@@ -116,8 +116,8 @@ describe('StripeSource', () => {
116116 describe ( 'discover()' , ( ) => {
117117 it ( 'returns a CatalogMessage with known streams' , async ( ) => {
118118 const registry : Record < string , ResourceConfig > = {
119- customer : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
120- invoice : makeConfig ( { order : 2 , tableName : 'invoices' } ) ,
119+ customers : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
120+ invoices : makeConfig ( { order : 2 , tableName : 'invoices' } ) ,
121121 }
122122
123123 vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
@@ -130,7 +130,7 @@ describe('StripeSource', () => {
130130
131131 it ( 'excludes resources with sync: false' , async ( ) => {
132132 const registry : Record < string , ResourceConfig > = {
133- customer : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
133+ customers : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
134134 internal : makeConfig ( { order : 2 , tableName : 'internal' , sync : false } ) ,
135135 }
136136
@@ -169,7 +169,7 @@ describe('StripeSource', () => {
169169 } )
170170
171171 const registry : Record < string , ResourceConfig > = {
172- customer : makeConfig ( {
172+ customers : makeConfig ( {
173173 order : 1 ,
174174 tableName : 'customers' ,
175175 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -236,12 +236,12 @@ describe('StripeSource', () => {
236236 } )
237237
238238 const registry : Record < string , ResourceConfig > = {
239- customer : makeConfig ( {
239+ customers : makeConfig ( {
240240 order : 1 ,
241241 tableName : 'customers' ,
242242 listFn : custListFn as ResourceConfig [ 'listFn' ] ,
243243 } ) ,
244- invoice : makeConfig ( {
244+ invoices : makeConfig ( {
245245 order : 2 ,
246246 tableName : 'invoices' ,
247247 listFn : invListFn as ResourceConfig [ 'listFn' ] ,
@@ -298,7 +298,7 @@ describe('StripeSource', () => {
298298 } )
299299
300300 const registry : Record < string , ResourceConfig > = {
301- customer : makeConfig ( {
301+ customers : makeConfig ( {
302302 order : 1 ,
303303 tableName : 'customers' ,
304304 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -334,7 +334,7 @@ describe('StripeSource', () => {
334334 } )
335335
336336 const registry : Record < string , ResourceConfig > = {
337- customer : makeConfig ( {
337+ customers : makeConfig ( {
338338 order : 1 ,
339339 tableName : 'customers' ,
340340 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -372,7 +372,7 @@ describe('StripeSource', () => {
372372 describe ( 'fromWebhookEvent() — live mode scenarios' , ( ) => {
373373 it ( 'webhook mode emits one RecordMessage + one StateMessage per event' , ( ) => {
374374 const registry : Record < string , ResourceConfig > = {
375- customer : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
375+ customers : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
376376 }
377377
378378 const event = makeEvent ( {
@@ -404,7 +404,7 @@ describe('StripeSource', () => {
404404
405405 it ( 'returns null for unsupported object type' , ( ) => {
406406 const registry : Record < string , ResourceConfig > = {
407- customer : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
407+ customers : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
408408 }
409409
410410 const event = makeEvent ( {
@@ -417,7 +417,7 @@ describe('StripeSource', () => {
417417
418418 it ( 'returns null for objects without id (preview/draft)' , ( ) => {
419419 const registry : Record < string , ResourceConfig > = {
420- invoice : makeConfig ( { order : 1 , tableName : 'invoices' } ) ,
420+ invoices : makeConfig ( { order : 1 , tableName : 'invoices' } ) ,
421421 }
422422
423423 const event = makeEvent ( {
@@ -431,7 +431,7 @@ describe('StripeSource', () => {
431431
432432 it ( 'passes through deleted flag from event data' , ( ) => {
433433 const registry : Record < string , ResourceConfig > = {
434- customer : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
434+ customers : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
435435 }
436436
437437 const event = makeEvent ( {
@@ -451,7 +451,7 @@ describe('StripeSource', () => {
451451
452452 it ( 'returns null when event data.object has no object field' , ( ) => {
453453 const registry : Record < string , ResourceConfig > = {
454- customer : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
454+ customers : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
455455 }
456456
457457 const event = makeEvent ( {
@@ -467,7 +467,7 @@ describe('StripeSource', () => {
467467 // The same Stripe.Event structure is received regardless of transport.
468468 // This test verifies fromWebhookEvent works for any Stripe.Event input.
469469 const registry : Record < string , ResourceConfig > = {
470- invoice : makeConfig ( { order : 1 , tableName : 'invoices' } ) ,
470+ invoices : makeConfig ( { order : 1 , tableName : 'invoices' } ) ,
471471 }
472472
473473 const event = makeEvent ( {
@@ -491,7 +491,7 @@ describe('StripeSource', () => {
491491 const listFn = vi . fn ( ) . mockRejectedValueOnce ( new Error ( 'Rate limit exceeded' ) )
492492
493493 const registry : Record < string , ResourceConfig > = {
494- customer : makeConfig ( {
494+ customers : makeConfig ( {
495495 order : 1 ,
496496 tableName : 'customers' ,
497497 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -541,7 +541,7 @@ describe('StripeSource', () => {
541541 const listFn = vi . fn ( ) . mockRejectedValueOnce ( new Error ( 'Connection refused' ) )
542542
543543 const registry : Record < string , ResourceConfig > = {
544- customer : makeConfig ( {
544+ customers : makeConfig ( {
545545 order : 1 ,
546546 tableName : 'customers' ,
547547 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -568,12 +568,12 @@ describe('StripeSource', () => {
568568 } )
569569
570570 const registry : Record < string , ResourceConfig > = {
571- customer : makeConfig ( {
571+ customers : makeConfig ( {
572572 order : 1 ,
573573 tableName : 'customers' ,
574574 listFn : failingListFn as ResourceConfig [ 'listFn' ] ,
575575 } ) ,
576- invoice : makeConfig ( {
576+ invoices : makeConfig ( {
577577 order : 2 ,
578578 tableName : 'invoices' ,
579579 listFn : successListFn as ResourceConfig [ 'listFn' ] ,
@@ -621,7 +621,7 @@ describe('StripeSource', () => {
621621 // Shared registry for these tests
622622 const listFn = vi . fn ( )
623623 const registry : Record < string , ResourceConfig > = {
624- customer : makeConfig ( {
624+ customers : makeConfig ( {
625625 order : 1 ,
626626 tableName : 'customers' ,
627627 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -810,7 +810,7 @@ describe('StripeSource', () => {
810810 describe ( 'read(input) — enriched webhook processing' , ( ) => {
811811 it ( 'delete event yields record with deleted: true' , async ( ) => {
812812 const registry : Record < string , ResourceConfig > = {
813- customer : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
813+ customers : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
814814 }
815815
816816 vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
@@ -840,7 +840,7 @@ describe('StripeSource', () => {
840840
841841 it ( 'delete event detected by event type (not just deleted flag)' , async ( ) => {
842842 const registry : Record < string , ResourceConfig > = {
843- product : makeConfig ( { order : 1 , tableName : 'products' } ) ,
843+ products : makeConfig ( { order : 1 , tableName : 'products' } ) ,
844844 }
845845
846846 vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
@@ -866,7 +866,7 @@ describe('StripeSource', () => {
866866
867867 it ( 'subscription event yields subscription_items from nested items.data' , async ( ) => {
868868 const registry : Record < string , ResourceConfig > = {
869- subscription : makeConfig ( { order : 1 , tableName : 'subscriptions' } ) ,
869+ subscriptions : makeConfig ( { order : 1 , tableName : 'subscriptions' } ) ,
870870 }
871871
872872 vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
@@ -992,7 +992,7 @@ describe('StripeSource', () => {
992992 } )
993993
994994 const registry : Record < string , ResourceConfig > = {
995- subscription : makeConfig ( {
995+ subscriptions : makeConfig ( {
996996 order : 1 ,
997997 tableName : 'subscriptions' ,
998998 retrieveFn : retrieveFn as ResourceConfig [ 'retrieveFn' ] ,
@@ -1027,7 +1027,7 @@ describe('StripeSource', () => {
10271027 const retrieveFn = vi . fn ( )
10281028
10291029 const registry : Record < string , ResourceConfig > = {
1030- subscription : makeConfig ( {
1030+ subscriptions : makeConfig ( {
10311031 order : 1 ,
10321032 tableName : 'subscriptions' ,
10331033 retrieveFn : retrieveFn as ResourceConfig [ 'retrieveFn' ] ,
@@ -1061,7 +1061,7 @@ describe('StripeSource', () => {
10611061
10621062 it ( 'preview objects (no id) produce no output' , async ( ) => {
10631063 const registry : Record < string , ResourceConfig > = {
1064- invoice : makeConfig ( { order : 1 , tableName : 'invoices' } ) ,
1064+ invoices : makeConfig ( { order : 1 , tableName : 'invoices' } ) ,
10651065 }
10661066
10671067 vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
@@ -1105,7 +1105,7 @@ describe('StripeSource', () => {
11051105
11061106 it ( 'throws when raw webhook input is provided without webhook_secret' , async ( ) => {
11071107 const registry : Record < string , ResourceConfig > = {
1108- customer : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
1108+ customers : makeConfig ( { order : 1 , tableName : 'customers' } ) ,
11091109 }
11101110
11111111 vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
@@ -1124,12 +1124,12 @@ describe('StripeSource', () => {
11241124
11251125 describe ( 'read() — WebSocket streaming' , ( ) => {
11261126 const registry : Record < string , ResourceConfig > = {
1127- customer : makeConfig ( {
1127+ customers : makeConfig ( {
11281128 order : 1 ,
11291129 tableName : 'customers' ,
11301130 listFn : ( ( ) => Promise . resolve ( { data : [ ] , has_more : false } ) ) as ResourceConfig [ 'listFn' ] ,
11311131 } ) ,
1132- invoice : makeConfig ( {
1132+ invoices : makeConfig ( {
11331133 order : 2 ,
11341134 tableName : 'invoices' ,
11351135 listFn : ( ( ) => Promise . resolve ( { data : [ ] , has_more : false } ) ) as ResourceConfig [ 'listFn' ] ,
@@ -1256,7 +1256,7 @@ describe('StripeSource', () => {
12561256 } )
12571257
12581258 const wsRegistry : Record < string , ResourceConfig > = {
1259- customer : makeConfig ( {
1259+ customers : makeConfig ( {
12601260 order : 1 ,
12611261 tableName : 'customers' ,
12621262 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -1418,7 +1418,7 @@ describe('StripeSource', () => {
14181418 it ( 'starts an HTTP server on webhook_port and processes POSTed webhooks' , async ( ) => {
14191419 const listFn = vi . fn ( ) . mockResolvedValue ( { data : [ ] , has_more : false } )
14201420 const registry : Record < string , ResourceConfig > = {
1421- customer : makeConfig ( { order : 1 , tableName : 'customers' , listFn } ) ,
1421+ customers : makeConfig ( { order : 1 , tableName : 'customers' , listFn } ) ,
14221422 }
14231423 vi . mocked ( buildResourceRegistry ) . mockReturnValue ( registry as any )
14241424 const cat = catalog ( { name : 'customers' } )
@@ -1452,7 +1452,7 @@ describe('StripeSource', () => {
14521452 it ( 'skips backfill when all streams are already complete' , async ( ) => {
14531453 const listFn = vi . fn ( )
14541454 const registry : Record < string , ResourceConfig > = {
1455- customer : makeConfig ( {
1455+ customers : makeConfig ( {
14561456 order : 1 ,
14571457 tableName : 'customers' ,
14581458 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -1481,7 +1481,7 @@ describe('StripeSource', () => {
14811481 it ( 'stamps initial events_cursor after first backfill completes' , async ( ) => {
14821482 const listFn = vi . fn ( )
14831483 const registry : Record < string , ResourceConfig > = {
1484- customer : makeConfig ( {
1484+ customers : makeConfig ( {
14851485 order : 1 ,
14861486 tableName : 'customers' ,
14871487 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -1511,7 +1511,7 @@ describe('StripeSource', () => {
15111511 it ( 'does not run events polling when poll_events is false/absent' , async ( ) => {
15121512 const listFn = vi . fn ( )
15131513 const registry : Record < string , ResourceConfig > = {
1514- customer : makeConfig ( {
1514+ customers : makeConfig ( {
15151515 order : 1 ,
15161516 tableName : 'customers' ,
15171517 listFn : listFn as ResourceConfig [ 'listFn' ] ,
@@ -1542,12 +1542,12 @@ describe('StripeSource', () => {
15421542 } )
15431543
15441544 const registry : Record < string , ResourceConfig > = {
1545- customer : makeConfig ( {
1545+ customers : makeConfig ( {
15461546 order : 1 ,
15471547 tableName : 'customers' ,
15481548 listFn : custListFn as ResourceConfig [ 'listFn' ] ,
15491549 } ) ,
1550- invoice : makeConfig ( {
1550+ invoices : makeConfig ( {
15511551 order : 2 ,
15521552 tableName : 'invoices' ,
15531553 listFn : ( ( ) =>
0 commit comments