@capgo/capacitor-autofill-save-password 7.1.4 → 7.2.0
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/README.md +16 -0
- package/android/src/main/java/ee/forgr/autofill_password/SavePasswordPlugin.java +12 -0
- package/dist/docs.json +19 -0
- package/dist/esm/definitions.d.ts +9 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/SavePasswordPlugin/SavePasswordPlugin.swift +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,6 +87,7 @@ with
|
|
|
87
87
|
|
|
88
88
|
* [`promptDialog(...)`](#promptdialog)
|
|
89
89
|
* [`readPassword()`](#readpassword)
|
|
90
|
+
* [`getPluginVersion()`](#getpluginversion)
|
|
90
91
|
* [Interfaces](#interfaces)
|
|
91
92
|
|
|
92
93
|
</docgen-index>
|
|
@@ -122,6 +123,21 @@ Read a password from the keychain. Requires the developer to setup associated do
|
|
|
122
123
|
--------------------
|
|
123
124
|
|
|
124
125
|
|
|
126
|
+
### getPluginVersion()
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
getPluginVersion() => Promise<{ version: string; }>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Get the native Capacitor plugin version.
|
|
133
|
+
|
|
134
|
+
**Returns:** <code>Promise<{ version: string; }></code>
|
|
135
|
+
|
|
136
|
+
**Since:** 1.0.0
|
|
137
|
+
|
|
138
|
+
--------------------
|
|
139
|
+
|
|
140
|
+
|
|
125
141
|
### Interfaces
|
|
126
142
|
|
|
127
143
|
|
|
@@ -28,6 +28,7 @@ import java.util.Map;
|
|
|
28
28
|
@CapacitorPlugin(name = "SavePassword")
|
|
29
29
|
public class SavePasswordPlugin extends Plugin {
|
|
30
30
|
|
|
31
|
+
private final String PLUGIN_VERSION = "7.2.0";
|
|
31
32
|
private static final String TAG = "CredentialManager";
|
|
32
33
|
private CredentialManager credentialManager;
|
|
33
34
|
private Map<String, PendingGetCredentialRequest> pendingRequestsByElementId = new HashMap<>();
|
|
@@ -164,4 +165,15 @@ public class SavePasswordPlugin extends Plugin {
|
|
|
164
165
|
|
|
165
166
|
return true;
|
|
166
167
|
}
|
|
168
|
+
|
|
169
|
+
@PluginMethod
|
|
170
|
+
public void getPluginVersion(final PluginCall call) {
|
|
171
|
+
try {
|
|
172
|
+
final JSObject ret = new JSObject();
|
|
173
|
+
ret.put("version", this.PLUGIN_VERSION);
|
|
174
|
+
call.resolve(ret);
|
|
175
|
+
} catch (final Exception e) {
|
|
176
|
+
call.reject("Could not get plugin version", e);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
167
179
|
}
|
package/dist/docs.json
CHANGED
|
@@ -61,6 +61,25 @@
|
|
|
61
61
|
"ReadPasswordResult"
|
|
62
62
|
],
|
|
63
63
|
"slug": "readpassword"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "getPluginVersion",
|
|
67
|
+
"signature": "() => Promise<{ version: string; }>",
|
|
68
|
+
"parameters": [],
|
|
69
|
+
"returns": "Promise<{ version: string; }>",
|
|
70
|
+
"tags": [
|
|
71
|
+
{
|
|
72
|
+
"name": "returns",
|
|
73
|
+
"text": "Promise that resolves with the plugin version"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "since",
|
|
77
|
+
"text": "1.0.0"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"docs": "Get the native Capacitor plugin version.",
|
|
81
|
+
"complexTypes": [],
|
|
82
|
+
"slug": "getpluginversion"
|
|
64
83
|
}
|
|
65
84
|
],
|
|
66
85
|
"properties": []
|
|
@@ -48,4 +48,13 @@ export interface SavePasswordPlugin {
|
|
|
48
48
|
* @returns {Promise<ReadPasswordResult>} The retrieved password credentials
|
|
49
49
|
*/
|
|
50
50
|
readPassword(): Promise<ReadPasswordResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Get the native Capacitor plugin version.
|
|
53
|
+
*
|
|
54
|
+
* @returns Promise that resolves with the plugin version
|
|
55
|
+
* @since 1.0.0
|
|
56
|
+
*/
|
|
57
|
+
getPluginVersion(): Promise<{
|
|
58
|
+
version: string;
|
|
59
|
+
}>;
|
|
51
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @interface Options\n * @description The options for the prompt.\n */\nexport interface Options {\n /**\n * The username to save.\n */\n username: string;\n /**\n * The password to save.\n */\n password: string;\n /**\n * The url to save the password for. (For example: \"web.capgo.app\")\n * iOS only.\n */\n url?: string;\n}\n\nexport interface ReadPasswordResult {\n /**\n * The username of the password.\n */\n username: string;\n /**\n * The password of the password.\n */\n password: string;\n}\n\n/**\n * @interface SavePasswordPlugin\n * @description Capacitor plugin for saving passwords to the keychain.\n */\nexport interface SavePasswordPlugin {\n /**\n * Save a password to the keychain.\n * @param {Options} options - The options for the password.\n * @returns {Promise<void>} Success status\n * @example\n * await SavePassword.promptDialog({\n * username: 'your-username',\n * password: 'your-password'\n * });\n */\n promptDialog(options: Options): Promise<void>;\n\n /**\n * Read a password from the keychain. Requires the developer to setup associated domain for the app for iOS.\n * @returns {Promise<ReadPasswordResult>} The retrieved password credentials\n */\n readPassword(): Promise<ReadPasswordResult>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @interface Options\n * @description The options for the prompt.\n */\nexport interface Options {\n /**\n * The username to save.\n */\n username: string;\n /**\n * The password to save.\n */\n password: string;\n /**\n * The url to save the password for. (For example: \"web.capgo.app\")\n * iOS only.\n */\n url?: string;\n}\n\nexport interface ReadPasswordResult {\n /**\n * The username of the password.\n */\n username: string;\n /**\n * The password of the password.\n */\n password: string;\n}\n\n/**\n * @interface SavePasswordPlugin\n * @description Capacitor plugin for saving passwords to the keychain.\n */\nexport interface SavePasswordPlugin {\n /**\n * Save a password to the keychain.\n * @param {Options} options - The options for the password.\n * @returns {Promise<void>} Success status\n * @example\n * await SavePassword.promptDialog({\n * username: 'your-username',\n * password: 'your-password'\n * });\n */\n promptDialog(options: Options): Promise<void>;\n\n /**\n * Read a password from the keychain. Requires the developer to setup associated domain for the app for iOS.\n * @returns {Promise<ReadPasswordResult>} The retrieved password credentials\n */\n readPassword(): Promise<ReadPasswordResult>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @since 1.0.0\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -3,4 +3,7 @@ import type { Options, ReadPasswordResult, SavePasswordPlugin } from './definiti
|
|
|
3
3
|
export declare class SavePasswordWeb extends WebPlugin implements SavePasswordPlugin {
|
|
4
4
|
readPassword(): Promise<ReadPasswordResult>;
|
|
5
5
|
promptDialog(options: Options): Promise<void>;
|
|
6
|
+
getPluginVersion(): Promise<{
|
|
7
|
+
version: string;
|
|
8
|
+
}>;
|
|
6
9
|
}
|
package/dist/esm/web.js
CHANGED
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,YAAY;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,OAAgB;QACjC,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { Options, ReadPasswordResult, SavePasswordPlugin } from './definitions';\n\nexport class SavePasswordWeb extends WebPlugin implements SavePasswordPlugin {\n readPassword(): Promise<ReadPasswordResult> {\n throw new Error('Method not implemented.');\n }\n async promptDialog(options: Options): Promise<void> {\n throw new Error('Not implemented on web' + JSON.stringify(options));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,YAAY;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,OAAgB;QACjC,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { Options, ReadPasswordResult, SavePasswordPlugin } from './definitions';\n\nexport class SavePasswordWeb extends WebPlugin implements SavePasswordPlugin {\n readPassword(): Promise<ReadPasswordResult> {\n throw new Error('Method not implemented.');\n }\n async promptDialog(options: Options): Promise<void> {\n throw new Error('Not implemented on web' + JSON.stringify(options));\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -13,6 +13,9 @@ class SavePasswordWeb extends core.WebPlugin {
|
|
|
13
13
|
async promptDialog(options) {
|
|
14
14
|
throw new Error('Not implemented on web' + JSON.stringify(options));
|
|
15
15
|
}
|
|
16
|
+
async getPluginVersion() {
|
|
17
|
+
return { version: 'web' };
|
|
18
|
+
}
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SavePassword = registerPlugin('SavePassword', {\n web: () => import('./web').then((m) => new m.SavePasswordWeb()),\n});\nexport * from './definitions';\nexport { SavePassword };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SavePasswordWeb extends WebPlugin {\n readPassword() {\n throw new Error('Method not implemented.');\n }\n async promptDialog(options) {\n throw new Error('Not implemented on web' + JSON.stringify(options));\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,YAAY,GAAG;AACnB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QAAQ,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC3E;AACA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SavePassword = registerPlugin('SavePassword', {\n web: () => import('./web').then((m) => new m.SavePasswordWeb()),\n});\nexport * from './definitions';\nexport { SavePassword };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SavePasswordWeb extends WebPlugin {\n readPassword() {\n throw new Error('Method not implemented.');\n }\n async promptDialog(options) {\n throw new Error('Not implemented on web' + JSON.stringify(options));\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,YAAY,GAAG;AACnB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QAAQ,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC3E;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC;AACA;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -12,6 +12,9 @@ var capacitorSavePassword = (function (exports, core) {
|
|
|
12
12
|
async promptDialog(options) {
|
|
13
13
|
throw new Error('Not implemented on web' + JSON.stringify(options));
|
|
14
14
|
}
|
|
15
|
+
async getPluginVersion() {
|
|
16
|
+
return { version: 'web' };
|
|
17
|
+
}
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SavePassword = registerPlugin('SavePassword', {\n web: () => import('./web').then((m) => new m.SavePasswordWeb()),\n});\nexport * from './definitions';\nexport { SavePassword };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SavePasswordWeb extends WebPlugin {\n readPassword() {\n throw new Error('Method not implemented.');\n }\n async promptDialog(options) {\n throw new Error('Not implemented on web' + JSON.stringify(options));\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,YAAY,GAAG;IACnB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD;IACA,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;IAChC,QAAQ,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3E;IACA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SavePassword = registerPlugin('SavePassword', {\n web: () => import('./web').then((m) => new m.SavePasswordWeb()),\n});\nexport * from './definitions';\nexport { SavePassword };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SavePasswordWeb extends WebPlugin {\n readPassword() {\n throw new Error('Method not implemented.');\n }\n async promptDialog(options) {\n throw new Error('Not implemented on web' + JSON.stringify(options));\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,YAAY,GAAG;IACnB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD;IACA,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;IAChC,QAAQ,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3E;IACA,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC;IACA;;;;;;;;;;;;;;;"}
|
|
@@ -9,12 +9,14 @@ import AuthenticationServices
|
|
|
9
9
|
*/
|
|
10
10
|
@objc(SavePasswordPlugin)
|
|
11
11
|
public class SavePasswordPlugin: CAPPlugin, CAPBridgedPlugin, ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding {
|
|
12
|
+
private let PLUGIN_VERSION: String = "7.2.0"
|
|
12
13
|
public let identifier = "SavePasswordPlugin"
|
|
13
14
|
|
|
14
15
|
public let jsName = "SavePassword"
|
|
15
16
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
16
17
|
CAPPluginMethod(name: "promptDialog", returnType: CAPPluginReturnPromise),
|
|
17
|
-
CAPPluginMethod(name: "readPassword", returnType: CAPPluginReturnPromise)
|
|
18
|
+
CAPPluginMethod(name: "readPassword", returnType: CAPPluginReturnPromise),
|
|
19
|
+
CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
|
|
18
20
|
]
|
|
19
21
|
|
|
20
22
|
@objc func promptDialog(_ call: CAPPluginCall) {
|
|
@@ -97,4 +99,8 @@ public class SavePasswordPlugin: CAPPlugin, CAPBridgedPlugin, ASAuthorizationCon
|
|
|
97
99
|
public func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
|
|
98
100
|
return self.bridge?.viewController?.view.window ?? ASPresentationAnchor()
|
|
99
101
|
}
|
|
102
|
+
|
|
103
|
+
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
104
|
+
call.resolve(["version": self.PLUGIN_VERSION])
|
|
105
|
+
}
|
|
100
106
|
}
|
package/package.json
CHANGED