@casual-simulation/aux-common 3.8.2-alpha.19511653187 → 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 +146 -3
  7. package/bots/BotEvents.js +19 -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
@@ -1 +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,Q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* - "enter join code" indicates that the user should be prompted to enter a join code.
7
+ * - "temp" indicates that a temporary instance should be created (no persistence).
7
8
  * - "static inst", "local inst", and "local" indicates that the instance should be loaded statically.
8
9
  * - "public inst", "free inst", and "free" indicates that the instance should be loaded from the public partition.
9
- * - "private inst", "studio inst", and "studio" indicates that the instance should be loaded from the private partition.
10
+ * - "private inst", "studio inst", "studio", and "locked" indicates that the instance should be loaded from the private partition.
10
11
  * - "sign in" indicates that the user should be prompted to sign in.
11
12
  * - "sign up" indicates that the user should be prompted to sign up.
12
13
  * - "sign out" indicates that the user should be logged out.
13
14
  */
14
- export type BiosOption = 'enter join code' | 'join inst' | 'static inst' | 'local inst' | 'local' | 'public inst' | 'private inst' | 'free inst' | 'free' | 'studio inst' | 'studio' | 'sign in' | 'sign up' | 'sign out' | 'delete inst';
15
- export declare const BIOS_OPTION_SCHEMA: z.ZodEnum<["enter join code", "join inst", "static inst", "local inst", "local", "public inst", "private inst", "free inst", "free", "studio inst", "studio", "sign in", "sign up", "sign out", "delete inst"]>;
15
+ export type BiosOption = 'enter join code' | 'join inst' | 'temp' | 'static inst' | 'local inst' | 'local' | 'public inst' | 'free inst' | 'free' | 'private inst' | 'studio inst' | 'studio' | 'locked' | 'sign in' | 'sign up' | 'sign out' | 'delete inst';
16
+ export declare const BIOS_OPTION_SCHEMA: z.ZodEnum<{
17
+ local: "local";
18
+ studio: "studio";
19
+ locked: "locked";
20
+ "enter join code": "enter join code";
21
+ "join inst": "join inst";
22
+ temp: "temp";
23
+ "static inst": "static inst";
24
+ "local inst": "local inst";
25
+ "public inst": "public inst";
26
+ "free inst": "free inst";
27
+ free: "free";
28
+ "private inst": "private inst";
29
+ "studio inst": "studio inst";
30
+ "sign in": "sign in";
31
+ "sign up": "sign up";
32
+ "sign out": "sign out";
33
+ "delete inst": "delete inst";
34
+ }>;
16
35
  /**
17
36
  * Defines an interface for the configuration that the web client should try to pull from the server.
18
37
  */
