@major-tech/resource-client 0.2.9 → 0.2.10
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/README.md +91 -2
- package/bin/generate-clients.mjs +4 -3
- package/dist/clients/snowflake.cjs +94 -0
- package/dist/clients/snowflake.cjs.map +7 -0
- package/dist/clients/snowflake.d.ts +68 -0
- package/dist/clients/snowflake.d.ts.map +1 -0
- package/dist/clients/snowflake.js +67 -0
- package/dist/clients/snowflake.js.map +1 -0
- package/dist/index.cjs +3 -1
- 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/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/dist/schemas/snowflake.cjs +17 -0
- package/dist/schemas/snowflake.cjs.map +7 -0
- package/dist/schemas/snowflake.d.ts +154 -0
- package/dist/schemas/snowflake.d.ts.map +1 -0
- package/dist/schemas/snowflake.js +2 -0
- package/dist/schemas/snowflake.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @major-tech/resource-client
|
|
2
2
|
|
|
3
|
-
TS client: PostgreSQL/CustomAPI/HubSpot/S3. Type-safe, 0-dep, universal (Node/browser/edge), ESM+CJS.
|
|
3
|
+
TS client: PostgreSQL/DynamoDB/CosmosDB/Snowflake/CustomAPI/HubSpot/S3. Type-safe, 0-dep, universal (Node/browser/edge), ESM+CJS.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -157,6 +157,95 @@ const r = await c.invoke("GET", "/crm/v3/objects/contacts", "fetch-contacts", {
|
|
|
157
157
|
// r.ok && r.result.body.kind === 'json' ? r.result.body.value : r.error
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
+
## SnowflakeResourceClient
|
|
161
|
+
|
|
162
|
+
**Constructor:** `new SnowflakeResourceClient(config: BaseClientConfig)`
|
|
163
|
+
|
|
164
|
+
**Methods:**
|
|
165
|
+
|
|
166
|
+
- `execute(statement: string, invocationKey: string, options?: SnowflakeExecuteOptions): Promise<SnowflakeInvokeResponse>`
|
|
167
|
+
- `status(statementHandle: string, invocationKey: string, options?: { partition?: number }): Promise<SnowflakeInvokeResponse>`
|
|
168
|
+
- `cancel(statementHandle: string, invocationKey: string): Promise<SnowflakeInvokeResponse>`
|
|
169
|
+
- `invoke(payload: DbSnowflakePayload, invocationKey: string): Promise<SnowflakeInvokeResponse>` - raw payload
|
|
170
|
+
|
|
171
|
+
**Execute Options:**
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
{
|
|
175
|
+
bindings?: Record<string, { type: SnowflakeBindingType; value: string | number | boolean | null }>;
|
|
176
|
+
database?: string; // Override default database
|
|
177
|
+
schema?: string; // Override default schema
|
|
178
|
+
warehouse?: string; // Override default warehouse
|
|
179
|
+
role?: string; // Override default role
|
|
180
|
+
timeout?: number; // Timeout in seconds (max 604800 = 7 days)
|
|
181
|
+
async?: boolean; // Execute asynchronously
|
|
182
|
+
parameters?: SnowflakeSessionParameters; // Session params (timezone, query_tag, etc.)
|
|
183
|
+
nullable?: boolean; // Return NULL as "null" string
|
|
184
|
+
requestId?: string; // Idempotency key
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Binding Types:** `"TEXT" | "FIXED" | "REAL" | "BOOLEAN" | "DATE" | "TIME" | "TIMESTAMP_LTZ" | "TIMESTAMP_NTZ" | "TIMESTAMP_TZ" | "BINARY" | "ARRAY" | "OBJECT" | "VARIANT"`
|
|
189
|
+
|
|
190
|
+
**Result (ok=true):**
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
{
|
|
194
|
+
kind: "snowflake";
|
|
195
|
+
code?: string; // Snowflake response code
|
|
196
|
+
message: string; // Response message
|
|
197
|
+
statementHandle?: string; // Handle for async operations
|
|
198
|
+
statementHandles?: string[]; // Multi-statement handles
|
|
199
|
+
statementStatusUrl?: string; // URL to check status
|
|
200
|
+
createdOn?: number; // Timestamp
|
|
201
|
+
resultSetMetaData?: { // Column metadata
|
|
202
|
+
numRows: number;
|
|
203
|
+
format: string;
|
|
204
|
+
rowType: SnowflakeColumnMetadata[];
|
|
205
|
+
partitionInfo?: SnowflakePartitionInfo[];
|
|
206
|
+
};
|
|
207
|
+
data?: (string | null)[][]; // Result rows
|
|
208
|
+
stats?: { // DML stats
|
|
209
|
+
numRowsInserted?: number;
|
|
210
|
+
numRowsUpdated?: number;
|
|
211
|
+
numRowsDeleted?: number;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Example:**
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
import { SnowflakeResourceClient } from "@major-tech/resource-client";
|
|
220
|
+
const c = new SnowflakeResourceClient({ baseUrl, applicationId, resourceId, majorJwtToken });
|
|
221
|
+
|
|
222
|
+
// Execute a query
|
|
223
|
+
const r = await c.execute(
|
|
224
|
+
"SELECT * FROM users WHERE region = ?",
|
|
225
|
+
"fetch-users",
|
|
226
|
+
{
|
|
227
|
+
bindings: { "1": { type: "TEXT", value: "US-WEST" } },
|
|
228
|
+
warehouse: "COMPUTE_WH",
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
// r.ok ? r.result.data : r.error.message
|
|
232
|
+
|
|
233
|
+
// Async execution for long-running queries
|
|
234
|
+
const async = await c.execute(
|
|
235
|
+
"INSERT INTO large_table SELECT * FROM source",
|
|
236
|
+
"bulk-insert",
|
|
237
|
+
{ async: true }
|
|
238
|
+
);
|
|
239
|
+
// async.ok ? async.result.statementHandle : async.error
|
|
240
|
+
|
|
241
|
+
// Check status of async query
|
|
242
|
+
const status = await c.status(async.result.statementHandle!, "check-status");
|
|
243
|
+
// status.result.code === "090001" means completed
|
|
244
|
+
|
|
245
|
+
// Cancel a running query
|
|
246
|
+
const cancel = await c.cancel(statementHandle, "cancel-query");
|
|
247
|
+
```
|
|
248
|
+
|
|
160
249
|
## S3ResourceClient
|
|
161
250
|
|
|
162
251
|
**Constructor:** `new S3ResourceClient(config: BaseClientConfig)`
|
|
@@ -215,7 +304,7 @@ catch (e) { if (e instanceof ResourceInvokeError) { e.message, e.httpStatus, e.r
|
|
|
215
304
|
- `npx major-client remove <name>` - Remove resource
|
|
216
305
|
- `npx major-client regenerate` - Regenerate all clients
|
|
217
306
|
|
|
218
|
-
**Types:** `database-postgresql | database-dynamodb | api-custom | api-hubspot | storage-s3`
|
|
307
|
+
**Types:** `database-postgresql | database-dynamodb | database-cosmosdb | database-snowflake | api-custom | api-hubspot | api-googlesheets | storage-s3`
|
|
219
308
|
|
|
220
309
|
**Generated Files:**
|
|
221
310
|
|
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-dynamodb | database-cosmosdb | api-hubspot | api-googlesheets | api-custom | storage-s3
|
|
11
|
+
* Types: database-postgresql | database-dynamodb | database-cosmosdb | database-snowflake | api-hubspot | api-googlesheets | api-custom | 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"
|
|
@@ -143,6 +143,7 @@ function getClientClass(type) {
|
|
|
143
143
|
'database-postgresql': 'PostgresResourceClient',
|
|
144
144
|
'database-dynamodb': 'DynamoDBResourceClient',
|
|
145
145
|
'database-cosmosdb': 'CosmosDBResourceClient',
|
|
146
|
+
'database-snowflake': 'SnowflakeResourceClient',
|
|
146
147
|
'api-custom': 'CustomApiResourceClient',
|
|
147
148
|
'api-hubspot': 'HubSpotResourceClient',
|
|
148
149
|
'api-googlesheets': 'GoogleSheetsResourceClient',
|
|
@@ -180,7 +181,7 @@ function generateIndexFile(resources) {
|
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
function addResource(resourceId, name, type, description, applicationId, framework) {
|
|
183
|
-
const validTypes = ['database-postgresql', 'database-dynamodb', 'database-cosmosdb', 'api-hubspot', 'api-googlesheets', 'api-custom', 'storage-s3'];
|
|
184
|
+
const validTypes = ['database-postgresql', 'database-dynamodb', 'database-cosmosdb', 'database-snowflake', 'api-hubspot', 'api-googlesheets', 'api-custom', 'storage-s3'];
|
|
184
185
|
if (!validTypes.includes(type)) {
|
|
185
186
|
console.error(`❌ Invalid type: ${type}`);
|
|
186
187
|
console.error(` Valid types: ${validTypes.join(', ')}`);
|
|
@@ -317,7 +318,7 @@ function main() {
|
|
|
317
318
|
console.log(' npx @major-tech/resource-client add <resource_id> <name> <type> <description> <application_id> [--framework <nextjs|vite>]');
|
|
318
319
|
console.log(' npx @major-tech/resource-client remove <name> [--framework <nextjs|vite>]');
|
|
319
320
|
console.log(' npx @major-tech/resource-client list');
|
|
320
|
-
console.log('\nTypes: database-postgresql | database-dynamodb | database-cosmosdb | api-hubspot | api-googlesheets | api-custom | storage-s3');
|
|
321
|
+
console.log('\nTypes: database-postgresql | database-dynamodb | database-cosmosdb | database-snowflake | api-hubspot | api-googlesheets | api-custom | storage-s3');
|
|
321
322
|
return;
|
|
322
323
|
}
|
|
323
324
|
|
|
@@ -0,0 +1,94 @@
|
|
|
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 snowflake_exports = {};
|
|
21
|
+
__export(snowflake_exports, {
|
|
22
|
+
SnowflakeResourceClient: () => SnowflakeResourceClient
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(snowflake_exports);
|
|
25
|
+
var import_base = require("../base");
|
|
26
|
+
class SnowflakeResourceClient extends import_base.BaseResourceClient {
|
|
27
|
+
static {
|
|
28
|
+
__name(this, "SnowflakeResourceClient");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Invoke a Snowflake operation with a raw payload
|
|
32
|
+
* @param payload The complete operation payload
|
|
33
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
34
|
+
*/
|
|
35
|
+
async invoke(payload, invocationKey) {
|
|
36
|
+
return this.invokeRaw(payload, invocationKey);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Execute a SQL statement
|
|
40
|
+
* @param statement The SQL statement to execute
|
|
41
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
42
|
+
* @param options Execution options (bindings, database overrides, async, etc.)
|
|
43
|
+
*/
|
|
44
|
+
async execute(statement, invocationKey, options = {}) {
|
|
45
|
+
const payload = {
|
|
46
|
+
type: "database",
|
|
47
|
+
subtype: "snowflake",
|
|
48
|
+
operation: "execute",
|
|
49
|
+
statement,
|
|
50
|
+
bindings: options.bindings,
|
|
51
|
+
database: options.database,
|
|
52
|
+
schema: options.schema,
|
|
53
|
+
warehouse: options.warehouse,
|
|
54
|
+
role: options.role,
|
|
55
|
+
timeout: options.timeout,
|
|
56
|
+
async: options.async,
|
|
57
|
+
parameters: options.parameters,
|
|
58
|
+
nullable: options.nullable,
|
|
59
|
+
requestId: options.requestId
|
|
60
|
+
};
|
|
61
|
+
return this.invokeRaw(payload, invocationKey);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get status or results of a statement
|
|
65
|
+
* @param statementHandle The statement handle from execute operation
|
|
66
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
67
|
+
* @param options Status options (partition for paginated results)
|
|
68
|
+
*/
|
|
69
|
+
async status(statementHandle, invocationKey, options = {}) {
|
|
70
|
+
const payload = {
|
|
71
|
+
type: "database",
|
|
72
|
+
subtype: "snowflake",
|
|
73
|
+
operation: "status",
|
|
74
|
+
statementHandle,
|
|
75
|
+
partition: options.partition
|
|
76
|
+
};
|
|
77
|
+
return this.invokeRaw(payload, invocationKey);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Cancel a running statement
|
|
81
|
+
* @param statementHandle The statement handle to cancel
|
|
82
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
83
|
+
*/
|
|
84
|
+
async cancel(statementHandle, invocationKey) {
|
|
85
|
+
const payload = {
|
|
86
|
+
type: "database",
|
|
87
|
+
subtype: "snowflake",
|
|
88
|
+
operation: "cancel",
|
|
89
|
+
statementHandle
|
|
90
|
+
};
|
|
91
|
+
return this.invokeRaw(payload, invocationKey);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=snowflake.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/clients/snowflake.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n DbSnowflakePayload,\n DbSnowflakeResult,\n SnowflakeBindingValue,\n SnowflakeSessionParameters,\n SnowflakeExecutePayload,\n SnowflakeStatusPayload,\n SnowflakeCancelPayload,\n} from \"../schemas\";\nimport type { BaseInvokeSuccess, InvokeFailure } from \"../schemas/response\";\nimport { BaseResourceClient } from \"../base\";\n\n/**\n * Response type for Snowflake operations\n */\nexport type SnowflakeInvokeResponse =\n | BaseInvokeSuccess<DbSnowflakeResult>\n | InvokeFailure;\n\n/**\n * Options for execute operation\n */\nexport interface SnowflakeExecuteOptions {\n /** Parameter bindings */\n bindings?: Record<string, SnowflakeBindingValue>;\n /** Override default database */\n database?: string;\n /** Override default schema */\n schema?: string;\n /** Override default warehouse */\n warehouse?: string;\n /** Override default role */\n role?: string;\n /** Timeout in seconds (0 = max timeout of 604800s / 7 days) */\n timeout?: number;\n /** Execute asynchronously - returns statementHandle immediately */\n async?: boolean;\n /** Session parameters for this execution */\n parameters?: SnowflakeSessionParameters;\n /** Return SQL NULL as string \"null\" instead of JSON null */\n nullable?: boolean;\n /** Request ID for idempotency (auto-generated if not provided) */\n requestId?: string;\n}\n\n/**\n * Options for status operation\n */\nexport interface SnowflakeStatusOptions {\n /** For paginated results - retrieve specific partition (0-indexed) */\n partition?: number;\n}\n\nexport class SnowflakeResourceClient extends BaseResourceClient {\n /**\n * Invoke a Snowflake operation with a raw payload\n * @param payload The complete operation payload\n * @param invocationKey Unique key for tracking this invocation\n */\n async invoke(\n payload: DbSnowflakePayload,\n invocationKey: string\n ): Promise<SnowflakeInvokeResponse> {\n return this.invokeRaw(payload, invocationKey) as Promise<SnowflakeInvokeResponse>;\n }\n\n /**\n * Execute a SQL statement\n * @param statement The SQL statement to execute\n * @param invocationKey Unique key for tracking this invocation\n * @param options Execution options (bindings, database overrides, async, etc.)\n */\n async execute(\n statement: string,\n invocationKey: string,\n options: SnowflakeExecuteOptions = {}\n ): Promise<SnowflakeInvokeResponse> {\n const payload: SnowflakeExecutePayload = {\n type: \"database\",\n subtype: \"snowflake\",\n operation: \"execute\",\n statement,\n bindings: options.bindings,\n database: options.database,\n schema: options.schema,\n warehouse: options.warehouse,\n role: options.role,\n timeout: options.timeout,\n async: options.async,\n parameters: options.parameters,\n nullable: options.nullable,\n requestId: options.requestId,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<SnowflakeInvokeResponse>;\n }\n\n /**\n * Get status or results of a statement\n * @param statementHandle The statement handle from execute operation\n * @param invocationKey Unique key for tracking this invocation\n * @param options Status options (partition for paginated results)\n */\n async status(\n statementHandle: string,\n invocationKey: string,\n options: SnowflakeStatusOptions = {}\n ): Promise<SnowflakeInvokeResponse> {\n const payload: SnowflakeStatusPayload = {\n type: \"database\",\n subtype: \"snowflake\",\n operation: \"status\",\n statementHandle,\n partition: options.partition,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<SnowflakeInvokeResponse>;\n }\n\n /**\n * Cancel a running statement\n * @param statementHandle The statement handle to cancel\n * @param invocationKey Unique key for tracking this invocation\n */\n async cancel(\n statementHandle: string,\n invocationKey: string\n ): Promise<SnowflakeInvokeResponse> {\n const payload: SnowflakeCancelPayload = {\n type: \"database\",\n subtype: \"snowflake\",\n operation: \"cancel\",\n statementHandle,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<SnowflakeInvokeResponse>;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAUA;;;;;AAAA,kBAAmC;AA2C7B,MAAO,gCAAgC,+BAAkB;EA3C/D,OA2C+D;;;;;;;;EAM7D,MAAM,OACJ,SACA,eAAqB;AAErB,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;EAQA,MAAM,QACJ,WACA,eACA,UAAmC,CAAA,GAAE;AAErC,UAAM,UAAmC;MACvC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA,UAAU,QAAQ;MAClB,UAAU,QAAQ;MAClB,QAAQ,QAAQ;MAChB,WAAW,QAAQ;MACnB,MAAM,QAAQ;MACd,SAAS,QAAQ;MACjB,OAAO,QAAQ;MACf,YAAY,QAAQ;MACpB,UAAU,QAAQ;MAClB,WAAW,QAAQ;;AAGrB,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;EAQA,MAAM,OACJ,iBACA,eACA,UAAkC,CAAA,GAAE;AAEpC,UAAM,UAAkC;MACtC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA,WAAW,QAAQ;;AAGrB,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;EAOA,MAAM,OACJ,iBACA,eAAqB;AAErB,UAAM,UAAkC;MACtC,MAAM;MACN,SAAS;MACT,WAAW;MACX;;AAGF,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { DbSnowflakePayload, DbSnowflakeResult, SnowflakeBindingValue, SnowflakeSessionParameters } from "../schemas";
|
|
2
|
+
import type { BaseInvokeSuccess, InvokeFailure } from "../schemas/response";
|
|
3
|
+
import { BaseResourceClient } from "../base";
|
|
4
|
+
/**
|
|
5
|
+
* Response type for Snowflake operations
|
|
6
|
+
*/
|
|
7
|
+
export type SnowflakeInvokeResponse = BaseInvokeSuccess<DbSnowflakeResult> | InvokeFailure;
|
|
8
|
+
/**
|
|
9
|
+
* Options for execute operation
|
|
10
|
+
*/
|
|
11
|
+
export interface SnowflakeExecuteOptions {
|
|
12
|
+
/** Parameter bindings */
|
|
13
|
+
bindings?: Record<string, SnowflakeBindingValue>;
|
|
14
|
+
/** Override default database */
|
|
15
|
+
database?: string;
|
|
16
|
+
/** Override default schema */
|
|
17
|
+
schema?: string;
|
|
18
|
+
/** Override default warehouse */
|
|
19
|
+
warehouse?: string;
|
|
20
|
+
/** Override default role */
|
|
21
|
+
role?: string;
|
|
22
|
+
/** Timeout in seconds (0 = max timeout of 604800s / 7 days) */
|
|
23
|
+
timeout?: number;
|
|
24
|
+
/** Execute asynchronously - returns statementHandle immediately */
|
|
25
|
+
async?: boolean;
|
|
26
|
+
/** Session parameters for this execution */
|
|
27
|
+
parameters?: SnowflakeSessionParameters;
|
|
28
|
+
/** Return SQL NULL as string "null" instead of JSON null */
|
|
29
|
+
nullable?: boolean;
|
|
30
|
+
/** Request ID for idempotency (auto-generated if not provided) */
|
|
31
|
+
requestId?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Options for status operation
|
|
35
|
+
*/
|
|
36
|
+
export interface SnowflakeStatusOptions {
|
|
37
|
+
/** For paginated results - retrieve specific partition (0-indexed) */
|
|
38
|
+
partition?: number;
|
|
39
|
+
}
|
|
40
|
+
export declare class SnowflakeResourceClient extends BaseResourceClient {
|
|
41
|
+
/**
|
|
42
|
+
* Invoke a Snowflake operation with a raw payload
|
|
43
|
+
* @param payload The complete operation payload
|
|
44
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
45
|
+
*/
|
|
46
|
+
invoke(payload: DbSnowflakePayload, invocationKey: string): Promise<SnowflakeInvokeResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Execute a SQL statement
|
|
49
|
+
* @param statement The SQL statement to execute
|
|
50
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
51
|
+
* @param options Execution options (bindings, database overrides, async, etc.)
|
|
52
|
+
*/
|
|
53
|
+
execute(statement: string, invocationKey: string, options?: SnowflakeExecuteOptions): Promise<SnowflakeInvokeResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Get status or results of a statement
|
|
56
|
+
* @param statementHandle The statement handle from execute operation
|
|
57
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
58
|
+
* @param options Status options (partition for paginated results)
|
|
59
|
+
*/
|
|
60
|
+
status(statementHandle: string, invocationKey: string, options?: SnowflakeStatusOptions): Promise<SnowflakeInvokeResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Cancel a running statement
|
|
63
|
+
* @param statementHandle The statement handle to cancel
|
|
64
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
65
|
+
*/
|
|
66
|
+
cancel(statementHandle: string, invocationKey: string): Promise<SnowflakeInvokeResponse>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=snowflake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snowflake.d.ts","sourceRoot":"","sources":["../../src/clients/snowflake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAI3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,iBAAiB,CAAC,iBAAiB,CAAC,GACpC,aAAa,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACjD,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,0BAA0B,CAAC;IACxC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D;;;;OAIG;IACG,MAAM,CACV,OAAO,EAAE,kBAAkB,EAC3B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,uBAAuB,CAAC;IAInC;;;;;OAKG;IACG,OAAO,CACX,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,uBAAuB,CAAC;IAqBnC;;;;;OAKG;IACG,MAAM,CACV,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,uBAAuB,CAAC;IAYnC;;;;OAIG;IACG,MAAM,CACV,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,uBAAuB,CAAC;CAUpC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { BaseResourceClient } from "../base";
|
|
2
|
+
export class SnowflakeResourceClient extends BaseResourceClient {
|
|
3
|
+
/**
|
|
4
|
+
* Invoke a Snowflake operation with a raw payload
|
|
5
|
+
* @param payload The complete operation payload
|
|
6
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
7
|
+
*/
|
|
8
|
+
async invoke(payload, invocationKey) {
|
|
9
|
+
return this.invokeRaw(payload, invocationKey);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Execute a SQL statement
|
|
13
|
+
* @param statement The SQL statement to execute
|
|
14
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
15
|
+
* @param options Execution options (bindings, database overrides, async, etc.)
|
|
16
|
+
*/
|
|
17
|
+
async execute(statement, invocationKey, options = {}) {
|
|
18
|
+
const payload = {
|
|
19
|
+
type: "database",
|
|
20
|
+
subtype: "snowflake",
|
|
21
|
+
operation: "execute",
|
|
22
|
+
statement,
|
|
23
|
+
bindings: options.bindings,
|
|
24
|
+
database: options.database,
|
|
25
|
+
schema: options.schema,
|
|
26
|
+
warehouse: options.warehouse,
|
|
27
|
+
role: options.role,
|
|
28
|
+
timeout: options.timeout,
|
|
29
|
+
async: options.async,
|
|
30
|
+
parameters: options.parameters,
|
|
31
|
+
nullable: options.nullable,
|
|
32
|
+
requestId: options.requestId,
|
|
33
|
+
};
|
|
34
|
+
return this.invokeRaw(payload, invocationKey);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get status or results of a statement
|
|
38
|
+
* @param statementHandle The statement handle from execute operation
|
|
39
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
40
|
+
* @param options Status options (partition for paginated results)
|
|
41
|
+
*/
|
|
42
|
+
async status(statementHandle, invocationKey, options = {}) {
|
|
43
|
+
const payload = {
|
|
44
|
+
type: "database",
|
|
45
|
+
subtype: "snowflake",
|
|
46
|
+
operation: "status",
|
|
47
|
+
statementHandle,
|
|
48
|
+
partition: options.partition,
|
|
49
|
+
};
|
|
50
|
+
return this.invokeRaw(payload, invocationKey);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Cancel a running statement
|
|
54
|
+
* @param statementHandle The statement handle to cancel
|
|
55
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
56
|
+
*/
|
|
57
|
+
async cancel(statementHandle, invocationKey) {
|
|
58
|
+
const payload = {
|
|
59
|
+
type: "database",
|
|
60
|
+
subtype: "snowflake",
|
|
61
|
+
operation: "cancel",
|
|
62
|
+
statementHandle,
|
|
63
|
+
};
|
|
64
|
+
return this.invokeRaw(payload, invocationKey);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=snowflake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snowflake.js","sourceRoot":"","sources":["../../src/clients/snowflake.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA2C7C,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;IAC7D;;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ChB,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,QAAQ;YACnB,eAAe;SAChB,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAqC,CAAC;IACpF,CAAC;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -27,7 +27,8 @@ __export(index_exports, {
|
|
|
27
27
|
HubSpotResourceClient: () => import_hubspot.HubSpotResourceClient,
|
|
28
28
|
PostgresResourceClient: () => import_postgres.PostgresResourceClient,
|
|
29
29
|
ResourceInvokeError: () => import_errors.ResourceInvokeError,
|
|
30
|
-
S3ResourceClient: () => import_s3.S3ResourceClient
|
|
30
|
+
S3ResourceClient: () => import_s3.S3ResourceClient,
|
|
31
|
+
SnowflakeResourceClient: () => import_snowflake.SnowflakeResourceClient
|
|
31
32
|
});
|
|
32
33
|
module.exports = __toCommonJS(index_exports);
|
|
33
34
|
__reExport(index_exports, require("./schemas"), module.exports);
|
|
@@ -36,6 +37,7 @@ var import_errors = require("./errors");
|
|
|
36
37
|
var import_postgres = require("./clients/postgres");
|
|
37
38
|
var import_dynamodb = require("./clients/dynamodb");
|
|
38
39
|
var import_cosmosdb = require("./clients/cosmosdb");
|
|
40
|
+
var import_snowflake = require("./clients/snowflake");
|
|
39
41
|
var import_api_custom = require("./clients/api-custom");
|
|
40
42
|
var import_hubspot = require("./clients/hubspot");
|
|
41
43
|
var import_googlesheets = require("./clients/googlesheets");
|
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 { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CosmosDBResourceClient } from \"./clients/cosmosdb\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n CosmosDBInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\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 { 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 { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n CosmosDBInvokeResponse,\n SnowflakeInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AACA,0BAAc,sBADd;AAIA,kBAA0D;AAG1D,oBAAoC;AAGpC,sBAAuC;AACvC,sBAAuC;AACvC,sBAAuC;AACvC,uBAAwC;AACxC,wBAAwC;AACxC,qBAAsC;AACtC,0BAA2C;AAC3C,gBAAiC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ export { ResourceInvokeError } from "./errors";
|
|
|
4
4
|
export { PostgresResourceClient } from "./clients/postgres";
|
|
5
5
|
export { DynamoDBResourceClient } from "./clients/dynamodb";
|
|
6
6
|
export { CosmosDBResourceClient } from "./clients/cosmosdb";
|
|
7
|
+
export { SnowflakeResourceClient } from "./clients/snowflake";
|
|
7
8
|
export { CustomApiResourceClient } from "./clients/api-custom";
|
|
8
9
|
export { HubSpotResourceClient } from "./clients/hubspot";
|
|
9
10
|
export { GoogleSheetsResourceClient } from "./clients/googlesheets";
|
|
10
11
|
export { S3ResourceClient } from "./clients/s3";
|
|
11
|
-
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
12
|
+
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
12
13
|
//# 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,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,oBAAoB,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,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,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { ResourceInvokeError } from "./errors";
|
|
|
8
8
|
export { PostgresResourceClient } from "./clients/postgres";
|
|
9
9
|
export { DynamoDBResourceClient } from "./clients/dynamodb";
|
|
10
10
|
export { CosmosDBResourceClient } from "./clients/cosmosdb";
|
|
11
|
+
export { SnowflakeResourceClient } from "./clients/snowflake";
|
|
11
12
|
export { CustomApiResourceClient } from "./clients/api-custom";
|
|
12
13
|
export { HubSpotResourceClient } from "./clients/hubspot";
|
|
13
14
|
export { GoogleSheetsResourceClient } from "./clients/googlesheets";
|
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,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,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,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,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/schemas/index.cjs
CHANGED
|
@@ -19,6 +19,7 @@ __reExport(index_exports, require("./common"), module.exports);
|
|
|
19
19
|
__reExport(index_exports, require("./postgres"), module.exports);
|
|
20
20
|
__reExport(index_exports, require("./dynamodb"), module.exports);
|
|
21
21
|
__reExport(index_exports, require("./cosmosdb"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./snowflake"), module.exports);
|
|
22
23
|
__reExport(index_exports, require("./s3"), module.exports);
|
|
23
24
|
__reExport(index_exports, require("./api-custom"), module.exports);
|
|
24
25
|
__reExport(index_exports, require("./api-hubspot"), module.exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/schemas/index.ts"],
|
|
4
|
-
"sourcesContent": ["// Re-export all types\nexport * from \"./common\";\nexport * from \"./postgres\";\nexport * from \"./dynamodb\";\nexport * from \"./cosmosdb\";\nexport * from \"./s3\";\nexport * from \"./api-custom\";\nexport * from \"./api-hubspot\";\nexport * from \"./api-googlesheets\";\nexport * from \"./request\";\nexport * from \"./response\";\n\n// Import for discriminated union\nimport type { ApiCustomPayload } from \"./api-custom\";\nimport type { ApiHubSpotPayload } from \"./api-hubspot\";\nimport type { ApiGoogleSheetsPayload } from \"./api-googlesheets\";\nimport type { DbPostgresPayload } from \"./postgres\";\nimport type { DbDynamoDBPayload } from \"./dynamodb\";\nimport type { DbCosmosDBPayload } from \"./cosmosdb\";\nimport type { StorageS3Payload } from \"./s3\";\n\n/**\n * Discriminated union of all resource payload types\n * Use the 'subtype' field to narrow the type\n */\nexport type ResourceInvokePayload =\n | ApiCustomPayload\n | DbPostgresPayload\n | DbDynamoDBPayload\n | DbCosmosDBPayload\n | ApiHubSpotPayload\n | ApiGoogleSheetsPayload\n | StorageS3Payload;\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,uBAHd;AAIA,0BAAc,uBAJd;AAKA,0BAAc,
|
|
4
|
+
"sourcesContent": ["// Re-export all types\nexport * from \"./common\";\nexport * from \"./postgres\";\nexport * from \"./dynamodb\";\nexport * from \"./cosmosdb\";\nexport * from \"./snowflake\";\nexport * from \"./s3\";\nexport * from \"./api-custom\";\nexport * from \"./api-hubspot\";\nexport * from \"./api-googlesheets\";\nexport * from \"./request\";\nexport * from \"./response\";\n\n// Import for discriminated union\nimport type { ApiCustomPayload } from \"./api-custom\";\nimport type { ApiHubSpotPayload } from \"./api-hubspot\";\nimport type { ApiGoogleSheetsPayload } from \"./api-googlesheets\";\nimport type { DbPostgresPayload } from \"./postgres\";\nimport type { DbDynamoDBPayload } from \"./dynamodb\";\nimport type { DbCosmosDBPayload } from \"./cosmosdb\";\nimport type { DbSnowflakePayload } from \"./snowflake\";\nimport type { StorageS3Payload } from \"./s3\";\n\n/**\n * Discriminated union of all resource payload types\n * Use the 'subtype' field to narrow the type\n */\nexport type ResourceInvokePayload =\n | ApiCustomPayload\n | DbPostgresPayload\n | DbDynamoDBPayload\n | DbCosmosDBPayload\n | DbSnowflakePayload\n | ApiHubSpotPayload\n | ApiGoogleSheetsPayload\n | StorageS3Payload;\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,uBAHd;AAIA,0BAAc,uBAJd;AAKA,0BAAc,wBALd;AAMA,0BAAc,iBANd;AAOA,0BAAc,yBAPd;AAQA,0BAAc,0BARd;AASA,0BAAc,+BATd;AAUA,0BAAc,sBAVd;AAWA,0BAAc,uBAXd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./common";
|
|
|
2
2
|
export * from "./postgres";
|
|
3
3
|
export * from "./dynamodb";
|
|
4
4
|
export * from "./cosmosdb";
|
|
5
|
+
export * from "./snowflake";
|
|
5
6
|
export * from "./s3";
|
|
6
7
|
export * from "./api-custom";
|
|
7
8
|
export * from "./api-hubspot";
|
|
@@ -14,10 +15,11 @@ import type { ApiGoogleSheetsPayload } from "./api-googlesheets";
|
|
|
14
15
|
import type { DbPostgresPayload } from "./postgres";
|
|
15
16
|
import type { DbDynamoDBPayload } from "./dynamodb";
|
|
16
17
|
import type { DbCosmosDBPayload } from "./cosmosdb";
|
|
18
|
+
import type { DbSnowflakePayload } from "./snowflake";
|
|
17
19
|
import type { StorageS3Payload } from "./s3";
|
|
18
20
|
/**
|
|
19
21
|
* Discriminated union of all resource payload types
|
|
20
22
|
* Use the 'subtype' field to narrow the type
|
|
21
23
|
*/
|
|
22
|
-
export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbDynamoDBPayload | DbCosmosDBPayload | ApiHubSpotPayload | ApiGoogleSheetsPayload | StorageS3Payload;
|
|
24
|
+
export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbDynamoDBPayload | DbCosmosDBPayload | DbSnowflakePayload | ApiHubSpotPayload | ApiGoogleSheetsPayload | StorageS3Payload;
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,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oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAC7B,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,sBAAsB,GACtB,gBAAgB,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -3,10 +3,11 @@ import type { DbResult } from "./postgres";
|
|
|
3
3
|
import type { StorageS3Result } from "./s3";
|
|
4
4
|
import type { DbDynamoDBResult } from "./dynamodb";
|
|
5
5
|
import type { DbCosmosDBResult, DbCosmosDBResultGeneric } from "./cosmosdb";
|
|
6
|
+
import type { DbSnowflakeResult } from "./snowflake";
|
|
6
7
|
/**
|
|
7
8
|
* Union of all possible resource invocation result types
|
|
8
9
|
*/
|
|
9
|
-
export type ResourceInvokeSuccess = ApiResult | DbResult | StorageS3Result | DbDynamoDBResult | DbCosmosDBResult;
|
|
10
|
+
export type ResourceInvokeSuccess = ApiResult | DbResult | StorageS3Result | DbDynamoDBResult | DbCosmosDBResult | DbSnowflakeResult;
|
|
10
11
|
/**
|
|
11
12
|
* Base successful invocation response - generic over result type
|
|
12
13
|
*/
|
|
@@ -58,4 +59,8 @@ export type DynamoDBInvokeResponse = BaseInvokeSuccess<DbDynamoDBResult> | Invok
|
|
|
58
59
|
* Response from CosmosDB database resource invocation (generic for typed documents)
|
|
59
60
|
*/
|
|
60
61
|
export type CosmosDBInvokeResponse<T = Record<string, unknown>> = BaseInvokeSuccess<DbCosmosDBResultGeneric<T>> | InvokeFailure;
|
|
62
|
+
/**
|
|
63
|
+
* Response from Snowflake database resource invocation
|
|
64
|
+
*/
|
|
65
|
+
export type SnowflakeInvokeResponse = BaseInvokeSuccess<DbSnowflakeResult> | InvokeFailure;
|
|
61
66
|
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/schemas/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC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CAAC,GAAG,aAAa,CAAC;AAEjF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,aAAa,CAAC;AAEzF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAC1D,iBAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,GAC7C,aAAa,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var snowflake_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(snowflake_exports);
|
|
17
|
+
//# sourceMappingURL=snowflake.cjs.map
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snowflake binding value types matching Snowflake's supported types
|
|
3
|
+
*/
|
|
4
|
+
export interface SnowflakeBindingValue {
|
|
5
|
+
type: "TEXT" | "FIXED" | "REAL" | "BOOLEAN" | "DATE" | "TIME" | "TIMESTAMP_LTZ" | "TIMESTAMP_NTZ" | "TIMESTAMP_TZ" | "BINARY" | "ARRAY" | "OBJECT" | "VARIANT";
|
|
6
|
+
value: string | number | boolean | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Snowflake session parameters for query execution
|
|
10
|
+
*/
|
|
11
|
+
export interface SnowflakeSessionParameters {
|
|
12
|
+
binary_output_format?: "HEX" | "BASE64";
|
|
13
|
+
date_output_format?: string;
|
|
14
|
+
time_output_format?: string;
|
|
15
|
+
timestamp_ltz_output_format?: string;
|
|
16
|
+
timestamp_ntz_output_format?: string;
|
|
17
|
+
timestamp_tz_output_format?: string;
|
|
18
|
+
timestamp_output_format?: string;
|
|
19
|
+
timezone?: string;
|
|
20
|
+
query_tag?: string;
|
|
21
|
+
rows_per_resultset?: number;
|
|
22
|
+
use_cached_result?: boolean;
|
|
23
|
+
client_result_chunk_size?: number;
|
|
24
|
+
/** For multi-statement execution (0 = variable count, 1 = single, >1 = exact count) */
|
|
25
|
+
multi_statement_count?: string;
|
|
26
|
+
/** Additional parameters */
|
|
27
|
+
[key: string]: string | number | boolean | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Execute operation payload - submit a SQL statement
|
|
31
|
+
*/
|
|
32
|
+
export interface SnowflakeExecutePayload {
|
|
33
|
+
type: "database";
|
|
34
|
+
subtype: "snowflake";
|
|
35
|
+
operation: "execute";
|
|
36
|
+
/** SQL statement to execute */
|
|
37
|
+
statement: string;
|
|
38
|
+
/** Parameter bindings */
|
|
39
|
+
bindings?: Record<string, SnowflakeBindingValue>;
|
|
40
|
+
/** Override default database */
|
|
41
|
+
database?: string;
|
|
42
|
+
/** Override default schema */
|
|
43
|
+
schema?: string;
|
|
44
|
+
/** Override default warehouse */
|
|
45
|
+
warehouse?: string;
|
|
46
|
+
/** Override default role */
|
|
47
|
+
role?: string;
|
|
48
|
+
/** Timeout in seconds (0 = max timeout of 604800s / 7 days) */
|
|
49
|
+
timeout?: number;
|
|
50
|
+
/** Execute asynchronously - returns statementHandle immediately */
|
|
51
|
+
async?: boolean;
|
|
52
|
+
/** Session parameters for this execution */
|
|
53
|
+
parameters?: SnowflakeSessionParameters;
|
|
54
|
+
/** Return SQL NULL as string "null" instead of JSON null */
|
|
55
|
+
nullable?: boolean;
|
|
56
|
+
/** Request ID for idempotency (auto-generated if not provided) */
|
|
57
|
+
requestId?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Status operation payload - get status/results of a running query
|
|
61
|
+
*/
|
|
62
|
+
export interface SnowflakeStatusPayload {
|
|
63
|
+
type: "database";
|
|
64
|
+
subtype: "snowflake";
|
|
65
|
+
operation: "status";
|
|
66
|
+
/** Statement handle from execute operation */
|
|
67
|
+
statementHandle: string;
|
|
68
|
+
/** For paginated results - retrieve specific partition (0-indexed) */
|
|
69
|
+
partition?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Cancel operation payload - cancel a running query
|
|
73
|
+
*/
|
|
74
|
+
export interface SnowflakeCancelPayload {
|
|
75
|
+
type: "database";
|
|
76
|
+
subtype: "snowflake";
|
|
77
|
+
operation: "cancel";
|
|
78
|
+
/** Statement handle to cancel */
|
|
79
|
+
statementHandle: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Discriminated union of all Snowflake operation payloads
|
|
83
|
+
*/
|
|
84
|
+
export type DbSnowflakePayload = SnowflakeExecutePayload | SnowflakeStatusPayload | SnowflakeCancelPayload;
|
|
85
|
+
/**
|
|
86
|
+
* Column metadata from Snowflake result set
|
|
87
|
+
*/
|
|
88
|
+
export interface SnowflakeColumnMetadata {
|
|
89
|
+
name: string;
|
|
90
|
+
type: string;
|
|
91
|
+
length?: number | null;
|
|
92
|
+
precision?: number | null;
|
|
93
|
+
scale?: number | null;
|
|
94
|
+
nullable: boolean;
|
|
95
|
+
byteLength?: number | null;
|
|
96
|
+
collation?: string | null;
|
|
97
|
+
database?: string;
|
|
98
|
+
schema?: string;
|
|
99
|
+
table?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Partition info for large result sets
|
|
103
|
+
*/
|
|
104
|
+
export interface SnowflakePartitionInfo {
|
|
105
|
+
rowCount: number;
|
|
106
|
+
uncompressedSize: number;
|
|
107
|
+
compressedSize?: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Result set metadata
|
|
111
|
+
*/
|
|
112
|
+
export interface SnowflakeResultSetMetadata {
|
|
113
|
+
numRows: number;
|
|
114
|
+
format: string;
|
|
115
|
+
rowType: SnowflakeColumnMetadata[];
|
|
116
|
+
partitionInfo?: SnowflakePartitionInfo[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* DML statistics
|
|
120
|
+
*/
|
|
121
|
+
export interface SnowflakeStats {
|
|
122
|
+
numRowsInserted?: number;
|
|
123
|
+
numRowsUpdated?: number;
|
|
124
|
+
numRowsDeleted?: number;
|
|
125
|
+
numDuplicateRowsUpdated?: number;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Result from a Snowflake operation
|
|
129
|
+
* This is a thin passthrough of Snowflake's SQL API response with `kind` added
|
|
130
|
+
*/
|
|
131
|
+
export interface DbSnowflakeResult {
|
|
132
|
+
kind: "snowflake";
|
|
133
|
+
/** Snowflake response code */
|
|
134
|
+
code?: string;
|
|
135
|
+
/** Response message */
|
|
136
|
+
message: string;
|
|
137
|
+
/** SQL state code for errors */
|
|
138
|
+
sqlState?: string;
|
|
139
|
+
/** Handle for the executed statement */
|
|
140
|
+
statementHandle?: string;
|
|
141
|
+
/** Handles for multi-statement execution */
|
|
142
|
+
statementHandles?: string[];
|
|
143
|
+
/** URL to check statement status */
|
|
144
|
+
statementStatusUrl?: string;
|
|
145
|
+
/** Timestamp when statement was created */
|
|
146
|
+
createdOn?: number;
|
|
147
|
+
/** Metadata about the result set */
|
|
148
|
+
resultSetMetaData?: SnowflakeResultSetMetadata;
|
|
149
|
+
/** Result data as array of arrays (each inner array is a row) */
|
|
150
|
+
data?: (string | null)[][];
|
|
151
|
+
/** DML operation statistics */
|
|
152
|
+
stats?: SnowflakeStats;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=snowflake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snowflake.d.ts","sourceRoot":"","sources":["../../src/schemas/snowflake.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EACA,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,GACT,MAAM,GACN,MAAM,GACN,eAAe,GACf,eAAe,GACf,cAAc,GACd,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IA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,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,oCAAoC;IACpC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,0BAA0B,CAAC;IAC/C,iEAAiE;IACjE,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snowflake.js","sourceRoot":"","sources":["../../src/schemas/snowflake.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED