@bringg/dashboard-sdk 1.4.3 → 1.4.4

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.
@@ -1,18 +1,16 @@
1
1
  import Session from '../Services/Identity/Session';
2
2
  import { DataEntity, DataOptions, GroupValue } from '../data-entity';
3
- import { PlannedDeliveryWindow, PlannedDeliveryWindowResponse, PlannedDeliveryWindowsFilterGroups, PlannedDeliveryWindowsResponse } from './planned-delivery-windows.consts';
3
+ import { PlannedDeliveryWindow, PlannedDeliveryWindowsFilterGroups } from './planned-delivery-windows.consts';
4
4
  export default class PlannedDeliveryWindowsApi {
5
5
  private readonly deliveryWindowsStore;
6
6
  private readonly deliveryWindowsService;
7
7
  private readonly storableDataService;
8
- load: <T extends DataEntity>(id: number, options?: DataOptions) => Promise<PlannedDeliveryWindowResponse>;
9
- loadAll: <T extends DataEntity>(options?: DataOptions) => Promise<PlannedDeliveryWindowsResponse>;
10
- loadAllByTeam: <T extends DataEntity>(teamId: number, options?: DataOptions) => Promise<PlannedDeliveryWindowsResponse>;
11
- create: (deliveryWindowsData: Partial<PlannedDeliveryWindow>[]) => Promise<PlannedDeliveryWindowsResponse>;
12
- delete: (id: number) => Promise<{
13
- success: boolean;
14
- }>;
15
- update: (id: number, deliveryWindow: Partial<PlannedDeliveryWindow>) => Promise<PlannedDeliveryWindowResponse>;
8
+ load: <T extends DataEntity>(id: number, options?: DataOptions) => Promise<PlannedDeliveryWindow>;
9
+ loadAll: <T extends DataEntity>(options?: DataOptions) => Promise<PlannedDeliveryWindow[]>;
10
+ loadAllByTeam: <T extends DataEntity>(teamId: number, options?: DataOptions) => Promise<PlannedDeliveryWindow[]>;
11
+ create: (deliveryWindowsData: Partial<PlannedDeliveryWindow>[]) => Promise<PlannedDeliveryWindow[]>;
12
+ delete: (id: number) => Promise<PlannedDeliveryWindow>;
13
+ update: (id: number, deliveryWindow: Partial<PlannedDeliveryWindow>) => Promise<PlannedDeliveryWindow>;
16
14
  constructor(session: Session);
17
15
  get(id: number): PlannedDeliveryWindow;
18
16
  getAll(): PlannedDeliveryWindow[];
@@ -1 +1 @@
1
- {"version":3,"file":"planned-delivery-windows-api.js","sourceRoot":"","sources":["../../src/PlannedDeliveryWindows/planned-delivery-windows-api.ts"],"names":[],"mappings":";;AAEA,4CAAsC;AACtC,uFAA+E;AAC/E,qFAK2C;AAC3C,kEAA2D;AAC3D,gEAAyD;AAEzD;IAkBC,mCAAY,OAAgB;QAC3B,IAAM,YAAY,GAAG;YACpB;gBACC,SAAS,EAAE,oEAAkC,CAAC,IAAI;gBAClD,OAAO,EAAE,UAAC,cAAqC,IAAK,OAAA,cAAc,CAAC,OAAO,EAAtB,CAAsB;aAC1E;SACD,CAAC;QACF,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAS,CAAwB,YAAY,CAAC,CAAC;QAC/E,IAAI,CAAC,sBAAsB,GAAG,IAAI,0CAA6B,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,CAAC,mBAAmB,GAAG,IAAI,+BAAmB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAE9E,MAAM,CAAC,MAAM,CACZ,IAAI,EACJ,8BAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,sBAAsB,EAAE;YAC/E,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAC5B,MAAM,EAAE,CAAC,QAAQ,CAAC;YAClB,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,OAAO,EAAE;gBACR,SAAS;gBACT;oBACC,MAAM,EAAE,eAAe;oBACvB,UAAU,EAAE,UAAC,MAAM;wBAClB,OAAO;4BACN,SAAS,EAAE,oEAAkC,CAAC,IAAI;4BAClD,UAAU,EAAE,MAAM;yBAClB,CAAC;oBACH,CAAC;iBACD;aACD;SACD,CAAC,CACF,CAAC;IACH,CAAC;IAEM,uCAAG,GAAV,UAAW,EAAU;QACpB,OAAO,IAAI,CAAC,o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Ae;oBACvB,UAAU,EAAE,UAAC,MAAM;wBAClB,OAAO;4BACN,SAAS,EAAE,oEAAkC,CAAC,IAAI;4BAClD,UAAU,EAAE,MAAM;yBAClB,CAAC;oBACH,CAAC;iBACD;aACD;SACD,CAAC,CACF,CAAC;IACH,CAAC;IAEM,uCAAG,GAAV,UAAW,EAAU;QACpB,OAAO,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAEM,0CAAM,GAAb;QACC,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC;IAC3C,CAAC;IAEM,4CAAQ,GAAf,UAAgB,KAAyC,EAAE,UAAsB;QAChF,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;IACF,gCAAC;AAAD,CAAC,AA3DD,IA2DC"}
@@ -1,6 +1,6 @@
1
1
  import { DELETE_RESPONSE } from '../Core/CrudService';
2
2
  import Session from '../Services/Identity/Session';
3
- import { PlannedDeliveryWindow, PlannedDeliveryWindowResponse } from './planned-delivery-windows.consts';
3
+ import { PlannedDeliveryWindow } from './planned-delivery-windows.consts';
4
4
  export declare const Routes: {
5
5
  GET_BY_TEAM: string;
6
6
  GET_ALL: string;
@@ -8,7 +8,7 @@ export declare const Routes: {
8
8
  export default class PlannedDeliveryWindowsService {
9
9
  private readonly service;
10
10
  constructor(session: Session);
11
- load(id: number): Promise<PlannedDeliveryWindowResponse>;
11
+ load(id: number): Promise<PlannedDeliveryWindow>;
12
12
  loadAll(): Promise<PlannedDeliveryWindow[]>;
13
13
  loadAllByTeam(teamId: number): Promise<PlannedDeliveryWindow[]>;
14
14
  create(deliveryWindows: Partial<PlannedDeliveryWindow>[]): Promise<PlannedDeliveryWindow[]>;
@@ -38,7 +38,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Routes = void 0;
40
40
  var CrudService_1 = require("../Core/CrudService");
41
- var planned_delivery_windows_consts_1 = require("./planned-delivery-windows.consts");
42
41
  var entityName = 'planned_delivery_windows';
43
42
  var prefix = 'merchant';
44
43
  var baseRoute = "/".concat(prefix, "/").concat(entityName);
@@ -52,8 +51,14 @@ var PlannedDeliveryWindowsService = /** @class */ (function () {
52
51
  }
53
52
  PlannedDeliveryWindowsService.prototype.load = function (id) {
54
53
  return __awaiter(this, void 0, void 0, function () {
54
+ var result;
55
55
  return __generator(this, function (_a) {
56
- return [2 /*return*/, this.service.get(id)];
56
+ switch (_a.label) {
57
+ case 0: return [4 /*yield*/, this.service.get(id)];
58
+ case 1:
59
+ result = _a.sent();
60
+ return [2 /*return*/, result.planned_delivery_window];
61
+ }
57
62
  });
58
63
  });
59
64
  };
@@ -77,7 +82,6 @@ var PlannedDeliveryWindowsService = /** @class */ (function () {
77
82
  switch (_a.label) {
78
83
  case 0: return [4 /*yield*/, this.service.routeGenerator
79
84
  .get(exports.Routes.GET_BY_TEAM)
80
- .withExtractor(planned_delivery_windows_consts_1.plannedDeliveryWindowsExtractor)
81
85
  .setException("failed to load delivery windows from team ".concat(teamId))
82
86
  .withRouteParams({ teamId: teamId })
83
87
  .invoke()];
@@ -1 +1 @@
1
- {"version":3,"file":"planned-delivery-windows-service.js","sourceRoot":"","sources":["../../src/PlannedDeliveryWindows/planned-delivery-windows-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmE;AAEnE,qFAK2C;AAE3C,IAAM,UAAU,GAAG,0BAA0B,CAAC;AAC9C,IAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,IAAM,SAAS,GAAG,WAAI,MAAM,cAAI,UAAU,CAAE,CAAC;AAEhC,QAAA,MAAM,GAAG;IACrB,WAAW,EAAE,UAAG,SAAS,uBAAoB;IAC7C,OAAO,EAAE,UAAG,SAAS,CAAE;CACvB,CAAC;AAEF;IAGC,uCAAY,O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M,CAAC,EAAE,CAAC,EAAC;;;KAC/B;IACF,oCAAC;AAAD,CAAC,AAvCD,IAuCC"}
1
+ {"version":3,"file":"planned-delivery-windows-service.js","sourceRoot":"","sources":["../../src/PlannedDeliveryWindows/planned-delivery-windows-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmE;AAQnE,IAAM,UAAU,GAAG,0BAA0B,CAAC;AAC9C,IAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,IAAM,SAAS,GAAG,WAAI,MAAM,cAAI,UAAU,CAAE,CAAC;AAEhC,QAAA,MAAM,GAAG;IACrB,WAAW,EAAE,UAAG,SAAS,uBAAoB;IAC7C,OAAO,EAAE,UAAG,SAAS,CAAE;CACvB,CAAC;AAEF;IAGC,uCAAY,OAAgB;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAW,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;IAEY,4CAAI,GAAjB,UAAkB,EAAU;;;;;4BACmB,qBAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAA;;wBAAlE,MAAM,GAAkC,SAA0B;wBACxE,sBAAO,MAAM,CAAC,uBAAuB,EAAC;;;;KACtC;IAEY,+CAAO,GAApB;;;;;4BACgD,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAA;;wBAApE,MAAM,GAAmC,SAA2B;wBAC1E,sBAAO,MAAM,CAAC,wBAAwB,EAAC;;;;KACvC;IAEY,qDAAa,GAA1B,UAA2B,MAAc;;;;;4BACO,qBAAM,IAAI,CAAC,OAAO,CAAC,cAAc;6BAC9E,GAAG,CAAC,cAAM,CAAC,WAAW,CAAC;6BACvB,YAAY,CAAC,oDAA6C,MAAM,CAAE,CAAC;6BACnE,eAAe,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC;6BAC3B,MAAM,EAAE,EAAA;;wBAJJ,MAAM,GAAmC,SAIrC;wBACV,sBAAO,MAAM,CAAC,wBAAwB,EAAC;;;;KACvC;IAEY,8CAAM,GAAnB,UAAoB,eAAiD;;;;;4BACrB,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,EAAA;;wBAAnF,MAAM,GAAmC,SAA0C;wBACzF,sBAAO,MAAM,CAAC,wBAAwB,EAAC;;;;KACvC;IAEY,8CAAM,GAAnB,UAAoB,EAAU,EAAE,cAA8C;;;;;4BAC/B,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,EAAA;;wBAArF,MAAM,GAAkC,SAA6C;wBAC3F,sBAAO,MAAM,CAAC,uBAAuB,EAAC;;;;KACtC;IAEY,8CAAM,GAAnB,UAAoB,EAAU;;;gBAC7B,sBAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAAC;;;KAC/B;IACF,oCAAC;AAAD,CAAC,AAvCD,IAuCC"}
@@ -21,4 +21,3 @@ export type PlannedDeliveryWindowResponse = {
21
21
  export declare enum PlannedDeliveryWindowsFilterGroups {
22
22
  Team = "team_id"
23
23
  }
24
- export declare const plannedDeliveryWindowsExtractor: (response: PlannedDeliveryWindowsResponse) => PlannedDeliveryWindow[];
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.plannedDeliveryWindowsExtractor = exports.PlannedDeliveryWindowsFilterGroups = void 0;
3
+ exports.PlannedDeliveryWindowsFilterGroups = void 0;
4
4
  var PlannedDeliveryWindowsFilterGroups;
5
5
  (function (PlannedDeliveryWindowsFilterGroups) {
6
6
  PlannedDeliveryWindowsFilterGroups["Team"] = "team_id";
7
7
  })(PlannedDeliveryWindowsFilterGroups = exports.PlannedDeliveryWindowsFilterGroups || (exports.PlannedDeliveryWindowsFilterGroups = {}));
8
- var plannedDeliveryWindowsExtractor = function (response) {
9
- return response.planned_delivery_windows;
10
- };
11
- exports.plannedDeliveryWindowsExtractor = plannedDeliveryWindowsExtractor;
12
8
  //# sourceMappingURL=planned-delivery-windows.consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"planned-delivery-windows.consts.js","sourceRoot":"","sources":["../../src/PlannedDeliveryWindows/planned-delivery-windows.consts.ts"],"names":[],"mappings":";;;AAuBA,IAAY,kCAEX;AAFD,WAAY,kCAAkC;IAC7C,sDAAgB,CAAA;AACjB,CAAC,EAFW,kCAAkC,GAAlC,0CAAkC,KAAlC,0CAAkC,QAE7C;AAEM,IAAM,+BAA+B,GAAG,UAAC,QAAwC;IACvF,OAAA,QAAQ,CAAC,wBAAwB;AAAjC,CAAiC,CAAC;AADtB,QAAA,+BAA+B,mCACT"}
1
+ {"version":3,"file":"planned-delivery-windows.consts.js","sourceRoot":"","sources":["../../src/PlannedDeliveryWindows/planned-delivery-windows.consts.ts"],"names":[],"mappings":";;;AAuBA,IAAY,kCAEX;AAFD,WAAY,kCAAkC;IAC7C,sDAAgB,CAAA;AACjB,CAAC,EAFW,kCAAkC,GAAlC,0CAAkC,KAAlC,0CAAkC,QAE7C"}
@@ -52,7 +52,7 @@ var axios_1 = require("axios");
52
52
  var Logger_1 = require("../Core/Logger");
53
53
  var lodash_1 = require("lodash");
54
54
  var BringgException_1 = require("../Core/BringgException");
55
- var version = '1.4.3';
55
+ var version = '1.4.4';
56
56
  function logErrorResponse(response) {
57
57
  var data = response.data, status = response.status;
58
58
  try {