@major-tech/resource-client 0.1.4 → 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 +200 -47
- package/bin/generate-clients.mjs +5 -4
- 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
|
@@ -1,90 +1,243 @@
|
|
|
1
1
|
# @major-tech/resource-client
|
|
2
2
|
|
|
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
|
-
pnpm
|
|
8
|
+
pnpm add @major-tech/resource-client
|
|
8
9
|
```
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Config (All Clients)
|
|
11
12
|
|
|
12
|
-
**Config (all clients):**
|
|
13
13
|
```typescript
|
|
14
14
|
{ baseUrl: string; applicationId: string; resourceId: string; majorJwtToken?: string; fetch?: typeof fetch }
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## Response Format
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
{ ok: true; requestId: string; result: T } | { ok: false; requestId: string; error: { message: string; httpStatus?: number } }
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## PostgresResourceClient
|
|
24
|
+
|
|
25
|
+
**Constructor:** `new PostgresResourceClient(config: BaseClientConfig)`
|
|
26
|
+
|
|
27
|
+
**Method:** `invoke(sql: string, params: DbParamPrimitive[] | undefined, invocationKey: string, timeoutMs?: number): Promise<DatabaseInvokeResponse>`
|
|
28
|
+
|
|
29
|
+
**Params:**
|
|
30
|
+
|
|
31
|
+
- `sql`: SQL query string
|
|
32
|
+
- `params`: `(string | number | boolean | null)[]` - positional params ($1, $2, etc)
|
|
33
|
+
- `invocationKey`: unique operation ID (regex: `[a-zA-Z0-9][a-zA-Z0-9._:-]*`)
|
|
34
|
+
- `timeoutMs`: optional timeout
|
|
35
|
+
|
|
36
|
+
**Result (ok=true):**
|
|
18
37
|
|
|
19
|
-
**PostgreSQL:**
|
|
20
38
|
```typescript
|
|
21
|
-
|
|
22
|
-
const client = new PostgresResourceClient({ baseUrl, applicationId, resourceId, majorJwtToken? });
|
|
23
|
-
const res = await client.invoke('SELECT * FROM users WHERE id = $1', [123], 'fetch-user-by-id');
|
|
24
|
-
// res.ok ? res.result.rows / res.result.rowsAffected : res.error.message
|
|
39
|
+
{ kind: "database"; rows: Record<string, unknown>[]; rowsAffected?: number }
|
|
25
40
|
```
|
|
26
41
|
|
|
27
|
-
**
|
|
42
|
+
**Example:**
|
|
43
|
+
|
|
28
44
|
```typescript
|
|
29
|
-
import {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
import { PostgresResourceClient } from "@major-tech/resource-client";
|
|
46
|
+
const c = new PostgresResourceClient({
|
|
47
|
+
baseUrl,
|
|
48
|
+
applicationId,
|
|
49
|
+
resourceId,
|
|
50
|
+
majorJwtToken,
|
|
34
51
|
});
|
|
35
|
-
|
|
52
|
+
const r = await c.invoke(
|
|
53
|
+
"SELECT * FROM users WHERE id = $1",
|
|
54
|
+
[123],
|
|
55
|
+
"fetch-user"
|
|
56
|
+
);
|
|
57
|
+
// r.ok ? r.result.rows : r.error.message
|
|
58
|
+
```
|
|
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
|
+
}
|
|
36
81
|
```
|
|
37
82
|
|
|
38
|
-
**
|
|
83
|
+
**Example:**
|
|
84
|
+
|
|
39
85
|
```typescript
|
|
40
|
-
import {
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
|
|
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
|
|
44
94
|
```
|
|
45
95
|
|
|
46
|
-
|
|
96
|
+
## CustomApiResourceClient
|
|
97
|
+
|
|
98
|
+
**Constructor:** `new CustomApiResourceClient(config: BaseClientConfig)`
|
|
99
|
+
|
|
100
|
+
**Method:** `invoke(method: HttpMethod, path: string, invocationKey: string, options?: { query?: QueryParams; headers?: Record<string, string>; body?: BodyPayload; timeoutMs?: number }): Promise<ApiInvokeResponse>`
|
|
101
|
+
|
|
102
|
+
**Params:**
|
|
103
|
+
|
|
104
|
+
- `method`: `"GET" | "POST" | "PUT" | "PATCH" | "DELETE"`
|
|
105
|
+
- `path`: URL path (appended to resource baseUrl)
|
|
106
|
+
- `invocationKey`: unique operation ID
|
|
107
|
+
- `options.query`: `Record<string, string | string[]>` - query params
|
|
108
|
+
- `options.headers`: `Record<string, string>` - additional headers
|
|
109
|
+
- `options.body`: `{ type: "json"; value: unknown } | { type: "text"; value: string } | { type: "bytes"; base64: string; contentType: string }`
|
|
110
|
+
- `options.timeoutMs`: timeout (default: 30000)
|
|
111
|
+
|
|
112
|
+
**Result (ok=true):**
|
|
113
|
+
|
|
47
114
|
```typescript
|
|
48
|
-
|
|
49
|
-
const client = new S3ResourceClient({ baseUrl, applicationId, resourceId });
|
|
50
|
-
const res = await client.invoke('ListObjectsV2', { Bucket: 'my-bucket', Prefix: 'uploads/' }, 'list-uploads');
|
|
51
|
-
// res.ok ? res.result.data : res.error
|
|
52
|
-
const url = await client.invoke('GeneratePresignedUrl', { Bucket: 'my-bucket', Key: 'file.pdf', expiresIn: 3600 }, 'presigned-url');
|
|
53
|
-
// url.ok && 'presignedUrl' in url.result ? url.result.presignedUrl / url.result.expiresAt : url.error
|
|
115
|
+
{ kind: "api"; status: number; body: { kind: "json"; value: unknown } | { kind: "text"; value: string } | { kind: "bytes"; base64: string; contentType: string } }
|
|
54
116
|
```
|
|
55
117
|
|
|
56
|
-
**
|
|
118
|
+
**Example:**
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
import { CustomApiResourceClient } from "@major-tech/resource-client";
|
|
122
|
+
const c = new CustomApiResourceClient({ baseUrl, applicationId, resourceId });
|
|
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,
|
|
128
|
+
});
|
|
129
|
+
// r.ok ? r.result.status : r.error
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## HubSpotResourceClient
|
|
133
|
+
|
|
134
|
+
**Constructor:** `new HubSpotResourceClient(config: BaseClientConfig)`
|
|
135
|
+
|
|
136
|
+
**Method:** `invoke(method: HttpMethod, path: string, invocationKey: string, options?: { query?: QueryParams; body?: { type: "json"; value: unknown }; timeoutMs?: number }): Promise<ApiInvokeResponse>`
|
|
137
|
+
|
|
138
|
+
**Params:**
|
|
139
|
+
|
|
140
|
+
- `method`: `"GET" | "POST" | "PUT" | "PATCH" | "DELETE"`
|
|
141
|
+
- `path`: HubSpot API path
|
|
142
|
+
- `invocationKey`: unique operation ID
|
|
143
|
+
- `options.query`: `Record<string, string | string[]>`
|
|
144
|
+
- `options.body`: `{ type: "json"; value: unknown }` - JSON only
|
|
145
|
+
- `options.timeoutMs`: timeout (default: 30000)
|
|
146
|
+
|
|
147
|
+
**Result:** Same as CustomApiResourceClient
|
|
148
|
+
|
|
149
|
+
**Example:**
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { HubSpotResourceClient } from "@major-tech/resource-client";
|
|
153
|
+
const c = new HubSpotResourceClient({ baseUrl, applicationId, resourceId });
|
|
154
|
+
const r = await c.invoke("GET", "/crm/v3/objects/contacts", "fetch-contacts", {
|
|
155
|
+
query: { limit: "10" },
|
|
156
|
+
});
|
|
157
|
+
// r.ok && r.result.body.kind === 'json' ? r.result.body.value : r.error
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## S3ResourceClient
|
|
161
|
+
|
|
162
|
+
**Constructor:** `new S3ResourceClient(config: BaseClientConfig)`
|
|
163
|
+
|
|
164
|
+
**Method:** `invoke(command: S3Command, params: Record<string, unknown>, invocationKey: string, options?: { timeoutMs?: number }): Promise<StorageInvokeResponse>`
|
|
165
|
+
|
|
166
|
+
**Params:**
|
|
167
|
+
|
|
168
|
+
- `command`: `"ListObjectsV2" | "HeadObject" | "GetObjectTagging" | "PutObjectTagging" | "DeleteObject" | "DeleteObjects" | "CopyObject" | "ListBuckets" | "GetBucketLocation" | "GeneratePresignedUrl"`
|
|
169
|
+
- `params`: Command-specific params (e.g., `{ Bucket, Prefix, Key, expiresIn }`)
|
|
170
|
+
- `invocationKey`: unique operation ID
|
|
171
|
+
- `options.timeoutMs`: optional timeout
|
|
172
|
+
|
|
173
|
+
**Result (ok=true):**
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
{ kind: "storage"; command: string; data: unknown } | { kind: "storage"; presignedUrl: string; expiresAt: string }
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
- Standard commands return `{ kind: "storage"; command; data }`
|
|
180
|
+
- `GeneratePresignedUrl` returns `{ kind: "storage"; presignedUrl; expiresAt }`
|
|
181
|
+
|
|
182
|
+
**Example:**
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
import { S3ResourceClient } from "@major-tech/resource-client";
|
|
186
|
+
const c = new S3ResourceClient({ baseUrl, applicationId, resourceId });
|
|
187
|
+
const r = await c.invoke(
|
|
188
|
+
"ListObjectsV2",
|
|
189
|
+
{ Bucket: "my-bucket", Prefix: "uploads/" },
|
|
190
|
+
"list-uploads"
|
|
191
|
+
);
|
|
192
|
+
// r.ok ? r.result.data : r.error
|
|
193
|
+
const u = await c.invoke(
|
|
194
|
+
"GeneratePresignedUrl",
|
|
195
|
+
{ Bucket: "my-bucket", Key: "file.pdf", expiresIn: 3600 },
|
|
196
|
+
"presigned"
|
|
197
|
+
);
|
|
198
|
+
// u.ok && 'presignedUrl' in u.result ? u.result.presignedUrl : u.error
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Error Handling
|
|
202
|
+
|
|
57
203
|
```typescript
|
|
58
204
|
import { ResourceInvokeError } from '@major-tech/resource-client';
|
|
59
205
|
try { await client.invoke(...); }
|
|
60
206
|
catch (e) { if (e instanceof ResourceInvokeError) { e.message, e.httpStatus, e.requestId } }
|
|
61
207
|
```
|
|
62
208
|
|
|
63
|
-
|
|
209
|
+
## CLI - Singleton Generator
|
|
64
210
|
|
|
65
|
-
**
|
|
211
|
+
**Commands:**
|
|
66
212
|
|
|
67
|
-
|
|
213
|
+
- `npx major-client add <resourceId> <name> <type> <desc> <appId>` - Add resource, generate singleton
|
|
214
|
+
- `npx major-client list` - List all resources
|
|
215
|
+
- `npx major-client remove <name>` - Remove resource
|
|
216
|
+
- `npx major-client regenerate` - Regenerate all clients
|
|
68
217
|
|
|
69
|
-
|
|
218
|
+
**Types:** `database-postgresql | database-dynamodb | api-custom | api-hubspot | storage-s3`
|
|
70
219
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
220
|
+
**Generated Files:**
|
|
221
|
+
|
|
222
|
+
- `resources.json` - Resource registry
|
|
223
|
+
- `src/clients/<name>.ts` - Singleton client
|
|
224
|
+
- `src/clients/index.ts` - Exports
|
|
74
225
|
|
|
75
|
-
|
|
76
|
-
npx major-client list
|
|
226
|
+
**Env Vars:** `MAJOR_API_BASE_URL`, `MAJOR_JWT_TOKEN`
|
|
77
227
|
|
|
78
|
-
|
|
79
|
-
|
|
228
|
+
**Example:**
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
npx major-client add "res_123" "orders-db" "database-postgresql" "Orders DB" "app_456"
|
|
80
232
|
```
|
|
81
233
|
|
|
82
|
-
This generates TypeScript files in `src/clients/` that you can import:
|
|
83
234
|
```typescript
|
|
84
|
-
import { ordersDbClient } from
|
|
85
|
-
const
|
|
235
|
+
import { ordersDbClient } from "./clients";
|
|
236
|
+
const r = await ordersDbClient.invoke(
|
|
237
|
+
"SELECT * FROM orders",
|
|
238
|
+
[],
|
|
239
|
+
"list-orders"
|
|
240
|
+
);
|
|
86
241
|
```
|
|
87
242
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
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"
|
|
@@ -45,7 +45,7 @@ function clientTemplate(data) {
|
|
|
45
45
|
* DO NOT EDIT - Auto-generated by @major-tech/resource-client
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
|
-
const BASE_URL = import.meta.env.MAJOR_API_BASE_URL || 'https://api.major.
|
|
48
|
+
const BASE_URL = import.meta.env.MAJOR_API_BASE_URL || 'https://api.prod.major.build';
|
|
49
49
|
const MAJOR_JWT_TOKEN = import.meta.env.MAJOR_JWT_TOKEN;
|
|
50
50
|
|
|
51
51
|
class ${data.clientName}Singleton {
|
|
@@ -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
|
}
|