@casual-simulation/aux-common 3.8.1 → 3.10.2

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.
Files changed (86) hide show
  1. package/BlobPolyfill.js +1 -1
  2. package/BlobPolyfill.js.map +1 -1
  3. package/README.md +493 -26
  4. package/bots/BotCalculations.js +9 -17
  5. package/bots/BotCalculations.js.map +1 -1
  6. package/bots/BotEvents.d.ts +160 -3
  7. package/bots/BotEvents.js +29 -4
  8. package/bots/BotEvents.js.map +1 -1
  9. package/common/ConnectionInfo.d.ts +1 -9
  10. package/common/DenialReason.d.ts +1 -1
  11. package/common/PolicyPermissions.d.ts +866 -754
  12. package/common/PolicyPermissions.js +53 -0
  13. package/common/PolicyPermissions.js.map +1 -1
  14. package/common/RemoteActions.d.ts +33 -299
  15. package/common/Version.d.ts +35 -1
  16. package/common/Version.js +50 -2
  17. package/common/Version.js.map +1 -1
  18. package/common/WebConfig.d.ts +163 -69
  19. package/common/WebConfig.js +86 -23
  20. package/common/WebConfig.js.map +1 -1
  21. package/common/WebManifest.d.ts +27 -0
  22. package/common/WebManifest.js +110 -0
  23. package/common/WebManifest.js.map +1 -0
  24. package/documents/RemoteYjsSharedDocument.js +3 -5
  25. package/documents/RemoteYjsSharedDocument.js.map +1 -1
  26. package/documents/YjsSharedDocument.js +5 -10
  27. package/documents/YjsSharedDocument.js.map +1 -1
  28. package/forms/FormError.js +1 -2
  29. package/forms/FormError.js.map +1 -1
  30. package/http/GenericHttpInterface.d.ts +11 -20
  31. package/http/GenericHttpInterface.js.map +1 -1
  32. package/math/Rotation.js +3 -4
  33. package/math/Rotation.js.map +1 -1
  34. package/package.json +77 -78
  35. package/partitions/AuxPartitionConfig.d.ts +11 -1
  36. package/partitions/AuxPartitionFactories.js +3 -0
  37. package/partitions/AuxPartitionFactories.js.map +1 -1
  38. package/partitions/MemoryPartition.js +5 -7
  39. package/partitions/MemoryPartition.js.map +1 -1
  40. package/partitions/OtherPlayersPartition.js +4 -8
  41. package/partitions/OtherPlayersPartition.js.map +1 -1
  42. package/partitions/PartitionAuthSource.js +2 -4
  43. package/partitions/PartitionAuthSource.js.map +1 -1
  44. package/partitions/PartitionUtils.d.ts +12 -0
  45. package/partitions/PartitionUtils.js +65 -6
  46. package/partitions/PartitionUtils.js.map +1 -1
  47. package/partitions/RemoteYjsPartition.d.ts +1 -0
  48. package/partitions/RemoteYjsPartition.js +39 -6
  49. package/partitions/RemoteYjsPartition.js.map +1 -1
  50. package/partitions/YjsPartition.d.ts +2 -1
  51. package/partitions/YjsPartition.js +46 -28
  52. package/partitions/YjsPartition.js.map +1 -1
  53. package/records/AccountBalance.d.ts +82 -0
  54. package/records/AccountBalance.js +63 -0
  55. package/records/AccountBalance.js.map +1 -0
  56. package/records/AuthUtils.js +7 -7
  57. package/records/AuthUtils.js.map +1 -1
  58. package/records/RecordKeys.js +2 -3
  59. package/records/RecordKeys.js.map +1 -1
  60. package/records/index.d.ts +1 -0
  61. package/records/index.js +1 -0
  62. package/records/index.js.map +1 -1
  63. package/rpc/ErrorCodes.d.ts +1 -1
  64. package/rpc/ErrorCodes.js +3 -3
  65. package/rpc/ErrorCodes.js.map +1 -1
  66. package/rpc/GenericRPCInterface.d.ts +56 -13
  67. package/rpc/GenericRPCInterface.js +87 -55
  68. package/rpc/GenericRPCInterface.js.map +1 -1
  69. package/rpc/Result.d.ts +4 -1
  70. package/rpc/Result.js +21 -13
  71. package/rpc/Result.js.map +1 -1
  72. package/utils.d.ts +1 -1
  73. package/utils.js +6 -4
  74. package/utils.js.map +1 -1
  75. package/websockets/InstRecordsClient.js +6 -7
  76. package/websockets/InstRecordsClient.js.map +1 -1
  77. package/websockets/Utils.js +3 -3
  78. package/websockets/Utils.js.map +1 -1
  79. package/websockets/WebsocketEvents.d.ts +246 -997
  80. package/websockets/WebsocketEvents.js +3 -3
  81. package/websockets/WebsocketEvents.js.map +1 -1
  82. package/yjs/YjsHelpers.d.ts +9 -0
  83. package/yjs/YjsHelpers.js +28 -1
  84. package/yjs/YjsHelpers.js.map +1 -1
  85. package/yjs/YjsIndexedDBPersistence.js +2 -3
  86. package/yjs/YjsIndexedDBPersistence.js.map +1 -1
@@ -29,13 +29,16 @@ export declare const PACKAGE_RESOURCE_KIND = "package";
29
29
  export declare const PACKAGE_VERSION_RESOURCE_KIND = "package.version";
30
30
  export declare const SEARCH_RESOURCE_KIND = "search";
31
31
  export declare const DATABASE_RESOURCE_KIND = "database";
32
+ export declare const PURCHASABLE_ITEM_RESOURCE_KIND = "purchasableItem";
33
+ export declare const CONTRACT_RESOURCE_KIND = "contract";
34
+ export declare const INVOICE_RESOURCE_KIND = "invoice";
32
35
  /**
33
36
  * The possible types of resources that can be affected by permissions.
34
37
  *
35
38
  * @dochash types/permissions
36
39
  * @docname ResourceKinds
37
40
  */
38
- export type ResourceKinds = 'data' | 'file' | 'event' | 'marker' | 'role' | 'inst' | 'webhook' | 'notification' | 'package' | 'package.version' | 'search' | 'loom' | 'ai.sloyd' | 'ai.hume' | 'ai.openai.realtime' | 'database';
41
+ export type ResourceKinds = 'data' | 'file' | 'event' | 'marker' | 'role' | 'inst' | 'webhook' | 'notification' | 'package' | 'package.version' | 'search' | 'loom' | 'ai.sloyd' | 'ai.hume' | 'ai.openai.realtime' | 'database' | 'purchasableItem' | 'contract' | 'invoice';
39
42
  export declare const READ_ACTION = "read";
40
43
  export declare const CREATE_ACTION = "create";
41
44
  export declare const UPDATE_ACTION = "update";
@@ -56,13 +59,16 @@ export declare const SEND_ACTION = "send";
56
59
  export declare const SUBSCRIBE_ACTION = "subscribe";
57
60
  export declare const UNSUBSCRIBE_ACTION = "unsubscribe";
58
61
  export declare const LIST_SUBSCRIPTIONS_ACTION = "listSubscriptions";
62
+ export declare const PURCHASE_ACTION = "purchase";
63
+ export declare const APPROVE_ACTION = "approve";
64
+ export declare const CANCEL_ACTION = "cancel";
59
65
  /**
60
66
  * The possible types of actions that can be performed on resources.
61
67
  *
62
68
  * @dochash types/permissions
63
69
  * @docname ActionKinds
64
70
  */
65
- export type ActionKinds = 'read' | 'create' | 'update' | 'delete' | 'assign' | 'unassign' | 'increment' | 'count' | 'list' | 'grantPermission' | 'revokePermission' | 'grant' | 'revoke' | 'sendAction' | 'updateData' | 'run' | 'send' | 'subscribe' | 'unsubscribe' | 'listSubscriptions';
71
+ export type ActionKinds = 'read' | 'create' | 'update' | 'delete' | 'assign' | 'unassign' | 'increment' | 'count' | 'list' | 'grantPermission' | 'revokePermission' | 'grant' | 'revoke' | 'sendAction' | 'updateData' | 'run' | 'send' | 'subscribe' | 'unsubscribe' | 'listSubscriptions' | 'purchase' | 'approve' | 'cancel';
66
72
  /**
67
73
  * The possible types of actions that can be performed on data resources.
68
74
  *
@@ -175,6 +181,27 @@ export type SearchActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list'
175
181
  * @docname DatabaseActionKinds
176
182
  */
177
183
  export type DatabaseActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list';
184
+ /**
185
+ * The possible types of actions that can be performed on purchasableItem resources.
186
+ *
187
+ * @dochash types/permissions
188
+ * @docname PurchasableItemActionKinds
189
+ */
190
+ export type PurchasableItemActionKinds = 'read' | 'create' | 'update' | 'delete' | 'list' | 'purchase';
191
+ /**
192
+ * The possible types of actions that can be performed on contract resources.
193
+ *
194
+ * @dochash types/permissions
195
+ * @docname ContractActionKinds
196
+ */
197
+ export type ContractActionKinds = 'read' | 'create' | 'update' | 'delete' | 'list' | 'purchase' | 'cancel';
198
+ /**
199
+ * The possible types of actions that can be performed on invoice resources.
200
+ *
201
+ * @dochash types/permissions
202
+ * @docname InvoiceActionKinds
203
+ */
204
+ export type InvoiceActionKinds = 'read' | 'create' | 'update' | 'delete' | 'list' | 'approve' | 'cancel';
178
205
  /**
179
206
  * The possible types of permissions that can be added to policies.
180
207
  *
@@ -184,26 +211,188 @@ export type DatabaseActionKinds = 'create' | 'read' | 'update' | 'delete' | 'lis
184
211
  * @docdescription Types that represent permissions that control access to resources.
185
212
  * @docname AvailablePermissions
186
213
  */
