@gw2me/client 0.4.0 → 0.5.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/pkce.d.ts +11 -0
- package/dist/pkce.js +1 -0
- package/package.json +17 -6
package/dist/pkce.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface PKCEChallenge {
|
|
2
|
+
code_challenge: string;
|
|
3
|
+
code_challenge_method: 'S256';
|
|
4
|
+
}
|
|
5
|
+
interface PKCEPair {
|
|
6
|
+
challenge: PKCEChallenge;
|
|
7
|
+
code_verifier: string;
|
|
8
|
+
}
|
|
9
|
+
declare function generatePKCEPair(): Promise<PKCEPair>;
|
|
10
|
+
|
|
11
|
+
export { type PKCEChallenge, type PKCEPair, generatePKCEPair };
|
package/dist/pkce.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(e,r)=>{for(var n in r)a(e,n,{get:r[n],enumerable:!0})},h=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of i(r))!g.call(e,c)&&c!==n&&a(e,c,{get:()=>r[c],enumerable:!(t=l(r,c))||t.enumerable});return e};var s=e=>h(a({},"__esModule",{value:!0}),e);var C={};d(C,{generatePKCEPair:()=>f});module.exports=s(C);async function f(){let e=new Uint8Array(32);crypto.getRandomValues(e);let r=o(e),n=new TextEncoder,t=await crypto.subtle.digest("SHA-256",n.encode(r));return{code_verifier:r,challenge:{code_challenge_method:"S256",code_challenge:o(new Uint8Array(t))}}}function o(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}0&&(module.exports={generatePKCEPair});
|
package/package.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gw2me/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "gw2.me client library",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
"./package.json": "./package.json",
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./pkce": {
|
|
14
|
+
"types": "./dist/pkce.d.ts",
|
|
15
|
+
"default": "./dist/pkce.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
7
18
|
"repository": {
|
|
8
19
|
"type": "git",
|
|
9
20
|
"url": "git+https://github.com/GW2Treasures/gw2.me.git"
|
|
@@ -31,12 +42,12 @@
|
|
|
31
42
|
"eslint": "8.57.1",
|
|
32
43
|
"tsup": "8.3.5",
|
|
33
44
|
"typescript": "5.7.2",
|
|
34
|
-
"undici-types": "
|
|
45
|
+
"undici-types": "7.1.0"
|
|
35
46
|
},
|
|
36
47
|
"scripts": {
|
|
37
48
|
"build": "pnpm run clean && if test $CI; then pnpm run build:ci; else pnpm run build:local; fi",
|
|
38
|
-
"build:local": "tsup src/index.ts && tsc --emitDeclarationOnly --declaration --declarationMap",
|
|
39
|
-
"build:ci": "tsup src/index.ts --minify --dts",
|
|
49
|
+
"build:local": "tsup src/index.ts src/pkce.ts && tsc --emitDeclarationOnly --declaration --declarationMap",
|
|
50
|
+
"build:ci": "tsup src/index.ts src/pkce.ts --minify --dts",
|
|
40
51
|
"clean": "rm -rf dist/",
|
|
41
52
|
"lint": "eslint src",
|
|
42
53
|
"publish-package": "gw2treasures-publish-package"
|