@casual-simulation/aux-common 3.2.11 → 3.2.12

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.
@@ -0,0 +1,177 @@
1
+ import { RemoteCausalRepoProtocol, SharedPartitionsVersion } from '../partitions';
2
+ import { z } from 'zod';
3
+ /**
4
+ * The possible BIOS options.
5
+ *
6
+ * - "enter join code" indicates that the user should be prompted to enter a join code.
7
+ * - "static inst", "local inst", and "local" indicates that the instance should be loaded statically.
8
+ * - "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
+ * - "sign in" indicates that the user should be prompted to sign in.
11
+ * - "sign up" indicates that the user should be prompted to sign up.
12
+ * - "sign out" indicates that the user should be logged out.
13
+ */
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';
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"]>;
16
+ /**
17
+ * Defines an interface for the configuration that the web client should try to pull from the server.
18
+ */
19
+ export interface WebConfig {
20
+ /**
21
+ * The protocol version.
22
+ */
23
+ version: 1 | 2 | null;
24
+ /**
25
+ * The protocol that should be used for realtime connections.
26
+ */
27
+ causalRepoConnectionProtocol: RemoteCausalRepoProtocol;
28
+ /**
29
+ * The URL that should be used for realtime connections.
30
+ */
31
+ causalRepoConnectionUrl?: string | null;
32
+ /**
33
+ * Whether collaborative repositories should be persisted locally.
34
+ * Defaults to false.
35
+ */
36
+ collaborativeRepoLocalPersistence?: boolean;
37
+ /**
38
+ * Whether static repositories should be persisted locally.
39
+ * Defaults to true.
40
+ */
41
+ staticRepoLocalPersistence?: boolean;
42
+ /**
43
+ * The version of the shared partitions that should be used.
44
+ */
45
+ sharedPartitionsVersion?: SharedPartitionsVersion | null;
46
+ /**
47
+ * The HTTP Origin that should be used for VM Iframes.
48
+ */
49
+ vmOrigin?: string | null;
50
+ /**
51
+ * The HTTP origin that should be used for auth iframes.
52
+ */
53
+ authOrigin?: string | null;
54
+ /**
55
+ * The HTTP origin that should be used for records.
56
+ */
57
+ recordsOrigin?: string | null;
58
+ /**
59
+ * Whether collaboration should be disabled.
60
+ * Setting this to true will replace the shared partition of simulations
61
+ * with tempLocal partitions.
62
+ */
63
+ disableCollaboration?: boolean | null;
64
+ /**
65
+ * The URL that should be used to bootstrap AB1.
66
+ */
67
+ ab1BootstrapURL?: string | null;
68
+ /**
69
+ * The API key that should be used for the ArcGIS mapping API.
70
+ */
71
+ arcGisApiKey?: string | null;
72
+ /**
73
+ * The app name that should be used for the Jitsi meet portal.
74
+ */
75
+ jitsiAppName?: string | null;
76
+ /**
77
+ * The API Key that should be used for what3words integration.
78
+ */
79
+ what3WordsApiKey?: string | null;
80
+ /**
81
+ * Gets the player mode of this CasualOS version.
82
+ *
83
+ * - "player" indicates that the instance has been configured for experiencing AUXes.
84
+ * - "builder" indicates that the instance has been configured for building AUXes.
85
+ */
86
+ playerMode?: 'player' | 'builder' | null;
87
+ /**
88
+ * Whether to require that users login with Privo before they can access collaboration features.
89
+ */
90
+ requirePrivoLogin?: boolean;
91
+ /**
92
+ * The allowed BIOS options.
93
+ * If omitted, then all options are allowed.
94
+ *
95
+ * Possible options are:
96
+ * - "enter join code"
97
+ * - "static inst"
98
+ * - "public inst"
99
+ * - "private inst"
100
+ * - "sign in"
101
+ * - "sign up"
102
+ * - "sign out"
103
+ */
104
+ allowedBiosOptions?: BiosOption[];
105
+ /**
106
+ * The default BIOS option.
107
+ * If specified, then the BIOS will automatically select this option when shown.
108
+ */
109
+ defaultBiosOption?: BiosOption;
110
+ /**
111
+ * The automatic BIOS option.
112
+ * If specified, then the BIOS will automatically execute this option.
113
+ */
114
+ automaticBiosOption?: BiosOption;
115
+ }
116
+ export declare const WEB_CONFIG_SCHEMA: z.ZodObject<{
117
+ version: any;
118
+ causalRepoConnectionProtocol: z.ZodEnum<["websocket", "apiary-aws"]>;
119
+ causalRepoConnectionUrl: z.ZodString;
120
+ collaborativeRepoLocalPersistence: z.ZodBoolean;
121
+ staticRepoLocalPersistence: z.ZodBoolean;
122
+ sharedPartitionsVersion: z.ZodEnum<["v2"]>;
123
+ vmOrigin: z.ZodNullable<z.ZodString>;
124
+ authOrigin: z.ZodNullable<z.ZodString>;
125
+ recordsOrigin: z.ZodNullable<z.ZodString>;
126
+ disableCollaboration: z.ZodNullable<z.ZodBoolean>;
127
+ ab1BootstrapURL: z.ZodNullable<z.ZodString>;
128
+ arcGisApiKey: z.ZodNullable<z.ZodString>;
129
+ jitsiAppName: z.ZodNullable<z.ZodString>;
130
+ what3WordsApiKey: z.ZodNullable<z.ZodString>;
131
+ playerMode: z.ZodNullable<z.ZodEnum<["player", "builder"]>>;
132
+ requirePrivoLogin: z.ZodBoolean;
133
+ 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"]>, "many">>;
134
+ 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"]>>;
135
+ 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"]>>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ version?: any;
138
+ causalRepoConnectionProtocol?: "apiary-aws" | "websocket";
139
+ causalRepoConnectionUrl?: string;
140
+ collaborativeRepoLocalPersistence?: boolean;
141
+ staticRepoLocalPersistence?: boolean;
142
+ sharedPartitionsVersion?: "v2";
143
+ vmOrigin?: string;
144
+ authOrigin?: string;
145
+ recordsOrigin?: string;
146
+ disableCollaboration?: boolean;
147
+ ab1BootstrapURL?: string;
148
+ arcGisApiKey?: string;
149
+ jitsiAppName?: string;
150
+ what3WordsApiKey?: string;
151
+ playerMode?: "builder" | "player";
152
+ requirePrivoLogin?: boolean;
153
+ allowedBiosOptions?: ("local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "studio" | "sign in" | "sign up" | "sign out")[];
154
+ defaultBiosOption?: "local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "studio" | "sign in" | "sign up" | "sign out";
155
+ automaticBiosOption?: "local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "studio" | "sign in" | "sign up" | "sign out";
156
+ }, {
157
+ version?: any;
158
+ causalRepoConnectionProtocol?: "apiary-aws" | "websocket";
159
+ causalRepoConnectionUrl?: string;
160
+ collaborativeRepoLocalPersistence?: boolean;
161
+ staticRepoLocalPersistence?: boolean;
162
+ sharedPartitionsVersion?: "v2";
163
+ vmOrigin?: string;
164
+ authOrigin?: string;
165
+ recordsOrigin?: string;
166
+ disableCollaboration?: boolean;
167
+ ab1BootstrapURL?: string;
168
+ arcGisApiKey?: string;
169
+ jitsiAppName?: string;
170
+ what3WordsApiKey?: string;
171
+ playerMode?: "builder" | "player";
172
+ requirePrivoLogin?: boolean;
173
+ allowedBiosOptions?: ("local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "studio" | "sign in" | "sign up" | "sign out")[];
174
+ defaultBiosOption?: "local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "studio" | "sign in" | "sign up" | "sign out";
175
+ automaticBiosOption?: "local" | "enter join code" | "join inst" | "static inst" | "local inst" | "public inst" | "private inst" | "free inst" | "free" | "studio inst" | "studio" | "sign in" | "sign up" | "sign out";
176
+ }>;
177
+ //# sourceMappingURL=WebConfig.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ export const BIOS_OPTION_SCHEMA = z.enum([
3
+ 'enter join code',
4
+ 'join inst',
5
+ 'static inst',
6
+ 'local inst',
7
+ 'local',
8
+ 'public inst',
9
+ 'private inst',
10
+ 'free inst',
11
+ 'free',
12
+ 'studio inst',
13
+ 'studio',
14
+ 'sign in',
15
+ 'sign up',
16
+ 'sign out',
17
+ ]);
18
+ export const WEB_CONFIG_SCHEMA = z.object({
19
+ version: null,
20
+ causalRepoConnectionProtocol: z.enum(['websocket', 'apiary-aws']),
21
+ causalRepoConnectionUrl: z.string().min(1).max(512),
22
+ collaborativeRepoLocalPersistence: z.boolean(),
23
+ staticRepoLocalPersistence: z.boolean(),
24
+ sharedPartitionsVersion: z.enum(['v2']),
25
+ vmOrigin: z.string().min(1).max(128).nullable(),
26
+ authOrigin: z.string().min(1).max(128).nullable(),
27
+ recordsOrigin: z.string().min(1).max(128).nullable(),
28
+ disableCollaboration: z.boolean().nullable(),
29
+ ab1BootstrapURL: z.string().min(1).max(512).nullable(),
30
+ arcGisApiKey: z.string().min(1).max(128).nullable(),
31
+ jitsiAppName: z.string().min(1).max(128).nullable(),
32
+ what3WordsApiKey: z.string().min(1).max(128).nullable(),
33
+ playerMode: z.enum(['player', 'builder']).nullable(),
34
+ requirePrivoLogin: z.boolean(),
35
+ allowedBiosOptions: z.array(BIOS_OPTION_SCHEMA).nullable(),
36
+ defaultBiosOption: BIOS_OPTION_SCHEMA.nullable(),
37
+ automaticBiosOption: BIOS_OPTION_SCHEMA.nullable(),
38
+ });
39
+ //# sourceMappingURL=WebConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebConfig.js","sourceRoot":"","sources":["WebConfig.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB,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E,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACnD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACnD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACvD,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpD,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC9B,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;IAC1D,iBAAiB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAChD,mBAAmB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC"}
package/common/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export * from './ConnectionToken';
10
10
  export * from './Iterators';
11
11
  export * from './PolicyPermissions';
12
12
  export * from './DenialReason';
13
+ export * from './WebConfig';
13
14
  //# sourceMappingURL=index.d.ts.map
package/common/index.js CHANGED
@@ -10,4 +10,5 @@ export * from './ConnectionToken';
10
10
  export * from './Iterators';
11
11
  export * from './PolicyPermissions';
12
12
  export * from './DenialReason';
13
+ export * from './WebConfig';
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,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,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casual-simulation/aux-common",
3
- "version": "3.2.11",
3
+ "version": "3.2.12",
4
4
  "description": "Common library for AUX projects",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -74,5 +74,5 @@
74
74
  "**/*.d.ts",
75
75
  "**/*.def"
76
76
  ],
77
- "gitHead": "0ee54bec92a85f87221cd9c829d71aa463eb97b4"
77
+ "gitHead": "eb991ede222910373ebd73b3cce4dbea581918e2"
78
78
  }