@theholocron/doppler-client 1.58.0-alpha.46 → 1.58.0-alpha.47
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 +39 -2
- package/dist/index.mjs +13 -2
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -78,7 +78,40 @@ 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
|
-
/**
|
|
81
|
+
/** A webhook of a Doppler project, as the list call returns it. The signing secret is never returned. */
|
|
82
|
+
interface DopplerWebhook {
|
|
83
|
+
/** The webhook's slug. */
|
|
84
|
+
id?: string;
|
|
85
|
+
/** The webhook's name. */
|
|
86
|
+
name?: string;
|
|
87
|
+
/** Where Doppler posts. */
|
|
88
|
+
url?: string;
|
|
89
|
+
/** Whether the webhook is on. */
|
|
90
|
+
enabled?: boolean;
|
|
91
|
+
/** Whether a signing secret is set (the value is never returned). */
|
|
92
|
+
hasSecret?: boolean;
|
|
93
|
+
/** The config slugs it applies to. */
|
|
94
|
+
enabledConfigs?: string[];
|
|
95
|
+
/** Whether the caller may change it. */
|
|
96
|
+
canManage?: boolean;
|
|
97
|
+
}
|
|
98
|
+
/** The response of listing a project's webhooks. */
|
|
99
|
+
interface DopplerWebhooksResponse {
|
|
100
|
+
/** The project's webhooks. */
|
|
101
|
+
webhooks?: DopplerWebhook[];
|
|
102
|
+
}
|
|
103
|
+
/** What creating a webhook takes. */
|
|
104
|
+
interface DopplerWebhookInput {
|
|
105
|
+
/** An https URL. */
|
|
106
|
+
url: string;
|
|
107
|
+
/** The webhook's name. */
|
|
108
|
+
name?: string;
|
|
109
|
+
/** The signing secret Doppler uses for `X-Doppler-Signature`. A credential. */
|
|
110
|
+
secret?: string;
|
|
111
|
+
/** The config slugs it applies to. */
|
|
112
|
+
enableConfigs?: string[];
|
|
113
|
+
}
|
|
114
|
+
/** Creates a Doppler API client with `environments`, `me`, `projects`, `secrets` and `webhooks` groups, all sharing one REST client. */
|
|
82
115
|
export declare function createDopplerClient(opts: DopplerClientOptions): {
|
|
83
116
|
environments: {
|
|
84
117
|
list: (project: string) => Promise<DopplerEnvironmentsResponse>;
|
|
@@ -96,7 +129,11 @@ export declare function createDopplerClient(opts: DopplerClientOptions): {
|
|
|
96
129
|
update: (project: string, config: string, values: Record<string, string>) => Promise<DopplerSecretsMap>;
|
|
97
130
|
download: (project: string, config: string) => Promise<Record<string, string>>;
|
|
98
131
|
};
|
|
132
|
+
webhooks: {
|
|
133
|
+
list: (project: string) => Promise<DopplerWebhooksResponse>;
|
|
134
|
+
create: (project: string, input: DopplerWebhookInput) => Promise<unknown>;
|
|
135
|
+
};
|
|
99
136
|
};
|
|
100
137
|
/** The client `createDopplerClient` returns. */
|
|
101
138
|
export type DopplerClient = ReturnType<typeof createDopplerClient>;
|
|
102
|
-
export type { DopplerClientOptions, DopplerEnvironment, DopplerEnvironmentsResponse, DopplerMe, DopplerProject, DopplerProjectResponse, DopplerSecret, DopplerSecretValue, DopplerSecretsMap };
|
|
139
|
+
export type { DopplerClientOptions, DopplerEnvironment, DopplerEnvironmentsResponse, DopplerMe, DopplerProject, DopplerProjectResponse, DopplerSecret, DopplerSecretValue, DopplerSecretsMap, DopplerWebhook, DopplerWebhookInput, DopplerWebhooksResponse };
|
package/dist/index.mjs
CHANGED
|
@@ -65,15 +65,26 @@ function createDopplerRestClient(opts) {
|
|
|
65
65
|
errors: opts.errors
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
+
// src/webhooks/webhooks.ts
|
|
69
|
+
function webhooks(rest) {
|
|
70
|
+
return {
|
|
71
|
+
list: (project) => rest.request(`/webhooks?project=${encodeURIComponent(project)}`),
|
|
72
|
+
create: (project, input) => rest.request(`/webhooks?project=${encodeURIComponent(project)}`, {
|
|
73
|
+
method: "POST",
|
|
74
|
+
body: input
|
|
75
|
+
})
|
|
76
|
+
};
|
|
77
|
+
}
|
|
68
78
|
// src/index.ts
|
|
69
|
-
/** Creates a Doppler API client with `environments`, `me`, `projects` and `
|
|
79
|
+
/** Creates a Doppler API client with `environments`, `me`, `projects`, `secrets` and `webhooks` groups, all sharing one REST client. */
|
|
70
80
|
function createDopplerClient(opts) {
|
|
71
81
|
const rest = createDopplerRestClient(opts);
|
|
72
82
|
return {
|
|
73
83
|
environments: environments(rest),
|
|
74
84
|
me: me(rest),
|
|
75
85
|
projects: projects(rest),
|
|
76
|
-
secrets: secrets(rest)
|
|
86
|
+
secrets: secrets(rest),
|
|
87
|
+
webhooks: webhooks(rest)
|
|
77
88
|
};
|
|
78
89
|
}
|
|
79
90
|
export { createDopplerClient };
|
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.47",
|
|
4
4
|
"description": "A TypeScript client for the Doppler API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"doppler",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@theholocron/http-client": "^1.58.0-alpha.
|
|
35
|
+
"@theholocron/http-client": "^1.58.0-alpha.47",
|
|
36
36
|
"@theholocron/observability": "^0.7.0-alpha.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"tsdown": "^0.23.7",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"vitest": "^5.1.0",
|
|
48
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.21",
|
|
49
48
|
"@theholocron/eslint-config": "^8.9.0-alpha.21",
|
|
50
|
-
"@theholocron/
|
|
51
|
-
"@theholocron/vitest-config": "^8.9.0-alpha.21"
|
|
49
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.21",
|
|
50
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.21",
|
|
51
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.21"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22.0.0"
|