@1password/sdk 0.4.0 → 0.4.1-beta.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/dist/client.d.ts CHANGED
@@ -2,11 +2,13 @@ import { InnerClient } from "./core.js";
2
2
  import { SecretsApi } from "./secrets.js";
3
3
  import { ItemsApi } from "./items.js";
4
4
  import { VaultsApi } from "./vaults.js";
5
+ import { EnvironmentsApi } from "./environments.js";
5
6
  import { GroupsApi } from "./groups.js";
6
7
  export declare class Client {
7
8
  secrets: SecretsApi;
8
9
  items: ItemsApi;
9
10
  vaults: VaultsApi;
11
+ environments: EnvironmentsApi;
10
12
  groups: GroupsApi;
11
13
  constructor(innerClient: InnerClient);
12
14
  }
package/dist/client.js CHANGED
@@ -5,12 +5,14 @@ exports.Client = void 0;
5
5
  const secrets_js_1 = require("./secrets.js");
6
6
  const items_js_1 = require("./items.js");
7
7
  const vaults_js_1 = require("./vaults.js");
8
+ const environments_js_1 = require("./environments.js");
8
9
  const groups_js_1 = require("./groups.js");
9
10
  class Client {
10
11
  constructor(innerClient) {
11
12
  this.secrets = new secrets_js_1.Secrets(innerClient);
12
13
  this.items = new items_js_1.Items(innerClient);
13
14
  this.vaults = new vaults_js_1.Vaults(innerClient);
15
+ this.environments = new environments_js_1.Environments(innerClient);
14
16
  this.groups = new groups_js_1.Groups(innerClient);
15
17
  }
16
18
  }
@@ -1,6 +1,6 @@
1
1
  import { ClientAuthConfig } from "./core.js";
2
2
  export declare const LANGUAGE = "JS";
3
- export declare const VERSION = "0040003";
3
+ export declare const VERSION = "0040101";
4
4
  export interface ClientConfiguration {
5
5
  auth: Auth;
6
6
  integrationName: string;
@@ -0,0 +1,19 @@
1
+ import { InnerClient } from "./core.js";
2
+ import { GetVariablesResponse } from "./types.js";
3
+ /**
4
+ * The Environments API holds all the operations the SDK client can perform on 1Password Environments.
5
+ */
6
+ export interface EnvironmentsApi {
7
+ /**
8
+ * Get environment variables belonging to an Environment.
9
+ */
10
+ getVariables(environmentId: string): Promise<GetVariablesResponse>;
11
+ }
12
+ export declare class Environments implements EnvironmentsApi {
13
+ #private;
14
+ constructor(inner: InnerClient);
15
+ /**
16
+ * Get environment variables belonging to an Environment.
17
+ */
18
+ getVariables(environmentId: string): Promise<GetVariablesResponse>;
19
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ // Code generated by op-codegen - DO NOT EDIT MANUALLY
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13
+ if (kind === "m") throw new TypeError("Private method is not writable");
14
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
15
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
16
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
17
+ };
18
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
19
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
20
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
21
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
22
+ };
23
+ var _Environments_inner;
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.Environments = void 0;
26
+ const types_js_1 = require("./types.js");
27
+ class Environments {
28
+ constructor(inner) {
29
+ _Environments_inner.set(this, void 0);
30
+ __classPrivateFieldSet(this, _Environments_inner, inner, "f");
31
+ }
32
+ /**
33
+ * Get environment variables belonging to an Environment.
34
+ */
35
+ getVariables(environmentId) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const invocationConfig = {
38
+ invocation: {
39
+ clientId: __classPrivateFieldGet(this, _Environments_inner, "f").id,
40
+ parameters: {
41
+ name: "EnvironmentsGetVariables",
42
+ parameters: {
43
+ environment_id: environmentId,
44
+ },
45
+ },
46
+ },
47
+ };
48
+ return JSON.parse(yield __classPrivateFieldGet(this, _Environments_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
49
+ });
50
+ }
51
+ }
52
+ exports.Environments = Environments;
53
+ _Environments_inner = new WeakMap();
package/dist/types.d.ts CHANGED
@@ -18,6 +18,15 @@ export interface DocumentCreateParams {
18
18
  /** The content of the file */
19
19
  content: Uint8Array;
20
20
  }
21
+ /** Represents an environment variable (name:value pair) and its masked state */
22
+ export interface EnvironmentVariable {
23
+ /** An environment variable's name */
24
+ name: string;
25
+ /** An environment variable's value */
26
+ value: string;
27
+ /** An environment variable's masked state */
28
+ masked: boolean;
29
+ }
21
30
  export interface FileAttributes {
22
31
  /** The name of the file */
23
32
  name: string;
@@ -44,6 +53,11 @@ export interface GeneratePasswordResponse {
44
53
  /** The generated password. */
45
54
  password: string;
46
55
  }
56
+ /** Response containing the full set of environment variables from an Environment. */
57
+ export interface GetVariablesResponse {
58
+ /** List of environment variables. */
59
+ variables: EnvironmentVariable[];
60
+ }
47
61
  export declare enum GroupType {
48
62
  /**
49
63
  * The owners group, which gives the following permissions:
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.4.0";
2
- export declare const SDK_BUILD_NUMBER = "0040003";
1
+ export declare const SDK_VERSION = "0.4.1-beta.1";
2
+ export declare const SDK_BUILD_NUMBER = "0040101";
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.4.0";
5
- exports.SDK_BUILD_NUMBER = "0040003";
6
- const SDK_CORE_VERSION = "0.4.0";
4
+ exports.SDK_VERSION = "0.4.1-beta.1";
5
+ exports.SDK_BUILD_NUMBER = "0040101";
6
+ const SDK_CORE_VERSION = "0.4.1-beta.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1password/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.1-beta.1",
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.4.0"
29
+ "@1password/sdk-core": "0.4.1-beta.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@1password/eslint-config": "^4.0.0",