@@ -47,6 +66,14 @@ export interface WebConfig {
47
66
  * The HTTP Origin that should be used for VM Iframes.
48
67
  */
49
68
  vmOrigin?: string | null;
69
+ /**
70
+ * Whether to disable the VM entirely.
71
+ *
72
+ * This is primarily for custom domains and enabling full PWA support.
73
+ *
74
+ * Defaults to false.
75
+ */
76
+ disableVm?: boolean;
50
77
  /**
51
78
  * The HTTP origin that should be used for auth iframes.
52
79
  */
@@ -65,6 +92,10 @@ export interface WebConfig {
65
92
  * The URL that should be used to bootstrap AB1.
66
93
  */
67
94
  ab1BootstrapURL?: string | null;
95
+ /**
96
+ * Whether the server should inject the AB1 Bootstrap script via a script tag.
97
+ */
98
+ serverInjectBootstrapper?: boolean;
68
99
  /**
69
100
  * The API key that should be used for the ArcGIS mapping API.
70
101
  */
@@ -112,6 +143,12 @@ export interface WebConfig {
112
143
  * If specified, then the BIOS will automatically execute this option.
113
144
  */
114
145
  automaticBiosOption?: BiosOption;
146
+ /**
147
+ * The instance ID to use when executing the automatic BIOS option.
148
+ *
149
+ * Should be formatted as `{recordName/{instName}`. For local/public insts, recordName can be omitted (e.g. `/{instName}`).
150
+ */
151
+ automaticBiosOptionInst?: string | null;
115
152
  /**
116
153
  * Whether full support for the DOM should be enabled.
117
154
  * This will run the VM without the web worker so that scripts have direct access to the iframe.
@@ -137,75 +174,132 @@ export interface WebConfig {
137
174
  * This is used to set the background color of the splash screen.
138
175
  */
139
176
  logoBackgroundColor?: string | null;
177
+ /**
178
+ * The URL that users can visit for support.
179
+ */
180
+ supportUrl?: string | null;
181
+ /**
182
+ * Whether to enable SMS authentication.
183
+ * Defaults to false.
184
+ */
185
+ enableSmsAuthentication?: boolean;
186
+ icons?: {
187
+ favicon?: string | null;
188
+ appleTouchIcon?: string | null;
189
+ };
190
+ }
191
+ /**
192
+ * The configuration interface that extends the web config with computed options.
193
+ */
194
+ export interface CasualOSConfig extends WebConfig {
195
+ /**
196
+ * Whether subscriptions are supported in this configuration.
197
+ */
198
+ subscriptionsSupported: boolean;
199
+ /**
200
+ * Whether studios are supported in this configuration.
201
+ */
202
+ studiosSupported: boolean;
203
+ /**
204
+ * The comID that was used to load this configuration.
205
+ */
206
+ comId?: string | null;
140
207
  }
141
208
  export declare const WEB_CONFIG_SCHEMA: z.ZodObject<{
142
- version: any;
143
- causalRepoConnectionProtocol: z.ZodEnum<["websocket", "apiary-aws"]>;
144
- causalRepoConnectionUrl: z.ZodString;
145
- collaborativeRepoLocalPersistence: z.ZodBoolean;
146
- staticRepoLocalPersistence: z.ZodBoolean;
147
- sharedPartitionsVersion: z.ZodEnum<["v2"]>;
148
- vmOrigin: z.ZodNullable<z.ZodString>;
149
- authOrigin: z.ZodNullable<z.ZodString>;
150
- recordsOrigin: z.ZodNullable<z.ZodString>;
151
- disableCollaboration: z.ZodNullable<z.ZodBoolean>;
152
- ab1BootstrapURL: z.ZodNullable<z.ZodString>;
153
- arcGisApiKey: z.ZodNullable<z.ZodString>;
154
- jitsiAppName: z.ZodNullable<z.ZodString>;
155
- what3WordsApiKey: z.ZodNullable<z.ZodString>;
156
- playerMode: z.ZodNullable<z.ZodEnum<["player", "builder"]>>;
157
- requirePrivoLogin: z.ZodBoolean;
158
- allowedBiosOptions: z.ZodNullable<z.ZodArray<z.ZodEnum<["enter join code", "join inst", "static inst", "local inst", "local", "public inst", "private inst", "free inst", "free", "studio inst", "studio", "sign in", "sign up", "sign out", "delete inst"]>, "many">>;
159
- defaultBiosOption: z.ZodNullable<z.ZodEnum<["enter join code", "join inst", "static inst", "local inst", "local", "public inst", "private inst", "free inst", "free", "studio inst", "studio", "sign in", "sign up", "sign out", "delete inst"]>>;
160
- automaticBiosOption: z.ZodNullable<z.ZodEnum<["enter join code", "join inst", "static inst", "local inst", "local", "public inst", "private inst", "free inst", "free", "studio inst", "studio", "sign in", "sign up", "sign out", "delete inst"]>>;
209
+ causalRepoConnectionProtocol: z.ZodPrefault<z.ZodEnum<{
210
+ "apiary-aws": "apiary-aws";
211
+ websocket: "websocket";
212
+ }>>;
213
+ causalRepoConnectionUrl: z.ZodOptional<z.ZodString>;
214
+ collaborativeRepoLocalPersistence: z.ZodPrefault<z.ZodBoolean>;
215
+ staticRepoLocalPersistence: z.ZodPrefault<z.ZodBoolean>;
216
+ sharedPartitionsVersion: z.ZodPrefault<z.ZodEnum<{
217
+ v2: "v2";
218
+ }>>;
219
+ vmOrigin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ disableVM: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
221
+ authOrigin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
+ recordsOrigin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
223
+ disableCollaboration: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
224
+ ab1BootstrapURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ serverInjectBootstrapper: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
226
+ arcGisApiKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
+ jitsiAppName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
228
+ what3WordsApiKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
+ playerMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
230
+ builder: "builder";
231
+ player: "player";
232
+ }>>>;
233
+ requirePrivoLogin: z.ZodPrefault<z.ZodBoolean>;
234
+ allowedBiosOptions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
235
+ local: "local";
236
+ studio: "studio";
237
+ locked: "locked";
238
+ "enter join code": "enter join code";
239
+ "join inst": "join inst";
240
+ temp: "temp";
241
+ "static inst": "static inst";
242
+ "local inst": "local inst";
243
+ "public inst": "public inst";
244
+ "free inst": "free inst";
245
+ free: "free";
246
+ "private inst": "private inst";
247
+ "studio inst": "studio inst";
248
+ "sign in": "sign in";
249
+ "sign up": "sign up";
250
+ "sign out": "sign out";
251
+ "delete inst": "delete inst";
252
+ }>>>>;
253
+ defaultBiosOption: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
254
+ local: "local";
255
+ studio: "studio";
256
+ locked: "locked";
257
+ "enter join code": "enter join code";
258
+ "join inst": "join inst";
259
+ temp: "temp";
260
+ "static inst": "static inst";
261
+ "local inst": "local inst";
262
+ "public inst": "public inst";
263
+ "free inst": "free inst";
264
+ free: "free";
265
+ "private inst": "private inst";
266
+ "studio inst": "studio inst";
267
+ "sign in": "sign in";
268
+ "sign up": "sign up";
269
+ "sign out": "sign out";
270
+ "delete inst": "delete inst";
271
+ }>>>;
272
+ automaticBiosOption: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
273
+ local: "local";
274
+ studio: "studio";
275
+ locked: "locked";
276
+ "enter join code": "enter join code";
277
+ "join inst": "join inst";
278
+ temp: "temp";
279
+ "static inst": "static inst";
280
+ "local inst": "local inst";
281
+ "public inst": "public inst";
282
+ "free inst": "free inst";
283
+ free: "free";
284
+ "private inst": "private inst";
285
+ "studio inst": "studio inst";
286
+ "sign in": "sign in";
287
+ "sign up": "sign up";
288
+ "sign out": "sign out";
289
+ "delete inst": "delete inst";
290
+ }>>>;
291
+ automaticBiosOptionInst: z.ZodOptional<z.ZodNullable<z.ZodString>>;
292
+ enableDom: z.ZodPrefault<z.ZodBoolean>;
293
+ debug: z.ZodPrefault<z.ZodBoolean>;
294
+ enableSmsAuthentication: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
161
295
  logoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
