@atscript/moost-mongo 0.1.0 → 0.1.2

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 CHANGED
@@ -29,31 +29,56 @@ const __atscript_typescript_utils = __toESM(require("@atscript/typescript/utils"
29
29
  const __atscript_mongo = __toESM(require("@atscript/mongo"));
30
30
 
31
31
  //#region packages/moost-mongo/src/dto/controls.dto.as.js
32
+ function _define_property$1(obj, key, value) {
33
+ if (key in obj) Object.defineProperty(obj, key, {
34
+ value,
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true
38
+ });
39
+ else obj[key] = value;
40
+ return obj;
41
+ }
32
42
  var QueryControlsDto = class {
33
43
  static toJsonSchema() {
34
44
  return this._jsonSchema ?? (this._jsonSchema = (0, __atscript_typescript_utils.buildJsonSchema)(this));
35
45
  }
36
46
  };
47
+ _define_property$1(QueryControlsDto, "__is_atscript_annotated_type", true);
48
+ _define_property$1(QueryControlsDto, "type", {});
49
+ _define_property$1(QueryControlsDto, "metadata", new Map());
37
50
  var PagesControlsDto = class {
38
51
  static toJsonSchema() {
39
52
  return this._jsonSchema ?? (this._jsonSchema = (0, __atscript_typescript_utils.buildJsonSchema)(this));
40
53
  }
41
54
  };
55
+ _define_property$1(PagesControlsDto, "__is_atscript_annotated_type", true);
56
+ _define_property$1(PagesControlsDto, "type", {});
57
+ _define_property$1(PagesControlsDto, "metadata", new Map());
42
58
  var GetOneControlsDto = class {
43
59
  static toJsonSchema() {
44
60
  return this._jsonSchema ?? (this._jsonSchema = (0, __atscript_typescript_utils.buildJsonSchema)(this));
45
61
  }
46
62
  };
63
+ _define_property$1(GetOneControlsDto, "__is_atscript_annotated_type", true);
64
+ _define_property$1(GetOneControlsDto, "type", {});
65
+ _define_property$1(GetOneControlsDto, "metadata", new Map());
47
66
  let SortControlDto = class SortControlDto$1 {
48
67
  static toJsonSchema() {
49
68
  return this._jsonSchema ?? (this._jsonSchema = (0, __atscript_typescript_utils.buildJsonSchema)(this));
50
69
  }
51
70
  };
71
+ _define_property$1(SortControlDto, "__is_atscript_annotated_type", true);
72
+ _define_property$1(SortControlDto, "type", {});
73
+ _define_property$1(SortControlDto, "metadata", new Map());
52
74
  let SelectControlDto = class SelectControlDto$1 {
53
75
  static toJsonSchema() {
54
76
  return this._jsonSchema ?? (this._jsonSchema = (0, __atscript_typescript_utils.buildJsonSchema)(this));
55
77
  }
56
78
  };
79
+ _define_property$1(SelectControlDto, "__is_atscript_annotated_type", true);
80
+ _define_property$1(SelectControlDto, "type", {});
81
+ _define_property$1(SelectControlDto, "metadata", new Map());
57
82
  (0, __atscript_typescript_utils.defineAnnotatedType)("object", QueryControlsDto).prop("$skip", (0, __atscript_typescript_utils.defineAnnotatedType)().designType("number").tags("positive", "int", "number").annotate("expect.min", 0).annotate("expect.int", true).optional().$type).prop("$limit", (0, __atscript_typescript_utils.defineAnnotatedType)().designType("number").tags("positive", "int", "number").annotate("expect.min", 0).annotate("expect.int", true).optional().$type).prop("$count", (0, __atscript_typescript_utils.defineAnnotatedType)().designType("boolean").tags("boolean").optional().$type).prop("$sort", (0, __atscript_typescript_utils.defineAnnotatedType)().refTo(SortControlDto).optional().$type).prop("$select", (0, __atscript_typescript_utils.defineAnnotatedType)().refTo(SelectControlDto).optional().$type).prop("$search", (0, __atscript_typescript_utils.defineAnnotatedType)().designType("string").tags("string").optional().$type).prop("$index", (0, __atscript_typescript_utils.defineAnnotatedType)().designType("string").tags("string").optional().$type);
58
83
  (0, __atscript_typescript_utils.defineAnnotatedType)("object", PagesControlsDto).prop("$page", (0, __atscript_typescript_utils.defineAnnotatedType)().designType("string").tags("string").annotate("expect.pattern", {
59
84
  pattern: "^\\d+$",
package/dist/index.d.ts CHANGED
@@ -57,11 +57,11 @@ declare class AsMongoController<T extends TAtscriptAnnotatedTypeConstructor> {
57
57
  private _pagesControlsValidator?;
58
58
  private _getOneControlsValidator?;
59
59
  /** Returns (and memoises) validator for *query* endpoint controls. */
60
- protected get queryControlsValidator(): Validator<any> | undefined;
60
+ protected get queryControlsValidator(): Validator<any, any> | undefined;
61
61
  /** Returns (and memoises) validator for *pages* endpoint controls. */
62
- protected get pagesControlsValidator(): Validator<any> | undefined;
62
+ protected get pagesControlsValidator(): Validator<any, any> | undefined;
63
63
  /** Returns (and memoises) validator for *one* endpoint controls. */
64
- protected get getOneControlsValidator(): Validator<any> | undefined;
64
+ protected get getOneControlsValidator(): Validator<any, any> | undefined;
65
65
  /**
66
66
  * Validates `$limit`, `$skip`, `$sort`, `$select`, `$count` controls for the
67
67
  * **query** endpoint.
package/dist/index.mjs CHANGED
@@ -5,31 +5,56 @@ import { ValidatorError, buildJsonSchema, defineAnnotatedType } from "@atscript/
5
5
  import { AsMongo } from "@atscript/mongo";
6
6
 
7
7
  //#region packages/moost-mongo/src/dto/controls.dto.as.js
8
+ function _define_property$1(obj, key, value) {
9
+ if (key in obj) Object.defineProperty(obj, key, {
10
+ value,
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true
14
+ });
15
+ else obj[key] = value;
16
+ return obj;
17
+ }
8
18
  var QueryControlsDto = class {
9
19
  static toJsonSchema() {
10
20
  return this._jsonSchema ?? (this._jsonSchema = buildJsonSchema(this));
11
21
  }
12
22
  };
23
+ _define_property$1(QueryControlsDto, "__is_atscript_annotated_type", true);
24
+ _define_property$1(QueryControlsDto, "type", {});
25
+ _define_property$1(QueryControlsDto, "metadata", new Map());
13
26
  var PagesControlsDto = class {
14
27
  static toJsonSchema() {
15
28
  return this._jsonSchema ?? (this._jsonSchema = buildJsonSchema(this));
16
29
  }
17
30
  };
31
+ _define_property$1(PagesControlsDto, "__is_atscript_annotated_type", true);
32
+ _define_property$1(PagesControlsDto, "type", {});
33
+ _define_property$1(PagesControlsDto, "metadata", new Map());
18
34
  var GetOneControlsDto = class {
19
35
  static toJsonSchema() {
20
36
  return this._jsonSchema ?? (this._jsonSchema = buildJsonSchema(this));
21
37
  }
22
38
  };
39
+ _define_property$1(GetOneControlsDto, "__is_atscript_annotated_type", true);
40
+ _define_property$1(GetOneControlsDto, "type", {});
41
+ _define_property$1(GetOneControlsDto, "metadata", new Map());
23
42
  let SortControlDto = class SortControlDto$1 {
24
43
  static toJsonSchema() {
25
44
  return this._jsonSchema ?? (this._jsonSchema = buildJsonSchema(this));
26
45
  }
27
46
  };
47
+ _define_property$1(SortControlDto, "__is_atscript_annotated_type", true);
48
+ _define_property$1(SortControlDto, "type", {});
49
+ _define_property$1(SortControlDto, "metadata", new Map());
28
50
  let SelectControlDto = class SelectControlDto$1 {
29
51
  static toJsonSchema() {
30
52
  return this._jsonSchema ?? (this._jsonSchema = buildJsonSchema(this));
31
53
  }
32
54
  };
55
+ _define_property$1(SelectControlDto, "__is_atscript_annotated_type", true);
56
+ _define_property$1(SelectControlDto, "type", {});
57
+ _define_property$1(SelectControlDto, "metadata", new Map());
33
58
  defineAnnotatedType("object", QueryControlsDto).prop("$skip", defineAnnotatedType().designType("number").tags("positive", "int", "number").annotate("expect.min", 0).annotate("expect.int", true).optional().$type).prop("$limit", defineAnnotatedType().designType("number").tags("positive", "int", "number").annotate("expect.min", 0).annotate("expect.int", true).optional().$type).prop("$count", defineAnnotatedType().designType("boolean").tags("boolean").optional().$type).prop("$sort", defineAnnotatedType().refTo(SortControlDto).optional().$type).prop("$select", defineAnnotatedType().refTo(SelectControlDto).optional().$type).prop("$search", defineAnnotatedType().designType("string").tags("string").optional().$type).prop("$index", defineAnnotatedType().designType("string").tags("string").optional().$type);
34
59
  defineAnnotatedType("object", PagesControlsDto).prop("$page", defineAnnotatedType().designType("string").tags("string").annotate("expect.pattern", {
35
60
  pattern: "^\\d+$",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/moost-mongo",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Atscript Mongo for Moost.",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -39,14 +39,14 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "vitest": "3.2.4",
42
- "@atscript/core": "^0.1.0"
42
+ "@atscript/core": "^0.1.2"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@moostjs/event-http": "^0.5.32",
46
46
  "mongodb": "^6.17.0",
47
47
  "moost": "^0.5.32",
48
- "@atscript/mongo": "^0.1.0",
49
- "@atscript/typescript": "^0.1.0"
48
+ "@atscript/mongo": "^0.1.2",
49
+ "@atscript/typescript": "^0.1.2"
50
50
  },
51
51
  "scripts": {
52
52
  "pub": "pnpm publish --access public",