@vsaas/loopback-datasource-juggler 13.0.3 → 13.1.1

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.
Files changed (57) hide show
  1. package/LICENSE +0 -0
  2. package/NOTICE +0 -0
  3. package/dist/_virtual/_rolldown/runtime.js +2 -3
  4. package/dist/index.js +7 -6
  5. package/dist/lib/browser.depd.js +1 -2
  6. package/dist/lib/case-utils.js +1 -2
  7. package/dist/lib/connectors/kv-memory.js +1 -2
  8. package/dist/lib/connectors/memory.js +1 -2
  9. package/dist/lib/connectors/transient.js +1 -2
  10. package/dist/lib/dao.js +23 -13
  11. package/dist/lib/datasource.js +9 -10
  12. package/dist/lib/date-string.js +1 -2
  13. package/dist/lib/geo.js +1 -2
  14. package/dist/lib/globalize.js +1 -2
  15. package/dist/lib/hooks.js +1 -2
  16. package/dist/lib/id-utils.js +1 -2
  17. package/dist/lib/include.js +1 -2
  18. package/dist/lib/include_utils.js +1 -2
  19. package/dist/lib/introspection.js +1 -2
  20. package/dist/lib/jutil.js +1 -2
  21. package/dist/lib/kvao/delete-all.js +1 -2
  22. package/dist/lib/kvao/delete.js +1 -2
  23. package/dist/lib/kvao/expire.js +1 -2
  24. package/dist/lib/kvao/get.js +1 -2
  25. package/dist/lib/kvao/index.js +1 -2
  26. package/dist/lib/kvao/iterate-keys.js +1 -2
  27. package/dist/lib/kvao/keys.js +1 -2
  28. package/dist/lib/kvao/set.js +1 -2
  29. package/dist/lib/kvao/ttl.js +1 -2
  30. package/dist/lib/list.js +1 -2
  31. package/dist/lib/mixins.js +1 -2
  32. package/dist/lib/model-builder.js +19 -7
  33. package/dist/lib/model-definition.js +2 -3
  34. package/dist/lib/model-internals.js +1 -2
  35. package/dist/lib/model-utils.js +13 -3
  36. package/dist/lib/model.js +2 -3
  37. package/dist/lib/normalizers.js +190 -0
  38. package/dist/lib/observer.js +1 -2
  39. package/dist/lib/property-constraints.js +166 -0
  40. package/dist/lib/relation-definition.js +4 -5
  41. package/dist/lib/relations.js +1 -2
  42. package/dist/lib/scope.js +1 -2
  43. package/dist/lib/transaction.js +3 -4
  44. package/dist/lib/types.js +1 -2
  45. package/dist/lib/utils.js +4 -5
  46. package/dist/lib/validations.js +35 -2
  47. package/dist/package.js +3 -4
  48. package/package.json +11 -11
  49. package/types/inclusion-mixin.d.ts +0 -0
  50. package/types/kv-model.d.ts +0 -0
  51. package/types/model.d.ts +64 -0
  52. package/types/query.d.ts +0 -0
  53. package/types/relation-mixin.d.ts +0 -0
  54. package/types/relation.d.ts +0 -0
  55. package/types/scope.d.ts +0 -0
  56. package/types/transaction-mixin.d.ts +0 -0
  57. package/types/validation-mixin.d.ts +0 -0
package/dist/package.js CHANGED
@@ -1,8 +1,8 @@
1
- //#region package.json
1
+ // package.json
2
2
  var require_package = /* @__PURE__ */ require("./_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
3
3
  module.exports = {
4
4
  "name": "@vsaas/loopback-datasource-juggler",
5
- "version": "13.0.3",
5
+ "version": "13.1.1",
6
6
  "description": "Fork of loopback-datasource-juggler for LoopBack 3 style applications",
7
7
  "keywords": [
8
8
  "Connector",
@@ -67,7 +67,7 @@ var require_package = /* @__PURE__ */ require("./_virtual/_rolldown/runtime.js")
67
67
  "debug": "catalog:",
68
68
  "depd": "^2.0.0",
69
69
  "inflection": "^3.0.2",
70
- "minimatch": "^10.2.6",
70
+ "minimatch": "^11.0.3",
71
71
  "neotraverse": "^0.6.18",
72
72
  "qs": "catalog:"
73
73
  },
@@ -85,7 +85,6 @@ var require_package = /* @__PURE__ */ require("./_virtual/_rolldown/runtime.js")
85
85
  "engines": { "node": ">=24" }
86
86
  };
87
87
  }));
