@use-stall/core 0.0.4 → 0.0.6

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/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { ConnectorModuleKey, UnifiedProductType, UnifiedVariantsType, UnifiedCollectionType, UnifiedCategoryType, UnifiedInventoryLevelType, UnifiedPromotion, UnifiedOrderType, UnifiedOrderNote, UnifiedOrderRefundType, UnifiedPaymentProviderType, UnifiedPaymentCollectionType, UnifiedTaxRegionType, UnifiedTaxRateType, UnifiedCustomerType, UnifiedLocationType, UnifiedFulfillmentType } from '@use-stall/types';
1
+ import { ConnectorModuleKey, UnifiedProductType, UnifiedVariantsType, UnifiedCollectionType, UnifiedCategoryType, UnifiedTagProductTag, UnifiedInventoryLevelType, UnifiedPromotion, UnifiedOrderType, UnifiedOrderNote, UnifiedOrderRefundType, UnifiedPaymentProviderType, UnifiedPaymentCollectionType, UnifiedTaxRegionType, UnifiedTaxRateType, UnifiedCustomerType, UnifiedLocationType, UnifiedFulfillmentMethodType, UnifiedFulfillmentProviderConfigType, UnifiedFulfillmentType } from '@use-stall/types';
2
+ import Dexie, { EntityTable } from 'dexie';
2
3
 
