@bringg/dashboard-sdk 0.16.3 → 0.17.0

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.
@@ -6,5 +6,6 @@ declare class PlannedRoutesEntity extends StoreEntity<Bringg.PlannedRoute> {
6
6
  constructor(session: Session);
7
7
  getAll(): Promise<any>;
8
8
  getAllByTeam(teamId: number): Promise<Bringg.PlannedRoute[]>;
9
+ getBatchByTeamIds(team_ids: number[]): Promise<Bringg.PlannedRoute[]>;
9
10
  }
10
11
  export default PlannedRoutesEntity;
@@ -21,7 +21,8 @@ var StoreEntity_1 = require("../../Core/StoreEntity");
21
21
  var extractor = function (response) { return response.planned_routes; };
22
22
  exports.extractor = extractor;
23
23
  var Routes = {
24
- GET_PLANNED_ROUTES_BY_TEAM: '/teams/{:teamId}/planned_routes'
24
+ GET_PLANNED_ROUTES_BY_TEAM: '/teams/{:teamId}/planned_routes',
25
+ GET_BATCH_BY_TEAM_IDS: '/planned_routes/batch_get'
25
26
  };
26
27
  var PlannedRoutesEntity = /** @class */ (function (_super) {
27
28
  __extends(PlannedRoutesEntity, _super);
@@ -43,6 +44,14 @@ var PlannedRoutesEntity = /** @class */ (function (_super) {
43
44
  .withRouteParams({ teamId: teamId })
44
45
  .invoke();
45
46
  };
47
+ PlannedRoutesEntity.prototype.getBatchByTeamIds = function (team_ids) {
48
+ return this.service.routeGenerator
49
+ .get(Routes.GET_BATCH_BY_TEAM_IDS)
50
+ .withExtractor(exports.extractor)
51
+ .setException("Could not fetch planned routes for the teams " + team_ids.toString())
52
+ .withQueryString({ team_ids: team_ids })
53
+ .invoke();
54
+ };
46
55
  return PlannedRoutesEntity;
47
56
  }(StoreEntity_1.default));
48
57
  exports.default = PlannedRoutesEntity;
@@ -1 +1 @@
1
- {"version":3,"file":"PlannedRoutesEntity.js","sourceRoot":"","sources":["../../../src/PlannedRoutes/Entity/PlannedRoutesEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;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,uCAAgC;IACjE,6BAAY,OAAgB;eAC3B,kBAAM;YACL,OAAO,SAAA;YACP,UAAU,EAAE,gBAAgB;YAC5B,MAAM,EAAE,CAAC,mBAAU,CAAC,MAAM,CAAC;SAC3B,CAAC;IACH,CAAC;IAED,oCAAM,GAAN;QACC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,iBAAS,EAAE,iBAAS,CAAC,CAAC;IACvD,CAAC;IAEM,0CAAY,GAAnB,UAAoB,MAAc;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc;aAChC,GAAG,CAAC,MAAM,CAAC,0BAA0B,CAAC;aACtC,aAAa,CAAC,iBAAS,CAAC;aACxB,YAAY,CAAC,iDAA+C,MAAQ,CAAC;aACrE,eAAe,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC;aAC3B,MAAM,EAAE,CAAC;IACZ,CAAC;IAEM,+CAAiB,GAAxB,UAAyB,QAAkB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc;aAChC,GAAG,CAAC,MAAM,CAAC,qBAAqB,CAAC;aACjC,aAAa,CAAC,iBAAS,CAAC;aACxB,YAAY,CAAC,kDAAgD,QAAQ,CAAC,QAAQ,EAAI,CAAC;aACnF,eAAe,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC;aAC7B,MAAM,EAAE,CAAC;IACZ,CAAC;IACF,0BAAC;AAAD,CAAC,AA9BD,CAAkC,qBAAW,GA8B5C;AAED,kBAAe,mBAAmB,CAAC"}
@@ -5,4 +5,5 @@ export default class PlannedRoutes {
5
5
  constructor(session: Session);
6
6
  getAllByTeam(teamId: number): Promise<PlannedRoute[]>;
7
7
  getAll(): Promise<PlannedRoute[]>;
8
+ getBatchByTeamIds(teamIds: number[]): Promise<PlannedRoute[]>;
8
9
  }
@@ -11,6 +11,9 @@ var PlannedRoutes = /** @class */ (function () {
11
11
  PlannedRoutes.prototype.getAll = function () {
12
12
  return this.plannedRoutesEntity.getAll();
13
13
  };
14
+ PlannedRoutes.prototype.getBatchByTeamIds = function (teamIds) {
15
+ return this.plannedRoutesEntity.getBatchByTeamIds(teamIds);
16
+ };
14
17
  return PlannedRoutes;
15
18
  }());
16
19
  exports.default = PlannedRoutes;
@@ -1 +1 @@
1
- {"version":3,"file":"PlannedRoutesApi.js","sourceRoot":"","sources":["../../src/PlannedRoutes/PlannedRoutesApi.ts"],"names":[],"mappings":";;AAEA,oEAA+D;AAE/D;IAGC,uBAAY,OAAgB;QAC3B,IAAI,CAAC,mBAAmB,GAAG,IAAI,6BAAmB,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAEM,oCAAY,GAAnB,UAAoB,MAAc;QACjC,OAAO,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAEM,8BAAM,GAAb;QACC,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;IACF,oBAAC;AAAD,CAAC,AAdD,IAcC"}
1
+ {"version":3,"file":"PlannedRoutesApi.js","sourceRoot":"","sources":["../../src/PlannedRoutes/PlannedRoutesApi.ts"],"names":[],"mappings":";;AAEA,oEAA+D;AAE/D;IAGC,uBAAY,OAAgB;QAC3B,IAAI,CAAC,mBAAmB,GAAG,IAAI,6BAAmB,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAEM,oCAAY,GAAnB,UAAoB,MAAc;QACjC,OAAO,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAEM,8BAAM,GAAb;QACC,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;IAEM,yCAAiB,GAAxB,UAAyB,OAAiB;QACzC,OAAO,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC;IACF,oBAAC;AAAD,CAAC,AAlBD,IAkBC"}
@@ -60,7 +60,14 @@ var ServicePlanSEntity = /** @class */ (function (_super) {
60
60
  return _super.call(this, {
61
61
  session: session,
62
62
  entityName: 'service_plans',
63
- routes: [Entity_1.BaseRoutes.Create, Entity_1.BaseRoutes.Get, Entity_1.BaseRoutes.Delete, Entity_1.BaseRoutes.GetAll]
63
+ routes: [
64
+ Entity_1.BaseRoutes.Get,
65
+ Entity_1.BaseRoutes.GetAll,
66
+ Entity_1.BaseRoutes.Update,
67
+ Entity_1.BaseRoutes.Create,
68
+ Entity_1.BaseRoutes.Delete,
69
+ Entity_1.BaseRoutes.Patch
70
+ ]
64
71
  }) || this;
65
72
  }
66
73
  ServicePlanSEntity.prototype.getAll = function () {
@@ -1 +1 @@
1
- {"version":3,"file":"ServicePlansEntity.js","sourceRoot":"","sources":["../../../src/ServicePlans/Entity/ServicePlansEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4CAA+C;AAE/C,sDAAiD;AACjD,8DAAmE;AAEnE;IAAgD,sCAA4B;IAC3E,4BAAY,OAAgB;eAC3B,kBAAM;YACL,OAAO,SAAA;YACP,UAAU,EAAE,eAAe;YAC3B,MAAM,EAAE,CAAC,mBAAU,CAAC,MAAM,EAAE,mBAAU,CAAC,GAAG,EAAE,mBAAU,CAAC,MAAM,EAAE,mBAAU,CAAC,MAAM,CAAC;SACjF,CAAC;IACH,CAAC;IACK,mCAAM,GAAZ;;;gBACC,sBAAO,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,+CAAyB,EAAE,+CAAyB,CAAC,EAAC;;;KACtF;IAEK,gCAAG,GAAT,UAAU,EAAU;;;gBACnB,sBAAO,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,+CAAyB,EAAE,+CAAyB,CAAC,EAAC;;;KACjF;IACF,yBAAC;AAAD,CAAC,AAfD,CAAgD,qBAAW,GAe1D"}
1
+ {"version":3,"file":"ServicePlansEntity.js","sourceRoot":"","sources":["../../../src/ServicePlans/Entity/ServicePlansEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4CAA+C;AAE/C,sDAAiD;AACjD,8DAAmE;AAGnE;IAAgD,sCAA4B;IAC3E,4BAAY,OAAgB;eAC3B,kBAAM;YACL,OAAO,SAAA;YACP,UAAU,EAAE,eAAe;YAC3B,MAAM,EAAE;gBACP,mBAAU,CAAC,GAAG;gBACd,mBAAU,CAAC,MAAM;gBACjB,mBAAU,CAAC,MAAM;gBACjB,mBAAU,CAAC,MAAM;gBACjB,mBAAU,CAAC,MAAM;gBACjB,mBAAU,CAAC,KAAK;aAChB;SACD,CAAC;IACH,CAAC;IACK,mCAAM,GAAZ;;;gBACC,sBAAO,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,+CAAyB,EAAE,+CAAyB,CAAC,EAAC;;;KACtF;IAEK,gCAAG,GAAT,UAAU,EAAU;;;gBACnB,sBAAO,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,+CAAyB,EAAE,+CAAyB,CAAC,EAAC;;;KACjF;IACF,yBAAC;AAAD,CAAC,AAtBD,CAAgD,qBAAW,GAsB1D"}
@@ -1,8 +1,13 @@
1
- import { ServicePlan as ServicePlanType } from '@bringg/types';
1
+ import { ServicePlan as ServicePlanType, Timestamp } from '@bringg/types';
2
2
  import Session from '../Services/Identity/Session';
3
+ import { Require } from '../utils/types/helper-types';
4
+ export declare type ServicePlanEntity = Require<Omit<ServicePlanType, keyof Timestamp | 'id'>, 'name'>;
3
5
  export default class ServicePlansApi {
4
6
  private servicePlansEntity;
5
7
  constructor(session: Session);
6
8
  getAll(): Promise<ServicePlanType[]>;
7
9
  get(id: number): Promise<ServicePlanType>;
10
+ create(servicePlan: ServicePlanEntity): Promise<ServicePlanType>;
11
+ update(id: number, servicePlan: ServicePlanEntity): Promise<ServicePlanType>;
12
+ delete(id: number): Promise<boolean>;
8
13
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var ServicePlansEntity_1 = require("./Entity/ServicePlansEntity");
4
+ var ServicePlans_consts_1 = require("./ServicePlans.consts");
4
5
  var ServicePlansApi = /** @class */ (function () {
5
6
  function ServicePlansApi(session) {
6
7
  this.servicePlansEntity = new ServicePlansEntity_1.default(session);
@@ -11,6 +12,15 @@ var ServicePlansApi = /** @class */ (function () {
11
12
  ServicePlansApi.prototype.get = function (id) {
12
13
  return this.servicePlansEntity.service.get(id);
13
14
  };
15
+ ServicePlansApi.prototype.create = function (servicePlan) {
16
+ return this.servicePlansEntity.service.create(servicePlan, ServicePlans_consts_1.planningResponseExtractor, ServicePlans_consts_1.planningResponseExtractor);
17
+ };
18
+ ServicePlansApi.prototype.update = function (id, servicePlan) {
19
+ return this.servicePlansEntity.service.update(id, servicePlan, ServicePlans_consts_1.planningResponseExtractor, ServicePlans_consts_1.planningResponseExtractor);
20
+ };
21
+ ServicePlansApi.prototype.delete = function (id) {
22
+ return this.servicePlansEntity.service.delete(id);
23
+ };
14
24
  return ServicePlansApi;
15
25
  }());
16
26
  exports.default = ServicePlansApi;
@@ -1 +1 @@
1
- {"version":3,"file":"ServicePlansApi.js","sourceRoot":"","sources":["../../src/ServicePlans/ServicePlansApi.ts"],"names":[],"mappings":";;AAEA,kEAA6D;AAE7D;IAGC,yBAAY,OAAgB;QAC3B,IAAI,CAAC,kBAAkB,GAAG,IAAI,4BAAkB,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAEM,gCAAM,GAAb;QACC,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IAEM,6BAAG,GAAV,UAAW,EAAU;QACpB,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACF,sBAAC;AAAD,CAAC,AAdD,IAcC"}
1
+ {"version":3,"file":"ServicePlansApi.js","sourceRoot":"","sources":["../../src/ServicePlans/ServicePlansApi.ts"],"names":[],"mappings":";;AAEA,kEAA6D;AAE7D,6DAAkE;AAIlE;IAGC,yBAAY,OAAgB;QAC3B,IAAI,CAAC,kBAAkB,GAAG,IAAI,4BAAkB,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAEM,gCAAM,GAAb;QACC,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IAEM,6BAAG,GAAV,UAAW,EAAU;QACpB,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IAEM,gCAAM,GAAb,UAAc,WAA8B;QAC3C,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAC5C,WAAW,EACX,+CAAyB,EACzB,+CAAyB,CACzB,CAAC;IACH,CAAC;IAEM,gCAAM,GAAb,UAAc,EAAU,EAAE,WAA8B;QACvD,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAC5C,EAAE,EACF,WAAW,EACX,+CAAyB,EACzB,+CAAyB,CACzB,CAAC;IACH,CAAC;IAEM,gCAAM,GAAb,UAAc,EAAU;QACvB,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;IACF,sBAAC;AAAD,CAAC,AAnCD,IAmCC"}
@@ -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 = '0.16.3';
55
+ var version = '0.17.0';
56
56
  function logErrorResponse(response) {
57
57
  var data = response.data, status = response.status;
58
58
  try {