88
- //#endregion
89
88
  Object.defineProperty(exports, "default", {
90
89
  enumerable: true,
91
90
  get: function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vsaas/loopback-datasource-juggler",
3
- "version": "13.0.3",
3
+ "version": "13.1.1",
4
4
  "description": "Fork of loopback-datasource-juggler for LoopBack 3 style applications",
5
5
  "keywords": [
6
6
  "Connector",
@@ -52,24 +52,24 @@
52
52
  "registry": "https://registry.npmjs.org/"
53
53
  },
54
54
  "dependencies": {
55
+ "@vsaas/loopback-connector": "^12.0.2",
55
56
  "debug": "4.4.3",
56
57
  "depd": "^2.0.0",
57
58
  "inflection": "^3.0.2",
58
- "minimatch": "^10.2.6",
59
+ "minimatch": "^11.0.3",
59
60
  "neotraverse": "^0.6.18",
60
- "qs": "^6.16.0",
61
- "@vsaas/loopback-connector": "^12.0.1"
61
+ "qs": "^6.16.2"
62
62
  },
63
63
  "devDependencies": {
64
- "@types/node": "25.5.0",
64
+ "@types/node": "25.9.9",
65
65
  "bson": "^4.7.2",
66
- "oxfmt": "0.64.0",
67
- "oxlint": "1.79.0",
66
+ "loopback-connector-throwing": "1.0.0",
67
+ "oxfmt": "0.75.0",
68
+ "oxlint": "1.90.0",
68
69
  "should": "13.2.3",
69
- "tsdown": "0.22.14",
70
- "typescript": "6.0.2",
71
- "vitest": "4.1.11",
72
- "loopback-connector-throwing": "1.0.0"
70
+ "tsdown": "0.23.4",
71
+ "typescript": "6.0.3",
72
+ "vitest": "5.0.5"
73
73
  },
74
74
  "engines": {
75
75
  "node": ">=24"
File without changes
File without changes
package/types/model.d.ts CHANGED
@@ -13,12 +13,76 @@ import { Listener, OperationHookContext, SyncListener } from './observer-mixin';
13
13
  */
14
14
  export type PropertyType = string | Function | { [property: string]: PropertyType };
15
15
 
16
+ /**
17
+ * Built-in property normalizers
18
+ */
19
+ export type BuiltinNormalizer =
20
+ | 'trim'
21
+ | 'lowercase'
22
+ | 'uppercase'
23
+ | 'nfc'
24
+ | 'unaccent'
25
+ | 'collapseSpaces'
26
+ | 'emptyToNull'
27
+ | 'stripInvisible'
28
+ | 'numeric'
29
+ | 'alphanumeric'
30
+ | 'stripHtml';
31
+
32
+ /**
33
+ * A normalizer step. Returning null or undefined stops the pipeline and stores
34
+ * that value.
35
+ */
36
+ export type NormalizerFunction = (value: string) => string | null | undefined;
37
+
38
+ /**
39
+ * A built-in or registered normalizer name, or an inline normalizer
40
+ */
41
+ export type PropertyNormalizer = BuiltinNormalizer | (string & {}) | NormalizerFunction;
42
+
43
+ /**
44
+ * Register a named normalizer usable from property definitions.
45
+ * Register it before defining the models that reference it.
46
+ */
47
+ export declare function registerNormalizer(name: string, fn: NormalizerFunction): void;
48
+
16
49
  /**
17
50
  * Property definition
18
51
  */
19
52
  export interface PropertyDefinition extends AnyObject {
20
53
  type?: PropertyType;
21
54
  id?: boolean | number;
55
+ /**
56
+ * Normalize string values, in order, when they are assigned and when they
57
+ * are compared for equality in `where` filters. Only for string and string
58
+ * array properties.
59
+ */
60
+ normalize?: PropertyNormalizer | PropertyNormalizer[] | false | null;
61
+ /** Minimum length in Unicode characters; string properties */
62
+ minLength?: number;
63
+ /** Maximum length in Unicode characters; string properties */
64
+ maxLength?: number;
65
+ /** Regular expression the value must match; string properties */
66
+ pattern?: string | RegExp;
67
+ /**
68
+ * `email`, `uri` and `uuid` are validated on string properties; other
69
+ * formats are documentation only
70
+ */
71
+ format?: string;
72
+ /** Inclusive lower bound; number properties */
73
+ minimum?: number;
74
+ /** Alias of `minimum` */
75
+ min?: number;
76
+ /** Inclusive upper bound; number properties */
77
+ maximum?: number;
78
+ /** Alias of `maximum` */
79
+ max?: number;
80
+ /** Allowed values; string, number and boolean properties */
81
+ enum?: Array<string | number | boolean>;
82
+ /** Minimum number of items; array properties */
83
+ minItems?: number;
84
+ /** Maximum number of items; array properties */
85
+ maxItems?: number;
22
86
  }
23
87
 
24
88
  /**
package/types/query.d.ts CHANGED
File without changes
File without changes
File without changes
package/types/scope.d.ts CHANGED
File without changes
File without changes
File without changes