typed-settings 0.1.0 → 0.1.4

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.
Files changed (50) hide show
  1. package/README.md +4 -2
  2. package/dist/adapters/joi.d.cts +13 -0
  3. package/dist/adapters/joi.d.ts +13 -0
  4. package/dist/adapters/zod.d.cts +16 -0
  5. package/dist/adapters/zod.d.ts +16 -0
  6. package/dist/{chunk-VTIYOSG2.js → chunk-DEP5SD4J.js} +1 -1
  7. package/dist/{chunk-RCO6K3WQ.js → chunk-YVJEZPPZ.js} +11 -6
  8. package/dist/cli/main.cjs +11 -6
  9. package/dist/cli/main.d.cts +4 -0
  10. package/dist/cli/main.d.ts +4 -0
  11. package/dist/cli/main.js +2 -2
  12. package/dist/{errors-IU9n4f3t.d.cts → errors-itGaU4Q8.d.cts} +5 -0
  13. package/dist/{errors-IU9n4f3t.d.ts → errors-itGaU4Q8.d.ts} +5 -0
  14. package/dist/formats/env.d.cts +5 -0
  15. package/dist/formats/env.d.ts +5 -0
  16. package/dist/formats/json.d.cts +4 -0
  17. package/dist/formats/json.d.ts +4 -0
  18. package/dist/formats/toml.d.cts +4 -0
  19. package/dist/formats/toml.d.ts +4 -0
  20. package/dist/formats/yaml.d.cts +5 -0
  21. package/dist/formats/yaml.d.ts +5 -0
  22. package/dist/framework/next.cjs +11 -6
  23. package/dist/framework/next.d.cts +16 -3
  24. package/dist/framework/next.d.ts +16 -3
  25. package/dist/framework/next.js +1 -1
  26. package/dist/framework/vite.cjs +11 -6
  27. package/dist/framework/vite.d.cts +16 -3
  28. package/dist/framework/vite.d.ts +16 -3
  29. package/dist/framework/vite.js +2 -2
  30. package/dist/index.cjs +11 -6
  31. package/dist/index.d.cts +42 -3
  32. package/dist/index.d.ts +42 -3
  33. package/dist/index.js +1 -1
  34. package/dist/node.cjs +11 -6
  35. package/dist/node.d.cts +29 -2
  36. package/dist/node.d.ts +29 -2
  37. package/dist/node.js +2 -2
  38. package/dist/{shared-DBcV6jIy.d.cts → shared-CucO_XsG.d.cts} +1 -0
  39. package/dist/{shared-DBcV6jIy.d.ts → shared-CucO_XsG.d.ts} +1 -0
  40. package/dist/types-B_Dc2L4T.d.cts +69 -0
  41. package/dist/types-B_Dc2L4T.d.ts +69 -0
  42. package/dist/vault/aws.d.cts +26 -1
  43. package/dist/vault/aws.d.ts +26 -1
  44. package/dist/vault/hashicorp.d.cts +23 -2
  45. package/dist/vault/hashicorp.d.ts +23 -2
  46. package/dist/vault/http.d.cts +20 -2
  47. package/dist/vault/http.d.ts +20 -2
  48. package/package.json +9 -1
  49. package/dist/types-BswIPp7U.d.cts +0 -41
  50. package/dist/types-BswIPp7U.d.ts +0 -41
@@ -1,15 +1,33 @@
1
- import { F as Flat, a as SecretProvider } from '../types-BswIPp7U.cjs';
2
- import { F as FetchFn } from '../shared-DBcV6jIy.cjs';
1
+ import { F as Flat, a as SecretProvider } from '../types-B_Dc2L4T.cjs';
2
+ import { F as FetchFn } from '../shared-CucO_XsG.cjs';
3
3
  import '@standard-schema/spec';
4
4
 
5
+ /**
6
+ * Generic HTTP secret provider: GETs a JSON endpoint and reads a dot-path
7
+ * (`jsonPath`, default `'data'`) into a flat map. Auth rides in `headers`.
8
+ *
9
+ * @module
10
+ */
11
+
12
+ /** Options for {@link httpProvider}. */
5
13
  interface HttpProviderOptions {
14
+ /** Endpoint URL. */
6
15
  url: string;
16
+ /** Extra headers. Feed auth from env-injected values, never CLI args. */
7
17
  headers?: Flat;
18
+ /** Dot path into the JSON body. Default `'data'`; `''` reads the whole body. */
8
19
  jsonPath?: string;
20
+ /** Request timeout in ms. Default 5000. */
9
21
  timeoutMs?: number;
22
+ /** Injectable fetch for tests. */
10
23
  fetchFn?: FetchFn;
24
+ /** Response body cap in bytes. Default 1 MiB. */
11
25
  maxBytes?: number;
12
26
  }
27
+ /**
28
+ * GETs a JSON endpoint and reads `jsonPath` into a flat map. Concurrent loads
29
+ * share one in-flight request; failures reset so the next call retries.
30
+ */
13
31
  declare function httpProvider(opts: HttpProviderOptions): SecretProvider;
14
32
 
15
33
  export { type HttpProviderOptions, httpProvider };
@@ -1,15 +1,33 @@
1
- import { F as Flat, a as SecretProvider } from '../types-BswIPp7U.js';
2
- import { F as FetchFn } from '../shared-DBcV6jIy.js';
1
+ import { F as Flat, a as SecretProvider } from '../types-B_Dc2L4T.js';
2
+ import { F as FetchFn } from '../shared-CucO_XsG.js';
3
3
  import '@standard-schema/spec';
