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

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 (135) hide show
  1. package/README.md +9 -6
  2. package/package.json +10 -10
  3. package/src/index.d.ts +1 -1
  4. package/src/index.js +1 -1
  5. package/src/index.js.map +1 -1
  6. package/src/lib/artifact/dataset-schema-artifact.server.d.ts +57 -0
  7. package/src/lib/artifact/dataset-schema-artifact.server.js +308 -0
  8. package/src/lib/artifact/dataset-schema-artifact.server.js.map +1 -0
  9. package/src/lib/artifact/dataset-schema.d.ts +136 -0
  10. package/src/lib/artifact/dataset-schema.js +232 -0
  11. package/src/lib/artifact/dataset-schema.js.map +1 -0
  12. package/src/lib/components/dataset-record-dialog.component.d.ts +1 -1
  13. package/src/lib/components/dataset-record-dialog.component.js +1 -1
  14. package/src/lib/components/dataset-record-dialog.component.js.map +1 -1
  15. package/src/lib/components/dataset-record-filter.d.ts +1 -1
  16. package/src/lib/components/dataset-record-filter.js +2 -2
  17. package/src/lib/components/dataset-record-filter.js.map +1 -1
  18. package/src/lib/components/dataset-schema-dialog.component.d.ts +1 -1
  19. package/src/lib/components/dataset-schema-dialog.component.js +55 -23
  20. package/src/lib/components/dataset-schema-dialog.component.js.map +1 -1
  21. package/src/lib/components/host-datasets-card.component.js +91 -403
  22. package/src/lib/components/host-datasets-card.component.js.map +1 -1
  23. package/src/lib/constants/bundle-common.d.ts +12 -0
  24. package/src/lib/constants/bundle-common.js +13 -0
  25. package/src/lib/constants/bundle-common.js.map +1 -1
  26. package/src/lib/declarations.console-server.d.ts +16 -1
  27. package/src/lib/declarations.console-server.js +34 -2
  28. package/src/lib/declarations.console-server.js.map +1 -1
  29. package/src/lib/declarations.server.d.ts +13 -0
  30. package/src/lib/declarations.server.js +48 -2
  31. package/src/lib/declarations.server.js.map +1 -1
  32. package/src/lib/form-target/dataset-form-record-target.server.js +5 -3
  33. package/src/lib/form-target/dataset-form-record-target.server.js.map +1 -1
  34. package/src/lib/model/dataset-models.d.ts +392 -0
  35. package/src/lib/model/dataset-models.js +806 -0
  36. package/src/lib/model/dataset-models.js.map +1 -0
  37. package/src/lib/model/dataset-record-view.d.ts +1 -1
  38. package/src/lib/model/dataset-record-view.js +1 -2
  39. package/src/lib/model/dataset-record-view.js.map +1 -1
  40. package/src/lib/model/dataset-record.js +2 -2
  41. package/src/lib/model/dataset-record.js.map +1 -1
  42. package/src/lib/model/datasets.d.ts +162 -0
  43. package/src/lib/model/datasets.js +227 -0
  44. package/src/lib/model/datasets.js.map +1 -0
  45. package/src/lib/plugin.d.ts +4 -0
  46. package/src/lib/plugin.js +40 -0
  47. package/src/lib/plugin.js.map +1 -1
  48. package/src/lib/record-pages/record-page-live-paths.server.d.ts +55 -0
  49. package/src/lib/record-pages/record-page-live-paths.server.js +83 -0
  50. package/src/lib/record-pages/record-page-live-paths.server.js.map +1 -0
  51. package/src/lib/record-pages/record-page-read.server.d.ts +70 -0
  52. package/src/lib/record-pages/record-page-read.server.js +175 -0
  53. package/src/lib/record-pages/record-page-read.server.js.map +1 -0
  54. package/src/lib/record-pages/record-page-resolver.server.d.ts +37 -0
  55. package/src/lib/record-pages/record-page-resolver.server.js +131 -0
  56. package/src/lib/record-pages/record-page-resolver.server.js.map +1 -0
  57. package/src/lib/record-pages/record-page-sitemap.server.d.ts +32 -0
  58. package/src/lib/record-pages/record-page-sitemap.server.js +102 -0
  59. package/src/lib/record-pages/record-page-sitemap.server.js.map +1 -0
  60. package/src/lib/record-pages/record-page-source.d.ts +42 -0
  61. package/src/lib/record-pages/record-page-source.js +176 -0
  62. package/src/lib/record-pages/record-page-source.js.map +1 -0
  63. package/src/lib/record-pages/record-pages-route.d.ts +42 -0
  64. package/src/lib/record-pages/record-pages-route.js +348 -0
  65. package/src/lib/record-pages/record-pages-route.js.map +1 -0
  66. package/src/lib/record-pages/record-pages.d.ts +218 -0
  67. package/src/lib/record-pages/record-pages.js +351 -0
  68. package/src/lib/record-pages/record-pages.js.map +1 -0
  69. package/src/lib/record-pages/record-template-row-chip.component.d.ts +28 -0
  70. package/src/lib/record-pages/record-template-row-chip.component.js +87 -0
  71. package/src/lib/record-pages/record-template-row-chip.component.js.map +1 -0
  72. package/src/lib/record-pages/record-template-section.component.d.ts +30 -0
  73. package/src/lib/record-pages/record-template-section.component.js +491 -0
  74. package/src/lib/record-pages/record-template-section.component.js.map +1 -0
  75. package/src/lib/repeat/dataset-repeat-rows.d.ts +2 -1
  76. package/src/lib/repeat/dataset-repeat-rows.js +30 -12
  77. package/src/lib/repeat/dataset-repeat-rows.js.map +1 -1
  78. package/src/lib/repeat/dataset-repeat-rows.server.d.ts +1 -1
  79. package/src/lib/repeat/dataset-repeat-rows.server.js +23 -12
  80. package/src/lib/repeat/dataset-repeat-rows.server.js.map +1 -1
  81. package/src/lib/repeat/repeat-record-pages.d.ts +48 -0
  82. package/src/lib/repeat/repeat-record-pages.js +64 -0
  83. package/src/lib/repeat/repeat-record-pages.js.map +1 -0
  84. package/src/lib/server/announce-dataset-records.d.ts +1 -1
  85. package/src/lib/server/announce-dataset-records.js +1 -1
  86. package/src/lib/server/announce-dataset-records.js.map +1 -1
  87. package/src/lib/server/api-v1/datasets.js +5 -3
  88. package/src/lib/server/api-v1/datasets.js.map +1 -1
  89. package/src/lib/server/dataset-figures.js +2 -2
  90. package/src/lib/server/dataset-figures.js.map +1 -1
  91. package/src/lib/server/dataset-live-pages.d.ts +147 -0
  92. package/src/lib/server/dataset-live-pages.js +436 -0
  93. package/src/lib/server/dataset-live-pages.js.map +1 -0
  94. package/src/lib/server/dataset-steps.server.d.ts +45 -0
  95. package/src/lib/server/dataset-steps.server.js +268 -0
  96. package/src/lib/server/dataset-steps.server.js.map +1 -0
  97. package/src/lib/server/datasets-route.d.ts +2 -0
  98. package/src/lib/server/datasets-route.js +102 -6
  99. package/src/lib/server/datasets-route.js.map +1 -1
  100. package/src/lib/server/resolve-dataset.d.ts +40 -0
  101. package/src/lib/server/resolve-dataset.js +64 -0
  102. package/src/lib/server/resolve-dataset.js.map +1 -0
  103. package/src/lib/server.d.ts +3 -2
  104. package/src/lib/server.js +8 -9
  105. package/src/lib/server.js.map +1 -1
  106. package/src/lib/site-bundle/datasets-package.d.ts +42 -0
  107. package/src/lib/site-bundle/datasets-package.js +95 -0
  108. package/src/lib/site-bundle/datasets-package.js.map +1 -0
  109. package/src/lib/site-bundle/datasets-site-bundle.server.js +2 -2
  110. package/src/lib/site-bundle/datasets-site-bundle.server.js.map +1 -1
  111. package/src/lib/{model/index.js → tenant-api.d.ts} +12 -7
  112. package/src/lib/tenant-api.js +30 -0
  113. package/src/lib/tenant-api.js.map +1 -0
  114. package/src/lib/transfer/dataset-transfer-key.d.ts +30 -0
  115. package/src/lib/transfer/dataset-transfer-key.js +31 -0
  116. package/src/lib/transfer/dataset-transfer-key.js.map +1 -0
  117. package/src/lib/transfer/dataset-transfer-model.d.ts +146 -0
  118. package/src/lib/transfer/dataset-transfer-model.js +536 -0
  119. package/src/lib/transfer/dataset-transfer-model.js.map +1 -0
  120. package/src/lib/{model/index.d.ts → transfer/dataset-transfer-resource.d.ts} +2 -6
  121. package/src/lib/transfer/dataset-transfer-resource.js +41 -0
  122. package/src/lib/transfer/dataset-transfer-resource.js.map +1 -0
  123. package/src/lib/transfer/dataset-transfer.server.d.ts +69 -0
  124. package/src/lib/transfer/dataset-transfer.server.js +930 -0
  125. package/src/lib/transfer/dataset-transfer.server.js.map +1 -0
  126. package/src/lib/model/dataset-csv.d.ts +0 -36
  127. package/src/lib/model/dataset-csv.js +0 -85
  128. package/src/lib/model/dataset-csv.js.map +0 -1
  129. package/src/lib/model/dataset-io.d.ts +0 -44
  130. package/src/lib/model/dataset-io.js +0 -85
  131. package/src/lib/model/dataset-io.js.map +0 -1
  132. package/src/lib/model/index.js.map +0 -1
  133. package/src/lib/server/datasets-export-route.d.ts +0 -57
  134. package/src/lib/server/datasets-export-route.js +0 -229
  135. package/src/lib/server/datasets-export-route.js.map +0 -1
