@aglyn/plugins-data 1.0.0-beta.219 → 1.0.0-beta.221

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 (63) hide show
  1. package/README.md +1 -1
  2. package/package.json +10 -10
  3. package/src/lib/constants/bundle-common.d.ts +2 -0
  4. package/src/lib/constants/bundle-common.js +1 -0
  5. package/src/lib/constants/bundle-common.js.map +1 -1
  6. package/src/lib/declarations.console-server.d.ts +47 -0
  7. package/src/lib/declarations.console-server.js +74 -0
  8. package/src/lib/declarations.console-server.js.map +1 -0
  9. package/src/lib/declarations.server.d.ts +4 -0
  10. package/src/lib/declarations.server.js +11 -1
  11. package/src/lib/declarations.server.js.map +1 -1
  12. package/src/lib/model/dataset-csv.d.ts +36 -0
  13. package/src/lib/model/dataset-csv.js +85 -0
  14. package/src/lib/model/dataset-csv.js.map +1 -0
  15. package/src/lib/model/dataset-io.d.ts +8 -7
  16. package/src/lib/model/dataset-io.js +9 -8
  17. package/src/lib/model/dataset-io.js.map +1 -1
  18. package/src/lib/model/dataset-record-list.d.ts +40 -0
  19. package/src/lib/model/dataset-record-list.js +61 -0
  20. package/src/lib/model/dataset-record-list.js.map +1 -0
  21. package/src/lib/model/dataset-record.d.ts +33 -0
  22. package/src/lib/model/dataset-record.js +68 -0
  23. package/src/lib/model/dataset-record.js.map +1 -0
  24. package/src/lib/plugin.js +3 -0
  25. package/src/lib/plugin.js.map +1 -1
  26. package/src/lib/server/announce-dataset-records.d.ts +37 -0
  27. package/src/lib/server/announce-dataset-records.js +54 -0
  28. package/src/lib/server/announce-dataset-records.js.map +1 -0
  29. package/src/lib/server/api-v1/datasets.d.ts +18 -0
  30. package/src/lib/server/api-v1/datasets.js +646 -0
  31. package/src/lib/server/api-v1/datasets.js.map +1 -0
  32. package/src/lib/server/api-v1/openapi.d.ts +26 -0
  33. package/src/lib/server/api-v1/openapi.js +260 -0
  34. package/src/lib/server/api-v1/openapi.js.map +1 -0
  35. package/src/lib/server/api-v1/usage.d.ts +26 -0
  36. package/src/lib/server/api-v1/usage.js +33 -0
  37. package/src/lib/server/api-v1/usage.js.map +1 -0
  38. package/src/lib/server/custom-field-types.d.ts +39 -0
  39. package/src/lib/server/custom-field-types.js +41 -0
  40. package/src/lib/server/custom-field-types.js.map +1 -0
  41. package/src/lib/server/dataset-figures.d.ts +61 -0
  42. package/src/lib/server/dataset-figures.js +413 -0
  43. package/src/lib/server/dataset-figures.js.map +1 -0
  44. package/src/lib/server/dataset-record-index.d.ts +18 -0
  45. package/src/lib/server/dataset-record-index.js +62 -0
  46. package/src/lib/server/dataset-record-index.js.map +1 -0
  47. package/src/lib/server/dataset-storage-meter.d.ts +29 -0
  48. package/src/lib/server/dataset-storage-meter.js +82 -0
  49. package/src/lib/server/dataset-storage-meter.js.map +1 -0
  50. package/src/lib/server/datasets-export-route.d.ts +57 -0
  51. package/src/lib/server/datasets-export-route.js +229 -0
  52. package/src/lib/server/datasets-export-route.js.map +1 -0
  53. package/src/lib/server/datasets-route.d.ts +38 -0
  54. package/src/lib/server/datasets-route.js +614 -0
  55. package/src/lib/server/datasets-route.js.map +1 -0
  56. package/src/lib/server.d.ts +23 -0
  57. package/src/lib/server.js +54 -0
  58. package/src/lib/server.js.map +1 -0
  59. package/src/lib/site-bundle/datasets-site-bundle.server.js +2 -15
  60. package/src/lib/site-bundle/datasets-site-bundle.server.js.map +1 -1
  61. package/src/lib/usage-axes.d.ts +24 -0
  62. package/src/lib/usage-axes.js +32 -0
  63. package/src/lib/usage-axes.js.map +1 -0
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { PluginIndexedRecord } from '@aglyn/aglyn/plugin-manager/plugin-record-index';
18
+ /**
19
+ * One stored dataset as this plugin shares it with another (AGL-3080) — the
20
+ * one shape its server index (`dataset-record-index.ts`) and its console list
21
+ * source (`dataset-record-list.ts`) both answer, so a reader on either side
22
+ * reads the same record.
23
+ *
24
+ * `null` for a deleted dataset. Otherwise its id, its name as the Data page
25
+ * shows it, and `facts`:
26
+ * `fields` — its fields in the dataset page's order, each
27
+ * `{ id, name, type }`; `visibleTo` — the scope tokens it is shared
28
+ * with, so a reader acting for a member can apply the platform's own
29
+ * visibility rule to them; and `installedFrom` — `{ listingId, version }`
30
+ * for a dataset installed from a listing (`version` as the install
31
+ * stamped it), `null` for one the workspace made. Never a record of it.
32
+ */
33
+ export declare function datasetIndexedRecord(id: string, data: Readonly<Record<string, unknown>> | undefined): PluginIndexedRecord | null;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { effectiveDatasetModel } from "@aglyn/aglyn/app-utils/dataset-models";
17
+ import { datasetDisplayName } from "@aglyn/aglyn/app-utils/datasets";
18
+ /**
19
+ * One stored dataset as this plugin shares it with another (AGL-3080) — the
20
+ * one shape its server index (`dataset-record-index.ts`) and its console list
21
+ * source (`dataset-record-list.ts`) both answer, so a reader on either side
22
+ * reads the same record.
23
+ *
24
+ * `null` for a deleted dataset. Otherwise its id, its name as the Data page
25
+ * shows it, and `facts`:
26
+ * `fields` — its fields in the dataset page's order, each
27
+ * `{ id, name, type }`; `visibleTo` — the scope tokens it is shared
28
+ * with, so a reader acting for a member can apply the platform's own
29
+ * visibility rule to them; and `installedFrom` — `{ listingId, version }`
30
+ * for a dataset installed from a listing (`version` as the install
31
+ * stamped it), `null` for one the workspace made. Never a record of it.
32
+ */ export function datasetIndexedRecord(id, data) {
33
+ if (!data || data['deletedAt'] != null) return null;
34
+ const model = effectiveDatasetModel(data);
35
+ const text = (value)=>typeof value === 'string' ? value.trim() : '';
36
+ return {
37
+ id,
38
+ name: datasetDisplayName(data) || id,
39
+ facts: {
40
+ fields: model.order.map((fieldId)=>{
41
+ var _ref;
42
+ var _model_fields_fieldId, _model_fields_fieldId1;
43
+ return {
44
+ id: fieldId,
45
+ name: text((_model_fields_fieldId = model.fields[fieldId]) == null ? void 0 : _model_fields_fieldId.name) || fieldId,
46
+ type: String((_ref = (_model_fields_fieldId1 = model.fields[fieldId]) == null ? void 0 : _model_fields_fieldId1.type) != null ? _ref : 'text')
47
+ };
48
+ }),
49
+ visibleTo: Array.isArray(data['visibleTo']) ? data['visibleTo'] : [],
50
+ installedFrom: installedFrom(data['source'])
51
+ }
52
+ };
53
+ }
54
+ /**
55
+ * Where an installed dataset came from. Read from its `source` stamp, which
56
+ * every dataset install has written — the ones from before install
57
+ * provenance (AGL-1015) included, which carry no `installedFrom`.
58
+ */ function installedFrom(source) {
59
+ var _stamp_version;
60
+ const stamp = source != null ? source : {};
61
+ const listingId = typeof stamp['listingId'] === 'string' ? stamp['listingId'] : '';
62
+ return listingId ? {
63
+ listingId,
64
+ version: (_stamp_version = stamp['version']) != null ? _stamp_version : null
65
+ } : null;
66
+ }
67
+
68
+ //# sourceMappingURL=dataset-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/data/src/lib/model/dataset-record.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { effectiveDatasetModel, type DatasetModel } from '@aglyn/aglyn/app-utils/dataset-models'\nimport { datasetDisplayName } from '@aglyn/aglyn/app-utils/datasets'\nimport type { PluginIndexedRecord } from '@aglyn/aglyn/plugin-manager/plugin-record-index'\n\n/**\n * One stored dataset as this plugin shares it with another (AGL-3080) — the\n * one shape its server index (`dataset-record-index.ts`) and its console list\n * source (`dataset-record-list.ts`) both answer, so a reader on either side\n * reads the same record.\n *\n * `null` for a deleted dataset. Otherwise its id, its name as the Data page\n * shows it, and `facts`:\n * `fields` — its fields in the dataset page's order, each\n * `{ id, name, type }`; `visibleTo` — the scope tokens it is shared\n * with, so a reader acting for a member can apply the platform's own\n * visibility rule to them; and `installedFrom` — `{ listingId, version }`\n * for a dataset installed from a listing (`version` as the install\n * stamped it), `null` for one the workspace made. Never a record of it.\n */\nexport function datasetIndexedRecord(\n id: string,\n data: Readonly<Record<string, unknown>> | undefined,\n): PluginIndexedRecord | null {\n if (!data || data['deletedAt'] != null) return null\n const model = effectiveDatasetModel(data as { model?: DatasetModel; fields?: string[] })\n const text = (value: unknown): string => (typeof value === 'string' ? value.trim() : '')\n return {\n id,\n name: datasetDisplayName(data) || id,\n facts: {\n fields: model.order.map((fieldId) => ({\n id: fieldId,\n name: text(model.fields[fieldId]?.name) || fieldId,\n type: String(model.fields[fieldId]?.type ?? 'text'),\n })),\n visibleTo: Array.isArray(data['visibleTo']) ? (data['visibleTo'] as string[]) : [],\n installedFrom: installedFrom(data['source']),\n },\n }\n}\n\n/**\n * Where an installed dataset came from. Read from its `source` stamp, which\n * every dataset install has written — the ones from before install\n * provenance (AGL-1015) included, which carry no `installedFrom`.\n */\nfunction installedFrom(source: unknown): { listingId: string; version: unknown } | null {\n const stamp = (source ?? {}) as Record<string, unknown>\n const listingId = typeof stamp['listingId'] === 'string' ? stamp['listingId'] : ''\n return listingId ? { listingId, version: stamp['version'] ?? null } : null\n}\n"],"names":["effectiveDatasetModel","datasetDisplayName","datasetIndexedRecord","id","data","model","text","value","trim","name","facts","fields","order","map","fieldId","type","String","visibleTo","Array","isArray","installedFrom","source","stamp","listingId","version"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,qBAAqB,QAA2B,wCAAuC;AAChG,SAASC,kBAAkB,QAAQ,kCAAiC;AAGpE;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,qBACdC,EAAU,EACVC,IAAmD;IAEnD,IAAI,CAACA,QAAQA,IAAI,CAAC,YAAY,IAAI,MAAM,OAAO;IAC/C,MAAMC,QAAQL,sBAAsBI;IACpC,MAAME,OAAO,CAACC,QAA4B,OAAOA,UAAU,WAAWA,MAAMC,IAAI,KAAK;IACrF,OAAO;QACLL;QACAM,MAAMR,mBAAmBG,SAASD;QAClCO,OAAO;YACLC,QAAQN,MAAMO,KAAK,CAACC,GAAG,CAAC,CAACC;;oBAEZT,uBACEA;uBAHuB;oBACpCF,IAAIW;oBACJL,MAAMH,MAAKD,wBAAAA,MAAMM,MAAM,CAACG,QAAQ,qBAArBT,sBAAuBI,IAAI,KAAKK;oBAC3CC,MAAMC,gBAAOX,yBAAAA,MAAMM,MAAM,CAACG,QAAQ,qBAArBT,uBAAuBU,IAAI,mBAAI;gBAC9C;;YACAE,WAAWC,MAAMC,OAAO,CAACf,IAAI,CAAC,YAAY,IAAKA,IAAI,CAAC,YAAY,GAAgB,EAAE;YAClFgB,eAAeA,cAAchB,IAAI,CAAC,SAAS;QAC7C;IACF;AACF;AAEA;;;;CAIC,GACD,SAASgB,cAAcC,MAAe;QAGKC;IAFzC,MAAMA,QAASD,iBAAAA,SAAU,CAAC;IAC1B,MAAME,YAAY,OAAOD,KAAK,CAAC,YAAY,KAAK,WAAWA,KAAK,CAAC,YAAY,GAAG;IAChF,OAAOC,YAAY;QAAEA;QAAWC,OAAO,GAAEF,iBAAAA,KAAK,CAAC,UAAU,YAAhBA,iBAAoB;IAAK,IAAI;AACxE"}
package/src/lib/plugin.js CHANGED
@@ -19,6 +19,7 @@ import { registerRepeatSource } from "@aglyn/aglyn/app-utils/repeat-sources";
19
19
  import { mdiDatabaseOutline } from "@aglyn/shared-data-mdi";