4
4
 
5
+ /**
6
+ * Generic HTTP secret provider: GETs a JSON endpoint and reads a dot-path
7
+ * (`jsonPath`, default `'data'`) into a flat map. Auth rides in `headers`.
8
+ *
9
+ * @module
10
+ */
11
+
12
+ /** Options for {@link httpProvider}. */
5
13
  interface HttpProviderOptions {
14
+ /** Endpoint URL. */
6
15
  url: string;
16
+ /** Extra headers. Feed auth from env-injected values, never CLI args. */
7
17
  headers?: Flat;
18
+ /** Dot path into the JSON body. Default `'data'`; `''` reads the whole body. */
8
19
  jsonPath?: string;
20
+ /** Request timeout in ms. Default 5000. */
9
21
  timeoutMs?: number;
22
+ /** Injectable fetch for tests. */
10
23
  fetchFn?: FetchFn;
24
+ /** Response body cap in bytes. Default 1 MiB. */
11
25
  maxBytes?: number;
12
26
  }
27
+ /**
28
+ * GETs a JSON endpoint and reads `jsonPath` into a flat map. Concurrent loads
29
+ * share one in-flight request; failures reset so the next call retries.
30
+ */
13
31
  declare function httpProvider(opts: HttpProviderOptions): SecretProvider;
14
32
 
15
33
  export { type HttpProviderOptions, httpProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-settings",
3
- "version": "0.1.0",
3
+ "version": "0.1.4",
4
4
  "description": "One-call typed config for TS: env + .env + yaml/toml/json + secrets-dir + vault -> frozen object. Standard Schema + legacy bridges.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -89,6 +89,14 @@
89
89
  "standard-schema"
90
90
  ],
91
91
  "license": "MIT",
92
+ "repository": {
93
+ "type": "git",
94
+ "url": "https://github.com/prosubodh/typed-settings"
95
+ },
96
+ "homepage": "https://github.com/prosubodh/typed-settings#readme",
97
+ "bugs": {
98
+ "url": "https://github.com/prosubodh/typed-settings/issues"
99
+ },
92
100
  "engines": {
93
101
  "node": ">=20"
94
102
  },
@@ -1,41 +0,0 @@
1
- import { StandardSchemaV1 } from '@standard-schema/spec';
2
-
3
- type Flat = Record<string, string | undefined>;
4
- interface SecretProvider {
5
- name: string;
6
- load(): Promise<Flat> | Flat;
7
- }
8
- type SourceInput = 'env' | '.env' | '.env.local' | {
9
- text: string;
10
- } | {
11
- file: string;
12
- } | {
13
- dir: string;
14
- } | {
15
- map: Flat;
16
- prefix?: string;
17
- } | {
18
- provider: SecretProvider;
19
- prefix?: string;
20
- } | SecretProvider | Flat | string;
21
- type ArrayStrategy = 'replace' | 'concat' | 'mergeIndex';
22
- type UnknownKeys = 'strip' | 'preserve' | 'reject';
23
- interface SettingsOptions<S extends StandardSchemaV1 = StandardSchemaV1> {
24
- schema: S;
25
- sources?: SourceInput[];
26
- prefix?: string;
27
- separator?: '__';
28
- coerce?: boolean;
29
- expand?: boolean;
30
- expandSecrets?: boolean;
31
- arrayStrategy?: ArrayStrategy;
32
- unknownKeys?: UnknownKeys;
33
- freeze?: boolean;
34
- timeoutMs?: number;
35
- maxBytes?: number;
36
- envMap?: Record<string, string>;
37
- allowUnresolved?: boolean;
38
- env?: Flat;
39
- }
40
-
41
- export type { ArrayStrategy as A, Flat as F, SettingsOptions as S, UnknownKeys as U, SecretProvider as a, SourceInput as b };
@@ -1,41 +0,0 @@
1
- import { StandardSchemaV1 } from '@standard-schema/spec';
2
-
3
- type Flat = Record<string, string | undefined>;
4
- interface SecretProvider {
5
- name: string;
6
- load(): Promise<Flat> | Flat;
7
- }
8
- type SourceInput = 'env' | '.env' | '.env.local' | {
9
- text: string;
10
- } | {
11
- file: string;
12
- } | {
13
- dir: string;
14
- } | {
15
- map: Flat;
16
- prefix?: string;
17
- } | {
18
- provider: SecretProvider;
19
- prefix?: string;
20
- } | SecretProvider | Flat | string;
21
- type ArrayStrategy = 'replace' | 'concat' | 'mergeIndex';
22
- type UnknownKeys = 'strip' | 'preserve' | 'reject';
23
- interface SettingsOptions<S extends StandardSchemaV1 = StandardSchemaV1> {
24
- schema: S;
25
- sources?: SourceInput[];
26
- prefix?: string;
27
- separator?: '__';
28
- coerce?: boolean;
29
- expand?: boolean;
30
- expandSecrets?: boolean;
31
- arrayStrategy?: ArrayStrategy;
32
- unknownKeys?: UnknownKeys;
33
- freeze?: boolean;
34
- timeoutMs?: number;
35
- maxBytes?: number;
36
- envMap?: Record<string, string>;
37
- allowUnresolved?: boolean;
38
- env?: Flat;
39
- }
40
-
41
- export type { ArrayStrategy as A, Flat as F, SettingsOptions as S, UnknownKeys as U, SecretProvider as a, SourceInput as b };