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.
@@ -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();