@stack-spot/portal-network 0.184.0 → 0.185.0
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/CHANGELOG.md +2419 -2412
- package/dist/api/account.js +1 -1
- package/dist/api/agent-tools.js +1 -1
- package/dist/api/agent.js +1 -1
- package/dist/api/ai.js +1 -1
- package/dist/api/apiManagement.js +1 -1
- package/dist/api/apiRuntime.js +1 -1
- package/dist/api/cloudAccount.js +1 -1
- package/dist/api/cloudPlatform.js +1 -1
- package/dist/api/cloudPlatformHorizon.js +1 -1
- package/dist/api/cloudRuntimes.js +1 -1
- package/dist/api/cloudServices.js +1 -1
- package/dist/api/codeShift.d.ts +63 -4
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +14 -1
- package/dist/api/codeShift.js.map +1 -1
- package/dist/api/content.js +1 -1
- package/dist/api/dataIntegration.js +1 -1
- package/dist/api/discover.js +1 -1
- package/dist/api/genAiInference.js +1 -1
- package/dist/api/insights.js +1 -1
- package/dist/api/notification.js +1 -1
- package/dist/api/secrets.js +1 -1
- package/dist/api/serviceCatalog.js +1 -1
- package/dist/api/workspace-ai.js +1 -1
- package/dist/api/workspace.js +1 -1
- package/dist/api/workspaceManager.js +1 -1
- package/dist/api/workspaceSearchEngine.js +1 -1
- package/dist/client/code-shift.d.ts +22 -0
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +28 -1
- package/dist/client/code-shift.js.map +1 -1
- package/package.json +6 -6
- package/scripts/generate-apis.ts +134 -134
- package/src/api/account.ts +8367 -8367
- package/src/api/agent-tools.ts +2169 -2169
- package/src/api/agent.ts +1083 -1083
- package/src/api/ai.ts +3388 -3388
- package/src/api/apiManagement.ts +570 -570
- package/src/api/apiRuntime.ts +2103 -2103
- package/src/api/cloudAccount.ts +1239 -1239
- package/src/api/cloudPlatform.ts +927 -927
- package/src/api/cloudPlatformHorizon.ts +2655 -2655
- package/src/api/cloudRuntimes.ts +2043 -2043
- package/src/api/cloudServices.ts +1445 -1445
- package/src/api/codeShift.ts +3567 -3481
- package/src/api/content.ts +9785 -9785
- package/src/api/dataIntegration.ts +1657 -1657
- package/src/api/discover.ts +435 -435
- package/src/api/eventBus.ts +171 -171
- package/src/api/genAiInference.ts +603 -603
- package/src/api/insights.ts +310 -310
- package/src/api/notification.ts +334 -334
- package/src/api/secrets.ts +342 -342
- package/src/api/serviceCatalog.ts +2908 -2908
- package/src/api/workflows.ts +1669 -1669
- package/src/api/workspace-ai.ts +677 -677
- package/src/api/workspace.ts +5889 -5889
- package/src/api/workspaceManager.ts +2951 -2951
- package/src/api/workspaceSearchEngine.ts +153 -153
- package/src/api-addresses.ts +120 -120
- package/src/apis-itau.json +225 -225
- package/src/apis.json +225 -225
- package/src/client/account.ts +902 -902
- package/src/client/agent-tools.ts +210 -210
- package/src/client/agent.ts +81 -81
- package/src/client/ai.ts +395 -395
- package/src/client/api-management.ts +40 -40
- package/src/client/cloud-account.ts +70 -70
- package/src/client/cloud-platform-horizon.ts +113 -113
- package/src/client/cloud-platform.ts +163 -163
- package/src/client/cloud-runtimes.ts +129 -129
- package/src/client/cloud-services.ts +94 -94
- package/src/client/code-shift.ts +364 -349
- package/src/client/content.ts +538 -538
- package/src/client/data-integration.ts +191 -191
- package/src/client/discover.ts +89 -89
- package/src/client/event-bus.ts +84 -84
- package/src/client/gen-ai-inference.ts +65 -65
- package/src/client/insights.ts +28 -28
- package/src/client/notification.ts +32 -32
- package/src/client/runtime-manager.ts +76 -76
- package/src/client/secrets.ts +60 -60
- package/src/client/types.ts +377 -377
- package/src/client/workflow.ts +83 -83
- package/src/client/workspace-ai.ts +191 -191
- package/src/client/workspace-manager.ts +564 -564
- package/src/client/workspace-search.ts +39 -39
- package/src/client/workspace.ts +480 -480
- package/src/error/DefaultAPIError.ts +151 -151
- package/src/error/FileUploadError.ts +18 -18
- package/src/error/IgnoredErrorCodes.ts +3 -3
- package/src/error/StackspotAPIError.ts +101 -101
- package/src/error/StreamCanceledError.ts +10 -10
- package/src/error/StreamError.ts +7 -7
- package/src/error/StreamJsonError.ts +10 -10
- package/src/error/dictionary/account.ts +58 -58
- package/src/error/dictionary/action-details.ts +20 -20
- package/src/error/dictionary/action.ts +211 -211
- package/src/error/dictionary/agent-tools.ts +75 -75
- package/src/error/dictionary/ai-inference.ts +28 -28
- package/src/error/dictionary/base.ts +22 -22
- package/src/error/dictionary/cloud-platform.ts +82 -82
- package/src/error/dictionary/cnt-fields.ts +14 -14
- package/src/error/dictionary/cnt.ts +103 -103
- package/src/error/dictionary/code-shift.ts +12 -12
- package/src/error/dictionary/rte.ts +24 -24
- package/src/error/dictionary/rtm.ts +10 -10
- package/src/error/dictionary/secrets.ts +14 -14
- package/src/error/dictionary/workspace-ai.ts +10 -10
- package/src/error/dictionary/workspace-details.ts +15 -15
- package/src/error/dictionary/workspace-fields.ts +10 -10
- package/src/error/dictionary/workspace.ts +209 -209
- package/src/error/types.ts +21 -21
- package/src/index.ts +43 -43
- package/src/network/AutoInfiniteQuery.ts +115 -115
- package/src/network/AutoMutation.ts +27 -27
- package/src/network/AutoOperation.ts +73 -73
- package/src/network/AutoQuery.ts +75 -75
- package/src/network/ManualInfiniteQuery.ts +95 -95
- package/src/network/ManualMutation.ts +40 -40
- package/src/network/ManualOperation.ts +52 -52
- package/src/network/ManualQuery.ts +82 -82
- package/src/network/NetworkClient.ts +167 -167
- package/src/network/ReactQueryNetworkClient.ts +312 -312
- package/src/network/react-query-client.ts +14 -14
- package/src/network/types.ts +294 -294
- package/src/types.ts +1 -1
- package/src/utils/StreamedArray.tsx +146 -146
- package/src/utils/StreamedJson.tsx +166 -166
- package/src/utils/remove-authorization-param.ts +6 -6
- package/src/utils/string.ts +19 -19
- package/src/utils/use-extended-list.ts +80 -80
- package/src/utils/use-streamed-array.ts +17 -17
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +10 -10
package/src/api/secrets.ts
CHANGED
|
@@ -1,342 +1,342 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace Secrets API
|
|
3
|
-
* v1.0.0
|
|
4
|
-
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
-
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
-
*/
|
|
7
|
-
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
-
import * as QS from "@oazapfts/runtime/query";
|
|
9
|
-
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
|
|
10
|
-
headers: {},
|
|
11
|
-
baseUrl: "https://workspace-workspace-secrets-api.dev.stackspot.com",
|
|
12
|
-
};
|
|
13
|
-
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
-
export const servers = {
|
|
15
|
-
generatedServerUrl: "https://workspace-workspace-secrets-api.dev.stackspot.com"
|
|
16
|
-
};
|
|
17
|
-
export type SecretValueResponse = {
|
|
18
|
-
key: string;
|
|
19
|
-
description: string;
|
|
20
|
-
value: string;
|
|
21
|
-
};
|
|
22
|
-
export type ValidationDetails = {
|
|
23
|
-
code: string;
|
|
24
|
-
field?: string;
|
|
25
|
-
details?: string;
|
|
26
|
-
values?: string[];
|
|
27
|
-
};
|
|
28
|
-
export type ErrorResponse = {
|
|
29
|
-
code: string;
|
|
30
|
-
status: number;
|
|
31
|
-
details: string;
|
|
32
|
-
validationDetails?: ValidationDetails[];
|
|
33
|
-
};
|
|
34
|
-
export type UpdateSecretValueRequest = {
|
|
35
|
-
value: string;
|
|
36
|
-
};
|
|
37
|
-
export type EditKeyRequest = {
|
|
38
|
-
description: string;
|
|
39
|
-
};
|
|
40
|
-
export type SecretKeyResponse = {
|
|
41
|
-
key: string;
|
|
42
|
-
description: string;
|
|
43
|
-
};
|
|
44
|
-
export type CreateKeyRequest = {
|
|
45
|
-
key: string;
|
|
46
|
-
description: string;
|
|
47
|
-
};
|
|
48
|
-
export type EncryptRequest = {
|
|
49
|
-
value: string;
|
|
50
|
-
};
|
|
51
|
-
export type EncryptResponse = {
|
|
52
|
-
value: string;
|
|
53
|
-
};
|
|
54
|
-
export type DecryptRequest = {
|
|
55
|
-
value: string;
|
|
56
|
-
};
|
|
57
|
-
export type DecryptResponse = {
|
|
58
|
-
value: string;
|
|
59
|
-
};
|
|
60
|
-
export type SecretAvailabilityResponse = {
|
|
61
|
-
definedKeys: string[];
|
|
62
|
-
undefinedKeys: string[];
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Get a Secret Key value.
|
|
66
|
-
*/
|
|
67
|
-
export function getSecretValue({ key, executionId }: {
|
|
68
|
-
key: string;
|
|
69
|
-
executionId?: string;
|
|
70
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
71
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
72
|
-
status: 200;
|
|
73
|
-
data: SecretValueResponse;
|
|
74
|
-
} | {
|
|
75
|
-
status: 400;
|
|
76
|
-
data: ErrorResponse;
|
|
77
|
-
} | {
|
|
78
|
-
status: 403;
|
|
79
|
-
data: ErrorResponse;
|
|
80
|
-
} | {
|
|
81
|
-
status: 422;
|
|
82
|
-
data: ErrorResponse;
|
|
83
|
-
} | {
|
|
84
|
-
status: 500;
|
|
85
|
-
data: ErrorResponse;
|
|
86
|
-
}>(`/v1/secrets/values/${encodeURIComponent(key)}${QS.query(QS.explode({
|
|
87
|
-
executionId
|
|
88
|
-
}))}`, {
|
|
89
|
-
...opts
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Edit a Secret Key value.
|
|
94
|
-
*/
|
|
95
|
-
export function updateSecretValue({ key, updateSecretValueRequest }: {
|
|
96
|
-
key: string;
|
|
97
|
-
updateSecretValueRequest: UpdateSecretValueRequest;
|
|
98
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
99
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
100
|
-
status: 204;
|
|
101
|
-
} | {
|
|
102
|
-
status: 400;
|
|
103
|
-
data: ErrorResponse;
|
|
104
|
-
} | {
|
|
105
|
-
status: 403;
|
|
106
|
-
data: ErrorResponse;
|
|
107
|
-
} | {
|
|
108
|
-
status: 422;
|
|
109
|
-
data: ErrorResponse;
|
|
110
|
-
} | {
|
|
111
|
-
status: 500;
|
|
112
|
-
data: ErrorResponse;
|
|
113
|
-
}>(`/v1/secrets/values/${encodeURIComponent(key)}`, oazapfts.json({
|
|
114
|
-
...opts,
|
|
115
|
-
method: "PUT",
|
|
116
|
-
body: updateSecretValueRequest
|
|
117
|
-
})));
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Delete a Secret Key value.
|
|
121
|
-
*/
|
|
122
|
-
export function deleteSecretValue({ key }: {
|
|
123
|
-
key: string;
|
|
124
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
125
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
126
|
-
status: 204;
|
|
127
|
-
} | {
|
|
128
|
-
status: 400;
|
|
129
|
-
data: ErrorResponse;
|
|
130
|
-
} | {
|
|
131
|
-
status: 403;
|
|
132
|
-
data: ErrorResponse;
|
|
133
|
-
} | {
|
|
134
|
-
status: 422;
|
|
135
|
-
data: ErrorResponse;
|
|
136
|
-
} | {
|
|
137
|
-
status: 500;
|
|
138
|
-
data: ErrorResponse;
|
|
139
|
-
}>(`/v1/secrets/values/${encodeURIComponent(key)}`, {
|
|
140
|
-
...opts,
|
|
141
|
-
method: "DELETE"
|
|
142
|
-
}));
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Edit a Secret Key.
|
|
146
|
-
*/
|
|
147
|
-
export function editKey({ key, editKeyRequest }: {
|
|
148
|
-
key: string;
|
|
149
|
-
editKeyRequest: EditKeyRequest;
|
|
150
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
151
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
152
|
-
status: 200;
|
|
153
|
-
} | {
|
|
154
|
-
status: 400;
|
|
155
|
-
data: ErrorResponse;
|
|
156
|
-
} | {
|
|
157
|
-
status: 403;
|
|
158
|
-
data: ErrorResponse;
|
|
159
|
-
} | {
|
|
160
|
-
status: 422;
|
|
161
|
-
data: ErrorResponse;
|
|
162
|
-
} | {
|
|
163
|
-
status: 500;
|
|
164
|
-
data: ErrorResponse;
|
|
165
|
-
}>(`/v1/secrets/keys/${encodeURIComponent(key)}`, oazapfts.json({
|
|
166
|
-
...opts,
|
|
167
|
-
method: "PUT",
|
|
168
|
-
body: editKeyRequest
|
|
169
|
-
})));
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Delete a Secret Key.
|
|
173
|
-
*/
|
|
174
|
-
export function deleteKey({ key }: {
|
|
175
|
-
key: string;
|
|
176
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
177
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
178
|
-
status: 204;
|
|
179
|
-
} | {
|
|
180
|
-
status: 400;
|
|
181
|
-
data: ErrorResponse;
|
|
182
|
-
} | {
|
|
183
|
-
status: 403;
|
|
184
|
-
data: ErrorResponse;
|
|
185
|
-
} | {
|
|
186
|
-
status: 422;
|
|
187
|
-
data: ErrorResponse;
|
|
188
|
-
} | {
|
|
189
|
-
status: 500;
|
|
190
|
-
data: ErrorResponse;
|
|
191
|
-
}>(`/v1/secrets/keys/${encodeURIComponent(key)}`, {
|
|
192
|
-
...opts,
|
|
193
|
-
method: "DELETE"
|
|
194
|
-
}));
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* List all Secret Keys.
|
|
198
|
-
*/
|
|
199
|
-
export function getAll1(opts?: Oazapfts.RequestOpts) {
|
|
200
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
201
|
-
status: 200;
|
|
202
|
-
data: SecretKeyResponse[];
|
|
203
|
-
} | {
|
|
204
|
-
status: 400;
|
|
205
|
-
data: ErrorResponse;
|
|
206
|
-
} | {
|
|
207
|
-
status: 403;
|
|
208
|
-
data: ErrorResponse;
|
|
209
|
-
} | {
|
|
210
|
-
status: 422;
|
|
211
|
-
data: ErrorResponse;
|
|
212
|
-
} | {
|
|
213
|
-
status: 500;
|
|
214
|
-
data: ErrorResponse;
|
|
215
|
-
}>("/v1/secrets/keys", {
|
|
216
|
-
...opts
|
|
217
|
-
}));
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Create a new Secret Key.
|
|
221
|
-
*/
|
|
222
|
-
export function createKey({ createKeyRequest }: {
|
|
223
|
-
createKeyRequest: CreateKeyRequest;
|
|
224
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
225
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
226
|
-
status: 201;
|
|
227
|
-
} | {
|
|
228
|
-
status: 400;
|
|
229
|
-
data: ErrorResponse;
|
|
230
|
-
} | {
|
|
231
|
-
status: 403;
|
|
232
|
-
data: ErrorResponse;
|
|
233
|
-
} | {
|
|
234
|
-
status: 422;
|
|
235
|
-
data: ErrorResponse;
|
|
236
|
-
} | {
|
|
237
|
-
status: 500;
|
|
238
|
-
data: ErrorResponse;
|
|
239
|
-
}>("/v1/secrets/keys", oazapfts.json({
|
|
240
|
-
...opts,
|
|
241
|
-
method: "POST",
|
|
242
|
-
body: createKeyRequest
|
|
243
|
-
})));
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Encrypt a value.
|
|
247
|
-
*/
|
|
248
|
-
export function encrypt({ encryptRequest }: {
|
|
249
|
-
encryptRequest: EncryptRequest;
|
|
250
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
251
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
252
|
-
status: 201;
|
|
253
|
-
data: EncryptResponse;
|
|
254
|
-
} | {
|
|
255
|
-
status: 400;
|
|
256
|
-
data: ErrorResponse;
|
|
257
|
-
} | {
|
|
258
|
-
status: 403;
|
|
259
|
-
data: ErrorResponse;
|
|
260
|
-
} | {
|
|
261
|
-
status: 500;
|
|
262
|
-
data: ErrorResponse;
|
|
263
|
-
}>("/v1/secrets/encryption/encrypt", oazapfts.json({
|
|
264
|
-
...opts,
|
|
265
|
-
method: "POST",
|
|
266
|
-
body: encryptRequest
|
|
267
|
-
})));
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Decrypt a value.
|
|
271
|
-
*/
|
|
272
|
-
export function decrypt({ executionId, decryptRequest }: {
|
|
273
|
-
executionId?: string;
|
|
274
|
-
decryptRequest: DecryptRequest;
|
|
275
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
276
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
277
|
-
status: 201;
|
|
278
|
-
data: DecryptResponse;
|
|
279
|
-
} | {
|
|
280
|
-
status: 400;
|
|
281
|
-
data: ErrorResponse;
|
|
282
|
-
} | {
|
|
283
|
-
status: 403;
|
|
284
|
-
data: ErrorResponse;
|
|
285
|
-
} | {
|
|
286
|
-
status: 500;
|
|
287
|
-
data: ErrorResponse;
|
|
288
|
-
}>(`/v1/secrets/encryption/decrypt${QS.query(QS.explode({
|
|
289
|
-
executionId
|
|
290
|
-
}))}`, oazapfts.json({
|
|
291
|
-
...opts,
|
|
292
|
-
method: "POST",
|
|
293
|
-
body: decryptRequest
|
|
294
|
-
})));
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* List all configured Secret Keys values.
|
|
298
|
-
*/
|
|
299
|
-
export function getAll({ executionId }: {
|
|
300
|
-
executionId?: string;
|
|
301
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
302
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
303
|
-
status: 200;
|
|
304
|
-
data: SecretValueResponse[];
|
|
305
|
-
} | {
|
|
306
|
-
status: 400;
|
|
307
|
-
data: ErrorResponse;
|
|
308
|
-
} | {
|
|
309
|
-
status: 403;
|
|
310
|
-
data: ErrorResponse;
|
|
311
|
-
} | {
|
|
312
|
-
status: 422;
|
|
313
|
-
data: ErrorResponse;
|
|
314
|
-
} | {
|
|
315
|
-
status: 500;
|
|
316
|
-
data: ErrorResponse;
|
|
317
|
-
}>(`/v1/secrets/values${QS.query(QS.explode({
|
|
318
|
-
executionId
|
|
319
|
-
}))}`, {
|
|
320
|
-
...opts
|
|
321
|
-
}));
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* List all defined and not defined secret keys by the user.
|
|
325
|
-
*/
|
|
326
|
-
export function getAvailability(opts?: Oazapfts.RequestOpts) {
|
|
327
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
328
|
-
status: 200;
|
|
329
|
-
data: SecretAvailabilityResponse;
|
|
330
|
-
} | {
|
|
331
|
-
status: 400;
|
|
332
|
-
data: ErrorResponse;
|
|
333
|
-
} | {
|
|
334
|
-
status: 403;
|
|
335
|
-
data: ErrorResponse;
|
|
336
|
-
} | {
|
|
337
|
-
status: 500;
|
|
338
|
-
data: ErrorResponse;
|
|
339
|
-
}>("/v1/secrets/availability", {
|
|
340
|
-
...opts
|
|
341
|
-
}));
|
|
342
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Workspace Secrets API
|
|
3
|
+
* v1.0.0
|
|
4
|
+
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
+
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
+
*/
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
+
import * as QS from "@oazapfts/runtime/query";
|
|
9
|
+
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
|
|
10
|
+
headers: {},
|
|
11
|
+
baseUrl: "https://workspace-workspace-secrets-api.dev.stackspot.com",
|
|
12
|
+
};
|
|
13
|
+
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
+
export const servers = {
|
|
15
|
+
generatedServerUrl: "https://workspace-workspace-secrets-api.dev.stackspot.com"
|
|
16
|
+
};
|
|
17
|
+
export type SecretValueResponse = {
|
|
18
|
+
key: string;
|
|
19
|
+
description: string;
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
export type ValidationDetails = {
|
|
23
|
+
code: string;
|
|
24
|
+
field?: string;
|
|
25
|
+
details?: string;
|
|
26
|
+
values?: string[];
|
|
27
|
+
};
|
|
28
|
+
export type ErrorResponse = {
|
|
29
|
+
code: string;
|
|
30
|
+
status: number;
|
|
31
|
+
details: string;
|
|
32
|
+
validationDetails?: ValidationDetails[];
|
|
33
|
+
};
|
|
34
|
+
export type UpdateSecretValueRequest = {
|
|
35
|
+
value: string;
|
|
36
|
+
};
|
|
37
|
+
export type EditKeyRequest = {
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
export type SecretKeyResponse = {
|
|
41
|
+
key: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
export type CreateKeyRequest = {
|
|
45
|
+
key: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
export type EncryptRequest = {
|
|
49
|
+
value: string;
|
|
50
|
+
};
|
|
51
|
+
export type EncryptResponse = {
|
|
52
|
+
value: string;
|
|
53
|
+
};
|
|
54
|
+
export type DecryptRequest = {
|
|
55
|
+
value: string;
|
|
56
|
+
};
|
|
57
|
+
export type DecryptResponse = {
|
|
58
|
+
value: string;
|
|
59
|
+
};
|
|
60
|
+
export type SecretAvailabilityResponse = {
|
|
61
|
+
definedKeys: string[];
|
|
62
|
+
undefinedKeys: string[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Get a Secret Key value.
|
|
66
|
+
*/
|
|
67
|
+
export function getSecretValue({ key, executionId }: {
|
|
68
|
+
key: string;
|
|
69
|
+
executionId?: string;
|
|
70
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
71
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
72
|
+
status: 200;
|
|
73
|
+
data: SecretValueResponse;
|
|
74
|
+
} | {
|
|
75
|
+
status: 400;
|
|
76
|
+
data: ErrorResponse;
|
|
77
|
+
} | {
|
|
78
|
+
status: 403;
|
|
79
|
+
data: ErrorResponse;
|
|
80
|
+
} | {
|
|
81
|
+
status: 422;
|
|
82
|
+
data: ErrorResponse;
|
|
83
|
+
} | {
|
|
84
|
+
status: 500;
|
|
85
|
+
data: ErrorResponse;
|
|
86
|
+
}>(`/v1/secrets/values/${encodeURIComponent(key)}${QS.query(QS.explode({
|
|
87
|
+
executionId
|
|
88
|
+
}))}`, {
|
|
89
|
+
...opts
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Edit a Secret Key value.
|
|
94
|
+
*/
|
|
95
|
+
export function updateSecretValue({ key, updateSecretValueRequest }: {
|
|
96
|
+
key: string;
|
|
97
|
+
updateSecretValueRequest: UpdateSecretValueRequest;
|
|
98
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
99
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
100
|
+
status: 204;
|
|
101
|
+
} | {
|
|
102
|
+
status: 400;
|
|
103
|
+
data: ErrorResponse;
|
|
104
|
+
} | {
|
|
105
|
+
status: 403;
|
|
106
|
+
data: ErrorResponse;
|
|
107
|
+
} | {
|
|
108
|
+
status: 422;
|
|
109
|
+
data: ErrorResponse;
|
|
110
|
+
} | {
|
|
111
|
+
status: 500;
|
|
112
|
+
data: ErrorResponse;
|
|
113
|
+
}>(`/v1/secrets/values/${encodeURIComponent(key)}`, oazapfts.json({
|
|
114
|
+
...opts,
|
|
115
|
+
method: "PUT",
|
|
116
|
+
body: updateSecretValueRequest
|
|
117
|
+
})));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Delete a Secret Key value.
|
|
121
|
+
*/
|
|
122
|
+
export function deleteSecretValue({ key }: {
|
|
123
|
+
key: string;
|
|
124
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
125
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
126
|
+
status: 204;
|
|
127
|
+
} | {
|
|
128
|
+
status: 400;
|
|
129
|
+
data: ErrorResponse;
|
|
130
|
+
} | {
|
|
131
|
+
status: 403;
|
|
132
|
+
data: ErrorResponse;
|
|
133
|
+
} | {
|
|
134
|
+
status: 422;
|
|
135
|
+
data: ErrorResponse;
|
|
136
|
+
} | {
|
|
137
|
+
status: 500;
|
|
138
|
+
data: ErrorResponse;
|
|
139
|
+
}>(`/v1/secrets/values/${encodeURIComponent(key)}`, {
|
|
140
|
+
...opts,
|
|
141
|
+
method: "DELETE"
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Edit a Secret Key.
|
|
146
|
+
*/
|
|
147
|
+
export function editKey({ key, editKeyRequest }: {
|
|
148
|
+
key: string;
|
|
149
|
+
editKeyRequest: EditKeyRequest;
|
|
150
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
151
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
152
|
+
status: 200;
|
|
153
|
+
} | {
|
|
154
|
+
status: 400;
|
|
155
|
+
data: ErrorResponse;
|
|
156
|
+
} | {
|
|
157
|
+
status: 403;
|
|
158
|
+
data: ErrorResponse;
|
|
159
|
+
} | {
|
|
160
|
+
status: 422;
|
|
161
|
+
data: ErrorResponse;
|
|
162
|
+
} | {
|
|
163
|
+
status: 500;
|
|
164
|
+
data: ErrorResponse;
|
|
165
|
+
}>(`/v1/secrets/keys/${encodeURIComponent(key)}`, oazapfts.json({
|
|
166
|
+
...opts,
|
|
167
|
+
method: "PUT",
|
|
168
|
+
body: editKeyRequest
|
|
169
|
+
})));
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Delete a Secret Key.
|
|
173
|
+
*/
|
|
174
|
+
export function deleteKey({ key }: {
|
|
175
|
+
key: string;
|
|
176
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
177
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
178
|
+
status: 204;
|
|
179
|
+
} | {
|
|
180
|
+
status: 400;
|
|
181
|
+
data: ErrorResponse;
|
|
182
|
+
} | {
|
|
183
|
+
status: 403;
|
|
184
|
+
data: ErrorResponse;
|
|
185
|
+
} | {
|
|
186
|
+
status: 422;
|
|
187
|
+
data: ErrorResponse;
|
|
188
|
+
} | {
|
|
189
|
+
status: 500;
|
|
190
|
+
data: ErrorResponse;
|
|
191
|
+
}>(`/v1/secrets/keys/${encodeURIComponent(key)}`, {
|
|
192
|
+
...opts,
|
|
193
|
+
method: "DELETE"
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* List all Secret Keys.
|
|
198
|
+
*/
|
|
199
|
+
export function getAll1(opts?: Oazapfts.RequestOpts) {
|
|
200
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
201
|
+
status: 200;
|
|
202
|
+
data: SecretKeyResponse[];
|
|
203
|
+
} | {
|
|
204
|
+
status: 400;
|
|
205
|
+
data: ErrorResponse;
|
|
206
|
+
} | {
|
|
207
|
+
status: 403;
|
|
208
|
+
data: ErrorResponse;
|
|
209
|
+
} | {
|
|
210
|
+
status: 422;
|
|
211
|
+
data: ErrorResponse;
|
|
212
|
+
} | {
|
|
213
|
+
status: 500;
|
|
214
|
+
data: ErrorResponse;
|
|
215
|
+
}>("/v1/secrets/keys", {
|
|
216
|
+
...opts
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Create a new Secret Key.
|
|
221
|
+
*/
|
|
222
|
+
export function createKey({ createKeyRequest }: {
|
|
223
|
+
createKeyRequest: CreateKeyRequest;
|
|
224
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
225
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
226
|
+
status: 201;
|
|
227
|
+
} | {
|
|
228
|
+
status: 400;
|
|
229
|
+
data: ErrorResponse;
|
|
230
|
+
} | {
|
|
231
|
+
status: 403;
|
|
232
|
+
data: ErrorResponse;
|
|
233
|
+
} | {
|
|
234
|
+
status: 422;
|
|
235
|
+
data: ErrorResponse;
|
|
236
|
+
} | {
|
|
237
|
+
status: 500;
|
|
238
|
+
data: ErrorResponse;
|
|
239
|
+
}>("/v1/secrets/keys", oazapfts.json({
|
|
240
|
+
...opts,
|
|
241
|
+
method: "POST",
|
|
242
|
+
body: createKeyRequest
|
|
243
|
+
})));
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Encrypt a value.
|
|
247
|
+
*/
|
|
248
|
+
export function encrypt({ encryptRequest }: {
|
|
249
|
+
encryptRequest: EncryptRequest;
|
|
250
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
251
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
252
|
+
status: 201;
|
|
253
|
+
data: EncryptResponse;
|
|
254
|
+
} | {
|
|
255
|
+
status: 400;
|
|
256
|
+
data: ErrorResponse;
|
|
257
|
+
} | {
|
|
258
|
+
status: 403;
|
|
259
|
+
data: ErrorResponse;
|
|
260
|
+
} | {
|
|
261
|
+
status: 500;
|
|
262
|
+
data: ErrorResponse;
|
|
263
|
+
}>("/v1/secrets/encryption/encrypt", oazapfts.json({
|
|
264
|
+
...opts,
|
|
265
|
+
method: "POST",
|
|
266
|
+
body: encryptRequest
|
|
267
|
+
})));
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Decrypt a value.
|
|
271
|
+
*/
|
|
272
|
+
export function decrypt({ executionId, decryptRequest }: {
|
|
273
|
+
executionId?: string;
|
|
274
|
+
decryptRequest: DecryptRequest;
|
|
275
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
276
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
277
|
+
status: 201;
|
|
278
|
+
data: DecryptResponse;
|
|
279
|
+
} | {
|
|
280
|
+
status: 400;
|
|
281
|
+
data: ErrorResponse;
|
|
282
|
+
} | {
|
|
283
|
+
status: 403;
|
|
284
|
+
data: ErrorResponse;
|
|
285
|
+
} | {
|
|
286
|
+
status: 500;
|
|
287
|
+
data: ErrorResponse;
|
|
288
|
+
}>(`/v1/secrets/encryption/decrypt${QS.query(QS.explode({
|
|
289
|
+
executionId
|
|
290
|
+
}))}`, oazapfts.json({
|
|
291
|
+
...opts,
|
|
292
|
+
method: "POST",
|
|
293
|
+
body: decryptRequest
|
|
294
|
+
})));
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* List all configured Secret Keys values.
|
|
298
|
+
*/
|
|
299
|
+
export function getAll({ executionId }: {
|
|
300
|
+
executionId?: string;
|
|
301
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
302
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
303
|
+
status: 200;
|
|
304
|
+
data: SecretValueResponse[];
|
|
305
|
+
} | {
|
|
306
|
+
status: 400;
|
|
307
|
+
data: ErrorResponse;
|
|
308
|
+
} | {
|
|
309
|
+
status: 403;
|
|
310
|
+
data: ErrorResponse;
|
|
311
|
+
} | {
|
|
312
|
+
status: 422;
|
|
313
|
+
data: ErrorResponse;
|
|
314
|
+
} | {
|
|
315
|
+
status: 500;
|
|
316
|
+
data: ErrorResponse;
|
|
317
|
+
}>(`/v1/secrets/values${QS.query(QS.explode({
|
|
318
|
+
executionId
|
|
319
|
+
}))}`, {
|
|
320
|
+
...opts
|
|
321
|
+
}));
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* List all defined and not defined secret keys by the user.
|
|
325
|
+
*/
|
|
326
|
+
export function getAvailability(opts?: Oazapfts.RequestOpts) {
|
|
327
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
328
|
+
status: 200;
|
|
329
|
+
data: SecretAvailabilityResponse;
|
|
330
|
+
} | {
|
|
331
|
+
status: 400;
|
|
332
|
+
data: ErrorResponse;
|
|
333
|
+
} | {
|
|
334
|
+
status: 403;
|
|
335
|
+
data: ErrorResponse;
|
|
336
|
+
} | {
|
|
337
|
+
status: 500;
|
|
338
|
+
data: ErrorResponse;
|
|
339
|
+
}>("/v1/secrets/availability", {
|
|
340
|
+
...opts
|
|
341
|
+
}));
|
|
342
|
+
}
|