@rdlabo/ionic-angular-kit 21.4.1 → 21.4.3
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.4.
|
|
3
|
+
"version": "21.4.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/rdlabo-team/ionic-angular-library.git"
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"@capacitor/core": ">=6.0.0 <9.0.0",
|
|
16
16
|
"@capacitor/app": ">=6.0.0 <9.0.0",
|
|
17
17
|
"@capawesome/capacitor-live-update": ">=6.0.0 <9.0.0",
|
|
18
|
-
"@capawesome-team/capacitor-sqlite": ">=0.3.0 <1.0.0",
|
|
19
18
|
"@capacitor/haptics": ">=6.0.0 <9.0.0",
|
|
20
19
|
"@capacitor/keyboard": ">=6.0.0 <9.0.0",
|
|
21
20
|
"@capacitor/network": ">=6.0.0 <9.0.0",
|
|
@@ -37,9 +36,6 @@
|
|
|
37
36
|
"@capawesome/capacitor-live-update": {
|
|
38
37
|
"optional": true
|
|
39
38
|
},
|
|
40
|
-
"@capawesome-team/capacitor-sqlite": {
|
|
41
|
-
"optional": true
|
|
42
|
-
},
|
|
43
39
|
"@capacitor/preferences": {
|
|
44
40
|
"optional": true
|
|
45
41
|
},
|
|
@@ -83,12 +83,14 @@ interface OfflineReplicaIgnoredDef {
|
|
|
83
83
|
readonly reason: string;
|
|
84
84
|
}
|
|
85
85
|
type StripNullish<T> = Exclude<T, null | undefined>;
|
|
86
|
+
type NormalizeReplicaColumnValue<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends Date ? string | Date : T;
|
|
86
87
|
type IsNullableSelectValue<T> = null extends T ? true : undefined extends T ? true : false;
|
|
87
|
-
type
|
|
88
|
+
type OfflineReplicaColumnDefForValue<T> = IsNullableSelectValue<T> extends true ? OfflineReplicaColumnDef<NormalizeReplicaColumnValue<StripNullish<T>>, {
|
|
88
89
|
readonly [replicaNullableBrand]: 'nullable';
|
|
89
|
-
}> : OfflineReplicaColumnDef<
|
|
90
|
+
}> : OfflineReplicaColumnDef<NormalizeReplicaColumnValue<T>, {
|
|
90
91
|
readonly [replicaNullableBrand]: 'required';
|
|
91
|
-
}
|
|
92
|
+
}>;
|
|
93
|
+
type OfflineReplicaFieldDefForKey<TSelect extends Record<string, unknown>, K extends keyof TSelect> = (StripNullish<TSelect[K]> extends number ? OfflineReplicaServerIdDef : never) | OfflineReplicaIgnoredDef | OfflineReplicaColumnDefForValue<TSelect[K]>;
|
|
92
94
|
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;
|
|
93
95
|
/** Configuration accepted by {@link defineReplicaEntity}. */
|
|
94
96
|
interface OfflineReplicaEntityDefinition<TSelect extends Record<string, unknown>, TFields extends {
|
|
@@ -425,8 +427,8 @@ declare class OfflineCoordinatorService {
|
|
|
425
427
|
interface OfflineKitOptions {
|
|
426
428
|
/** Encrypted SQLite database name used on iOS and Android. */
|
|
427
429
|
databaseName: string;
|
|
428
|
-
/**
|
|
429
|
-
|
|
430
|
+
/** Creates the native database encryption key on first install. Required on iOS and Android. */
|
|
431
|
+
createEncryptionKey?: () => Promise<string>;
|
|
430
432
|
/** Versioned product replica schema applied to native SQLite during initialization. */
|
|
431
433
|
replicaSchema: OfflineReplicaSchemaBundle;
|
|
432
434
|
}
|
|
@@ -477,12 +479,11 @@ declare class OfflineRequestPolicyRegistry {
|
|
|
477
479
|
static ɵprov: i0.ɵɵInjectableDeclaration<OfflineRequestPolicyRegistry>;
|
|
478
480
|
}
|
|
479
481
|
|
|
480
|
-
/** Minimal
|
|
481
|
-
interface
|
|
482
|
+
/** Minimal native SQLite driver surface required by the offline repository. */
|
|
483
|
+
interface CommunitySqliteDriver {
|
|
482
484
|
open(options: {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
readOnly: false;
|
|
485
|
+
databaseName: string;
|
|
486
|
+
createEncryptionKey?: () => Promise<string>;
|
|
486
487
|
}): Promise<{
|
|
487
488
|
databaseId: string;
|
|
488
489
|
}>;
|
|
@@ -509,10 +510,31 @@ interface CapawesomeSqlitePlugin {
|
|
|
509
510
|
databaseId: string;
|
|
510
511
|
}): Promise<void>;
|
|
511
512
|
}
|
|
512
|
-
/**
|
|
513
|
-
|
|
513
|
+
/** Open community SQLite database surface used by the standard driver. */
|
|
514
|
+
interface CommunitySqliteDatabase {
|
|
515
|
+
open(): Promise<void>;
|
|
516
|
+
run(statement: string, values?: unknown[], transaction?: boolean): Promise<unknown>;
|
|
517
|
+
query(statement: string, values?: unknown[]): Promise<{
|
|
518
|
+
values?: unknown[];
|
|
519
|
+
}>;
|
|
520
|
+
beginTransaction(): Promise<unknown>;
|
|
521
|
+
commitTransaction(): Promise<unknown>;
|
|
522
|
+
rollbackTransaction(): Promise<unknown>;
|
|
523
|
+
}
|
|
524
|
+
/** Community SQLite connection surface used to provision encrypted databases. */
|
|
525
|
+
interface CommunitySqliteConnection {
|
|
526
|
+
isSecretStored(): Promise<{
|
|
527
|
+
result?: boolean;
|
|
528
|
+
}>;
|
|
529
|
+
setEncryptionSecret(passphrase: string): Promise<void>;
|
|
530
|
+
createConnection(database: string, encrypted: boolean, mode: string, version: number, readonly: boolean): Promise<CommunitySqliteDatabase>;
|
|
531
|
+
}
|
|
532
|
+
/** DI token for the native community SQLite driver. */
|
|
533
|
+
declare const COMMUNITY_SQLITE: InjectionToken<CommunitySqliteDriver | null>;
|
|
534
|
+
/** Create the standard encrypted `@capacitor-community/sqlite` driver. */
|
|
535
|
+
declare function createCommunitySqliteDriver(connection: CommunitySqliteConnection): CommunitySqliteDriver;
|
|
514
536
|
type SQLiteValue = string | number | null;
|
|
515
|
-
/** Native iOS/Android
|
|
537
|
+
/** Native iOS/Android repository backed by encrypted `@capacitor-community/sqlite`. */
|
|
516
538
|
declare class SqliteOfflineRepository implements OfflineRepository {
|
|
517
539
|
#private;
|
|
518
540
|
initialize(): Promise<void>;
|
|
@@ -548,14 +570,14 @@ interface ProvideOfflineOptions extends OfflineKitOptions {
|
|
|
548
570
|
commandHooks?: Type<OfflineCommandHooks>;
|
|
549
571
|
/** Optional additional providers required by product adapters. */
|
|
550
572
|
providers?: readonly Provider[];
|
|
551
|
-
/**
|
|
552
|
-
|
|
573
|
+
/** Application-installed `@capacitor-community/sqlite` connection. Required only on iOS and Android. */
|
|
574
|
+
sqliteConnection?: CommunitySqliteConnection;
|
|
553
575
|
}
|
|
554
576
|
/**
|
|
555
577
|
* Provide the standard scoped offline runtime.
|
|
556
578
|
*
|
|
557
579
|
* @remarks
|
|
558
|
-
* Web uses Ionic Storage. Native iOS/Android uses encrypted
|
|
580
|
+
* Web uses Ionic Storage. Native iOS/Android uses encrypted `@capacitor-community/sqlite`. The application owns
|
|
559
581
|
* URL/DTO policy and command execution; the kit owns persistence, ordering, retries, and session
|
|
560
582
|
* isolation.
|
|
561
583
|
*/
|
|
@@ -592,6 +614,8 @@ interface EnqueueOfflineCommand<T = unknown> {
|
|
|
592
614
|
aggregateType: string;
|
|
593
615
|
/** Stable UUID generated by the client before the entity is first written. */
|
|
594
616
|
aggregateLocalId: string;
|
|
617
|
+
/** Known immutable server identity when adopting an entity before its first replica pull. */
|
|
618
|
+
serverId?: number | null;
|
|
595
619
|
operation: string;
|
|
596
620
|
payload: T;
|
|
597
621
|
/** Full local entity value committed to the replica before the command is exposed to the UI. */
|
|
@@ -637,5 +661,5 @@ declare class OfflineRequestFallbackService {
|
|
|
637
661
|
static ɵprov: i0.ɵɵInjectableDeclaration<OfflineRequestFallbackService>;
|
|
638
662
|
}
|
|
639
663
|
|
|
640
|
-
export {
|
|
641
|
-
export type {
|
|
664
|
+
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, OfflinePayloadValidationError, OfflineReplicaPullService, OfflineRequestFallbackService, OfflineRequestPolicyRegistry, OfflineSessionService, OfflineSyncService, SqliteOfflineRepository, booleanColumn, createCommunitySqliteDriver, datetime, decodeOfflineReplicaValues, defineOfflineReplicaSchema, defineReplicaEntity, encodeOfflineReplicaValues, ignored, integer, isOfflineFallbackError, json, nullable, offlineInterceptor, projectOfflineReplicaValues, provideOffline, provideOfflineRequestPolicy, real, selectOfflineRepository, serverId, sha256OfflineReplicaSchema, text };
|
|
665
|
+
export type { CommunitySqliteConnection, CommunitySqliteDatabase, CommunitySqliteDriver, EnqueueOfflineCommand, OfflineCommand, OfflineCommandExecutor, OfflineCommandHooks, OfflineCommandResult, OfflineCommandState, OfflineCommandTarget, OfflineKitOptions, OfflineLogoutAction, OfflineNetworkState, OfflineReadRequestPlan, OfflineReplicaChange, OfflineReplicaColumnDef, OfflineReplicaCursor, OfflineReplicaEntityDefinition, OfflineReplicaEntitySchema, OfflineReplicaEntityScope, OfflineReplicaFieldDescriptor, OfflineReplicaFieldPolicy, OfflineReplicaIgnoredDef, OfflineReplicaMigration, OfflineReplicaPullPage, OfflineReplicaPullRequest, OfflineReplicaPuller, OfflineReplicaRow, OfflineReplicaRowKey, OfflineReplicaSchemaBundle, OfflineReplicaSchemaDefinition, OfflineReplicaServerIdDef, OfflineReplicaSqliteAffinity, OfflineReplicaStorageKind, OfflineReplicaSyncState, OfflineReplicaTransaction, OfflineReplicaWebMigrationCallback, OfflineReplicaWebMigrationResult, OfflineReplicaWebMigrationRow, OfflineRepository, OfflineRequestPlan, OfflineRequestPolicy, OfflineResponseSource, OfflineScope, OfflineSessionManifest, OfflineSyncContext, OfflineSyncSession, OfflineSyncState, ProvideOfflineOptions };
|