@theholocron/doppler-client 1.58.0-alpha.64 → 1.58.0-alpha.66
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 +41 -2
- package/dist/index.mjs +28 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -78,6 +78,41 @@ interface DopplerSecretsMap {
|
|
|
78
78
|
/** Each secret's value by name; a secret with no value is `null`. */
|
|
79
79
|
secrets?: Record<string, DopplerSecretValue | null>;
|
|
80
80
|
}
|
|
81
|
+
/** What making a service token takes (`POST /v3/configs/config/tokens`). */
|
|
82
|
+
interface DopplerServiceTokenInput {
|
|
83
|
+
/** The project the token is scoped to. */
|
|
84
|
+
project: string;
|
|
85
|
+
/** The config of that project the token is scoped to. */
|
|
86
|
+
config: string;
|
|
87
|
+
/** The name the token is shown under. */
|
|
88
|
+
name: string;
|
|
89
|
+
/** What the token may do. Doppler's default is `read`. */
|
|
90
|
+
access?: "read" | "read/write";
|
|
91
|
+
/** When the token stops working, as an ISO 8601 time. Omitted, the token never expires. */
|
|
92
|
+
expireAt?: string;
|
|
93
|
+
}
|
|
94
|
+
/** A service token as the create call returns it. `key` (the secret) is returned only then. */
|
|
95
|
+
interface DopplerServiceToken {
|
|
96
|
+
/** The token's value (`dp.st.…`). A credential, shown once. */
|
|
97
|
+
key?: string;
|
|
98
|
+
/** The token's unique id, what a delete takes. */
|
|
99
|
+
slug?: string;
|
|
100
|
+
/** The token's name. */
|
|
101
|
+
name?: string;
|
|
102
|
+
/** The project the token is scoped to. */
|
|
103
|
+
project?: string;
|
|
104
|
+
/** The config the token is scoped to. */
|
|
105
|
+
config?: string;
|
|
106
|
+
/** `read` or `read/write`. */
|
|
107
|
+
access?: string;
|
|
108
|
+
/** When the token expires, `null` when it never does. */
|
|
109
|
+
expires_at?: string | null;
|
|
110
|
+
}
|
|
111
|
+
/** The response of deleting a service token. */
|
|
112
|
+
interface DopplerDeleteResponse {
|
|
113
|
+
/** `true` when Doppler deleted it. */
|
|
114
|
+
success?: boolean;
|
|
115
|
+
}
|
|
81
116
|
/** A webhook of a Doppler project, as the list call returns it. The signing secret is never returned. */
|
|
82
117
|
interface DopplerWebhook {
|
|
83
118
|
/** The webhook's slug. */
|
|
@@ -111,7 +146,7 @@ interface DopplerWebhookInput {
|
|
|
111
146
|
/** The config slugs it applies to. */
|
|
112
147
|
enableConfigs?: string[];
|
|
113
148
|
}
|
|
114
|
-
/** Creates a Doppler API client with `environments`, `me`, `projects`, `secrets` and `webhooks` groups, all sharing one REST client. */
|
|
149
|
+
/** Creates a Doppler API client with `environments`, `me`, `projects`, `secrets`, `serviceTokens` and `webhooks` groups, all sharing one REST client. */
|
|
115
150
|
export declare function createDopplerClient(opts: DopplerClientOptions): {
|
|
116
151
|
environments: {
|
|
117
152
|
list: (project: string) => Promise<DopplerEnvironmentsResponse>;
|
|
@@ -129,6 +164,10 @@ export declare function createDopplerClient(opts: DopplerClientOptions): {
|
|
|
129
164
|
update: (project: string, config: string, values: Record<string, string>) => Promise<DopplerSecretsMap>;
|
|
130
165
|
download: (project: string, config: string) => Promise<Record<string, string>>;
|
|
131
166
|
};
|
|
167
|
+
serviceTokens: {
|
|
168
|
+
create: (input: DopplerServiceTokenInput) => Promise<DopplerServiceToken>;
|
|
169
|
+
delete: (project: string, config: string, slug: string) => Promise<DopplerDeleteResponse>;
|
|
170
|
+
};
|
|
132
171
|
webhooks: {
|
|
133
172
|
list: (project: string) => Promise<DopplerWebhooksResponse>;
|
|
134
173
|
create: (project: string, input: DopplerWebhookInput) => Promise<unknown>;
|
|
@@ -136,4 +175,4 @@ export declare function createDopplerClient(opts: DopplerClientOptions): {
|
|
|
136
175
|
};
|
|
137
176
|
/** The client `createDopplerClient` returns. */
|
|
138
177
|
export type DopplerClient = ReturnType<typeof createDopplerClient>;
|
|
139
|
-
export type { DopplerClientOptions, DopplerEnvironment, DopplerEnvironmentsResponse, DopplerMe, DopplerProject, DopplerProjectResponse, DopplerSecret, DopplerSecretValue, DopplerSecretsMap, DopplerWebhook, DopplerWebhookInput, DopplerWebhooksResponse };
|
|
178
|
+
export type { DopplerClientOptions, DopplerDeleteResponse, DopplerEnvironment, DopplerEnvironmentsResponse, DopplerMe, DopplerProject, DopplerProjectResponse, DopplerSecret, DopplerSecretValue, DopplerSecretsMap, DopplerServiceToken, DopplerServiceTokenInput, DopplerWebhook, DopplerWebhookInput, DopplerWebhooksResponse };
|
package/dist/index.mjs
CHANGED
|
@@ -54,6 +54,32 @@ function secrets(rest) {
|
|
|
54
54
|
} })
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
// src/service-tokens/service-tokens.ts
|
|
58
|
+
/** The service-token calls: scoped to one project and one config, unlike the caller's own token. */
|
|
59
|
+
function serviceTokens(rest) {
|
|
60
|
+
return {
|
|
61
|
+
/** Makes a service token for one project and config; the response carries its value once. */
|
|
62
|
+
create: (input) => rest.request("/configs/config/tokens", {
|
|
63
|
+
method: "POST",
|
|
64
|
+
body: {
|
|
65
|
+
project: input.project,
|
|
66
|
+
config: input.config,
|
|
67
|
+
name: input.name,
|
|
68
|
+
access: input.access,
|
|
69
|
+
expire_at: input.expireAt
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
/** Deletes a service token by its `slug`, in the project and config it lives in. */
|
|
73
|
+
delete: (project, config, slug) => rest.request("/configs/config/tokens/token", {
|
|
74
|
+
method: "DELETE",
|
|
75
|
+
body: {
|
|
76
|
+
project,
|
|
77
|
+
config,
|
|
78
|
+
slug
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
};
|
|
82
|
+
}
|
|
57
83
|
// src/utils.ts
|
|
58
84
|
function createDopplerRestClient(opts) {
|
|
59
85
|
return createRestClient({
|
|
@@ -76,7 +102,7 @@ function webhooks(rest) {
|
|
|
76
102
|
};
|
|
77
103
|
}
|
|
78
104
|
// src/index.ts
|
|
79
|
-
/** Creates a Doppler API client with `environments`, `me`, `projects`, `secrets` and `webhooks` groups, all sharing one REST client. */
|
|
105
|
+
/** Creates a Doppler API client with `environments`, `me`, `projects`, `secrets`, `serviceTokens` and `webhooks` groups, all sharing one REST client. */
|
|
80
106
|
function createDopplerClient(opts) {
|
|
81
107
|
const rest = createDopplerRestClient(opts);
|
|
82
108
|
return {
|
|
@@ -84,6 +110,7 @@ function createDopplerClient(opts) {
|
|
|
84
110
|
me: me(rest),
|
|
85
111
|
projects: projects(rest),
|
|
86
112
|
secrets: secrets(rest),
|
|
113
|
+
serviceTokens: serviceTokens(rest),
|
|
87
114
|
webhooks: webhooks(rest)
|
|
88
115
|
};
|
|
89
116
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/doppler-client",
|
|
3
|
-
"version": "1.58.0-alpha.
|
|
3
|
+
"version": "1.58.0-alpha.66",
|
|
4
4
|
"description": "A TypeScript client for the Doppler API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"doppler",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@theholocron/http-client": "^1.58.0-alpha.
|
|
36
|
-
"@theholocron/observability": "^0.7.0-alpha.
|
|
35
|
+
"@theholocron/http-client": "^1.58.0-alpha.66",
|
|
36
|
+
"@theholocron/observability": "^0.7.0-alpha.9"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^26",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"tsdown": "^0.23.7",
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
47
|
"vitest": "^5.1.1",
|
|
48
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.24",
|
|
49
48
|
"@theholocron/eslint-config": "^8.9.0-alpha.24",
|
|
49
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.24",
|
|
50
50
|
"@theholocron/tsdown-config": "^8.9.0-alpha.24",
|
|
51
51
|
"@theholocron/vitest-config": "^8.9.0-alpha.24"
|
|
52
52
|
},
|