@civitai/orchestration-client 0.2.2 → 0.2.4
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/generated/index.d.ts +34 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +15 -1
- package/dist/generated/sdk.gen.js +15 -1
- package/dist/generated/services.gen.d.ts +3414 -0
- package/dist/generated/services.gen.js +405 -0
- package/dist/generated/types.gen.d.ts +689 -358
- package/dist/generated/types.gen.js +7 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/services.d.ts +31 -0
- package/dist/utils/services.js +36 -0
- package/package.json +2 -2
|
@@ -123,7 +123,7 @@ export const FileFormat = {
|
|
|
123
123
|
ONNX: 'onnx',
|
|
124
124
|
TAR: 'tar',
|
|
125
125
|
};
|
|
126
|
-
export const GeminiOmniModel = { '1_1_FLASH': '1.1-flash' };
|
|
126
|
+
export const GeminiOmniModel = { '1_1_FLASH': '1.1-flash', '1_2_FLASH': '1.2-flash' };
|
|
127
127
|
export const GeminiOmniResolution = {
|
|
128
128
|
'360P': '360p',
|
|
129
129
|
'720P': '720p',
|
|
@@ -163,6 +163,8 @@ export const ImageGenOutputFormat = {
|
|
|
163
163
|
JPEG: 'jpeg',
|
|
164
164
|
PNG: 'png',
|
|
165
165
|
WEB_P: 'webP',
|
|
166
|
+
GIF: 'gif',
|
|
167
|
+
SVG: 'svg',
|
|
166
168
|
};
|
|
167
169
|
export const ImageResouceTrainingModerationStatus = {
|
|
168
170
|
EVALUATING: 'evaluating',
|
|
@@ -306,6 +308,8 @@ export const ModelClamScanStatus = {
|
|
|
306
308
|
INFECTED: 'infected',
|
|
307
309
|
TIMEOUT: 'timeout',
|
|
308
310
|
ERROR: 'error',
|
|
311
|
+
ENCRYPTED: 'encrypted',
|
|
312
|
+
LIMITS_EXCEEDED: 'limitsExceeded',
|
|
309
313
|
};
|
|
310
314
|
export const ModelPickleScanStatus = {
|
|
311
315
|
CLEAN: 'clean',
|
|
@@ -412,6 +416,7 @@ export const SeedreamVersion = {
|
|
|
412
416
|
V4_5: 'v4.5',
|
|
413
417
|
V5_0_LITE: 'v5.0-lite',
|
|
414
418
|
V5_0_PRO: 'v5.0-pro',
|
|
419
|
+
V5_5: 'v5.5',
|
|
415
420
|
};
|
|
416
421
|
export const ServiceStatus = {
|
|
417
422
|
UNKNOWN: 'unknown',
|
|
@@ -488,6 +493,7 @@ export const WorkflowStatus = {
|
|
|
488
493
|
export const WorkflowStepWarningCode = {
|
|
489
494
|
MODEL_DEPRECATED: 'modelDeprecated',
|
|
490
495
|
FIELD_DEPRECATED: 'fieldDeprecated',
|
|
496
|
+
FIELD_IGNORED: 'fieldIgnored',
|
|
491
497
|
};
|
|
492
498
|
/**
|
|
493
499
|
* How a workflow is paid for.
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ServiceCategory,
|
|
3
|
+
type ServiceHosting,
|
|
4
|
+
type ServiceName,
|
|
5
|
+
} from '../generated/services.gen.js';
|
|
6
|
+
export type ServiceInfo = {
|
|
7
|
+
name: ServiceName;
|
|
8
|
+
category: ServiceCategory;
|
|
9
|
+
hosting: ServiceHosting;
|
|
10
|
+
/** WorkflowStep `$type` this input is used with. */
|
|
11
|
+
stepType?: string;
|
|
12
|
+
/** Discriminator values on the input that select this schema (e.g. engine/model/operation). */
|
|
13
|
+
discriminators: Readonly<Record<string, string>>;
|
|
14
|
+
};
|
|
15
|
+
type StepLike = {
|
|
16
|
+
$type?: string;
|
|
17
|
+
input?: unknown;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the service (category + hosting) a workflow step will run on, based on its
|
|
21
|
+
* `$type` and the discriminator values in its input (engine, model, operation, ...).
|
|
22
|
+
* Returns the most specific match, or undefined when the step isn't in the catalog.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* getServiceInfo({ $type: 'imageGen', input: { engine: 'flux2', model: 'pro', operation: 'createImage' } })
|
|
26
|
+
* // => { name: 'Flux2ProCreateImageInput', category: 'image', hosting: 'partner', ... }
|
|
27
|
+
*/
|
|
28
|
+
export declare function getServiceInfo(step: StepLike): ServiceInfo | undefined;
|
|
29
|
+
export declare function getServiceHosting(step: StepLike): ServiceHosting | undefined;
|
|
30
|
+
export declare function isPartnerService(step: StepLike): boolean;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { services, } from '../generated/services.gen.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the service (category + hosting) a workflow step will run on, based on its
|
|
4
|
+
* `$type` and the discriminator values in its input (engine, model, operation, ...).
|
|
5
|
+
* Returns the most specific match, or undefined when the step isn't in the catalog.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* getServiceInfo({ $type: 'imageGen', input: { engine: 'flux2', model: 'pro', operation: 'createImage' } })
|
|
9
|
+
* // => { name: 'Flux2ProCreateImageInput', category: 'image', hosting: 'partner', ... }
|
|
10
|
+
*/
|
|
11
|
+
export function getServiceInfo(step) {
|
|
12
|
+
var _a;
|
|
13
|
+
if (!step.$type)
|
|
14
|
+
return undefined;
|
|
15
|
+
const input = ((_a = step.input) !== null && _a !== void 0 ? _a : {});
|
|
16
|
+
let best;
|
|
17
|
+
for (const [name, entry] of Object.entries(services)) {
|
|
18
|
+
const [category, hosting, stepType, discriminators = {}] = entry;
|
|
19
|
+
if (stepType !== step.$type)
|
|
20
|
+
continue;
|
|
21
|
+
const pairs = Object.entries(discriminators);
|
|
22
|
+
if (!pairs.every(([key, value]) => input[key] === value))
|
|
23
|
+
continue;
|
|
24
|
+
if (!best || pairs.length > Object.keys(best.discriminators).length) {
|
|
25
|
+
best = { name, category, hosting, stepType, discriminators };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return best;
|
|
29
|
+
}
|
|
30
|
+
export function getServiceHosting(step) {
|
|
31
|
+
var _a;
|
|
32
|
+
return (_a = getServiceInfo(step)) === null || _a === void 0 ? void 0 : _a.hosting;
|
|
33
|
+
}
|
|
34
|
+
export function isPartnerService(step) {
|
|
35
|
+
return getServiceHosting(step) === 'partner';
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civitai/orchestration-client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Civitai's javascript client for generating ai content",
|
|
5
5
|
"packageManager": "pnpm@10.34.4",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"yarn": ">=1.7.0"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"generate": "openapi-ts && node scripts/fix-discriminators.mjs",
|
|
28
|
+
"generate": "openapi-ts && node scripts/fix-discriminators.mjs && node scripts/generate-services.mjs",
|
|
29
29
|
"build": "tsc && eslint --fix dist",
|
|
30
30
|
"test": "jest",
|
|
31
31
|
"prepublishOnly": "pnpm test && pnpm build",
|