@digilogiclabs/platform-core 1.8.0 → 1.9.0

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/dist/index.mjs CHANGED
@@ -14032,7 +14032,10 @@ var MemoryBeta = class {
14032
14032
  return { valid: false, message: "This invite code has expired." };
14033
14033
  }
14034
14034
  if (invite.currentUses >= invite.maxUses) {
14035
- return { valid: false, message: "This invite code has reached its usage limit." };
14035
+ return {
14036
+ valid: false,
14037
+ message: "This invite code has reached its usage limit."
14038
+ };
14036
14039
  }
14037
14040
  return {
14038
14041
  valid: true,
@@ -14082,7 +14085,9 @@ var MemoryBeta = class {
14082
14085
  async getStats() {
14083
14086
  const codes = Array.from(this.codes.values());
14084
14087
  const activeCodes = codes.filter((c) => c.isActive);
14085
- const testers = Array.from(this.testers.values()).filter((t) => t.isBetaTester);
14088
+ const testers = Array.from(this.testers.values()).filter(
14089
+ (t) => t.isBetaTester
14090
+ );
14086
14091
  const joinDates = testers.map((t) => t.betaJoinedAt).sort((a, b) => a.getTime() - b.getTime());
14087
14092
  return {
14088
14093
  totalBetaTesters: testers.length,
@@ -18916,14 +18921,11 @@ function createBetaClient(config = {}) {
18916
18921
  async function fetchBetaSettings(config = {}) {
18917
18922
  const cfg = { ...DEFAULT_CONFIG, ...config };
18918
18923
  try {
18919
- const response = await fetch(
18920
- `${cfg.baseUrl}${cfg.settingsEndpoint}`,
18921
- {
18922
- method: "GET",
18923
- headers: { "Content-Type": "application/json" },
18924
- cache: "no-store"
18925
- }
18926
- );
18924
+ const response = await fetch(`${cfg.baseUrl}${cfg.settingsEndpoint}`, {
18925
+ method: "GET",
18926
+ headers: { "Content-Type": "application/json" },
18927
+ cache: "no-store"
18928
+ });
18927
18929
  if (!response.ok) {
18928
18930
  throw new Error(`Failed to fetch beta settings: ${response.status}`);
18929
18931
  }
@@ -18951,14 +18953,11 @@ async function validateBetaCode(code, config = {}) {
18951
18953
  };
18952
18954
  }
18953
18955
  try {
18954
- const response = await fetch(
18955
- `${cfg.baseUrl}${cfg.validateEndpoint}`,
18956
- {
18957
- method: "POST",
18958
- headers: { "Content-Type": "application/json" },
18959
- body: JSON.stringify({ code: code.trim().toUpperCase() })
18960
- }
18961
- );
18956
+ const response = await fetch(`${cfg.baseUrl}${cfg.validateEndpoint}`, {
18957
+ method: "POST",
18958
+ headers: { "Content-Type": "application/json" },
18959
+ body: JSON.stringify({ code: code.trim().toUpperCase() })
18960
+ });
18962
18961
  if (response.status === 429) {
18963
18962
  return {
18964
18963
  valid: false,
@@ -31118,17 +31117,20 @@ var PostgresBeta = class {
31118
31117
  updated_by VARCHAR(255)
31119
31118
  )
31120
31119
  `);
31121
- await client.query(`
31120
+ await client.query(
31121
+ `
31122
31122
  INSERT INTO ${this.t("beta_settings")} (key, value, description) VALUES
31123
31123
  ('beta_mode', $1, 'Whether the app is in beta mode'),
31124
31124
  ('require_invite_code', $2, 'Whether an invite code is required to sign up'),
31125
31125
  ('beta_message', $3, 'Message displayed during beta')
31126
31126
  ON CONFLICT (key) DO NOTHING
31127
- `, [
31128
- String(this.config.defaultBetaMode),
31129
- String(this.config.defaultRequireInviteCode),
31130
- this.config.defaultBetaMessage
31131
- ]);
31127
+ `,
31128
+ [
31129
+ String(this.config.defaultBetaMode),
31130
+ String(this.config.defaultRequireInviteCode),
31131
+ this.config.defaultBetaMessage
31132
+ ]
31133
+ );
31132
31134
  await client.query(`
31133
31135
  CREATE TABLE IF NOT EXISTS ${this.t("beta_invites")} (
31134
31136
  id VARCHAR(255) PRIMARY KEY,
@@ -31203,7 +31205,10 @@ var PostgresBeta = class {
31203
31205
  updates.push({ key: "beta_mode", value: String(options.betaMode) });
31204
31206
  }
31205
31207
  if (options.requireInviteCode !== void 0) {
31206
- updates.push({ key: "require_invite_code", value: String(options.requireInviteCode) });
31208
+ updates.push({
31209
+ key: "require_invite_code",
31210
+ value: String(options.requireInviteCode)
31211
+ });
31207
31212
  }
31208
31213
  if (options.betaMessage !== void 0) {
31209
31214
  updates.push({ key: "beta_message", value: options.betaMessage });
@@ -31262,7 +31267,9 @@ var PostgresBeta = class {
31262
31267
  }
31263
31268
  }
31264
31269
  if (!inserted) {
31265
- throw new Error(`Failed to generate unique code after ${attempts} attempts`);
31270
+ throw new Error(
31271
+ `Failed to generate unique code after ${attempts} attempts`
31272
+ );
31266
31273
  }
31267
31274
  if (options.code) break;
31268
31275
  }
@@ -31373,7 +31380,10 @@ var PostgresBeta = class {
31373
31380
  return { valid: false, message: "This invite code has expired." };
31374
31381
  }
31375
31382
  if (existRow.current_uses >= existRow.max_uses) {
31376
- return { valid: false, message: "This invite code has reached its usage limit." };
31383
+ return {
31384
+ valid: false,
31385
+ message: "This invite code has reached its usage limit."
31386
+ };
31377
31387
  }
31378
31388
  return { valid: false, message: "Invalid invite code." };
31379
31389
  }