@superdurable/connector-adyen 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 +4 -2
- package/dex-connector.json +65 -0
- package/dist/chunk-CHGEL2F6.js +106 -0
- package/dist/connection-ozFLV9Xy.d.ts +72 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +220 -0
- package/dist/mock.d.ts +35 -0
- package/dist/mock.js +74 -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,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Adyen TypeScript connector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Implements `getPaymentLink`, returning a payment link ID, status, and amount currency. Go-recorded conformance checks exact requests, branches, retries, and outputs.
|
|
4
|
+
|
|
5
|
+
Create a secret API key in Adyen Customer Area > Developers > API credentials and grant the Checkout webservice role. Save it as `api_key` in Dex Web Connections. See the [connection guide](../README.md) and [runnable example](examples/payment-link-inspection/README.md). Live provider authorization remains unverified.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectorId": "adyen",
|
|
3
|
+
"releaseTag": "connectors/adyen/go/v0.1.0",
|
|
4
|
+
"package": {
|
|
5
|
+
"ecosystem": "npm",
|
|
6
|
+
"name": "@superdurable/connector-adyen",
|
|
7
|
+
"version": "0.1.0"
|
|
8
|
+
},
|
|
9
|
+
"factories": [
|
|
10
|
+
{
|
|
11
|
+
"name": "newGetPaymentLinkStep",
|
|
12
|
+
"kind": "query",
|
|
13
|
+
"operationId": "getPaymentLink",
|
|
14
|
+
"inputType": "GetPaymentLinkInput",
|
|
15
|
+
"description": "Read a payment link's ID, status, and amount currency without shopper or payment details.",
|
|
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": "notFound",
|
|
30
|
+
"field": "notFound",
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "providerRejected",
|
|
35
|
+
"field": "providerRejected",
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "invalidResponse",
|
|
40
|
+
"field": "invalidResponse",
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "defect",
|
|
45
|
+
"field": "defect",
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"inputSchema": {
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"description": "GetPaymentLinkInput selects a payment link by its non-secret Adyen ID.",
|
|
52
|
+
"properties": {
|
|
53
|
+
"paymentLinkId": {
|
|
54
|
+
"description": "PaymentLinkID is a payment link ID returned by Adyen Checkout API.",
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": [
|
|
59
|
+
"paymentLinkId"
|
|
60
|
+
],
|
|
61
|
+
"type": "object"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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(["api_key"]);
|
|
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["api_key"] != null && !(typeof fields["api_key"] === "string")) throw new TypeError("credential api_key has an invalid type");
|
|
15
|
+
const credentials = {};
|
|
16
|
+
if (!fields["api_key"]) throw new TypeError("credential api_key is required");
|
|
17
|
+
credentials.apiKey = new SecretString(fields["api_key"] ?? "");
|
|
18
|
+
return credentials;
|
|
19
|
+
}
|
|
20
|
+
var GetPaymentLinkInputSchema = z.strictObject({
|
|
21
|
+
"paymentLinkId": z.string()
|
|
22
|
+
});
|
|
23
|
+
var PaymentLinkStatusSchema = z.strictObject({
|
|
24
|
+
"id": z.string(),
|
|
25
|
+
"status": z.string(),
|
|
26
|
+
"currencyCode": z.string()
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// src/generated/definitions.ts
|
|
30
|
+
var ConnectorID = "adyen";
|
|
31
|
+
var ProviderID = "adyen";
|
|
32
|
+
var GetPaymentLinkBranch = {
|
|
33
|
+
Found: "found",
|
|
34
|
+
NotFound: "notFound",
|
|
35
|
+
ProviderRejected: "providerRejected",
|
|
36
|
+
InvalidResponse: "invalidResponse",
|
|
37
|
+
Defect: "defect"
|
|
38
|
+
};
|
|
39
|
+
var GetPaymentLinkBranchFound = GetPaymentLinkBranch.Found;
|
|
40
|
+
var GetPaymentLinkBranchNotFound = GetPaymentLinkBranch.NotFound;
|
|
41
|
+
var GetPaymentLinkBranchProviderRejected = GetPaymentLinkBranch.ProviderRejected;
|
|
42
|
+
var GetPaymentLinkBranchInvalidResponse = GetPaymentLinkBranch.InvalidResponse;
|
|
43
|
+
var GetPaymentLinkBranchDefect = GetPaymentLinkBranch.Defect;
|
|
44
|
+
var GetPaymentLinkDefinition = {
|
|
45
|
+
operation: { connectorId: ConnectorID, operationId: "getPaymentLink" },
|
|
46
|
+
branches: [
|
|
47
|
+
{ id: "found", description: "Adyen returned the payment link." },
|
|
48
|
+
{ id: "notFound", description: "Adyen did not expose the payment link.", optional: true },
|
|
49
|
+
{ id: "providerRejected", description: "Adyen conclusively rejected the lookup.", optional: true },
|
|
50
|
+
{ id: "invalidResponse", description: "Adyen returned malformed or oversized JSON.", optional: true },
|
|
51
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
52
|
+
],
|
|
53
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
54
|
+
};
|
|
55
|
+
var GetPaymentLinkMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
56
|
+
|
|
57
|
+
// src/generated/connection.ts
|
|
58
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
59
|
+
var Connection = class {
|
|
60
|
+
/** Stable provider and connection name. */
|
|
61
|
+
reference;
|
|
62
|
+
/** Bound provider operations. */
|
|
63
|
+
operations;
|
|
64
|
+
/** Validate a reference and bind operations. */
|
|
65
|
+
constructor(reference, operations) {
|
|
66
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
67
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
68
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
69
|
+
this.operations = operations;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function newConnection(client, reference) {
|
|
73
|
+
if (!client) throw new TypeError("connector client is required");
|
|
74
|
+
return new Connection(reference, client);
|
|
75
|
+
}
|
|
76
|
+
function newConnectionWithOperations(operations, reference) {
|
|
77
|
+
return new Connection(reference, operations);
|
|
78
|
+
}
|
|
79
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
80
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
81
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
82
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
83
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
84
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
ConfigSchema,
|
|
89
|
+
decodeCredentials,
|
|
90
|
+
GetPaymentLinkInputSchema,
|
|
91
|
+
PaymentLinkStatusSchema,
|
|
92
|
+
ConnectorID,
|
|
93
|
+
ProviderID,
|
|
94
|
+
GetPaymentLinkBranch,
|
|
95
|
+
GetPaymentLinkBranchFound,
|
|
96
|
+
GetPaymentLinkBranchNotFound,
|
|
97
|
+
GetPaymentLinkBranchProviderRejected,
|
|
98
|
+
GetPaymentLinkBranchInvalidResponse,
|
|
99
|
+
GetPaymentLinkBranchDefect,
|
|
100
|
+
GetPaymentLinkDefinition,
|
|
101
|
+
GetPaymentLinkMetadata,
|
|
102
|
+
Connection,
|
|
103
|
+
newConnection,
|
|
104
|
+
newConnectionWithOperations,
|
|
105
|
+
newProjectConnection
|
|
106
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
/** Checkout API root as an absolute HTTPS URL. Blank uses the displayed test endpoint. For live, find your company prefix in Customer Area > Developers > API URLs > Prefix and use https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v72; override only for live or a trusted local test gateway. */
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
/** Maximum duration of one API request as a positive Go duration such as 15s. Blank uses the displayed default; increase for slow payment link reads. Runtime value in milliseconds. */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
/** Maximum complete payment link response in bytes as a positive integer. Blank uses the displayed default; increase for unusually large link metadata. */
|
|
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 server-side API key from Adyen Customer Area > Developers > API credentials > Payments > credential username > Server settings > Authentication > API key > Generate API key. Copy the complete opaque value when shown; blank prevents calls. Dex sends it only in the X-API-Key header. Use a key from the same test or live environment as baseUrl. */
|
|
22
|
+
apiKey: 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
|
+
/** GetPaymentLinkInput selects a payment link by its non-secret Adyen ID. */
|
|
29
|
+
interface GetPaymentLinkInput {
|
|
30
|
+
/** PaymentLinkID is a payment link ID returned by Adyen Checkout API. */
|
|
31
|
+
"paymentLinkId": string;
|
|
32
|
+
}
|
|
33
|
+
/** PaymentLinkStatus excludes shopper identities and payment details. */
|
|
34
|
+
interface PaymentLinkStatus {
|
|
35
|
+
/** ID is the Adyen payment link ID. */
|
|
36
|
+
"id": string;
|
|
37
|
+
/** Status is a payment link state such as completed. */
|
|
38
|
+
"status": string;
|
|
39
|
+
/** CurrencyCode is the link amount's ISO 4217 currency. */
|
|
40
|
+
"currencyCode": string;
|
|
41
|
+
}
|
|
42
|
+
/** Runtime validator for GetPaymentLinkInput. */
|
|
43
|
+
declare const GetPaymentLinkInputSchema: z.ZodObject<{
|
|
44
|
+
paymentLinkId: z.ZodString;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
/** Runtime validator for PaymentLinkStatus. */
|
|
47
|
+
declare const PaymentLinkStatusSchema: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
status: z.ZodString;
|
|
50
|
+
currencyCode: z.ZodString;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
|
|
53
|
+
/** Typed operations supplied by a client or mock. */
|
|
54
|
+
interface Operations {
|
|
55
|
+
/** Invoke getPaymentLink through this connection. */
|
|
56
|
+
getPaymentLink(): Query<GetPaymentLinkInput, PaymentLinkStatus>;
|
|
57
|
+
}
|
|
58
|
+
/** Named connector connection kept outside Flow state. */
|
|
59
|
+
declare class Connection<BoundOperations = Operations> {
|
|
60
|
+
/** Stable provider and connection name. */
|
|
61
|
+
readonly reference: ConnectionRef;
|
|
62
|
+
/** Bound provider operations. */
|
|
63
|
+
readonly operations: BoundOperations;
|
|
64
|
+
/** Validate a reference and bind operations. */
|
|
65
|
+
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
66
|
+
}
|
|
67
|
+
/** Bind a client to a named connection. */
|
|
68
|
+
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
69
|
+
/** Bind scripted operations to a named connection. */
|
|
70
|
+
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
71
|
+
|
|
72
|
+
export { Connection as C, type GetPaymentLinkInput as G, type Operations as O, type PaymentLinkStatus as P, type Config as a, type Credentials as b, ConfigSchema as c, type CredentialSource as d, GetPaymentLinkInputSchema as e, PaymentLinkStatusSchema as f, decodeCredentials as g, newConnectionWithOperations as h, newConnection as n };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { G as GetPaymentLinkInput, P as PaymentLinkStatus, C as Connection, O as Operations, a as Config, b as Credentials } from './connection-ozFLV9Xy.js';
|
|
2
|
+
export { c as ConfigSchema, d as CredentialSource, e as GetPaymentLinkInputSchema, f as PaymentLinkStatusSchema, g as decodeCredentials, n as newConnection, h as newConnectionWithOperations } from './connection-ozFLV9Xy.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 = "adyen";
|
|
11
|
+
/** Provider identity for named connections. */
|
|
12
|
+
declare const ProviderID = "adyen";
|
|
13
|
+
/** Branch IDs for getPaymentLink. */
|
|
14
|
+
declare const GetPaymentLinkBranch: {
|
|
15
|
+
readonly Found: "found";
|
|
16
|
+
readonly NotFound: "notFound";
|
|
17
|
+
readonly ProviderRejected: "providerRejected";
|
|
18
|
+
readonly InvalidResponse: "invalidResponse";
|
|
19
|
+
readonly Defect: "defect";
|
|
20
|
+
};
|
|
21
|
+
/** Adyen returned the payment link. */
|
|
22
|
+
declare const GetPaymentLinkBranchFound: "found";
|
|
23
|
+
/** Adyen did not expose the payment link. */
|
|
24
|
+
declare const GetPaymentLinkBranchNotFound: "notFound";
|
|
25
|
+
/** Adyen conclusively rejected the lookup. */
|
|
26
|
+
declare const GetPaymentLinkBranchProviderRejected: "providerRejected";
|
|
27
|
+
/** Adyen returned malformed or oversized JSON. */
|
|
28
|
+
declare const GetPaymentLinkBranchInvalidResponse: "invalidResponse";
|
|
29
|
+
/** Local input or connection credentials are invalid. */
|
|
30
|
+
declare const GetPaymentLinkBranchDefect: "defect";
|
|
31
|
+
/** Manifest definition for getPaymentLink. */
|
|
32
|
+
declare const GetPaymentLinkDefinition: QueryDefinition;
|
|
33
|
+
/** Manifest metadata for getPaymentLink. */
|
|
34
|
+
declare const GetPaymentLinkMetadata: {
|
|
35
|
+
readonly kind: "query";
|
|
36
|
+
readonly idempotency: "none";
|
|
37
|
+
readonly authorization: "required";
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Configuration for the getPaymentLink connector Step. */
|
|
41
|
+
interface GetPaymentLinkStepConfig<StepInput, OperationInput = GetPaymentLinkInput, OperationOutput = PaymentLinkStatus> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
42
|
+
/** Named connection supplying this operation. */
|
|
43
|
+
connection: Connection<{
|
|
44
|
+
getPaymentLink(): Query<OperationInput, OperationOutput>;
|
|
45
|
+
}>;
|
|
46
|
+
/** Name matching the bound connection. */
|
|
47
|
+
connectionName: string;
|
|
48
|
+
/** Adyen returned the payment link. */
|
|
49
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
50
|
+
/** Adyen did not expose the payment link. */
|
|
51
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
52
|
+
/** Adyen conclusively rejected the lookup. */
|
|
53
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
54
|
+
/** Adyen returned malformed or oversized JSON. */
|
|
55
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
56
|
+
/** Local input or connection credentials are invalid. */
|
|
57
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
58
|
+
}
|
|
59
|
+
/** Build the getPaymentLink Step from a named connection. */
|
|
60
|
+
declare function newGetPaymentLinkStep<StepInput, OperationInput = GetPaymentLinkInput, OperationOutput = PaymentLinkStatus>(configuration: GetPaymentLinkStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
61
|
+
|
|
62
|
+
/** Open one named Adyen connection from Dex project configuration. */
|
|
63
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
|
|
64
|
+
|
|
65
|
+
/** Injectable provider sender for tests and local applications. */
|
|
66
|
+
interface AdyenClientOptions {
|
|
67
|
+
/** Provider sender; omitted uses the SDK transport. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
68
|
+
}
|
|
69
|
+
interface Exchange {
|
|
70
|
+
status: number;
|
|
71
|
+
body: Uint8Array;
|
|
72
|
+
retryAfterMs: number;
|
|
73
|
+
error?: 'credential' | 'request' | 'tooLarge';
|
|
74
|
+
}
|
|
75
|
+
/** Authenticated Adyen REST API client for payment link metadata. */
|
|
76
|
+
declare class AdyenClient {
|
|
77
|
+
private readonly credentials;
|
|
78
|
+
private readonly baseURL;
|
|
79
|
+
private readonly timeoutMs;
|
|
80
|
+
private readonly maxResponseBytes;
|
|
81
|
+
private readonly send;
|
|
82
|
+
/** Validate provider configuration without contacting Adyen. */
|
|
83
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: AdyenClientOptions);
|
|
84
|
+
/** Bind the getPaymentLink Query. */ getPaymentLink(): GetPaymentLinkOperation;
|
|
85
|
+
/** Resolve the API key and send one bounded payment link lookup. */
|
|
86
|
+
get(call: Call, paymentLinkID: string): Promise<Exchange>;
|
|
87
|
+
}
|
|
88
|
+
/** Read one payment link's ID, name, and status. */
|
|
89
|
+
declare class GetPaymentLinkOperation implements Query<GetPaymentLinkInput, PaymentLinkStatus> {
|
|
90
|
+
private readonly client;
|
|
91
|
+
/** Bind the provider client. */ constructor(client: AdyenClient);
|
|
92
|
+
/** Return the generated Query contract. */ definition(): QueryDefinition;
|
|
93
|
+
/** Classify provider outcomes consistently with the Go implementation. */
|
|
94
|
+
invoke(call: Call, input: GetPaymentLinkInput): Promise<QueryAttempt<PaymentLinkStatus>>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { AdyenClient, type AdyenClientOptions, Config, Connection, ConnectorID, Credentials, GetPaymentLinkBranch, GetPaymentLinkBranchDefect, GetPaymentLinkBranchFound, GetPaymentLinkBranchInvalidResponse, GetPaymentLinkBranchNotFound, GetPaymentLinkBranchProviderRejected, GetPaymentLinkDefinition, GetPaymentLinkInput, GetPaymentLinkMetadata, GetPaymentLinkOperation, type GetPaymentLinkStepConfig, PaymentLinkStatus, ProviderID, newGetPaymentLinkStep, newProjectConnection };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigSchema,
|
|
3
|
+
Connection,
|
|
4
|
+
ConnectorID,
|
|
5
|
+
GetPaymentLinkBranch,
|
|
6
|
+
GetPaymentLinkBranchDefect,
|
|
7
|
+
GetPaymentLinkBranchFound,
|
|
8
|
+
GetPaymentLinkBranchInvalidResponse,
|
|
9
|
+
GetPaymentLinkBranchNotFound,
|
|
10
|
+
GetPaymentLinkBranchProviderRejected,
|
|
11
|
+
GetPaymentLinkDefinition,
|
|
12
|
+
GetPaymentLinkInputSchema,
|
|
13
|
+
GetPaymentLinkMetadata,
|
|
14
|
+
PaymentLinkStatusSchema,
|
|
15
|
+
ProviderID,
|
|
16
|
+
decodeCredentials,
|
|
17
|
+
newConnection,
|
|
18
|
+
newConnectionWithOperations,
|
|
19
|
+
newProjectConnection
|
|
20
|
+
} from "./chunk-CHGEL2F6.js";
|
|
21
|
+
|
|
22
|
+
// src/generated/steps.ts
|
|
23
|
+
import { goToBranch, newQueryStep } from "@superdurable/connectors-sdk";
|
|
24
|
+
function newGetPaymentLinkStep(configuration) {
|
|
25
|
+
const { connection, connectionName, found, notFound, providerRejected, invalidResponse, defect, ...stepConfiguration } = configuration;
|
|
26
|
+
if (!connection || connection.reference.name !== connectionName) throw new TypeError("Step connection name differs from the bound connection");
|
|
27
|
+
return newQueryStep({ ...stepConfiguration, operation: connection.operations.getPaymentLink(), connection: connection.reference, branches: [
|
|
28
|
+
goToBranch("found", found),
|
|
29
|
+
...notFound ? [goToBranch("notFound", notFound)] : [],
|
|
30
|
+
...providerRejected ? [goToBranch("providerRejected", providerRejected)] : [],
|
|
31
|
+
...invalidResponse ? [goToBranch("invalidResponse", invalidResponse)] : [],
|
|
32
|
+
...defect ? [goToBranch("defect", defect)] : []
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/project.ts
|
|
37
|
+
import { SecretString as SecretString2 } from "@superdurable/connectors-sdk";
|
|
38
|
+
import { z } from "zod";
|
|
39
|
+
|
|
40
|
+
// src/client.ts
|
|
41
|
+
import { SecretString, newQueryBranch, newQueryRetry } from "@superdurable/connectors-sdk";
|
|
42
|
+
import { BodyTooLargeError, isHeaderSafeCredential, parseRetryAfter, sendProviderRequest, validateBaseURL } from "@superdurable/connectors-sdk/providerhttp";
|
|
43
|
+
var defaultBaseURL = "https://checkout-test.adyen.com/v72";
|
|
44
|
+
var emptyPaymentLink = () => ({ id: "", status: "", currencyCode: "" });
|
|
45
|
+
var AdyenClient = class {
|
|
46
|
+
/** Validate provider configuration without contacting Adyen. */
|
|
47
|
+
constructor(config, credentials, options = {}) {
|
|
48
|
+
this.credentials = credentials;
|
|
49
|
+
if (!config || !credentials) throw new TypeError("Adyen configuration and credentials are required");
|
|
50
|
+
this.baseURL = validateBaseURL(config.baseUrl || defaultBaseURL);
|
|
51
|
+
this.timeoutMs = config.timeoutMs || 15e3;
|
|
52
|
+
this.maxResponseBytes = config.maxResponseBytes || 1048576;
|
|
53
|
+
if (!Number.isSafeInteger(this.timeoutMs) || this.timeoutMs <= 0 || !Number.isSafeInteger(this.maxResponseBytes) || this.maxResponseBytes <= 0)
|
|
54
|
+
throw new TypeError("Adyen request limits must be positive integers");
|
|
55
|
+
this.send = options.send ?? sendProviderRequest;
|
|
56
|
+
}
|
|
57
|
+
credentials;
|
|
58
|
+
baseURL;
|
|
59
|
+
timeoutMs;
|
|
60
|
+
maxResponseBytes;
|
|
61
|
+
send;
|
|
62
|
+
/** Bind the getPaymentLink Query. */
|
|
63
|
+
getPaymentLink() {
|
|
64
|
+
return new GetPaymentLinkOperation(this);
|
|
65
|
+
}
|
|
66
|
+
/** Resolve the API key and send one bounded payment link lookup. */
|
|
67
|
+
async get(call, paymentLinkID) {
|
|
68
|
+
let apiKey;
|
|
69
|
+
try {
|
|
70
|
+
const credentials = await this.credentials.resolve(call, call.context.cancellationSignal);
|
|
71
|
+
apiKey = credentials.apiKey instanceof SecretString ? credentials.apiKey.reveal() : "";
|
|
72
|
+
} catch {
|
|
73
|
+
return emptyExchange("credential");
|
|
74
|
+
}
|
|
75
|
+
if (!apiKey || !isHeaderSafeCredential(apiKey)) return emptyExchange("credential");
|
|
76
|
+
const request = {
|
|
77
|
+
url: `${this.baseURL}/paymentLinks/${encodeURIComponent(paymentLinkID)}`,
|
|
78
|
+
method: "GET",
|
|
79
|
+
headers: { Accept: "application/json", "X-API-Key": apiKey },
|
|
80
|
+
maxResponseBytes: this.maxResponseBytes,
|
|
81
|
+
timeoutMs: this.timeoutMs,
|
|
82
|
+
addressPolicy: this.baseURL.startsWith("https://") ? "publicHTTPS" : "privateNetworkHTTP",
|
|
83
|
+
signal: call.context.cancellationSignal
|
|
84
|
+
};
|
|
85
|
+
let response;
|
|
86
|
+
let isTooLarge = false;
|
|
87
|
+
try {
|
|
88
|
+
response = await this.send(request);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
if (error instanceof BodyTooLargeError && error.status !== void 0) {
|
|
91
|
+
response = { status: error.status, headers: error.headers ?? {}, body: new Uint8Array() };
|
|
92
|
+
isTooLarge = true;
|
|
93
|
+
} else return emptyExchange("request");
|
|
94
|
+
}
|
|
95
|
+
const retryAfterMs = parseRetryAfter(header(response.headers, "retry-after"));
|
|
96
|
+
if (isTooLarge || response.body.length > this.maxResponseBytes)
|
|
97
|
+
return { status: response.status, body: new Uint8Array(), retryAfterMs, error: "tooLarge" };
|
|
98
|
+
return { status: response.status, body: response.body, retryAfterMs };
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var GetPaymentLinkOperation = class {
|
|
102
|
+
/** Bind the provider client. */
|
|
103
|
+
constructor(client) {
|
|
104
|
+
this.client = client;
|
|
105
|
+
}
|
|
106
|
+
client;
|
|
107
|
+
/** Return the generated Query contract. */
|
|
108
|
+
definition() {
|
|
109
|
+
return GetPaymentLinkDefinition;
|
|
110
|
+
}
|
|
111
|
+
/** Classify provider outcomes consistently with the Go implementation. */
|
|
112
|
+
async invoke(call, input) {
|
|
113
|
+
if (!isValidPaymentLinkID(input?.paymentLinkId))
|
|
114
|
+
return terminal("defect", "VALIDATION", "payment link ID must contain 1\u2013128 URL-safe characters");
|
|
115
|
+
const exchange = await this.client.get(call, input.paymentLinkId);
|
|
116
|
+
if (exchange.error === "credential") return terminal("defect", "AUTHENTICATION", "Adyen credentials are unavailable or invalid");
|
|
117
|
+
if (exchange.error === "request") return retry("TRANSPORT", "Adyen request failed");
|
|
118
|
+
if (exchange.status === 429) return retry("RATE_LIMIT", "Adyen rate limited the request", exchange.retryAfterMs);
|
|
119
|
+
if (exchange.status === 408 || exchange.status >= 500) return retry("AVAILABILITY", "Adyen is temporarily unavailable", exchange.retryAfterMs);
|
|
120
|
+
if (exchange.status === 404) return terminal("notFound", "NOT_FOUND", "Adyen did not expose the payment link");
|
|
121
|
+
if (exchange.status !== 200) return terminal("providerRejected", "PROVIDER_REJECTION", `Adyen rejected HTTP ${exchange.status}`);
|
|
122
|
+
if (exchange.error === "tooLarge") return terminal("invalidResponse", "RESPONSE_TOO_LARGE", "Adyen response exceeded the configured limit");
|
|
123
|
+
const paymentLinkStatus = decodePaymentLink(exchange.body, input.paymentLinkId);
|
|
124
|
+
if (!paymentLinkStatus) return terminal("invalidResponse", "PROTOCOL", "Adyen returned invalid payment link JSON");
|
|
125
|
+
return newQueryBranch("found", paymentLinkStatus);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
function isValidPaymentLinkID(value) {
|
|
129
|
+
return typeof value === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(value);
|
|
130
|
+
}
|
|
131
|
+
function emptyExchange(error) {
|
|
132
|
+
return { status: 0, body: new Uint8Array(), retryAfterMs: 0, error };
|
|
133
|
+
}
|
|
134
|
+
function failure(kind, message) {
|
|
135
|
+
return { provider: "adyen", operation: "getPaymentLink", kind, message };
|
|
136
|
+
}
|
|
137
|
+
function terminal(branch, kind, message) {
|
|
138
|
+
return newQueryBranch(branch, emptyPaymentLink(), {}, failure(kind, message));
|
|
139
|
+
}
|
|
140
|
+
function retry(kind, message, delay = 0) {
|
|
141
|
+
return newQueryRetry(failure(kind, message), delay);
|
|
142
|
+
}
|
|
143
|
+
function header(headers, name) {
|
|
144
|
+
const entry = Object.entries(headers).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];
|
|
145
|
+
return Array.isArray(entry) ? entry[0] ?? "" : entry ?? "";
|
|
146
|
+
}
|
|
147
|
+
function isObject(value) {
|
|
148
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
149
|
+
}
|
|
150
|
+
function decodePaymentLink(body, paymentLinkID) {
|
|
151
|
+
let raw;
|
|
152
|
+
try {
|
|
153
|
+
raw = JSON.parse(Buffer.from(body).toString("utf8"));
|
|
154
|
+
} catch {
|
|
155
|
+
return void 0;
|
|
156
|
+
}
|
|
157
|
+
if (!isObject(raw) || !isObject(raw.amount)) return void 0;
|
|
158
|
+
const amount = raw.amount;
|
|
159
|
+
if (raw.id !== paymentLinkID || typeof raw.status !== "string" || !raw.status.trim() || typeof amount.currency !== "string" || amount.currency.length !== 3) return void 0;
|
|
160
|
+
return { id: paymentLinkID, status: raw.status, currencyCode: amount.currency };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// src/project.ts
|
|
164
|
+
function newProjectConnection2(project, connectionName) {
|
|
165
|
+
return newProjectConnection(project, connectionName, (loadedProject, name) => {
|
|
166
|
+
const selected = loadedProject.configuration.connections.find((entry) => entry.connectorId === "adyen" && entry.connectionName === name);
|
|
167
|
+
if (!selected) throw new TypeError("Adyen project connection is not configured");
|
|
168
|
+
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);
|
|
169
|
+
const timeoutMs = typeof fields.timeout === "number" ? Math.ceil(fields.timeout / 1e6) : fields.timeout ? parseDurationMilliseconds(fields.timeout) : void 0;
|
|
170
|
+
const config = {
|
|
171
|
+
...fields.baseUrl ? { baseUrl: fields.baseUrl } : {},
|
|
172
|
+
...timeoutMs !== void 0 ? { timeoutMs } : {},
|
|
173
|
+
...fields.maxResponseBytes !== void 0 ? { maxResponseBytes: fields.maxResponseBytes } : {}
|
|
174
|
+
};
|
|
175
|
+
const credentials = {
|
|
176
|
+
async resolve(_call, signal) {
|
|
177
|
+
const privateFields = await loadedProject.resolveCredential("adyen", name, signal);
|
|
178
|
+
if (typeof privateFields.api_key !== "string") throw new TypeError("Adyen credentials are unavailable");
|
|
179
|
+
return { apiKey: new SecretString2(privateFields.api_key) };
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
return new AdyenClient(config, credentials);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function parseDurationMilliseconds(value) {
|
|
186
|
+
let remaining = value;
|
|
187
|
+
let milliseconds = 0;
|
|
188
|
+
const units = { ns: 1e-6, us: 1e-3, "\xB5s": 1e-3, ms: 1, s: 1e3, m: 6e4, h: 36e5 };
|
|
189
|
+
while (remaining) {
|
|
190
|
+
const part = /^(\d+(?:\.\d+)?)(ns|us|µs|ms|s|m|h)/.exec(remaining);
|
|
191
|
+
if (!part) throw new TypeError("Adyen timeout must be a positive Go duration");
|
|
192
|
+
milliseconds += Number(part[1]) * (units[part[2] ?? ""] ?? NaN);
|
|
193
|
+
remaining = remaining.slice(part[0].length);
|
|
194
|
+
}
|
|
195
|
+
if (!Number.isSafeInteger(milliseconds) || milliseconds <= 0) throw new TypeError("Adyen timeout must resolve to positive whole milliseconds");
|
|
196
|
+
return milliseconds;
|
|
197
|
+
}
|
|
198
|
+
export {
|
|
199
|
+
AdyenClient,
|
|
200
|
+
ConfigSchema,
|
|
201
|
+
Connection,
|
|
202
|
+
ConnectorID,
|
|
203
|
+
GetPaymentLinkBranch,
|
|
204
|
+
GetPaymentLinkBranchDefect,
|
|
205
|
+
GetPaymentLinkBranchFound,
|
|
206
|
+
GetPaymentLinkBranchInvalidResponse,
|
|
207
|
+
GetPaymentLinkBranchNotFound,
|
|
208
|
+
GetPaymentLinkBranchProviderRejected,
|
|
209
|
+
GetPaymentLinkDefinition,
|
|
210
|
+
GetPaymentLinkInputSchema,
|
|
211
|
+
GetPaymentLinkMetadata,
|
|
212
|
+
GetPaymentLinkOperation,
|
|
213
|
+
PaymentLinkStatusSchema,
|
|
214
|
+
ProviderID,
|
|
215
|
+
decodeCredentials,
|
|
216
|
+
newConnection,
|
|
217
|
+
newConnectionWithOperations,
|
|
218
|
+
newGetPaymentLinkStep,
|
|
219
|
+
newProjectConnection2 as newProjectConnection
|
|
220
|
+
};
|
package/dist/mock.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MockQuery, Case } from '@superdurable/connectors-sdk/connectormock';
|
|
2
|
+
import { Failure } from '@superdurable/connectors-sdk';
|
|
3
|
+
import { O as Operations, C as Connection, G as GetPaymentLinkInput, P as PaymentLinkStatus } from './connection-ozFLV9Xy.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/** Go zero value for GetPaymentLinkInput in scripted cases. */
|
|
7
|
+
declare const emptyGetPaymentLinkInput: GetPaymentLinkInput;
|
|
8
|
+
/** Go zero value for PaymentLinkStatus in scripted cases. */
|
|
9
|
+
declare const emptyPaymentLinkStatus: PaymentLinkStatus;
|
|
10
|
+
/** Script the found branch. */
|
|
11
|
+
declare function getPaymentLinkFound(value: PaymentLinkStatus, failure?: Failure): Case<PaymentLinkStatus>;
|
|
12
|
+
/** Script the notFound branch. */
|
|
13
|
+
declare function getPaymentLinkNotFound(value: PaymentLinkStatus, failure?: Failure): Case<PaymentLinkStatus>;
|
|
14
|
+
/** Script the providerRejected branch. */
|
|
15
|
+
declare function getPaymentLinkProviderRejected(value: PaymentLinkStatus, failure?: Failure): Case<PaymentLinkStatus>;
|
|
16
|
+
/** Script the invalidResponse branch. */
|
|
17
|
+
declare function getPaymentLinkInvalidResponse(value: PaymentLinkStatus, failure?: Failure): Case<PaymentLinkStatus>;
|
|
18
|
+
/** Script the defect branch. */
|
|
19
|
+
declare function getPaymentLinkDefect(value: PaymentLinkStatus, failure?: Failure): Case<PaymentLinkStatus>;
|
|
20
|
+
/** Script a safe retry of getPaymentLink. */
|
|
21
|
+
declare function getPaymentLinkRetry(failure: Failure, retryAfterMs?: number): Case<PaymentLinkStatus>;
|
|
22
|
+
/** Manifest scenario foundDefault for getPaymentLink. */
|
|
23
|
+
declare function getPaymentLinkFoundDefault(): Case<PaymentLinkStatus>;
|
|
24
|
+
/** Default getPaymentLink scenario. */
|
|
25
|
+
declare function getPaymentLinkDefault(): Case<PaymentLinkStatus>;
|
|
26
|
+
/** Scripted operations and manifest defaults for this connector. */
|
|
27
|
+
declare class GeneratedMock implements Operations {
|
|
28
|
+
#private;
|
|
29
|
+
constructor(connectionName: string);
|
|
30
|
+
connection(): Connection;
|
|
31
|
+
getPaymentLink(): MockQuery<GetPaymentLinkInput, PaymentLinkStatus>;
|
|
32
|
+
assertNoFailures(): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { GeneratedMock, GeneratedMock as Mock, emptyGetPaymentLinkInput, emptyPaymentLinkStatus, getPaymentLinkDefault, getPaymentLinkDefect, getPaymentLinkFound, getPaymentLinkFoundDefault, getPaymentLinkInvalidResponse, getPaymentLinkNotFound, getPaymentLinkProviderRejected, getPaymentLinkRetry };
|
package/dist/mock.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GetPaymentLinkDefinition,
|
|
3
|
+
GetPaymentLinkInputSchema,
|
|
4
|
+
PaymentLinkStatusSchema,
|
|
5
|
+
ProviderID,
|
|
6
|
+
newConnectionWithOperations
|
|
7
|
+
} from "./chunk-CHGEL2F6.js";
|
|
8
|
+
|
|
9
|
+
// src/generated/mock.ts
|
|
10
|
+
import { branchCase, retryCase, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
11
|
+
var emptyGetPaymentLinkInput = GetPaymentLinkInputSchema.parse({
|
|
12
|
+
"paymentLinkId": ""
|
|
13
|
+
});
|
|
14
|
+
var emptyPaymentLinkStatus = PaymentLinkStatusSchema.parse({
|
|
15
|
+
"id": "",
|
|
16
|
+
"status": "",
|
|
17
|
+
"currencyCode": ""
|
|
18
|
+
});
|
|
19
|
+
function getPaymentLinkFound(value, failure) {
|
|
20
|
+
return branchCase("found", value, failure);
|
|
21
|
+
}
|
|
22
|
+
function getPaymentLinkNotFound(value, failure) {
|
|
23
|
+
return branchCase("notFound", value, failure);
|
|
24
|
+
}
|
|
25
|
+
function getPaymentLinkProviderRejected(value, failure) {
|
|
26
|
+
return branchCase("providerRejected", value, failure);
|
|
27
|
+
}
|
|
28
|
+
function getPaymentLinkInvalidResponse(value, failure) {
|
|
29
|
+
return branchCase("invalidResponse", value, failure);
|
|
30
|
+
}
|
|
31
|
+
function getPaymentLinkDefect(value, failure) {
|
|
32
|
+
return branchCase("defect", value, failure);
|
|
33
|
+
}
|
|
34
|
+
function getPaymentLinkRetry(failure, retryAfterMs = 0) {
|
|
35
|
+
return retryCase(failure, retryAfterMs);
|
|
36
|
+
}
|
|
37
|
+
function getPaymentLinkFoundDefault() {
|
|
38
|
+
const value = PaymentLinkStatusSchema.parse({ "currencyCode": "EUR", "id": "PL50C5F751CED39G71", "status": "completed" });
|
|
39
|
+
return branchCase("found", value);
|
|
40
|
+
}
|
|
41
|
+
function getPaymentLinkDefault() {
|
|
42
|
+
return getPaymentLinkFoundDefault();
|
|
43
|
+
}
|
|
44
|
+
var GeneratedMock = class {
|
|
45
|
+
#getPaymentLink;
|
|
46
|
+
#connection;
|
|
47
|
+
constructor(connectionName) {
|
|
48
|
+
this.#getPaymentLink = newQuery(GetPaymentLinkDefinition).default(getPaymentLinkDefault());
|
|
49
|
+
this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
|
|
50
|
+
}
|
|
51
|
+
connection() {
|
|
52
|
+
return this.#connection;
|
|
53
|
+
}
|
|
54
|
+
getPaymentLink() {
|
|
55
|
+
return this.#getPaymentLink;
|
|
56
|
+
}
|
|
57
|
+
assertNoFailures() {
|
|
58
|
+
this.#getPaymentLink.assertNoFailures();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
GeneratedMock,
|
|
63
|
+
GeneratedMock as Mock,
|
|
64
|
+
emptyGetPaymentLinkInput,
|
|
65
|
+
emptyPaymentLinkStatus,
|
|
66
|
+
getPaymentLinkDefault,
|
|
67
|
+
getPaymentLinkDefect,
|
|
68
|
+
getPaymentLinkFound,
|
|
69
|
+
getPaymentLinkFoundDefault,
|
|
70
|
+
getPaymentLinkInvalidResponse,
|
|
71
|
+
getPaymentLinkNotFound,
|
|
72
|
+
getPaymentLinkProviderRejected,
|
|
73
|
+
getPaymentLinkRetry
|
|
74
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connector-adyen",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Adyen connector for Dex TypeScript applications",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/superdurable/dex-connectors-library.git",
|
|
9
|
+
"directory": "connectors/adyen/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/payment-link-inspection/worker.ts",
|
|
42
|
+
"example:start": "tsx examples/payment-link-inspection/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
|
+
}
|