@tagadapay/node-sdk 0.2.1 → 1.0.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.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/dist/HttpClient.d.ts +10 -0
  3. package/dist/HttpClient.d.ts.map +1 -1
  4. package/dist/HttpClient.js +21 -6
  5. package/dist/HttpClient.js.map +1 -1
  6. package/dist/Tagada.d.ts +30 -0
  7. package/dist/Tagada.d.ts.map +1 -1
  8. package/dist/Tagada.js +6 -0
  9. package/dist/Tagada.js.map +1 -1
  10. package/dist/dashboard/client.d.ts +147 -0
  11. package/dist/dashboard/client.d.ts.map +1 -0
  12. package/dist/dashboard/client.js +243 -0
  13. package/dist/dashboard/client.js.map +1 -0
  14. package/dist/dashboard/httpTransport.d.ts +28 -0
  15. package/dist/dashboard/httpTransport.d.ts.map +1 -0
  16. package/dist/dashboard/httpTransport.js +196 -0
  17. package/dist/dashboard/httpTransport.js.map +1 -0
  18. package/dist/dashboard/index.d.ts +22 -0
  19. package/dist/dashboard/index.d.ts.map +1 -0
  20. package/dist/dashboard/index.js +22 -0
  21. package/dist/dashboard/index.js.map +1 -0
  22. package/dist/dashboard/internalTransport.d.ts +29 -0
  23. package/dist/dashboard/internalTransport.d.ts.map +1 -0
  24. package/dist/dashboard/internalTransport.js +70 -0
  25. package/dist/dashboard/internalTransport.js.map +1 -0
  26. package/dist/dashboard/types.d.ts +304 -0
  27. package/dist/dashboard/types.d.ts.map +1 -0
  28. package/dist/dashboard/types.js +50 -0
  29. package/dist/dashboard/types.js.map +1 -0
  30. package/dist/index.d.ts +3 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +9 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/resources/Partners.d.ts +133 -0
  35. package/dist/resources/Partners.d.ts.map +1 -0
  36. package/dist/resources/Partners.js +151 -0
  37. package/dist/resources/Partners.js.map +1 -0
  38. package/dist/resources/PaymentSetup.d.ts +34 -0
  39. package/dist/resources/PaymentSetup.d.ts.map +1 -0
  40. package/dist/resources/PaymentSetup.js +34 -0
  41. package/dist/resources/PaymentSetup.js.map +1 -0
  42. package/dist/resources/Plugins.d.ts +1 -1
  43. package/dist/resources/Plugins.d.ts.map +1 -1
  44. package/dist/resources/Plugins.js +10 -3
  45. package/dist/resources/Plugins.js.map +1 -1
  46. package/dist/resources/Products.d.ts +5 -1
  47. package/dist/resources/Products.d.ts.map +1 -1
  48. package/dist/resources/Products.js +6 -0
  49. package/dist/resources/Products.js.map +1 -1
  50. package/dist/resources/Threeds.d.ts +30 -0
  51. package/dist/resources/Threeds.d.ts.map +1 -0
  52. package/dist/resources/Threeds.js +32 -0
  53. package/dist/resources/Threeds.js.map +1 -0
  54. package/dist/types/index.d.ts +3 -1
  55. package/dist/types/index.d.ts.map +1 -1
  56. package/dist/types/index.js +3 -1
  57. package/dist/types/index.js.map +1 -1
  58. package/dist/types/partners.d.ts +119 -0
  59. package/dist/types/partners.d.ts.map +1 -0
  60. package/dist/types/partners.js +9 -0
  61. package/dist/types/partners.js.map +1 -0
  62. package/dist/types/paymentSetup.d.ts +67 -0
  63. package/dist/types/paymentSetup.d.ts.map +1 -0
  64. package/dist/types/paymentSetup.js +9 -0
  65. package/dist/types/paymentSetup.js.map +1 -0
  66. package/dist/types/plugins.d.ts +2 -2
  67. package/dist/types/plugins.d.ts.map +1 -1
  68. package/dist/types/products.d.ts +12 -0
  69. package/dist/types/products.d.ts.map +1 -1
  70. package/dist/types/stores.d.ts +0 -1
  71. package/dist/types/stores.d.ts.map +1 -1
  72. package/dist/types/threeds.d.ts +27 -0
  73. package/dist/types/threeds.d.ts.map +1 -0
  74. package/dist/types/threeds.js +8 -0
  75. package/dist/types/threeds.js.map +1 -0
  76. package/package.json +6 -1
