@opencampus/ocid-connect-js 2.0.0 → 2.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.
@@ -2,5 +2,4 @@ export default function LoginButton({ pill, disabled, theme, }: {
2
2
  pill: any;
3
3
  disabled: any;
4
4
  theme: any;
5
- }): React.JSX.Element;
6
- import React from 'react';
5
+ }): any;
@@ -3,5 +3,4 @@ declare function OCConnect({ children, opts, sandboxMode }: {
3
3
  children: any;
4
4
  opts: any;
5
5
  sandboxMode: any;
6
- }): React.JSX.Element;
7
- import React from 'react';
6
+ }): any;
@@ -1,3 +1,2 @@
1
- export const OCContext: React.Context<any>;
1
+ export const OCContext: any;
2
2
  export function useOCAuth(): any;
3
- import * as React from 'react';
@@ -2,5 +2,4 @@ export default OCSpinner;
2
2
  declare function OCSpinner({ width, height }: {
3
3
  width: any;
4
4
  height: any;
5
- }): React.JSX.Element;
6
- import React from 'react';
5
+ }): any;
@@ -2,6 +2,8 @@ export class CookieStorageProvider {
2
2
  constructor(options?: {});
3
3
  domain: any;
4
4
  sameSite: any;
5
+ keyPrefix: any;
6
+ getKey(key: any): any;
5
7
  getItem(key: any): any;
6
8
  setItem(key: any, value: any): any;
7
9
  removeItem(key: any): any;
@@ -13,13 +13,13 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
13
13
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*!
16
- * Copyright 2024-Present Animoca Brands Corporation Ltd.
17
- *
18
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
19
- *
20
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ * Copyright 2024-Present Animoca Brands Corporation Ltd.
17
+ *
18
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
24
  var CookieStorageProvider = exports.CookieStorageProvider = /*#__PURE__*/function () {
25
25
  function CookieStorageProvider() {
@@ -27,13 +27,20 @@ var CookieStorageProvider = exports.CookieStorageProvider = /*#__PURE__*/functio
27
27
  _classCallCheck(this, CookieStorageProvider);
28
28
  _defineProperty(this, "domain", void 0);
29
29
  _defineProperty(this, "sameSite", void 0);
30
+ _defineProperty(this, "keyPrefix", void 0);
30
31
  this.domain = options.domain;
31
32
  this.sameSite = options.sameSite;
33
+ this.keyPrefix = options.cookieKeyPrefix;
32
34
  }
33
35
  return _createClass(CookieStorageProvider, [{
36
+ key: "getKey",
37
+ value: function getKey(key) {
38
+ return this.keyPrefix ? "".concat(this.keyPrefix, "-").concat(key) : key;
39
+ }
40
+ }, {
34
41
  key: "getItem",
35
42
  value: function getItem(key) {
36
- return _jsCookie["default"].get(key);
43
+ return _jsCookie["default"].get(this.getKey(key));
37
44
  }
38
45
  }, {
39
46
  key: "setItem",
@@ -51,12 +58,12 @@ var CookieStorageProvider = exports.CookieStorageProvider = /*#__PURE__*/functio
51
58
  }
52
59
 
53
60
  // if sameSite is undefined or null, leave default browser behavior
54
- return _jsCookie["default"].set(key, value, cookieOptions);
61
+ return _jsCookie["default"].set(this.getKey(key), value, cookieOptions);
55
62
  }
56
63
  }, {
57
64
  key: "removeItem",
58
65
  value: function removeItem(key) {
59
- return _jsCookie["default"].remove(key, {
66
+ return _jsCookie["default"].remove(this.getKey(key), {
60
67
  path: '/',
61
68
  domain: this.domain
62
69
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencampus/ocid-connect-js",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "author": "Animoca Brands",
5
5
  "license": "MIT",
6
6
  "description": "OCID Connector Library",
@@ -19,14 +19,14 @@
19
19
  "precommit": "lint-staged"
20
20
  },
21
21
  "devDependencies": {
22
- "@babel/cli": "^7.0.0",
22
+ "@babel/cli": "^7.16.0",
23
23
  "@babel/core": "^7.16.0",
24
24
  "@babel/eslint-parser": "^7.16.3",
25
25
  "@babel/plugin-proposal-class-properties": "^7.1.0",
26
26
  "@babel/polyfill": "^7.0.0",
27
27
  "@babel/preset-env": "^7.1.0",
28
28
  "@babel/preset-react": "^7.0.0",
29
- "@testing-library/react": "^13.3.0",
29
+ "@testing-library/react": "^16.0.0",
30
30
  "@testing-library/user-event": "^14.3.0",
31
31
  "@types/node": "^22.10.3",
32
32
  "autoprefixer": "^7.1.2",
@@ -48,24 +48,24 @@
48
48
  "postcss-loader": "^1.3.3",
49
49
  "prettier": "^1.14.3",
50
50
  "raf": "^3.4.0",
51
- "react": "^18.0.0",
52
- "react-dom": "^18.0.0",
51
+ "react": "^19.0.0",
52
+ "react-dom": "^19.0.0",
53
+ "regenerator-runtime": "^0.14.1",
53
54
  "sinon": "^2.1.0",
54
55
  "style-loader": "^0.16.1",
55
56
  "typescript": "^5.7.2",
56
57
  "typescript-json-schema": "^0.65.1",
57
58
  "uglifyjs-webpack-plugin": "^2.0.1",
58
59
  "webpack": "^4.21.0",
59
- "webpack-cli": "^3.1.2",
60
- "regenerator-runtime": "^0.14.1"
60
+ "webpack-cli": "^3.1.2"
61
61
  },
62
62
  "dependencies": {
63
- "tiny-emitter": "^2.1.0",
64
- "js-cookie": "^3.0.5"
63
+ "js-cookie": "^3.0.5",
64
+ "tiny-emitter": "^2.1.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "react": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0",
68
- "react-dom": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0"
67
+ "react": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
68
+ "react-dom": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
69
69
  },
70
70
  "lint-staged": {
71
71
  "*.{js,json,md}": [
@@ -86,4 +86,4 @@
86
86
  ]
87
87
  }
88
88
  ]
89
- }
89
+ }