@feedmepos/mf-miniprogram-v2 0.2.2-dev.0 → 0.2.2-dev.10
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/App-agMiJ0tU.js +197 -0
- package/dist/AppTemplatePicker-C0lZyhK2.js +184 -0
- package/dist/BrandFontPicker-BFjp8k2W.js +241 -0
- package/dist/BrandKitView-DUbIT3c8.js +249 -0
- package/dist/{ControlPlaneView-krmwG-w_.js → ControlPlaneView-BJ6QP0bK.js} +8181 -7959
- package/dist/EcosystemView-BgjtBJy_.js +186 -0
- package/dist/LegacyWorkspaceEntry-opz_kWz9.js +36 -0
- package/dist/MobileProjectsView-DAWuOiCr.js +279 -0
- package/dist/ModuleCenterView-DyMr3iWV.js +147 -0
- package/dist/{ModuleDetailView-D5P-_5Ms.js → ModuleDetailView-BeXK89Cs.js} +71 -73
- package/dist/PagesView-CegMd6GC.js +43 -0
- package/dist/PlatformUnavailableView-j0_2YBKm.js +40 -0
- package/dist/PortalIcon-DO0VrIoY.js +28 -0
- package/dist/PortalSettingsView-Bqw8tMZb.js +123 -0
- package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js +26 -0
- package/dist/WorkspaceEntryView-e2EUnq9A.js +21 -0
- package/dist/app.js +55 -11
- package/dist/controlPlane-CoEgf9BA.js +144 -0
- package/dist/index-D5qXvcfE.js +55 -0
- package/dist/localPreference-DneUpUrQ.js +34 -0
- package/dist/package.json +2 -1
- package/dist/portalContext-C4HL_0kl.js +47 -0
- package/dist/portalNavigation-DOF4Ah49.js +28 -0
- package/dist/routes-Boz_WlNM.js +54 -0
- package/dist/style.css +1 -1
- package/dist/useBrandKit-BlKlqpo2.js +1020 -0
- package/dist/{useModuleCatalog-CTgQG6Dx.js → useModuleCatalog-DqECds3F.js} +17 -16
- package/package.json +2 -1
- package/dist/App-CaNGbhK8.js +0 -20
- package/dist/AppTabs.vue_vue_type_script_setup_true_lang-BKOXPYIU.js +0 -284
- package/dist/ModuleCenterView-54GneqaO.js +0 -148
package/dist/app.js
CHANGED
|
@@ -1,32 +1,76 @@
|
|
|
1
|
-
import { defineAsyncComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineAsyncComponent as t } from "vue";
|
|
2
|
+
const o = [
|
|
3
|
+
{
|
|
4
|
+
path: "/platforms/mobile",
|
|
5
|
+
name: "miniprogram-v2-mobile-projects",
|
|
6
|
+
meta: { title: "Mobile" },
|
|
7
|
+
component: () => import("./MobileProjectsView-DAWuOiCr.js")
|
|
8
|
+
},
|
|
3
9
|
{
|
|
4
10
|
path: "/",
|
|
11
|
+
name: "miniprogram-v2-ecosystem",
|
|
12
|
+
meta: { title: "Ecosystem" },
|
|
13
|
+
beforeEnter: (e) => ["workspace", "releases", "sessions"].includes(String(e.query.view)) ? { name: "miniprogram-v2-control", query: e.query } : !0,
|
|
14
|
+
component: () => import("./EcosystemView-BgjtBJy_.js")
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: "/workspace",
|
|
5
18
|
name: "miniprogram-v2-control",
|
|
6
|
-
component: () => import("./
|
|
19
|
+
component: () => import("./WorkspaceEntryView-e2EUnq9A.js")
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
path: "/p/:projectId/:view(workspace|releases|sessions)?",
|
|
23
|
+
name: "miniprogram-v2-project",
|
|
24
|
+
component: () => import("./ControlPlaneView-BJ6QP0bK.js")
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
path: "/brand-kit",
|
|
28
|
+
name: "miniprogram-v2-brand-kit",
|
|
29
|
+
meta: { title: "Brand Kit" },
|
|
30
|
+
component: () => import("./BrandKitView-DUbIT3c8.js")
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
path: "/pages",
|
|
34
|
+
name: "miniprogram-v2-pages",
|
|
35
|
+
meta: { title: "Pages" },
|
|
36
|
+
component: () => import("./PagesView-CegMd6GC.js")
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
path: "/settings",
|
|
40
|
+
name: "miniprogram-v2-settings",
|
|
41
|
+
meta: { title: "Settings" },
|
|
42
|
+
component: () => import("./PortalSettingsView-Bqw8tMZb.js")
|
|
7
43
|
},
|
|
44
|
+
...["tablet", "kiosk"].map((e) => ({
|
|
45
|
+
path: `/platforms/${e}`,
|
|
46
|
+
name: `miniprogram-v2-${e}`,
|
|
47
|
+
meta: { title: e === "tablet" ? "Tablet" : "Kiosk", kind: e },
|
|
48
|
+
component: () => import("./PlatformUnavailableView-j0_2YBKm.js")
|
|
49
|
+
})),
|
|
8
50
|
{
|
|
9
51
|
// The shared component library, not this merchant's workspace — which is
|
|
10
52
|
// why it sits beside the control view rather than inside it.
|
|
11
53
|
path: "/modules",
|
|
12
54
|
name: "miniprogram-v2-module-center",
|
|
13
|
-
|
|
55
|
+
meta: { title: "Module library" },
|
|
56
|
+
component: () => import("./ModuleCenterView-DyMr3iWV.js")
|
|
14
57
|
},
|
|
15
58
|
{
|
|
16
59
|
// Keyed by the module's directory name, which is what the catalog, the
|
|
17
60
|
// delivered library directory and the block-swap skill all already use.
|
|
18
61
|
path: "/modules/:name",
|
|
19
62
|
name: "miniprogram-v2-module-detail",
|
|
20
|
-
|
|
63
|
+
meta: { title: "Module library" },
|
|
64
|
+
component: () => import("./ModuleDetailView-BeXK89Cs.js")
|
|
21
65
|
},
|
|
22
66
|
{
|
|
23
67
|
path: "/:pathMatch(.*)*",
|
|
24
|
-
redirect: { name: "miniprogram-v2-
|
|
68
|
+
redirect: (e) => ({ name: "miniprogram-v2-ecosystem", query: e.query, params: {} })
|
|
25
69
|
}
|
|
26
|
-
],
|
|
70
|
+
], r = {}, a = t(() => import("./App-agMiJ0tU.js")), i = t(() => import("./LegacyWorkspaceEntry-opz_kWz9.js"));
|
|
27
71
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
72
|
+
a as FmApp,
|
|
73
|
+
i as MiniprogramWorkspace,
|
|
74
|
+
r as i18nMessages,
|
|
75
|
+
o as routes
|
|
32
76
|
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { a as f, e as d, D as m } from "./index-D5qXvcfE.js";
|
|
2
|
+
import { useCoreStore as a, FeedMeAuth as p } from "@feedmepos/mf-common";
|
|
3
|
+
const h = [
|
|
4
|
+
"AE",
|
|
5
|
+
"AU",
|
|
6
|
+
"BN",
|
|
7
|
+
"GB",
|
|
8
|
+
"ID",
|
|
9
|
+
"JP",
|
|
10
|
+
"MA",
|
|
11
|
+
"MO",
|
|
12
|
+
"MV",
|
|
13
|
+
"MY",
|
|
14
|
+
"PK",
|
|
15
|
+
"SG",
|
|
16
|
+
"TH",
|
|
17
|
+
"VN"
|
|
18
|
+
];
|
|
19
|
+
function w(e) {
|
|
20
|
+
return typeof e == "string" && h.includes(e);
|
|
21
|
+
}
|
|
22
|
+
function g(e) {
|
|
23
|
+
if (typeof e != "string") return null;
|
|
24
|
+
const n = e.trim().toUpperCase();
|
|
25
|
+
return w(n) ? n : null;
|
|
26
|
+
}
|
|
27
|
+
function U(e, n) {
|
|
28
|
+
const t = n === "MY" ? "" : `.${n.toLowerCase()}`, r = e === "dev" ? "-dev" : "", o = e === "dev" ? "https://portal.feedmedev.cc" : "https://portal.feedme.cc", s = e === "dev" ? "https://license.feedmedev.cc" : "https://license.feedme.cc";
|
|
29
|
+
return {
|
|
30
|
+
country: n,
|
|
31
|
+
portalApiBaseUrl: `https://portal-v2${r}${t}.feedmeapi.com`,
|
|
32
|
+
licenseApiBaseUrl: `https://license-v2${r}${t}.feedmeapi.com/api`,
|
|
33
|
+
purchaseUrl: `${o}/purchase`,
|
|
34
|
+
aiTokenPurchaseUrl: `${s}/purchase`,
|
|
35
|
+
usageUrl: `${s}/token`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function k(e, n, t) {
|
|
39
|
+
const r = new URL(U(e, n).usageUrl);
|
|
40
|
+
return r.searchParams.set("businessId", t), r.searchParams.set("country", n), r.toString();
|
|
41
|
+
}
|
|
42
|
+
function B(e) {
|
|
43
|
+
return e.replace(/\/+$/, "");
|
|
44
|
+
}
|
|
45
|
+
function v() {
|
|
46
|
+
return B("https://miniprogram-v2-api.feedmedev.vip");
|
|
47
|
+
}
|
|
48
|
+
function y(e) {
|
|
49
|
+
const n = v();
|
|
50
|
+
return n ? `${n}${e.startsWith("/") ? e : `/${e}`}` : e;
|
|
51
|
+
}
|
|
52
|
+
function i() {
|
|
53
|
+
return a().currentBusiness.value;
|
|
54
|
+
}
|
|
55
|
+
function u() {
|
|
56
|
+
var e;
|
|
57
|
+
return ((e = i()) == null ? void 0 : e._id) ?? m;
|
|
58
|
+
}
|
|
59
|
+
function C() {
|
|
60
|
+
var e;
|
|
61
|
+
return ((e = i()) == null ? void 0 : e.url) ?? void 0;
|
|
62
|
+
}
|
|
63
|
+
function D() {
|
|
64
|
+
var e;
|
|
65
|
+
return ((e = i()) == null ? void 0 : e.name) ?? u();
|
|
66
|
+
}
|
|
67
|
+
function $() {
|
|
68
|
+
return a().currentCountry.value;
|
|
69
|
+
}
|
|
70
|
+
function x() {
|
|
71
|
+
var r;
|
|
72
|
+
const e = (r = C()) == null ? void 0 : r.trim().toLowerCase(), n = e && /^[a-z0-9-]+$/.test(e) ? e : u(), t = f(d("fmmf:dev")).liveDomain;
|
|
73
|
+
return `https://${n}.${t}`;
|
|
74
|
+
}
|
|
75
|
+
function S(e) {
|
|
76
|
+
return new Promise((n) => window.setTimeout(n, e));
|
|
77
|
+
}
|
|
78
|
+
function F(e) {
|
|
79
|
+
return e instanceof Error ? e.message : String(e);
|
|
80
|
+
}
|
|
81
|
+
class T extends Error {
|
|
82
|
+
constructor(n, t) {
|
|
83
|
+
super(t), this.status = n, this.body = t;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function c() {
|
|
87
|
+
var n;
|
|
88
|
+
return ((n = a().sessionUser.value) == null ? void 0 : n.token) || p.token || "";
|
|
89
|
+
}
|
|
90
|
+
async function E() {
|
|
91
|
+
let e = c();
|
|
92
|
+
const n = Date.now() + 5e3;
|
|
93
|
+
for (; !e && Date.now() < n; )
|
|
94
|
+
await S(100), e = c();
|
|
95
|
+
return e ? `Bearer ${e}` : null;
|
|
96
|
+
}
|
|
97
|
+
async function P(e, n = {}) {
|
|
98
|
+
const t = new Request(e, n), r = await E();
|
|
99
|
+
r && t.headers.set("Authorization", r);
|
|
100
|
+
const o = g($());
|
|
101
|
+
return o && t.headers.set("x-feedme-country", o), fetch(t);
|
|
102
|
+
}
|
|
103
|
+
async function l(e, n = {}) {
|
|
104
|
+
const t = new Headers(n.headers);
|
|
105
|
+
n.body && !t.has("Content-Type") && t.set("Content-Type", "application/json");
|
|
106
|
+
const r = new AbortController(), o = window.setTimeout(() => r.abort(), 15e3);
|
|
107
|
+
try {
|
|
108
|
+
const s = await P(y(e), {
|
|
109
|
+
...n,
|
|
110
|
+
headers: t,
|
|
111
|
+
signal: n.signal ?? r.signal
|
|
112
|
+
});
|
|
113
|
+
if (!s.ok) throw new T(s.status, await s.text());
|
|
114
|
+
return s;
|
|
115
|
+
} catch (s) {
|
|
116
|
+
throw s instanceof DOMException && s.name === "AbortError" ? new Error("Control-plane request timed out") : s;
|
|
117
|
+
} finally {
|
|
118
|
+
window.clearTimeout(o);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function b(e, n = {}) {
|
|
122
|
+
return (await l(e, n)).json();
|
|
123
|
+
}
|
|
124
|
+
async function I(e, n = {}) {
|
|
125
|
+
return (await l(e, n)).text();
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
T as C,
|
|
129
|
+
$ as a,
|
|
130
|
+
x as b,
|
|
131
|
+
b as c,
|
|
132
|
+
P as d,
|
|
133
|
+
F as e,
|
|
134
|
+
y as f,
|
|
135
|
+
E as g,
|
|
136
|
+
u as h,
|
|
137
|
+
C as i,
|
|
138
|
+
D as j,
|
|
139
|
+
k,
|
|
140
|
+
i as l,
|
|
141
|
+
I as m,
|
|
142
|
+
g as n,
|
|
143
|
+
S as s
|
|
144
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const c = "69cde0740c0106001ca83dff", t = {
|
|
2
|
+
dev: {
|
|
3
|
+
env: "dev",
|
|
4
|
+
liveDomain: "feedmedev.vip",
|
|
5
|
+
apiOrigin: "https://api.feedmedev.vip",
|
|
6
|
+
workerNamePrefix: "miniprogram-v2-dev",
|
|
7
|
+
d1DatabaseName: "miniprogram-v2-dev-metadata",
|
|
8
|
+
r2BucketName: "miniprogram-v2-dev-artifacts",
|
|
9
|
+
v1Origin: "https://brand.feedmedev.vip"
|
|
10
|
+
},
|
|
11
|
+
prod: {
|
|
12
|
+
env: "prod",
|
|
13
|
+
liveDomain: "feedme.vip",
|
|
14
|
+
apiOrigin: "https://api.feedme.vip",
|
|
15
|
+
workerNamePrefix: "miniprogram-v2-prod",
|
|
16
|
+
d1DatabaseName: "miniprogram-v2-prod-metadata",
|
|
17
|
+
r2BucketName: "miniprogram-v2-prod-artifacts",
|
|
18
|
+
v1Origin: "https://brand.feedme.vip"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function o(e) {
|
|
22
|
+
return e === "dev" || e === "prod";
|
|
23
|
+
}
|
|
24
|
+
function s(e) {
|
|
25
|
+
if (!o(e))
|
|
26
|
+
throw new Error(`MINIPROGRAM_ENV must be 'dev' or 'prod', got ${JSON.stringify(e)}`);
|
|
27
|
+
return t[e];
|
|
28
|
+
}
|
|
29
|
+
function v(e) {
|
|
30
|
+
const r = e.toLowerCase().replace(/^fmmf:/, "");
|
|
31
|
+
return r === "prod" || r === "production" ? "prod" : "dev";
|
|
32
|
+
}
|
|
33
|
+
const a = /^[a-f0-9]{24}$/;
|
|
34
|
+
function d(e) {
|
|
35
|
+
return a.test(e);
|
|
36
|
+
}
|
|
37
|
+
function f(e = crypto.randomUUID()) {
|
|
38
|
+
const r = m("prj", e, 24);
|
|
39
|
+
return r.length === 27 ? r : r.padEnd(27, "0");
|
|
40
|
+
}
|
|
41
|
+
function g(e) {
|
|
42
|
+
if (!d(e)) throw new Error(`Invalid business id: ${e}`);
|
|
43
|
+
return `prj${e}`;
|
|
44
|
+
}
|
|
45
|
+
function m(e, r, n) {
|
|
46
|
+
const i = r.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replaceAll("-", "").slice(0, n);
|
|
47
|
+
return `${e}${i || Date.now().toString(36)}`;
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
c as D,
|
|
51
|
+
s as a,
|
|
52
|
+
v as e,
|
|
53
|
+
g as l,
|
|
54
|
+
f as m
|
|
55
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function o(t, e) {
|
|
2
|
+
if (typeof window > "u") return e;
|
|
3
|
+
try {
|
|
4
|
+
const r = window.localStorage.getItem(t);
|
|
5
|
+
return r === null ? e : r === "1";
|
|
6
|
+
} catch {
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function i(t, e) {
|
|
11
|
+
if (typeof window > "u") return e;
|
|
12
|
+
try {
|
|
13
|
+
const r = Number(window.localStorage.getItem(t));
|
|
14
|
+
return Number.isFinite(r) ? r : e;
|
|
15
|
+
} catch {
|
|
16
|
+
return e;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function n(t, e) {
|
|
20
|
+
if (!(typeof window > "u"))
|
|
21
|
+
try {
|
|
22
|
+
window.localStorage.setItem(t, e);
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function u(t, e) {
|
|
27
|
+
n(t, e ? "1" : "0");
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
i as a,
|
|
31
|
+
n as b,
|
|
32
|
+
o as r,
|
|
33
|
+
u as w
|
|
34
|
+
};
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-miniprogram-v2",
|
|
3
|
-
"version": "0.2.2-dev.
|
|
3
|
+
"version": "0.2.2-dev.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"deploy:npm:prod": "pnpm run build-only:prod && pnpm run publish:npm latest"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@casl/ability": "3.4.0",
|
|
40
41
|
"@feedmepos/media-picker": "2.0.0",
|
|
41
42
|
"@feedmepos/mf-common": "^1.27.9",
|
|
42
43
|
"@feedmepos/ui-library": "1.8.4",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { a as b } from "./routes-Boz_WlNM.js";
|
|
2
|
+
import { useCoreStore as d } from "@feedmepos/mf-common";
|
|
3
|
+
import { c as g, e as h } from "./controlPlane-CoEgf9BA.js";
|
|
4
|
+
import { provide as y, computed as f, ref as c, watch as C, onScopeDispose as w, inject as x } from "vue";
|
|
5
|
+
function P() {
|
|
6
|
+
const e = d(), r = f(() => {
|
|
7
|
+
var t;
|
|
8
|
+
return ((t = e.currentBusiness.value) == null ? void 0 : t._id) ?? null;
|
|
9
|
+
}), v = f(() => {
|
|
10
|
+
var t;
|
|
11
|
+
return ((t = e.currentBusiness.value) == null ? void 0 : t.name) ?? "Your business";
|
|
12
|
+
}), s = c(null), a = c(!1), i = c(null);
|
|
13
|
+
let n = 0, o = null;
|
|
14
|
+
async function m() {
|
|
15
|
+
const t = ++n;
|
|
16
|
+
o == null || o.abort(), o = new AbortController();
|
|
17
|
+
const u = r.value;
|
|
18
|
+
if (i.value = null, s.value = null, a.value = !!u, !!u)
|
|
19
|
+
try {
|
|
20
|
+
const l = await g(b.portalContext(u), {
|
|
21
|
+
signal: AbortSignal.any([o.signal, AbortSignal.timeout(15e3)])
|
|
22
|
+
});
|
|
23
|
+
t === n && (s.value = l);
|
|
24
|
+
} catch (l) {
|
|
25
|
+
t === n && (i.value = h(l));
|
|
26
|
+
} finally {
|
|
27
|
+
t === n && (a.value = !1);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return C([r, () => e.currentCountry.value], m, { immediate: !0 }), w(() => {
|
|
31
|
+
n++, o == null || o.abort();
|
|
32
|
+
}), { businessId: r, businessName: v, context: s, loading: a, error: i, refresh: m };
|
|
33
|
+
}
|
|
34
|
+
const p = Symbol("miniprogram-portal");
|
|
35
|
+
function R() {
|
|
36
|
+
const e = P();
|
|
37
|
+
return y(p, e), e;
|
|
38
|
+
}
|
|
39
|
+
function j() {
|
|
40
|
+
const e = x(p);
|
|
41
|
+
if (!e) throw new Error("Portal views must be mounted inside the Miniprogram shell");
|
|
42
|
+
return e;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
R as p,
|
|
46
|
+
j as u
|
|
47
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function o(e) {
|
|
2
|
+
return e === "releases" ? "releases" : "workspace";
|
|
3
|
+
}
|
|
4
|
+
function t(e) {
|
|
5
|
+
const { view: s, ...r } = e;
|
|
6
|
+
return r;
|
|
7
|
+
}
|
|
8
|
+
function c(e, s, r) {
|
|
9
|
+
return {
|
|
10
|
+
name: "miniprogram-v2-project",
|
|
11
|
+
params: { projectId: e, view: s === "workspace" ? void 0 : s },
|
|
12
|
+
query: t(r)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function i(e, s = "settings") {
|
|
16
|
+
const r = new URLSearchParams();
|
|
17
|
+
for (const a of ["businessId", "country", "restaurantId"]) {
|
|
18
|
+
const n = e[a];
|
|
19
|
+
typeof n == "string" && r.set(a, n);
|
|
20
|
+
}
|
|
21
|
+
return `/brand/${s}${r.size ? `?${r}` : ""}`;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
o as a,
|
|
25
|
+
i as l,
|
|
26
|
+
t as p,
|
|
27
|
+
c as w
|
|
28
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const t = (e, s) => `/api/businesses/${e}/projects/${s}`, i = {
|
|
2
|
+
projects: (e) => `/api/businesses/${e}/projects`,
|
|
3
|
+
portalContext: (e) => `/api/businesses/${e}/portal-context`,
|
|
4
|
+
project: (e, s) => t(e, s),
|
|
5
|
+
provision: (e, s) => `${t(e, s)}/provision`,
|
|
6
|
+
refreshSlug: (e, s) => `${t(e, s)}/refresh-slug`,
|
|
7
|
+
sessions: (e, s) => `${t(e, s)}/sessions`,
|
|
8
|
+
session: (e, s, r) => `${t(e, s)}/sessions/${r}`,
|
|
9
|
+
messages: (e, s, r) => `${i.session(e, s, r)}/messages`,
|
|
10
|
+
startStatus: (e, s, r) => `${i.session(e, s, r)}/start-status`,
|
|
11
|
+
changes: (e, s, r, o = !1) => `${i.session(e, s, r)}/changes${o ? "?refresh=1" : ""}`,
|
|
12
|
+
checkpoints: (e, s, r) => `${i.session(e, s, r)}/checkpoints`,
|
|
13
|
+
aiBillingPreflight: (e, s, r) => `${i.session(e, s, r)}/ai-billing/preflight`,
|
|
14
|
+
restoreCheckpoint: (e, s, r, o) => `${i.checkpoints(e, s, r)}/${o}/restore`,
|
|
15
|
+
previewBridgeTicket: (e, s, r) => `${i.session(e, s, r)}/preview-bridge/ticket`,
|
|
16
|
+
previewBridgeSocket: (e, s, r) => `${i.session(e, s, r)}/preview-bridge/socket`,
|
|
17
|
+
uploads: (e, s, r, o = "") => `${i.session(e, s, r)}/uploads${o ? `?${o}` : ""}`,
|
|
18
|
+
archive: (e, s, r) => `${i.session(e, s, r)}/archive`,
|
|
19
|
+
commit: (e, s, r) => `${i.session(e, s, r)}/commit`,
|
|
20
|
+
resume: (e, s, r) => `${i.session(e, s, r)}/resume`,
|
|
21
|
+
restartPreview: (e, s, r) => `${i.session(e, s, r)}/restart-preview`,
|
|
22
|
+
fork: (e, s, r) => `${i.session(e, s, r)}/fork`,
|
|
23
|
+
flushEvents: (e, s, r) => `${i.session(e, s, r)}/events/flush`,
|
|
24
|
+
revertTurn: (e, s, r) => `${i.session(e, s, r)}/turns/revert`,
|
|
25
|
+
unrevertTurn: (e, s, r) => `${i.session(e, s, r)}/turns/unrevert`,
|
|
26
|
+
releases: (e, s) => `${t(e, s)}/releases`,
|
|
27
|
+
publishRelease: (e, s, r) => `${i.releases(e, s)}/${r}/publish`,
|
|
28
|
+
releasePreviewUrl: (e, s, r) => `${i.releases(e, s)}/${r}/preview-url`,
|
|
29
|
+
rollbackToRelease: (e, s, r) => `${t(e, s)}/rollback-to-release/${r}`,
|
|
30
|
+
rollbackToV1: (e, s) => `${t(e, s)}/rollback-to-v1`,
|
|
31
|
+
start: (e, s, r) => {
|
|
32
|
+
const o = new URLSearchParams();
|
|
33
|
+
e && o.set("businessId", e), s && o.set("projectId", s), r && o.set("sessionId", r);
|
|
34
|
+
const a = o.toString();
|
|
35
|
+
return `/api/start${a ? `?${a}` : ""}`;
|
|
36
|
+
},
|
|
37
|
+
opencode: (e = "") => `/api/opencode${e ? `/${e.replace(/^\/+/, "")}` : ""}`,
|
|
38
|
+
/** The shared component library's catalog. Deliberately not under a
|
|
39
|
+
* business/project path: the library belongs to no business, and the
|
|
40
|
+
* module centre is not inside a workspace. */
|
|
41
|
+
componentLibraryCatalog: () => "/api/component-library/catalog",
|
|
42
|
+
/** The self-contained preview document the module centre frames. Fetched with
|
|
43
|
+
* the portal's bearer and assigned to an iframe's `srcdoc`, never used as an
|
|
44
|
+
* `<iframe src>` — a navigation request carries no Authorization header,
|
|
45
|
+
* which is what a signed URL would otherwise exist to work around. */
|
|
46
|
+
componentLibraryPreview: () => "/api/component-library/preview",
|
|
47
|
+
/** The application templates this environment can provision, for the portal's
|
|
48
|
+
* picker. Not under a business/project path: the answer is a property of
|
|
49
|
+
* the environment, and it is needed BEFORE a project exists. */
|
|
50
|
+
appTemplates: () => "/api/app-templates"
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
i as a
|
|
54
|
+
};
|