@@ -0,0 +1,70 @@
1
+ function notImpl(method) {
2
+ throw new Error(`TagadaPayClient.${method}: not implemented in Phase A InternalTransport. ` +
3
+ `Wire the corresponding adapter or wait for Phase C.`);
4
+ }
5
+ /**
6
+ * Factory for the InternalTransport. Called once at Hub boot with the
7
+ * set of local services wired to their real implementations.
8
+ */
9
+ export function createInternalTransport(adapters) {
10
+ return {
11
+ kind: 'internal',
12
+ accountsCreate: async (payload, opts) => adapters.accounts.create(payload, opts),
13
+ accountsRetrieve: async (id) => adapters.accounts.retrieve(id),
14
+ accountsUpdate: async (id, patch) => {
15
+ if (!adapters.accounts.update)
16
+ notImpl('accounts.update');
17
+ return adapters.accounts.update(id, patch);
18
+ },
19
+ accountsList: async (params) => {
20
+ if (!adapters.accounts.list)
21
+ notImpl('accounts.list');
22
+ return adapters.accounts.list(params);
23
+ },
24
+ accountsUploadDocument: async (id, doc) => {
25
+ if (!adapters.accounts.uploadDocument)
26
+ notImpl('accounts.uploadDocument');
27
+ return adapters.accounts.uploadDocument(id, doc);
28
+ },
29
+ accountsListRequirements: async (id) => {
30
+ if (!adapters.accounts.listRequirements)
31
+ notImpl('accounts.listRequirements');
32
+ return adapters.accounts.listRequirements(id);
33
+ },
34
+ accountsCreateOnboardingLink: async (id) => {
35
+ if (!adapters.accounts.createOnboardingLink)
36
+ notImpl('accounts.createOnboardingLink');
37
+ return adapters.accounts.createOnboardingLink(id);
38
+ },
39
+ accountsListCapabilities: async (id) => {
40
+ if (!adapters.accounts.listCapabilities)
41
+ notImpl('accounts.listCapabilities');
42
+ return adapters.accounts.listCapabilities(id);
43
+ },
44
+ // Servicing — all deferred to Phase C.
45
+ payoutsList: async () => notImpl('payouts.list'),
46
+ payoutsRetrieve: async () => notImpl('payouts.retrieve'),
47
+ disputesList: async () => notImpl('disputes.list'),
48
+ disputesRetrieve: async () => notImpl('disputes.retrieve'),
49
+ disputesSubmitEvidence: async () => notImpl('disputes.submitEvidence'),
50
+ chargebackAlertsList: async () => notImpl('chargebackAlerts.list'),
51
+ chargebackAlertsRetrieve: async () => notImpl('chargebackAlerts.retrieve'),
52
+ chargebackAlertsAction: async () => notImpl('chargebackAlerts.action'),
53
+ balanceTransactionsList: async () => notImpl('balanceTransactions.list'),
54
+ balanceTransactionsRetrieve: async () => notImpl('balanceTransactions.retrieve'),
55
+ reportRunsCreate: async (_params) => notImpl('reportRuns.create'),
56
+ reportRunsRetrieve: async () => notImpl('reportRuns.retrieve'),
57
+ reportRunsList: async () => notImpl('reportRuns.list'),
58
+ // C15/C16/C26 — deferred to the Phase C TagadaPay app service layer.
59
+ webhookEndpointsCreate: async () => notImpl('webhookEndpoints.create'),
60
+ webhookEndpointsList: async () => notImpl('webhookEndpoints.list'),
61
+ webhookEndpointsUpdate: async () => notImpl('webhookEndpoints.update'),
62
+ webhookEndpointsDelete: async () => notImpl('webhookEndpoints.delete'),
63
+ pricingTemplatesCreate: async () => notImpl('pricingTemplates.create'),
64
+ pricingTemplatesList: async () => notImpl('pricingTemplates.list'),
65
+ pricingTemplatesRetrieve: async () => notImpl('pricingTemplates.retrieve'),
66
+ accountsPlacePaymentsRestriction: async () => notImpl('paymentsRestrictions.place'),
67
+ accountsReleasePaymentsRestriction: async () => notImpl('paymentsRestrictions.release'),
68
+ };
69
+ }
70
+ //# sourceMappingURL=internalTransport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internalTransport.js","sourceRoot":"","sources":["../../src/dashboard/internalTransport.ts"],"names":[],"mappings":"AAiDA,SAAS,OAAO,CAAC,MAAc;IAC7B,MAAM,IAAI,KAAK,CACb,mBAAmB,MAAM,kDAAkD;QACzE,qDAAqD,CACxD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA0B;IAChE,OAAO;QACL,IAAI,EAAE,UAAU;QAEhB,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC;QAChF,gBAAgB,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE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AK,IAAoC,EAAE,CAC/D,OAAO,CAAC,uBAAuB,CAAC;QAClC,sBAAsB,EAAE,KAAK,IAA8B,EAAE,CAC3D,OAAO,CAAC,yBAAyB,CAAC;QACpC,sBAAsB,EAAE,KAAK,IAAmB,EAAE,CAAC,OAAO,CAAC,yBAAyB,CAAC;QACrF,sBAAsB,EAAE,KAAK,IAA8B,EAAE,CAC3D,OAAO,CAAC,yBAAyB,CAAC;QACpC,oBAAoB,EAAE,KAAK,IAAoC,EAAE,CAC/D,OAAO,CAAC,uBAAuB,CAAC;QAClC,wBAAwB,EAAE,KAAK,IAA8B,EAAE,CAC7D,OAAO,CAAC,2BAA2B,CAAC;QACtC,gCAAgC,EAAE,KAAK,IAAsB,EAAE,CAC7D,OAAO,CAAC,4BAA4B,CAAC;QACvC,kCAAkC,EAAE,KAAK,IAAsB,EAAE,CAC/D,OAAO,CAAC,8BAA8B,CAAC;KAC1C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,304 @@
1
+ /**
2
+ * TagadaPay Dashboard SDK — public types.
3
+ *
4
+ * These are the stable shapes the SDK accepts/returns. The internal
5
+ * (Hub) and HTTP (partner) implementations MUST agree on this surface
6
+ * so we can swap one for the other with zero consumer rewrite.
7
+ *
8
+ * See plan §3.A4 and §5 C8.
9
+ */
10
+ export type Currency = string;
11
+ export interface Page<T> {
12
+ object: 'list';
13
+ data: T[];
14
+ hasMore: boolean;
15
+ nextCursor?: string;
16
+ }
17
+ export interface RequestOpts {
18
+ idempotencyKey?: string;
19
+ apiVersion?: string;
20
+ }
21
+ export interface MerchantIdentity {
22
+ legalName: string;
23
+ tradingName?: string;
24
+ country: string;
25
+ mcc?: string;
26
+ website?: string;
27
+ email?: string;
28
+ phone?: string;
29
+ registrationNumber?: string;
30
+ vatNumber?: string;
31
+ representatives?: Array<{
32
+ firstName: string;
33
+ lastName: string;
34
+ role: string;
35
+ email: string;
36
+ dateOfBirth?: string;
37
+ ownershipPercent?: number;
38
+ }>;
39
+ bankAccount?: {
40
+ currency: Currency;
41
+ last4?: string;
42
+ iban?: string;
43
+ accountNumber?: string;
44
+ routingNumber?: string;
45
+ bankName?: string;
46
+ };
47
+ }
48
+ export interface CreateAccountParams {
49
+ /** Source of the account creation — currently only 'hub' is live. */
50
+ source: 'hub' | 'partner' | 'self_serve';
51
+ /** Stable reference from the source system (hub_request_id, partner ref, ...). Used for idempotency. */
52
+ handoffId: string;
53
+ /** Kind of case: fresh onboarding vs derived maintenance/migration. */
54
+ kind?: 'onboarding' | 'maintenance' | 'migration';
55
+ /** TPA id of the previous account being migrated (when kind='migration'). */
56
+ parentTagadapayAccountId?: string;
57
+ /** Merchant tagadapay account_id (accounts.id in the monolith today). */
58
+ tagadaAccountId: string;
59
+ merchantIdentity: MerchantIdentity;
60
+ /** MerchantContractFeesV1 (validated by caller). */
61
+ merchantContract: Record<string, unknown>;
62
+ documents?: Array<{
63
+ kind: string;
64
+ displayName: string;
65
+ storageKey: string;
66
+ mimeType: string;
67
+ sizeBytes: number;
68
+ }>;
69
+ /** Hub URL to receive tpa.* events once TagadaPay provisions. */
70
+ hubCallbackUrl?: string;
71
+ }
72
+ export interface UpdateAccountParams {
73
+ merchantContract?: Record<string, unknown>;
74
+ bankAccount?: MerchantIdentity['bankAccount'];
75
+ status?: 'active' | 'paused' | 'banned' | 'closed';
76
+ }
77
+ export interface Account {
78
+ object: 'account';
79
+ id: string;
80
+ tagadaAccountId: string;
81
+ payfacProvider: string | null;
82
+ payfacMode: string | null;
83
+ providerAccountId: string | null;
84
+ status: 'pending_operator_assignment' | 'pending_provisioning' | 'active' | 'paused' | 'banned' | 'migrating' | 'closed';
85
+ hubRequestId: string | null;
86
+ createdAt: string;
87
+ activatedAt: string | null;
88
+ }
89
+ export interface DocumentUpload {
90
+ kind: string;
91
+ displayName: string;
92
+ storageKey: string;
93
+ mimeType: string;
94
+ sizeBytes: number;
95
+ }
96
+ export interface Document {
97
+ object: 'document';
98
+ id: string;
99
+ tagadapayAccountId: string;
100
+ kind: string;
101
+ status: 'uploaded' | 'approved' | 'rejected';
102
+ createdAt: string;
103
+ }
104
+ export interface Requirement {
105
+ object: 'requirement';
106
+ id: string;
107
+ tagadapayAccountId: string;
108
+ category: 'identity' | 'address' | 'bank' | 'business' | 'representative' | 'other';
109
+ code: string;
110
+ status: 'pending' | 'submitted' | 'satisfied' | 'failed';
111
+ dueAt?: string | null;
112
+ hint?: string;
113
+ }
114
+ export interface OnboardingLink {
115
+ object: 'onboarding_link';
116
+ url: string;
117
+ expiresAt: string;
118
+ }
119
+ export interface Capability {
120
+ object: 'capability';
121
+ code: string;
122
+ status: 'active' | 'pending' | 'inactive' | 'rejected';
123
+ reason?: string;
124
+ }
125
+ export interface Payout {
126
+ object: 'payout';
127
+ id: string;
128
+ tagadapayAccountId: string;
129
+ amountMinor: number;
130
+ currency: Currency;
131
+ status: 'pending' | 'in_transit' | 'paid' | 'failed' | 'canceled';
132
+ scheduledAt: string;
133
+ paidAt: string | null;
134
+ }
135
+ export interface Dispute {
136
+ object: 'dispute';
137
+ id: string;
138
+ chargeId: string;
139
+ amountMinor: number;
140
+ currency: Currency;
141
+ reason: string;
142
+ status: 'needs_response' | 'under_review' | 'won' | 'lost';
143
+ dueBy: string | null;
144
+ }
145
+ export interface ChargebackAlert {
146
+ object: 'chargeback_alert';
147
+ id: string;
148
+ chargeId: string | null;
149
+ provider: 'ethoca' | 'rdr' | 'cdrn';
150
+ status: 'open' | 'accepted' | 'refunded' | 'ignored';
151
+ amountMinor: number | null;
152
+ currency: Currency | null;
153
+ }
154
+ export interface BalanceTransaction {
155
+ object: 'balance_transaction';
156
+ id: string;
157
+ tagadapayAccountId: string;
158
+ type: string;
159
+ amountMinor: number;
160
+ feeMinor: number;
161
+ netMinor: number;
162
+ currency: Currency;
163
+ createdAt: string;
164
+ }
165
+ export interface ReportRun {
166
+ object: 'report_run';
167
+ id: string;
168
+ tagadapayAccountId: string;
169
+ reportType: string;
170
+ status: 'pending' | 'running' | 'succeeded' | 'failed';
171
+ resultUrl: string | null;
172
+ }
173
+ export interface ListAccountsParams {
174
+ cursor?: string;
175
+ limit?: number;
176
+ status?: Account['status'];
177
+ tagadaAccountId?: string;
178
+ }
179
+ export interface ListPayoutsParams {
180
+ tagadapayAccountId: string;
181
+ cursor?: string;
182
+ limit?: number;
183
+ status?: Payout['status'];
184
+ }
185
+ export interface ListDisputesParams {
186
+ tagadapayAccountId: string;
187
+ cursor?: string;
188
+ limit?: number;
189
+ status?: Dispute['status'];
190
+ }
191
+ export interface ListChargebackAlertsParams {
192
+ tagadapayAccountId: string;
193
+ cursor?: string;
194
+ limit?: number;
195
+ status?: ChargebackAlert['status'];
196
+ }
197
+ export interface ListBalanceTransactionsParams {
198
+ tagadapayAccountId: string;
199
+ cursor?: string;
200
+ limit?: number;
201
+ type?: string;
202
+ }
203
+ export interface CreateReportRunParams {
204
+ tagadapayAccountId: string;
205
+ reportType: string;
206
+ periodStart: string;
207
+ periodEnd: string;
208
+ }
209
+ /**
210
+ * Internal Hub↔TagadaPay event catalog. These are the only events the
211
+ * Hub subscribes to via the `/api/hub/tagadapay/webhook` endpoint.
212
+ */
213
+ export type TpaEventType = 'tpa.created' | 'tpa.activated' | 'tpa.requires_docs' | 'tpa.requires_field_correction' | 'tpa.failed' | 'tpa.paused' | 'tpa.banned' | 'tpa.bank_change_required' | 'tpa.migration_required' | 'tpa.migrated' | 'tpa.handoff_received' | 'tpa.provider_assigned' | 'tpa.provider_migrated';
214
+ /**
215
+ * Phase C15b — Dashboard API public webhook event catalog.
216
+ *
217
+ * This is the union of events published to merchant / partner / direct-
218
+ * API webhook endpoints (plan §5ter.20). Kept as a string literal union
219
+ * so consumers can narrow generically, with a const array below for
220
+ * runtime validation.
221
+ */
222
+ export type DashboardEventType = 'account.created' | 'account.updated' | 'account.application.submitted' | 'account.application.approved' | 'account.application.declined' | 'account.requirements.updated' | 'account.capability.updated' | 'account.bank_account.updated' | 'account.payout_config.updated' | 'account.funding_hold.placed' | 'account.funding_hold.released' | 'account.payments_restriction.placed' | 'account.payments_restriction.released' | 'document.uploaded' | 'document.verified' | 'document.rejected' | 'document.requested' | 'payout.created' | 'payout.paid' | 'payout.withdrawn' | 'payout.failed' | 'payout.updated' | 'dispute.created' | 'dispute.updated' | 'dispute.funds_withdrawn' | 'dispute.funds_reinstated' | 'dispute.evidence_submitted' | 'dispute.closed' | 'chargeback_alert.created' | 'chargeback_alert.action_taken' | 'balance.available' | 'balance_transaction.created' | 'platform_fee.created' | 'platform_fee.refunded' | 'partner_fee.created' | 'partner_fee.refunded' | 'report_run.succeeded' | 'report_run.failed';
223
+ /**
224
+ * Payment API event catalog (Main app).
225
+ * Kept here for reference so the dashboard SDK agrees on the wire shape.
226
+ */
227
+ export type PaymentEventType = 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.canceled' | 'payment.requires_action' | 'payment.processing' | 'payment.pending' | 'payment.expired' | 'payment.captured' | 'payment.capturable_updated' | 'payment.voided' | 'refund.created' | 'refund.pending' | 'refund.succeeded' | 'refund.failed' | 'refund.updated' | 'payment_method.updated' | 'payment_method.attached' | 'payment_method.detached';
228
+ export declare const DASHBOARD_EVENT_TYPES: readonly DashboardEventType[];
229
+ export interface TpaEvent<T = unknown> {
230
+ object: 'event';
231
+ id: string;
232
+ type: TpaEventType;
233
+ created: string;
234
+ apiVersion: string;
235
+ data: {
236
+ object: T;
237
+ };
238
+ }
239
+ /**
240
+ * Generic public event envelope (Stripe/Tilled aligned).
241
+ */
242
+ export interface DashboardEvent<T = unknown> {
243
+ object: 'event';
244
+ id: string;
245
+ accountId: string;
246
+ type: DashboardEventType;
247
+ created: number;
248
+ apiVersion: string;
249
+ livemode: boolean;
250
+ data: {
251
+ object: T;
252
+ previousAttributes?: Partial<T>;
253
+ };
254
+ request?: {
255
+ id: string;
256
+ idempotencyKey?: string;
257
+ };
258
+ }
259
+ export type ApplicationStatus = 'created' | 'started' | 'submitted' | 'in_review' | 'active' | 'rejected' | 'disabled' | 'withdrawn';
260
+ export interface WebhookEndpoint {
261
+ object: 'webhook_endpoint';
262
+ id: string;
263
+ url: string;
264
+ secret?: string;
265
+ mode: 'test' | 'live';
266
+ enabledEvents: DashboardEventType[];
267
+ apiVersion: string;
268
+ status: 'enabled' | 'disabled';
269
+ createdAt: string;
270
+ }
271
+ export interface CreateWebhookEndpointParams {
272
+ url: string;
273
+ enabledEvents: DashboardEventType[];
274
+ mode?: 'test' | 'live';
275
+ apiVersion?: string;
276
+ ownerType: 'merchant' | 'platform' | 'partner';
277
+ ownerId: string;
278
+ }
279
+ export interface PricingTemplate {
280
+ object: 'pricing_template';
281
+ id: string;
282
+ name: string;
283
+ description: string | null;
284
+ allowsSelfServeSchedule: boolean;
285
+ status: 'active' | 'archived';
286
+ contract: Record<string, unknown>;
287
+ createdAt: string;
288
+ }
289
+ export interface ListCapabilitiesParams {
290
+ tagadapayAccountId: string;
291
+ }
292
+ export interface PaymentsRestriction {
293
+ mode: 'blocked' | 'limited';
294
+ limit?: {
295
+ maxPerDayMinor: number;
296
+ currency: Currency;
297
+ };
298
+ reason: 'fraud_investigation' | 'banned' | 'volume_cap' | 'manual_ops' | 'scheme_compliance';
299
+ placedAt: string;
300
+ placedBy: string;
301
+ expiresAt?: string;
302
+ note: string;
303
+ }
304
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dashboard/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MA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AAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,uBAAuB,EAAE,OAAO,CAAC;IACjC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAMD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC;IACvD,MAAM,EACF,qBAAqB,GACrB,QAAQ,GACR,YAAY,GACZ,YAAY,GACZ,mBAAmB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * TagadaPay Dashboard SDK — public types.
3
+ *
4
+ * These are the stable shapes the SDK accepts/returns. The internal
5
+ * (Hub) and HTTP (partner) implementations MUST agree on this surface
6
+ * so we can swap one for the other with zero consumer rewrite.
7
+ *
8
+ * See plan §3.A4 and §5 C8.
9
+ */
10
+ export const DASHBOARD_EVENT_TYPES = [
11
+ 'account.created',
12
+ 'account.updated',
13
+ 'account.application.submitted',
14
+ 'account.application.approved',
15
+ 'account.application.declined',
16
+ 'account.requirements.updated',
17
+ 'account.capability.updated',
18
+ 'account.bank_account.updated',
19
+ 'account.payout_config.updated',
20
+ 'account.funding_hold.placed',
21
+ 'account.funding_hold.released',
22
+ 'account.payments_restriction.placed',
23
+ 'account.payments_restriction.released',
24
+ 'document.uploaded',
25
+ 'document.verified',
26
+ 'document.rejected',
27
+ 'document.requested',
28
+ 'payout.created',
29
+ 'payout.paid',
30
+ 'payout.withdrawn',
31
+ 'payout.failed',
32
+ 'payout.updated',
33
+ 'dispute.created',
34
+ 'dispute.updated',
35
+ 'dispute.funds_withdrawn',
36
+ 'dispute.funds_reinstated',
37
+ 'dispute.evidence_submitted',
38
+ 'dispute.closed',
39
+ 'chargeback_alert.created',
40
+ 'chargeback_alert.action_taken',
41
+ 'balance.available',
42
+ 'balance_transaction.created',
43
+ 'platform_fee.created',
44
+ 'platform_fee.refunded',
45
+ 'partner_fee.created',
46
+ 'partner_fee.refunded',
47
+ 'report_run.succeeded',
48
+ 'report_run.failed',
49
+ ];
50
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dashboard/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgWH,MAAM,CAAC,MAAM,qBAAqB,GAAkC;IAClE,iBAAiB;IACjB,iBAAiB;IACjB,+BAA+B;IAC/B,8BAA8B;IAC9B,8BAA8B;IAC9B,8BAA8B;IAC9B,4BAA4B;IAC5B,8BAA8B;IAC9B,+BAA+B;IAC/B,6BAA6B;IAC7B,+BAA+B;IAC/B,qCAAqC;IACrC,uCAAuC;IACvC,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,gBAAgB;IAChB,aAAa;IACb,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,yBAAyB;IACzB,0BAA0B;IAC1B,4BAA4B;IAC5B,gBAAgB;IAChB,0BAA0B;IAC1B,+BAA+B;IAC/B,mBAAmB;IACnB,6BAA6B;IAC7B,sBAAsB;IACtB,uBAAuB;IACvB,qBAAqB;IACrB,sBAAsB;IACtB,sBAAsB;IACtB,mBAAmB;CACX,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,5 +2,7 @@ export { Tagada } from './Tagada.js';
2
2
  export { Tagada as default } from './Tagada.js';
