@ontemper/sdk 0.7.1-postgresql.2 → 0.7.1-postgresql.3
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 +46 -2
- package/dist/As2Resource.d.ts +431 -76
- package/dist/As2Resource.d.ts.map +1 -1
- package/dist/As2Resource.js +31 -30
- package/dist/As2Resource.js.map +1 -1
- package/dist/As2Transport.d.ts.map +1 -1
- package/dist/As2Transport.js +3 -1
- package/dist/As2Transport.js.map +1 -1
- package/dist/As2Wire.d.ts +39 -0
- package/dist/As2Wire.d.ts.map +1 -1
- package/dist/DatabaseTunnelAuthorization.d.ts +11 -0
- package/dist/DatabaseTunnelAuthorization.d.ts.map +1 -0
- package/dist/DatabaseTunnelAuthorization.js +35 -0
- package/dist/DatabaseTunnelAuthorization.js.map +1 -0
- package/dist/ExpiringMap.d.ts +21 -0
- package/dist/ExpiringMap.d.ts.map +1 -0
- package/dist/ExpiringMap.js +79 -0
- package/dist/ExpiringMap.js.map +1 -0
- package/dist/HttpApiResource.d.ts +2904 -177
- package/dist/HttpApiResource.d.ts.map +1 -1
- package/dist/HttpApiResource.js +81 -59
- package/dist/HttpApiResource.js.map +1 -1
- package/dist/Kafka.d.ts +89 -0
- package/dist/Kafka.d.ts.map +1 -0
- package/dist/Kafka.js +297 -0
- package/dist/Kafka.js.map +1 -0
- package/dist/Manifest.d.ts +1 -1
- package/dist/Manifest.js +1 -1
- package/dist/PostgreSql.d.ts.map +1 -1
- package/dist/PostgreSql.js +2 -11
- package/dist/PostgreSql.js.map +1 -1
- package/dist/PostgreSqlPool.d.ts +1 -39
- package/dist/PostgreSqlPool.d.ts.map +1 -1
- package/dist/PostgreSqlPool.js +2 -22
- package/dist/PostgreSqlPool.js.map +1 -1
- package/dist/Redaction.d.ts +2 -0
- package/dist/Redaction.d.ts.map +1 -1
- package/dist/Redaction.js +16 -4
- package/dist/Redaction.js.map +1 -1
- package/dist/ResourceRecords.d.ts +1086 -0
- package/dist/ResourceRecords.d.ts.map +1 -0
- package/dist/ResourceRecords.js +303 -0
- package/dist/ResourceRecords.js.map +1 -0
- package/dist/Resources.d.ts +13 -3
- package/dist/Resources.d.ts.map +1 -1
- package/dist/Resources.js +11 -3
- package/dist/Resources.js.map +1 -1
- package/dist/ResourcesCache.d.ts +33 -0
- package/dist/ResourcesCache.d.ts.map +1 -0
- package/dist/ResourcesCache.js +205 -0
- package/dist/ResourcesCache.js.map +1 -0
- package/dist/ResourcesEnv.d.ts +81 -0
- package/dist/ResourcesEnv.d.ts.map +1 -0
- package/dist/ResourcesEnv.js +104 -0
- package/dist/ResourcesEnv.js.map +1 -0
- package/dist/ResourcesErrors.d.ts +5 -1
- package/dist/ResourcesErrors.d.ts.map +1 -1
- package/dist/ResourcesErrors.js +5 -2
- package/dist/ResourcesErrors.js.map +1 -1
- package/dist/ResourcesToken.d.ts +9 -0
- package/dist/ResourcesToken.d.ts.map +1 -1
- package/dist/ResourcesToken.js +20 -7
- package/dist/ResourcesToken.js.map +1 -1
- package/dist/RuntimeResources.d.ts +18 -3
- package/dist/RuntimeResources.d.ts.map +1 -1
- package/dist/RuntimeResources.js +53 -29
- package/dist/RuntimeResources.js.map +1 -1
- package/dist/TransportResource.d.ts +1 -32
- package/dist/TransportResource.d.ts.map +1 -1
- package/dist/TransportResource.js +1 -19
- package/dist/TransportResource.js.map +1 -1
- package/dist/Workflow.js +2 -2
- package/dist/Workflow.js.map +1 -1
- package/package.json +14 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpApiResource.d.ts","sourceRoot":"","sources":["../src/HttpApiResource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAwB,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"HttpApiResource.d.ts","sourceRoot":"","sources":["../src/HttpApiResource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAwB,MAAM,QAAQ,CAAC;AAIxE,2FAA2F;AAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAW1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC"}
|
package/dist/HttpApiResource.js
CHANGED
|
@@ -1,112 +1,130 @@
|
|
|
1
1
|
import { Effect, Redacted, Schema, SchemaTransformation } from 'effect';
|
|
2
2
|
// The `http_api` system type at catalog revision 2 (T-4256), as `@ontemper/resources` reads it (`records.ts`).
|
|
3
|
+
/** Extensions remain unknown plain values; only declared secret fields become Redacted. */
|
|
4
|
+
export const recordStruct = (fields) => {
|
|
5
|
+
const schema = Schema.Struct(fields);
|
|
6
|
+
const record = Schema.StructWithRest(schema, [Schema.Record(Schema.String, Schema.Unknown)]);
|
|
7
|
+
// Existing SDK consumers specialize records with Struct.fields/mapFields; keep those methods through rebuilds.
|
|
8
|
+
return Schema.make(record.ast, {
|
|
9
|
+
schema,
|
|
10
|
+
records: record.records,
|
|
11
|
+
fields: schema.fields,
|
|
12
|
+
mapFields: schema.mapFields,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
3
15
|
/** An `x-secret` field: the value arrives `Redacted`, so logging the record never prints it. */
|
|
4
16
|
const Secret = Schema.RedactedFromValue(Schema.String);
|
|
5
17
|
// A catalog `nonEmptySecret`: an empty credential cannot sign or authenticate, so it fails at decode.
|
|
6
18
|
const NonEmptySecret = Schema.RedactedFromValue(Schema.String.check(Schema.isMinLength(1)));
|
|
7
19
|
const NonEmptyString = Schema.String.check(Schema.isMinLength(1));
|
|
8
20
|
// Clients log request URLs verbatim, so userinfo in the authority would log a reusable credential.
|
|
9
|
-
const AbsoluteHttpUrl = Schema.String.check(
|
|
10
|
-
// Carried into the manifest's JSON Schema, so deploy rejects a non-http URL before a run does.
|
|
11
|
-
Schema.isPattern(/^[hH][tT][tT][pP][sS]?:\/\//u), Schema.makeFilter((url) => {
|
|
21
|
+
export const AbsoluteHttpUrl = Schema.String.check(Schema.makeFilter((url) => {
|
|
12
22
|
if (!URL.canParse(url))
|
|
13
23
|
return 'Expected an absolute http(s) URL';
|
|
14
24
|
const parsed = new URL(url);
|
|
15
25
|
if (!['http:', 'https:'].includes(parsed.protocol))
|
|
16
26
|
return 'Expected an absolute http(s) URL';
|
|
17
27
|
return (!parsed.username && !parsed.password) || 'Expected a URL without embedded credentials';
|
|
18
|
-
}
|
|
28
|
+
},
|
|
29
|
+
// Deploy rejects a non-http scheme; the scheme-only pattern keeps legacy-accepted forms such as `https:host`.
|
|
30
|
+
{ toJsonSchema: () => ({ pattern: '^[Hh][Tt][Tt][Pp][Ss]?:' }) }));
|
|
19
31
|
/** TLS trust and client-certificate material; certificate fields are PEM, and nothing disables verification. */
|
|
20
|
-
export const TlsSettings =
|
|
21
|
-
caCertificate: Schema.
|
|
22
|
-
clientCertificate: Schema.
|
|
23
|
-
clientKey: Schema.
|
|
24
|
-
clientKeyPassphrase: Schema.
|
|
25
|
-
serverName: Schema.
|
|
32
|
+
export const TlsSettings = recordStruct({
|
|
33
|
+
caCertificate: Schema.optional(Schema.String),
|
|
34
|
+
clientCertificate: Schema.optional(Schema.String),
|
|
35
|
+
clientKey: Schema.optional(Secret),
|
|
36
|
+
clientKeyPassphrase: Schema.optional(Secret),
|
|
37
|
+
serverName: Schema.optional(Schema.String),
|
|
26
38
|
}).check(
|
|
27
39
|
// tls.connect needs both halves for client authentication; one half fails the handshake on every connect.
|
|
28
|
-
Schema.makeFilter(({ clientCertificate, clientKey }) => (clientCertificate === undefined) === (clientKey === undefined) ||
|
|
29
|
-
'
|
|
30
|
-
clientKey
|
|
31
|
-
|
|
40
|
+
Schema.makeFilter(({ clientCertificate, clientKey }) => (clientCertificate === undefined) === (clientKey === undefined) || {
|
|
41
|
+
path: ['clientCertificate'],
|
|
42
|
+
issue: 'Expected clientCertificate and clientKey together or neither',
|
|
43
|
+
}), Schema.makeFilter(({ clientKey, clientKeyPassphrase }) => clientKeyPassphrase === undefined ||
|
|
44
|
+
clientKey !== undefined || {
|
|
45
|
+
path: ['clientKeyPassphrase'],
|
|
46
|
+
issue: 'Expected clientKeyPassphrase only with clientKey',
|
|
47
|
+
}));
|
|
48
|
+
// Shared by proxy authentication and AS2 partner endpoint authentication.
|
|
49
|
+
export const HttpBasicOrNoneAuth = Schema.Union([
|
|
50
|
+
recordStruct({ type: Schema.Literal('none') }),
|
|
51
|
+
recordStruct({ type: Schema.Literal('basic'), username: Schema.String, password: Secret }),
|
|
52
|
+
]).pipe(Schema.withDecodingDefault(Effect.succeed({ type: 'none' })));
|
|
32
53
|
/** An outbound HTTP CONNECT proxy: URL, optional Basic credentials, and optional TLS to the proxy. */
|
|
33
|
-
export const HttpProxy =
|
|
54
|
+
export const HttpProxy = recordStruct({
|
|
34
55
|
url: AbsoluteHttpUrl,
|
|
35
|
-
auth:
|
|
36
|
-
|
|
37
|
-
Schema.Struct({ type: Schema.Literal('basic'), username: Schema.String, password: Secret }),
|
|
38
|
-
]).pipe(Schema.withDecodingDefaultKey(Effect.succeed({ type: 'none' }))),
|
|
39
|
-
tls: Schema.optionalKey(TlsSettings),
|
|
56
|
+
auth: HttpBasicOrNoneAuth,
|
|
57
|
+
tls: Schema.optional(TlsSettings),
|
|
40
58
|
});
|
|
41
59
|
// Closed: the type decides which identity signs, and a guess could fall back to the runtime's own identity.
|
|
42
60
|
export const AwsAuth = Schema.Union([
|
|
43
|
-
|
|
61
|
+
recordStruct({
|
|
44
62
|
type: Schema.Literal('access_key'),
|
|
45
63
|
accessKeyId: NonEmptyString,
|
|
46
64
|
secretAccessKey: NonEmptySecret,
|
|
47
|
-
sessionToken: Schema.
|
|
65
|
+
sessionToken: Schema.optional(NonEmptySecret),
|
|
48
66
|
}),
|
|
49
|
-
|
|
67
|
+
recordStruct({
|
|
50
68
|
type: Schema.Literal('assume_role'),
|
|
51
69
|
roleArn: NonEmptyString,
|
|
52
|
-
externalId: Schema.
|
|
70
|
+
externalId: Schema.optional(Schema.String),
|
|
53
71
|
}),
|
|
54
|
-
|
|
72
|
+
recordStruct({ type: Schema.Literal('ambient') }),
|
|
55
73
|
]);
|
|
56
|
-
const JwtAlgorithm = Schema.Literals(['RS256', 'PS256', 'ES256']).pipe(Schema.
|
|
74
|
+
const JwtAlgorithm = Schema.Literals(['RS256', 'PS256', 'ES256']).pipe(Schema.withDecodingDefault(Effect.succeed('RS256')));
|
|
57
75
|
// Closed: the type decides where the client secret travels.
|
|
58
76
|
const OAuthClientAuthentication = Schema.Union([
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
77
|
+
recordStruct({ type: Schema.Literal('none') }),
|
|
78
|
+
recordStruct({ type: Schema.Literal('basic'), clientSecret: NonEmptySecret }),
|
|
79
|
+
recordStruct({ type: Schema.Literal('body'), clientSecret: NonEmptySecret }),
|
|
80
|
+
recordStruct({ type: Schema.Literal('query'), clientSecret: NonEmptySecret }),
|
|
81
|
+
recordStruct({
|
|
64
82
|
type: Schema.Literal('private_key_jwt'),
|
|
65
83
|
privateKey: NonEmptySecret,
|
|
66
|
-
keyId: Schema.
|
|
84
|
+
keyId: Schema.optional(Schema.String),
|
|
67
85
|
algorithm: JwtAlgorithm,
|
|
68
86
|
}),
|
|
69
87
|
]);
|
|
70
88
|
/** An OAuth 2.0 token request: endpoint, client, and how the client authenticates. */
|
|
71
|
-
export const OAuthTokenRequest =
|
|
89
|
+
export const OAuthTokenRequest = recordStruct({
|
|
72
90
|
tokenUrl: AbsoluteHttpUrl,
|
|
73
91
|
clientId: Schema.String,
|
|
74
92
|
clientAuthentication: OAuthClientAuthentication,
|
|
75
|
-
scope: Schema.
|
|
76
|
-
audience: Schema.
|
|
77
|
-
extraParams: Schema.
|
|
78
|
-
tokenRequestFormat: Schema.Literals(['form', 'json']).pipe(Schema.
|
|
93
|
+
scope: Schema.optional(Schema.String),
|
|
94
|
+
audience: Schema.optional(Schema.String),
|
|
95
|
+
extraParams: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
96
|
+
tokenRequestFormat: Schema.Literals(['form', 'json']).pipe(Schema.withDecodingDefault(Effect.succeed('form'))),
|
|
79
97
|
});
|
|
80
98
|
const knownAuth = [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
recordStruct({ type: Schema.Literal('none') }),
|
|
100
|
+
recordStruct({ type: Schema.Literal('basic'), username: Schema.String, password: Secret }),
|
|
101
|
+
recordStruct({ type: Schema.Literal('bearer'), token: Secret }),
|
|
102
|
+
recordStruct({
|
|
85
103
|
type: Schema.Literal('api_key'),
|
|
86
104
|
apiKey: Secret,
|
|
87
105
|
// Closed: the placement decides where the key travels.
|
|
88
|
-
placement: Schema.Literals(['authorization_bearer', 'header', 'query']).pipe(Schema.
|
|
89
|
-
name: NonEmptyString.pipe(Schema.
|
|
106
|
+
placement: Schema.Literals(['authorization_bearer', 'header', 'query']).pipe(Schema.withDecodingDefault(Effect.succeed('header'))),
|
|
107
|
+
name: NonEmptyString.pipe(Schema.withDecodingDefault(Effect.succeed('x-api-key'))),
|
|
90
108
|
}),
|
|
91
|
-
|
|
92
|
-
|
|
109
|
+
recordStruct({ type: Schema.Literal('oauth2_client_credentials'), tokenRequest: OAuthTokenRequest }),
|
|
110
|
+
recordStruct({
|
|
93
111
|
type: Schema.Literal('oauth2_password'),
|
|
94
112
|
tokenRequest: OAuthTokenRequest,
|
|
95
113
|
username: Schema.String,
|
|
96
114
|
password: Secret,
|
|
97
115
|
}),
|
|
98
|
-
|
|
116
|
+
recordStruct({
|
|
99
117
|
type: Schema.Literal('oauth2_jwt_bearer'),
|
|
100
118
|
tokenUrl: AbsoluteHttpUrl,
|
|
101
119
|
issuer: Schema.String,
|
|
102
120
|
subject: Schema.String,
|
|
103
121
|
audience: Schema.String,
|
|
104
122
|
privateKey: NonEmptySecret,
|
|
105
|
-
keyId: Schema.
|
|
123
|
+
keyId: Schema.optional(Schema.String),
|
|
106
124
|
algorithm: JwtAlgorithm,
|
|
107
|
-
scope: Schema.
|
|
125
|
+
scope: Schema.optional(Schema.String),
|
|
108
126
|
}),
|
|
109
|
-
|
|
127
|
+
recordStruct({
|
|
110
128
|
type: Schema.Literal('oauth1_tba'),
|
|
111
129
|
realm: Schema.String,
|
|
112
130
|
consumerKey: Schema.String,
|
|
@@ -114,9 +132,9 @@ const knownAuth = [
|
|
|
114
132
|
tokenId: Schema.String,
|
|
115
133
|
tokenSecret: NonEmptySecret,
|
|
116
134
|
}),
|
|
117
|
-
|
|
135
|
+
recordStruct({ type: Schema.Literal('aws_sigv4'), region: Schema.String, service: Schema.String, awsAuth: AwsAuth }),
|
|
118
136
|
];
|
|
119
|
-
const knownAuthTypes = new Set(knownAuth.map((member) => member.fields.type.literal));
|
|
137
|
+
const knownAuthTypes = new Set(knownAuth.map((member) => member.schema.fields.type.literal));
|
|
120
138
|
/**
|
|
121
139
|
* An `auth` variant a newer platform added, unvalidated: `variant` holds its `type`, and `fields` the auth object
|
|
122
140
|
* as it arrived, `type` included. `fields` is `Redacted` because the SDK cannot tell which of its fields are secret.
|
|
@@ -139,17 +157,21 @@ const UnknownAuth = Schema.StructWithRest(Schema.Struct({
|
|
|
139
157
|
}),
|
|
140
158
|
encode: ({ variant, fields }) => ({ ...Redacted.value(fields), type: variant }),
|
|
141
159
|
})));
|
|
160
|
+
const AuthVariants = Schema.Union([...knownAuth, UnknownAuth]);
|
|
142
161
|
/** The `auth` of an `http_api` record: one known variant, or `unsupported` for a variant a newer platform added. */
|
|
143
|
-
export const HttpApiAuth = Schema.
|
|
162
|
+
export const HttpApiAuth = Schema.toEncoded(AuthVariants)
|
|
163
|
+
// Legacy validates every raw auth field as JSON before parsing its variant, including unknown extension fields.
|
|
164
|
+
.check(Schema.makeFilter(Schema.is(Schema.JsonObject), { expected: 'JSON auth fields' }))
|
|
165
|
+
.pipe(Schema.decodeTo(AuthVariants));
|
|
144
166
|
/** The resolved value of the `http_api` system type, with the defaults its schema declares. */
|
|
145
|
-
export const HttpApiResource =
|
|
167
|
+
export const HttpApiResource = recordStruct({
|
|
146
168
|
// Requests join paths onto `baseUrl` as strings, so a query or fragment in the base corrupts every call.
|
|
147
169
|
baseUrl: AbsoluteHttpUrl.check(Schema.makeFilter((url) => !/[?#]/.test(url) || 'Expected a base URL without a query string or fragment')),
|
|
148
|
-
headers: Schema.Record(Schema.String, Schema.String).pipe(Schema.
|
|
149
|
-
auth: HttpApiAuth.pipe(Schema.
|
|
150
|
-
tls: Schema.
|
|
151
|
-
proxy: Schema.
|
|
152
|
-
tenantKey: Schema.
|
|
153
|
-
secondaryTenantKey: Schema.
|
|
170
|
+
headers: Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefault(Effect.succeed({}))),
|
|
171
|
+
auth: HttpApiAuth.pipe(Schema.withDecodingDefault(Effect.succeed({ type: 'none' }))),
|
|
172
|
+
tls: Schema.optional(TlsSettings),
|
|
173
|
+
proxy: Schema.optional(HttpProxy),
|
|
174
|
+
tenantKey: Schema.optional(Secret),
|
|
175
|
+
secondaryTenantKey: Schema.optional(Secret),
|
|
154
176
|
});
|
|
155
177
|
//# sourceMappingURL=HttpApiResource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpApiResource.js","sourceRoot":"","sources":["../src/HttpApiResource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAExE,+GAA+G;AAE/G,gGAAgG;AAChG,MAAM,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACvD,sGAAsG;AACtG,MAAM,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5F,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAElE,mGAAmG;AACnG,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK
|
|
1
|
+
{"version":3,"file":"HttpApiResource.js","sourceRoot":"","sources":["../src/HttpApiResource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAExE,+GAA+G;AAE/G,2FAA2F;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAG,CAA4C,MAAc,EAAE,EAAE;IACxF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM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AAM,eAAe,GAAG,YAAY,CAAC;IAC1C,yGAAyG;IACzG,OAAO,EAAE,eAAe,CAAC,KAAK,CAC5B,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,wDAAwD,CAAC,CAC1G;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IACzG,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC,CAAC,CAAC;IAC7F,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAClC,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;CAC5C,CAAC,CAAC"}
|
package/dist/Kafka.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { KafkaResource } from './ResourceRecords.js';
|
|
2
|
+
export declare class OptionalKafkaDependencyError extends Error {
|
|
3
|
+
constructor(packageName: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class UnsupportedKafkaAuthError extends Error {
|
|
6
|
+
constructor(field: string);
|
|
7
|
+
}
|
|
8
|
+
type MskToken = {
|
|
9
|
+
token: string;
|
|
10
|
+
expiryTime: number;
|
|
11
|
+
};
|
|
12
|
+
type MskSigner = {
|
|
13
|
+
generateAuthToken(options: {
|
|
14
|
+
region: string;
|
|
15
|
+
}): Promise<MskToken>;
|
|
16
|
+
generateAuthTokenFromCredentialsProvider(options: {
|
|
17
|
+
region: string;
|
|
18
|
+
awsCredentialsProvider: () => Promise<{
|
|
19
|
+
accessKeyId: string;
|
|
20
|
+
secretAccessKey: string;
|
|
21
|
+
sessionToken?: string;
|
|
22
|
+
}>;
|
|
23
|
+
}): Promise<MskToken>;
|
|
24
|
+
};
|
|
25
|
+
type AwsCredentialsProvider = () => Promise<{
|
|
26
|
+
accessKeyId: string;
|
|
27
|
+
secretAccessKey: string;
|
|
28
|
+
sessionToken?: string;
|
|
29
|
+
expiration?: Date;
|
|
30
|
+
}>;
|
|
31
|
+
type CredentialProviders = {
|
|
32
|
+
fromTemporaryCredentials(options: {
|
|
33
|
+
params: {
|
|
34
|
+
RoleArn: string;
|
|
35
|
+
RoleSessionName: string;
|
|
36
|
+
ExternalId?: string;
|
|
37
|
+
};
|
|
38
|
+
clientConfig?: {
|
|
39
|
+
region: string;
|
|
40
|
+
};
|
|
41
|
+
}): AwsCredentialsProvider;
|
|
42
|
+
};
|
|
43
|
+
export interface KafkaConfigOptions {
|
|
44
|
+
readonly fetch?: typeof fetch;
|
|
45
|
+
readonly now?: () => number;
|
|
46
|
+
readonly loadMskSigner?: () => Promise<MskSigner>;
|
|
47
|
+
readonly loadCredentialProviders?: () => Promise<CredentialProviders>;
|
|
48
|
+
}
|
|
49
|
+
/** TLS options for `ssl`; structurally a subset of Node `tls.ConnectionOptions`. */
|
|
50
|
+
export interface KafkaClientTlsOptions {
|
|
51
|
+
ca?: string;
|
|
52
|
+
cert?: string;
|
|
53
|
+
key?: string;
|
|
54
|
+
passphrase?: string;
|
|
55
|
+
servername?: string;
|
|
56
|
+
}
|
|
57
|
+
/** SASL options for `sasl`; each variant is assignable to the matching KafkaJS `SASLOptions` variant. */
|
|
58
|
+
export type KafkaClientSasl = {
|
|
59
|
+
mechanism: 'plain';
|
|
60
|
+
username: string;
|
|
61
|
+
password: string;
|
|
62
|
+
} | {
|
|
63
|
+
mechanism: 'scram-sha-256';
|
|
64
|
+
username: string;
|
|
65
|
+
password: string;
|
|
66
|
+
} | {
|
|
67
|
+
mechanism: 'scram-sha-512';
|
|
68
|
+
username: string;
|
|
69
|
+
password: string;
|
|
70
|
+
} | {
|
|
71
|
+
mechanism: 'oauthbearer';
|
|
72
|
+
oauthBearerProvider: () => Promise<{
|
|
73
|
+
value: string;
|
|
74
|
+
}>;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The options `kafkaConfig` returns, assignable to KafkaJS `KafkaConfig`.
|
|
78
|
+
* SDK-owned, so the published declarations do not import `kafkajs` for consumers that do not install it.
|
|
79
|
+
*/
|
|
80
|
+
export interface KafkaClientConfig {
|
|
81
|
+
brokers: string[];
|
|
82
|
+
clientId?: string;
|
|
83
|
+
ssl?: boolean | KafkaClientTlsOptions;
|
|
84
|
+
sasl?: KafkaClientSasl;
|
|
85
|
+
}
|
|
86
|
+
/** Maps a resolved Kafka record to the options accepted by `new Kafka(...)`. */
|
|
87
|
+
export declare function kafkaConfig(resource: KafkaResource, options?: KafkaConfigOptions): KafkaClientConfig;
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=Kafka.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kafka.d.ts","sourceRoot":"","sources":["../src/Kafka.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,YAAY,WAAW,EAAE,MAAM,EAG9B;CACF;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,YAAY,KAAK,EAAE,MAAM,EAGxB;CACF;AAGD,KAAK,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AACtD,KAAK,SAAS,GAAG;IACf,iBAAiB,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CA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