@superdurable/connector-amazon-lambda 0.1.0 → 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 +2 -0
- package/dex-connector.json +159 -2
- package/dist/chunk-HI4S6PQZ.js +234 -0
- package/dist/connection-Cqa6vZYT.d.ts +142 -0
- package/dist/index.d.ts +162 -4
- package/dist/index.js +303 -19
- package/dist/mock.d.ts +58 -3
- package/dist/mock.js +139 -3
- package/package.json +1 -1
- package/dist/chunk-G5OORMFR.js +0 -111
- package/dist/connection-B5yl3Wdb.d.ts +0 -73
package/dist/mock.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { MockQuery, Case } from '@superdurable/connectors-sdk/connectormock';
|
|
1
|
+
import { MockQuery, MockMutation, Case } from '@superdurable/connectors-sdk/connectormock';
|
|
2
2
|
import { Failure } from '@superdurable/connectors-sdk';
|
|
3
|
-
import { O as Operations, C as Connection, G as GetFunctionInput,
|
|
3
|
+
import { O as Operations, C as Connection, G as GetFunctionInput, a as FunctionDetails, L as ListFunctionsInput, b as FunctionPage, U as UpdateFunctionDescriptionInput, D as DeleteFunctionInput, F as FunctionWriteResult } from './connection-Cqa6vZYT.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
/** Go zero value for GetFunctionInput in scripted cases. */
|
|
7
7
|
declare const emptyGetFunctionInput: GetFunctionInput;
|
|
8
8
|
/** Go zero value for FunctionDetails in scripted cases. */
|
|
9
9
|
declare const emptyFunctionDetails: FunctionDetails;
|
|
10
|
+
/** Go zero value for ListFunctionsInput in scripted cases. */
|
|
11
|
+
declare const emptyListFunctionsInput: ListFunctionsInput;
|
|
12
|
+
/** Go zero value for FunctionPage in scripted cases. */
|
|
13
|
+
declare const emptyFunctionPage: FunctionPage;
|
|
14
|
+
/** Go zero value for UpdateFunctionDescriptionInput in scripted cases. */
|
|
15
|
+
declare const emptyUpdateFunctionDescriptionInput: UpdateFunctionDescriptionInput;
|
|
16
|
+
/** Go zero value for DeleteFunctionInput in scripted cases. */
|
|
17
|
+
declare const emptyDeleteFunctionInput: DeleteFunctionInput;
|
|
18
|
+
/** Go zero value for FunctionWriteResult in scripted cases. */
|
|
19
|
+
declare const emptyFunctionWriteResult: FunctionWriteResult;
|
|
10
20
|
/** Script the found branch. */
|
|
11
21
|
declare function getFunctionFound(value: FunctionDetails, failure?: Failure): Case<FunctionDetails>;
|
|
12
22
|
/** Script the missing branch. */
|
|
@@ -23,13 +33,58 @@ declare function getFunctionRetry(failure: Failure, retryAfterMs?: number): Case
|
|
|
23
33
|
declare function getFunctionFoundDefault(): Case<FunctionDetails>;
|
|
24
34
|
/** Default getFunction scenario. */
|
|
25
35
|
declare function getFunctionDefault(): Case<FunctionDetails>;
|
|
36
|
+
/** Script the listed branch. */
|
|
37
|
+
declare function listFunctionsListed(value: FunctionPage, failure?: Failure): Case<FunctionPage>;
|
|
38
|
+
/** Script the providerRejected branch. */
|
|
39
|
+
declare function listFunctionsProviderRejected(value: FunctionPage, failure?: Failure): Case<FunctionPage>;
|
|
40
|
+
/** Script the invalidResponse branch. */
|
|
41
|
+
declare function listFunctionsInvalidResponse(value: FunctionPage, failure?: Failure): Case<FunctionPage>;
|
|
42
|
+
/** Script the defect branch. */
|
|
43
|
+
declare function listFunctionsDefect(value: FunctionPage, failure?: Failure): Case<FunctionPage>;
|
|
44
|
+
/** Script a safe retry of listFunctions. */
|
|
45
|
+
declare function listFunctionsRetry(failure: Failure, retryAfterMs?: number): Case<FunctionPage>;
|
|
46
|
+
/** Manifest scenario listedDefault for listFunctions. */
|
|
47
|
+
declare function listFunctionsListedDefault(): Case<FunctionPage>;
|
|
48
|
+
/** Default listFunctions scenario. */
|
|
49
|
+
declare function listFunctionsDefault(): Case<FunctionPage>;
|
|
50
|
+
/** Script the updated branch. */
|
|
51
|
+
declare function updateFunctionDescriptionUpdated(value: FunctionDetails, failure?: Failure): Case<FunctionDetails>;
|
|
52
|
+
/** Script the missing branch. */
|
|
53
|
+
declare function updateFunctionDescriptionMissing(value: FunctionDetails, failure?: Failure): Case<FunctionDetails>;
|
|
54
|
+
/** Script the providerRejected branch. */
|
|
55
|
+
declare function updateFunctionDescriptionProviderRejected(value: FunctionDetails, failure?: Failure): Case<FunctionDetails>;
|
|
56
|
+
/** Script the invalidResponse branch. */
|
|
57
|
+
declare function updateFunctionDescriptionInvalidResponse(value: FunctionDetails, failure?: Failure): Case<FunctionDetails>;
|
|
58
|
+
/** Script the defect branch. */
|
|
59
|
+
declare function updateFunctionDescriptionDefect(value: FunctionDetails, failure?: Failure): Case<FunctionDetails>;
|
|
60
|
+
/** Script a safe retry of updateFunctionDescription. */
|
|
61
|
+
declare function updateFunctionDescriptionRetry(failure: Failure, retryAfterMs?: number): Case<FunctionDetails>;
|
|
62
|
+
/** Manifest scenario updatedDefault for updateFunctionDescription. */
|
|
63
|
+
declare function updateFunctionDescriptionUpdatedDefault(): Case<FunctionDetails>;
|
|
64
|
+
/** Default updateFunctionDescription scenario. */
|
|
65
|
+
declare function updateFunctionDescriptionDefault(): Case<FunctionDetails>;
|
|
66
|
+
/** Script the deleted branch. */
|
|
67
|
+
declare function deleteFunctionDeleted(value: FunctionWriteResult, failure?: Failure): Case<FunctionWriteResult>;
|
|
68
|
+
/** Script the providerRejected branch. */
|
|
69
|
+
declare function deleteFunctionProviderRejected(value: FunctionWriteResult, failure?: Failure): Case<FunctionWriteResult>;
|
|
70
|
+
/** Script the defect branch. */
|
|
71
|
+
declare function deleteFunctionDefect(value: FunctionWriteResult, failure?: Failure): Case<FunctionWriteResult>;
|
|
72
|
+
/** Script a safe retry of deleteFunction. */
|
|
73
|
+
declare function deleteFunctionRetry(failure: Failure, retryAfterMs?: number): Case<FunctionWriteResult>;
|
|
74
|
+
/** Manifest scenario deletedDefault for deleteFunction. */
|
|
75
|
+
declare function deleteFunctionDeletedDefault(): Case<FunctionWriteResult>;
|
|
76
|
+
/** Default deleteFunction scenario. */
|
|
77
|
+
declare function deleteFunctionDefault(): Case<FunctionWriteResult>;
|
|
26
78
|
/** Scripted operations and manifest defaults for this connector. */
|
|
27
79
|
declare class GeneratedMock implements Operations {
|
|
28
80
|
#private;
|
|
29
81
|
constructor(connectionName: string);
|
|
30
82
|
connection(): Connection;
|
|
31
83
|
getFunction(): MockQuery<GetFunctionInput, FunctionDetails>;
|
|
84
|
+
listFunctions(): MockQuery<ListFunctionsInput, FunctionPage>;
|
|
85
|
+
updateFunctionDescription(): MockMutation<UpdateFunctionDescriptionInput, FunctionDetails>;
|
|
86
|
+
deleteFunction(): MockMutation<DeleteFunctionInput, FunctionWriteResult>;
|
|
32
87
|
assertNoFailures(): void;
|
|
33
88
|
}
|
|
34
89
|
|
|
35
|
-
export { GeneratedMock, GeneratedMock as Mock, emptyFunctionDetails, emptyGetFunctionInput, getFunctionDefault, getFunctionDefect, getFunctionFound, getFunctionFoundDefault, getFunctionInvalidResponse, getFunctionMissing, getFunctionProviderRejected, getFunctionRetry };
|
|
90
|
+
export { GeneratedMock, GeneratedMock as Mock, deleteFunctionDefault, deleteFunctionDefect, deleteFunctionDeleted, deleteFunctionDeletedDefault, deleteFunctionProviderRejected, deleteFunctionRetry, emptyDeleteFunctionInput, emptyFunctionDetails, emptyFunctionPage, emptyFunctionWriteResult, emptyGetFunctionInput, emptyListFunctionsInput, emptyUpdateFunctionDescriptionInput, getFunctionDefault, getFunctionDefect, getFunctionFound, getFunctionFoundDefault, getFunctionInvalidResponse, getFunctionMissing, getFunctionProviderRejected, getFunctionRetry, listFunctionsDefault, listFunctionsDefect, listFunctionsInvalidResponse, listFunctionsListed, listFunctionsListedDefault, listFunctionsProviderRejected, listFunctionsRetry, updateFunctionDescriptionDefault, updateFunctionDescriptionDefect, updateFunctionDescriptionInvalidResponse, updateFunctionDescriptionMissing, updateFunctionDescriptionProviderRejected, updateFunctionDescriptionRetry, updateFunctionDescriptionUpdated, updateFunctionDescriptionUpdatedDefault };
|
package/dist/mock.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DeleteFunctionDefinition,
|
|
3
|
+
DeleteFunctionInputSchema,
|
|
2
4
|
FunctionDetailsSchema,
|
|
5
|
+
FunctionPageSchema,
|
|
6
|
+
FunctionWriteResultSchema,
|
|
3
7
|
GetFunctionDefinition,
|
|
4
8
|
GetFunctionInputSchema,
|
|
9
|
+
ListFunctionsDefinition,
|
|
10
|
+
ListFunctionsInputSchema,
|
|
5
11
|
ProviderID,
|
|
12
|
+
UpdateFunctionDescriptionDefinition,
|
|
13
|
+
UpdateFunctionDescriptionInputSchema,
|
|
6
14
|
newConnectionWithOperations
|
|
7
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HI4S6PQZ.js";
|
|
8
16
|
|
|
9
17
|
// src/generated/mock.ts
|
|
10
|
-
import { branchCase, retryCase, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
18
|
+
import { branchCase, retryCase, newMutation, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
11
19
|
var emptyGetFunctionInput = GetFunctionInputSchema.parse({
|
|
12
20
|
"functionName": ""
|
|
13
21
|
});
|
|
@@ -15,6 +23,24 @@ var emptyFunctionDetails = FunctionDetailsSchema.parse({
|
|
|
15
23
|
"name": "",
|
|
16
24
|
"arn": ""
|
|
17
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
|
+
});
|
|
18
44
|
function getFunctionFound(value, failure) {
|
|
19
45
|
return branchCase("found", value, failure);
|
|
20
46
|
}
|
|
@@ -40,11 +66,83 @@ function getFunctionFoundDefault() {
|
|
|
40
66
|
function getFunctionDefault() {
|
|
41
67
|
return getFunctionFoundDefault();
|
|
42
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
|
+
}
|
|
43
135
|
var GeneratedMock = class {
|
|
44
136
|
#getFunction;
|
|
137
|
+
#listFunctions;
|
|
138
|
+
#updateFunctionDescription;
|
|
139
|
+
#deleteFunction;
|
|
45
140
|
#connection;
|
|
46
141
|
constructor(connectionName) {
|
|
47
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());
|
|
48
146
|
this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
|
|
49
147
|
}
|
|
50
148
|
connection() {
|
|
@@ -53,15 +151,38 @@ var GeneratedMock = class {
|
|
|
53
151
|
getFunction() {
|
|
54
152
|
return this.#getFunction;
|
|
55
153
|
}
|
|
154
|
+
listFunctions() {
|
|
155
|
+
return this.#listFunctions;
|
|
156
|
+
}
|
|
157
|
+
updateFunctionDescription() {
|
|
158
|
+
return this.#updateFunctionDescription;
|
|
159
|
+
}
|
|
160
|
+
deleteFunction() {
|
|
161
|
+
return this.#deleteFunction;
|
|
162
|
+
}
|
|
56
163
|
assertNoFailures() {
|
|
57
164
|
this.#getFunction.assertNoFailures();
|
|
165
|
+
this.#listFunctions.assertNoFailures();
|
|
166
|
+
this.#updateFunctionDescription.assertNoFailures();
|
|
167
|
+
this.#deleteFunction.assertNoFailures();
|
|
58
168
|
}
|
|
59
169
|
};
|
|
60
170
|
export {
|
|
61
171
|
GeneratedMock,
|
|
62
172
|
GeneratedMock as Mock,
|
|
173
|
+
deleteFunctionDefault,
|
|
174
|
+
deleteFunctionDefect,
|
|
175
|
+
deleteFunctionDeleted,
|
|
176
|
+
deleteFunctionDeletedDefault,
|
|
177
|
+
deleteFunctionProviderRejected,
|
|
178
|
+
deleteFunctionRetry,
|
|
179
|
+
emptyDeleteFunctionInput,
|
|
63
180
|
emptyFunctionDetails,
|
|
181
|
+
emptyFunctionPage,
|
|
182
|
+
emptyFunctionWriteResult,
|
|
64
183
|
emptyGetFunctionInput,
|
|
184
|
+
emptyListFunctionsInput,
|
|
185
|
+
emptyUpdateFunctionDescriptionInput,
|
|
65
186
|
getFunctionDefault,
|
|
66
187
|
getFunctionDefect,
|
|
67
188
|
getFunctionFound,
|
|
@@ -69,5 +190,20 @@ export {
|
|
|
69
190
|
getFunctionInvalidResponse,
|
|
70
191
|
getFunctionMissing,
|
|
71
192
|
getFunctionProviderRejected,
|
|
72
|
-
getFunctionRetry
|
|
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
|
|
73
209
|
};
|
package/package.json
CHANGED
package/dist/chunk-G5OORMFR.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// src/generated/models.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { SecretString } from "@superdurable/connectors-sdk";
|
|
4
|
-
var ConfigSchema = z.object({
|
|
5
|
-
"region": z.string().optional(),
|
|
6
|
-
"endpoint": z.string().optional(),
|
|
7
|
-
"timeoutMs": z.number().int().optional(),
|
|
8
|
-
"maxResponseBytes": z.number().int().optional()
|
|
9
|
-
});
|
|
10
|
-
function decodeCredentials(value) {
|
|
11
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
|
|
12
|
-
const fields = value;
|
|
13
|
-
const allowed = /* @__PURE__ */ new Set(["access_key_id", "secret_access_key", "session_token"]);
|
|
14
|
-
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
|
|
15
|
-
if (fields["access_key_id"] != null && !(typeof fields["access_key_id"] === "string")) throw new TypeError("credential access_key_id has an invalid type");
|
|
16
|
-
if (fields["secret_access_key"] != null && !(typeof fields["secret_access_key"] === "string")) throw new TypeError("credential secret_access_key has an invalid type");
|
|
17
|
-
if (fields["session_token"] != null && !(typeof fields["session_token"] === "string")) throw new TypeError("credential session_token has an invalid type");
|
|
18
|
-
const credentials = {};
|
|
19
|
-
if (!fields["access_key_id"]) throw new TypeError("credential access_key_id is required");
|
|
20
|
-
credentials.accessKeyId = new SecretString(fields["access_key_id"] ?? "");
|
|
21
|
-
if (!fields["secret_access_key"]) throw new TypeError("credential secret_access_key is required");
|
|
22
|
-
credentials.secretAccessKey = new SecretString(fields["secret_access_key"] ?? "");
|
|
23
|
-
credentials.sessionToken = new SecretString(fields["session_token"] ?? "");
|
|
24
|
-
return credentials;
|
|
25
|
-
}
|
|
26
|
-
var GetFunctionInputSchema = z.strictObject({
|
|
27
|
-
"functionName": z.string()
|
|
28
|
-
});
|
|
29
|
-
var FunctionDetailsSchema = z.strictObject({
|
|
30
|
-
"name": z.string(),
|
|
31
|
-
"arn": z.string()
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// src/generated/definitions.ts
|
|
35
|
-
var ConnectorID = "amazon-lambda";
|
|
36
|
-
var ProviderID = "amazon-lambda";
|
|
37
|
-
var GetFunctionBranch = {
|
|
38
|
-
Found: "found",
|
|
39
|
-
Missing: "missing",
|
|
40
|
-
ProviderRejected: "providerRejected",
|
|
41
|
-
InvalidResponse: "invalidResponse",
|
|
42
|
-
Defect: "defect"
|
|
43
|
-
};
|
|
44
|
-
var GetFunctionBranchFound = GetFunctionBranch.Found;
|
|
45
|
-
var GetFunctionBranchMissing = GetFunctionBranch.Missing;
|
|
46
|
-
var GetFunctionBranchProviderRejected = GetFunctionBranch.ProviderRejected;
|
|
47
|
-
var GetFunctionBranchInvalidResponse = GetFunctionBranch.InvalidResponse;
|
|
48
|
-
var GetFunctionBranchDefect = GetFunctionBranch.Defect;
|
|
49
|
-
var GetFunctionDefinition = {
|
|
50
|
-
operation: { connectorId: ConnectorID, operationId: "getFunction" },
|
|
51
|
-
branches: [
|
|
52
|
-
{ id: "found", description: "AWS returned the function configuration." },
|
|
53
|
-
{ id: "missing", description: "The function does not exist in the selected Region.", optional: true },
|
|
54
|
-
{ id: "providerRejected", description: "AWS conclusively rejected the request or credentials.", optional: true },
|
|
55
|
-
{ id: "invalidResponse", description: "AWS returned malformed or oversized function metadata.", optional: true },
|
|
56
|
-
{ id: "defect", description: "The function name, endpoint, Region, or credentials are invalid.", optional: true }
|
|
57
|
-
],
|
|
58
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
59
|
-
};
|
|
60
|
-
var GetFunctionMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
61
|
-
|
|
62
|
-
// src/generated/connection.ts
|
|
63
|
-
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
64
|
-
var Connection = class {
|
|
65
|
-
/** Stable provider and connection name. */
|
|
66
|
-
reference;
|
|
67
|
-
/** Bound provider operations. */
|
|
68
|
-
operations;
|
|
69
|
-
/** Validate a reference and bind operations. */
|
|
70
|
-
constructor(reference, operations) {
|
|
71
|
-
this.reference = ConnectionRefSchema.parse(reference);
|
|
72
|
-
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
73
|
-
if (!operations) throw new TypeError("connector operations are required");
|
|
74
|
-
this.operations = operations;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
function newConnection(client, reference) {
|
|
78
|
-
if (!client) throw new TypeError("connector client is required");
|
|
79
|
-
return new Connection(reference, client);
|
|
80
|
-
}
|
|
81
|
-
function newConnectionWithOperations(operations, reference) {
|
|
82
|
-
return new Connection(reference, operations);
|
|
83
|
-
}
|
|
84
|
-
function newProjectConnection(project, connectionName, createClient) {
|
|
85
|
-
if (!project) throw new TypeError("loaded project is required");
|
|
86
|
-
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
87
|
-
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
88
|
-
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
89
|
-
return newConnection(createClient(project, connectionName), reference);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export {
|
|
93
|
-
ConfigSchema,
|
|
94
|
-
decodeCredentials,
|
|
95
|
-
GetFunctionInputSchema,
|
|
96
|
-
FunctionDetailsSchema,
|
|
97
|
-
ConnectorID,
|
|
98
|
-
ProviderID,
|
|
99
|
-
GetFunctionBranch,
|
|
100
|
-
GetFunctionBranchFound,
|
|
101
|
-
GetFunctionBranchMissing,
|
|
102
|
-
GetFunctionBranchProviderRejected,
|
|
103
|
-
GetFunctionBranchInvalidResponse,
|
|
104
|
-
GetFunctionBranchDefect,
|
|
105
|
-
GetFunctionDefinition,
|
|
106
|
-
GetFunctionMetadata,
|
|
107
|
-
Connection,
|
|
108
|
-
newConnection,
|
|
109
|
-
newConnectionWithOperations,
|
|
110
|
-
newProjectConnection
|
|
111
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { SecretString, CredentialProvider, Query, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
-
interface Config {
|
|
6
|
-
/** AWS Region of the Lambda function, as a Region code such as eu-west-1. In https://console.aws.amazon.com/lambda > Functions, use the console Region selector and the function ARN. Blank uses the displayed default; change it when your function is elsewhere. */
|
|
7
|
-
region?: string;
|
|
8
|
-
/** Optional Lambda-compatible API root. Blank derives the regional AWS endpoint from region. Override only for a trusted compatible endpoint; local tests may use loopback HTTP. */
|
|
9
|
-
endpoint?: string;
|
|
10
|
-
/** Maximum duration of one GetFunction request as a positive Go duration such as 15s. Blank uses the displayed default; increase only for a slow network. Runtime value in milliseconds. */
|
|
11
|
-
timeoutMs?: number;
|
|
12
|
-
/** Maximum complete function metadata response in bytes. Blank uses the displayed default; increase only for unusually large responses. */
|
|
13
|
-
maxResponseBytes?: number;
|
|
14
|
-
}
|
|
15
|
-
/** Runtime schema for manifest configuration. */
|
|
16
|
-
declare const ConfigSchema: z.ZodObject<{
|
|
17
|
-
region: z.ZodOptional<z.ZodString>;
|
|
18
|
-
endpoint: z.ZodOptional<z.ZodString>;
|
|
19
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
20
|
-
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
/** Private connector credentials resolved by the host. */
|
|
23
|
-
interface Credentials {
|
|
24
|
-
/** Secret-stored AWS access key ID from https://console.aws.amazon.com/iam > Users > selected user > Security credentials > Access keys > Create access key. Long-term IDs start AKIA and temporary IDs start ASIA. Blank prevents signing. Dex stores it as a secret. */
|
|
25
|
-
accessKeyId: SecretString;
|
|
26
|
-
/** Secret access key paired with access_key_id, shown once on the IAM Retrieve access keys page. Copy the Value, never the key ID. Blank prevents signing; rotate by creating another key and deleting the old one after verification. */
|
|
27
|
-
secretAccessKey: SecretString;
|
|
28
|
-
/** Secret session token for temporary ASIA credentials, from AWS STS. Blank means long-term IAM user credentials. Temporary credentials expire; replace all three fields before expiry. */
|
|
29
|
-
sessionToken?: SecretString;
|
|
30
|
-
}
|
|
31
|
-
/** Decode private credential fields for the connector. */
|
|
32
|
-
declare function decodeCredentials(value: unknown): Credentials;
|
|
33
|
-
/** Host-owned source of private connector credentials. */
|
|
34
|
-
type CredentialSource = CredentialProvider<Credentials>;
|
|
35
|
-
/** GetFunctionInput identifies one Lambda function in the configured Region. */
|
|
36
|
-
interface GetFunctionInput {
|
|
37
|
-
"functionName": string;
|
|
38
|
-
}
|
|
39
|
-
/** FunctionDetails returns the stable identity of a Lambda function. */
|
|
40
|
-
interface FunctionDetails {
|
|
41
|
-
"name": string;
|
|
42
|
-
"arn": string;
|
|
43
|
-
}
|
|
44
|
-
/** Runtime validator for GetFunctionInput. */
|
|
45
|
-
declare const GetFunctionInputSchema: z.ZodObject<{
|
|
46
|
-
functionName: z.ZodString;
|
|
47
|
-
}, z.core.$strict>;
|
|
48
|
-
/** Runtime validator for FunctionDetails. */
|
|
49
|
-
declare const FunctionDetailsSchema: z.ZodObject<{
|
|
50
|
-
name: z.ZodString;
|
|
51
|
-
arn: z.ZodString;
|
|
52
|
-
}, z.core.$strict>;
|
|
53
|
-
|
|
54
|
-
/** Typed operations supplied by a client or mock. */
|
|
55
|
-
interface Operations {
|
|
56
|
-
/** Invoke getFunction through this connection. */
|
|
57
|
-
getFunction(): Query<GetFunctionInput, FunctionDetails>;
|
|
58
|
-
}
|
|
59
|
-
/** Named connector connection kept outside Flow state. */
|
|
60
|
-
declare class Connection<BoundOperations = Operations> {
|
|
61
|
-
/** Stable provider and connection name. */
|
|
62
|
-
readonly reference: ConnectionRef;
|
|
63
|
-
/** Bound provider operations. */
|
|
64
|
-
readonly operations: BoundOperations;
|
|
65
|
-
/** Validate a reference and bind operations. */
|
|
66
|
-
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
67
|
-
}
|
|
68
|
-
/** Bind a client to a named connection. */
|
|
69
|
-
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
70
|
-
/** Bind scripted operations to a named connection. */
|
|
71
|
-
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
72
|
-
|
|
73
|
-
export { Connection as C, type FunctionDetails as F, type GetFunctionInput as G, type Operations as O, type Config as a, type Credentials as b, ConfigSchema as c, type CredentialSource as d, FunctionDetailsSchema as e, GetFunctionInputSchema as f, decodeCredentials as g, newConnectionWithOperations as h, newConnection as n };
|