@loopback/repository 4.0.0-alpha.9 → 4.0.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.
- package/LICENSE +25 -0
- package/README.md +93 -389
- package/dist/common-types.d.ts +96 -0
- package/dist/common-types.js +24 -0
- package/dist/common-types.js.map +1 -0
- package/dist/connectors/connector.d.ts +48 -0
- package/{lib → dist/connectors}/connector.js +1 -1
- package/dist/connectors/connector.js.map +1 -0
- package/{lib/crud-connector.d.ts → dist/connectors/crud.connector.d.ts} +51 -51
- package/{lib/common-types.js → dist/connectors/crud.connector.js} +2 -2
- package/dist/connectors/crud.connector.js.map +1 -0
- package/dist/connectors/index.d.ts +3 -0
- package/dist/connectors/index.js +11 -0
- package/dist/connectors/index.js.map +1 -0
- package/{lib6/kv-connector.d.ts → dist/connectors/kv.connector.d.ts} +28 -28
- package/{lib/datasource.js → dist/connectors/kv.connector.js} +2 -2
- package/dist/connectors/kv.connector.js.map +1 -0
- package/dist/datasource.d.ts +27 -0
- package/{lib6 → dist}/datasource.js +1 -1
- package/dist/datasource.js.map +1 -0
- package/dist/decorators/index.d.ts +3 -0
- package/dist/decorators/index.js +11 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/metadata.d.ts +12 -0
- package/dist/decorators/metadata.js +51 -0
- package/dist/decorators/metadata.js.map +1 -0
- package/dist/decorators/model.decorator.d.ts +40 -0
- package/dist/decorators/model.decorator.js +112 -0
- package/dist/decorators/model.decorator.js.map +1 -0
- package/dist/decorators/repository.decorator.d.ts +106 -0
- package/dist/decorators/repository.decorator.js +114 -0
- package/dist/decorators/repository.decorator.js.map +1 -0
- package/dist/define-model-class.d.ts +55 -0
- package/dist/define-model-class.js +57 -0
- package/dist/define-model-class.js.map +1 -0
- package/dist/define-repository-class.d.ts +119 -0
- package/dist/define-repository-class.js +98 -0
- package/dist/define-repository-class.js.map +1 -0
- package/dist/errors/entity-not-found.error.d.ts +8 -0
- package/dist/errors/entity-not-found.error.js +28 -0
- package/dist/errors/entity-not-found.error.js.map +1 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +10 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/invalid-relation.error.d.ts +10 -0
- package/dist/errors/invalid-relation.error.js +28 -0
- package/dist/errors/invalid-relation.error.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/keys.d.ts +34 -0
- package/dist/keys.js +44 -0
- package/dist/keys.js.map +1 -0
- package/dist/mixins/index.d.ts +1 -0
- package/dist/mixins/index.js +9 -0
- package/dist/mixins/index.js.map +1 -0
- package/dist/mixins/repository.mixin.d.ts +377 -0
- package/dist/mixins/repository.mixin.js +405 -0
- package/dist/mixins/repository.mixin.js.map +1 -0
- package/dist/model.d.ts +232 -0
- package/dist/model.js +367 -0
- package/dist/model.js.map +1 -0
- package/dist/relations/belongs-to/belongs-to.accessor.d.ts +17 -0
- package/dist/relations/belongs-to/belongs-to.accessor.js +40 -0
- package/dist/relations/belongs-to/belongs-to.accessor.js.map +1 -0
- package/dist/relations/belongs-to/belongs-to.decorator.d.ts +11 -0
- package/dist/relations/belongs-to/belongs-to.decorator.js +64 -0
- package/dist/relations/belongs-to/belongs-to.decorator.js.map +1 -0
- package/dist/relations/belongs-to/belongs-to.helpers.d.ts +17 -0
- package/dist/relations/belongs-to/belongs-to.helpers.js +63 -0
- package/dist/relations/belongs-to/belongs-to.helpers.js.map +1 -0
- package/dist/relations/belongs-to/belongs-to.inclusion-resolver.d.ts +14 -0
- package/dist/relations/belongs-to/belongs-to.inclusion-resolver.js +36 -0
- package/dist/relations/belongs-to/belongs-to.inclusion-resolver.js.map +1 -0
- package/dist/relations/belongs-to/belongs-to.repository.d.ts +28 -0
- package/dist/relations/belongs-to/belongs-to.repository.js +33 -0
- package/dist/relations/belongs-to/belongs-to.repository.js.map +1 -0
- package/dist/relations/belongs-to/index.d.ts +4 -0
- package/dist/relations/belongs-to/index.js +12 -0
- package/dist/relations/belongs-to/index.js.map +1 -0
- package/dist/relations/has-many/has-many-through.helpers.d.ts +182 -0
- package/dist/relations/has-many/has-many-through.helpers.js +282 -0
- package/dist/relations/has-many/has-many-through.helpers.js.map +1 -0
- package/dist/relations/has-many/has-many-through.inclusion-resolver.d.ts +16 -0
- package/dist/relations/has-many/has-many-through.inclusion-resolver.js +78 -0
- package/dist/relations/has-many/has-many-through.inclusion-resolver.js.map +1 -0
- package/dist/relations/has-many/has-many-through.repository-factory.d.ts +17 -0
- package/dist/relations/has-many/has-many-through.repository-factory.js +37 -0
- package/dist/relations/has-many/has-many-through.repository-factory.js.map +1 -0
- package/dist/relations/has-many/has-many-through.repository.d.ts +114 -0
- package/dist/relations/has-many/has-many-through.repository.js +103 -0
- package/dist/relations/has-many/has-many-through.repository.js.map +1 -0
- package/dist/relations/has-many/has-many.decorator.d.ts +11 -0
- package/dist/relations/has-many/has-many.decorator.js +36 -0
- package/dist/relations/has-many/has-many.decorator.js.map +1 -0
- package/dist/relations/has-many/has-many.helpers.d.ts +26 -0
- package/dist/relations/has-many/has-many.helpers.js +78 -0
- package/dist/relations/has-many/has-many.helpers.js.map +1 -0
- package/dist/relations/has-many/has-many.inclusion-resolver.d.ts +14 -0
- package/dist/relations/has-many/has-many.inclusion-resolver.js +45 -0
- package/dist/relations/has-many/has-many.inclusion-resolver.js.map +1 -0
- package/dist/relations/has-many/has-many.repository-factory.d.ts +28 -0
- package/dist/relations/has-many/has-many.repository-factory.js +39 -0
- package/dist/relations/has-many/has-many.repository-factory.js.map +1 -0
- package/dist/relations/has-many/has-many.repository.d.ts +54 -0
- package/dist/relations/has-many/has-many.repository.js +38 -0
- package/dist/relations/has-many/has-many.repository.js.map +1 -0
- package/dist/relations/has-many/index.d.ts +6 -0
- package/dist/relations/has-many/index.js +14 -0
- package/dist/relations/has-many/index.js.map +1 -0
- package/dist/relations/has-one/has-one.decorator.d.ts +3 -0
- package/dist/relations/has-one/has-one.decorator.js +37 -0
- package/dist/relations/has-one/has-one.decorator.js.map +1 -0
- package/dist/relations/has-one/has-one.helpers.d.ts +17 -0
- package/dist/relations/has-one/has-one.helpers.js +64 -0
- package/dist/relations/has-one/has-one.helpers.js.map +1 -0
- package/dist/relations/has-one/has-one.inclusion-resolver.d.ts +14 -0
- package/dist/relations/has-one/has-one.inclusion-resolver.js +35 -0
- package/dist/relations/has-one/has-one.inclusion-resolver.js.map +1 -0
- package/dist/relations/has-one/has-one.repository-factory.d.ts +28 -0
- package/dist/relations/has-one/has-one.repository-factory.js +39 -0
- package/dist/relations/has-one/has-one.repository-factory.js.map +1 -0
- package/dist/relations/has-one/has-one.repository.d.ts +53 -0
- package/dist/relations/has-one/has-one.repository.js +45 -0
- package/dist/relations/has-one/has-one.repository.js.map +1 -0
- package/dist/relations/has-one/index.d.ts +3 -0
- package/dist/relations/has-one/index.js +11 -0
- package/dist/relations/has-one/index.js.map +1 -0
- package/dist/relations/index.d.ts +6 -0
- package/dist/relations/index.js +14 -0
- package/dist/relations/index.js.map +1 -0
- package/dist/relations/relation.decorator.d.ts +39 -0
- package/dist/relations/relation.decorator.js +88 -0
- package/dist/relations/relation.decorator.js.map +1 -0
- package/dist/relations/relation.helpers.d.ts +105 -0
- package/dist/relations/relation.helpers.js +298 -0
- package/dist/relations/relation.helpers.js.map +1 -0
- package/dist/relations/relation.types.d.ts +142 -0
- package/dist/relations/relation.types.js +21 -0
- package/dist/relations/relation.types.js.map +1 -0
- package/dist/repositories/constraint-utils.d.ts +49 -0
- package/dist/repositories/constraint-utils.js +87 -0
- package/dist/repositories/constraint-utils.js.map +1 -0
- package/dist/repositories/index.d.ts +5 -0
- package/dist/repositories/index.js +13 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/repositories/kv.repository.bridge.d.ts +30 -0
- package/dist/repositories/kv.repository.bridge.js +76 -0
- package/dist/repositories/kv.repository.bridge.js.map +1 -0
- package/dist/repositories/kv.repository.d.ts +74 -0
- package/{lib/crud-connector.js → dist/repositories/kv.repository.js} +2 -2
- package/dist/repositories/kv.repository.js.map +1 -0
- package/dist/repositories/legacy-juggler-bridge.d.ts +305 -0
- package/dist/repositories/legacy-juggler-bridge.js +452 -0
- package/dist/repositories/legacy-juggler-bridge.js.map +1 -0
- package/dist/repositories/repository.d.ts +223 -0
- package/dist/repositories/repository.js +157 -0
- package/dist/repositories/repository.js.map +1 -0
- package/dist/transaction.d.ts +30 -0
- package/dist/transaction.js +18 -0
- package/dist/transaction.js.map +1 -0
- package/dist/type-resolver.d.ts +42 -0
- package/dist/type-resolver.js +61 -0
- package/dist/type-resolver.js.map +1 -0
- package/{lib → dist}/types/any.d.ts +1 -1
- package/{lib6 → dist}/types/any.js +3 -2
- package/dist/types/any.js.map +1 -0
- package/{lib6 → dist}/types/array.d.ts +4 -4
- package/{lib → dist}/types/array.js +6 -4
- package/dist/types/array.js.map +1 -0
- package/{lib → dist}/types/boolean.d.ts +1 -1
- package/{lib6 → dist}/types/boolean.js +3 -2
- package/dist/types/boolean.js.map +1 -0
- package/{lib6 → dist}/types/buffer.d.ts +2 -2
- package/{lib → dist}/types/buffer.js +8 -6
- package/dist/types/buffer.js.map +1 -0
- package/{lib → dist}/types/date.d.ts +1 -1
- package/{lib → dist}/types/date.js +6 -4
- package/dist/types/date.js.map +1 -0
- package/{lib → dist}/types/index.d.ts +11 -9
- package/dist/types/index.js +49 -0
- package/dist/types/index.js.map +1 -0
- package/{lib6 → dist}/types/model.d.ts +2 -1
- package/{lib6 → dist}/types/model.js +2 -2
- package/dist/types/model.js.map +1 -0
- package/dist/types/null.d.ts +12 -0
- package/{lib/types/boolean.js → dist/types/null.js} +12 -11
- package/dist/types/null.js.map +1 -0
- package/{lib6 → dist}/types/number.d.ts +1 -1
- package/{lib → dist}/types/number.js +6 -4
- package/dist/types/number.js.map +1 -0
- package/{lib → dist}/types/object.d.ts +1 -1
- package/{lib → dist}/types/object.js +7 -6
- package/dist/types/object.js.map +1 -0
- package/{lib → dist}/types/string.d.ts +1 -1
- package/{lib → dist}/types/string.js +3 -2
- package/dist/types/string.js.map +1 -0
- package/{lib6 → dist}/types/type.d.ts +7 -7
- package/{lib6 → dist}/types/type.js +1 -1
- package/dist/types/type.js.map +1 -0
- package/{lib → dist}/types/union.d.ts +1 -1
- package/{lib → dist}/types/union.js +6 -4
- package/dist/types/union.js.map +1 -0
- package/package.json +49 -33
- package/src/common-types.ts +123 -0
- package/src/connectors/connector.ts +70 -0
- package/src/connectors/crud.connector.ts +208 -0
- package/src/connectors/index.ts +8 -0
- package/src/connectors/kv.connector.ts +113 -0
- package/src/datasource.ts +37 -0
- package/src/decorators/index.ts +8 -0
- package/src/decorators/metadata.ts +84 -0
- package/src/decorators/model.decorator.ts +166 -0
- package/src/decorators/repository.decorator.ts +223 -0
- package/src/define-model-class.ts +90 -0
- package/src/define-repository-class.ts +170 -0
- package/src/errors/entity-not-found.error.ts +40 -0
- package/src/errors/index.ts +7 -0
- package/src/errors/invalid-relation.error.ts +39 -0
- package/src/index.ts +36 -0
- package/src/keys.ts +40 -0
- package/{index.d.ts → src/mixins/index.ts} +2 -2
- package/src/mixins/repository.mixin.ts +499 -0
- package/src/model.ts +539 -0
- package/src/relations/belongs-to/belongs-to.accessor.ts +74 -0
- package/src/relations/belongs-to/belongs-to.decorator.ts +81 -0
- package/src/relations/belongs-to/belongs-to.helpers.ts +78 -0
- package/src/relations/belongs-to/belongs-to.inclusion-resolver.ts +71 -0
- package/src/relations/belongs-to/belongs-to.repository.ts +55 -0
- package/src/relations/belongs-to/index.ts +9 -0
- package/src/relations/has-many/has-many-through.helpers.ts +361 -0
- package/src/relations/has-many/has-many-through.inclusion-resolver.ts +135 -0
- package/src/relations/has-many/has-many-through.repository-factory.ts +121 -0
- package/src/relations/has-many/has-many-through.repository.ts +318 -0
- package/src/relations/has-many/has-many.decorator.ts +38 -0
- package/src/relations/has-many/has-many.helpers.ts +100 -0
- package/src/relations/has-many/has-many.inclusion-resolver.ts +88 -0
- package/src/relations/has-many/has-many.repository-factory.ts +76 -0
- package/src/relations/has-many/has-many.repository.ts +118 -0
- package/src/relations/has-many/index.ts +11 -0
- package/src/relations/has-one/has-one.decorator.ts +40 -0
- package/src/relations/has-one/has-one.helpers.ts +84 -0
- package/src/relations/has-one/has-one.inclusion-resolver.ts +65 -0
- package/src/relations/has-one/has-one.repository-factory.ts +72 -0
- package/src/relations/has-one/has-one.repository.ts +127 -0
- package/src/relations/has-one/index.ts +8 -0
- package/src/relations/index.ts +11 -0
- package/src/relations/relation.decorator.ts +90 -0
- package/src/relations/relation.helpers.ts +364 -0
- package/src/relations/relation.types.ts +180 -0
- package/src/repositories/constraint-utils.ts +98 -0
- package/src/repositories/index.ts +10 -0
- package/src/repositories/kv.repository.bridge.ts +97 -0
- package/src/repositories/kv.repository.ts +87 -0
- package/src/repositories/legacy-juggler-bridge.ts +788 -0
- package/src/repositories/repository.ts +441 -0
- package/src/transaction.ts +39 -0
- package/src/type-resolver.ts +98 -0
- package/src/types/any.ts +38 -0
- package/src/types/array.ts +53 -0
- package/src/types/boolean.ts +35 -0
- package/src/types/buffer.ts +53 -0
- package/src/types/date.ts +61 -0
- package/src/types/index.ts +52 -0
- package/src/types/model.ts +24 -0
- package/src/types/null.ts +35 -0
- package/src/types/number.ts +42 -0
- package/src/types/object.ts +53 -0
- package/src/types/string.ts +42 -0
- package/src/types/type.ts +51 -0
- package/src/types/union.ts +55 -0
- package/api-docs/apple-touch-icon-114x114-precomposed.png +0 -0
- package/api-docs/apple-touch-icon-144x144-precomposed.png +0 -0
- package/api-docs/apple-touch-icon-57x57-precomposed.png +0 -0
- package/api-docs/apple-touch-icon-72x72-precomposed.png +0 -0
- package/api-docs/apple-touch-icon-precomposed.png +0 -0
- package/api-docs/apple-touch-icon.png +0 -0
- package/api-docs/css/bootstrap.min.css +0 -9
- package/api-docs/css/code-themes/arta.css +0 -158
- package/api-docs/css/code-themes/ascetic.css +0 -50
- package/api-docs/css/code-themes/brown_paper.css +0 -104
- package/api-docs/css/code-themes/brown_papersq.png +0 -0
- package/api-docs/css/code-themes/dark.css +0 -103
- package/api-docs/css/code-themes/default.css +0 -135
- package/api-docs/css/code-themes/far.css +0 -111
- package/api-docs/css/code-themes/github.css +0 -127
- package/api-docs/css/code-themes/googlecode.css +0 -144
- package/api-docs/css/code-themes/idea.css +0 -121
- package/api-docs/css/code-themes/ir_black.css +0 -104
- package/api-docs/css/code-themes/magula.css +0 -121
- package/api-docs/css/code-themes/monokai.css +0 -114
- package/api-docs/css/code-themes/pojoaque.css +0 -104
- package/api-docs/css/code-themes/pojoaque.jpg +0 -0
- package/api-docs/css/code-themes/rainbow.css +0 -114
- package/api-docs/css/code-themes/school_book.css +0 -111
- package/api-docs/css/code-themes/school_book.png +0 -0
- package/api-docs/css/code-themes/sl-theme.css +0 -45
- package/api-docs/css/code-themes/solarized_dark.css +0 -88
- package/api-docs/css/code-themes/solarized_light.css +0 -88
- package/api-docs/css/code-themes/sunburst.css +0 -158
- package/api-docs/css/code-themes/tomorrow-night-blue.css +0 -52
- package/api-docs/css/code-themes/tomorrow-night-bright.css +0 -51
- package/api-docs/css/code-themes/tomorrow-night-eighties.css +0 -51
- package/api-docs/css/code-themes/tomorrow-night.css +0 -52
- package/api-docs/css/code-themes/tomorrow.css +0 -49
- package/api-docs/css/code-themes/vs.css +0 -86
- package/api-docs/css/code-themes/xcode.css +0 -154
- package/api-docs/css/code-themes/zenburn.css +0 -115
- package/api-docs/css/main.css +0 -139
- package/api-docs/favicon.ico +0 -0
- package/api-docs/fonts/0ihfXUL2emPh0ROJezvraLO3LdcAZYWl9Si6vvxL-qU.woff +0 -0
- package/api-docs/fonts/OsJ2DjdpjqFRVUSto6IffLO3LdcAZYWl9Si6vvxL-qU.woff +0 -0
- package/api-docs/fonts/_aijTyevf54tkVDLy-dlnLO3LdcAZYWl9Si6vvxL-qU.woff +0 -0
- package/api-docs/index.html +0 -18017
- package/api-docs/js/main.js +0 -19
- package/api-docs/js/vendor/bootstrap.min.js +0 -6
- package/api-docs/js/vendor/jquery-1.10.1.min.js +0 -6
- package/api-docs/js/vendor/jquery.scrollTo-1.4.3.1.js +0 -218
- package/api-docs/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js +0 -11
- package/index.js +0 -9
- package/lib/common-types.d.ts +0 -44
- package/lib/common-types.js.map +0 -1
- package/lib/connector.d.ts +0 -12
- package/lib/connector.js.map +0 -1
- package/lib/crud-connector.js.map +0 -1
- package/lib/datasource.d.ts +0 -11
- package/lib/datasource.js.map +0 -1
- package/lib/decorators/model.d.ts +0 -17
- package/lib/decorators/model.js +0 -55
- package/lib/decorators/model.js.map +0 -1
- package/lib/decorators/relation.d.ts +0 -65
- package/lib/decorators/relation.js +0 -126
- package/lib/decorators/relation.js.map +0 -1
- package/lib/decorators/repository.d.ts +0 -61
- package/lib/decorators/repository.js +0 -107
- package/lib/decorators/repository.js.map +0 -1
- package/lib/index.d.ts +0 -17
- package/lib/index.js +0 -21
- package/lib/index.js.map +0 -1
- package/lib/kv-connector.d.ts +0 -77
- package/lib/kv-connector.js +0 -7
- package/lib/kv-connector.js.map +0 -1
- package/lib/kv-repository.d.ts +0 -78
- package/lib/kv-repository.js +0 -7
- package/lib/kv-repository.js.map +0 -1
- package/lib/legacy-juggler-bridge.d.ts +0 -53
- package/lib/legacy-juggler-bridge.js +0 -142
- package/lib/legacy-juggler-bridge.js.map +0 -1
- package/lib/loopback-datasource-juggler.d.ts +0 -666
- package/lib/loopback-datasource-juggler.js +0 -8
- package/lib/loopback-datasource-juggler.js.map +0 -1
- package/lib/mixin.d.ts +0 -43
- package/lib/mixin.js +0 -34
- package/lib/mixin.js.map +0 -1
- package/lib/model.d.ts +0 -137
- package/lib/model.js +0 -182
- package/lib/model.js.map +0 -1
- package/lib/query.d.ts +0 -112
- package/lib/query.js +0 -25
- package/lib/query.js.map +0 -1
- package/lib/repository-mixin.d.ts +0 -20
- package/lib/repository-mixin.js +0 -111
- package/lib/repository-mixin.js.map +0 -1
- package/lib/repository.d.ts +0 -172
- package/lib/repository.js +0 -128
- package/lib/repository.js.map +0 -1
- package/lib/types/any.js +0 -35
- package/lib/types/any.js.map +0 -1
- package/lib/types/array.d.ts +0 -14
- package/lib/types/array.js.map +0 -1
- package/lib/types/boolean.js.map +0 -1
- package/lib/types/buffer.d.ts +0 -14
- package/lib/types/buffer.js.map +0 -1
- package/lib/types/date.js.map +0 -1
- package/lib/types/index.js +0 -33
- package/lib/types/index.js.map +0 -1
- package/lib/types/model.d.ts +0 -11
- package/lib/types/model.js +0 -25
- package/lib/types/model.js.map +0 -1
- package/lib/types/number.d.ts +0 -12
- package/lib/types/number.js.map +0 -1
- package/lib/types/object.js.map +0 -1
- package/lib/types/string.js.map +0 -1
- package/lib/types/type.d.ts +0 -38
- package/lib/types/type.js +0 -7
- package/lib/types/type.js.map +0 -1
- package/lib/types/union.js.map +0 -1
- package/lib6/common-types.d.ts +0 -44
- package/lib6/common-types.js +0 -7
- package/lib6/common-types.js.map +0 -1
- package/lib6/connector.d.ts +0 -12
- package/lib6/connector.js +0 -7
- package/lib6/connector.js.map +0 -1
- package/lib6/crud-connector.d.ts +0 -130
- package/lib6/crud-connector.js +0 -7
- package/lib6/crud-connector.js.map +0 -1
- package/lib6/datasource.d.ts +0 -11
- package/lib6/datasource.js.map +0 -1
- package/lib6/decorators/model.d.ts +0 -17
- package/lib6/decorators/model.js +0 -55
- package/lib6/decorators/model.js.map +0 -1
- package/lib6/decorators/relation.d.ts +0 -65
- package/lib6/decorators/relation.js +0 -126
- package/lib6/decorators/relation.js.map +0 -1
- package/lib6/decorators/repository.d.ts +0 -61
- package/lib6/decorators/repository.js +0 -117
- package/lib6/decorators/repository.js.map +0 -1
- package/lib6/index.d.ts +0 -17
- package/lib6/index.js +0 -21
- package/lib6/index.js.map +0 -1
- package/lib6/kv-connector.js +0 -7
- package/lib6/kv-connector.js.map +0 -1
- package/lib6/kv-repository.d.ts +0 -78
- package/lib6/kv-repository.js +0 -7
- package/lib6/kv-repository.js.map +0 -1
- package/lib6/legacy-juggler-bridge.d.ts +0 -53
- package/lib6/legacy-juggler-bridge.js +0 -158
- package/lib6/legacy-juggler-bridge.js.map +0 -1
- package/lib6/loopback-datasource-juggler.d.ts +0 -666
- package/lib6/loopback-datasource-juggler.js +0 -8
- package/lib6/loopback-datasource-juggler.js.map +0 -1
- package/lib6/mixin.d.ts +0 -43
- package/lib6/mixin.js +0 -34
- package/lib6/mixin.js.map +0 -1
- package/lib6/model.d.ts +0 -137
- package/lib6/model.js +0 -182
- package/lib6/model.js.map +0 -1
- package/lib6/query.d.ts +0 -112
- package/lib6/query.js +0 -25
- package/lib6/query.js.map +0 -1
- package/lib6/repository-mixin.d.ts +0 -20
- package/lib6/repository-mixin.js +0 -111
- package/lib6/repository-mixin.js.map +0 -1
- package/lib6/repository.d.ts +0 -172
- package/lib6/repository.js +0 -128
- package/lib6/repository.js.map +0 -1
- package/lib6/types/any.d.ts +0 -12
- package/lib6/types/any.js.map +0 -1
- package/lib6/types/array.js +0 -53
- package/lib6/types/array.js.map +0 -1
- package/lib6/types/boolean.d.ts +0 -12
- package/lib6/types/boolean.js.map +0 -1
- package/lib6/types/buffer.js +0 -57
- package/lib6/types/buffer.js.map +0 -1
- package/lib6/types/date.d.ts +0 -12
- package/lib6/types/date.js +0 -60
- package/lib6/types/date.js.map +0 -1
- package/lib6/types/index.d.ts +0 -30
- package/lib6/types/index.js +0 -33
- package/lib6/types/index.js.map +0 -1
- package/lib6/types/model.js.map +0 -1
- package/lib6/types/number.js +0 -40
- package/lib6/types/number.js.map +0 -1
- package/lib6/types/object.d.ts +0 -15
- package/lib6/types/object.js +0 -49
- package/lib6/types/object.js.map +0 -1
- package/lib6/types/string.d.ts +0 -12
- package/lib6/types/string.js +0 -40
- package/lib6/types/string.js.map +0 -1
- package/lib6/types/type.js.map +0 -1
- package/lib6/types/union.d.ts +0 -14
- package/lib6/types/union.js +0 -51
- package/lib6/types/union.js.map +0 -1
package/lib/mixin.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Class } from './common-types';
|
|
2
|
-
/**
|
|
3
|
-
* Interface for functions that can mix properties/methods into a base class
|
|
4
|
-
*
|
|
5
|
-
* For example,
|
|
6
|
-
* ```
|
|
7
|
-
* var calculatorMixin = Base => class extends Base {
|
|
8
|
-
* calc() { }
|
|
9
|
-
* };
|
|
10
|
-
*
|
|
11
|
-
* function timestampMixin(Base) {
|
|
12
|
-
* return class extends Base {
|
|
13
|
-
* created: Date = new Date();
|
|
14
|
-
* modified: Date = new Date();
|
|
15
|
-
* }
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
* See http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/.
|
|
19
|
-
*/
|
|
20
|
-
export interface MixinFunc {
|
|
21
|
-
<BC extends Class<any>>(baseClass: BC): BC;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A builder to compose mixins
|
|
25
|
-
*/
|
|
26
|
-
export declare class MixinBuilder {
|
|
27
|
-
baseClass: Class<any>;
|
|
28
|
-
/**
|
|
29
|
-
* Constructor for MixinBuilder
|
|
30
|
-
* @param baseClass The base class
|
|
31
|
-
*/
|
|
32
|
-
constructor(baseClass: Class<any>);
|
|
33
|
-
/**
|
|
34
|
-
* Apply one or more mixin functions
|
|
35
|
-
* @param mixins An array of mixin functions
|
|
36
|
-
*/
|
|
37
|
-
with(...mixins: MixinFunc[]): Class<any>;
|
|
38
|
-
/**
|
|
39
|
-
* Create an instance of MixinBuilder with the base class
|
|
40
|
-
* @param baseClass The base class
|
|
41
|
-
*/
|
|
42
|
-
static mix(baseClass: Class<any>): MixinBuilder;
|
|
43
|
-
}
|
package/lib/mixin.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2017. All Rights Reserved.
|
|
3
|
-
// Node module: @loopback/repository
|
|
4
|
-
// This file is licensed under the MIT License.
|
|
5
|
-
// License text available at https://opensource.org/licenses/MIT
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
/**
|
|
8
|
-
* A builder to compose mixins
|
|
9
|
-
*/
|
|
10
|
-
class MixinBuilder {
|
|
11
|
-
/**
|
|
12
|
-
* Constructor for MixinBuilder
|
|
13
|
-
* @param baseClass The base class
|
|
14
|
-
*/
|
|
15
|
-
constructor(baseClass) {
|
|
16
|
-
this.baseClass = baseClass;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Apply one or more mixin functions
|
|
20
|
-
* @param mixins An array of mixin functions
|
|
21
|
-
*/
|
|
22
|
-
with(...mixins) {
|
|
23
|
-
return mixins.reduce((c, mixin) => mixin(c), this.baseClass);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Create an instance of MixinBuilder with the base class
|
|
27
|
-
* @param baseClass The base class
|
|
28
|
-
*/
|
|
29
|
-
static mix(baseClass) {
|
|
30
|
-
return new MixinBuilder(baseClass);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.MixinBuilder = MixinBuilder;
|
|
34
|
-
//# sourceMappingURL=mixin.js.map
|
package/lib/mixin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mixin.js","sourceRoot":"","sources":["../src/mixin.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;AA4BhE;;GAEG;AACH;IACE;;;OAGG;IACH,YAAmB,SAAqB;QAArB,cAAS,GAAT,SAAS,CAAY;IAAG,CAAC;IAE5C;;;OAGG;IACH,IAAI,CAAC,GAAG,MAAmB;QACzB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,GAAG,CAAC,SAAqB;QAC9B,MAAM,CAAC,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;CACF;AAtBD,oCAsBC"}
|
package/lib/model.d.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { Options, DataObject } from './common-types';
|
|
2
|
-
import { Type } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* This module defines the key classes representing building blocks for Domain
|
|
5
|
-
* Driven Design.
|
|
6
|
-
* See https://en.wikipedia.org/wiki/Domain-driven_design#Building_blocks
|
|
7
|
-
*/
|
|
8
|
-
export declare type PropertyType = string | Function | Object | Type<any>;
|
|
9
|
-
/**
|
|
10
|
-
* Property definition for a model
|
|
11
|
-
*/
|
|
12
|
-
export interface PropertyDefinition {
|
|
13
|
-
type: PropertyType;
|
|
14
|
-
id?: boolean;
|
|
15
|
-
json?: PropertyForm;
|
|
16
|
-
store?: PropertyForm;
|
|
17
|
-
[attribute: string]: any;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* See https://github.com/strongloop/loopback-datasource-juggler/issues/432
|
|
21
|
-
*/
|
|
22
|
-
export interface PropertyForm {
|
|
23
|
-
in?: boolean;
|
|
24
|
-
out?: boolean;
|
|
25
|
-
name?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface PropertyDefinitionMap {
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* DSL for building a model definition.
|
|
31
|
-
*/
|
|
32
|
-
export interface ModelDefinitionSyntax {
|
|
33
|
-
name: string;
|
|
34
|
-
properties?: {
|
|
35
|
-
[name: string]: PropertyDefinition | PropertyType;
|
|
36
|
-
};
|
|
37
|
-
settings?: {
|
|
38
|
-
[name: string]: any;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Definition for a model
|
|
43
|
-
*/
|
|
44
|
-
export declare class ModelDefinition {
|
|
45
|
-
readonly name: string;
|
|
46
|
-
properties: {
|
|
47
|
-
[name: string]: PropertyDefinition;
|
|
48
|
-
};
|
|
49
|
-
settings: {
|
|
50
|
-
[name: string]: any;
|
|
51
|
-
};
|
|
52
|
-
[attribute: string]: any;
|
|
53
|
-
constructor(nameOrDef: string | ModelDefinitionSyntax);
|
|
54
|
-
/**
|
|
55
|
-
* Add a property
|
|
56
|
-
* @param property Property definition or name (string)
|
|
57
|
-
* @param type Property type
|
|
58
|
-
*/
|
|
59
|
-
addProperty(name: string, definitionOrType: PropertyDefinition | PropertyType): this;
|
|
60
|
-
/**
|
|
61
|
-
* Add a setting
|
|
62
|
-
* @param name Setting name
|
|
63
|
-
* @param value Setting value
|
|
64
|
-
*/
|
|
65
|
-
addSetting(name: string, value: any): this;
|
|
66
|
-
/**
|
|
67
|
-
* Get an array of names of ID properties, which are specified in
|
|
68
|
-
* the model settings or properties with `id` attribute. For example,
|
|
69
|
-
* ```
|
|
70
|
-
* {
|
|
71
|
-
* settings: {
|
|
72
|
-
* id: ['id']
|
|
73
|
-
* }
|
|
74
|
-
* properties: {
|
|
75
|
-
* id: {
|
|
76
|
-
* type: 'string',
|
|
77
|
-
* id: true
|
|
78
|
-
* }
|
|
79
|
-
* }
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
idProperties(): string[];
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Base class for models
|
|
87
|
-
*/
|
|
88
|
-
export declare abstract class Model {
|
|
89
|
-
static modelName: string;
|
|
90
|
-
static definition: ModelDefinition;
|
|
91
|
-
/**
|
|
92
|
-
* Serialize into a plain JSON object
|
|
93
|
-
*/
|
|
94
|
-
toJSON(): Object;
|
|
95
|
-
/**
|
|
96
|
-
* Convert to a plain object as DTO
|
|
97
|
-
*/
|
|
98
|
-
toObject(options?: Options): Object;
|
|
99
|
-
[prop: string]: any;
|
|
100
|
-
constructor(data?: Partial<Model>);
|
|
101
|
-
}
|
|
102
|
-
export interface Persistable {
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Base class for value objects - An object that contains attributes but has no
|
|
106
|
-
* conceptual identity. They should be treated as immutable.
|
|
107
|
-
*/
|
|
108
|
-
export declare abstract class ValueObject extends Model implements Persistable {
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Base class for entities which have unique ids
|
|
112
|
-
*/
|
|
113
|
-
export declare abstract class Entity extends Model implements Persistable {
|
|
114
|
-
/**
|
|
115
|
-
* Get the identity value. If the identity is a composite key, returns
|
|
116
|
-
* an object.
|
|
117
|
-
*/
|
|
118
|
-
getId(): any;
|
|
119
|
-
/**
|
|
120
|
-
* Get the identity as an object, such as `{id: 1}` or
|
|
121
|
-
* `{schoolId: 1, studentId: 2}`
|
|
122
|
-
*/
|
|
123
|
-
getIdObject(): Object;
|
|
124
|
-
/**
|
|
125
|
-
* Build the where object for the given id
|
|
126
|
-
* @param id The id value
|
|
127
|
-
*/
|
|
128
|
-
static buildWhereForId(id: any): any;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Domain events
|
|
132
|
-
*/
|
|
133
|
-
export declare class Event {
|
|
134
|
-
source: any;
|
|
135
|
-
type: string;
|
|
136
|
-
}
|
|
137
|
-
export declare type EntityData = DataObject<Entity>;
|
package/lib/model.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2017. All Rights Reserved.
|
|
3
|
-
// Node module: @loopback/repository
|
|
4
|
-
// This file is licensed under the MIT License.
|
|
5
|
-
// License text available at https://opensource.org/licenses/MIT
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
/**
|
|
8
|
-
* Definition for a model
|
|
9
|
-
*/
|
|
10
|
-
class ModelDefinition {
|
|
11
|
-
constructor(nameOrDef) {
|
|
12
|
-
if (typeof nameOrDef === 'string') {
|
|
13
|
-
nameOrDef = { name: nameOrDef };
|
|
14
|
-
}
|
|
15
|
-
const { name, properties, settings } = nameOrDef;
|
|
16
|
-
this.name = name;
|
|
17
|
-
this.properties = {};
|
|
18
|
-
if (properties) {
|
|
19
|
-
for (const p in properties) {
|
|
20
|
-
this.addProperty(p, properties[p]);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
this.settings = settings || new Map();
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Add a property
|
|
27
|
-
* @param property Property definition or name (string)
|
|
28
|
-
* @param type Property type
|
|
29
|
-
*/
|
|
30
|
-
addProperty(name, definitionOrType) {
|
|
31
|
-
const definition = definitionOrType.type ?
|
|
32
|
-
definitionOrType :
|
|
33
|
-
{ type: definitionOrType };
|
|
34
|
-
this.properties[name] = definition;
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Add a setting
|
|
39
|
-
* @param name Setting name
|
|
40
|
-
* @param value Setting value
|
|
41
|
-
*/
|
|
42
|
-
addSetting(name, value) {
|
|
43
|
-
this.settings[name] = value;
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Get an array of names of ID properties, which are specified in
|
|
48
|
-
* the model settings or properties with `id` attribute. For example,
|
|
49
|
-
* ```
|
|
50
|
-
* {
|
|
51
|
-
* settings: {
|
|
52
|
-
* id: ['id']
|
|
53
|
-
* }
|
|
54
|
-
* properties: {
|
|
55
|
-
* id: {
|
|
56
|
-
* type: 'string',
|
|
57
|
-
* id: true
|
|
58
|
-
* }
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
idProperties() {
|
|
64
|
-
if (typeof this.settings.id === 'string') {
|
|
65
|
-
return [this.settings.id];
|
|
66
|
-
}
|
|
67
|
-
else if (Array.isArray(this.settings.id)) {
|
|
68
|
-
return this.settings.id;
|
|
69
|
-
}
|
|
70
|
-
const idProps = Object.keys(this.properties)
|
|
71
|
-
.filter(prop => this.properties[prop].id);
|
|
72
|
-
return idProps;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.ModelDefinition = ModelDefinition;
|
|
76
|
-
/**
|
|
77
|
-
* Base class for models
|
|
78
|
-
*/
|
|
79
|
-
class Model {
|
|
80
|
-
/**
|
|
81
|
-
* Serialize into a plain JSON object
|
|
82
|
-
*/
|
|
83
|
-
toJSON() {
|
|
84
|
-
const json = {};
|
|
85
|
-
const def = this.constructor.definition;
|
|
86
|
-
if (def == null) {
|
|
87
|
-
return this.toObject({ ignoreUnknownProperties: false });
|
|
88
|
-
}
|
|
89
|
-
for (const p in def.properties) {
|
|
90
|
-
if (p in this) {
|
|
91
|
-
json[p] = this[p];
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return json;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Convert to a plain object as DTO
|
|
98
|
-
*/
|
|
99
|
-
toObject(options) {
|
|
100
|
-
let obj;
|
|
101
|
-
if (options && options.ignoreUnknownProperties === false) {
|
|
102
|
-
obj = {};
|
|
103
|
-
for (const p in this) {
|
|
104
|
-
obj[p] = this[p];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
obj = this.toJSON();
|
|
109
|
-
}
|
|
110
|
-
return obj;
|
|
111
|
-
}
|
|
112
|
-
constructor(data) {
|
|
113
|
-
Object.assign(this, data);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.Model = Model;
|
|
117
|
-
/**
|
|
118
|
-
* Base class for value objects - An object that contains attributes but has no
|
|
119
|
-
* conceptual identity. They should be treated as immutable.
|
|
120
|
-
*/
|
|
121
|
-
class ValueObject extends Model {
|
|
122
|
-
}
|
|
123
|
-
exports.ValueObject = ValueObject;
|
|
124
|
-
/**
|
|
125
|
-
* Base class for entities which have unique ids
|
|
126
|
-
*/
|
|
127
|
-
class Entity extends Model {
|
|
128
|
-
/**
|
|
129
|
-
* Get the identity value. If the identity is a composite key, returns
|
|
130
|
-
* an object.
|
|
131
|
-
*/
|
|
132
|
-
getId() {
|
|
133
|
-
const definition = this.constructor.definition;
|
|
134
|
-
const idProps = definition.idProperties();
|
|
135
|
-
if (idProps.length === 1) {
|
|
136
|
-
return this[idProps[0]];
|
|
137
|
-
}
|
|
138
|
-
if (!idProps.length) {
|
|
139
|
-
throw new Error(`Invalid Entity ${this.constructor.name}:` +
|
|
140
|
-
'missing primary key (id) property');
|
|
141
|
-
}
|
|
142
|
-
return this.getIdObject();
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Get the identity as an object, such as `{id: 1}` or
|
|
146
|
-
* `{schoolId: 1, studentId: 2}`
|
|
147
|
-
*/
|
|
148
|
-
getIdObject() {
|
|
149
|
-
const definition = this.constructor.definition;
|
|
150
|
-
const idProps = definition.idProperties();
|
|
151
|
-
const idObj = {};
|
|
152
|
-
for (const idProp of idProps) {
|
|
153
|
-
idObj[idProp] = this[idProp];
|
|
154
|
-
}
|
|
155
|
-
return idObj;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Build the where object for the given id
|
|
159
|
-
* @param id The id value
|
|
160
|
-
*/
|
|
161
|
-
static buildWhereForId(id) {
|
|
162
|
-
const where = {};
|
|
163
|
-
const idProps = this.definition.idProperties();
|
|
164
|
-
if (idProps.length === 1) {
|
|
165
|
-
where[idProps[0]] = id;
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
for (const idProp of idProps) {
|
|
169
|
-
where[idProp] = id[idProp];
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return where;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
exports.Entity = Entity;
|
|
176
|
-
/**
|
|
177
|
-
* Domain events
|
|
178
|
-
*/
|
|
179
|
-
class Event {
|
|
180
|
-
}
|
|
181
|
-
exports.Event = Event;
|
|
182
|
-
//# sourceMappingURL=model.js.map
|
package/lib/model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,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AAC,CAAC,MAAM,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC;YAC7B,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;QACD,MAAM,CAAC,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,EAAO;QAC5B,MAAM,KAAK,GAAG,EAAS,CAAC;QACxB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QAC/C,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;YACzB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACzB,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,GAAG,CAAC,CAAC,MAAM,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC;gBAC7B,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QACD,MAAM,CAAC,KAAK,CAAC;IACf,CAAC;CACF;AAlDD,wBAkDC;AAED;;GAEG;AACH;CAGC;AAHD,sBAGC"}
|
package/lib/query.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Operators for where clauses
|
|
3
|
-
*/
|
|
4
|
-
export declare enum Operators {
|
|
5
|
-
eq = 0,
|
|
6
|
-
neq = 1,
|
|
7
|
-
gt = 2,
|
|
8
|
-
gte = 3,
|
|
9
|
-
lt = 4,
|
|
10
|
-
lte = 5,
|
|
11
|
-
inq = 6,
|
|
12
|
-
between = 7,
|
|
13
|
-
exists = 8,
|
|
14
|
-
and = 9,
|
|
15
|
-
or = 10,
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Matching condition
|
|
19
|
-
*/
|
|
20
|
-
export interface Condition {
|
|
21
|
-
eq?: any;
|
|
22
|
-
neq?: any;
|
|
23
|
-
gt?: any;
|
|
24
|
-
get?: any;
|
|
25
|
-
lt?: any;
|
|
26
|
-
lte?: any;
|
|
27
|
-
inq?: any[];
|
|
28
|
-
between?: any[];
|
|
29
|
-
exists?: boolean;
|
|
30
|
-
and?: Where[];
|
|
31
|
-
or?: Where[];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Where object
|
|
35
|
-
*
|
|
36
|
-
* Examples:
|
|
37
|
-
* `{afieldname: 'aName'}`
|
|
38
|
-
* `{and: [{fieldone: 'one'}, {fieldtwo: 'two'}]}`
|
|
39
|
-
* `{or: [{fieldone: 'one'}, {fieldtwo: 'two'}]}`
|
|
40
|
-
*/
|
|
41
|
-
export interface Where {
|
|
42
|
-
and?: Where[];
|
|
43
|
-
or?: Where[];
|
|
44
|
-
[property: string]: Condition | any;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Order by direction
|
|
48
|
-
*/
|
|
49
|
-
export declare type Direction = 'ASC' | 'DESC';
|
|
50
|
-
/**
|
|
51
|
-
* Order by
|
|
52
|
-
*
|
|
53
|
-
* Example:
|
|
54
|
-
* `{afieldname: 'ASC'}`
|
|
55
|
-
*/
|
|
56
|
-
export interface Order {
|
|
57
|
-
[property: string]: Direction;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Selection of fields
|
|
61
|
-
*
|
|
62
|
-
* Example:
|
|
63
|
-
* `{afieldname: true}`
|
|
64
|
-
*/
|
|
65
|
-
export interface Fields {
|
|
66
|
-
[property: string]: boolean;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Inclusion of related items
|
|
70
|
-
*
|
|
71
|
-
* Note: scope means filter on related items
|
|
72
|
-
*
|
|
73
|
-
* Example:
|
|
74
|
-
* `{relation: 'aRelationName', scope: {<AFilterObject>}}`
|
|
75
|
-
*/
|
|
76
|
-
export interface Inclusion {
|
|
77
|
-
relation: string;
|
|
78
|
-
scope: Filter;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Query filter object
|
|
82
|
-
*/
|
|
83
|
-
export interface Filter {
|
|
84
|
-
/**
|
|
85
|
-
* The matching criteria
|
|
86
|
-
*/
|
|
87
|
-
where?: Where;
|
|
88
|
-
/**
|
|
89
|
-
* To include/exclude fields
|
|
90
|
-
*/
|
|
91
|
-
fields?: Fields;
|
|
92
|
-
/**
|
|
93
|
-
* Sorting order for matched entities
|
|
94
|
-
*/
|
|
95
|
-
order?: Order[];
|
|
96
|
-
/**
|
|
97
|
-
* Maximum number of entities
|
|
98
|
-
*/
|
|
99
|
-
limit?: number;
|
|
100
|
-
/**
|
|
101
|
-
* Skip N number of entities
|
|
102
|
-
*/
|
|
103
|
-
skip?: number;
|
|
104
|
-
/**
|
|
105
|
-
* Offset N number of entities. An alias for `skip`
|
|
106
|
-
*/
|
|
107
|
-
offset?: number;
|
|
108
|
-
/**
|
|
109
|
-
* To include related objects
|
|
110
|
-
*/
|
|
111
|
-
include?: Inclusion[];
|
|
112
|
-
}
|
package/lib/query.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2017. All Rights Reserved.
|
|
3
|
-
// Node module: @loopback/repository
|
|
4
|
-
// This file is licensed under the MIT License.
|
|
5
|
-
// License text available at https://opensource.org/licenses/MIT
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
// tslint:disable:no-any
|
|
8
|
-
/**
|
|
9
|
-
* Operators for where clauses
|
|
10
|
-
*/
|
|
11
|
-
var Operators;
|
|
12
|
-
(function (Operators) {
|
|
13
|
-
Operators[Operators["eq"] = 0] = "eq";
|
|
14
|
-
Operators[Operators["neq"] = 1] = "neq";
|
|
15
|
-
Operators[Operators["gt"] = 2] = "gt";
|
|
16
|
-
Operators[Operators["gte"] = 3] = "gte";
|
|
17
|
-
Operators[Operators["lt"] = 4] = "lt";
|
|
18
|
-
Operators[Operators["lte"] = 5] = "lte";
|
|
19
|
-
Operators[Operators["inq"] = 6] = "inq";
|
|
20
|
-
Operators[Operators["between"] = 7] = "between";
|
|
21
|
-
Operators[Operators["exists"] = 8] = "exists";
|
|
22
|
-
Operators[Operators["and"] = 9] = "and";
|
|
23
|
-
Operators[Operators["or"] = 10] = "or";
|
|
24
|
-
})(Operators = exports.Operators || (exports.Operators = {}));
|
|
25
|
-
//# sourceMappingURL=query.js.map
|
package/lib/query.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;AAEhE,wBAAwB;AAExB;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,qCAAE,CAAA;IACF,uCAAG,CAAA;IACH,qCAAE,CAAA;IACF,uCAAG,CAAA;IACH,qCAAE,CAAA;IACF,uCAAG,CAAA;IACH,uCAAG,CAAA;IACH,+CAAO,CAAA;IACP,6CAAM,CAAA;IACN,uCAAG,CAAA;IACH,sCAAE,CAAA;AACJ,CAAC,EAZW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAYpB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Class } from './common-types';
|
|
2
|
-
import { Repository } from './repository';
|
|
3
|
-
/**
|
|
4
|
-
* A mixin class for Application that creates a .repository()
|
|
5
|
-
* function to register a repository automatically. Also overrides
|
|
6
|
-
* component function to allow it to register repositories automatically.
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
*
|
|
10
|
-
* class MyApplication extends RepositoryMixin(Application) {}
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export declare function RepositoryMixin<T extends Class<any>>(superClass: T): {
|
|
14
|
-
new (...args: any[]): {
|
|
15
|
-
[x: string]: any;
|
|
16
|
-
repository(repo: Class<Repository<any>>): void;
|
|
17
|
-
component(component: Class<any>): void;
|
|
18
|
-
mountComponentRepository(component: Class<any>): void;
|
|
19
|
-
};
|
|
20
|
-
} & T;
|
package/lib/repository-mixin.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2017. All Rights Reserved.
|
|
3
|
-
// Node module: @loopback/repository
|
|
4
|
-
// This file is licensed under the MIT License.
|
|
5
|
-
// License text available at https://opensource.org/licenses/MIT
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
// tslint:disable:no-any
|
|
8
|
-
/**
|
|
9
|
-
* A mixin class for Application that creates a .repository()
|
|
10
|
-
* function to register a repository automatically. Also overrides
|
|
11
|
-
* component function to allow it to register repositories automatically.
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
*
|
|
15
|
-
* class MyApplication extends RepositoryMixin(Application) {}
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
function RepositoryMixin(superClass) {
|
|
19
|
-
return class extends superClass {
|
|
20
|
-
// A mixin class has to take in a type any[] argument!
|
|
21
|
-
constructor(...args) {
|
|
22
|
-
super(...args);
|
|
23
|
-
if (!this.options)
|
|
24
|
-
this.options = {};
|
|
25
|
-
if (this.options.repositories) {
|
|
26
|
-
for (const repo of this.options.repositories) {
|
|
27
|
-
this.repository(repo);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (this.options.components) {
|
|
31
|
-
// Super would have already mounted the component
|
|
32
|
-
for (const component of this.options.components) {
|
|
33
|
-
this.mountComponentRepository(component);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Add a repository to this application.
|
|
39
|
-
*
|
|
40
|
-
* @param repo The repository to add.
|
|
41
|
-
*
|
|
42
|
-
* ```ts
|
|
43
|
-
*
|
|
44
|
-
* class NoteRepo {
|
|
45
|
-
* model: any;
|
|
46
|
-
*
|
|
47
|
-
* constructor() {
|
|
48
|
-
* const ds: juggler.DataSource = new DataSourceConstructor({
|
|
49
|
-
* name: 'db',
|
|
50
|
-
* connector: 'memory',
|
|
51
|
-
* });
|
|
52
|
-
*
|
|
53
|
-
* this.model = ds.createModel(
|
|
54
|
-
* 'note',
|
|
55
|
-
* {title: 'string', content: 'string'},
|
|
56
|
-
* {}
|
|
57
|
-
* );
|
|
58
|
-
* }
|
|
59
|
-
* };
|
|
60
|
-
*
|
|
61
|
-
* app.repository(NoteRepo);
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
repository(repo) {
|
|
65
|
-
const repoKey = `repositories.${repo.name}`;
|
|
66
|
-
this.bind(repoKey).toClass(repo);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Add a component to this application. Also mounts
|
|
70
|
-
* all the components repositories.
|
|
71
|
-
*
|
|
72
|
-
* @param component The component to add.
|
|
73
|
-
*
|
|
74
|
-
* ```ts
|
|
75
|
-
*
|
|
76
|
-
* export class ProductComponent {
|
|
77
|
-
* controllers = [ProductController];
|
|
78
|
-
* repositories = [ProductRepo, UserRepo];
|
|
79
|
-
* providers = {
|
|
80
|
-
* [AUTHENTICATION_STRATEGY]: AuthStrategy,
|
|
81
|
-
* [AUTHORIZATION_ROLE]: Role,
|
|
82
|
-
* };
|
|
83
|
-
* };
|
|
84
|
-
*
|
|
85
|
-
* app.component(ProductComponent);
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
component(component) {
|
|
89
|
-
super.component(component);
|
|
90
|
-
this.mountComponentRepository(component);
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Get an instance of a component and mount all it's
|
|
94
|
-
* repositories. This function is intended to be used internally
|
|
95
|
-
* by component()
|
|
96
|
-
*
|
|
97
|
-
* @param component The component to mount repositories of
|
|
98
|
-
*/
|
|
99
|
-
mountComponentRepository(component) {
|
|
100
|
-
const componentKey = `components.${component.name}`;
|
|
101
|
-
const compInstance = this.getSync(componentKey);
|
|
102
|
-
if (compInstance.repositories) {
|
|
103
|
-
for (const repo of compInstance.repositories) {
|
|
104
|
-
this.repository(repo);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
exports.RepositoryMixin = RepositoryMixin;
|
|
111
|
-
//# sourceMappingURL=repository-mixin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repository-mixin.js","sourceRoot":"","sources":["../src/repository-mixin.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;AAKhE,wBAAwB;AAExB;;;;;;;;;EASE;AACF,yBAAsD,UAAa;IACjE,MAAM,CAAC,KAAM,SAAQ,UAAU;QAC7B,sDAAsD;QACtD,YAAY,GAAG,IAAW;YACxB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACf,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;gBAAC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;YAErC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;gBAC9B,GAAG,CAAC,CAAC,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;oBAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;YAED,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;gBAC5B,iDAAiD;gBACjD,GAAG,CAAC,CAAC,MAAM,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;oBAChD,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC;QACH,CAAC;QAED;;;;;;;;;;;;;;;;;;;;;;;;;;UA0BE;QACF,UAAU,CAAC,IAA4B;YACrC,MAAM,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