@multiplatform.one/backoffice 7.11.0 → 7.16.0

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 (100) hide show
  1. package/dist/cjs/desk/Desk.cjs +2 -6
  2. package/dist/cjs/desk/Desk.native.js +2 -7
  3. package/dist/cjs/desk/Desk.native.js.map +1 -1
  4. package/dist/cjs/desk/DeskSurface.native.js.map +1 -1
  5. package/dist/cjs/form/FormTimeline.cjs +6 -1
  6. package/dist/cjs/form/FormTimeline.native.js +6 -1
  7. package/dist/cjs/form/FormTimeline.native.js.map +1 -1
  8. package/dist/cjs/list/DoctypeListScreen.cjs +1 -0
  9. package/dist/cjs/list/DoctypeListScreen.native.js +1 -0
  10. package/dist/cjs/list/DoctypeListScreen.native.js.map +1 -1
  11. package/dist/cjs/list/ListBulkActionsBar.cjs +1 -0
  12. package/dist/cjs/list/ListBulkActionsBar.native.js +1 -0
  13. package/dist/cjs/list/ListBulkActionsBar.native.js.map +1 -1
  14. package/dist/cjs/list/bulk-export.cjs +28 -3
  15. package/dist/cjs/list/bulk-export.native.js +37 -3
  16. package/dist/cjs/list/bulk-export.native.js.map +1 -1
  17. package/dist/cjs/shared/useDoctypeMeta.native.js.map +1 -1
  18. package/dist/cjs/shared/useUserRoles.cjs +1 -39
  19. package/dist/cjs/shared/useUserRoles.native.js +1 -43
  20. package/dist/cjs/shared/useUserRoles.native.js.map +1 -1
  21. package/dist/esm/desk/Desk.mjs +2 -6
  22. package/dist/esm/desk/Desk.mjs.map +1 -1
  23. package/dist/esm/desk/Desk.native.js +2 -7
  24. package/dist/esm/desk/Desk.native.js.map +1 -1
  25. package/dist/esm/desk/DeskSurface.mjs.map +1 -1
  26. package/dist/esm/desk/DeskSurface.native.js.map +1 -1
  27. package/dist/esm/form/FormTimeline.mjs +6 -1
  28. package/dist/esm/form/FormTimeline.mjs.map +1 -1
  29. package/dist/esm/form/FormTimeline.native.js +6 -1
  30. package/dist/esm/form/FormTimeline.native.js.map +1 -1
  31. package/dist/esm/list/DoctypeListScreen.mjs +1 -0
  32. package/dist/esm/list/DoctypeListScreen.mjs.map +1 -1
  33. package/dist/esm/list/DoctypeListScreen.native.js +1 -0
  34. package/dist/esm/list/DoctypeListScreen.native.js.map +1 -1
  35. package/dist/esm/list/ListBulkActionsBar.mjs +1 -0
  36. package/dist/esm/list/ListBulkActionsBar.mjs.map +1 -1
  37. package/dist/esm/list/ListBulkActionsBar.native.js +1 -0
  38. package/dist/esm/list/ListBulkActionsBar.native.js.map +1 -1
  39. package/dist/esm/list/bulk-export.mjs +27 -3
  40. package/dist/esm/list/bulk-export.mjs.map +1 -1
  41. package/dist/esm/list/bulk-export.native.js +36 -3
  42. package/dist/esm/list/bulk-export.native.js.map +1 -1
  43. package/dist/esm/shared/useDoctypeMeta.mjs.map +1 -1
  44. package/dist/esm/shared/useDoctypeMeta.native.js.map +1 -1
  45. package/dist/esm/shared/useUserRoles.mjs +2 -40
  46. package/dist/esm/shared/useUserRoles.mjs.map +1 -1
  47. package/dist/esm/shared/useUserRoles.native.js +2 -44
  48. package/dist/esm/shared/useUserRoles.native.js.map +1 -1
  49. package/dist/jsx/desk/Desk.mjs +2 -6
  50. package/dist/jsx/desk/Desk.mjs.map +1 -1
  51. package/dist/jsx/desk/Desk.native.js +2 -7
  52. package/dist/jsx/desk/Desk.native.js.map +1 -1
  53. package/dist/jsx/desk/DeskSurface.mjs.map +1 -1
  54. package/dist/jsx/desk/DeskSurface.native.js.map +1 -1
  55. package/dist/jsx/form/FormTimeline.mjs +6 -1
  56. package/dist/jsx/form/FormTimeline.mjs.map +1 -1
  57. package/dist/jsx/form/FormTimeline.native.js +6 -1
  58. package/dist/jsx/form/FormTimeline.native.js.map +1 -1
  59. package/dist/jsx/list/DoctypeListScreen.mjs +1 -0
  60. package/dist/jsx/list/DoctypeListScreen.mjs.map +1 -1
  61. package/dist/jsx/list/DoctypeListScreen.native.js +1 -0
  62. package/dist/jsx/list/DoctypeListScreen.native.js.map +1 -1
  63. package/dist/jsx/list/ListBulkActionsBar.mjs +1 -0
  64. package/dist/jsx/list/ListBulkActionsBar.mjs.map +1 -1
  65. package/dist/jsx/list/ListBulkActionsBar.native.js +1 -0
  66. package/dist/jsx/list/ListBulkActionsBar.native.js.map +1 -1
  67. package/dist/jsx/list/bulk-export.mjs +27 -3
  68. package/dist/jsx/list/bulk-export.mjs.map +1 -1
  69. package/dist/jsx/list/bulk-export.native.js +37 -3
  70. package/dist/jsx/list/bulk-export.native.js.map +1 -1
  71. package/dist/jsx/shared/useDoctypeMeta.mjs.map +1 -1
  72. package/dist/jsx/shared/useDoctypeMeta.native.js.map +1 -1
  73. package/dist/jsx/shared/useUserRoles.mjs +2 -40
  74. package/dist/jsx/shared/useUserRoles.mjs.map +1 -1
  75. package/dist/jsx/shared/useUserRoles.native.js +1 -43
  76. package/dist/jsx/shared/useUserRoles.native.js.map +1 -1
  77. package/package.json +14 -14
  78. package/src/desk/Desk.spec.tsx +32 -1
  79. package/src/desk/Desk.tsx +8 -14
  80. package/src/desk/DeskSurface.tsx +7 -8
  81. package/src/form/FormErrorBoundary.spec.tsx +5 -3
  82. package/src/form/FormTimeline.optimistic.spec.tsx +33 -13
  83. package/src/form/FormTimeline.tsx +7 -1
  84. package/src/list/DoctypeListScreen.tsx +2 -2
  85. package/src/list/ListBulkActionsBar.tsx +2 -1
  86. package/src/list/bulk-export.spec.ts +75 -0
  87. package/src/list/bulk-export.tsx +31 -6
  88. package/src/shared/useDoctypeMeta.ts +4 -5
  89. package/src/shared/useUserRoles.ts +7 -59
  90. package/types/desk/Desk.d.ts +4 -4
  91. package/types/desk/Desk.d.ts.map +1 -1
  92. package/types/desk/DeskSurface.d.ts.map +1 -1
  93. package/types/form/FormTimeline.d.ts.map +1 -1
  94. package/types/list/DoctypeListScreen.d.ts.map +1 -1
  95. package/types/list/ListBulkActionsBar.d.ts.map +1 -1
  96. package/types/list/bulk-export.d.ts +5 -1
  97. package/types/list/bulk-export.d.ts.map +1 -1
  98. package/types/shared/useDoctypeMeta.d.ts.map +1 -1
  99. package/types/shared/useUserRoles.d.ts +5 -9
  100. package/types/shared/useUserRoles.d.ts.map +1 -1
