@next-core/easyops-runtime 0.8.1 → 0.9.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/dist/cjs/auth.js +1 -0
- package/dist/cjs/auth.js.map +1 -1
- package/dist/esm/auth.js +1 -0
- package/dist/esm/auth.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/auth.js
CHANGED
package/dist/cjs/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":["_checkPermissions","require","auth","authenticate","newAuth","Object","assign","org","username","userInstanceId","loginFrom","accessRule","isAdmin","csrfToken","license","userShowValue","getAuth","logout","key","keys","undefined","resetPermissionPreChecks","isLoggedIn"],"sources":["../../src/auth.ts"],"sourcesContent":["import type { AuthApi_CheckLoginResponseBody } from \"@next-api-sdk/api-gateway-sdk\";\nimport { resetPermissionPreChecks } from \"./checkPermissions.js\";\n\nconst auth: AuthInfo = {};\n\n/** @internal */\nexport type AuthInfo = Omit<AuthApi_CheckLoginResponseBody, \"loggedIn\">;\n\n/** @internal */\nexport function authenticate(newAuth: AuthInfo): void {\n Object.assign(auth, {\n org: newAuth.org,\n username: newAuth.username,\n userInstanceId: newAuth.userInstanceId,\n loginFrom: newAuth.loginFrom,\n accessRule: newAuth.accessRule,\n isAdmin: newAuth.isAdmin,\n csrfToken: newAuth.csrfToken,\n license: newAuth.license,\n userShowValue: newAuth.userShowValue,\n });\n}\n\n/**\n * 获取当前登录认证信息。\n *\n * @returns 当前登录认证信息。\n */\nexport function getAuth(): AuthInfo {\n return {\n ...auth,\n };\n}\n\n/** @internal */\nexport function logout(): void {\n for (const key of Object.keys(auth) as (keyof AuthInfo)[]) {\n auth[key] = undefined;\n }\n resetPermissionPreChecks();\n}\n\n/**\n * 查看当前是否已登录。\n *\n * @returns 当前是否已登录。\n */\nexport function isLoggedIn(): boolean {\n return auth.username !== undefined;\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,MAAMC,IAAc,GAAG,CAAC,CAAC;;AAEzB;;AAGA;AACO,SAASC,YAAYA,CAACC,OAAiB,EAAQ;EACpDC,MAAM,CAACC,MAAM,CAACJ,IAAI,EAAE;IAClBK,GAAG,EAAEH,OAAO,CAACG,GAAG;IAChBC,QAAQ,EAAEJ,OAAO,CAACI,QAAQ;IAC1BC,cAAc,EAAEL,OAAO,CAACK,cAAc;IACtCC,SAAS,EAAEN,OAAO,CAACM,SAAS;IAC5BC,UAAU,EAAEP,OAAO,CAACO,UAAU;IAC9BC,OAAO,EAAER,OAAO,CAACQ,OAAO;IACxBC,SAAS,EAAET,OAAO,CAACS,SAAS;IAC5BC,OAAO,EAAEV,OAAO,CAACU,OAAO;IACxBC,
|
|
1
|
+
{"version":3,"file":"auth.js","names":["_checkPermissions","require","auth","authenticate","newAuth","Object","assign","org","username","userInstanceId","loginFrom","accessRule","isAdmin","csrfToken","license","accessToken","userShowValue","getAuth","logout","key","keys","undefined","resetPermissionPreChecks","isLoggedIn"],"sources":["../../src/auth.ts"],"sourcesContent":["import type { AuthApi_CheckLoginResponseBody } from \"@next-api-sdk/api-gateway-sdk\";\nimport { resetPermissionPreChecks } from \"./checkPermissions.js\";\n\nconst auth: AuthInfo = {};\n\n/** @internal */\nexport type AuthInfo = Omit<AuthApi_CheckLoginResponseBody, \"loggedIn\">;\n\n/** @internal */\nexport function authenticate(newAuth: AuthInfo): void {\n Object.assign(auth, {\n org: newAuth.org,\n username: newAuth.username,\n userInstanceId: newAuth.userInstanceId,\n loginFrom: newAuth.loginFrom,\n accessRule: newAuth.accessRule,\n isAdmin: newAuth.isAdmin,\n csrfToken: newAuth.csrfToken,\n license: newAuth.license,\n accessToken: newAuth.accessToken,\n userShowValue: newAuth.userShowValue,\n });\n}\n\n/**\n * 获取当前登录认证信息。\n *\n * @returns 当前登录认证信息。\n */\nexport function getAuth(): AuthInfo {\n return {\n ...auth,\n };\n}\n\n/** @internal */\nexport function logout(): void {\n for (const key of Object.keys(auth) as (keyof AuthInfo)[]) {\n auth[key] = undefined;\n }\n resetPermissionPreChecks();\n}\n\n/**\n * 查看当前是否已登录。\n *\n * @returns 当前是否已登录。\n */\nexport function isLoggedIn(): boolean {\n return auth.username !== undefined;\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,MAAMC,IAAc,GAAG,CAAC,CAAC;;AAEzB;;AAGA;AACO,SAASC,YAAYA,CAACC,OAAiB,EAAQ;EACpDC,MAAM,CAACC,MAAM,CAACJ,IAAI,EAAE;IAClBK,GAAG,EAAEH,OAAO,CAACG,GAAG;IAChBC,QAAQ,EAAEJ,OAAO,CAACI,QAAQ;IAC1BC,cAAc,EAAEL,OAAO,CAACK,cAAc;IACtCC,SAAS,EAAEN,OAAO,CAACM,SAAS;IAC5BC,UAAU,EAAEP,OAAO,CAACO,UAAU;IAC9BC,OAAO,EAAER,OAAO,CAACQ,OAAO;IACxBC,SAAS,EAAET,OAAO,CAACS,SAAS;IAC5BC,OAAO,EAAEV,OAAO,CAACU,OAAO;IACxBC,WAAW,EAAEX,OAAO,CAACW,WAAW;IAChCC,aAAa,EAAEZ,OAAO,CAACY;EACzB,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAAA,EAAa;EAClC,OAAO;IACL,GAAGf;EACL,CAAC;AACH;;AAEA;AACO,SAASgB,MAAMA,CAAA,EAAS;EAC7B,KAAK,MAAMC,GAAG,IAAId,MAAM,CAACe,IAAI,CAAClB,IAAI,CAAC,EAAwB;IACzDA,IAAI,CAACiB,GAAG,CAAC,GAAGE,SAAS;EACvB;EACA,IAAAC,0CAAwB,EAAC,CAAC;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAA,EAAY;EACpC,OAAOrB,IAAI,CAACM,QAAQ,KAAKa,SAAS;AACpC","ignoreList":[]}
|
package/dist/esm/auth.js
CHANGED
package/dist/esm/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":["resetPermissionPreChecks","auth","authenticate","newAuth","Object","assign","org","username","userInstanceId","loginFrom","accessRule","isAdmin","csrfToken","license","userShowValue","getAuth","_objectSpread","logout","key","keys","undefined","isLoggedIn"],"sources":["../../src/auth.ts"],"sourcesContent":["import type { AuthApi_CheckLoginResponseBody } from \"@next-api-sdk/api-gateway-sdk\";\nimport { resetPermissionPreChecks } from \"./checkPermissions.js\";\n\nconst auth: AuthInfo = {};\n\n/** @internal */\nexport type AuthInfo = Omit<AuthApi_CheckLoginResponseBody, \"loggedIn\">;\n\n/** @internal */\nexport function authenticate(newAuth: AuthInfo): void {\n Object.assign(auth, {\n org: newAuth.org,\n username: newAuth.username,\n userInstanceId: newAuth.userInstanceId,\n loginFrom: newAuth.loginFrom,\n accessRule: newAuth.accessRule,\n isAdmin: newAuth.isAdmin,\n csrfToken: newAuth.csrfToken,\n license: newAuth.license,\n userShowValue: newAuth.userShowValue,\n });\n}\n\n/**\n * 获取当前登录认证信息。\n *\n * @returns 当前登录认证信息。\n */\nexport function getAuth(): AuthInfo {\n return {\n ...auth,\n };\n}\n\n/** @internal */\nexport function logout(): void {\n for (const key of Object.keys(auth) as (keyof AuthInfo)[]) {\n auth[key] = undefined;\n }\n resetPermissionPreChecks();\n}\n\n/**\n * 查看当前是否已登录。\n *\n * @returns 当前是否已登录。\n */\nexport function isLoggedIn(): boolean {\n return auth.username !== undefined;\n}\n"],"mappings":";AACA,SAASA,wBAAwB,QAAQ,uBAAuB;AAEhE,IAAMC,IAAc,GAAG,CAAC,CAAC;;AAEzB;;AAGA;AACA,OAAO,SAASC,YAAYA,CAACC,OAAiB,EAAQ;EACpDC,MAAM,CAACC,MAAM,CAACJ,IAAI,EAAE;IAClBK,GAAG,EAAEH,OAAO,CAACG,GAAG;IAChBC,QAAQ,EAAEJ,OAAO,CAACI,QAAQ;IAC1BC,cAAc,EAAEL,OAAO,CAACK,cAAc;IACtCC,SAAS,EAAEN,OAAO,CAACM,SAAS;IAC5BC,UAAU,EAAEP,OAAO,CAACO,UAAU;IAC9BC,OAAO,EAAER,OAAO,CAACQ,OAAO;IACxBC,SAAS,EAAET,OAAO,CAACS,SAAS;IAC5BC,OAAO,EAAEV,OAAO,CAACU,OAAO;IACxBC,
|
|
1
|
+
{"version":3,"file":"auth.js","names":["resetPermissionPreChecks","auth","authenticate","newAuth","Object","assign","org","username","userInstanceId","loginFrom","accessRule","isAdmin","csrfToken","license","accessToken","userShowValue","getAuth","_objectSpread","logout","key","keys","undefined","isLoggedIn"],"sources":["../../src/auth.ts"],"sourcesContent":["import type { AuthApi_CheckLoginResponseBody } from \"@next-api-sdk/api-gateway-sdk\";\nimport { resetPermissionPreChecks } from \"./checkPermissions.js\";\n\nconst auth: AuthInfo = {};\n\n/** @internal */\nexport type AuthInfo = Omit<AuthApi_CheckLoginResponseBody, \"loggedIn\">;\n\n/** @internal */\nexport function authenticate(newAuth: AuthInfo): void {\n Object.assign(auth, {\n org: newAuth.org,\n username: newAuth.username,\n userInstanceId: newAuth.userInstanceId,\n loginFrom: newAuth.loginFrom,\n accessRule: newAuth.accessRule,\n isAdmin: newAuth.isAdmin,\n csrfToken: newAuth.csrfToken,\n license: newAuth.license,\n accessToken: newAuth.accessToken,\n userShowValue: newAuth.userShowValue,\n });\n}\n\n/**\n * 获取当前登录认证信息。\n *\n * @returns 当前登录认证信息。\n */\nexport function getAuth(): AuthInfo {\n return {\n ...auth,\n };\n}\n\n/** @internal */\nexport function logout(): void {\n for (const key of Object.keys(auth) as (keyof AuthInfo)[]) {\n auth[key] = undefined;\n }\n resetPermissionPreChecks();\n}\n\n/**\n * 查看当前是否已登录。\n *\n * @returns 当前是否已登录。\n */\nexport function isLoggedIn(): boolean {\n return auth.username !== undefined;\n}\n"],"mappings":";AACA,SAASA,wBAAwB,QAAQ,uBAAuB;AAEhE,IAAMC,IAAc,GAAG,CAAC,CAAC;;AAEzB;;AAGA;AACA,OAAO,SAASC,YAAYA,CAACC,OAAiB,EAAQ;EACpDC,MAAM,CAACC,MAAM,CAACJ,IAAI,EAAE;IAClBK,GAAG,EAAEH,OAAO,CAACG,GAAG;IAChBC,QAAQ,EAAEJ,OAAO,CAACI,QAAQ;IAC1BC,cAAc,EAAEL,OAAO,CAACK,cAAc;IACtCC,SAAS,EAAEN,OAAO,CAACM,SAAS;IAC5BC,UAAU,EAAEP,OAAO,CAACO,UAAU;IAC9BC,OAAO,EAAER,OAAO,CAACQ,OAAO;IACxBC,SAAS,EAAET,OAAO,CAACS,SAAS;IAC5BC,OAAO,EAAEV,OAAO,CAACU,OAAO;IACxBC,WAAW,EAAEX,OAAO,CAACW,WAAW;IAChCC,aAAa,EAAEZ,OAAO,CAACY;EACzB,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAAA,EAAa;EAClC,OAAAC,aAAA,KACKhB,IAAI;AAEX;;AAEA;AACA,OAAO,SAASiB,MAAMA,CAAA,EAAS;EAC7B,KAAK,IAAMC,GAAG,IAAIf,MAAM,CAACgB,IAAI,CAACnB,IAAI,CAAC,EAAwB;IACzDA,IAAI,CAACkB,GAAG,CAAC,GAAGE,SAAS;EACvB;EACArB,wBAAwB,CAAC,CAAC;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsB,UAAUA,CAAA,EAAY;EACpC,OAAOrB,IAAI,CAACM,QAAQ,KAAKc,SAAS;AACpC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/easyops-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/easyops-runtime",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"test:ci": "cross-env NODE_ENV='test' CI=true test-next"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@next-api-sdk/api-gateway-sdk": "^1.
|
|
43
|
+
"@next-api-sdk/api-gateway-sdk": "^1.2.0",
|
|
44
44
|
"@next-api-sdk/cmdb-sdk": "^1.1.0",
|
|
45
45
|
"@next-api-sdk/micro-app-sdk": "^1.2.1",
|
|
46
46
|
"@next-api-sdk/micro-app-standalone-sdk": "^1.1.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"jest-websocket-mock": "^2.5.0",
|
|
60
60
|
"whatwg-fetch": "^3.6.20"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "f9d0ebf756ac699bba97b28001fd5ae43f3de5ef"
|
|
63
63
|
}
|