@use-stall/core 0.0.12 → 0.0.14
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.mts +40 -50
- package/dist/index.d.ts +40 -50
- package/dist/index.js +1384 -1070
- package/dist/index.mjs +1381 -1070
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -704,6 +704,31 @@ declare const fulfillments: {
|
|
|
704
704
|
}) => Promise<void>;
|
|
705
705
|
};
|
|
706
706
|
|
|
707
|
+
declare const sync_service: {
|
|
708
|
+
get_sync_status: () => Promise<{
|
|
709
|
+
pending: number;
|
|
710
|
+
syncing: number;
|
|
711
|
+
failed: number;
|
|
712
|
+
total: number;
|
|
713
|
+
is_sync_running: boolean;
|
|
714
|
+
}>;
|
|
715
|
+
fix_sync_queue: () => Promise<{
|
|
716
|
+
fixed: number;
|
|
717
|
+
}>;
|
|
718
|
+
trigger_sync: (props: {
|
|
719
|
+
sdk: CoreConfig;
|
|
720
|
+
}) => Promise<{
|
|
721
|
+
sync_batch_id: string;
|
|
722
|
+
total: number;
|
|
723
|
+
synced: number;
|
|
724
|
+
failed: number;
|
|
725
|
+
}>;
|
|
726
|
+
start_sync: (props: {
|
|
727
|
+
sdk: CoreConfig;
|
|
728
|
+
}) => Promise<void>;
|
|
729
|
+
stop_sync: () => void;
|
|
730
|
+
};
|
|
731
|
+
|
|
707
732
|
interface ConnectorCacheType {
|
|
708
733
|
id: string;
|
|
709
734
|
code: string;
|
|
@@ -757,55 +782,6 @@ type CustomersTable = EntityTable<UnifiedCustomerType, "id">;
|
|
|
757
782
|
type LocationsTable = EntityTable<UnifiedLocationType, "id">;
|
|
758
783
|
type FulfillmentsTable = EntityTable<UnifiedFulfillmentType, "id">;
|
|
759
784
|
|
|
760
|
-
declare const sync_service: {
|
|
761
|
-
process_sync_queue: (props: {
|
|
762
|
-
sdk: CoreConfig;
|
|
763
|
-
}) => Promise<{
|
|
764
|
-
sync_batch_id: string;
|
|
765
|
-
total: number;
|
|
766
|
-
synced: number;
|
|
767
|
-
failed: number;
|
|
768
|
-
summary: {
|
|
769
|
-
table: ConnectorModuleKey;
|
|
770
|
-
synced: number;
|
|
771
|
-
failed: number;
|
|
772
|
-
}[];
|
|
773
|
-
}>;
|
|
774
|
-
sync_queue_item: (props: {
|
|
775
|
-
sdk: CoreConfig;
|
|
776
|
-
item: SyncQueueType;
|
|
777
|
-
sync_batch_id: string;
|
|
778
|
-
}) => Promise<{
|
|
779
|
-
success: boolean;
|
|
780
|
-
connector_id?: string;
|
|
781
|
-
error?: string;
|
|
782
|
-
}>;
|
|
783
|
-
start_sync_service: (props: {
|
|
784
|
-
sdk: CoreConfig;
|
|
785
|
-
interval?: number;
|
|
786
|
-
}) => Promise<void>;
|
|
787
|
-
stop_sync_service: () => void;
|
|
788
|
-
get_sync_stats: () => Promise<{
|
|
789
|
-
pending: number;
|
|
790
|
-
syncing: number;
|
|
791
|
-
failed: number;
|
|
792
|
-
total: number;
|
|
793
|
-
}>;
|
|
794
|
-
trigger_sync: (props: {
|
|
795
|
-
sdk: CoreConfig;
|
|
796
|
-
}) => Promise<{
|
|
797
|
-
sync_batch_id: string;
|
|
798
|
-
total: number;
|
|
799
|
-
synced: number;
|
|
800
|
-
failed: number;
|
|
801
|
-
summary: {
|
|
802
|
-
table: ConnectorModuleKey;
|
|
803
|
-
synced: number;
|
|
804
|
-
failed: number;
|
|
805
|
-
}[];
|
|
806
|
-
}>;
|
|
807
|
-
};
|
|
808
|
-
|
|
809
785
|
/**
|
|
810
786
|
* Generate a temporary offline ID
|
|
811
787
|
* Format: stall_{table}_{uuid}_{timestamp}
|
|
@@ -879,6 +855,10 @@ declare const get_recent_sync_logs: (props?: {
|
|
|
879
855
|
table?: ConnectorModuleKey;
|
|
880
856
|
status?: "success" | "failed" | "pending";
|
|
881
857
|
}) => Promise<SyncLogType[]>;
|
|
858
|
+
/**
|
|
859
|
+
* Check if sync queue is empty (all pending items synced)
|
|
860
|
+
*/
|
|
861
|
+
declare const is_sync_queue_empty: () => Promise<boolean>;
|
|
882
862
|
/**
|
|
883
863
|
* Clear old sync logs (keep last N days)
|
|
884
864
|
*/
|
|
@@ -907,4 +887,14 @@ declare const local_db: Dexie & {
|
|
|
907
887
|
fulfillments: FulfillmentsTable;
|
|
908
888
|
};
|
|
909
889
|
|
|
910
|
-
|
|
890
|
+
/**
|
|
891
|
+
* Check if the device is online
|
|
892
|
+
* Returns true if navigator.onLine is true or if navigator is not available (Node.js)
|
|
893
|
+
*/
|
|
894
|
+
declare const is_online: () => boolean;
|
|
895
|
+
/**
|
|
896
|
+
* Check if the device is offline
|
|
897
|
+
*/
|
|
898
|
+
declare const is_offline: () => boolean;
|
|
899
|
+
|
|
900
|
+
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, is_offline, is_online, is_sync_queue_empty, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -704,6 +704,31 @@ declare const fulfillments: {
|
|
|
704
704
|
}) => Promise<void>;
|
|
705
705
|
};
|
|
706
706
|
|
|
707
|
+
declare const sync_service: {
|
|
708
|
+
get_sync_status: () => Promise<{
|
|
709
|
+
pending: number;
|
|
710
|
+
syncing: number;
|
|
711
|
+
failed: number;
|
|
712
|
+
total: number;
|
|
713
|
+
is_sync_running: boolean;
|
|
714
|
+
}>;
|
|
715
|
+
fix_sync_queue: () => Promise<{
|
|
716
|
+
fixed: number;
|
|
717
|
+
}>;
|
|
718
|
+
trigger_sync: (props: {
|
|
719
|
+
sdk: CoreConfig;
|
|
720
|
+
}) => Promise<{
|
|
721
|
+
sync_batch_id: string;
|
|
722
|
+
total: number;
|
|
723
|
+
synced: number;
|
|
724
|
+
failed: number;
|
|
725
|
+
}>;
|
|
726
|
+
start_sync: (props: {
|
|
727
|
+
sdk: CoreConfig;
|
|
728
|
+
}) => Promise<void>;
|
|
729
|
+
stop_sync: () => void;
|
|
730
|
+
};
|
|
731
|
+
|
|
707
732
|
interface ConnectorCacheType {
|
|
708
733
|
id: string;
|
|
709
734
|
code: string;
|
|
@@ -757,55 +782,6 @@ type CustomersTable = EntityTable<UnifiedCustomerType, "id">;
|
|
|
757
782
|
type LocationsTable = EntityTable<UnifiedLocationType, "id">;
|
|
758
783
|
type FulfillmentsTable = EntityTable<UnifiedFulfillmentType, "id">;
|
|
759
784
|
|
|
760
|
-
declare const sync_service: {
|
|
761
|
-
process_sync_queue: (props: {
|
|
762
|
-
sdk: CoreConfig;
|
|
763
|
-
}) => Promise<{
|
|
764
|
-
sync_batch_id: string;
|
|
765
|
-
total: number;
|
|
766
|
-
synced: number;
|
|
767
|
-
failed: number;
|
|
768
|
-
summary: {
|
|
769
|
-
table: ConnectorModuleKey;
|
|
770
|
-
synced: number;
|
|
771
|
-
failed: number;
|
|
772
|
-
}[];
|
|
773
|
-
}>;
|
|
774
|
-
sync_queue_item: (props: {
|
|
775
|
-
sdk: CoreConfig;
|
|
776
|
-
item: SyncQueueType;
|
|
777
|
-
sync_batch_id: string;
|
|
778
|
-
}) => Promise<{
|
|
779
|
-
success: boolean;
|
|
780
|
-
connector_id?: string;
|
|
781
|
-
error?: string;
|
|
782
|
-
}>;
|
|
783
|
-
start_sync_service: (props: {
|
|
784
|
-
sdk: CoreConfig;
|
|
785
|
-
interval?: number;
|
|
786
|
-
}) => Promise<void>;
|
|
787
|
-
stop_sync_service: () => void;
|
|
788
|
-
get_sync_stats: () => Promise<{
|
|
789
|
-
pending: number;
|
|
790
|
-
syncing: number;
|
|
791
|
-
failed: number;
|
|
792
|
-
total: number;
|
|
793
|
-
}>;
|
|
794
|
-
trigger_sync: (props: {
|
|
795
|
-
sdk: CoreConfig;
|
|
796
|
-
}) => Promise<{
|
|
797
|
-
sync_batch_id: string;
|
|
798
|
-
total: number;
|
|
799
|
-
synced: number;
|
|
800
|
-
failed: number;
|
|
801
|
-
summary: {
|
|
802
|
-
table: ConnectorModuleKey;
|
|
803
|
-
synced: number;
|
|
804
|
-
failed: number;
|
|
805
|
-
}[];
|
|
806
|
-
}>;
|
|
807
|
-
};
|
|
808
|
-
|
|
809
785
|
/**
|
|
810
786
|
* Generate a temporary offline ID
|
|
811
787
|
* Format: stall_{table}_{uuid}_{timestamp}
|
|
@@ -879,6 +855,10 @@ declare const get_recent_sync_logs: (props?: {
|
|
|
879
855
|
table?: ConnectorModuleKey;
|
|
880
856
|
status?: "success" | "failed" | "pending";
|
|
881
857
|
}) => Promise<SyncLogType[]>;
|
|
858
|
+
/**
|
|
859
|
+
* Check if sync queue is empty (all pending items synced)
|
|
860
|
+
*/
|
|
861
|
+
declare const is_sync_queue_empty: () => Promise<boolean>;
|
|
882
862
|
/**
|
|
883
863
|
* Clear old sync logs (keep last N days)
|
|
884
864
|
*/
|
|
@@ -907,4 +887,14 @@ declare const local_db: Dexie & {
|
|
|
907
887
|
fulfillments: FulfillmentsTable;
|
|
908
888
|
};
|
|
909
889
|
|
|
910
|
-
|
|
890
|
+
/**
|
|
891
|
+
* Check if the device is online
|
|
892
|
+
* Returns true if navigator.onLine is true or if navigator is not available (Node.js)
|
|
893
|
+
*/
|
|
894
|
+
declare const is_online: () => boolean;
|
|
895
|
+
/**
|
|
896
|
+
* Check if the device is offline
|
|
897
|
+
*/
|
|
898
|
+
declare const is_offline: () => boolean;
|
|
899
|
+
|
|
900
|
+
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, is_offline, is_online, is_sync_queue_empty, 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 };
|