@@ -0,0 +1,75 @@
1
+ import type { FrappeApp } from "@multiplatform.one/frappe";
2
+ import { FileSaveError, type FileSaveOptions } from "@multiplatform.one/platform/file";
3
+ import { beforeEach, describe, expect, it, vi } from "vitest";
4
+
5
+ const saveFile = vi.hoisted(() => vi.fn());
6
+ vi.mock("@multiplatform.one/platform/file", async (importOriginal) => ({
7
+ ...(await importOriginal<typeof import("@multiplatform.one/platform/file")>()),
8
+ saveFile,
9
+ }));
10
+
11
+ import { bulkExportCsv } from "./bulk-export";
12
+
13
+ const rows = [
14
+ { name: "SO-2", customer: "Acme, Inc." },
15
+ { name: "SO-1", customer: "Globex" },
16
+ ];
17
+
18
+ function appWith(getDocList = vi.fn(async () => rows)) {
19
+ return { db: () => ({ getDocList }) } as unknown as FrappeApp;
20
+ }
21
+
22
+ const meta = {
23
+ name: "Sales Order",
24
+ fields: [{ fieldname: "customer", fieldtype: "Link" as const, in_list_view: 1 as const }],
25
+ };
26
+
27
+ describe("bulkExportCsv saves through the platform file API (MPO-22)", () => {
28
+ beforeEach(() => {
29
+ saveFile.mockReset();
30
+ });
31
+
32
+ it("hands the CSV bytes, filename and type to saveFile, in selection order", async () => {
33
+ saveFile.mockResolvedValue({
34
+ status: "written",
35
+ uri: "content://provider/tree/sales-order.csv",
36
+ requestedFilename: "sales-order.csv",
37
+ byteLength: 42,
38
+ });
39
+ const result = await bulkExportCsv(appWith(), "Sales Order", ["SO-1", "SO-2"], meta);
40
+
41
+ const request = saveFile.mock.calls[0][0] as FileSaveOptions;
42
+ expect(request.filename).toBe("sales-order.csv");
43
+ expect(request.mimeType).toBe("text/csv;charset=utf-8");
44
+ expect(new TextDecoder().decode(request.bytes)).toBe(
45
+ 'name,customer\r\nSO-1,Globex\r\nSO-2,"Acme, Inc."',
46
+ );
47
+ expect(result).toMatchObject({ rowCount: 2, downloaded: true, cancelled: false });
48
+ });
49
+
50
+ it("a web download request counts as downloaded", async () => {
51
+ saveFile.mockResolvedValue({ status: "download-requested" });
52
+ const result = await bulkExportCsv(appWith(), "Sales Order", ["SO-1"], meta);
53
+ expect(result).toMatchObject({ downloaded: true, cancelled: false });
54
+ });
55
+
56
+ it("a cancelled native picker is not an unsupported platform", async () => {
57
+ saveFile.mockResolvedValue({ status: "not-saved", reason: "cancelled-or-refused" });
58
+ const result = await bulkExportCsv(appWith(), "Sales Order", ["SO-1"], meta);
59
+ expect(result).toMatchObject({ downloaded: false, cancelled: true });
60
+ });
61
+
62
+ it("a platform with no save path reports not downloaded and keeps the CSV", async () => {
63
+ saveFile.mockRejectedValue(new FileSaveError("unavailable", "no save path"));
64
+ const result = await bulkExportCsv(appWith(), "Sales Order", ["SO-1"], meta);
65
+ expect(result).toMatchObject({ downloaded: false, cancelled: false });
66
+ expect(result.csv.startsWith("name,customer")).toBe(true);
67
+ });
68
+
69
+ it("a failed write surfaces as an error", async () => {
70
+ saveFile.mockRejectedValue(new FileSaveError("write-failed", "disk full"));
71
+ await expect(bulkExportCsv(appWith(), "Sales Order", ["SO-1"], meta)).rejects.toMatchObject({
72
+ code: "write-failed",
73
+ });
74
+ });
75
+ });
@@ -1,10 +1,12 @@
1
1
  // Client-side CSV export for the selected rows (desk "Export" parity, scoped
