@sudobility/screenwriter_types 0.1.7 → 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.
@@ -25,7 +25,7 @@ export declare const UPLOAD_PURPOSES: readonly ["state", "watermark_lookup", "im
25
25
  export type UploadPurpose = (typeof UPLOAD_PURPOSES)[number];
26
26
  /**
27
27
  * `POST /uploads/state`. `purpose` defaults to `state` (a Yjs state blob); `watermark_lookup` is a leaked file for
28
- * `POST /workspaces/:wid/watermark-lookup`. `import` uploads are created by `POST /imports`, never here.
28
+ * `POST /entities/:wid/watermark-lookup`. `import` uploads are created by `POST /imports`, never here.
29
29
  */
30
30
  export declare const uploadStateRequestSchema: z.ZodObject<{
31
31
  sizeBytes: z.ZodNumber;
@@ -89,10 +89,10 @@ export declare const importCreateSchema: z.ZodObject<{
89
89
  targetProjectId: z.ZodOptional<z.ZodString>;
90
90
  templateTarget: z.ZodOptional<z.ZodObject<{
91
91
  scope: z.ZodEnum<{
92
- workspace: "workspace";
92
+ entity: "entity";
93
93
  user: "user";
94
94
  }>;
95
- workspaceId: z.ZodOptional<z.ZodString>;
95
+ entityId: z.ZodOptional<z.ZodString>;
96
96
  }, z.core.$strip>>;
97
97
  }, z.core.$strip>;
98
98
  export type ImportCreateRequest = z.input<typeof importCreateSchema>;
@@ -16,7 +16,7 @@ export interface ApiKeySummary {
16
16
  name: string;
17
17
  /** The 8-char public prefix. */
18
18
  prefix: string;
19
- workspaceId: string;
19
+ entityId: string;
20
20
  scope: ApiKeyScope;
21
21
  ai: boolean;
22
22
  createdAt: string;
@@ -26,7 +26,7 @@ export interface ApiKeySummary {
26
26
  }
27
27
  export declare const apiKeyCreateSchema: z.ZodObject<{
28
28
  name: z.ZodString;
29
- workspaceId: z.ZodString;
29
+ entityId: z.ZodString;
30
30
  scope: z.ZodEnum<{
31
31
  read: "read";
32
32
  read_write: "read_write";
package/dist/keys.js CHANGED
@@ -5,7 +5,7 @@ const API_KEY_MAX_ACTIVE = 25;
5
5
  const API_KEY_FORMAT_RE = /^fwk_([a-z0-9]{8})_([A-Za-z0-9_-]{43})$/;
6
6
  const apiKeyCreateSchema = z.object({
7
7
  name: z.string().trim().min(1).max(60),
8
- workspaceId: z.string().min(1),
8
+ entityId: z.string().min(1),
9
9
  scope: apiKeyScopeSchema,
10
10
  ai: z.boolean().default(false),
11
11
  expiresInDays: z.number().int().min(1).max(365).optional()
package/dist/keys.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"keys.js","sources":["../src/keys/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n/** Personal API keys (`fwk_`), spec 05 4.2 and 6.5. */\nexport const API_KEY_SCOPES = ['read', 'read_write'] as const;\nexport type ApiKeyScope = (typeof API_KEY_SCOPES)[number];\nexport const apiKeyScopeSchema = z.enum(API_KEY_SCOPES);\n\n/** At most this many active (unrevoked) keys per user. */\nexport const API_KEY_MAX_ACTIVE = 25;\n\n/** `fwk_` + 8-char public prefix + `_` + 32 bytes base64url secret. */\nexport const API_KEY_FORMAT_RE = /^fwk_([a-z0-9]{8})_([A-Za-z0-9_-]{43})$/;\n\n/** `GET /api-keys` item. Never contains the secret. */\nexport interface ApiKeySummary {\n id: string;\n name: string;\n /** The 8-char public prefix. */\n prefix: string;\n workspaceId: string;\n scope: ApiKeyScope;\n ai: boolean;\n createdAt: string;\n lastUsedAt: string | null;\n expiresAt: string | null;\n revokedAt: string | null;\n}\n\nexport const apiKeyCreateSchema = z.object({\n name: z.string().trim().min(1).max(60),\n workspaceId: z.string().min(1),\n scope: apiKeyScopeSchema,\n ai: z.boolean().default(false),\n expiresInDays: z.number().int().min(1).max(365).optional(),\n});\nexport type ApiKeyCreateRequest = z.input<typeof apiKeyCreateSchema>;\n\n/** `POST /api-keys` response: the only time `key` is ever returned. */\nexport type ApiKeyCreated = ApiKeySummary & { key: string };\n\nexport const apiKeyUpdateSchema = z.object({\n name: z.string().trim().min(1).max(60).optional(),\n ai: z.boolean().optional(),\n});\nexport type ApiKeyUpdateRequest = z.infer<typeof apiKeyUpdateSchema>;\n\n/** `DELETE /api-keys/:kid` response. */\nexport interface ApiKeyRevokeResponse {\n revokedAt: string;\n}\n\n/** Sent by API clients so command transactions record the right origin (`fadewright-mcp/<version>`). */\nexport const CLIENT_HEADER = 'X-Client';\nexport const MCP_CLIENT_NAME = 'fadewright-mcp';\n"],"names":[],"mappings":";AAGO,MAAM,iBAAiB,CAAC,QAAQ,YAAY;AAE5C,MAAM,oBAAoB,EAAE,KAAK,cAAc;AAG/C,MAAM,qBAAqB;AAG3B,MAAM,oBAAoB;AAiB1B,MAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EACrC,aAAa,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,OAAO;AAAA,EACP,IAAI,EAAE,UAAU,QAAQ,KAAK;AAAA,EAC7B,eAAe,EAAE,OAAA,EAAS,IAAA,EAAM,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAA;AAClD,CAAC;AAMM,MAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EACvC,IAAI,EAAE,QAAA,EAAU,SAAA;AAClB,CAAC;AASM,MAAM,gBAAgB;AACtB,MAAM,kBAAkB;"}
1
+ {"version":3,"file":"keys.js","sources":["../src/keys/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n/** Personal API keys (`fwk_`), spec 05 4.2 and 6.5. */\nexport const API_KEY_SCOPES = ['read', 'read_write'] as const;\nexport type ApiKeyScope = (typeof API_KEY_SCOPES)[number];\nexport const apiKeyScopeSchema = z.enum(API_KEY_SCOPES);\n\n/** At most this many active (unrevoked) keys per user. */\nexport const API_KEY_MAX_ACTIVE = 25;\n\n/** `fwk_` + 8-char public prefix + `_` + 32 bytes base64url secret. */\nexport const API_KEY_FORMAT_RE = /^fwk_([a-z0-9]{8})_([A-Za-z0-9_-]{43})$/;\n\n/** `GET /api-keys` item. Never contains the secret. */\nexport interface ApiKeySummary {\n id: string;\n name: string;\n /** The 8-char public prefix. */\n prefix: string;\n entityId: string;\n scope: ApiKeyScope;\n ai: boolean;\n createdAt: string;\n lastUsedAt: string | null;\n expiresAt: string | null;\n revokedAt: string | null;\n}\n\nexport const apiKeyCreateSchema = z.object({\n name: z.string().trim().min(1).max(60),\n entityId: z.string().min(1),\n scope: apiKeyScopeSchema,\n ai: z.boolean().default(false),\n expiresInDays: z.number().int().min(1).max(365).optional(),\n});\nexport type ApiKeyCreateRequest = z.input<typeof apiKeyCreateSchema>;\n\n/** `POST /api-keys` response: the only time `key` is ever returned. */\nexport type ApiKeyCreated = ApiKeySummary & { key: string };\n\nexport const apiKeyUpdateSchema = z.object({\n name: z.string().trim().min(1).max(60).optional(),\n ai: z.boolean().optional(),\n});\nexport type ApiKeyUpdateRequest = z.infer<typeof apiKeyUpdateSchema>;\n\n/** `DELETE /api-keys/:kid` response. */\nexport interface ApiKeyRevokeResponse {\n revokedAt: string;\n}\n\n/** Sent by API clients so command transactions record the right origin (`fadewright-mcp/<version>`). */\nexport const CLIENT_HEADER = 'X-Client';\nexport const MCP_CLIENT_NAME = 'fadewright-mcp';\n"],"names":[],"mappings":";AAGO,MAAM,iBAAiB,CAAC,QAAQ,YAAY;AAE5C,MAAM,oBAAoB,EAAE,KAAK,cAAc;AAG/C,MAAM,qBAAqB;AAG3B,MAAM,oBAAoB;AAiB1B,MAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EACrC,UAAU,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,OAAO;AAAA,EACP,IAAI,EAAE,UAAU,QAAQ,KAAK;AAAA,EAC7B,eAAe,EAAE,OAAA,EAAS,IAAA,EAAM,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAA;AAClD,CAAC;AAMM,MAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAA,EAAS,KAAA,EAAO,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EACvC,IAAI,EAAE,QAAA,EAAU,SAAA;AAClB,CAAC;AASM,MAAM,gBAAgB;AACtB,MAAM,kBAAkB;"}
@@ -37,7 +37,7 @@ export declare const projectPurgeSchema: z.ZodObject<{
37
37
  export type ProjectPurgeRequest = z.infer<typeof projectPurgeSchema>;
38
38
  export declare const projectDuplicateSchema: z.ZodObject<{
39
39
  name: z.ZodString;
40
- targetWorkspaceId: z.ZodOptional<z.ZodString>;
40
+ targetEntityId: z.ZodOptional<z.ZodString>;
41
41
  includeSnapshots: z.ZodDefault<z.ZodBoolean>;
42
42
  includeAssets: z.ZodDefault<z.ZodBoolean>;
43
43
  }, z.core.$strip>;
@@ -87,7 +87,7 @@ export interface ApplyTemplateResult {
87
87
  remapped: number;
88
88
  preTemplateSnapshotId: string;
89
89
  }
90
- /** `GET /workspaces/:wid/documents`: across every project; `starred` is the caller's own stars (`document_stars`). */
90
+ /** `GET /entities/:wid/documents`: across every project; `starred` is the caller's own stars (`document_stars`). */
91
91
  export declare const workspaceDocumentsQuerySchema: z.ZodObject<{
92
92
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
93
93
  cursor: z.ZodOptional<z.ZodString>;
@@ -112,7 +112,7 @@ export declare const workspaceDocumentsQuerySchema: z.ZodObject<{
112
112
  export type WorkspaceDocumentsQuery = z.output<typeof workspaceDocumentsQuerySchema>;
113
113
  export declare const TRASH_ITEM_TYPES: readonly ["project", "document", "asset"];
114
114
  export type TrashItemType = (typeof TRASH_ITEM_TYPES)[number];
115
- /** `GET /workspaces/:wid/trash`. A document trashed together with its project is not listed on its own (restore the project). */
115
+ /** `GET /entities/:wid/trash`. A document trashed together with its project is not listed on its own (restore the project). */
116
116
  export interface TrashItem {
117
117
  type: TrashItemType;
118
118
  id: string;
@@ -131,7 +131,7 @@ export declare const trashEmptySchema: z.ZodObject<{
131
131
  export type TrashEmptyRequest = z.infer<typeof trashEmptySchema>;
132
132
  /** The `system.purge` job's input (also what a purge job row shows in its `requestSummary`). */
133
133
  export declare const purgeInputSchema: z.ZodObject<{
134
- workspaceId: z.ZodOptional<z.ZodString>;
134
+ entityId: z.ZodOptional<z.ZodString>;
135
135
  projectId: z.ZodOptional<z.ZodString>;
136
136
  documentId: z.ZodOptional<z.ZodString>;
137
137
  }, z.core.$strip>;
@@ -245,7 +245,7 @@ export interface WorkspaceContactDeleteResponse {
245
245
  export declare const projectDuplicateJobInputSchema: z.ZodObject<{
246
246
  projectId: z.ZodString;
247
247
  name: z.ZodString;
248
- targetWorkspaceId: z.ZodString;
248
+ targetEntityId: z.ZodString;
249
249
  includeSnapshots: z.ZodBoolean;
250
250
  includeAssets: z.ZodBoolean;
251
251
  }, z.core.$strip>;
@@ -11,7 +11,7 @@ export interface Me {
11
11
  uiLanguage: string;
12
12
  timeZone: string;
13
13
  siteAdmin: boolean;
14
- personalWorkspaceId: string;
14
+ personalEntityId: string;
15
15
  createdAt: string;
16
16
  /** Set while an account deletion is scheduled (`DELETE /me`); `POST /me/restore` clears it. */
17
17
  deletionScheduledFor?: string | null;
@@ -27,7 +27,7 @@ export declare const DOCUMENT_LABEL_MAX_CHARS = 40;
27
27
  export declare const documentLabelsSchema: z.ZodArray<z.ZodString>;
28
28
  export interface ProjectSummary {
29
29
  id: string;
30
- workspaceId: string;
30
+ entityId: string;
31
31
  name: string;
32
32
  description: string | null;
33
33
  color: string | null;
@@ -42,7 +42,7 @@ export interface ProjectSummary {
42
42
  export interface DocumentMeta {
43
43
  id: string;
44
44
  projectId: string;
45
- workspaceId: string;
45
+ entityId: string;
46
46
  folderId: string | null;
47
47
  kind: DocumentKind;
48
48
  title: string;
@@ -108,7 +108,7 @@ export declare const projectUpdateSchema: z.ZodObject<{
108
108
  play: "play";
109
109
  }>>;
110
110
  logline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
- workspaceId: z.ZodOptional<z.ZodString>;
111
+ entityId: z.ZodOptional<z.ZodString>;
112
112
  }, z.core.$strip>;
113
113
  export type ProjectUpdateRequest = z.infer<typeof projectUpdateSchema>;
114
114
  export declare const projectListQuerySchema: z.ZodObject<{
@@ -335,16 +335,16 @@ export declare const searchQuerySchema: z.ZodObject<{
335
335
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
336
336
  cursor: z.ZodOptional<z.ZodString>;
337
337
  q: z.ZodString;
338
- workspaceId: z.ZodOptional<z.ZodString>;
338
+ entityId: z.ZodOptional<z.ZodString>;
339
339
  projectId: z.ZodOptional<z.ZodString>;
340
340
  documentId: z.ZodOptional<z.ZodString>;
341
341
  types: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<{
342
342
  scene: "scene";
343
+ entity: "entity";
343
344
  document: "document";
344
345
  asset: "asset";
345
346
  note: "note";
346
347
  element: "element";
347
- entity: "entity";
348
348
  }>>, unknown>>;
349
349
  styleIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
350
350
  characterId: z.ZodOptional<z.ZodString>;
@@ -4,12 +4,12 @@
4
4
  import { z } from 'zod';
5
5
  import { type Role } from '../tenancy/index.js';
6
6
  export declare const TEAM_WORKSPACE_LIMIT = 50;
7
- export declare const workspaceCreateSchema: z.ZodObject<{
7
+ export declare const entityCreateSchema: z.ZodObject<{
8
8
  name: z.ZodString;
9
9
  avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
10
  }, z.core.$strip>;
11
- export type WorkspaceCreateRequest = z.infer<typeof workspaceCreateSchema>;
12
- export declare const workspaceUpdateSchema: z.ZodObject<{
11
+ export type EntityCreateRequest = z.infer<typeof entityCreateSchema>;
12
+ export declare const entityUpdateSchema: z.ZodObject<{
13
13
  name: z.ZodOptional<z.ZodString>;
14
14
  avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
15
  defaultTemplateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -17,28 +17,28 @@ export declare const workspaceUpdateSchema: z.ZodObject<{
17
17
  aiEnabled: z.ZodOptional<z.ZodBoolean>;
18
18
  allowPublicLinks: z.ZodOptional<z.ZodBoolean>;
19
19
  }, z.core.$strip>;
20
- export type WorkspaceUpdateRequest = z.infer<typeof workspaceUpdateSchema>;
21
- export declare const workspaceDeleteSchema: z.ZodObject<{
20
+ export type EntityUpdateRequest = z.infer<typeof entityUpdateSchema>;
21
+ export declare const entityDeleteSchema: z.ZodObject<{
22
22
  confirmName: z.ZodString;
23
23
  }, z.core.$strip>;
24
- export type WorkspaceDeleteRequest = z.infer<typeof workspaceDeleteSchema>;
25
- /** `DELETE /workspaces/:wid` response (soft delete). */
26
- export interface WorkspaceDeleteResponse {
24
+ export type EntityDeleteRequest = z.infer<typeof entityDeleteSchema>;
25
+ /** `DELETE /entities/:wid` response (soft delete). */
26
+ export interface EntityDeleteResponse {
27
27
  deletedAt: string;
28
28
  }
29
- export declare const workspaceTransferSchema: z.ZodObject<{
29
+ export declare const entityTransferSchema: z.ZodObject<{
30
30
  toUserId: z.ZodString;
31
31
  }, z.core.$strip>;
32
- export type WorkspaceTransferRequest = z.infer<typeof workspaceTransferSchema>;
33
- /** `GET /workspaces/:wid/audit.csv` query: an ISO-8601 range of at most one year. */
34
- export declare const workspaceAuditQuerySchema: z.ZodObject<{
32
+ export type EntityTransferRequest = z.infer<typeof entityTransferSchema>;
33
+ /** `GET /entities/:wid/audit.csv` query: an ISO-8601 range of at most one year. */
34
+ export declare const entityAuditQuerySchema: z.ZodObject<{
35
35
  from: z.ZodOptional<z.ZodISODateTime>;
36
36
  to: z.ZodOptional<z.ZodISODateTime>;
37
37
  }, z.core.$strip>;
38
- export type WorkspaceAuditQuery = z.infer<typeof workspaceAuditQuerySchema>;
38
+ export type EntityAuditQuery = z.infer<typeof entityAuditQuerySchema>;
39
39
  export declare const AUDIT_CSV_COLUMNS: readonly ["created_at", "actor", "action", "target_type", "target_id", "ip"];
40
40
  export declare const AUDIT_MAX_RANGE_DAYS = 366;
41
- export interface WorkspaceUsage {
41
+ export interface EntityUsageOverview {
42
42
  storageBytes: number;
43
43
  quotaBytes: number;
44
44
  documentCount: number;
@@ -62,7 +62,7 @@ export declare const memberUpdateSchema: z.ZodObject<{
62
62
  }>;
63
63
  }, z.core.$strip>;
64
64
  export type MemberUpdateRequest = z.infer<typeof memberUpdateSchema>;
65
- export declare const INVITATION_TARGETS: readonly ["workspace", "project", "document"];
65
+ export declare const INVITATION_TARGETS: readonly ["entity", "project", "document"];
66
66
  export type InvitationTarget = (typeof INVITATION_TARGETS)[number];
67
67
  export declare const INVITATION_TTL_DAYS = 14;
68
68
  export declare const INVITATION_STATUSES: readonly ["pending", "accepted", "declined", "cancelled", "expired"];
@@ -83,7 +83,7 @@ export type InvitationCreateRequest = z.infer<typeof invitationCreateSchema>;
83
83
  export interface Invitation {
84
84
  id: string;
85
85
  targetType: InvitationTarget;
86
- workspaceId: string;
86
+ entityId: string;
87
87
  projectId: string | null;
88
88
  documentId: string | null;
89
89
  email: string;
@@ -101,13 +101,13 @@ export declare const invitationAcceptSchema: z.ZodObject<{
101
101
  }, z.core.$strip>;
102
102
  export type InvitationAcceptRequest = z.infer<typeof invitationAcceptSchema>;
103
103
  export interface InvitationAcceptResult {
104
- workspaceId?: string;
104
+ entityId?: string;
105
105
  projectId?: string;
106
106
  documentId?: string;
107
107
  }
108
108
  /** Where an invitation, grant list or link list points. */
109
109
  export type ShareTarget = {
110
- type: 'workspace';
110
+ type: 'entity';
111
111
  id: string;
112
112
  } | {
113
113
  type: 'project';
@@ -145,7 +145,7 @@ export interface SharedItem {
145
145
  id: string;
146
146
  title: string;
147
147
  role: Role;
148
- workspaceId: string;
148
+ entityId: string;
149
149
  /** For a document: its project. */
150
150
  projectId: string | null;
151
151
  projectName: string | null;
@@ -1,13 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  import type { TemplateCategory } from '@sudobility/writing_core';
3
- export type TemplateScope = 'builtin' | 'user' | 'workspace';
3
+ export type TemplateScope = 'builtin' | 'user' | 'entity';
4
4
  /** `GET /templates` item (spec 05 §6.8). The full body is writing_core's Template. */
5
5
  export interface TemplateSummary {
6
6
  id: string;
7
7
  scope: TemplateScope;
8
8
  builtinKey: string | null;
9
9
  /** Set for `workspace` templates. */
10
- workspaceId: string | null;
10
+ entityId: string | null;
11
11
  name: string;
12
12
  description: string | null;
13
13
  category: TemplateCategory;
@@ -21,14 +21,14 @@ export interface TemplateSummary {
21
21
  */
22
22
  locale?: string;
23
23
  }
24
- /** `GET /templates` query: user templates always; `workspaceId` adds that workspace's; `scope` narrows.
24
+ /** `GET /templates` query: user templates always; `entityId` adds that workspace's; `scope` narrows.
25
25
  * `locale` filters built-ins to one BCP-47 language (e.g. the app's current UI language); user/workspace templates
26
26
  * are never filtered by it, since they have no locale of their own. */
27
27
  export declare const templateListQuerySchema: z.ZodObject<{
28
28
  category: z.ZodOptional<z.ZodString>;
29
- workspaceId: z.ZodOptional<z.ZodString>;
29
+ entityId: z.ZodOptional<z.ZodString>;
30
30
  scope: z.ZodOptional<z.ZodEnum<{
31
- workspace: "workspace";
31
+ entity: "entity";
32
32
  builtin: "builtin";
33
33
  user: "user";
34
34
  }>>;
@@ -41,10 +41,10 @@ export declare const templateGetQuerySchema: z.ZodObject<{
41
41
  }, z.core.$strip>;
42
42
  export declare const templateCreateSchema: z.ZodObject<{
43
43
  scope: z.ZodEnum<{
44
- workspace: "workspace";
44
+ entity: "entity";
45
45
  user: "user";
46
46
  }>;
47
- workspaceId: z.ZodOptional<z.ZodString>;
47
+ entityId: z.ZodOptional<z.ZodString>;
48
48
  template: z.ZodCustom<{
49
49
  schemaVersion: 1;
50
50
  id: import("@sudobility/writing_core").Id<"tpl">;
@@ -1673,10 +1673,10 @@ export declare const FWTEMPLATE_FORMAT_VERSION = 1;
1673
1673
  */
1674
1674
  export declare const templateImportSchema: z.ZodObject<{
1675
1675
  scope: z.ZodEnum<{
1676
- workspace: "workspace";
1676
+ entity: "entity";
1677
1677
  user: "user";
1678
1678
  }>;
1679
- workspaceId: z.ZodOptional<z.ZodString>;
1679
+ entityId: z.ZodOptional<z.ZodString>;
1680
1680
  filename: z.ZodString;
1681
1681
  contentB64: z.ZodString;
1682
1682
  }, z.core.$strip>;
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
- export declare const WORKSPACE_KINDS: readonly ["personal", "team"];
3
- export type WorkspaceKind = (typeof WORKSPACE_KINDS)[number];
2
+ export declare const ENTITY_KINDS: readonly ["personal", "team"];
3
+ export type EntityKind = (typeof ENTITY_KINDS)[number];
4
4
  /** Ordered by authority (spec 05 §5.2). */
5
5
  export declare const ROLES: readonly ["owner", "admin", "writer", "commenter", "viewer"];
6
6
  export type Role = (typeof ROLES)[number];
7
- export declare const workspaceKindSchema: z.ZodEnum<{
7
+ export declare const entityKindSchema: z.ZodEnum<{
8
8
  personal: "personal";
9
9
  team: "team";
10
10
  }>;
@@ -15,13 +15,13 @@ export declare const roleSchema: z.ZodEnum<{
15
15
  commenter: "commenter";
16
16
  viewer: "viewer";
17
17
  }>;
18
- export interface WorkspaceSummary {
18
+ export interface ManagedEntitySummary {
19
19
  id: string;
20
- kind: WorkspaceKind;
20
+ kind: EntityKind;
21
21
  name: string;
22
22
  avatarAssetId: string | null;
23
23
  }
24
- export interface Workspace extends WorkspaceSummary {
24
+ export interface ManagedEntity extends ManagedEntitySummary {
25
25
  defaultTemplateId: string | null;
26
26
  defaultLanguage: string;
27
27
  aiEnabled: boolean;
@@ -30,12 +30,12 @@ export interface Workspace extends WorkspaceSummary {
30
30
  createdAt: string;
31
31
  updatedAt: string;
32
32
  }
33
- /** `GET /workspaces` item: summary plus the caller's role. */
34
- export type WorkspaceListItem = WorkspaceSummary & {
33
+ /** `GET /entities` item: summary plus the caller's role. */
34
+ export type ManagedEntityListItem = ManagedEntitySummary & {
35
35
  role: Role;
36
36
  };
37
- /** `GET /workspaces/:wid` */
38
- export type WorkspaceDetail = Workspace & {
37
+ /** `GET /entities/:wid` */
38
+ export type ManagedEntityDetail = ManagedEntity & {
39
39
  role: Role;
40
40
  memberCount: number;
41
41
  storageBytes: number;
@@ -48,13 +48,13 @@ export type WorkspaceDetail = Workspace & {
48
48
  * - `project.trash` / `project.restore` for a writer only applies to projects they created.
49
49
  */
50
50
  export declare const PERMISSION_MIN_ROLE: {
51
- readonly 'workspace.read': "viewer";
52
- readonly 'workspace.update': "admin";
53
- readonly 'workspace.aiToggle': "owner";
54
- readonly 'workspace.audit': "admin";
55
- readonly 'workspace.delete': "owner";
56
- readonly 'workspace.transfer': "owner";
57
- readonly 'workspace.leave': "viewer";
51
+ readonly 'entity.read': "viewer";
52
+ readonly 'entity.update': "admin";
53
+ readonly 'entity.aiToggle': "owner";
54
+ readonly 'entity.audit': "admin";
55
+ readonly 'entity.delete': "owner";
56
+ readonly 'entity.transfer': "owner";
57
+ readonly 'entity.leave': "viewer";
58
58
  readonly 'members.read': "viewer";
59
59
  readonly 'members.invite': "admin";
60
60
  readonly 'members.updateRole': "admin";
@@ -1,8 +1,8 @@
1
1
  /** Fixture factories for consumers' tests (`@sudobility/screenwriter_types/test`). */
2
- import type { Workspace } from '../tenancy/index.js';
2
+ import type { ManagedEntity } from '../tenancy/index.js';
3
3
  import type { Project, DocumentMeta } from '../projects/index.js';
4
4
  import type { SnapshotSummary } from '../versions/index.js';
5
- export declare function makeWorkspace(over?: Partial<Workspace>): Workspace;
5
+ export declare function makeWorkspace(over?: Partial<ManagedEntity>): ManagedEntity;
6
6
  export declare function makeProject(over?: Partial<Project>): Project;
7
7
  export declare function makeDocumentMeta(over?: Partial<DocumentMeta>): DocumentMeta;
8
8
  export declare function makeSnapshotSummary(over?: Partial<SnapshotSummary>): SnapshotSummary;
package/dist/test.js CHANGED
@@ -17,7 +17,7 @@ function makeWorkspace(over = {}) {
17
17
  function makeProject(over = {}) {
18
18
  return {
19
19
  id: "prj_test",
20
- workspaceId: "ws_test",
20
+ entityId: "ws_test",
21
21
  name: "Untitled Project",
22
22
  description: null,
23
23
  color: null,
@@ -38,7 +38,7 @@ function makeDocumentMeta(over = {}) {
38
38
  return {
39
39
  id: "doc_test",
40
40
  projectId: "prj_test",
41
- workspaceId: "ws_test",
41
+ entityId: "ws_test",
42
42
  folderId: null,
43
43
  kind: "script",
44
44
  title: "Untitled Screenplay",
package/dist/test.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"test.js","sources":["../src/test/index.ts"],"sourcesContent":["/** Fixture factories for consumers' tests (`@sudobility/screenwriter_types/test`). */\nimport type { Workspace } from '../tenancy/index.js';\nimport type { Project, DocumentMeta } from '../projects/index.js';\nimport type { SnapshotSummary } from '../versions/index.js';\n\nconst T = '2026-01-01T00:00:00.000Z';\n\nexport function makeWorkspace(over: Partial<Workspace> = {}): Workspace {\n return {\n id: 'ws_test',\n kind: 'personal',\n name: 'Personal',\n avatarAssetId: null,\n defaultTemplateId: null,\n defaultLanguage: 'en',\n aiEnabled: true,\n allowPublicLinks: true,\n createdAt: T,\n updatedAt: T,\n ...over,\n };\n}\n\nexport function makeProject(over: Partial<Project> = {}): Project {\n return {\n id: 'prj_test',\n workspaceId: 'ws_test',\n name: 'Untitled Project',\n description: null,\n color: null,\n coverAssetId: null,\n kind: 'feature',\n logline: null,\n documentCount: 0,\n createdAt: T,\n updatedAt: T,\n trashedAt: null,\n role: 'owner',\n folders: [],\n documents: [],\n ...over,\n };\n}\n\nexport function makeDocumentMeta(\n over: Partial<DocumentMeta> = {}\n): DocumentMeta {\n return {\n id: 'doc_test',\n projectId: 'prj_test',\n workspaceId: 'ws_test',\n folderId: null,\n kind: 'script',\n title: 'Untitled Screenplay',\n logline: null,\n color: null,\n labels: [],\n season: null,\n episode: null,\n position: 0,\n language: 'en',\n templateId: null,\n templateVersion: null,\n epoch: 0,\n excludeFromAi: false,\n locked: false,\n pageCount: 0,\n sceneCount: 0,\n wordCount: 0,\n parentSnapshotId: null,\n createdBy: null,\n createdAt: T,\n updatedAt: T,\n lastEditedAt: null,\n trashedAt: null,\n ...over,\n };\n}\n\nexport function makeSnapshotSummary(\n over: Partial<SnapshotSummary> = {}\n): SnapshotSummary {\n return {\n id: 'snap_test',\n documentId: 'doc_test',\n parentId: null,\n name: 'First draft',\n note: null,\n kind: 'manual',\n autoReason: null,\n stats: { pages: 0, scenes: 0, words: 0 },\n createdBy: null,\n createdOnDevice: null,\n createdAt: T,\n receivedAt: T,\n forkedDocumentIds: [],\n hiddenForMe: false,\n noteCount: 0,\n ...over,\n };\n}\n"],"names":[],"mappings":"AAKA,MAAM,IAAI;AAEH,SAAS,cAAc,OAA2B,IAAe;AACtE,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,WAAW;AAAA,IACX,WAAW;AAAA,IACX,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,YAAY,OAAyB,IAAa;AAChE,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,IACP,cAAc;AAAA,IACd,MAAM;AAAA,IACN,SAAS;AAAA,IACT,eAAe;AAAA,IACf,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,MAAM;AAAA,IACN,SAAS,CAAA;AAAA,IACT,WAAW,CAAA;AAAA,IACX,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,iBACd,OAA8B,IAChB;AACd,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,WAAW;AAAA,IACX,aAAa;AAAA,IACb,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ,CAAA;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA,IACV,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,cAAc;AAAA,IACd,WAAW;AAAA,IACX,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,oBACd,OAAiC,IAChB;AACjB,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,EAAA;AAAA,IACrC,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,mBAAmB,CAAA;AAAA,IACnB,aAAa;AAAA,IACb,WAAW;AAAA,IACX,GAAG;AAAA,EAAA;AAEP;"}
1
+ {"version":3,"file":"test.js","sources":["../src/test/index.ts"],"sourcesContent":["/** Fixture factories for consumers' tests (`@sudobility/screenwriter_types/test`). */\nimport type { ManagedEntity } from '../tenancy/index.js';\nimport type { Project, DocumentMeta } from '../projects/index.js';\nimport type { SnapshotSummary } from '../versions/index.js';\n\nconst T = '2026-01-01T00:00:00.000Z';\n\nexport function makeWorkspace(\n over: Partial<ManagedEntity> = {}\n): ManagedEntity {\n return {\n id: 'ws_test',\n kind: 'personal',\n name: 'Personal',\n avatarAssetId: null,\n defaultTemplateId: null,\n defaultLanguage: 'en',\n aiEnabled: true,\n allowPublicLinks: true,\n createdAt: T,\n updatedAt: T,\n ...over,\n };\n}\n\nexport function makeProject(over: Partial<Project> = {}): Project {\n return {\n id: 'prj_test',\n entityId: 'ws_test',\n name: 'Untitled Project',\n description: null,\n color: null,\n coverAssetId: null,\n kind: 'feature',\n logline: null,\n documentCount: 0,\n createdAt: T,\n updatedAt: T,\n trashedAt: null,\n role: 'owner',\n folders: [],\n documents: [],\n ...over,\n };\n}\n\nexport function makeDocumentMeta(\n over: Partial<DocumentMeta> = {}\n): DocumentMeta {\n return {\n id: 'doc_test',\n projectId: 'prj_test',\n entityId: 'ws_test',\n folderId: null,\n kind: 'script',\n title: 'Untitled Screenplay',\n logline: null,\n color: null,\n labels: [],\n season: null,\n episode: null,\n position: 0,\n language: 'en',\n templateId: null,\n templateVersion: null,\n epoch: 0,\n excludeFromAi: false,\n locked: false,\n pageCount: 0,\n sceneCount: 0,\n wordCount: 0,\n parentSnapshotId: null,\n createdBy: null,\n createdAt: T,\n updatedAt: T,\n lastEditedAt: null,\n trashedAt: null,\n ...over,\n };\n}\n\nexport function makeSnapshotSummary(\n over: Partial<SnapshotSummary> = {}\n): SnapshotSummary {\n return {\n id: 'snap_test',\n documentId: 'doc_test',\n parentId: null,\n name: 'First draft',\n note: null,\n kind: 'manual',\n autoReason: null,\n stats: { pages: 0, scenes: 0, words: 0 },\n createdBy: null,\n createdOnDevice: null,\n createdAt: T,\n receivedAt: T,\n forkedDocumentIds: [],\n hiddenForMe: false,\n noteCount: 0,\n ...over,\n };\n}\n"],"names":[],"mappings":"AAKA,MAAM,IAAI;AAEH,SAAS,cACd,OAA+B,IAChB;AACf,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,WAAW;AAAA,IACX,WAAW;AAAA,IACX,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,YAAY,OAAyB,IAAa;AAChE,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,IACP,cAAc;AAAA,IACd,MAAM;AAAA,IACN,SAAS;AAAA,IACT,eAAe;AAAA,IACf,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,MAAM;AAAA,IACN,SAAS,CAAA;AAAA,IACT,WAAW,CAAA;AAAA,IACX,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,iBACd,OAA8B,IAChB;AACd,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ,CAAA;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA,IACV,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,cAAc;AAAA,IACd,WAAW;AAAA,IACX,GAAG;AAAA,EAAA;AAEP;AAEO,SAAS,oBACd,OAAiC,IAChB;AACjB,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,EAAA;AAAA,IACrC,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,mBAAmB,CAAA;AAAA,IACnB,aAAa;AAAA,IACb,WAAW;AAAA,IACX,GAAG;AAAA,EAAA;AAEP;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/screenwriter_types",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Shared TypeScript types and Zod schemas for the Fadewright frontend and backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",