@rdlabo/ionic-angular-kit 21.5.8 → 21.5.10

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdlabo/ionic-angular-kit",
3
- "version": "21.5.8",
3
+ "version": "21.5.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rdlabo-team/ionic-angular-library.git"
@@ -18,17 +18,19 @@ type OfflineReplicaStorageKind = 'text' | 'integer' | 'real' | 'booleanColumn' |
18
18
  /** Scope partition persisted on every replica table row. */
19
19
  type OfflineReplicaEntityScope = 'user' | 'partition';
20
20
  /** Field projection policy for a source-model property. */
21
- type OfflineReplicaFieldPolicy = 'column' | 'serverId' | 'ignored';
21
+ type OfflineReplicaFieldPolicy = 'column' | 'remoteId' | 'ignored';
22
22
  /** Canonical value types accepted in a composite server-side natural key. */
23
23
  type OfflineNaturalKeyValue = string | number;
24
24
  /** Ordered natural-key values keyed by source-model field name. */
25
25
  type OfflineNaturalKey = Readonly<Record<string, OfflineNaturalKeyValue>>;
26
+ /** Server-assigned remote identifier for a generated-identity entity. */
27
+ type OfflineGeneratedRemoteId = number | string;
26
28
  /** Remote row identity. Exactly one variant is valid for a replicated entity. */
27
29
  type OfflineReplicaRemoteIdentity = {
28
- readonly serverId: number;
30
+ readonly remoteId: OfflineGeneratedRemoteId;
29
31
  readonly naturalKey?: never;
30
32
  } | {
31
- readonly serverId?: never;
33
+ readonly remoteId?: never;
32
34
  readonly naturalKey: OfflineNaturalKey;
33
35
  };
34
36
  /** Runtime identity policy materialized into an entity schema. */
@@ -36,8 +38,9 @@ type OfflineReplicaIdentityDescriptor = {
36
38
  readonly kind: 'localOnly';
37
39
  readonly sourceKeys: readonly [];
38
40
  } | {
39
- readonly kind: 'serverId';
41
+ readonly kind: 'generated';
40
42
  readonly sourceKeys: readonly [string];
43
+ readonly affinity: OfflineReplicaSqliteAffinity;
41
44
  } | {
42
45
  readonly kind: 'naturalKey';
43
46
  readonly sourceKeys: readonly string[];
@@ -97,11 +100,14 @@ interface OfflineReplicaColumnDef<TValue = unknown, TNullable extends ReplicaNul
97
100
  readonly nullable: TNullable[typeof replicaNullableBrand];
98
101
  };
99
102
  }
