@dudousxd/nestjs-catalog 0.14.0 → 0.15.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.
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CATALOG_STORE = exports.CatalogColumnCollisionError = exports.UnsafeIdentifierError = exports.CATALOG_RESERVED_COLUMNS = exports.CATALOG_SNAPSHOT_MODES = void 0;
3
+ exports.CATALOG_STORE = exports.CatalogColumnCollisionError = exports.UnsafeIdentifierError = exports.physicalColumn = exports.outputAlias = exports.isSafeIdentifier = exports.assertSafeIdentifier = exports.CATALOG_RESERVED_COLUMNS = exports.CATALOG_SNAPSHOT_MODES = void 0;
4
4
  exports.isCatalogStoreCapabilities = isCatalogStoreCapabilities;
5
5
  exports.supportsObjectFilters = supportsObjectFilters;
6
6
  exports.isReservedColumn = isReservedColumn;
7
- exports.isSafeIdentifier = isSafeIdentifier;
8
- exports.assertSafeIdentifier = assertSafeIdentifier;
9
7
  exports.findColumnCollisions = findColumnCollisions;
10
8
  exports.assertNoColumnCollisions = assertNoColumnCollisions;
11
9
  exports.isWriteStore = isWriteStore;
@@ -81,72 +79,36 @@ function isReservedColumn(column) {
81
79
  return exports.CATALOG_RESERVED_COLUMNS.some((reserved) => reserved === column.toLowerCase());
82
80
  }
83
81
  /**
84
- * What a name has to look like before a store will write it into SQL.
85
- *
86
- * Identifiers are *rejected*, never escaped and never sanitised. Every table
87
- * and column name a store emits arrives from another application over HTTP and
88
- * ends up in DDL and in SELECT lists, where no placeholder can stand in for it,
89
- * so anything outside this character set never becomes SQL at all.
90
- *
91
- * Here, beside {@link CATALOG_RESERVED_COLUMNS}, for the same reason: it is
92
- * part of what the catalog promises a *publisher*. Refuse a property name and
93
- * the sentence explaining why is the only statement of the rule most people
94
- * will ever read, so it belongs to the contract rather than to whichever
95
- * adapter happens to be mounted.
96
- *
97
- * And for one more reason. It used to be two copies — `store-mikro-orm` and
98
- * `store-clickhouse` each carried this pattern and this sentence, byte for
99
- * byte — and the publish-time refusal in the pipeline package borrowed the
100
- * MySQL one so that publish-time and DDL-time could not disagree about the
101
- * character set, the length or the wording. That bought the guarantee for a
102
- * MySQL deployment and left a ClickHouse-only one trusting two files to be
103
- * edited together. One definition is the guarantee; two identical ones are a
104
- * habit.
105
- *
106
- * 63 characters because it is under MySQL's 64-character ceiling and no engine
107
- * a store here targets refuses a name that short, and because the number is
108
- * quoted in the refusal below: a per-store limit would mean a publisher being
109
- * told a different rule depending on what is mounted, for a name the catalog
110
- * would then be unable to promise anything about across a fan-out.
111
- *
112
- * Not exported. A `RegExp` is mutable and shared state, and the two questions
113
- * anyone has of it — "may I?" and "why not?" — are {@link isSafeIdentifier} and
114
- * {@link UnsafeIdentifierError}.
115
- */
116
- const SAFE_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]{0,62}$/;
117
- /**
118
- * Why a name cannot be written into SQL, in the words a publisher is given.
119
- *
120
- * One class for the whole ecosystem rather than one per adapter, so
121
- * `instanceof` is a usable question across packages. The publish-time check in
122
- * the pipeline package catches this to tell "that name cannot be an identifier"
123
- * from "something else failed inside the store", and with a class per adapter
124
- * that check would re-throw the moment the mounted store was not the one it
125
- * imported — turning a 400 that names the property into a 500 that names
126
- * nothing.
82
+ * The whole naming rule, which used to be written out here.
83
+ *
84
+ * `isSafeIdentifier` and friends, the {@link physicalColumn} cleaning and the
85
+ * {@link outputAlias} it feeds all moved to `catalog.identifiers.ts` — a file
86
+ * that imports nothing — and are re-exported here so that every caller that
87
+ * reached them from this module still does.
88
+ *
89
+ * The move was not tidying. This file imports `BadRequestException` at module
90
+ * scope, so a browser importing a *value* from it would pull NestJS into its
91
+ * bundle, and a console proposing to replicate a table has to be able to ask,
92
+ * before it draws anything, whether the source's column spellings could be
93
+ * published as property names. The question a publisher is refused on is
94
+ * `isSafeIdentifier(physicalColumn(name))`, so both halves had to become
95
+ * reachable from `/client`, answered by the same two functions the DDL runs
96
+ * rather than by a copy of either. See the docblock on `catalog.identifiers.ts`.
97
+ *
98
+ * A bare `export … from` and not `import` + `export`, which is safe here for a
99
+ * reason worth writing down: nothing left in this file *calls* any of them.
100
+ * A re-export forwards a name without binding it locally, and while `outputAlias`
101
+ * still lived here — one line, calling `isSafeIdentifier` — that difference was
102
+ * a `ReferenceError` at the first read of any type, compiled and shipped by a
103
+ * rebase that had nothing to conflict on. Adding a caller here means turning
104
+ * this back into an import.
127
105
  */
