@absolutejs/absolute 0.20.0-beta.16 → 0.20.0-beta.18

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,19 +1,11 @@
1
1
  // src/mobile/shellAuth.ts
2
2
  import { lifecycle, links, secureStorage } from "@absolutejs/devices";
3
- import { installCapacitorDeviceAdapter } from "@absolutejs/devices-capacitor";
4
3
  import {
5
4
  createMobileAuthClient,
6
5
  createMobileAuthTransport,
7
6
  installAuthClientRuntimeTransport
8
7
  } from "@absolutejs/auth/client/mobile";
9
- var installed = false;
10
8
  var createAbsoluteMobileShellAuth = async (config) => {
11
- if (!installed) {
12
- installCapacitorDeviceAdapter({
13
- storagePrefix: `absolutejs.${config.clientId}.`
14
- });
15
- installed = true;
16
- }
17
9
  const client = createMobileAuthClient({
18
10
  allowedOrigins: [config.issuer],
19
11
  clientId: config.clientId,
@@ -8,6 +8,46 @@ import {
8
8
  installCapacitorSyncLifecycle
9
9
  } from "@absolutejs/sync-capacitor";
10
10
  import { installSyncClientRuntimeTransport } from "@absolutejs/sync/client/runtime";
11
+
12
+ // src/mobile/syncRemediation.ts
13
+ import {
14
+ discardSyncRuntimeDeadLetter,
15
+ inspectSyncRuntime,
16
+ rebaseSyncRuntimeDeadLetter,
17
+ retrySyncRuntimeDeadLetter
18
+ } from "@absolutejs/sync/client/runtime";
19
+ var REMEDIATION_REGISTRY = Symbol.for("@absolutejs/mobile-sync-remediation");
20
+ var isRegistry = (value) => typeof value === "object" && value !== null && Array.isArray(Reflect.get(value, "installations"));
21
+ var resolveRegistry = () => {
22
+ const existing = Reflect.get(globalThis, REMEDIATION_REGISTRY);
23
+ if (isRegistry(existing))
24
+ return existing;
25
+ const created = { installations: [] };
26
+ Object.defineProperty(globalThis, REMEDIATION_REGISTRY, {
27
+ configurable: false,
28
+ enumerable: false,
29
+ value: created,
30
+ writable: false
31
+ });
32
+ return created;
33
+ };
34
+ var registry = resolveRegistry();
35
+ var installAbsoluteMobileSyncRemediation = (bridge = {
36
+ discard: discardSyncRuntimeDeadLetter,
37
+ inspect: inspectSyncRuntime,
38
+ rebase: rebaseSyncRuntimeDeadLetter,
39
+ retry: retrySyncRuntimeDeadLetter
40
+ }) => {
41
+ const installation = { bridge };
42
+ registry.installations.push(installation);
43
+ return () => {
44
+ const index = registry.installations.indexOf(installation);
45
+ if (index >= 0)
46
+ registry.installations.splice(index, 1);
47
+ };
48
+ };
49
+
50
+ // src/mobile/shellSync.ts
11
51
  var reloadShell = () => globalThis.location.reload();
12
52
  var ABSOLUTE_MOBILE_SYNC_STATUS_EVENT = "absolute:sync-status";
13
53
  var reportShellStatus = (status) => globalThis.dispatchEvent(new CustomEvent(ABSOLUTE_MOBILE_SYNC_STATUS_EVENT, { detail: status }));
@@ -61,6 +101,7 @@ var installAbsoluteMobileShellSync = (auth, config, options = {}) => {
61
101
  };
62
102
  }
63
103
  });
104
+ const removeRemediation = installAbsoluteMobileSyncRemediation();
64
105
  const reload = options.reload ?? reloadShell;