162
296
  logoBackgroundColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
297
  logoTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
164
- }, "strip", z.ZodTypeAny, {
165
- version?: any;
166
- causalRepoConnectionProtocol?: "apiary-aws" | "websocket";
167
- causalRepoConnectionUrl?: string;
168
- collaborativeRepoLocalPersistence?: boolean;
169
- staticRepoLocalPersistence?: boolean;
170
- sharedPartitionsVersion?: "v2";
171
- vmOrigin?: string;
172
- authOrigin?: string;
173
- recordsOrigin?: string;
174
- disableCollaboration?: boolean;
175
- ab1BootstrapURL?: string;
176
- arcGisApiKey?: string;
177
- jitsiAppName?: string;
178
- what3WordsApiKey?: string;
179
- playerMode?: "builder" | "player";
180
- requirePrivoLogin?: boolean;
181
- 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")[];
182
- 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";
183
- 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";
184
- logoUrl?: string;
185
- logoBackgroundColor?: string;
186
- logoTitle?: string;
187
- }, {
188
- version?: any;
189
- causalRepoConnectionProtocol?: "apiary-aws" | "websocket";
190
- causalRepoConnectionUrl?: string;
191
- collaborativeRepoLocalPersistence?: boolean;
192
- staticRepoLocalPersistence?: boolean;
193
- sharedPartitionsVersion?: "v2";
194
- vmOrigin?: string;
195
- authOrigin?: string;
196
- recordsOrigin?: string;
197
- disableCollaboration?: boolean;
198
- ab1BootstrapURL?: string;
199
- arcGisApiKey?: string;
200
- jitsiAppName?: string;
201
- what3WordsApiKey?: string;
202
- playerMode?: "builder" | "player";
203
- requirePrivoLogin?: boolean;
204
- 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")[];
205
- 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";
206
- 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";
207
- logoUrl?: string;
208
- logoBackgroundColor?: string;
209
- logoTitle?: string;
210
- }>;
298
+ icons: z.ZodOptional<z.ZodNullable<z.ZodObject<{
299
+ favicon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ appleTouchIcon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
+ }, z.core.$strip>>>;
302
+ supportUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
303
+ }, z.core.$strip>;
304
+ export declare function parseWebConfig(config: any, defaultConfig: WebConfig): WebConfig;
211
305
  //# sourceMappingURL=WebConfig.d.ts.map
