@tagadapay/node-sdk 0.1.0 → 0.2.1
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/README.md +13 -5
- package/dist/HttpClient.d.ts +2 -2
- package/dist/HttpClient.d.ts.map +1 -1
- package/dist/HttpClient.js +2 -2
- package/dist/Tagada.d.ts +3 -1
- package/dist/Tagada.d.ts.map +1 -1
- package/dist/Tagada.js +3 -1
- package/dist/Tagada.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/resources/Domains.d.ts +13 -4
- package/dist/resources/Domains.d.ts.map +1 -1
- package/dist/resources/Domains.js +22 -3
- package/dist/resources/Domains.js.map +1 -1
- package/dist/resources/EmailTemplates.d.ts +66 -0
- package/dist/resources/EmailTemplates.d.ts.map +1 -0
- package/dist/resources/EmailTemplates.js +72 -0
- package/dist/resources/EmailTemplates.js.map +1 -0
- package/dist/resources/Funnels.d.ts +6 -1
- package/dist/resources/Funnels.d.ts.map +1 -1
- package/dist/resources/Funnels.js +7 -0
- package/dist/resources/Funnels.js.map +1 -1
- package/dist/resources/PaymentFlows.d.ts +3 -3
- package/dist/resources/PaymentFlows.js +3 -3
- package/dist/resources/Plugins.d.ts +74 -16
- package/dist/resources/Plugins.d.ts.map +1 -1
- package/dist/resources/Plugins.js +305 -18
- package/dist/resources/Plugins.js.map +1 -1
- package/dist/resources/Processors.d.ts +39 -1
- package/dist/resources/Processors.d.ts.map +1 -1
- package/dist/resources/Processors.js +43 -0
- package/dist/resources/Processors.js.map +1 -1
- package/dist/resources/Webhooks.d.ts +1 -1
- package/dist/resources/Webhooks.d.ts.map +1 -1
- package/dist/resources/Webhooks.js +11 -1
- package/dist/resources/Webhooks.js.map +1 -1
- 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/dist/types/checkout-offers.d.ts +1 -1
- package/dist/types/checkout-offers.d.ts.map +1 -1
- package/dist/types/domains.d.ts +34 -2
- package/dist/types/domains.d.ts.map +1 -1
- package/dist/types/emailTemplates.d.ts +55 -0
- package/dist/types/emailTemplates.d.ts.map +1 -0
- package/dist/types/emailTemplates.js +5 -0
- package/dist/types/emailTemplates.js.map +1 -0
- package/dist/types/events.d.ts +2 -1
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/funnels.d.ts +10 -0
- package/dist/types/funnels.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/paymentFlows.d.ts +4 -3
- package/dist/types/paymentFlows.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +104 -2
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/processors.d.ts +37 -0
- package/dist/types/processors.d.ts.map +1 -1
- package/dist/types/stores.d.ts +1 -0
- package/dist/types/stores.d.ts.map +1 -1
- package/dist/types/webhooks.d.ts +8 -2
- package/dist/types/webhooks.d.ts.map +1 -1
- package/dist/types/webhooks.js +48 -1
- package/dist/types/webhooks.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
import { BaseResource } from './BaseResource.js';
|
|
2
2
|
import type { RequestOptions } from '../types/common.js';
|
|
3
|
-
import type { PluginDeployParams, PluginDeployResult, PluginInstantiateParams, PluginInstantiateResult, PluginMountParams, PluginMountResult, PluginUnmountParams } from '../types/plugins.js';
|
|
3
|
+
import type { PluginDeployParams, PluginDeployResult, PluginInstantiateParams, PluginInstantiateResult, PluginMountParams, PluginMountResult, PluginUnmountParams, PluginInstance, PluginInstanceListResult, PluginDeploymentDetails, PluginListResult, PluginMountPointListResult, PluginDetails, DeployDirectoryParams, DeployDirectoryResult, ConfigureSplitParams, ConfigureSplitResult } from '../types/plugins.js';
|
|
4
4
|
/**
|
|
5
5
|
* Plugins V2 — deploy HTML/JS/CSS pages, instantiate them for stores,
|
|
6
6
|
* and mount them to custom domains or aliases.
|
|
7
|
-
*
|
|
8
|
-
* This is the mechanism Tagada uses to serve checkout pages, landing pages,
|
|
9
|
-
* upsell pages, and any custom storefront on your own domains.
|
|
10
7
|
*/
|
|
11
8
|
export declare class Plugins extends BaseResource {
|
|
9
|
+
/**
|
|
10
|
+
* Deploy a local build directory to TagadaPay's CDN in one call.
|
|
11
|
+
*
|
|
12
|
+
* Handles everything automatically: file collection, MIME type detection,
|
|
13
|
+
* base64 encoding, instantiation, and mounting to a CDN hostname.
|
|
14
|
+
* Builds up to ~3.5 MB are uploaded inline; larger builds are automatically
|
|
15
|
+
* zipped and uploaded via Vercel Blob (up to 50 MB).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const result = await tagada.plugins.deployDirectory({
|
|
20
|
+
* directory: './dist',
|
|
21
|
+
* storeId: 'store_xxx',
|
|
22
|
+
* name: 'my-store',
|
|
23
|
+
* });
|
|
24
|
+
* console.log(result.url); // https://my-store--store_xxx.cdn.tagadapay.com/
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
deployDirectory(params: DeployDirectoryParams, opts?: RequestOptions): Promise<DeployDirectoryResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Create a ZIP archive from raw file buffers using only Node.js built-ins.
|
|
30
|
+
* Uses the STORE method (no compression) for speed — the files are already
|
|
31
|
+
* minified JS/CSS/images, so deflate savings are minimal.
|
|
32
|
+
*/
|
|
33
|
+
private _createZipBuffer;
|
|
34
|
+
/**
|
|
35
|
+
* Upload a ZIP buffer to Vercel Blob using the two-step client upload protocol.
|
|
36
|
+
* Step 1: POST to generate-upload-token to get a signed clientToken.
|
|
37
|
+
* Step 2: PUT the ZIP to the Vercel Blob API with that token.
|
|
38
|
+
*/
|
|
39
|
+
private _uploadZipToBlob;
|
|
12
40
|
/**
|
|
13
41
|
* Deploy a plugin with inline assets (HTML, JS, CSS as base64) or
|
|
14
42
|
* from a ZIP URL. Returns a deploymentId used for instantiation and mounting.
|
|
@@ -16,38 +44,68 @@ export declare class Plugins extends BaseResource {
|
|
|
16
44
|
deploy(params: PluginDeployParams, opts?: RequestOptions): Promise<PluginDeployResult>;
|
|
17
45
|
/**
|
|
18
46
|
* Create an instance of a deployed plugin for a specific store.
|
|
19
|
-
* Instances allow per-store configuration of the same deployment.
|
|
20
47
|
*/
|
|
21
48
|
instantiate(params: PluginInstantiateParams, opts?: RequestOptions): Promise<PluginInstantiateResult>;
|
|
49
|
+
/**
|
|
50
|
+
* List all instances for a store.
|
|
51
|
+
* Optionally filter by deploymentId.
|
|
52
|
+
*/
|
|
53
|
+
listInstances(storeId: string, deploymentId?: string, opts?: RequestOptions): Promise<PluginInstanceListResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Retrieve a single instance by ID.
|
|
56
|
+
*/
|
|
57
|
+
retrieveInstance(instanceId: string, opts?: RequestOptions): Promise<PluginInstance>;
|
|
58
|
+
/**
|
|
59
|
+
* Retrieve deployment details (version, pages, instances).
|
|
60
|
+
* Does not require storeId — deployments are global.
|
|
61
|
+
*/
|
|
62
|
+
retrieveDeployment(deploymentId: string, opts?: RequestOptions): Promise<PluginDeploymentDetails>;
|
|
22
63
|
/**
|
|
23
64
|
* Mount a plugin deployment/instance to a custom domain or alias.
|
|
24
|
-
* The domain must be verified in your account's custom domains.
|
|
25
65
|
*/
|
|
26
66
|
mount(params: PluginMountParams, opts?: RequestOptions): Promise<PluginMountResult>;
|
|
27
67
|
/**
|
|
28
68
|
* Unmount a plugin from a domain or alias.
|
|
29
69
|
*/
|
|
30
|
-
unmount(params: PluginUnmountParams, opts?: RequestOptions): Promise<
|
|
70
|
+
unmount(params: PluginUnmountParams, opts?: RequestOptions): Promise<{
|
|
71
|
+
success: boolean;
|
|
72
|
+
message: string;
|
|
73
|
+
}>;
|
|
31
74
|
/**
|
|
32
|
-
*
|
|
75
|
+
* Configure A/B split testing on an existing route.
|
|
76
|
+
*
|
|
77
|
+
* @example Weighted 50/50 split
|
|
78
|
+
* ```ts
|
|
79
|
+
* await tagada.plugins.configureSplit({
|
|
80
|
+
* routeId: 'route_xxx',
|
|
81
|
+
* storeId: 'store_xxx',
|
|
82
|
+
* splitConfig: {
|
|
83
|
+
* type: 'weighted',
|
|
84
|
+
* instances: [
|
|
85
|
+
* { instanceId: 'inst_a', deploymentId: 'dep_a', weight: 50 },
|
|
86
|
+
* { instanceId: 'inst_b', deploymentId: 'dep_b', weight: 50 },
|
|
87
|
+
* ],
|
|
88
|
+
* },
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
33
91
|
*/
|
|
34
|
-
|
|
92
|
+
configureSplit(params: ConfigureSplitParams, opts?: RequestOptions): Promise<ConfigureSplitResult>;
|
|
35
93
|
/**
|
|
36
|
-
* List all
|
|
94
|
+
* List all plugins for a store.
|
|
37
95
|
*/
|
|
38
|
-
|
|
96
|
+
list(storeId: string, opts?: RequestOptions): Promise<PluginListResult>;
|
|
39
97
|
/**
|
|
40
98
|
* List mount points for a store.
|
|
41
99
|
*/
|
|
42
|
-
listMountPoints(storeId: string, opts?: RequestOptions): Promise<
|
|
100
|
+
listMountPoints(storeId: string, opts?: RequestOptions): Promise<PluginMountPointListResult>;
|
|
43
101
|
/**
|
|
44
|
-
* Get detailed info about a
|
|
102
|
+
* Get detailed info about a plugin.
|
|
45
103
|
*/
|
|
46
|
-
|
|
104
|
+
details(pluginId: string, storeId: string, opts?: RequestOptions): Promise<PluginDetails>;
|
|
47
105
|
/**
|
|
48
|
-
*
|
|
106
|
+
* @deprecated Use retrieveDeployment() instead — it doesn't require storeId.
|
|
49
107
|
*/
|
|
50
|
-
|
|
108
|
+
deploymentDetails(deploymentId: string, storeId: string, opts?: RequestOptions): Promise<PluginDeploymentDetails>;
|
|
51
109
|
/**
|
|
52
110
|
* Delete a plugin and all its deployments.
|
|
53
111
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugins.d.ts","sourceRoot":"","sources":["../../src/resources/Plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Plugins.d.ts","sourceRoot":"","sources":["../../src/resources/Plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,0BAA0B,EAC1B,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EAErB,MAAM,qBAAqB,CAAC;AAwC7B;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAAY;IAGvC;;;;;;;;;;;;;;;;;OAiBG;IACG,eAAe,CAAC,MAAM,EAAE,qBAAqB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAuF3G;;;;OAIG;YACW,gBAAgB;IA8E9B;;;;OAIG;YACW,gBAAgB;IAwD9B;;;OAGG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAM5F;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,uBAAuB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAA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AO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAMvH;;OAEG;IACG,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrF;;OAEG;IACG,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAGvG"}
|
|
@@ -1,12 +1,260 @@
|
|
|
1
1
|
import { BaseResource } from './BaseResource.js';
|
|
2
|
+
const CONTENT_TYPES = {
|
|
3
|
+
'.html': 'text/html',
|
|
4
|
+
'.js': 'application/javascript',
|
|
5
|
+
'.mjs': 'application/javascript',
|
|
6
|
+
'.css': 'text/css',
|
|
7
|
+
'.svg': 'image/svg+xml',
|
|
8
|
+
'.png': 'image/png',
|
|
9
|
+
'.jpg': 'image/jpeg',
|
|
10
|
+
'.jpeg': 'image/jpeg',
|
|
11
|
+
'.gif': 'image/gif',
|
|
12
|
+
'.webp': 'image/webp',
|
|
13
|
+
'.ico': 'image/x-icon',
|
|
14
|
+
'.json': 'application/json',
|
|
15
|
+
'.woff': 'font/woff',
|
|
16
|
+
'.woff2': 'font/woff2',
|
|
17
|
+
'.ttf': 'font/ttf',
|
|
18
|
+
'.eot': 'application/vnd.ms-fontobject',
|
|
19
|
+
'.map': 'application/json',
|
|
20
|
+
'.txt': 'text/plain',
|
|
21
|
+
'.xml': 'application/xml',
|
|
22
|
+
'.webmanifest': 'application/manifest+json',
|
|
23
|
+
};
|
|
24
|
+
const INLINE_SIZE_LIMIT = 3.5 * 1024 * 1024; // 3.5 MB raw — base64 expands ~33%
|
|
25
|
+
const VERCEL_BLOB_API = 'https://vercel.com/api/blob';
|
|
26
|
+
const CRC_TABLE = new Uint32Array(256);
|
|
27
|
+
for (let i = 0; i < 256; i++) {
|
|
28
|
+
let c = i;
|
|
29
|
+
for (let j = 0; j < 8; j++)
|
|
30
|
+
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
31
|
+
CRC_TABLE[i] = c;
|
|
32
|
+
}
|
|
33
|
+
function crc32(buf) {
|
|
34
|
+
let crc = 0xffffffff;
|
|
35
|
+
for (let i = 0; i < buf.length; i++)
|
|
36
|
+
crc = CRC_TABLE[(crc ^ buf[i]) & 0xff] ^ (crc >>> 8);
|
|
37
|
+
return (crc ^ 0xffffffff) >>> 0;
|
|
38
|
+
}
|
|
2
39
|
/**
|
|
3
40
|
* Plugins V2 — deploy HTML/JS/CSS pages, instantiate them for stores,
|
|
4
41
|
* and mount them to custom domains or aliases.
|
|
5
|
-
*
|
|
6
|
-
* This is the mechanism Tagada uses to serve checkout pages, landing pages,
|
|
7
|
-
* upsell pages, and any custom storefront on your own domains.
|
|
8
42
|
*/
|
|
9
43
|
export class Plugins extends BaseResource {
|
|
44
|
+
// ─── High-Level Helpers ─────────────────────────────────────────────
|
|
45
|
+
/**
|
|
46
|
+
* Deploy a local build directory to TagadaPay's CDN in one call.
|
|
47
|
+
*
|
|
48
|
+
* Handles everything automatically: file collection, MIME type detection,
|
|
49
|
+
* base64 encoding, instantiation, and mounting to a CDN hostname.
|
|
50
|
+
* Builds up to ~3.5 MB are uploaded inline; larger builds are automatically
|
|
51
|
+
* zipped and uploaded via Vercel Blob (up to 50 MB).
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const result = await tagada.plugins.deployDirectory({
|
|
56
|
+
* directory: './dist',
|
|
57
|
+
* storeId: 'store_xxx',
|
|
58
|
+
* name: 'my-store',
|
|
59
|
+
* });
|
|
60
|
+
* console.log(result.url); // https://my-store--store_xxx.cdn.tagadapay.com/
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
async deployDirectory(params, opts) {
|
|
64
|
+
const { directory, storeId, name, version = '1.0.0', overwrite = true } = params;
|
|
65
|
+
const { readFileSync, readdirSync, statSync } = await import('fs');
|
|
66
|
+
const { join, relative, extname, resolve } = await import('path');
|
|
67
|
+
const collectRawFiles = (dir, base) => {
|
|
68
|
+
const files = [];
|
|
69
|
+
for (const entry of readdirSync(dir)) {
|
|
70
|
+
const full = join(dir, entry);
|
|
71
|
+
if (statSync(full).isDirectory()) {
|
|
72
|
+
files.push(...collectRawFiles(full, base));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
const ext = extname(full).toLowerCase();
|
|
76
|
+
files.push({
|
|
77
|
+
relPath: '/' + relative(base, full).replace(/\\/g, '/'),
|
|
78
|
+
content: readFileSync(full),
|
|
79
|
+
contentType: CONTENT_TYPES[ext] || 'application/octet-stream',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return files;
|
|
84
|
+
};
|
|
85
|
+
const absDir = resolve(directory);
|
|
86
|
+
const rawFiles = collectRawFiles(absDir, absDir);
|
|
87
|
+
const totalSize = rawFiles.reduce((sum, f) => sum + f.content.length, 0);
|
|
88
|
+
const deployOpts = { timeout: 180000, ...opts };
|
|
89
|
+
let deployResult;
|
|
90
|
+
if (totalSize <= INLINE_SIZE_LIMIT) {
|
|
91
|
+
const inlineAssets = rawFiles.map(f => ({
|
|
92
|
+
path: f.relPath,
|
|
93
|
+
content: f.content.toString('base64'),
|
|
94
|
+
contentType: f.contentType,
|
|
95
|
+
}));
|
|
96
|
+
deployResult = await this.deploy({
|
|
97
|
+
storeId,
|
|
98
|
+
manifest: { name, version, pages: [{ id: 'main', path: '/', name: 'Store' }] },
|
|
99
|
+
inlineAssets,
|
|
100
|
+
overwrite,
|
|
101
|
+
}, deployOpts);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
const zipBuffer = await this._createZipBuffer(rawFiles);
|
|
105
|
+
const blobUrl = await this._uploadZipToBlob(zipBuffer, name);
|
|
106
|
+
deployResult = await this.deploy({
|
|
107
|
+
storeId,
|
|
108
|
+
manifest: { name, version, pages: [{ id: 'main', path: '/', name: 'Store' }] },
|
|
109
|
+
zipUrl: blobUrl,
|
|
110
|
+
overwrite,
|
|
111
|
+
}, deployOpts);
|
|
112
|
+
}
|
|
113
|
+
const instanceResult = await this.instantiate({
|
|
114
|
+
deploymentId: deployResult.deploymentId,
|
|
115
|
+
storeId,
|
|
116
|
+
config: {},
|
|
117
|
+
}, opts);
|
|
118
|
+
const hostname = params.hostname || `${name}--${storeId}.cdn.tagadapay.com`;
|
|
119
|
+
await this.mount({
|
|
120
|
+
deploymentId: deployResult.deploymentId,
|
|
121
|
+
deploymentInstanceId: instanceResult.instanceId,
|
|
122
|
+
storeId,
|
|
123
|
+
hostname,
|
|
124
|
+
basePath: '/',
|
|
125
|
+
matcher: '/',
|
|
126
|
+
}, opts);
|
|
127
|
+
return {
|
|
128
|
+
pluginId: deployResult.pluginId,
|
|
129
|
+
deploymentId: deployResult.deploymentId,
|
|
130
|
+
instanceId: instanceResult.instanceId,
|
|
131
|
+
version: deployResult.version,
|
|
132
|
+
hostname,
|
|
133
|
+
url: `https://${hostname}/`,
|
|
134
|
+
uploadedFiles: deployResult.uploadedFiles,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
// ─── Private: ZIP + Blob Upload ────────────────────────────────────
|
|
138
|
+
/**
|
|
139
|
+
* Create a ZIP archive from raw file buffers using only Node.js built-ins.
|
|
140
|
+
* Uses the STORE method (no compression) for speed — the files are already
|
|
141
|
+
* minified JS/CSS/images, so deflate savings are minimal.
|
|
142
|
+
*/
|
|
143
|
+
async _createZipBuffer(files) {
|
|
144
|
+
const entries = [];
|
|
145
|
+
const parts = [];
|
|
146
|
+
let offset = 0;
|
|
147
|
+
for (const file of files) {
|
|
148
|
+
const pathStr = file.relPath.startsWith('/') ? file.relPath.slice(1) : file.relPath;
|
|
149
|
+
const nameBytes = Buffer.from(pathStr, 'utf-8');
|
|
150
|
+
const content = file.content;
|
|
151
|
+
const checksum = crc32(content);
|
|
152
|
+
const localHeader = Buffer.alloc(30 + nameBytes.length);
|
|
153
|
+
localHeader.writeUInt32LE(0x04034b50, 0); // local file header signature
|
|
154
|
+
localHeader.writeUInt16LE(20, 4); // version needed to extract (2.0)
|
|
155
|
+
localHeader.writeUInt16LE(0, 6); // general purpose bit flag
|
|
156
|
+
localHeader.writeUInt16LE(0, 8); // compression method: stored
|
|
157
|
+
localHeader.writeUInt16LE(0, 10); // last mod file time
|
|
158
|
+
localHeader.writeUInt16LE(0, 12); // last mod file date
|
|
159
|
+
localHeader.writeUInt32LE(checksum, 14); // crc-32
|
|
160
|
+
localHeader.writeUInt32LE(content.length, 18); // compressed size
|
|
161
|
+
localHeader.writeUInt32LE(content.length, 22); // uncompressed size
|
|
162
|
+
localHeader.writeUInt16LE(nameBytes.length, 26); // file name length
|
|
163
|
+
localHeader.writeUInt16LE(0, 28); // extra field length
|
|
164
|
+
nameBytes.copy(localHeader, 30);
|
|
165
|
+
entries.push({ name: nameBytes, content, crc: checksum, localHeaderOffset: offset });
|
|
166
|
+
parts.push(localHeader, content);
|
|
167
|
+
offset += localHeader.length + content.length;
|
|
168
|
+
}
|
|
169
|
+
const centralDirOffset = offset;
|
|
170
|
+
for (const entry of entries) {
|
|
171
|
+
const cdHeader = Buffer.alloc(46 + entry.name.length);
|
|
172
|
+
cdHeader.writeUInt32LE(0x02014b50, 0); // central directory file header signature
|
|
173
|
+
cdHeader.writeUInt16LE(20, 4); // version made by
|
|
174
|
+
cdHeader.writeUInt16LE(20, 6); // version needed to extract
|
|
175
|
+
cdHeader.writeUInt16LE(0, 8); // general purpose bit flag
|
|
176
|
+
cdHeader.writeUInt16LE(0, 10); // compression method: stored
|
|
177
|
+
cdHeader.writeUInt16LE(0, 12); // last mod file time
|
|
178
|
+
cdHeader.writeUInt16LE(0, 14); // last mod file date
|
|
179
|
+
cdHeader.writeUInt32LE(entry.crc, 16); // crc-32
|
|
180
|
+
cdHeader.writeUInt32LE(entry.content.length, 20); // compressed size
|
|
181
|
+
cdHeader.writeUInt32LE(entry.content.length, 24); // uncompressed size
|
|
182
|
+
cdHeader.writeUInt16LE(entry.name.length, 28); // file name length
|
|
183
|
+
cdHeader.writeUInt16LE(0, 30); // extra field length
|
|
184
|
+
cdHeader.writeUInt16LE(0, 32); // file comment length
|
|
185
|
+
cdHeader.writeUInt16LE(0, 34); // disk number start
|
|
186
|
+
cdHeader.writeUInt16LE(0, 36); // internal file attributes
|
|
187
|
+
cdHeader.writeUInt32LE(0, 38); // external file attributes
|
|
188
|
+
cdHeader.writeUInt32LE(entry.localHeaderOffset, 42); // relative offset of local header
|
|
189
|
+
entry.name.copy(cdHeader, 46);
|
|
190
|
+
parts.push(cdHeader);
|
|
191
|
+
offset += cdHeader.length;
|
|
192
|
+
}
|
|
193
|
+
const centralDirSize = offset - centralDirOffset;
|
|
194
|
+
const eocd = Buffer.alloc(22);
|
|
195
|
+
eocd.writeUInt32LE(0x06054b50, 0); // end of central directory signature
|
|
196
|
+
eocd.writeUInt16LE(0, 4); // disk number
|
|
197
|
+
eocd.writeUInt16LE(0, 6); // disk with central dir
|
|
198
|
+
eocd.writeUInt16LE(entries.length, 8); // entries on this disk
|
|
199
|
+
eocd.writeUInt16LE(entries.length, 10); // total entries
|
|
200
|
+
eocd.writeUInt32LE(centralDirSize, 12); // size of central directory
|
|
201
|
+
eocd.writeUInt32LE(centralDirOffset, 16); // offset of central directory
|
|
202
|
+
eocd.writeUInt16LE(0, 20); // comment length
|
|
203
|
+
parts.push(eocd);
|
|
204
|
+
return Buffer.concat(parts);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Upload a ZIP buffer to Vercel Blob using the two-step client upload protocol.
|
|
208
|
+
* Step 1: POST to generate-upload-token to get a signed clientToken.
|
|
209
|
+
* Step 2: PUT the ZIP to the Vercel Blob API with that token.
|
|
210
|
+
*/
|
|
211
|
+
async _uploadZipToBlob(zipBuffer, pluginName) {
|
|
212
|
+
const apiKey = this.client.apiKey;
|
|
213
|
+
const baseUrl = this.client.baseUrl;
|
|
214
|
+
const filename = `${pluginName}-${Date.now()}.zip`;
|
|
215
|
+
const tokenUrl = `${baseUrl}/plugins/generate-upload-token`;
|
|
216
|
+
const tokenRes = await fetch(tokenUrl, {
|
|
217
|
+
method: 'POST',
|
|
218
|
+
headers: { 'Content-Type': 'application/json' },
|
|
219
|
+
body: JSON.stringify({
|
|
220
|
+
type: 'blob.generate-client-token',
|
|
221
|
+
payload: {
|
|
222
|
+
pathname: filename,
|
|
223
|
+
clientPayload: JSON.stringify({ apiKey, pluginId: pluginName }),
|
|
224
|
+
multipart: false,
|
|
225
|
+
},
|
|
226
|
+
}),
|
|
227
|
+
});
|
|
228
|
+
if (!tokenRes.ok) {
|
|
229
|
+
const errText = await tokenRes.text().catch(() => '');
|
|
230
|
+
throw new Error(`Failed to get upload token (HTTP ${tokenRes.status}): ${errText}`);
|
|
231
|
+
}
|
|
232
|
+
const { clientToken } = (await tokenRes.json());
|
|
233
|
+
if (!clientToken?.startsWith('vercel_blob_client_')) {
|
|
234
|
+
throw new Error('Invalid upload token received from server');
|
|
235
|
+
}
|
|
236
|
+
const params = new URLSearchParams({ pathname: filename });
|
|
237
|
+
const putRes = await fetch(`${VERCEL_BLOB_API}?${params.toString()}`, {
|
|
238
|
+
method: 'PUT',
|
|
239
|
+
headers: {
|
|
240
|
+
authorization: `Bearer ${clientToken}`,
|
|
241
|
+
'x-vercel-blob-access': 'public',
|
|
242
|
+
'x-content-type': 'application/zip',
|
|
243
|
+
'x-api-version': '12',
|
|
244
|
+
},
|
|
245
|
+
body: zipBuffer,
|
|
246
|
+
});
|
|
247
|
+
if (!putRes.ok) {
|
|
248
|
+
const errBody = await putRes.text().catch(() => '');
|
|
249
|
+
throw new Error(`Blob upload failed (HTTP ${putRes.status}): ${errBody}`);
|
|
250
|
+
}
|
|
251
|
+
const blob = (await putRes.json());
|
|
252
|
+
if (!blob.url) {
|
|
253
|
+
throw new Error('Blob upload succeeded but no URL returned');
|
|
254
|
+
}
|
|
255
|
+
return blob.url;
|
|
256
|
+
}
|
|
257
|
+
// ─── Deploy ──────────────────────────────────────────────────────────
|
|
10
258
|
/**
|
|
11
259
|
* Deploy a plugin with inline assets (HTML, JS, CSS as base64) or
|
|
12
260
|
* from a ZIP URL. Returns a deploymentId used for instantiation and mounting.
|
|
@@ -14,16 +262,37 @@ export class Plugins extends BaseResource {
|
|
|
14
262
|
async deploy(params, opts) {
|
|
15
263
|
return this._post('/plugins/v2/deploy', params, opts);
|
|
16
264
|
}
|
|
265
|
+
// ─── Instances ───────────────────────────────────────────────────────
|
|
17
266
|
/**
|
|
18
267
|
* Create an instance of a deployed plugin for a specific store.
|
|
19
|
-
* Instances allow per-store configuration of the same deployment.
|
|
20
268
|
*/
|
|
21
269
|
async instantiate(params, opts) {
|
|
22
270
|
return this._post('/plugins/v2/instantiate', params, opts);
|
|
23
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* List all instances for a store.
|
|
274
|
+
* Optionally filter by deploymentId.
|
|
275
|
+
*/
|
|
276
|
+
async listInstances(storeId, deploymentId, opts) {
|
|
277
|
+
return this._get(`/plugins/v2/instances/${encodeURIComponent(storeId)}`, deploymentId ? { deploymentId } : undefined, opts);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Retrieve a single instance by ID.
|
|
281
|
+
*/
|
|
282
|
+
async retrieveInstance(instanceId, opts) {
|
|
283
|
+
return this._get(`/plugins/v2/instances/detail/${encodeURIComponent(instanceId)}`, undefined, opts);
|
|
284
|
+
}
|
|
285
|
+
// ─── Deployments ─────────────────────────────────────────────────────
|
|
286
|
+
/**
|
|
287
|
+
* Retrieve deployment details (version, pages, instances).
|
|
288
|
+
* Does not require storeId — deployments are global.
|
|
289
|
+
*/
|
|
290
|
+
async retrieveDeployment(deploymentId, opts) {
|
|
291
|
+
return this._get(`/plugins/v2/deployments/${encodeURIComponent(deploymentId)}`, undefined, opts);
|
|
292
|
+
}
|
|
293
|
+
// ─── Mounting ────────────────────────────────────────────────────────
|
|
24
294
|
/**
|
|
25
295
|
* Mount a plugin deployment/instance to a custom domain or alias.
|
|
26
|
-
* The domain must be verified in your account's custom domains.
|
|
27
296
|
*/
|
|
28
297
|
async mount(params, opts) {
|
|
29
298
|
return this._post('/plugins/v2/mount', params, opts);
|
|
@@ -35,35 +304,53 @@ export class Plugins extends BaseResource {
|
|
|
35
304
|
return this._post('/plugins/v2/unmount', params, opts);
|
|
36
305
|
}
|
|
37
306
|
/**
|
|
38
|
-
*
|
|
307
|
+
* Configure A/B split testing on an existing route.
|
|
308
|
+
*
|
|
309
|
+
* @example Weighted 50/50 split
|
|
310
|
+
* ```ts
|
|
311
|
+
* await tagada.plugins.configureSplit({
|
|
312
|
+
* routeId: 'route_xxx',
|
|
313
|
+
* storeId: 'store_xxx',
|
|
314
|
+
* splitConfig: {
|
|
315
|
+
* type: 'weighted',
|
|
316
|
+
* instances: [
|
|
317
|
+
* { instanceId: 'inst_a', deploymentId: 'dep_a', weight: 50 },
|
|
318
|
+
* { instanceId: 'inst_b', deploymentId: 'dep_b', weight: 50 },
|
|
319
|
+
* ],
|
|
320
|
+
* },
|
|
321
|
+
* });
|
|
322
|
+
* ```
|
|
39
323
|
*/
|
|
40
|
-
async
|
|
41
|
-
return this._post('/plugins/v2/
|
|
324
|
+
async configureSplit(params, opts) {
|
|
325
|
+
return this._post('/plugins/v2/split', params, opts);
|
|
42
326
|
}
|
|
327
|
+
// ─── Listing ─────────────────────────────────────────────────────────
|
|
43
328
|
/**
|
|
44
|
-
* List all
|
|
329
|
+
* List all plugins for a store.
|
|
45
330
|
*/
|
|
46
|
-
async
|
|
47
|
-
return this.
|
|
331
|
+
async list(storeId, opts) {
|
|
332
|
+
return this._get(`/plugins/v2/list/${encodeURIComponent(storeId)}`, undefined, opts);
|
|
48
333
|
}
|
|
49
334
|
/**
|
|
50
335
|
* List mount points for a store.
|
|
51
336
|
*/
|
|
52
337
|
async listMountPoints(storeId, opts) {
|
|
53
|
-
return this.
|
|
338
|
+
return this._get(`/plugins/v2/mount-points/${encodeURIComponent(storeId)}`, undefined, opts);
|
|
54
339
|
}
|
|
340
|
+
// ─── Details ─────────────────────────────────────────────────────────
|
|
55
341
|
/**
|
|
56
|
-
* Get detailed info about a
|
|
342
|
+
* Get detailed info about a plugin.
|
|
57
343
|
*/
|
|
58
|
-
async
|
|
59
|
-
return this.
|
|
344
|
+
async details(pluginId, storeId, opts) {
|
|
345
|
+
return this._get(`/plugins/v2/details/${encodeURIComponent(pluginId)}`, { storeId }, opts);
|
|
60
346
|
}
|
|
61
347
|
/**
|
|
62
|
-
*
|
|
348
|
+
* @deprecated Use retrieveDeployment() instead — it doesn't require storeId.
|
|
63
349
|
*/
|
|
64
|
-
async
|
|
65
|
-
return this._post('/plugins/v2/details', {
|
|
350
|
+
async deploymentDetails(deploymentId, storeId, opts) {
|
|
351
|
+
return this._post('/plugins/v2/deployment/details', { deploymentId, storeId }, opts);
|
|
66
352
|
}
|
|
353
|
+
// ─── Management ──────────────────────────────────────────────────────
|
|
67
354
|
/**
|
|
68
355
|
* Delete a plugin and all its deployments.
|
|
69
356
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugins.js","sourceRoot":"","sources":["../../src/resources/Plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYjD;;;;;;GAMG;AACH,MAAM,OAAO,OAAQ,SAAQ,YAAY;IACvC;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,MAA0B,EAAE,IAAqB;QAC5D,OAAO,IAAI,CAAC,KAAK,CAAqB,oBAAoB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5E,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,MAA+B,EAAE,IAAqB;QACtE,OAAO,IAAI,CAAC,KAAK,CAA0B,yBAAyB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACtF,CAAC;IAED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1
1
|
import { BaseResource } from './BaseResource.js';
|
|
2
2
|
import type { RequestOptions } from '../types/common.js';
|
|
3
|
-
import type { Processor, ProcessorCreateParams, ProcessorUpdateParams } from '../types/processors.js';
|
|
3
|
+
import type { Processor, ProcessorCreateParams, ProcessorUpdateParams, StripeConnectInitiateParams, StripeConnectInitiateResponse, StripeConnectDisconnectParams, StripeAccountDetails } from '../types/processors.js';
|
|
4
4
|
/**
|
|
5
5
|
* Processors represent the payment gateways/PSPs connected to your Tagada
|
|
6
6
|
* account. Tagada is gateway-agnostic: you can connect Stripe, Adyen, NMI,
|
|
@@ -50,5 +50,43 @@ export declare class Processors extends BaseResource {
|
|
|
50
50
|
del(processorIds: string[], opts?: RequestOptions): Promise<{
|
|
51
51
|
processors: string[];
|
|
52
52
|
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Initiate a Stripe Connect OAuth flow. Returns a URL that the merchant
|
|
55
|
+
* must visit in their browser to authorize TagadaPay to use their Stripe
|
|
56
|
+
* account.
|
|
57
|
+
*
|
|
58
|
+
* After the merchant completes the OAuth flow, Stripe redirects back to
|
|
59
|
+
* TagadaPay, which saves the connected account credentials on the
|
|
60
|
+
* processor automatically.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* const { url } = await tagada.processors.initiateStripeConnect({
|
|
64
|
+
* processorId: 'processor_abc123',
|
|
65
|
+
* });
|
|
66
|
+
* // Redirect the merchant to `url` in their browser
|
|
67
|
+
*/
|
|
68
|
+
initiateStripeConnect(params: StripeConnectInitiateParams, opts?: RequestOptions): Promise<StripeConnectInitiateResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* Disconnect a Stripe Connect account from a processor.
|
|
71
|
+
* Revokes the OAuth authorization and disables the processor.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* await tagada.processors.disconnectStripe({
|
|
75
|
+
* accountId: 'acct_1234567890',
|
|
76
|
+
* processorId: 'processor_abc123',
|
|
77
|
+
* });
|
|
78
|
+
*/
|
|
79
|
+
disconnectStripe(params: StripeConnectDisconnectParams, opts?: RequestOptions): Promise<{
|
|
80
|
+
success: boolean;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Retrieve details about a connected Stripe account (capabilities,
|
|
84
|
+
* charges enabled, country, etc.).
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* const details = await tagada.processors.getStripeAccountDetails('acct_1234567890');
|
|
88
|
+
* console.log(details.charges_enabled, details.country);
|
|
89
|
+
*/
|
|
90
|
+
getStripeAccountDetails(accountId: string, opts?: RequestOptions): Promise<StripeAccountDetails>;
|
|
53
91
|
}
|
|
54
92
|
//# sourceMappingURL=Processors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Processors.d.ts","sourceRoot":"","sources":["../../src/resources/Processors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Processors.d.ts","sourceRoot":"","sources":["../../src/resources/Processors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,6BAA6B,EAC7B,6BAA6B,EAC7B,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C;;OAEG;IACG,IAAI,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,SAAS,EAAE,CAAA;KAAE,CAAC;IAIvE;;OAEG;IACG,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC;IAI9E;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CAAC,MAAM,EAAE,qBAAqB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,SAAS,CAAA;KAAE,CAAC;IAIrG;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,qBAAqB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,SAAS,CAAA;KAAE,CAAC;IAIrG;;OAEG;IACG,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAM3F;;;;;;;;;;;;;;OAcG;IACG,qBAAqB,CACzB,MAAM,EAAE,2BAA2B,EACnC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,6BAA6B,CAAC;IAQzC;;;;;;;;;OASG;IACG,gBAAgB,CACpB,MAAM,EAAE,6BAA6B,EACrC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAQhC;;;;;;;OAOG;IACG,uBAAuB,CAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,oBAAoB,CAAC;CAOjC"}
|
|
@@ -50,5 +50,48 @@ export class Processors extends BaseResource {
|
|
|
50
50
|
async del(processorIds, opts) {
|
|
51
51
|
return this._post('/processors/delete', { processorIds }, opts);
|
|
52
52
|
}
|
|
53
|
+
// ── Stripe Connect ───────────────────────────────────────────────────
|
|
54
|
+
/**
|
|
55
|
+
* Initiate a Stripe Connect OAuth flow. Returns a URL that the merchant
|
|
56
|
+
* must visit in their browser to authorize TagadaPay to use their Stripe
|
|
57
|
+
* account.
|
|
58
|
+
*
|
|
59
|
+
* After the merchant completes the OAuth flow, Stripe redirects back to
|
|
60
|
+
* TagadaPay, which saves the connected account credentials on the
|
|
61
|
+
* processor automatically.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const { url } = await tagada.processors.initiateStripeConnect({
|
|
65
|
+
* processorId: 'processor_abc123',
|
|
66
|
+
* });
|
|
67
|
+
* // Redirect the merchant to `url` in their browser
|
|
68
|
+
*/
|
|
69
|
+
async initiateStripeConnect(params, opts) {
|
|
70
|
+
return this._post('/processors/stripe-connect/initiate', params, opts);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Disconnect a Stripe Connect account from a processor.
|
|
74
|
+
* Revokes the OAuth authorization and disables the processor.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await tagada.processors.disconnectStripe({
|
|
78
|
+
* accountId: 'acct_1234567890',
|
|
79
|
+
* processorId: 'processor_abc123',
|
|
80
|
+
* });
|
|
81
|
+
*/
|
|
82
|
+
async disconnectStripe(params, opts) {
|
|
83
|
+
return this._post('/processors/stripe-connect/disconnect', params, opts);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Retrieve details about a connected Stripe account (capabilities,
|
|
87
|
+
* charges enabled, country, etc.).
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const details = await tagada.processors.getStripeAccountDetails('acct_1234567890');
|
|
91
|
+
* console.log(details.charges_enabled, details.country);
|
|
92
|
+
*/
|
|
93
|
+
async getStripeAccountDetails(accountId, opts) {
|
|
94
|
+
return this._post('/processors/stripe-connect/account', { accountId }, opts);
|
|
95
|
+
}
|
|
53
96
|
}
|
|
54
97
|
//# sourceMappingURL=Processors.js.map
|