@civitai/sdk 0.5.0 → 0.6.0
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/orchestration/index.d.ts +2 -0
- package/dist/orchestration/index.js +5 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { SCOPES } from './session/index.js';
|
|
|
10
10
|
export type { GrantOptions, Scope, TokenOptions, TokenSource } from './session/index.js';
|
|
11
11
|
export type { SiteClient } from './site/index.js';
|
|
12
12
|
export type { StorageCallOptions, StorageClient, StorageKeyEntry, StorageListQuery, StorageListResult, StorageQuota, } from './storage/index.js';
|
|
13
|
-
export { isTerminal } from './orchestration/index.js';
|
|
13
|
+
export { isTerminal, isTerminalStatus } from './orchestration/index.js';
|
|
14
14
|
export type { OrchestrationClient, Step, StepTemplate, WaitOptions, Workflow, WorkflowPage, WorkflowQuery, WorkflowStatus, WorkflowTemplate, } from './orchestration/index.js';
|
|
15
15
|
export { createHost } from './host/index.js';
|
|
16
16
|
export type { ConsentRefusal, DownloadRequest, Host, HostCallOptions, ImageScanResult, PendingImage, PickedResource, ResourcePickerType, SourceImage, UploadedImage, } from './host/index.js';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export { initialize } from './app/index.js';
|
|
6
6
|
export { createSignIn, SignInError } from './sign-in/index.js';
|
|
7
7
|
export { SCOPES } from './session/index.js';
|
|
8
|
-
export { isTerminal } from './orchestration/index.js';
|
|
8
|
+
export { isTerminal, isTerminalStatus } from './orchestration/index.js';
|
|
9
9
|
export { createHost } from './host/index.js';
|
|
10
10
|
export { ApiError } from './http/index.js';
|
|
11
11
|
export { BridgeError, CivitaiError } from './core/errors.js';
|
|
@@ -50,4 +50,6 @@ export interface OrchestrationClient {
|
|
|
50
50
|
queryWorkflows(query?: WorkflowQuery, opts?: CallOptions): Promise<WorkflowPage>;
|
|
51
51
|
}
|
|
52
52
|
export declare function isTerminal(workflow: Workflow): boolean;
|
|
53
|
+
/** True once nothing more will happen to a workflow, or to one of its steps. */
|
|
54
|
+
export declare function isTerminalStatus(status: WorkflowStatus): boolean;
|
|
53
55
|
export declare function createOrchestrationClient(http: Http): OrchestrationClient;
|
|
@@ -12,7 +12,11 @@ const HELD_READ_SECONDS = 20;
|
|
|
12
12
|
/** Waits between consecutive failed reads while watching; a success resets it. */
|
|
13
13
|
const RETRY_BACKOFF_MS = [250, 1_000, 4_000];
|
|
14
14
|
export function isTerminal(workflow) {
|
|
15
|
-
return
|
|
15
|
+
return isTerminalStatus(workflow.status);
|
|
16
|
+
}
|
|
17
|
+
/** True once nothing more will happen to a workflow, or to one of its steps. */
|
|
18
|
+
export function isTerminalStatus(status) {
|
|
19
|
+
return TERMINAL.has(status);
|
|
16
20
|
}
|
|
17
21
|
export function createOrchestrationClient(http) {
|
|
18
22
|
const getWorkflow = (workflowId, { wait, until, signal } = {}) => http('GET', `${WORKFLOWS}/${encodeURIComponent(workflowId)}`, {
|
package/package.json
CHANGED