@capgo/capacitor-persistent-account 7.1.3 → 7.2.1
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.swift +1 -1
- package/README.md +23 -3
- package/android/src/main/java/ee/forgr/capacitor_persistent_account/CapacitorPersistentAccountPlugin.java +1 -1
- package/dist/docs.json +45 -10
- package/dist/esm/definitions.d.ts +66 -2
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Sources/CapacitorPersistentAccountPlugin/CapacitorPersistentAccountPlugin.swift +1 -1
- package/package.json +1 -1
package/Package.swift
CHANGED
|
@@ -10,7 +10,7 @@ let package = Package(
|
|
|
10
10
|
targets: ["CapacitorPersistentAccountPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.4.
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.4.4")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/README.md
CHANGED
|
@@ -26,12 +26,23 @@ npx cap sync
|
|
|
26
26
|
<docgen-api>
|
|
27
27
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
28
28
|
|
|
29
|
+
Capacitor Persistent Account Plugin
|
|
30
|
+
|
|
31
|
+
Provides persistent storage for account data across app sessions using platform-specific
|
|
32
|
+
secure storage mechanisms. On iOS, this uses the Keychain. On Android, this uses
|
|
33
|
+
AccountManager. This ensures account data persists even after app reinstallation.
|
|
34
|
+
|
|
29
35
|
### readAccount()
|
|
30
36
|
|
|
31
37
|
```typescript
|
|
32
38
|
readAccount() => Promise<{ data: unknown | null; }>
|
|
33
39
|
```
|
|
34
40
|
|
|
41
|
+
Reads the stored account data from persistent storage.
|
|
42
|
+
|
|
43
|
+
Retrieves account data that was previously saved using saveAccount(). The data
|
|
44
|
+
persists across app sessions and survives app reinstallation on supported platforms.
|
|
45
|
+
|
|
35
46
|
**Returns:** <code>Promise<{ data: unknown; }></code>
|
|
36
47
|
|
|
37
48
|
--------------------
|
|
@@ -43,9 +54,15 @@ readAccount() => Promise<{ data: unknown | null; }>
|
|
|
43
54
|
saveAccount(options: { data: unknown; }) => Promise<void>
|
|
44
55
|
```
|
|
45
56
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
Saves account data to persistent storage.
|
|
58
|
+
|
|
59
|
+
Stores the provided account data using platform-specific secure storage mechanisms.
|
|
60
|
+
The data will persist across app sessions and survive app reinstallation.
|
|
61
|
+
Any existing account data will be overwritten.
|
|
62
|
+
|
|
63
|
+
| Param | Type | Description |
|
|
64
|
+
| ------------- | ------------------------------- | ------------------------------------------------- |
|
|
65
|
+
| **`options`** | <code>{ data: unknown; }</code> | - The options object containing the data to save. |
|
|
49
66
|
|
|
50
67
|
--------------------
|
|
51
68
|
|
|
@@ -58,6 +75,9 @@ getPluginVersion() => Promise<{ version: string; }>
|
|
|
58
75
|
|
|
59
76
|
Get the native Capacitor plugin version
|
|
60
77
|
|
|
78
|
+
Returns the version string of the native plugin implementation. Useful for
|
|
79
|
+
debugging and ensuring compatibility between the JavaScript and native layers.
|
|
80
|
+
|
|
61
81
|
**Returns:** <code>Promise<{ version: string; }></code>
|
|
62
82
|
|
|
63
83
|
--------------------
|
|
@@ -11,7 +11,7 @@ import com.getcapacitor.annotation.PermissionCallback;
|
|
|
11
11
|
@CapacitorPlugin(name = "CapacitorPersistentAccount")
|
|
12
12
|
public class CapacitorPersistentAccountPlugin extends Plugin {
|
|
13
13
|
|
|
14
|
-
private final String PLUGIN_VERSION = "7.1
|
|
14
|
+
private final String PLUGIN_VERSION = "7.2.1";
|
|
15
15
|
|
|
16
16
|
private CapacitorPersistentAccount implementation;
|
|
17
17
|
|
package/dist/docs.json
CHANGED
|
@@ -2,16 +2,30 @@
|
|
|
2
2
|
"api": {
|
|
3
3
|
"name": "CapacitorPersistentAccountPlugin",
|
|
4
4
|
"slug": "capacitorpersistentaccountplugin",
|
|
5
|
-
"docs": "",
|
|
6
|
-
"tags": [
|
|
5
|
+
"docs": "Capacitor Persistent Account Plugin\n\nProvides persistent storage for account data across app sessions using platform-specific\nsecure storage mechanisms. On iOS, this uses the Keychain. On Android, this uses\nAccountManager. This ensures account data persists even after app reinstallation.",
|
|
6
|
+
"tags": [
|
|
7
|
+
{
|
|
8
|
+
"text": "CapacitorPersistentAccountPlugin",
|
|
9
|
+
"name": "interface"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
7
12
|
"methods": [
|
|
8
13
|
{
|
|
9
14
|
"name": "readAccount",
|
|
10
15
|
"signature": "() => Promise<{ data: unknown | null; }>",
|
|
11
16
|
"parameters": [],
|
|
12
17
|
"returns": "Promise<{ data: unknown; }>",
|
|
13
|
-
"tags": [
|
|
14
|
-
|
|
18
|
+
"tags": [
|
|
19
|
+
{
|
|
20
|
+
"name": "returns",
|
|
21
|
+
"text": "A promise that resolves to an object\ncontaining the stored account data, or null if no data has been saved yet."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "example",
|
|
25
|
+
"text": "```typescript\nconst result = await CapacitorPersistentAccount.readAccount();\nif (result.data) {\n console.log('Account data:', result.data);\n} else {\n console.log('No account data found');\n}\n```"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"docs": "Reads the stored account data from persistent storage.\n\nRetrieves account data that was previously saved using saveAccount(). The data\npersists across app sessions and survives app reinstallation on supported platforms.",
|
|
15
29
|
"complexTypes": [],
|
|
16
30
|
"slug": "readaccount"
|
|
17
31
|
},
|
|
@@ -21,13 +35,30 @@
|
|
|
21
35
|
"parameters": [
|
|
22
36
|
{
|
|
23
37
|
"name": "options",
|
|
24
|
-
"docs": "",
|
|
38
|
+
"docs": "- The options object containing the data to save.",
|
|
25
39
|
"type": "{ data: unknown; }"
|
|
26
40
|
}
|
|
27
41
|
],
|
|
28
42
|
"returns": "Promise<void>",
|
|
29
|
-
"tags": [
|
|
30
|
-
|
|
43
|
+
"tags": [
|
|
44
|
+
{
|
|
45
|
+
"name": "param",
|
|
46
|
+
"text": "options - The options object containing the data to save."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "returns",
|
|
50
|
+
"text": "A promise that resolves when the data has been successfully saved."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "throws",
|
|
54
|
+
"text": "{Error} Throws an error if the data cannot be saved to persistent storage."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "example",
|
|
58
|
+
"text": "```typescript\nawait CapacitorPersistentAccount.saveAccount({\n data: {\n userId: '12345',\n username: 'john.doe',\n email: 'john@example.com'\n }\n});\n```"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"docs": "Saves account data to persistent storage.\n\nStores the provided account data using platform-specific secure storage mechanisms.\nThe data will persist across app sessions and survive app reinstallation.\nAny existing account data will be overwritten.",
|
|
31
62
|
"complexTypes": [],
|
|
32
63
|
"slug": "saveaccount"
|
|
33
64
|
},
|
|
@@ -39,14 +70,18 @@
|
|
|
39
70
|
"tags": [
|
|
40
71
|
{
|
|
41
72
|
"name": "returns",
|
|
42
|
-
"text": "an
|
|
73
|
+
"text": "A promise that resolves to an object\ncontaining the version string of the native plugin."
|
|
43
74
|
},
|
|
44
75
|
{
|
|
45
76
|
"name": "throws",
|
|
46
|
-
"text": "
|
|
77
|
+
"text": "{Error} Throws an error if the version information cannot be retrieved."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "example",
|
|
81
|
+
"text": "```typescript\nconst { version } = await CapacitorPersistentAccount.getPluginVersion();\nconsole.log('Plugin version:', version);\n```"
|
|
47
82
|
}
|
|
48
83
|
],
|
|
49
|
-
"docs": "Get the native Capacitor plugin version",
|
|
84
|
+
"docs": "Get the native Capacitor plugin version\n\nReturns the version string of the native plugin implementation. Useful for\ndebugging and ensuring compatibility between the JavaScript and native layers.",
|
|
50
85
|
"complexTypes": [],
|
|
51
86
|
"slug": "getpluginversion"
|
|
52
87
|
}
|
|
@@ -1,15 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capacitor Persistent Account Plugin
|
|
3
|
+
*
|
|
4
|
+
* Provides persistent storage for account data across app sessions using platform-specific
|
|
5
|
+
* secure storage mechanisms. On iOS, this uses the Keychain. On Android, this uses
|
|
6
|
+
* AccountManager. This ensures account data persists even after app reinstallation.
|
|
7
|
+
*
|
|
8
|
+
* @interface CapacitorPersistentAccountPlugin
|
|
9
|
+
*/
|
|
1
10
|
export interface CapacitorPersistentAccountPlugin {
|
|
11
|
+
/**
|
|
12
|
+
* Reads the stored account data from persistent storage.
|
|
13
|
+
*
|
|
14
|
+
* Retrieves account data that was previously saved using saveAccount(). The data
|
|
15
|
+
* persists across app sessions and survives app reinstallation on supported platforms.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Promise<{ data: unknown | null }>} A promise that resolves to an object
|
|
18
|
+
* containing the stored account data, or null if no data has been saved yet.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const result = await CapacitorPersistentAccount.readAccount();
|
|
23
|
+
* if (result.data) {
|
|
24
|
+
* console.log('Account data:', result.data);
|
|
25
|
+
* } else {
|
|
26
|
+
* console.log('No account data found');
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
2
30
|
readAccount(): Promise<{
|
|
3
31
|
data: unknown | null;
|
|
4
32
|
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Saves account data to persistent storage.
|
|
35
|
+
*
|
|
36
|
+
* Stores the provided account data using platform-specific secure storage mechanisms.
|
|
37
|
+
* The data will persist across app sessions and survive app reinstallation.
|
|
38
|
+
* Any existing account data will be overwritten.
|
|
39
|
+
*
|
|
40
|
+
* @param {Object} options - The options object containing the data to save.
|
|
41
|
+
* @param {unknown} options.data - The account data to persist. Can be any serializable data type.
|
|
42
|
+
*
|
|
43
|
+
* @returns {Promise<void>} A promise that resolves when the data has been successfully saved.
|
|
44
|
+
*
|
|
45
|
+
* @throws {Error} Throws an error if the data cannot be saved to persistent storage.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* await CapacitorPersistentAccount.saveAccount({
|
|
50
|
+
* data: {
|
|
51
|
+
* userId: '12345',
|
|
52
|
+
* username: 'john.doe',
|
|
53
|
+
* email: 'john@example.com'
|
|
54
|
+
* }
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
5
58
|
saveAccount(options: {
|
|
6
59
|
data: unknown;
|
|
7
60
|
}): Promise<void>;
|
|
8
61
|
/**
|
|
9
62
|
* Get the native Capacitor plugin version
|
|
10
63
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
64
|
+
* Returns the version string of the native plugin implementation. Useful for
|
|
65
|
+
* debugging and ensuring compatibility between the JavaScript and native layers.
|
|
66
|
+
*
|
|
67
|
+
* @returns {Promise<{ version: string }>} A promise that resolves to an object
|
|
68
|
+
* containing the version string of the native plugin.
|
|
69
|
+
*
|
|
70
|
+
* @throws {Error} Throws an error if the version information cannot be retrieved.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const { version } = await CapacitorPersistentAccount.getPluginVersion();
|
|
75
|
+
* console.log('Plugin version:', version);
|
|
76
|
+
* ```
|
|
13
77
|
*/
|
|
14
78
|
getPluginVersion(): Promise<{
|
|
15
79
|
version: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Capacitor Persistent Account Plugin\n *\n * Provides persistent storage for account data across app sessions using platform-specific\n * secure storage mechanisms. On iOS, this uses the Keychain. On Android, this uses\n * AccountManager. This ensures account data persists even after app reinstallation.\n *\n * @interface CapacitorPersistentAccountPlugin\n */\nexport interface CapacitorPersistentAccountPlugin {\n /**\n * Reads the stored account data from persistent storage.\n *\n * Retrieves account data that was previously saved using saveAccount(). The data\n * persists across app sessions and survives app reinstallation on supported platforms.\n *\n * @returns {Promise<{ data: unknown | null }>} A promise that resolves to an object\n * containing the stored account data, or null if no data has been saved yet.\n *\n * @example\n * ```typescript\n * const result = await CapacitorPersistentAccount.readAccount();\n * if (result.data) {\n * console.log('Account data:', result.data);\n * } else {\n * console.log('No account data found');\n * }\n * ```\n */\n readAccount(): Promise<{ data: unknown | null }>;\n\n /**\n * Saves account data to persistent storage.\n *\n * Stores the provided account data using platform-specific secure storage mechanisms.\n * The data will persist across app sessions and survive app reinstallation.\n * Any existing account data will be overwritten.\n *\n * @param {Object} options - The options object containing the data to save.\n * @param {unknown} options.data - The account data to persist. Can be any serializable data type.\n *\n * @returns {Promise<void>} A promise that resolves when the data has been successfully saved.\n *\n * @throws {Error} Throws an error if the data cannot be saved to persistent storage.\n *\n * @example\n * ```typescript\n * await CapacitorPersistentAccount.saveAccount({\n * data: {\n * userId: '12345',\n * username: 'john.doe',\n * email: 'john@example.com'\n * }\n * });\n * ```\n */\n saveAccount(options: { data: unknown }): Promise<void>;\n\n /**\n * Get the native Capacitor plugin version\n *\n * Returns the version string of the native plugin implementation. Useful for\n * debugging and ensuring compatibility between the JavaScript and native layers.\n *\n * @returns {Promise<{ version: string }>} A promise that resolves to an object\n * containing the version string of the native plugin.\n *\n * @throws {Error} Throws an error if the version information cannot be retrieved.\n *\n * @example\n * ```typescript\n * const { version } = await CapacitorPersistentAccount.getPluginVersion();\n * console.log('Plugin version:', version);\n * ```\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import Capacitor
|
|
|
7
7
|
*/
|
|
8
8
|
@objc(CapacitorPersistentAccountPlugin)
|
|
9
9
|
public class CapacitorPersistentAccountPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
10
|
-
private let PLUGIN_VERSION: String = "7.1
|
|
10
|
+
private let PLUGIN_VERSION: String = "7.2.1"
|
|
11
11
|
public let identifier = "CapacitorPersistentAccountPlugin"
|
|
12
12
|
public let jsName = "CapacitorPersistentAccount"
|
|
13
13
|
public let pluginMethods: [CAPPluginMethod] = [
|
package/package.json
CHANGED