@tagadapay/node-sdk 1.2.1 → 2.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.
Files changed (43) hide show
  1. package/README.md +82 -0
  2. package/dist/HttpClient.d.ts +21 -7
  3. package/dist/HttpClient.d.ts.map +1 -1
  4. package/dist/HttpClient.js +38 -13
  5. package/dist/HttpClient.js.map +1 -1
  6. package/dist/Tagada.d.ts +24 -5
  7. package/dist/Tagada.d.ts.map +1 -1
  8. package/dist/Tagada.js +4 -0
  9. package/dist/Tagada.js.map +1 -1
  10. package/dist/cli/init.js +4 -2
  11. package/dist/cli/init.js.map +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/resources/Partners.d.ts +62 -111
  16. package/dist/resources/Partners.d.ts.map +1 -1
  17. package/dist/resources/Partners.js +70 -121
  18. package/dist/resources/Partners.js.map +1 -1
  19. package/dist/resources/Processing.d.ts +129 -0
  20. package/dist/resources/Processing.d.ts.map +1 -0
  21. package/dist/resources/Processing.js +153 -0
  22. package/dist/resources/Processing.js.map +1 -0
  23. package/dist/resources/TaxExemptions.d.ts +23 -0
  24. package/dist/resources/TaxExemptions.d.ts.map +1 -0
  25. package/dist/resources/TaxExemptions.js +25 -0
  26. package/dist/resources/TaxExemptions.js.map +1 -0
  27. package/dist/resources/index.d.ts +1 -0
  28. package/dist/resources/index.d.ts.map +1 -1
  29. package/dist/resources/index.js +1 -0
  30. package/dist/resources/index.js.map +1 -1
  31. package/dist/types/index.d.ts +1 -0
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/types/index.js +1 -0
  34. package/dist/types/index.js.map +1 -1
  35. package/dist/types/partners.d.ts +127 -52
  36. package/dist/types/partners.d.ts.map +1 -1
  37. package/dist/types/partners.js +20 -4
  38. package/dist/types/partners.js.map +1 -1
  39. package/dist/types/taxExemptions.d.ts +25 -0
  40. package/dist/types/taxExemptions.d.ts.map +1 -0
  41. package/dist/types/taxExemptions.js +2 -0
  42. package/dist/types/taxExemptions.js.map +1 -0
  43. package/package.json +1 -1
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Processing domain (TagadaPay payfac), served on `/api/tagadapay/v1`.
3
+ *
4
+ * The same resource classes back two SDK entry points, differing only by a
5
+ * URL prefix:
6
+ * - `tagada.processing.*` → direct merchant, prefix `''`
7
+ * - `tagada.partners.processing.*` → partner "on behalf of", prefix `/partner`
8
+ */
9
+ /** Processing keys (`tp_sk_…`), each scoped to one TPA. */
10
+ export class ProcessingKeys {
11
+ constructor(client, prefix) {
12
+ this.client = client;
13
+ this.prefix = prefix;
14
+ }
15
+ /**
16
+ * Mint a processing key restricted to one TPA. The plaintext `secret` is
17
+ * returned ONLY on creation — store it immediately in your secret manager.
18
+ */
19
+ async create(tpaId, params, opts) {
20
+ return this.client.processingPost(`${this.prefix}/tpas/${tpaId}/keys`, params ?? {}, opts);
21
+ }
22
+ async list(tpaId, opts) {
23
+ return this.client.processingGet(`${this.prefix}/tpas/${tpaId}/keys`, undefined, opts);
24
+ }
25
+ /** Revoke a processing key. Subsequent calls with that secret get HTTP 401. */
26
+ async revoke(keyId, opts) {
27
+ return this.client.processingDel(`${this.prefix}/keys/${keyId}`, undefined, opts);
28
+ }
29
+ }
30
+ /** KYB requirements for a TPA. */
31
+ export class ProcessingRequirements {
32
+ constructor(client, prefix) {
33
+ this.client = client;
34
+ this.prefix = prefix;
35
+ }
36
+ async list(tpaId, opts) {
37
+ return this.client.processingGet(`${this.prefix}/tpas/${tpaId}/requirements`, undefined, opts);
38
+ }
39
+ /**
40
+ * Submit a value for a non-document requirement (e.g. `business.vat_number`,
41
+ * `banking.iban`). The requirement flips to `pending_verification` — it is
42
+ * never set directly to `satisfied` (Tagada ops / a provider verify it).
43
+ * Document requirements are satisfied via `documents.record()` instead.
44
+ */
45
+ async update(tpaId, code, value, opts) {
46
+ return this.client.processingPatch(`${this.prefix}/tpas/${tpaId}/requirements/${code}`, { value }, opts);
47
+ }
48
+ }
49
+ /**
50
+ * KYB documents for a TPA. v1 ships only the metadata path: upload bytes to
51
+ * S3 via a presigned URL, then `record()` the resulting `storageUrl`.
52
+ */
53
+ export class ProcessingDocuments {
54
+ constructor(client, prefix) {
55
+ this.client = client;
56
+ this.prefix = prefix;
57
+ }
58
+ async list(tpaId, opts) {
59
+ return this.client.processingGet(`${this.prefix}/tpas/${tpaId}/documents`, undefined, opts);
60
+ }
61
+ async record(tpaId, params, opts) {
62
+ return this.client.processingPost(`${this.prefix}/tpas/${tpaId}/documents`, params, opts);
63
+ }
64
+ /**
65
+ * Upload a KYB document's raw bytes AND record it in one call — the
66
+ * programmatic equivalent of a merchant dropping a file on the onboarding
67
+ * form. Tagada stores the file and links it to the TPA (and, when
68
+ * `requirementCode` is given, flips that `documents.*` requirement to
69
+ * `pending_verification`).
70
+ *
71
+ * `file` is a `Blob` (Node 18+ exposes `Blob` and `FormData` globally; use
72
+ * `new Blob([buffer])` or a `File`). Allowed: PDF, JPG, PNG, WEBP, HEIC,
73
+ * up to 10MB.
74
+ *
75
+ * @example
76
+ * import { readFile } from 'node:fs/promises';
77
+ * const bytes = await readFile('./registration.pdf');
78
+ * await tagada.partners.processing.tpas.documents.upload(tpaId, {
79
+ * file: new Blob([bytes], { type: 'application/pdf' }),
80
+ * filename: 'registration.pdf',
81
+ * kind: 'company_registration',
82
+ * requirementCode: 'documents.company_registration',
83
+ * });
84
+ */
85
+ async upload(tpaId, params, opts) {
86
+ const form = new FormData();
87
+ form.append('file', params.file, params.filename);
88
+ form.append('kind', params.kind);
89
+ form.append('filename', params.filename);
90
+ if (params.requirementCode)
91
+ form.append('requirementCode', params.requirementCode);
92
+ return this.client.processingPostForm(`${this.prefix}/tpas/${tpaId}/documents/upload`, form, opts);
93
+ }
94
+ }
95
+ /**
96
+ * TagadaPay Accounts (TPAs) — the processing provisioning surface.
97
+ * A merchant (`acc_xxx`) can own multiple TPAs (`tpa_xxx`).
98
+ */
99
+ export class ProcessingTpas {
100
+ constructor(client, prefix) {
101
+ this.client = client;
102
+ this.prefix = prefix;
103
+ this.keys = new ProcessingKeys(client, prefix);
104
+ this.requirements = new ProcessingRequirements(client, prefix);
105
+ this.documents = new ProcessingDocuments(client, prefix);
106
+ }
107
+ /**
108
+ * Provision a new TPA. Pass `accountId` to attach it to an existing
109
+ * merchant (the multi-TPA case). Pass `externalRef` for idempotency.
110
+ *
111
+ * @example
112
+ * const tpa = await tagada.partners.processing.tpas.create({
113
+ * accountId: 'acc_xxx',
114
+ * country: 'FR', currency: 'EUR',
115
+ * externalRef: 'merchant_42_eu',
116
+ * });
117
+ */
118
+ async create(params, opts) {
119
+ return this.client.processingPost(`${this.prefix}/tpas`, params, opts);
120
+ }
121
+ async retrieve(tpaId, opts) {
122
+ return this.client.processingGet(`${this.prefix}/tpas/${tpaId}`, undefined, opts);
123
+ }
124
+ /** Look up a TPA by your own external reference. Returns `null` if none match. */
125
+ async retrieveByExternalRef(externalRef, opts) {
126
+ const list = await this.client.processingGet(`${this.prefix}/tpas`, { externalRef, limit: 1 }, opts);
127
+ return list.data?.[0] ?? null;
128
+ }
129
+ async list(params, opts) {
130
+ return this.client.processingGet(`${this.prefix}/tpas`, params, opts);
131
+ }
132
+ /**
133
+ * Re-point a TPA to a different store within the same merchant. This is the
134
+ * only mutation `PATCH /tpas/:id` exposes today — other fields (`status`,
135
+ * KYB outcomes) are operator-driven. The target store must belong to the
136
+ * same merchant (`acc_xxx`); crossing merchants is refused server-side.
137
+ */
138
+ async repointStore(tpaId, storeId, opts) {
139
+ return this.client.processingPatch(`${this.prefix}/tpas/${tpaId}`, { storeId }, opts);
140
+ }
141
+ }
142
+ /**
143
+ * Top-level processing namespace exposed as `tagada.processing`. For a direct
144
+ * merchant managing their own TPAs. Requires a key with processing access on
145
+ * the merchant (a partner key, or a merchant whose account has processing).
146
+ */
147
+ export class Processing {
148
+ constructor(client) {
149
+ // Direct surface — no `/partner` prefix.
150
+ this.tpas = new ProcessingTpas(client, '');
151
+ }
152
+ }
153
+ //# sourceMappingURL=Processing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Processing.js","sourceRoot":"","sources":["../../src/resources/Processing.ts"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,2DAA2D;AAC3D,MAAM,OAAO,cAAc;IACzB,YACmB,MAAkB,EAClB,MAAc;QADd,WAAM,GAAN,MAAM,CAAY;QAClB,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ;;;OAGG;IACH,KAAK,CAAC,MAAM,CACV,KAAa,EACb,MAAkC,EAClC,IAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAC/B,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,OAAO,EACnC,MAAM,IAAI,EAAE,EACZ,IAAI,CACL,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAa,EAAE,IAAqB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAC9B,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,OAAO,EACnC,SAAS,EACT,IAAI,CACL,CAAC;IACJ,CAAC;IAED,+EAA+E;IAC/E,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,IAAqB;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAC9B,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,EAAE,EAC9B,SAAS,EACT,IAAI,CACL,CAAC;IACJ,CAAC;CACF;AAED,kCAAkC;AAClC,MAAM,OAAO,sBAAsB;IACjC,YACmB,MAAkB,EAClB,MAAc;QADd,WAAM,GAAN,MAAM,CAAY;QAClB,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,KAAa,EAAE,IAAqB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAC9B,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,eAAe,EAC3C,SA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L,CAAC;QACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,MAAsB,EAAE,IAAqB;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAC9B,GAAG,IAAI,CAAC,MAAM,OAAO,EACrB,MAA6C,EAC7C,IAAI,CACL,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAAC,KAAa,EAAE,OAAe,EAAE,IAAqB;QACtE,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAM,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;IAC7F,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,UAAU;IAGrB,YAAY,MAAkB;QAC5B,yCAAyC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ import type { RequestOptions } from '../types/common.js';
2
+ import type { TaxExemption, TaxExemptionCreateParams, TaxExemptionListParams, TaxExemptionListResult, TaxExemptionDeleteParams } from '../types/taxExemptions.js';
3
+ import { BaseResource } from './BaseResource.js';
4
+ export declare class TaxExemptions extends BaseResource {
5
+ /**
6
+ * Bulk-create tax exemptions for a store.
7
+ *
8
+ * Customers whose email matches an exemption are excluded from tax
9
+ * calculations at checkout.
10
+ */
11
+ create(params: TaxExemptionCreateParams, opts?: RequestOptions): Promise<TaxExemption[]>;
12
+ /**
13
+ * List tax exemptions for a store with pagination.
14
+ */
15
+ list(params: TaxExemptionListParams, opts?: RequestOptions): Promise<TaxExemptionListResult>;
16
+ /**
17
+ * Delete one or more tax exemptions by ID.
18
+ */
19
+ del(params: TaxExemptionDeleteParams, opts?: RequestOptions): Promise<{
20
+ success: boolean;
21
+ }>;
22
+ }
23
+ //# sourceMappingURL=TaxExemptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaxExemptions.d.ts","sourceRoot":"","sources":["../../src/resources/TaxExemptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,aAAc,SAAQ,YAAY;IAC7C;;;;;OAKG;IACG,MAAM,CACV,MAAM,EAAE,wBAAwB,EAChC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,YAAY,EAAE,CAAC;IAI1B;;OAEG;IACG,IAAI,CACR,MAAM,EAAE,sBAAsB,EAC9B,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,sBAAsB,CAAC;IAIlC;;OAEG;IACG,GAAG,CACP,MAAM,EAAE,wBAAwB,EAChC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAGjC"}
@@ -0,0 +1,25 @@
1
+ import { BaseResource } from './BaseResource.js';
2
+ export class TaxExemptions extends BaseResource {
3
+ /**
4
+ * Bulk-create tax exemptions for a store.
5
+ *
6
+ * Customers whose email matches an exemption are excluded from tax
7
+ * calculations at checkout.
8
+ */
9
+ async create(params, opts) {
10
+ return this._post('/tax-exemptions', params, opts);
11
+ }
12
+ /**
13
+ * List tax exemptions for a store with pagination.
14
+ */
15
+ async list(params, opts) {
16
+ return this._get('/tax-exemptions', params, opts);
17
+ }
18
+ /**
19
+ * Delete one or more tax exemptions by ID.
20
+ */
21
+ async del(params, opts) {
22
+ return this._del('/tax-exemptions', params, opts);
23
+ }
24
+ }
25
+ //# sourceMappingURL=TaxExemptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaxExemptions.js","sourceRoot":"","sources":["../../src/resources/TaxExemptions.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,MAAgC,EAChC,IAAqB;QAErB,OAAO,IAAI,CAAC,KAAK,CAAiB,iBAAiB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,MAA8B,EAC9B,IAAqB;QAErB,OAAO,IAAI,CAAC,IAAI,CAAyB,iBAAiB,EAAE,MAA4C,EAAE,IAAI,CAAC,CAAC;IAClH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,MAAgC,EAChC,IAAqB;QAErB,OAAO,IAAI,CAAC,IAAI,CAAuB,iBAAiB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;CACF"}
@@ -20,4 +20,5 @@ export { Offers } from './Offers.js';
20
20
  export { CheckoutOffers } from './CheckoutOffers.js';
