@alphawebai/hs-prism 0.1.0-rc.27

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.
Files changed (39) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +493 -0
  3. package/dist/src/alphaweb/contracts.d.ts +6 -0
  4. package/dist/src/alphaweb/contracts.js +14 -0
  5. package/dist/src/alphaweb/error.d.ts +13 -0
  6. package/dist/src/alphaweb/error.js +100 -0
  7. package/dist/src/alphaweb/index.d.ts +3 -0
  8. package/dist/src/alphaweb/index.js +22 -0
  9. package/dist/src/alphaweb/manifest.d.ts +28 -0
  10. package/dist/src/alphaweb/manifest.js +55 -0
  11. package/dist/src/alphaweb/money.d.ts +19 -0
  12. package/dist/src/alphaweb/money.js +128 -0
  13. package/dist/src/alphaweb/stripe-connector.d.ts +58 -0
  14. package/dist/src/alphaweb/stripe-connector.js +1402 -0
  15. package/dist/src/alphaweb/types.d.ts +255 -0
  16. package/dist/src/alphaweb/types.js +3 -0
  17. package/dist/src/http_client.d.ts +58 -0
  18. package/dist/src/http_client.js +179 -0
  19. package/dist/src/index.d.ts +10 -0
  20. package/dist/src/index.js +41 -0
  21. package/dist/src/payments/_generated_connector_client_flows.d.ts +112 -0
  22. package/dist/src/payments/_generated_connector_client_flows.js +215 -0
  23. package/dist/src/payments/_generated_flows.js +141 -0
  24. package/dist/src/payments/_generated_grpc_client.d.ts +194 -0
  25. package/dist/src/payments/_generated_grpc_client.js +905 -0
  26. package/dist/src/payments/_generated_uniffi_client_flows.d.ts +169 -0
  27. package/dist/src/payments/_generated_uniffi_client_flows.js +342 -0
  28. package/dist/src/payments/connector_client.d.ts +51 -0
  29. package/dist/src/payments/connector_client.js +152 -0
  30. package/dist/src/payments/errors.d.ts +27 -0
  31. package/dist/src/payments/errors.js +39 -0
  32. package/dist/src/payments/generated/libconnector_service_ffi.so +0 -0
  33. package/dist/src/payments/generated/proto.d.ts +49087 -0
  34. package/dist/src/payments/generated/proto.js +154163 -0
  35. package/dist/src/payments/grpc_client.d.ts +1 -0
  36. package/dist/src/payments/grpc_client.js +20 -0
  37. package/dist/src/payments/uniffi_client.d.ts +40 -0
  38. package/dist/src/payments/uniffi_client.js +249 -0
  39. package/package.json +79 -0
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Connection configuration for the gRPC client.
3
+ * Field names must be snake_case — they are serialised to JSON and sent to the
4
+ * Rust FFI layer which deserialises them into GrpcConfigInput.
5
+ *
6
+ * The connector_config field should contain the connector-specific authentication
7
+ * and configuration in the format expected by the server:
8
+ * {"config": {"ConnectorName": {"api_key": "...", ...}}}
9
+ */
10
+ export interface GrpcConfig {
11
+ endpoint: string;
12
+ connector: string;
13
+ connector_config: Record<string, unknown>;
14
+ }
15
+ interface GrpcFfi {
16
+ call: (method: string, configPtr: Buffer, configLen: number, reqPtr: Buffer, reqLen: number, outLen: number[]) => unknown;
17
+ free: (ptr: unknown, len: number) => void;
18
+ }
19
+ export declare class GrpcCustomerClient {
20
+ private ffi;
21
+ private config;
22
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
23
+ /** CustomerService.Create — Create customer record in the payment processor system. Stores customer details for future payment operations without re-sending personal information. */
24
+ customerCreate(req: unknown): Promise<unknown>;
25
+ /** CustomerService.Get — Retrieves customer details from the payment processor. Callers typically use this before Create to implement get-or-create semantics for connectors that reject duplicates (e.g. Glomopay). */
26
+ customerGet(req: unknown): Promise<unknown>;
27
+ }
28
+ export declare class GrpcDisputeClient {
29
+ private ffi;
30
+ private config;
31
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
32
+ /** DisputeService.SubmitEvidence — Upload evidence to dispute customer chargeback. Provides documentation like receipts and delivery proof to contest fraudulent transaction claims. */
33
+ submitEvidence(req: unknown): Promise<unknown>;
34
+ /** DisputeService.Get — Retrieve dispute status and evidence submission state. Tracks dispute progress through bank review process for informed decision-making. */
35
+ disputeGet(req: unknown): Promise<unknown>;
36
+ /** DisputeService.Defend — Submit defense with reason code for dispute. Presents formal argument against customer's chargeback claim with supporting documentation. */
37
+ defend(req: unknown): Promise<unknown>;
38
+ /** DisputeService.Accept — Concede dispute and accepts chargeback loss. Acknowledges liability and stops dispute defense process when evidence is insufficient. */
39
+ accept(req: unknown): Promise<unknown>;
40
+ }
41
+ export declare class GrpcEventClient {
42
+ private ffi;
43
+ private config;
44
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
45
+ /** EventService.ParseEvent — Parse a raw webhook payload without credentials. Returns resource reference and event type — sufficient to resolve secrets or early-exit. */
46
+ parseEvent(req: unknown): Promise<unknown>;
47
+ /** EventService.HandleEvent — Verify webhook source and return a unified typed response. Response mirrors PaymentService.Get / RefundService.Get / DisputeService.Get. */
48
+ handleEvent(req: unknown): Promise<unknown>;
49
+ /** EventService.NotifyConnector — Notify connectors about events (payment succeeded, refund succeeded, refund failed). */
50
+ notifyConnector(req: unknown): Promise<unknown>;
51
+ }
52
+ export declare class GrpcFraudAndRiskManagementClient {
53
+ private ffi;
54
+ private config;
55
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
56
+ /** FraudAndRiskManagementService.PreRiskCheck — Evaluate fraud risk before payment processing. Analyzes transaction details, customer behavior, and device fingerprints to determine if the payment should proceed, be rejected, or flagged for manual review. */
57
+ preRiskCheck(req: unknown): Promise<unknown>;
58
+ /** FraudAndRiskManagementService.PostRiskCheck — Evaluate fraud risk after payment processing. Analyzes payment outcomes and post-transaction signals to refine risk models and detect chargeback fraud. */
59
+ postRiskCheck(req: unknown): Promise<unknown>;
60
+ }
61
+ export declare class GrpcMerchantAuthenticationClient {
62
+ private ffi;
63
+ private config;
64
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
65
+ /** MerchantAuthenticationService.CreateServerAuthenticationToken — Generate short-lived connector authentication token. Provides secure credentials for connector API access without storing secrets client-side. */
66
+ createServerAuthenticationToken(req: unknown): Promise<unknown>;
67
+ /** MerchantAuthenticationService.CreateServerSessionAuthenticationToken — Create a server-side session with the connector. Establishes session state for multi-step operations like 3DS verification or wallet authorization. */
68
+ createServerSessionAuthenticationToken(req: unknown): Promise<unknown>;
69
+ /** MerchantAuthenticationService.CreateClientAuthenticationToken — Initialize client-facing SDK sessions for wallets, device fingerprinting, etc. Returns structured data the client SDK needs to render payment/verification UI. */
70
+ createClientAuthenticationToken(req: unknown): Promise<unknown>;
71
+ }
72
+ export declare class GrpcPaymentMethodAuthenticationClient {
73
+ private ffi;
74
+ private config;
75
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
76
+ /** PaymentMethodAuthenticationService.PreAuthenticate — Initiate 3DS flow before payment authorization. Collects device data and prepares authentication context for frictionless or challenge-based verification. */
77
+ preAuthenticate(req: unknown): Promise<unknown>;
78
+ /** PaymentMethodAuthenticationService.Authenticate — Execute 3DS challenge or frictionless verification. Authenticates customer via bank challenge or behind-the-scenes verification for fraud prevention. */
79
+ authenticate(req: unknown): Promise<unknown>;
80
+ /** PaymentMethodAuthenticationService.PostAuthenticate — Validate authentication results with the issuing bank. Processes bank's authentication decision to determine if payment can proceed. */
81
+ postAuthenticate(req: unknown): Promise<unknown>;
82
+ }
83
+ export declare class GrpcPaymentMethodClient {
84
+ private ffi;
85
+ private config;
86
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
87
+ /** PaymentMethodService.Tokenize — Tokenize payment method for secure storage. Replaces raw card details with secure token for one-click payments and recurring billing. */
88
+ tokenize(req: unknown): Promise<unknown>;
89
+ /** PaymentMethodService.Create — Create payment method at connector. Establishes a new payment method and returns connector-specific details. */
90
+ create(req: unknown): Promise<unknown>;
91
+ /** PaymentMethodService.Get — Retrieve payment method details from the payment processor. */
92
+ paymentMethodGet(req: unknown): Promise<unknown>;
93
+ /** PaymentMethodService.Recharge — Recharge a payment method (wallet, gift card, prepaid card) with funds. */
94
+ recharge(req: unknown): Promise<unknown>;
95
+ /** PaymentMethodService.Eligibility — Check if the payment method is eligible for the transaction (e.g. BNPL pre-checkout check) */
96
+ eligibility(req: unknown): Promise<unknown>;
97
+ }
98
+ export declare class GrpcPaymentClient {
99
+ private ffi;
100
+ private config;
101
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
102
+ /** PaymentService.Authorize — Authorize a payment amount on a payment method. This reserves funds without capturing them, essential for verifying availability before finalizing. */
103
+ authorize(req: unknown): Promise<unknown>;
104
+ /** PaymentService.Get — Retrieve current payment status from the payment processor. Enables synchronization between your system and payment processors for accurate state tracking. */
105
+ get(req: unknown): Promise<unknown>;
106
+ /** PaymentService.Void — Cancel an authorized payment that has not been captured. Releases held funds back to the customer's payment method when a transaction cannot be completed. */
107
+ void(req: unknown): Promise<unknown>;
108
+ /** PaymentService.Reverse — Reverse a captured payment in full. Initiates a complete refund when you need to cancel a settled transaction rather than just an authorization. */
109
+ reverse(req: unknown): Promise<unknown>;
110
+ /** PaymentService.Capture — Finalize an authorized payment by transferring funds. Captures the authorized amount to complete the transaction and move funds to your merchant account. */
111
+ capture(req: unknown): Promise<unknown>;
112
+ /** PaymentService.CreateOrder — Create a payment order for later processing. Establishes a transaction context that can be authorized or captured in subsequent API calls. */
113
+ createOrder(req: unknown): Promise<unknown>;
114
+ /** PaymentService.Refund — Process a partial or full refund for a captured payment. Returns funds to the customer when goods are returned or services are cancelled. */
115
+ refund(req: unknown): Promise<unknown>;
116
+ /** PaymentService.IncrementalAuthorization — Increase the authorized amount for an existing payment. Enables you to capture additional funds when the transaction amount changes after initial authorization. */
117
+ incrementalAuthorization(req: unknown): Promise<unknown>;
118
+ /** PaymentService.VerifyRedirectResponse — Verify and process redirect responses from 3D Secure or other external flows. Validates authentication results and updates payment state accordingly. */
119
+ verifyRedirectResponse(req: unknown): Promise<unknown>;
120
+ /** PaymentService.SetupRecurring — Configure a payment method for recurring billing. Sets up the mandate and payment details needed for future automated charges. */
121
+ setupRecurring(req: unknown): Promise<unknown>;
122
+ /** PaymentService.TokenAuthorize — Authorize using a connector-issued payment method token. */
123
+ tokenAuthorize(req: unknown): Promise<unknown>;
124
+ /** PaymentService.TokenSetupRecurring — Setup a recurring mandate using a connector token. */
125
+ tokenSetupRecurring(req: unknown): Promise<unknown>;
126
+ /** PaymentService.ProxyAuthorize — Authorize using vault-aliased card data. Proxy substitutes before connector. */
127
+ proxyAuthorize(req: unknown): Promise<unknown>;
128
+ /** PaymentService.ProxySetupRecurring — Setup recurring mandate using vault-aliased card data. */
129
+ proxySetupRecurring(req: unknown): Promise<unknown>;
130
+ }
131
+ export declare class GrpcPayoutClient {
132
+ private ffi;
133
+ private config;
134
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
135
+ /** PayoutService.Create — Creates a payout. */
136
+ payoutCreate(req: unknown): Promise<unknown>;
137
+ /** PayoutService.Transfer — Creates a payout fund transfer. */
138
+ transfer(req: unknown): Promise<unknown>;
139
+ /** PayoutService.Get — Retrieve payout details. */
140
+ payoutGet(req: unknown): Promise<unknown>;
141
+ /** PayoutService.Void — Void a payout. */
142
+ payoutVoid(req: unknown): Promise<unknown>;
143
+ /** PayoutService.Stage — Stage the payout. */
144
+ stage(req: unknown): Promise<unknown>;
145
+ /** PayoutService.CreateLink — Creates a link between the recipient and the payout. */
146
+ createLink(req: unknown): Promise<unknown>;
147
+ /** PayoutService.CreateRecipient — Create payout recipient. */
148
+ createRecipient(req: unknown): Promise<unknown>;
149
+ /** PayoutService.EnrollDisburseAccount — Enroll disburse account. */
150
+ enrollDisburseAccount(req: unknown): Promise<unknown>;
151
+ /** PayoutService.Eligibility — Check if the payout method is eligible for the transaction */
152
+ payoutEligibility(req: unknown): Promise<unknown>;
153
+ }
154
+ export declare class GrpcRecurringPaymentClient {
155
+ private ffi;
156
+ private config;
157
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
158
+ /** RecurringPaymentService.Charge — Charge using an existing stored recurring payment instruction. Processes repeat payments for subscriptions or recurring billing without collecting payment details. */
159
+ charge(req: unknown): Promise<unknown>;
160
+ /** RecurringPaymentService.Revoke — Cancel an existing recurring payment mandate. Stops future automatic charges on customer's stored consent for subscription cancellations. */
161
+ revoke(req: unknown): Promise<unknown>;
162
+ }
163
+ export declare class GrpcRefundClient {
164
+ private ffi;
165
+ private config;
166
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
167
+ /** RefundService.Get — Retrieve refund status from the payment processor. Tracks refund progress through processor settlement for accurate customer communication. */
168
+ refundGet(req: unknown): Promise<unknown>;
169
+ /** RefundService.VoidPostRefund — Void/reverse a refund before processor settlement. */
170
+ voidPostRefund(req: unknown): Promise<unknown>;
171
+ }
172
+ export declare class GrpcSurchargeClient {
173
+ private ffi;
174
+ private config;
175
+ constructor(ffi: GrpcFfi, config: GrpcConfig);
176
+ /** SurchargeService.Calculate — Calculate surcharge fees for a payment amount before processing. */
177
+ calculate(req: unknown): Promise<unknown>;
178
+ }
179
+ export declare class GrpcClient {
180
+ customer: GrpcCustomerClient;
181
+ dispute: GrpcDisputeClient;
182
+ event: GrpcEventClient;
183
+ fraudAndRiskManagement: GrpcFraudAndRiskManagementClient;
184
+ merchantAuthentication: GrpcMerchantAuthenticationClient;
185
+ paymentMethodAuthentication: GrpcPaymentMethodAuthenticationClient;
186
+ paymentMethod: GrpcPaymentMethodClient;
187
+ payment: GrpcPaymentClient;
188
+ payout: GrpcPayoutClient;
189
+ recurringPayment: GrpcRecurringPaymentClient;
190
+ refund: GrpcRefundClient;
191
+ surcharge: GrpcSurchargeClient;
192
+ constructor(config: GrpcConfig, libPath?: string);
193
+ }
194
+ export {};