@@ -2,42 +2,105 @@ import { z } from 'zod';
2
2
  export const BIOS_OPTION_SCHEMA = z.enum([
3
3
  'enter join code',
4
4
  'join inst',
5
+ 'temp',
5
6
  'static inst',
6
7
  'local inst',
7
8
  'local',
8
9
  'public inst',
9
- 'private inst',
10
10
  'free inst',
11
11
  'free',
12
+ 'private inst',
12
13
  'studio inst',
13
14
  'studio',
15
+ 'locked',
14
16
  'sign in',
15
17
  'sign up',
16
18
  'sign out',
17
19
  'delete inst',
18
20
  ]);
19
21
  export const WEB_CONFIG_SCHEMA = z.object({
20
- version: null,
21
- causalRepoConnectionProtocol: z.enum(['websocket', 'apiary-aws']),
22
- causalRepoConnectionUrl: z.string().min(1).max(512),
23
- collaborativeRepoLocalPersistence: z.boolean(),
24
- staticRepoLocalPersistence: z.boolean(),
25
- sharedPartitionsVersion: z.enum(['v2']),
26
- vmOrigin: z.string().min(1).max(128).nullable(),
27
- authOrigin: z.string().min(1).max(128).nullable(),
28
- recordsOrigin: z.string().min(1).max(128).nullable(),
29
- disableCollaboration: z.boolean().nullable(),
30
- ab1BootstrapURL: z.string().min(1).max(512).nullable(),
31
- arcGisApiKey: z.string().min(1).max(128).nullable(),
32
- jitsiAppName: z.string().min(1).max(128).nullable(),
33
- what3WordsApiKey: z.string().min(1).max(128).nullable(),
34
- playerMode: z.enum(['player', 'builder']).nullable(),
35
- requirePrivoLogin: z.boolean(),
36
- allowedBiosOptions: z.array(BIOS_OPTION_SCHEMA).nullable(),
37
- defaultBiosOption: BIOS_OPTION_SCHEMA.nullable(),
38
- automaticBiosOption: BIOS_OPTION_SCHEMA.nullable(),
39
- logoUrl: z.string().min(1).max(512).nullable().optional(),
40
- logoBackgroundColor: z.string().min(1).max(32).nullable().optional(),
41
- logoTitle: z.string().min(1).max(128).nullable().optional(),
22
+ causalRepoConnectionProtocol: z
23
+ .enum(['websocket', 'apiary-aws'])
24
+ .prefault('websocket'),
25
+ causalRepoConnectionUrl: z.string().min(1).max(512).optional(),
26
+ collaborativeRepoLocalPersistence: z.boolean().prefault(false),
27
+ staticRepoLocalPersistence: z.boolean().prefault(true),
28
+ sharedPartitionsVersion: z.enum(['v2']).prefault('v2'),
29
+ vmOrigin: z.string().min(1).max(128).nullable().optional(),
30
+ disableVM: z.boolean().nullable().optional(),
31
+ authOrigin: z.string().min(1).max(128).nullable().optional(),
32
+ recordsOrigin: z.string().min(1).max(128).nullable().optional(),
33
+ disableCollaboration: z.boolean().nullable().optional(),
34
+ ab1BootstrapURL: z.string().min(1).max(512).nullable().optional(),
35
+ serverInjectBootstrapper: z.boolean().nullable().optional(),
36
+ arcGisApiKey: z.string().min(1).max(128).nullable().optional(),
37
+ jitsiAppName: z.string().min(1).max(128).nullable().optional(),
38
+ what3WordsApiKey: z.string().min(1).max(128).nullable().optional(),
39
+ playerMode: z.enum(['player', 'builder']).nullable().optional(),
40
+ requirePrivoLogin: z.boolean().prefault(false),
41
+ allowedBiosOptions: z.array(BIOS_OPTION_SCHEMA).nullable().optional(),
42
+ defaultBiosOption: BIOS_OPTION_SCHEMA.nullable().optional(),
43
+ automaticBiosOption: BIOS_OPTION_SCHEMA.nullable().optional(),
44
+ automaticBiosOptionInst: z
45
+ .string()
46
+ .nonempty()
47
+ .nullable()
48
+ .optional()
49
+ .describe('The instance ID to use when executing the automatic BIOS option. Should be formatted as `{recordName/{instName}`. For local/public insts, recordName can be omitted (e.g. `/{instName}`).'),
50
+ enableDom: z.boolean().prefault(false),
51
+ debug: z.boolean().prefault(false),
52
+ enableSmsAuthentication: z.boolean().nullable().optional(),
53
+ logoUrl: z
54
+ .string()
55
+ .min(1)
56
+ .max(512)
57
+ .nullable()
58
+ .optional()
59
+ .describe('The URL of the logo to display in the loading screen.'),
60
+ logoBackgroundColor: z
61
+ .string()
62
+ .min(1)
63
+ .max(32)
64
+ .nullable()
65
+ .optional()
66
+ .describe('The background color of the logo to display in the loading screen. This is used to set the background color of the splash screen.'),
67
+ logoTitle: z
68
+ .string()
69
+ .min(1)
70
+ .max(128)
71
+ .nullable()
72
+ .optional()
73
+ .describe('The title text that accompanies the logo in the loading screen.'),
74
+ icons: z
75
+ .object({
76
+ favicon: z
77
+ .string()
78
+ .nonempty()
79
+ .nullable()
80
+ .optional()
81
+ .describe('The favicon that should be served for the web client. If not specified, a default favicon will be used. Should be 48x48 px and utilize transparency.'),
82
+ appleTouchIcon: z
83
+ .string()
84
+ .nonempty()
85
+ .nullable()
86
+ .optional()
87
+ .describe('The apple touch icon that should be used for the web client. If not specified, a default apple touch icon will be used. Should be 180x180 px and not use transparency (background should be a solid color).'),
88
+ })
89
+ .nullable()
90
+ .optional()
91
+ .describe('The set of icons that should be used for the web client.'),
92
+ supportUrl: z.string().min(1).nullable().optional(),
42
93
  });
