@superdurable/connector-amazon-lambda 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +4 -2
- package/dex-connector.json +221 -0
- package/dist/chunk-HI4S6PQZ.js +234 -0
- package/dist/connection-Cqa6vZYT.d.ts +142 -0
- package/dist/index.d.ts +258 -0
- package/dist/index.js +539 -0
- package/dist/mock.d.ts +90 -0
- package/dist/mock.js +209 -0
- package/package.json +59 -4
package/dist/mock.js
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeleteFunctionDefinition,
|
|
3
|
+
DeleteFunctionInputSchema,
|
|
4
|
+
FunctionDetailsSchema,
|
|
5
|
+
FunctionPageSchema,
|
|
6
|
+
FunctionWriteResultSchema,
|
|
7
|
+
GetFunctionDefinition,
|
|
8
|
+
GetFunctionInputSchema,
|
|
9
|
+
ListFunctionsDefinition,
|
|
10
|
+
ListFunctionsInputSchema,
|
|
11
|
+
ProviderID,
|
|
12
|
+
UpdateFunctionDescriptionDefinition,
|
|
13
|
+
UpdateFunctionDescriptionInputSchema,
|
|
14
|
+
newConnectionWithOperations
|
|
15
|
+
} from "./chunk-HI4S6PQZ.js";
|
|
16
|
+
|
|
17
|
+
// src/generated/mock.ts
|
|
18
|
+
import { branchCase, retryCase, newMutation, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
19
|
+
var emptyGetFunctionInput = GetFunctionInputSchema.parse({
|
|
20
|
+
"functionName": ""
|
|
21
|
+
});
|
|
22
|
+
var emptyFunctionDetails = FunctionDetailsSchema.parse({
|
|
23
|
+
"name": "",
|
|
24
|
+
"arn": ""
|
|
25
|
+
});
|
|
26
|
+
var emptyListFunctionsInput = ListFunctionsInputSchema.parse({
|
|
27
|
+
"marker": "",
|
|
28
|
+
"maxItems": 0
|
|
29
|
+
});
|
|
30
|
+
var emptyFunctionPage = FunctionPageSchema.parse({
|
|
31
|
+
"functions": [],
|
|
32
|
+
"nextMarker": ""
|
|
33
|
+
});
|
|
34
|
+
var emptyUpdateFunctionDescriptionInput = UpdateFunctionDescriptionInputSchema.parse({
|
|
35
|
+
"functionName": "",
|
|
36
|
+
"description": ""
|
|
37
|
+
});
|
|
38
|
+
var emptyDeleteFunctionInput = DeleteFunctionInputSchema.parse({
|
|
39
|
+
"functionName": ""
|
|
40
|
+
});
|
|
41
|
+
var emptyFunctionWriteResult = FunctionWriteResultSchema.parse({
|
|
42
|
+
"applied": false
|
|
43
|
+
});
|
|
44
|
+
function getFunctionFound(value, failure) {
|
|
45
|
+
return branchCase("found", value, failure);
|
|
46
|
+
}
|
|
47
|
+
function getFunctionMissing(value, failure) {
|
|
48
|
+
return branchCase("missing", value, failure);
|
|
49
|
+
}
|
|
50
|
+
function getFunctionProviderRejected(value, failure) {
|
|
51
|
+
return branchCase("providerRejected", value, failure);
|
|
52
|
+
}
|
|
53
|
+
function getFunctionInvalidResponse(value, failure) {
|
|
54
|
+
return branchCase("invalidResponse", value, failure);
|
|
55
|
+
}
|
|
56
|
+
function getFunctionDefect(value, failure) {
|
|
57
|
+
return branchCase("defect", value, failure);
|
|
58
|
+
}
|
|
59
|
+
function getFunctionRetry(failure, retryAfterMs = 0) {
|
|
60
|
+
return retryCase(failure, retryAfterMs);
|
|
61
|
+
}
|
|
62
|
+
function getFunctionFoundDefault() {
|
|
63
|
+
const value = FunctionDetailsSchema.parse({ "arn": "arn:aws:lambda:us-east-1:123456789012:function:example-function", "name": "example-function" });
|
|
64
|
+
return branchCase("found", value);
|
|
65
|
+
}
|
|
66
|
+
function getFunctionDefault() {
|
|
67
|
+
return getFunctionFoundDefault();
|
|
68
|
+
}
|
|
69
|
+
function listFunctionsListed(value, failure) {
|
|
70
|
+
return branchCase("listed", value, failure);
|
|
71
|
+
}
|
|
72
|
+
function listFunctionsProviderRejected(value, failure) {
|
|
73
|
+
return branchCase("providerRejected", value, failure);
|
|
74
|
+
}
|
|
75
|
+
function listFunctionsInvalidResponse(value, failure) {
|
|
76
|
+
return branchCase("invalidResponse", value, failure);
|
|
77
|
+
}
|
|
78
|
+
function listFunctionsDefect(value, failure) {
|
|
79
|
+
return branchCase("defect", value, failure);
|
|
80
|
+
}
|
|
81
|
+
function listFunctionsRetry(failure, retryAfterMs = 0) {
|
|
82
|
+
return retryCase(failure, retryAfterMs);
|
|
83
|
+
}
|
|
84
|
+
function listFunctionsListedDefault() {
|
|
85
|
+
const value = FunctionPageSchema.parse({ "functions": [{ "arn": "arn:aws:lambda:us-east-1:123456789012:function:example-function", "name": "example-function" }], "nextMarker": "" });
|
|
86
|
+
return branchCase("listed", value);
|
|
87
|
+
}
|
|
88
|
+
function listFunctionsDefault() {
|
|
89
|
+
return listFunctionsListedDefault();
|
|
90
|
+
}
|
|
91
|
+
function updateFunctionDescriptionUpdated(value, failure) {
|
|
92
|
+
return branchCase("updated", value, failure);
|
|
93
|
+
}
|
|
94
|
+
function updateFunctionDescriptionMissing(value, failure) {
|
|
95
|
+
return branchCase("missing", value, failure);
|
|
96
|
+
}
|
|
97
|
+
function updateFunctionDescriptionProviderRejected(value, failure) {
|
|
98
|
+
return branchCase("providerRejected", value, failure);
|
|
99
|
+
}
|
|
100
|
+
function updateFunctionDescriptionInvalidResponse(value, failure) {
|
|
101
|
+
return branchCase("invalidResponse", value, failure);
|
|
102
|
+
}
|
|
103
|
+
function updateFunctionDescriptionDefect(value, failure) {
|
|
104
|
+
return branchCase("defect", value, failure);
|
|
105
|
+
}
|
|
106
|
+
function updateFunctionDescriptionRetry(failure, retryAfterMs = 0) {
|
|
107
|
+
return retryCase(failure, retryAfterMs);
|
|
108
|
+
}
|
|
109
|
+
function updateFunctionDescriptionUpdatedDefault() {
|
|
110
|
+
const value = FunctionDetailsSchema.parse({ "arn": "arn:aws:lambda:us-east-1:123456789012:function:example-function", "name": "example-function" });
|
|
111
|
+
return branchCase("updated", value);
|
|
112
|
+
}
|
|
113
|
+
function updateFunctionDescriptionDefault() {
|
|
114
|
+
return updateFunctionDescriptionUpdatedDefault();
|
|
115
|
+
}
|
|
116
|
+
function deleteFunctionDeleted(value, failure) {
|
|
117
|
+
return branchCase("deleted", value, failure);
|
|
118
|
+
}
|
|
119
|
+
function deleteFunctionProviderRejected(value, failure) {
|
|
120
|
+
return branchCase("providerRejected", value, failure);
|
|
121
|
+
}
|
|
122
|
+
function deleteFunctionDefect(value, failure) {
|
|
123
|
+
return branchCase("defect", value, failure);
|
|
124
|
+
}
|
|
125
|
+
function deleteFunctionRetry(failure, retryAfterMs = 0) {
|
|
126
|
+
return retryCase(failure, retryAfterMs);
|
|
127
|
+
}
|
|
128
|
+
function deleteFunctionDeletedDefault() {
|
|
129
|
+
const value = FunctionWriteResultSchema.parse({ "applied": true });
|
|
130
|
+
return branchCase("deleted", value);
|
|
131
|
+
}
|
|
132
|
+
function deleteFunctionDefault() {
|
|
133
|
+
return deleteFunctionDeletedDefault();
|
|
134
|
+
}
|
|
135
|
+
var GeneratedMock = class {
|
|
136
|
+
#getFunction;
|
|
137
|
+
#listFunctions;
|
|
138
|
+
#updateFunctionDescription;
|
|
139
|
+
#deleteFunction;
|
|
140
|
+
#connection;
|
|
141
|
+
constructor(connectionName) {
|
|
142
|
+
this.#getFunction = newQuery(GetFunctionDefinition).default(getFunctionDefault());
|
|
143
|
+
this.#listFunctions = newQuery(ListFunctionsDefinition).default(listFunctionsDefault());
|
|
144
|
+
this.#updateFunctionDescription = newMutation(UpdateFunctionDescriptionDefinition).default(updateFunctionDescriptionDefault());
|
|
145
|
+
this.#deleteFunction = newMutation(DeleteFunctionDefinition).default(deleteFunctionDefault());
|
|
146
|
+
this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
|
|
147
|
+
}
|
|
148
|
+
connection() {
|
|
149
|
+
return this.#connection;
|
|
150
|
+
}
|
|
151
|
+
getFunction() {
|
|
152
|
+
return this.#getFunction;
|
|
153
|
+
}
|
|
154
|
+
listFunctions() {
|
|
155
|
+
return this.#listFunctions;
|
|
156
|
+
}
|
|
157
|
+
updateFunctionDescription() {
|
|
158
|
+
return this.#updateFunctionDescription;
|
|
159
|
+
}
|
|
160
|
+
deleteFunction() {
|
|
161
|
+
return this.#deleteFunction;
|
|
162
|
+
}
|
|
163
|
+
assertNoFailures() {
|
|
164
|
+
this.#getFunction.assertNoFailures();
|
|
165
|
+
this.#listFunctions.assertNoFailures();
|
|
166
|
+
this.#updateFunctionDescription.assertNoFailures();
|
|
167
|
+
this.#deleteFunction.assertNoFailures();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
export {
|
|
171
|
+
GeneratedMock,
|
|
172
|
+
GeneratedMock as Mock,
|
|
173
|
+
deleteFunctionDefault,
|
|
174
|
+
deleteFunctionDefect,
|
|
175
|
+
deleteFunctionDeleted,
|
|
176
|
+
deleteFunctionDeletedDefault,
|
|
177
|
+
deleteFunctionProviderRejected,
|
|
178
|
+
deleteFunctionRetry,
|
|
179
|
+
emptyDeleteFunctionInput,
|
|
180
|
+
emptyFunctionDetails,
|
|
181
|
+
emptyFunctionPage,
|
|
182
|
+
emptyFunctionWriteResult,
|
|
183
|
+
emptyGetFunctionInput,
|
|
184
|
+
emptyListFunctionsInput,
|
|
185
|
+
emptyUpdateFunctionDescriptionInput,
|
|
186
|
+
getFunctionDefault,
|
|
187
|
+
getFunctionDefect,
|
|
188
|
+
getFunctionFound,
|
|
189
|
+
getFunctionFoundDefault,
|
|
190
|
+
getFunctionInvalidResponse,
|
|
191
|
+
getFunctionMissing,
|
|
192
|
+
getFunctionProviderRejected,
|
|
193
|
+
getFunctionRetry,
|
|
194
|
+
listFunctionsDefault,
|
|
195
|
+
listFunctionsDefect,
|
|
196
|
+
listFunctionsInvalidResponse,
|
|
197
|
+
listFunctionsListed,
|
|
198
|
+
listFunctionsListedDefault,
|
|
199
|
+
listFunctionsProviderRejected,
|
|
200
|
+
listFunctionsRetry,
|
|
201
|
+
updateFunctionDescriptionDefault,
|
|
202
|
+
updateFunctionDescriptionDefect,
|
|
203
|
+
updateFunctionDescriptionInvalidResponse,
|
|
204
|
+
updateFunctionDescriptionMissing,
|
|
205
|
+
updateFunctionDescriptionProviderRejected,
|
|
206
|
+
updateFunctionDescriptionRetry,
|
|
207
|
+
updateFunctionDescriptionUpdated,
|
|
208
|
+
updateFunctionDescriptionUpdatedDefault
|
|
209
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connector-amazon-lambda",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Amazon Lambda connector for Dex TypeScript applications",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/superdurable/dex-connectors-library.git",
|
|
9
|
+
"directory": "connectors/amazon/lambda/typescript"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": "^22.0.0 || ^24.0.0"
|
|
14
|
+
},
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./mock": {
|
|
23
|
+
"types": "./dist/mock.d.ts",
|
|
24
|
+
"import": "./dist/mock.js"
|
|
25
|
+
},
|
|
26
|
+
"./dex-connector.json": "./dex-connector.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"dex-connector.json"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"prepack": "npm run build",
|
|
36
|
+
"build": "tsup src/index.ts src/mock.ts --format esm --dts --clean",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"lint": "eslint src test examples",
|
|
39
|
+
"test": "vitest run --exclude test/integration/**",
|
|
40
|
+
"test:integration": "vitest run test/integration/*.integration.test.ts",
|
|
41
|
+
"example:worker": "tsx examples/function-lookup/worker.ts",
|
|
42
|
+
"example:start": "tsx examples/function-lookup/start.ts",
|
|
43
|
+
"check": "npm run typecheck && npm run lint && npm test && npm run build"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@superdurable/connectors-sdk": "0.1.1",
|
|
47
|
+
"@superdurable/dex": ">=1.28.0",
|
|
48
|
+
"zod": "^4.1.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@eslint/js": "^9.0.0",
|
|
52
|
+
"@types/node": "^22.0.0",
|
|
53
|
+
"eslint": "^9.0.0",
|
|
54
|
+
"tsup": "^8.0.0",
|
|
55
|
+
"tsx": "^4.23.15",
|
|
56
|
+
"typescript": "^5.9.0",
|
|
57
|
+
"typescript-eslint": "^8.0.0",
|
|
58
|
+
"vitest": "^3.0.0",
|
|
59
|
+
"yaml": "^2.9.1"
|
|
60
|
+
}
|
|
61
|
+
}
|