stripe-experiment-sync 1.0.6 → 1.0.8
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 +25 -4
- package/dist/{chunk-3UERGK2O.js → chunk-CKWVW2JK.js} +18 -6
- package/dist/chunk-J7BH3XD6.js +3436 -0
- package/dist/chunk-X2OQQCC2.js +409 -0
- package/dist/chunk-YH6KRZDQ.js +634 -0
- package/dist/cli/index.cjs +4592 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +59 -0
- package/dist/cli/lib.cjs +4571 -0
- package/dist/cli/lib.d.cts +69 -0
- package/dist/cli/lib.d.ts +69 -0
- package/dist/cli/lib.js +21 -0
- package/dist/index.cjs +243 -58
- package/dist/index.d.cts +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.js +9 -3255
- package/dist/migrations/0057_rename_sync_tables.sql +57 -0
- package/dist/migrations/0058_improve_sync_runs_status.sql +36 -0
- package/dist/supabase/index.cjs +46 -21
- package/dist/supabase/index.d.cts +6 -1
- package/dist/supabase/index.d.ts +6 -1
- package/dist/supabase/index.js +12 -382
- package/package.json +18 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
backfillCommand,
|
|
4
|
+
installCommand,
|
|
5
|
+
migrateCommand,
|
|
6
|
+
syncCommand,
|
|
7
|
+
uninstallCommand
|
|
8
|
+
} from "../chunk-YH6KRZDQ.js";
|
|
9
|
+
import "../chunk-J7BH3XD6.js";
|
|
10
|
+
import "../chunk-X2OQQCC2.js";
|
|
11
|
+
import {
|
|
12
|
+
package_default
|
|
13
|
+
} from "../chunk-CKWVW2JK.js";
|
|
14
|
+
|
|
15
|
+
// src/cli/index.ts
|
|
16
|
+
import { Command } from "commander";
|
|
17
|
+
var program = new Command();
|
|
18
|
+
program.name("stripe-experiment-sync").description("CLI tool for syncing Stripe data to PostgreSQL").version(package_default.version);
|
|
19
|
+
program.command("migrate").description("Run database migrations only").option("--database-url <url>", "Postgres DATABASE_URL (or DATABASE_URL env)").action(async (options) => {
|
|
20
|
+
await migrateCommand({
|
|
21
|
+
databaseUrl: options.databaseUrl
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
program.command("start").description("Start Stripe sync").option("--stripe-key <key>", "Stripe API key (or STRIPE_API_KEY env)").option("--ngrok-token <token>", "ngrok auth token (or NGROK_AUTH_TOKEN env)").option("--database-url <url>", "Postgres DATABASE_URL (or DATABASE_URL env)").action(async (options) => {
|
|
25
|
+
await syncCommand({
|
|
26
|
+
stripeKey: options.stripeKey,
|
|
27
|
+
ngrokToken: options.ngrokToken,
|
|
28
|
+
databaseUrl: options.databaseUrl
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
program.command("backfill <entityName>").description("Backfill a specific entity type from Stripe (e.g., customer, invoice, product)").option("--stripe-key <key>", "Stripe API key (or STRIPE_API_KEY env)").option("--database-url <url>", "Postgres DATABASE_URL (or DATABASE_URL env)").action(async (entityName, options) => {
|
|
32
|
+
await backfillCommand(
|
|
33
|
+
{
|
|
34
|
+
stripeKey: options.stripeKey,
|
|
35
|
+
databaseUrl: options.databaseUrl
|
|
36
|
+
},
|
|
37
|
+
entityName
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
var supabase = program.command("supabase").description("Supabase Edge Functions commands");
|
|
41
|
+
supabase.command("install").description("Install Stripe sync to Supabase Edge Functions").option("--token <token>", "Supabase access token (or SUPABASE_ACCESS_TOKEN env)").option("--project <ref>", "Supabase project ref (or SUPABASE_PROJECT_REF env)").option("--stripe-key <key>", "Stripe API key (or STRIPE_API_KEY env)").option(
|
|
42
|
+
"--version <version>",
|
|
43
|
+
"Package version to install (e.g., 1.0.8-beta.1, defaults to latest)"
|
|
44
|
+
).action(async (options) => {
|
|
45
|
+
await installCommand({
|
|
46
|
+
supabaseAccessToken: options.token,
|
|
47
|
+
supabaseProjectRef: options.project,
|
|
48
|
+
stripeKey: options.stripeKey,
|
|
49
|
+
packageVersion: options.version
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
supabase.command("uninstall").description("Uninstall Stripe sync from Supabase Edge Functions").option("--token <token>", "Supabase access token (or SUPABASE_ACCESS_TOKEN env)").option("--project <ref>", "Supabase project ref (or SUPABASE_PROJECT_REF env)").option("--stripe-key <key>", "Stripe API key (or STRIPE_API_KEY env)").action(async (options) => {
|
|
53
|
+
await uninstallCommand({
|
|
54
|
+
supabaseAccessToken: options.token,
|
|
55
|
+
supabaseProjectRef: options.project,
|
|
56
|
+
stripeKey: options.stripeKey
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
program.parse();
|