@burdenoff/microfe-export 2026.1108.1 → 2026.1113.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.
Files changed (65) hide show
  1. package/dist/export/ExportRoot.js +45 -40
  2. package/dist/export/ExportRoot.js.map +1 -1
  3. package/dist/export/ExportRoutes.d.ts +7 -0
  4. package/dist/export/ExportRoutes.js +70 -51
  5. package/dist/export/ExportRoutes.js.map +1 -1
  6. package/dist/export/components/ConfirmDestructiveDialog.d.ts +21 -0
  7. package/dist/export/components/ConfirmDestructiveDialog.js +37 -0
  8. package/dist/export/components/ConfirmDestructiveDialog.js.map +1 -0
  9. package/dist/export/components/DownloadSections.d.ts +10 -0
  10. package/dist/export/components/DownloadSections.js +161 -0
  11. package/dist/export/components/DownloadSections.js.map +1 -0
  12. package/dist/export/components/DownloadStatus.d.ts +13 -0
  13. package/dist/export/components/DownloadStatus.js +36 -0
  14. package/dist/export/components/DownloadStatus.js.map +1 -0
  15. package/dist/export/components/DownloadsTabs.d.ts +5 -0
  16. package/dist/export/components/DownloadsTabs.js +25 -0
  17. package/dist/export/components/DownloadsTabs.js.map +1 -0
  18. package/dist/export/hooks/useEntityLabel.d.ts +7 -0
  19. package/dist/export/hooks/useEntityLabel.js +16 -0
  20. package/dist/export/hooks/useEntityLabel.js.map +1 -0
  21. package/dist/export/hooks/useExportQueries.d.ts +3 -1
  22. package/dist/export/hooks/useExportQueries.js +23 -23
  23. package/dist/export/hooks/useExportQueries.js.map +1 -1
  24. package/dist/export/navigation-v2/NavigationV2.d.ts +7 -0
  25. package/dist/export/navigation-v2/NavigationV2.js +16 -0
  26. package/dist/export/navigation-v2/NavigationV2.js.map +1 -0
  27. package/dist/export/pages/CreateExportPage.js +123 -121
  28. package/dist/export/pages/CreateExportPage.js.map +1 -1
  29. package/dist/export/pages/ExportDetailPage.js +131 -124
  30. package/dist/export/pages/ExportDetailPage.js.map +1 -1
  31. package/dist/export/pages/ExportHistoryPage.js +61 -57
  32. package/dist/export/pages/ExportHistoryPage.js.map +1 -1
  33. package/dist/export/pages/ExportTemplatesPage.js +214 -182
  34. package/dist/export/pages/ExportTemplatesPage.js.map +1 -1
  35. package/dist/export/pages/TemplateDetailPage.js +141 -119
  36. package/dist/export/pages/TemplateDetailPage.js.map +1 -1
  37. package/dist/export/pages/v2/DownloadDetailPage.d.ts +8 -0
  38. package/dist/export/pages/v2/DownloadDetailPage.js +176 -0
  39. package/dist/export/pages/v2/DownloadDetailPage.js.map +1 -0
  40. package/dist/export/pages/v2/DownloadsPage.d.ts +10 -0
  41. package/dist/export/pages/v2/DownloadsPage.js +401 -0
  42. package/dist/export/pages/v2/DownloadsPage.js.map +1 -0
  43. package/dist/export/pages/v2/NewDownloadPage.d.ts +8 -0
  44. package/dist/export/pages/v2/NewDownloadPage.js +440 -0
  45. package/dist/export/pages/v2/NewDownloadPage.js.map +1 -0
  46. package/dist/export/types/index.d.ts +7 -0
  47. package/dist/export/utils/billing.d.ts +6 -0
  48. package/dist/export/utils/billing.js +7 -0
  49. package/dist/export/utils/billing.js.map +1 -0
  50. package/dist/export/utils/downloadStatus.d.ts +15 -0
  51. package/dist/export/utils/downloadStatus.js +48 -0
  52. package/dist/export/utils/downloadStatus.js.map +1 -0
  53. package/dist/export/utils/entityLabels.d.ts +47 -0
  54. package/dist/export/utils/entityLabels.js +150 -0
  55. package/dist/export/utils/entityLabels.js.map +1 -0
  56. package/dist/export/utils/formatBytes.d.ts +2 -0
  57. package/dist/export/utils/formatBytes.js +15 -0
  58. package/dist/export/utils/formatBytes.js.map +1 -0
  59. package/dist/export/utils/newDownloadForm.d.ts +32 -0
  60. package/dist/export/utils/newDownloadForm.js +42 -0
  61. package/dist/export/utils/newDownloadForm.js.map +1 -0
  62. package/dist/export/utils/paths.d.ts +2 -0
  63. package/dist/export/utils/paths.js +7 -0
  64. package/dist/export/utils/paths.js.map +1 -0
  65. package/package.json +2 -2
