@dyrected/sdk 2.4.2 → 2.4.4
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.cjs +5 -5
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
generateFreshSetupPrompt: () => generateFreshSetupPrompt
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(index_exports);
|
|
40
|
-
var
|
|
40
|
+
var qs = __toESM(require("qs"), 1);
|
|
41
41
|
|
|
42
42
|
// src/query-builder.ts
|
|
43
43
|
var QueryBuilder = class {
|
|
@@ -953,7 +953,7 @@ var DyrectedClient = class {
|
|
|
953
953
|
if (normalizedArgs.where && typeof normalizedArgs.where === "object") {
|
|
954
954
|
normalizedArgs.where = JSON.stringify(normalizedArgs.where);
|
|
955
955
|
}
|
|
956
|
-
const query =
|
|
956
|
+
const query = qs.stringify(normalizedArgs, { addQueryPrefix: true });
|
|
957
957
|
const res = await this.request(`/api/collections/${collection}${query}`);
|
|
958
958
|
if (res.docs.length === 0 && initialData && initialData.length > 0) {
|
|
959
959
|
this.request(`/api/collections/${collection}/seed`, {
|
|
@@ -1047,7 +1047,7 @@ var DyrectedClient = class {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
async findOne(collection, id, args = {}) {
|
|
1049
1049
|
const { initialData, ...queryArgs } = args;
|
|
1050
|
-
const query =
|
|
1050
|
+
const query = qs.stringify(queryArgs, { addQueryPrefix: true });
|
|
1051
1051
|
try {
|
|
1052
1052
|
return await this.request(`/api/collections/${collection}/${id}${query}`);
|
|
1053
1053
|
} catch (err) {
|
|
@@ -1083,12 +1083,12 @@ var DyrectedClient = class {
|
|
|
1083
1083
|
async deleteMany(collection, ids) {
|
|
1084
1084
|
return this.request(`/api/collections/${collection}/delete-many`, {
|
|
1085
1085
|
method: "DELETE",
|
|
1086
|
-
body:
|
|
1086
|
+
body: qs.stringify({ ids })
|
|
1087
1087
|
});
|
|
1088
1088
|
}
|
|
1089
1089
|
async getGlobal(slug, args = {}) {
|
|
1090
1090
|
const { initialData, ...queryArgs } = args;
|
|
1091
|
-
const query =
|
|
1091
|
+
const query = qs.stringify(queryArgs, { addQueryPrefix: true });
|
|
1092
1092
|
try {
|
|
1093
1093
|
const res = await this.request(`/api/globals/${slug}${query}`);
|
|
1094
1094
|
if ((!res || Object.keys(res).length === 0) && initialData) {
|
package/dist/index.js
CHANGED