btrz-api-client 9.10.0 → 9.11.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 +8 -8
- package/lib/client.js +4 -0
- package/lib/endpoints/accounts/authorized-external-messaging.js +171 -0
- package/lib/endpoints/accounts/network.js +3 -2
- package/package.json +1 -1
- package/src/client.js +1 -0
- package/src/endpoints/accounts/authorized-external-messaging.js +119 -0
- package/src/endpoints/accounts/network.js +3 -2
- package/test/endpoints/accounts/authorized-external-messaging.test.js +98 -0
- package/test/endpoints/invoices/infileJson.test.js +1 -2
- package/types/endpoints/invoices/infileJson.d.ts +0 -4
package/lib/client.js
CHANGED
|
@@ -497,6 +497,10 @@ function createAccounts({
|
|
|
497
497
|
client,
|
|
498
498
|
internalAuthTokenProvider
|
|
499
499
|
}),
|
|
500
|
+
authorizedExternalMessaging: require("./endpoints/accounts/authorized-external-messaging.js")({
|
|
501
|
+
client,
|
|
502
|
+
internalAuthTokenProvider
|
|
503
|
+
}),
|
|
500
504
|
application: require("./endpoints/accounts/application.js")({
|
|
501
505
|
client,
|
|
502
506
|
internalAuthTokenProvider
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Query params for GET /authorized-external-messaging (btrz-api-accounts).
|
|
7
|
+
* @typedef {Object} AuthorizedExternalMessagingListQuery
|
|
8
|
+
* @property {number} [page] - The page number to retrieve (positive integer)
|
|
9
|
+
* @property {string} [email] - Filter by email prefix (starts with), case-insensitive
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Factory for authorized-external-messaging API (btrz-api-accounts).
|
|
14
|
+
* @param {Object} deps
|
|
15
|
+
* @param {import("axios").AxiosInstance} deps.client
|
|
16
|
+
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
17
|
+
* @returns {{ all: function, get: function, create: function, update: function, remove: function }}
|
|
18
|
+
*/
|
|
19
|
+
function authorizedExternalMessagingFactory({
|
|
20
|
+
client,
|
|
21
|
+
internalAuthTokenProvider
|
|
22
|
+
}) {
|
|
23
|
+
/**
|
|
24
|
+
* GET /authorized-external-messaging - list authorized external messaging entries for the account.
|
|
25
|
+
* @param {Object} opts
|
|
26
|
+
* @param {string} [opts.token] - API key
|
|
27
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
28
|
+
* @param {AuthorizedExternalMessagingListQuery} [opts.query] - Query params (page, email)
|
|
29
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
30
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
31
|
+
*/
|
|
32
|
+
function all({
|
|
33
|
+
token,
|
|
34
|
+
jwtToken,
|
|
35
|
+
query = {},
|
|
36
|
+
headers
|
|
37
|
+
}) {
|
|
38
|
+
return client.get("/authorized-external-messaging", {
|
|
39
|
+
params: query,
|
|
40
|
+
headers: authorizationHeaders({
|
|
41
|
+
token,
|
|
42
|
+
jwtToken,
|
|
43
|
+
internalAuthTokenProvider,
|
|
44
|
+
headers
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* GET /authorized-external-messaging/:authorizedExternalMessagingId - get an entry by id.
|
|
51
|
+
* @param {Object} opts
|
|
52
|
+
* @param {string} [opts.token] - API key
|
|
53
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
54
|
+
* @param {string} opts.authorizedExternalMessagingId - Entry id (ObjectId)
|
|
55
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
56
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
57
|
+
*/
|
|
58
|
+
function get({
|
|
59
|
+
token,
|
|
60
|
+
jwtToken,
|
|
61
|
+
authorizedExternalMessagingId,
|
|
62
|
+
headers
|
|
63
|
+
}) {
|
|
64
|
+
return client({
|
|
65
|
+
url: `/authorized-external-messaging/${authorizedExternalMessagingId}`,
|
|
66
|
+
headers: authorizationHeaders({
|
|
67
|
+
token,
|
|
68
|
+
jwtToken,
|
|
69
|
+
internalAuthTokenProvider,
|
|
70
|
+
headers
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* POST /authorized-external-messaging - create an authorized external messaging entry.
|
|
77
|
+
* @param {Object} opts
|
|
78
|
+
* @param {string} [opts.token] - API key
|
|
79
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
80
|
+
* @param {Object} opts.authorizedExternalMessaging - Entry payload (email required)
|
|
81
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
82
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
83
|
+
*/
|
|
84
|
+
function create({
|
|
85
|
+
token,
|
|
86
|
+
jwtToken,
|
|
87
|
+
authorizedExternalMessaging,
|
|
88
|
+
headers
|
|
89
|
+
}) {
|
|
90
|
+
return client({
|
|
91
|
+
url: "/authorized-external-messaging",
|
|
92
|
+
method: "post",
|
|
93
|
+
headers: authorizationHeaders({
|
|
94
|
+
token,
|
|
95
|
+
jwtToken,
|
|
96
|
+
internalAuthTokenProvider,
|
|
97
|
+
headers
|
|
98
|
+
}),
|
|
99
|
+
data: {
|
|
100
|
+
authorizedExternalMessaging
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* PUT /authorized-external-messaging/:authorizedExternalMessagingId - update an entry.
|
|
107
|
+
* @param {Object} opts
|
|
108
|
+
* @param {string} [opts.token] - API key
|
|
109
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
110
|
+
* @param {string} opts.authorizedExternalMessagingId - Entry id (24-char hex ObjectId)
|
|
111
|
+
* @param {Object} opts.authorizedExternalMessaging - Entry payload (email required)
|
|
112
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
113
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
114
|
+
*/
|
|
115
|
+
function update({
|
|
116
|
+
token,
|
|
117
|
+
jwtToken,
|
|
118
|
+
authorizedExternalMessagingId,
|
|
119
|
+
authorizedExternalMessaging,
|
|
120
|
+
headers
|
|
121
|
+
}) {
|
|
122
|
+
return client({
|
|
123
|
+
url: `/authorized-external-messaging/${authorizedExternalMessagingId}`,
|
|
124
|
+
method: "put",
|
|
125
|
+
headers: authorizationHeaders({
|
|
126
|
+
token,
|
|
127
|
+
jwtToken,
|
|
128
|
+
internalAuthTokenProvider,
|
|
129
|
+
headers
|
|
130
|
+
}),
|
|
131
|
+
data: {
|
|
132
|
+
authorizedExternalMessaging
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* DELETE /authorized-external-messaging/:authorizedExternalMessagingId - delete an entry.
|
|
139
|
+
* @param {Object} opts
|
|
140
|
+
* @param {string} [opts.token] - API key
|
|
141
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
142
|
+
* @param {string} opts.authorizedExternalMessagingId - Entry id (24-char hex ObjectId)
|
|
143
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
144
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
145
|
+
*/
|
|
146
|
+
function remove({
|
|
147
|
+
token,
|
|
148
|
+
jwtToken,
|
|
149
|
+
authorizedExternalMessagingId,
|
|
150
|
+
headers
|
|
151
|
+
}) {
|
|
152
|
+
return client({
|
|
153
|
+
url: `/authorized-external-messaging/${authorizedExternalMessagingId}`,
|
|
154
|
+
method: "delete",
|
|
155
|
+
headers: authorizationHeaders({
|
|
156
|
+
token,
|
|
157
|
+
jwtToken,
|
|
158
|
+
internalAuthTokenProvider,
|
|
159
|
+
headers
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
all,
|
|
165
|
+
get,
|
|
166
|
+
create,
|
|
167
|
+
update,
|
|
168
|
+
remove
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
module.exports = authorizedExternalMessagingFactory;
|
|
@@ -7,6 +7,7 @@ const {
|
|
|
7
7
|
* Query params for GET /network/agencies (btrz-api-accounts). See get-agencies-handler getSpec().
|
|
8
8
|
* @typedef {Object} NetworkAgenciesListQuery
|
|
9
9
|
* @property {string} [name] - Filter by agency/seller name (prefix, case-insensitive)
|
|
10
|
+
* @property {string} [createdBy] - Filter by creating provider user ObjectId
|
|
10
11
|
* @property {number} [page] - Page number (1-based)
|
|
11
12
|
*/
|
|
12
13
|
|
|
@@ -23,11 +24,11 @@ function networkFactory({
|
|
|
23
24
|
}) {
|
|
24
25
|
const agencies = {
|
|
25
26
|
/**
|
|
26
|
-
* GET /network/agencies - list agencies (paginated). Query: name, page.
|
|
27
|
+
* GET /network/agencies - list agencies (paginated). Query: name, createdBy, page.
|
|
27
28
|
* @param {Object} opts
|
|
28
29
|
* @param {string} [opts.token] - API key
|
|
29
30
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
30
|
-
* @param {NetworkAgenciesListQuery} [opts.query] - Query params (name, page)
|
|
31
|
+
* @param {NetworkAgenciesListQuery} [opts.query] - Query params (name, createdBy, page)
|
|
31
32
|
* @param {Object} [opts.headers] - Optional headers
|
|
32
33
|
* @returns {Promise<import("axios").AxiosResponse<{ agencies: Array, next?: string, previous?: string, count?: number }>>}
|
|
33
34
|
* Errors: 401, 500
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -188,6 +188,7 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
188
188
|
accounts: require("./endpoints/accounts/accounts.js")({client, internalAuthTokenProvider}),
|
|
189
189
|
agencies: require("./endpoints/accounts/agencies.js")({client, internalAuthTokenProvider}),
|
|
190
190
|
agencyTypes: require("./endpoints/accounts/agency-types.js")({client, internalAuthTokenProvider}),
|
|
191
|
+
authorizedExternalMessaging: require("./endpoints/accounts/authorized-external-messaging.js")({client, internalAuthTokenProvider}),
|
|
191
192
|
application: require("./endpoints/accounts/application.js")({client, internalAuthTokenProvider}),
|
|
192
193
|
applications: require("./endpoints/accounts/applications.js")({client, internalAuthTokenProvider}),
|
|
193
194
|
applicationSettings: require("./endpoints/accounts/application-settings.js")({client, internalAuthTokenProvider}),
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Query params for GET /authorized-external-messaging (btrz-api-accounts).
|
|
7
|
+
* @typedef {Object} AuthorizedExternalMessagingListQuery
|
|
8
|
+
* @property {number} [page] - The page number to retrieve (positive integer)
|
|
9
|
+
* @property {string} [email] - Filter by email prefix (starts with), case-insensitive
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Factory for authorized-external-messaging API (btrz-api-accounts).
|
|
14
|
+
* @param {Object} deps
|
|
15
|
+
* @param {import("axios").AxiosInstance} deps.client
|
|
16
|
+
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
17
|
+
* @returns {{ all: function, get: function, create: function, update: function, remove: function }}
|
|
18
|
+
*/
|
|
19
|
+
function authorizedExternalMessagingFactory({client, internalAuthTokenProvider}) {
|
|
20
|
+
/**
|
|
21
|
+
* GET /authorized-external-messaging - list authorized external messaging entries for the account.
|
|
22
|
+
* @param {Object} opts
|
|
23
|
+
* @param {string} [opts.token] - API key
|
|
24
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
25
|
+
* @param {AuthorizedExternalMessagingListQuery} [opts.query] - Query params (page, email)
|
|
26
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
27
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
28
|
+
*/
|
|
29
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
30
|
+
return client.get("/authorized-external-messaging", {
|
|
31
|
+
params: query,
|
|
32
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* GET /authorized-external-messaging/:authorizedExternalMessagingId - get an entry by id.
|
|
38
|
+
* @param {Object} opts
|
|
39
|
+
* @param {string} [opts.token] - API key
|
|
40
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
41
|
+
* @param {string} opts.authorizedExternalMessagingId - Entry id (ObjectId)
|
|
42
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
43
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
44
|
+
*/
|
|
45
|
+
function get({token, jwtToken, authorizedExternalMessagingId, headers}) {
|
|
46
|
+
return client({
|
|
47
|
+
url: `/authorized-external-messaging/${authorizedExternalMessagingId}`,
|
|
48
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* POST /authorized-external-messaging - create an authorized external messaging entry.
|
|
54
|
+
* @param {Object} opts
|
|
55
|
+
* @param {string} [opts.token] - API key
|
|
56
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
57
|
+
* @param {Object} opts.authorizedExternalMessaging - Entry payload (email required)
|
|
58
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
59
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
60
|
+
*/
|
|
61
|
+
function create({token, jwtToken, authorizedExternalMessaging, headers}) {
|
|
62
|
+
return client({
|
|
63
|
+
url: "/authorized-external-messaging",
|
|
64
|
+
method: "post",
|
|
65
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
66
|
+
data: {
|
|
67
|
+
authorizedExternalMessaging
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* PUT /authorized-external-messaging/:authorizedExternalMessagingId - update an entry.
|
|
74
|
+
* @param {Object} opts
|
|
75
|
+
* @param {string} [opts.token] - API key
|
|
76
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
77
|
+
* @param {string} opts.authorizedExternalMessagingId - Entry id (24-char hex ObjectId)
|
|
78
|
+
* @param {Object} opts.authorizedExternalMessaging - Entry payload (email required)
|
|
79
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
80
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
81
|
+
*/
|
|
82
|
+
function update({token, jwtToken, authorizedExternalMessagingId, authorizedExternalMessaging, headers}) {
|
|
83
|
+
return client({
|
|
84
|
+
url: `/authorized-external-messaging/${authorizedExternalMessagingId}`,
|
|
85
|
+
method: "put",
|
|
86
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
87
|
+
data: {
|
|
88
|
+
authorizedExternalMessaging
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* DELETE /authorized-external-messaging/:authorizedExternalMessagingId - delete an entry.
|
|
95
|
+
* @param {Object} opts
|
|
96
|
+
* @param {string} [opts.token] - API key
|
|
97
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
98
|
+
* @param {string} opts.authorizedExternalMessagingId - Entry id (24-char hex ObjectId)
|
|
99
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
100
|
+
* @returns {Promise<import("axios").AxiosResponse>}
|
|
101
|
+
*/
|
|
102
|
+
function remove({token, jwtToken, authorizedExternalMessagingId, headers}) {
|
|
103
|
+
return client({
|
|
104
|
+
url: `/authorized-external-messaging/${authorizedExternalMessagingId}`,
|
|
105
|
+
method: "delete",
|
|
106
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
all,
|
|
112
|
+
get,
|
|
113
|
+
create,
|
|
114
|
+
update,
|
|
115
|
+
remove
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
module.exports = authorizedExternalMessagingFactory;
|
|
@@ -7,6 +7,7 @@ const {
|
|
|
7
7
|
* Query params for GET /network/agencies (btrz-api-accounts). See get-agencies-handler getSpec().
|
|
8
8
|
* @typedef {Object} NetworkAgenciesListQuery
|
|
9
9
|
* @property {string} [name] - Filter by agency/seller name (prefix, case-insensitive)
|
|
10
|
+
* @property {string} [createdBy] - Filter by creating provider user ObjectId
|
|
10
11
|
* @property {number} [page] - Page number (1-based)
|
|
11
12
|
*/
|
|
12
13
|
|
|
@@ -20,11 +21,11 @@ const {
|
|
|
20
21
|
function networkFactory({client, internalAuthTokenProvider}) {
|
|
21
22
|
const agencies = {
|
|
22
23
|
/**
|
|
23
|
-
* GET /network/agencies - list agencies (paginated). Query: name, page.
|
|
24
|
+
* GET /network/agencies - list agencies (paginated). Query: name, createdBy, page.
|
|
24
25
|
* @param {Object} opts
|
|
25
26
|
* @param {string} [opts.token] - API key
|
|
26
27
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
27
|
-
* @param {NetworkAgenciesListQuery} [opts.query] - Query params (name, page)
|
|
28
|
+
* @param {NetworkAgenciesListQuery} [opts.query] - Query params (name, createdBy, page)
|
|
28
29
|
* @param {Object} [opts.headers] - Optional headers
|
|
29
30
|
* @returns {Promise<import("axios").AxiosResponse<{ agencies: Array, next?: string, previous?: string, count?: number }>>}
|
|
30
31
|
* Errors: 401, 500
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
const {
|
|
2
|
+
axiosMock,
|
|
3
|
+
expectRequest
|
|
4
|
+
} = require("./../../test-helpers.js");
|
|
5
|
+
const api = require("./../../../src/client.js").createApiClient({
|
|
6
|
+
baseURL: "http://test.com"
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
describe("accounts/authorized-external-messaging", () => {
|
|
10
|
+
const token = "I owe you a token";
|
|
11
|
+
const jwtToken = "I owe you a JWT token";
|
|
12
|
+
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
axiosMock.reset();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("should GET a list of authorized external messaging entries", () => {
|
|
18
|
+
axiosMock.onGet("/authorized-external-messaging").reply(expectRequest({
|
|
19
|
+
statusCode: 200,
|
|
20
|
+
token,
|
|
21
|
+
jwtToken
|
|
22
|
+
}));
|
|
23
|
+
return api.accounts.authorizedExternalMessaging.all({
|
|
24
|
+
token,
|
|
25
|
+
jwtToken,
|
|
26
|
+
query: {
|
|
27
|
+
page: 1,
|
|
28
|
+
email: "user@"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("should GET an authorized external messaging entry by id", () => {
|
|
34
|
+
const authorizedExternalMessagingId = "507f1f77bcf86cd799439011";
|
|
35
|
+
axiosMock.onGet(`/authorized-external-messaging/${authorizedExternalMessagingId}`).reply(expectRequest({
|
|
36
|
+
statusCode: 200,
|
|
37
|
+
token,
|
|
38
|
+
jwtToken
|
|
39
|
+
}));
|
|
40
|
+
return api.accounts.authorizedExternalMessaging.get({
|
|
41
|
+
token,
|
|
42
|
+
jwtToken,
|
|
43
|
+
authorizedExternalMessagingId
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("should POST an authorized external messaging entry", () => {
|
|
48
|
+
const authorizedExternalMessaging = {
|
|
49
|
+
email: "reports@example.com",
|
|
50
|
+
reports: true
|
|
51
|
+
};
|
|
52
|
+
axiosMock.onPost("/authorized-external-messaging").reply(expectRequest({
|
|
53
|
+
statusCode: 200,
|
|
54
|
+
token,
|
|
55
|
+
jwtToken,
|
|
56
|
+
body: {authorizedExternalMessaging}
|
|
57
|
+
}));
|
|
58
|
+
return api.accounts.authorizedExternalMessaging.create({
|
|
59
|
+
token,
|
|
60
|
+
jwtToken,
|
|
61
|
+
authorizedExternalMessaging
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("should PUT an authorized external messaging entry", () => {
|
|
66
|
+
const authorizedExternalMessagingId = "507f1f77bcf86cd799439011";
|
|
67
|
+
const authorizedExternalMessaging = {
|
|
68
|
+
email: "reports@example.com",
|
|
69
|
+
reports: true
|
|
70
|
+
};
|
|
71
|
+
axiosMock.onPut(`/authorized-external-messaging/${authorizedExternalMessagingId}`).reply(expectRequest({
|
|
72
|
+
statusCode: 200,
|
|
73
|
+
token,
|
|
74
|
+
jwtToken,
|
|
75
|
+
body: {authorizedExternalMessaging}
|
|
76
|
+
}));
|
|
77
|
+
return api.accounts.authorizedExternalMessaging.update({
|
|
78
|
+
token,
|
|
79
|
+
jwtToken,
|
|
80
|
+
authorizedExternalMessagingId,
|
|
81
|
+
authorizedExternalMessaging
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("should DELETE an authorized external messaging entry", () => {
|
|
86
|
+
const authorizedExternalMessagingId = "507f1f77bcf86cd799439011";
|
|
87
|
+
axiosMock.onDelete(`/authorized-external-messaging/${authorizedExternalMessagingId}`).reply(expectRequest({
|
|
88
|
+
statusCode: 200,
|
|
89
|
+
token,
|
|
90
|
+
jwtToken
|
|
91
|
+
}));
|
|
92
|
+
return api.accounts.authorizedExternalMessaging.remove({
|
|
93
|
+
token,
|
|
94
|
+
jwtToken,
|
|
95
|
+
authorizedExternalMessagingId
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
@@ -32,10 +32,6 @@ type InvoiceInfileJsonValidateVoidQuery = {
|
|
|
32
32
|
* - Original sale transaction `_id` (24-character hex ObjectId)
|
|
33
33
|
*/
|
|
34
34
|
originalTransactionId: string;
|
|
35
|
-
/**
|
|
36
|
-
* - Optional infileJson invoice provider id
|
|
37
|
-
*/
|
|
38
|
-
invoiceProviderId?: string;
|
|
39
35
|
};
|
|
40
36
|
/**
|
|
41
37
|
* Query params for POST /infile-json (btrz-api-invoices). onlyValidateRequest optional.
|