@absolutejs/absolute 0.20.0-beta.81 → 0.20.0-beta.82

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-0xCaBl/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-hdmKLU/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-0xCaBl/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-hdmKLU/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-0xCaBl/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-hdmKLU/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
package/dist/build.js CHANGED
@@ -28772,10 +28772,10 @@ var MOBILE_UPDATE_REGISTRY_FORMAT = 1, DEFAULT_PREFIX = "absolutejs/mobile-updat
28772
28772
  cacheControl: "public, max-age=31536000, immutable",
28773
28773
  contentType: "application/octet-stream",
28774
28774
  maxBytes: file5.bytes,
28775
- metadata: { releaseId: manifest.releaseId, sha256: file5.sha256 },
28775
+ metadata: { releaseid: manifest.releaseId, sha256: file5.sha256 },
28776
28776
  signal: input.signal
28777
28777
  });
28778
- } else if (stored.size !== file5.bytes || stored.metadata?.sha256 !== file5.sha256 || stored.metadata?.releaseId !== manifest.releaseId)
28778
+ } else if (stored.size !== file5.bytes || stored.metadata?.sha256 !== file5.sha256 || (stored.metadata?.releaseid ?? stored.metadata?.releaseId) !== manifest.releaseId)
28779
28779
  throw new MobileUpdateRegistryError("Stored mobile update file identity changed");
28780
28780
  }
28781
28781
  const bytes = json(manifest);
@@ -28783,7 +28783,7 @@ var MOBILE_UPDATE_REGISTRY_FORMAT = 1, DEFAULT_PREFIX = "absolutejs/mobile-updat
28783
28783
  cacheControl: "public, max-age=31536000, immutable",
28784
28784
  contentType: "application/json",
28785
28785
  maxBytes: bytes.byteLength,
28786
- metadata: { releaseId: manifest.releaseId, sha256: digest(bytes) },
28786
+ metadata: { releaseid: manifest.releaseId, sha256: digest(bytes) },
28787
28787
  signal: input.signal
28788
28788
  });
28789
28789
  if (!await readManifest2(manifest.appId, manifest.releaseId))
@@ -28856,7 +28856,7 @@ var MOBILE_UPDATE_REGISTRY_FORMAT = 1, DEFAULT_PREFIX = "absolutejs/mobile-updat
28856
28856
  ]);
28857
28857
  if (!bytes || !head)
28858
28858
  return null;
28859
- if (bytes.byteLength !== file5.bytes || head.size !== file5.bytes || head.metadata?.sha256 !== file5.sha256 || head.metadata?.releaseId !== release.manifest.releaseId || digest(bytes) !== file5.sha256)
28859
+ if (bytes.byteLength !== file5.bytes || head.size !== file5.bytes || head.metadata?.sha256 !== file5.sha256 || (head.metadata?.releaseid ?? head.metadata?.releaseId) !== release.manifest.releaseId || digest(bytes) !== file5.sha256)
28860
28860
  throw new MobileUpdateRegistryError("Stored mobile update file integrity failed");
28861
28861
  return { bytes, file: file5 };
28862
28862
  }
@@ -29215,10 +29215,27 @@ var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MOD
29215
29215
  const registry2 = loaded.default ?? loaded.registry;
29216
29216
  if (!isRegistry2(registry2))
29217
29217
  throw new TypeError("Mobile update registry must implement publication, promotion, rollback, resolution, and file reads.");
29218
+ const metadata = serverMetadata(loaded.absoluteMobileUpdateServer);
29219
+ const verifier = loaded.verifyAbsoluteMobileUpdateServer;
29220
+ if (metadata.storage === "durable" && typeof verifier !== "function")
29221
+ throw new TypeError("Mobile update registries marked durable must export verifyAbsoluteMobileUpdateServer(). Re-run `absolute mobile update provision --storage s3 --force` or provide an active durability check.");
29218
29222
  return {
29219
- metadata: serverMetadata(loaded.absoluteMobileUpdateServer),
29220
- registry: registry2
29223
+ metadata,
29224
+ registry: registry2,
29225
+ ...typeof verifier === "function" ? {
29226
+ verifyDurability: async () => {
29227
+ await verifier();
29228
+ }
29229
+ } : {}
29221
29230
  };