3
3
  export * from './types/index.js';
4
4
  export * from './errors/index.js';
5
- export type { Payments, Customers, Orders, Stores, Subscriptions, Products, Checkout, PaymentFlows, PaymentInstruments, Webhooks, Funnels, Events, Processors, Domains, Promotions, PromotionCodes, BlockRules, Plugins, Offers, CheckoutOffers, EmailTemplates, } from './resources/index.js';
5
+ export type { Payments, Customers, Orders, Stores, Subscriptions, Products, Checkout, PaymentFlows, PaymentInstruments, Webhooks, Funnels, Events, Processors, Domains, Promotions, PromotionCodes, BlockRules, Plugins, Offers, CheckoutOffers, } from './resources/index.js';
6
+ export { TagadaPayClient, type ClientTransport, type TagadaPayClientConfig, createInternalTransport, type InternalAdapters, createHttpTransport, TagadaPayApiError, type HttpTransportConfig, } from './dashboard/index.js';
7
+ export * from './dashboard/types.js';
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAElC,YAAY,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,MAAM,EACN,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,cAAc,EACd,UAAU,EACV,OAAO,EACP,MAAM,EACN,cAAc,EACd,cAAc,GACf,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAElC,YAAY,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,MAAM,EACN,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,cAAc,EACd,UAAU,EACV,OAAO,EACP,MAAM,EACN,cAAc,GACf,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -2,4 +2,13 @@ export { Tagada } from './Tagada.js';
2
2
  export { Tagada as default } from './Tagada.js';
