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