29231
+ }, verifyDurableModule = async (module) => {
29232
+ if (module.metadata.storage !== "durable")
29233
+ throw new TypeError("Mobile production updates require durable object storage. Re-run `absolute mobile update provision --storage s3 --force` or configure a durable adapter.");
29234
+ try {
29235
+ await module.verifyDurability?.();
29236
+ } catch (error) {
29237
+ throw new TypeError(`Durable mobile update storage verification failed for ${module.metadata.provider}. Check the bucket, endpoint, credentials, and read/write/delete permissions.`, { cause: error });
29238
+ }
29222
29239
  }, expoSigningOptions = (config) => {
29223
29240
  if (!config.updates?.expoCodeSigning)
29224
29241
  return;
@@ -29250,8 +29267,8 @@ var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MOD
29250
29267
  if (!updates || !server?.autoMount)
29251
29268
  return new Elysia5({ name: "absolutejs-mobile-updates-disabled" });
29252
29269
  const module = await loadAbsoluteMobileUpdateServerModule(projectRoot, server.registryModule);
29253
- if (options.production && module.metadata.storage !== "durable")
29254
- throw new TypeError("Mobile production updates require durable object storage. Re-run `absolute mobile update provision --storage s3 --force` or configure a durable adapter.");
29270
+ if (options.production)
29271
+ await verifyDurableModule(module);
29255
29272
  const manifest = new URL(updates.manifestUrl);
29256
29273
  if (!manifest.pathname.endsWith("/update.json"))
29257
29274
  throw new TypeError("Auto-mounted mobile update manifests must end in /update.json.");
@@ -29269,8 +29286,7 @@ var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MOD
29269
29286
  if (!config.updates)
29270
29287
  return;
29271
29288
  const module = await loadAbsoluteMobileUpdateServerModule(projectRoot, config.updateServer?.registryModule);
29272
- if (module.metadata.storage !== "durable")
29273
- throw new TypeError("Mobile production updates require durable object storage; the configured registry is local-only.");
29289
+ await verifyDurableModule(module);
29274
29290
  if (config.engine === "expo")
29275
29291
  expoSigningOptions(config);
29276
29292
  return module.metadata;
@@ -29297,7 +29313,8 @@ export default createMobileUpdateRegistry({
29297
29313
  store
29298
29314
  });
29299
29315
  `;
29300
- return `import { S3Client } from '@aws-sdk/client-s3';
29316
+ return `import { randomUUID } from 'node:crypto';
29317
+ import { DeleteObjectCommand, GetObjectCommand, PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
29301
29318
  import { awsS3BlobStore } from '@absolutejs/blob/aws-s3';
29302
29319
  import { createMobileUpdateRegistry } from '@absolutejs/deploy/mobile-update';
29303
29320
 
@@ -29309,6 +29326,7 @@ const required = (name: string) => {
29309
29326
  return value;
29310
29327
  };
29311
29328
 
29329
+ const bucket = required('ABSOLUTE_MOBILE_UPDATE_S3_BUCKET');
29312
29330
  const client = new S3Client({
29313
29331
  region: process.env.ABSOLUTE_MOBILE_UPDATE_S3_REGION ?? 'auto',
29314
29332
  forcePathStyle: process.env.ABSOLUTE_MOBILE_UPDATE_S3_FORCE_PATH_STYLE === '1',
@@ -29316,10 +29334,22 @@ const client = new S3Client({
29316
29334
  ? { endpoint: process.env.ABSOLUTE_MOBILE_UPDATE_S3_ENDPOINT }
29317
29335
  : {})
29318
29336
  });
29319
- const store = awsS3BlobStore({
29320
- bucket: required('ABSOLUTE_MOBILE_UPDATE_S3_BUCKET'),
29321
- client
29322
- });
29337
+ const store = awsS3BlobStore({ bucket, client });
29338
+
29339
+ export const verifyAbsoluteMobileUpdateServer = async () => {
29340
+ const key = \`absolutejs/mobile-updates/_health/\${randomUUID()}\`;
29341
+ const expected = randomUUID();
29342
+ let stored = false;
29343
+ try {
29344
+ await client.send(new PutObjectCommand({ Bucket: bucket, Key: key, Body: expected }));
29345
+ stored = true;
29346
+ const response = await client.send(new GetObjectCommand({ Bucket: bucket, Key: key }));
29347
+ if ((await response.Body?.transformToString()) !== expected)
29348
+ throw new Error('Durability probe read did not match its write.');
29349
+ } finally {
29350
+ if (stored) await client.send(new DeleteObjectCommand({ Bucket: bucket, Key: key }));
29351
+ }
29352
+ };
29323
29353
 
29324
29354
  export default createMobileUpdateRegistry({
29325
29355
  publicKeys: ${publicKeysSource(options.publicKeys)},
@@ -36939,5 +36969,5 @@ export {
36939
36969
  devBuild
36940
36970
  };
36941
36971
 
36942
- //# debugId=C21B5771D51EC59A64756E2164756E21
36972
+ //# debugId=7849DC008DCD28AC64756E2164756E21
36943
36973
  //# sourceMappingURL=build.js.map