@dnax/core 0.55.0 → 0.58.0

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.
@@ -160,17 +160,18 @@ class useRest {
160
160
  };
161
161
  }[]
162
162
  > => {
163
- params = {
164
- ...params,
165
- $match: {
166
- ...(params?.$match || {}),
167
- collection: collection,
168
- },
169
- };
170
- return await restActivity
171
- .list(this.#tenant, params || {})
172
- .then((e) => e)
173
- .catch((err) => []);
163
+ return new Promise(async (resolve, reject) => {
164
+ try {
165
+ params?.$match = {
166
+ ...(params?.$match || {}),
167
+ collection: collection,
168
+ };
169
+ let response = await this.find("_activity_", params);
170
+ resolve(response);
171
+ } catch (err) {
172
+ return reject(err);
173
+ }
174
+ });
174
175
  },
175
176
  };
176
177
 
@@ -458,7 +459,7 @@ class useRest {
458
459
  collection: collection,
459
460
  data: {
460
461
  data: data,
461
- id: data?._id,
462
+ _id: data?._id,
462
463
  },
463
464
  transaction: this.#session ? true : false,
464
465
  action: "insertOne",
@@ -602,7 +603,7 @@ class useRest {
602
603
  collection: collection,
603
604
  data: {
604
605
  data: toJson(data),
605
- ids: data?.map((e) => e?._id),
606
+ _ids: data?.map((e) => e?._id),
606
607
  },
607
608
  action: "insertMany",
608
609
  transaction: this.#session ? true : false,
@@ -1223,8 +1224,8 @@ class useRest {
1223
1224
  collection: collection,
1224
1225
  data: {
1225
1226
  update: update,
1226
- id: id,
1227
- ids: [id],
1227
+ _id: id,
1228
+ _ids: [id],
1228
1229
  },
1229
1230
  transaction: this.#session ? true : false,
1230
1231
  action: "updateOne",
@@ -1654,7 +1655,7 @@ class useRest {
1654
1655
  collection: collection,
1655
1656
  data: {
1656
1657
  update: update,
1657
- ids: ids,
1658
+ _ids: ids,
1658
1659
  },
1659
1660
  action: "updateMany",
1660
1661
  transaction: this.#session ? true : false,
@@ -1792,7 +1793,8 @@ class useRest {
1792
1793
  collection: collection,
1793
1794
  data: {
1794
1795
  data: doc,
1795
- id: id,
1796
+ _id: id,
1797
+ _ids: [id],
1796
1798
  },
1797
1799
  transaction: this.#session ? true : false,
1798
1800
  action: "deleteOne",
@@ -1929,8 +1931,8 @@ class useRest {
1929
1931
  restActivity.save(this.#tenant, {
1930
1932
  collection: collection,
1931
1933
  data: {
1932
- input: null,
1933
- ids: ids,
1934
+ data: null,
1935
+ _ids: ids,
1934
1936
  },
1935
1937
  transaction: this.#session ? true : false,
1936
1938
  action: "deleteMany",
@@ -2034,18 +2036,7 @@ const restActivity = {
2034
2036
  $sort?: {};
2035
2037
  $skip?: number;
2036
2038
  }
2037
- ) => {
2038
- return await tenant.database.db
2039
- ?.collection("_activity_")
2040
- .find({
2041
- ...filter?.$match,
2042
- })
2043
- .limit(filter?.$limit || 100)
2044
- .sort({ createdAt: -1, ...filter?.$sort })
2045
- .skip(filter?.$skip || 0)
2046
- .toArray()
2047
- .catch((err) => []);
2048
- },
2039
+ ) => {},
2049
2040
  save: async (
2050
2041
  tenant: Tenant,
2051
2042
  activity: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.55.0",
3
+ "version": "0.58.0",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {