@opencampus/ocid-connect-js 1.2.3 → 1.2.6

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.
Files changed (37) hide show
  1. package/README.md +11 -7
  2. package/dist/ocid-connect-js.js +165 -74
  3. package/dist/ocid-connect-js.js.map +1 -1
  4. package/lib/index.d.ts +2 -0
  5. package/lib/react/LoginButton.d.ts +6 -0
  6. package/lib/react/LoginCallBack.d.ts +7 -0
  7. package/lib/react/LoginCallBack.js +2 -1
  8. package/lib/react/OCConnect.d.ts +7 -0
  9. package/lib/react/OCConnect.js +12 -8
  10. package/lib/react/OCContext.d.ts +3 -0
  11. package/lib/react/index.d.ts +4 -0
  12. package/lib/sdk/auth.d.ts +31 -0
  13. package/lib/sdk/auth.js +3 -3
  14. package/lib/sdk/crypto/base64.d.ts +5 -0
  15. package/lib/sdk/crypto/index.d.ts +3 -0
  16. package/lib/sdk/crypto/verifyToken.d.ts +1 -0
  17. package/lib/sdk/crypto/webcrypto.d.ts +13 -0
  18. package/lib/sdk/endpoints/buildAuthEndpointUrl.d.ts +1 -0
  19. package/lib/sdk/endpoints/index.d.ts +1 -0
  20. package/lib/sdk/index.d.ts +2 -0
  21. package/lib/sdk/lib/AuthInfoManager.d.ts +11 -0
  22. package/lib/sdk/lib/AuthInfoManager.js +4 -1
  23. package/lib/sdk/lib/CookieStorageProvider.d.ts +8 -0
  24. package/lib/sdk/lib/CookieStorageProvider.js +16 -5
  25. package/lib/sdk/lib/StorageManager.d.ts +23 -0
  26. package/lib/sdk/lib/StorageManager.js +1 -1
  27. package/lib/sdk/lib/TokenManager.d.ts +16 -0
  28. package/lib/sdk/lib/TransactionManager.d.ts +9 -0
  29. package/lib/sdk/lib/index.d.ts +3 -0
  30. package/lib/sdk/lib/pkce.d.ts +11 -0
  31. package/lib/sdk/utils/createPkceMeta.d.ts +5 -0
  32. package/lib/sdk/utils/errors.d.ts +15 -0
  33. package/lib/sdk/utils/index.d.ts +4 -0
  34. package/lib/sdk/utils/jwtParser.d.ts +1 -0
  35. package/lib/sdk/utils/prepareTokenParams.d.ts +8 -0
  36. package/lib/sdk/utils/urlParser.d.ts +5 -0
  37. package/package.json +6 -2
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./react";
2
+ export * from "./sdk";
@@ -0,0 +1,6 @@
1
+ export default function LoginButton({ pill, disabled, theme, }: {
2
+ pill: any;
3
+ disabled: any;
4
+ theme: any;
5
+ }): React.JSX.Element;
6
+ import React from 'react';
@@ -0,0 +1,7 @@
1
+ export default LoginCallBack;
2
+ declare function LoginCallBack({ successCallback, errorCallback, customErrorComponent, customLoadingComponent }: {
3
+ successCallback: any;
4
+ errorCallback: any;
5
+ customErrorComponent: any;
6
+ customLoadingComponent: any;
7
+ }): any;
@@ -27,6 +27,7 @@ var LoginCallBack = function LoginCallBack(_ref) {
27
27
  customErrorComponent = _ref.customErrorComponent,
28
28
  customLoadingComponent = _ref.customLoadingComponent;
29
29
  var _useOCAuth = (0, _OCContext.useOCAuth)(),
30
+ isInitialized = _useOCAuth.isInitialized,
30
31
  ocAuth = _useOCAuth.ocAuth,
31
32
  authState = _useOCAuth.authState,
32
33
  setAuthError = _useOCAuth.setAuthError;
@@ -68,7 +69,7 @@ var LoginCallBack = function LoginCallBack(_ref) {
68
69
  handleLogin();
69
70
  }
70
71
  }, [ocAuth]);
