@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright IBM Corp. 2017,2020. 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
|
+
exports.CountSchema = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* JSON Schema describing the Count interface. It's the response type for
|
|
10
|
+
* REST calls to APIs which return `count`. The type is compatible with
|
|
11
|
+
* `SchemaObject` from `@loopback/openapi-v3`, which is not an explicit
|
|
12
|
+
* dependency for `@loopback/repository`.
|
|
13
|
+
*/
|
|
14
|
+
exports.CountSchema /* :SchemaObject */ = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
title: 'loopback.Count',
|
|
17
|
+
'x-typescript-type': '@loopback/repository#Count',
|
|
18
|
+
properties: {
|
|
19
|
+
count: {
|
|
20
|
+
type: 'number', // Force to be `number` type instead of `string`
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=common-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-types.js","sourceRoot":"","sources":["../src/common-types.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;;AA6FhE;;;;;GAKG;AACU,QAAA,WAAW,CAAC,mBAAmB,GAAG;IAC7C,IAAI,EAAE,QAAiB;IACvB,KAAK,EAAE,gBAAgB;IACvB,mBAAmB,EAAE,4BAA4B;IACjD,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,QAAiB,EAAE,gDAAgD;SAC1E;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AnyObject, Command, NamedParameters, Options, PositionalParameters } from '../common-types';
|
|
2
|
+
import { Model } from '../model';
|
|
3
|
+
/**
|
|
4
|
+
* Interfaces adopted by a {@link Connector}.
|
|
5
|
+
*
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare namespace ConnectorInterfaces {
|
|
9
|
+
/**
|
|
10
|
+
* Strong relation interfaces adopted by a {@link Connector}
|
|
11
|
+
*
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
14
|
+
const enum StrongRelation {
|
|
15
|
+
BELONGS_TO = "strongBelongsTo",
|
|
16
|
+
HAS_ONE = "strongHasOne",
|
|
17
|
+
HAS_MANY = "strongHasMany",
|
|
18
|
+
HAS_MANY_THROUGH = "strongHasManyThrough",
|
|
19
|
+
HAS_AND_BELONGS_TO_MANY = "strongHasAndBelongsToMany",
|
|
20
|
+
EMBEDS_ONE = "strongEmbedsOne",
|
|
21
|
+
EMBEDS_MANY = "strongEmbedsMany",
|
|
22
|
+
REFERNCES_MANY = "strongReferencesMany"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Strong query join interfaces adopted by a {@link Connector}
|
|
26
|
+
*
|
|
27
|
+
* @experimental
|
|
28
|
+
*/
|
|
29
|
+
const enum StrongJoins {
|
|
30
|
+
INNER = "strongInnerJoin",
|
|
31
|
+
LEFT = "strongLeftJoin",
|
|
32
|
+
RIGHT = "strongRightJoin",
|
|
33
|
+
FULL = "strongFullJoin",
|
|
34
|
+
CARTESIAN = "strongCartesianJoin"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Common properties/operations for connectors
|
|
39
|
+
*/
|
|
40
|
+
export interface Connector {
|
|
41
|
+
name: string;
|
|
42
|
+
configModel?: Model;
|
|
43
|
+
interfaces?: (string | ConnectorInterfaces.StrongRelation | ConnectorInterfaces.StrongJoins)[];
|
|
44
|
+
connect(): Promise<void>;
|
|
45
|
+
disconnect(): Promise<void>;
|
|
46
|
+
ping(): Promise<void>;
|
|
47
|
+
execute?(command: Command, parameters: NamedParameters | PositionalParameters, options?: Options): Promise<AnyObject>;
|
|
48
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp.
|
|
2
|
+
// Copyright IBM Corp. 2018,2019. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/repository
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../../src/connectors/connector.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE"}
|
|
@@ -1,128 +1,128 @@
|
|
|
1
|
+
import { Filter, Where } from '@loopback/filter';
|
|
2
|
+
import { Class, Count, Options } from '../common-types';
|
|
3
|
+
import { Entity, EntityData } from '../model';
|
|
1
4
|
import { Connector } from './connector';
|
|
2
|
-
import { Entity, EntityData } from './model';
|
|
3
|
-
import { Filter, Where } from './query';
|
|
4
|
-
import { Class, Options } from './common-types';
|
|
5
5
|
/**
|
|
6
6
|
* CRUD operations for connector implementations
|
|
7
7
|
*/
|
|
8
8
|
export interface CrudConnector extends Connector {
|
|
9
9
|
/**
|
|
10
10
|
* Create a new entity
|
|
11
|
-
* @param modelClass The model class
|
|
12
|
-
* @param entity The entity instance or data
|
|
13
|
-
* @param options Options for the operation
|
|
11
|
+
* @param modelClass - The model class
|
|
12
|
+
* @param entity - The entity instance or data
|
|
13
|
+
* @param options - Options for the operation
|
|
14
14
|
* @returns A promise of the entity created
|
|
15
15
|
*/
|
|
16
16
|
create(modelClass: Class<Entity>, entity: EntityData, options?: Options): Promise<EntityData>;
|
|
17
17
|
/**
|
|
18
18
|
* Create multiple entities
|
|
19
|
-
* @param modelClass The model class
|
|
20
|
-
* @param entities An array of entity instances or data
|
|
21
|
-
* @param options Options for the operation
|
|
19
|
+
* @param modelClass - The model class
|
|
20
|
+
* @param entities - An array of entity instances or data
|
|
21
|
+
* @param options - Options for the operation
|
|
22
22
|
* @returns A promise of an array of entities created
|
|
23
23
|
*/
|
|
24
24
|
createAll?(modelClass: Class<Entity>, entities: EntityData[], options?: Options): Promise<EntityData[]>;
|
|
25
25
|
/**
|
|
26
26
|
* Save an entity
|
|
27
|
-
* @param modelClass The model class
|
|
28
|
-
* @param entity The entity instance or data
|
|
29
|
-
* @param options Options for the operation
|
|
27
|
+
* @param modelClass - The model class
|
|
28
|
+
* @param entity - The entity instance or data
|
|
29
|
+
* @param options - Options for the operation
|
|
30
30
|
* @returns A promise of the entity saved
|
|
31
31
|
*/
|
|
32
32
|
save?(modelClass: Class<Entity>, entity: EntityData, options?: Options): Promise<EntityData>;
|
|
33
33
|
/**
|
|
34
34
|
* Find matching entities by the filter
|
|
35
|
-
* @param modelClass The model class
|
|
36
|
-
* @param filter The query filter
|
|
37
|
-
* @param options Options for the operation
|
|
35
|
+
* @param modelClass - The model class
|
|
36
|
+
* @param filter - The query filter
|
|
37
|
+
* @param options - Options for the operation
|
|
38
38
|
* @returns A promise of an array of entities found for the filter
|
|
39
39
|
*/
|
|
40
40
|
find(modelClass: Class<Entity>, filter?: Filter, options?: Options): Promise<EntityData[]>;
|
|
41
41
|
/**
|
|
42
42
|
* Find an entity by id
|
|
43
|
-
* @param modelClass The model class
|
|
44
|
-
* @param id The entity id value
|
|
45
|
-
* @param options Options for the operation
|
|
43
|
+
* @param modelClass - The model class
|
|
44
|
+
* @param id - The entity id value
|
|
45
|
+
* @param options - Options for the operation
|
|
46
46
|
* @returns A promise of the entity found for the id
|
|
47
47
|
*/
|
|
48
48
|
findById?<IdType>(modelClass: Class<Entity>, id: IdType, options?: Options): Promise<EntityData>;
|
|
49
49
|
/**
|
|
50
50
|
* Update an entity
|
|
51
|
-
* @param modelClass The model class
|
|
52
|
-
* @param entity The entity instance or data
|
|
53
|
-
* @param options Options for the operation
|
|
51
|
+
* @param modelClass - The model class
|
|
52
|
+
* @param entity - The entity instance or data
|
|
53
|
+
* @param options - Options for the operation
|
|
54
54
|
* @returns Promise<true> if an entity is updated, otherwise
|
|
55
55
|
* Promise<false>
|
|
56
56
|
*/
|
|
57
57
|
update?(modelClass: Class<Entity>, entity: EntityData, options?: Options): Promise<boolean>;
|
|
58
58
|
/**
|
|
59
59
|
* Delete an entity
|
|
60
|
-
* @param modelClass The model class
|
|
61
|
-
* @param entity The entity instance or data
|
|
62
|
-
* @param options Options for the operation
|
|
60
|
+
* @param modelClass - The model class
|
|
61
|
+
* @param entity - The entity instance or data
|
|
62
|
+
* @param options - Options for the operation
|
|
63
63
|
* @returns Promise<true> if an entity is deleted, otherwise
|
|
64
64
|
* Promise<false>
|
|
65
65
|
*/
|
|
66
66
|
delete?(modelClass: Class<Entity>, entity: EntityData, options?: Options): Promise<boolean>;
|
|
67
67
|
/**
|
|
68
68
|
* Update matching entities
|
|
69
|
-
* @param modelClass The model class
|
|
70
|
-
* @param data The data attributes to be updated
|
|
71
|
-
* @param where The matching criteria
|
|
72
|
-
* @param options Options for the operation
|
|
69
|
+
* @param modelClass - The model class
|
|
70
|
+
* @param data - The data attributes to be updated
|
|
71
|
+
* @param where - The matching criteria
|
|
72
|
+
* @param options - Options for the operation
|
|
73
73
|
* @returns A promise of number of matching entities deleted
|
|
74
74
|
*/
|
|
75
|
-
updateAll(modelClass: Class<Entity>, data: EntityData, where?: Where
|
|
75
|
+
updateAll(modelClass: Class<Entity>, data: EntityData, where?: Where<Entity>, options?: Options): Promise<Count>;
|
|
76
76
|
/**
|
|
77
77
|
* Update an entity by id
|
|
78
|
-
* @param modelClass The model class
|
|
79
|
-
* @param id The entity id value
|
|
80
|
-
* @param data The data attributes to be updated
|
|
81
|
-
* @param options Options for the operation
|
|
78
|
+
* @param modelClass - The model class
|
|
79
|
+
* @param id - The entity id value
|
|
80
|
+
* @param data - The data attributes to be updated
|
|
81
|
+
* @param options - Options for the operation
|
|
82
82
|
* @returns Promise<true> if an entity is updated for the id, otherwise
|
|
83
83
|
* Promise<false>
|
|
84
84
|
*/
|
|
85
85
|
updateById?<IdType>(modelClass: Class<Entity>, id: IdType, data: EntityData, options?: Options): Promise<boolean>;
|
|
86
86
|
/**
|
|
87
87
|
* Replace an entity by id
|
|
88
|
-
* @param modelClass The model class
|
|
89
|
-
* @param id The entity id value
|
|
90
|
-
* @param data The data attributes to be updated
|
|
91
|
-
* @param options Options for the operation
|
|
88
|
+
* @param modelClass - The model class
|
|
89
|
+
* @param id - The entity id value
|
|
90
|
+
* @param data - The data attributes to be updated
|
|
91
|
+
* @param options - Options for the operation
|
|
92
92
|
* @returns Promise<true> if an entity is replaced for the id, otherwise
|
|
93
93
|
* Promise<false>
|
|
94
94
|
*/
|
|
95
95
|
replaceById?<IdType>(modelClass: Class<Entity>, id: IdType, data: EntityData, options?: Options): Promise<boolean>;
|
|
96
96
|
/**
|
|
97
97
|
* Delete matching entities
|
|
98
|
-
* @param modelClass The model class
|
|
99
|
-
* @param where The matching criteria
|
|
100
|
-
* @param options Options for the operation
|
|
98
|
+
* @param modelClass - The model class
|
|
99
|
+
* @param where - The matching criteria
|
|
100
|
+
* @param options - Options for the operation
|
|
101
101
|
* @returns A promise of number of matching entities deleted
|
|
102
102
|
*/
|
|
103
|
-
deleteAll(modelClass: Class<Entity>, where?: Where
|
|
103
|
+
deleteAll(modelClass: Class<Entity>, where?: Where<Entity>, options?: Options): Promise<Count>;
|
|
104
104
|
/**
|
|
105
105
|
* Delete an entity by id
|
|
106
|
-
* @param modelClass The model class
|
|
107
|
-
* @param id The entity id value
|
|
108
|
-
* @param options Options for the operation
|
|
106
|
+
* @param modelClass - The model class
|
|
107
|
+
* @param id - The entity id value
|
|
108
|
+
* @param options - Options for the operation
|
|
109
109
|
* @returns Promise<true> if an entity is deleted for the id, otherwise
|
|
110
110
|
* Promise<false>
|
|
111
111
|
*/
|
|
112
112
|
deleteById?<IdType>(modelClass: Class<Entity>, id: IdType, options?: Options): Promise<boolean>;
|
|
113
113
|
/**
|
|
114
114
|
* Count matching entities
|
|
115
|
-
* @param modelClass The model class
|
|
116
|
-
* @param where The matching criteria
|
|
117
|
-
* @param options Options for the operation
|
|
115
|
+
* @param modelClass - The model class
|
|
116
|
+
* @param where - The matching criteria
|
|
117
|
+
* @param options - Options for the operation
|
|
118
118
|
* @returns A promise of number of matching entities
|
|
119
119
|
*/
|
|
120
|
-
count(modelClass: Class<Entity>, where?: Where
|
|
120
|
+
count(modelClass: Class<Entity>, where?: Where<Entity>, options?: Options): Promise<Count>;
|
|
121
121
|
/**
|
|
122
122
|
* Check if an entity exists for the id
|
|
123
|
-
* @param modelClass The model class
|
|
124
|
-
* @param id The entity id value
|
|
125
|
-
* @param options Options for the operation
|
|
123
|
+
* @param modelClass - The model class
|
|
124
|
+
* @param id - The entity id value
|
|
125
|
+
* @param options - Options for the operation
|
|
126
126
|
* @returns Promise<true> if an entity exists for the id, otherwise
|
|
127
127
|
* Promise<false>
|
|
128
128
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp.
|
|
2
|
+
// Copyright IBM Corp. 2018,2020. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/repository
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=crud.connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crud.connector.js","sourceRoot":"","sources":["../../src/connectors/crud.connector.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright IBM Corp. 2018,2020. 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
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./connector"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./crud.connector"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./kv.connector"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connectors/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,2DAA4B;AAC5B,gEAAiC;AACjC,8DAA+B"}
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
+
import { Filter } from '@loopback/filter';
|
|
2
|
+
import { Class, Options } from '../common-types';
|
|
3
|
+
import { Entity, EntityData } from '../model';
|
|
1
4
|
import { Connector } from './connector';
|
|
2
|
-
import { Entity, EntityData } from './model';
|
|
3
|
-
import { Class, Options } from './common-types';
|
|
4
|
-
import { Filter } from './query';
|
|
5
5
|
/**
|
|
6
6
|
* Key/Value operations for connector implementations
|
|
7
7
|
*/
|
|
8
8
|
export interface KVConnector<T extends Entity> extends Connector {
|
|
9
9
|
/**
|
|
10
10
|
* Delete an entry by key
|
|
11
|
-
* @param modelClass Model class
|
|
12
|
-
* @param key Key for the entry
|
|
13
|
-
* @param options Options for the operation
|
|
11
|
+
* @param modelClass - Model class
|
|
12
|
+
* @param key - Key for the entry
|
|
13
|
+
* @param options - Options for the operation
|
|
14
14
|
* @returns Promise<true> if an entry is deleted for the id, otherwise
|
|
15
15
|
* Promise<false>
|
|
16
16
|
*/
|
|
17
17
|
delete(modelClass: Class<Entity>, key: string, options?: Options): Promise<boolean>;
|
|
18
18
|
/**
|
|
19
19
|
* Delete all entries
|
|
20
|
-
* @param modelClass Model class
|
|
21
|
-
* @param options Options for the operation
|
|
20
|
+
* @param modelClass - Model class
|
|
21
|
+
* @param options - Options for the operation
|
|
22
22
|
* @returns A promise of the number of entries deleted
|
|
23
23
|
*/
|
|
24
24
|
deleteAll(modelClass: Class<Entity>, options?: Options): Promise<number>;
|
|
25
25
|
/**
|
|
26
26
|
* Get an entry by key
|
|
27
|
-
* @param modelClass Model class
|
|
28
|
-
* @param key Key for the entry
|
|
29
|
-
* @param options Options for the operation
|
|
27
|
+
* @param modelClass - Model class
|
|
28
|
+
* @param key - Key for the entry
|
|
29
|
+
* @param options - Options for the operation
|
|
30
30
|
* @returns A promise of the entry found for the key
|
|
31
31
|
*/
|
|
32
32
|
get(modelClass: Class<Entity>, key: string, options?: Options): Promise<T>;
|
|
33
33
|
/**
|
|
34
34
|
* Set an entry with key/value
|
|
35
|
-
* @param modelClass Model class
|
|
36
|
-
* @param key Key for the entry
|
|
37
|
-
* @param value Value for the entry
|
|
38
|
-
* @param options Options for the operation
|
|
35
|
+
* @param modelClass - Model class
|
|
36
|
+
* @param key - Key for the entry
|
|
37
|
+
* @param value - Value for the entry
|
|
38
|
+
* @param options - Options for the operation
|
|
39
39
|
* @returns Promise<true> if an entry is set for the key, otherwise
|
|
40
40
|
* Promise<false>
|
|
41
41
|
*/
|
|
42
42
|
set(modelClass: Class<Entity>, key: string, value: EntityData, options?: Options): Promise<boolean>;
|
|
43
43
|
/**
|
|
44
44
|
* Set up ttl for an entry by key
|
|
45
|
-
* @param modelClass Model class
|
|
46
|
-
* @param key Key for the entry
|
|
47
|
-
* @param options Options for the operation
|
|
45
|
+
* @param modelClass - Model class
|
|
46
|
+
* @param key - Key for the entry
|
|
47
|
+
* @param options - Options for the operation
|
|
48
48
|
* @returns Promise<true> if an entry is configured for the key, otherwise
|
|
49
49
|
* Promise<false>
|
|
50
50
|
*/
|
|
51
51
|
expire(modelClass: Class<Entity>, key: string, ttl: number, options?: Options): Promise<boolean>;
|
|
52
52
|
/**
|
|
53
53
|
* Get ttl for an entry by key
|
|
54
|
-
* @param modelClass Model class
|
|
55
|
-
* @param key Key for the entry
|
|
56
|
-
* @param ttl Time to live in millisenconds
|
|
57
|
-
* @param options Options for the operation
|
|
54
|
+
* @param modelClass - Model class
|
|
55
|
+
* @param key - Key for the entry
|
|
56
|
+
* @param ttl - Time to live in millisenconds
|
|
57
|
+
* @param options - Options for the operation
|
|
58
58
|
* @returns A promise of the TTL value
|
|
59
59
|
*/
|
|
60
60
|
ttl?(modelClass: Class<Entity>, key: string, ttl: number, options?: Options): Promise<number>;
|
|
61
61
|
/**
|
|
62
62
|
* Fetch all keys
|
|
63
|
-
* @param modelClass Model class
|
|
64
|
-
* @param key Key for the entry
|
|
65
|
-
* @param options Options for the operation
|
|
63
|
+
* @param modelClass - Model class
|
|
64
|
+
* @param key - Key for the entry
|
|
65
|
+
* @param options - Options for the operation
|
|
66
66
|
* @returns A promise of an array of keys for all entries
|
|
67
67
|
*/
|
|
68
68
|
keys?(modelClass: Class<Entity>, options?: Options): Promise<string[]>;
|
|
69
69
|
/**
|
|
70
70
|
* Get an Iterator for matching keys
|
|
71
|
-
* @param modelClass Model class
|
|
72
|
-
* @param filter Matching filter
|
|
73
|
-
* @param options Options for the operation
|
|
71
|
+
* @param modelClass - Model class
|
|
72
|
+
* @param filter - Matching filter
|
|
73
|
+
* @param options - Options for the operation
|
|
74
74
|
* @returns A promise of an iterator of entries
|
|
75
75
|
*/
|
|
76
76
|
iterateKeys?(modelClass: Class<Entity>, filter?: Filter, options?: Options): Promise<Iterator<T>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp.
|
|
2
|
+
// Copyright IBM Corp. 2018,2020. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/repository
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=kv.connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kv.connector.js","sourceRoot":"","sources":["../../src/connectors/kv.connector.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AnyObject, Options } from './common-types';
|
|
2
|
+
import { Connector } from './connectors';
|
|
3
|
+
/**
|
|
4
|
+
* DataSource denotes a configured connector
|
|
5
|
+
*/
|
|
6
|
+
export interface DataSource {
|
|
7
|
+
name: string;
|
|
8
|
+
connector?: Connector;
|
|
9
|
+
settings: AnyObject;
|
|
10
|
+
[property: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export interface SchemaMigrationOptions extends Options {
|
|
13
|
+
/**
|
|
14
|
+
* When set to 'drop', schema migration will drop existing tables and recreate
|
|
15
|
+
* them from scratch, removing any existing data along the way.
|
|
16
|
+
*
|
|
17
|
+
* When set to 'alter', schema migration will try to preserve current schema
|
|
18
|
+
* and data, and perform a non-destructive incremental update.
|
|
19
|
+
*/
|
|
20
|
+
existingSchema?: 'drop' | 'alter';
|
|
21
|
+
/**
|
|
22
|
+
* List of model names to migrate.
|
|
23
|
+
*
|
|
24
|
+
* By default, all models are migrated.
|
|
25
|
+
*/
|
|
26
|
+
models?: string[];
|
|
27
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2017. All Rights Reserved.
|
|
2
|
+
// Copyright IBM Corp. 2017,2019. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/repository
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource.js","sourceRoot":"","sources":["../src/datasource.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright IBM Corp. 2018,2020. 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
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./metadata"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./model.decorator"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./repository.decorator"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,0DAA2B;AAC3B,iEAAkC;AAClC,sEAAuC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InspectionOptions } from '@loopback/core';
|
|
2
|
+
import { ModelDefinition } from '../model';
|
|
3
|
+
export declare class ModelMetadataHelper {
|
|
4
|
+
/**
|
|
5
|
+
* A utility function to simplify retrieving metadata from a target model and
|
|
6
|
+
* its properties.
|
|
7
|
+
* @param target - The class from which to retrieve metadata.
|
|
8
|
+
* @param options - An options object for the MetadataInspector to customize
|
|
9
|
+
* the output of the metadata retrieval functions.
|
|
10
|
+
*/
|
|
11
|
+
static getModelMetadata(target: Function, options?: InspectionOptions): ModelDefinition | {};
|
|
12
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright IBM Corp. 2017,2020. 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
|
+
exports.ModelMetadataHelper = void 0;
|
|
8
|
+
const core_1 = require("@loopback/core");
|
|
9
|
+
const model_1 = require("../model");
|
|
10
|
+
const relations_1 = require("../relations");
|
|
11
|
+
const model_decorator_1 = require("./model.decorator");
|
|
12
|
+
class ModelMetadataHelper {
|
|
13
|
+
/**
|
|
14
|
+
* A utility function to simplify retrieving metadata from a target model and
|
|
15
|
+
* its properties.
|
|
16
|
+
* @param target - The class from which to retrieve metadata.
|
|
17
|
+
* @param options - An options object for the MetadataInspector to customize
|
|
18
|
+
* the output of the metadata retrieval functions.
|
|
19
|
+
*/
|
|
20
|
+
static getModelMetadata(target, options) {
|
|
21
|
+
const classDef = core_1.MetadataInspector.getClassMetadata(model_decorator_1.MODEL_WITH_PROPERTIES_KEY, target,
|
|
22
|
+
// https://github.com/loopbackio/loopback-next/issues/4721
|
|
23
|
+
// The `target` can be a subclass for a base model
|
|
24
|
+
{ ...options, ownMetadataOnly: true });
|
|
25
|
+
// Return the cached value, if it exists.
|
|
26
|
+
// XXX(kjdelisle): If we're going to support dynamic updates, then this
|
|
27
|
+
// will be problematic in the future, since it will never update.
|
|
28
|
+
if (classDef) {
|
|
29
|
+
return classDef;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const modelMeta = core_1.MetadataInspector.getClassMetadata(model_decorator_1.MODEL_KEY, target, options);
|
|
33
|
+
if (!modelMeta) {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
// sets the metadata to a dedicated key if cached value does not exist
|
|
38
|
+
// set ModelDefinition properties if they don't already exist
|
|
39
|
+
const meta = new model_1.ModelDefinition({ ...modelMeta });
|
|
40
|
+
// set properties lost from creating instance of ModelDefinition
|
|
41
|
+
Object.assign(meta, modelMeta);
|
|
42
|
+
meta.properties = Object.assign(meta.properties, core_1.MetadataInspector.getAllPropertyMetadata(model_decorator_1.MODEL_PROPERTIES_KEY, target.prototype, options));
|
|
43
|
+
meta.relations = Object.assign(meta.relations, core_1.MetadataInspector.getAllPropertyMetadata(relations_1.RELATIONS_KEY, target.prototype, options));
|
|
44
|
+
core_1.MetadataInspector.defineMetadata(model_decorator_1.MODEL_WITH_PROPERTIES_KEY.key, meta, target);
|
|
45
|
+
return meta;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.ModelMetadataHelper = ModelMetadataHelper;
|
|
51
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/decorators/metadata.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,yCAAoE;AACpE,oCAAgE;AAChE,4CAA2C;AAC3C,uDAK2B;AAE3B,MAAa,mBAAmB;IAC9B;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CACrB,MAAgB,EAChB,OAA2B;QAE3B,MAAM,QAAQ,GAAG,wBAAiB,CAAC,gBAAgB,CACjD,2CAAyB,EACzB,MAAM;QACN,0DAA0D;QAC1D,kDAAkD;QAClD,EAAC,GAAG,OAAO,EAAE,eAAe,EAAE,IAAI,EAAC,CACpC,CAAC;QACF,yCAAyC;QACzC,uEAAuE;QACvE,iEAAiE;QACjE,IAAI,QAAQ,EAAE;YACZ,OAAO,QAAQ,CAAC;SACjB;aAAM;YACL,MAAM,SAAS,GAAG,wBAAiB,CAAC,gBAAgB,CAClD,2BAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;YACF,IAAI,CAAC,SAAS,EAAE;gBACd,OAAO,EAAE,CAAC;aACX;iBAAM;gBACL,sEAAsE;gBAEtE,6DAA6D;gBAC7D,MAAM,IAAI,GAAG,IAAI,uBAAe,CAAC,EAAC,GAAG,SAAS,EAAC,CAAC,CAAC;gBAEjD,gEAAgE;gBAChE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;gBAE/B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAChB,IAAI,CAAC,UAAU,EAC5B,wBAAiB,CAAC,sBAAsB,CACtC,sCAAoB,EACpB,MAAM,CAAC,SAAS,EAChB,OAAO,CACR,CACF,CAAC;gBAEF,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CACL,IAAI,CAAC,SAAS,EACrC,wBAAiB,CAAC,sBAAsB,CACtC,yBAAa,EACb,MAAM,CAAC,SAAS,EAChB,OAAO,CACR,CACF,CAAC;gBAEF,wBAAiB,CAAC,cAAc,CAC9B,2CAAyB,CAAC,GAAG,EAC7B,IAAI,EACJ,MAAM,CACP,CAAC;gBACF,OAAO,IAAI,CAAC;aACb;SACF;IACH,CAAC;CACF;AApED,kDAoEC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MetadataAccessor, MetadataMap } from '@loopback/core';
|
|
2
|
+
import { ModelDefinition, ModelDefinitionSyntax, PropertyDefinition, PropertyType } from '../model';
|
|
3
|
+
export declare const MODEL_KEY: MetadataAccessor<Partial<ModelDefinitionSyntax>, ClassDecorator>;
|
|
4
|
+
export declare const MODEL_PROPERTIES_KEY: MetadataAccessor<PropertyDefinition, PropertyDecorator>;
|
|
5
|
+
export declare const MODEL_WITH_PROPERTIES_KEY: MetadataAccessor<ModelDefinition, ClassDecorator>;
|
|
6
|
+
export declare type PropertyMap = MetadataMap<Partial<PropertyDefinition>>;
|
|
7
|
+
/**
|
|
8
|
+
* Decorator for model definitions
|
|
9
|
+
* @param definition
|
|
10
|
+
* @returns A class decorator for `model`
|
|
11
|
+
*/
|
|
12
|
+
export declare function model(definition?: Partial<ModelDefinitionSyntax>): (target: Function & {
|
|
13
|
+
definition?: ModelDefinition;
|
|
14
|
+
}) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Build model definition from decorations
|
|
17
|
+
* @param target - Target model class
|
|
18
|
+
* @param def - Model definition spec
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildModelDefinition(target: Function & {
|
|
21
|
+
definition?: ModelDefinition | undefined;
|
|
22
|
+
}, def?: ModelDefinitionSyntax): ModelDefinition;
|
|
23
|
+
/**
|
|
24
|
+
* Decorator for model properties
|
|
25
|
+
* @param definition
|
|
26
|
+
* @returns A property decorator
|
|
27
|
+
*/
|
|
28
|
+
export declare function property(definition?: Partial<PropertyDefinition>): PropertyDecorator;
|
|
29
|
+
export declare namespace property {
|
|
30
|
+
const ERR_PROP_NOT_ARRAY = "@property.array can only decorate array properties!";
|
|
31
|
+
const ERR_NO_ARGS = "decorator received less than two parameters";
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param itemType - The type of array items.
|
|
35
|
+
* Examples: `number`, `Product`, `() => Order`.
|
|
36
|
+
* @param definition - Optional PropertyDefinition object for additional
|
|
37
|
+
* metadata
|
|
38
|
+
*/
|
|
39
|
+
function array(itemType: PropertyType, definition?: Partial<PropertyDefinition>): (target: object, propertyName: string) => void;
|
|
40
|
+
}
|