3
4
  interface StallCoreConfigOptions {
4
5
  connector_url: string;
@@ -17,7 +18,7 @@ type ModuleTypeMap = {
17
18
  variants: UnifiedVariantsType;
18
19
  collections: UnifiedCollectionType;
19
20
  categories: UnifiedCategoryType;
20
- tags: string;
21
+ tags: UnifiedTagProductTag;
21
22
  inventory_levels: UnifiedInventoryLevelType;
22
23
  inventory_history: UnifiedInventoryLevelType;
23
24
  promotions: UnifiedPromotion;
@@ -30,8 +31,8 @@ type ModuleTypeMap = {
30
31
  tax_rates: UnifiedTaxRateType;
31
32
  customers: UnifiedCustomerType;
32
33
  locations: UnifiedLocationType;
33
- fulfillment_types: string;
34
- fulfillment_providers: string;
34
+ fulfillment_types: UnifiedFulfillmentMethodType;
35
+ fulfillment_providers: UnifiedFulfillmentProviderConfigType;
35
36
  fulfillments: UnifiedFulfillmentType;
36
37
  };
37
38
 
@@ -77,4 +78,824 @@ type AdapterModuleType = {
77
78
  };
78
79
  };
79
80
 
80
- export type { AdapterModuleType, CoreConfig, StallCoreConfigOptions };
81
+ declare const initializeStallCore: (options: StallCoreConfigOptions) => CoreConfig;
82
+
83
+ declare const products: {
84
+ list: (props: {
85
+ sdk: CoreConfig;
86
+ query?: string;
87
+ }) => Promise<UnifiedProductType[]>;
88
+ retrieve: (props: {
89
+ sdk: CoreConfig;
90
+ id: string;
91
+ }) => Promise<UnifiedProductType>;
92
+ create: (props: {
93
+ sdk: CoreConfig;
94
+ data: UnifiedProductType;
95
+ }) => Promise<UnifiedProductType>;
96
+ update: (props: {
97
+ sdk: CoreConfig;
98
+ id: string;
99
+ data: Partial<UnifiedProductType>;
100
+ }) => Promise<UnifiedProductType>;
101
+ delete: (props: {
102
+ sdk: CoreConfig;
103
+ id: string;
104
+ }) => Promise<void>;
105
+ bulk_create: (props: {
106
+ sdk: CoreConfig;
107
+ data: UnifiedProductType[];
108
+ }) => Promise<UnifiedProductType[]>;
109
+ bulk_update: (props: {
110
+ sdk: CoreConfig;
111
+ data: Array<{
112
+ id: string;
113
+ data: Partial<UnifiedProductType>;
114
+ }>;
115
+ }) => Promise<UnifiedProductType[]>;
116
+ bulk_delete: (props: {
117
+ sdk: CoreConfig;
118
+ ids: string[];
119
+ }) => Promise<void>;
120
+ };
121
+
122
+ declare const orders: {
123
+ list: (props: {
124
+ sdk: CoreConfig;
125
+ query?: string;
126
+ }) => Promise<UnifiedOrderType[]>;
127
+ retrieve: (props: {
128
+ sdk: CoreConfig;
129
+ id: string;
130
+ }) => Promise<UnifiedOrderType>;
131
+ create: (props: {
132
+ sdk: CoreConfig;
133
+ data: UnifiedOrderType;
134
+ }) => Promise<UnifiedOrderType>;
135
+ update: (props: {
136
+ sdk: CoreConfig;
137
+ id: string;
138
+ data: Partial<UnifiedOrderType>;
139
+ }) => Promise<UnifiedOrderType>;
140
+ delete: (props: {
141
+ sdk: CoreConfig;
142
+ id: string;
143
+ }) => Promise<void>;
144
+ bulk_create: (props: {
145
+ sdk: CoreConfig;
146
+ data: UnifiedOrderType[];
147
+ }) => Promise<UnifiedOrderType[]>;
148
+ bulk_update: (props: {
149
+ sdk: CoreConfig;
150
+ data: Array<{
151
+ id: string;
152
+ data: Partial<UnifiedOrderType>;
153
+ }>;
154
+ }) => Promise<UnifiedOrderType[]>;
155
+ bulk_delete: (props: {
156
+ sdk: CoreConfig;
157
+ ids: string[];
158
+ }) => Promise<void>;
159
+ };
160
+
161
+ declare const customers: {
162
+ list: (props: {
163
+ sdk: CoreConfig;
164
+ query?: string;
165
+ }) => Promise<UnifiedCustomerType[]>;
166
+ retrieve: (props: {
167
+ sdk: CoreConfig;
168
+ id: string;
169
+ }) => Promise<UnifiedCustomerType>;
170
+ create: (props: {
171
+ sdk: CoreConfig;
172
+ data: UnifiedCustomerType;
173
+ }) => Promise<UnifiedCustomerType>;
174
+ update: (props: {
175
+ sdk: CoreConfig;
176
+ id: string;
177
+ data: Partial<UnifiedCustomerType>;
178
+ }) => Promise<UnifiedCustomerType>;
179
+ delete: (props: {
180
+ sdk: CoreConfig;
181
+ id: string;
182
+ }) => Promise<void>;
183
+ bulk_create: (props: {
184
+ sdk: CoreConfig;
185
+ data: UnifiedCustomerType[];
186
+ }) => Promise<UnifiedCustomerType[]>;
187
+ bulk_update: (props: {
188
+ sdk: CoreConfig;
189
+ data: Array<{
190
+ id: string;
191
+ data: Partial<UnifiedCustomerType>;
192
+ }>;
193
+ }) => Promise<UnifiedCustomerType[]>;
194
+ bulk_delete: (props: {
195
+ sdk: CoreConfig;
196
+ ids: string[];
197
+ }) => Promise<void>;
198
+ };
199
+
200
+ declare const collections: {
201
+ list: (props: {
202
+ sdk: CoreConfig;
203
+ query?: string;
204
+ }) => Promise<UnifiedCollectionType[]>;
205
+ retrieve: (props: {
206
+ sdk: CoreConfig;
207
+ id: string;
208
+ }) => Promise<UnifiedCollectionType>;
209
+ create: (props: {
210
+ sdk: CoreConfig;
211
+ data: UnifiedCollectionType;
212
+ }) => Promise<UnifiedCollectionType>;
213
+ update: (props: {
214
+ sdk: CoreConfig;
215
+ id: string;
216
+ data: Partial<UnifiedCollectionType>;
217
+ }) => Promise<UnifiedCollectionType>;
218
+ delete: (props: {
219
+ sdk: CoreConfig;
220
+ id: string;
221
+ }) => Promise<void>;
222
+ bulk_create: (props: {
223
+ sdk: CoreConfig;
224
+ data: UnifiedCollectionType[];
225
+ }) => Promise<UnifiedCollectionType[]>;
226
+ bulk_update: (props: {
227
+ sdk: CoreConfig;
228
+ data: Array<{
229
+ id: string;
230
+ data: Partial<UnifiedCollectionType>;
231
+ }>;
232
+ }) => Promise<UnifiedCollectionType[]>;
233
+ bulk_delete: (props: {
234
+ sdk: CoreConfig;
235
+ ids: string[];
236
+ }) => Promise<void>;
237
+ };
238
+
239
+ declare const categories: {
240
+ list: (props: {
241
+ sdk: CoreConfig;
242
+ query?: string;
243
+ }) => Promise<UnifiedCategoryType[]>;
244
+ retrieve: (props: {
245
+ sdk: CoreConfig;
246
+ id: string;
247
+ }) => Promise<UnifiedCategoryType>;
248
+ create: (props: {
249
+ sdk: CoreConfig;
250
+ data: UnifiedCategoryType;
251
+ }) => Promise<UnifiedCategoryType>;
252
+ update: (props: {
253
+ sdk: CoreConfig;
254
+ id: string;
255
+ data: Partial<UnifiedCategoryType>;
256
+ }) => Promise<UnifiedCategoryType>;
257
+ delete: (props: {
258
+ sdk: CoreConfig;
259
+ id: string;
260
+ }) => Promise<void>;
261
+ bulk_create: (props: {
262
+ sdk: CoreConfig;
263
+ data: UnifiedCategoryType[];
264
+ }) => Promise<UnifiedCategoryType[]>;
265
+ bulk_update: (props: {
266
+ sdk: CoreConfig;
267
+ data: Array<{
268
+ id: string;
269
+ data: Partial<UnifiedCategoryType>;
270
+ }>;
271
+ }) => Promise<UnifiedCategoryType[]>;
272
+ bulk_delete: (props: {
273
+ sdk: CoreConfig;
274
+ ids: string[];
275
+ }) => Promise<void>;
276
+ };
277
+
278
+ declare const variants: {
279
+ list: (props: {
280
+ sdk: CoreConfig;
281
+ query?: string;
282
+ }) => Promise<UnifiedVariantsType[]>;
283
+ retrieve: (props: {
284
+ sdk: CoreConfig;
285
+ id: string;
286
+ }) => Promise<UnifiedVariantsType>;
287
+ create: (props: {
288
+ sdk: CoreConfig;
289
+ data: UnifiedVariantsType;
290
+ }) => Promise<UnifiedVariantsType>;
291
+ update: (props: {
292
+ sdk: CoreConfig;
293
+ id: string;
294
+ data: Partial<UnifiedVariantsType>;
295
+ }) => Promise<UnifiedVariantsType>;
296
+ delete: (props: {
297
+ sdk: CoreConfig;
298
+ id: string;
299
+ }) => Promise<void>;
300
+ bulk_create: (props: {
301
+ sdk: CoreConfig;
302
+ data: UnifiedVariantsType[];
303
+ }) => Promise<UnifiedVariantsType[]>;
304
+ bulk_update: (props: {
305
+ sdk: CoreConfig;
306
+ data: Array<{
307
+ id: string;
308
+ data: Partial<UnifiedVariantsType>;
309
+ }>;
310
+ }) => Promise<UnifiedVariantsType[]>;
311
+ bulk_delete: (props: {
312
+ sdk: CoreConfig;
313
+ ids: string[];
314
+ }) => Promise<void>;
315
+ };
316
+
317
+ declare const inventory_levels: {
318
+ list: (props: {
319
+ sdk: CoreConfig;
320
+ query?: string;
321
+ }) => Promise<UnifiedInventoryLevelType[]>;
322
+ retrieve: (props: {
323
+ sdk: CoreConfig;
324
+ id: string;
325
+ }) => Promise<UnifiedInventoryLevelType>;
326
+ create: (props: {
327
+ sdk: CoreConfig;
328
+ data: UnifiedInventoryLevelType;
329
+ }) => Promise<UnifiedInventoryLevelType>;
330
+ update: (props: {
331
+ sdk: CoreConfig;
332
+ id: string;
333
+ data: Partial<UnifiedInventoryLevelType>;
334
+ }) => Promise<UnifiedInventoryLevelType>;
335
+ delete: (props: {
336
+ sdk: CoreConfig;
337
+ id: string;
338
+ }) => Promise<void>;
339
+ bulk_create: (props: {
340
+ sdk: CoreConfig;
341
+ data: UnifiedInventoryLevelType[];
342
+ }) => Promise<UnifiedInventoryLevelType[]>;
343
+ bulk_update: (props: {
344
+ sdk: CoreConfig;
345
+ data: Array<{
346
+ id: string;
347
+ data: Partial<UnifiedInventoryLevelType>;
348
+ }>;
349
+ }) => Promise<UnifiedInventoryLevelType[]>;
350
+ bulk_delete: (props: {
351
+ sdk: CoreConfig;
352
+ ids: string[];
353
+ }) => Promise<void>;
354
+ };
355
+
356
+ declare const promotions: {
357
+ list: (props: {
358
+ sdk: CoreConfig;
359
+ query?: string;
360
+ }) => Promise<UnifiedPromotion[]>;
361
+ retrieve: (props: {
362
+ sdk: CoreConfig;
363
+ id: string;
364
+ }) => Promise<UnifiedPromotion>;
365
+ create: (props: {
366
+ sdk: CoreConfig;
367
+ data: UnifiedPromotion;
368
+ }) => Promise<UnifiedPromotion>;
369
+ update: (props: {
370
+ sdk: CoreConfig;
371
+ id: string;
372
+ data: Partial<UnifiedPromotion>;
373
+ }) => Promise<UnifiedPromotion>;
374
+ delete: (props: {
375
+ sdk: CoreConfig;
376
+ id: string;
377
+ }) => Promise<void>;
378
+ bulk_create: (props: {
379
+ sdk: CoreConfig;
380
+ data: UnifiedPromotion[];
381
+ }) => Promise<UnifiedPromotion[]>;
382
+ bulk_update: (props: {
383
+ sdk: CoreConfig;
384
+ data: Array<{
385
+ id: string;
386
+ data: Partial<UnifiedPromotion>;
387
+ }>;
388
+ }) => Promise<UnifiedPromotion[]>;
389
+ bulk_delete: (props: {
390
+ sdk: CoreConfig;
391
+ ids: string[];
392
+ }) => Promise<void>;
393
+ };
394
+
395
+ declare const order_notes: {
396
+ list: (props: {
397
+ sdk: CoreConfig;
398
+ query?: string;
399
+ }) => Promise<UnifiedOrderNote[]>;
400
+ retrieve: (props: {
401
+ sdk: CoreConfig;
402
+ id: string;
403
+ }) => Promise<UnifiedOrderNote>;
404
+ create: (props: {
405
+ sdk: CoreConfig;
406
+ data: UnifiedOrderNote;
407
+ }) => Promise<UnifiedOrderNote>;
408
+ update: (props: {
409
+ sdk: CoreConfig;
410
+ id: string;
411
+ data: Partial<UnifiedOrderNote>;
412
+ }) => Promise<UnifiedOrderNote>;
413
+ delete: (props: {
414
+ sdk: CoreConfig;
415
+ id: string;
416
+ }) => Promise<void>;
417
+ bulk_create: (props: {
418
+ sdk: CoreConfig;
419
+ data: UnifiedOrderNote[];
420
+ }) => Promise<UnifiedOrderNote[]>;
421
+ bulk_update: (props: {
422
+ sdk: CoreConfig;
423
+ data: Array<{
424
+ id: string;
425
+ data: Partial<UnifiedOrderNote>;
426
+ }>;
427
+ }) => Promise<UnifiedOrderNote[]>;
428
+ bulk_delete: (props: {
429
+ sdk: CoreConfig;
430
+ ids: string[];
431
+ }) => Promise<void>;
432
+ };
433
+
434
+ declare const refunds: {
435
+ list: (props: {
436
+ sdk: CoreConfig;
437
+ query?: string;
438
+ }) => Promise<UnifiedOrderRefundType[]>;
439
+ retrieve: (props: {
440
+ sdk: CoreConfig;
441
+ id: string;
442
+ }) => Promise<UnifiedOrderRefundType>;
443
+ create: (props: {
444
+ sdk: CoreConfig;
445
+ data: UnifiedOrderRefundType;
446
+ }) => Promise<UnifiedOrderRefundType>;
447
+ update: (props: {
448
+ sdk: CoreConfig;
449
+ id: string;
450
+ data: Partial<UnifiedOrderRefundType>;
451
+ }) => Promise<UnifiedOrderRefundType>;
452
+ delete: (props: {
453
+ sdk: CoreConfig;
454
+ id: string;
455
+ }) => Promise<void>;
456
+ bulk_create: (props: {
457
+ sdk: CoreConfig;
458
+ data: UnifiedOrderRefundType[];
459
+ }) => Promise<UnifiedOrderRefundType[]>;
460
+ bulk_update: (props: {
461
+ sdk: CoreConfig;
462
+ data: Array<{
463
+ id: string;
464
+ data: Partial<UnifiedOrderRefundType>;
465
+ }>;
466
+ }) => Promise<UnifiedOrderRefundType[]>;
467
+ bulk_delete: (props: {
468
+ sdk: CoreConfig;
469
+ ids: string[];
470
+ }) => Promise<void>;
471
+ };
472
+
473
+ declare const payment_providers: {
474
+ list: (props: {
475
+ sdk: CoreConfig;
476
+ query?: string;
477
+ }) => Promise<UnifiedPaymentProviderType[]>;
478
+ retrieve: (props: {
479
+ sdk: CoreConfig;
480
+ id: string;
481
+ }) => Promise<UnifiedPaymentProviderType>;
482
+ create: (props: {
483
+ sdk: CoreConfig;
484
+ data: UnifiedPaymentProviderType;
485
+ }) => Promise<UnifiedPaymentProviderType>;
486
+ update: (props: {
487
+ sdk: CoreConfig;
488
+ id: string;
489
+ data: Partial<UnifiedPaymentProviderType>;
490
+ }) => Promise<UnifiedPaymentProviderType>;
491
+ delete: (props: {
492
+ sdk: CoreConfig;
493
+ id: string;
494
+ }) => Promise<void>;
495
+ bulk_create: (props: {
496
+ sdk: CoreConfig;
497
+ data: UnifiedPaymentProviderType[];
498
+ }) => Promise<UnifiedPaymentProviderType[]>;
499
+ bulk_update: (props: {
500
+ sdk: CoreConfig;
501
+ data: Array<{
502
+ id: string;
503
+ data: Partial<UnifiedPaymentProviderType>;
504
+ }>;
505
+ }) => Promise<UnifiedPaymentProviderType[]>;
506
+ bulk_delete: (props: {
507
+ sdk: CoreConfig;
508
+ ids: string[];
509
+ }) => Promise<void>;
510
+ };
511
+
512
+ declare const payments: {
513
+ list: (props: {
514
+ sdk: CoreConfig;
515
+ query?: string;
516
+ }) => Promise<UnifiedPaymentCollectionType[]>;
517
+ retrieve: (props: {
518
+ sdk: CoreConfig;
519
+ id: string;
520
+ }) => Promise<UnifiedPaymentCollectionType>;
521
+ create: (props: {
522
+ sdk: CoreConfig;
523
+ data: UnifiedPaymentCollectionType;
524
+ }) => Promise<UnifiedPaymentCollectionType>;
525
+ update: (props: {
526
+ sdk: CoreConfig;
527
+ id: string;
528
+ data: Partial<UnifiedPaymentCollectionType>;
529
+ }) => Promise<UnifiedPaymentCollectionType>;
530
+ delete: (props: {
531
+ sdk: CoreConfig;
532
+ id: string;
533
+ }) => Promise<void>;
534
+ bulk_create: (props: {
535
+ sdk: CoreConfig;
536
+ data: UnifiedPaymentCollectionType[];
537
+ }) => Promise<UnifiedPaymentCollectionType[]>;
538
+ bulk_update: (props: {
539
+ sdk: CoreConfig;
540
+ data: Array<{
541
+ id: string;
542
+ data: Partial<UnifiedPaymentCollectionType>;
543
+ }>;
544
+ }) => Promise<UnifiedPaymentCollectionType[]>;
545
+ bulk_delete: (props: {
546
+ sdk: CoreConfig;
547
+ ids: string[];
548
+ }) => Promise<void>;
549
+ };
550
+
551
+ declare const tax_regions: {
552
+ list: (props: {
553
+ sdk: CoreConfig;
554
+ query?: string;
555
+ }) => Promise<UnifiedTaxRegionType[]>;
556
+ retrieve: (props: {
557
+ sdk: CoreConfig;
558
+ id: string;
559
+ }) => Promise<UnifiedTaxRegionType>;
560
+ create: (props: {
561
+ sdk: CoreConfig;
562
+ data: UnifiedTaxRegionType;
563
+ }) => Promise<UnifiedTaxRegionType>;
564
+ update: (props: {
565
+ sdk: CoreConfig;
566
+ id: string;
567
+ data: Partial<UnifiedTaxRegionType>;
568
+ }) => Promise<UnifiedTaxRegionType>;
569
+ delete: (props: {
570
+ sdk: CoreConfig;
571
+ id: string;
572
+ }) => Promise<void>;
573
+ bulk_create: (props: {
574
+ sdk: CoreConfig;
575
+ data: UnifiedTaxRegionType[];
576
+ }) => Promise<UnifiedTaxRegionType[]>;
577
+ bulk_update: (props: {
578
+ sdk: CoreConfig;
579
+ data: Array<{
580
+ id: string;
581
+ data: Partial<UnifiedTaxRegionType>;
582
+ }>;
583
+ }) => Promise<UnifiedTaxRegionType[]>;
584
+ bulk_delete: (props: {
585
+ sdk: CoreConfig;
586
+ ids: string[];
587
+ }) => Promise<void>;
588
+ };
589
+
590
+ declare const tax_rates: {
591
+ list: (props: {
592
+ sdk: CoreConfig;
593
+ query?: string;
594
+ }) => Promise<UnifiedTaxRateType[]>;
595
+ retrieve: (props: {
596
+ sdk: CoreConfig;
597
+ id: string;
598
+ }) => Promise<UnifiedTaxRateType>;
599
+ create: (props: {
600
+ sdk: CoreConfig;
601
+ data: UnifiedTaxRateType;
602
+ }) => Promise<UnifiedTaxRateType>;
603
+ update: (props: {
604
+ sdk: CoreConfig;
605
+ id: string;
606
+ data: Partial<UnifiedTaxRateType>;
607
+ }) => Promise<UnifiedTaxRateType>;
608
+ delete: (props: {
609
+ sdk: CoreConfig;
610
+ id: string;
611
+ }) => Promise<void>;
612
+ bulk_create: (props: {
613
+ sdk: CoreConfig;
614
+ data: UnifiedTaxRateType[];
615
+ }) => Promise<UnifiedTaxRateType[]>;
616
+ bulk_update: (props: {
617
+ sdk: CoreConfig;
618
+ data: Array<{
619
+ id: string;
620
+ data: Partial<UnifiedTaxRateType>;
621
+ }>;
622
+ }) => Promise<UnifiedTaxRateType[]>;
623
+ bulk_delete: (props: {
624
+ sdk: CoreConfig;
625
+ ids: string[];
626
+ }) => Promise<void>;
627
+ };
628
+
629
+ declare const locations: {
630
+ list: (props: {
631
+ sdk: CoreConfig;
632
+ query?: string;
633
+ }) => Promise<UnifiedLocationType[]>;
634
+ retrieve: (props: {
635
+ sdk: CoreConfig;
636
+ id: string;
637
+ }) => Promise<UnifiedLocationType>;
638
+ create: (props: {
639
+ sdk: CoreConfig;
640
+ data: UnifiedLocationType;
641
+ }) => Promise<UnifiedLocationType>;
642
+ update: (props: {
643
+ sdk: CoreConfig;
644
+ id: string;
645
+ data: Partial<UnifiedLocationType>;
646
+ }) => Promise<UnifiedLocationType>;
647
+ delete: (props: {
648
+ sdk: CoreConfig;
649
+ id: string;
650
+ }) => Promise<void>;
651
+ bulk_create: (props: {
652
+ sdk: CoreConfig;
653
+ data: UnifiedLocationType[];
654
+ }) => Promise<UnifiedLocationType[]>;
655
+ bulk_update: (props: {
656
+ sdk: CoreConfig;
657
+ data: Array<{
658
+ id: string;
659
+ data: Partial<UnifiedLocationType>;
660
+ }>;
661
+ }) => Promise<UnifiedLocationType[]>;
662
+ bulk_delete: (props: {
663
+ sdk: CoreConfig;
664
+ ids: string[];
665
+ }) => Promise<void>;
666
+ };
667
+
668
+ declare const fulfillments: {
669
+ list: (props: {
670
+ sdk: CoreConfig;
671
+ query?: string;
672
+ }) => Promise<UnifiedFulfillmentType[]>;
673
+ retrieve: (props: {
674
+ sdk: CoreConfig;
675
+ id: string;
676
+ }) => Promise<UnifiedFulfillmentType>;
677
+ create: (props: {
678
+ sdk: CoreConfig;
679
+ data: UnifiedFulfillmentType;
680
+ }) => Promise<UnifiedFulfillmentType>;
681
+ update: (props: {
682
+ sdk: CoreConfig;
683
+ id: string;
684
+ data: Partial<UnifiedFulfillmentType>;
685
+ }) => Promise<UnifiedFulfillmentType>;
686
+ delete: (props: {
687
+ sdk: CoreConfig;
688
+ id: string;
689
+ }) => Promise<void>;
690
+ bulk_create: (props: {
691
+ sdk: CoreConfig;
692
+ data: UnifiedFulfillmentType[];
693
+ }) => Promise<UnifiedFulfillmentType[]>;
694
+ bulk_update: (props: {
695
+ sdk: CoreConfig;
696
+ data: Array<{
697
+ id: string;
698
+ data: Partial<UnifiedFulfillmentType>;
699
+ }>;
700
+ }) => Promise<UnifiedFulfillmentType[]>;
701
+ bulk_delete: (props: {
702
+ sdk: CoreConfig;
703
+ ids: string[];
704
+ }) => Promise<void>;
705
+ };
706
+
707
+ interface ConnectorCacheType {
708
+ id: string;
709
+ code: string;
710
+ timestamp: number;
711
+ }
712
+ interface SyncQueueType {
713
+ id: string;
714
+ action: "create" | "update" | "delete";
715
+ table: ConnectorModuleKey;
716
+ document_id: string;
717
+ stall_offline_id: string;
718
+ data: Record<string, any>;
719
+ timestamp: number;
720
+ status: "pending" | "syncing" | "completed" | "failed";
721
+ error?: string;
722
+ retry_count: number;
723
+ last_retry_at?: number;
724
+ }
725
+ interface SyncLogType {
726
+ id: string;
727
+ sync_batch_id: string;
728
+ table: ConnectorModuleKey;
729
+ action: "create" | "update" | "delete";
730
+ document_id: string;
731
+ stall_offline_id: string;
732
+ connector_id?: string;
733
+ status: "success" | "failed" | "pending";
734
+ error?: string;
735
+ timestamp: number;
736
+ duration_ms: number;
737
+ }
738
+ type ConnectorCacheTable = EntityTable<ConnectorCacheType, "id">;
739
+ type SyncQueueTable = EntityTable<SyncQueueType, "id">;
740
+ type SyncLogTable = EntityTable<SyncLogType, "id">;
741
+ type ProductsTable = EntityTable<UnifiedProductType, "id">;
742
+ type VariantsTable = EntityTable<UnifiedVariantsType, "id">;
743
+ type CollectionsTable = EntityTable<UnifiedCollectionType, "id">;
744
+ type CategoriesTable = EntityTable<UnifiedCategoryType, "id">;
745
+ type InventoryLevelsTable = EntityTable<UnifiedInventoryLevelType, "id">;
746
+ type InventoryHistoryTable = EntityTable<UnifiedInventoryLevelType, "id">;
747
+ type PromotionsTable = EntityTable<UnifiedPromotion, "id">;
748
+ type OrdersTable = EntityTable<UnifiedOrderType, "id">;
749
+ type OrderNotesTable = EntityTable<UnifiedOrderNote, "id">;
750
+ type RefundsTable = EntityTable<UnifiedOrderRefundType, "id">;
751
+ type PaymentProvidersTable = EntityTable<UnifiedPaymentProviderType, "id">;
752
+ type PaymentsTable = EntityTable<UnifiedPaymentCollectionType, "id">;
753
+ type TaxRegionsTable = EntityTable<UnifiedTaxRegionType, "id">;
754
+ type TaxRatesTable = EntityTable<UnifiedTaxRateType, "id">;
755
+ type CustomersTable = EntityTable<UnifiedCustomerType, "id">;
756
+ type LocationsTable = EntityTable<UnifiedLocationType, "id">;
757
+ type FulfillmentsTable = EntityTable<UnifiedFulfillmentType, "id">;
758
+
759
+ declare const sync_service: {
760
+ process_sync_queue: (props: {
761
+ sdk: CoreConfig;
762
+ }) => Promise<{
763
+ sync_batch_id: string;
764
+ total: number;
765
+ synced: number;
766
+ failed: number;
767
+ summary: {
768
+ table: ConnectorModuleKey;
769
+ synced: number;
770
+ failed: number;
771
+ }[];
772
+ }>;
773
+ sync_queue_item: (props: {
774
+ sdk: CoreConfig;
775
+ item: SyncQueueType;
776
+ sync_batch_id: string;
777
+ }) => Promise<{
778
+ success: boolean;
779
+ connector_id?: string;
780
+ error?: string;
781
+ }>;
782
+ start_sync_service: (props: {
783
+ sdk: CoreConfig;
784
+ interval?: number;
785
+ }) => Promise<void>;
786
+ stop_sync_service: () => void;
787
+ get_sync_stats: () => Promise<{
788
+ pending: number;
789
+ syncing: number;
790
+ failed: number;
791
+ total: number;
792
+ }>;
793
+ trigger_sync: (props: {
794
+ sdk: CoreConfig;
795
+ }) => Promise<{
796
+ sync_batch_id: string;
797
+ total: number;
798
+ synced: number;
799
+ failed: number;
800
+ summary: {
801
+ table: ConnectorModuleKey;
802
+ synced: number;
803
+ failed: number;
804
+ }[];
805
+ }>;
806
+ };
807
+
808
+ /**
809
+ * Generate a temporary offline ID
810
+ * Format: stall_{table}_{uuid}_{timestamp}
811
+ */
812
+ declare const generate_offline_id: (table: string) => string;
813
+ /**
814
+ * Save bulk data to local database, clearing existing data
815
+ */
816
+ declare const save_bulk_data: (props: {
817
+ table: string;
818
+ data: any[];
819
+ }) => Promise<void>;
820
+ /**
821
+ * Add a single item to the sync queue for later synchronization
822
+ */
823
+ declare const add_to_sync_queue: (props: {
824
+ action: "create" | "update" | "delete";
825
+ table: ConnectorModuleKey;
826
+ document_id: string;
827
+ stall_offline_id: string;
828
+ data: Record<string, any>;
829
+ }) => Promise<SyncQueueType>;
830
+ /**
831
+ * Get pending sync queue items grouped by table for dependency-aware syncing
832
+ */
833
+ declare const get_pending_sync_queue: () => Promise<Map<ConnectorModuleKey, SyncQueueType[]>>;
834
+ /**
835
+ * Update sync queue item status
836
+ */
837
+ declare const update_sync_queue_status: (props: {
838
+ id: string;
839
+ status: "pending" | "syncing" | "completed" | "failed";
840
+ error?: string;
841
+ retry_count?: number;
842
+ }) => Promise<void>;
843
+ /**
844
+ * Remove item from sync queue after successful sync
845
+ */
846
+ declare const remove_from_sync_queue: (id: string) => Promise<void>;
847
+ /**
848
+ * Add a sync log entry for tracking synchronization activities
849
+ */
850
+ declare const add_sync_log: (props: {
851
+ sync_batch_id: string;
852
+ table: ConnectorModuleKey;
853
+ action: "create" | "update" | "delete";
854
+ document_id: string;
855
+ stall_offline_id: string;
856
+ connector_id?: string;
857
+ status: "success" | "failed" | "pending";
858
+ error?: string;
859
+ duration_ms: number;
860
+ }) => Promise<SyncLogType>;
861
+ /**
862
+ * Get sync logs for a specific batch
863
+ */
864
+ declare const get_sync_logs_by_batch: (sync_batch_id: string) => Promise<SyncLogType[]>;
865
+ /**
866
+ * Get recent sync logs with optional filtering
867
+ */
868
+ declare const get_recent_sync_logs: (props?: {
869
+ limit?: number;
870
+ table?: ConnectorModuleKey;
871
+ status?: "success" | "failed" | "pending";
872
+ }) => Promise<SyncLogType[]>;
873
+ /**
874
+ * Clear old sync logs (keep last N days)
875
+ */
876
+ declare const cleanup_old_sync_logs: (days?: number) => Promise<void>;
877
+
878
+ declare const local_db: Dexie & {
879
+ connector_cache: ConnectorCacheTable;
880
+ sync_queue: SyncQueueTable;
881
+ sync_logs: SyncLogTable;
882
+ products: ProductsTable;
883
+ variants: VariantsTable;
884
+ collections: CollectionsTable;
885
+ categories: CategoriesTable;
886
+ inventory_levels: InventoryLevelsTable;
887
+ inventory_history: InventoryHistoryTable;
888
+ promotions: PromotionsTable;
889
+ orders: OrdersTable;
890
+ order_notes: OrderNotesTable;
891
+ refunds: RefundsTable;
892
+ payment_providers: PaymentProvidersTable;
893
+ payments: PaymentsTable;
894
+ tax_regions: TaxRegionsTable;
895
+ tax_rates: TaxRatesTable;
896
+ customers: CustomersTable;
897
+ locations: LocationsTable;
898
+ fulfillments: FulfillmentsTable;
899
+ };
900
+
901
+ export { add_sync_log, add_to_sync_queue, categories, cleanup_old_sync_logs, collections, customers, fulfillments, generate_offline_id, get_pending_sync_queue, get_recent_sync_logs, get_sync_logs_by_batch, initializeStallCore, inventory_levels, local_db, locations, order_notes, orders, payment_providers, payments, products, promotions, refunds, remove_from_sync_queue, save_bulk_data, sync_service, tax_rates, tax_regions, update_sync_queue_status, variants };