@remixhq/core 0.1.14 → 0.1.16
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/api.d.ts +1 -1
- package/dist/collab.d.ts +2 -2
- package/dist/collab.js +1 -1
- package/dist/{contracts-NbV3P_Rl.d.ts → contracts-CHmD-fMj.d.ts} +1 -1
- package/dist/history.d.ts +64 -0
- package/dist/history.js +529 -0
- package/dist/index.d.ts +1 -1
- package/package.json +6 -2
- package/dist/chunk-2WGZS7CD.js +0 -0
- package/dist/chunk-34WDQCPF.js +0 -242
- package/dist/chunk-4276ARDF.js +0 -303
- package/dist/chunk-4L3ZBZUQ.js +0 -281
- package/dist/chunk-54CBEP2W.js +0 -570
- package/dist/chunk-55K5GHAZ.js +0 -252
- package/dist/chunk-5H5CZKGN.js +0 -691
- package/dist/chunk-5NTOJXEZ.js +0 -223
- package/dist/chunk-7WUKH3ZD.js +0 -221
- package/dist/chunk-AE2HPMUZ.js +0 -80
- package/dist/chunk-AEAOYVIL.js +0 -200
- package/dist/chunk-B5S3PUIR.js +0 -388
- package/dist/chunk-BJFCN2C3.js +0 -46
- package/dist/chunk-BNKPTE2U.js +0 -401
- package/dist/chunk-C5NBNU32.js +0 -240
- package/dist/chunk-CJFGQE7D.js +0 -46
- package/dist/chunk-CUUXZSKW.js +0 -611
- package/dist/chunk-DCU3646I.js +0 -12
- package/dist/chunk-DEWAIK5X.js +0 -11
- package/dist/chunk-DRD6EVTT.js +0 -447
- package/dist/chunk-DXCL6I4Q.js +0 -399
- package/dist/chunk-E4KAGBU7.js +0 -134
- package/dist/chunk-E6AYE22H.js +0 -343
- package/dist/chunk-EF3677RE.js +0 -93
- package/dist/chunk-EVWDYCBL.js +0 -223
- package/dist/chunk-EW4PWFHB.js +0 -46
- package/dist/chunk-FAZUMWBS.js +0 -93
- package/dist/chunk-GEHSFPCD.js +0 -93
- package/dist/chunk-GFOBGYW4.js +0 -252
- package/dist/chunk-INDDXWAH.js +0 -92
- package/dist/chunk-IXWQWFYT.js +0 -342
- package/dist/chunk-J3J4PBQ7.js +0 -710
- package/dist/chunk-K54U353Z.js +0 -691
- package/dist/chunk-K57ZFDGC.js +0 -15
- package/dist/chunk-NDA7EJJA.js +0 -286
- package/dist/chunk-NK2DA4X6.js +0 -357
- package/dist/chunk-OBYR4JHZ.js +0 -374
- package/dist/chunk-OJMTW22J.js +0 -286
- package/dist/chunk-OMUDRPUI.js +0 -195
- package/dist/chunk-ONKKRS2C.js +0 -239
- package/dist/chunk-OWFBBWU7.js +0 -196
- package/dist/chunk-OZRXDDEL.js +0 -46
- package/dist/chunk-P7EM3N73.js +0 -46
- package/dist/chunk-POYB6MCQ.js +0 -373
- package/dist/chunk-PR5QKMHM.js +0 -46
- package/dist/chunk-R44EOUS4.js +0 -288
- package/dist/chunk-R7FVSCQW.js +0 -415
- package/dist/chunk-RIP2MIZL.js +0 -710
- package/dist/chunk-RKMMEML5.js +0 -46
- package/dist/chunk-RM2BGDBB.js +0 -400
- package/dist/chunk-RREREIGW.js +0 -710
- package/dist/chunk-TQHLFQY4.js +0 -448
- package/dist/chunk-TY3SSQQK.js +0 -688
- package/dist/chunk-UGKPOCN5.js +0 -710
- package/dist/chunk-UIGKSCTD.js +0 -406
- package/dist/chunk-UWIVJRTI.js +0 -343
- package/dist/chunk-VA6WXRWB.js +0 -636
- package/dist/chunk-XC2FV57P.js +0 -385
- package/dist/chunk-XOQIADCH.js +0 -223
- package/dist/chunk-ZAQZKEH4.js +0 -46
- package/dist/chunk-ZBMOGUSJ.js +0 -17
- package/dist/chunk-ZXP6ENQY.js +0 -244
- package/dist/index.cjs +0 -1269
- package/dist/index.d.cts +0 -482
package/dist/chunk-R44EOUS4.js
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RemixError
|
|
3
|
-
} from "./chunk-YZ34ICNN.js";
|
|
4
|
-
|
|
5
|
-
// src/api/client.ts
|
|
6
|
-
async function readJsonSafe(res) {
|
|
7
|
-
const ct = res.headers.get("content-type") ?? "";
|
|
8
|
-
if (!ct.toLowerCase().includes("application/json")) return null;
|
|
9
|
-
try {
|
|
10
|
-
return await res.json();
|
|
11
|
-
} catch {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function createApiClient(config, opts) {
|
|
16
|
-
const apiKey = (opts?.apiKey ?? "").trim();
|
|
17
|
-
const tokenProvider = opts?.tokenProvider;
|
|
18
|
-
const CLIENT_KEY_HEADER = "x-comerge-api-key";
|
|
19
|
-
async function request(path, init) {
|
|
20
|
-
if (!tokenProvider) {
|
|
21
|
-
throw new RemixError("API client is missing a token provider.", {
|
|
22
|
-
exitCode: 1,
|
|
23
|
-
hint: "Configure auth before creating the Remix API client."
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const auth = await tokenProvider();
|
|
27
|
-
const url = new URL(path, config.apiUrl).toString();
|
|
28
|
-
const doFetch = async (bearer) => fetch(url, {
|
|
29
|
-
...init,
|
|
30
|
-
headers: {
|
|
31
|
-
Accept: "application/json",
|
|
32
|
-
"Content-Type": "application/json",
|
|
33
|
-
...init?.headers ?? {},
|
|
34
|
-
Authorization: `Bearer ${bearer}`,
|
|
35
|
-
...apiKey ? { [CLIENT_KEY_HEADER]: apiKey } : {}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
let res = await doFetch(auth.token);
|
|
39
|
-
if (res.status === 401 && !auth.fromEnv && auth.session?.refresh_token) {
|
|
40
|
-
const refreshed = await tokenProvider({ forceRefresh: true });
|
|
41
|
-
res = await doFetch(refreshed.token);
|
|
42
|
-
}
|
|
43
|
-
if (!res.ok) {
|
|
44
|
-
const body = await readJsonSafe(res);
|
|
45
|
-
const msg = (body && typeof body === "object" && body && "message" in body && typeof body.message === "string" ? body.message : null) ?? `Request failed (status ${res.status})`;
|
|
46
|
-
throw new RemixError(msg, { exitCode: 1, hint: body ? JSON.stringify(body, null, 2) : null });
|
|
47
|
-
}
|
|
48
|
-
const json = await readJsonSafe(res);
|
|
49
|
-
return json ?? null;
|
|
50
|
-
}
|
|
51
|
-
async function requestBinary(path, init) {
|
|
52
|
-
if (!tokenProvider) {
|
|
53
|
-
throw new RemixError("API client is missing a token provider.", {
|
|
54
|
-
exitCode: 1,
|
|
55
|
-
hint: "Configure auth before creating the Remix API client."
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
const auth = await tokenProvider();
|
|
59
|
-
const url = new URL(path, config.apiUrl).toString();
|
|
60
|
-
const doFetch = async (bearer) => fetch(url, {
|
|
61
|
-
...init,
|
|
62
|
-
headers: {
|
|
63
|
-
Accept: "*/*",
|
|
64
|
-
...init?.headers ?? {},
|
|
65
|
-
Authorization: `Bearer ${bearer}`,
|
|
66
|
-
...apiKey ? { [CLIENT_KEY_HEADER]: apiKey } : {}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
let res = await doFetch(auth.token);
|
|
70
|
-
if (res.status === 401 && !auth.fromEnv && auth.session?.refresh_token) {
|
|
71
|
-
const refreshed = await tokenProvider({ forceRefresh: true });
|
|
72
|
-
res = await doFetch(refreshed.token);
|
|
73
|
-
}
|
|
74
|
-
if (!res.ok) {
|
|
75
|
-
const body = await readJsonSafe(res);
|
|
76
|
-
const msg = (body && typeof body === "object" && body && "message" in body && typeof body.message === "string" ? body.message : null) ?? `Request failed (status ${res.status})`;
|
|
77
|
-
throw new RemixError(msg, { exitCode: 1, hint: body ? JSON.stringify(body, null, 2) : null });
|
|
78
|
-
}
|
|
79
|
-
const contentDisposition = res.headers.get("content-disposition") ?? "";
|
|
80
|
-
const fileNameMatch = contentDisposition.match(/filename=\"([^\"]+)\"/i);
|
|
81
|
-
return {
|
|
82
|
-
data: Buffer.from(await res.arrayBuffer()),
|
|
83
|
-
fileName: fileNameMatch?.[1] ?? null,
|
|
84
|
-
contentType: res.headers.get("content-type")
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
getMe: () => request("/v1/me", { method: "GET" }),
|
|
89
|
-
listOrganizations: () => request("/v1/organizations", { method: "GET" }),
|
|
90
|
-
getOrganization: (orgId) => request(`/v1/organizations/${encodeURIComponent(orgId)}`, { method: "GET" }),
|
|
91
|
-
listProjects: (params) => {
|
|
92
|
-
const qs = new URLSearchParams();
|
|
93
|
-
if (params?.organizationId) qs.set("organizationId", params.organizationId);
|
|
94
|
-
if (params?.clientAppId) qs.set("clientAppId", params.clientAppId);
|
|
95
|
-
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
96
|
-
return request(`/v1/projects${suffix}`, { method: "GET" });
|
|
97
|
-
},
|
|
98
|
-
getProject: (projectId) => request(`/v1/projects/${encodeURIComponent(projectId)}`, { method: "GET" }),
|
|
99
|
-
resolveProjectBinding: (params) => {
|
|
100
|
-
const qs = new URLSearchParams();
|
|
101
|
-
if (params.repoFingerprint) qs.set("repoFingerprint", params.repoFingerprint);
|
|
102
|
-
if (params.remoteUrl) qs.set("remoteUrl", params.remoteUrl);
|
|
103
|
-
return request(`/v1/projects/bindings/resolve?${qs.toString()}`, { method: "GET" });
|
|
104
|
-
},
|
|
105
|
-
autoEnableDeveloper: () => request("/v1/developer/auto-enable", { method: "POST" }),
|
|
106
|
-
listClientApps: (params) => {
|
|
107
|
-
const qs = params?.orgId ? `?orgId=${encodeURIComponent(params.orgId)}` : "";
|
|
108
|
-
return request(`/v1/developer/client-apps${qs}`, { method: "GET" });
|
|
109
|
-
},
|
|
110
|
-
createClientApp: (payload) => request("/v1/developer/client-apps", { method: "POST", body: JSON.stringify(payload) }),
|
|
111
|
-
createClientAppKey: (clientAppId, payload) => request(`/v1/developer/client-apps/${encodeURIComponent(clientAppId)}/keys`, {
|
|
112
|
-
method: "POST",
|
|
113
|
-
body: JSON.stringify(payload ?? {})
|
|
114
|
-
}),
|
|
115
|
-
listApps: (params) => {
|
|
116
|
-
const qs = new URLSearchParams();
|
|
117
|
-
if (params?.projectId) qs.set("projectId", params.projectId);
|
|
118
|
-
if (params?.organizationId) qs.set("organizationId", params.organizationId);
|
|
119
|
-
if (params?.forked) qs.set("forked", params.forked);
|
|
120
|
-
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
121
|
-
return request(`/v1/apps${suffix}`, { method: "GET" });
|
|
122
|
-
},
|
|
123
|
-
getApp: (appId) => request(`/v1/apps/${encodeURIComponent(appId)}`, { method: "GET" }),
|
|
124
|
-
getMergeRequest: (mrId) => request(`/v1/merge-requests/${encodeURIComponent(mrId)}`, { method: "GET" }),
|
|
125
|
-
presignImportUpload: (payload) => request("/v1/apps/import/upload/presign", { method: "POST", body: JSON.stringify(payload) }),
|
|
126
|
-
importFromUpload: (payload) => request("/v1/apps/import/upload", { method: "POST", body: JSON.stringify(payload) }),
|
|
127
|
-
presignImportUploadFirstParty: (payload) => request("/v1/apps/import/upload/presign/first-party", { method: "POST", body: JSON.stringify(payload) }),
|
|
128
|
-
importFromUploadFirstParty: (payload) => request("/v1/apps/import/upload/first-party", { method: "POST", body: JSON.stringify(payload) }),
|
|
129
|
-
importFromGithubFirstParty: (payload) => request("/v1/apps/import/github/first-party", { method: "POST", body: JSON.stringify(payload) }),
|
|
130
|
-
forkApp: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/fork`, { method: "POST", body: JSON.stringify(payload ?? {}) }),
|
|
131
|
-
downloadAppBundle: (appId) => requestBinary(`/v1/apps/${encodeURIComponent(appId)}/download.bundle`, { method: "GET" }),
|
|
132
|
-
createChangeStep: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/change-steps`, {
|
|
133
|
-
method: "POST",
|
|
134
|
-
body: JSON.stringify(payload)
|
|
135
|
-
}),
|
|
136
|
-
createCollabTurn: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/collab-turns`, {
|
|
137
|
-
method: "POST",
|
|
138
|
-
body: JSON.stringify(payload)
|
|
139
|
-
}),
|
|
140
|
-
listCollabTurns: (appId, params) => {
|
|
141
|
-
const qs = new URLSearchParams();
|
|
142
|
-
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
143
|
-
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
144
|
-
if (params?.changeStepId) qs.set("changeStepId", params.changeStepId);
|
|
145
|
-
if (params?.threadId) qs.set("threadId", params.threadId);
|
|
146
|
-
if (params?.createdAfter) qs.set("createdAfter", params.createdAfter);
|
|
147
|
-
if (params?.createdBefore) qs.set("createdBefore", params.createdBefore);
|
|
148
|
-
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
149
|
-
return request(`/v1/apps/${encodeURIComponent(appId)}/collab-turns${suffix}`, { method: "GET" });
|
|
150
|
-
},
|
|
151
|
-
getCollabTurn: (appId, collabTurnId) => request(`/v1/apps/${encodeURIComponent(appId)}/collab-turns/${encodeURIComponent(collabTurnId)}`, {
|
|
152
|
-
method: "GET"
|
|
153
|
-
}),
|
|
154
|
-
getAgentMemorySummary: (appId) => request(`/v1/apps/${encodeURIComponent(appId)}/agent-memory/summary`, { method: "GET" }),
|
|
155
|
-
listAgentMemoryTimeline: (appId, params) => {
|
|
156
|
-
const qs = new URLSearchParams();
|
|
157
|
-
if (params?.limit !== void 0) qs.set("limit", String(params.limit));
|
|
158
|
-
if (params?.offset !== void 0) qs.set("offset", String(params.offset));
|
|
159
|
-
if (params?.createdAfter) qs.set("createdAfter", params.createdAfter);
|
|
160
|
-
if (params?.createdBefore) qs.set("createdBefore", params.createdBefore);
|
|
161
|
-
if (params?.kinds?.length) {
|
|
162
|
-
for (const kind of params.kinds) qs.append("kinds", kind);
|
|
163
|
-
}
|
|
164
|
-
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
165
|
-
return request(`/v1/apps/${encodeURIComponent(appId)}/agent-memory/timeline${suffix}`, { method: "GET" });
|
|
166
|
-
},
|
|
167
|
-
searchAgentMemory: (appId, params) => {
|
|
168
|
-
const qs = new URLSearchParams();
|
|
169
|
-
qs.set("q", params.q);
|
|
170
|
-
if (params.limit !== void 0) qs.set("limit", String(params.limit));
|
|
171
|
-
if (params.offset !== void 0) qs.set("offset", String(params.offset));
|
|
172
|
-
if (params.createdAfter) qs.set("createdAfter", params.createdAfter);
|
|
173
|
-
if (params.createdBefore) qs.set("createdBefore", params.createdBefore);
|
|
174
|
-
if (params.kinds?.length) {
|
|
175
|
-
for (const kind of params.kinds) qs.append("kinds", kind);
|
|
176
|
-
}
|
|
177
|
-
return request(`/v1/apps/${encodeURIComponent(appId)}/agent-memory/search?${qs.toString()}`, { method: "GET" });
|
|
178
|
-
},
|
|
179
|
-
getChangeStep: (appId, changeStepId) => request(`/v1/apps/${encodeURIComponent(appId)}/change-steps/${encodeURIComponent(changeStepId)}`, { method: "GET" }),
|
|
180
|
-
getChangeStepDiff: (appId, changeStepId) => request(`/v1/apps/${encodeURIComponent(appId)}/change-steps/${encodeURIComponent(changeStepId)}/diff`, {
|
|
181
|
-
method: "GET"
|
|
182
|
-
}),
|
|
183
|
-
startChangeStepReplay: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/change-steps/replays`, {
|
|
184
|
-
method: "POST",
|
|
185
|
-
body: JSON.stringify(payload)
|
|
186
|
-
}),
|
|
187
|
-
getChangeStepReplay: (appId, replayId) => request(`/v1/apps/${encodeURIComponent(appId)}/change-steps/replays/${encodeURIComponent(replayId)}`, {
|
|
188
|
-
method: "GET"
|
|
189
|
-
}),
|
|
190
|
-
getChangeStepReplayDiff: (appId, replayId) => request(`/v1/apps/${encodeURIComponent(appId)}/change-steps/replays/${encodeURIComponent(replayId)}/diff`, {
|
|
191
|
-
method: "GET"
|
|
192
|
-
}),
|
|
193
|
-
listMergeRequests: (params) => {
|
|
194
|
-
const qs = new URLSearchParams();
|
|
195
|
-
if (params?.queue) qs.set("queue", params.queue);
|
|
196
|
-
if (params?.appId) qs.set("appId", params.appId);
|
|
197
|
-
if (params?.sourceAppId) qs.set("sourceAppId", params.sourceAppId);
|
|
198
|
-
if (params?.targetAppId) qs.set("targetAppId", params.targetAppId);
|
|
199
|
-
if (Array.isArray(params?.status)) {
|
|
200
|
-
for (const status of params.status) qs.append("status", status);
|
|
201
|
-
} else if (typeof params?.status === "string") {
|
|
202
|
-
qs.set("status", params.status);
|
|
203
|
-
}
|
|
204
|
-
if (params?.kind) qs.set("kind", params.kind);
|
|
205
|
-
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
206
|
-
return request(`/v1/merge-requests${suffix}`, { method: "GET" });
|
|
207
|
-
},
|
|
208
|
-
openMergeRequest: (sourceAppId) => request("/v1/merge-requests", { method: "POST", body: JSON.stringify({ sourceAppId }) }),
|
|
209
|
-
getMergeRequestReview: (mrId) => request(`/v1/merge-requests/${encodeURIComponent(mrId)}/review`, { method: "GET" }),
|
|
210
|
-
updateMergeRequest: (mrId, payload) => request(`/v1/merge-requests/${encodeURIComponent(mrId)}`, { method: "PATCH", body: JSON.stringify(payload) }),
|
|
211
|
-
createOrganizationInvite: (orgId, payload) => request(`/v1/organizations/${encodeURIComponent(orgId)}/invitations`, {
|
|
212
|
-
method: "POST",
|
|
213
|
-
body: JSON.stringify(payload)
|
|
214
|
-
}),
|
|
215
|
-
createProjectInvite: (projectId, payload) => request(`/v1/projects/${encodeURIComponent(projectId)}/invitations`, {
|
|
216
|
-
method: "POST",
|
|
217
|
-
body: JSON.stringify(payload)
|
|
218
|
-
}),
|
|
219
|
-
createAppInvite: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/invitations`, {
|
|
220
|
-
method: "POST",
|
|
221
|
-
body: JSON.stringify(payload)
|
|
222
|
-
}),
|
|
223
|
-
listOrganizationInvites: (orgId) => request(`/v1/organizations/${encodeURIComponent(orgId)}/invitations`, { method: "GET" }),
|
|
224
|
-
listProjectInvites: (projectId) => request(`/v1/projects/${encodeURIComponent(projectId)}/invitations`, { method: "GET" }),
|
|
225
|
-
listAppInvites: (appId) => request(`/v1/apps/${encodeURIComponent(appId)}/invitations`, { method: "GET" }),
|
|
226
|
-
resendOrganizationInvite: (orgId, inviteId, payload) => request(`/v1/organizations/${encodeURIComponent(orgId)}/invitations/${encodeURIComponent(inviteId)}/resend`, {
|
|
227
|
-
method: "POST",
|
|
228
|
-
body: JSON.stringify(payload ?? {})
|
|
229
|
-
}),
|
|
230
|
-
resendProjectInvite: (projectId, inviteId, payload) => request(`/v1/projects/${encodeURIComponent(projectId)}/invitations/${encodeURIComponent(inviteId)}/resend`, {
|
|
231
|
-
method: "POST",
|
|
232
|
-
body: JSON.stringify(payload ?? {})
|
|
233
|
-
}),
|
|
234
|
-
resendAppInvite: (appId, inviteId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/invitations/${encodeURIComponent(inviteId)}/resend`, {
|
|
235
|
-
method: "POST",
|
|
236
|
-
body: JSON.stringify(payload ?? {})
|
|
237
|
-
}),
|
|
238
|
-
revokeOrganizationInvite: (orgId, inviteId) => request(`/v1/organizations/${encodeURIComponent(orgId)}/invitations/${encodeURIComponent(inviteId)}`, {
|
|
239
|
-
method: "DELETE"
|
|
240
|
-
}),
|
|
241
|
-
revokeProjectInvite: (projectId, inviteId) => request(`/v1/projects/${encodeURIComponent(projectId)}/invitations/${encodeURIComponent(inviteId)}`, {
|
|
242
|
-
method: "DELETE"
|
|
243
|
-
}),
|
|
244
|
-
revokeAppInvite: (appId, inviteId) => request(`/v1/apps/${encodeURIComponent(appId)}/invitations/${encodeURIComponent(inviteId)}`, {
|
|
245
|
-
method: "DELETE"
|
|
246
|
-
}),
|
|
247
|
-
syncUpstreamApp: (appId) => request(`/v1/apps/${encodeURIComponent(appId)}/sync-upstream`, {
|
|
248
|
-
method: "POST",
|
|
249
|
-
body: JSON.stringify({})
|
|
250
|
-
}),
|
|
251
|
-
preflightAppReconcile: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/reconcile/preflight`, {
|
|
252
|
-
method: "POST",
|
|
253
|
-
body: JSON.stringify(payload)
|
|
254
|
-
}),
|
|
255
|
-
startAppReconcile: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/reconcile/start`, {
|
|
256
|
-
method: "POST",
|
|
257
|
-
body: JSON.stringify(payload)
|
|
258
|
-
}),
|
|
259
|
-
getAppReconcile: (appId, reconcileId) => request(`/v1/apps/${encodeURIComponent(appId)}/reconcile/${encodeURIComponent(reconcileId)}`, { method: "GET" }),
|
|
260
|
-
downloadAppReconcileBundle: (appId, reconcileId) => requestBinary(`/v1/apps/${encodeURIComponent(appId)}/reconcile/${encodeURIComponent(reconcileId)}/download.bundle`, {
|
|
261
|
-
method: "GET"
|
|
262
|
-
}),
|
|
263
|
-
syncLocalApp: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/sync-local`, {
|
|
264
|
-
method: "POST",
|
|
265
|
-
body: JSON.stringify(payload)
|
|
266
|
-
}),
|
|
267
|
-
initiateBundle: (appId, payload) => request(`/v1/apps/${encodeURIComponent(appId)}/bundles`, { method: "POST", body: JSON.stringify(payload) }),
|
|
268
|
-
getBundle: (appId, bundleId) => request(`/v1/apps/${encodeURIComponent(appId)}/bundles/${encodeURIComponent(bundleId)}`, { method: "GET" }),
|
|
269
|
-
getBundleDownloadUrl: (appId, bundleId, options) => request(
|
|
270
|
-
`/v1/apps/${encodeURIComponent(appId)}/bundles/${encodeURIComponent(bundleId)}/download?redirect=${options?.redirect ?? false}`,
|
|
271
|
-
{ method: "GET" }
|
|
272
|
-
),
|
|
273
|
-
getBundleAssetsDownloadUrl: (appId, bundleId, options) => {
|
|
274
|
-
const qs = new URLSearchParams({
|
|
275
|
-
redirect: String(options?.redirect ?? false),
|
|
276
|
-
kind: options?.kind ?? "metro-assets"
|
|
277
|
-
});
|
|
278
|
-
return request(
|
|
279
|
-
`/v1/apps/${encodeURIComponent(appId)}/bundles/${encodeURIComponent(bundleId)}/assets/download?${qs.toString()}`,
|
|
280
|
-
{ method: "GET" }
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
export {
|
|
287
|
-
createApiClient
|
|
288
|
-
};
|