btrz-api-client 4.4.0 → 5.0.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.
- package/lib/client-standalone-min.js +1 -1
- package/lib/client.js +1 -0
- package/lib/endpoints/accounts/print-settings.js +1 -35
- package/lib/endpoints/accounts/print-templates.js +4 -2
- package/lib/endpoints/inventory/document-types.js +101 -0
- package/lib/endpoints/notifications/pdf-data.js +3 -0
- package/lib/endpoints/notifications/pdfs.js +3 -0
- package/lib/endpoints/webhooks/undelivered.js +15 -1
- package/package.json +1 -1
- package/src/client.js +1 -0
- package/src/endpoints/accounts/print-settings.js +1 -25
- package/src/endpoints/accounts/print-templates.js +3 -2
- package/src/endpoints/inventory/document-types.js +60 -0
- package/src/endpoints/notifications/pdf-data.js +3 -0
- package/src/endpoints/notifications/pdfs.js +3 -0
- package/src/endpoints/webhooks/undelivered.js +10 -1
- package/test/endpoints/accounts/print-settings.test.js +0 -29
- package/test/endpoints/inventory/document-types.test.js +40 -0
- package/test/endpoints/notifications/pdf-data.test.js +13 -0
- package/test/endpoints/notifications/pdfs.test.js +13 -0
- package/test/endpoints/webhooks/undelivered.test.js +6 -0
- package/types/client.d.ts +45 -15
- package/types/endpoints/accounts/print-settings.d.ts +0 -14
- package/types/endpoints/accounts/print-templates.d.ts +2 -1
- package/types/endpoints/inventory/document-types.d.ts +41 -0
- package/types/endpoints/webhooks/undelivered.d.ts +6 -0
- package/types/initializedClient.d.ts +45 -15
package/lib/client.js
CHANGED
|
@@ -100,6 +100,7 @@ function createInventory(_ref) {
|
|
|
100
100
|
marketplaceModifiers: require("./endpoints/inventory/marketplace-modifiers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
101
101
|
healthCheck: require("./endpoints/inventory/healthcheck.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
102
102
|
maritalStatus: require("./endpoints/inventory/marital-status.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
103
|
+
documentTypes: require("./endpoints/inventory/document-types.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
103
104
|
__test: {
|
|
104
105
|
client: client
|
|
105
106
|
}
|
|
@@ -36,44 +36,10 @@ function printSettingsFactory(_ref) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
var productTemplates = {
|
|
40
|
-
create: function create(_ref4) {
|
|
41
|
-
var jwtToken = _ref4.jwtToken,
|
|
42
|
-
token = _ref4.token,
|
|
43
|
-
productTemplate = _ref4.productTemplate,
|
|
44
|
-
headers = _ref4.headers;
|
|
45
|
-
|
|
46
|
-
return client({
|
|
47
|
-
url: "/print-settings/product-templates",
|
|
48
|
-
method: "post",
|
|
49
|
-
headers: authorizationHeaders({
|
|
50
|
-
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
51
|
-
}),
|
|
52
|
-
data: {
|
|
53
|
-
productTemplate: productTemplate
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
remove: function remove(_ref5) {
|
|
58
|
-
var productTemplateId = _ref5.productTemplateId,
|
|
59
|
-
token = _ref5.token,
|
|
60
|
-
jwtToken = _ref5.jwtToken,
|
|
61
|
-
headers = _ref5.headers;
|
|
62
|
-
|
|
63
|
-
return client({
|
|
64
|
-
url: "/print-settings/product-templates/" + productTemplateId,
|
|
65
|
-
method: "delete",
|
|
66
|
-
headers: authorizationHeaders({
|
|
67
|
-
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
68
|
-
})
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
39
|
|
|
73
40
|
return {
|
|
74
41
|
all: all,
|
|
75
|
-
update: update
|
|
76
|
-
productTemplates: productTemplates
|
|
42
|
+
update: update
|
|
77
43
|
};
|
|
78
44
|
}
|
|
79
45
|
|
|
@@ -37,7 +37,8 @@ function printSettingsFactory(_ref) {
|
|
|
37
37
|
token = _ref4.token,
|
|
38
38
|
printTemplateId = _ref4.printTemplateId,
|
|
39
39
|
printTemplate = _ref4.printTemplate,
|
|
40
|
-
headers = _ref4.headers
|
|
40
|
+
headers = _ref4.headers,
|
|
41
|
+
query = _ref4.query;
|
|
41
42
|
|
|
42
43
|
return client({
|
|
43
44
|
url: "/print-templates/" + printTemplateId,
|
|
@@ -47,7 +48,8 @@ function printSettingsFactory(_ref) {
|
|
|
47
48
|
}),
|
|
48
49
|
data: {
|
|
49
50
|
printTemplate: printTemplate
|
|
50
|
-
}
|
|
51
|
+
},
|
|
52
|
+
query: query
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("./../endpoints_helpers"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function documentTypesFactory(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
function all(_ref2) {
|
|
11
|
+
var token = _ref2.token,
|
|
12
|
+
jwtToken = _ref2.jwtToken,
|
|
13
|
+
_ref2$query = _ref2.query,
|
|
14
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
15
|
+
headers = _ref2.headers;
|
|
16
|
+
|
|
17
|
+
return client({
|
|
18
|
+
url: "/document-types",
|
|
19
|
+
method: "get",
|
|
20
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
21
|
+
params: query
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function get(_ref3) {
|
|
26
|
+
var token = _ref3.token,
|
|
27
|
+
jwtToken = _ref3.jwtToken,
|
|
28
|
+
id = _ref3.id,
|
|
29
|
+
_ref3$query = _ref3.query,
|
|
30
|
+
query = _ref3$query === undefined ? {} : _ref3$query,
|
|
31
|
+
headers = _ref3.headers;
|
|
32
|
+
|
|
33
|
+
return client({
|
|
34
|
+
url: "/document-types/" + id,
|
|
35
|
+
method: "get",
|
|
36
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
37
|
+
params: query
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function update(_ref4) {
|
|
42
|
+
var token = _ref4.token,
|
|
43
|
+
jwtToken = _ref4.jwtToken,
|
|
44
|
+
id = _ref4.id,
|
|
45
|
+
data = _ref4.data,
|
|
46
|
+
_ref4$query = _ref4.query,
|
|
47
|
+
query = _ref4$query === undefined ? {} : _ref4$query,
|
|
48
|
+
headers = _ref4.headers;
|
|
49
|
+
|
|
50
|
+
return client({
|
|
51
|
+
url: "/document-types/" + id,
|
|
52
|
+
method: "put",
|
|
53
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
54
|
+
params: query,
|
|
55
|
+
data: data
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function remove(_ref5) {
|
|
60
|
+
var token = _ref5.token,
|
|
61
|
+
jwtToken = _ref5.jwtToken,
|
|
62
|
+
id = _ref5.id,
|
|
63
|
+
_ref5$query = _ref5.query,
|
|
64
|
+
query = _ref5$query === undefined ? {} : _ref5$query,
|
|
65
|
+
headers = _ref5.headers;
|
|
66
|
+
|
|
67
|
+
return client({
|
|
68
|
+
url: "/document-types/" + id,
|
|
69
|
+
method: "delete",
|
|
70
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
71
|
+
params: query
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function create(_ref6) {
|
|
76
|
+
var token = _ref6.token,
|
|
77
|
+
jwtToken = _ref6.jwtToken,
|
|
78
|
+
data = _ref6.data,
|
|
79
|
+
_ref6$query = _ref6.query,
|
|
80
|
+
query = _ref6$query === undefined ? {} : _ref6$query,
|
|
81
|
+
headers = _ref6.headers;
|
|
82
|
+
|
|
83
|
+
return client({
|
|
84
|
+
url: "/document-types",
|
|
85
|
+
method: "post",
|
|
86
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
87
|
+
params: query,
|
|
88
|
+
data: data
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
all: all,
|
|
94
|
+
get: get,
|
|
95
|
+
update: update,
|
|
96
|
+
remove: remove,
|
|
97
|
+
create: create
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
module.exports = documentTypesFactory;
|
|
@@ -77,12 +77,26 @@ function undeliveredFactory(_ref) {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
function deleteById(_ref7) {
|
|
81
|
+
var token = _ref7.token,
|
|
82
|
+
jwtToken = _ref7.jwtToken,
|
|
83
|
+
id = _ref7.id,
|
|
84
|
+
headers = _ref7.headers;
|
|
85
|
+
|
|
86
|
+
return client({
|
|
87
|
+
url: "/undelivered/" + id,
|
|
88
|
+
method: "delete",
|
|
89
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
80
93
|
return {
|
|
81
94
|
all: all,
|
|
82
95
|
getById: getById,
|
|
83
96
|
patch: patch,
|
|
84
97
|
resend: resend,
|
|
85
|
-
resendAll: resendAll
|
|
98
|
+
resendAll: resendAll,
|
|
99
|
+
deleteById: deleteById
|
|
86
100
|
};
|
|
87
101
|
}
|
|
88
102
|
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -87,6 +87,7 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
|
|
|
87
87
|
marketplaceModifiers: require("./endpoints/inventory/marketplace-modifiers.js")({client, internalAuthTokenProvider}),
|
|
88
88
|
healthCheck: require("./endpoints/inventory/healthcheck.js")({client, internalAuthTokenProvider}),
|
|
89
89
|
maritalStatus: require("./endpoints/inventory/marital-status.js")({client, internalAuthTokenProvider}),
|
|
90
|
+
documentTypes: require("./endpoints/inventory/document-types.js")({client, internalAuthTokenProvider}),
|
|
90
91
|
__test: {
|
|
91
92
|
client
|
|
92
93
|
}
|
|
@@ -23,34 +23,10 @@ function printSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
const productTemplates = {
|
|
27
|
-
create({jwtToken, token, productTemplate, headers}) {
|
|
28
|
-
return client({
|
|
29
|
-
url: "/print-settings/product-templates",
|
|
30
|
-
method: "post",
|
|
31
|
-
headers: authorizationHeaders({
|
|
32
|
-
token, jwtToken, internalAuthTokenProvider, headers
|
|
33
|
-
}),
|
|
34
|
-
data: {
|
|
35
|
-
productTemplate
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
remove({productTemplateId, token, jwtToken, headers}) {
|
|
40
|
-
return client({
|
|
41
|
-
url: `/print-settings/product-templates/${productTemplateId}`,
|
|
42
|
-
method: "delete",
|
|
43
|
-
headers: authorizationHeaders({
|
|
44
|
-
token, jwtToken, internalAuthTokenProvider, headers
|
|
45
|
-
})
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
26
|
|
|
50
27
|
return {
|
|
51
28
|
all,
|
|
52
|
-
update
|
|
53
|
-
productTemplates
|
|
29
|
+
update
|
|
54
30
|
};
|
|
55
31
|
}
|
|
56
32
|
|
|
@@ -19,7 +19,7 @@ function printSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function update({jwtToken, token, printTemplateId, printTemplate, headers}) {
|
|
22
|
+
function update({jwtToken, token, printTemplateId, printTemplate, headers, query}) {
|
|
23
23
|
return client({
|
|
24
24
|
url: `/print-templates/${printTemplateId}`,
|
|
25
25
|
method: "put",
|
|
@@ -28,7 +28,8 @@ function printSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
28
28
|
}),
|
|
29
29
|
data: {
|
|
30
30
|
printTemplate
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
query
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
2
|
+
|
|
3
|
+
function documentTypesFactory({client, internalAuthTokenProvider}) {
|
|
4
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
5
|
+
return client({
|
|
6
|
+
url: "/document-types",
|
|
7
|
+
method: "get",
|
|
8
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
9
|
+
params: query
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function get({token, jwtToken, id, query = {}, headers}) {
|
|
14
|
+
return client({
|
|
15
|
+
url: `/document-types/${id}`,
|
|
16
|
+
method: "get",
|
|
17
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
18
|
+
params: query
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function update({token, jwtToken, id, data, query = {}, headers}) {
|
|
23
|
+
return client({
|
|
24
|
+
url: `/document-types/${id}`,
|
|
25
|
+
method: "put",
|
|
26
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
27
|
+
params: query,
|
|
28
|
+
data
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function remove({token, jwtToken, id, query = {}, headers}) {
|
|
33
|
+
return client({
|
|
34
|
+
url: `/document-types/${id}`,
|
|
35
|
+
method: "delete",
|
|
36
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
37
|
+
params: query
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function create({token, jwtToken, data, query = {}, headers}) {
|
|
42
|
+
return client({
|
|
43
|
+
url: "/document-types",
|
|
44
|
+
method: "post",
|
|
45
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
46
|
+
params: query,
|
|
47
|
+
data
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
all,
|
|
53
|
+
get,
|
|
54
|
+
update,
|
|
55
|
+
remove,
|
|
56
|
+
create
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = documentTypesFactory;
|
|
@@ -45,12 +45,21 @@ function undeliveredFactory({ client, internalAuthTokenProvider }) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
function deleteById({ token, jwtToken, id, headers }) {
|
|
49
|
+
return client({
|
|
50
|
+
url: `/undelivered/${id}`,
|
|
51
|
+
method: "delete",
|
|
52
|
+
headers: authorizationHeaders({ token, jwtToken, internalAuthTokenProvider, headers }),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
return {
|
|
49
57
|
all,
|
|
50
58
|
getById,
|
|
51
59
|
patch,
|
|
52
60
|
resend,
|
|
53
|
-
resendAll
|
|
61
|
+
resendAll,
|
|
62
|
+
deleteById
|
|
54
63
|
};
|
|
55
64
|
|
|
56
65
|
}
|
|
@@ -32,33 +32,4 @@ describe("accounts/accounts/print-settings", () => {
|
|
|
32
32
|
token, jwtToken, printSettings
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
it("should create a productTemplate", () => {
|
|
37
|
-
const productTemplate = {
|
|
38
|
-
name: "A"
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
axiosMock.onPost("/print-settings/product-templates")
|
|
42
|
-
.reply(expectRequest({
|
|
43
|
-
statusCode: 200,
|
|
44
|
-
token,
|
|
45
|
-
jwtToken
|
|
46
|
-
}));
|
|
47
|
-
return api.accounts.printSettings.productTemplates.create({
|
|
48
|
-
token, jwtToken, productTemplate
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("should delete the productTemplate by id", () => {
|
|
53
|
-
const productTemplateId = "A";
|
|
54
|
-
axiosMock.onDelete(`/print-settings/product-templates/${productTemplateId}`)
|
|
55
|
-
.reply(expectRequest({
|
|
56
|
-
statusCode: 200,
|
|
57
|
-
token,
|
|
58
|
-
jwtToken
|
|
59
|
-
}));
|
|
60
|
-
return api.accounts.printSettings.productTemplates.remove({
|
|
61
|
-
token, jwtToken, productTemplateId
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
35
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers");
|
|
2
|
+
const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("inventory/document-types", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "I owe you a JWT token";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
axiosMock.restore();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should list document-types", () => {
|
|
13
|
+
axiosMock.onGet("/document-types").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
14
|
+
return api.inventory.documentTypes.all({token, jwtToken});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("should create a document-types", () => {
|
|
18
|
+
axiosMock.onPost("/document-types").reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
19
|
+
return api.inventory.documentTypes.create({
|
|
20
|
+
jwtToken,
|
|
21
|
+
token,
|
|
22
|
+
data: {
|
|
23
|
+
name: "example",
|
|
24
|
+
code: 20,
|
|
25
|
+
ord: 100
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("should update a document-types", () => {
|
|
31
|
+
const documentTypesId = "123123123123";
|
|
32
|
+
const data = {
|
|
33
|
+
name: "new",
|
|
34
|
+
code: 100,
|
|
35
|
+
ord: 10
|
|
36
|
+
};
|
|
37
|
+
axiosMock.onPut(`/document-types/${documentTypesId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
38
|
+
return api.inventory.documentTypes.update({jwtToken, token, id: documentTypesId, data});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -68,6 +68,19 @@ describe("notifications/pdf-data", () => {
|
|
|
68
68
|
token, query, itemId});
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
it("should return the proper data for an order", () => {
|
|
72
|
+
const itemId = "12345";
|
|
73
|
+
const query = {
|
|
74
|
+
type: "order"
|
|
75
|
+
}
|
|
76
|
+
axiosMock.onGet(`/pdf-orders/${itemId}`)
|
|
77
|
+
.reply(expectRequest({
|
|
78
|
+
statusCode: 200, token
|
|
79
|
+
}));
|
|
80
|
+
return api.notifications.pdfData.get({
|
|
81
|
+
token, query, itemId});
|
|
82
|
+
});
|
|
83
|
+
|
|
71
84
|
it("should return the proper data for a ssr", () => {
|
|
72
85
|
const itemId = "12345";
|
|
73
86
|
const query = {
|
|
@@ -68,6 +68,19 @@ describe("notifications/pdfs", () => {
|
|
|
68
68
|
token, query, itemId});
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
it("should return the proper data for an order", () => {
|
|
72
|
+
const itemId = "12345";
|
|
73
|
+
const query = {
|
|
74
|
+
type: "order"
|
|
75
|
+
}
|
|
76
|
+
axiosMock.onGet(`/pdf-orders/${itemId}`)
|
|
77
|
+
.reply(expectRequest({
|
|
78
|
+
statusCode: 200, token
|
|
79
|
+
}));
|
|
80
|
+
return api.notifications.pdfs.get({
|
|
81
|
+
token, query, itemId});
|
|
82
|
+
});
|
|
83
|
+
|
|
71
84
|
it("should return the proper data for a ssr", () => {
|
|
72
85
|
const itemId = "12345";
|
|
73
86
|
const query = {
|
|
@@ -20,6 +20,12 @@ describe("webhooks/undelivered", () => {
|
|
|
20
20
|
return api.webhooks.undelivered.getById({ token, id });
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
it("should delete an undelivered by id", function () {
|
|
24
|
+
const id = "undeliveredId";
|
|
25
|
+
axiosMock.onDelete(`/undelivered/${id}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
|
|
26
|
+
return api.webhooks.undelivered.deleteById({ token, jwtToken, id });
|
|
27
|
+
});
|
|
28
|
+
|
|
23
29
|
it("should patch an undelivered", function() {
|
|
24
30
|
axiosMock.onPatch("/undelivered").reply(expectRequest({ statusCode: 200, token, jwtToken }));
|
|
25
31
|
return api.webhooks.undelivered.patch({ jwtToken, token, operation: {} });
|
package/types/client.d.ts
CHANGED
|
@@ -961,6 +961,43 @@ export function createApiClient(options: {
|
|
|
961
961
|
headers: any;
|
|
962
962
|
}) => any;
|
|
963
963
|
};
|
|
964
|
+
documentTypes: {
|
|
965
|
+
all: ({ token, jwtToken, query, headers }: {
|
|
966
|
+
token: any;
|
|
967
|
+
jwtToken: any;
|
|
968
|
+
query?: {};
|
|
969
|
+
headers: any;
|
|
970
|
+
}) => any;
|
|
971
|
+
get: ({ token, jwtToken, id, query, headers }: {
|
|
972
|
+
token: any;
|
|
973
|
+
jwtToken: any;
|
|
974
|
+
id: any;
|
|
975
|
+
query?: {};
|
|
976
|
+
headers: any;
|
|
977
|
+
}) => any;
|
|
978
|
+
update: ({ token, jwtToken, id, data, query, headers }: {
|
|
979
|
+
token: any;
|
|
980
|
+
jwtToken: any;
|
|
981
|
+
id: any;
|
|
982
|
+
data: any;
|
|
983
|
+
query?: {};
|
|
984
|
+
headers: any;
|
|
985
|
+
}) => any;
|
|
986
|
+
remove: ({ token, jwtToken, id, query, headers }: {
|
|
987
|
+
token: any;
|
|
988
|
+
jwtToken: any;
|
|
989
|
+
id: any;
|
|
990
|
+
query?: {};
|
|
991
|
+
headers: any;
|
|
992
|
+
}) => any;
|
|
993
|
+
create: ({ token, jwtToken, data, query, headers }: {
|
|
994
|
+
token: any;
|
|
995
|
+
jwtToken: any;
|
|
996
|
+
data: any;
|
|
997
|
+
query?: {};
|
|
998
|
+
headers: any;
|
|
999
|
+
}) => any;
|
|
1000
|
+
};
|
|
964
1001
|
__test: {
|
|
965
1002
|
client: axios.AxiosInstance;
|
|
966
1003
|
};
|
|
@@ -1272,20 +1309,6 @@ export function createApiClient(options: {
|
|
|
1272
1309
|
printSettings: any;
|
|
1273
1310
|
headers: any;
|
|
1274
1311
|
}) => any;
|
|
1275
|
-
productTemplates: {
|
|
1276
|
-
create({ jwtToken, token, productTemplate, headers }: {
|
|
1277
|
-
jwtToken: any;
|
|
1278
|
-
token: any;
|
|
1279
|
-
productTemplate: any;
|
|
1280
|
-
headers: any;
|
|
1281
|
-
}): any;
|
|
1282
|
-
remove({ productTemplateId, token, jwtToken, headers }: {
|
|
1283
|
-
productTemplateId: any;
|
|
1284
|
-
token: any;
|
|
1285
|
-
jwtToken: any;
|
|
1286
|
-
headers: any;
|
|
1287
|
-
}): any;
|
|
1288
|
-
};
|
|
1289
1312
|
};
|
|
1290
1313
|
printTemplates: {
|
|
1291
1314
|
all: ({ token, query, headers }: {
|
|
@@ -1299,12 +1322,13 @@ export function createApiClient(options: {
|
|
|
1299
1322
|
headers: any;
|
|
1300
1323
|
printTemplateId: any;
|
|
1301
1324
|
}) => any;
|
|
1302
|
-
update: ({ jwtToken, token, printTemplateId, printTemplate, headers }: {
|
|
1325
|
+
update: ({ jwtToken, token, printTemplateId, printTemplate, headers, query }: {
|
|
1303
1326
|
jwtToken: any;
|
|
1304
1327
|
token: any;
|
|
1305
1328
|
printTemplateId: any;
|
|
1306
1329
|
printTemplate: any;
|
|
1307
1330
|
headers: any;
|
|
1331
|
+
query: any;
|
|
1308
1332
|
}) => any;
|
|
1309
1333
|
create: ({ jwtToken, token, printTemplate, headers }: {
|
|
1310
1334
|
jwtToken: any;
|
|
@@ -2136,6 +2160,12 @@ export function createApiClient(options: {
|
|
|
2136
2160
|
jwtToken: any;
|
|
2137
2161
|
headers: any;
|
|
2138
2162
|
}) => any;
|
|
2163
|
+
deleteById: ({ token, jwtToken, id, headers }: {
|
|
2164
|
+
token: any;
|
|
2165
|
+
jwtToken: any;
|
|
2166
|
+
id: any;
|
|
2167
|
+
headers: any;
|
|
2168
|
+
}) => any;
|
|
2139
2169
|
};
|
|
2140
2170
|
webhooks: {
|
|
2141
2171
|
emit: ({ token, jwtToken, webhook, headers }: {
|
|
@@ -14,18 +14,4 @@ declare function printSettingsFactory({ client, internalAuthTokenProvider }: {
|
|
|
14
14
|
printSettings: any;
|
|
15
15
|
headers: any;
|
|
16
16
|
}) => any;
|
|
17
|
-
productTemplates: {
|
|
18
|
-
create({ jwtToken, token, productTemplate, headers }: {
|
|
19
|
-
jwtToken: any;
|
|
20
|
-
token: any;
|
|
21
|
-
productTemplate: any;
|
|
22
|
-
headers: any;
|
|
23
|
-
}): any;
|
|
24
|
-
remove({ productTemplateId, token, jwtToken, headers }: {
|
|
25
|
-
productTemplateId: any;
|
|
26
|
-
token: any;
|
|
27
|
-
jwtToken: any;
|
|
28
|
-
headers: any;
|
|
29
|
-
}): any;
|
|
30
|
-
};
|
|
31
17
|
};
|
|
@@ -14,12 +14,13 @@ declare function printSettingsFactory({ client, internalAuthTokenProvider }: {
|
|
|
14
14
|
headers: any;
|
|
15
15
|
printTemplateId: any;
|
|
16
16
|
}) => any;
|
|
17
|
-
update: ({ jwtToken, token, printTemplateId, printTemplate, headers }: {
|
|
17
|
+
update: ({ jwtToken, token, printTemplateId, printTemplate, headers, query }: {
|
|
18
18
|
jwtToken: any;
|
|
19
19
|
token: any;
|
|
20
20
|
printTemplateId: any;
|
|
21
21
|
printTemplate: any;
|
|
22
22
|
headers: any;
|
|
23
|
+
query: any;
|
|
23
24
|
}) => any;
|
|
24
25
|
create: ({ jwtToken, token, printTemplate, headers }: {
|
|
25
26
|
jwtToken: any;
|