@ztimson/momentum 1.4.3 → 1.4.5
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/audit.d.ts +2 -2
- package/dist/audit.d.ts.map +1 -1
- package/dist/data.d.ts +11 -8
- package/dist/data.d.ts.map +1 -1
- package/dist/index.js +37 -31
- package/dist/index.mjs +37 -31
- package/dist/schemas.d.ts +2 -0
- package/dist/schemas.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/audit.d.ts
CHANGED
package/dist/audit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,qBAAqB;AACrB,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,GAAG;IACtC,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,qBAAqB;AACrB,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,GAAG;IACtC,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc;IACd,KAAK,EAAE,GAAG,CAAC;CACX,CAAA;AAED,qBAAa,KAAM,SAAQ,gBAAgB;IAE9B,SAAS,CAAC,QAAQ,EAAE,QAAQ;gBAAlB,QAAQ,EAAE,QAAQ;IAIlC,SAAS,IAAI,OAAO,CAAC;QAAC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAC;IAChD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAK5C,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAKzD,QAAQ,CAAC,EAAE,EAAE,MAAM;CAIzB"}
|
package/dist/data.d.ts
CHANGED
|
@@ -3,14 +3,18 @@ import { Meta, PathEventEmitter } from './core';
|
|
|
3
3
|
import { Momentum } from './momentum';
|
|
4
4
|
/** Comparison operators for filters */
|
|
5
5
|
export type FilterOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'nin' | 'regex' | 'exists';
|
|
6
|
-
/** Filter value - primitive for equality
|
|
7
|
-
export type FilterValue<T = any> = T | [FilterOperator, T];
|
|
8
|
-
/** Filter object with comparison support */
|
|
9
|
-
export type Filter<T = any> = {
|
|
6
|
+
/** Filter value - primitive for equality, operator array, or top-level OR array */
|
|
7
|
+
export type FilterValue<T = any> = T | [FilterOperator | T | '||' | '&&', ...(T | FilterOperator | '||' | '&&')[]];
|
|
8
|
+
/** Filter object with comparison support, or array for top-level OR logic */
|
|
9
|
+
export type Filter<T = any> = ({
|
|
10
10
|
[K in keyof T]?: FilterValue<T[K]>;
|
|
11
11
|
} & {
|
|
12
12
|
[key: string]: FilterValue;
|
|
13
|
-
}
|
|
13
|
+
}) | Array<({
|
|
14
|
+
[K in keyof T]?: FilterValue<T[K]>;
|
|
15
|
+
} & {
|
|
16
|
+
[key: string]: FilterValue;
|
|
17
|
+
}) | '||'>;
|
|
14
18
|
/** Generic MongoDB document */
|
|
15
19
|
export type Document<T> = Meta & T;
|
|
16
20
|
/** Read query options */
|
|
@@ -51,9 +55,7 @@ export declare class Data extends PathEventEmitter {
|
|
|
51
55
|
[key: string]: Unsubscribe;
|
|
52
56
|
};
|
|
53
57
|
constructor(momentum: Momentum);
|
|
54
|
-
protected dataUrl(collection: string, pk?: number
|
|
55
|
-
[key: string]: any;
|
|
56
|
-
}): string;
|
|
58
|
+
protected dataUrl(collection: string, pk?: number | null): string;
|
|
57
59
|
/**
|
|
58
60
|
* Create new document(s) in collection
|
|
59
61
|
* @param {string} collection Target collection
|
|
@@ -69,6 +71,7 @@ export declare class Data extends PathEventEmitter {
|
|
|
69
71
|
* @return {Promise<number[]>} Array of deleted document IDs
|
|
70
72
|
*/
|
|
71
73
|
delete(collection: string, id: number, options?: DeleteOptions): Promise<number[]>;
|
|
74
|
+
delete(collection: string, ids: number[], options?: DeleteOptions): Promise<number[]>;
|
|
72
75
|
delete<T>(collection: string, filter: Filter<T>, options?: DeleteOptions): Promise<number[]>;
|
|
73
76
|
/**
|
|
74
77
|
* Read document(s) from collection
|
package/dist/data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,KAAK,IAAI,EAAE,gBAAgB,EAAM,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,uCAAuC;AACvC,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEtG,
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,KAAK,IAAI,EAAE,gBAAgB,EAAM,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,C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,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IASzD;;;;;;OAMG;IACH,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,GAAE;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAM,GAAG,WAAW;CAmBtG"}
|
package/dist/index.js
CHANGED
|
@@ -3196,14 +3196,8 @@ Must be either: call, email or sms`);
|
|
|
3196
3196
|
}
|
|
3197
3197
|
momentum;
|
|
3198
3198
|
subscribers = {};
|
|
3199
|
-
dataUrl(collection, pk
|
|
3200
|
-
|
|
3201
|
-
if (filter) params.set("q", JSON.stringify(filter));
|
|
3202
|
-
Object.entries(options ?? {}).forEach(([key, value]) => {
|
|
3203
|
-
if (value !== void 0 && value !== null) params.set(key, String(value));
|
|
3204
|
-
});
|
|
3205
|
-
const query = params.toString();
|
|
3206
|
-
return `api/data/${collection}${pk != null ? `/${pk}` : ""}${query ? `?${query}` : ""}`;
|
|
3199
|
+
dataUrl(collection, pk) {
|
|
3200
|
+
return `api/data/${collection}${pk != null ? `/${pk}` : ""}`;
|
|
3207
3201
|
}
|
|
3208
3202
|
/**
|
|
3209
3203
|
* Create new document(s) in collection
|
|
@@ -3213,6 +3207,7 @@ Must be either: call, email or sms`);
|
|
|
3213
3207
|
*/
|
|
3214
3208
|
create(collection, documents) {
|
|
3215
3209
|
if (!collection || !documents) throw new Error("Cannot create document, missing collection or document");
|
|
3210
|
+
if (Array.isArray(documents) && !documents.length) return Promise.resolve([]);
|
|
3216
3211
|
return this.momentum.api.request({
|
|
3217
3212
|
url: `api/` + PES`data/${collection}`,
|
|
3218
3213
|
method: "POST",
|
|
@@ -3225,19 +3220,30 @@ Must be either: call, email or sms`);
|
|
|
3225
3220
|
}
|
|
3226
3221
|
async delete(collection, filter, options) {
|
|
3227
3222
|
if (!collection || filter == null) throw new Error("Cannot delete document, missing collection or filter");
|
|
3228
|
-
|
|
3229
|
-
const
|
|
3230
|
-
const url = this.dataUrl(collection, pk
|
|
3231
|
-
const ids = await this.momentum.api.request({
|
|
3223
|
+
if (Array.isArray(filter) && !filter.length) return [];
|
|
3224
|
+
const pk = Array.isArray(filter) ? null : typeof filter == "object" ? filter["_id"] == null || Array.isArray(filter["_id"]) ? null : filter["_id"] : filter;
|
|
3225
|
+
const url = this.dataUrl(collection, pk);
|
|
3226
|
+
const ids = await this.momentum.api.request({
|
|
3227
|
+
url,
|
|
3228
|
+
method: "DELETE",
|
|
3229
|
+
body: {
|
|
3230
|
+
filter: Array.isArray(filter) ? { _id: ["in", filter] } : typeof filter == "object" && pk == null ? filter : null,
|
|
3231
|
+
...options
|
|
3232
|
+
}
|
|
3233
|
+
});
|
|
3232
3234
|
ids.forEach((id) => this.emit(PES`data/${collection}/${id}:d`, id));
|
|
3233
3235
|
return ids;
|
|
3234
3236
|
}
|
|
3235
3237
|
read(collection, filter, options) {
|
|
3236
3238
|
if (!collection) throw new Error("Cannot read documents, missing collection");
|
|
3237
|
-
const pk = typeof filter == "object" ? filter
|
|
3239
|
+
const pk = Array.isArray(filter) ? null : typeof filter == "object" ? filter["_id"] == null || Array.isArray(filter["_id"]) ? null : filter["_id"] : filter;
|
|
3238
3240
|
const q = typeof filter == "object" && filter != null && Object.keys(filter).length && pk == null ? filter : null;
|
|
3239
|
-
const url = this.dataUrl(collection, pk
|
|
3240
|
-
return this.momentum.api.request({
|
|
3241
|
+
const url = this.dataUrl(collection, pk);
|
|
3242
|
+
return this.momentum.api.request({
|
|
3243
|
+
url,
|
|
3244
|
+
method: "POST",
|
|
3245
|
+
body: { filter: q, ...options, _read: true }
|
|
3246
|
+
}).then((resp) => {
|
|
3241
3247
|
if (!resp) return null;
|
|
3242
3248
|
if (Array.isArray(resp)) {
|
|
3243
3249
|
if (!q && !options?.limit) this.emit(PES`data/${collection}:r`, collection, resp);
|
|
@@ -3256,17 +3262,17 @@ Must be either: call, email or sms`);
|
|
|
3256
3262
|
* @return {Promise<Document<T> | Document<T>[]>} Updated document(s)
|
|
3257
3263
|
*/
|
|
3258
3264
|
update(collection, documents, options = {}) {
|
|
3259
|
-
if (!collection || !documents) throw new Error("Cannot update
|
|
3265
|
+
if (!collection || !documents) throw new Error("Cannot update, missing collection or document");
|
|
3266
|
+
if (Array.isArray(documents) && !documents.length) return Promise.resolve([]);
|
|
3260
3267
|
const { filter, append, ...queryOptions } = options;
|
|
3261
3268
|
const isArray = Array.isArray(documents);
|
|
3262
3269
|
const firstDoc = isArray ? documents[0] : documents;
|
|
3263
|
-
const pk = isArray ? null : filter
|
|
3264
|
-
const
|
|
3265
|
-
const url = this.dataUrl(collection, pk, q, queryOptions);
|
|
3270
|
+
const pk = (isArray ? null : filter && !Array.isArray(filter?._id) ? filter?._id : null) ?? firstDoc._id;
|
|
3271
|
+
const url = this.dataUrl(collection, pk);
|
|
3266
3272
|
return this.momentum.api.request({
|
|
3267
3273
|
url,
|
|
3268
3274
|
method: append === false ? "PUT" : "PATCH",
|
|
3269
|
-
body: documents
|
|
3275
|
+
body: { data: documents, filter: filter && filter?._id == null ? filter : null, ...queryOptions }
|
|
3270
3276
|
}).then((resp) => {
|
|
3271
3277
|
if (!resp) return null;
|
|
3272
3278
|
makeArray(resp).forEach((r) => this.emit(PES`data/${collection}/${r._id}:u`, r));
|
|
@@ -3282,7 +3288,7 @@ Must be either: call, email or sms`);
|
|
|
3282
3288
|
raw(collection, query) {
|
|
3283
3289
|
if (!collection || !query) throw new Error("Cannot execute raw query, missing collection or query");
|
|
3284
3290
|
const mode = query.operand.startsWith("find") ? "r" : query.operand == "insertOne" ? "c" : query.operand.startsWith("delete") ? "d" : "u";
|
|
3285
|
-
return this.momentum.api.request({ url: `api/` + PES`data/${collection}
|
|
3291
|
+
return this.momentum.api.request({ url: `api/` + PES`data/${collection}`, method: "POST", body: { ...query, _raw: true } }).then((resp) => {
|
|
3286
3292
|
this.emit(PES`data/${collection}:${mode}`, resp);
|
|
3287
3293
|
return resp;
|
|
3288
3294
|
});
|
|
@@ -4059,7 +4065,7 @@ ${log}`;
|
|
|
4059
4065
|
*/
|
|
4060
4066
|
all(path) {
|
|
4061
4067
|
if (!path) path = "/";
|
|
4062
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4068
|
+
return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}?all=true` }).then((resp) => {
|
|
4063
4069
|
this.emit(PES`${this.module}/${path}:r`, resp);
|
|
4064
4070
|
return resp;
|
|
4065
4071
|
});
|
|
@@ -4078,7 +4084,7 @@ ${log}`;
|
|
|
4078
4084
|
destination = [...path.slice(0, -1), destination].join("/");
|
|
4079
4085
|
if (!destination.startsWith("/")) destination = "/" + destination;
|
|
4080
4086
|
}
|
|
4081
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4087
|
+
return this.momentum.api.request({ url: `api/${this.module}${destination.startsWith("/") ? "" : "/"}${destination}`, body: { from: source } }).then((response) => {
|
|
4082
4088
|
this.emit(PES`${this.module}/${destination}:c`, response);
|
|
4083
4089
|
return response;
|
|
4084
4090
|
});
|
|
@@ -4090,7 +4096,7 @@ ${log}`;
|
|
|
4090
4096
|
*/
|
|
4091
4097
|
async delete(path) {
|
|
4092
4098
|
if (!path) throw new Error("Cannot delete file or folder, missing module");
|
|
4093
|
-
const count = await this.momentum.api.request({ url: `api/${this.module}
|
|
4099
|
+
const count = await this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}`, method: "DELETE" });
|
|
4094
4100
|
if (count) this.emit(PES`${this.module}/${path}:d`, path);
|
|
4095
4101
|
return count;
|
|
4096
4102
|
}
|
|
@@ -4110,7 +4116,7 @@ ${log}`;
|
|
|
4110
4116
|
*/
|
|
4111
4117
|
meta(path) {
|
|
4112
4118
|
if (!path) path = "/";
|
|
4113
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4119
|
+
return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}?meta=true` }).then((resp) => {
|
|
4114
4120
|
this.emit(PES`${this.module}/${path}:r`, resp);
|
|
4115
4121
|
return resp;
|
|
4116
4122
|
});
|
|
@@ -4122,7 +4128,7 @@ ${log}`;
|
|
|
4122
4128
|
*/
|
|
4123
4129
|
mkdir(path) {
|
|
4124
4130
|
if (!path) throw new Error("Cannot make directory, missing module");
|
|
4125
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4131
|
+
return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}`, body: { directory: true } }).then((resp) => {
|
|
4126
4132
|
this.emit(PES`${this.module}/${path}:c`, resp);
|
|
4127
4133
|
return resp;
|
|
4128
4134
|
});
|
|
@@ -4136,7 +4142,7 @@ ${log}`;
|
|
|
4136
4142
|
move(source, destination) {
|
|
4137
4143
|
if (!source || !destination) throw new Error("Cannot move file or folder, missing source or destination");
|
|
4138
4144
|
if (source == destination) return this.meta(destination);
|
|
4139
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4145
|
+
return this.momentum.api.request({ url: `api/${this.module}${source.startsWith("/") ? "" : "/"}${source}`, method: "PUT", body: { move: destination } }).then((response) => {
|
|
4140
4146
|
this.emit(PES`${this.module}/${source}:u`, response);
|
|
4141
4147
|
return response;
|
|
4142
4148
|
});
|
|
@@ -4146,7 +4152,7 @@ ${log}`;
|
|
|
4146
4152
|
const link = `${this.momentum.url.toString()}api/${this.module}/${path}`.replaceAll(/([^:])\/+/g, "$1/") + (!this.momentum.api.sameOrigin && this.momentum.api.token ? `?token=${this.momentum.api.token}` : "");
|
|
4147
4153
|
if (target === "url" || target === false) return link;
|
|
4148
4154
|
if (target === "_blank" || target == "_self") return window.open(link, target);
|
|
4149
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4155
|
+
return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}?download=true`, decode: false }).then(async (response) => {
|
|
4150
4156
|
const blob = await response.blob();
|
|
4151
4157
|
if (target !== "blob") {
|
|
4152
4158
|
const name = target === "download" ? path.split("/").pop() : target;
|
|
@@ -4157,7 +4163,7 @@ ${log}`;
|
|
|
4157
4163
|
}
|
|
4158
4164
|
text(path, set) {
|
|
4159
4165
|
if (!path) throw new Error("Missing path");
|
|
4160
|
-
if (set !== void 0) return this.momentum.api.request({ url: `api/${this.module}
|
|
4166
|
+
if (set !== void 0) return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}`, method: "PATCH", body: { text: set } });
|
|
4161
4167
|
else return this.momentum.api.request({ url: `api/${this.module}/${path}?text=true` });
|
|
4162
4168
|
}
|
|
4163
4169
|
/**
|
|
@@ -4177,7 +4183,7 @@ ${log}`;
|
|
|
4177
4183
|
f = [new File([f[0]], opts.rename, { type: f[0].type })];
|
|
4178
4184
|
}
|
|
4179
4185
|
return uploadWithProgress({
|
|
4180
|
-
url: `${this.momentum.url.toString()}api/${this.module}
|
|
4186
|
+
url: `${this.momentum.url.toString()}api/${this.module}${path.startsWith("/") ? "" : "/"}${path}`,
|
|
4181
4187
|
headers: this.momentum.api.headers,
|
|
4182
4188
|
files: f
|
|
4183
4189
|
}).onProgress((p) => {
|
|
@@ -4332,7 +4338,7 @@ ${log}`;
|
|
|
4332
4338
|
}
|
|
4333
4339
|
momentum;
|
|
4334
4340
|
}
|
|
4335
|
-
const version = "1.4.
|
|
4341
|
+
const version = "1.4.5";
|
|
4336
4342
|
class WebRtc extends PathEventEmitter {
|
|
4337
4343
|
constructor(momentum) {
|
|
4338
4344
|
super("webrtc");
|
package/dist/index.mjs
CHANGED
|
@@ -3192,14 +3192,8 @@ class Data extends PathEventEmitter {
|
|
|
3192
3192
|
}
|
|
3193
3193
|
momentum;
|
|
3194
3194
|
subscribers = {};
|
|
3195
|
-
dataUrl(collection, pk
|
|
3196
|
-
|
|
3197
|
-
if (filter) params.set("q", JSON.stringify(filter));
|
|
3198
|
-
Object.entries(options ?? {}).forEach(([key, value]) => {
|
|
3199
|
-
if (value !== void 0 && value !== null) params.set(key, String(value));
|
|
3200
|
-
});
|
|
3201
|
-
const query = params.toString();
|
|
3202
|
-
return `api/data/${collection}${pk != null ? `/${pk}` : ""}${query ? `?${query}` : ""}`;
|
|
3195
|
+
dataUrl(collection, pk) {
|
|
3196
|
+
return `api/data/${collection}${pk != null ? `/${pk}` : ""}`;
|
|
3203
3197
|
}
|
|
3204
3198
|
/**
|
|
3205
3199
|
* Create new document(s) in collection
|
|
@@ -3209,6 +3203,7 @@ class Data extends PathEventEmitter {
|
|
|
3209
3203
|
*/
|
|
3210
3204
|
create(collection, documents) {
|
|
3211
3205
|
if (!collection || !documents) throw new Error("Cannot create document, missing collection or document");
|
|
3206
|
+
if (Array.isArray(documents) && !documents.length) return Promise.resolve([]);
|
|
3212
3207
|
return this.momentum.api.request({
|
|
3213
3208
|
url: `api/` + PES`data/${collection}`,
|
|
3214
3209
|
method: "POST",
|
|
@@ -3221,19 +3216,30 @@ class Data extends PathEventEmitter {
|
|
|
3221
3216
|
}
|
|
3222
3217
|
async delete(collection, filter, options) {
|
|
3223
3218
|
if (!collection || filter == null) throw new Error("Cannot delete document, missing collection or filter");
|
|
3224
|
-
|
|
3225
|
-
const
|
|
3226
|
-
const url = this.dataUrl(collection, pk
|
|
3227
|
-
const ids = await this.momentum.api.request({
|
|
3219
|
+
if (Array.isArray(filter) && !filter.length) return [];
|
|
3220
|
+
const pk = Array.isArray(filter) ? null : typeof filter == "object" ? filter["_id"] == null || Array.isArray(filter["_id"]) ? null : filter["_id"] : filter;
|
|
3221
|
+
const url = this.dataUrl(collection, pk);
|
|
3222
|
+
const ids = await this.momentum.api.request({
|
|
3223
|
+
url,
|
|
3224
|
+
method: "DELETE",
|
|
3225
|
+
body: {
|
|
3226
|
+
filter: Array.isArray(filter) ? { _id: ["in", filter] } : typeof filter == "object" && pk == null ? filter : null,
|
|
3227
|
+
...options
|
|
3228
|
+
}
|
|
3229
|
+
});
|
|
3228
3230
|
ids.forEach((id) => this.emit(PES`data/${collection}/${id}:d`, id));
|
|
3229
3231
|
return ids;
|
|
3230
3232
|
}
|
|
3231
3233
|
read(collection, filter, options) {
|
|
3232
3234
|
if (!collection) throw new Error("Cannot read documents, missing collection");
|
|
3233
|
-
const pk = typeof filter == "object" ? filter
|
|
3235
|
+
const pk = Array.isArray(filter) ? null : typeof filter == "object" ? filter["_id"] == null || Array.isArray(filter["_id"]) ? null : filter["_id"] : filter;
|
|
3234
3236
|
const q = typeof filter == "object" && filter != null && Object.keys(filter).length && pk == null ? filter : null;
|
|
3235
|
-
const url = this.dataUrl(collection, pk
|
|
3236
|
-
return this.momentum.api.request({
|
|
3237
|
+
const url = this.dataUrl(collection, pk);
|
|
3238
|
+
return this.momentum.api.request({
|
|
3239
|
+
url,
|
|
3240
|
+
method: "POST",
|
|
3241
|
+
body: { filter: q, ...options, _read: true }
|
|
3242
|
+
}).then((resp) => {
|
|
3237
3243
|
if (!resp) return null;
|
|
3238
3244
|
if (Array.isArray(resp)) {
|
|
3239
3245
|
if (!q && !options?.limit) this.emit(PES`data/${collection}:r`, collection, resp);
|
|
@@ -3252,17 +3258,17 @@ class Data extends PathEventEmitter {
|
|
|
3252
3258
|
* @return {Promise<Document<T> | Document<T>[]>} Updated document(s)
|
|
3253
3259
|
*/
|
|
3254
3260
|
update(collection, documents, options = {}) {
|
|
3255
|
-
if (!collection || !documents) throw new Error("Cannot update
|
|
3261
|
+
if (!collection || !documents) throw new Error("Cannot update, missing collection or document");
|
|
3262
|
+
if (Array.isArray(documents) && !documents.length) return Promise.resolve([]);
|
|
3256
3263
|
const { filter, append, ...queryOptions } = options;
|
|
3257
3264
|
const isArray = Array.isArray(documents);
|
|
3258
3265
|
const firstDoc = isArray ? documents[0] : documents;
|
|
3259
|
-
const pk = isArray ? null : filter
|
|
3260
|
-
const
|
|
3261
|
-
const url = this.dataUrl(collection, pk, q, queryOptions);
|
|
3266
|
+
const pk = (isArray ? null : filter && !Array.isArray(filter?._id) ? filter?._id : null) ?? firstDoc._id;
|
|
3267
|
+
const url = this.dataUrl(collection, pk);
|
|
3262
3268
|
return this.momentum.api.request({
|
|
3263
3269
|
url,
|
|
3264
3270
|
method: append === false ? "PUT" : "PATCH",
|
|
3265
|
-
body: documents
|
|
3271
|
+
body: { data: documents, filter: filter && filter?._id == null ? filter : null, ...queryOptions }
|
|
3266
3272
|
}).then((resp) => {
|
|
3267
3273
|
if (!resp) return null;
|
|
3268
3274
|
makeArray(resp).forEach((r) => this.emit(PES`data/${collection}/${r._id}:u`, r));
|
|
@@ -3278,7 +3284,7 @@ class Data extends PathEventEmitter {
|
|
|
3278
3284
|
raw(collection, query) {
|
|
3279
3285
|
if (!collection || !query) throw new Error("Cannot execute raw query, missing collection or query");
|
|
3280
3286
|
const mode = query.operand.startsWith("find") ? "r" : query.operand == "insertOne" ? "c" : query.operand.startsWith("delete") ? "d" : "u";
|
|
3281
|
-
return this.momentum.api.request({ url: `api/` + PES`data/${collection}
|
|
3287
|
+
return this.momentum.api.request({ url: `api/` + PES`data/${collection}`, method: "POST", body: { ...query, _raw: true } }).then((resp) => {
|
|
3282
3288
|
this.emit(PES`data/${collection}:${mode}`, resp);
|
|
3283
3289
|
return resp;
|
|
3284
3290
|
});
|
|
@@ -4055,7 +4061,7 @@ class Storage extends PathEventEmitter {
|
|
|
4055
4061
|
*/
|
|
4056
4062
|
all(path) {
|
|
4057
4063
|
if (!path) path = "/";
|
|
4058
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4064
|
+
return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}?all=true` }).then((resp) => {
|
|
4059
4065
|
this.emit(PES`${this.module}/${path}:r`, resp);
|
|
4060
4066
|
return resp;
|
|
4061
4067
|
});
|
|
@@ -4074,7 +4080,7 @@ class Storage extends PathEventEmitter {
|
|
|
4074
4080
|
destination = [...path.slice(0, -1), destination].join("/");
|
|
4075
4081
|
if (!destination.startsWith("/")) destination = "/" + destination;
|
|
4076
4082
|
}
|
|
4077
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4083
|
+
return this.momentum.api.request({ url: `api/${this.module}${destination.startsWith("/") ? "" : "/"}${destination}`, body: { from: source } }).then((response) => {
|
|
4078
4084
|
this.emit(PES`${this.module}/${destination}:c`, response);
|
|
4079
4085
|
return response;
|
|
4080
4086
|
});
|
|
@@ -4086,7 +4092,7 @@ class Storage extends PathEventEmitter {
|
|
|
4086
4092
|
*/
|
|
4087
4093
|
async delete(path) {
|
|
4088
4094
|
if (!path) throw new Error("Cannot delete file or folder, missing module");
|
|
4089
|
-
const count = await this.momentum.api.request({ url: `api/${this.module}
|
|
4095
|
+
const count = await this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}`, method: "DELETE" });
|
|
4090
4096
|
if (count) this.emit(PES`${this.module}/${path}:d`, path);
|
|
4091
4097
|
return count;
|
|
4092
4098
|
}
|
|
@@ -4106,7 +4112,7 @@ class Storage extends PathEventEmitter {
|
|
|
4106
4112
|
*/
|
|
4107
4113
|
meta(path) {
|
|
4108
4114
|
if (!path) path = "/";
|
|
4109
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4115
|
+
return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}?meta=true` }).then((resp) => {
|
|
4110
4116
|
this.emit(PES`${this.module}/${path}:r`, resp);
|
|
4111
4117
|
return resp;
|
|
4112
4118
|
});
|
|
@@ -4118,7 +4124,7 @@ class Storage extends PathEventEmitter {
|
|
|
4118
4124
|
*/
|
|
4119
4125
|
mkdir(path) {
|
|
4120
4126
|
if (!path) throw new Error("Cannot make directory, missing module");
|
|
4121
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4127
|
+
return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}`, body: { directory: true } }).then((resp) => {
|
|
4122
4128
|
this.emit(PES`${this.module}/${path}:c`, resp);
|
|
4123
4129
|
return resp;
|
|
4124
4130
|
});
|
|
@@ -4132,7 +4138,7 @@ class Storage extends PathEventEmitter {
|
|
|
4132
4138
|
move(source, destination) {
|
|
4133
4139
|
if (!source || !destination) throw new Error("Cannot move file or folder, missing source or destination");
|
|
4134
4140
|
if (source == destination) return this.meta(destination);
|
|
4135
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4141
|
+
return this.momentum.api.request({ url: `api/${this.module}${source.startsWith("/") ? "" : "/"}${source}`, method: "PUT", body: { move: destination } }).then((response) => {
|
|
4136
4142
|
this.emit(PES`${this.module}/${source}:u`, response);
|
|
4137
4143
|
return response;
|
|
4138
4144
|
});
|
|
@@ -4142,7 +4148,7 @@ class Storage extends PathEventEmitter {
|
|
|
4142
4148
|
const link = `${this.momentum.url.toString()}api/${this.module}/${path}`.replaceAll(/([^:])\/+/g, "$1/") + (!this.momentum.api.sameOrigin && this.momentum.api.token ? `?token=${this.momentum.api.token}` : "");
|
|
4143
4149
|
if (target === "url" || target === false) return link;
|
|
4144
4150
|
if (target === "_blank" || target == "_self") return window.open(link, target);
|
|
4145
|
-
return this.momentum.api.request({ url: `api/${this.module}
|
|
4151
|
+
return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}?download=true`, decode: false }).then(async (response) => {
|
|
4146
4152
|
const blob = await response.blob();
|
|
4147
4153
|
if (target !== "blob") {
|
|
4148
4154
|
const name = target === "download" ? path.split("/").pop() : target;
|
|
@@ -4153,7 +4159,7 @@ class Storage extends PathEventEmitter {
|
|
|
4153
4159
|
}
|
|
4154
4160
|
text(path, set) {
|
|
4155
4161
|
if (!path) throw new Error("Missing path");
|
|
4156
|
-
if (set !== void 0) return this.momentum.api.request({ url: `api/${this.module}
|
|
4162
|
+
if (set !== void 0) return this.momentum.api.request({ url: `api/${this.module}${path.startsWith("/") ? "" : "/"}${path}`, method: "PATCH", body: { text: set } });
|
|
4157
4163
|
else return this.momentum.api.request({ url: `api/${this.module}/${path}?text=true` });
|
|
4158
4164
|
}
|
|
4159
4165
|
/**
|
|
@@ -4173,7 +4179,7 @@ class Storage extends PathEventEmitter {
|
|
|
4173
4179
|
f = [new File([f[0]], opts.rename, { type: f[0].type })];
|
|
4174
4180
|
}
|
|
4175
4181
|
return uploadWithProgress({
|
|
4176
|
-
url: `${this.momentum.url.toString()}api/${this.module}
|
|
4182
|
+
url: `${this.momentum.url.toString()}api/${this.module}${path.startsWith("/") ? "" : "/"}${path}`,
|
|
4177
4183
|
headers: this.momentum.api.headers,
|
|
4178
4184
|
files: f
|
|
4179
4185
|
}).onProgress((p) => {
|
|
@@ -4328,7 +4334,7 @@ class Static extends Storage {
|
|
|
4328
4334
|
}
|
|
4329
4335
|
momentum;
|
|
4330
4336
|
}
|
|
4331
|
-
const version = "1.4.
|
|
4337
|
+
const version = "1.4.5";
|
|
4332
4338
|
class WebRtc extends PathEventEmitter {
|
|
4333
4339
|
constructor(momentum) {
|
|
4334
4340
|
super("webrtc");
|
package/dist/schemas.d.ts
CHANGED
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAC,KAAK,IAAI,EAAC,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG;IAC3B,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,mCAAmC;IACnC,IAAI,EAAE,OAA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IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAAG;QAAC,SAAS,EAAE,MAAM,CAAA;KAAC,CAAC,EAAE,CAAA;CAC9E,CAAA;AAED,qBAAa,OAAQ,SAAQ,mBAAmB,CAAC,MAAM,CAAC;IAC3C,SAAS,CAAC,QAAQ,EAAE,QAAQ;gBAAlB,QAAQ,EAAE,QAAQ;CAGxC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztimson/momentum",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "Client library for momentum",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Momentum"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"postbuild": "npm run build:docs && node -e \"const fs=require('fs');fs.cpSync('dist/index.mjs','../server/public/momentum.mjs');fs.cpSync('dist/index.js','../server/public/momentum.js');fs.cpSync('dist/momentum.worker.mjs','../server/public/momentum.worker.mjs')\""
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@ztimson/utils": "^0.
|
|
36
|
+
"@ztimson/utils": "^0.30.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.5.4",
|