128
- class UnsafeIdentifierError extends Error {
129
- constructor(value) {
130
- super(`Refusing to use "${value}" as a SQL identifier: letters, digits and underscore only, starting with a letter or underscore, 63 characters max.`);
131
- }
132
- }
133
- exports.UnsafeIdentifierError = UnsafeIdentifierError;
134
- /** Whether a name can be written into SQL as it stands. */
135
- function isSafeIdentifier(value) {
136
- return SAFE_IDENTIFIER.test(value);
137
- }
138
- /**
139
- * Refuse a name that cannot be a SQL identifier.
140
- *
141
- * Throws rather than answering, because the caller's next line writes the value
142
- * into a statement: a boolean that can be ignored is a boolean that eventually
143
- * is. {@link isSafeIdentifier} is there for the callers that are asking rather
144
- * than about to build.
145
- */
146
- function assertSafeIdentifier(value) {
147
- if (!isSafeIdentifier(value))
148
- throw new UnsafeIdentifierError(value);
149
- }
106
+ var catalog_identifiers_1 = require("./catalog.identifiers");
107
+ Object.defineProperty(exports, "assertSafeIdentifier", { enumerable: true, get: function () { return catalog_identifiers_1.assertSafeIdentifier; } });
108
+ Object.defineProperty(exports, "isSafeIdentifier", { enumerable: true, get: function () { return catalog_identifiers_1.isSafeIdentifier; } });
109
+ Object.defineProperty(exports, "outputAlias", { enumerable: true, get: function () { return catalog_identifiers_1.outputAlias; } });
110
+ Object.defineProperty(exports, "physicalColumn", { enumerable: true, get: function () { return catalog_identifiers_1.physicalColumn; } });
111
+ Object.defineProperty(exports, "UnsafeIdentifierError", { enumerable: true, get: function () { return catalog_identifiers_1.UnsafeIdentifierError; } });
150
112
  /**
151
113
  * Every way a type's properties would fight over a physical column.
152
114
  *
@@ -299,13 +299,20 @@ export interface CatalogObjectPage {
299
299
  * How the source spells this column, when it is not how the property is
300
300
  * named.
301
301
  *
302
- * Carried because on a published type the two really do differ: a source
303
- * column called `Asset Id` cannot be a SQL identifier, so the property is
304
- * `Asset_Id` and `columnName` keeps the original. A reader recognises the
305
- * source spelling — it is what is on their spreadsheet — and a filter has to
306
- * be built from the property name, so a screen that shows only one of the two
307
- * either fails to be recognised or invites a filter on a name that resolves
308
- * to nothing. Both are here so a screen can show one and send the other.
302
+ * Lineage, and only lineage — nothing reads a record through it. A reader
303
+ * recognises the source spelling because it is what is on their spreadsheet,
304
+ * and a filter has to be built from the property name, so both are here and a
305
+ * screen can show one and send the other.
306
+ *
307
+ * The two differ less often than they used to. A property may now be named
308
+ * `Asset Id` outright: a store cleans the name to reach its column and
309
+ * aliases its view to the cleaned form, so a name is no longer required to be
310
+ * a SQL identifier. Publishers were previously told to send `{ name:
311
+ * 'Asset_Id', columnName: 'Asset Id' }`, which is where most of the divergent
312
+ * pairs in an older catalog come from — and it was a costly instruction,
313
+ * because a load matches records to properties by NAME, so those columns
314
+ * loaded NULL. The two still differ whenever a publisher chooses different
315
+ * names for its own reasons, which is why the field stays.
309
316
  *
310
317
  * Optional: a page served by a version of this library that predates the
311
318
  * field simply does not say, and a screen falls back to the property name.
package/dist/client.d.ts CHANGED
@@ -33,6 +33,36 @@ export type { CatalogGraph, CatalogObjectPage, CatalogObjectQuery, CatalogObject
33
33
  export { CATALOG_FILTER_LIMIT, CATALOG_FILTER_OPERATORS, coerceFilterValue, encodeObjectFilter, filterOperatorTakesValue, filterOperatorsFor, isCatalogFilterOperator, offeredFilterOperators, parseObjectFilter, resolveObjectFilters, VALUELESS_FILTER_OPERATORS, } from './catalog.filters';
34
34
  export type { CatalogFilterableColumn, CatalogFilterOperator, CatalogFilterResolution, CatalogObjectFilter, CatalogResolvedFilter, } from './catalog.filters';
35
35
  export type { SnapshotRef } from './catalog.store';
36
+ /**
37
+ * How a name becomes a column, shipped to the browser deliberately.
38
+ *
39
+ * The second exception to "types only" on this entry point, and it is made for
40
+ * the same reason `validateWorkflow` is the first: the answer has to be the
41
+ * same one the server will give, and the only way to guarantee that is for both
42
+ * to run these functions.
43
+ *
44
+ * A console proposing to replicate a table has to be able to ask, *before* it
45
+ * draws anything, whether the source's own column spellings could be published
46
+ * as property names — because a property `name` is what the warehouse looks
47
+ * every field up by, `row[property.name]`, so a name the publisher then refuses
48
+ * has to be renamed, and a rename with nothing renaming the record's keys to
49
+ * match writes null into that column on every run and reports success. That is
50
+ * not a hypothesis; it is what happened to six types in one evening.
51
+ *
52
+ * **Both halves, because the composition is the rule.** A name no longer has to
53
+ * be an identifier itself — the view's output alias and the read's lookup key go
54
+ * through {@link outputAlias} together, so `Asset Id` is a perfectly good
55
+ * property name and lands in `Asset_Id`. What is still refused is a name whose
56
+ * *cleaned* form is not an identifier: `2024 Total` cleans to `2024_Total`, and
57
+ * no store will quote a name starting with a digit. So the question worth asking
58
+ * from a browser is `isSafeIdentifier(physicalColumn(name))` — the same two
59
+ * calls, in the same order, that `identifierRefusal` makes at publish time.
60
+ * Exporting only `isSafeIdentifier` would let a console answer the stricter,
61
+ * obsolete question and refuse a graph the server would have accepted.
62
+ *
63
+ * Safe to export because `catalog.identifiers.ts` imports nothing at all.
64
+ */
65
+ export { isSafeIdentifier, outputAlias, physicalColumn, UnsafeIdentifierError, } from './catalog.identifiers';
36
66
  /** What a tier-0 edit to a type may change. */
