@atbas/m-mcp 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 +364 -0
- package/dist/builder/transaction-builder.d.ts +53 -0
- package/dist/builder/transaction-builder.d.ts.map +1 -0
- package/dist/builder/transaction-builder.js +159 -0
- package/dist/builder/transaction-builder.js.map +1 -0
- package/dist/catalogue/default-catalogue.d.ts +18 -0
- package/dist/catalogue/default-catalogue.d.ts.map +1 -0
- package/dist/catalogue/default-catalogue.js +21 -0
- package/dist/catalogue/default-catalogue.js.map +1 -0
- package/dist/catalogue/endpoints.d.ts +22 -0
- package/dist/catalogue/endpoints.d.ts.map +1 -0
- package/dist/catalogue/endpoints.js +24 -0
- package/dist/catalogue/endpoints.js.map +1 -0
- package/dist/catalogue/flows.d.ts +32 -0
- package/dist/catalogue/flows.d.ts.map +1 -0
- package/dist/catalogue/flows.js +64 -0
- package/dist/catalogue/flows.js.map +1 -0
- package/dist/catalogue/hash-options.d.ts +112 -0
- package/dist/catalogue/hash-options.d.ts.map +1 -0
- package/dist/catalogue/hash-options.js +151 -0
- package/dist/catalogue/hash-options.js.map +1 -0
- package/dist/catalogue/types.d.ts +279 -0
- package/dist/catalogue/types.d.ts.map +1 -0
- package/dist/catalogue/types.js +360 -0
- package/dist/catalogue/types.js.map +1 -0
- package/dist/codegen/generate.d.ts +14 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/generate.js +490 -0
- package/dist/codegen/generate.js.map +1 -0
- package/dist/codegen/languages/node.d.ts +3 -0
- package/dist/codegen/languages/node.d.ts.map +1 -0
- package/dist/codegen/languages/node.js +32 -0
- package/dist/codegen/languages/node.js.map +1 -0
- package/dist/codegen/languages/php.d.ts +3 -0
- package/dist/codegen/languages/php.d.ts.map +1 -0
- package/dist/codegen/languages/php.js +27 -0
- package/dist/codegen/languages/php.js.map +1 -0
- package/dist/codegen/languages/python.d.ts +3 -0
- package/dist/codegen/languages/python.d.ts.map +1 -0
- package/dist/codegen/languages/python.js +27 -0
- package/dist/codegen/languages/python.js.map +1 -0
- package/dist/codegen/renderer.d.ts +24 -0
- package/dist/codegen/renderer.d.ts.map +1 -0
- package/dist/codegen/renderer.js +59 -0
- package/dist/codegen/renderer.js.map +1 -0
- package/dist/codegen/types.d.ts +50 -0
- package/dist/codegen/types.d.ts.map +1 -0
- package/dist/codegen/types.js +5 -0
- package/dist/codegen/types.js.map +1 -0
- package/dist/config/credentials.d.ts +64 -0
- package/dist/config/credentials.d.ts.map +1 -0
- package/dist/config/credentials.js +216 -0
- package/dist/config/credentials.js.map +1 -0
- package/dist/config/environment.d.ts +23 -0
- package/dist/config/environment.d.ts.map +1 -0
- package/dist/config/environment.js +54 -0
- package/dist/config/environment.js.map +1 -0
- package/dist/core/dependencies.d.ts +43 -0
- package/dist/core/dependencies.d.ts.map +1 -0
- package/dist/core/dependencies.js +2 -0
- package/dist/core/dependencies.js.map +1 -0
- package/dist/core/registry.d.ts +33 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +13 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/server.d.ts +61 -0
- package/dist/core/server.d.ts.map +1 -0
- package/dist/core/server.js +90 -0
- package/dist/core/server.js.map +1 -0
- package/dist/dependencies.d.ts +28 -0
- package/dist/dependencies.d.ts.map +1 -0
- package/dist/dependencies.js +2 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/diagnostics/diagnose.d.ts +43 -0
- package/dist/diagnostics/diagnose.d.ts.map +1 -0
- package/dist/diagnostics/diagnose.js +121 -0
- package/dist/diagnostics/diagnose.js.map +1 -0
- package/dist/domain/amount.d.ts +157 -0
- package/dist/domain/amount.d.ts.map +1 -0
- package/dist/domain/amount.js +275 -0
- package/dist/domain/amount.js.map +1 -0
- package/dist/domain/datetime.d.ts +95 -0
- package/dist/domain/datetime.d.ts.map +1 -0
- package/dist/domain/datetime.js +211 -0
- package/dist/domain/datetime.js.map +1 -0
- package/dist/domain/response-codes.d.ts +116 -0
- package/dist/domain/response-codes.d.ts.map +1 -0
- package/dist/domain/response-codes.js +380 -0
- package/dist/domain/response-codes.js.map +1 -0
- package/dist/domain/secure-hash.d.ts +78 -0
- package/dist/domain/secure-hash.d.ts.map +1 -0
- package/dist/domain/secure-hash.js +69 -0
- package/dist/domain/secure-hash.js.map +1 -0
- package/dist/domain/signature/jazzcash.d.ts +56 -0
- package/dist/domain/signature/jazzcash.d.ts.map +1 -0
- package/dist/domain/signature/jazzcash.js +214 -0
- package/dist/domain/signature/jazzcash.js.map +1 -0
- package/dist/domain/signature/registry.d.ts +69 -0
- package/dist/domain/signature/registry.d.ts.map +1 -0
- package/dist/domain/signature/registry.js +92 -0
- package/dist/domain/signature/registry.js.map +1 -0
- package/dist/domain/signature/scheme.d.ts +349 -0
- package/dist/domain/signature/scheme.d.ts.map +1 -0
- package/dist/domain/signature/scheme.js +398 -0
- package/dist/domain/signature/scheme.js.map +1 -0
- package/dist/domain/txn-ref.d.ts +76 -0
- package/dist/domain/txn-ref.d.ts.map +1 -0
- package/dist/domain/txn-ref.js +126 -0
- package/dist/domain/txn-ref.js.map +1 -0
- package/dist/domain/types.d.ts +45 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/domain/types.js +70 -0
- package/dist/domain/types.js.map +1 -0
- package/dist/errors.d.ts +84 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +87 -0
- package/dist/errors.js.map +1 -0
- package/dist/gateway/checkout-form.d.ts +16 -0
- package/dist/gateway/checkout-form.d.ts.map +1 -0
- package/dist/gateway/checkout-form.js +103 -0
- package/dist/gateway/checkout-form.js.map +1 -0
- package/dist/gateway/checkout-output.d.ts +70 -0
- package/dist/gateway/checkout-output.d.ts.map +1 -0
- package/dist/gateway/checkout-output.js +199 -0
- package/dist/gateway/checkout-output.js.map +1 -0
- package/dist/gateway/guards.d.ts +37 -0
- package/dist/gateway/guards.d.ts.map +1 -0
- package/dist/gateway/guards.js +44 -0
- package/dist/gateway/guards.js.map +1 -0
- package/dist/gateway/http-client.d.ts +42 -0
- package/dist/gateway/http-client.d.ts.map +1 -0
- package/dist/gateway/http-client.js +153 -0
- package/dist/gateway/http-client.js.map +1 -0
- package/dist/gateway/rest-client.d.ts +42 -0
- package/dist/gateway/rest-client.d.ts.map +1 -0
- package/dist/gateway/rest-client.js +241 -0
- package/dist/gateway/rest-client.js.map +1 -0
- package/dist/gateway/transport.d.ts +31 -0
- package/dist/gateway/transport.d.ts.map +1 -0
- package/dist/gateway/transport.js +73 -0
- package/dist/gateway/transport.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/install/cli.d.ts +38 -0
- package/dist/install/cli.d.ts.map +1 -0
- package/dist/install/cli.js +274 -0
- package/dist/install/cli.js.map +1 -0
- package/dist/install/harnesses.d.ts +74 -0
- package/dist/install/harnesses.d.ts.map +1 -0
- package/dist/install/harnesses.js +263 -0
- package/dist/install/harnesses.js.map +1 -0
- package/dist/knowledge/corpus.d.ts +15 -0
- package/dist/knowledge/corpus.d.ts.map +1 -0
- package/dist/knowledge/corpus.js +129 -0
- package/dist/knowledge/corpus.js.map +1 -0
- package/dist/knowledge/search.d.ts +29 -0
- package/dist/knowledge/search.d.ts.map +1 -0
- package/dist/knowledge/search.js +181 -0
- package/dist/knowledge/search.js.map +1 -0
- package/dist/knowledge/source.d.ts +60 -0
- package/dist/knowledge/source.d.ts.map +1 -0
- package/dist/knowledge/source.js +91 -0
- package/dist/knowledge/source.js.map +1 -0
- package/dist/knowledge/types.d.ts +40 -0
- package/dist/knowledge/types.d.ts.map +1 -0
- package/dist/knowledge/types.js +19 -0
- package/dist/knowledge/types.js.map +1 -0
- package/dist/paths.d.ts +26 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +106 -0
- package/dist/paths.js.map +1 -0
- package/dist/prompts/integration-walkthrough.d.ts +11 -0
- package/dist/prompts/integration-walkthrough.d.ts.map +1 -0
- package/dist/prompts/integration-walkthrough.js +52 -0
- package/dist/prompts/integration-walkthrough.js.map +1 -0
- package/dist/prompts/register.d.ts +4 -0
- package/dist/prompts/register.d.ts.map +1 -0
- package/dist/prompts/register.js +4 -0
- package/dist/prompts/register.js.map +1 -0
- package/dist/registry.d.ts +14 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -0
- package/dist/resources/knowledge-resources.d.ts +5 -0
- package/dist/resources/knowledge-resources.d.ts.map +1 -0
- package/dist/resources/knowledge-resources.js +121 -0
- package/dist/resources/knowledge-resources.js.map +1 -0
- package/dist/resources/register.d.ts +4 -0
- package/dist/resources/register.d.ts.map +1 -0
- package/dist/resources/register.js +8 -0
- package/dist/resources/register.js.map +1 -0
- package/dist/server.d.ts +40 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +56 -0
- package/dist/server.js.map +1 -0
- package/dist/telemetry/logger.d.ts +31 -0
- package/dist/telemetry/logger.d.ts.map +1 -0
- package/dist/telemetry/logger.js +67 -0
- package/dist/telemetry/logger.js.map +1 -0
- package/dist/telemetry/redaction.d.ts +88 -0
- package/dist/telemetry/redaction.d.ts.map +1 -0
- package/dist/telemetry/redaction.js +238 -0
- package/dist/telemetry/redaction.js.map +1 -0
- package/dist/tools/build-transaction-parameters.d.ts +10 -0
- package/dist/tools/build-transaction-parameters.d.ts.map +1 -0
- package/dist/tools/build-transaction-parameters.js +154 -0
- package/dist/tools/build-transaction-parameters.js.map +1 -0
- package/dist/tools/call-context.d.ts +47 -0
- package/dist/tools/call-context.d.ts.map +1 -0
- package/dist/tools/call-context.js +15 -0
- package/dist/tools/call-context.js.map +1 -0
- package/dist/tools/codegen-tools.d.ts +4 -0
- package/dist/tools/codegen-tools.d.ts.map +1 -0
- package/dist/tools/codegen-tools.js +131 -0
- package/dist/tools/codegen-tools.js.map +1 -0
- package/dist/tools/credential-tools.d.ts +32 -0
- package/dist/tools/credential-tools.d.ts.map +1 -0
- package/dist/tools/credential-tools.js +65 -0
- package/dist/tools/credential-tools.js.map +1 -0
- package/dist/tools/descriptor.d.ts +52 -0
- package/dist/tools/descriptor.d.ts.map +1 -0
- package/dist/tools/descriptor.js +2 -0
- package/dist/tools/descriptor.js.map +1 -0
- package/dist/tools/diagnostic-tools.d.ts +3 -0
- package/dist/tools/diagnostic-tools.d.ts.map +1 -0
- package/dist/tools/diagnostic-tools.js +128 -0
- package/dist/tools/diagnostic-tools.js.map +1 -0
- package/dist/tools/gateway-tools.d.ts +6 -0
- package/dist/tools/gateway-tools.d.ts.map +1 -0
- package/dist/tools/gateway-tools.js +381 -0
- package/dist/tools/gateway-tools.js.map +1 -0
- package/dist/tools/hash-tools.d.ts +5 -0
- package/dist/tools/hash-tools.d.ts.map +1 -0
- package/dist/tools/hash-tools.js +238 -0
- package/dist/tools/hash-tools.js.map +1 -0
- package/dist/tools/knowledge-tools.d.ts +7 -0
- package/dist/tools/knowledge-tools.d.ts.map +1 -0
- package/dist/tools/knowledge-tools.js +247 -0
- package/dist/tools/knowledge-tools.js.map +1 -0
- package/dist/tools/onboarding-checklist.d.ts +3 -0
- package/dist/tools/onboarding-checklist.d.ts.map +1 -0
- package/dist/tools/onboarding-checklist.js +141 -0
- package/dist/tools/onboarding-checklist.js.map +1 -0
- package/dist/tools/register.d.ts +60 -0
- package/dist/tools/register.d.ts.map +1 -0
- package/dist/tools/register.js +145 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/tools/tool-kit.d.ts +88 -0
- package/dist/tools/tool-kit.d.ts.map +1 -0
- package/dist/tools/tool-kit.js +297 -0
- package/dist/tools/tool-kit.js.map +1 -0
- package/dist/validation/payload-validator.d.ts +29 -0
- package/dist/validation/payload-validator.d.ts.map +1 -0
- package/dist/validation/payload-validator.js +79 -0
- package/dist/validation/payload-validator.js.map +1 -0
- package/dist/validation/rules/amount.d.ts +3 -0
- package/dist/validation/rules/amount.d.ts.map +1 -0
- package/dist/validation/rules/amount.js +77 -0
- package/dist/validation/rules/amount.js.map +1 -0
- package/dist/validation/rules/bill-reference.d.ts +10 -0
- package/dist/validation/rules/bill-reference.d.ts.map +1 -0
- package/dist/validation/rules/bill-reference.js +34 -0
- package/dist/validation/rules/bill-reference.js.map +1 -0
- package/dist/validation/rules/cnic.d.ts +3 -0
- package/dist/validation/rules/cnic.d.ts.map +1 -0
- package/dist/validation/rules/cnic.js +42 -0
- package/dist/validation/rules/cnic.js.map +1 -0
- package/dist/validation/rules/constants.d.ts +9 -0
- package/dist/validation/rules/constants.d.ts.map +1 -0
- package/dist/validation/rules/constants.js +28 -0
- package/dist/validation/rules/constants.js.map +1 -0
- package/dist/validation/rules/constraints.d.ts +3 -0
- package/dist/validation/rules/constraints.d.ts.map +1 -0
- package/dist/validation/rules/constraints.js +113 -0
- package/dist/validation/rules/constraints.js.map +1 -0
- package/dist/validation/rules/datetime.d.ts +3 -0
- package/dist/validation/rules/datetime.d.ts.map +1 -0
- package/dist/validation/rules/datetime.js +49 -0
- package/dist/validation/rules/datetime.js.map +1 -0
- package/dist/validation/rules/empty-string.d.ts +13 -0
- package/dist/validation/rules/empty-string.d.ts.map +1 -0
- package/dist/validation/rules/empty-string.js +32 -0
- package/dist/validation/rules/empty-string.js.map +1 -0
- package/dist/validation/rules/expiry.d.ts +3 -0
- package/dist/validation/rules/expiry.d.ts.map +1 -0
- package/dist/validation/rules/expiry.js +52 -0
- package/dist/validation/rules/expiry.js.map +1 -0
- package/dist/validation/rules/msisdn.d.ts +3 -0
- package/dist/validation/rules/msisdn.d.ts.map +1 -0
- package/dist/validation/rules/msisdn.js +45 -0
- package/dist/validation/rules/msisdn.js.map +1 -0
- package/dist/validation/rules/presence.d.ts +3 -0
- package/dist/validation/rules/presence.d.ts.map +1 -0
- package/dist/validation/rules/presence.js +90 -0
- package/dist/validation/rules/presence.js.map +1 -0
- package/dist/validation/rules/return-url.d.ts +14 -0
- package/dist/validation/rules/return-url.d.ts.map +1 -0
- package/dist/validation/rules/return-url.js +58 -0
- package/dist/validation/rules/return-url.js.map +1 -0
- package/dist/validation/rules/tool-argument.d.ts +16 -0
- package/dist/validation/rules/tool-argument.d.ts.map +1 -0
- package/dist/validation/rules/tool-argument.js +38 -0
- package/dist/validation/rules/tool-argument.js.map +1 -0
- package/dist/validation/rules/txn-ref.d.ts +3 -0
- package/dist/validation/rules/txn-ref.d.ts.map +1 -0
- package/dist/validation/rules/txn-ref.js +47 -0
- package/dist/validation/rules/txn-ref.js.map +1 -0
- package/dist/validation/rules/unknown-fields.d.ts +10 -0
- package/dist/validation/rules/unknown-fields.d.ts.map +1 -0
- package/dist/validation/rules/unknown-fields.js +29 -0
- package/dist/validation/rules/unknown-fields.js.map +1 -0
- package/dist/validation/types.d.ts +36 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/types.js +12 -0
- package/dist/validation/types.js.map +1 -0
- package/dist/version.d.ts +23 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +23 -0
- package/dist/version.js.map +1 -0
- package/knowledge/diagnostics/symptoms.json +321 -0
- package/knowledge/docs/bnpl-guide.md +77 -0
- package/knowledge/docs/card-page-redirection.md +67 -0
- package/knowledge/docs/card-refund.md +91 -0
- package/knowledge/docs/hmac-sha256-calculation.md +72 -0
- package/knowledge/docs/index.json +189 -0
- package/knowledge/docs/ipn-implementation.md +89 -0
- package/knowledge/docs/mwallet-recurring.md +117 -0
- package/knowledge/docs/mwallet-refund.md +65 -0
- package/knowledge/docs/mwallet-rest-v1-1.md +126 -0
- package/knowledge/docs/mwallet-rest-v2-0-cnic.md +113 -0
- package/knowledge/docs/portal-guide.md +45 -0
- package/knowledge/docs/shopify-guide.md +74 -0
- package/knowledge/docs/status-inquiry-2025-26.md +32 -0
- package/knowledge/docs/status-inquiry.md +111 -0
- package/knowledge/docs/wordpress-guide.md +49 -0
- package/knowledge/flow.schema.json +390 -0
- package/knowledge/flows/bnpl-page-redirection-v1.1.json +211 -0
- package/knowledge/flows/card-page-redirection-v1.1.json +211 -0
- package/knowledge/flows/mwallet-rest-v1.1.json +187 -0
- package/knowledge/flows/mwallet-rest-v2.0-cnic.json +197 -0
- package/knowledge/flows/mwallet-token-pay-v4.0.json +130 -0
- package/knowledge/flows/refund-bnpl.json +105 -0
- package/knowledge/flows/refund-card-v1.1.json +112 -0
- package/knowledge/flows/refund-card-v2.0.json +121 -0
- package/knowledge/flows/refund-mwallet-v1.1.json +106 -0
- package/knowledge/flows/status-inquiry-v1.1.json +102 -0
- package/knowledge/flows/status-inquiry-v2.0.json +103 -0
- package/knowledge/flows/token-delete-v1.json +85 -0
- package/knowledge/flows/token-inquiry-v1.json +85 -0
- package/knowledge/flows/wallet-linking-portal.json +103 -0
- package/knowledge/templates/node/checkout-redirect.tmpl +166 -0
- package/knowledge/templates/node/ipn-handler.tmpl +108 -0
- package/knowledge/templates/node/rest-client.tmpl +197 -0
- package/knowledge/templates/node/wallet-linking.tmpl +147 -0
- package/knowledge/templates/php/checkout-redirect.tmpl +149 -0
- package/knowledge/templates/php/ipn-handler.tmpl +105 -0
- package/knowledge/templates/php/rest-client.tmpl +191 -0
- package/knowledge/templates/php/wallet-linking.tmpl +137 -0
- package/knowledge/templates/python/checkout-redirect.tmpl +148 -0
- package/knowledge/templates/python/ipn-handler.tmpl +110 -0
- package/knowledge/templates/python/rest-client.tmpl +179 -0
- package/knowledge/templates/python/wallet-linking.tmpl +133 -0
- package/package.json +84 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Machine-readable description of one payment-integration flow.
|
|
4
|
+
*
|
|
5
|
+
* Every flow in `knowledge/flows/` is a faithful transcription of a single
|
|
6
|
+
* official guide. The schema is the contract between the corpus and the code:
|
|
7
|
+
* validation, code generation and gateway execution all read from it, so a
|
|
8
|
+
* correction from the provider is a data change rather than a code change.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Payment providers whose flows the catalogue can describe.
|
|
12
|
+
*
|
|
13
|
+
* A closed set rather than a free string: a mistyped provider would otherwise
|
|
14
|
+
* create a one-flow provider of its own, and every provider-scoped rule —
|
|
15
|
+
* signature scheme, endpoint checks, response contract — would silently decline
|
|
16
|
+
* to apply to it.
|
|
17
|
+
*
|
|
18
|
+
* One member today, and the enumeration is kept rather than collapsed into a
|
|
19
|
+
* literal: every flow file declares `provider` explicitly, and a single-member
|
|
20
|
+
* enum makes adding a second one a deliberate schema change rather than a
|
|
21
|
+
* string somebody can mistype into existence.
|
|
22
|
+
*/
|
|
23
|
+
export declare const PROVIDERS: readonly ["jazzcash"];
|
|
24
|
+
export declare const PRODUCTS: readonly ["card", "bnpl", "mwallet", "wallet-linking", "token", "status-inquiry", "refund"];
|
|
25
|
+
/**
|
|
26
|
+
* How a flow is performed.
|
|
27
|
+
*
|
|
28
|
+
* - `rest` — a server-to-server JSON POST this server can execute headlessly.
|
|
29
|
+
* - `form-post` — a browser form POST the customer completes themselves.
|
|
30
|
+
*
|
|
31
|
+
* The distinction is not cosmetic. Called `rest`, a form-post flow would be
|
|
32
|
+
* sent server-side to an endpoint that expects a customer's browser; called
|
|
33
|
+
* `form-post`, a REST flow would redirect a customer straight at an endpoint
|
|
34
|
+
* that expects a signed server-side payload.
|
|
35
|
+
*/
|
|
36
|
+
export declare const TRANSPORTS: readonly ["rest", "form-post"];
|
|
37
|
+
export declare const REQUIREMENTS: readonly ["mandatory", "optional", "must-be-empty"];
|
|
38
|
+
/**
|
|
39
|
+
* Value types as every consumer sees them once a flow has been parsed.
|
|
40
|
+
*
|
|
41
|
+
* `pkt-datetime` and `pkt-expiry` name a zone deliberately, and no general alias
|
|
42
|
+
* is offered alongside them. The timestamp formatter and both validation rules
|
|
43
|
+
* are fixed to Asia/Karachi (`src/domain/datetime.ts`,
|
|
44
|
+
* `src/validation/rules/datetime.ts`, `src/validation/rules/expiry.ts`), so a
|
|
45
|
+
* general spelling would be a promise the code does not keep: a Turkish flow
|
|
46
|
+
* declaring `zoned-datetime` would still be stamped and validated in Pakistan
|
|
47
|
+
* Standard Time, two hours out, with nothing to warn the flow author. A name
|
|
48
|
+
* that is too specific is visibly wrong; a name that is falsely general is not.
|
|
49
|
+
*
|
|
50
|
+
* The zone has to travel with the value — as a declared property of the flow,
|
|
51
|
+
* read by the formatter — before a genuinely non-PKT flow can be transcribed.
|
|
52
|
+
*/
|
|
53
|
+
export declare const VALUE_TYPES: readonly ["constant", "string", "minor-units", "pkt-datetime", "pkt-expiry", "url", "txn-ref", "bill-reference", "request-id", "msisdn", "cnic", "payment-token", "secure-hash"];
|
|
54
|
+
export type Provider = (typeof PROVIDERS)[number];
|
|
55
|
+
export type Product = (typeof PRODUCTS)[number];
|
|
56
|
+
export type Transport = (typeof TRANSPORTS)[number];
|
|
57
|
+
export type Requirement = (typeof REQUIREMENTS)[number];
|
|
58
|
+
export type ValueType = (typeof VALUE_TYPES)[number];
|
|
59
|
+
declare const parameterSchema: z.ZodObject<{
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
requirement: z.ZodEnum<{
|
|
62
|
+
mandatory: "mandatory";
|
|
63
|
+
optional: "optional";
|
|
64
|
+
"must-be-empty": "must-be-empty";
|
|
65
|
+
}>;
|
|
66
|
+
valueType: z.ZodEnum<{
|
|
67
|
+
string: "string";
|
|
68
|
+
constant: "constant";
|
|
69
|
+
"minor-units": "minor-units";
|
|
70
|
+
"pkt-datetime": "pkt-datetime";
|
|
71
|
+
"pkt-expiry": "pkt-expiry";
|
|
72
|
+
url: "url";
|
|
73
|
+
"txn-ref": "txn-ref";
|
|
74
|
+
"bill-reference": "bill-reference";
|
|
75
|
+
"request-id": "request-id";
|
|
76
|
+
msisdn: "msisdn";
|
|
77
|
+
cnic: "cnic";
|
|
78
|
+
"payment-token": "payment-token";
|
|
79
|
+
"secure-hash": "secure-hash";
|
|
80
|
+
}>;
|
|
81
|
+
constantValue: z.ZodOptional<z.ZodString>;
|
|
82
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
84
|
+
sensitive: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
+
neverAcceptAsToolArgument: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
+
notes: z.ZodString;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
/**
|
|
89
|
+
* How a flow signs its requests.
|
|
90
|
+
*
|
|
91
|
+
* Still a discriminated union with one member, rather than a bare object: the
|
|
92
|
+
* discriminator is what makes a second construction fail to compile at every
|
|
93
|
+
* call site reading `flow.hash`, instead of a field quietly reinterpreted.
|
|
94
|
+
* `requestHashOptions` in `./hash-options.ts` relies on exactly that.
|
|
95
|
+
*
|
|
96
|
+
* Every member is read by `src/domain/signature/`. A field here that no code
|
|
97
|
+
* consumes is worse than no field at all: it reads as configuration, and a
|
|
98
|
+
* merchant who corrects it sees nothing change.
|
|
99
|
+
*/
|
|
100
|
+
declare const hashSpecSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
101
|
+
algorithm: z.ZodLiteral<"hmac-sha256">;
|
|
102
|
+
includeFieldPrefixes: z.ZodArray<z.ZodString>;
|
|
103
|
+
excludeFields: z.ZodArray<z.ZodString>;
|
|
104
|
+
outputEncoding: z.ZodEnum<{
|
|
105
|
+
base64: "base64";
|
|
106
|
+
"hex-lowercase": "hex-lowercase";
|
|
107
|
+
}>;
|
|
108
|
+
comparison: z.ZodEnum<{
|
|
109
|
+
"case-insensitive": "case-insensitive";
|
|
110
|
+
"case-sensitive": "case-sensitive";
|
|
111
|
+
}>;
|
|
112
|
+
}, z.core.$strict>], "algorithm">;
|
|
113
|
+
/**
|
|
114
|
+
* How a flow's response reports its outcome, and whether it is signed.
|
|
115
|
+
*
|
|
116
|
+
* `hashVerification` discriminates because the two cases differ in what they
|
|
117
|
+
* may declare, not merely in a flag: a signed response must name the field
|
|
118
|
+
* carrying the digest, and an unsigned one has no such field to name.
|
|
119
|
+
*/
|
|
120
|
+
declare const responseSpecSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
121
|
+
hashVerification: z.ZodLiteral<"assumed-all-non-empty">;
|
|
122
|
+
hashField: z.ZodString;
|
|
123
|
+
successField: z.ZodString;
|
|
124
|
+
successValue: z.ZodString;
|
|
125
|
+
settlement: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
field: z.ZodString;
|
|
127
|
+
successValue: z.ZodString;
|
|
128
|
+
}, z.core.$strict>>;
|
|
129
|
+
messageField: z.ZodOptional<z.ZodString>;
|
|
130
|
+
hashFieldPrefixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
131
|
+
notableFields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
132
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
133
|
+
hashVerification: z.ZodLiteral<"not-applicable">;
|
|
134
|
+
hashField: z.ZodOptional<z.ZodString>;
|
|
135
|
+
successField: z.ZodString;
|
|
136
|
+
successValue: z.ZodString;
|
|
137
|
+
settlement: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
field: z.ZodString;
|
|
139
|
+
successValue: z.ZodString;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
messageField: z.ZodOptional<z.ZodString>;
|
|
142
|
+
hashFieldPrefixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
143
|
+
notableFields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
144
|
+
}, z.core.$strict>], "hashVerification">;
|
|
145
|
+
declare const knownIssueSchema: z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
summary: z.ZodString;
|
|
148
|
+
detail: z.ZodString;
|
|
149
|
+
guidance: z.ZodString;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
export declare const flowSchema: z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
title: z.ZodString;
|
|
154
|
+
provider: z.ZodEnum<{
|
|
155
|
+
jazzcash: "jazzcash";
|
|
156
|
+
}>;
|
|
157
|
+
product: z.ZodEnum<{
|
|
158
|
+
card: "card";
|
|
159
|
+
bnpl: "bnpl";
|
|
160
|
+
mwallet: "mwallet";
|
|
161
|
+
"wallet-linking": "wallet-linking";
|
|
162
|
+
token: "token";
|
|
163
|
+
"status-inquiry": "status-inquiry";
|
|
164
|
+
refund: "refund";
|
|
165
|
+
}>;
|
|
166
|
+
version: z.ZodString;
|
|
167
|
+
transport: z.ZodEnum<{
|
|
168
|
+
rest: "rest";
|
|
169
|
+
"form-post": "form-post";
|
|
170
|
+
}>;
|
|
171
|
+
summary: z.ZodString;
|
|
172
|
+
useWhen: z.ZodString;
|
|
173
|
+
endpoints: z.ZodObject<{
|
|
174
|
+
sandbox: z.ZodURL;
|
|
175
|
+
production: z.ZodURL;
|
|
176
|
+
}, z.core.$strict>;
|
|
177
|
+
sameEndpointForBothEnvironments: z.ZodBoolean;
|
|
178
|
+
movesMoney: z.ZodBoolean;
|
|
179
|
+
responseContext: z.ZodEnum<{
|
|
180
|
+
token: "token";
|
|
181
|
+
refund: "refund";
|
|
182
|
+
payment: "payment";
|
|
183
|
+
inquiry: "inquiry";
|
|
184
|
+
ipn: "ipn";
|
|
185
|
+
}>;
|
|
186
|
+
constants: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
187
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
188
|
+
name: z.ZodString;
|
|
189
|
+
requirement: z.ZodEnum<{
|
|
190
|
+
mandatory: "mandatory";
|
|
191
|
+
optional: "optional";
|
|
192
|
+
"must-be-empty": "must-be-empty";
|
|
193
|
+
}>;
|
|
194
|
+
valueType: z.ZodEnum<{
|
|
195
|
+
string: "string";
|
|
196
|
+
constant: "constant";
|
|
197
|
+
"minor-units": "minor-units";
|
|
198
|
+
"pkt-datetime": "pkt-datetime";
|
|
199
|
+
"pkt-expiry": "pkt-expiry";
|
|
200
|
+
url: "url";
|
|
201
|
+
"txn-ref": "txn-ref";
|
|
202
|
+
"bill-reference": "bill-reference";
|
|
203
|
+
"request-id": "request-id";
|
|
204
|
+
msisdn: "msisdn";
|
|
205
|
+
cnic: "cnic";
|
|
206
|
+
"payment-token": "payment-token";
|
|
207
|
+
"secure-hash": "secure-hash";
|
|
208
|
+
}>;
|
|
209
|
+
constantValue: z.ZodOptional<z.ZodString>;
|
|
210
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
212
|
+
sensitive: z.ZodDefault<z.ZodBoolean>;
|
|
213
|
+
neverAcceptAsToolArgument: z.ZodDefault<z.ZodBoolean>;
|
|
214
|
+
notes: z.ZodString;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
hash: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
217
|
+
algorithm: z.ZodLiteral<"hmac-sha256">;
|
|
218
|
+
includeFieldPrefixes: z.ZodArray<z.ZodString>;
|
|
219
|
+
excludeFields: z.ZodArray<z.ZodString>;
|
|
220
|
+
outputEncoding: z.ZodEnum<{
|
|
221
|
+
base64: "base64";
|
|
222
|
+
"hex-lowercase": "hex-lowercase";
|
|
223
|
+
}>;
|
|
224
|
+
comparison: z.ZodEnum<{
|
|
225
|
+
"case-insensitive": "case-insensitive";
|
|
226
|
+
"case-sensitive": "case-sensitive";
|
|
227
|
+
}>;
|
|
228
|
+
}, z.core.$strict>], "algorithm">;
|
|
229
|
+
response: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
230
|
+
hashVerification: z.ZodLiteral<"assumed-all-non-empty">;
|
|
231
|
+
hashField: z.ZodString;
|
|
232
|
+
successField: z.ZodString;
|
|
233
|
+
successValue: z.ZodString;
|
|
234
|
+
settlement: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
field: z.ZodString;
|
|
236
|
+
successValue: z.ZodString;
|
|
237
|
+
}, z.core.$strict>>;
|
|
238
|
+
messageField: z.ZodOptional<z.ZodString>;
|
|
239
|
+
hashFieldPrefixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
240
|
+
notableFields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
241
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
242
|
+
hashVerification: z.ZodLiteral<"not-applicable">;
|
|
243
|
+
hashField: z.ZodOptional<z.ZodString>;
|
|
244
|
+
successField: z.ZodString;
|
|
245
|
+
successValue: z.ZodString;
|
|
246
|
+
settlement: z.ZodOptional<z.ZodObject<{
|
|
247
|
+
field: z.ZodString;
|
|
248
|
+
successValue: z.ZodString;
|
|
249
|
+
}, z.core.$strict>>;
|
|
250
|
+
messageField: z.ZodOptional<z.ZodString>;
|
|
251
|
+
hashFieldPrefixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
252
|
+
notableFields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
253
|
+
}, z.core.$strict>], "hashVerification">;
|
|
254
|
+
companionFlows: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
255
|
+
docRefs: z.ZodArray<z.ZodObject<{
|
|
256
|
+
docId: z.ZodString;
|
|
257
|
+
sectionId: z.ZodOptional<z.ZodString>;
|
|
258
|
+
label: z.ZodOptional<z.ZodString>;
|
|
259
|
+
}, z.core.$strict>>;
|
|
260
|
+
knownIssues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
261
|
+
id: z.ZodString;
|
|
262
|
+
summary: z.ZodString;
|
|
263
|
+
detail: z.ZodString;
|
|
264
|
+
guidance: z.ZodString;
|
|
265
|
+
}, z.core.$strict>>>;
|
|
266
|
+
}, z.core.$strict>;
|
|
267
|
+
export type FlowParameter = z.infer<typeof parameterSchema>;
|
|
268
|
+
export type FlowHashSpec = z.infer<typeof hashSpecSchema>;
|
|
269
|
+
export type FlowResponseSpec = z.infer<typeof responseSpecSchema>;
|
|
270
|
+
export type FlowKnownIssue = z.infer<typeof knownIssueSchema>;
|
|
271
|
+
export type IntegrationFlow = z.infer<typeof flowSchema>;
|
|
272
|
+
/** Parameter names the caller must supply because they carry business data. */
|
|
273
|
+
export declare function businessParameters(flow: IntegrationFlow): readonly FlowParameter[];
|
|
274
|
+
/** Every parameter name declared by the flow, in documentation order. */
|
|
275
|
+
export declare function parameterNames(flow: IntegrationFlow): readonly string[];
|
|
276
|
+
/** Look up a single parameter definition. */
|
|
277
|
+
export declare function findParameter(flow: IntegrationFlow, name: string): FlowParameter | undefined;
|
|
278
|
+
export {};
|
|
279
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/catalogue/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,uBAAwB,CAAC;AAE/C,eAAO,MAAM,QAAQ,6FAA8F,CAAC;AAEpH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,gCAAiC,CAAC;AAEzD,eAAO,MAAM,YAAY,qDAAsD,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,kLAcd,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAClD,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAChD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AACpD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACxD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAQrD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwBnB,CAAC;AAqBH;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,cAAc;;;;;;;;;;;;iCAAoE,CAAC;AAwHzF;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;wCAGtB,CAAC;AAcH,QAAA,MAAM,gBAAgB;;;;;kBAKpB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoFnB,CAAC;AAEL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzD,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,aAAa,EAAE,CAOlF;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,MAAM,EAAE,CAEvE;AAED,6CAA6C;AAC7C,wBAAgB,aAAa,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAE5F"}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Machine-readable description of one payment-integration flow.
|
|
4
|
+
*
|
|
5
|
+
* Every flow in `knowledge/flows/` is a faithful transcription of a single
|
|
6
|
+
* official guide. The schema is the contract between the corpus and the code:
|
|
7
|
+
* validation, code generation and gateway execution all read from it, so a
|
|
8
|
+
* correction from the provider is a data change rather than a code change.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Payment providers whose flows the catalogue can describe.
|
|
12
|
+
*
|
|
13
|
+
* A closed set rather than a free string: a mistyped provider would otherwise
|
|
14
|
+
* create a one-flow provider of its own, and every provider-scoped rule —
|
|
15
|
+
* signature scheme, endpoint checks, response contract — would silently decline
|
|
16
|
+
* to apply to it.
|
|
17
|
+
*
|
|
18
|
+
* One member today, and the enumeration is kept rather than collapsed into a
|
|
19
|
+
* literal: every flow file declares `provider` explicitly, and a single-member
|
|
20
|
+
* enum makes adding a second one a deliberate schema change rather than a
|
|
21
|
+
* string somebody can mistype into existence.
|
|
22
|
+
*/
|
|
23
|
+
export const PROVIDERS = ['jazzcash'];
|
|
24
|
+
export const PRODUCTS = ['card', 'bnpl', 'mwallet', 'wallet-linking', 'token', 'status-inquiry', 'refund'];
|
|
25
|
+
/**
|
|
26
|
+
* How a flow is performed.
|
|
27
|
+
*
|
|
28
|
+
* - `rest` — a server-to-server JSON POST this server can execute headlessly.
|
|
29
|
+
* - `form-post` — a browser form POST the customer completes themselves.
|
|
30
|
+
*
|
|
31
|
+
* The distinction is not cosmetic. Called `rest`, a form-post flow would be
|
|
32
|
+
* sent server-side to an endpoint that expects a customer's browser; called
|
|
33
|
+
* `form-post`, a REST flow would redirect a customer straight at an endpoint
|
|
34
|
+
* that expects a signed server-side payload.
|
|
35
|
+
*/
|
|
36
|
+
export const TRANSPORTS = ['rest', 'form-post'];
|
|
37
|
+
export const REQUIREMENTS = ['mandatory', 'optional', 'must-be-empty'];
|
|
38
|
+
/**
|
|
39
|
+
* Value types as every consumer sees them once a flow has been parsed.
|
|
40
|
+
*
|
|
41
|
+
* `pkt-datetime` and `pkt-expiry` name a zone deliberately, and no general alias
|
|
42
|
+
* is offered alongside them. The timestamp formatter and both validation rules
|
|
43
|
+
* are fixed to Asia/Karachi (`src/domain/datetime.ts`,
|
|
44
|
+
* `src/validation/rules/datetime.ts`, `src/validation/rules/expiry.ts`), so a
|
|
45
|
+
* general spelling would be a promise the code does not keep: a Turkish flow
|
|
46
|
+
* declaring `zoned-datetime` would still be stamped and validated in Pakistan
|
|
47
|
+
* Standard Time, two hours out, with nothing to warn the flow author. A name
|
|
48
|
+
* that is too specific is visibly wrong; a name that is falsely general is not.
|
|
49
|
+
*
|
|
50
|
+
* The zone has to travel with the value — as a declared property of the flow,
|
|
51
|
+
* read by the formatter — before a genuinely non-PKT flow can be transcribed.
|
|
52
|
+
*/
|
|
53
|
+
export const VALUE_TYPES = [
|
|
54
|
+
'constant',
|
|
55
|
+
'string',
|
|
56
|
+
'minor-units',
|
|
57
|
+
'pkt-datetime',
|
|
58
|
+
'pkt-expiry',
|
|
59
|
+
'url',
|
|
60
|
+
'txn-ref',
|
|
61
|
+
'bill-reference',
|
|
62
|
+
'request-id',
|
|
63
|
+
'msisdn',
|
|
64
|
+
'cnic',
|
|
65
|
+
'payment-token',
|
|
66
|
+
'secure-hash',
|
|
67
|
+
];
|
|
68
|
+
const docRefSchema = z.strictObject({
|
|
69
|
+
docId: z.string().min(1),
|
|
70
|
+
sectionId: z.string().min(1).optional(),
|
|
71
|
+
label: z.string().min(1).optional(),
|
|
72
|
+
});
|
|
73
|
+
const parameterSchema = z.strictObject({
|
|
74
|
+
name: z.string().min(1),
|
|
75
|
+
requirement: z.enum(REQUIREMENTS),
|
|
76
|
+
valueType: z.enum(VALUE_TYPES),
|
|
77
|
+
/** Required value when `valueType` is `constant`. */
|
|
78
|
+
constantValue: z.string().optional(),
|
|
79
|
+
maxLength: z.number().int().positive().optional(),
|
|
80
|
+
/** Additional regular expression the value must satisfy, as a source string. */
|
|
81
|
+
pattern: z.string().optional(),
|
|
82
|
+
/** True for credentials and personal data; excluded from logs and echoes. */
|
|
83
|
+
sensitive: z.boolean().default(false),
|
|
84
|
+
/**
|
|
85
|
+
* True for a value that must never cross the MCP boundary as a tool argument.
|
|
86
|
+
*
|
|
87
|
+
* Card flows carry the PAN, the expiry and the CVV. `safeHandler` scrubs tool
|
|
88
|
+
* OUTPUTS, not inputs, so a PAN pasted as a tool argument is already in the
|
|
89
|
+
* conversation transcript — and in whatever the harness persists — before any
|
|
90
|
+
* server code runs, and no later redaction can recall it. A parameter marked
|
|
91
|
+
* here has to reach the gateway by another route: a hosted field, or the
|
|
92
|
+
* merchant's own server. Distinct from `sensitive`, which says a value may be
|
|
93
|
+
* handled but never echoed.
|
|
94
|
+
*/
|
|
95
|
+
neverAcceptAsToolArgument: z.boolean().default(false),
|
|
96
|
+
notes: z.string().min(1),
|
|
97
|
+
});
|
|
98
|
+
const HASH_OUTPUT_ENCODINGS = ['hex-lowercase', 'base64'];
|
|
99
|
+
const HASH_COMPARISONS = ['case-insensitive', 'case-sensitive'];
|
|
100
|
+
/**
|
|
101
|
+
* A signature built from prefix-selected fields, keyed with the shared secret.
|
|
102
|
+
*
|
|
103
|
+
* The JazzCash construction: sort the selected non-empty parameters by name,
|
|
104
|
+
* join their values, prepend the Integrity Salt and HMAC the result with it.
|
|
105
|
+
*/
|
|
106
|
+
const prefixSelectedHashSpecSchema = z.strictObject({
|
|
107
|
+
algorithm: z.literal('hmac-sha256'),
|
|
108
|
+
/** Assumption A1. See `src/domain/signature/jazzcash.ts`. */
|
|
109
|
+
includeFieldPrefixes: z.array(z.string()).min(1),
|
|
110
|
+
excludeFields: z.array(z.string()),
|
|
111
|
+
outputEncoding: z.enum(HASH_OUTPUT_ENCODINGS),
|
|
112
|
+
comparison: z.enum(HASH_COMPARISONS),
|
|
113
|
+
});
|
|
114
|
+
/**
|
|
115
|
+
* How a flow signs its requests.
|
|
116
|
+
*
|
|
117
|
+
* Still a discriminated union with one member, rather than a bare object: the
|
|
118
|
+
* discriminator is what makes a second construction fail to compile at every
|
|
119
|
+
* call site reading `flow.hash`, instead of a field quietly reinterpreted.
|
|
120
|
+
* `requestHashOptions` in `./hash-options.ts` relies on exactly that.
|
|
121
|
+
*
|
|
122
|
+
* Every member is read by `src/domain/signature/`. A field here that no code
|
|
123
|
+
* consumes is worse than no field at all: it reads as configuration, and a
|
|
124
|
+
* merchant who corrects it sees nothing change.
|
|
125
|
+
*/
|
|
126
|
+
const hashSpecSchema = z.discriminatedUnion('algorithm', [prefixSelectedHashSpecSchema]);
|
|
127
|
+
/**
|
|
128
|
+
* The shape of a response field name.
|
|
129
|
+
*
|
|
130
|
+
* A shape check rather than a closed enumeration: a field name is an identifier
|
|
131
|
+
* the gateway sends, and an empty value, a stray space or a pasted quotation
|
|
132
|
+
* mark is a transcription slip. The slip is silent — verification and success
|
|
133
|
+
* checking both read a field that never arrives, and report nothing rather than
|
|
134
|
+
* complaining.
|
|
135
|
+
*
|
|
136
|
+
* Shape cannot catch a MISSPELLED identifier, so `flowSchema` re-pins the exact
|
|
137
|
+
* JazzCash names below, where the corpus actually documents them.
|
|
138
|
+
*/
|
|
139
|
+
const responseFieldNameSchema = z
|
|
140
|
+
.string()
|
|
141
|
+
.min(1)
|
|
142
|
+
.max(64)
|
|
143
|
+
.regex(/^[A-Za-z][A-Za-z0-9_]*$/u, 'A response field name is an identifier: a letter followed by letters, digits or underscores.');
|
|
144
|
+
/**
|
|
145
|
+
* The settlement (bank) level of a two-level success rule.
|
|
146
|
+
*
|
|
147
|
+
* Some gateways answer a card sale twice over: a service-level code saying the
|
|
148
|
+
* request was accepted and processed, and an acquirer code saying whether the
|
|
149
|
+
* card was actually approved. BOTH have to be checked. A contract that names
|
|
150
|
+
* only the service level classifies a DECLINED card as a successful payment,
|
|
151
|
+
* and a merchant who releases goods on that classification is never paid.
|
|
152
|
+
*
|
|
153
|
+
* The field and the value it must hold travel together as one object, because a
|
|
154
|
+
* field with no value to compare against cannot be checked at all, and a value
|
|
155
|
+
* with no field names nothing.
|
|
156
|
+
*/
|
|
157
|
+
const settlementSpecSchema = z.strictObject({
|
|
158
|
+
field: responseFieldNameSchema,
|
|
159
|
+
successValue: z.string().min(1),
|
|
160
|
+
});
|
|
161
|
+
/** The parts of a response contract that do not depend on whether it is signed. */
|
|
162
|
+
const responseSpecBase = {
|
|
163
|
+
successField: responseFieldNameSchema,
|
|
164
|
+
successValue: z.string().min(1),
|
|
165
|
+
/**
|
|
166
|
+
* The bank-level result, where the service-level code is not the whole answer.
|
|
167
|
+
*
|
|
168
|
+
* Absent for every JazzCash flow: those report one outcome in one field.
|
|
169
|
+
*/
|
|
170
|
+
settlement: settlementSpecSchema.optional(),
|
|
171
|
+
/**
|
|
172
|
+
* The field carrying the gateway's own explanation of the outcome.
|
|
173
|
+
*
|
|
174
|
+
* Declared rather than derived from `successField`. The generator used to read
|
|
175
|
+
* `successField === 'ResponseCode' ? 'ResponseMessage' : 'pp_ResponseMessage'`,
|
|
176
|
+
* which is a JazzCash naming convention applied to every provider, so a
|
|
177
|
+
* generated client for anyone else printed a field its gateway never sends —
|
|
178
|
+
* silently, because an absent key is an empty line rather than an error.
|
|
179
|
+
*
|
|
180
|
+
* Optional, because a provider that sends no message has none to name, and
|
|
181
|
+
* `src/codegen/generate.ts` then generates no lookup at all. Unlike
|
|
182
|
+
* `successField` and `hashField` it is not re-pinned per provider below: a
|
|
183
|
+
* misspelling here prints nothing where an explanation should be, while a
|
|
184
|
+
* misspelling there misclassifies every response or skips verification
|
|
185
|
+
* entirely.
|
|
186
|
+
*/
|
|
187
|
+
messageField: responseFieldNameSchema.optional(),
|
|
188
|
+
/**
|
|
189
|
+
* Prefixes that select which RESPONSE fields feed the response hash.
|
|
190
|
+
*
|
|
191
|
+
* Empty means no filtering, which is correct for every documented flow: card
|
|
192
|
+
* and BNPL refund responses use unprefixed field names, so applying the
|
|
193
|
+
* request filter (`pp_`, `ppmpf_`) would exclude every field and reduce the
|
|
194
|
+
* hash input to the bare salt. Declared separately from `hash` because the
|
|
195
|
+
* request and response rules are genuinely different, and present on an
|
|
196
|
+
* unsigned response too, because `jazzcash_verify_secure_hash` recomputes a
|
|
197
|
+
* pasted response for any flow and still has to know the selection rule.
|
|
198
|
+
*/
|
|
199
|
+
hashFieldPrefixes: z.array(z.string()).default([]),
|
|
200
|
+
notableFields: z.array(z.string()).default([]),
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* A response the server recomputes a signature over.
|
|
204
|
+
*
|
|
205
|
+
* Assumption A2: no guide states which response fields feed the response hash.
|
|
206
|
+
* `assumed-all-non-empty` means the server recomputes over all non-empty fields
|
|
207
|
+
* but reports `unverified` rather than `failed` on a mismatch.
|
|
208
|
+
*/
|
|
209
|
+
const signedResponseSpecSchema = z.strictObject({
|
|
210
|
+
...responseSpecBase,
|
|
211
|
+
hashVerification: z.literal('assumed-all-non-empty'),
|
|
212
|
+
/**
|
|
213
|
+
* Card and BNPL refunds return a bare `SecureHash`; every other JazzCash
|
|
214
|
+
* response returns `pp_SecureHash`. Getting this wrong silently skips
|
|
215
|
+
* response verification.
|
|
216
|
+
*/
|
|
217
|
+
hashField: responseFieldNameSchema,
|
|
218
|
+
});
|
|
219
|
+
/**
|
|
220
|
+
* A response the server does not verify a signature on.
|
|
221
|
+
*
|
|
222
|
+
* `hashField` is OPTIONAL here, and that is the whole point of the split.
|
|
223
|
+
* Requiring it forced a provider whose REST responses are unsigned to name a
|
|
224
|
+
* field that does not exist, and every call then reported "no hash arrived" —
|
|
225
|
+
* which reads as a broken integration rather than as the provider's design.
|
|
226
|
+
*
|
|
227
|
+
* Optional rather than forbidden: a gateway may return a digest it does not
|
|
228
|
+
* document how to reproduce, and recording the field a merchant can see in the
|
|
229
|
+
* payload is still worth something. Absent means there is nothing to read, and
|
|
230
|
+
* `src/gateway/rest-client.ts` says so instead of hunting for a field.
|
|
231
|
+
*/
|
|
232
|
+
const unsignedResponseSpecSchema = z.strictObject({
|
|
233
|
+
...responseSpecBase,
|
|
234
|
+
hashVerification: z.literal('not-applicable'),
|
|
235
|
+
hashField: responseFieldNameSchema.optional(),
|
|
236
|
+
});
|
|
237
|
+
/**
|
|
238
|
+
* How a flow's response reports its outcome, and whether it is signed.
|
|
239
|
+
*
|
|
240
|
+
* `hashVerification` discriminates because the two cases differ in what they
|
|
241
|
+
* may declare, not merely in a flag: a signed response must name the field
|
|
242
|
+
* carrying the digest, and an unsigned one has no such field to name.
|
|
243
|
+
*/
|
|
244
|
+
const responseSpecSchema = z.discriminatedUnion('hashVerification', [
|
|
245
|
+
signedResponseSpecSchema,
|
|
246
|
+
unsignedResponseSpecSchema,
|
|
247
|
+
]);
|
|
248
|
+
/**
|
|
249
|
+
* The response field names the JazzCash guides actually use.
|
|
250
|
+
*
|
|
251
|
+
* The shape check above accepts any identifier, which on its own would drop the
|
|
252
|
+
* check that caught `pp_ResponceCode` in a flow file. Re-pinned here, where the
|
|
253
|
+
* corpus documents them: a wrong name is silent otherwise, because the success
|
|
254
|
+
* check then reads a field that never arrives and every response classifies as
|
|
255
|
+
* unrecognisable.
|
|
256
|
+
*/
|
|
257
|
+
const JAZZCASH_RESPONSE_HASH_FIELDS = ['pp_SecureHash', 'SecureHash'];
|
|
258
|
+
const JAZZCASH_RESPONSE_SUCCESS_FIELDS = ['pp_ResponseCode', 'ResponseCode'];
|
|
259
|
+
const knownIssueSchema = z.strictObject({
|
|
260
|
+
id: z.string().min(1),
|
|
261
|
+
summary: z.string().min(1),
|
|
262
|
+
detail: z.string().min(1),
|
|
263
|
+
guidance: z.string().min(1),
|
|
264
|
+
});
|
|
265
|
+
export const flowSchema = z
|
|
266
|
+
.strictObject({
|
|
267
|
+
id: z.string().min(1),
|
|
268
|
+
title: z.string().min(1),
|
|
269
|
+
/**
|
|
270
|
+
* The gateway this flow belongs to.
|
|
271
|
+
*
|
|
272
|
+
* Required rather than defaulted, even with one provider in the enumeration:
|
|
273
|
+
* a file that omitted the field would load as JazzCash by accident, and the
|
|
274
|
+
* day a second provider is added every existing flow would need auditing to
|
|
275
|
+
* find out which of them had meant it.
|
|
276
|
+
*/
|
|
277
|
+
provider: z.enum(PROVIDERS),
|
|
278
|
+
product: z.enum(PRODUCTS),
|
|
279
|
+
version: z.string().min(1),
|
|
280
|
+
transport: z.enum(TRANSPORTS),
|
|
281
|
+
summary: z.string().min(1),
|
|
282
|
+
useWhen: z.string().min(1),
|
|
283
|
+
endpoints: z.strictObject({
|
|
284
|
+
sandbox: z.url(),
|
|
285
|
+
production: z.url(),
|
|
286
|
+
}),
|
|
287
|
+
/** True for every documented flow: the environment lives in the credentials. */
|
|
288
|
+
sameEndpointForBothEnvironments: z.boolean(),
|
|
289
|
+
/**
|
|
290
|
+
* True when a successful call debits, refunds or authorises money, or links
|
|
291
|
+
* a wallet. Drives the production dual opt-in guard.
|
|
292
|
+
*/
|
|
293
|
+
movesMoney: z.boolean(),
|
|
294
|
+
responseContext: z.enum(['payment', 'inquiry', 'refund', 'ipn', 'token']),
|
|
295
|
+
constants: z.record(z.string(), z.string()).default({}),
|
|
296
|
+
parameters: z.array(parameterSchema).min(1),
|
|
297
|
+
hash: hashSpecSchema,
|
|
298
|
+
response: responseSpecSchema,
|
|
299
|
+
/** Flows the guides mark as mandatory alongside this one. */
|
|
300
|
+
companionFlows: z.array(z.string()).default([]),
|
|
301
|
+
docRefs: z.array(docRefSchema).min(1),
|
|
302
|
+
knownIssues: z.array(knownIssueSchema).default([]),
|
|
303
|
+
})
|
|
304
|
+
.superRefine((flow, ctx) => {
|
|
305
|
+
// Every rule below is JazzCash's, and `PROVIDERS` names only JazzCash, so
|
|
306
|
+
// they apply to every flow. A second provider added to the enumeration must
|
|
307
|
+
// reinstate a guard here first: these spellings are JazzCash's, and applied
|
|
308
|
+
// to another gateway they would reject its correct field names.
|
|
309
|
+
const { hashField, successField } = flow.response;
|
|
310
|
+
if (hashField !== undefined && !JAZZCASH_RESPONSE_HASH_FIELDS.includes(hashField)) {
|
|
311
|
+
ctx.addIssue({
|
|
312
|
+
code: 'custom',
|
|
313
|
+
path: ['response', 'hashField'],
|
|
314
|
+
message: `A JazzCash response carries its signature in ${JAZZCASH_RESPONSE_HASH_FIELDS.join(' or ')}, not in "${hashField}". Verification against a field the gateway never sends reports "no hash arrived" on every call.`,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
if (!JAZZCASH_RESPONSE_SUCCESS_FIELDS.includes(successField)) {
|
|
318
|
+
ctx.addIssue({
|
|
319
|
+
code: 'custom',
|
|
320
|
+
path: ['response', 'successField'],
|
|
321
|
+
message: `A JazzCash response reports its outcome in ${JAZZCASH_RESPONSE_SUCCESS_FIELDS.join(' or ')}, not in "${successField}". Reading the outcome from a field the gateway never sends classifies every response as unrecognisable.`,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
// Every JazzCash response is signed. Declaring otherwise would silently
|
|
325
|
+
// switch off response verification for a flow the guides say carries a
|
|
326
|
+
// digest, and the loss is invisible: nothing reports a check that was never
|
|
327
|
+
// attempted.
|
|
328
|
+
if (flow.response.hashVerification !== 'assumed-all-non-empty') {
|
|
329
|
+
ctx.addIssue({
|
|
330
|
+
code: 'custom',
|
|
331
|
+
path: ['response', 'hashVerification'],
|
|
332
|
+
message: `Every JazzCash response carries a signature, so this must be "assumed-all-non-empty". Declaring "${flow.response.hashVerification}" skips response verification silently.`,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
// A JazzCash response reports one outcome in one field. A settlement level
|
|
336
|
+
// here would make `classifyResponse` demand a bank code the gateway never
|
|
337
|
+
// sends, so every successful payment would classify as unknown.
|
|
338
|
+
if (flow.response.settlement !== undefined) {
|
|
339
|
+
ctx.addIssue({
|
|
340
|
+
code: 'custom',
|
|
341
|
+
path: ['response', 'settlement'],
|
|
342
|
+
message: `A JazzCash response reports one outcome in ${flow.response.successField}, so it has no settlement level. Declaring "${flow.response.settlement.field}" makes every response classify as unknown, because the gateway never sends it.`,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
/** Parameter names the caller must supply because they carry business data. */
|
|
347
|
+
export function businessParameters(flow) {
|
|
348
|
+
return flow.parameters.filter((parameter) => parameter.requirement !== 'must-be-empty' &&
|
|
349
|
+
parameter.valueType !== 'constant' &&
|
|
350
|
+
parameter.valueType !== 'secure-hash');
|
|
351
|
+
}
|
|
352
|
+
/** Every parameter name declared by the flow, in documentation order. */
|
|
353
|
+
export function parameterNames(flow) {
|
|
354
|
+
return flow.parameters.map((parameter) => parameter.name);
|
|
355
|
+
}
|
|
356
|
+
/** Look up a single parameter definition. */
|
|
357
|
+
export function findParameter(flow, name) {
|
|
358
|
+
return flow.parameters.find((parameter) => parameter.name === name);
|
|
359
|
+
}
|
|
360
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/catalogue/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,UAAU,CAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,CAAU,CAAC;AAEpH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,WAAW,CAAU,CAAC;AAEzD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,eAAe,CAAU,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU;IACV,QAAQ;IACR,aAAa;IACb,cAAc;IACd,YAAY;IACZ,KAAK;IACL,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,eAAe;IACf,aAAa;CACL,CAAC;AAQX,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE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} from '../catalogue/types.js';
|
|
2
|
+
import type { CodegenRequest, CodegenResult, TemplateKind } from './types.js';
|
|
3
|
+
/** Generate one artefact for a flow. */
|
|
4
|
+
export declare function generateCode(request: CodegenRequest): CodegenResult;
|
|
5
|
+
/**
|
|
6
|
+
* The artefact kinds that make sense for a flow.
|
|
7
|
+
*
|
|
8
|
+
* Every shipped transport has a kind, so this is currently total. It returns a
|
|
9
|
+
* list rather than one kind because a transport nothing here can generate for
|
|
10
|
+
* must be able to answer "none" — naming a kind and then refusing it in
|
|
11
|
+
* `assertKindSuitsFlow` sent the caller round in a circle between the two.
|
|
12
|
+
*/
|
|
13
|
+
export declare function availableKinds(flow: IntegrationFlow): readonly TemplateKind[];
|
|
14
|
+
//# sourceMappingURL=generate.d.ts.map
|