@nsshunt/stsappframework 3.1.164 → 3.1.167
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/dist/testertesting/app.js +18 -13
- package/dist/testertesting/app.js.map +1 -1
- package/dist/testertesting/commonTypes.js +2 -0
- package/dist/testertesting/commonTypes.js.map +1 -1
- package/dist/testertesting/testCase01.js +40 -1
- package/dist/testertesting/testCase01.js.map +1 -1
- package/dist/testertesting/workerInstance.js +66 -17
- package/dist/testertesting/workerInstance.js.map +1 -1
- package/dist/testertesting/workerManager.js +14 -9
- package/dist/testertesting/workerManager.js.map +1 -1
- package/package.json +1 -1
- package/src/testertesting/app.ts +23 -17
- package/src/testertesting/commonTypes.ts +21 -18
- package/src/testertesting/testCase01.ts +49 -1
- package/src/testertesting/workerInstance.ts +68 -19
- package/src/testertesting/workerManager.ts +17 -10
- package/types/testertesting/commonTypes.d.ts +15 -8
- package/types/testertesting/commonTypes.d.ts.map +1 -1
- package/types/testertesting/testCase01.d.ts +8 -0
- package/types/testertesting/testCase01.d.ts.map +1 -1
- package/types/testertesting/workerInstance.d.ts.map +1 -1
- package/types/testertesting/workerManager.d.ts +1 -1
- package/types/testertesting/workerManager.d.ts.map +1 -1
- package/dist/testertesting/workerPrimaryTestRunner01.js +0 -62
- package/dist/testertesting/workerPrimaryTestRunner01.js.map +0 -1
- package/src/testertesting/workerPrimaryTestRunner01.ts +0 -81
- package/types/testertesting/workerPrimaryTestRunner01.d.ts +0 -8
- package/types/testertesting/workerPrimaryTestRunner01.d.ts.map +0 -1
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { MessagePort } from 'worker_threads';
|
|
2
|
-
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
// Force chalk level
|
|
5
|
-
chalk.level = 3;
|
|
6
|
-
|
|
7
|
-
import { IPrimaryWorker, IWorkerOptions, PublishMessageCommandsTestRunner,
|
|
8
|
-
IIWMessagePayload, IIWMessagePayloadContentBase } from './commonTypes'
|
|
9
|
-
|
|
10
|
-
//import { STSOAuth2Manager, STSOAuth2ManagerPluginKey } from '@nsshunt/stsoauth2plugin'
|
|
11
|
-
|
|
12
|
-
// This will execute within the primary thread context and have access to plugins and other Vue application features
|
|
13
|
-
export class WorkerPrimaryTestRunner01 implements IPrimaryWorker {
|
|
14
|
-
// #STSOAuth2Manager: STSOAuth2Manager
|
|
15
|
-
#options: IWorkerOptions
|
|
16
|
-
|
|
17
|
-
#debug = (message: string) => {
|
|
18
|
-
console.log(chalk.magenta(`pid: [${process.pid}] WorkerPrimaryTestRunner01::${message}`));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
constructor(app: any, options: IWorkerOptions) {
|
|
23
|
-
this.#debug(`constructor`)
|
|
24
|
-
this.#options = options;
|
|
25
|
-
this.#debug(`constructor::options: [${JSON.stringify(this.#options)}]`);
|
|
26
|
-
// this.#STSOAuth2Manager = app.config.globalProperties.$sts[STSOAuth2ManagerPluginKey]
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async ProcessMessageFromWorker(workerPort: MessagePort, publishMessagePayload: IIWMessagePayload) {
|
|
30
|
-
this.#debug(`ProcessMessageFromWorker`)
|
|
31
|
-
// Process messages received back from the worker
|
|
32
|
-
switch (publishMessagePayload.command as PublishMessageCommandsTestRunner) {
|
|
33
|
-
case PublishMessageCommandsTestRunner.GetAccessToken : {
|
|
34
|
-
//const access_token = await this.#GetAccessToken();
|
|
35
|
-
const access_token = '1234';
|
|
36
|
-
workerPort.postMessage({
|
|
37
|
-
command: PublishMessageCommandsTestRunner.GetAccessTokenResponse,
|
|
38
|
-
payload: {
|
|
39
|
-
messageId: publishMessagePayload.payload.messageId,
|
|
40
|
-
access_token
|
|
41
|
-
} as IIWMessagePayloadContentBase
|
|
42
|
-
})}
|
|
43
|
-
break;
|
|
44
|
-
case PublishMessageCommandsTestRunner.ExecuteRefreshToken : {
|
|
45
|
-
//const access_token = await this.#ExecuteRefreshToken();
|
|
46
|
-
const access_token = '5678';
|
|
47
|
-
workerPort.postMessage({
|
|
48
|
-
command: PublishMessageCommandsTestRunner.ExecuteRefreshTokenResponse,
|
|
49
|
-
payload: {
|
|
50
|
-
messageId: publishMessagePayload.payload.messageId,
|
|
51
|
-
access_token
|
|
52
|
-
} as IIWMessagePayloadContentBase
|
|
53
|
-
})}
|
|
54
|
-
break;
|
|
55
|
-
default :
|
|
56
|
-
throw new Error(`publishMessagePayload.command: [${publishMessagePayload.command}] not allowed`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/*
|
|
61
|
-
#GetAccessToken = async() : Promise<string | null> => {
|
|
62
|
-
debug(`WorkerPrimaryTestRunner01::GetAccessToken`)
|
|
63
|
-
return await this.#STSOAuth2Manager.GetAccessToken();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#ExecuteRefreshToken = async (): Promise<string | null> => {
|
|
67
|
-
debug(`WorkerPrimaryTestRunner01::ExecuteRefreshToken`)
|
|
68
|
-
const retVal = await this.#STSOAuth2Manager.ExecuteRefreshToken();
|
|
69
|
-
if (retVal) {
|
|
70
|
-
const access_token = await this.#STSOAuth2Manager.GetAccessToken();
|
|
71
|
-
if (access_token) {
|
|
72
|
-
return access_token;
|
|
73
|
-
} else {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
*/
|
|
81
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MessagePort } from 'worker_threads';
|
|
2
|
-
import { IPrimaryWorker, IWorkerOptions, IIWMessagePayload } from './commonTypes';
|
|
3
|
-
export declare class WorkerPrimaryTestRunner01 implements IPrimaryWorker {
|
|
4
|
-
#private;
|
|
5
|
-
constructor(app: any, options: IWorkerOptions);
|
|
6
|
-
ProcessMessageFromWorker(workerPort: MessagePort, publishMessagePayload: IIWMessagePayload): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=workerPrimaryTestRunner01.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workerPrimaryTestRunner01.d.ts","sourceRoot":"","sources":["../../src/testertesting/workerPrimaryTestRunner01.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,OAAO,EAAE,cAAc,EAAE,cAAc,EACnC,iBAAiB,EAAgC,MAAM,eAAe,CAAA;AAK1E,qBAAa,yBAA0B,YAAW,cAAc;;gBAShD,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc;IAOvC,wBAAwB,CAAC,UAAU,EAAE,WAAW,EAAE,qBAAqB,EAAE,iBAAiB;CAoDnG"}
|