94
+ export function parseWebConfig(config, defaultConfig) {
95
+ if (config) {
96
+ const result = WEB_CONFIG_SCHEMA.safeParse(config);
97
+ if (result.success) {
98
+ return result.data;
99
+ }
100
+ else {
101
+ console.error('[WebConfig] Invalid web config', result);
102
+ }
103
+ }
104
+ return defaultConfig;
105
+ }
43
106
  //# sourceMappingURL=WebConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebConfig.js","sourceRoot":"","sources":["WebConfig.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8BxB,MAAM,CAAC,MAAM,kBAAkB,GAAG,C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,QAAQ,CAAC,0DAA0D,CAAC;IAEzE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACtD,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAC1B,MAAW,EACX,aAAwB;IAExB,IAAI,MAAM,EAAE,CAAC;QACT,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,IAAiB,CAAC;QACpC,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,MAAM,CAAC,CAAC;QAC5D,CAAC;IACL,CAAC;IACD,OAAO,aAAa,CAAC;AACzB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import z from 'zod';
2
+ /**
3
+ * The schema for the PWA web manifest.
4
+ */
5
+ export declare const WEB_MANIFEST_SCHEMA: z.ZodOptional<z.ZodObject<{
6
+ name: z.ZodString;
7
+ short_name: z.ZodString;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ start_url: z.ZodPrefault<z.ZodString>;
10
+ display: z.ZodPrefault<z.ZodEnum<{
11
+ fullscreen: "fullscreen";
12
+ standalone: "standalone";
13
+ "minimal-ui": "minimal-ui";
14
+ browser: "browser";
15
+ }>>;
16
+ background_color: z.ZodPrefault<z.ZodString>;
17
+ theme_color: z.ZodPrefault<z.ZodString>;
18
+ icons: z.ZodPrefault<z.ZodArray<z.ZodObject<{
19
+ src: z.ZodString;
20
+ type: z.ZodString;
21
+ sizes: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodString]>;
22
+ purpose: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>>>;
24
+ }, z.core.$loose>>;
25
+ export type WebManifest = z.infer<typeof WEB_MANIFEST_SCHEMA>;
26
+ export declare function parseWebManifest(config: any, defaultConfig: WebManifest): WebManifest;
27
+ //# sourceMappingURL=WebManifest.d.ts.map
@@ -0,0 +1,110 @@
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 z from 'zod';
19
+ /**
20
+ * The schema for the PWA web manifest.
21
+ */
22
+ export const WEB_MANIFEST_SCHEMA = z
23
+ .looseObject({
24
+ name: z.string().describe('The name of the PWA app.'),
25
+ short_name: z.string().describe('The short name of the PWA app.'),
26
+ description: z
27
+ .string()
28
+ .optional()
29
+ .describe('The description of the PWA app.'),
30
+ start_url: z
31
+ .string()
32
+ .prefault('/')
33
+ .describe('The URL that should be launched when opening the PWA. Defaults to "/"'),
34
+ display: z
35
+ .enum(['fullscreen', 'standalone', 'minimal-ui', 'browser'])
36
+ .prefault('standalone')
37
+ .describe('The display mode that should be used for the PWA app.'),
38
+ background_color: z
39
+ .string()
40
+ .prefault('#ffffff')
41
+ .describe('The background color that should be used on the splash screen when the PWA is launched.'),
42
+ theme_color: z
43
+ .string()
44
+ .prefault('#000000')
45
+ .describe('The theme color that should be used for the PWA app.'),
46
+ icons: z
47
+ .array(z.object({
48
+ src: z.string().describe('The source URL of the icon.'),
49
+ type: z.string().describe('The MIME type of the icon.'),
50
+ sizes: z
51
+ .union([
52
+ z
53
+ .literal('any')
54
+ .describe('The icon is scalable and can be used at any size.'),
55
+ z
56
+ .string()
57
+ .check(z.regex(/^(\d+x\d+)(\s+\d+x\d+)*$/))
58
+ .describe('The sizes of the icon.'),
59
+ ])
60
+ .describe('The size(s) that the icon can display formatted as "{width}x{height}". Use "any" for scalable icons like SVG.'),
61
+ purpose: z
62
+ .string()
63
+ .optional()
64
+ .describe('The purpose of the icon.'),
65
+ }))
66
+ .prefault([
67
+ {
68
+ src: '/pwa-192x192.png',
69
+ sizes: '192x192',
70
+ type: 'image/png',
71
+ purpose: 'any',
72
+ },
73
+ {
74
+ src: '/pwa-512x512.png',
75
+ sizes: '512x512',
76
+ type: 'image/png',
77
+ purpose: 'any',
78
+ },
79
+ {
80
+ src: '/pwa-maskable-192x192.png',
81
+ sizes: '192x192',
82
+ type: 'image/png',
83
+ purpose: 'maskable',
84
+ },
85
+ {
86
+ src: '/pwa-maskable-512x512.png',
87
+ sizes: '512x512',
88
+ type: 'image/png',
89
+ purpose: 'maskable',
90
+ },
91
+ ])
92
+ .describe('The icons that should be used for the PWA app.\nSee https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest/Reference/icons\nAlso see https://favicon.inbrowser.app/tools/favicon-generator to generate icons.'),
93
+ })
94
+ .refine((obj) => Object.keys(obj).length < 20, {
95
+ error: 'Web manifest has too many top-level properties. Maximum allowed is 20.',
96
+ })
97
+ .optional();
98
+ export function parseWebManifest(config, defaultConfig) {
99
+ if (config) {
100
+ const result = WEB_MANIFEST_SCHEMA.safeParse(config);
101
+ if (result.success) {
102
+ return result.data;
103
+ }
104
+ else {
105
+ console.error('[WebManifest] Invalid web manifest', result);
106
+ }
107
+ }
108
+ return defaultConfig;
109
+ }
110
+ //# sourceMappingURL=WebManifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebManifest.js","sourceRoot":"","sources":["WebManifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;GAEG;AACH,MAAM,CA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teYjsSharedDocument extends YjsSharedDocument {
53
53
  this._readOnly = config.readOnly || this._static || false;
