@sasjs/adapter 6.1.6 → 6.1.8
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/SASViyaApiClient.d.ts +6 -0
- package/SASViyaApiClient.js +6 -0
- package/SASjs.d.ts +9 -0
- package/SASjs.js +9 -0
- package/dist/minified_sas9.js +21 -1
- package/dist/sasjs-adapter.js +53 -2
- package/job-execution/ComputeJobExecutor.js +5 -0
- package/job-execution/FileUploader.js +5 -0
- package/job-execution/JesJobExecutor.js +5 -0
- package/job-execution/SasjsJobExecutor.js +3 -1
- package/job-execution/WebJobExecutor.js +7 -1
- package/job-execution/unauthenticatedRequestMessage.d.ts +1 -0
- package/job-execution/unauthenticatedRequestMessage.js +4 -0
- package/minified/sas9/WebJobExecutor.js +3 -1
- package/package.json +2 -2
package/SASViyaApiClient.d.ts
CHANGED
|
@@ -221,6 +221,12 @@ export declare class SASViyaApiClient {
|
|
|
221
221
|
refreshTokens(clientId: string, clientSecret: string, refreshToken: string): Promise<SasAuthResponse>;
|
|
222
222
|
/**
|
|
223
223
|
* Deletes the client representing the supplied ID.
|
|
224
|
+
*
|
|
225
|
+
* @deprecated Removing an OAuth client is an identity provider's administrative
|
|
226
|
+
* action: on Viya it takes an administrator's token, and the client it removes
|
|
227
|
+
* is a credential other callers sign in with. Nothing in this framework calls
|
|
228
|
+
* it, from a browser or from the CLI, so it is kept only until the next major
|
|
229
|
+
* release and will be removed then.
|
|
224
230
|
* @param clientId - the client ID to authenticate with.
|
|
225
231
|
* @param accessToken - an access token for authorizing the request.
|
|
226
232
|
*/
|
package/SASViyaApiClient.js
CHANGED
|
@@ -542,6 +542,12 @@ class SASViyaApiClient {
|
|
|
542
542
|
}
|
|
543
543
|
/**
|
|
544
544
|
* Deletes the client representing the supplied ID.
|
|
545
|
+
*
|
|
546
|
+
* @deprecated Removing an OAuth client is an identity provider's administrative
|
|
547
|
+
* action: on Viya it takes an administrator's token, and the client it removes
|
|
548
|
+
* is a credential other callers sign in with. Nothing in this framework calls
|
|
549
|
+
* it, from a browser or from the CLI, so it is kept only until the next major
|
|
550
|
+
* release and will be removed then.
|
|
545
551
|
* @param clientId - the client ID to authenticate with.
|
|
546
552
|
* @param accessToken - an access token for authorizing the request.
|
|
547
553
|
*/
|
package/SASjs.d.ts
CHANGED
|
@@ -229,6 +229,15 @@ export default class SASjs {
|
|
|
229
229
|
* @param refreshToken - the refresh token received from the server.
|
|
230
230
|
*/
|
|
231
231
|
refreshTokens(clientId: string, clientSecret: string, refreshToken: string): Promise<SasAuthResponse | SASjsAuthResponse>;
|
|
232
|
+
/**
|
|
233
|
+
* Deletes the client representing the supplied ID.
|
|
234
|
+
*
|
|
235
|
+
* @deprecated Nothing in the framework calls it - no CLI command, no SASjs
|
|
236
|
+
* Server route and no published app - and deleting an OAuth client is an estate
|
|
237
|
+
* administrator's action, taken in the platform against an administrator's
|
|
238
|
+
* token, so a browser or CLI client has no use for it. It keeps working until
|
|
239
|
+
* the next major release, when it will be removed.
|
|
240
|
+
*/
|
|
232
241
|
deleteClient(clientId: string, accessToken: string): Promise<unknown>;
|
|
233
242
|
/**
|
|
234
243
|
* Returns the current SASjs configuration.
|
package/SASjs.js
CHANGED
|
@@ -408,6 +408,15 @@ class SASjs {
|
|
|
408
408
|
return yield this.sasViyaApiClient.refreshTokens(clientId, clientSecret, refreshToken);
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* Deletes the client representing the supplied ID.
|
|
413
|
+
*
|
|
414
|
+
* @deprecated Nothing in the framework calls it - no CLI command, no SASjs
|
|
415
|
+
* Server route and no published app - and deleting an OAuth client is an estate
|
|
416
|
+
* administrator's action, taken in the platform against an administrator's
|
|
417
|
+
* token, so a browser or CLI client has no use for it. It keeps working until
|
|
418
|
+
* the next major release, when it will be removed.
|
|
419
|
+
*/
|
|
411
420
|
deleteClient(clientId, accessToken) {
|
|
412
421
|
return __awaiter(this, void 0, void 0, function* () {
|
|
413
422
|
this.isMethodSupported('deleteClient', [types_2.ServerType.SasViya]);
|
package/dist/minified_sas9.js
CHANGED
|
@@ -1875,6 +1875,7 @@ const errors_1 = __webpack_require__(7388);
|
|
|
1875
1875
|
const MockReadinessError_1 = __webpack_require__(314);
|
|
1876
1876
|
const types_1 = __webpack_require__(3631);
|
|
1877
1877
|
const JobExecutor_1 = __webpack_require__(1101);
|
|
1878
|
+
const unauthenticatedRequestMessage_1 = __webpack_require__(2021);
|
|
1878
1879
|
class FileUploader extends JobExecutor_1.BaseJobExecutor {
|
|
1879
1880
|
constructor(serverUrl, serverType, jobsPath, requestClient) {
|
|
1880
1881
|
super(serverUrl, serverType);
|
|
@@ -1954,6 +1955,10 @@ class FileUploader extends JobExecutor_1.BaseJobExecutor {
|
|
|
1954
1955
|
reject(new errors_1.ErrorResponse(e === null || e === void 0 ? void 0 : e.message, e));
|
|
1955
1956
|
}
|
|
1956
1957
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
1958
|
+
if (!loginRequiredCallback) {
|
|
1959
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
1960
|
+
return;
|
|
1961
|
+
}
|
|
1957
1962
|
this.appendWaitingRequest(() => {
|
|
1958
1963
|
return this.execute(sasJob, data, config, loginRequiredCallback).then((res) => {
|
|
1959
1964
|
resolve(res);
|
|
@@ -2025,6 +2030,19 @@ class BaseJobExecutor {
|
|
|
2025
2030
|
exports.BaseJobExecutor = BaseJobExecutor;
|
|
2026
2031
|
|
|
2027
2032
|
|
|
2033
|
+
/***/ },
|
|
2034
|
+
|
|
2035
|
+
/***/ 2021
|
|
2036
|
+
(__unused_webpack_module, exports) {
|
|
2037
|
+
|
|
2038
|
+
"use strict";
|
|
2039
|
+
var __webpack_unused_export__;
|
|
2040
|
+
|
|
2041
|
+
__webpack_unused_export__ = ({ value: true });
|
|
2042
|
+
exports.UNAUTHENTICATED_REQUEST_MESSAGE = void 0;
|
|
2043
|
+
exports.UNAUTHENTICATED_REQUEST_MESSAGE = 'Request is not authenticated. Make sure .env file exists with valid credentials.';
|
|
2044
|
+
|
|
2045
|
+
|
|
2028
2046
|
/***/ },
|
|
2029
2047
|
|
|
2030
2048
|
/***/ 7737
|
|
@@ -2252,6 +2270,7 @@ exports.WebJobExecutor = void 0;
|
|
|
2252
2270
|
const errors_1 = __webpack_require__(7388);
|
|
2253
2271
|
const utils_1 = __webpack_require__(9266);
|
|
2254
2272
|
const JobExecutor_1 = __webpack_require__(1101);
|
|
2273
|
+
const unauthenticatedRequestMessage_1 = __webpack_require__(2021);
|
|
2255
2274
|
const parseWeboutResponse_1 = __webpack_require__(5259);
|
|
2256
2275
|
class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
2257
2276
|
constructor(serverUrl, serverType, jobsPath, requestClient) {
|
|
@@ -2300,7 +2319,8 @@ class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
2300
2319
|
}
|
|
2301
2320
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
2302
2321
|
if (!loginRequiredCallback) {
|
|
2303
|
-
reject(new errors_1.ErrorResponse(
|
|
2322
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
2323
|
+
return;
|
|
2304
2324
|
}
|
|
2305
2325
|
this.appendWaitingRequest(() => {
|
|
2306
2326
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
package/dist/sasjs-adapter.js
CHANGED
|
@@ -3510,6 +3510,12 @@ class SASViyaApiClient {
|
|
|
3510
3510
|
}
|
|
3511
3511
|
/**
|
|
3512
3512
|
* Deletes the client representing the supplied ID.
|
|
3513
|
+
*
|
|
3514
|
+
* @deprecated Removing an OAuth client is an identity provider's administrative
|
|
3515
|
+
* action: on Viya it takes an administrator's token, and the client it removes
|
|
3516
|
+
* is a credential other callers sign in with. Nothing in this framework calls
|
|
3517
|
+
* it, from a browser or from the CLI, so it is kept only until the next major
|
|
3518
|
+
* release and will be removed then.
|
|
3513
3519
|
* @param clientId - the client ID to authenticate with.
|
|
3514
3520
|
* @param accessToken - an access token for authorizing the request.
|
|
3515
3521
|
*/
|
|
@@ -4330,6 +4336,15 @@ class SASjs {
|
|
|
4330
4336
|
return yield this.sasViyaApiClient.refreshTokens(clientId, clientSecret, refreshToken);
|
|
4331
4337
|
});
|
|
4332
4338
|
}
|
|
4339
|
+
/**
|
|
4340
|
+
* Deletes the client representing the supplied ID.
|
|
4341
|
+
*
|
|
4342
|
+
* @deprecated Nothing in the framework calls it - no CLI command, no SASjs
|
|
4343
|
+
* Server route and no published app - and deleting an OAuth client is an estate
|
|
4344
|
+
* administrator's action, taken in the platform against an administrator's
|
|
4345
|
+
* token, so a browser or CLI client has no use for it. It keeps working until
|
|
4346
|
+
* the next major release, when it will be removed.
|
|
4347
|
+
*/
|
|
4333
4348
|
deleteClient(clientId, accessToken) {
|
|
4334
4349
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4335
4350
|
this.isMethodSupported('deleteClient', [types_2.ServerType.SasViya]);
|
|
@@ -7549,6 +7564,7 @@ exports.ComputeJobExecutor = void 0;
|
|
|
7549
7564
|
const types_1 = __webpack_require__(3631);
|
|
7550
7565
|
const errors_1 = __webpack_require__(7388);
|
|
7551
7566
|
const JobExecutor_1 = __webpack_require__(1101);
|
|
7567
|
+
const unauthenticatedRequestMessage_1 = __webpack_require__(2021);
|
|
7552
7568
|
class ComputeJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
7553
7569
|
constructor(serverUrl, sasViyaApiClient) {
|
|
7554
7570
|
super(serverUrl, types_1.ServerType.SasViya);
|
|
@@ -7570,6 +7586,10 @@ class ComputeJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
7570
7586
|
reject(new errors_1.ErrorResponse(e === null || e === void 0 ? void 0 : e.message, e));
|
|
7571
7587
|
}
|
|
7572
7588
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
7589
|
+
if (!loginRequiredCallback) {
|
|
7590
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
7591
|
+
return;
|
|
7592
|
+
}
|
|
7573
7593
|
this.appendWaitingRequest(() => {
|
|
7574
7594
|
return this.execute(sasJob, data, config, loginRequiredCallback).then((res) => {
|
|
7575
7595
|
resolve(res);
|
|
@@ -7614,6 +7634,7 @@ const errors_1 = __webpack_require__(7388);
|
|
|
7614
7634
|
const MockReadinessError_1 = __webpack_require__(314);
|
|
7615
7635
|
const types_1 = __webpack_require__(3631);
|
|
7616
7636
|
const JobExecutor_1 = __webpack_require__(1101);
|
|
7637
|
+
const unauthenticatedRequestMessage_1 = __webpack_require__(2021);
|
|
7617
7638
|
class FileUploader extends JobExecutor_1.BaseJobExecutor {
|
|
7618
7639
|
constructor(serverUrl, serverType, jobsPath, requestClient) {
|
|
7619
7640
|
super(serverUrl, serverType);
|
|
@@ -7693,6 +7714,10 @@ class FileUploader extends JobExecutor_1.BaseJobExecutor {
|
|
|
7693
7714
|
reject(new errors_1.ErrorResponse(e === null || e === void 0 ? void 0 : e.message, e));
|
|
7694
7715
|
}
|
|
7695
7716
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
7717
|
+
if (!loginRequiredCallback) {
|
|
7718
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
7719
|
+
return;
|
|
7720
|
+
}
|
|
7696
7721
|
this.appendWaitingRequest(() => {
|
|
7697
7722
|
return this.execute(sasJob, data, config, loginRequiredCallback).then((res) => {
|
|
7698
7723
|
resolve(res);
|
|
@@ -7737,6 +7762,7 @@ exports.JesJobExecutor = void 0;
|
|
|
7737
7762
|
const types_1 = __webpack_require__(3631);
|
|
7738
7763
|
const errors_1 = __webpack_require__(7388);
|
|
7739
7764
|
const JobExecutor_1 = __webpack_require__(1101);
|
|
7765
|
+
const unauthenticatedRequestMessage_1 = __webpack_require__(2021);
|
|
7740
7766
|
const utils_1 = __webpack_require__(9266);
|
|
7741
7767
|
class JesJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
7742
7768
|
constructor(serverUrl, sasViyaApiClient) {
|
|
@@ -7758,6 +7784,10 @@ class JesJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
7758
7784
|
reject(new errors_1.ErrorResponse(e === null || e === void 0 ? void 0 : e.message, e));
|
|
7759
7785
|
}
|
|
7760
7786
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
7787
|
+
if (!loginRequiredCallback) {
|
|
7788
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
7789
|
+
return;
|
|
7790
|
+
}
|
|
7761
7791
|
this.appendWaitingRequest(() => {
|
|
7762
7792
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
|
7763
7793
|
resolve(res);
|
|
@@ -7983,6 +8013,7 @@ const generateFileUploadForm_1 = __webpack_require__(7673);
|
|
|
7983
8013
|
const utils_1 = __webpack_require__(9266);
|
|
7984
8014
|
const utils_2 = __webpack_require__(9266);
|
|
7985
8015
|
const JobExecutor_1 = __webpack_require__(1101);
|
|
8016
|
+
const unauthenticatedRequestMessage_1 = __webpack_require__(2021);
|
|
7986
8017
|
class SasjsJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
7987
8018
|
constructor(serverUrl, jobsPath, requestClient) {
|
|
7988
8019
|
super(serverUrl, types_1.ServerType.Sasjs);
|
|
@@ -8040,7 +8071,8 @@ class SasjsJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
8040
8071
|
}
|
|
8041
8072
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
8042
8073
|
if (!loginRequiredCallback) {
|
|
8043
|
-
reject(new errors_1.ErrorResponse(
|
|
8074
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
8075
|
+
return;
|
|
8044
8076
|
}
|
|
8045
8077
|
this.appendWaitingRequest(() => {
|
|
8046
8078
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
|
@@ -8091,6 +8123,7 @@ const generateFileUploadForm_1 = __webpack_require__(7673);
|
|
|
8091
8123
|
const generateTableUploadForm_1 = __webpack_require__(93);
|
|
8092
8124
|
const utils_1 = __webpack_require__(9266);
|
|
8093
8125
|
const JobExecutor_1 = __webpack_require__(1101);
|
|
8126
|
+
const unauthenticatedRequestMessage_1 = __webpack_require__(2021);
|
|
8094
8127
|
class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
8095
8128
|
constructor(serverUrl, serverType, jobsPath, requestClient, sasViyaApiClient) {
|
|
8096
8129
|
super(serverUrl, serverType);
|
|
@@ -8116,6 +8149,10 @@ class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
8116
8149
|
catch (e) {
|
|
8117
8150
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
8118
8151
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
8152
|
+
if (!loginRequiredCallback) {
|
|
8153
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
8154
|
+
return;
|
|
8155
|
+
}
|
|
8119
8156
|
this.appendWaitingRequest(() => {
|
|
8120
8157
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
|
8121
8158
|
resolve(res);
|
|
@@ -8252,7 +8289,8 @@ class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
8252
8289
|
}
|
|
8253
8290
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
8254
8291
|
if (!loginRequiredCallback) {
|
|
8255
|
-
reject(new errors_1.ErrorResponse(
|
|
8292
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
8293
|
+
return;
|
|
8256
8294
|
}
|
|
8257
8295
|
this.appendWaitingRequest(() => {
|
|
8258
8296
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
|
@@ -8356,6 +8394,19 @@ __exportStar(__webpack_require__(8067), exports);
|
|
|
8356
8394
|
__exportStar(__webpack_require__(8995), exports);
|
|
8357
8395
|
|
|
8358
8396
|
|
|
8397
|
+
/***/ },
|
|
8398
|
+
|
|
8399
|
+
/***/ 2021
|
|
8400
|
+
(__unused_webpack_module, exports) {
|
|
8401
|
+
|
|
8402
|
+
"use strict";
|
|
8403
|
+
var __webpack_unused_export__;
|
|
8404
|
+
|
|
8405
|
+
__webpack_unused_export__ = ({ value: true });
|
|
8406
|
+
exports.UNAUTHENTICATED_REQUEST_MESSAGE = void 0;
|
|
8407
|
+
exports.UNAUTHENTICATED_REQUEST_MESSAGE = 'Request is not authenticated. Make sure .env file exists with valid credentials.';
|
|
8408
|
+
|
|
8409
|
+
|
|
8359
8410
|
/***/ },
|
|
8360
8411
|
|
|
8361
8412
|
/***/ 8816
|
|
@@ -13,6 +13,7 @@ exports.ComputeJobExecutor = void 0;
|
|
|
13
13
|
const types_1 = require("@sasjs/utils/types");
|
|
14
14
|
const errors_1 = require("../types/errors");
|
|
15
15
|
const JobExecutor_1 = require("./JobExecutor");
|
|
16
|
+
const unauthenticatedRequestMessage_1 = require("./unauthenticatedRequestMessage");
|
|
16
17
|
class ComputeJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
17
18
|
constructor(serverUrl, sasViyaApiClient) {
|
|
18
19
|
super(serverUrl, types_1.ServerType.SasViya);
|
|
@@ -34,6 +35,10 @@ class ComputeJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
34
35
|
reject(new errors_1.ErrorResponse(e === null || e === void 0 ? void 0 : e.message, e));
|
|
35
36
|
}
|
|
36
37
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
38
|
+
if (!loginRequiredCallback) {
|
|
39
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
37
42
|
this.appendWaitingRequest(() => {
|
|
38
43
|
return this.execute(sasJob, data, config, loginRequiredCallback).then((res) => {
|
|
39
44
|
resolve(res);
|
|
@@ -15,6 +15,7 @@ const errors_1 = require("../types/errors");
|
|
|
15
15
|
const MockReadinessError_1 = require("../types/errors/MockReadinessError");
|
|
16
16
|
const types_1 = require("@sasjs/utils/types");
|
|
17
17
|
const JobExecutor_1 = require("./JobExecutor");
|
|
18
|
+
const unauthenticatedRequestMessage_1 = require("./unauthenticatedRequestMessage");
|
|
18
19
|
class FileUploader extends JobExecutor_1.BaseJobExecutor {
|
|
19
20
|
constructor(serverUrl, serverType, jobsPath, requestClient) {
|
|
20
21
|
super(serverUrl, serverType);
|
|
@@ -94,6 +95,10 @@ class FileUploader extends JobExecutor_1.BaseJobExecutor {
|
|
|
94
95
|
reject(new errors_1.ErrorResponse(e === null || e === void 0 ? void 0 : e.message, e));
|
|
95
96
|
}
|
|
96
97
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
98
|
+
if (!loginRequiredCallback) {
|
|
99
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
97
102
|
this.appendWaitingRequest(() => {
|
|
98
103
|
return this.execute(sasJob, data, config, loginRequiredCallback).then((res) => {
|
|
99
104
|
resolve(res);
|
|
@@ -13,6 +13,7 @@ exports.JesJobExecutor = void 0;
|
|
|
13
13
|
const types_1 = require("@sasjs/utils/types");
|
|
14
14
|
const errors_1 = require("../types/errors");
|
|
15
15
|
const JobExecutor_1 = require("./JobExecutor");
|
|
16
|
+
const unauthenticatedRequestMessage_1 = require("./unauthenticatedRequestMessage");
|
|
16
17
|
const utils_1 = require("../utils");
|
|
17
18
|
class JesJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
18
19
|
constructor(serverUrl, sasViyaApiClient) {
|
|
@@ -34,6 +35,10 @@ class JesJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
34
35
|
reject(new errors_1.ErrorResponse(e === null || e === void 0 ? void 0 : e.message, e));
|
|
35
36
|
}
|
|
36
37
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
38
|
+
if (!loginRequiredCallback) {
|
|
39
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
37
42
|
this.appendWaitingRequest(() => {
|
|
38
43
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
|
39
44
|
resolve(res);
|
|
@@ -20,6 +20,7 @@ const generateFileUploadForm_1 = require("../file/generateFileUploadForm");
|
|
|
20
20
|
const utils_1 = require("../utils");
|
|
21
21
|
const utils_2 = require("../utils");
|
|
22
22
|
const JobExecutor_1 = require("./JobExecutor");
|
|
23
|
+
const unauthenticatedRequestMessage_1 = require("./unauthenticatedRequestMessage");
|
|
23
24
|
class SasjsJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
24
25
|
constructor(serverUrl, jobsPath, requestClient) {
|
|
25
26
|
super(serverUrl, types_1.ServerType.Sasjs);
|
|
@@ -77,7 +78,8 @@ class SasjsJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
77
78
|
}
|
|
78
79
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
79
80
|
if (!loginRequiredCallback) {
|
|
80
|
-
reject(new errors_1.ErrorResponse(
|
|
81
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
82
|
+
return;
|
|
81
83
|
}
|
|
82
84
|
this.appendWaitingRequest(() => {
|
|
83
85
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
|
@@ -20,6 +20,7 @@ const generateFileUploadForm_1 = require("../file/generateFileUploadForm");
|
|
|
20
20
|
const generateTableUploadForm_1 = require("../file/generateTableUploadForm");
|
|
21
21
|
const utils_1 = require("../utils");
|
|
22
22
|
const JobExecutor_1 = require("./JobExecutor");
|
|
23
|
+
const unauthenticatedRequestMessage_1 = require("./unauthenticatedRequestMessage");
|
|
23
24
|
class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
24
25
|
constructor(serverUrl, serverType, jobsPath, requestClient, sasViyaApiClient) {
|
|
25
26
|
super(serverUrl, serverType);
|
|
@@ -45,6 +46,10 @@ class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
45
46
|
catch (e) {
|
|
46
47
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
47
48
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
49
|
+
if (!loginRequiredCallback) {
|
|
50
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
48
53
|
this.appendWaitingRequest(() => {
|
|
49
54
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
|
50
55
|
resolve(res);
|
|
@@ -181,7 +186,8 @@ class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
181
186
|
}
|
|
182
187
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
183
188
|
if (!loginRequiredCallback) {
|
|
184
|
-
reject(new errors_1.ErrorResponse(
|
|
189
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
190
|
+
return;
|
|
185
191
|
}
|
|
186
192
|
this.appendWaitingRequest(() => {
|
|
187
193
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UNAUTHENTICATED_REQUEST_MESSAGE = "Request is not authenticated. Make sure .env file exists with valid credentials.";
|
|
@@ -13,6 +13,7 @@ exports.WebJobExecutor = void 0;
|
|
|
13
13
|
const errors_1 = require("../../types/errors");
|
|
14
14
|
const utils_1 = require("../../utils");
|
|
15
15
|
const JobExecutor_1 = require("../../job-execution/JobExecutor");
|
|
16
|
+
const unauthenticatedRequestMessage_1 = require("../../job-execution/unauthenticatedRequestMessage");
|
|
16
17
|
const parseWeboutResponse_1 = require("../../utils/parseWeboutResponse");
|
|
17
18
|
class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
18
19
|
constructor(serverUrl, serverType, jobsPath, requestClient) {
|
|
@@ -61,7 +62,8 @@ class WebJobExecutor extends JobExecutor_1.BaseJobExecutor {
|
|
|
61
62
|
}
|
|
62
63
|
if (e instanceof errors_1.LoginRequiredError) {
|
|
63
64
|
if (!loginRequiredCallback) {
|
|
64
|
-
reject(new errors_1.ErrorResponse(
|
|
65
|
+
reject(new errors_1.ErrorResponse(unauthenticatedRequestMessage_1.UNAUTHENTICATED_REQUEST_MESSAGE, e));
|
|
66
|
+
return;
|
|
65
67
|
}
|
|
66
68
|
this.appendWaitingRequest(() => {
|
|
67
69
|
return this.execute(sasJob, data, config, loginRequiredCallback, authConfig, extraResponseAttributes).then((res) => {
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@cypress/webpack-preprocessor": "8.0.0",
|
|
40
|
-
"@sasjs/release": "0.
|
|
40
|
+
"@sasjs/release": "0.18.0",
|
|
41
41
|
"@types/cors": "2.8.19",
|
|
42
42
|
"@types/express": "5.0.6",
|
|
43
43
|
"@types/jest": "30.0.0",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"safer-buffer": "npm:@socketregistry/safer-buffer@1.0.10",
|
|
121
121
|
"side-channel": "npm:@socketregistry/side-channel@1.0.10"
|
|
122
122
|
},
|
|
123
|
-
"version": "6.1.
|
|
123
|
+
"version": "6.1.8",
|
|
124
124
|
"engines": {
|
|
125
125
|
"node": ">=22"
|
|
126
126
|
},
|