@sasjs/cli 4.20.0 → 4.20.1

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.
@@ -69,7 +69,7 @@ var executeFlow = function (flow, sasjs, pollOptions, target, authConfig, csvFil
69
69
  return [4 /*yield*/, sasjs
70
70
  .startComputeJob(jobLocation, null, {
71
71
  contextName: target.contextName
72
- }, authConfig, true, pollOptions, true, job.macroVars)
72
+ }, authConfig, true, pollOptions, true, job.macroVars, undefined, (0, utils_1.persistTokensRefreshedByAdapter)(target))
73
73
  .catch(function (err) { return __awaiter(void 0, void 0, void 0, function () {
74
74
  var logName, predecessors, data;
75
75
  var _a, _b, _c, _d;
@@ -105,7 +105,7 @@ function executeJobViya(sasjs, authConfig, jobPath, target, waitForJob, output,
105
105
  }
106
106
  _c.label = 5;
107
107
  case 5: return [4 /*yield*/, sasjs
108
- .startComputeJob(jobPath, null, { contextName: contextName }, authConfig, waitForJob || !!logFile, pollOptions, true, macroVars === null || macroVars === void 0 ? void 0 : macroVars.macroVars)
108
+ .startComputeJob(jobPath, null, { contextName: contextName }, authConfig, waitForJob || !!logFile, pollOptions, true, macroVars === null || macroVars === void 0 ? void 0 : macroVars.macroVars, undefined, (0, utils_2.persistTokensRefreshedByAdapter)(target))
109
109
  .catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
110
110
  var logData;
111
111
  var _a, _b;
@@ -68,6 +68,7 @@ var types_1 = require("@sasjs/utils/types");
68
68
  var path_1 = __importDefault(require("path"));
69
69
  var utils_2 = require("../../../utils");
70
70
  var utilsModule = __importStar(require("../../../utils/utils"));
71
+ var configUtils = __importStar(require("../../../utils/config"));
71
72
  var execute_1 = require("../internal/execute");
72
73
  var mocks_1 = require("./mocks");
73
74
  var sasjs = new node_1.default();
@@ -104,7 +105,7 @@ describe('executeJobViya', function () {
104
105
  pollInterval: 0,
105
106
  streamLog: true,
106
107
  logFolderPath: testLogsPath
107
- }, true, undefined);
108
+ }, true, undefined, undefined, expect.any(Function));
108
109
  return [4 /*yield*/, (0, utils_1.deleteFile)(testFilePath)];
109
110
  case 2:
110
111
  _a.sent();
@@ -125,7 +126,7 @@ describe('executeJobViya', function () {
125
126
  pollInterval: 0,
126
127
  streamLog: false,
127
128
  logFolderPath: testLogsPath
128
- }, true, undefined);
129
+ }, true, undefined, undefined, expect.any(Function));
129
130
  return [4 /*yield*/, (0, utils_1.deleteFile)(testFilePath)];
130
131
  case 2:
131
132
  _a.sent();
@@ -133,6 +134,27 @@ describe('executeJobViya', function () {
133
134
  }
134
135
  });
135
136
  }); });
137
+ it('should pass persistTokensRefreshedByAdapter(target) as onTokensRefreshed', function () { return __awaiter(void 0, void 0, void 0, function () {
138
+ var spy, callArgs, onTokensRefreshed;
139
+ return __generator(this, function (_a) {
140
+ switch (_a.label) {
141
+ case 0:
142
+ spy = jest
143
+ .spyOn(configUtils, 'persistTokensRefreshedByAdapter')
144
+ .mockImplementation(function () { return jest.fn(); });
145
+ return [4 /*yield*/, (0, execute_1.executeJobViya)(sasjs, mocks_1.mockAuthConfig, 'test/job', target, false, false, undefined, undefined, false, undefined, false)];
146
+ case 1:
147
+ _a.sent();
148
+ expect(spy).toHaveBeenCalledWith(target);
149
+ callArgs = sasjs.startComputeJob.mock.calls[0];
150
+ onTokensRefreshed = callArgs[callArgs.length - 1];
151
+ expect(onTokensRefreshed).toBeDefined();
152
+ expect(typeof onTokensRefreshed).toEqual('function');
153
+ spy.mockRestore();
154
+ return [2 /*return*/];
155
+ }
156
+ });
157
+ }); });
136
158
  });
137
159
  describe('executeJobSasjs', function () {
138
160
  beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
package/package.json CHANGED
@@ -124,5 +124,5 @@
124
124
  "ws": "8.21.0",
125
125
  "nanoid": "3.3.18"
126
126
  },
127
- "version": "4.20.0"
127
+ "version": "4.20.1"
128
128
  }