@burdenoff/microfe-movethewheels 2026.827.1 → 2026.828.1

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.
@@ -1,56 +1,27 @@
1
- import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
- import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
- import { useCallback as n, useMemo as r, useState as i } from "react";
1
+ import { useCallback as e, useState as t } from "react";
4
2
  //#region src/movethewheels/hooks/useImportExport.ts
5
- var a = "\n mutation MovethewheelsExportData($input: MovethewheelsExportDataInput!) {\n exportData(input: $input) {\n success\n message\n payload\n }\n }\n", o = "\n mutation MovethewheelsImportData($input: MovethewheelsImportDataInput!) {\n importData(input: $input) {\n success\n message\n payload\n }\n }\n";
6
- function s() {
7
- let { apiGatewayUrl: s, authToken: c, workspaceToken: l, workspaceId: u, tenantId: d, currentUser: f } = e(), [p, m] = i(!1), [h, g] = i(null), _ = r(() => ({
8
- apiGatewayUrl: s,
9
- authToken: c,
10
- workspaceToken: l,
11
- workspaceId: u,
12
- tenantId: d,
13
- actorId: f?.id
14
- }), [
15
- s,
16
- c,
17
- l,
18
- u,
19
- d,
20
- f?.id
21
- ]);
3
+ function n() {
4
+ let [n, r] = t(!1), [i, a] = t(null), o = e(async (e) => {
5
+ r(!0), a(null);
6
+ try {
7
+ return await e();
8
+ } catch (e) {
9
+ let t = e instanceof Error ? e : /* @__PURE__ */ Error("Import/export failed");
10
+ throw a(t), t;
11
+ } finally {
12
+ r(!1);
13
+ }
14
+ }, []);
22
15
  return {
23
- exportData: n(async (e, n) => {
24
- m(!0), g(null);
25
- try {
26
- return (await t(_, a, { input: {
27
- resource: e,
28
- format: n
29
- } })).exportData;
30
- } catch (e) {
31
- let t = e instanceof Error ? e : /* @__PURE__ */ Error("Export failed");
32
- throw g(t), t;
33
- } finally {
34
- m(!1);
35
- }
36
- }, [_]),
37
- importData: n(async (e, n) => {
38
- m(!0), g(null);
39
- try {
40
- return (await t(_, o, { input: {
41
- resource: e,
42
- payload: n
43
- } })).importData;
44
- } catch (e) {
45
- let t = e instanceof Error ? e : /* @__PURE__ */ Error("Import failed");
46
- throw g(t), t;
47
- } finally {
48
- m(!1);
49
- }
50
- }, [_]),
51
- isBusy: p,
52
- error: h
16
+ exportData: e(async (e, t) => o(async () => {
17
+ throw Error(`Export for "${e}" is not available: the import/export surface was withdrawn from the service.`);
18
+ }), [o]),
19
+ importData: e(async (e, t) => o(async () => {
20
+ throw Error(`Import for "${e}" is not available: the import surface was withdrawn from the service.`);
21
+ }), [o]),
22
+ isBusy: n,
23
+ error: i
53
24
  };
54
25
  }
55
26
  //#endregion
56
- export { s as useImportExport };
27
+ export { n as useImportExport };
@@ -1,85 +1,75 @@
1
1
  import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
- import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
- import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
2
+ import { useCallback as t, useEffect as n, useState as r } from "react";
4
3
  //#region src/movethewheels/hooks/useReports.ts
5
- var o = "\n id\n name\n description\n type\n status\n schedule\n lastGenerated\n createdAt\n updatedAt\n", s = `
6
- query MovethewheelsReports($filter: MovethewheelsReportFilterInput, $pagination: PaginationInput) {
7
- movethewheelsReports(filter: $filter, pagination: $pagination) {
8
- ${o}
9
- }
10
- }
11
- `, c = `
12
- mutation CreateMovethewheelsReport($input: CreateMovethewheelsReportInput!) {
13
- createMovethewheelsReport(input: $input) {
14
- ${o}
15
- }
16
- }
17
- `, l = `
18
- mutation GenerateMovethewheelsReport($input: GenerateMovethewheelsReportInput!) {
19
- generateMovethewheelsReport(input: $input) {
20
- generatedAt
21
- result
22
- report {
23
- ${o}
24
- }
25
- }
26
- }
27
- `;
28
- function u(o = {}) {
29
- let { limit: u = 100, offset: d = 0 } = o, { apiGatewayUrl: f, authToken: p, workspaceToken: m, workspaceId: h, tenantId: g, currentUser: _ } = e(), [v, y] = a([]), [b, x] = a(!1), [S, C] = a(!1), [w, T] = a(null), E = i(() => ({
30
- apiGatewayUrl: f,
31
- authToken: p,
32
- workspaceToken: m,
33
- workspaceId: h,
34
- tenantId: g,
35
- actorId: _?.id
36
- }), [
37
- f,
38
- p,
39
- m,
40
- h,
41
- g,
42
- _?.id
43
- ]), D = n(async () => {
44
- C(!0), T(null);
4
+ function i() {
5
+ return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
6
+ }
7
+ function a(e) {
8
+ return `movethewheels:reports:${e ?? "default"}`;
9
+ }
10
+ function o(e) {
11
+ if (typeof window > "u") return [];
12
+ try {
13
+ let t = window.localStorage.getItem(a(e));
14
+ if (!t) return [];
15
+ let n = JSON.parse(t);
16
+ return Array.isArray(n) ? n : [];
17
+ } catch {
18
+ return [];
19
+ }
20
+ }
21
+ function s(e, t) {
22
+ if (!(typeof window > "u")) try {
23
+ window.localStorage.setItem(a(e), JSON.stringify(t));
24
+ } catch {}
25
+ }
26
+ function c(a = {}) {
27
+ let { limit: c = 100, offset: l = 0 } = a, { workspaceId: u } = e(), [d, f] = r([]), [p, m] = r(!1), [h, g] = r(!1), [_, v] = r(null), y = t(() => {
28
+ g(!0), v(null);
45
29
  try {
46
- let e = await t(E, s, { pagination: {
47
- limit: u,
48
- offset: d
49
- } });
50
- x(e.movethewheelsReports.length === u), y(e.movethewheelsReports);
30
+ let e = o(u).slice(l, l + c);
31
+ m(e.length === c), f(e);
51
32
  } catch (e) {
52
- T(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load reports"));
33
+ v(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load reports"));
53
34
  } finally {
54
- C(!1);
35
+ g(!1);
55
36
  }
56
37
  }, [
57
- E,
58
38
  u,
59
- d
39
+ c,
40
+ l
60
41
  ]);
61
- return r(() => {
62
- D();
63
- }, [D]), {
64
- reports: v,
65
- hasMore: b,
66
- isLoading: S,
67
- error: w,
68
- refetch: n(() => {
69
- D();
70
- }, [D]),
71
- createReport: n(async (e) => {
72
- let n = (await t(E, c, { input: e })).createMovethewheelsReport;
73
- return y((e) => [n, ...e]), n;
74
- }, [E]),
75
- generateReport: n(async (e, n) => {
76
- let r = (await t(E, l, { input: {
77
- reportId: e,
78
- parameters: n
79
- } })).generateMovethewheelsReport;
80
- return y((t) => t.map((t) => t.id === e ? r.report : t)), r;
81
- }, [E])
42
+ return n(() => {
43
+ y();
44
+ }, [y]), {
45
+ reports: d,
46
+ hasMore: p,
47
+ isLoading: h,
48
+ error: _,
49
+ refetch: t(() => {
50
+ y();
51
+ }, [y]),
52
+ createReport: t(async (e) => {
53
+ let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
54
+ id: i(),
55
+ name: e.name,
56
+ description: e.description ?? null,
57
+ type: e.type,
58
+ status: e.status ?? "ready",
59
+ schedule: e.schedule ?? null,
60
+ lastGenerated: null,
61
+ createdAt: t,
62
+ updatedAt: t
63
+ };
64
+ return f((e) => {
65
+ let t = [n, ...e];
66
+ return s(u, t), t;
67
+ }), n;
68
+ }, [u]),
69
+ generateReport: t(async (e, t) => {
70
+ throw Error("Report generation is not available: the movethewheelsReports surface was withdrawn from the service.");
71
+ }, [])
82
72
  };
83
73
  }
84
74
  //#endregion
85
- export { u as useReports };
75
+ export { c as useReports };
@@ -1,59 +1,67 @@
1
1
  import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
- import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
- import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
2
+ import { useCallback as t, useEffect as n, useMemo as r, useState as i } from "react";
4
3
  //#region src/movethewheels/hooks/useSettings.ts
5
- var o = "\n query MovethewheelsModuleSettings {\n moduleSettings {\n preferences\n updatedAt\n workspaceId\n }\n }\n", s = "\n mutation UpdateMovethewheelsModuleSettings($input: UpdateMovethewheelsModuleSettingsInput!) {\n updateModuleSettings(input: $input) {\n preferences\n updatedAt\n workspaceId\n }\n }\n";
6
- function c() {
7
- let { apiGatewayUrl: c, authToken: l, workspaceToken: u, workspaceId: d, tenantId: f, currentUser: p } = e(), [m, h] = a(null), [g, _] = a(!1), [v, y] = a(!1), [b, x] = a(null), S = i(() => ({
8
- apiGatewayUrl: c,
9
- authToken: l,
10
- workspaceToken: u,
11
- workspaceId: d,
12
- tenantId: f,
13
- actorId: p?.id
14
- }), [
15
- c,
16
- l,
17
- u,
18
- d,
19
- f,
20
- p?.id
21
- ]), C = n(async () => {
22
- _(!0), x(null);
4
+ function a(e) {
5
+ if (typeof window > "u") return null;
6
+ try {
7
+ let t = window.localStorage.getItem(`movethewheels:moduleSettings:${e}`);
8
+ if (!t) return null;
9
+ let n = JSON.parse(t);
10
+ return n && typeof n == "object" && "preferences" in n ? n : null;
11
+ } catch {
12
+ return null;
13
+ }
14
+ }
15
+ function o(e) {
16
+ if (!(typeof window > "u")) try {
17
+ window.localStorage.setItem(`movethewheels:moduleSettings:${e.workspaceId}`, JSON.stringify(e));
18
+ } catch {}
19
+ }
20
+ function s() {
21
+ let { workspaceId: s } = e(), [c, l] = i(null), [u, d] = i(!1), [f, p] = i(!1), [m, h] = i(null), g = t(() => {
22
+ d(!0), h(null);
23
23
  try {
24
- h((await t(S, o)).moduleSettings);
24
+ l((s ? a(s) : null) ?? {
25
+ preferences: {},
26
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
27
+ workspaceId: s ?? ""
28
+ });
25
29
  } catch (e) {
26
- x(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load settings"));
30
+ h(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load settings"));
27
31
  } finally {
28
- _(!1);
32
+ d(!1);
29
33
  }
30
- }, [S]);
31
- r(() => {
32
- C();
33
- }, [C]);
34
- let w = n(() => {
35
- C();
36
- }, [C]), T = n(async (e) => {
37
- y(!0), x(null);
34
+ }, [s]);
35
+ n(() => {
36
+ g();
37
+ }, [g]);
38
+ let _ = t(() => {
39
+ g();
40
+ }, [g]), v = t(async (e) => {
41
+ p(!0), h(null);
38
42
  try {
39
- let n = await t(S, s, { input: { preferences: e } });
40
- return h(n.updateModuleSettings), n.updateModuleSettings;
43
+ let t = {
44
+ preferences: e,
45
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
46
+ workspaceId: s ?? ""
47
+ };
48
+ return o(t), l(t), t;
41
49
  } catch (e) {
42
50
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to save settings");
43
- throw x(t), t;
51
+ throw h(t), t;
44
52
  } finally {
45
- y(!1);
53
+ p(!1);
46
54
  }
47
- }, [S]);
55
+ }, [s]);
48
56
  return {
49
- settings: m,
50
- preferences: i(() => m?.preferences ?? {}, [m]),
51
- isLoading: g,
52
- isSaving: v,
53
- error: b,
54
- refetch: w,
55
- savePreferences: T
57
+ settings: c,
58
+ preferences: r(() => c?.preferences ?? {}, [c]),
59
+ isLoading: u,
60
+ isSaving: f,
61
+ error: m,
62
+ refetch: _,
63
+ savePreferences: v
56
64
  };
57
65
  }
58
66
  //#endregion
59
- export { c as useModuleSettings };
67
+ export { s as useModuleSettings };
@@ -9,5 +9,15 @@ interface UseImportExportResult {
9
9
  isBusy: boolean;
10
10
  error: Error | null;
11
11
  }
12
+ /**
13
+ * Import/export surface withdrawn from wspace-movethewheels-svc by migration
14
+ * 20260707000001_movethewheels_reuse_cleanup. The service now exposes
15
+ * `exportMtwEntities` (async job, returns MtwExportJob) but no import
16
+ * counterpart, so the old synchronous exportData/importData mutations are no
17
+ * longer resolvable. This hook keeps the same contract for consumers but
18
+ * rejects calls with a clear message until a replacement import/export flow is
19
+ * designed. The original operations are preserved in
20
+ * src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql.
21
+ */
12
22
  export declare function useImportExport(): UseImportExportResult;
13
23
  export {};
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * Marketplace Page
3
3
  *
4
- * Browse third-party logistics service providers and their offerings. Providers
5
- * are paginated server-side (offset); clicking a provider expands its offerings
6
- * inline. The Filters control narrows the current page by type, verification and
7
- * minimum rating.
4
+ * The collaborative logistics marketplace (service providers / service offerings)
5
+ * was withdrawn from wspace-movethewheels-svc by migration
6
+ * 20260707000001_movethewheels_reuse_cleanup. The original query and mutation
7
+ * documents are preserved verbatim in
8
+ * src/operations/wspace/movethewheels/{queries,mutations}/marketplace-reports.withdrawn.graphql
9
+ * so they can be restored if the surface returns. Until then the page renders a
10
+ * static "coming soon" state.
8
11
  */
9
12
  export default function MarketplacePage(): import("react").JSX.Element;