@1password/sdk 0.1.4 → 0.1.5
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 +2 -0
- package/dist/configuration.d.ts +1 -1
- package/dist/sdk.js +1 -0
- package/dist/secrets.d.ts +2 -0
- package/dist/secrets.js +14 -0
- package/dist/types.d.ts +85 -0
- package/dist/types.js +51 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -86,6 +86,7 @@ Operations:
|
|
|
86
86
|
- [x] [Delete items](https://developer.1password.com/docs/sdks/manage-items#delete-an-item)
|
|
87
87
|
- [x] [List items](https://developer.1password.com/docs/sdks/list-vaults-items/)
|
|
88
88
|
- [x] Add & update tags on items
|
|
89
|
+
- [x] Generate PIN, random and memorable passwords
|
|
89
90
|
|
|
90
91
|
Field types:
|
|
91
92
|
- [x] API Keys
|
|
@@ -100,6 +101,7 @@ Field types:
|
|
|
100
101
|
- [x] Websites (used to suggest and autofill logins)
|
|
101
102
|
- [x] Phone numbers
|
|
102
103
|
- [x] Credit card types
|
|
104
|
+
- [x] Credit card numbers
|
|
103
105
|
- [ ] File attachments and Document items
|
|
104
106
|
|
|
105
107
|
### Vault management
|
package/dist/configuration.d.ts
CHANGED
package/dist/sdk.js
CHANGED
|
@@ -28,6 +28,7 @@ const core_js_1 = require("./core.js");
|
|
|
28
28
|
const client_builder_js_1 = require("./client_builder.js");
|
|
29
29
|
exports.DEFAULT_INTEGRATION_NAME = "Unknown";
|
|
30
30
|
exports.DEFAULT_INTEGRATION_VERSION = "Unknown";
|
|
31
|
+
// auto-generated static exports
|
|
31
32
|
var secrets_js_1 = require("./secrets.js");
|
|
32
33
|
Object.defineProperty(exports, "Secrets", { enumerable: true, get: function () { return secrets_js_1.Secrets; } });
|
|
33
34
|
__exportStar(require("./client.js"), exports);
|
package/dist/secrets.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InnerClient } from "./core.js";
|
|
2
|
+
import * as types from "./types.js";
|
|
2
3
|
/**
|
|
3
4
|
* The Secrets API includes all operations the SDK client can perform on secrets.
|
|
4
5
|
* Use secret reference URIs to securely load secrets from 1Password: op://<vault-name>/<item-name>[/<section-name>]/<field-name>
|
|
@@ -20,4 +21,5 @@ export declare class Secrets implements SecretsApi {
|
|
|
20
21
|
* Validate the secret reference to ensure there are no syntax errors.
|
|
21
22
|
*/
|
|
22
23
|
static validateSecretReference(secretReference: string): void;
|
|
24
|
+
static generatePassword(recipe: types.PasswordRecipe): types.GeneratePasswordResponse;
|
|
23
25
|
}
|
package/dist/secrets.js
CHANGED
|
@@ -65,6 +65,20 @@ class Secrets {
|
|
|
65
65
|
};
|
|
66
66
|
sharedCore.invoke_sync(invocationConfig);
|
|
67
67
|
}
|
|
68
|
+
static generatePassword(recipe) {
|
|
69
|
+
const sharedCore = new core_js_1.SharedCore();
|
|
70
|
+
const invocationConfig = {
|
|
71
|
+
invocation: {
|
|
72
|
+
parameters: {
|
|
73
|
+
name: "GeneratePassword",
|
|
74
|
+
parameters: {
|
|
75
|
+
recipe,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
return JSON.parse(sharedCore.invoke_sync(invocationConfig));
|
|
81
|
+
}
|
|
68
82
|
}
|
|
69
83
|
exports.Secrets = Secrets;
|
|
70
84
|
_Secrets_inner = new WeakMap();
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For future use, if we want to return more information about the generated password.
|
|
3
|
+
* Currently, it only returns the password itself.
|
|
4
|
+
*/
|
|
5
|
+
export interface GeneratePasswordResponse {
|
|
6
|
+
/** The generated password. */
|
|
7
|
+
password: string;
|
|
8
|
+
}
|
|
1
9
|
export declare enum ItemCategory {
|
|
2
10
|
Login = "Login",
|
|
3
11
|
SecureNote = "SecureNote",
|
|
@@ -28,6 +36,7 @@ export declare enum ItemFieldType {
|
|
|
28
36
|
Text = "Text",
|
|
29
37
|
Concealed = "Concealed",
|
|
30
38
|
CreditCardType = "CreditCardType",
|
|
39
|
+
CreditCardNumber = "CreditCardNumber",
|
|
31
40
|
Phone = "Phone",
|
|
32
41
|
Url = "Url",
|
|
33
42
|
Totp = "Totp",
|
|
@@ -152,3 +161,79 @@ export interface VaultOverview {
|
|
|
152
161
|
/** The vault's title */
|
|
153
162
|
title: string;
|
|
154
163
|
}
|
|
164
|
+
export type PasswordRecipe = {
|
|
165
|
+
type: "Memorable";
|
|
166
|
+
parameters: {
|
|
167
|
+
/** The type of separator between chunks. */
|
|
168
|
+
separatorType: SeparatorType;
|
|
169
|
+
/** Uppercase one randomly selected chunk. */
|
|
170
|
+
capitalize: boolean;
|
|
171
|
+
/** The type of word list used. */
|
|
172
|
+
wordListType: WordListType;
|
|
173
|
+
/** The number of "words" (words or syllables). */
|
|
174
|
+
wordCount: number;
|
|
175
|
+
};
|
|
176
|
+
} | {
|
|
177
|
+
type: "Pin";
|
|
178
|
+
parameters: {
|
|
179
|
+
/** Number of digits in the PIN. */
|
|
180
|
+
length: number;
|
|
181
|
+
};
|
|
182
|
+
} | {
|
|
183
|
+
type: "Random";
|
|
184
|
+
parameters: {
|
|
185
|
+
/** Include at least one digit in the password. */
|
|
186
|
+
includeDigits: boolean;
|
|
187
|
+
/** Include at least one symbol in the password. */
|
|
188
|
+
includeSymbols: boolean;
|
|
189
|
+
/** The length of the password. */
|
|
190
|
+
length: number;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
export declare enum SeparatorType {
|
|
194
|
+
/**
|
|
195
|
+
* Randomly selected digits.
|
|
196
|
+
* E.g, "`correct4horse0battery1staple`"
|
|
197
|
+
*/
|
|
198
|
+
Digits = "digits",
|
|
199
|
+
/**
|
|
200
|
+
* Randomly selected digits and symbols.
|
|
201
|
+
* This is useful to get word-based passwords to meet complexity requirements
|
|
202
|
+
* E.g, "`correct4horse-battery1staple`"
|
|
203
|
+
*/
|
|
204
|
+
DigitsAndSymbols = "digitsAndSymbols",
|
|
205
|
+
/**
|
|
206
|
+
* Spaces, like the original Diceware.
|
|
207
|
+
* Great for mobile keyboards, not so great when people can overhear you type the password.
|
|
208
|
+
* E.g, "`correct horse battery staple`"
|
|
209
|
+
*/
|
|
210
|
+
Spaces = "spaces",
|
|
211
|
+
/**
|
|
212
|
+
* Hyphens "`-`".
|
|
213
|
+
* E.g, "`correct-horse-battery-staple`"
|
|
214
|
+
*/
|
|
215
|
+
Hyphens = "hyphens",
|
|
216
|
+
/**
|
|
217
|
+
* "`_`".
|
|
218
|
+
* E.g, "`correct_horse_battery_staple`"
|
|
219
|
+
*/
|
|
220
|
+
Underscores = "underscores",
|
|
221
|
+
/**
|
|
222
|
+
* Period (full stop) "`.`".
|
|
223
|
+
* E.g, "`correct.horse.battery.staple`"
|
|
224
|
+
*/
|
|
225
|
+
Periods = "periods",
|
|
226
|
+
/**
|
|
227
|
+
* Comma "`,`".
|
|
228
|
+
* E.g, "`correct,horse,battery,staple`"
|
|
229
|
+
*/
|
|
230
|
+
Commas = "commas"
|
|
231
|
+
}
|
|
232
|
+
export declare enum WordListType {
|
|
233
|
+
/** Agile wordlist */
|
|
234
|
+
FullWords = "fullWords",
|
|
235
|
+
/** English-like syllables */
|
|
236
|
+
Syllables = "syllables",
|
|
237
|
+
/** Three (random) letter "words" */
|
|
238
|
+
ThreeLetters = "threeLetters"
|
|
239
|
+
}
|
package/dist/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Generated by typeshare 1.12.0
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AutofillBehavior = exports.ItemFieldType = exports.ItemCategory = void 0;
|
|
6
|
+
exports.WordListType = exports.SeparatorType = exports.AutofillBehavior = exports.ItemFieldType = exports.ItemCategory = void 0;
|
|
7
7
|
var ItemCategory;
|
|
8
8
|
(function (ItemCategory) {
|
|
9
9
|
ItemCategory["Login"] = "Login";
|
|
@@ -36,6 +36,7 @@ var ItemFieldType;
|
|
|
36
36
|
ItemFieldType["Text"] = "Text";
|
|
37
37
|
ItemFieldType["Concealed"] = "Concealed";
|
|
38
38
|
ItemFieldType["CreditCardType"] = "CreditCardType";
|
|
39
|
+
ItemFieldType["CreditCardNumber"] = "CreditCardNumber";
|
|
39
40
|
ItemFieldType["Phone"] = "Phone";
|
|
40
41
|
ItemFieldType["Url"] = "Url";
|
|
41
42
|
ItemFieldType["Totp"] = "Totp";
|
|
@@ -56,3 +57,52 @@ var AutofillBehavior;
|
|
|
56
57
|
/** Never auto-fill on this website */
|
|
57
58
|
AutofillBehavior["Never"] = "Never";
|
|
58
59
|
})(AutofillBehavior || (exports.AutofillBehavior = AutofillBehavior = {}));
|
|
60
|
+
var SeparatorType;
|
|
61
|
+
(function (SeparatorType) {
|
|
62
|
+
/**
|
|
63
|
+
* Randomly selected digits.
|
|
64
|
+
* E.g, "`correct4horse0battery1staple`"
|
|
65
|
+
*/
|
|
66
|
+
SeparatorType["Digits"] = "digits";
|
|
67
|
+
/**
|
|
68
|
+
* Randomly selected digits and symbols.
|
|
69
|
+
* This is useful to get word-based passwords to meet complexity requirements
|
|
70
|
+
* E.g, "`correct4horse-battery1staple`"
|
|
71
|
+
*/
|
|
72
|
+
SeparatorType["DigitsAndSymbols"] = "digitsAndSymbols";
|
|
73
|
+
/**
|
|
74
|
+
* Spaces, like the original Diceware.
|
|
75
|
+
* Great for mobile keyboards, not so great when people can overhear you type the password.
|
|
76
|
+
* E.g, "`correct horse battery staple`"
|
|
77
|
+
*/
|
|
78
|
+
SeparatorType["Spaces"] = "spaces";
|
|
79
|
+
/**
|
|
80
|
+
* Hyphens "`-`".
|
|
81
|
+
* E.g, "`correct-horse-battery-staple`"
|
|
82
|
+
*/
|
|
83
|
+
SeparatorType["Hyphens"] = "hyphens";
|
|
84
|
+
/**
|
|
85
|
+
* "`_`".
|
|
86
|
+
* E.g, "`correct_horse_battery_staple`"
|
|
87
|
+
*/
|
|
88
|
+
SeparatorType["Underscores"] = "underscores";
|
|
89
|
+
/**
|
|
90
|
+
* Period (full stop) "`.`".
|
|
91
|
+
* E.g, "`correct.horse.battery.staple`"
|
|
92
|
+
*/
|
|
93
|
+
SeparatorType["Periods"] = "periods";
|
|
94
|
+
/**
|
|
95
|
+
* Comma "`,`".
|
|
96
|
+
* E.g, "`correct,horse,battery,staple`"
|
|
97
|
+
*/
|
|
98
|
+
SeparatorType["Commas"] = "commas";
|
|
99
|
+
})(SeparatorType || (exports.SeparatorType = SeparatorType = {}));
|
|
100
|
+
var WordListType;
|
|
101
|
+
(function (WordListType) {
|
|
102
|
+
/** Agile wordlist */
|
|
103
|
+
WordListType["FullWords"] = "fullWords";
|
|
104
|
+
/** English-like syllables */
|
|
105
|
+
WordListType["Syllables"] = "syllables";
|
|
106
|
+
/** Three (random) letter "words" */
|
|
107
|
+
WordListType["ThreeLetters"] = "threeLetters";
|
|
108
|
+
})(WordListType || (exports.WordListType = WordListType = {}));
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
2
|
-
export declare const SDK_BUILD_NUMBER = "
|
|
1
|
+
export declare const SDK_VERSION = "0.1.5";
|
|
2
|
+
export declare const SDK_BUILD_NUMBER = "0010501";
|
package/dist/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SDK_BUILD_NUMBER = exports.SDK_VERSION = void 0;
|
|
4
|
-
exports.SDK_VERSION = "0.1.
|
|
5
|
-
exports.SDK_BUILD_NUMBER = "
|
|
6
|
-
const SDK_CORE_VERSION = "0.1.
|
|
4
|
+
exports.SDK_VERSION = "0.1.5";
|
|
5
|
+
exports.SDK_BUILD_NUMBER = "0010501";
|
|
6
|
+
const SDK_CORE_VERSION = "0.1.5";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1password/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "The 1Password JavaScript SDK offers programmatic read access to your secrets in 1Password in an interface native to JavaScript. The SDK currently supports `Node.JS`",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"main": "./dist/sdk.js",
|
|
27
27
|
"types": "./dist/sdk.d.ts",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@1password/sdk-core": "0.1.
|
|
29
|
+
"@1password/sdk-core": "0.1.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@1password/eslint-config": "^4.0.0",
|