@civitai/app-sdk 0.82.0 → 0.83.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.
@@ -2797,7 +2797,7 @@ export type BlockStorageMigrationOp = {
2797
2797
  * A PRIVATE collection — a separate key space per viewer, read and written
2798
2798
  * only by that viewer. Carries none of the shared-only fields (`write`,
2799
2799
  * `counters`, `marks`, `showAuthor`, `dailyWritesPerAuthor`,
2800
- * `ownedModelVersions`); the canonical
2800
+ * `ownedModelVersions`, `registry`); the canonical
2801
2801
  * forbids them here. See {@link BlockStorageSharedCollectionDeclaration} for
2802
2802
  * the fields both kinds share.
2803
2803
  */
@@ -2918,6 +2918,16 @@ export interface BlockStorageSharedCollectionDeclaration {
2918
2918
  * `false` refuses every import of it with 403 `not_exportable`.
2919
2919
  */
2920
2920
  exportable?: boolean;
2921
+ /**
2922
+ * RESERVED — civitai.com refuses this field until publishing to registries
2923
+ * is enabled, so do not declare it yet. Shared collections only.
2924
+ * `'public'` publishes the collection's visible shared documents, read-only,
2925
+ * to every registry that follows Civitai's apps, as entities of the
2926
+ * collection's schema; hidden documents and every private document never
2927
+ * leave. Absent (the default): the collection is not published. A moderator
2928
+ * sees the change at review.
2929
+ */
2930
+ registry?: 'public';
2921
2931
  /**
2922
2932
  * The schema every document's `data` must match — see {@link BlockStorageCollectionSchema}.
2923
2933
  * Not allowed with `write` `'none'` (no document bodies are written there).
@@ -149,8 +149,8 @@ export const KNOWN_GAPS = {
149
149
  '`apps:storage:import` (and `apps:storage`), requesting any of these scopes with nothing for ' +
150
150
  'it to reach is rejected, an import never names this app itself and names each source at ' +
151
151
  'most once, a counter may not share a name with a mark, and the ' +
152
- 'RESERVED features (`kind` "log", `ttlSeconds`, `dailyWritesPerAuthor`, `write` "anyone" / ' +
153
- '"owner") validate offline and are refused at submit. Ajv enforces the structural rules ' +
152
+ 'RESERVED features (`kind` "log", `ttlSeconds`, `dailyWritesPerAuthor`, `registry`, `write` ' +
153
+ '"anyone" / "owner") validate offline and are refused at submit. Ajv enforces the structural rules ' +
154
154
  'exactly; these are server-side.',
155
155
  'storage-collection-schema-server-only-rules': 'A collection `schema` (civitai/civitai#7491): the canonical encodes the keyword subset, each ' +
156
156
  'keyword\'s shape, the 256-character `pattern` bound, "a pattern needs a maxLength of at most ' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civitai/app-sdk",
3
- "version": "0.82.0",
3
+ "version": "0.83.0",
4
4
  "description": "OAuth + PKCE, encrypted-cookie sessions, scopes, and orchestrator helpers for building third-party Civitai apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -503,6 +503,10 @@
503
503
  "type": "boolean",
504
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
505
  },
506
+ "registry": {
507
+ "enum": ["public"],
508
+ "description": "RESERVED — civitai.com refuses this field until publishing to registries is enabled, so do not declare it yet. Shared collections only. \"public\" publishes the collection's visible shared documents, read-only, to every registry that follows Civitai's apps, as entities of the collection's schema; hidden documents and every private document never leave. Absent (the default): the collection is not published. A moderator sees the change at review."
509
+ },
506
510
  "ownedModelVersions": {
507
511
  "type": "array",
508
512
  "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.",
@@ -515,7 +519,7 @@
515
519
  }
516
520
  },
517
521
  "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. A change that narrows the schema against the previous approved version (a newly required property; a type, enum, const, bound or pattern narrowed; `additionalProperties` closed or newly a schema; a declared property removed under `additionalProperties: false`; or a schema added where there was none) is refused at submit unless `migrations` covers it.",
522
+ "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. A change that narrows the schema against the previous approved version (a newly required property; a type, enum, const, bound or pattern narrowed; `additionalProperties` closed or newly a schema; a declared property removed under `additionalProperties: false`; or a schema added where there was none) is refused at submit unless `migrations` covers it. The covering ops run over the documents already stored when the version is approved; a document an \"acknowledge\" op covers is left as stored and checked when next written.",
519
523
  "$ref": "#/$defs/storageCollectionSchema"
520
524
  },
521
525
  "migrations": {
@@ -549,7 +553,8 @@
549
553
  "marks": false,
550
554
  "showAuthor": false,
551
555
  "dailyWritesPerAuthor": false,
552
- "ownedModelVersions": false
556
+ "ownedModelVersions": false,
557
+ "registry": false
553
558
  }
554
559
  }
555
560
  },