@civitai/app-sdk 0.60.0 → 0.62.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.
@@ -521,6 +521,8 @@ export type ParentToBlockMessage = {
521
521
  payload: {
522
522
  requestId: string;
523
523
  selected?: BlockUploadedImageInfo | BlockGenerationSourceImageInfo | BlockPendingImageInfo;
524
+ /** A `bytes` upload's refusal or failure: a host string or a forwarded server message. */
525
+ error?: string;
524
526
  };
525
527
  } | {
526
528
  type: 'IMAGE_SCAN_RESOLVED';
@@ -836,6 +838,10 @@ export type BlockToParentMessage = {
836
838
  requestId: string;
837
839
  purpose?: BlockUploadPurpose;
838
840
  asyncScan?: boolean;
841
+ /** In-tab image bytes; no picker. Page apps only. See the comment above. */
842
+ bytes?: ArrayBuffer;
843
+ /** Optional name for a `bytes` upload (host-sanitised). */
844
+ filename?: string;
839
845
  };
840
846
  } | {
841
847
  type: 'SET_USER_CHECKPOINT';
@@ -966,11 +972,20 @@ export type BlockToParentMessage = {
966
972
  type: 'SAVE_IMAGE';
967
973
  payload: {
968
974
  requestId: string;
969
- /** Own-output URL — origin-allowlisted host-side. Mutually exclusive with `imageId`. */
975
+ /** Own-output URL — origin-allowlisted host-side. Mutually exclusive with `imageId` / `bytes`. */
970
976
  url?: string;
971
- /** Cross-user image id — routed through the gated per-viewer read. Mutually exclusive with `url`. */
977
+ /** Cross-user image id — routed through the gated per-viewer read. Mutually exclusive with `url` / `bytes`. */
972
978
  imageId?: number;
973
- /** Optional download filename (host-sanitized). */
979
+ /**
980
+ * In-tab file bytes — classified by CONTENT host-side, size-capped host-side.
981
+ * Page apps only. Mutually exclusive with `url` / `imageId`.
982
+ */
983
+ bytes?: ArrayBuffer;
984
+ /**
985
+ * Optional download filename (host-sanitized). For `bytes`, a `.json`
986
+ * name selects JSON for text that parses as JSON, and the extension is
987
+ * forced from the classified type.
988
+ */
974
989
  filename?: string;
975
990
  };
976
991
  } | {
@@ -2429,7 +2429,11 @@ export type BlockPostSource = {
2429
2429
  imageIndexes?: number[];
2430
2430
  } | {
2431
2431
  kind: 'published';
2432
- /** Ids returned by a previous `usePublishGenerationOutputs()` publish. */
2432
+ /**
2433
+ * Ids returned by a previous `usePublishGenerationOutputs()` publish, or
2434
+ * by an in-tab `bytes` upload (`useUploadImageBytes()` in
2435
+ * `@civitai/blocks-react`; page apps only).
2436
+ */
2433
2437
  imageIds: number[];
2434
2438
  };
2435
2439
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civitai/app-sdk",
3
- "version": "0.60.0",
3
+ "version": "0.62.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",