@feedmepos/mf-miniprogram-v2 0.2.1-dev.8 → 0.2.2-dev.0
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/{AppTabs.vue_vue_type_script_setup_true_lang-C-UOi7TE.js → AppTabs.vue_vue_type_script_setup_true_lang-BKOXPYIU.js} +120 -110
- package/dist/{ControlPlaneView-CUD6naF1.js → ControlPlaneView-krmwG-w_.js} +5891 -5798
- package/dist/{ModuleCenterView-CYZJ97HU.js → ModuleCenterView-54GneqaO.js} +2 -2
- package/dist/{ModuleDetailView-CZ_2C-zj.js → ModuleDetailView-D5P-_5Ms.js} +2 -2
- package/dist/app.js +4 -4
- package/dist/package.json +1 -1
- package/dist/style.css +1 -1
- package/dist/{useModuleCatalog-CYsxGYLA.js → useModuleCatalog-CTgQG6Dx.js} +1 -1
- package/package.json +1 -1
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { useCoreStore as
|
|
2
|
-
import { defineComponent as
|
|
1
|
+
import { useCoreStore as l, FeedMeAuth as h } from "@feedmepos/mf-common";
|
|
2
|
+
import { defineComponent as $, computed as g, resolveComponent as w, openBlock as b, createElementBlock as k, createVNode as y, renderSlot as B } from "vue";
|
|
3
3
|
import "@feedmepos/ui-library";
|
|
4
|
-
import { useRouter as
|
|
5
|
-
const t = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
4
|
+
import { useRouter as C } from "vue-router";
|
|
5
|
+
const c = (e, s) => `/api/businesses/${e}/projects/${s}`, t = {
|
|
6
|
+
portalContext: (e) => `/api/businesses/${e}/portal-context`,
|
|
7
|
+
project: (e, s) => c(e, s),
|
|
8
|
+
provision: (e, s) => `${c(e, s)}/provision`,
|
|
9
|
+
refreshSlug: (e, s) => `${c(e, s)}/refresh-slug`,
|
|
10
|
+
sessions: (e, s) => `${c(e, s)}/sessions`,
|
|
11
|
+
session: (e, s, r) => `${c(e, s)}/sessions/${r}`,
|
|
12
|
+
messages: (e, s, r) => `${t.session(e, s, r)}/messages`,
|
|
13
|
+
startStatus: (e, s, r) => `${t.session(e, s, r)}/start-status`,
|
|
14
|
+
changes: (e, s, r, n = !1) => `${t.session(e, s, r)}/changes${n ? "?refresh=1" : ""}`,
|
|
15
|
+
checkpoints: (e, s, r) => `${t.session(e, s, r)}/checkpoints`,
|
|
16
|
+
aiBillingPreflight: (e, s, r) => `${t.session(e, s, r)}/ai-billing/preflight`,
|
|
17
|
+
restoreCheckpoint: (e, s, r, n) => `${t.checkpoints(e, s, r)}/${n}/restore`,
|
|
18
|
+
previewBridgeTicket: (e, s, r) => `${t.session(e, s, r)}/preview-bridge/ticket`,
|
|
19
|
+
previewBridgeSocket: (e, s, r) => `${t.session(e, s, r)}/preview-bridge/socket`,
|
|
20
|
+
uploads: (e, s, r, n = "") => `${t.session(e, s, r)}/uploads${n ? `?${n}` : ""}`,
|
|
21
|
+
archive: (e, s, r) => `${t.session(e, s, r)}/archive`,
|
|
22
|
+
commit: (e, s, r) => `${t.session(e, s, r)}/commit`,
|
|
23
|
+
resume: (e, s, r) => `${t.session(e, s, r)}/resume`,
|
|
24
|
+
restartPreview: (e, s, r) => `${t.session(e, s, r)}/restart-preview`,
|
|
25
|
+
fork: (e, s, r) => `${t.session(e, s, r)}/fork`,
|
|
26
|
+
flushEvents: (e, s, r) => `${t.session(e, s, r)}/events/flush`,
|
|
27
|
+
revertTurn: (e, s, r) => `${t.session(e, s, r)}/turns/revert`,
|
|
28
|
+
unrevertTurn: (e, s, r) => `${t.session(e, s, r)}/turns/unrevert`,
|
|
29
|
+
releases: (e, s) => `${c(e, s)}/releases`,
|
|
30
|
+
publishRelease: (e, s, r) => `${t.releases(e, s)}/${r}/publish`,
|
|
31
|
+
releasePreviewUrl: (e, s, r) => `${t.releases(e, s)}/${r}/preview-url`,
|
|
32
|
+
rollbackToRelease: (e, s, r) => `${c(e, s)}/rollback-to-release/${r}`,
|
|
33
|
+
rollbackToV1: (e, s) => `${c(e, s)}/rollback-to-v1`,
|
|
34
|
+
start: (e, s, r) => {
|
|
35
|
+
const n = new URLSearchParams();
|
|
36
|
+
e && n.set("businessId", e), s && n.set("projectId", s), r && n.set("sessionId", r);
|
|
37
|
+
const i = n.toString();
|
|
38
|
+
return `/api/start${i ? `?${i}` : ""}`;
|
|
38
39
|
},
|
|
39
40
|
opencode: (e = "") => `/api/opencode${e ? `/${e.replace(/^\/+/, "")}` : ""}`,
|
|
40
|
-
/** The shared component library's catalog. Deliberately not under
|
|
41
|
-
*
|
|
41
|
+
/** The shared component library's catalog. Deliberately not under a
|
|
42
|
+
* business/project path: the library belongs to no business, and the
|
|
42
43
|
* module centre is not inside a workspace. */
|
|
43
44
|
componentLibraryCatalog: () => "/api/component-library/catalog",
|
|
44
45
|
/** The self-contained preview document the module centre frames. Fetched with
|
|
@@ -47,7 +48,7 @@ const t = {
|
|
|
47
48
|
* which is what a signed URL would otherwise exist to work around. */
|
|
48
49
|
componentLibraryPreview: () => "/api/component-library/preview",
|
|
49
50
|
/** The application templates this environment can provision, for the portal's
|
|
50
|
-
* picker. Not under
|
|
51
|
+
* picker. Not under a business/project path: the answer is a property of
|
|
51
52
|
* the environment, and it is needed BEFORE a project exists. */
|
|
52
53
|
appTemplates: () => "/api/app-templates"
|
|
53
54
|
}, T = [
|
|
@@ -66,15 +67,15 @@ const t = {
|
|
|
66
67
|
"TH",
|
|
67
68
|
"VN"
|
|
68
69
|
];
|
|
69
|
-
function
|
|
70
|
+
function E(e) {
|
|
70
71
|
return typeof e == "string" && T.includes(e);
|
|
71
72
|
}
|
|
72
73
|
function U(e) {
|
|
73
74
|
if (typeof e != "string") return null;
|
|
74
75
|
const s = e.trim().toUpperCase();
|
|
75
|
-
return
|
|
76
|
+
return E(s) ? s : null;
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function S(e, s) {
|
|
78
79
|
const r = s === "MY" ? "" : `.${s.toLowerCase()}`, n = e === "dev" ? "-dev" : "", i = e === "dev" ? "https://portal.feedmedev.cc" : "https://portal.feedme.cc", o = e === "dev" ? "https://license.feedmedev.cc" : "https://license.feedme.cc";
|
|
79
80
|
return {
|
|
80
81
|
country: s,
|
|
@@ -85,11 +86,11 @@ function E(e, s) {
|
|
|
85
86
|
usageUrl: `${o}/token`
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
const n = new URL(
|
|
89
|
+
function X(e, s, r) {
|
|
90
|
+
const n = new URL(S(e, s).usageUrl);
|
|
90
91
|
return n.searchParams.set("businessId", r), n.searchParams.set("country", s), n.toString();
|
|
91
92
|
}
|
|
92
|
-
const
|
|
93
|
+
const P = "69cde0740c0106001ca83dff", N = {
|
|
93
94
|
dev: {
|
|
94
95
|
env: "dev",
|
|
95
96
|
liveDomain: "feedmedev.vip",
|
|
@@ -109,90 +110,98 @@ const S = "69cde0740c0106001ca83dff", P = {
|
|
|
109
110
|
v1Origin: "https://brand.feedme.vip"
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
|
-
function
|
|
113
|
+
function _(e) {
|
|
113
114
|
return e === "dev" || e === "prod";
|
|
114
115
|
}
|
|
115
116
|
function M(e) {
|
|
116
|
-
if (!
|
|
117
|
+
if (!_(e))
|
|
117
118
|
throw new Error(`MINIPROGRAM_ENV must be 'dev' or 'prod', got ${JSON.stringify(e)}`);
|
|
118
|
-
return
|
|
119
|
+
return N[e];
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function x(e) {
|
|
121
122
|
const s = e.toLowerCase().replace(/^fmmf:/, "");
|
|
122
123
|
return s === "prod" || s === "production" ? "prod" : "dev";
|
|
123
124
|
}
|
|
125
|
+
const D = /^[a-f0-9]{24}$/;
|
|
124
126
|
function R(e) {
|
|
127
|
+
return D.test(e);
|
|
128
|
+
}
|
|
129
|
+
function Z(e) {
|
|
130
|
+
if (!R(e)) throw new Error(`Invalid business id: ${e}`);
|
|
131
|
+
return `prj${e}`;
|
|
132
|
+
}
|
|
133
|
+
function O(e) {
|
|
125
134
|
return e.replace(/\/+$/, "");
|
|
126
135
|
}
|
|
127
|
-
function
|
|
128
|
-
return
|
|
136
|
+
function I() {
|
|
137
|
+
return O("https://miniprogram-v2-api.feedmedev.vip");
|
|
129
138
|
}
|
|
130
|
-
function
|
|
131
|
-
const s =
|
|
139
|
+
function A(e) {
|
|
140
|
+
const s = I();
|
|
132
141
|
return s ? `${s}${e.startsWith("/") ? e : `/${e}`}` : e;
|
|
133
142
|
}
|
|
134
|
-
function
|
|
135
|
-
return
|
|
143
|
+
function u() {
|
|
144
|
+
return l().currentBusiness.value;
|
|
136
145
|
}
|
|
137
|
-
function
|
|
146
|
+
function m() {
|
|
138
147
|
var e;
|
|
139
|
-
return ((e =
|
|
148
|
+
return ((e = u()) == null ? void 0 : e._id) ?? P;
|
|
140
149
|
}
|
|
141
|
-
function
|
|
150
|
+
function L() {
|
|
142
151
|
var e;
|
|
143
|
-
return ((e =
|
|
152
|
+
return ((e = u()) == null ? void 0 : e.url) ?? void 0;
|
|
144
153
|
}
|
|
145
|
-
function
|
|
154
|
+
function ee() {
|
|
146
155
|
var e;
|
|
147
|
-
return ((e =
|
|
156
|
+
return ((e = u()) == null ? void 0 : e.name) ?? m();
|
|
148
157
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
158
|
+
function F() {
|
|
159
|
+
return l().currentCountry.value;
|
|
151
160
|
}
|
|
152
|
-
function
|
|
161
|
+
function se() {
|
|
153
162
|
var n;
|
|
154
|
-
const e = (n =
|
|
163
|
+
const e = (n = L()) == null ? void 0 : n.trim().toLowerCase(), s = e && /^[a-z0-9-]+$/.test(e) ? e : m(), r = M(x("fmmf:dev")).liveDomain;
|
|
155
164
|
return `https://${s}.${r}`;
|
|
156
165
|
}
|
|
157
|
-
function
|
|
166
|
+
function j(e) {
|
|
158
167
|
return new Promise((s) => window.setTimeout(s, e));
|
|
159
168
|
}
|
|
160
|
-
function
|
|
169
|
+
function re(e) {
|
|
161
170
|
return e instanceof Error ? e.message : String(e);
|
|
162
171
|
}
|
|
163
|
-
class
|
|
172
|
+
class q extends Error {
|
|
164
173
|
constructor(s, r) {
|
|
165
174
|
super(r), this.status = s, this.body = r;
|
|
166
175
|
}
|
|
167
176
|
}
|
|
168
|
-
function
|
|
177
|
+
function p() {
|
|
169
178
|
var s;
|
|
170
|
-
return ((s =
|
|
179
|
+
return ((s = l().sessionUser.value) == null ? void 0 : s.token) || h.token || "";
|
|
171
180
|
}
|
|
172
|
-
async function
|
|
173
|
-
let e =
|
|
181
|
+
async function z() {
|
|
182
|
+
let e = p();
|
|
174
183
|
const s = Date.now() + 5e3;
|
|
175
184
|
for (; !e && Date.now() < s; )
|
|
176
|
-
await
|
|
185
|
+
await j(100), e = p();
|
|
177
186
|
return e ? `Bearer ${e}` : null;
|
|
178
187
|
}
|
|
179
|
-
async function
|
|
180
|
-
const r = new Request(e, s), n = await
|
|
188
|
+
async function V(e, s = {}) {
|
|
189
|
+
const r = new Request(e, s), n = await z();
|
|
181
190
|
n && r.headers.set("Authorization", n);
|
|
182
|
-
const i = U(
|
|
191
|
+
const i = U(F());
|
|
183
192
|
return i && r.headers.set("x-feedme-country", i), fetch(r);
|
|
184
193
|
}
|
|
185
|
-
async function
|
|
194
|
+
async function d(e, s = {}) {
|
|
186
195
|
const r = new Headers(s.headers);
|
|
187
196
|
s.body && !r.has("Content-Type") && r.set("Content-Type", "application/json");
|
|
188
197
|
const n = new AbortController(), i = window.setTimeout(() => n.abort(), 15e3);
|
|
189
198
|
try {
|
|
190
|
-
const o = await
|
|
199
|
+
const o = await V(A(e), {
|
|
191
200
|
...s,
|
|
192
201
|
headers: r,
|
|
193
202
|
signal: s.signal ?? n.signal
|
|
194
203
|
});
|
|
195
|
-
if (!o.ok) throw new
|
|
204
|
+
if (!o.ok) throw new q(o.status, await o.text());
|
|
196
205
|
return o;
|
|
197
206
|
} catch (o) {
|
|
198
207
|
throw o instanceof DOMException && o.name === "AbortError" ? new Error("Control-plane request timed out") : o;
|
|
@@ -200,13 +209,13 @@ async function m(e, s = {}) {
|
|
|
200
209
|
window.clearTimeout(i);
|
|
201
210
|
}
|
|
202
211
|
}
|
|
203
|
-
async function
|
|
204
|
-
return (await
|
|
212
|
+
async function ne(e, s = {}) {
|
|
213
|
+
return (await d(e, s)).json();
|
|
205
214
|
}
|
|
206
|
-
async function
|
|
207
|
-
return (await
|
|
215
|
+
async function te(e, s = {}) {
|
|
216
|
+
return (await d(e, s)).text();
|
|
208
217
|
}
|
|
209
|
-
const
|
|
218
|
+
const G = { class: "flex min-w-0 shrink-0 items-center gap-12 border-b border-fm-color-neutral-gray-100 bg-fm-color-neutral-white px-16" }, H = "miniprogram-v2-module-center", oe = /* @__PURE__ */ $({
|
|
210
219
|
__name: "AppTabs",
|
|
211
220
|
props: {
|
|
212
221
|
active: {},
|
|
@@ -214,15 +223,15 @@ const z = { class: "flex min-w-0 shrink-0 items-center gap-12 border-b border-fm
|
|
|
214
223
|
},
|
|
215
224
|
emits: ["select"],
|
|
216
225
|
setup(e, { emit: s }) {
|
|
217
|
-
const r = e, n = s, i =
|
|
226
|
+
const r = e, n = s, i = C(), o = g(() => [
|
|
218
227
|
{ label: "Workspace", value: "workspace", icon: "space_dashboard" },
|
|
219
228
|
{ label: "Releases", value: "releases", icon: "rocket_launch" },
|
|
220
229
|
...r.sessionCount == null ? [{ label: "Sessions", value: "sessions", icon: "history" }] : [{ label: "Sessions", value: "sessions", icon: "history", badge: r.sessionCount }],
|
|
221
230
|
{ label: "Module library", value: "modules", icon: "widgets" }
|
|
222
231
|
]);
|
|
223
|
-
function
|
|
232
|
+
function f(a) {
|
|
224
233
|
if (a === "modules") {
|
|
225
|
-
i.push({ name:
|
|
234
|
+
i.push({ name: H });
|
|
226
235
|
return;
|
|
227
236
|
}
|
|
228
237
|
if (!(a !== "workspace" && a !== "releases" && a !== "sessions")) {
|
|
@@ -236,39 +245,40 @@ const z = { class: "flex min-w-0 shrink-0 items-center gap-12 border-b border-fm
|
|
|
236
245
|
n("select", a);
|
|
237
246
|
}
|
|
238
247
|
}
|
|
239
|
-
return (a,
|
|
240
|
-
const
|
|
241
|
-
return
|
|
242
|
-
|
|
248
|
+
return (a, J) => {
|
|
249
|
+
const v = w("FmTabs");
|
|
250
|
+
return b(), k("header", G, [
|
|
251
|
+
y(v, {
|
|
243
252
|
class: "min-w-0 flex-1",
|
|
244
253
|
items: o.value,
|
|
245
254
|
"model-value": e.active,
|
|
246
|
-
"onUpdate:modelValue":
|
|
255
|
+
"onUpdate:modelValue": f
|
|
247
256
|
}, null, 8, ["items", "model-value"]),
|
|
248
|
-
|
|
257
|
+
B(a.$slots, "actions")
|
|
249
258
|
]);
|
|
250
259
|
};
|
|
251
260
|
}
|
|
252
261
|
});
|
|
253
262
|
export {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
263
|
+
q as C,
|
|
264
|
+
P as D,
|
|
265
|
+
oe as _,
|
|
257
266
|
M as a,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
267
|
+
x as b,
|
|
268
|
+
m as c,
|
|
269
|
+
V as d,
|
|
270
|
+
re as e,
|
|
271
|
+
A as f,
|
|
263
272
|
t as g,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
273
|
+
ne as h,
|
|
274
|
+
z as i,
|
|
275
|
+
L as j,
|
|
276
|
+
F as k,
|
|
277
|
+
Z as l,
|
|
278
|
+
ee as m,
|
|
270
279
|
U as n,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
280
|
+
X as o,
|
|
281
|
+
se as p,
|
|
282
|
+
te as q,
|
|
283
|
+
j as s
|
|
274
284
|
};
|