@major-tech/resource-client 0.2.18 → 0.2.21
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/bin/generate-clients.mjs +4 -3
- package/dist/clients/bigquery.cjs +104 -0
- package/dist/clients/bigquery.cjs.map +7 -0
- package/dist/clients/bigquery.d.ts +66 -0
- package/dist/clients/bigquery.d.ts.map +1 -0
- package/dist/clients/bigquery.js +77 -0
- package/dist/clients/bigquery.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/payload-builders/bigquery.cjs +103 -0
- package/dist/payload-builders/bigquery.cjs.map +7 -0
- package/dist/payload-builders/bigquery.d.ts +55 -0
- package/dist/payload-builders/bigquery.d.ts.map +1 -0
- package/dist/payload-builders/bigquery.js +103 -0
- package/dist/payload-builders/bigquery.js.map +1 -0
- package/dist/payload-builders/from-extracted-params.cjs +47 -0
- package/dist/payload-builders/from-extracted-params.cjs.map +2 -2
- package/dist/payload-builders/from-extracted-params.d.ts +4 -0
- package/dist/payload-builders/from-extracted-params.d.ts.map +1 -1
- package/dist/payload-builders/from-extracted-params.js +53 -0
- package/dist/payload-builders/from-extracted-params.js.map +1 -1
- package/dist/payload-builders/index.cjs +8 -0
- package/dist/payload-builders/index.cjs.map +2 -2
- package/dist/payload-builders/index.d.ts +1 -0
- package/dist/payload-builders/index.d.ts.map +1 -1
- package/dist/payload-builders/index.js +2 -0
- package/dist/payload-builders/index.js.map +1 -1
- package/dist/schemas/bigquery.cjs +17 -0
- package/dist/schemas/bigquery.cjs.map +7 -0
- package/dist/schemas/bigquery.d.ts +74 -0
- package/dist/schemas/bigquery.d.ts.map +1 -0
- package/dist/schemas/bigquery.js +5 -0
- package/dist/schemas/bigquery.js.map +1 -0
- package/dist/schemas/index.cjs +1 -0
- package/dist/schemas/index.cjs.map +2 -2
- package/dist/schemas/index.d.ts +3 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/response.d.ts +6 -1
- package/dist/schemas/response.d.ts.map +1 -1
- package/package.json +1 -1
package/bin/generate-clients.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* npx @major-tech/resource-client remove <name>
|
|
9
9
|
* npx @major-tech/resource-client list
|
|
10
10
|
*
|
|
11
|
-
* Types: database-postgresql | database-mssql | database-dynamodb | database-cosmosdb | database-snowflake | api-hubspot | api-googlesheets | api-custom | api-lambda | api-salesforce | storage-s3
|
|
11
|
+
* Types: database-postgresql | database-mssql | database-dynamodb | database-cosmosdb | database-snowflake | database-bigquery | api-hubspot | api-googlesheets | api-custom | api-lambda | api-salesforce | storage-s3
|
|
12
12
|
*
|
|
13
13
|
* Examples:
|
|
14
14
|
* npx @major-tech/resource-client add "abc-123" "orders-db" "database-postgresql" "Orders database" "app-123"
|
|
@@ -145,6 +145,7 @@ function getClientClass(type) {
|
|
|
145
145
|
'database-dynamodb': 'DynamoDBResourceClient',
|
|
146
146
|
'database-cosmosdb': 'CosmosDBResourceClient',
|
|
147
147
|
'database-snowflake': 'SnowflakeResourceClient',
|
|
148
|
+
'database-bigquery': 'BigQueryResourceClient',
|
|
148
149
|
'api-custom': 'CustomApiResourceClient',
|
|
149
150
|
'api-hubspot': 'HubSpotResourceClient',
|
|
150
151
|
'api-googlesheets': 'GoogleSheetsResourceClient',
|
|
@@ -184,7 +185,7 @@ function generateIndexFile(resources) {
|
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
function addResource(resourceId, name, type, description, applicationId, framework) {
|
|
187
|
-
const validTypes = ['database-postgresql', 'database-mssql', 'database-dynamodb', 'database-cosmosdb', 'database-snowflake', 'api-hubspot', 'api-googlesheets', 'api-custom', 'api-lambda', 'api-salesforce', 'storage-s3'];
|
|
188
|
+
const validTypes = ['database-postgresql', 'database-mssql', 'database-dynamodb', 'database-cosmosdb', 'database-snowflake', 'database-bigquery', 'api-hubspot', 'api-googlesheets', 'api-custom', 'api-lambda', 'api-salesforce', 'storage-s3'];
|
|
188
189
|
if (!validTypes.includes(type)) {
|
|
189
190
|
console.error(`❌ Invalid type: ${type}`);
|
|
190
191
|
console.error(` Valid types: ${validTypes.join(', ')}`);
|
|
@@ -321,7 +322,7 @@ function main() {
|
|
|
321
322
|
console.log(' npx @major-tech/resource-client add <resource_id> <name> <type> <description> <application_id> [--framework <nextjs|vite>]');
|
|
322
323
|
console.log(' npx @major-tech/resource-client remove <name> [--framework <nextjs|vite>]');
|
|
323
324
|
console.log(' npx @major-tech/resource-client list');
|
|
324
|
-
console.log('\nTypes: database-postgresql | database-mssql | database-dynamodb | database-cosmosdb | database-snowflake | api-hubspot | api-googlesheets | api-custom | api-lambda | api-salesforce | storage-s3');
|
|
325
|
+
console.log('\nTypes: database-postgresql | database-mssql | database-dynamodb | database-cosmosdb | database-snowflake | database-bigquery | api-hubspot | api-googlesheets | api-custom | api-lambda | api-salesforce | storage-s3');
|
|
325
326
|
return;
|
|
326
327
|
}
|
|
327
328
|
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var bigquery_exports = {};
|
|
21
|
+
__export(bigquery_exports, {
|
|
22
|
+
BigQueryResourceClient: () => BigQueryResourceClient
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(bigquery_exports);
|
|
25
|
+
var import_base = require("../base");
|
|
26
|
+
var import_bigquery = require("../payload-builders/bigquery");
|
|
27
|
+
class BigQueryResourceClient extends import_base.BaseResourceClient {
|
|
28
|
+
static {
|
|
29
|
+
__name(this, "BigQueryResourceClient");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Execute a SQL query
|
|
33
|
+
* @param sql The SQL query to execute
|
|
34
|
+
* @param params Optional query parameters (named parameters)
|
|
35
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
36
|
+
* @param options Query options
|
|
37
|
+
*/
|
|
38
|
+
async query(sql, params, invocationKey, options) {
|
|
39
|
+
const payload = (0, import_bigquery.buildBigQueryQueryPayload)(sql, params, options);
|
|
40
|
+
return this.invokeRaw(payload, invocationKey);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* List all datasets in the project
|
|
44
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
45
|
+
* @param options List options
|
|
46
|
+
*/
|
|
47
|
+
async listDatasets(invocationKey, options) {
|
|
48
|
+
const payload = (0, import_bigquery.buildBigQueryListDatasetsPayload)(options);
|
|
49
|
+
return this.invokeRaw(payload, invocationKey);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* List all tables in a dataset
|
|
53
|
+
* @param datasetId The dataset ID
|
|
54
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
55
|
+
* @param options List options
|
|
56
|
+
*/
|
|
57
|
+
async listTables(datasetId, invocationKey, options) {
|
|
58
|
+
const payload = (0, import_bigquery.buildBigQueryListTablesPayload)(datasetId, options);
|
|
59
|
+
return this.invokeRaw(payload, invocationKey);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get table metadata and schema
|
|
63
|
+
* @param datasetId The dataset ID
|
|
64
|
+
* @param tableId The table ID
|
|
65
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
66
|
+
*/
|
|
67
|
+
async getTable(datasetId, tableId, invocationKey) {
|
|
68
|
+
const payload = (0, import_bigquery.buildBigQueryGetTablePayload)(datasetId, tableId);
|
|
69
|
+
return this.invokeRaw(payload, invocationKey);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Insert rows into a table (streaming insert)
|
|
73
|
+
* @param datasetId The dataset ID
|
|
74
|
+
* @param tableId The table ID
|
|
75
|
+
* @param rows Array of rows to insert
|
|
76
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
77
|
+
*/
|
|
78
|
+
async insertRows(datasetId, tableId, rows, invocationKey) {
|
|
79
|
+
const payload = (0, import_bigquery.buildBigQueryInsertRowsPayload)(datasetId, tableId, rows);
|
|
80
|
+
return this.invokeRaw(payload, invocationKey);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Create a new table
|
|
84
|
+
* @param datasetId The dataset ID
|
|
85
|
+
* @param tableId The table ID
|
|
86
|
+
* @param schema Table schema definition
|
|
87
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
88
|
+
* @param options Table creation options
|
|
89
|
+
*/
|
|
90
|
+
async createTable(datasetId, tableId, schema, invocationKey, options) {
|
|
91
|
+
const payload = (0, import_bigquery.buildBigQueryCreateTablePayload)(datasetId, tableId, schema, options);
|
|
92
|
+
return this.invokeRaw(payload, invocationKey);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Raw invoke with a custom payload
|
|
96
|
+
* @param payload The BigQuery payload
|
|
97
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
98
|
+
*/
|
|
99
|
+
async invoke(payload, invocationKey) {
|
|
100
|
+
const fullPayload = (0, import_bigquery.buildBigQueryInvokePayload)(payload);
|
|
101
|
+
return this.invokeRaw(fullPayload, invocationKey);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=bigquery.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/clients/bigquery.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n BigQueryInvokeResponse,\n BigQueryTableSchema,\n DbBigQueryPayload,\n} from \"../schemas\";\nimport { BaseResourceClient } from \"../base\";\nimport {\n buildBigQueryQueryPayload,\n buildBigQueryListDatasetsPayload,\n buildBigQueryListTablesPayload,\n buildBigQueryGetTablePayload,\n buildBigQueryInsertRowsPayload,\n buildBigQueryCreateTablePayload,\n buildBigQueryInvokePayload,\n} from \"../payload-builders/bigquery\";\n\nexport interface BigQueryQueryOptions {\n timeoutMs?: number;\n maxResults?: number;\n}\n\nexport class BigQueryResourceClient extends BaseResourceClient {\n /**\n * Execute a SQL query\n * @param sql The SQL query to execute\n * @param params Optional query parameters (named parameters)\n * @param invocationKey Unique key for tracking this invocation\n * @param options Query options\n */\n async query(\n sql: string,\n params: Record<string, unknown> | undefined,\n invocationKey: string,\n options?: BigQueryQueryOptions\n ): Promise<BigQueryInvokeResponse> {\n const payload = buildBigQueryQueryPayload(sql, params, options);\n return this.invokeRaw(payload, invocationKey) as Promise<BigQueryInvokeResponse>;\n }\n\n /**\n * List all datasets in the project\n * @param invocationKey Unique key for tracking this invocation\n * @param options List options\n */\n async listDatasets(\n invocationKey: string,\n options?: { maxResults?: number }\n ): Promise<BigQueryInvokeResponse> {\n const payload = buildBigQueryListDatasetsPayload(options);\n return this.invokeRaw(payload, invocationKey) as Promise<BigQueryInvokeResponse>;\n }\n\n /**\n * List all tables in a dataset\n * @param datasetId The dataset ID\n * @param invocationKey Unique key for tracking this invocation\n * @param options List options\n */\n async listTables(\n datasetId: string,\n invocationKey: string,\n options?: { maxResults?: number }\n ): Promise<BigQueryInvokeResponse> {\n const payload = buildBigQueryListTablesPayload(datasetId, options);\n return this.invokeRaw(payload, invocationKey) as Promise<BigQueryInvokeResponse>;\n }\n\n /**\n * Get table metadata and schema\n * @param datasetId The dataset ID\n * @param tableId The table ID\n * @param invocationKey Unique key for tracking this invocation\n */\n async getTable(\n datasetId: string,\n tableId: string,\n invocationKey: string\n ): Promise<BigQueryInvokeResponse> {\n const payload = buildBigQueryGetTablePayload(datasetId, tableId);\n return this.invokeRaw(payload, invocationKey) as Promise<BigQueryInvokeResponse>;\n }\n\n /**\n * Insert rows into a table (streaming insert)\n * @param datasetId The dataset ID\n * @param tableId The table ID\n * @param rows Array of rows to insert\n * @param invocationKey Unique key for tracking this invocation\n */\n async insertRows(\n datasetId: string,\n tableId: string,\n rows: Record<string, unknown>[],\n invocationKey: string\n ): Promise<BigQueryInvokeResponse> {\n const payload = buildBigQueryInsertRowsPayload(datasetId, tableId, rows);\n return this.invokeRaw(payload, invocationKey) as Promise<BigQueryInvokeResponse>;\n }\n\n /**\n * Create a new table\n * @param datasetId The dataset ID\n * @param tableId The table ID\n * @param schema Table schema definition\n * @param invocationKey Unique key for tracking this invocation\n * @param options Table creation options\n */\n async createTable(\n datasetId: string,\n tableId: string,\n schema: BigQueryTableSchema,\n invocationKey: string,\n options?: { timeoutMs?: number }\n ): Promise<BigQueryInvokeResponse> {\n const payload = buildBigQueryCreateTablePayload(datasetId, tableId, schema, options);\n return this.invokeRaw(payload, invocationKey) as Promise<BigQueryInvokeResponse>;\n }\n\n /**\n * Raw invoke with a custom payload\n * @param payload The BigQuery payload\n * @param invocationKey Unique key for tracking this invocation\n */\n async invoke(\n payload: Omit<DbBigQueryPayload, \"type\" | \"subtype\">,\n invocationKey: string\n ): Promise<BigQueryInvokeResponse> {\n const fullPayload = buildBigQueryInvokePayload(payload);\n return this.invokeRaw(fullPayload, invocationKey) as Promise<BigQueryInvokeResponse>;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAKA;;;;;AAAA,kBAAmC;AACnC,sBAQO;AAOD,MAAO,+BAA+B,+BAAkB;EAhB9D,OAgB8D;;;;;;;;;;EAQ5D,MAAM,MACJ,KACA,QACA,eACA,SAA8B;AAE9B,UAAM,cAAU,2CAA0B,KAAK,QAAQ,OAAO;AAC9D,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;EAOA,MAAM,aACJ,eACA,SAAiC;AAEjC,UAAM,cAAU,kDAAiC,OAAO;AACxD,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;EAQA,MAAM,WACJ,WACA,eACA,SAAiC;AAEjC,UAAM,cAAU,gDAA+B,WAAW,OAAO;AACjE,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;EAQA,MAAM,SACJ,WACA,SACA,eAAqB;AAErB,UAAM,cAAU,8CAA6B,WAAW,OAAO;AAC/D,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;;EASA,MAAM,WACJ,WACA,SACA,MACA,eAAqB;AAErB,UAAM,cAAU,gDAA+B,WAAW,SAAS,IAAI;AACvE,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;;;EAUA,MAAM,YACJ,WACA,SACA,QACA,eACA,SAAgC;AAEhC,UAAM,cAAU,iDAAgC,WAAW,SAAS,QAAQ,OAAO;AACnF,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;EAOA,MAAM,OACJ,SACA,eAAqB;AAErB,UAAM,kBAAc,4CAA2B,OAAO;AACtD,WAAO,KAAK,UAAU,aAAa,aAAa;EAClD;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { BigQueryInvokeResponse, BigQueryTableSchema, DbBigQueryPayload } from "../schemas";
|
|
2
|
+
import { BaseResourceClient } from "../base";
|
|
3
|
+
export interface BigQueryQueryOptions {
|
|
4
|
+
timeoutMs?: number;
|
|
5
|
+
maxResults?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class BigQueryResourceClient extends BaseResourceClient {
|
|
8
|
+
/**
|
|
9
|
+
* Execute a SQL query
|
|
10
|
+
* @param sql The SQL query to execute
|
|
11
|
+
* @param params Optional query parameters (named parameters)
|
|
12
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
13
|
+
* @param options Query options
|
|
14
|
+
*/
|
|
15
|
+
query(sql: string, params: Record<string, unknown> | undefined, invocationKey: string, options?: BigQueryQueryOptions): Promise<BigQueryInvokeResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* List all datasets in the project
|
|
18
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
19
|
+
* @param options List options
|
|
20
|
+
*/
|
|
21
|
+
listDatasets(invocationKey: string, options?: {
|
|
22
|
+
maxResults?: number;
|
|
23
|
+
}): Promise<BigQueryInvokeResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* List all tables in a dataset
|
|
26
|
+
* @param datasetId The dataset ID
|
|
27
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
28
|
+
* @param options List options
|
|
29
|
+
*/
|
|
30
|
+
listTables(datasetId: string, invocationKey: string, options?: {
|
|
31
|
+
maxResults?: number;
|
|
32
|
+
}): Promise<BigQueryInvokeResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Get table metadata and schema
|
|
35
|
+
* @param datasetId The dataset ID
|
|
36
|
+
* @param tableId The table ID
|
|
37
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
38
|
+
*/
|
|
39
|
+
getTable(datasetId: string, tableId: string, invocationKey: string): Promise<BigQueryInvokeResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Insert rows into a table (streaming insert)
|
|
42
|
+
* @param datasetId The dataset ID
|
|
43
|
+
* @param tableId The table ID
|
|
44
|
+
* @param rows Array of rows to insert
|
|
45
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
46
|
+
*/
|
|
47
|
+
insertRows(datasetId: string, tableId: string, rows: Record<string, unknown>[], invocationKey: string): Promise<BigQueryInvokeResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Create a new table
|
|
50
|
+
* @param datasetId The dataset ID
|
|
51
|
+
* @param tableId The table ID
|
|
52
|
+
* @param schema Table schema definition
|
|
53
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
54
|
+
* @param options Table creation options
|
|
55
|
+
*/
|
|
56
|
+
createTable(datasetId: string, tableId: string, schema: BigQueryTableSchema, invocationKey: string, options?: {
|
|
57
|
+
timeoutMs?: number;
|
|
58
|
+
}): Promise<BigQueryInvokeResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Raw invoke with a custom payload
|
|
61
|
+
* @param payload The BigQuery payload
|
|
62
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
63
|
+
*/
|
|
64
|
+
invoke(payload: Omit<DbBigQueryPayload, "type" | "subtype">, invocationKey: string): Promise<BigQueryInvokeResponse>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=bigquery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigquery.d.ts","sourceRoot":"","sources":["../../src/clients/bigquery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAW7C,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D;;;;;;OAMG;IACG,KAAK,CACT,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;OAIG;IACG,YAAY,CAChB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;;OAKG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;;OAKG;IACG,QAAQ,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;;;OAMG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC/B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;;;;OAOG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,mBAAmB,EAC3B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;OAIG;IACG,MAAM,CACV,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC,EACpD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC;CAInC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { BaseResourceClient } from "../base";
|
|
2
|
+
import { buildBigQueryQueryPayload, buildBigQueryListDatasetsPayload, buildBigQueryListTablesPayload, buildBigQueryGetTablePayload, buildBigQueryInsertRowsPayload, buildBigQueryCreateTablePayload, buildBigQueryInvokePayload, } from "../payload-builders/bigquery";
|
|
3
|
+
export class BigQueryResourceClient extends BaseResourceClient {
|
|
4
|
+
/**
|
|
5
|
+
* Execute a SQL query
|
|
6
|
+
* @param sql The SQL query to execute
|
|
7
|
+
* @param params Optional query parameters (named parameters)
|
|
8
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
9
|
+
* @param options Query options
|
|
10
|
+
*/
|
|
11
|
+
async query(sql, params, invocationKey, options) {
|
|
12
|
+
const payload = buildBigQueryQueryPayload(sql, params, options);
|
|
13
|
+
return this.invokeRaw(payload, invocationKey);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* List all datasets in the project
|
|
17
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
18
|
+
* @param options List options
|
|
19
|
+
*/
|
|
20
|
+
async listDatasets(invocationKey, options) {
|
|
21
|
+
const payload = buildBigQueryListDatasetsPayload(options);
|
|
22
|
+
return this.invokeRaw(payload, invocationKey);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List all tables in a dataset
|
|
26
|
+
* @param datasetId The dataset ID
|
|
27
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
28
|
+
* @param options List options
|
|
29
|
+
*/
|
|
30
|
+
async listTables(datasetId, invocationKey, options) {
|
|
31
|
+
const payload = buildBigQueryListTablesPayload(datasetId, options);
|
|
32
|
+
return this.invokeRaw(payload, invocationKey);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get table metadata and schema
|
|
36
|
+
* @param datasetId The dataset ID
|
|
37
|
+
* @param tableId The table ID
|
|
38
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
39
|
+
*/
|
|
40
|
+
async getTable(datasetId, tableId, invocationKey) {
|
|
41
|
+
const payload = buildBigQueryGetTablePayload(datasetId, tableId);
|
|
42
|
+
return this.invokeRaw(payload, invocationKey);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Insert rows into a table (streaming insert)
|
|
46
|
+
* @param datasetId The dataset ID
|
|
47
|
+
* @param tableId The table ID
|
|
48
|
+
* @param rows Array of rows to insert
|
|
49
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
50
|
+
*/
|
|
51
|
+
async insertRows(datasetId, tableId, rows, invocationKey) {
|
|
52
|
+
const payload = buildBigQueryInsertRowsPayload(datasetId, tableId, rows);
|
|
53
|
+
return this.invokeRaw(payload, invocationKey);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Create a new table
|
|
57
|
+
* @param datasetId The dataset ID
|
|
58
|
+
* @param tableId The table ID
|
|
59
|
+
* @param schema Table schema definition
|
|
60
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
61
|
+
* @param options Table creation options
|
|
62
|
+
*/
|
|
63
|
+
async createTable(datasetId, tableId, schema, invocationKey, options) {
|
|
64
|
+
const payload = buildBigQueryCreateTablePayload(datasetId, tableId, schema, options);
|
|
65
|
+
return this.invokeRaw(payload, invocationKey);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Raw invoke with a custom payload
|
|
69
|
+
* @param payload The BigQuery payload
|
|
70
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
71
|
+
*/
|
|
72
|
+
async invoke(payload, invocationKey) {
|
|
73
|
+
const fullPayload = buildBigQueryInvokePayload(payload);
|
|
74
|
+
return this.invokeRaw(fullPayload, invocationKey);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=bigquery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigquery.js","sourceRoot":"","sources":["../../src/clients/bigquery.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,8BAA8B,EAC9B,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC;AAOtC,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CACT,GAAW,EACX,MAA2C,EAC3C,aAAqB,EACrB,OAA8B;QAE9B,MAAM,OAAO,GAAG,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAoC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY,CAChB,aAAqB,EACrB,OAAiC;QAEjC,MAAM,OAAO,GAAG,gCAAgC,CAAC,OAAO,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAoC,CAAC;IACnF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CACd,SAAiB,EACjB,aAAqB,EACrB,OAAiC;QAEjC,MAAM,OAAO,GAAG,8BAA8B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAoC,CAAC;IACnF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CACZ,SAAiB,EACjB,OAAe,EACf,aAAqB;QAErB,MAAM,OAAO,GAAG,4BAA4B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAoC,CAAC;IACnF,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,UAAU,CACd,SAAiB,EACjB,OAAe,EACf,IAA+B,EAC/B,aAAqB;QAErB,MAAM,OAAO,GAAG,8BAA8B,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACzE,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAoC,CAAC;IACnF,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,WAAW,CACf,SAAiB,EACjB,OAAe,EACf,MAA2B,EAC3B,aAAqB,EACrB,OAAgC;QAEhC,MAAM,OAAO,GAAG,+BAA+B,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QACrF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAoC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,OAAoD,EACpD,aAAqB;QAErB,MAAM,WAAW,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,aAAa,CAAoC,CAAC;IACvF,CAAC;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var index_exports = {};
|
|
21
21
|
__export(index_exports, {
|
|
22
22
|
BaseResourceClient: () => import_base.BaseResourceClient,
|
|
23
|
+
BigQueryResourceClient: () => import_bigquery.BigQueryResourceClient,
|
|
23
24
|
CosmosDBResourceClient: () => import_cosmosdb.CosmosDBResourceClient,
|
|
24
25
|
CustomApiResourceClient: () => import_api_custom.CustomApiResourceClient,
|
|
25
26
|
DynamoDBResourceClient: () => import_dynamodb.DynamoDBResourceClient,
|
|
@@ -48,5 +49,6 @@ var import_salesforce = require("./clients/salesforce");
|
|
|
48
49
|
var import_googlesheets = require("./clients/googlesheets");
|
|
49
50
|
var import_s3 = require("./clients/s3");
|
|
50
51
|
var import_lambda = require("./clients/lambda");
|
|
52
|
+
var import_bigquery = require("./clients/bigquery");
|
|
51
53
|
__reExport(index_exports, require("./payload-builders"), module.exports);
|
|
52
54
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["// Export all schemas and types\nexport * from \"./schemas\";\n\n// Export base client and config\nexport { BaseResourceClient, type BaseClientConfig } from \"./base\";\n\n// Export errors\nexport { ResourceInvokeError } from \"./errors\";\n\n// Export individual clients\nexport { PostgresResourceClient } from \"./clients/postgres\";\nexport { MssqlResourceClient } from \"./clients/mssql\";\nexport { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CosmosDBResourceClient } from \"./clients/cosmosdb\";\nexport { SnowflakeResourceClient } from \"./clients/snowflake\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { SalesforceResourceClient } from \"./clients/salesforce\";\nexport { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\nexport { LambdaResourceClient } from \"./clients/lambda\";\n\n// Export payload builders (for use in testing UIs, etc.)\nexport * from \"./payload-builders\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n CosmosDBInvokeResponse,\n SnowflakeInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n LambdaInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA
|
|
4
|
+
"sourcesContent": ["// Export all schemas and types\nexport * from \"./schemas\";\n\n// Export base client and config\nexport { BaseResourceClient, type BaseClientConfig } from \"./base\";\n\n// Export errors\nexport { ResourceInvokeError } from \"./errors\";\n\n// Export individual clients\nexport { PostgresResourceClient } from \"./clients/postgres\";\nexport { MssqlResourceClient } from \"./clients/mssql\";\nexport { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CosmosDBResourceClient } from \"./clients/cosmosdb\";\nexport { SnowflakeResourceClient } from \"./clients/snowflake\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { SalesforceResourceClient } from \"./clients/salesforce\";\nexport { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\nexport { LambdaResourceClient } from \"./clients/lambda\";\nexport { BigQueryResourceClient } from \"./clients/bigquery\";\n\n// Export payload builders (for use in testing UIs, etc.)\nexport * from \"./payload-builders\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n CosmosDBInvokeResponse,\n SnowflakeInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n LambdaInvokeResponse,\n BigQueryInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;AACA,0BAAc,sBADd;AAIA,kBAA0D;AAG1D,oBAAoC;AAGpC,sBAAuC;AACvC,mBAAoC;AACpC,sBAAuC;AACvC,sBAAuC;AACvC,uBAAwC;AACxC,wBAAwC;AACxC,qBAAsC;AACtC,wBAAyC;AACzC,0BAA2C;AAC3C,gBAAiC;AACjC,oBAAqC;AACrC,sBAAuC;AAGvC,0BAAc,+BAxBd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { SalesforceResourceClient } from "./clients/salesforce";
|
|
|
12
12
|
export { GoogleSheetsResourceClient } from "./clients/googlesheets";
|
|
13
13
|
export { S3ResourceClient } from "./clients/s3";
|
|
14
14
|
export { LambdaResourceClient } from "./clients/lambda";
|
|
15
|
+
export { BigQueryResourceClient } from "./clients/bigquery";
|
|
15
16
|
export * from "./payload-builders";
|
|
16
|
-
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, LambdaInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
17
|
+
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, LambdaInvokeResponse, BigQueryInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,cAAc,oBAAoB,CAAC;AAGnC,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { SalesforceResourceClient } from "./clients/salesforce";
|
|
|
16
16
|
export { GoogleSheetsResourceClient } from "./clients/googlesheets";
|
|
17
17
|
export { S3ResourceClient } from "./clients/s3";
|
|
18
18
|
export { LambdaResourceClient } from "./clients/lambda";
|
|
19
|
+
export { BigQueryResourceClient } from "./clients/bigquery";
|
|
19
20
|
// Export payload builders (for use in testing UIs, etc.)
|
|
20
21
|
export * from "./payload-builders";
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,cAAc,WAAW,CAAC;AAE1B,gCAAgC;AAChC,OAAO,EAAE,kBAAkB,EAAyB,MAAM,QAAQ,CAAC;AAEnE,gBAAgB;AAChB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,4BAA4B;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,cAAc,WAAW,CAAC;AAE1B,gCAAgC;AAChC,OAAO,EAAE,kBAAkB,EAAyB,MAAM,QAAQ,CAAC;AAEnE,gBAAgB;AAChB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,4BAA4B;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,yDAAyD;AACzD,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var bigquery_exports = {};
|
|
21
|
+
__export(bigquery_exports, {
|
|
22
|
+
buildBigQueryCreateTablePayload: () => buildBigQueryCreateTablePayload,
|
|
23
|
+
buildBigQueryGetTablePayload: () => buildBigQueryGetTablePayload,
|
|
24
|
+
buildBigQueryInsertRowsPayload: () => buildBigQueryInsertRowsPayload,
|
|
25
|
+
buildBigQueryInvokePayload: () => buildBigQueryInvokePayload,
|
|
26
|
+
buildBigQueryListDatasetsPayload: () => buildBigQueryListDatasetsPayload,
|
|
27
|
+
buildBigQueryListTablesPayload: () => buildBigQueryListTablesPayload,
|
|
28
|
+
buildBigQueryQueryPayload: () => buildBigQueryQueryPayload
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(bigquery_exports);
|
|
31
|
+
function buildBigQueryQueryPayload(sql, params, options) {
|
|
32
|
+
return {
|
|
33
|
+
type: "database",
|
|
34
|
+
subtype: "bigquery",
|
|
35
|
+
operation: "query",
|
|
36
|
+
sql,
|
|
37
|
+
params,
|
|
38
|
+
timeoutMs: options?.timeoutMs,
|
|
39
|
+
maxResults: options?.maxResults
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
__name(buildBigQueryQueryPayload, "buildBigQueryQueryPayload");
|
|
43
|
+
function buildBigQueryListDatasetsPayload(options) {
|
|
44
|
+
return {
|
|
45
|
+
type: "database",
|
|
46
|
+
subtype: "bigquery",
|
|
47
|
+
operation: "listDatasets",
|
|
48
|
+
maxResults: options?.maxResults
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
__name(buildBigQueryListDatasetsPayload, "buildBigQueryListDatasetsPayload");
|
|
52
|
+
function buildBigQueryListTablesPayload(datasetId, options) {
|
|
53
|
+
return {
|
|
54
|
+
type: "database",
|
|
55
|
+
subtype: "bigquery",
|
|
56
|
+
operation: "listTables",
|
|
57
|
+
datasetId,
|
|
58
|
+
maxResults: options?.maxResults
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
__name(buildBigQueryListTablesPayload, "buildBigQueryListTablesPayload");
|
|
62
|
+
function buildBigQueryGetTablePayload(datasetId, tableId) {
|
|
63
|
+
return {
|
|
64
|
+
type: "database",
|
|
65
|
+
subtype: "bigquery",
|
|
66
|
+
operation: "getTable",
|
|
67
|
+
datasetId,
|
|
68
|
+
tableId
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
__name(buildBigQueryGetTablePayload, "buildBigQueryGetTablePayload");
|
|
72
|
+
function buildBigQueryInsertRowsPayload(datasetId, tableId, rows) {
|
|
73
|
+
return {
|
|
74
|
+
type: "database",
|
|
75
|
+
subtype: "bigquery",
|
|
76
|
+
operation: "insertRows",
|
|
77
|
+
datasetId,
|
|
78
|
+
tableId,
|
|
79
|
+
rows
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
__name(buildBigQueryInsertRowsPayload, "buildBigQueryInsertRowsPayload");
|
|
83
|
+
function buildBigQueryCreateTablePayload(datasetId, tableId, schema, options) {
|
|
84
|
+
return {
|
|
85
|
+
type: "database",
|
|
86
|
+
subtype: "bigquery",
|
|
87
|
+
operation: "createTable",
|
|
88
|
+
datasetId,
|
|
89
|
+
tableId,
|
|
90
|
+
schema,
|
|
91
|
+
timeoutMs: options?.timeoutMs
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
__name(buildBigQueryCreateTablePayload, "buildBigQueryCreateTablePayload");
|
|
95
|
+
function buildBigQueryInvokePayload(payload) {
|
|
96
|
+
return {
|
|
97
|
+
type: "database",
|
|
98
|
+
subtype: "bigquery",
|
|
99
|
+
...payload
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
__name(buildBigQueryInvokePayload, "buildBigQueryInvokePayload");
|
|
103
|
+
//# sourceMappingURL=bigquery.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/payload-builders/bigquery.ts"],
|
|
4
|
+
"sourcesContent": ["import type { DbBigQueryPayload, BigQueryTableSchema } from \"../schemas\";\n\n/**\n * Build a BigQuery query payload\n * @param sql The SQL query to execute\n * @param params Optional query parameters\n * @param options Query options\n */\nexport function buildBigQueryQueryPayload(\n sql: string,\n params?: Record<string, unknown>,\n options?: { timeoutMs?: number; maxResults?: number }\n): DbBigQueryPayload {\n return {\n type: \"database\",\n subtype: \"bigquery\",\n operation: \"query\",\n sql,\n params,\n timeoutMs: options?.timeoutMs,\n maxResults: options?.maxResults,\n };\n}\n\n/**\n * Build a BigQuery listDatasets payload\n * @param options List options\n */\nexport function buildBigQueryListDatasetsPayload(\n options?: { maxResults?: number }\n): DbBigQueryPayload {\n return {\n type: \"database\",\n subtype: \"bigquery\",\n operation: \"listDatasets\",\n maxResults: options?.maxResults,\n };\n}\n\n/**\n * Build a BigQuery listTables payload\n * @param datasetId The dataset ID\n * @param options List options\n */\nexport function buildBigQueryListTablesPayload(\n datasetId: string,\n options?: { maxResults?: number }\n): DbBigQueryPayload {\n return {\n type: \"database\",\n subtype: \"bigquery\",\n operation: \"listTables\",\n datasetId,\n maxResults: options?.maxResults,\n };\n}\n\n/**\n * Build a BigQuery getTable payload\n * @param datasetId The dataset ID\n * @param tableId The table ID\n */\nexport function buildBigQueryGetTablePayload(\n datasetId: string,\n tableId: string\n): DbBigQueryPayload {\n return {\n type: \"database\",\n subtype: \"bigquery\",\n operation: \"getTable\",\n datasetId,\n tableId,\n };\n}\n\n/**\n * Build a BigQuery insertRows payload\n * @param datasetId The dataset ID\n * @param tableId The table ID\n * @param rows Array of rows to insert\n */\nexport function buildBigQueryInsertRowsPayload(\n datasetId: string,\n tableId: string,\n rows: Record<string, unknown>[]\n): DbBigQueryPayload {\n return {\n type: \"database\",\n subtype: \"bigquery\",\n operation: \"insertRows\",\n datasetId,\n tableId,\n rows,\n };\n}\n\n/**\n * Build a BigQuery createTable payload\n * @param datasetId The dataset ID\n * @param tableId The table ID\n * @param schema Table schema\n * @param options Creation options\n */\nexport function buildBigQueryCreateTablePayload(\n datasetId: string,\n tableId: string,\n schema: BigQueryTableSchema,\n options?: { timeoutMs?: number }\n): DbBigQueryPayload {\n return {\n type: \"database\",\n subtype: \"bigquery\",\n operation: \"createTable\",\n datasetId,\n tableId,\n schema,\n timeoutMs: options?.timeoutMs,\n };\n}\n\n/**\n * Build a raw BigQuery invoke payload\n * @param payload The partial payload\n */\nexport function buildBigQueryInvokePayload(\n payload: Omit<DbBigQueryPayload, \"type\" | \"subtype\">\n): DbBigQueryPayload {\n return {\n type: \"database\",\n subtype: \"bigquery\",\n ...payload,\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;AAMM,SAAU,0BACd,KACA,QACA,SAAqD;AAErD,SAAO;IACL,MAAM;IACN,SAAS;IACT,WAAW;IACX;IACA;IACA,WAAW,SAAS;IACpB,YAAY,SAAS;;AAEzB;AAdgB;AAoBV,SAAU,iCACd,SAAiC;AAEjC,SAAO;IACL,MAAM;IACN,SAAS;IACT,WAAW;IACX,YAAY,SAAS;;AAEzB;AATgB;AAgBV,SAAU,+BACd,WACA,SAAiC;AAEjC,SAAO;IACL,MAAM;IACN,SAAS;IACT,WAAW;IACX;IACA,YAAY,SAAS;;AAEzB;AAXgB;AAkBV,SAAU,6BACd,WACA,SAAe;AAEf,SAAO;IACL,MAAM;IACN,SAAS;IACT,WAAW;IACX;IACA;;AAEJ;AAXgB;AAmBV,SAAU,+BACd,WACA,SACA,MAA+B;AAE/B,SAAO;IACL,MAAM;IACN,SAAS;IACT,WAAW;IACX;IACA;IACA;;AAEJ;AAbgB;AAsBV,SAAU,gCACd,WACA,SACA,QACA,SAAgC;AAEhC,SAAO;IACL,MAAM;IACN,SAAS;IACT,WAAW;IACX;IACA;IACA;IACA,WAAW,SAAS;;AAExB;AAfgB;AAqBV,SAAU,2BACd,SAAoD;AAEpD,SAAO;IACL,MAAM;IACN,SAAS;IACT,GAAG;;AAEP;AARgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DbBigQueryPayload, BigQueryTableSchema } from "../schemas";
|
|
2
|
+
/**
|
|
3
|
+
* Build a BigQuery query payload
|
|
4
|
+
* @param sql The SQL query to execute
|
|
5
|
+
* @param params Optional query parameters
|
|
6
|
+
* @param options Query options
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildBigQueryQueryPayload(sql: string, params?: Record<string, unknown>, options?: {
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
maxResults?: number;
|
|
11
|
+
}): DbBigQueryPayload;
|
|
12
|
+
/**
|
|
13
|
+
* Build a BigQuery listDatasets payload
|
|
14
|
+
* @param options List options
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildBigQueryListDatasetsPayload(options?: {
|
|
17
|
+
maxResults?: number;
|
|
18
|
+
}): DbBigQueryPayload;
|
|
19
|
+
/**
|
|
20
|
+
* Build a BigQuery listTables payload
|
|
21
|
+
* @param datasetId The dataset ID
|
|
22
|
+
* @param options List options
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildBigQueryListTablesPayload(datasetId: string, options?: {
|
|
25
|
+
maxResults?: number;
|
|
26
|
+
}): DbBigQueryPayload;
|
|
27
|
+
/**
|
|
28
|
+
* Build a BigQuery getTable payload
|
|
29
|
+
* @param datasetId The dataset ID
|
|
30
|
+
* @param tableId The table ID
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildBigQueryGetTablePayload(datasetId: string, tableId: string): DbBigQueryPayload;
|
|
33
|
+
/**
|
|
34
|
+
* Build a BigQuery insertRows payload
|
|
35
|
+
* @param datasetId The dataset ID
|
|
36
|
+
* @param tableId The table ID
|
|
37
|
+
* @param rows Array of rows to insert
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildBigQueryInsertRowsPayload(datasetId: string, tableId: string, rows: Record<string, unknown>[]): DbBigQueryPayload;
|
|
40
|
+
/**
|
|
41
|
+
* Build a BigQuery createTable payload
|
|
42
|
+
* @param datasetId The dataset ID
|
|
43
|
+
* @param tableId The table ID
|
|
44
|
+
* @param schema Table schema
|
|
45
|
+
* @param options Creation options
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildBigQueryCreateTablePayload(datasetId: string, tableId: string, schema: BigQueryTableSchema, options?: {
|
|
48
|
+
timeoutMs?: number;
|
|
49
|
+
}): DbBigQueryPayload;
|
|
50
|
+
/**
|
|
51
|
+
* Build a raw BigQuery invoke payload
|
|
52
|
+
* @param payload The partial payload
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildBigQueryInvokePayload(payload: Omit<DbBigQueryPayload, "type" | "subtype">): DbBigQueryPayload;
|
|
55
|
+
//# sourceMappingURL=bigquery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigquery.d.ts","sourceRoot":"","sources":["../../src/payload-builders/bigquery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD,iBAAiB,CAUnB;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC,iBAAiB,CAOnB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC,iBAAiB,CAQnB;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,iBAAiB,CAQnB;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAC9B,iBAAiB,CASnB;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B,iBAAiB,CAUnB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC,GACnD,iBAAiB,CAMnB"}
|