100
- /** Builder marking a source property as the server-assigned identifier. */
101
- interface OfflineReplicaServerIdDef {
102
- readonly kind: 'serverId';
103
- readonly __types?: {
103
+ /** Builder marking a source property as the server-assigned generated identifier. */
104
+ interface OfflineReplicaRemoteIdDef<TAffinity extends OfflineReplicaSqliteAffinity = OfflineReplicaSqliteAffinity> {
105
+ readonly kind: 'remoteId';
106
+ readonly affinity: TAffinity;
107
+ readonly __types?: TAffinity extends 'INTEGER' ? {
104
108
  readonly value: number;
109
+ } : {
110
+ readonly value: string;
105
111
  };
106
112
  }
107
113
  /** Builder excluding a source property from SQLite projection. */
@@ -114,6 +120,10 @@ interface OfflineReplicaNaturalKeyDef<TKey extends string = string> {
114
120
  readonly kind: 'naturalKey';
115
121
  readonly sourceKeys: readonly TKey[];
116
122
  }
123
+ /** Explicit identity for a projection that is never synchronized to a remote row. */
124
+ interface OfflineReplicaLocalOnlyDef {
125
+ readonly kind: 'localOnly';
126
+ }
117
127
  type StripNullish<T> = Exclude<T, null | undefined>;
118
128
  type NormalizeReplicaColumnValue<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends Date ? string | Date : T;
119
129
  type StrictNullChecksEnabled = undefined extends null ? false : true;
@@ -125,7 +135,8 @@ type ReplicaColumnNullabilityForSelect<T> = StrictNullChecksEnabled extends true
125
135
  readonly [replicaNullableBrand]: 'required';
126
136
  } : ReplicaNullableBrand;
127
137
  type OfflineReplicaColumnDefForValue<T> = OfflineReplicaColumnDef<NormalizeReplicaColumnValue<StripNullish<T>>, ReplicaColumnNullabilityForSelect<T>>;
128
- type OfflineReplicaFieldDefForKey<TSelect extends Record<string, unknown>, K extends keyof TSelect> = (StripNullish<TSelect[K]> extends number ? OfflineReplicaServerIdDef : never) | OfflineReplicaIgnoredDef | OfflineReplicaColumnDefForValue<TSelect[K]>;
138
+ type OfflineReplicaRemoteIdDefForValue<T> = StripNullish<T> extends number ? OfflineReplicaRemoteIdDef<'INTEGER'> : StripNullish<T> extends string ? OfflineReplicaRemoteIdDef<'TEXT'> : never;
139
+ type OfflineReplicaFieldDefForKey<TSelect extends Record<string, unknown>, K extends keyof TSelect> = OfflineReplicaRemoteIdDefForValue<TSelect[K]> | OfflineReplicaIgnoredDef | OfflineReplicaColumnDefForValue<TSelect[K]>;
129
140
  type ExactSelectKeys<TSelect extends Record<string, unknown>, TFields> = Exclude<keyof TFields, keyof TSelect> extends never ? (Exclude<keyof TSelect, keyof TFields> extends never ? TFields : never) : never;
130
141
  /** Configuration accepted by {@link defineReplicaEntity}. */
131
142
  interface OfflineReplicaEntityDefinition<TSelect extends Record<string, unknown>, TFields extends {
@@ -134,7 +145,7 @@ interface OfflineReplicaEntityDefinition<TSelect extends Record<string, unknown>
134
145
  readonly table: string;
135
146
  readonly sourceKey: string;
136
147
  readonly scope: OfflineReplicaEntityScope;
137
- readonly identity?: OfflineReplicaNaturalKeyDef<Extract<keyof TSelect, string>>;
148
+ readonly identity?: OfflineReplicaNaturalKeyDef<Extract<keyof TSelect, string>> | OfflineReplicaLocalOnlyDef;
138
149
  readonly fields: ExactSelectKeys<TSelect, TFields> & TFields;
139
150
  }
140
151
  /**
@@ -142,7 +153,7 @@ interface OfflineReplicaEntityDefinition<TSelect extends Record<string, unknown>
142
153
  *
143
154
  * Every key in `TSelect` must appear exactly once in `fields`, and column nullability
144
155
  * must match the select property nullability. An entity may map at most one field with
145
- * {@link serverId}; omit it for local-only projections that have no remote row identity.
156
+ * {@link generatedId}; omit it for local-only projections that have no remote row identity.
146
157
  */
147
158
  declare function defineReplicaEntity<TSelect extends Record<string, unknown>>(): <const TFields extends { readonly [K in keyof TSelect]: OfflineReplicaFieldDefForKey<TSelect, K>; }>(definition: OfflineReplicaEntityDefinition<TSelect, TFields>) => OfflineReplicaEntitySchema<TSelect>;
148
159
  /** Maps a non-null string source property to a TEXT column. */
@@ -163,12 +174,15 @@ declare function nullable<TValue>(column: OfflineReplicaColumnDef<TValue, {
163
174
  }>): OfflineReplicaColumnDef<TValue, {
164
175
  readonly [replicaNullableBrand]: 'nullable';
165
176
  }>;
166
- /** Maps a source property to the shared nullable `server_id` column. */
167
- declare function serverId(): OfflineReplicaServerIdDef;
168
- /** Declares an ordered composite natural key without changing the immutable local UUID. */
177
+ /** Maps a source property to the nullable generated remote-id column. */
178
+ declare function generatedId(kind: 'integer'): OfflineReplicaRemoteIdDef<'INTEGER'>;
179
+ declare function generatedId(kind: 'text'): OfflineReplicaRemoteIdDef<'TEXT'>;
180
+ /** Declares an ordered remote natural key used directly as the scoped SQLite primary key. */
169
181
  declare function naturalKey<const TKey extends string>(sourceKeys: readonly TKey[]): OfflineReplicaNaturalKeyDef<TKey>;
170
- /** Rejects a remote identity on a local-only projection before it reaches platform storage. */
171
- declare function assertOfflineReplicaServerId(schema: OfflineReplicaEntitySchema<Record<string, unknown>>, value: number | null): void;
182
+ /** Declares a projection with a local UUID address and no Outbox identity. */
183
+ declare function localOnly(): OfflineReplicaLocalOnlyDef;
184
+ /** Rejects a generated remote id on a local-only or natural-key projection before it reaches platform storage. */
185
+ declare function assertOfflineReplicaGeneratedRemoteId(schema: OfflineReplicaEntitySchema<Record<string, unknown>>, value: OfflineGeneratedRemoteId | null): void;
172
186
  /** Extracts and validates an entity's natural key in declared component order. */
173
187
  declare function offlineNaturalKeyFromValues(schema: OfflineReplicaEntitySchema<Record<string, unknown>>, values: unknown): OfflineNaturalKey | null;
174
188
  /** Validates a supplied natural key and returns it in schema-declared order. */
@@ -184,7 +198,7 @@ declare function ignored(reason: string): OfflineReplicaIgnoredDef;
184
198
  *
185
199
  * Only {@link OfflineReplicaFieldPolicy} `column` fields are emitted, keyed by
186
200
  * {@link OfflineReplicaFieldDescriptor.sqliteColumnName} in descriptor order.
187
- * Source properties mapped as `serverId` or `ignored` may be present but are not encoded.
201
+ * Source properties mapped as `remoteId` or `ignored` may be present but are not encoded.
188
202
  */
189
203
  declare function encodeOfflineReplicaValues(schema: OfflineReplicaEntitySchema<Record<string, unknown>>, values: unknown): Readonly<Record<string, string | number | null>>;
190
204
  /**
@@ -199,8 +213,8 @@ declare function decodeOfflineReplicaValues(schema: OfflineReplicaEntitySchema<R
199
213
  /**
200
214
  * Validates a source-model row and returns the canonical domain projection persisted by every repository.
201
215
  *
202
- * Fields mapped as `serverId` or `ignored` are intentionally omitted. This keeps web and native row shapes
203
- * identical; the server identifier remains available through the replica row's dedicated `serverId` field.
216
+ * Fields mapped as `remoteId` or `ignored` are intentionally omitted. This keeps web and native row shapes
217
+ * identical; the server identifier remains available through the replica row's dedicated `remoteId` field.
204
218
  */
205
219
  declare function projectOfflineReplicaValues(schema: OfflineReplicaEntitySchema<Record<string, unknown>>, values: unknown): Readonly<Record<string, unknown>>;
206
220
  /** Domain payload transformed during web replica schema migration. Identity and sync metadata stay outside this shape. */
@@ -222,7 +236,7 @@ interface OfflineReplicaMigration {
222
236
  /**
223
237
  * Transforms one row's domain projection for web storage during this step.
224
238
  * The callback receives only {@link OfflineReplicaWebMigrationRow}; it must not read or mutate
225
- * `localId`, `serverId`, scope, revision, or `syncState`. Return `null` to delete the row.
239
+ * `localId`, `remoteId`, scope, revision, or `syncState`. Return `null` to delete the row.
226
240
  */
227
241
  readonly migrateWebRow: OfflineReplicaWebMigrationCallback;
228
242
  }
@@ -258,11 +272,67 @@ declare function defineOfflineReplicaSchema(definition: OfflineReplicaSchemaDefi
258
272
  */
259
273
  declare function sha256OfflineReplicaSchema(bundle: OfflineReplicaSchemaBundle): Promise<string>;
260
274
 
275
+ /** Product-agnostic authenticated principal identifier. */
276
+ type OfflinePrincipalId = string | number;
277
+ /** Type-tagged SQLite/web key; numeric 7 and text "7" never share a boundary. */
278
+ declare function canonicalOfflinePrincipalId(value: OfflinePrincipalId): string;
279
+ /** Decodes a principal previously persisted by {@link canonicalOfflinePrincipalId}. */
280
+ declare function parseOfflinePrincipalId(value: string): OfflinePrincipalId;
281
+ /** Durable address of a generated or natural-key replica row. */
282
+ type OfflineReplicaIdentity = {
283
+ readonly kind: 'generated';
284
+ readonly localId: string;
285
+ readonly remoteId: OfflineGeneratedRemoteId | null;
286
+ } | {
287
+ readonly kind: 'natural';
288
+ readonly naturalKey: OfflineNaturalKey;
289
+ } | {
290
+ readonly kind: 'local';
291
+ readonly localId: string;
292
+ };
293
+ /** Outbox address. Generated ids are resolved to the latest server id immediately before transport. */
294
+ type OfflineCommandIdentity = {
295
+ readonly kind: 'generated';
296
+ readonly localId: string;
297
+ } | {
298
+ readonly kind: 'natural';
299
+ readonly naturalKey: OfflineNaturalKey;
300
+ };
301
+ /** Stable lookup address for every replica row, including local-only projections. */
302
+ type OfflineReplicaAddress = OfflineCommandIdentity | {
303
+ readonly kind: 'local';
304
+ readonly localId: string;
305
+ };
306
+ /** Stable storage key for one outbox or replica row identity. */
307
+ declare function canonicalOfflineCommandIdentity(identity: OfflineCommandIdentity): string;
308
+ /** Stable storage key for one materialized replica row identity. */
309
+ declare function canonicalOfflineReplicaIdentity(identity: OfflineReplicaIdentity): string;
310
+ /** JSON persisted in SQLite/web outbox rows. */
311
+ declare function serializeOfflineCommandIdentity(identity: OfflineCommandIdentity): string;
312
+ /** Parses durable outbox identity JSON. */
313
+ declare function parseOfflineCommandIdentity(value: unknown): OfflineCommandIdentity;
314
+ /** Builds a generated replica identity. */
315
+ declare function offlineGeneratedReplicaIdentity(localId: string, remoteId: OfflineGeneratedRemoteId | null): OfflineReplicaIdentity;
316
+ /** Validates a durable local row id before it can enter either storage backend. */
317
+ declare function assertOfflineLocalId(value: unknown): asserts value is string;
318
+ /** Builds a natural replica identity from current domain values. */
319
+ declare function offlineNaturalReplicaIdentity(schema: OfflineReplicaEntitySchema<Record<string, unknown>>, values: unknown): OfflineReplicaIdentity;
320
+ /** Converts a materialized replica identity into an outbox address. */
321
+ declare function commandIdentityFromReplicaIdentity(identity: OfflineReplicaIdentity): OfflineCommandIdentity;
322
+ /** Converts a materialized row identity into its immutable repository address. */
323
+ declare function replicaAddressFromIdentity(identity: OfflineReplicaIdentity): OfflineReplicaAddress;
324
+ /** Whether a command identity addresses the given replica row. */
325
+ declare function commandIdentityMatchesReplicaRow(schema: OfflineReplicaEntitySchema<Record<string, unknown>>, row: {
326
+ readonly identity: OfflineReplicaIdentity;
327
+ }, commandIdentity: OfflineCommandIdentity): boolean;
328
+ /** Remote identity used by pull reconciliation and uniqueness checks. */
329
+ declare function offlineReplicaRemoteIdentity(schema: OfflineReplicaEntitySchema<Record<string, unknown>>, identity: OfflineReplicaIdentity): OfflineReplicaRemoteIdentity | null;
330
+
261
331
  /** Current durable storage schema used by both web and native repositories. */
262
- declare const OFFLINE_SCHEMA_VERSION = 5;
332
+ declare const OFFLINE_SCHEMA_VERSION = 1;
263
333
  /** User and partition scope of all local offline data. */
264
334
  interface OfflineScope {
265
- userId: number;
335
+ userId: OfflinePrincipalId;
266
336
  scopeId: string;
267
337
  }
268
338
  /** Synchronization state of a locally materialized product replica row. */
@@ -271,12 +341,13 @@ type OfflineReplicaVisibility = 'present' | 'pending_delete';
271
341
  type OfflineReplicaMutation = 'upsert' | 'delete';
272
342
  /** Durable processing state of an outbox command. */
273
343
  type OfflineCommandState = 'pending' | 'sending' | 'retry_wait' | 'blocked_auth' | 'rejected' | 'conflict';
274
- /** Product-agnostic mutation persisted in the outbox by local id. */
275
- interface OfflineCommand<T = unknown> extends OfflineScope {
344
+ interface OfflineCommandBase<T> extends OfflineScope {
276
345
  commandId: string;
277
346
  aggregateType: string;
278
- /** Immutable local id of the target. The outbox never persists a server id. */
279
- aggregateLocalId: string;
347
+ /** Replica schema source key resolved when the command is enqueued. */
348
+ sourceKey: string;
349
+ /** Stable row identity. The Outbox never persists a generated server id. */
350
+ identity: OfflineCommandIdentity;
280
351
  operation: string;
281
352
  payload: T;
282
353
  /** Full optimistic entity value displayed while this command is pending. */
@@ -291,14 +362,13 @@ interface OfflineCommand<T = unknown> extends OfflineScope {
291
362
  createdAt: number;
292
363
  lastErrorCode: string | null;
293
364
  }
365
+ type OfflineCommand<T = unknown> = OfflineCommandBase<T>;
294
366
  /** Product replica row materialized from a versioned schema entity. */
295
- interface OfflineReplicaRow<TValues = unknown> extends OfflineScope {
367
+ interface OfflineReplicaRowBase<TValues> extends OfflineScope {
296
368
  /** Stable source key matching {@link OfflineReplicaEntitySchema.sourceKey}. */
297
369
  sourceKey: string;
298
- /** Immutable client-generated UUID used as the SQLite primary key. */
299
- localId: string;
300
- /** Server-assigned identifier after a successful create, otherwise null. */
301
- serverId: number | null;
370
+ /** Row identity matching the entity schema. Natural-key rows have no synthetic ids. */
371
+ identity: OfflineReplicaIdentity;
302
372
  /** Current optimistic domain values displayed locally. */
303
373
  values: TValues;
304
374
  /** Last server-confirmed domain values, or null while pending. */
@@ -309,10 +379,16 @@ interface OfflineReplicaRow<TValues = unknown> extends OfflineScope {
309
379
  /** Library-owned visibility; pending deletes remain durable but are hidden from product reads. */
310
380
  visibility?: OfflineReplicaVisibility;
311
381
  }
382
+ type OfflineReplicaRow<TValues = unknown> = OfflineReplicaRowBase<TValues>;
312
383
  /** Stable address of a product replica row inside a user or partition-scoped replica. */
313
384
  interface OfflineReplicaRowKey extends OfflineScope {
314
385
  sourceKey: string;
315
- localId: string;
386
+ identity: OfflineReplicaIdentity;
387
+ }
388
+ /** Explicit one-way release of a generated remote id during a replica delete acknowledgement. */
389
+ interface OfflineReplicaRemoteIdRelease extends OfflineReplicaRowKey {
390
+ /** The current remote id being released; the matching put row must set `remoteId` to null. */
391
+ remoteId: OfflineGeneratedRemoteId;
316
392
  }
317
393
  /** Scope partition plus the durable replica pull cursor for that partition. */
318
394
  interface OfflineReplicaCursor extends OfflineScope {
@@ -321,6 +397,11 @@ interface OfflineReplicaCursor extends OfflineScope {
321
397
  /** Atomic changes applied to the local replica and durable outbox together. */
322
398
  interface OfflineReplicaTransaction {
323
399
  putRows?: readonly OfflineReplicaRow[];
400
+ /**
401
+ * Allows only the matching `remoteId: current -> null` transition in `putRows`.
402
+ * All other remote-id changes remain immutable.
403
+ */
404
+ releaseRemoteIds?: readonly OfflineReplicaRemoteIdRelease[];
324
405
  removeRows?: readonly OfflineReplicaRowKey[];
325
406
  putCommands?: readonly OfflineCommand[];
326
407
  removeCommandIds?: readonly string[];
@@ -329,23 +410,23 @@ interface OfflineReplicaTransaction {
329
410
  /** Durable local replica and outbox persistence contract. */
330
411
  interface OfflineRepository {
331
412
  initialize(): Promise<void>;
332
- getLastUserId(): Promise<number | null>;
333
- setLastUserId(userId: number): Promise<void>;
334
- getSessionManifest<T>(userId: number): Promise<T | null>;
335
- putSessionManifest<T>(userId: number, value: T): Promise<void>;
336
- getReplicaRow<TValues = unknown>(scope: OfflineScope, sourceKey: string, localId: string): Promise<OfflineReplicaRow<TValues> | null>;
413
+ getLastUserId(): Promise<OfflinePrincipalId | null>;
414
+ setLastUserId(userId: OfflinePrincipalId): Promise<void>;
415
+ getSessionManifest<T>(userId: OfflinePrincipalId): Promise<T | null>;
416
+ putSessionManifest<T>(userId: OfflinePrincipalId, value: T): Promise<void>;
417
+ getReplicaRow<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaAddress): Promise<OfflineReplicaRow<TValues> | null>;
337
418
  /** Internal durable lookup used by synchronization; includes pending-delete tombstones. */
338
- getReplicaRowIncludingPendingDelete?<TValues = unknown>(scope: OfflineScope, sourceKey: string, localId: string): Promise<OfflineReplicaRow<TValues> | null>;
419
+ getReplicaRowIncludingPendingDelete?<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaAddress): Promise<OfflineReplicaRow<TValues> | null>;
339
420
  getReplicaRows<TValues = unknown>(scope: OfflineScope, sourceKey: string): Promise<OfflineReplicaRow<TValues>[]>;
340
- getReplicaRowByServerId<TValues = unknown>(scope: OfflineScope, sourceKey: string, serverId: number): Promise<OfflineReplicaRow<TValues> | null>;
421
+ getReplicaRowByRemoteId<TValues = unknown>(scope: OfflineScope, sourceKey: string, remoteId: OfflineGeneratedRemoteId): Promise<OfflineReplicaRow<TValues> | null>;
341
422
  getReplicaRowByRemoteIdentity<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaRemoteIdentity): Promise<OfflineReplicaRow<TValues> | null>;
342
423
  getReplicaCursor(scope: OfflineScope): Promise<OfflineReplicaCursor | null>;
343
424
  getCommands(scope: OfflineScope): Promise<OfflineCommand[]>;
344
- getCommandsForUser?(userId: number): Promise<OfflineCommand[]>;
425
+ getCommandsForUser?(userId: OfflinePrincipalId): Promise<OfflineCommand[]>;
345
426
  putCommand(command: OfflineCommand): Promise<void>;
346
427
  replaceCommand(command: OfflineCommand): Promise<void>;
347
428
  removeCommand(commandId: string): Promise<void>;
348
- clearUser(userId: number): Promise<void>;
429
+ clearUser(userId: OfflinePrincipalId): Promise<void>;
349
430
  clearScope(scope: OfflineScope): Promise<void>;
350
431
  transactReplica(transaction: OfflineReplicaTransaction): Promise<void>;
351
432
  }
@@ -357,22 +438,22 @@ declare function selectOfflineRepository(platform: string, webRepository: Offlin
357
438
  declare class IonicOfflineRepository implements OfflineRepository {
358
439
  #private;
359
440
  initialize(): Promise<void>;
360
- getLastUserId(): Promise<number | null>;
361
- setLastUserId(userId: number): Promise<void>;
362
- getSessionManifest<T>(userId: number): Promise<T | null>;
363
- putSessionManifest<T>(userId: number, value: T): Promise<void>;
364
- getReplicaRow<TValues = unknown>(scope: OfflineScope, sourceKey: string, localId: string): Promise<OfflineReplicaRow<TValues> | null>;
365
- getReplicaRowIncludingPendingDelete<TValues = unknown>(scope: OfflineScope, sourceKey: string, localId: string): Promise<OfflineReplicaRow<TValues> | null>;
441
+ getLastUserId(): Promise<OfflinePrincipalId | null>;
442
+ setLastUserId(userId: OfflinePrincipalId): Promise<void>;
443
+ getSessionManifest<T>(userId: OfflinePrincipalId): Promise<T | null>;
444
+ putSessionManifest<T>(userId: OfflinePrincipalId, value: T): Promise<void>;
445
+ getReplicaRow<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaAddress): Promise<OfflineReplicaRow<TValues> | null>;
446
+ getReplicaRowIncludingPendingDelete<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaAddress): Promise<OfflineReplicaRow<TValues> | null>;
366
447
  getReplicaRows<TValues = unknown>(scope: OfflineScope, sourceKey: string): Promise<OfflineReplicaRow<TValues>[]>;
367
- getReplicaRowByServerId<TValues = unknown>(scope: OfflineScope, sourceKey: string, serverId: number): Promise<OfflineReplicaRow<TValues> | null>;
448
+ getReplicaRowByRemoteId<TValues = unknown>(scope: OfflineScope, sourceKey: string, remoteId: OfflineGeneratedRemoteId): Promise<OfflineReplicaRow<TValues> | null>;
368
449
  getReplicaRowByRemoteIdentity<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaRemoteIdentity): Promise<OfflineReplicaRow<TValues> | null>;
369
450
  getReplicaCursor(scope: OfflineScope): Promise<OfflineReplicaCursor | null>;
370
451
  getCommands(scope: OfflineScope): Promise<OfflineCommand[]>;
371
- getCommandsForUser(userId: number): Promise<OfflineCommand[]>;
452
+ getCommandsForUser(userId: OfflinePrincipalId): Promise<OfflineCommand[]>;
372
453
  putCommand(command: OfflineCommand): Promise<void>;
373
454
  replaceCommand(command: OfflineCommand): Promise<void>;
374
455
  removeCommand(commandId: string): Promise<void>;
375
- clearUser(userId: number): Promise<void>;
456
+ clearUser(userId: OfflinePrincipalId): Promise<void>;
376
457
  clearScope(scope: OfflineScope): Promise<void>;
377
458
  transactReplica(transaction: OfflineReplicaTransaction): Promise<void>;
378
459
  static ɵfac: i0.ɵɵFactoryDeclaration<IonicOfflineRepository, never>;
@@ -425,34 +506,46 @@ declare class OfflineReplicaPullService {
425
506
 
426
507
  /** Server acknowledgement used to reconcile one optimistic local mutation. */
427
508
  interface OfflineCommandResult {
428
- /** AUTO_INCREMENT id returned by a successful create. */
429
- serverId?: number;
509
+ /** Remote id returned by a successful generated-identity mutation. */
510
+ remoteId?: OfflineGeneratedRemoteId;
430
511
  serverRevision?: string | number;
431
512
  /** Full server-confirmed domain values after applying the mutation. */
432
513
  confirmedValues?: unknown;
433
514
  /** Removes the local replica row after a confirmed server delete. */
434
515
  removeReplica?: boolean;
516
+ /**
517
+ * Releases the deleted row's remote identity while keeping
518
+ * its immutable local id for a queued recreate of the same logical target.
519
+ */
520
+ clearRemoteId?: boolean;
435
521
  response?: unknown;
436
522
  }
437
- /** Target ids resolved from the local replica immediately before transport. */
438
- interface OfflineCommandTarget {
439
- localId: string;
440
- serverId: number | null;
441
- /** Composite identity derived from current replica values for a natural-key entity. */
442
- naturalKey?: OfflineNaturalKey;
443
- }
523
+ /** Target identity resolved from the local replica immediately before transport. */
524
+ type OfflineCommandTarget = {
525
+ readonly kind: 'generated';
526
+ readonly localId: string;
527
+ readonly remoteId: OfflineGeneratedRemoteId | null;
528
+ } | {
529
+ readonly kind: 'natural';
530
+ readonly naturalKey: OfflineNaturalKey;
531
+ };
444
532
  /** 不透明なoperationを製品APIへ送信し、local replicaへ投影するadapter。 */
445
533
  /** Product adapter that sends commands and projects acknowledgements into entities. */
446
534
  interface OfflineCommandExecutor {
447
535
  /** Sends the command using `command.commandId` as its durable server-side idempotency key. */
448
536
  execute(command: OfflineCommand, target: OfflineCommandTarget): Promise<OfflineCommandResult>;
449
537
  withServerRevision(command: OfflineCommand, revision: string | number): OfflineCommand;
538
+ /**
539
+ * Removes the deleted remote row's revision from a queued recreate.
540
+ * Required only when `clearRemoteId` completes while later commands remain.
541
+ */
542
+ withoutServerRevision?(command: OfflineCommand): OfflineCommand;
450
543
  }
451
544
  /** DI token for the product-specific command transport adapter. */
452
545
  declare const OFFLINE_COMMAND_EXECUTOR: InjectionToken<OfflineCommandExecutor>;
453
546
  /** Authenticated user and partition scopes currently eligible for synchronization. */
454
547
  interface OfflineSyncSession {
455
- userId: number;
548
+ userId: OfflinePrincipalId;
456
549
  scopes: OfflineScope[];
457
550
  }
458
551
  /** Product adapter that exposes the currently authenticated synchronization session. */
@@ -464,6 +557,25 @@ interface OfflineSyncContext {
464
557
  }
465
558
  /** DI token for authenticated synchronization context. */
466
559
  declare const OFFLINE_SYNC_CONTEXT: InjectionToken<OfflineSyncContext>;
560
+ /** Resolves the transport target from a replica row. */
561
+ declare function offlineCommandTargetFromReplicaRow(row: {
562
+ readonly identity: OfflineReplicaIdentity;
563
+ }): OfflineCommandTarget;
564
+ /** Resolves a command lookup identity from an enqueue request identity. */
565
+ declare function offlineCommandLookupIdentity(identity: EnqueueOfflineCommandIdentity): OfflineCommandIdentity;
566
+ /** Enqueue identity for generated entities. */
567
+ interface EnqueueOfflineGeneratedIdentity {
568
+ readonly kind: 'generated';
569
+ readonly localId: string;
570
+ readonly remoteId?: OfflineGeneratedRemoteId | null;
571
+ readonly remoteIdHint?: OfflineGeneratedRemoteId | null;
572
+ }
573
+ /** Enqueue identity for natural-key entities. */
574
+ interface EnqueueOfflineNaturalIdentity {
575
+ readonly kind: 'natural';
576
+ readonly naturalKey: OfflineNaturalKey;
577
+ }
578
+ type EnqueueOfflineCommandIdentity = EnqueueOfflineGeneratedIdentity | EnqueueOfflineNaturalIdentity;
467
579
 
468
580
  /** Optional product hooks for entity projection and command cleanup. */
469
581
  interface OfflineCommandHooks {
@@ -476,7 +588,7 @@ declare const OFFLINE_COMMAND_HOOKS: InjectionToken<OfflineCommandHooks>;
476
588
 
477
589
  /** Persisted identity and partition boundary for one authenticated local replica. */
478
590
  interface OfflineSessionManifest {
479
- userId: number;
591
+ userId: OfflinePrincipalId;
480
592
  readonly scopeIds: readonly string[];
481
593
  /** Authentication-provider subject used to distinguish users on a shared device. */
482
594
  authSubject: string | null;
@@ -491,8 +603,8 @@ declare class OfflineSessionService {
491
603
  #private;
492
604
  readonly activeManifest: i0.Signal<OfflineSessionManifest | null>;
493
605
  initialize(): Promise<void>;
494
- activateSession(userId: number, scopeIds: readonly string[], authSubject: string | null): Promise<void>;
495
- activateSession(userId: number, scopeIds: readonly string[], authSubject: string | null, lease: OfflineSessionTransitionLease): Promise<boolean>;
606
+ activateSession(userId: OfflinePrincipalId, scopeIds: readonly string[], authSubject: string | null): Promise<void>;
607
+ activateSession(userId: OfflinePrincipalId, scopeIds: readonly string[], authSubject: string | null, lease: OfflineSessionTransitionLease): Promise<boolean>;
496
608
  clearActiveSession(): Promise<void>;
497
609
  /** Immediately revoke local and remote runtime access while durable cleanup is pending. */
498
610
  revokeAccess(): void;
@@ -523,12 +635,12 @@ declare class OfflineSessionService {
523
635
  activateOfflineSession(authSubject?: string | null, lease?: OfflineSessionTransitionLease): Promise<OfflineSessionManifest | null>;
524
636
  /** Returns the session allowed to use the local replica and append outbox commands. */
525
637
  getLocalSession(): Promise<{
526
- userId: number;
638
+ userId: OfflinePrincipalId;
527
639
  scopes: OfflineScope[];
528
640
  } | null>;
529
641
  /** Returns the remotely authenticated session eligible for pull and command replay. */
530
642
  getSession(): Promise<{
531
- userId: number;
643
+ userId: OfflinePrincipalId;
532
644
  scopes: OfflineScope[];
533
645
  } | null>;
534
646
  static ɵfac: i0.ɵɵFactoryDeclaration<OfflineSessionService, never>;
@@ -543,11 +655,11 @@ declare class OfflineCoordinatorService {
543
655
  readonly networkState: i0.Signal<_rdlabo_ionic_angular_kit_offline.OfflineNetworkState>;
544
656
  readonly syncState: i0.Signal<_rdlabo_ionic_angular_kit_offline.OfflineSyncState>;
545
657
  readonly pendingCount: i0.Signal<number>;
546
- readonly conflicts: i0.Signal<_rdlabo_ionic_angular_kit_offline.OfflineCommand<unknown>[]>;
658
+ readonly conflicts: i0.Signal<_rdlabo_ionic_angular_kit_offline.OfflineCommand[]>;
547
659
  initialize(): Promise<void>;
548
- activateSession(userId: number, scopeIds: readonly string[], authSubject: string | null): Promise<void>;
660
+ activateSession(userId: OfflinePrincipalId, scopeIds: readonly string[], authSubject: string | null): Promise<void>;
549
661
  /** Installs a remotely verified identity without starting pull or outbox replay. */
550
- prepareRemoteSession(userId: number, scopeIds: readonly string[], authSubject: string | null, authLease?: OfflineSessionTransitionLease): Promise<boolean>;
662
+ prepareRemoteSession(userId: OfflinePrincipalId, scopeIds: readonly string[], authSubject: string | null, authLease?: OfflineSessionTransitionLease): Promise<boolean>;
551
663
  /** Starts pull and outbox replay after the caller has published remote access. */
552
664
  resumeRemoteSession(): Promise<void>;
553
665
  /**
@@ -563,7 +675,7 @@ declare class OfflineCoordinatorService {
563
675
 
564
676
  /** Remote identity fields required to activate an offline session boundary. */
565
677
  interface OfflineRemoteIdentity {
566
- readonly userId: number;
678
+ readonly userId: OfflinePrincipalId;
567
679
  readonly scopeIds: readonly string[];
568
680
  readonly authSubject: string;
569
681
  }
@@ -758,22 +870,22 @@ type SQLiteValue = string | number | null;
758
870
  declare class SqliteOfflineRepository implements OfflineRepository {
759
871
  #private;
760
872
  initialize(): Promise<void>;
761
- getLastUserId(): Promise<number | null>;
762
- setLastUserId(userId: number): Promise<void>;
763
- getSessionManifest<T>(userId: number): Promise<T | null>;
764
- putSessionManifest<T>(userId: number, value: T): Promise<void>;
765
- getReplicaRow<TValues = unknown>(scope: OfflineScope, sourceKey: string, localId: string): Promise<OfflineReplicaRow<TValues> | null>;
766
- getReplicaRowIncludingPendingDelete<TValues = unknown>(scope: OfflineScope, sourceKey: string, localId: string): Promise<OfflineReplicaRow<TValues> | null>;
873
+ getLastUserId(): Promise<OfflinePrincipalId | null>;
874
+ setLastUserId(userId: OfflinePrincipalId): Promise<void>;
875
+ getSessionManifest<T>(userId: OfflinePrincipalId): Promise<T | null>;
876
+ putSessionManifest<T>(userId: OfflinePrincipalId, value: T): Promise<void>;
877
+ getReplicaRow<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaAddress): Promise<OfflineReplicaRow<TValues> | null>;
878
+ getReplicaRowIncludingPendingDelete<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaAddress): Promise<OfflineReplicaRow<TValues> | null>;
767
879
  getReplicaRows<TValues = unknown>(scope: OfflineScope, sourceKey: string): Promise<OfflineReplicaRow<TValues>[]>;
768
- getReplicaRowByServerId<TValues = unknown>(scope: OfflineScope, sourceKey: string, serverId: number): Promise<OfflineReplicaRow<TValues> | null>;
880
+ getReplicaRowByRemoteId<TValues = unknown>(scope: OfflineScope, sourceKey: string, remoteId: OfflineGeneratedRemoteId): Promise<OfflineReplicaRow<TValues> | null>;
769
881
  getReplicaRowByRemoteIdentity<TValues = unknown>(scope: OfflineScope, sourceKey: string, identity: OfflineReplicaRemoteIdentity): Promise<OfflineReplicaRow<TValues> | null>;
770
882
  getReplicaCursor(scope: OfflineScope): Promise<OfflineReplicaCursor | null>;
771
883
  getCommands(scope: OfflineScope): Promise<OfflineCommand[]>;
772
- getCommandsForUser(userId: number): Promise<OfflineCommand[]>;
884
+ getCommandsForUser(userId: OfflinePrincipalId): Promise<OfflineCommand[]>;
773
885
  putCommand(command: OfflineCommand): Promise<void>;
774
886
  replaceCommand(command: OfflineCommand): Promise<void>;
775
887
  removeCommand(commandId: string): Promise<void>;
776
- clearUser(userId: number): Promise<void>;
888
+ clearUser(userId: OfflinePrincipalId): Promise<void>;
777
889
  clearScope(scope: OfflineScope): Promise<void>;
778
890
  transactReplica(transaction: OfflineReplicaTransaction): Promise<void>;
779
891
  static ɵfac: i0.ɵɵFactoryDeclaration<SqliteOfflineRepository, never>;
@@ -811,10 +923,7 @@ type OfflineSyncState = 'idle' | 'pending' | 'syncing' | 'attention';
811
923
  interface EnqueueOfflineCommand<T = unknown> {
812
924
  scopeId: string;
813
925
  aggregateType: string;
814
- /** Stable UUID generated by the client before the entity is first written. */
815
- aggregateLocalId: string;
816
- /** Known immutable server identity when adopting an entity before its first replica pull. */
817
- serverId?: number | null;
926
+ identity: EnqueueOfflineCommandIdentity;
818
927
  operation: string;
819
928
  payload: T;
820
929
  /** Full local entity value committed to the replica before the command is exposed to the UI. */
@@ -840,9 +949,9 @@ declare class OfflineOutboxCapacityError extends Error {
840
949
  /** Maintains the optimistic local replica and synchronizes its durable outbox. */
841
950
  declare class OfflineSyncService {
842
951
  #private;
843
- readonly pendingCommands: i0.Signal<OfflineCommand<unknown>[]>;
952
+ readonly pendingCommands: i0.Signal<OfflineCommand[]>;
844
953
  readonly pendingCount: i0.Signal<number>;
845
- readonly conflicts: i0.Signal<OfflineCommand<unknown>[]>;
954
+ readonly conflicts: i0.Signal<OfflineCommand[]>;
846
955
  readonly syncState: i0.Signal<OfflineSyncState>;
847
956
  constructor();
848
957
  initialize(): Promise<void>;
@@ -857,6 +966,18 @@ declare class OfflineSyncService {
857
966
  enqueue<T>(request: EnqueueOfflineCommand<T>, options?: {
858
967
  flush?: boolean;
859
968
  }): Promise<string>;
969
+ /**
970
+ * Serializes a product-owned replica projection with enqueue and command ACK
971
+ * reconciliation. For read/derive/write cache updates, prefer
972
+ * `runSerializedReplicaMutation` so the read is serialized as well.
973
+ */
974
+ transactReplica(transaction: OfflineReplicaTransaction): Promise<void>;
975
+ /**
976
+ * Runs a product cache's replica read/derive/write sequence atomically with
977
+ * enqueue and ACK projection. Use this for any repository reads that inform
978
+ * a later transaction; `transactReplica` alone only serializes the write.
979
+ */
980
+ runSerializedReplicaMutation<T>(operation: (repository: OfflineRepository) => Promise<T>): Promise<T>;
860
981
  discard(commandId: string, options?: {
861
982
  flush?: boolean;
862
983
  }): Promise<void>;
@@ -876,5 +997,5 @@ declare class OfflineRequestFallbackService {
876
997
  static ɵprov: i0.ɵɵInjectableDeclaration<OfflineRequestFallbackService>;
877
998
  }
878
999
 
879
- export { COMMUNITY_SQLITE, DEFAULT_OFFLINE_COMMAND_HOOKS, IonicOfflineRepository, OFFLINE_BYPASS, OFFLINE_COMMAND_EXECUTOR, OFFLINE_COMMAND_HOOKS, OFFLINE_KIT_OPTIONS, OFFLINE_REPLICA_PULLER, OFFLINE_REPOSITORY, OFFLINE_REQUEST_POLICIES, OFFLINE_RESPONSE_HEADER, OFFLINE_SCHEMA_VERSION, OFFLINE_SYNC_CONTEXT, OfflineCoordinatorService, OfflineNetworkService, OfflineOutboxCapacityError, OfflinePayloadValidationError, OfflineReplicaPullService, OfflineRequestFallbackService, OfflineRequestPolicyRegistry, OfflineSessionService, OfflineSyncService, SqliteOfflineRepository, assertOfflineReplicaNaturalKeyBaseline, assertOfflineReplicaServerId, booleanColumn, canonicalOfflineRemoteIdentity, createCommunitySqliteDriver, createOfflineAuthBridge, datetime, decodeOfflineReplicaValues, defineOfflineReplicaSchema, defineReplicaEntity, encodeOfflineReplicaValues, ignored, integer, isOfflineFallbackError, json, naturalKey, normalizeOfflineNaturalKey, nullable, offlineInterceptor, offlineNaturalKeyFromValues, projectOfflineReplicaValues, provideOffline, provideOfflineRequestPolicy, real, selectOfflineRepository, serverId, sha256OfflineReplicaSchema, text };
880
- export type { CommunitySqliteConnection, CommunitySqliteDatabase, CommunitySqliteDriver, CreateOfflineAuthBridgeOptions, EnqueueOfflineCommand, OfflineAuthBridgeConfig, OfflineAuthExchangeContext, OfflineAuthExchangePhase, OfflineAuthResumeContext, OfflineCommand, OfflineCommandExecutor, OfflineCommandHooks, OfflineCommandResult, OfflineCommandState, OfflineCommandTarget, OfflineKitOptions, OfflineLogoutAction, OfflineNaturalKey, OfflineNaturalKeyValue, OfflineNetworkState, OfflineOutboxLimits, OfflineReadRequestPlan, OfflineRemoteIdentity, OfflineReplicaChange, OfflineReplicaColumnDef, OfflineReplicaCursor, OfflineReplicaEntityDefinition, OfflineReplicaEntitySchema, OfflineReplicaEntityScope, OfflineReplicaFieldDescriptor, OfflineReplicaFieldPolicy, OfflineReplicaIdentityDescriptor, OfflineReplicaIgnoredDef, OfflineReplicaMigration, OfflineReplicaMutation, OfflineReplicaNaturalKeyDef, OfflineReplicaPullPage, OfflineReplicaPullRequest, OfflineReplicaPuller, OfflineReplicaRemoteIdentity, OfflineReplicaRow, OfflineReplicaRowKey, OfflineReplicaSchemaBundle, OfflineReplicaSchemaDefinition, OfflineReplicaServerIdDef, OfflineReplicaSqliteAffinity, OfflineReplicaStorageKind, OfflineReplicaSyncState, OfflineReplicaTransaction, OfflineReplicaVisibility, OfflineReplicaWebMigrationCallback, OfflineReplicaWebMigrationResult, OfflineReplicaWebMigrationRow, OfflineRepository, OfflineRequestPlan, OfflineRequestPolicy, OfflineResponseSource, OfflineScope, OfflineSessionManifest, OfflineSessionTransitionLease, OfflineSyncContext, OfflineSyncSession, OfflineSyncState, ProvideOfflineOptions };
1000
+ export { COMMUNITY_SQLITE, DEFAULT_OFFLINE_COMMAND_HOOKS, IonicOfflineRepository, OFFLINE_BYPASS, OFFLINE_COMMAND_EXECUTOR, OFFLINE_COMMAND_HOOKS, OFFLINE_KIT_OPTIONS, OFFLINE_REPLICA_PULLER, OFFLINE_REPOSITORY, OFFLINE_REQUEST_POLICIES, OFFLINE_RESPONSE_HEADER, OFFLINE_SCHEMA_VERSION, OFFLINE_SYNC_CONTEXT, OfflineCoordinatorService, OfflineNetworkService, OfflineOutboxCapacityError, OfflinePayloadValidationError, OfflineReplicaPullService, OfflineRequestFallbackService, OfflineRequestPolicyRegistry, OfflineSessionService, OfflineSyncService, SqliteOfflineRepository, assertOfflineLocalId, assertOfflineReplicaGeneratedRemoteId, assertOfflineReplicaNaturalKeyBaseline, booleanColumn, canonicalOfflineCommandIdentity, canonicalOfflinePrincipalId, canonicalOfflineRemoteIdentity, canonicalOfflineReplicaIdentity, commandIdentityFromReplicaIdentity, commandIdentityMatchesReplicaRow, createCommunitySqliteDriver, createOfflineAuthBridge, datetime, decodeOfflineReplicaValues, defineOfflineReplicaSchema, defineReplicaEntity, encodeOfflineReplicaValues, generatedId, ignored, integer, isOfflineFallbackError, json, localOnly, naturalKey, normalizeOfflineNaturalKey, nullable, offlineCommandLookupIdentity, offlineCommandTargetFromReplicaRow, offlineGeneratedReplicaIdentity, offlineInterceptor, offlineNaturalKeyFromValues, offlineNaturalReplicaIdentity, offlineReplicaRemoteIdentity, parseOfflineCommandIdentity, parseOfflinePrincipalId, projectOfflineReplicaValues, provideOffline, provideOfflineRequestPolicy, real, replicaAddressFromIdentity, selectOfflineRepository, serializeOfflineCommandIdentity, sha256OfflineReplicaSchema, text };
1001
+ export type { CommunitySqliteConnection, CommunitySqliteDatabase, CommunitySqliteDriver, CreateOfflineAuthBridgeOptions, EnqueueOfflineCommand, EnqueueOfflineCommandIdentity, EnqueueOfflineGeneratedIdentity, EnqueueOfflineNaturalIdentity, OfflineAuthBridgeConfig, OfflineAuthExchangeContext, OfflineAuthExchangePhase, OfflineAuthResumeContext, OfflineCommand, OfflineCommandExecutor, OfflineCommandHooks, OfflineCommandIdentity, OfflineCommandResult, OfflineCommandState, OfflineCommandTarget, OfflineGeneratedRemoteId, OfflineKitOptions, OfflineLogoutAction, OfflineNaturalKey, OfflineNaturalKeyValue, OfflineNetworkState, OfflineOutboxLimits, OfflinePrincipalId, OfflineReadRequestPlan, OfflineRemoteIdentity, OfflineReplicaAddress, OfflineReplicaChange, OfflineReplicaColumnDef, OfflineReplicaCursor, OfflineReplicaEntityDefinition, OfflineReplicaEntitySchema, OfflineReplicaEntityScope, OfflineReplicaFieldDescriptor, OfflineReplicaFieldPolicy, OfflineReplicaIdentity, OfflineReplicaIdentityDescriptor, OfflineReplicaIgnoredDef, OfflineReplicaLocalOnlyDef, OfflineReplicaMigration, OfflineReplicaMutation, OfflineReplicaNaturalKeyDef, OfflineReplicaPullPage, OfflineReplicaPullRequest, OfflineReplicaPuller, OfflineReplicaRemoteIdDef, OfflineReplicaRemoteIdRelease, OfflineReplicaRemoteIdentity, OfflineReplicaRow, OfflineReplicaRowKey, OfflineReplicaSchemaBundle, OfflineReplicaSchemaDefinition, OfflineReplicaSqliteAffinity, OfflineReplicaStorageKind, OfflineReplicaSyncState, OfflineReplicaTransaction, OfflineReplicaVisibility, OfflineReplicaWebMigrationCallback, OfflineReplicaWebMigrationResult, OfflineReplicaWebMigrationRow, OfflineRepository, OfflineRequestPlan, OfflineRequestPolicy, OfflineResponseSource, OfflineScope, OfflineSessionManifest, OfflineSessionTransitionLease, OfflineSyncContext, OfflineSyncSession, OfflineSyncState, ProvideOfflineOptions };