insite-client 2.2.1 → 2.2.3
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/InSite.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
package/dist/InSite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InSite.d.ts","sourceRoot":"","sources":["../src/InSite.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EACN,sBAAsB,EACtB,KAAK,WAAW,EAChB,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAMzE,mBAAmB;AACnB,iBAAS,KAAK,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,yBAEtF;AAED,mBAAmB;AACnB,iBAAS,MAAM,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,yBAEtD;AAGD,qBAAa,MAAM,CAClB,CAA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C,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACzH,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC;CASnH"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var E=Object.defineProperty;var R=t=>{throw TypeError(t)};var M=(t,o,e)=>o in t?E(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e;var n=(t,o,e)=>M(t,typeof o!="symbol"?o+"":o,e),W=(t,o,e)=>o.has(t)||R("Cannot "+e);var v=(t,o,e)=>(W(t,o,"read from private field"),e?e.call(t):o.get(t)),b=(t,o,e)=>o.has(t)?R("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(t):o.set(t,e);import B from"eventemitter3";function d(){}function L(t,o=0,e={}){let{leading:r=!1,trailing:i=!0}=e,{maxWait:f=1/0}=e,u,a,p,O,y,l,s,S,$=async()=>{let x=Date.now();x>=p?(u=void 0,p=void 0,clearTimeout(a),typeof s=="function"&&await s(),c.resolve(S),c.promise.isResolved=!0,l=r):(clearTimeout(u),u=setTimeout($,p-x))},I=Number.isFinite(f)?()=>{s===m&&(s=!1),m(),a=setTimeout(I,f)}:null;async function m(){return S=await t.apply(O,y)}r&&typeof r=="boolean"&&(r=m),l=r,i&&typeof i=="boolean"&&(i=m),s=i;let c=Object.assign(function(...x){return y=x,O=this,p=Date.now()+o,s=i,c.promise.isResolved&&(c.promise=Object.assign(new Promise(A=>{c.resolve=A,typeof l=="function"&&(l(),l=!1,s===m&&(s=!1)),u||(u=setTimeout($,o),I&&(a=setTimeout(I,f)))}),{isResolved:!1})),c.promise},{callback:t,promise:Object.assign(Promise.resolve(),{isResolved:!0}),resolve:d,run:m,clear:async x=>{clearTimeout(u),u=void 0,clearTimeout(a),c.promise.isResolved=!0,c.resolve(x?await m():S)}});return c}L.noop=Object.assign(()=>{},{callback:d,promise:Object.assign(Promise.resolve(),{isResolved:!0}),resolve:d,run:d,clear:d});function P(t,o,e,r,i=!0){return Array.isArray(t)&&(t=t.length),typeof r!="string"&&(i=r??!0,r=e),(i?`${t}\xA0`:"")+P.raw(t,o,e,r)}P.raw=(t,o,e,r=e)=>{t=Math.abs(t);let i=t%10,f=t%100;return i===1&&f!==11?o:i>=2&&i<=4&&!(f>=12&&f<=15)?e:r};var h=new WeakMap,w=class extends Promise{constructor(e){let r,i;super((f,u)=>{r=f,i=u});n(this,"isPending",!0);n(this,"isFulfilled",!1);n(this,"isRejected",!1);n(this,"state","pending");n(this,"result");n(this,"resolve",e=>{if(this.isPending){this.isPending=!1,this.isFulfilled=!0,this.state="fulfilled",this.result=e;let r=h.get(this);r&&(r.resolve.call(this,e),h.delete(this))}});n(this,"reject",e=>{if(this.isPending){this.isPending=!1,this.isRejected=!0,this.state="rejected",this.result=e;let r=h.get(this);r&&(r.reject.call(this,e),h.delete(this))}});h.set(this,{resolve:r,reject:i}),e?.(this.resolve,this.reject)}};import{CookieSetter as C}from"insite-cookie/client";import{Subscription as k}from"insite-subscriptions-client";import{UsersSubscriptionGroup as U}from"insite-users-client";import{IncomingTransport as D,OutgoingTransport as F}from"insite-ws-transfers/browser";import{WS as G}from"insite-ws/client";function N(t,o){return this.ws.sendRequest("login",t,o)}function _(){return this.ws.sendRequest("logout")}var g,T=class T extends B{constructor(e){super();n(this,"ws");n(this,"incomingTransport");n(this,"outgoingTransport");n(this,"cookie");n(this,"usersSubscriptionGroup");n(this,"user");n(this,"users");n(this,"orgs");n(this,"roles");n(this,"isLoggedIn",!1);n(this,"login");n(this,"logout");n(this,"isReady",!1);b(this,g,new w);e&&this.init(e)}async init(e){if(!this.isReady){let{ws:r={},cookie:i,users:f,public:u}=e??{},{subscriptions:a,incomingTransport:p,outgoingTransport:O,...y}=r;this.ws=new G(y),a!==null&&k.bindTo(this.ws),p&&(this.incomingTransport=new D(this.ws,typeof p=="object"?p:{})),O&&(this.outgoingTransport=new F(this.ws)),i!==null&&(this.cookie=new C(this.ws,i)),f!==null&&a!==null&&i!==null&&(this.user=null,this.login=N,this.logout=_,u?await new Promise(l=>{new k("object","user",[!0],s=>{this.user=s,this.user?this.isLoggedIn||(this.isLoggedIn=!0,this.emit("login",!0)):this.isLoggedIn&&(this.isLoggedIn=!1,this.emit("logout",!1)),this.isReady||l()})}):(this.usersSubscriptionGroup=new U({target:this}),await new Promise(l=>{this.usersSubscriptionGroup.once("init",()=>{this.isLoggedIn=!!this.user,this.usersSubscriptionGroup.on("update.user",s=>{s.valueOf()?this.isLoggedIn||(this.isLoggedIn=!0,this.emit("login",!0)):this.isLoggedIn&&(this.isLoggedIn=!1,this.emit("logout",!1))}),l(),this.isLoggedIn&&this.emit("login",!0)})}))),this.isReady=!0,this.emit("ready",!0),v(this,g).resolve(this)}}whenReady(){return v(this,g)}static init(e,r=!1){let i=new T(e);return r?i.whenReady():i}};g=new WeakMap;var j=T;export*from"insite-common/frontend";export*from"insite-cookie/client";export*from"insite-subscriptions-client";export*from"insite-users-client";export*from"insite-ws-transfers/browser";export*from"insite-ws/client";export{j as InSite};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/InSite.ts", "../../../../@nesvet/npm/n/src/noop.ts", "../../../../@nesvet/npm/n/src/debounce.ts", "../../../../@nesvet/npm/n/src/howmuch.ts", "../../../../@nesvet/npm/n/src/StatefulPromise.ts", "../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import EventEmitter from \"eventemitter3\";\nimport { StatefulPromise } from \"@nesvet/n\";\nimport type { AbilitiesSchema } from \"insite-common\";\nimport { CookieSetter } from \"insite-cookie/client\";\nimport { Subscription } from \"insite-subscriptions-client\";\nimport {\n\tUsersSubscriptionGroup,\n\ttype CurrentUser,\n\ttype Orgs,\n\ttype OrgsExtended,\n\ttype Roles,\n\ttype Users,\n\ttype UsersExtended\n} from \"insite-users-client\";\nimport { IncomingTransport, OutgoingTransport } from \"insite-ws-transfers/browser\";\nimport { WS } from \"insite-ws/client\";\nimport type { OmitRedundant, Options, WSWithActualProps } from \"./types\";\n\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n\n/** @this InSite */\nfunction login<O extends Options<any>>(this: InSite<O>, email: string, password: string) {\n\treturn this.ws.sendRequest(\"login\", email, password);\n}\n\n/** @this InSite */\nfunction logout<O extends Options<any>>(this: InSite<O>) {\n\treturn this.ws.sendRequest(\"logout\");\n}\n\n\nexport class InSite<\n\tO extends Options<any>,\n\tAS extends AbilitiesSchema = O extends Options<infer A> ? A : never\n> extends EventEmitter {\n\tconstructor(options?: O) {\n\t\tsuper();\n\t\t\n\t\tif (options)\n\t\t\tthis.init(options);\n\t\t\n\t}\n\t\n\tws!: WSWithActualProps<O>;\n\tincomingTransport!: IncomingTransport;\n\toutgoingTransport!: OutgoingTransport;\n\tcookie!: CookieSetter;\n\tusersSubscriptionGroup!: UsersSubscriptionGroup;\n\tuser!: CurrentUser<AS> | null;\n\tusers!: Users | UsersExtended;\n\torgs!: Orgs | OrgsExtended;\n\troles!: Roles;\n\tisLoggedIn = false;\n\t\n\tlogin!: typeof login<O>;\n\tlogout!: typeof logout<O>;\n\t\n\tisReady = false;\n\t\n\tprotected async init(options?: O) {\n\t\t\n\t\tif (!this.isReady) {\n\t\t\tconst {\n\t\t\t\tws: wsWithOtherOptions = {},\n\t\t\t\tcookie: cookieOptions,\n\t\t\t\tusers\n\t\t\t} = options ?? {};\n\t\t\t\n\t\t\tconst {\n\t\t\t\tsubscriptions,\n\t\t\t\tincomingTransport,\n\t\t\t\toutgoingTransport,\n\t\t\t\t...wsOptions\n\t\t\t} = wsWithOtherOptions;\n\t\t\t\n\t\t\tthis.ws = new WS(wsOptions) as WSWithActualProps<O>;\n\t\t\t\n\t\t\tif (subscriptions !== null)\n\t\t\t\tSubscription.bindTo(this.ws);\n\t\t\t\n\t\t\tif (incomingTransport)\n\t\t\t\tthis.incomingTransport = new IncomingTransport(this.ws, typeof incomingTransport == \"object\" ? incomingTransport : {});\n\t\t\t\n\t\t\tif (outgoingTransport)\n\t\t\t\tthis.outgoingTransport = new OutgoingTransport(this.ws);\n\t\t\t\n\t\t\tif (cookieOptions !== null)\n\t\t\t\tthis.cookie = new CookieSetter(this.ws, cookieOptions);\n\t\t\t\n\t\t\tif (users !== null && subscriptions !== null && cookieOptions !== null) {\n\t\t\t\tthis.user = null;\n\t\t\t\tthis.login = login<O>;\n\t\t\t\tthis.logout = logout<O>;\n\t\t\t\t\n\t\t\t\tthis.usersSubscriptionGroup = new UsersSubscriptionGroup({ target: this });\n\t\t\t\t\n\t\t\t\tawait new Promise<void>(resolve => {\n\t\t\t\t\t\n\t\t\t\t\tthis.usersSubscriptionGroup.once(\"init\", () => {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.isLoggedIn = !!this.user;\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.usersSubscriptionGroup.on(\"update.user\", (user: CurrentUser) => {\n\t\t\t\t\t\t\tif (user.valueOf()) {\n\t\t\t\t\t\t\t\tif (!this.isLoggedIn) {\n\t\t\t\t\t\t\t\t\tthis.isLoggedIn = true;\n\t\t\t\t\t\t\t\t\tthis.emit(\"login\", true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (this.isLoggedIn) {\n\t\t\t\t\t\t\t\tthis.isLoggedIn = false;\n\t\t\t\t\t\t\t\tthis.emit(\"logout\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (this.isLoggedIn)\n\t\t\t\t\t\t\tthis.emit(\"login\", true);\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tthis.isReady = true;\n\t\t\tthis.emit(\"ready\", true);\n\t\t\t\n\t\t\tthis.#initPromise.resolve(this);\n\t\t}\n\t\t\n\t}\n\t\n\t#initPromise = new StatefulPromise<this>();\n\t\n\twhenReady() {\n\t\treturn this.#initPromise;\n\t}\n\t\n\t\n\tstatic init<IO extends Options<any>, IS extends InSite<IO>>(options: IO, asPromise: true): Promise<OmitRedundant<IS, IO>>;\n\tstatic init<IO extends Options<any>, IS extends InSite<IO>>(options?: IO, asPromise?: false): OmitRedundant<IS, IO>;\n\tstatic init<IO extends Options<any>, IS extends InSite<IO>>(options?: IO, asPromise = false) {\n\t\tconst inSite = new InSite(options) as IS;\n\t\t\n\t\treturn asPromise ?\n\t\t\tinSite.whenReady() :\n\t\t\tinSite;\n\t}\n\t\n}\n", "export function noop() { /**/ }\n", "import { noop } from \"./noop.js\";\n\n\ntype Callback<Result> = (...args: unknown[]) => Result;\ntype FunctionOrBoolean = (() => unknown) | boolean;\ntype Options = { leading?: FunctionOrBoolean; maxWait?: number; trailing?: FunctionOrBoolean };\ntype NumberOrUndefined = number | undefined;\n\ntype DebouncedFunction<Result> = {\n\t(this: unknown, ..._args: unknown[]): Promise<Result>;\n};\n\nexport type Debounced<Result> = {\n\tcallback: Callback<Result>;\n\tpromise: {\n\t\tisResolved: boolean;\n\t} & Promise<unknown>;\n\tresolve: (value: Result) => void;\n\trun(): Promise<Result>;\n\tclear(shouldRun?: boolean): Promise<void>;\n} & DebouncedFunction<Result>;\n\n\nexport function debounce<Result>(callback: Callback<Result>, limit = 0, options: Options = {}) {\n\tlet { leading = false, trailing = true } = options;\n\tconst { maxWait = Infinity } = options;\n\t\n\tlet timeout: NumberOrUndefined;\n\tlet maxWaitTimeout: NumberOrUndefined;\n\tlet end: NumberOrUndefined;\n\tlet context: unknown;\n\tlet args: unknown[];\n\tlet initial: FunctionOrBoolean;\n\tlet final: FunctionOrBoolean;\n\tlet result: Result;\n\t\n\tconst expired = async () => {\n\t\t\n\t\tconst n = Date.now();\n\t\t\n\t\tif (n >= end!) {\n\t\t\ttimeout = undefined;\n\t\t\tend = undefined;\n\t\t\tclearTimeout(maxWaitTimeout);\n\t\t\tif (typeof final == \"function\")\n\t\t\t\tawait final();\n\t\t\tdebounced.resolve(result);\n\t\t\tdebounced.promise.isResolved = true;\n\t\t\tinitial = leading;\n\t\t} else {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = setTimeout(expired, end! - n);\n\t\t}\n\t\t\n\t};\n\t\n\tconst maxWaitExpired = Number.isFinite(maxWait) ? () => {\n\t\t\n\t\tif (final === run)\n\t\t\tfinal = false;\n\t\trun();\n\t\tmaxWaitTimeout = setTimeout(maxWaitExpired as TimerHandler, maxWait);\n\t\t\n\t} : null;\n\t\n\tasync function run() {\n\t\treturn (result = await callback.apply(context, args));\n\t}\n\t\n\tif (leading && typeof leading == \"boolean\")\n\t\tleading = run;\n\tinitial = leading;\n\t\n\tif (trailing && typeof trailing == \"boolean\")\n\t\ttrailing = run;\n\tfinal = trailing;\n\t\n\tconst debounced: Debounced<Result> = Object.assign(function (..._args) {\n\t\targs = _args;\n\t\tcontext = this;// eslint-disable-line no-invalid-this\n\t\t\n\t\tend = Date.now() + limit;\n\t\tfinal = trailing;\n\t\t\n\t\tif (debounced.promise.isResolved)\n\t\t\tdebounced.promise = Object.assign(new Promise(resolve => {\n\t\t\t\tdebounced.resolve = resolve;\n\t\t\t\t\n\t\t\t\tif (typeof initial == \"function\") {\n\t\t\t\t\tinitial();\n\t\t\t\t\tinitial = false;\n\t\t\t\t\tif (final === run)\n\t\t\t\t\t\tfinal = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!timeout) {\n\t\t\t\t\ttimeout = setTimeout(expired, limit);\n\t\t\t\t\tif (maxWaitExpired)\n\t\t\t\t\t\tmaxWaitTimeout = setTimeout(maxWaitExpired, maxWait);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}), {\n\t\t\t\tisResolved: false\n\t\t\t});\n\t\t\n\t\treturn debounced.promise;\n\t} as DebouncedFunction<Result>, {\n\t\tcallback,\n\t\tpromise: Object.assign(Promise.resolve(), {\n\t\t\tisResolved: true\n\t\t}),\n\t\tresolve: noop,\n\t\trun,\n\t\tclear: async (shouldRun?: boolean) => {\n\t\t\t\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = undefined;\n\t\t\t\n\t\t\tclearTimeout(maxWaitTimeout);\n\t\t\t\n\t\t\tdebounced.promise.isResolved = true;\n\t\t\tdebounced.resolve(shouldRun ? await run() : result);\n\t\t\t\n\t\t}\n\t});\n\t\n\treturn debounced;\n}\n\n\ndebounce.noop = Object.assign(() => { /**/ }, {\n\tcallback: noop,\n\tpromise: Object.assign(Promise.resolve(), {\n\t\tisResolved: true\n\t}),\n\tresolve: noop,\n\trun: noop,\n\tclear: noop\n}) as unknown as Debounced<void>;\n\n\nexport function throttle<Result>(callback: Callback<Result>, limit?: number, options?: Options) {\n\treturn debounce(callback, limit, {\n\t\tmaxWait: limit,\n\t\tleading: true,\n\t\ttrailing: true,\n\t\t...options\n\t});\n}\n", "export function howmuch(number: [] | number, one: string, two: string, five: boolean | string, shouldPrintNumber = true) {\n\tif (Array.isArray(number))\n\t\tnumber = number.length;\n\t\n\tif (typeof five != \"string\") {\n\t\tshouldPrintNumber = five ?? true;\n\t\tfive = two;\n\t}\n\t\n\t\n\treturn (shouldPrintNumber ? `${number}\u00A0` : \"\") + howmuch.raw(number, one, two, five);\n}\n\nhowmuch.raw = (number: number, one: string, two: string, five = two) => {\n\tnumber = Math.abs(number);\n\tconst u = number % 10;\n\tconst d = number % 100;\n\t\n\treturn (\n\t\t(u === 1 && d !== 11) ?\n\t\t\tone :\n\t\t\t((u >= 2 && u <= 4) && !(d >= 12 && d <= 15)) ?\n\t\t\t\ttwo :\n\t\t\t\tfive\n\t);\n};\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype Value<T> = PromiseLike<T> | T;\ntype Resolve<T> = (value: Value<T>) => void;\ntype Reject = (reason?: any) => void;\n\nconst nativesMap = new WeakMap<StatefulPromise<any>, { resolve: Resolve<any>; reject: Reject }>();\n\n\nexport class StatefulPromise<T> extends Promise<T> {\n\tconstructor(executor?: (resolve: Resolve<T>, reject: Reject) => void) {\n\t\t\n\t\tlet nativeResolve: Resolve<T>;\n\t\tlet nativeReject: Reject;\n\t\t\n\t\tsuper((resolve, reject) => {\n\t\t\tnativeResolve = resolve;\n\t\t\tnativeReject = reject;\n\t\t\t\n\t\t});\n\t\t\n\t\tnativesMap.set(this, { resolve: nativeResolve!, reject: nativeReject! });\n\t\t\n\t\texecutor?.(this.resolve, this.reject);\n\t\t\n\t}\n\t\n\tisPending = true;\n\tisFulfilled = false;\n\tisRejected = false;\n\t\n\tstate: \"fulfilled\" | \"pending\" | \"rejected\" = \"pending\";\n\t\n\tresult?: any;\n\t\n\tresolve = (value: Value<T>) => {\n\t\t\n\t\tif (this.isPending) {\n\t\t\tthis.isPending = false;\n\t\t\tthis.isFulfilled = true;\n\t\t\tthis.state = \"fulfilled\";\n\t\t\tthis.result = value;\n\t\t\t\n\t\t\tconst native = nativesMap.get(this);\n\t\t\t\n\t\t\tif (native) {\n\t\t\t\tnative.resolve.call(this, value);\n\t\t\t\tnativesMap.delete(this);\n\t\t\t}\n\t\t}\n\t\t\n\t};\n\t\n\treject = (reason?: any) => {\n\t\t\n\t\tif (this.isPending) {\n\t\t\tthis.isPending = false;\n\t\t\tthis.isRejected = true;\n\t\t\tthis.state = \"rejected\";\n\t\t\tthis.result = reason;\n\t\t\t\n\t\t\tconst native = nativesMap.get(this);\n\t\t\t\n\t\t\tif (native) {\n\t\t\t\tnative.reject.call(this, reason);\n\t\t\t\tnativesMap.delete(this);\n\t\t\t}\n\t\t}\n\t\t\n\t};\n\t\n}\n", "export * from \"./InSite\";\nexport type { Options } from \"./types\";\nexport * from \"insite-common/frontend\";\nexport type { Options as CookieOptions } from \"insite-cookie/client\";\nexport * from \"insite-cookie/client\";\nexport * from \"insite-subscriptions-client\";\nexport * from \"insite-users-client\";\nexport * from \"insite-ws-transfers/browser\";\nexport type { Options as WSOptions } from \"insite-ws/client\";\nexport * from \"insite-ws/client\";\n"],
|
|
5
|
-
"mappings": "iaAAA,OAAOA,MAAkB,gBCAnB,SAAUC,GAAI,CAAU,CCuBxB,SAAUC,EAAiBC,EAA4BC,EAAQ,EAAGC,EAAmB,CAAA,EAAE,CAC5F,GAAI,CAAE,QAAAC,EAAU,GAAO,SAAAC,EAAW,EAAI,EAAKF,EACrC,CAAE,QAAAG,EAAU,GAAQ,EAAKH,EAE3BI,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEEC,EAAU,SAAW,CAE1B,IAAMC,EAAI,KAAK,IAAG,EAEdA,GAAKP,GACRF,EAAU,OACVE,EAAM,OACN,aAAaD,CAAc,EACvB,OAAOK,GAAS,YACnB,MAAMA,EAAK,EACZI,EAAU,QAAQH,CAAM,EACxBG,EAAU,QAAQ,WAAa,GAC/BL,EAAUR,IAEV,aAAaG,CAAO,EACpBA,EAAU,WAAWQ,EAASN,EAAOO,CAAC,EAGxC,EAEME,EAAiB,OAAO,SAASZ,CAAO,EAAI,IAAK,CAElDO,IAAUM,IACbN,EAAQ,IACTM,EAAG,EACHX,EAAiB,WAAWU,EAAgCZ,CAAO,CAEpE,EAAI,KAEJ,eAAea,GAAG,CACjB,OAAQL,EAAS,MAAMb,EAAS,MAAMS,EAASC,CAAI,CACpD,CAEIP,GAAW,OAAOA,GAAW,YAChCA,EAAUe,GACXP,EAAUR,EAENC,GAAY,OAAOA,GAAY,YAClCA,EAAWc,GACZN,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EAA+CC,EAAeC,EAAkB,CACxF,OAAO,KAAK,GAAG,YAAY,QAASD,EAAOC,CAAQ,CACpD,CAGA,SAASC,GAAgD,CACxD,OAAO,KAAK,GAAG,YAAY,QAAQ,CACpC,CA9BA,IAAAC,EAiCaC,EAAN,MAAMA,UAGHC,CAAa,CACtB,YAAYC,EAAa,CACxB,MAAM,EAOPC,EAAA,WACAA,EAAA,0BACAA,EAAA,0BACAA,EAAA,eACAA,EAAA,+BACAA,EAAA,aACAA,EAAA,cACAA,EAAA,aACAA,EAAA,cACAA,EAAA,kBAAa,IAEbA,EAAA,cACAA,EAAA,eAEAA,EAAA,eAAU,
|
|
6
|
-
"names": ["EventEmitter", "noop", "debounce", "callback", "limit", "options", "leading", "trailing", "maxWait", "timeout", "maxWaitTimeout", "end", "context", "args", "initial", "final", "result", "expired", "n", "debounced", "maxWaitExpired", "run", "_args", "resolve", "noop", "shouldRun", "howmuch", "number", "one", "two", "five", "shouldPrintNumber", "u", "d", "nativesMap", "StatefulPromise", "executor", "nativeResolve", "nativeReject", "resolve", "reject", "__publicField", "value", "native", "reason", "CookieSetter", "Subscription", "UsersSubscriptionGroup", "IncomingTransport", "OutgoingTransport", "WS", "login", "email", "password", "logout", "_initPromise", "_InSite", "EventEmitter", "options", "__publicField", "__privateAdd", "StatefulPromise", "wsWithOtherOptions", "cookieOptions", "users", "subscriptions", "incomingTransport", "outgoingTransport", "wsOptions", "WS", "Subscription", "IncomingTransport", "OutgoingTransport", "CookieSetter", "
|
|
4
|
+
"sourcesContent": ["import EventEmitter from \"eventemitter3\";\nimport { StatefulPromise } from \"@nesvet/n\";\nimport type { AbilitiesSchema } from \"insite-common\";\nimport { CookieSetter } from \"insite-cookie/client\";\nimport { Subscription } from \"insite-subscriptions-client\";\nimport {\n\tUsersSubscriptionGroup,\n\ttype CurrentUser,\n\ttype Orgs,\n\ttype OrgsExtended,\n\ttype Roles,\n\ttype Users,\n\ttype UsersExtended\n} from \"insite-users-client\";\nimport { IncomingTransport, OutgoingTransport } from \"insite-ws-transfers/browser\";\nimport { WS } from \"insite-ws/client\";\nimport type { OmitRedundant, Options, WSWithActualProps } from \"./types\";\n\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n\n/** @this InSite */\nfunction login<O extends Options<any>>(this: InSite<O>, email: string, password: string) {\n\treturn this.ws.sendRequest(\"login\", email, password);\n}\n\n/** @this InSite */\nfunction logout<O extends Options<any>>(this: InSite<O>) {\n\treturn this.ws.sendRequest(\"logout\");\n}\n\n\nexport class InSite<\n\tO extends Options<any>,\n\tAS extends AbilitiesSchema = O extends Options<infer A> ? A : never\n> extends EventEmitter {\n\tconstructor(options?: O) {\n\t\tsuper();\n\t\t\n\t\tif (options)\n\t\t\tvoid this.init(options);\n\t\t\n\t}\n\t\n\tws!: WSWithActualProps<O>;\n\tincomingTransport!: IncomingTransport;\n\toutgoingTransport!: OutgoingTransport;\n\tcookie!: CookieSetter;\n\tusersSubscriptionGroup!: UsersSubscriptionGroup;\n\tuser!: CurrentUser<AS> | null;\n\tusers!: Users | UsersExtended;\n\torgs!: Orgs | OrgsExtended;\n\troles!: Roles;\n\tisLoggedIn = false;\n\t\n\tlogin!: typeof login<O>;\n\tlogout!: typeof logout<O>;\n\t\n\tisReady = false;\n\t\n\tprotected async init(options?: O) {\n\t\t\n\t\tif (!this.isReady) {\n\t\t\tconst {\n\t\t\t\tws: wsWithOtherOptions = {},\n\t\t\t\tcookie: cookieOptions,\n\t\t\t\tusers,\n\t\t\t\tpublic: isPublic\n\t\t\t} = options ?? {};\n\t\t\t\n\t\t\tconst {\n\t\t\t\tsubscriptions,\n\t\t\t\tincomingTransport,\n\t\t\t\toutgoingTransport,\n\t\t\t\t...wsOptions\n\t\t\t} = wsWithOtherOptions;\n\t\t\t\n\t\t\tthis.ws = new WS(wsOptions) as WSWithActualProps<O>;\n\t\t\t\n\t\t\tif (subscriptions !== null)\n\t\t\t\tSubscription.bindTo(this.ws);\n\t\t\t\n\t\t\tif (incomingTransport)\n\t\t\t\tthis.incomingTransport = new IncomingTransport(this.ws, typeof incomingTransport == \"object\" ? incomingTransport : {});\n\t\t\t\n\t\t\tif (outgoingTransport)\n\t\t\t\tthis.outgoingTransport = new OutgoingTransport(this.ws);\n\t\t\t\n\t\t\tif (cookieOptions !== null)\n\t\t\t\tthis.cookie = new CookieSetter(this.ws, cookieOptions);\n\t\t\t\n\t\t\tif (users !== null && subscriptions !== null && cookieOptions !== null) {\n\t\t\t\tthis.user = null;\n\t\t\t\tthis.login = login<O>;\n\t\t\t\tthis.logout = logout<O>;\n\t\t\t\t\n\t\t\t\tif (isPublic)\n\t\t\t\t\tawait new Promise<void>(resolve => {\n\t\t\t\t\t\t\n\t\t\t\t\t\tnew Subscription(\"object\", \"user\", [ true ], user => {\n\t\t\t\t\t\t\tthis.user = user;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (this.user) {\n\t\t\t\t\t\t\t\tif (!this.isLoggedIn) {\n\t\t\t\t\t\t\t\t\tthis.isLoggedIn = true;\n\t\t\t\t\t\t\t\t\tthis.emit(\"login\", true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (this.isLoggedIn) {\n\t\t\t\t\t\t\t\tthis.isLoggedIn = false;\n\t\t\t\t\t\t\t\tthis.emit(\"logout\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!this.isReady)\n\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\telse {\n\t\t\t\t\tthis.usersSubscriptionGroup = new UsersSubscriptionGroup({ target: this });\n\t\t\t\t\t\n\t\t\t\t\tawait new Promise<void>(resolve => {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.usersSubscriptionGroup.once(\"init\", () => {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.isLoggedIn = !!this.user;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.usersSubscriptionGroup.on(\"update.user\", (user: CurrentUser) => {\n\t\t\t\t\t\t\t\tif (user.valueOf()) {\n\t\t\t\t\t\t\t\t\tif (!this.isLoggedIn) {\n\t\t\t\t\t\t\t\t\t\tthis.isLoggedIn = true;\n\t\t\t\t\t\t\t\t\t\tthis.emit(\"login\", true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (this.isLoggedIn) {\n\t\t\t\t\t\t\t\t\tthis.isLoggedIn = false;\n\t\t\t\t\t\t\t\t\tthis.emit(\"logout\", false);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (this.isLoggedIn)\n\t\t\t\t\t\t\t\tthis.emit(\"login\", true);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.isReady = true;\n\t\t\tthis.emit(\"ready\", true);\n\t\t\t\n\t\t\tthis.#initPromise.resolve(this);\n\t\t}\n\t\t\n\t}\n\t\n\t#initPromise = new StatefulPromise<this>();\n\t\n\twhenReady() {\n\t\treturn this.#initPromise;\n\t}\n\t\n\t\n\tstatic init<IO extends Options<any>, IS extends InSite<IO>>(options: IO, asPromise: true): Promise<OmitRedundant<IS, IO>>;\n\tstatic init<IO extends Options<any>, IS extends InSite<IO>>(options?: IO, asPromise?: false): OmitRedundant<IS, IO>;\n\tstatic init<IO extends Options<any>, IS extends InSite<IO>>(options?: IO, asPromise = false) {\n\t\tconst inSite = new InSite(options) as IS;\n\t\t\n\t\treturn asPromise ?\n\t\t\tinSite.whenReady() :\n\t\t\tinSite;\n\t}\n\t\n}\n", "export function noop() { /**/ }\n", "import { noop } from \"./noop.js\";\n\n\ntype Callback<Result> = (...args: unknown[]) => Result;\ntype FunctionOrBoolean = (() => unknown) | boolean;\ntype Options = { leading?: FunctionOrBoolean; maxWait?: number; trailing?: FunctionOrBoolean };\ntype NumberOrUndefined = number | undefined;\n\ntype DebouncedFunction<Result> = {\n\t(this: unknown, ..._args: unknown[]): Promise<Result>;\n};\n\nexport type Debounced<Result> = {\n\tcallback: Callback<Result>;\n\tpromise: {\n\t\tisResolved: boolean;\n\t} & Promise<unknown>;\n\tresolve: (value: Result) => void;\n\trun(): Promise<Result>;\n\tclear(shouldRun?: boolean): Promise<void>;\n} & DebouncedFunction<Result>;\n\n\nexport function debounce<Result>(callback: Callback<Result>, limit = 0, options: Options = {}) {\n\tlet { leading = false, trailing = true } = options;\n\tconst { maxWait = Infinity } = options;\n\t\n\tlet timeout: NumberOrUndefined;\n\tlet maxWaitTimeout: NumberOrUndefined;\n\tlet end: NumberOrUndefined;\n\tlet context: unknown;\n\tlet args: unknown[];\n\tlet initial: FunctionOrBoolean;\n\tlet final: FunctionOrBoolean;\n\tlet result: Result;\n\t\n\tconst expired = async () => {\n\t\t\n\t\tconst n = Date.now();\n\t\t\n\t\tif (n >= end!) {\n\t\t\ttimeout = undefined;\n\t\t\tend = undefined;\n\t\t\tclearTimeout(maxWaitTimeout);\n\t\t\tif (typeof final == \"function\")\n\t\t\t\tawait final();\n\t\t\tdebounced.resolve(result);\n\t\t\tdebounced.promise.isResolved = true;\n\t\t\tinitial = leading;\n\t\t} else {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = setTimeout(expired, end! - n);\n\t\t}\n\t\t\n\t};\n\t\n\tconst maxWaitExpired = Number.isFinite(maxWait) ? () => {\n\t\t\n\t\tif (final === run)\n\t\t\tfinal = false;\n\t\trun();\n\t\tmaxWaitTimeout = setTimeout(maxWaitExpired as TimerHandler, maxWait);\n\t\t\n\t} : null;\n\t\n\tasync function run() {\n\t\treturn (result = await callback.apply(context, args));\n\t}\n\t\n\tif (leading && typeof leading == \"boolean\")\n\t\tleading = run;\n\tinitial = leading;\n\t\n\tif (trailing && typeof trailing == \"boolean\")\n\t\ttrailing = run;\n\tfinal = trailing;\n\t\n\tconst debounced: Debounced<Result> = Object.assign(function (..._args) {\n\t\targs = _args;\n\t\tcontext = this;// eslint-disable-line no-invalid-this\n\t\t\n\t\tend = Date.now() + limit;\n\t\tfinal = trailing;\n\t\t\n\t\tif (debounced.promise.isResolved)\n\t\t\tdebounced.promise = Object.assign(new Promise(resolve => {\n\t\t\t\tdebounced.resolve = resolve;\n\t\t\t\t\n\t\t\t\tif (typeof initial == \"function\") {\n\t\t\t\t\tinitial();\n\t\t\t\t\tinitial = false;\n\t\t\t\t\tif (final === run)\n\t\t\t\t\t\tfinal = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!timeout) {\n\t\t\t\t\ttimeout = setTimeout(expired, limit);\n\t\t\t\t\tif (maxWaitExpired)\n\t\t\t\t\t\tmaxWaitTimeout = setTimeout(maxWaitExpired, maxWait);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}), {\n\t\t\t\tisResolved: false\n\t\t\t});\n\t\t\n\t\treturn debounced.promise;\n\t} as DebouncedFunction<Result>, {\n\t\tcallback,\n\t\tpromise: Object.assign(Promise.resolve(), {\n\t\t\tisResolved: true\n\t\t}),\n\t\tresolve: noop,\n\t\trun,\n\t\tclear: async (shouldRun?: boolean) => {\n\t\t\t\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = undefined;\n\t\t\t\n\t\t\tclearTimeout(maxWaitTimeout);\n\t\t\t\n\t\t\tdebounced.promise.isResolved = true;\n\t\t\tdebounced.resolve(shouldRun ? await run() : result);\n\t\t\t\n\t\t}\n\t});\n\t\n\treturn debounced;\n}\n\n\ndebounce.noop = Object.assign(() => { /**/ }, {\n\tcallback: noop,\n\tpromise: Object.assign(Promise.resolve(), {\n\t\tisResolved: true\n\t}),\n\tresolve: noop,\n\trun: noop,\n\tclear: noop\n}) as unknown as Debounced<void>;\n\n\nexport function throttle<Result>(callback: Callback<Result>, limit?: number, options?: Options) {\n\treturn debounce(callback, limit, {\n\t\tmaxWait: limit,\n\t\tleading: true,\n\t\ttrailing: true,\n\t\t...options\n\t});\n}\n", "export function howmuch(number: [] | number, one: string, two: string, five: boolean | string, shouldPrintNumber = true) {\n\tif (Array.isArray(number))\n\t\tnumber = number.length;\n\t\n\tif (typeof five != \"string\") {\n\t\tshouldPrintNumber = five ?? true;\n\t\tfive = two;\n\t}\n\t\n\t\n\treturn (shouldPrintNumber ? `${number}\u00A0` : \"\") + howmuch.raw(number, one, two, five);\n}\n\nhowmuch.raw = (number: number, one: string, two: string, five = two) => {\n\tnumber = Math.abs(number);\n\tconst u = number % 10;\n\tconst d = number % 100;\n\t\n\treturn (\n\t\t(u === 1 && d !== 11) ?\n\t\t\tone :\n\t\t\t((u >= 2 && u <= 4) && !(d >= 12 && d <= 15)) ?\n\t\t\t\ttwo :\n\t\t\t\tfive\n\t);\n};\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype Value<T> = PromiseLike<T> | T;\ntype Resolve<T> = (value: Value<T>) => void;\ntype Reject = (reason?: any) => void;\n\nconst nativesMap = new WeakMap<StatefulPromise<any>, { resolve: Resolve<any>; reject: Reject }>();\n\n\nexport class StatefulPromise<T> extends Promise<T> {\n\tconstructor(executor?: (resolve: Resolve<T>, reject: Reject) => void) {\n\t\t\n\t\tlet nativeResolve: Resolve<T>;\n\t\tlet nativeReject: Reject;\n\t\t\n\t\tsuper((resolve, reject) => {\n\t\t\tnativeResolve = resolve;\n\t\t\tnativeReject = reject;\n\t\t\t\n\t\t});\n\t\t\n\t\tnativesMap.set(this, { resolve: nativeResolve!, reject: nativeReject! });\n\t\t\n\t\texecutor?.(this.resolve, this.reject);\n\t\t\n\t}\n\t\n\tisPending = true;\n\tisFulfilled = false;\n\tisRejected = false;\n\t\n\tstate: \"fulfilled\" | \"pending\" | \"rejected\" = \"pending\";\n\t\n\tresult?: any;\n\t\n\tresolve = (value: Value<T>) => {\n\t\t\n\t\tif (this.isPending) {\n\t\t\tthis.isPending = false;\n\t\t\tthis.isFulfilled = true;\n\t\t\tthis.state = \"fulfilled\";\n\t\t\tthis.result = value;\n\t\t\t\n\t\t\tconst native = nativesMap.get(this);\n\t\t\t\n\t\t\tif (native) {\n\t\t\t\tnative.resolve.call(this, value);\n\t\t\t\tnativesMap.delete(this);\n\t\t\t}\n\t\t}\n\t\t\n\t};\n\t\n\treject = (reason?: any) => {\n\t\t\n\t\tif (this.isPending) {\n\t\t\tthis.isPending = false;\n\t\t\tthis.isRejected = true;\n\t\t\tthis.state = \"rejected\";\n\t\t\tthis.result = reason;\n\t\t\t\n\t\t\tconst native = nativesMap.get(this);\n\t\t\t\n\t\t\tif (native) {\n\t\t\t\tnative.reject.call(this, reason);\n\t\t\t\tnativesMap.delete(this);\n\t\t\t}\n\t\t}\n\t\t\n\t};\n\t\n}\n", "export * from \"./InSite\";\nexport type { Options } from \"./types\";\nexport * from \"insite-common/frontend\";\nexport type { Options as CookieOptions } from \"insite-cookie/client\";\nexport * from \"insite-cookie/client\";\nexport * from \"insite-subscriptions-client\";\nexport * from \"insite-users-client\";\nexport * from \"insite-ws-transfers/browser\";\nexport type { Options as WSOptions } from \"insite-ws/client\";\nexport * from \"insite-ws/client\";\n"],
|
|
5
|
+
"mappings": "iaAAA,OAAOA,MAAkB,gBCAnB,SAAUC,GAAI,CAAU,CCuBxB,SAAUC,EAAiBC,EAA4BC,EAAQ,EAAGC,EAAmB,CAAA,EAAE,CAC5F,GAAI,CAAE,QAAAC,EAAU,GAAO,SAAAC,EAAW,EAAI,EAAKF,EACrC,CAAE,QAAAG,EAAU,GAAQ,EAAKH,EAE3BI,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEEC,EAAU,SAAW,CAE1B,IAAMC,EAAI,KAAK,IAAG,EAEdA,GAAKP,GACRF,EAAU,OACVE,EAAM,OACN,aAAaD,CAAc,EACvB,OAAOK,GAAS,YACnB,MAAMA,EAAK,EACZI,EAAU,QAAQH,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C,EAAS,IAAIxB,EAAOE,CAAO,EAEjC,OAAOqB,EACNC,EAAO,UAAU,EACjBA,CACF,CAED,EAjBCzB,EAAA,YA/HM,IAAM0B,EAANzB,EK/BP,WAAc,yBAEd,WAAc,uBACd,WAAc,8BACd,WAAc,sBACd,WAAc,8BAEd,WAAc",
|
|
6
|
+
"names": ["EventEmitter", "noop", "debounce", "callback", "limit", "options", "leading", "trailing", "maxWait", "timeout", "maxWaitTimeout", "end", "context", "args", "initial", "final", "result", "expired", "n", "debounced", "maxWaitExpired", "run", "_args", "resolve", "noop", "shouldRun", "howmuch", "number", "one", "two", "five", "shouldPrintNumber", "u", "d", "nativesMap", "StatefulPromise", "executor", "nativeResolve", "nativeReject", "resolve", "reject", "__publicField", "value", "native", "reason", "CookieSetter", "Subscription", "UsersSubscriptionGroup", "IncomingTransport", "OutgoingTransport", "WS", "login", "email", "password", "logout", "_initPromise", "_InSite", "EventEmitter", "options", "__publicField", "__privateAdd", "StatefulPromise", "wsWithOtherOptions", "cookieOptions", "users", "isPublic", "subscriptions", "incomingTransport", "outgoingTransport", "wsOptions", "WS", "Subscription", "IncomingTransport", "OutgoingTransport", "CookieSetter", "resolve", "user", "UsersSubscriptionGroup", "__privateGet", "asPromise", "inSite", "InSite"]
|
|
7
7
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export type Options<AS extends AbilitiesSchema> = {
|
|
|
20
20
|
ws?: WSO;
|
|
21
21
|
cookie?: Cookie | null;
|
|
22
22
|
users?: Users<AS> | null;
|
|
23
|
+
public?: boolean;
|
|
23
24
|
};
|
|
24
25
|
type OptionsWithWSSubscriptions = AnyProp & {
|
|
25
26
|
ws?: AnyProp & {
|
|
@@ -42,7 +43,11 @@ type OptionsWithCookie = AnyProp & {
|
|
|
42
43
|
type OptionsWithUsers = OptionsWithCookie & OptionsWithWSSubscriptions & {
|
|
43
44
|
users?: Users<any>;
|
|
44
45
|
};
|
|
45
|
-
|
|
46
|
+
type OptionsWithPublic = OptionsWithCookie & OptionsWithWSSubscriptions & {
|
|
47
|
+
public: true;
|
|
48
|
+
};
|
|
49
|
+
type ExtendsOrOmitUsersProps<O, I> = O extends OptionsWithPublic ? Omit<I, "orgs" | "roles" | "users" | "usersSubscriptionGroup"> : O extends OptionsWithUsers ? I : Omit<I, "isLoggedIn" | "login" | "logout" | "orgs" | "roles" | "user" | "users" | "usersSubscriptionGroup">;
|
|
50
|
+
export type OmitRedundant<I, O> = ExtendsOrOmit<O, OptionsWithWSIncomingTransport, "incomingTransport", ExtendsOrOmit<O, OptionsWithWSOutgoingTransport, "outgoingTransport", ExtendsOrOmit<O, OptionsWithCookie, "cookie", ExtendsOrOmitUsersProps<O, I>>>>;
|
|
46
51
|
type OptionalTransfer<O, W extends WS> = O extends OptionsWithWSOutgoingTransport ? WithTransfer<W> : W;
|
|
47
52
|
type OptionalOnTransfer<O, W extends WS> = O extends OptionsWithWSIncomingTransport ? WithOnTransfer<W> : W;
|
|
48
53
|
export type WSWithActualProps<O> = OptionalTransfer<O, OptionalOnTransfer<O, WS>>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,IAAI,SAAS,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAMjE,KAAK,eAAe,GAAG,IAAI,CAAC;AAC5B,KAAK,mBA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E,MAAM,EAAE,IAAI,CAAA;CAAE,CAAC;AAG3F,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAChC,CAAC,SAAS,iBAAiB,GAC1B,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,wBAAwB,CAAC,GAC9D,CAAC,SAAS,gBAAgB,GACzB,CAAC,GACD,IAAI,CAAC,CAAC,EAAE,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,wBAAwB,CAAC,CAAC;AAG/G,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,IAC7B,aAAa,CAAC,CAAC,EAAE,8BAA8B,EAAE,mBAAmB,EACnE,aAAa,CAAC,CAAC,EAAE,8BAA8B,EAAE,mBAAmB,EACnE,aAAa,CAAC,CAAC,EAAE,iBAAiB,EAAE,QAAQ,EAC3C,uBAAuB,CAAC,CAAC,EACxB,CAAC,CACD,CACD,CACD,CACD,CAAC;AAGH,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,IACpC,CAAC,SAAS,8BAA8B,GACvC,YAAY,CAAC,CAAC,CAAC,GACf,CAAC,CAAC;AAEJ,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,IACtC,CAAC,SAAS,8BAA8B,GACvC,cAAc,CAAC,CAAC,CAAC,GACjB,CAAC,CAAC;AAEJ,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAC9B,gBAAgB,CAAC,CAAC,EACjB,kBAAkB,CAAC,CAAC,EACnB,EAAE,CACF,CACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "insite-client",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "Client-side inSite app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
|
-
"packageManager": "bun@1.2.
|
|
8
|
+
"packageManager": "bun@1.2.9",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
11
|
"build": "bun .conveyer.js",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"author": "Eugene Nesvetaev <dev@nesvet.dev> (https://nesvet.dev/)",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@nesvet/n": "^1.1.
|
|
26
|
+
"@nesvet/n": "^1.1.29",
|
|
27
27
|
"eventemitter3": "^5.0.1",
|
|
28
|
-
"insite-common": "^2.2.
|
|
29
|
-
"insite-cookie": "^2.2.
|
|
30
|
-
"insite-subscriptions-client": "^2.2.
|
|
31
|
-
"insite-users-client": "^2.2.
|
|
32
|
-
"insite-ws": "^2.2.
|
|
33
|
-
"insite-ws-transfers": "^2.2.
|
|
28
|
+
"insite-common": "^2.2.3",
|
|
29
|
+
"insite-cookie": "^2.2.3",
|
|
30
|
+
"insite-subscriptions-client": "^2.2.3",
|
|
31
|
+
"insite-users-client": "^2.2.3",
|
|
32
|
+
"insite-ws": "^2.2.3",
|
|
33
|
+
"insite-ws-transfers": "^2.2.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@nesvet/conveyer": "^2.5.
|
|
37
|
-
"@nesvet/eslint-config": "^2.0.
|
|
38
|
-
"typescript": "^5.8.
|
|
36
|
+
"@nesvet/conveyer": "^2.5.1",
|
|
37
|
+
"@nesvet/eslint-config": "^2.0.52",
|
|
38
|
+
"typescript": "^5.8.3"
|
|
39
39
|
}
|
|
40
40
|
}
|