@feedmepos/mf-miniprogram-v2 0.2.2-dev.10 → 0.2.2-dev.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.
@@ -0,0 +1,354 @@
1
+ import { defineComponent as le, ref as r, computed as S, watch as B, onMounted as oe, resolveComponent as y, openBlock as s, createBlock as k, withCtx as O, createVNode as c, createElementVNode as i, toDisplayString as m, createCommentVNode as V, unref as be, createElementBlock as p, Fragment as R, renderList as ne, createTextVNode as g, onScopeDispose as _e } from "vue";
2
+ import { a as A } from "./routes-DXQSkGM7.js";
3
+ import { useDialog as he } from "@feedmepos/ui-library";
4
+ import { c as z, e as j } from "./controlPlane-CoEgf9BA.js";
5
+ import { _ as fe } from "./StatusBadge.vue_vue_type_script_setup_true_lang-Bh9Eoe_H.js";
6
+ import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const ye = ["qsr", "coffee", "tea"], L = [
8
+ // `label` and `description` are MERCHANT-FACING: the portal's picker renders
9
+ // them, and they are the only thing a merchant chooses on. Say what the app does
10
+ // for their customers, never which package it is built from — the SDK is real and
11
+ // load-bearing and means nothing to the person making this decision.
12
+ {
13
+ id: "miniprogram-vue",
14
+ label: "Phone ordering app",
15
+ description: "Menu browsing, cart and checkout, membership and rewards, and order history — for customers ordering on their own phone.",
16
+ industries: [],
17
+ environments: ["dev", "prod"],
18
+ default: !0
19
+ },
20
+ {
21
+ id: "miniprogram-vue-v2",
22
+ label: "Phone, kiosk and tablet",
23
+ description: "Everything in the phone app, plus self-order kiosk and in-store tablet surfaces sharing the same menu, cart and membership.",
24
+ industries: [],
25
+ // Dev only, deliberately. It has never been provisioned end-to-end: the
26
+ // preview proxy, the component-library unpack and the release build have
27
+ // only been exercised locally. Add 'prod' after a real merchant has run
28
+ // through all three.
29
+ environments: ["dev"]
30
+ }
31
+ ], ge = { class: "template-choice-dialog__environments" }, Ce = {
32
+ key: 2,
33
+ class: "template-choice-dialog__prod-warning"
34
+ }, ke = {
35
+ key: 4,
36
+ class: "portal-error",
37
+ role: "alert"
38
+ }, E = "__none__", Ve = /* @__PURE__ */ le({
39
+ __name: "TemplateChoiceDialog",
40
+ props: {
41
+ choice: {}
42
+ },
43
+ emits: ["saved", "close"],
44
+ setup(N, { emit: T }) {
45
+ var q, G, Y, H, J, K, W, Q, X;
46
+ const d = N, w = T, v = r(((q = d.choice) == null ? void 0 : q.id) ?? ""), b = r(((G = d.choice) == null ? void 0 : G.appTemplateId) ?? ((Y = L[0]) == null ? void 0 : Y.id) ?? ""), _ = r(((H = d.choice) == null ? void 0 : H.restaurantStyle) ?? E), h = r(((J = d.choice) == null ? void 0 : J.label) ?? ""), C = r(((K = d.choice) == null ? void 0 : K.description) ?? ""), F = r((((W = d.choice) == null ? void 0 : W.industries) ?? []).join(", ")), f = r([...((Q = d.choice) == null ? void 0 : Q.environments) ?? ["dev"]]), o = r(((X = d.choice) == null ? void 0 : X.default) ?? !1), l = r(!1), u = r(""), a = S(() => !!d.choice), x = L.map((n) => ({ label: n.label, value: n.id })), P = S(() => b.value === "miniprogram-vue-v2"), ie = [
47
+ { label: "None (v1-style layout)", value: E },
48
+ ...ye.map((n) => ({ label: n, value: n }))
49
+ ];
50
+ B(b, () => {
51
+ P.value || (_.value = E);
52
+ });
53
+ const D = S(() => L.find((n) => n.id === b.value)), re = S(
54
+ () => ["dev", "prod"].map((n) => {
55
+ var e;
56
+ return {
57
+ label: n,
58
+ value: n,
59
+ disabled: !((e = D.value) != null && e.environments.includes(n))
60
+ };
61
+ })
62
+ );
63
+ B(D, () => {
64
+ f.value = f.value.filter((n) => {
65
+ var e;
66
+ return (e = D.value) == null ? void 0 : e.environments.includes(n);
67
+ });
68
+ });
69
+ const $ = r(!1), I = S(() => f.value.includes("prod"));
70
+ B(I, (n) => {
71
+ n || ($.value = !1);
72
+ });
73
+ const M = S(
74
+ () => !l.value && h.value.trim().length > 0 && C.value.trim().length > 0 && f.value.length > 0 && (a.value ? !0 : /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(v.value.trim())) && (!I.value || $.value)
75
+ );
76
+ async function de() {
77
+ if (!M.value) return;
78
+ l.value = !0, u.value = "";
79
+ const n = {
80
+ ...a.value ? {} : { id: v.value.trim() },
81
+ appTemplateId: b.value,
82
+ label: h.value.trim(),
83
+ description: C.value.trim(),
84
+ industries: F.value.split(",").map((e) => e.trim()).filter(Boolean),
85
+ environments: f.value,
86
+ default: o.value,
87
+ ...P.value && _.value !== E ? { restaurantStyle: _.value } : {}
88
+ };
89
+ try {
90
+ await z(
91
+ a.value ? A.appTemplateChoice(d.choice.id) : A.appTemplateChoices(),
92
+ { method: a.value ? "PATCH" : "POST", body: JSON.stringify(n) }
93
+ ), w("saved");
94
+ } catch (e) {
95
+ u.value = j(e);
96
+ } finally {
97
+ l.value = !1;
98
+ }
99
+ }
100
+ return oe(() => {
101
+ !a.value && !h.value && (h.value = "");
102
+ }), (n, e) => {
103
+ const U = y("FmTextField"), Z = y("FmSelect"), ue = y("FmTextarea"), ee = y("FmCheckbox"), ce = y("FmSwitch"), ae = y("FmButton"), me = y("FmCard"), pe = y("FmForm");
104
+ return s(), k(pe, { onValidationSuccess: de }, {
105
+ default: O(() => [
106
+ c(me, { class: "template-choice-dialog" }, {
107
+ default: O(() => {
108
+ var te;
109
+ return [
110
+ i("h2", null, m(a.value ? `Edit ${(te = N.choice) == null ? void 0 : te.label}` : "New template choice"), 1),
111
+ a.value ? V("", !0) : (s(), k(U, {
112
+ key: 0,
113
+ modelValue: v.value,
114
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => v.value = t),
115
+ label: "Choice id",
116
+ placeholder: "e.g. miniprogram-vue-v2-bakery",
117
+ "helper-text": "Lowercase, kebab-case. Cannot be changed after creation.",
118
+ disabled: l.value,
119
+ rules: [(t) => /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(t.trim()) || "Lowercase kebab-case, e.g. miniprogram-vue-v2-bakery"]
120
+ }, null, 8, ["modelValue", "disabled", "rules"])),
121
+ c(Z, {
122
+ modelValue: b.value,
123
+ "onUpdate:modelValue": e[1] || (e[1] = (t) => b.value = t),
124
+ label: "Physical template",
125
+ items: be(x),
126
+ disabled: l.value || a.value
127
+ }, null, 8, ["modelValue", "items", "disabled"]),
128
+ P.value ? (s(), k(Z, {
129
+ key: 1,
130
+ modelValue: _.value,
131
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => _.value = t),
132
+ label: "Restaurant style",
133
+ "helper-text": "Only styles templates/miniprogram-vue-v2/src/brand/recipes.ts already implements.",
134
+ items: ie,
135
+ disabled: l.value
136
+ }, null, 8, ["modelValue", "disabled"])) : V("", !0),
137
+ c(U, {
138
+ modelValue: h.value,
139
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => h.value = t),
140
+ label: "Label",
141
+ placeholder: "Shown to merchants in the picker",
142
+ disabled: l.value
143
+ }, null, 8, ["modelValue", "disabled"]),
144
+ c(ue, {
145
+ modelValue: C.value,
146
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => C.value = t),
147
+ label: "Description",
148
+ placeholder: "One or two sentences on what the merchant gets",
149
+ disabled: l.value
150
+ }, null, 8, ["modelValue", "disabled"]),
151
+ c(U, {
152
+ modelValue: F.value,
153
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => F.value = t),
154
+ label: "Industries (comma-separated)",
155
+ placeholder: "e.g. Food & beverage",
156
+ disabled: l.value
157
+ }, null, 8, ["modelValue", "disabled"]),
158
+ i("div", ge, [
159
+ e[10] || (e[10] = i("p", { class: "template-choice-dialog__label" }, "Environments", -1)),
160
+ (s(!0), p(R, null, ne(re.value, (t) => (s(), k(ee, {
161
+ key: t.value,
162
+ modelValue: f.value,
163
+ "onUpdate:modelValue": e[6] || (e[6] = (ve) => f.value = ve),
164
+ value: t.value,
165
+ label: t.value,
166
+ disabled: l.value || t.disabled
167
+ }, null, 8, ["modelValue", "value", "label", "disabled"]))), 128))
168
+ ]),
169
+ I.value ? (s(), p("p", Ce, [...e[11] || (e[11] = [
170
+ g(" This choice will be offered to merchants creating a project in ", -1),
171
+ i("strong", null, "prod", -1),
172
+ g(" as soon as it saves — there is no deploy step in between. ", -1)
173
+ ])])) : V("", !0),
174
+ I.value ? (s(), k(ee, {
175
+ key: 3,
176
+ modelValue: $.value,
177
+ "onUpdate:modelValue": e[7] || (e[7] = (t) => $.value = t),
178
+ value: !0,
179
+ label: "I understand this affects prod immediately",
180
+ disabled: l.value
181
+ }, null, 8, ["modelValue", "disabled"])) : V("", !0),
182
+ c(ce, {
183
+ modelValue: o.value,
184
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => o.value = t),
185
+ label: "Default choice",
186
+ sublabel: "Used when a provision request names none",
187
+ disabled: l.value
188
+ }, null, 8, ["modelValue", "disabled"]),
189
+ u.value ? (s(), p("p", ke, m(u.value), 1)) : V("", !0),
190
+ i("footer", null, [
191
+ c(ae, {
192
+ label: "Cancel",
193
+ variant: "tertiary",
194
+ disabled: l.value,
195
+ onClick: e[9] || (e[9] = (t) => w("close"))
196
+ }, null, 8, ["disabled"]),
197
+ c(ae, {
198
+ label: a.value ? "Save" : "Create",
199
+ type: "submit",
200
+ loading: l.value,
201
+ disabled: !M.value
202
+ }, null, 8, ["label", "loading", "disabled"])
203
+ ])
204
+ ];
205
+ }),
206
+ _: 1
207
+ })
208
+ ]),
209
+ _: 1
210
+ });
211
+ };
212
+ }
213
+ }), Te = /* @__PURE__ */ se(Ve, [["__scopeId", "data-v-f14457dc"]]), we = { class: "portal-page" }, Se = { class: "portal-page-inner" }, Fe = { class: "portal-page-heading" }, Ae = {
214
+ key: 0,
215
+ class: "portal-error",
216
+ role: "alert"
217
+ }, xe = {
218
+ key: 1,
219
+ role: "status"
220
+ }, $e = {
221
+ key: 2,
222
+ class: "template-choices__list",
223
+ "aria-label": "Template choices"
224
+ }, Ie = { class: "template-choices__name" }, Ee = { class: "template-choices__label" }, Ne = { key: 0 }, Pe = { class: "template-choices__id" }, De = { class: "template-choices__meta" }, Ue = ["datetime"], Be = { class: "template-choices__actions" }, Le = /* @__PURE__ */ le({
225
+ __name: "TemplateCenterView",
226
+ setup(N) {
227
+ const T = he(), d = r([]), w = r(!0), v = r(""), b = new AbortController();
228
+ async function _() {
229
+ w.value = !0, v.value = "";
230
+ try {
231
+ const o = await z(A.appTemplateChoices(), {
232
+ signal: b.signal
233
+ });
234
+ d.value = o.choices;
235
+ } catch (o) {
236
+ b.signal.aborted || (v.value = j(o));
237
+ } finally {
238
+ w.value = !1;
239
+ }
240
+ }
241
+ function h(o) {
242
+ T.open({
243
+ title: o ? `Edit ${o.label}` : "New template choice",
244
+ dialogComponent: Te,
245
+ dialogComponentProps: {
246
+ choice: o,
247
+ onClose: () => T.close(),
248
+ onSaved: () => {
249
+ T.close(), _();
250
+ }
251
+ }
252
+ });
253
+ }
254
+ async function C(o, l) {
255
+ try {
256
+ await z(
257
+ l === "archived" ? A.appTemplateChoiceArchive(o.id) : A.appTemplateChoiceRestore(o.id),
258
+ { method: "POST" }
259
+ ), await _();
260
+ } catch (u) {
261
+ v.value = j(u);
262
+ }
263
+ }
264
+ function F(o) {
265
+ T.open({
266
+ title: `Archive ${o.label}?`,
267
+ message: "It stops appearing for new projects. Merchants already provisioned from it are unaffected — it is never consulted again after provisioning.",
268
+ primaryActions: { text: "Archive", close: !0, variant: "primary" },
269
+ secondaryActions: { text: "Cancel", close: !0, variant: "tertiary" }
270
+ }).onPrimary(() => void C(o, "archived"));
271
+ }
272
+ function f(o) {
273
+ return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(new Date(o));
274
+ }
275
+ return oe(() => void _()), _e(() => b.abort()), (o, l) => {
276
+ const u = y("FmButton");
277
+ return s(), p("div", we, [
278
+ i("div", Se, [
279
+ i("header", Fe, [
280
+ l[1] || (l[1] = i("div", null, [
281
+ i("p", { class: "portal-eyebrow" }, "Internal"),
282
+ i("h1", null, "Template Center")
283
+ ], -1)),
284
+ c(u, {
285
+ label: "New choice",
286
+ icon: "add",
287
+ onClick: l[0] || (l[0] = (a) => h())
288
+ })
289
+ ]),
290
+ v.value ? (s(), p("p", Ae, [
291
+ g(m(v.value) + " ", 1),
292
+ c(u, {
293
+ label: "Retry",
294
+ variant: "tertiary",
295
+ onClick: _
296
+ })
297
+ ])) : w.value ? (s(), p("p", xe, "Loading template choices…")) : (s(), p("section", $e, [
298
+ (s(!0), p(R, null, ne(d.value, (a) => (s(), p("article", {
299
+ key: a.id,
300
+ class: "template-choices__row"
301
+ }, [
302
+ i("div", Ie, [
303
+ i("span", Ee, [
304
+ g(m(a.label), 1),
305
+ a.default ? (s(), p("span", Ne, " · Default")) : V("", !0)
306
+ ]),
307
+ i("span", Pe, m(a.id), 1),
308
+ i("span", De, [
309
+ g(m(a.appTemplateId), 1),
310
+ a.restaurantStyle ? (s(), p(R, { key: 0 }, [
311
+ g(" · " + m(a.restaurantStyle), 1)
312
+ ], 64)) : V("", !0),
313
+ g(" · " + m(a.industries.join(", ") || "General-purpose") + " · " + m((a.environments ?? []).join(", ")), 1)
314
+ ])
315
+ ]),
316
+ c(fe, {
317
+ variant: a.status === "active" ? "success" : "neutral"
318
+ }, {
319
+ default: O(() => [
320
+ g(m(a.status === "active" ? "Active" : "Archived"), 1)
321
+ ]),
322
+ _: 2
323
+ }, 1032, ["variant"]),
324
+ i("time", {
325
+ datetime: a.updatedAt
326
+ }, m(f(a.updatedAt)), 9, Ue),
327
+ i("div", Be, [
328
+ c(u, {
329
+ label: "Edit",
330
+ variant: "secondary",
331
+ onClick: (x) => h(a)
332
+ }, null, 8, ["onClick"]),
333
+ a.status === "active" ? (s(), k(u, {
334
+ key: 0,
335
+ label: "Archive",
336
+ variant: "tertiary",
337
+ onClick: (x) => F(a)
338
+ }, null, 8, ["onClick"])) : (s(), k(u, {
339
+ key: 1,
340
+ label: "Restore",
341
+ variant: "tertiary",
342
+ onClick: (x) => C(a, "active")
343
+ }, null, 8, ["onClick"]))
344
+ ])
345
+ ]))), 128))
346
+ ]))
347
+ ])
348
+ ]);
349
+ };
350
+ }
351
+ }), Ge = /* @__PURE__ */ se(Le, [["__scopeId", "data-v-da7cd846"]]);
352
+ export {
353
+ Ge as default
354
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as c, watchEffect as a, openBlock as n, createElementBlock as p } from "vue";
2
2
  import { useRoute as i, useRouter as u } from "vue-router";
