stripe-experiment-sync 1.0.2 → 1.0.6
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/chunk-3UERGK2O.js +73 -0
- package/dist/index.cjs +25 -7
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +17 -65
- package/dist/supabase/index.cjs +509 -0
- package/dist/supabase/index.d.cts +115 -0
- package/dist/supabase/index.d.ts +115 -0
- package/dist/supabase/index.js +396 -0
- package/package.json +11 -7
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// package.json
|
|
2
|
+
var package_default = {
|
|
3
|
+
name: "stripe-experiment-sync",
|
|
4
|
+
version: "1.0.6",
|
|
5
|
+
private: false,
|
|
6
|
+
description: "Stripe Sync Engine to sync Stripe data to Postgres",
|
|
7
|
+
type: "module",
|
|
8
|
+
main: "./dist/index.cjs",
|
|
9
|
+
bin: "./dist/cli/index.cjs",
|
|
10
|
+
exports: {
|
|
11
|
+
".": {
|
|
12
|
+
types: "./dist/index.d.ts",
|
|
13
|
+
import: "./dist/index.js",
|
|
14
|
+
require: "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./supabase": {
|
|
17
|
+
types: "./dist/supabase/index.d.ts",
|
|
18
|
+
import: "./dist/supabase/index.js",
|
|
19
|
+
require: "./dist/supabase/index.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
scripts: {
|
|
23
|
+
clean: "rimraf dist",
|
|
24
|
+
prebuild: "npm run clean",
|
|
25
|
+
build: "tsup src/index.ts src/supabase/index.ts --format esm,cjs --dts --shims && cp -r src/database/migrations dist/migrations",
|
|
26
|
+
lint: "eslint src --ext .ts",
|
|
27
|
+
test: "vitest"
|
|
28
|
+
},
|
|
29
|
+
files: [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
dependencies: {
|
|
33
|
+
pg: "^8.16.3",
|
|
34
|
+
"pg-node-migrations": "0.0.8",
|
|
35
|
+
"supabase-management-js": "^0.1.6",
|
|
36
|
+
ws: "^8.18.0",
|
|
37
|
+
yesql: "^7.0.0"
|
|
38
|
+
},
|
|
39
|
+
peerDependencies: {
|
|
40
|
+
stripe: "> 11"
|
|
41
|
+
},
|
|
42
|
+
devDependencies: {
|
|
43
|
+
"@types/node": "^24.10.1",
|
|
44
|
+
"@types/pg": "^8.15.5",
|
|
45
|
+
"@types/ws": "^8.5.13",
|
|
46
|
+
"@types/yesql": "^4.1.4",
|
|
47
|
+
"@vitest/ui": "^4.0.9",
|
|
48
|
+
vitest: "^3.2.4"
|
|
49
|
+
},
|
|
50
|
+
repository: {
|
|
51
|
+
type: "git",
|
|
52
|
+
url: "https://github.com/tx-stripe/stripe-sync-engine.git"
|
|
53
|
+
},
|
|
54
|
+
homepage: "https://github.com/tx-stripe/stripe-sync-engine#readme",
|
|
55
|
+
bugs: {
|
|
56
|
+
url: "https://github.com/tx-stripe/stripe-sync-engine/issues"
|
|
57
|
+
},
|
|
58
|
+
keywords: [
|
|
59
|
+
"stripe",
|
|
60
|
+
"postgres",
|
|
61
|
+
"sync",
|
|
62
|
+
"webhooks",
|
|
63
|
+
"supabase",
|
|
64
|
+
"billing",
|
|
65
|
+
"database",
|
|
66
|
+
"typescript"
|
|
67
|
+
],
|
|
68
|
+
author: "Supabase <https://supabase.com/>"
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
package_default
|
|
73
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -45,25 +45,28 @@ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
|
45
45
|
// package.json
|
|
46
46
|
var package_default = {
|
|
47
47
|
name: "stripe-experiment-sync",
|
|
48
|
-
version: "1.0.
|
|
48
|
+
version: "1.0.6",
|
|
49
49
|
private: false,
|
|
50
50
|
description: "Stripe Sync Engine to sync Stripe data to Postgres",
|
|
51
51
|
type: "module",
|
|
52
52
|
main: "./dist/index.cjs",
|
|
53
|
+
bin: "./dist/cli/index.cjs",
|
|
53
54
|
exports: {
|
|
54
|
-
|
|
55
|
+
".": {
|
|
55
56
|
types: "./dist/index.d.ts",
|
|
56
|
-
import: "./dist/index.js"
|
|
57
|
-
},
|
|
58
|
-
require: {
|
|
59
|
-
types: "./dist/index.d.cts",
|
|
57
|
+
import: "./dist/index.js",
|
|
60
58
|
require: "./dist/index.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./supabase": {
|
|
61
|
+
types: "./dist/supabase/index.d.ts",
|
|
62
|
+
import: "./dist/supabase/index.js",
|
|
63
|
+
require: "./dist/supabase/index.cjs"
|
|
61
64
|
}
|
|
62
65
|
},
|
|
63
66
|
scripts: {
|
|
64
67
|
clean: "rimraf dist",
|
|
65
68
|
prebuild: "npm run clean",
|
|
66
|
-
build: "tsup src/index.ts --format esm,cjs --dts --shims && cp -r src/database/migrations dist/migrations",
|
|
69
|
+
build: "tsup src/index.ts src/supabase/index.ts --format esm,cjs --dts --shims && cp -r src/database/migrations dist/migrations",
|
|
67
70
|
lint: "eslint src --ext .ts",
|
|
68
71
|
test: "vitest"
|
|
69
72
|
},
|
|
@@ -73,6 +76,7 @@ var package_default = {
|
|
|
73
76
|
dependencies: {
|
|
74
77
|
pg: "^8.16.3",
|
|
75
78
|
"pg-node-migrations": "0.0.8",
|
|
79
|
+
"supabase-management-js": "^0.1.6",
|
|
76
80
|
ws: "^8.18.0",
|
|
77
81
|
yesql: "^7.0.0"
|
|
78
82
|
},
|
|
@@ -753,6 +757,13 @@ var PostgresClient = class {
|
|
|
753
757
|
);
|
|
754
758
|
return parseInt(result.rows[0].count) === 0;
|
|
755
759
|
}
|
|
760
|
+
/**
|
|
761
|
+
* Closes the database connection pool and cleans up resources.
|
|
762
|
+
* Call this when you're done using the PostgresClient instance.
|
|
763
|
+
*/
|
|
764
|
+
async close() {
|
|
765
|
+
await this.pool.end();
|
|
766
|
+
}
|
|
756
767
|
};
|
|
757
768
|
|
|
758
769
|
// src/schemas/managed_webhook.ts
|
|
@@ -3249,6 +3260,13 @@ var StripeSync = class {
|
|
|
3249
3260
|
}
|
|
3250
3261
|
return entities;
|
|
3251
3262
|
}
|
|
3263
|
+
/**
|
|
3264
|
+
* Closes the database connection pool and cleans up resources.
|
|
3265
|
+
* Call this when you're done using the StripeSync instance.
|
|
3266
|
+
*/
|
|
3267
|
+
async close() {
|
|
3268
|
+
await this.postgresClient.pool.end();
|
|
3269
|
+
}
|
|
3252
3270
|
};
|
|
3253
3271
|
function chunkArray(array, chunkSize) {
|
|
3254
3272
|
const result = [];
|
package/dist/index.d.cts
CHANGED
|
@@ -191,6 +191,11 @@ declare class PostgresClient {
|
|
|
191
191
|
* Check if all objects in a run are complete (or error).
|
|
192
192
|
*/
|
|
193
193
|
areAllObjectsComplete(accountId: string, runStartedAt: Date): Promise<boolean>;
|
|
194
|
+
/**
|
|
195
|
+
* Closes the database connection pool and cleans up resources.
|
|
196
|
+
* Call this when you're done using the PostgresClient instance.
|
|
197
|
+
*/
|
|
198
|
+
close(): Promise<void>;
|
|
194
199
|
}
|
|
195
200
|
|
|
196
201
|
/**
|
|
@@ -571,6 +576,11 @@ declare class StripeSync {
|
|
|
571
576
|
*/
|
|
572
577
|
private expandEntity;
|
|
573
578
|
private fetchMissingEntities;
|
|
579
|
+
/**
|
|
580
|
+
* Closes the database connection pool and cleans up resources.
|
|
581
|
+
* Call this when you're done using the StripeSync instance.
|
|
582
|
+
*/
|
|
583
|
+
close(): Promise<void>;
|
|
574
584
|
}
|
|
575
585
|
|
|
576
586
|
type MigrationConfig = {
|
package/dist/index.d.ts
CHANGED
|
@@ -191,6 +191,11 @@ declare class PostgresClient {
|
|
|
191
191
|
* Check if all objects in a run are complete (or error).
|
|
192
192
|
*/
|
|
193
193
|
areAllObjectsComplete(accountId: string, runStartedAt: Date): Promise<boolean>;
|
|
194
|
+
/**
|
|
195
|
+
* Closes the database connection pool and cleans up resources.
|
|
196
|
+
* Call this when you're done using the PostgresClient instance.
|
|
197
|
+
*/
|
|
198
|
+
close(): Promise<void>;
|
|
194
199
|
}
|
|
195
200
|
|
|
196
201
|
/**
|
|
@@ -571,6 +576,11 @@ declare class StripeSync {
|
|
|
571
576
|
*/
|
|
572
577
|
private expandEntity;
|
|
573
578
|
private fetchMissingEntities;
|
|
579
|
+
/**
|
|
580
|
+
* Closes the database connection pool and cleans up resources.
|
|
581
|
+
* Call this when you're done using the StripeSync instance.
|
|
582
|
+
*/
|
|
583
|
+
close(): Promise<void>;
|
|
574
584
|
}
|
|
575
585
|
|
|
576
586
|
type MigrationConfig = {
|
package/dist/index.js
CHANGED
|
@@ -1,68 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
version: "1.0.2",
|
|
5
|
-
private: false,
|
|
6
|
-
description: "Stripe Sync Engine to sync Stripe data to Postgres",
|
|
7
|
-
type: "module",
|
|
8
|
-
main: "./dist/index.cjs",
|
|
9
|
-
exports: {
|
|
10
|
-
import: {
|
|
11
|
-
types: "./dist/index.d.ts",
|
|
12
|
-
import: "./dist/index.js"
|
|
13
|
-
},
|
|
14
|
-
require: {
|
|
15
|
-
types: "./dist/index.d.cts",
|
|
16
|
-
require: "./dist/index.cjs"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
scripts: {
|
|
20
|
-
clean: "rimraf dist",
|
|
21
|
-
prebuild: "npm run clean",
|
|
22
|
-
build: "tsup src/index.ts --format esm,cjs --dts --shims && cp -r src/database/migrations dist/migrations",
|
|
23
|
-
lint: "eslint src --ext .ts",
|
|
24
|
-
test: "vitest"
|
|
25
|
-
},
|
|
26
|
-
files: [
|
|
27
|
-
"dist"
|
|
28
|
-
],
|
|
29
|
-
dependencies: {
|
|
30
|
-
pg: "^8.16.3",
|
|
31
|
-
"pg-node-migrations": "0.0.8",
|
|
32
|
-
ws: "^8.18.0",
|
|
33
|
-
yesql: "^7.0.0"
|
|
34
|
-
},
|
|
35
|
-
peerDependencies: {
|
|
36
|
-
stripe: "> 11"
|
|
37
|
-
},
|
|
38
|
-
devDependencies: {
|
|
39
|
-
"@types/node": "^24.10.1",
|
|
40
|
-
"@types/pg": "^8.15.5",
|
|
41
|
-
"@types/ws": "^8.5.13",
|
|
42
|
-
"@types/yesql": "^4.1.4",
|
|
43
|
-
"@vitest/ui": "^4.0.9",
|
|
44
|
-
vitest: "^3.2.4"
|
|
45
|
-
},
|
|
46
|
-
repository: {
|
|
47
|
-
type: "git",
|
|
48
|
-
url: "https://github.com/tx-stripe/stripe-sync-engine.git"
|
|
49
|
-
},
|
|
50
|
-
homepage: "https://github.com/tx-stripe/stripe-sync-engine#readme",
|
|
51
|
-
bugs: {
|
|
52
|
-
url: "https://github.com/tx-stripe/stripe-sync-engine/issues"
|
|
53
|
-
},
|
|
54
|
-
keywords: [
|
|
55
|
-
"stripe",
|
|
56
|
-
"postgres",
|
|
57
|
-
"sync",
|
|
58
|
-
"webhooks",
|
|
59
|
-
"supabase",
|
|
60
|
-
"billing",
|
|
61
|
-
"database",
|
|
62
|
-
"typescript"
|
|
63
|
-
],
|
|
64
|
-
author: "Supabase <https://supabase.com/>"
|
|
65
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
package_default
|
|
3
|
+
} from "./chunk-3UERGK2O.js";
|
|
66
4
|
|
|
67
5
|
// src/stripeSync.ts
|
|
68
6
|
import Stripe2 from "stripe";
|
|
@@ -709,6 +647,13 @@ var PostgresClient = class {
|
|
|
709
647
|
);
|
|
710
648
|
return parseInt(result.rows[0].count) === 0;
|
|
711
649
|
}
|
|
650
|
+
/**
|
|
651
|
+
* Closes the database connection pool and cleans up resources.
|
|
652
|
+
* Call this when you're done using the PostgresClient instance.
|
|
653
|
+
*/
|
|
654
|
+
async close() {
|
|
655
|
+
await this.pool.end();
|
|
656
|
+
}
|
|
712
657
|
};
|
|
713
658
|
|
|
714
659
|
// src/schemas/managed_webhook.ts
|
|
@@ -3205,6 +3150,13 @@ var StripeSync = class {
|
|
|
3205
3150
|
}
|
|
3206
3151
|
return entities;
|
|
3207
3152
|
}
|
|
3153
|
+
/**
|
|
3154
|
+
* Closes the database connection pool and cleans up resources.
|
|
3155
|
+
* Call this when you're done using the StripeSync instance.
|
|
3156
|
+
*/
|
|
3157
|
+
async close() {
|
|
3158
|
+
await this.postgresClient.pool.end();
|
|
3159
|
+
}
|
|
3208
3160
|
};
|
|
3209
3161
|
function chunkArray(array, chunkSize) {
|
|
3210
3162
|
const result = [];
|