@@ -0,0 +1,41 @@
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
+ * The `data.dataset` server half (AGL-3530) as the console registers it at
18
+ * boot: every hook loads `dataset-transfer.server.ts` — and the Admin SDK and
19
+ * the job engine with it — on its first call, so a console process that
20
+ * never imports or exports a dataset pays nothing for it.
21
+ */ const hooks = async ()=>(await import("./dataset-transfer.server.js")).datasetTransferHooks();
22
+ export const DATASET_TRANSFER_HOOKS = {
23
+ fields: async (ctx)=>(await hooks()).fields(ctx),
24
+ matchKeys: async (ctx)=>{
25
+ const matchKeys = (await hooks()).matchKeys;
26
+ return typeof matchKeys === 'function' ? matchKeys(ctx) : {
27
+ keys: matchKeys
28
+ };
29
+ },
30
+ count: async (ctx, options)=>(await hooks()).count(ctx, options),
31
+ readPage: async (ctx, cursor, fieldIds, options)=>(await hooks()).readPage(ctx, cursor, fieldIds, options),
32
+ lookup: async (ctx, requests)=>(await hooks()).lookup(ctx, requests),
33
+ suggest: async (ctx, request)=>(await hooks()).suggest(ctx, request),
34
+ picklists: async (ctx, picklistIds)=>(await hooks()).picklists(ctx, picklistIds),
35
+ addPicklistValues: async (ctx, picklistId, values)=>(await hooks()).addPicklistValues(ctx, picklistId, values),
36
+ plan: async (ctx, input)=>(await hooks()).plan(ctx, input),
37
+ apply: async (ctx, chunk, writer)=>(await hooks()).apply(ctx, chunk, writer),
38
+ revert: async (ctx, snapshot, decisions)=>(await hooks()).revert(ctx, snapshot, decisions)
39
+ };
40
+
41
+ //# sourceMappingURL=dataset-transfer-resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/data/src/lib/transfer/dataset-transfer-resource.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 type {\n PluginTransferResource,\n TransferRecordsHooks,\n} from '@aglyn/aglyn/plugin-manager/plugin-transfer-resources'\n\n/**\n * The `data.dataset` server half (AGL-3530) as the console registers it at\n * boot: every hook loads `dataset-transfer.server.ts` — and the Admin SDK and\n * the job engine with it — on its first call, so a console process that\n * never imports or exports a dataset pays nothing for it.\n */\nconst hooks = async (): Promise<TransferRecordsHooks> =>\n (await import('./dataset-transfer.server')).datasetTransferHooks()\n\nexport const DATASET_TRANSFER_HOOKS: PluginTransferResource = {\n fields: async (ctx) => (await hooks()).fields(ctx),\n matchKeys: async (ctx) => {\n const matchKeys = (await hooks()).matchKeys\n return typeof matchKeys === 'function' ? matchKeys(ctx) : { keys: matchKeys }\n },\n count: async (ctx, options) => ((await hooks()).count as NonNullable<TransferRecordsHooks['count']>)(ctx, options),\n readPage: async (ctx, cursor, fieldIds, options) => (await hooks()).readPage(ctx, cursor, fieldIds, options),\n lookup: async (ctx, requests) => (await hooks()).lookup(ctx, requests),\n suggest: async (ctx, request) =>\n ((await hooks()).suggest as NonNullable<TransferRecordsHooks['suggest']>)(ctx, request),\n picklists: async (ctx, picklistIds) =>\n ((await hooks()).picklists as NonNullable<TransferRecordsHooks['picklists']>)(ctx, picklistIds),\n addPicklistValues: async (ctx, picklistId, values) =>\n ((await hooks()).addPicklistValues as NonNullable<TransferRecordsHooks['addPicklistValues']>)(ctx, picklistId, values),\n plan: async (ctx, input) => ((await hooks()).plan as NonNullable<TransferRecordsHooks['plan']>)(ctx, input),\n apply: async (ctx, chunk, writer) => (await hooks()).apply(ctx, chunk, writer),\n revert: async (ctx, snapshot, decisions) => (await hooks()).revert(ctx, snapshot, decisions),\n}\n"],"names":["hooks","datasetTransferHooks","DATASET_TRANSFER_HOOKS","fields","ctx","matchKeys","keys","count","options","readPage","cursor","fieldIds","lookup","requests","suggest","request","picklists","picklistIds","addPicklistValues","picklistId","values","plan","input","apply","chunk","writer","revert","snapshot","decisions"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAOD;;;;;CAKC,GACD,MAAMA,QAAQ,UACZ,AAAC,CAAA,MAAM,MAAM,CAAC,+BAA2B,EAAGC,oBAAoB;AAElE,OAAO,MAAMC,yBAAiD;IAC5DC,QAAQ,OAAOC,MAAQ,AAAC,CAAA,MAAMJ,OAAM,EAAGG,MAAM,CAACC;IAC9CC,WAAW,OAAOD;QAChB,MAAMC,YAAY,AAAC,CAAA,MAAML,OAAM,EAAGK,SAAS;QAC3C,OAAO,OAAOA,cAAc,aAAaA,UAAUD,OAAO;YAAEE,MAAMD;QAAU;IAC9E;IACAE,OAAO,OAAOH,KAAKI,UAAY,AAAC,AAAC,CAAA,MAAMR,OAAM,EAAGO,KAAK,CAAgDH,KAAKI;IAC1GC,UAAU,OAAOL,KAAKM,QAAQC,UAAUH,UAAY,AAAC,CAAA,MAAMR,OAAM,EAAGS,QAAQ,CAACL,KAAKM,QAAQC,UAAUH;IACpGI,QAAQ,OAAOR,KAAKS,WAAa,AAAC,CAAA,MAAMb,OAAM,EAAGY,MAAM,CAACR,KAAKS;IAC7DC,SAAS,OAAOV,KAAKW,UACnB,AAAC,AAAC,CAAA,MAAMf,OAAM,EAAGc,OAAO,CAAkDV,KAAKW;IACjFC,WAAW,OAAOZ,KAAKa,cACrB,AAAC,AAAC,CAAA,MAAMjB,OAAM,EAAGgB,SAAS,CAAoDZ,KAAKa;IACrFC,mBAAmB,OAAOd,KAAKe,YAAYC,SACzC,AAAC,AAAC,CAAA,MAAMpB,OAAM,EAAGkB,iBAAiB,CAA4Dd,KAAKe,YAAYC;IACjHC,MAAM,OAAOjB,KAAKkB,QAAU,AAAC,AAAC,CAAA,MAAMtB,OAAM,EAAGqB,IAAI,CAA+CjB,KAAKkB;IACrGC,OAAO,OAAOnB,KAAKoB,OAAOC,SAAW,AAAC,CAAA,MAAMzB,OAAM,EAAGuB,KAAK,CAACnB,KAAKoB,OAAOC;IACvEC,QAAQ,OAAOtB,KAAKuB,UAAUC,YAAc,AAAC,CAAA,MAAM5B,OAAM,EAAG0B,MAAM,CAACtB,KAAKuB,UAAUC;AACpF,EAAC"}
@@ -0,0 +1,69 @@
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 MatchLookupRequest, type PlannedTransferRow, type TransferLookupSuggestion, type TransferUndoEntry } from '@aglyn/aglyn/data-transfer';
18
+ import type { PicklistValue } from '@aglyn/aglyn/app-utils/picklists';
19
+ import type { TransferApplyResult, TransferApplyWriter, TransferLookupResult, TransferLookupSuggestRequest, TransferPicklistList, TransferReadOptions, TransferReadPage, TransferRecordsHooks, TransferResourceContext, TransferRevertDecisions, TransferRevertResult } from '@aglyn/aglyn/plugin-manager/plugin-transfer-resources';
20
+ import type { ListFilterClause } from '@aglyn/shared-ui-jsx/const/list-grid-filter';
21
+ import { type Firestore } from 'firebase-admin/firestore';
22
+ /** What the hooks run against; a spec hands in a double. */
23
+ export interface DatasetTransferDeps {
24
+ firestore: Firestore;
25
+ }
26
+ /**
27
+ * The id a record created by an import's row is given: ten characters of the
28
+ * resource-id alphabet, derived from the job and the row, so a retried chunk
29
+ * names the record it already wrote rather than writing a second one.
30
+ */
31
+ export declare function transferRecordId(jobId: string, row: number): string;
32
+ /** The records table's filter as the Data card sends it: the grid's clauses and the search words. */
33
+ export interface DatasetTransferFilter {
34
+ clauses: ListFilterClause[];
35
+ search: string[];
36
+ }
37
+ export declare function countDatasetRecords(deps: DatasetTransferDeps, ctx: TransferResourceContext, options: TransferReadOptions): Promise<number>;
38
+ export declare function readDatasetPage(deps: DatasetTransferDeps, ctx: TransferResourceContext, cursor: string | null, fieldIds: readonly string[], options?: TransferReadOptions): Promise<TransferReadPage>;
39
+ export declare function lookupDatasetRecords(deps: DatasetTransferDeps, ctx: TransferResourceContext, requests: readonly MatchLookupRequest[]): Promise<TransferLookupResult>;
40
+ /**
41
+ * Records named LIKE each value a reference could not find, for the person
42
+ * to pick from: each plain text `by` field asked for records with a word that
43
+ * starts with one of the value's first words, or with its first few letters
44
+ * (the `filterKeys` prefix tokens the records table's `contains` reads), then
45
+ * ranked by how close the whole name is. Values past the query budget get none.
46
+ */
47
+ export declare function suggestDatasetRecords(deps: DatasetTransferDeps, ctx: TransferResourceContext, request: TransferLookupSuggestRequest): Promise<Record<string, TransferLookupSuggestion[]>>;
48
+ export declare function datasetPicklists(deps: DatasetTransferDeps, ctx: TransferResourceContext, picklistIds: readonly string[]): Promise<Record<string, TransferPicklistList>>;
49
+ /**
50
+ * The values the person chose to add to an options field, added to the
51
+ * field's options in the dataset's model — the schema the Schema dialog
52
+ * edits — before the import's first write. A value already there is left.
53
+ */
54
+ export declare function addDatasetOptions(deps: DatasetTransferDeps, ctx: TransferResourceContext, picklistId: string, values: readonly PicklistValue[]): Promise<void>;
55
+ /**
56
+ * The id a record created for a reference's name is given: ten characters
57
+ * of the resource-id alphabet, from the job, the target, the field it is
58
+ * named in and the name as the engine keys it — so every row naming it, in
59
+ * any chunk, and a retried chunk all land on the one record.
60
+ */
61
+ export declare function transferReferenceRecordId(jobId: string, datasetId: string, displayFieldId: string, name: string): string;
62
+ export declare function applyDatasetChunk(deps: DatasetTransferDeps, ctx: TransferResourceContext, chunk: {
63
+ rows: PlannedTransferRow[];
64
+ }, writer: TransferApplyWriter): Promise<TransferApplyResult>;
65
+ export declare function revertDatasetChunk(deps: DatasetTransferDeps, ctx: TransferResourceContext, snapshot: {
66
+ entries: TransferUndoEntry[];
67
+ }, decisions?: TransferRevertDecisions): Promise<TransferRevertResult>;
68
+ /** The records hooks for `data.dataset`, over `deps` (the Admin SDK's Firestore by default). */
69
+ export declare function datasetTransferHooks(deps?: () => DatasetTransferDeps): TransferRecordsHooks;