@qelos/plugin-play 3.8.0 → 3.8.2

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.
@@ -4,7 +4,7 @@ export interface QelosRouteParams extends RouteOptions {
4
4
  verifyToken: boolean;
5
5
  }
6
6
  export declare const endpoints: Map<string, QelosRouteParams>;
7
- export declare const internalEndpoints: Map<string, RouteOptions<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify/types/route").RouteGenericInterface, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, import("fastify").FastifyLoggerInstance>>;
7
+ export declare const internalEndpoints: Map<string, RouteOptions<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify/types/route").RouteGenericInterface, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, import("fastify").FastifyBaseLogger>>;
8
8
  export declare function addProxyEndpoint(path: string, options: Partial<QelosRouteParams>): void;
9
9
  export declare function addEndpoint(path: string, options: Partial<QelosRouteParams>): void;
10
10
  export declare function addInternalEndpoint(path: string, options: Partial<RouteOptions>): void;
package/dist/sdk.d.ts CHANGED
@@ -6,7 +6,17 @@ export declare function authenticate(): Promise<{
6
6
  refreshToken: string;
7
7
  };
8
8
  }>;
9
- export declare function getSdkForUrl<T = any>(appUrl: string, refreshToken?: string, accessToken?: string, username?: string, password?: string): QelosAdministratorSDK;
9
+ export declare function getSdkForUrl<T = any>({ appUrl, refreshToken, accessToken, username, password, onRefresh }: {
10
+ appUrl: string;
11
+ refreshToken?: string;
12
+ accessToken?: string;
13
+ username?: string;
14
+ password?: string;
15
+ onRefresh?: ({ refreshToken, token }: {
16
+ refreshToken: string;
17
+ token: string;
18
+ }) => void;
19
+ }): QelosAdministratorSDK;
10
20
  export declare function getSdk(): QelosAdministratorSDK;
11
21
  export declare function getSdkForTenant(tenantPayload: StandardPayload): Promise<QelosAdministratorSDK | null>;
12
22
  export declare function getEncryptedDataForTenant(tenantPayload: StandardPayload, encryptedId?: string): Promise<any>;
package/dist/sdk.js CHANGED
@@ -4,11 +4,17 @@ import config from './config';
4
4
  import logger from './logger';
5
5
  let localSdk;
6
6
  export function authenticate() {
7
- return localSdk.authentication.oAuthSignin({ username: config.qelosUsername, password: config.qelosPassword });
7
+ return localSdk.authentication.oAuthSignin({
8
+ username: config.qelosUsername,
9
+ password: config.qelosPassword,
10
+ });
8
11
  }
