@absolutejs/absolute 0.20.0-beta.44 → 0.20.0-beta.45

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.js CHANGED
@@ -13618,7 +13618,7 @@ var init_deviceCapabilities = __esm(() => {
13618
13618
  });
13619
13619
 
13620
13620
  // node_modules/@absolutejs/sync/dist/client/index.js
13621
- var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")) && Array.isArray(Reflect.get(value, "clients")), registry, SyncLocalDataPolicyError, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
13621
+ var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations")) && Array.isArray(Reflect.get(value, "clients")), registry, pools, SyncLocalDataPolicyError, SyncLocalStoreSchemaError, positiveVersion = (value, label) => {
13622
13622
  if (!Number.isSafeInteger(value) || value < 1)
13623
13623
  throw new SyncLocalStoreSchemaError("INVALID_PLAN", `${label} must be a positive safe integer`);
13624
13624
  return value;
@@ -13723,6 +13723,7 @@ var init_client = __esm(() => {
13723
13723
  });
13724
13724
  return created;
13725
13725
  })();
13726
+ pools = new Map;
13726
13727
  SyncLocalDataPolicyError = class SyncLocalDataPolicyError extends Error {
13727
13728
  code;
13728
13729
  constructor(code, message) {
@@ -31070,7 +31071,7 @@ var init_requestInspector = __esm(() => {
31070
31071
  // src/mobile/nativeAuth.ts
31071
31072
  import { readFileSync as readFileSync34 } from "fs";
31072
31073
  import { join as join52 } from "path";
31073
- var ABSOLUTE_AUTH_PACKAGE = "@absolutejs/auth", ABSOLUTE_EXPO_AUTH_CORE_VERSION = "0.75.6", ABSOLUTE_EXPO_AUTH_PACKAGE = "@absolutejs/auth-expo", ABSOLUTE_EXPO_AUTH_VERSION = "0.0.2", ABSOLUTE_NATIVE_AUTH_CLIENTS_ENV = "ABSOLUTE_AUTH_NATIVE_CLIENTS", ABSOLUTE_NATIVE_AUTH_SCOPES, ABSOLUTE_SYNC_PACKAGE = "@absolutejs/sync", readPackageManifest = (projectRoot) => {
31074
+ var ABSOLUTE_AUTH_PACKAGE = "@absolutejs/auth", ABSOLUTE_EXPO_AUTH_CORE_VERSION = "0.75.6", ABSOLUTE_EXPO_AUTH_PACKAGE = "@absolutejs/auth-expo", ABSOLUTE_EXPO_AUTH_VERSION = "0.0.2", ABSOLUTE_EXPO_SYNC_CORE_VERSION = "2.31.0", ABSOLUTE_EXPO_SYNC_PACKAGE = "@absolutejs/sync-expo", ABSOLUTE_EXPO_SYNC_VERSION = "0.0.2", ABSOLUTE_NATIVE_AUTH_CLIENTS_ENV = "ABSOLUTE_AUTH_NATIVE_CLIENTS", ABSOLUTE_NATIVE_AUTH_SCOPES, ABSOLUTE_SYNC_PACKAGE = "@absolutejs/sync", readPackageManifest = (projectRoot) => {
31074
31075
  try {
31075
31076
  return JSON.parse(readFileSync34(join52(projectRoot, "package.json"), "utf8"));
31076
31077
  } catch {
@@ -31120,13 +31121,24 @@ __export(exports_devDeviceAdapter, {
31120
31121
  import { access as access3, mkdtemp as mkdtemp3, rm as rm15, writeFile as writeFile9 } from "fs/promises";
31121
31122
  import { join as join53 } from "path";
31122
31123
  import { tmpdir } from "os";
31123
- var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (specifier) => specifier, expoAdapterModule = "@absolutejs/absolute/mobile/expo-devices", expoAuthModule = "@absolutejs/absolute/mobile/expo-auth") => {
31124
+ var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (specifier) => specifier, expoAdapterModule = "@absolutejs/absolute/mobile/expo-devices", expoAuthModule = "@absolutejs/absolute/mobile/expo-auth", expoSyncModule = "@absolutejs/absolute/mobile/expo-sync") => {
31124
31125
  if ((mobile.engine ?? "capacitor") === "expo") {
31125
- const auth = projectUsesAbsoluteAuth(projectRoot) ? resolveAbsoluteMobileAuthManifest(projectRoot, normalizeAbsoluteMobileConfig(mobile, projectRoot)) : undefined;
31126
+ const normalized = normalizeAbsoluteMobileConfig(mobile, projectRoot);
31127
+ const auth = projectUsesAbsoluteAuth(projectRoot) ? resolveAbsoluteMobileAuthManifest(projectRoot, normalized) : undefined;
31128
+ const sync = Boolean(auth && projectUsesAbsoluteSync(projectRoot));
31129
+ const syncConfig = sync ? {
31130
+ background: {
31131
+ endpoint: new URL("/__absolute/sync/background", normalized.productionOrigin).href,
31132
+ intervalMinutes: 15
31133
+ },
31134
+ socketTickets: true,
31135
+ storageSchema: discoverAbsoluteSyncSchema(projectRoot)
31136
+ } : undefined;
31126
31137
  return `import { installAbsoluteExpoWebDeviceAdapter } from ${JSON.stringify(expoAdapterModule)};
31127
31138
  ${auth ? `import { createAbsoluteExpoShellAuth } from ${JSON.stringify(expoAuthModule)};` : ""}
31139
+ ${sync ? `import { installAbsoluteExpoShellSync } from ${JSON.stringify(expoSyncModule)};` : ""}
31128
31140
  installAbsoluteExpoWebDeviceAdapter();
31129
- ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).catch(error => console.error('[Absolute Mobile] Expo Auth initialization failed:', error));` : ""}`;
31141
+ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth => { ${sync ? `installAbsoluteExpoShellSync(auth, ${JSON.stringify(syncConfig)});` : ""} }).catch(error => console.error('[Absolute Mobile] Expo runtime initialization failed:', error));` : ""}`;
31130
31142
  }
31131
31143
  const plan = resolveAbsoluteDeviceCapabilityPlan(projectRoot);
31132
31144
  const imports = plan.capabilities.map((name, index) => {
@@ -31170,11 +31182,25 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).catch(error
31170
31182
  if (path)
31171
31183
  return path;
31172
31184
  throw new TypeError("The AbsoluteJS Expo Auth development adapter is missing.");
31185
+ }, expoSyncPath = async () => {
31186
+ const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
31187
+ const path2 = join53(import.meta.dir, `shellExpoSync.${extension}`);
31188
+ try {
31189
+ await access3(path2);
31190
+ return path2;
31191
+ } catch {
31192
+ return;
31193
+ }
31194
+ }));
31195
+ const path = candidates.find((candidate) => candidate !== undefined);
31196
+ if (path)
31197
+ return path;
31198
+ throw new TypeError("The AbsoluteJS Expo Sync development adapter is missing.");
31173
31199
  }, buildAbsoluteNativeDevAdapter = async (projectRoot, mobile) => {
31174
31200
  const temporaryDirectory = await mkdtemp3(join53(tmpdir(), "absolutejs-native-dev-adapter-"));
31175
31201
  const entry = join53(temporaryDirectory, "entry.ts");
31176
31202
  try {
31177
- await writeFile9(entry, absoluteNativeDevAdapterSource(projectRoot, mobile, (specifier) => Bun.resolveSync(specifier, projectRoot), await expoAdapterPath(), await expoAuthPath()));
31203
+ await writeFile9(entry, absoluteNativeDevAdapterSource(projectRoot, mobile, (specifier) => Bun.resolveSync(specifier, projectRoot), await expoAdapterPath(), await expoAuthPath(), await expoSyncPath()));
31178
31204
  const result = await Bun.build({
31179
31205
  entrypoints: [entry],
31180
31206
  format: "esm",
@@ -31193,6 +31219,7 @@ var init_devDeviceAdapter = __esm(() => {
31193
31219
  init_config();
31194
31220
  init_deviceCapabilities();
31195
31221
  init_nativeAuth();
31222
+ init_syncSchema();
31196
31223
  });
31197
31224
 
31198
31225
  // src/core/prerender.ts
@@ -40994,5 +41021,5 @@ export {
40994
41021
  wrapPageHandlerWithStreamingSlots
40995
41022
  };
40996
41023
 
40997
- //# debugId=9F0F483ABB21912064756E2164756E21
41024
+ //# debugId=76855C3AD6EAC66164756E2164756E21
40998
41025
  //# sourceMappingURL=index.js.map