diff --git a/docs/user-manual/api/branch-create.md b/docs/user-manual/api/branch-create.md new file mode 100644 index 00000000000..d4ce13cd959 --- /dev/null +++ b/docs/user-manual/api/branch-create.md @@ -0,0 +1,79 @@ +--- +title: Branches - Create branch +--- + +## Route URL + +```none +POST https://playcanvas.com/api/branches +``` + +## Description + +Create a new branch from an existing branch and optionally from a specific checkpoint. + +## Example + +```none +curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "name": "My New Branch", "sourceBranchId": "{sourceBranchId}"}' "https://playcanvas.com/api/branches" +``` + +HTTP Request + +```text +POST https://playcanvas.com/api/branches +Authorization: Bearer {accessToken} +Content-Type: application/json + +{ + "projectId": {projectId}, + "name": "My New Branch", + "sourceBranchId": "{sourceBranchId}" +} +``` + +## Parameters + +| Name | Type | Required | Description | +| ---------------------- | -------- | :------: | -------------------------------------------------------------------------------------------------------------------- | +| `name` | `string` | ✔️ | The name of the new branch. Must be non-empty and cannot exceed 1000 characters. | +| `projectId` | `number` | ✔️ | The id of the project. | +| `sourceBranchId` | `string` | ✔️ | The id of the branch to create the new branch from. | +| `sourceCheckpointId` | `string` | | The id of the checkpoint to create the new branch from. Must belong to the source branch. If not specified, the latest checkpoint of the source branch will be used. | + +## Response Schema + +```none +Status: 201 Created +``` + +```json +{ + "id": string, + "projectId": int, + "name": string, + "createdAt": date, + "closed": bool, + "permanent": bool, + "latestCheckpointId": string, + "user": { + "id": int, + "fullName": string, + "username": string + } +} +``` + +## Errors + +| Code | Description | +| ---- | -------------------------------------------------- | +| 400 | Invalid request / branch name already exists | +| 401 | Unauthorized | +| 403 | Forbidden | +| 404 | Project not found / Branch not found | +| 429 | Too many requests | + +## Rate Limiting + +This route uses a [normal](/user-manual/api#rate-limiting) rate limit. diff --git a/docs/user-manual/api/checkpoint-create.md b/docs/user-manual/api/checkpoint-create.md new file mode 100644 index 00000000000..79844b0f1d7 --- /dev/null +++ b/docs/user-manual/api/checkpoint-create.md @@ -0,0 +1,74 @@ +--- +title: Checkpoints - Create checkpoint +--- + +## Route URL + +```none +POST https://playcanvas.com/api/checkpoints +``` + +## Description + +Create a new checkpoint for a branch. A checkpoint captures the current state of a branch so that it can be restored later. + +## Example + +```none +curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "branchId": "{branchId}", "description": "My checkpoint"}' "https://playcanvas.com/api/checkpoints" +``` + +HTTP Request + +```text +POST https://playcanvas.com/api/checkpoints +Authorization: Bearer {accessToken} +Content-Type: application/json + +{ + "projectId": {projectId}, + "branchId": "{branchId}", + "description": "My checkpoint" +} +``` + +## Parameters + +| Name | Type | Required | Description | +| ------------- | -------- | :------: | -------------------------------------------------------------------------------- | +| `projectId` | `number` | ✔️ | The id of the project. | +| `branchId` | `string` | ✔️ | The id of the branch. | +| `description` | `string` | ✔️ | A description for the checkpoint. Must be non-empty and cannot exceed 10,000 characters. | + +## Response Schema + +```none +Status: 201 Created +``` + +```json +{ + "id": string, + "user": { + "id": int, + "fullName": string, + "username": string + }, + "createdAt": date, + "description": string +} +``` + +## Errors + +| Code | Description | +| ---- | ------------------ | +| 400 | Invalid request | +| 401 | Unauthorized | +| 403 | Forbidden | +| 404 | Project not found / Branch not found | +| 429 | Too many requests | + +## Rate Limiting + +This route uses a [normal](/user-manual/api#rate-limiting) rate limit. diff --git a/docs/user-manual/api/checkpoint-get.md b/docs/user-manual/api/checkpoint-get.md new file mode 100644 index 00000000000..e1436db6385 --- /dev/null +++ b/docs/user-manual/api/checkpoint-get.md @@ -0,0 +1,64 @@ +--- +title: Checkpoints - Get checkpoint +--- + +## Route URL + +```none +GET https://playcanvas.com/api/checkpoints/:id +``` + +## Description + +Get a checkpoint by its id. + +## Example + +```none +curl -H "Authorization: Bearer {accessToken}" "https://playcanvas.com/api/checkpoints/{id}" +``` + +HTTP Request + +```text +GET https://playcanvas.com/api/checkpoints/{id} +Authorization: Bearer {accessToken} +``` + +## Parameters + +| Name | Type | Description | +| ---- | -------- | ------------------------ | +| `id` | `string` | The id of the checkpoint. | + +## Response Schema + +```none +Status: 200 +``` + +```json +{ + "id": string, + "user": { + "id": int, + "fullName": string, + "username": string + }, + "createdAt": date, + "description": string +} +``` + +## Errors + +| Code | Description | +| ---- | -------------------- | +| 401 | Unauthorized | +| 403 | Forbidden | +| 404 | Checkpoint not found | +| 429 | Too many requests | + +## Rate Limiting + +This route uses a [normal](/user-manual/api#rate-limiting) rate limit. diff --git a/docs/user-manual/api/checkpoint-list.md b/docs/user-manual/api/checkpoint-list.md new file mode 100644 index 00000000000..3da089cdbb3 --- /dev/null +++ b/docs/user-manual/api/checkpoint-list.md @@ -0,0 +1,73 @@ +--- +title: Checkpoints - List checkpoints +--- + +## Route URL + +```none +GET https://playcanvas.com/api/branches/:branchId/checkpoints +``` + +## Description + +Get a list of checkpoints for a branch, sorted by newest first. + +## Example + +```none +curl -H "Authorization: Bearer {accessToken}" "https://playcanvas.com/api/branches/{branchId}/checkpoints" +``` + +HTTP Request + +```text +GET https://playcanvas.com/api/branches/{branchId}/checkpoints +Authorization: Bearer {accessToken} +``` + +## Parameters + +| Name | Type | Required | Description | +| ---------- | -------- | :------: | ----------------------------------------------------------------------------------------------------- | +| `branchId` | `string` | ✔️ | The id of the branch. | +| `limit` | `number` | | The maximum number of checkpoints to return. Cannot exceed 50. | +| `skip` | `string` | | A checkpoint id. The result will only contain checkpoints that were created before this checkpoint. | + +## Response Schema + +```none +Status: 200 +``` + +```json +{ + "result": [{ + "id": string, + "user": { + "id": int, + "fullName": string, + "username": string + }, + "createdAt": date, + "description": string + }, ...], + "pagination": { + "hasMore": bool + } +} +``` + +This endpoint uses a slightly different pagination method. If a response contains the value `hasMore: true` then additional results are available. Use the `skip` query parameter with the id of the last received checkpoint to receive more results. + +## Errors + +| Code | Description | +| ---- | ----------------- | +| 401 | Unauthorized | +| 403 | Forbidden | +| 404 | Branch not found | +| 429 | Too many requests | + +## Rate Limiting + +This route uses a [normal](/user-manual/api#rate-limiting) rate limit. diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/branch-create.md b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/branch-create.md new file mode 100644 index 00000000000..6d86745295a --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/branch-create.md @@ -0,0 +1,79 @@ +--- +title: ブランチ - Create branch +--- + +## ルートURL + +```none +POST https://playcanvas.com/api/branches +``` + +## 説明 + +既存のブランチから、オプションで特定のチェックポイントを指定して、新しいブランチを作成します。 + +## 例 + +```none +curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "name": "My New Branch", "sourceBranchId": "{sourceBranchId}"}' "https://playcanvas.com/api/branches" +``` + +HTTP リクエスト + +```text +POST https://playcanvas.com/api/branches +Authorization: Bearer {accessToken} +Content-Type: application/json + +{ + "projectId": {projectId}, + "name": "My New Branch", + "sourceBranchId": "{sourceBranchId}" +} +``` + +## パラメーター + +| 名前 | タイプ | Required | 説明 | +| ---------------------- | -------- | :------: | -------------------------------------------------------------------------------------------------------------------- | +| `name` | `string` | ✔️ | The name of the new branch. Must be non-empty and cannot exceed 1000 characters. | +| `projectId` | `number` | ✔️ | The id of the project. | +| `sourceBranchId` | `string` | ✔️ | The id of the branch to create the new branch from. | +| `sourceCheckpointId` | `string` | | The id of the checkpoint to create the new branch from. Must belong to the source branch. If not specified, the latest checkpoint of the source branch will be used. | + +## レスポンススキーマ + +```none +ステータス: 201 Created +``` + +```json +{ + "id": string, + "projectId": int, + "name": string, + "createdAt": date, + "closed": bool, + "permanent": bool, + "latestCheckpointId": string, + "user": { + "id": int, + "fullName": string, + "username": string + } +} +``` + +## エラー + +| コード | 説明 | +| ---- | -------------------------------------------------- | +| 400 | Invalid request / branch name already exists | +| 401 | Unauthorized | +| 403 | Forbidden | +| 404 | Project not found / Branch not found | +| 429 | Too many requests | + +## レート制限 + +このルートは[通常](/user-manual/api#rate-limiting)のレート制限を使用します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-create.md b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-create.md new file mode 100644 index 00000000000..9b82586e745 --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-create.md @@ -0,0 +1,74 @@ +--- +title: チェックポイント - Create checkpoint +--- + +## ルートURL + +```none +POST https://playcanvas.com/api/checkpoints +``` + +## 説明 + +ブランチの新しいチェックポイントを作成します。チェックポイントはブランチの現在の状態をキャプチャし、後で復元できるようにします。 + +## 例 + +```none +curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "branchId": "{branchId}", "description": "My checkpoint"}' "https://playcanvas.com/api/checkpoints" +``` + +HTTP リクエスト + +```text +POST https://playcanvas.com/api/checkpoints +Authorization: Bearer {accessToken} +Content-Type: application/json + +{ + "projectId": {projectId}, + "branchId": "{branchId}", + "description": "My checkpoint" +} +``` + +## パラメーター + +| 名前 | タイプ | Required | 説明 | +| ------------- | -------- | :------: | -------------------------------------------------------------------------------- | +| `projectId` | `number` | ✔️ | The id of the project. | +| `branchId` | `string` | ✔️ | The id of the branch. | +| `description` | `string` | ✔️ | A description for the checkpoint. Must be non-empty and cannot exceed 10,000 characters. | + +## レスポンススキーマ + +```none +ステータス: 201 Created +``` + +```json +{ + "id": string, + "user": { + "id": int, + "fullName": string, + "username": string + }, + "createdAt": date, + "description": string +} +``` + +## エラー + +| コード | 説明 | +| ---- | ------------------ | +| 400 | Invalid request | +| 401 | Unauthorized | +| 403 | Forbidden | +| 404 | Project not found / Branch not found | +| 429 | Too many requests | + +## レート制限 + +このルートは[通常](/user-manual/api#rate-limiting)のレート制限を使用します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-get.md b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-get.md new file mode 100644 index 00000000000..b7634906a95 --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-get.md @@ -0,0 +1,64 @@ +--- +title: チェックポイント - Get checkpoint +--- + +## ルートURL + +```none +GET https://playcanvas.com/api/checkpoints/:id +``` + +## 説明 + +IDを指定してチェックポイントを取得します。 + +## 例 + +```none +curl -H "Authorization: Bearer {accessToken}" "https://playcanvas.com/api/checkpoints/{id}" +``` + +HTTP リクエスト + +```text +GET https://playcanvas.com/api/checkpoints/{id} +Authorization: Bearer {accessToken} +``` + +## パラメーター + +| 名前 | タイプ | 説明 | +| ---- | -------- | ------------------------ | +| `id` | `string` | The id of the checkpoint. | + +## レスポンススキーマ + +```none +ステータス: 200 +``` + +```json +{ + "id": string, + "user": { + "id": int, + "fullName": string, + "username": string + }, + "createdAt": date, + "description": string +} +``` + +## エラー + +| コード | 説明 | +| ---- | -------------------- | +| 401 | Unauthorized | +| 403 | Forbidden | +| 404 | Checkpoint not found | +| 429 | Too many requests | + +## レート制限 + +このルートは[通常](/user-manual/api#rate-limiting)のレート制限を使用します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-list.md b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-list.md new file mode 100644 index 00000000000..19a43800e41 --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/api/checkpoint-list.md @@ -0,0 +1,73 @@ +--- +title: チェックポイント - List checkpoints +--- + +## ルートURL + +```none +GET https://playcanvas.com/api/branches/:branchId/checkpoints +``` + +## 説明 + +ブランチのチェックポイントのリストを新しい順に取得します。 + +## 例 + +```none +curl -H "Authorization: Bearer {accessToken}" "https://playcanvas.com/api/branches/{branchId}/checkpoints" +``` + +HTTP リクエスト + +```text +GET https://playcanvas.com/api/branches/{branchId}/checkpoints +Authorization: Bearer {accessToken} +``` + +## パラメーター + +| 名前 | タイプ | Required | 説明 | +| ---------- | -------- | :------: | ----------------------------------------------------------------------------------------------------- | +| `branchId` | `string` | ✔️ | The id of the branch. | +| `limit` | `number` | | The maximum number of checkpoints to return. Cannot exceed 50. | +| `skip` | `string` | | A checkpoint id. The result will only contain checkpoints that were created before this checkpoint. | + +## レスポンススキーマ + +```none +ステータス: 200 +``` + +```json +{ + "result": [{ + "id": string, + "user": { + "id": int, + "fullName": string, + "username": string + }, + "createdAt": date, + "description": string + }, ...], + "pagination": { + "hasMore": bool + } +} +``` + +このエンドポイントは、若干異なるページネーション方法を使用しています。レスポンスが `hasMore: true` の場合、追加の結果が利用可能です。最後に受信したチェックポイントのIDとともに `skip` クエリパラメーターを使用して、さらに結果を取得できます。 + +## エラー + +| コード | 説明 | +| ---- | ----------------- | +| 401 | Unauthorized | +| 403 | Forbidden | +| 404 | Branch not found | +| 429 | Too many requests | + +## レート制限 + +このルートは[通常](/user-manual/api#rate-limiting)のレート制限を使用します。 diff --git a/sidebars.js b/sidebars.js index f6e0f0af37d..7f29e5f3c5c 100644 --- a/sidebars.js +++ b/sidebars.js @@ -1016,7 +1016,11 @@ const sidebars = { 'user-manual/api/asset-get', 'user-manual/api/asset-list', 'user-manual/api/asset-update', + 'user-manual/api/branch-create', 'user-manual/api/branch-list', + 'user-manual/api/checkpoint-create', + 'user-manual/api/checkpoint-get', + 'user-manual/api/checkpoint-list', 'user-manual/api/job-get', 'user-manual/api/project-archive', 'user-manual/api/scene-list',