@tagadapay/node-sdk 1.0.0 → 1.2.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/dist/Tagada.d.ts +43 -0
- package/dist/Tagada.d.ts.map +1 -1
- package/dist/Tagada.js +37 -0
- package/dist/Tagada.js.map +1 -1
- package/dist/cli/init.d.ts +38 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +392 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/dashboard/types.d.ts +85 -0
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/dashboard/types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/onboarding/OnboardingClient.d.ts +117 -0
- package/dist/onboarding/OnboardingClient.d.ts.map +1 -0
- package/dist/onboarding/OnboardingClient.js +154 -0
- package/dist/onboarding/OnboardingClient.js.map +1 -0
- package/dist/resources/ShippingRates.d.ts +91 -0
- package/dist/resources/ShippingRates.d.ts.map +1 -0
- package/dist/resources/ShippingRates.js +36 -0
- package/dist/resources/ShippingRates.js.map +1 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -0
- package/dist/resources/index.js.map +1 -1
- package/package.json +10 -1
package/dist/Tagada.d.ts
CHANGED
|
@@ -19,9 +19,11 @@ import { Plugins } from './resources/Plugins.js';
|
|
|
19
19
|
import { Offers } from './resources/Offers.js';
|
|
20
20
|
import { CheckoutOffers } from './resources/CheckoutOffers.js';
|
|
21
21
|
import { EmailTemplates } from './resources/EmailTemplates.js';
|
|
22
|
+
import { ShippingRates } from './resources/ShippingRates.js';
|
|
22
23
|
import { Partners } from './resources/Partners.js';
|
|
23
24
|
import { PaymentSetup } from './resources/PaymentSetup.js';
|
|
24
25
|
import { Threeds } from './resources/Threeds.js';
|
|
26
|
+
import { OnboardingClient, type OnboardingClientOptions } from './onboarding/OnboardingClient.js';
|
|
25
27
|
/**
|
|
26
28
|
* The Tagada Node.js SDK client.
|
|
27
29
|
*
|
|
@@ -93,6 +95,15 @@ export declare class Tagada {
|
|
|
93
95
|
readonly offers: Offers;
|
|
94
96
|
readonly checkoutOffers: CheckoutOffers;
|
|
95
97
|
readonly emailTemplates: EmailTemplates;
|
|
98
|
+
/**
|
|
99
|
+
* Shipping rates control which delivery options Tagada surfaces at
|
|
100
|
+
* checkout. Without at least one matching rate, checkout still works
|
|
101
|
+
* but the customer sees no delivery section. Required for stores that
|
|
102
|
+
* ship physical goods.
|
|
103
|
+
*
|
|
104
|
+
* @see {@link ShippingRates}
|
|
105
|
+
*/
|
|
106
|
+
readonly shippingRates: ShippingRates;
|
|
96
107
|
/**
|
|
97
108
|
* Partner platform namespace. Used by partners (PSPs, marketplaces,
|
|
98
109
|
* embedded-payments platforms) to provision and manage sub-merchants.
|
|
@@ -121,5 +132,37 @@ export declare class Tagada {
|
|
|
121
132
|
*/
|
|
122
133
|
readonly threeds: Threeds;
|
|
123
134
|
constructor(apiKeyOrOptions: string | TagadaClientOptions);
|
|
135
|
+
/**
|
|
136
|
+
* Returns a public, no-auth client for the **Tagada onboarding** flow.
|
|
137
|
+
* Use this to provision a fresh sandbox Tagada account from a CLI script
|
|
138
|
+
* *without* an API key — the verify call returns a key you can plug
|
|
139
|
+
* into `new Tagada(...)`.
|
|
140
|
+
*
|
|
141
|
+
* For an interactive experience, ship `tagada-init` (the bin shipped
|
|
142
|
+
* with this package) instead of writing your own prompt loop.
|
|
143
|
+
*
|
|
144
|
+
* Naming: the package is `@tagadapay/node-sdk` (the SDK for the
|
|
145
|
+
* TagadaPay payment processor), but the *account* you provision here
|
|
146
|
+
* is a **Tagada** account — the CRM / control-plane that hosts your
|
|
147
|
+
* stores, products, and processor configuration. The processor is
|
|
148
|
+
* one of several products available inside that account.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* import Tagada from '@tagadapay/node-sdk';
|
|
153
|
+
*
|
|
154
|
+
* const onb = Tagada.public();
|
|
155
|
+
* await onb.start({ email: 'me@example.com', source: 'cli' });
|
|
156
|
+
* const { apiKey } = await onb.verify({
|
|
157
|
+
* email: 'me@example.com',
|
|
158
|
+
* code: '384921',
|
|
159
|
+
* });
|
|
160
|
+
*
|
|
161
|
+
* const tagada = new Tagada(apiKey);
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* @see {@link OnboardingClient}
|
|
165
|
+
*/
|
|
166
|
+
static public(opts?: OnboardingClientOptions): OnboardingClient;
|
|
124
167
|
}
|
|
125
168
|
//# sourceMappingURL=Tagada.d.ts.map
|
package/dist/Tagada.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tagada.d.ts","sourceRoot":"","sources":["../src/Tagada.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBA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AC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAExC;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEtC;;;;;;;;;OASG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE5B;;;;;;;OAOG;IACH,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;gBAEd,eAAe,EAAE,MAAM,GAAG,mBAAmB;IAmCzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,GAAE,uBAA4B,GAAG,gBAAgB;CAGpE"}
|
package/dist/Tagada.js
CHANGED
|
@@ -19,9 +19,11 @@ import { Plugins } from './resources/Plugins.js';
|
|
|
19
19
|
import { Offers } from './resources/Offers.js';
|
|
20
20
|
import { CheckoutOffers } from './resources/CheckoutOffers.js';
|
|
21
21
|
import { EmailTemplates } from './resources/EmailTemplates.js';
|
|
22
|
+
import { ShippingRates } from './resources/ShippingRates.js';
|
|
22
23
|
import { Partners } from './resources/Partners.js';
|
|
23
24
|
import { PaymentSetup } from './resources/PaymentSetup.js';
|
|
24
25
|
import { Threeds } from './resources/Threeds.js';
|
|
26
|
+
import { OnboardingClient, } from './onboarding/OnboardingClient.js';
|
|
25
27
|
/**
|
|
26
28
|
* The Tagada Node.js SDK client.
|
|
27
29
|
*
|
|
@@ -98,9 +100,44 @@ export class Tagada {
|
|
|
98
100
|
this.offers = new Offers(client);
|
|
99
101
|
this.checkoutOffers = new CheckoutOffers(client);
|
|
100
102
|
this.emailTemplates = new EmailTemplates(client);
|
|
103
|
+
this.shippingRates = new ShippingRates(client);
|
|
101
104
|
this.partners = new Partners(client);
|
|
102
105
|
this.paymentSetup = new PaymentSetup(client);
|
|
103
106
|
this.threeds = new Threeds(client);
|
|
104
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns a public, no-auth client for the **Tagada onboarding** flow.
|
|
110
|
+
* Use this to provision a fresh sandbox Tagada account from a CLI script
|
|
111
|
+
* *without* an API key — the verify call returns a key you can plug
|
|
112
|
+
* into `new Tagada(...)`.
|
|
113
|
+
*
|
|
114
|
+
* For an interactive experience, ship `tagada-init` (the bin shipped
|
|
115
|
+
* with this package) instead of writing your own prompt loop.
|
|
116
|
+
*
|
|
117
|
+
* Naming: the package is `@tagadapay/node-sdk` (the SDK for the
|
|
118
|
+
* TagadaPay payment processor), but the *account* you provision here
|
|
119
|
+
* is a **Tagada** account — the CRM / control-plane that hosts your
|
|
120
|
+
* stores, products, and processor configuration. The processor is
|
|
121
|
+
* one of several products available inside that account.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* import Tagada from '@tagadapay/node-sdk';
|
|
126
|
+
*
|
|
127
|
+
* const onb = Tagada.public();
|
|
128
|
+
* await onb.start({ email: 'me@example.com', source: 'cli' });
|
|
129
|
+
* const { apiKey } = await onb.verify({
|
|
130
|
+
* email: 'me@example.com',
|
|
131
|
+
* code: '384921',
|
|
132
|
+
* });
|
|
133
|
+
*
|
|
134
|
+
* const tagada = new Tagada(apiKey);
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @see {@link OnboardingClient}
|
|
138
|
+
*/
|
|
139
|
+
static public(opts = {}) {
|
|
140
|
+
return new OnboardingClient(opts);
|
|
141
|
+
}
|
|
105
142
|
}
|
|
106
143
|
//# sourceMappingURL=Tagada.js.map
|
package/dist/Tagada.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tagada.js","sourceRoot":"","sources":["../src/Tagada.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,2BAA2B,C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IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,MAAM,CAAC,MAAM,CAAC,OAAgC,EAAE;QAC9C,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `tagada-init [email]`
|
|
4
|
+
*
|
|
5
|
+
* Reachable as:
|
|
6
|
+
* - `npx -p @tagadapay/node-sdk tagada-init` (one-shot, no install)
|
|
7
|
+
* - `npx tagada-init` (after `npm i -D @tagadapay/node-sdk`)
|
|
8
|
+
* - `tagada-init` (after a global install)
|
|
9
|
+
*
|
|
10
|
+
* Interactive CLI that walks a developer through provisioning a fresh
|
|
11
|
+
* sandbox Tagada account in ~30 seconds:
|
|
12
|
+
*
|
|
13
|
+
* 1. Asks for an email (or accepts it as the first positional arg).
|
|
14
|
+
* 2. POSTs `/api/public/onboarding/start` to mail a 6-digit code.
|
|
15
|
+
* 3. Prompts the user to paste the code from their inbox.
|
|
16
|
+
* 4. POSTs `/api/public/onboarding/verify` to provision the account.
|
|
17
|
+
* 5. Writes the returned `apiKey` / `storeId` / `accountId` to a `.env`
|
|
18
|
+
* file in the current working directory (creating it if missing,
|
|
19
|
+
* appending non-conflicting keys if it exists).
|
|
20
|
+
* 6. Prints next steps.
|
|
21
|
+
*
|
|
22
|
+
* Flags:
|
|
23
|
+
* --base-url=<url> Override the API host (default https://api.tagada.io)
|
|
24
|
+
* --no-env Print the values instead of writing `.env`
|
|
25
|
+
* --env-file=<path> Custom path for the env file (default ./.env)
|
|
26
|
+
* --source=<tag> Acquisition source override (default 'cli')
|
|
27
|
+
*
|
|
28
|
+
* UTM forwarding: any `--utm-foo=bar` flag, plus matching `UTM_FOO` env
|
|
29
|
+
* vars, are bundled into the `utm` payload so attribution survives the
|
|
30
|
+
* jump from a docs link → terminal command.
|
|
31
|
+
*
|
|
32
|
+
* Naming note: the package is `@tagadapay/node-sdk` (the SDK to talk to
|
|
33
|
+
* the TagadaPay payment processor), but the *account* this command
|
|
34
|
+
* creates is a **Tagada** account (the CRM / control plane). Hence
|
|
35
|
+
* `tagada-init`, not `tagadapay-init`.
|
|
36
|
+
*/
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG"}
|
package/dist/cli/init.js
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `tagada-init [email]`
|
|
4
|
+
*
|
|
5
|
+
* Reachable as:
|
|
6
|
+
* - `npx -p @tagadapay/node-sdk tagada-init` (one-shot, no install)
|
|
7
|
+
* - `npx tagada-init` (after `npm i -D @tagadapay/node-sdk`)
|
|
8
|
+
* - `tagada-init` (after a global install)
|
|
9
|
+
*
|
|
10
|
+
* Interactive CLI that walks a developer through provisioning a fresh
|
|
11
|
+
* sandbox Tagada account in ~30 seconds:
|
|
12
|
+
*
|
|
13
|
+
* 1. Asks for an email (or accepts it as the first positional arg).
|
|
14
|
+
* 2. POSTs `/api/public/onboarding/start` to mail a 6-digit code.
|
|
15
|
+
* 3. Prompts the user to paste the code from their inbox.
|
|
16
|
+
* 4. POSTs `/api/public/onboarding/verify` to provision the account.
|
|
17
|
+
* 5. Writes the returned `apiKey` / `storeId` / `accountId` to a `.env`
|
|
18
|
+
* file in the current working directory (creating it if missing,
|
|
19
|
+
* appending non-conflicting keys if it exists).
|
|
20
|
+
* 6. Prints next steps.
|
|
21
|
+
*
|
|
22
|
+
* Flags:
|
|
23
|
+
* --base-url=<url> Override the API host (default https://api.tagada.io)
|
|
24
|
+
* --no-env Print the values instead of writing `.env`
|
|
25
|
+
* --env-file=<path> Custom path for the env file (default ./.env)
|
|
26
|
+
* --source=<tag> Acquisition source override (default 'cli')
|
|
27
|
+
*
|
|
28
|
+
* UTM forwarding: any `--utm-foo=bar` flag, plus matching `UTM_FOO` env
|
|
29
|
+
* vars, are bundled into the `utm` payload so attribution survives the
|
|
30
|
+
* jump from a docs link → terminal command.
|
|
31
|
+
*
|
|
32
|
+
* Naming note: the package is `@tagadapay/node-sdk` (the SDK to talk to
|
|
33
|
+
* the TagadaPay payment processor), but the *account* this command
|
|
34
|
+
* creates is a **Tagada** account (the CRM / control plane). Hence
|
|
35
|
+
* `tagada-init`, not `tagadapay-init`.
|
|
36
|
+
*/
|
|
37
|
+
import { promises as fs } from 'node:fs';
|
|
38
|
+
import { existsSync } from 'node:fs';
|
|
39
|
+
import path from 'node:path';
|
|
40
|
+
import readline from 'node:readline/promises';
|
|
41
|
+
import { stdin as input, stdout as output } from 'node:process';
|
|
42
|
+
import { OnboardingClient, OnboardingError, } from '../onboarding/OnboardingClient.js';
|
|
43
|
+
function parseArgs(argv) {
|
|
44
|
+
const out = {
|
|
45
|
+
envFile: '.env',
|
|
46
|
+
writeEnv: true,
|
|
47
|
+
source: 'cli',
|
|
48
|
+
utm: {},
|
|
49
|
+
help: false,
|
|
50
|
+
};
|
|
51
|
+
for (const raw of argv) {
|
|
52
|
+
if (raw === '--help' || raw === '-h') {
|
|
53
|
+
out.help = true;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (raw === '--no-env') {
|
|
57
|
+
out.writeEnv = false;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const eq = raw.indexOf('=');
|
|
61
|
+
if (raw.startsWith('--')) {
|
|
62
|
+
const key = eq === -1 ? raw.slice(2) : raw.slice(2, eq);
|
|
63
|
+
const value = eq === -1 ? 'true' : raw.slice(eq + 1);
|
|
64
|
+
if (key === 'base-url')
|
|
65
|
+
out.baseUrl = value;
|
|
66
|
+
else if (key === 'env-file')
|
|
67
|
+
out.envFile = value;
|
|
68
|
+
else if (key === 'source')
|
|
69
|
+
out.source = value;
|
|
70
|
+
else if (key.startsWith('utm-')) {
|
|
71
|
+
// --utm-source=docs → utm.utm_source = 'docs'
|
|
72
|
+
out.utm[`utm_${key.slice(4).replace(/-/g, '_')}`] = value;
|
|
73
|
+
}
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
// First positional = email.
|
|
77
|
+
if (!out.email)
|
|
78
|
+
out.email = raw;
|
|
79
|
+
}
|
|
80
|
+
// Pull UTMs from env vars too (so wrapper scripts can set them once).
|
|
81
|
+
for (const [k, v] of Object.entries(process.env)) {
|
|
82
|
+
if (k.startsWith('UTM_') && typeof v === 'string' && v.length > 0) {
|
|
83
|
+
const key = k.toLowerCase();
|
|
84
|
+
if (!(key in out.utm))
|
|
85
|
+
out.utm[key] = v;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
function printHelp() {
|
|
91
|
+
console.log(`
|
|
92
|
+
tagada-init — provision a fresh sandbox Tagada account from your terminal.
|
|
93
|
+
|
|
94
|
+
Verifies your email with a 6-digit code, creates a Tagada account
|
|
95
|
+
(Clerk user + org), provisions a demo-seeded store with sandbox
|
|
96
|
+
processor + payment flow + funnel, and writes the API key to \`.env\`.
|
|
97
|
+
|
|
98
|
+
Usage:
|
|
99
|
+
npx -p @tagadapay/node-sdk tagada-init [email] [flags]
|
|
100
|
+
npx tagada-init [email] [flags] # after npm i @tagadapay/node-sdk
|
|
101
|
+
|
|
102
|
+
Examples:
|
|
103
|
+
npx -p @tagadapay/node-sdk tagada-init you@example.com
|
|
104
|
+
npx tagada-init you@example.com --utm-source=docs --utm-campaign=cli
|
|
105
|
+
npx tagada-init --base-url=http://localhost:3000 # local dev
|
|
106
|
+
|
|
107
|
+
Flags:
|
|
108
|
+
--base-url=<url> API host (default https://api.tagada.io)
|
|
109
|
+
--env-file=<path> Where to write the API key (default ./.env)
|
|
110
|
+
--no-env Print credentials instead of writing them
|
|
111
|
+
--source=<tag> Acquisition source (default cli)
|
|
112
|
+
--utm-<name>=<val> Forward UTM params (e.g. --utm-source=docs)
|
|
113
|
+
--help, -h Show this message
|
|
114
|
+
`.trim());
|
|
115
|
+
}
|
|
116
|
+
async function prompt(rl, message) {
|
|
117
|
+
const answer = await rl.question(message);
|
|
118
|
+
return answer.trim();
|
|
119
|
+
}
|
|
120
|
+
function isLikelyEmail(s) {
|
|
121
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s);
|
|
122
|
+
}
|
|
123
|
+
async function readExistingEnv(filePath) {
|
|
124
|
+
const map = new Map();
|
|
125
|
+
if (!existsSync(filePath))
|
|
126
|
+
return map;
|
|
127
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
128
|
+
for (const line of content.split('\n')) {
|
|
129
|
+
const trimmed = line.trim();
|
|
130
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
131
|
+
continue;
|
|
132
|
+
const eq = trimmed.indexOf('=');
|
|
133
|
+
if (eq === -1)
|
|
134
|
+
continue;
|
|
135
|
+
map.set(trimmed.slice(0, eq).trim(), trimmed.slice(eq + 1));
|
|
136
|
+
}
|
|
137
|
+
return map;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Append `additions` to `filePath`, preserving anything already there.
|
|
141
|
+
* Existing keys with the same name are commented out (not overwritten),
|
|
142
|
+
* so users can see what changed without losing their previous values.
|
|
143
|
+
*/
|
|
144
|
+
async function writeEnvFile(filePath, additions) {
|
|
145
|
+
const existing = await readExistingEnv(filePath);
|
|
146
|
+
const conflicts = [];
|
|
147
|
+
for (const k of Object.keys(additions)) {
|
|
148
|
+
if (existing.has(k))
|
|
149
|
+
conflicts.push(k);
|
|
150
|
+
}
|
|
151
|
+
let prior = '';
|
|
152
|
+
if (existsSync(filePath)) {
|
|
153
|
+
prior = await fs.readFile(filePath, 'utf8');
|
|
154
|
+
if (!prior.endsWith('\n'))
|
|
155
|
+
prior += '\n';
|
|
156
|
+
// Comment out any conflicting keys so we don't shadow them silently.
|
|
157
|
+
for (const k of conflicts) {
|
|
158
|
+
prior = prior.replace(new RegExp(`^${escapeRegex(k)}=.*$`, 'm'), `# ${k}= (replaced by tagadapay init on ${new Date().toISOString()})`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const block = [
|
|
162
|
+
'',
|
|
163
|
+
'# Provisioned by `npx @tagadapay/node-sdk init`',
|
|
164
|
+
`# ${new Date().toISOString()}`,
|
|
165
|
+
...Object.entries(additions).map(([k, v]) => `${k}=${v}`),
|
|
166
|
+
'',
|
|
167
|
+
].join('\n');
|
|
168
|
+
await fs.writeFile(filePath, prior + block, 'utf8');
|
|
169
|
+
}
|
|
170
|
+
function escapeRegex(s) {
|
|
171
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Look at the cwd and decide which frameworks the user is targeting so we
|
|
175
|
+
* can mirror the canonical `TAGADA_*` env vars under the prefix that
|
|
176
|
+
* framework actually exposes to the browser. We do this purely from
|
|
177
|
+
* filesystem signals (config files + dependency manifests) — no
|
|
178
|
+
* `require()` of user code.
|
|
179
|
+
*
|
|
180
|
+
* Multiple matches are possible (e.g. an Astro site that uses Vite under
|
|
181
|
+
* the hood). We return all of them; the caller writes one prefix per
|
|
182
|
+
* framework.
|
|
183
|
+
*/
|
|
184
|
+
async function detectFrameworks(cwd) {
|
|
185
|
+
const found = new Set();
|
|
186
|
+
const has = (rel) => existsSync(path.join(cwd, rel));
|
|
187
|
+
if (has('vite.config.ts') ||
|
|
188
|
+
has('vite.config.js') ||
|
|
189
|
+
has('vite.config.mjs') ||
|
|
190
|
+
has('vite.config.cjs')) {
|
|
191
|
+
found.add('vite');
|
|
192
|
+
}
|
|
193
|
+
if (has('next.config.ts') ||
|
|
194
|
+
has('next.config.js') ||
|
|
195
|
+
has('next.config.mjs') ||
|
|
196
|
+
has('next.config.cjs')) {
|
|
197
|
+
found.add('next');
|
|
198
|
+
}
|
|
199
|
+
if (has('astro.config.ts') ||
|
|
200
|
+
has('astro.config.js') ||
|
|
201
|
+
has('astro.config.mjs')) {
|
|
202
|
+
found.add('astro');
|
|
203
|
+
}
|
|
204
|
+
// Fallback to package.json sniffing for projects that omit a config file.
|
|
205
|
+
if (found.size === 0 && has('package.json')) {
|
|
206
|
+
try {
|
|
207
|
+
const pkg = JSON.parse(await fs.readFile(path.join(cwd, 'package.json'), 'utf8'));
|
|
208
|
+
const deps = {
|
|
209
|
+
...(pkg.dependencies ?? {}),
|
|
210
|
+
...(pkg.devDependencies ?? {}),
|
|
211
|
+
};
|
|
212
|
+
if (deps.vite)
|
|
213
|
+
found.add('vite');
|
|
214
|
+
if (deps.next)
|
|
215
|
+
found.add('next');
|
|
216
|
+
if (deps.astro)
|
|
217
|
+
found.add('astro');
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
/* ignore unreadable package.json */
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return [...found];
|
|
224
|
+
}
|
|
225
|
+
async function main() {
|
|
226
|
+
const args = parseArgs(process.argv.slice(2));
|
|
227
|
+
if (args.help) {
|
|
228
|
+
printHelp();
|
|
229
|
+
return 0;
|
|
230
|
+
}
|
|
231
|
+
const rl = readline.createInterface({ input, output });
|
|
232
|
+
try {
|
|
233
|
+
// ─── Step 1: collect email ────────────────────────────────────────
|
|
234
|
+
let email = args.email;
|
|
235
|
+
while (!email || !isLikelyEmail(email)) {
|
|
236
|
+
if (email) {
|
|
237
|
+
console.error(`✗ '${email}' doesn't look like a valid email.`);
|
|
238
|
+
}
|
|
239
|
+
email = await prompt(rl, 'Email: ');
|
|
240
|
+
}
|
|
241
|
+
email = email.toLowerCase();
|
|
242
|
+
const client = new OnboardingClient({ baseUrl: args.baseUrl });
|
|
243
|
+
// ─── Step 2: send the code ────────────────────────────────────────
|
|
244
|
+
process.stdout.write(`→ Sending verification code to ${email}... `);
|
|
245
|
+
try {
|
|
246
|
+
await client.start({
|
|
247
|
+
email,
|
|
248
|
+
source: args.source,
|
|
249
|
+
utm: Object.keys(args.utm).length > 0 ? args.utm : undefined,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
catch (err) {
|
|
253
|
+
process.stdout.write('\n');
|
|
254
|
+
return handleOnboardingError(err);
|
|
255
|
+
}
|
|
256
|
+
console.log('✓');
|
|
257
|
+
// ─── Step 3: prompt for code ──────────────────────────────────────
|
|
258
|
+
let code = '';
|
|
259
|
+
let verifyResult;
|
|
260
|
+
for (let attempt = 0; attempt < 5; attempt++) {
|
|
261
|
+
code = await prompt(rl, 'Code (6 digits): ');
|
|
262
|
+
if (!/^\d{6}$/.test(code)) {
|
|
263
|
+
console.error('✗ The code must be exactly 6 digits.');
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
try {
|
|
267
|
+
process.stdout.write('→ Provisioning account... ');
|
|
268
|
+
verifyResult = await client.verify({
|
|
269
|
+
email,
|
|
270
|
+
code,
|
|
271
|
+
source: args.source,
|
|
272
|
+
utm: Object.keys(args.utm).length > 0 ? args.utm : undefined,
|
|
273
|
+
});
|
|
274
|
+
console.log('✓');
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
catch (err) {
|
|
278
|
+
process.stdout.write('\n');
|
|
279
|
+
if (err instanceof OnboardingError && err.code === 'invalid_code') {
|
|
280
|
+
console.error('✗ Wrong code. Try again.');
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
return handleOnboardingError(err);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (!verifyResult) {
|
|
287
|
+
console.error('✗ Too many failed attempts. Run `tagada-init` again to get a fresh code.');
|
|
288
|
+
return 1;
|
|
289
|
+
}
|
|
290
|
+
// ─── Step 4: persist credentials ──────────────────────────────────
|
|
291
|
+
// Always write canonical TAGADA_* (used by Node/server scripts), and
|
|
292
|
+
// additionally mirror to framework-prefixed vars so the frontend can
|
|
293
|
+
// read them without a config rename. We only mirror the storeId +
|
|
294
|
+
// environment (browser-safe); the apiKey stays server-only.
|
|
295
|
+
const additions = {
|
|
296
|
+
TAGADA_API_KEY: verifyResult.apiKey,
|
|
297
|
+
TAGADA_STORE_ID: verifyResult.storeId,
|
|
298
|
+
TAGADA_ACCOUNT_ID: verifyResult.accountId,
|
|
299
|
+
};
|
|
300
|
+
const frameworks = await detectFrameworks(process.cwd());
|
|
301
|
+
if (frameworks.includes('vite')) {
|
|
302
|
+
additions.VITE_STORE_ID = verifyResult.storeId;
|
|
303
|
+
additions.VITE_ENVIRONMENT = 'production';
|
|
304
|
+
}
|
|
305
|
+
if (frameworks.includes('next')) {
|
|
306
|
+
additions.NEXT_PUBLIC_TAGADA_STORE_ID = verifyResult.storeId;
|
|
307
|
+
additions.NEXT_PUBLIC_TAGADA_ENVIRONMENT = 'production';
|
|
308
|
+
}
|
|
309
|
+
if (frameworks.includes('astro')) {
|
|
310
|
+
additions.PUBLIC_TAGADA_STORE_ID = verifyResult.storeId;
|
|
311
|
+
additions.PUBLIC_TAGADA_ENVIRONMENT = 'production';
|
|
312
|
+
}
|
|
313
|
+
if (args.writeEnv) {
|
|
314
|
+
const fullPath = path.resolve(process.cwd(), args.envFile);
|
|
315
|
+
await writeEnvFile(fullPath, additions);
|
|
316
|
+
const frameworksHint = frameworks.length
|
|
317
|
+
? ` (with ${frameworks.join(' + ')} mirrored vars)`
|
|
318
|
+
: '';
|
|
319
|
+
console.log(`✓ Wrote credentials to ${path.relative(process.cwd(), fullPath) || args.envFile}${frameworksHint}`);
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
console.log('\nCredentials (copy into your environment):');
|
|
323
|
+
for (const [k, v] of Object.entries(additions)) {
|
|
324
|
+
console.log(` ${k}=${v}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// ─── Step 5: next steps ───────────────────────────────────────────
|
|
328
|
+
console.log(`
|
|
329
|
+
Done. Your sandbox account is ready.
|
|
330
|
+
|
|
331
|
+
Account: ${verifyResult.accountId}
|
|
332
|
+
Store: ${verifyResult.storeId}
|
|
333
|
+
Org: ${verifyResult.orgSlug ?? verifyResult.clerkOrgId}
|
|
334
|
+
|
|
335
|
+
Demo products, payment flow, and funnel are seeding in the background
|
|
336
|
+
(typically <30s). You can already run your dev server — the catalog will
|
|
337
|
+
populate as the seed completes.
|
|
338
|
+
|
|
339
|
+
Next:
|
|
340
|
+
1. cd into your TagadaPay app (e.g. examples/headless-react-store)
|
|
341
|
+
2. pnpm install
|
|
342
|
+
3. pnpm dev
|
|
343
|
+
`);
|
|
344
|
+
return 0;
|
|
345
|
+
}
|
|
346
|
+
finally {
|
|
347
|
+
rl.close();
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function handleOnboardingError(err) {
|
|
351
|
+
if (err instanceof OnboardingError) {
|
|
352
|
+
switch (err.code) {
|
|
353
|
+
case 'rate_limited':
|
|
354
|
+
console.error(`✗ Rate limited. ${err.message}`);
|
|
355
|
+
if (err.resetAt) {
|
|
356
|
+
console.error(` Try again after ${err.resetAt.toLocaleTimeString()}.`);
|
|
357
|
+
}
|
|
358
|
+
return 2;
|
|
359
|
+
case 'email_send_failed':
|
|
360
|
+
console.error(`✗ Could not send the verification email. ${err.message}`);
|
|
361
|
+
console.error(' Try a different email or retry in a few minutes.');
|
|
362
|
+
return 3;
|
|
363
|
+
case 'expired':
|
|
364
|
+
case 'no_pending_code':
|
|
365
|
+
console.error(`✗ ${err.message}`);
|
|
366
|
+
return 4;
|
|
367
|
+
case 'too_many_attempts':
|
|
368
|
+
console.error(`✗ ${err.message}`);
|
|
369
|
+
return 5;
|
|
370
|
+
case 'invalid_request':
|
|
371
|
+
console.error(`✗ Invalid request: ${err.message}`);
|
|
372
|
+
return 6;
|
|
373
|
+
case 'provisioning_failed':
|
|
374
|
+
console.error(`✗ Provisioning failed: ${err.message}`);
|
|
375
|
+
console.error(' This usually clears up after a retry. Run `tagada-init` again.');
|
|
376
|
+
return 7;
|
|
377
|
+
case 'network_error':
|
|
378
|
+
console.error(`✗ Network error: ${err.message}`);
|
|
379
|
+
return 8;
|
|
380
|
+
default:
|
|
381
|
+
console.error(`✗ ${err.message}`);
|
|
382
|
+
return 9;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
console.error('✗ Unexpected error:', err);
|
|
386
|
+
return 99;
|
|
387
|
+
}
|
|
388
|
+
main().then((code) => process.exit(code), (err) => {
|
|
389
|
+
console.error('✗ Fatal error:', err);
|
|
390
|
+
process.exit(99);
|
|
391
|
+
});
|
|
392
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EACL,gBAAgB,EAChB,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAY3C,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,GAAG,GAAe;QACtB,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,KAAK;KACZ,CAAC;IAEF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,C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