@superdurable/connector-amazon-redshift 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/dist/mock.d.ts ADDED
@@ -0,0 +1,117 @@
1
+ import { MockQuery, MockMutation, Case } from '@superdurable/connectors-sdk/connectormock';
2
+ import { Failure } from '@superdurable/connectors-sdk';
3
+ import { O as Operations, a as Connection, G as GetStatementResultInput, d as StatementResultPage, E as ExecuteStatementInput, c as StatementIdentity, D as DescribeStatementInput, b as StatementStatus, L as ListStatementsInput, e as StatementPage, C as CancelStatementInput, S as StatementCancellation } from './connection-QfejfWYW.js';
4
+ import 'zod';
5
+
6
+ /** Go zero value for GetStatementResultInput in scripted cases. */
7
+ declare const emptyGetStatementResultInput: GetStatementResultInput;
8
+ /** Go zero value for StatementResultPage in scripted cases. */
9
+ declare const emptyStatementResultPage: StatementResultPage;
10
+ /** Go zero value for ExecuteStatementInput in scripted cases. */
11
+ declare const emptyExecuteStatementInput: ExecuteStatementInput;
12
+ /** Go zero value for StatementIdentity in scripted cases. */
13
+ declare const emptyStatementIdentity: StatementIdentity;
14
+ /** Go zero value for DescribeStatementInput in scripted cases. */
15
+ declare const emptyDescribeStatementInput: DescribeStatementInput;
16
+ /** Go zero value for StatementStatus in scripted cases. */
17
+ declare const emptyStatementStatus: StatementStatus;
18
+ /** Go zero value for ListStatementsInput in scripted cases. */
19
+ declare const emptyListStatementsInput: ListStatementsInput;
20
+ /** Go zero value for StatementPage in scripted cases. */
21
+ declare const emptyStatementPage: StatementPage;
22
+ /** Go zero value for CancelStatementInput in scripted cases. */
23
+ declare const emptyCancelStatementInput: CancelStatementInput;
24
+ /** Go zero value for StatementCancellation in scripted cases. */
25
+ declare const emptyStatementCancellation: StatementCancellation;
26
+ /** Script the fetched branch. */
27
+ declare function getStatementResultFetched(value: StatementResultPage, failure?: Failure): Case<StatementResultPage>;
28
+ /** Script the missing branch. */
29
+ declare function getStatementResultMissing(value: StatementResultPage, failure?: Failure): Case<StatementResultPage>;
30
+ /** Script the providerRejected branch. */
31
+ declare function getStatementResultProviderRejected(value: StatementResultPage, failure?: Failure): Case<StatementResultPage>;
32
+ /** Script the invalidResponse branch. */
33
+ declare function getStatementResultInvalidResponse(value: StatementResultPage, failure?: Failure): Case<StatementResultPage>;
34
+ /** Script the defect branch. */
35
+ declare function getStatementResultDefect(value: StatementResultPage, failure?: Failure): Case<StatementResultPage>;
36
+ /** Script a safe retry of getStatementResult. */
37
+ declare function getStatementResultRetry(failure: Failure, retryAfterMs?: number): Case<StatementResultPage>;
38
+ /** Manifest scenario fetchedDefault for getStatementResult. */
39
+ declare function getStatementResultFetchedDefault(): Case<StatementResultPage>;
40
+ /** Default getStatementResult scenario. */
41
+ declare function getStatementResultDefault(): Case<StatementResultPage>;
42
+ /** Script the submitted branch. */
43
+ declare function executeStatementSubmitted(value: StatementIdentity, failure?: Failure): Case<StatementIdentity>;
44
+ /** Script the providerRejected branch. */
45
+ declare function executeStatementProviderRejected(value: StatementIdentity, failure?: Failure): Case<StatementIdentity>;
46
+ /** Script the invalidResponse branch. */
47
+ declare function executeStatementInvalidResponse(value: StatementIdentity, failure?: Failure): Case<StatementIdentity>;
48
+ /** Script the defect branch. */
49
+ declare function executeStatementDefect(value: StatementIdentity, failure?: Failure): Case<StatementIdentity>;
50
+ /** Script a safe retry of executeStatement. */
51
+ declare function executeStatementRetry(failure: Failure, retryAfterMs?: number): Case<StatementIdentity>;
52
+ /** Manifest scenario submittedDefault for executeStatement. */
53
+ declare function executeStatementSubmittedDefault(): Case<StatementIdentity>;
54
+ /** Default executeStatement scenario. */
55
+ declare function executeStatementDefault(): Case<StatementIdentity>;
56
+ /** Script the described branch. */
57
+ declare function describeStatementDescribed(value: StatementStatus, failure?: Failure): Case<StatementStatus>;
58
+ /** Script the missing branch. */
59
+ declare function describeStatementMissing(value: StatementStatus, failure?: Failure): Case<StatementStatus>;
60
+ /** Script the providerRejected branch. */
61
+ declare function describeStatementProviderRejected(value: StatementStatus, failure?: Failure): Case<StatementStatus>;
62
+ /** Script the invalidResponse branch. */
63
+ declare function describeStatementInvalidResponse(value: StatementStatus, failure?: Failure): Case<StatementStatus>;
64
+ /** Script the defect branch. */
65
+ declare function describeStatementDefect(value: StatementStatus, failure?: Failure): Case<StatementStatus>;
66
+ /** Script a safe retry of describeStatement. */
67
+ declare function describeStatementRetry(failure: Failure, retryAfterMs?: number): Case<StatementStatus>;
68
+ /** Manifest scenario describedDefault for describeStatement. */
69
+ declare function describeStatementDescribedDefault(): Case<StatementStatus>;
70
+ /** Default describeStatement scenario. */
71
+ declare function describeStatementDefault(): Case<StatementStatus>;
72
+ /** Script the listed branch. */
73
+ declare function listStatementsListed(value: StatementPage, failure?: Failure): Case<StatementPage>;
74
+ /** Script the providerRejected branch. */
75
+ declare function listStatementsProviderRejected(value: StatementPage, failure?: Failure): Case<StatementPage>;
76
+ /** Script the invalidResponse branch. */
77
+ declare function listStatementsInvalidResponse(value: StatementPage, failure?: Failure): Case<StatementPage>;
78
+ /** Script the defect branch. */
79
+ declare function listStatementsDefect(value: StatementPage, failure?: Failure): Case<StatementPage>;
80
+ /** Script a safe retry of listStatements. */
81
+ declare function listStatementsRetry(failure: Failure, retryAfterMs?: number): Case<StatementPage>;
82
+ /** Manifest scenario listedDefault for listStatements. */
83
+ declare function listStatementsListedDefault(): Case<StatementPage>;
84
+ /** Default listStatements scenario. */
85
+ declare function listStatementsDefault(): Case<StatementPage>;
86
+ /** Script the canceled branch. */
87
+ declare function cancelStatementCanceled(value: StatementCancellation, failure?: Failure): Case<StatementCancellation>;
88
+ /** Script the notCanceled branch. */
89
+ declare function cancelStatementNotCanceled(value: StatementCancellation, failure?: Failure): Case<StatementCancellation>;
90
+ /** Script the missing branch. */
91
+ declare function cancelStatementMissing(value: StatementCancellation, failure?: Failure): Case<StatementCancellation>;
92
+ /** Script the providerRejected branch. */
93
+ declare function cancelStatementProviderRejected(value: StatementCancellation, failure?: Failure): Case<StatementCancellation>;
94
+ /** Script the invalidResponse branch. */
95
+ declare function cancelStatementInvalidResponse(value: StatementCancellation, failure?: Failure): Case<StatementCancellation>;
96
+ /** Script the defect branch. */
97
+ declare function cancelStatementDefect(value: StatementCancellation, failure?: Failure): Case<StatementCancellation>;
98
+ /** Script a safe retry of cancelStatement. */
99
+ declare function cancelStatementRetry(failure: Failure, retryAfterMs?: number): Case<StatementCancellation>;
100
+ /** Manifest scenario canceledDefault for cancelStatement. */
101
+ declare function cancelStatementCanceledDefault(): Case<StatementCancellation>;
102
+ /** Default cancelStatement scenario. */
103
+ declare function cancelStatementDefault(): Case<StatementCancellation>;
104
+ /** Scripted operations and manifest defaults for this connector. */
105
+ declare class GeneratedMock implements Operations {
106
+ #private;
107
+ constructor(connectionName: string);
108
+ connection(): Connection;
109
+ getStatementResult(): MockQuery<GetStatementResultInput, StatementResultPage>;
110
+ executeStatement(): MockMutation<ExecuteStatementInput, StatementIdentity>;
111
+ describeStatement(): MockQuery<DescribeStatementInput, StatementStatus>;
112
+ listStatements(): MockQuery<ListStatementsInput, StatementPage>;
113
+ cancelStatement(): MockMutation<CancelStatementInput, StatementCancellation>;
114
+ assertNoFailures(): void;
115
+ }
116
+
117
+ export { GeneratedMock, GeneratedMock as Mock, cancelStatementCanceled, cancelStatementCanceledDefault, cancelStatementDefault, cancelStatementDefect, cancelStatementInvalidResponse, cancelStatementMissing, cancelStatementNotCanceled, cancelStatementProviderRejected, cancelStatementRetry, describeStatementDefault, describeStatementDefect, describeStatementDescribed, describeStatementDescribedDefault, describeStatementInvalidResponse, describeStatementMissing, describeStatementProviderRejected, describeStatementRetry, emptyCancelStatementInput, emptyDescribeStatementInput, emptyExecuteStatementInput, emptyGetStatementResultInput, emptyListStatementsInput, emptyStatementCancellation, emptyStatementIdentity, emptyStatementPage, emptyStatementResultPage, emptyStatementStatus, executeStatementDefault, executeStatementDefect, executeStatementInvalidResponse, executeStatementProviderRejected, executeStatementRetry, executeStatementSubmitted, executeStatementSubmittedDefault, getStatementResultDefault, getStatementResultDefect, getStatementResultFetched, getStatementResultFetchedDefault, getStatementResultInvalidResponse, getStatementResultMissing, getStatementResultProviderRejected, getStatementResultRetry, listStatementsDefault, listStatementsDefect, listStatementsInvalidResponse, listStatementsListed, listStatementsListedDefault, listStatementsProviderRejected, listStatementsRetry };
package/dist/mock.js ADDED
@@ -0,0 +1,277 @@
1
+ import {
2
+ CancelStatementDefinition,
3
+ CancelStatementInputSchema,
4
+ DescribeStatementDefinition,
5
+ DescribeStatementInputSchema,
6
+ ExecuteStatementDefinition,
7
+ ExecuteStatementInputSchema,
8
+ GetStatementResultDefinition,
9
+ GetStatementResultInputSchema,
10
+ ListStatementsDefinition,
11
+ ListStatementsInputSchema,
12
+ ProviderID,
13
+ StatementCancellationSchema,
14
+ StatementIdentitySchema,
15
+ StatementPageSchema,
16
+ StatementResultPageSchema,
17
+ StatementStatusSchema,
18
+ newConnectionWithOperations
19
+ } from "./chunk-V4IZMGI7.js";
20
+
21
+ // src/generated/mock.ts
22
+ import { branchCase, retryCase, newMutation, newQuery } from "@superdurable/connectors-sdk/connectormock";
23
+ var emptyGetStatementResultInput = GetStatementResultInputSchema.parse({
24
+ "statementId": "",
25
+ "nextToken": ""
26
+ });
27
+ var emptyStatementResultPage = StatementResultPageSchema.parse({
28
+ "records": [],
29
+ "nextToken": "",
30
+ "totalNumRows": 0
31
+ });
32
+ var emptyExecuteStatementInput = ExecuteStatementInputSchema.parse({
33
+ "workgroupName": "",
34
+ "database": "",
35
+ "sql": ""
36
+ });
37
+ var emptyStatementIdentity = StatementIdentitySchema.parse({
38
+ "id": ""
39
+ });
40
+ var emptyDescribeStatementInput = DescribeStatementInputSchema.parse({
41
+ "statementId": ""
42
+ });
43
+ var emptyStatementStatus = StatementStatusSchema.parse({
44
+ "id": "",
45
+ "status": "",
46
+ "hasResultSet": false
47
+ });
48
+ var emptyListStatementsInput = ListStatementsInputSchema.parse({
49
+ "maxResults": 0,
50
+ "nextToken": ""
51
+ });
52
+ var emptyStatementPage = StatementPageSchema.parse({
53
+ "statements": [],
54
+ "nextToken": ""
55
+ });
56
+ var emptyCancelStatementInput = CancelStatementInputSchema.parse({
57
+ "statementId": ""
58
+ });
59
+ var emptyStatementCancellation = StatementCancellationSchema.parse({
60
+ "canceled": false
61
+ });
62
+ function getStatementResultFetched(value, failure) {
63
+ return branchCase("fetched", value, failure);
64
+ }
65
+ function getStatementResultMissing(value, failure) {
66
+ return branchCase("missing", value, failure);
67
+ }
68
+ function getStatementResultProviderRejected(value, failure) {
69
+ return branchCase("providerRejected", value, failure);
70
+ }
71
+ function getStatementResultInvalidResponse(value, failure) {
72
+ return branchCase("invalidResponse", value, failure);
73
+ }
74
+ function getStatementResultDefect(value, failure) {
75
+ return branchCase("defect", value, failure);
76
+ }
77
+ function getStatementResultRetry(failure, retryAfterMs = 0) {
78
+ return retryCase(failure, retryAfterMs);
79
+ }
80
+ function getStatementResultFetchedDefault() {
81
+ const value = StatementResultPageSchema.parse({ "nextToken": "", "records": [[{ "stringValue": "example" }]], "totalNumRows": 1 });
82
+ return branchCase("fetched", value);
83
+ }
84
+ function getStatementResultDefault() {
85
+ return getStatementResultFetchedDefault();
86
+ }
87
+ function executeStatementSubmitted(value, failure) {
88
+ return branchCase("submitted", value, failure);
89
+ }
90
+ function executeStatementProviderRejected(value, failure) {
91
+ return branchCase("providerRejected", value, failure);
92
+ }
93
+ function executeStatementInvalidResponse(value, failure) {
94
+ return branchCase("invalidResponse", value, failure);
95
+ }
96
+ function executeStatementDefect(value, failure) {
97
+ return branchCase("defect", value, failure);
98
+ }
99
+ function executeStatementRetry(failure, retryAfterMs = 0) {
100
+ return retryCase(failure, retryAfterMs);
101
+ }
102
+ function executeStatementSubmittedDefault() {
103
+ const value = StatementIdentitySchema.parse({ "id": "123e4567-e89b-12d3-a456-426614174000" });
104
+ return branchCase("submitted", value);
105
+ }
106
+ function executeStatementDefault() {
107
+ return executeStatementSubmittedDefault();
108
+ }
109
+ function describeStatementDescribed(value, failure) {
110
+ return branchCase("described", value, failure);
111
+ }
112
+ function describeStatementMissing(value, failure) {
113
+ return branchCase("missing", value, failure);
114
+ }
115
+ function describeStatementProviderRejected(value, failure) {
116
+ return branchCase("providerRejected", value, failure);
117
+ }
118
+ function describeStatementInvalidResponse(value, failure) {
119
+ return branchCase("invalidResponse", value, failure);
120
+ }
121
+ function describeStatementDefect(value, failure) {
122
+ return branchCase("defect", value, failure);
123
+ }
124
+ function describeStatementRetry(failure, retryAfterMs = 0) {
125
+ return retryCase(failure, retryAfterMs);
126
+ }
127
+ function describeStatementDescribedDefault() {
128
+ const value = StatementStatusSchema.parse({ "hasResultSet": true, "id": "123e4567-e89b-12d3-a456-426614174000", "status": "FINISHED" });
129
+ return branchCase("described", value);
130
+ }
131
+ function describeStatementDefault() {
132
+ return describeStatementDescribedDefault();
133
+ }
134
+ function listStatementsListed(value, failure) {
135
+ return branchCase("listed", value, failure);
136
+ }
137
+ function listStatementsProviderRejected(value, failure) {
138
+ return branchCase("providerRejected", value, failure);
139
+ }
140
+ function listStatementsInvalidResponse(value, failure) {
141
+ return branchCase("invalidResponse", value, failure);
142
+ }
143
+ function listStatementsDefect(value, failure) {
144
+ return branchCase("defect", value, failure);
145
+ }
146
+ function listStatementsRetry(failure, retryAfterMs = 0) {
147
+ return retryCase(failure, retryAfterMs);
148
+ }
149
+ function listStatementsListedDefault() {
150
+ const value = StatementPageSchema.parse({ "nextToken": "", "statements": [{ "hasResultSet": false, "id": "123e4567-e89b-12d3-a456-426614174000", "status": "FINISHED" }] });
151
+ return branchCase("listed", value);
152
+ }
153
+ function listStatementsDefault() {
154
+ return listStatementsListedDefault();
155
+ }
156
+ function cancelStatementCanceled(value, failure) {
157
+ return branchCase("canceled", value, failure);
158
+ }
159
+ function cancelStatementNotCanceled(value, failure) {
160
+ return branchCase("notCanceled", value, failure);
161
+ }
162
+ function cancelStatementMissing(value, failure) {
163
+ return branchCase("missing", value, failure);
164
+ }
165
+ function cancelStatementProviderRejected(value, failure) {
166
+ return branchCase("providerRejected", value, failure);
167
+ }
168
+ function cancelStatementInvalidResponse(value, failure) {
169
+ return branchCase("invalidResponse", value, failure);
170
+ }
171
+ function cancelStatementDefect(value, failure) {
172
+ return branchCase("defect", value, failure);
173
+ }
174
+ function cancelStatementRetry(failure, retryAfterMs = 0) {
175
+ return retryCase(failure, retryAfterMs);
176
+ }
177
+ function cancelStatementCanceledDefault() {
178
+ const value = StatementCancellationSchema.parse({ "canceled": true });
179
+ return branchCase("canceled", value);
180
+ }
181
+ function cancelStatementDefault() {
182
+ return cancelStatementCanceledDefault();
183
+ }
184
+ var GeneratedMock = class {
185
+ #getStatementResult;
186
+ #executeStatement;
187
+ #describeStatement;
188
+ #listStatements;
189
+ #cancelStatement;
190
+ #connection;
191
+ constructor(connectionName) {
192
+ this.#getStatementResult = newQuery(GetStatementResultDefinition).default(getStatementResultDefault());
193
+ this.#executeStatement = newMutation(ExecuteStatementDefinition).default(executeStatementDefault());
194
+ this.#describeStatement = newQuery(DescribeStatementDefinition).default(describeStatementDefault());
195
+ this.#listStatements = newQuery(ListStatementsDefinition).default(listStatementsDefault());
196
+ this.#cancelStatement = newMutation(CancelStatementDefinition).default(cancelStatementDefault());
197
+ this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
198
+ }
199
+ connection() {
200
+ return this.#connection;
201
+ }
202
+ getStatementResult() {
203
+ return this.#getStatementResult;
204
+ }
205
+ executeStatement() {
206
+ return this.#executeStatement;
207
+ }
208
+ describeStatement() {
209
+ return this.#describeStatement;
210
+ }
211
+ listStatements() {
212
+ return this.#listStatements;
213
+ }
214
+ cancelStatement() {
215
+ return this.#cancelStatement;
216
+ }
217
+ assertNoFailures() {
218
+ this.#getStatementResult.assertNoFailures();
219
+ this.#executeStatement.assertNoFailures();
220
+ this.#describeStatement.assertNoFailures();
221
+ this.#listStatements.assertNoFailures();
222
+ this.#cancelStatement.assertNoFailures();
223
+ }
224
+ };
225
+ export {
226
+ GeneratedMock,
227
+ GeneratedMock as Mock,
228
+ cancelStatementCanceled,
229
+ cancelStatementCanceledDefault,
230
+ cancelStatementDefault,
231
+ cancelStatementDefect,
232
+ cancelStatementInvalidResponse,
233
+ cancelStatementMissing,
234
+ cancelStatementNotCanceled,
235
+ cancelStatementProviderRejected,
236
+ cancelStatementRetry,
237
+ describeStatementDefault,
238
+ describeStatementDefect,
239
+ describeStatementDescribed,
240
+ describeStatementDescribedDefault,
241
+ describeStatementInvalidResponse,
242
+ describeStatementMissing,
243
+ describeStatementProviderRejected,
244
+ describeStatementRetry,
245
+ emptyCancelStatementInput,
246
+ emptyDescribeStatementInput,
247
+ emptyExecuteStatementInput,
248
+ emptyGetStatementResultInput,
249
+ emptyListStatementsInput,
250
+ emptyStatementCancellation,
251
+ emptyStatementIdentity,
252
+ emptyStatementPage,
253
+ emptyStatementResultPage,
254
+ emptyStatementStatus,
255
+ executeStatementDefault,
256
+ executeStatementDefect,
257
+ executeStatementInvalidResponse,
258
+ executeStatementProviderRejected,
259
+ executeStatementRetry,
260
+ executeStatementSubmitted,
261
+ executeStatementSubmittedDefault,
262
+ getStatementResultDefault,
263
+ getStatementResultDefect,
264
+ getStatementResultFetched,
265
+ getStatementResultFetchedDefault,
266
+ getStatementResultInvalidResponse,
267
+ getStatementResultMissing,
268
+ getStatementResultProviderRejected,
269
+ getStatementResultRetry,
270
+ listStatementsDefault,
271
+ listStatementsDefect,
272
+ listStatementsInvalidResponse,
273
+ listStatementsListed,
274
+ listStatementsListedDefault,
275
+ listStatementsProviderRejected,
276
+ listStatementsRetry
277
+ };
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "@superdurable/connector-amazon-redshift",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "license": "MIT",
5
+ "description": "Amazon Redshift 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/redshift/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/statement-results/worker.ts",
42
+ "example:start": "tsx examples/statement-results/start.ts",
43
+ "check": "npm run typecheck && npm run lint && npm test && npm run build"
44
+ },
45
+ "dependencies": {
46
+ "@superdurable/connectors-sdk": "0.12.0",
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
+ }