freestyle-sandboxes 0.0.25 → 0.0.27
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/ai/index.d.cts +1 -1
- package/dist/ai/index.d.mts +1 -1
- package/dist/index.cjs +309 -58
- package/dist/index.d.cts +73 -8
- package/dist/index.d.mts +73 -8
- package/dist/index.mjs +309 -58
- package/dist/langgraph/index.d.cts +1 -1
- package/dist/langgraph/index.d.mts +1 -1
- package/dist/mastra/index.d.cts +1 -1
- package/dist/mastra/index.d.mts +1 -1
- package/dist/types.gen-BzRtj_TA.d.ts +725 -0
- package/dist/utils/index.cjs +90 -0
- package/dist/utils/index.d.cts +12 -0
- package/dist/utils/index.d.mts +12 -0
- package/dist/utils/index.mjs +65 -0
- package/openapi/sdk.gen.ts +203 -9
- package/openapi/types.gen.ts +440 -20
- package/openapi.json +1 -1
- package/package.json +11 -1
- package/src/index.ts +397 -91
package/dist/ai/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-
|
|
2
|
+
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-BzRtj_TA.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const executeCodeSchema: z.ZodObject<{
|
package/dist/ai/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-
|
|
2
|
+
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-BzRtj_TA.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const executeCodeSchema: z.ZodObject<{
|
package/dist/index.cjs
CHANGED
|
@@ -69,19 +69,79 @@ const handleExecuteScript = (options) => {
|
|
|
69
69
|
url: "/execute/v1/script"
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
const
|
|
72
|
+
const handleCreateIdentity = (options) => {
|
|
73
|
+
return (options?.client ?? client).post({
|
|
74
|
+
...options,
|
|
75
|
+
url: "/git/v1/identity"
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const handleDeleteIdentity = (options) => {
|
|
79
|
+
return (options?.client ?? client).delete({
|
|
80
|
+
...options,
|
|
81
|
+
url: "/git/v1/identity/{identity}"
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const handleListPermissions = (options) => {
|
|
85
|
+
return (options?.client ?? client).get({
|
|
86
|
+
...options,
|
|
87
|
+
url: "/git/v1/identity/{identity}/permissions"
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const handleDescribePermission = (options) => {
|
|
91
|
+
return (options?.client ?? client).get({
|
|
92
|
+
...options,
|
|
93
|
+
url: "/git/v1/identity/{identity}/permissions/{repo}"
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const handleGrantPermission = (options) => {
|
|
97
|
+
return (options?.client ?? client).post({
|
|
98
|
+
...options,
|
|
99
|
+
url: "/git/v1/identity/{identity}/permissions/{repo}"
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const handleRevokePermission = (options) => {
|
|
103
|
+
return (options?.client ?? client).delete({
|
|
104
|
+
...options,
|
|
105
|
+
url: "/git/v1/identity/{identity}/permissions/{repo}"
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const handleUpdatePermission = (options) => {
|
|
109
|
+
return (options?.client ?? client).patch({
|
|
110
|
+
...options,
|
|
111
|
+
url: "/git/v1/identity/{identity}/permissions/{repo}"
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
const handleListGitTokens = (options) => {
|
|
115
|
+
return (options?.client ?? client).get({
|
|
116
|
+
...options,
|
|
117
|
+
url: "/git/v1/identity/{identity}/tokens"
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
const handleCreateGitToken = (options) => {
|
|
121
|
+
return (options?.client ?? client).post({
|
|
122
|
+
...options,
|
|
123
|
+
url: "/git/v1/identity/{identity}/tokens"
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
const handleRevokeGitToken = (options) => {
|
|
127
|
+
return (options?.client ?? client).delete({
|
|
128
|
+
...options,
|
|
129
|
+
url: "/git/v1/identity/{identity}/tokens"
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
const handleListRepositories = (options) => {
|
|
73
133
|
return (options?.client ?? client).get({
|
|
74
134
|
...options,
|
|
75
135
|
url: "/git/v1/repo"
|
|
76
136
|
});
|
|
77
137
|
};
|
|
78
|
-
const
|
|
138
|
+
const handleCreateRepo = (options) => {
|
|
79
139
|
return (options?.client ?? client).post({
|
|
80
140
|
...options,
|
|
81
141
|
url: "/git/v1/repo"
|
|
82
142
|
});
|
|
83
143
|
};
|
|
84
|
-
const
|
|
144
|
+
const handleDeleteRepo = (options) => {
|
|
85
145
|
return (options?.client ?? client).delete({
|
|
86
146
|
...options,
|
|
87
147
|
url: "/git/v1/repo/{repo}"
|
|
@@ -130,19 +190,18 @@ class FreestyleSandboxes {
|
|
|
130
190
|
});
|
|
131
191
|
if (response.data) {
|
|
132
192
|
return response.data;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
193
|
+
}
|
|
194
|
+
throw new Error(
|
|
195
|
+
`Failed to execute script:
|
|
136
196
|
|
|
137
197
|
${script}
|
|
138
198
|
|
|
139
199
|
Error:
|
|
140
200
|
|
|
141
201
|
${JSON.stringify(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
202
|
+
response
|
|
203
|
+
)}`
|
|
204
|
+
);
|
|
146
205
|
}
|
|
147
206
|
/**
|
|
148
207
|
* Deploy a Web project to a sandbox.
|
|
@@ -157,15 +216,14 @@ ${JSON.stringify(
|
|
|
157
216
|
});
|
|
158
217
|
if (response.data) {
|
|
159
218
|
return response.data;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
219
|
+
}
|
|
220
|
+
throw new Error(
|
|
221
|
+
`Failed to deploy web project
|
|
163
222
|
|
|
164
223
|
Status: ${response.response.status}
|
|
165
224
|
|
|
166
225
|
Message: ${response.error?.message}`
|
|
167
|
-
|
|
168
|
-
}
|
|
226
|
+
);
|
|
169
227
|
}
|
|
170
228
|
/**
|
|
171
229
|
* Deploy a Cloudstate project to a sandbox.
|
|
@@ -177,9 +235,8 @@ Message: ${response.error?.message}`
|
|
|
177
235
|
});
|
|
178
236
|
if (response.data) {
|
|
179
237
|
return response.data;
|
|
180
|
-
} else {
|
|
181
|
-
throw new Error("Failed to deploy Cloudstate project");
|
|
182
238
|
}
|
|
239
|
+
throw new Error("Failed to deploy Cloudstate project");
|
|
183
240
|
}
|
|
184
241
|
/**
|
|
185
242
|
* Get a backup of a Cloudstate project in a sandbox.
|
|
@@ -196,9 +253,8 @@ Message: ${response.error?.message}`
|
|
|
196
253
|
});
|
|
197
254
|
if (response.data) {
|
|
198
255
|
return response.data;
|
|
199
|
-
} else {
|
|
200
|
-
throw new Error("Failed to get backup of Cloudstate project");
|
|
201
256
|
}
|
|
257
|
+
throw new Error("Failed to get backup of Cloudstate project");
|
|
202
258
|
}
|
|
203
259
|
/**
|
|
204
260
|
* Get logs for an execute run, or web deployment.
|
|
@@ -218,9 +274,8 @@ Message: ${response.error?.message}`
|
|
|
218
274
|
});
|
|
219
275
|
if (response.data) {
|
|
220
276
|
return response.data;
|
|
221
|
-
} else {
|
|
222
|
-
throw new Error("Failed to get logs for sandbox");
|
|
223
277
|
}
|
|
278
|
+
throw new Error("Failed to get logs for sandbox");
|
|
224
279
|
}
|
|
225
280
|
/**
|
|
226
281
|
* Create a a domain verification request.
|
|
@@ -236,9 +291,8 @@ Message: ${response.error?.message}`
|
|
|
236
291
|
});
|
|
237
292
|
if (response.data) {
|
|
238
293
|
return response.data;
|
|
239
|
-
} else {
|
|
240
|
-
throw new Error(response.error.message);
|
|
241
294
|
}
|
|
295
|
+
throw new Error(response.error.message);
|
|
242
296
|
}
|
|
243
297
|
/**
|
|
244
298
|
* Verify a domain. Note, this requires the domain verification token to be already set up.
|
|
@@ -254,11 +308,10 @@ Message: ${response.error?.message}`
|
|
|
254
308
|
});
|
|
255
309
|
if (response.data) {
|
|
256
310
|
return response.data;
|
|
257
|
-
} else {
|
|
258
|
-
throw new Error(
|
|
259
|
-
`Failed to verify domain ${domain}: ${response.error.message}`
|
|
260
|
-
);
|
|
261
311
|
}
|
|
312
|
+
throw new Error(
|
|
313
|
+
`Failed to verify domain ${domain}: ${response.error.message}`
|
|
314
|
+
);
|
|
262
315
|
}
|
|
263
316
|
async listDomains() {
|
|
264
317
|
const response = await handleListDomains({
|
|
@@ -266,9 +319,9 @@ Message: ${response.error?.message}`
|
|
|
266
319
|
});
|
|
267
320
|
if (response.data) {
|
|
268
321
|
return response.data;
|
|
269
|
-
} else {
|
|
270
|
-
throw new Error("Failed to list domains\n" + response.error.message);
|
|
271
322
|
}
|
|
323
|
+
throw new Error(`Failed to list domains
|
|
324
|
+
${response.error.message}`);
|
|
272
325
|
}
|
|
273
326
|
async listDomainVerificationRequests() {
|
|
274
327
|
const response = await handleListDomainVerificationRequests(
|
|
@@ -278,11 +331,11 @@ Message: ${response.error?.message}`
|
|
|
278
331
|
);
|
|
279
332
|
if (response.data) {
|
|
280
333
|
return response.data;
|
|
281
|
-
} else {
|
|
282
|
-
throw new Error(
|
|
283
|
-
"Failed to list domain verification requests\n" + response.error.message
|
|
284
|
-
);
|
|
285
334
|
}
|
|
335
|
+
throw new Error(
|
|
336
|
+
`Failed to list domain verification requests
|
|
337
|
+
${response.error.message}`
|
|
338
|
+
);
|
|
286
339
|
}
|
|
287
340
|
async deleteDomainVerificationRequest(domain, verificationCode) {
|
|
288
341
|
const response = await handleDeleteDomainVerification({
|
|
@@ -294,11 +347,10 @@ Message: ${response.error?.message}`
|
|
|
294
347
|
});
|
|
295
348
|
if (response.data) {
|
|
296
349
|
return response.data;
|
|
297
|
-
} else {
|
|
298
|
-
throw new Error(
|
|
299
|
-
`Failed to delete domain verification request for domain ${domain}: ${response.error.message}`
|
|
300
|
-
);
|
|
301
350
|
}
|
|
351
|
+
throw new Error(
|
|
352
|
+
`Failed to delete domain verification request for domain ${domain}: ${response.error.message}`
|
|
353
|
+
);
|
|
302
354
|
}
|
|
303
355
|
async listWebDeployments(limit, offset) {
|
|
304
356
|
const response = await handleListWebDeploys({
|
|
@@ -310,11 +362,11 @@ Message: ${response.error?.message}`
|
|
|
310
362
|
});
|
|
311
363
|
if (response.data) {
|
|
312
364
|
return response.data;
|
|
313
|
-
} else {
|
|
314
|
-
throw new Error(
|
|
315
|
-
"Failed to list web deployments\n" + response.error.message
|
|
316
|
-
);
|
|
317
365
|
}
|
|
366
|
+
throw new Error(
|
|
367
|
+
`Failed to list web deployments
|
|
368
|
+
${response.error.message}`
|
|
369
|
+
);
|
|
318
370
|
}
|
|
319
371
|
async listExecuteRuns(limit, offset) {
|
|
320
372
|
const response = await handleListExecuteRuns({
|
|
@@ -326,9 +378,9 @@ Message: ${response.error?.message}`
|
|
|
326
378
|
});
|
|
327
379
|
if (response.data) {
|
|
328
380
|
return response.data;
|
|
329
|
-
} else {
|
|
330
|
-
throw new Error("Failed to list execute runs\n" + response.error.message);
|
|
331
381
|
}
|
|
382
|
+
throw new Error(`Failed to list execute runs
|
|
383
|
+
${response.error.message}`);
|
|
332
384
|
}
|
|
333
385
|
async getExecuteRun(id) {
|
|
334
386
|
const response = await handleGetExecuteRun({
|
|
@@ -344,13 +396,28 @@ Message: ${response.error?.message}`
|
|
|
344
396
|
`Failed to get execute run with ID ${id}: ${response.error.message}`
|
|
345
397
|
);
|
|
346
398
|
}
|
|
399
|
+
/** Provision a wildcard certificate for domain. */
|
|
400
|
+
async provisionWildcard(domain) {
|
|
401
|
+
const response = await handleVerifyWildcard({
|
|
402
|
+
client: this.client,
|
|
403
|
+
path: {
|
|
404
|
+
domain
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
if (response.data) {
|
|
408
|
+
return response.data;
|
|
409
|
+
}
|
|
410
|
+
throw new Error(
|
|
411
|
+
`Failed to provision wildcard for domain ${domain}: ${response.error.message}`
|
|
412
|
+
);
|
|
413
|
+
}
|
|
347
414
|
/**
|
|
348
415
|
* Create a new git repository.
|
|
349
416
|
*
|
|
350
417
|
* @param name The name of the repository.
|
|
351
418
|
*/
|
|
352
419
|
async createGitRepository(name) {
|
|
353
|
-
const response = await
|
|
420
|
+
const response = await handleCreateRepo({
|
|
354
421
|
client: this.client,
|
|
355
422
|
body: {
|
|
356
423
|
name
|
|
@@ -370,7 +437,7 @@ Message: ${response.error?.message}`
|
|
|
370
437
|
* @param offset The offset to start at. Defaults to 0.
|
|
371
438
|
*/
|
|
372
439
|
async listGitRepositories(limit, offset) {
|
|
373
|
-
const response = await
|
|
440
|
+
const response = await handleListRepositories({
|
|
374
441
|
client: this.client,
|
|
375
442
|
query: {
|
|
376
443
|
limit: limit ?? 10,
|
|
@@ -388,7 +455,7 @@ Message: ${response.error?.message}`
|
|
|
388
455
|
* @param repositoryId The ID of the repository to delete.
|
|
389
456
|
*/
|
|
390
457
|
async deleteGitRepository(repositoryId) {
|
|
391
|
-
const response = await
|
|
458
|
+
const response = await handleDeleteRepo({
|
|
392
459
|
client: this.client,
|
|
393
460
|
path: {
|
|
394
461
|
repo: repositoryId
|
|
@@ -396,27 +463,211 @@ Message: ${response.error?.message}`
|
|
|
396
463
|
});
|
|
397
464
|
if (response.data) {
|
|
398
465
|
return response.data;
|
|
399
|
-
} else {
|
|
400
|
-
throw new Error(
|
|
401
|
-
`Failed to delete git repository ${repositoryId}: ${response.error}`
|
|
402
|
-
);
|
|
403
466
|
}
|
|
467
|
+
throw new Error(
|
|
468
|
+
`Failed to delete git repository ${repositoryId}: ${response.error}`
|
|
469
|
+
);
|
|
404
470
|
}
|
|
405
|
-
/**
|
|
406
|
-
|
|
407
|
-
|
|
471
|
+
/**
|
|
472
|
+
* Create a new git identity.
|
|
473
|
+
*/
|
|
474
|
+
async createGitIdentity() {
|
|
475
|
+
const response = await handleCreateIdentity({
|
|
476
|
+
client: this.client
|
|
477
|
+
});
|
|
478
|
+
if (response.data) {
|
|
479
|
+
return response.data;
|
|
480
|
+
}
|
|
481
|
+
throw new Error(`Failed to create git identity: ${response.error}`);
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Delete a git identity.
|
|
485
|
+
*
|
|
486
|
+
* @param identityId The ID of the identity to delete.
|
|
487
|
+
*/
|
|
488
|
+
async deleteGitIdentity(identityId) {
|
|
489
|
+
const response = await handleDeleteIdentity({
|
|
408
490
|
client: this.client,
|
|
409
491
|
path: {
|
|
410
|
-
|
|
492
|
+
identity: identityId
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
if (response.data) {
|
|
496
|
+
return response.data;
|
|
497
|
+
}
|
|
498
|
+
throw new Error(`Failed to delete git identity: ${response.error}`);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Grant a git identity access to a repository.
|
|
502
|
+
*
|
|
503
|
+
* @param repoId The ID of the repository to grant access to.
|
|
504
|
+
* @param identityId The ID of the identity grant access to `repoId`.
|
|
505
|
+
* @param permission The permission to grant.
|
|
506
|
+
*/
|
|
507
|
+
async grantGitPermission(repoId, identityId, permission) {
|
|
508
|
+
const response = await handleGrantPermission({
|
|
509
|
+
client: this.client,
|
|
510
|
+
path: {
|
|
511
|
+
repo: repoId,
|
|
512
|
+
identity: identityId
|
|
513
|
+
},
|
|
514
|
+
body: {
|
|
515
|
+
permission
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
if (response.data) {
|
|
519
|
+
return response.data;
|
|
520
|
+
}
|
|
521
|
+
throw new Error(
|
|
522
|
+
`Failed to grant access to git identity ${identityId} for repository ${repoId}: ${response.error}`
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Update a git identity's permissions on a repository.
|
|
527
|
+
*
|
|
528
|
+
* @param repoId The ID of the repository to update permissions for.
|
|
529
|
+
* @param identityId The ID of the identity to whose access to update.
|
|
530
|
+
* @param permission The permission to grant.
|
|
531
|
+
*/
|
|
532
|
+
async updateGitPermission(repoId, identityId, permission) {
|
|
533
|
+
const response = await handleUpdatePermission({
|
|
534
|
+
client: this.client,
|
|
535
|
+
path: {
|
|
536
|
+
repo: repoId,
|
|
537
|
+
identity: identityId
|
|
538
|
+
},
|
|
539
|
+
body: {
|
|
540
|
+
permission
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
if (response.data) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
throw new Error(
|
|
547
|
+
`Failed to update permission for git identity ${identityId} for repository ${repoId}: ${response.error}`
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Revoke a git identity's access to a repository.
|
|
552
|
+
*
|
|
553
|
+
* @param repoId The ID of the repository revoke access to.
|
|
554
|
+
* @param identityId The ID of the identity to revoke access from.
|
|
555
|
+
*/
|
|
556
|
+
async revokeGitPermission(repoId, identityId) {
|
|
557
|
+
const response = await handleRevokePermission({
|
|
558
|
+
client: this.client,
|
|
559
|
+
path: {
|
|
560
|
+
repo: repoId,
|
|
561
|
+
identity: identityId
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
if (response.data) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
throw new Error(
|
|
568
|
+
`Failed to revoke access to git identity ${identityId} for repository ${repoId}: ${response.error}`
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* List access permissions for a git identity.
|
|
573
|
+
*
|
|
574
|
+
* @param identityId The ID of the identity to list permissions for.
|
|
575
|
+
*/
|
|
576
|
+
async listGitPermissions(identityId) {
|
|
577
|
+
const response = await handleListPermissions({
|
|
578
|
+
client: this.client,
|
|
579
|
+
path: {
|
|
580
|
+
identity: identityId
|
|
411
581
|
}
|
|
412
582
|
});
|
|
413
583
|
if (response.data) {
|
|
414
584
|
return response.data;
|
|
415
|
-
} else {
|
|
416
|
-
throw new Error(
|
|
417
|
-
`Failed to provision wildcard for domain ${domain}: ${response.error.message}`
|
|
418
|
-
);
|
|
419
585
|
}
|
|
586
|
+
throw new Error(
|
|
587
|
+
`Failed to list permissions for git identity ${identityId}: ${response.error}`
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Get the permission of a git identity on a repository.
|
|
592
|
+
*
|
|
593
|
+
* @param repoId The ID of the repository to check permissions for.
|
|
594
|
+
* @param identityId The ID of the identity to check permissions for.
|
|
595
|
+
*/
|
|
596
|
+
async getGitPermission(repoId, identityId) {
|
|
597
|
+
const response = await handleDescribePermission({
|
|
598
|
+
client: this.client,
|
|
599
|
+
path: {
|
|
600
|
+
repo: repoId,
|
|
601
|
+
identity: identityId
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
if (response.data) {
|
|
605
|
+
return response.data;
|
|
606
|
+
}
|
|
607
|
+
throw new Error(
|
|
608
|
+
`Failed to get permission for git identity ${identityId} on repository ${repoId}: ${response.error}`
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Create a new git access token for an identity.
|
|
613
|
+
*
|
|
614
|
+
* @param identityId The ID of the identity to create the token for.
|
|
615
|
+
*/
|
|
616
|
+
async createGitAccessToken(identityId) {
|
|
617
|
+
const response = await handleCreateGitToken({
|
|
618
|
+
client: this.client,
|
|
619
|
+
path: {
|
|
620
|
+
identity: identityId
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
if (response.data) {
|
|
624
|
+
return response.data;
|
|
625
|
+
}
|
|
626
|
+
throw new Error(
|
|
627
|
+
`Failed to create git access token: ${response.error.message}`
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Revoke a git access token.
|
|
632
|
+
*
|
|
633
|
+
* @param identityId The ID of the identity the token belongs to.
|
|
634
|
+
* @param tokenId The ID of the token to revoke.
|
|
635
|
+
*/
|
|
636
|
+
async revokeGitAccessToken(identityId, tokenId) {
|
|
637
|
+
const response = await handleRevokeGitToken({
|
|
638
|
+
client: this.client,
|
|
639
|
+
body: {
|
|
640
|
+
tokenId
|
|
641
|
+
},
|
|
642
|
+
path: {
|
|
643
|
+
identity: identityId
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
if (response.data) {
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
throw new Error(
|
|
650
|
+
`Failed to revoke git access token ${tokenId}: ${response.error.message}`
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* List git access tokens for an identity.
|
|
655
|
+
*
|
|
656
|
+
* @param identityId The ID of the identity to list tokens for.
|
|
657
|
+
*/
|
|
658
|
+
async listGitAccessTokens(identityId) {
|
|
659
|
+
const response = await handleListGitTokens({
|
|
660
|
+
client: this.client,
|
|
661
|
+
path: {
|
|
662
|
+
identity: identityId
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
if (response.data) {
|
|
666
|
+
return response.data;
|
|
667
|
+
}
|
|
668
|
+
throw new Error(
|
|
669
|
+
`Failed to list git access tokens: ${response.error.message}`
|
|
670
|
+
);
|
|
420
671
|
}
|
|
421
672
|
}
|
|
422
673
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, b as FreestyleDeployWebConfiguration, c as FreestyleDeployWebSuccessResponse, d as FreestyleCloudstateDeployRequest, e as FreestyleCloudstateDeploySuccessResponse, H as HandleBackupCloudstateResponse, f as HandleGetLogsResponse, g as HandleCreateDomainVerificationResponse, h as HandleVerifyDomainResponse, i as HandleVerifyDomainError, j as HandleListDomainsResponse, k as HandleListDomainVerificationRequestsResponse, l as HandleDeleteDomainVerificationResponse, m as HandleListWebDeploysResponse, n as HandleListExecuteRunsResponse, o as HandleGetExecuteRunResponse, C as
|
|
2
|
-
export { B as Behavior,
|
|
1
|
+
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, b as FreestyleDeployWebConfiguration, c as FreestyleDeployWebSuccessResponse, d as FreestyleCloudstateDeployRequest, e as FreestyleCloudstateDeploySuccessResponse, H as HandleBackupCloudstateResponse, f as HandleGetLogsResponse, g as HandleCreateDomainVerificationResponse, h as HandleVerifyDomainResponse, i as HandleVerifyDomainError, j as HandleListDomainsResponse, k as HandleListDomainVerificationRequestsResponse, l as HandleDeleteDomainVerificationResponse, m as HandleListWebDeploysResponse, n as HandleListExecuteRunsResponse, o as HandleGetExecuteRunResponse, p as HandleVerifyWildcardResponse, C as CreateRepositoryResponseSuccess, q as HandleListRepositoriesResponse, r as HandleDeleteRepoResponse, G as GitIdentity, s as HandleDeleteIdentityResponse, A as AccessLevel, t as HandleGrantPermissionResponse, L as ListPermissionResponseSuccess, D as DescribePermissionResponseSuccess, u as CreatedToken, v as ListGitTokensResponseSuccess } from './types.gen-BzRtj_TA.js';
|
|
2
|
+
export { x as AccessTokenInfo, w as AccessibleRepository, B as Behavior, y as CreateDomainMappingRequest, z as CreateRepositoryRequest, E as DeploymentLogEntry, I as DeploymentState, J as DnsRecord, K as DnsRecordKind, M as DomainVerificationRequest, N as ExecuteLogEntry, O as ExecuteRunInfo, P as ExecuteRunState, Q as FreestyleCloudstateDeployConfiguration, R as FreestyleCloudstateDeployErrorResponse, S as FreestyleDeleteDomainVerificationRequest, T as FreestyleDeployWebErrorResponse, U as FreestyleDeployWebPayload, V as FreestyleDomainVerificationRequest, W as FreestyleExecuteScriptParams, X as FreestyleFile, Y as FreestyleGetLogsResponse, Z as FreestyleJavaScriptLog, _ as FreestyleLogResponseObject, $ as FreestyleNetworkPermission, a1 as FreestyleVerifyDomainRequest, a2 as GitRepositoryTrigger, a5 as GitTrigger, a6 as GitTriggerAction, a7 as GrantPermissionRequest, ah as HandleBackupCloudstateData, ai as HandleBackupCloudstateError, aD as HandleCreateDomainVerificationData, aE as HandleCreateDomainVerificationError, b7 as HandleCreateGitTokenData, b9 as HandleCreateGitTokenError, b8 as HandleCreateGitTokenResponse, bn as HandleCreateGitTriggerData, bp as HandleCreateGitTriggerError, bo as HandleCreateGitTriggerResponse, aP as HandleCreateIdentityError, aO as HandleCreateIdentityResponse, am as HandleCreateRecordData, ao as HandleCreateRecordError, an as HandleCreateRecordResponse, bf as HandleCreateRepoData, bh as HandleCreateRepoError, bg as HandleCreateRepoResponse, ay as HandleDeleteDomainMappingData, aA as HandleDeleteDomainMappingError, az as HandleDeleteDomainMappingResponse, aF as HandleDeleteDomainVerificationData, aG as HandleDeleteDomainVerificationError, bq as HandleDeleteGitTriggerData, bs as HandleDeleteGitTriggerError, br as HandleDeleteGitTriggerResponse, aQ as HandleDeleteIdentityData, aR as HandleDeleteIdentityError, ap as HandleDeleteRecordData, ar as HandleDeleteRecordError, aq as HandleDeleteRecordResponse, bi as HandleDeleteRepoData, bj as HandleDeleteRepoError, ae as HandleDeployCloudstateData, ag as HandleDeployCloudstateError, af as HandleDeployCloudstateResponse, bv as HandleDeployWebData, bx as HandleDeployWebError, bw as HandleDeployWebResponse, aV as HandleDescribePermissionData, aX as HandleDescribePermissionError, aW as HandleDescribePermissionResponse, aL as HandleExecuteScriptData, aN as HandleExecuteScriptError, aM as HandleExecuteScriptResponse, aJ as HandleGetExecuteRunData, aK as HandleGetExecuteRunError, bt as HandleGetLogsData, bu as HandleGetLogsError, bA as HandleGetWebDeployDetailsData, aY as HandleGrantPermissionData, aZ as HandleGrantPermissionError, av as HandleInsertDomainMappingData, ax as HandleInsertDomainMappingError, aw as HandleInsertDomainMappingResponse, aB as HandleListDomainVerificationRequestsError, au as HandleListDomainsError, aH as HandleListExecuteRunsData, aI as HandleListExecuteRunsError, b4 as HandleListGitTokensData, b6 as HandleListGitTokensError, b5 as HandleListGitTokensResponse, bk as HandleListGitTriggersData, bm as HandleListGitTriggersError, bl as HandleListGitTriggersResponse, aS as HandleListPermissionsData, aU as HandleListPermissionsError, aT as HandleListPermissionsResponse, aj as HandleListRecordsData, al as HandleListRecordsError, ak as HandleListRecordsResponse, bd as HandleListRepositoriesData, be as HandleListRepositoriesError, by as HandleListWebDeploysData, bz as HandleListWebDeploysError, ba as HandleRevokeGitTokenData, bc as HandleRevokeGitTokenError, bb as HandleRevokeGitTokenResponse, a_ as HandleRevokePermissionData, b0 as HandleRevokePermissionError, a$ as HandleRevokePermissionResponse, b1 as HandleUpdatePermissionData, b3 as HandleUpdatePermissionError, b2 as HandleUpdatePermissionResponse, aC as HandleVerifyDomainData, as as HandleVerifyWildcardData, at as HandleVerifyWildcardError, a8 as ListRecordsResponse, a9 as NetworkPermissionData, aa as RepositoryInfo, ab as RevokeGitTokenRequest, ac as UpdatePermissionRequest, ad as Visibility, a0 as action, a4 as action2, a3 as event } from './types.gen-BzRtj_TA.js';
|
|
3
3
|
|
|
4
4
|
declare class FreestyleSandboxes {
|
|
5
5
|
private client;
|
|
@@ -64,27 +64,92 @@ declare class FreestyleSandboxes {
|
|
|
64
64
|
listWebDeployments(limit?: number, offset?: number): Promise<HandleListWebDeploysResponse>;
|
|
65
65
|
listExecuteRuns(limit?: number, offset?: number): Promise<HandleListExecuteRunsResponse>;
|
|
66
66
|
getExecuteRun(id: string): Promise<HandleGetExecuteRunResponse>;
|
|
67
|
+
/** Provision a wildcard certificate for domain. */
|
|
68
|
+
provisionWildcard(domain: string): Promise<HandleVerifyWildcardResponse>;
|
|
67
69
|
/**
|
|
68
70
|
* Create a new git repository.
|
|
69
71
|
*
|
|
70
72
|
* @param name The name of the repository.
|
|
71
73
|
*/
|
|
72
|
-
createGitRepository(name: string): Promise<
|
|
74
|
+
createGitRepository(name: string): Promise<CreateRepositoryResponseSuccess>;
|
|
73
75
|
/**
|
|
74
76
|
* List git repositories.
|
|
75
77
|
*
|
|
76
78
|
* @param limit The maximum number of repositories to return. Defaults to 10.
|
|
77
79
|
* @param offset The offset to start at. Defaults to 0.
|
|
78
80
|
*/
|
|
79
|
-
listGitRepositories(limit?: number, offset?: number): Promise<
|
|
81
|
+
listGitRepositories(limit?: number, offset?: number): Promise<HandleListRepositoriesResponse>;
|
|
80
82
|
/**
|
|
81
83
|
* Delete a git repository.
|
|
82
84
|
*
|
|
83
85
|
* @param repositoryId The ID of the repository to delete.
|
|
84
86
|
*/
|
|
85
|
-
deleteGitRepository(repositoryId: string): Promise<
|
|
86
|
-
/**
|
|
87
|
-
|
|
87
|
+
deleteGitRepository(repositoryId: string): Promise<HandleDeleteRepoResponse>;
|
|
88
|
+
/**
|
|
89
|
+
* Create a new git identity.
|
|
90
|
+
*/
|
|
91
|
+
createGitIdentity(): Promise<GitIdentity>;
|
|
92
|
+
/**
|
|
93
|
+
* Delete a git identity.
|
|
94
|
+
*
|
|
95
|
+
* @param identityId The ID of the identity to delete.
|
|
96
|
+
*/
|
|
97
|
+
deleteGitIdentity(identityId: string): Promise<HandleDeleteIdentityResponse>;
|
|
98
|
+
/**
|
|
99
|
+
* Grant a git identity access to a repository.
|
|
100
|
+
*
|
|
101
|
+
* @param repoId The ID of the repository to grant access to.
|
|
102
|
+
* @param identityId The ID of the identity grant access to `repoId`.
|
|
103
|
+
* @param permission The permission to grant.
|
|
104
|
+
*/
|
|
105
|
+
grantGitPermission(repoId: string, identityId: string, permission: AccessLevel): Promise<HandleGrantPermissionResponse>;
|
|
106
|
+
/**
|
|
107
|
+
* Update a git identity's permissions on a repository.
|
|
108
|
+
*
|
|
109
|
+
* @param repoId The ID of the repository to update permissions for.
|
|
110
|
+
* @param identityId The ID of the identity to whose access to update.
|
|
111
|
+
* @param permission The permission to grant.
|
|
112
|
+
*/
|
|
113
|
+
updateGitPermission(repoId: string, identityId: string, permission: AccessLevel): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Revoke a git identity's access to a repository.
|
|
116
|
+
*
|
|
117
|
+
* @param repoId The ID of the repository revoke access to.
|
|
118
|
+
* @param identityId The ID of the identity to revoke access from.
|
|
119
|
+
*/
|
|
120
|
+
revokeGitPermission(repoId: string, identityId: string): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* List access permissions for a git identity.
|
|
123
|
+
*
|
|
124
|
+
* @param identityId The ID of the identity to list permissions for.
|
|
125
|
+
*/
|
|
126
|
+
listGitPermissions(identityId: string): Promise<ListPermissionResponseSuccess>;
|
|
127
|
+
/**
|
|
128
|
+
* Get the permission of a git identity on a repository.
|
|
129
|
+
*
|
|
130
|
+
* @param repoId The ID of the repository to check permissions for.
|
|
131
|
+
* @param identityId The ID of the identity to check permissions for.
|
|
132
|
+
*/
|
|
133
|
+
getGitPermission(repoId: string, identityId: string): Promise<DescribePermissionResponseSuccess>;
|
|
134
|
+
/**
|
|
135
|
+
* Create a new git access token for an identity.
|
|
136
|
+
*
|
|
137
|
+
* @param identityId The ID of the identity to create the token for.
|
|
138
|
+
*/
|
|
139
|
+
createGitAccessToken(identityId: string): Promise<CreatedToken>;
|
|
140
|
+
/**
|
|
141
|
+
* Revoke a git access token.
|
|
142
|
+
*
|
|
143
|
+
* @param identityId The ID of the identity the token belongs to.
|
|
144
|
+
* @param tokenId The ID of the token to revoke.
|
|
145
|
+
*/
|
|
146
|
+
revokeGitAccessToken(identityId: string, tokenId: string): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* List git access tokens for an identity.
|
|
149
|
+
*
|
|
150
|
+
* @param identityId The ID of the identity to list tokens for.
|
|
151
|
+
*/
|
|
152
|
+
listGitAccessTokens(identityId: string): Promise<ListGitTokensResponseSuccess>;
|
|
88
153
|
}
|
|
89
154
|
|
|
90
|
-
export {
|
|
155
|
+
export { AccessLevel, CreateRepositoryResponseSuccess, CreatedToken, DescribePermissionResponseSuccess, FreestyleCloudstateDeployRequest, FreestyleCloudstateDeploySuccessResponse, FreestyleDeployWebConfiguration, FreestyleDeployWebSuccessResponse, FreestyleExecuteScriptParamsConfiguration, FreestyleExecuteScriptResultSuccess, FreestyleSandboxes, GitIdentity, HandleBackupCloudstateResponse, HandleCreateDomainVerificationResponse, HandleDeleteDomainVerificationResponse, HandleDeleteIdentityResponse, HandleDeleteRepoResponse, HandleGetExecuteRunResponse, HandleGetLogsResponse, HandleGrantPermissionResponse, HandleListDomainVerificationRequestsResponse, HandleListDomainsResponse, HandleListExecuteRunsResponse, HandleListRepositoriesResponse, HandleListWebDeploysResponse, HandleVerifyDomainError, HandleVerifyDomainResponse, HandleVerifyWildcardResponse, ListGitTokensResponseSuccess, ListPermissionResponseSuccess };
|