@cargo-ai/api 1.0.22 → 1.0.24
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/README.md +4 -0
- package/build/src/api/connection/index.d.ts +8 -0
- package/build/src/api/connection/index.d.ts.map +1 -1
- package/build/src/api/connection/index.js +96 -0
- package/build/src/api/context/index.d.ts +9 -7
- package/build/src/api/context/index.d.ts.map +1 -1
- package/build/src/api/context/index.js +43 -35
- package/build/src/api/hosting/index.d.ts +47 -0
- package/build/src/api/hosting/index.d.ts.map +1 -0
- package/build/src/api/hosting/index.js +225 -0
- package/build/src/api/index.d.ts +13 -1
- package/build/src/api/index.d.ts.map +1 -1
- package/build/src/api/index.js +5 -1
- package/build/src/api/orchestration/index.d.ts +8 -3
- package/build/src/api/orchestration/index.d.ts.map +1 -1
- package/build/src/api/orchestration/index.js +42 -7
- package/build/src/api/storage/index.d.ts +4 -0
- package/build/src/api/storage/index.d.ts.map +1 -1
- package/build/src/api/storage/index.js +87 -0
- package/build/src/domains/connection.d.ts +61 -0
- package/build/src/domains/connection.d.ts.map +1 -1
- package/build/src/domains/connection.js +27 -0
- package/build/src/domains/context.d.ts +67 -26
- package/build/src/domains/context.d.ts.map +1 -1
- package/build/src/domains/context.js +6 -6
- package/build/src/domains/hosting.d.ts +292 -0
- package/build/src/domains/hosting.d.ts.map +1 -0
- package/build/src/domains/hosting.js +32 -0
- package/build/src/domains/index.d.ts +1 -0
- package/build/src/domains/index.d.ts.map +1 -1
- package/build/src/domains/index.js +1 -0
- package/build/src/domains/orchestration.d.ts +61 -14
- package/build/src/domains/orchestration.d.ts.map +1 -1
- package/build/src/domains/orchestration.js +11 -4
- package/build/src/domains/storage.d.ts +66 -0
- package/build/src/domains/storage.d.ts.map +1 -1
- package/build/src/domains/storage.js +34 -0
- package/build/src/fetcher/index.d.ts +15 -0
- package/build/src/fetcher/index.d.ts.map +1 -1
- package/build/src/fetcher/index.js +60 -1
- package/build/src/index.d.ts +1 -1
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -54,7 +54,9 @@ The package exports typed **domain** namespaces and API modules for:
|
|
|
54
54
|
- **Ai** – AI resources, agents, MCP servers, files
|
|
55
55
|
- **Billing** – subscriptions and billing
|
|
56
56
|
- **Connection** – connectors, integrations, filters
|
|
57
|
+
- **Context** – context repository, runtime sandbox, knowledge graph
|
|
57
58
|
- **Expression** – expressions and formula helpers
|
|
59
|
+
- **Hosting** – Cargo Hosting apps, workers, deployments, env vars, custom domains
|
|
58
60
|
- **Orchestration** – workflows, plays, tools, templates
|
|
59
61
|
- **RevenueOrganization** – members, capacities, territories
|
|
60
62
|
- **Segmentation** – segments, changes
|
|
@@ -70,7 +72,9 @@ Each domain exposes **sub-areas** on the API instance. Examples:
|
|
|
70
72
|
| **Ai** | template, agent, release, chat, message, vote, document, mcpServer, mcpClient, prompt, memory, file, suggestedAction |
|
|
71
73
|
| **Billing** | usage, subscription |
|
|
72
74
|
| **Connection** | connector, integration, nativeIntegration |
|
|
75
|
+
| **Context** | repository, runtime, graph |
|
|
73
76
|
| **Expression** | favoriteRecipe, recipe, expression |
|
|
77
|
+
| **Hosting** | app, worker, deployment, envVars, customDomain |
|
|
74
78
|
| **Orchestration** | batch, workflow, play, tool, release, draftRelease, run, record, node, template |
|
|
75
79
|
| **RevenueOrganization** | allocation, capacity, member, territory |
|
|
76
80
|
| **Segmentation** | segment, change, record |
|
|
@@ -20,10 +20,18 @@ export interface ConnectionApi {
|
|
|
20
20
|
getDocumentation: (slug: string) => Promise<string>;
|
|
21
21
|
list: (payload: Connection.Api.ListIntegrationsPayload) => Promise<Connection.Api.ListIntegrationsResult>;
|
|
22
22
|
completeOauth(payload: Connection.Api.CompleteIntegrationOauthPayload): Promise<Connection.Api.CompleteIntegrationOauthResult>;
|
|
23
|
+
initiateOauth(payload: Connection.Api.InitiateIntegrationOauthPayload): Promise<Connection.Api.InitiateIntegrationOauthResult>;
|
|
23
24
|
};
|
|
24
25
|
nativeIntegration: {
|
|
25
26
|
get: () => Promise<Connection.Api.GetNativeIntegrationResult>;
|
|
26
27
|
};
|
|
28
|
+
customIntegration: {
|
|
29
|
+
create: (payload: Connection.Api.CreateCustomIntegrationPayload) => Promise<Connection.Api.CreateCustomIntegrationResult>;
|
|
30
|
+
list: () => Promise<Connection.Api.ListCustomIntegrationsResult>;
|
|
31
|
+
get: (payload: Connection.Api.GetCustomIntegrationPayload) => Promise<Connection.Api.GetCustomIntegrationResult>;
|
|
32
|
+
update: (payload: Connection.Api.UpdateCustomIntegrationPayload) => Promise<Connection.Api.UpdateCustomIntegrationResult>;
|
|
33
|
+
remove: (uuid: string) => Promise<void>;
|
|
34
|
+
};
|
|
27
35
|
}
|
|
28
36
|
export declare const buildConnectionApi: ({ fetcher, }: ConnectionApiDependencies) => ConnectionApi;
|
|
29
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE;QACT,YAAY,EAAE,CACZ,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,4BAA4B,KACjD,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QACzD,gBAAgB,EAAE,CAChB,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,gCAAgC,KACrD,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC7D,iBAAiB,EAAE,CACjB,OAAO,EAAE,UAAU,CAAC,GAAG,CAA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N,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,8BAA8B,KACnD,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3D,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACjE,GAAG,EAAE,CACH,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,2BAA2B,KAChD,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxD,MAAM,EAAE,CACN,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,8BAA8B,KACnD,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3D,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACzC,CAAC;CACH;AAED,eAAO,MAAM,kBAAkB,iBAE5B,yBAAyB,KAAG,aA0a9B,CAAC"}
|
|
@@ -146,6 +146,23 @@ export const buildConnectionApi = ({ fetcher, }) => {
|
|
|
146
146
|
});
|
|
147
147
|
return result;
|
|
148
148
|
}
|
|
149
|
+
async function initiateIntegrationOauth(payload) {
|
|
150
|
+
const { slug } = payload;
|
|
151
|
+
try {
|
|
152
|
+
const result = await fetcher.fetch({
|
|
153
|
+
method: "post",
|
|
154
|
+
endpoint: `connection/integrations/${slug}/initiateOauth`,
|
|
155
|
+
});
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
throw getErrorWithReasonErrorMessage(error, Connection.Api.zodInitiateIntegrationOauthErrorReason, {
|
|
160
|
+
integrationNotFound: "Integration not found",
|
|
161
|
+
initiateOauthNotSupported: "This integration does not support OAuth initiation",
|
|
162
|
+
failedToInitiateOauth: "Failed to initiate OAuth flow",
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
149
166
|
async function getNativeIntegration() {
|
|
150
167
|
const result = await fetcher.fetch({
|
|
151
168
|
method: "get",
|
|
@@ -153,6 +170,77 @@ export const buildConnectionApi = ({ fetcher, }) => {
|
|
|
153
170
|
});
|
|
154
171
|
return result;
|
|
155
172
|
}
|
|
173
|
+
async function createCustomIntegration(payload) {
|
|
174
|
+
try {
|
|
175
|
+
const result = await fetcher.fetch({
|
|
176
|
+
method: "post",
|
|
177
|
+
endpoint: "connection/customIntegrations",
|
|
178
|
+
payload,
|
|
179
|
+
});
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
throw getErrorWithReasonErrorMessage(error, Connection.Api.zodCreateCustomIntegrationErrorReason, {
|
|
184
|
+
workerNotFound: "Worker not found",
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async function listCustomIntegrations() {
|
|
189
|
+
const result = await fetcher.fetch({
|
|
190
|
+
method: "get",
|
|
191
|
+
endpoint: "connection/customIntegrations/list",
|
|
192
|
+
});
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
async function getCustomIntegration(payload) {
|
|
196
|
+
const { uuid } = payload;
|
|
197
|
+
try {
|
|
198
|
+
const result = await fetcher.fetch({
|
|
199
|
+
method: "get",
|
|
200
|
+
endpoint: `connection/customIntegrations/${uuid}`,
|
|
201
|
+
});
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
throw getErrorWithReasonErrorMessage(error, Connection.Api.zodGetCustomIntegrationErrorReason, {
|
|
206
|
+
customIntegrationNotFound: "Custom integration not found",
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
async function updateCustomIntegration(payload) {
|
|
211
|
+
const { uuid, ...other } = payload;
|
|
212
|
+
try {
|
|
213
|
+
const result = await fetcher.fetch({
|
|
214
|
+
method: "put",
|
|
215
|
+
endpoint: `connection/customIntegrations/${uuid}`,
|
|
216
|
+
payload: other,
|
|
217
|
+
});
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
throw getErrorWithReasonErrorMessage(error, Connection.Api.zodUpdateCustomIntegrationErrorReason, {
|
|
222
|
+
customIntegrationNotFound: "Custom integration not found",
|
|
223
|
+
workerNotFound: "Worker not found",
|
|
224
|
+
customIntegrationNotWorker: "Custom integration is not backed by a worker",
|
|
225
|
+
customIntegrationNotExternal: "Custom integration is not externally hosted",
|
|
226
|
+
unknown: "Failed to update custom integration",
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
async function removeCustomIntegration(uuid) {
|
|
231
|
+
try {
|
|
232
|
+
await fetcher.fetch({
|
|
233
|
+
method: "delete",
|
|
234
|
+
endpoint: `connection/customIntegrations/${uuid}`,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
throw getErrorWithReasonErrorMessage(error, Connection.Api.zodRemoveCustomIntegrationErrorReason, {
|
|
239
|
+
customIntegrationNotFound: "Custom integration not found",
|
|
240
|
+
unknown: "Failed to remove custom integration",
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
156
244
|
return {
|
|
157
245
|
connector: {
|
|
158
246
|
autocomplete: autocompleteConnector,
|
|
@@ -197,9 +285,17 @@ export const buildConnectionApi = ({ fetcher, }) => {
|
|
|
197
285
|
return result.replaceAll("./", `${fetcher.baseUrl}/v1/connection/integrations/${slug}/documentation/`);
|
|
198
286
|
},
|
|
199
287
|
completeOauth: completeIntegrationOauth,
|
|
288
|
+
initiateOauth: initiateIntegrationOauth,
|
|
200
289
|
},
|
|
201
290
|
nativeIntegration: {
|
|
202
291
|
get: getNativeIntegration,
|
|
203
292
|
},
|
|
293
|
+
customIntegration: {
|
|
294
|
+
create: createCustomIntegration,
|
|
295
|
+
list: listCustomIntegrations,
|
|
296
|
+
get: getCustomIntegration,
|
|
297
|
+
update: updateCustomIntegration,
|
|
298
|
+
remove: removeCustomIntegration,
|
|
299
|
+
},
|
|
204
300
|
};
|
|
205
301
|
};
|
|
@@ -8,14 +8,16 @@ export interface ContextApi {
|
|
|
8
8
|
get: () => Promise<Context.Api.GetRepositoryResult>;
|
|
9
9
|
update: (payload: Context.Api.UpdateRepositoryPayload) => Promise<Context.Api.UpdateRepositoryResult>;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
browse: (payload
|
|
13
|
-
read: (payload: Context.Api.
|
|
14
|
-
|
|
11
|
+
runtime: {
|
|
12
|
+
browse: (payload?: Context.Api.BrowseRuntimePayload) => Promise<Context.Api.BrowseRuntimeResult>;
|
|
13
|
+
read: (payload: Context.Api.ReadRuntimePayload) => Promise<Context.Api.ReadRuntimeResult>;
|
|
14
|
+
readBytes: (payload: Context.Api.ReadBytesRuntimePayload) => Promise<Blob>;
|
|
15
|
+
write: (payload: Context.Api.WriteRuntimePayload) => Promise<Context.Api.WriteRuntimeResult>;
|
|
16
|
+
edit: (payload: Context.Api.EditRuntimePayload) => Promise<Context.Api.EditRuntimeResult>;
|
|
17
|
+
execute: (payload: Context.Api.ExecuteRuntimePayload) => Promise<Context.Api.ExecuteRuntimeResult>;
|
|
15
18
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
get: (payload: Context.Api.GetSkillPayload) => Promise<Context.Api.GetSkillResult>;
|
|
19
|
+
graph: {
|
|
20
|
+
get: () => Promise<Context.Api.GetGraphResult>;
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
export declare const buildContextApi: ({ fetcher, }: ContextApiDependencies) => ContextApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,UAAU,sBAAsB;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,M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mB,KACrC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC7C,IAAI,EAAE,CACJ,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,KACpC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC5C,OAAO,EAAE,CACP,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,KACvC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;KAChD,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;KAChD,CAAC;CACH;AAED,eAAO,MAAM,eAAe,iBAEzB,sBAAsB,KAAG,UA2F3B,CAAC"}
|
|
@@ -1,71 +1,79 @@
|
|
|
1
1
|
export const buildContextApi = ({ fetcher, }) => {
|
|
2
2
|
async function getRepository() {
|
|
3
|
-
|
|
3
|
+
return fetcher.fetch({
|
|
4
4
|
method: "get",
|
|
5
5
|
endpoint: "/context/repository",
|
|
6
6
|
});
|
|
7
|
-
return result;
|
|
8
7
|
}
|
|
9
8
|
async function updateRepository(payload) {
|
|
10
|
-
|
|
9
|
+
return fetcher.fetch({
|
|
11
10
|
method: "patch",
|
|
12
11
|
endpoint: "/context/repository",
|
|
13
12
|
payload,
|
|
14
13
|
});
|
|
15
|
-
return result;
|
|
16
14
|
}
|
|
17
|
-
async function
|
|
18
|
-
|
|
15
|
+
async function browseRuntime(payload) {
|
|
16
|
+
return fetcher.fetch({
|
|
19
17
|
method: "get",
|
|
20
|
-
endpoint: "/context/
|
|
18
|
+
endpoint: "/context/runtime",
|
|
21
19
|
params: payload,
|
|
22
20
|
});
|
|
23
|
-
return result;
|
|
24
21
|
}
|
|
25
|
-
async function
|
|
26
|
-
|
|
27
|
-
method: "
|
|
28
|
-
endpoint: "/context/
|
|
29
|
-
|
|
22
|
+
async function readRuntime(payload) {
|
|
23
|
+
return fetcher.fetch({
|
|
24
|
+
method: "post",
|
|
25
|
+
endpoint: "/context/runtime/content",
|
|
26
|
+
payload,
|
|
30
27
|
});
|
|
31
|
-
return result;
|
|
32
28
|
}
|
|
33
|
-
async function
|
|
34
|
-
|
|
29
|
+
async function readRuntimeBytes(payload) {
|
|
30
|
+
return fetcher.fetchBlob({
|
|
31
|
+
endpoint: "/context/runtime/raw",
|
|
32
|
+
params: { path: payload.path },
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async function writeRuntime(payload) {
|
|
36
|
+
return fetcher.fetch({
|
|
35
37
|
method: "put",
|
|
36
|
-
endpoint: "/context/
|
|
38
|
+
endpoint: "/context/runtime/content",
|
|
37
39
|
payload,
|
|
38
40
|
});
|
|
39
|
-
return result;
|
|
40
41
|
}
|
|
41
|
-
async function
|
|
42
|
-
|
|
43
|
-
method: "
|
|
44
|
-
endpoint: "/context/
|
|
42
|
+
async function editRuntime(payload) {
|
|
43
|
+
return fetcher.fetch({
|
|
44
|
+
method: "patch",
|
|
45
|
+
endpoint: "/context/runtime/content",
|
|
46
|
+
payload,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async function executeRuntime(payload) {
|
|
50
|
+
return fetcher.fetch({
|
|
51
|
+
method: "post",
|
|
52
|
+
endpoint: "/context/runtime/execute",
|
|
53
|
+
payload,
|
|
45
54
|
});
|
|
46
|
-
return result;
|
|
47
55
|
}
|
|
48
|
-
async function
|
|
49
|
-
|
|
56
|
+
async function getGraph() {
|
|
57
|
+
return fetcher.fetch({
|
|
50
58
|
method: "get",
|
|
51
|
-
endpoint: "/context/
|
|
52
|
-
params: { path: payload.slug },
|
|
59
|
+
endpoint: "/context/graph",
|
|
53
60
|
});
|
|
54
|
-
return result;
|
|
55
61
|
}
|
|
56
62
|
return {
|
|
57
63
|
repository: {
|
|
58
64
|
get: getRepository,
|
|
59
65
|
update: updateRepository,
|
|
60
66
|
},
|
|
61
|
-
|
|
62
|
-
browse:
|
|
63
|
-
read:
|
|
64
|
-
|
|
67
|
+
runtime: {
|
|
68
|
+
browse: browseRuntime,
|
|
69
|
+
read: readRuntime,
|
|
70
|
+
readBytes: readRuntimeBytes,
|
|
71
|
+
write: writeRuntime,
|
|
72
|
+
edit: editRuntime,
|
|
73
|
+
execute: executeRuntime,
|
|
65
74
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
get: getSkill,
|
|
75
|
+
graph: {
|
|
76
|
+
get: getGraph,
|
|
69
77
|
},
|
|
70
78
|
};
|
|
71
79
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Hosting } from "../../domains/index.js";
|
|
2
|
+
import type { Fetcher } from "../../fetcher/index.js";
|
|
3
|
+
interface HostingApiDependencies {
|
|
4
|
+
fetcher: Fetcher;
|
|
5
|
+
}
|
|
6
|
+
export interface HostingApi {
|
|
7
|
+
app: {
|
|
8
|
+
list: (payload?: Hosting.Api.ListAppsPayload) => Promise<Hosting.Api.ListAppsResult>;
|
|
9
|
+
get: (uuid: string) => Promise<Hosting.Api.GetAppResult>;
|
|
10
|
+
create: (payload: Hosting.Api.CreateAppPayload) => Promise<Hosting.Api.CreateAppResult>;
|
|
11
|
+
update: (payload: Hosting.Api.UpdateAppPayload) => Promise<Hosting.Api.UpdateAppResult>;
|
|
12
|
+
remove: (uuid: string) => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
worker: {
|
|
15
|
+
list: (payload?: Hosting.Api.ListWorkersPayload) => Promise<Hosting.Api.ListWorkersResult>;
|
|
16
|
+
get: (uuid: string) => Promise<Hosting.Api.GetWorkerResult>;
|
|
17
|
+
create: (payload: Hosting.Api.CreateWorkerPayload) => Promise<Hosting.Api.CreateWorkerResult>;
|
|
18
|
+
update: (payload: Hosting.Api.UpdateWorkerPayload) => Promise<Hosting.Api.UpdateWorkerResult>;
|
|
19
|
+
remove: (uuid: string) => Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
deployment: {
|
|
22
|
+
list: (payload: Hosting.Api.ListDeploymentsPayload) => Promise<Hosting.Api.ListDeploymentsResult>;
|
|
23
|
+
count: (payload: Hosting.Api.CountDeploymentsPayload) => Promise<Hosting.Api.CountDeploymentsResult>;
|
|
24
|
+
get: (uuid: string) => Promise<Hosting.Api.GetDeploymentResult>;
|
|
25
|
+
getPromoted: (payload: Hosting.Api.GetPromotedDeploymentPayload) => Promise<Hosting.Api.GetPromotedDeploymentResult>;
|
|
26
|
+
getBuildLogUrl: (payload: Hosting.Api.GetDeploymentBuildLogUrlPayload) => Promise<Hosting.Api.GetDeploymentBuildLogUrlResult>;
|
|
27
|
+
create: (payload: Hosting.Api.CreateDeploymentPayload) => Promise<Hosting.Api.CreateDeploymentResult>;
|
|
28
|
+
promote: (payload: Hosting.Api.PromoteDeploymentPayload) => Promise<Hosting.Api.PromoteDeploymentResult>;
|
|
29
|
+
cancel: (payload: Hosting.Api.CancelDeploymentPayload) => Promise<Hosting.Api.CancelDeploymentResult>;
|
|
30
|
+
};
|
|
31
|
+
envVars: {
|
|
32
|
+
list: (payload: Hosting.Api.ListEnvVarsPayload) => Promise<Hosting.Api.ListEnvVarsResult>;
|
|
33
|
+
create: (payload: Hosting.Api.CreateEnvVarPayload) => Promise<Hosting.Api.CreateEnvVarResult>;
|
|
34
|
+
update: (payload: Hosting.Api.UpdateEnvVarPayload) => Promise<Hosting.Api.UpdateEnvVarResult>;
|
|
35
|
+
remove: (payload: Hosting.Api.RemoveEnvVarPayload) => Promise<void>;
|
|
36
|
+
};
|
|
37
|
+
customDomain: {
|
|
38
|
+
list: (payload: Hosting.Api.ListCustomDomainsPayload) => Promise<Hosting.Api.ListCustomDomainsResult>;
|
|
39
|
+
get: (payload: Hosting.Api.GetCustomDomainPayload) => Promise<Hosting.Api.GetCustomDomainResult>;
|
|
40
|
+
attach: (payload: Hosting.Api.AttachCustomDomainPayload) => Promise<Hosting.Api.AttachCustomDomainResult>;
|
|
41
|
+
refreshStatus: (payload: Hosting.Api.RefreshCustomDomainStatusPayload) => Promise<Hosting.Api.RefreshCustomDomainStatusResult>;
|
|
42
|
+
detach: (payload: Hosting.Api.DetachCustomDomainPayload) => Promise<Hosting.Api.DetachCustomDomainResult>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare const buildHostingApi: ({ fetcher, }: HostingApiDependencies) => HostingApi;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/hosting/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,UAAU,sBAAsB;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE;QACH,IAAI,EAAE,CACJ,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,KAClC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzD,MAAM,EAAE,CACN,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAClC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC1C,MAAM,EAAE,CACN,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAClC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC1C,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACzC,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,CACJ,OAAO,CAAC,EAAE,OAA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yB,KAC3C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACnD,aAAa,EAAE,CACb,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,KAClD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC1D,MAAM,EAAE,CACN,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB,KAC3C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;KACpD,CAAC;CACH;AAED,eAAO,MAAM,eAAe,iBAEzB,sBAAsB,KAAG,UA+Q3B,CAAC"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
export const buildHostingApi = ({ fetcher, }) => {
|
|
2
|
+
async function listApps(payload) {
|
|
3
|
+
return await fetcher.fetch({
|
|
4
|
+
method: "post",
|
|
5
|
+
endpoint: "/hosting/apps/list",
|
|
6
|
+
payload: payload !== undefined ? payload : {},
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
async function getApp(uuid) {
|
|
10
|
+
return await fetcher.fetch({
|
|
11
|
+
method: "get",
|
|
12
|
+
endpoint: `/hosting/apps/${uuid}`,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async function createApp(payload) {
|
|
16
|
+
return await fetcher.fetch({
|
|
17
|
+
method: "post",
|
|
18
|
+
endpoint: "/hosting/apps",
|
|
19
|
+
payload,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function updateApp(payload) {
|
|
23
|
+
const { uuid, ...other } = payload;
|
|
24
|
+
return await fetcher.fetch({
|
|
25
|
+
method: "put",
|
|
26
|
+
endpoint: `/hosting/apps/${uuid}`,
|
|
27
|
+
payload: other,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async function removeApp(uuid) {
|
|
31
|
+
await fetcher.fetch({
|
|
32
|
+
method: "delete",
|
|
33
|
+
endpoint: `/hosting/apps/${uuid}`,
|
|
34
|
+
payload: {},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async function listWorkers(payload) {
|
|
38
|
+
return await fetcher.fetch({
|
|
39
|
+
method: "post",
|
|
40
|
+
endpoint: "/hosting/workers/list",
|
|
41
|
+
payload: payload !== undefined ? payload : {},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async function getWorker(uuid) {
|
|
45
|
+
return await fetcher.fetch({
|
|
46
|
+
method: "get",
|
|
47
|
+
endpoint: `/hosting/workers/${uuid}`,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async function createWorker(payload) {
|
|
51
|
+
return await fetcher.fetch({
|
|
52
|
+
method: "post",
|
|
53
|
+
endpoint: "/hosting/workers",
|
|
54
|
+
payload,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async function updateWorker(payload) {
|
|
58
|
+
const { uuid, ...other } = payload;
|
|
59
|
+
return await fetcher.fetch({
|
|
60
|
+
method: "put",
|
|
61
|
+
endpoint: `/hosting/workers/${uuid}`,
|
|
62
|
+
payload: other,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async function removeWorker(uuid) {
|
|
66
|
+
await fetcher.fetch({
|
|
67
|
+
method: "delete",
|
|
68
|
+
endpoint: `/hosting/workers/${uuid}`,
|
|
69
|
+
payload: {},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async function listDeployments(payload) {
|
|
73
|
+
return await fetcher.fetch({
|
|
74
|
+
method: "post",
|
|
75
|
+
endpoint: "/hosting/deployments/list",
|
|
76
|
+
payload,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async function countDeployments(payload) {
|
|
80
|
+
return await fetcher.fetch({
|
|
81
|
+
method: "post",
|
|
82
|
+
endpoint: "/hosting/deployments/count",
|
|
83
|
+
payload,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async function getDeployment(uuid) {
|
|
87
|
+
return await fetcher.fetch({
|
|
88
|
+
method: "get",
|
|
89
|
+
endpoint: `/hosting/deployments/${uuid}`,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
async function getPromotedDeployment(payload) {
|
|
93
|
+
return await fetcher.fetch({
|
|
94
|
+
method: "get",
|
|
95
|
+
endpoint: "/hosting/deployments/promoted",
|
|
96
|
+
params: payload,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async function createDeployment(payload) {
|
|
100
|
+
return await fetcher.fetch({
|
|
101
|
+
method: "post",
|
|
102
|
+
endpoint: "/hosting/deployments",
|
|
103
|
+
payload,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
async function promoteDeployment(payload) {
|
|
107
|
+
return await fetcher.fetch({
|
|
108
|
+
method: "post",
|
|
109
|
+
endpoint: "/hosting/deployments/promote",
|
|
110
|
+
payload,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
async function cancelDeployment(payload) {
|
|
114
|
+
return await fetcher.fetch({
|
|
115
|
+
method: "post",
|
|
116
|
+
endpoint: "/hosting/deployments/cancel",
|
|
117
|
+
payload,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async function getDeploymentBuildLogUrl(payload) {
|
|
121
|
+
return await fetcher.fetch({
|
|
122
|
+
method: "get",
|
|
123
|
+
endpoint: `/hosting/deployments/${encodeURIComponent(payload.uuid)}/build-log-url`,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
async function listEnvVars(payload) {
|
|
127
|
+
return await fetcher.fetch({
|
|
128
|
+
method: "get",
|
|
129
|
+
endpoint: "/hosting/env-vars",
|
|
130
|
+
params: payload,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
async function createEnvVar(payload) {
|
|
134
|
+
return await fetcher.fetch({
|
|
135
|
+
method: "post",
|
|
136
|
+
endpoint: "/hosting/env-vars",
|
|
137
|
+
payload,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
async function updateEnvVar(payload) {
|
|
141
|
+
const { uuid, ...body } = payload;
|
|
142
|
+
return await fetcher.fetch({
|
|
143
|
+
method: "patch",
|
|
144
|
+
endpoint: `/hosting/env-vars/${encodeURIComponent(uuid)}`,
|
|
145
|
+
payload: body,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
async function removeEnvVar(payload) {
|
|
149
|
+
await fetcher.fetch({
|
|
150
|
+
method: "delete",
|
|
151
|
+
endpoint: `/hosting/env-vars/${encodeURIComponent(payload.uuid)}`,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
async function listCustomDomains(payload) {
|
|
155
|
+
return await fetcher.fetch({
|
|
156
|
+
method: "get",
|
|
157
|
+
endpoint: "/hosting/custom-domains/list",
|
|
158
|
+
params: payload,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
async function getCustomDomain(payload) {
|
|
162
|
+
return await fetcher.fetch({
|
|
163
|
+
method: "get",
|
|
164
|
+
endpoint: `/hosting/custom-domains/${encodeURIComponent(payload.uuid)}`,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
async function attachCustomDomain(payload) {
|
|
168
|
+
return await fetcher.fetch({
|
|
169
|
+
method: "post",
|
|
170
|
+
endpoint: "/hosting/custom-domains",
|
|
171
|
+
payload,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async function refreshCustomDomainStatus(payload) {
|
|
175
|
+
return await fetcher.fetch({
|
|
176
|
+
method: "post",
|
|
177
|
+
endpoint: `/hosting/custom-domains/${encodeURIComponent(payload.uuid)}/refresh-status`,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
async function detachCustomDomain(payload) {
|
|
181
|
+
return await fetcher.fetch({
|
|
182
|
+
method: "delete",
|
|
183
|
+
endpoint: `/hosting/custom-domains/${encodeURIComponent(payload.uuid)}`,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
app: {
|
|
188
|
+
list: listApps,
|
|
189
|
+
get: getApp,
|
|
190
|
+
create: createApp,
|
|
191
|
+
update: updateApp,
|
|
192
|
+
remove: removeApp,
|
|
193
|
+
},
|
|
194
|
+
worker: {
|
|
195
|
+
list: listWorkers,
|
|
196
|
+
get: getWorker,
|
|
197
|
+
create: createWorker,
|
|
198
|
+
update: updateWorker,
|
|
199
|
+
remove: removeWorker,
|
|
200
|
+
},
|
|
201
|
+
deployment: {
|
|
202
|
+
list: listDeployments,
|
|
203
|
+
count: countDeployments,
|
|
204
|
+
get: getDeployment,
|
|
205
|
+
getPromoted: getPromotedDeployment,
|
|
206
|
+
getBuildLogUrl: getDeploymentBuildLogUrl,
|
|
207
|
+
create: createDeployment,
|
|
208
|
+
promote: promoteDeployment,
|
|
209
|
+
cancel: cancelDeployment,
|
|
210
|
+
},
|
|
211
|
+
envVars: {
|
|
212
|
+
list: listEnvVars,
|
|
213
|
+
create: createEnvVar,
|
|
214
|
+
update: updateEnvVar,
|
|
215
|
+
remove: removeEnvVar,
|
|
216
|
+
},
|
|
217
|
+
customDomain: {
|
|
218
|
+
list: listCustomDomains,
|
|
219
|
+
get: getCustomDomain,
|
|
220
|
+
attach: attachCustomDomain,
|
|
221
|
+
refreshStatus: refreshCustomDomainStatus,
|
|
222
|
+
detach: detachCustomDomain,
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
};
|
package/build/src/api/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ai, Billing, Connection, Orchestration, RevenueOrganization, Segmentation, Storage, SystemOfRecordIntegration, WorkspaceManagement } from "../domains/index.js";
|
|
1
|
+
import type { Ai, Billing, Connection, Hosting, Orchestration, RevenueOrganization, Segmentation, Storage, SystemOfRecordIntegration, WorkspaceManagement } from "../domains/index.js";
|
|
2
2
|
import type { FetcherOrigin } from "../fetcher/index.js";
|
|
3
3
|
import type { ApiType } from "../types.js";
|
|
4
4
|
import type { AiApi } from "./ai/index.js";
|
|
@@ -6,6 +6,7 @@ import type { BillingApi } from "./billing/index.js";
|
|
|
6
6
|
import type { ConnectionApi } from "./connection/index.js";
|
|
7
7
|
import type { ContextApi } from "./context/index.js";
|
|
8
8
|
import type { ExpressionApi } from "./expression/index.js";
|
|
9
|
+
import type { HostingApi } from "./hosting/index.js";
|
|
9
10
|
import type { OrchestrationApi } from "./orchestration/index.js";
|
|
10
11
|
import type { RevenueOrganizationApi } from "./revenueOrganization/index.js";
|
|
11
12
|
import type { SegmentationApi } from "./segmentation/index.js";
|
|
@@ -18,6 +19,7 @@ export * from "./billing/index.js";
|
|
|
18
19
|
export * from "./connection/index.js";
|
|
19
20
|
export * from "./context/index.js";
|
|
20
21
|
export * from "./expression/index.js";
|
|
22
|
+
export * from "./hosting/index.js";
|
|
21
23
|
export * from "./orchestration/index.js";
|
|
22
24
|
export * from "./revenueOrganization/index.js";
|
|
23
25
|
export * from "./segmentation/index.js";
|
|
@@ -27,6 +29,13 @@ export * from "./workspaceManagement/index.js";
|
|
|
27
29
|
export interface ApiDependencies {
|
|
28
30
|
baseUrl?: string;
|
|
29
31
|
workspaceUuid?: string;
|
|
32
|
+
/**
|
|
33
|
+
* If the API client runs inside a Cargo Hosted app, set this to the
|
|
34
|
+
* `VITE_CARGO_APP_UUID` so every request carries an `x-cargo-app-uuid`
|
|
35
|
+
* header. The backend uses it for usage attribution and as defence in depth
|
|
36
|
+
* on top of the user's own permissions.
|
|
37
|
+
*/
|
|
38
|
+
appUuid?: string;
|
|
30
39
|
getAccessToken?: (refresh?: boolean | undefined) => Promise<string>;
|
|
31
40
|
accessToken?: string;
|
|
32
41
|
origin?: FetcherOrigin;
|
|
@@ -43,6 +52,7 @@ export interface Api {
|
|
|
43
52
|
expression: ExpressionApi;
|
|
44
53
|
systemOfRecordIntegration: SystemOfRecordIntegrationApi;
|
|
45
54
|
orchestration: OrchestrationApi;
|
|
55
|
+
hosting: HostingApi;
|
|
46
56
|
userManagement: UserManagementApi;
|
|
47
57
|
ai: AiApi;
|
|
48
58
|
}
|
|
@@ -70,6 +80,8 @@ export type InitialisationResult = {
|
|
|
70
80
|
systemOfRecords: SystemOfRecordIntegration.SystemOfRecord[];
|
|
71
81
|
subscription: Billing.EnrichedSubscription;
|
|
72
82
|
files: Ai.File[];
|
|
83
|
+
apps: Hosting.App[];
|
|
84
|
+
workers: Hosting.Worker[];
|
|
73
85
|
};
|
|
74
86
|
export declare const buildApi: (dependencies: ApiDependencies) => Api;
|
|
75
87
|
//# sourceMappingURL=index.d.ts.map
|