@8ms/helpers 3.2.12 → 3.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/googleCloud/bigquery/_shared/index.cjs +1 -0
- package/dist/googleCloud/bigquery/_shared/index.d.cts +2 -2
- package/dist/googleCloud/bigquery/_shared/index.d.mts +2 -2
- package/dist/googleCloud/bigquery/_shared/index.mjs +2 -2
- package/dist/googleCloud/bigquery/_shared/zodToBQDefinition.cjs +13 -0
- package/dist/googleCloud/bigquery/_shared/zodToBQDefinition.d.cts +5 -0
- package/dist/googleCloud/bigquery/_shared/zodToBQDefinition.d.mts +5 -0
- package/dist/googleCloud/bigquery/_shared/zodToBQDefinition.mjs +13 -1
- package/dist/googleCloud/bigquery/client/index.cjs +1 -0
- package/dist/googleCloud/bigquery/client/index.d.cts +2 -2
- package/dist/googleCloud/bigquery/client/index.d.mts +2 -2
- package/dist/googleCloud/bigquery/client/index.mjs +2 -2
- package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.cjs +6 -2
- package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.mjs +6 -2
- package/dist/googleCloud/bigquery/server/index.cjs +1 -0
- package/dist/googleCloud/bigquery/server/index.d.cts +2 -2
- package/dist/googleCloud/bigquery/server/index.d.mts +2 -2
- package/dist/googleCloud/bigquery/server/index.mjs +2 -2
- package/dist/xlsx/_shared/createXlsx.cjs +1 -1
- package/dist/xlsx/_shared/createXlsx.mjs +1 -1
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ exports.googleAdsAccountBQRow = require_googleCloud_bigquery__shared_lookup_goog
|
|
|
40
40
|
exports.googleCloudBQRow = require_googleCloud_bigquery__shared_lookup_googleCloud.googleCloudBQRow;
|
|
41
41
|
exports.languageBQRow = require_googleCloud_bigquery__shared_lookup_language.languageBQRow;
|
|
42
42
|
exports.partitionType = require_googleCloud_bigquery__shared_partitionType.partitionType;
|
|
43
|
+
exports.toBQApiSchema = require_googleCloud_bigquery__shared_zodToBQDefinition.toBQApiSchema;
|
|
43
44
|
exports.zBQBytes = require_googleCloud_bigquery__shared_field_bqBytes.zBQBytes;
|
|
44
45
|
exports.zBQFloat = require_googleCloud_bigquery__shared_field_bqFloat.zBQFloat;
|
|
45
46
|
exports.zBQInt = require_googleCloud_bigquery__shared_field_bqInt.zBQInt;
|
|
@@ -16,6 +16,6 @@ import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "./lookup/googleAds
|
|
|
16
16
|
import { GoogleCloudBQRow, googleCloudBQRow } from "./lookup/googleCloud.cjs";
|
|
17
17
|
import { LanguageBQRow, languageBQRow } from "./lookup/language.cjs";
|
|
18
18
|
import { PartitionType, partitionType } from "./partitionType.cjs";
|
|
19
|
-
import { BQField, zodToBQSchema } from "./zodToBQDefinition.cjs";
|
|
19
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "./zodToBQDefinition.cjs";
|
|
20
20
|
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "./types.cjs";
|
|
21
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
21
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -16,6 +16,6 @@ import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "./lookup/googleAds
|
|
|
16
16
|
import { GoogleCloudBQRow, googleCloudBQRow } from "./lookup/googleCloud.mjs";
|
|
17
17
|
import { LanguageBQRow, languageBQRow } from "./lookup/language.mjs";
|
|
18
18
|
import { PartitionType, partitionType } from "./partitionType.mjs";
|
|
19
|
-
import { BQField, zodToBQSchema } from "./zodToBQDefinition.mjs";
|
|
19
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "./zodToBQDefinition.mjs";
|
|
20
20
|
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "./types.mjs";
|
|
21
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
21
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -16,5 +16,5 @@ import { googleAdsAccountBQRow } from "./lookup/googleAdsAccount.mjs";
|
|
|
16
16
|
import { googleCloudBQRow } from "./lookup/googleCloud.mjs";
|
|
17
17
|
import { languageBQRow } from "./lookup/language.mjs";
|
|
18
18
|
import { partitionType } from "./partitionType.mjs";
|
|
19
|
-
import { zodToBQSchema } from "./zodToBQDefinition.mjs";
|
|
20
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
19
|
+
import { toBQApiSchema, zodToBQSchema } from "./zodToBQDefinition.mjs";
|
|
20
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -57,5 +57,18 @@ const zodToBQSchema = (schema) => {
|
|
|
57
57
|
return buildBQField(name, fieldSchema);
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Maps BQField (which names nested columns subFields) to the shape the BigQuery API expects,
|
|
62
|
+
* where nested columns are called fields. Apply at the API boundary only.
|
|
63
|
+
*/
|
|
64
|
+
const toBQApiSchema = (fields) => {
|
|
65
|
+
return fields.map(({ subFields, ...field }) => {
|
|
66
|
+
return subFields ? {
|
|
67
|
+
...field,
|
|
68
|
+
fields: toBQApiSchema(subFields)
|
|
69
|
+
} : field;
|
|
70
|
+
});
|
|
71
|
+
};
|
|
60
72
|
//#endregion
|
|
73
|
+
exports.toBQApiSchema = toBQApiSchema;
|
|
61
74
|
exports.zodToBQSchema = zodToBQSchema;
|
|
@@ -16,4 +16,9 @@ export type BQField = {
|
|
|
16
16
|
* RECORD.
|
|
17
17
|
*/
|
|
18
18
|
export declare const zodToBQSchema: (schema: z.ZodObject<z.ZodRawShape>) => BQField[];
|
|
19
|
+
/**
|
|
20
|
+
* Maps BQField (which names nested columns subFields) to the shape the BigQuery API expects,
|
|
21
|
+
* where nested columns are called fields. Apply at the API boundary only.
|
|
22
|
+
*/
|
|
23
|
+
export declare const toBQApiSchema: (fields: BQField[]) => object[];
|
|
19
24
|
//#endregion
|
|
@@ -16,4 +16,9 @@ export type BQField = {
|
|
|
16
16
|
* RECORD.
|
|
17
17
|
*/
|
|
18
18
|
export declare const zodToBQSchema: (schema: z.ZodObject<z.ZodRawShape>) => BQField[];
|
|
19
|
+
/**
|
|
20
|
+
* Maps BQField (which names nested columns subFields) to the shape the BigQuery API expects,
|
|
21
|
+
* where nested columns are called fields. Apply at the API boundary only.
|
|
22
|
+
*/
|
|
23
|
+
export declare const toBQApiSchema: (fields: BQField[]) => object[];
|
|
19
24
|
//#endregion
|
|
@@ -56,5 +56,17 @@ const zodToBQSchema = (schema) => {
|
|
|
56
56
|
return buildBQField(name, fieldSchema);
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Maps BQField (which names nested columns subFields) to the shape the BigQuery API expects,
|
|
61
|
+
* where nested columns are called fields. Apply at the API boundary only.
|
|
62
|
+
*/
|
|
63
|
+
const toBQApiSchema = (fields) => {
|
|
64
|
+
return fields.map(({ subFields, ...field }) => {
|
|
65
|
+
return subFields ? {
|
|
66
|
+
...field,
|
|
67
|
+
fields: toBQApiSchema(subFields)
|
|
68
|
+
} : field;
|
|
69
|
+
});
|
|
70
|
+
};
|
|
59
71
|
//#endregion
|
|
60
|
-
export { zodToBQSchema };
|
|
72
|
+
export { toBQApiSchema, zodToBQSchema };
|
|
@@ -41,6 +41,7 @@ exports.googleAdsAccountBQRow = require_googleCloud_bigquery__shared_lookup_goog
|
|
|
41
41
|
exports.googleCloudBQRow = require_googleCloud_bigquery__shared_lookup_googleCloud.googleCloudBQRow;
|
|
42
42
|
exports.languageBQRow = require_googleCloud_bigquery__shared_lookup_language.languageBQRow;
|
|
43
43
|
exports.partitionType = require_googleCloud_bigquery__shared_partitionType.partitionType;
|
|
44
|
+
exports.toBQApiSchema = require_googleCloud_bigquery__shared_zodToBQDefinition.toBQApiSchema;
|
|
44
45
|
exports.zBQBytes = require_googleCloud_bigquery__shared_field_bqBytes.zBQBytes;
|
|
45
46
|
exports.zBQFloat = require_googleCloud_bigquery__shared_field_bqFloat.zBQFloat;
|
|
46
47
|
exports.zBQInt = require_googleCloud_bigquery__shared_field_bqInt.zBQInt;
|
|
@@ -16,7 +16,7 @@ import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "../_shared/lookup/
|
|
|
16
16
|
import { GoogleCloudBQRow, googleCloudBQRow } from "../_shared/lookup/googleCloud.cjs";
|
|
17
17
|
import { LanguageBQRow, languageBQRow } from "../_shared/lookup/language.cjs";
|
|
18
18
|
import { PartitionType, partitionType } from "../_shared/partitionType.cjs";
|
|
19
|
-
import { BQField, zodToBQSchema } from "../_shared/zodToBQDefinition.cjs";
|
|
19
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.cjs";
|
|
20
20
|
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "../_shared/types.cjs";
|
|
21
21
|
import "../_shared/index.cjs";
|
|
22
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
22
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -16,7 +16,7 @@ import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "../_shared/lookup/
|
|
|
16
16
|
import { GoogleCloudBQRow, googleCloudBQRow } from "../_shared/lookup/googleCloud.mjs";
|
|
17
17
|
import { LanguageBQRow, languageBQRow } from "../_shared/lookup/language.mjs";
|
|
18
18
|
import { PartitionType, partitionType } from "../_shared/partitionType.mjs";
|
|
19
|
-
import { BQField, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
19
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
20
20
|
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "../_shared/types.mjs";
|
|
21
21
|
import "../_shared/index.mjs";
|
|
22
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
22
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -16,6 +16,6 @@ import { googleAdsAccountBQRow } from "../_shared/lookup/googleAdsAccount.mjs";
|
|
|
16
16
|
import { googleCloudBQRow } from "../_shared/lookup/googleCloud.mjs";
|
|
17
17
|
import { languageBQRow } from "../_shared/lookup/language.mjs";
|
|
18
18
|
import { partitionType } from "../_shared/partitionType.mjs";
|
|
19
|
-
import { zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
19
|
+
import { toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
20
20
|
import "../_shared/index.mjs";
|
|
21
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
21
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -10,6 +10,7 @@ const require_json__shared_getJsonNewline = require("../../../json/_shared/getJs
|
|
|
10
10
|
const require_stream_server_json_logic = require("../../../stream/server/json/logic.cjs");
|
|
11
11
|
const require_stream_server_json_write = require("../../../stream/server/json/write.cjs");
|
|
12
12
|
require("../../../stream/server/index.cjs");
|
|
13
|
+
const require_googleCloud_bigquery__shared_zodToBQDefinition = require("../_shared/zodToBQDefinition.cjs");
|
|
13
14
|
let node_stream_promises = require("node:stream/promises");
|
|
14
15
|
//#region src/googleCloud/bigquery/server/GoogleCloudBigquery.ts
|
|
15
16
|
/** Maps this library's generic file-type catalog onto BigQuery's own load-job sourceFormat strings. */
|
|
@@ -119,7 +120,10 @@ var GoogleCloudBigquery = class extends require__class__shared_BaseNamespace.Bas
|
|
|
119
120
|
*/
|
|
120
121
|
createTable = async (datasetId, datasetOptions = {}, tableId, options) => {
|
|
121
122
|
await this.createDataset(datasetId, datasetOptions);
|
|
122
|
-
if (!await this.tableExists(datasetId, tableId)) await this.client.dataset(datasetId).createTable(tableId, {
|
|
123
|
+
if (!await this.tableExists(datasetId, tableId)) await this.client.dataset(datasetId).createTable(tableId, {
|
|
124
|
+
...options ?? {},
|
|
125
|
+
schema: options?.schema && require_googleCloud_bigquery__shared_zodToBQDefinition.toBQApiSchema(options.schema)
|
|
126
|
+
});
|
|
123
127
|
};
|
|
124
128
|
/**
|
|
125
129
|
* Check to see whether a given BigQuery table exists.
|
|
@@ -159,7 +163,7 @@ var GoogleCloudBigquery = class extends require__class__shared_BaseNamespace.Bas
|
|
|
159
163
|
await this.createTable(props.table.datasetId, {}, props.table.tableId, props.table.options);
|
|
160
164
|
await this.client.dataset(props.table.datasetId, { location: finalRegion }).table(props.table.tableId).load(props.googleCloudStorage.client.bucket(props.file.bucket).file(props.file.key), {
|
|
161
165
|
autodetect: props.schema ? false : props.autodetect ?? true,
|
|
162
|
-
schema: props.schema ? { fields: props.schema } : void 0,
|
|
166
|
+
schema: props.schema ? { fields: require_googleCloud_bigquery__shared_zodToBQDefinition.toBQApiSchema(props.schema) } : void 0,
|
|
163
167
|
sourceFormat: bigQuerySourceFormat[props.file.sourceFormat ?? require_file__shared_fileType.fileType.JSON_NEWLINE],
|
|
164
168
|
schemaUpdateOptions: ["ALLOW_FIELD_ADDITION"],
|
|
165
169
|
location: finalRegion
|
|
@@ -9,6 +9,7 @@ import { getJsonNewline } from "../../../json/_shared/getJsonNewline.mjs";
|
|
|
9
9
|
import { toRowReadable } from "../../../stream/server/json/logic.mjs";
|
|
10
10
|
import { jsonNewLineStringifier } from "../../../stream/server/json/write.mjs";
|
|
11
11
|
import "../../../stream/server/index.mjs";
|
|
12
|
+
import { toBQApiSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
12
13
|
import { pipeline } from "node:stream/promises";
|
|
13
14
|
//#region src/googleCloud/bigquery/server/GoogleCloudBigquery.ts
|
|
14
15
|
/** Maps this library's generic file-type catalog onto BigQuery's own load-job sourceFormat strings. */
|
|
@@ -118,7 +119,10 @@ var GoogleCloudBigquery = class extends BaseNamespace {
|
|
|
118
119
|
*/
|
|
119
120
|
createTable = async (datasetId, datasetOptions = {}, tableId, options) => {
|
|
120
121
|
await this.createDataset(datasetId, datasetOptions);
|
|
121
|
-
if (!await this.tableExists(datasetId, tableId)) await this.client.dataset(datasetId).createTable(tableId, {
|
|
122
|
+
if (!await this.tableExists(datasetId, tableId)) await this.client.dataset(datasetId).createTable(tableId, {
|
|
123
|
+
...options ?? {},
|
|
124
|
+
schema: options?.schema && toBQApiSchema(options.schema)
|
|
125
|
+
});
|
|
122
126
|
};
|
|
123
127
|
/**
|
|
124
128
|
* Check to see whether a given BigQuery table exists.
|
|
@@ -158,7 +162,7 @@ var GoogleCloudBigquery = class extends BaseNamespace {
|
|
|
158
162
|
await this.createTable(props.table.datasetId, {}, props.table.tableId, props.table.options);
|
|
159
163
|
await this.client.dataset(props.table.datasetId, { location: finalRegion }).table(props.table.tableId).load(props.googleCloudStorage.client.bucket(props.file.bucket).file(props.file.key), {
|
|
160
164
|
autodetect: props.schema ? false : props.autodetect ?? true,
|
|
161
|
-
schema: props.schema ? { fields: props.schema } : void 0,
|
|
165
|
+
schema: props.schema ? { fields: toBQApiSchema(props.schema) } : void 0,
|
|
162
166
|
sourceFormat: bigQuerySourceFormat[props.file.sourceFormat ?? fileType.JSON_NEWLINE],
|
|
163
167
|
schemaUpdateOptions: ["ALLOW_FIELD_ADDITION"],
|
|
164
168
|
location: finalRegion
|
|
@@ -45,6 +45,7 @@ exports.googleAdsAccountBQRow = require_googleCloud_bigquery__shared_lookup_goog
|
|
|
45
45
|
exports.googleCloudBQRow = require_googleCloud_bigquery__shared_lookup_googleCloud.googleCloudBQRow;
|
|
46
46
|
exports.languageBQRow = require_googleCloud_bigquery__shared_lookup_language.languageBQRow;
|
|
47
47
|
exports.partitionType = require_googleCloud_bigquery__shared_partitionType.partitionType;
|
|
48
|
+
exports.toBQApiSchema = require_googleCloud_bigquery__shared_zodToBQDefinition.toBQApiSchema;
|
|
48
49
|
exports.zBQBytes = require_googleCloud_bigquery__shared_field_bqBytes.zBQBytes;
|
|
49
50
|
exports.zBQFloat = require_googleCloud_bigquery__shared_field_bqFloat.zBQFloat;
|
|
50
51
|
exports.zBQInt = require_googleCloud_bigquery__shared_field_bqInt.zBQInt;
|
|
@@ -16,9 +16,9 @@ import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "../_shared/lookup/
|
|
|
16
16
|
import { GoogleCloudBQRow, googleCloudBQRow } from "../_shared/lookup/googleCloud.cjs";
|
|
17
17
|
import { LanguageBQRow, languageBQRow } from "../_shared/lookup/language.cjs";
|
|
18
18
|
import { PartitionType, partitionType } from "../_shared/partitionType.cjs";
|
|
19
|
-
import { BQField, zodToBQSchema } from "../_shared/zodToBQDefinition.cjs";
|
|
19
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.cjs";
|
|
20
20
|
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "../_shared/types.cjs";
|
|
21
21
|
import "../_shared/index.cjs";
|
|
22
22
|
import { GoogleCloudBigquery } from "./GoogleCloudBigquery.cjs";
|
|
23
23
|
import { getHandlerPath } from "./getHandlerPath.cjs";
|
|
24
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, GoogleCloudBigquery, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, getHandlerPath, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
24
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, GoogleCloudBigquery, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, getHandlerPath, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -16,9 +16,9 @@ import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "../_shared/lookup/
|
|
|
16
16
|
import { GoogleCloudBQRow, googleCloudBQRow } from "../_shared/lookup/googleCloud.mjs";
|
|
17
17
|
import { LanguageBQRow, languageBQRow } from "../_shared/lookup/language.mjs";
|
|
18
18
|
import { PartitionType, partitionType } from "../_shared/partitionType.mjs";
|
|
19
|
-
import { BQField, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
19
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
20
20
|
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "../_shared/types.mjs";
|
|
21
21
|
import "../_shared/index.mjs";
|
|
22
22
|
import { GoogleCloudBigquery } from "./GoogleCloudBigquery.mjs";
|
|
23
23
|
import { getHandlerPath } from "./getHandlerPath.mjs";
|
|
24
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, GoogleCloudBigquery, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, getHandlerPath, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
24
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleAdsAccountBQRow, GoogleCloudBQRow, GoogleCloudBigquery, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, getHandlerPath, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -16,8 +16,8 @@ import { googleAdsAccountBQRow } from "../_shared/lookup/googleAdsAccount.mjs";
|
|
|
16
16
|
import { googleCloudBQRow } from "../_shared/lookup/googleCloud.mjs";
|
|
17
17
|
import { languageBQRow } from "../_shared/lookup/language.mjs";
|
|
18
18
|
import { partitionType } from "../_shared/partitionType.mjs";
|
|
19
|
-
import { zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
19
|
+
import { toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
20
20
|
import "../_shared/index.mjs";
|
|
21
21
|
import { GoogleCloudBigquery } from "./GoogleCloudBigquery.mjs";
|
|
22
22
|
import { getHandlerPath } from "./getHandlerPath.mjs";
|
|
23
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, GoogleCloudBigquery, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, getHandlerPath, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
23
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, GoogleCloudBigquery, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, getHandlerPath, googleAdsAccountBQRow, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_xlsx__shared_column = require("./column.cjs");
|
|
3
3
|
const require_xlsx__shared_cell = require("./cell.cjs");
|
|
4
|
-
const require_xlsx__shared_sheet = require("./sheet.cjs");
|
|
5
4
|
const require_zip__shared_ZipArchive = require("../../zip/_shared/ZipArchive.cjs");
|
|
5
|
+
const require_xlsx__shared_sheet = require("./sheet.cjs");
|
|
6
6
|
//#region src/xlsx/_shared/createXlsx.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a complete .xlsx workbook from scratch, using hand-written OOXML rather
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getColumLetter, getColumnWidth } from "./column.mjs";
|
|
2
2
|
import { buildCellXml, getCellValue, getEscapedXml } from "./cell.mjs";
|
|
3
|
-
import { getUniqueSheetNames } from "./sheet.mjs";
|
|
4
3
|
import { ZipArchive } from "../../zip/_shared/ZipArchive.mjs";
|
|
4
|
+
import { getUniqueSheetNames } from "./sheet.mjs";
|
|
5
5
|
//#region src/xlsx/_shared/createXlsx.ts
|
|
6
6
|
/**
|
|
7
7
|
* Builds a complete .xlsx workbook from scratch, using hand-written OOXML rather
|