@sudobility/screenwriter_types 0.1.6 → 0.1.8

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.
@@ -72,8 +72,8 @@ export interface AdminUserRestoreResponse {
72
72
  /**
73
73
  * `DELETE /admin/users/:uid`: schedules an IMMEDIATE deletion (no grace period) and revokes the user's API keys and
74
74
  * share links — the same bounded action `DELETE /me` takes, admin-triggered. **Not** a destructive data purge: no
75
- * `system.purge` job exists anywhere in this codebase yet to actually delete a user's workspaces/documents/content,
76
- * and `workspaces.created_by` is `ON DELETE RESTRICT`, so a raw row delete cannot work without first reassigning
75
+ * `system.purge` job exists anywhere in this codebase yet to actually delete a user's entities/documents/content,
76
+ * and `entities.created_by` is `ON DELETE RESTRICT`, so a raw row delete cannot work without first reassigning
77
77
  * or deleting every workspace the person created — real work for that job, not this route.
78
78
  */
79
79
  export interface AdminUserPurgeResponse {
@@ -85,7 +85,7 @@ export interface AdminDocumentMeta {
85
85
  title: string;
86
86
  kind: string;
87
87
  projectId: string;
88
- workspaceId: string;
88
+ entityId: string;
89
89
  ownerEmail: string | null;
90
90
  epoch: number;
91
91
  schemaVersion: number;
@@ -522,7 +522,7 @@ export interface AiEstimateResponse {
522
522
  withinLimit: boolean;
523
523
  balance: number;
524
524
  }
525
- /** `GET /me/ai-activity`, `GET /workspaces/:wid/ai-activity` (the latter adds `userId`). */
525
+ /** `GET /me/ai-activity`, `GET /entities/:wid/ai-activity` (the latter adds `userId`). */
526
526
  export interface AiActivityItem {
527
527
  jobId: string;
528
528
  task: AiTask;
@@ -3,7 +3,7 @@
3
3
  * Platform-free: no clock is read here, so the envelope carries no timestamp.
4
4
  */
5
5
  /** Every REST error code and its fixed HTTP status (spec 05 §12). */
6
- declare const ERROR_TABLE: readonly [readonly ["UNAUTHORIZED", 401], readonly ["REAUTH_REQUIRED", 401], readonly ["API_KEY_FORBIDDEN", 403], readonly ["FORBIDDEN", 403], readonly ["ROLE_ESCALATION", 403], readonly ["NOT_FOUND", 404], readonly ["PROJECT_NOT_FOUND", 404], readonly ["DOCUMENT_NOT_FOUND", 404], readonly ["SNAPSHOT_NOT_FOUND", 404], readonly ["TEMPLATE_NOT_FOUND", 404], readonly ["ITEM_NOT_FOUND", 404], readonly ["ANCHOR_NOT_FOUND", 404], readonly ["TARGET_NOT_FOUND", 404], readonly ["VALIDATION", 400], readonly ["COMMAND_INVALID", 422], readonly ["TEMPLATE_INVALID", 422], readonly ["CONFIRMATION_MISMATCH", 400], readonly ["EPOCH_MISMATCH", 409], readonly ["DOCUMENT_LOCKED", 423], readonly ["DOCUMENT_BUSY", 409], readonly ["JOB_ALREADY_RUNNING", 409], readonly ["JOB_FINISHED", 409], readonly ["JOB_NOT_FINISHED", 409], readonly ["LAST_OWNER", 409], readonly ["ALREADY_MEMBER", 409], readonly ["NOT_A_MEMBER", 409], readonly ["PERSONAL_WORKSPACE_IMMUTABLE", 409], readonly ["OWNS_TEAM_WORKSPACE", 409], readonly ["NOT_IN_TRASH", 409], readonly ["PARENT_IN_TRASH", 409], readonly ["FOLDER_DEPTH", 409], readonly ["FOLDER_CYCLE", 409], readonly ["MOVE_FORBIDDEN", 403], readonly ["BUILTIN_IMMUTABLE", 409], readonly ["LOCATOR_AMBIGUOUS", 409], readonly ["INVITATION_INVALID", 410], readonly ["INVITATION_EXPIRED", 410], readonly ["INVITATION_CLOSED", 410], readonly ["EMAIL_MISMATCH", 403], readonly ["SHARE_LINK_INVALID", 404], readonly ["SHARE_LINK_PASSWORD_REQUIRED", 401], readonly ["WATERMARK_REQUIRED", 403], readonly ["EDIT_WINDOW_CLOSED", 409], readonly ["ASSET_TOO_LARGE", 413], readonly ["IMPORT_TOO_LARGE", 413], readonly ["UNSUPPORTED_FORMAT", 400], readonly ["IMPORT_FAILED", 400], readonly ["IMPORT_INVALID", 422], readonly ["ASSET_TYPE_REJECTED", 415], readonly ["ASSET_CHECKSUM_MISMATCH", 422], readonly ["ASSET_NOT_READY", 409], readonly ["ASSET_IN_USE", 409], readonly ["UPLOAD_INCOMPLETE", 409], readonly ["UPLOAD_EXPIRED", 410], readonly ["STORAGE_QUOTA_EXCEEDED", 507], readonly ["STORAGE_UNAVAILABLE", 503], readonly ["IMPORT_FORMAT_UNSUPPORTED", 415], readonly ["EXPORT_FORMAT_UNSUPPORTED", 415], readonly ["COMPARE_TOO_LARGE", 413], readonly ["LIMIT_EXCEEDED", 409], readonly ["RATE_LIMITED", 429], readonly ["QUOTA_EXCEEDED", 429], readonly ["INSUFFICIENT_CREDITS", 402], readonly ["AI_UNAVAILABLE", 503], readonly ["AI_INPUT_TOO_LARGE", 413], readonly ["AI_GENERATION_FAILED", 502], readonly ["AI_OUTPUT_INVALID", 502], readonly ["CONFIG_MISSING", 503], readonly ["CLIENT_TOO_OLD", 426], readonly ["CONTENT_CHANGED", 409], readonly ["STYLE_NOT_IN_TEMPLATE", 422], readonly ["NOT_CONTIGUOUS", 422], readonly ["LOCKED_CONTENT", 409], readonly ["NAME_COLLISION", 409], readonly ["KIND_MISMATCH", 422], readonly ["OVERLAPPING_SHOTS", 422], readonly ["OVERLAPPING_NODE", 422], readonly ["SCENES_LOCKED", 409], readonly ["NOT_LOCKED", 409], readonly ["RANGE_OUT_OF_BOUNDS", 422], readonly ["INVALID_TARGET", 422], readonly ["INVALID_DUAL_DIALOGUE", 422], readonly ["FOUNTAIN_PARSE_ERROR", 422], readonly ["UNMAPPED_STYLES", 422], readonly ["RANGE_TOO_LARGE", 413], readonly ["PAYLOAD_TOO_LARGE", 413], readonly ["INVALID_REGEX", 400], readonly ["REPORT_OPTIONS_INVALID", 400], readonly ["REPORT_KIND_UNAVAILABLE", 501], readonly ["ENTITY_IN_USE", 409], readonly ["VARIANT_IN_USE", 409], readonly ["SNAPSHOT_NOT_IN_DOCUMENT", 404], readonly ["ITEM_NOT_IN_SNAPSHOT", 404], readonly ["INVALID_LOCATOR", 400], readonly ["LOCATOR_NOT_FOUND", 404], readonly ["ROLE_NOT_ALLOWED_FOR_TARGET", 422], readonly ["ID_CONFLICT", 409], readonly ["IDEMPOTENCY_KEY_REUSED", 409], readonly ["IDEMPOTENCY_IN_PROGRESS", 409], readonly ["DEVICE_REVOKED", 403], readonly ["MACRO_TRIGGER_TAKEN", 409], readonly ["STALE_WRITE", 409], readonly ["HANDOFF_INVALID", 410], readonly ["WATERMARK_NOT_FOUND", 404], readonly ["OCR_UNAVAILABLE", 503], readonly ["GRAMMAR_UNAVAILABLE", 503], readonly ["AI_CONSENT_REQUIRED", 403], readonly ["AI_DISABLED_FOR_WORKSPACE", 403], readonly ["AI_EXCLUDED_DOCUMENT", 403], readonly ["AI_KEY_NOT_PERMITTED", 403], readonly ["QUOTE_EXCEEDS_MAX", 402], readonly ["AI_CONTENT_REFUSED", 422], readonly ["SCOPE_TOO_LARGE", 413], readonly ["SUGGESTION_UNAVAILABLE", 409], readonly ["JOB_KIND_DISABLED", 501], readonly ["JOB_KIND_NOT_GENERIC", 400], readonly ["JOB_FAILED", 409], readonly ["JOB_TIMEOUT", 504], readonly ["LIKENESS_CONSENT_REQUIRED", 422], readonly ["CONTENT_REJECTED", 422], readonly ["INTERNAL", 500]];
6
+ declare const ERROR_TABLE: readonly [readonly ["UNAUTHORIZED", 401], readonly ["REAUTH_REQUIRED", 401], readonly ["API_KEY_FORBIDDEN", 403], readonly ["FORBIDDEN", 403], readonly ["ROLE_ESCALATION", 403], readonly ["NOT_FOUND", 404], readonly ["PROJECT_NOT_FOUND", 404], readonly ["DOCUMENT_NOT_FOUND", 404], readonly ["SNAPSHOT_NOT_FOUND", 404], readonly ["TEMPLATE_NOT_FOUND", 404], readonly ["ITEM_NOT_FOUND", 404], readonly ["ANCHOR_NOT_FOUND", 404], readonly ["TARGET_NOT_FOUND", 404], readonly ["VALIDATION", 400], readonly ["COMMAND_INVALID", 422], readonly ["TEMPLATE_INVALID", 422], readonly ["CONFIRMATION_MISMATCH", 400], readonly ["EPOCH_MISMATCH", 409], readonly ["DOCUMENT_LOCKED", 423], readonly ["DOCUMENT_BUSY", 409], readonly ["JOB_ALREADY_RUNNING", 409], readonly ["JOB_FINISHED", 409], readonly ["JOB_NOT_FINISHED", 409], readonly ["LAST_OWNER", 409], readonly ["ALREADY_MEMBER", 409], readonly ["NOT_A_MEMBER", 409], readonly ["PERSONAL_WORKSPACE_IMMUTABLE", 409], readonly ["OWNS_TEAM_WORKSPACE", 409], readonly ["NOT_IN_TRASH", 409], readonly ["PARENT_IN_TRASH", 409], readonly ["FOLDER_DEPTH", 409], readonly ["FOLDER_CYCLE", 409], readonly ["MOVE_FORBIDDEN", 403], readonly ["BUILTIN_IMMUTABLE", 409], readonly ["LOCATOR_AMBIGUOUS", 409], readonly ["INVITATION_INVALID", 410], readonly ["INVITATION_EXPIRED", 410], readonly ["INVITATION_CLOSED", 410], readonly ["EMAIL_MISMATCH", 403], readonly ["SHARE_LINK_INVALID", 404], readonly ["SHARE_LINK_PASSWORD_REQUIRED", 401], readonly ["WATERMARK_REQUIRED", 403], readonly ["EDIT_WINDOW_CLOSED", 409], readonly ["ASSET_TOO_LARGE", 413], readonly ["IMPORT_TOO_LARGE", 413], readonly ["UNSUPPORTED_FORMAT", 400], readonly ["IMPORT_FAILED", 400], readonly ["IMPORT_INVALID", 422], readonly ["ASSET_TYPE_REJECTED", 415], readonly ["ASSET_CHECKSUM_MISMATCH", 422], readonly ["ASSET_NOT_READY", 409], readonly ["ASSET_IN_USE", 409], readonly ["UPLOAD_INCOMPLETE", 409], readonly ["UPLOAD_EXPIRED", 410], readonly ["STORAGE_QUOTA_EXCEEDED", 507], readonly ["STORAGE_UNAVAILABLE", 503], readonly ["IMPORT_FORMAT_UNSUPPORTED", 415], readonly ["EXPORT_FORMAT_UNSUPPORTED", 415], readonly ["COMPARE_TOO_LARGE", 413], readonly ["LIMIT_EXCEEDED", 409], readonly ["RATE_LIMITED", 429], readonly ["QUOTA_EXCEEDED", 429], readonly ["INSUFFICIENT_CREDITS", 402], readonly ["COUPON_NOT_FOUND", 404], readonly ["COUPON_EMAIL_MISMATCH", 403], readonly ["COUPON_ALREADY_REDEEMED", 409], readonly ["COUPON_EXPIRED", 410], readonly ["AI_UNAVAILABLE", 503], readonly ["AI_INPUT_TOO_LARGE", 413], readonly ["AI_GENERATION_FAILED", 502], readonly ["AI_OUTPUT_INVALID", 502], readonly ["CONFIG_MISSING", 503], readonly ["CLIENT_TOO_OLD", 426], readonly ["CONTENT_CHANGED", 409], readonly ["STYLE_NOT_IN_TEMPLATE", 422], readonly ["NOT_CONTIGUOUS", 422], readonly ["LOCKED_CONTENT", 409], readonly ["NAME_COLLISION", 409], readonly ["KIND_MISMATCH", 422], readonly ["OVERLAPPING_SHOTS", 422], readonly ["OVERLAPPING_NODE", 422], readonly ["SCENES_LOCKED", 409], readonly ["NOT_LOCKED", 409], readonly ["RANGE_OUT_OF_BOUNDS", 422], readonly ["INVALID_TARGET", 422], readonly ["INVALID_DUAL_DIALOGUE", 422], readonly ["FOUNTAIN_PARSE_ERROR", 422], readonly ["UNMAPPED_STYLES", 422], readonly ["RANGE_TOO_LARGE", 413], readonly ["PAYLOAD_TOO_LARGE", 413], readonly ["INVALID_REGEX", 400], readonly ["REPORT_OPTIONS_INVALID", 400], readonly ["REPORT_KIND_UNAVAILABLE", 501], readonly ["ENTITY_IN_USE", 409], readonly ["VARIANT_IN_USE", 409], readonly ["SNAPSHOT_NOT_IN_DOCUMENT", 404], readonly ["ITEM_NOT_IN_SNAPSHOT", 404], readonly ["INVALID_LOCATOR", 400], readonly ["LOCATOR_NOT_FOUND", 404], readonly ["ROLE_NOT_ALLOWED_FOR_TARGET", 422], readonly ["ID_CONFLICT", 409], readonly ["IDEMPOTENCY_KEY_REUSED", 409], readonly ["IDEMPOTENCY_IN_PROGRESS", 409], readonly ["DEVICE_REVOKED", 403], readonly ["MACRO_TRIGGER_TAKEN", 409], readonly ["STALE_WRITE", 409], readonly ["HANDOFF_INVALID", 410], readonly ["WATERMARK_NOT_FOUND", 404], readonly ["OCR_UNAVAILABLE", 503], readonly ["GRAMMAR_UNAVAILABLE", 503], readonly ["AI_CONSENT_REQUIRED", 403], readonly ["AI_DISABLED_FOR_WORKSPACE", 403], readonly ["AI_EXCLUDED_DOCUMENT", 403], readonly ["AI_KEY_NOT_PERMITTED", 403], readonly ["QUOTE_EXCEEDS_MAX", 402], readonly ["AI_CONTENT_REFUSED", 422], readonly ["SCOPE_TOO_LARGE", 413], readonly ["SUGGESTION_UNAVAILABLE", 409], readonly ["JOB_KIND_DISABLED", 501], readonly ["JOB_KIND_NOT_GENERIC", 400], readonly ["JOB_FAILED", 409], readonly ["JOB_TIMEOUT", 504], readonly ["LIKENESS_CONSENT_REQUIRED", 422], readonly ["CONTENT_REJECTED", 422], readonly ["INTERNAL", 500]];
7
7
  type ErrorTable = typeof ERROR_TABLE;
8
8
  export type ApiErrorCode = ErrorTable[number][0];
9
9
  export declare const API_ERROR_CODES: { readonly [C in ApiErrorCode]: C; };
@@ -15,8 +15,8 @@ export declare const API_ROUTES: {
15
15
  readonly health: RouteSpec;
16
16
  readonly meGet: RouteSpec;
17
17
  readonly mePatch: RouteSpec;
18
- readonly workspacesList: RouteSpec;
19
- readonly workspaceGet: RouteSpec;
18
+ readonly entitiesList: RouteSpec;
19
+ readonly entityGetDetails: RouteSpec;
20
20
  readonly projectsList: RouteSpec;
21
21
  readonly projectCreate: RouteSpec;
22
22
  readonly projectGet: RouteSpec;
@@ -81,24 +81,25 @@ export declare const API_ROUTES: {
81
81
  readonly aiSuggestionSetGet: RouteSpec;
82
82
  readonly aiSuggestionSetAccept: RouteSpec;
83
83
  readonly aiSuggestionSetReject: RouteSpec;
84
- readonly workspaceCreate: RouteSpec;
85
- readonly workspaceUpdate: RouteSpec;
86
- readonly workspaceDelete: RouteSpec;
87
- readonly workspaceTransfer: RouteSpec;
88
- readonly workspaceLeave: RouteSpec;
89
- readonly workspaceUsage: RouteSpec;
90
- readonly workspaceAudit: RouteSpec;
84
+ readonly entityCreate: RouteSpec;
85
+ readonly entityUpdate: RouteSpec;
86
+ readonly entityDelete: RouteSpec;
87
+ readonly entityTransfer: RouteSpec;
88
+ readonly entityLeave: RouteSpec;
89
+ readonly managedEntityUsage: RouteSpec;
90
+ readonly entityAudit: RouteSpec;
91
91
  readonly membersList: RouteSpec;
92
92
  readonly memberUpdate: RouteSpec;
93
93
  readonly memberRemove: RouteSpec;
94
- readonly invitationCreateWorkspace: RouteSpec;
94
+ readonly invitationCreateEntity: RouteSpec;
95
95
  readonly invitationCreateProject: RouteSpec;
96
96
  readonly invitationCreateDocument: RouteSpec;
97
- readonly workspaceInvitationsList: RouteSpec;
97
+ readonly entityInvitationsList: RouteSpec;
98
98
  readonly myInvitations: RouteSpec;
99
99
  readonly invitationRenew: RouteSpec;
100
100
  readonly invitationCancel: RouteSpec;
101
101
  readonly invitationAccept: RouteSpec;
102
+ readonly invitationAcceptById: RouteSpec;
102
103
  readonly invitationDecline: RouteSpec;
103
104
  readonly sharedWithMe: RouteSpec;
104
105
  readonly documentLock: RouteSpec;
@@ -125,7 +126,7 @@ export declare const API_ROUTES: {
125
126
  readonly jobOutputs: RouteSpec;
126
127
  readonly jobRecipients: RouteSpec;
127
128
  readonly jobWebhook: RouteSpec;
128
- readonly entitiesList: RouteSpec;
129
+ readonly documentEntitiesList: RouteSpec;
129
130
  readonly entityGet: RouteSpec;
130
131
  readonly entityUsage: RouteSpec;
131
132
  readonly entityDialogue: RouteSpec;
@@ -252,6 +253,10 @@ export declare const API_ROUTES: {
252
253
  readonly aiReportNoteConvert: RouteSpec;
253
254
  readonly aiSuggestionSetDecide: RouteSpec;
254
255
  readonly consumablesBalance: RouteSpec;
256
+ readonly consumablesPurchaseTarget: RouteSpec;
257
+ readonly consumablesRedeemCoupon: RouteSpec;
258
+ readonly consumablesCouponsList: RouteSpec;
259
+ readonly consumablesCouponsCreate: RouteSpec;
255
260
  readonly consumablesPurchases: RouteSpec;
256
261
  readonly consumablesUsages: RouteSpec;
257
262
  readonly consumablesProducts: RouteSpec;
@@ -56,11 +56,11 @@ export declare const ASSET_TARGET_KINDS: readonly ["document", "scene", "element
56
56
  export type AssetTargetKind = (typeof ASSET_TARGET_KINDS)[number];
57
57
  export declare const assetTargetKindSchema: z.ZodEnum<{
58
58
  scene: "scene";
59
+ entity: "entity";
59
60
  document: "document";
60
61
  snapshot: "snapshot";
61
62
  element: "element";
62
63
  shot: "shot";
63
- entity: "entity";
64
64
  beat: "beat";
65
65
  title_page: "title_page";
66
66
  }>;
@@ -119,10 +119,10 @@ export declare const assetSourceRefSchema: z.ZodObject<{
119
119
  snapshotId: z.ZodOptional<z.ZodString>;
120
120
  targetKind: z.ZodEnum<{
121
121
  scene: "scene";
122
+ entity: "entity";
122
123
  document: "document";
123
124
  element: "element";
124
125
  shot: "shot";
125
- entity: "entity";
126
126
  beat: "beat";
127
127
  title_page: "title_page";
128
128
  }>;
@@ -141,10 +141,10 @@ export declare const assetProvenanceInputSchema: z.ZodDiscriminatedUnion<[z.ZodO
141
141
  snapshotId: z.ZodOptional<z.ZodString>;
142
142
  targetKind: z.ZodEnum<{
143
143
  scene: "scene";
144
+ entity: "entity";
144
145
  document: "document";
145
146
  element: "element";
146
147
  shot: "shot";
147
- entity: "entity";
148
148
  beat: "beat";
149
149
  title_page: "title_page";
150
150
  }>;
@@ -175,10 +175,10 @@ export declare const assetProvenanceInputSchema: z.ZodDiscriminatedUnion<[z.ZodO
175
175
  snapshotId: z.ZodOptional<z.ZodString>;
176
176
  targetKind: z.ZodEnum<{
177
177
  scene: "scene";
178
+ entity: "entity";
178
179
  document: "document";
179
180
  element: "element";
180
181
  shot: "shot";
181
- entity: "entity";
182
182
  beat: "beat";
183
183
  title_page: "title_page";
184
184
  }>;
@@ -244,7 +244,7 @@ export interface AssetVersion {
244
244
  }
245
245
  export interface AssetSummary {
246
246
  id: string;
247
- workspaceId: string;
247
+ entityId: string;
248
248
  kind: AssetKind;
249
249
  title: string;
250
250
  description: string;
@@ -265,11 +265,11 @@ export interface AssetSummary {
265
265
  }
266
266
  export interface AssetLink {
267
267
  id: string;
268
- workspaceId: string;
268
+ entityId: string;
269
269
  assetId: string;
270
270
  /** Null = follow the asset's current version. */
271
271
  pinnedVersionId: string | null;
272
- /** Null = a workspace-level link (its target is `{kind: 'document', id: <workspaceId>}`). */
272
+ /** Null = a workspace-level link (its target is `{kind: 'document', id: <entityId>}`). */
273
273
  documentId: string | null;
274
274
  targetKind: AssetTargetKind;
275
275
  targetId: string;
@@ -318,10 +318,10 @@ export declare const assetUploadRequestSchema: z.ZodObject<{
318
318
  snapshotId: z.ZodOptional<z.ZodString>;
319
319
  targetKind: z.ZodEnum<{
320
320
  scene: "scene";
321
+ entity: "entity";
321
322
  document: "document";
322
323
  element: "element";
323
324
  shot: "shot";
324
- entity: "entity";
325
325
  beat: "beat";
326
326
  title_page: "title_page";
327
327
  }>;
@@ -352,10 +352,10 @@ export declare const assetUploadRequestSchema: z.ZodObject<{
352
352
  snapshotId: z.ZodOptional<z.ZodString>;
353
353
  targetKind: z.ZodEnum<{
354
354
  scene: "scene";
355
+ entity: "entity";
355
356
  document: "document";
356
357
  element: "element";
357
358
  shot: "shot";
358
- entity: "entity";
359
359
  beat: "beat";
360
360
  title_page: "title_page";
361
361
  }>;
@@ -441,7 +441,7 @@ export interface AssetAbortResponse {
441
441
  export declare const assetListQuerySchema: z.ZodObject<{
442
442
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
443
443
  cursor: z.ZodOptional<z.ZodString>;
444
- workspaceId: z.ZodOptional<z.ZodString>;
444
+ entityId: z.ZodOptional<z.ZodString>;
445
445
  documentId: z.ZodOptional<z.ZodString>;
446
446
  linkedTo: z.ZodOptional<z.ZodString>;
447
447
  role: z.ZodOptional<z.ZodEnum<{
@@ -537,11 +537,11 @@ export declare const assetLinkCreateSchema: z.ZodObject<{
537
537
  target: z.ZodObject<{
538
538
  kind: z.ZodEnum<{
539
539
  scene: "scene";
540
+ entity: "entity";
540
541
  document: "document";
541
542
  snapshot: "snapshot";
542
543
  element: "element";
543
544
  shot: "shot";
544
- entity: "entity";
545
545
  beat: "beat";
546
546
  title_page: "title_page";
547
547
  }>;
@@ -630,11 +630,11 @@ export type AssetLinkUpdateRequest = z.input<typeof assetLinkUpdateSchema>;
630
630
  export declare const documentAssetLinksQuerySchema: z.ZodObject<{
631
631
  targetKind: z.ZodOptional<z.ZodEnum<{
632
632
  scene: "scene";
633
+ entity: "entity";
633
634
  document: "document";
634
635
  snapshot: "snapshot";
635
636
  element: "element";
636
637
  shot: "shot";
637
- entity: "entity";
638
638
  beat: "beat";
639
639
  title_page: "title_page";
640
640
  }>>;
@@ -689,9 +689,9 @@ export declare const STALENESS_TARGET_KINDS: readonly ["scene", "element", "shot
689
689
  export declare const documentStalenessQuerySchema: z.ZodObject<{
690
690
  targetKind: z.ZodOptional<z.ZodEnum<{
691
691
  scene: "scene";
692
+ entity: "entity";
692
693
  element: "element";
693
694
  shot: "shot";
694
- entity: "entity";
695
695
  }>>;
696
696
  }, z.core.$strip>;
697
697
  export type DocumentStalenessQuery = z.output<typeof documentStalenessQuerySchema>;
@@ -42,7 +42,7 @@ export interface Notification {
42
42
  kind: NotificationKind;
43
43
  /** Ids and display strings only; never document/script content (spec 05 §8.7). */
44
44
  payload: Record<string, unknown>;
45
- workspaceId: string | null;
45
+ entityId: string | null;
46
46
  documentId: string | null;
47
47
  readAt: string | null;
48
48
  createdAt: string;
@@ -134,7 +134,7 @@ export interface ActivityEvent {
134
134
  targetIds: string[];
135
135
  createdAt: string;
136
136
  }
137
- /** `GET /workspaces/:wid/activity` items also carry the document they happened on. */
137
+ /** `GET /entities/:wid/activity` items also carry the document they happened on. */
138
138
  export interface WorkspaceActivityEvent extends ActivityEvent {
139
139
  documentId: string | null;
140
140
  }
@@ -24,3 +24,27 @@ export interface PurchaseHandoffResponse {
24
24
  handoffUrl: string;
25
25
  expiresAt: string;
26
26
  }
27
+ export interface CreditCouponHistoryItem {
28
+ entityId: string;
29
+ userId: string;
30
+ credits: number;
31
+ redeemedAt: string;
32
+ }
33
+ export interface CreditCoupon {
34
+ id: string;
35
+ code: string;
36
+ credits: number;
37
+ expiresAt: string;
38
+ email: string | null;
39
+ createdAt: string;
40
+ history: CreditCouponHistoryItem[];
41
+ }
42
+ export interface CreditCouponCreateRequest {
43
+ credits: number;
44
+ expires_at: string;
45
+ email?: string | null;
46
+ }
47
+ export interface CreditCouponRedeemResponse {
48
+ credits: number;
49
+ balance: number;
50
+ }