@major-tech/resource-client 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/generate-clients.mjs +4 -3
- package/dist/clients/cosmosdb.cjs +182 -0
- package/dist/clients/cosmosdb.cjs.map +7 -0
- package/dist/clients/cosmosdb.d.ts +93 -0
- package/dist/clients/cosmosdb.d.ts.map +1 -0
- package/dist/clients/cosmosdb.js +155 -0
- package/dist/clients/cosmosdb.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/cosmosdb.cjs +17 -0
- package/dist/schemas/cosmosdb.cjs.map +7 -0
- package/dist/schemas/cosmosdb.d.ts +121 -0
- package/dist/schemas/cosmosdb.d.ts.map +1 -0
- package/dist/schemas/cosmosdb.js +2 -0
- package/dist/schemas/cosmosdb.js.map +1 -0
- package/dist/schemas/index.cjs +1 -0
- package/dist/schemas/index.cjs.map +2 -2
- package/dist/schemas/index.d.ts +3 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/response.d.ts +6 -1
- package/dist/schemas/response.d.ts.map +1 -1
- package/package.json +1 -1
package/bin/generate-clients.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* npx @major-tech/resource-client remove <name>
|
|
9
9
|
* npx @major-tech/resource-client list
|
|
10
10
|
*
|
|
11
|
-
* Types: database-postgresql | database-dynamodb | api-hubspot | api-googlesheets | api-custom | storage-s3
|
|
11
|
+
* Types: database-postgresql | database-dynamodb | database-cosmosdb | 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"
|
|
@@ -142,6 +142,7 @@ function getClientClass(type) {
|
|
|
142
142
|
const typeMap = {
|
|
143
143
|
'database-postgresql': 'PostgresResourceClient',
|
|
144
144
|
'database-dynamodb': 'DynamoDBResourceClient',
|
|
145
|
+
'database-cosmosdb': 'CosmosDBResourceClient',
|
|
145
146
|
'api-custom': 'CustomApiResourceClient',
|
|
146
147
|
'api-hubspot': 'HubSpotResourceClient',
|
|
147
148
|
'api-googlesheets': 'GoogleSheetsResourceClient',
|
|
@@ -179,7 +180,7 @@ function generateIndexFile(resources) {
|
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
function addResource(resourceId, name, type, description, applicationId, framework) {
|
|
182
|
-
const validTypes = ['database-postgresql', 'database-dynamodb', 'api-hubspot', 'api-googlesheets', 'api-custom', 'storage-s3'];
|
|
183
|
+
const validTypes = ['database-postgresql', 'database-dynamodb', 'database-cosmosdb', 'api-hubspot', 'api-googlesheets', 'api-custom', 'storage-s3'];
|
|
183
184
|
if (!validTypes.includes(type)) {
|
|
184
185
|
console.error(`❌ Invalid type: ${type}`);
|
|
185
186
|
console.log(` Valid types: ${validTypes.join(', ')}`);
|
|
@@ -316,7 +317,7 @@ function main() {
|
|
|
316
317
|
console.log(' npx @major-tech/resource-client add <resource_id> <name> <type> <description> <application_id> [--framework <nextjs|vite>]');
|
|
317
318
|
console.log(' npx @major-tech/resource-client remove <name> [--framework <nextjs|vite>]');
|
|
318
319
|
console.log(' npx @major-tech/resource-client list');
|
|
319
|
-
console.log('\nTypes: database-postgresql | database-dynamodb | api-hubspot | api-googlesheets | api-custom | storage-s3');
|
|
320
|
+
console.log('\nTypes: database-postgresql | database-dynamodb | database-cosmosdb | api-hubspot | api-googlesheets | api-custom | storage-s3');
|
|
320
321
|
return;
|
|
321
322
|
}
|
|
322
323
|
|
|
@@ -0,0 +1,182 @@
|
|
|
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 cosmosdb_exports = {};
|
|
21
|
+
__export(cosmosdb_exports, {
|
|
22
|
+
CosmosDBResourceClient: () => CosmosDBResourceClient
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(cosmosdb_exports);
|
|
25
|
+
var import_base = require("../base");
|
|
26
|
+
class CosmosDBResourceClient extends import_base.BaseResourceClient {
|
|
27
|
+
static {
|
|
28
|
+
__name(this, "CosmosDBResourceClient");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Invoke a CosmosDB 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 query against a container
|
|
40
|
+
* @param container The container name
|
|
41
|
+
* @param query The SQL query string
|
|
42
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
43
|
+
* @param options Query options (parameters, partitionKey, pagination)
|
|
44
|
+
*/
|
|
45
|
+
async query(container, query, invocationKey, options) {
|
|
46
|
+
const payload = {
|
|
47
|
+
type: "database",
|
|
48
|
+
subtype: "cosmosdb",
|
|
49
|
+
operation: "query",
|
|
50
|
+
container,
|
|
51
|
+
query,
|
|
52
|
+
parameters: options?.parameters,
|
|
53
|
+
partitionKey: options?.partitionKey,
|
|
54
|
+
maxItemCount: options?.maxItemCount,
|
|
55
|
+
continuationToken: options?.continuationToken,
|
|
56
|
+
timeoutMs: options?.timeoutMs
|
|
57
|
+
};
|
|
58
|
+
return this.invokeRaw(payload, invocationKey);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Read a single document by ID
|
|
62
|
+
* @param container The container name
|
|
63
|
+
* @param id The document ID
|
|
64
|
+
* @param partitionKey The partition key value
|
|
65
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
66
|
+
* @param options Additional options
|
|
67
|
+
*/
|
|
68
|
+
async read(container, id, partitionKey, invocationKey, options) {
|
|
69
|
+
const payload = {
|
|
70
|
+
type: "database",
|
|
71
|
+
subtype: "cosmosdb",
|
|
72
|
+
operation: "read",
|
|
73
|
+
container,
|
|
74
|
+
id,
|
|
75
|
+
partitionKey,
|
|
76
|
+
timeoutMs: options?.timeoutMs
|
|
77
|
+
};
|
|
78
|
+
return this.invokeRaw(payload, invocationKey);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Create a new document
|
|
82
|
+
* @param container The container name
|
|
83
|
+
* @param body The document body (must include id and partition key properties)
|
|
84
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
85
|
+
* @param options Additional options
|
|
86
|
+
*/
|
|
87
|
+
async create(container, body, invocationKey, options) {
|
|
88
|
+
const payload = {
|
|
89
|
+
type: "database",
|
|
90
|
+
subtype: "cosmosdb",
|
|
91
|
+
operation: "create",
|
|
92
|
+
container,
|
|
93
|
+
body,
|
|
94
|
+
timeoutMs: options?.timeoutMs
|
|
95
|
+
};
|
|
96
|
+
return this.invokeRaw(payload, invocationKey);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Replace an existing document
|
|
100
|
+
* @param container The container name
|
|
101
|
+
* @param id The document ID
|
|
102
|
+
* @param partitionKey The partition key value
|
|
103
|
+
* @param body The new document body
|
|
104
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
105
|
+
* @param options Additional options
|
|
106
|
+
*/
|
|
107
|
+
async replace(container, id, partitionKey, body, invocationKey, options) {
|
|
108
|
+
const payload = {
|
|
109
|
+
type: "database",
|
|
110
|
+
subtype: "cosmosdb",
|
|
111
|
+
operation: "replace",
|
|
112
|
+
container,
|
|
113
|
+
id,
|
|
114
|
+
partitionKey,
|
|
115
|
+
body,
|
|
116
|
+
timeoutMs: options?.timeoutMs
|
|
117
|
+
};
|
|
118
|
+
return this.invokeRaw(payload, invocationKey);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Upsert a document (insert or replace)
|
|
122
|
+
* @param container The container name
|
|
123
|
+
* @param body The document body (must include id and partition key properties)
|
|
124
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
125
|
+
* @param options Additional options
|
|
126
|
+
*/
|
|
127
|
+
async upsert(container, body, invocationKey, options) {
|
|
128
|
+
const payload = {
|
|
129
|
+
type: "database",
|
|
130
|
+
subtype: "cosmosdb",
|
|
131
|
+
operation: "upsert",
|
|
132
|
+
container,
|
|
133
|
+
body,
|
|
134
|
+
timeoutMs: options?.timeoutMs
|
|
135
|
+
};
|
|
136
|
+
return this.invokeRaw(payload, invocationKey);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Delete a document
|
|
140
|
+
* @param container The container name
|
|
141
|
+
* @param id The document ID
|
|
142
|
+
* @param partitionKey The partition key value
|
|
143
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
144
|
+
* @param options Additional options
|
|
145
|
+
*/
|
|
146
|
+
async delete(container, id, partitionKey, invocationKey, options) {
|
|
147
|
+
const payload = {
|
|
148
|
+
type: "database",
|
|
149
|
+
subtype: "cosmosdb",
|
|
150
|
+
operation: "delete",
|
|
151
|
+
container,
|
|
152
|
+
id,
|
|
153
|
+
partitionKey,
|
|
154
|
+
timeoutMs: options?.timeoutMs
|
|
155
|
+
};
|
|
156
|
+
return this.invokeRaw(payload, invocationKey);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Patch a document with partial updates
|
|
160
|
+
* @param container The container name
|
|
161
|
+
* @param id The document ID
|
|
162
|
+
* @param partitionKey The partition key value
|
|
163
|
+
* @param patchOperations Array of patch operations
|
|
164
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
165
|
+
* @param options Additional options (condition, timeoutMs)
|
|
166
|
+
*/
|
|
167
|
+
async patch(container, id, partitionKey, patchOperations, invocationKey, options) {
|
|
168
|
+
const payload = {
|
|
169
|
+
type: "database",
|
|
170
|
+
subtype: "cosmosdb",
|
|
171
|
+
operation: "patch",
|
|
172
|
+
container,
|
|
173
|
+
id,
|
|
174
|
+
partitionKey,
|
|
175
|
+
patchOperations,
|
|
176
|
+
condition: options?.condition,
|
|
177
|
+
timeoutMs: options?.timeoutMs
|
|
178
|
+
};
|
|
179
|
+
return this.invokeRaw(payload, invocationKey);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=cosmosdb.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 partitionKey The partition key value\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options\n */\n async read<T = Record<string, unknown>>(\n container: string,\n id: string,\n partitionKey: PartitionKey,\n invocationKey: string,\n options?: { 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,\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\n */\n async create<T = Record<string, unknown>>(\n container: string,\n body: Record<string, CosmosValue>,\n invocationKey: string,\n options?: { 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 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 partitionKey The partition key value\n * @param body The new document body\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options\n */\n async replace<T = Record<string, unknown>>(\n container: string,\n id: string,\n partitionKey: PartitionKey,\n body: Record<string, CosmosValue>,\n invocationKey: string,\n options?: { 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,\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\n */\n async upsert<T = Record<string, unknown>>(\n container: string,\n body: Record<string, CosmosValue>,\n invocationKey: string,\n options?: { 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 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 partitionKey The partition key value\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options\n */\n async delete(\n container: string,\n id: string,\n partitionKey: PartitionKey,\n invocationKey: string,\n options?: { 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,\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 partitionKey The partition key value\n * @param patchOperations Array of patch operations\n * @param invocationKey Unique key for tracking this invocation\n * @param options Additional options (condition, timeoutMs)\n */\n async patch<T = Record<string, unknown>>(\n container: string,\n id: string,\n partitionKey: PartitionKey,\n patchOperations: CosmosPatchOperation[],\n invocationKey: string,\n options?: { 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,\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;AAE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AAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;;;;;;;;;EAWA,MAAM,MACJ,WACA,IACA,cACA,iBACA,eACA,SAAoD;AAEpD,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT,WAAW;MACX;MACA;MACA;MACA;MACA,WAAW,SAAS;MACpB,WAAW,SAAS;;AAGtB,WAAO,KAAK,UAAU,SAAS,aAAa;EAG9C;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { DbCosmosDBPayload, CosmosValue, PartitionKey, CosmosQueryParameter, CosmosPatchOperation, CosmosQueryResult, CosmosReadResult, CosmosCreateResult, CosmosReplaceResult, CosmosUpsertResult, CosmosDeleteResult, CosmosPatchResult, DbCosmosDBResultGeneric } from "../schemas";
|
|
2
|
+
import type { BaseInvokeSuccess, InvokeFailure } from "../schemas/response";
|
|
3
|
+
import { BaseResourceClient } from "../base";
|
|
4
|
+
export declare class CosmosDBResourceClient extends BaseResourceClient {
|
|
5
|
+
/**
|
|
6
|
+
* Invoke a CosmosDB operation with a raw payload
|
|
7
|
+
* @param payload The complete operation payload
|
|
8
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
9
|
+
*/
|
|
10
|
+
invoke<T = Record<string, unknown>>(payload: DbCosmosDBPayload, invocationKey: string): Promise<BaseInvokeSuccess<DbCosmosDBResultGeneric<T>> | InvokeFailure>;
|
|
11
|
+
/**
|
|
12
|
+
* Execute a SQL query against a container
|
|
13
|
+
* @param container The container name
|
|
14
|
+
* @param query The SQL query string
|
|
15
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
16
|
+
* @param options Query options (parameters, partitionKey, pagination)
|
|
17
|
+
*/
|
|
18
|
+
query<T = Record<string, unknown>>(container: string, query: string, invocationKey: string, options?: {
|
|
19
|
+
parameters?: CosmosQueryParameter[];
|
|
20
|
+
partitionKey?: PartitionKey;
|
|
21
|
+
maxItemCount?: number;
|
|
22
|
+
continuationToken?: string;
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
}): Promise<BaseInvokeSuccess<CosmosQueryResult<T>> | InvokeFailure>;
|
|
25
|
+
/**
|
|
26
|
+
* Read a single document by ID
|
|
27
|
+
* @param container The container name
|
|
28
|
+
* @param id The document ID
|
|
29
|
+
* @param partitionKey The partition key value
|
|
30
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
31
|
+
* @param options Additional options
|
|
32
|
+
*/
|
|
33
|
+
read<T = Record<string, unknown>>(container: string, id: string, partitionKey: PartitionKey, invocationKey: string, options?: {
|
|
34
|
+
timeoutMs?: number;
|
|
35
|
+
}): Promise<BaseInvokeSuccess<CosmosReadResult<T>> | InvokeFailure>;
|
|
36
|
+
/**
|
|
37
|
+
* Create a new document
|
|
38
|
+
* @param container The container name
|
|
39
|
+
* @param body The document body (must include id and partition key properties)
|
|
40
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
41
|
+
* @param options Additional options
|
|
42
|
+
*/
|
|
43
|
+
create<T = Record<string, unknown>>(container: string, body: Record<string, CosmosValue>, invocationKey: string, options?: {
|
|
44
|
+
timeoutMs?: number;
|
|
45
|
+
}): Promise<BaseInvokeSuccess<CosmosCreateResult<T>> | InvokeFailure>;
|
|
46
|
+
/**
|
|
47
|
+
* Replace an existing document
|
|
48
|
+
* @param container The container name
|
|
49
|
+
* @param id The document ID
|
|
50
|
+
* @param partitionKey The partition key value
|
|
51
|
+
* @param body The new document body
|
|
52
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
53
|
+
* @param options Additional options
|
|
54
|
+
*/
|
|
55
|
+
replace<T = Record<string, unknown>>(container: string, id: string, partitionKey: PartitionKey, body: Record<string, CosmosValue>, invocationKey: string, options?: {
|
|
56
|
+
timeoutMs?: number;
|
|
57
|
+
}): Promise<BaseInvokeSuccess<CosmosReplaceResult<T>> | InvokeFailure>;
|
|
58
|
+
/**
|
|
59
|
+
* Upsert a document (insert or replace)
|
|
60
|
+
* @param container The container name
|
|
61
|
+
* @param body The document body (must include id and partition key properties)
|
|
62
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
63
|
+
* @param options Additional options
|
|
64
|
+
*/
|
|
65
|
+
upsert<T = Record<string, unknown>>(container: string, body: Record<string, CosmosValue>, invocationKey: string, options?: {
|
|
66
|
+
timeoutMs?: number;
|
|
67
|
+
}): Promise<BaseInvokeSuccess<CosmosUpsertResult<T>> | InvokeFailure>;
|
|
68
|
+
/**
|
|
69
|
+
* Delete a document
|
|
70
|
+
* @param container The container name
|
|
71
|
+
* @param id The document ID
|
|
72
|
+
* @param partitionKey The partition key value
|
|
73
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
74
|
+
* @param options Additional options
|
|
75
|
+
*/
|
|
76
|
+
delete(container: string, id: string, partitionKey: PartitionKey, invocationKey: string, options?: {
|
|
77
|
+
timeoutMs?: number;
|
|
78
|
+
}): Promise<BaseInvokeSuccess<CosmosDeleteResult> | InvokeFailure>;
|
|
79
|
+
/**
|
|
80
|
+
* Patch a document with partial updates
|
|
81
|
+
* @param container The container name
|
|
82
|
+
* @param id The document ID
|
|
83
|
+
* @param partitionKey The partition key value
|
|
84
|
+
* @param patchOperations Array of patch operations
|
|
85
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
86
|
+
* @param options Additional options (condition, timeoutMs)
|
|
87
|
+
*/
|
|
88
|
+
patch<T = Record<string, unknown>>(container: string, id: string, partitionKey: PartitionKey, patchOperations: CosmosPatchOperation[], invocationKey: string, options?: {
|
|
89
|
+
condition?: string;
|
|
90
|
+
timeoutMs?: number;
|
|
91
|
+
}): Promise<BaseInvokeSuccess<CosmosPatchResult<T>> | InvokeFailure>;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=cosmosdb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosdb.d.ts","sourceRoot":"","sources":["../../src/clients/cosmosdb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB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S,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAC/B,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,GAAG,aAAa,CAAC;IAgBjE;;;;;;;;OAQG;IACG,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,oBAAoB,EAAE,EACvC,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GACnD,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;CAiBpE"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { BaseResourceClient } from "../base";
|
|
2
|
+
export class CosmosDBResourceClient extends BaseResourceClient {
|
|
3
|
+
/**
|
|
4
|
+
* Invoke a CosmosDB 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 query against a container
|
|
13
|
+
* @param container The container name
|
|
14
|
+
* @param query The SQL query string
|
|
15
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
16
|
+
* @param options Query options (parameters, partitionKey, pagination)
|
|
17
|
+
*/
|
|
18
|
+
async query(container, query, invocationKey, options) {
|
|
19
|
+
const payload = {
|
|
20
|
+
type: "database",
|
|
21
|
+
subtype: "cosmosdb",
|
|
22
|
+
operation: "query",
|
|
23
|
+
container,
|
|
24
|
+
query,
|
|
25
|
+
parameters: options?.parameters,
|
|
26
|
+
partitionKey: options?.partitionKey,
|
|
27
|
+
maxItemCount: options?.maxItemCount,
|
|
28
|
+
continuationToken: options?.continuationToken,
|
|
29
|
+
timeoutMs: options?.timeoutMs,
|
|
30
|
+
};
|
|
31
|
+
return this.invokeRaw(payload, invocationKey);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Read a single document by ID
|
|
35
|
+
* @param container The container name
|
|
36
|
+
* @param id The document ID
|
|
37
|
+
* @param partitionKey The partition key value
|
|
38
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
39
|
+
* @param options Additional options
|
|
40
|
+
*/
|
|
41
|
+
async read(container, id, partitionKey, invocationKey, options) {
|
|
42
|
+
const payload = {
|
|
43
|
+
type: "database",
|
|
44
|
+
subtype: "cosmosdb",
|
|
45
|
+
operation: "read",
|
|
46
|
+
container,
|
|
47
|
+
id,
|
|
48
|
+
partitionKey,
|
|
49
|
+
timeoutMs: options?.timeoutMs,
|
|
50
|
+
};
|
|
51
|
+
return this.invokeRaw(payload, invocationKey);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Create a new document
|
|
55
|
+
* @param container The container name
|
|
56
|
+
* @param body The document body (must include id and partition key properties)
|
|
57
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
58
|
+
* @param options Additional options
|
|
59
|
+
*/
|
|
60
|
+
async create(container, body, invocationKey, options) {
|
|
61
|
+
const payload = {
|
|
62
|
+
type: "database",
|
|
63
|
+
subtype: "cosmosdb",
|
|
64
|
+
operation: "create",
|
|
65
|
+
container,
|
|
66
|
+
body,
|
|
67
|
+
timeoutMs: options?.timeoutMs,
|
|
68
|
+
};
|
|
69
|
+
return this.invokeRaw(payload, invocationKey);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Replace an existing document
|
|
73
|
+
* @param container The container name
|
|
74
|
+
* @param id The document ID
|
|
75
|
+
* @param partitionKey The partition key value
|
|
76
|
+
* @param body The new document body
|
|
77
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
78
|
+
* @param options Additional options
|
|
79
|
+
*/
|
|
80
|
+
async replace(container, id, partitionKey, body, invocationKey, options) {
|
|
81
|
+
const payload = {
|
|
82
|
+
type: "database",
|
|
83
|
+
subtype: "cosmosdb",
|
|
84
|
+
operation: "replace",
|
|
85
|
+
container,
|
|
86
|
+
id,
|
|
87
|
+
partitionKey,
|
|
88
|
+
body,
|
|
89
|
+
timeoutMs: options?.timeoutMs,
|
|
90
|
+
};
|
|
91
|
+
return this.invokeRaw(payload, invocationKey);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Upsert a document (insert or replace)
|
|
95
|
+
* @param container The container name
|
|
96
|
+
* @param body The document body (must include id and partition key properties)
|
|
97
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
98
|
+
* @param options Additional options
|
|
99
|
+
*/
|
|
100
|
+
async upsert(container, body, invocationKey, options) {
|
|
101
|
+
const payload = {
|
|
102
|
+
type: "database",
|
|
103
|
+
subtype: "cosmosdb",
|
|
104
|
+
operation: "upsert",
|
|
105
|
+
container,
|
|
106
|
+
body,
|
|
107
|
+
timeoutMs: options?.timeoutMs,
|
|
108
|
+
};
|
|
109
|
+
return this.invokeRaw(payload, invocationKey);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Delete a document
|
|
113
|
+
* @param container The container name
|
|
114
|
+
* @param id The document ID
|
|
115
|
+
* @param partitionKey The partition key value
|
|
116
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
117
|
+
* @param options Additional options
|
|
118
|
+
*/
|
|
119
|
+
async delete(container, id, partitionKey, invocationKey, options) {
|
|
120
|
+
const payload = {
|
|
121
|
+
type: "database",
|
|
122
|
+
subtype: "cosmosdb",
|
|
123
|
+
operation: "delete",
|
|
124
|
+
container,
|
|
125
|
+
id,
|
|
126
|
+
partitionKey,
|
|
127
|
+
timeoutMs: options?.timeoutMs,
|
|
128
|
+
};
|
|
129
|
+
return this.invokeRaw(payload, invocationKey);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Patch a document with partial updates
|
|
133
|
+
* @param container The container name
|
|
134
|
+
* @param id The document ID
|
|
135
|
+
* @param partitionKey The partition key value
|
|
136
|
+
* @param patchOperations Array of patch operations
|
|
137
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
138
|
+
* @param options Additional options (condition, timeoutMs)
|
|
139
|
+
*/
|
|
140
|
+
async patch(container, id, partitionKey, patchOperations, invocationKey, options) {
|
|
141
|
+
const payload = {
|
|
142
|
+
type: "database",
|
|
143
|
+
subtype: "cosmosdb",
|
|
144
|
+
operation: "patch",
|
|
145
|
+
container,
|
|
146
|
+
id,
|
|
147
|
+
partitionKey,
|
|
148
|
+
patchOperations,
|
|
149
|
+
condition: options?.condition,
|
|
150
|
+
timeoutMs: options?.timeoutMs,
|
|
151
|
+
};
|
|
152
|
+
return this.invokeRaw(payload, invocationKey);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=cosmosdb.js.map
|
|
@@ -0,0 +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,SA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SAC9B,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAE3C,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var index_exports = {};
|
|
21
21
|
__export(index_exports, {
|
|
22
22
|
BaseResourceClient: () => import_base.BaseResourceClient,
|
|
23
|
+
CosmosDBResourceClient: () => import_cosmosdb.CosmosDBResourceClient,
|
|
23
24
|
CustomApiResourceClient: () => import_api_custom.CustomApiResourceClient,
|
|
24
25
|
DynamoDBResourceClient: () => import_dynamodb.DynamoDBResourceClient,
|
|
25
26
|
GoogleSheetsResourceClient: () => import_googlesheets.GoogleSheetsResourceClient,
|
|
@@ -34,6 +35,7 @@ var import_base = require("./base");
|
|
|
34
35
|
var import_errors = require("./errors");
|
|
35
36
|
var import_postgres = require("./clients/postgres");
|
|
36
37
|
var import_dynamodb = require("./clients/dynamodb");
|
|
38
|
+
var import_cosmosdb = require("./clients/cosmosdb");
|
|
37
39
|
var import_api_custom = require("./clients/api-custom");
|
|
38
40
|
var import_hubspot = require("./clients/hubspot");
|
|
39
41
|
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 { 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 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 { 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;;;;;;;;;;;;;AACA,0BAAc,sBADd;AAIA,kBAA0D;AAG1D,oBAAoC;AAGpC,sBAAuC;AACvC,sBAAuC;AACvC,sBAAuC;AACvC,wBAAwC;AACxC,qBAAsC;AACtC,0BAA2C;AAC3C,gBAAiC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ export { BaseResourceClient, type BaseClientConfig } from "./base";
|
|
|
3
3
|
export { ResourceInvokeError } from "./errors";
|
|
4
4
|
export { PostgresResourceClient } from "./clients/postgres";
|
|
5
5
|
export { DynamoDBResourceClient } from "./clients/dynamodb";
|
|
6
|
+
export { CosmosDBResourceClient } from "./clients/cosmosdb";
|
|
6
7
|
export { CustomApiResourceClient } from "./clients/api-custom";
|
|
7
8
|
export { HubSpotResourceClient } from "./clients/hubspot";
|
|
8
9
|
export { GoogleSheetsResourceClient } from "./clients/googlesheets";
|
|
9
10
|
export { S3ResourceClient } from "./clients/s3";
|
|
10
|
-
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
11
|
+
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
11
12
|
//# 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,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,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,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"}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { ResourceInvokeError } from "./errors";
|
|
|
7
7
|
// Export individual clients
|
|
8
8
|
export { PostgresResourceClient } from "./clients/postgres";
|
|
9
9
|
export { DynamoDBResourceClient } from "./clients/dynamodb";
|
|
10
|
+
export { CosmosDBResourceClient } from "./clients/cosmosdb";
|
|
10
11
|
export { CustomApiResourceClient } from "./clients/api-custom";
|
|
11
12
|
export { HubSpotResourceClient } from "./clients/hubspot";
|
|
12
13
|
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,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,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"}
|
|
@@ -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 cosmosdb_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(cosmosdb_exports);
|
|
17
|
+
//# sourceMappingURL=cosmosdb.cjs.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursive type for CosmosDB document values
|
|
3
|
+
*/
|
|
4
|
+
export type CosmosValue = string | number | boolean | null | CosmosValue[] | {
|
|
5
|
+
[key: string]: CosmosValue;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Partition key type - single value or hierarchical array
|
|
9
|
+
*/
|
|
10
|
+
export type PartitionKey = string | number | boolean | null | (string | number | boolean | null)[];
|
|
11
|
+
/**
|
|
12
|
+
* Query parameter for parameterized SQL queries
|
|
13
|
+
*/
|
|
14
|
+
export interface CosmosQueryParameter {
|
|
15
|
+
name: string;
|
|
16
|
+
value: CosmosValue;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Patch operation for partial document updates
|
|
20
|
+
*/
|
|
21
|
+
export interface CosmosPatchOperation {
|
|
22
|
+
op: "add" | "set" | "replace" | "remove" | "incr";
|
|
23
|
+
path: string;
|
|
24
|
+
value?: CosmosValue;
|
|
25
|
+
}
|
|
26
|
+
interface CosmosDBPayloadBase {
|
|
27
|
+
type: "database";
|
|
28
|
+
subtype: "cosmosdb";
|
|
29
|
+
container: string;
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface CosmosQueryPayload extends CosmosDBPayloadBase {
|
|
33
|
+
operation: "query";
|
|
34
|
+
query: string;
|
|
35
|
+
parameters?: CosmosQueryParameter[];
|
|
36
|
+
partitionKey?: PartitionKey;
|
|
37
|
+
maxItemCount?: number;
|
|
38
|
+
continuationToken?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface CosmosReadPayload extends CosmosDBPayloadBase {
|
|
41
|
+
operation: "read";
|
|
42
|
+
id: string;
|
|
43
|
+
partitionKey: PartitionKey;
|
|
44
|
+
}
|
|
45
|
+
export interface CosmosCreatePayload extends CosmosDBPayloadBase {
|
|
46
|
+
operation: "create";
|
|
47
|
+
body: Record<string, CosmosValue>;
|
|
48
|
+
}
|
|
49
|
+
export interface CosmosReplacePayload extends CosmosDBPayloadBase {
|
|
50
|
+
operation: "replace";
|
|
51
|
+
id: string;
|
|
52
|
+
partitionKey: PartitionKey;
|
|
53
|
+
body: Record<string, CosmosValue>;
|
|
54
|
+
}
|
|
55
|
+
export interface CosmosUpsertPayload extends CosmosDBPayloadBase {
|
|
56
|
+
operation: "upsert";
|
|
57
|
+
body: Record<string, CosmosValue>;
|
|
58
|
+
}
|
|
59
|
+
export interface CosmosDeletePayload extends CosmosDBPayloadBase {
|
|
60
|
+
operation: "delete";
|
|
61
|
+
id: string;
|
|
62
|
+
partitionKey: PartitionKey;
|
|
63
|
+
}
|
|
64
|
+
export interface CosmosPatchPayload extends CosmosDBPayloadBase {
|
|
65
|
+
operation: "patch";
|
|
66
|
+
id: string;
|
|
67
|
+
partitionKey: PartitionKey;
|
|
68
|
+
patchOperations: CosmosPatchOperation[];
|
|
69
|
+
condition?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Discriminated union of all CosmosDB operation payloads
|
|
73
|
+
*/
|
|
74
|
+
export type DbCosmosDBPayload = CosmosQueryPayload | CosmosReadPayload | CosmosCreatePayload | CosmosReplacePayload | CosmosUpsertPayload | CosmosDeletePayload | CosmosPatchPayload;
|
|
75
|
+
export interface CosmosQueryResult<T = Record<string, unknown>> {
|
|
76
|
+
kind: "cosmosdb";
|
|
77
|
+
operation: "query";
|
|
78
|
+
documents: T[];
|
|
79
|
+
count: number;
|
|
80
|
+
continuationToken?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface CosmosReadResult<T = Record<string, unknown>> {
|
|
83
|
+
kind: "cosmosdb";
|
|
84
|
+
operation: "read";
|
|
85
|
+
document: T;
|
|
86
|
+
etag: string;
|
|
87
|
+
}
|
|
88
|
+
export interface CosmosCreateResult<T = Record<string, unknown>> {
|
|
89
|
+
kind: "cosmosdb";
|
|
90
|
+
operation: "create";
|
|
91
|
+
document: T;
|
|
92
|
+
}
|
|
93
|
+
export interface CosmosReplaceResult<T = Record<string, unknown>> {
|
|
94
|
+
kind: "cosmosdb";
|
|
95
|
+
operation: "replace";
|
|
96
|
+
document: T;
|
|
97
|
+
}
|
|
98
|
+
export interface CosmosUpsertResult<T = Record<string, unknown>> {
|
|
99
|
+
kind: "cosmosdb";
|
|
100
|
+
operation: "upsert";
|
|
101
|
+
document: T;
|
|
102
|
+
}
|
|
103
|
+
export interface CosmosDeleteResult {
|
|
104
|
+
kind: "cosmosdb";
|
|
105
|
+
operation: "delete";
|
|
106
|
+
}
|
|
107
|
+
export interface CosmosPatchResult<T = Record<string, unknown>> {
|
|
108
|
+
kind: "cosmosdb";
|
|
109
|
+
operation: "patch";
|
|
110
|
+
document: T;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Union of all CosmosDB operation results (non-generic version)
|
|
114
|
+
*/
|
|
115
|
+
export type DbCosmosDBResult = CosmosQueryResult | CosmosReadResult | CosmosCreateResult | CosmosReplaceResult | CosmosUpsertResult | CosmosDeleteResult | CosmosPatchResult;
|
|
116
|
+
/**
|
|
117
|
+
* Generic result type for typed document access
|
|
118
|
+
*/
|
|
119
|
+
export type DbCosmosDBResultGeneric<T = Record<string, unknown>> = CosmosQueryResult<T> | CosmosReadResult<T> | CosmosCreateResult<T> | CosmosReplaceResult<T> | CosmosUpsertResult<T> | CosmosDeleteResult | CosmosPatchResult<T>;
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=cosmosdb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosdb.d.ts","sourceRoot":"","sources":["../../src/schemas/cosmosdb.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,WAAW,EAAE,GACb;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAMD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EA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,gBAAgB,GACxB,iBAAiB,GACjB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAC3D,iBAAiB,CAAC,CAAC,CAAC,GACpB,gBAAgB,CAAC,CAAC,CAAC,GACnB,kBAAkB,CAAC,CAAC,CAAC,GACrB,mBAAmB,CAAC,CAAC,CAAC,GACtB,kBAAkB,CAAC,CAAC,CAAC,GACrB,kBAAkB,GAClB,iBAAiB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosdb.js","sourceRoot":"","sources":["../../src/schemas/cosmosdb.ts"],"names":[],"mappings":""}
|
package/dist/schemas/index.cjs
CHANGED
|
@@ -18,6 +18,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
18
18
|
__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
|
+
__reExport(index_exports, require("./cosmosdb"), module.exports);
|
|
21
22
|
__reExport(index_exports, require("./s3"), module.exports);
|
|
22
23
|
__reExport(index_exports, require("./api-custom"), module.exports);
|
|
23
24
|
__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 \"./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 { 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 | ApiHubSpotPayload\n | ApiGoogleSheetsPayload\n | StorageS3Payload;\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,uBAHd;AAIA,0BAAc,
|
|
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,iBALd;AAMA,0BAAc,yBANd;AAOA,0BAAc,0BAPd;AAQA,0BAAc,+BARd;AASA,0BAAc,sBATd;AAUA,0BAAc,uBAVd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./common";
|
|
2
2
|
export * from "./postgres";
|
|
3
3
|
export * from "./dynamodb";
|
|
4
|
+
export * from "./cosmosdb";
|
|
4
5
|
export * from "./s3";
|
|
5
6
|
export * from "./api-custom";
|
|
6
7
|
export * from "./api-hubspot";
|
|
@@ -12,10 +13,11 @@ import type { ApiHubSpotPayload } from "./api-hubspot";
|
|
|
12
13
|
import type { ApiGoogleSheetsPayload } from "./api-googlesheets";
|
|
13
14
|
import type { DbPostgresPayload } from "./postgres";
|
|
14
15
|
import type { DbDynamoDBPayload } from "./dynamodb";
|
|
16
|
+
import type { DbCosmosDBPayload } from "./cosmosdb";
|
|
15
17
|
import type { StorageS3Payload } from "./s3";
|
|
16
18
|
/**
|
|
17
19
|
* Discriminated union of all resource payload types
|
|
18
20
|
* Use the 'subtype' field to narrow the type
|
|
19
21
|
*/
|
|
20
|
-
export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbDynamoDBPayload | ApiHubSpotPayload | ApiGoogleSheetsPayload | StorageS3Payload;
|
|
22
|
+
export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbDynamoDBPayload | DbCosmosDBPayload | ApiHubSpotPayload | ApiGoogleSheetsPayload | StorageS3Payload;
|
|
21
23
|
//# 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,MAAM,CAAC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,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAC7B,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,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,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,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -2,10 +2,11 @@ import type { ApiResult } from "./common";
|
|
|
2
2
|
import type { DbResult } from "./postgres";
|
|
3
3
|
import type { StorageS3Result } from "./s3";
|
|
4
4
|
import type { DbDynamoDBResult } from "./dynamodb";
|
|
5
|
+
import type { DbCosmosDBResult, DbCosmosDBResultGeneric } from "./cosmosdb";
|
|
5
6
|
/**
|
|
6
7
|
* Union of all possible resource invocation result types
|
|
7
8
|
*/
|
|
8
|
-
export type ResourceInvokeSuccess = ApiResult | DbResult | StorageS3Result | DbDynamoDBResult;
|
|
9
|
+
export type ResourceInvokeSuccess = ApiResult | DbResult | StorageS3Result | DbDynamoDBResult | DbCosmosDBResult;
|
|
9
10
|
/**
|
|
10
11
|
* Base successful invocation response - generic over result type
|
|
11
12
|
*/
|
|
@@ -53,4 +54,8 @@ export type StorageInvokeResponse = BaseInvokeSuccess<StorageS3Result> | InvokeF
|
|
|
53
54
|
* Response from DynamoDB database resource invocation
|
|
54
55
|
*/
|
|
55
56
|
export type DynamoDBInvokeResponse = BaseInvokeSuccess<DbDynamoDBResult> | InvokeFailure;
|
|
57
|
+
/**
|
|
58
|
+
* Response from CosmosDB database resource invocation (generic for typed documents)
|
|
59
|
+
*/
|
|
60
|
+
export type CosmosDBInvokeResponse<T = Record<string, unknown>> = BaseInvokeSuccess<DbCosmosDBResultGeneric<T>> | InvokeFailure;
|
|
56
61
|
//# 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;
|
|
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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