@absolutejs/absolute 0.20.0-beta.7 → 0.20.0-beta.9
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/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/cli/index.js +209 -75
- package/dist/mobile/index.js +10 -2
- package/dist/mobile/index.js.map +4 -4
- package/dist/mobile/shellAuth.js +2 -0
- package/dist/mobile/shellBootstrap.js +1 -1
- package/dist/mobile/shellSync.js +25 -2
- package/dist/src/mobile/capacitorBundle.d.ts +4 -0
- package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
- package/dist/src/mobile/shellAuth.d.ts +2 -0
- package/dist/src/mobile/shellBootstrap.d.ts +3 -1
- package/dist/src/mobile/shellSync.d.ts +8 -3
- package/dist/src/mobile/transport.d.ts +4 -0
- package/package.json +13 -13
package/dist/mobile/shellAuth.js
CHANGED
|
@@ -29,7 +29,9 @@ var createAbsoluteMobileShellAuth = async (config) => {
|
|
|
29
29
|
const principal = await client.principal();
|
|
30
30
|
installAuthClientRuntimeTransport(createMobileAuthTransport(client, { baseUrl: config.issuer }));
|
|
31
31
|
return {
|
|
32
|
+
clientId: config.clientId,
|
|
32
33
|
fetch: client.fetchOptional,
|
|
34
|
+
issuer: config.issuer,
|
|
33
35
|
onPrincipalChange: client.onPrincipalChange,
|
|
34
36
|
principal,
|
|
35
37
|
redirectUri: config.redirectUri,
|
|
@@ -557,7 +557,7 @@ var startAbsoluteMobileShell = async (options = {}) => {
|
|
|
557
557
|
const manifest = await readManifest();
|
|
558
558
|
const auth = manifest.auth && options.createAuth ? await options.createAuth(manifest.auth) : undefined;
|
|
559
559
|
if (auth && manifest.sync?.socketTickets)
|
|
560
|
-
options.installSync?.(auth);
|
|
560
|
+
options.installSync?.(auth, manifest.sync);
|
|
561
561
|
let removeAnchorNavigation = () => {
|
|
562
562
|
return;
|
|
563
563
|
};
|
package/dist/mobile/shellSync.js
CHANGED
|
@@ -2,19 +2,40 @@
|
|
|
2
2
|
import { lifecycle, network } from "@absolutejs/devices";
|
|
3
3
|
import {
|
|
4
4
|
createCapacitorSyncLocalStore,
|
|
5
|
+
AbsoluteBackgroundSync,
|
|
6
|
+
configureCapacitorBackgroundSync,
|
|
5
7
|
installCapacitorSyncLifecycle
|
|
6
8
|
} from "@absolutejs/sync-capacitor";
|
|
7
9
|
import { installSyncClientRuntimeTransport } from "@absolutejs/sync/client/runtime";
|
|
8
10
|
var reloadShell = () => globalThis.location.reload();
|
|
9
|
-
var
|
|
11
|
+
var ABSOLUTE_MOBILE_SYNC_STATUS_EVENT = "absolute:sync-status";
|
|
12
|
+
var reportShellStatus = (status) => globalThis.dispatchEvent(new CustomEvent(ABSOLUTE_MOBILE_SYNC_STATUS_EVENT, { detail: status }));
|
|
13
|
+
var installAbsoluteMobileShellSync = (auth, config, options = {}) => {
|
|
10
14
|
const namespace = auth.principal?.namespace;
|
|
11
15
|
const store = namespace ? options.createStore?.() ?? createCapacitorSyncLocalStore() : undefined;
|
|
12
16
|
const installLifecycle = options.installLifecycle ?? installCapacitorSyncLifecycle;
|
|
17
|
+
const reportStatus = options.reportStatus ?? reportShellStatus;
|
|
18
|
+
const configureBackground = options.configureBackground ?? configureCapacitorBackgroundSync;
|
|
19
|
+
const clearBackground = options.clearBackground ?? (() => AbsoluteBackgroundSync.clear());
|
|
20
|
+
if (namespace && config) {
|
|
21
|
+
configureBackground({
|
|
22
|
+
clientId: auth.clientId,
|
|
23
|
+
endpoint: config.background.endpoint,
|
|
24
|
+
intervalMinutes: config.background.intervalMinutes,
|
|
25
|
+
issuer: auth.issuer,
|
|
26
|
+
namespace
|
|
27
|
+
}).catch((error) => console.error("[Absolute Mobile] Background Sync configuration failed:", error));
|
|
28
|
+
} else {
|
|
29
|
+
clearBackground().catch(() => {
|
|
30
|
+
return;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
13
33
|
const removeTransport = installSyncClientRuntimeTransport({
|
|
14
34
|
...namespace && store ? { durable: { namespace, store } } : {},
|
|
15
35
|
socketTicket: auth.socketTicket,
|
|
16
36
|
registerClient: (client) => {
|
|
17
37
|
let active2 = true;
|
|
38
|
+
const removeStatus = client.subscribeStatus(reportStatus);
|
|
18
39
|
const reportLifecycleFailure = (error) => console.error("[Absolute Mobile] Sync lifecycle installation failed:", error);
|
|
19
40
|
const removal = installLifecycle({
|
|
20
41
|
client,
|
|
@@ -28,6 +49,7 @@ var installAbsoluteMobileShellSync = (auth, options = {}) => {
|
|
|
28
49
|
if (!active2)
|
|
29
50
|
return;
|
|
30
51
|
active2 = false;
|
|
52
|
+
removeStatus();
|
|
31
53
|
removal.then((remove) => remove?.());
|
|
32
54
|
};
|
|
33
55
|
}
|
|
@@ -47,5 +69,6 @@ var installAbsoluteMobileShellSync = (auth, options = {}) => {
|
|
|
47
69
|
};
|
|
48
70
|
};
|
|
49
71
|
export {
|
|
50
|
-
installAbsoluteMobileShellSync
|
|
72
|
+
installAbsoluteMobileShellSync,
|
|
73
|
+
ABSOLUTE_MOBILE_SYNC_STATUS_EVENT
|
|
51
74
|
};
|
|
@@ -10,6 +10,10 @@ export type AbsoluteCapacitorBundleOptions = {
|
|
|
10
10
|
};
|
|
11
11
|
export declare const materializeAbsoluteCapacitorWebBundle: (options: AbsoluteCapacitorBundleOptions) => Promise<{
|
|
12
12
|
sync?: {
|
|
13
|
+
background: {
|
|
14
|
+
endpoint: string;
|
|
15
|
+
intervalMinutes: number;
|
|
16
|
+
};
|
|
13
17
|
socketTickets: true;
|
|
14
18
|
} | undefined;
|
|
15
19
|
appId: string;
|
|
@@ -2,10 +2,12 @@ import { type MobileAuthPrincipal } from '@absolutejs/auth/client/mobile';
|
|
|
2
2
|
import type { AbsoluteMobileAuthManifest } from './nativeAuth';
|
|
3
3
|
import type { AbsoluteMobileFetch } from './transport';
|
|
4
4
|
export type AbsoluteMobileShellAuth = {
|
|
5
|
+
clientId: string;
|
|
5
6
|
fetch: AbsoluteMobileFetch;
|
|
6
7
|
onPrincipalChange: (listener: (principal: MobileAuthPrincipal | null) => void) => () => void;
|
|
7
8
|
principal: MobileAuthPrincipal | null;
|
|
8
9
|
redirectUri: string;
|
|
10
|
+
issuer: string;
|
|
9
11
|
socketTicket: (audience?: string) => Promise<string>;
|
|
10
12
|
};
|
|
11
13
|
export declare const createAbsoluteMobileShellAuth: (config: AbsoluteMobileAuthManifest) => Promise<AbsoluteMobileShellAuth>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type AbsoluteMobileFetch, type AbsoluteMobileClientManifest } from './transport';
|
|
2
2
|
export type AbsoluteMobileShellAuthRuntime = {
|
|
3
|
+
clientId: string;
|
|
3
4
|
fetch: AbsoluteMobileFetch;
|
|
4
5
|
onPrincipalChange: (listener: (principal: AbsoluteMobileShellPrincipal | null) => void) => () => void;
|
|
5
6
|
principal: AbsoluteMobileShellPrincipal | null;
|
|
6
7
|
redirectUri: string;
|
|
8
|
+
issuer: string;
|
|
7
9
|
socketTicket: (audience?: string) => Promise<string>;
|
|
8
10
|
};
|
|
9
11
|
export type AbsoluteMobileShellPrincipal = {
|
|
@@ -11,6 +13,6 @@ export type AbsoluteMobileShellPrincipal = {
|
|
|
11
13
|
};
|
|
12
14
|
export type AbsoluteMobileShellOptions = {
|
|
13
15
|
createAuth?: (config: NonNullable<AbsoluteMobileClientManifest['auth']>) => Promise<AbsoluteMobileShellAuthRuntime>;
|
|
14
|
-
installSync?: (auth: AbsoluteMobileShellAuthRuntime) => void | (() => void);
|
|
16
|
+
installSync?: (auth: AbsoluteMobileShellAuthRuntime, config: NonNullable<AbsoluteMobileClientManifest['sync']>) => void | (() => void);
|
|
15
17
|
};
|
|
16
18
|
export declare const startAbsoluteMobileShell: (options?: AbsoluteMobileShellOptions) => Promise<void>;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { type CapacitorSyncLifecycleOptions } from '@absolutejs/sync-capacitor';
|
|
2
|
-
import type { SyncLocalStore } from '@absolutejs/sync/client';
|
|
1
|
+
import { configureCapacitorBackgroundSync, type CapacitorSyncLifecycleOptions } from '@absolutejs/sync-capacitor';
|
|
2
|
+
import type { SyncClientStatus, SyncLocalStore } from '@absolutejs/sync/client';
|
|
3
3
|
import type { AbsoluteMobileShellAuthRuntime } from './shellBootstrap';
|
|
4
|
+
import type { AbsoluteMobileClientManifest } from './transport';
|
|
4
5
|
export type AbsoluteMobileShellSyncOptions = {
|
|
5
6
|
createStore?: () => SyncLocalStore;
|
|
6
7
|
installLifecycle?: (options: CapacitorSyncLifecycleOptions) => Promise<() => void>;
|
|
7
8
|
reload?: () => void;
|
|
9
|
+
reportStatus?: (status: SyncClientStatus) => void;
|
|
10
|
+
configureBackground?: typeof configureCapacitorBackgroundSync;
|
|
11
|
+
clearBackground?: () => Promise<void>;
|
|
8
12
|
};
|
|
13
|
+
export declare const ABSOLUTE_MOBILE_SYNC_STATUS_EVENT = "absolute:sync-status";
|
|
9
14
|
/**
|
|
10
15
|
* Provisions unchanged Sync clients with native durability, Auth isolation, and
|
|
11
16
|
* foreground/connectivity reconnects. An identity change reloads the shell so
|
|
12
17
|
* no page-held client can retain the previous account's in-memory rows.
|
|
13
18
|
*/
|
|
14
|
-
export declare const installAbsoluteMobileShellSync: (auth: AbsoluteMobileShellAuthRuntime, options?: AbsoluteMobileShellSyncOptions) => () => void;
|
|
19
|
+
export declare const installAbsoluteMobileShellSync: (auth: AbsoluteMobileShellAuthRuntime, config?: NonNullable<AbsoluteMobileClientManifest["sync"]>, options?: AbsoluteMobileShellSyncOptions) => () => void;
|
package/package.json
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"url": "https://github.com/absolutejs/absolutejs/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@absolutejs/auth": "0.
|
|
11
|
-
"@absolutejs/devices": "0.0.
|
|
12
|
-
"@absolutejs/devices-capacitor": "0.1.
|
|
10
|
+
"@absolutejs/auth": "0.71.0",
|
|
11
|
+
"@absolutejs/devices": "0.0.3",
|
|
12
|
+
"@absolutejs/devices-capacitor": "0.1.3",
|
|
13
13
|
"@capacitor/browser": "8.0.4",
|
|
14
14
|
"@capacitor/network": "8.0.1",
|
|
15
15
|
"@capacitor/preferences": "8.0.1",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@absolutejs/manifest": "0.9.0",
|
|
27
27
|
"@absolutejs/scoped-state": "0.2.2",
|
|
28
|
-
"@absolutejs/sync": "2.
|
|
29
|
-
"@absolutejs/sync-capacitor": "0.
|
|
28
|
+
"@absolutejs/sync": "2.23.0",
|
|
29
|
+
"@absolutejs/sync-capacitor": "0.3.0",
|
|
30
30
|
"@angular/animations": "21.2.6",
|
|
31
31
|
"@angular/cdk": "21.2.6",
|
|
32
32
|
"@angular/common": "21.2.6",
|
|
@@ -274,12 +274,12 @@
|
|
|
274
274
|
"main": "./dist/index.js",
|
|
275
275
|
"name": "@absolutejs/absolute",
|
|
276
276
|
"optionalDependencies": {
|
|
277
|
-
"@absolutejs/native-darwin-arm64": "0.20.0-beta.
|
|
278
|
-
"@absolutejs/native-darwin-x64": "0.20.0-beta.
|
|
279
|
-
"@absolutejs/native-linux-arm64": "0.20.0-beta.
|
|
280
|
-
"@absolutejs/native-linux-x64": "0.20.0-beta.
|
|
281
|
-
"@absolutejs/native-windows-arm64": "0.20.0-beta.
|
|
282
|
-
"@absolutejs/native-windows-x64": "0.20.0-beta.
|
|
277
|
+
"@absolutejs/native-darwin-arm64": "0.20.0-beta.9",
|
|
278
|
+
"@absolutejs/native-darwin-x64": "0.20.0-beta.9",
|
|
279
|
+
"@absolutejs/native-linux-arm64": "0.20.0-beta.9",
|
|
280
|
+
"@absolutejs/native-linux-x64": "0.20.0-beta.9",
|
|
281
|
+
"@absolutejs/native-windows-arm64": "0.20.0-beta.9",
|
|
282
|
+
"@absolutejs/native-windows-x64": "0.20.0-beta.9"
|
|
283
283
|
},
|
|
284
284
|
"overrides": {
|
|
285
285
|
"@sinclair/typebox": "0.34.52",
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
"typebox": "1.3.16"
|
|
290
290
|
},
|
|
291
291
|
"peerDependencies": {
|
|
292
|
-
"@absolutejs/sync": ">=2.
|
|
292
|
+
"@absolutejs/sync": ">=2.23.0 <3",
|
|
293
293
|
"@angular/animations": "^21.0.0",
|
|
294
294
|
"@angular/common": "^21.0.0",
|
|
295
295
|
"@angular/compiler": "^21.0.0",
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
]
|
|
491
491
|
}
|
|
492
492
|
},
|
|
493
|
-
"version": "0.20.0-beta.
|
|
493
|
+
"version": "0.20.0-beta.9",
|
|
494
494
|
"workspaces": [
|
|
495
495
|
"tests/fixtures/*",
|
|
496
496
|
"tests/fixtures/_packages/*"
|