@flytedesk/app-kit 10.0.1 → 10.1.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.
- package/dist/bigquery/client.d.ts +7 -0
- package/dist/bigquery/client.js +6 -0
- package/dist/bigquery/client.js.map +1 -1
- package/dist/bigquery/index.d.ts +3 -1
- package/dist/bigquery/index.js +1 -0
- package/dist/bigquery/index.js.map +1 -1
- package/dist/bigquery/tableAdmin.d.ts +21 -0
- package/dist/bigquery/tableAdmin.js +46 -0
- package/dist/bigquery/tableAdmin.js.map +1 -0
- package/dist/bigquery/types.d.ts +23 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type LoadFromUrisOptions, type LoadRowSource, type LoadRowsOptions, type LoadRowsResult } from "./load.js";
|
|
2
2
|
import { type InsertRowsOptions } from "./insert.js";
|
|
3
|
+
import { type CreateTableOptions, type DeleteTableOptions } from "./tableAdmin.js";
|
|
3
4
|
import type { BigQueryLike, DryRunEstimate, EstimateQueryBytesOptions, ExtractJobHandle, ExtractJobStatus, ExtractTableToGCSInput, JobLabelInput, QueryPage, RunQueryOptions, WaitForExtractJobOptions } from "./types.js";
|
|
4
5
|
export interface CreateBigQueryReadClientOptions {
|
|
5
6
|
/** Merged under any per-call `labels`/`extra` — e.g. `{app: "sms-app"}`. */
|
|
@@ -20,6 +21,12 @@ export interface BigQueryReadClient {
|
|
|
20
21
|
loadFromUris(options: LoadFromUrisOptions, sourceUris: readonly string[]): Promise<LoadRowsResult>;
|
|
21
22
|
/** Streaming insert, strict by default — see `insertRows`. */
|
|
22
23
|
insertRows(options: InsertRowsOptions, rows: readonly object[]): Promise<void>;
|
|
24
|
+
/** Creates a table through the table API, no query job, labelled with this
|
|
25
|
+
* client's `defaultLabels` — see `createTable`. */
|
|
26
|
+
createTable(options: CreateTableOptions): Promise<void>;
|
|
27
|
+
/** Deletes a table through the table API, no query job; a missing table is
|
|
28
|
+
* not an error — see `deleteTable`. */
|
|
29
|
+
deleteTable(options: DeleteTableOptions): Promise<void>;
|
|
23
30
|
/** Builds a `{actor, purpose, ...extra}` label set, pre-merged with this
|
|
24
31
|
* client's `defaultLabels` — pass the result as `labels` to `query`/
|
|
25
32
|
* `extractTableToGCS`. */
|
package/dist/bigquery/client.js
CHANGED
|
@@ -10,6 +10,7 @@ import { buildJobLabels } from "./labels.js";
|
|
|
10
10
|
import { extractTableToGCS, getExtractJobStatus, waitForExtractJob, } from "./extract.js";
|
|
11
11
|
import { loadFromUrisWithRetry, loadRowsWithRetry, } from "./load.js";
|
|
12
12
|
import { insertRows } from "./insert.js";
|
|
13
|
+
import { createTable, deleteTable, } from "./tableAdmin.js";
|
|
13
14
|
import { estimateQueryBytes, runQuery, runQueryAllPages } from "./query.js";
|
|
14
15
|
export function createBigQueryReadClient(bq, options = {}) {
|
|
15
16
|
const defaultLabels = options.defaultLabels ?? {};
|
|
@@ -33,6 +34,11 @@ export function createBigQueryReadClient(bq, options = {}) {
|
|
|
33
34
|
loadRows: (loadOptions, source) => loadRowsWithRetry(bq, { ...loadOptions, labels: withDefaults(loadOptions.labels) }, source),
|
|
34
35
|
loadFromUris: (loadOptions, sourceUris) => loadFromUrisWithRetry(bq, { ...loadOptions, labels: withDefaults(loadOptions.labels) }, sourceUris),
|
|
35
36
|
insertRows: (insertOptions, rows) => insertRows(bq, insertOptions, rows),
|
|
37
|
+
createTable: (tableOptions) => createTable(bq, {
|
|
38
|
+
...tableOptions,
|
|
39
|
+
labels: withDefaults(tableOptions.labels),
|
|
40
|
+
}),
|
|
41
|
+
deleteTable: (tableOptions) => deleteTable(bq, tableOptions),
|
|
36
42
|
buildJobLabels: (input) => ({
|
|
37
43
|
...defaultLabels,
|
|
38
44
|
...buildJobLabels(input),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/bigquery/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,c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,CAAC,WAAW,CAAC,EAAE,EAAE,YAAY,CAAC;QAC5D,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC1B,GAAG,aAAa;YAChB,GAAG,cAAc,CAAC,KAAK,CAAC;SACzB,CAAC;KACH,CAAC;AACJ,CAAC"}
|
package/dist/bigquery/index.d.ts
CHANGED
|
@@ -50,7 +50,9 @@ export type { RetryOptions } from "./retry.js";
|
|
|
50
50
|
export { buildJobLabels, sanitizeLabelValue } from "./labels.js";
|
|
51
51
|
export { insertRows } from "./insert.js";
|
|
52
52
|
export type { InsertRowsOptions } from "./insert.js";
|
|
53
|
+
export { createTable, deleteTable } from "./tableAdmin.js";
|
|
54
|
+
export type { CreateTableOptions, DeleteTableOptions } from "./tableAdmin.js";
|
|
53
55
|
export { unwrapBigQueryCount, unwrapBigQueryRow, unwrapBigQueryValue, } from "./values.js";
|
|
54
56
|
export { BadQueryError, BigQueryReadError, DryRunBudgetExceededError, InsertRowsPartialFailureError, JobTimeoutError, MalformedResultSchemaError, MaximumBytesBilledExceededError, PermissionDeniedError, RateLimitExceededError, TransientBackendError, classifyBigQueryError, } from "./errors.js";
|
|
55
57
|
export type { InsertRowError } from "./errors.js";
|
|
56
|
-
export type { BigQueryApiErrorDetail, BigQueryCreateQueryJobOptions, BigQueryDatasetLike, BigQueryExtractOptions, BigQueryInsertOptions, BigQueryJobLike, BigQueryJobMetadata, BigQueryLike, BigQueryLoadOptions, BigQueryLoadJobLike, BigQueryNextQuery, BigQueryParamTypes, BigQueryParamTypeStruct, BigQueryQueryResultsOptions, BigQueryRawSchema, BigQueryRawSchemaField, BigQueryResultSchemaField, BigQuerySchemaField, BigQueryTableLike, BigQueryTableReference, DryRunEstimate, EstimateQueryBytesOptions, ExtractJobHandle, ExtractJobState, ExtractJobStatus, ExtractTableToGCSInput, GcsFileLike, JobLabelInput, QueryPage, RunQueryOptions, WaitForExtractJobOptions, } from "./types.js";
|
|
58
|
+
export type { BigQueryApiErrorDetail, BigQueryCreateQueryJobOptions, BigQueryDatasetLike, BigQueryExtractOptions, BigQueryInsertOptions, BigQueryJobLike, BigQueryJobMetadata, BigQueryLike, BigQueryLoadOptions, BigQueryLoadJobLike, BigQueryNextQuery, BigQueryParamTypes, BigQueryParamTypeStruct, BigQueryQueryResultsOptions, BigQueryRawSchema, BigQueryRawSchemaField, BigQueryResultSchemaField, BigQuerySchemaField, BigQueryTableDeleteOptions, BigQueryTableLike, BigQueryTableMetadata, BigQueryTableReference, DryRunEstimate, EstimateQueryBytesOptions, ExtractJobHandle, ExtractJobState, ExtractJobStatus, ExtractTableToGCSInput, GcsFileLike, JobLabelInput, QueryPage, RunQueryOptions, WaitForExtractJobOptions, } from "./types.js";
|
package/dist/bigquery/index.js
CHANGED
|
@@ -46,6 +46,7 @@ export { extractTableToGCS, getExtractJobStatus, waitForExtractJob, } from "./ex
|
|
|
46
46
|
export { loadFromUrisWithRetry, loadRowsWithRetry } from "./load.js";
|
|
47
47
|
export { buildJobLabels, sanitizeLabelValue } from "./labels.js";
|
|
48
48
|
export { insertRows } from "./insert.js";
|
|
49
|
+
export { createTable, deleteTable } from "./tableAdmin.js";
|
|
49
50
|
export { unwrapBigQueryCount, unwrapBigQueryRow, unwrapBigQueryValue, } from "./values.js";
|
|
50
51
|
export { BadQueryError, BigQueryReadError, DryRunBudgetExceededError, InsertRowsPartialFailureError, JobTimeoutError, MalformedResultSchemaError, MaximumBytesBilledExceededError, PermissionDeniedError, RateLimitExceededError, TransientBackendError, classifyBigQueryError, } from "./errors.js";
|
|
51
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bigquery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAMvD,OAAO,EAAE,QAAQ,EAAE,gBAAgB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CAAC;AAErB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,eAAe,EACf,0BAA0B,EAC1B,+BAA+B,EAC/B,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BigQueryLike, BigQuerySchemaField } from "./types.js";
|
|
2
|
+
export interface CreateTableOptions {
|
|
3
|
+
datasetId: string;
|
|
4
|
+
tableId: string;
|
|
5
|
+
/** Every field states its name, type and mode. */
|
|
6
|
+
schema: readonly BigQuerySchemaField[];
|
|
7
|
+
/** Clustering columns, in order. Omitted: the table is not clustered. */
|
|
8
|
+
clusteringFields?: readonly string[];
|
|
9
|
+
/** When BigQuery deletes the table itself. Omitted: it never expires. */
|
|
10
|
+
expiresAt?: Date;
|
|
11
|
+
labels?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export interface DeleteTableOptions {
|
|
14
|
+
datasetId: string;
|
|
15
|
+
tableId: string;
|
|
16
|
+
}
|
|
17
|
+
/** Creates the table. Fails (classified, not swallowed) if it already exists. */
|
|
18
|
+
export declare function createTable(bq: BigQueryLike, options: CreateTableOptions): Promise<void>;
|
|
19
|
+
/** Deletes the table. A table that does not exist is a no-op, like
|
|
20
|
+
* `DROP TABLE IF EXISTS`, so a cleanup can run twice. */
|
|
21
|
+
export declare function deleteTable(bq: BigQueryLike, options: DeleteTableOptions): Promise<void>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table create and delete through the table API (AK-50): `tables.insert` and
|
|
3
|
+
* `tables.delete` are metadata calls that start no query job, so they never
|
|
4
|
+
* wait PENDING behind BigQuery's job queue the way `CREATE TABLE` and
|
|
5
|
+
* `DROP TABLE` statements can. No retry of their own.
|
|
6
|
+
*/
|
|
7
|
+
import { BigQueryReadError, classifyBigQueryError } from "./errors.js";
|
|
8
|
+
/** Creates the table. Fails (classified, not swallowed) if it already exists. */
|
|
9
|
+
export async function createTable(bq, options) {
|
|
10
|
+
const table = bq.dataset(options.datasetId).table(options.tableId);
|
|
11
|
+
const create = table.create;
|
|
12
|
+
if (!create) {
|
|
13
|
+
throw new BigQueryReadError(`dataset(${options.datasetId}).table(${options.tableId}) does not implement create — this BigQueryLike was not constructed for table administration`);
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
await create.call(table, {
|
|
17
|
+
schema: { fields: [...options.schema] },
|
|
18
|
+
...(options.clusteringFields && {
|
|
19
|
+
clustering: { fields: [...options.clusteringFields] },
|
|
20
|
+
}),
|
|
21
|
+
...(options.expiresAt && {
|
|
22
|
+
expirationTime: String(options.expiresAt.getTime()),
|
|
23
|
+
}),
|
|
24
|
+
...(options.labels && { labels: options.labels }),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
throw classifyBigQueryError(err);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** Deletes the table. A table that does not exist is a no-op, like
|
|
32
|
+
* `DROP TABLE IF EXISTS`, so a cleanup can run twice. */
|
|
33
|
+
export async function deleteTable(bq, options) {
|
|
34
|
+
const table = bq.dataset(options.datasetId).table(options.tableId);
|
|
35
|
+
const del = table.delete;
|
|
36
|
+
if (!del) {
|
|
37
|
+
throw new BigQueryReadError(`dataset(${options.datasetId}).table(${options.tableId}) does not implement delete — this BigQueryLike was not constructed for table administration`);
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
await del.call(table, { ignoreNotFound: true });
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
throw classifyBigQueryError(err);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=tableAdmin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableAdmin.js","sourceRoot":"","sources":["../../src/bigquery/tableAdmin.ts"],"names":[],"mappings":"AAAA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,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnE,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IACzB,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,iBAAiB,CACzB,WAAW,OAAO,CAAC,SAAS,WAAW,OAAO,CAAC,OAAO,8FAA8F,CACrJ,CAAC;IACJ,CAAC;IACD,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,qBAAqB,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;AACH,CAAC"}
|
package/dist/bigquery/types.d.ts
CHANGED
|
@@ -223,6 +223,22 @@ export interface BigQueryInsertOptions {
|
|
|
223
223
|
skipInvalidRows: boolean;
|
|
224
224
|
ignoreUnknownValues: boolean;
|
|
225
225
|
}
|
|
226
|
+
/** Metadata for `Table#create`, as `@google-cloud/bigquery`'s `TableMetadata`
|
|
227
|
+
* carries it. `expirationTime` is a decimal string of epoch milliseconds. */
|
|
228
|
+
export interface BigQueryTableMetadata {
|
|
229
|
+
schema: {
|
|
230
|
+
fields: BigQuerySchemaField[];
|
|
231
|
+
};
|
|
232
|
+
clustering?: {
|
|
233
|
+
fields: string[];
|
|
234
|
+
};
|
|
235
|
+
expirationTime?: string;
|
|
236
|
+
labels?: Record<string, string>;
|
|
237
|
+
}
|
|
238
|
+
/** Options of `Table#delete`: `ignoreNotFound` turns a missing table into a no-op. */
|
|
239
|
+
export interface BigQueryTableDeleteOptions {
|
|
240
|
+
ignoreNotFound?: boolean;
|
|
241
|
+
}
|
|
226
242
|
export interface BigQueryTableLike {
|
|
227
243
|
createExtractJob(destination: GcsFileLike, options?: BigQueryExtractOptions): Promise<[BigQueryJobLike, BigQueryJobMetadata]>;
|
|
228
244
|
/** Opens a load-job write stream — a real Node `Writable`, since the loader
|
|
@@ -238,6 +254,13 @@ export interface BigQueryTableLike {
|
|
|
238
254
|
* Rejects with a `PartialFailureError` when rows are rejected. Optional:
|
|
239
255
|
* only `insertRows` (./insert.js) needs it, and it fails loudly if missing. */
|
|
240
256
|
insert?(rows: readonly object[], options: BigQueryInsertOptions): Promise<unknown>;
|
|
257
|
+
/** Table API create (`tables.insert`): a metadata call that starts no query
|
|
258
|
+
* job. Rejects when the table already exists. Optional: only
|
|
259
|
+
* `createTable` (./tableAdmin.js) needs it, and it fails loudly if missing. */
|
|
260
|
+
create?(metadata: BigQueryTableMetadata): Promise<unknown>;
|
|
261
|
+
/** Table API delete (`tables.delete`), no query job. Optional: only
|
|
262
|
+
* `deleteTable` (./tableAdmin.js) needs it, and it fails loudly if missing. */
|
|
263
|
+
delete?(options?: BigQueryTableDeleteOptions): Promise<unknown>;
|
|
241
264
|
}
|
|
242
265
|
export interface BigQueryDatasetLike {
|
|
243
266
|
table(id: string): BigQueryTableLike;
|
package/package.json
CHANGED