@gravity-platform/aws-dynamodb 1.1.1
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 -0
- package/dist/DynamoDB/node/executor.d.ts +12 -0
- package/dist/DynamoDB/node/executor.d.ts.map +1 -0
- package/dist/DynamoDB/node/executor.js +62 -0
- package/dist/DynamoDB/node/executor.js.map +1 -0
- package/dist/DynamoDB/node/index.d.ts +10 -0
- package/dist/DynamoDB/node/index.d.ts.map +1 -0
- package/dist/DynamoDB/node/index.js +90 -0
- package/dist/DynamoDB/node/index.js.map +1 -0
- package/dist/DynamoDB/service/putRecord.d.ts +10 -0
- package/dist/DynamoDB/service/putRecord.d.ts.map +1 -0
- package/dist/DynamoDB/service/putRecord.js +18 -0
- package/dist/DynamoDB/service/putRecord.js.map +1 -0
- package/dist/DynamoDB/util/types.d.ts +17 -0
- package/dist/DynamoDB/util/types.d.ts.map +1 -0
- package/dist/DynamoDB/util/types.js +6 -0
- package/dist/DynamoDB/util/types.js.map +1 -0
- package/dist/DynamoDBFetch/node/executor.d.ts +12 -0
- package/dist/DynamoDBFetch/node/executor.d.ts.map +1 -0
- package/dist/DynamoDBFetch/node/executor.js +54 -0
- package/dist/DynamoDBFetch/node/executor.js.map +1 -0
- package/dist/DynamoDBFetch/node/index.d.ts +10 -0
- package/dist/DynamoDBFetch/node/index.d.ts.map +1 -0
- package/dist/DynamoDBFetch/node/index.js +77 -0
- package/dist/DynamoDBFetch/node/index.js.map +1 -0
- package/dist/DynamoDBFetch/service/fetchRecord.d.ts +11 -0
- package/dist/DynamoDBFetch/service/fetchRecord.d.ts.map +1 -0
- package/dist/DynamoDBFetch/service/fetchRecord.js +28 -0
- package/dist/DynamoDBFetch/service/fetchRecord.js.map +1 -0
- package/dist/DynamoDBFetch/util/types.d.ts +15 -0
- package/dist/DynamoDBFetch/util/types.d.ts.map +1 -0
- package/dist/DynamoDBFetch/util/types.js +6 -0
- package/dist/DynamoDBFetch/util/types.js.map +1 -0
- package/dist/DynamoDBService/node/executor.d.ts +12 -0
- package/dist/DynamoDBService/node/executor.d.ts.map +1 -0
- package/dist/DynamoDBService/node/executor.js +52 -0
- package/dist/DynamoDBService/node/executor.js.map +1 -0
- package/dist/DynamoDBService/node/index.d.ts +10 -0
- package/dist/DynamoDBService/node/index.d.ts.map +1 -0
- package/dist/DynamoDBService/node/index.js +66 -0
- package/dist/DynamoDBService/node/index.js.map +1 -0
- package/dist/DynamoDBService/util/types.d.ts +11 -0
- package/dist/DynamoDBService/util/types.d.ts.map +1 -0
- package/dist/DynamoDBService/util/types.js +6 -0
- package/dist/DynamoDBService/util/types.js.map +1 -0
- package/dist/credentials/index.d.ts +7 -0
- package/dist/credentials/index.d.ts.map +1 -0
- package/dist/credentials/index.js +11 -0
- package/dist/credentials/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/shared/client.d.ts +7 -0
- package/dist/shared/client.d.ts.map +1 -0
- package/dist/shared/client.js +61 -0
- package/dist/shared/client.js.map +1 -0
- package/dist/shared/operations.d.ts +25 -0
- package/dist/shared/operations.d.ts.map +1 -0
- package/dist/shared/operations.js +121 -0
- package/dist/shared/operations.js.map +1 -0
- package/dist/shared/platform.d.ts +11 -0
- package/dist/shared/platform.d.ts.map +1 -0
- package/dist/shared/platform.js +21 -0
- package/dist/shared/platform.js.map +1 -0
- package/dist/shared/types.d.ts +40 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +6 -0
- package/dist/shared/types.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamoDBServiceExecutor = void 0;
|
|
4
|
+
const platform_1 = require("../../shared/platform");
|
|
5
|
+
const client_1 = require("../../shared/client");
|
|
6
|
+
const NODE_TYPE = "DynamoDBService";
|
|
7
|
+
class DynamoDBServiceExecutor extends platform_1.PromiseNode {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(NODE_TYPE);
|
|
10
|
+
}
|
|
11
|
+
async executeNode(inputs, config, context) {
|
|
12
|
+
const logger = (0, platform_1.createLogger)("DynamoDBService");
|
|
13
|
+
// Build credential context for service
|
|
14
|
+
const credentialContext = this.buildCredentialContext(context);
|
|
15
|
+
try {
|
|
16
|
+
// Initialize DynamoDB client to validate credentials
|
|
17
|
+
const client = (0, client_1.initializeDynamoDBClient)(credentialContext.credentials?.awsCredential, logger);
|
|
18
|
+
logger.info("DynamoDBService initialized successfully", {
|
|
19
|
+
region: config.region || credentialContext.credentials?.awsCredential?.region,
|
|
20
|
+
defaultTable: config.defaultTable
|
|
21
|
+
});
|
|
22
|
+
// Service nodes don't return data directly
|
|
23
|
+
return {
|
|
24
|
+
__outputs: {}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
logger.error("DynamoDBService initialization failed", {
|
|
29
|
+
error: error.message,
|
|
30
|
+
code: error.code,
|
|
31
|
+
stack: error.stack,
|
|
32
|
+
});
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build credential context from execution context
|
|
38
|
+
*/
|
|
39
|
+
buildCredentialContext(context) {
|
|
40
|
+
return {
|
|
41
|
+
credentials: {
|
|
42
|
+
awsCredential: context.credentials?.awsCredential || {},
|
|
43
|
+
},
|
|
44
|
+
nodeType: NODE_TYPE,
|
|
45
|
+
workflowId: context.workflow?.id || "",
|
|
46
|
+
executionId: context.executionId || "",
|
|
47
|
+
nodeId: context.nodeId || "",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.DynamoDBServiceExecutor = DynamoDBServiceExecutor;
|
|
52
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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xD;YACD,QAAQ,EAAE,SAAS;YACnB,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE;YACtC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;YACtC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;SAC7B,CAAC;IACJ,CAAC;CACF;AAvDD,0DAuDC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type EnhancedNodeDefinition } from "@gravity-platform/plugin-base";
|
|
2
|
+
import { DynamoDBServiceExecutor } from "./executor";
|
|
3
|
+
export declare const NODE_TYPE = "DynamoDBService";
|
|
4
|
+
declare function createNodeDefinition(): EnhancedNodeDefinition;
|
|
5
|
+
export declare const DynamoDBServiceNode: {
|
|
6
|
+
definition: any;
|
|
7
|
+
executor: typeof DynamoDBServiceExecutor;
|
|
8
|
+
};
|
|
9
|
+
export { createNodeDefinition };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/DynamoDBService/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAE3C,iBAAS,oBAAoB,IAAI,sBAAsB,CA0DtD;AAID,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamoDBServiceNode = exports.NODE_TYPE = void 0;
|
|
4
|
+
exports.createNodeDefinition = createNodeDefinition;
|
|
5
|
+
const plugin_base_1 = require("@gravity-platform/plugin-base");
|
|
6
|
+
const executor_1 = require("./executor");
|
|
7
|
+
exports.NODE_TYPE = "DynamoDBService";
|
|
8
|
+
function createNodeDefinition() {
|
|
9
|
+
const { NodeInputType } = (0, plugin_base_1.getPlatformDependencies)();
|
|
10
|
+
return {
|
|
11
|
+
packageVersion: "1.1.0",
|
|
12
|
+
type: exports.NODE_TYPE,
|
|
13
|
+
name: "DynamoDB Service",
|
|
14
|
+
description: "Provides DynamoDB operations as a service for other nodes",
|
|
15
|
+
category: "storage",
|
|
16
|
+
logoUrl: "https://res.cloudinary.com/sonik/image/upload/v1751473913/gravity/icons/DynamoDB.png",
|
|
17
|
+
color: "#4B61D1", // AWS DynamoDB Blue
|
|
18
|
+
// Node template for styling
|
|
19
|
+
template: "service", // Options: "standard", "service", "mini"
|
|
20
|
+
// No inputs/outputs for service nodes
|
|
21
|
+
inputs: [],
|
|
22
|
+
outputs: [],
|
|
23
|
+
// SERVICE CONNECTORS - defines what services this node provides
|
|
24
|
+
serviceConnectors: [
|
|
25
|
+
{
|
|
26
|
+
name: "nosqlService",
|
|
27
|
+
description: "Provides NoSQL database operations",
|
|
28
|
+
serviceType: "nosql",
|
|
29
|
+
methods: ["put", "get", "query", "scan", "delete", "update"],
|
|
30
|
+
isService: true, // This node PROVIDES NoSQL services to others
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
// Configuration schema
|
|
34
|
+
configSchema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
required: [],
|
|
37
|
+
properties: {
|
|
38
|
+
region: {
|
|
39
|
+
type: "string",
|
|
40
|
+
title: "AWS Region",
|
|
41
|
+
description: "AWS region for DynamoDB (e.g., us-east-1)",
|
|
42
|
+
default: "us-east-1",
|
|
43
|
+
},
|
|
44
|
+
defaultTable: {
|
|
45
|
+
type: "string",
|
|
46
|
+
title: "Default Table",
|
|
47
|
+
description: "Default table name (can be overridden per operation)",
|
|
48
|
+
default: "",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
// AWS credentials required
|
|
53
|
+
credentials: [
|
|
54
|
+
{
|
|
55
|
+
name: "awsCredential",
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const definition = createNodeDefinition();
|
|
62
|
+
exports.DynamoDBServiceNode = {
|
|
63
|
+
definition,
|
|
64
|
+
executor: executor_1.DynamoDBServiceExecutor,
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DynamoDBService/node/index.ts"],"names":[],"mappings":";;;AAwES,oDAAoB;AAxE7B,+DAAqG;AACrG,yCAAqD;AAExC,QAAA,SAAS,GAAG,iBAAiB,CAAC;AAE3C,SAAS,oBAAoB;IAC3B,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,qCAAuB,GAAE,CAAC;IAEpD,OAAO;QACL,cAAc,EAAE,OAAO;QACvB,IAAI,EAAE,iBAAS;QACf,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,2DAA2D;QACxE,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,sFAAsF;QAC/F,KAAK,EAAE,SAAS,EAAE,oBAAoB;QAEtC,4BAA4B;QAC5B,QAAQ,EAAE,SAAS,EAAE,yCAAyC;QAE9D,sCAAsC;QACtC,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;QAEX,gEAAgE;QAChE,iBAAiB,EAAE;YACjB;gBACE,IAAI,EAAE,cAAc;gBACpB,WAAW,EAAE,oCAAoC;gBACjD,WAAW,EAAE,OAAO;gBACpB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC;gBAC5D,SAAS,EAAE,IAAI,EAAE,8CAA8C;aAChE;SACF;QAED,uBAAuB;QACvB,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,YAAY;oBACnB,WAAW,EAAE,2CAA2C;oBACxD,OAAO,EAAE,WAAW;iBACrB;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,eAAe;oBACtB,WAAW,EAAE,sDAAsD;oBACnE,OAAO,EAAE,EAAE;iBACZ;aACF;SACF;QAED,2BAA2B;QAC3B,WAAW,EAAE;YACX;gBACE,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,IAAI;aACf;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAC;AAE7B,QAAA,mBAAmB,GAAG;IACjC,UAAU;IACV,QAAQ,EAAE,kCAAuB;CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/DynamoDBService/util/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IAEpC,SAAS,EAAE,EAAE,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/DynamoDBService/util/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Credential definitions for AWS DynamoDB package
|
|
4
|
+
* Re-exports shared credentials from plugin-base
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.AWSCredential = void 0;
|
|
8
|
+
// Import shared credentials from plugin-base
|
|
9
|
+
const plugin_base_1 = require("@gravity-platform/plugin-base");
|
|
10
|
+
Object.defineProperty(exports, "AWSCredential", { enumerable: true, get: function () { return plugin_base_1.AWSCredential; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAA6C;AAC7C,+DAA8D;AAGrD,8FAHA,2BAAa,OAGA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,uDA0BV,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const plugin_base_1 = require("@gravity-platform/plugin-base");
|
|
40
|
+
const package_json_1 = __importDefault(require("../package.json"));
|
|
41
|
+
const plugin = (0, plugin_base_1.createPlugin)({
|
|
42
|
+
name: package_json_1.default.name,
|
|
43
|
+
version: package_json_1.default.version,
|
|
44
|
+
description: package_json_1.default.description,
|
|
45
|
+
async setup(api) {
|
|
46
|
+
// Initialize platform dependencies
|
|
47
|
+
const { initializePlatformFromAPI } = await Promise.resolve().then(() => __importStar(require("@gravity-platform/plugin-base")));
|
|
48
|
+
initializePlatformFromAPI(api);
|
|
49
|
+
// Import and register DynamoDB node
|
|
50
|
+
const { DynamoDBNode } = await Promise.resolve().then(() => __importStar(require("./DynamoDB/node/index")));
|
|
51
|
+
api.registerNode(DynamoDBNode);
|
|
52
|
+
// Import and register DynamoDBFetch node
|
|
53
|
+
const { DynamoDBFetchNode } = await Promise.resolve().then(() => __importStar(require("./DynamoDBFetch/node/index")));
|
|
54
|
+
api.registerNode(DynamoDBFetchNode);
|
|
55
|
+
// Import and register DynamoDBService node
|
|
56
|
+
const { DynamoDBServiceNode } = await Promise.resolve().then(() => __importStar(require("./DynamoDBService/node/index")));
|
|
57
|
+
api.registerNode(DynamoDBServiceNode);
|
|
58
|
+
// Import and register AWS credential
|
|
59
|
+
const { AWSCredential } = await Promise.resolve().then(() => __importStar(require("./credentials/index")));
|
|
60
|
+
api.registerCredential(AWSCredential);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
exports.default = plugin;
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAoF;AACpF,mEAA0C;AAE1C,MAAM,MAAM,GAAG,IAAA,0BAAY,EAAC;IAC1B,IAAI,EAAE,sBAAW,CAAC,IAAI;IACtB,OAAO,EAAE,sBAAW,CAAC,OAAO;IAC5B,WAAW,EAAE,sBAAW,CAAC,WAAW;IAEpC,KAAK,CAAC,KAAK,CAAC,GAAqB;QAC/B,mCAAmC;QACnC,MAAM,EAAE,yBAAyB,EAAE,GAAG,wDAAa,+BAA+B,GAAC,CAAC;QACpF,yBAAyB,CAAC,GAAG,CAAC,CAAC;QAE/B,oCAAoC;QACpC,MAAM,EAAE,YAAY,EAAE,GAAG,wDAAa,uBAAuB,GAAC,CAAC;QAC/D,GAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAE/B,yCAAyC;QACzC,MAAM,EAAE,iBAAiB,EAAE,GAAG,wDAAa,4BAA4B,GAAC,CAAC;QACzE,GAAG,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;QAEpC,2CAA2C;QAC3C,MAAM,EAAE,mBAAmB,EAAE,GAAG,wDAAa,8BAA8B,GAAC,CAAC;QAC7E,GAAG,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAEtC,qCAAqC;QACrC,MAAM,EAAE,aAAa,EAAE,GAAG,wDAAa,qBAAqB,GAAC,CAAC;QAC9D,GAAG,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC;CACF,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import { AWSCredentials } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Initialize AWS DynamoDB client with credentials (with caching)
|
|
5
|
+
*/
|
|
6
|
+
export declare function initializeDynamoDBClient(credentials: AWSCredentials, logger: any): DynamoDBDocumentClient;
|
|
7
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/shared/client.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAazC;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,GAAG,sBAAsB,CAiCzG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initializeDynamoDBClient = initializeDynamoDBClient;
|
|
4
|
+
/**
|
|
5
|
+
* DynamoDB client management with caching
|
|
6
|
+
*/
|
|
7
|
+
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
8
|
+
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
9
|
+
// Client cache to avoid recreating clients for the same credentials
|
|
10
|
+
const clientCache = new Map();
|
|
11
|
+
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes
|
|
12
|
+
/**
|
|
13
|
+
* Get cache key for credentials
|
|
14
|
+
*/
|
|
15
|
+
function getCacheKey(credentials) {
|
|
16
|
+
return `${credentials.accessKeyId}_${credentials.region}`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Initialize AWS DynamoDB client with credentials (with caching)
|
|
20
|
+
*/
|
|
21
|
+
function initializeDynamoDBClient(credentials, logger) {
|
|
22
|
+
const cacheKey = getCacheKey(credentials);
|
|
23
|
+
const now = Date.now();
|
|
24
|
+
// Check cache first
|
|
25
|
+
const cached = clientCache.get(cacheKey);
|
|
26
|
+
if (cached && (now - cached.timestamp) < CACHE_TTL) {
|
|
27
|
+
logger.debug('Using cached DynamoDB client', { cacheKey });
|
|
28
|
+
return cached.client;
|
|
29
|
+
}
|
|
30
|
+
if (!credentials.accessKeyId || !credentials.secretAccessKey) {
|
|
31
|
+
throw new Error('AWS credentials missing accessKeyId or secretAccessKey');
|
|
32
|
+
}
|
|
33
|
+
const region = credentials.region || 'us-east-1';
|
|
34
|
+
const dynamoClient = new client_dynamodb_1.DynamoDBClient({
|
|
35
|
+
region,
|
|
36
|
+
credentials: {
|
|
37
|
+
accessKeyId: credentials.accessKeyId,
|
|
38
|
+
secretAccessKey: credentials.secretAccessKey,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
// Create document client for easier operations
|
|
42
|
+
const client = lib_dynamodb_1.DynamoDBDocumentClient.from(dynamoClient);
|
|
43
|
+
// Cache the client
|
|
44
|
+
clientCache.set(cacheKey, { client, timestamp: now });
|
|
45
|
+
logger.debug('Created and cached new DynamoDB client', { cacheKey, region });
|
|
46
|
+
return client;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Clean up expired clients from cache
|
|
50
|
+
*/
|
|
51
|
+
function cleanupCache() {
|
|
52
|
+
const now = Date.now();
|
|
53
|
+
for (const [key, value] of clientCache.entries()) {
|
|
54
|
+
if (now - value.timestamp > CACHE_TTL) {
|
|
55
|
+
clientCache.delete(key);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Run cleanup every minute
|
|
60
|
+
setInterval(cleanupCache, 60 * 1000);
|
|
61
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/shared/client.ts"],"names":[],"mappings":";;AAqBA,4DAiCC;AAtDD;;GAEG;AACH,8DAA0D;AAC1D,wDAA+D;AAG/D,oEAAoE;AACpE,MAAM,WAAW,GAAG,IAAI,GAAG,EAAiE,CAAC;AAC7F,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAE7C;;GAEG;AACH,SAAS,WAAW,CAAC,WAA2B;IAC9C,OAAO,GAAG,WAAW,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,WAA2B,EAAE,MAAW;IAC/E,MAAM,QAAQ,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;IAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEvB,oBAAoB;IACpB,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,MAAM,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,SAAS,EAAE,CAAC;QACnD,MAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC;IAEjD,MAAM,YAAY,GAAG,IAAI,gCAAc,CAAC;QACtC,MAAM;QACN,WAAW,EAAE;YACX,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,eAAe,EAAE,WAAW,CAAC,eAAe;SAC7C;KACF,CAAC,CAAC;IAEH,+CAA+C;IAC/C,MAAM,MAAM,GAAG,qCAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAEzD,mBAAmB;IACnB,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IACtD,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAE7E,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAS,YAAY;IACnB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;QACjD,IAAI,GAAG,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,EAAE,CAAC;YACtC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;AACH,CAAC;AAED,2BAA2B;AAC3B,WAAW,CAAC,YAAY,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DynamoDBPutConfig, DynamoDBGetConfig, DynamoDBQueryConfig, AWSCredentials } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Put a record into DynamoDB table
|
|
4
|
+
*/
|
|
5
|
+
export declare function putDynamoDBRecord(config: DynamoDBPutConfig, credentials: AWSCredentials, logger: any): Promise<{
|
|
6
|
+
success: boolean;
|
|
7
|
+
itemId?: string;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a document from DynamoDB table
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDynamoDBDocument(config: DynamoDBGetConfig, credentials: AWSCredentials, logger: any): Promise<{
|
|
13
|
+
success: boolean;
|
|
14
|
+
found: boolean;
|
|
15
|
+
document?: any;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Query DynamoDB table
|
|
19
|
+
*/
|
|
20
|
+
export declare function queryDynamoDBTable(config: DynamoDBQueryConfig, credentials: AWSCredentials, logger: any): Promise<{
|
|
21
|
+
success: boolean;
|
|
22
|
+
items: any[];
|
|
23
|
+
lastEvaluatedKey?: Record<string, any>;
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/shared/operations.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAsB,cAAc,EAAE,MAAM,SAAS,CAAC;AAExH;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAE,cAAc,EAC3B,MAAM,EAAE,GAAG,GACV,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAsChD;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAE,cAAc,EAC3B,MAAM,EAAE,GAAG,GACV,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAyC/D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,cAAc,EAC3B,MAAM,EAAE,GAAG,GACV,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,GAAG,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,CAAC,CAwCrF"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.putDynamoDBRecord = putDynamoDBRecord;
|
|
4
|
+
exports.getDynamoDBDocument = getDynamoDBDocument;
|
|
5
|
+
exports.queryDynamoDBTable = queryDynamoDBTable;
|
|
6
|
+
/**
|
|
7
|
+
* DynamoDB operations using document client
|
|
8
|
+
*/
|
|
9
|
+
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
10
|
+
const client_1 = require("./client");
|
|
11
|
+
/**
|
|
12
|
+
* Put a record into DynamoDB table
|
|
13
|
+
*/
|
|
14
|
+
async function putDynamoDBRecord(config, credentials, logger) {
|
|
15
|
+
try {
|
|
16
|
+
const client = (0, client_1.initializeDynamoDBClient)(credentials, logger);
|
|
17
|
+
// Build the put command
|
|
18
|
+
const putCommand = new lib_dynamodb_1.PutCommand({
|
|
19
|
+
TableName: config.tableName,
|
|
20
|
+
Item: config.record,
|
|
21
|
+
ConditionExpression: config.conditionExpression,
|
|
22
|
+
ExpressionAttributeNames: config.expressionAttributeNames,
|
|
23
|
+
ExpressionAttributeValues: config.expressionAttributeValues,
|
|
24
|
+
});
|
|
25
|
+
logger.info('Putting record to DynamoDB', {
|
|
26
|
+
tableName: config.tableName,
|
|
27
|
+
recordKeys: Object.keys(config.record),
|
|
28
|
+
});
|
|
29
|
+
await client.send(putCommand);
|
|
30
|
+
// Extract the primary key value if it exists
|
|
31
|
+
const itemId = config.record.id || config.record.Id || config.record.ID || config.record.universalId;
|
|
32
|
+
logger.info('Successfully put record to DynamoDB', {
|
|
33
|
+
tableName: config.tableName,
|
|
34
|
+
itemId,
|
|
35
|
+
});
|
|
36
|
+
return { success: true, itemId };
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
logger.error('Failed to put record to DynamoDB', {
|
|
40
|
+
error: error.message,
|
|
41
|
+
tableName: config.tableName,
|
|
42
|
+
});
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get a document from DynamoDB table
|
|
48
|
+
*/
|
|
49
|
+
async function getDynamoDBDocument(config, credentials, logger) {
|
|
50
|
+
try {
|
|
51
|
+
const client = (0, client_1.initializeDynamoDBClient)(credentials, logger);
|
|
52
|
+
logger.info('Getting document from DynamoDB', {
|
|
53
|
+
tableName: config.tableName,
|
|
54
|
+
key: config.key,
|
|
55
|
+
});
|
|
56
|
+
const command = new lib_dynamodb_1.GetCommand({
|
|
57
|
+
TableName: config.tableName,
|
|
58
|
+
Key: config.key,
|
|
59
|
+
});
|
|
60
|
+
const response = await client.send(command);
|
|
61
|
+
if (!response.Item) {
|
|
62
|
+
logger.info('Document not found in DynamoDB', {
|
|
63
|
+
tableName: config.tableName,
|
|
64
|
+
key: config.key,
|
|
65
|
+
});
|
|
66
|
+
return { success: true, found: false };
|
|
67
|
+
}
|
|
68
|
+
logger.info('Successfully retrieved document from DynamoDB', {
|
|
69
|
+
tableName: config.tableName,
|
|
70
|
+
documentKeys: Object.keys(response.Item),
|
|
71
|
+
});
|
|
72
|
+
return { success: true, found: true, document: response.Item };
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
logger.error('Failed to get document from DynamoDB', {
|
|
76
|
+
error: error.message,
|
|
77
|
+
tableName: config.tableName,
|
|
78
|
+
key: config.key,
|
|
79
|
+
});
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Query DynamoDB table
|
|
85
|
+
*/
|
|
86
|
+
async function queryDynamoDBTable(config, credentials, logger) {
|
|
87
|
+
try {
|
|
88
|
+
const client = (0, client_1.initializeDynamoDBClient)(credentials, logger);
|
|
89
|
+
logger.info('Querying DynamoDB table', {
|
|
90
|
+
tableName: config.tableName,
|
|
91
|
+
keyConditionExpression: config.keyConditionExpression,
|
|
92
|
+
});
|
|
93
|
+
const command = new lib_dynamodb_1.QueryCommand({
|
|
94
|
+
TableName: config.tableName,
|
|
95
|
+
KeyConditionExpression: config.keyConditionExpression,
|
|
96
|
+
FilterExpression: config.filterExpression,
|
|
97
|
+
ExpressionAttributeNames: config.expressionAttributeNames,
|
|
98
|
+
ExpressionAttributeValues: config.expressionAttributeValues,
|
|
99
|
+
Limit: config.limit,
|
|
100
|
+
ExclusiveStartKey: config.exclusiveStartKey,
|
|
101
|
+
});
|
|
102
|
+
const response = await client.send(command);
|
|
103
|
+
logger.info('Successfully queried DynamoDB table', {
|
|
104
|
+
tableName: config.tableName,
|
|
105
|
+
itemCount: response.Items?.length || 0,
|
|
106
|
+
});
|
|
107
|
+
return {
|
|
108
|
+
success: true,
|
|
109
|
+
items: response.Items || [],
|
|
110
|
+
lastEvaluatedKey: response.LastEvaluatedKey,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
logger.error('Failed to query DynamoDB table', {
|
|
115
|
+
error: error.message,
|
|
116
|
+
tableName: config.tableName,
|
|
117
|
+
});
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/shared/operations.ts"],"names":[],"mappings":";;AAUA,8CA0CC;AAKD,kDA6CC;AAKD,gDA4CC;AAvJD;;GAEG;AACH,wDAA0F;AAC1F,qCAAoD;AAGpD;;GAEG;AACI,KAAK,UAAU,iBAAiB,CACrC,MAAyB,EACzB,WAA2B,EAC3B,MAAW;IAGX,IAAI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QACH,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const getNodeCredentials: (context: any, credentialName: string) => Promise<any>;
|
|
2
|
+
export declare const saveTokenUsage: (usage: any) => Promise<void>;
|
|
3
|
+
export declare const createLogger: (name: string) => any;
|
|
4
|
+
export declare const getConfig: () => any;
|
|
5
|
+
export declare const PromiseNode: any;
|
|
6
|
+
export declare const CallbackNode: any;
|
|
7
|
+
export declare const NodeExecutionContext: any;
|
|
8
|
+
export declare const EnhancedNodeDefinition: any;
|
|
9
|
+
export declare const NodeInputType: any;
|
|
10
|
+
export declare const dynamodbLogger: any;
|
|
11
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/shared/platform.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB,wDAA0B,CAAC;AAC1D,eAAO,MAAM,cAAc,+BAAsB,CAAC;AAClD,eAAO,MAAM,YAAY,uBAAoB,CAAC;AAC9C,eAAO,MAAM,SAAS,WAAiB,CAAC;AACxC,eAAO,MAAM,WAAW,KAAmB,CAAC;AAC5C,eAAO,MAAM,YAAY,KAAoB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,KAA4B,CAAC;AAC9D,eAAO,MAAM,sBAAsB,KAA8B,CAAC;AAClE,eAAO,MAAM,aAAa,KAAqB,CAAC;AAGhD,eAAO,MAAM,cAAc,KAA2B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dynamodbLogger = exports.NodeInputType = exports.EnhancedNodeDefinition = exports.NodeExecutionContext = exports.CallbackNode = exports.PromiseNode = exports.getConfig = exports.createLogger = exports.saveTokenUsage = exports.getNodeCredentials = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Shared platform dependencies for AWS DynamoDB services
|
|
6
|
+
*/
|
|
7
|
+
const plugin_base_1 = require("@gravity-platform/plugin-base");
|
|
8
|
+
// Get platform dependencies once
|
|
9
|
+
const deps = (0, plugin_base_1.getPlatformDependencies)();
|
|
10
|
+
exports.getNodeCredentials = deps.getNodeCredentials;
|
|
11
|
+
exports.saveTokenUsage = deps.saveTokenUsage;
|
|
12
|
+
exports.createLogger = deps.createLogger;
|
|
13
|
+
exports.getConfig = deps.getConfig;
|
|
14
|
+
exports.PromiseNode = deps.PromiseNode;
|
|
15
|
+
exports.CallbackNode = deps.CallbackNode;
|
|
16
|
+
exports.NodeExecutionContext = deps.NodeExecutionContext;
|
|
17
|
+
exports.EnhancedNodeDefinition = deps.EnhancedNodeDefinition;
|
|
18
|
+
exports.NodeInputType = deps.NodeInputType;
|
|
19
|
+
// Create shared loggers
|
|
20
|
+
exports.dynamodbLogger = (0, exports.createLogger)("DynamoDB");
|
|
21
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/shared/platform.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+DAAwE;AAExE,iCAAiC;AACjC,MAAM,IAAI,GAAG,IAAA,qCAAuB,GAAE,CAAC;AAE1B,QAAA,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;AAC7C,QAAA,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;AACrC,QAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;AACjC,QAAA,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AAC3B,QAAA,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;AAC/B,QAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;AACjC,QAAA,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC;AACjD,QAAA,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;AACrD,QAAA,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAEhD,wBAAwB;AACX,QAAA,cAAc,GAAG,IAAA,oBAAY,EAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for DynamoDB operations
|
|
3
|
+
*/
|
|
4
|
+
export interface DynamoDBRecord {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface DynamoDBPutConfig {
|
|
8
|
+
tableName: string;
|
|
9
|
+
record: DynamoDBRecord;
|
|
10
|
+
conditionExpression?: string;
|
|
11
|
+
expressionAttributeNames?: Record<string, string>;
|
|
12
|
+
expressionAttributeValues?: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export interface DynamoDBGetConfig {
|
|
15
|
+
tableName: string;
|
|
16
|
+
key: Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
export interface DynamoDBQueryConfig {
|
|
19
|
+
tableName: string;
|
|
20
|
+
keyConditionExpression: string;
|
|
21
|
+
expressionAttributeNames?: Record<string, string>;
|
|
22
|
+
expressionAttributeValues?: Record<string, any>;
|
|
23
|
+
filterExpression?: string;
|
|
24
|
+
limit?: number;
|
|
25
|
+
exclusiveStartKey?: Record<string, any>;
|
|
26
|
+
}
|
|
27
|
+
export interface DynamoDBScanConfig {
|
|
28
|
+
tableName: string;
|
|
29
|
+
filterExpression?: string;
|
|
30
|
+
expressionAttributeNames?: Record<string, string>;
|
|
31
|
+
expressionAttributeValues?: Record<string, any>;
|
|
32
|
+
limit?: number;
|
|
33
|
+
exclusiveStartKey?: Record<string, any>;
|
|
34
|
+
}
|
|
35
|
+
export interface AWSCredentials {
|
|
36
|
+
accessKeyId: string;
|
|
37
|
+
secretAccessKey: string;
|
|
38
|
+
region: string;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types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