65
106
  const removePrincipalListener = auth.onPrincipalChange((principal) => {
66
107
  if (principal?.namespace !== namespace)
@@ -72,6 +113,7 @@ var installAbsoluteMobileShellSync = (auth, config, options = {}) => {
72
113
  return;
73
114
  active = false;
74
115
  removePrincipalListener();
116
+ removeRemediation();
75
117
  removeTransport();
76
118
  };
77
119
  };
@@ -1,2 +1,3 @@
1
1
  export * from './client';
2
2
  export * from './pageProtocol';
3
+ export * from './syncRemediation';
@@ -2,11 +2,14 @@ import type { NormalizedAbsoluteMobileConfig } from './config';
2
2
  import type { AbsoluteMobileCompatibilityArtifact } from './releaseArtifact';
3
3
  import type { AbsoluteMobileAuthManifest } from './nativeAuth';
4
4
  import type { SyncLocalStoreSchemaBundle } from '@absolutejs/sync/client';
5
+ import type { AbsoluteDeviceCapabilityPlan } from './deviceCapabilities';
5
6
  export type AbsoluteCapacitorBundleOptions = {
6
7
  artifact: AbsoluteMobileCompatibilityArtifact;
7
8
  auth?: AbsoluteMobileAuthManifest;
8
9
  buildDirectory: string;
9
10
  config: NormalizedAbsoluteMobileConfig;
11
+ deviceCapabilities: AbsoluteDeviceCapabilityPlan;
12
+ projectRoot: string;
10
13
  sync?: boolean;
11
14
  syncSchema?: SyncLocalStoreSchemaBundle;
12
15
  };
@@ -23,6 +26,7 @@ export declare const materializeAbsoluteCapacitorWebBundle: (options: AbsoluteCa
23
26
  appName: string;
24
27
  deepLinkHosts: string[];
25
28
  deepLinkScheme: string | undefined;
29
+ deviceCapabilities: string[];
26
30
  entry: string;
27
31
  format: 1;
28
32
  pages: {
@@ -0,0 +1,20 @@
1
+ export type AbsoluteDeviceCapabilityProvider = {
2
+ factory: string;
3
+ module: string;
4
+ packages: string[];
5
+ };
6
+ export type AbsoluteDeviceCapabilityPlan = {
7
+ capabilities: string[];
8
+ providers: Record<string, AbsoluteDeviceCapabilityProvider>;
9
+ requiredPackages: string[];
10
+ };
11
+ export declare const loadAbsoluteDeviceCapabilityProviders: (projectRoot: string) => {
12
+ [k: string]: AbsoluteDeviceCapabilityProvider;
13
+ };
14
+ export declare const assertAbsoluteDeviceCapabilityPackages: (projectRoot: string, plan: AbsoluteDeviceCapabilityPlan) => void;
15
+ export declare const directAbsoluteProjectPackages: (projectRoot: string) => Set<string>;
16
+ export declare const discoverAbsoluteDeviceCapabilities: (projectRoot: string, providers?: {
17
+ [k: string]: AbsoluteDeviceCapabilityProvider;
18
+ }) => string[];
19
+ export declare const missingAbsoluteDeviceCapabilityPackages: (plan: AbsoluteDeviceCapabilityPlan, directPackages: ReadonlySet<string>) => string[];
20
+ export declare const resolveAbsoluteDeviceCapabilityPlan: (projectRoot: string) => AbsoluteDeviceCapabilityPlan;
@@ -11,6 +11,8 @@ export * from './buildPipeline';
11
11
  export * from './buildRelease';
12
12
  export * from './capacitorBundle';
13
13
  export * from './syncSchema';
14
+ export * from './syncRemediation';
15
+ export * from './deviceCapabilities';
14
16
  export * from './capacitorProject';
15
17
  export * from './config';
16
18
  export * from './client';
@@ -0,0 +1,10 @@
1
+ import { type SyncRuntimeInspection } from '@absolutejs/sync/client/runtime';
2
+ export type AbsoluteMobileSyncRemediation = {
3
+ discard: (operationId: string) => Promise<void>;
4
+ inspect: () => Promise<SyncRuntimeInspection>;
5
+ rebase: (operationId: string, args: unknown) => Promise<string>;
6
+ retry: (operationId: string) => Promise<void>;
7
+ };
8
+ /** Install the native shell's framework-neutral, redacted remediation bridge. */
9
+ export declare const getAbsoluteMobileSyncRemediation: () => AbsoluteMobileSyncRemediation | undefined;
10
+ export declare const installAbsoluteMobileSyncRemediation: (bridge?: AbsoluteMobileSyncRemediation) => () => void;
@@ -15,6 +15,7 @@ export type AbsoluteMobileClientManifest = {
15
15
  appName: string;
16
16
  deepLinkHosts: string[];
17
17
  deepLinkScheme?: string;
18
+ deviceCapabilities: string[];
18
19
  entry: string;
19
20
  format: typeof ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT;
20
21
  pages: AbsoluteMobileClientPage[];
package/package.json CHANGED
@@ -8,9 +8,9 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@absolutejs/auth": "0.72.0",
11
- "@absolutejs/devices": "0.0.3",
12
- "@absolutejs/devices-capacitor": "0.1.3",
13
- "@absolutejs/pwa": "0.12.0",
11
+ "@absolutejs/devices": "0.1.0",
12
+ "@absolutejs/devices-capacitor": "0.2.0",
13
+ "@absolutejs/pwa": "0.13.0",
14
14
  "@capacitor/browser": "8.0.4",
15
15
  "@capacitor/network": "8.0.1",
16
16
  "@capacitor/preferences": "8.0.1",
@@ -26,8 +26,8 @@
26
26
  "devDependencies": {
27
27
  "@absolutejs/manifest": "0.9.0",
28
28
  "@absolutejs/scoped-state": "0.2.2",
29
- "@absolutejs/sync": "2.28.0",
30
- "@absolutejs/sync-capacitor": "0.7.0",
29
+ "@absolutejs/sync": "2.29.0",
30
+ "@absolutejs/sync-capacitor": "0.8.0",
31
31
  "@angular/animations": "21.2.6",
32
32
  "@angular/cdk": "21.2.6",
33
33
  "@angular/common": "21.2.6",
@@ -45,8 +45,11 @@
45
45
  "@capacitor/android": "8.5.0",
46
46
  "@capacitor/app": "8.1.1",
47
47
  "@capacitor/cli": "8.5.0",
48
+ "@capacitor/clipboard": "8.0.1",
48
49
  "@capacitor/core": "8.5.0",
50
+ "@capacitor/haptics": "8.0.2",
49
51
  "@capacitor/ios": "8.5.0",
52
+ "@capacitor/share": "8.0.1",
50
53
  "@embroider/macros": "^1.20.2",
51
54
  "@eslint/js": "^10.0.1",
52
55
  "@glimmer/component": "^2.1.1",
@@ -275,12 +278,12 @@
275
278
  "main": "./dist/index.js",
276
279
  "name": "@absolutejs/absolute",
277
280
  "optionalDependencies": {
278
- "@absolutejs/native-darwin-arm64": "0.20.0-beta.16",
279
- "@absolutejs/native-darwin-x64": "0.20.0-beta.16",
280
- "@absolutejs/native-linux-arm64": "0.20.0-beta.16",
281
- "@absolutejs/native-linux-x64": "0.20.0-beta.16",
282
- "@absolutejs/native-windows-arm64": "0.20.0-beta.16",
283
- "@absolutejs/native-windows-x64": "0.20.0-beta.16"
281
+ "@absolutejs/native-darwin-arm64": "0.20.0-beta.18",
282
+ "@absolutejs/native-darwin-x64": "0.20.0-beta.18",
283
+ "@absolutejs/native-linux-arm64": "0.20.0-beta.18",
284
+ "@absolutejs/native-linux-x64": "0.20.0-beta.18",
285
+ "@absolutejs/native-windows-arm64": "0.20.0-beta.18",
286
+ "@absolutejs/native-windows-x64": "0.20.0-beta.18"
284
287
  },
285
288
  "overrides": {
286
289
  "@sinclair/typebox": "0.34.52",
@@ -290,7 +293,7 @@
290
293
  "typebox": "1.3.16"
291
294
  },
292
295
  "peerDependencies": {
293
- "@absolutejs/sync": ">=2.28.0 <3",
296
+ "@absolutejs/sync": ">=2.29.0 <3",
294
297
  "@angular/animations": "^21.0.0",
295
298
  "@angular/common": "^21.0.0",
296
299
  "@angular/compiler": "^21.0.0",
@@ -491,7 +494,7 @@
491
494
  ]
492
495
  }
493
496
  },
494
- "version": "0.20.0-beta.16",
497
+ "version": "0.20.0-beta.18",
495
498
  "workspaces": [
496
499
  "tests/fixtures/*",
497
500
  "tests/fixtures/_packages/*"