@thisisagile/easy-mongo 8.42.3 → 8.44.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.
@@ -1,19 +1,19 @@
1
- import { Condition, Database, Field, Get, Json, LogicalCondition, MapOptions, Mapper, PropertyOptions, SortCondition, Text } from '@thisisagile/easy';
1
+ import { Condition, Database, Field, Get, Json, LogicalCondition, MapOptions, Mapper, Mapping, PropertyOptions, SortCondition, Text } from '@thisisagile/easy';
2
2
  import { MongoProvider } from './MongoProvider';
3
3
  export declare class Collection extends Mapper {
4
4
  protected readonly map: {
5
5
  field: <T = unknown>(name: string, options?: PropertyOptions<T> | undefined) => Field;
6
6
  item: (property: string, options?: PropertyOptions<unknown> | undefined) => import("@thisisagile/easy").Property<unknown>;
7
- ignore: (property?: string | undefined) => import("@thisisagile/easy").Mapping;
8
- skipIn: (property: string) => import("@thisisagile/easy").Mapping;
9
- skipOut: (property: string) => import("@thisisagile/easy").Mapping;
10
- func: (property: string, funcIn: Get<import("@thisisagile/easy").JsonValue | undefined, Json>, funcOut: Get<import("@thisisagile/easy").JsonValue | undefined, Json>) => import("@thisisagile/easy").Mapping;
11
- add: (funcIn: Get<import("@thisisagile/easy").JsonValue, Json>) => import("@thisisagile/easy").Mapping;
12
- map: (mapper: import("@thisisagile/easy").Construct<Mapper>, property?: string | undefined) => import("@thisisagile/easy").Mapping;
13
- propsToList: (...maps: import("@thisisagile/easy").Mapping[]) => import("@thisisagile/easy").Mapping;
14
- list: (mapper: import("@thisisagile/easy").Mapping, property: string) => import("@thisisagile/easy").Mapping;
7
+ ignore: (property?: string | undefined) => Mapping;
8
+ skipIn: (property: string) => Mapping;
9
+ skipOut: (property: string) => Mapping;
10
+ func: (property: string, funcIn: Get<import("@thisisagile/easy").JsonValue | undefined, Json>, funcOut: Get<import("@thisisagile/easy").JsonValue | undefined, Json>) => Mapping;
11
+ add: (funcIn: Get<import("@thisisagile/easy").JsonValue, Json>) => Mapping;
12
+ map: (mapper: import("@thisisagile/easy").Construct<Mapper>, property?: string | undefined) => Mapping;
13
+ propsToList: (...maps: Mapping[]) => Mapping;
14
+ list: (mapper: Mapping, property: string) => Mapping;
15
15
  };
16
- readonly id: Field;
16
+ readonly id: Mapping;
17
17
  constructor(options?: MapOptions);
18
18
  get db(): Database;
19
19
  get provider(): MongoProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"Collection.js","sourceRoot":"","sources":["../src/Collection.ts"],"names":[],"mappings":";;;AAAA,4CAiB2B;AAC3B,mCAAsC;AACtC,mDAAgD;AAEhD,MAAa,UAAW,SAAQ,aAAM;IAOpC,YAAY,UAAsB,EAAE,SAAS,EAAE,QAAQ,EAAE;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QAPE,QAAG,GAAG;YACvB,GAAG,eAAQ;YACX,KAAK,EAAE,CAAc,IAAY,EAAE,OAA4B,EAAS,EAAE,CAAC,IAAI,YAAK,CAAC,IAAI,EAAE,OAAO,CAAC;SACpG,CAAC;QACO,OAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,aAAM,EAAE,CAAC,CAAC;QAcrD,UAAK,GAAG,CAAC,GAAG,UAAkC,EAAQ,EAAE,CACtD,IAAI,uBAAgB,CAClB,KAAK,EACL,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,YAAK,EAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CACpC,CAAC,MAAM,EAAE,CAAC;QAEb,UAAK,GAAG,CAAC,SAAkD,EAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAA,YAAK,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAEpH,UAAK,GAAG,CAAC,GAAG,UAAkC,EAAQ,EAAE,CACtD,IAAI,uBAAgB,CAClB,OAAO,EACP,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,C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IAAI,EAAE;QACJ,OAAO,eAAQ,CAAC,OAAO,CAAC;IAC1B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,6BAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IA0BD,GAAG,CAAC,KAAW,EAAE;QACf,OAAO,IAAA,mBAAW,EAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;CACF;AA9CD,gCA8CC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisisagile/easy-mongo",
3
- "version": "8.42.3",
3
+ "version": "8.44.0",
4
4
  "description": "Add support for MongoDB",
5
5
  "author": "Sander Hoogendoorn",
6
6
  "license": "MIT",
@@ -31,10 +31,10 @@
31
31
  "access": "public"
32
32
  },
33
33
  "devDependencies": {
34
- "@thisisagile/easy-test": "8.42.3"
34
+ "@thisisagile/easy-test": "8.44.0"
35
35
  },
36
36
  "dependencies": {
37
- "@thisisagile/easy": "8.42.3",
37
+ "@thisisagile/easy": "8.44.0",
38
38
  "@types/mongodb": "^3.6.20",
39
39
  "mongodb": "^3.7.3"
40
40
  }
package/src/Collection.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  LogicalCondition,
9
9
  MapOptions,
10
10
  Mapper,
11
+ Mapping,
11
12
  mappings,
12
13
  ofGet,
13
14
  PropertyOptions,
@@ -24,7 +25,7 @@ export class Collection extends Mapper {
24
25
  ...mappings,
25
26
  field: <T = unknown>(name: string, options?: PropertyOptions<T>): Field => new Field(name, options),
26
27
  };
27
- readonly id = this.map.field('id', { dflt: toUuid });
28
+ readonly id = this.map.field('id', { dflt: toUuid }) as Mapping;
28
29
 
29
30
  constructor(options: MapOptions = { startFrom: 'source' }) {
30
31
  super(options);