@kokimoki/app 0.5.1 → 0.5.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/fields.d.ts CHANGED
@@ -54,6 +54,14 @@ export declare class IntegerField extends Field<number> {
54
54
  default: number;
55
55
  };
56
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
+ }
57
65
  export declare class FormGroup<T extends Record<string, Field<any>>, O extends Record<string, Field<any>>> extends Field<{
58
66
  [key in keyof T]: T[key]["value"];
59
67
  } & Partial<{
package/dist/fields.js CHANGED
@@ -83,6 +83,19 @@ export class IntegerField extends Field {
83
83
  };
84
84
  }
85
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
+ }
86
99
  export class FormGroup extends Field {
87
100
  requiredFields;
88
101
  optionalFields;
@@ -40,5 +40,9 @@ export declare class KokimokiClient<StatelessDataT = any> extends KokimokiClient
40
40
  mimeTypes?: string[];
41
41
  tags?: string[];
42
42
  }, skip?: number, limit?: number): Promise<Paginated<Upload>>;
43
+ deleteUpload(id: string): Promise<{
44
+ acknowledged: boolean;
45
+ deletedCount: number;
46
+ }>;
43
47
  }
44
48
  export {};
@@ -186,4 +186,11 @@ export class KokimokiClient extends EventEmitter {
186
186
  });
187
187
  return await res.json();
188
188
  }
189
+ async deleteUpload(id) {
190
+ const res = await fetch(`${this._apiUrl}/uploads/${id}`, {
191
+ method: "DELETE",
192
+ headers: this.apiHeaders,
193
+ });
194
+ return await res.json();
195
+ }
189
196
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokimoki/app",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "description": "Kokimoki app",
6
6
  "main": "dist/index.js",