stripe-experiment-sync 1.0.18 → 1.0.20
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 +3 -0
- package/dist/{chunk-HV64EIZU.js → chunk-DFIHCPGH.js} +95 -28
- package/dist/chunk-HHDPFCIA.js +48329 -0
- package/dist/{chunk-XO57OJUE.js → chunk-NM6L6EPQ.js} +4 -2
- package/dist/{chunk-M5TTM27L.js → chunk-UPJNFZXA.js} +88 -17
- package/dist/cli/index.cjs +44782 -365
- package/dist/cli/index.js +16 -10
- package/dist/cli/lib.cjs +44770 -359
- package/dist/cli/lib.d.cts +1 -0
- package/dist/cli/lib.d.ts +1 -0
- package/dist/cli/lib.js +4 -4
- package/dist/index.cjs +44622 -347
- package/dist/index.d.cts +92 -8
- package/dist/index.d.ts +92 -8
- package/dist/index.js +2 -2
- package/dist/migrations/0061_add_page_cursor.sql +3 -0
- package/dist/migrations/0062_sigma_query_runs.sql +8 -0
- package/dist/supabase/index.cjs +92 -18
- package/dist/supabase/index.d.cts +13 -6
- package/dist/supabase/index.d.ts +13 -6
- package/dist/supabase/index.js +4 -2
- package/package.json +4 -2
- package/dist/chunk-K4JQHI7Y.js +0 -4055
package/dist/cli/index.js
CHANGED
|
@@ -5,20 +5,21 @@ import {
|
|
|
5
5
|
migrateCommand,
|
|
6
6
|
syncCommand,
|
|
7
7
|
uninstallCommand
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-DFIHCPGH.js";
|
|
9
|
+
import "../chunk-HHDPFCIA.js";
|
|
10
|
+
import "../chunk-UPJNFZXA.js";
|
|
11
11
|
import {
|
|
12
12
|
package_default
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-NM6L6EPQ.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/index.ts
|
|
16
16
|
import { Command } from "commander";
|
|
17
17
|
var program = new Command();
|
|
18
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) => {
|
|
19
|
+
program.command("migrate").description("Run database migrations only").option("--database-url <url>", "Postgres DATABASE_URL (or DATABASE_URL env)").option("--sigma", "Create Sigma tables during migration").action(async (options) => {
|
|
20
20
|
await migrateCommand({
|
|
21
|
-
databaseUrl: options.databaseUrl
|
|
21
|
+
databaseUrl: options.databaseUrl,
|
|
22
|
+
enableSigma: options.sigma
|
|
22
23
|
});
|
|
23
24
|
});
|
|
24
25
|
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)").option("--sigma", "Sync Sigma data (requires Sigma access in Stripe API key)").action(async (options) => {
|
|
@@ -29,11 +30,15 @@ program.command("start").description("Start Stripe sync").option("--stripe-key <
|
|
|
29
30
|
enableSigma: options.sigma
|
|
30
31
|
});
|
|
31
32
|
});
|
|
32
|
-
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)").
|
|
33
|
+
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)").option(
|
|
34
|
+
"--sigma",
|
|
35
|
+
"Enable Sigma tables (required for sigma table names like exchange_rates_from_usd)"
|
|
36
|
+
).action(async (entityName, options) => {
|
|
33
37
|
await backfillCommand(
|
|
34
38
|
{
|
|
35
39
|
stripeKey: options.stripeKey,
|
|
36
|
-
databaseUrl: options.databaseUrl
|
|
40
|
+
databaseUrl: options.databaseUrl,
|
|
41
|
+
enableSigma: options.sigma
|
|
37
42
|
},
|
|
38
43
|
entityName
|
|
39
44
|
);
|
|
@@ -49,14 +54,15 @@ supabase.command("install").description("Install Stripe sync to Supabase Edge Fu
|
|
|
49
54
|
).option(
|
|
50
55
|
"--management-url <url>",
|
|
51
56
|
"Supabase management API URL with protocol (e.g., http://localhost:54323, defaults to https://api.supabase.com or SUPABASE_MANAGEMENT_URL env)"
|
|
52
|
-
).action(async (options) => {
|
|
57
|
+
).option("--sigma", "Enable Sigma sync (deploy sigma worker and cron job)").action(async (options) => {
|
|
53
58
|
await installCommand({
|
|
54
59
|
supabaseAccessToken: options.token,
|
|
55
60
|
supabaseProjectRef: options.project,
|
|
56
61
|
stripeKey: options.stripeKey,
|
|
57
62
|
packageVersion: options.packageVersion,
|
|
58
63
|
workerInterval: options.workerInterval,
|
|
59
|
-
supabaseManagementUrl: options.managementUrl
|
|
64
|
+
supabaseManagementUrl: options.managementUrl,
|
|
65
|
+
enableSigma: options.sigma
|
|
60
66
|
});
|
|
61
67
|
});
|
|
62
68
|
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(
|