21
21
  export { EmailTemplates } from './EmailTemplates.js';
22
22
  export { ShippingRates } from './ShippingRates.js';
23
+ export { TaxExemptions } from './TaxExemptions.js';
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,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E,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -20,4 +20,5 @@ export { Offers } from './Offers.js';
20
20
  export { CheckoutOffers } from './CheckoutOffers.js';
21
21
  export { EmailTemplates } from './EmailTemplates.js';
22
22
  export { ShippingRates } from './ShippingRates.js';
23
+ export { TaxExemptions } from './TaxExemptions.js';
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,S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AM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -21,4 +21,5 @@ export * from './emailTemplates.js';
21
21
  export * from './partners.js';
22
22
  export * from './paymentSetup.js';
23
23
  export * from './threeds.js';
24
+ export * from './taxExemptions.js';
24
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc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cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
@@ -21,4 +21,5 @@ export * from './emailTemplates.js';
21
21
  export * from './partners.js';
22
22
  export * from './paymentSetup.js';
23
23
  export * from './threeds.js';
24
+ export * from './taxExemptions.js';
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
@@ -1,76 +1,141 @@
1
- export interface PartnerAccount {
2
- object: 'account';
3
- /** TagadaPay Account id (`tpa_xxx`). */
1
+ /**
2
+ * A Tagada CRM merchant — the organization/account that owns stores,
3
+ * products, orders and CRM keys. Identified by `acc_xxx`.
4
+ */
5
+ export interface Merchant {
6
+ object: 'merchant';
7
+ /** Tagada CRM account id (`acc_xxx`). */
4
8
  id: string;
5
- /** Underlying owning `accounts` row (`acc_xxx`). */
6
- accountId: string;
7
- /**
8
- * Currently bound store. Auto-created on TPA creation (1 TPA → 1 store
9
- * invariant). Mutable via `repointStore()`. Null only for legacy TPAs
10
- * created before the auto-store migration.
11
- */
12
- storeId: string | null;
13
- partnerId: string;
14
- partnerExternalRef: string | null;
15
- status: string;
16
- applicationStatus: string;
17
- mode: 'live' | 'test';
9
+ legalName: string | null;
10
+ /** Partner-supplied stable reference (idempotency / your own merchant id). */
11
+ externalRef: string | null;
12
+ country: string | null;
13
+ currency: string | null;
14
+ /** `partner_managed` when provisioned by a partner with no Clerk user yet. */
15
+ managementMode: 'self_serve' | 'partner_managed';
18
16
  createdAt: string;
19
17
  }
20
- export interface PartnerAccountCreateParams {
21
- /** Required the legal entity going through KYB. */
18
+ export interface MerchantCreateParams {
19
+ /** Legal entity name for the merchant. */
22
20
  legalName: string;
23
- /** ISO 3166-1 alpha-2 country code. */
24
21
  country?: string;
25
- /** ISO 4217 settlement currency code. */
26
22
  currency?: string;
27
23
  /**
28
- * Partner-supplied stable id used as the idempotency key. A second
29
- * call with the same value returns the same TPA (created=false).
24
+ * Partner-supplied stable id used as the idempotency key. A second call
25
+ * with the same `(partnerId, externalRef)` returns the existing merchant.
30
26
  * Can also be passed via the `Idempotency-Key` header — body wins.
31
27
  */
32
28
  externalRef?: string;
33
- /** Free-form metadata bag. Stored on `tagadapay_accounts.merchantContractSnapshot`. */
34
29
  metadata?: Record<string, unknown>;
35
30
  }
36
- export interface PartnerAccountListParams {
37
- /** Limit per page. Defaults to 50. */
31
+ export interface MerchantListParams {
38
32
  limit?: number;
33
+ cursor?: string;
34
+ /** Filter by your own merchant reference. */
35
+ externalRef?: string;
39
36
  }
40
- export interface PartnerAccountUpdateParams {
41
- metadata?: Record<string, unknown>;
42
- partnerExternalRef?: string;
37
+ /**
38
+ * A CRM Key grants access to the CRM API (`/api/public/v1/*`) for one
39
+ * merchant. New keys use the `sk_crm_…` format; legacy UUID keys remain
40
+ * valid. The plaintext token is returned ONLY on creation.
41
+ */
42
+ export interface CrmKey {
43
+ object: 'crm_key';
44
+ id: string;
45
+ /** Merchant this key is scoped to (`acc_xxx`). */
46
+ accountId: string;
47
+ name: string;
48
+ /** Token prefix for display, e.g. `sk_crm_live_a1b2…`. */
49
+ prefix: string;
50
+ orgRole: string;
51
+ revoked: boolean;
52
+ createdAt: string;
53
+ expiresAt: string | null;
43
54
  }
44
- export interface PartnerAccountRepointStoreParams {
55
+ export interface CrmKeyCreated extends CrmKey {
45
56
  /**
46
- * Target store id. Must belong to the SAME `accounts` row as the TPA —
47
- * we never let a TPA cross merchant entities.
57
+ * Plaintext CRM Key (`sk_crm_live_…` / `sk_crm_test_…`). Returned ONLY on
58
+ * creation store it immediately. The server keeps a hash only.
48
59
  */
49
- targetStoreId: string;
60
+ token: string;
61
+ }
62
+ export interface CrmKeyCreateParams {
63
+ /** Optional human label. Auto-generated from the partner name when omitted. */
64
+ name?: string;
65
+ mode?: 'live' | 'test';
50
66
  }
51
- export interface PartnerApiKey {
52
- object: 'api_key';
67
+ /**
68
+ * A TagadaPay Account (TPA) — one payfac processing context. Belongs to
69
+ * exactly one merchant (`acc_xxx`); a merchant may own several TPAs
70
+ * (e.g. one per settlement region). Identified by `tpa_xxx`.
71
+ */
72
+ export interface Tpa {
73
+ object: 'tpa';
74
+ /** TagadaPay Account id (`tpa_xxx`). */
75
+ id: string;
76
+ /** Owning CRM merchant (`acc_xxx`). */
77
+ accountId: string;
78
+ /**
79
+ * Bound store. Auto-created on TPA creation (1 TPA → 1 store invariant).
80
+ * Null only for legacy TPAs created before the auto-store migration.
81
+ */
82
+ storeId: string | null;
83
+ /** Owning partner (`par_xxx`), when provisioned on behalf of a merchant. */
84
+ partnerId?: string | null;
85
+ externalRef: string | null;
86
+ status: string;
87
+ applicationStatus: string;
88
+ mode: 'live' | 'test';
89
+ createdAt: string;
90
+ }
91
+ export interface TpaCreateParams {
92
+ /**
93
+ * Owning merchant (`acc_xxx`). Required for `partners.processing.tpas.create`
94
+ * and for a direct merchant adding an additional TPA. Omit only when the
95
+ * surface infers it from the calling key.
96
+ */
97
+ accountId?: string;
98
+ /** Legal entity name going through KYB. */
99
+ legalName?: string;
100
+ /** ISO 3166-1 alpha-2 — used during provisioning (not echoed on the TPA). */
101
+ country?: string;
102
+ /** ISO 4217 — drives the auto-created store currency (not echoed on the TPA). */
103
+ currency?: string;
104
+ /** Partner-supplied stable id — idempotency key for the TPA. */
105
+ externalRef?: string;
106
+ metadata?: Record<string, unknown>;
107
+ }
108
+ export interface TpaListParams {
109
+ limit?: number;
110
+ cursor?: string;
111
+ /** Filter to TPAs owned by a given merchant. */
112
+ accountId?: string;
113
+ externalRef?: string;
114
+ }
115
+ /**
116
+ * A Processing Key (`tp_sk_…`) restricted to a single TPA. Use a processing
117
+ * key (not the partner key) for charging — smaller blast radius if it leaks.
118
+ */
119
+ export interface ProcessingKey {
120
+ object: 'processing_key';
53
121
  id: string;
54
122
  prefix: string;
55
- /** Sub-key&rsquo;s scope: the `tpa_xxx` it&rsquo;s restricted to. */
56
- tagadapayAccountId: string;
123
+ /** TPA this key is scoped to (`tpa_xxx`). */
124
+ tpaId: string;
57
125
  label?: string;
58
126
  lastUsedAt?: string | null;
59
127
  status: 'active' | 'revoked';
60
128
  createdAt: string;
61
129
  }
62
- export interface PartnerApiKeyCreated extends PartnerApiKey {
63
- /**
64
- * Plaintext secret. Returned ONLY on creation — store immediately.
65
- * The server hashes it on storage; we cannot retrieve it later.
66
- */
130
+ export interface ProcessingKeyCreated extends ProcessingKey {
131
+ /** Plaintext secret (`tp_sk_live_…`). Returned ONLY on creation. */
67
132
  secret: string;
68
133
  }
69
- export interface PartnerApiKeyCreateParams {
70
- /** Human-readable label for audit. */
134
+ export interface ProcessingKeyCreateParams {
135
+ mode?: 'live' | 'test';
71
136
  label?: string;
72
137
  }
73
- export interface PartnerRequirement {
138
+ export interface TpaRequirement {
74
139
  object: 'requirement';
75
140
  id: string;
76
141
  code: string;
@@ -84,11 +149,13 @@ export interface PartnerRequirement {
84
149
  createdAt: string;
85
150
  updatedAt: string;
86
151
  }
87
- export interface PartnerRequirementUpdateParams {
88
- status?: PartnerRequirement['status'];
89
- metadata?: Record<string, unknown>;
90
- }
91
- export interface PartnerDocument {
152
+ /**
153
+ * Value submitted for a non-document requirement via
154
+ * `requirements.update(tpaId, code, value)`. Accepts a primitive or a
155
+ * free-form object (e.g. `{ iban: 'FR…', bic: 'BNPAFRPP' }`).
156
+ */
157
+ export type RequirementValue = string | number | boolean | Record<string, unknown>;
158
+ export interface TpaDocument {
92
159
  object: 'document';
93
160
  id: string;
94
161
  requirementCode?: string | null;
@@ -102,9 +169,17 @@ export interface PartnerDocument {
102
169
  createdAt: string;
103
170
  updatedAt: string;
104
171
  }
105
- export interface PartnerDocumentRecordParams {
106
- /** TPA this document is attached to. */
107
- tagadapayAccountId: string;
172
+ export interface TpaDocumentUploadParams {
173
+ /** Raw file bytes. Node 18+: `new Blob([buffer], { type })` or a `File`. */
174
+ file: Blob;
175
+ /** File name stored alongside the document, e.g. `registration.pdf`. */
176
+ filename: string;
177
+ /** e.g. 'identity_proof' | 'proof_of_address' | 'company_registration' */
178
+ kind: string;
179
+ /** Optional link to a `documents.*` requirement code on this TPA. */
180
+ requirementCode?: string;
181
+ }
182
+ export interface TpaDocumentRecordParams {
108
183
  /** Optional link to a `tp_account_requirements.code` on this TPA. */
109
184
  requirementCode?: string;
110
185
  /** e.g. 'identity_proof' | 'proof_of_address' | 'company_registration' */
@@ -1 +1 @@
1
- {"version":3,"file":"partners.d.ts","sourceRoot":"","sources":["../../src/types/partners.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB;IACvC,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAA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;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,UAAU,GAAG,sBAAsB,GAAG,UAAU,GAAG,UAAU,CAAC;IACtE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,4EAA4E;IAC5E,IAAI,EAAE,IAAI,CAAC;IACX,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
@@ -1,9 +1,25 @@
1
1
  // ---------------------------------------------------------------------------
2
- // Partner platform types — for the `tagada.partners.*` namespace.
2
+ // Partner platform types.
3
3
  //
4
- // These wrap the public REST surface at /api/tagadapay/v1/* used by partners
5
- // (PSPs, embedded-payments platforms, marketplaces) to provision and manage
6
- // sub-merchants.
4
+ // The Tagada platform is split into two clearly-separated domains. The SDK
5
+ // mirrors that split exactly:
6
+ //
7
+ // CRM domain → the merchant control plane (orders, stores, customers,
8
+ // subscriptions…). Exposed on `/api/public/v1/*` and
9
+ // authenticated with a **CRM Key** (`sk_crm_…`, legacy
10
+ // UUID still accepted). One CRM Key is scoped to one
11
+ // merchant (`acc_xxx`).
12
+ //
13
+ // Processing domain → TagadaPay payfac provisioning (TPAs, KYB requirements,
14
+ // documents, processing keys, charges). Exposed on
15
+ // `/api/tagadapay/v1/*` and authenticated with a
16
+ // **Processing Key** (`tp_sk_…`). One Processing Key is
17
+ // scoped to one TPA (`tpa_xxx`).
18
+ //
19
+ // A single merchant (`acc_xxx`) can own **0..N** TPAs (`tpa_xxx`).
20
+ //
21
+ // Partner ("on behalf of") operations live under the `partners.crm.*` and
22
+ // `partners.processing.*` namespaces and require a partner key.
7
23
  // ---------------------------------------------------------------------------
8
24
  export {};
9
25
  //# sourceMappingURL=partners.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"partners.js","sourceRoot":"","sources":["../../src/types/partners.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kEAAkE;AAClE,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,iBAAiB;AACjB,8EAA8E"}
1
+ {"version":3,"file":"partners.js","sourceRoot":"","sources":["../../src/types/partners.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0BAA0B;AAC1B,EAAE;AACF,2EAA2E;AAC3E,8BAA8B;AAC9B,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,+CAA+C;AAC/C,EAAE;AACF,+EAA+E;AAC/E,0EAA0E;AAC1E,wEAAwE;AACxE,+EAA+E;AAC/E,wDAAwD;AACxD,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,0EAA0E;AAC1E,gEAAgE;AAChE,8EAA8E"}
@@ -0,0 +1,25 @@
1
+ export interface TaxExemption {
2
+ id: string;
3
+ storeId: string;
4
+ accountId: string;
5
+ email: string;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ }
9
+ export interface TaxExemptionCreateParams {
10
+ storeId: string;
11
+ emails: string[];
12
+ }
13
+ export interface TaxExemptionListParams {
14
+ storeId: string;
15
+ pageNumber?: number;
16
+ pageSize?: number;
17
+ }
18
+ export interface TaxExemptionListResult {
19
+ items: TaxExemption[];
20
+ total: number;
21
+ }
22
+ export interface TaxExemptionDeleteParams {
23
+ ids: string[];
24
+ }
25
+ //# sourceMappingURL=taxExemptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taxExemptions.d.ts","sourceRoot":"","sources":["../../src/types/taxExemptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,EAAE,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=taxExemptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taxExemptions.js","sourceRoot":"","sources":["../../src/types/taxExemptions.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/node-sdk",
3
- "version": "1.2.1",
3
+ "version": "2.1.0",
4
4
  "description": "Official Tagada Node.js SDK — PSP/gateway-agnostic payment orchestration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",