@burdenoff/microfe-devportal 2026.624.10 → 2026.624.12
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.
|
@@ -14,134 +14,168 @@ import { useDevportalPermission as c } from "../hooks/usePermission.js";
|
|
|
14
14
|
import "../hooks/index.js";
|
|
15
15
|
import ce from "../../node_modules/.bun/date-fns@3.6.0/node_modules/date-fns/format.js";
|
|
16
16
|
import { usePackageUpload as le } from "../hooks/usePackageUpload.js";
|
|
17
|
-
import { useCallback as
|
|
18
|
-
import { useI18n as
|
|
19
|
-
import { AlertCircle as
|
|
17
|
+
import { useCallback as l, useEffect as ue, useMemo as u, useRef as d, useState as f } from "react";
|
|
18
|
+
import { useI18n as de } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
19
|
+
import { AlertCircle as p, Archive as fe, CheckCircle as m, Clock as pe, FileJson as me, Loader2 as h, Package as he, Plus as ge, Upload as g } from "lucide-react";
|
|
20
20
|
import { useParams as _e } from "react-router-dom";
|
|
21
21
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
22
|
+
import { gql as ve } from "@apollo/client";
|
|
23
|
+
import { useMutation as ye, useQuery as be } from "@apollo/client/react";
|
|
22
24
|
//#region src/devportal/pages/ApplicationVersionsPage.tsx
|
|
23
|
-
var
|
|
24
|
-
let { t:
|
|
25
|
-
let n =
|
|
25
|
+
var xe = () => {
|
|
26
|
+
let { t: xe } = de(), b = (e, t) => {
|
|
27
|
+
let n = xe(e);
|
|
26
28
|
return n === e ? t : n;
|
|
27
|
-
}, { allowed:
|
|
29
|
+
}, { allowed: Se } = c(s.APP_VERSION_CREATE), { allowed: x } = c(s.APP_VERSION_PUBLISH), { allowed: S } = c(s.APP_VERSION_DEPRECATE), { appId: C } = _e(), { workspacesGatewayUrl: Ce, authToken: we, workspaceId: Te, getWorkspaceToken: Ee } = e(), { data: De } = be(ve`query MyPublisherProductsVersions { myPublisher { id products { id productId } } }`, { fetchPolicy: "cache-first" }), w = De?.myPublisher?.products.find((e) => e.productId === C)?.id ?? null, [Oe] = ye(ve`
|
|
30
|
+
mutation UpdateStoreProductVersion($input: UpdateProductInput!) {
|
|
31
|
+
updateProduct(input: $input) { id manifestVersion }
|
|
32
|
+
}
|
|
33
|
+
`), { upload: T, uploading: E, progress: D, error: O } = le(Ce, we, Te, Ee), k = d(null), A = d(null), [j, M] = f(!1), [N, P] = f({
|
|
28
34
|
version: "",
|
|
29
35
|
releaseNotes: "",
|
|
30
36
|
changelog: "",
|
|
31
37
|
packageUrl: "",
|
|
32
38
|
packageSize: "",
|
|
33
39
|
manifestJson: ""
|
|
34
|
-
}), [
|
|
40
|
+
}), [F, I] = f(null), [L, R] = f("file"), [ke, z] = f(null), [Ae, B] = f(null), [V, H] = f(/* @__PURE__ */ new Set()), [je, U] = f(null), { data: W } = ee({
|
|
35
41
|
variables: { id: C ?? "" },
|
|
36
42
|
skip: !C,
|
|
37
43
|
fetchPolicy: "cache-first"
|
|
38
|
-
}),
|
|
39
|
-
|
|
44
|
+
}), Me = W?.application?.appType === "NODE" || W?.application?.appType === "WORKFLOW";
|
|
45
|
+
ue(() => {
|
|
40
46
|
let e = W?.application?.name;
|
|
41
47
|
if (!C || !e) return;
|
|
42
48
|
let t = window.__breadcrumbRegistry;
|
|
43
49
|
return t?.register(C, e), () => t?.unregister(C);
|
|
44
50
|
}, [C, W?.application?.name]);
|
|
45
|
-
let { data: G, loading:
|
|
51
|
+
let { data: G, loading: Ne, error: Pe } = te({
|
|
46
52
|
variables: { applicationId: C },
|
|
47
53
|
skip: !C,
|
|
48
54
|
fetchPolicy: "cache-and-network"
|
|
49
|
-
}), [
|
|
50
|
-
if (!C || !
|
|
51
|
-
if (z(null),
|
|
52
|
-
if (!
|
|
55
|
+
}), [Fe, { loading: Ie }] = n({ refetchQueries: ["GetApplicationVersions"] }), [Le] = ne({ refetchQueries: ["GetApplicationVersions"] }), [K] = r({ refetchQueries: ["GetApplicationVersions"] }), q = u(() => G?.application?.versions?.edges?.map((e) => e.node) ?? [], [G?.application?.versions]), J = u(() => q.filter((e) => V.has(e.id)), [q, V]), Y = u(() => J.filter((e) => e.status?.toUpperCase() === "DRAFT"), [J]), X = u(() => J.filter((e) => e.status?.toUpperCase() === "PUBLISHED" && !e.isLatest), [J]), Z = q.length > 0 && q.every((e) => V.has(e.id)), Re = q.some((e) => V.has(e.id)) && !Z, ze = async () => {
|
|
56
|
+
if (!C || !N.version.trim()) return;
|
|
57
|
+
if (z(null), Me) {
|
|
58
|
+
if (!N.packageUrl) {
|
|
53
59
|
z("A ZIP package is required for this app type.");
|
|
54
60
|
return;
|
|
55
61
|
}
|
|
56
|
-
if (!
|
|
62
|
+
if (!N.manifestJson.trim()) {
|
|
57
63
|
z("A manifest JSON is required for this app type.");
|
|
58
64
|
return;
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
67
|
let e;
|
|
62
|
-
if (
|
|
63
|
-
e = JSON.parse(
|
|
68
|
+
if (N.manifestJson.trim()) try {
|
|
69
|
+
e = JSON.parse(N.manifestJson);
|
|
64
70
|
} catch {
|
|
65
71
|
z("Invalid JSON in manifest — please check your input.");
|
|
66
72
|
return;
|
|
67
73
|
}
|
|
68
74
|
try {
|
|
69
|
-
await
|
|
75
|
+
await Fe({ variables: {
|
|
70
76
|
applicationId: C,
|
|
71
77
|
input: {
|
|
72
|
-
version:
|
|
73
|
-
releaseNotes:
|
|
74
|
-
changelog:
|
|
75
|
-
packageUrl:
|
|
76
|
-
packageSize:
|
|
78
|
+
version: N.version,
|
|
79
|
+
releaseNotes: N.releaseNotes || void 0,
|
|
80
|
+
changelog: N.changelog || void 0,
|
|
81
|
+
packageUrl: N.packageUrl || void 0,
|
|
82
|
+
packageSize: N.packageSize || void 0,
|
|
77
83
|
manifest: e
|
|
78
84
|
}
|
|
79
|
-
} }),
|
|
85
|
+
} }), M(!1), P({
|
|
80
86
|
version: "",
|
|
81
87
|
releaseNotes: "",
|
|
82
88
|
changelog: "",
|
|
83
89
|
packageUrl: "",
|
|
84
90
|
packageSize: "",
|
|
85
91
|
manifestJson: ""
|
|
86
|
-
}),
|
|
92
|
+
}), I(null), R("file"), B(b("devportal.versionCreatedSuccess", "Version created successfully"));
|
|
87
93
|
} catch (e) {
|
|
88
94
|
z(e instanceof Error ? e.message : b("devportal.versionCreateFailed", "Failed to create version"));
|
|
89
95
|
}
|
|
90
|
-
},
|
|
96
|
+
}, Be = l(async (e) => {
|
|
91
97
|
let t = e.target.files?.[0];
|
|
92
98
|
if (t) {
|
|
93
99
|
e.target.value = "";
|
|
94
100
|
try {
|
|
95
|
-
let e = await
|
|
96
|
-
|
|
101
|
+
let e = await T(t);
|
|
102
|
+
P((n) => ({
|
|
97
103
|
...n,
|
|
98
104
|
packageUrl: e.downloadUrl,
|
|
99
105
|
packageSize: String(t.size)
|
|
100
106
|
}));
|
|
101
107
|
} catch {}
|
|
102
108
|
}
|
|
103
|
-
}, [
|
|
109
|
+
}, [T]), Ve = l((e) => {
|
|
104
110
|
let t = e.target.files?.[0];
|
|
105
111
|
if (!t) return;
|
|
106
112
|
e.target.value = "";
|
|
107
113
|
let n = new FileReader();
|
|
108
114
|
n.onload = (e) => {
|
|
109
115
|
let n = e.target?.result;
|
|
110
|
-
typeof n == "string" && (
|
|
116
|
+
typeof n == "string" && (I(t.name), P((e) => ({
|
|
111
117
|
...e,
|
|
112
118
|
manifestJson: n
|
|
113
119
|
})));
|
|
114
120
|
}, n.readAsText(t);
|
|
115
|
-
}, []),
|
|
121
|
+
}, []), He = async (e) => {
|
|
116
122
|
z(null), B(null);
|
|
117
123
|
try {
|
|
118
|
-
await
|
|
124
|
+
if (await Le({ variables: { id: e } }), w) {
|
|
125
|
+
let t = q.find((t) => t.id === e);
|
|
126
|
+
t && await Oe({ variables: { input: {
|
|
127
|
+
id: w,
|
|
128
|
+
manifestVersion: t.version,
|
|
129
|
+
manifest: {
|
|
130
|
+
manifestVersion: "1.0",
|
|
131
|
+
name: W?.application?.slug ?? "",
|
|
132
|
+
version: t.version,
|
|
133
|
+
itemType: W?.application?.appType?.toLowerCase() ?? "node",
|
|
134
|
+
identity: {
|
|
135
|
+
name: W?.application?.slug ?? "",
|
|
136
|
+
version: t.version,
|
|
137
|
+
displayName: W?.application?.name ?? "",
|
|
138
|
+
description: W?.application?.shortDescription ?? W?.application?.description ?? ""
|
|
139
|
+
},
|
|
140
|
+
publisher: {
|
|
141
|
+
id: W?.application?.developerId ?? "",
|
|
142
|
+
name: "Burdenoff"
|
|
143
|
+
},
|
|
144
|
+
pricing: {
|
|
145
|
+
currency: "USD",
|
|
146
|
+
model: "FREE"
|
|
147
|
+
},
|
|
148
|
+
permissions: []
|
|
149
|
+
}
|
|
150
|
+
} } }).catch(() => {});
|
|
151
|
+
}
|
|
152
|
+
B(b("devportal.versionPublishedSuccess", "Version published successfully"));
|
|
119
153
|
} catch (e) {
|
|
120
154
|
z(e instanceof Error ? e.message : b("devportal.versionPublishFailed", "Failed to publish version"));
|
|
121
155
|
}
|
|
122
|
-
},
|
|
156
|
+
}, Ue = async (e) => {
|
|
123
157
|
z(null), B(null);
|
|
124
158
|
try {
|
|
125
|
-
await
|
|
159
|
+
await K({ variables: { id: e } }), B(b("devportal.versionDeprecatedSuccess", "Version deprecated successfully"));
|
|
126
160
|
} catch (e) {
|
|
127
161
|
z(e instanceof Error ? e.message : b("devportal.versionDeprecateFailed", "Failed to deprecate version"));
|
|
128
162
|
}
|
|
129
|
-
},
|
|
163
|
+
}, We = (e) => {
|
|
130
164
|
let t = e.status?.toUpperCase();
|
|
131
|
-
return t === "PUBLISHED" && e.isLatest ? /* @__PURE__ */ v(
|
|
165
|
+
return t === "PUBLISHED" && e.isLatest ? /* @__PURE__ */ v(m, {
|
|
132
166
|
size: 16,
|
|
133
167
|
className: "text-status-success-text"
|
|
134
|
-
}) : t === "DRAFT" ? /* @__PURE__ */ v(
|
|
168
|
+
}) : t === "DRAFT" ? /* @__PURE__ */ v(pe, {
|
|
135
169
|
size: 16,
|
|
136
170
|
className: "text-status-warning-text"
|
|
137
|
-
}) : t === "DEPRECATED" ? /* @__PURE__ */ v(
|
|
171
|
+
}) : t === "DEPRECATED" ? /* @__PURE__ */ v(fe, {
|
|
138
172
|
size: 16,
|
|
139
173
|
className: "text-text-secondary"
|
|
140
174
|
}) : /* @__PURE__ */ v(he, {
|
|
141
175
|
size: 16,
|
|
142
176
|
className: "text-accent-blue"
|
|
143
177
|
});
|
|
144
|
-
},
|
|
178
|
+
}, Ge = (e, t) => {
|
|
145
179
|
H((n) => {
|
|
146
180
|
let r = new Set(n);
|
|
147
181
|
return t ? r.add(e) : r.delete(e), r;
|
|
@@ -149,12 +183,12 @@ var ve = () => {
|
|
|
149
183
|
}, Q = (e) => {
|
|
150
184
|
H((t) => {
|
|
151
185
|
let n = new Set(t);
|
|
152
|
-
return
|
|
186
|
+
return q.forEach((t) => {
|
|
153
187
|
e ? n.add(t.id) : n.delete(t.id);
|
|
154
188
|
}), n;
|
|
155
189
|
});
|
|
156
190
|
}, $ = () => H(/* @__PURE__ */ new Set());
|
|
157
|
-
return
|
|
191
|
+
return Ne && !G ? /* @__PURE__ */ v(i, {
|
|
158
192
|
title: b("devportal.versionManagement", "Version Management"),
|
|
159
193
|
description: b("devportal.versionManagementDescription", "Manage your application versions"),
|
|
160
194
|
backLink: `/apps/${C}`,
|
|
@@ -163,18 +197,18 @@ var ve = () => {
|
|
|
163
197
|
className: "flex items-center justify-center py-16",
|
|
164
198
|
children: /* @__PURE__ */ v(h, { className: "h-8 w-8 animate-spin text-muted-foreground" })
|
|
165
199
|
})
|
|
166
|
-
}) :
|
|
200
|
+
}) : Pe && !G ? /* @__PURE__ */ v(i, {
|
|
167
201
|
title: b("devportal.versionManagement", "Version Management"),
|
|
168
202
|
description: b("devportal.versionManagementDescription", "Manage your application versions"),
|
|
169
203
|
backLink: `/apps/${C}`,
|
|
170
204
|
backLabel: b("devportal.backToApplication", "Back to Application"),
|
|
171
205
|
children: /* @__PURE__ */ v(t, {
|
|
172
|
-
icon: /* @__PURE__ */ v(
|
|
206
|
+
icon: /* @__PURE__ */ v(p, {
|
|
173
207
|
size: 32,
|
|
174
208
|
className: "text-status-error-text"
|
|
175
209
|
}),
|
|
176
210
|
title: b("devportal.failedToLoadVersions", "Failed to load versions"),
|
|
177
|
-
description:
|
|
211
|
+
description: Pe.message || b("devportal.versionsLoadError", "An error occurred while loading versions")
|
|
178
212
|
})
|
|
179
213
|
}) : /* @__PURE__ */ v(se, {
|
|
180
214
|
permission: s.APP_READ,
|
|
@@ -184,21 +218,21 @@ var ve = () => {
|
|
|
184
218
|
backLink: `/apps/${C}`,
|
|
185
219
|
backLabel: b("devportal.backToApplication", "Back to Application"),
|
|
186
220
|
actions: /* @__PURE__ */ y("button", {
|
|
187
|
-
onClick: () =>
|
|
188
|
-
disabled: !
|
|
189
|
-
"aria-disabled": !
|
|
221
|
+
onClick: () => M(!0),
|
|
222
|
+
disabled: !Se,
|
|
223
|
+
"aria-disabled": !Se,
|
|
190
224
|
className: "inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
|
|
191
225
|
children: [/* @__PURE__ */ v(ge, { size: 16 }), b("devportal.newVersion", "New Version")]
|
|
192
226
|
}),
|
|
193
227
|
children: [
|
|
194
|
-
|
|
228
|
+
ke && /* @__PURE__ */ y("div", {
|
|
195
229
|
className: "rounded-lg border border-border-subtle bg-status-error-bg-subtle p-3 flex items-center gap-2 text-sm text-status-error-text",
|
|
196
230
|
children: [
|
|
197
|
-
/* @__PURE__ */ v(
|
|
231
|
+
/* @__PURE__ */ v(p, {
|
|
198
232
|
size: 16,
|
|
199
233
|
className: "flex-shrink-0"
|
|
200
234
|
}),
|
|
201
|
-
|
|
235
|
+
ke,
|
|
202
236
|
/* @__PURE__ */ v("button", {
|
|
203
237
|
onClick: () => z(null),
|
|
204
238
|
className: "ml-auto text-status-error-text hover:text-status-error-text",
|
|
@@ -206,14 +240,14 @@ var ve = () => {
|
|
|
206
240
|
})
|
|
207
241
|
]
|
|
208
242
|
}),
|
|
209
|
-
|
|
243
|
+
Ae && /* @__PURE__ */ y("div", {
|
|
210
244
|
className: "rounded-lg border border-border-subtle bg-status-success-bg-subtle p-3 flex items-center gap-2 text-sm text-status-success-text",
|
|
211
245
|
children: [
|
|
212
|
-
/* @__PURE__ */ v(
|
|
246
|
+
/* @__PURE__ */ v(m, {
|
|
213
247
|
size: 16,
|
|
214
248
|
className: "flex-shrink-0"
|
|
215
249
|
}),
|
|
216
|
-
|
|
250
|
+
Ae,
|
|
217
251
|
/* @__PURE__ */ v("button", {
|
|
218
252
|
onClick: () => B(null),
|
|
219
253
|
className: "ml-auto text-status-success-text hover:text-status-success-text",
|
|
@@ -221,7 +255,7 @@ var ve = () => {
|
|
|
221
255
|
})
|
|
222
256
|
]
|
|
223
257
|
}),
|
|
224
|
-
|
|
258
|
+
q.length > 0 && /* @__PURE__ */ v("div", {
|
|
225
259
|
className: "rounded-lg border bg-card p-4",
|
|
226
260
|
children: /* @__PURE__ */ y("div", {
|
|
227
261
|
className: "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
|
|
@@ -230,8 +264,8 @@ var ve = () => {
|
|
|
230
264
|
children: [/* @__PURE__ */ y("div", {
|
|
231
265
|
className: "flex items-center gap-2",
|
|
232
266
|
children: [/* @__PURE__ */ v(a, {
|
|
233
|
-
checked:
|
|
234
|
-
indeterminate:
|
|
267
|
+
checked: Z,
|
|
268
|
+
indeterminate: Re,
|
|
235
269
|
onChange: Q,
|
|
236
270
|
ariaLabel: "Select all visible versions"
|
|
237
271
|
}), /* @__PURE__ */ v("span", {
|
|
@@ -252,31 +286,31 @@ var ve = () => {
|
|
|
252
286
|
}),
|
|
253
287
|
/* @__PURE__ */ y("button", {
|
|
254
288
|
onClick: () => U("publish"),
|
|
255
|
-
disabled:
|
|
289
|
+
disabled: Y.length === 0 || !x,
|
|
256
290
|
"aria-disabled": !x,
|
|
257
291
|
className: "rounded-md border border-status-success-bg px-3 py-2 text-sm font-medium text-status-success-text hover:bg-status-success-bg-subtle disabled:cursor-not-allowed disabled:opacity-50",
|
|
258
|
-
children: [b("devportal.publishSelected", "Publish Selected"),
|
|
292
|
+
children: [b("devportal.publishSelected", "Publish Selected"), Y.length > 0 ? ` (${Y.length})` : ""]
|
|
259
293
|
}),
|
|
260
294
|
/* @__PURE__ */ y("button", {
|
|
261
295
|
onClick: () => U("deprecate"),
|
|
262
|
-
disabled:
|
|
296
|
+
disabled: X.length === 0 || !S,
|
|
263
297
|
"aria-disabled": !S,
|
|
264
298
|
className: "rounded-md border border-status-warning-bg px-3 py-2 text-sm font-medium text-status-warning-text hover:bg-status-warning-bg-subtle disabled:cursor-not-allowed disabled:opacity-50",
|
|
265
|
-
children: [b("devportal.deprecateSelected", "Deprecate Selected"),
|
|
299
|
+
children: [b("devportal.deprecateSelected", "Deprecate Selected"), X.length > 0 ? ` (${X.length})` : ""]
|
|
266
300
|
})
|
|
267
301
|
]
|
|
268
302
|
})]
|
|
269
303
|
})
|
|
270
304
|
}),
|
|
271
|
-
|
|
272
|
-
data:
|
|
305
|
+
q.length > 0 ? /* @__PURE__ */ v(ie, {
|
|
306
|
+
data: q,
|
|
273
307
|
keyField: "id",
|
|
274
308
|
columns: [
|
|
275
309
|
{
|
|
276
310
|
key: "select",
|
|
277
311
|
header: /* @__PURE__ */ v(a, {
|
|
278
|
-
checked:
|
|
279
|
-
indeterminate:
|
|
312
|
+
checked: Z,
|
|
313
|
+
indeterminate: Re,
|
|
280
314
|
onChange: Q,
|
|
281
315
|
ariaLabel: "Select all visible versions"
|
|
282
316
|
}),
|
|
@@ -285,7 +319,7 @@ var ve = () => {
|
|
|
285
319
|
onClick: (e) => e.stopPropagation(),
|
|
286
320
|
children: /* @__PURE__ */ v(a, {
|
|
287
321
|
checked: V.has(e.id),
|
|
288
|
-
onChange: (t) =>
|
|
322
|
+
onChange: (t) => Ge(e.id, t),
|
|
289
323
|
ariaLabel: `Select version ${e.version}`
|
|
290
324
|
})
|
|
291
325
|
})
|
|
@@ -296,7 +330,7 @@ var ve = () => {
|
|
|
296
330
|
render: (e) => /* @__PURE__ */ y("div", {
|
|
297
331
|
className: "flex items-center gap-2",
|
|
298
332
|
children: [
|
|
299
|
-
|
|
333
|
+
We(e),
|
|
300
334
|
/* @__PURE__ */ v("span", {
|
|
301
335
|
className: "font-mono font-medium",
|
|
302
336
|
children: e.version
|
|
@@ -340,13 +374,13 @@ var ve = () => {
|
|
|
340
374
|
className: "text-xs text-primary hover:underline disabled:opacity-50",
|
|
341
375
|
disabled: !x,
|
|
342
376
|
"aria-disabled": !x,
|
|
343
|
-
onClick: () =>
|
|
377
|
+
onClick: () => He(e.id),
|
|
344
378
|
children: b("devportal.publish", "Publish")
|
|
345
379
|
}), e.status?.toUpperCase() === "PUBLISHED" && !e.isLatest && /* @__PURE__ */ v("button", {
|
|
346
380
|
className: "text-xs text-status-warning-text hover:underline disabled:opacity-50",
|
|
347
381
|
disabled: !S,
|
|
348
382
|
"aria-disabled": !S,
|
|
349
|
-
onClick: () =>
|
|
383
|
+
onClick: () => Ue(e.id),
|
|
350
384
|
children: b("devportal.deprecate", "Deprecate")
|
|
351
385
|
})]
|
|
352
386
|
})
|
|
@@ -357,33 +391,33 @@ var ve = () => {
|
|
|
357
391
|
title: b("devportal.noVersionsYet", "No versions yet"),
|
|
358
392
|
description: b("devportal.noVersionsYetDescription", "Create your first version to start distributing your app"),
|
|
359
393
|
action: /* @__PURE__ */ y("button", {
|
|
360
|
-
onClick: () =>
|
|
394
|
+
onClick: () => M(!0),
|
|
361
395
|
className: "inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
|
|
362
396
|
children: [/* @__PURE__ */ v(ge, { size: 16 }), b("devportal.createVersion", "Create Version")]
|
|
363
397
|
})
|
|
364
398
|
}),
|
|
365
|
-
|
|
366
|
-
open:
|
|
367
|
-
onOpenChange:
|
|
368
|
-
onConfirm:
|
|
399
|
+
j && /* @__PURE__ */ v(o, {
|
|
400
|
+
open: j,
|
|
401
|
+
onOpenChange: M,
|
|
402
|
+
onConfirm: ze,
|
|
369
403
|
title: b("devportal.createNewVersion", "Create New Version"),
|
|
370
404
|
size: "lg",
|
|
371
|
-
confirmLabel:
|
|
405
|
+
confirmLabel: Ie ? b("devportal.creating", "Creating...") : b("devportal.createVersion", "Create Version"),
|
|
372
406
|
children: /* @__PURE__ */ y("div", {
|
|
373
407
|
className: "space-y-4",
|
|
374
408
|
children: [
|
|
375
409
|
/* @__PURE__ */ v(ae, {
|
|
376
410
|
label: b("devportal.versionNumber", "Version Number"),
|
|
377
|
-
value:
|
|
378
|
-
onChange: (e) =>
|
|
379
|
-
...
|
|
411
|
+
value: N.version,
|
|
412
|
+
onChange: (e) => P({
|
|
413
|
+
...N,
|
|
380
414
|
version: e.target.value
|
|
381
415
|
}),
|
|
382
416
|
placeholder: "e.g., 2.2.0",
|
|
383
417
|
hint: b("devportal.versionHint", "Use semantic versioning (major.minor.patch)"),
|
|
384
418
|
required: !0
|
|
385
419
|
}),
|
|
386
|
-
|
|
420
|
+
Me ? /* @__PURE__ */ y("div", {
|
|
387
421
|
className: "space-y-3",
|
|
388
422
|
children: [
|
|
389
423
|
/* @__PURE__ */ v("div", {
|
|
@@ -404,41 +438,41 @@ var ve = () => {
|
|
|
404
438
|
className: "flex gap-2 items-center",
|
|
405
439
|
children: [
|
|
406
440
|
/* @__PURE__ */ v("input", {
|
|
407
|
-
ref:
|
|
441
|
+
ref: k,
|
|
408
442
|
type: "file",
|
|
409
443
|
accept: ".zip",
|
|
410
444
|
className: "hidden",
|
|
411
|
-
onChange:
|
|
445
|
+
onChange: Be
|
|
412
446
|
}),
|
|
413
447
|
/* @__PURE__ */ v("button", {
|
|
414
448
|
type: "button",
|
|
415
|
-
disabled:
|
|
416
|
-
onClick: () =>
|
|
449
|
+
disabled: E,
|
|
450
|
+
onClick: () => k.current?.click(),
|
|
417
451
|
className: "inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm font-medium hover:bg-muted transition-colors disabled:opacity-50",
|
|
418
|
-
children:
|
|
452
|
+
children: E ? /* @__PURE__ */ y(_, { children: [
|
|
419
453
|
/* @__PURE__ */ v(h, {
|
|
420
454
|
size: 14,
|
|
421
455
|
className: "animate-spin"
|
|
422
456
|
}),
|
|
423
457
|
" ",
|
|
424
458
|
"Uploading… ",
|
|
425
|
-
|
|
459
|
+
D,
|
|
426
460
|
"%"
|
|
427
461
|
] }) : /* @__PURE__ */ y(_, { children: [
|
|
428
462
|
/* @__PURE__ */ v(g, { size: 14 }),
|
|
429
463
|
" ",
|
|
430
|
-
|
|
464
|
+
N.packageUrl ? "Replace zip" : "Upload zip"
|
|
431
465
|
] })
|
|
432
466
|
}),
|
|
433
|
-
|
|
467
|
+
N.packageUrl && !E && /* @__PURE__ */ v("span", {
|
|
434
468
|
className: "text-xs text-status-success-text",
|
|
435
469
|
children: "✓ Uploaded"
|
|
436
470
|
})
|
|
437
471
|
]
|
|
438
472
|
}),
|
|
439
|
-
|
|
473
|
+
O && /* @__PURE__ */ v("p", {
|
|
440
474
|
className: "text-xs text-destructive",
|
|
441
|
-
children:
|
|
475
|
+
children: O
|
|
442
476
|
})
|
|
443
477
|
]
|
|
444
478
|
}),
|
|
@@ -453,27 +487,27 @@ var ve = () => {
|
|
|
453
487
|
})]
|
|
454
488
|
}),
|
|
455
489
|
/* @__PURE__ */ v("input", {
|
|
456
|
-
ref:
|
|
490
|
+
ref: A,
|
|
457
491
|
type: "file",
|
|
458
492
|
accept: ".json,application/json",
|
|
459
493
|
className: "hidden",
|
|
460
|
-
onChange:
|
|
494
|
+
onChange: Ve
|
|
461
495
|
}),
|
|
462
496
|
/* @__PURE__ */ y("div", {
|
|
463
497
|
className: "flex gap-2 items-center",
|
|
464
498
|
children: [/* @__PURE__ */ y("button", {
|
|
465
499
|
type: "button",
|
|
466
|
-
onClick: () =>
|
|
500
|
+
onClick: () => A.current?.click(),
|
|
467
501
|
className: "inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm font-medium hover:bg-muted transition-colors",
|
|
468
|
-
children: [/* @__PURE__ */ v(
|
|
469
|
-
}),
|
|
502
|
+
children: [/* @__PURE__ */ v(me, { size: 14 }), F ? "Replace manifest.json" : "Upload manifest.json"]
|
|
503
|
+
}), F && /* @__PURE__ */ y("span", {
|
|
470
504
|
className: "text-xs text-status-success-text",
|
|
471
|
-
children: ["✓ ",
|
|
505
|
+
children: ["✓ ", F]
|
|
472
506
|
})]
|
|
473
507
|
}),
|
|
474
|
-
|
|
508
|
+
F && N.manifestJson && (() => {
|
|
475
509
|
try {
|
|
476
|
-
let e = JSON.parse(
|
|
510
|
+
let e = JSON.parse(N.manifestJson), t = typeof e.name == "string" ? e.name : null, n = typeof e.version == "string" ? e.version : null, r = typeof e.itemType == "string" ? e.itemType : null;
|
|
477
511
|
return /* @__PURE__ */ y("div", {
|
|
478
512
|
className: "rounded-md border bg-muted/40 px-3 py-2 text-xs font-mono space-y-0.5",
|
|
479
513
|
children: [
|
|
@@ -513,66 +547,66 @@ var ve = () => {
|
|
|
513
547
|
className: "flex gap-1 rounded-md border p-0.5 w-fit",
|
|
514
548
|
children: [/* @__PURE__ */ y("button", {
|
|
515
549
|
type: "button",
|
|
516
|
-
onClick: () =>
|
|
517
|
-
className: `inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs font-medium transition-colors ${
|
|
550
|
+
onClick: () => R("file"),
|
|
551
|
+
className: `inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs font-medium transition-colors ${L === "file" ? "bg-primary text-primary-foreground" : "hover:bg-muted"}`,
|
|
518
552
|
children: [/* @__PURE__ */ v(g, { size: 12 }), " Upload zip"]
|
|
519
553
|
}), /* @__PURE__ */ y("button", {
|
|
520
554
|
type: "button",
|
|
521
|
-
onClick: () =>
|
|
522
|
-
className: `inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs font-medium transition-colors ${
|
|
523
|
-
children: [/* @__PURE__ */ v(
|
|
555
|
+
onClick: () => R("manifest"),
|
|
556
|
+
className: `inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs font-medium transition-colors ${L === "manifest" ? "bg-primary text-primary-foreground" : "hover:bg-muted"}`,
|
|
557
|
+
children: [/* @__PURE__ */ v(me, { size: 12 }), " Paste manifest JSON"]
|
|
524
558
|
})]
|
|
525
559
|
}),
|
|
526
|
-
|
|
560
|
+
L === "file" && /* @__PURE__ */ y("div", {
|
|
527
561
|
className: "space-y-1",
|
|
528
562
|
children: [/* @__PURE__ */ y("div", {
|
|
529
563
|
className: "flex gap-2 items-center",
|
|
530
564
|
children: [
|
|
531
565
|
/* @__PURE__ */ v("input", {
|
|
532
|
-
ref:
|
|
566
|
+
ref: k,
|
|
533
567
|
type: "file",
|
|
534
568
|
accept: ".zip",
|
|
535
569
|
className: "hidden",
|
|
536
|
-
onChange:
|
|
570
|
+
onChange: Be
|
|
537
571
|
}),
|
|
538
572
|
/* @__PURE__ */ v("button", {
|
|
539
573
|
type: "button",
|
|
540
|
-
disabled:
|
|
541
|
-
onClick: () =>
|
|
574
|
+
disabled: E,
|
|
575
|
+
onClick: () => k.current?.click(),
|
|
542
576
|
className: "inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm font-medium hover:bg-muted transition-colors disabled:opacity-50",
|
|
543
|
-
children:
|
|
577
|
+
children: E ? /* @__PURE__ */ y(_, { children: [
|
|
544
578
|
/* @__PURE__ */ v(h, {
|
|
545
579
|
size: 14,
|
|
546
580
|
className: "animate-spin"
|
|
547
581
|
}),
|
|
548
582
|
" ",
|
|
549
583
|
"Uploading… ",
|
|
550
|
-
|
|
584
|
+
D,
|
|
551
585
|
"%"
|
|
552
586
|
] }) : /* @__PURE__ */ y(_, { children: [
|
|
553
587
|
/* @__PURE__ */ v(g, { size: 14 }),
|
|
554
588
|
" ",
|
|
555
|
-
|
|
589
|
+
N.packageUrl ? "Replace zip" : "Upload zip"
|
|
556
590
|
] })
|
|
557
591
|
}),
|
|
558
|
-
|
|
592
|
+
N.packageUrl && !E && /* @__PURE__ */ v("span", {
|
|
559
593
|
className: "text-xs text-status-success-text",
|
|
560
594
|
children: "✓ Uploaded"
|
|
561
595
|
})
|
|
562
596
|
]
|
|
563
|
-
}),
|
|
597
|
+
}), O && /* @__PURE__ */ v("p", {
|
|
564
598
|
className: "text-xs text-destructive",
|
|
565
|
-
children:
|
|
599
|
+
children: O
|
|
566
600
|
})]
|
|
567
601
|
}),
|
|
568
|
-
|
|
602
|
+
L === "manifest" && /* @__PURE__ */ y("div", {
|
|
569
603
|
className: "space-y-1",
|
|
570
604
|
children: [/* @__PURE__ */ v("textarea", {
|
|
571
605
|
rows: 6,
|
|
572
606
|
placeholder: "{\n \"name\": \"my-workflow\",\n \"version\": \"1.0.0\",\n \"steps\": []\n}",
|
|
573
|
-
value:
|
|
574
|
-
onChange: (e) =>
|
|
575
|
-
...
|
|
607
|
+
value: N.manifestJson,
|
|
608
|
+
onChange: (e) => P({
|
|
609
|
+
...N,
|
|
576
610
|
manifestJson: e.target.value
|
|
577
611
|
}),
|
|
578
612
|
className: "w-full rounded-md border bg-transparent px-3 py-2 text-xs font-mono resize-y placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"
|
|
@@ -585,9 +619,9 @@ var ve = () => {
|
|
|
585
619
|
}),
|
|
586
620
|
/* @__PURE__ */ v(oe, {
|
|
587
621
|
label: b("devportal.releaseNotes", "Release Notes"),
|
|
588
|
-
value:
|
|
589
|
-
onChange: (e) =>
|
|
590
|
-
...
|
|
622
|
+
value: N.releaseNotes,
|
|
623
|
+
onChange: (e) => P({
|
|
624
|
+
...N,
|
|
591
625
|
releaseNotes: e.target.value
|
|
592
626
|
}),
|
|
593
627
|
placeholder: b("devportal.releaseNotesPlaceholder", "What changed in this release?"),
|
|
@@ -597,35 +631,35 @@ var ve = () => {
|
|
|
597
631
|
})
|
|
598
632
|
}),
|
|
599
633
|
/* @__PURE__ */ v(o, {
|
|
600
|
-
open:
|
|
634
|
+
open: je === "publish",
|
|
601
635
|
onOpenChange: (e) => {
|
|
602
636
|
e || U(null);
|
|
603
637
|
},
|
|
604
638
|
onConfirm: async () => {
|
|
605
|
-
if (
|
|
639
|
+
if (Y.length === 0) return;
|
|
606
640
|
z(null);
|
|
607
|
-
let e = await Promise.allSettled(
|
|
641
|
+
let e = await Promise.allSettled(Y.map((e) => Le({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
|
|
608
642
|
B(`Published ${t} version${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`), $(), U(null);
|
|
609
643
|
},
|
|
610
644
|
title: b("devportal.publishSelectedVersions", "Publish selected versions"),
|
|
611
|
-
description: `${b("devportal.publish", "Publish")} ${
|
|
645
|
+
description: `${b("devportal.publish", "Publish")} ${Y.length} selected version${Y.length === 1 ? "" : "s"}?`,
|
|
612
646
|
confirmLabel: b("devportal.publish", "Publish"),
|
|
613
647
|
cancelLabel: b("devportal.cancel", "Cancel"),
|
|
614
648
|
variant: "success"
|
|
615
649
|
}),
|
|
616
650
|
/* @__PURE__ */ v(o, {
|
|
617
|
-
open:
|
|
651
|
+
open: je === "deprecate",
|
|
618
652
|
onOpenChange: (e) => {
|
|
619
653
|
e || U(null);
|
|
620
654
|
},
|
|
621
655
|
onConfirm: async () => {
|
|
622
|
-
if (
|
|
656
|
+
if (X.length === 0) return;
|
|
623
657
|
z(null);
|
|
624
|
-
let e = await Promise.allSettled(
|
|
658
|
+
let e = await Promise.allSettled(X.map((e) => K({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
|
|
625
659
|
B(`Deprecated ${t} version${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`), $(), U(null);
|
|
626
660
|
},
|
|
627
661
|
title: b("devportal.deprecateSelectedVersions", "Deprecate selected versions"),
|
|
628
|
-
description: `${b("devportal.deprecate", "Deprecate")} ${
|
|
662
|
+
description: `${b("devportal.deprecate", "Deprecate")} ${X.length} selected version${X.length === 1 ? "" : "s"}? ${b("devportal.deprecateVersionsWarning", "Deprecated versions remain visible but should no longer be promoted.")}`,
|
|
629
663
|
confirmLabel: b("devportal.deprecate", "Deprecate"),
|
|
630
664
|
cancelLabel: b("devportal.cancel", "Cancel"),
|
|
631
665
|
variant: "warning"
|
|
@@ -635,6 +669,6 @@ var ve = () => {
|
|
|
635
669
|
});
|
|
636
670
|
};
|
|
637
671
|
//#endregion
|
|
638
|
-
export {
|
|
672
|
+
export { xe as ApplicationVersionsPage };
|
|
639
673
|
|
|
640
674
|
//# sourceMappingURL=ApplicationVersionsPage.js.map
|