@burdenoff/microfe-devportal 2026.1107.2 → 2026.1107.3

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,40 @@
1
+ /**
2
+ * Submit-for-review flow for the application page.
3
+ *
4
+ * The page used to run these steps inline and swallow any failure with a
5
+ * console.error, so when the store refused a submission the developer saw no
6
+ * message: the app silently stayed a draft (BOFF-10636). The flow is pure here
7
+ * so the page only renders the outcome, and the error mapping is unit tested.
8
+ */
9
+ /** Fallback when a failure carries no message a developer can use. */
10
+ export declare const SUBMIT_FAILED_MESSAGE = "Your app could not be submitted for review. Nothing was sent to reviewers. Try again in a moment; if it keeps failing, contact support.";
11
+ export interface VersionLike {
12
+ id: string;
13
+ status: string;
14
+ }
15
+ export interface SubmitForReviewSteps {
16
+ /** Moves one draft version into review together with the app. */
17
+ publishVersion: (versionId: string) => Promise<unknown>;
18
+ /** Submits the application itself. */
19
+ submitApplication: () => Promise<unknown>;
20
+ }
21
+ export type SubmitForReviewResult = {
22
+ ok: true;
23
+ } | {
24
+ ok: false;
25
+ message: string;
26
+ };
27
+ /** Draft versions go into review together with the app. */
28
+ export declare function draftVersionIds(versions: readonly VersionLike[]): string[];
29
+ /**
30
+ * The message to show for a failed submission: the first GraphQL error the
31
+ * backend sent (it forwards actionable store errors), else the error's own
32
+ * message, else a plain fallback.
33
+ */
34
+ export declare function submitErrorMessage(error: unknown): string;
35
+ /**
36
+ * Publish the draft versions, then submit the application. Stops at the first
37
+ * failure and reports it instead of throwing.
38
+ */
39
+ export declare function submitForReview(versions: readonly VersionLike[], steps: SubmitForReviewSteps): Promise<SubmitForReviewResult>;
40
+ //# sourceMappingURL=submitForReview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitForReview.d.ts","sourceRoot":"","sources":["../../../src/devportal/utils/submitForReview.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,4IACyG,CAAC;AAE5I,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,sCAAsC;IACtC,iBAAiB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GACZ;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,EAAE,CAE1E;AAyBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAgBzD;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,qBAAqB,CAAC,CAYhC"}
@@ -0,0 +1,37 @@
1
+ function e(e) {
2
+ return e.filter((e) => e.status === "draft").map((e) => e.id);
3
+ }
4
+ function t(e) {
5
+ return typeof e == "object" && e && !Array.isArray(e) ? e : null;
6
+ }
7
+ function n(e) {
8
+ if (typeof e != "string") return null;
9
+ let t = e.trim();
10
+ return !t || /^(unexpected error|response not successful|failed to fetch|network ?error)/i.test(t) ? null : t;
11
+ }
12
+ function r(e) {
13
+ let r = t(e);
14
+ for (let e of ["errors", "graphQLErrors"]) {
15
+ let i = r?.[e];
16
+ if (Array.isArray(i)) for (let e of i) {
17
+ let r = n(t(e)?.message);
18
+ if (r) return r;
19
+ }
20
+ }
21
+ return e instanceof Error ? n(e.message) ?? "Your app could not be submitted for review. Nothing was sent to reviewers. Try again in a moment; if it keeps failing, contact support." : n(r?.message) ?? "Your app could not be submitted for review. Nothing was sent to reviewers. Try again in a moment; if it keeps failing, contact support.";
22
+ }
23
+ async function i(t, n) {
24
+ try {
25
+ for (let r of e(t)) await n.publishVersion(r);
26
+ return await n.submitApplication(), { ok: !0 };
27
+ } catch (e) {
28
+ return console.warn("[DevPortal] Submit for review failed:", e), {
29
+ ok: !1,
30
+ message: r(e)
31
+ };
32
+ }
33
+ }
34
+ //#endregion
35
+ export { i as submitForReview };
36
+
37
+ //# sourceMappingURL=submitForReview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submitForReview.js","names":[],"sources":["../../../src/devportal/utils/submitForReview.ts"],"sourcesContent":["/**\n * Submit-for-review flow for the application page.\n *\n * The page used to run these steps inline and swallow any failure with a\n * console.error, so when the store refused a submission the developer saw no\n * message: the app silently stayed a draft (BOFF-10636). The flow is pure here\n * so the page only renders the outcome, and the error mapping is unit tested.\n */\n\n/** Fallback when a failure carries no message a developer can use. */\nexport const SUBMIT_FAILED_MESSAGE =\n \"Your app could not be submitted for review. Nothing was sent to reviewers. Try again in a moment; if it keeps failing, contact support.\";\n\nexport interface VersionLike {\n id: string;\n status: string;\n}\n\nexport interface SubmitForReviewSteps {\n /** Moves one draft version into review together with the app. */\n publishVersion: (versionId: string) => Promise<unknown>;\n /** Submits the application itself. */\n submitApplication: () => Promise<unknown>;\n}\n\nexport type SubmitForReviewResult =\n | { ok: true }\n | { ok: false; message: string };\n\n/** Draft versions go into review together with the app. */\nexport function draftVersionIds(versions: readonly VersionLike[]): string[] {\n return versions.filter((v) => v.status === \"draft\").map((v) => v.id);\n}\n\nfunction readRecord(value: unknown): Record<string, unknown> | null {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? // Narrowed to a non-null, non-array object above; fields are read defensively below.\n (value as Record<string, unknown>)\n : null;\n}\n\nfunction usableMessage(value: unknown): string | null {\n if (typeof value !== \"string\") return null;\n const message = value.trim();\n if (!message) return null;\n // Transport noise (\"Unexpected error.\", \"Response not successful: ...\",\n // \"Failed to fetch\") tells the developer nothing they can act on.\n if (\n /^(unexpected error|response not successful|failed to fetch|network ?error)/i.test(\n message,\n )\n ) {\n return null;\n }\n return message;\n}\n\n/**\n * The message to show for a failed submission: the first GraphQL error the\n * backend sent (it forwards actionable store errors), else the error's own\n * message, else a plain fallback.\n */\nexport function submitErrorMessage(error: unknown): string {\n const record = readRecord(error);\n // Apollo Client 4 raises CombinedGraphQLErrors (`errors`); older clients\n // raised ApolloError (`graphQLErrors`).\n for (const key of [\"errors\", \"graphQLErrors\"]) {\n const entries = record?.[key];\n if (!Array.isArray(entries)) continue;\n for (const entry of entries) {\n const message = usableMessage(readRecord(entry)?.[\"message\"]);\n if (message) return message;\n }\n }\n if (error instanceof Error) {\n return usableMessage(error.message) ?? SUBMIT_FAILED_MESSAGE;\n }\n return usableMessage(record?.[\"message\"]) ?? SUBMIT_FAILED_MESSAGE;\n}\n\n/**\n * Publish the draft versions, then submit the application. Stops at the first\n * failure and reports it instead of throwing.\n */\nexport async function submitForReview(\n versions: readonly VersionLike[],\n steps: SubmitForReviewSteps,\n): Promise<SubmitForReviewResult> {\n try {\n for (const versionId of draftVersionIds(versions)) {\n await steps.publishVersion(versionId);\n }\n await steps.submitApplication();\n return { ok: true };\n } catch (error) {\n // Keep the raw error for debugging; the developer sees the mapped message.\n console.warn(\"[DevPortal] Submit for review failed:\", error);\n return { ok: false, message: submitErrorMessage(error) };\n }\n}\n"],"mappings":"AA8BA,SAAgB,EAAgB,GAA4C;AAC1E,QAAO,EAAS,QAAQ,MAAM,EAAE,WAAW,QAAQ,CAAC,KAAK,MAAM,EAAE,GAAG;;AAGtE,SAAS,EAAW,GAAgD;AAClE,QAAO,OAAO,KAAU,YAAY,KAAkB,CAAC,MAAM,QAAQ,EAAM,GAEtE,IACD;;AAGN,SAAS,EAAc,GAA+B;AACpD,KAAI,OAAO,KAAU,SAAU,QAAO;CACtC,IAAM,IAAU,EAAM,MAAM;AAW5B,QAVI,CAAC,KAIH,8EAA8E,KAC5E,EACD,GAEM,OAEF;;AAQT,SAAgB,EAAmB,GAAwB;CACzD,IAAM,IAAS,EAAW,EAAM;AAGhC,MAAK,IAAM,KAAO,CAAC,UAAU,gBAAgB,EAAE;EAC7C,IAAM,IAAU,IAAS;AACpB,YAAM,QAAQ,EAAQ,CAC3B,MAAK,IAAM,KAAS,GAAS;GAC3B,IAAM,IAAU,EAAc,EAAW,EAAM,EAAG,QAAW;AAC7D,OAAI,EAAS,QAAO;;;AAMxB,QAHI,aAAiB,QACZ,EAAc,EAAM,QAAQ,IAAA,4IAE9B,EAAc,GAAS,QAAW,IAAA;;AAO3C,eAAsB,EACpB,GACA,GACgC;AAChC,KAAI;AACF,OAAK,IAAM,KAAa,EAAgB,EAAS,CAC/C,OAAM,EAAM,eAAe,EAAU;AAGvC,SADA,MAAM,EAAM,mBAAmB,EACxB,EAAE,IAAI,IAAM;UACZ,GAAO;AAGd,SADA,QAAQ,KAAK,yCAAyC,EAAM,EACrD;GAAE,IAAI;GAAO,SAAS,EAAmB,EAAM;GAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-devportal",
3
- "version": "2026.1107.2",
3
+ "version": "2026.1107.3",
4
4
  "description": "Burdenoff Developer Portal Microfrontend - Complete developer operations interface",
5
5
  "type": "module",
6
6
  "files": [