@rdlabo/ionic-angular-kit 21.5.5 → 21.5.6
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/package.json
CHANGED
|
@@ -16,7 +16,7 @@ type OfflineReplicaSqliteAffinity = 'TEXT' | 'INTEGER' | 'REAL';
|
|
|
16
16
|
*/
|
|
17
17
|
type OfflineReplicaStorageKind = 'text' | 'integer' | 'real' | 'booleanColumn' | 'json' | 'datetime';
|
|
18
18
|
/** Scope partition persisted on every replica table row. */
|
|
19
|
-
type OfflineReplicaEntityScope = 'user' | '
|
|
19
|
+
type OfflineReplicaEntityScope = 'user' | 'partition';
|
|
20
20
|
/** Field projection policy for a source-model property. */
|
|
21
21
|
type OfflineReplicaFieldPolicy = 'column' | 'serverId' | 'ignored';
|
|
22
22
|
/** Runtime descriptor for one mapped source property. */
|
|
@@ -42,7 +42,7 @@ interface OfflineReplicaEntitySchema<TSelect extends Record<string, unknown>> {
|
|
|
42
42
|
readonly tableName: string;
|
|
43
43
|
/** Stable source key used by sync and repository layers. */
|
|
44
44
|
readonly sourceKey: string;
|
|
45
|
-
/** Whether rows are partitioned by user only or user plus
|
|
45
|
+
/** Whether rows are partitioned by user only or user plus scope partition. */
|
|
46
46
|
readonly scope: OfflineReplicaEntityScope;
|
|
47
47
|
/** Ordered field descriptors derived from the DSL definition. */
|
|
48
48
|
readonly fields: readonly OfflineReplicaFieldDescriptor[];
|
|
@@ -219,10 +219,10 @@ declare function sha256OfflineReplicaSchema(bundle: OfflineReplicaSchemaBundle):
|
|
|
219
219
|
|
|
220
220
|
/** Current durable storage schema used by both web and native repositories. */
|
|
221
221
|
declare const OFFLINE_SCHEMA_VERSION = 4;
|
|
222
|
-
/** User and
|
|
222
|
+
/** User and partition scope of all local offline data. */
|
|
223
223
|
interface OfflineScope {
|
|
224
224
|
userId: number;
|
|
225
|
-
|
|
225
|
+
scopeId: string;
|
|
226
226
|
}
|
|
227
227
|
/** Synchronization state of a locally materialized product replica row. */
|
|
228
228
|
type OfflineReplicaSyncState = 'confirmed' | 'pending' | 'blocked_auth' | 'rejected' | 'conflict';
|
|
@@ -262,7 +262,7 @@ interface OfflineReplicaRow<TValues = unknown> extends OfflineScope {
|
|
|
262
262
|
fetchedAt: number;
|
|
263
263
|
syncState: OfflineReplicaSyncState;
|
|
264
264
|
}
|
|
265
|
-
/** Stable address of a product replica row inside a user
|
|
265
|
+
/** Stable address of a product replica row inside a user or partition-scoped replica. */
|
|
266
266
|
interface OfflineReplicaRowKey extends OfflineScope {
|
|
267
267
|
sourceKey: string;
|
|
268
268
|
localId: string;
|
|
@@ -296,7 +296,7 @@ interface OfflineRepository {
|
|
|
296
296
|
replaceCommand(command: OfflineCommand): Promise<void>;
|
|
297
297
|
removeCommand(commandId: string): Promise<void>;
|
|
298
298
|
clearUser(userId: number): Promise<void>;
|
|
299
|
-
|
|
299
|
+
clearScope(scope: OfflineScope): Promise<void>;
|
|
300
300
|
transactReplica(transaction: OfflineReplicaTransaction): Promise<void>;
|
|
301
301
|
}
|
|
302
302
|
/** DI token for the selected platform repository. */
|
|
@@ -321,13 +321,13 @@ declare class IonicOfflineRepository implements OfflineRepository {
|
|
|
321
321
|
replaceCommand(command: OfflineCommand): Promise<void>;
|
|
322
322
|
removeCommand(commandId: string): Promise<void>;
|
|
323
323
|
clearUser(userId: number): Promise<void>;
|
|
324
|
-
|
|
324
|
+
clearScope(scope: OfflineScope): Promise<void>;
|
|
325
325
|
transactReplica(transaction: OfflineReplicaTransaction): Promise<void>;
|
|
326
326
|
static ɵfac: i0.ɵɵFactoryDeclaration<IonicOfflineRepository, never>;
|
|
327
327
|
static ɵprov: i0.ɵɵInjectableDeclaration<IonicOfflineRepository>;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
/** Server pull request for one user
|
|
330
|
+
/** Server pull request for one user or partition-scoped replica. */
|
|
331
331
|
interface OfflineReplicaPullRequest {
|
|
332
332
|
scope: OfflineScope;
|
|
333
333
|
cursor: string;
|
|
@@ -395,7 +395,7 @@ interface OfflineCommandExecutor {
|
|
|
395
395
|
}
|
|
396
396
|
/** DI token for the product-specific command transport adapter. */
|
|
397
397
|
declare const OFFLINE_COMMAND_EXECUTOR: InjectionToken<OfflineCommandExecutor>;
|
|
398
|
-
/** Authenticated user and
|
|
398
|
+
/** Authenticated user and partition scopes currently eligible for synchronization. */
|
|
399
399
|
interface OfflineSyncSession {
|
|
400
400
|
userId: number;
|
|
401
401
|
scopes: OfflineScope[];
|
|
@@ -419,10 +419,10 @@ declare const DEFAULT_OFFLINE_COMMAND_HOOKS: OfflineCommandHooks;
|
|
|
419
419
|
/** DI token for optional product-specific synchronization hooks. */
|
|
420
420
|
declare const OFFLINE_COMMAND_HOOKS: InjectionToken<OfflineCommandHooks>;
|
|
421
421
|
|
|
422
|
-
/** Persisted identity and
|
|
422
|
+
/** Persisted identity and partition boundary for one authenticated local replica. */
|
|
423
423
|
interface OfflineSessionManifest {
|
|
424
424
|
userId: number;
|
|
425
|
-
scopeIds:
|
|
425
|
+
readonly scopeIds: readonly string[];
|
|
426
426
|
/** Authentication-provider subject used to distinguish users on a shared device. */
|
|
427
427
|
authSubject: string | null;
|
|
428
428
|
updatedAt: number;
|
|
@@ -436,8 +436,8 @@ declare class OfflineSessionService {
|
|
|
436
436
|
#private;
|
|
437
437
|
readonly activeManifest: i0.Signal<OfflineSessionManifest | null>;
|
|
438
438
|
initialize(): Promise<void>;
|
|
439
|
-
activateSession(userId: number, scopeIds: readonly
|
|
440
|
-
activateSession(userId: number, scopeIds: readonly
|
|
439
|
+
activateSession(userId: number, scopeIds: readonly string[], authSubject: string | null): Promise<void>;
|
|
440
|
+
activateSession(userId: number, scopeIds: readonly string[], authSubject: string | null, lease: OfflineSessionTransitionLease): Promise<boolean>;
|
|
441
441
|
clearActiveSession(): Promise<void>;
|
|
442
442
|
/** Immediately revoke local and remote runtime access while durable cleanup is pending. */
|
|
443
443
|
revokeAccess(): void;
|
|
@@ -490,9 +490,9 @@ declare class OfflineCoordinatorService {
|
|
|
490
490
|
readonly pendingCount: i0.Signal<number>;
|
|
491
491
|
readonly conflicts: i0.Signal<_rdlabo_ionic_angular_kit_offline.OfflineCommand<unknown>[]>;
|
|
492
492
|
initialize(): Promise<void>;
|
|
493
|
-
activateSession(userId: number, scopeIds: readonly
|
|
493
|
+
activateSession(userId: number, scopeIds: readonly string[], authSubject: string | null): Promise<void>;
|
|
494
494
|
/** Installs a remotely verified identity without starting pull or outbox replay. */
|
|
495
|
-
prepareRemoteSession(userId: number, scopeIds: readonly
|
|
495
|
+
prepareRemoteSession(userId: number, scopeIds: readonly string[], authSubject: string | null, authLease?: OfflineSessionTransitionLease): Promise<boolean>;
|
|
496
496
|
/** Starts pull and outbox replay after the caller has published remote access. */
|
|
497
497
|
resumeRemoteSession(): Promise<void>;
|
|
498
498
|
/**
|
|
@@ -509,7 +509,7 @@ declare class OfflineCoordinatorService {
|
|
|
509
509
|
/** Remote identity fields required to activate an offline session boundary. */
|
|
510
510
|
interface OfflineRemoteIdentity {
|
|
511
511
|
readonly userId: number;
|
|
512
|
-
readonly scopeIds: readonly
|
|
512
|
+
readonly scopeIds: readonly string[];
|
|
513
513
|
readonly authSubject: string;
|
|
514
514
|
}
|
|
515
515
|
/** Phase that distinguishes route authorization from background remote recovery. */
|
|
@@ -717,7 +717,7 @@ declare class SqliteOfflineRepository implements OfflineRepository {
|
|
|
717
717
|
replaceCommand(command: OfflineCommand): Promise<void>;
|
|
718
718
|
removeCommand(commandId: string): Promise<void>;
|
|
719
719
|
clearUser(userId: number): Promise<void>;
|
|
720
|
-
|
|
720
|
+
clearScope(scope: OfflineScope): Promise<void>;
|
|
721
721
|
transactReplica(transaction: OfflineReplicaTransaction): Promise<void>;
|
|
722
722
|
static ɵfac: i0.ɵɵFactoryDeclaration<SqliteOfflineRepository, never>;
|
|
723
723
|
static ɵprov: i0.ɵɵInjectableDeclaration<SqliteOfflineRepository>;
|
|
@@ -752,7 +752,7 @@ declare function provideOffline(options: ProvideOfflineOptions): EnvironmentProv
|
|
|
752
752
|
type OfflineSyncState = 'idle' | 'pending' | 'syncing' | 'attention';
|
|
753
753
|
/** Mutation and optimistic entity materialization appended atomically to the outbox. */
|
|
754
754
|
interface EnqueueOfflineCommand<T = unknown> {
|
|
755
|
-
|
|
755
|
+
scopeId: string;
|
|
756
756
|
aggregateType: string;
|
|
757
757
|
/** Stable UUID generated by the client before the entity is first written. */
|
|
758
758
|
aggregateLocalId: string;
|