@absolutejs/absolute 0.20.0-beta.29 → 0.20.0-beta.30

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-iocRFr/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-rkRhCL/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-iocRFr/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-rkRhCL/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-iocRFr/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-rkRhCL/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/cli/index.js CHANGED
@@ -18044,7 +18044,7 @@ var init_iosConformance = __esm(() => {
18044
18044
  // src/mobile/nativeTestReport.ts
18045
18045
  import { mkdir as mkdir13, readFile as readFile18, writeFile as writeFile15 } from "fs/promises";
18046
18046
  import { join as join51 } from "path";
18047
- var secretPattern, bearerPattern, coordinatePattern, sanitizeNativeReportText = (value) => value.replace(bearerPattern, "Bearer [REDACTED]").replace(secretPattern, "$1$2[REDACTED]").replace(coordinatePattern, "$1$2[REDACTED]").replace(/(https?:\/\/[^\s?#]+)[?#][^\s]*/giu, "$1?[REDACTED]"), markdownCell = (value) => sanitizeNativeReportText(value).replaceAll("|", "\\|").replaceAll(`
18047
+ var secretPattern, bearerPattern, coordinatePattern, nativeCredentialPattern, sanitizeNativeReportText = (value) => value.replace(nativeCredentialPattern, "[REDACTED]").replace(bearerPattern, "Bearer [REDACTED]").replace(secretPattern, "$1$2[REDACTED]").replace(coordinatePattern, "$1$2[REDACTED]").replace(/(https?:\/\/[^\s?#]+)[?#][^\s]*/giu, "$1?[REDACTED]"), markdownCell = (value) => sanitizeNativeReportText(value).replaceAll("|", "\\|").replaceAll(`
18048
18048
  `, "<br>"), createAbsoluteNativeAutomatedChecks = (run) => {
18049
18049
  const target = `${run.targetKind} ${run.targetId}`;
18050
18050
  const evidence = run.screenshot ? `Screenshot: ${run.screenshot}` : undefined;
@@ -18094,6 +18094,18 @@ var secretPattern, bearerPattern, coordinatePattern, sanitizeNativeReportText =
18094
18094
  result: upgrade.compatibility.nPlusOne === "compatible" && upgrade.compatibility.nPlusTwo === "compatible" && upgrade.compatibility.nPlusThree === "upgrade-required" && upgrade.compatibility.rollback === "compatible" ? "PASS" : "FAIL"
18095
18095
  });
18096
18096
  }
18097
+ if (run.syncMigration) {
18098
+ const { syncMigration } = run;
18099
+ checks.push({
18100
+ details: `Generated SQLite migration deliberately failed with ${syncMigration.failedAttempt.code}, then reached schema ${syncMigration.recovery.storedVersion}/${syncMigration.recovery.targetVersion} after correction in ${syncMigration.durationMs}ms.`,
18101
+ id: "AUTO-MIGRATE-01",
18102
+ result: syncMigration.outcome === "pass" ? "PASS" : "FAIL"
18103
+ }, {
18104
+ details: `Transaction rollback: ${syncMigration.state.rollbackPreserved ? "preserved" : "not preserved"}; corrected schema advancement: ${syncMigration.state.schemaAdvanced ? "observed" : "missing"}; Auth credential: ${syncMigration.state.authCredential ? "preserved" : "missing"}; pending operations: ${syncMigration.state.pendingOperations ? "preserved" : "missing"}.`,
18105
+ id: "AUTO-MIGRATE-02",
18106
+ result: Object.values(syncMigration.state).every(Boolean) ? "PASS" : "FAIL"
18107
+ });
18108
+ }
18097
18109
  return checks;
18098
18110
  }, createAbsoluteNativeTestReport = (options) => ({
18099
18111
  automatedChecks: options.automatedChecks ?? createAbsoluteNativeAutomatedChecks(options.run),
@@ -18159,6 +18171,7 @@ var init_nativeTestReport = __esm(() => {
18159
18171
  secretPattern = /(authorization|access[_ -]?token|refresh[_ -]?token|socket[_ -]?ticket|password|cookie)(\s*[=:]\s*)([^\s,;]+)/giu;
18160
18172
  bearerPattern = /bearer\s+[^\s,;]+/giu;
18161
18173
  coordinatePattern = /\b(latitude|longitude|lat|lng)(\s*[=:]\s*)-?\d+(?:\.\d+)?/giu;
18174
+ nativeCredentialPattern = /\b(?:access|refresh|ticket)-[a-z0-9-]+\b/giu;
18162
18175
  });
18163
18176
 
18164
18177
  // src/mobile/iosTestReport.ts
@@ -18327,6 +18340,14 @@ var init_androidTestReport = __esm(() => {
18327
18340
  "COMPAT-01",
18328
18341
  "Confirm installed app N works with retained N+1/N+2 producers, shows typed update-required at N+3, and recovers after server rollback."
18329
18342
  ],
18343
+ [
18344
+ "MIGRATE-01",
18345
+ "Install a generated local-schema upgrade in place and confirm cached rows, Auth, and pending operations survive."
18346
+ ],
18347
+ [
18348
+ "MIGRATE-02",
18349
+ "Confirm a failed local-schema migration rolls back atomically and a corrected forward build recovers without clearing app data."
18350
+ ],
18330
18351
  ["BUILD-01", "Pass release doctor and produce a signed AAB."],
18331
18352
  [
18332
18353
  "REPORT-01",
@@ -49,7 +49,49 @@ var installAbsoluteMobileSyncRemediation = (bridge = {
49
49
 
50
50
  // src/mobile/shellSync.ts
51
51
  var reloadShell = () => globalThis.location.reload();
52
+ var ABSOLUTE_MOBILE_SYNC_SCHEMA_EVENT = "absolute:sync-schema";
53
+ var ABSOLUTE_MOBILE_SYNC_SCHEMA_STATE_KEY = "absolutejs.mobile.sync.schema-state";
52
54
  var ABSOLUTE_MOBILE_SYNC_STATUS_EVENT = "absolute:sync-status";
55
+ var schemaStateSymbol = () => Symbol.for(ABSOLUTE_MOBILE_SYNC_SCHEMA_STATE_KEY);
56
+ var readAbsoluteMobileSyncSchemaState = () => {
57
+ const value = Reflect.get(globalThis, schemaStateSymbol());
58
+ if (typeof value !== "object" || value === null)
59
+ return;
60
+ const state = Reflect.get(value, "state");
61
+ if (state === "preparing")
62
+ return { state };
63
+ if (state === "failed")
64
+ return schemaFailureState(value);
65
+ const minimumCompatibleVersion = Reflect.get(value, "minimumCompatibleVersion");
66
+ const storedVersion = Reflect.get(value, "storedVersion");
67
+ const targetVersion = Reflect.get(value, "targetVersion");
68
+ if (state !== "ready" || typeof minimumCompatibleVersion !== "number" || typeof storedVersion !== "number" || typeof targetVersion !== "number")
69
+ return;
70
+ return {
71
+ minimumCompatibleVersion,
72
+ state,
73
+ storedVersion,
74
+ targetVersion
75
+ };
76
+ };
77
+ var reportShellSchemaState = (state) => {
78
+ Reflect.set(globalThis, schemaStateSymbol(), state);
79
+ globalThis.dispatchEvent(new CustomEvent(ABSOLUTE_MOBILE_SYNC_SCHEMA_EVENT, { detail: state }));
80
+ };
81
+ var schemaFailureState = (error) => {
82
+ if (typeof error !== "object" || error === null)
83
+ return { code: "UNKNOWN", state: "failed" };
84
+ const rawCode = Reflect.get(error, "code");
85
+ const code = rawCode === "INVALID_PLAN" || rawCode === "MIGRATION_MISSING" || rawCode === "SCHEMA_TOO_NEW" || rawCode === "SCHEMA_TOO_OLD" ? rawCode : "UNKNOWN";
86
+ const storedVersion = Reflect.get(error, "storedVersion");
87
+ const targetVersion = Reflect.get(error, "targetVersion");
88
+ return {
89
+ code,
90
+ state: "failed",
91
+ ...typeof storedVersion === "number" ? { storedVersion } : {},
92
+ ...typeof targetVersion === "number" ? { targetVersion } : {}
93
+ };
94
+ };
53
95
  var reportShellStatus = (status) => globalThis.dispatchEvent(new CustomEvent(ABSOLUTE_MOBILE_SYNC_STATUS_EVENT, { detail: status }));
54
96
  var installAbsoluteMobileShellSync = (auth, config, options = {}) => {
55
97
  const namespace = auth.principal?.namespace;
@@ -62,8 +104,13 @@ var installAbsoluteMobileShellSync = (auth, config, options = {}) => {
62
104
  }) : undefined;
63
105
  const installLifecycle = options.installLifecycle ?? installCapacitorSyncLifecycle;
64
106
  const reportStatus = options.reportStatus ?? reportShellStatus;
107
+ const reportSchemaState = options.reportSchemaState ?? reportShellSchemaState;
65
108
  const configureBackground = options.configureBackground ?? configureCapacitorBackgroundSync;
66
109
  const clearBackground = options.clearBackground ?? (() => AbsoluteBackgroundSync.clear());
110
+ if (store?.getSchemaStatus) {
111
+ reportSchemaState({ state: "preparing" });
112
+ store.getSchemaStatus().then(reportSchemaState).catch((error) => reportSchemaState(schemaFailureState(error)));
113
+ }
67
114
  if (namespace && config) {
68
115
  configureBackground({
69
116
  clientId: auth.clientId,
@@ -118,6 +165,9 @@ var installAbsoluteMobileShellSync = (auth, config, options = {}) => {
118
165
  };
119
166
  };
120
167
  export {
168
+ readAbsoluteMobileSyncSchemaState,
121
169
  installAbsoluteMobileShellSync,
122
- ABSOLUTE_MOBILE_SYNC_STATUS_EVENT
170
+ ABSOLUTE_MOBILE_SYNC_STATUS_EVENT,
171
+ ABSOLUTE_MOBILE_SYNC_SCHEMA_STATE_KEY,
172
+ ABSOLUTE_MOBILE_SYNC_SCHEMA_EVENT
123
173
  };
@@ -12,6 +12,25 @@ export type AbsoluteNativeHmrResult = {
12
12
  outcome: 'applied' | 'failed' | 'reloaded';
13
13
  serverMs?: number;
14
14
  };
15
+ export type AbsoluteNativeSyncMigrationResult = {
16
+ durationMs: number;
17
+ failedAttempt: {
18
+ code: 'INVALID_PLAN' | 'MIGRATION_MISSING' | 'SCHEMA_TOO_NEW' | 'SCHEMA_TOO_OLD' | 'UNKNOWN';
19
+ storedVersion?: number;
20
+ targetVersion?: number;
21
+ };
22
+ outcome: 'fail' | 'pass';
23
+ recovery: {
24
+ storedVersion: number;
25
+ targetVersion: number;
26
+ };
27
+ state: {
28
+ authCredential: boolean;
29
+ pendingOperations: boolean;
30
+ rollbackPreserved: boolean;
31
+ schemaAdvanced: boolean;
32
+ };
33
+ };
15
34
  export type AbsoluteNativeAutomatedRun = {
16
35
  appId: string;
17
36
  durationMs: number;
@@ -23,6 +42,7 @@ export type AbsoluteNativeAutomatedRun = {
23
42
  routes?: string[];
24
43
  screenshot?: string;
25
44
  status: 'fail' | 'pass';
45
+ syncMigration?: AbsoluteNativeSyncMigrationResult;
26
46
  targetId: string;
27
47
  targetKind: 'device' | 'emulator' | 'simulator';
28
48
  upgrade?: AbsoluteAndroidUpgradeConformanceResult;
@@ -1,5 +1,5 @@
1
1
  import { configureCapacitorBackgroundSync, type CapacitorSyncLifecycleOptions, type CapacitorSyncLocalStoreOptions } from '@absolutejs/sync-capacitor';
2
- import type { SyncClientStatus, SyncLocalStore } from '@absolutejs/sync/client';
2
+ import type { SyncClientStatus, SyncLocalStore, SyncLocalStoreSchemaStatus } from '@absolutejs/sync/client';
3
3
  import type { AbsoluteMobileShellAuthRuntime } from './shellBootstrap';
4
4
  import type { AbsoluteMobileClientManifest } from './transport';
5
5
  export type AbsoluteMobileShellSyncOptions = {
@@ -7,10 +7,38 @@ export type AbsoluteMobileShellSyncOptions = {
7
7
  installLifecycle?: (options: CapacitorSyncLifecycleOptions) => Promise<() => void>;
8
8
  reload?: () => void;
9
9
  reportStatus?: (status: SyncClientStatus) => void;
10
+ reportSchemaState?: (state: AbsoluteMobileSyncSchemaState) => void;
10
11
  configureBackground?: typeof configureCapacitorBackgroundSync;
11
12
  clearBackground?: () => Promise<void>;
12
13
  };
14
+ export declare const ABSOLUTE_MOBILE_SYNC_SCHEMA_EVENT = "absolute:sync-schema";
15
+ export declare const ABSOLUTE_MOBILE_SYNC_SCHEMA_STATE_KEY = "absolutejs.mobile.sync.schema-state";
13
16
  export declare const ABSOLUTE_MOBILE_SYNC_STATUS_EVENT = "absolute:sync-status";
17
+ export type AbsoluteMobileSyncSchemaFailureCode = 'INVALID_PLAN' | 'MIGRATION_MISSING' | 'SCHEMA_TOO_NEW' | 'SCHEMA_TOO_OLD' | 'UNKNOWN';
18
+ export type AbsoluteMobileSyncSchemaState = {
19
+ state: 'preparing';
20
+ } | SyncLocalStoreSchemaStatus | {
21
+ code: AbsoluteMobileSyncSchemaFailureCode;
22
+ state: 'failed';
23
+ storedVersion?: number;
24
+ targetVersion?: number;
25
+ };
26
+ export declare const readAbsoluteMobileSyncSchemaState: () => SyncLocalStoreSchemaStatus | {
27
+ code: AbsoluteMobileSyncSchemaFailureCode;
28
+ state: "failed";
29
+ storedVersion?: number;
30
+ targetVersion?: number;
31
+ } | {
32
+ state: any;
33
+ minimumCompatibleVersion?: undefined;
34
+ storedVersion?: undefined;
35
+ targetVersion?: undefined;
36
+ } | {
37
+ minimumCompatibleVersion: number;
38
+ state: any;
39
+ storedVersion: number;
40
+ targetVersion: number;
41
+ } | undefined;
14
42
  /**
15
43
  * Provisions unchanged Sync clients with native durability, Auth isolation, and
16
44
  * foreground/connectivity reconnects. An identity change reloads the shell so
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "@absolutejs/manifest": "0.9.0",
30
30
  "@absolutejs/scoped-state": "0.2.2",
31
31
  "@absolutejs/sync": "2.29.0",
32
- "@absolutejs/sync-capacitor": "0.9.1",
32
+ "@absolutejs/sync-capacitor": "0.9.2",
33
33
  "@angular/animations": "21.2.6",
34
34
  "@angular/cdk": "21.2.6",
35
35
  "@angular/common": "21.2.6",
@@ -503,7 +503,7 @@
503
503
  ]
504
504
  }
505
505
  },
506
- "version": "0.20.0-beta.29",
506
+ "version": "0.20.0-beta.30",
507
507
  "workspaces": [
508
508
  "tests/fixtures/*",
509
509
  "tests/fixtures/_packages/*"