@8ms/helpers 3.2.12 → 3.2.14
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/adverity/_shared/index.mjs +1 -2
- package/dist/adverity/client/index.mjs +1 -2
- package/dist/adverity/server/getJobs.cjs +1 -1
- package/dist/adverity/server/getJobs.d.cts +2 -1
- package/dist/adverity/server/getJobs.d.mts +2 -1
- package/dist/adverity/server/getJobs.mjs +1 -1
- package/dist/api/_shared/ApiResponseClass.d.cts +2 -1
- package/dist/api/_shared/ApiResponseClass.d.mts +2 -1
- package/dist/api/_shared/index.cjs +1 -1
- package/dist/api/_shared/index.mjs +1 -1
- package/dist/api/client/index.cjs +1 -1
- package/dist/api/client/index.mjs +1 -1
- package/dist/api/server/index.cjs +1 -1
- package/dist/api/server/index.mjs +1 -1
- package/dist/array/_shared/index.mjs +1 -2
- package/dist/array/client/index.mjs +1 -2
- package/dist/array/server/index.mjs +1 -2
- package/dist/atInternet/_shared/index.mjs +1 -2
- package/dist/atInternet/client/index.mjs +1 -2
- package/dist/atInternet/server/index.mjs +1 -2
- package/dist/aws/cloudWatchMetric/server/index.mjs +1 -2
- package/dist/aws/ecs/server/AwsEcs.d.cts +2 -1
- package/dist/aws/ecs/server/AwsEcs.d.mts +2 -1
- package/dist/aws/glue/server/index.mjs +1 -2
- package/dist/aws/lambda/server/AwsLambda.d.cts +2 -1
- package/dist/aws/lambda/server/AwsLambda.d.mts +2 -1
- package/dist/aws/s3/_shared/index.mjs +1 -2
- package/dist/aws/s3/server/AwsS3.cjs +1 -1
- package/dist/aws/s3/server/AwsS3.mjs +1 -1
- package/dist/aws/ses/server/SimpleEmail.d.cts +2 -1
- package/dist/aws/ses/server/SimpleEmail.d.mts +2 -1
- package/dist/aws/sqs/server/AwsSqs.d.cts +2 -1
- package/dist/aws/sqs/server/AwsSqs.d.mts +2 -1
- package/dist/aws/sqs/server/index.mjs +1 -2
- package/dist/aws/ssm/server/index.mjs +1 -2
- package/dist/boolean/_shared/index.mjs +1 -2
- package/dist/boolean/client/index.mjs +1 -2
- package/dist/boolean/server/index.mjs +1 -2
- package/dist/brightData/googleTrends/_shared/buildGoogleTrendsUrl.d.cts +2 -1
- package/dist/brightData/googleTrends/_shared/buildGoogleTrendsUrl.d.mts +2 -1
- package/dist/brightData/googleTrends/_shared/getReportQueries.d.cts +2 -1
- package/dist/brightData/googleTrends/_shared/getReportQueries.d.mts +2 -1
- package/dist/brightData/googleTrends/_shared/getReportTopics.d.cts +2 -1
- package/dist/brightData/googleTrends/_shared/getReportTopics.d.mts +2 -1
- package/dist/brightData/googleTrends/_shared/getReportTrend.d.cts +2 -1
- package/dist/brightData/googleTrends/_shared/getReportTrend.d.mts +2 -1
- package/dist/brightData/serpApi/server/buildGoogleSerpUrl.d.cts +2 -1
- package/dist/brightData/serpApi/server/buildGoogleSerpUrl.d.mts +2 -1
- package/dist/brightData/server/index.mjs +1 -2
- package/dist/brightData/webScraperIde/server/getBatch.d.cts +2 -1
- package/dist/brightData/webScraperIde/server/getBatch.d.mts +2 -1
- package/dist/cache/server/index.mjs +1 -2
- package/dist/crud/_shared/index.mjs +1 -2
- package/dist/crud/client/index.mjs +1 -2
- package/dist/crud/server/index.mjs +1 -2
- package/dist/drizzle/server/index.mjs +1 -2
- package/dist/environment/_shared/index.mjs +1 -2
- package/dist/environment/client/index.mjs +1 -2
- package/dist/environment/server/index.mjs +1 -2
- package/dist/eskimi/_shared/eskimi.d.cts +2 -1
- package/dist/eskimi/_shared/eskimi.d.mts +2 -1
- package/dist/eskimi/_shared/index.mjs +1 -2
- package/dist/eskimi/client/index.mjs +1 -2
- package/dist/googleAds/keywordPlanner/_shared/bigquery.cjs +1 -1
- package/dist/googleAds/keywordPlanner/_shared/bigquery.mjs +1 -1
- package/dist/googleAds/server/index.mjs +1 -2
- package/dist/googleCloud/bigquery/_shared/field/bqFieldType.cjs +2 -1
- package/dist/googleCloud/bigquery/_shared/field/bqFieldType.d.cts +2 -0
- package/dist/googleCloud/bigquery/_shared/field/bqFieldType.d.mts +2 -0
- package/dist/googleCloud/bigquery/_shared/field/bqFieldType.mjs +2 -1
- package/dist/googleCloud/bigquery/_shared/field/bqJson.cjs +11 -0
- package/dist/googleCloud/bigquery/_shared/field/bqJson.d.cts +9 -0
- package/dist/googleCloud/bigquery/_shared/field/bqJson.d.mts +9 -0
- package/dist/googleCloud/bigquery/_shared/field/bqJson.mjs +9 -0
- package/dist/googleCloud/bigquery/_shared/index.cjs +12 -3
- package/dist/googleCloud/bigquery/_shared/index.d.cts +7 -5
- package/dist/googleCloud/bigquery/_shared/index.d.mts +7 -5
- package/dist/googleCloud/bigquery/_shared/index.mjs +5 -3
- package/dist/googleCloud/bigquery/_shared/lookup/account.cjs +44 -0
- package/dist/googleCloud/bigquery/_shared/lookup/account.d.cts +31 -0
- package/dist/googleCloud/bigquery/_shared/lookup/account.d.mts +31 -0
- package/dist/googleCloud/bigquery/_shared/lookup/account.mjs +41 -0
- package/dist/googleCloud/bigquery/_shared/lookup/accountPlatform.cjs +19 -0
- package/dist/googleCloud/bigquery/_shared/lookup/accountPlatform.d.cts +28 -0
- package/dist/googleCloud/bigquery/_shared/lookup/accountPlatform.d.mts +28 -0
- package/dist/googleCloud/bigquery/_shared/lookup/accountPlatform.mjs +17 -0
- package/dist/googleCloud/bigquery/_shared/zodToBQDefinition.cjs +14 -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 +14 -1
- package/dist/googleCloud/bigquery/client/index.cjs +12 -3
- package/dist/googleCloud/bigquery/client/index.d.cts +7 -5
- package/dist/googleCloud/bigquery/client/index.d.mts +7 -5
- package/dist/googleCloud/bigquery/client/index.mjs +5 -3
- 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 +12 -3
- package/dist/googleCloud/bigquery/server/index.d.cts +7 -5
- package/dist/googleCloud/bigquery/server/index.d.mts +7 -5
- package/dist/googleCloud/bigquery/server/index.mjs +5 -3
- package/dist/googleCloud/drive/server/GoogleCloudDrive.d.cts +2 -1
- package/dist/googleCloud/drive/server/GoogleCloudDrive.d.mts +2 -1
- package/dist/googleCloud/drive/server/index.mjs +1 -2
- package/dist/googleCloud/server/getGoogleCloudConfig.d.cts +2 -1
- package/dist/googleCloud/server/getGoogleCloudConfig.d.mts +2 -1
- package/dist/googleCloud/server/index.mjs +1 -2
- package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.cts +2 -1
- package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.mts +2 -1
- package/dist/googleCloud/sheets/server/getAssociatedData.d.cts +2 -1
- package/dist/googleCloud/sheets/server/getAssociatedData.d.mts +2 -1
- package/dist/googleCloud/sheets/server/index.mjs +1 -2
- package/dist/googleCloud/storage/server/index.mjs +1 -2
- package/dist/googleSearchIncidents/server/index.mjs +1 -2
- package/dist/greenDomain/server/index.mjs +1 -2
- package/dist/inngest/_shared/index.mjs +1 -2
- package/dist/inngest/client/index.mjs +1 -2
- package/dist/inngest/server/index.mjs +1 -2
- package/dist/lodash/_shared/orderBy.d.cts +2 -1
- package/dist/lodash/_shared/orderBy.d.mts +2 -1
- package/dist/lumar/graphql/server/queries/getCrawls.d.cts +2 -1
- package/dist/lumar/graphql/server/queries/getCrawls.d.mts +2 -1
- package/dist/lumar/graphql/server/queries/getReportDifferences.d.cts +2 -1
- package/dist/lumar/graphql/server/queries/getReportDifferences.d.mts +2 -1
- package/dist/lumar/graphql/server/queries/getRows.d.cts +2 -1
- package/dist/lumar/graphql/server/queries/getRows.d.mts +2 -1
- package/dist/lumar/graphql/server/queries/getTotals.d.cts +2 -1
- package/dist/lumar/graphql/server/queries/getTotals.d.mts +2 -1
- package/dist/lumar/graphql/server/queries/row.d.cts +2 -1
- package/dist/lumar/graphql/server/queries/row.d.mts +2 -1
- package/dist/myTarget/server/index.mjs +1 -2
- package/dist/number/_shared/getSafeDivide.d.cts +2 -1
- package/dist/number/_shared/getSafeDivide.d.mts +2 -1
- package/dist/object/_shared/index.mjs +1 -2
- package/dist/object/client/index.mjs +1 -2
- package/dist/object/server/index.mjs +1 -2
- package/dist/openAi/server/index.mjs +1 -2
- package/dist/prisma/_shared/index.mjs +1 -2
- package/dist/prisma/client/index.mjs +1 -2
- package/dist/react/client/LazyLoad.d.cts +2 -1
- package/dist/react/client/LazyLoad.d.mts +2 -1
- package/dist/react/client/cn.d.cts +2 -1
- package/dist/react/client/cn.d.mts +2 -1
- package/dist/regex/_shared/index.mjs +1 -2
- package/dist/regex/client/index.mjs +1 -2
- package/dist/regex/server/index.mjs +1 -2
- package/dist/snapchat/server/Snapchat.d.cts +2 -1
- package/dist/snapchat/server/Snapchat.d.mts +2 -1
- package/dist/snapchat/server/index.mjs +1 -2
- package/dist/stream/server/sort.d.cts +2 -1
- package/dist/stream/server/sort.d.mts +2 -1
- package/dist/string/_shared/getClean.d.cts +2 -1
- package/dist/string/_shared/getClean.d.mts +2 -1
- package/dist/string/_shared/getProperCase.d.cts +2 -1
- package/dist/string/_shared/getProperCase.d.mts +2 -1
- package/dist/swr/client/index.mjs +1 -2
- package/dist/upTimeRobot/server/UpTimeRobot.d.cts +2 -1
- package/dist/upTimeRobot/server/UpTimeRobot.d.mts +2 -1
- package/dist/url/_shared/getClean.d.cts +2 -1
- package/dist/url/_shared/getClean.d.mts +2 -1
- package/dist/webWorker/_shared/index.mjs +1 -2
- package/dist/webWorker/client/index.mjs +1 -2
- package/dist/webWorker/server/index.mjs +1 -2
- package/dist/xml/server/index.mjs +1 -2
- package/package.json +44 -32
|
@@ -8,16 +8,18 @@ const require_googleCloud_bigquery__shared_field_bqFieldType = require("./field/
|
|
|
8
8
|
const require_googleCloud_bigquery__shared_field_bqFloat = require("./field/bqFloat.cjs");
|
|
9
9
|
const require_googleCloud_bigquery__shared_field_bqInt = require("./field/bqInt.cjs");
|
|
10
10
|
const require_googleCloud_bigquery__shared_field_bqInt64 = require("./field/bqInt64.cjs");
|
|
11
|
+
const require_googleCloud_bigquery__shared_field_bqJson = require("./field/bqJson.cjs");
|
|
11
12
|
const require_googleCloud_bigquery__shared_field_bqNumeric = require("./field/bqNumeric.cjs");
|
|
12
13
|
const require_googleCloud_bigquery__shared_field_bqString = require("./field/bqString.cjs");
|
|
13
14
|
const require_googleCloud_bigquery__shared_field_bqTime = require("./field/bqTime.cjs");
|
|
14
15
|
const require_googleCloud_bigquery__shared_field_bqTimestamp = require("./field/bqTimestamp.cjs");
|
|
16
|
+
const require_googleCloud_bigquery__shared_zodToBQDefinition = require("./zodToBQDefinition.cjs");
|
|
17
|
+
const require_googleCloud_bigquery__shared_lookup_account = require("./lookup/account.cjs");
|
|
18
|
+
const require_googleCloud_bigquery__shared_lookup_accountPlatform = require("./lookup/accountPlatform.cjs");
|
|
15
19
|
const require_googleCloud_bigquery__shared_lookup_country = require("./lookup/country.cjs");
|
|
16
|
-
const require_googleCloud_bigquery__shared_lookup_googleAdsAccount = require("./lookup/googleAdsAccount.cjs");
|
|
17
20
|
const require_googleCloud_bigquery__shared_lookup_googleCloud = require("./lookup/googleCloud.cjs");
|
|
18
21
|
const require_googleCloud_bigquery__shared_lookup_language = require("./lookup/language.cjs");
|
|
19
22
|
const require_googleCloud_bigquery__shared_partitionType = require("./partitionType.cjs");
|
|
20
|
-
const require_googleCloud_bigquery__shared_zodToBQDefinition = require("./zodToBQDefinition.cjs");
|
|
21
23
|
exports.BQBool = require_googleCloud_bigquery__shared_field_bqBool.BQBool;
|
|
22
24
|
exports.BQBytes = require_googleCloud_bigquery__shared_field_bqBytes.BQBytes;
|
|
23
25
|
exports.BQDate = require_googleCloud_bigquery__shared_field_bqDate.BQDate;
|
|
@@ -27,23 +29,30 @@ exports.BQFieldModeSchema = require_googleCloud_bigquery__shared_field_bqFieldMo
|
|
|
27
29
|
exports.BQFieldType = require_googleCloud_bigquery__shared_field_bqFieldType.BQFieldType;
|
|
28
30
|
exports.BQFieldTypeSchema = require_googleCloud_bigquery__shared_field_bqFieldType.BQFieldTypeSchema;
|
|
29
31
|
exports.BQInt64 = require_googleCloud_bigquery__shared_field_bqInt64.BQInt64;
|
|
32
|
+
exports.BQJson = require_googleCloud_bigquery__shared_field_bqJson.BQJson;
|
|
30
33
|
exports.BQNumeric = require_googleCloud_bigquery__shared_field_bqNumeric.BQNumeric;
|
|
31
34
|
exports.BQString = require_googleCloud_bigquery__shared_field_bqString.BQString;
|
|
32
35
|
exports.BQTime = require_googleCloud_bigquery__shared_field_bqTime.BQTime;
|
|
33
36
|
exports.BQTimestamp = require_googleCloud_bigquery__shared_field_bqTimestamp.BQTimestamp;
|
|
37
|
+
exports.accountBQRow = require_googleCloud_bigquery__shared_lookup_account.accountBQRow;
|
|
38
|
+
exports.accountDefinition = require_googleCloud_bigquery__shared_lookup_account.accountDefinition;
|
|
39
|
+
exports.accountPlatform = require_googleCloud_bigquery__shared_lookup_accountPlatform.accountPlatform;
|
|
40
|
+
exports.accountPlatformSchema = require_googleCloud_bigquery__shared_lookup_accountPlatform.accountPlatformSchema;
|
|
41
|
+
exports.accountTableId = require_googleCloud_bigquery__shared_lookup_account.accountTableId;
|
|
34
42
|
exports.countryBQRow = require_googleCloud_bigquery__shared_lookup_country.countryBQRow;
|
|
35
43
|
exports.decodeBQDate = require_googleCloud_bigquery__shared_field_bqDate.decodeBQDate;
|
|
36
44
|
exports.decodeBQDateTime = require_googleCloud_bigquery__shared_field_bqDateTime.decodeBQDateTime;
|
|
37
45
|
exports.encodeBQDate = require_googleCloud_bigquery__shared_field_bqDate.encodeBQDate;
|
|
38
46
|
exports.encodeBQDateTime = require_googleCloud_bigquery__shared_field_bqDateTime.encodeBQDateTime;
|
|
39
|
-
exports.googleAdsAccountBQRow = require_googleCloud_bigquery__shared_lookup_googleAdsAccount.googleAdsAccountBQRow;
|
|
40
47
|
exports.googleCloudBQRow = require_googleCloud_bigquery__shared_lookup_googleCloud.googleCloudBQRow;
|
|
41
48
|
exports.languageBQRow = require_googleCloud_bigquery__shared_lookup_language.languageBQRow;
|
|
42
49
|
exports.partitionType = require_googleCloud_bigquery__shared_partitionType.partitionType;
|
|
50
|
+
exports.toBQApiSchema = require_googleCloud_bigquery__shared_zodToBQDefinition.toBQApiSchema;
|
|
43
51
|
exports.zBQBytes = require_googleCloud_bigquery__shared_field_bqBytes.zBQBytes;
|
|
44
52
|
exports.zBQFloat = require_googleCloud_bigquery__shared_field_bqFloat.zBQFloat;
|
|
45
53
|
exports.zBQInt = require_googleCloud_bigquery__shared_field_bqInt.zBQInt;
|
|
46
54
|
exports.zBQInt64 = require_googleCloud_bigquery__shared_field_bqInt64.zBQInt64;
|
|
55
|
+
exports.zBQJson = require_googleCloud_bigquery__shared_field_bqJson.zBQJson;
|
|
47
56
|
exports.zBQNumeric = require_googleCloud_bigquery__shared_field_bqNumeric.zBQNumeric;
|
|
48
57
|
exports.zBQTime = require_googleCloud_bigquery__shared_field_bqTime.zBQTime;
|
|
49
58
|
exports.zLuxonDate = require_googleCloud_bigquery__shared_field_bqDate.zLuxonDate;
|
|
@@ -7,15 +7,17 @@ import { BQFieldType, BQFieldTypeSchema } from "./field/bqFieldType.cjs";
|
|
|
7
7
|
import { zBQFloat } from "./field/bqFloat.cjs";
|
|
8
8
|
import { zBQInt } from "./field/bqInt.cjs";
|
|
9
9
|
import { BQInt64, zBQInt64 } from "./field/bqInt64.cjs";
|
|
10
|
+
import { BQJson, zBQJson } from "./field/bqJson.cjs";
|
|
10
11
|
import { BQNumeric, zBQNumeric } from "./field/bqNumeric.cjs";
|
|
11
12
|
import { BQString } from "./field/bqString.cjs";
|
|
12
13
|
import { BQTime, zBQTime } from "./field/bqTime.cjs";
|
|
13
14
|
import { BQTimestamp } from "./field/bqTimestamp.cjs";
|
|
15
|
+
import { PartitionType, partitionType } from "./partitionType.cjs";
|
|
16
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "./zodToBQDefinition.cjs";
|
|
17
|
+
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "./types.cjs";
|
|
18
|
+
import { AccountBQRow, accountBQRow, accountDefinition, accountTableId } from "./lookup/account.cjs";
|
|
19
|
+
import { AccountPlatform, accountPlatform, accountPlatformSchema } from "./lookup/accountPlatform.cjs";
|
|
14
20
|
import { CountryBQRow, countryBQRow } from "./lookup/country.cjs";
|
|
15
|
-
import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "./lookup/googleAdsAccount.cjs";
|
|
16
21
|
import { GoogleCloudBQRow, googleCloudBQRow } from "./lookup/googleCloud.cjs";
|
|
17
22
|
import { LanguageBQRow, languageBQRow } from "./lookup/language.cjs";
|
|
18
|
-
|
|
19
|
-
import { BQField, zodToBQSchema } from "./zodToBQDefinition.cjs";
|
|
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 };
|
|
23
|
+
export { AccountBQRow, AccountPlatform, BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQJson, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, accountBQRow, accountDefinition, accountPlatform, accountPlatformSchema, accountTableId, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQJson, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -7,15 +7,17 @@ import { BQFieldType, BQFieldTypeSchema } from "./field/bqFieldType.mjs";
|
|
|
7
7
|
import { zBQFloat } from "./field/bqFloat.mjs";
|
|
8
8
|
import { zBQInt } from "./field/bqInt.mjs";
|
|
9
9
|
import { BQInt64, zBQInt64 } from "./field/bqInt64.mjs";
|
|
10
|
+
import { BQJson, zBQJson } from "./field/bqJson.mjs";
|
|
10
11
|
import { BQNumeric, zBQNumeric } from "./field/bqNumeric.mjs";
|
|
11
12
|
import { BQString } from "./field/bqString.mjs";
|
|
12
13
|
import { BQTime, zBQTime } from "./field/bqTime.mjs";
|
|
13
14
|
import { BQTimestamp } from "./field/bqTimestamp.mjs";
|
|
15
|
+
import { PartitionType, partitionType } from "./partitionType.mjs";
|
|
16
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "./zodToBQDefinition.mjs";
|
|
17
|
+
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "./types.mjs";
|
|
18
|
+
import { AccountBQRow, accountBQRow, accountDefinition, accountTableId } from "./lookup/account.mjs";
|
|
19
|
+
import { AccountPlatform, accountPlatform, accountPlatformSchema } from "./lookup/accountPlatform.mjs";
|
|
14
20
|
import { CountryBQRow, countryBQRow } from "./lookup/country.mjs";
|
|
15
|
-
import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "./lookup/googleAdsAccount.mjs";
|
|
16
21
|
import { GoogleCloudBQRow, googleCloudBQRow } from "./lookup/googleCloud.mjs";
|
|
17
22
|
import { LanguageBQRow, languageBQRow } from "./lookup/language.mjs";
|
|
18
|
-
|
|
19
|
-
import { BQField, zodToBQSchema } from "./zodToBQDefinition.mjs";
|
|
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 };
|
|
23
|
+
export { AccountBQRow, AccountPlatform, BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQJson, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, accountBQRow, accountDefinition, accountPlatform, accountPlatformSchema, accountTableId, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQJson, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -7,14 +7,16 @@ import { BQFieldType, BQFieldTypeSchema } from "./field/bqFieldType.mjs";
|
|
|
7
7
|
import { zBQFloat } from "./field/bqFloat.mjs";
|
|
8
8
|
import { zBQInt } from "./field/bqInt.mjs";
|
|
9
9
|
import { BQInt64, zBQInt64 } from "./field/bqInt64.mjs";
|
|
10
|
+
import { BQJson, zBQJson } from "./field/bqJson.mjs";
|
|
10
11
|
import { BQNumeric, zBQNumeric } from "./field/bqNumeric.mjs";
|
|
11
12
|
import { BQString } from "./field/bqString.mjs";
|
|
12
13
|
import { BQTime, zBQTime } from "./field/bqTime.mjs";
|
|
13
14
|
import { BQTimestamp } from "./field/bqTimestamp.mjs";
|
|
15
|
+
import { toBQApiSchema, zodToBQSchema } from "./zodToBQDefinition.mjs";
|
|
16
|
+
import { accountBQRow, accountDefinition, accountTableId } from "./lookup/account.mjs";
|
|
17
|
+
import { accountPlatform, accountPlatformSchema } from "./lookup/accountPlatform.mjs";
|
|
14
18
|
import { countryBQRow } from "./lookup/country.mjs";
|
|
15
|
-
import { googleAdsAccountBQRow } from "./lookup/googleAdsAccount.mjs";
|
|
16
19
|
import { googleCloudBQRow } from "./lookup/googleCloud.mjs";
|
|
17
20
|
import { languageBQRow } from "./lookup/language.mjs";
|
|
18
21
|
import { partitionType } from "./partitionType.mjs";
|
|
19
|
-
|
|
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 };
|
|
22
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQJson, BQNumeric, BQString, BQTime, BQTimestamp, accountBQRow, accountDefinition, accountPlatform, accountPlatformSchema, accountTableId, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQJson, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_googleCloud_bigquery__shared_field_bqJson = require("../field/bqJson.cjs");
|
|
3
|
+
const require_googleCloud_bigquery__shared_zodToBQDefinition = require("../zodToBQDefinition.cjs");
|
|
4
|
+
let zod = require("zod");
|
|
5
|
+
//#region src/googleCloud/bigquery/_shared/lookup/account.ts
|
|
6
|
+
/**
|
|
7
|
+
* ems-shared.look.account
|
|
8
|
+
*
|
|
9
|
+
* Maps every platform account to a website. The same account_id can appear against several
|
|
10
|
+
* websites. platform is a plain STRING in BigQuery (see accountPlatform for the known values).
|
|
11
|
+
* account_includes and account_excludes hold per-account matching rules (for example exclusion
|
|
12
|
+
* regexes) and are deliberately free-form JSON.
|
|
13
|
+
*/
|
|
14
|
+
const accountBQRow = zod.z.object({
|
|
15
|
+
id: zod.z.string(),
|
|
16
|
+
account_group: zod.z.string().nullable(),
|
|
17
|
+
platform: zod.z.string(),
|
|
18
|
+
account_name: zod.z.string(),
|
|
19
|
+
account_id: zod.z.string(),
|
|
20
|
+
account_includes: require_googleCloud_bigquery__shared_field_bqJson.zBQJson.nullable(),
|
|
21
|
+
account_excludes: require_googleCloud_bigquery__shared_field_bqJson.zBQJson.nullable(),
|
|
22
|
+
currency: zod.z.string().nullable(),
|
|
23
|
+
is_all_conversions: zod.z.boolean(),
|
|
24
|
+
is_active: zod.z.boolean(),
|
|
25
|
+
is_mdo: zod.z.boolean(),
|
|
26
|
+
codex_website_id: zod.z.string(),
|
|
27
|
+
inserted_at: zod.z.date(),
|
|
28
|
+
updated_at: zod.z.date()
|
|
29
|
+
});
|
|
30
|
+
const accountField = accountBQRow.keyof().enum;
|
|
31
|
+
const accountDefinition = {
|
|
32
|
+
projectId: "ems-shared",
|
|
33
|
+
datasetId: "look",
|
|
34
|
+
tableId: "account",
|
|
35
|
+
options: {
|
|
36
|
+
schema: require_googleCloud_bigquery__shared_zodToBQDefinition.zodToBQSchema(accountBQRow),
|
|
37
|
+
clustering: { fields: [accountField.codex_website_id, accountField.platform] }
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const accountTableId = `${accountDefinition.projectId}.${accountDefinition.datasetId}.${accountDefinition.tableId}`;
|
|
41
|
+
//#endregion
|
|
42
|
+
exports.accountBQRow = accountBQRow;
|
|
43
|
+
exports.accountDefinition = accountDefinition;
|
|
44
|
+
exports.accountTableId = accountTableId;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TableDefinition } from "../types.cjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/googleCloud/bigquery/_shared/lookup/account.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* ems-shared.look.account
|
|
6
|
+
*
|
|
7
|
+
* Maps every platform account to a website. The same account_id can appear against several
|
|
8
|
+
* websites. platform is a plain STRING in BigQuery (see accountPlatform for the known values).
|
|
9
|
+
* account_includes and account_excludes hold per-account matching rules (for example exclusion
|
|
10
|
+
* regexes) and are deliberately free-form JSON.
|
|
11
|
+
*/
|
|
12
|
+
export declare const accountBQRow: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
account_group: z.ZodNullable<z.ZodString>;
|
|
15
|
+
platform: z.ZodString;
|
|
16
|
+
account_name: z.ZodString;
|
|
17
|
+
account_id: z.ZodString;
|
|
18
|
+
account_includes: z.ZodNullable<z.ZodUnknown>;
|
|
19
|
+
account_excludes: z.ZodNullable<z.ZodUnknown>;
|
|
20
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
21
|
+
is_all_conversions: z.ZodBoolean;
|
|
22
|
+
is_active: z.ZodBoolean;
|
|
23
|
+
is_mdo: z.ZodBoolean;
|
|
24
|
+
codex_website_id: z.ZodString;
|
|
25
|
+
inserted_at: z.ZodDate;
|
|
26
|
+
updated_at: z.ZodDate;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type AccountBQRow = z.infer<typeof accountBQRow>;
|
|
29
|
+
export declare const accountDefinition: TableDefinition;
|
|
30
|
+
export declare const accountTableId: string;
|
|
31
|
+
//#endregion
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TableDefinition } from "../types.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/googleCloud/bigquery/_shared/lookup/account.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* ems-shared.look.account
|
|
6
|
+
*
|
|
7
|
+
* Maps every platform account to a website. The same account_id can appear against several
|
|
8
|
+
* websites. platform is a plain STRING in BigQuery (see accountPlatform for the known values).
|
|
9
|
+
* account_includes and account_excludes hold per-account matching rules (for example exclusion
|
|
10
|
+
* regexes) and are deliberately free-form JSON.
|
|
11
|
+
*/
|
|
12
|
+
export declare const accountBQRow: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
account_group: z.ZodNullable<z.ZodString>;
|
|
15
|
+
platform: z.ZodString;
|
|
16
|
+
account_name: z.ZodString;
|
|
17
|
+
account_id: z.ZodString;
|
|
18
|
+
account_includes: z.ZodNullable<z.ZodUnknown>;
|
|
19
|
+
account_excludes: z.ZodNullable<z.ZodUnknown>;
|
|
20
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
21
|
+
is_all_conversions: z.ZodBoolean;
|
|
22
|
+
is_active: z.ZodBoolean;
|
|
23
|
+
is_mdo: z.ZodBoolean;
|
|
24
|
+
codex_website_id: z.ZodString;
|
|
25
|
+
inserted_at: z.ZodDate;
|
|
26
|
+
updated_at: z.ZodDate;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type AccountBQRow = z.infer<typeof accountBQRow>;
|
|
29
|
+
export declare const accountDefinition: TableDefinition;
|
|
30
|
+
export declare const accountTableId: string;
|
|
31
|
+
//#endregion
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { zBQJson } from "../field/bqJson.mjs";
|
|
2
|
+
import { zodToBQSchema } from "../zodToBQDefinition.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/googleCloud/bigquery/_shared/lookup/account.ts
|
|
5
|
+
/**
|
|
6
|
+
* ems-shared.look.account
|
|
7
|
+
*
|
|
8
|
+
* Maps every platform account to a website. The same account_id can appear against several
|
|
9
|
+
* websites. platform is a plain STRING in BigQuery (see accountPlatform for the known values).
|
|
10
|
+
* account_includes and account_excludes hold per-account matching rules (for example exclusion
|
|
11
|
+
* regexes) and are deliberately free-form JSON.
|
|
12
|
+
*/
|
|
13
|
+
const accountBQRow = z.object({
|
|
14
|
+
id: z.string(),
|
|
15
|
+
account_group: z.string().nullable(),
|
|
16
|
+
platform: z.string(),
|
|
17
|
+
account_name: z.string(),
|
|
18
|
+
account_id: z.string(),
|
|
19
|
+
account_includes: zBQJson.nullable(),
|
|
20
|
+
account_excludes: zBQJson.nullable(),
|
|
21
|
+
currency: z.string().nullable(),
|
|
22
|
+
is_all_conversions: z.boolean(),
|
|
23
|
+
is_active: z.boolean(),
|
|
24
|
+
is_mdo: z.boolean(),
|
|
25
|
+
codex_website_id: z.string(),
|
|
26
|
+
inserted_at: z.date(),
|
|
27
|
+
updated_at: z.date()
|
|
28
|
+
});
|
|
29
|
+
const accountField = accountBQRow.keyof().enum;
|
|
30
|
+
const accountDefinition = {
|
|
31
|
+
projectId: "ems-shared",
|
|
32
|
+
datasetId: "look",
|
|
33
|
+
tableId: "account",
|
|
34
|
+
options: {
|
|
35
|
+
schema: zodToBQSchema(accountBQRow),
|
|
36
|
+
clustering: { fields: [accountField.codex_website_id, accountField.platform] }
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const accountTableId = `${accountDefinition.projectId}.${accountDefinition.datasetId}.${accountDefinition.tableId}`;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { accountBQRow, accountDefinition, accountTableId };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/googleCloud/bigquery/_shared/lookup/accountPlatform.ts
|
|
4
|
+
const accountPlatform = {
|
|
5
|
+
ADOBE_ANALYTICS: "ADOBE_ANALYTICS",
|
|
6
|
+
GOOGLE_ADS: "GOOGLE_ADS",
|
|
7
|
+
GOOGLE_ANALYTICS: "GOOGLE_ANALYTICS",
|
|
8
|
+
GOOGLE_SEARCH_CONSOLE: "GOOGLE_SEARCH_CONSOLE",
|
|
9
|
+
LINKEDIN_ADS: "LINKEDIN_ADS",
|
|
10
|
+
META_ADS: "META_ADS",
|
|
11
|
+
MICROSOFT_ADS: "MICROSOFT_ADS",
|
|
12
|
+
MICROSOFT_WEBMASTER_TOOLS: "MICROSOFT_WEBMASTER_TOOLS",
|
|
13
|
+
REDDIT_ADS: "REDDIT_ADS",
|
|
14
|
+
TIKTOK_ADS: "TIKTOK_ADS"
|
|
15
|
+
};
|
|
16
|
+
const accountPlatformSchema = zod.z.enum(accountPlatform);
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.accountPlatform = accountPlatform;
|
|
19
|
+
exports.accountPlatformSchema = accountPlatformSchema;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/googleCloud/bigquery/_shared/lookup/accountPlatform.d.ts
|
|
3
|
+
export declare const accountPlatform: {
|
|
4
|
+
readonly ADOBE_ANALYTICS: "ADOBE_ANALYTICS";
|
|
5
|
+
readonly GOOGLE_ADS: "GOOGLE_ADS";
|
|
6
|
+
readonly GOOGLE_ANALYTICS: "GOOGLE_ANALYTICS";
|
|
7
|
+
readonly GOOGLE_SEARCH_CONSOLE: "GOOGLE_SEARCH_CONSOLE";
|
|
8
|
+
readonly LINKEDIN_ADS: "LINKEDIN_ADS";
|
|
9
|
+
readonly META_ADS: "META_ADS";
|
|
10
|
+
readonly MICROSOFT_ADS: "MICROSOFT_ADS";
|
|
11
|
+
readonly MICROSOFT_WEBMASTER_TOOLS: "MICROSOFT_WEBMASTER_TOOLS";
|
|
12
|
+
readonly REDDIT_ADS: "REDDIT_ADS";
|
|
13
|
+
readonly TIKTOK_ADS: "TIKTOK_ADS";
|
|
14
|
+
};
|
|
15
|
+
export type AccountPlatform = typeof accountPlatform[keyof typeof accountPlatform];
|
|
16
|
+
export declare const accountPlatformSchema: z.ZodEnum<{
|
|
17
|
+
readonly ADOBE_ANALYTICS: "ADOBE_ANALYTICS";
|
|
18
|
+
readonly GOOGLE_ADS: "GOOGLE_ADS";
|
|
19
|
+
readonly GOOGLE_ANALYTICS: "GOOGLE_ANALYTICS";
|
|
20
|
+
readonly GOOGLE_SEARCH_CONSOLE: "GOOGLE_SEARCH_CONSOLE";
|
|
21
|
+
readonly LINKEDIN_ADS: "LINKEDIN_ADS";
|
|
22
|
+
readonly META_ADS: "META_ADS";
|
|
23
|
+
readonly MICROSOFT_ADS: "MICROSOFT_ADS";
|
|
24
|
+
readonly MICROSOFT_WEBMASTER_TOOLS: "MICROSOFT_WEBMASTER_TOOLS";
|
|
25
|
+
readonly REDDIT_ADS: "REDDIT_ADS";
|
|
26
|
+
readonly TIKTOK_ADS: "TIKTOK_ADS";
|
|
27
|
+
}>;
|
|
28
|
+
//#endregion
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/googleCloud/bigquery/_shared/lookup/accountPlatform.d.ts
|
|
3
|
+
export declare const accountPlatform: {
|
|
4
|
+
readonly ADOBE_ANALYTICS: "ADOBE_ANALYTICS";
|
|
5
|
+
readonly GOOGLE_ADS: "GOOGLE_ADS";
|
|
6
|
+
readonly GOOGLE_ANALYTICS: "GOOGLE_ANALYTICS";
|
|
7
|
+
readonly GOOGLE_SEARCH_CONSOLE: "GOOGLE_SEARCH_CONSOLE";
|
|
8
|
+
readonly LINKEDIN_ADS: "LINKEDIN_ADS";
|
|
9
|
+
readonly META_ADS: "META_ADS";
|
|
10
|
+
readonly MICROSOFT_ADS: "MICROSOFT_ADS";
|
|
11
|
+
readonly MICROSOFT_WEBMASTER_TOOLS: "MICROSOFT_WEBMASTER_TOOLS";
|
|
12
|
+
readonly REDDIT_ADS: "REDDIT_ADS";
|
|
13
|
+
readonly TIKTOK_ADS: "TIKTOK_ADS";
|
|
14
|
+
};
|
|
15
|
+
export type AccountPlatform = typeof accountPlatform[keyof typeof accountPlatform];
|
|
16
|
+
export declare const accountPlatformSchema: z.ZodEnum<{
|
|
17
|
+
readonly ADOBE_ANALYTICS: "ADOBE_ANALYTICS";
|
|
18
|
+
readonly GOOGLE_ADS: "GOOGLE_ADS";
|
|
19
|
+
readonly GOOGLE_ANALYTICS: "GOOGLE_ANALYTICS";
|
|
20
|
+
readonly GOOGLE_SEARCH_CONSOLE: "GOOGLE_SEARCH_CONSOLE";
|
|
21
|
+
readonly LINKEDIN_ADS: "LINKEDIN_ADS";
|
|
22
|
+
readonly META_ADS: "META_ADS";
|
|
23
|
+
readonly MICROSOFT_ADS: "MICROSOFT_ADS";
|
|
24
|
+
readonly MICROSOFT_WEBMASTER_TOOLS: "MICROSOFT_WEBMASTER_TOOLS";
|
|
25
|
+
readonly REDDIT_ADS: "REDDIT_ADS";
|
|
26
|
+
readonly TIKTOK_ADS: "TIKTOK_ADS";
|
|
27
|
+
}>;
|
|
28
|
+
//#endregion
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/googleCloud/bigquery/_shared/lookup/accountPlatform.ts
|
|
3
|
+
const accountPlatform = {
|
|
4
|
+
ADOBE_ANALYTICS: "ADOBE_ANALYTICS",
|
|
5
|
+
GOOGLE_ADS: "GOOGLE_ADS",
|
|
6
|
+
GOOGLE_ANALYTICS: "GOOGLE_ANALYTICS",
|
|
7
|
+
GOOGLE_SEARCH_CONSOLE: "GOOGLE_SEARCH_CONSOLE",
|
|
8
|
+
LINKEDIN_ADS: "LINKEDIN_ADS",
|
|
9
|
+
META_ADS: "META_ADS",
|
|
10
|
+
MICROSOFT_ADS: "MICROSOFT_ADS",
|
|
11
|
+
MICROSOFT_WEBMASTER_TOOLS: "MICROSOFT_WEBMASTER_TOOLS",
|
|
12
|
+
REDDIT_ADS: "REDDIT_ADS",
|
|
13
|
+
TIKTOK_ADS: "TIKTOK_ADS"
|
|
14
|
+
};
|
|
15
|
+
const accountPlatformSchema = z.enum(accountPlatform);
|
|
16
|
+
//#endregion
|
|
17
|
+
export { accountPlatform, accountPlatformSchema };
|
|
@@ -10,6 +10,7 @@ const getBqType = (schema) => {
|
|
|
10
10
|
if ("bq:int64" === schema.description) return "INTEGER";
|
|
11
11
|
if ("bq:time" === schema.description) return "TIME";
|
|
12
12
|
if ("bq:bytes" === schema.description) return "BYTES";
|
|
13
|
+
if ("bq:json" === schema.description) return "JSON";
|
|
13
14
|
if (schema instanceof zod.z.ZodString || schema instanceof zod.z.ZodEnum) return "STRING";
|
|
14
15
|
if (schema instanceof zod.z.ZodBoolean) return "BOOLEAN";
|
|
15
16
|
if (schema instanceof zod.z.ZodDate) return "TIMESTAMP";
|
|
@@ -57,5 +58,18 @@ const zodToBQSchema = (schema) => {
|
|
|
57
58
|
return buildBQField(name, fieldSchema);
|
|
58
59
|
});
|
|
59
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Maps BQField (which names nested columns subFields) to the shape the BigQuery API expects,
|
|
63
|
+
* where nested columns are called fields. Apply at the API boundary only.
|
|
64
|
+
*/
|
|
65
|
+
const toBQApiSchema = (fields) => {
|
|
66
|
+
return fields.map(({ subFields, ...field }) => {
|
|
67
|
+
return subFields ? {
|
|
68
|
+
...field,
|
|
69
|
+
fields: toBQApiSchema(subFields)
|
|
70
|
+
} : field;
|
|
71
|
+
});
|
|
72
|
+
};
|
|
60
73
|
//#endregion
|
|
74
|
+
exports.toBQApiSchema = toBQApiSchema;
|
|
61
75
|
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
|
|
@@ -9,6 +9,7 @@ const getBqType = (schema) => {
|
|
|
9
9
|
if ("bq:int64" === schema.description) return "INTEGER";
|
|
10
10
|
if ("bq:time" === schema.description) return "TIME";
|
|
11
11
|
if ("bq:bytes" === schema.description) return "BYTES";
|
|
12
|
+
if ("bq:json" === schema.description) return "JSON";
|
|
12
13
|
if (schema instanceof z.ZodString || schema instanceof z.ZodEnum) return "STRING";
|
|
13
14
|
if (schema instanceof z.ZodBoolean) return "BOOLEAN";
|
|
14
15
|
if (schema instanceof z.ZodDate) return "TIMESTAMP";
|
|
@@ -56,5 +57,17 @@ const zodToBQSchema = (schema) => {
|
|
|
56
57
|
return buildBQField(name, fieldSchema);
|
|
57
58
|
});
|
|
58
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
|
+
};
|
|
59
72
|
//#endregion
|
|
60
|
-
export { zodToBQSchema };
|
|
73
|
+
export { toBQApiSchema, zodToBQSchema };
|
|
@@ -8,16 +8,18 @@ const require_googleCloud_bigquery__shared_field_bqFieldType = require("../_shar
|
|
|
8
8
|
const require_googleCloud_bigquery__shared_field_bqFloat = require("../_shared/field/bqFloat.cjs");
|
|
9
9
|
const require_googleCloud_bigquery__shared_field_bqInt = require("../_shared/field/bqInt.cjs");
|
|
10
10
|
const require_googleCloud_bigquery__shared_field_bqInt64 = require("../_shared/field/bqInt64.cjs");
|
|
11
|
+
const require_googleCloud_bigquery__shared_field_bqJson = require("../_shared/field/bqJson.cjs");
|
|
11
12
|
const require_googleCloud_bigquery__shared_field_bqNumeric = require("../_shared/field/bqNumeric.cjs");
|
|
12
13
|
const require_googleCloud_bigquery__shared_field_bqString = require("../_shared/field/bqString.cjs");
|
|
13
14
|
const require_googleCloud_bigquery__shared_field_bqTime = require("../_shared/field/bqTime.cjs");
|
|
14
15
|
const require_googleCloud_bigquery__shared_field_bqTimestamp = require("../_shared/field/bqTimestamp.cjs");
|
|
16
|
+
const require_googleCloud_bigquery__shared_zodToBQDefinition = require("../_shared/zodToBQDefinition.cjs");
|
|
17
|
+
const require_googleCloud_bigquery__shared_lookup_account = require("../_shared/lookup/account.cjs");
|
|
18
|
+
const require_googleCloud_bigquery__shared_lookup_accountPlatform = require("../_shared/lookup/accountPlatform.cjs");
|
|
15
19
|
const require_googleCloud_bigquery__shared_lookup_country = require("../_shared/lookup/country.cjs");
|
|
16
|
-
const require_googleCloud_bigquery__shared_lookup_googleAdsAccount = require("../_shared/lookup/googleAdsAccount.cjs");
|
|
17
20
|
const require_googleCloud_bigquery__shared_lookup_googleCloud = require("../_shared/lookup/googleCloud.cjs");
|
|
18
21
|
const require_googleCloud_bigquery__shared_lookup_language = require("../_shared/lookup/language.cjs");
|
|
19
22
|
const require_googleCloud_bigquery__shared_partitionType = require("../_shared/partitionType.cjs");
|
|
20
|
-
const require_googleCloud_bigquery__shared_zodToBQDefinition = require("../_shared/zodToBQDefinition.cjs");
|
|
21
23
|
require("../_shared/index.cjs");
|
|
22
24
|
exports.BQBool = require_googleCloud_bigquery__shared_field_bqBool.BQBool;
|
|
23
25
|
exports.BQBytes = require_googleCloud_bigquery__shared_field_bqBytes.BQBytes;
|
|
@@ -28,23 +30,30 @@ exports.BQFieldModeSchema = require_googleCloud_bigquery__shared_field_bqFieldMo
|
|
|
28
30
|
exports.BQFieldType = require_googleCloud_bigquery__shared_field_bqFieldType.BQFieldType;
|
|
29
31
|
exports.BQFieldTypeSchema = require_googleCloud_bigquery__shared_field_bqFieldType.BQFieldTypeSchema;
|
|
30
32
|
exports.BQInt64 = require_googleCloud_bigquery__shared_field_bqInt64.BQInt64;
|
|
33
|
+
exports.BQJson = require_googleCloud_bigquery__shared_field_bqJson.BQJson;
|
|
31
34
|
exports.BQNumeric = require_googleCloud_bigquery__shared_field_bqNumeric.BQNumeric;
|
|
32
35
|
exports.BQString = require_googleCloud_bigquery__shared_field_bqString.BQString;
|
|
33
36
|
exports.BQTime = require_googleCloud_bigquery__shared_field_bqTime.BQTime;
|
|
34
37
|
exports.BQTimestamp = require_googleCloud_bigquery__shared_field_bqTimestamp.BQTimestamp;
|
|
38
|
+
exports.accountBQRow = require_googleCloud_bigquery__shared_lookup_account.accountBQRow;
|
|
39
|
+
exports.accountDefinition = require_googleCloud_bigquery__shared_lookup_account.accountDefinition;
|
|
40
|
+
exports.accountPlatform = require_googleCloud_bigquery__shared_lookup_accountPlatform.accountPlatform;
|
|
41
|
+
exports.accountPlatformSchema = require_googleCloud_bigquery__shared_lookup_accountPlatform.accountPlatformSchema;
|
|
42
|
+
exports.accountTableId = require_googleCloud_bigquery__shared_lookup_account.accountTableId;
|
|
35
43
|
exports.countryBQRow = require_googleCloud_bigquery__shared_lookup_country.countryBQRow;
|
|
36
44
|
exports.decodeBQDate = require_googleCloud_bigquery__shared_field_bqDate.decodeBQDate;
|
|
37
45
|
exports.decodeBQDateTime = require_googleCloud_bigquery__shared_field_bqDateTime.decodeBQDateTime;
|
|
38
46
|
exports.encodeBQDate = require_googleCloud_bigquery__shared_field_bqDate.encodeBQDate;
|
|
39
47
|
exports.encodeBQDateTime = require_googleCloud_bigquery__shared_field_bqDateTime.encodeBQDateTime;
|
|
40
|
-
exports.googleAdsAccountBQRow = require_googleCloud_bigquery__shared_lookup_googleAdsAccount.googleAdsAccountBQRow;
|
|
41
48
|
exports.googleCloudBQRow = require_googleCloud_bigquery__shared_lookup_googleCloud.googleCloudBQRow;
|
|
42
49
|
exports.languageBQRow = require_googleCloud_bigquery__shared_lookup_language.languageBQRow;
|
|
43
50
|
exports.partitionType = require_googleCloud_bigquery__shared_partitionType.partitionType;
|
|
51
|
+
exports.toBQApiSchema = require_googleCloud_bigquery__shared_zodToBQDefinition.toBQApiSchema;
|
|
44
52
|
exports.zBQBytes = require_googleCloud_bigquery__shared_field_bqBytes.zBQBytes;
|
|
45
53
|
exports.zBQFloat = require_googleCloud_bigquery__shared_field_bqFloat.zBQFloat;
|
|
46
54
|
exports.zBQInt = require_googleCloud_bigquery__shared_field_bqInt.zBQInt;
|
|
47
55
|
exports.zBQInt64 = require_googleCloud_bigquery__shared_field_bqInt64.zBQInt64;
|
|
56
|
+
exports.zBQJson = require_googleCloud_bigquery__shared_field_bqJson.zBQJson;
|
|
48
57
|
exports.zBQNumeric = require_googleCloud_bigquery__shared_field_bqNumeric.zBQNumeric;
|
|
49
58
|
exports.zBQTime = require_googleCloud_bigquery__shared_field_bqTime.zBQTime;
|
|
50
59
|
exports.zLuxonDate = require_googleCloud_bigquery__shared_field_bqDate.zLuxonDate;
|
|
@@ -7,16 +7,18 @@ import { BQFieldType, BQFieldTypeSchema } from "../_shared/field/bqFieldType.cjs
|
|
|
7
7
|
import { zBQFloat } from "../_shared/field/bqFloat.cjs";
|
|
8
8
|
import { zBQInt } from "../_shared/field/bqInt.cjs";
|
|
9
9
|
import { BQInt64, zBQInt64 } from "../_shared/field/bqInt64.cjs";
|
|
10
|
+
import { BQJson, zBQJson } from "../_shared/field/bqJson.cjs";
|
|
10
11
|
import { BQNumeric, zBQNumeric } from "../_shared/field/bqNumeric.cjs";
|
|
11
12
|
import { BQString } from "../_shared/field/bqString.cjs";
|
|
12
13
|
import { BQTime, zBQTime } from "../_shared/field/bqTime.cjs";
|
|
13
14
|
import { BQTimestamp } from "../_shared/field/bqTimestamp.cjs";
|
|
15
|
+
import { PartitionType, partitionType } from "../_shared/partitionType.cjs";
|
|
16
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.cjs";
|
|
17
|
+
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "../_shared/types.cjs";
|
|
18
|
+
import { AccountBQRow, accountBQRow, accountDefinition, accountTableId } from "../_shared/lookup/account.cjs";
|
|
19
|
+
import { AccountPlatform, accountPlatform, accountPlatformSchema } from "../_shared/lookup/accountPlatform.cjs";
|
|
14
20
|
import { CountryBQRow, countryBQRow } from "../_shared/lookup/country.cjs";
|
|
15
|
-
import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "../_shared/lookup/googleAdsAccount.cjs";
|
|
16
21
|
import { GoogleCloudBQRow, googleCloudBQRow } from "../_shared/lookup/googleCloud.cjs";
|
|
17
22
|
import { LanguageBQRow, languageBQRow } from "../_shared/lookup/language.cjs";
|
|
18
|
-
import { PartitionType, partitionType } from "../_shared/partitionType.cjs";
|
|
19
|
-
import { BQField, zodToBQSchema } from "../_shared/zodToBQDefinition.cjs";
|
|
20
|
-
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "../_shared/types.cjs";
|
|
21
23
|
import "../_shared/index.cjs";
|
|
22
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset,
|
|
24
|
+
export { AccountBQRow, AccountPlatform, BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQJson, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, accountBQRow, accountDefinition, accountPlatform, accountPlatformSchema, accountTableId, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQJson, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -7,16 +7,18 @@ import { BQFieldType, BQFieldTypeSchema } from "../_shared/field/bqFieldType.mjs
|
|
|
7
7
|
import { zBQFloat } from "../_shared/field/bqFloat.mjs";
|
|
8
8
|
import { zBQInt } from "../_shared/field/bqInt.mjs";
|
|
9
9
|
import { BQInt64, zBQInt64 } from "../_shared/field/bqInt64.mjs";
|
|
10
|
+
import { BQJson, zBQJson } from "../_shared/field/bqJson.mjs";
|
|
10
11
|
import { BQNumeric, zBQNumeric } from "../_shared/field/bqNumeric.mjs";
|
|
11
12
|
import { BQString } from "../_shared/field/bqString.mjs";
|
|
12
13
|
import { BQTime, zBQTime } from "../_shared/field/bqTime.mjs";
|
|
13
14
|
import { BQTimestamp } from "../_shared/field/bqTimestamp.mjs";
|
|
15
|
+
import { PartitionType, partitionType } from "../_shared/partitionType.mjs";
|
|
16
|
+
import { BQField, toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
17
|
+
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "../_shared/types.mjs";
|
|
18
|
+
import { AccountBQRow, accountBQRow, accountDefinition, accountTableId } from "../_shared/lookup/account.mjs";
|
|
19
|
+
import { AccountPlatform, accountPlatform, accountPlatformSchema } from "../_shared/lookup/accountPlatform.mjs";
|
|
14
20
|
import { CountryBQRow, countryBQRow } from "../_shared/lookup/country.mjs";
|
|
15
|
-
import { GoogleAdsAccountBQRow, googleAdsAccountBQRow } from "../_shared/lookup/googleAdsAccount.mjs";
|
|
16
21
|
import { GoogleCloudBQRow, googleCloudBQRow } from "../_shared/lookup/googleCloud.mjs";
|
|
17
22
|
import { LanguageBQRow, languageBQRow } from "../_shared/lookup/language.mjs";
|
|
18
|
-
import { PartitionType, partitionType } from "../_shared/partitionType.mjs";
|
|
19
|
-
import { BQField, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
20
|
-
import { BigqueryLoadFormat, Dataset, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, QueryInput, Table, TableDefinition } from "../_shared/types.mjs";
|
|
21
23
|
import "../_shared/index.mjs";
|
|
22
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset,
|
|
24
|
+
export { AccountBQRow, AccountPlatform, BQBool, BQBytes, BQDate, BQDateTime, BQDatetime, BQField, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQJson, BQNumeric, BQString, BQTime, BQTimestamp, BigqueryLoadFormat, CountryBQRow, Dataset, GoogleCloudBQRow, LanguageBQRow, LoadData, LoadStreamTableProps, LoadTableProps, MergeTableProps, PartitionType, QueryInput, Table, TableDefinition, accountBQRow, accountDefinition, accountPlatform, accountPlatformSchema, accountTableId, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQJson, zBQNumeric, zBQTime, zLuxonDate, zLuxonDateTime, zodToBQSchema };
|
|
@@ -7,15 +7,17 @@ import { BQFieldType, BQFieldTypeSchema } from "../_shared/field/bqFieldType.mjs
|
|
|
7
7
|
import { zBQFloat } from "../_shared/field/bqFloat.mjs";
|
|
8
8
|
import { zBQInt } from "../_shared/field/bqInt.mjs";
|
|
9
9
|
import { BQInt64, zBQInt64 } from "../_shared/field/bqInt64.mjs";
|
|
10
|
+
import { BQJson, zBQJson } from "../_shared/field/bqJson.mjs";
|
|
10
11
|
import { BQNumeric, zBQNumeric } from "../_shared/field/bqNumeric.mjs";
|
|
11
12
|
import { BQString } from "../_shared/field/bqString.mjs";
|
|
12
13
|
import { BQTime, zBQTime } from "../_shared/field/bqTime.mjs";
|
|
13
14
|
import { BQTimestamp } from "../_shared/field/bqTimestamp.mjs";
|
|
15
|
+
import { toBQApiSchema, zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
16
|
+
import { accountBQRow, accountDefinition, accountTableId } from "../_shared/lookup/account.mjs";
|
|
17
|
+
import { accountPlatform, accountPlatformSchema } from "../_shared/lookup/accountPlatform.mjs";
|
|
14
18
|
import { countryBQRow } from "../_shared/lookup/country.mjs";
|
|
15
|
-
import { googleAdsAccountBQRow } from "../_shared/lookup/googleAdsAccount.mjs";
|
|
16
19
|
import { googleCloudBQRow } from "../_shared/lookup/googleCloud.mjs";
|
|
17
20
|
import { languageBQRow } from "../_shared/lookup/language.mjs";
|
|
18
21
|
import { partitionType } from "../_shared/partitionType.mjs";
|
|
19
|
-
import { zodToBQSchema } from "../_shared/zodToBQDefinition.mjs";
|
|
20
22
|
import "../_shared/index.mjs";
|
|
21
|
-
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQNumeric, BQString, BQTime, BQTimestamp, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime,
|
|
23
|
+
export { BQBool, BQBytes, BQDate, BQDateTime, BQFieldMode, BQFieldModeSchema, BQFieldType, BQFieldTypeSchema, BQInt64, BQJson, BQNumeric, BQString, BQTime, BQTimestamp, accountBQRow, accountDefinition, accountPlatform, accountPlatformSchema, accountTableId, countryBQRow, decodeBQDate, decodeBQDateTime, encodeBQDate, encodeBQDateTime, googleCloudBQRow, languageBQRow, partitionType, toBQApiSchema, zBQBytes, zBQFloat, zBQInt, zBQInt64, zBQJson, 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
|