@zvonimirsun/iszy-common 1.0.7 → 1.0.9

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 ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var E=(n=>(n.SUPERADMIN="superadmin",n.ADMIN="admin",n))(E||{}),u=(n=>(n[n.DEACTIVATED=0]="DEACTIVATED",n[n.ENABLED=1]="ENABLED",n[n.DISABLED=2]="DISABLED",n))(u||{});const g="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function i(n){let e="";do e=g.charAt(Number(n%62n))+e,n=n/62n;while(n>0n);return e}const D=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\v\f\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|\\[\x01-\x09\v\f\x0E-\x7F])\*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d{1,2}|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\v\f\x0E-\x1F\x21-\x5A\x53-\x7F]|\\[\x01-\x09\v\f\x0E-\x7F])+)\])$/,I=/^1[3-9]\d{9}$/,t=[];for(let n=0;n<256;++n)t.push((n+256).toString(16).slice(1));function l(n,e=0){return(t[n[e+0]]+t[n[e+1]]+t[n[e+2]]+t[n[e+3]]+"-"+t[n[e+4]]+t[n[e+5]]+"-"+t[n[e+6]]+t[n[e+7]]+"-"+t[n[e+8]]+t[n[e+9]]+"-"+t[n[e+10]]+t[n[e+11]]+t[n[e+12]]+t[n[e+13]]+t[n[e+14]]+t[n[e+15]]).toLowerCase()}let o;const y=new Uint8Array(16);function A(){if(!o){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");o=crypto.getRandomValues.bind(crypto)}return o(y)}const U=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),x={randomUUID:U};function b(n,e,r){var d;if(x.randomUUID&&!n)return x.randomUUID();n=n||{};const c=n.random??((d=n.rng)==null?void 0:d.call(n))??A();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,l(c)}function a(){return b()}function m(n){n=n||a();const e=n.replace(/-/g,""),r=BigInt(`0x${e.substring(0,16)}`),c=BigInt(`0x${e.substring(16,32)}`),d=r^c;return i(d).substring(0,6)}exports.REGEX_EMAIL=D;exports.REGEX_MOBILE_PHONE=I;exports.RoleEnum=E;exports.UserStatus=u;exports.base62Encode=i;exports.encodeUUID=m;exports.getUUID=a;
@@ -2,3 +2,7 @@ export interface Device {
2
2
  id?: string;
3
3
  ip: string;
4
4
  }
5
+ export interface DeviceCache extends Device {
6
+ id: string;
7
+ refreshToken: string;
8
+ }
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@zvonimirsun/iszy-common",
3
3
  "type": "module",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
8
- "import": "./dist/index.js"
8
+ "import": "./dist/index.js",
9
+ "require": "./dist/index.cjs"
9
10
  },
10
11
  "./*": "./*"
11
12
  },
12
- "main": "./dist/index.js",
13
+ "main": "./dist/index.cjs",
13
14
  "module": "./dist/index.js",
14
15
  "types": "./dist/index.d.ts",
15
16
  "files": [