freestyle-sandboxes 0.0.26 → 0.0.28
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 +321 -58
- package/dist/index.d.cts +73 -8
- package/dist/index.d.mts +73 -8
- package/dist/index.mjs +321 -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.d.cts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/openapi/sdk.gen.ts +203 -9
- package/openapi/types.gen.ts +440 -20
- package/openapi.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +400 -80
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}"
|
|
@@ -109,6 +169,18 @@ const handleListWebDeploys = (options) => {
|
|
|
109
169
|
class FreestyleSandboxes {
|
|
110
170
|
client;
|
|
111
171
|
constructor(options) {
|
|
172
|
+
if (typeof Deno !== "undefined") {
|
|
173
|
+
class FreestyleRequest extends Request {
|
|
174
|
+
constructor(input, init) {
|
|
175
|
+
if (init.client !== void 0) {
|
|
176
|
+
console.warn("Unsupported client detected, using default client");
|
|
177
|
+
delete init.client;
|
|
178
|
+
}
|
|
179
|
+
super(input, init);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
Request = FreestyleRequest;
|
|
183
|
+
}
|
|
112
184
|
this.client = clientFetch.createClient({
|
|
113
185
|
baseUrl: options.baseUrl ?? "https://api.freestyle.sh",
|
|
114
186
|
headers: {
|
|
@@ -130,19 +202,18 @@ class FreestyleSandboxes {
|
|
|
130
202
|
});
|
|
131
203
|
if (response.data) {
|
|
132
204
|
return response.data;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
205
|
+
}
|
|
206
|
+
throw new Error(
|
|
207
|
+
`Failed to execute script:
|
|
136
208
|
|
|
137
209
|
${script}
|
|
138
210
|
|
|
139
211
|
Error:
|
|
140
212
|
|
|
141
213
|
${JSON.stringify(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
214
|
+
response
|
|
215
|
+
)}`
|
|
216
|
+
);
|
|
146
217
|
}
|
|
147
218
|
/**
|
|
148
219
|
* Deploy a Web project to a sandbox.
|
|
@@ -157,15 +228,14 @@ ${JSON.stringify(
|
|
|
157
228
|
});
|
|
158
229
|
if (response.data) {
|
|
159
230
|
return response.data;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
231
|
+
}
|
|
232
|
+
throw new Error(
|
|
233
|
+
`Failed to deploy web project
|
|
163
234
|
|
|
164
235
|
Status: ${response.response.status}
|
|
165
236
|
|
|
166
237
|
Message: ${response.error?.message}`
|
|
167
|
-
|
|
168
|
-
}
|
|
238
|
+
);
|
|
169
239
|
}
|
|
170
240
|
/**
|
|
171
241
|
* Deploy a Cloudstate project to a sandbox.
|
|
@@ -177,9 +247,8 @@ Message: ${response.error?.message}`
|
|
|
177
247
|
});
|
|
178
248
|
if (response.data) {
|
|
179
249
|
return response.data;
|
|
180
|
-
} else {
|
|
181
|
-
throw new Error("Failed to deploy Cloudstate project");
|
|
182
250
|
}
|
|
251
|
+
throw new Error("Failed to deploy Cloudstate project");
|
|
183
252
|
}
|
|
184
253
|
/**
|
|
185
254
|
* Get a backup of a Cloudstate project in a sandbox.
|
|
@@ -196,9 +265,8 @@ Message: ${response.error?.message}`
|
|
|
196
265
|
});
|
|
197
266
|
if (response.data) {
|
|
198
267
|
return response.data;
|
|
199
|
-
} else {
|
|
200
|
-
throw new Error("Failed to get backup of Cloudstate project");
|
|
201
268
|
}
|
|
269
|
+
throw new Error("Failed to get backup of Cloudstate project");
|
|
202
270
|
}
|
|
203
271
|
/**
|
|
204
272
|
* Get logs for an execute run, or web deployment.
|
|
@@ -218,9 +286,8 @@ Message: ${response.error?.message}`
|
|
|
218
286
|
});
|
|
219
287
|
if (response.data) {
|
|
220
288
|
return response.data;
|
|
221
|
-
} else {
|
|
222
|
-
throw new Error("Failed to get logs for sandbox");
|
|
223
289
|
}
|
|
290
|
+
throw new Error("Failed to get logs for sandbox");
|
|
224
291
|
}
|
|
225
292
|
/**
|
|
226
293
|
* Create a a domain verification request.
|
|
@@ -236,9 +303,8 @@ Message: ${response.error?.message}`
|
|
|
236
303
|
});
|
|
237
304
|
if (response.data) {
|
|
238
305
|
return response.data;
|
|
239
|
-
} else {
|
|
240
|
-
throw new Error(response.error.message);
|
|
241
306
|
}
|
|
307
|
+
throw new Error(response.error.message);
|
|
242
308
|
}
|
|
243
309
|
/**
|
|
244
310
|
* Verify a domain. Note, this requires the domain verification token to be already set up.
|
|
@@ -254,11 +320,10 @@ Message: ${response.error?.message}`
|
|
|
254
320
|
});
|
|
255
321
|
if (response.data) {
|
|
256
322
|
return response.data;
|
|
257
|
-
} else {
|
|
258
|
-
throw new Error(
|
|
259
|
-
`Failed to verify domain ${domain}: ${response.error.message}`
|
|
260
|
-
);
|
|
261
323
|
}
|
|
324
|
+
throw new Error(
|
|
325
|
+
`Failed to verify domain ${domain}: ${response.error.message}`
|
|
326
|
+
);
|
|
262
327
|
}
|
|
263
328
|
async listDomains() {
|
|
264
329
|
const response = await handleListDomains({
|
|
@@ -266,9 +331,9 @@ Message: ${response.error?.message}`
|
|
|
266
331
|
});
|
|
267
332
|
if (response.data) {
|
|
268
333
|
return response.data;
|
|
269
|
-
} else {
|
|
270
|
-
throw new Error("Failed to list domains\n" + response.error.message);
|
|
271
334
|
}
|
|
335
|
+
throw new Error(`Failed to list domains
|
|
336
|
+
${response.error.message}`);
|
|
272
337
|
}
|
|
273
338
|
async listDomainVerificationRequests() {
|
|
274
339
|
const response = await handleListDomainVerificationRequests(
|
|
@@ -278,11 +343,11 @@ Message: ${response.error?.message}`
|
|
|
278
343
|
);
|
|
279
344
|
if (response.data) {
|
|
280
345
|
return response.data;
|
|
281
|
-
} else {
|
|
282
|
-
throw new Error(
|
|
283
|
-
"Failed to list domain verification requests\n" + response.error.message
|
|
284
|
-
);
|
|
285
346
|
}
|
|
347
|
+
throw new Error(
|
|
348
|
+
`Failed to list domain verification requests
|
|
349
|
+
${response.error.message}`
|
|
350
|
+
);
|
|
286
351
|
}
|
|
287
352
|
async deleteDomainVerificationRequest(domain, verificationCode) {
|
|
288
353
|
const response = await handleDeleteDomainVerification({
|
|
@@ -294,11 +359,10 @@ Message: ${response.error?.message}`
|
|
|
294
359
|
});
|
|
295
360
|
if (response.data) {
|
|
296
361
|
return response.data;
|
|
297
|
-
} else {
|
|
298
|
-
throw new Error(
|
|
299
|
-
`Failed to delete domain verification request for domain ${domain}: ${response.error.message}`
|
|
300
|
-
);
|
|
301
362
|
}
|
|
363
|
+
throw new Error(
|
|
364
|
+
`Failed to delete domain verification request for domain ${domain}: ${response.error.message}`
|
|
365
|
+
);
|
|
302
366
|
}
|
|
303
367
|
async listWebDeployments(limit, offset) {
|
|
304
368
|
const response = await handleListWebDeploys({
|
|
@@ -310,11 +374,11 @@ Message: ${response.error?.message}`
|
|
|
310
374
|
});
|
|
311
375
|
if (response.data) {
|
|
312
376
|
return response.data;
|
|
313
|
-
} else {
|
|
314
|
-
throw new Error(
|
|
315
|
-
"Failed to list web deployments\n" + response.error.message
|
|
316
|
-
);
|
|
317
377
|
}
|
|
378
|
+
throw new Error(
|
|
379
|
+
`Failed to list web deployments
|
|
380
|
+
${response.error.message}`
|
|
381
|
+
);
|
|
318
382
|
}
|
|
319
383
|
async listExecuteRuns(limit, offset) {
|
|
320
384
|
const response = await handleListExecuteRuns({
|
|
@@ -326,9 +390,9 @@ Message: ${response.error?.message}`
|
|
|
326
390
|
});
|
|
327
391
|
if (response.data) {
|
|
328
392
|
return response.data;
|
|
329
|
-
} else {
|
|
330
|
-
throw new Error("Failed to list execute runs\n" + response.error.message);
|
|
331
393
|
}
|
|
394
|
+
throw new Error(`Failed to list execute runs
|
|
395
|
+
${response.error.message}`);
|
|
332
396
|
}
|
|
333
397
|
async getExecuteRun(id) {
|
|
334
398
|
const response = await handleGetExecuteRun({
|
|
@@ -344,13 +408,28 @@ Message: ${response.error?.message}`
|
|
|
344
408
|
`Failed to get execute run with ID ${id}: ${response.error.message}`
|
|
345
409
|
);
|
|
346
410
|
}
|
|
411
|
+
/** Provision a wildcard certificate for domain. */
|
|
412
|
+
async provisionWildcard(domain) {
|
|
413
|
+
const response = await handleVerifyWildcard({
|
|
414
|
+
client: this.client,
|
|
415
|
+
path: {
|
|
416
|
+
domain
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
if (response.data) {
|
|
420
|
+
return response.data;
|
|
421
|
+
}
|
|
422
|
+
throw new Error(
|
|
423
|
+
`Failed to provision wildcard for domain ${domain}: ${response.error.message}`
|
|
424
|
+
);
|
|
425
|
+
}
|
|
347
426
|
/**
|
|
348
427
|
* Create a new git repository.
|
|
349
428
|
*
|
|
350
429
|
* @param name The name of the repository.
|
|
351
430
|
*/
|
|
352
431
|
async createGitRepository(name) {
|
|
353
|
-
const response = await
|
|
432
|
+
const response = await handleCreateRepo({
|
|
354
433
|
client: this.client,
|
|
355
434
|
body: {
|
|
356
435
|
name
|
|
@@ -370,7 +449,7 @@ Message: ${response.error?.message}`
|
|
|
370
449
|
* @param offset The offset to start at. Defaults to 0.
|
|
371
450
|
*/
|
|
372
451
|
async listGitRepositories(limit, offset) {
|
|
373
|
-
const response = await
|
|
452
|
+
const response = await handleListRepositories({
|
|
374
453
|
client: this.client,
|
|
375
454
|
query: {
|
|
376
455
|
limit: limit ?? 10,
|
|
@@ -388,7 +467,7 @@ Message: ${response.error?.message}`
|
|
|
388
467
|
* @param repositoryId The ID of the repository to delete.
|
|
389
468
|
*/
|
|
390
469
|
async deleteGitRepository(repositoryId) {
|
|
391
|
-
const response = await
|
|
470
|
+
const response = await handleDeleteRepo({
|
|
392
471
|
client: this.client,
|
|
393
472
|
path: {
|
|
394
473
|
repo: repositoryId
|
|
@@ -396,27 +475,211 @@ Message: ${response.error?.message}`
|
|
|
396
475
|
});
|
|
397
476
|
if (response.data) {
|
|
398
477
|
return response.data;
|
|
399
|
-
} else {
|
|
400
|
-
throw new Error(
|
|
401
|
-
`Failed to delete git repository ${repositoryId}: ${response.error}`
|
|
402
|
-
);
|
|
403
478
|
}
|
|
479
|
+
throw new Error(
|
|
480
|
+
`Failed to delete git repository ${repositoryId}: ${response.error}`
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Create a new git identity.
|
|
485
|
+
*/
|
|
486
|
+
async createGitIdentity() {
|
|
487
|
+
const response = await handleCreateIdentity({
|
|
488
|
+
client: this.client
|
|
489
|
+
});
|
|
490
|
+
if (response.data) {
|
|
491
|
+
return response.data;
|
|
492
|
+
}
|
|
493
|
+
throw new Error(`Failed to create git identity: ${response.error}`);
|
|
404
494
|
}
|
|
405
|
-
/**
|
|
406
|
-
|
|
407
|
-
|
|
495
|
+
/**
|
|
496
|
+
* Delete a git identity.
|
|
497
|
+
*
|
|
498
|
+
* @param identityId The ID of the identity to delete.
|
|
499
|
+
*/
|
|
500
|
+
async deleteGitIdentity(identityId) {
|
|
501
|
+
const response = await handleDeleteIdentity({
|
|
408
502
|
client: this.client,
|
|
409
503
|
path: {
|
|
410
|
-
|
|
504
|
+
identity: identityId
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
if (response.data) {
|
|
508
|
+
return response.data;
|
|
509
|
+
}
|
|
510
|
+
throw new Error(`Failed to delete git identity: ${response.error}`);
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Grant a git identity access to a repository.
|
|
514
|
+
*
|
|
515
|
+
* @param repoId The ID of the repository to grant access to.
|
|
516
|
+
* @param identityId The ID of the identity grant access to `repoId`.
|
|
517
|
+
* @param permission The permission to grant.
|
|
518
|
+
*/
|
|
519
|
+
async grantGitPermission(repoId, identityId, permission) {
|
|
520
|
+
const response = await handleGrantPermission({
|
|
521
|
+
client: this.client,
|
|
522
|
+
path: {
|
|
523
|
+
repo: repoId,
|
|
524
|
+
identity: identityId
|
|
525
|
+
},
|
|
526
|
+
body: {
|
|
527
|
+
permission
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
if (response.data) {
|
|
531
|
+
return response.data;
|
|
532
|
+
}
|
|
533
|
+
throw new Error(
|
|
534
|
+
`Failed to grant access to git identity ${identityId} for repository ${repoId}: ${response.error}`
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Update a git identity's permissions on a repository.
|
|
539
|
+
*
|
|
540
|
+
* @param repoId The ID of the repository to update permissions for.
|
|
541
|
+
* @param identityId The ID of the identity to whose access to update.
|
|
542
|
+
* @param permission The permission to grant.
|
|
543
|
+
*/
|
|
544
|
+
async updateGitPermission(repoId, identityId, permission) {
|
|
545
|
+
const response = await handleUpdatePermission({
|
|
546
|
+
client: this.client,
|
|
547
|
+
path: {
|
|
548
|
+
repo: repoId,
|
|
549
|
+
identity: identityId
|
|
550
|
+
},
|
|
551
|
+
body: {
|
|
552
|
+
permission
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
if (response.data) {
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
throw new Error(
|
|
559
|
+
`Failed to update permission for git identity ${identityId} for repository ${repoId}: ${response.error}`
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Revoke a git identity's access to a repository.
|
|
564
|
+
*
|
|
565
|
+
* @param repoId The ID of the repository revoke access to.
|
|
566
|
+
* @param identityId The ID of the identity to revoke access from.
|
|
567
|
+
*/
|
|
568
|
+
async revokeGitPermission(repoId, identityId) {
|
|
569
|
+
const response = await handleRevokePermission({
|
|
570
|
+
client: this.client,
|
|
571
|
+
path: {
|
|
572
|
+
repo: repoId,
|
|
573
|
+
identity: identityId
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
if (response.data) {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
throw new Error(
|
|
580
|
+
`Failed to revoke access to git identity ${identityId} for repository ${repoId}: ${response.error}`
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* List access permissions for a git identity.
|
|
585
|
+
*
|
|
586
|
+
* @param identityId The ID of the identity to list permissions for.
|
|
587
|
+
*/
|
|
588
|
+
async listGitPermissions(identityId) {
|
|
589
|
+
const response = await handleListPermissions({
|
|
590
|
+
client: this.client,
|
|
591
|
+
path: {
|
|
592
|
+
identity: identityId
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
if (response.data) {
|
|
596
|
+
return response.data;
|
|
597
|
+
}
|
|
598
|
+
throw new Error(
|
|
599
|
+
`Failed to list permissions for git identity ${identityId}: ${response.error}`
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Get the permission of a git identity on a repository.
|
|
604
|
+
*
|
|
605
|
+
* @param repoId The ID of the repository to check permissions for.
|
|
606
|
+
* @param identityId The ID of the identity to check permissions for.
|
|
607
|
+
*/
|
|
608
|
+
async getGitPermission(repoId, identityId) {
|
|
609
|
+
const response = await handleDescribePermission({
|
|
610
|
+
client: this.client,
|
|
611
|
+
path: {
|
|
612
|
+
repo: repoId,
|
|
613
|
+
identity: identityId
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
if (response.data) {
|
|
617
|
+
return response.data;
|
|
618
|
+
}
|
|
619
|
+
throw new Error(
|
|
620
|
+
`Failed to get permission for git identity ${identityId} on repository ${repoId}: ${response.error}`
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Create a new git access token for an identity.
|
|
625
|
+
*
|
|
626
|
+
* @param identityId The ID of the identity to create the token for.
|
|
627
|
+
*/
|
|
628
|
+
async createGitAccessToken(identityId) {
|
|
629
|
+
const response = await handleCreateGitToken({
|
|
630
|
+
client: this.client,
|
|
631
|
+
path: {
|
|
632
|
+
identity: identityId
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
if (response.data) {
|
|
636
|
+
return response.data;
|
|
637
|
+
}
|
|
638
|
+
throw new Error(
|
|
639
|
+
`Failed to create git access token: ${response.error.message}`
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Revoke a git access token.
|
|
644
|
+
*
|
|
645
|
+
* @param identityId The ID of the identity the token belongs to.
|
|
646
|
+
* @param tokenId The ID of the token to revoke.
|
|
647
|
+
*/
|
|
648
|
+
async revokeGitAccessToken(identityId, tokenId) {
|
|
649
|
+
const response = await handleRevokeGitToken({
|
|
650
|
+
client: this.client,
|
|
651
|
+
body: {
|
|
652
|
+
tokenId
|
|
653
|
+
},
|
|
654
|
+
path: {
|
|
655
|
+
identity: identityId
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
if (response.data) {
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
throw new Error(
|
|
662
|
+
`Failed to revoke git access token ${tokenId}: ${response.error.message}`
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* List git access tokens for an identity.
|
|
667
|
+
*
|
|
668
|
+
* @param identityId The ID of the identity to list tokens for.
|
|
669
|
+
*/
|
|
670
|
+
async listGitAccessTokens(identityId) {
|
|
671
|
+
const response = await handleListGitTokens({
|
|
672
|
+
client: this.client,
|
|
673
|
+
path: {
|
|
674
|
+
identity: identityId
|
|
411
675
|
}
|
|
412
676
|
});
|
|
413
677
|
if (response.data) {
|
|
414
678
|
return response.data;
|
|
415
|
-
} else {
|
|
416
|
-
throw new Error(
|
|
417
|
-
`Failed to provision wildcard for domain ${domain}: ${response.error.message}`
|
|
418
|
-
);
|
|
419
679
|
}
|
|
680
|
+
throw new Error(
|
|
681
|
+
`Failed to list git access tokens: ${response.error.message}`
|
|
682
|
+
);
|
|
420
683
|
}
|
|
421
684
|
}
|
|
422
685
|
|
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 };
|