@agent-cards/sdk 0.20.0 → 0.22.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/CHANGELOG.md +51 -0
- package/PREFLIGHT.md +34 -0
- package/README.md +1217 -15
- package/dist/aci.d.ts +173 -0
- package/dist/aci.generated.d.ts +87 -0
- package/dist/aci.generated.js +306 -0
- package/dist/aci.js +371 -0
- package/dist/adyen-merchant-hosted.generated.d.ts +3 -3
- package/dist/adyen-merchant-hosted.generated.js +283 -49
- package/dist/agentcard.d.ts +9 -2
- package/dist/agentcard.js +4 -2
- package/dist/amadeus-checkout.generated.d.ts +57 -0
- package/dist/amadeus-checkout.generated.js +549 -0
- package/dist/amadeus.d.ts +41 -0
- package/dist/amadeus.js +81 -0
- package/dist/builtin-registry.generated.js +1 -1
- package/dist/card-endpoint.d.ts +177 -0
- package/dist/card-endpoint.js +286 -0
- package/dist/card-fields.generated.d.ts +5 -3
- package/dist/card-fields.generated.js +284 -7
- package/dist/cdp.d.ts +6 -1
- package/dist/cdp.js +983 -147
- package/dist/client.d.ts +493 -13
- package/dist/client.js +1100 -82
- package/dist/creditguard.generated.d.ts +79 -0
- package/dist/creditguard.generated.js +662 -0
- package/dist/cse-body.js +11 -1
- package/dist/cybersource-flex.d.ts +183 -0
- package/dist/cybersource-flex.generated.d.ts +92 -0
- package/dist/cybersource-flex.generated.js +689 -0
- package/dist/cybersource-flex.js +275 -0
- package/dist/datatrans.d.ts +96 -0
- package/dist/datatrans.generated.d.ts +64 -0
- package/dist/datatrans.generated.js +426 -0
- package/dist/datatrans.js +178 -0
- package/dist/elavon-converge.d.ts +37 -0
- package/dist/elavon-converge.generated.d.ts +49 -0
- package/dist/elavon-converge.generated.js +439 -0
- package/dist/elavon-converge.js +84 -0
- package/dist/eprotect.d.ts +152 -0
- package/dist/eprotect.generated.d.ts +77 -0
- package/dist/eprotect.generated.js +498 -0
- package/dist/eprotect.js +222 -0
- package/dist/gmo.d.ts +63 -0
- package/dist/gmo.generated.d.ts +60 -0
- package/dist/gmo.generated.js +586 -0
- package/dist/gmo.js +119 -0
- package/dist/hosted-form.d.ts +3 -2
- package/dist/hosted-form.js +3 -2
- package/dist/index.d.ts +19 -3
- package/dist/index.js +6 -1
- package/dist/juspay-gate.d.ts +82 -0
- package/dist/juspay-gate.js +126 -0
- package/dist/juspay.generated.d.ts +89 -0
- package/dist/juspay.generated.js +705 -0
- package/dist/lifecycle.d.ts +62 -6
- package/dist/lifecycle.js +123 -8
- package/dist/merchant-card-endpoints.generated.d.ts +63 -0
- package/dist/merchant-card-endpoints.generated.js +1103 -0
- package/dist/merchant-hosted.d.ts +4 -1
- package/dist/merchant-hosted.js +5 -2
- package/dist/merchant-session-probe.d.ts +48 -0
- package/dist/merchant-session-probe.js +53 -0
- package/dist/merchant-session.generated.d.ts +69 -0
- package/dist/merchant-session.generated.js +919 -0
- package/dist/payrails.d.ts +133 -0
- package/dist/payrails.generated.d.ts +73 -0
- package/dist/payrails.generated.js +596 -0
- package/dist/payrails.js +305 -0
- package/dist/pelecard.d.ts +32 -0
- package/dist/pelecard.generated.d.ts +32 -0
- package/dist/pelecard.generated.js +283 -0
- package/dist/pelecard.js +42 -0
- package/dist/pre-claim.d.ts +84 -3
- package/dist/pre-claim.js +987 -9
- package/dist/preflight-catalog.json +2310 -263
- package/dist/preflight-schemas.json +187 -6
- package/dist/preflight.generated.d.ts +1 -1
- package/dist/preflight.generated.js +247 -4
- package/dist/preparation.d.ts +5 -2
- package/dist/preparation.js +36 -10
- package/dist/prepared-processor.d.ts +86 -5
- package/dist/prepared-processor.js +157 -6
- package/dist/primer.d.ts +53 -0
- package/dist/primer.generated.d.ts +38 -0
- package/dist/primer.generated.js +624 -0
- package/dist/primer.js +82 -0
- package/dist/registry.d.ts +114 -12
- package/dist/registry.js +85 -11
- package/dist/shiji-sts.d.ts +144 -0
- package/dist/shiji-sts.generated.d.ts +72 -0
- package/dist/shiji-sts.generated.js +913 -0
- package/dist/shiji-sts.js +222 -0
- package/dist/stripe-checkout.generated.d.ts +1 -1
- package/dist/stripe-checkout.generated.js +735 -10
- package/dist/stripe-setup.d.ts +16 -0
- package/dist/stripe-setup.js +61 -0
- package/dist/substitutions.generated.js +187 -29
- package/dist/verifone.d.ts +68 -0
- package/dist/verifone.generated.d.ts +51 -0
- package/dist/verifone.generated.js +1401 -0
- package/dist/verifone.js +119 -0
- package/dist/voice-types.d.ts +27 -0
- package/dist/voice.d.ts +6 -1
- package/dist/voice.js +6 -1
- package/dist/wspay.d.ts +41 -0
- package/dist/wspay.generated.d.ts +41 -0
- package/dist/wspay.generated.js +370 -0
- package/dist/wspay.js +65 -0
- package/examples/preflight/kernel-native/inventory.json +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/** The processor id, as the registry and the API name it. */
|
|
2
|
+
export declare const EPROTECT_PSP = "worldpay_eprotect";
|
|
3
|
+
/** The dark-launch capability the API serves the eProtect recognizer behind (payment-core definitions.js). */
|
|
4
|
+
export declare const EPROTECT_CAPABILITY = "worldpay_eprotect_jsonp";
|
|
5
|
+
/** What Worldpay answers a registration with on both of its card hosts, and what the paused script gets. */
|
|
6
|
+
export declare const EPROTECT_SCRIPT_CONTENT_TYPE = "application/x-javascript;charset=UTF-8";
|
|
7
|
+
/** A reviewed production Worldpay merchant, as payment-core pins it (EPROTECT_MERCHANT_PINS). */
|
|
8
|
+
export interface EprotectMerchantPin {
|
|
9
|
+
id: string;
|
|
10
|
+
merchant: string;
|
|
11
|
+
origins: readonly string[];
|
|
12
|
+
paypageIds: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Why a Worldpay eProtect checkout may not be prepared under `merchant`, or null when it may. On the
|
|
16
|
+
* production host the API admits only a paypageId payment-core pins for the merchant origin, under
|
|
17
|
+
* that pin's merchant name, the one the approval shows, and refuses another name
|
|
18
|
+
* (merchant_profile_mismatch) before any preparation exists. When this build pins the paypageId
|
|
19
|
+
* too, it refuses another name first, before any network call, as a Fiserv checkout must name its
|
|
20
|
+
* key pin's merchant. A paypageId this build does not pin is the API's to judge (unsupported_checkout
|
|
21
|
+
* with no pin); none is pinned on either side yet. The pre-live host takes only the guide's test
|
|
22
|
+
* cards and needs no pin. `pins` is for tests.
|
|
23
|
+
*/
|
|
24
|
+
export declare function eprotectCheckoutRefusal(input: {
|
|
25
|
+
environment: string;
|
|
26
|
+
paypageId: string;
|
|
27
|
+
merchantOrigin: string;
|
|
28
|
+
merchant: string;
|
|
29
|
+
}, pins?: readonly EprotectMerchantPin[]): 'merchant_profile_mismatch' | null;
|
|
30
|
+
/** The attempt a registration, a re-send or a give-up report belongs to: the merchant's paypageId and the page's own id. */
|
|
31
|
+
export interface EprotectAttempt {
|
|
32
|
+
paypageId: string;
|
|
33
|
+
id: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* What a request on Worldpay eProtect's hosts is, for an attachment:
|
|
37
|
+
* registration the vendor's new-card registration GET, the only card request;
|
|
38
|
+
* failover the vendor's re-send of a registration (targetServer=secondary);
|
|
39
|
+
* give_up the vendor's /eProtect/ppstats report that the merchant's timeout passed with no answer;
|
|
40
|
+
* unsupported any other request on /eProtect/paypage: a variant (CVV only, PIN, wallets, private
|
|
41
|
+
* label), the native-app Mobile API form post, another method or a malformed query;
|
|
42
|
+
* sibling everything else on those hosts: the scripts, the payframe, other ppstats reports.
|
|
43
|
+
*/
|
|
44
|
+
export type EprotectRequest = ({
|
|
45
|
+
kind: 'registration';
|
|
46
|
+
} & EprotectAttempt) | ({
|
|
47
|
+
kind: 'failover';
|
|
48
|
+
} & EprotectAttempt) | ({
|
|
49
|
+
kind: 'give_up';
|
|
50
|
+
code: '900' | '901';
|
|
51
|
+
} & EprotectAttempt) | {
|
|
52
|
+
kind: 'unsupported';
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'sibling';
|
|
55
|
+
};
|
|
56
|
+
/** Which eProtect request this is, or null for a URL that is not on one of Worldpay eProtect's hosts. */
|
|
57
|
+
export declare function classifyEprotectRequest(url: string, method: string): EprotectRequest | null;
|
|
58
|
+
/** The registration GET exactly as payment-core admits it: its URL alone, with no body. */
|
|
59
|
+
export declare function isEprotectRegistration(request: {
|
|
60
|
+
url: string;
|
|
61
|
+
method?: string;
|
|
62
|
+
body?: string | null;
|
|
63
|
+
}): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The answer a paused registration script gets, or null when the stored answer is not one to hand
|
|
66
|
+
* the page: Worldpay's own shape, `<callback>(<registration>)` under its script type, with the
|
|
67
|
+
* callback the paused URL named. The registration must be one payment-core's judge accepts for that
|
|
68
|
+
* exact URL (response 870, the page's own id, only allowlisted fields), byte for byte what the API
|
|
69
|
+
* stored after running the same judge.
|
|
70
|
+
*/
|
|
71
|
+
export declare function eprotectScriptAnswer(templateUrl: string, response: {
|
|
72
|
+
status: number;
|
|
73
|
+
body: string;
|
|
74
|
+
}): {
|
|
75
|
+
status: 200;
|
|
76
|
+
headers: Record<string, string>;
|
|
77
|
+
body: string;
|
|
78
|
+
} | null;
|
|
79
|
+
/**
|
|
80
|
+
* How long a paused registration's re-send is still recognized as a known repeat. The vendor
|
|
81
|
+
* scripts re-send 5 seconds after an unanswered primary and give up at the merchant's own timeout
|
|
82
|
+
* (10 to 15 seconds at the merchants this SDK covers), so a minute leaves room for a timer a busy
|
|
83
|
+
* page delays. A re-send that comes later still is aborted all the same, as unsupported (pre-claim).
|
|
84
|
+
*/
|
|
85
|
+
export declare const EPROTECT_REPEAT_WINDOW_MS = 60000;
|
|
86
|
+
/** At most this many paused registrations are remembered at once; the oldest is forgotten first. */
|
|
87
|
+
export declare const EPROTECT_REPEAT_LIMIT = 64;
|
|
88
|
+
/**
|
|
89
|
+
* One attachment's eProtect state. A failover re-send or a give-up report names a registration by
|
|
90
|
+
* paypageId and id; each is matched against what this attachment itself paused and answered, never
|
|
91
|
+
* taken on the page's word. Inert (classify returns null) until the registry serves eProtect, which
|
|
92
|
+
* a client reaches only by syncing with the capability for an org the API enabled, so a build, an
|
|
93
|
+
* org or an API that never served it leaves every eProtect request exactly as before.
|
|
94
|
+
*/
|
|
95
|
+
export declare class EprotectGate {
|
|
96
|
+
private readonly vault;
|
|
97
|
+
private readonly now;
|
|
98
|
+
/** Paused registrations, oldest first, each with the time its re-send window closes. */
|
|
99
|
+
private readonly seen;
|
|
100
|
+
private running;
|
|
101
|
+
private answered;
|
|
102
|
+
constructor(vault: {
|
|
103
|
+
recognizesProcessor?: (psp: string) => boolean;
|
|
104
|
+
} | undefined, now?: () => number);
|
|
105
|
+
/** What this request is, when the registry serves eProtect and the URL is on its hosts; null leaves it to the other gates. */
|
|
106
|
+
classify(url: string, method: string): EprotectRequest | null;
|
|
107
|
+
/** Playwright's route predicate sees only the URL: route the registration family and the give-up reports, never the scripts. */
|
|
108
|
+
matches(url: string): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* The page sent this registration and this attachment paused it: its re-send is then a known
|
|
111
|
+
* repeat for EPROTECT_REPEAT_WINDOW_MS. Seeing it again restarts that window. A long-lived
|
|
112
|
+
* attachment keeps at most EPROTECT_REPEAT_LIMIT of them, so repeated attempts never grow it.
|
|
113
|
+
*/
|
|
114
|
+
saw(attempt: EprotectAttempt): void;
|
|
115
|
+
/** Drops every registration whose re-send window closed: the map is in window order. */
|
|
116
|
+
private forgetBefore;
|
|
117
|
+
/**
|
|
118
|
+
* A re-send of a registration this attachment paused, whether its approval is running, answered,
|
|
119
|
+
* or never started. The vendor script re-sends 5 seconds after an unanswered primary and has no
|
|
120
|
+
* error path, so a primary the adapters refused before any approval (no ready preparation, another
|
|
121
|
+
* paypageId, an approval already outstanding) or answered just as that timer fired is re-sent
|
|
122
|
+
* too. Such a re-send is aborted quietly, like one during the approval, and never replaces that
|
|
123
|
+
* refusal's own state with `unsupported`. A re-send of a registration this attachment never paused
|
|
124
|
+
* means the primary went somewhere it does not cover, and pre-claim aborts that one as unsupported.
|
|
125
|
+
* Both carry the placeholder's ciphertext, and both are aborted. A registration is remembered
|
|
126
|
+
* only for its re-send window (saw).
|
|
127
|
+
*/
|
|
128
|
+
repeats(attempt: EprotectAttempt): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* An approval is running for this paused request, when it is a registration; `stop` ends it as the
|
|
131
|
+
* page abandoning its request. A new attempt also retires the last answered registration: a
|
|
132
|
+
* give-up report for it now belongs to a checkout the lifecycle has moved past, and must not end
|
|
133
|
+
* the attempt that just began (see gaveUp).
|
|
134
|
+
*/
|
|
135
|
+
begin(url: string, method: string, stop: () => void): void;
|
|
136
|
+
/**
|
|
137
|
+
* The approval's answer reached this registration; `lost` reports that the page had already given
|
|
138
|
+
* up on it. Kept after the attempt ends, since the vendor's report can land just after the answer,
|
|
139
|
+
* and only until the next attempt begins.
|
|
140
|
+
*/
|
|
141
|
+
delivered(url: string, lost: () => void): void;
|
|
142
|
+
/** The approval for the paused request ended, answered or not. */
|
|
143
|
+
end(): void;
|
|
144
|
+
/**
|
|
145
|
+
* The vendor's give-up report: end the approval still running for that registration (the
|
|
146
|
+
* adapter cancels the authorization, which the API confirms only before the device registered
|
|
147
|
+
* the card, and aborts the paused script instead of answering it), or report that the answer
|
|
148
|
+
* already handed to it came too late. Returns which one, or null when the report names neither,
|
|
149
|
+
* including a registration answered before the current attempt began.
|
|
150
|
+
*/
|
|
151
|
+
gaveUp(attempt: EprotectAttempt): 'running' | 'answered' | null;
|
|
152
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
declare var EPROTECT_PATH: string;
|
|
2
|
+
declare var EPROTECT_HOSTS: Readonly<{
|
|
3
|
+
production: "request.eprotect.vantivcnp.com";
|
|
4
|
+
sandbox: "request.eprotect.vantivprelive.com";
|
|
5
|
+
}>;
|
|
6
|
+
declare var EPROTECT_SECONDARY_HOST: string;
|
|
7
|
+
declare var EPROTECT_KEYS: Readonly<{
|
|
8
|
+
production: Readonly<{
|
|
9
|
+
keyId: "26455500012";
|
|
10
|
+
exponent: "10001";
|
|
11
|
+
modulus: "b9c7095ff203475347a932a6e11bacbb61cfb66a877158683634e5fb1dbf9923401bd7f82c21b67ffd3c82bdc64797c5e2ba4b57c68b1aaccb7fbe847da7234a21df910dfcc0aebacbbd4d36b35c0c35f7ee27358610d2e2fb2aa87d359deda0b5f4d77e31ac5ab98741da5b6052cb657087da05ad496154b8954939ee6fd463301ff15ebca94f210f4627a255a95ca8833728c1ab80b6cc3a874e4d3dce5d40f66c043ba1b042717bb9cc5d89434fa489a51c2ba9a3843b310df58c9e8a54c36cdd5fd66e76651b6fc88850b60e0739abfcf7d0d0cb44beb7e768da3bcea7e743b8c2d57edef59643f54432ccf60c49d4f5f84410ecf9c5a7af19bc5e792801";
|
|
12
|
+
}>;
|
|
13
|
+
sandbox: Readonly<{
|
|
14
|
+
keyId: "1";
|
|
15
|
+
exponent: "10001";
|
|
16
|
+
modulus: "bc637dd74ba76507dad5af1c7ad6f97dbef5298c3b9f74caea7301347db7b4a8c37f26491863100667246fd45071f3346bf62239f9b117d06fb67861b66ad0d158beeddd2f6f28be93d846f4c8f9ba1bd7e8f186f36cab0e432f22b3d732c221a9ff00a9bfacb88b24503e2695fd7237835d4936477b21289478906a49b164f52503c20eb29f11fcbda2af94deb9a0bfde5a4589276897436315c5d664d60bf10650164f509283aed39747ad5d6cb2bbe54e1b42306e5db37dfd42dcbfcc689e0ddfe3bc9cb22ae7018e5a4a1ff39813584ac7bd6d6d65ca763f0a672da454081ea20e8b1d403316d80b9353ba396bea8962b1a7d2f775c76612d857c1f7594f";
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
declare var EPROTECT_TEST_PANS: Readonly<Set<unknown>>;
|
|
20
|
+
declare var EPROTECT_REFUSAL_CODES: readonly string[];
|
|
21
|
+
declare function eprotectEnvironment(hostname: any): "production" | "sandbox" | null;
|
|
22
|
+
declare function eprotectPreparationUrl(environment: any): string;
|
|
23
|
+
declare function isEprotectTokenRequest(url: any, method: any): boolean;
|
|
24
|
+
declare function isEprotectRequest(request: any): boolean;
|
|
25
|
+
declare function eprotectRequestFacts(url: any): {
|
|
26
|
+
environment: string;
|
|
27
|
+
paypageId: any;
|
|
28
|
+
id: any;
|
|
29
|
+
orderId: any;
|
|
30
|
+
reportGroup: any;
|
|
31
|
+
callback: any;
|
|
32
|
+
cvv: boolean;
|
|
33
|
+
} | null;
|
|
34
|
+
declare function eprotectSecondaryAttempt(url: any): {
|
|
35
|
+
paypageId: any;
|
|
36
|
+
id: any;
|
|
37
|
+
} | null;
|
|
38
|
+
declare function isEprotectDeviceRequest(templateUrl: any, deviceUrl: any): boolean;
|
|
39
|
+
declare function isPreparedEprotectRequest(url: any, method: any, body: any, environment: any, paypageId: any): boolean;
|
|
40
|
+
declare var EPROTECT_MERCHANT_PINS: any;
|
|
41
|
+
declare function eprotectMerchantPin(paypageId: any, merchantOrigin: any, pins?: any): any;
|
|
42
|
+
declare function eprotectMerchantRefusal(environment: any, paypageId: any, merchantOrigin: any, pins?: any): "invalid_paypage_id" | "unsupported_environment" | "eprotect_merchant_unreviewed" | null;
|
|
43
|
+
declare function defaultRandom(bytes: any): void;
|
|
44
|
+
declare function eprotectEncrypt(text: any, key: any, random?: typeof defaultRandom): string;
|
|
45
|
+
declare function eprotectCardRefusal(environment: any, cardNumber: any): "unsupported_environment" | "sandbox_host_requires_documented_test_card" | "invalid_card_number" | "live_host_refuses_documented_test_card" | null;
|
|
46
|
+
declare function eprotectDeviceRequest(templateUrl: any, card: any, random?: typeof defaultRandom): {
|
|
47
|
+
url: string;
|
|
48
|
+
method: string;
|
|
49
|
+
headers: {};
|
|
50
|
+
body: string;
|
|
51
|
+
where: string[];
|
|
52
|
+
};
|
|
53
|
+
declare function eprotectOutcome(status: any, bodyText: any, templateUrl: any, card: any): {
|
|
54
|
+
outcome: string;
|
|
55
|
+
reason: string;
|
|
56
|
+
code?: undefined;
|
|
57
|
+
sanitizedJson?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
outcome: string;
|
|
60
|
+
code: any;
|
|
61
|
+
reason?: undefined;
|
|
62
|
+
sanitizedJson?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
outcome: string;
|
|
65
|
+
sanitizedJson: string;
|
|
66
|
+
reason?: undefined;
|
|
67
|
+
code?: undefined;
|
|
68
|
+
};
|
|
69
|
+
declare function sanitizeEprotectRegistration(bodyText: any, templateUrl: any): string | undefined;
|
|
70
|
+
declare function eprotectJsonp(callback: any, json: any): string;
|
|
71
|
+
declare function eprotectGiveUp(url: any): {
|
|
72
|
+
paypageId: any;
|
|
73
|
+
txnId: any;
|
|
74
|
+
code: any;
|
|
75
|
+
} | null;
|
|
76
|
+
declare function eprotectRefusalCode(bodyText: any): any;
|
|
77
|
+
export { EPROTECT_HOSTS, EPROTECT_KEYS, EPROTECT_MERCHANT_PINS, EPROTECT_PATH, EPROTECT_REFUSAL_CODES, EPROTECT_SECONDARY_HOST, EPROTECT_TEST_PANS, eprotectCardRefusal, eprotectDeviceRequest, eprotectEncrypt, eprotectEnvironment, eprotectGiveUp, eprotectJsonp, eprotectMerchantPin, eprotectMerchantRefusal, eprotectOutcome, eprotectPreparationUrl, eprotectRefusalCode, eprotectRequestFacts, eprotectSecondaryAttempt, isEprotectDeviceRequest, isEprotectRequest, isEprotectTokenRequest, isPreparedEprotectRequest, sanitizeEprotectRegistration };
|