@civitai/app-sdk 0.80.0 → 0.81.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/README.md +10 -6
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/messages.d.ts +1 -0
- package/dist/blocks/scopes.d.ts +1 -0
- package/dist/blocks/scopes.js +5 -0
- package/dist/blocks/types.d.ts +118 -5
- package/dist/blocks/types.js +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/manifest/defineBlock.d.ts +1 -0
- package/dist/manifest/defineBlock.js +12 -2
- package/dist/manifest/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/app-block/v1.json +102 -13
package/README.md
CHANGED
|
@@ -575,7 +575,7 @@ The reason codes are a closed set, in this order:
|
|
|
575
575
|
| `code` | Fires when | Extra fields |
|
|
576
576
|
|---|---|---|
|
|
577
577
|
| `not-api-format` | the entry is not ComfyUI API format (`format` is `ui` or `unknown`, or the graph does not have API shape). The next three are then not checked. | `format` |
|
|
578
|
-
| `custom-nodes` | a node class is outside the core list (API graphs, and the node lists of UI graphs and their subgraphs) | `classes
|
|
578
|
+
| `custom-nodes` | a node class is outside the core list (API graphs, and the node lists of UI graphs and their subgraphs) | `classes` (the complete list of offending classes), `packs` (partial: only the `properties.cnr_id` values present on those nodes in the file, so UI graphs only, and a node saved without one adds no pack) |
|
|
579
579
|
| `model-filenames` | a loader input (`*_name`, e.g. `ckpt_name`, `unet_name`, `lora_name`, `vae_name`, `clip_name`, `control_net_name`; plus `model_file`, `text_encoder`; plus `name` on `ModelPatchLoader` and `existing_lora` on `TrainLoraNode`) holds a model filename (`.safetensors`, `.ckpt`, `.pt`, `.pth`, `.bin`, `.gguf`, …) rather than an AIR (`urn:air:…`) | `inputs` (`nodeId`, `classType`, `input`, `value`) |
|
|
580
580
|
| `too-many-nodes` | more than `BLOCK_INLINE_COMFY_MAX_NODES` (300) nodes | `nodes`, `max` |
|
|
581
581
|
| `too-large` | the graph as sent (each node reduced to `class_type` + `inputs`) serializes to more than `BLOCK_INLINE_COMFY_MAX_GRAPH_BYTES` (262144) | `bytes`, `max` |
|
|
@@ -596,14 +596,18 @@ that uses one gets `runnable: true` here and can still fail on the worker. The e
|
|
|
596
596
|
succeed: the worker image decides which nodes exist, and the host still runs its
|
|
597
597
|
AIR-containment, entitlement and moderation gates on the body you submit.
|
|
598
598
|
|
|
599
|
-
Before you submit, two host limits this check does not cover
|
|
599
|
+
Before you submit, two host limits this check does not cover (the second only
|
|
600
|
+
on one path):
|
|
600
601
|
- **Strip per-node extras.** The host's node schema is strict: a node carrying
|
|
601
602
|
anything besides `class_type` and `inputs` (an export's `_meta`, for
|
|
602
603
|
instance) is rejected. `too-large` already measures the graph without them.
|
|
603
|
-
- **
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
604
|
+
- **Calling the REST routes directly caps the whole request at 256 KB of
|
|
605
|
+
UTF-8.** If you call `POST /api/v1/blocks/workflows/estimate` or `/submit`
|
|
606
|
+
yourself with a block token, a larger body is refused with a 413. That body
|
|
607
|
+
holds `resources`, `prompt` and the rest as well as the graph, so a graph
|
|
608
|
+
just under `BLOCK_INLINE_COMFY_MAX_GRAPH_BYTES` can still be refused there.
|
|
609
|
+
A page app using the hooks goes through the host bridge instead, which has
|
|
610
|
+
no such 256 KB request cap; the graph cap itself still applies.
|
|
607
611
|
|
|
608
612
|
🔴 **A Comfy estimate is a ceiling, never a price.** Estimating a `customComfy`
|
|
609
613
|
body returns your `maxBuzz` as `cost.total`, and billing settles to the real GPU
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ export { isModelSlotContext, isPageSlotContext } from './types.js';
|
|
|
116
116
|
* in `types.ts` for which of the two it uses and why.
|
|
117
117
|
*/
|
|
118
118
|
export { isSignedIn } from './types.js';
|
|
119
|
-
export type { BlockContext, KnownSlotId, ModelSlotId, PageSlotContext, PageSlotId, UnknownSlotContext, BlockAnalyticsDeclaration, BlockAnalyticsEventDeclaration, BlockAnalyticsPropertyDeclaration, BlockManifest, BlockManifestGood, BlockManifestV1, BlockSettings, BlockStorageCollectionDeclaration, BlockStorageDeclaration, BlockStorageIndexes, BlockStorageIndexType, BlockStoragePrivateCollectionDeclaration, BlockStorageSharedCollectionDeclaration, BlockToken, ContentRating, ManifestBooleanField, ManifestIframe, ManifestNumberField, ManifestPage, ManifestPreview, ManifestSettingField, ManifestSettings, ManifestStringField, ManifestTarget, ModelSlotContext, SettingScope, SettingWidget, Theme, ViewerInfo, BlockCheckpointInfo, BlockResourceInfo, BlockResourcePickerType, BlockSourceImage, BlockUploadedImageInfo, BlockGenerationSourceImageInfo, BlockImagePickerSource, BlockPickedImageInfo, BlockMediaKind, BlockMediaUploadInfo, BlockPendingImageInfo, BlockImageScanResult, BlockUploadPurpose, BlockNavigateScope, BlockTextToImageParams, BlockWorkflowSnapshot, BlockEstimateBatchAggregate, BlockModelSubstitution, ModelSubstitutionReason, KnownBlockWorkflowErrorCode, BlockStepToolCall, BlockTrainedEpoch, BlockPublishedModel, BuzzAccountType, ShowcaseImage, WorkflowBody, WorkflowBodyTextToImage, WorkflowBodyCustomComfy, WorkflowBodyCustomComfyRecipe, WorkflowBodyCustomComfyInline, InlineComfyNode, WorkflowBodyStep, WorkflowBodyPassThroughStep, WorkflowBodyWorkflow, WorkflowBodyWorkflowStep, WorkflowStepRef, WithWorkflowStepRefs, BlockWorkflowStepSnapshot, WorkflowStatus, BlockBuzzTransaction, BlockBuzzAccount, BlockDailyCompensationResource, BlockViewer, BlockWildcardPack, BlockWildcardPackErrorCode, BlockResourceFile, BlockResourceFileEntry, BlockResourceFileEntryFormat, BlockResourceFileErrorCode, BlockResourceFileMeta, AppWorkflow, AppWorkflowImage, BlockGatedImage, BlockCollectionFollowErrorCode, BlockCollectionFollowResult, BlockPostSource, BlockCreatePostRequest, BlockCreatePostResult, BlockCreatePostHostError, WorkflowBodyTraining, AiToolkitTrainingParams, AiToolkitTrainingParamsBase, AiToolkitPlainEcosystem, AiToolkitLrScheduler, AiToolkitOptimizerType, BlockTrainingQuote, BlockTrainingDatasetItem, BlockTrainingDataImage, BlockTrainingDataUploadResult, BlockRunTrainingHostError, BlockStepQuote, BlockModel3dOutput, BlockRunConfirmedStepHostError, } from './types.js';
|
|
119
|
+
export type { BlockContext, KnownSlotId, ModelSlotId, PageSlotContext, PageSlotId, UnknownSlotContext, BlockAnalyticsDeclaration, BlockAnalyticsEventDeclaration, BlockAnalyticsPropertyDeclaration, BlockManifest, BlockManifestGood, BlockManifestV1, BlockSettings, BlockStorageCollectionDeclaration, BlockStorageCollectionSchema, BlockStorageDeclaration, BlockStorageImport, BlockStorageIndexes, BlockStorageIndexType, BlockStoragePrivateCollectionDeclaration, BlockStorageSchemaType, BlockStorageSharedCollectionDeclaration, BlockToken, ContentRating, ManifestBooleanField, ManifestIframe, ManifestNumberField, ManifestPage, ManifestPreview, ManifestSettingField, ManifestSettings, ManifestStringField, ManifestTarget, ModelSlotContext, SettingScope, SettingWidget, Theme, ViewerInfo, BlockCheckpointInfo, BlockResourceInfo, BlockResourcePickerType, BlockSourceImage, BlockUploadedImageInfo, BlockGenerationSourceImageInfo, BlockImagePickerSource, BlockPickedImageInfo, BlockMediaKind, BlockMediaUploadInfo, BlockPendingImageInfo, BlockImageScanResult, BlockUploadPurpose, BlockNavigateScope, BlockTextToImageParams, BlockWorkflowSnapshot, BlockEstimateBatchAggregate, BlockModelSubstitution, ModelSubstitutionReason, KnownBlockWorkflowErrorCode, BlockStepToolCall, BlockTrainedEpoch, BlockPublishedModel, BuzzAccountType, ShowcaseImage, WorkflowBody, WorkflowBodyTextToImage, WorkflowBodyCustomComfy, WorkflowBodyCustomComfyRecipe, WorkflowBodyCustomComfyInline, InlineComfyNode, WorkflowBodyStep, WorkflowBodyPassThroughStep, WorkflowBodyWorkflow, WorkflowBodyWorkflowStep, WorkflowStepRef, WithWorkflowStepRefs, BlockWorkflowStepSnapshot, WorkflowStatus, BlockBuzzTransaction, BlockBuzzAccount, BlockDailyCompensationResource, BlockViewer, BlockWildcardPack, BlockWildcardPackErrorCode, BlockResourceFile, BlockResourceFileEntry, BlockResourceFileEntryFormat, BlockResourceFileErrorCode, BlockResourceFileMeta, AppWorkflow, AppWorkflowImage, BlockGatedImage, BlockCollectionFollowErrorCode, BlockCollectionFollowResult, BlockPostSource, BlockCreatePostRequest, BlockCreatePostResult, BlockCreatePostHostError, WorkflowBodyTraining, AiToolkitTrainingParams, AiToolkitTrainingParamsBase, AiToolkitPlainEcosystem, AiToolkitLrScheduler, AiToolkitOptimizerType, BlockTrainingQuote, BlockTrainingDatasetItem, BlockTrainingDataImage, BlockTrainingDataUploadResult, BlockRunTrainingHostError, BlockStepQuote, BlockModel3dOutput, BlockRunConfirmedStepHostError, } from './types.js';
|
|
120
120
|
/**
|
|
121
121
|
* Host bounds for an inline `customComfy` graph, mirrored from civitai/civitai —
|
|
122
122
|
* see `WorkflowBodyCustomComfyInline.workflow`.
|
package/dist/blocks/scopes.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare const BLOCK_SCOPES: {
|
|
|
22
22
|
readonly APPS_STORAGE_SHARED_WRITE: "apps:storage:shared:write";
|
|
23
23
|
readonly APPS_STORAGE: "apps:storage";
|
|
24
24
|
readonly APPS_STORAGE_PUBLISH: "apps:storage:publish";
|
|
25
|
+
readonly APPS_STORAGE_IMPORT: "apps:storage:import";
|
|
25
26
|
readonly COLLECTIONS_READ_SELF: "collections:read:self";
|
|
26
27
|
readonly COLLECTIONS_WRITE_SELF: "collections:write:self";
|
|
27
28
|
readonly COLLECTIONS_READ_PRIVATE: "collections:read:private";
|
package/dist/blocks/scopes.js
CHANGED
|
@@ -39,6 +39,11 @@ export const BLOCK_SCOPES = {
|
|
|
39
39
|
// civitai/civitai `src/shared/constants/block-scope.constants.ts`.
|
|
40
40
|
APPS_STORAGE: 'apps:storage',
|
|
41
41
|
APPS_STORAGE_PUBLISH: 'apps:storage:publish',
|
|
42
|
+
// apps:storage:import — reach ANOTHER app's collections as the viewer, through
|
|
43
|
+
// the manifest's `storage.imports` (civitai/civitai#7494; a fork reading its
|
|
44
|
+
// parent). SENSITIVE (needs a `scopeJustifications` entry) and CONSENT-GATED:
|
|
45
|
+
// the viewer's grant is recorded per (viewer, this app, source app).
|
|
46
|
+
APPS_STORAGE_IMPORT: 'apps:storage:import',
|
|
42
47
|
// collections:* — the App Blocks Collections surface. These have no OAuth bit
|
|
43
48
|
// (they never touch the user's civitai resources via the OAuth surface); the
|
|
44
49
|
// server gates them per-op server-side (collection visibility/ownership +
|
package/dist/blocks/types.d.ts
CHANGED
|
@@ -1019,8 +1019,11 @@ export declare const BLOCK_INLINE_COMFY_MAX_NODES = 300;
|
|
|
1019
1019
|
* The largest an inline `customComfy` graph may be, as `JSON.stringify(workflow)
|
|
1020
1020
|
* .length`. Mirrors civitai's `INLINE_GRAPH_BYTES_MAX` (256 KiB, same file). The
|
|
1021
1021
|
* host counts UTF-16 code units (its `jsonLengthWithin` default), which equals
|
|
1022
|
-
* bytes for an ASCII graph.
|
|
1023
|
-
*
|
|
1022
|
+
* bytes for an ASCII graph. Calling the REST routes
|
|
1023
|
+
* `POST /api/v1/blocks/workflows/estimate` / `submit` directly with a block
|
|
1024
|
+
* token also caps the WHOLE request body at 256 KiB, so on that path the real
|
|
1025
|
+
* room for the graph is a little less than this. A page app using the hooks
|
|
1026
|
+
* goes through the host bridge, which has no such 256 KiB request cap.
|
|
1024
1027
|
*/
|
|
1025
1028
|
export declare const BLOCK_INLINE_COMFY_MAX_GRAPH_BYTES = 262144;
|
|
1026
1029
|
/**
|
|
@@ -2687,6 +2690,61 @@ export interface BlockStorageIndexes {
|
|
|
2687
2690
|
createdAt?: never;
|
|
2688
2691
|
updatedAt?: never;
|
|
2689
2692
|
}
|
|
2693
|
+
/** A JSON type name a {@link BlockStorageCollectionSchema} can require. */
|
|
2694
|
+
export type BlockStorageSchemaType = 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
2695
|
+
/**
|
|
2696
|
+
* A collection's DOCUMENT SCHEMA (civitai/civitai#7491): a JSON Schema SUBSET that every
|
|
2697
|
+
* document's `data` in the collection must match. Opt-in: without one, documents are not
|
|
2698
|
+
* checked. The server checks every create and put, and refuses a document that does not match
|
|
2699
|
+
* with 400 `schema_violation`. The refusal's message and `details.pointer` name the FIRST
|
|
2700
|
+
* failing JSON pointer into `data` (for example `/title`), and `details.keyword` names the
|
|
2701
|
+
* keyword it failed. Counters and marks are not checked. Changing a schema does not re-check
|
|
2702
|
+
* stored documents; each is checked the next time it is written.
|
|
2703
|
+
*
|
|
2704
|
+
* Only these keywords exist; any other is refused at submit by name. Semantics: a keyword for
|
|
2705
|
+
* another type is ignored (`minLength` on a number), `integer` is a number with no fraction,
|
|
2706
|
+
* lengths count code points, `pattern` is an UNANCHORED JavaScript regular expression with the
|
|
2707
|
+
* `u` flag, and `enum`/`const` compare JSON values. "First" is: `type`, `const`, `enum`, the
|
|
2708
|
+
* string, number and array keywords (`maxLength` before `pattern`), `items` element by element,
|
|
2709
|
+
* then `required` in declared order, then the object's own keys in ascending order.
|
|
2710
|
+
*
|
|
2711
|
+
* Bounds (the server's, refused at submit): at most 16 schemas nested in one another, 16384
|
|
2712
|
+
* bytes of JSON and 16 patterns per collection schema, and 32 patterns across all of the
|
|
2713
|
+
* manifest's collection schemas together; a `pattern` is at most 256 characters,
|
|
2714
|
+
* must compile, needs a `maxLength` of at most 1000 on the same schema, and must not backtrack
|
|
2715
|
+
* catastrophically; no `min*` above its `max*`. Not allowed on a `write: 'none'` collection,
|
|
2716
|
+
* which has no document bodies. Mirrors the canonical schema's
|
|
2717
|
+
* `$defs.storageCollectionSchema`.
|
|
2718
|
+
*/
|
|
2719
|
+
export interface BlockStorageCollectionSchema {
|
|
2720
|
+
/** One type, or a non-empty list of them without repeats. */
|
|
2721
|
+
type?: BlockStorageSchemaType | BlockStorageSchemaType[];
|
|
2722
|
+
/** Property name → the schema its value must match. */
|
|
2723
|
+
properties?: Record<string, BlockStorageCollectionSchema>;
|
|
2724
|
+
/** Property names that must be present (own keys), checked in this order. */
|
|
2725
|
+
required?: string[];
|
|
2726
|
+
/** `false` refuses undeclared keys; a schema checks their values; `true` (the default) allows them. */
|
|
2727
|
+
additionalProperties?: boolean | BlockStorageCollectionSchema;
|
|
2728
|
+
/** One schema every array element must match. */
|
|
2729
|
+
items?: BlockStorageCollectionSchema;
|
|
2730
|
+
/** The allowed JSON values (at least one). */
|
|
2731
|
+
enum?: unknown[];
|
|
2732
|
+
/** The one allowed JSON value. */
|
|
2733
|
+
const?: unknown;
|
|
2734
|
+
/** In code points. */
|
|
2735
|
+
minLength?: number;
|
|
2736
|
+
/** In code points. Required, at most 1000, on any schema that declares `pattern`. */
|
|
2737
|
+
maxLength?: number;
|
|
2738
|
+
/** A JavaScript regular expression (`u` flag), unanchored, at most 256 characters. */
|
|
2739
|
+
pattern?: string;
|
|
2740
|
+
/** Inclusive. */
|
|
2741
|
+
minimum?: number;
|
|
2742
|
+
/** Inclusive. */
|
|
2743
|
+
maximum?: number;
|
|
2744
|
+
minItems?: number;
|
|
2745
|
+
maxItems?: number;
|
|
2746
|
+
description?: string;
|
|
2747
|
+
}
|
|
2690
2748
|
/**
|
|
2691
2749
|
* A PRIVATE collection — a separate key space per viewer, read and written
|
|
2692
2750
|
* only by that viewer. Carries none of the shared-only fields (`write`,
|
|
@@ -2706,6 +2764,10 @@ export interface BlockStoragePrivateCollectionDeclaration {
|
|
|
2706
2764
|
ttlSeconds?: number;
|
|
2707
2765
|
/** RESERVED — see {@link BlockStorageSharedCollectionDeclaration.maxEntries}. */
|
|
2708
2766
|
maxEntries?: number;
|
|
2767
|
+
/** See {@link BlockStorageSharedCollectionDeclaration.exportable}. */
|
|
2768
|
+
exportable?: boolean;
|
|
2769
|
+
/** See {@link BlockStorageCollectionSchema}. */
|
|
2770
|
+
schema?: BlockStorageCollectionSchema;
|
|
2709
2771
|
}
|
|
2710
2772
|
/**
|
|
2711
2773
|
* A SHARED collection — one key space for the whole app, read by every viewer
|
|
@@ -2800,6 +2862,17 @@ export interface BlockStorageSharedCollectionDeclaration {
|
|
|
2800
2862
|
* model later changes hands or is deleted.
|
|
2801
2863
|
*/
|
|
2802
2864
|
ownedModelVersions?: string[];
|
|
2865
|
+
/**
|
|
2866
|
+
* Whether OTHER apps may reach this collection through their `storage.imports`,
|
|
2867
|
+
* with the viewer's consent (see {@link BlockStorageImport}). Default `true`;
|
|
2868
|
+
* `false` refuses every import of it with 403 `not_exportable`.
|
|
2869
|
+
*/
|
|
2870
|
+
exportable?: boolean;
|
|
2871
|
+
/**
|
|
2872
|
+
* The schema every document's `data` must match — see {@link BlockStorageCollectionSchema}.
|
|
2873
|
+
* Not allowed with `write` `'none'` (no document bodies are written there).
|
|
2874
|
+
*/
|
|
2875
|
+
schema?: BlockStorageCollectionSchema;
|
|
2803
2876
|
}
|
|
2804
2877
|
/**
|
|
2805
2878
|
* One collection declaration — see {@link BlockManifestV1.storage}.
|
|
@@ -2808,9 +2881,44 @@ export interface BlockStorageSharedCollectionDeclaration {
|
|
|
2808
2881
|
* canonical schema's `storage.collections.*`.
|
|
2809
2882
|
*/
|
|
2810
2883
|
export type BlockStorageCollectionDeclaration = BlockStoragePrivateCollectionDeclaration | BlockStorageSharedCollectionDeclaration;
|
|
2884
|
+
/**
|
|
2885
|
+
* One entry of the manifest's `storage.imports` (civitai/civitai#7494): collections of
|
|
2886
|
+
* ANOTHER app this app reaches as the viewer — for example a fork reading and writing its
|
|
2887
|
+
* parent's data. The SDK reaches one with `app.storage.collection(name, { from })`.
|
|
2888
|
+
*
|
|
2889
|
+
* Through an import the app acts AS THE VIEWER IN THE SOURCE APP: a private collection
|
|
2890
|
+
* gives that viewer's own documents, a shared one reads as the source shows it to them,
|
|
2891
|
+
* writes follow the source collection's write policy and schema, and usage counts against
|
|
2892
|
+
* the source app's ceilings. Nothing is reached until the viewer grants it: declaring any
|
|
2893
|
+
* import requires the sensitive, consent-gated `apps:storage:import` scope with a
|
|
2894
|
+
* `scopeJustifications` entry (and `apps:storage`), and the viewer's consent is recorded
|
|
2895
|
+
* per (viewer, this app, source app). A source collection declared `exportable: false`
|
|
2896
|
+
* refuses every import.
|
|
2897
|
+
*
|
|
2898
|
+
* Limits (the canonical's): at most 8 imports, one per source, never this app itself.
|
|
2899
|
+
*/
|
|
2900
|
+
export interface BlockStorageImport {
|
|
2901
|
+
/** The source app's blockId (`^[a-z][a-z0-9-]{1,38}[a-z0-9]$`, 3 to 40 characters). */
|
|
2902
|
+
from: string;
|
|
2903
|
+
/** 1 to 16 distinct names of collections the source declares. */
|
|
2904
|
+
collections: string[];
|
|
2905
|
+
/**
|
|
2906
|
+
* `'read'`: reads only; every write, counter and mark is refused (`write_policy`).
|
|
2907
|
+
* `'readwrite'`: also writes, under the source collection's own write policy. A write,
|
|
2908
|
+
* counter or mark in one of the source's SHARED collections also needs the viewer's own
|
|
2909
|
+
* `apps:storage:publish` grant IN THE SOURCE APP; a private collection needs only the
|
|
2910
|
+
* import grant.
|
|
2911
|
+
*/
|
|
2912
|
+
access: 'read' | 'readwrite';
|
|
2913
|
+
}
|
|
2811
2914
|
/**
|
|
2812
2915
|
* The manifest's `storage` object — see {@link BlockManifestV1.storage}.
|
|
2813
2916
|
* Mirrors the canonical schema's `storage`; no other key is allowed.
|
|
2917
|
+
*
|
|
2918
|
+
* It declares `collections` (this app's own), `imports` (other apps'), or both.
|
|
2919
|
+
* AT LEAST ONE is required, which this type does not express: each is optional
|
|
2920
|
+
* here, and the canonical schema (so `defineBlock`) refuses a `storage` with
|
|
2921
|
+
* neither.
|
|
2814
2922
|
*/
|
|
2815
2923
|
export interface BlockStorageDeclaration {
|
|
2816
2924
|
/**
|
|
@@ -2820,7 +2928,9 @@ export interface BlockStorageDeclaration {
|
|
|
2820
2928
|
* its visibility, is a NEW collection: the old one's documents are not
|
|
2821
2929
|
* carried over.
|
|
2822
2930
|
*/
|
|
2823
|
-
collections
|
|
2931
|
+
collections?: Record<string, BlockStorageCollectionDeclaration>;
|
|
2932
|
+
/** Other apps' collections this app reaches as the viewer, 1 to 8 entries. See {@link BlockStorageImport}. */
|
|
2933
|
+
imports?: BlockStorageImport[];
|
|
2824
2934
|
}
|
|
2825
2935
|
/**
|
|
2826
2936
|
* One entry of a manifest's `goods[]`. Mirrors the canonical schema exactly;
|
|
@@ -2969,8 +3079,11 @@ export interface BlockManifestV1 {
|
|
|
2969
3079
|
* Declaring any collection requires the `apps:storage` scope; a shared
|
|
2970
3080
|
* collection viewers write (`write` `'own'` or `'anyone'`) also requires the
|
|
2971
3081
|
* sensitive, consent-gated `apps:storage:publish` scope with a
|
|
2972
|
-
* `scopeJustifications` entry;
|
|
2973
|
-
*
|
|
3082
|
+
* `scopeJustifications` entry; declaring any `imports` (another app's
|
|
3083
|
+
* collections, see {@link BlockStorageImport}) requires the sensitive,
|
|
3084
|
+
* consent-gated `apps:storage:import` scope with a `scopeJustifications`
|
|
3085
|
+
* entry; and requesting any of these scopes with nothing here for it to
|
|
3086
|
+
* reach is rejected. Those couplings, and the RESERVED features
|
|
2974
3087
|
* (`kind: 'log'`, `ttlSeconds`, `dailyWritesPerAuthor`, `write` `'anyone'` /
|
|
2975
3088
|
* `'owner'`), are enforced by the platform's manifest validator at submit,
|
|
2976
3089
|
* not by `defineBlock` — see `KNOWN_GAPS['storage-server-only-rules']`.
|
package/dist/blocks/types.js
CHANGED
|
@@ -124,8 +124,11 @@ export const BLOCK_INLINE_COMFY_MAX_NODES = 300;
|
|
|
124
124
|
* The largest an inline `customComfy` graph may be, as `JSON.stringify(workflow)
|
|
125
125
|
* .length`. Mirrors civitai's `INLINE_GRAPH_BYTES_MAX` (256 KiB, same file). The
|
|
126
126
|
* host counts UTF-16 code units (its `jsonLengthWithin` default), which equals
|
|
127
|
-
* bytes for an ASCII graph.
|
|
128
|
-
*
|
|
127
|
+
* bytes for an ASCII graph. Calling the REST routes
|
|
128
|
+
* `POST /api/v1/blocks/workflows/estimate` / `submit` directly with a block
|
|
129
|
+
* token also caps the WHOLE request body at 256 KiB, so on that path the real
|
|
130
|
+
* room for the graph is a little less than this. A page app using the hooks
|
|
131
|
+
* goes through the host bridge, which has no such 256 KiB request cap.
|
|
129
132
|
*/
|
|
130
133
|
export const BLOCK_INLINE_COMFY_MAX_GRAPH_BYTES = 262144;
|
|
131
134
|
// ============================================================
|
package/dist/index.d.ts
CHANGED
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
*
|
|
26
26
|
* - **`./blocks`** — importing it RUNS `./safe-storage` for its side effect
|
|
27
27
|
* (repairing `localStorage`/`sessionStorage` at an opaque origin). Folding
|
|
28
|
-
*
|
|
28
|
+
* 211 symbols and that side effect into the root would make every OAuth app
|
|
29
29
|
* that writes `import { exchangeCode } from '@civitai/app-sdk'` pay for the
|
|
30
30
|
* Civitai-Apps contract it does not use. Blocks and OAuth apps are disjoint
|
|
31
31
|
* audiences; see this package's README.
|
|
32
|
-
* 🔴 That
|
|
32
|
+
* 🔴 That 211 is ASSERTED, not merely quoted — by
|
|
33
33
|
* `packages/civitai-app-sdk/test/export-surface.test.ts`, which pins
|
|
34
34
|
* `surface.get('./blocks').size`. It said 119 here against a real 125 until
|
|
35
35
|
* 2026-10-04, because the existing checks pin the root as an exact union and
|
package/dist/index.js
CHANGED
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
*
|
|
26
26
|
* - **`./blocks`** — importing it RUNS `./safe-storage` for its side effect
|
|
27
27
|
* (repairing `localStorage`/`sessionStorage` at an opaque origin). Folding
|
|
28
|
-
*
|
|
28
|
+
* 211 symbols and that side effect into the root would make every OAuth app
|
|
29
29
|
* that writes `import { exchangeCode } from '@civitai/app-sdk'` pay for the
|
|
30
30
|
* Civitai-Apps contract it does not use. Blocks and OAuth apps are disjoint
|
|
31
31
|
* audiences; see this package's README.
|
|
32
|
-
* 🔴 That
|
|
32
|
+
* 🔴 That 211 is ASSERTED, not merely quoted — by
|
|
33
33
|
* `packages/civitai-app-sdk/test/export-surface.test.ts`, which pins
|
|
34
34
|
* `surface.get('./blocks').size`. It said 119 here against a real 125 until
|
|
35
35
|
* 2026-10-04, because the existing checks pin the root as an exact union and
|
|
@@ -97,6 +97,7 @@ export declare const KNOWN_GAPS: {
|
|
|
97
97
|
readonly 'slotId-registry': string;
|
|
98
98
|
readonly 'settings-meta-schema-not-vendored': string;
|
|
99
99
|
readonly 'storage-server-only-rules': string;
|
|
100
|
+
readonly 'storage-collection-schema-server-only-rules': string;
|
|
100
101
|
readonly 'format-uri-not-enforced': string;
|
|
101
102
|
};
|
|
102
103
|
/** The canonical schema object, parsed once. Exported for tests and tooling. */
|
|
@@ -145,11 +145,21 @@ export const KNOWN_GAPS = {
|
|
|
145
145
|
'See SCHEMA_DIVERGENCES.settings.',
|
|
146
146
|
'storage-server-only-rules': 'The canonical `storage` description states rules it does not encode: declaring any ' +
|
|
147
147
|
'collection requires the `apps:storage` scope, a shared collection viewers write (`write` ' +
|
|
148
|
-
'"own" or "anyone") also requires `apps:storage:publish`,
|
|
149
|
-
'
|
|
148
|
+
'"own" or "anyone") also requires `apps:storage:publish`, declaring `imports` requires ' +
|
|
149
|
+
'`apps:storage:import` (and `apps:storage`), requesting any of these scopes with nothing for ' +
|
|
150
|
+
'it to reach is rejected, an import never names this app itself and names each source at ' +
|
|
151
|
+
'most once, a counter may not share a name with a mark, and the ' +
|
|
150
152
|
'RESERVED features (`kind` "log", `ttlSeconds`, `dailyWritesPerAuthor`, `write` "anyone" / ' +
|
|
151
153
|
'"owner") validate offline and are refused at submit. Ajv enforces the structural rules ' +
|
|
152
154
|
'exactly; these are server-side.',
|
|
155
|
+
'storage-collection-schema-server-only-rules': 'A collection `schema` (civitai/civitai#7491): the canonical encodes the keyword subset, each ' +
|
|
156
|
+
'keyword\'s shape, the 256-character `pattern` bound, "a pattern needs a maxLength of at most ' +
|
|
157
|
+
'1000" and "no schema on write none", and Ajv enforces those exactly. It states in prose only ' +
|
|
158
|
+
'the bounds the server checks at submit: at most 16384 bytes of JSON, 16 nested schemas and ' +
|
|
159
|
+
'16 patterns per collection schema, 32 patterns across the whole manifest, no min above ' +
|
|
160
|
+
'its max, a pattern that compiles as a JavaScript regular expression with the `u` flag, ' +
|
|
161
|
+
'and no pattern that can backtrack ' +
|
|
162
|
+
'catastrophically. Those validate here and are refused at submit.',
|
|
153
163
|
'format-uri-not-enforced': '`assetBundleUrl` carries `format: "uri"` in addition to `pattern: "^https://"`. Ajv ignores ' +
|
|
154
164
|
'unknown formats unless `ajv-formats` is installed, which would be a second optional peer for ' +
|
|
155
165
|
'one field whose pattern is already enforced. The pattern IS enforced; the `uri` format is ' +
|
package/dist/manifest/index.d.ts
CHANGED
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
export { defineBlock, SCHEMA_DIVERGENCES, KNOWN_GAPS, loadCanonicalSchema } from './defineBlock.js';
|
|
16
16
|
export type { DefineBlockConfig } from './defineBlock.js';
|
|
17
17
|
export { BlockManifestError } from '../blocks/manifestError.js';
|
|
18
|
-
export type { BlockAnalyticsDeclaration, BlockAnalyticsEventDeclaration, BlockAnalyticsPropertyDeclaration, BlockManifest, BlockManifestGood, BlockManifestV1, BlockStorageCollectionDeclaration, BlockStorageDeclaration, BlockStorageIndexes, BlockStorageIndexType, BlockStoragePrivateCollectionDeclaration, BlockStorageSharedCollectionDeclaration, } from '../blocks/types.js';
|
|
18
|
+
export type { BlockAnalyticsDeclaration, BlockAnalyticsEventDeclaration, BlockAnalyticsPropertyDeclaration, BlockManifest, BlockManifestGood, BlockManifestV1, BlockStorageCollectionDeclaration, BlockStorageCollectionSchema, BlockStorageDeclaration, BlockStorageImport, BlockStorageIndexes, BlockStorageIndexType, BlockStoragePrivateCollectionDeclaration, BlockStorageSchemaType, BlockStorageSharedCollectionDeclaration, } from '../blocks/types.js';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -55,15 +55,7 @@
|
|
|
55
55
|
"category": {
|
|
56
56
|
"type": "string",
|
|
57
57
|
"description": "Optional marketplace category for the app's `/apps` store listing. When present it flows to the listing automatically on moderator-approve (only when a moderator has not already curated a category). Omit to let a moderator categorise the app. Must be one of the known marketplace categories — this enum is kept in lockstep with MARKETPLACE_CATEGORIES in src/server/services/blocks/marketplace-categories.constants.ts (a drift-guard test enforces equality).",
|
|
58
|
-
"enum": [
|
|
59
|
-
"generation",
|
|
60
|
-
"games",
|
|
61
|
-
"utility",
|
|
62
|
-
"discovery",
|
|
63
|
-
"moderation",
|
|
64
|
-
"analytics",
|
|
65
|
-
"other"
|
|
66
|
-
]
|
|
58
|
+
"enum": ["generation", "games", "utility", "discovery", "moderation", "analytics", "other"]
|
|
67
59
|
},
|
|
68
60
|
"renderMode": {
|
|
69
61
|
"type": "string",
|
|
@@ -98,6 +90,7 @@
|
|
|
98
90
|
"apps:storage:shared:write",
|
|
99
91
|
"apps:storage",
|
|
100
92
|
"apps:storage:publish",
|
|
93
|
+
"apps:storage:import",
|
|
101
94
|
"collections:read:self",
|
|
102
95
|
"collections:write:self",
|
|
103
96
|
"collections:read:private",
|
|
@@ -111,7 +104,7 @@
|
|
|
111
104
|
},
|
|
112
105
|
"scopeJustifications": {
|
|
113
106
|
"type": "object",
|
|
114
|
-
"description": "Per-scope justification: a map of scope-id → free-text rationale explaining WHY the app needs that permission, shown to the moderator during review. REQUIRED for SENSITIVE scopes — any declared scope that can spend or read the viewer's Buzz, read the viewer's private data, or write data other users see (e.g. `ai:write:budgeted`, `social:tip:self`, `goods:purchase:self`, `buzz:read:self`, `collections:read:private`, `apps:storage:shared:write`, `apps:storage:publish`, `posts:write:self`, `apps:store:items:write`, `social:react:self`) MUST carry a non-empty justification here, or the manifest is rejected at submit time. OPTIONAL for non-sensitive scopes — omit those and the manifest stays valid. Every key MUST be a scope also present in `scopes` (justifications for scopes you don't request are rejected). Each value is a non-empty string of at most 500 characters. The requirement is enforced imperatively by the manifest validator (not expressed as JSON-Schema conditionals here). NOTE: the justification captures the developer's STATED rationale only; the platform does not verify the truth of the claims.",
|
|
107
|
+
"description": "Per-scope justification: a map of scope-id → free-text rationale explaining WHY the app needs that permission, shown to the moderator during review. REQUIRED for SENSITIVE scopes — any declared scope that can spend or read the viewer's Buzz, read the viewer's private data, or write data other users see (e.g. `ai:write:budgeted`, `social:tip:self`, `goods:purchase:self`, `buzz:read:self`, `collections:read:private`, `apps:storage:shared:write`, `apps:storage:publish`, `apps:storage:import`, `posts:write:self`, `apps:store:items:write`, `social:react:self`) MUST carry a non-empty justification here, or the manifest is rejected at submit time. OPTIONAL for non-sensitive scopes — omit those and the manifest stays valid. Every key MUST be a scope also present in `scopes` (justifications for scopes you don't request are rejected). Each value is a non-empty string of at most 500 characters. The requirement is enforced imperatively by the manifest validator (not expressed as JSON-Schema conditionals here). NOTE: the justification captures the developer's STATED rationale only; the platform does not verify the truth of the claims.",
|
|
115
108
|
"additionalProperties": {
|
|
116
109
|
"type": "string",
|
|
117
110
|
"minLength": 1,
|
|
@@ -137,7 +130,10 @@
|
|
|
137
130
|
"maxLength": 256,
|
|
138
131
|
"allOf": [
|
|
139
132
|
{ "$comment": "no leading '/' (absolute path)", "not": { "pattern": "^/" } },
|
|
140
|
-
{
|
|
133
|
+
{
|
|
134
|
+
"$comment": "no backslash separators (Windows / '\\..' traversal)",
|
|
135
|
+
"not": { "pattern": "\\\\" }
|
|
136
|
+
},
|
|
141
137
|
{ "$comment": "no '..' path-traversal segment", "not": { "pattern": "(^|/)\\.\\.(/|$)" } },
|
|
142
138
|
{ "$comment": "no Windows drive prefix (e.g. C:)", "not": { "pattern": "^[A-Za-z]:" } }
|
|
143
139
|
]
|
|
@@ -378,10 +374,43 @@
|
|
|
378
374
|
},
|
|
379
375
|
"storage": {
|
|
380
376
|
"type": "object",
|
|
381
|
-
"description": "Optional APP STORAGE declaration — every collection of JSON documents your app keeps, and who may read and write each one. Manifest-governed and REVIEW-GATED: a collection that is not declared here does not exist at runtime, and the moderator sees each collection's visibility, write policy, counters, marks and indexes. Declaring any collection also requires the `apps:storage` scope; declaring a shared collection that viewers write (`write` of \"own\" or \"anyone\") also requires the sensitive, consent-gated `apps:storage:publish` scope with a `scopeJustifications` entry; and requesting
|
|
377
|
+
"description": "Optional APP STORAGE declaration — every collection of JSON documents your app keeps, and who may read and write each one. Manifest-governed and REVIEW-GATED: a collection that is not declared here does not exist at runtime, and the moderator sees each collection's visibility, write policy, counters, marks and indexes. Declaring any collection also requires the `apps:storage` scope; declaring a shared collection that viewers write (`write` of \"own\" or \"anyone\") also requires the sensitive, consent-gated `apps:storage:publish` scope with a `scopeJustifications` entry; declaring any `imports` also requires the sensitive, consent-gated `apps:storage:import` scope with a `scopeJustifications` entry (and `apps:storage`); and requesting any of these scopes with nothing here for it to reach is rejected. At least one of `collections` and `imports` is required. This schema describes the WHOLE declaration, including features the platform does not accept yet: today the server's manifest validation refuses `kind` \"log\", `ttlSeconds`, `dailyWritesPerAuthor`, `write` \"anyone\" and `write` \"owner\" with a message saying they are not available yet, so those validate offline and are rejected at submit. Kept in lockstep with src/shared/constants/block-storage.constants.ts (a drift-guard test enforces equality); the imperative validator in that module is authoritative.",
|
|
382
378
|
"additionalProperties": false,
|
|
383
|
-
"required": ["collections"],
|
|
379
|
+
"anyOf": [{ "required": ["collections"] }, { "required": ["imports"] }],
|
|
384
380
|
"properties": {
|
|
381
|
+
"imports": {
|
|
382
|
+
"type": "array",
|
|
383
|
+
"description": "Collections of OTHER apps this app reaches as the viewer — for example a fork reading and writing its parent's data. Each import names the source app by its `blockId`, 1 to 16 distinct collection names the source declares, and the access wanted: \"read\" or \"readwrite\". At most 8 imports, one per source app, never this app itself. Through an import the app acts AS THE VIEWER IN THE SOURCE APP: a private collection gives that viewer's own documents, a shared one reads as the source shows it to them, writes follow the source collection's write policy, and usage counts against the source app's ceilings. Nothing is reached until the viewer grants it: the `apps:storage:import` consent is recorded per (viewer, this app, source app) and can be withdrawn under Apps → Permissions. A source collection with `exportable: false` refuses every import. The SDK reaches one with `app.storage.collection(name, { from: blockId })`.",
|
|
384
|
+
"minItems": 1,
|
|
385
|
+
"maxItems": 8,
|
|
386
|
+
"items": {
|
|
387
|
+
"type": "object",
|
|
388
|
+
"additionalProperties": false,
|
|
389
|
+
"required": ["from", "collections", "access"],
|
|
390
|
+
"properties": {
|
|
391
|
+
"from": {
|
|
392
|
+
"type": "string",
|
|
393
|
+
"description": "The source app's blockId (its slug).",
|
|
394
|
+
"minLength": 3,
|
|
395
|
+
"maxLength": 40,
|
|
396
|
+
"pattern": "^[a-z][a-z0-9-]{1,38}[a-z0-9]$"
|
|
397
|
+
},
|
|
398
|
+
"collections": {
|
|
399
|
+
"type": "array",
|
|
400
|
+
"description": "Names of the source app's collections this import reaches.",
|
|
401
|
+
"minItems": 1,
|
|
402
|
+
"maxItems": 16,
|
|
403
|
+
"uniqueItems": true,
|
|
404
|
+
"items": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$" }
|
|
405
|
+
},
|
|
406
|
+
"access": {
|
|
407
|
+
"type": "string",
|
|
408
|
+
"description": "\"read\": reads only; every write is refused. \"readwrite\": reads and writes, under the source collection's own write policy. A create, update, counter, mark or unmark in one of the source's SHARED collections also needs the viewer's own `apps:storage:publish` grant in the source app, which the app asks the host to prompt for; a document delete, and any write to a private collection, needs only the import grant.",
|
|
409
|
+
"enum": ["read", "readwrite"]
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
},
|
|
385
414
|
"collections": {
|
|
386
415
|
"type": "object",
|
|
387
416
|
"description": "Map of collection name → declaration. At least 1 and at most 16 collections. A collection name is lowercase snake_case: a letter, then up to 31 of a-z, 0-9 or _. Renaming a collection, or changing its visibility, is a NEW collection: the old one's documents are not carried over.",
|
|
@@ -470,6 +499,10 @@
|
|
|
470
499
|
"minimum": 1,
|
|
471
500
|
"maximum": 1000
|
|
472
501
|
},
|
|
502
|
+
"exportable": {
|
|
503
|
+
"type": "boolean",
|
|
504
|
+
"description": "Whether other apps may reach this collection through their `storage.imports` (with the viewer's consent). Default true; false refuses every import of it with 403 `not_exportable`."
|
|
505
|
+
},
|
|
473
506
|
"ownedModelVersions": {
|
|
474
507
|
"type": "array",
|
|
475
508
|
"description": "Shared collections with `write` \"own\" only. Fields of a document's `data` that, when present, must hold a Civitai model version id owned by the viewer writing the document — for example [\"/workflow/modelVersionId\"] for a collection where viewers publish their own workflows. Each entry is a pointer of 1 to 4 segments, each \"/\" then a letter or _ followed by up to 63 letters, digits or _; 1 to 4 distinct pointers. A pointer names one field of nested objects: it never indexes into an array, and a step through an array or any other non-object finds nothing. On every create and update the server resolves each pointer in the new `data`: a field that is absent is allowed; a field that is present must be a positive integer naming a model version whose model the writer owns, and is otherwise refused with 403 `resource_not_owned` — a version that is someone else's, missing or deleted, and a value that is not a positive integer, are all refused the same way. The check runs before moderation and before any write budget is spent. Ownership is checked when a document is written, not afterwards: if the model later changes hands or is deleted, documents already stored keep the id.",
|
|
@@ -480,9 +513,21 @@
|
|
|
480
513
|
"type": "string",
|
|
481
514
|
"pattern": "^(/[A-Za-z_][A-Za-z0-9_]{0,63}){1,4}$"
|
|
482
515
|
}
|
|
516
|
+
},
|
|
517
|
+
"schema": {
|
|
518
|
+
"description": "Optional. A JSON Schema SUBSET that every document's `data` in this collection must match. The server checks it on every create and update and refuses a document that does not match with 400 `schema_violation`, whose message names the first failing JSON pointer into `data` (for example \"/title\"); counters and marks are not checked. Without a schema, documents are not checked. Supported keywords only: type (object, array, string, number, integer, boolean, null, or an array of them), properties, required, additionalProperties (true, false or a schema), items (one schema for every element), enum, const, minLength, maxLength, pattern, minimum, maximum, minItems, maxItems and description; any other keyword is refused at submit with a message naming it. Keywords that do not apply to a value's type are ignored; string lengths count code points; `pattern` is a JavaScript regular expression (the \"u\" flag), unanchored, of at most 256 characters, and a schema with a `pattern` must also declare a `maxLength` of at most 1000; a pattern that can backtrack catastrophically (analysed with the \"u\" flag, as the store runs it) is refused at submit. At most 16 patterns per schema and 32 across all of the manifest's collection schemas together, schemas nested at most 16 deep, and at most 16384 bytes of JSON. Not allowed on a `write` \"none\" collection. Changing a schema does not re-check documents already stored; they are checked when next written.",
|
|
519
|
+
"$ref": "#/$defs/storageCollectionSchema"
|
|
483
520
|
}
|
|
484
521
|
},
|
|
485
522
|
"allOf": [
|
|
523
|
+
{
|
|
524
|
+
"$comment": "No document body is ever written in a write:\"none\" collection, so a schema there would check nothing.",
|
|
525
|
+
"if": {
|
|
526
|
+
"required": ["write"],
|
|
527
|
+
"properties": { "write": { "const": "none" } }
|
|
528
|
+
},
|
|
529
|
+
"then": { "properties": { "schema": false } }
|
|
530
|
+
},
|
|
486
531
|
{
|
|
487
532
|
"$comment": "A shared collection must state its write policy; a private one carries none of the shared-only fields.",
|
|
488
533
|
"if": {
|
|
@@ -560,6 +605,50 @@
|
|
|
560
605
|
}
|
|
561
606
|
}
|
|
562
607
|
},
|
|
608
|
+
"$defs": {
|
|
609
|
+
"storageCollectionSchema": {
|
|
610
|
+
"type": "object",
|
|
611
|
+
"description": "One schema of the storage collection-schema subset (see `storage.collections.<name>.schema`). Depth, size, pattern-count and min-greater-than-max limits, and whether a pattern compiles, are checked by the server, not by this schema.",
|
|
612
|
+
"additionalProperties": false,
|
|
613
|
+
"properties": {
|
|
614
|
+
"type": {
|
|
615
|
+
"anyOf": [
|
|
616
|
+
{ "$ref": "#/$defs/storageCollectionSchemaType" },
|
|
617
|
+
{
|
|
618
|
+
"type": "array",
|
|
619
|
+
"minItems": 1,
|
|
620
|
+
"uniqueItems": true,
|
|
621
|
+
"items": { "$ref": "#/$defs/storageCollectionSchemaType" }
|
|
622
|
+
}
|
|
623
|
+
]
|
|
624
|
+
},
|
|
625
|
+
"properties": {
|
|
626
|
+
"type": "object",
|
|
627
|
+
"additionalProperties": { "$ref": "#/$defs/storageCollectionSchema" }
|
|
628
|
+
},
|
|
629
|
+
"required": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
|
|
630
|
+
"additionalProperties": {
|
|
631
|
+
"anyOf": [{ "type": "boolean" }, { "$ref": "#/$defs/storageCollectionSchema" }]
|
|
632
|
+
},
|
|
633
|
+
"items": { "$ref": "#/$defs/storageCollectionSchema" },
|
|
634
|
+
"enum": { "type": "array", "minItems": 1 },
|
|
635
|
+
"const": {},
|
|
636
|
+
"minLength": { "type": "integer", "minimum": 0 },
|
|
637
|
+
"maxLength": { "type": "integer", "minimum": 0 },
|
|
638
|
+
"pattern": { "type": "string", "maxLength": 256 },
|
|
639
|
+
"minimum": { "type": "number" },
|
|
640
|
+
"maximum": { "type": "number" },
|
|
641
|
+
"minItems": { "type": "integer", "minimum": 0 },
|
|
642
|
+
"maxItems": { "type": "integer", "minimum": 0 },
|
|
643
|
+
"description": { "type": "string" }
|
|
644
|
+
},
|
|
645
|
+
"if": { "required": ["pattern"] },
|
|
646
|
+
"then": { "required": ["maxLength"], "properties": { "maxLength": { "maximum": 1000 } } }
|
|
647
|
+
},
|
|
648
|
+
"storageCollectionSchemaType": {
|
|
649
|
+
"enum": ["object", "array", "string", "number", "integer", "boolean", "null"]
|
|
650
|
+
}
|
|
651
|
+
},
|
|
563
652
|
"allOf": [
|
|
564
653
|
{
|
|
565
654
|
"$comment": "outputDir is required whenever buildCommand is set. NOTE: the server-owned iframe.src and trustTier fields are rejected by the platform validator (and the CLI in Go) with clearer error messages than JSON Schema's `not`; they are declared in `properties` above only so the schema documents them.",
|