37
67
  export interface TypePatch {
38
68
  displayName?: string;
@@ -123,8 +153,8 @@ export declare const catalogRoutes: {
123
153
  readonly traces: () => string;
124
154
  readonly trace: (id: string) => string;
125
155
  };
126
- export type { CatalogConnection, CatalogConnector, ConnectionCheck, CatalogTransform, CatalogWorkflow, CatalogWorkflowCapabilities, ConnectorKind, ConnectorRun, TransformLanguage, TransformResult, WorkflowEdge, WorkflowExecutionMode, WorkflowGraph, WorkflowIssueCode, WorkflowNode, WorkflowNodeKind, WorkflowNodeOutcome, WorkflowSinkNode, WorkflowSourceNode, WorkflowStageRef, WorkflowTransformNode, WorkflowValidationIssue, } from './catalog.pipeline';
127
- export { CONNECTOR_KINDS, isConnectorKind, isTransformLanguage, isWorkflowEdge, isWorkflowNode, TRANSFORM_LANGUAGES, } from './catalog.pipeline';
156
+ export type { CatalogConnection, CatalogConnector, ConnectionCheck, CatalogTransform, CatalogWorkflow, CatalogWorkflowCapabilities, ConnectorKind, ConnectorRun, TransformLanguage, TransformResult, CallableWorkflowRef, WorkflowCallEnvelope, WorkflowCallNode, WorkflowCallOutput, WorkflowEdge, WorkflowExecutionMode, WorkflowGraph, WorkflowIssueCode, WorkflowNode, WorkflowNodeKind, WorkflowNodeOutcome, WorkflowSinkNode, WorkflowSourceNode, WorkflowStageRef, WorkflowTransformNode, WorkflowValidationIssue, } from './catalog.pipeline';
157
+ export { CONNECTOR_KINDS, isConnectorKind, isTransformLanguage, isWorkflowEdge, isWorkflowNode, TRANSFORM_LANGUAGES, readWorkflowCallOutput, WORKFLOW_CALL_CONTRACT, } from './catalog.pipeline';
128
158
  /**
129
159
  * The workflow validator, shipped to the browser deliberately.
130
160
  *
package/dist/client.js CHANGED
@@ -11,7 +11,7 @@
11
11
  * types are.
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.DELETE_RECONCILIATION_STRATEGIES = exports.isWorkflowStatus = exports.isWorkflowNodeKind = exports.isWorkflowExecutionMode = exports.workflowRunOrder = exports.workflowGraphHash = exports.WORKFLOW_STATUSES = exports.WORKFLOW_NODE_KINDS = exports.WORKFLOW_NODE_ID_PATTERN = exports.WORKFLOW_ISSUE_CODES = exports.WORKFLOW_EXECUTION_MODES = exports.validateWorkflow = exports.TRANSFORM_LANGUAGES = exports.isWorkflowNode = exports.isWorkflowEdge = exports.isTransformLanguage = exports.isConnectorKind = exports.CONNECTOR_KINDS = exports.catalogRoutes = exports.VALUELESS_FILTER_OPERATORS = exports.resolveObjectFilters = exports.parseObjectFilter = exports.offeredFilterOperators = exports.isCatalogFilterOperator = exports.filterOperatorsFor = exports.filterOperatorTakesValue = exports.encodeObjectFilter = exports.coerceFilterValue = exports.CATALOG_FILTER_OPERATORS = exports.CATALOG_FILTER_LIMIT = exports.CATALOG_REVISION_LIMIT = void 0;
14
+ exports.DELETE_RECONCILIATION_STRATEGIES = exports.isWorkflowStatus = exports.isWorkflowNodeKind = exports.isWorkflowExecutionMode = exports.workflowRunOrder = exports.workflowGraphHash = exports.WORKFLOW_STATUSES = exports.WORKFLOW_NODE_KINDS = exports.WORKFLOW_NODE_ID_PATTERN = exports.WORKFLOW_ISSUE_CODES = exports.WORKFLOW_EXECUTION_MODES = exports.validateWorkflow = exports.WORKFLOW_CALL_CONTRACT = exports.readWorkflowCallOutput = exports.TRANSFORM_LANGUAGES = exports.isWorkflowNode = exports.isWorkflowEdge = exports.isTransformLanguage = exports.isConnectorKind = exports.CONNECTOR_KINDS = exports.catalogRoutes = exports.UnsafeIdentifierError = exports.physicalColumn = exports.outputAlias = exports.isSafeIdentifier = exports.VALUELESS_FILTER_OPERATORS = exports.resolveObjectFilters = exports.parseObjectFilter = exports.offeredFilterOperators = exports.isCatalogFilterOperator = exports.filterOperatorsFor = exports.filterOperatorTakesValue = exports.encodeObjectFilter = exports.coerceFilterValue = exports.CATALOG_FILTER_OPERATORS = exports.CATALOG_FILTER_LIMIT = exports.CATALOG_REVISION_LIMIT = void 0;
15
15
  exports.isDeleteReconciliationStrategy = isDeleteReconciliationStrategy;
16
16
  exports.pipelineExpectationRoutes = pipelineExpectationRoutes;
17
17
  // A value, not a type: a screen saying how far back the history goes should read
@@ -46,6 +46,40 @@ Object.defineProperty(exports, "offeredFilterOperators", { enumerable: true, get
46
46
  Object.defineProperty(exports, "parseObjectFilter", { enumerable: true, get: function () { return catalog_filters_1.parseObjectFilter; } });
47
47
  Object.defineProperty(exports, "resolveObjectFilters", { enumerable: true, get: function () { return catalog_filters_1.resolveObjectFilters; } });
48
48
  Object.defineProperty(exports, "VALUELESS_FILTER_OPERATORS", { enumerable: true, get: function () { return catalog_filters_1.VALUELESS_FILTER_OPERATORS; } });
49
+ /**
50
+ * How a name becomes a column, shipped to the browser deliberately.
51
+ *
52
+ * The second exception to "types only" on this entry point, and it is made for
53
+ * the same reason `validateWorkflow` is the first: the answer has to be the
54
+ * same one the server will give, and the only way to guarantee that is for both
55
+ * to run these functions.
56
+ *
57
+ * A console proposing to replicate a table has to be able to ask, *before* it
58
+ * draws anything, whether the source's own column spellings could be published
59
+ * as property names — because a property `name` is what the warehouse looks
60
+ * every field up by, `row[property.name]`, so a name the publisher then refuses
61
+ * has to be renamed, and a rename with nothing renaming the record's keys to
62
+ * match writes null into that column on every run and reports success. That is
63
+ * not a hypothesis; it is what happened to six types in one evening.
64
+ *
65
+ * **Both halves, because the composition is the rule.** A name no longer has to
66
+ * be an identifier itself — the view's output alias and the read's lookup key go
67
+ * through {@link outputAlias} together, so `Asset Id` is a perfectly good
68
+ * property name and lands in `Asset_Id`. What is still refused is a name whose
69
+ * *cleaned* form is not an identifier: `2024 Total` cleans to `2024_Total`, and
70
+ * no store will quote a name starting with a digit. So the question worth asking
71
+ * from a browser is `isSafeIdentifier(physicalColumn(name))` — the same two
72
+ * calls, in the same order, that `identifierRefusal` makes at publish time.
73
+ * Exporting only `isSafeIdentifier` would let a console answer the stricter,
74
+ * obsolete question and refuse a graph the server would have accepted.
75
+ *
76
+ * Safe to export because `catalog.identifiers.ts` imports nothing at all.
77
+ */
78
+ var catalog_identifiers_1 = require("./catalog.identifiers");
79
+ Object.defineProperty(exports, "isSafeIdentifier", { enumerable: true, get: function () { return catalog_identifiers_1.isSafeIdentifier; } });
80
+ Object.defineProperty(exports, "outputAlias", { enumerable: true, get: function () { return catalog_identifiers_1.outputAlias; } });
81
+ Object.defineProperty(exports, "physicalColumn", { enumerable: true, get: function () { return catalog_identifiers_1.physicalColumn; } });
82
+ Object.defineProperty(exports, "UnsafeIdentifierError", { enumerable: true, get: function () { return catalog_identifiers_1.UnsafeIdentifierError; } });
49
83
  /**
50
84
  * Builds the paths the catalog controller serves, relative to wherever it was
51
85
  * mounted. Kept as string builders rather than a fetch wrapper so the host
@@ -107,6 +141,10 @@ Object.defineProperty(exports, "isTransformLanguage", { enumerable: true, get: f
107
141
  Object.defineProperty(exports, "isWorkflowEdge", { enumerable: true, get: function () { return catalog_pipeline_1.isWorkflowEdge; } });
108
142
  Object.defineProperty(exports, "isWorkflowNode", { enumerable: true, get: function () { return catalog_pipeline_1.isWorkflowNode; } });
109
143
  Object.defineProperty(exports, "TRANSFORM_LANGUAGES", { enumerable: true, get: function () { return catalog_pipeline_1.TRANSFORM_LANGUAGES; } });
144
+ // A screen that shows what a call node got back narrows it the same way the
145
+ // runner does, so the two cannot disagree about what "no rows" looks like.
146
+ Object.defineProperty(exports, "readWorkflowCallOutput", { enumerable: true, get: function () { return catalog_pipeline_1.readWorkflowCallOutput; } });
147
+ Object.defineProperty(exports, "WORKFLOW_CALL_CONTRACT", { enumerable: true, get: function () { return catalog_pipeline_1.WORKFLOW_CALL_CONTRACT; } });
110
148
  /**
111
149
  * The workflow validator, shipped to the browser deliberately.
112
150
  *
package/dist/index.d.ts CHANGED
@@ -1,16 +1,17 @@
1
1
  export { CatalogProperty, type CatalogPropertyOptions, CatalogType, type CatalogTypeOptions, } from './catalog.decorators';
2
2
  export { CATALOG_EVENT_PHASE, CATALOG_EVENT_PHASE_FALLBACK, CATALOG_EVENTS, CATALOG_LIB, type CatalogEvent, type CatalogEventPayloads, UNATTRIBUTED_PRINCIPAL_ID, catalogEventPhase, channelNameFor, curationActor, emitCatalog, } from './catalog.events';
3
3
  export { CatalogModule } from './catalog.module';
4
- export { assertReadOnlyShape, type CatalogQueryRelation, type CatalogQueryRequest, type CatalogQueryResult, type CatalogQueryStore, isQueryStore, } from './catalog.query';
4
+ export { assertReadOnlyShape, type CatalogQueryRelation, type CatalogQueryRequest, type CatalogQueryResult, type CatalogQueryStore, type CatalogQueryStreamRequest, isQueryStore, isStreamingQueryStore, } from './catalog.query';
5
5
  export { CATALOG_OPTIONS, type CatalogModuleOptions } from './catalog.options';
6
6
  export * from './catalog.secrets';
7
7
  export { type CatalogOverlayStore, FileCatalogOverlayStore, InMemoryCatalogOverlayStore, } from './catalog.overlay-store';
8
8
  export { CATALOG_OVERLAY_STORE } from './catalog.overlay-store.token';
9
9
  export { MikroOrmCatalogRegistry } from './catalog.registry';
10
10
  export { CatalogRegistry } from './catalog.registry.base';
11
- export { CATALOG_PIPELINE_STORE, type CatalogConnection, type CatalogConnector, type ConnectionCheck, CONNECTOR_KINDS, type CatalogLoadExpectations, type CatalogLoadExpectationStore, type CatalogPipelineStore, type CatalogStageStore, type CatalogTransform, type CatalogWorkflow, type CatalogWorkflowCapabilities, type CatalogWorkflowStore, type ConnectorKind, type ConnectorRun, type DeleteReconciliation, isConnectorKind, isPipelineStore, isTransformLanguage, type LoadExpectation, type RowCountBound, type StoredLoadExpectation, supportsLoadExpectations, supportsTransformRevisions, isWorkflowEdge, isWorkflowExecutionMode, isWorkflowNode, isWorkflowNodeKind, isWorkflowStatus, supportsWorkflows, supportsWorkflowStages, TRANSFORM_RUNNER, TRANSFORM_LANGUAGES, type TransformLanguage, type TransformResult, type TransformRunner, validateWorkflow, WORKFLOW_EXECUTION_MODES, WORKFLOW_ISSUE_CODES, WORKFLOW_NODE_ID_PATTERN, WORKFLOW_NODE_KINDS, WORKFLOW_STATUSES, type WorkflowEdge, type WorkflowExecutionMode, type WorkflowGraph, workflowGraphHash, type WorkflowIssueCode, type WorkflowNode, type WorkflowNodeKind, type WorkflowNodeOutcome, type WorkflowNodeStepInput, type WorkflowNodeStepOutput, workflowRunOrder, type WorkflowSinkNode, type WorkflowSourceNode, type WorkflowStageRef, type WorkflowStatus, type WorkflowTransformNode, type WorkflowValidationIssue, } from './catalog.pipeline';
11
+ export { CATALOG_PIPELINE_STORE, type CatalogConnection, type CatalogConnector, type ConnectionCheck, CONNECTOR_KINDS, type CatalogLoadExpectations, type CatalogLoadExpectationStore, type CatalogPipelineStore, type CatalogStageStore, type CatalogTransform, type CatalogWorkflow, type CatalogWorkflowCapabilities, type CatalogWorkflowStore, type CallableWorkflowRef, type ConnectorKind, type ConnectorRun, type DeleteReconciliation, isConnectorKind, isPipelineStore, isTransformLanguage, type LoadExpectation, type RowCountBound, type StoredLoadExpectation, readWorkflowCallOutput, supportsLoadExpectations, supportsTransformRevisions, isWorkflowEdge, isWorkflowExecutionMode, isWorkflowNode, isWorkflowNodeKind, isWorkflowStatus, supportsWorkflows, supportsWorkflowStages, TRANSFORM_RUNNER, TRANSFORM_LANGUAGES, type TransformLanguage, type TransformResult, type TransformRunner, validateWorkflow, WORKFLOW_CALL_CONTRACT, WORKFLOW_EXECUTION_MODES, WORKFLOW_ISSUE_CODES, WORKFLOW_NODE_ID_PATTERN, WORKFLOW_NODE_KINDS, WORKFLOW_STATUSES, type WorkflowCallEnvelope, type WorkflowCallNode, type WorkflowCallOutput, type WorkflowEdge, type WorkflowExecutionMode, type WorkflowGraph, workflowGraphHash, type WorkflowIssueCode, type WorkflowNode, type WorkflowNodeKind, type WorkflowNodeOutcome, type WorkflowNodeStepInput, type WorkflowNodeStepOutput, workflowRunOrder, type WorkflowSinkNode, type WorkflowSourceNode, type WorkflowStageRef, type WorkflowStatus, type WorkflowTransformNode, type WorkflowValidationIssue, } from './catalog.pipeline';
12
12
  export * from './catalog.environment';
13
- export { QueryCache, toCsv } from './catalog.query-cache';
13
+ export { QueryCache } from './catalog.query-cache';
14
+ export { type CsvRow, csvCell, csvLines, guardFormula, toCsv } from './catalog.csv';
14
15
  export { SubprocessTransformRunner, type TransformRunnerOptions, } from './transform-runner';
15
16
  export { CatalogService } from './catalog.service';
16
17
  export { DEFAULT_SEARCH_LIMIT, MAX_SEARCH_LIMIT, bestMatch, emptySearch, maySearch, type SearchInput, type SearchableDashboard, type SearchableSavedQuery, searchCatalog, visibleToPrincipal, } from './search';
@@ -19,7 +20,7 @@ export { type AuditQuery, CATALOG_REVISION_LIMIT, CATALOG_TRACE_OUTCOMES, CATALO
19
20
  export { CATALOG_PRINCIPAL_RESOLVER, type CatalogActor, type CatalogGrants, type CatalogPrincipal, type CatalogPrincipalResolver, type CatalogScope, composePrincipalId, delegatePrincipal, expandScopes, hasScope, parsePrincipalId, PRINCIPAL_ACTOR_SEPARATOR, maySeeClassification, mayRead, mayWrite, readableObjectPage, StaticKeyPrincipalResolver, } from './catalog.principal';
20
21
  export * from './catalog.access';
21
22
  export * from './catalog.filters';
22
- export { assertNoColumnCollisions, assertSafeIdentifier, CATALOG_RESERVED_COLUMNS, CATALOG_SNAPSHOT_MODES, CATALOG_STORE, type CarryForwardResult, type CatalogColumnCollision, CatalogColumnCollisionError, type CatalogFilteringReadStore, supportsObjectFilters, type CatalogMergeStore, type CatalogReadQuery, type CatalogReadResult, type CatalogReadStore, type CatalogReservedColumn, type CatalogSnapshotMode, type CatalogStoreCapabilities, type CatalogWriteStore, type ColumnCollisionOptions, findColumnCollisions, isCatalogStoreCapabilities, isReservedColumn, isSafeIdentifier, isWriteStore, type SnapshotRef, supportsCarryForward, UnsafeIdentifierError, } from './catalog.store';
23
+ export { assertNoColumnCollisions, assertSafeIdentifier, CATALOG_RESERVED_COLUMNS, CATALOG_SNAPSHOT_MODES, CATALOG_STORE, type CarryForwardResult, type CatalogColumnCollision, CatalogColumnCollisionError, type CatalogFilteringReadStore, supportsObjectFilters, type CatalogMergeStore, type CatalogReadQuery, type CatalogReadResult, type CatalogReadStore, type CatalogReservedColumn, type CatalogSnapshotMode, type CatalogStoreCapabilities, type CatalogWriteStore, type ColumnCollisionOptions, findColumnCollisions, isCatalogStoreCapabilities, isReservedColumn, isSafeIdentifier, isWriteStore, outputAlias, physicalColumn, type SnapshotRef, supportsCarryForward, UnsafeIdentifierError, } from './catalog.store';
23
24
  export { MikroOrmReadStore } from './stores/mikro-orm-read.store';
24
25
  export type { CatalogGraph, CatalogObjectPage, CatalogObjectQuery, CatalogObjectTypeDef, CatalogOverlay, CatalogPropertyDef, CatalogRelationDef, CatalogSnapshot, RelationKind, ScalarType, } from './catalog.types';
25
26
  export { REQUIRED_SCOPES, REQUIRES_HUMAN, RequireHuman, RequireScopes, } from './catalog.route-auth';
package/dist/index.js CHANGED
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.MAX_SEARCH_LIMIT = exports.DEFAULT_SEARCH_LIMIT = exports.CatalogService = exports.SubprocessTransformRunner = exports.toCsv = exports.QueryCache = exports.workflowRunOrder = exports.workflowGraphHash = exports.WORKFLOW_STATUSES = exports.WORKFLOW_NODE_KINDS = exports.WORKFLOW_NODE_ID_PATTERN = exports.WORKFLOW_ISSUE_CODES = exports.WORKFLOW_EXECUTION_MODES = exports.validateWorkflow = exports.TRANSFORM_LANGUAGES = exports.TRANSFORM_RUNNER = exports.supportsWorkflowStages = exports.supportsWorkflows = exports.isWorkflowStatus = exports.isWorkflowNodeKind = exports.isWorkflowNode = exports.isWorkflowExecutionMode = exports.isWorkflowEdge = exports.supportsTransformRevisions = exports.supportsLoadExpectations = exports.isTransformLanguage = exports.isPipelineStore = exports.isConnectorKind = exports.CONNECTOR_KINDS = exports.CATALOG_PIPELINE_STORE = exports.CatalogRegistry = exports.MikroOrmCatalogRegistry = exports.CATALOG_OVERLAY_STORE = exports.InMemoryCatalogOverlayStore = exports.FileCatalogOverlayStore = exports.CATALOG_OPTIONS = exports.isQueryStore = exports.assertReadOnlyShape = exports.CatalogModule = exports.emitCatalog = exports.curationActor = exports.channelNameFor = exports.catalogEventPhase = exports.UNATTRIBUTED_PRINCIPAL_ID = exports.CATALOG_LIB = exports.CATALOG_EVENTS = exports.CATALOG_EVENT_PHASE_FALLBACK = exports.CATALOG_EVENT_PHASE = exports.CatalogType = exports.CatalogProperty = void 0;
18
- exports.RequireScopes = exports.RequireHuman = exports.REQUIRES_HUMAN = exports.REQUIRED_SCOPES = exports.MikroOrmReadStore = exports.UnsafeIdentifierError = exports.supportsCarryForward = exports.isWriteStore = exports.isSafeIdentifier = exports.isReservedColumn = exports.isCatalogStoreCapabilities = exports.findColumnCollisions = exports.supportsObjectFilters = exports.CatalogColumnCollisionError = exports.CATALOG_STORE = exports.CATALOG_SNAPSHOT_MODES = exports.CATALOG_RESERVED_COLUMNS = exports.assertSafeIdentifier = exports.assertNoColumnCollisions = exports.StaticKeyPrincipalResolver = exports.readableObjectPage = exports.mayWrite = exports.mayRead = exports.maySeeClassification = exports.PRINCIPAL_ACTOR_SEPARATOR = exports.parsePrincipalId = exports.hasScope = exports.expandScopes = exports.delegatePrincipal = exports.composePrincipalId = exports.CATALOG_PRINCIPAL_RESOLVER = exports.traceOutcomeFilter = exports.supportsSavedQueryRevisions = exports.isWorkspaceStore = exports.isTraceStore = exports.isCatalogTraceOutcome = exports.embeddedVisualization = exports.CATALOG_WORKSPACE_STORE = exports.CATALOG_TRACE_STORE = exports.CATALOG_TRACE_OUTCOMES = exports.CATALOG_REVISION_LIMIT = exports.visibleToPrincipal = exports.searchCatalog = exports.maySearch = exports.emptySearch = exports.bestMatch = void 0;
17
+ exports.csvLines = exports.csvCell = exports.QueryCache = exports.workflowRunOrder = exports.workflowGraphHash = exports.WORKFLOW_STATUSES = exports.WORKFLOW_NODE_KINDS = exports.WORKFLOW_NODE_ID_PATTERN = exports.WORKFLOW_ISSUE_CODES = exports.WORKFLOW_EXECUTION_MODES = exports.WORKFLOW_CALL_CONTRACT = exports.validateWorkflow = exports.TRANSFORM_LANGUAGES = exports.TRANSFORM_RUNNER = exports.supportsWorkflowStages = exports.supportsWorkflows = exports.isWorkflowStatus = exports.isWorkflowNodeKind = exports.isWorkflowNode = exports.isWorkflowExecutionMode = exports.isWorkflowEdge = exports.supportsTransformRevisions = exports.supportsLoadExpectations = exports.readWorkflowCallOutput = exports.isTransformLanguage = exports.isPipelineStore = exports.isConnectorKind = exports.CONNECTOR_KINDS = exports.CATALOG_PIPELINE_STORE = exports.CatalogRegistry = exports.MikroOrmCatalogRegistry = exports.CATALOG_OVERLAY_STORE = exports.InMemoryCatalogOverlayStore = exports.FileCatalogOverlayStore = exports.CATALOG_OPTIONS = exports.isStreamingQueryStore = exports.isQueryStore = exports.assertReadOnlyShape = exports.CatalogModule = exports.emitCatalog = exports.curationActor = exports.channelNameFor = exports.catalogEventPhase = exports.UNATTRIBUTED_PRINCIPAL_ID = exports.CATALOG_LIB = exports.CATALOG_EVENTS = exports.CATALOG_EVENT_PHASE_FALLBACK = exports.CATALOG_EVENT_PHASE = exports.CatalogType = exports.CatalogProperty = void 0;
18
+ exports.MikroOrmReadStore = exports.UnsafeIdentifierError = exports.supportsCarryForward = exports.physicalColumn = exports.outputAlias = exports.isWriteStore = exports.isSafeIdentifier = exports.isReservedColumn = exports.isCatalogStoreCapabilities = exports.findColumnCollisions = exports.supportsObjectFilters = exports.CatalogColumnCollisionError = exports.CATALOG_STORE = exports.CATALOG_SNAPSHOT_MODES = exports.CATALOG_RESERVED_COLUMNS = exports.assertSafeIdentifier = exports.assertNoColumnCollisions = exports.StaticKeyPrincipalResolver = exports.readableObjectPage = exports.mayWrite = exports.mayRead = exports.maySeeClassification = exports.PRINCIPAL_ACTOR_SEPARATOR = exports.parsePrincipalId = exports.hasScope = exports.expandScopes = exports.delegatePrincipal = exports.composePrincipalId = exports.CATALOG_PRINCIPAL_RESOLVER = exports.traceOutcomeFilter = exports.supportsSavedQueryRevisions = exports.isWorkspaceStore = exports.isTraceStore = exports.isCatalogTraceOutcome = exports.embeddedVisualization = exports.CATALOG_WORKSPACE_STORE = exports.CATALOG_TRACE_STORE = exports.CATALOG_TRACE_OUTCOMES = exports.CATALOG_REVISION_LIMIT = exports.visibleToPrincipal = exports.searchCatalog = exports.maySearch = exports.emptySearch = exports.bestMatch = exports.MAX_SEARCH_LIMIT = exports.DEFAULT_SEARCH_LIMIT = exports.CatalogService = exports.SubprocessTransformRunner = exports.toCsv = exports.guardFormula = void 0;
19
+ exports.RequireScopes = exports.RequireHuman = exports.REQUIRES_HUMAN = exports.REQUIRED_SCOPES = void 0;
19
20
  var catalog_decorators_1 = require("./catalog.decorators");
20
21
  Object.defineProperty(exports, "CatalogProperty", { enumerable: true, get: function () { return catalog_decorators_1.CatalogProperty; } });
21
22
  Object.defineProperty(exports, "CatalogType", { enumerable: true, get: function () { return catalog_decorators_1.CatalogType; } });
@@ -34,6 +35,7 @@ Object.defineProperty(exports, "CatalogModule", { enumerable: true, get: functio
34
35
  var catalog_query_1 = require("./catalog.query");
35
36
  Object.defineProperty(exports, "assertReadOnlyShape", { enumerable: true, get: function () { return catalog_query_1.assertReadOnlyShape; } });
36
37
  Object.defineProperty(exports, "isQueryStore", { enumerable: true, get: function () { return catalog_query_1.isQueryStore; } });
38
+ Object.defineProperty(exports, "isStreamingQueryStore", { enumerable: true, get: function () { return catalog_query_1.isStreamingQueryStore; } });
37
39
  var catalog_options_1 = require("./catalog.options");
38
40
  Object.defineProperty(exports, "CATALOG_OPTIONS", { enumerable: true, get: function () { return catalog_options_1.CATALOG_OPTIONS; } });
39
41
  // Everything, deliberately, and here more than anywhere: this is a seam two
@@ -59,6 +61,7 @@ Object.defineProperty(exports, "CONNECTOR_KINDS", { enumerable: true, get: funct
59
61
  Object.defineProperty(exports, "isConnectorKind", { enumerable: true, get: function () { return catalog_pipeline_1.isConnectorKind; } });
60
62
  Object.defineProperty(exports, "isPipelineStore", { enumerable: true, get: function () { return catalog_pipeline_1.isPipelineStore; } });
61
63
  Object.defineProperty(exports, "isTransformLanguage", { enumerable: true, get: function () { return catalog_pipeline_1.isTransformLanguage; } });
64
+ Object.defineProperty(exports, "readWorkflowCallOutput", { enumerable: true, get: function () { return catalog_pipeline_1.readWorkflowCallOutput; } });
62
65
  Object.defineProperty(exports, "supportsLoadExpectations", { enumerable: true, get: function () { return catalog_pipeline_1.supportsLoadExpectations; } });
63
66
  Object.defineProperty(exports, "supportsTransformRevisions", { enumerable: true, get: function () { return catalog_pipeline_1.supportsTransformRevisions; } });
64
67
  Object.defineProperty(exports, "isWorkflowEdge", { enumerable: true, get: function () { return catalog_pipeline_1.isWorkflowEdge; } });
@@ -71,6 +74,7 @@ Object.defineProperty(exports, "supportsWorkflowStages", { enumerable: true, get
71
74
  Object.defineProperty(exports, "TRANSFORM_RUNNER", { enumerable: true, get: function () { return catalog_pipeline_1.TRANSFORM_RUNNER; } });
72
75
  Object.defineProperty(exports, "TRANSFORM_LANGUAGES", { enumerable: true, get: function () { return catalog_pipeline_1.TRANSFORM_LANGUAGES; } });
73
76
  Object.defineProperty(exports, "validateWorkflow", { enumerable: true, get: function () { return catalog_pipeline_1.validateWorkflow; } });
77
+ Object.defineProperty(exports, "WORKFLOW_CALL_CONTRACT", { enumerable: true, get: function () { return catalog_pipeline_1.WORKFLOW_CALL_CONTRACT; } });
74
78
  Object.defineProperty(exports, "WORKFLOW_EXECUTION_MODES", { enumerable: true, get: function () { return catalog_pipeline_1.WORKFLOW_EXECUTION_MODES; } });
75
79
  Object.defineProperty(exports, "WORKFLOW_ISSUE_CODES", { enumerable: true, get: function () { return catalog_pipeline_1.WORKFLOW_ISSUE_CODES; } });
76
80
  Object.defineProperty(exports, "WORKFLOW_NODE_ID_PATTERN", { enumerable: true, get: function () { return catalog_pipeline_1.WORKFLOW_NODE_ID_PATTERN; } });
@@ -83,7 +87,14 @@ Object.defineProperty(exports, "workflowRunOrder", { enumerable: true, get: func
83
87
  __exportStar(require("./catalog.environment"), exports);
84
88
  var catalog_query_cache_1 = require("./catalog.query-cache");
85
89
  Object.defineProperty(exports, "QueryCache", { enumerable: true, get: function () { return catalog_query_cache_1.QueryCache; } });
86
- Object.defineProperty(exports, "toCsv", { enumerable: true, get: function () { return catalog_query_cache_1.toCsv; } });
90
+ // CSV. `toCsv` is the shape it always was; `csvLines` is the one the export
91
+ // route uses, and `guardFormula` is exported because a host writing its own
92
+ // export route needs the escaping and not the framing.
93
+ var catalog_csv_1 = require("./catalog.csv");
94
+ Object.defineProperty(exports, "csvCell", { enumerable: true, get: function () { return catalog_csv_1.csvCell; } });
95
+ Object.defineProperty(exports, "csvLines", { enumerable: true, get: function () { return catalog_csv_1.csvLines; } });
96
+ Object.defineProperty(exports, "guardFormula", { enumerable: true, get: function () { return catalog_csv_1.guardFormula; } });
97
+ Object.defineProperty(exports, "toCsv", { enumerable: true, get: function () { return catalog_csv_1.toCsv; } });
87
98
  var transform_runner_1 = require("./transform-runner");
88
99
  Object.defineProperty(exports, "SubprocessTransformRunner", { enumerable: true, get: function () { return transform_runner_1.SubprocessTransformRunner; } });
89
100
  var catalog_service_1 = require("./catalog.service");
@@ -152,6 +163,8 @@ Object.defineProperty(exports, "isCatalogStoreCapabilities", { enumerable: true,
152
163
  Object.defineProperty(exports, "isReservedColumn", { enumerable: true, get: function () { return catalog_store_1.isReservedColumn; } });
153
164
  Object.defineProperty(exports, "isSafeIdentifier", { enumerable: true, get: function () { return catalog_store_1.isSafeIdentifier; } });
154
165
  Object.defineProperty(exports, "isWriteStore", { enumerable: true, get: function () { return catalog_store_1.isWriteStore; } });
166
+ Object.defineProperty(exports, "outputAlias", { enumerable: true, get: function () { return catalog_store_1.outputAlias; } });
167
+ Object.defineProperty(exports, "physicalColumn", { enumerable: true, get: function () { return catalog_store_1.physicalColumn; } });
155
168
  Object.defineProperty(exports, "supportsCarryForward", { enumerable: true, get: function () { return catalog_store_1.supportsCarryForward; } });
156
169
  Object.defineProperty(exports, "UnsafeIdentifierError", { enumerable: true, get: function () { return catalog_store_1.UnsafeIdentifierError; } });
157
170
  var mikro_orm_read_store_1 = require("./stores/mikro-orm-read.store");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-catalog",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "A metadata registry for NestJS: object types, properties and relations, derived from your ORM and enriched with decorators.",
5
5
  "license": "MIT",
6
6
  "author": "Davide Carvalho",