20
20
  import { lazy } from "react";
21
21
  import { BUNDLE_ID } from "./constants/bundle-common.js";
22
+ import { registerDatasetRecordList } from "./model/dataset-record-list.js";
22
23
  import { DATASET_REPEAT_SOURCE } from "./repeat/dataset-repeat-source.js";
23
24
  /** Code-split: the Data console page only loads when opened. */ const DataConsolePage = lazy(()=>import("./components/data-console-page.js"));
24
25
  /**
@@ -38,6 +39,8 @@ import { DATASET_REPEAT_SOURCE } from "./repeat/dataset-repeat-source.js";
38
39
  * imported only to run one (AGL-3025).
39
40
  */ export function registerDataConsole() {
40
41
  registerRepeatSource(DATASET_REPEAT_SOURCE);
42
+ // The workspace's datasets, for another plugin's picker (AGL-3080).
43
+ registerDatasetRecordList();
41
44
  Aglyn.registerConsoleExtension({
42
45
  // Org datasets card (AGL-419): org/data renders it through the
43
46
  // 'orgData' widget slot.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/plugins/data/src/lib/plugin.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport HostDatasetsCard from './components/host-datasets-card.component'\nimport * as Aglyn from '@aglyn/aglyn'\nimport { registerRepeatSource } from '@aglyn/aglyn/app-utils/repeat-sources'\nimport { mdiDatabaseOutline } from '@aglyn/shared-data-mdi'\nimport { lazy } from 'react'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { DATASET_REPEAT_SOURCE } from './repeat/dataset-repeat-source'\n\n/** Code-split: the Data console page only loads when opened. */\nconst DataConsolePage = lazy(() => import('./components/data-console-page'))\n\n/**\n * Data feature plugin (AGL-395). Console-only — datasets are org-shared\n * document collections consumed by repeatable components at render time\n * through binding resolution, not a canvas element of their own, so there\n * is no UI bundle. The console half declares the host Data nav + page\n * through the ConsoleExtension registry, gated by the `dataStore`\n * entitlement. The org Data page (`Route.ORG_DATA`) is an org-scoped app route\n * that imports {@link HostDatasetsCard} directly.\n *\n * It also registers datasets as a repeat source (AGL-3111), which is what puts\n * \"Repeat over dataset\" on every element's Attributes panel and draws a\n * repeat's copies from the real rows on the besigner canvas. Registered here,\n * inside the function the loader calls by name, and never by a module's own\n * load: this package declares no side effects, so a bundler deletes a module\n * imported only to run one (AGL-3025).\n */\nexport function registerDataConsole(): void {\n registerRepeatSource(DATASET_REPEAT_SOURCE)\n Aglyn.registerConsoleExtension({\n // Org datasets card (AGL-419): org/data renders it through the\n // 'orgData' widget slot.\n widgets: [\n {\n slot: 'orgData',\n widgetId: 'data-org-datasets',\n Component: HostDatasetsCard,\n },\n ],\n pluginId: BUNDLE_ID,\n displayName: 'Data',\n featureFlag: 'dataStore',\n navItems: [\n {\n label: 'Data',\n href: '/data',\n // Reuse the existing release-flag nav-tab so staff-preview gating is\n // unchanged now that the tab comes from the plugin (AGL-395).\n navTabId: 'nav-tab-data',\n icon: { path: mdiDatabaseOutline.path },\n header: {\n title: 'Data',\n icon: { path: mdiDatabaseOutline.path },\n docsTopic: 'datasets',\n },\n Component: DataConsolePage,\n },\n ],\n })\n}\n\nexport { default as HostDatasetsCard } from './components/host-datasets-card.component'\nexport type { HostDatasetsCardProps } from './components/host-datasets-card.component'\n"],"names":["HostDatasetsCard","Aglyn","registerRepeatSource","mdiDatabaseOutline","lazy","BUNDLE_ID","DATASET_REPEAT_SOURCE","DataConsolePage","registerDataConsole","registerConsoleExtension","widgets","slot","widgetId","Component","pluginId","displayName","featureFlag","navItems","label","href","navTabId","icon","path","header","title","docsTopic","default"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAOA,sBAAsB,+CAA2C;AACxE,YAAYC,WAAW,eAAc;AACrC,SAASC,oBAAoB,QAAQ,wCAAuC;AAC5E,SAASC,kBAAkB,QAAQ,yBAAwB;AAC3D,SAASC,IAAI,QAAQ,QAAO;AAC5B,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,qBAAqB,QAAQ,oCAAgC;AAEtE,8DAA8D,GAC9D,MAAMC,kBAAkBH,KAAK,IAAM,MAAM,CAAC;AAE1C;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASI;IACdN,qBAAqBI;IACrBL,MAAMQ,wBAAwB,CAAC;QAC7B,+DAA+D;QAC/D,yBAAyB;QACzBC,SAAS;YACP;gBACEC,MAAM;gBACNC,UAAU;gBACVC,WAAWb;YACb;SACD;QACDc,UAAUT;QACVU,aAAa;QACbC,aAAa;QACbC,UAAU;YACR;gBACEC,OAAO;gBACPC,MAAM;gBACN,qEAAqE;gBACrE,8DAA8D;gBAC9DC,UAAU;gBACVC,MAAM;oBAAEC,MAAMnB,mBAAmBmB,IAAI;gBAAC;gBACtCC,QAAQ;oBACNC,OAAO;oBACPH,MAAM;wBAAEC,MAAMnB,mBAAmBmB,IAAI;oBAAC;oBACtCG,WAAW;gBACb;gBACAZ,WAAWN;YACb;SACD;IACH;AACF;AAEA,SAASmB,WAAW1B,gBAAgB,QAAQ,+CAA2C"}
1
+ {"version":3,"sources":["../../../../../../libs/plugins/data/src/lib/plugin.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport HostDatasetsCard from './components/host-datasets-card.component'\nimport * as Aglyn from '@aglyn/aglyn'\nimport { registerRepeatSource } from '@aglyn/aglyn/app-utils/repeat-sources'\nimport { mdiDatabaseOutline } from '@aglyn/shared-data-mdi'\nimport { lazy } from 'react'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { registerDatasetRecordList } from './model/dataset-record-list'\nimport { DATASET_REPEAT_SOURCE } from './repeat/dataset-repeat-source'\n\n/** Code-split: the Data console page only loads when opened. */\nconst DataConsolePage = lazy(() => import('./components/data-console-page'))\n\n/**\n * Data feature plugin (AGL-395). Console-only — datasets are org-shared\n * document collections consumed by repeatable components at render time\n * through binding resolution, not a canvas element of their own, so there\n * is no UI bundle. The console half declares the host Data nav + page\n * through the ConsoleExtension registry, gated by the `dataStore`\n * entitlement. The org Data page (`Route.ORG_DATA`) is an org-scoped app route\n * that imports {@link HostDatasetsCard} directly.\n *\n * It also registers datasets as a repeat source (AGL-3111), which is what puts\n * \"Repeat over dataset\" on every element's Attributes panel and draws a\n * repeat's copies from the real rows on the besigner canvas. Registered here,\n * inside the function the loader calls by name, and never by a module's own\n * load: this package declares no side effects, so a bundler deletes a module\n * imported only to run one (AGL-3025).\n */\nexport function registerDataConsole(): void {\n registerRepeatSource(DATASET_REPEAT_SOURCE)\n // The workspace's datasets, for another plugin's picker (AGL-3080).\n registerDatasetRecordList()\n Aglyn.registerConsoleExtension({\n // Org datasets card (AGL-419): org/data renders it through the\n // 'orgData' widget slot.\n widgets: [\n {\n slot: 'orgData',\n widgetId: 'data-org-datasets',\n Component: HostDatasetsCard,\n },\n ],\n pluginId: BUNDLE_ID,\n displayName: 'Data',\n featureFlag: 'dataStore',\n navItems: [\n {\n label: 'Data',\n href: '/data',\n // Reuse the existing release-flag nav-tab so staff-preview gating is\n // unchanged now that the tab comes from the plugin (AGL-395).\n navTabId: 'nav-tab-data',\n icon: { path: mdiDatabaseOutline.path },\n header: {\n title: 'Data',\n icon: { path: mdiDatabaseOutline.path },\n docsTopic: 'datasets',\n },\n Component: DataConsolePage,\n },\n ],\n })\n}\n\nexport { default as HostDatasetsCard } from './components/host-datasets-card.component'\nexport type { HostDatasetsCardProps } from './components/host-datasets-card.component'\n"],"names":["HostDatasetsCard","Aglyn","registerRepeatSource","mdiDatabaseOutline","lazy","BUNDLE_ID","registerDatasetRecordList","DATASET_REPEAT_SOURCE","DataConsolePage","registerDataConsole","registerConsoleExtension","widgets","slot","widgetId","Component","pluginId","displayName","featureFlag","navItems","label","href","navTabId","icon","path","header","title","docsTopic","default"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAOA,sBAAsB,+CAA2C;AACxE,YAAYC,WAAW,eAAc;AACrC,SAASC,oBAAoB,QAAQ,wCAAuC;AAC5E,SAASC,kBAAkB,QAAQ,yBAAwB;AAC3D,SAASC,IAAI,QAAQ,QAAO;AAC5B,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,yBAAyB,QAAQ,iCAA6B;AACvE,SAASC,qBAAqB,QAAQ,oCAAgC;AAEtE,8DAA8D,GAC9D,MAAMC,kBAAkBJ,KAAK,IAAM,MAAM,CAAC;AAE1C;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASK;IACdP,qBAAqBK;IACrB,oEAAoE;IACpED;IACAL,MAAMS,wBAAwB,CAAC;QAC7B,+DAA+D;QAC/D,yBAAyB;QACzBC,SAAS;YACP;gBACEC,MAAM;gBACNC,UAAU;gBACVC,WAAWd;YACb;SACD;QACDe,UAAUV;QACVW,aAAa;QACbC,aAAa;QACbC,UAAU;YACR;gBACEC,OAAO;gBACPC,MAAM;gBACN,qEAAqE;gBACrE,8DAA8D;gBAC9DC,UAAU;gBACVC,MAAM;oBAAEC,MAAMpB,mBAAmBoB,IAAI;gBAAC;gBACtCC,QAAQ;oBACNC,OAAO;oBACPH,MAAM;wBAAEC,MAAMpB,mBAAmBoB,IAAI;oBAAC;oBACtCG,WAAW;gBACb;gBACAZ,WAAWN;YACb;SACD;IACH;AACF;AAEA,SAASmB,WAAW3B,gBAAgB,QAAQ,+CAA2C"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type DatasetAnnounceResult } from '@aglyn/tenant-data-admin/server/dataset-live-pages';
18
+ import type { Firestore } from 'firebase-admin/firestore';
19
+ /**
20
+ * Refresh every live page showing this dataset's records, from one of this
21
+ * plugin's console routes (AGL-3113).
22
+ *
23
+ * `announceDatasetRecordChange` works out WHICH pages a record write makes
24
+ * stale; the drop goes through the platform's site cache. Callers `await` it:
25
+ * the pages are supposed to be fresh by the time the editor's save returns.
26
+ * The result is returned rather than swallowed so a route can surface the
27
+ * shortfall warning — a refusal is the one case where the write landed and
28
+ * the live pages stay stale for the rest of their window.
29
+ *
30
+ * BEST EFFORT, ALWAYS. The record has already been written by the time this
31
+ * runs, so it never throws and never rejects.
32
+ */
33
+ export declare function announceDatasetRecords(options: {
34
+ firestore: Firestore;
35
+ orgId: string;
36
+ datasetId: string;
37
+ }): Promise<DatasetAnnounceResult>;
@@ -0,0 +1,54 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /**
3
+ * @license
4
+ * Copyright 2026 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import { dropPluginSiteCache } from "@aglyn/aglyn/plugin-manager/plugin-site-cache";
18
+ import { announceDatasetRecordChange } from "@aglyn/tenant-data-admin/server/dataset-live-pages";
19
+ /**
20
+ * Drops one site's pages through the platform's site cache, narrowed to the
21
+ * addresses that repeat over the dataset — the app knows how to drop a page on
22
+ * every address a site answers at, and this plugin knows which pages.
23
+ */ const dropThroughSiteCache = async (target)=>{
24
+ const result = await dropPluginSiteCache({
25
+ hostIds: [
26
+ target.hostId
27
+ ],
28
+ paths: {
29
+ [target.hostId]: target.paths
30
+ },
31
+ reason: 'dataset records changed'
32
+ });
33
+ return result.complete && result.dropped > 0;
34
+ };
35
+ /**
36
+ * Refresh every live page showing this dataset's records, from one of this
37
+ * plugin's console routes (AGL-3113).
38
+ *
39
+ * `announceDatasetRecordChange` works out WHICH pages a record write makes
40
+ * stale; the drop goes through the platform's site cache. Callers `await` it:
41
+ * the pages are supposed to be fresh by the time the editor's save returns.
42
+ * The result is returned rather than swallowed so a route can surface the
43
+ * shortfall warning — a refusal is the one case where the write landed and
44
+ * the live pages stay stale for the rest of their window.
45
+ *
46
+ * BEST EFFORT, ALWAYS. The record has already been written by the time this
47
+ * runs, so it never throws and never rejects.
48
+ */ export async function announceDatasetRecords(options) {
49
+ return announceDatasetRecordChange(_extends({}, options, {
50
+ drop: dropThroughSiteCache
51
+ }));
52
+ }
53
+
54
+ //# sourceMappingURL=announce-dataset-records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/data/src/lib/server/announce-dataset-records.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { dropPluginSiteCache } from '@aglyn/aglyn/plugin-manager/plugin-site-cache'\nimport {\n announceDatasetRecordChange,\n type DatasetAnnounceResult,\n type LivePageDropper,\n} from '@aglyn/tenant-data-admin/server/dataset-live-pages'\nimport type { Firestore } from 'firebase-admin/firestore'\n\n/**\n * Drops one site's pages through the platform's site cache, narrowed to the\n * addresses that repeat over the dataset — the app knows how to drop a page on\n * every address a site answers at, and this plugin knows which pages.\n */\nconst dropThroughSiteCache: LivePageDropper = async (target) => {\n const result = await dropPluginSiteCache({\n hostIds: [target.hostId],\n paths: { [target.hostId]: target.paths },\n reason: 'dataset records changed',\n })\n return result.complete && result.dropped > 0\n}\n\n/**\n * Refresh every live page showing this dataset's records, from one of this\n * plugin's console routes (AGL-3113).\n *\n * `announceDatasetRecordChange` works out WHICH pages a record write makes\n * stale; the drop goes through the platform's site cache. Callers `await` it:\n * the pages are supposed to be fresh by the time the editor's save returns.\n * The result is returned rather than swallowed so a route can surface the\n * shortfall warning — a refusal is the one case where the write landed and\n * the live pages stay stale for the rest of their window.\n *\n * BEST EFFORT, ALWAYS. The record has already been written by the time this\n * runs, so it never throws and never rejects.\n */\nexport async function announceDatasetRecords(options: {\n firestore: Firestore\n orgId: string\n datasetId: string\n}): Promise<DatasetAnnounceResult> {\n return announceDatasetRecordChange({ ...options, drop: dropThroughSiteCache })\n}\n"],"names":["dropPluginSiteCache","announceDatasetRecordChange","dropThroughSiteCache","target","result","hostIds","hostId","paths","reason","complete","dropped","announceDatasetRecords","options","drop"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,mBAAmB,QAAQ,gDAA+C;AACnF,SACEC,2BAA2B,QAGtB,qDAAoD;AAG3D;;;;CAIC,GACD,MAAMC,uBAAwC,OAAOC;IACnD,MAAMC,SAAS,MAAMJ,oBAAoB;QACvCK,SAAS;YAACF,OAAOG,MAAM;SAAC;QACxBC,OAAO;YAAE,CAACJ,OAAOG,MAAM,CAAC,EAAEH,OAAOI,KAAK;QAAC;QACvCC,QAAQ;IACV;IACA,OAAOJ,OAAOK,QAAQ,IAAIL,OAAOM,OAAO,GAAG;AAC7C;AAEA;;;;;;;;;;;;;CAaC,GACD,OAAO,eAAeC,uBAAuBC,OAI5C;IACC,OAAOX,4BAA4B,aAAKW;QAASC,MAAMX;;AACzD"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type ApiV1Context } from '@aglyn/tenant-data-admin/server/api-v1-kit';
18
+ export declare function handleDatasets(request: Request, ctx: ApiV1Context, segments: string[], url: URL): Promise<Response>;