3
- import { u as l } from "./portalContext-C4HL_0kl.js";
3
+ import { u as l } from "./portalContext-DCwZcTKL.js";
4
4
  import { w as m, a as f } from "./portalNavigation-DOF4Ah49.js";
5
5
  const _ = {
6
6
  class: "portal-loading",
package/dist/app.js CHANGED
@@ -4,24 +4,24 @@ const o = [
4
4
  path: "/platforms/mobile",
5
5
  name: "miniprogram-v2-mobile-projects",
6
6
  meta: { title: "Mobile" },
7
- component: () => import("./MobileProjectsView-DAWuOiCr.js")
7
+ component: () => import("./MobileProjectsView-BZw9pWnK.js")
8
8
  },
9
9
  {
10
10
  path: "/",
11
11
  name: "miniprogram-v2-ecosystem",
12
12
  meta: { title: "Ecosystem" },
13
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")
14
+ component: () => import("./EcosystemView-sb7DUkNL.js")
15
15
  },
16
16
  {
17
17
  path: "/workspace",
18
18
  name: "miniprogram-v2-control",
19
- component: () => import("./WorkspaceEntryView-e2EUnq9A.js")
19
+ component: () => import("./WorkspaceEntryView-hNqYjBTr.js")
20
20
  },
21
21
  {
22
22
  path: "/p/:projectId/:view(workspace|releases|sessions)?",
23
23
  name: "miniprogram-v2-project",
24
- component: () => import("./ControlPlaneView-BJ6QP0bK.js")
24
+ component: () => import("./ControlPlaneView-C7Eg9mU3.js")
25
25
  },
26
26
  {
27
27
  path: "/brand-kit",
@@ -33,13 +33,13 @@ const o = [
33
33
  path: "/pages",
34
34
  name: "miniprogram-v2-pages",
35
35
  meta: { title: "Pages" },
36
- component: () => import("./PagesView-CegMd6GC.js")
36
+ component: () => import("./PagesView-DTGhet9j.js")
37
37
  },
38
38
  {
39
39
  path: "/settings",
40
40
  name: "miniprogram-v2-settings",
41
41
  meta: { title: "Settings" },
42
- component: () => import("./PortalSettingsView-Bqw8tMZb.js")
42
+ component: () => import("./PortalSettingsView-BrO2Yt65.js")
43
43
  },
44
44
  ...["tablet", "kiosk"].map((e) => ({
45
45
  path: `/platforms/${e}`,
@@ -53,7 +53,7 @@ const o = [
53
53
  path: "/modules",
54
54
  name: "miniprogram-v2-module-center",
55
55
  meta: { title: "Module library" },
56
- component: () => import("./ModuleCenterView-DyMr3iWV.js")
56
+ component: () => import("./ModuleCenterView-CQrJ9pyE.js")
57
57
  },
58
58
  {
59
59
  // Keyed by the module's directory name, which is what the catalog, the
@@ -61,16 +61,25 @@ const o = [
61
61
  path: "/modules/:name",
62
62
  name: "miniprogram-v2-module-detail",
63
63
  meta: { title: "Module library" },
64
- component: () => import("./ModuleDetailView-BeXK89Cs.js")
64
+ component: () => import("./ModuleDetailView-CpBktRqD.js")
65
+ },
66
+ {
67
+ // Internal-only: no nav entry links here, reached by typing the URL. The
68
+ // `beforeEach` guard in `./index.ts` checks `meta.requiresAdmin` and sends a
69
+ // non-admin to the same place an unmatched URL goes, below.
70
+ path: "/internal/template-center",
71
+ name: "miniprogram-v2-template-center",
72
+ meta: { title: "Template Center", requiresAdmin: !0 },
73
+ component: () => import("./TemplateCenterView-QFMGVcnE.js")
65
74
  },
66
75
  {
67
76
  path: "/:pathMatch(.*)*",
68
77
  redirect: (e) => ({ name: "miniprogram-v2-ecosystem", query: e.query, params: {} })
69
78
  }
70
- ], r = {}, a = t(() => import("./App-agMiJ0tU.js")), i = t(() => import("./LegacyWorkspaceEntry-opz_kWz9.js"));
79
+ ], r = {}, a = t(() => import("./App-CR0BBDaq.js")), n = t(() => import("./LegacyWorkspaceEntry-opz_kWz9.js"));
71
80
  export {
72
81
  a as FmApp,
73
- i as MiniprogramWorkspace,
82
+ n as MiniprogramWorkspace,
74
83
  r as i18nMessages,
75
84
  o as routes
76
85
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-miniprogram-v2",
3
- "version": "0.2.2-dev.10",
3
+ "version": "0.2.2-dev.12",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,4 +1,4 @@
1
- import { a as b } from "./routes-Boz_WlNM.js";
1
+ import { a as b } from "./routes-DXQSkGM7.js";
2
2
  import { useCoreStore as d } from "@feedmepos/mf-common";
3
3
  import { c as g, e as h } from "./controlPlane-CoEgf9BA.js";
4
4
  import { provide as y, computed as f, ref as c, watch as C, onScopeDispose as w, inject as x } from "vue";
@@ -0,0 +1,66 @@
1
+ const o = (e, s) => `/api/businesses/${e}/projects/${s}`, r = {
2
+ projects: (e) => `/api/businesses/${e}/projects`,
3
+ portalContext: (e) => `/api/businesses/${e}/portal-context`,
4
+ project: (e, s) => o(e, s),
5
+ provision: (e, s) => `${o(e, s)}/provision`,
6
+ refreshSlug: (e, s) => `${o(e, s)}/refresh-slug`,
7
+ sessions: (e, s) => `${o(e, s)}/sessions`,
8
+ session: (e, s, i) => `${o(e, s)}/sessions/${i}`,
9
+ messages: (e, s, i) => `${r.session(e, s, i)}/messages`,
10
+ startStatus: (e, s, i) => `${r.session(e, s, i)}/start-status`,
11
+ changes: (e, s, i, a = !1) => `${r.session(e, s, i)}/changes${a ? "?refresh=1" : ""}`,
12
+ checkpoints: (e, s, i) => `${r.session(e, s, i)}/checkpoints`,
13
+ aiBillingPreflight: (e, s, i) => `${r.session(e, s, i)}/ai-billing/preflight`,
14
+ restoreCheckpoint: (e, s, i, a) => `${r.checkpoints(e, s, i)}/${a}/restore`,
15
+ previewBridgeTicket: (e, s, i) => `${r.session(e, s, i)}/preview-bridge/ticket`,
16
+ previewBridgeSocket: (e, s, i) => `${r.session(e, s, i)}/preview-bridge/socket`,
17
+ uploads: (e, s, i, a = "") => `${r.session(e, s, i)}/uploads${a ? `?${a}` : ""}`,
18
+ archive: (e, s, i) => `${r.session(e, s, i)}/archive`,
19
+ commit: (e, s, i) => `${r.session(e, s, i)}/commit`,
20
+ resume: (e, s, i) => `${r.session(e, s, i)}/resume`,
21
+ restartPreview: (e, s, i) => `${r.session(e, s, i)}/restart-preview`,
22
+ fork: (e, s, i) => `${r.session(e, s, i)}/fork`,
23
+ flushEvents: (e, s, i) => `${r.session(e, s, i)}/events/flush`,
24
+ revertTurn: (e, s, i) => `${r.session(e, s, i)}/turns/revert`,
25
+ unrevertTurn: (e, s, i) => `${r.session(e, s, i)}/turns/unrevert`,
26
+ releases: (e, s) => `${o(e, s)}/releases`,
27
+ /** Internal-admin only. Extracts a new restaurant style out of a session's
28
+ * verified checkpoint and, once confirmed, opens a PR against this repo. */
29
+ publishAsTemplate: (e, s) => `${o(e, s)}/publish-as-template`,
30
+ publishRelease: (e, s, i) => `${r.releases(e, s)}/${i}/publish`,
31
+ releasePreviewUrl: (e, s, i) => `${r.releases(e, s)}/${i}/preview-url`,
32
+ rollbackToRelease: (e, s, i) => `${o(e, s)}/rollback-to-release/${i}`,
33
+ rollbackToV1: (e, s) => `${o(e, s)}/rollback-to-v1`,
34
+ start: (e, s, i) => {
35
+ const a = new URLSearchParams();
36
+ e && a.set("businessId", e), s && a.set("projectId", s), i && a.set("sessionId", i);
37
+ const t = a.toString();
38
+ return `/api/start${t ? `?${t}` : ""}`;
39
+ },
40
+ opencode: (e = "") => `/api/opencode${e ? `/${e.replace(/^\/+/, "")}` : ""}`,
41
+ /** The shared component library's catalog. Deliberately not under a
42
+ * business/project path: the library belongs to no business, and the
43
+ * module centre is not inside a workspace. */
44
+ componentLibraryCatalog: () => "/api/component-library/catalog",
45
+ /** The self-contained preview document the module centre frames. Fetched with
46
+ * the portal's bearer and assigned to an iframe's `srcdoc`, never used as an
47
+ * `<iframe src>` — a navigation request carries no Authorization header,
48
+ * which is what a signed URL would otherwise exist to work around. */
49
+ componentLibraryPreview: () => "/api/component-library/preview",
50
+ /** The application templates this environment can provision, for the portal's
51
+ * picker. Not under a business/project path: the answer is a property of
52
+ * the environment, and it is needed BEFORE a project exists. */
53
+ appTemplates: () => "/api/app-templates",
54
+ /** Whether the caller is an internal admin — for the portal to decide whether to
55
+ * show internal-only entry points such as the Template Center. The real
56
+ * enforcement is on every admin route itself; this is a UI convenience. */
57
+ adminWhoami: () => "/api/admin/whoami",
58
+ /** Template Center: the FULL choice catalog (active + archived), internal-admin only. */
59
+ appTemplateChoices: () => "/api/admin/app-template-choices",
60
+ appTemplateChoice: (e) => `/api/admin/app-template-choices/${e}`,
61
+ appTemplateChoiceArchive: (e) => `${r.appTemplateChoice(e)}/archive`,
62
+ appTemplateChoiceRestore: (e) => `${r.appTemplateChoice(e)}/restore`
63
+ };
64
+ export {
65
+ r as a
66
+ };