187
- export type AvailablePermissions = DataPermission | FilePermission | EventPermission | MarkerPermission | RolePermission | InstPermission | LoomPermission | SloydPermission | HumePermission | OpenAIRealtimePermission | WebhookPermission | NotificationPermission | PackagePermission | PackageVersionPermission | SearchPermission | DatabasePermission;
188
- export declare const SUBJECT_TYPE_VALIDATION: z.ZodEnum<["user", "inst", "role"]>;
189
- export declare const DATA_ACTION_KINDS_VALIDATION: z.ZodEnum<["read", "create", "update", "delete", "list"]>;
190
- export declare const FILE_ACTION_KINDS_VALIDATION: z.ZodEnum<["read", "create", "update", "delete", "list"]>;
191
- export declare const EVENT_ACTION_KINDS_VALIDATION: z.ZodEnum<["increment", "count", "update", "list"]>;
192
- export declare const MARKER_ACTION_KINDS_VALIDATION: z.ZodEnum<["assign", "unassign", "grantPermission", "revokePermission", "read"]>;
193
- export declare const ROLE_ACTION_KINDS_VALIDATION: z.ZodEnum<["grant", "revoke", "read", "update", "list"]>;
194
- export declare const INST_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "updateData", "delete", "list", "sendAction"]>;
195
- export declare const LOOM_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
196
- export declare const SLOYD_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
197
- export declare const HUME_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
198
- export declare const OPENAI_REALTIME_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
199
- export declare const WEBHOOK_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
200
- export declare const NOTIFICATION_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "send", "subscribe", "unsubscribe", "listSubscriptions"]>;
201
- export declare const PACKAGE_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
202
- export declare const PACKAGE_VERSION_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
203
- export declare const SEARCH_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list"]>;
204
- export declare const DATABASE_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list"]>;
205
- export declare const RESOURCE_KIND_VALIDATION: z.ZodEnum<["data", "file", "event", "marker", "role", "inst", "loom", "ai.sloyd", "ai.hume", "ai.openai.realtime", "webhook", "notification", "package", "package.version", "search", "database"]>;
206
- export declare const ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "updateData", "delete", "list", "sendAction", "assign", "unassign", "grant", "revoke", "increment", "count", "grantPermission", "revokePermission", "run", "send", "subscribe", "unsubscribe", "listSubscriptions"]>;
214
+ export type AvailablePermissions = DataPermission | FilePermission | EventPermission | MarkerPermission | RolePermission | InstPermission | PurchasableItemPermission | LoomPermission | SloydPermission | HumePermission | OpenAIRealtimePermission | WebhookPermission | NotificationPermission | PackagePermission | PackageVersionPermission | SearchPermission | DatabasePermission | ContractPermission | InvoicePermission;
215
+ export declare const SUBJECT_TYPE_VALIDATION: z.ZodEnum<{
216
+ inst: "inst";
217
+ user: "user";
218
+ role: "role";
219
+ }>;
220
+ export declare const DATA_ACTION_KINDS_VALIDATION: z.ZodEnum<{
221
+ read: "read";
222
+ create: "create";
223
+ update: "update";
224
+ delete: "delete";
225
+ list: "list";
226
+ }>;
227
+ export declare const FILE_ACTION_KINDS_VALIDATION: z.ZodEnum<{
228
+ read: "read";
229
+ create: "create";
230
+ update: "update";
231
+ delete: "delete";
232
+ list: "list";
233
+ }>;
234
+ export declare const EVENT_ACTION_KINDS_VALIDATION: z.ZodEnum<{
235
+ update: "update";
236
+ increment: "increment";
237
+ count: "count";
238
+ list: "list";
239
+ }>;
240
+ export declare const MARKER_ACTION_KINDS_VALIDATION: z.ZodEnum<{
241
+ read: "read";
242
+ assign: "assign";
243
+ unassign: "unassign";
244
+ grantPermission: "grantPermission";
245
+ revokePermission: "revokePermission";
246
+ }>;
247
+ export declare const ROLE_ACTION_KINDS_VALIDATION: z.ZodEnum<{
248
+ read: "read";
249
+ update: "update";
250
+ list: "list";
251
+ grant: "grant";
252
+ revoke: "revoke";
253
+ }>;
254
+ export declare const INST_ACTION_KINDS_VALIDATION: z.ZodEnum<{
255
+ read: "read";
256
+ create: "create";
257
+ update: "update";
258
+ delete: "delete";
259
+ list: "list";
260
+ sendAction: "sendAction";
261
+ updateData: "updateData";
262
+ }>;
263
+ export declare const LOOM_ACTION_KINDS_VALIDATION: z.ZodEnum<{
264
+ create: "create";
265
+ }>;
266
+ export declare const SLOYD_ACTION_KINDS_VALIDATION: z.ZodEnum<{
267
+ create: "create";
268
+ }>;
269
+ export declare const HUME_ACTION_KINDS_VALIDATION: z.ZodEnum<{
270
+ create: "create";
271
+ }>;
272
+ export declare const OPENAI_REALTIME_ACTION_KINDS_VALIDATION: z.ZodEnum<{
273
+ create: "create";
274
+ }>;
275
+ export declare const WEBHOOK_ACTION_KINDS_VALIDATION: z.ZodEnum<{
276
+ run: "run";
277
+ read: "read";
278
+ create: "create";
279
+ update: "update";
280
+ delete: "delete";
281
+ list: "list";
282
+ }>;
283
+ export declare const NOTIFICATION_ACTION_KINDS_VALIDATION: z.ZodEnum<{
284
+ read: "read";
285
+ create: "create";
286
+ update: "update";
287
+ delete: "delete";
288
+ list: "list";
289
+ send: "send";
290
+ subscribe: "subscribe";
291
+ unsubscribe: "unsubscribe";
292
+ listSubscriptions: "listSubscriptions";
293
+ }>;
294
+ export declare const PACKAGE_ACTION_KINDS_VALIDATION: z.ZodEnum<{
295
+ run: "run";
296
+ read: "read";
297
+ create: "create";
298
+ update: "update";
299
+ delete: "delete";
300
+ list: "list";
301
+ }>;
302
+ export declare const PACKAGE_VERSION_ACTION_KINDS_VALIDATION: z.ZodEnum<{
303
+ run: "run";
304
+ read: "read";
305
+ create: "create";
306
+ update: "update";
307
+ delete: "delete";
308
+ list: "list";
309
+ }>;
310
+ export declare const SEARCH_ACTION_KINDS_VALIDATION: z.ZodEnum<{
311
+ read: "read";
312
+ create: "create";
313
+ update: "update";
314
+ delete: "delete";
315
+ list: "list";
316
+ }>;
317
+ export declare const DATABASE_ACTION_KINDS_VALIDATION: z.ZodEnum<{
318
+ read: "read";
319
+ create: "create";
320
+ update: "update";
321
+ delete: "delete";
322
+ list: "list";
323
+ }>;
324
+ export declare const PURCHASABLE_ITEM_ACTION_KINDS_VALIDATION: z.ZodEnum<{
325
+ read: "read";
326
+ create: "create";
327
+ update: "update";
328
+ delete: "delete";
329
+ list: "list";
330
+ purchase: "purchase";
331
+ }>;
332
+ export declare const CONTRACT_ACTION_KINDS_VALIDATION: z.ZodEnum<{
333
+ read: "read";
334
+ create: "create";
335
+ update: "update";
336
+ delete: "delete";
337
+ list: "list";
338
+ purchase: "purchase";
339
+ cancel: "cancel";
340
+ }>;
341
+ export declare const INVOICE_ACTION_KINDS_VALIDATION: z.ZodEnum<{
342
+ read: "read";
343
+ create: "create";
344
+ update: "update";
345
+ delete: "delete";
346
+ list: "list";
347
+ approve: "approve";
348
+ cancel: "cancel";
349
+ }>;
350
+ export declare const RESOURCE_KIND_VALIDATION: z.ZodEnum<{
351
+ search: "search";
352
+ inst: "inst";
353
+ file: "file";
354
+ event: "event";
355
+ role: "role";
356
+ data: "data";
357
+ marker: "marker";
358
+ loom: "loom";
359
+ "ai.sloyd": "ai.sloyd";
360
+ "ai.hume": "ai.hume";
361
+ "ai.openai.realtime": "ai.openai.realtime";
362
+ webhook: "webhook";
363
+ notification: "notification";
364
+ package: "package";
365
+ "package.version": "package.version";
366
+ database: "database";
367
+ purchasableItem: "purchasableItem";
368
+ contract: "contract";
369
+ invoice: "invoice";
370
+ }>;
371
+ export declare const ACTION_KINDS_VALIDATION: z.ZodEnum<{
372
+ run: "run";
373
+ read: "read";
374
+ create: "create";
375
+ update: "update";
376
+ delete: "delete";
377
+ assign: "assign";
378
+ unassign: "unassign";
379
+ increment: "increment";
380
+ count: "count";
381
+ list: "list";
382
+ grantPermission: "grantPermission";
383
+ revokePermission: "revokePermission";
384
+ grant: "grant";
385
+ revoke: "revoke";
386
+ sendAction: "sendAction";
387
+ updateData: "updateData";
388
+ send: "send";
389
+ subscribe: "subscribe";
390
+ unsubscribe: "unsubscribe";
391
+ listSubscriptions: "listSubscriptions";
392
+ purchase: "purchase";
393
+ approve: "approve";
394
+ cancel: "cancel";
395
+ }>;
207
396
  /**
208
397
  * The scopes that can be used for requested entitlements.
209
398
  * This can be used to limit the entitlement to requesting a category of resources.
@@ -261,20 +450,42 @@ export interface Entitlement {
261
450
  */
262
451
  designatedRecords?: string[];
263
452
  }
