@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/LICENSE +21 -0
- package/README.md +4 -2
- package/dex-connector.json +294 -0
- package/dist/chunk-V4IZMGI7.js +293 -0
- package/dist/connection-QfejfWYW.d.ts +185 -0
- package/dist/index.d.ts +343 -0
- package/dist/index.js +638 -0
- package/dist/mock.d.ts +117 -0
- package/dist/mock.js +277 -0
- package/package.json +59 -4
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { SecretString, CredentialProvider, Query, Mutation, 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 code containing the statement, such as eu-west-1. In https://console.aws.amazon.com/redshiftv2 > Query editor v2, use the console Region selector; blank uses the displayed default. */
|
|
7
|
+
region?: string;
|
|
8
|
+
/** Optional Redshift Data 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 Data API 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 Data API response in bytes. Blank uses the displayed default; increase only for a known large page. */
|
|
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. */
|
|
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 through IAM. */
|
|
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
|
+
/** Stored credential material that fails the connector credential checks, so no retry can succeed. */
|
|
32
|
+
declare class CredentialMaterialError extends TypeError {
|
|
33
|
+
constructor(message: string);
|
|
34
|
+
}
|
|
35
|
+
/** Report malformed stored credential material, also behind the SDK provider's decoding TypeError. */
|
|
36
|
+
declare function isCredentialMaterialError(error: unknown): boolean;
|
|
37
|
+
/** Decode private credential fields for the connector. */
|
|
38
|
+
declare function decodeCredentials(value: unknown): Credentials;
|
|
39
|
+
/** Host-owned source of private connector credentials. */
|
|
40
|
+
type CredentialSource = CredentialProvider<Credentials>;
|
|
41
|
+
/** GetStatementResultInput identifies a JSON result page by statement UUID and optional token. */
|
|
42
|
+
interface GetStatementResultInput {
|
|
43
|
+
"statementId": string;
|
|
44
|
+
"nextToken": string;
|
|
45
|
+
}
|
|
46
|
+
/** StatementResultPage holds one page of Redshift Field rows and a token for the next page. */
|
|
47
|
+
interface StatementResultPage {
|
|
48
|
+
"records": Array<unknown | null> | null;
|
|
49
|
+
"nextToken": string;
|
|
50
|
+
"totalNumRows": number;
|
|
51
|
+
}
|
|
52
|
+
/** ExecuteStatementInput submits one SQL statement to a serverless workgroup. */
|
|
53
|
+
interface ExecuteStatementInput {
|
|
54
|
+
/** WorkgroupName is the Redshift Serverless workgroup name in the configured Region. */
|
|
55
|
+
"workgroupName": string;
|
|
56
|
+
/** Database is the database selected in Query editor v2. */
|
|
57
|
+
"database": string;
|
|
58
|
+
/** SQL is one statement without credentials or other secrets. */
|
|
59
|
+
"sql": string;
|
|
60
|
+
}
|
|
61
|
+
/** StatementIdentity contains the ID assigned by Redshift Data API. */
|
|
62
|
+
interface StatementIdentity {
|
|
63
|
+
/** ID is the Redshift Data API UUID to describe or fetch results. */
|
|
64
|
+
"id": string;
|
|
65
|
+
}
|
|
66
|
+
/** DescribeStatementInput identifies a submitted statement. */
|
|
67
|
+
interface DescribeStatementInput {
|
|
68
|
+
/** StatementID is the UUID returned by ExecuteStatement. */
|
|
69
|
+
"statementId": string;
|
|
70
|
+
}
|
|
71
|
+
/** StatementStatus contains the identity and execution status of a statement. */
|
|
72
|
+
interface StatementStatus {
|
|
73
|
+
/** ID is the Redshift Data API statement UUID. */
|
|
74
|
+
"id": string;
|
|
75
|
+
/** Status is a Redshift execution state such as FINISHED or FAILED. */
|
|
76
|
+
"status": string;
|
|
77
|
+
/** HasResultSet reports whether a result page can be fetched. */
|
|
78
|
+
"hasResultSet": boolean;
|
|
79
|
+
}
|
|
80
|
+
/** ListStatementsInput selects a bounded page of recent statements. */
|
|
81
|
+
interface ListStatementsInput {
|
|
82
|
+
/** MaxResults selects 1 to 100 statements; zero uses the provider page size. */
|
|
83
|
+
"maxResults": number;
|
|
84
|
+
/** NextToken resumes from a prior page; blank starts at the beginning. */
|
|
85
|
+
"nextToken": string;
|
|
86
|
+
}
|
|
87
|
+
/** StatementPage contains statement IDs and statuses with a continuation token. */
|
|
88
|
+
interface StatementPage {
|
|
89
|
+
/** Statements contains IDs and statuses without SQL text. */
|
|
90
|
+
"statements": Array<StatementStatus> | null;
|
|
91
|
+
/** NextToken resumes the following page; blank means the list is complete. */
|
|
92
|
+
"nextToken": string;
|
|
93
|
+
}
|
|
94
|
+
/** CancelStatementInput identifies a running statement to cancel. */
|
|
95
|
+
interface CancelStatementInput {
|
|
96
|
+
/** StatementID is the UUID of the running statement. */
|
|
97
|
+
"statementId": string;
|
|
98
|
+
}
|
|
99
|
+
/** StatementCancellation reports whether Redshift accepted cancellation. */
|
|
100
|
+
interface StatementCancellation {
|
|
101
|
+
/** Canceled reports that cancellation was accepted or the statement is aborted. */
|
|
102
|
+
"canceled": boolean;
|
|
103
|
+
}
|
|
104
|
+
/** Runtime validator for GetStatementResultInput. */
|
|
105
|
+
declare const GetStatementResultInputSchema: z.ZodObject<{
|
|
106
|
+
statementId: z.ZodString;
|
|
107
|
+
nextToken: z.ZodString;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
/** Runtime validator for StatementResultPage. */
|
|
110
|
+
declare const StatementResultPageSchema: z.ZodObject<{
|
|
111
|
+
records: z.ZodNullable<z.ZodArray<z.ZodNullable<z.ZodUnknown>>>;
|
|
112
|
+
nextToken: z.ZodString;
|
|
113
|
+
totalNumRows: z.ZodNumber;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
/** Runtime validator for ExecuteStatementInput. */
|
|
116
|
+
declare const ExecuteStatementInputSchema: z.ZodObject<{
|
|
117
|
+
workgroupName: z.ZodString;
|
|
118
|
+
database: z.ZodString;
|
|
119
|
+
sql: z.ZodString;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
/** Runtime validator for StatementIdentity. */
|
|
122
|
+
declare const StatementIdentitySchema: z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
/** Runtime validator for DescribeStatementInput. */
|
|
126
|
+
declare const DescribeStatementInputSchema: z.ZodObject<{
|
|
127
|
+
statementId: z.ZodString;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
/** Runtime validator for StatementStatus. */
|
|
130
|
+
declare const StatementStatusSchema: z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
status: z.ZodString;
|
|
133
|
+
hasResultSet: z.ZodBoolean;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
/** Runtime validator for ListStatementsInput. */
|
|
136
|
+
declare const ListStatementsInputSchema: z.ZodObject<{
|
|
137
|
+
maxResults: z.ZodNumber;
|
|
138
|
+
nextToken: z.ZodString;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
/** Runtime validator for StatementPage. */
|
|
141
|
+
declare const StatementPageSchema: z.ZodObject<{
|
|
142
|
+
statements: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
status: z.ZodString;
|
|
145
|
+
hasResultSet: z.ZodBoolean;
|
|
146
|
+
}, z.core.$strict>>>;
|
|
147
|
+
nextToken: z.ZodString;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
/** Runtime validator for CancelStatementInput. */
|
|
150
|
+
declare const CancelStatementInputSchema: z.ZodObject<{
|
|
151
|
+
statementId: z.ZodString;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
/** Runtime validator for StatementCancellation. */
|
|
154
|
+
declare const StatementCancellationSchema: z.ZodObject<{
|
|
155
|
+
canceled: z.ZodBoolean;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
|
|
158
|
+
/** Typed operations supplied by a client or mock. */
|
|
159
|
+
interface Operations {
|
|
160
|
+
/** Invoke getStatementResult through this connection. */
|
|
161
|
+
getStatementResult(): Query<GetStatementResultInput, StatementResultPage>;
|
|
162
|
+
/** Invoke executeStatement through this connection. */
|
|
163
|
+
executeStatement(): Mutation<ExecuteStatementInput, StatementIdentity>;
|
|
164
|
+
/** Invoke describeStatement through this connection. */
|
|
165
|
+
describeStatement(): Query<DescribeStatementInput, StatementStatus>;
|
|
166
|
+
/** Invoke listStatements through this connection. */
|
|
167
|
+
listStatements(): Query<ListStatementsInput, StatementPage>;
|
|
168
|
+
/** Invoke cancelStatement through this connection. */
|
|
169
|
+
cancelStatement(): Mutation<CancelStatementInput, StatementCancellation>;
|
|
170
|
+
}
|
|
171
|
+
/** Named connector connection kept outside Flow state. */
|
|
172
|
+
declare class Connection<BoundOperations = Operations> {
|
|
173
|
+
/** Stable provider and connection name. */
|
|
174
|
+
readonly reference: ConnectionRef;
|
|
175
|
+
/** Bound provider operations. */
|
|
176
|
+
readonly operations: BoundOperations;
|
|
177
|
+
/** Validate a reference and bind operations. */
|
|
178
|
+
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
179
|
+
}
|
|
180
|
+
/** Bind a client to a named connection. */
|
|
181
|
+
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
182
|
+
/** Bind scripted operations to a named connection. */
|
|
183
|
+
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
184
|
+
|
|
185
|
+
export { type CancelStatementInput as C, type DescribeStatementInput as D, type ExecuteStatementInput as E, type GetStatementResultInput as G, type ListStatementsInput as L, type Operations as O, type StatementCancellation as S, Connection as a, type StatementStatus as b, type StatementIdentity as c, type StatementResultPage as d, type StatementPage as e, type Config as f, type Credentials as g, CancelStatementInputSchema as h, ConfigSchema as i, CredentialMaterialError as j, type CredentialSource as k, DescribeStatementInputSchema as l, ExecuteStatementInputSchema as m, GetStatementResultInputSchema as n, ListStatementsInputSchema as o, StatementCancellationSchema as p, StatementIdentitySchema as q, StatementPageSchema as r, StatementResultPageSchema as s, StatementStatusSchema as t, decodeCredentials as u, isCredentialMaterialError as v, newConnection as w, newConnectionWithOperations as x };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { C as CancelStatementInput, S as StatementCancellation, a as Connection, D as DescribeStatementInput, b as StatementStatus, E as ExecuteStatementInput, c as StatementIdentity, G as GetStatementResultInput, d as StatementResultPage, L as ListStatementsInput, e as StatementPage, O as Operations, f as Config, g as Credentials } from './connection-QfejfWYW.js';
|
|
2
|
+
export { h as CancelStatementInputSchema, i as ConfigSchema, j as CredentialMaterialError, k as CredentialSource, l as DescribeStatementInputSchema, m as ExecuteStatementInputSchema, n as GetStatementResultInputSchema, o as ListStatementsInputSchema, p as StatementCancellationSchema, q as StatementIdentitySchema, r as StatementPageSchema, s as StatementResultPageSchema, t as StatementStatusSchema, u as decodeCredentials, v as isCredentialMaterialError, w as newConnection, x as newConnectionWithOperations } from './connection-QfejfWYW.js';
|
|
3
|
+
import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
|
|
4
|
+
import { MutationDefinition, QueryDefinition, MutationStepConfig, Mutation, MutationResult, QueryStepConfig, Query, QueryResult, MutationStep, QueryStep, CredentialProvider, Call, QueryAttempt, MutationAttempt } from '@superdurable/connectors-sdk';
|
|
5
|
+
import { StepTarget } from '@superdurable/dex';
|
|
6
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
7
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
/** Stable connector identity. */
|
|
11
|
+
declare const ConnectorID = "amazon-redshift";
|
|
12
|
+
/** Provider identity for named connections. */
|
|
13
|
+
declare const ProviderID = "amazon-redshift";
|
|
14
|
+
/** Branch IDs for getStatementResult. */
|
|
15
|
+
declare const GetStatementResultBranch: {
|
|
16
|
+
readonly Fetched: "fetched";
|
|
17
|
+
readonly Missing: "missing";
|
|
18
|
+
readonly ProviderRejected: "providerRejected";
|
|
19
|
+
readonly InvalidResponse: "invalidResponse";
|
|
20
|
+
readonly Defect: "defect";
|
|
21
|
+
};
|
|
22
|
+
/** Redshift returned the statement result page. */
|
|
23
|
+
declare const GetStatementResultBranchFetched: "fetched";
|
|
24
|
+
/** Redshift does not retain the specified statement result. */
|
|
25
|
+
declare const GetStatementResultBranchMissing: "missing";
|
|
26
|
+
/** Redshift conclusively rejected the lookup or credentials. */
|
|
27
|
+
declare const GetStatementResultBranchProviderRejected: "providerRejected";
|
|
28
|
+
/** Redshift returned malformed or oversized result JSON. */
|
|
29
|
+
declare const GetStatementResultBranchInvalidResponse: "invalidResponse";
|
|
30
|
+
/** The statement ID, endpoint, Region, or credentials are invalid. */
|
|
31
|
+
declare const GetStatementResultBranchDefect: "defect";
|
|
32
|
+
/** Manifest definition for getStatementResult. */
|
|
33
|
+
declare const GetStatementResultDefinition: QueryDefinition;
|
|
34
|
+
/** Manifest metadata for getStatementResult. */
|
|
35
|
+
declare const GetStatementResultMetadata: {
|
|
36
|
+
readonly kind: "query";
|
|
37
|
+
readonly idempotency: "none";
|
|
38
|
+
readonly authorization: "required";
|
|
39
|
+
};
|
|
40
|
+
/** Branch IDs for executeStatement. */
|
|
41
|
+
declare const ExecuteStatementBranch: {
|
|
42
|
+
readonly Submitted: "submitted";
|
|
43
|
+
readonly ProviderRejected: "providerRejected";
|
|
44
|
+
readonly InvalidResponse: "invalidResponse";
|
|
45
|
+
readonly Defect: "defect";
|
|
46
|
+
};
|
|
47
|
+
/** Redshift accepted the SQL statement. */
|
|
48
|
+
declare const ExecuteStatementBranchSubmitted: "submitted";
|
|
49
|
+
/** Redshift conclusively rejected the submission. */
|
|
50
|
+
declare const ExecuteStatementBranchProviderRejected: "providerRejected";
|
|
51
|
+
/** Redshift returned malformed or oversized submission JSON. */
|
|
52
|
+
declare const ExecuteStatementBranchInvalidResponse: "invalidResponse";
|
|
53
|
+
/** The workgroup or SQL input or connection settings are invalid. */
|
|
54
|
+
declare const ExecuteStatementBranchDefect: "defect";
|
|
55
|
+
/** Manifest definition for executeStatement. */
|
|
56
|
+
declare const ExecuteStatementDefinition: MutationDefinition;
|
|
57
|
+
/** Manifest metadata for executeStatement. */
|
|
58
|
+
declare const ExecuteStatementMetadata: {
|
|
59
|
+
readonly kind: "mutation";
|
|
60
|
+
readonly idempotency: "required";
|
|
61
|
+
readonly authorization: "required";
|
|
62
|
+
};
|
|
63
|
+
/** Branch IDs for describeStatement. */
|
|
64
|
+
declare const DescribeStatementBranch: {
|
|
65
|
+
readonly Described: "described";
|
|
66
|
+
readonly Missing: "missing";
|
|
67
|
+
readonly ProviderRejected: "providerRejected";
|
|
68
|
+
readonly InvalidResponse: "invalidResponse";
|
|
69
|
+
readonly Defect: "defect";
|
|
70
|
+
};
|
|
71
|
+
/** Redshift returned the statement status. */
|
|
72
|
+
declare const DescribeStatementBranchDescribed: "described";
|
|
73
|
+
/** Redshift does not retain the statement. */
|
|
74
|
+
declare const DescribeStatementBranchMissing: "missing";
|
|
75
|
+
/** Redshift conclusively rejected the lookup. */
|
|
76
|
+
declare const DescribeStatementBranchProviderRejected: "providerRejected";
|
|
77
|
+
/** Redshift returned malformed or oversized status JSON. */
|
|
78
|
+
declare const DescribeStatementBranchInvalidResponse: "invalidResponse";
|
|
79
|
+
/** The statement ID or connection settings are invalid. */
|
|
80
|
+
declare const DescribeStatementBranchDefect: "defect";
|
|
81
|
+
/** Manifest definition for describeStatement. */
|
|
82
|
+
declare const DescribeStatementDefinition: QueryDefinition;
|
|
83
|
+
/** Manifest metadata for describeStatement. */
|
|
84
|
+
declare const DescribeStatementMetadata: {
|
|
85
|
+
readonly kind: "query";
|
|
86
|
+
readonly idempotency: "none";
|
|
87
|
+
readonly authorization: "required";
|
|
88
|
+
};
|
|
89
|
+
/** Branch IDs for listStatements. */
|
|
90
|
+
declare const ListStatementsBranch: {
|
|
91
|
+
readonly Listed: "listed";
|
|
92
|
+
readonly ProviderRejected: "providerRejected";
|
|
93
|
+
readonly InvalidResponse: "invalidResponse";
|
|
94
|
+
readonly Defect: "defect";
|
|
95
|
+
};
|
|
96
|
+
/** Redshift returned a statement page. */
|
|
97
|
+
declare const ListStatementsBranchListed: "listed";
|
|
98
|
+
/** Redshift conclusively rejected the list request. */
|
|
99
|
+
declare const ListStatementsBranchProviderRejected: "providerRejected";
|
|
100
|
+
/** Redshift returned malformed or oversized list JSON. */
|
|
101
|
+
declare const ListStatementsBranchInvalidResponse: "invalidResponse";
|
|
102
|
+
/** The page input or connection settings are invalid. */
|
|
103
|
+
declare const ListStatementsBranchDefect: "defect";
|
|
104
|
+
/** Manifest definition for listStatements. */
|
|
105
|
+
declare const ListStatementsDefinition: QueryDefinition;
|
|
106
|
+
/** Manifest metadata for listStatements. */
|
|
107
|
+
declare const ListStatementsMetadata: {
|
|
108
|
+
readonly kind: "query";
|
|
109
|
+
readonly idempotency: "none";
|
|
110
|
+
readonly authorization: "required";
|
|
111
|
+
};
|
|
112
|
+
/** Branch IDs for cancelStatement. */
|
|
113
|
+
declare const CancelStatementBranch: {
|
|
114
|
+
readonly Canceled: "canceled";
|
|
115
|
+
readonly NotCanceled: "notCanceled";
|
|
116
|
+
readonly Missing: "missing";
|
|
117
|
+
readonly ProviderRejected: "providerRejected";
|
|
118
|
+
readonly InvalidResponse: "invalidResponse";
|
|
119
|
+
readonly Defect: "defect";
|
|
120
|
+
};
|
|
121
|
+
/** Redshift accepted the cancellation. */
|
|
122
|
+
declare const CancelStatementBranchCanceled: "canceled";
|
|
123
|
+
/** The statement was not running or could not be canceled. */
|
|
124
|
+
declare const CancelStatementBranchNotCanceled: "notCanceled";
|
|
125
|
+
/** Redshift does not retain the statement. */
|
|
126
|
+
declare const CancelStatementBranchMissing: "missing";
|
|
127
|
+
/** Redshift conclusively rejected the cancellation. */
|
|
128
|
+
declare const CancelStatementBranchProviderRejected: "providerRejected";
|
|
129
|
+
/** Redshift returned malformed or oversized cancellation JSON. */
|
|
130
|
+
declare const CancelStatementBranchInvalidResponse: "invalidResponse";
|
|
131
|
+
/** The statement ID or connection settings are invalid. */
|
|
132
|
+
declare const CancelStatementBranchDefect: "defect";
|
|
133
|
+
/** Manifest definition for cancelStatement. */
|
|
134
|
+
declare const CancelStatementDefinition: MutationDefinition;
|
|
135
|
+
/** Manifest metadata for cancelStatement. */
|
|
136
|
+
declare const CancelStatementMetadata: {
|
|
137
|
+
readonly kind: "mutation";
|
|
138
|
+
readonly idempotency: "required";
|
|
139
|
+
readonly authorization: "required";
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** Configuration for the getStatementResult connector Step. */
|
|
143
|
+
interface GetStatementResultStepConfig<StepInput, OperationInput = GetStatementResultInput, OperationOutput = StatementResultPage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
144
|
+
/** Named connection supplying this operation. */
|
|
145
|
+
connection: Connection<{
|
|
146
|
+
getStatementResult(): Query<OperationInput, OperationOutput>;
|
|
147
|
+
}>;
|
|
148
|
+
/** Name matching the bound connection. */
|
|
149
|
+
connectionName: string;
|
|
150
|
+
/** Redshift returned the statement result page. */
|
|
151
|
+
fetched: StepTarget<QueryResult<OperationOutput>>;
|
|
152
|
+
/** Redshift does not retain the specified statement result. */
|
|
153
|
+
missing?: StepTarget<QueryResult<OperationOutput>>;
|
|
154
|
+
/** Redshift conclusively rejected the lookup or credentials. */
|
|
155
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
156
|
+
/** Redshift returned malformed or oversized result JSON. */
|
|
157
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
158
|
+
/** The statement ID, endpoint, Region, or credentials are invalid. */
|
|
159
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
160
|
+
}
|
|
161
|
+
/** Build the getStatementResult Step from a named connection. */
|
|
162
|
+
declare function newGetStatementResultStep<StepInput, OperationInput = GetStatementResultInput, OperationOutput = StatementResultPage>(configuration: GetStatementResultStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
163
|
+
/** Configuration for the executeStatement connector Step. */
|
|
164
|
+
interface ExecuteStatementStepConfig<StepInput, OperationInput = ExecuteStatementInput, OperationOutput = StatementIdentity> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
165
|
+
/** Named connection supplying this operation. */
|
|
166
|
+
connection: Connection<{
|
|
167
|
+
executeStatement(): Mutation<OperationInput, OperationOutput>;
|
|
168
|
+
}>;
|
|
169
|
+
/** Name matching the bound connection. */
|
|
170
|
+
connectionName: string;
|
|
171
|
+
/** Redshift accepted the SQL statement. */
|
|
172
|
+
submitted: StepTarget<MutationResult<OperationOutput>>;
|
|
173
|
+
/** Redshift conclusively rejected the submission. */
|
|
174
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
175
|
+
/** Redshift returned malformed or oversized submission JSON. */
|
|
176
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
177
|
+
/** The workgroup or SQL input or connection settings are invalid. */
|
|
178
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
179
|
+
/** Accepted for compatibility; ignored because the operation is safe to repeat. */
|
|
180
|
+
maxSends?: number;
|
|
181
|
+
}
|
|
182
|
+
/** Build the executeStatement Step from a named connection. */
|
|
183
|
+
declare function newExecuteStatementStep<StepInput, OperationInput = ExecuteStatementInput, OperationOutput = StatementIdentity>(configuration: ExecuteStatementStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
184
|
+
/** Configuration for the describeStatement connector Step. */
|
|
185
|
+
interface DescribeStatementStepConfig<StepInput, OperationInput = DescribeStatementInput, OperationOutput = StatementStatus> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
186
|
+
/** Named connection supplying this operation. */
|
|
187
|
+
connection: Connection<{
|
|
188
|
+
describeStatement(): Query<OperationInput, OperationOutput>;
|
|
189
|
+
}>;
|
|
190
|
+
/** Name matching the bound connection. */
|
|
191
|
+
connectionName: string;
|
|
192
|
+
/** Redshift returned the statement status. */
|
|
193
|
+
described: StepTarget<QueryResult<OperationOutput>>;
|
|
194
|
+
/** Redshift does not retain the statement. */
|
|
195
|
+
missing?: StepTarget<QueryResult<OperationOutput>>;
|
|
196
|
+
/** Redshift conclusively rejected the lookup. */
|
|
197
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
198
|
+
/** Redshift returned malformed or oversized status JSON. */
|
|
199
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
200
|
+
/** The statement ID or connection settings are invalid. */
|
|
201
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
202
|
+
}
|
|
203
|
+
/** Build the describeStatement Step from a named connection. */
|
|
204
|
+
declare function newDescribeStatementStep<StepInput, OperationInput = DescribeStatementInput, OperationOutput = StatementStatus>(configuration: DescribeStatementStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
205
|
+
/** Configuration for the listStatements connector Step. */
|
|
206
|
+
interface ListStatementsStepConfig<StepInput, OperationInput = ListStatementsInput, OperationOutput = StatementPage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
207
|
+
/** Named connection supplying this operation. */
|
|
208
|
+
connection: Connection<{
|
|
209
|
+
listStatements(): Query<OperationInput, OperationOutput>;
|
|
210
|
+
}>;
|
|
211
|
+
/** Name matching the bound connection. */
|
|
212
|
+
connectionName: string;
|
|
213
|
+
/** Redshift returned a statement page. */
|
|
214
|
+
listed: StepTarget<QueryResult<OperationOutput>>;
|
|
215
|
+
/** Redshift conclusively rejected the list request. */
|
|
216
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
217
|
+
/** Redshift returned malformed or oversized list JSON. */
|
|
218
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
219
|
+
/** The page input or connection settings are invalid. */
|
|
220
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
221
|
+
}
|
|
222
|
+
/** Build the listStatements Step from a named connection. */
|
|
223
|
+
declare function newListStatementsStep<StepInput, OperationInput = ListStatementsInput, OperationOutput = StatementPage>(configuration: ListStatementsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
224
|
+
/** Configuration for the cancelStatement connector Step. */
|
|
225
|
+
interface CancelStatementStepConfig<StepInput, OperationInput = CancelStatementInput, OperationOutput = StatementCancellation> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
226
|
+
/** Named connection supplying this operation. */
|
|
227
|
+
connection: Connection<{
|
|
228
|
+
cancelStatement(): Mutation<OperationInput, OperationOutput>;
|
|
229
|
+
}>;
|
|
230
|
+
/** Name matching the bound connection. */
|
|
231
|
+
connectionName: string;
|
|
232
|
+
/** Redshift accepted the cancellation. */
|
|
233
|
+
canceled: StepTarget<MutationResult<OperationOutput>>;
|
|
234
|
+
/** The statement was not running or could not be canceled. */
|
|
235
|
+
notCanceled?: StepTarget<MutationResult<OperationOutput>>;
|
|
236
|
+
/** Redshift does not retain the statement. */
|
|
237
|
+
missing?: StepTarget<MutationResult<OperationOutput>>;
|
|
238
|
+
/** Redshift conclusively rejected the cancellation. */
|
|
239
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
240
|
+
/** Redshift returned malformed or oversized cancellation JSON. */
|
|
241
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
242
|
+
/** The statement ID or connection settings are invalid. */
|
|
243
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
244
|
+
/** Accepted for compatibility; ignored because the operation is safe to repeat. */
|
|
245
|
+
maxSends?: number;
|
|
246
|
+
}
|
|
247
|
+
/** Build the cancelStatement Step from a named connection. */
|
|
248
|
+
declare function newCancelStatementStep<StepInput, OperationInput = CancelStatementInput, OperationOutput = StatementCancellation>(configuration: CancelStatementStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
249
|
+
|
|
250
|
+
/** Open one named Amazon Redshift connection from Dex project configuration. */
|
|
251
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
|
|
252
|
+
|
|
253
|
+
/** Injectable transport and clock for tests and local applications. */
|
|
254
|
+
interface AmazonRedshiftClientOptions {
|
|
255
|
+
/** Provider sender; omitted uses the SDK transport. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
256
|
+
/** Signing clock; omitted uses the current time. */ now?: () => Date;
|
|
257
|
+
}
|
|
258
|
+
interface Exchange {
|
|
259
|
+
status: number;
|
|
260
|
+
body: Uint8Array;
|
|
261
|
+
retryAfterMs: number;
|
|
262
|
+
error?: 'credential' | 'request' | 'tooLarge' | 'interrupted';
|
|
263
|
+
}
|
|
264
|
+
/** Authenticated Redshift client for signed Data API requests. */
|
|
265
|
+
declare class AmazonRedshiftClient {
|
|
266
|
+
private readonly credentials;
|
|
267
|
+
private readonly endpoint;
|
|
268
|
+
private readonly region;
|
|
269
|
+
private readonly timeoutMs;
|
|
270
|
+
private readonly maxResponseBytes;
|
|
271
|
+
private readonly send;
|
|
272
|
+
private readonly now;
|
|
273
|
+
/** Validate the Region, endpoint, and limits without contacting AWS. */
|
|
274
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: AmazonRedshiftClientOptions);
|
|
275
|
+
/** Bind the getStatementResult Query. */ getStatementResult(): GetStatementResultOperation;
|
|
276
|
+
/** Bind the idempotent submission Mutation. */
|
|
277
|
+
executeStatement(): ExecuteStatementOperation;
|
|
278
|
+
/** Bind the statement status Query. */
|
|
279
|
+
describeStatement(): DescribeStatementOperation;
|
|
280
|
+
/** Bind the bounded statement listing Query. */
|
|
281
|
+
listStatements(): ListStatementsOperation;
|
|
282
|
+
/** Bind the repeat-safe cancellation Mutation. */
|
|
283
|
+
cancelStatement(): CancelStatementOperation;
|
|
284
|
+
/** Sign and send one bounded GetStatementResult request. */
|
|
285
|
+
readStatementResult(call: Call, body: Buffer): Promise<Exchange>;
|
|
286
|
+
/** Sign and send one bounded Redshift Data API request. */
|
|
287
|
+
sendStatementRequest(call: Call, target: RedshiftAction, body: Buffer): Promise<Exchange>;
|
|
288
|
+
}
|
|
289
|
+
/** Fetch one cached SQL result page by statement UUID. */
|
|
290
|
+
declare class GetStatementResultOperation implements Query<GetStatementResultInput, StatementResultPage> {
|
|
291
|
+
private readonly client;
|
|
292
|
+
/** Bind the provider client. */ constructor(client: AmazonRedshiftClient);
|
|
293
|
+
/** Return the generated Query contract. */ definition(): QueryDefinition;
|
|
294
|
+
/** Classify provider outcomes consistently with the Go implementation. */
|
|
295
|
+
invoke(call: Call, input: GetStatementResultInput): Promise<QueryAttempt<StatementResultPage>>;
|
|
296
|
+
}
|
|
297
|
+
type RedshiftAction = 'GetStatementResult' | 'ExecuteStatement' | 'DescribeStatement' | 'ListStatements' | 'CancelStatement';
|
|
298
|
+
/** Submit SQL to one serverless workgroup with a stable provider token. */
|
|
299
|
+
declare class ExecuteStatementOperation implements Mutation<ExecuteStatementInput, StatementIdentity> {
|
|
300
|
+
private readonly client;
|
|
301
|
+
/** Bind the provider client. */
|
|
302
|
+
constructor(client: AmazonRedshiftClient);
|
|
303
|
+
/** Return the generated submission contract. */
|
|
304
|
+
definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
305
|
+
/** Use the stable Dex call ID to deduplicate submissions. */
|
|
306
|
+
idempotencyKey(callId: string): string;
|
|
307
|
+
/** Submit one statement and retry unknown outcomes with the same token. */
|
|
308
|
+
invoke(call: Call, input: ExecuteStatementInput): Promise<MutationAttempt<StatementIdentity>>;
|
|
309
|
+
}
|
|
310
|
+
/** Read one statement's status without returning its SQL. */
|
|
311
|
+
declare class DescribeStatementOperation implements Query<DescribeStatementInput, StatementStatus> {
|
|
312
|
+
private readonly client;
|
|
313
|
+
/** Bind the provider client. */
|
|
314
|
+
constructor(client: AmazonRedshiftClient);
|
|
315
|
+
/** Return the generated status query contract. */
|
|
316
|
+
definition(): QueryDefinition;
|
|
317
|
+
/** Validate the returned ID and status before returning the result. */
|
|
318
|
+
invoke(call: Call, input: DescribeStatementInput): Promise<QueryAttempt<StatementStatus>>;
|
|
319
|
+
}
|
|
320
|
+
/** Read a bounded list of recent statement IDs and statuses. */
|
|
321
|
+
declare class ListStatementsOperation implements Query<ListStatementsInput, StatementPage> {
|
|
322
|
+
private readonly client;
|
|
323
|
+
/** Bind the provider client. */
|
|
324
|
+
constructor(client: AmazonRedshiftClient);
|
|
325
|
+
/** Return the generated list query contract. */
|
|
326
|
+
definition(): QueryDefinition;
|
|
327
|
+
/** List one page with the requested limit and continuation. */
|
|
328
|
+
invoke(call: Call, input: ListStatementsInput): Promise<QueryAttempt<StatementPage>>;
|
|
329
|
+
}
|
|
330
|
+
/** Cancel one statement and confirm its status if cancellation was not acknowledged. */
|
|
331
|
+
declare class CancelStatementOperation implements Mutation<CancelStatementInput, StatementCancellation> {
|
|
332
|
+
private readonly client;
|
|
333
|
+
/** Bind the provider client. */
|
|
334
|
+
constructor(client: AmazonRedshiftClient);
|
|
335
|
+
/** Return the generated cancellation contract. */
|
|
336
|
+
definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
337
|
+
/** Identify one repeat-safe Dex cancellation call. */
|
|
338
|
+
idempotencyKey(callId: string): string;
|
|
339
|
+
/** Confirm cancellation or classify a statement that already finished or failed. */
|
|
340
|
+
invoke(call: Call, input: CancelStatementInput): Promise<MutationAttempt<StatementCancellation>>;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export { AmazonRedshiftClient, type AmazonRedshiftClientOptions, CancelStatementBranch, CancelStatementBranchCanceled, CancelStatementBranchDefect, CancelStatementBranchInvalidResponse, CancelStatementBranchMissing, CancelStatementBranchNotCanceled, CancelStatementBranchProviderRejected, CancelStatementDefinition, CancelStatementInput, CancelStatementMetadata, CancelStatementOperation, type CancelStatementStepConfig, Config, Connection, ConnectorID, Credentials, DescribeStatementBranch, DescribeStatementBranchDefect, DescribeStatementBranchDescribed, DescribeStatementBranchInvalidResponse, DescribeStatementBranchMissing, DescribeStatementBranchProviderRejected, DescribeStatementDefinition, DescribeStatementInput, DescribeStatementMetadata, DescribeStatementOperation, type DescribeStatementStepConfig, ExecuteStatementBranch, ExecuteStatementBranchDefect, ExecuteStatementBranchInvalidResponse, ExecuteStatementBranchProviderRejected, ExecuteStatementBranchSubmitted, ExecuteStatementDefinition, ExecuteStatementInput, ExecuteStatementMetadata, ExecuteStatementOperation, type ExecuteStatementStepConfig, GetStatementResultBranch, GetStatementResultBranchDefect, GetStatementResultBranchFetched, GetStatementResultBranchInvalidResponse, GetStatementResultBranchMissing, GetStatementResultBranchProviderRejected, GetStatementResultDefinition, GetStatementResultInput, GetStatementResultMetadata, GetStatementResultOperation, type GetStatementResultStepConfig, ListStatementsBranch, ListStatementsBranchDefect, ListStatementsBranchInvalidResponse, ListStatementsBranchListed, ListStatementsBranchProviderRejected, ListStatementsDefinition, ListStatementsInput, ListStatementsMetadata, ListStatementsOperation, type ListStatementsStepConfig, ProviderID, StatementCancellation, StatementIdentity, StatementPage, StatementResultPage, StatementStatus, newCancelStatementStep, newDescribeStatementStep, newExecuteStatementStep, newGetStatementResultStep, newListStatementsStep, newProjectConnection };
|