repzo 1.0.71 → 1.0.73

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/lib/index.d.ts CHANGED
@@ -499,6 +499,46 @@ export default class Repzo {
499
499
  id: Service.CustomStatus.Remove.ID
500
500
  ) => Promise<Service.CustomStatus.Remove.Result>;
501
501
  };
502
+ customList: {
503
+ _path: string;
504
+ find: (
505
+ params?: Service.CustomList.Find.Params
506
+ ) => Promise<Service.CustomList.Find.Result>;
507
+ get: (
508
+ id: Service.CustomList.Get.ID,
509
+ params?: Service.CustomList.Get.Params
510
+ ) => Promise<Service.CustomList.Get.Result>;
511
+ create: (
512
+ body: Service.CustomList.Create.Body
513
+ ) => Promise<Service.CustomList.Create.Result>;
514
+ update: (
515
+ id: Service.CustomList.Update.ID,
516
+ body: Service.CustomList.Update.Body
517
+ ) => Promise<Service.CustomList.Update.Result>;
518
+ remove: (
519
+ id: Service.CustomList.Remove.ID
520
+ ) => Promise<Service.CustomList.Remove.Result>;
521
+ };
522
+ customListItem: {
523
+ _path: string;
524
+ find: (
525
+ params?: Service.CustomListItem.Find.Params
526
+ ) => Promise<Service.CustomListItem.Find.Result>;
527
+ get: (
528
+ id: Service.CustomListItem.Get.ID,
529
+ params?: Service.CustomListItem.Get.Params
530
+ ) => Promise<Service.CustomListItem.Get.Result>;
531
+ create: (
532
+ body: Service.CustomListItem.Create.Body
533
+ ) => Promise<Service.CustomListItem.Create.Result>;
534
+ update: (
535
+ id: Service.CustomListItem.Update.ID,
536
+ body: Service.CustomListItem.Update.Body
537
+ ) => Promise<Service.CustomListItem.Update.Result>;
538
+ remove: (
539
+ id: Service.CustomListItem.Remove.ID
540
+ ) => Promise<Service.CustomListItem.Remove.Result>;
541
+ };
502
542
  workorder: {
503
543
  _path: string;
504
544
  find: (
@@ -778,6 +818,23 @@ export default class Repzo {
778
818
  id: Service.StorecheckTemplate.Remove.ID
779
819
  ) => Promise<Service.StorecheckTemplate.Remove.Result>;
780
820
  };
821
+ activityStorecheck: {
822
+ _path: string;
823
+ find: (
824
+ params?: Service.ActivityStorecheck.Find.Params
825
+ ) => Promise<Service.ActivityStorecheck.Find.Result>;
826
+ get: (
827
+ id: Service.ActivityStorecheck.Get.ID,
828
+ params?: Service.ActivityStorecheck.Get.Params
829
+ ) => Promise<Service.ActivityStorecheck.Get.Result>;
830
+ create: (
831
+ body: Service.ActivityStorecheck.Create.Body
832
+ ) => Promise<Service.ActivityStorecheck.Create.Result>;
833
+ update: (
834
+ id: Service.ActivityStorecheck.Update.ID,
835
+ body: Service.ActivityStorecheck.Update.Body
836
+ ) => Promise<Service.ActivityStorecheck.Update.Result>;
837
+ };
781
838
  adjustInventory: {
782
839
  _path: string;
783
840
  find: (
package/lib/index.js CHANGED
@@ -1035,6 +1035,88 @@ export default class Repzo {
1035
1035
  return res;
1036
1036
  },
1037
1037
  };
1038
+ this.customList = {
1039
+ _path: "/custom-list",
1040
+ find: async (params) => {
1041
+ let res = await this._fetch(
1042
+ this.svAPIEndpoint,
1043
+ this.customList._path,
1044
+ params
1045
+ );
1046
+ return res;
1047
+ },
1048
+ get: async (id, params) => {
1049
+ return await this._fetch(
1050
+ this.svAPIEndpoint,
1051
+ this.customList._path + `/${id}`,
1052
+ params
1053
+ );
1054
+ },
1055
+ create: async (body) => {
1056
+ let res = await this._create(
1057
+ this.svAPIEndpoint,
1058
+ this.customList._path,
1059
+ body
1060
+ );
1061
+ return res;
1062
+ },
1063
+ update: async (id, body) => {
1064
+ let res = await this._update(
1065
+ this.svAPIEndpoint,
1066
+ this.customList._path + `/${id}`,
1067
+ body
1068
+ );
1069
+ return res;
1070
+ },
1071
+ remove: async (id) => {
1072
+ let res = await this._delete(
1073
+ this.svAPIEndpoint,
1074
+ this.customList._path + `/${id}`
1075
+ );
1076
+ return res;
1077
+ },
1078
+ };
1079
+ this.customListItem = {
1080
+ _path: "/custom-list-item",
1081
+ find: async (params) => {
1082
+ let res = await this._fetch(
1083
+ this.svAPIEndpoint,
1084
+ this.customListItem._path,
1085
+ params
1086
+ );
1087
+ return res;
1088
+ },
1089
+ get: async (id, params) => {
1090
+ return await this._fetch(
1091
+ this.svAPIEndpoint,
1092
+ this.customListItem._path + `/${id}`,
1093
+ params
1094
+ );
1095
+ },
1096
+ create: async (body) => {
1097
+ let res = await this._create(
1098
+ this.svAPIEndpoint,
1099
+ this.customListItem._path,
1100
+ body
1101
+ );
1102
+ return res;
1103
+ },
1104
+ update: async (id, body) => {
1105
+ let res = await this._update(
1106
+ this.svAPIEndpoint,
1107
+ this.customListItem._path + `/${id}`,
1108
+ body
1109
+ );
1110
+ return res;
1111
+ },
1112
+ remove: async (id) => {
1113
+ let res = await this._delete(
1114
+ this.svAPIEndpoint,
1115
+ this.customListItem._path + `/${id}`
1116
+ );
1117
+ return res;
1118
+ },
1119
+ };
1038
1120
  this.workorder = {
1039
1121
  _path: "/workorder",
1040
1122
  find: async (params) => {
@@ -1584,6 +1666,40 @@ export default class Repzo {
1584
1666
  return res;
1585
1667
  },
1586
1668
  };
1669
+ this.activityStorecheck = {
1670
+ _path: "/activity-storecheck",
1671
+ find: async (params) => {
1672
+ let res = await this._fetch(
1673
+ this.svAPIEndpoint,
1674
+ this.activityStorecheck._path,
1675
+ params
1676
+ );
1677
+ return res;
1678
+ },
1679
+ get: async (id, params) => {
1680
+ return await this._fetch(
1681
+ this.svAPIEndpoint,
1682
+ this.activityStorecheck._path + `/${id}`,
1683
+ params
1684
+ );
1685
+ },
1686
+ create: async (body) => {
1687
+ let res = await this._create(
1688
+ this.svAPIEndpoint,
1689
+ this.activityStorecheck._path,
1690
+ body
1691
+ );
1692
+ return res;
1693
+ },
1694
+ update: async (id, body) => {
1695
+ let res = await this._update(
1696
+ this.svAPIEndpoint,
1697
+ this.activityStorecheck._path + `/${id}`,
1698
+ body
1699
+ );
1700
+ return res;
1701
+ },
1702
+ };
1587
1703
  this.adjustInventory = {
1588
1704
  _path: "/adjust-inventory",
1589
1705
  find: async (params) => {
@@ -223,6 +223,17 @@ export type Day =
223
223
  | "Fri"
224
224
  | "Sat"
225
225
  | string;
226
+ export type FieldType =
227
+ | "Text"
228
+ | "String"
229
+ | "Date"
230
+ | "Image"
231
+ | "Boolean"
232
+ | "Number"
233
+ | "List"
234
+ | "Separator"
235
+ | "Heading"
236
+ | "Media";
226
237
  export interface WeeklyDetails {
227
238
  every: number;
228
239
  days: Day[];
@@ -373,6 +384,10 @@ export interface GeoTag {
373
384
  lng: number;
374
385
  formatted_address: string;
375
386
  }
387
+ interface GeoPoint {
388
+ type: "Point";
389
+ coordinates: number[];
390
+ }
376
391
  export declare namespace Service {
377
392
  namespace Client {
378
393
  interface Financials {
@@ -1859,17 +1874,6 @@ export declare namespace Service {
1859
1874
  | "product-sub-category"
1860
1875
  | "product-brand"
1861
1876
  | "product-group";
1862
- type FieldType =
1863
- | "Text"
1864
- | "String"
1865
- | "Date"
1866
- | "Image"
1867
- | "Boolean"
1868
- | "Number"
1869
- | "List"
1870
- | "Separator"
1871
- | "Heading"
1872
- | "Media";
1873
1877
  type DataType =
1874
1878
  | "Separator"
1875
1879
  | "timestamp"
@@ -2042,6 +2046,189 @@ export declare namespace Service {
2042
2046
  }
2043
2047
  export {};
2044
2048
  }
2049
+ namespace ActivityStorecheck {
2050
+ interface Field {
2051
+ _id?: string;
2052
+ name: string;
2053
+ type: FieldType;
2054
+ isArray: boolean;
2055
+ isRequired?: boolean;
2056
+ is_calculated_field?: boolean;
2057
+ formula_key?: string;
2058
+ parent_field?: string;
2059
+ custom_list?: string;
2060
+ field_id: string;
2061
+ result: any[];
2062
+ result_custom_list_ids?: any[];
2063
+ calculation_status?: "success" | "failed";
2064
+ calculation_error?: string | any[];
2065
+ company_namespace?: string[];
2066
+ }
2067
+ export interface Division {
2068
+ fields: Field[];
2069
+ }
2070
+ interface Result {
2071
+ source_id: string;
2072
+ source_name: string;
2073
+ divisions: Division[];
2074
+ }
2075
+ interface Entry {
2076
+ entry_id: string;
2077
+ source:
2078
+ | "product"
2079
+ | "variant"
2080
+ | "product-category"
2081
+ | "product-sub-category"
2082
+ | "product-brand"
2083
+ | "product-group";
2084
+ results: Result[];
2085
+ }
2086
+ export interface ActivityStorecheckSchema {
2087
+ _id: string;
2088
+ company_namespace: string[];
2089
+ client: string;
2090
+ client_name: string;
2091
+ sync_id: string;
2092
+ time_zone: string;
2093
+ template_id: string;
2094
+ visit?: string;
2095
+ visit_id: string;
2096
+ battery_level?: number;
2097
+ user: string;
2098
+ user_name: string;
2099
+ time: number;
2100
+ geo_tag?: GeoTag;
2101
+ geoPoint: GeoPoint;
2102
+ teams?: string[];
2103
+ route?: string;
2104
+ tags?: string[];
2105
+ entries: Entry[];
2106
+ platform?: string;
2107
+ version_name?: string;
2108
+ device_brand?: string;
2109
+ device_os?: string;
2110
+ device_os_version?: string;
2111
+ device_model?: string;
2112
+ identifier?: number;
2113
+ device_id?: string;
2114
+ device_unique_id?: string;
2115
+ network_state?: number;
2116
+ serial_number?: SerialNumber;
2117
+ job_start_time?: number;
2118
+ job_end_time?: number;
2119
+ job_duration?: number;
2120
+ }
2121
+ export interface CreateBody {
2122
+ company_namespace: string[];
2123
+ client: string;
2124
+ client_name: string;
2125
+ time_zone: string;
2126
+ template_id: string;
2127
+ visit?: string;
2128
+ visit_id: string;
2129
+ user: string;
2130
+ user_name: string;
2131
+ time: number;
2132
+ geo_tag?: GeoTag;
2133
+ geoPoint: GeoPoint;
2134
+ teams?: string[];
2135
+ route?: string;
2136
+ tags?: string[];
2137
+ entries: Entry[];
2138
+ }
2139
+ export interface UpdateBody {
2140
+ _id?: string;
2141
+ company_namespace?: string[];
2142
+ client?: string;
2143
+ client_name?: string;
2144
+ sync_id?: string;
2145
+ time_zone?: string;
2146
+ template_id?: string;
2147
+ visit?: string;
2148
+ visit_id?: string;
2149
+ battery_level?: number;
2150
+ user?: string;
2151
+ user_name?: string;
2152
+ time?: number;
2153
+ geo_tag?: GeoTag;
2154
+ geoPoint?: GeoPoint;
2155
+ teams?: string[];
2156
+ route?: string;
2157
+ tags?: string[];
2158
+ entries?: Entry[];
2159
+ platform?: string;
2160
+ version_name?: string;
2161
+ device_brand?: string;
2162
+ device_os?: string;
2163
+ device_os_version?: string;
2164
+ device_model?: string;
2165
+ identifier?: number;
2166
+ device_id?: string;
2167
+ device_unique_id?: string;
2168
+ network_state?: number;
2169
+ serial_number?: SerialNumber;
2170
+ job_start_time?: number;
2171
+ job_end_time?: number;
2172
+ job_duration?: number;
2173
+ }
2174
+ type PopulatedKeys =
2175
+ | "teams"
2176
+ | "tags"
2177
+ | "client"
2178
+ | "user"
2179
+ | "route"
2180
+ | "visit"
2181
+ | "template_id";
2182
+ export type ActivityStoreCheckWithPopulatedKeysSchema = ActivityStorecheckSchema & {
2183
+ teams_populated: Team.TeamSchema[] | string[];
2184
+ tags_populated: Tag.TagSchema[] | string[];
2185
+ client_populated: Client.ClientSchema | string;
2186
+ user_populated: Rep.RepSchema | string;
2187
+ route_populated: Route.RouteSchema | string;
2188
+ visit_populated: Visit.VisitSchema | string;
2189
+ template_id_populated:
2190
+ | StorecheckTemplate.StorecheckTemplateSchema
2191
+ | string;
2192
+ };
2193
+ export namespace Find {
2194
+ type Params = DefaultPaginationQueryParams & {
2195
+ _id?: string[] | string;
2196
+ search?: string;
2197
+ name?: string[] | string;
2198
+ local_name?: string[] | string;
2199
+ disabled?: boolean;
2200
+ from_updatedAt?: number;
2201
+ from_time?: number;
2202
+ to_time?: number;
2203
+ client?: string;
2204
+ user?: string;
2205
+ tags?: string[];
2206
+ template_id?: string;
2207
+ teams?: string[];
2208
+ route?: string;
2209
+ populatedKeys?: PopulatedKeys[];
2210
+ [key: string]: any;
2211
+ };
2212
+ interface Result extends DefaultPaginationResult {
2213
+ data: ActivityStoreCheckWithPopulatedKeysSchema[];
2214
+ }
2215
+ }
2216
+ export namespace Get {
2217
+ type ID = string;
2218
+ interface Params {}
2219
+ type Result = ActivityStorecheckSchema;
2220
+ }
2221
+ export namespace Create {
2222
+ type Body = CreateBody;
2223
+ type Result = ActivityStorecheckSchema;
2224
+ }
2225
+ export namespace Update {
2226
+ type ID = string;
2227
+ type Body = UpdateBody;
2228
+ type Result = ActivityStorecheckSchema;
2229
+ }
2230
+ export {};
2231
+ }
2045
2232
  namespace Msl {
2046
2233
  interface MslSchema {
2047
2234
  _id: string;
@@ -3369,6 +3556,255 @@ export declare namespace Service {
3369
3556
  }
3370
3557
  export {};
3371
3558
  }
3559
+ namespace CustomList {
3560
+ interface EndPoint {
3561
+ _id?: string;
3562
+ is_read?: boolean;
3563
+ input_type?: "List";
3564
+ render_key?: string;
3565
+ filter_key?: "_id";
3566
+ type?: "String" | "Array" | "Number" | "Boolean";
3567
+ path?: string;
3568
+ method?: "get" | "post" | "put" | "patch" | "delete";
3569
+ body?: {
3570
+ [key: string]: any;
3571
+ };
3572
+ search?: boolean;
3573
+ multi_select?: boolean;
3574
+ }
3575
+ interface Source {
3576
+ source_id: string;
3577
+ company_namespace: string[];
3578
+ photo?: string;
3579
+ source_name: string;
3580
+ source_local_name?: string;
3581
+ }
3582
+ interface Filter {
3583
+ key: string;
3584
+ value: any[];
3585
+ operator:
3586
+ | "lte"
3587
+ | "lt"
3588
+ | "gte"
3589
+ | "gt"
3590
+ | "eq"
3591
+ | "ne"
3592
+ | "in"
3593
+ | "nin"
3594
+ | "search";
3595
+ id?: string;
3596
+ }
3597
+ interface Element {
3598
+ _id: string;
3599
+ name: string;
3600
+ type: "Number" | "String";
3601
+ key?: string;
3602
+ is_required?: boolean;
3603
+ isArray?: boolean;
3604
+ disabled: boolean;
3605
+ manipulator_function?: string;
3606
+ }
3607
+ export interface CustomListSchema {
3608
+ _id: string;
3609
+ code: string;
3610
+ name: string;
3611
+ local_name?: string;
3612
+ disabled: boolean;
3613
+ type: "reference" | "template";
3614
+ filters: Filter[];
3615
+ list_type: "String" | "Number";
3616
+ source:
3617
+ | "product"
3618
+ | "variant"
3619
+ | "product-category"
3620
+ | "product-sub-category"
3621
+ | "client"
3622
+ | "measureunits"
3623
+ | "tag"
3624
+ | "paymentterms"
3625
+ | "client-channel"
3626
+ | "speciality"
3627
+ | "rep";
3628
+ template_elements: Element[];
3629
+ company_namespace: string[];
3630
+ sources?: Source[];
3631
+ can_edit_types?: boolean;
3632
+ end_point: EndPoint;
3633
+ createdAt: string;
3634
+ updatedAt: string;
3635
+ }
3636
+ export interface CreateBody {
3637
+ code: string;
3638
+ name: string;
3639
+ local_name?: string;
3640
+ disabled: boolean;
3641
+ type: "reference" | "template";
3642
+ filters: Filter[];
3643
+ list_type: "String" | "Number";
3644
+ source:
3645
+ | "product"
3646
+ | "variant"
3647
+ | "product-category"
3648
+ | "product-sub-category"
3649
+ | "client"
3650
+ | "measureunits"
3651
+ | "tag"
3652
+ | "paymentterms"
3653
+ | "client-channel"
3654
+ | "speciality"
3655
+ | "rep";
3656
+ template_elements: Element[];
3657
+ company_namespace: string[];
3658
+ sources?: Source[];
3659
+ can_edit_types?: boolean;
3660
+ end_point: EndPoint;
3661
+ }
3662
+ export interface UpdateBody {
3663
+ _id?: string;
3664
+ code?: string;
3665
+ name?: string;
3666
+ local_name?: string;
3667
+ disabled?: boolean;
3668
+ type?: "reference" | "template";
3669
+ filters?: Filter[];
3670
+ list_type?: "String" | "Number";
3671
+ source?:
3672
+ | "product"
3673
+ | "variant"
3674
+ | "product-category"
3675
+ | "product-sub-category"
3676
+ | "client"
3677
+ | "measureunits"
3678
+ | "tag"
3679
+ | "paymentterms"
3680
+ | "client-channel"
3681
+ | "speciality"
3682
+ | "rep";
3683
+ template_elements?: Element[];
3684
+ company_namespace?: string[];
3685
+ sources?: Source[];
3686
+ can_edit_types?: boolean;
3687
+ end_point: EndPoint;
3688
+ }
3689
+ export namespace Find {
3690
+ type Params = DefaultPaginationQueryParams & {
3691
+ _id?: string[] | string;
3692
+ name?: string[] | string;
3693
+ type?: string;
3694
+ code?: string;
3695
+ from_updatedAt?: number;
3696
+ [key: string]: any;
3697
+ };
3698
+ interface Result extends DefaultPaginationResult {
3699
+ data: CustomListSchema[];
3700
+ }
3701
+ }
3702
+ export namespace Get {
3703
+ type ID = string;
3704
+ interface Params {}
3705
+ type Result = CustomListSchema;
3706
+ }
3707
+ export namespace Create {
3708
+ type Body = CreateBody;
3709
+ type Result = CustomListSchema;
3710
+ }
3711
+ export namespace Update {
3712
+ type ID = string;
3713
+ type Body = UpdateBody;
3714
+ type Result = CustomListSchema;
3715
+ }
3716
+ export namespace Remove {
3717
+ type ID = string;
3718
+ type Result = CustomListSchema;
3719
+ }
3720
+ export {};
3721
+ }
3722
+ namespace CustomListItem {
3723
+ type CustomItemType = "String" | "Number";
3724
+ interface CustomListItemElementModel {
3725
+ _id: string;
3726
+ template_element: string;
3727
+ value: string | number;
3728
+ name: string;
3729
+ type: CustomItemType;
3730
+ }
3731
+ export interface CustomListItemSchema {
3732
+ _id: string;
3733
+ disabled: boolean;
3734
+ custom_list: string;
3735
+ type: CustomItemType;
3736
+ value: string | number;
3737
+ photo?: string;
3738
+ media?: string[];
3739
+ position?: number;
3740
+ elements: CustomListItemElementModel[];
3741
+ score?: number;
3742
+ company_namespace: string[];
3743
+ createdAt: string;
3744
+ updatedAt: string;
3745
+ }
3746
+ export interface CreateBody {
3747
+ disabled: boolean;
3748
+ custom_list: string;
3749
+ type: CustomItemType;
3750
+ value: string | number;
3751
+ photo?: string;
3752
+ media?: string[];
3753
+ position?: number;
3754
+ elements: CustomListItemElementModel[];
3755
+ score?: number;
3756
+ company_namespace: string[];
3757
+ }
3758
+ export interface UpdateBody {
3759
+ _id?: string;
3760
+ disabled?: boolean;
3761
+ custom_list?: string;
3762
+ type?: CustomItemType;
3763
+ value?: string | number;
3764
+ photo?: string;
3765
+ media?: string[];
3766
+ position?: number;
3767
+ elements?: CustomListItemElementModel[];
3768
+ score?: number;
3769
+ company_namespace?: string[];
3770
+ }
3771
+ type CustomListItemSchemaWithPopulatedKeys = CustomListItemSchema & {
3772
+ custom_list?: string | CustomList.CustomListSchema;
3773
+ cover_photo?: string | MediaStorage.MediaStorageSchema;
3774
+ };
3775
+ type PopulatedKeys = "custom_list" | "cover_photo";
3776
+ export namespace Find {
3777
+ type Params = DefaultPaginationQueryParams & {
3778
+ _id?: string[] | string;
3779
+ custom_list?: string;
3780
+ from_updatedAt?: number;
3781
+ [key: string]: any;
3782
+ populatedKeys?: PopulatedKeys[];
3783
+ };
3784
+ interface Result extends DefaultPaginationResult {
3785
+ data: CustomListItemSchemaWithPopulatedKeys[];
3786
+ }
3787
+ }
3788
+ export namespace Get {
3789
+ type ID = string;
3790
+ interface Params {}
3791
+ type Result = CustomListItemSchema;
3792
+ }
3793
+ export namespace Create {
3794
+ type Body = CreateBody;
3795
+ type Result = CustomListItemSchema;
3796
+ }
3797
+ export namespace Update {
3798
+ type ID = string;
3799
+ type Body = UpdateBody;
3800
+ type Result = CustomListItemSchema;
3801
+ }
3802
+ export namespace Remove {
3803
+ type ID = string;
3804
+ type Result = CustomListItemSchema;
3805
+ }
3806
+ export {};
3807
+ }
3372
3808
  namespace ReturnReason {
3373
3809
  interface Schema {
3374
3810
  _id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1497,6 +1497,121 @@ export default class Repzo {
1497
1497
  return res;
1498
1498
  },
1499
1499
  };
1500
+
1501
+ customList = {
1502
+ _path: "/custom-list",
1503
+ find: async (
1504
+ params?: Service.CustomList.Find.Params
1505
+ ): Promise<Service.CustomList.Find.Result> => {
1506
+ let res: Service.CustomList.Find.Result = await this._fetch(
1507
+ this.svAPIEndpoint,
1508
+ this.customList._path,
1509
+ params
1510
+ );
1511
+ return res;
1512
+ },
1513
+
1514
+ get: async (
1515
+ id: Service.CustomList.Get.ID,
1516
+ params?: Service.CustomList.Get.Params
1517
+ ): Promise<Service.CustomList.Get.Result> => {
1518
+ return await this._fetch(
1519
+ this.svAPIEndpoint,
1520
+ this.customList._path + `/${id}`,
1521
+ params
1522
+ );
1523
+ },
1524
+
1525
+ create: async (
1526
+ body: Service.CustomList.Create.Body
1527
+ ): Promise<Service.CustomList.Create.Result> => {
1528
+ let res = await this._create(
1529
+ this.svAPIEndpoint,
1530
+ this.customList._path,
1531
+ body
1532
+ );
1533
+ return res;
1534
+ },
1535
+
1536
+ update: async (
1537
+ id: Service.CustomList.Update.ID,
1538
+ body: Service.CustomList.Update.Body
1539
+ ): Promise<Service.CustomList.Update.Result> => {
1540
+ let res: Service.CustomList.Update.Result = await this._update(
1541
+ this.svAPIEndpoint,
1542
+ this.customList._path + `/${id}`,
1543
+ body
1544
+ );
1545
+ return res;
1546
+ },
1547
+ remove: async (
1548
+ id: Service.CustomList.Remove.ID
1549
+ ): Promise<Service.CustomList.Remove.Result> => {
1550
+ let res: Service.CustomList.Remove.Result = await this._delete(
1551
+ this.svAPIEndpoint,
1552
+ this.customList._path + `/${id}`
1553
+ );
1554
+ return res;
1555
+ },
1556
+ };
1557
+
1558
+ customListItem = {
1559
+ _path: "/custom-list-item",
1560
+ find: async (
1561
+ params?: Service.CustomListItem.Find.Params
1562
+ ): Promise<Service.CustomListItem.Find.Result> => {
1563
+ let res: Service.CustomListItem.Find.Result = await this._fetch(
1564
+ this.svAPIEndpoint,
1565
+ this.customListItem._path,
1566
+ params
1567
+ );
1568
+ return res;
1569
+ },
1570
+
1571
+ get: async (
1572
+ id: Service.CustomListItem.Get.ID,
1573
+ params?: Service.CustomListItem.Get.Params
1574
+ ): Promise<Service.CustomListItem.Get.Result> => {
1575
+ return await this._fetch(
1576
+ this.svAPIEndpoint,
1577
+ this.customListItem._path + `/${id}`,
1578
+ params
1579
+ );
1580
+ },
1581
+
1582
+ create: async (
1583
+ body: Service.CustomListItem.Create.Body
1584
+ ): Promise<Service.CustomListItem.Create.Result> => {
1585
+ let res = await this._create(
1586
+ this.svAPIEndpoint,
1587
+ this.customListItem._path,
1588
+ body
1589
+ );
1590
+ return res;
1591
+ },
1592
+
1593
+ update: async (
1594
+ id: Service.CustomListItem.Update.ID,
1595
+ body: Service.CustomListItem.Update.Body
1596
+ ): Promise<Service.CustomListItem.Update.Result> => {
1597
+ let res: Service.CustomListItem.Update.Result = await this._update(
1598
+ this.svAPIEndpoint,
1599
+ this.customListItem._path + `/${id}`,
1600
+ body
1601
+ );
1602
+ return res;
1603
+ },
1604
+ remove: async (
1605
+ id: Service.CustomListItem.Remove.ID
1606
+ ): Promise<Service.CustomListItem.Remove.Result> => {
1607
+ let res: Service.CustomListItem.Remove.Result = await this._delete(
1608
+ this.svAPIEndpoint,
1609
+ this.customListItem._path + `/${id}`
1610
+ );
1611
+ return res;
1612
+ },
1613
+ };
1614
+
1500
1615
  workorder = {
1501
1616
  _path: "/workorder",
1502
1617
  find: async (
@@ -2268,6 +2383,54 @@ export default class Repzo {
2268
2383
  },
2269
2384
  };
2270
2385
 
2386
+ activityStorecheck = {
2387
+ _path: "/activity-storecheck",
2388
+ find: async (
2389
+ params?: Service.ActivityStorecheck.Find.Params
2390
+ ): Promise<Service.ActivityStorecheck.Find.Result> => {
2391
+ let res: Service.ActivityStorecheck.Find.Result = await this._fetch(
2392
+ this.svAPIEndpoint,
2393
+ this.activityStorecheck._path,
2394
+ params
2395
+ );
2396
+ return res;
2397
+ },
2398
+
2399
+ get: async (
2400
+ id: Service.ActivityStorecheck.Get.ID,
2401
+ params?: Service.ActivityStorecheck.Get.Params
2402
+ ): Promise<Service.ActivityStorecheck.Get.Result> => {
2403
+ return await this._fetch(
2404
+ this.svAPIEndpoint,
2405
+ this.activityStorecheck._path + `/${id}`,
2406
+ params
2407
+ );
2408
+ },
2409
+
2410
+ create: async (
2411
+ body: Service.ActivityStorecheck.Create.Body
2412
+ ): Promise<Service.ActivityStorecheck.Create.Result> => {
2413
+ let res = await this._create(
2414
+ this.svAPIEndpoint,
2415
+ this.activityStorecheck._path,
2416
+ body
2417
+ );
2418
+ return res;
2419
+ },
2420
+
2421
+ update: async (
2422
+ id: Service.ActivityStorecheck.Update.ID,
2423
+ body: Service.ActivityStorecheck.Update.Body
2424
+ ): Promise<Service.ActivityStorecheck.Update.Result> => {
2425
+ let res: Service.ActivityStorecheck.Update.Result = await this._update(
2426
+ this.svAPIEndpoint,
2427
+ this.activityStorecheck._path + `/${id}`,
2428
+ body
2429
+ );
2430
+ return res;
2431
+ },
2432
+ };
2433
+
2271
2434
  adjustInventory = {
2272
2435
  _path: "/adjust-inventory",
2273
2436
  find: async (
@@ -225,6 +225,18 @@ export type Day =
225
225
  | "Fri"
226
226
  | "Sat"
227
227
  | string;
228
+
229
+ export type FieldType =
230
+ | "Text"
231
+ | "String"
232
+ | "Date"
233
+ | "Image"
234
+ | "Boolean"
235
+ | "Number"
236
+ | "List"
237
+ | "Separator"
238
+ | "Heading"
239
+ | "Media";
228
240
  export interface WeeklyDetails {
229
241
  every: number;
230
242
  days: Day[];
@@ -377,6 +389,11 @@ export interface GeoTag {
377
389
  lng: number;
378
390
  formatted_address: string;
379
391
  }
392
+ interface GeoPoint {
393
+ type: "Point";
394
+ coordinates: number[];
395
+ }
396
+
380
397
  // <reference path = "vehicle.ts" />
381
398
  export namespace Service {
382
399
  export namespace Client {
@@ -1893,17 +1910,6 @@ export namespace Service {
1893
1910
  | "product-brand"
1894
1911
  | "product-group";
1895
1912
 
1896
- type FieldType =
1897
- | "Text"
1898
- | "String"
1899
- | "Date"
1900
- | "Image"
1901
- | "Boolean"
1902
- | "Number"
1903
- | "List"
1904
- | "Separator"
1905
- | "Heading"
1906
- | "Media";
1907
1913
  type DataType =
1908
1914
  | "Separator"
1909
1915
  | "timestamp"
@@ -2074,6 +2080,192 @@ export namespace Service {
2074
2080
  }
2075
2081
  }
2076
2082
 
2083
+ export namespace ActivityStorecheck {
2084
+ interface Field {
2085
+ _id?: string;
2086
+ name: string;
2087
+ type: FieldType;
2088
+ isArray: boolean;
2089
+ isRequired?: boolean;
2090
+ is_calculated_field?: boolean;
2091
+ formula_key?: string;
2092
+ parent_field?: string;
2093
+ custom_list?: string;
2094
+ field_id: string;
2095
+ result: any[];
2096
+ result_custom_list_ids?: any[];
2097
+ calculation_status?: "success" | "failed";
2098
+ calculation_error?: string | any[];
2099
+ company_namespace?: string[];
2100
+ }
2101
+ export interface Division {
2102
+ fields: Field[];
2103
+ }
2104
+ interface Result {
2105
+ source_id: string;
2106
+ source_name: string;
2107
+ divisions: Division[];
2108
+ }
2109
+ interface Entry {
2110
+ entry_id: string;
2111
+ source:
2112
+ | "product"
2113
+ | "variant"
2114
+ | "product-category"
2115
+ | "product-sub-category"
2116
+ | "product-brand"
2117
+ | "product-group";
2118
+ results: Result[];
2119
+ }
2120
+ export interface ActivityStorecheckSchema {
2121
+ _id: string;
2122
+ company_namespace: string[];
2123
+ client: string;
2124
+ client_name: string;
2125
+ sync_id: string;
2126
+ time_zone: string;
2127
+ template_id: string;
2128
+ visit?: string;
2129
+ visit_id: string;
2130
+ battery_level?: number;
2131
+ user: string;
2132
+ user_name: string;
2133
+ time: number;
2134
+ geo_tag?: GeoTag;
2135
+ geoPoint: GeoPoint;
2136
+ teams?: string[];
2137
+ route?: string;
2138
+ tags?: string[];
2139
+ entries: Entry[];
2140
+ platform?: string;
2141
+ version_name?: string;
2142
+ device_brand?: string;
2143
+ device_os?: string;
2144
+ device_os_version?: string;
2145
+ device_model?: string;
2146
+ identifier?: number;
2147
+ device_id?: string;
2148
+ device_unique_id?: string;
2149
+ network_state?: number;
2150
+ serial_number?: SerialNumber;
2151
+ job_start_time?: number;
2152
+ job_end_time?: number;
2153
+ job_duration?: number;
2154
+ }
2155
+
2156
+ export interface CreateBody {
2157
+ company_namespace: string[];
2158
+ client: string;
2159
+ client_name: string;
2160
+ time_zone: string;
2161
+ template_id: string;
2162
+ visit?: string;
2163
+ visit_id: string;
2164
+ user: string;
2165
+ user_name: string;
2166
+ time: number;
2167
+ geo_tag?: GeoTag;
2168
+ geoPoint: GeoPoint;
2169
+ teams?: string[];
2170
+ route?: string;
2171
+ tags?: string[];
2172
+ entries: Entry[];
2173
+ }
2174
+ export interface UpdateBody {
2175
+ _id?: string;
2176
+ company_namespace?: string[];
2177
+ client?: string;
2178
+ client_name?: string;
2179
+ sync_id?: string;
2180
+ time_zone?: string;
2181
+ template_id?: string;
2182
+ visit?: string;
2183
+ visit_id?: string;
2184
+ battery_level?: number;
2185
+ user?: string;
2186
+ user_name?: string;
2187
+ time?: number;
2188
+ geo_tag?: GeoTag;
2189
+ geoPoint?: GeoPoint;
2190
+ teams?: string[];
2191
+ route?: string;
2192
+ tags?: string[];
2193
+ entries?: Entry[];
2194
+ platform?: string;
2195
+ version_name?: string;
2196
+ device_brand?: string;
2197
+ device_os?: string;
2198
+ device_os_version?: string;
2199
+ device_model?: string;
2200
+ identifier?: number;
2201
+ device_id?: string;
2202
+ device_unique_id?: string;
2203
+ network_state?: number;
2204
+ serial_number?: SerialNumber;
2205
+ job_start_time?: number;
2206
+ job_end_time?: number;
2207
+ job_duration?: number;
2208
+ }
2209
+ type PopulatedKeys =
2210
+ | "teams"
2211
+ | "tags"
2212
+ | "client"
2213
+ | "user"
2214
+ | "route"
2215
+ | "visit"
2216
+ | "template_id";
2217
+
2218
+ export type ActivityStoreCheckWithPopulatedKeysSchema = ActivityStorecheckSchema & {
2219
+ teams_populated: Team.TeamSchema[] | string[];
2220
+ tags_populated: Tag.TagSchema[] | string[];
2221
+ client_populated: Client.ClientSchema | string;
2222
+ user_populated: Rep.RepSchema | string;
2223
+ route_populated: Route.RouteSchema | string;
2224
+ visit_populated: Visit.VisitSchema | string;
2225
+ template_id_populated:
2226
+ | StorecheckTemplate.StorecheckTemplateSchema
2227
+ | string;
2228
+ };
2229
+
2230
+ export namespace Find {
2231
+ export type Params = DefaultPaginationQueryParams & {
2232
+ _id?: string[] | string;
2233
+ search?: string;
2234
+ name?: string[] | string;
2235
+ local_name?: string[] | string;
2236
+ disabled?: boolean;
2237
+ from_updatedAt?: number;
2238
+ from_time?: number;
2239
+ to_time?: number;
2240
+ client?: string;
2241
+ user?: string;
2242
+ tags?: string[];
2243
+ template_id?: string;
2244
+ teams?: string[];
2245
+ route?: string;
2246
+ populatedKeys?: PopulatedKeys[];
2247
+ [key: string]: any;
2248
+ };
2249
+ export interface Result extends DefaultPaginationResult {
2250
+ data: ActivityStoreCheckWithPopulatedKeysSchema[];
2251
+ }
2252
+ }
2253
+ export namespace Get {
2254
+ export type ID = string;
2255
+ export interface Params {}
2256
+ export type Result = ActivityStorecheckSchema;
2257
+ }
2258
+ export namespace Create {
2259
+ export type Body = CreateBody;
2260
+ export type Result = ActivityStorecheckSchema;
2261
+ }
2262
+ export namespace Update {
2263
+ export type ID = string;
2264
+ export type Body = UpdateBody;
2265
+ export type Result = ActivityStorecheckSchema;
2266
+ }
2267
+ }
2268
+
2077
2269
  export namespace Msl {
2078
2270
  export interface MslSchema {
2079
2271
  _id: string;
@@ -3425,6 +3617,255 @@ export namespace Service {
3425
3617
  }
3426
3618
  }
3427
3619
 
3620
+ export namespace CustomList {
3621
+ interface EndPoint {
3622
+ _id?: string;
3623
+ is_read?: boolean;
3624
+ input_type?: "List";
3625
+ render_key?: string;
3626
+ filter_key?: "_id";
3627
+ type?: "String" | "Array" | "Number" | "Boolean";
3628
+ path?: string;
3629
+ method?: "get" | "post" | "put" | "patch" | "delete";
3630
+ body?: { [key: string]: any };
3631
+ search?: boolean;
3632
+ multi_select?: boolean;
3633
+ }
3634
+ interface Source {
3635
+ source_id: string;
3636
+ company_namespace: string[];
3637
+ photo?: string;
3638
+ source_name: string;
3639
+ source_local_name?: string;
3640
+ }
3641
+ interface Filter {
3642
+ key: string;
3643
+ value: any[];
3644
+ operator:
3645
+ | "lte"
3646
+ | "lt"
3647
+ | "gte"
3648
+ | "gt"
3649
+ | "eq"
3650
+ | "ne"
3651
+ | "in"
3652
+ | "nin"
3653
+ | "search";
3654
+ id?: string;
3655
+ }
3656
+ interface Element {
3657
+ _id: string;
3658
+ name: string;
3659
+ type: "Number" | "String";
3660
+ key?: string;
3661
+ is_required?: boolean;
3662
+ isArray?: boolean;
3663
+ disabled: boolean;
3664
+ manipulator_function?: string;
3665
+ }
3666
+ export interface CustomListSchema {
3667
+ _id: string;
3668
+ code: string;
3669
+ name: string;
3670
+ local_name?: string;
3671
+ disabled: boolean;
3672
+ type: "reference" | "template"; //| "items_list"
3673
+ filters: Filter[];
3674
+ list_type: "String" | "Number";
3675
+ source:
3676
+ | "product"
3677
+ | "variant"
3678
+ | "product-category"
3679
+ | "product-sub-category"
3680
+ | "client"
3681
+ | "measureunits"
3682
+ | "tag"
3683
+ | "paymentterms"
3684
+ | "client-channel"
3685
+ | "speciality"
3686
+ | "rep";
3687
+ template_elements: Element[];
3688
+ company_namespace: string[];
3689
+ sources?: Source[];
3690
+ can_edit_types?: boolean;
3691
+ end_point: EndPoint;
3692
+ createdAt: string;
3693
+ updatedAt: string;
3694
+ }
3695
+ export interface CreateBody {
3696
+ code: string;
3697
+ name: string;
3698
+ local_name?: string;
3699
+ disabled: boolean;
3700
+ type: "reference" | "template"; //| "items_list"
3701
+ filters: Filter[];
3702
+ list_type: "String" | "Number";
3703
+ source:
3704
+ | "product"
3705
+ | "variant"
3706
+ | "product-category"
3707
+ | "product-sub-category"
3708
+ | "client"
3709
+ | "measureunits"
3710
+ | "tag"
3711
+ | "paymentterms"
3712
+ | "client-channel"
3713
+ | "speciality"
3714
+ | "rep";
3715
+ template_elements: Element[];
3716
+ company_namespace: string[];
3717
+ sources?: Source[];
3718
+ can_edit_types?: boolean;
3719
+ end_point: EndPoint;
3720
+ }
3721
+ export interface UpdateBody {
3722
+ _id?: string;
3723
+ code?: string;
3724
+ name?: string;
3725
+ local_name?: string;
3726
+ disabled?: boolean;
3727
+ type?: "reference" | "template"; //| "items_list"
3728
+ filters?: Filter[];
3729
+ list_type?: "String" | "Number";
3730
+ source?:
3731
+ | "product"
3732
+ | "variant"
3733
+ | "product-category"
3734
+ | "product-sub-category"
3735
+ | "client"
3736
+ | "measureunits"
3737
+ | "tag"
3738
+ | "paymentterms"
3739
+ | "client-channel"
3740
+ | "speciality"
3741
+ | "rep";
3742
+ template_elements?: Element[];
3743
+ company_namespace?: string[];
3744
+ sources?: Source[];
3745
+ can_edit_types?: boolean;
3746
+ end_point: EndPoint;
3747
+ }
3748
+ export namespace Find {
3749
+ export type Params = DefaultPaginationQueryParams & {
3750
+ _id?: string[] | string;
3751
+ name?: string[] | string;
3752
+ type?: string;
3753
+ code?: string;
3754
+ from_updatedAt?: number;
3755
+ [key: string]: any; // integration_meta.
3756
+ };
3757
+ export interface Result extends DefaultPaginationResult {
3758
+ data: CustomListSchema[];
3759
+ }
3760
+ }
3761
+
3762
+ export namespace Get {
3763
+ export type ID = string;
3764
+ export interface Params {}
3765
+ export type Result = CustomListSchema;
3766
+ }
3767
+ export namespace Create {
3768
+ export type Body = CreateBody;
3769
+ export type Result = CustomListSchema;
3770
+ }
3771
+ export namespace Update {
3772
+ export type ID = string;
3773
+ export type Body = UpdateBody;
3774
+ export type Result = CustomListSchema;
3775
+ }
3776
+ export namespace Remove {
3777
+ export type ID = string;
3778
+ export type Result = CustomListSchema;
3779
+ }
3780
+ }
3781
+
3782
+ export namespace CustomListItem {
3783
+ type CustomItemType = "String" | "Number";
3784
+
3785
+ interface CustomListItemElementModel {
3786
+ _id: string;
3787
+ template_element: string;
3788
+ value: string | number;
3789
+ name: string;
3790
+ type: CustomItemType;
3791
+ }
3792
+ export interface CustomListItemSchema {
3793
+ _id: string;
3794
+ disabled: boolean;
3795
+ custom_list: string;
3796
+ type: CustomItemType;
3797
+ value: string | number;
3798
+ photo?: string;
3799
+ media?: string[];
3800
+ position?: number;
3801
+ elements: CustomListItemElementModel[];
3802
+ score?: number;
3803
+ company_namespace: string[];
3804
+ createdAt: string;
3805
+ updatedAt: string;
3806
+ }
3807
+ export interface CreateBody {
3808
+ disabled: boolean;
3809
+ custom_list: string;
3810
+ type: CustomItemType;
3811
+ value: string | number;
3812
+ photo?: string;
3813
+ media?: string[];
3814
+ position?: number;
3815
+ elements: CustomListItemElementModel[];
3816
+ score?: number;
3817
+ company_namespace: string[];
3818
+ }
3819
+ export interface UpdateBody {
3820
+ _id?: string;
3821
+ disabled?: boolean;
3822
+ custom_list?: string;
3823
+ type?: CustomItemType;
3824
+ value?: string | number;
3825
+ photo?: string;
3826
+ media?: string[];
3827
+ position?: number;
3828
+ elements?: CustomListItemElementModel[];
3829
+ score?: number;
3830
+ company_namespace?: string[];
3831
+ }
3832
+ type CustomListItemSchemaWithPopulatedKeys = CustomListItemSchema & {
3833
+ custom_list?: string | CustomList.CustomListSchema;
3834
+ cover_photo?: string | MediaStorage.MediaStorageSchema;
3835
+ };
3836
+ type PopulatedKeys = "custom_list" | "cover_photo";
3837
+ export namespace Find {
3838
+ export type Params = DefaultPaginationQueryParams & {
3839
+ _id?: string[] | string;
3840
+ custom_list?: string;
3841
+ from_updatedAt?: number;
3842
+ [key: string]: any; // integration_meta.
3843
+ populatedKeys?: PopulatedKeys[];
3844
+ };
3845
+ export interface Result extends DefaultPaginationResult {
3846
+ data: CustomListItemSchemaWithPopulatedKeys[];
3847
+ }
3848
+ }
3849
+ export namespace Get {
3850
+ export type ID = string;
3851
+ export interface Params {}
3852
+ export type Result = CustomListItemSchema;
3853
+ }
3854
+ export namespace Create {
3855
+ export type Body = CreateBody;
3856
+ export type Result = CustomListItemSchema;
3857
+ }
3858
+ export namespace Update {
3859
+ export type ID = string;
3860
+ export type Body = UpdateBody;
3861
+ export type Result = CustomListItemSchema;
3862
+ }
3863
+ export namespace Remove {
3864
+ export type ID = string;
3865
+ export type Result = CustomListItemSchema;
3866
+ }
3867
+ }
3868
+
3428
3869
  export namespace ReturnReason {
3429
3870
  export interface Schema {
3430
3871
  _id: string;