@major-tech/resource-client 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -16
- package/bin/generate-clients.mjs +4 -3
- package/dist/clients/dynamodb.cjs +40 -0
- package/dist/clients/dynamodb.cjs.map +7 -0
- package/dist/clients/dynamodb.d.ts +22 -0
- package/dist/clients/dynamodb.d.ts.map +1 -0
- package/dist/clients/dynamodb.js +13 -0
- package/dist/clients/dynamodb.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/dynamodb.cjs +17 -0
- package/dist/schemas/dynamodb.cjs.map +7 -0
- package/dist/schemas/dynamodb.d.ts +66 -0
- package/dist/schemas/dynamodb.d.ts.map +1 -0
- package/dist/schemas/dynamodb.js +2 -0
- package/dist/schemas/dynamodb.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/package.json +4 -1
package/README.md
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
TS client: PostgreSQL/CustomAPI/HubSpot/S3. Type-safe, 0-dep, universal (Node/browser/edge), ESM+CJS.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
|
+
|
|
6
7
|
```bash
|
|
7
8
|
pnpm add @major-tech/resource-client
|
|
8
9
|
```
|
|
9
10
|
|
|
10
11
|
## Config (All Clients)
|
|
12
|
+
|
|
11
13
|
```typescript
|
|
12
14
|
{ baseUrl: string; applicationId: string; resourceId: string; majorJwtToken?: string; fetch?: typeof fetch }
|
|
13
15
|
```
|
|
14
16
|
|
|
15
17
|
## Response Format
|
|
18
|
+
|
|
16
19
|
```typescript
|
|
17
20
|
{ ok: true; requestId: string; result: T } | { ok: false; requestId: string; error: { message: string; httpStatus?: number } }
|
|
18
21
|
```
|
|
@@ -24,24 +27,72 @@ pnpm add @major-tech/resource-client
|
|
|
24
27
|
**Method:** `invoke(sql: string, params: DbParamPrimitive[] | undefined, invocationKey: string, timeoutMs?: number): Promise<DatabaseInvokeResponse>`
|
|
25
28
|
|
|
26
29
|
**Params:**
|
|
30
|
+
|
|
27
31
|
- `sql`: SQL query string
|
|
28
32
|
- `params`: `(string | number | boolean | null)[]` - positional params ($1, $2, etc)
|
|
29
33
|
- `invocationKey`: unique operation ID (regex: `[a-zA-Z0-9][a-zA-Z0-9._:-]*`)
|
|
30
34
|
- `timeoutMs`: optional timeout
|
|
31
35
|
|
|
32
36
|
**Result (ok=true):**
|
|
37
|
+
|
|
33
38
|
```typescript
|
|
34
39
|
{ kind: "database"; rows: Record<string, unknown>[]; rowsAffected?: number }
|
|
35
40
|
```
|
|
36
41
|
|
|
37
42
|
**Example:**
|
|
43
|
+
|
|
38
44
|
```typescript
|
|
39
|
-
import { PostgresResourceClient } from
|
|
40
|
-
const c = new PostgresResourceClient({
|
|
41
|
-
|
|
45
|
+
import { PostgresResourceClient } from "@major-tech/resource-client";
|
|
46
|
+
const c = new PostgresResourceClient({
|
|
47
|
+
baseUrl,
|
|
48
|
+
applicationId,
|
|
49
|
+
resourceId,
|
|
50
|
+
majorJwtToken,
|
|
51
|
+
});
|
|
52
|
+
const r = await c.invoke(
|
|
53
|
+
"SELECT * FROM users WHERE id = $1",
|
|
54
|
+
[123],
|
|
55
|
+
"fetch-user"
|
|
56
|
+
);
|
|
42
57
|
// r.ok ? r.result.rows : r.error.message
|
|
43
58
|
```
|
|
44
59
|
|
|
60
|
+
## DynamoDBResourceClient
|
|
61
|
+
|
|
62
|
+
**Constructor:** `new DynamoDBResourceClient(config: BaseClientConfig)`
|
|
63
|
+
|
|
64
|
+
**Method:** `invoke(command: DbDynamoDBPayload["command"], params: Record<string, unknown>, invocationKey: string, timeoutMs?: number): Promise<DatabaseInvokeResponse>`
|
|
65
|
+
|
|
66
|
+
**Params:**
|
|
67
|
+
|
|
68
|
+
- `command`: `"GetItem" | "PutItem" | "UpdateItem" | "DeleteItem" | "Query" | "Scan" | ...`
|
|
69
|
+
- `params`: Command parameters (e.g., `{ TableName: 'users', Key: { id: { S: '123' } } }`)
|
|
70
|
+
- `invocationKey`: unique operation ID
|
|
71
|
+
- `timeoutMs`: optional timeout
|
|
72
|
+
|
|
73
|
+
**Result (ok=true):**
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
{
|
|
77
|
+
kind: "database";
|
|
78
|
+
command: string;
|
|
79
|
+
data: unknown;
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Example:**
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { DynamoDBResourceClient } from "@major-tech/resource-client";
|
|
87
|
+
const c = new DynamoDBResourceClient({ baseUrl, applicationId, resourceId });
|
|
88
|
+
const r = await c.invoke(
|
|
89
|
+
"GetItem",
|
|
90
|
+
{ TableName: "users", Key: { id: { S: "123" } } },
|
|
91
|
+
"get-user"
|
|
92
|
+
);
|
|
93
|
+
// r.ok ? r.result.data : r.error
|
|
94
|
+
```
|
|
95
|
+
|
|
45
96
|
## CustomApiResourceClient
|
|
46
97
|
|
|
47
98
|
**Constructor:** `new CustomApiResourceClient(config: BaseClientConfig)`
|
|
@@ -49,6 +100,7 @@ const r = await c.invoke('SELECT * FROM users WHERE id = $1', [123], 'fetch-user
|
|
|
49
100
|
**Method:** `invoke(method: HttpMethod, path: string, invocationKey: string, options?: { query?: QueryParams; headers?: Record<string, string>; body?: BodyPayload; timeoutMs?: number }): Promise<ApiInvokeResponse>`
|
|
50
101
|
|
|
51
102
|
**Params:**
|
|
103
|
+
|
|
52
104
|
- `method`: `"GET" | "POST" | "PUT" | "PATCH" | "DELETE"`
|
|
53
105
|
- `path`: URL path (appended to resource baseUrl)
|
|
54
106
|
- `invocationKey`: unique operation ID
|
|
@@ -58,17 +110,21 @@ const r = await c.invoke('SELECT * FROM users WHERE id = $1', [123], 'fetch-user
|
|
|
58
110
|
- `options.timeoutMs`: timeout (default: 30000)
|
|
59
111
|
|
|
60
112
|
**Result (ok=true):**
|
|
113
|
+
|
|
61
114
|
```typescript
|
|
62
115
|
{ kind: "api"; status: number; body: { kind: "json"; value: unknown } | { kind: "text"; value: string } | { kind: "bytes"; base64: string; contentType: string } }
|
|
63
116
|
```
|
|
64
117
|
|
|
65
118
|
**Example:**
|
|
119
|
+
|
|
66
120
|
```typescript
|
|
67
|
-
import { CustomApiResourceClient } from
|
|
121
|
+
import { CustomApiResourceClient } from "@major-tech/resource-client";
|
|
68
122
|
const c = new CustomApiResourceClient({ baseUrl, applicationId, resourceId });
|
|
69
|
-
const r = await c.invoke(
|
|
70
|
-
query: { currency:
|
|
71
|
-
|
|
123
|
+
const r = await c.invoke("POST", "/v1/pay", "create-pay", {
|
|
124
|
+
query: { currency: "USD" },
|
|
125
|
+
headers: { "X-Key": "val" },
|
|
126
|
+
body: { type: "json", value: { amt: 100 } },
|
|
127
|
+
timeoutMs: 5000,
|
|
72
128
|
});
|
|
73
129
|
// r.ok ? r.result.status : r.error
|
|
74
130
|
```
|
|
@@ -80,6 +136,7 @@ const r = await c.invoke('POST', '/v1/pay', 'create-pay', {
|
|
|
80
136
|
**Method:** `invoke(method: HttpMethod, path: string, invocationKey: string, options?: { query?: QueryParams; body?: { type: "json"; value: unknown }; timeoutMs?: number }): Promise<ApiInvokeResponse>`
|
|
81
137
|
|
|
82
138
|
**Params:**
|
|
139
|
+
|
|
83
140
|
- `method`: `"GET" | "POST" | "PUT" | "PATCH" | "DELETE"`
|
|
84
141
|
- `path`: HubSpot API path
|
|
85
142
|
- `invocationKey`: unique operation ID
|
|
@@ -90,10 +147,13 @@ const r = await c.invoke('POST', '/v1/pay', 'create-pay', {
|
|
|
90
147
|
**Result:** Same as CustomApiResourceClient
|
|
91
148
|
|
|
92
149
|
**Example:**
|
|
150
|
+
|
|
93
151
|
```typescript
|
|
94
|
-
import { HubSpotResourceClient } from
|
|
152
|
+
import { HubSpotResourceClient } from "@major-tech/resource-client";
|
|
95
153
|
const c = new HubSpotResourceClient({ baseUrl, applicationId, resourceId });
|
|
96
|
-
const r = await c.invoke(
|
|
154
|
+
const r = await c.invoke("GET", "/crm/v3/objects/contacts", "fetch-contacts", {
|
|
155
|
+
query: { limit: "10" },
|
|
156
|
+
});
|
|
97
157
|
// r.ok && r.result.body.kind === 'json' ? r.result.body.value : r.error
|
|
98
158
|
```
|
|
99
159
|
|
|
@@ -104,29 +164,42 @@ const r = await c.invoke('GET', '/crm/v3/objects/contacts', 'fetch-contacts', {
|
|
|
104
164
|
**Method:** `invoke(command: S3Command, params: Record<string, unknown>, invocationKey: string, options?: { timeoutMs?: number }): Promise<StorageInvokeResponse>`
|
|
105
165
|
|
|
106
166
|
**Params:**
|
|
167
|
+
|
|
107
168
|
- `command`: `"ListObjectsV2" | "HeadObject" | "GetObjectTagging" | "PutObjectTagging" | "DeleteObject" | "DeleteObjects" | "CopyObject" | "ListBuckets" | "GetBucketLocation" | "GeneratePresignedUrl"`
|
|
108
169
|
- `params`: Command-specific params (e.g., `{ Bucket, Prefix, Key, expiresIn }`)
|
|
109
170
|
- `invocationKey`: unique operation ID
|
|
110
171
|
- `options.timeoutMs`: optional timeout
|
|
111
172
|
|
|
112
173
|
**Result (ok=true):**
|
|
174
|
+
|
|
113
175
|
```typescript
|
|
114
176
|
{ kind: "storage"; command: string; data: unknown } | { kind: "storage"; presignedUrl: string; expiresAt: string }
|
|
115
177
|
```
|
|
178
|
+
|
|
116
179
|
- Standard commands return `{ kind: "storage"; command; data }`
|
|
117
180
|
- `GeneratePresignedUrl` returns `{ kind: "storage"; presignedUrl; expiresAt }`
|
|
118
181
|
|
|
119
182
|
**Example:**
|
|
183
|
+
|
|
120
184
|
```typescript
|
|
121
|
-
import { S3ResourceClient } from
|
|
185
|
+
import { S3ResourceClient } from "@major-tech/resource-client";
|
|
122
186
|
const c = new S3ResourceClient({ baseUrl, applicationId, resourceId });
|
|
123
|
-
const r = await c.invoke(
|
|
187
|
+
const r = await c.invoke(
|
|
188
|
+
"ListObjectsV2",
|
|
189
|
+
{ Bucket: "my-bucket", Prefix: "uploads/" },
|
|
190
|
+
"list-uploads"
|
|
191
|
+
);
|
|
124
192
|
// r.ok ? r.result.data : r.error
|
|
125
|
-
const u = await c.invoke(
|
|
193
|
+
const u = await c.invoke(
|
|
194
|
+
"GeneratePresignedUrl",
|
|
195
|
+
{ Bucket: "my-bucket", Key: "file.pdf", expiresIn: 3600 },
|
|
196
|
+
"presigned"
|
|
197
|
+
);
|
|
126
198
|
// u.ok && 'presignedUrl' in u.result ? u.result.presignedUrl : u.error
|
|
127
199
|
```
|
|
128
200
|
|
|
129
201
|
## Error Handling
|
|
202
|
+
|
|
130
203
|
```typescript
|
|
131
204
|
import { ResourceInvokeError } from '@major-tech/resource-client';
|
|
132
205
|
try { await client.invoke(...); }
|
|
@@ -136,14 +209,16 @@ catch (e) { if (e instanceof ResourceInvokeError) { e.message, e.httpStatus, e.r
|
|
|
136
209
|
## CLI - Singleton Generator
|
|
137
210
|
|
|
138
211
|
**Commands:**
|
|
212
|
+
|
|
139
213
|
- `npx major-client add <resourceId> <name> <type> <desc> <appId>` - Add resource, generate singleton
|
|
140
214
|
- `npx major-client list` - List all resources
|
|
141
215
|
- `npx major-client remove <name>` - Remove resource
|
|
142
216
|
- `npx major-client regenerate` - Regenerate all clients
|
|
143
217
|
|
|
144
|
-
**Types:** `database-postgresql | api-custom | api-hubspot | storage-s3`
|
|
218
|
+
**Types:** `database-postgresql | database-dynamodb | api-custom | api-hubspot | storage-s3`
|
|
145
219
|
|
|
146
220
|
**Generated Files:**
|
|
221
|
+
|
|
147
222
|
- `resources.json` - Resource registry
|
|
148
223
|
- `src/clients/<name>.ts` - Singleton client
|
|
149
224
|
- `src/clients/index.ts` - Exports
|
|
@@ -151,12 +226,18 @@ catch (e) { if (e instanceof ResourceInvokeError) { e.message, e.httpStatus, e.r
|
|
|
151
226
|
**Env Vars:** `MAJOR_API_BASE_URL`, `MAJOR_JWT_TOKEN`
|
|
152
227
|
|
|
153
228
|
**Example:**
|
|
229
|
+
|
|
154
230
|
```bash
|
|
155
231
|
npx major-client add "res_123" "orders-db" "database-postgresql" "Orders DB" "app_456"
|
|
156
232
|
```
|
|
233
|
+
|
|
157
234
|
```typescript
|
|
158
|
-
import { ordersDbClient } from
|
|
159
|
-
const r = await ordersDbClient.invoke(
|
|
235
|
+
import { ordersDbClient } from "./clients";
|
|
236
|
+
const r = await ordersDbClient.invoke(
|
|
237
|
+
"SELECT * FROM orders",
|
|
238
|
+
[],
|
|
239
|
+
"list-orders"
|
|
240
|
+
);
|
|
160
241
|
```
|
|
161
242
|
|
|
162
|
-
MIT License
|
|
243
|
+
MIT License
|
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 | api-hubspot | api-custom | storage-s3
|
|
11
|
+
* Types: database-postgresql | database-dynamodb | api-hubspot | 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"
|
|
@@ -118,6 +118,7 @@ function toCamelCase(str) {
|
|
|
118
118
|
function getClientClass(type) {
|
|
119
119
|
const typeMap = {
|
|
120
120
|
'database-postgresql': 'PostgresResourceClient',
|
|
121
|
+
'database-dynamodb': 'DynamoDBResourceClient',
|
|
121
122
|
'api-custom': 'CustomApiResourceClient',
|
|
122
123
|
'api-hubspot': 'HubSpotResourceClient',
|
|
123
124
|
'storage-s3': 'S3ResourceClient',
|
|
@@ -154,7 +155,7 @@ function generateIndexFile(resources) {
|
|
|
154
155
|
}
|
|
155
156
|
|
|
156
157
|
function addResource(resourceId, name, type, description, applicationId) {
|
|
157
|
-
const validTypes = ['database-postgresql', 'api-hubspot', 'api-custom', 'storage-s3'];
|
|
158
|
+
const validTypes = ['database-postgresql', 'database-dynamodb', 'api-hubspot', 'api-custom', 'storage-s3'];
|
|
158
159
|
if (!validTypes.includes(type)) {
|
|
159
160
|
console.error(`❌ Invalid type: ${type}`);
|
|
160
161
|
console.log(` Valid types: ${validTypes.join(', ')}`);
|
|
@@ -276,7 +277,7 @@ function main() {
|
|
|
276
277
|
console.log(' npx @major-tech/resource-client add <resource_id> <name> <type> <description> <application_id>');
|
|
277
278
|
console.log(' npx @major-tech/resource-client remove <name>');
|
|
278
279
|
console.log(' npx @major-tech/resource-client list');
|
|
279
|
-
console.log('\nTypes: database-postgresql | api-hubspot | api-custom | storage-s3');
|
|
280
|
+
console.log('\nTypes: database-postgresql | database-dynamodb | api-hubspot | api-custom | storage-s3');
|
|
280
281
|
return;
|
|
281
282
|
}
|
|
282
283
|
|
|
@@ -0,0 +1,40 @@
|
|
|
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 dynamodb_exports = {};
|
|
21
|
+
__export(dynamodb_exports, {
|
|
22
|
+
DynamoDBResourceClient: () => DynamoDBResourceClient
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(dynamodb_exports);
|
|
25
|
+
var import_base = require("../base");
|
|
26
|
+
class DynamoDBResourceClient extends import_base.BaseResourceClient {
|
|
27
|
+
static {
|
|
28
|
+
__name(this, "DynamoDBResourceClient");
|
|
29
|
+
}
|
|
30
|
+
async invoke(command, params, invocationKey) {
|
|
31
|
+
const payload = {
|
|
32
|
+
type: "database",
|
|
33
|
+
subtype: "dynamodb",
|
|
34
|
+
command,
|
|
35
|
+
params
|
|
36
|
+
};
|
|
37
|
+
return this.invokeRaw(payload, invocationKey);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=dynamodb.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/clients/dynamodb.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n DbDynamoDBPayload,\n DatabaseInvokeResponse,\n} from \"../schemas\";\nimport type {\n GetItemCommandInput,\n PutItemCommandInput,\n UpdateItemCommandInput,\n DeleteItemCommandInput,\n QueryCommandInput,\n ScanCommandInput,\n BatchGetItemCommandInput,\n BatchWriteItemCommandInput,\n TransactGetItemsCommandInput,\n TransactWriteItemsCommandInput,\n ListTablesCommandInput,\n DescribeTableCommandInput,\n} from \"@aws-sdk/client-dynamodb\";\nimport { BaseResourceClient } from \"../base\";\n\ntype DynamoDBCommandMap = {\n GetItem: GetItemCommandInput;\n PutItem: PutItemCommandInput;\n UpdateItem: UpdateItemCommandInput;\n DeleteItem: DeleteItemCommandInput;\n Query: QueryCommandInput;\n Scan: ScanCommandInput;\n BatchGetItem: BatchGetItemCommandInput;\n BatchWriteItem: BatchWriteItemCommandInput;\n TransactGetItems: TransactGetItemsCommandInput;\n TransactWriteItems: TransactWriteItemsCommandInput;\n ListTables: ListTablesCommandInput;\n DescribeTable: DescribeTableCommandInput;\n};\n\nexport class DynamoDBResourceClient extends BaseResourceClient {\n async invoke<C extends keyof DynamoDBCommandMap>(\n command: C,\n params: DynamoDBCommandMap[C],\n invocationKey: string,\n ): Promise<DatabaseInvokeResponse> {\n const payload = {\n type: \"database\" as const,\n subtype: \"dynamodb\" as const,\n command,\n params,\n };\n\n return this.invokeRaw(payload as DbDynamoDBPayload, invocationKey) as Promise<DatabaseInvokeResponse>;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAkBA;;;;;AAAA,kBAAmC;AAiB7B,MAAO,+BAA+B,+BAAkB;EAjB9D,OAiB8D;;;EAC5D,MAAM,OACJ,SACA,QACA,eAAqB;AAErB,UAAM,UAAU;MACd,MAAM;MACN,SAAS;MACT;MACA;;AAGF,WAAO,KAAK,UAAU,SAA8B,aAAa;EACnE;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DatabaseInvokeResponse } from "../schemas";
|
|
2
|
+
import type { GetItemCommandInput, PutItemCommandInput, UpdateItemCommandInput, DeleteItemCommandInput, QueryCommandInput, ScanCommandInput, BatchGetItemCommandInput, BatchWriteItemCommandInput, TransactGetItemsCommandInput, TransactWriteItemsCommandInput, ListTablesCommandInput, DescribeTableCommandInput } from "@aws-sdk/client-dynamodb";
|
|
3
|
+
import { BaseResourceClient } from "../base";
|
|
4
|
+
type DynamoDBCommandMap = {
|
|
5
|
+
GetItem: GetItemCommandInput;
|
|
6
|
+
PutItem: PutItemCommandInput;
|
|
7
|
+
UpdateItem: UpdateItemCommandInput;
|
|
8
|
+
DeleteItem: DeleteItemCommandInput;
|
|
9
|
+
Query: QueryCommandInput;
|
|
10
|
+
Scan: ScanCommandInput;
|
|
11
|
+
BatchGetItem: BatchGetItemCommandInput;
|
|
12
|
+
BatchWriteItem: BatchWriteItemCommandInput;
|
|
13
|
+
TransactGetItems: TransactGetItemsCommandInput;
|
|
14
|
+
TransactWriteItems: TransactWriteItemsCommandInput;
|
|
15
|
+
ListTables: ListTablesCommandInput;
|
|
16
|
+
DescribeTable: DescribeTableCommandInput;
|
|
17
|
+
};
|
|
18
|
+
export declare class DynamoDBResourceClient extends BaseResourceClient {
|
|
19
|
+
invoke<C extends keyof DynamoDBCommandMap>(command: C, params: DynamoDBCommandMap[C], invocationKey: string): Promise<DatabaseInvokeResponse>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=dynamodb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.d.ts","sourceRoot":"","sources":["../../src/clients/dynamodb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,sBAAsB,CAAC;IACnC,UAAU,EAAE,sBAAsB,CAAC;IACnC,KAAK,EAAE,iBAAiB,CAAC;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,YAAY,EAAE,wBAAwB,CAAC;IACvC,cAAc,EAAE,0BAA0B,CAAC;IAC3C,gBAAgB,EAAE,4BAA4B,CAAC;IAC/C,kBAAkB,EAAE,8BAA8B,CAAC;IACnD,UAAU,EAAE,sBAAsB,CAAC;IACnC,aAAa,EAAE,yBAAyB,CAAC;CAC1C,CAAC;AAEF,qBAAa,sBAAuB,SAAQ,kBAAkB;IACtD,MAAM,CAAC,CAAC,SAAS,MAAM,kBAAkB,EAC7C,OAAO,EAAE,CAAC,EACV,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC7B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC;CAUnC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseResourceClient } from "../base";
|
|
2
|
+
export class DynamoDBResourceClient extends BaseResourceClient {
|
|
3
|
+
async invoke(command, params, invocationKey) {
|
|
4
|
+
const payload = {
|
|
5
|
+
type: "database",
|
|
6
|
+
subtype: "dynamodb",
|
|
7
|
+
command,
|
|
8
|
+
params,
|
|
9
|
+
};
|
|
10
|
+
return this.invokeRaw(payload, invocationKey);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=dynamodb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.js","sourceRoot":"","sources":["../../src/clients/dynamodb.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAiB7C,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D,KAAK,CAAC,MAAM,CACV,OAAU,EACV,MAA6B,EAC7B,aAAqB;QAErB,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,UAAmB;YACzB,OAAO,EAAE,UAAmB;YAC5B,OAAO;YACP,MAAM;SACP,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAA4B,EAAE,aAAa,CAAoC,CAAC;IACxG,CAAC;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var index_exports = {};
|
|
|
21
21
|
__export(index_exports, {
|
|
22
22
|
BaseResourceClient: () => import_base.BaseResourceClient,
|
|
23
23
|
CustomApiResourceClient: () => import_api_custom.CustomApiResourceClient,
|
|
24
|
+
DynamoDBResourceClient: () => import_dynamodb.DynamoDBResourceClient,
|
|
24
25
|
HubSpotResourceClient: () => import_hubspot.HubSpotResourceClient,
|
|
25
26
|
PostgresResourceClient: () => import_postgres.PostgresResourceClient,
|
|
26
27
|
ResourceInvokeError: () => import_errors.ResourceInvokeError,
|
|
@@ -31,6 +32,7 @@ __reExport(index_exports, require("./schemas"), module.exports);
|
|
|
31
32
|
var import_base = require("./base");
|
|
32
33
|
var import_errors = require("./errors");
|
|
33
34
|
var import_postgres = require("./clients/postgres");
|
|
35
|
+
var import_dynamodb = require("./clients/dynamodb");
|
|
34
36
|
var import_api_custom = require("./clients/api-custom");
|
|
35
37
|
var import_hubspot = require("./clients/hubspot");
|
|
36
38
|
var import_s3 = require("./clients/s3");
|
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 { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { S3ResourceClient } from \"./clients/s3\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\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 { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { S3ResourceClient } from \"./clients/s3\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\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,wBAAwC;AACxC,qBAAsC;AACtC,gBAAiC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./schemas";
|
|
|
2
2
|
export { BaseResourceClient, type BaseClientConfig } from "./base";
|
|
3
3
|
export { ResourceInvokeError } from "./errors";
|
|
4
4
|
export { PostgresResourceClient } from "./clients/postgres";
|
|
5
|
+
export { DynamoDBResourceClient } from "./clients/dynamodb";
|
|
5
6
|
export { CustomApiResourceClient } from "./clients/api-custom";
|
|
6
7
|
export { HubSpotResourceClient } from "./clients/hubspot";
|
|
7
8
|
export { S3ResourceClient } from "./clients/s3";
|
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,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,YAAY,EACV,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,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,YAAY,EACV,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { BaseResourceClient } from "./base";
|
|
|
6
6
|
export { ResourceInvokeError } from "./errors";
|
|
7
7
|
// Export individual clients
|
|
8
8
|
export { PostgresResourceClient } from "./clients/postgres";
|
|
9
|
+
export { DynamoDBResourceClient } from "./clients/dynamodb";
|
|
9
10
|
export { CustomApiResourceClient } from "./clients/api-custom";
|
|
10
11
|
export { HubSpotResourceClient } from "./clients/hubspot";
|
|
11
12
|
export { S3ResourceClient } from "./clients/s3";
|
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,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,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,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,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 dynamodb_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(dynamodb_exports);
|
|
17
|
+
//# sourceMappingURL=dynamodb.cjs.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { GetItemCommandInput, PutItemCommandInput, UpdateItemCommandInput, DeleteItemCommandInput, QueryCommandInput, ScanCommandInput, BatchGetItemCommandInput, BatchWriteItemCommandInput, TransactGetItemsCommandInput, TransactWriteItemsCommandInput, ListTablesCommandInput, DescribeTableCommandInput } from "@aws-sdk/client-dynamodb";
|
|
2
|
+
/**
|
|
3
|
+
* Payload for invoking a DynamoDB database resource
|
|
4
|
+
*/
|
|
5
|
+
export type DbDynamoDBPayload = {
|
|
6
|
+
type: "database";
|
|
7
|
+
subtype: "dynamodb";
|
|
8
|
+
command: "GetItem";
|
|
9
|
+
params: GetItemCommandInput;
|
|
10
|
+
} | {
|
|
11
|
+
type: "database";
|
|
12
|
+
subtype: "dynamodb";
|
|
13
|
+
command: "PutItem";
|
|
14
|
+
params: PutItemCommandInput;
|
|
15
|
+
} | {
|
|
16
|
+
type: "database";
|
|
17
|
+
subtype: "dynamodb";
|
|
18
|
+
command: "UpdateItem";
|
|
19
|
+
params: UpdateItemCommandInput;
|
|
20
|
+
} | {
|
|
21
|
+
type: "database";
|
|
22
|
+
subtype: "dynamodb";
|
|
23
|
+
command: "DeleteItem";
|
|
24
|
+
params: DeleteItemCommandInput;
|
|
25
|
+
} | {
|
|
26
|
+
type: "database";
|
|
27
|
+
subtype: "dynamodb";
|
|
28
|
+
command: "Query";
|
|
29
|
+
params: QueryCommandInput;
|
|
30
|
+
} | {
|
|
31
|
+
type: "database";
|
|
32
|
+
subtype: "dynamodb";
|
|
33
|
+
command: "Scan";
|
|
34
|
+
params: ScanCommandInput;
|
|
35
|
+
} | {
|
|
36
|
+
type: "database";
|
|
37
|
+
subtype: "dynamodb";
|
|
38
|
+
command: "BatchGetItem";
|
|
39
|
+
params: BatchGetItemCommandInput;
|
|
40
|
+
} | {
|
|
41
|
+
type: "database";
|
|
42
|
+
subtype: "dynamodb";
|
|
43
|
+
command: "BatchWriteItem";
|
|
44
|
+
params: BatchWriteItemCommandInput;
|
|
45
|
+
} | {
|
|
46
|
+
type: "database";
|
|
47
|
+
subtype: "dynamodb";
|
|
48
|
+
command: "TransactGetItems";
|
|
49
|
+
params: TransactGetItemsCommandInput;
|
|
50
|
+
} | {
|
|
51
|
+
type: "database";
|
|
52
|
+
subtype: "dynamodb";
|
|
53
|
+
command: "TransactWriteItems";
|
|
54
|
+
params: TransactWriteItemsCommandInput;
|
|
55
|
+
} | {
|
|
56
|
+
type: "database";
|
|
57
|
+
subtype: "dynamodb";
|
|
58
|
+
command: "ListTables";
|
|
59
|
+
params: ListTablesCommandInput;
|
|
60
|
+
} | {
|
|
61
|
+
type: "database";
|
|
62
|
+
subtype: "dynamodb";
|
|
63
|
+
command: "DescribeTable";
|
|
64
|
+
params: DescribeTableCommandInput;
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=dynamodb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.d.ts","sourceRoot":"","sources":["../../src/schemas/dynamodb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,sBAAsB,CAAC;CAChC,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,sBAAsB,CAAC;CAChC,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,gBAAgB,CAAC;CAC1B,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,wBAAwB,CAAC;CAClC,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE,0BAA0B,CAAC;CACpC,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,MAAM,EAAE,4BAA4B,CAAC;CACtC,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,EAAE,8BAA8B,CAAC;CACxC,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,sBAAsB,CAAC;CAChC,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,yBAAyB,CAAC;CACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.js","sourceRoot":"","sources":["../../src/schemas/dynamodb.ts"],"names":[],"mappings":""}
|
package/dist/schemas/index.cjs
CHANGED
|
@@ -17,6 +17,7 @@ var index_exports = {};
|
|
|
17
17
|
module.exports = __toCommonJS(index_exports);
|
|
18
18
|
__reExport(index_exports, require("./common"), module.exports);
|
|
19
19
|
__reExport(index_exports, require("./postgres"), module.exports);
|
|
20
|
+
__reExport(index_exports, require("./dynamodb"), module.exports);
|
|
20
21
|
__reExport(index_exports, require("./s3"), module.exports);
|
|
21
22
|
__reExport(index_exports, require("./api-custom"), module.exports);
|
|
22
23
|
__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 \"./s3\";\nexport * from \"./api-custom\";\nexport * from \"./api-hubspot\";\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 { DbPostgresPayload } from \"./postgres\";\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 | ApiHubSpotPayload\n | StorageS3Payload;\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,
|
|
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 \"./request\";\nexport * from \"./response\";\n\n// Import for discriminated union\nimport type { ApiCustomPayload } from \"./api-custom\";\nimport type { ApiHubSpotPayload } from \"./api-hubspot\";\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 | StorageS3Payload;\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,uBAHd;AAIA,0BAAc,iBAJd;AAKA,0BAAc,yBALd;AAMA,0BAAc,0BANd;AAOA,0BAAc,sBAPd;AAQA,0BAAc,uBARd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./common";
|
|
2
2
|
export * from "./postgres";
|
|
3
|
+
export * from "./dynamodb";
|
|
3
4
|
export * from "./s3";
|
|
4
5
|
export * from "./api-custom";
|
|
5
6
|
export * from "./api-hubspot";
|
|
@@ -8,10 +9,11 @@ export * from "./response";
|
|
|
8
9
|
import type { ApiCustomPayload } from "./api-custom";
|
|
9
10
|
import type { ApiHubSpotPayload } from "./api-hubspot";
|
|
10
11
|
import type { DbPostgresPayload } from "./postgres";
|
|
12
|
+
import type { DbDynamoDBPayload } from "./dynamodb";
|
|
11
13
|
import type { StorageS3Payload } from "./s3";
|
|
12
14
|
/**
|
|
13
15
|
* Discriminated union of all resource payload types
|
|
14
16
|
* Use the 'subtype' field to narrow the type
|
|
15
17
|
*/
|
|
16
|
-
export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | ApiHubSpotPayload | StorageS3Payload;
|
|
18
|
+
export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbDynamoDBPayload | ApiHubSpotPayload | StorageS3Payload;
|
|
17
19
|
//# 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,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAG3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,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,gBAAgB,CAAC"}
|
|
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;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAG3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,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,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,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,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,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@major-tech/resource-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "TypeScript client library for invoking Major resources (PostgreSQL, Custom APIs, HubSpot, S3)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -55,5 +55,8 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"esbuild": "^0.24.0",
|
|
57
57
|
"typescript": "^5.9.3"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@aws-sdk/client-dynamodb": "^3.935.0"
|
|
58
61
|
}
|
|
59
62
|
}
|