aws-service-stack 0.18.421 → 0.18.424
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_examples/controller/local-task-controller.d.ts +17 -0
- package/dist/_examples/controller/local-task-controller.d.ts.map +1 -0
- package/dist/_examples/controller/local-task-controller.js +87 -0
- package/dist/_examples/controller/local-task-controller.js.map +1 -0
- package/dist/_examples/controller/order/order-config.d.ts +7 -0
- package/dist/_examples/controller/order/order-config.d.ts.map +1 -0
- package/dist/_examples/controller/order/order-config.js +54 -0
- package/dist/_examples/controller/order/order-config.js.map +1 -0
- package/dist/_examples/controller/order/order-controller-cron.d.ts +8 -0
- package/dist/_examples/controller/order/order-controller-cron.d.ts.map +1 -0
- package/dist/_examples/controller/order/order-controller-cron.js +58 -0
- package/dist/_examples/controller/order/order-controller-cron.js.map +1 -0
- package/dist/_examples/controller/order/order-controller-streamer.d.ts +7 -0
- package/dist/_examples/controller/order/order-controller-streamer.d.ts.map +1 -0
- package/dist/_examples/controller/order/order-controller-streamer.js +60 -0
- package/dist/_examples/controller/order/order-controller-streamer.js.map +1 -0
- package/dist/_examples/controller/order/order-controller.d.ts +15 -0
- package/dist/_examples/controller/order/order-controller.d.ts.map +1 -0
- package/dist/_examples/controller/order/order-controller.js +121 -0
- package/dist/_examples/controller/order/order-controller.js.map +1 -0
- package/dist/_examples/controller/order/order-cron.d.ts +6 -0
- package/dist/_examples/controller/order/order-cron.d.ts.map +1 -0
- package/dist/_examples/controller/order/order-cron.js +57 -0
- package/dist/_examples/controller/order/order-cron.js.map +1 -0
- package/dist/_examples/controller/order/order-crud.d.ts +5 -0
- package/dist/_examples/controller/order/order-crud.d.ts.map +1 -0
- package/dist/_examples/controller/order/order-crud.js +57 -0
- package/dist/_examples/controller/order/order-crud.js.map +1 -0
- package/dist/_examples/controller/order/order-streamer.d.ts +5 -0
- package/dist/_examples/controller/order/order-streamer.d.ts.map +1 -0
- package/dist/_examples/controller/order/order-streamer.js +57 -0
- package/dist/_examples/controller/order/order-streamer.js.map +1 -0
- package/dist/_examples/controller/order-item/order-item-config.d.ts +7 -0
- package/dist/_examples/controller/order-item/order-item-config.d.ts.map +1 -0
- package/dist/_examples/controller/order-item/order-item-config.js +43 -0
- package/dist/_examples/controller/order-item/order-item-config.js.map +1 -0
- package/dist/_examples/controller/order-item/order-item-controller-streamer.d.ts +7 -0
- package/dist/_examples/controller/order-item/order-item-controller-streamer.d.ts.map +1 -0
- package/dist/_examples/controller/order-item/order-item-controller-streamer.js +60 -0
- package/dist/_examples/controller/order-item/order-item-controller-streamer.js.map +1 -0
- package/dist/_examples/controller/order-item/order-item-controller.d.ts +12 -0
- package/dist/_examples/controller/order-item/order-item-controller.d.ts.map +1 -0
- package/dist/_examples/controller/order-item/order-item-controller.js +78 -0
- package/dist/_examples/controller/order-item/order-item-controller.js.map +1 -0
- package/dist/_examples/controller/order-item/order-item-crud.d.ts +5 -0
- package/dist/_examples/controller/order-item/order-item-crud.d.ts.map +1 -0
- package/dist/_examples/controller/order-item/order-item-crud.js +57 -0
- package/dist/_examples/controller/order-item/order-item-crud.js.map +1 -0
- package/dist/_examples/controller/order-item/order-item-streamer.d.ts +5 -0
- package/dist/_examples/controller/order-item/order-item-streamer.d.ts.map +1 -0
- package/dist/_examples/controller/order-item/order-item-streamer.js +57 -0
- package/dist/_examples/controller/order-item/order-item-streamer.js.map +1 -0
- package/dist/_examples/controller/profile/profile-crud-simple.d.ts +1 -0
- package/dist/_examples/controller/profile/profile-crud-simple.d.ts.map +1 -0
- package/dist/_examples/controller/profile/profile-crud.d.ts +2 -1
- package/dist/_examples/controller/profile/profile-crud.d.ts.map +1 -0
- package/dist/_examples/controller/profile/profile.config.d.ts +1 -0
- package/dist/_examples/controller/profile/profile.config.d.ts.map +1 -0
- package/dist/_examples/controller/profile/profile.config.js +20 -45
- package/dist/_examples/controller/profile/profile.config.js.map +1 -1
- package/dist/_examples/controller/profile/profile.controller.d.ts +4 -3
- package/dist/_examples/controller/profile/profile.controller.d.ts.map +1 -0
- package/dist/_examples/controller/profile/profile.controller.js +10 -3
- package/dist/_examples/controller/profile/profile.controller.js.map +1 -1
- package/dist/_examples/model-shared/example.model.d.ts +1 -0
- package/dist/_examples/model-shared/example.model.d.ts.map +1 -0
- package/dist/_examples/model-shared/order.model.d.ts +74 -0
- package/dist/_examples/model-shared/order.model.d.ts.map +1 -0
- package/dist/_examples/model-shared/order.model.js +12 -0
- package/dist/_examples/model-shared/order.model.js.map +1 -0
- package/dist/_examples/repositories/order/order-db.repo.d.ts +8 -0
- package/dist/_examples/repositories/order/order-db.repo.d.ts.map +1 -0
- package/dist/_examples/repositories/order/order-db.repo.interface.d.ts +5 -0
- package/dist/_examples/repositories/order/order-db.repo.interface.d.ts.map +1 -0
- package/dist/_examples/repositories/order/order-db.repo.interface.js +3 -0
- package/dist/_examples/repositories/order/order-db.repo.interface.js.map +1 -0
- package/dist/_examples/repositories/order/order-db.repo.js +20 -0
- package/dist/_examples/repositories/order/order-db.repo.js.map +1 -0
- package/dist/_examples/repositories/order/order-item-db.repo.d.ts +8 -0
- package/dist/_examples/repositories/order/order-item-db.repo.d.ts.map +1 -0
- package/dist/_examples/repositories/order/order-item-db.repo.interface.d.ts +5 -0
- package/dist/_examples/repositories/order/order-item-db.repo.interface.d.ts.map +1 -0
- package/dist/_examples/repositories/order/order-item-db.repo.interface.js +3 -0
- package/dist/_examples/repositories/order/order-item-db.repo.interface.js.map +1 -0
- package/dist/_examples/repositories/order/order-item-db.repo.js +20 -0
- package/dist/_examples/repositories/order/order-item-db.repo.js.map +1 -0
- package/dist/_examples/repositories/profile/profile-repo-db.d.ts +1 -0
- package/dist/_examples/repositories/profile/profile-repo-db.d.ts.map +1 -0
- package/dist/_examples/repositories/profile/profile-repo-db.interface.d.ts +1 -0
- package/dist/_examples/repositories/profile/profile-repo-db.interface.d.ts.map +1 -0
- package/dist/_examples/service/order/order-item-service-stream.d.ts +13 -0
- package/dist/_examples/service/order/order-item-service-stream.d.ts.map +1 -0
- package/dist/_examples/service/order/order-item-service-stream.interface.d.ts +5 -0
- package/dist/_examples/service/order/order-item-service-stream.interface.d.ts.map +1 -0
- package/dist/_examples/service/order/order-item-service-stream.interface.js +3 -0
- package/dist/_examples/service/order/order-item-service-stream.interface.js.map +1 -0
- package/dist/_examples/service/order/order-item-service-stream.js +81 -0
- package/dist/_examples/service/order/order-item-service-stream.js.map +1 -0
- package/dist/_examples/service/order/order-item-service.d.ts +16 -0
- package/dist/_examples/service/order/order-item-service.d.ts.map +1 -0
- package/dist/_examples/service/order/order-item-service.interface.d.ts +14 -0
- package/dist/_examples/service/order/order-item-service.interface.d.ts.map +1 -0
- package/dist/_examples/service/order/order-item-service.interface.js +3 -0
- package/dist/_examples/service/order/order-item-service.interface.js.map +1 -0
- package/dist/_examples/service/order/order-item-service.js +120 -0
- package/dist/_examples/service/order/order-item-service.js.map +1 -0
- package/dist/_examples/service/order/order-service-stream.d.ts +12 -0
- package/dist/_examples/service/order/order-service-stream.d.ts.map +1 -0
- package/dist/_examples/service/order/order-service-stream.interface.d.ts +5 -0
- package/dist/_examples/service/order/order-service-stream.interface.d.ts.map +1 -0
- package/dist/_examples/service/order/order-service-stream.interface.js +3 -0
- package/dist/_examples/service/order/order-service-stream.interface.js.map +1 -0
- package/dist/_examples/service/order/order-service-stream.js +80 -0
- package/dist/_examples/service/order/order-service-stream.js.map +1 -0
- package/dist/_examples/service/order/order-service.d.ts +19 -0
- package/dist/_examples/service/order/order-service.d.ts.map +1 -0
- package/dist/_examples/service/order/order-service.interface.d.ts +14 -0
- package/dist/_examples/service/order/order-service.interface.d.ts.map +1 -0
- package/dist/_examples/service/order/order-service.interface.js +3 -0
- package/dist/_examples/service/order/order-service.interface.js.map +1 -0
- package/dist/_examples/service/order/order-service.js +127 -0
- package/dist/_examples/service/order/order-service.js.map +1 -0
- package/dist/_examples/service/profile-service.d.ts +3 -3
- package/dist/_examples/service/profile-service.d.ts.map +1 -0
- package/dist/_examples/service/profile-service.interface.d.ts +2 -1
- package/dist/_examples/service/profile-service.interface.d.ts.map +1 -0
- package/dist/_examples/service/profile-service.interface.js.map +1 -1
- package/dist/_examples/service/profile-service.js +14 -14
- package/dist/_examples/service/profile-service.js.map +1 -1
- package/dist/controller/base-controller.d.ts +1 -0
- package/dist/controller/base-controller.d.ts.map +1 -0
- package/dist/controller/base-controller.js +14 -13
- package/dist/controller/base-controller.js.map +1 -1
- package/dist/controller/controller-api.d.ts +1 -0
- package/dist/controller/controller-api.d.ts.map +1 -0
- package/dist/controller/controller-api.js +14 -14
- package/dist/controller/controller-api.js.map +1 -1
- package/dist/controller/controller-request.d.ts +1 -0
- package/dist/controller/controller-request.d.ts.map +1 -0
- package/dist/controller/controller-request.js +2 -2
- package/dist/controller/controller-request.js.map +1 -1
- package/dist/controller/controller-role.d.ts +1 -0
- package/dist/controller/controller-role.d.ts.map +1 -0
- package/dist/controller/controller-role.js +7 -5
- package/dist/controller/controller-role.js.map +1 -1
- package/dist/controller/controller-stream.d.ts +1 -0
- package/dist/controller/controller-stream.d.ts.map +1 -0
- package/dist/controller/index.d.ts +1 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/exception/errors.d.ts +28 -11
- package/dist/exception/errors.d.ts.map +1 -0
- package/dist/exception/errors.js +35 -8
- package/dist/exception/errors.js.map +1 -1
- package/dist/exception/exception-handler.d.ts +6 -0
- package/dist/exception/exception-handler.d.ts.map +1 -0
- package/dist/exception/exception-handler.js +3 -1
- package/dist/exception/exception-handler.js.map +1 -1
- package/dist/exception/index.d.ts +1 -0
- package/dist/exception/index.d.ts.map +1 -0
- package/dist/function/cognito/cognito.function.d.ts +1 -0
- package/dist/function/cognito/cognito.function.d.ts.map +1 -0
- package/dist/function/cognito/index.d.ts +1 -0
- package/dist/function/cognito/index.d.ts.map +1 -0
- package/dist/function/index.d.ts +1 -0
- package/dist/function/index.d.ts.map +1 -0
- package/dist/function/logger.d.ts +1 -0
- package/dist/function/logger.d.ts.map +1 -0
- package/dist/function/s3/index.d.ts +1 -0
- package/dist/function/s3/index.d.ts.map +1 -0
- package/dist/function/s3/s3.function.d.ts +1 -0
- package/dist/function/s3/s3.function.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/model/base.config.d.ts +1 -0
- package/dist/model/base.config.d.ts.map +1 -0
- package/dist/model/base.model.d.ts +1 -0
- package/dist/model/base.model.d.ts.map +1 -0
- package/dist/model/cognito-user.model.d.ts +1 -0
- package/dist/model/cognito-user.model.d.ts.map +1 -0
- package/dist/model/dynamodb.model.d.ts +1 -0
- package/dist/model/dynamodb.model.d.ts.map +1 -0
- package/dist/model/filter.model.d.ts +2 -0
- package/dist/model/filter.model.d.ts.map +1 -0
- package/dist/model/filter.model.js.map +1 -1
- package/dist/model/http.model.d.ts +1 -0
- package/dist/model/http.model.d.ts.map +1 -0
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/role.model.d.ts +1 -0
- package/dist/model/role.model.d.ts.map +1 -0
- package/dist/model/validation.model.d.ts +1 -0
- package/dist/model/validation.model.d.ts.map +1 -0
- package/dist/provider/apigateway.d.ts +1 -0
- package/dist/provider/apigateway.d.ts.map +1 -0
- package/dist/provider/dynamodb.d.ts +1 -0
- package/dist/provider/dynamodb.d.ts.map +1 -0
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/opensearch.d.ts +1 -0
- package/dist/provider/opensearch.d.ts.map +1 -0
- package/dist/repositories/base-core.repo.interface.d.ts +10 -4
- package/dist/repositories/base-core.repo.interface.d.ts.map +1 -0
- package/dist/repositories/base-core.repo.interface.js.map +1 -1
- package/dist/repositories/base-db.repo.d.ts +14 -8
- package/dist/repositories/base-db.repo.d.ts.map +1 -0
- package/dist/repositories/base-db.repo.interface.d.ts +25 -4
- package/dist/repositories/base-db.repo.interface.d.ts.map +1 -0
- package/dist/repositories/base-db.repo.interface.js.map +1 -1
- package/dist/repositories/base-db.repo.js +70 -26
- package/dist/repositories/base-db.repo.js.map +1 -1
- package/dist/repositories/base-es.repo.d.ts +2 -1
- package/dist/repositories/base-es.repo.d.ts.map +1 -0
- package/dist/repositories/base-es.repo.interface.d.ts +1 -0
- package/dist/repositories/base-es.repo.interface.d.ts.map +1 -0
- package/dist/repositories/base-es.repo.js +2 -2
- package/dist/repositories/base-es.repo.js.map +1 -1
- package/dist/repositories/index.d.ts +1 -0
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/service/api.services/api.service.d.ts +1 -0
- package/dist/service/api.services/api.service.d.ts.map +1 -0
- package/dist/service/api.services/api.service.interface.d.ts +1 -0
- package/dist/service/api.services/api.service.interface.d.ts.map +1 -0
- package/dist/service/api.services/index.d.ts +1 -0
- package/dist/service/api.services/index.d.ts.map +1 -0
- package/dist/service/auth.service.d.ts +1 -0
- package/dist/service/auth.service.d.ts.map +1 -0
- package/dist/service/auth.service.interface.d.ts +1 -0
- package/dist/service/auth.service.interface.d.ts.map +1 -0
- package/dist/service/base.service.d.ts +5 -3
- package/dist/service/base.service.d.ts.map +1 -0
- package/dist/service/base.service.interface.d.ts +21 -10
- package/dist/service/base.service.interface.d.ts.map +1 -0
- package/dist/service/base.service.interface.js.map +1 -1
- package/dist/service/base.service.js +14 -11
- package/dist/service/base.service.js.map +1 -1
- package/dist/service/crud-operations.d.ts +103 -0
- package/dist/service/crud-operations.d.ts.map +1 -0
- package/dist/service/crud-operations.js +459 -0
- package/dist/service/crud-operations.js.map +1 -0
- package/dist/service/crud.service.d.ts +12 -18
- package/dist/service/crud.service.d.ts.map +1 -0
- package/dist/service/crud.service.interface.d.ts +55 -13
- package/dist/service/crud.service.interface.d.ts.map +1 -0
- package/dist/service/crud.service.interface.js.map +1 -1
- package/dist/service/crud.service.js +53 -351
- package/dist/service/crud.service.js.map +1 -1
- package/dist/service/index.d.ts +2 -0
- package/dist/service/index.d.ts.map +1 -0
- package/dist/service/index.js +1 -0
- package/dist/service/index.js.map +1 -1
- package/dist/service/key-aws.services.d.ts +1 -0
- package/dist/service/key-aws.services.d.ts.map +1 -0
- package/dist/service/key.services.interface.d.ts +1 -0
- package/dist/service/key.services.interface.d.ts.map +1 -0
- package/dist/service/permission.cache.d.ts +1 -0
- package/dist/service/permission.cache.d.ts.map +1 -0
- package/dist/service/permission.repo.d.ts +1 -0
- package/dist/service/permission.repo.d.ts.map +1 -0
- package/dist/service/permission.service.d.ts +3 -0
- package/dist/service/permission.service.d.ts.map +1 -0
- package/dist/service/permission.service.js +29 -13
- package/dist/service/permission.service.js.map +1 -1
- package/dist/service/socket.service.d.ts +1 -0
- package/dist/service/socket.service.d.ts.map +1 -0
- package/dist/service/socket.service.interface.d.ts +1 -0
- package/dist/service/socket.service.interface.d.ts.map +1 -0
- package/dist/service/stream.service.d.ts +1 -0
- package/dist/service/stream.service.d.ts.map +1 -0
- package/dist/service/stream.service.interface.d.ts +1 -0
- package/dist/service/stream.service.interface.d.ts.map +1 -0
- package/dist/service/validation.service.interface.d.ts +1 -0
- package/dist/service/validation.service.interface.d.ts.map +1 -0
- package/dist/utils/array.util.d.ts +1 -0
- package/dist/utils/array.util.d.ts.map +1 -0
- package/dist/utils/auth.util.d.ts +1 -0
- package/dist/utils/auth.util.d.ts.map +1 -0
- package/dist/utils/data.util.d.ts +1 -0
- package/dist/utils/data.util.d.ts.map +1 -0
- package/dist/utils/date.util.d.ts +1 -0
- package/dist/utils/date.util.d.ts.map +1 -0
- package/dist/utils/dynamodb.utils.d.ts +2 -1
- package/dist/utils/dynamodb.utils.d.ts.map +1 -0
- package/dist/utils/dynamodb.utils.js +105 -30
- package/dist/utils/dynamodb.utils.js.map +1 -1
- package/dist/utils/env.util.d.ts +1 -0
- package/dist/utils/env.util.d.ts.map +1 -0
- package/dist/utils/error.util.d.ts +1 -0
- package/dist/utils/error.util.d.ts.map +1 -0
- package/dist/utils/http/http-request.d.ts +1 -0
- package/dist/utils/http/http-request.d.ts.map +1 -0
- package/dist/utils/http/http.util.d.ts +1 -0
- package/dist/utils/http/http.util.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/json.util.d.ts +1 -0
- package/dist/utils/json.util.d.ts.map +1 -0
- package/dist/utils/opensearch/opensearch.parser.aggs.d.ts +1 -0
- package/dist/utils/opensearch/opensearch.parser.aggs.d.ts.map +1 -0
- package/dist/utils/opensearch/opensearch.parser.d.ts +1 -0
- package/dist/utils/opensearch/opensearch.parser.d.ts.map +1 -0
- package/dist/utils/opensearch/opensearch.parser.keyword.d.ts +1 -0
- package/dist/utils/opensearch/opensearch.parser.keyword.d.ts.map +1 -0
- package/dist/utils/opensearch/opensearch.parser.query.map.d.ts +1 -0
- package/dist/utils/opensearch/opensearch.parser.query.map.d.ts.map +1 -0
- package/dist/utils/opensearch/opensearch.parser.sort.d.ts +1 -0
- package/dist/utils/opensearch/opensearch.parser.sort.d.ts.map +1 -0
- package/dist/utils/opensearch/opensearch.parser.utils.d.ts +1 -0
- package/dist/utils/opensearch/opensearch.parser.utils.d.ts.map +1 -0
- package/dist/utils/opensearch/opensearch.transform.d.ts +1 -0
- package/dist/utils/opensearch/opensearch.transform.d.ts.map +1 -0
- package/dist/utils/opensearch.utils.d.ts +1 -0
- package/dist/utils/opensearch.utils.d.ts.map +1 -0
- package/dist/utils/reflection.util.d.ts +1 -0
- package/dist/utils/reflection.util.d.ts.map +1 -0
- package/dist/utils/reflection.util.js +7 -8
- package/dist/utils/reflection.util.js.map +1 -1
- package/dist/utils/string.util.d.ts +1 -0
- package/dist/utils/string.util.d.ts.map +1 -0
- package/dist/utils/validation.util.d.ts +1 -0
- package/dist/utils/validation.util.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export interface Filter extends Record<string, any> {
|
|
|
8
8
|
searchKeyword?: string;
|
|
9
9
|
rangeFilters?: RangeFilter[];
|
|
10
10
|
lastKey?: string;
|
|
11
|
+
queryCountLimit?: number;
|
|
11
12
|
indexName?: string;
|
|
12
13
|
indexValue?: string;
|
|
13
14
|
indexSortName?: string;
|
|
@@ -75,3 +76,4 @@ export declare enum AggTypeOS {
|
|
|
75
76
|
MIN = "min",
|
|
76
77
|
TREE = "tree"
|
|
77
78
|
}
|
|
79
|
+
//# sourceMappingURL=filter.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.model.d.ts","sourceRoot":"","sources":["../../src/model/filter.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAA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../src/model/filter.model.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"filter.model.js","sourceRoot":"","sources":["../../src/model/filter.model.ts"],"names":[],"mappings":";;;AA+CA,IAAY,eAkBX;AAlBD,WAAY,eAAe;IACzB,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,oCAAiB,CAAA;IACjB,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;IACrB,gDAA6B,CAAA;IAC7B,wCAAqB,CAAA;IACrB,gDAA6B,CAAA;IAC7B,kCAAe,CAAA;AACjB,CAAC,EAlBW,eAAe,+BAAf,eAAe,QAkB1B;AAED,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,wBAAS,CAAA;IACT,wBAAS,CAAA;AACX,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,6BAAS,CAAA;AACX,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,wBAAW,CAAA;IACX,wBAAW,CAAA;IACX,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAPW,SAAS,yBAAT,SAAS,QAOpB","sourcesContent":["import { SortOrder } from \"@chinggis/core\";\n\nexport interface Filter extends Record<string, any> {\n page?: number; // The page number for pagination\n size?: number; // The size of items per page\n sortBy?: string; // The field to sort by\n sort?: SortOrder; // Sorting order, either ascending or descending\n searchBy?: string[]; // The field to search in\n searchKeyword?: string; // The keyword to search for\n rangeFilters?: RangeFilter[]; // The field to apply range filtering on\n lastKey?: string;\n queryCountLimit?: number;\n indexName?: string;\n indexValue?: string;\n indexSortName?: string;\n indexSortValue?: string;\n fieldsInclude?: string[];\n fieldsExclude?: string[];\n urlRaw?: string;\n}\n\nexport type RangeFilter = {\n fieldName: string;\n minValue?: number | Date;\n maxValue?: number | Date;\n minExclude?: boolean;\n maxExclude?: boolean;\n};\n\nexport type NumberRange = {\n gte?: number;\n lte?: number;\n};\n\nexport type DateRange = {\n gte?: string;\n lte?: string;\n};\n\nexport interface BoolQueryOS {\n must: Array<any>;\n must_not: Array<any>;\n filter: Array<any>;\n should: Array<any>;\n minimum_should_match?: number;\n}\n\nexport enum BoolQueryTypeOS {\n eq = \"eq\",\n ne = \"ne\",\n in = \"in\",\n nin = \"nin\",\n gte = \"gte\",\n lte = \"lte\",\n gt = \"gt\",\n lt = \"lt\",\n exists = \"exists\",\n regex = \"regex\",\n prefix = \"prefix\",\n not_prefix = \"not_prefix\",\n contains = \"contains\",\n not_contains = \"not_contains\",\n wildcard = \"wildcard\",\n not_wildcard = \"not_wildcard\",\n fuzzy = \"fuzzy\",\n}\n\nexport enum RangeTypeOS {\n lte = \"lte\",\n gte = \"gte\",\n lt = \"lt\",\n gt = \"gt\",\n}\n\nexport enum SearchOperatorOS {\n AND = \"and\",\n OR = \"or\",\n}\n\nexport enum AggTypeOS {\n TERMS = \"terms\",\n SUM = \"sum\",\n AVG = \"avg\",\n MAX = \"max\",\n MIN = \"min\",\n TREE = \"tree\",\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.model.d.ts","sourceRoot":"","sources":["../../src/model/http.model.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,oBAAY,SAAS;IACnB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,oBAAY,MAAM;IAChB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.model.d.ts","sourceRoot":"","sources":["../../src/model/role.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.model.d.ts","sourceRoot":"","sources":["../../src/model/validation.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,oBAAY,MAAM;IAChB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apigateway.d.ts","sourceRoot":"","sources":["../../src/provider/apigateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAIxF,qBACa,oBAAqB,SAAQ,6BAA6B;;CAMtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.d.ts","sourceRoot":"","sources":["../../src/provider/dynamodb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,qBACa,gBAAiB,SAAQ,cAAc;CAAG"}
|
package/dist/provider/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opensearch.d.ts","sourceRoot":"","sources":["../../src/provider/opensearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAKxD,qBAAa,gBAAiB,SAAQ,MAAM;gBAC9B,IAAI,EAAE,MAAM;CAYzB"}
|
|
@@ -28,12 +28,17 @@ export interface CoreRepo<T extends BaseEntity> {
|
|
|
28
28
|
*/
|
|
29
29
|
findByIds(ids: string[]): Promise<T[]>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Reads a page of entities from the backing query mechanism.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* DynamoDB implementations must treat this as Query-only and reject non-indexed
|
|
34
|
+
* filters. Search implementations may translate the filter into their native
|
|
35
|
+
* search query format.
|
|
36
|
+
*
|
|
37
|
+
* @param filter - Query/search filter.
|
|
38
|
+
* @param debug - When true, logs the generated backing-store query.
|
|
39
|
+
* @returns One page of matching entities.
|
|
35
40
|
*/
|
|
36
|
-
find(filter: Filter): Promise<List<Partial<T>>>;
|
|
41
|
+
find(filter: Filter, debug?: boolean): Promise<List<Partial<T>>>;
|
|
37
42
|
fieldNotExists(fieldName: string, from: number, size: number): Promise<T[]>;
|
|
38
43
|
/**
|
|
39
44
|
* Retrieves the first matching entity based on the specified filter.
|
|
@@ -59,3 +64,4 @@ export interface CoreRepo<T extends BaseEntity> {
|
|
|
59
64
|
*/
|
|
60
65
|
getRaw?(filter: Filter): Promise<any>;
|
|
61
66
|
}
|
|
67
|
+
//# sourceMappingURL=base-core.repo.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-core.repo.interface.d.ts","sourceRoot":"","sources":["../../src/repositories/base-core.repo.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,UAAU;IAC5C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAExC;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAEvC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjE,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAE5E;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAEpD;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAYvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-core.repo.interface.js","sourceRoot":"","sources":["../../src/repositories/base-core.repo.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { List } from \"@chinggis/types\";\nimport { BaseEntity, Filter } from \"@chinggis/core\";\n\n/**\n * Core repository interface defining standard CRUD and query operations.\n * Designed to be implemented for different data sources such as DynamoDB or OpenSearch.\n */\nexport interface CoreRepo<T extends BaseEntity> {\n /**\n * Checks whether an entity with the specified ID exists.\n *\n * @param id - The ID of the entity to check.\n * @returns True if the entity exists; otherwise, false.\n */\n exists(id: string): Promise<boolean>;\n\n /**\n * Retrieves a single entity by its unique identifier.\n *\n * @param id - The ID of the entity to retrieve.\n * @returns The entity if found; otherwise, null.\n */\n findById(id: string): Promise<T | null>;\n\n /**\n * Retrieves multiple entities by their unique identifiers.\n * Returns only the entities that exist (non-existent IDs are ignored).\n *\n * @param ids - An array of entity IDs to retrieve.\n * @returns An array of entities that were found.\n */\n findByIds(ids: string[]): Promise<T[]>;\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"base-core.repo.interface.js","sourceRoot":"","sources":["../../src/repositories/base-core.repo.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { List } from \"@chinggis/types\";\nimport { BaseEntity, Filter } from \"@chinggis/core\";\n\n/**\n * Core repository interface defining standard CRUD and query operations.\n * Designed to be implemented for different data sources such as DynamoDB or OpenSearch.\n */\nexport interface CoreRepo<T extends BaseEntity> {\n /**\n * Checks whether an entity with the specified ID exists.\n *\n * @param id - The ID of the entity to check.\n * @returns True if the entity exists; otherwise, false.\n */\n exists(id: string): Promise<boolean>;\n\n /**\n * Retrieves a single entity by its unique identifier.\n *\n * @param id - The ID of the entity to retrieve.\n * @returns The entity if found; otherwise, null.\n */\n findById(id: string): Promise<T | null>;\n\n /**\n * Retrieves multiple entities by their unique identifiers.\n * Returns only the entities that exist (non-existent IDs are ignored).\n *\n * @param ids - An array of entity IDs to retrieve.\n * @returns An array of entities that were found.\n */\n findByIds(ids: string[]): Promise<T[]>;\n\n /**\n * Reads a page of entities from the backing query mechanism.\n *\n * DynamoDB implementations must treat this as Query-only and reject non-indexed\n * filters. Search implementations may translate the filter into their native\n * search query format.\n *\n * @param filter - Query/search filter.\n * @param debug - When true, logs the generated backing-store query.\n * @returns One page of matching entities.\n */\n find(filter: Filter, debug?: boolean): Promise<List<Partial<T>>>;\n\n fieldNotExists(fieldName: string, from: number, size: number): Promise<T[]>;\n\n /**\n * Retrieves the first matching entity based on the specified filter.\n *\n * @param filter - Filtering criteria.\n * @returns The first matching entity if found; otherwise, null.\n */\n findOne(filter: Filter): Promise<Partial<T> | null>;\n\n /**\n * Counts the total number of entities matching the specified filter.\n * Useful for pagination and statistics.\n *\n * @param filter - Filtering criteria.\n * @returns The number of matching entities.\n */\n count(filter: Filter): Promise<number>;\n\n /**\n * (Optional) Returns the raw response from the data source.\n * Useful for debugging or exposing advanced querying features (e.g., OpenSearch DSL).\n *\n * @param filter - Filtering and query options.\n * @returns A raw result object from the data source.\n */\n getRaw?(filter: Filter): Promise<any>;\n\n /**\n * Adjusts a numeric field in the database by adding or subtracting a specified value.\n * If the field does not exist, it will be initialized to zero before applying the adjustment.\n *\n * @param id - The unique identifier of the item to update.\n * @param fieldName - The name of the numeric field to modify.\n * @param delta - The amount to add (positive) or subtract (negative) from the field.\n * @returns The updated item after the adjustment.\n * @throws Will throw an error if the id is not provided.\n */\n}\n"]}
|
|
@@ -19,8 +19,8 @@ export declare class BaseRepoDBImpl<T extends BaseEntity> implements BaseRepoDB<
|
|
|
19
19
|
deleteMany(ids: string[]): Promise<boolean>;
|
|
20
20
|
findById(id: string): Promise<T>;
|
|
21
21
|
findByIds(ids: string[]): Promise<T[]>;
|
|
22
|
-
find(filter: Filter): Promise<List<Partial<T>>>;
|
|
23
|
-
scan(filter: Filter): Promise<List<Partial<T>>>;
|
|
22
|
+
find(filter: Filter, debug?: boolean): Promise<List<Partial<T>>>;
|
|
23
|
+
scan(filter: Filter, debug?: boolean): Promise<List<Partial<T>>>;
|
|
24
24
|
findOne(filter: Filter): Promise<T>;
|
|
25
25
|
findByIndex(indexName: string, value: string): Promise<List<Partial<T>>>;
|
|
26
26
|
count(filter: Filter): Promise<number>;
|
|
@@ -60,15 +60,21 @@ export declare class BaseRepoDBImpl<T extends BaseEntity> implements BaseRepoDB<
|
|
|
60
60
|
private saveManyTransactional;
|
|
61
61
|
private incrementOrDecrementFieldValue;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @param queryInput - QueryCommandInput or ScanCommandInput
|
|
66
|
-
* @param startKey - Optional start key for pagination
|
|
63
|
+
* Runs repeated Scan requests until enough filtered items are collected, the
|
|
64
|
+
* table ends, or the caller's scan-request limit is reached.
|
|
67
65
|
*/
|
|
68
66
|
private sendCommandDeep;
|
|
69
67
|
/**
|
|
70
|
-
*
|
|
71
|
-
|
|
68
|
+
* Enforces the per-call safety limit for scan pagination.
|
|
69
|
+
*/
|
|
70
|
+
private validateScanQueryCountLimit;
|
|
71
|
+
/**
|
|
72
|
+
* Executes one DynamoDB Query/Scan page and returns DynamoDB's pagination key.
|
|
73
|
+
*/
|
|
74
|
+
private sendCommandPage;
|
|
75
|
+
/**
|
|
76
|
+
* Sends one QueryCommand or ScanCommand after applying table/default limit.
|
|
72
77
|
*/
|
|
73
78
|
private sendCommand;
|
|
74
79
|
}
|
|
80
|
+
//# sourceMappingURL=base-db.repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-db.repo.d.ts","sourceRoot":"","sources":["../../src/repositories/base-db.repo.ts"],"names":[],"mappings":"AAqBA,OAAO,EAEL,UAAU,EAQV,cAAc,EAGd,IAAI,EAML,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIrD,qBAAa,cAAc,CAAC,CAAC,SAAS,UAAU,CAAE,YAAW,UAAU,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuD;IAChF,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAc;IAE3C,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAwCzE,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAI3E,qBAAqB,CACnB,QAAQ,EAAE,MA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pB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;SACjC,EAAE,CAAC;QACJ,MAAM,CAAC,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE;gBAAE,EAAE,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE,EAAE,CAAC;KACvD,GAAG,OAAO,CAAC,OAAO,CAAC;IA8DpB,YAAY;IAIZ,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO;IAK9C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAKpC,WAAW,IAAI,cAAc;YAIf,gBAAgB;YAIhB,uBAAuB;YAgDvB,cAAc;YAwBd,qBAAqB;YAgCrB,8BAA8B;IAgC5C;;;OAGG;YACW,eAAe;IAsF7B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAWnC;;OAEG;YACW,eAAe;IAiB7B;;OAEG;YACW,WAAW;CA4B1B"}
|
|
@@ -142,10 +142,30 @@ export interface BaseRepoDB<T extends BaseEntity> extends CoreRepo<T> {
|
|
|
142
142
|
getIndexMap(): DynamoIndexMap;
|
|
143
143
|
setTable(name: string): boolean;
|
|
144
144
|
getTableName(): string;
|
|
145
|
-
/**
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Executes a DynamoDB Query strictly.
|
|
147
|
+
*
|
|
148
|
+
* The filter must contain `indexName` and `indexValue`. Sort-key fields are
|
|
149
|
+
* converted to key conditions when the selected index has `sortKeyField`.
|
|
150
|
+
* This method never falls back to Scan.
|
|
151
|
+
*
|
|
152
|
+
* @param filter - DynamoDB query filter.
|
|
153
|
+
* @param debug - When true, logs the generated QueryCommand input.
|
|
154
|
+
* @returns One DynamoDB query page.
|
|
155
|
+
*/
|
|
156
|
+
find(filter: Filter, debug?: boolean): Promise<List<Partial<T>>>;
|
|
157
|
+
/**
|
|
158
|
+
* Executes a DynamoDB Scan with optional non-index filters.
|
|
159
|
+
*
|
|
160
|
+
* `queryCountLimit` is required and must be between 1 and 500. It limits how
|
|
161
|
+
* many ScanCommand requests one call may issue while trying to collect up to
|
|
162
|
+
* `size` matching items.
|
|
163
|
+
*
|
|
164
|
+
* @param filter - Scan filter. Must include `queryCountLimit`.
|
|
165
|
+
* @param debug - When true, logs each generated ScanCommand input.
|
|
166
|
+
* @returns Matching items and an optional `lastKey`.
|
|
167
|
+
*/
|
|
168
|
+
scan(filter: Filter, debug?: boolean): Promise<List<Partial<T>>>;
|
|
149
169
|
/**
|
|
150
170
|
* Atomically increments a numeric field. Supports nested map attributes via `nestedFieldSeparator`.
|
|
151
171
|
* Initializes to `0` if the field does not exist. Leaf field must be in `indexMap.numberFields`.
|
|
@@ -175,3 +195,4 @@ export interface BaseRepoDB<T extends BaseEntity> extends CoreRepo<T> {
|
|
|
175
195
|
*/
|
|
176
196
|
decrementValueByField(entityId: string, fieldName: string, value?: number, nestedFieldSeparator?: string): Promise<T>;
|
|
177
197
|
}
|
|
198
|
+
//# sourceMappingURL=base-db.repo.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-db.repo.interface.d.ts","sourceRoot":"","sources":["../../src/repositories/base-db.repo.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnE;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE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AoB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAEtH;;;;;;;;;;;;OAYG;IACH,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACvH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-db.repo.interface.js","sourceRoot":"","sources":["../../src/repositories/base-db.repo.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { DynamoIndexMap, List } from \"../index\";\nimport { CoreRepo } from \"./base-core.repo.interface\";\n\nimport { BaseEntity, Filter } from \"@chinggis/types\";\n\nexport interface BaseRepoDB<T extends BaseEntity> extends CoreRepo<T> {\n /**\n * Saves an entity by either creating it (if it does not exist) or updating it (if it does).\n *\n * @param entity - The entity to save.\n * @returns The saved entity.\n */\n save(entity: Partial<T>): Promise<T>;\n\n /**\n * Saves multiple entities by either creating or updating each one.\n *\n * @param entities - An array of entities to save.\n * @param isTransactional - Optional flag to indicate if the operation should be transactional.\n * @returns An array of saved entities.\n */\n saveMany(entities: Partial<T>[], isTransactional?: boolean): Promise<Partial<T>[]>;\n\n /**\n * Updates an existing entity.\n * Fails if the entity does not exist.\n *\n * @param entity - The entity with updated data.\n * @returns The updated entity.\n */\n update(entity: Partial<T>): Promise<T>;\n\n /**\n * Updates only selected fields of one entity identified by its partition key.\n * Supports nested paths using dot notation (e.g. `author.name`).\n *\n * This is a convenience wrapper over `updateMany` for single-item updates.\n *\n * @param entityId - Partition key value of the entity.\n * @param fields - Field names that should be updated.\n * @returns True if the update request is accepted; otherwise, false.\n */\n updateFields(entity: Partial<T>, fields: string[]): Promise<Partial<T>>;\n\n /**\n * Updates multiple existing entities.\n *\n * If `fieldNames` is **not provided**, the method performs a **batch update**\n * (e.g., using `BatchWriteItem` in DynamoDB, if supported). In this case, entire entities\n * are replaced or merged as a whole.\n *\n * If `fieldNames` **is provided**, each entity is updated individually, and only the\n * specified fields in `fieldNames` will be modified. This approach avoids overwriting\n * the entire entity and is useful for partial updates.\n * Field names support dot notation for nested updates (e.g. `author.name`).\n *\n * Note:\n * - Entities must already exist in the data store.\n * - Batch update is not truly atomic; some partial updates may occur if errors happen mid-way.\n * - If partial field updates are needed, `fieldNames` must be used.\n *\n * @param entities - An array of entities with partial data to update.\n * @param isTransactional - Optional flag to indicate if the operation should be transactional.\n * @param fields - field names to update\n * @returns An array of successfully updated entities.\n */\n updateMany(entities: Partial<T>[], fields: string[], isTransactional?: boolean): Promise<boolean>;\n\n /**\n * Deletes an entity by its unique identifier.\n *\n * @param id - The ID of the entity to delete.\n * @returns True if the entity was successfully deleted; otherwise, false.\n */\n delete(id: string): Promise<boolean>;\n\n /**\n * Deletes multiple entities by their unique identifiers.\n *\n * @param ids - An array of entity IDs to delete.\n * @returns True if all entities were successfully deleted; otherwise, false.\n */\n deleteMany(ids: string[]): Promise<boolean>;\n\n /**\n * Executes a transactional write operation.\n * DynamoDB typically supports this for atomic operations.\n *\n * @param operations - An array of write operations (create, update, delete) to perform atomically.\n * @returns True if the transaction was successful; otherwise, false.\n */\n transactionWrite(operations: {\n create?: { tableName: string; item: Record<string, any> }[];\n update?: {\n tableName: string;\n key: { id: string };\n updateData: Record<string, any>;\n }[];\n delete?: { tableName: string; key: { id: string } }[];\n }): Promise<boolean>;\n\n /**\n * Executes a transactional read operation.\n * DynamoDB typically supports this for atomic read operations.\n *\n * @param operations - An array of read operations to perform atomically.\n * @returns An array of results from the transaction.\n */\n transactionRead<T>(operations: { id: string; sortKey?: string }[]): Promise<T[]>;\n\n /**\n * (Optional) Executes a transactional write operation.\n * DynamoDB typically only supports this.\n *\n * @param operations - An array of write operations to perform atomically.\n * @returns True if the transaction was successful; otherwise, false.\n */\n transactWrite?(operations: any[]): Promise<boolean>;\n\n /**\n * Deletes one or more fields (attributes) from a DynamoDB item by its partition key.\n *\n * This method uses the `REMOVE` operation of the UpdateExpression to remove specific fields\n * from an existing item in the table. It dynamically constructs the expression and returns\n * the updated item (after removal).\n *\n * @param id - The value of the partition key for the item to update.\n * @param fieldNames - An array of attribute names to be removed from the item.\n * @returns The updated item as a partial object, or `undefined` if no update was performed.\n */\n deleteFields(id: string, fieldNames: string[]): Promise<Partial<T>>;\n\n /**\n * (Optional) Executes a transactional read operation.\n * DynamoDB typically only supports this.\n *\n * @param operations - An array of read operations to perform atomically.\n * @returns An array of results from the transaction.\n */\n transactRead?<TResult = any>(operations: any[]): Promise<TResult[]>;\n\n setIndexMap(value: DynamoIndexMap): boolean;\n\n getIndexMap(): DynamoIndexMap;\n\n setTable(name: string): boolean;\n\n getTableName(): string;\n\n
|
|
1
|
+
{"version":3,"file":"base-db.repo.interface.js","sourceRoot":"","sources":["../../src/repositories/base-db.repo.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { DynamoIndexMap, List } from \"../index\";\nimport { CoreRepo } from \"./base-core.repo.interface\";\n\nimport { BaseEntity, Filter } from \"@chinggis/types\";\n\nexport interface BaseRepoDB<T extends BaseEntity> extends CoreRepo<T> {\n /**\n * Saves an entity by either creating it (if it does not exist) or updating it (if it does).\n *\n * @param entity - The entity to save.\n * @returns The saved entity.\n */\n save(entity: Partial<T>): Promise<T>;\n\n /**\n * Saves multiple entities by either creating or updating each one.\n *\n * @param entities - An array of entities to save.\n * @param isTransactional - Optional flag to indicate if the operation should be transactional.\n * @returns An array of saved entities.\n */\n saveMany(entities: Partial<T>[], isTransactional?: boolean): Promise<Partial<T>[]>;\n\n /**\n * Updates an existing entity.\n * Fails if the entity does not exist.\n *\n * @param entity - The entity with updated data.\n * @returns The updated entity.\n */\n update(entity: Partial<T>): Promise<T>;\n\n /**\n * Updates only selected fields of one entity identified by its partition key.\n * Supports nested paths using dot notation (e.g. `author.name`).\n *\n * This is a convenience wrapper over `updateMany` for single-item updates.\n *\n * @param entityId - Partition key value of the entity.\n * @param fields - Field names that should be updated.\n * @returns True if the update request is accepted; otherwise, false.\n */\n updateFields(entity: Partial<T>, fields: string[]): Promise<Partial<T>>;\n\n /**\n * Updates multiple existing entities.\n *\n * If `fieldNames` is **not provided**, the method performs a **batch update**\n * (e.g., using `BatchWriteItem` in DynamoDB, if supported). In this case, entire entities\n * are replaced or merged as a whole.\n *\n * If `fieldNames` **is provided**, each entity is updated individually, and only the\n * specified fields in `fieldNames` will be modified. This approach avoids overwriting\n * the entire entity and is useful for partial updates.\n * Field names support dot notation for nested updates (e.g. `author.name`).\n *\n * Note:\n * - Entities must already exist in the data store.\n * - Batch update is not truly atomic; some partial updates may occur if errors happen mid-way.\n * - If partial field updates are needed, `fieldNames` must be used.\n *\n * @param entities - An array of entities with partial data to update.\n * @param isTransactional - Optional flag to indicate if the operation should be transactional.\n * @param fields - field names to update\n * @returns An array of successfully updated entities.\n */\n updateMany(entities: Partial<T>[], fields: string[], isTransactional?: boolean): Promise<boolean>;\n\n /**\n * Deletes an entity by its unique identifier.\n *\n * @param id - The ID of the entity to delete.\n * @returns True if the entity was successfully deleted; otherwise, false.\n */\n delete(id: string): Promise<boolean>;\n\n /**\n * Deletes multiple entities by their unique identifiers.\n *\n * @param ids - An array of entity IDs to delete.\n * @returns True if all entities were successfully deleted; otherwise, false.\n */\n deleteMany(ids: string[]): Promise<boolean>;\n\n /**\n * Executes a transactional write operation.\n * DynamoDB typically supports this for atomic operations.\n *\n * @param operations - An array of write operations (create, update, delete) to perform atomically.\n * @returns True if the transaction was successful; otherwise, false.\n */\n transactionWrite(operations: {\n create?: { tableName: string; item: Record<string, any> }[];\n update?: {\n tableName: string;\n key: { id: string };\n updateData: Record<string, any>;\n }[];\n delete?: { tableName: string; key: { id: string } }[];\n }): Promise<boolean>;\n\n /**\n * Executes a transactional read operation.\n * DynamoDB typically supports this for atomic read operations.\n *\n * @param operations - An array of read operations to perform atomically.\n * @returns An array of results from the transaction.\n */\n transactionRead<T>(operations: { id: string; sortKey?: string }[]): Promise<T[]>;\n\n /**\n * (Optional) Executes a transactional write operation.\n * DynamoDB typically only supports this.\n *\n * @param operations - An array of write operations to perform atomically.\n * @returns True if the transaction was successful; otherwise, false.\n */\n transactWrite?(operations: any[]): Promise<boolean>;\n\n /**\n * Deletes one or more fields (attributes) from a DynamoDB item by its partition key.\n *\n * This method uses the `REMOVE` operation of the UpdateExpression to remove specific fields\n * from an existing item in the table. It dynamically constructs the expression and returns\n * the updated item (after removal).\n *\n * @param id - The value of the partition key for the item to update.\n * @param fieldNames - An array of attribute names to be removed from the item.\n * @returns The updated item as a partial object, or `undefined` if no update was performed.\n */\n deleteFields(id: string, fieldNames: string[]): Promise<Partial<T>>;\n\n /**\n * (Optional) Executes a transactional read operation.\n * DynamoDB typically only supports this.\n *\n * @param operations - An array of read operations to perform atomically.\n * @returns An array of results from the transaction.\n */\n transactRead?<TResult = any>(operations: any[]): Promise<TResult[]>;\n\n setIndexMap(value: DynamoIndexMap): boolean;\n\n getIndexMap(): DynamoIndexMap;\n\n setTable(name: string): boolean;\n\n getTableName(): string;\n\n /**\n * Executes a DynamoDB Query strictly.\n *\n * The filter must contain `indexName` and `indexValue`. Sort-key fields are\n * converted to key conditions when the selected index has `sortKeyField`.\n * This method never falls back to Scan.\n *\n * @param filter - DynamoDB query filter.\n * @param debug - When true, logs the generated QueryCommand input.\n * @returns One DynamoDB query page.\n */\n find(filter: Filter, debug?: boolean): Promise<List<Partial<T>>>;\n\n /**\n * Executes a DynamoDB Scan with optional non-index filters.\n *\n * `queryCountLimit` is required and must be between 1 and 500. It limits how\n * many ScanCommand requests one call may issue while trying to collect up to\n * `size` matching items.\n *\n * @param filter - Scan filter. Must include `queryCountLimit`.\n * @param debug - When true, logs each generated ScanCommand input.\n * @returns Matching items and an optional `lastKey`.\n */\n scan(filter: Filter, debug?: boolean): Promise<List<Partial<T>>>;\n\n /**\n * Atomically increments a numeric field. Supports nested map attributes via `nestedFieldSeparator`.\n * Initializes to `0` if the field does not exist. Leaf field must be in `indexMap.numberFields`.\n *\n * @param entityId - Partition key of the item.\n * @param fieldName - Field name or separator-delimited path (e.g. `\"stats.views\"`).\n * @param value - Amount to increment. Defaults to `1`. Must be positive.\n * @param nestedFieldSeparator - If provided, splits `fieldName` into a nested path.\n *\n * @example\n * repo.incrementValueByField(id, \"views\");\n * repo.incrementValueByField(id, \"stats.monthly.views\", 5, \".\");\n */\n incrementValueByField(entityId: string, fieldName: string, value?: number, nestedFieldSeparator?: string): Promise<T>;\n\n /**\n * Atomically decrements a numeric field. Supports nested map attributes via `nestedFieldSeparator`.\n * Initializes to `0` if the field does not exist. Leaf field must be in `indexMap.numberFields`.\n *\n * @param entityId - Partition key of the item.\n * @param fieldName - Field name or separator-delimited path (e.g. `\"stats.stock\"`).\n * @param value - Amount to decrement. Defaults to `-1`. Must be negative.\n * @param nestedFieldSeparator - If provided, splits `fieldName` into a nested path.\n *\n * @example\n * repo.decrementValueByField(id, \"stock\");\n * repo.decrementValueByField(id, \"stats.monthly.stock\", -3, \".\");\n */\n decrementValueByField(entityId: string, fieldName: string, value?: number, nestedFieldSeparator?: string): Promise<T>;\n}\n"]}
|
|
@@ -256,7 +256,7 @@ class BaseRepoDBImpl {
|
|
|
256
256
|
}
|
|
257
257
|
return items;
|
|
258
258
|
}
|
|
259
|
-
async find(filter) {
|
|
259
|
+
async find(filter, debug) {
|
|
260
260
|
if (!filter)
|
|
261
261
|
filter = { size: this.DYNAMO_QUERY_LIMIT };
|
|
262
262
|
// Enforce Query-only: require indexName & indexValue; otherwise instruct the caller to use scan
|
|
@@ -269,16 +269,17 @@ class BaseRepoDBImpl {
|
|
|
269
269
|
filterCondition: (0, index_1.buildDynamoDBFilterConditions)(filter, this._indexMap),
|
|
270
270
|
indexMap: this._indexMap,
|
|
271
271
|
});
|
|
272
|
-
const response = await this.
|
|
272
|
+
const response = await this.sendCommandPage(dbQuery, filter?.lastKey, debug);
|
|
273
273
|
const fieldsRemoved = (0, index_1.removeFields)(response?.items, filter.fieldsInclude, filter.fieldsExclude);
|
|
274
274
|
return { items: fieldsRemoved, lastKey: response?.lastKey };
|
|
275
275
|
}
|
|
276
|
-
async scan(filter) {
|
|
276
|
+
async scan(filter, debug) {
|
|
277
277
|
if (!filter)
|
|
278
278
|
filter = { size: this.DYNAMO_QUERY_LIMIT };
|
|
279
|
+
const queryCountLimit = this.validateScanQueryCountLimit(filter);
|
|
279
280
|
const expression = (0, index_1.buildDynamoDBFilterConditions)(filter, this._indexMap);
|
|
280
281
|
const scanInput = (0, index_1.buildDynamoDBScanCommand)({ tableName: this._tableName, filter, expression });
|
|
281
|
-
const response = await this.sendCommandDeep(scanInput, filter?.lastKey);
|
|
282
|
+
const response = await this.sendCommandDeep(scanInput, filter?.lastKey, queryCountLimit, filter?.size ?? this.DYNAMO_QUERY_LIMIT, debug);
|
|
282
283
|
const fieldsRemoved = (0, index_1.removeFields)(response?.items, filter.fieldsInclude, filter.fieldsExclude);
|
|
283
284
|
return { items: fieldsRemoved, lastKey: response?.lastKey };
|
|
284
285
|
}
|
|
@@ -497,14 +498,12 @@ class BaseRepoDBImpl {
|
|
|
497
498
|
return (0, util_dynamodb_1.unmarshall)(result.Attributes);
|
|
498
499
|
}
|
|
499
500
|
/**
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
* @param queryInput - QueryCommandInput or ScanCommandInput
|
|
503
|
-
* @param startKey - Optional start key for pagination
|
|
501
|
+
* Runs repeated Scan requests until enough filtered items are collected, the
|
|
502
|
+
* table ends, or the caller's scan-request limit is reached.
|
|
504
503
|
*/
|
|
505
|
-
async sendCommandDeep(queryInput, startKey) {
|
|
504
|
+
async sendCommandDeep(queryInput, startKey, queryCountLimit, size = this.DYNAMO_QUERY_LIMIT, debug) {
|
|
506
505
|
const result = { items: [] };
|
|
507
|
-
|
|
506
|
+
let scannedCount = 0;
|
|
508
507
|
let lastEvaluatedKey;
|
|
509
508
|
if (startKey) {
|
|
510
509
|
lastEvaluatedKey =
|
|
@@ -513,52 +512,97 @@ class BaseRepoDBImpl {
|
|
|
513
512
|
: startKey;
|
|
514
513
|
}
|
|
515
514
|
do {
|
|
515
|
+
const remainingQueryCount = queryCountLimit === undefined ? undefined : queryCountLimit - scannedCount;
|
|
516
|
+
if (remainingQueryCount !== undefined && remainingQueryCount <= 0) {
|
|
517
|
+
result.lastKey = lastEvaluatedKey ? (0, index_1.toBase64)(JSON.stringify(lastEvaluatedKey)) : undefined;
|
|
518
|
+
return result;
|
|
519
|
+
}
|
|
516
520
|
const response = await this.sendCommand({
|
|
517
521
|
...queryInput,
|
|
518
522
|
ExclusiveStartKey: lastEvaluatedKey,
|
|
519
|
-
});
|
|
523
|
+
}, debug);
|
|
524
|
+
const responseItems = response.Items ?? [];
|
|
525
|
+
scannedCount++;
|
|
526
|
+
if (result.items.length + responseItems.length > size) {
|
|
527
|
+
const takeCount = size - result.items.length;
|
|
528
|
+
const lastIncludedIndex = takeCount - 1;
|
|
529
|
+
result.items.push(...(0, index_1.unMarshall)(responseItems.slice(0, takeCount)));
|
|
530
|
+
const index = this._indexMap.get(queryInput.IndexName);
|
|
531
|
+
result.lastKey = (0, index_1.generateLastEvaluatedKey)(responseItems[lastIncludedIndex], index?.field ?? this._indexMap.partitionKey, index?.sortKeyField);
|
|
532
|
+
return result;
|
|
533
|
+
}
|
|
520
534
|
// no more items to fetch
|
|
521
535
|
if (response.LastEvaluatedKey == undefined) {
|
|
522
|
-
result?.items.push(...(0, index_1.unMarshall)(
|
|
536
|
+
result?.items.push(...(0, index_1.unMarshall)(responseItems));
|
|
523
537
|
result.lastKey = undefined;
|
|
524
538
|
return result;
|
|
525
539
|
}
|
|
526
|
-
if (
|
|
540
|
+
if (responseItems.length === 0 && response.LastEvaluatedKey) {
|
|
527
541
|
lastEvaluatedKey = response.LastEvaluatedKey;
|
|
542
|
+
if (queryCountLimit !== undefined && scannedCount >= queryCountLimit) {
|
|
543
|
+
result.lastKey = (0, index_1.toBase64)(JSON.stringify(response.LastEvaluatedKey));
|
|
544
|
+
return result;
|
|
545
|
+
}
|
|
528
546
|
continue;
|
|
529
547
|
}
|
|
530
|
-
if (result?.items.length +
|
|
531
|
-
result?.items.push(...(0, index_1.unMarshall)(
|
|
548
|
+
if (result?.items.length + responseItems.length <= size) {
|
|
549
|
+
result?.items.push(...(0, index_1.unMarshall)(responseItems));
|
|
532
550
|
lastEvaluatedKey = response.LastEvaluatedKey;
|
|
533
551
|
if (result?.items.length === size) {
|
|
534
552
|
result.lastKey = (0, index_1.toBase64)(JSON.stringify(response.LastEvaluatedKey));
|
|
535
553
|
return result;
|
|
536
554
|
}
|
|
555
|
+
if (queryCountLimit !== undefined && scannedCount >= queryCountLimit) {
|
|
556
|
+
result.lastKey = (0, index_1.toBase64)(JSON.stringify(response.LastEvaluatedKey));
|
|
557
|
+
return result;
|
|
558
|
+
}
|
|
537
559
|
continue;
|
|
538
560
|
}
|
|
539
|
-
const elementIndex = size - result?.items.length - 1;
|
|
540
|
-
result?.items.push(...(0, index_1.unMarshall)(response.Items.slice(0, elementIndex)));
|
|
541
|
-
const index = this._indexMap.get(queryInput.IndexName);
|
|
542
|
-
result.lastKey = (0, index_1.generateLastEvaluatedKey)(response.Items[elementIndex], index?.field, index?.sortKeyField);
|
|
543
|
-
break;
|
|
544
561
|
} while (lastEvaluatedKey);
|
|
545
562
|
return result;
|
|
546
563
|
}
|
|
547
564
|
/**
|
|
548
|
-
*
|
|
549
|
-
|
|
565
|
+
* Enforces the per-call safety limit for scan pagination.
|
|
566
|
+
*/
|
|
567
|
+
validateScanQueryCountLimit(filter) {
|
|
568
|
+
const value = Number(filter.queryCountLimit);
|
|
569
|
+
if (!Number.isInteger(value) || value <= 0) {
|
|
570
|
+
throw new errors_1.ErrorDynamoDB(this._tableName, "scan", "scan requires queryCountLimit");
|
|
571
|
+
}
|
|
572
|
+
if (value > 500) {
|
|
573
|
+
throw new errors_1.ErrorDynamoDB(this._tableName, "scan", "scan queryCountLimit must not be greater than 500");
|
|
574
|
+
}
|
|
575
|
+
return value;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Executes one DynamoDB Query/Scan page and returns DynamoDB's pagination key.
|
|
579
|
+
*/
|
|
580
|
+
async sendCommandPage(queryInput, startKey, debug) {
|
|
581
|
+
if (startKey) {
|
|
582
|
+
queryInput.ExclusiveStartKey =
|
|
583
|
+
typeof startKey === "string" ? (0, index_1.parseLastEvaluatedKey)(startKey) : startKey;
|
|
584
|
+
}
|
|
585
|
+
const response = await this.sendCommand(queryInput, debug);
|
|
586
|
+
return {
|
|
587
|
+
items: (0, index_1.unMarshall)(response.Items),
|
|
588
|
+
lastKey: response.LastEvaluatedKey ? (0, index_1.toBase64)(JSON.stringify(response.LastEvaluatedKey)) : undefined,
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Sends one QueryCommand or ScanCommand after applying table/default limit.
|
|
550
593
|
*/
|
|
551
|
-
async sendCommand(commandInput) {
|
|
594
|
+
async sendCommand(commandInput, debug) {
|
|
552
595
|
commandInput.TableName = this._tableName;
|
|
553
596
|
// if (startKey) {
|
|
554
597
|
// commandInput.ExclusiveStartKey = typeof startKey === "string" ? parseLastEvaluatedKey(startKey) : startKey;
|
|
555
598
|
// }
|
|
556
|
-
|
|
599
|
+
const isQuery = "KeyConditionExpression" in commandInput;
|
|
600
|
+
if (isQuery && !commandInput.Limit) {
|
|
557
601
|
commandInput.Limit = this.DYNAMO_QUERY_LIMIT;
|
|
558
602
|
}
|
|
559
|
-
const isQuery = "KeyConditionExpression" in commandInput;
|
|
560
603
|
const command = isQuery ? new client_dynamodb_1.QueryCommand(commandInput) : new client_dynamodb_1.ScanCommand(commandInput);
|
|
561
|
-
|
|
604
|
+
if (debug)
|
|
605
|
+
log.debug("Sending command:", commandInput);
|
|
562
606
|
if (!this.dynamoDb)
|
|
563
607
|
throw new errors_1.ErrorDynamoDB(this._tableName, commandInput, "dynamoDB client not initialized");
|
|
564
608
|
try {
|