@sogni-ai/sogni-client 5.60.0 → 5.60.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +13 -2
- package/dist/ApiClient/WebSocketClient/events.d.ts +2 -0
- package/dist/ApiClient/index.d.ts +1 -0
- package/dist/ApiClient/index.js +10 -1
- package/dist/ApiClient/index.js.map +1 -1
- package/dist/Projects/index.d.ts +12 -0
- package/dist/Projects/index.js +15 -0
- package/dist/Projects/index.js.map +1 -1
- package/dist/types/ErrorData.d.ts +2 -0
- package/dist/types/ErrorData.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist-esm/ApiClient/index.js +10 -1
- package/dist-esm/ApiClient/index.js.map +1 -1
- package/dist-esm/Projects/index.js +15 -0
- package/dist-esm/Projects/index.js.map +1 -1
- package/dist-esm/types/ErrorData.js.map +1 -1
- package/dist-esm/version.js +1 -1
- package/package.json +3 -1
- package/src/ApiClient/WebSocketClient/events.ts +2 -0
- package/src/ApiClient/index.ts +10 -1
- package/src/Projects/index.ts +15 -0
- package/src/types/ErrorData.ts +8 -0
- package/src/version.ts +1 -1
package/src/Projects/index.ts
CHANGED
|
@@ -1104,6 +1104,9 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
1104
1104
|
message: data.error_message
|
|
1105
1105
|
};
|
|
1106
1106
|
}
|
|
1107
|
+
if (data.vendorFailureCategory) {
|
|
1108
|
+
error.vendorFailureCategory = data.vendorFailureCategory;
|
|
1109
|
+
}
|
|
1107
1110
|
if (data.subscriptionLimit) {
|
|
1108
1111
|
error.subscriptionLimit = true;
|
|
1109
1112
|
if (data.requiredPlans) error.requiredPlans = data.requiredPlans;
|
|
@@ -2566,6 +2569,10 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
2566
2569
|
* A project that belongs to another account, or does not exist, rejects with a
|
|
2567
2570
|
* 404 `ApiError`; a 503 means the server could not determine the state yet and
|
|
2568
2571
|
* the call can be retried.
|
|
2572
|
+
*
|
|
2573
|
+
* A one-off read, not a way to wait: a tracked project settles over the
|
|
2574
|
+
* socket (`project.waitForCompletion()`), and polling this spends the
|
|
2575
|
+
* account's per-IP rate limit. On a 429 wait `ApiError.retryAfter` seconds.
|
|
2569
2576
|
* @param projectId
|
|
2570
2577
|
*/
|
|
2571
2578
|
async getStatus(projectId: string): Promise<ProjectStatusSnapshot> {
|
|
@@ -2587,6 +2594,14 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
2587
2594
|
* waiting for a worker. Needs an authenticated client; another account's or
|
|
2588
2595
|
* an unknown project rejects with a 404 `ApiError`.
|
|
2589
2596
|
*
|
|
2597
|
+
* Not for waiting on a project: never call it in a loop until it finishes.
|
|
2598
|
+
* A tracked project settles over the socket (`project.waitForCompletion()`
|
|
2599
|
+
* and its events) with no requests; after a restart, connect with the same
|
|
2600
|
+
* `appId` and `projects.sync()` hands its projects back (`resolveMissing()`
|
|
2601
|
+
* covers ids it no longer holds). Each call is a REST request against the
|
|
2602
|
+
* account's per-IP rate limit, plus one signed-URL request per completed
|
|
2603
|
+
* job. A 429 `ApiError` carries `retryAfter` (seconds): wait that long.
|
|
2604
|
+
*
|
|
2590
2605
|
* @example
|
|
2591
2606
|
* ```ts
|
|
2592
2607
|
* const result = await sogni.projects.getResult(projectId);
|
package/src/types/ErrorData.ts
CHANGED
|
@@ -4,6 +4,14 @@ interface ErrorData {
|
|
|
4
4
|
code: number;
|
|
5
5
|
originalCode?: string;
|
|
6
6
|
message: string;
|
|
7
|
+
/** Coarse server-reported cause of an external generation failure. */
|
|
8
|
+
vendorFailureCategory?:
|
|
9
|
+
| 'content_policy'
|
|
10
|
+
| 'input_validation'
|
|
11
|
+
| 'timeout'
|
|
12
|
+
| 'result_storage'
|
|
13
|
+
| 'cancelled'
|
|
14
|
+
| 'vendor_failed';
|
|
7
15
|
/**
|
|
8
16
|
* Discriminator set to `true` when this render-path error is a subscription
|
|
9
17
|
* FEATURE-gate denial (socket error code 4081). The four fields below are
|
package/src/version.ts
CHANGED