btrz-api-client 7.13.0 → 7.15.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 +3 -3
- package/lib/client.js +2 -0
- package/lib/endpoints/accounts/salesforce-settings.js +47 -0
- package/lib/endpoints/accounts/users.js +45 -30
- package/lib/endpoints/notifications/salesforce.js +33 -0
- package/package.json +1 -1
- package/src/client.js +2 -0
- package/src/endpoints/accounts/salesforce-settings.js +33 -0
- package/src/endpoints/accounts/users.js +10 -0
- package/src/endpoints/notifications/salesforce.js +27 -0
- package/test/endpoints/accounts/salesforce-settings.test.js +35 -0
- package/test/endpoints/accounts/users.js +21 -3
- package/test/endpoints/notifications/salesforce.test.js +27 -0
- package/types/client.d.ts +30 -0
- package/types/endpoints/accounts/salesforce-settings.d.ts +18 -0
- package/types/endpoints/accounts/users.d.ts +6 -0
- package/types/endpoints/notifications/salesforce.d.ts +14 -0
- package/types/initializedClient.d.ts +30 -0
package/lib/client.js
CHANGED
|
@@ -215,6 +215,7 @@ function createAccounts(_ref4) {
|
|
|
215
215
|
client: client, internalAuthTokenProvider: internalAuthTokenProvider
|
|
216
216
|
}),
|
|
217
217
|
s3Buckets: require("./endpoints/accounts/s3buckets.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
218
|
+
salesforceSettings: require("./endpoints/accounts/salesforce-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
218
219
|
shifts: require("./endpoints/accounts/shifts.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
219
220
|
shiftSettings: require("./endpoints/accounts/shift-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
220
221
|
ticketMovementSettings: require("./endpoints/accounts/ticket-movement-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
@@ -352,6 +353,7 @@ function createNotifications(_ref8) {
|
|
|
352
353
|
email: require("./endpoints/notifications/email.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
353
354
|
customers: require("./endpoints/notifications/customers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
354
355
|
twilio: require("./endpoints/notifications/twilio.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
356
|
+
salesforce: require("./endpoints/notifications/salesforce.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
355
357
|
notify: require("./endpoints/notifications/notify-tickets.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
356
358
|
ordersRulesValidations: require("./endpoints/notifications/orders-rules-validations.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
357
359
|
__test: {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("./../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function salesforceSettingsFactory(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
function get(_ref2) {
|
|
11
|
+
var jwtToken = _ref2.jwtToken,
|
|
12
|
+
token = _ref2.token,
|
|
13
|
+
query = _ref2.query,
|
|
14
|
+
headers = _ref2.headers;
|
|
15
|
+
|
|
16
|
+
return client({
|
|
17
|
+
url: "/salesforce-settings",
|
|
18
|
+
params: query,
|
|
19
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function update(_ref3) {
|
|
24
|
+
var jwtToken = _ref3.jwtToken,
|
|
25
|
+
token = _ref3.token,
|
|
26
|
+
salesforceSettings = _ref3.salesforceSettings,
|
|
27
|
+
headers = _ref3.headers;
|
|
28
|
+
|
|
29
|
+
return client({
|
|
30
|
+
url: "/salesforce-settings",
|
|
31
|
+
method: "put",
|
|
32
|
+
headers: authorizationHeaders({
|
|
33
|
+
token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers
|
|
34
|
+
}),
|
|
35
|
+
data: {
|
|
36
|
+
salesforceSettings: salesforceSettings
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
get: get,
|
|
43
|
+
update: update
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = salesforceSettingsFactory;
|
|
@@ -134,70 +134,84 @@ function usersFactory(_ref) {
|
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
sequenceId = _ref11.sequenceId,
|
|
143
|
-
headers = _ref11.headers;
|
|
137
|
+
function revokeDelegation(_ref11) {
|
|
138
|
+
var token = _ref11.token,
|
|
139
|
+
jwtToken = _ref11.jwtToken,
|
|
140
|
+
actionName = _ref11.actionName,
|
|
141
|
+
headers = _ref11.headers;
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
return client({
|
|
144
|
+
url: "/users/delegation",
|
|
145
|
+
method: "delete",
|
|
146
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
147
|
+
data: { actionName: actionName }
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
var sequences = {
|
|
152
|
+
get: function get(_ref12) {
|
|
151
153
|
var token = _ref12.token,
|
|
152
154
|
jwtToken = _ref12.jwtToken,
|
|
153
155
|
userId = _ref12.userId,
|
|
154
|
-
|
|
155
|
-
query = _ref12$query === undefined ? {} : _ref12$query,
|
|
156
|
+
sequenceId = _ref12.sequenceId,
|
|
156
157
|
headers = _ref12.headers;
|
|
157
158
|
|
|
158
159
|
return client({
|
|
159
|
-
url: "/users/" + userId + "/sequences",
|
|
160
|
-
params: query,
|
|
160
|
+
url: "/users/" + userId + "/sequences/" + sequenceId,
|
|
161
161
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
162
162
|
});
|
|
163
163
|
},
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
|
|
164
|
+
all: function all(_ref13) {
|
|
165
|
+
var token = _ref13.token,
|
|
166
|
+
jwtToken = _ref13.jwtToken,
|
|
167
167
|
userId = _ref13.userId,
|
|
168
|
-
|
|
168
|
+
_ref13$query = _ref13.query,
|
|
169
|
+
query = _ref13$query === undefined ? {} : _ref13$query,
|
|
169
170
|
headers = _ref13.headers;
|
|
170
171
|
|
|
171
172
|
return client({
|
|
172
173
|
url: "/users/" + userId + "/sequences",
|
|
173
|
-
|
|
174
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
175
|
-
data: sequence
|
|
174
|
+
params: query,
|
|
175
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
176
176
|
});
|
|
177
177
|
},
|
|
178
|
-
|
|
178
|
+
create: function create(_ref14) {
|
|
179
179
|
var jwtToken = _ref14.jwtToken,
|
|
180
180
|
token = _ref14.token,
|
|
181
181
|
userId = _ref14.userId,
|
|
182
|
-
sequenceId = _ref14.sequenceId,
|
|
183
182
|
sequence = _ref14.sequence,
|
|
184
183
|
headers = _ref14.headers;
|
|
185
184
|
|
|
186
185
|
return client({
|
|
187
|
-
url: "/users/" + userId + "/sequences
|
|
188
|
-
method: "
|
|
186
|
+
url: "/users/" + userId + "/sequences",
|
|
187
|
+
method: "post",
|
|
189
188
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
190
189
|
data: sequence
|
|
191
190
|
});
|
|
192
191
|
},
|
|
193
|
-
|
|
192
|
+
update: function update(_ref15) {
|
|
194
193
|
var jwtToken = _ref15.jwtToken,
|
|
195
194
|
token = _ref15.token,
|
|
196
195
|
userId = _ref15.userId,
|
|
197
196
|
sequenceId = _ref15.sequenceId,
|
|
198
|
-
|
|
197
|
+
sequence = _ref15.sequence,
|
|
199
198
|
headers = _ref15.headers;
|
|
200
199
|
|
|
200
|
+
return client({
|
|
201
|
+
url: "/users/" + userId + "/sequences/" + sequenceId,
|
|
202
|
+
method: "put",
|
|
203
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
204
|
+
data: sequence
|
|
205
|
+
});
|
|
206
|
+
},
|
|
207
|
+
transfer: function transfer(_ref16) {
|
|
208
|
+
var jwtToken = _ref16.jwtToken,
|
|
209
|
+
token = _ref16.token,
|
|
210
|
+
userId = _ref16.userId,
|
|
211
|
+
sequenceId = _ref16.sequenceId,
|
|
212
|
+
newUserId = _ref16.newUserId,
|
|
213
|
+
headers = _ref16.headers;
|
|
214
|
+
|
|
201
215
|
return client({
|
|
202
216
|
url: "/users/" + userId + "/sequences/" + sequenceId,
|
|
203
217
|
method: "patch",
|
|
@@ -220,6 +234,7 @@ function usersFactory(_ref) {
|
|
|
220
234
|
createOrUpdateMany: createOrUpdateMany,
|
|
221
235
|
impersonate: impersonate,
|
|
222
236
|
delegation: delegation,
|
|
237
|
+
revokeDelegation: revokeDelegation,
|
|
223
238
|
sequences: sequences
|
|
224
239
|
};
|
|
225
240
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _require = require("./../endpoints_helpers.js"),
|
|
4
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
5
|
+
|
|
6
|
+
function salesforceFactory(_ref) {
|
|
7
|
+
var client = _ref.client,
|
|
8
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
sms: {
|
|
12
|
+
create: function create(_ref2) {
|
|
13
|
+
var token = _ref2.token,
|
|
14
|
+
jwtToken = _ref2.jwtToken,
|
|
15
|
+
_ref2$smsMsg = _ref2.smsMsg,
|
|
16
|
+
smsMsg = _ref2$smsMsg === undefined ? {} : _ref2$smsMsg,
|
|
17
|
+
headers = _ref2.headers;
|
|
18
|
+
|
|
19
|
+
return client({
|
|
20
|
+
url: "/salesforce/sms",
|
|
21
|
+
method: "post",
|
|
22
|
+
data: {
|
|
23
|
+
sms: smsMsg
|
|
24
|
+
},
|
|
25
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = salesforceFactory;
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -181,6 +181,7 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
|
|
|
181
181
|
client, internalAuthTokenProvider
|
|
182
182
|
}),
|
|
183
183
|
s3Buckets: require("./endpoints/accounts/s3buckets.js")({client, internalAuthTokenProvider}),
|
|
184
|
+
salesforceSettings: require("./endpoints/accounts/salesforce-settings.js")({client, internalAuthTokenProvider}),
|
|
184
185
|
shifts: require("./endpoints/accounts/shifts.js")({client, internalAuthTokenProvider}),
|
|
185
186
|
shiftSettings: require("./endpoints/accounts/shift-settings.js")({client, internalAuthTokenProvider}),
|
|
186
187
|
ticketMovementSettings: require("./endpoints/accounts/ticket-movement-settings.js")({client, internalAuthTokenProvider}),
|
|
@@ -290,6 +291,7 @@ function createNotifications({baseURL, headers, timeout, overrideFn, internalAut
|
|
|
290
291
|
email: require("./endpoints/notifications/email.js")({client, internalAuthTokenProvider}),
|
|
291
292
|
customers: require("./endpoints/notifications/customers.js")({client, internalAuthTokenProvider}),
|
|
292
293
|
twilio: require("./endpoints/notifications/twilio.js")({client, internalAuthTokenProvider}),
|
|
294
|
+
salesforce: require("./endpoints/notifications/salesforce.js")({client, internalAuthTokenProvider}),
|
|
293
295
|
notify: require("./endpoints/notifications/notify-tickets.js")({client, internalAuthTokenProvider}),
|
|
294
296
|
ordersRulesValidations: require("./endpoints/notifications/orders-rules-validations.js")({client, internalAuthTokenProvider}),
|
|
295
297
|
__test: {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("./../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function salesforceSettingsFactory({client, internalAuthTokenProvider}) {
|
|
6
|
+
function get({jwtToken, token, query, headers}) {
|
|
7
|
+
return client({
|
|
8
|
+
url: "/salesforce-settings",
|
|
9
|
+
params: query,
|
|
10
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function update({jwtToken, token, salesforceSettings, headers}) {
|
|
15
|
+
return client({
|
|
16
|
+
url: "/salesforce-settings",
|
|
17
|
+
method: "put",
|
|
18
|
+
headers: authorizationHeaders({
|
|
19
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
20
|
+
}),
|
|
21
|
+
data: {
|
|
22
|
+
salesforceSettings
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
get,
|
|
29
|
+
update
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = salesforceSettingsFactory;
|
|
@@ -74,6 +74,15 @@ function usersFactory({client, internalAuthTokenProvider}) {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
function revokeDelegation({token, jwtToken, actionName, headers}) {
|
|
78
|
+
return client({
|
|
79
|
+
url: "/users/delegation",
|
|
80
|
+
method: "delete",
|
|
81
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
82
|
+
data: {actionName}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
77
86
|
const sequences = {
|
|
78
87
|
get({token, jwtToken, userId, sequenceId, headers}) {
|
|
79
88
|
return client({
|
|
@@ -127,6 +136,7 @@ function usersFactory({client, internalAuthTokenProvider}) {
|
|
|
127
136
|
createOrUpdateMany,
|
|
128
137
|
impersonate,
|
|
129
138
|
delegation,
|
|
139
|
+
revokeDelegation,
|
|
130
140
|
sequences
|
|
131
141
|
};
|
|
132
142
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const {
|
|
2
|
+
authorizationHeaders
|
|
3
|
+
} = require("./../endpoints_helpers.js");
|
|
4
|
+
|
|
5
|
+
function salesforceFactory({
|
|
6
|
+
client, internalAuthTokenProvider
|
|
7
|
+
}) {
|
|
8
|
+
return {
|
|
9
|
+
sms: {
|
|
10
|
+
create({
|
|
11
|
+
token, jwtToken, smsMsg = {}, headers
|
|
12
|
+
}) {
|
|
13
|
+
return client({
|
|
14
|
+
url: "/salesforce/sms",
|
|
15
|
+
method: "post",
|
|
16
|
+
data: {
|
|
17
|
+
sms: smsMsg
|
|
18
|
+
},
|
|
19
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = salesforceFactory;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const {axiosMock, expectRequest} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("accounts/accounts/salesforce-settings", () => {
|
|
5
|
+
const token = "I owe you a token";
|
|
6
|
+
const jwtToken = "secret";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
axiosMock.reset();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should get the salesforce settings", () => {
|
|
13
|
+
const query = {};
|
|
14
|
+
|
|
15
|
+
axiosMock.onGet("/salesforce-settings", {params: query})
|
|
16
|
+
.reply(expectRequest({statusCode: 200, token}));
|
|
17
|
+
return api.accounts.salesforceSettings.get({token, query});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should update the salesforce setting", () => {
|
|
21
|
+
const salesforceSettings = {
|
|
22
|
+
name: "A"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
axiosMock.onPut("/salesforce-settings")
|
|
26
|
+
.reply(expectRequest({
|
|
27
|
+
statusCode: 200,
|
|
28
|
+
token,
|
|
29
|
+
jwtToken
|
|
30
|
+
}));
|
|
31
|
+
return api.accounts.salesforceSettings.update({
|
|
32
|
+
token, jwtToken, salesforceSettings
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -94,14 +94,14 @@ describe("accounts/user/{id}", () => {
|
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
it("should delegate a user", () => {
|
|
97
|
+
it("should delegate permissions to a user", () => {
|
|
98
98
|
axiosMock.onPost("/users/delegation").reply(
|
|
99
99
|
expectRequest({
|
|
100
100
|
statusCode: 200,
|
|
101
101
|
token,
|
|
102
102
|
jwtToken,
|
|
103
103
|
body: {
|
|
104
|
-
actionName: "
|
|
104
|
+
actionName: "exceed_ticket_movement_limit",
|
|
105
105
|
delegator: {
|
|
106
106
|
email: "some_email@betterez.com",
|
|
107
107
|
password: "some_password"
|
|
@@ -112,7 +112,7 @@ describe("accounts/user/{id}", () => {
|
|
|
112
112
|
return api.accounts.users.delegation({
|
|
113
113
|
jwtToken,
|
|
114
114
|
token,
|
|
115
|
-
actionName: "
|
|
115
|
+
actionName: "exceed_ticket_movement_limit",
|
|
116
116
|
delegator: {
|
|
117
117
|
email: "some_email@betterez.com",
|
|
118
118
|
password: "some_password"
|
|
@@ -120,6 +120,24 @@ describe("accounts/user/{id}", () => {
|
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
+
it("should revoke permissions previously delegated to a user", () => {
|
|
124
|
+
axiosMock.onDelete("/users/delegation").reply(
|
|
125
|
+
expectRequest({
|
|
126
|
+
statusCode: 200,
|
|
127
|
+
token,
|
|
128
|
+
jwtToken,
|
|
129
|
+
body: {
|
|
130
|
+
actionName: "exceed_ticket_movement_limit"
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
return api.accounts.users.revokeDelegation({
|
|
135
|
+
jwtToken,
|
|
136
|
+
token,
|
|
137
|
+
actionName: "exceed_ticket_movement_limit"
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
123
141
|
it("should return user sequence", () => {
|
|
124
142
|
const sequenceId = "123";
|
|
125
143
|
const userId = "1234321";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const {axiosMock} = require("./../../test-helpers.js");
|
|
2
|
+
const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
|
|
3
|
+
|
|
4
|
+
describe("notifications/salesforce", () => {
|
|
5
|
+
const token = "my-api-key";
|
|
6
|
+
const jwtToken = "my-jwt";
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
axiosMock.reset();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should post an sms message", () => {
|
|
13
|
+
axiosMock.onPost("/salesforce/sms").reply(({headers}) => {
|
|
14
|
+
if (headers["x-api-key"] === token && headers.authorization === `Bearer ${jwtToken}`) {
|
|
15
|
+
return [200];
|
|
16
|
+
}
|
|
17
|
+
return [403];
|
|
18
|
+
});
|
|
19
|
+
const sms = {
|
|
20
|
+
phone: "+1234567890",
|
|
21
|
+
message: "Something something something",
|
|
22
|
+
templateType: "order",
|
|
23
|
+
itemId: "12312123"
|
|
24
|
+
};
|
|
25
|
+
return api.notifications.salesforce.sms.create({token, jwtToken, sms});
|
|
26
|
+
});
|
|
27
|
+
});
|
package/types/client.d.ts
CHANGED
|
@@ -2535,6 +2535,20 @@ export function createApiClient(options: {
|
|
|
2535
2535
|
headers: any;
|
|
2536
2536
|
}) => any;
|
|
2537
2537
|
};
|
|
2538
|
+
salesforceSettings: {
|
|
2539
|
+
get: ({ jwtToken, token, query, headers }: {
|
|
2540
|
+
jwtToken: any;
|
|
2541
|
+
token: any;
|
|
2542
|
+
query: any;
|
|
2543
|
+
headers: any;
|
|
2544
|
+
}) => any;
|
|
2545
|
+
update: ({ jwtToken, token, salesforceSettings, headers }: {
|
|
2546
|
+
jwtToken: any;
|
|
2547
|
+
token: any;
|
|
2548
|
+
salesforceSettings: any;
|
|
2549
|
+
headers: any;
|
|
2550
|
+
}) => any;
|
|
2551
|
+
};
|
|
2538
2552
|
shifts: {
|
|
2539
2553
|
all: ({ jwtToken, token, query, headers }: {
|
|
2540
2554
|
jwtToken: any;
|
|
@@ -2923,6 +2937,12 @@ export function createApiClient(options: {
|
|
|
2923
2937
|
delegator: any;
|
|
2924
2938
|
headers: any;
|
|
2925
2939
|
}) => any;
|
|
2940
|
+
revokeDelegation: ({ token, jwtToken, actionName, headers }: {
|
|
2941
|
+
token: any;
|
|
2942
|
+
jwtToken: any;
|
|
2943
|
+
actionName: any;
|
|
2944
|
+
headers: any;
|
|
2945
|
+
}) => any;
|
|
2926
2946
|
sequences: {
|
|
2927
2947
|
get({ token, jwtToken, userId, sequenceId, headers }: {
|
|
2928
2948
|
token: any;
|
|
@@ -4164,6 +4184,16 @@ export function createApiClient(options: {
|
|
|
4164
4184
|
}): any;
|
|
4165
4185
|
};
|
|
4166
4186
|
};
|
|
4187
|
+
salesforce: {
|
|
4188
|
+
sms: {
|
|
4189
|
+
create({ token, jwtToken, smsMsg, headers }: {
|
|
4190
|
+
token: any;
|
|
4191
|
+
jwtToken: any;
|
|
4192
|
+
smsMsg?: {};
|
|
4193
|
+
headers: any;
|
|
4194
|
+
}): any;
|
|
4195
|
+
};
|
|
4196
|
+
};
|
|
4167
4197
|
notify: {
|
|
4168
4198
|
tickets: {
|
|
4169
4199
|
create({ token, jwtToken, query, operation, to, ticketId, headers }: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export = salesforceSettingsFactory;
|
|
2
|
+
declare function salesforceSettingsFactory({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
get: ({ jwtToken, token, query, headers }: {
|
|
7
|
+
jwtToken: any;
|
|
8
|
+
token: any;
|
|
9
|
+
query: any;
|
|
10
|
+
headers: any;
|
|
11
|
+
}) => any;
|
|
12
|
+
update: ({ jwtToken, token, salesforceSettings, headers }: {
|
|
13
|
+
jwtToken: any;
|
|
14
|
+
token: any;
|
|
15
|
+
salesforceSettings: any;
|
|
16
|
+
headers: any;
|
|
17
|
+
}) => any;
|
|
18
|
+
};
|
|
@@ -51,6 +51,12 @@ declare function usersFactory({ client, internalAuthTokenProvider }: {
|
|
|
51
51
|
delegator: any;
|
|
52
52
|
headers: any;
|
|
53
53
|
}) => any;
|
|
54
|
+
revokeDelegation: ({ token, jwtToken, actionName, headers }: {
|
|
55
|
+
token: any;
|
|
56
|
+
jwtToken: any;
|
|
57
|
+
actionName: any;
|
|
58
|
+
headers: any;
|
|
59
|
+
}) => any;
|
|
54
60
|
sequences: {
|
|
55
61
|
get({ token, jwtToken, userId, sequenceId, headers }: {
|
|
56
62
|
token: any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export = salesforceFactory;
|
|
2
|
+
declare function salesforceFactory({ client, internalAuthTokenProvider }: {
|
|
3
|
+
client: any;
|
|
4
|
+
internalAuthTokenProvider: any;
|
|
5
|
+
}): {
|
|
6
|
+
sms: {
|
|
7
|
+
create({ token, jwtToken, smsMsg, headers }: {
|
|
8
|
+
token: any;
|
|
9
|
+
jwtToken: any;
|
|
10
|
+
smsMsg?: {};
|
|
11
|
+
headers: any;
|
|
12
|
+
}): any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -2489,6 +2489,20 @@ declare const _exports: {
|
|
|
2489
2489
|
headers: any;
|
|
2490
2490
|
}) => any;
|
|
2491
2491
|
};
|
|
2492
|
+
salesforceSettings: {
|
|
2493
|
+
get: ({ jwtToken, token, query, headers }: {
|
|
2494
|
+
jwtToken: any;
|
|
2495
|
+
token: any;
|
|
2496
|
+
query: any;
|
|
2497
|
+
headers: any;
|
|
2498
|
+
}) => any;
|
|
2499
|
+
update: ({ jwtToken, token, salesforceSettings, headers }: {
|
|
2500
|
+
jwtToken: any;
|
|
2501
|
+
token: any;
|
|
2502
|
+
salesforceSettings: any;
|
|
2503
|
+
headers: any;
|
|
2504
|
+
}) => any;
|
|
2505
|
+
};
|
|
2492
2506
|
shifts: {
|
|
2493
2507
|
all: ({ jwtToken, token, query, headers }: {
|
|
2494
2508
|
jwtToken: any;
|
|
@@ -2877,6 +2891,12 @@ declare const _exports: {
|
|
|
2877
2891
|
delegator: any;
|
|
2878
2892
|
headers: any;
|
|
2879
2893
|
}) => any;
|
|
2894
|
+
revokeDelegation: ({ token, jwtToken, actionName, headers }: {
|
|
2895
|
+
token: any;
|
|
2896
|
+
jwtToken: any;
|
|
2897
|
+
actionName: any;
|
|
2898
|
+
headers: any;
|
|
2899
|
+
}) => any;
|
|
2880
2900
|
sequences: {
|
|
2881
2901
|
get({ token, jwtToken, userId, sequenceId, headers }: {
|
|
2882
2902
|
token: any;
|
|
@@ -4118,6 +4138,16 @@ declare const _exports: {
|
|
|
4118
4138
|
}): any;
|
|
4119
4139
|
};
|
|
4120
4140
|
};
|
|
4141
|
+
salesforce: {
|
|
4142
|
+
sms: {
|
|
4143
|
+
create({ token, jwtToken, smsMsg, headers }: {
|
|
4144
|
+
token: any;
|
|
4145
|
+
jwtToken: any;
|
|
4146
|
+
smsMsg?: {};
|
|
4147
|
+
headers: any;
|
|
4148
|
+
}): any;
|
|
4149
|
+
};
|
|
4150
|
+
};
|
|
4121
4151
|
notify: {
|
|
4122
4152
|
tickets: {
|
|
4123
4153
|
create({ token, jwtToken, query, operation, to, ticketId, headers }: {
|