stripe-experiment-sync 1.0.11 → 1.0.12
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-LFXGDVMC.js → chunk-2TIRMOJR.js} +1 -1
- package/dist/{chunk-4MOFTZ53.js → chunk-6KTLIYUL.js} +2 -2
- package/dist/{chunk-XTL72K7K.js → chunk-IO2EEPFD.js} +1 -1
- package/dist/{chunk-EVNKMOYA.js → chunk-RAM7OG7J.js} +8 -6
- package/dist/cli/index.cjs +8 -6
- package/dist/cli/index.js +4 -4
- package/dist/cli/lib.cjs +8 -6
- package/dist/cli/lib.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/supabase/index.cjs +8 -6
- package/dist/supabase/index.d.cts +4 -2
- package/dist/supabase/index.d.ts +4 -2
- package/dist/supabase/index.js +2 -2
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
StripeSync,
|
|
3
3
|
createStripeWebSocketClient,
|
|
4
4
|
runMigrations
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2TIRMOJR.js";
|
|
6
6
|
import {
|
|
7
7
|
install,
|
|
8
8
|
uninstall
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RAM7OG7J.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/config.ts
|
|
12
12
|
import dotenv from "dotenv";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IO2EEPFD.js";
|
|
4
4
|
|
|
5
5
|
// src/supabase/supabase.ts
|
|
6
6
|
import { SupabaseManagementAPI } from "supabase-management-js";
|
|
@@ -301,7 +301,7 @@ var SupabaseSetupClient = class {
|
|
|
301
301
|
* Removes all Edge Functions, secrets, database resources, and Stripe webhooks
|
|
302
302
|
*/
|
|
303
303
|
async uninstall(stripeSecretKey) {
|
|
304
|
-
const stripe = new Stripe(stripeSecretKey, { apiVersion: "2025-02-24.acacia" });
|
|
304
|
+
const stripe = stripeSecretKey ? new Stripe(stripeSecretKey, { apiVersion: "2025-02-24.acacia" }) : null;
|
|
305
305
|
try {
|
|
306
306
|
try {
|
|
307
307
|
const webhookResult = await this.runSQL(`
|
|
@@ -310,7 +310,7 @@ var SupabaseSetupClient = class {
|
|
|
310
310
|
const webhookIds = webhookResult[0]?.rows?.map((r) => r.id) || [];
|
|
311
311
|
for (const webhookId of webhookIds) {
|
|
312
312
|
try {
|
|
313
|
-
await stripe
|
|
313
|
+
await stripe?.webhookEndpoints.del(webhookId);
|
|
314
314
|
} catch (err) {
|
|
315
315
|
console.warn(`Could not delete Stripe webhook ${webhookId}:`, err);
|
|
316
316
|
}
|
|
@@ -440,13 +440,15 @@ async function install(params) {
|
|
|
440
440
|
}
|
|
441
441
|
async function uninstall(params) {
|
|
442
442
|
const { supabaseAccessToken, supabaseProjectRef, stripeKey } = params;
|
|
443
|
-
const trimmedStripeKey = stripeKey.trim();
|
|
444
|
-
if (!trimmedStripeKey.startsWith("sk_") && !trimmedStripeKey.startsWith("rk_")) {
|
|
443
|
+
const trimmedStripeKey = stripeKey && stripeKey.trim();
|
|
444
|
+
if (trimmedStripeKey && !trimmedStripeKey.startsWith("sk_") && !trimmedStripeKey.startsWith("rk_")) {
|
|
445
445
|
throw new Error('Stripe key should start with "sk_" or "rk_"');
|
|
446
446
|
}
|
|
447
447
|
const client = new SupabaseSetupClient({
|
|
448
448
|
accessToken: supabaseAccessToken,
|
|
449
|
-
projectRef: supabaseProjectRef
|
|
449
|
+
projectRef: supabaseProjectRef,
|
|
450
|
+
projectBaseUrl: params.baseProjectUrl,
|
|
451
|
+
managementApiBaseUrl: params.baseManagementApiUrl
|
|
450
452
|
});
|
|
451
453
|
await client.uninstall(trimmedStripeKey);
|
|
452
454
|
}
|
package/dist/cli/index.cjs
CHANGED
|
@@ -33,7 +33,7 @@ var import_commander = require("commander");
|
|
|
33
33
|
// package.json
|
|
34
34
|
var package_default = {
|
|
35
35
|
name: "stripe-experiment-sync",
|
|
36
|
-
version: "1.0.
|
|
36
|
+
version: "1.0.12",
|
|
37
37
|
private: false,
|
|
38
38
|
description: "Stripe Sync Engine to sync Stripe data to Postgres",
|
|
39
39
|
type: "module",
|
|
@@ -3926,7 +3926,7 @@ var SupabaseSetupClient = class {
|
|
|
3926
3926
|
* Removes all Edge Functions, secrets, database resources, and Stripe webhooks
|
|
3927
3927
|
*/
|
|
3928
3928
|
async uninstall(stripeSecretKey) {
|
|
3929
|
-
const stripe = new import_stripe3.default(stripeSecretKey, { apiVersion: "2025-02-24.acacia" });
|
|
3929
|
+
const stripe = stripeSecretKey ? new import_stripe3.default(stripeSecretKey, { apiVersion: "2025-02-24.acacia" }) : null;
|
|
3930
3930
|
try {
|
|
3931
3931
|
try {
|
|
3932
3932
|
const webhookResult = await this.runSQL(`
|
|
@@ -3935,7 +3935,7 @@ var SupabaseSetupClient = class {
|
|
|
3935
3935
|
const webhookIds = webhookResult[0]?.rows?.map((r) => r.id) || [];
|
|
3936
3936
|
for (const webhookId of webhookIds) {
|
|
3937
3937
|
try {
|
|
3938
|
-
await stripe
|
|
3938
|
+
await stripe?.webhookEndpoints.del(webhookId);
|
|
3939
3939
|
} catch (err) {
|
|
3940
3940
|
console.warn(`Could not delete Stripe webhook ${webhookId}:`, err);
|
|
3941
3941
|
}
|
|
@@ -4065,13 +4065,15 @@ async function install(params) {
|
|
|
4065
4065
|
}
|
|
4066
4066
|
async function uninstall(params) {
|
|
4067
4067
|
const { supabaseAccessToken, supabaseProjectRef, stripeKey } = params;
|
|
4068
|
-
const trimmedStripeKey = stripeKey.trim();
|
|
4069
|
-
if (!trimmedStripeKey.startsWith("sk_") && !trimmedStripeKey.startsWith("rk_")) {
|
|
4068
|
+
const trimmedStripeKey = stripeKey && stripeKey.trim();
|
|
4069
|
+
if (trimmedStripeKey && !trimmedStripeKey.startsWith("sk_") && !trimmedStripeKey.startsWith("rk_")) {
|
|
4070
4070
|
throw new Error('Stripe key should start with "sk_" or "rk_"');
|
|
4071
4071
|
}
|
|
4072
4072
|
const client = new SupabaseSetupClient({
|
|
4073
4073
|
accessToken: supabaseAccessToken,
|
|
4074
|
-
projectRef: supabaseProjectRef
|
|
4074
|
+
projectRef: supabaseProjectRef,
|
|
4075
|
+
projectBaseUrl: params.baseProjectUrl,
|
|
4076
|
+
managementApiBaseUrl: params.baseManagementApiUrl
|
|
4075
4077
|
});
|
|
4076
4078
|
await client.uninstall(trimmedStripeKey);
|
|
4077
4079
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
migrateCommand,
|
|
6
6
|
syncCommand,
|
|
7
7
|
uninstallCommand
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-6KTLIYUL.js";
|
|
9
|
+
import "../chunk-2TIRMOJR.js";
|
|
10
|
+
import "../chunk-RAM7OG7J.js";
|
|
11
11
|
import {
|
|
12
12
|
package_default
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-IO2EEPFD.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/index.ts
|
|
16
16
|
import { Command } from "commander";
|
package/dist/cli/lib.cjs
CHANGED
|
@@ -105,7 +105,7 @@ async function loadConfig(options) {
|
|
|
105
105
|
// package.json
|
|
106
106
|
var package_default = {
|
|
107
107
|
name: "stripe-experiment-sync",
|
|
108
|
-
version: "1.0.
|
|
108
|
+
version: "1.0.12",
|
|
109
109
|
private: false,
|
|
110
110
|
description: "Stripe Sync Engine to sync Stripe data to Postgres",
|
|
111
111
|
type: "module",
|
|
@@ -3940,7 +3940,7 @@ var SupabaseSetupClient = class {
|
|
|
3940
3940
|
* Removes all Edge Functions, secrets, database resources, and Stripe webhooks
|
|
3941
3941
|
*/
|
|
3942
3942
|
async uninstall(stripeSecretKey) {
|
|
3943
|
-
const stripe = new import_stripe3.default(stripeSecretKey, { apiVersion: "2025-02-24.acacia" });
|
|
3943
|
+
const stripe = stripeSecretKey ? new import_stripe3.default(stripeSecretKey, { apiVersion: "2025-02-24.acacia" }) : null;
|
|
3944
3944
|
try {
|
|
3945
3945
|
try {
|
|
3946
3946
|
const webhookResult = await this.runSQL(`
|
|
@@ -3949,7 +3949,7 @@ var SupabaseSetupClient = class {
|
|
|
3949
3949
|
const webhookIds = webhookResult[0]?.rows?.map((r) => r.id) || [];
|
|
3950
3950
|
for (const webhookId of webhookIds) {
|
|
3951
3951
|
try {
|
|
3952
|
-
await stripe
|
|
3952
|
+
await stripe?.webhookEndpoints.del(webhookId);
|
|
3953
3953
|
} catch (err) {
|
|
3954
3954
|
console.warn(`Could not delete Stripe webhook ${webhookId}:`, err);
|
|
3955
3955
|
}
|
|
@@ -4079,13 +4079,15 @@ async function install(params) {
|
|
|
4079
4079
|
}
|
|
4080
4080
|
async function uninstall(params) {
|
|
4081
4081
|
const { supabaseAccessToken, supabaseProjectRef, stripeKey } = params;
|
|
4082
|
-
const trimmedStripeKey = stripeKey.trim();
|
|
4083
|
-
if (!trimmedStripeKey.startsWith("sk_") && !trimmedStripeKey.startsWith("rk_")) {
|
|
4082
|
+
const trimmedStripeKey = stripeKey && stripeKey.trim();
|
|
4083
|
+
if (trimmedStripeKey && !trimmedStripeKey.startsWith("sk_") && !trimmedStripeKey.startsWith("rk_")) {
|
|
4084
4084
|
throw new Error('Stripe key should start with "sk_" or "rk_"');
|
|
4085
4085
|
}
|
|
4086
4086
|
const client = new SupabaseSetupClient({
|
|
4087
4087
|
accessToken: supabaseAccessToken,
|
|
4088
|
-
projectRef: supabaseProjectRef
|
|
4088
|
+
projectRef: supabaseProjectRef,
|
|
4089
|
+
projectBaseUrl: params.baseProjectUrl,
|
|
4090
|
+
managementApiBaseUrl: params.baseManagementApiUrl
|
|
4089
4091
|
});
|
|
4090
4092
|
await client.uninstall(trimmedStripeKey);
|
|
4091
4093
|
}
|
package/dist/cli/lib.js
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
migrateCommand,
|
|
7
7
|
syncCommand,
|
|
8
8
|
uninstallCommand
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-6KTLIYUL.js";
|
|
10
|
+
import "../chunk-2TIRMOJR.js";
|
|
11
|
+
import "../chunk-RAM7OG7J.js";
|
|
12
|
+
import "../chunk-IO2EEPFD.js";
|
|
13
13
|
export {
|
|
14
14
|
backfillCommand,
|
|
15
15
|
createTunnel,
|
package/dist/index.cjs
CHANGED
|
@@ -46,7 +46,7 @@ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
|
46
46
|
// package.json
|
|
47
47
|
var package_default = {
|
|
48
48
|
name: "stripe-experiment-sync",
|
|
49
|
-
version: "1.0.
|
|
49
|
+
version: "1.0.12",
|
|
50
50
|
private: false,
|
|
51
51
|
description: "Stripe Sync Engine to sync Stripe data to Postgres",
|
|
52
52
|
type: "module",
|
package/dist/index.js
CHANGED
package/dist/supabase/index.cjs
CHANGED
|
@@ -64,7 +64,7 @@ var workerFunctionCode = stripe_worker_default;
|
|
|
64
64
|
// package.json
|
|
65
65
|
var package_default = {
|
|
66
66
|
name: "stripe-experiment-sync",
|
|
67
|
-
version: "1.0.
|
|
67
|
+
version: "1.0.12",
|
|
68
68
|
private: false,
|
|
69
69
|
description: "Stripe Sync Engine to sync Stripe data to Postgres",
|
|
70
70
|
type: "module",
|
|
@@ -425,7 +425,7 @@ var SupabaseSetupClient = class {
|
|
|
425
425
|
* Removes all Edge Functions, secrets, database resources, and Stripe webhooks
|
|
426
426
|
*/
|
|
427
427
|
async uninstall(stripeSecretKey) {
|
|
428
|
-
const stripe = new import_stripe.default(stripeSecretKey, { apiVersion: "2025-02-24.acacia" });
|
|
428
|
+
const stripe = stripeSecretKey ? new import_stripe.default(stripeSecretKey, { apiVersion: "2025-02-24.acacia" }) : null;
|
|
429
429
|
try {
|
|
430
430
|
try {
|
|
431
431
|
const webhookResult = await this.runSQL(`
|
|
@@ -434,7 +434,7 @@ var SupabaseSetupClient = class {
|
|
|
434
434
|
const webhookIds = webhookResult[0]?.rows?.map((r) => r.id) || [];
|
|
435
435
|
for (const webhookId of webhookIds) {
|
|
436
436
|
try {
|
|
437
|
-
await stripe
|
|
437
|
+
await stripe?.webhookEndpoints.del(webhookId);
|
|
438
438
|
} catch (err) {
|
|
439
439
|
console.warn(`Could not delete Stripe webhook ${webhookId}:`, err);
|
|
440
440
|
}
|
|
@@ -564,13 +564,15 @@ async function install(params) {
|
|
|
564
564
|
}
|
|
565
565
|
async function uninstall(params) {
|
|
566
566
|
const { supabaseAccessToken, supabaseProjectRef, stripeKey } = params;
|
|
567
|
-
const trimmedStripeKey = stripeKey.trim();
|
|
568
|
-
if (!trimmedStripeKey.startsWith("sk_") && !trimmedStripeKey.startsWith("rk_")) {
|
|
567
|
+
const trimmedStripeKey = stripeKey && stripeKey.trim();
|
|
568
|
+
if (trimmedStripeKey && !trimmedStripeKey.startsWith("sk_") && !trimmedStripeKey.startsWith("rk_")) {
|
|
569
569
|
throw new Error('Stripe key should start with "sk_" or "rk_"');
|
|
570
570
|
}
|
|
571
571
|
const client = new SupabaseSetupClient({
|
|
572
572
|
accessToken: supabaseAccessToken,
|
|
573
|
-
projectRef: supabaseProjectRef
|
|
573
|
+
projectRef: supabaseProjectRef,
|
|
574
|
+
projectBaseUrl: params.baseProjectUrl,
|
|
575
|
+
managementApiBaseUrl: params.baseManagementApiUrl
|
|
574
576
|
});
|
|
575
577
|
await client.uninstall(trimmedStripeKey);
|
|
576
578
|
}
|
|
@@ -93,7 +93,7 @@ declare class SupabaseSetupClient {
|
|
|
93
93
|
* Uninstall stripe-sync from a Supabase project
|
|
94
94
|
* Removes all Edge Functions, secrets, database resources, and Stripe webhooks
|
|
95
95
|
*/
|
|
96
|
-
uninstall(stripeSecretKey
|
|
96
|
+
uninstall(stripeSecretKey?: string): Promise<void>;
|
|
97
97
|
/**
|
|
98
98
|
* Inject package version into Edge Function code
|
|
99
99
|
*/
|
|
@@ -112,7 +112,9 @@ declare function install(params: {
|
|
|
112
112
|
declare function uninstall(params: {
|
|
113
113
|
supabaseAccessToken: string;
|
|
114
114
|
supabaseProjectRef: string;
|
|
115
|
-
stripeKey
|
|
115
|
+
stripeKey?: string;
|
|
116
|
+
baseProjectUrl?: string;
|
|
117
|
+
baseManagementApiUrl?: string;
|
|
116
118
|
}): Promise<void>;
|
|
117
119
|
|
|
118
120
|
declare const setupFunctionCode: string;
|
package/dist/supabase/index.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ declare class SupabaseSetupClient {
|
|
|
93
93
|
* Uninstall stripe-sync from a Supabase project
|
|
94
94
|
* Removes all Edge Functions, secrets, database resources, and Stripe webhooks
|
|
95
95
|
*/
|
|
96
|
-
uninstall(stripeSecretKey
|
|
96
|
+
uninstall(stripeSecretKey?: string): Promise<void>;
|
|
97
97
|
/**
|
|
98
98
|
* Inject package version into Edge Function code
|
|
99
99
|
*/
|
|
@@ -112,7 +112,9 @@ declare function install(params: {
|
|
|
112
112
|
declare function uninstall(params: {
|
|
113
113
|
supabaseAccessToken: string;
|
|
114
114
|
supabaseProjectRef: string;
|
|
115
|
-
stripeKey
|
|
115
|
+
stripeKey?: string;
|
|
116
|
+
baseProjectUrl?: string;
|
|
117
|
+
baseManagementApiUrl?: string;
|
|
116
118
|
}): Promise<void>;
|
|
117
119
|
|
|
118
120
|
declare const setupFunctionCode: string;
|
package/dist/supabase/index.js
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
uninstall,
|
|
10
10
|
webhookFunctionCode,
|
|
11
11
|
workerFunctionCode
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-RAM7OG7J.js";
|
|
13
|
+
import "../chunk-IO2EEPFD.js";
|
|
14
14
|
export {
|
|
15
15
|
INSTALLATION_ERROR_SUFFIX,
|
|
16
16
|
INSTALLATION_INSTALLED_SUFFIX,
|