@dforge-core/metadata 0.0.54 → 0.0.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dforge-core/metadata",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "description": "Canonical dForge authoring registries — field types, base datatypes, column types, traits, data-view kinds and chart types — with derivation helpers. Runtime-dependency-free; the single source of truth shared by editors, the web app and the CLI.",
5
5
  "license": "MIT",
6
6
  "author": "dForge",
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "dForge Module Export Templates",
4
+ "description": "Excel export template declarations for a dForge module package (ui/export_templates.json). Each key is the template_cd; the value binds an .xlsx file under export_templates/ to an entity. A user picks it from the grid's Export menu, and data.export with that template pours the entity's rows into the workbook: a cell {{rows.column_cd}} repeats once per row, {{_count}} is the row count and {{_today}} today's date.",
5
+ "type": "object",
6
+ "additionalProperties": {
7
+ "type": "object",
8
+ "properties": {
9
+ "entityCd": {
10
+ "type": "string",
11
+ "description": "Entity code whose rows the template receives. Cross-module form 'module.entity' is supported."
12
+ },
13
+ "description": {
14
+ "type": "string",
15
+ "description": "Label shown in the Export menu. Defaults to the template code."
16
+ },
17
+ "file": {
18
+ "type": "string",
19
+ "description": "Relative path of the .xlsx under the module's export_templates/ directory (e.g. 'invoices.xlsx')."
20
+ }
21
+ },
22
+ "required": ["entityCd", "file"],
23
+ "additionalProperties": false
24
+ }
25
+ }
@@ -45,7 +45,12 @@
45
45
  },
46
46
  "description": {
47
47
  "type": "string",
48
- "description": "Module description"
48
+ "description": "Module description. The marketplace module page shows it whole when the package has no README; the catalog card shows shortDescription, else the start of this cut at a sentence."
49
+ },
50
+ "shortDescription": {
51
+ "type": "string",
52
+ "maxLength": 1000,
53
+ "description": "Marketplace card text (at most 1000 characters). Optional; refreshed on every publish."
49
54
  },
50
55
  "schemaName": {
51
56
  "type": "string",
@@ -212,6 +212,12 @@ export const BUILTINS: Builtin[] = [
212
212
  returns: "string",
213
213
  doc: "`downloadText()` for bytes: decodes `base64` and hands it to the user as `fileName` (`application/octet-stream` unless `mimeType` says otherwise). Returns the signed download URL.",
214
214
  },
215
+ {
216
+ name: "exportXlsx",
217
+ signature: "exportXlsx(entity, templateCd, options?)",
218
+ returns: "object",
219
+ doc: "Fill an Excel export template of `entity` with its rows and hand the user the workbook as the action's download. `options`: `filter` (`{c,o,v}` / `{g,i}` as in `select()`, `v` a scalar), `orderBy` (as in `select()`), `fileName` (default: the template's description). The rows are read as `data.export` reads them, under the current user's rights. Returns `{ url, fileName, recordCount }`. Counts as a download; not available in a scheduled or background run.",
220
+ },
215
221
  {
216
222
  name: "attachText",
217
223
  signature: "attachText(content, fileName, encoding?, mimeType?)",
@@ -0,0 +1,19 @@
1
+ // Export templates — authoring shape of `ui/export_templates.json`.
2
+ // Mirror of export_templates.schema.json.
3
+
4
+ /**
5
+ * An Excel export template (value in the export_templates map). The `.xlsx` lives under
6
+ * the module's `export_templates/` directory; `data.export` with the template pours the
7
+ * entity's rows into it (`{{rows.column_cd}}` repeats per row, `{{_count}}`, `{{_today}}`).
8
+ */
9
+ export interface ExportTemplateDef {
10
+ /** Entity code whose rows the template receives. */
11
+ entityCd: string;
12
+ /** Label shown in the grid's Export menu. Defaults to the template code. */
13
+ description?: string;
14
+ /** Relative path of the .xlsx under `export_templates/`. */
15
+ file: string;
16
+ }
17
+
18
+ /** A `ui/export_templates.json` file: template_cd → definition. */
19
+ export type ExportTemplatesFile = Record<string, ExportTemplateDef>;
package/src/index.ts CHANGED
@@ -185,6 +185,7 @@ export type { JobsFile, JobDef } from "./jobs";
185
185
  export type { TriggersFile, TriggerDef, EntityEvent } from "./triggers";
186
186
  export type { WebhooksFile, WebhookSubscription, WebhookPayload } from "./webhooks";
187
187
  export type { PrintTemplatesFile, PrintTemplateDef, PrintPageSettings, PrintMargins } from "./print-templates";
188
+ export type { ExportTemplatesFile, ExportTemplateDef } from "./export-templates";
188
189
  export type {
189
190
  CardLayoutsFile,
190
191
  CardLayoutDef,
package/src/manifest.ts CHANGED
@@ -35,6 +35,8 @@ export interface ManifestDef {
35
35
  dbSchemaVersion: string;
36
36
  displayName: string;
37
37
  description?: string;
38
+ /** Marketplace card text, at most 1000 characters; without it the card shows the start of `description`. */
39
+ shortDescription?: string;
38
40
  /** Schema name override (defaults to `code`; system modules use 'dForge'). */
39
41
  schemaName?: string;
40
42
  /** System module flag (cannot be uninstalled, admin-only). Omit for regular modules. */