@use-stall/core 0.0.12 → 0.0.13
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 +36 -50
- package/dist/index.d.ts +36 -50
- package/dist/index.js +1196 -1085
- package/dist/index.mjs +1194 -1085
- 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}
|
|
@@ -907,4 +883,14 @@ declare const local_db: Dexie & {
|
|
|
907
883
|
fulfillments: FulfillmentsTable;
|
|
908
884
|
};
|
|
909
885
|
|
|
910
|
-
|
|
886
|
+
/**
|
|
887
|
+
* Check if the device is online
|
|
888
|
+
* Returns true if navigator.onLine is true or if navigator is not available (Node.js)
|
|
889
|
+
*/
|
|
890
|
+
declare const is_online: () => boolean;
|
|
891
|
+
/**
|
|
892
|
+
* Check if the device is offline
|
|
893
|
+
*/
|
|
894
|
+
declare const is_offline: () => boolean;
|
|
895
|
+
|
|
896
|
+
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, 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}
|
|
@@ -907,4 +883,14 @@ declare const local_db: Dexie & {
|
|
|
907
883
|
fulfillments: FulfillmentsTable;
|
|
908
884
|
};
|
|
909
885
|
|
|
910
|
-
|
|
886
|
+
/**
|
|
887
|
+
* Check if the device is online
|
|
888
|
+
* Returns true if navigator.onLine is true or if navigator is not available (Node.js)
|
|
889
|
+
*/
|
|
890
|
+
declare const is_online: () => boolean;
|
|
891
|
+
/**
|
|
892
|
+
* Check if the device is offline
|
|
893
|
+
*/
|
|
894
|
+
declare const is_offline: () => boolean;
|
|
895
|
+
|
|
896
|
+
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, 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 };
|