@kokimoki/app 1.15.1 → 1.15.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/kokimoki-client.d.ts +4 -3
- package/dist/kokimoki.min.d.ts +4 -3
- package/dist/kokimoki.min.js +1 -1
- package/dist/kokimoki.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/fields.d.ts +0 -95
- package/dist/fields.js +0 -152
- package/dist/kokimoki-client-refactored.d.ts +0 -68
- package/dist/kokimoki-client-refactored.js +0 -394
- package/dist/kokimoki-schema.d.ts +0 -84
- package/dist/kokimoki-schema.js +0 -163
- package/dist/message-queue.d.ts +0 -8
- package/dist/message-queue.js +0 -19
- package/dist/synced-schema.d.ts +0 -59
- package/dist/synced-schema.js +0 -84
- package/dist/synced-store.d.ts +0 -7
- package/dist/synced-store.js +0 -9
- package/dist/synced-types.d.ts +0 -38
- package/dist/synced-types.js +0 -68
- package/dist/ws-message-type copy.d.ts +0 -6
- package/dist/ws-message-type copy.js +0 -7
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const KOKIMOKI_APP_VERSION = "1.15.
|
|
1
|
+
export declare const KOKIMOKI_APP_VERSION = "1.15.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const KOKIMOKI_APP_VERSION = "1.15.
|
|
1
|
+
export const KOKIMOKI_APP_VERSION = "1.15.2";
|
package/package.json
CHANGED
package/dist/fields.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
export interface FieldOptions {
|
|
2
|
-
label?: string;
|
|
3
|
-
}
|
|
4
|
-
export declare abstract class Field<T> {
|
|
5
|
-
readonly options: FieldOptions;
|
|
6
|
-
constructor(options: FieldOptions);
|
|
7
|
-
abstract get value(): T;
|
|
8
|
-
abstract get schema(): any;
|
|
9
|
-
}
|
|
10
|
-
export declare class BooleanField extends Field<boolean> {
|
|
11
|
-
value: boolean;
|
|
12
|
-
constructor(value: boolean, options?: FieldOptions);
|
|
13
|
-
get schema(): {
|
|
14
|
-
type: string;
|
|
15
|
-
default: boolean;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export declare class ConstField<T extends string> extends Field<string extends T ? never : T> {
|
|
19
|
-
value: string extends T ? never : T;
|
|
20
|
-
constructor(value: string extends T ? never : T, options?: FieldOptions);
|
|
21
|
-
get schema(): {
|
|
22
|
-
const: string extends T ? never : T;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export declare class ImageField extends Field<string> {
|
|
26
|
-
value: string;
|
|
27
|
-
constructor(value: string, options?: FieldOptions);
|
|
28
|
-
get schema(): {
|
|
29
|
-
type: string;
|
|
30
|
-
default: string;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export declare class TextField extends Field<string> {
|
|
34
|
-
value: string;
|
|
35
|
-
constructor(value: string, options?: FieldOptions);
|
|
36
|
-
get schema(): {
|
|
37
|
-
type: string;
|
|
38
|
-
default: string;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export declare class EnumField<T extends Record<string, string>> extends Field<keyof T> {
|
|
42
|
-
enumValues: T;
|
|
43
|
-
value: keyof T;
|
|
44
|
-
constructor(enumValues: T, value: keyof T, options?: FieldOptions);
|
|
45
|
-
get schema(): {
|
|
46
|
-
enum: string[];
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export declare class IntegerField extends Field<number> {
|
|
50
|
-
value: number;
|
|
51
|
-
constructor(value: number, options?: FieldOptions);
|
|
52
|
-
get schema(): {
|
|
53
|
-
type: string;
|
|
54
|
-
default: number;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export declare class FloatField extends Field<number> {
|
|
58
|
-
value: number;
|
|
59
|
-
constructor(value: number, options?: FieldOptions);
|
|
60
|
-
get schema(): {
|
|
61
|
-
type: string;
|
|
62
|
-
default: number;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
export declare class FormGroup<T extends Record<string, Field<any>>, O extends Record<string, Field<any>>> extends Field<{
|
|
66
|
-
[key in keyof T]: T[key]["value"];
|
|
67
|
-
} & Partial<{
|
|
68
|
-
[key in keyof O]: O[key]["value"];
|
|
69
|
-
}>> {
|
|
70
|
-
requiredFields: T;
|
|
71
|
-
optionalFields: O;
|
|
72
|
-
constructor(requiredFields: T, optionalFields?: O, options?: FieldOptions);
|
|
73
|
-
get value(): {
|
|
74
|
-
[key in keyof T]: T[key]["value"];
|
|
75
|
-
} & Partial<{
|
|
76
|
-
[key in keyof O]: O[key]["value"];
|
|
77
|
-
}>;
|
|
78
|
-
get schema(): {
|
|
79
|
-
type: string;
|
|
80
|
-
properties: any;
|
|
81
|
-
required: string[];
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
export declare class FormArray<T> extends Field<T[]> {
|
|
85
|
-
private factory;
|
|
86
|
-
value: Field<T>["value"][];
|
|
87
|
-
constructor(factory: () => Field<T>, value: Field<T>["value"][], options?: FieldOptions);
|
|
88
|
-
get schema(): {
|
|
89
|
-
type: string;
|
|
90
|
-
items: any;
|
|
91
|
-
default: T[];
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
export declare class Form<R extends Record<string, Field<any>>, O extends Record<string, Field<any>>> extends FormGroup<R, O> {
|
|
95
|
-
}
|
package/dist/fields.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
const defaultFieldOptions = {};
|
|
2
|
-
export class Field {
|
|
3
|
-
options;
|
|
4
|
-
constructor(options) {
|
|
5
|
-
this.options = options;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export class BooleanField extends Field {
|
|
9
|
-
value;
|
|
10
|
-
constructor(value, options = defaultFieldOptions) {
|
|
11
|
-
super(options);
|
|
12
|
-
this.value = value;
|
|
13
|
-
}
|
|
14
|
-
get schema() {
|
|
15
|
-
return {
|
|
16
|
-
type: "boolean",
|
|
17
|
-
default: this.value,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export class ConstField extends Field {
|
|
22
|
-
value;
|
|
23
|
-
constructor(value, options = defaultFieldOptions) {
|
|
24
|
-
super(options);
|
|
25
|
-
this.value = value;
|
|
26
|
-
}
|
|
27
|
-
get schema() {
|
|
28
|
-
return {
|
|
29
|
-
const: this.value,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export class ImageField extends Field {
|
|
34
|
-
value;
|
|
35
|
-
constructor(value, options = defaultFieldOptions) {
|
|
36
|
-
super(options);
|
|
37
|
-
this.value = value;
|
|
38
|
-
}
|
|
39
|
-
get schema() {
|
|
40
|
-
return {
|
|
41
|
-
type: "string",
|
|
42
|
-
default: this.value,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export class TextField extends Field {
|
|
47
|
-
value;
|
|
48
|
-
constructor(value, options = defaultFieldOptions) {
|
|
49
|
-
super(options);
|
|
50
|
-
this.value = value;
|
|
51
|
-
}
|
|
52
|
-
get schema() {
|
|
53
|
-
return {
|
|
54
|
-
type: "string",
|
|
55
|
-
default: this.value,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
export class EnumField extends Field {
|
|
60
|
-
enumValues;
|
|
61
|
-
value;
|
|
62
|
-
constructor(enumValues, value, options = defaultFieldOptions) {
|
|
63
|
-
super(options);
|
|
64
|
-
this.enumValues = enumValues;
|
|
65
|
-
this.value = value;
|
|
66
|
-
}
|
|
67
|
-
get schema() {
|
|
68
|
-
return {
|
|
69
|
-
enum: Object.keys(this.enumValues),
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
export class IntegerField extends Field {
|
|
74
|
-
value;
|
|
75
|
-
constructor(value, options = defaultFieldOptions) {
|
|
76
|
-
super(options);
|
|
77
|
-
this.value = value;
|
|
78
|
-
}
|
|
79
|
-
get schema() {
|
|
80
|
-
return {
|
|
81
|
-
type: "integer",
|
|
82
|
-
default: this.value,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
export class FloatField extends Field {
|
|
87
|
-
value;
|
|
88
|
-
constructor(value, options = defaultFieldOptions) {
|
|
89
|
-
super(options);
|
|
90
|
-
this.value = value;
|
|
91
|
-
}
|
|
92
|
-
get schema() {
|
|
93
|
-
return {
|
|
94
|
-
type: "number",
|
|
95
|
-
default: this.value,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
export class FormGroup extends Field {
|
|
100
|
-
requiredFields;
|
|
101
|
-
optionalFields;
|
|
102
|
-
constructor(requiredFields, optionalFields = {}, options = defaultFieldOptions) {
|
|
103
|
-
super(options);
|
|
104
|
-
this.requiredFields = requiredFields;
|
|
105
|
-
this.optionalFields = optionalFields;
|
|
106
|
-
}
|
|
107
|
-
get value() {
|
|
108
|
-
const value = Object.entries(this.requiredFields).reduce((acc, [key, field]) => {
|
|
109
|
-
acc[key] = field.value;
|
|
110
|
-
return acc;
|
|
111
|
-
}, {});
|
|
112
|
-
Object.entries(this.optionalFields).forEach(([key, field]) => {
|
|
113
|
-
if (field.value !== undefined) {
|
|
114
|
-
value[key] = field.value;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
return value;
|
|
118
|
-
}
|
|
119
|
-
get schema() {
|
|
120
|
-
const properties = {};
|
|
121
|
-
Object.entries(this.requiredFields).forEach(([key, field]) => {
|
|
122
|
-
properties[key] = field.schema;
|
|
123
|
-
});
|
|
124
|
-
Object.entries(this.optionalFields).forEach(([key, field]) => {
|
|
125
|
-
properties[key] = field.schema;
|
|
126
|
-
});
|
|
127
|
-
return {
|
|
128
|
-
type: "object",
|
|
129
|
-
properties,
|
|
130
|
-
required: Object.keys(this.requiredFields),
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
export class FormArray extends Field {
|
|
135
|
-
factory;
|
|
136
|
-
value;
|
|
137
|
-
constructor(factory, value, options = defaultFieldOptions) {
|
|
138
|
-
super(options);
|
|
139
|
-
this.factory = factory;
|
|
140
|
-
this.value = value;
|
|
141
|
-
}
|
|
142
|
-
get schema() {
|
|
143
|
-
const field = this.factory();
|
|
144
|
-
return {
|
|
145
|
-
type: "array",
|
|
146
|
-
items: field.schema,
|
|
147
|
-
default: this.value,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
export class Form extends FormGroup {
|
|
152
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type TypedEmitter from "typed-emitter";
|
|
2
|
-
import type { KokimokiClientEventsRefactored } from "./types/events";
|
|
3
|
-
import type { Upload } from "./types/upload";
|
|
4
|
-
import type { Paginated } from "./types/common";
|
|
5
|
-
import { KokimokiTransaction } from "./kokimoki-transaction";
|
|
6
|
-
import type { KokimokiStore } from "./kokimoki-store";
|
|
7
|
-
import type { SyncedGeneric } from "./synced-schema";
|
|
8
|
-
import { RoomSubscriptionMode } from "./room-subscription-mode";
|
|
9
|
-
declare const KokimokiClientRefactored_base: new () => TypedEmitter<KokimokiClientEventsRefactored>;
|
|
10
|
-
export declare class KokimokiClientRefactored<ClientContextT = any> extends KokimokiClientRefactored_base {
|
|
11
|
-
readonly host: string;
|
|
12
|
-
readonly appId: string;
|
|
13
|
-
readonly code: string;
|
|
14
|
-
private _wsUrl;
|
|
15
|
-
private _apiUrl;
|
|
16
|
-
private _id?;
|
|
17
|
-
private _token?;
|
|
18
|
-
private _apiHeaders?;
|
|
19
|
-
private _serverTimeOffset;
|
|
20
|
-
private _clientContext?;
|
|
21
|
-
private _ws?;
|
|
22
|
-
private _subscriptions;
|
|
23
|
-
private _stores;
|
|
24
|
-
private _reqPromises;
|
|
25
|
-
private _transactionResolves;
|
|
26
|
-
private _roomHashes;
|
|
27
|
-
private _roomHashToDoc;
|
|
28
|
-
private _connected;
|
|
29
|
-
private _connectPromise?;
|
|
30
|
-
private _messageId;
|
|
31
|
-
constructor(host: string, appId: string, code?: string);
|
|
32
|
-
get id(): string;
|
|
33
|
-
get token(): string;
|
|
34
|
-
get apiUrl(): string;
|
|
35
|
-
get apiHeaders(): Headers;
|
|
36
|
-
get clientContext(): ClientContextT & ({} | null);
|
|
37
|
-
get connected(): boolean;
|
|
38
|
-
get ws(): WebSocket;
|
|
39
|
-
connect(): Promise<void>;
|
|
40
|
-
private handleInitMessage;
|
|
41
|
-
private handleBinaryMessage;
|
|
42
|
-
private handleErrorMessage;
|
|
43
|
-
private handleSubscribeResMessage;
|
|
44
|
-
private handleRoomUpdateMessage;
|
|
45
|
-
serverTimestamp(): number;
|
|
46
|
-
patchRoomState(room: string, update: Uint8Array): Promise<any>;
|
|
47
|
-
private createUpload;
|
|
48
|
-
private uploadChunks;
|
|
49
|
-
private completeUpload;
|
|
50
|
-
upload(name: string, blob: Blob, tags?: string[]): Promise<Upload>;
|
|
51
|
-
updateUpload(id: string, update: {
|
|
52
|
-
tags?: string[];
|
|
53
|
-
}): Promise<Upload>;
|
|
54
|
-
listUploads(filter?: {
|
|
55
|
-
clientId?: string;
|
|
56
|
-
mimeTypes?: string[];
|
|
57
|
-
tags?: string[];
|
|
58
|
-
}, skip?: number, limit?: number): Promise<Paginated<Upload>>;
|
|
59
|
-
deleteUpload(id: string): Promise<{
|
|
60
|
-
acknowledged: boolean;
|
|
61
|
-
deletedCount: number;
|
|
62
|
-
}>;
|
|
63
|
-
exposeScriptingContext(context: any): Promise<void>;
|
|
64
|
-
private sendSubscriptionReq;
|
|
65
|
-
join<T extends SyncedGeneric<unknown>>(store: KokimokiStore<T>, mode?: RoomSubscriptionMode): Promise<void>;
|
|
66
|
-
transact(handler: (t: KokimokiTransaction) => void): Promise<void>;
|
|
67
|
-
}
|
|
68
|
-
export {};
|