@dudousxd/nestjs-catalog 0.20.0 → 0.21.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.
@@ -34,15 +34,22 @@ export declare function isConnectorKind(value: unknown): value is ConnectorKind;
34
34
  * one: this used to be compared against string literals in the parser and
35
35
  * spelled out again in a dropdown, and the two had no way to disagree loudly.
36
36
  * The parser's chain also *ended* in JSON, so a format it did not recognise was
37
- * not refused — it was read as JSON, and a spreadsheet handed to `JSON.parse`
38
- * fails with a syntax error that names a byte offset rather than the format.
39
- *
40
- * `xlsx` is the odd one and is named for what it is: the only member whose
41
- * payload is binary. The other three are text, and everything that reads them
42
- * decodes the bytes first. Anything deciding something *per format* narrows
43
- * against this and answers {@link unreachableSourceFormat}.
44
- */
45
- export declare const SOURCE_FORMATS: readonly ["csv", "ndjson", "json", "xlsx"];
37
+ * not refused — it was read as JSON, so a spreadsheet handed to `JSON.parse`
38
+ * failed with a syntax error naming a byte offset rather than the format, and
39
+ * so did `format: "parquet"`.
40
+ *
41
+ * Two things distinguish the members, and everything downstream turns on one or
42
+ * the other. **Text or binary:** `xlsx` and `parquet` are binary, so everything
43
+ * that reads them takes bytes, and the other two are decoded first. **Whether
44
+ * there is a row boundary a reader can find without holding the whole
45
+ * payload:** `csv` and `ndjson` have one at every newline and `parquet` has one
46
+ * at every row group, so those three are read as a stream; `json` is a single
47
+ * value whose array may be nested inside an envelope that is only found by
48
+ * parsing down to it, and `xlsx` is a ZIP whose shared-string table generally
49
+ * has to be read before the sheet. Anything deciding something *per format*
50
+ * narrows against this list and answers {@link unreachableSourceFormat}.
51
+ */
52
+ export declare const SOURCE_FORMATS: readonly ["csv", "ndjson", "json", "xlsx", "parquet"];
46
53
  export type SourceFormat = (typeof SOURCE_FORMATS)[number];
47
54
  /** Same reason as {@link isConnectorKind}: one list, no second copy to drift. */
48
55
  export declare function isSourceFormat(value: unknown): value is SourceFormat;
@@ -105,13 +105,20 @@ function isConnectorKind(value) {
105
105
  * one: this used to be compared against string literals in the parser and
106
106
  * spelled out again in a dropdown, and the two had no way to disagree loudly.
107
107
  * The parser's chain also *ended* in JSON, so a format it did not recognise was
108
- * not refused — it was read as JSON, and a spreadsheet handed to `JSON.parse`
109
- * fails with a syntax error that names a byte offset rather than the format.
110
- *
111
- * `xlsx` is the odd one and is named for what it is: the only member whose
112
- * payload is binary. The other three are text, and everything that reads them
113
- * decodes the bytes first. Anything deciding something *per format* narrows
114
- * against this and answers {@link unreachableSourceFormat}.
108
+ * not refused — it was read as JSON, so a spreadsheet handed to `JSON.parse`
109
+ * failed with a syntax error naming a byte offset rather than the format, and
110
+ * so did `format: "parquet"`.
111
+ *
112
+ * Two things distinguish the members, and everything downstream turns on one or
113
+ * the other. **Text or binary:** `xlsx` and `parquet` are binary, so everything
114
+ * that reads them takes bytes, and the other two are decoded first. **Whether
115
+ * there is a row boundary a reader can find without holding the whole
116
+ * payload:** `csv` and `ndjson` have one at every newline and `parquet` has one
117
+ * at every row group, so those three are read as a stream; `json` is a single
118
+ * value whose array may be nested inside an envelope that is only found by
119
+ * parsing down to it, and `xlsx` is a ZIP whose shared-string table generally
120
+ * has to be read before the sheet. Anything deciding something *per format*
121
+ * narrows against this list and answers {@link unreachableSourceFormat}.
115
122
  */
116
123
  exports.SOURCE_FORMATS = [
117
124
  /** Delimited text with a header row. The delimiter is configurable. */
@@ -121,13 +128,22 @@ exports.SOURCE_FORMATS = [
121
128
  /** A JSON document, optionally with the array nested in an envelope. */
122
129
  'json',
123
130
  /**
124
- * A spreadsheet workbook — binary, and the only member that is.
131
+ * A spreadsheet workbook — binary, and read whole.
125
132
  *
126
133
  * Named for the modern extension, but the reader identifies the container
127
134
  * from its own bytes, so the legacy `.xls` and the macro-enabled `.xlsm` are
128
135
  * this format too rather than three names for one decision.
129
136
  */
130
137
  'xlsx',
138
+ /**
139
+ * Apache Parquet — binary, and read a row group at a time.
140
+ *
141
+ * A row group is a chunk boundary the format supplies rather than one a
142
+ * reader has to invent, which is what separates it from `xlsx`. It also
143
+ * carries a real type system, so unlike the text formats a value arrives as
144
+ * the type the writer meant rather than as a string.
145
+ */
146
+ 'parquet',
131
147
  ];
132
148
  /** Same reason as {@link isConnectorKind}: one list, no second copy to drift. */
133
149
  function isSourceFormat(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-catalog",
3
- "version": "0.20.0",
3
+ "version": "0.21.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",