effect-app 4.0.0-beta.99 → 4.0.1
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/CHANGELOG.md +2042 -0
- package/dist/Array.d.ts +1 -17
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +3 -27
- package/dist/Chunk.d.ts +3 -27
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +4 -39
- package/dist/Config/SecretURL.d.ts +3 -1
- package/dist/Config/SecretURL.d.ts.map +1 -1
- package/dist/Config/SecretURL.js +3 -6
- package/dist/Config/internal/configSecretURL.d.ts.map +1 -1
- package/dist/Config/internal/configSecretURL.js +2 -2
- package/dist/Config.d.ts +0 -5
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +7 -5
- package/dist/ConfigProvider.d.ts +0 -37
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +5 -41
- package/dist/Context.d.ts +6 -4
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +4 -3
- package/dist/DataDependencies.d.ts +136 -0
- package/dist/DataDependencies.d.ts.map +1 -0
- package/dist/DataDependencies.js +112 -0
- package/dist/DateTime.d.ts +33 -0
- package/dist/DateTime.d.ts.map +1 -0
- package/dist/DateTime.js +18 -0
- package/dist/Effect.d.ts +3 -14
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +8 -26
- package/dist/Emailer.d.ts +51 -0
- package/dist/Emailer.d.ts.map +1 -0
- package/dist/Emailer.js +7 -0
- package/dist/Function.d.ts +0 -4
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +1 -7
- package/dist/Layer.d.ts +6 -3
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +3 -2
- package/dist/Model/Repository/Registry.d.ts +22 -0
- package/dist/Model/Repository/Registry.d.ts.map +1 -0
- package/dist/Model/Repository/Registry.js +18 -0
- package/dist/Model/Repository/dependency.d.ts +6 -0
- package/dist/Model/Repository/dependency.d.ts.map +1 -0
- package/dist/Model/Repository/dependency.js +29 -0
- package/dist/Model/Repository/ext.d.ts +60 -0
- package/dist/Model/Repository/ext.d.ts.map +1 -0
- package/dist/Model/Repository/ext.js +124 -0
- package/dist/Model/Repository/internal/internal.d.ts +68 -0
- package/dist/Model/Repository/internal/internal.d.ts.map +1 -0
- package/dist/Model/Repository/internal/internal.js +610 -0
- package/dist/Model/Repository/legacy.d.ts +21 -0
- package/dist/Model/Repository/legacy.d.ts.map +1 -0
- package/dist/Model/Repository/legacy.js +2 -0
- package/dist/Model/Repository/makeRepo.d.ts +71 -0
- package/dist/Model/Repository/makeRepo.d.ts.map +1 -0
- package/dist/Model/Repository/makeRepo.js +30 -0
- package/dist/Model/Repository/service.d.ts +121 -0
- package/dist/Model/Repository/service.d.ts.map +1 -0
- package/dist/Model/Repository/service.js +2 -0
- package/dist/Model/Repository/validation.d.ts +72 -0
- package/dist/Model/Repository/validation.d.ts.map +1 -0
- package/dist/Model/Repository/validation.js +39 -0
- package/dist/Model/Repository.d.ts +8 -0
- package/dist/Model/Repository.d.ts.map +1 -0
- package/dist/Model/Repository.js +8 -0
- package/dist/Model/dsl.d.ts +34 -0
- package/dist/Model/dsl.d.ts.map +1 -0
- package/dist/Model/dsl.js +45 -0
- package/dist/Model/filter/filterApi.d.ts +30 -0
- package/dist/Model/filter/filterApi.d.ts.map +1 -0
- package/dist/Model/filter/filterApi.js +2 -0
- package/dist/Model/filter/types/errors.d.ts +29 -0
- package/dist/Model/filter/types/errors.d.ts.map +1 -0
- package/dist/Model/filter/types/errors.js +2 -0
- package/dist/Model/filter/types/fields.d.ts +15 -0
- package/dist/Model/filter/types/fields.d.ts.map +1 -0
- package/dist/Model/filter/types/fields.js +2 -0
- package/dist/Model/filter/types/path/common.d.ts +316 -0
- package/dist/Model/filter/types/path/common.d.ts.map +1 -0
- package/dist/Model/filter/types/path/common.js +2 -0
- package/dist/Model/filter/types/path/eager.d.ts +94 -0
- package/dist/Model/filter/types/path/eager.d.ts.map +1 -0
- package/dist/Model/filter/types/path/eager.js +36 -0
- package/dist/Model/filter/types/path/index.d.ts +4 -0
- package/dist/Model/filter/types/path/index.d.ts.map +1 -0
- package/dist/Model/filter/types/path/index.js +3 -0
- package/dist/Model/filter/types/utils.d.ts +79 -0
- package/dist/Model/filter/types/utils.d.ts.map +1 -0
- package/dist/Model/filter/types/utils.js +2 -0
- package/dist/Model/filter/types/validator.d.ts +30 -0
- package/dist/Model/filter/types/validator.d.ts.map +1 -0
- package/dist/Model/filter/types/validator.js +2 -0
- package/dist/Model/filter/types.d.ts +5 -0
- package/dist/Model/filter/types.d.ts.map +1 -0
- package/dist/Model/filter/types.js +7 -0
- package/dist/Model/query/dsl.d.ts +630 -0
- package/dist/Model/query/dsl.d.ts.map +1 -0
- package/dist/Model/query/dsl.js +376 -0
- package/dist/Model/query/new-kid-interpreter.d.ts +132 -0
- package/dist/Model/query/new-kid-interpreter.d.ts.map +1 -0
- package/dist/Model/query/new-kid-interpreter.js +369 -0
- package/dist/Model/query.d.ts +15 -0
- package/dist/Model/query.d.ts.map +1 -0
- package/dist/Model/query.js +3 -0
- package/dist/Model.d.ts +6 -0
- package/dist/Model.d.ts.map +1 -0
- package/dist/Model.js +6 -0
- package/dist/NonEmptySet.d.ts +3 -1
- package/dist/NonEmptySet.d.ts.map +1 -1
- package/dist/NonEmptySet.js +2 -2
- package/dist/Option.d.ts +1 -2
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +3 -7
- package/dist/Pure.d.ts +9 -7
- package/dist/Pure.d.ts.map +1 -1
- package/dist/Pure.js +20 -17
- package/dist/QueueMaker.d.ts +11 -0
- package/dist/QueueMaker.d.ts.map +1 -0
- package/dist/QueueMaker.js +11 -0
- package/dist/RequestContext.d.ts +87 -0
- package/dist/RequestContext.d.ts.map +1 -0
- package/dist/RequestContext.js +45 -0
- package/dist/RequestScopedDependencies.d.ts +21 -0
- package/dist/RequestScopedDependencies.d.ts.map +1 -0
- package/dist/RequestScopedDependencies.js +16 -0
- package/dist/Schema/Class.d.ts +163 -16
- package/dist/Schema/Class.d.ts.map +1 -1
- package/dist/Schema/Class.js +193 -21
- package/dist/Schema/FastCheck.d.ts.map +1 -1
- package/dist/Schema/SchemaParser.d.ts +5 -0
- package/dist/Schema/SchemaParser.d.ts.map +1 -0
- package/dist/Schema/SchemaParser.js +6 -0
- package/dist/Schema/SpecialJsonSchema.d.ts +15 -2
- package/dist/Schema/SpecialJsonSchema.d.ts.map +1 -1
- package/dist/Schema/SpecialJsonSchema.js +70 -12
- package/dist/Schema/SpecialOpenApi.d.ts +1 -1
- package/dist/Schema/SpecialOpenApi.js +3 -3
- package/dist/Schema/brand.d.ts +5 -5
- package/dist/Schema/brand.d.ts.map +1 -1
- package/dist/Schema/brand.js +6 -4
- package/dist/Schema/email.d.ts.map +1 -1
- package/dist/Schema/email.js +8 -5
- package/dist/Schema/ext.d.ts +279 -75
- package/dist/Schema/ext.d.ts.map +1 -1
- package/dist/Schema/ext.js +330 -72
- package/dist/Schema/moreStrings.d.ts +82 -48
- package/dist/Schema/moreStrings.d.ts.map +1 -1
- package/dist/Schema/moreStrings.js +85 -51
- package/dist/Schema/numbers.d.ts +33 -21
- package/dist/Schema/numbers.d.ts.map +1 -1
- package/dist/Schema/numbers.js +64 -12
- package/dist/Schema/phoneNumber.d.ts.map +1 -1
- package/dist/Schema/phoneNumber.js +6 -6
- package/dist/Schema/schema.d.ts +1 -1
- package/dist/Schema/schema.d.ts.map +1 -1
- package/dist/Schema/schema.js +2 -2
- package/dist/Schema/strings.d.ts +18 -4
- package/dist/Schema/strings.d.ts.map +1 -1
- package/dist/Schema/strings.js +1 -5
- package/dist/Schema.d.ts +224 -7
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +190 -24
- package/dist/SchemaAST.d.ts +2 -0
- package/dist/SchemaAST.d.ts.map +1 -0
- package/dist/SchemaAST.js +2 -0
- package/dist/Set.d.ts +4 -1
- package/dist/Set.d.ts.map +1 -1
- package/dist/Set.js +8 -6
- package/dist/Store.d.ts +215 -0
- package/dist/Store.d.ts.map +1 -0
- package/dist/Store.js +113 -0
- package/dist/_ext/Array.d.ts +1 -1
- package/dist/_ext/Array.d.ts.map +1 -1
- package/dist/_ext/Array.js +4 -2
- package/dist/_ext/ord.ext.d.ts +2 -1
- package/dist/_ext/ord.ext.d.ts.map +1 -1
- package/dist/_ext/ord.ext.js +2 -2
- package/dist/builtin.d.ts +2 -14
- package/dist/builtin.d.ts.map +1 -1
- package/dist/builtin.js +1 -1
- package/dist/client/InvalidationKeys.d.ts +30 -0
- package/dist/client/InvalidationKeys.d.ts.map +1 -0
- package/dist/client/InvalidationKeys.js +37 -0
- package/dist/client/apiClientFactory.d.ts +13 -8
- package/dist/client/apiClientFactory.d.ts.map +1 -1
- package/dist/client/apiClientFactory.js +154 -34
- package/dist/client/clientFor.d.ts +48 -13
- package/dist/client/clientFor.d.ts.map +1 -1
- package/dist/client/clientFor.js +9 -1
- package/dist/client/errors.d.ts +74 -28
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js +41 -10
- package/dist/client/makeClient.d.ts +487 -32
- package/dist/client/makeClient.d.ts.map +1 -1
- package/dist/client/makeClient.js +47 -21
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -1
- package/dist/faker.d.ts.map +1 -1
- package/dist/http/Request.d.ts +2 -2
- package/dist/http/Request.d.ts.map +1 -1
- package/dist/http/Request.js +2 -2
- package/dist/http/internal/lib.d.ts +12 -12
- package/dist/http/internal/lib.d.ts.map +1 -1
- package/dist/http/internal/lib.js +13 -13
- package/dist/ids.d.ts +32 -14
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +38 -7
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/middleware.d.ts +12 -6
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +13 -7
- package/dist/migration/nativeEffect.d.ts +21 -0
- package/dist/migration/nativeEffect.d.ts.map +1 -0
- package/dist/migration/nativeEffect.js +598 -0
- package/dist/rpc/Invalidation.d.ts +1124 -0
- package/dist/rpc/Invalidation.d.ts.map +1 -0
- package/dist/rpc/Invalidation.js +178 -0
- package/dist/rpc/MiddlewareMaker.d.ts +10 -7
- package/dist/rpc/MiddlewareMaker.d.ts.map +1 -1
- package/dist/rpc/MiddlewareMaker.js +57 -37
- package/dist/rpc/RpcContextMap.d.ts +2 -2
- package/dist/rpc/RpcContextMap.d.ts.map +1 -1
- package/dist/rpc/RpcMiddleware.d.ts +13 -10
- package/dist/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/rpc/RpcMiddleware.js +2 -2
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +2 -2
- package/dist/runtime.d.ts +19 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +40 -0
- package/dist/setupRequest.d.ts +20 -0
- package/dist/setupRequest.d.ts.map +1 -0
- package/dist/setupRequest.js +72 -0
- package/dist/toast.d.ts +51 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +34 -0
- package/dist/transform.d.ts +1 -1
- package/dist/transform.d.ts.map +1 -1
- package/dist/transform.js +4 -5
- package/dist/utils/effectify.d.ts +1 -1
- package/dist/utils/effectify.d.ts.map +1 -1
- package/dist/utils/effectify.js +2 -2
- package/dist/utils/extend.d.ts +6 -1
- package/dist/utils/extend.d.ts.map +1 -1
- package/dist/utils/extend.js +24 -6
- package/dist/utils/gen.d.ts +4 -4
- package/dist/utils/gen.d.ts.map +1 -1
- package/dist/utils/logLevel.d.ts +2 -2
- package/dist/utils/logLevel.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +2 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +2 -2
- package/dist/utils.d.ts +34 -45
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +33 -49
- package/dist/validation/validators.d.ts.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/dist/withToast.d.ts +30 -0
- package/dist/withToast.d.ts.map +1 -0
- package/dist/withToast.js +64 -0
- package/package.json +25 -266
- package/src/Array.ts +7 -39
- package/src/Chunk.ts +6 -55
- package/src/Config/SecretURL.ts +6 -3
- package/src/Config/internal/configSecretURL.ts +2 -2
- package/src/Config.ts +6 -13
- package/src/ConfigProvider.ts +4 -47
- package/src/Context.ts +9 -8
- package/src/DataDependencies.ts +171 -0
- package/src/DateTime.ts +473 -0
- package/src/Effect.ts +10 -32
- package/src/Emailer.ts +51 -0
- package/src/Function.ts +0 -7
- package/src/Inputify.type.ts +1 -1
- package/src/Layer.ts +8 -5
- package/src/Model/Repository/Registry.ts +35 -0
- package/src/Model/Repository/dependency.ts +32 -0
- package/src/Model/Repository/ext.ts +374 -0
- package/src/Model/Repository/internal/internal.ts +987 -0
- package/src/Model/Repository/legacy.ts +29 -0
- package/src/Model/Repository/makeRepo.ts +168 -0
- package/src/Model/Repository/service.ts +676 -0
- package/src/Model/Repository/validation.ts +38 -0
- package/src/Model/Repository.ts +7 -0
- package/src/Model/dsl.ts +130 -0
- package/src/Model/filter/filterApi.ts +78 -0
- package/src/Model/filter/types/errors.ts +47 -0
- package/src/Model/filter/types/fields.ts +50 -0
- package/src/Model/filter/types/path/common.ts +404 -0
- package/src/Model/filter/types/path/eager.ts +329 -0
- package/src/Model/filter/types/path/index.ts +4 -0
- package/src/Model/filter/types/utils.ts +128 -0
- package/src/Model/filter/types/validator.ts +46 -0
- package/src/Model/filter/types.ts +6 -0
- package/src/Model/query/dsl.ts +3092 -0
- package/src/Model/query/new-kid-interpreter.ts +531 -0
- package/src/Model/query.ts +13 -0
- package/src/Model.ts +5 -0
- package/src/NonEmptySet.ts +6 -4
- package/src/Option.ts +3 -8
- package/src/Pure.ts +20 -17
- package/src/QueueMaker.ts +11 -0
- package/src/RequestContext.ts +48 -0
- package/src/RequestScopedDependencies.ts +45 -0
- package/src/Schema/Class.ts +550 -56
- package/src/Schema/SchemaParser.ts +12 -0
- package/src/Schema/SpecialJsonSchema.ts +75 -7
- package/src/Schema/SpecialOpenApi.ts +5 -5
- package/src/Schema/brand.ts +27 -12
- package/src/Schema/email.ts +9 -7
- package/src/Schema/ext.ts +405 -95
- package/src/Schema/moreStrings.ts +213 -88
- package/src/Schema/numbers.ts +107 -29
- package/src/Schema/phoneNumber.ts +8 -9
- package/src/Schema/schema.ts +1 -1
- package/src/Schema/strings.ts +23 -14
- package/src/Schema.ts +403 -46
- package/src/SchemaAST.ts +1 -0
- package/src/Set.ts +10 -5
- package/src/Store.ts +325 -0
- package/src/_ext/Array.ts +4 -2
- package/src/_ext/ord.ext.ts +2 -1
- package/src/builtin-json.d.ts +24 -0
- package/src/builtin.ts +16 -21
- package/src/client/InvalidationKeys.ts +55 -0
- package/src/client/apiClientFactory.ts +295 -129
- package/src/client/clientFor.ts +101 -33
- package/src/client/errors.ts +66 -20
- package/src/client/makeClient.ts +519 -60
- package/src/client.ts +6 -4
- package/src/http/Request.ts +4 -4
- package/src/http/internal/lib.ts +12 -12
- package/src/http.ts +1 -1
- package/src/ids.ts +45 -8
- package/src/index.ts +20 -16
- package/src/middleware.ts +12 -8
- package/src/migration/nativeEffect.ts +645 -0
- package/src/rpc/Invalidation.ts +278 -0
- package/src/rpc/MiddlewareMaker.ts +86 -79
- package/src/rpc/README.md +2 -2
- package/src/rpc/RpcContextMap.ts +4 -4
- package/src/rpc/RpcMiddleware.ts +18 -13
- package/src/rpc.ts +4 -4
- package/src/runtime.ts +57 -0
- package/src/setupRequest.ts +138 -0
- package/src/toast.ts +54 -0
- package/src/transform.ts +4 -4
- package/src/utils/effectify.ts +1 -1
- package/src/utils/extend.ts +24 -5
- package/src/utils/gen.ts +7 -7
- package/src/utils/logLevel.ts +1 -1
- package/src/utils/logger.ts +3 -2
- package/src/utils.ts +85 -175
- package/src/validation.ts +2 -2
- package/src/withToast.ts +133 -0
- package/test/dateTimeLocal.test.ts +55 -0
- package/test/dist/dateTimeLocal.test.d.ts.map +1 -0
- package/test/dist/nativeEffectMigration.test.d.ts.map +1 -0
- package/test/dist/rpc.test.d.ts.map +1 -1
- package/test/dist/rpcMiddlewareContext.test.d.ts.map +1 -0
- package/test/moreStrings.test.ts +55 -10
- package/test/nativeEffectMigration.test.ts +77 -0
- package/test/rpc.test.ts +28 -11
- package/test/rpcMiddlewareContext.test.ts +63 -0
- package/test/schema.test.ts +318 -55
- package/test/secretURL.test.ts +4 -1
- package/test/special.test.ts +663 -131
- package/test/utils.test.ts +5 -5
- package/tsconfig.base.json +6 -4
- package/tsconfig.json +9 -1
- package/tsconfig.src.json +29 -29
- package/tsconfig.test.json +2 -2
- package/dist/Operations.d.ts +0 -124
- package/dist/Operations.d.ts.map +0 -1
- package/dist/Operations.js +0 -29
- package/dist/_ext/date.d.ts +0 -15
- package/dist/_ext/date.d.ts.map +0 -1
- package/dist/_ext/date.js +0 -16
- package/dist/_ext/misc.d.ts +0 -14
- package/dist/_ext/misc.d.ts.map +0 -1
- package/dist/_ext/misc.js +0 -17
- package/eslint.config.mjs +0 -26
- package/src/Operations.ts +0 -55
- package/src/_ext/date.ts +0 -27
- package/src/_ext/misc.ts +0 -46
- package/tsconfig.json.bak +0 -12
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-app",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/effect-app/libs.git",
|
|
9
|
+
"directory": "packages/effect-app"
|
|
10
|
+
},
|
|
6
11
|
"dependencies": {
|
|
7
12
|
"@tsconfig/strictest": "^2.0.8",
|
|
8
|
-
"
|
|
9
|
-
"nanoid": "^5.1.7",
|
|
13
|
+
"nanoid": "^5.1.11",
|
|
10
14
|
"path-parser": "^6.1.0",
|
|
11
|
-
"query-string": "^9.
|
|
12
|
-
"ts-pattern": "^5.9.0",
|
|
15
|
+
"query-string": "^9.4.0",
|
|
13
16
|
"ts-toolbelt": "^9.6.0",
|
|
14
|
-
"uuid": "^13.0.0",
|
|
15
17
|
"validator": "^13.15.35"
|
|
16
18
|
},
|
|
17
19
|
"devDependencies": {
|
|
18
20
|
"@faker-js/faker": "^8.4.1",
|
|
19
|
-
"@types/node": "25.
|
|
20
|
-
"@types/uuid": "^11.0.0",
|
|
21
|
+
"@types/node": "25.9.1",
|
|
21
22
|
"@types/validator": "^13.15.10",
|
|
22
|
-
"fast-check": "
|
|
23
|
-
"typescript": "~6.0.
|
|
24
|
-
"vitest": "^4.1.
|
|
25
|
-
"@effect-app/eslint-shared-config": "0.5.7-beta.9"
|
|
23
|
+
"fast-check": "^4.9.0",
|
|
24
|
+
"typescript": "~6.0.3",
|
|
25
|
+
"vitest": "^4.1.7"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"effect": "^4.0.
|
|
28
|
+
"effect": "^4.0.1"
|
|
29
29
|
},
|
|
30
30
|
"typesVersions": {
|
|
31
31
|
"*": {
|
|
@@ -39,249 +39,10 @@
|
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
40
40
|
"default": "./dist/index.js"
|
|
41
41
|
},
|
|
42
|
-
"./
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
"./Chunk": {
|
|
47
|
-
"types": "./dist/Chunk.d.ts",
|
|
48
|
-
"default": "./dist/Chunk.js"
|
|
49
|
-
},
|
|
50
|
-
"./Config": {
|
|
51
|
-
"types": "./dist/Config.d.ts",
|
|
52
|
-
"default": "./dist/Config.js"
|
|
53
|
-
},
|
|
54
|
-
"./Config/SecretURL": {
|
|
55
|
-
"types": "./dist/Config/SecretURL.d.ts",
|
|
56
|
-
"default": "./dist/Config/SecretURL.js"
|
|
57
|
-
},
|
|
58
|
-
"./ConfigProvider": {
|
|
59
|
-
"types": "./dist/ConfigProvider.d.ts",
|
|
60
|
-
"default": "./dist/ConfigProvider.js"
|
|
61
|
-
},
|
|
62
|
-
"./Context": {
|
|
63
|
-
"types": "./dist/Context.d.ts",
|
|
64
|
-
"default": "./dist/Context.js"
|
|
65
|
-
},
|
|
66
|
-
"./Effect": {
|
|
67
|
-
"types": "./dist/Effect.d.ts",
|
|
68
|
-
"default": "./dist/Effect.js"
|
|
69
|
-
},
|
|
70
|
-
"./Function": {
|
|
71
|
-
"types": "./dist/Function.d.ts",
|
|
72
|
-
"default": "./dist/Function.js"
|
|
73
|
-
},
|
|
74
|
-
"./Inputify.type": {
|
|
75
|
-
"types": "./dist/Inputify.type.d.ts",
|
|
76
|
-
"default": "./dist/Inputify.type.js"
|
|
77
|
-
},
|
|
78
|
-
"./Layer": {
|
|
79
|
-
"types": "./dist/Layer.d.ts",
|
|
80
|
-
"default": "./dist/Layer.js"
|
|
81
|
-
},
|
|
82
|
-
"./NonEmptySet": {
|
|
83
|
-
"types": "./dist/NonEmptySet.d.ts",
|
|
84
|
-
"default": "./dist/NonEmptySet.js"
|
|
85
|
-
},
|
|
86
|
-
"./Operations": {
|
|
87
|
-
"types": "./dist/Operations.d.ts",
|
|
88
|
-
"default": "./dist/Operations.js"
|
|
89
|
-
},
|
|
90
|
-
"./Option": {
|
|
91
|
-
"types": "./dist/Option.d.ts",
|
|
92
|
-
"default": "./dist/Option.js"
|
|
93
|
-
},
|
|
94
|
-
"./Pure": {
|
|
95
|
-
"types": "./dist/Pure.d.ts",
|
|
96
|
-
"default": "./dist/Pure.js"
|
|
97
|
-
},
|
|
98
|
-
"./Schema": {
|
|
99
|
-
"types": "./dist/Schema.d.ts",
|
|
100
|
-
"default": "./dist/Schema.js"
|
|
101
|
-
},
|
|
102
|
-
"./Schema/Class": {
|
|
103
|
-
"types": "./dist/Schema/Class.d.ts",
|
|
104
|
-
"default": "./dist/Schema/Class.js"
|
|
105
|
-
},
|
|
106
|
-
"./Schema/FastCheck": {
|
|
107
|
-
"types": "./dist/Schema/FastCheck.d.ts",
|
|
108
|
-
"default": "./dist/Schema/FastCheck.js"
|
|
109
|
-
},
|
|
110
|
-
"./Schema/Methods": {
|
|
111
|
-
"types": "./dist/Schema/Methods.d.ts",
|
|
112
|
-
"default": "./dist/Schema/Methods.js"
|
|
113
|
-
},
|
|
114
|
-
"./Schema/SpecialJsonSchema": {
|
|
115
|
-
"types": "./dist/Schema/SpecialJsonSchema.d.ts",
|
|
116
|
-
"default": "./dist/Schema/SpecialJsonSchema.js"
|
|
117
|
-
},
|
|
118
|
-
"./Schema/SpecialOpenApi": {
|
|
119
|
-
"types": "./dist/Schema/SpecialOpenApi.d.ts",
|
|
120
|
-
"default": "./dist/Schema/SpecialOpenApi.js"
|
|
121
|
-
},
|
|
122
|
-
"./Schema/brand": {
|
|
123
|
-
"types": "./dist/Schema/brand.d.ts",
|
|
124
|
-
"default": "./dist/Schema/brand.js"
|
|
125
|
-
},
|
|
126
|
-
"./Schema/email": {
|
|
127
|
-
"types": "./dist/Schema/email.d.ts",
|
|
128
|
-
"default": "./dist/Schema/email.js"
|
|
129
|
-
},
|
|
130
|
-
"./Schema/ext": {
|
|
131
|
-
"types": "./dist/Schema/ext.d.ts",
|
|
132
|
-
"default": "./dist/Schema/ext.js"
|
|
133
|
-
},
|
|
134
|
-
"./Schema/moreStrings": {
|
|
135
|
-
"types": "./dist/Schema/moreStrings.d.ts",
|
|
136
|
-
"default": "./dist/Schema/moreStrings.js"
|
|
137
|
-
},
|
|
138
|
-
"./Schema/numbers": {
|
|
139
|
-
"types": "./dist/Schema/numbers.d.ts",
|
|
140
|
-
"default": "./dist/Schema/numbers.js"
|
|
141
|
-
},
|
|
142
|
-
"./Schema/phoneNumber": {
|
|
143
|
-
"types": "./dist/Schema/phoneNumber.d.ts",
|
|
144
|
-
"default": "./dist/Schema/phoneNumber.js"
|
|
145
|
-
},
|
|
146
|
-
"./Schema/schema": {
|
|
147
|
-
"types": "./dist/Schema/schema.d.ts",
|
|
148
|
-
"default": "./dist/Schema/schema.js"
|
|
149
|
-
},
|
|
150
|
-
"./Schema/strings": {
|
|
151
|
-
"types": "./dist/Schema/strings.d.ts",
|
|
152
|
-
"default": "./dist/Schema/strings.js"
|
|
153
|
-
},
|
|
154
|
-
"./Set": {
|
|
155
|
-
"types": "./dist/Set.d.ts",
|
|
156
|
-
"default": "./dist/Set.js"
|
|
157
|
-
},
|
|
158
|
-
"./TypeTest": {
|
|
159
|
-
"types": "./dist/TypeTest.d.ts",
|
|
160
|
-
"default": "./dist/TypeTest.js"
|
|
161
|
-
},
|
|
162
|
-
"./Types": {
|
|
163
|
-
"types": "./dist/Types.d.ts",
|
|
164
|
-
"default": "./dist/Types.js"
|
|
165
|
-
},
|
|
166
|
-
"./Widen.type": {
|
|
167
|
-
"types": "./dist/Widen.type.d.ts",
|
|
168
|
-
"default": "./dist/Widen.type.js"
|
|
169
|
-
},
|
|
170
|
-
"./_ext/Array": {
|
|
171
|
-
"types": "./dist/_ext/Array.d.ts",
|
|
172
|
-
"default": "./dist/_ext/Array.js"
|
|
173
|
-
},
|
|
174
|
-
"./_ext/date": {
|
|
175
|
-
"types": "./dist/_ext/date.d.ts",
|
|
176
|
-
"default": "./dist/_ext/date.js"
|
|
177
|
-
},
|
|
178
|
-
"./_ext/misc": {
|
|
179
|
-
"types": "./dist/_ext/misc.d.ts",
|
|
180
|
-
"default": "./dist/_ext/misc.js"
|
|
181
|
-
},
|
|
182
|
-
"./_ext/ord.ext": {
|
|
183
|
-
"types": "./dist/_ext/ord.ext.d.ts",
|
|
184
|
-
"default": "./dist/_ext/ord.ext.js"
|
|
185
|
-
},
|
|
186
|
-
"./builtin": {
|
|
187
|
-
"types": "./dist/builtin.d.ts",
|
|
188
|
-
"default": "./dist/builtin.js"
|
|
189
|
-
},
|
|
190
|
-
"./client": {
|
|
191
|
-
"types": "./dist/client.d.ts",
|
|
192
|
-
"default": "./dist/client.js"
|
|
193
|
-
},
|
|
194
|
-
"./client/apiClientFactory": {
|
|
195
|
-
"types": "./dist/client/apiClientFactory.d.ts",
|
|
196
|
-
"default": "./dist/client/apiClientFactory.js"
|
|
197
|
-
},
|
|
198
|
-
"./client/clientFor": {
|
|
199
|
-
"types": "./dist/client/clientFor.d.ts",
|
|
200
|
-
"default": "./dist/client/clientFor.js"
|
|
201
|
-
},
|
|
202
|
-
"./client/errors": {
|
|
203
|
-
"types": "./dist/client/errors.d.ts",
|
|
204
|
-
"default": "./dist/client/errors.js"
|
|
205
|
-
},
|
|
206
|
-
"./client/makeClient": {
|
|
207
|
-
"types": "./dist/client/makeClient.d.ts",
|
|
208
|
-
"default": "./dist/client/makeClient.js"
|
|
209
|
-
},
|
|
210
|
-
"./faker": {
|
|
211
|
-
"types": "./dist/faker.d.ts",
|
|
212
|
-
"default": "./dist/faker.js"
|
|
213
|
-
},
|
|
214
|
-
"./http": {
|
|
215
|
-
"types": "./dist/http.d.ts",
|
|
216
|
-
"default": "./dist/http.js"
|
|
217
|
-
},
|
|
218
|
-
"./http/Request": {
|
|
219
|
-
"types": "./dist/http/Request.d.ts",
|
|
220
|
-
"default": "./dist/http/Request.js"
|
|
221
|
-
},
|
|
222
|
-
"./ids": {
|
|
223
|
-
"types": "./dist/ids.d.ts",
|
|
224
|
-
"default": "./dist/ids.js"
|
|
225
|
-
},
|
|
226
|
-
"./logger": {
|
|
227
|
-
"types": "./dist/logger.d.ts",
|
|
228
|
-
"default": "./dist/logger.js"
|
|
229
|
-
},
|
|
230
|
-
"./middleware": {
|
|
231
|
-
"types": "./dist/middleware.d.ts",
|
|
232
|
-
"default": "./dist/middleware.js"
|
|
233
|
-
},
|
|
234
|
-
"./rpc": {
|
|
235
|
-
"types": "./dist/rpc.d.ts",
|
|
236
|
-
"default": "./dist/rpc.js"
|
|
237
|
-
},
|
|
238
|
-
"./rpc/MiddlewareMaker": {
|
|
239
|
-
"types": "./dist/rpc/MiddlewareMaker.d.ts",
|
|
240
|
-
"default": "./dist/rpc/MiddlewareMaker.js"
|
|
241
|
-
},
|
|
242
|
-
"./rpc/RpcContextMap": {
|
|
243
|
-
"types": "./dist/rpc/RpcContextMap.d.ts",
|
|
244
|
-
"default": "./dist/rpc/RpcContextMap.js"
|
|
245
|
-
},
|
|
246
|
-
"./rpc/RpcMiddleware": {
|
|
247
|
-
"types": "./dist/rpc/RpcMiddleware.d.ts",
|
|
248
|
-
"default": "./dist/rpc/RpcMiddleware.js"
|
|
249
|
-
},
|
|
250
|
-
"./transform": {
|
|
251
|
-
"types": "./dist/transform.d.ts",
|
|
252
|
-
"default": "./dist/transform.js"
|
|
253
|
-
},
|
|
254
|
-
"./utils": {
|
|
255
|
-
"types": "./dist/utils.d.ts",
|
|
256
|
-
"default": "./dist/utils.js"
|
|
257
|
-
},
|
|
258
|
-
"./utils/effectify": {
|
|
259
|
-
"types": "./dist/utils/effectify.d.ts",
|
|
260
|
-
"default": "./dist/utils/effectify.js"
|
|
261
|
-
},
|
|
262
|
-
"./utils/extend": {
|
|
263
|
-
"types": "./dist/utils/extend.d.ts",
|
|
264
|
-
"default": "./dist/utils/extend.js"
|
|
265
|
-
},
|
|
266
|
-
"./utils/gen": {
|
|
267
|
-
"types": "./dist/utils/gen.d.ts",
|
|
268
|
-
"default": "./dist/utils/gen.js"
|
|
269
|
-
},
|
|
270
|
-
"./utils/logLevel": {
|
|
271
|
-
"types": "./dist/utils/logLevel.d.ts",
|
|
272
|
-
"default": "./dist/utils/logLevel.js"
|
|
273
|
-
},
|
|
274
|
-
"./utils/logger": {
|
|
275
|
-
"types": "./dist/utils/logger.d.ts",
|
|
276
|
-
"default": "./dist/utils/logger.js"
|
|
277
|
-
},
|
|
278
|
-
"./validation": {
|
|
279
|
-
"types": "./dist/validation.d.ts",
|
|
280
|
-
"default": "./dist/validation.js"
|
|
281
|
-
},
|
|
282
|
-
"./validation/validators": {
|
|
283
|
-
"types": "./dist/validation/validators.d.ts",
|
|
284
|
-
"default": "./dist/validation/validators.js"
|
|
42
|
+
"./internal/*": null,
|
|
43
|
+
"./*": {
|
|
44
|
+
"types": "./dist/*.d.ts",
|
|
45
|
+
"default": "./dist/*.js"
|
|
285
46
|
}
|
|
286
47
|
},
|
|
287
48
|
"gitHead": "bd8e27eea3eff97db8739d577d67e7336c078d28",
|
|
@@ -295,26 +56,24 @@
|
|
|
295
56
|
],
|
|
296
57
|
"scripts": {
|
|
297
58
|
"watch": "pnpm build:tsc -w",
|
|
298
|
-
"build:tsc": "pnpm clean-dist &&
|
|
299
|
-
"check": "
|
|
300
|
-
"build:tsc-src": "pnpm clean-dist &&
|
|
59
|
+
"build:tsc": "pnpm clean-dist && pnpm check && node ../../scripts/rewrite-dist-declaration-imports.mjs dist",
|
|
60
|
+
"check": "tsgo --build",
|
|
61
|
+
"build:tsc-src": "pnpm clean-dist && tsc --build ./tsconfig.src.json && node ../../scripts/rewrite-dist-declaration-imports.mjs dist",
|
|
301
62
|
"build:src": "pnpm build:tsc-src",
|
|
302
63
|
"build": "pnpm build:tsc",
|
|
303
|
-
"watch2": "pnpm clean-dist && NODE_OPTIONS=--max-old-space-size=6144
|
|
64
|
+
"watch2": "pnpm clean-dist && NODE_OPTIONS=--max-old-space-size=6144 tsgo -w",
|
|
304
65
|
"clean": "rm -rf dist",
|
|
305
66
|
"clean-dist": "sh ../../scripts/clean-dist.sh",
|
|
306
67
|
"circular": "pnpm circular:src && pnpm circular:dist",
|
|
307
68
|
"circular:src": "madge --circular --ts-config ./tsconfig.json --extensions ts ./src",
|
|
308
69
|
"circular:dist": "madge --circular --extensions js ./dist",
|
|
309
|
-
"compile": "NODE_OPTIONS=--max-old-space-size=6144
|
|
310
|
-
"lint": "
|
|
311
|
-
"lint
|
|
312
|
-
"lint-fix": "pnpm lint --fix",
|
|
70
|
+
"compile": "NODE_OPTIONS=--max-old-space-size=6144 tsgo --noEmit",
|
|
71
|
+
"lint": "oxlint --type-aware ./src && pnpm exec dprint check --config ../../dprint.jsonc .",
|
|
72
|
+
"lint-fix": "oxlint --type-aware --fix ./src && pnpm exec dprint fmt --config ../../dprint.jsonc .",
|
|
313
73
|
"test": "vitest",
|
|
314
74
|
"test:run": "pnpm run test run --passWithNoTests",
|
|
315
75
|
"testsuite": "pnpm lint && pnpm circular && pnpm run test:run",
|
|
316
76
|
"ncu": "ncu",
|
|
317
|
-
"pub": "
|
|
318
|
-
"prepublish": "cp -f ./tsconfig.json ./tsconfig.json.bak && node ../../scripts/mergeTsConfig.mjs ./tsconfig.json"
|
|
77
|
+
"pub": "npm publish --access public"
|
|
319
78
|
}
|
|
320
79
|
}
|
package/src/Array.ts
CHANGED
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
import { Chunk, Effect } from "effect"
|
|
2
1
|
import type { NonEmptyArray, NonEmptyReadonlyArray } from "effect/Array"
|
|
3
2
|
import * as Array from "effect/Array"
|
|
4
|
-
import * as
|
|
5
|
-
import { dual, type Predicate } from "./Function.
|
|
6
|
-
import * as Option from "./Option.
|
|
7
|
-
|
|
8
|
-
export const toNonEmptyArray = Option.liftPredicate(Array.isReadonlyArrayNonEmpty)
|
|
9
|
-
|
|
10
|
-
export const isArray: {
|
|
11
|
-
// uses ReadonlyArray here because otherwise the second overload don't work when ROA is involved.
|
|
12
|
-
(self: unknown): self is ReadonlyArray<unknown>
|
|
13
|
-
<T>(self: T): self is Extract<T, ReadonlyArray<any>>
|
|
14
|
-
} = Array.isArray
|
|
15
|
-
|
|
16
|
-
export function NEAFromArray<T>(ar: Array<T>) {
|
|
17
|
-
return ar.length ? Option.some(ar as NonEmptyArray<T>) : Option.none()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function NEROArrayFromArray<T>(ar: ReadonlyArray<T>) {
|
|
21
|
-
return ar.length ? Option.some(ar as NonEmptyReadonlyArray<T>) : Option.none()
|
|
22
|
-
}
|
|
3
|
+
import * as Effect from "effect/Effect"
|
|
4
|
+
import { dual, type Predicate } from "./Function.ts"
|
|
5
|
+
import * as Option from "./Option.ts"
|
|
23
6
|
|
|
24
7
|
export const groupByT = dual<
|
|
25
8
|
<A, Key>(
|
|
@@ -85,26 +68,11 @@ export function filterWith<A>(self: ReadonlyArray<A>, predicates: ReadonlyArray<
|
|
|
85
68
|
return self.filter((_) => predicates.every((f) => f(_)))
|
|
86
69
|
}
|
|
87
70
|
|
|
88
|
-
/**
|
|
89
|
-
* Split the `items` array into multiple, smaller chunks of the given `size`.
|
|
90
|
-
*/
|
|
91
|
-
export function* _chunk_<T>(items_: Iterable<T>, size: number) {
|
|
92
|
-
const items = [...items_]
|
|
93
|
-
|
|
94
|
-
while (items.length) {
|
|
95
|
-
yield items.splice(0, size)
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Split the `items` array into multiple, smaller chunks of the given `size`.
|
|
101
|
-
*/
|
|
102
|
-
export function chunk_<T>(items_: Iterable<T>, size: number) {
|
|
103
|
-
return Chunk.fromIterable(_chunk_(items_, size))
|
|
104
|
-
}
|
|
105
|
-
|
|
106
71
|
export function forEachEffectNA<A, R, E, B>(as: NonEmptyReadonlyArray<A>, f: (a: A) => Effect.Effect<B, E, R>) {
|
|
107
|
-
return Effect.map(
|
|
72
|
+
return Effect.map(
|
|
73
|
+
Effect.forEach(as, f),
|
|
74
|
+
(_) => Option.getOrNull(Option.liftPredicate(Array.isReadonlyArrayNonEmpty)(_))
|
|
75
|
+
)
|
|
108
76
|
}
|
|
109
77
|
|
|
110
78
|
export * from "effect/Array"
|
package/src/Chunk.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { pipe
|
|
2
|
-
import * as Option from "./Option.
|
|
1
|
+
import { pipe } from "./Function.ts"
|
|
2
|
+
import * as Option from "./Option.ts"
|
|
3
3
|
|
|
4
4
|
import * as Chunk from "effect/Chunk"
|
|
5
|
-
import
|
|
6
|
-
import * as Array from "./Array.js"
|
|
5
|
+
import * as Array from "./Array.ts"
|
|
7
6
|
|
|
8
7
|
export * from "effect/Chunk"
|
|
9
8
|
|
|
10
|
-
export const fromIterable = Chunk.fromIterable
|
|
11
|
-
|
|
12
9
|
export function groupByTChunk_<A, Key extends PropertyKey>(c: Chunk.Chunk<A>, f: (a: A) => Key) {
|
|
13
10
|
return pipe(Chunk.toReadonlyArray(c), Array.groupByT(f), Chunk.fromIterable)
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
/**
|
|
17
|
-
* Returns the first
|
|
14
|
+
* Returns the first `Some` produced by `f`.
|
|
15
|
+
*
|
|
16
|
+
* Effect's `Chunk.findFirst` takes a predicate, not an `Option`-returning function.
|
|
18
17
|
*/
|
|
19
18
|
export function findFirstMap<A, B>(
|
|
20
19
|
f: (a: A) => Option.Option<B>
|
|
@@ -31,51 +30,3 @@ export function findFirstMap<A, B>(
|
|
|
31
30
|
return Option.none()
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
export function toArray<T>(c: Chunk.Chunk<T>): T[] {
|
|
36
|
-
return Chunk.toReadonlyArray(c) as T[]
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Remove duplicates from an array, keeping the first occurrence of an element.
|
|
41
|
-
*/
|
|
42
|
-
export function uniq<A>(E: Equivalence<A>) {
|
|
43
|
-
return (self: Chunk.Chunk<A>): Chunk.Chunk<A> => {
|
|
44
|
-
let out = Chunk.fromIterable([] as A[])
|
|
45
|
-
for (let i = 0; i < self.length; i++) {
|
|
46
|
-
const a = Chunk.getUnsafe(self, i)
|
|
47
|
-
if (!elem(E, a)(out)) {
|
|
48
|
-
out = Chunk.append(out, a)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return self.length === out.length ? self : out
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Test if a value is a member of an array. Takes a `Equivalence<A>` as a single
|
|
57
|
-
* argument which returns the function to use to search for a value of type `A`
|
|
58
|
-
* in an array of type `Chunk<A>`.
|
|
59
|
-
*/
|
|
60
|
-
export function elem<A>(E: Equivalence<A>, value: A) {
|
|
61
|
-
return (self: Chunk.Chunk<A>): boolean => {
|
|
62
|
-
for (let i = 0; i < self.length; i++) {
|
|
63
|
-
if (E(Chunk.getUnsafe(self, i), value)) {
|
|
64
|
-
return true
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return false
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export const ChunkPartition = Chunk.partition
|
|
72
|
-
|
|
73
|
-
export const findFirstSimple: {
|
|
74
|
-
<A, B extends A>(self: Chunk.Chunk<A>, refinement: Refinement<A, B>): Option.Option<B>
|
|
75
|
-
<A>(self: Chunk.Chunk<A>, predicate: Predicate<A>): Option.Option<A>
|
|
76
|
-
} = Chunk.findFirst
|
|
77
|
-
|
|
78
|
-
export const findLastSimple: {
|
|
79
|
-
<A, B extends A>(self: Chunk.Chunk<A>, refinement: Refinement<A, B>): Option.Option<B>
|
|
80
|
-
<A>(self: Chunk.Chunk<A>, predicate: Predicate<A>): Option.Option<A>
|
|
81
|
-
} = Chunk.findLast
|
package/src/Config/SecretURL.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import { Config, type Equal, type Redacted } from "effect"
|
|
5
4
|
import type * as Chunk from "effect/Chunk"
|
|
6
|
-
import * as
|
|
5
|
+
import * as Config from "effect/Config"
|
|
6
|
+
import type * as Equal from "effect/Equal"
|
|
7
|
+
import type * as Redacted from "effect/Redacted"
|
|
8
|
+
import * as internal from "./internal/configSecretURL.ts"
|
|
7
9
|
|
|
8
10
|
// /**
|
|
9
11
|
// * @since 1.0.0
|
|
@@ -21,6 +23,7 @@ import * as internal from "./internal/configSecretURL.js"
|
|
|
21
23
|
* @since 1.0.0
|
|
22
24
|
* @category models
|
|
23
25
|
*/
|
|
26
|
+
// eslint-disable-next-line import/namespace
|
|
24
27
|
export interface SecretURL extends Redacted.Redacted, Equal.Equal {
|
|
25
28
|
/** @internal */
|
|
26
29
|
readonly raw: Array<number>
|
|
@@ -73,5 +76,5 @@ export const value: (self: SecretURL) => string = internal.value
|
|
|
73
76
|
export const unsafeWipe: (self: SecretURL) => void = internal.unsafeWipe
|
|
74
77
|
|
|
75
78
|
export const secretURL = (name?: string): Config.Config<SecretURL> => {
|
|
76
|
-
return Config.map(Config.
|
|
79
|
+
return Config.map(Config.NonEmptyString(name), fromString)
|
|
77
80
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Redacted } from "effect"
|
|
2
1
|
import * as Chunk from "effect/Chunk"
|
|
3
|
-
import
|
|
2
|
+
import * as Redacted from "effect/Redacted"
|
|
3
|
+
import type * as SecretURL from "../SecretURL.ts"
|
|
4
4
|
|
|
5
5
|
/** @internal */
|
|
6
6
|
export const isSecretURL = (u: unknown): u is SecretURL.SecretURL => {
|
package/src/Config.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
(name: string): <A>(self: Config<A>) => Config<A>
|
|
8
|
-
<A>(self: Config<A>, name: string): Config<A>
|
|
9
|
-
} = dual(
|
|
10
|
-
2,
|
|
11
|
-
<A>(self: Config<A>, name: string): Config<A> => make((provider) => self.parse(ConfigProvider.nested(provider, name)))
|
|
12
|
-
)
|
|
13
|
-
|
|
1
|
+
// `Config.nested` previously needed a local override because effect v3's `nested`
|
|
2
|
+
// did not run the provider's `mapInput`/`constantCase` over the nested namespace
|
|
3
|
+
// segment (see commit "fix Config.nested mapping"). As of effect 4.0.0-beta.84 the
|
|
4
|
+
// upstream `nested` threads the prefix through the lookup path, so the provider
|
|
5
|
+
// transform covers it — the override is obsolete and the old internals it used are
|
|
6
|
+
// gone. Re-export the native module directly.
|
|
14
7
|
export * from "effect/Config"
|
package/src/ConfigProvider.ts
CHANGED
|
@@ -1,48 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* Scopes a provider so that all lookups are prefixed with the given path
|
|
6
|
-
* segments.
|
|
7
|
-
*
|
|
8
|
-
* When to use:
|
|
9
|
-
* - Namespacing config under a prefix like `"app"` or `"database"`.
|
|
10
|
-
* - Reusing the same provider shape for multiple sub-configs.
|
|
11
|
-
*
|
|
12
|
-
* Accepts a single string or a full `Path` array. The prefix is prepended
|
|
13
|
-
* *after* any `mapInput` transformation runs, so ordering matters when
|
|
14
|
-
* composing with {@link mapInput} or {@link constantCase}.
|
|
15
|
-
*
|
|
16
|
-
* Supports both data-last and data-first calling conventions.
|
|
17
|
-
*
|
|
18
|
-
* **Example** (Nesting under a prefix)
|
|
19
|
-
*
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { ConfigProvider } from "effect"
|
|
22
|
-
*
|
|
23
|
-
* const provider = ConfigProvider.fromEnv({
|
|
24
|
-
* env: { APP_HOST: "localhost", APP_PORT: "3000" }
|
|
25
|
-
* })
|
|
26
|
-
*
|
|
27
|
-
* // Lookups for ["HOST"] now resolve to ["APP", "HOST"]
|
|
28
|
-
* const scoped = ConfigProvider.nested(provider, "APP")
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @see {@link mapInput} – for arbitrary path transformations
|
|
32
|
-
*
|
|
33
|
-
* @category Combinators
|
|
34
|
-
* @since 4.0.0
|
|
35
|
-
*/
|
|
36
|
-
export const nested: {
|
|
37
|
-
(prefix: string | Path): (self: ConfigProvider) => ConfigProvider
|
|
38
|
-
(self: ConfigProvider, prefix: string | Path): ConfigProvider
|
|
39
|
-
} = dual(
|
|
40
|
-
2,
|
|
41
|
-
(self: ConfigProvider, prefix: string | Path): ConfigProvider => {
|
|
42
|
-
let path: Path = typeof prefix === "string" ? [prefix] : prefix
|
|
43
|
-
if (self.mapInput) path = self.mapInput(path)
|
|
44
|
-
return make(self.get, self.mapInput, self.prefix ? [...self.prefix, ...path] : path)
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
|
|
1
|
+
// Local `nested` override removed: it existed to make the nested namespace honour the
|
|
2
|
+
// provider's `mapInput`/`constantCase` (see commit "fix Config.nested mapping"), which
|
|
3
|
+
// effect 4.0.0-beta.84 now does natively. The old override also relied on internals
|
|
4
|
+
// (`provider.get`/`mapInput`/`prefix`) that no longer exist. Re-export native directly.
|
|
48
5
|
export * from "effect/ConfigProvider"
|
package/src/Context.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable import/namespace */
|
|
2
3
|
|
|
3
|
-
import { type Effect, Layer, type Scope, type Types } from "effect"
|
|
4
4
|
import * as CTX from "effect/Context"
|
|
5
|
-
import
|
|
5
|
+
import type * as Effect from "effect/Effect"
|
|
6
|
+
import * as Layer from "effect/Layer"
|
|
7
|
+
import type * as Scope from "effect/Scope"
|
|
8
|
+
import type * as Types from "effect/Types"
|
|
6
9
|
|
|
7
10
|
export * from "effect/Context"
|
|
8
11
|
|
|
9
|
-
export interface Opaque<Self extends object, in out Shape extends object>
|
|
10
|
-
extends CTX.Key<Self, Self>, Yieldable<Opaque<Self, Shape>, Self, never, Self>
|
|
11
|
-
{
|
|
12
|
+
export interface Opaque<Self extends object, in out Shape extends object> extends CTX.Key<Self, Self> {
|
|
12
13
|
of(this: void, self: Shape): Self
|
|
13
|
-
|
|
14
|
+
context(self: Shape): CTX.Context<Self>
|
|
14
15
|
// a version that leverages the Shape -> Self conversion
|
|
15
16
|
toLayer: <E, R>(
|
|
16
17
|
eff: Effect.Effect<Shape, E, R>
|
|
@@ -24,7 +25,7 @@ export interface Opaque<Self extends object, in out Shape extends object>
|
|
|
24
25
|
// {
|
|
25
26
|
// // temp while sorting out https://github.com/Effect-TS/effect-smol/pull/1534
|
|
26
27
|
// of(self: Shape): Self
|
|
27
|
-
//
|
|
28
|
+
// contextMap2(self: Shape): CTX.Context<Self>
|
|
28
29
|
// // a version that leverages the Shape -> Self conversion
|
|
29
30
|
// toLayer: {
|
|
30
31
|
// <E, R>(
|
|
@@ -93,7 +94,7 @@ export const accessCn = <
|
|
|
93
94
|
>(
|
|
94
95
|
Tag: Opaque<Self, Shape>,
|
|
95
96
|
key: K
|
|
96
|
-
): Effect.Effect<Shape[K], never, Self> => Tag.useSync((s) => s[key])
|
|
97
|
+
): Effect.Effect<Shape[K], never, Self> => Tag.useSync((s) => s[key])
|
|
97
98
|
|
|
98
99
|
/** Accessor for a service property that is an Effect. Delegates via `use`. */
|
|
99
100
|
export const accessEffectCn = <
|