54
54
  }
55
55
  connect() {
56
- var _a, _b;
57
- if (!this._temporary && ((_a = this._persistence) === null || _a === void 0 ? void 0 : _a.saveToIndexedDb)) {
56
+ if (!this._temporary && this._persistence?.saveToIndexedDb) {
58
57
  console.log('[RemoteYjsSharedDocument] Using IndexedDB persistence');
59
- const name = `${(_b = this._recordName) !== null && _b !== void 0 ? _b : ''}/${this._inst}/${this._branch}`;
58
+ const name = `${this._recordName ?? ''}/${this._inst}/${this._branch}`;
60
59
  this._indexeddb = new YjsIndexedDBPersistence(name, this._doc);
61
60
  }
62
61
  if (this._skipInitialLoad) {
@@ -79,7 +78,6 @@ export class RemoteYjsSharedDocument extends YjsSharedDocument {
79
78
  await promise;
80
79
  }
81
80
  async _initializePartitionWithoutLoading() {
82
- var _a;
83
81
  this._onStatusUpdated.next({
84
82
  type: 'connection',
85
83
  connected: true,
@@ -91,7 +89,7 @@ export class RemoteYjsSharedDocument extends YjsSharedDocument {
91
89
  this._onStatusUpdated.next({
92
90
  type: 'authentication',
93
91
  authenticated: true,
94
- info: (_a = this._client.connection.info) !== null && _a !== void 0 ? _a : {
92
+ info: this._client.connection.info ?? {
95
93
  connectionId: connectionId,
96
94
  sessionId: null,
97
95
  userId: null,