btrz-api-client 5.132.0 → 5.133.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.
@@ -64,11 +64,41 @@ function operatingCompaniesFactory(_ref) {
64
64
  });
65
65
  }
66
66
 
67
+ var sequences = {
68
+ create: function create(_ref6) {
69
+ var jwtToken = _ref6.jwtToken,
70
+ token = _ref6.token,
71
+ operatingCompanyId = _ref6.operatingCompanyId,
72
+ sequence = _ref6.sequence,
73
+ headers = _ref6.headers;
74
+
75
+ return client({
76
+ url: "/operating-companies/" + operatingCompanyId + "/sequences",
77
+ method: "post",
78
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
79
+ data: sequence
80
+ });
81
+ },
82
+ all: function all(_ref7) {
83
+ var jwtToken = _ref7.jwtToken,
84
+ token = _ref7.token,
85
+ operatingCompanyId = _ref7.operatingCompanyId,
86
+ headers = _ref7.headers;
87
+
88
+ return client({
89
+ url: "/operating-companies/" + operatingCompanyId + "/sequences",
90
+ method: "get",
91
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
92
+ });
93
+ }
94
+ };
95
+
67
96
  return {
68
97
  all: all,
69
98
  create: create,
70
99
  update: update,
71
- get: get
100
+ get: get,
101
+ sequences: sequences
72
102
  };
73
103
  }
74
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "5.132.0",
3
+ "version": "5.133.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,7 +20,7 @@ function operatingCompaniesFactory({ client, internalAuthTokenProvider }) {
20
20
  }
21
21
 
22
22
  function update({ jwtToken, token, operatingCompanyId, operatingCompany, headers }) {
23
- return client({
23
+ return client({
24
24
  url: `/operating-companies/${operatingCompanyId}`,
25
25
  method: "put",
26
26
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
@@ -36,11 +36,30 @@ function operatingCompaniesFactory({ client, internalAuthTokenProvider }) {
36
36
  });
37
37
  }
38
38
 
39
+ const sequences = {
40
+ create({jwtToken, token, operatingCompanyId, sequence, headers}) {
41
+ return client({
42
+ url: `/operating-companies/${operatingCompanyId}/sequences`,
43
+ method: "post",
44
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
45
+ data: sequence
46
+ });
47
+ },
48
+ all({jwtToken, token, operatingCompanyId, headers}) {
49
+ return client({
50
+ url: `/operating-companies/${operatingCompanyId}/sequences`,
51
+ method: "get",
52
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
53
+ });
54
+ }
55
+ };
56
+
39
57
  return {
40
58
  all,
41
59
  create,
42
60
  update,
43
- get
61
+ get,
62
+ sequences
44
63
  };
45
64
  }
46
65
 
@@ -1,4 +1,5 @@
1
1
  const { axiosMock, expectRequest } = require("./../../test-helpers");
2
+ const {expect} = require("chai");
2
3
  const api = require("./../../../src/client").createApiClient({ baseURL: "http://test.com" });
3
4
 
4
5
  describe('inventory/operating-companies', () => {
@@ -55,4 +56,31 @@ describe('inventory/operating-companies', () => {
55
56
  operatingCompanyId
56
57
  });
57
58
  });
59
+
60
+ it("should create an operating company sequence", () => {
61
+ const operatingCompanyId = "1234";
62
+ const operatingCompanySequenceData = {};
63
+ // eslint-disable-next-line max-len
64
+ axiosMock.onPost(`/operating-companies/${operatingCompanyId}/sequences`).reply(expectRequest({statusCode: 200, token, jwtToken, body: operatingCompanySequenceData}));
65
+ return api.inventory.operatingCompanies.sequences.create({
66
+ jwtToken,
67
+ token,
68
+ operatingCompanyId,
69
+ sequence: operatingCompanySequenceData
70
+ }).then((httpResponse) => {
71
+ expect(httpResponse.status).eql(200);
72
+ });
73
+ });
74
+
75
+ it("should get operating company sequences", () => {
76
+ const operatingCompanyId = "1234";
77
+ axiosMock.onGet(`/operating-companies/${operatingCompanyId}/sequences`).reply(expectRequest({statusCode: 200, token, jwtToken}));
78
+ return api.inventory.operatingCompanies.sequences.all({
79
+ jwtToken,
80
+ token,
81
+ operatingCompanyId
82
+ }).then((httpResponse) => {
83
+ expect(httpResponse.status).eql(200);
84
+ });
85
+ });
58
86
  });
package/types/client.d.ts CHANGED
@@ -640,6 +640,21 @@ export function createApiClient(options: {
640
640
  jwtToken: any;
641
641
  headers: any;
642
642
  }) => any;
643
+ sequences: {
644
+ create({ jwtToken, token, operatingCompanyId, sequence, headers }: {
645
+ jwtToken: any;
646
+ token: any;
647
+ operatingCompanyId: any;
648
+ sequence: any;
649
+ headers: any;
650
+ }): any;
651
+ all({ jwtToken, token, operatingCompanyId, headers }: {
652
+ jwtToken: any;
653
+ token: any;
654
+ operatingCompanyId: any;
655
+ headers: any;
656
+ }): any;
657
+ };
643
658
  };
644
659
  operationMessages: {
645
660
  get: ({ token, operationMessageId, headers }: {
@@ -1 +1 @@
1
- export const INTERNAL_AUTH_TOKEN_SYMBOL: string;
1
+ export let INTERNAL_AUTH_TOKEN_SYMBOL: string;
@@ -28,4 +28,19 @@ declare function operatingCompaniesFactory({ client, internalAuthTokenProvider }
28
28
  jwtToken: any;
29
29
  headers: any;
30
30
  }) => any;
31
+ sequences: {
32
+ create({ jwtToken, token, operatingCompanyId, sequence, headers }: {
33
+ jwtToken: any;
34
+ token: any;
35
+ operatingCompanyId: any;
36
+ sequence: any;
37
+ headers: any;
38
+ }): any;
39
+ all({ jwtToken, token, operatingCompanyId, headers }: {
40
+ jwtToken: any;
41
+ token: any;
42
+ operatingCompanyId: any;
43
+ headers: any;
44
+ }): any;
45
+ };
31
46
  };
@@ -594,6 +594,21 @@ declare const _exports: {
594
594
  jwtToken: any;
595
595
  headers: any;
596
596
  }) => any;
597
+ sequences: {
598
+ create({ jwtToken, token, operatingCompanyId, sequence, headers }: {
599
+ jwtToken: any;
600
+ token: any;
601
+ operatingCompanyId: any;
602
+ sequence: any;
603
+ headers: any;
604
+ }): any;
605
+ all({ jwtToken, token, operatingCompanyId, headers }: {
606
+ jwtToken: any;
607
+ token: any;
608
+ operatingCompanyId: any;
609
+ headers: any;
610
+ }): any;
611
+ };
597
612
  };
598
613
  operationMessages: {
599
614
  get: ({ token, operationMessageId, headers }: {
@@ -1,5 +1,5 @@
1
- export const baseURL: string;
2
- export const timeout: number;
1
+ export let baseURL: string;
2
+ export let timeout: number;
3
3
  export namespace baseURLOverride {
4
4
  function inventory(url: any): string;
5
5
  function trips(url: any): string;