@@ -0,0 +1,47 @@
1
+ import { ExportAvailableEntity } from '../types';
2
+ type Tr = (key: string, fallback: string) => string;
3
+ /**
4
+ * Which translation group the legacy wizard's built-in copy uses for an
5
+ * entity type. The wizard's copy was keyed by short names (`activity`,
6
+ * `calendar`, `users`) that never matched the entity types the export service
7
+ * actually lists (`activity_logs`, `calendar_events`, `workspace_members`), so
8
+ * its own labels were never shown. Both spellings resolve now.
9
+ */
10
+ export declare const LEGACY_ENTITY_COPY_KEY: Readonly<Record<string, string>>;
11
+ /**
12
+ * Plain names for the entity types the export service lists (Navigation v2,
13
+ * BOFF-11870): "Activity history", not `activity_logs`. Keys live under
14
+ * `export.entities.<entityType>`, so an app can reword any of them.
15
+ */
16
+ export declare const ENTITY_PLAIN_NAMES: Readonly<Record<string, string>>;
17
+ /** `activity_logs` → "Activity logs": the last resort for an unknown key. */
18
+ export declare function humanizeEntityType(entityType: string): string;
19
+ /**
20
+ * The one name a person sees for an entity type: the plain name when there is
21
+ * one, else the export service's display name, else the key made readable.
22
+ * Never the raw key.
23
+ */
24
+ export declare function entityLabel(entityType: string, tr: Tr, available?: readonly ExportAvailableEntity[]): string;
25
+ /** A curated plain group on step 1 of "New download". */
26
+ export interface EntityGroup {
27
+ id: string;
28
+ /** Translation key and English for the group's name. */
29
+ labelKey: string;
30
+ label: string;
31
+ descriptionKey: string;
32
+ description: string;
33
+ /** Entity types in the group, in display order. */
34
+ entityTypes: readonly string[];
35
+ }
36
+ /**
37
+ * The everyday groups step 1 offers first (level 1). Every other entity type
38
+ * the workspace can export sits under "Show all data types" (level 2). A group
39
+ * only shows when at least one of its entity types is offered.
40
+ */
41
+ export declare const ENTITY_GROUPS: readonly EntityGroup[];
42
+ /** The curated groups, each cut down to the entity types actually offered. */
43
+ export declare function offeredGroups(offered: readonly string[]): {
44
+ group: EntityGroup;
45
+ entityTypes: string[];
46
+ }[];
47
+ export {};
@@ -0,0 +1,150 @@
1
+ // src/export/utils/entityLabels.ts
2
+ var e = {
3
+ users: "users",
4
+ workspace_members: "users",
5
+ projects: "projects",
6
+ tasks: "tasks",
7
+ files: "files",
8
+ conversations: "conversations",
9
+ tags: "tags",
10
+ activity: "activity",
11
+ activity_logs: "activity",
12
+ calendar: "calendar",
13
+ calendar_events: "calendar"
14
+ }, t = {
15
+ workflows: "Workflows",
16
+ fluidgrids_workflow_runs: "Workflow runs",
17
+ fluidgrids_event_triggers: "Event triggers",
18
+ fluidgrids_scheduled_triggers: "Schedules",
19
+ scheduled_tasks: "Scheduled tasks",
20
+ fluidgrids_variables: "Variables",
21
+ fluidgrids_data_tables: "Data tables",
22
+ fluidgrids_data_table_rows: "Data table rows",
23
+ files: "Files",
24
+ folders: "Folders",
25
+ conversations: "Chats",
26
+ messages: "Chat messages",
27
+ calendars: "Calendars",
28
+ calendar_events: "Calendar events",
29
+ groups: "Teams",
30
+ group_members: "Team members",
31
+ workspace_members: "Workspace members",
32
+ users: "People",
33
+ invitations: "Invitations",
34
+ activity_logs: "Activity history",
35
+ analytics_events: "Usage events",
36
+ tags: "Tags",
37
+ vocabularies: "Tag groups",
38
+ rbac_roles: "Roles",
39
+ rbac_role_members: "Role assignments",
40
+ permission_audit_logs: "Access check history",
41
+ rbac_change_logs: "Role change history",
42
+ vaults: "Vaults",
43
+ secrets: "Saved values",
44
+ vault_audit_logs: "Vault history",
45
+ vault_security_events: "Vault security events",
46
+ integrations: "Connected apps",
47
+ sandbox_environments: "Sandboxes",
48
+ workspaces: "Workspaces",
49
+ projects: "Projects",
50
+ graph_edges: "Links between items"
51
+ };
52
+ function n(e) {
53
+ let t = e.replace(/[_-]+/g, " ").trim();
54
+ return t ? t.charAt(0).toUpperCase() + t.slice(1) : e;
55
+ }
56
+ function r(e, r, i = []) {
57
+ let a = t[e];
58
+ if (a) return r(`export.entities.${e}`, a);
59
+ let o = i.find((t) => t.entityType === e)?.displayName;
60
+ return o && o !== e ? o : n(e);
61
+ }
62
+ var i = [
63
+ {
64
+ id: "workflows",
65
+ labelKey: "export.create.groups.workflows.label",
66
+ label: "Workflows and runs",
67
+ descriptionKey: "export.create.groups.workflows.description",
68
+ description: "Your workflows, their runs, triggers and schedules",
69
+ entityTypes: [
70
+ "workflows",
71
+ "fluidgrids_workflow_runs",
72
+ "fluidgrids_event_triggers",
73
+ "fluidgrids_scheduled_triggers",
74
+ "scheduled_tasks"
75
+ ]
76
+ },
77
+ {
78
+ id: "data",
79
+ labelKey: "export.create.groups.data.label",
80
+ label: "Data tables and variables",
81
+ descriptionKey: "export.create.groups.data.description",
82
+ description: "Tables, their rows and the variables your workflows use",
83
+ entityTypes: [
84
+ "fluidgrids_data_tables",
85
+ "fluidgrids_data_table_rows",
86
+ "fluidgrids_variables"
87
+ ]
88
+ },
89
+ {
90
+ id: "files",
91
+ labelKey: "export.create.groups.files.label",
92
+ label: "Files",
93
+ descriptionKey: "export.create.groups.files.description",
94
+ description: "Your files and folders",
95
+ entityTypes: ["files", "folders"]
96
+ },
97
+ {
98
+ id: "chat",
99
+ labelKey: "export.create.groups.chat.label",
100
+ label: "Chats and calendar",
101
+ descriptionKey: "export.create.groups.chat.description",
102
+ description: "Conversations, messages and calendar events",
103
+ entityTypes: [
104
+ "conversations",
105
+ "messages",
106
+ "calendars",
107
+ "calendar_events"
108
+ ]
109
+ },
110
+ {
111
+ id: "people",
112
+ labelKey: "export.create.groups.people.label",
113
+ label: "Teams and people",
114
+ descriptionKey: "export.create.groups.people.description",
115
+ description: "Teams, their members and workspace invitations",
116
+ entityTypes: [
117
+ "groups",
118
+ "group_members",
119
+ "workspace_members",
120
+ "users",
121
+ "invitations"
122
+ ]
123
+ },
124
+ {
125
+ id: "activity",
126
+ labelKey: "export.create.groups.activity.label",
127
+ label: "Activity history",
128
+ descriptionKey: "export.create.groups.activity.description",
129
+ description: "Who did what, and when",
130
+ entityTypes: ["activity_logs"]
131
+ },
132
+ {
133
+ id: "tags",
134
+ labelKey: "export.create.groups.tags.label",
135
+ label: "Tags",
136
+ descriptionKey: "export.create.groups.tags.description",
137
+ description: "Tags and tag groups",
138
+ entityTypes: ["tags", "vocabularies"]
139
+ }
140
+ ];
141
+ function a(e) {
142
+ let t = new Set(e);
143
+ return i.map((e) => ({
144
+ group: e,
145
+ entityTypes: e.entityTypes.filter((e) => t.has(e))
146
+ })).filter((e) => e.entityTypes.length > 0);
147
+ }
148
+ export { i as ENTITY_GROUPS, t as ENTITY_PLAIN_NAMES, e as LEGACY_ENTITY_COPY_KEY, r as entityLabel, n as humanizeEntityType, a as offeredGroups };
149
+
150
+ //# sourceMappingURL=entityLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entityLabels.js","names":["LEGACY_ENTITY_COPY_KEY","ENTITY_PLAIN_NAMES","humanizeEntityType","words","entityType","entityLabel","plain","tr","fromService","available","e","ENTITY_GROUPS","offeredGroups","offeredSet","offered","group","t","g"],"sources":["../../../src/export/utils/entityLabels.ts"],"sourcesContent":["import type { ExportAvailableEntity } from \"../types\";\n\ntype Tr = (key: string, fallback: string) => string;\n\n/**\n * Which translation group the legacy wizard's built-in copy uses for an\n * entity type. The wizard's copy was keyed by short names (`activity`,\n * `calendar`, `users`) that never matched the entity types the export service\n * actually lists (`activity_logs`, `calendar_events`, `workspace_members`), so\n * its own labels were never shown. Both spellings resolve now.\n */\nexport const LEGACY_ENTITY_COPY_KEY: Readonly<Record<string, string>> = {\n users: \"users\",\n workspace_members: \"users\",\n projects: \"projects\",\n tasks: \"tasks\",\n files: \"files\",\n conversations: \"conversations\",\n tags: \"tags\",\n activity: \"activity\",\n activity_logs: \"activity\",\n calendar: \"calendar\",\n calendar_events: \"calendar\",\n};\n\n/**\n * Plain names for the entity types the export service lists (Navigation v2,\n * BOFF-11870): \"Activity history\", not `activity_logs`. Keys live under\n * `export.entities.<entityType>`, so an app can reword any of them.\n */\nexport const ENTITY_PLAIN_NAMES: Readonly<Record<string, string>> = {\n workflows: \"Workflows\",\n fluidgrids_workflow_runs: \"Workflow runs\",\n fluidgrids_event_triggers: \"Event triggers\",\n fluidgrids_scheduled_triggers: \"Schedules\",\n scheduled_tasks: \"Scheduled tasks\",\n fluidgrids_variables: \"Variables\",\n fluidgrids_data_tables: \"Data tables\",\n fluidgrids_data_table_rows: \"Data table rows\",\n files: \"Files\",\n folders: \"Folders\",\n conversations: \"Chats\",\n messages: \"Chat messages\",\n calendars: \"Calendars\",\n calendar_events: \"Calendar events\",\n groups: \"Teams\",\n group_members: \"Team members\",\n workspace_members: \"Workspace members\",\n users: \"People\",\n invitations: \"Invitations\",\n activity_logs: \"Activity history\",\n analytics_events: \"Usage events\",\n tags: \"Tags\",\n vocabularies: \"Tag groups\",\n rbac_roles: \"Roles\",\n rbac_role_members: \"Role assignments\",\n permission_audit_logs: \"Access check history\",\n rbac_change_logs: \"Role change history\",\n vaults: \"Vaults\",\n secrets: \"Saved values\",\n vault_audit_logs: \"Vault history\",\n vault_security_events: \"Vault security events\",\n integrations: \"Connected apps\",\n sandbox_environments: \"Sandboxes\",\n workspaces: \"Workspaces\",\n projects: \"Projects\",\n graph_edges: \"Links between items\",\n};\n\n/** `activity_logs` → \"Activity logs\": the last resort for an unknown key. */\nexport function humanizeEntityType(entityType: string): string {\n const words = entityType.replace(/[_-]+/g, \" \").trim();\n if (!words) return entityType;\n return words.charAt(0).toUpperCase() + words.slice(1);\n}\n\n/**\n * The one name a person sees for an entity type: the plain name when there is\n * one, else the export service's display name, else the key made readable.\n * Never the raw key.\n */\nexport function entityLabel(\n entityType: string,\n tr: Tr,\n available: readonly ExportAvailableEntity[] = [],\n): string {\n const plain = ENTITY_PLAIN_NAMES[entityType];\n if (plain) return tr(`export.entities.${entityType}`, plain);\n const fromService = available.find(\n (e) => e.entityType === entityType,\n )?.displayName;\n if (fromService && fromService !== entityType) return fromService;\n return humanizeEntityType(entityType);\n}\n\n/** A curated plain group on step 1 of \"New download\". */\nexport interface EntityGroup {\n id: string;\n /** Translation key and English for the group's name. */\n labelKey: string;\n label: string;\n descriptionKey: string;\n description: string;\n /** Entity types in the group, in display order. */\n entityTypes: readonly string[];\n}\n\n/**\n * The everyday groups step 1 offers first (level 1). Every other entity type\n * the workspace can export sits under \"Show all data types\" (level 2). A group\n * only shows when at least one of its entity types is offered.\n */\nexport const ENTITY_GROUPS: readonly EntityGroup[] = [\n {\n id: \"workflows\",\n labelKey: \"export.create.groups.workflows.label\",\n label: \"Workflows and runs\",\n descriptionKey: \"export.create.groups.workflows.description\",\n description: \"Your workflows, their runs, triggers and schedules\",\n entityTypes: [\n \"workflows\",\n \"fluidgrids_workflow_runs\",\n \"fluidgrids_event_triggers\",\n \"fluidgrids_scheduled_triggers\",\n \"scheduled_tasks\",\n ],\n },\n {\n id: \"data\",\n labelKey: \"export.create.groups.data.label\",\n label: \"Data tables and variables\",\n descriptionKey: \"export.create.groups.data.description\",\n description: \"Tables, their rows and the variables your workflows use\",\n entityTypes: [\n \"fluidgrids_data_tables\",\n \"fluidgrids_data_table_rows\",\n \"fluidgrids_variables\",\n ],\n },\n {\n id: \"files\",\n labelKey: \"export.create.groups.files.label\",\n label: \"Files\",\n descriptionKey: \"export.create.groups.files.description\",\n description: \"Your files and folders\",\n entityTypes: [\"files\", \"folders\"],\n },\n {\n id: \"chat\",\n labelKey: \"export.create.groups.chat.label\",\n label: \"Chats and calendar\",\n descriptionKey: \"export.create.groups.chat.description\",\n description: \"Conversations, messages and calendar events\",\n entityTypes: [\"conversations\", \"messages\", \"calendars\", \"calendar_events\"],\n },\n {\n id: \"people\",\n labelKey: \"export.create.groups.people.label\",\n label: \"Teams and people\",\n descriptionKey: \"export.create.groups.people.description\",\n description: \"Teams, their members and workspace invitations\",\n entityTypes: [\n \"groups\",\n \"group_members\",\n \"workspace_members\",\n \"users\",\n \"invitations\",\n ],\n },\n {\n id: \"activity\",\n labelKey: \"export.create.groups.activity.label\",\n label: \"Activity history\",\n descriptionKey: \"export.create.groups.activity.description\",\n description: \"Who did what, and when\",\n entityTypes: [\"activity_logs\"],\n },\n {\n id: \"tags\",\n labelKey: \"export.create.groups.tags.label\",\n label: \"Tags\",\n descriptionKey: \"export.create.groups.tags.description\",\n description: \"Tags and tag groups\",\n entityTypes: [\"tags\", \"vocabularies\"],\n },\n];\n\n/** The curated groups, each cut down to the entity types actually offered. */\nexport function offeredGroups(\n offered: readonly string[],\n): { group: EntityGroup; entityTypes: string[] }[] {\n const offeredSet = new Set(offered);\n return ENTITY_GROUPS.map((group) => ({\n group,\n entityTypes: group.entityTypes.filter((t) => offeredSet.has(t)),\n })).filter((g) => g.entityTypes.length > 0);\n}\n"],"mappings":";AAWA,IAAaA,IAA2D;CACtE,OAAO;CACP,mBAAmB;CACnB,UAAU;CACV,OAAO;CACP,OAAO;CACP,eAAe;CACf,MAAM;CACN,UAAU;CACV,eAAe;CACf,UAAU;CACV,iBAAiB;AACnB,GAOaC,IAAuD;CAClE,WAAW;CACX,0BAA0B;CAC1B,2BAA2B;CAC3B,+BAA+B;CAC/B,iBAAiB;CACjB,sBAAsB;CACtB,wBAAwB;CACxB,4BAA4B;CAC5B,OAAO;CACP,SAAS;CACT,eAAe;CACf,UAAU;CACV,WAAW;CACX,iBAAiB;CACjB,QAAQ;CACR,eAAe;CACf,mBAAmB;CACnB,OAAO;CACP,aAAa;CACb,eAAe;CACf,kBAAkB;CAClB,MAAM;CACN,cAAc;CACd,YAAY;CACZ,mBAAmB;CACnB,uBAAuB;CACvB,kBAAkB;CAClB,QAAQ;CACR,SAAS;CACT,kBAAkB;CAClB,uBAAuB;CACvB,cAAc;CACd,sBAAsB;CACtB,YAAY;CACZ,UAAU;CACV,aAAa;AACf;AAGA,SAAgBC,EAAmB,GAA4B;CAC7D,IAAMC,IAAQC,EAAW,QAAQ,UAAU,GAAG,CAAC,CAAC,KAAK;CAErD,OADKD,IACEA,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAM,MAAM,CAAC,IADjCC;AAErB;AAOA,SAAgBC,EACd,GACA,GACA,IAA8C,CAAC,GACvC;CACR,IAAMC,IAAQL,EAAmBG;CACjC,IAAIE,GAAO,OAAOC,EAAG,mBAAmBH,KAAcE,CAAK;CAC3D,IAAME,IAAcC,EAAU,MAC3B,MAAMC,EAAE,eAAeN,CAC1B,CAAC,EAAE;CAEH,OADII,KAAeA,MAAgBJ,IAAmBI,IAC/CN,EAAmBE,CAAU;AACtC;AAmBA,IAAaO,IAAwC;CACnD;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,aAAa;EACb,aAAa;GACX;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,aAAa;EACb,aAAa;GACX;GACA;GACA;EACF;CACF;CACA;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,aAAa;EACb,aAAa,CAAC,SAAS,SAAS;CAClC;CACA;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,aAAa;EACb,aAAa;GAAC;GAAiB;GAAY;GAAa;EAAiB;CAC3E;CACA;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,aAAa;EACb,aAAa;GACX;GACA;GACA;GACA;GACA;EACF;CACF;CACA;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,aAAa;EACb,aAAa,CAAC,eAAe;CAC/B;CACA;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,gBAAgB;EAChB,aAAa;EACb,aAAa,CAAC,QAAQ,cAAc;CACtC;AACF;AAGA,SAAgBC,EACd,GACiD;CACjD,IAAMC,IAAa,IAAI,IAAIC,CAAO;CAClC,OAAOH,EAAc,KAAK,OAAW;EACnC;EACA,aAAaI,EAAM,YAAY,QAAQ,MAAMF,EAAW,IAAIG,CAAC,CAAC;CAChE,EAAE,CAAC,CAAC,QAAQ,MAAMC,EAAE,YAAY,SAAS,CAAC;AAC5C"}
@@ -0,0 +1,2 @@
1
+ /** Bytes as a short human-readable size: 1536 → "1.5 KB". */
2
+ export declare function formatBytes(bytes: number): string;
@@ -0,0 +1,15 @@
1
+ // src/export/utils/formatBytes.ts
2
+ function e(e) {
3
+ if (!Number.isFinite(e) || e <= 0) return "0 B";
4
+ let t = 1024, n = [
5
+ "B",
6
+ "KB",
7
+ "MB",
8
+ "GB",
9
+ "TB"
10
+ ], r = Math.min(n.length - 1, Math.floor(Math.log(e) / Math.log(t)));
11
+ return `${parseFloat((e / t ** r).toFixed(2))} ${n[r]}`;
12
+ }
13
+ export { e as formatBytes };
14
+
15
+ //# sourceMappingURL=formatBytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatBytes.js","names":["formatBytes","bytes","k","sizes","i"],"sources":["../../../src/export/utils/formatBytes.ts"],"sourcesContent":["/** Bytes as a short human-readable size: 1536 → \"1.5 KB\". */\nexport function formatBytes(bytes: number): string {\n if (!Number.isFinite(bytes) || bytes <= 0) return \"0 B\";\n const k = 1024;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n const i = Math.min(\n sizes.length - 1,\n Math.floor(Math.log(bytes) / Math.log(k)),\n );\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;\n}\n"],"mappings":";AACA,SAAgBA,EAAY,GAAuB;CACjD,IAAI,CAAC,OAAO,SAASC,CAAK,KAAKA,KAAS,GAAG,OAAO;CAClD,IAAMC,IAAI,MACJC,IAAQ;EAAC;EAAK;EAAM;EAAM;EAAM;CAAI,GACpCC,IAAI,KAAK,IACbD,EAAM,SAAS,GACf,KAAK,MAAM,KAAK,IAAIF,CAAK,IAAI,KAAK,IAAIC,CAAC,CAAC,CAC1C;CACA,OAAO,GAAG,YAAYD,IAAiBC,KAAGE,EAAC,CAAG,QAAQ,CAAC,CAAC,EAAE,GAAGD,EAAMC;AACrE"}
@@ -0,0 +1,32 @@
1
+ import { CreateExportJobInput } from '../hooks/useExportQueries';
2
+ import { ExportFormat, ExportScope, ExportTemplate } from '../types';
3
+ /** Output formats the export service writes. */
4
+ export declare const SUPPORTED_FORMATS: readonly ExportFormat[];
5
+ /** Every download is packaged as this archive; there is no choice to make. */
6
+ export declare const DOWNLOAD_ARCHIVE_FORMAT = "ZIP";
7
+ /** Everything "New download" collects, before it becomes the service input. */
8
+ export interface NewDownloadForm {
9
+ entityTypes: string[];
10
+ name: string;
11
+ scope: ExportScope;
12
+ format: ExportFormat;
13
+ templateId?: string;
14
+ /** `yyyy-mm-dd` from a date input, or "" for no bound. */
15
+ dateFrom: string;
16
+ dateTo: string;
17
+ }
18
+ export declare const DEFAULT_NEW_DOWNLOAD_FORM: NewDownloadForm;
19
+ /**
20
+ * The `createExportJob` input for a filled-in form: exactly what the legacy
21
+ * wizard sends for the same choices, so a download contains the same data.
22
+ * Values in a closed "More options" fold are part of the form and are sent.
23
+ */
24
+ export declare function toCreateExportInput(form: NewDownloadForm, organizationId: string | undefined): CreateExportJobInput;
25
+ /**
26
+ * Apply a saved setup to the form: its data types (only the ones this shell
27
+ * offers), its format when the service supports it, and its id. The name is
28
+ * the setup's name unless the person already typed their own.
29
+ */
30
+ export declare function applySavedSetup(form: NewDownloadForm, setup: ExportTemplate, isSelectable: (entityType: string) => boolean, nameTouched: boolean): NewDownloadForm;
31
+ /** "Workflows and runs — 13 Nov 2026": the prefilled download name. */
32
+ export declare function suggestedDownloadName(what: string, now?: Date, locale?: string): string;
@@ -0,0 +1,42 @@
1
+ // src/export/utils/newDownloadForm.ts
2
+ var e = ["CSV", "JSON"], t = {
3
+ entityTypes: [],
4
+ name: "",
5
+ scope: "INDIVIDUAL",
6
+ format: "CSV",
7
+ templateId: void 0,
8
+ dateFrom: "",
9
+ dateTo: ""
10
+ };
11
+ function n(e, t) {
12
+ return {
13
+ name: e.name.trim(),
14
+ entityTypes: e.entityTypes,
15
+ format: e.format,
16
+ exportScope: e.scope,
17
+ organizationId: e.scope === "ORG_ADMIN" ? t : void 0,
18
+ templateId: e.templateId,
19
+ dateRangeStart: e.dateFrom ? new Date(e.dateFrom).toISOString() : null,
20
+ dateRangeEnd: e.dateTo ? new Date(e.dateTo).toISOString() : null
21
+ };
22
+ }
23
+ function r(t, n, r, i) {
24
+ let a = n.format?.toUpperCase();
25
+ return {
26
+ ...t,
27
+ templateId: n.id,
28
+ entityTypes: (n.entityTypes ?? []).filter(r),
29
+ format: a && e.includes(a) ? a : t.format,
30
+ name: i ? t.name : n.name ?? t.name
31
+ };
32
+ }
33
+ function i(e, t = /* @__PURE__ */ new Date(), n) {
34
+ return `${e} — ${t.toLocaleDateString(n, {
35
+ day: "numeric",
36
+ month: "short",
37
+ year: "numeric"
38
+ })}`;
39
+ }
40
+ export { t as DEFAULT_NEW_DOWNLOAD_FORM, e as SUPPORTED_FORMATS, r as applySavedSetup, i as suggestedDownloadName, n as toCreateExportInput };
41
+
42
+ //# sourceMappingURL=newDownloadForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"newDownloadForm.js","names":["SUPPORTED_FORMATS","DEFAULT_NEW_DOWNLOAD_FORM","toCreateExportInput","form","organizationId","applySavedSetup","format","setup","isSelectable","nameTouched","suggestedDownloadName","what","now","locale"],"sources":["../../../src/export/utils/newDownloadForm.ts"],"sourcesContent":["import type { CreateExportJobInput } from \"../hooks/useExportQueries\";\nimport type { ExportFormat, ExportScope, ExportTemplate } from \"../types\";\n\n/** Output formats the export service writes. */\nexport const SUPPORTED_FORMATS: readonly ExportFormat[] = [\"CSV\", \"JSON\"];\n\n/** Every download is packaged as this archive; there is no choice to make. */\nexport const DOWNLOAD_ARCHIVE_FORMAT = \"ZIP\";\n\n/** Everything \"New download\" collects, before it becomes the service input. */\nexport interface NewDownloadForm {\n entityTypes: string[];\n name: string;\n scope: ExportScope;\n format: ExportFormat;\n templateId?: string;\n /** `yyyy-mm-dd` from a date input, or \"\" for no bound. */\n dateFrom: string;\n dateTo: string;\n}\n\nexport const DEFAULT_NEW_DOWNLOAD_FORM: NewDownloadForm = {\n entityTypes: [],\n name: \"\",\n scope: \"INDIVIDUAL\",\n format: \"CSV\",\n templateId: undefined,\n dateFrom: \"\",\n dateTo: \"\",\n};\n\n/**\n * The `createExportJob` input for a filled-in form: exactly what the legacy\n * wizard sends for the same choices, so a download contains the same data.\n * Values in a closed \"More options\" fold are part of the form and are sent.\n */\nexport function toCreateExportInput(\n form: NewDownloadForm,\n organizationId: string | undefined,\n): CreateExportJobInput {\n return {\n name: form.name.trim(),\n entityTypes: form.entityTypes,\n format: form.format,\n exportScope: form.scope,\n organizationId: form.scope === \"ORG_ADMIN\" ? organizationId : undefined,\n templateId: form.templateId,\n dateRangeStart: form.dateFrom\n ? new Date(form.dateFrom).toISOString()\n : null,\n dateRangeEnd: form.dateTo ? new Date(form.dateTo).toISOString() : null,\n };\n}\n\n/**\n * Apply a saved setup to the form: its data types (only the ones this shell\n * offers), its format when the service supports it, and its id. The name is\n * the setup's name unless the person already typed their own.\n */\nexport function applySavedSetup(\n form: NewDownloadForm,\n setup: ExportTemplate,\n isSelectable: (entityType: string) => boolean,\n nameTouched: boolean,\n): NewDownloadForm {\n const format = setup.format?.toUpperCase() as ExportFormat | undefined;\n return {\n ...form,\n templateId: setup.id,\n entityTypes: (setup.entityTypes ?? []).filter(isSelectable),\n format: format && SUPPORTED_FORMATS.includes(format) ? format : form.format,\n name: nameTouched ? form.name : (setup.name ?? form.name),\n };\n}\n\n/** \"Workflows and runs — 13 Nov 2026\": the prefilled download name. */\nexport function suggestedDownloadName(\n what: string,\n now: Date = new Date(),\n locale?: string,\n): string {\n const date = now.toLocaleDateString(locale, {\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n });\n return `${what} — ${date}`;\n}\n"],"mappings":";AAIA,IAAaA,IAA6C,CAAC,OAAO,MAAM,GAiB3DC,IAA6C;CACxD,aAAa,CAAC;CACd,MAAM;CACN,OAAO;CACP,QAAQ;CACR,YAAY,KAAA;CACZ,UAAU;CACV,QAAQ;AACV;AAOA,SAAgBC,EACd,GACA,GACsB;CACtB,OAAO;EACL,MAAMC,EAAK,KAAK,KAAK;EACrB,aAAaA,EAAK;EAClB,QAAQA,EAAK;EACb,aAAaA,EAAK;EAClB,gBAAgBA,EAAK,UAAU,cAAcC,IAAiB,KAAA;EAC9D,YAAYD,EAAK;EACjB,gBAAgBA,EAAK,WACjB,IAAI,KAAKA,EAAK,QAAQ,CAAC,CAAC,YAAY,IACpC;EACJ,cAAcA,EAAK,SAAS,IAAI,KAAKA,EAAK,MAAM,CAAC,CAAC,YAAY,IAAI;CACpE;AACF;AAOA,SAAgBE,EACd,GACA,GACA,GACA,GACiB;CACjB,IAAMC,IAASC,EAAM,QAAQ,YAAY;CACzC,OAAO;EACL,GAAGJ;EACH,YAAYI,EAAM;EAClB,cAAcA,EAAM,eAAe,CAAC,EAAA,CAAG,OAAOC,CAAY;EAC1D,QAAQF,KAAUN,EAAkB,SAASM,CAAM,IAAIA,IAASH,EAAK;EACrE,MAAMM,IAAcN,EAAK,OAAQI,EAAM,QAAQJ,EAAK;CACtD;AACF;AAGA,SAAgBO,EACd,GACA,oBAAY,IAAI,KAAK,GACrB,GACQ;CAMR,OAAO,GAAGC,EAAK,KALFC,EAAI,mBAAmBC,GAAQ;EAC1C,KAAK;EACL,OAAO;EACP,MAAM;CACR,CACoB;AACtB"}
@@ -0,0 +1,2 @@
1
+ /** Join a base path and a sub path without doubling or dropping a slash. */
2
+ export declare function joinPath(base: string, path: string): string;
@@ -0,0 +1,7 @@
1
+ // src/export/utils/paths.ts
2
+ function e(e, t) {
3
+ return (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
4
+ }
5
+ export { e as joinPath };
6
+
7
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","names":["joinPath","base","path"],"sources":["../../../src/export/utils/paths.ts"],"sourcesContent":["/** Join a base path and a sub path without doubling or dropping a slash. */\nexport function joinPath(base: string, path: string): string {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n}\n"],"mappings":";AACA,SAAgBA,EAAS,GAAc,GAAsB;CAG3D,QAFkBC,EAAK,SAAS,GAAG,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA,MACzCC,EAAK,WAAW,GAAG,IAAIA,IAAO,IAAIA;AAEtD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-export",
3
- "version": "2026.1108.1",
3
+ "version": "2026.1113.1",
4
4
  "description": "Burdenoff Export Microfrontend - Data export management interface",
5
5
  "type": "module",
6
6
  "files": [
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@apollo/client": "^4.3.7",
49
- "@burdenoff/fe-libs": "2026.801.1",
49
+ "@burdenoff/fe-libs": "2026.1113.6",
50
50
  "@tanstack/react-query": "^5.106.1",
51
51
  "clsx": "^2.1.1",
52
52
  "graphql": "^16.15.0",