3
3
  export * from './types/index.js';
4
4
  export * from './errors/index.js';
5
+ // ─────────────────────────────────────────────────────────────────
6
+ // Pluggable-transport client — used by the Hub's in-process
7
+ // TagadaPay handoff (`InternalTransport`) and any external caller
8
+ // that wants the lower-level partner HTTP surface (`HttpTransport`).
9
+ // New partner / external code should prefer the modern `Tagada`
10
+ // client + `tagada.partners.*` namespace above.
11
+ // ─────────────────────────────────────────────────────────────────
12
+ export { TagadaPayClient, createInternalTransport, createHttpTransport, TagadaPayApiError, } from './dashboard/index.js';
13
+ export * from './dashboard/types.js';
5
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAyBlC,oEAAoE;AACpE,4DAA4D;AAC5D,kEAAkE;AAClE,qEAAqE;AACrE,gEAAgE;AAChE,gDAAgD;AAChD,oEAAoE;AACpE,OAAO,EACL,eAAe,EAGf,uBAAuB,EAEvB,mBAAmB,EACnB,iBAAiB,GAElB,MAAM,sBAAsB,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,133 @@
1
+ import { BaseResource } from './BaseResource.js';
2
+ import type { RequestOptions } from '../types/common.js';
3
+ import type { PartnerAccount, PartnerAccountCreateParams, PartnerAccountListParams, PartnerAccountUpdateParams, PartnerAccountRepointStoreParams, PartnerApiKey, PartnerApiKeyCreated, PartnerApiKeyCreateParams, PartnerRequirement, PartnerRequirementUpdateParams, PartnerDocument, PartnerDocumentRecordParams } from '../types/partners.js';
4
+ /**
5
+ * Partner Accounts resource (`tagada.partners.accounts.*`).
6
+ *
7
+ * Wraps `/api/tagadapay/v1/accounts`. Used by partners (PSPs, marketplaces,
8
+ * embedded-payments platforms) to provision and manage sub-merchants (TPAs).
9
+ *
10
+ * Each `create()` call atomically creates:
11
+ * 1. an `accounts` row (private namespace, no Clerk user — never auto-invited)
12
+ * 2. a `stores` row (auto-provisioned, `1 TPA = 1 store` invariant)
13
+ * 3. a `tagadapay_accounts` row (the TPA itself)
14
+ *
15
+ * Idempotency: pass `externalRef` to make `create()` idempotent on retries.
16
+ * A second call with the same `(partnerId, externalRef)` returns the existing TPA.
17
+ */
18
+ export declare class PartnerAccounts extends BaseResource {
19
+ /**
20
+ * Provision a new sub-merchant. Atomically creates the `accounts` row,
21
+ * the auto-provisioned store, and the TPA in a single round-trip.
22
+ *
23
+ * @example
24
+ * const tpa = await tagada.partners.accounts.create({
25
+ * legalName: 'Acme SAS',
26
+ * country: 'FR',
27
+ * currency: 'EUR',
28
+ * externalRef: 'merchant_42', // your own id — used for idempotency
29
+ * });
30
+ * // → { id: 'tpa_xxx', storeId: 'store_xxx', accountId: 'acc_xxx', ... }
31
+ */
32
+ create(params: PartnerAccountCreateParams, opts?: RequestOptions): Promise<PartnerAccount>;
33
+ retrieve(tpaId: string, opts?: RequestOptions): Promise<PartnerAccount>;
34
+ /**
35
+ * Look up a TPA by your own external reference (e.g. your merchant id).
36
+ * Returns `null` if no TPA matches.
37
+ */
38
+ retrieveByExternalRef(externalRef: string, opts?: RequestOptions): Promise<PartnerAccount | null>;
39
+ list(params?: PartnerAccountListParams, opts?: RequestOptions): Promise<{
40
+ data: PartnerAccount[];
41
+ hasMore: boolean;
42
+ }>;
43
+ update(tpaId: string, params: PartnerAccountUpdateParams, opts?: RequestOptions): Promise<PartnerAccount>;
44
+ /**
45
+ * Move the TPA from its current store to `targetStoreId`. The target
46
+ * store MUST belong to the same `accounts` row — we never let a TPA
47
+ * cross merchant entities. The old store stays intact (orphaned from
48
+ * any active TPA) so historical data remains accessible.
49
+ *
50
+ * NOT YET IMPLEMENTED — the corresponding backend route
51
+ * (`POST /api/tagadapay/v1/accounts/:id/repoint_store`) ships in a
52
+ * later phase. This stub throws synchronously so partner code
53
+ * doesn&rsquo;t depend on a route that 404s in production. Track the
54
+ * upstream ticket before re-enabling.
55
+ *
56
+ * @internal
57
+ */
58
+ repointStore(_tpaId: string, _params: PartnerAccountRepointStoreParams, _opts?: RequestOptions): Promise<PartnerAccount>;
59
+ /**
60
+ * Send a TagadaPay portal invitation to the merchant. Only meaningful
61
+ * when the partner&rsquo;s `merchantPortalAccess` policy is `'on_request'`.
62
+ *
63
+ * NOT YET IMPLEMENTED — the corresponding backend route
64
+ * (`POST /api/tagadapay/v1/accounts/:id/onboarding_link`) ships
65
+ * alongside the merchant-portal access policy enforcement. Stub
66
+ * throws synchronously to prevent silent 404s in partner code.
67
+ *
68
+ * @internal
69
+ */
70
+ invite(_tpaId: string, _opts?: RequestOptions): Promise<{
71
+ url: string;
72
+ expiresAt: string;
73
+ }>;
74
+ }
75
+ /**
76
+ * Partner API keys resource (`tagada.partners.apiKeys.*`).
77
+ *
78
+ * Sub-keys are restricted to a single TPA. Use sub-keys (not the partner key)
79
+ * for charging — smaller blast radius if either leaks.
80
+ */
81
+ export declare class PartnerApiKeys extends BaseResource {
82
+ /**
83
+ * Mint a sub-key restricted to one TPA. The plaintext `secret` is
84
+ * returned ONLY on creation — store it immediately in your secret manager.
85
+ */
86
+ create(tpaId: string, params?: PartnerApiKeyCreateParams, opts?: RequestOptions): Promise<PartnerApiKeyCreated>;
87
+ list(tpaId: string, opts?: RequestOptions): Promise<{
88
+ data: PartnerApiKey[];
89
+ }>;
90
+ /**
91
+ * Revoke a sub-key. Subsequent calls with that secret get HTTP 401.
92
+ * In-flight calls complete normally. Irreversible &mdash; mint a new key
93
+ * and deploy it before revoking.
94
+ */
95
+ revoke(apiKeyId: string, opts?: RequestOptions): Promise<{
96
+ id: string;
97
+ status: 'revoked';
98
+ }>;
99
+ }
100
+ /**
101
+ * Partner KYB requirements resource (`tagada.partners.requirements.*`).
102
+ */
103
+ export declare class PartnerRequirements extends BaseResource {
104
+ list(tpaId: string, opts?: RequestOptions): Promise<{
105
+ data: PartnerRequirement[];
106
+ }>;
107
+ update(tpaId: string, code: string, params: PartnerRequirementUpdateParams, opts?: RequestOptions): Promise<PartnerRequirement>;
108
+ }
109
+ /**
110
+ * Partner KYB documents resource (`tagada.partners.documents.*`).
111
+ *
112
+ * v1 ships only the metadata-only path. Document bytes live in S3 — you
113
+ * upload directly via a presigned URL we issue (`getUploadUrl()`), then
114
+ * call `record()` with the resulting `storageUrl` to attach metadata.
115
+ */
116
+ export declare class PartnerDocuments extends BaseResource {
117
+ list(tpaId: string, opts?: RequestOptions): Promise<{
118
+ data: PartnerDocument[];
119
+ }>;
120
+ record(params: PartnerDocumentRecordParams, opts?: RequestOptions): Promise<PartnerDocument>;
121
+ }
122
+ /**
123
+ * Aggregator class exposed as `tagada.partners`. Holds the per-resource
124
+ * sub-clients so you can write `tagada.partners.accounts.create(...)`.
125
+ */
126
+ export declare class Partners {
127
+ readonly accounts: PartnerAccounts;
128
+ readonly apiKeys: PartnerApiKeys;
129
+ readonly requirements: PartnerRequirements;
130
+ readonly documents: PartnerDocuments;
131
+ constructor(client: ConstructorParameters<typeof PartnerAccounts>[0]);
132
+ }
133
+ //# sourceMappingURL=Partners.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Partners.d.ts","sourceRoot":"","sources":["../../src/resources/Partners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,aAAa,EACb,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,8BAA8B,EAC9B,eAAe,EACf,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AACH,qBAAa,eAAgB,SAAQ,YAAY;IAC/C;;;;;;;;;;;;OAYG;IACG,MAAM,CACV,MAAM,EAAE,0BAA0B,EAClC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,cAAc,CAAC;IAIpB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAA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