@superdurable/connector-amazon-ses 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 +1 -1
- package/dex-connector.json +955 -2
- package/dist/chunk-WYO3XI32.js +754 -0
- package/dist/connection-Z3og2ZYX.d.ts +519 -0
- package/dist/index.d.ts +832 -9
- package/dist/index.js +1247 -36
- package/dist/mock.d.ts +295 -3
- package/dist/mock.js +730 -3
- package/package.json +3 -3
- package/dist/chunk-6NP3EK7O.js +0 -111
- package/dist/connection-BEfEuNCI.d.ts +0 -73
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connector-amazon-ses",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Amazon SES connector for Dex TypeScript applications",
|
|
6
6
|
"repository": {
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"build": "tsup src/index.ts src/mock.ts --format esm --dts --clean",
|
|
37
37
|
"typecheck": "tsc --noEmit",
|
|
38
38
|
"lint": "eslint src test examples",
|
|
39
|
-
"test": "vitest run --exclude test/integration/**",
|
|
39
|
+
"test": "vitest run --exclude 'test/integration/**'",
|
|
40
40
|
"test:integration": "vitest run test/integration/*.integration.test.ts",
|
|
41
41
|
"example:worker": "tsx examples/identity-lookup/worker.ts",
|
|
42
42
|
"example:start": "tsx examples/identity-lookup/start.ts",
|
|
43
43
|
"check": "npm run typecheck && npm run lint && npm test && npm run build"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@superdurable/connectors-sdk": "0.
|
|
46
|
+
"@superdurable/connectors-sdk": "0.13.0",
|
|
47
47
|
"@superdurable/dex": ">=1.28.0",
|
|
48
48
|
"zod": "^4.1.0"
|
|
49
49
|
},
|
package/dist/chunk-6NP3EK7O.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// src/generated/models.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { SecretString } from "@superdurable/connectors-sdk";
|
|
4
|
-
var ConfigSchema = z.object({
|
|
5
|
-
"region": z.string().optional(),
|
|
6
|
-
"endpoint": z.string().optional(),
|
|
7
|
-
"timeoutMs": z.number().int().optional(),
|
|
8
|
-
"maxResponseBytes": z.number().int().optional()
|
|
9
|
-
});
|
|
10
|
-
function decodeCredentials(value) {
|
|
11
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
|
|
12
|
-
const fields = value;
|
|
13
|
-
const allowed = /* @__PURE__ */ new Set(["access_key_id", "secret_access_key", "session_token"]);
|
|
14
|
-
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
|
|
15
|
-
if (fields["access_key_id"] != null && !(typeof fields["access_key_id"] === "string")) throw new TypeError("credential access_key_id has an invalid type");
|
|
16
|
-
if (fields["secret_access_key"] != null && !(typeof fields["secret_access_key"] === "string")) throw new TypeError("credential secret_access_key has an invalid type");
|
|
17
|
-
if (fields["session_token"] != null && !(typeof fields["session_token"] === "string")) throw new TypeError("credential session_token has an invalid type");
|
|
18
|
-
const credentials = {};
|
|
19
|
-
if (!fields["access_key_id"]) throw new TypeError("credential access_key_id is required");
|
|
20
|
-
credentials.accessKeyId = new SecretString(fields["access_key_id"] ?? "");
|
|
21
|
-
if (!fields["secret_access_key"]) throw new TypeError("credential secret_access_key is required");
|
|
22
|
-
credentials.secretAccessKey = new SecretString(fields["secret_access_key"] ?? "");
|
|
23
|
-
credentials.sessionToken = new SecretString(fields["session_token"] ?? "");
|
|
24
|
-
return credentials;
|
|
25
|
-
}
|
|
26
|
-
var GetEmailIdentityInputSchema = z.strictObject({
|
|
27
|
-
"emailIdentity": z.string()
|
|
28
|
-
});
|
|
29
|
-
var EmailIdentityDetailsSchema = z.strictObject({
|
|
30
|
-
"name": z.string(),
|
|
31
|
-
"verificationStatus": z.string()
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// src/generated/definitions.ts
|
|
35
|
-
var ConnectorID = "amazon-ses";
|
|
36
|
-
var ProviderID = "amazon-ses";
|
|
37
|
-
var GetEmailIdentityBranch = {
|
|
38
|
-
Found: "found",
|
|
39
|
-
Missing: "missing",
|
|
40
|
-
ProviderRejected: "providerRejected",
|
|
41
|
-
InvalidResponse: "invalidResponse",
|
|
42
|
-
Defect: "defect"
|
|
43
|
-
};
|
|
44
|
-
var GetEmailIdentityBranchFound = GetEmailIdentityBranch.Found;
|
|
45
|
-
var GetEmailIdentityBranchMissing = GetEmailIdentityBranch.Missing;
|
|
46
|
-
var GetEmailIdentityBranchProviderRejected = GetEmailIdentityBranch.ProviderRejected;
|
|
47
|
-
var GetEmailIdentityBranchInvalidResponse = GetEmailIdentityBranch.InvalidResponse;
|
|
48
|
-
var GetEmailIdentityBranchDefect = GetEmailIdentityBranch.Defect;
|
|
49
|
-
var GetEmailIdentityDefinition = {
|
|
50
|
-
operation: { connectorId: ConnectorID, operationId: "getEmailIdentity" },
|
|
51
|
-
branches: [
|
|
52
|
-
{ id: "found", description: "AWS returned the identity verification status." },
|
|
53
|
-
{ id: "missing", description: "The identity does not exist in the selected Region.", optional: true },
|
|
54
|
-
{ id: "providerRejected", description: "AWS conclusively rejected the request or credentials.", optional: true },
|
|
55
|
-
{ id: "invalidResponse", description: "AWS returned malformed or oversized identity metadata.", optional: true },
|
|
56
|
-
{ id: "defect", description: "The identity, endpoint, Region, or credentials are invalid.", optional: true }
|
|
57
|
-
],
|
|
58
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
59
|
-
};
|
|
60
|
-
var GetEmailIdentityMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
61
|
-
|
|
62
|
-
// src/generated/connection.ts
|
|
63
|
-
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
64
|
-
var Connection = class {
|
|
65
|
-
/** Stable provider and connection name. */
|
|
66
|
-
reference;
|
|
67
|
-
/** Bound provider operations. */
|
|
68
|
-
operations;
|
|
69
|
-
/** Validate a reference and bind operations. */
|
|
70
|
-
constructor(reference, operations) {
|
|
71
|
-
this.reference = ConnectionRefSchema.parse(reference);
|
|
72
|
-
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
73
|
-
if (!operations) throw new TypeError("connector operations are required");
|
|
74
|
-
this.operations = operations;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
function newConnection(client, reference) {
|
|
78
|
-
if (!client) throw new TypeError("connector client is required");
|
|
79
|
-
return new Connection(reference, client);
|
|
80
|
-
}
|
|
81
|
-
function newConnectionWithOperations(operations, reference) {
|
|
82
|
-
return new Connection(reference, operations);
|
|
83
|
-
}
|
|
84
|
-
function newProjectConnection(project, connectionName, createClient) {
|
|
85
|
-
if (!project) throw new TypeError("loaded project is required");
|
|
86
|
-
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
87
|
-
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
88
|
-
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
89
|
-
return newConnection(createClient(project, connectionName), reference);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export {
|
|
93
|
-
ConfigSchema,
|
|
94
|
-
decodeCredentials,
|
|
95
|
-
GetEmailIdentityInputSchema,
|
|
96
|
-
EmailIdentityDetailsSchema,
|
|
97
|
-
ConnectorID,
|
|
98
|
-
ProviderID,
|
|
99
|
-
GetEmailIdentityBranch,
|
|
100
|
-
GetEmailIdentityBranchFound,
|
|
101
|
-
GetEmailIdentityBranchMissing,
|
|
102
|
-
GetEmailIdentityBranchProviderRejected,
|
|
103
|
-
GetEmailIdentityBranchInvalidResponse,
|
|
104
|
-
GetEmailIdentityBranchDefect,
|
|
105
|
-
GetEmailIdentityDefinition,
|
|
106
|
-
GetEmailIdentityMetadata,
|
|
107
|
-
Connection,
|
|
108
|
-
newConnection,
|
|
109
|
-
newConnectionWithOperations,
|
|
110
|
-
newProjectConnection
|
|
111
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { SecretString, CredentialProvider, Query, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
-
interface Config {
|
|
6
|
-
/** AWS Region code for the email identity, such as eu-west-1. In https://console.aws.amazon.com/ses > Verified identities, use the Region selector; blank uses the displayed default. */
|
|
7
|
-
region?: string;
|
|
8
|
-
/** Optional SES-compatible API root. Blank derives the regional AWS endpoint from region. Override only for a trusted compatible endpoint; local tests may use loopback HTTP. */
|
|
9
|
-
endpoint?: string;
|
|
10
|
-
/** Maximum duration of one GetEmailIdentity 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 identity metadata response in bytes. Blank uses the displayed default; increase only for unusually large responses. */
|
|
13
|
-
maxResponseBytes?: number;
|
|
14
|
-
}
|
|
15
|
-
/** Runtime schema for manifest configuration. */
|
|
16
|
-
declare const ConfigSchema: z.ZodObject<{
|
|
17
|
-
region: z.ZodOptional<z.ZodString>;
|
|
18
|
-
endpoint: z.ZodOptional<z.ZodString>;
|
|
19
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
20
|
-
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
/** Private connector credentials resolved by the host. */
|
|
23
|
-
interface Credentials {
|
|
24
|
-
/** Secret-stored AWS access key ID from https://console.aws.amazon.com/iam > Users > selected user > Security credentials > Access keys > Create access key. Long-term IDs start AKIA and temporary IDs start ASIA. Blank prevents signing. */
|
|
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
|
-
/** Decode private credential fields for the connector. */
|
|
32
|
-
declare function decodeCredentials(value: unknown): Credentials;
|
|
33
|
-
/** Host-owned source of private connector credentials. */
|
|
34
|
-
type CredentialSource = CredentialProvider<Credentials>;
|
|
35
|
-
/** GetEmailIdentityInput identifies one SES email identity in the configured Region. */
|
|
36
|
-
interface GetEmailIdentityInput {
|
|
37
|
-
"emailIdentity": string;
|
|
38
|
-
}
|
|
39
|
-
/** EmailIdentityDetails returns the name and verification status of an SES email identity. */
|
|
40
|
-
interface EmailIdentityDetails {
|
|
41
|
-
"name": string;
|
|
42
|
-
"verificationStatus": string;
|
|
43
|
-
}
|
|
44
|
-
/** Runtime validator for GetEmailIdentityInput. */
|
|
45
|
-
declare const GetEmailIdentityInputSchema: z.ZodObject<{
|
|
46
|
-
emailIdentity: z.ZodString;
|
|
47
|
-
}, z.core.$strict>;
|
|
48
|
-
/** Runtime validator for EmailIdentityDetails. */
|
|
49
|
-
declare const EmailIdentityDetailsSchema: z.ZodObject<{
|
|
50
|
-
name: z.ZodString;
|
|
51
|
-
verificationStatus: z.ZodString;
|
|
52
|
-
}, z.core.$strict>;
|
|
53
|
-
|
|
54
|
-
/** Typed operations supplied by a client or mock. */
|
|
55
|
-
interface Operations {
|
|
56
|
-
/** Invoke getEmailIdentity through this connection. */
|
|
57
|
-
getEmailIdentity(): Query<GetEmailIdentityInput, EmailIdentityDetails>;
|
|
58
|
-
}
|
|
59
|
-
/** Named connector connection kept outside Flow state. */
|
|
60
|
-
declare class Connection<BoundOperations = Operations> {
|
|
61
|
-
/** Stable provider and connection name. */
|
|
62
|
-
readonly reference: ConnectionRef;
|
|
63
|
-
/** Bound provider operations. */
|
|
64
|
-
readonly operations: BoundOperations;
|
|
65
|
-
/** Validate a reference and bind operations. */
|
|
66
|
-
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
67
|
-
}
|
|
68
|
-
/** Bind a client to a named connection. */
|
|
69
|
-
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
70
|
-
/** Bind scripted operations to a named connection. */
|
|
71
|
-
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
72
|
-
|
|
73
|
-
export { Connection as C, type EmailIdentityDetails as E, type GetEmailIdentityInput as G, type Operations as O, type Config as a, type Credentials as b, ConfigSchema as c, type CredentialSource as d, EmailIdentityDetailsSchema as e, GetEmailIdentityInputSchema as f, decodeCredentials as g, newConnectionWithOperations as h, newConnection as n };
|