repzo 1.0.46 → 1.0.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1041,6 +1041,103 @@ export default class Repzo {
1041
1041
  },
1042
1042
  };
1043
1043
 
1044
+ route = {
1045
+ _path: "/route",
1046
+ find: async (
1047
+ params?: Service.Route.Find.Params
1048
+ ): Promise<Service.Route.Find.Result> => {
1049
+ let res: Service.Route.Find.Result = await this._fetch(
1050
+ this.svAPIEndpoint,
1051
+ this.route._path,
1052
+ params
1053
+ );
1054
+ return res;
1055
+ },
1056
+ get: async (
1057
+ id: Service.Route.Get.ID
1058
+ ): Promise<Service.Route.Get.Result> => {
1059
+ return await this._fetch(this.svAPIEndpoint, this.route._path + `/${id}`);
1060
+ },
1061
+ create: async (
1062
+ body: Service.Route.Create.Body
1063
+ ): Promise<Service.Route.Create.Result> => {
1064
+ let res = await this._create(this.svAPIEndpoint, this.route._path, body);
1065
+ return res;
1066
+ },
1067
+ update: async (
1068
+ id: Service.Route.Update.ID,
1069
+ body: Service.Route.Update.Body
1070
+ ): Promise<Service.Route.Update.Result> => {
1071
+ let res: Service.Route.Update.Result = await this._update(
1072
+ this.svAPIEndpoint,
1073
+ this.route._path + `/${id}`,
1074
+ body
1075
+ );
1076
+ return res;
1077
+ },
1078
+ remove: async (
1079
+ id: Service.Route.Remove.ID
1080
+ ): Promise<Service.Route.Remove.Result> => {
1081
+ let res: Service.Route.Remove.Result = await this._delete(
1082
+ this.svAPIEndpoint,
1083
+ this.route._path + `/${id}`
1084
+ );
1085
+ return res;
1086
+ },
1087
+ };
1088
+
1089
+ productModifiersGroup = {
1090
+ _path: "/product-modifiers-group",
1091
+ find: async (
1092
+ params?: Service.ProductModifiersGroup.Find.Params
1093
+ ): Promise<Service.ProductModifiersGroup.Find.Result> => {
1094
+ let res: Service.ProductModifiersGroup.Find.Result = await this._fetch(
1095
+ this.svAPIEndpoint,
1096
+ this.productModifiersGroup._path,
1097
+ params
1098
+ );
1099
+ return res;
1100
+ },
1101
+ get: async (
1102
+ id: Service.ProductModifiersGroup.Get.ID
1103
+ ): Promise<Service.ProductModifiersGroup.Get.Result> => {
1104
+ return await this._fetch(
1105
+ this.svAPIEndpoint,
1106
+ this.productModifiersGroup._path + `/${id}`
1107
+ );
1108
+ },
1109
+ create: async (
1110
+ body: Service.ProductModifiersGroup.Create.Body
1111
+ ): Promise<Service.ProductModifiersGroup.Create.Result> => {
1112
+ let res = await this._create(
1113
+ this.svAPIEndpoint,
1114
+ this.productModifiersGroup._path,
1115
+ body
1116
+ );
1117
+ return res;
1118
+ },
1119
+ update: async (
1120
+ id: Service.ProductModifiersGroup.Update.ID,
1121
+ body: Service.ProductModifiersGroup.Update.Body
1122
+ ): Promise<Service.ProductModifiersGroup.Update.Result> => {
1123
+ let res: Service.ProductModifiersGroup.Update.Result = await this._update(
1124
+ this.svAPIEndpoint,
1125
+ this.productModifiersGroup._path + `/${id}`,
1126
+ body
1127
+ );
1128
+ return res;
1129
+ },
1130
+ remove: async (
1131
+ id: Service.ProductModifiersGroup.Remove.ID
1132
+ ): Promise<Service.ProductModifiersGroup.Remove.Result> => {
1133
+ let res: Service.ProductModifiersGroup.Remove.Result = await this._delete(
1134
+ this.svAPIEndpoint,
1135
+ this.productModifiersGroup._path + `/${id}`
1136
+ );
1137
+ return res;
1138
+ },
1139
+ };
1140
+
1044
1141
  channel = {
1045
1142
  _path: "/client-channel",
1046
1143
  find: async (
@@ -868,8 +868,14 @@ export namespace Service {
868
868
  modifiers_groups?: string[];
869
869
  integration_meta?: { [key: string]: any };
870
870
  }
871
- type PopulatedKeys = "product";
871
+ type PopulatedKeys = "product" | "modifiers_groups";
872
872
 
873
+ type VariantWithPopulatedKeys = VariantSchema & {
874
+ modifiers_groups?:
875
+ | string[]
876
+ | ProductModifiersGroup.ProductModifiersGroupSchema[];
877
+ product?: string | Product.ProductSchema;
878
+ };
873
879
  export namespace Find {
874
880
  export type Params = DefaultPaginationQueryParams & {
875
881
  _id?: string[] | string;
@@ -884,6 +890,7 @@ export namespace Service {
884
890
  position?: number[] | number;
885
891
  createdAt?: number;
886
892
  updatedAt?: number;
893
+ from_updatedAt?: number;
887
894
  default?: boolean;
888
895
  category?: string[] | string;
889
896
  subCategory?: string[] | string;
@@ -891,10 +898,11 @@ export namespace Service {
891
898
  productGroup?: string[] | string;
892
899
  teams?: string[] | string;
893
900
  withProduct?: boolean;
901
+ populatedKeys?: PopulatedKeys[];
894
902
  [key: string]: any; // integration_meta.
895
903
  };
896
904
  export interface Result extends DefaultPaginationResult {
897
- data: VariantSchema[];
905
+ data: VariantWithPopulatedKeys[];
898
906
  }
899
907
  }
900
908
 
@@ -2208,6 +2216,87 @@ export namespace Service {
2208
2216
  }
2209
2217
  }
2210
2218
 
2219
+ export namespace Route {
2220
+ export interface RouteSchema {
2221
+ _id: string;
2222
+ name: string;
2223
+ disabled: boolean;
2224
+ sync_id: string;
2225
+ force_sequence: boolean;
2226
+ editor: AdminCreator;
2227
+ list: List[];
2228
+ company_namespace: string[];
2229
+ createdAt: string;
2230
+ updatedAt: string;
2231
+ }
2232
+ export interface RouteBody {
2233
+ name?: string;
2234
+ disabled?: boolean;
2235
+ sync_id?: string;
2236
+ force_sequence?: boolean;
2237
+ editor?: AdminCreator;
2238
+ list?: List[];
2239
+ company_namespace?: string[];
2240
+ }
2241
+ type PopulatedKeys = "client" | "list.client";
2242
+ interface List {
2243
+ client: string;
2244
+ from?: string;
2245
+ to?: string;
2246
+ }
2247
+
2248
+ export type RouteWithPopulatedKeysSchema = RouteSchema & {
2249
+ "list.client"?:
2250
+ | string[]
2251
+ | {
2252
+ client: string | Pick<Client.ClientSchema, "name" | "lat" | "lng">;
2253
+ from?: string;
2254
+ to?: string;
2255
+ }[];
2256
+ };
2257
+ export namespace Find {
2258
+ export type Params = DefaultPaginationQueryParams & {
2259
+ _id?: string[] | string;
2260
+ name?: string[] | string;
2261
+ disabled?: boolean;
2262
+ from_updatedAt?: number;
2263
+ populatedKeys?: PopulatedKeys[];
2264
+ };
2265
+ export interface Result extends DefaultPaginationResult {
2266
+ data: RouteWithPopulatedKeysSchema[];
2267
+ }
2268
+ }
2269
+ export namespace Get {
2270
+ export type ID = string;
2271
+ export type Result = RouteSchema;
2272
+ }
2273
+
2274
+ export namespace Create {
2275
+ export interface Body extends RouteBody {
2276
+ name: string;
2277
+ force_sequence: boolean;
2278
+ list: List[];
2279
+ sync_id: string;
2280
+ }
2281
+ export type Result = RouteSchema;
2282
+ }
2283
+
2284
+ export namespace Update {
2285
+ export type ID = string;
2286
+ export interface Body extends RouteBody {
2287
+ _id?: string;
2288
+ createdAt?: string;
2289
+ updatedAt?: string;
2290
+ __v?: number;
2291
+ }
2292
+ export type Result = RouteSchema;
2293
+ }
2294
+ export namespace Remove {
2295
+ export type ID = string;
2296
+ export type Result = RouteSchema;
2297
+ }
2298
+ }
2299
+
2211
2300
  export namespace Warehouse {
2212
2301
  type WarehouseType = "van" | "main" | "origin";
2213
2302
  export interface WarehouseSchema {
@@ -2230,7 +2319,12 @@ export namespace Service {
2230
2319
  integration_meta?: { [key: string]: any };
2231
2320
  company_namespace?: string[];
2232
2321
  }
2233
- type PopulatedKeys = "rep_id";
2322
+ type PopulatedKeys = "rep_id" | "teams";
2323
+
2324
+ export type WarehouseWithPopulatedKeysSchema = WarehouseSchema & {
2325
+ rep_id?: string[] | Pick<Rep.RepSchema, "_id" | "name">[];
2326
+ teams_populated?: string[] | Team.TeamSchema[];
2327
+ };
2234
2328
  export namespace Find {
2235
2329
  export type Params = DefaultPaginationQueryParams & {
2236
2330
  _id?: string[] | string;
@@ -2244,9 +2338,7 @@ export namespace Service {
2244
2338
  populatedKeys?: PopulatedKeys[];
2245
2339
  };
2246
2340
  export interface Result extends DefaultPaginationResult {
2247
- data: (WarehouseSchema & {
2248
- rep_id?: Pick<Rep.RepSchema, "_id" | "name">;
2249
- })[];
2341
+ data: WarehouseWithPopulatedKeysSchema[];
2250
2342
  }
2251
2343
  }
2252
2344
 
@@ -2280,6 +2372,69 @@ export namespace Service {
2280
2372
  }
2281
2373
  }
2282
2374
 
2375
+ export namespace ProductModifiersGroup {
2376
+ export interface ProductModifiersGroupSchema {
2377
+ _id: string;
2378
+ name: string;
2379
+ disabled: boolean;
2380
+ local_name?: string;
2381
+ position: number;
2382
+ multiple_modifiers: boolean;
2383
+ company_namespace: string[];
2384
+ createdAt: string;
2385
+ updatedAt: string;
2386
+ __v: number;
2387
+ }
2388
+ export interface ProductModifiersGroupBody {
2389
+ name?: string;
2390
+ disabled?: boolean;
2391
+ local_name?: string;
2392
+ position?: number;
2393
+ multiple_modifiers?: boolean;
2394
+ company_namespace?: string[];
2395
+ }
2396
+ export namespace Find {
2397
+ export type Params = DefaultPaginationQueryParams & {
2398
+ _id?: string[] | string;
2399
+ search?: string;
2400
+ name?: string[] | string;
2401
+ local_name?: string[] | string;
2402
+ disabled?: boolean;
2403
+ from_updatedAt?: number;
2404
+ };
2405
+ export interface Result extends DefaultPaginationResult {
2406
+ data: ProductModifiersGroupSchema[];
2407
+ }
2408
+ }
2409
+ export namespace Get {
2410
+ export type ID = string;
2411
+ export type Result = ProductModifiersGroupSchema;
2412
+ }
2413
+
2414
+ export namespace Create {
2415
+ export interface Body extends ProductModifiersGroupBody {
2416
+ name: string;
2417
+ position: number;
2418
+ multiple_modifiers: boolean;
2419
+ }
2420
+ export type Result = ProductModifiersGroupSchema;
2421
+ }
2422
+ export namespace Update {
2423
+ export type ID = string;
2424
+ export interface Body extends ProductModifiersGroupBody {
2425
+ _id?: string;
2426
+ createdAt?: string;
2427
+ updatedAt?: string;
2428
+ __v?: number;
2429
+ }
2430
+ export type Result = ProductModifiersGroupSchema;
2431
+ }
2432
+ export namespace Remove {
2433
+ export type ID = string;
2434
+ export type Result = ProductModifiersGroupSchema;
2435
+ }
2436
+ }
2437
+
2283
2438
  export namespace Channel {
2284
2439
  export interface ChannelSchema {
2285
2440
  _id: string;