2
2
  // to the selection): fetch the selected docs' list-view fields via
3
- // app.db().getDocList, build the CSV locally, download it web-side.
4
- // KNOWN GAP: native/GTK have no document/Blob download path — callers get
5
- // `downloaded: false` plus the CSV text and should surface the gap honestly.
3
+ // app.db().getDocList, build the CSV locally, save it through the platform
4
+ // file API (a download on web, the system save picker on native).
5
+ // KNOWN GAP: GTK has no save path — callers get `downloaded: false` plus the
6
+ // CSV text and should surface the gap honestly.
6
7
  import React from "react";
7
8
  import type { FrappeApp } from "@multiplatform.one/frappe";
9
+ import { FileSaveError, saveFile } from "@multiplatform.one/platform/file";
8
10
  import type { DoctypeMeta } from "../shared/useDoctypeMeta";
9
11
  import { BULK_EDIT_EXCLUDED_FIELDTYPES } from "./bulk-edit-dialog";
10
12
 
@@ -61,8 +63,32 @@ export interface BulkExportResult {
61
63
  csv: string;
62
64
  /** Rows actually fetched — may be fewer than requested (permissions). */
63
65
  rowCount: number;
64
- /** False on platforms without a download path (native/GTK). */
66
+ /** A file was written (native) or a download requested (web). False on GTK. */
65
67
  downloaded: boolean;
68
+ /** The native save picker was cancelled or refused; nothing was written. */
69
+ cancelled: boolean;
70
+ }
71
+
72
+ /** Save CSV text through the platform file API. Throws on picker/write failure. */
73
+ export async function saveCsvFile(
74
+ filename: string,
75
+ csv: string,
76
+ ): Promise<Pick<BulkExportResult, "downloaded" | "cancelled">> {
77
+ try {
78
+ const result = await saveFile({
79
+ bytes: new TextEncoder().encode(csv),
80
+ filename,
81
+ mimeType: "text/csv;charset=utf-8",
82
+ });
83
+ return result.status === "not-saved"
84
+ ? { downloaded: false, cancelled: true }
85
+ : { downloaded: true, cancelled: false };
86
+ } catch (error) {
87
+ if (error instanceof FileSaveError && error.code === "unavailable") {
88
+ return { downloaded: false, cancelled: false };
89
+ }
90
+ throw error;
91
+ }
66
92
  }
