@kokimoki/app 0.2.0 → 0.2.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.
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -9,11 +9,11 @@ export declare class KokimokiClient<StatelessDataT = any> extends KokimokiClient
|
|
|
9
9
|
private _appId?;
|
|
10
10
|
private _wsUrl?;
|
|
11
11
|
private _apiUrl?;
|
|
12
|
-
private
|
|
12
|
+
private _id?;
|
|
13
13
|
private _token?;
|
|
14
14
|
private _providers;
|
|
15
15
|
constructor();
|
|
16
|
-
get
|
|
16
|
+
get id(): string;
|
|
17
17
|
get appId(): string;
|
|
18
18
|
get token(): string;
|
|
19
19
|
get apiUrl(): string;
|
package/dist/kokimoki-client.js
CHANGED
|
@@ -5,17 +5,17 @@ export class KokimokiClient extends EventEmitter {
|
|
|
5
5
|
_appId;
|
|
6
6
|
_wsUrl;
|
|
7
7
|
_apiUrl;
|
|
8
|
-
|
|
8
|
+
_id;
|
|
9
9
|
_token;
|
|
10
10
|
_providers = new Map();
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
13
13
|
}
|
|
14
|
-
get
|
|
15
|
-
if (!this.
|
|
14
|
+
get id() {
|
|
15
|
+
if (!this._id) {
|
|
16
16
|
throw new Error("Client not connected");
|
|
17
17
|
}
|
|
18
|
-
return this.
|
|
18
|
+
return this._id;
|
|
19
19
|
}
|
|
20
20
|
get appId() {
|
|
21
21
|
if (!this._appId) {
|
|
@@ -54,7 +54,7 @@ export class KokimokiClient extends EventEmitter {
|
|
|
54
54
|
const { clientId, appToken, serverTime, token } = await res.json();
|
|
55
55
|
const endTime = Date.now();
|
|
56
56
|
const ping = Math.round((endTime - startTime) / 2);
|
|
57
|
-
this.
|
|
57
|
+
this._id = clientId;
|
|
58
58
|
this._token = appToken;
|
|
59
59
|
this.serverTimeOffset = Date.now() - serverTime - ping;
|
|
60
60
|
localStorage.setItem("KM_TOKEN", token);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Paginated } from "./types/common";
|
|
1
2
|
import type { Upload } from "./types/upload";
|
|
2
3
|
export declare class KokimokiStorage {
|
|
3
4
|
private createUpload;
|
|
@@ -7,9 +8,6 @@ export declare class KokimokiStorage {
|
|
|
7
8
|
listUploads(filter?: {
|
|
8
9
|
clientId?: string;
|
|
9
10
|
mimeTypes?: string[];
|
|
10
|
-
}, skip?: number, limit?: number): Promise<
|
|
11
|
-
total: any;
|
|
12
|
-
items: any;
|
|
13
|
-
}>;
|
|
11
|
+
}, skip?: number, limit?: number): Promise<Paginated<Upload>>;
|
|
14
12
|
}
|
|
15
13
|
export declare const kmStorage: KokimokiStorage;
|
package/dist/kokimoki-storage.js
CHANGED
package/dist/types/common.d.ts
CHANGED