casualos 4.1.3 → 4.1.4

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 (2) hide show
  1. package/dist/cli.js +139 -46
  2. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -137353,7 +137353,14 @@ var WEB_CONFIG_SCHEMA = external_exports.object({
137353
137353
  "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)."
137354
137354
  )
137355
137355
  }).nullable().optional().describe("The set of icons that should be used for the web client."),
137356
- supportUrl: external_exports.string().min(1).nullable().optional()
137356
+ supportUrl: external_exports.string().min(1).nullable().optional(),
137357
+ postHogApiKey: external_exports.string().min(1).nullable().optional().describe(
137358
+ "The API key that should be used for PostHog analytics. If not specified, then PostHog will not be initialized."
137359
+ ),
137360
+ postHogApiHost: external_exports.string().min(1).nullable().optional().describe(
137361
+ "The HTTP host that should be used for PostHog analytics. If not specified, then the default PostHog cloud host will be used."
137362
+ ),
137363
+ enableSimpleAnalytics: external_exports.boolean().nullable().optional().describe("Whether to enable simple analytics. Defaults to false.")
137357
137364
  });
137358
137365
 
137359
137366
  // ../aux-common/common/Version.ts
@@ -149337,7 +149344,7 @@ var trace = TraceAPI.getInstance();
149337
149344
  function hashLowEntropyPasswordWithSalt2(password, salt) {
149338
149345
  const tracer = trace.getTracer(
149339
149346
  "InstrumentedHashHelpers",
149340
- false ? void 0 : "v4.1.3"
149347
+ false ? void 0 : "v4.1.4"
149341
149348
  );
149342
149349
  return tracer.startActiveSpan(
149343
149350
  "hashLowEntropyPasswordWithSalt",
@@ -149355,7 +149362,7 @@ function hashLowEntropyPasswordWithSalt2(password, salt) {
149355
149362
  function hashHighEntropyPasswordWithSalt2(password, salt) {
149356
149363
  const tracer = trace.getTracer(
149357
149364
  "InstrumentedHashHelpers",
149358
- false ? void 0 : "v4.1.3"
149365
+ false ? void 0 : "v4.1.4"
149359
149366
  );
149360
149367
  return tracer.startActiveSpan(
149361
149368
  "hashHighEntropyPasswordWithSalt",
@@ -149373,7 +149380,7 @@ function hashHighEntropyPasswordWithSalt2(password, salt) {
149373
149380
  function verifyPasswordAgainstHashes2(password, salt, hashes) {
149374
149381
  const tracer = trace.getTracer(
149375
149382
  "InstrumentedHashHelpers",
149376
- false ? void 0 : "v4.1.3"
149383
+ false ? void 0 : "v4.1.4"
149377
149384
  );
149378
149385
  return tracer.startActiveSpan(
149379
149386
  "verifyPasswordAgainstHashes",
@@ -156946,7 +156953,7 @@ var import_semantic_conventions = __toESM(require_src3());
156946
156953
  function traced(tracerName, options = {}, metricOptions = {}) {
156947
156954
  const tracer = trace.getTracer(
156948
156955
  tracerName,
156949
- false ? void 0 : "v4.1.3"
156956
+ false ? void 0 : "v4.1.4"
156950
156957
  );
156951
156958
  return function(target, propertyKey, descriptor) {
156952
156959
  const originalMethod = descriptor.value;
@@ -157032,7 +157039,7 @@ function getHistogram(meter) {
157032
157039
  }
157033
157040
  return metrics.getMeter(
157034
157041
  meter.meter,
157035
- false ? void 0 : "v4.1.3"
157042
+ false ? void 0 : "v4.1.4"
157036
157043
  ).createHistogram(meter.name, meter.options);
157037
157044
  }
157038
157045
  function getCounter(meter) {
@@ -157041,7 +157048,7 @@ function getCounter(meter) {
157041
157048
  }
157042
157049
  return metrics.getMeter(
157043
157050
  meter.meter,
157044
- false ? void 0 : "v4.1.3"
157051
+ false ? void 0 : "v4.1.4"
157045
157052
  ).createCounter(meter.name, meter.options);
157046
157053
  }
157047
157054
  function traceHttpResponse(options = {}) {
@@ -169025,7 +169032,9 @@ var COM_ID_PLAYER_CONFIG = WEB_CONFIG_SCHEMA.pick({
169025
169032
  jitsiAppName: true,
169026
169033
  what3WordsApiKey: true,
169027
169034
  logoBackgroundColor: true,
169028
- disableVM: true
169035
+ disableVM: true,
169036
+ postHogApiKey: true,
169037
+ postHogApiHost: true
169029
169038
  }).partial();
169030
169039
  var COM_ID_WEB_CONFIG_SCHEMA = external_exports.object({
169031
169040
  playerConfig: COM_ID_PLAYER_CONFIG,
@@ -171021,7 +171030,7 @@ var RecordsServer = class {
171021
171030
  this._viewTemplateRenderer = viewTemplateRenderer;
171022
171031
  this._tracer = trace.getTracer(
171023
171032
  "RecordsServer",
171024
- false ? void 0 : "v4.1.3"
171033
+ false ? void 0 : "v4.1.4"
171025
171034
  );
171026
171035
  this._purchasableItems = purchasableItemsController;
171027
171036
  this._procedures = this._createProcedures();
@@ -171085,6 +171094,56 @@ var RecordsServer = class {
171085
171094
  );
171086
171095
  }
171087
171096
  }
171097
+ if (config3.value.postHogApiKey) {
171098
+ postApp.push(
171099
+ /* @__PURE__ */ React.createElement(
171100
+ "script",
171101
+ {
171102
+ type: "text/plain",
171103
+ id: "posthog-api-key",
171104
+ dangerouslySetInnerHTML: {
171105
+ __html: config3.value.postHogApiKey
171106
+ }
171107
+ }
171108
+ )
171109
+ );
171110
+ }
171111
+ if (config3.value.postHogApiHost) {
171112
+ postApp.push(
171113
+ /* @__PURE__ */ React.createElement(
171114
+ "script",
171115
+ {
171116
+ type: "text/plain",
171117
+ id: "posthog-host",
171118
+ dangerouslySetInnerHTML: {
171119
+ __html: config3.value.postHogApiHost
171120
+ }
171121
+ }
171122
+ )
171123
+ );
171124
+ }
171125
+ if (config3.value.enableSimpleAnalytics) {
171126
+ postApp.push(
171127
+ /* @__PURE__ */ React.createElement(
171128
+ "script",
171129
+ {
171130
+ id: "simple-analytics",
171131
+ async: true,
171132
+ defer: true,
171133
+ "data-allow-params": "pattern,ask,inst",
171134
+ src: "https://scripts.simpleanalyticscdn.com/latest.js"
171135
+ }
171136
+ ),
171137
+ /* @__PURE__ */ React.createElement("noscript", null, /* @__PURE__ */ React.createElement(
171138
+ "img",
171139
+ {
171140
+ src: "https://queue.simpleanalyticscdn.com/noscript.gif",
171141
+ alt: "",
171142
+ referrerpolicy: "no-referrer-when-downgrade"
171143
+ }
171144
+ ))
171145
+ );
171146
+ }
171088
171147
  if (config3.value.icons) {
171089
171148
  if (config3.value.icons.appleTouchIcon) {
171090
171149
  icons.push(
@@ -171160,6 +171219,56 @@ var RecordsServer = class {
171160
171219
  }
171161
171220
  )
171162
171221
  );
171222
+ if (config3.value.postHogApiKey) {
171223
+ postApp.push(
171224
+ /* @__PURE__ */ React.createElement(
171225
+ "script",
171226
+ {
171227
+ type: "text/plain",
171228
+ id: "posthog-api-key",
171229
+ dangerouslySetInnerHTML: {
171230
+ __html: config3.value.postHogApiKey
171231
+ }
171232
+ }
171233
+ )
171234
+ );
171235
+ }
171236
+ if (config3.value.postHogApiHost) {
171237
+ postApp.push(
171238
+ /* @__PURE__ */ React.createElement(
171239
+ "script",
171240
+ {
171241
+ type: "text/plain",
171242
+ id: "posthog-host",
171243
+ dangerouslySetInnerHTML: {
171244
+ __html: config3.value.postHogApiHost
171245
+ }
171246
+ }
171247
+ )
171248
+ );
171249
+ }
171250
+ if (config3.value.enableSimpleAnalytics) {
171251
+ postApp.push(
171252
+ /* @__PURE__ */ React.createElement(
171253
+ "script",
171254
+ {
171255
+ id: "simple-analytics",
171256
+ async: true,
171257
+ defer: true,
171258
+ "data-allow-params": "pattern,ask,inst",
171259
+ src: "https://scripts.simpleanalyticscdn.com/latest.js"
171260
+ }
171261
+ ),
171262
+ /* @__PURE__ */ React.createElement("noscript", null, /* @__PURE__ */ React.createElement(
171263
+ "img",
171264
+ {
171265
+ src: "https://queue.simpleanalyticscdn.com/noscript.gif",
171266
+ alt: "",
171267
+ referrerpolicy: "no-referrer-when-downgrade"
171268
+ }
171269
+ ))
171270
+ );
171271
+ }
171163
171272
  let csp = `default-src 'self' https://js.stripe.com; img-src 'self' https://*; style-src 'self' 'unsafe-inline'; frame-src https://js.stripe.com; child-src https://*; connect-src 'self' https://scripts.simpleanalyticscdn.com http://localhost:9000 *.s3.amazonaws.com`;
171164
171273
  if (config3.value.recordsOrigin) {
171165
171274
  csp += ` ${config3.value.recordsOrigin};`;
@@ -174934,8 +175043,8 @@ var RecordsServer = class {
174934
175043
  return {
174935
175044
  success: true,
174936
175045
  ...metadata,
174937
- version: true ? "v4.1.3" : void 0,
174938
- versionHash: true ? "cfbc9d3d9c32d92c0bf90f496844e487f7ecfda5" : void 0
175046
+ version: true ? "v4.1.4" : void 0,
175047
+ versionHash: true ? "3a264de49101c026bc0d15d0e7958e5b6955c03a" : void 0
174939
175048
  };
174940
175049
  }),
174941
175050
  getPurchasableItem: procedure().origins(true).http("GET", "/api/v2/records/purchasableItems").inputs(
@@ -190836,82 +190945,66 @@ var CachingConfigStore = class {
190836
190945
  const cached2 = await this._cache.retrieve(
190837
190946
  key
190838
190947
  );
190839
- if (cached2) {
190948
+ if (typeof cached2 !== "undefined") {
190840
190949
  return cached2;
190841
190950
  }
190842
190951
  const result = await this._store.getConfiguration(key, defaultValue);
190843
- if (result) {
190844
- await this._cache.store(key, result, this._cacheSeconds);
190845
- }
190952
+ await this._cache.store(key, result, this._cacheSeconds);
190846
190953
  return result;
190847
190954
  }
190848
190955
  async getWebConfig() {
190849
190956
  const cached2 = await this._cache.retrieve(WEB_CONFIG_KEY);
190850
- if (cached2) {
190957
+ if (typeof cached2 !== "undefined") {
190851
190958
  return cached2;
190852
190959
  }
190853
190960
  const result = await this._store.getWebConfig();
190854
- if (result) {
190855
- await this._cache.store(WEB_CONFIG_KEY, result, this._cacheSeconds);
190856
- }
190961
+ await this._cache.store(WEB_CONFIG_KEY, result, this._cacheSeconds);
190857
190962
  return result;
190858
190963
  }
190859
190964
  async getPlayerWebManifest() {
190860
190965
  const cached2 = await this._cache.retrieve(
190861
190966
  PLAYER_WEB_MANIFEST_KEY
190862
190967
  );
190863
- if (cached2) {
190968
+ if (typeof cached2 !== "undefined") {
190864
190969
  return cached2;
190865
190970
  }
190866
190971
  const result = await this._store.getPlayerWebManifest();
190867
- if (result) {
190868
- await this._cache.store(
190869
- PLAYER_WEB_MANIFEST_KEY,
190870
- result,
190871
- this._cacheSeconds
190872
- );
190873
- }
190972
+ await this._cache.store(
190973
+ PLAYER_WEB_MANIFEST_KEY,
190974
+ result,
190975
+ this._cacheSeconds
190976
+ );
190874
190977
  return result;
190875
190978
  }
190876
190979
  async getSubscriptionConfiguration() {
190877
190980
  const cached2 = await this._cache.retrieve(
190878
190981
  "subscriptions"
190879
190982
  );
190880
- if (cached2) {
190983
+ if (typeof cached2 !== "undefined") {
190881
190984
  return cached2;
190882
190985
  }
190883
190986
  const result = await this._store.getSubscriptionConfiguration();
190884
- if (result) {
190885
- await this._cache.store(
190886
- "subscriptions",
190887
- result,
190888
- this._cacheSeconds
190889
- );
190890
- }
190987
+ await this._cache.store("subscriptions", result, this._cacheSeconds);
190891
190988
  return result;
190892
190989
  }
190893
190990
  async getPrivoConfiguration() {
190894
190991
  const cached2 = await this._cache.retrieve("privo");
190895
- if (cached2) {
190992
+ if (typeof cached2 !== "undefined") {
190896
190993
  return cached2;
190897
190994
  }
190898
190995
  const result = await this._store.getPrivoConfiguration();
190899
- if (result) {
190900
- await this._cache.store("privo", result, this._cacheSeconds);
190901
- }
190996
+ await this._cache.store("privo", result, this._cacheSeconds);
190902
190997
  return result;
190903
190998
  }
190904
190999
  async getModerationConfig() {
190905
191000
  const cached2 = await this._cache.retrieve(
190906
191001
  "moderation"
190907
191002
  );
190908
- if (cached2) {
191003
+ if (typeof cached2 !== "undefined") {
190909
191004
  return cached2;
190910
191005
  }
190911
191006
  const result = await this._store.getModerationConfig();
190912
- if (result) {
190913
- await this._cache.store("moderation", result, this._cacheSeconds);
190914
- }
191007
+ await this._cache.store("moderation", result, this._cacheSeconds);
190915
191008
  return result;
190916
191009
  }
190917
191010
  };
@@ -196632,8 +196725,8 @@ Because repo/add_updates is a very common permission, we periodically cache perm
196632
196725
  "The TLS configuration for the CasualOS app. If not provided, then TLS will not be used."
196633
196726
  ),
196634
196727
  proxy: external_exports.object({
196635
- trust: external_exports.string().optional().describe(
196636
- "The IP Address range of proxies that should be trusted."
196728
+ trust: external_exports.union([external_exports.string(), external_exports.boolean(), external_exports.number()]).optional().describe(
196729
+ 'The express.js "trust proxy" value. Can be a string, boolean, or number representing the IP Address range of proxies that should be trusted.'
196637
196730
  )
196638
196731
  }).optional().describe("The proxy configuration for the CasualOS app."),
196639
196732
  debug: external_exports.boolean().prefault(false).describe(
@@ -231564,7 +231657,7 @@ var config2 = new Conf({
231564
231657
  projectName: "casualos-cli"
231565
231658
  });
231566
231659
  var program2 = new Command();
231567
- program2.name("casualos").description("A CLI for CasualOS").version("v4.1.3").option(
231660
+ program2.name("casualos").description("A CLI for CasualOS").version("v4.1.4").option(
231568
231661
  "-e, --endpoint <url>",
231569
231662
  "The endpoint to use for queries. Can be used to override the current endpoint."
231570
231663
  ).option(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "casualos",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "Command line interface for CasualOS.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@casual-simulation/aux-common": "^4.1.3",
32
- "@casual-simulation/aux-records": "^4.1.3",
33
- "@casual-simulation/aux-runtime": "^4.1.3",
34
- "@casual-simulation/aux-vm": "^4.1.3",
31
+ "@casual-simulation/aux-common": "^4.1.4",
32
+ "@casual-simulation/aux-records": "^4.1.4",
33
+ "@casual-simulation/aux-runtime": "^4.1.4",
34
+ "@casual-simulation/aux-vm": "^4.1.4",
35
35
  "@octokit/app": "^15.1.0",
36
36
  "@octokit/auth-oauth-device": "^7.1.1",
37
37
  "@octokit/core": "^6.1.2",