67
93
 
68
94
  /** Fetch the selected docs and export them as CSV (selection-scoped export). */
@@ -86,6 +112,5 @@ export async function bulkExportCsv(
86
112
  );
87
113
  const csv = buildCsv(fields, sorted as Record<string, unknown>[]);
88
114
  const filename = `${doctype.toLowerCase().replace(/\s+/g, "-")}.csv`;
89
- const downloaded = downloadTextFile(filename, csv);
90
- return { csv, rowCount: sorted.length, downloaded };
115
+ return { csv, rowCount: sorted.length, ...(await saveCsvFile(filename, csv)) };
91
116
  }
@@ -10,11 +10,10 @@ import type { DocFieldMeta, DoctypeMeta } from "@multiplatform.one/frappe-ui";
10
10
  import { useCallback, useEffect, useMemo, useState } from "react";
11
11
  import { useFrappeApp } from "./useFrappeApp";
12
12
 
13
- // The meta SHAPES live one tier down, in
14
- // `@multiplatform.one/frappe-ui/src/formEngine/doctypeMeta` — the desk form
15
- // engine consumes them and the engine moved there (MPO-15). This module keeps
16
- // the LOADER (it needs the backoffice app context) and re-exports the shapes
17
- // so every existing `@multiplatform.one/backoffice` import still resolves.
13
+ // The meta shapes are the one model `@multiplatform.one/frappe` declares
14
+ // (MPO-15), under the desk names frappe-ui gives them. This module keeps the
15
+ // LOADER (it needs the backoffice app context) and re-exports the shapes so
16
+ // every existing `@multiplatform.one/backoffice` import still resolves.
18
17
  export type {
19
18
  DocFieldMeta,
20
19
  DocLinkMeta,
@@ -1,66 +1,14 @@
1
1
  /**
2
- * Session user's role list — the client-side half of desk's
3
- * `frappe.user_roles` (bootinfo). Fetched once per session via the
4
- * whitelisted `frappe.core.doctype.user.user.get_roles` RPC (probed:
5
- * `?uid=<user>` → `{"message": ["Role", ...]}`), keyed off
6
- * `frappe.auth.get_logged_user`.
7
- *
8
- * `roles` stays undefined while loading, in fixture mode, or when the RPC
9
- * fails — consumers (permlevel matrix) fall back to the conservative
10
- * "permlevel > 0 → read-only" rule in that case.
2
+ * Session user's role list for backoffice surfaces, read off the ambient
3
+ * FrappeProvider. The fetch itself lives in frappe-ui's form engine
4
+ * (`useSessionRoles`) so FrappeForm and the desk resolve permlevel from one
5
+ * source; `roles` stays undefined while loading, in fixture mode, or when
6
+ * the RPC fails.
11
7
  */
12
8
 
13
- import { useFrappeConfig } from "@multiplatform.one/frappe-ui";
14
- import { useEffect, useState } from "react";
15
- import { useFrappeApp } from "./useFrappeApp";
16
-
17
- const rolesCache = new Map<string, Promise<string[]>>();
9
+ import { useFrappeConfig, useSessionRoles } from "@multiplatform.one/frappe-ui";
18
10
 
19
11
  export function useUserRoles(): { roles?: string[] } {
20
- const app = useFrappeApp();
21
12
  const config = useFrappeConfig();
22
- const fixtures = config?.fixtures;
23
- const baseURL = config?.baseURL;
24
- const [roles, setRoles] = useState<string[] | undefined>(undefined);
25
-
26
- useEffect(() => {
27
- // Fixture mode has no session — permlevel falls back to the coarse rule.
28
- if (!app || fixtures || !baseURL) {
29
- setRoles(undefined);
30
- return;
31
- }
32
- let cancelled = false;
33
- let promise = rolesCache.get(baseURL);
34
- if (!promise) {
35
- promise = app
36
- .call()
37
- .get<{ message?: string }>("frappe.auth.get_logged_user")
38
- .then((res) => {
39
- const user = res.payload?.message;
40
- if (!user) throw new Error("No session user");
41
- return app.call().get<{ message?: string[] }>("frappe.core.doctype.user.user.get_roles", {
42
- uid: user,
43
- });
44
- })
45
- .then((res) => {
46
- const list = res.payload?.message;
47
- if (!Array.isArray(list)) throw new Error("No roles returned");
48
- return list;
49
- });
50
- rolesCache.set(baseURL, promise);
51
- promise.catch(() => rolesCache.delete(baseURL));
52
- }
53
- promise
54
- .then((list) => {
55
- if (!cancelled) setRoles(list);
56
- })
57
- .catch(() => {
58
- if (!cancelled) setRoles(undefined);
59
- });
60
- return () => {
61
- cancelled = true;
62
- };
63
- }, [app, fixtures, baseURL]);
64
-
65
- return { roles };
13
+ return { roles: useSessionRoles(config) };
66
14
  }
@@ -12,10 +12,10 @@ import { type DeskTarget } from "./target";
12
12
  export type DeskChrome = "full" | "bare" | "content";
13
13
  export interface DeskProps {
14
14
  /**
15
- * Frappe connection. Omit to inherit an ambient FrappeProvider (or
16
- * BackofficeProvider). IGNORED when an ambient provider exists — Desk
17
- * warns once, because the SyncModule is cached per baseURL and a second
18
- * config for the same server silently loses to the first.
15
+ * Frappe connection. Wins over an ambient FrappeProvider; omit it to
16
+ * inherit the ambient one. The SyncModule is shared per baseURL, socket
17
+ * target and syncOptions, so a config matching the ambient one on all
18
+ * three also shares its auth.
19
19
  */
20
20
  frappe?: BackofficeFrappeConfig;
21
21
  /** Pin the desk to one doctype. Sets the initial target AND the scope. */
@@ -1 +1 @@
1
- {"version":3,"file":"Desk.d.ts","sourceRoot":"","sources":["../../src/desk/Desk.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,a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ACzE,UAAU,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC;AAQD,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,IAAI,EACJ,OAAO,EACP,cAAc,EACd,WAAW,EACX,UAAU,GACX,EAAE,iBAAiB,2CAoqBnB"}
1
+ {"version":3,"file":"FormTimeline.d.ts","sourceRoot":"","sources":["../../src/form/FormTimeline.tsx"],"names":[],"mappings":"AA0EA,OAAO,EAIL,KAAK,mBAAmB,EAGzB,MAAM,oBAAoB,CAAC;AAY5B,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,UAAU,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC;AAQD,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,IAAI,EACJ,OAAO,EACP,cAAc,EACd,WAAW,EACX,UAAU,GACX,EAAE,iBAAiB,2CA0qBnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"DoctypeListScreen.d.ts","sourceRoot":"","sources":["../../src/list/DoctypeListScreen.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAEV,eAAe,EAIhB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAS1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,0BAA0B,CAAC;AAoB5E,OAAO,EAAg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ACf,EAAE,sBAAsB,2CA86BxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListBulkActionsBar.d.ts","sourceRoot":"","sources":["../../src/list/ListBulkActionsBar.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAS5D,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,8BAA8B;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,IAAI,EACJ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,EAAE,uBAAuB,kDAsUzB"}
1
+ {"version":3,"file":"ListBulkActionsBar.d.ts","sourceRoot":"","sources":["../../src/list/ListBulkActionsBar.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAS5D,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,8BAA8B;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,IAAI,EACJ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,EAAE,uBAAuB,kDAuUzB"}
@@ -11,9 +11,13 @@ export interface BulkExportResult {
11
11
  csv: string;
12
12
  /** Rows actually fetched — may be fewer than requested (permissions). */
13
13
  rowCount: number;
14
- /** False on platforms without a download path (native/GTK). */
14
+ /** A file was written (native) or a download requested (web). False on GTK. */
15
15
  downloaded: boolean;
16
+ /** The native save picker was cancelled or refused; nothing was written. */
17
+ cancelled: boolean;
16
18
  }
19
+ /** Save CSV text through the platform file API. Throws on picker/write failure. */
20
+ export declare function saveCsvFile(filename: string, csv: string): Promise<Pick<BulkExportResult, "downloaded" | "cancelled">>;
17
21
  /** Fetch the selected docs and export them as CSV (selection-scoped export). */
18
22
  export declare function bulkExportCsv(app: FrappeApp, doctype: string, names: string[], meta?: DoctypeMeta): Promise<BulkExportResult>;
19
23
  //# sourceMappingURL=bulk-export.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bulk-export.d.ts","sourceRoot":"","sources":["../../src/list/bulk-export.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAS5D,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,MAAM,CAMnF;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CAS7D;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,SAAa,GAAG,OAAO,CAkB3F;AAED,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,gFAAgF;AAChF,wBAAsB,aAAa,CACjC,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAiB3B"}
1
+ {"version":3,"file":"bulk-export.d.ts","sourceRoot":"","sources":["../../src/list/bulk-export.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAS5D,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,MAAM,CAMnF;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CAS7D;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,SAAa,GAAG,OAAO,CAkB3F;AAED,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,mFAAmF;AACnF,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,WAAW,CAAC,CAAC,CAgB7D;AAED,gFAAgF;AAChF,wBAAsB,aAAa,CACjC,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAgB3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDoctypeMeta.d.ts","sourceRoot":"","sources":["../../src/shared/useDoctypeMeta.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAS9E,YAAY,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,WAAW,GACZ,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxC,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAmCD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG;IAChD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAgFA"}
1
+ {"version":3,"file":"useDoctypeMeta.d.ts","sourceRoot":"","sources":["../../src/shared/useDoctypeMeta.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAQ9E,YAAY,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,WAAW,GACZ,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxC,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAmCD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG;IAChD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAgFA"}
@@ -1,13 +1,9 @@
1
1
  /**
2
- * Session user's role list — the client-side half of desk's
3
- * `frappe.user_roles` (bootinfo). Fetched once per session via the
4
- * whitelisted `frappe.core.doctype.user.user.get_roles` RPC (probed:
5
- * `?uid=<user>` → `{"message": ["Role", ...]}`), keyed off
6
- * `frappe.auth.get_logged_user`.
7
- *
8
- * `roles` stays undefined while loading, in fixture mode, or when the RPC
9
- * fails — consumers (permlevel matrix) fall back to the conservative
10
- * "permlevel > 0 → read-only" rule in that case.
2
+ * Session user's role list for backoffice surfaces, read off the ambient
3
+ * FrappeProvider. The fetch itself lives in frappe-ui's form engine
4
+ * (`useSessionRoles`) so FrappeForm and the desk resolve permlevel from one
5
+ * source; `roles` stays undefined while loading, in fixture mode, or when
6
+ * the RPC fails.
11
7
  */
12
8
  export declare function useUserRoles(): {
13
9
  roles?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"useUserRoles.d.ts","sourceRoot":"","sources":["../../src/shared/useUserRoles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,wBAAgB,YAAY,IAAI;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CA+CnD"}
1
+ {"version":3,"file":"useUserRoles.d.ts","sourceRoot":"","sources":["../../src/shared/useUserRoles.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,wBAAgB,YAAY,IAAI;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAGnD"}