Skip to content

Commit

Permalink
Merge pull request #9 from saasus-platform/feature/en_doc_create
Browse files Browse the repository at this point in the history
Add English document
  • Loading branch information
yutomoriyasu authored Feb 11, 2023
2 parents 474f79e + 041771c commit 07607fb
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 9 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# PHP SaaSus SDK
# PHP SDK for SaaSus Platform

[English page is here.](./README_en.md)

---

Expand All @@ -18,7 +20,7 @@ composer require saasus-platform/saasus-sdk-php

### 環境変数を定義

```
```ini
### for SaaSus Platform
SAASUS_SAAS_ID="(画面のSaaS ID)"
SAASUS_API_KEY="(画面のAPI KEY)"
Expand All @@ -27,13 +29,13 @@ SAASUS_LOGIN_URL="https://auth.sample.saasus.jp/ (ログイン画面のURL
```

SAASUS_SAAS_ID, SAASUS_API_KEY, SAASUS_SECRET_KEY は SaaS 開発コンソール画面に表示されている SaaS ID、 API キー  と クライアントシークレットを、
SAASUS_LOGIN_URL は、SaaSus コンソールで作成したログイン画面の URL を設定します。
SAASUS_LOGIN_URL は、SaaS 開発コンソールで作成したログイン画面の URL を設定します。

### 認証モジュールの組み込み

api/routes/web.php

```
```php
// SaaSus SDK標準のAuth Middlewareを利用する
Route::middleware(\AntiPatternInc\Saasus\Laravel\Middleware\Auth::class)->group(function () {
// 固有のロジックを記載する
Expand All @@ -60,6 +62,6 @@ Route::middleware(\AntiPatternInc\Saasus\Laravel\Middleware\Auth::class)->group(

---

# ユースケースサンプル
## ユースケースサンプル

準備中・・・
67 changes: 67 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# PHP SDK for SaaSus Platform

[Japanese page is here.](./README.md)

---

## Preparing to use the SDK

### Set Up

```
composer config repositories.saasus-platform/saasus-sdk-php vcs https://github.com/saasus-platform/saasus-sdk-php
```

### Added SDK

```
composer require saasus-platform/saasus-sdk-php
```

### Define Environment Variables

```ini
### for SaaSus Platform
SAASUS_SAAS_ID="(SaaS ID on Screen)"
SAASUS_API_KEY="(API KEY on Screen)"
SAASUS_SECRET_KEY="(Client Secret on Screen)"
SAASUS_LOGIN_URL="https://auth.sample.saasus.jp/ (Login Screen URL)"
```

SAASUS_SAAS_ID, SAASUS_API_KEY, SAASUS_SECRET_KEY are the SaaS ID, API key and client secret displayed on the SaaS development console screen,
SAASUS_LOGIN_URL sets the URL of the login screen created in the SaaS development console.

### Incorporating the authentication module

api/routes/web.php

```php
// Use Auth Middleware of SaaSus SDK standard
Route::middleware(\AntiPatternInc\Saasus\Laravel\Middleware\Auth::class)->group(function () {
// Write your own logic

Route::redirect('/', '/xxxxxx');
});
```

---

## PHP SDK

- [Auth](./generated/Auth/README_en.md)

It is used for referencing/updating user information, basic information, authentication information, tenant information, role information, etc.

- [Pricing](./generated/Pricing/README_en.md)

It is used to refer to and update information related to charges, such as pricing units, function menus, charge plans, and metering unit counts.

- [Billing](./generated/Billing/README_en.md)

It is used for referencing/updating information related to external SaaS used in billing operations.

---

## Use Case Sample

In Preparation···
8 changes: 4 additions & 4 deletions generated/Auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
## 認証情報

- GetAuthInfo ・・・認証情報を取得
- UpdateAuthInfo ・・・認証情報を更
- UpdateAuthInfo ・・・認証情報を更新
- GetSignInSettings ・・・パスワード要件を取得
- UpdateSignInSettings ・・・パスワード要件を更新

Expand Down Expand Up @@ -52,10 +52,10 @@

- GetTenantUsers ・・・テナントのユーザー一覧を取得

- GetTenantUse ・・・テナントのユーザー情報を取得
- GetTenantUser ・・・テナントのユーザー情報を取得
- CreateTenantUser ・・・テナントにユーザーを作成

- UpdateTenantUser ・・・テナントのユーザー属性情報を更新
- UpdateTenantUser ・・・テナントのユーザー情報を更新
- DeleteTenantUser ・・・テナントのユーザー情報を削除

- CreateTenantUserRoles ・・・テナントのユーザー情報に役割(ロール)を作成
Expand Down Expand Up @@ -89,7 +89,7 @@

## SaaSus 情報

- GetApiKeys ・・・API キー一覧を取
- GetApiKeys ・・・API キー一覧を取得
- CreateApiKey ・・・API キーを作成
- DeleteApiKey ・・・API キーを削除
- GetSaasId ・・・SaasID を取得
Expand Down
112 changes: 112 additions & 0 deletions generated/Auth/README_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Auth

For details (arguments, return values), [refer to the API document](https://docs.saasus.io/reference/getuserinfo)

## User Info

- GetUserInfo ... Get User Info

## Basic Configuration

- GetBasicInfo ... Get Basic Configurations
- UpdateBasicInfo ... Update Basic Configurations

- FindNotificationMessages ... Get Notification Email Templates
- UpdateNotificationMessages ... Update Notification Email Template

- GetCustomizePages ... Get Authentication Page Setting
- UpdateCustomizePages ... Authentication Page Setting

- GetCustomizePageSettings ... Get Authentication Authorization Basic Information
- UpdateCustomizePageSettings ... Update Authentication Authorization Basic Information

## Authentication Info

- GetAuthInfo ... Get Authentication Info
- UpdateAuthInfo ... Update Authentication Info
- GetSignInSettings ... Get Password Requirements
- UpdateSignInSettings ... Update Password Requirements

## SaaS User Info

- GetSaasUsers ... Get Users

- GetSaasUser ... Get User
- CreateSaasUser ... Create SaaS User
- DeleteSaasUser ... Delete User

- UpdateSaasUserPassword ... Change Password

- UpdateSaasUserEmail ... Change Email

- CreateSecretCode ... Creates secret code for authentication application registration
- UpdateSoftwareToken ... Register Authentication Application

- GetUserMfaPreference ... Get User's MFA Settings
- UpdateUserMfaPreference ... Update User's MFA Settings

### Tenant User Info

- GetAllTenantUsers ... Get Users
- GetAllTenantUser ... Get User Info

- GetTenantUsers ... Get Tenant Users

- GetTenantUser ... Get Tenant User
- CreateTenantUser ... Create Tenant User

- UpdateTenantUser ... Update Tenant User
- DeleteTenantUser ... Delete Tenant User

- CreateTenantUserRoles ... Create Tenant User Role
- DeleteTenantUserRole ... Delete Role From Tenant User

## Role Info

- GetRoles ... Get Roles
- CreateRole ... Create Role
- DeleteRole ... Delete Role

## User Attribute

- GetUserAttributes ... Get User Attributes
- CreateUserAttribute ... Create User Attributes
- DeleteUserAttribute ... Delete User Attribute

## Tenant Attribute

- GetTenantAttributes ... Get Tenant Attributes
- CreateTenantAttribute ... Create Tenant Attribute
- DeleteTenantAttribute ... Delete Tenant Attribute

## Tenant Info

- GetTenants ... Get Tenants
- GetTenant ... Get Tenant Details
- CreateTenant ... Create Tenant
- UpdateTenant ... Update Tenant Details
- DeleteTenant ... Delete Tenant

## SaaSus Info

- GetApiKeys ... Get API Keys
- CreateApiKey ... Create API Key
- DeleteApiKey ... Delete API Key
- GetSaasId ... Get SaasID
- UpdateSaasId ... Update SaasID
- GetClientSecret ... Get Client Secret
- UpdateClientSecret ... Update Client Secret

## Env Info

- GetEnvs ... Get Env Info

- GetEnv ... Get Env Details
- CreateEnv ... Create Env Info
- UpdateEnv ... Update Env Info
- DeleteEnv ... Delete Env Info

## Authentication/Authorization Info

- GetAuthCredentials ... Get Authentication/Authorization Information
- CreateAuthCredentials ... Save Authentication/Authorization Information
9 changes: 9 additions & 0 deletions generated/Billing/README_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Billing

For details (arguments, return values), [refer to the API document](https://docs.saasus.io/reference/getstripeinfo)

## Working with stripe resource

- GetStripeInfo ... Get Stripe Connection information
- UpdateStripeInfo ... Update Stripe Connection Info
- DeleteStripeInfo ... Delete Stripe Connection
39 changes: 39 additions & 0 deletions generated/Pricing/README_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Pricing

For details (arguments, return values), [refer to the API document](https://docs.saasus.io/reference/getpricingunits)

## Pricing Unit

- GetPricingUnits ... Get Pricing Units

- GetPricingUnit ... Get Pricing Unit
- CreatePricingUnit ... Create Pricing Unit

## Pricing Feature Menu

- GetPricingMenus ... Get Pricing Feature Menus

- GetPricingMenu ... Create a Pricing Feature Menu
- CreatePricingMenu ... Get Pricing Feature Menu

## Pricing Plan

- GetPricingPlans ... Get Pricing Plans

- GetPricingPlan ... Create Pricing Plan
- CreatePricingPlan ... Get Pricing Plan

## Metering

- GetMeteringUnitDateCountByTenantIdAndUnitNameAndDate ... Get Metering Unit Count for Specific Date
- UpdateMeteringUnitTimestampCount ... Update Metering Unit Count for Specified Timestamp
- DeleteMeteringUnitTimestampCount ... Delete Metering Unit Count for Specified Timestamp

- GetMeteringUnitDateCountByTenantIdAndUnitNameToday ... Get Metering Unit Count for the Current Day
- UpdateMeteringUnitTimestampCountNow ... Update Metering Unit Count for Current Time

- GetMeteringUnitMonthCountByTenantIdAndUnitNameThisMonth ... Get Metering Unit Count for the Current Month
- GetMeteringUnitMonthCountByTenantIdAndUnitNameAndMonth ... Get the Metering Unit Count for the Specified Month

- GetMeteringUnitDateCountsByTenantIdAndDate ... Get All Metering Unit Counts for a Specified Date
- GetMeteringUnitMonthCountsByTenantIdAndMonth ... Get All Metering Unit Counts for the Specified Month

0 comments on commit 07607fb

Please sign in to comment.