@orderingstack/front-hooks 3.11.0 → 3.12.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/index.cjs.js +1 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +4 -7835
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/pkce.d.ts +2 -2
- package/dist/src/pkce.d.ts.map +1 -1
- package/dist/src/storage.d.ts +14 -0
- package/dist/src/storage.d.ts.map +1 -0
- package/dist/web.js +2 -0
- package/dist/web.js.map +1 -0
- package/package.json +4 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export * from './useChannelAvailability';
|
|
|
8
8
|
export * from './useMediaUrl';
|
|
9
9
|
export * from './utils';
|
|
10
10
|
export { isChannelOpen } from './utils/timeAvailabilityFilter';
|
|
11
|
-
export
|
|
11
|
+
export * from './pkce';
|
|
12
|
+
export * from './storage';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
package/dist/src/pkce.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export declare enum CodeChallengeEncoding {
|
|
|
4
4
|
Base64Url = 0,
|
|
5
5
|
UriEncodedBase64 = 1
|
|
6
6
|
}
|
|
7
|
+
export declare function generateCodeChallenge(code_verifier: string, encoding: CodeChallengeEncoding): string;
|
|
7
8
|
export declare type PkceChallenge = {
|
|
8
9
|
code_verifier: string;
|
|
9
10
|
code_challenge: string;
|
|
10
11
|
};
|
|
11
|
-
declare function generatePkceChallenge(encoding?: CodeChallengeEncoding, length?: number): PkceChallenge;
|
|
12
|
+
export declare function generatePkceChallenge(encoding?: CodeChallengeEncoding, length?: number): PkceChallenge;
|
|
12
13
|
export declare function verifyChallenge(code_verifier: string, code_challenge: string, encoding: CodeChallengeEncoding): boolean;
|
|
13
|
-
export default generatePkceChallenge;
|
|
14
14
|
//# sourceMappingURL=pkce.d.ts.map
|
package/dist/src/pkce.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkce.d.ts","sourceRoot":"","sources":["pkce.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pkce.d.ts","sourceRoot":"","sources":["pkce.ts"],"names":[],"mappings":"AAWA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,YAQ3C;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,oBAAY,qBAAqB;IAC/B,SAAS,IAAA;IACT,gBAAgB,IAAA;CACjB;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,qBAAqB,GAC9B,MAAM,CAMR;AAED,oBAAY,aAAa,GAAG;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,QAAQ,GAAE,qBAAuD,EACjE,MAAM,SAAM,GACX,aAAa,CAQf;AAED,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,qBAAqB,WAGhC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IRefreshTokenStorageHandler } from '@orderingstack/ordering-core';
|
|
2
|
+
export interface IStorage {
|
|
3
|
+
get: (key: string) => Promise<string | null>;
|
|
4
|
+
set: (key: string, value: string) => Promise<void | {
|
|
5
|
+
value: boolean;
|
|
6
|
+
}> | void;
|
|
7
|
+
remove: (key: string) => Promise<void | {
|
|
8
|
+
value: boolean;
|
|
9
|
+
}> | void;
|
|
10
|
+
}
|
|
11
|
+
export declare const storage: IStorage;
|
|
12
|
+
export declare const localStorage: IStorage;
|
|
13
|
+
export declare const tokenStorageHandler: IRefreshTokenStorageHandler;
|
|
14
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAI3E,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7C,GAAG,EAAE,CACH,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,KACV,OAAO,CAAC,IAAI,GAAG;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;CACpE;AAqBD,eAAO,MAAM,OAAO,EAAE,QAUrB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAO1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,2BAKjC,CAAC"}
|
package/dist/web.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=require("./index.js");require("react");require("@orderingstack/ordering-core-react");require("react-i18next");class i extends t.WebPlugin{constructor(){super(...arguments),this.PREFIX="cap_sec_",this.addPrefix=e=>this.PREFIX+e,this.removePrefix=e=>e.replace(this.PREFIX,"")}get(e){const r=localStorage.getItem(this.addPrefix(e.key));return r!==null?Promise.resolve({value:atob(r)}):Promise.reject("Item with given key does not exist")}set(e){return localStorage.setItem(this.addPrefix(e.key),btoa(e.value)),Promise.resolve({value:!0})}remove(e){return localStorage.getItem(this.addPrefix(e.key))?(localStorage.removeItem(this.addPrefix(e.key)),Promise.resolve({value:!0})):Promise.reject("Item with given key does not exist")}clear(){for(const e in localStorage)e.indexOf(this.PREFIX)===0&&localStorage.removeItem(e);return Promise.resolve({value:!0})}keys(){const e=Object.keys(localStorage).filter(r=>r.indexOf(this.PREFIX)===0).map(this.removePrefix);return Promise.resolve({value:e})}getPlatform(){return Promise.resolve({value:"web"})}}exports.SecureStoragePluginWeb=i;
|
|
2
|
+
//# sourceMappingURL=web.js.map
|
package/dist/web.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sources":["../node_modules/capacitor-secure-storage-plugin/dist/esm/web.js"],"sourcesContent":["import { WebPlugin } from '@capacitor/core';\nexport class SecureStoragePluginWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.PREFIX = 'cap_sec_';\n this.addPrefix = (key) => this.PREFIX + key;\n this.removePrefix = (key) => key.replace(this.PREFIX, '');\n }\n get(options) {\n const value = localStorage.getItem(this.addPrefix(options.key));\n return value !== null\n ? Promise.resolve({\n value: atob(value),\n })\n : Promise.reject('Item with given key does not exist');\n }\n set(options) {\n localStorage.setItem(this.addPrefix(options.key), btoa(options.value));\n return Promise.resolve({ value: true });\n }\n remove(options) {\n if (localStorage.getItem(this.addPrefix(options.key))) {\n localStorage.removeItem(this.addPrefix(options.key));\n return Promise.resolve({ value: true });\n }\n else {\n return Promise.reject('Item with given key does not exist');\n }\n }\n clear() {\n for (const key in localStorage) {\n if (key.indexOf(this.PREFIX) === 0) {\n localStorage.removeItem(key);\n }\n }\n return Promise.resolve({ value: true });\n }\n keys() {\n const keys = Object.keys(localStorage)\n .filter(k => k.indexOf(this.PREFIX) === 0)\n .map(this.removePrefix);\n return Promise.resolve({ value: keys });\n }\n getPlatform() {\n return Promise.resolve({ value: 'web' });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["WebPlugin"],"mappings":"oMACO,MAAM,SAA+BA,GAAAA,SAAU,CAClD,aAAc,CACV,MAAM,GAAG,SAAS,EAClB,KAAK,OAAS,WACd,KAAK,UAAY,AAAC,GAAQ,KAAK,OAAS,EACxC,KAAK,aAAe,AAAC,GAAQ,EAAI,QAAQ,KAAK,OAAQ,EAAE,CAC3D,CACD,IAAI,EAAS,CACT,KAAM,GAAQ,aAAa,QAAQ,KAAK,UAAU,EAAQ,GAAG,CAAC,EAC9D,MAAO,KAAU,KACX,QAAQ,QAAQ,CACd,MAAO,KAAK,CAAK,CACjC,CAAa,EACC,QAAQ,OAAO,oCAAoC,CAC5D,CACD,IAAI,EAAS,CACT,oBAAa,QAAQ,KAAK,UAAU,EAAQ,GAAG,EAAG,KAAK,EAAQ,KAAK,CAAC,EAC9D,QAAQ,QAAQ,CAAE,MAAO,EAAM,CAAA,CACzC,CACD,OAAO,EAAS,CACZ,MAAI,cAAa,QAAQ,KAAK,UAAU,EAAQ,GAAG,CAAC,EAChD,cAAa,WAAW,KAAK,UAAU,EAAQ,GAAG,CAAC,EAC5C,QAAQ,QAAQ,CAAE,MAAO,EAAM,CAAA,GAG/B,QAAQ,OAAO,oCAAoC,CAEjE,CACD,OAAQ,CACJ,SAAW,KAAO,cACd,AAAI,EAAI,QAAQ,KAAK,MAAM,IAAM,GAC7B,aAAa,WAAW,CAAG,EAGnC,MAAO,SAAQ,QAAQ,CAAE,MAAO,EAAM,CAAA,CACzC,CACD,MAAO,CACH,KAAM,GAAO,OAAO,KAAK,YAAY,EAChC,OAAO,GAAK,EAAE,QAAQ,KAAK,MAAM,IAAM,CAAC,EACxC,IAAI,KAAK,YAAY,EAC1B,MAAO,SAAQ,QAAQ,CAAE,MAAO,CAAM,CAAA,CACzC,CACD,aAAc,CACV,MAAO,SAAQ,QAAQ,CAAE,MAAO,KAAO,CAAA,CAC1C,CACL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orderingstack/front-hooks",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
"prepublishOnly": "npm run build"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
+
"@capacitor/core": "^4.7.3",
|
|
18
19
|
"@orderingstack/ordering-core": "^1.0.1",
|
|
19
20
|
"@orderingstack/ordering-types": "^1.2.0",
|
|
21
|
+
"capacitor-secure-storage-plugin": "^0.8.1",
|
|
20
22
|
"crypto-js": "^4.1.1",
|
|
21
23
|
"dayjs": "^1.11.3",
|
|
22
24
|
"lodash": "^4.17.21",
|
|
@@ -29,6 +31,7 @@
|
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
33
|
"@orderingstack/ordering-core-react": "^1.0.0",
|
|
34
|
+
"@types/crypto-js": "^4.1.1",
|
|
32
35
|
"@types/node": "^17.0.8",
|
|
33
36
|
"@types/react": "^17.0.38",
|
|
34
37
|
"@vitejs/plugin-react": "^1.1.4",
|