stripe-experiment-sync 1.0.18 → 1.0.19
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-M5TTM27L.js → chunk-4P6TAP7L.js} +1 -1
- package/dist/{chunk-XO57OJUE.js → chunk-CMGFQCD7.js} +1 -1
- package/dist/{chunk-HV64EIZU.js → chunk-HZ2OIPQ5.js} +2 -2
- package/dist/{chunk-K4JQHI7Y.js → chunk-XKBCLBFT.js} +129 -54
- package/dist/cli/index.cjs +129 -54
- package/dist/cli/index.js +4 -4
- package/dist/cli/lib.cjs +129 -54
- package/dist/cli/lib.js +4 -4
- package/dist/index.cjs +129 -54
- package/dist/index.d.cts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +2 -2
- package/dist/migrations/0061_add_page_cursor.sql +3 -0
- package/dist/supabase/index.cjs +1 -1
- package/dist/supabase/index.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -157,12 +157,21 @@ declare class PostgresClient {
|
|
|
157
157
|
status: string;
|
|
158
158
|
processedCount: number;
|
|
159
159
|
cursor: string | null;
|
|
160
|
+
pageCursor: string | null;
|
|
160
161
|
} | null>;
|
|
161
162
|
/**
|
|
162
163
|
* Update progress for an object sync.
|
|
163
164
|
* Also touches updated_at for stale detection.
|
|
164
165
|
*/
|
|
165
166
|
incrementObjectProgress(accountId: string, runStartedAt: Date, object: string, count: number): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Update the pagination page_cursor used for backfills using Stripe list calls.
|
|
169
|
+
*/
|
|
170
|
+
updateObjectPageCursor(accountId: string, runStartedAt: Date, object: string, pageCursor: string | null): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Clear the pagination page_cursor for an object sync.
|
|
173
|
+
*/
|
|
174
|
+
clearObjectPageCursor(accountId: string, runStartedAt: Date, object: string): Promise<void>;
|
|
166
175
|
/**
|
|
167
176
|
* Update the cursor for an object sync.
|
|
168
177
|
* Only updates if the new cursor is higher than the existing one (cursors should never decrease).
|
|
@@ -172,15 +181,20 @@ declare class PostgresClient {
|
|
|
172
181
|
updateObjectCursor(accountId: string, runStartedAt: Date, object: string, cursor: string | null): Promise<void>;
|
|
173
182
|
/**
|
|
174
183
|
* Get the highest cursor from previous syncs for an object type.
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
184
|
+
* Uses only completed object runs.
|
|
185
|
+
* - During the initial backfill we page through history, but we also update the cursor as we go.
|
|
186
|
+
* If we crash mid-backfill and reuse that cursor, we can accidentally switch into incremental mode
|
|
187
|
+
* too early and only ever fetch the newest page (breaking the historical backfill).
|
|
178
188
|
*
|
|
179
189
|
* Handles two cursor formats:
|
|
180
190
|
* - Numeric: compared as bigint for correct ordering
|
|
181
191
|
* - Composite cursors: compared as strings with COLLATE "C"
|
|
182
192
|
*/
|
|
183
193
|
getLastCompletedCursor(accountId: string, object: string): Promise<string | null>;
|
|
194
|
+
/**
|
|
195
|
+
* Get the highest cursor from previous syncs for an object type, excluding the current run.
|
|
196
|
+
*/
|
|
197
|
+
getLastCursorBeforeRun(accountId: string, object: string, runStartedAt: Date): Promise<string | null>;
|
|
184
198
|
/**
|
|
185
199
|
* Delete all sync runs and object runs for an account.
|
|
186
200
|
* Useful for testing or resetting sync state.
|
|
@@ -587,6 +601,7 @@ declare class StripeSync {
|
|
|
587
601
|
* ```
|
|
588
602
|
*/
|
|
589
603
|
processNext(object: Exclude<SyncObject, 'all' | 'customer_with_entitlements'>, params?: ProcessNextParams): Promise<ProcessNextResult>;
|
|
604
|
+
private appendMigrationHint;
|
|
590
605
|
/**
|
|
591
606
|
* Get the database resource name for a SyncObject type
|
|
592
607
|
*/
|
package/dist/index.js
CHANGED
package/dist/supabase/index.cjs
CHANGED
|
@@ -54,7 +54,7 @@ var workerFunctionCode = stripe_worker_default;
|
|
|
54
54
|
// package.json
|
|
55
55
|
var package_default = {
|
|
56
56
|
name: "stripe-experiment-sync",
|
|
57
|
-
version: "1.0.
|
|
57
|
+
version: "1.0.19",
|
|
58
58
|
private: false,
|
|
59
59
|
description: "Stripe Sync Engine to sync Stripe data to Postgres",
|
|
60
60
|
type: "module",
|
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-4P6TAP7L.js";
|
|
13
|
+
import "../chunk-CMGFQCD7.js";
|
|
14
14
|
export {
|
|
15
15
|
INSTALLATION_ERROR_SUFFIX,
|
|
16
16
|
INSTALLATION_INSTALLED_SUFFIX,
|