@mrxsys/mrx-core 2.8.0 → 2.9.0-1-and-259-20250918
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/chunk-00s6t4tw.js +26 -0
- package/dist/{chunk-sepwfqdh.js → chunk-0601exyg.js} +2 -1
- package/dist/chunk-4mvsje21.js +7 -0
- package/dist/chunk-547mr88s.js +10 -0
- package/dist/chunk-5pwb7peq.js +9 -0
- package/dist/{chunk-syhskygx.js → chunk-6g29g0tk.js} +15 -24
- package/dist/{chunk-z1skzn1j.js → chunk-6tqh339a.js} +4 -3
- package/dist/{chunk-m18th1g5.js → chunk-75hgws2d.js} +18 -39
- package/dist/chunk-8y9b2m5a.js +53 -0
- package/dist/chunk-9cgzhc50.js +15 -0
- package/dist/chunk-9dzsj7f2.js +23 -0
- package/dist/{chunk-kv9hms2z.js → chunk-b23dvm2d.js} +2 -1
- package/dist/chunk-b6f6ez2w.js +8 -0
- package/dist/{chunk-zaje5tv4.js → chunk-c9vjf06h.js} +31 -30
- package/dist/chunk-d0p9787v.js +272 -0
- package/dist/{chunk-5qtpggzv.js → chunk-grfyngq0.js} +3 -2
- package/dist/{chunk-4n72ks5x.js → chunk-h4dyeeqg.js} +4 -5
- package/dist/{chunk-9nw6qekv.js → chunk-h9t48r9q.js} +2 -1
- package/dist/{chunk-7g8k2epn.js → chunk-k9dtqf1p.js} +6 -9
- package/dist/{chunk-26brdrbz.js → chunk-kje1qysg.js} +59 -46
- package/dist/{chunk-4mt568fz.js → chunk-m3grz32t.js} +4 -3
- package/dist/{chunk-yvyahr2h.js → chunk-mvrxngm7.js} +2 -1
- package/dist/{chunk-j28jpfv2.js → chunk-n6d9ncnv.js} +2 -1
- package/dist/chunk-ngrxhdkb.js +32 -0
- package/dist/{chunk-79mw7w0g.js → chunk-nvt16s80.js} +2 -1
- package/dist/{chunk-yd82hdxv.js → chunk-w1547qd4.js} +2 -1
- package/dist/chunk-yagxbm1r.js +9 -0
- package/dist/{chunk-snqdnkk7.js → chunk-z9a175mk.js} +4 -3
- package/dist/{chunk-r1kcf1q6.js → chunk-zwrygafm.js} +5 -6
- package/dist/errors/base-error.d.ts +5 -0
- package/dist/errors/enums/index.d.ts +1 -1
- package/dist/errors/enums/index.js +1 -1
- package/dist/errors/http-error.d.ts +11 -0
- package/dist/errors/index.d.ts +2 -2
- package/dist/errors/index.js +3 -3
- package/dist/errors/utils/index.d.ts +1 -0
- package/dist/errors/utils/index.js +16 -0
- package/dist/errors/utils/is-nowarajs-error.ts.d.ts +4 -0
- package/dist/modules/data/data.d.ts +2 -2
- package/dist/modules/data/enums/index.d.ts +1 -1
- package/dist/modules/data/enums/index.js +1 -1
- package/dist/modules/data/index.js +3 -3
- package/dist/modules/data/transformers/{camelCase.d.ts → camel-case.d.ts} +2 -2
- package/dist/modules/data/transformers/index.d.ts +4 -4
- package/dist/modules/data/transformers/index.js +4 -4
- package/dist/modules/data/transformers/{kebabCase.d.ts → kebab-case.d.ts} +2 -2
- package/dist/modules/data/transformers/{pascalCase.d.ts → pascal-case.d.ts} +2 -2
- package/dist/modules/data/transformers/{snakeCase.d.ts → snake-case.d.ts} +2 -2
- package/dist/modules/data/types/index.d.ts +10 -10
- package/dist/modules/data/types/{pascalCase.d.ts → pascal-case.d.ts} +1 -1
- package/dist/modules/data/types/{transformKeysCamelCase.d.ts → transform-keys-camel-case.d.ts} +1 -1
- package/dist/modules/data/types/{transformKeysKebabCase.d.ts → transform-keys-kebab-case.d.ts} +1 -1
- package/dist/modules/data/types/{transformKeysPascalCase.d.ts → transform-keys-pascal-case.d.ts} +1 -1
- package/dist/modules/data/types/{transformKeysSnakeCase.d.ts → transform-keys-snake-case.d.ts} +1 -1
- package/dist/modules/data/types/{transformObjectKeys.d.ts → transform-object-keys.d.ts} +8 -8
- package/dist/modules/database/enums/index.d.ts +2 -2
- package/dist/modules/database/enums/index.js +1 -1
- package/dist/modules/database/events/index.d.ts +2 -2
- package/dist/modules/database/events/{mssqlEventMap.d.ts → mssql-event-map.d.ts} +1 -1
- package/dist/modules/database/events/{tableEventMap.d.ts → table-event-map.d.ts} +1 -1
- package/dist/modules/database/index.js +8 -8
- package/dist/modules/database/mssql.d.ts +3 -3
- package/dist/modules/database/table.d.ts +2 -2
- package/dist/modules/database/types/index.d.ts +3 -3
- package/dist/modules/elysia/cache/cache.d.ts +15 -132
- package/dist/modules/elysia/cache/index.js +8 -6
- package/dist/modules/elysia/cache/types/{cacheOptions.d.ts → cache-options.d.ts} +1 -1
- package/dist/modules/elysia/cache/types/index.d.ts +1 -1
- package/dist/modules/elysia/cache/utils/index.d.ts +1 -1
- package/dist/modules/elysia/cache/utils/index.js +1 -1
- package/dist/modules/elysia/{crudSchema/crudSchema.d.ts → crud/crud-schema.d.ts} +4 -4
- package/dist/modules/elysia/crud/crud.d.ts +34 -42
- package/dist/modules/elysia/crud/index.d.ts +1 -0
- package/dist/modules/elysia/crud/index.js +125 -280
- package/dist/modules/elysia/crud/operations/count.d.ts +258 -0
- package/dist/modules/elysia/crud/operations/delete.d.ts +258 -0
- package/dist/modules/elysia/crud/operations/deleteOne.d.ts +258 -0
- package/dist/modules/elysia/crud/operations/find.d.ts +258 -0
- package/dist/modules/elysia/crud/operations/findOne.d.ts +258 -0
- package/dist/modules/elysia/crud/operations/index.d.ts +8 -0
- package/dist/modules/elysia/crud/operations/index.js +33 -0
- package/dist/modules/elysia/crud/operations/insert.d.ts +258 -0
- package/dist/modules/elysia/crud/operations/update.d.ts +268 -0
- package/dist/modules/elysia/crud/operations/updateOne.d.ts +268 -0
- package/dist/modules/elysia/{crudSchema/types/adaptiveWhereClauseSchema.d.ts → crud/types/adaptive-where-clause-schema.d.ts} +1 -1
- package/dist/modules/elysia/crud/types/count-response-200-schema.d.ts +5 -0
- package/dist/modules/elysia/crud/types/count-schema.d.ts +10 -0
- package/dist/modules/elysia/crud/types/crud-operation-base.d.ts +4 -0
- package/dist/modules/elysia/crud/types/crud-operation-count.d.ts +14 -0
- package/dist/modules/elysia/crud/types/crud-operation-delete-one.d.ts +14 -0
- package/dist/modules/elysia/crud/types/crud-operation-delete.d.ts +14 -0
- package/dist/modules/elysia/crud/types/crud-operation-find-one.d.ts +14 -0
- package/dist/modules/elysia/crud/types/crud-operation-find.d.ts +14 -0
- package/dist/modules/elysia/crud/types/crud-operation-insert.d.ts +14 -0
- package/dist/modules/elysia/crud/types/crud-operation-update-one.d.ts +16 -0
- package/dist/modules/elysia/crud/types/crud-operation-update.d.ts +14 -0
- package/dist/modules/elysia/crud/types/crud-operations.d.ts +19 -0
- package/dist/modules/elysia/crud/types/crud-options.d.ts +44 -0
- package/dist/modules/elysia/crud/types/crud-schema-models-type.d.ts +12 -0
- package/dist/modules/elysia/{crudSchema/types/crudSchemaOptions.d.ts → crud/types/crud-schema-options.d.ts} +1 -1
- package/dist/modules/elysia/crud/types/delete-schema.d.ts +12 -0
- package/dist/modules/elysia/crud/types/filter-schema.d.ts +9 -0
- package/dist/modules/elysia/crud/types/find-schema.d.ts +16 -0
- package/dist/modules/elysia/{crudSchema/utils/createIdParamSchema.d.ts → crud/types/id-param-schema.d.ts} +1 -1
- package/dist/modules/elysia/crud/types/index.d.ts +29 -11
- package/dist/modules/elysia/crud/types/insert-schema.d.ts +11 -0
- package/dist/modules/elysia/{crudSchema/types/orderSchema.d.ts → crud/types/order-schema.d.ts} +1 -1
- package/dist/modules/elysia/crud/types/properties-schema.d.ts +9 -0
- package/dist/modules/elysia/{crudSchema/types/qSchema.d.ts → crud/types/q-schema.d.ts} +1 -1
- package/dist/modules/elysia/crud/types/response-200-schema.d.ts +11 -0
- package/dist/modules/elysia/{crudSchema/types/selectedFieldSchema.d.ts → crud/types/selected-field-schema.d.ts} +1 -1
- package/dist/modules/elysia/crud/types/update-one-schema.d.ts +4 -0
- package/dist/modules/elysia/crud/types/update-schema.d.ts +13 -0
- package/dist/modules/elysia/{crudSchema/utils/createAdaptiveWhereClauseSchema.d.ts → crud/utils/create-adaptive-where-clause-schema.d.ts} +2 -2
- package/dist/modules/elysia/crud/utils/create-count-response-200-schema.d.ts +8 -0
- package/dist/modules/elysia/crud/utils/create-count-schema.d.ts +12 -0
- package/dist/modules/elysia/crud/utils/create-delete-schema.d.ts +12 -0
- package/dist/modules/elysia/{crudSchema/utils/createFiltersSchema.d.ts → crud/utils/create-filters-schema.d.ts} +3 -6
- package/dist/modules/elysia/crud/utils/create-find-schema.d.ts +12 -0
- package/dist/modules/elysia/crud/utils/create-id-param-schema.d.ts +2 -0
- package/dist/modules/elysia/crud/utils/create-insert-schema.d.ts +8 -0
- package/dist/modules/elysia/{crudSchema/utils/createOrderSchema.d.ts → crud/utils/create-order-schema.d.ts} +2 -2
- package/dist/modules/elysia/crud/utils/create-properties-schema.d.ts +12 -0
- package/dist/modules/elysia/{crudSchema/utils/createQSchema.d.ts → crud/utils/create-q-schema.d.ts} +2 -2
- package/dist/modules/elysia/crud/utils/create-response-200-schema.d.ts +3 -0
- package/dist/modules/elysia/{crudSchema/utils/createSelectedFieldsSchema.d.ts → crud/utils/create-selected-fields-schema.d.ts} +2 -2
- package/dist/modules/elysia/crud/utils/create-update-one-schema.d.ts +3 -0
- package/dist/modules/elysia/crud/utils/create-update-schema.d.ts +3 -0
- package/dist/modules/elysia/crud/utils/index.d.ts +16 -0
- package/dist/modules/elysia/{crudSchema → crud}/utils/index.js +7 -4
- package/dist/modules/elysia/{crudSchema/utils/isDateFromElysiaTypeBox.d.ts → crud/utils/is-date-from-elysia-typebox.d.ts} +1 -1
- package/dist/modules/elysia/db-resolver/db-resolver.d.ts +193 -0
- package/dist/modules/elysia/db-resolver/enums/db-resolver-error-keys.d.ts +3 -0
- package/dist/modules/elysia/db-resolver/enums/index.d.ts +1 -0
- package/dist/modules/elysia/{dbResolver → db-resolver}/enums/index.js +1 -1
- package/dist/modules/elysia/db-resolver/index.d.ts +1 -0
- package/dist/modules/elysia/db-resolver/index.js +18 -0
- package/dist/modules/elysia/error/error.d.ts +14 -3
- package/dist/modules/elysia/error/index.js +5 -5
- package/dist/modules/elysia/microservice/microservice.d.ts +17 -14
- package/dist/modules/elysia/rate-limit/enums/index.d.ts +1 -0
- package/dist/modules/elysia/{rateLimit → rate-limit}/enums/index.js +1 -1
- package/dist/modules/elysia/rate-limit/index.d.ts +1 -0
- package/dist/modules/elysia/{rateLimit → rate-limit}/index.js +12 -16
- package/dist/modules/elysia/{rateLimit/rateLimit.d.ts → rate-limit/rate-limit.d.ts} +5 -2
- package/dist/modules/elysia/rate-limit/types/index.d.ts +1 -0
- package/dist/modules/elysia/{rateLimit/types/rateLimitOptions.d.ts → rate-limit/types/rate-limit-options.d.ts} +1 -1
- package/dist/modules/jwt/enums/index.d.ts +2 -2
- package/dist/modules/jwt/enums/index.js +2 -2
- package/dist/modules/jwt/index.js +8 -15
- package/dist/modules/jwt/utils/index.d.ts +1 -1
- package/dist/modules/jwt/utils/index.js +3 -3
- package/dist/modules/kv-store/enums/index.d.ts +1 -0
- package/dist/modules/{kvStore → kv-store}/enums/index.js +1 -1
- package/dist/modules/kv-store/ioredis/index.d.ts +1 -0
- package/dist/modules/{kvStore → kv-store}/ioredis/index.js +7 -17
- package/dist/modules/{kvStore/ioredis/ioredisStore.d.ts → kv-store/ioredis/ioredis-store.d.ts} +1 -1
- package/dist/modules/kv-store/memory/index.d.ts +1 -0
- package/dist/modules/kv-store/memory/index.js +9 -0
- package/dist/modules/{kvStore/memory/memoryStore.d.ts → kv-store/memory/memory-store.d.ts} +1 -1
- package/dist/modules/kv-store/types/index.d.ts +1 -0
- package/dist/modules/logger/enums/index.d.ts +1 -1
- package/dist/modules/logger/enums/index.js +1 -1
- package/dist/modules/logger/enums/logger-error-keys.d.ts +6 -0
- package/dist/modules/logger/events/index.d.ts +1 -1
- package/dist/modules/logger/events/logger-events.d.ts +11 -0
- package/dist/modules/logger/index.js +40 -52
- package/dist/modules/logger/logger.d.ts +172 -172
- package/dist/modules/logger/sinks/console-logger.d.ts +22 -0
- package/dist/modules/logger/sinks/file-logger.d.ts +25 -0
- package/dist/modules/logger/sinks/index.d.ts +2 -0
- package/dist/modules/logger/{strategies → sinks}/index.js +6 -6
- package/dist/modules/logger/types/bodies-intersection.d.ts +2 -0
- package/dist/modules/logger/types/index.d.ts +6 -6
- package/dist/modules/logger/types/log-stream-chunk.d.ts +15 -0
- package/dist/modules/logger/types/{loggerStrategy.d.ts → logger-sink.d.ts} +3 -3
- package/dist/modules/logger/types/sink-body.d.ts +2 -0
- package/dist/modules/logger/types/sink-map.d.ts +2 -0
- package/dist/modules/mailer/enums/index.d.ts +1 -1
- package/dist/modules/mailer/enums/index.js +1 -1
- package/dist/modules/mailer/index.js +5 -8
- package/dist/modules/mailer/smtp.d.ts +1 -1
- package/dist/modules/mailer/types/index.d.ts +3 -3
- package/dist/modules/mailer/types/{smtpOptions.d.ts → smtp-options.d.ts} +2 -2
- package/dist/modules/repository/index.js +6 -6
- package/dist/modules/repository/repository.d.ts +5 -5
- package/dist/modules/repository/types/filter.d.ts +2 -2
- package/dist/modules/repository/types/index.d.ts +6 -6
- package/dist/modules/repository/types/{queryOptionsExtendPagination.d.ts → query-options-extend-pagination.d.ts} +1 -1
- package/dist/modules/repository/types/{queryOptionsExtendStream.d.ts → query-options-extend-stream.d.ts} +1 -1
- package/dist/modules/repository/types/{queryOptions.d.ts → query-options.d.ts} +4 -4
- package/dist/modules/singleton-manager/enums/index.d.ts +1 -0
- package/dist/modules/{singletonManager → singleton-manager}/enums/index.js +1 -1
- package/dist/modules/singleton-manager/enums/singleton-manager-error-keys.d.ts +4 -0
- package/dist/modules/singleton-manager/index.d.ts +1 -0
- package/dist/modules/singleton-manager/index.js +9 -0
- package/dist/modules/{singletonManager/singletonManager.d.ts → singleton-manager/singleton-manager.d.ts} +9 -11
- package/dist/modules/totp/enums/index.d.ts +1 -1
- package/dist/modules/totp/enums/index.js +1 -1
- package/dist/modules/totp/hotp.d.ts +1 -1
- package/dist/modules/totp/index.d.ts +1 -1
- package/dist/modules/totp/index.js +7 -13
- package/dist/modules/totp/{otpAuthUri.d.ts → otp-auth-uri.d.ts} +1 -1
- package/dist/modules/totp/totp.d.ts +2 -2
- package/dist/modules/totp/types/index.d.ts +3 -3
- package/dist/modules/totp/types/{verifyOptions.d.ts → verify-options.d.ts} +1 -1
- package/dist/modules/totp/utils/index.d.ts +5 -5
- package/dist/modules/totp/utils/index.js +7 -12
- package/dist/modules/typed-event-emitter/index.d.ts +1 -0
- package/dist/modules/{typedEventEmitter → typed-event-emitter}/index.js +1 -1
- package/dist/modules/typed-event-emitter/typed-event-emitter.d.ts +221 -0
- package/dist/modules/typed-event-emitter/types/index.d.ts +1 -0
- package/dist/shared/enums/index.d.ts +1 -0
- package/dist/{utils → shared}/enums/index.js +1 -1
- package/dist/shared/types/index.d.ts +3 -0
- package/dist/shared/types/tflatten.d.ts +5 -0
- package/dist/shared/utils/flatten.d.ts +3 -0
- package/dist/{utils → shared/utils}/index.d.ts +2 -1
- package/dist/{utils → shared/utils}/index.js +10 -9
- package/package.json +39 -40
- package/CHANGELOG.md +0 -98
- package/dist/chunk-45gt9273.js +0 -8
- package/dist/chunk-4xs0e8cm.js +0 -9
- package/dist/chunk-683sda6e.js +0 -28
- package/dist/chunk-7jsxw1ts.js +0 -40
- package/dist/chunk-dwfyt1m6.js +0 -6
- package/dist/chunk-g821m8gq.js +0 -77
- package/dist/chunk-hcc6g1fd.js +0 -7
- package/dist/chunk-ncc0m208.js +0 -8
- package/dist/chunk-vknq69e0.js +0 -23
- package/dist/chunk-y78xrx17.js +0 -54
- package/dist/errors/baseError.d.ts +0 -9
- package/dist/errors/httpError.d.ts +0 -14
- package/dist/errors/types/baseErrorOptions.d.ts +0 -15
- package/dist/errors/types/httpErrorOptions.d.ts +0 -13
- package/dist/errors/types/index.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationBaseOptions.d.ts +0 -6
- package/dist/modules/elysia/crud/types/crudOperationCountOptions.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationDeleteOneOptions.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationDeleteOptions.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationFindOneOptions.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationFindOptions.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationInsertOptions.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationUpdateOneOptions.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationUpdateOptions.d.ts +0 -2
- package/dist/modules/elysia/crud/types/crudOperationsOptions.d.ts +0 -18
- package/dist/modules/elysia/crud/types/crudOptions.d.ts +0 -25
- package/dist/modules/elysia/crudSchema/index.d.ts +0 -1
- package/dist/modules/elysia/crudSchema/index.js +0 -11
- package/dist/modules/elysia/crudSchema/types/crudModelsType.d.ts +0 -14
- package/dist/modules/elysia/crudSchema/types/index.d.ts +0 -8
- package/dist/modules/elysia/crudSchema/types/queryOptionsBuilderOptions.d.ts +0 -11
- package/dist/modules/elysia/crudSchema/utils/createCountResponse200Schema.d.ts +0 -11
- package/dist/modules/elysia/crudSchema/utils/createCountSchema.d.ts +0 -16
- package/dist/modules/elysia/crudSchema/utils/createDeleteSchema.d.ts +0 -18
- package/dist/modules/elysia/crudSchema/utils/createFindSchema.d.ts +0 -22
- package/dist/modules/elysia/crudSchema/utils/createInsertSchema.d.ts +0 -8
- package/dist/modules/elysia/crudSchema/utils/createPropertiesSchema.d.ts +0 -12
- package/dist/modules/elysia/crudSchema/utils/createResponse200Schema.d.ts +0 -5
- package/dist/modules/elysia/crudSchema/utils/createUpdateOneSchema.d.ts +0 -4
- package/dist/modules/elysia/crudSchema/utils/createUpdateSchema.d.ts +0 -10
- package/dist/modules/elysia/crudSchema/utils/index.d.ts +0 -15
- package/dist/modules/elysia/dbResolver/dbResolver.d.ts +0 -17
- package/dist/modules/elysia/dbResolver/enums/dbResolverErrorKeys.d.ts +0 -3
- package/dist/modules/elysia/dbResolver/enums/index.d.ts +0 -1
- package/dist/modules/elysia/dbResolver/index.d.ts +0 -1
- package/dist/modules/elysia/dbResolver/index.js +0 -18
- package/dist/modules/elysia/dbResolver/types/dynamicDbOptions.d.ts +0 -7
- package/dist/modules/elysia/dbResolver/types/index.d.ts +0 -1
- package/dist/modules/elysia/rateLimit/enums/index.d.ts +0 -1
- package/dist/modules/elysia/rateLimit/index.d.ts +0 -1
- package/dist/modules/elysia/rateLimit/types/index.d.ts +0 -1
- package/dist/modules/kvStore/enums/index.d.ts +0 -1
- package/dist/modules/kvStore/ioredis/index.d.ts +0 -1
- package/dist/modules/kvStore/memory/index.d.ts +0 -1
- package/dist/modules/kvStore/memory/index.js +0 -9
- package/dist/modules/kvStore/types/index.d.ts +0 -1
- package/dist/modules/kvStore/types/index.js +0 -1
- package/dist/modules/logger/enums/loggerErrorKeys.d.ts +0 -6
- package/dist/modules/logger/events/loggerEvents.d.ts +0 -11
- package/dist/modules/logger/strategies/consoleLogger.d.ts +0 -22
- package/dist/modules/logger/strategies/fileLogger.d.ts +0 -25
- package/dist/modules/logger/strategies/index.d.ts +0 -2
- package/dist/modules/logger/types/bodiesIntersection.d.ts +0 -2
- package/dist/modules/logger/types/logStreamChunk.d.ts +0 -15
- package/dist/modules/logger/types/strategyBody.d.ts +0 -2
- package/dist/modules/logger/types/strategyMap.d.ts +0 -2
- package/dist/modules/singletonManager/enums/index.d.ts +0 -1
- package/dist/modules/singletonManager/enums/singletonManagerErrorKeys.d.ts +0 -4
- package/dist/modules/singletonManager/index.d.ts +0 -1
- package/dist/modules/singletonManager/index.js +0 -9
- package/dist/modules/typedEventEmitter/index.d.ts +0 -1
- package/dist/modules/typedEventEmitter/typedEventEmitter.d.ts +0 -221
- package/dist/modules/typedEventEmitter/types/index.d.ts +0 -1
- package/dist/modules/typedEventEmitter/types/index.js +0 -1
- package/dist/utils/enums/index.d.ts +0 -1
- package/dist/utils/types/index.d.ts +0 -2
- package/dist/utils/types/index.js +0 -1
- package/dist/errors/enums/{httpErrorStatusCodes.d.ts → http-status-codes.d.ts} +0 -0
- package/dist/modules/data/enums/{dataErrorKeys.d.ts → data-error-keys.d.ts} +0 -0
- package/dist/modules/data/types/{camelCase.d.ts → camel-case.d.ts} +0 -0
- package/dist/modules/data/types/{caseTransformer.d.ts → case-transformer.d.ts} +0 -0
- package/dist/modules/data/types/{kebabCase.d.ts → kebab-case.d.ts} +0 -0
- package/dist/modules/data/types/{snakeCase.d.ts → snake-case.d.ts} +0 -0
- package/dist/modules/database/enums/{databaseErrorKeys.d.ts → database-error-keys.d.ts} +15 -15
- package/dist/modules/database/enums/{mssqlErrorCode.d.ts → mssql-error-code.d.ts} +12 -12
- package/dist/modules/database/types/{mssqlDatabaseOption.d.ts → mssql-database-option.d.ts} +0 -0
- package/dist/modules/database/types/{mssqlEventLog.d.ts → mssql-event-log.d.ts} +0 -0
- package/dist/modules/database/types/{queryContext.d.ts → query-context.d.ts} +0 -0
- package/dist/modules/elysia/cache/types/{cacheItem.d.ts → cache-item.d.ts} +0 -0
- package/dist/modules/elysia/cache/utils/{generateCacheKey.d.ts → generate-cache-key.d.ts} +0 -0
- package/dist/modules/elysia/{crudSchema/types/crudSchemaOperations.d.ts → crud/types/crud-schema-operations.d.ts} +0 -0
- package/dist/modules/elysia/{rateLimit/enums/rateLimitErrorKeys.d.ts → rate-limit/enums/rate-limit-error-keys.d.ts} +0 -0
- package/dist/{errors → modules/elysia/rate-limit}/types/index.js +0 -0
- package/dist/modules/jwt/enums/{jwtErrorKeys.d.ts → jwt-error-keys.d.ts} +2 -2
- package/dist/modules/jwt/enums/{parseHumanTimeToSecondsErrorKeys.d.ts → parse-human-time-to-seconds-error-keys.d.ts} +0 -0
- package/dist/modules/jwt/utils/{parseHumanTimeToSeconds.d.ts → parse-human-time-to-seconds.d.ts} +0 -0
- package/dist/modules/{kvStore/enums/kvStoreErrorKeys.d.ts → kv-store/enums/kv-store-error-keys.d.ts} +2 -2
- package/dist/modules/{kvStore/memory/types/memoryStoreEntry.d.ts → kv-store/memory/types/memory-store-entry.d.ts} +0 -0
- package/dist/modules/{elysia/crudSchema → kv-store}/types/index.js +0 -0
- package/dist/modules/{kvStore/types/kvStore.d.ts → kv-store/types/kv-store.d.ts} +0 -0
- package/dist/modules/logger/types/{logLevels.d.ts → log-levels.d.ts} +0 -0
- package/dist/modules/mailer/enums/{mailerErrorKeys.d.ts → mailer-error-keys.d.ts} +1 -1
- package/dist/modules/mailer/types/{smtpCredentials.d.ts → smtp-credentials.d.ts} +0 -0
- package/dist/modules/mailer/types/{smtpPoolOptions.d.ts → smtp-pool-options.d.ts} +0 -0
- package/dist/modules/repository/types/{adaptiveWhereClause.d.ts → adaptive-where-clause.d.ts} +0 -0
- package/dist/modules/repository/types/{orderByItem.d.ts → order-by-item.d.ts} +0 -0
- package/dist/modules/repository/types/{selectedFields.d.ts → selected-fields.d.ts} +0 -0
- package/dist/modules/totp/enums/{totpErrorKeys.d.ts → totp-error-keys.d.ts} +2 -2
- /package/dist/modules/totp/types/{otpAuthUri.d.ts → otp-auth-uri.d.ts} +0 -0
- /package/dist/modules/totp/types/{totpOptions.d.ts → totp-options.d.ts} +0 -0
- /package/dist/modules/totp/utils/{createCounterBuffer.d.ts → create-counter-buffer.d.ts} +0 -0
- /package/dist/modules/totp/utils/{dynamicTruncation.d.ts → dynamic-truncation.d.ts} +0 -0
- /package/dist/modules/totp/utils/{generateHmac.d.ts → generate-hmac.d.ts} +0 -0
- /package/dist/modules/totp/utils/{generateSecretBytes.d.ts → generate-secret-bytes.d.ts} +0 -0
- /package/dist/modules/totp/utils/{timeRemaining.d.ts → time-remaining.d.ts} +0 -0
- /package/dist/modules/{typedEventEmitter/types/eventMap.d.ts → typed-event-emitter/types/event-map.d.ts} +0 -0
- /package/dist/modules/{elysia/dbResolver → typed-event-emitter}/types/index.js +0 -0
- /package/dist/{utils/enums/utilsErrorKeys.d.ts → shared/enums/utils-error-keys.d.ts} +0 -0
- /package/dist/{modules/elysia/rateLimit → shared}/types/index.js +0 -0
- /package/dist/{utils/types/renameKey.d.ts → shared/types/rename-key.d.ts} +0 -0
- /package/dist/{utils/types/streamWithAsyncIterable.d.ts → shared/types/stream-with-async-iterable.d.ts} +0 -0
- /package/dist/{utils → shared/utils}/env.d.ts +0 -0
- /package/dist/{utils/isDateString.d.ts → shared/utils/is-date-string.d.ts} +0 -0
- /package/dist/{utils → shared/utils}/stream.d.ts +0 -0
|
@@ -1,267 +1,92 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
createCountResponse200Schema,
|
|
4
|
+
createCountSchema,
|
|
5
|
+
createDeleteSchema,
|
|
6
|
+
createFindSchema,
|
|
7
|
+
createIdParamSchema,
|
|
8
|
+
createInsertSchema,
|
|
9
|
+
createResponse200Schema,
|
|
10
|
+
createUpdateOneSchema,
|
|
11
|
+
createUpdateSchema
|
|
12
|
+
} from "../../../chunk-kje1qysg.js";
|
|
13
|
+
import"../../../chunk-9dzsj7f2.js";
|
|
6
14
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import"../../../chunk-
|
|
17
|
-
import"../../../chunk-
|
|
18
|
-
import"../../../chunk-
|
|
19
|
-
import"../../../chunk-
|
|
20
|
-
import"../../../chunk-
|
|
21
|
-
import"../../../chunk-
|
|
15
|
+
batchDelete,
|
|
16
|
+
count,
|
|
17
|
+
deleteOne,
|
|
18
|
+
find,
|
|
19
|
+
findOne,
|
|
20
|
+
insert,
|
|
21
|
+
update,
|
|
22
|
+
updateOne
|
|
23
|
+
} from "../../../chunk-d0p9787v.js";
|
|
24
|
+
import"../../../chunk-8y9b2m5a.js";
|
|
25
|
+
import"../../../chunk-ngrxhdkb.js";
|
|
26
|
+
import"../../../chunk-b6f6ez2w.js";
|
|
27
|
+
import"../../../chunk-4mvsje21.js";
|
|
28
|
+
import"../../../chunk-h4dyeeqg.js";
|
|
29
|
+
import"../../../chunk-n6d9ncnv.js";
|
|
30
|
+
import"../../../chunk-75hgws2d.js";
|
|
31
|
+
import"../../../chunk-6g29g0tk.js";
|
|
32
|
+
import"../../../chunk-grfyngq0.js";
|
|
33
|
+
import"../../../chunk-mvrxngm7.js";
|
|
34
|
+
import"../../../chunk-c9vjf06h.js";
|
|
35
|
+
import"../../../chunk-00s6t4tw.js";
|
|
36
|
+
import"../../../chunk-h9t48r9q.js";
|
|
37
|
+
import"../../../chunk-9cgzhc50.js";
|
|
22
38
|
|
|
23
39
|
// source/modules/elysia/crud/crud.ts
|
|
24
|
-
import { Elysia
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
content: data
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
find: {
|
|
51
|
-
method: "POST",
|
|
52
|
-
path: "/search",
|
|
53
|
-
hook: {
|
|
54
|
-
..._requiredHeaderDatabase,
|
|
55
|
-
body: `${tableName}Find`,
|
|
56
|
-
response: `${tableName}Response200`
|
|
57
|
-
},
|
|
58
|
-
handler: async (ctx) => {
|
|
59
|
-
const db = ctx.dynamicDB || ctx.staticDB;
|
|
60
|
-
const body = ctx.body;
|
|
61
|
-
const data = await db.getRepository(tableName).find({
|
|
62
|
-
...body.queryOptions,
|
|
63
|
-
throwIfNoResult: true
|
|
64
|
-
});
|
|
65
|
-
return {
|
|
66
|
-
message: `Found ${data.length} records for ${tableName}`,
|
|
67
|
-
content: data
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
findOne: {
|
|
72
|
-
method: "GET",
|
|
73
|
-
path: "/:id",
|
|
74
|
-
hook: {
|
|
75
|
-
..._requiredHeaderDatabase,
|
|
76
|
-
params: t.Object({
|
|
77
|
-
id: t.Union([
|
|
78
|
-
t.String({
|
|
79
|
-
format: "uuid"
|
|
80
|
-
}),
|
|
81
|
-
t.Number({
|
|
82
|
-
minimum: 1,
|
|
83
|
-
maximum: Number.MAX_SAFE_INTEGER
|
|
84
|
-
})
|
|
85
|
-
])
|
|
86
|
-
}),
|
|
87
|
-
response: `${tableName}Response200`
|
|
88
|
-
},
|
|
89
|
-
handler: async (ctx) => {
|
|
90
|
-
const db = ctx.dynamicDB || ctx.staticDB;
|
|
91
|
-
const { id } = ctx.params;
|
|
92
|
-
const [primaryKey] = db.getTable(tableName).primaryKey;
|
|
93
|
-
const data = await db.getRepository(tableName).find({
|
|
94
|
-
filters: {
|
|
95
|
-
[primaryKey]: id
|
|
96
|
-
},
|
|
97
|
-
throwIfNoResult: true
|
|
98
|
-
});
|
|
99
|
-
return {
|
|
100
|
-
message: `Found record with id ${id} in ${tableName}`,
|
|
101
|
-
content: data
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
count: {
|
|
106
|
-
method: "POST",
|
|
107
|
-
path: "/count",
|
|
108
|
-
hook: {
|
|
109
|
-
..._requiredHeaderDatabase,
|
|
110
|
-
body: `${tableName}Count`,
|
|
111
|
-
response: `${tableName}CountResponse200`
|
|
112
|
-
},
|
|
113
|
-
handler: async (ctx) => {
|
|
114
|
-
const db = ctx.dynamicDB || ctx.staticDB;
|
|
115
|
-
const body = ctx.body;
|
|
116
|
-
const data = await db.getRepository(tableName).count({
|
|
117
|
-
...body.queryOptions,
|
|
118
|
-
throwIfNoResult: true
|
|
119
|
-
});
|
|
120
|
-
return {
|
|
121
|
-
message: `Counted records in ${tableName}`,
|
|
122
|
-
content: data
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
update: {
|
|
127
|
-
method: "PATCH",
|
|
128
|
-
path: "/",
|
|
129
|
-
hook: {
|
|
130
|
-
..._requiredHeaderDatabase,
|
|
131
|
-
body: `${tableName}Update`,
|
|
132
|
-
response: `${tableName}Response200`
|
|
133
|
-
},
|
|
134
|
-
handler: async (ctx) => {
|
|
135
|
-
const db = ctx.dynamicDB || ctx.staticDB;
|
|
136
|
-
const body = ctx.body;
|
|
137
|
-
const data = await db.getRepository(tableName).update(body.data, {
|
|
138
|
-
filters: body.queryOptions.filters,
|
|
139
|
-
selectedFields: body.queryOptions.selectedFields ?? "*",
|
|
140
|
-
throwIfNoResult: true
|
|
141
|
-
});
|
|
142
|
-
return {
|
|
143
|
-
message: data.length === 0 ? `No records updated in ${tableName}` : `Updated records in ${tableName}`,
|
|
144
|
-
content: data
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
updateOne: {
|
|
149
|
-
method: "PATCH",
|
|
150
|
-
path: "/:id",
|
|
151
|
-
hook: {
|
|
152
|
-
..._requiredHeaderDatabase,
|
|
153
|
-
params: t.Object({
|
|
154
|
-
id: t.Union([
|
|
155
|
-
t.String({
|
|
156
|
-
format: "uuid"
|
|
157
|
-
}),
|
|
158
|
-
t.Number({
|
|
159
|
-
minimum: 1,
|
|
160
|
-
maximum: Number.MAX_SAFE_INTEGER
|
|
161
|
-
})
|
|
162
|
-
])
|
|
163
|
-
}),
|
|
164
|
-
body: `${tableName}UpdateOne`,
|
|
165
|
-
response: `${tableName}Response200`
|
|
166
|
-
},
|
|
167
|
-
handler: async (ctx) => {
|
|
168
|
-
const db = ctx.dynamicDB || ctx.staticDB;
|
|
169
|
-
const { id } = ctx.params;
|
|
170
|
-
const body = ctx.body;
|
|
171
|
-
const [primaryKey] = db.getTable(tableName).primaryKey;
|
|
172
|
-
const data = await db.getRepository(tableName).update(body.data, {
|
|
173
|
-
selectedFields: "*",
|
|
174
|
-
filters: {
|
|
175
|
-
[primaryKey]: id
|
|
176
|
-
},
|
|
177
|
-
throwIfNoResult: true
|
|
178
|
-
});
|
|
179
|
-
return {
|
|
180
|
-
message: `Updated record with id ${id} in ${tableName}`,
|
|
181
|
-
content: data
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
delete: {
|
|
186
|
-
method: "DELETE",
|
|
187
|
-
path: "/",
|
|
188
|
-
hook: {
|
|
189
|
-
..._requiredHeaderDatabase,
|
|
190
|
-
body: `${tableName}Delete`,
|
|
191
|
-
response: `${tableName}Response200`
|
|
192
|
-
},
|
|
193
|
-
handler: async (ctx) => {
|
|
194
|
-
const db = ctx.dynamicDB || ctx.staticDB;
|
|
195
|
-
const body = ctx.body;
|
|
196
|
-
const selectedFields = body.queryOptions?.selectedFields ?? "*";
|
|
197
|
-
const data = await db.getRepository(tableName).delete({
|
|
198
|
-
filters: body.queryOptions.filters,
|
|
199
|
-
selectedFields,
|
|
200
|
-
throwIfNoResult: true
|
|
201
|
-
});
|
|
202
|
-
return {
|
|
203
|
-
message: `Deleted records from ${tableName}`,
|
|
204
|
-
content: data
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
deleteOne: {
|
|
209
|
-
method: "DELETE",
|
|
210
|
-
path: "/:id",
|
|
211
|
-
hook: {
|
|
212
|
-
..._requiredHeaderDatabase,
|
|
213
|
-
params: t.Object({
|
|
214
|
-
id: t.Union([
|
|
215
|
-
t.String({
|
|
216
|
-
format: "uuid"
|
|
217
|
-
}),
|
|
218
|
-
t.Number({
|
|
219
|
-
minimum: 1,
|
|
220
|
-
maximum: Number.MAX_SAFE_INTEGER
|
|
221
|
-
})
|
|
222
|
-
])
|
|
223
|
-
}),
|
|
224
|
-
body: `${tableName}DeleteOne`,
|
|
225
|
-
response: `${tableName}Response200`
|
|
226
|
-
},
|
|
227
|
-
handler: async (ctx) => {
|
|
228
|
-
const db = ctx.dynamicDB || ctx.staticDB;
|
|
229
|
-
const { id } = ctx.params;
|
|
230
|
-
const body = ctx.body;
|
|
231
|
-
const selectedFields = body.queryOptions?.selectedFields ?? "*";
|
|
232
|
-
const data = await db.getRepository(tableName).delete({
|
|
233
|
-
filters: body.queryOptions.filters,
|
|
234
|
-
selectedFields,
|
|
235
|
-
throwIfNoResult: true
|
|
236
|
-
});
|
|
237
|
-
return {
|
|
238
|
-
message: `Deleted record with id ${id} from ${tableName}`,
|
|
239
|
-
content: data
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
};
|
|
245
|
-
var _addRoutesByOperations = (tableName, database, operations) => {
|
|
246
|
-
const app = new Elysia;
|
|
247
|
-
const _defaultOperations = _createDefaultOperationsWithHandlers(tableName, database);
|
|
248
|
-
for (const operationKey in operations) {
|
|
249
|
-
const operation = operations[operationKey];
|
|
250
|
-
const defaultOperation = _defaultOperations[operationKey];
|
|
251
|
-
if (!operation || !defaultOperation)
|
|
252
|
-
continue;
|
|
253
|
-
if (typeof operation === "boolean") {
|
|
254
|
-
app.route(defaultOperation.method, defaultOperation.path, (ctx) => defaultOperation.handler(ctx), defaultOperation.hook);
|
|
255
|
-
} else if (typeof operation === "object") {
|
|
256
|
-
const mergedOperation = {
|
|
257
|
-
...defaultOperation,
|
|
258
|
-
...operation
|
|
259
|
-
};
|
|
260
|
-
app.route(mergedOperation.method, mergedOperation.path, (ctx) => defaultOperation.handler(ctx), mergedOperation.hook);
|
|
261
|
-
}
|
|
40
|
+
import { Elysia as Elysia2 } from "elysia";
|
|
41
|
+
|
|
42
|
+
// source/modules/elysia/crud/crud-schema.ts
|
|
43
|
+
import { Elysia } from "elysia";
|
|
44
|
+
var crudSchema = ({
|
|
45
|
+
sourceSchemaName,
|
|
46
|
+
sourceSchema,
|
|
47
|
+
sourceInsertSchema = sourceSchema,
|
|
48
|
+
sourceFindSchema = sourceSchema,
|
|
49
|
+
sourceCountSchema = sourceSchema,
|
|
50
|
+
sourceUpdateSchema = sourceSchema,
|
|
51
|
+
sourceDeleteSchema = sourceSchema,
|
|
52
|
+
sourceResponseSchema = sourceSchema,
|
|
53
|
+
operations = {
|
|
54
|
+
count: true,
|
|
55
|
+
find: true,
|
|
56
|
+
findOne: true,
|
|
57
|
+
insert: true,
|
|
58
|
+
update: true,
|
|
59
|
+
updateOne: true,
|
|
60
|
+
delete: true,
|
|
61
|
+
deleteOne: true
|
|
262
62
|
}
|
|
63
|
+
}) => {
|
|
64
|
+
const models = {};
|
|
65
|
+
if (operations.insert)
|
|
66
|
+
models[`${sourceSchemaName}Insert`] = createInsertSchema(sourceInsertSchema);
|
|
67
|
+
if (operations.find)
|
|
68
|
+
models[`${sourceSchemaName}Find`] = createFindSchema(sourceFindSchema);
|
|
69
|
+
if (operations.count)
|
|
70
|
+
models[`${sourceSchemaName}Count`] = createCountSchema(sourceCountSchema);
|
|
71
|
+
if (operations.update)
|
|
72
|
+
models[`${sourceSchemaName}Update`] = createUpdateSchema(sourceUpdateSchema);
|
|
73
|
+
if (operations.updateOne)
|
|
74
|
+
models[`${sourceSchemaName}UpdateOne`] = createUpdateOneSchema(sourceUpdateSchema);
|
|
75
|
+
if (operations.delete)
|
|
76
|
+
models[`${sourceSchemaName}Delete`] = createDeleteSchema(sourceDeleteSchema);
|
|
77
|
+
if (operations.findOne || operations.updateOne || operations.deleteOne)
|
|
78
|
+
models[`${sourceSchemaName}IdParam`] = createIdParamSchema();
|
|
79
|
+
if (operations.find || operations.findOne || operations.insert || operations.update || operations.updateOne || operations.delete || operations.deleteOne)
|
|
80
|
+
models[`${sourceSchemaName}Response200`] = createResponse200Schema(sourceResponseSchema);
|
|
81
|
+
if (operations.count)
|
|
82
|
+
models[`${sourceSchemaName}CountResponse200`] = createCountResponse200Schema();
|
|
83
|
+
const app = new Elysia({
|
|
84
|
+
name: `crudSchemaPlugin-${sourceSchemaName}`
|
|
85
|
+
}).model(models);
|
|
263
86
|
return app;
|
|
264
87
|
};
|
|
88
|
+
|
|
89
|
+
// source/modules/elysia/crud/crud.ts
|
|
265
90
|
var crud = ({
|
|
266
91
|
database,
|
|
267
92
|
tableName,
|
|
@@ -278,30 +103,50 @@ var crud = ({
|
|
|
278
103
|
},
|
|
279
104
|
tags = [tableName],
|
|
280
105
|
prefix = ""
|
|
281
|
-
}) =>
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
106
|
+
}) => {
|
|
107
|
+
const app = new Elysia2({
|
|
108
|
+
name: `crudPlugin[${tableName}]`,
|
|
109
|
+
tags,
|
|
110
|
+
prefix
|
|
111
|
+
}).use(crudSchema({
|
|
112
|
+
sourceSchemaName: tableName,
|
|
113
|
+
sourceSchema: schema.sourceSchema,
|
|
114
|
+
sourceInsertSchema: schema.sourceInsertSchema || schema.sourceSchema,
|
|
115
|
+
sourceFindSchema: schema.sourceFindSchema || schema.sourceSchema,
|
|
116
|
+
sourceCountSchema: schema.sourceCountSchema || schema.sourceSchema,
|
|
117
|
+
sourceUpdateSchema: schema.sourceUpdateSchema || schema.sourceSchema,
|
|
118
|
+
sourceDeleteSchema: schema.sourceDeleteSchema || schema.sourceSchema,
|
|
119
|
+
sourceResponseSchema: schema.sourceResponseSchema || schema.sourceSchema,
|
|
120
|
+
operations: {
|
|
121
|
+
find: operations.find ? true : false,
|
|
122
|
+
findOne: operations.findOne ? true : false,
|
|
123
|
+
insert: operations.insert ? true : false,
|
|
124
|
+
update: operations.update ? true : false,
|
|
125
|
+
updateOne: operations.updateOne ? true : false,
|
|
126
|
+
delete: operations.delete ? true : false,
|
|
127
|
+
deleteOne: operations.deleteOne ? true : false,
|
|
128
|
+
count: operations.count ? true : false
|
|
129
|
+
}
|
|
130
|
+
}));
|
|
131
|
+
if (operations.insert)
|
|
132
|
+
app.use(insert(database, tableName, operations.insert && typeof operations.insert === "object" ? operations.insert : {}));
|
|
133
|
+
if (operations.find)
|
|
134
|
+
app.use(find(database, tableName, operations.find && typeof operations.find === "object" ? operations.find : {}));
|
|
135
|
+
if (operations.findOne)
|
|
136
|
+
app.use(findOne(database, tableName, operations.findOne && typeof operations.findOne === "object" ? operations.findOne : {}));
|
|
137
|
+
if (operations.update)
|
|
138
|
+
app.use(update(database, tableName, operations.update && typeof operations.update === "object" ? operations.update : {}));
|
|
139
|
+
if (operations.updateOne)
|
|
140
|
+
app.use(updateOne(database, tableName, operations.updateOne && typeof operations.updateOne === "object" ? operations.updateOne : {}));
|
|
141
|
+
if (operations.delete)
|
|
142
|
+
app.use(batchDelete(database, tableName, operations.delete && typeof operations.delete === "object" ? operations.delete : {}));
|
|
143
|
+
if (operations.deleteOne)
|
|
144
|
+
app.use(deleteOne(database, tableName, operations.deleteOne && typeof operations.deleteOne === "object" ? operations.deleteOne : {}));
|
|
145
|
+
if (operations.count)
|
|
146
|
+
app.use(count(database, tableName, operations.count && typeof operations.count === "object" ? operations.count : {}));
|
|
147
|
+
return app;
|
|
148
|
+
};
|
|
305
149
|
export {
|
|
150
|
+
crudSchema,
|
|
306
151
|
crud
|
|
307
152
|
};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import type { TObject } from '@sinclair/typebox/type';
|
|
2
|
+
import { Elysia } from 'elysia';
|
|
3
|
+
import type { MSSQL } from '../../../../modules/database/mssql';
|
|
4
|
+
import type { MSSQLDatabaseOptions } from '../../../../modules/database/types/mssql-database-option';
|
|
5
|
+
import type { CrudOperationCount } from '../../../../modules/elysia/crud/types/crud-operation-count';
|
|
6
|
+
export declare const count: <const TDatabase extends Omit<MSSQLDatabaseOptions, "databaseName"> | string, const TTableName extends string, const THeaderSchema extends TObject, const TSourceCountSchema extends TObject>(database: TDatabase, tableName: TTableName, { hook, method, path }: CrudOperationCount<THeaderSchema, TSourceCountSchema>) => Elysia<"", {
|
|
7
|
+
decorator: {};
|
|
8
|
+
store: {};
|
|
9
|
+
derive: {};
|
|
10
|
+
resolve: {};
|
|
11
|
+
}, {
|
|
12
|
+
typebox: {
|
|
13
|
+
readonly dbResolverHeader: TObject<{
|
|
14
|
+
'database-using': import("@sinclair/typebox").TString;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
error: {};
|
|
18
|
+
}, {
|
|
19
|
+
schema: {};
|
|
20
|
+
standaloneSchema: {};
|
|
21
|
+
macro: {
|
|
22
|
+
readonly injectDynamicDB?: Omit<MSSQLDatabaseOptions, "databaseName">;
|
|
23
|
+
readonly injectStaticDB?: string;
|
|
24
|
+
};
|
|
25
|
+
macroFn: {
|
|
26
|
+
readonly injectDynamicDB: (config: Omit<MSSQLDatabaseOptions, "databaseName">) => {
|
|
27
|
+
readonly headers: "dbResolverHeader";
|
|
28
|
+
readonly resolve: ({ headers }: {
|
|
29
|
+
body: unknown;
|
|
30
|
+
query: Record<string, string>;
|
|
31
|
+
params: Record<string, string>;
|
|
32
|
+
headers: Record<string, string | undefined>;
|
|
33
|
+
cookie: Record<string, import("elysia").Cookie<unknown>>;
|
|
34
|
+
server: import("elysia/universal/server").Server | null;
|
|
35
|
+
redirect: import("elysia").redirect;
|
|
36
|
+
set: {
|
|
37
|
+
headers: import("elysia").HTTPHeaders;
|
|
38
|
+
status?: number | keyof import("elysia").StatusMap;
|
|
39
|
+
redirect?: string;
|
|
40
|
+
cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
|
|
41
|
+
};
|
|
42
|
+
path: string;
|
|
43
|
+
route: string;
|
|
44
|
+
request: Request;
|
|
45
|
+
store: {};
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 100 | 102 | 207 | 208 | 101 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
|
+
readonly 100: "Continue";
|
|
48
|
+
readonly 101: "Switching Protocols";
|
|
49
|
+
readonly 102: "Processing";
|
|
50
|
+
readonly 103: "Early Hints";
|
|
51
|
+
readonly 200: "OK";
|
|
52
|
+
readonly 201: "Created";
|
|
53
|
+
readonly 202: "Accepted";
|
|
54
|
+
readonly 203: "Non-Authoritative Information";
|
|
55
|
+
readonly 204: "No Content";
|
|
56
|
+
readonly 205: "Reset Content";
|
|
57
|
+
readonly 206: "Partial Content";
|
|
58
|
+
readonly 207: "Multi-Status";
|
|
59
|
+
readonly 208: "Already Reported";
|
|
60
|
+
readonly 300: "Multiple Choices";
|
|
61
|
+
readonly 301: "Moved Permanently";
|
|
62
|
+
readonly 302: "Found";
|
|
63
|
+
readonly 303: "See Other";
|
|
64
|
+
readonly 304: "Not Modified";
|
|
65
|
+
readonly 307: "Temporary Redirect";
|
|
66
|
+
readonly 308: "Permanent Redirect";
|
|
67
|
+
readonly 400: "Bad Request";
|
|
68
|
+
readonly 401: "Unauthorized";
|
|
69
|
+
readonly 402: "Payment Required";
|
|
70
|
+
readonly 403: "Forbidden";
|
|
71
|
+
readonly 404: "Not Found";
|
|
72
|
+
readonly 405: "Method Not Allowed";
|
|
73
|
+
readonly 406: "Not Acceptable";
|
|
74
|
+
readonly 407: "Proxy Authentication Required";
|
|
75
|
+
readonly 408: "Request Timeout";
|
|
76
|
+
readonly 409: "Conflict";
|
|
77
|
+
readonly 410: "Gone";
|
|
78
|
+
readonly 411: "Length Required";
|
|
79
|
+
readonly 412: "Precondition Failed";
|
|
80
|
+
readonly 413: "Payload Too Large";
|
|
81
|
+
readonly 414: "URI Too Long";
|
|
82
|
+
readonly 415: "Unsupported Media Type";
|
|
83
|
+
readonly 416: "Range Not Satisfiable";
|
|
84
|
+
readonly 417: "Expectation Failed";
|
|
85
|
+
readonly 418: "I'm a teapot";
|
|
86
|
+
readonly 420: "Enhance Your Calm";
|
|
87
|
+
readonly 421: "Misdirected Request";
|
|
88
|
+
readonly 422: "Unprocessable Content";
|
|
89
|
+
readonly 423: "Locked";
|
|
90
|
+
readonly 424: "Failed Dependency";
|
|
91
|
+
readonly 425: "Too Early";
|
|
92
|
+
readonly 426: "Upgrade Required";
|
|
93
|
+
readonly 428: "Precondition Required";
|
|
94
|
+
readonly 429: "Too Many Requests";
|
|
95
|
+
readonly 431: "Request Header Fields Too Large";
|
|
96
|
+
readonly 451: "Unavailable For Legal Reasons";
|
|
97
|
+
readonly 500: "Internal Server Error";
|
|
98
|
+
readonly 501: "Not Implemented";
|
|
99
|
+
readonly 502: "Bad Gateway";
|
|
100
|
+
readonly 503: "Service Unavailable";
|
|
101
|
+
readonly 504: "Gateway Timeout";
|
|
102
|
+
readonly 505: "HTTP Version Not Supported";
|
|
103
|
+
readonly 506: "Variant Also Negotiates";
|
|
104
|
+
readonly 507: "Insufficient Storage";
|
|
105
|
+
readonly 508: "Loop Detected";
|
|
106
|
+
readonly 510: "Not Extended";
|
|
107
|
+
readonly 511: "Network Authentication Required";
|
|
108
|
+
}[Code] : Code>(code: Code, response?: T) => import("elysia").ElysiaCustomStatusResponse<Code, T, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
|
|
109
|
+
readonly Continue: 100;
|
|
110
|
+
readonly "Switching Protocols": 101;
|
|
111
|
+
readonly Processing: 102;
|
|
112
|
+
readonly "Early Hints": 103;
|
|
113
|
+
readonly OK: 200;
|
|
114
|
+
readonly Created: 201;
|
|
115
|
+
readonly Accepted: 202;
|
|
116
|
+
readonly "Non-Authoritative Information": 203;
|
|
117
|
+
readonly "No Content": 204;
|
|
118
|
+
readonly "Reset Content": 205;
|
|
119
|
+
readonly "Partial Content": 206;
|
|
120
|
+
readonly "Multi-Status": 207;
|
|
121
|
+
readonly "Already Reported": 208;
|
|
122
|
+
readonly "Multiple Choices": 300;
|
|
123
|
+
readonly "Moved Permanently": 301;
|
|
124
|
+
readonly Found: 302;
|
|
125
|
+
readonly "See Other": 303;
|
|
126
|
+
readonly "Not Modified": 304;
|
|
127
|
+
readonly "Temporary Redirect": 307;
|
|
128
|
+
readonly "Permanent Redirect": 308;
|
|
129
|
+
readonly "Bad Request": 400;
|
|
130
|
+
readonly Unauthorized: 401;
|
|
131
|
+
readonly "Payment Required": 402;
|
|
132
|
+
readonly Forbidden: 403;
|
|
133
|
+
readonly "Not Found": 404;
|
|
134
|
+
readonly "Method Not Allowed": 405;
|
|
135
|
+
readonly "Not Acceptable": 406;
|
|
136
|
+
readonly "Proxy Authentication Required": 407;
|
|
137
|
+
readonly "Request Timeout": 408;
|
|
138
|
+
readonly Conflict: 409;
|
|
139
|
+
readonly Gone: 410;
|
|
140
|
+
readonly "Length Required": 411;
|
|
141
|
+
readonly "Precondition Failed": 412;
|
|
142
|
+
readonly "Payload Too Large": 413;
|
|
143
|
+
readonly "URI Too Long": 414;
|
|
144
|
+
readonly "Unsupported Media Type": 415;
|
|
145
|
+
readonly "Range Not Satisfiable": 416;
|
|
146
|
+
readonly "Expectation Failed": 417;
|
|
147
|
+
readonly "I'm a teapot": 418;
|
|
148
|
+
readonly "Enhance Your Calm": 420;
|
|
149
|
+
readonly "Misdirected Request": 421;
|
|
150
|
+
readonly "Unprocessable Content": 422;
|
|
151
|
+
readonly Locked: 423;
|
|
152
|
+
readonly "Failed Dependency": 424;
|
|
153
|
+
readonly "Too Early": 425;
|
|
154
|
+
readonly "Upgrade Required": 426;
|
|
155
|
+
readonly "Precondition Required": 428;
|
|
156
|
+
readonly "Too Many Requests": 429;
|
|
157
|
+
readonly "Request Header Fields Too Large": 431;
|
|
158
|
+
readonly "Unavailable For Legal Reasons": 451;
|
|
159
|
+
readonly "Internal Server Error": 500;
|
|
160
|
+
readonly "Not Implemented": 501;
|
|
161
|
+
readonly "Bad Gateway": 502;
|
|
162
|
+
readonly "Service Unavailable": 503;
|
|
163
|
+
readonly "Gateway Timeout": 504;
|
|
164
|
+
readonly "HTTP Version Not Supported": 505;
|
|
165
|
+
readonly "Variant Also Negotiates": 506;
|
|
166
|
+
readonly "Insufficient Storage": 507;
|
|
167
|
+
readonly "Loop Detected": 508;
|
|
168
|
+
readonly "Not Extended": 510;
|
|
169
|
+
readonly "Network Authentication Required": 511;
|
|
170
|
+
}[Code] : Code>;
|
|
171
|
+
}) => Promise<{
|
|
172
|
+
dynamicDB: MSSQL;
|
|
173
|
+
}>;
|
|
174
|
+
};
|
|
175
|
+
readonly injectStaticDB: (databaseName: string) => {
|
|
176
|
+
readonly resolve: () => {
|
|
177
|
+
staticDB: MSSQL;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
parser: {};
|
|
182
|
+
response: {};
|
|
183
|
+
}, {
|
|
184
|
+
[x: string]: {
|
|
185
|
+
GET: {
|
|
186
|
+
body: unknown;
|
|
187
|
+
params: {};
|
|
188
|
+
query: unknown;
|
|
189
|
+
headers: unknown;
|
|
190
|
+
response: {
|
|
191
|
+
200: {
|
|
192
|
+
message: string;
|
|
193
|
+
content: number;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
POST: {
|
|
198
|
+
body: unknown;
|
|
199
|
+
params: {};
|
|
200
|
+
query: unknown;
|
|
201
|
+
headers: unknown;
|
|
202
|
+
response: {
|
|
203
|
+
200: {
|
|
204
|
+
message: string;
|
|
205
|
+
content: number;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
PUT: {
|
|
210
|
+
body: unknown;
|
|
211
|
+
params: {};
|
|
212
|
+
query: unknown;
|
|
213
|
+
headers: unknown;
|
|
214
|
+
response: {
|
|
215
|
+
200: {
|
|
216
|
+
message: string;
|
|
217
|
+
content: number;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
DELETE: {
|
|
222
|
+
body: unknown;
|
|
223
|
+
params: {};
|
|
224
|
+
query: unknown;
|
|
225
|
+
headers: unknown;
|
|
226
|
+
response: {
|
|
227
|
+
200: {
|
|
228
|
+
message: string;
|
|
229
|
+
content: number;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
PATCH: {
|
|
234
|
+
body: unknown;
|
|
235
|
+
params: {};
|
|
236
|
+
query: unknown;
|
|
237
|
+
headers: unknown;
|
|
238
|
+
response: {
|
|
239
|
+
200: {
|
|
240
|
+
message: string;
|
|
241
|
+
content: number;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
}, {
|
|
247
|
+
derive: {};
|
|
248
|
+
resolve: {};
|
|
249
|
+
schema: {};
|
|
250
|
+
standaloneSchema: {};
|
|
251
|
+
response: {};
|
|
252
|
+
}, {
|
|
253
|
+
derive: {};
|
|
254
|
+
resolve: {};
|
|
255
|
+
schema: {};
|
|
256
|
+
standaloneSchema: {};
|
|
257
|
+
response: {};
|
|
258
|
+
}>;
|