@theholocron/infisical-client 1.57.1-alpha.2 → 1.58.0-alpha.10

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/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import "@theholocron/http-client";
2
2
  import { ErrorSink, Logger } from "@theholocron/observability/core";
3
+ /** Options for `createInfisicalClient`. */
3
4
  interface InfisicalClientOptions {
4
5
  /** Infisical Universal Auth machine identity token or personal token. */
5
6
  token: string;
@@ -12,48 +13,80 @@ interface InfisicalClientOptions {
12
13
  /** Reports transport failures and unexpected 5xx. Defaults to a no-op. */
13
14
  errors?: ErrorSink;
14
15
  }
16
+ /** A secret as the Infisical API returns it. */
15
17
  interface InfisicalSecret {
18
+ /** The secret's name. */
16
19
  secretKey?: string;
20
+ /** The secret's value in plain text. */
17
21
  secretValue?: string;
18
22
  }
23
+ /** The response of listing secrets. */
19
24
  interface InfisicalSecretsListResponse {
25
+ /** The secrets in the requested scope. */
20
26
  secrets?: InfisicalSecret[];
21
27
  }
28
+ /** The response of reading one secret. */
22
29
  interface InfisicalSecretResponse {
30
+ /** The secret that was read. */
23
31
  secret?: InfisicalSecret;
24
32
  }
33
+ /** Where a secret lives: a workspace, an environment and a folder path. */
25
34
  interface InfisicalSecretScope {
35
+ /** The id of the workspace (project) that holds the secret. */
26
36
  workspaceId: string;
37
+ /** The slug of the environment, such as `dev` or `prod`. */
27
38
  environment: string;
39
+ /** The folder path inside the environment; left out, `/` is used. */
28
40
  secretPath?: string;
29
41
  }
42
+ /** What to create a secret with, on top of its scope. */
30
43
  interface InfisicalCreateSecretInput extends InfisicalSecretScope {
44
+ /** The value to store. */
31
45
  secretValue: string;
46
+ /** Whether the secret is `"shared"` or `"personal"`; left out, `"shared"` is sent. */
32
47
  type?: "shared" | "personal";
33
48
  }
49
+ /** What to update a secret with, on top of its scope. */
34
50
  interface InfisicalUpdateSecretInput extends InfisicalSecretScope {
51
+ /** The new value to store. */
35
52
  secretValue: string;
36
53
  }
54
+ /** An Infisical workspace (project); the API may return its id as `_id`, `id` or both. */
37
55
  interface InfisicalWorkspace {
56
+ /** The workspace id in the API's legacy `_id` form. */
38
57
  _id?: string;
58
+ /** The workspace id. */
39
59
  id?: string;
60
+ /** The workspace name. */
40
61
  name?: string;
62
+ /** The workspace slug. */
41
63
  slug?: string;
42
64
  }
65
+ /** An environment of a workspace. */
43
66
  interface InfisicalWorkspaceEnvironment {
67
+ /** The environment id. */
44
68
  id?: string;
69
+ /** The environment name. */
45
70
  name?: string;
71
+ /** The environment slug, such as `dev`. */
46
72
  slug?: string;
47
73
  }
74
+ /** A workspace with the details the client reads. */
48
75
  interface InfisicalWorkspaceDetails {
76
+ /** The workspace's environments. */
49
77
  environments?: InfisicalWorkspaceEnvironment[];
50
78
  }
79
+ /** The response of listing workspaces. */
51
80
  interface InfisicalWorkspaceListResponse {
81
+ /** The workspaces the token can see. */
52
82
  workspaces?: InfisicalWorkspace[];
53
83
  }
84
+ /** The response of reading one workspace. */
54
85
  interface InfisicalWorkspaceDetailsResponse {
86
+ /** The workspace that was read. */
55
87
  workspace?: InfisicalWorkspaceDetails;
56
88
  }
89
+ /** Creates an Infisical API client with `secrets` and `workspaces` groups, all sharing one REST client. */
57
90
  export declare function createInfisicalClient(opts: InfisicalClientOptions): {
58
91
  secrets: {
59
92
  list: (scope: InfisicalSecretScope) => Promise<InfisicalSecretsListResponse>;
@@ -68,5 +101,6 @@ export declare function createInfisicalClient(opts: InfisicalClientOptions): {
68
101
  createEnvironment: (workspaceId: string, name: string, slug: string) => Promise<unknown>;
69
102
  };
70
103
  };
104
+ /** The client `createInfisicalClient` returns. */
71
105
  export type InfisicalClient = ReturnType<typeof createInfisicalClient>;
72
106
  export type { InfisicalClientOptions, InfisicalCreateSecretInput, InfisicalSecret, InfisicalSecretResponse, InfisicalSecretScope, InfisicalSecretsListResponse, InfisicalUpdateSecretInput, InfisicalWorkspace, InfisicalWorkspaceDetails, InfisicalWorkspaceDetailsResponse, InfisicalWorkspaceEnvironment, InfisicalWorkspaceListResponse };
package/dist/index.mjs CHANGED
@@ -72,6 +72,7 @@ function workspaces(rest) {
72
72
  };
73
73
  }
74
74
  // src/index.ts
75
+ /** Creates an Infisical API client with `secrets` and `workspaces` groups, all sharing one REST client. */
75
76
  function createInfisicalClient(opts) {
76
77
  const rest = createInfisicalRestClient(opts);
77
78
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/infisical-client",
3
- "version": "1.57.1-alpha.2",
3
+ "version": "1.58.0-alpha.10",
4
4
  "description": "A TypeScript client for the Infisical API",
5
5
  "keywords": [
6
6
  "infisical",
@@ -32,23 +32,23 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/http-client": "^1.57.1-alpha.2",
36
- "@theholocron/observability": "^0.6.1-alpha.1"
35
+ "@theholocron/http-client": "^1.58.0-alpha.10",
36
+ "@theholocron/observability": "^0.7.0-alpha.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^26",
40
40
  "@vitest/coverage-v8": "^5.0.5",
41
- "@vitest/eslint-plugin": "^1.6.27",
42
- "eslint": "^10.8.1",
43
- "eslint-plugin-n": "^18.3.0",
44
- "globals": "^17.11.0",
45
- "tsdown": "^0.23.3",
41
+ "@vitest/eslint-plugin": "^1.6.28",
42
+ "eslint": "^10.14.0",
43
+ "eslint-plugin-n": "^18.5.0",
44
+ "globals": "^17.14.0",
45
+ "tsdown": "^0.23.4",
46
46
  "typescript": "^5.9.3",
47
47
  "vitest": "^5.0.5",
48
- "@theholocron/tsconfig": "^8.9.0-alpha.3",
49
- "@theholocron/eslint-config": "^8.9.0-alpha.3",
50
- "@theholocron/tsdown-config": "^8.9.0-alpha.3",
51
- "@theholocron/vitest-config": "^8.9.0-alpha.3"
48
+ "@theholocron/eslint-config": "^8.9.0-alpha.8",
49
+ "@theholocron/tsdown-config": "^8.9.0-alpha.8",
50
+ "@theholocron/tsconfig": "^8.9.0-alpha.8",
51
+ "@theholocron/vitest-config": "^8.9.0-alpha.8"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"
@@ -57,10 +57,10 @@
57
57
  "access": "public"
58
58
  },
59
59
  "scripts": {
60
- "delivery.build": "tsdown && node ../scripts/check-bundle-size.mjs",
61
- "sourceQuality.staticAnalysis": "eslint .",
60
+ "build": "tsdown && node ../scripts/check-bundle-size.mjs",
61
+ "lint:code": "eslint .",
62
+ "test:unit": "vitest run --coverage",
62
63
  "test:watch": "vitest",
63
- "verification.typeSafety": "tsc --noEmit",
64
- "verification.unitTests": "vitest run"
64
+ "typecheck": "tsc --noEmit"
65
65
  }
66
66
  }