@superdurable/connector-customerio 0.0.0-stage → 0.1.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 +2 -2
- package/dex-connector.json +60 -0
- package/dist/chunk-462ICFCP.js +101 -0
- package/dist/connection-WnPSA5jF.d.ts +69 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +220 -0
- package/dist/mock.d.ts +33 -0
- package/dist/mock.js +69 -0
- package/package.json +59 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Super Durable
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Customer.io TypeScript connector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Implements `getCustomersByEmail`, returning matching Customer.io profile IDs. Go-recorded conformance checks exact requests, branches, retries and outputs. Configure a secret App API private key using the [connection guide](../README.md). See the [runnable Dex Flow](examples/customer-lookup/README.md). Live provider authorization remains unverified.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectorId": "customerio",
|
|
3
|
+
"releaseTag": "connectors/customerio/go/v0.1.0",
|
|
4
|
+
"package": {
|
|
5
|
+
"ecosystem": "npm",
|
|
6
|
+
"name": "@superdurable/connector-customerio",
|
|
7
|
+
"version": "0.1.0"
|
|
8
|
+
},
|
|
9
|
+
"factories": [
|
|
10
|
+
{
|
|
11
|
+
"name": "newGetCustomersByEmailStep",
|
|
12
|
+
"kind": "query",
|
|
13
|
+
"operationId": "getCustomersByEmail",
|
|
14
|
+
"inputType": "GetCustomersByEmailInput",
|
|
15
|
+
"description": "Return Customer.io profile IDs matching one exact email address.",
|
|
16
|
+
"fields": {
|
|
17
|
+
"stepType": "stepType",
|
|
18
|
+
"annotations": "annotations",
|
|
19
|
+
"connectionName": "connectionName",
|
|
20
|
+
"resultAttribute": "resultAttribute"
|
|
21
|
+
},
|
|
22
|
+
"branches": [
|
|
23
|
+
{
|
|
24
|
+
"id": "found",
|
|
25
|
+
"field": "found",
|
|
26
|
+
"optional": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "providerRejected",
|
|
30
|
+
"field": "providerRejected",
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "invalidResponse",
|
|
35
|
+
"field": "invalidResponse",
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "defect",
|
|
40
|
+
"field": "defect",
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"inputSchema": {
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"description": "GetCustomersByEmailInput identifies an exact non-secret customer email address.",
|
|
47
|
+
"properties": {
|
|
48
|
+
"email": {
|
|
49
|
+
"description": "Email is the complete email address shown on the Customer.io People page.",
|
|
50
|
+
"type": "string"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"required": [
|
|
54
|
+
"email"
|
|
55
|
+
],
|
|
56
|
+
"type": "object"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// src/generated/models.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SecretString } from "@superdurable/connectors-sdk";
|
|
4
|
+
var ConfigSchema = z.object({
|
|
5
|
+
"baseUrl": z.string().optional(),
|
|
6
|
+
"timeoutMs": z.number().int().optional(),
|
|
7
|
+
"maxResponseBytes": z.number().int().optional()
|
|
8
|
+
});
|
|
9
|
+
function decodeCredentials(value) {
|
|
10
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
|
|
11
|
+
const fields = value;
|
|
12
|
+
const allowed = /* @__PURE__ */ new Set(["privateKey"]);
|
|
13
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
|
|
14
|
+
if (fields["privateKey"] != null && !(typeof fields["privateKey"] === "string")) throw new TypeError("credential privateKey has an invalid type");
|
|
15
|
+
const credentials = {};
|
|
16
|
+
if (!fields["privateKey"]) throw new TypeError("credential privateKey is required");
|
|
17
|
+
credentials.privateKey = new SecretString(fields["privateKey"] ?? "");
|
|
18
|
+
return credentials;
|
|
19
|
+
}
|
|
20
|
+
var GetCustomersByEmailInputSchema = z.strictObject({
|
|
21
|
+
"email": z.string()
|
|
22
|
+
});
|
|
23
|
+
var CustomerLookupPageSchema = z.strictObject({
|
|
24
|
+
"email": z.string(),
|
|
25
|
+
"customerIDs": z.array(z.string()).nullable()
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/generated/definitions.ts
|
|
29
|
+
var ConnectorID = "customerio";
|
|
30
|
+
var ProviderID = "customerio";
|
|
31
|
+
var GetCustomersByEmailBranch = {
|
|
32
|
+
Found: "found",
|
|
33
|
+
ProviderRejected: "providerRejected",
|
|
34
|
+
InvalidResponse: "invalidResponse",
|
|
35
|
+
Defect: "defect"
|
|
36
|
+
};
|
|
37
|
+
var GetCustomersByEmailBranchFound = GetCustomersByEmailBranch.Found;
|
|
38
|
+
var GetCustomersByEmailBranchProviderRejected = GetCustomersByEmailBranch.ProviderRejected;
|
|
39
|
+
var GetCustomersByEmailBranchInvalidResponse = GetCustomersByEmailBranch.InvalidResponse;
|
|
40
|
+
var GetCustomersByEmailBranchDefect = GetCustomersByEmailBranch.Defect;
|
|
41
|
+
var GetCustomersByEmailDefinition = {
|
|
42
|
+
operation: { connectorId: ConnectorID, operationId: "getCustomersByEmail" },
|
|
43
|
+
branches: [
|
|
44
|
+
{ id: "found", description: "Customer.io returned matching customer IDs, possibly empty." },
|
|
45
|
+
{ id: "providerRejected", description: "Customer.io conclusively rejected the lookup.", optional: true },
|
|
46
|
+
{ id: "invalidResponse", description: "Customer.io returned malformed or oversized JSON.", optional: true },
|
|
47
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
48
|
+
],
|
|
49
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
50
|
+
};
|
|
51
|
+
var GetCustomersByEmailMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
52
|
+
|
|
53
|
+
// src/generated/connection.ts
|
|
54
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
55
|
+
var Connection = class {
|
|
56
|
+
/** Stable provider and connection name. */
|
|
57
|
+
reference;
|
|
58
|
+
/** Bound provider operations. */
|
|
59
|
+
operations;
|
|
60
|
+
/** Validate a reference and bind operations. */
|
|
61
|
+
constructor(reference, operations) {
|
|
62
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
63
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
64
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
65
|
+
this.operations = operations;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function newConnection(client, reference) {
|
|
69
|
+
if (!client) throw new TypeError("connector client is required");
|
|
70
|
+
return new Connection(reference, client);
|
|
71
|
+
}
|
|
72
|
+
function newConnectionWithOperations(operations, reference) {
|
|
73
|
+
return new Connection(reference, operations);
|
|
74
|
+
}
|
|
75
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
76
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
77
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
78
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
79
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
80
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
ConfigSchema,
|
|
85
|
+
decodeCredentials,
|
|
86
|
+
GetCustomersByEmailInputSchema,
|
|
87
|
+
CustomerLookupPageSchema,
|
|
88
|
+
ConnectorID,
|
|
89
|
+
ProviderID,
|
|
90
|
+
GetCustomersByEmailBranch,
|
|
91
|
+
GetCustomersByEmailBranchFound,
|
|
92
|
+
GetCustomersByEmailBranchProviderRejected,
|
|
93
|
+
GetCustomersByEmailBranchInvalidResponse,
|
|
94
|
+
GetCustomersByEmailBranchDefect,
|
|
95
|
+
GetCustomersByEmailDefinition,
|
|
96
|
+
GetCustomersByEmailMetadata,
|
|
97
|
+
Connection,
|
|
98
|
+
newConnection,
|
|
99
|
+
newConnectionWithOperations,
|
|
100
|
+
newProjectConnection
|
|
101
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { CredentialProvider, SecretString, Query, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
+
interface Config {
|
|
6
|
+
/** Customer.io App API HTTPS root. Blank uses the displayed US-region default; override with https://api-eu.customer.io for an EU workspace. Do not include path, query, or credentials. */
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
/** Maximum duration of one customer lookup as a positive Go duration. Blank uses the displayed default; increase only for slow responses. Runtime value in milliseconds. */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
/** Maximum complete customer-lookup JSON response in bytes as a positive integer. Blank uses the displayed default; increase if an email has many matching profiles. */
|
|
11
|
+
maxResponseBytes?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Runtime schema for manifest configuration. */
|
|
14
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
15
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
16
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/** Private connector credentials resolved by the host. */
|
|
20
|
+
interface Credentials {
|
|
21
|
+
/** Secret App API private key from Customer.io > Settings > API Credentials > App API > Create API Key. Copy the complete sk_ key or existing App API key, not its label; blank prevents calls. Dex sends it only as a Bearer credential. */
|
|
22
|
+
privateKey: SecretString;
|
|
23
|
+
}
|
|
24
|
+
/** Decode private credential fields for the connector. */
|
|
25
|
+
declare function decodeCredentials(value: unknown): Credentials;
|
|
26
|
+
/** Host-owned source of private connector credentials. */
|
|
27
|
+
type CredentialSource = CredentialProvider<Credentials>;
|
|
28
|
+
/** GetCustomersByEmailInput identifies an exact non-secret customer email address. */
|
|
29
|
+
interface GetCustomersByEmailInput {
|
|
30
|
+
/** Email is the complete email address shown on the Customer.io People page. */
|
|
31
|
+
"email": string;
|
|
32
|
+
}
|
|
33
|
+
/** CustomerLookupPage contains Customer.io profile IDs matching an email. */
|
|
34
|
+
interface CustomerLookupPage {
|
|
35
|
+
/** Email is the address supplied to Customer.io. */
|
|
36
|
+
"email": string;
|
|
37
|
+
/** CustomerIDs are the matching cio_id values in provider order. */
|
|
38
|
+
"customerIDs": Array<string> | null;
|
|
39
|
+
}
|
|
40
|
+
/** Runtime validator for GetCustomersByEmailInput. */
|
|
41
|
+
declare const GetCustomersByEmailInputSchema: z.ZodObject<{
|
|
42
|
+
email: z.ZodString;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
/** Runtime validator for CustomerLookupPage. */
|
|
45
|
+
declare const CustomerLookupPageSchema: z.ZodObject<{
|
|
46
|
+
email: z.ZodString;
|
|
47
|
+
customerIDs: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
|
|
50
|
+
/** Typed operations supplied by a client or mock. */
|
|
51
|
+
interface Operations {
|
|
52
|
+
/** Invoke getCustomersByEmail through this connection. */
|
|
53
|
+
getCustomersByEmail(): Query<GetCustomersByEmailInput, CustomerLookupPage>;
|
|
54
|
+
}
|
|
55
|
+
/** Named connector connection kept outside Flow state. */
|
|
56
|
+
declare class Connection<BoundOperations = Operations> {
|
|
57
|
+
/** Stable provider and connection name. */
|
|
58
|
+
readonly reference: ConnectionRef;
|
|
59
|
+
/** Bound provider operations. */
|
|
60
|
+
readonly operations: BoundOperations;
|
|
61
|
+
/** Validate a reference and bind operations. */
|
|
62
|
+
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
63
|
+
}
|
|
64
|
+
/** Bind a client to a named connection. */
|
|
65
|
+
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
66
|
+
/** Bind scripted operations to a named connection. */
|
|
67
|
+
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
68
|
+
|
|
69
|
+
export { type CustomerLookupPage as C, type GetCustomersByEmailInput as G, type Operations as O, Connection as a, type Config as b, type Credentials as c, ConfigSchema as d, type CredentialSource as e, CustomerLookupPageSchema as f, GetCustomersByEmailInputSchema as g, decodeCredentials as h, newConnectionWithOperations as i, newConnection as n };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { G as GetCustomersByEmailInput, C as CustomerLookupPage, a as Connection, O as Operations, b as Config, c as Credentials } from './connection-WnPSA5jF.js';
|
|
2
|
+
export { d as ConfigSchema, e as CredentialSource, f as CustomerLookupPageSchema, g as GetCustomersByEmailInputSchema, h as decodeCredentials, n as newConnection, i as newConnectionWithOperations } from './connection-WnPSA5jF.js';
|
|
3
|
+
import { QueryDefinition, QueryStepConfig, Query, QueryResult, QueryStep, CredentialProvider, Call, QueryAttempt } from '@superdurable/connectors-sdk';
|
|
4
|
+
import { StepTarget } from '@superdurable/dex';
|
|
5
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
6
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
7
|
+
import 'zod';
|
|
8
|
+
|
|
9
|
+
/** Stable connector identity. */
|
|
10
|
+
declare const ConnectorID = "customerio";
|
|
11
|
+
/** Provider identity for named connections. */
|
|
12
|
+
declare const ProviderID = "customerio";
|
|
13
|
+
/** Branch IDs for getCustomersByEmail. */
|
|
14
|
+
declare const GetCustomersByEmailBranch: {
|
|
15
|
+
readonly Found: "found";
|
|
16
|
+
readonly ProviderRejected: "providerRejected";
|
|
17
|
+
readonly InvalidResponse: "invalidResponse";
|
|
18
|
+
readonly Defect: "defect";
|
|
19
|
+
};
|
|
20
|
+
/** Customer.io returned matching customer IDs, possibly empty. */
|
|
21
|
+
declare const GetCustomersByEmailBranchFound: "found";
|
|
22
|
+
/** Customer.io conclusively rejected the lookup. */
|
|
23
|
+
declare const GetCustomersByEmailBranchProviderRejected: "providerRejected";
|
|
24
|
+
/** Customer.io returned malformed or oversized JSON. */
|
|
25
|
+
declare const GetCustomersByEmailBranchInvalidResponse: "invalidResponse";
|
|
26
|
+
/** Local input or credentials are invalid. */
|
|
27
|
+
declare const GetCustomersByEmailBranchDefect: "defect";
|
|
28
|
+
/** Manifest definition for getCustomersByEmail. */
|
|
29
|
+
declare const GetCustomersByEmailDefinition: QueryDefinition;
|
|
30
|
+
/** Manifest metadata for getCustomersByEmail. */
|
|
31
|
+
declare const GetCustomersByEmailMetadata: {
|
|
32
|
+
readonly kind: "query";
|
|
33
|
+
readonly idempotency: "none";
|
|
34
|
+
readonly authorization: "required";
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Configuration for the getCustomersByEmail connector Step. */
|
|
38
|
+
interface GetCustomersByEmailStepConfig<StepInput, OperationInput = GetCustomersByEmailInput, OperationOutput = CustomerLookupPage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
39
|
+
/** Named connection supplying this operation. */
|
|
40
|
+
connection: Connection<{
|
|
41
|
+
getCustomersByEmail(): Query<OperationInput, OperationOutput>;
|
|
42
|
+
}>;
|
|
43
|
+
/** Name matching the bound connection. */
|
|
44
|
+
connectionName: string;
|
|
45
|
+
/** Customer.io returned matching customer IDs, possibly empty. */
|
|
46
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
47
|
+
/** Customer.io conclusively rejected the lookup. */
|
|
48
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
49
|
+
/** Customer.io returned malformed or oversized JSON. */
|
|
50
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
51
|
+
/** Local input or credentials are invalid. */
|
|
52
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
53
|
+
}
|
|
54
|
+
/** Build the getCustomersByEmail Step from a named connection. */
|
|
55
|
+
declare function newGetCustomersByEmailStep<StepInput, OperationInput = GetCustomersByEmailInput, OperationOutput = CustomerLookupPage>(configuration: GetCustomersByEmailStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
56
|
+
|
|
57
|
+
/** Open one named Customerio connection from Dex project configuration. */
|
|
58
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
|
|
59
|
+
|
|
60
|
+
/** Injectable provider sender for tests and local applications. */
|
|
61
|
+
interface CustomerioClientOptions {
|
|
62
|
+
/** Provider sender; omitted uses the SDK transport. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
63
|
+
}
|
|
64
|
+
interface Exchange {
|
|
65
|
+
status: number;
|
|
66
|
+
body: Uint8Array;
|
|
67
|
+
retryAfterMs: number;
|
|
68
|
+
error?: 'credential' | 'request' | 'tooLarge';
|
|
69
|
+
}
|
|
70
|
+
/** Authenticated Customer.io App API client for customer lookups. */
|
|
71
|
+
declare class CustomerioClient {
|
|
72
|
+
private readonly credentials;
|
|
73
|
+
private readonly baseURL;
|
|
74
|
+
private readonly timeoutMs;
|
|
75
|
+
private readonly maxResponseBytes;
|
|
76
|
+
private readonly send;
|
|
77
|
+
/** Validate provider configuration without contacting Customer.io. */
|
|
78
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: CustomerioClientOptions);
|
|
79
|
+
/** Bind the getCustomersByEmail Query. */ getCustomersByEmail(): GetCustomersByEmailOperation;
|
|
80
|
+
/** Resolve credentials and send one bounded customer lookup. */
|
|
81
|
+
get(call: Call, email: string): Promise<Exchange>;
|
|
82
|
+
}
|
|
83
|
+
/** Look up Customer.io profile IDs by exact email address. */
|
|
84
|
+
declare class GetCustomersByEmailOperation implements Query<GetCustomersByEmailInput, CustomerLookupPage> {
|
|
85
|
+
private readonly client;
|
|
86
|
+
/** Bind the provider client. */ constructor(client: CustomerioClient);
|
|
87
|
+
/** Return the generated Query definition. */ definition(): QueryDefinition;
|
|
88
|
+
/** Classify provider outcomes consistently with Go. */
|
|
89
|
+
invoke(call: Call, input: GetCustomersByEmailInput): Promise<QueryAttempt<CustomerLookupPage>>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { Config, Connection, ConnectorID, Credentials, CustomerLookupPage, CustomerioClient, type CustomerioClientOptions, GetCustomersByEmailBranch, GetCustomersByEmailBranchDefect, GetCustomersByEmailBranchFound, GetCustomersByEmailBranchInvalidResponse, GetCustomersByEmailBranchProviderRejected, GetCustomersByEmailDefinition, GetCustomersByEmailInput, GetCustomersByEmailMetadata, GetCustomersByEmailOperation, type GetCustomersByEmailStepConfig, ProviderID, newGetCustomersByEmailStep, newProjectConnection };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigSchema,
|
|
3
|
+
Connection,
|
|
4
|
+
ConnectorID,
|
|
5
|
+
CustomerLookupPageSchema,
|
|
6
|
+
GetCustomersByEmailBranch,
|
|
7
|
+
GetCustomersByEmailBranchDefect,
|
|
8
|
+
GetCustomersByEmailBranchFound,
|
|
9
|
+
GetCustomersByEmailBranchInvalidResponse,
|
|
10
|
+
GetCustomersByEmailBranchProviderRejected,
|
|
11
|
+
GetCustomersByEmailDefinition,
|
|
12
|
+
GetCustomersByEmailInputSchema,
|
|
13
|
+
GetCustomersByEmailMetadata,
|
|
14
|
+
ProviderID,
|
|
15
|
+
decodeCredentials,
|
|
16
|
+
newConnection,
|
|
17
|
+
newConnectionWithOperations,
|
|
18
|
+
newProjectConnection
|
|
19
|
+
} from "./chunk-462ICFCP.js";
|
|
20
|
+
|
|
21
|
+
// src/generated/steps.ts
|
|
22
|
+
import { goToBranch, newQueryStep } from "@superdurable/connectors-sdk";
|
|
23
|
+
function newGetCustomersByEmailStep(configuration) {
|
|
24
|
+
const { connection, connectionName, found, providerRejected, invalidResponse, defect, ...stepConfiguration } = configuration;
|
|
25
|
+
if (!connection || connection.reference.name !== connectionName) throw new TypeError("Step connection name differs from the bound connection");
|
|
26
|
+
return newQueryStep({ ...stepConfiguration, operation: connection.operations.getCustomersByEmail(), connection: connection.reference, branches: [
|
|
27
|
+
goToBranch("found", found),
|
|
28
|
+
...providerRejected ? [goToBranch("providerRejected", providerRejected)] : [],
|
|
29
|
+
...invalidResponse ? [goToBranch("invalidResponse", invalidResponse)] : [],
|
|
30
|
+
...defect ? [goToBranch("defect", defect)] : []
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/project.ts
|
|
35
|
+
import { SecretString as SecretString2 } from "@superdurable/connectors-sdk";
|
|
36
|
+
import { z } from "zod";
|
|
37
|
+
|
|
38
|
+
// src/client.ts
|
|
39
|
+
import { SecretString, newQueryBranch, newQueryRetry } from "@superdurable/connectors-sdk";
|
|
40
|
+
import { BodyTooLargeError, isHeaderSafeCredential, parseRetryAfter, sendProviderRequest, validateBaseURL } from "@superdurable/connectors-sdk/providerhttp";
|
|
41
|
+
var emptyCustomers = () => ({ email: "", customerIDs: [] });
|
|
42
|
+
var CustomerioClient = class {
|
|
43
|
+
/** Validate provider configuration without contacting Customer.io. */
|
|
44
|
+
constructor(config, credentials, options = {}) {
|
|
45
|
+
this.credentials = credentials;
|
|
46
|
+
if (!config || !credentials) throw new TypeError("Customer.io configuration and credentials are required");
|
|
47
|
+
this.baseURL = validateBaseURL(config.baseUrl ?? "https://api.customer.io").replace(/\/$/, "");
|
|
48
|
+
this.timeoutMs = config.timeoutMs ?? 15e3;
|
|
49
|
+
this.maxResponseBytes = config.maxResponseBytes ?? 1048576;
|
|
50
|
+
if (!Number.isSafeInteger(this.timeoutMs) || this.timeoutMs <= 0 || !Number.isSafeInteger(this.maxResponseBytes) || this.maxResponseBytes <= 0)
|
|
51
|
+
throw new TypeError("Customer.io request limits must be positive integers");
|
|
52
|
+
this.send = options.send ?? sendProviderRequest;
|
|
53
|
+
}
|
|
54
|
+
credentials;
|
|
55
|
+
baseURL;
|
|
56
|
+
timeoutMs;
|
|
57
|
+
maxResponseBytes;
|
|
58
|
+
send;
|
|
59
|
+
/** Bind the getCustomersByEmail Query. */
|
|
60
|
+
getCustomersByEmail() {
|
|
61
|
+
return new GetCustomersByEmailOperation(this);
|
|
62
|
+
}
|
|
63
|
+
/** Resolve credentials and send one bounded customer lookup. */
|
|
64
|
+
async get(call, email) {
|
|
65
|
+
let privateKey;
|
|
66
|
+
try {
|
|
67
|
+
const credentials = await this.credentials.resolve(call, call.context.cancellationSignal);
|
|
68
|
+
privateKey = credentials.privateKey instanceof SecretString ? credentials.privateKey.reveal() : "";
|
|
69
|
+
} catch {
|
|
70
|
+
return emptyExchange("credential");
|
|
71
|
+
}
|
|
72
|
+
if (!isHeaderSafeCredential(privateKey)) return emptyExchange("credential");
|
|
73
|
+
const url = new URL(`${this.baseURL}/v1/customers`);
|
|
74
|
+
url.searchParams.set("email", email);
|
|
75
|
+
const request = {
|
|
76
|
+
url: url.toString(),
|
|
77
|
+
method: "GET",
|
|
78
|
+
headers: { Accept: "application/json", Authorization: `Bearer ${privateKey}` },
|
|
79
|
+
maxResponseBytes: this.maxResponseBytes,
|
|
80
|
+
timeoutMs: this.timeoutMs,
|
|
81
|
+
addressPolicy: this.baseURL.startsWith("https://") ? "publicHTTPS" : "privateNetworkHTTP",
|
|
82
|
+
signal: call.context.cancellationSignal
|
|
83
|
+
};
|
|
84
|
+
let response;
|
|
85
|
+
let isTooLarge = false;
|
|
86
|
+
try {
|
|
87
|
+
response = await this.send(request);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
if (error instanceof BodyTooLargeError && error.status !== void 0) {
|
|
90
|
+
response = { status: error.status, headers: error.headers ?? {}, body: new Uint8Array() };
|
|
91
|
+
isTooLarge = true;
|
|
92
|
+
} else return emptyExchange("request");
|
|
93
|
+
}
|
|
94
|
+
const retryAfterMs = parseRetryAfter(header(response.headers, "retry-after"));
|
|
95
|
+
if (isTooLarge || response.body.length > this.maxResponseBytes)
|
|
96
|
+
return { status: response.status, body: new Uint8Array(), retryAfterMs, error: "tooLarge" };
|
|
97
|
+
return { status: response.status, body: response.body, retryAfterMs };
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var GetCustomersByEmailOperation = class {
|
|
101
|
+
/** Bind the provider client. */
|
|
102
|
+
constructor(client) {
|
|
103
|
+
this.client = client;
|
|
104
|
+
}
|
|
105
|
+
client;
|
|
106
|
+
/** Return the generated Query definition. */
|
|
107
|
+
definition() {
|
|
108
|
+
return GetCustomersByEmailDefinition;
|
|
109
|
+
}
|
|
110
|
+
/** Classify provider outcomes consistently with Go. */
|
|
111
|
+
async invoke(call, input) {
|
|
112
|
+
if (!isValidEmail(input?.email))
|
|
113
|
+
return terminal("defect", "VALIDATION", "email must be one valid address of at most 320 bytes");
|
|
114
|
+
const exchange = await this.client.get(call, input.email);
|
|
115
|
+
if (exchange.error === "credential") return terminal("defect", "AUTHENTICATION", "Customer.io credentials are unavailable or invalid");
|
|
116
|
+
if (exchange.error === "request") return retry("TRANSPORT", "Customer.io request failed");
|
|
117
|
+
if (exchange.status === 429) return retry("RATE_LIMIT", "Customer.io rate limited the request", exchange.retryAfterMs);
|
|
118
|
+
if (exchange.status === 408 || exchange.status >= 500) return retry("AVAILABILITY", "Customer.io is temporarily unavailable", exchange.retryAfterMs);
|
|
119
|
+
if (exchange.status !== 200) return terminal("providerRejected", "PROVIDER_REJECTION", `Customer.io rejected HTTP ${exchange.status}`);
|
|
120
|
+
if (exchange.error === "tooLarge") return terminal("invalidResponse", "RESPONSE_TOO_LARGE", "Customer.io response exceeded the configured limit");
|
|
121
|
+
const customers = decodeCustomers(exchange.body, input.email);
|
|
122
|
+
if (!customers) return terminal("invalidResponse", "PROTOCOL", "Customer.io returned invalid customer-lookup JSON");
|
|
123
|
+
return newQueryBranch("found", customers);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
function isValidEmail(value) {
|
|
127
|
+
return typeof value === "string" && value.length > 0 && value.trim() === value && new TextEncoder().encode(value).length <= 320 && /^[^\s@]+@[^\s@]+$/.test(value) && !/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF])/.test(value);
|
|
128
|
+
}
|
|
129
|
+
function emptyExchange(error) {
|
|
130
|
+
return { status: 0, body: new Uint8Array(), retryAfterMs: 0, error };
|
|
131
|
+
}
|
|
132
|
+
function failure(kind, message) {
|
|
133
|
+
return { provider: "customerio", operation: "getCustomersByEmail", kind, message };
|
|
134
|
+
}
|
|
135
|
+
function terminal(branch, kind, message) {
|
|
136
|
+
return newQueryBranch(branch, emptyCustomers(), {}, failure(kind, message));
|
|
137
|
+
}
|
|
138
|
+
function retry(kind, message, delay = 0) {
|
|
139
|
+
return newQueryRetry(failure(kind, message), delay);
|
|
140
|
+
}
|
|
141
|
+
function header(headers, name) {
|
|
142
|
+
const entry = Object.entries(headers).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];
|
|
143
|
+
return Array.isArray(entry) ? entry[0] ?? "" : entry ?? "";
|
|
144
|
+
}
|
|
145
|
+
function isObject(value) {
|
|
146
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
147
|
+
}
|
|
148
|
+
function decodeCustomers(body, email) {
|
|
149
|
+
let raw;
|
|
150
|
+
try {
|
|
151
|
+
raw = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(body));
|
|
152
|
+
} catch {
|
|
153
|
+
return void 0;
|
|
154
|
+
}
|
|
155
|
+
if (!isObject(raw) || !Array.isArray(raw.results)) return void 0;
|
|
156
|
+
const customerIDs = [];
|
|
157
|
+
for (const result of raw.results) {
|
|
158
|
+
if (!isObject(result) || typeof result.cio_id !== "string" || !result.cio_id) return void 0;
|
|
159
|
+
customerIDs.push(result.cio_id);
|
|
160
|
+
}
|
|
161
|
+
return { email, customerIDs };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// src/project.ts
|
|
165
|
+
function newProjectConnection2(project, connectionName) {
|
|
166
|
+
return newProjectConnection(project, connectionName, (loadedProject, name) => {
|
|
167
|
+
const selected = loadedProject.configuration.connections.find((entry) => entry.connectorId === "customerio" && entry.connectionName === name);
|
|
168
|
+
if (!selected) throw new TypeError("Customerio project connection is not configured");
|
|
169
|
+
const fields = z.strictObject({ baseUrl: z.string().optional(), timeout: z.union([z.string(), z.number().int()]).optional(), maxResponseBytes: z.number().int().optional() }).parse(selected.configuration);
|
|
170
|
+
const timeoutMs = typeof fields.timeout === "number" ? Math.ceil(fields.timeout / 1e6) : fields.timeout ? parseDurationMilliseconds(fields.timeout) : void 0;
|
|
171
|
+
const config = {
|
|
172
|
+
...fields.baseUrl ? { baseUrl: fields.baseUrl } : {},
|
|
173
|
+
...timeoutMs !== void 0 ? { timeoutMs } : {},
|
|
174
|
+
...fields.maxResponseBytes !== void 0 ? { maxResponseBytes: fields.maxResponseBytes } : {}
|
|
175
|
+
};
|
|
176
|
+
const credentials = {
|
|
177
|
+
async resolve(_call, signal) {
|
|
178
|
+
const privateFields = await loadedProject.resolveCredential("customerio", name, signal);
|
|
179
|
+
if (typeof privateFields.privateKey !== "string") throw new TypeError("Customerio credentials are unavailable");
|
|
180
|
+
return { privateKey: new SecretString2(privateFields.privateKey) };
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
return new CustomerioClient(config, credentials);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function parseDurationMilliseconds(value) {
|
|
187
|
+
let remaining = value;
|
|
188
|
+
let milliseconds = 0;
|
|
189
|
+
const units = { ns: 1e-6, us: 1e-3, "\xB5s": 1e-3, ms: 1, s: 1e3, m: 6e4, h: 36e5 };
|
|
190
|
+
while (remaining) {
|
|
191
|
+
const part = /^(\d+(?:\.\d+)?)(ns|us|µs|ms|s|m|h)/.exec(remaining);
|
|
192
|
+
if (!part) throw new TypeError("Customerio timeout must be a positive Go duration");
|
|
193
|
+
milliseconds += Number(part[1]) * (units[part[2] ?? ""] ?? NaN);
|
|
194
|
+
remaining = remaining.slice(part[0].length);
|
|
195
|
+
}
|
|
196
|
+
if (!Number.isSafeInteger(milliseconds) || milliseconds <= 0) throw new TypeError("Customerio timeout must resolve to positive whole milliseconds");
|
|
197
|
+
return milliseconds;
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
ConfigSchema,
|
|
201
|
+
Connection,
|
|
202
|
+
ConnectorID,
|
|
203
|
+
CustomerLookupPageSchema,
|
|
204
|
+
CustomerioClient,
|
|
205
|
+
GetCustomersByEmailBranch,
|
|
206
|
+
GetCustomersByEmailBranchDefect,
|
|
207
|
+
GetCustomersByEmailBranchFound,
|
|
208
|
+
GetCustomersByEmailBranchInvalidResponse,
|
|
209
|
+
GetCustomersByEmailBranchProviderRejected,
|
|
210
|
+
GetCustomersByEmailDefinition,
|
|
211
|
+
GetCustomersByEmailInputSchema,
|
|
212
|
+
GetCustomersByEmailMetadata,
|
|
213
|
+
GetCustomersByEmailOperation,
|
|
214
|
+
ProviderID,
|
|
215
|
+
decodeCredentials,
|
|
216
|
+
newConnection,
|
|
217
|
+
newConnectionWithOperations,
|
|
218
|
+
newGetCustomersByEmailStep,
|
|
219
|
+
newProjectConnection2 as newProjectConnection
|
|
220
|
+
};
|
package/dist/mock.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MockQuery, Case } from '@superdurable/connectors-sdk/connectormock';
|
|
2
|
+
import { Failure } from '@superdurable/connectors-sdk';
|
|
3
|
+
import { O as Operations, a as Connection, G as GetCustomersByEmailInput, C as CustomerLookupPage } from './connection-WnPSA5jF.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/** Go zero value for GetCustomersByEmailInput in scripted cases. */
|
|
7
|
+
declare const emptyGetCustomersByEmailInput: GetCustomersByEmailInput;
|
|
8
|
+
/** Go zero value for CustomerLookupPage in scripted cases. */
|
|
9
|
+
declare const emptyCustomerLookupPage: CustomerLookupPage;
|
|
10
|
+
/** Script the found branch. */
|
|
11
|
+
declare function getCustomersByEmailFound(value: CustomerLookupPage, failure?: Failure): Case<CustomerLookupPage>;
|
|
12
|
+
/** Script the providerRejected branch. */
|
|
13
|
+
declare function getCustomersByEmailProviderRejected(value: CustomerLookupPage, failure?: Failure): Case<CustomerLookupPage>;
|
|
14
|
+
/** Script the invalidResponse branch. */
|
|
15
|
+
declare function getCustomersByEmailInvalidResponse(value: CustomerLookupPage, failure?: Failure): Case<CustomerLookupPage>;
|
|
16
|
+
/** Script the defect branch. */
|
|
17
|
+
declare function getCustomersByEmailDefect(value: CustomerLookupPage, failure?: Failure): Case<CustomerLookupPage>;
|
|
18
|
+
/** Script a safe retry of getCustomersByEmail. */
|
|
19
|
+
declare function getCustomersByEmailRetry(failure: Failure, retryAfterMs?: number): Case<CustomerLookupPage>;
|
|
20
|
+
/** Manifest scenario foundDefault for getCustomersByEmail. */
|
|
21
|
+
declare function getCustomersByEmailFoundDefault(): Case<CustomerLookupPage>;
|
|
22
|
+
/** Default getCustomersByEmail scenario. */
|
|
23
|
+
declare function getCustomersByEmailDefault(): Case<CustomerLookupPage>;
|
|
24
|
+
/** Scripted operations and manifest defaults for this connector. */
|
|
25
|
+
declare class GeneratedMock implements Operations {
|
|
26
|
+
#private;
|
|
27
|
+
constructor(connectionName: string);
|
|
28
|
+
connection(): Connection;
|
|
29
|
+
getCustomersByEmail(): MockQuery<GetCustomersByEmailInput, CustomerLookupPage>;
|
|
30
|
+
assertNoFailures(): void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { GeneratedMock, GeneratedMock as Mock, emptyCustomerLookupPage, emptyGetCustomersByEmailInput, getCustomersByEmailDefault, getCustomersByEmailDefect, getCustomersByEmailFound, getCustomersByEmailFoundDefault, getCustomersByEmailInvalidResponse, getCustomersByEmailProviderRejected, getCustomersByEmailRetry };
|
package/dist/mock.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CustomerLookupPageSchema,
|
|
3
|
+
GetCustomersByEmailDefinition,
|
|
4
|
+
GetCustomersByEmailInputSchema,
|
|
5
|
+
ProviderID,
|
|
6
|
+
newConnectionWithOperations
|
|
7
|
+
} from "./chunk-462ICFCP.js";
|
|
8
|
+
|
|
9
|
+
// src/generated/mock.ts
|
|
10
|
+
import { branchCase, retryCase, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
11
|
+
var emptyGetCustomersByEmailInput = GetCustomersByEmailInputSchema.parse({
|
|
12
|
+
"email": ""
|
|
13
|
+
});
|
|
14
|
+
var emptyCustomerLookupPage = CustomerLookupPageSchema.parse({
|
|
15
|
+
"email": "",
|
|
16
|
+
"customerIDs": []
|
|
17
|
+
});
|
|
18
|
+
function getCustomersByEmailFound(value, failure) {
|
|
19
|
+
return branchCase("found", value, failure);
|
|
20
|
+
}
|
|
21
|
+
function getCustomersByEmailProviderRejected(value, failure) {
|
|
22
|
+
return branchCase("providerRejected", value, failure);
|
|
23
|
+
}
|
|
24
|
+
function getCustomersByEmailInvalidResponse(value, failure) {
|
|
25
|
+
return branchCase("invalidResponse", value, failure);
|
|
26
|
+
}
|
|
27
|
+
function getCustomersByEmailDefect(value, failure) {
|
|
28
|
+
return branchCase("defect", value, failure);
|
|
29
|
+
}
|
|
30
|
+
function getCustomersByEmailRetry(failure, retryAfterMs = 0) {
|
|
31
|
+
return retryCase(failure, retryAfterMs);
|
|
32
|
+
}
|
|
33
|
+
function getCustomersByEmailFoundDefault() {
|
|
34
|
+
const value = CustomerLookupPageSchema.parse({ "customerIDs": ["a3000001"], "email": "person@example.com" });
|
|
35
|
+
return branchCase("found", value);
|
|
36
|
+
}
|
|
37
|
+
function getCustomersByEmailDefault() {
|
|
38
|
+
return getCustomersByEmailFoundDefault();
|
|
39
|
+
}
|
|
40
|
+
var GeneratedMock = class {
|
|
41
|
+
#getCustomersByEmail;
|
|
42
|
+
#connection;
|
|
43
|
+
constructor(connectionName) {
|
|
44
|
+
this.#getCustomersByEmail = newQuery(GetCustomersByEmailDefinition).default(getCustomersByEmailDefault());
|
|
45
|
+
this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
|
|
46
|
+
}
|
|
47
|
+
connection() {
|
|
48
|
+
return this.#connection;
|
|
49
|
+
}
|
|
50
|
+
getCustomersByEmail() {
|
|
51
|
+
return this.#getCustomersByEmail;
|
|
52
|
+
}
|
|
53
|
+
assertNoFailures() {
|
|
54
|
+
this.#getCustomersByEmail.assertNoFailures();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
GeneratedMock,
|
|
59
|
+
GeneratedMock as Mock,
|
|
60
|
+
emptyCustomerLookupPage,
|
|
61
|
+
emptyGetCustomersByEmailInput,
|
|
62
|
+
getCustomersByEmailDefault,
|
|
63
|
+
getCustomersByEmailDefect,
|
|
64
|
+
getCustomersByEmailFound,
|
|
65
|
+
getCustomersByEmailFoundDefault,
|
|
66
|
+
getCustomersByEmailInvalidResponse,
|
|
67
|
+
getCustomersByEmailProviderRejected,
|
|
68
|
+
getCustomersByEmailRetry
|
|
69
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connector-customerio",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Customerio connector for Dex TypeScript applications",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/superdurable/dex-connectors-library.git",
|
|
9
|
+
"directory": "connectors/customerio/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/customer-lookup/worker.ts",
|
|
42
|
+
"example:start": "tsx examples/customer-lookup/start.ts",
|
|
43
|
+
"check": "npm run typecheck && npm run lint && npm test && npm run build"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@superdurable/connectors-sdk": "0.1.1",
|
|
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
|
+
}
|