@antelopejs/interface-dms 0.5.11 → 0.5.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.5.12
4
+
5
+ [compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.5.11...v0.5.12)
6
+
7
+ ### 🚀 Enhancements
8
+
9
+ - **actions:** Let a button download a file with the user's session ([#246](https://github.com/AntelopeJS/dms/pull/246))
10
+
11
+ ### 🏡 Chore
12
+
13
+ - **release:** @antelopejs/dms v0.7.16 ([05bb8bba](https://github.com/AntelopeJS/dms/commit/05bb8bba))
14
+
15
+ ### ❤️ Contributors
16
+
17
+ - Antony Rizzitelli <rizzitelli.antony@pm.me>
18
+
3
19
  ## v0.5.11
4
20
 
5
21
  [compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.5.10...v0.5.11)
@@ -61,6 +61,27 @@ export interface SidePanelTargetOptions {
61
61
  */
62
62
  notFound?: SidePanelNotFoundTexts;
63
63
  }
64
+ /**
65
+ * A `download` action target: the file is fetched with the user's session and
66
+ * saved, the page left as it is.
67
+ */
68
+ export interface DownloadActionTarget {
69
+ type: "download";
70
+ /**
71
+ * The file to fetch, with the user's session: takes the same `{field}` and
72
+ * page URL tokens (`{{params.X}}`, `{{query.X}}`) as a `page` target, a
73
+ * query pair whose token the page has no value for being left out.
74
+ * @example "/api/lang/translations/export?workspace={{query.workspace}}&locale={{query.locale}}"
75
+ */
76
+ url: string;
77
+ /**
78
+ * The saved file's name, same tokens (written as they are, not encoded).
79
+ * Else, or while a token is left without a value, the server's
80
+ * `Content-Disposition` name, else the URL's last path segment.
81
+ * @example "{{query.locale}}.json"
82
+ */
83
+ filename?: string;
84
+ }
64
85
  export type ActionTarget = {
65
86
  type: "drawer";
66
87
  component: Component;
@@ -103,7 +124,7 @@ export type ActionTarget = {
103
124
  /** Takes the same `{field}` and page URL tokens as a `page` target. */
104
125
  url: string;
105
126
  newTab?: boolean;
106
- } | {
127
+ } | DownloadActionTarget | {
107
128
  type: "quickAction";
108
129
  /**
109
130
  * Key of the quick action to run: `category:id`, or the bare id when no
@@ -178,7 +199,7 @@ export type ActionTargetSerialized = {
178
199
  type: "external";
179
200
  url: string;
180
201
  newTab?: boolean;
181
- } | {
202
+ } | DownloadActionTarget | {
182
203
  type: "quickAction";
183
204
  /**
184
205
  * Key of the quick action to run: `category:id`, or the bare id when no
@@ -127,8 +127,8 @@ export interface CustomRowAction<T extends Record<string, unknown> = Record<stri
127
127
  /**
128
128
  * Offers the action on the selection bar, for the selected rows: an `api`
129
129
  * or `exportJob` target receives their `ids` as a repeated query parameter
130
- * (`?ids=a&ids=b`), a page or external URL too, a drawer or modal
131
- * component a `selection` prop. With `{ allMatching: true }`, "Select all
130
+ * (`?ids=a&ids=b`), a page, external or download URL too, a drawer or
131
+ * modal component a `selection` prop. With `{ allMatching: true }`, "Select all
132
132
  * N matching" sends `allMatching=true` and the table's filters and search
133
133
  * instead. A fixed confirmation receives `{ count }`.
134
134
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/interface-dms",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "Public AntelopeJS interfaces of the DMS: pages, components, permissions, tenancy, auth, notifications and HTML rendering.",
5
5
  "keywords": [
6
6
  "antelopejs",