@medipass/web-sdk 13.0.2-fix-type-issues.0 → 13.0.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.
@@ -1,6 +1,6 @@
1
- import storageEngine from "store/src/store-engine";
2
- import localStorage from "store/storages/localStorage";
3
- import sessionStorage from "store/storages/sessionStorage";
1
+ import storageEngine from "store/src/store-engine.js";
2
+ import localStorage from "store/storages/localStorage.js";
3
+ import sessionStorage from "store/storages/sessionStorage.js";
4
4
  import maskedModule from "@medipass/utils/masked";
5
5
  import { VERY_SENSITIVE_KEYS } from "@medipass/utils/sensitive-keys";
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","names":[],"sources":["../../src/services/storage.ts"],"sourcesContent":["// @ts-expect-error TS(7016): Could not find a declaration file for module 'stor... Remove this comment to see the full error message\nimport storageEngine from 'store/src/store-engine';\n// @ts-expect-error TS(7016): Could not find a declaration file for module 'stor... Remove this comment to see the full error message\nimport localStorage from 'store/storages/localStorage';\n// @ts-expect-error TS(7016): Could not find a declaration file for module 'stor... Remove this comment to see the full error message\nimport sessionStorage from 'store/storages/sessionStorage';\nimport maskedModule from '@medipass/utils/masked';\nimport { VERY_SENSITIVE_KEYS } from '@medipass/utils/sensitive-keys';\nconst STORAGE_PREFIX = 'medipass-web-sdk';\nconst PERSIST_KEYS = ['_persist', 'device', 'savedEmail', 'rememberEmail'];\nconst masked = (maskedModule as typeof maskedModule & { default?: typeof maskedModule }).default ?? maskedModule;\nexport type StoreType = 'default' | 'session';\nexport type CommonOpts = {\n storeType?: StoreType;\n};\nexport type SetOpts = CommonOpts & {\n override?: boolean;\n};\nconst noopStore = {\n // @ts-expect-error TS(7006): Parameter 'key' implicitly has an 'any' type.\n get: key => {},\n // @ts-expect-error TS(7006): Parameter 'key' implicitly has an 'any' type.\n remove: key => {},\n // @ts-expect-error TS(7006): Parameter 'val' implicitly has an 'any' type.\n each: (val, key) => {},\n // @ts-expect-error TS(7006): Parameter 'key' implicitly has an 'any' type.\n set: (key, val) => {}\n};\n\nconst stores = {\n default:\n typeof window !== 'undefined' && window.navigator.cookieEnabled\n ? storageEngine.createStore(localStorage)\n : noopStore,\n session:\n typeof window !== 'undefined' && window.navigator.cookieEnabled\n ? storageEngine.createStore(sessionStorage)\n : noopStore\n};\nconst storeTypes = Object.keys(stores);\nexport const clearAll = (opts: CommonOpts = {}) => {\n // @ts-expect-error TS(7006): Parameter 'storeType' implicitly has an 'any' type... Remove this comment to see the full error message\n function clear(storeType) {\n // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message\n stores[storeType].each((val, key) => {\n key = key.replace(`${STORAGE_PREFIX}.`, '');\n const shouldPersist = PERSIST_KEYS.some(persistKey => key.includes(persistKey));\n\n if (shouldPersist) {\n return;\n }\n\n // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message\n stores[storeType].remove(`${STORAGE_PREFIX}.${key}`);\n });\n }\n\n // If a store type has been chosen, then clear all from that store type. Otherwise, clear all from every store type.\n if (opts.storeType) {\n clear(opts.storeType);\n } else {\n storeTypes.forEach(storeType => clear(storeType));\n }\n};\nexport const get = (key: string, opts: CommonOpts = {}) => {\n const storeType = opts.storeType || 'default';\n return stores[storeType].get(`${STORAGE_PREFIX}.${key}`);\n};\nexport const remove = (key: string, opts: CommonOpts = {}) => {\n // If a store type has been chosen, then clear all from that store type. Otherwise, clear all from every store type.\n if (opts.storeType) {\n stores[opts.storeType].remove(`${STORAGE_PREFIX}.${key}`);\n } else {\n // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message\n storeTypes.forEach(storeType => stores[storeType].remove(`${STORAGE_PREFIX}.${key}`));\n }\n};\nexport const set = (key: string, val: any, opts: SetOpts = {}) => {\n const storeType = opts.storeType || 'default';\n\n if (opts && opts.override) {\n stores[storeType].set(\n `${STORAGE_PREFIX}.${key}`,\n masked({ ...get(key), ...val }, VERY_SENSITIVE_KEYS, {\n omitKeys: true\n })\n );\n return;\n }\n\n stores[storeType].set(\n `${STORAGE_PREFIX}.${key}`,\n masked(val, VERY_SENSITIVE_KEYS, {\n omitKeys: true\n })\n );\n};\n\nconst _createStorageResource = (key: string) => ({\n get: () => get(key),\n set: (value: any, opts?: SetOpts) => set(key, value, opts),\n remove: () => remove(key)\n});\n\nconst storage = {\n clearAll,\n remove,\n get,\n set,\n onboardingStatus: _createStorageResource('onboardingStatus'),\n previousCreatePHITransactionFormValues: _createStorageResource('previousTransactionFormValues')\n};\n\nexport default storage;\n"],"mappings":";;;;;;;AAQA,MAAM,iBAAiB;AACvB,MAAM,eAAe;CAAC;CAAY;CAAU;CAAc;CAAgB;AAC1E,MAAM,SAAU,aAAyE,WAAW;AAQpG,MAAM,YAAY;CAEhB,MAAK,QAAO;CAEZ,SAAQ,QAAO;CAEf,OAAO,KAAK,QAAQ;CAEpB,MAAM,KAAK,QAAQ;CACpB;AAED,MAAM,SAAS;CACb,SACE,OAAO,WAAW,eAAe,OAAO,UAAU,gBAC9C,cAAc,YAAY,aAAa,GACvC;CACN,SACE,OAAO,WAAW,eAAe,OAAO,UAAU,gBAC9C,cAAc,YAAY,eAAe,GACzC;CACP;AACD,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAa,YAAY,OAAmB,EAAE,KAAK;CAEjD,SAAS,MAAM,WAAW;AAExB,SAAO,WAAW,MAAM,KAAK,QAAQ;AACnC,SAAM,IAAI,QAAQ,GAAG,eAAe,IAAI,GAAG;AAG3C,OAFsB,aAAa,MAAK,eAAc,IAAI,SAAS,WAAW,CAAC,CAG7E;AAIF,UAAO,WAAW,OAAO,GAAG,eAAe,GAAG,MAAM;IACpD;;AAIJ,KAAI,KAAK,UACP,OAAM,KAAK,UAAU;KAErB,YAAW,SAAQ,cAAa,MAAM,UAAU,CAAC;;AAGrD,MAAa,OAAO,KAAa,OAAmB,EAAE,KAAK;AAEzD,QAAO,OADW,KAAK,aAAa,WACX,IAAI,GAAG,eAAe,GAAG,MAAM;;AAE1D,MAAa,UAAU,KAAa,OAAmB,EAAE,KAAK;AAE5D,KAAI,KAAK,UACP,QAAO,KAAK,WAAW,OAAO,GAAG,eAAe,GAAG,MAAM;KAGzD,YAAW,SAAQ,cAAa,OAAO,WAAW,OAAO,GAAG,eAAe,GAAG,MAAM,CAAC;;AAGzF,MAAa,OAAO,KAAa,KAAU,OAAgB,EAAE,KAAK;CAChE,MAAM,YAAY,KAAK,aAAa;AAEpC,KAAI,QAAQ,KAAK,UAAU;AACzB,SAAO,WAAW,IAChB,GAAG,eAAe,GAAG,OACrB,OAAO;GAAE,GAAG,IAAI,IAAI;GAAE,GAAG;GAAK,EAAE,qBAAqB,EACnD,UAAU,MACX,CAAC,CACH;AACD;;AAGF,QAAO,WAAW,IAChB,GAAG,eAAe,GAAG,OACrB,OAAO,KAAK,qBAAqB,EAC/B,UAAU,MACX,CAAC,CACH;;AAGH,MAAM,0BAA0B,SAAiB;CAC/C,WAAW,IAAI,IAAI;CACnB,MAAM,OAAY,SAAmB,IAAI,KAAK,OAAO,KAAK;CAC1D,cAAc,OAAO,IAAI;CAC1B;AAED,MAAM,UAAU;CACd;CACA;CACA;CACA;CACA,kBAAkB,uBAAuB,mBAAmB;CAC5D,wCAAwC,uBAAuB,gCAAgC;CAChG;AAED,sBAAe"}
1
+ {"version":3,"file":"storage.js","names":[],"sources":["../../src/services/storage.ts"],"sourcesContent":["// @ts-expect-error TS(7016): Could not find a declaration file for module 'stor... Remove this comment to see the full error message\nimport storageEngine from 'store/src/store-engine.js';\n// @ts-expect-error TS(7016): Could not find a declaration file for module 'stor... Remove this comment to see the full error message\nimport localStorage from 'store/storages/localStorage.js';\n// @ts-expect-error TS(7016): Could not find a declaration file for module 'stor... Remove this comment to see the full error message\nimport sessionStorage from 'store/storages/sessionStorage.js';\nimport maskedModule from '@medipass/utils/masked';\nimport { VERY_SENSITIVE_KEYS } from '@medipass/utils/sensitive-keys';\nconst STORAGE_PREFIX = 'medipass-web-sdk';\nconst PERSIST_KEYS = ['_persist', 'device', 'savedEmail', 'rememberEmail'];\nconst masked = (maskedModule as typeof maskedModule & { default?: typeof maskedModule }).default ?? maskedModule;\nexport type StoreType = 'default' | 'session';\nexport type CommonOpts = {\n storeType?: StoreType;\n};\nexport type SetOpts = CommonOpts & {\n override?: boolean;\n};\nconst noopStore = {\n // @ts-expect-error TS(7006): Parameter 'key' implicitly has an 'any' type.\n get: key => {},\n // @ts-expect-error TS(7006): Parameter 'key' implicitly has an 'any' type.\n remove: key => {},\n // @ts-expect-error TS(7006): Parameter 'val' implicitly has an 'any' type.\n each: (val, key) => {},\n // @ts-expect-error TS(7006): Parameter 'key' implicitly has an 'any' type.\n set: (key, val) => {}\n};\n\nconst stores = {\n default:\n typeof window !== 'undefined' && window.navigator.cookieEnabled\n ? storageEngine.createStore(localStorage)\n : noopStore,\n session:\n typeof window !== 'undefined' && window.navigator.cookieEnabled\n ? storageEngine.createStore(sessionStorage)\n : noopStore\n};\nconst storeTypes = Object.keys(stores);\nexport const clearAll = (opts: CommonOpts = {}) => {\n // @ts-expect-error TS(7006): Parameter 'storeType' implicitly has an 'any' type... Remove this comment to see the full error message\n function clear(storeType) {\n // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message\n stores[storeType].each((val, key) => {\n key = key.replace(`${STORAGE_PREFIX}.`, '');\n const shouldPersist = PERSIST_KEYS.some(persistKey => key.includes(persistKey));\n\n if (shouldPersist) {\n return;\n }\n\n // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message\n stores[storeType].remove(`${STORAGE_PREFIX}.${key}`);\n });\n }\n\n // If a store type has been chosen, then clear all from that store type. Otherwise, clear all from every store type.\n if (opts.storeType) {\n clear(opts.storeType);\n } else {\n storeTypes.forEach(storeType => clear(storeType));\n }\n};\nexport const get = (key: string, opts: CommonOpts = {}) => {\n const storeType = opts.storeType || 'default';\n return stores[storeType].get(`${STORAGE_PREFIX}.${key}`);\n};\nexport const remove = (key: string, opts: CommonOpts = {}) => {\n // If a store type has been chosen, then clear all from that store type. Otherwise, clear all from every store type.\n if (opts.storeType) {\n stores[opts.storeType].remove(`${STORAGE_PREFIX}.${key}`);\n } else {\n // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message\n storeTypes.forEach(storeType => stores[storeType].remove(`${STORAGE_PREFIX}.${key}`));\n }\n};\nexport const set = (key: string, val: any, opts: SetOpts = {}) => {\n const storeType = opts.storeType || 'default';\n\n if (opts && opts.override) {\n stores[storeType].set(\n `${STORAGE_PREFIX}.${key}`,\n masked({ ...get(key), ...val }, VERY_SENSITIVE_KEYS, {\n omitKeys: true\n })\n );\n return;\n }\n\n stores[storeType].set(\n `${STORAGE_PREFIX}.${key}`,\n masked(val, VERY_SENSITIVE_KEYS, {\n omitKeys: true\n })\n );\n};\n\nconst _createStorageResource = (key: string) => ({\n get: () => get(key),\n set: (value: any, opts?: SetOpts) => set(key, value, opts),\n remove: () => remove(key)\n});\n\nconst storage = {\n clearAll,\n remove,\n get,\n set,\n onboardingStatus: _createStorageResource('onboardingStatus'),\n previousCreatePHITransactionFormValues: _createStorageResource('previousTransactionFormValues')\n};\n\nexport default storage;\n"],"mappings":";;;;;;;AAQA,MAAM,iBAAiB;AACvB,MAAM,eAAe;CAAC;CAAY;CAAU;CAAc;CAAgB;AAC1E,MAAM,SAAU,aAAyE,WAAW;AAQpG,MAAM,YAAY;CAEhB,MAAK,QAAO;CAEZ,SAAQ,QAAO;CAEf,OAAO,KAAK,QAAQ;CAEpB,MAAM,KAAK,QAAQ;CACpB;AAED,MAAM,SAAS;CACb,SACE,OAAO,WAAW,eAAe,OAAO,UAAU,gBAC9C,cAAc,YAAY,aAAa,GACvC;CACN,SACE,OAAO,WAAW,eAAe,OAAO,UAAU,gBAC9C,cAAc,YAAY,eAAe,GACzC;CACP;AACD,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAa,YAAY,OAAmB,EAAE,KA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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medipass/web-sdk",
3
- "version": "13.0.2-fix-type-issues.0",
3
+ "version": "13.0.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -116,7 +116,7 @@
116
116
  "store": "2.0.12"
117
117
  },
118
118
  "devDependencies": {
119
- "@medipass/utils": "^12.0.2-fix-type-issues.0",
119
+ "@medipass/utils": "^12.0.2",
120
120
  "@types/applepayjs": "14.0.8",
121
121
  "@types/googlepay": "0.7.6",
122
122
  "@types/lodash": "4.17.24",
@@ -129,5 +129,5 @@
129
129
  "vite-tsconfig-paths": "6.1.1",
130
130
  "vitest": "4.1.5"
131
131
  },
132
- "gitHead": "ad8958c085a1d7e04bf85122ffb46c6cc108e13d"
132
+ "gitHead": "ae93e7b60f7ca0f97122df6bf9148ce27bca20cf"
133
133
  }