@superdurable/connector-amazon-redshift 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 +3 -1
- package/dex-connector.json +228 -2
- package/dist/chunk-V4IZMGI7.js +293 -0
- package/dist/connection-QfejfWYW.d.ts +185 -0
- package/dist/index.d.ts +249 -6
- package/dist/index.js +371 -8
- package/dist/mock.d.ts +85 -3
- package/dist/mock.js +205 -3
- package/package.json +2 -2
- package/dist/chunk-OEV6UKQQ.js +0 -113
- package/dist/connection-BikiyVDi.d.ts +0 -77
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
# Amazon Redshift TypeScript package
|
|
2
2
|
|
|
3
|
-
`AmazonRedshiftClient.getStatementResult()` binds the signed result-page Query. `GetStatementResultInput` holds `statementId` and `nextToken` (blank for the first page). `StatementResultPage` contains `records`, `totalNumRows`, and `nextToken`. See the [connector guide](../README.md) for configuration and IAM permissions. The [runnable
|
|
3
|
+
`AmazonRedshiftClient.getStatementResult()` binds the signed result-page Query. `GetStatementResultInput` holds `statementId` and `nextToken` (blank for the first page). `StatementResultPage` contains `records`, `totalNumRows`, and `nextToken`. See the [connector guide](../README.md) for configuration and IAM permissions. The [runnable examples](examples/statement-results/README.md) exercise a real Dex Worker with a local provider fixture. Live AWS access has not been verified.
|
|
4
|
+
|
|
5
|
+
Version 0.2.0 adds statement submission, status lookup, paginated listing, and cancellation. Submission retries use the same Redshift client token. Custom connection bindings supply all five operations. The generated mock connection provides a default answer for each operation.
|
package/dex-connector.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"connectorId": "amazon-redshift",
|
|
3
|
-
"releaseTag": "connectors/amazon/redshift/go/v0.
|
|
3
|
+
"releaseTag": "connectors/amazon/redshift/go/v0.2.0",
|
|
4
4
|
"package": {
|
|
5
5
|
"ecosystem": "npm",
|
|
6
6
|
"name": "@superdurable/connector-amazon-redshift",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.2.0"
|
|
8
8
|
},
|
|
9
9
|
"factories": [
|
|
10
10
|
{
|
|
@@ -63,6 +63,232 @@
|
|
|
63
63
|
],
|
|
64
64
|
"type": "object"
|
|
65
65
|
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "newExecuteStatementStep",
|
|
69
|
+
"kind": "mutation",
|
|
70
|
+
"operationId": "executeStatement",
|
|
71
|
+
"inputType": "ExecuteStatementInput",
|
|
72
|
+
"description": "Submit one SQL statement to a serverless workgroup with a Dex-derived client token.",
|
|
73
|
+
"fields": {
|
|
74
|
+
"stepType": "stepType",
|
|
75
|
+
"annotations": "annotations",
|
|
76
|
+
"connectionName": "connectionName",
|
|
77
|
+
"resultAttribute": "resultAttribute"
|
|
78
|
+
},
|
|
79
|
+
"branches": [
|
|
80
|
+
{
|
|
81
|
+
"id": "submitted",
|
|
82
|
+
"field": "submitted",
|
|
83
|
+
"optional": false
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "providerRejected",
|
|
87
|
+
"field": "providerRejected",
|
|
88
|
+
"optional": true
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "invalidResponse",
|
|
92
|
+
"field": "invalidResponse",
|
|
93
|
+
"optional": true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "defect",
|
|
97
|
+
"field": "defect",
|
|
98
|
+
"optional": true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"inputSchema": {
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"description": "ExecuteStatementInput submits one SQL statement to a serverless workgroup.",
|
|
104
|
+
"properties": {
|
|
105
|
+
"database": {
|
|
106
|
+
"description": "Database is the database selected in Query editor v2.",
|
|
107
|
+
"type": "string"
|
|
108
|
+
},
|
|
109
|
+
"sql": {
|
|
110
|
+
"description": "SQL is one statement without credentials or other secrets.",
|
|
111
|
+
"type": "string"
|
|
112
|
+
},
|
|
113
|
+
"workgroupName": {
|
|
114
|
+
"description": "WorkgroupName is the Redshift Serverless workgroup name in the configured Region.",
|
|
115
|
+
"type": "string"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": [
|
|
119
|
+
"database",
|
|
120
|
+
"sql",
|
|
121
|
+
"workgroupName"
|
|
122
|
+
],
|
|
123
|
+
"type": "object"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "newDescribeStatementStep",
|
|
128
|
+
"kind": "query",
|
|
129
|
+
"operationId": "describeStatement",
|
|
130
|
+
"inputType": "DescribeStatementInput",
|
|
131
|
+
"description": "Read a submitted statement's current execution status.",
|
|
132
|
+
"fields": {
|
|
133
|
+
"stepType": "stepType",
|
|
134
|
+
"annotations": "annotations",
|
|
135
|
+
"connectionName": "connectionName",
|
|
136
|
+
"resultAttribute": "resultAttribute"
|
|
137
|
+
},
|
|
138
|
+
"branches": [
|
|
139
|
+
{
|
|
140
|
+
"id": "described",
|
|
141
|
+
"field": "described",
|
|
142
|
+
"optional": false
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "missing",
|
|
146
|
+
"field": "missing",
|
|
147
|
+
"optional": true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": "providerRejected",
|
|
151
|
+
"field": "providerRejected",
|
|
152
|
+
"optional": true
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "invalidResponse",
|
|
156
|
+
"field": "invalidResponse",
|
|
157
|
+
"optional": true
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"id": "defect",
|
|
161
|
+
"field": "defect",
|
|
162
|
+
"optional": true
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"inputSchema": {
|
|
166
|
+
"additionalProperties": false,
|
|
167
|
+
"description": "DescribeStatementInput identifies a submitted statement.",
|
|
168
|
+
"properties": {
|
|
169
|
+
"statementId": {
|
|
170
|
+
"description": "StatementID is the UUID returned by ExecuteStatement.",
|
|
171
|
+
"type": "string"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"required": [
|
|
175
|
+
"statementId"
|
|
176
|
+
],
|
|
177
|
+
"type": "object"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "newListStatementsStep",
|
|
182
|
+
"kind": "query",
|
|
183
|
+
"operationId": "listStatements",
|
|
184
|
+
"inputType": "ListStatementsInput",
|
|
185
|
+
"description": "List one bounded page of statement IDs and statuses.",
|
|
186
|
+
"fields": {
|
|
187
|
+
"stepType": "stepType",
|
|
188
|
+
"annotations": "annotations",
|
|
189
|
+
"connectionName": "connectionName",
|
|
190
|
+
"resultAttribute": "resultAttribute"
|
|
191
|
+
},
|
|
192
|
+
"branches": [
|
|
193
|
+
{
|
|
194
|
+
"id": "listed",
|
|
195
|
+
"field": "listed",
|
|
196
|
+
"optional": false
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "providerRejected",
|
|
200
|
+
"field": "providerRejected",
|
|
201
|
+
"optional": true
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "invalidResponse",
|
|
205
|
+
"field": "invalidResponse",
|
|
206
|
+
"optional": true
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "defect",
|
|
210
|
+
"field": "defect",
|
|
211
|
+
"optional": true
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
"inputSchema": {
|
|
215
|
+
"additionalProperties": false,
|
|
216
|
+
"description": "ListStatementsInput selects a bounded page of recent statements.",
|
|
217
|
+
"properties": {
|
|
218
|
+
"maxResults": {
|
|
219
|
+
"description": "MaxResults selects 1 to 100 statements; zero uses the provider page size.",
|
|
220
|
+
"type": "integer"
|
|
221
|
+
},
|
|
222
|
+
"nextToken": {
|
|
223
|
+
"description": "NextToken resumes from a prior page; blank starts at the beginning.",
|
|
224
|
+
"type": "string"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"required": [
|
|
228
|
+
"maxResults",
|
|
229
|
+
"nextToken"
|
|
230
|
+
],
|
|
231
|
+
"type": "object"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "newCancelStatementStep",
|
|
236
|
+
"kind": "mutation",
|
|
237
|
+
"operationId": "cancelStatement",
|
|
238
|
+
"inputType": "CancelStatementInput",
|
|
239
|
+
"description": "Request cancellation of a running SQL statement.",
|
|
240
|
+
"fields": {
|
|
241
|
+
"stepType": "stepType",
|
|
242
|
+
"annotations": "annotations",
|
|
243
|
+
"connectionName": "connectionName",
|
|
244
|
+
"resultAttribute": "resultAttribute"
|
|
245
|
+
},
|
|
246
|
+
"branches": [
|
|
247
|
+
{
|
|
248
|
+
"id": "canceled",
|
|
249
|
+
"field": "canceled",
|
|
250
|
+
"optional": false
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"id": "notCanceled",
|
|
254
|
+
"field": "notCanceled",
|
|
255
|
+
"optional": true
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"id": "missing",
|
|
259
|
+
"field": "missing",
|
|
260
|
+
"optional": true
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"id": "providerRejected",
|
|
264
|
+
"field": "providerRejected",
|
|
265
|
+
"optional": true
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"id": "invalidResponse",
|
|
269
|
+
"field": "invalidResponse",
|
|
270
|
+
"optional": true
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"id": "defect",
|
|
274
|
+
"field": "defect",
|
|
275
|
+
"optional": true
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"inputSchema": {
|
|
279
|
+
"additionalProperties": false,
|
|
280
|
+
"description": "CancelStatementInput identifies a running statement to cancel.",
|
|
281
|
+
"properties": {
|
|
282
|
+
"statementId": {
|
|
283
|
+
"description": "StatementID is the UUID of the running statement.",
|
|
284
|
+
"type": "string"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"required": [
|
|
288
|
+
"statementId"
|
|
289
|
+
],
|
|
290
|
+
"type": "object"
|
|
291
|
+
}
|
|
66
292
|
}
|
|
67
293
|
]
|
|
68
294
|
}
|
|
@@ -0,0 +1,293 @@
|
|
|
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
|
+
var CredentialMaterialError = class extends TypeError {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "CredentialMaterialError";
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
|
|
17
|
+
"project credential decoding failed",
|
|
18
|
+
"shared project credential decoding failed",
|
|
19
|
+
"project credential decoding failed: this connector version does not support shared credentials"
|
|
20
|
+
]);
|
|
21
|
+
function isCredentialMaterialError(error) {
|
|
22
|
+
return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
|
|
23
|
+
}
|
|
24
|
+
function decodeCredentials(value) {
|
|
25
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
|
|
26
|
+
const fields = value;
|
|
27
|
+
const allowed = /* @__PURE__ */ new Set(["access_key_id", "secret_access_key", "session_token"]);
|
|
28
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
|
|
29
|
+
if (fields["access_key_id"] != null && !(typeof fields["access_key_id"] === "string")) throw new CredentialMaterialError("credential access_key_id has an invalid type");
|
|
30
|
+
if (fields["secret_access_key"] != null && !(typeof fields["secret_access_key"] === "string")) throw new CredentialMaterialError("credential secret_access_key has an invalid type");
|
|
31
|
+
if (fields["session_token"] != null && !(typeof fields["session_token"] === "string")) throw new CredentialMaterialError("credential session_token has an invalid type");
|
|
32
|
+
const credentials = {};
|
|
33
|
+
if (!fields["access_key_id"]) throw new CredentialMaterialError("credential access_key_id is required");
|
|
34
|
+
credentials.accessKeyId = new SecretString(fields["access_key_id"] ?? "");
|
|
35
|
+
if (!fields["secret_access_key"]) throw new CredentialMaterialError("credential secret_access_key is required");
|
|
36
|
+
credentials.secretAccessKey = new SecretString(fields["secret_access_key"] ?? "");
|
|
37
|
+
credentials.sessionToken = new SecretString(fields["session_token"] ?? "");
|
|
38
|
+
return credentials;
|
|
39
|
+
}
|
|
40
|
+
var GetStatementResultInputSchema = z.strictObject({
|
|
41
|
+
"statementId": z.string(),
|
|
42
|
+
"nextToken": z.string()
|
|
43
|
+
});
|
|
44
|
+
var StatementResultPageSchema = z.strictObject({
|
|
45
|
+
"records": z.array(z.unknown().nullable()).nullable(),
|
|
46
|
+
"nextToken": z.string(),
|
|
47
|
+
"totalNumRows": z.number().int()
|
|
48
|
+
});
|
|
49
|
+
var ExecuteStatementInputSchema = z.strictObject({
|
|
50
|
+
"workgroupName": z.string(),
|
|
51
|
+
"database": z.string(),
|
|
52
|
+
"sql": z.string()
|
|
53
|
+
});
|
|
54
|
+
var StatementIdentitySchema = z.strictObject({
|
|
55
|
+
"id": z.string()
|
|
56
|
+
});
|
|
57
|
+
var DescribeStatementInputSchema = z.strictObject({
|
|
58
|
+
"statementId": z.string()
|
|
59
|
+
});
|
|
60
|
+
var StatementStatusSchema = z.strictObject({
|
|
61
|
+
"id": z.string(),
|
|
62
|
+
"status": z.string(),
|
|
63
|
+
"hasResultSet": z.boolean()
|
|
64
|
+
});
|
|
65
|
+
var ListStatementsInputSchema = z.strictObject({
|
|
66
|
+
"maxResults": z.number().int(),
|
|
67
|
+
"nextToken": z.string()
|
|
68
|
+
});
|
|
69
|
+
var StatementPageSchema = z.strictObject({
|
|
70
|
+
"statements": z.array(StatementStatusSchema).nullable(),
|
|
71
|
+
"nextToken": z.string()
|
|
72
|
+
});
|
|
73
|
+
var CancelStatementInputSchema = z.strictObject({
|
|
74
|
+
"statementId": z.string()
|
|
75
|
+
});
|
|
76
|
+
var StatementCancellationSchema = z.strictObject({
|
|
77
|
+
"canceled": z.boolean()
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// src/generated/definitions.ts
|
|
81
|
+
var ConnectorID = "amazon-redshift";
|
|
82
|
+
var ProviderID = "amazon-redshift";
|
|
83
|
+
var GetStatementResultBranch = {
|
|
84
|
+
Fetched: "fetched",
|
|
85
|
+
Missing: "missing",
|
|
86
|
+
ProviderRejected: "providerRejected",
|
|
87
|
+
InvalidResponse: "invalidResponse",
|
|
88
|
+
Defect: "defect"
|
|
89
|
+
};
|
|
90
|
+
var GetStatementResultBranchFetched = GetStatementResultBranch.Fetched;
|
|
91
|
+
var GetStatementResultBranchMissing = GetStatementResultBranch.Missing;
|
|
92
|
+
var GetStatementResultBranchProviderRejected = GetStatementResultBranch.ProviderRejected;
|
|
93
|
+
var GetStatementResultBranchInvalidResponse = GetStatementResultBranch.InvalidResponse;
|
|
94
|
+
var GetStatementResultBranchDefect = GetStatementResultBranch.Defect;
|
|
95
|
+
var GetStatementResultDefinition = {
|
|
96
|
+
operation: { connectorId: ConnectorID, operationId: "getStatementResult" },
|
|
97
|
+
branches: [
|
|
98
|
+
{ id: "fetched", description: "Redshift returned the statement result page." },
|
|
99
|
+
{ id: "missing", description: "Redshift does not retain the specified statement result.", optional: true },
|
|
100
|
+
{ id: "providerRejected", description: "Redshift conclusively rejected the lookup or credentials.", optional: true },
|
|
101
|
+
{ id: "invalidResponse", description: "Redshift returned malformed or oversized result JSON.", optional: true },
|
|
102
|
+
{ id: "defect", description: "The statement ID, endpoint, Region, or credentials are invalid.", optional: true }
|
|
103
|
+
],
|
|
104
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
105
|
+
};
|
|
106
|
+
var GetStatementResultMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
107
|
+
var ExecuteStatementBranch = {
|
|
108
|
+
Submitted: "submitted",
|
|
109
|
+
ProviderRejected: "providerRejected",
|
|
110
|
+
InvalidResponse: "invalidResponse",
|
|
111
|
+
Defect: "defect"
|
|
112
|
+
};
|
|
113
|
+
var ExecuteStatementBranchSubmitted = ExecuteStatementBranch.Submitted;
|
|
114
|
+
var ExecuteStatementBranchProviderRejected = ExecuteStatementBranch.ProviderRejected;
|
|
115
|
+
var ExecuteStatementBranchInvalidResponse = ExecuteStatementBranch.InvalidResponse;
|
|
116
|
+
var ExecuteStatementBranchDefect = ExecuteStatementBranch.Defect;
|
|
117
|
+
var ExecuteStatementDefinition = {
|
|
118
|
+
operation: { connectorId: ConnectorID, operationId: "executeStatement" },
|
|
119
|
+
branches: [
|
|
120
|
+
{ id: "submitted", description: "Redshift accepted the SQL statement." },
|
|
121
|
+
{ id: "providerRejected", description: "Redshift conclusively rejected the submission.", optional: true },
|
|
122
|
+
{ id: "invalidResponse", description: "Redshift returned malformed or oversized submission JSON.", optional: true },
|
|
123
|
+
{ id: "defect", description: "The workgroup or SQL input or connection settings are invalid.", optional: true }
|
|
124
|
+
],
|
|
125
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
|
|
126
|
+
repeatOnUnknown: "safe"
|
|
127
|
+
};
|
|
128
|
+
var ExecuteStatementMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
129
|
+
var DescribeStatementBranch = {
|
|
130
|
+
Described: "described",
|
|
131
|
+
Missing: "missing",
|
|
132
|
+
ProviderRejected: "providerRejected",
|
|
133
|
+
InvalidResponse: "invalidResponse",
|
|
134
|
+
Defect: "defect"
|
|
135
|
+
};
|
|
136
|
+
var DescribeStatementBranchDescribed = DescribeStatementBranch.Described;
|
|
137
|
+
var DescribeStatementBranchMissing = DescribeStatementBranch.Missing;
|
|
138
|
+
var DescribeStatementBranchProviderRejected = DescribeStatementBranch.ProviderRejected;
|
|
139
|
+
var DescribeStatementBranchInvalidResponse = DescribeStatementBranch.InvalidResponse;
|
|
140
|
+
var DescribeStatementBranchDefect = DescribeStatementBranch.Defect;
|
|
141
|
+
var DescribeStatementDefinition = {
|
|
142
|
+
operation: { connectorId: ConnectorID, operationId: "describeStatement" },
|
|
143
|
+
branches: [
|
|
144
|
+
{ id: "described", description: "Redshift returned the statement status." },
|
|
145
|
+
{ id: "missing", description: "Redshift does not retain the statement.", optional: true },
|
|
146
|
+
{ id: "providerRejected", description: "Redshift conclusively rejected the lookup.", optional: true },
|
|
147
|
+
{ id: "invalidResponse", description: "Redshift returned malformed or oversized status JSON.", optional: true },
|
|
148
|
+
{ id: "defect", description: "The statement ID or connection settings are invalid.", optional: true }
|
|
149
|
+
],
|
|
150
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
151
|
+
};
|
|
152
|
+
var DescribeStatementMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
153
|
+
var ListStatementsBranch = {
|
|
154
|
+
Listed: "listed",
|
|
155
|
+
ProviderRejected: "providerRejected",
|
|
156
|
+
InvalidResponse: "invalidResponse",
|
|
157
|
+
Defect: "defect"
|
|
158
|
+
};
|
|
159
|
+
var ListStatementsBranchListed = ListStatementsBranch.Listed;
|
|
160
|
+
var ListStatementsBranchProviderRejected = ListStatementsBranch.ProviderRejected;
|
|
161
|
+
var ListStatementsBranchInvalidResponse = ListStatementsBranch.InvalidResponse;
|
|
162
|
+
var ListStatementsBranchDefect = ListStatementsBranch.Defect;
|
|
163
|
+
var ListStatementsDefinition = {
|
|
164
|
+
operation: { connectorId: ConnectorID, operationId: "listStatements" },
|
|
165
|
+
branches: [
|
|
166
|
+
{ id: "listed", description: "Redshift returned a statement page." },
|
|
167
|
+
{ id: "providerRejected", description: "Redshift conclusively rejected the list request.", optional: true },
|
|
168
|
+
{ id: "invalidResponse", description: "Redshift returned malformed or oversized list JSON.", optional: true },
|
|
169
|
+
{ id: "defect", description: "The page input or connection settings are invalid.", optional: true }
|
|
170
|
+
],
|
|
171
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
172
|
+
};
|
|
173
|
+
var ListStatementsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
174
|
+
var CancelStatementBranch = {
|
|
175
|
+
Canceled: "canceled",
|
|
176
|
+
NotCanceled: "notCanceled",
|
|
177
|
+
Missing: "missing",
|
|
178
|
+
ProviderRejected: "providerRejected",
|
|
179
|
+
InvalidResponse: "invalidResponse",
|
|
180
|
+
Defect: "defect"
|
|
181
|
+
};
|
|
182
|
+
var CancelStatementBranchCanceled = CancelStatementBranch.Canceled;
|
|
183
|
+
var CancelStatementBranchNotCanceled = CancelStatementBranch.NotCanceled;
|
|
184
|
+
var CancelStatementBranchMissing = CancelStatementBranch.Missing;
|
|
185
|
+
var CancelStatementBranchProviderRejected = CancelStatementBranch.ProviderRejected;
|
|
186
|
+
var CancelStatementBranchInvalidResponse = CancelStatementBranch.InvalidResponse;
|
|
187
|
+
var CancelStatementBranchDefect = CancelStatementBranch.Defect;
|
|
188
|
+
var CancelStatementDefinition = {
|
|
189
|
+
operation: { connectorId: ConnectorID, operationId: "cancelStatement" },
|
|
190
|
+
branches: [
|
|
191
|
+
{ id: "canceled", description: "Redshift accepted the cancellation." },
|
|
192
|
+
{ id: "notCanceled", description: "The statement was not running or could not be canceled.", optional: true },
|
|
193
|
+
{ id: "missing", description: "Redshift does not retain the statement.", optional: true },
|
|
194
|
+
{ id: "providerRejected", description: "Redshift conclusively rejected the cancellation.", optional: true },
|
|
195
|
+
{ id: "invalidResponse", description: "Redshift returned malformed or oversized cancellation JSON.", optional: true },
|
|
196
|
+
{ id: "defect", description: "The statement ID or connection settings are invalid.", optional: true }
|
|
197
|
+
],
|
|
198
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
|
|
199
|
+
repeatOnUnknown: "safe"
|
|
200
|
+
};
|
|
201
|
+
var CancelStatementMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
202
|
+
|
|
203
|
+
// src/generated/connection.ts
|
|
204
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
205
|
+
var Connection = class {
|
|
206
|
+
/** Stable provider and connection name. */
|
|
207
|
+
reference;
|
|
208
|
+
/** Bound provider operations. */
|
|
209
|
+
operations;
|
|
210
|
+
/** Validate a reference and bind operations. */
|
|
211
|
+
constructor(reference, operations) {
|
|
212
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
213
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
214
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
215
|
+
this.operations = operations;
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
function newConnection(client, reference) {
|
|
219
|
+
if (!client) throw new TypeError("connector client is required");
|
|
220
|
+
return new Connection(reference, client);
|
|
221
|
+
}
|
|
222
|
+
function newConnectionWithOperations(operations, reference) {
|
|
223
|
+
return new Connection(reference, operations);
|
|
224
|
+
}
|
|
225
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
226
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
227
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
228
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
229
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
230
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export {
|
|
234
|
+
ConfigSchema,
|
|
235
|
+
CredentialMaterialError,
|
|
236
|
+
isCredentialMaterialError,
|
|
237
|
+
decodeCredentials,
|
|
238
|
+
GetStatementResultInputSchema,
|
|
239
|
+
StatementResultPageSchema,
|
|
240
|
+
ExecuteStatementInputSchema,
|
|
241
|
+
StatementIdentitySchema,
|
|
242
|
+
DescribeStatementInputSchema,
|
|
243
|
+
StatementStatusSchema,
|
|
244
|
+
ListStatementsInputSchema,
|
|
245
|
+
StatementPageSchema,
|
|
246
|
+
CancelStatementInputSchema,
|
|
247
|
+
StatementCancellationSchema,
|
|
248
|
+
ConnectorID,
|
|
249
|
+
ProviderID,
|
|
250
|
+
GetStatementResultBranch,
|
|
251
|
+
GetStatementResultBranchFetched,
|
|
252
|
+
GetStatementResultBranchMissing,
|
|
253
|
+
GetStatementResultBranchProviderRejected,
|
|
254
|
+
GetStatementResultBranchInvalidResponse,
|
|
255
|
+
GetStatementResultBranchDefect,
|
|
256
|
+
GetStatementResultDefinition,
|
|
257
|
+
GetStatementResultMetadata,
|
|
258
|
+
ExecuteStatementBranch,
|
|
259
|
+
ExecuteStatementBranchSubmitted,
|
|
260
|
+
ExecuteStatementBranchProviderRejected,
|
|
261
|
+
ExecuteStatementBranchInvalidResponse,
|
|
262
|
+
ExecuteStatementBranchDefect,
|
|
263
|
+
ExecuteStatementDefinition,
|
|
264
|
+
ExecuteStatementMetadata,
|
|
265
|
+
DescribeStatementBranch,
|
|
266
|
+
DescribeStatementBranchDescribed,
|
|
267
|
+
DescribeStatementBranchMissing,
|
|
268
|
+
DescribeStatementBranchProviderRejected,
|
|
269
|
+
DescribeStatementBranchInvalidResponse,
|
|
270
|
+
DescribeStatementBranchDefect,
|
|
271
|
+
DescribeStatementDefinition,
|
|
272
|
+
DescribeStatementMetadata,
|
|
273
|
+
ListStatementsBranch,
|
|
274
|
+
ListStatementsBranchListed,
|
|
275
|
+
ListStatementsBranchProviderRejected,
|
|
276
|
+
ListStatementsBranchInvalidResponse,
|
|
277
|
+
ListStatementsBranchDefect,
|
|
278
|
+
ListStatementsDefinition,
|
|
279
|
+
ListStatementsMetadata,
|
|
280
|
+
CancelStatementBranch,
|
|
281
|
+
CancelStatementBranchCanceled,
|
|
282
|
+
CancelStatementBranchNotCanceled,
|
|
283
|
+
CancelStatementBranchMissing,
|
|
284
|
+
CancelStatementBranchProviderRejected,
|
|
285
|
+
CancelStatementBranchInvalidResponse,
|
|
286
|
+
CancelStatementBranchDefect,
|
|
287
|
+
CancelStatementDefinition,
|
|
288
|
+
CancelStatementMetadata,
|
|
289
|
+
Connection,
|
|
290
|
+
newConnection,
|
|
291
|
+
newConnectionWithOperations,
|
|
292
|
+
newProjectConnection
|
|
293
|
+
};
|