@logto/node 1.0.0-beta.3 → 1.0.0-beta.4
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/lib/index.d.ts.map +1 -1
- package/package.json +13 -13
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAEA,eAAe,MAAM,CAAC;
|
|
1
|
+
{"mappings":";AAEA,eAAe,MAAM,CAAC;IAGpB,UAAU,eAAe;QACvB,IAAI,EAAE,YAAY,CAAC;KACpB;CACF;AAED,2BAA2B;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AENF,YAAY,EACV,aAAa,EACb,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,OAAO,EACP,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnG,gCAAiC,SAAQ,UAAU;gBACrC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,SAAS,CAAC;IA6BrF,UAAU,gCAAmC,QAAQ,YAAY,CAAC,CA+BhE;CACH","sources":["packages/node/src/src/types.ts","packages/node/src/src/utils/generators.ts","packages/node/src/src/index.ts","packages/node/src/index.ts"],"sourcesContent":[null,null,null,"import BaseClient, { LogtoConfig, createRequester, ClientAdapter } from '@logto/client';\nimport fetch from 'node-fetch';\n\nimport { LogtoContext } from './types';\nimport { generateCodeChallenge, generateCodeVerifier, generateState } from './utils/generators';\n\nexport type { LogtoContext } from './types';\n\nexport type {\n IdTokenClaims,\n LogtoErrorCode,\n LogtoConfig,\n LogtoClientErrorCode,\n Storage,\n StorageKey,\n} from '@logto/client';\nexport { LogtoError, OidcError, Prompt, LogtoRequestError, LogtoClientError } from '@logto/client';\n\nexport default class LogtoClient extends BaseClient {\n constructor(config: LogtoConfig, adapter: Pick<ClientAdapter, 'navigate' | 'storage'>) {\n super(config, {\n ...adapter,\n requester: createRequester(\n config.appSecret\n ? async (...args: Parameters<typeof fetch>) => {\n const [input, init] = args;\n\n return fetch(input, {\n ...init,\n headers: {\n ...init?.headers,\n\n authorization: `basic ${Buffer.from(\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `${config.appId}:${config.appSecret}`,\n 'utf8'\n ).toString('base64')}`,\n },\n });\n }\n : fetch\n ),\n generateCodeChallenge,\n generateCodeVerifier,\n generateState,\n });\n }\n\n getContext = async (getAccessToken = false): Promise<LogtoContext> => {\n const isAuthenticated = await this.isAuthenticated();\n\n if (!isAuthenticated) {\n return {\n isAuthenticated,\n };\n }\n\n const claims = await this.getIdTokenClaims();\n\n if (!getAccessToken) {\n return {\n isAuthenticated,\n claims,\n };\n }\n\n try {\n const accessToken = await this.getAccessToken();\n\n return {\n isAuthenticated,\n claims: await this.getIdTokenClaims(),\n accessToken,\n };\n } catch {\n return {\n isAuthenticated: false,\n };\n }\n };\n}\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/node",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.4",
|
|
4
4
|
"source": "./src/index.ts",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -29,28 +29,28 @@
|
|
|
29
29
|
"prepack": "pnpm test"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@logto/client": "^1.0.0-beta.
|
|
33
|
-
"@silverhand/essentials": "^1.
|
|
32
|
+
"@logto/client": "^1.0.0-beta.4",
|
|
33
|
+
"@silverhand/essentials": "^1.2.0",
|
|
34
34
|
"js-base64": "^3.7.2",
|
|
35
35
|
"node-fetch": "^2.6.7"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@jest/types": "^27.5.1",
|
|
39
|
-
"@parcel/core": "^2.
|
|
40
|
-
"@parcel/packager-ts": "^2.
|
|
41
|
-
"@parcel/transformer-typescript-types": "^2.
|
|
42
|
-
"@silverhand/eslint-config": "^0.
|
|
43
|
-
"@silverhand/ts-config": "^0.
|
|
39
|
+
"@parcel/core": "^2.7.0",
|
|
40
|
+
"@parcel/packager-ts": "^2.7.0",
|
|
41
|
+
"@parcel/transformer-typescript-types": "^2.7.0",
|
|
42
|
+
"@silverhand/eslint-config": "^1.0.0",
|
|
43
|
+
"@silverhand/ts-config": "^1.0.0",
|
|
44
44
|
"@types/jest": "^27.4.0",
|
|
45
|
-
"eslint": "^8.
|
|
45
|
+
"eslint": "^8.23.0",
|
|
46
46
|
"jest": "^27.5.1",
|
|
47
47
|
"jest-location-mock": "^1.0.9",
|
|
48
48
|
"jest-matcher-specific-error": "^1.0.0",
|
|
49
49
|
"lint-staged": "^13.0.0",
|
|
50
|
-
"parcel": "^2.
|
|
51
|
-
"prettier": "^2.
|
|
50
|
+
"parcel": "^2.7.0",
|
|
51
|
+
"prettier": "^2.7.1",
|
|
52
52
|
"ts-jest": "^27.0.4",
|
|
53
|
-
"typescript": "
|
|
53
|
+
"typescript": "4.7.4"
|
|
54
54
|
},
|
|
55
55
|
"eslintConfig": {
|
|
56
56
|
"extends": "@silverhand"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "8b0f8947ac211fd8d4b6e2e00ce6acfc9dd344db"
|
|
72
72
|
}
|