@fnlb-project/shared 1.5.7 → 1.5.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/types/index.d.ts +4 -2
- package/dist/util/index.d.ts +8 -0
- package/dist/util/index.js +1 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -167,10 +167,11 @@ export interface IClientAccount {
|
|
|
167
167
|
export interface IDBBot {
|
|
168
168
|
id: string;
|
|
169
169
|
owner: string;
|
|
170
|
-
parent
|
|
170
|
+
parent?: string;
|
|
171
171
|
nickname: string;
|
|
172
172
|
type: BotTypes;
|
|
173
|
-
email
|
|
173
|
+
email?: string;
|
|
174
|
+
disabled?: boolean;
|
|
174
175
|
deviceAuth: {
|
|
175
176
|
accountId: string;
|
|
176
177
|
deviceId: string;
|
|
@@ -333,6 +334,7 @@ export interface IDBCategory {
|
|
|
333
334
|
id: string;
|
|
334
335
|
owner: string;
|
|
335
336
|
name: string;
|
|
337
|
+
disabled?: boolean;
|
|
336
338
|
config: ICategoryConfig;
|
|
337
339
|
}
|
|
338
340
|
export interface ICategory extends IDBCategory {
|
package/dist/util/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
export declare class AsyncLock {
|
|
4
|
+
private lockPromise?;
|
|
5
|
+
constructor();
|
|
6
|
+
get isLocked(): boolean;
|
|
7
|
+
wait(): Promise<void>;
|
|
8
|
+
lock(): void;
|
|
9
|
+
unlock(): void;
|
|
10
|
+
}
|
|
3
11
|
export declare abstract class AuthUtil {
|
|
4
12
|
static encodeToken(id: string, auth: string): string;
|
|
5
13
|
static decodeToken(token: string): {
|
package/dist/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class
|
|
1
|
+
class s{lockPromise;constructor(){this.lockPromise=void 0}get isLocked(){return!!this.lockPromise}wait(){return this.lockPromise?.promise||Promise.resolve()}lock(){let e,r=new Promise((t)=>{e=t});this.lockPromise={promise:r,resolve:e}}unlock(){this.lockPromise?.resolve(),this.lockPromise=void 0}}class n{static encodeToken(e,r){let t=Buffer.from(e,"hex"),i=Buffer.from(r,"hex"),o=Buffer.from([t.length]);return Buffer.concat([new Uint8Array(o),new Uint8Array(t),new Uint8Array(i)]).toString("base64url")}static decodeToken(e){let r=Buffer.from(e,"base64url"),t=r[0];if(!t||t>=r.length)return null;let i=r.subarray(1,1+t).toString("hex"),o=r.subarray(1+t).toString("hex");return{id:i,auth:o}}}class u{static wait(e){return new Promise((r)=>setTimeout(r,e))}}class l extends Map{ttl;constructor(e){super();this.ttl=e}pull(e){return super.get(e)?.value}push(e,r){let t=setTimeout(()=>this.delete(e),this.ttl);return super.set(e,{handle:t,value:r})}remove(e){let r=this.get(e);if(r)clearTimeout(r.handle);return super.delete(e)}modify(e,r){let t=super.get(e);if(t)return t.value=r,!0;return!1}}class c{static cutText(e,r,t=!0){return e.length>r?`${e.slice(0,t?Math.max(r-3,0):r)}${t?"...":""}`:e}}export{c as TextUtil,l as TemporalMap,u as PromiseUtil,n as AuthUtil,s as AsyncLock};
|