@casual-simulation/aux-common 3.4.6-alpha.14668890889 → 3.5.0-alpha.15119114602
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/AAGUID.d.ts +11 -0
- package/AAGUID.js +116 -0
- package/AAGUID.js.map +1 -0
- package/BlobPolyfill.js +20 -31
- package/BlobPolyfill.js.map +1 -1
- package/bots/AuxStateHelpers.js +9 -3
- package/bots/AuxStateHelpers.js.map +1 -1
- package/bots/Bot.d.ts +1 -1
- package/bots/Bot.js +10 -1
- package/bots/Bot.js.map +1 -1
- package/bots/BotCalculationContext.js.map +1 -1
- package/bots/BotCalculations.d.ts +3 -3
- package/bots/BotCalculations.js +5 -1
- package/bots/BotCalculations.js.map +1 -1
- package/bots/BotEvents.d.ts +20 -2
- package/bots/BotEvents.js +84 -17
- package/bots/BotEvents.js.map +1 -1
- package/bots/StateUpdatedEvent.js.map +1 -1
- package/bots/StoredAux.d.ts +1 -1
- package/bots/StoredAux.js.map +1 -1
- package/bots/test/BotCalculationContextTests.d.ts +0 -1
- package/bots/test/BotCalculationContextTests.js.map +1 -1
- package/common/PolicyPermissions.d.ts +224 -3
- package/common/PolicyPermissions.js +46 -0
- package/common/PolicyPermissions.js.map +1 -1
- package/common/RemoteActions.js +19 -6
- package/common/RemoteActions.js.map +1 -1
- package/common/StatusUpdateUtils.js +4 -1
- package/common/StatusUpdateUtils.js.map +1 -1
- package/common/Version.d.ts +22 -0
- package/common/Version.js +75 -0
- package/common/Version.js.map +1 -0
- package/common/WebConfig.d.ts +6 -6
- package/common/index.d.ts +1 -0
- package/common/index.js +1 -0
- package/common/index.js.map +1 -1
- package/documents/RemoteYjsSharedDocument.js +30 -54
- package/documents/RemoteYjsSharedDocument.js.map +1 -1
- package/documents/SharedDocumentFactories.js +7 -18
- package/documents/SharedDocumentFactories.js.map +1 -1
- package/documents/YjsSharedDocument.js +1 -12
- package/documents/YjsSharedDocument.js.map +1 -1
- package/documents/test/DocumentTests.js +15 -24
- package/documents/test/DocumentTests.js.map +1 -1
- package/forms/FormError.d.ts +43 -0
- package/forms/FormError.js +56 -0
- package/forms/FormError.js.map +1 -0
- package/forms/index.d.ts +2 -0
- package/forms/index.js +19 -0
- package/forms/index.js.map +1 -0
- package/http/GenericHttpInterface.d.ts +2 -1
- package/http/GenericHttpInterface.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +7 -7
- package/partitions/AuxPartition.js +5 -1
- package/partitions/AuxPartition.js.map +1 -1
- package/partitions/AuxPartitionFactories.js +7 -18
- package/partitions/AuxPartitionFactories.js.map +1 -1
- package/partitions/MemoryPartition.js +24 -40
- package/partitions/MemoryPartition.js.map +1 -1
- package/partitions/OtherPlayersPartition.js +140 -159
- package/partitions/OtherPlayersPartition.js.map +1 -1
- package/partitions/PartitionAuthSource.d.ts +4 -0
- package/partitions/PartitionUtils.js +1 -1
- package/partitions/PartitionUtils.js.map +1 -1
- package/partitions/ProxyBridgePartition.js +32 -47
- package/partitions/ProxyBridgePartition.js.map +1 -1
- package/partitions/RemoteYjsPartition.js +235 -221
- package/partitions/RemoteYjsPartition.js.map +1 -1
- package/partitions/YjsPartition.js +215 -205
- package/partitions/YjsPartition.js.map +1 -1
- package/records/AuthUtils.d.ts +175 -0
- package/records/AuthUtils.js +335 -0
- package/records/AuthUtils.js.map +1 -0
- package/records/RecordKeys.d.ts +52 -0
- package/records/RecordKeys.js +131 -0
- package/records/RecordKeys.js.map +1 -0
- package/records/WebPush.d.ts +2 -0
- package/records/WebPush.js +19 -0
- package/records/WebPush.js.map +1 -0
- package/records/index.d.ts +4 -0
- package/records/index.js +21 -0
- package/records/index.js.map +1 -0
- package/rpc/ErrorCodes.d.ts +2 -2
- package/rpc/ErrorCodes.js.map +1 -1
- package/rpc/GenericRPCInterface.js +8 -4
- package/rpc/GenericRPCInterface.js.map +1 -1
- package/test/TestHelpers.js +2 -13
- package/test/TestHelpers.js.map +1 -1
- package/utils.d.ts +14 -0
- package/utils.js +18 -0
- package/utils.js.map +1 -1
- package/websockets/AuthenticatedConnectionClient.js +39 -10
- package/websockets/AuthenticatedConnectionClient.js.map +1 -1
- package/websockets/InstRecordsClient.js +18 -8
- package/websockets/InstRecordsClient.js.map +1 -1
- package/websockets/MemoryConnectionClient.d.ts +1 -1
- package/websockets/Utils.d.ts +33 -0
- package/websockets/Utils.js +82 -0
- package/websockets/Utils.js.map +1 -0
- package/websockets/WebsocketEvents.d.ts +18 -17
- package/websockets/WebsocketEvents.js.map +1 -1
- package/websockets/index.d.ts +1 -0
- package/websockets/index.js +1 -0
- package/websockets/index.js.map +1 -1
- package/yjs/YjsHelpers.js.map +1 -1
- package/yjs/YjsIndexedDBPersistence.js +53 -78
- package/yjs/YjsIndexedDBPersistence.js.map +1 -1
|
@@ -25,13 +25,15 @@ export declare const HUME_RESOURCE_KIND = "ai.hume";
|
|
|
25
25
|
export declare const OPENAI_REALTIME_RESOURCE_KIND = "ai.openai.realtime";
|
|
26
26
|
export declare const WEBHOOK_RESOURCE_KIND = "webhook";
|
|
27
27
|
export declare const NOTIFICATION_RESOURCE_KIND = "notification";
|
|
28
|
+
export declare const PACKAGE_RESOURCE_KIND = "package";
|
|
29
|
+
export declare const PACKAGE_VERSION_RESOURCE_KIND = "package.version";
|
|
28
30
|
/**
|
|
29
31
|
* The possible types of resources that can be affected by permissions.
|
|
30
32
|
*
|
|
31
33
|
* @dochash types/permissions
|
|
32
34
|
* @docname ResourceKinds
|
|
33
35
|
*/
|
|
34
|
-
export type ResourceKinds = 'data' | 'file' | 'event' | 'marker' | 'role' | 'inst' | 'webhook' | 'notification' | 'loom' | 'ai.sloyd' | 'ai.hume' | 'ai.openai.realtime';
|
|
36
|
+
export type ResourceKinds = 'data' | 'file' | 'event' | 'marker' | 'role' | 'inst' | 'webhook' | 'notification' | 'package' | 'package.version' | 'loom' | 'ai.sloyd' | 'ai.hume' | 'ai.openai.realtime';
|
|
35
37
|
export declare const READ_ACTION = "read";
|
|
36
38
|
export declare const CREATE_ACTION = "create";
|
|
37
39
|
export declare const UPDATE_ACTION = "update";
|
|
@@ -143,6 +145,20 @@ export type WebhookActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list
|
|
|
143
145
|
* @docname NotificationActionKinds
|
|
144
146
|
*/
|
|
145
147
|
export type NotificationActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list' | 'send' | 'subscribe' | 'unsubscribe' | 'listSubscriptions';
|
|
148
|
+
/**
|
|
149
|
+
* The possible types of actions that can be performed on package resources.
|
|
150
|
+
*
|
|
151
|
+
* @dochash types/permissions
|
|
152
|
+
* @docname PackageActionKinds
|
|
153
|
+
*/
|
|
154
|
+
export type PackageActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list' | 'run';
|
|
155
|
+
/**
|
|
156
|
+
* The possible types of actions that can be performed on package.version resources.
|
|
157
|
+
*
|
|
158
|
+
* @dochash types/permissions
|
|
159
|
+
* @docname PackageVersionActionKinds
|
|
160
|
+
*/
|
|
161
|
+
export type PackageVersionActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list' | 'run';
|
|
146
162
|
/**
|
|
147
163
|
* The possible types of permissions that can be added to policies.
|
|
148
164
|
*
|
|
@@ -152,7 +168,7 @@ export type NotificationActionKinds = 'create' | 'read' | 'update' | 'delete' |
|
|
|
152
168
|
* @docdescription Types that represent permissions that control access to resources.
|
|
153
169
|
* @docname AvailablePermissions
|
|
154
170
|
*/
|
|
155
|
-
export type AvailablePermissions = DataPermission | FilePermission | EventPermission | MarkerPermission | RolePermission | InstPermission | LoomPermission | SloydPermission | HumePermission | OpenAIRealtimePermission | WebhookPermission | NotificationPermission;
|
|
171
|
+
export type AvailablePermissions = DataPermission | FilePermission | EventPermission | MarkerPermission | RolePermission | InstPermission | LoomPermission | SloydPermission | HumePermission | OpenAIRealtimePermission | WebhookPermission | NotificationPermission | PackagePermission | PackageVersionPermission;
|
|
156
172
|
export declare const SUBJECT_TYPE_VALIDATION: z.ZodEnum<["user", "inst", "role"]>;
|
|
157
173
|
export declare const DATA_ACTION_KINDS_VALIDATION: z.ZodEnum<["read", "create", "update", "delete", "list"]>;
|
|
158
174
|
export declare const FILE_ACTION_KINDS_VALIDATION: z.ZodEnum<["read", "create", "update", "delete", "list"]>;
|
|
@@ -166,8 +182,81 @@ export declare const HUME_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
|
|
|
166
182
|
export declare const OPENAI_REALTIME_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
|
|
167
183
|
export declare const WEBHOOK_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
|
|
168
184
|
export declare const NOTIFICATION_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "send", "subscribe", "unsubscribe", "listSubscriptions"]>;
|
|
169
|
-
export declare const
|
|
185
|
+
export declare const PACKAGE_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
|
|
186
|
+
export declare const PACKAGE_VERSION_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
|
|
187
|
+
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"]>;
|
|
170
188
|
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"]>;
|
|
189
|
+
/**
|
|
190
|
+
* The scopes that can be used for requested entitlements.
|
|
191
|
+
* This can be used to limit the entitlement to requesting a category of resources.
|
|
192
|
+
* For example, the "personal" scope would limit the entitlement to requesting access to the user's personal resources.
|
|
193
|
+
*
|
|
194
|
+
* - "personal" - The entitlement is for personal (user-specific) records. This would allow the package to request access to resources in the user's player record. Once granted, the package would have access to the user's personal record.
|
|
195
|
+
* - "owned" - The entitlement is for user (user-owned) records. This would allow the package to request access to resources in a record that the user owns. Once granted, the package would have access to the user's owned records.
|
|
196
|
+
* - "studio" - The entitlement is for studio records. This would allow the package to request access to resources in studios in which the user is an admin or member of.
|
|
197
|
+
* - "shared" - The entitlement is for shared records. This would allow the package to request access to records that are either owned or granted to the user.
|
|
198
|
+
* - "designated" - The entitlement is for specific records. This would allow the package to only request access to specific records.
|
|
199
|
+
*/
|
|
200
|
+
export type EntitlementScope = 'personal' | 'owned' | 'studio' | 'shared' | 'designated';
|
|
201
|
+
/**
|
|
202
|
+
* The scopes that can be granted for entitlements.
|
|
203
|
+
* Compared to the requested entitlement scopes, the granted entitlement scopes are more restrictive.
|
|
204
|
+
*
|
|
205
|
+
* This ultimately means that while a package can have the ability to request access to a bunch of different records,
|
|
206
|
+
* they can only be granted access to a single record at once (for now).
|
|
207
|
+
*
|
|
208
|
+
* - "designated" - The entitlement is for specific records. This would allow the package to access specific records.
|
|
209
|
+
*/
|
|
210
|
+
export type GrantedEntitlementScope = 'designated';
|
|
211
|
+
/**
|
|
212
|
+
* The feature categories that entitlements support.
|
|
213
|
+
* Generally, features align with resource kinds, but don't have to.
|
|
214
|
+
*/
|
|
215
|
+
export type EntitlementFeature = 'data' | 'file' | 'event' | 'inst' | 'notification' | 'package' | 'permissions' | 'webhook' | 'ai';
|
|
216
|
+
/**
|
|
217
|
+
* Defines an interface that represents an entitlement.
|
|
218
|
+
* That is, a feature that can be granted to a package but still requires user approval.
|
|
219
|
+
*
|
|
220
|
+
* In essence, this allows a package to ask the user for permission for a category of permissions.
|
|
221
|
+
*/
|
|
222
|
+
export interface Entitlement {
|
|
223
|
+
/**
|
|
224
|
+
* The feature category that the entitlement is for.
|
|
225
|
+
* Generally, features align with resource kinds, but don't have to.
|
|
226
|
+
*/
|
|
227
|
+
feature: EntitlementFeature;
|
|
228
|
+
/**
|
|
229
|
+
* The scope of the entitlement.
|
|
230
|
+
* This can be used to limit the entitlement to a category of resources.
|
|
231
|
+
* For example, the "personal" scope would limit the entitlement to requesting access to the user's personal resources.
|
|
232
|
+
*
|
|
233
|
+
*
|
|
234
|
+
* - "personal" - The entitlement is for personal (user-specific) records. This would allow the package to request access to resources in the user's player record.
|
|
235
|
+
* - "owned" - The entitlement is for user (user-owned) records. This would allow the package to request access to resources in a record that the user owns.
|
|
236
|
+
* - "studio" - The entitlement is for studio records. This would allow the package to request access to resources in studios in which the user is an admin or member of.
|
|
237
|
+
* - "shared" - The entitlement is for shared records. This would allow the package to request access to records that are either owned or granted to the user.
|
|
238
|
+
* - "designated" - The entitlement is for specific records. This would allow the package to only request access to specific records.
|
|
239
|
+
*/
|
|
240
|
+
scope: EntitlementScope;
|
|
241
|
+
/**
|
|
242
|
+
* The list of records that the entitlement is for.
|
|
243
|
+
*/
|
|
244
|
+
designatedRecords?: string[];
|
|
245
|
+
}
|
|
246
|
+
export declare const ENTITLEMENT_FEATURE_VALIDATION: z.ZodEnum<["data", "file", "event", "inst", "notification", "package", "permissions", "webhook", "ai"]>;
|
|
247
|
+
export declare const ENTITLEMENT_VALIDATION: z.ZodObject<{
|
|
248
|
+
feature: z.ZodEnum<["data", "file", "event", "inst", "notification", "package", "permissions", "webhook", "ai"]>;
|
|
249
|
+
scope: z.ZodEnum<["personal", "owned", "studio", "shared", "designated"]>;
|
|
250
|
+
designatedRecords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
feature?: "inst" | "data" | "event" | "file" | "webhook" | "notification" | "package" | "permissions" | "ai";
|
|
253
|
+
scope?: "shared" | "personal" | "owned" | "studio" | "designated";
|
|
254
|
+
designatedRecords?: string[];
|
|
255
|
+
}, {
|
|
256
|
+
feature?: "inst" | "data" | "event" | "file" | "webhook" | "notification" | "package" | "permissions" | "ai";
|
|
257
|
+
scope?: "shared" | "personal" | "owned" | "studio" | "designated";
|
|
258
|
+
designatedRecords?: string[];
|
|
259
|
+
}>;
|
|
171
260
|
/**
|
|
172
261
|
* Defines an interface that describes common options for all permissions.
|
|
173
262
|
*/
|
|
@@ -825,6 +914,90 @@ export declare const NOTIFICATION_PERMISSION_VALIDATION: z.ZodObject<{
|
|
|
825
914
|
resourceKind?: "notification";
|
|
826
915
|
action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
|
|
827
916
|
}>;
|
|
917
|
+
/**
|
|
918
|
+
* Defines an interface that describes common options for all permissions that affect package resources.
|
|
919
|
+
*
|
|
920
|
+
* @dochash types/permissions
|
|
921
|
+
* @docname PackagePermission
|
|
922
|
+
*/
|
|
923
|
+
export interface PackagePermission extends Permission {
|
|
924
|
+
/**
|
|
925
|
+
* The kind of the permission.
|
|
926
|
+
*/
|
|
927
|
+
resourceKind: 'package';
|
|
928
|
+
/**
|
|
929
|
+
* The action that is allowed.
|
|
930
|
+
* If null, then all actions are allowed.
|
|
931
|
+
*/
|
|
932
|
+
action: PackageActionKinds | null;
|
|
933
|
+
}
|
|
934
|
+
export declare const PACKAGE_PERMISSION_VALIDATION: z.ZodObject<{
|
|
935
|
+
marker: z.ZodOptional<z.ZodString>;
|
|
936
|
+
subjectType: z.ZodEnum<["user", "inst", "role"]>;
|
|
937
|
+
subjectId: z.ZodString;
|
|
938
|
+
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
939
|
+
expireTimeMs: z.ZodNullable<z.ZodNumber>;
|
|
940
|
+
resourceKind: z.ZodLiteral<"package">;
|
|
941
|
+
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
|
|
942
|
+
}, "strip", z.ZodTypeAny, {
|
|
943
|
+
marker?: string;
|
|
944
|
+
subjectType?: "inst" | "user" | "role";
|
|
945
|
+
subjectId?: string;
|
|
946
|
+
resourceId?: string;
|
|
947
|
+
expireTimeMs?: number;
|
|
948
|
+
resourceKind?: "package";
|
|
949
|
+
action?: "create" | "read" | "update" | "delete" | "list" | "run";
|
|
950
|
+
}, {
|
|
951
|
+
marker?: string;
|
|
952
|
+
subjectType?: "inst" | "user" | "role";
|
|
953
|
+
subjectId?: string;
|
|
954
|
+
resourceId?: string;
|
|
955
|
+
expireTimeMs?: number;
|
|
956
|
+
resourceKind?: "package";
|
|
957
|
+
action?: "create" | "read" | "update" | "delete" | "list" | "run";
|
|
958
|
+
}>;
|
|
959
|
+
/**
|
|
960
|
+
* Defines an interface that describes common options for all permissions that affect package.version resources.
|
|
961
|
+
*
|
|
962
|
+
* @dochash types/permissions
|
|
963
|
+
* @docname PackageVersionPermission
|
|
964
|
+
*/
|
|
965
|
+
export interface PackageVersionPermission extends Permission {
|
|
966
|
+
/**
|
|
967
|
+
* The kind of the permission.
|
|
968
|
+
*/
|
|
969
|
+
resourceKind: 'package.version';
|
|
970
|
+
/**
|
|
971
|
+
* The action that is allowed.
|
|
972
|
+
* If null, then all actions are allowed.
|
|
973
|
+
*/
|
|
974
|
+
action: PackageVersionActionKinds | null;
|
|
975
|
+
}
|
|
976
|
+
export declare const PACKAGE_VERSION_PERMISSION_VALIDATION: z.ZodObject<{
|
|
977
|
+
marker: z.ZodOptional<z.ZodString>;
|
|
978
|
+
subjectType: z.ZodEnum<["user", "inst", "role"]>;
|
|
979
|
+
subjectId: z.ZodString;
|
|
980
|
+
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
981
|
+
expireTimeMs: z.ZodNullable<z.ZodNumber>;
|
|
982
|
+
resourceKind: z.ZodLiteral<"package.version">;
|
|
983
|
+
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
|
|
984
|
+
}, "strip", z.ZodTypeAny, {
|
|
985
|
+
marker?: string;
|
|
986
|
+
subjectType?: "inst" | "user" | "role";
|
|
987
|
+
subjectId?: string;
|
|
988
|
+
resourceId?: string;
|
|
989
|
+
expireTimeMs?: number;
|
|
990
|
+
resourceKind?: "package.version";
|
|
991
|
+
action?: "create" | "read" | "update" | "delete" | "list" | "run";
|
|
992
|
+
}, {
|
|
993
|
+
marker?: string;
|
|
994
|
+
subjectType?: "inst" | "user" | "role";
|
|
995
|
+
subjectId?: string;
|
|
996
|
+
resourceId?: string;
|
|
997
|
+
expireTimeMs?: number;
|
|
998
|
+
resourceKind?: "package.version";
|
|
999
|
+
action?: "create" | "read" | "update" | "delete" | "list" | "run";
|
|
1000
|
+
}>;
|
|
828
1001
|
export declare const AVAILABLE_PERMISSIONS_VALIDATION: z.ZodDiscriminatedUnion<"resourceKind", [z.ZodObject<{
|
|
829
1002
|
marker: z.ZodOptional<z.ZodString>;
|
|
830
1003
|
subjectType: z.ZodEnum<["user", "inst", "role"]>;
|
|
@@ -1144,6 +1317,54 @@ export declare const AVAILABLE_PERMISSIONS_VALIDATION: z.ZodDiscriminatedUnion<"
|
|
|
1144
1317
|
expireTimeMs?: number;
|
|
1145
1318
|
resourceKind?: "notification";
|
|
1146
1319
|
action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
|
|
1320
|
+
}>, z.ZodObject<{
|
|
1321
|
+
marker: z.ZodOptional<z.ZodString>;
|
|
1322
|
+
subjectType: z.ZodEnum<["user", "inst", "role"]>;
|
|
1323
|
+
subjectId: z.ZodString;
|
|
1324
|
+
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1325
|
+
expireTimeMs: z.ZodNullable<z.ZodNumber>;
|
|
1326
|
+
resourceKind: z.ZodLiteral<"package">;
|
|
1327
|
+
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
|
|
1328
|
+
}, "strip", z.ZodTypeAny, {
|
|
1329
|
+
marker?: string;
|
|
1330
|
+
subjectType?: "inst" | "user" | "role";
|
|
1331
|
+
subjectId?: string;
|
|
1332
|
+
resourceId?: string;
|
|
1333
|
+
expireTimeMs?: number;
|
|
1334
|
+
resourceKind?: "package";
|
|
1335
|
+
action?: "create" | "read" | "update" | "delete" | "list" | "run";
|
|
1336
|
+
}, {
|
|
1337
|
+
marker?: string;
|
|
1338
|
+
subjectType?: "inst" | "user" | "role";
|
|
1339
|
+
subjectId?: string;
|
|
1340
|
+
resourceId?: string;
|
|
1341
|
+
expireTimeMs?: number;
|
|
1342
|
+
resourceKind?: "package";
|
|
1343
|
+
action?: "create" | "read" | "update" | "delete" | "list" | "run";
|
|
1344
|
+
}>, z.ZodObject<{
|
|
1345
|
+
marker: z.ZodOptional<z.ZodString>;
|
|
1346
|
+
subjectType: z.ZodEnum<["user", "inst", "role"]>;
|
|
1347
|
+
subjectId: z.ZodString;
|
|
1348
|
+
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1349
|
+
expireTimeMs: z.ZodNullable<z.ZodNumber>;
|
|
1350
|
+
resourceKind: z.ZodLiteral<"package.version">;
|
|
1351
|
+
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
|
|
1352
|
+
}, "strip", z.ZodTypeAny, {
|
|
1353
|
+
marker?: string;
|
|
1354
|
+
subjectType?: "inst" | "user" | "role";
|
|
1355
|
+
subjectId?: string;
|
|
1356
|
+
resourceId?: string;
|
|
1357
|
+
expireTimeMs?: number;
|
|
1358
|
+
resourceKind?: "package.version";
|
|
1359
|
+
action?: "create" | "read" | "update" | "delete" | "list" | "run";
|
|
1360
|
+
}, {
|
|
1361
|
+
marker?: string;
|
|
1362
|
+
subjectType?: "inst" | "user" | "role";
|
|
1363
|
+
subjectId?: string;
|
|
1364
|
+
resourceId?: string;
|
|
1365
|
+
expireTimeMs?: number;
|
|
1366
|
+
resourceKind?: "package.version";
|
|
1367
|
+
action?: "create" | "read" | "update" | "delete" | "list" | "run";
|
|
1147
1368
|
}>]>;
|
|
1148
1369
|
export type PermissionOptions = FilePermissionOptions | RolePermissionOptions;
|
|
1149
1370
|
/**
|
|
@@ -28,6 +28,8 @@ export const HUME_RESOURCE_KIND = 'ai.hume';
|
|
|
28
28
|
export const OPENAI_REALTIME_RESOURCE_KIND = 'ai.openai.realtime';
|
|
29
29
|
export const WEBHOOK_RESOURCE_KIND = 'webhook';
|
|
30
30
|
export const NOTIFICATION_RESOURCE_KIND = 'notification';
|
|
31
|
+
export const PACKAGE_RESOURCE_KIND = 'package';
|
|
32
|
+
export const PACKAGE_VERSION_RESOURCE_KIND = 'package.version';
|
|
31
33
|
export const READ_ACTION = 'read';
|
|
32
34
|
export const CREATE_ACTION = 'create';
|
|
33
35
|
export const UPDATE_ACTION = 'update';
|
|
@@ -115,6 +117,22 @@ export const NOTIFICATION_ACTION_KINDS_VALIDATION = z.enum([
|
|
|
115
117
|
UNSUBSCRIBE_ACTION,
|
|
116
118
|
LIST_SUBSCRIPTIONS_ACTION,
|
|
117
119
|
]);
|
|
120
|
+
export const PACKAGE_ACTION_KINDS_VALIDATION = z.enum([
|
|
121
|
+
CREATE_ACTION,
|
|
122
|
+
READ_ACTION,
|
|
123
|
+
UPDATE_ACTION,
|
|
124
|
+
DELETE_ACTION,
|
|
125
|
+
LIST_ACTION,
|
|
126
|
+
RUN_ACTION,
|
|
127
|
+
]);
|
|
128
|
+
export const PACKAGE_VERSION_ACTION_KINDS_VALIDATION = z.enum([
|
|
129
|
+
CREATE_ACTION,
|
|
130
|
+
READ_ACTION,
|
|
131
|
+
UPDATE_ACTION,
|
|
132
|
+
DELETE_ACTION,
|
|
133
|
+
LIST_ACTION,
|
|
134
|
+
RUN_ACTION,
|
|
135
|
+
]);
|
|
118
136
|
export const RESOURCE_KIND_VALIDATION = z.enum([
|
|
119
137
|
DATA_RESOURCE_KIND,
|
|
120
138
|
FILE_RESOURCE_KIND,
|
|
@@ -128,6 +146,8 @@ export const RESOURCE_KIND_VALIDATION = z.enum([
|
|
|
128
146
|
OPENAI_REALTIME_RESOURCE_KIND,
|
|
129
147
|
WEBHOOK_RESOURCE_KIND,
|
|
130
148
|
NOTIFICATION_RESOURCE_KIND,
|
|
149
|
+
PACKAGE_RESOURCE_KIND,
|
|
150
|
+
PACKAGE_VERSION_RESOURCE_KIND,
|
|
131
151
|
]);
|
|
132
152
|
export const ACTION_KINDS_VALIDATION = z.enum([
|
|
133
153
|
CREATE_ACTION,
|
|
@@ -151,6 +171,22 @@ export const ACTION_KINDS_VALIDATION = z.enum([
|
|
|
151
171
|
UNSUBSCRIBE_ACTION,
|
|
152
172
|
LIST_SUBSCRIPTIONS_ACTION,
|
|
153
173
|
]);
|
|
174
|
+
export const ENTITLEMENT_FEATURE_VALIDATION = z.enum([
|
|
175
|
+
'data',
|
|
176
|
+
'file',
|
|
177
|
+
'event',
|
|
178
|
+
'inst',
|
|
179
|
+
'notification',
|
|
180
|
+
'package',
|
|
181
|
+
'permissions',
|
|
182
|
+
'webhook',
|
|
183
|
+
'ai',
|
|
184
|
+
]);
|
|
185
|
+
export const ENTITLEMENT_VALIDATION = z.object({
|
|
186
|
+
feature: ENTITLEMENT_FEATURE_VALIDATION,
|
|
187
|
+
scope: z.enum(['personal', 'owned', 'studio', 'shared', 'designated']),
|
|
188
|
+
designatedRecords: z.array(z.string()).optional(),
|
|
189
|
+
});
|
|
154
190
|
export const PERMISSION_VALIDATION = z.object({
|
|
155
191
|
subjectType: SUBJECT_TYPE_VALIDATION,
|
|
156
192
|
subjectId: z.string().min(1),
|
|
@@ -218,6 +254,14 @@ export const NOTIFICATION_PERMISSION_VALIDATION = PERMISSION_VALIDATION.extend({
|
|
|
218
254
|
resourceKind: z.literal(NOTIFICATION_RESOURCE_KIND),
|
|
219
255
|
action: NOTIFICATION_ACTION_KINDS_VALIDATION.nullable(),
|
|
220
256
|
});
|
|
257
|
+
export const PACKAGE_PERMISSION_VALIDATION = PERMISSION_VALIDATION.extend({
|
|
258
|
+
resourceKind: z.literal(PACKAGE_RESOURCE_KIND),
|
|
259
|
+
action: PACKAGE_ACTION_KINDS_VALIDATION.nullable(),
|
|
260
|
+
});
|
|
261
|
+
export const PACKAGE_VERSION_PERMISSION_VALIDATION = PERMISSION_VALIDATION.extend({
|
|
262
|
+
resourceKind: z.literal(PACKAGE_VERSION_RESOURCE_KIND),
|
|
263
|
+
action: PACKAGE_VERSION_ACTION_KINDS_VALIDATION.nullable(),
|
|
264
|
+
});
|
|
221
265
|
export const AVAILABLE_PERMISSIONS_VALIDATION = z.discriminatedUnion('resourceKind', [
|
|
222
266
|
DATA_PERMISSION_VALIDATION,
|
|
223
267
|
FILE_PERMISSION_VALIDATION,
|
|
@@ -231,6 +275,8 @@ export const AVAILABLE_PERMISSIONS_VALIDATION = z.discriminatedUnion('resourceKi
|
|
|
231
275
|
OPENAI_REALTIME_PERMISSION_VALIDATION,
|
|
232
276
|
WEBHOOK_PERMISSION_VALIDATION,
|
|
233
277
|
NOTIFICATION_PERMISSION_VALIDATION,
|
|
278
|
+
PACKAGE_PERMISSION_VALIDATION,
|
|
279
|
+
PACKAGE_VERSION_PERMISSION_VALIDATION,
|
|
234
280
|
]);
|
|
235
281
|
// /**
|
|
236
282
|
// * Defines an interface that represents a policy document.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyPermissions.js","sourceRoot":"","sources":["PolicyPermissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAC9C,MAAM,CAAC,MAA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AO,CAAC,qBAAqB,CAAC;IAC9C,MAAM,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC;AAyBH,MAAM,CAAC,MAAM,qCAAqC,GAC9C,qBAAqB,CAAC,MAAM,CAAC;IACzB,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,6BAA6B,CAAC;IACtD,MAAM,EAAE,uCAAuC,CAAC,QAAQ,EAAE;CAC7D,CAAC,CAAC;AASP,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,kBAAkB,CAChE,cAAc,EACd;IACI,0BAA0B;IAC1B,0BAA0B;IAC1B,2BAA2B;IAC3B,4BAA4B;IAC5B,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,2BAA2B;IAC3B,0BAA0B;IAC1B,qCAAqC;IACrC,6BAA6B;IAC7B,kCAAkC;IAClC,6BAA6B;IAC7B,qCAAqC;CACxC,CACJ,CAAC;AAIF,MAAM;AACN,6DAA6D;AAC7D,wEAAwE;AACxE,MAAM;AACN,oCAAoC;AACpC,UAAU;AACV,2EAA2E;AAC3E,UAAU;AACV,2CAA2C;AAC3C,IAAI;AAEJ;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC"}
|
package/common/RemoteActions.js
CHANGED
|
@@ -60,8 +60,13 @@ export const deviceActionsSchema = z.discriminatedUnion('type', [
|
|
|
60
60
|
* @param taskId The ID of the task that this remote action represents.
|
|
61
61
|
*/
|
|
62
62
|
export function remote(event, selector, allowBatching, taskId) {
|
|
63
|
-
return
|
|
64
|
-
|
|
63
|
+
return {
|
|
64
|
+
type: 'remote',
|
|
65
|
+
event: event,
|
|
66
|
+
allowBatching,
|
|
67
|
+
taskId,
|
|
68
|
+
...selector,
|
|
69
|
+
};
|
|
65
70
|
}
|
|
66
71
|
/**
|
|
67
72
|
* Creates a new remote event that represents a result to an async task.
|
|
@@ -70,8 +75,12 @@ export function remote(event, selector, allowBatching, taskId) {
|
|
|
70
75
|
* @param taskId The ID of the task that this remote action represents.
|
|
71
76
|
*/
|
|
72
77
|
export function remoteResult(result, selector, taskId) {
|
|
73
|
-
return
|
|
74
|
-
|
|
78
|
+
return {
|
|
79
|
+
type: 'remote_result',
|
|
80
|
+
result,
|
|
81
|
+
taskId,
|
|
82
|
+
...selector,
|
|
83
|
+
};
|
|
75
84
|
}
|
|
76
85
|
/**
|
|
77
86
|
* Creates a new remote event that represents an error result to an async task.
|
|
@@ -80,8 +89,12 @@ export function remoteResult(result, selector, taskId) {
|
|
|
80
89
|
* @param taskId The ID of the task that this remote action represents.
|
|
81
90
|
*/
|
|
82
91
|
export function remoteError(error, selector, taskId) {
|
|
83
|
-
return
|
|
84
|
-
|
|
92
|
+
return {
|
|
93
|
+
type: 'remote_error',
|
|
94
|
+
error,
|
|
95
|
+
taskId,
|
|
96
|
+
...selector,
|
|
97
|
+
};
|
|
85
98
|
}
|
|
86
99
|
/**
|
|
87
100
|
* Creates a new device event.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteActions.js","sourceRoot":"","sources":["RemoteActions.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAA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EAAE,IAAI;QAChB,KAAK,EAAE,KAAK;QACZ,MAAM;KACT,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CACxB,IAAoB,EACpB,MAAW,EACX,MAAwB;IAExB,OAAO;QACH,IAAI,EAAE,eAAe;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM;QACN,MAAM;KACT,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACvB,IAAoB,EACpB,KAAU,EACV,MAAwB;IAExB,OAAO;QACH,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE,IAAI;QAChB,KAAK;QACL,MAAM;KACT,CAAC;AACN,CAAC"}
|
|
@@ -5,7 +5,10 @@ export function remapProgressPercent(start, end) {
|
|
|
5
5
|
return msg;
|
|
6
6
|
}
|
|
7
7
|
let realProgress = start + ratio * msg.progress;
|
|
8
|
-
return
|
|
8
|
+
return {
|
|
9
|
+
...msg,
|
|
10
|
+
progress: realProgress,
|
|
11
|
+
};
|
|
9
12
|
};
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=StatusUpdateUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusUpdateUtils.js","sourceRoot":"","sources":["StatusUpdateUtils.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,oBAAoB,CAChC,KAAa,EACb,GAAW;IAEX,IAAI,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;IACxB,OAAO,CAAC,GAAiB,EAAE,EAAE;QACzB,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC1B,OAAO,GAAG,CAAC;QACf,CAAC;QAED,IAAI,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC;QAChD,
|
|
1
|
+
{"version":3,"file":"StatusUpdateUtils.js","sourceRoot":"","sources":["StatusUpdateUtils.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,oBAAoB,CAChC,KAAa,EACb,GAAW;IAEX,IAAI,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;IACxB,OAAO,CAAC,GAAiB,EAAE,EAAE;QACzB,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC1B,OAAO,GAAG,CAAC;QACf,CAAC;QAED,IAAI,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC;QAChD,OAAO;YACH,GAAG,GAAG;YACN,QAAQ,EAAE,YAAY;SACzB,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface VersionNumber {
|
|
2
|
+
version: string | null;
|
|
3
|
+
major: number | null;
|
|
4
|
+
minor: number | null;
|
|
5
|
+
patch: number | null;
|
|
6
|
+
alpha: boolean | number | null;
|
|
7
|
+
tag: string | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Parses the given version number.
|
|
11
|
+
* @param version The version number.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseVersionNumber(version: string | null | undefined): VersionNumber;
|
|
14
|
+
/**
|
|
15
|
+
* Formats the given version number.
|
|
16
|
+
* @param major The major version number.
|
|
17
|
+
* @param minor The minor version number.
|
|
18
|
+
* @param patch The patch.
|
|
19
|
+
* @param tag The tag of the version number.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatVersionNumber(major: number, minor: number, patch: number, tag: string): string;
|
|
22
|
+
//# sourceMappingURL=Version.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* CasualOS is a set of web-based tools designed to facilitate the creation of real-time, multi-user, context-aware interactive experiences.
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) 2019-2025 Casual Simulation, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as
|
|
7
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
8
|
+
* License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { hasValue } from '../bots';
|
|
19
|
+
/**
|
|
20
|
+
* Parses the given version number.
|
|
21
|
+
* @param version The version number.
|
|
22
|
+
*/
|
|
23
|
+
export function parseVersionNumber(version) {
|
|
24
|
+
var _a;
|
|
25
|
+
if (!version) {
|
|
26
|
+
return {
|
|
27
|
+
version: null,
|
|
28
|
+
major: null,
|
|
29
|
+
minor: null,
|
|
30
|
+
patch: null,
|
|
31
|
+
alpha: null,
|
|
32
|
+
tag: null,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const versionRegex = /^v?(\d+)\.(\d+)\.(\d+)((:|-)\w+\.?\d*)*$/i;
|
|
36
|
+
const result = versionRegex.exec(version);
|
|
37
|
+
if (!result) {
|
|
38
|
+
return {
|
|
39
|
+
version: null,
|
|
40
|
+
major: null,
|
|
41
|
+
minor: null,
|
|
42
|
+
patch: null,
|
|
43
|
+
alpha: null,
|
|
44
|
+
tag: null,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const [str, major, minor, patch, prerelease] = result;
|
|
48
|
+
let alpha = false;
|
|
49
|
+
if (hasValue(prerelease)) {
|
|
50
|
+
alpha = true;
|
|
51
|
+
const [first, number] = prerelease.split('.');
|
|
52
|
+
if (hasValue(number)) {
|
|
53
|
+
alpha = parseInt(number);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
version: str,
|
|
58
|
+
major: parseInt(major),
|
|
59
|
+
minor: parseInt(minor),
|
|
60
|
+
patch: parseInt(patch),
|
|
61
|
+
alpha,
|
|
62
|
+
tag: (_a = prerelease === null || prerelease === void 0 ? void 0 : prerelease.substring(1)) !== null && _a !== void 0 ? _a : null,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Formats the given version number.
|
|
67
|
+
* @param major The major version number.
|
|
68
|
+
* @param minor The minor version number.
|
|
69
|
+
* @param patch The patch.
|
|
70
|
+
* @param tag The tag of the version number.
|
|
71
|
+
*/
|
|
72
|
+
export function formatVersionNumber(major, minor, patch, tag) {
|
|
73
|
+
return `v${major}.${minor}.${patch}${tag ? `-${tag}` : ''}`;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=Version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Version.js","sourceRoot":"","sources":["Version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAWnC;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAC9B,OAAkC;;IAElC,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO;YACH,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,GAAG,EAAE,IAAI;SACZ,CAAC;IACN,CAAC;IACD,MAAM,YAAY,GAAG,2CAA2C,CAAC;IACjE,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,OAAO;YACH,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,GAAG,EAAE,IAAI;SACZ,CAAC;IACN,CAAC;IACD,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,MAAM,CAAC;IAEtD,IAAI,KAAK,GAAqB,KAAK,CAAC;IACpC,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACvB,KAAK,GAAG,IAAI,CAAC;QACb,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACnB,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;IACL,CAAC;IAED,OAAO;QACH,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;QACtB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;QACtB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;QACtB,KAAK;QACL,GAAG,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,CAAC,CAAC,CAAC,mCAAI,IAAI;KACxC,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAC/B,KAAa,EACb,KAAa,EACb,KAAa,EACb,GAAW;IAEX,OAAO,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAChE,CAAC"}
|
package/common/WebConfig.d.ts
CHANGED
|
@@ -162,9 +162,9 @@ export declare const WEB_CONFIG_SCHEMA: z.ZodObject<{
|
|
|
162
162
|
what3WordsApiKey?: string;
|
|
163
163
|
playerMode?: "builder" | "player";
|
|
164
164
|
requirePrivoLogin?: boolean;
|
|
165
|
-
allowedBiosOptions?: ("local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "
|
|
166
|
-
defaultBiosOption?: "local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "
|
|
167
|
-
automaticBiosOption?: "local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "
|
|
165
|
+
allowedBiosOptions?: ("local" | "studio" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "sign in" | "sign up" | "sign out" | "delete inst")[];
|
|
166
|
+
defaultBiosOption?: "local" | "studio" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "sign in" | "sign up" | "sign out" | "delete inst";
|
|
167
|
+
automaticBiosOption?: "local" | "studio" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "sign in" | "sign up" | "sign out" | "delete inst";
|
|
168
168
|
}, {
|
|
169
169
|
version?: any;
|
|
170
170
|
causalRepoConnectionProtocol?: "apiary-aws" | "websocket";
|
|
@@ -182,8 +182,8 @@ export declare const WEB_CONFIG_SCHEMA: z.ZodObject<{
|
|
|
182
182
|
what3WordsApiKey?: string;
|
|
183
183
|
playerMode?: "builder" | "player";
|
|
184
184
|
requirePrivoLogin?: boolean;
|
|
185
|
-
allowedBiosOptions?: ("local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "
|
|
186
|
-
defaultBiosOption?: "local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "
|
|
187
|
-
automaticBiosOption?: "local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "
|
|
185
|
+
allowedBiosOptions?: ("local" | "studio" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "sign in" | "sign up" | "sign out" | "delete inst")[];
|
|
186
|
+
defaultBiosOption?: "local" | "studio" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "sign in" | "sign up" | "sign out" | "delete inst";
|
|
187
|
+
automaticBiosOption?: "local" | "studio" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "sign in" | "sign up" | "sign out" | "delete inst";
|
|
188
188
|
}>;
|
|
189
189
|
//# sourceMappingURL=WebConfig.d.ts.map
|
package/common/index.d.ts
CHANGED
package/common/index.js
CHANGED
package/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC"}
|