9
12
  async function bootstrapAuthenticate() {
10
13
  try {
11
- await localSdk.authentication.oAuthSignin({ username: config.qelosUsername, password: config.qelosPassword });
14
+ await localSdk.authentication.oAuthSignin({
15
+ username: config.qelosUsername,
16
+ password: config.qelosPassword,
17
+ });
12
18
  console.log('authenticated successfully to ' + config.qelosUrl);
13
19
  }
14
20
  catch (err) {
@@ -17,17 +23,19 @@ async function bootstrapAuthenticate() {
17
23
  process.exit(1);
18
24
  }
19
25
  }
20
- export function getSdkForUrl(appUrl, refreshToken, accessToken, username, password) {
26
+ export function getSdkForUrl({ appUrl, refreshToken, accessToken, username, password, onRefresh }) {
21
27
  let sdk;
22
28
  const options = {
23
29
  appUrl,
24
30
  forceRefresh: true,
25
31
  fetch: globalThis.fetch || undiciFetch,
26
- ...(config.sdkOptions || {}),
27
32
  onFailedRefreshToken: async () => {
28
- await sdk.authentication.oAuthSignin({ username, password });
29
- // throw new Error('could not able to refresh token');
30
- }
33
+ const res = await sdk.authentication.oAuthSignin({ username, password });
34
+ if (onRefresh) {
35
+ onRefresh(res.payload);
36
+ }
37
+ },
38
+ ...(config.sdkOptions || {}),
31
39
  };
32
40
  if (refreshToken) {
33
41
  options.refreshToken = refreshToken;
@@ -42,7 +50,13 @@ export function getSdk() {
42
50
  if (localSdk) {
43
51
  return localSdk;
44
52
  }
45
- localSdk = getSdkForUrl(config.qelosUrl, null, null, config.qelosUsername, config.qelosPassword);
53
+ localSdk = getSdkForUrl({
54
+ appUrl: config.qelosUrl,
55
+ refreshToken: null,
56
+ accessToken: null,
57
+ username: config.qelosUsername,
58
+ password: config.qelosPassword,
59
+ });
46
60
  bootstrapAuthenticate().catch();
47
61
  return localSdk;
48
62
  }
@@ -52,7 +66,17 @@ export async function getSdkForTenant(tenantPayload) {
52
66
  if (!data.appUrl) {
53
67
  return null;
54
68
  }
55
- const sdk = getSdkForUrl(data.appUrl, data.currentAuthPayload?.refreshToken, data.currentAuthPayload?.token, data.username, data.password);
69
+ const sdk = getSdkForUrl({
70
+ appUrl: data.appUrl,
71
+ refreshToken: data.currentAuthPayload?.refreshToken,
72
+ accessToken: data.currentAuthPayload?.token,
73
+ username: data.username,
74
+ password: data.password,
75
+ onRefresh: (payload) => {
76
+ data.currentAuthPayload = payload;
77
+ setEncryptedDataForTenant(tenantPayload, config.userPayloadSecret, data);
78
+ }
79
+ });
56
80
  return sdk;
57
81
  }
58
82
  catch (e) {
package/dist/sdk.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAElE,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,IAAI,QAA4D,CAAC;AAEjE,MAAM,UAAU,YAAY;IAC1B,OAAO,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;AACjH,CAAC;AAED,KAAK,UAAU,qBAAqB;IAClC,IAAI;QACF,MAAM,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;QAC9G,OAAO,CA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Z;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACd,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,aAA8B,EAC9B,cAAsB,EAAE;IAExB,OAAO,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,aAA8B,EAC9B,cAAsB,EAAE,EACxB,IAAS;IAET,OAAO,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qelos/plugin-play",
3
- "version": "3.8.0",
3
+ "version": "3.8.2",
4
4
  "description": "Play a plugin for Qelos!",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -15,15 +15,15 @@
15
15
  "dependencies": {
16
16
  "@fastify/cookie": "^8.3.0",
17
17
  "@fastify/static": "^6.12.0",
18
- "@qelos/cache-manager": "^3.8.0",
19
- "@qelos/sdk": "^3.8.0",
20
- "@qelos/web-sdk": "^3.8.0",
21
- "fastify": "~4.3.0",
18
+ "@qelos/cache-manager": "^3.8.2",
19
+ "@qelos/sdk": "^3.8.2",
20
+ "@qelos/web-sdk": "^3.8.2",
21
+ "fastify": "~4.15.0",
22
22
  "jsonwebtoken": "^9.0.2",
23
23
  "undici": "^6.20.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "typescript": "^4.9.5"
27
27
  },
28
- "gitHead": "cb6281585059df8baa9b2ce388fb00577b2cf99b"
28
+ "gitHead": "dc75ba76bdb68c07b640d4469d9dffecf61759b1"
29
29
  }
package/src/sdk.ts CHANGED
@@ -8,13 +8,19 @@ import logger from './logger';
8
8
  let localSdk: QelosAdministratorSDK<{ tokenIdentifier: string }>;
9
9
 
10
10
  export function authenticate() {
11
- return localSdk.authentication.oAuthSignin({ username: config.qelosUsername, password: config.qelosPassword });
11
+ return localSdk.authentication.oAuthSignin({
12
+ username: config.qelosUsername,
13
+ password: config.qelosPassword,
14
+ });
12
15
  }
13
16
 
14
17
  async function bootstrapAuthenticate() {
15
18
  try {
16
- await localSdk.authentication.oAuthSignin({ username: config.qelosUsername, password: config.qelosPassword });
17
- console.log('authenticated successfully to ' + config.qelosUrl)
19
+ await localSdk.authentication.oAuthSignin({
20
+ username: config.qelosUsername,
21
+ password: config.qelosPassword,
22
+ });
23
+ console.log('authenticated successfully to ' + config.qelosUrl);
18
24
  } catch (err) {
19
25
  console.log('could not authenticate to own qelos app');
20
26
  logger.error('connect to qelos error: ', err);
@@ -22,17 +28,33 @@ async function bootstrapAuthenticate() {
22
28
  }
23
29
  }
24
30
 
25
- export function getSdkForUrl<T = any>(appUrl: string, refreshToken?: string, accessToken?: string, username?: string, password?: string): QelosAdministratorSDK {
31
+ export function getSdkForUrl<T = any>({
32
+ appUrl,
33
+ refreshToken,
34
+ accessToken,
35
+ username,
36
+ password,
37
+ onRefresh
38
+ }: {
39
+ appUrl: string;
40
+ refreshToken?: string;
41
+ accessToken?: string;
42
+ username?: string;
43
+ password?: string;
44
+ onRefresh?: ({ refreshToken, token }: { refreshToken: string, token: string }) => void
45
+ }): QelosAdministratorSDK {
26
46
  let sdk: QelosAdministratorSDK;
27
47
  const options: QelosSDKOptions = {
28
48
  appUrl,
29
49
  forceRefresh: true,
30
- fetch: globalThis.fetch || undiciFetch as any as FetchLike,
31
- ...(config.sdkOptions || {}),
50
+ fetch: globalThis.fetch || (undiciFetch as any as FetchLike),
32
51
  onFailedRefreshToken: async () => {
33
- await sdk.authentication.oAuthSignin({ username, password });
34
- // throw new Error('could not able to refresh token');
35
- }
52
+ const res = await sdk.authentication.oAuthSignin({ username, password });
53
+ if (onRefresh) {
54
+ onRefresh(res.payload)
55
+ }
56
+ },
57
+ ...(config.sdkOptions || {}),
36
58
  };
37
59
  if (refreshToken) {
38
60
  options.refreshToken = refreshToken;
@@ -48,29 +70,57 @@ export function getSdk(): QelosAdministratorSDK {
48
70
  if (localSdk) {
49
71
  return localSdk;
50
72
  }
51
- localSdk = getSdkForUrl<{ tokenIdentifier: string }>(config.qelosUrl, null, null, config.qelosUsername, config.qelosPassword);
73
+ localSdk = getSdkForUrl<{ tokenIdentifier: string }>({
74
+ appUrl: config.qelosUrl,
75
+ refreshToken: null,
76
+ accessToken: null,
77
+ username: config.qelosUsername,
78
+ password: config.qelosPassword,
79
+ });
52
80
  bootstrapAuthenticate().catch();
53
81
  return localSdk;
54
82
  }
55
83
 
56
- export async function getSdkForTenant(tenantPayload: StandardPayload): Promise<QelosAdministratorSDK | null> {
84
+ export async function getSdkForTenant(
85
+ tenantPayload: StandardPayload
86
+ ): Promise<QelosAdministratorSDK | null> {
57
87
  try {
58
- const data = await getEncryptedDataForTenant(tenantPayload, config.userPayloadSecret);
88
+ const data = await getEncryptedDataForTenant(
89
+ tenantPayload,
90
+ config.userPayloadSecret
91
+ );
59
92
  if (!data.appUrl) {
60
93
  return null;
61
94
  }
62
- const sdk = getSdkForUrl(data.appUrl, data.currentAuthPayload?.refreshToken, data.currentAuthPayload?.token, data.username, data.password);
95
+ const sdk = getSdkForUrl({
96
+ appUrl: data.appUrl,
97
+ refreshToken: data.currentAuthPayload?.refreshToken,
98
+ accessToken: data.currentAuthPayload?.token,
99
+ username: data.username,
100
+ password: data.password,
101
+ onRefresh: (payload) => {
102
+ data.currentAuthPayload = payload;
103
+ setEncryptedDataForTenant(tenantPayload, config.userPayloadSecret, data);
104
+ }
105
+ });
63
106
  return sdk;
64
107
  } catch (e) {
65
- logger.log(e)
108
+ logger.log(e);
66
109
  return null;
67
110
  }
68
111
  }
69
112
 
70
- export function getEncryptedDataForTenant(tenantPayload: StandardPayload, encryptedId: string = '') {
113
+ export function getEncryptedDataForTenant(
114
+ tenantPayload: StandardPayload,
115
+ encryptedId: string = ''
116
+ ) {
71
117
  return getSdk().users.getEncryptedData(tenantPayload.sub, encryptedId);
72
118
  }
73
119
 
74
- export function setEncryptedDataForTenant(tenantPayload: StandardPayload, encryptedId: string = '', data: any) {
120
+ export function setEncryptedDataForTenant(
121
+ tenantPayload: StandardPayload,
122
+ encryptedId: string = '',
123
+ data: any
124
+ ) {
75
125
  return getSdk().users.setEncryptedData(tenantPayload.sub, encryptedId, data);
76
126
  }
package/LICENSE DELETED
@@ -1,31 +0,0 @@
1
- # License
2
-
3
- ## Community Use - Apache License 2.0
4
-
5
- This project is licensed under the **Apache License 2.0**. You are free to:
6
-
7
- - **Use** the software for personal, educational, or community purposes.
8
- - **Modify** the software as needed.
9
- - **Distribute** copies of the software or modified versions.
10
-
11
- ### Key Conditions:
12
- - You are not required to share modifications you make.
13
- - You may use this software internally, including within commercial settings, without any restrictions.
14
-
15
- For full license details, see [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
16
-
17
- ## Restriction on Managed Services - Custom Clause
18
-
19
- While the software is open and free to use for internal or personal purposes, **you are not permitted to offer this software or any derivative of it as a paid managed service** or **Software as a Service (SaaS)** without explicit permission from Velocitech LTD.
20
-
21
- ### Key Restriction:
22
- - You **may not** sell, offer, or commercialize this software as a managed service, SaaS, or any similar hosted service.
23
-
24
- ### How to Obtain Permission:
25
- If you wish to offer a managed or commercial version of this software, you must obtain a **commercial license** from Velocitech LTD. Please contact us at [support@qelos.io](mailto:support@qelos.io) for details.
26
-
27
- ## Additional Notes
28
-
29
- This license ensures the software remains free for personal use and community development, while protecting Velocitech LTD’s right to control the commercialization of managed services based on the software.
30
-
31
- For any questions regarding the license, feel free to reach out at [support@qelos.io].