71
- if (authState.error !== undefined && !errorCallback) {
72
+ if (isInitialized && authState.error !== undefined && !errorCallback) {
72
73
  return customErrorComponent ? customErrorComponent : /*#__PURE__*/_react["default"].createElement("div", null, "Error Logging in: ", authState.error.message);
73
74
  } else {
74
75
  return customLoadingComponent ? customLoadingComponent : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("h3", null, "Loading ......"));
@@ -0,0 +1,7 @@
1
+ export default OCConnect;
2
+ declare function OCConnect({ children, opts, sandboxMode }: {
3
+ children: any;
4
+ opts: any;
5
+ sandboxMode: any;
6
+ }): React.JSX.Element;
7
+ import React from 'react';
@@ -28,7 +28,7 @@ var OCConnect = function OCConnect(_ref) {
28
28
  var children = _ref.children,
29
29
  opts = _ref.opts,
30
30
  sandboxMode = _ref.sandboxMode;
31
- var _useState = (0, _react.useState)({}),
31
+ var _useState = (0, _react.useState)(),
32
32
  _useState2 = _slicedToArray(_useState, 2),
33
33
  ocAuth = _useState2[0],
34
34
  setOcAuth = _useState2[1];
@@ -40,16 +40,18 @@ var OCConnect = function OCConnect(_ref) {
40
40
  _useState6 = _slicedToArray(_useState5, 2),
41
41
  ethAddress = _useState6[0],
42
42
  setEthAddress = _useState6[1];
43
- var _useState7 = (0, _react.useState)({
44
- isAuthenticated: false
45
- }),
43
+ var _useState7 = (0, _react.useState)(),
46
44
  _useState8 = _slicedToArray(_useState7, 2),
47
45
  authState = _useState8[0],
48
46
  setAuthState = _useState8[1];
49
- var _useState9 = (0, _react.useState)(null),
47
+ var _useState9 = (0, _react.useState)(false),
50
48
  _useState10 = _slicedToArray(_useState9, 2),
51
- authError = _useState10[0],
52
- setAuthError = _useState10[1];
49
+ isInitialized = _useState10[0],
50
+ setIsInitialized = _useState10[1];
51
+ var _useState11 = (0, _react.useState)(null),
52
+ _useState12 = _slicedToArray(_useState11, 2),
53
+ authError = _useState12[0],
54
+ setAuthError = _useState12[1];
53
55
  var updateAuthState = function updateAuthState(authState) {
54
56
  setAuthState(authState);
55
57
  setOCId(authState.OCId);
@@ -61,9 +63,10 @@ var OCConnect = function OCConnect(_ref) {
61
63
  var authSdk = sandboxMode ? new _auth.OCAuthSandbox(opts) : new _auth.OCAuthLive(opts);
62
64
  updateAuthState(authSdk.getAuthState());
63
65
  setOcAuth(authSdk);
66
+ setIsInitialized(true);
64
67
  }, []);
65
68
  (0, _react.useEffect)(function () {
66
- if (ocAuth.authInfoManager) {
69
+ if (ocAuth && ocAuth.authInfoManager) {
67
70
  // reactively recieve update on the authstate change
68
71
  ocAuth.authInfoManager.subscribe(updateAuthState);
69
72
  return function () {
@@ -78,6 +81,7 @@ var OCConnect = function OCConnect(_ref) {
78
81
  ocAuth: ocAuth,
79
82
  authState: authState,
80
83
  authError: authError,
84
+ isInitialized: isInitialized,
81
85
  setAuthError: setAuthError
82
86
  }
83
87
  }, children);
@@ -0,0 +1,3 @@
1
+ export const OCContext: React.Context<any>;
2
+ export function useOCAuth(): any;
3
+ import * as React from 'react';
@@ -0,0 +1,4 @@
1
+ export { default as LoginButton } from "./LoginButton";
2
+ export { default as LoginCallBack } from "./LoginCallBack";
3
+ export { default as OCConnect } from "./OCConnect";
4
+ export * from "./OCContext";
@@ -0,0 +1,31 @@
1
+ export class OCAuthCore {
2
+ constructor(loginEndpoint: any, redirectUri: any, transactionManager: any, tokenManager: any, referralCode: any, logoutEndPoint: any);
3
+ tokenManager: any;
4
+ authInfoManager: AuthInfoManager;
5
+ transactionManager: any;
6
+ redirectUri: any;
7
+ loginEndPoint: any;
8
+ logoutEndPoint: any;
9
+ referralCode: any;
10
+ clearStorage(): void;
11
+ logout(logoutReturnTo: any): Promise<void>;
12
+ signInWithRedirect(params: any): Promise<void>;
13
+ handleLoginRedirect(): Promise<any>;
14
+ isAuthenticated(): boolean;
15
+ syncAuthInfo(): void;
16
+ getAuthState(): any;
17
+ getStateParameter(): any;
18
+ getIdToken(): any;
19
+ getAccessToken(): any;
20
+ getParsedIdToken(): any;
21
+ getParsedAccessToken(): any;
22
+ get OCId(): any;
23
+ get ethAddress(): any;
24
+ }
25
+ export class OCAuthLive extends OCAuthCore {
26
+ constructor(opts?: {});
27
+ }
28
+ export class OCAuthSandbox extends OCAuthCore {
29
+ constructor(opts?: {});
30
+ }
31
+ import AuthInfoManager from './lib/AuthInfoManager';
package/lib/sdk/auth.js CHANGED
@@ -175,7 +175,7 @@ var OCAuthCore = exports.OCAuthCore = /*#__PURE__*/function () {
175
175
  var _this$getParsedIdToke = this.getParsedIdToken(),
176
176
  edu_username = _this$getParsedIdToke.edu_username,
177
177
  eth_address = _this$getParsedIdToke.eth_address;
178
- this.authInfoManager.setAuthState(this.getAccessToken(), this.getIdToken(), edu_username, eth_address, this.isAuthenticated());
178
+ this.authInfoManager.setAuthState(this.getAccessToken(), this.getIdToken(), edu_username, eth_address, true);
179
179
  }
180
180
  }
181
181
  }, {
@@ -253,7 +253,7 @@ var OCAuthLive = exports.OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
253
253
  var storageClass = (0, _StorageManager.getStorageClass)(opts);
254
254
  var pkceTransactionManager = new _TransactionManager["default"](storageClass);
255
255
  var tokenManager = new _TokenManager["default"](storageClass, tokenEndpoint, publicKey);
256
- return _callSuper(this, OCAuthLive, [loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint]);
256
+ return _callSuper(this, OCAuthLive, [loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, false]);
257
257
  }
258
258
  _inherits(OCAuthLive, _OCAuthCore2);
259
259
  return _createClass(OCAuthLive);
@@ -275,7 +275,7 @@ var OCAuthSandbox = exports.OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3)
275
275
  var storageClass = (0, _StorageManager.getStorageClass)(opts);
276
276
  var pkceTransactionManager = new _TransactionManager["default"](storageClass);
277
277
  var tokenManager = new _TokenManager["default"](storageClass, tokenEndpoint, publicKey);
278
- return _callSuper(this, OCAuthSandbox, [loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint]);
278
+ return _callSuper(this, OCAuthSandbox, [loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, true]);
279
279
  }
280
280
  _inherits(OCAuthSandbox, _OCAuthCore3);
281
281
  return _createClass(OCAuthSandbox);
@@ -0,0 +1,5 @@
1
+ export function base64ToBase64Url(b64: any): any;
2
+ export function base64UrlToBase64(b64u: any): any;
3
+ export function stringToBase64Url(str: any): any;
4
+ export function stringToBuffer(str: any): Uint8Array<any>;
5
+ export function base64UrlDecode(str: any): string;
@@ -0,0 +1,3 @@
1
+ export * from "./webcrypto";
2
+ export * from "./base64";
3
+ export * from "./verifyToken";
@@ -0,0 +1 @@
1
+ export function verifyToken(idToken: any, key: any): Promise<boolean>;
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright 2024-Present Animoca Brands Corporation Ltd.
3
+ *
4
+ * 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:
5
+ *
6
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+ *
8
+ * 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.
9
+ */
10
+ declare function a(str: any): string;
11
+ declare function b(str: any): string;
12
+ declare const c: Crypto;
13
+ export { a as atob, b as btoa, c as webcrypto };
@@ -0,0 +1 @@
1
+ export function buildAuthEndpointUrl(signInParams: any, loginEndPoint: any): string;
@@ -0,0 +1 @@
1
+ export * from "./buildAuthEndpointUrl";
@@ -0,0 +1,2 @@
1
+ export * from "./lib";
2
+ export * from "./auth";
@@ -0,0 +1,11 @@
1
+ export default AuthInfoManager;
2
+ declare class AuthInfoManager {
3
+ _emmitter: any;
4
+ _authState: any;
5
+ _emitter: any;
6
+ setAuthState(accessToken: any, idToken: any, OCId: any, ethAddress: any, isAuthenticated: any): void;
7
+ getAuthState(): any;
8
+ clear(): void;
9
+ subscribe(handler: any): void;
10
+ unsubscribe(handler: any): void;
11
+ }
@@ -50,7 +50,10 @@ var AuthInfoManager = /*#__PURE__*/function () {
50
50
  }, {
51
51
  key: "clear",
52
52
  value: function clear() {
53
- this._authState = null;
53
+ this._authState = {
54
+ isAuthenticated: false
55
+ };
56
+ this._emitter.emit(EVENT_AUTH_STATE_CHANGE, this._authState);
54
57
  }
55
58
  }, {
56
59
  key: "subscribe",
@@ -0,0 +1,8 @@
1
+ export class CookieStorageProvider {
2
+ constructor(options?: {});
3
+ domain: any;
4
+ sameSite: any;
5
+ getItem(key: any): any;
6
+ setItem(key: any, value: any): any;
7
+ removeItem(key: any): any;
8
+ }
@@ -21,12 +21,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
21
21
  *
22
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
- // Wrapper to support Cookie based storage
25
24
  var CookieStorageProvider = exports.CookieStorageProvider = /*#__PURE__*/function () {
26
- function CookieStorageProvider(domain) {
25
+ function CookieStorageProvider() {
26
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
27
27
  _classCallCheck(this, CookieStorageProvider);
28
28
  _defineProperty(this, "domain", void 0);
29
- this.domain = domain;
29
+ _defineProperty(this, "sameSite", void 0);
30
+ this.domain = options.domain;
31
+ this.sameSite = options.sameSite;
30
32
  }
31
33
  return _createClass(CookieStorageProvider, [{
32
34
  key: "getItem",
@@ -36,11 +38,20 @@ var CookieStorageProvider = exports.CookieStorageProvider = /*#__PURE__*/functio
36
38
  }, {
37
39
  key: "setItem",
38
40
  value: function setItem(key, value) {
39
- return _jsCookie["default"].set(key, value, {
41
+ var cookieOptions = {
40
42
  expires: 365,
41
43
  path: '/',
42
44
  domain: this.domain
43
- });
45
+ };
46
+ if (this.sameSite === true) {
47
+ cookieOptions.sameSite = 'Strict';
48
+ } else if (this.sameSite === false) {
49
+ cookieOptions.sameSite = 'None';
50
+ cookieOptions.secure = true;
51
+ }
52
+
53
+ // if sameSite is undefined or null, leave default browser behavior
54
+ return _jsCookie["default"].set(key, value, cookieOptions);
44
55
  }
45
56
  }, {
46
57
  key: "removeItem",
@@ -0,0 +1,23 @@
1
+ export class BaseStorageManager {
2
+ constructor(storageName: any, storageProvider: any);
3
+ storageProvider: any;
4
+ storageName: any;
5
+ getStorageObject(): SavedObject;
6
+ }
7
+ export class LocalStorageManager extends BaseStorageManager {
8
+ constructor(storageName: any);
9
+ }
10
+ export function getStorageClass(opts: any): typeof LocalStorageManager;
11
+ declare class SavedObject {
12
+ constructor(storageProvider: any, storageName: any);
13
+ storageProvider: any;
14
+ storageName: any;
15
+ getItem(key: any): any;
16
+ setItem(key: any, value: any): void;
17
+ removeItem(key: any): void;
18
+ getStorage(): any;
19
+ setStorage(obj: any): void;
20
+ clearStorage(key: any): void;
21
+ updateStorage(key: any, value: any): void;
22
+ }
23
+ export {};
@@ -122,7 +122,7 @@ var getStorageClass = exports.getStorageClass = function getStorageClass(opts) {
122
122
  return /*#__PURE__*/function (_BaseStorageManager3) {
123
123
  function CookieStorageManager(storageName) {
124
124
  _classCallCheck(this, CookieStorageManager);
125
- return _callSuper(this, CookieStorageManager, [storageName, new _CookieStorageProvider.CookieStorageProvider(opts.cookieDomain)]);
125
+ return _callSuper(this, CookieStorageManager, [storageName, new _CookieStorageProvider.CookieStorageProvider(opts)]);
126
126
  }
127
127
  _inherits(CookieStorageManager, _BaseStorageManager3);
128
128
  return _createClass(CookieStorageManager);
@@ -0,0 +1,16 @@
1
+ export default TokenManager;
2
+ declare class TokenManager {
3
+ constructor(StorageManagerClass: any, tokenEndPoint: any, publicKey: any);
4
+ storageManager: any;
5
+ tokenExpiredAt: any;
6
+ tokenEndPoint: any;
7
+ publicKey: any;
8
+ clear(): void;
9
+ exchangeTokenFromCode(accessCode: any, codeVerifier: any, state?: any): Promise<void>;
10
+ getStateParameter(): any;
11
+ getIdToken(): any;
12
+ getAccessToken(): any;
13
+ getExpiredAt(): any;
14
+ getPublicKey(): Promise<any>;
15
+ hasExpired(): boolean;
16
+ }
@@ -0,0 +1,9 @@
1
+ export default TransactionManager;
2
+ declare class TransactionManager {
3
+ constructor(StorageManagerClass: any);
4
+ storageManager: any;
5
+ clear(): void;
6
+ save(meta: any): void;
7
+ getTransactionMeta(): any;
8
+ hasActiveTransaction(): boolean;
9
+ }
@@ -0,0 +1,3 @@
1
+ export { default as TokenManager } from "./TokenManager";
2
+ export { default as TransactionManager } from "./TransactionManager";
3
+ export * from "./StorageManager";
@@ -0,0 +1,11 @@
1
+ export const MIN_VERIFIER_LENGTH: 43;
2
+ export const MAX_VERIFIER_LENGTH: 128;
3
+ export const DEFAULT_CODE_CHALLENGE_METHOD: "S256";
4
+ declare namespace _default {
5
+ export { DEFAULT_CODE_CHALLENGE_METHOD };
6
+ export { generateVerifier };
7
+ export { computeChallenge };
8
+ }
9
+ export default _default;
10
+ declare function generateVerifier(prefix: any): string;
11
+ declare function computeChallenge(str: any): Promise<any>;
@@ -0,0 +1,5 @@
1
+ export function createPkceMeta(signinParams: any): {
2
+ codeChallenge: any;
3
+ codeVerifier: any;
4
+ codeChallengeMethod: any;
5
+ };
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright 2024-Present Animoca Brands Corporation Ltd.
3
+ *
4
+ * 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:
5
+ *
6
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+ *
8
+ * 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.
9
+ */
10
+ export class InternalError extends Error {
11
+ }
12
+ export class InvalidParamsError extends InternalError {
13
+ }
14
+ export class AuthError extends Error {
15
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./urlParser";
2
+ export * from "./prepareTokenParams";
3
+ export * from "./createPkceMeta";
4
+ export * from "./jwtParser";
@@ -0,0 +1 @@
1
+ export function parseJwt(token: any): any;
@@ -0,0 +1,8 @@
1
+ export function prepareTokenParams(params: any): Promise<{
2
+ redirectUri: any;
3
+ codeVerifier: string;
4
+ codeChallenge: any;
5
+ codeChallengeMethod: string;
6
+ scope: string;
7
+ responseType: string;
8
+ }>;
@@ -0,0 +1,5 @@
1
+ export function parseUrl(): {
2
+ id_token: string;
3
+ code: string;
4
+ state: string;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencampus/ocid-connect-js",
3
- "version": "1.2.3",
3
+ "version": "1.2.6",
4
4
  "author": "Animoca Brands",
5
5
  "license": "MIT",
6
6
  "description": "OCID Connector Library",
@@ -11,7 +11,8 @@
11
11
  ],
12
12
  "scripts": {
13
13
  "build-dev": "gulp clean && gulp copy && webpack",
14
- "lib": "babel ./src --out-dir ./lib",
14
+ "generate-types": "tsc --declaration --allowJs --emitDeclarationOnly",
15
+ "lib": "babel ./src --out-dir ./lib && yarn generate-types",
15
16
  "build": "NODE_OPTIONS=--openssl-legacy-provider npm run lib && NODE_OPTIONS=--openssl-legacy-provider gulp dist",
16
17
  "prepublishOnly": "npm run build",
17
18
  "lint": "eslint src",
@@ -27,6 +28,7 @@
27
28
  "@babel/preset-react": "^7.0.0",
28
29
  "@testing-library/react": "^13.3.0",
29
30
  "@testing-library/user-event": "^14.3.0",
31
+ "@types/node": "^22.10.3",
30
32
  "autoprefixer": "^7.1.2",
31
33
  "babel-core": "^7.0.0-bridge.0",
32
34
  "babel-loader": "^8.0.4",
@@ -50,6 +52,8 @@
50
52
  "react-dom": "^18.0.0",
51
53
  "sinon": "^2.1.0",
52
54
  "style-loader": "^0.16.1",
55
+ "typescript": "^5.7.2",
56
+ "typescript-json-schema": "^0.65.1",
53
57
  "uglifyjs-webpack-plugin": "^2.0.1",
54
58
  "webpack": "^4.21.0",
55
59
  "webpack-cli": "^3.1.2",