@anteros/core 0.0.2 → 0.0.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/server/config.ts CHANGED
@@ -53,7 +53,7 @@ function safePublicConfig() {
53
53
  actions: [
54
54
  'insertOne', 'insertMany', 'updateOne', 'updateMany',
55
55
  'deleteOne', 'deleteMany', 'findOne', 'find',
56
- 'findOneAndUpdate', 'aggregate',
56
+ 'aggregate',
57
57
  ...Object.keys(c.actions ?? {}),
58
58
  ],
59
59
  fields: (c.fields ?? []).map(f => ({
package/tests/api.test.ts CHANGED
@@ -116,14 +116,6 @@ describe("updateMany", () => {
116
116
  });
117
117
  });
118
118
 
119
- describe("findOneAndUpdate", () => {
120
- it("finds and updates atomically", async () => {
121
- await rest.insertOne("items", { title: "fau", count: 0 });
122
- const doc = await rest.findOneAndUpdate("items", { title: "fau" }, { $set: { count: 10 } });
123
- expect(doc.count).toBe(10);
124
- });
125
- });
126
-
127
119
  describe("deleteMany", () => {
128
120
  it("deletes multiple by ids", async () => {
129
121
  const a = await rest.insertOne("items", { title: "d1" });
package/types/api.d.ts CHANGED
@@ -17,7 +17,6 @@ export declare enum ApiActions {
17
17
  }
18
18
 
19
19
  export type ActionsApiList =
20
- | "findOneAndUpdate"
21
20
  | "insertOne"
22
21
  | "insertMany"
23
22
  | "updateOne"
@@ -28,20 +28,17 @@ export type Collection = {
28
28
  payload: any;
29
29
  error: typeof fn.error;
30
30
  jwt: typeof jwt;
31
- req: {
32
- cookies: {
33
- set: (name: string, value: string, options?: {
34
- httpOnly?: boolean;
35
- secure?: boolean;
36
- maxAge?: number;
37
- path?: string;
38
- domain?: string;
39
- sameSite?: 'lax' | 'strict' | 'none';
40
- }) => any;
41
- get: (name: string) => string | undefined;
42
- delete: (name: string) => void;
43
- }
44
-
31
+ cookies: {
32
+ set: (name: string, value: string, options?: {
33
+ httpOnly?: boolean;
34
+ secure?: boolean;
35
+ maxAge?: number;
36
+ path?: string;
37
+ domain?: string;
38
+ sameSite?: 'lax' | 'strict' | 'none';
39
+ }) => any;
40
+ get: (name: string) => string | undefined;
41
+ delete: (name: string) => void;
45
42
  }
46
43
  }) => Promise<{
47
44
  token: string;
@@ -52,10 +49,8 @@ export type Collection = {
52
49
  payload: any;
53
50
  error: typeof fn.error;
54
51
  jwt: typeof jwt;
55
- req: {
56
- cookies: {
57
- delete: (name: string) => void;
58
- }
52
+ cookies: {
53
+ delete: (name: string) => void;
59
54
  }
60
55
  }) => Promise<void>;
61
56
  };