264
- export declare const ENTITLEMENT_FEATURE_VALIDATION: z.ZodEnum<["data", "file", "event", "inst", "notification", "package", "permissions", "webhook", "ai", "search", "database"]>;
265
- export declare const ENTITLEMENT_VALIDATION: z.ZodObject<{
266
- feature: z.ZodEnum<["data", "file", "event", "inst", "notification", "package", "permissions", "webhook", "ai", "search", "database"]>;
267
- scope: z.ZodEnum<["personal", "owned", "studio", "shared", "designated"]>;
268
- designatedRecords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
269
- }, "strip", z.ZodTypeAny, {
270
- feature?: "search" | "inst" | "data" | "event" | "file" | "webhook" | "notification" | "package" | "database" | "permissions" | "ai";
271
- scope?: "shared" | "personal" | "owned" | "studio" | "designated";
272
- designatedRecords?: string[];
273
- }, {
274
- feature?: "search" | "inst" | "data" | "event" | "file" | "webhook" | "notification" | "package" | "database" | "permissions" | "ai";
275
- scope?: "shared" | "personal" | "owned" | "studio" | "designated";
276
- designatedRecords?: string[];
453
+ export declare const ENTITLEMENT_FEATURE_VALIDATION: z.ZodEnum<{
454
+ search: "search";
455
+ inst: "inst";
456
+ file: "file";
457
+ event: "event";
458
+ data: "data";
459
+ webhook: "webhook";
460
+ notification: "notification";
461
+ package: "package";
462
+ database: "database";
463
+ permissions: "permissions";
464
+ ai: "ai";
277
465
  }>;
466
+ export declare const ENTITLEMENT_VALIDATION: z.ZodObject<{
467
+ feature: z.ZodEnum<{
468
+ search: "search";
469
+ inst: "inst";
470
+ file: "file";
471
+ event: "event";
472
+ data: "data";
473
+ webhook: "webhook";
474
+ notification: "notification";
475
+ package: "package";
476
+ database: "database";
477
+ permissions: "permissions";
478
+ ai: "ai";
479
+ }>;
480
+ scope: z.ZodEnum<{
481
+ shared: "shared";
482
+ personal: "personal";
483
+ owned: "owned";
484
+ studio: "studio";
485
+ designated: "designated";
486
+ }>;
487
+ designatedRecords: z.ZodOptional<z.ZodArray<z.ZodString>>;
488
+ }, z.core.$strip>;
278
489
  /**
279
490
  * Defines an interface that describes common options for all permissions.
280
491
  */
@@ -312,24 +523,16 @@ export interface Permission {
312
523
  expireTimeMs: number | null;
313
524
  }
314
525
  export declare const PERMISSION_VALIDATION: z.ZodObject<{
315
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
526
+ subjectType: z.ZodEnum<{
527
+ inst: "inst";
528
+ user: "user";
529
+ role: "role";
530
+ }>;
316
531
  subjectId: z.ZodString;
317
532
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
533
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
319
534
  marker: z.ZodOptional<z.ZodString>;
320
- }, "strip", z.ZodTypeAny, {
321
- subjectType?: "inst" | "user" | "role";
322
- subjectId?: string;
323
- resourceId?: string;
324
- expireTimeMs?: number;
325
- marker?: string;
326
- }, {
327
- subjectType?: "inst" | "user" | "role";
328
- subjectId?: string;
329
- resourceId?: string;
330
- expireTimeMs?: number;
331
- marker?: string;
332
- }>;
535
+ }, z.core.$strip>;
333
536
  /**
334
537
  * Defines an interface that describes the common options for all permissions that affect data records.
335
538
  *
@@ -348,30 +551,24 @@ export interface DataPermission extends Permission {
348
551
  action: DataActionKinds | null;
349
552
  }
350
553
  export declare const DATA_PERMISSION_VALIDATION: z.ZodObject<{
351
- marker: z.ZodOptional<z.ZodString>;
352
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
554
+ subjectType: z.ZodEnum<{
555
+ inst: "inst";
556
+ user: "user";
557
+ role: "role";
558
+ }>;
353
559
  subjectId: z.ZodString;
354
560
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
355
561
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
562
+ marker: z.ZodOptional<z.ZodString>;
356
563
  resourceKind: z.ZodLiteral<"data">;
357
- action: z.ZodNullable<z.ZodEnum<["read", "create", "update", "delete", "list"]>>;
358
- }, "strip", z.ZodTypeAny, {
359
- marker?: string;
360
- subjectType?: "inst" | "user" | "role";
361
- subjectId?: string;
362
- resourceId?: string;
363
- expireTimeMs?: number;
364
- resourceKind?: "data";
365
- action?: "create" | "read" | "update" | "delete" | "list";
366
- }, {
367
- marker?: string;
368
- subjectType?: "inst" | "user" | "role";
369
- subjectId?: string;
370
- resourceId?: string;
371
- expireTimeMs?: number;
372
- resourceKind?: "data";
373
- action?: "create" | "read" | "update" | "delete" | "list";
374
- }>;
564
+ action: z.ZodNullable<z.ZodEnum<{
565
+ read: "read";
566
+ create: "create";
567
+ update: "update";
568
+ delete: "delete";
569
+ list: "list";
570
+ }>>;
571
+ }, z.core.$strip>;
375
572
  /**
376
573
  * Options for file permissions.
377
574
  *
@@ -393,14 +590,8 @@ export interface FilePermissionOptions {
393
590
  }
394
591
  export declare const FILE_PERMISSION_OPTIONS_VALIDATION: z.ZodObject<{
395
592
  maxFileSizeInBytes: z.ZodOptional<z.ZodNumber>;
396
- allowedMimeTypes: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodArray<z.ZodString, "many">]>>;
397
- }, "strip", z.ZodTypeAny, {
398
- maxFileSizeInBytes?: number;
399
- allowedMimeTypes?: true | string[];
400
- }, {
401
- maxFileSizeInBytes?: number;
402
- allowedMimeTypes?: true | string[];
403
- }>;
593
+ allowedMimeTypes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
594
+ }, z.core.$strip>;
404
595
  /**
405
596
  * Defines an interface that describes the common options for all permissions that affect file records.
406
597
  *
@@ -423,48 +614,28 @@ export interface FilePermission extends Permission {
423
614
  options: FilePermissionOptions;
424
615
  }
425
616
  export declare const FILE_PERMISSION_VALIDATION: z.ZodObject<{
426
- marker: z.ZodOptional<z.ZodString>;
427
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
617
+ subjectType: z.ZodEnum<{
618
+ inst: "inst";
619
+ user: "user";
620
+ role: "role";
621
+ }>;
428
622
  subjectId: z.ZodString;
429
623
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
430
624
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
625
+ marker: z.ZodOptional<z.ZodString>;
431
626
  resourceKind: z.ZodLiteral<"file">;
432
- action: z.ZodNullable<z.ZodEnum<["read", "create", "update", "delete", "list"]>>;
627
+ action: z.ZodNullable<z.ZodEnum<{
628
+ read: "read";
629
+ create: "create";
630
+ update: "update";
631
+ delete: "delete";
632
+ list: "list";
633
+ }>>;
433
634
  options: z.ZodObject<{
434
635
  maxFileSizeInBytes: z.ZodOptional<z.ZodNumber>;
435
- allowedMimeTypes: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodArray<z.ZodString, "many">]>>;
436
- }, "strip", z.ZodTypeAny, {
437
- maxFileSizeInBytes?: number;
438
- allowedMimeTypes?: true | string[];
439
- }, {
440
- maxFileSizeInBytes?: number;
441
- allowedMimeTypes?: true | string[];
442
- }>;
443
- }, "strip", z.ZodTypeAny, {
444
- marker?: string;
445
- subjectType?: "inst" | "user" | "role";
446
- subjectId?: string;
447
- resourceId?: string;
448
- expireTimeMs?: number;
449
- resourceKind?: "file";
450
- action?: "create" | "read" | "update" | "delete" | "list";
451
- options?: {
452
- maxFileSizeInBytes?: number;
453
- allowedMimeTypes?: true | string[];
454
- };
455
- }, {
456
- marker?: string;
457
- subjectType?: "inst" | "user" | "role";
458
- subjectId?: string;
459
- resourceId?: string;
460
- expireTimeMs?: number;
461
- resourceKind?: "file";
462
- action?: "create" | "read" | "update" | "delete" | "list";
463
- options?: {
464
- maxFileSizeInBytes?: number;
465
- allowedMimeTypes?: true | string[];
466
- };
467
- }>;
636
+ allowedMimeTypes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
637
+ }, z.core.$strip>;
638
+ }, z.core.$strip>;
468
639
  /**
469
640
  * Defines an interface that describes the common options for all permissions that affect event records.
470
641
  *
@@ -483,30 +654,23 @@ export interface EventPermission extends Permission {
483
654
  action: EventActionKinds | null;
484
655
  }
485
656
  export declare const EVENT_PERMISSION_VALIDATION: z.ZodObject<{
486
- marker: z.ZodOptional<z.ZodString>;
487
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
657
+ subjectType: z.ZodEnum<{
658
+ inst: "inst";
659
+ user: "user";
660
+ role: "role";
661
+ }>;
488
662
  subjectId: z.ZodString;
489
663
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
664
+ marker: z.ZodOptional<z.ZodString>;
490
665
  resourceKind: z.ZodLiteral<"event">;
491
666
  resourceId: z.ZodNullable<z.ZodString>;
492
- action: z.ZodNullable<z.ZodEnum<["increment", "count", "update", "list"]>>;
493
- }, "strip", z.ZodTypeAny, {
494
- marker?: string;
495
- subjectType?: "inst" | "user" | "role";
496
- subjectId?: string;
497
- expireTimeMs?: number;
498
- resourceKind?: "event";
499
- resourceId?: string;
500
- action?: "update" | "increment" | "count" | "list";
501
- }, {
502
- marker?: string;
503
- subjectType?: "inst" | "user" | "role";
504
- subjectId?: string;
505
- expireTimeMs?: number;
506
- resourceKind?: "event";
507
- resourceId?: string;
508
- action?: "update" | "increment" | "count" | "list";
509
- }>;
667
+ action: z.ZodNullable<z.ZodEnum<{
668
+ update: "update";
669
+ increment: "increment";
670
+ count: "count";
671
+ list: "list";
672
+ }>>;
673
+ }, z.core.$strip>;
510
674
  /**
511
675
  * Defines an interface that describes the common options for all permissions that affect markers.
512
676
  *
@@ -525,30 +689,24 @@ export interface MarkerPermission extends Permission {
525
689
  action: MarkerActionKinds | null;
526
690
  }
527
691
  export declare const MARKER_PERMISSION_VALIDATION: z.ZodObject<{
528
- marker: z.ZodOptional<z.ZodString>;
529
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
692
+ subjectType: z.ZodEnum<{
693
+ inst: "inst";
694
+ user: "user";
695
+ role: "role";
696
+ }>;
530
697
  subjectId: z.ZodString;
531
698
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
532
699
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
700
+ marker: z.ZodOptional<z.ZodString>;
533
701
  resourceKind: z.ZodLiteral<"marker">;
534
- action: z.ZodNullable<z.ZodEnum<["assign", "unassign", "grantPermission", "revokePermission", "read"]>>;
535
- }, "strip", z.ZodTypeAny, {
536
- marker?: string;
537
- subjectType?: "inst" | "user" | "role";
538
- subjectId?: string;
539
- resourceId?: string;
540
- expireTimeMs?: number;
541
- resourceKind?: "marker";
542
- action?: "read" | "assign" | "unassign" | "grantPermission" | "revokePermission";
543
- }, {
544
- marker?: string;
545
- subjectType?: "inst" | "user" | "role";
546
- subjectId?: string;
547
- resourceId?: string;
548
- expireTimeMs?: number;
549
- resourceKind?: "marker";
550
- action?: "read" | "assign" | "unassign" | "grantPermission" | "revokePermission";
551
- }>;
702
+ action: z.ZodNullable<z.ZodEnum<{
703
+ read: "read";
704
+ assign: "assign";
705
+ unassign: "unassign";
706
+ grantPermission: "grantPermission";
707
+ revokePermission: "revokePermission";
708
+ }>>;
709
+ }, z.core.$strip>;
552
710
  /**
553
711
  * Options for role permissions.
554
712
  *
@@ -564,11 +722,7 @@ export interface RolePermissionOptions {
564
722
  }
565
723
  export declare const ROLE_PERMISSION_OPTIONS_VALIDATION: z.ZodObject<{
566
724
  maxDurationMs: z.ZodOptional<z.ZodNumber>;
567
- }, "strip", z.ZodTypeAny, {
568
- maxDurationMs?: number;
569
- }, {
570
- maxDurationMs?: number;
571
- }>;
725
+ }, z.core.$strip>;
572
726
  /**
573
727
  * Defines an interface that describes the common options for all permissions that affect roles.
574
728
  *
@@ -596,43 +750,27 @@ export interface RolePermission extends Permission {
596
750
  options: RolePermissionOptions;
597
751
  }
598
752
  export declare const ROLE_PERMISSION_VALIDATION: z.ZodObject<{
599
- marker: z.ZodOptional<z.ZodString>;
600
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
753
+ subjectType: z.ZodEnum<{
754
+ inst: "inst";
755
+ user: "user";
756
+ role: "role";
757
+ }>;
601
758
  subjectId: z.ZodString;
602
759
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
603
760
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
761
+ marker: z.ZodOptional<z.ZodString>;
604
762
  resourceKind: z.ZodLiteral<"role">;
605
- action: z.ZodNullable<z.ZodEnum<["grant", "revoke", "read", "update", "list"]>>;
763
+ action: z.ZodNullable<z.ZodEnum<{
764
+ read: "read";
765
+ update: "update";
766
+ list: "list";
767
+ grant: "grant";
768
+ revoke: "revoke";
769
+ }>>;
606
770
  options: z.ZodObject<{
607
771
  maxDurationMs: z.ZodOptional<z.ZodNumber>;
608
- }, "strip", z.ZodTypeAny, {
609
- maxDurationMs?: number;
610
- }, {
611
- maxDurationMs?: number;
612
- }>;
613
- }, "strip", z.ZodTypeAny, {
614
- marker?: string;
615
- subjectType?: "inst" | "user" | "role";
616
- subjectId?: string;
617
- resourceId?: string;
618
- expireTimeMs?: number;
619
- resourceKind?: "role";
620
- action?: "read" | "update" | "list" | "grant" | "revoke";
621
- options?: {
622
- maxDurationMs?: number;
623
- };
624
- }, {
625
- marker?: string;
626
- subjectType?: "inst" | "user" | "role";
627
- subjectId?: string;
628
- resourceId?: string;
629
- expireTimeMs?: number;
630
- resourceKind?: "role";
631
- action?: "read" | "update" | "list" | "grant" | "revoke";
632
- options?: {
633
- maxDurationMs?: number;
634
- };
635
- }>;
772
+ }, z.core.$strip>;
773
+ }, z.core.$strip>;
636
774
  /**
637
775
  * Defines an interface that describes common options for all permissions that affect insts.
638
776
  *
@@ -656,30 +794,26 @@ export interface InstPermission extends Permission {
656
794
  action: InstActionKinds | null;
657
795
  }
658
796
  export declare const INST_PERMISSION_VALIDATION: z.ZodObject<{
659
- marker: z.ZodOptional<z.ZodString>;
660
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
797
+ subjectType: z.ZodEnum<{
798
+ inst: "inst";
799
+ user: "user";
800
+ role: "role";
801
+ }>;
661
802
  subjectId: z.ZodString;
662
803
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
663
804
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
805
+ marker: z.ZodOptional<z.ZodString>;
664
806
  resourceKind: z.ZodLiteral<"inst">;
665
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "updateData", "delete", "list", "sendAction"]>>;
666
- }, "strip", z.ZodTypeAny, {
667
- marker?: string;
668
- subjectType?: "inst" | "user" | "role";
669
- subjectId?: string;
670
- resourceId?: string;
671
- expireTimeMs?: number;
672
- resourceKind?: "inst";
673
- action?: "create" | "read" | "update" | "delete" | "list" | "sendAction" | "updateData";
674
- }, {
675
- marker?: string;
676
- subjectType?: "inst" | "user" | "role";
677
- subjectId?: string;
678
- resourceId?: string;
679
- expireTimeMs?: number;
680
- resourceKind?: "inst";
681
- action?: "create" | "read" | "update" | "delete" | "list" | "sendAction" | "updateData";
682
- }>;
807
+ action: z.ZodNullable<z.ZodEnum<{
808
+ read: "read";
809
+ create: "create";
810
+ update: "update";
811
+ delete: "delete";
812
+ list: "list";
813
+ sendAction: "sendAction";
814
+ updateData: "updateData";
815
+ }>>;
816
+ }, z.core.$strip>;
683
817
  /**
684
818
  * Defines an interface that describes common options for all permissions that affect loom resources.
685
819
  *
@@ -698,30 +832,20 @@ export interface LoomPermission extends Permission {
698
832
  action: LoomActionKinds | null;
699
833
  }
700
834
  export declare const LOOM_PERMISSION_VALIDATION: z.ZodObject<{
701
- marker: z.ZodOptional<z.ZodString>;
702
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
835
+ subjectType: z.ZodEnum<{
836
+ inst: "inst";
837
+ user: "user";
838
+ role: "role";
839
+ }>;
703
840
  subjectId: z.ZodString;
704
841
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
705
842
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
843
+ marker: z.ZodOptional<z.ZodString>;
706
844
  resourceKind: z.ZodLiteral<"loom">;
707
- action: z.ZodNullable<z.ZodEnum<["create"]>>;
708
- }, "strip", z.ZodTypeAny, {
709
- marker?: string;
710
- subjectType?: "inst" | "user" | "role";
711
- subjectId?: string;
712
- resourceId?: string;
713
- expireTimeMs?: number;
714
- resourceKind?: "loom";
715
- action?: "create";
716
- }, {
717
- marker?: string;
718
- subjectType?: "inst" | "user" | "role";
719
- subjectId?: string;
720
- resourceId?: string;
721
- expireTimeMs?: number;
722
- resourceKind?: "loom";
723
- action?: "create";
724
- }>;
845
+ action: z.ZodNullable<z.ZodEnum<{
846
+ create: "create";
847
+ }>>;
848
+ }, z.core.$strip>;
725
849
  /**
726
850
  * Defines an interface that describes common options for all permissions that affect ai.sloyd resources.
727
851
  *
@@ -740,30 +864,20 @@ export interface SloydPermission extends Permission {
740
864
  action: SloydActionKinds | null;
741
865
  }
742
866
  export declare const SLOYD_PERMISSION_VALIDATION: z.ZodObject<{
743
- marker: z.ZodOptional<z.ZodString>;
744
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
867
+ subjectType: z.ZodEnum<{
868
+ inst: "inst";
869
+ user: "user";
870
+ role: "role";
871
+ }>;
745
872
  subjectId: z.ZodString;
746
873
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
747
874
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
875
+ marker: z.ZodOptional<z.ZodString>;
748
876
  resourceKind: z.ZodLiteral<"ai.sloyd">;
749
- action: z.ZodNullable<z.ZodEnum<["create"]>>;
750
- }, "strip", z.ZodTypeAny, {
751
- marker?: string;
752
- subjectType?: "inst" | "user" | "role";
753
- subjectId?: string;
754
- resourceId?: string;
755
- expireTimeMs?: number;
756
- resourceKind?: "ai.sloyd";
757
- action?: "create";
758
- }, {
759
- marker?: string;
760
- subjectType?: "inst" | "user" | "role";
761
- subjectId?: string;
762
- resourceId?: string;
763
- expireTimeMs?: number;
764
- resourceKind?: "ai.sloyd";
765
- action?: "create";
766
- }>;
877
+ action: z.ZodNullable<z.ZodEnum<{
878
+ create: "create";
879
+ }>>;
880
+ }, z.core.$strip>;
767
881
  /**
768
882
  * Defines an interface that describes common options for all permissions that affect ai.hume resources.
769
883
  *
@@ -782,30 +896,20 @@ export interface HumePermission extends Permission {
782
896
  action: HumeActionKinds | null;
783
897
  }
784
898
  export declare const HUME_PERMISSION_VALIDATION: z.ZodObject<{
785
- marker: z.ZodOptional<z.ZodString>;
786
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
899
+ subjectType: z.ZodEnum<{
900
+ inst: "inst";
901
+ user: "user";
902
+ role: "role";
903
+ }>;
787
904
  subjectId: z.ZodString;
788
905
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
789
906
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
907
+ marker: z.ZodOptional<z.ZodString>;
790
908
  resourceKind: z.ZodLiteral<"ai.hume">;
791
- action: z.ZodNullable<z.ZodEnum<["create"]>>;
792
- }, "strip", z.ZodTypeAny, {
793
- marker?: string;
794
- subjectType?: "inst" | "user" | "role";
795
- subjectId?: string;
796
- resourceId?: string;
797
- expireTimeMs?: number;
798
- resourceKind?: "ai.hume";
799
- action?: "create";
800
- }, {
801
- marker?: string;
802
- subjectType?: "inst" | "user" | "role";
803
- subjectId?: string;
804
- resourceId?: string;
805
- expireTimeMs?: number;
806
- resourceKind?: "ai.hume";
807
- action?: "create";
808
- }>;
909
+ action: z.ZodNullable<z.ZodEnum<{
910
+ create: "create";
911
+ }>>;
912
+ }, z.core.$strip>;
809
913
  /**
810
914
  * Defines an interface that describes common options for all permissions that affect ai.openai.realtime resources.
811
915
  *
@@ -824,30 +928,20 @@ export interface OpenAIRealtimePermission extends Permission {
824
928
  action: OpenAIRealtimeActionKinds | null;
825
929
  }
826
930
  export declare const OPENAI_REALTIME_PERMISSION_VALIDATION: z.ZodObject<{
827
- marker: z.ZodOptional<z.ZodString>;
828
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
931
+ subjectType: z.ZodEnum<{
932
+ inst: "inst";
933
+ user: "user";
934
+ role: "role";
935
+ }>;
829
936
  subjectId: z.ZodString;
830
937
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
831
938
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
939
+ marker: z.ZodOptional<z.ZodString>;
832
940
  resourceKind: z.ZodLiteral<"ai.openai.realtime">;
833
- action: z.ZodNullable<z.ZodEnum<["create"]>>;
834
- }, "strip", z.ZodTypeAny, {
835
- marker?: string;
836
- subjectType?: "inst" | "user" | "role";
837
- subjectId?: string;
838
- resourceId?: string;
839
- expireTimeMs?: number;
840
- resourceKind?: "ai.openai.realtime";
841
- action?: "create";
842
- }, {
843
- marker?: string;
844
- subjectType?: "inst" | "user" | "role";
845
- subjectId?: string;
846
- resourceId?: string;
847
- expireTimeMs?: number;
848
- resourceKind?: "ai.openai.realtime";
849
- action?: "create";
850
- }>;
941
+ action: z.ZodNullable<z.ZodEnum<{
942
+ create: "create";
943
+ }>>;
944
+ }, z.core.$strip>;
851
945
  /**
852
946
  * Defines an interface that describes common options for all permissions that affect webhook resources.
853
947
  *
@@ -866,30 +960,25 @@ export interface WebhookPermission extends Permission {
866
960
  action: WebhookActionKinds | null;
867
961
  }
868
962
  export declare const WEBHOOK_PERMISSION_VALIDATION: z.ZodObject<{
869
- marker: z.ZodOptional<z.ZodString>;
870
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
963
+ subjectType: z.ZodEnum<{
964
+ inst: "inst";
965
+ user: "user";
966
+ role: "role";
967
+ }>;
871
968
  subjectId: z.ZodString;
872
969
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
873
970
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
971
+ marker: z.ZodOptional<z.ZodString>;
874
972
  resourceKind: z.ZodLiteral<"webhook">;
875
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
876
- }, "strip", z.ZodTypeAny, {
877
- marker?: string;
878
- subjectType?: "inst" | "user" | "role";
879
- subjectId?: string;
880
- resourceId?: string;
881
- expireTimeMs?: number;
882
- resourceKind?: "webhook";
883
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
884
- }, {
885
- marker?: string;
886
- subjectType?: "inst" | "user" | "role";
887
- subjectId?: string;
888
- resourceId?: string;
889
- expireTimeMs?: number;
890
- resourceKind?: "webhook";
891
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
892
- }>;
973
+ action: z.ZodNullable<z.ZodEnum<{
974
+ run: "run";
975
+ read: "read";
976
+ create: "create";
977
+ update: "update";
978
+ delete: "delete";
979
+ list: "list";
980
+ }>>;
981
+ }, z.core.$strip>;
893
982
  /**
894
983
  * Defines an interface that describes common options for all permissions that affect notification resources.
895
984
  *
@@ -908,30 +997,28 @@ export interface NotificationPermission extends Permission {
908
997
  action: NotificationActionKinds | null;
909
998
  }
910
999
  export declare const NOTIFICATION_PERMISSION_VALIDATION: z.ZodObject<{
911
- marker: z.ZodOptional<z.ZodString>;
912
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1000
+ subjectType: z.ZodEnum<{
1001
+ inst: "inst";
1002
+ user: "user";
1003
+ role: "role";
1004
+ }>;
913
1005
  subjectId: z.ZodString;
914
1006
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
915
1007
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1008
+ marker: z.ZodOptional<z.ZodString>;
916
1009
  resourceKind: z.ZodLiteral<"notification">;
917
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "send", "subscribe", "unsubscribe", "listSubscriptions"]>>;
918
- }, "strip", z.ZodTypeAny, {
919
- marker?: string;
920
- subjectType?: "inst" | "user" | "role";
921
- subjectId?: string;
922
- resourceId?: string;
923
- expireTimeMs?: number;
924
- resourceKind?: "notification";
925
- action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
926
- }, {
927
- marker?: string;
928
- subjectType?: "inst" | "user" | "role";
929
- subjectId?: string;
930
- resourceId?: string;
931
- expireTimeMs?: number;
932
- resourceKind?: "notification";
933
- action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
934
- }>;
1010
+ action: z.ZodNullable<z.ZodEnum<{
1011
+ read: "read";
1012
+ create: "create";
1013
+ update: "update";
1014
+ delete: "delete";
1015
+ list: "list";
1016
+ send: "send";
1017
+ subscribe: "subscribe";
1018
+ unsubscribe: "unsubscribe";
1019
+ listSubscriptions: "listSubscriptions";
1020
+ }>>;
1021
+ }, z.core.$strip>;
935
1022
  /**
936
1023
  * Defines an interface that describes common options for all permissions that affect package resources.
937
1024
  *
@@ -950,30 +1037,25 @@ export interface PackagePermission extends Permission {
950
1037
  action: PackageActionKinds | null;
951
1038
  }
952
1039
  export declare const PACKAGE_PERMISSION_VALIDATION: z.ZodObject<{
953
- marker: z.ZodOptional<z.ZodString>;
954
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1040
+ subjectType: z.ZodEnum<{
1041
+ inst: "inst";
1042
+ user: "user";
1043
+ role: "role";
1044
+ }>;
955
1045
  subjectId: z.ZodString;
956
1046
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
957
1047
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1048
+ marker: z.ZodOptional<z.ZodString>;
958
1049
  resourceKind: z.ZodLiteral<"package">;
959
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
960
- }, "strip", z.ZodTypeAny, {
961
- marker?: string;
962
- subjectType?: "inst" | "user" | "role";
963
- subjectId?: string;
964
- resourceId?: string;
965
- expireTimeMs?: number;
966
- resourceKind?: "package";
967
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
968
- }, {
969
- marker?: string;
970
- subjectType?: "inst" | "user" | "role";
971
- subjectId?: string;
972
- resourceId?: string;
973
- expireTimeMs?: number;
974
- resourceKind?: "package";
975
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
976
- }>;
1050
+ action: z.ZodNullable<z.ZodEnum<{
1051
+ run: "run";
1052
+ read: "read";
1053
+ create: "create";
1054
+ update: "update";
1055
+ delete: "delete";
1056
+ list: "list";
1057
+ }>>;
1058
+ }, z.core.$strip>;
977
1059
  /**
978
1060
  * Defines an interface that describes common options for all permissions that affect package.version resources.
979
1061
  *
@@ -992,30 +1074,25 @@ export interface PackageVersionPermission extends Permission {
992
1074
  action: PackageVersionActionKinds | null;
993
1075
  }
994
1076
  export declare const PACKAGE_VERSION_PERMISSION_VALIDATION: z.ZodObject<{
995
- marker: z.ZodOptional<z.ZodString>;
996
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1077
+ subjectType: z.ZodEnum<{
1078
+ inst: "inst";
1079
+ user: "user";
1080
+ role: "role";
1081
+ }>;
997
1082
  subjectId: z.ZodString;
998
1083
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
999
1084
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1085
+ marker: z.ZodOptional<z.ZodString>;
1000
1086
  resourceKind: z.ZodLiteral<"package.version">;
1001
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
1002
- }, "strip", z.ZodTypeAny, {
1003
- marker?: string;
1004
- subjectType?: "inst" | "user" | "role";
1005
- subjectId?: string;
1006
- resourceId?: string;
1007
- expireTimeMs?: number;
1008
- resourceKind?: "package.version";
1009
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
1010
- }, {
1011
- marker?: string;
1012
- subjectType?: "inst" | "user" | "role";
1013
- subjectId?: string;
1014
- resourceId?: string;
1015
- expireTimeMs?: number;
1016
- resourceKind?: "package.version";
1017
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
1018
- }>;
1087
+ action: z.ZodNullable<z.ZodEnum<{
1088
+ run: "run";
1089
+ read: "read";
1090
+ create: "create";
1091
+ update: "update";
1092
+ delete: "delete";
1093
+ list: "list";
1094
+ }>>;
1095
+ }, z.core.$strip>;
1019
1096
  /**
1020
1097
  * Defines an interface that describes common options for all permissions that affect search resources.
1021
1098
  *
@@ -1034,30 +1111,24 @@ export interface SearchPermission extends Permission {
1034
1111
  action: SearchActionKinds | null;
1035
1112
  }
1036
1113
  export declare const SEARCH_PERMISSION_VALIDATION: z.ZodObject<{
1037
- marker: z.ZodOptional<z.ZodString>;
1038
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1114
+ subjectType: z.ZodEnum<{
1115
+ inst: "inst";
1116
+ user: "user";
1117
+ role: "role";
1118
+ }>;
1039
1119
  subjectId: z.ZodString;
1040
1120
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1041
1121
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1122
+ marker: z.ZodOptional<z.ZodString>;
1042
1123
  resourceKind: z.ZodLiteral<"search">;
1043
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list"]>>;
1044
- }, "strip", z.ZodTypeAny, {
1045
- marker?: string;
1046
- subjectType?: "inst" | "user" | "role";
1047
- subjectId?: string;
1048
- resourceId?: string;
1049
- expireTimeMs?: number;
1050
- resourceKind?: "search";
1051
- action?: "create" | "read" | "update" | "delete" | "list";
1052
- }, {
1053
- marker?: string;
1054
- subjectType?: "inst" | "user" | "role";
1055
- subjectId?: string;
1056
- resourceId?: string;
1057
- expireTimeMs?: number;
1058
- resourceKind?: "search";
1059
- action?: "create" | "read" | "update" | "delete" | "list";
1060
- }>;
1124
+ action: z.ZodNullable<z.ZodEnum<{
1125
+ read: "read";
1126
+ create: "create";
1127
+ update: "update";
1128
+ delete: "delete";
1129
+ list: "list";
1130
+ }>>;
1131
+ }, z.core.$strip>;
1061
1132
  /**
1062
1133
  * Defines an interface that describes common options for all permissions that affect search resources.
1063
1134
  *
@@ -1076,446 +1147,487 @@ export interface DatabasePermission extends Permission {
1076
1147
  action: DatabaseActionKinds | null;
1077
1148
  }
1078
1149
  export declare const DATABASE_PERMISSION_VALIDATION: z.ZodObject<{
1079
- marker: z.ZodOptional<z.ZodString>;
1080
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1150
+ subjectType: z.ZodEnum<{
1151
+ inst: "inst";
1152
+ user: "user";
1153
+ role: "role";
1154
+ }>;
1081
1155
  subjectId: z.ZodString;
1082
1156
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1083
1157
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1158
+ marker: z.ZodOptional<z.ZodString>;
1084
1159
  resourceKind: z.ZodLiteral<"database">;
1085
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list"]>>;
1086
- }, "strip", z.ZodTypeAny, {
1087
- marker?: string;
1088
- subjectType?: "inst" | "user" | "role";
1089
- subjectId?: string;
1090
- resourceId?: string;
1091
- expireTimeMs?: number;
1092
- resourceKind?: "database";
1093
- action?: "create" | "read" | "update" | "delete" | "list";
1094
- }, {
1095
- marker?: string;
1096
- subjectType?: "inst" | "user" | "role";
1097
- subjectId?: string;
1098
- resourceId?: string;
1099
- expireTimeMs?: number;
1100
- resourceKind?: "database";
1101
- action?: "create" | "read" | "update" | "delete" | "list";
1102
- }>;
1103
- export declare const AVAILABLE_PERMISSIONS_VALIDATION: z.ZodDiscriminatedUnion<"resourceKind", [z.ZodObject<{
1160
+ action: z.ZodNullable<z.ZodEnum<{
1161
+ read: "read";
1162
+ create: "create";
1163
+ update: "update";
1164
+ delete: "delete";
1165
+ list: "list";
1166
+ }>>;
1167
+ }, z.core.$strip>;
1168
+ /**
1169
+ * Defines an interface that describes common options for all purchasableItem permissions.
1170
+ *
1171
+ * @dochash types/permissions
1172
+ * @docname PurchasableItemPermission
1173
+ */
1174
+ export interface PurchasableItemPermission extends Permission {
1175
+ /**
1176
+ * The kind of the permission.
1177
+ */
1178
+ resourceKind: 'purchasableItem';
1179
+ /**
1180
+ * The ID of the resource that is allowed.
1181
+ * If null, then all resources are allowed.
1182
+ */
1183
+ resourceId: string | null;
1184
+ action: PurchasableItemActionKinds | null;
1185
+ }
1186
+ export declare const PURCHASABLE_ITEM_PERMISSION_VALIDATION: z.ZodObject<{
1187
+ subjectType: z.ZodEnum<{
1188
+ inst: "inst";
1189
+ user: "user";
1190
+ role: "role";
1191
+ }>;
1192
+ subjectId: z.ZodString;
1193
+ resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1194
+ expireTimeMs: z.ZodNullable<z.ZodNumber>;
1104
1195
  marker: z.ZodOptional<z.ZodString>;
1105
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1196
+ resourceKind: z.ZodLiteral<"purchasableItem">;
1197
+ action: z.ZodNullable<z.ZodEnum<{
1198
+ read: "read";
1199
+ create: "create";
1200
+ update: "update";
1201
+ delete: "delete";
1202
+ list: "list";
1203
+ purchase: "purchase";
1204
+ }>>;
1205
+ }, z.core.$strip>;
1206
+ /**
1207
+ * Defines an interface that describes common options for all contract permissions.
1208
+ *
1209
+ * @dochash types/permissions
1210
+ * @docname ContractPermission
1211
+ */
1212
+ export interface ContractPermission extends Permission {
1213
+ /**
1214
+ * The kind of the permission.
1215
+ */
1216
+ resourceKind: 'contract';
1217
+ /**
1218
+ * The ID of the resource that is allowed.
1219
+ * If null, then all resources are allowed.
1220
+ */
1221
+ resourceId: string | null;
1222
+ action: ContractActionKinds | null;
1223
+ }
1224
+ export declare const CONTRACT_PERMISSION_VALIDATION: z.ZodObject<{
1225
+ subjectType: z.ZodEnum<{
1226
+ inst: "inst";
1227
+ user: "user";
1228
+ role: "role";
1229
+ }>;
1230
+ subjectId: z.ZodString;
1231
+ resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1232
+ expireTimeMs: z.ZodNullable<z.ZodNumber>;
1233
+ marker: z.ZodOptional<z.ZodString>;
1234
+ resourceKind: z.ZodLiteral<"contract">;
1235
+ action: z.ZodNullable<z.ZodEnum<{
1236
+ read: "read";
1237
+ create: "create";
1238
+ update: "update";
1239
+ delete: "delete";
1240
+ list: "list";
1241
+ purchase: "purchase";
1242
+ cancel: "cancel";
1243
+ }>>;
1244
+ }, z.core.$strip>;
1245
+ /**
1246
+ * Defines an interface that describes common options for all invoice permissions.
1247
+ *
1248
+ * @dochash types/permissions
1249
+ * @docname InvoicePermission
1250
+ */
1251
+ export interface InvoicePermission extends Permission {
1252
+ /**
1253
+ * The kind of the permission.
1254
+ */
1255
+ resourceKind: 'invoice';
1256
+ /**
1257
+ * The ID of the resource that is allowed.
1258
+ * If null, then all resources are allowed.
1259
+ */
1260
+ resourceId: string | null;
1261
+ action: InvoiceActionKinds | null;
1262
+ }
1263
+ export declare const INVOICE_PERMISSION_VALIDATION: z.ZodObject<{
1264
+ subjectType: z.ZodEnum<{
1265
+ inst: "inst";
1266
+ user: "user";
1267
+ role: "role";
1268
+ }>;
1106
1269
  subjectId: z.ZodString;
1107
1270
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1108
1271
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1109
- resourceKind: z.ZodLiteral<"data">;
1110
- action: z.ZodNullable<z.ZodEnum<["read", "create", "update", "delete", "list"]>>;
1111
- }, "strip", z.ZodTypeAny, {
1112
- marker?: string;
1113
- subjectType?: "inst" | "user" | "role";
1114
- subjectId?: string;
1115
- resourceId?: string;
1116
- expireTimeMs?: number;
1117
- resourceKind?: "data";
1118
- action?: "create" | "read" | "update" | "delete" | "list";
1119
- }, {
1120
- marker?: string;
1121
- subjectType?: "inst" | "user" | "role";
1122
- subjectId?: string;
1123
- resourceId?: string;
1124
- expireTimeMs?: number;
1125
- resourceKind?: "data";
1126
- action?: "create" | "read" | "update" | "delete" | "list";
1127
- }>, z.ZodObject<{
1128
1272
  marker: z.ZodOptional<z.ZodString>;
1129
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1273
+ resourceKind: z.ZodLiteral<"invoice">;
1274
+ action: z.ZodNullable<z.ZodEnum<{
1275
+ read: "read";
1276
+ create: "create";
1277
+ update: "update";
1278
+ delete: "delete";
1279
+ list: "list";
1280
+ approve: "approve";
1281
+ cancel: "cancel";
1282
+ }>>;
1283
+ }, z.core.$strip>;
1284
+ export declare const AVAILABLE_PERMISSIONS_VALIDATION: z.ZodDiscriminatedUnion<[z.ZodObject<{
1285
+ subjectType: z.ZodEnum<{
1286
+ inst: "inst";
1287
+ user: "user";
1288
+ role: "role";
1289
+ }>;
1130
1290
  subjectId: z.ZodString;
1131
1291
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1132
1292
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1293
+ marker: z.ZodOptional<z.ZodString>;
1294
+ resourceKind: z.ZodLiteral<"data">;
1295
+ action: z.ZodNullable<z.ZodEnum<{
1296
+ read: "read";
1297
+ create: "create";
1298
+ update: "update";
1299
+ delete: "delete";
1300
+ list: "list";
1301
+ }>>;
1302
+ }, z.core.$strip>, z.ZodObject<{
1303
+ subjectType: z.ZodEnum<{
1304
+ inst: "inst";
1305
+ user: "user";
1306
+ role: "role";
1307
+ }>;
1308
+ subjectId: z.ZodString;
1309
+ resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1310
+ expireTimeMs: z.ZodNullable<z.ZodNumber>;
1311
+ marker: z.ZodOptional<z.ZodString>;
1133
1312
  resourceKind: z.ZodLiteral<"file">;
1134
- action: z.ZodNullable<z.ZodEnum<["read", "create", "update", "delete", "list"]>>;
1313
+ action: z.ZodNullable<z.ZodEnum<{
1314
+ read: "read";
1315
+ create: "create";
1316
+ update: "update";
1317
+ delete: "delete";
1318
+ list: "list";
1319
+ }>>;
1135
1320
  options: z.ZodObject<{
1136
1321
  maxFileSizeInBytes: z.ZodOptional<z.ZodNumber>;
1137
- allowedMimeTypes: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodArray<z.ZodString, "many">]>>;
1138
- }, "strip", z.ZodTypeAny, {
1139
- maxFileSizeInBytes?: number;
1140
- allowedMimeTypes?: true | string[];
1141
- }, {
1142
- maxFileSizeInBytes?: number;
1143
- allowedMimeTypes?: true | string[];
1322
+ allowedMimeTypes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
1323
+ }, z.core.$strip>;
1324
+ }, z.core.$strip>, z.ZodObject<{
1325
+ subjectType: z.ZodEnum<{
1326
+ inst: "inst";
1327
+ user: "user";
1328
+ role: "role";
1144
1329
  }>;
1145
- }, "strip", z.ZodTypeAny, {
1146
- marker?: string;
1147
- subjectType?: "inst" | "user" | "role";
1148
- subjectId?: string;
1149
- resourceId?: string;
1150
- expireTimeMs?: number;
1151
- resourceKind?: "file";
1152
- action?: "create" | "read" | "update" | "delete" | "list";
1153
- options?: {
1154
- maxFileSizeInBytes?: number;
1155
- allowedMimeTypes?: true | string[];
1156
- };
1157
- }, {
1158
- marker?: string;
1159
- subjectType?: "inst" | "user" | "role";
1160
- subjectId?: string;
1161
- resourceId?: string;
1162
- expireTimeMs?: number;
1163
- resourceKind?: "file";
1164
- action?: "create" | "read" | "update" | "delete" | "list";
1165
- options?: {
1166
- maxFileSizeInBytes?: number;
1167
- allowedMimeTypes?: true | string[];
1168
- };
1169
- }>, z.ZodObject<{
1170
- marker: z.ZodOptional<z.ZodString>;
1171
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1172
1330
  subjectId: z.ZodString;
1173
1331
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1332
+ marker: z.ZodOptional<z.ZodString>;
1174
1333
  resourceKind: z.ZodLiteral<"event">;
1175
1334
  resourceId: z.ZodNullable<z.ZodString>;
1176
- action: z.ZodNullable<z.ZodEnum<["increment", "count", "update", "list"]>>;
1177
- }, "strip", z.ZodTypeAny, {
1178
- marker?: string;
1179
- subjectType?: "inst" | "user" | "role";
1180
- subjectId?: string;
1181
- expireTimeMs?: number;
1182
- resourceKind?: "event";
1183
- resourceId?: string;
1184
- action?: "update" | "increment" | "count" | "list";
1185
- }, {
1186
- marker?: string;
1187
- subjectType?: "inst" | "user" | "role";
1188
- subjectId?: string;
1189
- expireTimeMs?: number;
1190
- resourceKind?: "event";
1191
- resourceId?: string;
1192
- action?: "update" | "increment" | "count" | "list";
1193
- }>, z.ZodObject<{
1194
- marker: z.ZodOptional<z.ZodString>;
1195
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1335
+ action: z.ZodNullable<z.ZodEnum<{
1336
+ update: "update";
1337
+ increment: "increment";
1338
+ count: "count";
1339
+ list: "list";
1340
+ }>>;
1341
+ }, z.core.$strip>, z.ZodObject<{
1342
+ subjectType: z.ZodEnum<{
1343
+ inst: "inst";
1344
+ user: "user";
1345
+ role: "role";
1346
+ }>;
1196
1347
  subjectId: z.ZodString;
1197
1348
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1198
1349
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1199
- resourceKind: z.ZodLiteral<"marker">;
1200
- action: z.ZodNullable<z.ZodEnum<["assign", "unassign", "grantPermission", "revokePermission", "read"]>>;
1201
- }, "strip", z.ZodTypeAny, {
1202
- marker?: string;
1203
- subjectType?: "inst" | "user" | "role";
1204
- subjectId?: string;
1205
- resourceId?: string;
1206
- expireTimeMs?: number;
1207
- resourceKind?: "marker";
1208
- action?: "read" | "assign" | "unassign" | "grantPermission" | "revokePermission";
1209
- }, {
1210
- marker?: string;
1211
- subjectType?: "inst" | "user" | "role";
1212
- subjectId?: string;
1213
- resourceId?: string;
1214
- expireTimeMs?: number;
1215
- resourceKind?: "marker";
1216
- action?: "read" | "assign" | "unassign" | "grantPermission" | "revokePermission";
1217
- }>, z.ZodObject<{
1218
1350
  marker: z.ZodOptional<z.ZodString>;
1219
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1351
+ resourceKind: z.ZodLiteral<"marker">;
1352
+ action: z.ZodNullable<z.ZodEnum<{
1353
+ read: "read";
1354
+ assign: "assign";
1355
+ unassign: "unassign";
1356
+ grantPermission: "grantPermission";
1357
+ revokePermission: "revokePermission";
1358
+ }>>;
1359
+ }, z.core.$strip>, z.ZodObject<{
1360
+ subjectType: z.ZodEnum<{
1361
+ inst: "inst";
1362
+ user: "user";
1363
+ role: "role";
1364
+ }>;
1220
1365
  subjectId: z.ZodString;
1221
1366
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1222
1367
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1368
+ marker: z.ZodOptional<z.ZodString>;
1223
1369
  resourceKind: z.ZodLiteral<"role">;
1224
- action: z.ZodNullable<z.ZodEnum<["grant", "revoke", "read", "update", "list"]>>;
1370
+ action: z.ZodNullable<z.ZodEnum<{
1371
+ read: "read";
1372
+ update: "update";
1373
+ list: "list";
1374
+ grant: "grant";
1375
+ revoke: "revoke";
1376
+ }>>;
1225
1377
  options: z.ZodObject<{
1226
1378
  maxDurationMs: z.ZodOptional<z.ZodNumber>;
1227
- }, "strip", z.ZodTypeAny, {
1228
- maxDurationMs?: number;
1229
- }, {
1230
- maxDurationMs?: number;
1379
+ }, z.core.$strip>;
1380
+ }, z.core.$strip>, z.ZodObject<{
1381
+ subjectType: z.ZodEnum<{
1382
+ inst: "inst";
1383
+ user: "user";
1384
+ role: "role";
1231
1385
  }>;
1232
- }, "strip", z.ZodTypeAny, {
1233
- marker?: string;
1234
- subjectType?: "inst" | "user" | "role";
1235
- subjectId?: string;
1236
- resourceId?: string;
1237
- expireTimeMs?: number;
1238
- resourceKind?: "role";
1239
- action?: "read" | "update" | "list" | "grant" | "revoke";
1240
- options?: {
1241
- maxDurationMs?: number;
1242
- };
1243
- }, {
1244
- marker?: string;
1245
- subjectType?: "inst" | "user" | "role";
1246
- subjectId?: string;
1247
- resourceId?: string;
1248
- expireTimeMs?: number;
1249
- resourceKind?: "role";
1250
- action?: "read" | "update" | "list" | "grant" | "revoke";
1251
- options?: {
1252
- maxDurationMs?: number;
1253
- };
1254
- }>, z.ZodObject<{
1255
- marker: z.ZodOptional<z.ZodString>;
1256
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1257
1386
  subjectId: z.ZodString;
1258
1387
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1259
1388
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1260
- resourceKind: z.ZodLiteral<"inst">;
1261
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "updateData", "delete", "list", "sendAction"]>>;
1262
- }, "strip", z.ZodTypeAny, {
1263
- marker?: string;
1264
- subjectType?: "inst" | "user" | "role";
1265
- subjectId?: string;
1266
- resourceId?: string;
1267
- expireTimeMs?: number;
1268
- resourceKind?: "inst";
1269
- action?: "create" | "read" | "update" | "delete" | "list" | "sendAction" | "updateData";
1270
- }, {
1271
- marker?: string;
1272
- subjectType?: "inst" | "user" | "role";
1273
- subjectId?: string;
1274
- resourceId?: string;
1275
- expireTimeMs?: number;
1276
- resourceKind?: "inst";
1277
- action?: "create" | "read" | "update" | "delete" | "list" | "sendAction" | "updateData";
1278
- }>, z.ZodObject<{
1279
1389
  marker: z.ZodOptional<z.ZodString>;
1280
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1390
+ resourceKind: z.ZodLiteral<"inst">;
1391
+ action: z.ZodNullable<z.ZodEnum<{
1392
+ read: "read";
1393
+ create: "create";
1394
+ update: "update";
1395
+ delete: "delete";
1396
+ list: "list";
1397
+ sendAction: "sendAction";
1398
+ updateData: "updateData";
1399
+ }>>;
1400
+ }, z.core.$strip>, z.ZodObject<{
1401
+ subjectType: z.ZodEnum<{
1402
+ inst: "inst";
1403
+ user: "user";
1404
+ role: "role";
1405
+ }>;
1281
1406
  subjectId: z.ZodString;
1282
1407
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1283
1408
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1284
- resourceKind: z.ZodLiteral<"loom">;
1285
- action: z.ZodNullable<z.ZodEnum<["create"]>>;
1286
- }, "strip", z.ZodTypeAny, {
1287
- marker?: string;
1288
- subjectType?: "inst" | "user" | "role";
1289
- subjectId?: string;
1290
- resourceId?: string;
1291
- expireTimeMs?: number;
1292
- resourceKind?: "loom";
1293
- action?: "create";
1294
- }, {
1295
- marker?: string;
1296
- subjectType?: "inst" | "user" | "role";
1297
- subjectId?: string;
1298
- resourceId?: string;
1299
- expireTimeMs?: number;
1300
- resourceKind?: "loom";
1301
- action?: "create";
1302
- }>, z.ZodObject<{
1303
1409
  marker: z.ZodOptional<z.ZodString>;
1304
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1410
+ resourceKind: z.ZodLiteral<"loom">;
1411
+ action: z.ZodNullable<z.ZodEnum<{
1412
+ create: "create";
1413
+ }>>;
1414
+ }, z.core.$strip>, z.ZodObject<{
1415
+ subjectType: z.ZodEnum<{
1416
+ inst: "inst";
1417
+ user: "user";
1418
+ role: "role";
1419
+ }>;
1305
1420
  subjectId: z.ZodString;
1306
1421
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1307
1422
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1308
- resourceKind: z.ZodLiteral<"ai.sloyd">;
1309
- action: z.ZodNullable<z.ZodEnum<["create"]>>;
1310
- }, "strip", z.ZodTypeAny, {
1311
- marker?: string;
1312
- subjectType?: "inst" | "user" | "role";
1313
- subjectId?: string;
1314
- resourceId?: string;
1315
- expireTimeMs?: number;
1316
- resourceKind?: "ai.sloyd";
1317
- action?: "create";
1318
- }, {
1319
- marker?: string;
1320
- subjectType?: "inst" | "user" | "role";
1321
- subjectId?: string;
1322
- resourceId?: string;
1323
- expireTimeMs?: number;
1324
- resourceKind?: "ai.sloyd";
1325
- action?: "create";
1326
- }>, z.ZodObject<{
1327
1423
  marker: z.ZodOptional<z.ZodString>;
1328
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1424
+ resourceKind: z.ZodLiteral<"ai.sloyd">;
1425
+ action: z.ZodNullable<z.ZodEnum<{
1426
+ create: "create";
1427
+ }>>;
1428
+ }, z.core.$strip>, z.ZodObject<{
1429
+ subjectType: z.ZodEnum<{
1430
+ inst: "inst";
1431
+ user: "user";
1432
+ role: "role";
1433
+ }>;
1329
1434
  subjectId: z.ZodString;
1330
1435
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1331
1436
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1332
- resourceKind: z.ZodLiteral<"ai.hume">;
1333
- action: z.ZodNullable<z.ZodEnum<["create"]>>;
1334
- }, "strip", z.ZodTypeAny, {
1335
- marker?: string;
1336
- subjectType?: "inst" | "user" | "role";
1337
- subjectId?: string;
1338
- resourceId?: string;
1339
- expireTimeMs?: number;
1340
- resourceKind?: "ai.hume";
1341
- action?: "create";
1342
- }, {
1343
- marker?: string;
1344
- subjectType?: "inst" | "user" | "role";
1345
- subjectId?: string;
1346
- resourceId?: string;
1347
- expireTimeMs?: number;
1348
- resourceKind?: "ai.hume";
1349
- action?: "create";
1350
- }>, z.ZodObject<{
1351
1437
  marker: z.ZodOptional<z.ZodString>;
1352
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1438
+ resourceKind: z.ZodLiteral<"ai.hume">;
1439
+ action: z.ZodNullable<z.ZodEnum<{
1440
+ create: "create";
1441
+ }>>;
1442
+ }, z.core.$strip>, z.ZodObject<{
1443
+ subjectType: z.ZodEnum<{
1444
+ inst: "inst";
1445
+ user: "user";
1446
+ role: "role";
1447
+ }>;
1353
1448
  subjectId: z.ZodString;
1354
1449
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1355
1450
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1356
- resourceKind: z.ZodLiteral<"ai.openai.realtime">;
1357
- action: z.ZodNullable<z.ZodEnum<["create"]>>;
1358
- }, "strip", z.ZodTypeAny, {
1359
- marker?: string;
1360
- subjectType?: "inst" | "user" | "role";
1361
- subjectId?: string;
1362
- resourceId?: string;
1363
- expireTimeMs?: number;
1364
- resourceKind?: "ai.openai.realtime";
1365
- action?: "create";
1366
- }, {
1367
- marker?: string;
1368
- subjectType?: "inst" | "user" | "role";
1369
- subjectId?: string;
1370
- resourceId?: string;
1371
- expireTimeMs?: number;
1372
- resourceKind?: "ai.openai.realtime";
1373
- action?: "create";
1374
- }>, z.ZodObject<{
1375
1451
  marker: z.ZodOptional<z.ZodString>;
1376
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1452
+ resourceKind: z.ZodLiteral<"ai.openai.realtime">;
1453
+ action: z.ZodNullable<z.ZodEnum<{
1454
+ create: "create";
1455
+ }>>;
1456
+ }, z.core.$strip>, z.ZodObject<{
1457
+ subjectType: z.ZodEnum<{
1458
+ inst: "inst";
1459
+ user: "user";
1460
+ role: "role";
1461
+ }>;
1377
1462
  subjectId: z.ZodString;
1378
1463
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1379
1464
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1380
- resourceKind: z.ZodLiteral<"webhook">;
1381
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
1382
- }, "strip", z.ZodTypeAny, {
1383
- marker?: string;
1384
- subjectType?: "inst" | "user" | "role";
1385
- subjectId?: string;
1386
- resourceId?: string;
1387
- expireTimeMs?: number;
1388
- resourceKind?: "webhook";
1389
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
1390
- }, {
1391
- marker?: string;
1392
- subjectType?: "inst" | "user" | "role";
1393
- subjectId?: string;
1394
- resourceId?: string;
1395
- expireTimeMs?: number;
1396
- resourceKind?: "webhook";
1397
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
1398
- }>, z.ZodObject<{
1399
1465
  marker: z.ZodOptional<z.ZodString>;
1400
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1466
+ resourceKind: z.ZodLiteral<"webhook">;
1467
+ action: z.ZodNullable<z.ZodEnum<{
1468
+ run: "run";
1469
+ read: "read";
1470
+ create: "create";
1471
+ update: "update";
1472
+ delete: "delete";
1473
+ list: "list";
1474
+ }>>;
1475
+ }, z.core.$strip>, z.ZodObject<{
1476
+ subjectType: z.ZodEnum<{
1477
+ inst: "inst";
1478
+ user: "user";
1479
+ role: "role";
1480
+ }>;
1401
1481
  subjectId: z.ZodString;
1402
1482
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1403
1483
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1404
- resourceKind: z.ZodLiteral<"notification">;
1405
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "send", "subscribe", "unsubscribe", "listSubscriptions"]>>;
1406
- }, "strip", z.ZodTypeAny, {
1407
- marker?: string;
1408
- subjectType?: "inst" | "user" | "role";
1409
- subjectId?: string;
1410
- resourceId?: string;
1411
- expireTimeMs?: number;
1412
- resourceKind?: "notification";
1413
- action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
1414
- }, {
1415
- marker?: string;
1416
- subjectType?: "inst" | "user" | "role";
1417
- subjectId?: string;
1418
- resourceId?: string;
1419
- expireTimeMs?: number;
1420
- resourceKind?: "notification";
1421
- action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
1422
- }>, z.ZodObject<{
1423
1484
  marker: z.ZodOptional<z.ZodString>;
1424
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1485
+ resourceKind: z.ZodLiteral<"notification">;
1486
+ action: z.ZodNullable<z.ZodEnum<{
1487
+ read: "read";
1488
+ create: "create";
1489
+ update: "update";
1490
+ delete: "delete";
1491
+ list: "list";
1492
+ send: "send";
1493
+ subscribe: "subscribe";
1494
+ unsubscribe: "unsubscribe";
1495
+ listSubscriptions: "listSubscriptions";
1496
+ }>>;
1497
+ }, z.core.$strip>, z.ZodObject<{
1498
+ subjectType: z.ZodEnum<{
1499
+ inst: "inst";
1500
+ user: "user";
1501
+ role: "role";
1502
+ }>;
1425
1503
  subjectId: z.ZodString;
1426
1504
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1427
1505
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1428
- resourceKind: z.ZodLiteral<"package">;
1429
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
1430
- }, "strip", z.ZodTypeAny, {
1431
- marker?: string;
1432
- subjectType?: "inst" | "user" | "role";
1433
- subjectId?: string;
1434
- resourceId?: string;
1435
- expireTimeMs?: number;
1436
- resourceKind?: "package";
1437
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
1438
- }, {
1439
- marker?: string;
1440
- subjectType?: "inst" | "user" | "role";
1441
- subjectId?: string;
1442
- resourceId?: string;
1443
- expireTimeMs?: number;
1444
- resourceKind?: "package";
1445
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
1446
- }>, z.ZodObject<{
1447
1506
  marker: z.ZodOptional<z.ZodString>;
1448
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1507
+ resourceKind: z.ZodLiteral<"package">;
1508
+ action: z.ZodNullable<z.ZodEnum<{
1509
+ run: "run";
1510
+ read: "read";
1511
+ create: "create";
1512
+ update: "update";
1513
+ delete: "delete";
1514
+ list: "list";
1515
+ }>>;
1516
+ }, z.core.$strip>, z.ZodObject<{
1517
+ subjectType: z.ZodEnum<{
1518
+ inst: "inst";
1519
+ user: "user";
1520
+ role: "role";
1521
+ }>;
1449
1522
  subjectId: z.ZodString;
1450
1523
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1451
1524
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1452
- resourceKind: z.ZodLiteral<"package.version">;
1453
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
1454
- }, "strip", z.ZodTypeAny, {
1455
- marker?: string;
1456
- subjectType?: "inst" | "user" | "role";
1457
- subjectId?: string;
1458
- resourceId?: string;
1459
- expireTimeMs?: number;
1460
- resourceKind?: "package.version";
1461
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
1462
- }, {
1463
- marker?: string;
1464
- subjectType?: "inst" | "user" | "role";
1465
- subjectId?: string;
1466
- resourceId?: string;
1467
- expireTimeMs?: number;
1468
- resourceKind?: "package.version";
1469
- action?: "create" | "read" | "update" | "delete" | "list" | "run";
1470
- }>, z.ZodObject<{
1471
1525
  marker: z.ZodOptional<z.ZodString>;
1472
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1526
+ resourceKind: z.ZodLiteral<"package.version">;
1527
+ action: z.ZodNullable<z.ZodEnum<{
1528
+ run: "run";
1529
+ read: "read";
1530
+ create: "create";
1531
+ update: "update";
1532
+ delete: "delete";
1533
+ list: "list";
1534
+ }>>;
1535
+ }, z.core.$strip>, z.ZodObject<{
1536
+ subjectType: z.ZodEnum<{
1537
+ inst: "inst";
1538
+ user: "user";
1539
+ role: "role";
1540
+ }>;
1473
1541
  subjectId: z.ZodString;
1474
1542
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1475
1543
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1476
- resourceKind: z.ZodLiteral<"search">;
1477
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list"]>>;
1478
- }, "strip", z.ZodTypeAny, {
1479
- marker?: string;
1480
- subjectType?: "inst" | "user" | "role";
1481
- subjectId?: string;
1482
- resourceId?: string;
1483
- expireTimeMs?: number;
1484
- resourceKind?: "search";
1485
- action?: "create" | "read" | "update" | "delete" | "list";
1486
- }, {
1487
- marker?: string;
1488
- subjectType?: "inst" | "user" | "role";
1489
- subjectId?: string;
1490
- resourceId?: string;
1491
- expireTimeMs?: number;
1492
- resourceKind?: "search";
1493
- action?: "create" | "read" | "update" | "delete" | "list";
1494
- }>, z.ZodObject<{
1495
1544
  marker: z.ZodOptional<z.ZodString>;
1496
- subjectType: z.ZodEnum<["user", "inst", "role"]>;
1545
+ resourceKind: z.ZodLiteral<"search">;
1546
+ action: z.ZodNullable<z.ZodEnum<{
1547
+ read: "read";
1548
+ create: "create";
1549
+ update: "update";
1550
+ delete: "delete";
1551
+ list: "list";
1552
+ }>>;
1553
+ }, z.core.$strip>, z.ZodObject<{
1554
+ subjectType: z.ZodEnum<{
1555
+ inst: "inst";
1556
+ user: "user";
1557
+ role: "role";
1558
+ }>;
1497
1559
  subjectId: z.ZodString;
1498
1560
  resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1499
1561
  expireTimeMs: z.ZodNullable<z.ZodNumber>;
1562
+ marker: z.ZodOptional<z.ZodString>;
1500
1563
  resourceKind: z.ZodLiteral<"database">;
1501
- action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list"]>>;
1502
- }, "strip", z.ZodTypeAny, {
1503
- marker?: string;
1504
- subjectType?: "inst" | "user" | "role";
1505
- subjectId?: string;
1506
- resourceId?: string;
1507
- expireTimeMs?: number;
1508
- resourceKind?: "database";
1509
- action?: "create" | "read" | "update" | "delete" | "list";
1510
- }, {
1511
- marker?: string;
1512
- subjectType?: "inst" | "user" | "role";
1513
- subjectId?: string;
1514
- resourceId?: string;
1515
- expireTimeMs?: number;
1516
- resourceKind?: "database";
1517
- action?: "create" | "read" | "update" | "delete" | "list";
1518
- }>]>;
1564
+ action: z.ZodNullable<z.ZodEnum<{
1565
+ read: "read";
1566
+ create: "create";
1567
+ update: "update";
1568
+ delete: "delete";
1569
+ list: "list";
1570
+ }>>;
1571
+ }, z.core.$strip>, z.ZodObject<{
1572
+ subjectType: z.ZodEnum<{
1573
+ inst: "inst";
1574
+ user: "user";
1575
+ role: "role";
1576
+ }>;
1577
+ subjectId: z.ZodString;
1578
+ resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1579
+ expireTimeMs: z.ZodNullable<z.ZodNumber>;
1580
+ marker: z.ZodOptional<z.ZodString>;
1581
+ resourceKind: z.ZodLiteral<"purchasableItem">;
1582
+ action: z.ZodNullable<z.ZodEnum<{
1583
+ read: "read";
1584
+ create: "create";
1585
+ update: "update";
1586
+ delete: "delete";
1587
+ list: "list";
1588
+ purchase: "purchase";
1589
+ }>>;
1590
+ }, z.core.$strip>, z.ZodObject<{
1591
+ subjectType: z.ZodEnum<{
1592
+ inst: "inst";
1593
+ user: "user";
1594
+ role: "role";
1595
+ }>;
1596
+ subjectId: z.ZodString;
1597
+ resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1598
+ expireTimeMs: z.ZodNullable<z.ZodNumber>;
1599
+ marker: z.ZodOptional<z.ZodString>;
1600
+ resourceKind: z.ZodLiteral<"contract">;
1601
+ action: z.ZodNullable<z.ZodEnum<{
1602
+ read: "read";
1603
+ create: "create";
1604
+ update: "update";
1605
+ delete: "delete";
1606
+ list: "list";
1607
+ purchase: "purchase";
1608
+ cancel: "cancel";
1609
+ }>>;
1610
+ }, z.core.$strip>, z.ZodObject<{
1611
+ subjectType: z.ZodEnum<{
1612
+ inst: "inst";
1613
+ user: "user";
1614
+ role: "role";
1615
+ }>;
1616
+ subjectId: z.ZodString;
1617
+ resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1618
+ expireTimeMs: z.ZodNullable<z.ZodNumber>;
1619
+ marker: z.ZodOptional<z.ZodString>;
1620
+ resourceKind: z.ZodLiteral<"invoice">;
1621
+ action: z.ZodNullable<z.ZodEnum<{
1622
+ read: "read";
1623
+ create: "create";
1624
+ update: "update";
1625
+ delete: "delete";
1626
+ list: "list";
1627
+ approve: "approve";
1628
+ cancel: "cancel";
1629
+ }>>;
1630
+ }, z.core.$strip>], "resourceKind">;
1519
1631
  export type PermissionOptions = FilePermissionOptions | RolePermissionOptions;
1520
1632
  /**
1521
1633
  * The name of the admin role.