@1password/sdk 0.1.3 → 0.1.4

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.
@@ -1,6 +1,6 @@
1
1
  import { ClientAuthConfig } from "./core.js";
2
2
  export declare const LANGUAGE = "JS";
3
- export declare const VERSION = "0010301";
3
+ export declare const VERSION = "0010401";
4
4
  export interface ClientConfiguration {
5
5
  auth: Auth;
6
6
  integrationName: string;
package/dist/core.d.ts CHANGED
@@ -7,9 +7,13 @@ export interface Core {
7
7
  */
8
8
  initClient(config: ClientAuthConfig): Promise<string>;
9
9
  /**
10
- * Calls business logic from a given client and returns the result.
10
+ * Calls async business logic from a given client and returns the result.
11
11
  */
12
12
  invoke(config: InvokeConfig): Promise<string>;
13
+ /**
14
+ * Calls sync business logic from a given client and returns the result.
15
+ */
16
+ invoke_sync(config: InvokeConfig): string;
13
17
  /**
14
18
  * Deallocates memory held by the given client in the SDK core when it goes out of scope.
15
19
  */
@@ -65,6 +69,7 @@ export interface Parameters {
65
69
  * An implementation of the `Core` interface that shares resources across all clients.
66
70
  */
67
71
  export declare class SharedCore implements Core {
72
+ invoke_sync(config: InvokeConfig): string;
68
73
  initClient(config: ClientAuthConfig): Promise<string>;
69
74
  invoke(config: InvokeConfig): Promise<string>;
70
75
  releaseClient(clientId: number): void;
package/dist/core.js CHANGED
@@ -15,6 +15,10 @@ const sdk_core_1 = require("@1password/sdk-core");
15
15
  * An implementation of the `Core` interface that shares resources across all clients.
16
16
  */
17
17
  class SharedCore {
18
+ invoke_sync(config) {
19
+ const serializedConfig = JSON.stringify(config);
20
+ return (0, sdk_core_1.invoke_sync)(serializedConfig);
21
+ }
18
22
  initClient(config) {
19
23
  return __awaiter(this, void 0, void 0, function* () {
20
24
  const serializedConfig = JSON.stringify(config);
package/dist/items.d.ts CHANGED
@@ -20,7 +20,7 @@ export interface ItemsApi {
20
20
  /**
21
21
  * Delete an item.
22
22
  */
23
- delete(vaultId: string, itemId: string): Promise<void>;
23
+ delete(vaultId: string, itemId: string): any;
24
24
  /**
25
25
  * List all items
26
26
  */
package/dist/iterator.js CHANGED
@@ -3,7 +3,7 @@ var __await = (this && this.__await) || function (v) { return this instanceof __
3
3
  var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
4
4
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5
5
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
6
- return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
6
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
7
7
  function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
8
8
  function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
9
9
  function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
package/dist/secrets.d.ts CHANGED
@@ -16,4 +16,8 @@ export declare class Secrets implements SecretsApi {
16
16
  * Resolve returns the secret the provided secret reference points to.
17
17
  */
18
18
  resolve(secretReference: string): Promise<string>;
19
+ /**
20
+ * Validate the secret reference to ensure there are no syntax errors.
21
+ */
22
+ static validateSecretReference(secretReference: string): void;
19
23
  }
package/dist/secrets.js CHANGED
@@ -23,6 +23,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
23
23
  var _Secrets_inner;
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.Secrets = void 0;
26
+ const core_js_1 = require("./core.js");
26
27
  class Secrets {
27
28
  constructor(inner) {
28
29
  _Secrets_inner.set(this, void 0);
@@ -47,6 +48,23 @@ class Secrets {
47
48
  return JSON.parse(yield __classPrivateFieldGet(this, _Secrets_inner, "f").core.invoke(invocationConfig));
48
49
  });
49
50
  }
51
+ /**
52
+ * Validate the secret reference to ensure there are no syntax errors.
53
+ */
54
+ static validateSecretReference(secretReference) {
55
+ const sharedCore = new core_js_1.SharedCore();
56
+ const invocationConfig = {
57
+ invocation: {
58
+ parameters: {
59
+ name: "ValidateSecretReference",
60
+ parameters: {
61
+ secret_reference: secretReference,
62
+ },
63
+ },
64
+ },
65
+ };
66
+ sharedCore.invoke_sync(invocationConfig);
67
+ }
50
68
  }
51
69
  exports.Secrets = Secrets;
52
70
  _Secrets_inner = new WeakMap();
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Generated by typeshare 1.11.0
3
+ Generated by typeshare 1.12.0
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AutofillBehavior = exports.ItemFieldType = exports.ItemCategory = void 0;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.1.3";
2
- export declare const SDK_BUILD_NUMBER = "0010301";
1
+ export declare const SDK_VERSION = "0.1.4";
2
+ export declare const SDK_BUILD_NUMBER = "0010401";
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.3";
5
- exports.SDK_BUILD_NUMBER = "0010301";
6
- const SDK_CORE_VERSION = "0.1.3";
4
+ exports.SDK_VERSION = "0.1.4";
5
+ exports.SDK_BUILD_NUMBER = "0010401";
6
+ const SDK_CORE_VERSION = "0.1.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1password/sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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.3"
29
+ "@1password/sdk-core": "0.1.4"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@1password/eslint-config": "^4.0.0",