@major-tech/resource-client 0.2.8 → 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/cosmosdb.cjs +16 -18
- package/dist/clients/cosmosdb.cjs.map +2 -2
- package/dist/clients/cosmosdb.d.ts +16 -14
- package/dist/clients/cosmosdb.d.ts.map +1 -1
- package/dist/clients/cosmosdb.js +16 -18
- package/dist/clients/cosmosdb.js.map +1 -1
- 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
|
|
|
@@ -61,18 +61,17 @@ class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
|
61
61
|
* Read a single document by ID
|
|
62
62
|
* @param container The container name
|
|
63
63
|
* @param id The document ID
|
|
64
|
-
* @param partitionKey The partition key value
|
|
65
64
|
* @param invocationKey Unique key for tracking this invocation
|
|
66
|
-
* @param options Additional options
|
|
65
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
67
66
|
*/
|
|
68
|
-
async read(container, id,
|
|
67
|
+
async read(container, id, invocationKey, options) {
|
|
69
68
|
const payload = {
|
|
70
69
|
type: "database",
|
|
71
70
|
subtype: "cosmosdb",
|
|
72
71
|
operation: "read",
|
|
73
72
|
container,
|
|
74
73
|
id,
|
|
75
|
-
partitionKey,
|
|
74
|
+
partitionKey: options?.partitionKey,
|
|
76
75
|
timeoutMs: options?.timeoutMs
|
|
77
76
|
};
|
|
78
77
|
return this.invokeRaw(payload, invocationKey);
|
|
@@ -82,7 +81,7 @@ class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
|
82
81
|
* @param container The container name
|
|
83
82
|
* @param body The document body (must include id and partition key properties)
|
|
84
83
|
* @param invocationKey Unique key for tracking this invocation
|
|
85
|
-
* @param options Additional options
|
|
84
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
86
85
|
*/
|
|
87
86
|
async create(container, body, invocationKey, options) {
|
|
88
87
|
const payload = {
|
|
@@ -91,6 +90,7 @@ class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
|
91
90
|
operation: "create",
|
|
92
91
|
container,
|
|
93
92
|
body,
|
|
93
|
+
partitionKey: options?.partitionKey,
|
|
94
94
|
timeoutMs: options?.timeoutMs
|
|
95
95
|
};
|
|
96
96
|
return this.invokeRaw(payload, invocationKey);
|
|
@@ -99,19 +99,18 @@ class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
|
99
99
|
* Replace an existing document
|
|
100
100
|
* @param container The container name
|
|
101
101
|
* @param id The document ID
|
|
102
|
-
* @param partitionKey The partition key value
|
|
103
102
|
* @param body The new document body
|
|
104
103
|
* @param invocationKey Unique key for tracking this invocation
|
|
105
|
-
* @param options Additional options
|
|
104
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
106
105
|
*/
|
|
107
|
-
async replace(container, id,
|
|
106
|
+
async replace(container, id, body, invocationKey, options) {
|
|
108
107
|
const payload = {
|
|
109
108
|
type: "database",
|
|
110
109
|
subtype: "cosmosdb",
|
|
111
110
|
operation: "replace",
|
|
112
111
|
container,
|
|
113
112
|
id,
|
|
114
|
-
partitionKey,
|
|
113
|
+
partitionKey: options?.partitionKey,
|
|
115
114
|
body,
|
|
116
115
|
timeoutMs: options?.timeoutMs
|
|
117
116
|
};
|
|
@@ -122,7 +121,7 @@ class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
|
122
121
|
* @param container The container name
|
|
123
122
|
* @param body The document body (must include id and partition key properties)
|
|
124
123
|
* @param invocationKey Unique key for tracking this invocation
|
|
125
|
-
* @param options Additional options
|
|
124
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
126
125
|
*/
|
|
127
126
|
async upsert(container, body, invocationKey, options) {
|
|
128
127
|
const payload = {
|
|
@@ -131,6 +130,7 @@ class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
|
131
130
|
operation: "upsert",
|
|
132
131
|
container,
|
|
133
132
|
body,
|
|
133
|
+
partitionKey: options?.partitionKey,
|
|
134
134
|
timeoutMs: options?.timeoutMs
|
|
135
135
|
};
|
|
136
136
|
return this.invokeRaw(payload, invocationKey);
|
|
@@ -139,18 +139,17 @@ class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
|
139
139
|
* Delete a document
|
|
140
140
|
* @param container The container name
|
|
141
141
|
* @param id The document ID
|
|
142
|
-
* @param partitionKey The partition key value
|
|
143
142
|
* @param invocationKey Unique key for tracking this invocation
|
|
144
|
-
* @param options Additional options
|
|
143
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
145
144
|
*/
|
|
146
|
-
async delete(container, id,
|
|
145
|
+
async delete(container, id, invocationKey, options) {
|
|
147
146
|
const payload = {
|
|
148
147
|
type: "database",
|
|
149
148
|
subtype: "cosmosdb",
|
|
150
149
|
operation: "delete",
|
|
151
150
|
container,
|
|
152
151
|
id,
|
|
153
|
-
partitionKey,
|
|
152
|
+
partitionKey: options?.partitionKey,
|
|
154
153
|
timeoutMs: options?.timeoutMs
|
|
155
154
|
};
|
|
156
155
|
return this.invokeRaw(payload, invocationKey);
|
|
@@ -159,19 +158,18 @@ class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
|
159
158
|
* Patch a document with partial updates
|
|
160
159
|
* @param container The container name
|
|
161
160
|
* @param id The document ID
|
|
162
|
-
* @param partitionKey The partition key value
|
|
163
161
|
* @param patchOperations Array of patch operations
|
|
164
162
|
* @param invocationKey Unique key for tracking this invocation
|
|
165
|
-
* @param options Additional options (condition, timeoutMs)
|
|
163
|
+
* @param options Additional options (partitionKey, condition, timeoutMs)
|
|
166
164
|
*/
|
|
167
|
-
async patch(container, id,
|
|
165
|
+
async patch(container, id, patchOperations, invocationKey, options) {
|
|
168
166
|
const payload = {
|
|
169
167
|
type: "database",
|
|
170
168
|
subtype: "cosmosdb",
|
|
171
169
|
operation: "patch",
|
|
172
170
|
container,
|
|
173
171
|
id,
|
|
174
|
-
partitionKey,
|
|
172
|
+
partitionKey: options?.partitionKey,
|
|
175
173
|
patchOperations,
|
|
176
174
|
condition: options?.condition,
|
|
177
175
|
timeoutMs: options?.timeoutMs
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/clients/cosmosdb.ts"],
|
|
4
|
-
"sourcesContent": ["import type {\n DbCosmosDBPayload,\n CosmosValue,\n PartitionKey,\n CosmosQueryParameter,\n CosmosPatchOperation,\n CosmosQueryResult,\n CosmosReadResult,\n CosmosCreateResult,\n CosmosReplaceResult,\n CosmosUpsertResult,\n CosmosDeleteResult,\n CosmosPatchResult,\n DbCosmosDBResultGeneric,\n} from \"../schemas\";\nimport type { BaseInvokeSuccess, InvokeFailure } from \"../schemas/response\";\nimport { BaseResourceClient } from \"../base\";\n\nexport class CosmosDBResourceClient extends BaseResourceClient {\n /**\n * Invoke a CosmosDB 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<T = Record<string, unknown>>(\n payload: DbCosmosDBPayload,\n invocationKey: string\n ): Promise<BaseInvokeSuccess<DbCosmosDBResultGeneric<T>> | InvokeFailure> {\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<DbCosmosDBResultGeneric<T>> | InvokeFailure\n >;\n }\n\n /**\n * Execute a SQL query against a container\n * @param container The container name\n * @param query The SQL query string\n * @param invocationKey Unique key for tracking this invocation\n * @param options Query options (parameters, partitionKey, pagination)\n */\n async query<T = Record<string, unknown>>(\n container: string,\n query: string,\n invocationKey: string,\n options?: {\n parameters?: CosmosQueryParameter[];\n partitionKey?: PartitionKey;\n maxItemCount?: number;\n continuationToken?: string;\n timeoutMs?: number;\n }\n ): Promise<BaseInvokeSuccess<CosmosQueryResult<T>> | InvokeFailure> {\n const payload: DbCosmosDBPayload = {\n type: \"database\",\n subtype: \"cosmosdb\",\n operation: \"query\",\n container,\n query,\n parameters: options?.parameters,\n partitionKey: options?.partitionKey,\n maxItemCount: options?.maxItemCount,\n continuationToken: options?.continuationToken,\n timeoutMs: options?.timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<CosmosQueryResult<T>> | InvokeFailure\n >;\n }\n\n /**\n * Read a single document by ID\n * @param container The container name\n * @param id The document ID\n * @param
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAgBA;;;;;AAAA,kBAAmC;AAE7B,MAAO,+BAA+B,+BAAkB;EAF9D,OAE8D;;;;;;;;EAM5D,MAAM,OACJ,SACA,eAAqB;AAErB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;EASA,MAAM,MACJ,WACA,OACA,eACA,SAMC;AAED,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA,YAAY,SAAS;MACrB,cAAc,SAAS;MACvB,cAAc,SAAS;MACvB,mBAAmB,SAAS;MAC5B,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C
|
|
4
|
+
"sourcesContent": ["import type {\n DbCosmosDBPayload,\n CosmosValue,\n PartitionKey,\n CosmosQueryParameter,\n CosmosPatchOperation,\n CosmosQueryResult,\n CosmosReadResult,\n CosmosCreateResult,\n CosmosReplaceResult,\n CosmosUpsertResult,\n CosmosDeleteResult,\n CosmosPatchResult,\n DbCosmosDBResultGeneric,\n} from \"../schemas\";\nimport type { BaseInvokeSuccess, InvokeFailure } from \"../schemas/response\";\nimport { BaseResourceClient } from \"../base\";\n\nexport class CosmosDBResourceClient extends BaseResourceClient {\n /**\n * Invoke a CosmosDB 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<T = Record<string, unknown>>(\n payload: DbCosmosDBPayload,\n invocationKey: string\n ): Promise<BaseInvokeSuccess<DbCosmosDBResultGeneric<T>> | InvokeFailure> {\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<DbCosmosDBResultGeneric<T>> | InvokeFailure\n >;\n }\n\n /**\n * Execute a SQL query against a container\n * @param container The container name\n * @param query The SQL query string\n * @param invocationKey Unique key for tracking this invocation\n * @param options Query options (parameters, partitionKey, pagination)\n */\n async query<T = Record<string, unknown>>(\n container: string,\n query: string,\n invocationKey: string,\n options?: {\n parameters?: CosmosQueryParameter[];\n partitionKey?: PartitionKey;\n maxItemCount?: number;\n continuationToken?: string;\n timeoutMs?: number;\n }\n ): Promise<BaseInvokeSuccess<CosmosQueryResult<T>> | InvokeFailure> {\n const payload: DbCosmosDBPayload = {\n type: \"database\",\n subtype: \"cosmosdb\",\n operation: \"query\",\n container,\n query,\n parameters: options?.parameters,\n partitionKey: options?.partitionKey,\n maxItemCount: options?.maxItemCount,\n continuationToken: options?.continuationToken,\n timeoutMs: options?.timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<CosmosQueryResult<T>> | InvokeFailure\n >;\n }\n\n /**\n * Read a single document by ID\n * @param container The container name\n * @param id The document ID\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options (partitionKey, timeoutMs)\n */\n async read<T = Record<string, unknown>>(\n container: string,\n id: string,\n invocationKey: string,\n options?: { partitionKey?: PartitionKey; timeoutMs?: number }\n ): Promise<BaseInvokeSuccess<CosmosReadResult<T>> | InvokeFailure> {\n const payload: DbCosmosDBPayload = {\n type: \"database\",\n subtype: \"cosmosdb\",\n operation: \"read\",\n container,\n id,\n partitionKey: options?.partitionKey,\n timeoutMs: options?.timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<CosmosReadResult<T>> | InvokeFailure\n >;\n }\n\n /**\n * Create a new document\n * @param container The container name\n * @param body The document body (must include id and partition key properties)\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options (partitionKey, timeoutMs)\n */\n async create<T = Record<string, unknown>>(\n container: string,\n body: Record<string, CosmosValue>,\n invocationKey: string,\n options?: { partitionKey?: PartitionKey; timeoutMs?: number }\n ): Promise<BaseInvokeSuccess<CosmosCreateResult<T>> | InvokeFailure> {\n const payload: DbCosmosDBPayload = {\n type: \"database\",\n subtype: \"cosmosdb\",\n operation: \"create\",\n container,\n body,\n partitionKey: options?.partitionKey,\n timeoutMs: options?.timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<CosmosCreateResult<T>> | InvokeFailure\n >;\n }\n\n /**\n * Replace an existing document\n * @param container The container name\n * @param id The document ID\n * @param body The new document body\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options (partitionKey, timeoutMs)\n */\n async replace<T = Record<string, unknown>>(\n container: string,\n id: string,\n body: Record<string, CosmosValue>,\n invocationKey: string,\n options?: { partitionKey?: PartitionKey; timeoutMs?: number }\n ): Promise<BaseInvokeSuccess<CosmosReplaceResult<T>> | InvokeFailure> {\n const payload: DbCosmosDBPayload = {\n type: \"database\",\n subtype: \"cosmosdb\",\n operation: \"replace\",\n container,\n id,\n partitionKey: options?.partitionKey,\n body,\n timeoutMs: options?.timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<CosmosReplaceResult<T>> | InvokeFailure\n >;\n }\n\n /**\n * Upsert a document (insert or replace)\n * @param container The container name\n * @param body The document body (must include id and partition key properties)\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options (partitionKey, timeoutMs)\n */\n async upsert<T = Record<string, unknown>>(\n container: string,\n body: Record<string, CosmosValue>,\n invocationKey: string,\n options?: { partitionKey?: PartitionKey; timeoutMs?: number }\n ): Promise<BaseInvokeSuccess<CosmosUpsertResult<T>> | InvokeFailure> {\n const payload: DbCosmosDBPayload = {\n type: \"database\",\n subtype: \"cosmosdb\",\n operation: \"upsert\",\n container,\n body,\n partitionKey: options?.partitionKey,\n timeoutMs: options?.timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<CosmosUpsertResult<T>> | InvokeFailure\n >;\n }\n\n /**\n * Delete a document\n * @param container The container name\n * @param id The document ID\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options (partitionKey, timeoutMs)\n */\n async delete(\n container: string,\n id: string,\n invocationKey: string,\n options?: { partitionKey?: PartitionKey; timeoutMs?: number }\n ): Promise<BaseInvokeSuccess<CosmosDeleteResult> | InvokeFailure> {\n const payload: DbCosmosDBPayload = {\n type: \"database\",\n subtype: \"cosmosdb\",\n operation: \"delete\",\n container,\n id,\n partitionKey: options?.partitionKey,\n timeoutMs: options?.timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<CosmosDeleteResult> | InvokeFailure\n >;\n }\n\n /**\n * Patch a document with partial updates\n * @param container The container name\n * @param id The document ID\n * @param patchOperations Array of patch operations\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options (partitionKey, condition, timeoutMs)\n */\n async patch<T = Record<string, unknown>>(\n container: string,\n id: string,\n patchOperations: CosmosPatchOperation[],\n invocationKey: string,\n options?: { partitionKey?: PartitionKey; condition?: string; timeoutMs?: number }\n ): Promise<BaseInvokeSuccess<CosmosPatchResult<T>> | InvokeFailure> {\n const payload: DbCosmosDBPayload = {\n type: \"database\",\n subtype: \"cosmosdb\",\n operation: \"patch\",\n container,\n id,\n partitionKey: options?.partitionKey,\n patchOperations,\n condition: options?.condition,\n timeoutMs: options?.timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<\n BaseInvokeSuccess<CosmosPatchResult<T>> | InvokeFailure\n >;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAgBA;;;;;AAAA,kBAAmC;AAE7B,MAAO,+BAA+B,+BAAkB;EAF9D,OAE8D;;;;;;;;EAM5D,MAAM,OACJ,SACA,eAAqB;AAErB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;EASA,MAAM,MACJ,WACA,OACA,eACA,SAMC;AAED,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA,YAAY,SAAS;MACrB,cAAc,SAAS;MACvB,cAAc,SAAS;MACvB,mBAAmB,SAAS;MAC5B,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;EASA,MAAM,KACJ,WACA,IACA,eACA,SAA6D;AAE7D,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA,cAAc,SAAS;MACvB,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;EASA,MAAM,OACJ,WACA,MACA,eACA,SAA6D;AAE7D,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA,cAAc,SAAS;MACvB,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;;EAUA,MAAM,QACJ,WACA,IACA,MACA,eACA,SAA6D;AAE7D,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA,cAAc,SAAS;MACvB;MACA,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;EASA,MAAM,OACJ,WACA,MACA,eACA,SAA6D;AAE7D,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA,cAAc,SAAS;MACvB,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;EASA,MAAM,OACJ,WACA,IACA,eACA,SAA6D;AAE7D,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA,cAAc,SAAS;MACvB,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;;EAUA,MAAM,MACJ,WACA,IACA,iBACA,eACA,SAAiF;AAEjF,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA,cAAc,SAAS;MACvB;MACA,WAAW,SAAS;MACpB,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,11 +26,11 @@ export declare class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
26
26
|
* Read a single document by ID
|
|
27
27
|
* @param container The container name
|
|
28
28
|
* @param id The document ID
|
|
29
|
-
* @param partitionKey The partition key value
|
|
30
29
|
* @param invocationKey Unique key for tracking this invocation
|
|
31
|
-
* @param options Additional options
|
|
30
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
32
31
|
*/
|
|
33
|
-
read<T = Record<string, unknown>>(container: string, id: string,
|
|
32
|
+
read<T = Record<string, unknown>>(container: string, id: string, invocationKey: string, options?: {
|
|
33
|
+
partitionKey?: PartitionKey;
|
|
34
34
|
timeoutMs?: number;
|
|
35
35
|
}): Promise<BaseInvokeSuccess<CosmosReadResult<T>> | InvokeFailure>;
|
|
36
36
|
/**
|
|
@@ -38,21 +38,22 @@ export declare class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
38
38
|
* @param container The container name
|
|
39
39
|
* @param body The document body (must include id and partition key properties)
|
|
40
40
|
* @param invocationKey Unique key for tracking this invocation
|
|
41
|
-
* @param options Additional options
|
|
41
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
42
42
|
*/
|
|
43
43
|
create<T = Record<string, unknown>>(container: string, body: Record<string, CosmosValue>, invocationKey: string, options?: {
|
|
44
|
+
partitionKey?: PartitionKey;
|
|
44
45
|
timeoutMs?: number;
|
|
45
46
|
}): Promise<BaseInvokeSuccess<CosmosCreateResult<T>> | InvokeFailure>;
|
|
46
47
|
/**
|
|
47
48
|
* Replace an existing document
|
|
48
49
|
* @param container The container name
|
|
49
50
|
* @param id The document ID
|
|
50
|
-
* @param partitionKey The partition key value
|
|
51
51
|
* @param body The new document body
|
|
52
52
|
* @param invocationKey Unique key for tracking this invocation
|
|
53
|
-
* @param options Additional options
|
|
53
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
54
54
|
*/
|
|
55
|
-
replace<T = Record<string, unknown>>(container: string, id: string,
|
|
55
|
+
replace<T = Record<string, unknown>>(container: string, id: string, body: Record<string, CosmosValue>, invocationKey: string, options?: {
|
|
56
|
+
partitionKey?: PartitionKey;
|
|
56
57
|
timeoutMs?: number;
|
|
57
58
|
}): Promise<BaseInvokeSuccess<CosmosReplaceResult<T>> | InvokeFailure>;
|
|
58
59
|
/**
|
|
@@ -60,32 +61,33 @@ export declare class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
60
61
|
* @param container The container name
|
|
61
62
|
* @param body The document body (must include id and partition key properties)
|
|
62
63
|
* @param invocationKey Unique key for tracking this invocation
|
|
63
|
-
* @param options Additional options
|
|
64
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
64
65
|
*/
|
|
65
66
|
upsert<T = Record<string, unknown>>(container: string, body: Record<string, CosmosValue>, invocationKey: string, options?: {
|
|
67
|
+
partitionKey?: PartitionKey;
|
|
66
68
|
timeoutMs?: number;
|
|
67
69
|
}): Promise<BaseInvokeSuccess<CosmosUpsertResult<T>> | InvokeFailure>;
|
|
68
70
|
/**
|
|
69
71
|
* Delete a document
|
|
70
72
|
* @param container The container name
|
|
71
73
|
* @param id The document ID
|
|
72
|
-
* @param partitionKey The partition key value
|
|
73
74
|
* @param invocationKey Unique key for tracking this invocation
|
|
74
|
-
* @param options Additional options
|
|
75
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
75
76
|
*/
|
|
76
|
-
delete(container: string, id: string,
|
|
77
|
+
delete(container: string, id: string, invocationKey: string, options?: {
|
|
78
|
+
partitionKey?: PartitionKey;
|
|
77
79
|
timeoutMs?: number;
|
|
78
80
|
}): Promise<BaseInvokeSuccess<CosmosDeleteResult> | InvokeFailure>;
|
|
79
81
|
/**
|
|
80
82
|
* Patch a document with partial updates
|
|
81
83
|
* @param container The container name
|
|
82
84
|
* @param id The document ID
|
|
83
|
-
* @param partitionKey The partition key value
|
|
84
85
|
* @param patchOperations Array of patch operations
|
|
85
86
|
* @param invocationKey Unique key for tracking this invocation
|
|
86
|
-
* @param options Additional options (condition, timeoutMs)
|
|
87
|
+
* @param options Additional options (partitionKey, condition, timeoutMs)
|
|
87
88
|
*/
|
|
88
|
-
patch<T = Record<string, unknown>>(container: string, id: string,
|
|
89
|
+
patch<T = Record<string, unknown>>(container: string, id: string, patchOperations: CosmosPatchOperation[], invocationKey: string, options?: {
|
|
90
|
+
partitionKey?: PartitionKey;
|
|
89
91
|
condition?: string;
|
|
90
92
|
timeoutMs?: number;
|
|
91
93
|
}): Promise<BaseInvokeSuccess<CosmosPatchResult<T>> | InvokeFailure>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosdb.d.ts","sourceRoot":"","sources":["../../src/clients/cosmosdb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D;;;;OAIG;IACG,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,OAAO,EAAE,iBAAiB,EAC1B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;IAMzE;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QACR,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAC;QACpC,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;IAmBnE
|
|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C,EAAE;QAAE,YAAY,CAAC,EAAE,YAAY,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5D,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;IAgBpE;;;;;;OAMG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,YAAY,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5D,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,GAAG,aAAa,CAAC;IAgBjE;;;;;;;OAOG;IACG,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,oBAAoB,EAAE,EACvC,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,YAAY,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAChF,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;CAiBpE"}
|
package/dist/clients/cosmosdb.js
CHANGED
|
@@ -34,18 +34,17 @@ export class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
34
34
|
* Read a single document by ID
|
|
35
35
|
* @param container The container name
|
|
36
36
|
* @param id The document ID
|
|
37
|
-
* @param partitionKey The partition key value
|
|
38
37
|
* @param invocationKey Unique key for tracking this invocation
|
|
39
|
-
* @param options Additional options
|
|
38
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
40
39
|
*/
|
|
41
|
-
async read(container, id,
|
|
40
|
+
async read(container, id, invocationKey, options) {
|
|
42
41
|
const payload = {
|
|
43
42
|
type: "database",
|
|
44
43
|
subtype: "cosmosdb",
|
|
45
44
|
operation: "read",
|
|
46
45
|
container,
|
|
47
46
|
id,
|
|
48
|
-
partitionKey,
|
|
47
|
+
partitionKey: options?.partitionKey,
|
|
49
48
|
timeoutMs: options?.timeoutMs,
|
|
50
49
|
};
|
|
51
50
|
return this.invokeRaw(payload, invocationKey);
|
|
@@ -55,7 +54,7 @@ export class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
55
54
|
* @param container The container name
|
|
56
55
|
* @param body The document body (must include id and partition key properties)
|
|
57
56
|
* @param invocationKey Unique key for tracking this invocation
|
|
58
|
-
* @param options Additional options
|
|
57
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
59
58
|
*/
|
|
60
59
|
async create(container, body, invocationKey, options) {
|
|
61
60
|
const payload = {
|
|
@@ -64,6 +63,7 @@ export class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
64
63
|
operation: "create",
|
|
65
64
|
container,
|
|
66
65
|
body,
|
|
66
|
+
partitionKey: options?.partitionKey,
|
|
67
67
|
timeoutMs: options?.timeoutMs,
|
|
68
68
|
};
|
|
69
69
|
return this.invokeRaw(payload, invocationKey);
|
|
@@ -72,19 +72,18 @@ export class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
72
72
|
* Replace an existing document
|
|
73
73
|
* @param container The container name
|
|
74
74
|
* @param id The document ID
|
|
75
|
-
* @param partitionKey The partition key value
|
|
76
75
|
* @param body The new document body
|
|
77
76
|
* @param invocationKey Unique key for tracking this invocation
|
|
78
|
-
* @param options Additional options
|
|
77
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
79
78
|
*/
|
|
80
|
-
async replace(container, id,
|
|
79
|
+
async replace(container, id, body, invocationKey, options) {
|
|
81
80
|
const payload = {
|
|
82
81
|
type: "database",
|
|
83
82
|
subtype: "cosmosdb",
|
|
84
83
|
operation: "replace",
|
|
85
84
|
container,
|
|
86
85
|
id,
|
|
87
|
-
partitionKey,
|
|
86
|
+
partitionKey: options?.partitionKey,
|
|
88
87
|
body,
|
|
89
88
|
timeoutMs: options?.timeoutMs,
|
|
90
89
|
};
|
|
@@ -95,7 +94,7 @@ export class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
95
94
|
* @param container The container name
|
|
96
95
|
* @param body The document body (must include id and partition key properties)
|
|
97
96
|
* @param invocationKey Unique key for tracking this invocation
|
|
98
|
-
* @param options Additional options
|
|
97
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
99
98
|
*/
|
|
100
99
|
async upsert(container, body, invocationKey, options) {
|
|
101
100
|
const payload = {
|
|
@@ -104,6 +103,7 @@ export class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
104
103
|
operation: "upsert",
|
|
105
104
|
container,
|
|
106
105
|
body,
|
|
106
|
+
partitionKey: options?.partitionKey,
|
|
107
107
|
timeoutMs: options?.timeoutMs,
|
|
108
108
|
};
|
|
109
109
|
return this.invokeRaw(payload, invocationKey);
|
|
@@ -112,18 +112,17 @@ export class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
112
112
|
* Delete a document
|
|
113
113
|
* @param container The container name
|
|
114
114
|
* @param id The document ID
|
|
115
|
-
* @param partitionKey The partition key value
|
|
116
115
|
* @param invocationKey Unique key for tracking this invocation
|
|
117
|
-
* @param options Additional options
|
|
116
|
+
* @param options Additional options (partitionKey, timeoutMs)
|
|
118
117
|
*/
|
|
119
|
-
async delete(container, id,
|
|
118
|
+
async delete(container, id, invocationKey, options) {
|
|
120
119
|
const payload = {
|
|
121
120
|
type: "database",
|
|
122
121
|
subtype: "cosmosdb",
|
|
123
122
|
operation: "delete",
|
|
124
123
|
container,
|
|
125
124
|
id,
|
|
126
|
-
partitionKey,
|
|
125
|
+
partitionKey: options?.partitionKey,
|
|
127
126
|
timeoutMs: options?.timeoutMs,
|
|
128
127
|
};
|
|
129
128
|
return this.invokeRaw(payload, invocationKey);
|
|
@@ -132,19 +131,18 @@ export class CosmosDBResourceClient extends BaseResourceClient {
|
|
|
132
131
|
* Patch a document with partial updates
|
|
133
132
|
* @param container The container name
|
|
134
133
|
* @param id The document ID
|
|
135
|
-
* @param partitionKey The partition key value
|
|
136
134
|
* @param patchOperations Array of patch operations
|
|
137
135
|
* @param invocationKey Unique key for tracking this invocation
|
|
138
|
-
* @param options Additional options (condition, timeoutMs)
|
|
136
|
+
* @param options Additional options (partitionKey, condition, timeoutMs)
|
|
139
137
|
*/
|
|
140
|
-
async patch(container, id,
|
|
138
|
+
async patch(container, id, patchOperations, invocationKey, options) {
|
|
141
139
|
const payload = {
|
|
142
140
|
type: "database",
|
|
143
141
|
subtype: "cosmosdb",
|
|
144
142
|
operation: "patch",
|
|
145
143
|
container,
|
|
146
144
|
id,
|
|
147
|
-
partitionKey,
|
|
145
|
+
partitionKey: options?.partitionKey,
|
|
148
146
|
patchOperations,
|
|
149
147
|
condition: options?.condition,
|
|
150
148
|
timeoutMs: options?.timeoutMs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosdb.js","sourceRoot":"","sources":["../../src/clients/cosmosdb.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,OAA0B,EAC1B,aAAqB;QAErB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAE3C,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CACT,SAAiB,EACjB,KAAa,EACb,aAAqB,EACrB,OAMC;QAED,MAAM,OAAO,GAAsB;YACjC,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,OAAO;YAClB,SAAS;YACT,KAAK;YACL,UAAU,EAAE,OAAO,EAAE,UAAU;YAC/B,YAAY,EAAE,OAAO,EAAE,YAAY;YACnC,YAAY,EAAE,OAAO,E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IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAE3C,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,EAAU,EACV,aAAqB,EACrB,OAA6D;QAE7D,MAAM,OAAO,GAAsB;YACjC,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,QAAQ;YACnB,SAAS;YACT,EAAE;YACF,YAAY,EAAE,OAAO,EAAE,YAAY;YACnC,SAAS,EAAE,OAAO,EAAE,SAAS;SAC9B,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAE3C,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,CACT,SAAiB,EACjB,EAAU,EACV,eAAuC,EACvC,aAAqB,EACrB,OAAiF;QAEjF,MAAM,OAAO,GAAsB;YACjC,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,OAAO;YAClB,SAAS;YACT,EAAE;YACF,YAAY,EAAE,OAAO,EAAE,YAAY;YACnC,eAAe;YACf,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,SAAS,EAAE,OAAO,EAAE,SAAS;SAC9B,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAE3C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -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;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,OAA2B,EAC3B,aAAqB;QAErB,OAAO,IAAI,CAAC,SAAS,CAAC,O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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,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AA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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;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"response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,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;IAClC,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4BAA4B;IAC5B,CAAC,GAAG,EAAE,MAA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,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