@effect-app/infra 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +11 -0
- package/.jest-cache/haste-map-369fa5ca2164cc35b19159bd76147276-e7a7ff05756c055cb63be97ba8537525-314902b6271c341511f7398a50469024 +0 -0
- package/.jest-cache/haste-map-369fa5ca2164cc35b19159bd76147276-e7a7ff05756c055cb63be97ba8537525-3f072cc7afa09b6adaead0527ab9df83 +0 -0
- package/.jest-cache/haste-map-369fa5ca2164cc35b19159bd76147276-e7a7ff05756c055cb63be97ba8537525-74c3c295c110fc861b6a4c673afc3e24 +0 -0
- package/.jest-cache/haste-map-369fa5ca2164cc35b19159bd76147276-e7a7ff05756c055cb63be97ba8537525-bf6dae8cb9ea9740ceb39aefaf12716c +0 -0
- package/.jest-cache/haste-map-369fa5ca2164cc35b19159bd76147276-e7a7ff05756c055cb63be97ba8537525-cf9d1486029526079a5f68f2041dea02 +0 -0
- package/.jest-cache/haste-map-4ca41cc04e60c616a19cbb483cbf487b-e2f1f4b6d87214e3c49442fed31f310c-b4710ed9fb3d0757c4bf23045c585670 +0 -0
- package/.jest-cache/haste-map-4ca41cc04e60c616a19cbb483cbf487b-e2f1f4b6d87214e3c49442fed31f310c-ee17e5395bb1b7b36a4e2e22a6ae1449 +0 -0
- package/.jest-cache/haste-map-7dc16d7fae8c072843ed1c69eae73100-a8a4225b317477b49bca31f54559afb3-c16136699bb7f463be85273162b447c3 +0 -0
- package/.jest-cache/haste-map-9aa1e395a82e108eb49698982c574272-e2f1f4b6d87214e3c49442fed31f310c-f7435f46fc41ac5a13d06a49cae9a650 +0 -0
- package/.jest-cache/haste-map-9d206b45d610536c9ec65eec263c6964-a8a4225b317477b49bca31f54559afb3-3510506a330b44f1ae629033aac8fbb3 +0 -0
- package/.jest-cache/haste-map-a00ab30d0d656f9d3990958a54b9ccfd-87603b0fc921b26b622a5859b4c92bed-17b550b450b18840c25861aa6e835f0c +0 -0
- package/.jest-cache/haste-map-a00ab30d0d656f9d3990958a54b9ccfd-87603b0fc921b26b622a5859b4c92bed-4dc31290b1efc98335eb4c89167d75c3 +0 -0
- package/.jest-cache/haste-map-ab843cb0ffbadfd0deea4adb182c7ecd-87603b0fc921b26b622a5859b4c92bed-997106edf4bbc31567a378146180e45e +0 -0
- package/.jest-cache/haste-map-ab843cb0ffbadfd0deea4adb182c7ecd-87603b0fc921b26b622a5859b4c92bed-f0cd25414f9ed16c446940ca3aa23c1b +0 -0
- package/.jest-cache/haste-map-cf17f2edf0e949eebfdfca561816457c-e7a7ff05756c055cb63be97ba8537525-2cac07d09e6384e2d37c49714edad0ba +0 -0
- package/.jest-cache/haste-map-cf17f2edf0e949eebfdfca561816457c-e7a7ff05756c055cb63be97ba8537525-d7967c2976c5feac7161c964f0aa442f +0 -0
- package/.jest-cache/haste-map-fb1a173276d25bbff02f815600059283-938122bdc1c8836874b6585d7acb2e99-f705929cca05ce95ceaa6d520b560ce8 +0 -0
- package/.prettierignore +6 -0
- package/_cjs/_global.cjs +6 -0
- package/_cjs/_global.cjs.map +1 -0
- package/_cjs/_global.ext.cjs +6 -0
- package/_cjs/_global.ext.cjs.map +1 -0
- package/_cjs/_global.schema.cjs +5 -0
- package/_cjs/_global.schema.cjs.map +1 -0
- package/_cjs/errors.cjs +82 -0
- package/_cjs/errors.cjs.map +1 -0
- package/_cjs/ext.cjs +4 -0
- package/_cjs/ext.cjs.map +1 -0
- package/_cjs/index.cjs +6 -0
- package/_cjs/index.cjs.map +1 -0
- package/_cjs/lib/RequestContext.cjs +70 -0
- package/_cjs/lib/RequestContext.cjs.map +1 -0
- package/_cjs/lib/api/authorization.jwt.cjs +44 -0
- package/_cjs/lib/api/authorization.jwt.cjs.map +1 -0
- package/_cjs/lib/api/defaultErrorHandler.cjs +45 -0
- package/_cjs/lib/api/defaultErrorHandler.cjs.map +1 -0
- package/_cjs/lib/api/reportError.cjs +64 -0
- package/_cjs/lib/api/reportError.cjs.map +1 -0
- package/_cjs/lib/api/routing.cjs +262 -0
- package/_cjs/lib/api/routing.cjs.map +1 -0
- package/_cjs/lib/api/setupRequest.cjs +35 -0
- package/_cjs/lib/api/setupRequest.cjs.map +1 -0
- package/_cjs/lib/api/util.cjs +17 -0
- package/_cjs/lib/api/util.cjs.map +1 -0
- package/_cjs/lib/api/writeDocs.cjs +31 -0
- package/_cjs/lib/api/writeDocs.cjs.map +1 -0
- package/_cjs/lib/errorReporter.cjs +72 -0
- package/_cjs/lib/errorReporter.cjs.map +1 -0
- package/_cjs/lib/ext/Array.cjs +30 -0
- package/_cjs/lib/ext/Array.cjs.map +1 -0
- package/_cjs/lib/fileUtil.cjs +36 -0
- package/_cjs/lib/fileUtil.cjs.map +1 -0
- package/_cjs/lib/filter/types/errors.cjs +6 -0
- package/_cjs/lib/filter/types/errors.cjs.map +1 -0
- package/_cjs/lib/filter/types/fields.cjs +6 -0
- package/_cjs/lib/filter/types/fields.cjs.map +1 -0
- package/_cjs/lib/filter/types/index.cjs +61 -0
- package/_cjs/lib/filter/types/index.cjs.map +1 -0
- package/_cjs/lib/filter/types/path/common.cjs +6 -0
- package/_cjs/lib/filter/types/path/common.cjs.map +1 -0
- package/_cjs/lib/filter/types/path/eager.cjs +6 -0
- package/_cjs/lib/filter/types/path/eager.cjs.map +1 -0
- package/_cjs/lib/filter/types/path/index.cjs +8 -0
- package/_cjs/lib/filter/types/path/index.cjs.map +1 -0
- package/_cjs/lib/filter/types/utils.cjs +6 -0
- package/_cjs/lib/filter/types/utils.cjs.map +1 -0
- package/_cjs/lib/filter/types/validator.cjs +6 -0
- package/_cjs/lib/filter/types/validator.cjs.map +1 -0
- package/_cjs/lib/filter.cjs +238 -0
- package/_cjs/lib/filter.cjs.map +1 -0
- package/_cjs/lib/instrument.cjs +20 -0
- package/_cjs/lib/instrument.cjs.map +1 -0
- package/_cjs/lib/rateLimit.cjs +88 -0
- package/_cjs/lib/rateLimit.cjs.map +1 -0
- package/_cjs/services/CUPS/service.cjs +15 -0
- package/_cjs/services/CUPS/service.cjs.map +1 -0
- package/_cjs/services/CUPS.cjs +113 -0
- package/_cjs/services/CUPS.cjs.map +1 -0
- package/_cjs/services/Cache.cjs +39 -0
- package/_cjs/services/Cache.cjs.map +1 -0
- package/_cjs/services/Emailer/Sendgrid.cjs +112 -0
- package/_cjs/services/Emailer/Sendgrid.cjs.map +1 -0
- package/_cjs/services/Emailer/fake.cjs +24 -0
- package/_cjs/services/Emailer/fake.cjs.map +1 -0
- package/_cjs/services/Emailer/service.cjs +12 -0
- package/_cjs/services/Emailer/service.cjs.map +1 -0
- package/_cjs/services/Emailer.cjs +17 -0
- package/_cjs/services/Emailer.cjs.map +1 -0
- package/_cjs/services/Repository.cjs +247 -0
- package/_cjs/services/Repository.cjs.map +1 -0
- package/_cjs/services/ServiceBus.cjs +69 -0
- package/_cjs/services/ServiceBus.cjs.map +1 -0
- package/_cjs/services/Store/Cosmos.cjs +324 -0
- package/_cjs/services/Store/Cosmos.cjs.map +1 -0
- package/_cjs/services/Store/Cosmos.test.cjs +59 -0
- package/_cjs/services/Store/Cosmos.test.cjs.map +1 -0
- package/_cjs/services/Store/Disk.cjs +62 -0
- package/_cjs/services/Store/Disk.cjs.map +1 -0
- package/_cjs/services/Store/Memory.cjs +70 -0
- package/_cjs/services/Store/Memory.cjs.map +1 -0
- package/_cjs/services/Store/Redis.cjs +72 -0
- package/_cjs/services/Store/Redis.cjs.map +1 -0
- package/_cjs/services/Store/codeFilter.test.cjs +61 -0
- package/_cjs/services/Store/codeFilter.test.cjs.map +1 -0
- package/_cjs/services/Store/index.cjs +72 -0
- package/_cjs/services/Store/index.cjs.map +1 -0
- package/_cjs/services/Store/service.cjs +72 -0
- package/_cjs/services/Store/service.cjs.map +1 -0
- package/_cjs/services/Store/utils.cjs +78 -0
- package/_cjs/services/Store/utils.cjs.map +1 -0
- package/_cjs/services/Store.cjs +17 -0
- package/_cjs/services/Store.cjs.map +1 -0
- package/_cjs/services/memQueue.cjs +32 -0
- package/_cjs/services/memQueue.cjs.map +1 -0
- package/_cjs/test.arbs.cjs +32 -0
- package/_cjs/test.arbs.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/_internal/AtomicBoolean.cjs +14 -0
- package/_cjs/vendor/Cache/Cache/_internal/AtomicBoolean.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/_internal/AtomicNumber.cjs +29 -0
- package/_cjs/vendor/Cache/Cache/_internal/AtomicNumber.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/_internal/AtomicReference.cjs +32 -0
- package/_cjs/vendor/Cache/Cache/_internal/AtomicReference.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/_internal/CacheInternal.cjs +266 -0
- package/_cjs/vendor/Cache/Cache/_internal/CacheInternal.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/_internal/CacheState.cjs +31 -0
- package/_cjs/vendor/Cache/Cache/_internal/CacheState.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/_internal/KeySet.cjs +67 -0
- package/_cjs/vendor/Cache/Cache/_internal/KeySet.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/_internal/MapKey.cjs +44 -0
- package/_cjs/vendor/Cache/Cache/_internal/MapKey.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/_internal/MapValue.cjs +33 -0
- package/_cjs/vendor/Cache/Cache/_internal/MapValue.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/definition.cjs +13 -0
- package/_cjs/vendor/Cache/Cache/definition.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/operations/make.cjs +20 -0
- package/_cjs/vendor/Cache/Cache/operations/make.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/operations/makeWith.cjs +23 -0
- package/_cjs/vendor/Cache/Cache/operations/makeWith.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache/operations.cjs +28 -0
- package/_cjs/vendor/Cache/Cache/operations.cjs.map +1 -0
- package/_cjs/vendor/Cache/Cache.cjs +28 -0
- package/_cjs/vendor/Cache/Cache.cjs.map +1 -0
- package/_cjs/vendor/Cache/CacheStats/definition.cjs +13 -0
- package/_cjs/vendor/Cache/CacheStats/definition.cjs.map +1 -0
- package/_cjs/vendor/Cache/CacheStats.cjs +17 -0
- package/_cjs/vendor/Cache/CacheStats.cjs.map +1 -0
- package/_cjs/vendor/Cache/EntryStats/definition.cjs +11 -0
- package/_cjs/vendor/Cache/EntryStats/definition.cjs.map +1 -0
- package/_cjs/vendor/Cache/EntryStats.cjs +17 -0
- package/_cjs/vendor/Cache/EntryStats.cjs.map +1 -0
- package/_cjs/vendor/Cache/Lookup/definition.cjs +6 -0
- package/_cjs/vendor/Cache/Lookup/definition.cjs.map +1 -0
- package/_cjs/vendor/Cache/Lookup.cjs +17 -0
- package/_cjs/vendor/Cache/Lookup.cjs.map +1 -0
- package/_cjs/vendor/Cache/index.cjs +17 -0
- package/_cjs/vendor/Cache/index.cjs.map +1 -0
- package/_src/_global.ext.ts +34 -0
- package/_src/_global.schema.ts +10 -0
- package/_src/_global.ts +14 -0
- package/_src/errors.ts +50 -0
- package/_src/ext.ts +1 -0
- package/_src/index.ts +0 -0
- package/_src/lib/RequestContext.ts +132 -0
- package/_src/lib/api/authorization.jwt.ts +52 -0
- package/_src/lib/api/defaultErrorHandler.ts +92 -0
- package/_src/lib/api/reportError.ts +50 -0
- package/_src/lib/api/routing.ts +623 -0
- package/_src/lib/api/setupRequest.ts +22 -0
- package/_src/lib/api/util.ts +14 -0
- package/_src/lib/api/writeDocs.ts +26 -0
- package/_src/lib/errorReporter.ts +63 -0
- package/_src/lib/ext/Array.ts +32 -0
- package/_src/lib/fileUtil.ts +56 -0
- package/_src/lib/filter/types/errors.ts +47 -0
- package/_src/lib/filter/types/fields.ts +50 -0
- package/_src/lib/filter/types/index.ts +5 -0
- package/_src/lib/filter/types/path/common.ts +404 -0
- package/_src/lib/filter/types/path/eager.ts +146 -0
- package/_src/lib/filter/types/path/index.ts +14 -0
- package/_src/lib/filter/types/utils.ts +106 -0
- package/_src/lib/filter/types/validator.ts +46 -0
- package/_src/lib/filter.ts +323 -0
- package/_src/lib/instrument.ts +9 -0
- package/_src/lib/rateLimit.ts +126 -0
- package/_src/services/CUPS/service.ts +16 -0
- package/_src/services/CUPS.ts +105 -0
- package/_src/services/Cache.ts +45 -0
- package/_src/services/Emailer/Sendgrid.ts +123 -0
- package/_src/services/Emailer/fake.ts +14 -0
- package/_src/services/Emailer/service.ts +33 -0
- package/_src/services/Emailer.ts +1 -0
- package/_src/services/Repository.ts +513 -0
- package/_src/services/ServiceBus.ts +111 -0
- package/_src/services/Store/Cosmos.test.ts +91 -0
- package/_src/services/Store/Cosmos.ts +545 -0
- package/_src/services/Store/Disk.ts +81 -0
- package/_src/services/Store/Memory.ts +77 -0
- package/_src/services/Store/Redis.ts +92 -0
- package/_src/services/Store/codeFilter.test.ts +74 -0
- package/_src/services/Store/index.test.ts.bak +112 -0
- package/_src/services/Store/index.ts +62 -0
- package/_src/services/Store/service.ts +174 -0
- package/_src/services/Store/utils.ts +126 -0
- package/_src/services/Store.ts +1 -0
- package/_src/services/memQueue.ts +30 -0
- package/_src/test.arbs.ts +27 -0
- package/_src/vendor/Cache/Cache/_internal/AtomicBoolean.ts +7 -0
- package/_src/vendor/Cache/Cache/_internal/AtomicNumber.ts +28 -0
- package/_src/vendor/Cache/Cache/_internal/AtomicReference.ts +30 -0
- package/_src/vendor/Cache/Cache/_internal/CacheInternal.ts +293 -0
- package/_src/vendor/Cache/Cache/_internal/CacheState.ts +56 -0
- package/_src/vendor/Cache/Cache/_internal/KeySet.ts +58 -0
- package/_src/vendor/Cache/Cache/_internal/MapKey.ts +43 -0
- package/_src/vendor/Cache/Cache/_internal/MapValue.ts +39 -0
- package/_src/vendor/Cache/Cache/definition.ts +112 -0
- package/_src/vendor/Cache/Cache/operations/make.ts +17 -0
- package/_src/vendor/Cache/Cache/operations/makeWith.ts +32 -0
- package/_src/vendor/Cache/Cache/operations.ts +4 -0
- package/_src/vendor/Cache/Cache.ts +4 -0
- package/_src/vendor/Cache/CacheStats/definition.ts +23 -0
- package/_src/vendor/Cache/CacheStats.ts +3 -0
- package/_src/vendor/Cache/EntryStats/definition.ts +19 -0
- package/_src/vendor/Cache/EntryStats.ts +3 -0
- package/_src/vendor/Cache/Lookup/definition.ts +15 -0
- package/_src/vendor/Cache/Lookup.ts +3 -0
- package/_src/vendor/Cache/global.ts.bak +23 -0
- package/_src/vendor/Cache/index.ts +4 -0
- package/dist/_global.d.ts +10 -0
- package/dist/_global.d.ts.map +1 -0
- package/dist/_global.ext.d.ts +34 -0
- package/dist/_global.ext.d.ts.map +1 -0
- package/dist/_global.ext.js +2 -0
- package/dist/_global.js +12 -0
- package/dist/_global.schema.d.ts +6 -0
- package/dist/_global.schema.d.ts.map +1 -0
- package/dist/_global.schema.js +9 -0
- package/dist/errors.d.ts +41 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +51 -0
- package/dist/ext.d.ts +2 -0
- package/dist/ext.d.ts.map +1 -0
- package/dist/ext.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/lib/RequestContext.d.ts +122 -0
- package/dist/lib/RequestContext.d.ts.map +1 -0
- package/dist/lib/RequestContext.js +52 -0
- package/dist/lib/api/authorization.jwt.d.ts +7 -0
- package/dist/lib/api/authorization.jwt.d.ts.map +1 -0
- package/dist/lib/api/authorization.jwt.js +32 -0
- package/dist/lib/api/defaultErrorHandler.d.ts +8 -0
- package/dist/lib/api/defaultErrorHandler.d.ts.map +1 -0
- package/dist/lib/api/defaultErrorHandler.js +37 -0
- package/dist/lib/api/reportError.d.ts +32 -0
- package/dist/lib/api/reportError.d.ts.map +1 -0
- package/dist/lib/api/reportError.js +44 -0
- package/dist/lib/api/routing.d.ts +100 -0
- package/dist/lib/api/routing.d.ts.map +1 -0
- package/dist/lib/api/routing.js +248 -0
- package/dist/lib/api/setupRequest.d.ts +13 -0
- package/dist/lib/api/setupRequest.d.ts.map +1 -0
- package/dist/lib/api/setupRequest.js +25 -0
- package/dist/lib/api/util.d.ts +3 -0
- package/dist/lib/api/util.d.ts.map +1 -0
- package/dist/lib/api/util.js +14 -0
- package/dist/lib/api/writeDocs.d.ts +3 -0
- package/dist/lib/api/writeDocs.d.ts.map +1 -0
- package/dist/lib/api/writeDocs.js +23 -0
- package/dist/lib/errorReporter.d.ts +8 -0
- package/dist/lib/errorReporter.d.ts.map +1 -0
- package/dist/lib/errorReporter.js +45 -0
- package/dist/lib/ext/Array.d.ts +19 -0
- package/dist/lib/ext/Array.d.ts.map +1 -0
- package/dist/lib/ext/Array.js +21 -0
- package/dist/lib/fileUtil.d.ts +22 -0
- package/dist/lib/fileUtil.d.ts.map +1 -0
- package/dist/lib/fileUtil.js +23 -0
- package/dist/lib/filter/types/errors.d.ts +30 -0
- package/dist/lib/filter/types/errors.d.ts.map +1 -0
- package/dist/lib/filter/types/errors.js +2 -0
- package/dist/lib/filter/types/fields.d.ts +29 -0
- package/dist/lib/filter/types/fields.d.ts.map +1 -0
- package/dist/lib/filter/types/fields.js +2 -0
- package/dist/lib/filter/types/index.d.ts +6 -0
- package/dist/lib/filter/types/index.d.ts.map +1 -0
- package/dist/lib/filter/types/index.js +6 -0
- package/dist/lib/filter/types/path/common.d.ts +316 -0
- package/dist/lib/filter/types/path/common.d.ts.map +1 -0
- package/dist/lib/filter/types/path/common.js +2 -0
- package/dist/lib/filter/types/path/eager.d.ts +95 -0
- package/dist/lib/filter/types/path/eager.d.ts.map +1 -0
- package/dist/lib/filter/types/path/eager.js +2 -0
- package/dist/lib/filter/types/path/index.d.ts +4 -0
- package/dist/lib/filter/types/path/index.d.ts.map +1 -0
- package/dist/lib/filter/types/path/index.js +4 -0
- package/dist/lib/filter/types/utils.d.ts +68 -0
- package/dist/lib/filter/types/utils.d.ts.map +1 -0
- package/dist/lib/filter/types/utils.js +2 -0
- package/dist/lib/filter/types/validator.d.ts +30 -0
- package/dist/lib/filter/types/validator.d.ts.map +1 -0
- package/dist/lib/filter/types/validator.js +2 -0
- package/dist/lib/filter.d.ts +133 -0
- package/dist/lib/filter.d.ts.map +1 -0
- package/dist/lib/filter.js +171 -0
- package/dist/lib/instrument.d.ts +7 -0
- package/dist/lib/instrument.d.ts.map +1 -0
- package/dist/lib/instrument.js +12 -0
- package/dist/lib/rateLimit.d.ts +43 -0
- package/dist/lib/rateLimit.d.ts.map +1 -0
- package/dist/lib/rateLimit.js +76 -0
- package/dist/services/CUPS/service.d.ts +19 -0
- package/dist/services/CUPS/service.d.ts.map +1 -0
- package/dist/services/CUPS/service.js +5 -0
- package/dist/services/CUPS.d.ts +10 -0
- package/dist/services/CUPS.d.ts.map +1 -0
- package/dist/services/CUPS.js +89 -0
- package/dist/services/Cache.d.ts +28 -0
- package/dist/services/Cache.d.ts.map +1 -0
- package/dist/services/Cache.js +28 -0
- package/dist/services/Emailer/Sendgrid.d.ts +180 -0
- package/dist/services/Emailer/Sendgrid.d.ts.map +1 -0
- package/dist/services/Emailer/Sendgrid.js +102 -0
- package/dist/services/Emailer/fake.d.ts +7 -0
- package/dist/services/Emailer/fake.d.ts.map +1 -0
- package/dist/services/Emailer/fake.js +15 -0
- package/dist/services/Emailer/service.d.ts +41 -0
- package/dist/services/Emailer/service.d.ts.map +1 -0
- package/dist/services/Emailer/service.js +3 -0
- package/dist/services/Emailer.d.ts +2 -0
- package/dist/services/Emailer.d.ts.map +1 -0
- package/dist/services/Emailer.js +2 -0
- package/dist/services/Repository.d.ts +300 -0
- package/dist/services/Repository.d.ts.map +1 -0
- package/dist/services/Repository.js +193 -0
- package/dist/services/ServiceBus.d.ts +26 -0
- package/dist/services/ServiceBus.d.ts.map +1 -0
- package/dist/services/ServiceBus.js +53 -0
- package/dist/services/Store/Cosmos.d.ts +56 -0
- package/dist/services/Store/Cosmos.d.ts.map +1 -0
- package/dist/services/Store/Cosmos.js +321 -0
- package/dist/services/Store/Cosmos.test.d.ts.map +1 -0
- package/dist/services/Store/Disk.d.ts +14 -0
- package/dist/services/Store/Disk.d.ts.map +1 -0
- package/dist/services/Store/Disk.js +52 -0
- package/dist/services/Store/Memory.d.ts +17 -0
- package/dist/services/Store/Memory.d.ts.map +1 -0
- package/dist/services/Store/Memory.js +60 -0
- package/dist/services/Store/Redis.d.ts +12 -0
- package/dist/services/Store/Redis.d.ts.map +1 -0
- package/dist/services/Store/Redis.js +59 -0
- package/dist/services/Store/codeFilter.test.d.ts.map +1 -0
- package/dist/services/Store/index.d.ts +10 -0
- package/dist/services/Store/index.d.ts.map +1 -0
- package/dist/services/Store/index.js +52 -0
- package/dist/services/Store/service.d.ts +113 -0
- package/dist/services/Store/service.d.ts.map +1 -0
- package/dist/services/Store/service.js +63 -0
- package/dist/services/Store/utils.d.ts +14 -0
- package/dist/services/Store/utils.d.ts.map +1 -0
- package/dist/services/Store/utils.js +103 -0
- package/dist/services/Store.d.ts +2 -0
- package/dist/services/Store.d.ts.map +1 -0
- package/dist/services/Store.js +2 -0
- package/dist/services/memQueue.d.ts +18 -0
- package/dist/services/memQueue.d.ts.map +1 -0
- package/dist/services/memQueue.js +24 -0
- package/dist/test.arbs.d.ts +13 -0
- package/dist/test.arbs.d.ts.map +1 -0
- package/dist/test.arbs.js +22 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicBoolean.d.ts +5 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicBoolean.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicBoolean.js +7 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicNumber.d.ts +8 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicNumber.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicNumber.js +22 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicReference.d.ts +10 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicReference.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/_internal/AtomicReference.js +25 -0
- package/dist/vendor/Cache/Cache/_internal/CacheInternal.d.ts +51 -0
- package/dist/vendor/Cache/Cache/_internal/CacheInternal.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/_internal/CacheInternal.js +253 -0
- package/dist/vendor/Cache/Cache/_internal/CacheState.d.ts +33 -0
- package/dist/vendor/Cache/Cache/_internal/CacheState.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/_internal/CacheState.js +21 -0
- package/dist/vendor/Cache/Cache/_internal/KeySet.d.ts +20 -0
- package/dist/vendor/Cache/Cache/_internal/KeySet.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/_internal/KeySet.js +61 -0
- package/dist/vendor/Cache/Cache/_internal/MapKey.d.ts +24 -0
- package/dist/vendor/Cache/Cache/_internal/MapKey.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/_internal/MapKey.js +37 -0
- package/dist/vendor/Cache/Cache/_internal/MapValue.d.ts +32 -0
- package/dist/vendor/Cache/Cache/_internal/MapValue.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/_internal/MapValue.js +24 -0
- package/dist/vendor/Cache/Cache/definition.d.ts +100 -0
- package/dist/vendor/Cache/Cache/definition.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/definition.js +5 -0
- package/dist/vendor/Cache/Cache/operations/make.d.ts +12 -0
- package/dist/vendor/Cache/Cache/operations/make.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/operations/make.js +12 -0
- package/dist/vendor/Cache/Cache/operations/makeWith.d.ts +14 -0
- package/dist/vendor/Cache/Cache/operations/makeWith.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/operations/makeWith.js +15 -0
- package/dist/vendor/Cache/Cache/operations.d.ts +3 -0
- package/dist/vendor/Cache/Cache/operations.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache/operations.js +4 -0
- package/dist/vendor/Cache/Cache.d.ts +3 -0
- package/dist/vendor/Cache/Cache.d.ts.map +1 -0
- package/dist/vendor/Cache/Cache.js +4 -0
- package/dist/vendor/Cache/CacheStats/definition.d.ts +19 -0
- package/dist/vendor/Cache/CacheStats/definition.d.ts.map +1 -0
- package/dist/vendor/Cache/CacheStats/definition.js +6 -0
- package/dist/vendor/Cache/CacheStats.d.ts +2 -0
- package/dist/vendor/Cache/CacheStats.d.ts.map +1 -0
- package/dist/vendor/Cache/CacheStats.js +3 -0
- package/dist/vendor/Cache/EntryStats/definition.d.ts +17 -0
- package/dist/vendor/Cache/EntryStats/definition.d.ts.map +1 -0
- package/dist/vendor/Cache/EntryStats/definition.js +4 -0
- package/dist/vendor/Cache/EntryStats.d.ts +2 -0
- package/dist/vendor/Cache/EntryStats.d.ts.map +1 -0
- package/dist/vendor/Cache/EntryStats.js +3 -0
- package/dist/vendor/Cache/Lookup/definition.d.ts +17 -0
- package/dist/vendor/Cache/Lookup/definition.d.ts.map +1 -0
- package/dist/vendor/Cache/Lookup/definition.js +2 -0
- package/dist/vendor/Cache/Lookup.d.ts +2 -0
- package/dist/vendor/Cache/Lookup.d.ts.map +1 -0
- package/dist/vendor/Cache/Lookup.js +3 -0
- package/dist/vendor/Cache/index.d.ts +5 -0
- package/dist/vendor/Cache/index.d.ts.map +1 -0
- package/dist/vendor/Cache/index.js +5 -0
- package/package.json +756 -0
- package/tsconfig.json +107 -0
- package/tsconfig.json.bak +47 -0
- package/tsplus.config.json +6 -0
- package/types/modules.d.ts +1 -0
- package/vitest.config.ts +5 -0
- package/wallaby.cjs +1 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Lookup } from "../../Lookup/definition.js"
|
|
2
|
+
import { Cache } from "../definition.js"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Constructs a new cache with the specified capacity, time to live, and
|
|
6
|
+
* lookup function.
|
|
7
|
+
*
|
|
8
|
+
* @tsplus static effect/cache/Cache.Ops make
|
|
9
|
+
*/
|
|
10
|
+
export function make<Key, Environment, Error, Value>(
|
|
11
|
+
capacity: number,
|
|
12
|
+
timeToLive: DUR,
|
|
13
|
+
lookup: Lookup<Key, Environment, Error, Value>,
|
|
14
|
+
__tsplusTrace?: string
|
|
15
|
+
): Effect<Environment, never, Cache<Key, Error, Value>> {
|
|
16
|
+
return Cache.makeWith(capacity, lookup, () => timeToLive)
|
|
17
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Lookup } from "../../Lookup/definition.js"
|
|
2
|
+
import { CacheInternal } from "../_internal/CacheInternal.js"
|
|
3
|
+
import type { Cache } from "../definition.js"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Constructs a new cache with the specified capacity, time to live, and
|
|
7
|
+
* lookup function, where the time to live can depend on the `Exit` value
|
|
8
|
+
* returned by the lookup function.
|
|
9
|
+
*
|
|
10
|
+
* @tsplus static effect/cache/Cache.Ops makeWith
|
|
11
|
+
*/
|
|
12
|
+
export function makeWith<Key, Environment, Error, Value>(
|
|
13
|
+
capacity: number,
|
|
14
|
+
lookup: Lookup<Key, Environment, Error, Value>,
|
|
15
|
+
timeToLive: (exit: Exit<Error, Value>) => DUR,
|
|
16
|
+
__tsplusTrace?: string
|
|
17
|
+
): Effect<Environment, never, Cache<Key, Error, Value>> {
|
|
18
|
+
return Effect.clockWith(clock =>
|
|
19
|
+
Effect.environment<Environment>().flatMap(environment =>
|
|
20
|
+
Effect.fiberId().map(fiberId =>
|
|
21
|
+
new CacheInternal(
|
|
22
|
+
capacity,
|
|
23
|
+
lookup,
|
|
24
|
+
timeToLive,
|
|
25
|
+
clock,
|
|
26
|
+
environment,
|
|
27
|
+
fiberId
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `CacheStats` represents a snapshot of statistics for the cache as of a
|
|
3
|
+
* point in time.
|
|
4
|
+
*
|
|
5
|
+
* @tsplus type effect/cache/CacheStats
|
|
6
|
+
*/
|
|
7
|
+
export interface CacheStats {
|
|
8
|
+
readonly hits: number
|
|
9
|
+
readonly misses: number
|
|
10
|
+
readonly size: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @tsplus type effect/cache/CacheStats.Ops
|
|
15
|
+
*/
|
|
16
|
+
export interface CacheStatsOps {
|
|
17
|
+
(hits: number, misses: number, size: number): CacheStats
|
|
18
|
+
}
|
|
19
|
+
export const CacheStats: CacheStatsOps = (hits, misses, size) => ({
|
|
20
|
+
hits,
|
|
21
|
+
misses,
|
|
22
|
+
size
|
|
23
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An `EntryStats` represents a snapshot of statistics for an entry in the
|
|
3
|
+
* cache.
|
|
4
|
+
*
|
|
5
|
+
* @tsplus type effect/cache/EntryStats
|
|
6
|
+
*/
|
|
7
|
+
export interface EntryStats {
|
|
8
|
+
readonly loadedMillis: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @tsplus type effect/cache/EntryStats.Ops
|
|
13
|
+
*/
|
|
14
|
+
export interface EntryStatsOps {
|
|
15
|
+
(loadedMillis: number): EntryStats
|
|
16
|
+
}
|
|
17
|
+
export const EntryStats: EntryStatsOps = (loadedMillis) => ({
|
|
18
|
+
loadedMillis
|
|
19
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `Lookup` represents a lookup function that, given a key of type `Key`, can
|
|
3
|
+
* return an `Effect` that will either produce a value of type `Value` or
|
|
4
|
+
* fail with an error of type `Error` using an environment of type
|
|
5
|
+
* `Environment`.
|
|
6
|
+
*
|
|
7
|
+
* You can think of a `Lookup` as an effectual function that computes a value
|
|
8
|
+
* given a key. Given any effectual function you can convert it to a lookup
|
|
9
|
+
* function for a cache by using the `Lookup` constructor.
|
|
10
|
+
*
|
|
11
|
+
* @tsplus type effect/cache/Lookup
|
|
12
|
+
*/
|
|
13
|
+
export interface Lookup<Key, Environment, Error, Value> {
|
|
14
|
+
(key: Key): Effect<Environment, Error, Value>
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "@effect/cache"
|
|
2
|
+
import "@effect/core/global"
|
|
3
|
+
import "@tsplus/stdlib/global"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @tsplus global
|
|
7
|
+
*/
|
|
8
|
+
import { Cache } from "@effect/cache/Cache/definition"
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @tsplus global
|
|
12
|
+
*/
|
|
13
|
+
import { CacheStats } from "@effect/cache/CacheStats/definition"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @tsplus global
|
|
17
|
+
*/
|
|
18
|
+
import { EntryStats } from "@effect/cache/EntryStats/definition"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @tsplus global
|
|
22
|
+
*/
|
|
23
|
+
import { Lookup } from "@effect/cache/Lookup/definition"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_global.d.ts","sourceRoot":"","sources":["../_src/_global.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,OAAO,6BAA6B,CAAA;AAEpC;;GAEG;AACH,OAAO,oCAAoC,CAAA;AAE3C,OAAO,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tsplus global
|
|
3
|
+
*/
|
|
4
|
+
import type {} from "@effect-app/infra/services/Emailer/fake";
|
|
5
|
+
/**
|
|
6
|
+
* @tsplus global
|
|
7
|
+
*/
|
|
8
|
+
import type {} from "@effect-app/infra/services/Emailer/Sendgrid";
|
|
9
|
+
/**
|
|
10
|
+
* @tsplus global
|
|
11
|
+
*/
|
|
12
|
+
import type {} from "@effect-app/infra/test.arbs";
|
|
13
|
+
/**
|
|
14
|
+
* @tsplus global
|
|
15
|
+
*/
|
|
16
|
+
import type {} from "@effect-app/infra/ext";
|
|
17
|
+
/**
|
|
18
|
+
* @tsplus global
|
|
19
|
+
*/
|
|
20
|
+
import type {} from "@effect-app/infra/lib/instrument";
|
|
21
|
+
/**
|
|
22
|
+
* @tsplus global
|
|
23
|
+
*/
|
|
24
|
+
import type {} from "@effect-app/infra/lib/rateLimit";
|
|
25
|
+
/**
|
|
26
|
+
* @tsplus global
|
|
27
|
+
*/
|
|
28
|
+
import type {} from "@effect-app/infra/lib/api/setupRequest";
|
|
29
|
+
/**
|
|
30
|
+
* @tsplus global
|
|
31
|
+
*/
|
|
32
|
+
import {} from "@effect-app/infra/lib/api/reportError";
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=_global.ext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_global.ext.d.ts","sourceRoot":"","sources":["../_src/_global.ext.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,yCAAyC,CAAA;AAC7D;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,6CAA6C,CAAA;AACjE;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACjD;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC3C;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,kCAAkC,CAAA;AACtD;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,iCAAiC,CAAA;AAErD;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,wCAAwC,CAAA;AAE5D;;GAEG;AACH,OAAO,EAAE,MAAM,uCAAuC,CAAA"}
|
package/dist/_global.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
/* eslint-disable unused-imports/no-unused-imports */
|
|
3
|
+
/**
|
|
4
|
+
* @tsplus global
|
|
5
|
+
*/
|
|
6
|
+
import "@effect-app/prelude/_global";
|
|
7
|
+
/**
|
|
8
|
+
* @tsplus global
|
|
9
|
+
*/
|
|
10
|
+
import "@effect-app/infra-adapters/_global";
|
|
11
|
+
import "./_global.ext.js";
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiX2dsb2JhbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL19zcmMvX2dsb2JhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx5Q0FBeUM7QUFDekMscURBQXFEO0FBRXJEOztHQUVHO0FBQ0gsT0FBTyw2QkFBNkIsQ0FBQTtBQUVwQzs7R0FFRztBQUNILE9BQU8sb0NBQW9DLENBQUE7QUFFM0MsT0FBTyxrQkFBa0IsQ0FBQSJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_global.schema.d.ts","sourceRoot":"","sources":["../_src/_global.schema.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAA;AAE1F,OAAO,oCAAoC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
/* eslint-disable unused-imports/no-unused-imports */
|
|
3
|
+
// Required for tsplus with project references in vscode..
|
|
4
|
+
/**
|
|
5
|
+
* @tsplus global
|
|
6
|
+
*/
|
|
7
|
+
import "@effect-app/prelude/schema";
|
|
8
|
+
import "@effect-app/prelude/_global.schema";
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiX2dsb2JhbC5zY2hlbWEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9fc3JjL19nbG9iYWwuc2NoZW1hLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHlDQUF5QztBQUN6QyxxREFBcUQ7QUFDckQsMERBQTBEO0FBRTFEOztHQUVHO0FBQ0gsT0FBOEQsNEJBQTRCLENBQUE7QUFFMUYsT0FBTyxvQ0FBb0MsQ0FBQSJ9
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Cause } from "@effect/io/Cause";
|
|
2
|
+
import { NotLoggedInError } from "@effect-app/infra-adapters/errors";
|
|
3
|
+
export declare class NotFoundError<T extends string = string> {
|
|
4
|
+
readonly _tag = "NotFoundError";
|
|
5
|
+
readonly message: string;
|
|
6
|
+
constructor(type: T, id: string);
|
|
7
|
+
}
|
|
8
|
+
export { NotLoggedInError, UnauthorizedError, ValidationError } from "@effect-app/infra-adapters/errors";
|
|
9
|
+
/**
|
|
10
|
+
* The user carries a valid Userprofile, but there is a problem with the login none the less.
|
|
11
|
+
*/
|
|
12
|
+
export declare class LoginError extends NotLoggedInError {
|
|
13
|
+
readonly message: string;
|
|
14
|
+
constructor(message: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class InvalidStateError {
|
|
17
|
+
readonly message: string;
|
|
18
|
+
readonly _tag = "InvalidStateError";
|
|
19
|
+
constructor(message: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class CauseException<E> extends Error {
|
|
22
|
+
readonly exitCause: Cause<E>;
|
|
23
|
+
readonly _tag: string;
|
|
24
|
+
readonly pretty: string;
|
|
25
|
+
constructor(exitCause: Cause<E>, _tag: string);
|
|
26
|
+
toJSON(): {
|
|
27
|
+
_tag: string;
|
|
28
|
+
message: string;
|
|
29
|
+
pretty: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare class OptimisticConcurrencyException {
|
|
33
|
+
readonly type: string;
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly current?: string | undefined;
|
|
36
|
+
readonly found?: string | undefined;
|
|
37
|
+
readonly _tag = "OptimisticConcurrencyException";
|
|
38
|
+
readonly message: string;
|
|
39
|
+
constructor(type: string, id: string, current?: string | undefined, found?: string | undefined);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../_src/errors.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAEpE,qBAAa,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAClD,SAAgB,IAAI,mBAAkB;IACtC,SAAgB,OAAO,EAAE,MAAM,CAAA;gBACnB,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM;CAGhC;AAED,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAExG;;GAEG;AACH,qBAAa,UAAW,SAAQ,gBAAgB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;CAGrC;AAED,qBAAa,iBAAiB;aAEA,OAAO,EAAE,MAAM;IAD3C,SAAgB,IAAI,uBAAsB;gBACd,OAAO,EAAE,MAAM;CAC5C;AAED,qBAAa,cAAc,CAAC,CAAC,CAAE,SAAQ,KAAK;IAE9B,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM;IAD/D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBACF,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EAAW,IAAI,EAAE,MAAM;IAK/D,MAAM;;;;;CAQP;AAED,qBAAa,8BAA8B;IAG7B,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM;IAAE,QAAQ,CAAC,OAAO,CAAC;IAAU,QAAQ,CAAC,KAAK,CAAC;IAFlG,QAAQ,CAAC,IAAI,oCAAmC;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;gBACH,IAAI,EAAE,MAAM,EAAW,EAAE,EAAE,MAAM,EAAW,OAAO,CAAC,oBAAQ,EAAW,KAAK,CAAC,oBAAQ;CAG3G"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as tsplus_module_1 from "@effect/io/Cause";
|
|
2
|
+
import { NotLoggedInError } from "@effect-app/infra-adapters/errors";
|
|
3
|
+
export class NotFoundError {
|
|
4
|
+
constructor(type, id) {
|
|
5
|
+
this._tag = "NotFoundError";
|
|
6
|
+
this.message = `Didn't find ${type}#${id}`;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export { NotLoggedInError, UnauthorizedError, ValidationError } from "@effect-app/infra-adapters/errors";
|
|
10
|
+
/**
|
|
11
|
+
* The user carries a valid Userprofile, but there is a problem with the login none the less.
|
|
12
|
+
*/
|
|
13
|
+
export class LoginError extends NotLoggedInError {
|
|
14
|
+
constructor(message) {
|
|
15
|
+
super();
|
|
16
|
+
this.message = message;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class InvalidStateError {
|
|
20
|
+
constructor(message) {
|
|
21
|
+
this.message = message;
|
|
22
|
+
this._tag = "InvalidStateError";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class CauseException extends Error {
|
|
26
|
+
constructor(exitCause, _tag) {
|
|
27
|
+
super(`An unexpected ${_tag} Exception occurred, see \`pretty\` for details.`);
|
|
28
|
+
this.exitCause = exitCause;
|
|
29
|
+
this._tag = _tag;
|
|
30
|
+
this.pretty = tsplus_module_1.pretty()(exitCause);
|
|
31
|
+
}
|
|
32
|
+
toJSON() {
|
|
33
|
+
return {
|
|
34
|
+
_tag: this._tag,
|
|
35
|
+
message: this.message,
|
|
36
|
+
pretty: this.pretty
|
|
37
|
+
// cause: (this.cause as {}).$$.inspect(undefined, 10)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export class OptimisticConcurrencyException {
|
|
42
|
+
constructor(type, id, current, found) {
|
|
43
|
+
this.type = type;
|
|
44
|
+
this.id = id;
|
|
45
|
+
this.current = current;
|
|
46
|
+
this.found = found;
|
|
47
|
+
this._tag = "OptimisticConcurrencyException";
|
|
48
|
+
this.message = `Existing ${type} ${id} record changed`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vX3NyYy9lcnJvcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1DQUFtQyxDQUFBO0FBRXBFLE1BQU0sT0FBTyxhQUFhO0lBR3hCLFlBQVksSUFBTyxFQUFFLEVBQVU7UUFGZixTQUFJLEdBQUcsZUFBZSxDQUFBO1FBR3BDLElBQUksQ0FBQyxPQUFPLEdBQUcsZUFBZSxJQUFJLElBQUksRUFBRSxFQUFFLENBQUE7SUFDNUMsQ0FBQztDQUNGO0FBRUQsT0FBTyxFQUFFLGdCQUFnQixFQUFFLGlCQUFpQixFQUFFLGVBQWUsRUFBRSxNQUFNLG1DQUFtQyxDQUFBO0FBRXhHOztHQUVHO0FBQ0gsTUFBTSxPQUFPLFVBQVcsU0FBUSxnQkFBZ0I7SUFDOUMsWUFBcUIsT0FBZTtRQUNsQyxLQUFLLEVBQUUsQ0FBQTtRQURZLFlBQU8sR0FBUCxPQUFPLENBQVE7SUFFcEMsQ0FBQztDQUNGO0FBRUQsTUFBTSxPQUFPLGlCQUFpQjtJQUU1QixZQUE0QixPQUFlO1FBQWYsWUFBTyxHQUFQLE9BQU8sQ0FBUTtRQUQzQixTQUFJLEdBQUcsbUJBQW1CLENBQUE7SUFDSSxDQUFDO0NBQ2hEO0FBRUQsTUFBTSxPQUFPLGNBQWtCLFNBQVEsS0FBSztJQUUxQyxZQUFxQixTQUFtQixFQUFXLElBQVk7UUFDN0QsS0FBSyxDQUFDLGlCQUFpQixJQUFJLGtEQUFrRCxDQUFDLENBQUE7UUFEM0QsY0FBUyxHQUFULFNBQVMsQ0FBVTtRQUFXLFNBQUksR0FBSixJQUFJLENBQVE7UUFFN0QsSUFBSSxDQUFDLE1BQU0sR0FBRyx5QkFBQSxTQUFTLENBQVMsQ0FBQTtJQUNsQyxDQUFDO0lBRUQsTUFBTTtRQUNKLE9BQU87WUFDTCxJQUFJLEVBQUUsSUFBSSxDQUFDLElBQUk7WUFDZixPQUFPLEVBQUUsSUFBSSxDQUFDLE9BQU87WUFDckIsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNO1lBQ25CLDJEQUEyRDtTQUM1RCxDQUFBO0lBQ0gsQ0FBQztDQUNGO0FBRUQsTUFBTSxPQUFPLDhCQUE4QjtJQUd6QyxZQUFxQixJQUFZLEVBQVcsRUFBVSxFQUFXLE9BQWdCLEVBQVcsS0FBYztRQUFyRixTQUFJLEdBQUosSUFBSSxDQUFRO1FBQVcsT0FBRSxHQUFGLEVBQUUsQ0FBUTtRQUFXLFlBQU8sR0FBUCxPQUFPLENBQVM7UUFBVyxVQUFLLEdBQUwsS0FBSyxDQUFTO1FBRmpHLFNBQUksR0FBRyxnQ0FBZ0MsQ0FBQTtRQUc5QyxJQUFJLENBQUMsT0FBTyxHQUFHLFlBQVksSUFBSSxJQUFJLEVBQUUsaUJBQWlCLENBQUE7SUFDeEQsQ0FBQztDQUNGIn0=
|
package/dist/ext.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ext.d.ts","sourceRoot":"","sources":["../_src/ext.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA"}
|
package/dist/ext.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../_src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ParsedShapeOfCustom, MNModel, prop, literal, ReasonableString, defaultProp, date, optProp, ConstructorInputFromApi, GetProvidedProps } from "@effect-app/prelude/schema";
|
|
2
|
+
export declare const RequestId: import("@effect-app/prelude/schema").StringIdSchema & import("@effect-app/schema").Utils<import("@effect-app/prelude/schema").StringIdSchema> & {
|
|
3
|
+
make(this: void): import("@effect-app/prelude/schema").StringId;
|
|
4
|
+
};
|
|
5
|
+
export type RequestId = ParsedShapeOfCustom<typeof RequestId>;
|
|
6
|
+
declare const RequestContextParent_base: import("@effect-app/schema").MNModel<import("@effect-app/schema").SchemaProperties<{
|
|
7
|
+
_tag: import("@effect-app/schema").Property<import("@effect-app/schema").DefaultSchema<unknown, "RequestContext", "RequestContext", "RequestContext", import("@effect-app/schema").LiteralApi<["RequestContext"]>>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
8
|
+
id: import("@effect-app/schema").Property<import("@effect-app/prelude/schema").StringIdSchema & import("@effect-app/schema").Utils<import("@effect-app/prelude/schema").StringIdSchema> & {
|
|
9
|
+
make(this: void): import("@effect-app/prelude/schema").StringId;
|
|
10
|
+
}, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
11
|
+
name: import("@effect-app/schema").Property<import("@effect-app/schema").SchemaDefaultSchema<unknown, import("@effect-app/schema").ReasonableString, string, string, import("@effect-app/schema").ApiSelfType<import("@effect-app/schema").ReasonableString>> & import("@effect-app/schema").Utils<import("@effect-app/schema").SchemaDefaultSchema<unknown, import("@effect-app/schema").ReasonableString, string, string, import("@effect-app/schema").ApiSelfType<import("@effect-app/schema").ReasonableString>>>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
12
|
+
locale: import("@effect-app/schema").Property<import("@effect-app/schema").DefaultSchema<unknown, "en" | "de", "en" | "de", "en" | "de", import("@effect-app/schema").LiteralApi<["en", "de"]>>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
13
|
+
createdAt: import("@effect-app/schema").FromProperty<import("@effect-app/schema").SchemaDefaultSchema<unknown, Date, Date, string, {}>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").Some<["constructor", () => Date]>>;
|
|
14
|
+
}>, RequestContextParent, RequestContextParent.ConstructorInput, RequestContextParent.Encoded, RequestContextParent.Props> & import("@effect-app/schema").PropsExtensions<RequestContextParent.Props>;
|
|
15
|
+
export declare class RequestContextParent extends RequestContextParent_base {
|
|
16
|
+
}
|
|
17
|
+
/** @ignore @internal @deprecated */
|
|
18
|
+
export type RequestContextParentConstructor = typeof RequestContextParent;
|
|
19
|
+
export declare function makeRequestId(): import("@effect-app/prelude/schema").StringId;
|
|
20
|
+
declare const RequestContext_base: import("@effect-app/schema").MNModel<import("@effect-app/schema").SchemaProperties<{
|
|
21
|
+
id: import("@effect-app/schema").Property<import("@effect-app/schema").SchemaDefaultSchema<unknown, import("@effect-app/prelude/schema").StringId, string, string, import("@effect-app/schema").ApiSelfType<import("@effect-app/prelude/schema").StringId>>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").Some<["constructor", () => import("@effect-app/prelude/schema").StringId]>>;
|
|
22
|
+
rootId: import("@effect-app/schema").Property<import("@effect-app/prelude/schema").StringIdSchema & import("@effect-app/schema").Utils<import("@effect-app/prelude/schema").StringIdSchema> & {
|
|
23
|
+
make(this: void): import("@effect-app/prelude/schema").StringId;
|
|
24
|
+
}, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
25
|
+
parent: import("@effect-app/schema").Property<typeof RequestContextParent, "optional", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
26
|
+
_tag: import("@effect-app/schema").Property<import("@effect-app/schema").DefaultSchema<unknown, "RequestContext", "RequestContext", "RequestContext", import("@effect-app/schema").LiteralApi<["RequestContext"]>>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
27
|
+
name: import("@effect-app/schema").Property<import("@effect-app/schema").SchemaDefaultSchema<unknown, import("@effect-app/schema").ReasonableString, string, string, import("@effect-app/schema").ApiSelfType<import("@effect-app/schema").ReasonableString>> & import("@effect-app/schema").Utils<import("@effect-app/schema").SchemaDefaultSchema<unknown, import("@effect-app/schema").ReasonableString, string, string, import("@effect-app/schema").ApiSelfType<import("@effect-app/schema").ReasonableString>>>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
28
|
+
locale: import("@effect-app/schema").Property<import("@effect-app/schema").DefaultSchema<unknown, "en" | "de", "en" | "de", "en" | "de", import("@effect-app/schema").LiteralApi<["en", "de"]>>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").None>;
|
|
29
|
+
createdAt: import("@effect-app/schema").FromProperty<import("@effect-app/schema").SchemaDefaultSchema<unknown, Date, Date, string, {}>, "required", import("@fp-ts/data/Option").None, import("@fp-ts/data/Option").Some<["constructor", () => Date]>>;
|
|
30
|
+
}>, RequestContext, RequestContext.ConstructorInput, RequestContext.Encoded, RequestContext.Props> & import("@effect-app/schema").PropsExtensions<RequestContext.Props>;
|
|
31
|
+
/**
|
|
32
|
+
* @tsplus type RequestContext
|
|
33
|
+
* @tsplus companion RequestContext.Ops
|
|
34
|
+
*/
|
|
35
|
+
export declare class RequestContext extends RequestContext_base {
|
|
36
|
+
static inherit(this: void, parent: RequestContext, newSelf: RequestContextParent.ConstructorInput): RequestContext;
|
|
37
|
+
static toMonitoring(this: void, self: RequestContext): {
|
|
38
|
+
parentOperationName?: import("@effect-app/schema").ReasonableString | undefined;
|
|
39
|
+
parentLocale?: "en" | "de" | undefined;
|
|
40
|
+
operationName: import("@effect-app/schema").ReasonableString;
|
|
41
|
+
locale: "en" | "de";
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** @ignore @internal @deprecated */
|
|
45
|
+
export type RequestContextConstructor = typeof RequestContext;
|
|
46
|
+
/**
|
|
47
|
+
* @tsplus static RequestContext.Ops Tag
|
|
48
|
+
* @tsplus location "@effect-app/infra/lib/RequestContext"
|
|
49
|
+
*/
|
|
50
|
+
export declare const tag: import("@fp-ts/data/Context").Tag<RequestContext>;
|
|
51
|
+
export interface RequestContextParent {
|
|
52
|
+
readonly createdAt: Date;
|
|
53
|
+
readonly id: RequestId;
|
|
54
|
+
readonly locale: "de" | "en";
|
|
55
|
+
readonly name: ReasonableString;
|
|
56
|
+
}
|
|
57
|
+
export declare namespace RequestContextParent {
|
|
58
|
+
/**
|
|
59
|
+
* @tsplus type RequestContextParent.Encoded
|
|
60
|
+
*/
|
|
61
|
+
interface Encoded {
|
|
62
|
+
readonly createdAt: string;
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly locale: "de" | "en";
|
|
65
|
+
readonly name: string;
|
|
66
|
+
}
|
|
67
|
+
const Encoded: EncodedOps;
|
|
68
|
+
/**
|
|
69
|
+
* @tsplus type RequestContextParent.Encoded.Aspects
|
|
70
|
+
*/
|
|
71
|
+
interface EncodedAspects {
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @tsplus type RequestContextParent.Encoded.Ops
|
|
75
|
+
*/
|
|
76
|
+
interface EncodedOps {
|
|
77
|
+
$: EncodedAspects;
|
|
78
|
+
}
|
|
79
|
+
interface ConstructorInput extends ConstructorInputFromApi<typeof RequestContextParent> {
|
|
80
|
+
}
|
|
81
|
+
interface Props extends GetProvidedProps<typeof RequestContextParent> {
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export interface RequestContext {
|
|
85
|
+
readonly createdAt: Date;
|
|
86
|
+
readonly id: RequestId;
|
|
87
|
+
readonly locale: "de" | "en";
|
|
88
|
+
readonly name: ReasonableString;
|
|
89
|
+
readonly parent?: RequestContextParent | undefined;
|
|
90
|
+
readonly rootId: RequestId;
|
|
91
|
+
}
|
|
92
|
+
export declare namespace RequestContext {
|
|
93
|
+
/**
|
|
94
|
+
* @tsplus type RequestContext.Encoded
|
|
95
|
+
*/
|
|
96
|
+
interface Encoded {
|
|
97
|
+
readonly createdAt: string;
|
|
98
|
+
readonly id: string;
|
|
99
|
+
readonly locale: "de" | "en";
|
|
100
|
+
readonly name: string;
|
|
101
|
+
readonly parent?: RequestContextParent.Encoded | undefined;
|
|
102
|
+
readonly rootId: string;
|
|
103
|
+
}
|
|
104
|
+
const Encoded: EncodedOps;
|
|
105
|
+
/**
|
|
106
|
+
* @tsplus type RequestContext.Encoded.Aspects
|
|
107
|
+
*/
|
|
108
|
+
interface EncodedAspects {
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @tsplus type RequestContext.Encoded.Ops
|
|
112
|
+
*/
|
|
113
|
+
interface EncodedOps {
|
|
114
|
+
$: EncodedAspects;
|
|
115
|
+
}
|
|
116
|
+
interface ConstructorInput extends ConstructorInputFromApi<typeof RequestContext> {
|
|
117
|
+
}
|
|
118
|
+
interface Props extends GetProvidedProps<typeof RequestContext> {
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export {};
|
|
122
|
+
//# sourceMappingURL=RequestContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestContext.d.ts","sourceRoot":"","sources":["../../_src/lib/RequestContext.ts"],"names":[],"mappings":";AAAA,eAAO,MAAM,SAAS;;CAAW,CAAA;AACjC,MAAM,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,SAAS,CAAC,CAAA;;;;;;;;;;AAE7D,qBAAa,oBAAqB,SAAQ,yBAWxC;CAAG;AACL,oCAAoC;AACpC,MAAM,MAAM,+BAA+B,GAAG,OAAO,oBAAoB,CAAA;AAEzE,wBAAgB,aAAa,kDAE5B;;;;;;;;;;;;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAUlC;IACA,MAAM,CAAC,OAAO,CACZ,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,oBAAoB,CAAC,gBAAgB;IAShD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc;;;;;;CASrD;AAED,oCAAoC;AACpC,MAAM,MAAM,yBAAyB,GAAG,OAAO,cAAc,CAAA;;;;;AAK7D,eAAO,MAAM,GAAG,mDAAwB,CAAA;AAGxC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;CAChC;AACD,yBAAiB,oBAAoB,CAAC;IACpC;;OAEG;IACH,UAAiB,OAAO;QACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;QAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KACtB;IACM,MAAM,OAAO,EAAE,UAAsB,CAAA;IAC5C;;OAEG;IACH,UAAiB,cAAc;KAAG;IAClC;;OAEG;IACH,UAAiB,UAAU;QAAG,CAAC,EAAE,cAAc,CAAA;KAAE;IACjD,UAAiB,gBACf,SAAQ,uBAAuB,CAAC,OAAO,oBAAoB,CAAC;KAAG;IACjE,UAAiB,KAAM,SAAQ,gBAAgB,CAAC,OAAO,oBAAoB,CAAC;KAAG;CAChF;AACD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAA;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAC3B;AACD,yBAAiB,cAAc,CAAC;IAC9B;;OAEG;IACH,UAAiB,OAAO;QACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;QAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC,OAAO,GAAG,SAAS,CAAA;QAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KACxB;IACM,MAAM,OAAO,EAAE,UAAsB,CAAA;IAC5C;;OAEG;IACH,UAAiB,cAAc;KAAG;IAClC;;OAEG;IACH,UAAiB,UAAU;QAAG,CAAC,EAAE,cAAc,CAAA;KAAE;IACjD,UAAiB,gBACf,SAAQ,uBAAuB,CAAC,OAAO,cAAc,CAAC;KAAG;IAC3D,UAAiB,KAAM,SAAQ,gBAAgB,CAAC,OAAO,cAAc,CAAC;KAAG;CAC1E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as tsplus_module_1 from "@effect-app/prelude/schema";
|
|
2
|
+
import * as tsplus_module_2 from "@fp-ts/data/Context";
|
|
3
|
+
export const RequestId = tsplus_module_1.StringId;
|
|
4
|
+
export class RequestContextParent extends tsplus_module_1.MNModel()({
|
|
5
|
+
_tag: tsplus_module_1.prop(tsplus_module_1.literal("RequestContext")),
|
|
6
|
+
id: tsplus_module_1.prop(RequestId),
|
|
7
|
+
name: tsplus_module_1.prop(tsplus_module_1.ReasonableString),
|
|
8
|
+
locale: tsplus_module_1.prop(tsplus_module_1.literal("en", "de")),
|
|
9
|
+
createdAt: tsplus_module_1.defaultProp(tsplus_module_1.date)
|
|
10
|
+
}) {
|
|
11
|
+
}
|
|
12
|
+
export function makeRequestId() {
|
|
13
|
+
return RequestId.make();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @tsplus type RequestContext
|
|
17
|
+
* @tsplus companion RequestContext.Ops
|
|
18
|
+
*/
|
|
19
|
+
export class RequestContext extends tsplus_module_1.MNModel()({
|
|
20
|
+
...RequestContextParent.omit("id"),
|
|
21
|
+
id: tsplus_module_1.defaultProp(RequestId, makeRequestId),
|
|
22
|
+
rootId: tsplus_module_1.prop(RequestId),
|
|
23
|
+
parent: tsplus_module_1.optProp(RequestContextParent)
|
|
24
|
+
}) {
|
|
25
|
+
static inherit(parent, newSelf) {
|
|
26
|
+
return new RequestContext({
|
|
27
|
+
...newSelf,
|
|
28
|
+
rootId: parent.rootId,
|
|
29
|
+
parent
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
static toMonitoring(self) {
|
|
33
|
+
return {
|
|
34
|
+
operationName: self.name,
|
|
35
|
+
locale: self.locale,
|
|
36
|
+
...(self.parent
|
|
37
|
+
? { parentOperationName: self.parent.name, parentLocale: self.parent.locale }
|
|
38
|
+
: {})
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @tsplus static RequestContext.Ops Tag
|
|
44
|
+
*/
|
|
45
|
+
export const tag = tsplus_module_2.Tag();
|
|
46
|
+
(function (RequestContextParent) {
|
|
47
|
+
RequestContextParent.Encoded = { $: {} };
|
|
48
|
+
})(RequestContextParent || (RequestContextParent = {}));
|
|
49
|
+
(function (RequestContext) {
|
|
50
|
+
RequestContext.Encoded = { $: {} };
|
|
51
|
+
})(RequestContext || (RequestContext = {}));
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVxdWVzdENvbnRleHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9fc3JjL2xpYi9SZXF1ZXN0Q29udGV4dC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sQ0FBQyxNQUFNLFNBQVMsbUJBQUcsUUFBUSxDQUFBO0FBR2pDLE1BQU0sT0FBTyxvQkFBcUIsU0FBUSxnQkFBQSxPQUFPLEVBSzlDLENBQUM7SUFDRixJQUFJLEVBQUUsZ0JBQUEsSUFBSSxDQUFDLGdCQUFBLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO0lBQ3JDLEVBQUUsRUFBRSxnQkFBQSxJQUFJLENBQUMsU0FBUyxDQUFDO0lBQ25CLElBQUksRUFBRSxnQkFBQSxJQUFJLGlCQUFDLGdCQUFnQixDQUFDO0lBQzVCLE1BQU0sRUFBRSxnQkFBQSxJQUFJLENBQUMsZ0JBQUEsT0FBTyxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztJQUNqQyxTQUFTLEVBQUUsZ0JBQUEsV0FBVyxpQkFBQyxJQUFJLENBQUM7Q0FDN0IsQ0FBQztDQUFHO0FBSUwsTUFBTSxVQUFVLGFBQWE7SUFDM0IsT0FBTyxTQUFTLENBQUMsSUFBSSxFQUFFLENBQUE7QUFDekIsQ0FBQztBQUVEOzs7R0FHRztBQUNILE1BQU0sT0FBTyxjQUFlLFNBQVEsZ0JBQUEsT0FBTyxFQUt4QyxDQUFDO0lBQ0YsR0FBRyxvQkFBb0IsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDO0lBQ2xDLEVBQUUsRUFBRSxnQkFBQSxXQUFXLENBQUMsU0FBUyxFQUFFLGFBQWEsQ0FBQztJQUN6QyxNQUFNLEVBQUUsZ0JBQUEsSUFBSSxDQUFDLFNBQVMsQ0FBQztJQUN2QixNQUFNLEVBQUUsZ0JBQUEsT0FBTyxDQUFDLG9CQUFvQixDQUFDO0NBQ3RDLENBQUM7SUFDQSxNQUFNLENBQUMsT0FBTyxDQUVaLE1BQXNCLEVBQ3RCLE9BQThDO1FBRTlDLE9BQU8sSUFBSSxjQUFjLENBQUM7WUFDeEIsR0FBRyxPQUFPO1lBQ1YsTUFBTSxFQUFFLE1BQU0sQ0FBQyxNQUFNO1lBQ3JCLE1BQU07U0FDUCxDQUFDLENBQUE7SUFDSixDQUFDO0lBRUQsTUFBTSxDQUFDLFlBQVksQ0FBYSxJQUFvQjtRQUNsRCxPQUFPO1lBQ0wsYUFBYSxFQUFFLElBQUksQ0FBQyxJQUFJO1lBQ3hCLE1BQU0sRUFBRSxJQUFJLENBQUMsTUFBTTtZQUNuQixHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU07Z0JBQ2IsQ0FBQyxDQUFDLEVBQUUsbUJBQW1CLEVBQUUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsWUFBWSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO2dCQUM3RSxDQUFDLENBQUMsRUFBRSxDQUFDO1NBQ1IsQ0FBQTtJQUNILENBQUM7Q0FDRjtBQUtEOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sR0FBRyxHQUFHLGdCQUFBLEdBQUcsRUFBa0IsQ0FBQTtBQVN4QyxXQUFpQixvQkFBb0I7SUFVdEIsNEJBQU8sR0FBZSxFQUFFLENBQUMsRUFBRSxFQUFFLEVBQUUsQ0FBQTtBQVk5QyxDQUFDLEVBdEJnQixvQkFBb0IsS0FBcEIsb0JBQW9CLFFBc0JwQztBQVNELFdBQWlCLGNBQWM7SUFZaEIsc0JBQU8sR0FBZSxFQUFFLENBQUMsRUFBRSxFQUFFLEVBQUUsQ0FBQTtBQVk5QyxDQUFDLEVBeEJnQixjQUFjLEtBQWQsY0FBYyxRQXdCOUIifQ==
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Ex from "@effect-app/infra-adapters/express/index";
|
|
2
|
+
export declare const checkJwt: (audience: string, issuer: string) => {
|
|
3
|
+
(req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: import("express").Response<any, Record<string, any>>, next: import("express").NextFunction): Promise<any>;
|
|
4
|
+
unless: typeof import("express-unless").unless;
|
|
5
|
+
};
|
|
6
|
+
export declare const scopes: Ex.EffectRequestHandler<never, Ex.ParamsDictionary, any, any, Ex.ParsedQs, Record<string, any>>;
|
|
7
|
+
//# sourceMappingURL=authorization.jwt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.jwt.d.ts","sourceRoot":"","sources":["../../../_src/lib/api/authorization.jwt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAA;AAQ9D,eAAO,MAAM,QAAQ,aAAc,MAAM,UAAU,MAAM;;;CAgBrD,CAAA;AAUJ,eAAO,MAAM,MAAM,iGAA2B,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// import { configM, UserSVC } from "@/services.js"
|
|
2
|
+
import * as Ex from "@effect-app/infra-adapters/express/index";
|
|
3
|
+
import { expressjwt } from "express-jwt";
|
|
4
|
+
import jwtAuthz from "express-jwt-authz";
|
|
5
|
+
import jwksRsa from "jwks-rsa";
|
|
6
|
+
// Authorization middleware. When used, the
|
|
7
|
+
// Access Token must exist and be verified against
|
|
8
|
+
// the Auth0 JSON Web Key Set
|
|
9
|
+
export const checkJwt = (audience, issuer) => expressjwt({
|
|
10
|
+
// Dynamically provide a signing key
|
|
11
|
+
// based on the kid in the header and
|
|
12
|
+
// the signing keys provided by the JWKS endpoint.
|
|
13
|
+
secret: jwksRsa.expressJwtSecret({
|
|
14
|
+
cache: true,
|
|
15
|
+
rateLimit: true,
|
|
16
|
+
jwksRequestsPerMinute: 5,
|
|
17
|
+
jwksUri: `${issuer}/.well-known/jwks.json`
|
|
18
|
+
}),
|
|
19
|
+
// Validate the audience and the issuer.
|
|
20
|
+
audience,
|
|
21
|
+
issuer: [issuer + "/"],
|
|
22
|
+
algorithms: ["RS256"]
|
|
23
|
+
});
|
|
24
|
+
const demandScopes = jwtAuthz([]);
|
|
25
|
+
// export const auth = configM(
|
|
26
|
+
// (cfg) =>
|
|
27
|
+
// cfg.AUTH_DISABLED
|
|
28
|
+
// ? Effect.unit
|
|
29
|
+
// : Ex.use(Ex.classic(checkJwt)) > Ex.use(Ex.classic(demandScopes)) // TODO
|
|
30
|
+
// )
|
|
31
|
+
export const scopes = Ex.classic(demandScopes);
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5qd3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9fc3JjL2xpYi9hcGkvYXV0aG9yaXphdGlvbi5qd3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsbURBQW1EO0FBQ25ELE9BQU8sS0FBSyxFQUFFLE1BQU0sMENBQTBDLENBQUE7QUFDOUQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGFBQWEsQ0FBQTtBQUN4QyxPQUFPLFFBQVEsTUFBTSxtQkFBbUIsQ0FBQTtBQUN4QyxPQUFPLE9BQU8sTUFBTSxVQUFVLENBQUE7QUFFOUIsMkNBQTJDO0FBQzNDLGtEQUFrRDtBQUNsRCw2QkFBNkI7QUFDN0IsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLENBQUMsUUFBZ0IsRUFBRSxNQUFjLEVBQUUsRUFBRSxDQUMzRCxVQUFVLENBQUM7SUFDVCxvQ0FBb0M7SUFDcEMscUNBQXFDO0lBQ3JDLGtEQUFrRDtJQUNsRCxNQUFNLEVBQUUsT0FBTyxDQUFDLGdCQUFnQixDQUFDO1FBQy9CLEtBQUssRUFBRSxJQUFJO1FBQ1gsU0FBUyxFQUFFLElBQUk7UUFDZixxQkFBcUIsRUFBRSxDQUFDO1FBQ3hCLE9BQU8sRUFBRSxHQUFHLE1BQU0sd0JBQXdCO0tBQzNDLENBQStCO0lBRWhDLHdDQUF3QztJQUN4QyxRQUFRO0lBQ1IsTUFBTSxFQUFFLENBQUMsTUFBTSxHQUFHLEdBQUcsQ0FBQztJQUN0QixVQUFVLEVBQUUsQ0FBQyxPQUFPLENBQUM7Q0FDdEIsQ0FBQyxDQUFBO0FBRUosTUFBTSxZQUFZLEdBQUcsUUFBUSxDQUFDLEVBQUUsQ0FBQyxDQUFBO0FBRWpDLCtCQUErQjtBQUMvQixhQUFhO0FBQ2Isd0JBQXdCO0FBQ3hCLHNCQUFzQjtBQUN0QixrRkFBa0Y7QUFDbEYsSUFBSTtBQUNKLE1BQU0sQ0FBQyxNQUFNLE1BQU0sR0FBRyxFQUFFLENBQUMsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFBIn0=
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Effect } from "@effect/io/Effect";
|
|
2
|
+
import type express from "express";
|
|
3
|
+
import type { InvalidStateError, NotFoundError, NotLoggedInError, OptimisticConcurrencyException, UnauthorizedError, ValidationError } from "../../errors.js";
|
|
4
|
+
import type { RequestContext } from "../RequestContext.js";
|
|
5
|
+
export declare function defaultBasicErrorHandler<R>(_req: express.Request, res: express.Response, _requestContext: RequestContext, r2: Effect<R, ValidationError, void>): import("@effect/io/Effect").Effect<RequestContext | R, never, void>;
|
|
6
|
+
export declare function defaultErrorHandler<R>(req: express.Request, res: express.Response, _: RequestContext, r2: Effect<R, SupportedErrors, void>): import("@effect/io/Effect").Effect<RequestContext | R, never, void>;
|
|
7
|
+
export type SupportedErrors = ValidationError | NotFoundError | NotLoggedInError | UnauthorizedError | InvalidStateError | OptimisticConcurrencyException;
|
|
8
|
+
//# sourceMappingURL=defaultErrorHandler.d.ts.map
|