@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.
- package/dist/admin/index.d.ts +3 -3
- package/dist/ai/index.d.ts +1 -1
- package/dist/api/envelope.d.ts +1 -1
- package/dist/api/routes.d.ts +17 -12
- package/dist/assets/index.d.ts +13 -13
- package/dist/collab/index.d.ts +2 -2
- package/dist/credits/index.d.ts +24 -0
- package/dist/index.js +103 -104
- package/dist/index.js.map +1 -1
- package/dist/io/index.d.ts +3 -3
- package/dist/keys/index.d.ts +2 -2
- package/dist/keys.js +1 -1
- package/dist/keys.js.map +1 -1
- package/dist/lifecycle/index.d.ts +5 -5
- package/dist/me/index.d.ts +1 -1
- package/dist/projects/index.d.ts +3 -3
- package/dist/reads/index.d.ts +2 -2
- package/dist/sharing/index.d.ts +19 -19
- package/dist/templates/index.d.ts +9 -9
- package/dist/tenancy/index.d.ts +17 -17
- package/dist/test/index.d.ts +2 -2
- package/dist/test.js +2 -2
- package/dist/test.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -66,6 +66,10 @@ const ERROR_TABLE = [
|
|
|
66
66
|
["RATE_LIMITED", 429],
|
|
67
67
|
["QUOTA_EXCEEDED", 429],
|
|
68
68
|
["INSUFFICIENT_CREDITS", 402],
|
|
69
|
+
["COUPON_NOT_FOUND", 404],
|
|
70
|
+
["COUPON_EMAIL_MISMATCH", 403],
|
|
71
|
+
["COUPON_ALREADY_REDEEMED", 409],
|
|
72
|
+
["COUPON_EXPIRED", 410],
|
|
69
73
|
["AI_UNAVAILABLE", 503],
|
|
70
74
|
["AI_INPUT_TOO_LARGE", 413],
|
|
71
75
|
["AI_GENERATION_FAILED", 502],
|
|
@@ -146,14 +150,14 @@ const API_ROUTES = {
|
|
|
146
150
|
health: r("GET", "/health", "P"),
|
|
147
151
|
meGet: r("GET", "/me", "U,Kr"),
|
|
148
152
|
mePatch: r("PATCH", "/me", "U"),
|
|
149
|
-
// B2
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
// B2 entities
|
|
154
|
+
entitiesList: r("GET", "/entities", "U,Kr"),
|
|
155
|
+
entityGetDetails: r("GET", "/entities/:entityId", "U,Kr", "entity.read"),
|
|
152
156
|
// B2 projects
|
|
153
|
-
projectsList: r("GET", "/
|
|
157
|
+
projectsList: r("GET", "/entities/:wid/projects", "U,Kr", "project.read"),
|
|
154
158
|
projectCreate: r(
|
|
155
159
|
"POST",
|
|
156
|
-
"/
|
|
160
|
+
"/entities/:wid/projects",
|
|
157
161
|
"U,Krw",
|
|
158
162
|
"project.create"
|
|
159
163
|
),
|
|
@@ -375,39 +379,34 @@ const API_ROUTES = {
|
|
|
375
379
|
"document.edit"
|
|
376
380
|
),
|
|
377
381
|
// B8 tenancy, roles, sharing. Keys (K) only read members and /me/shared; everything else is user-only (403 API_KEY_FORBIDDEN).
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
+
entityCreate: r("POST", "/entities", "U"),
|
|
383
|
+
entityUpdate: r("PATCH", "/entities/:entityId", "U", "entity.update"),
|
|
384
|
+
entityDelete: r("DELETE", "/entities/:entityId", "U", "entity.delete"),
|
|
385
|
+
entityTransfer: r(
|
|
382
386
|
"POST",
|
|
383
|
-
"/
|
|
387
|
+
"/entities/:entityId/transfer",
|
|
384
388
|
"U",
|
|
385
|
-
"
|
|
389
|
+
"entity.transfer"
|
|
386
390
|
),
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
"/workspaces/:wid/audit.csv",
|
|
392
|
-
"U",
|
|
393
|
-
"workspace.audit"
|
|
394
|
-
),
|
|
395
|
-
membersList: r("GET", "/workspaces/:wid/members", "U,Kr", "members.read"),
|
|
391
|
+
entityLeave: r("POST", "/entities/:entityId/leave", "U", "entity.leave"),
|
|
392
|
+
managedEntityUsage: r("GET", "/entities/:entityId/usage", "U", "entity.read"),
|
|
393
|
+
entityAudit: r("GET", "/entities/:entityId/audit.csv", "U", "entity.audit"),
|
|
394
|
+
membersList: r("GET", "/entities/:wid/members", "U,Kr", "members.read"),
|
|
396
395
|
memberUpdate: r(
|
|
397
396
|
"PATCH",
|
|
398
|
-
"/
|
|
397
|
+
"/entities/:wid/members/:uid",
|
|
399
398
|
"U",
|
|
400
399
|
"members.updateRole"
|
|
401
400
|
),
|
|
402
401
|
memberRemove: r(
|
|
403
402
|
"DELETE",
|
|
404
|
-
"/
|
|
403
|
+
"/entities/:wid/members/:uid",
|
|
405
404
|
"U",
|
|
406
405
|
"members.remove"
|
|
407
406
|
),
|
|
408
|
-
|
|
407
|
+
invitationCreateEntity: r(
|
|
409
408
|
"POST",
|
|
410
|
-
"/
|
|
409
|
+
"/entities/:entityId/invitations",
|
|
411
410
|
"U",
|
|
412
411
|
"members.invite"
|
|
413
412
|
),
|
|
@@ -423,9 +422,9 @@ const API_ROUTES = {
|
|
|
423
422
|
"U",
|
|
424
423
|
"share.manage"
|
|
425
424
|
),
|
|
426
|
-
|
|
425
|
+
entityInvitationsList: r(
|
|
427
426
|
"GET",
|
|
428
|
-
"/
|
|
427
|
+
"/entities/:entityId/invitations",
|
|
429
428
|
"U",
|
|
430
429
|
"members.invite"
|
|
431
430
|
),
|
|
@@ -433,6 +432,7 @@ const API_ROUTES = {
|
|
|
433
432
|
invitationRenew: r("POST", "/invitations/:iid/renew", "U"),
|
|
434
433
|
invitationCancel: r("DELETE", "/invitations/:iid", "U"),
|
|
435
434
|
invitationAccept: r("POST", "/invitations/accept", "U"),
|
|
435
|
+
invitationAcceptById: r("POST", "/invitations/:iid/accept", "U"),
|
|
436
436
|
invitationDecline: r("POST", "/invitations/:iid/decline", "U"),
|
|
437
437
|
sharedWithMe: r("GET", "/me/shared", "U,Kr"),
|
|
438
438
|
documentLock: r("POST", "/documents/:did/lock", "U", "document.lock"),
|
|
@@ -496,7 +496,12 @@ const API_ROUTES = {
|
|
|
496
496
|
// B10 projection-backed reads, search, reports, packets (spec 05 §6.7.1, §6.7.2, §6.12, §6.14, §6.15, §6.17, §6.18, §6.22).
|
|
497
497
|
// `?source=live|snapshot:<id>|version:<id>` selects the state a read answers from. Keys (K) read all of these; the report
|
|
498
498
|
// and resolve POSTs are reads, so a read-only key may send them.
|
|
499
|
-
|
|
499
|
+
documentEntitiesList: r(
|
|
500
|
+
"GET",
|
|
501
|
+
"/documents/:did/entities",
|
|
502
|
+
"U,Kr,L",
|
|
503
|
+
"document.read"
|
|
504
|
+
),
|
|
500
505
|
entityGet: r(
|
|
501
506
|
"GET",
|
|
502
507
|
"/documents/:did/entities/:eid",
|
|
@@ -555,12 +560,7 @@ const API_ROUTES = {
|
|
|
555
560
|
resolveBatch: r("POST", "/documents/:did/resolve", "U,Kr,L", "document.read"),
|
|
556
561
|
resolveOne: r("GET", "/documents/:did/resolve", "U,Kr,L", "document.read"),
|
|
557
562
|
documentSearch: r("GET", "/documents/:did/search", "U,Kr,L", "document.read"),
|
|
558
|
-
workspaceSearch: r(
|
|
559
|
-
"GET",
|
|
560
|
-
"/workspaces/:wid/search",
|
|
561
|
-
"U,Kr",
|
|
562
|
-
"workspace.read"
|
|
563
|
-
),
|
|
563
|
+
workspaceSearch: r("GET", "/entities/:wid/search", "U,Kr", "entity.read"),
|
|
564
564
|
search: r("GET", "/search", "U,Kr"),
|
|
565
565
|
reportKinds: r("GET", "/reports/kinds", "U,Kr"),
|
|
566
566
|
reportGet: r("GET", "/documents/:did/reports/:kind", "U,Kr,L", "reports.run"),
|
|
@@ -623,14 +623,14 @@ const API_ROUTES = {
|
|
|
623
623
|
// trash-empty, workspace defaults and contacts are user-only (a key gets 403 API_KEY_FORBIDDEN).
|
|
624
624
|
workspaceDocuments: r(
|
|
625
625
|
"GET",
|
|
626
|
-
"/
|
|
626
|
+
"/entities/:wid/documents",
|
|
627
627
|
"U,Kr",
|
|
628
628
|
"project.read"
|
|
629
629
|
),
|
|
630
|
-
workspaceTrash: r("GET", "/
|
|
630
|
+
workspaceTrash: r("GET", "/entities/:wid/trash", "U,Kr", "project.read"),
|
|
631
631
|
workspaceTrashEmpty: r(
|
|
632
632
|
"POST",
|
|
633
|
-
"/
|
|
633
|
+
"/entities/:wid/trash/empty",
|
|
634
634
|
"U",
|
|
635
635
|
"project.purge"
|
|
636
636
|
),
|
|
@@ -694,39 +694,39 @@ const API_ROUTES = {
|
|
|
694
694
|
),
|
|
695
695
|
workspaceDefaultsGet: r(
|
|
696
696
|
"GET",
|
|
697
|
-
"/
|
|
697
|
+
"/entities/:wid/defaults",
|
|
698
698
|
"U,Kr",
|
|
699
|
-
"
|
|
699
|
+
"entity.read"
|
|
700
700
|
),
|
|
701
701
|
workspaceDefaultsSet: r(
|
|
702
702
|
"PUT",
|
|
703
|
-
"/
|
|
703
|
+
"/entities/:wid/defaults",
|
|
704
704
|
"U",
|
|
705
|
-
"
|
|
705
|
+
"entity.update"
|
|
706
706
|
),
|
|
707
707
|
workspaceContactsList: r(
|
|
708
708
|
"GET",
|
|
709
|
-
"/
|
|
709
|
+
"/entities/:wid/contacts",
|
|
710
710
|
"U",
|
|
711
|
-
"
|
|
711
|
+
"entity.read"
|
|
712
712
|
),
|
|
713
713
|
workspaceContactsCreate: r(
|
|
714
714
|
"POST",
|
|
715
|
-
"/
|
|
715
|
+
"/entities/:wid/contacts",
|
|
716
716
|
"U",
|
|
717
|
-
"
|
|
717
|
+
"entity.update"
|
|
718
718
|
),
|
|
719
719
|
workspaceContactUpdate: r(
|
|
720
720
|
"PATCH",
|
|
721
|
-
"/
|
|
721
|
+
"/entity-contacts/:cid",
|
|
722
722
|
"U",
|
|
723
|
-
"
|
|
723
|
+
"entity.update"
|
|
724
724
|
),
|
|
725
725
|
workspaceContactDelete: r(
|
|
726
726
|
"DELETE",
|
|
727
|
-
"/
|
|
727
|
+
"/entity-contacts/:cid",
|
|
728
728
|
"U",
|
|
729
|
-
"
|
|
729
|
+
"entity.update"
|
|
730
730
|
),
|
|
731
731
|
// B16 imports, exports and watermark as jobs (spec 05 §6.18). `POST /imports*` and `/uploads/state` are `Krw`; exports are `Kr` (a read key may
|
|
732
732
|
// export what it can read); the watermark lookup is user-only (403 API_KEY_FORBIDDEN for a key). The synchronous
|
|
@@ -754,15 +754,15 @@ const API_ROUTES = {
|
|
|
754
754
|
),
|
|
755
755
|
watermarkLookup: r(
|
|
756
756
|
"POST",
|
|
757
|
-
"/
|
|
757
|
+
"/entities/:wid/watermark-lookup",
|
|
758
758
|
"U",
|
|
759
|
-
"
|
|
759
|
+
"entity.audit"
|
|
760
760
|
),
|
|
761
761
|
// B11 assets and R2 (spec 05 §6.13). Bytes go to object storage through presigned URLs, never through the API. Writes are `Krw`, reads `Kr`;
|
|
762
762
|
// share-link readers (`L`) are not built (no `/share/:token/assets` route yet). The uploader routes check the caller is the uploader.
|
|
763
763
|
assetUploadCreate: r(
|
|
764
764
|
"POST",
|
|
765
|
-
"/
|
|
765
|
+
"/entities/:wid/assets/uploads",
|
|
766
766
|
"U,Krw",
|
|
767
767
|
"assets.upload"
|
|
768
768
|
),
|
|
@@ -818,12 +818,7 @@ const API_ROUTES = {
|
|
|
818
818
|
"U,Kr",
|
|
819
819
|
"document.activity"
|
|
820
820
|
),
|
|
821
|
-
workspaceActivity: r(
|
|
822
|
-
"GET",
|
|
823
|
-
"/workspaces/:wid/activity",
|
|
824
|
-
"U",
|
|
825
|
-
"workspace.read"
|
|
826
|
-
),
|
|
821
|
+
workspaceActivity: r("GET", "/entities/:wid/activity", "U", "entity.read"),
|
|
827
822
|
notificationsList: r("GET", "/notifications", "U"),
|
|
828
823
|
notificationsRead: r("POST", "/notifications/read", "U"),
|
|
829
824
|
notificationDelete: r("DELETE", "/notifications/:nid", "U"),
|
|
@@ -844,9 +839,9 @@ const API_ROUTES = {
|
|
|
844
839
|
meAiActivity: r("GET", "/me/ai-activity", "U"),
|
|
845
840
|
workspaceAiActivity: r(
|
|
846
841
|
"GET",
|
|
847
|
-
"/
|
|
842
|
+
"/entities/:wid/ai-activity",
|
|
848
843
|
"U",
|
|
849
|
-
"
|
|
844
|
+
"entity.audit"
|
|
850
845
|
),
|
|
851
846
|
aiEstimate: r("POST", "/documents/:did/ai/estimate", "U,Kr", "document.read"),
|
|
852
847
|
aiReportsList: r(
|
|
@@ -874,6 +869,10 @@ const API_ROUTES = {
|
|
|
874
869
|
"document.edit"
|
|
875
870
|
),
|
|
876
871
|
consumablesBalance: r("GET", "/consumables/balance", "U,Kr"),
|
|
872
|
+
consumablesPurchaseTarget: r("POST", "/consumables/purchase-target", "U"),
|
|
873
|
+
consumablesRedeemCoupon: r("POST", "/consumables/redeem-coupon", "U"),
|
|
874
|
+
consumablesCouponsList: r("GET", "/consumables/coupons/history", "U"),
|
|
875
|
+
consumablesCouponsCreate: r("POST", "/consumables/coupons", "U"),
|
|
877
876
|
consumablesPurchases: r("GET", "/consumables/purchases", "U"),
|
|
878
877
|
consumablesUsages: r("GET", "/consumables/usages", "U"),
|
|
879
878
|
consumablesProducts: r("GET", "/consumables/products", "U,Kr,P"),
|
|
@@ -899,7 +898,7 @@ const API_ROUTES = {
|
|
|
899
898
|
adminJobKindUpdate: r("PATCH", "/admin/job-kinds/:kind", "U"),
|
|
900
899
|
adminDocumentMeta: r("GET", "/admin/documents/:did/meta", "U")
|
|
901
900
|
};
|
|
902
|
-
const
|
|
901
|
+
const ENTITY_KINDS = ["personal", "team"];
|
|
903
902
|
const ROLES = [
|
|
904
903
|
"owner",
|
|
905
904
|
"admin",
|
|
@@ -907,16 +906,16 @@ const ROLES = [
|
|
|
907
906
|
"commenter",
|
|
908
907
|
"viewer"
|
|
909
908
|
];
|
|
910
|
-
const
|
|
909
|
+
const entityKindSchema = z.enum(ENTITY_KINDS);
|
|
911
910
|
const roleSchema = z.enum(ROLES);
|
|
912
911
|
const PERMISSION_MIN_ROLE = {
|
|
913
|
-
"
|
|
914
|
-
"
|
|
915
|
-
"
|
|
916
|
-
"
|
|
917
|
-
"
|
|
918
|
-
"
|
|
919
|
-
"
|
|
912
|
+
"entity.read": "viewer",
|
|
913
|
+
"entity.update": "admin",
|
|
914
|
+
"entity.aiToggle": "owner",
|
|
915
|
+
"entity.audit": "admin",
|
|
916
|
+
"entity.delete": "owner",
|
|
917
|
+
"entity.transfer": "owner",
|
|
918
|
+
"entity.leave": "viewer",
|
|
920
919
|
"members.read": "viewer",
|
|
921
920
|
"members.invite": "admin",
|
|
922
921
|
"members.updateRole": "admin",
|
|
@@ -986,11 +985,11 @@ const hasPermission = (role, permission) => roleAtLeast(role, PERMISSION_MIN_ROL
|
|
|
986
985
|
const requiredRoleFor = (permission) => PERMISSION_MIN_ROLE[permission];
|
|
987
986
|
const SHARE_ROLES = ["admin", "writer", "commenter", "viewer"];
|
|
988
987
|
const TEAM_WORKSPACE_LIMIT = 50;
|
|
989
|
-
const
|
|
988
|
+
const entityCreateSchema = z.object({
|
|
990
989
|
name: z.string().trim().min(1).max(80),
|
|
991
990
|
avatarAssetId: z.string().min(1).nullable().optional()
|
|
992
991
|
});
|
|
993
|
-
const
|
|
992
|
+
const entityUpdateSchema = z.object({
|
|
994
993
|
name: z.string().trim().min(1).max(80).optional(),
|
|
995
994
|
avatarAssetId: z.string().min(1).nullable().optional(),
|
|
996
995
|
defaultTemplateId: z.string().min(1).nullable().optional(),
|
|
@@ -998,11 +997,11 @@ const workspaceUpdateSchema = z.object({
|
|
|
998
997
|
aiEnabled: z.boolean().optional(),
|
|
999
998
|
allowPublicLinks: z.boolean().optional()
|
|
1000
999
|
});
|
|
1001
|
-
const
|
|
1002
|
-
const
|
|
1000
|
+
const entityDeleteSchema = z.object({ confirmName: z.string() });
|
|
1001
|
+
const entityTransferSchema = z.object({
|
|
1003
1002
|
toUserId: z.string().min(1)
|
|
1004
1003
|
});
|
|
1005
|
-
const
|
|
1004
|
+
const entityAuditQuerySchema = z.object({
|
|
1006
1005
|
from: z.iso.datetime({ offset: true }).optional(),
|
|
1007
1006
|
to: z.iso.datetime({ offset: true }).optional()
|
|
1008
1007
|
});
|
|
@@ -1016,7 +1015,7 @@ const AUDIT_CSV_COLUMNS = [
|
|
|
1016
1015
|
];
|
|
1017
1016
|
const AUDIT_MAX_RANGE_DAYS = 366;
|
|
1018
1017
|
const memberUpdateSchema = z.object({ role: roleSchema });
|
|
1019
|
-
const INVITATION_TARGETS = ["
|
|
1018
|
+
const INVITATION_TARGETS = ["entity", "project", "document"];
|
|
1020
1019
|
const INVITATION_TTL_DAYS = 14;
|
|
1021
1020
|
const INVITATION_STATUSES = [
|
|
1022
1021
|
"pending",
|
|
@@ -1083,7 +1082,7 @@ const projectUpdateSchema = z.object({
|
|
|
1083
1082
|
color: z.string().max(32).nullable().optional(),
|
|
1084
1083
|
kind: projectKindSchema.optional(),
|
|
1085
1084
|
logline: z.string().max(2e3).nullable().optional(),
|
|
1086
|
-
|
|
1085
|
+
entityId: z.string().optional()
|
|
1087
1086
|
});
|
|
1088
1087
|
const projectListQuerySchema = z.object({
|
|
1089
1088
|
trashed: z.enum(["true", "false"]).transform((v) => v === "true").optional(),
|
|
@@ -1140,7 +1139,7 @@ const projectFolderDeleteQuerySchema = z.object({
|
|
|
1140
1139
|
const projectPurgeSchema = z.object({ confirmName: z.string() });
|
|
1141
1140
|
const projectDuplicateSchema = z.object({
|
|
1142
1141
|
name: z.string().trim().min(1).max(200),
|
|
1143
|
-
|
|
1142
|
+
targetEntityId: z.string().min(1).optional(),
|
|
1144
1143
|
includeSnapshots: z.boolean().default(false),
|
|
1145
1144
|
/** Re-links the source's asset links onto the copy (B11); a no-op when the target is a different workspace. */
|
|
1146
1145
|
includeAssets: z.boolean().default(false)
|
|
@@ -1173,7 +1172,7 @@ const workspaceDocumentsQuerySchema = cursorQuerySchema.extend({
|
|
|
1173
1172
|
const TRASH_ITEM_TYPES = ["project", "document", "asset"];
|
|
1174
1173
|
const trashEmptySchema = z.object({ confirm: z.string() });
|
|
1175
1174
|
const purgeInputSchema = z.object({
|
|
1176
|
-
|
|
1175
|
+
entityId: z.string().optional(),
|
|
1177
1176
|
projectId: z.string().optional(),
|
|
1178
1177
|
documentId: z.string().optional()
|
|
1179
1178
|
});
|
|
@@ -1227,7 +1226,7 @@ const workspaceContactsQuerySchema = cursorQuerySchema.extend({
|
|
|
1227
1226
|
const projectDuplicateJobInputSchema = z.object({
|
|
1228
1227
|
projectId: z.string().min(1),
|
|
1229
1228
|
name: z.string().min(1),
|
|
1230
|
-
|
|
1229
|
+
targetEntityId: z.string().min(1),
|
|
1231
1230
|
includeSnapshots: z.boolean(),
|
|
1232
1231
|
includeAssets: z.boolean()
|
|
1233
1232
|
});
|
|
@@ -1459,8 +1458,8 @@ const documentViewStatePutSchema = documentViewStateSchema.extend({
|
|
|
1459
1458
|
});
|
|
1460
1459
|
const templateListQuerySchema = z.object({
|
|
1461
1460
|
category: z.string().optional(),
|
|
1462
|
-
|
|
1463
|
-
scope: z.enum(["builtin", "user", "
|
|
1461
|
+
entityId: z.string().optional(),
|
|
1462
|
+
scope: z.enum(["builtin", "user", "entity"]).optional(),
|
|
1464
1463
|
locale: z.string().optional()
|
|
1465
1464
|
});
|
|
1466
1465
|
const templateGetQuerySchema = z.object({
|
|
@@ -1473,12 +1472,12 @@ const templateBody = z.custom(
|
|
|
1473
1472
|
}
|
|
1474
1473
|
);
|
|
1475
1474
|
const templateCreateSchema = z.object({
|
|
1476
|
-
scope: z.enum(["user", "
|
|
1477
|
-
|
|
1475
|
+
scope: z.enum(["user", "entity"]),
|
|
1476
|
+
entityId: z.string().min(1).optional(),
|
|
1478
1477
|
template: templateBody
|
|
1479
|
-
}).refine((v) => v.scope !== "
|
|
1480
|
-
message: "
|
|
1481
|
-
path: ["
|
|
1478
|
+
}).refine((v) => v.scope !== "entity" || !!v.entityId, {
|
|
1479
|
+
message: "entityId is required for a workspace template",
|
|
1480
|
+
path: ["entityId"]
|
|
1482
1481
|
});
|
|
1483
1482
|
const templateVersionCreateSchema = z.object({ template: templateBody });
|
|
1484
1483
|
const templateUpdateSchema = z.object({
|
|
@@ -1494,13 +1493,13 @@ const TEMPLATE_FILE_FORMATS = [
|
|
|
1494
1493
|
const FWTEMPLATE_FORMAT = "fadewright-template";
|
|
1495
1494
|
const FWTEMPLATE_FORMAT_VERSION = 1;
|
|
1496
1495
|
const templateImportSchema = z.object({
|
|
1497
|
-
scope: z.enum(["user", "
|
|
1498
|
-
|
|
1496
|
+
scope: z.enum(["user", "entity"]),
|
|
1497
|
+
entityId: z.string().min(1).optional(),
|
|
1499
1498
|
filename: z.string().min(1).max(255),
|
|
1500
1499
|
contentB64: z.string().min(1)
|
|
1501
|
-
}).refine((v) => v.scope !== "
|
|
1502
|
-
message: "
|
|
1503
|
-
path: ["
|
|
1500
|
+
}).refine((v) => v.scope !== "entity" || !!v.entityId, {
|
|
1501
|
+
message: "entityId is required for a workspace template",
|
|
1502
|
+
path: ["entityId"]
|
|
1504
1503
|
});
|
|
1505
1504
|
const templateImportByIdSchema = z.object({
|
|
1506
1505
|
importId: z.string().min(1)
|
|
@@ -1719,7 +1718,7 @@ const SEARCH_HIT_TYPES = [
|
|
|
1719
1718
|
const csv = (v) => typeof v === "string" ? v.split(",").map((s) => s.trim()).filter(Boolean) : v;
|
|
1720
1719
|
const searchQuerySchema = cursorQuerySchema.extend({
|
|
1721
1720
|
q: z.string().min(1).max(200),
|
|
1722
|
-
|
|
1721
|
+
entityId: z.string().min(1).optional(),
|
|
1723
1722
|
projectId: z.string().min(1).optional(),
|
|
1724
1723
|
documentId: z.string().min(1).optional(),
|
|
1725
1724
|
types: z.preprocess(csv, z.array(z.enum(SEARCH_HIT_TYPES)).min(1)).optional(),
|
|
@@ -1767,11 +1766,11 @@ const importFileFields = {
|
|
|
1767
1766
|
const importCreateSchema = z.object({
|
|
1768
1767
|
targetProjectId: z.string().min(1).optional(),
|
|
1769
1768
|
templateTarget: z.object({
|
|
1770
|
-
scope: z.enum(["user", "
|
|
1771
|
-
|
|
1772
|
-
}).refine((v) => v.scope !== "
|
|
1773
|
-
message: "
|
|
1774
|
-
path: ["
|
|
1769
|
+
scope: z.enum(["user", "entity"]),
|
|
1770
|
+
entityId: z.string().min(1).optional()
|
|
1771
|
+
}).refine((v) => v.scope !== "entity" || !!v.entityId, {
|
|
1772
|
+
message: "entityId is required for a workspace template",
|
|
1773
|
+
path: ["entityId"]
|
|
1775
1774
|
}).optional(),
|
|
1776
1775
|
...importFileFields
|
|
1777
1776
|
}).refine(
|
|
@@ -3409,7 +3408,7 @@ const linkedToSchema = z.string().regex(
|
|
|
3409
3408
|
"linkedTo is <entity|scene|shot|element>:<id>"
|
|
3410
3409
|
);
|
|
3411
3410
|
const assetListQuerySchema = cursorQuerySchema.extend({
|
|
3412
|
-
|
|
3411
|
+
entityId: z.string().min(1).optional(),
|
|
3413
3412
|
documentId: z.string().min(1).optional(),
|
|
3414
3413
|
linkedTo: linkedToSchema.optional(),
|
|
3415
3414
|
role: assetRoleSchema.optional(),
|
|
@@ -4262,6 +4261,7 @@ export {
|
|
|
4262
4261
|
DOCUMENT_LABEL_MAX_CHARS,
|
|
4263
4262
|
DOCUMENT_VIEW_STATE_MAX_BYTES,
|
|
4264
4263
|
ELEMENT_BATCH_MAX,
|
|
4264
|
+
ENTITY_KINDS,
|
|
4265
4265
|
ERROR_STATUS,
|
|
4266
4266
|
EXPORT_CODE_PREFIX,
|
|
4267
4267
|
EXPORT_FORMAT_IDS,
|
|
@@ -4358,7 +4358,6 @@ export {
|
|
|
4358
4358
|
VERSION_REASONS,
|
|
4359
4359
|
WORKSPACE_CONTACTS_BATCH_MAX,
|
|
4360
4360
|
WORKSPACE_DEFAULTS_MAX_BYTES,
|
|
4361
|
-
WORKSPACE_KINDS,
|
|
4362
4361
|
WRITING_GOALS_MAX,
|
|
4363
4362
|
WRITING_GOAL_KINDS,
|
|
4364
4363
|
WRITING_STATS_GRANULARITIES,
|
|
@@ -4446,8 +4445,14 @@ export {
|
|
|
4446
4445
|
elementHistoryQuerySchema,
|
|
4447
4446
|
elementsBatchRequestSchema,
|
|
4448
4447
|
encodeFrame,
|
|
4448
|
+
entityAuditQuerySchema,
|
|
4449
|
+
entityCreateSchema,
|
|
4450
|
+
entityDeleteSchema,
|
|
4449
4451
|
entityDialogueQuerySchema,
|
|
4452
|
+
entityKindSchema,
|
|
4450
4453
|
entityListQuerySchema,
|
|
4454
|
+
entityTransferSchema,
|
|
4455
|
+
entityUpdateSchema,
|
|
4451
4456
|
entityUsageQuerySchema,
|
|
4452
4457
|
epochChangedPayloadSchema,
|
|
4453
4458
|
errorResponse,
|
|
@@ -4596,19 +4601,13 @@ export {
|
|
|
4596
4601
|
watermarkLookupSchema,
|
|
4597
4602
|
watermarkStyleSchema,
|
|
4598
4603
|
workspaceActivityQuerySchema,
|
|
4599
|
-
workspaceAuditQuerySchema,
|
|
4600
4604
|
workspaceContactInputSchema,
|
|
4601
4605
|
workspaceContactPatchSchema,
|
|
4602
4606
|
workspaceContactsCreateSchema,
|
|
4603
4607
|
workspaceContactsQuerySchema,
|
|
4604
|
-
workspaceCreateSchema,
|
|
4605
4608
|
workspaceDefaultsPutSchema,
|
|
4606
4609
|
workspaceDefaultsSchema,
|
|
4607
|
-
workspaceDeleteSchema,
|
|
4608
4610
|
workspaceDocumentsQuerySchema,
|
|
4609
|
-
workspaceKindSchema,
|
|
4610
|
-
workspaceTransferSchema,
|
|
4611
|
-
workspaceUpdateSchema,
|
|
4612
4611
|
writingGoalInputSchema,
|
|
4613
4612
|
writingGoalsPutSchema,
|
|
4614
4613
|
writingSessionSchema,
|