@geekmidas/envkit 9.0.2 → 10.0.0-alpha.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/README.md +2 -2
- package/dist/{EnvironmentBuilder-DDgLJAAo.cjs → EnvironmentBuilder-15SdFJdK.cjs} +2 -2
- package/dist/EnvironmentBuilder-15SdFJdK.cjs.map +1 -0
- package/dist/{EnvironmentBuilder-CFen3oIg.mjs → EnvironmentBuilder-C-2fViCT.mjs} +2 -2
- package/dist/EnvironmentBuilder-C-2fViCT.mjs.map +1 -0
- package/dist/{EnvironmentBuilder-DHfDXJUm.d.mts → EnvironmentBuilder-CoBQ9Xp2.d.mts} +2 -2
- package/dist/{EnvironmentBuilder-CNgcdzSR.d.cts.map → EnvironmentBuilder-CoBQ9Xp2.d.mts.map} +1 -1
- package/dist/{EnvironmentBuilder-CNgcdzSR.d.cts → EnvironmentBuilder-DeIle4QN.d.cts} +2 -2
- package/dist/{EnvironmentBuilder-DHfDXJUm.d.mts.map → EnvironmentBuilder-DeIle4QN.d.cts.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/sst.cjs +13 -6
- package/dist/sst.cjs.map +1 -1
- package/dist/sst.d.cts +15 -4
- package/dist/sst.d.cts.map +1 -1
- package/dist/sst.d.mts +15 -4
- package/dist/sst.d.mts.map +1 -1
- package/dist/sst.mjs +13 -6
- package/dist/sst.mjs.map +1 -1
- package/package.json +6 -2
- package/CHANGELOG.md +0 -115
- package/dist/EnvironmentBuilder-CFen3oIg.mjs.map +0 -1
- package/dist/EnvironmentBuilder-DDgLJAAo.cjs.map +0 -1
- package/docs/api-reference.md +0 -302
- package/docs/async-secrets-design.md +0 -355
- package/examples/basic-usage.ts +0 -386
- package/src/EnvironmentBuilder.ts +0 -192
- package/src/EnvironmentParser.ts +0 -330
- package/src/SnifferEnvironmentParser.ts +0 -334
- package/src/SstEnvValidator.ts +0 -369
- package/src/SstEnvironmentBuilder.ts +0 -343
- package/src/__tests__/ConfigParser.spec.ts +0 -394
- package/src/__tests__/EnvironmentBuilder.spec.ts +0 -254
- package/src/__tests__/EnvironmentParser.spec.ts +0 -839
- package/src/__tests__/SnifferEnvironmentParser.spec.ts +0 -644
- package/src/__tests__/SstEnvValidator.spec.ts +0 -236
- package/src/__tests__/SstEnvironmentBuilder.spec.ts +0 -397
- package/src/__tests__/credentials.integration.spec.ts +0 -239
- package/src/__tests__/credentials.spec.ts +0 -136
- package/src/__tests__/formatter.spec.ts +0 -268
- package/src/__tests__/sst.spec.ts +0 -437
- package/src/credentials.ts +0 -112
- package/src/formatter.ts +0 -146
- package/src/index.ts +0 -24
- package/src/sst.ts +0 -76
- package/sst-env.d.ts +0 -8
- package/tsconfig.json +0 -9
- package/tsdown.config.ts +0 -18
package/README.md
CHANGED
|
@@ -249,12 +249,12 @@ import { ResourceType } from '@geekmidas/envkit/sst';
|
|
|
249
249
|
// Legacy format (dot notation)
|
|
250
250
|
ResourceType.Postgres // 'sst.aws.Postgres'
|
|
251
251
|
ResourceType.Secret // 'sst.sst.Secret'
|
|
252
|
-
ResourceType.
|
|
252
|
+
ResourceType.ObjectStorage // 'sst.aws.Bucket'
|
|
253
253
|
|
|
254
254
|
// Modern format (colon notation)
|
|
255
255
|
ResourceType.SSTPostgres // 'sst:aws:Postgres'
|
|
256
256
|
ResourceType.SSTSecret // 'sst:sst:Secret'
|
|
257
|
-
ResourceType.
|
|
257
|
+
ResourceType.SSTObjectStorage // 'sst:aws:Bucket'
|
|
258
258
|
ResourceType.SnsTopic // 'sst:aws:SnsTopic'
|
|
259
259
|
```
|
|
260
260
|
|
|
@@ -11,7 +11,7 @@ const lodash_snakecase = require_chunk.__toESM(require("lodash.snakecase"));
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* environmentCase('myVariable') // 'MY_VARIABLE'
|
|
14
|
-
* environmentCase('
|
|
14
|
+
* environmentCase('api2') // 'API2'
|
|
15
15
|
*/
|
|
16
16
|
function environmentCase(name) {
|
|
17
17
|
return (0, lodash_snakecase.default)(name).toUpperCase().replace(/_\d+/g, (r) => {
|
|
@@ -90,4 +90,4 @@ Object.defineProperty(exports, 'environmentCase', {
|
|
|
90
90
|
return environmentCase;
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
//# sourceMappingURL=EnvironmentBuilder-
|
|
93
|
+
//# sourceMappingURL=EnvironmentBuilder-15SdFJdK.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentBuilder-15SdFJdK.cjs","names":["name: string","record: TRecord","resolvers: TResolvers","options: EnvironmentBuilderOptions","env: EnvRecord"],"sources":["../src/EnvironmentBuilder.ts"],"sourcesContent":["import snakecase from 'lodash.snakecase';\n\n/**\n * Converts a string to environment variable case format (UPPER_SNAKE_CASE).\n * Numbers following underscores are preserved without the underscore.\n *\n * @param name - The string to convert\n * @returns The converted string in environment variable format\n *\n * @example\n * environmentCase('myVariable') // 'MY_VARIABLE'\n * environmentCase('api2') // 'API2'\n */\nexport function environmentCase(name: string): string {\n\treturn snakecase(name)\n\t\t.toUpperCase()\n\t\t.replace(/_\\d+/g, (r) => {\n\t\t\treturn r.replace('_', '');\n\t\t});\n}\n\n/**\n * A record of environment variable names to their values.\n * Values can be primitives or nested records.\n */\nexport interface EnvRecord {\n\t[key: string]: EnvValue;\n}\n\n/**\n * Represents a value that can be stored in an environment record.\n * Can be a primitive value or a nested record of environment values.\n */\nexport type EnvValue = string | number | boolean | EnvRecord;\n\n/**\n * A resolver function that converts a typed value into environment variables.\n *\n * @template T - The type of value this resolver handles (without the `type` key)\n * @param key - The key name from the input record\n * @param value - The value to resolve (without the `type` key)\n * @returns A record of environment variable names to their values\n */\nexport type EnvironmentResolver<T = any> = (key: string, value: T) => EnvRecord;\n\n/**\n * A map of type discriminator strings to their resolver functions.\n */\nexport type Resolvers = Record<string, EnvironmentResolver<any>>;\n\n/**\n * Options for configuring the EnvironmentBuilder.\n */\nexport interface EnvironmentBuilderOptions {\n\t/**\n\t * Handler called when a value's type doesn't match any registered resolver.\n\t * Defaults to console.warn.\n\t */\n\tonUnmatchedValue?: (key: string, value: unknown) => void;\n}\n\n/**\n * Input value type - either a string or an object with a `type` discriminator.\n */\nexport type InputValue = string | { type: string; [key: string]: unknown };\n\n/**\n * Base type for typed input values with a specific type discriminator.\n */\nexport type TypedInputValue<TType extends string = string> = {\n\ttype: TType;\n\t[key: string]: unknown;\n};\n\n/**\n * Extracts the `type` string value from an input value.\n */\ntype ExtractType<T> = T extends { type: infer U extends string } ? U : never;\n\n/**\n * Removes the `type` key from an object type.\n */\ntype OmitType<T> = T extends { type: string } ? Omit<T, 'type'> : never;\n\n/**\n * Extracts all unique `type` values from a record (excluding plain strings).\n */\ntype AllTypeValues<TRecord extends Record<string, InputValue>> = {\n\t[K in keyof TRecord]: ExtractType<TRecord[K]>;\n}[keyof TRecord];\n\n/**\n * For a given type value, finds the corresponding value type (without `type` key).\n */\ntype ValueForType<\n\tTRecord extends Record<string, InputValue>,\n\tTType extends string,\n> = {\n\t[K in keyof TRecord]: TRecord[K] extends { type: TType }\n\t\t? OmitType<TRecord[K]>\n\t\t: never;\n}[keyof TRecord];\n\n/**\n * Generates typed resolvers based on the input record.\n * Keys are the `type` values, values are resolver functions receiving the value without `type`.\n */\nexport type TypedResolvers<TRecord extends Record<string, InputValue>> = {\n\t[TType in AllTypeValues<TRecord>]: EnvironmentResolver<\n\t\tValueForType<TRecord, TType>\n\t>;\n};\n\n/**\n * A generic, extensible class for building environment variables from\n * objects with type-discriminated values.\n *\n * @template TRecord - The input record type for type inference\n * @template TResolvers - The resolvers type (defaults to TypedResolvers<TRecord>)\n *\n * @example\n * ```typescript\n * const env = new EnvironmentBuilder(\n * {\n * apiKey: { type: 'secret', value: 'xyz' },\n * appName: 'my-app'\n * },\n * {\n * // `value` is typed as { value: string } (without `type`)\n * secret: (key, value) => ({ [key]: value.value }),\n * }\n * ).build();\n * // { API_KEY: 'xyz', APP_NAME: 'my-app' }\n * ```\n */\nexport class EnvironmentBuilder<\n\tTRecord extends Record<string, InputValue> = Record<string, InputValue>,\n\tTResolvers extends Resolvers = TypedResolvers<TRecord>,\n> {\n\tprivate readonly record: TRecord;\n\tprivate readonly resolvers: TResolvers;\n\tprivate readonly options: Required<EnvironmentBuilderOptions>;\n\n\tconstructor(\n\t\trecord: TRecord,\n\t\tresolvers: TResolvers,\n\t\toptions: EnvironmentBuilderOptions = {},\n\t) {\n\t\tthis.record = record;\n\t\tthis.resolvers = resolvers;\n\t\tthis.options = {\n\t\t\tonUnmatchedValue: options.onUnmatchedValue ?? ((_key, _value) => {}),\n\t\t};\n\t}\n\n\t/**\n\t * Build environment variables from the input record.\n\t *\n\t * - Plain string values are passed through with key transformation\n\t * - Object values with a `type` property are matched against resolvers\n\t * - Resolvers receive values without the `type` key\n\t * - Only root-level keys are transformed to UPPER_SNAKE_CASE\n\t *\n\t * @returns A record of environment variables\n\t */\n\tbuild(): EnvRecord {\n\t\tconst env: EnvRecord = {};\n\n\t\tfor (const [key, value] of Object.entries(this.record)) {\n\t\t\t// Handle plain string values\n\t\t\tif (typeof value === 'string') {\n\t\t\t\tenv[environmentCase(key)] = value;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Handle objects with type discriminator\n\t\t\tconst { type, ...rest } = value;\n\t\t\tconst resolver = this.resolvers[type];\n\t\t\tif (resolver) {\n\t\t\t\tconst resolved = resolver(key, rest);\n\t\t\t\t// Transform only root-level keys from resolver output\n\t\t\t\tfor (const [resolvedKey, resolvedValue] of Object.entries(resolved)) {\n\t\t\t\t\tenv[environmentCase(resolvedKey)] = resolvedValue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.options.onUnmatchedValue(key, value);\n\t\t\t}\n\t\t}\n\n\t\treturn env;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,SAAgB,gBAAgBA,MAAsB;AACrD,QAAO,8BAAU,KAAK,CACpB,aAAa,CACb,QAAQ,SAAS,CAAC,MAAM;AACxB,SAAO,EAAE,QAAQ,KAAK,GAAG;CACzB,EAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;AAoHD,IAAa,qBAAb,MAGE;CACD,AAAiB;CACjB,AAAiB;CACjB,AAAiB;CAEjB,YACCC,QACAC,WACAC,UAAqC,CAAE,GACtC;AACD,OAAK,SAAS;AACd,OAAK,YAAY;AACjB,OAAK,UAAU,EACd,kBAAkB,QAAQ,qBAAqB,CAAC,MAAM,WAAW,CAAE,GACnE;CACD;;;;;;;;;;;CAYD,QAAmB;EAClB,MAAMC,MAAiB,CAAE;AAEzB,OAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,KAAK,OAAO,EAAE;AAEvD,cAAW,UAAU,UAAU;AAC9B,QAAI,gBAAgB,IAAI,IAAI;AAC5B;GACA;GAGD,MAAM,EAAE,KAAM,GAAG,MAAM,GAAG;GAC1B,MAAM,WAAW,KAAK,UAAU;AAChC,OAAI,UAAU;IACb,MAAM,WAAW,SAAS,KAAK,KAAK;AAEpC,SAAK,MAAM,CAAC,aAAa,cAAc,IAAI,OAAO,QAAQ,SAAS,CAClE,KAAI,gBAAgB,YAAY,IAAI;GAErC,MACA,MAAK,QAAQ,iBAAiB,KAAK,MAAM;EAE1C;AAED,SAAO;CACP;AACD"}
|
|
@@ -10,7 +10,7 @@ import snakecase from "lodash.snakecase";
|
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* environmentCase('myVariable') // 'MY_VARIABLE'
|
|
13
|
-
* environmentCase('
|
|
13
|
+
* environmentCase('api2') // 'API2'
|
|
14
14
|
*/
|
|
15
15
|
function environmentCase(name) {
|
|
16
16
|
return snakecase(name).toUpperCase().replace(/_\d+/g, (r) => {
|
|
@@ -78,4 +78,4 @@ var EnvironmentBuilder = class {
|
|
|
78
78
|
|
|
79
79
|
//#endregion
|
|
80
80
|
export { EnvironmentBuilder, environmentCase };
|
|
81
|
-
//# sourceMappingURL=EnvironmentBuilder-
|
|
81
|
+
//# sourceMappingURL=EnvironmentBuilder-C-2fViCT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentBuilder-C-2fViCT.mjs","names":["name: string","record: TRecord","resolvers: TResolvers","options: EnvironmentBuilderOptions","env: EnvRecord"],"sources":["../src/EnvironmentBuilder.ts"],"sourcesContent":["import snakecase from 'lodash.snakecase';\n\n/**\n * Converts a string to environment variable case format (UPPER_SNAKE_CASE).\n * Numbers following underscores are preserved without the underscore.\n *\n * @param name - The string to convert\n * @returns The converted string in environment variable format\n *\n * @example\n * environmentCase('myVariable') // 'MY_VARIABLE'\n * environmentCase('api2') // 'API2'\n */\nexport function environmentCase(name: string): string {\n\treturn snakecase(name)\n\t\t.toUpperCase()\n\t\t.replace(/_\\d+/g, (r) => {\n\t\t\treturn r.replace('_', '');\n\t\t});\n}\n\n/**\n * A record of environment variable names to their values.\n * Values can be primitives or nested records.\n */\nexport interface EnvRecord {\n\t[key: string]: EnvValue;\n}\n\n/**\n * Represents a value that can be stored in an environment record.\n * Can be a primitive value or a nested record of environment values.\n */\nexport type EnvValue = string | number | boolean | EnvRecord;\n\n/**\n * A resolver function that converts a typed value into environment variables.\n *\n * @template T - The type of value this resolver handles (without the `type` key)\n * @param key - The key name from the input record\n * @param value - The value to resolve (without the `type` key)\n * @returns A record of environment variable names to their values\n */\nexport type EnvironmentResolver<T = any> = (key: string, value: T) => EnvRecord;\n\n/**\n * A map of type discriminator strings to their resolver functions.\n */\nexport type Resolvers = Record<string, EnvironmentResolver<any>>;\n\n/**\n * Options for configuring the EnvironmentBuilder.\n */\nexport interface EnvironmentBuilderOptions {\n\t/**\n\t * Handler called when a value's type doesn't match any registered resolver.\n\t * Defaults to console.warn.\n\t */\n\tonUnmatchedValue?: (key: string, value: unknown) => void;\n}\n\n/**\n * Input value type - either a string or an object with a `type` discriminator.\n */\nexport type InputValue = string | { type: string; [key: string]: unknown };\n\n/**\n * Base type for typed input values with a specific type discriminator.\n */\nexport type TypedInputValue<TType extends string = string> = {\n\ttype: TType;\n\t[key: string]: unknown;\n};\n\n/**\n * Extracts the `type` string value from an input value.\n */\ntype ExtractType<T> = T extends { type: infer U extends string } ? U : never;\n\n/**\n * Removes the `type` key from an object type.\n */\ntype OmitType<T> = T extends { type: string } ? Omit<T, 'type'> : never;\n\n/**\n * Extracts all unique `type` values from a record (excluding plain strings).\n */\ntype AllTypeValues<TRecord extends Record<string, InputValue>> = {\n\t[K in keyof TRecord]: ExtractType<TRecord[K]>;\n}[keyof TRecord];\n\n/**\n * For a given type value, finds the corresponding value type (without `type` key).\n */\ntype ValueForType<\n\tTRecord extends Record<string, InputValue>,\n\tTType extends string,\n> = {\n\t[K in keyof TRecord]: TRecord[K] extends { type: TType }\n\t\t? OmitType<TRecord[K]>\n\t\t: never;\n}[keyof TRecord];\n\n/**\n * Generates typed resolvers based on the input record.\n * Keys are the `type` values, values are resolver functions receiving the value without `type`.\n */\nexport type TypedResolvers<TRecord extends Record<string, InputValue>> = {\n\t[TType in AllTypeValues<TRecord>]: EnvironmentResolver<\n\t\tValueForType<TRecord, TType>\n\t>;\n};\n\n/**\n * A generic, extensible class for building environment variables from\n * objects with type-discriminated values.\n *\n * @template TRecord - The input record type for type inference\n * @template TResolvers - The resolvers type (defaults to TypedResolvers<TRecord>)\n *\n * @example\n * ```typescript\n * const env = new EnvironmentBuilder(\n * {\n * apiKey: { type: 'secret', value: 'xyz' },\n * appName: 'my-app'\n * },\n * {\n * // `value` is typed as { value: string } (without `type`)\n * secret: (key, value) => ({ [key]: value.value }),\n * }\n * ).build();\n * // { API_KEY: 'xyz', APP_NAME: 'my-app' }\n * ```\n */\nexport class EnvironmentBuilder<\n\tTRecord extends Record<string, InputValue> = Record<string, InputValue>,\n\tTResolvers extends Resolvers = TypedResolvers<TRecord>,\n> {\n\tprivate readonly record: TRecord;\n\tprivate readonly resolvers: TResolvers;\n\tprivate readonly options: Required<EnvironmentBuilderOptions>;\n\n\tconstructor(\n\t\trecord: TRecord,\n\t\tresolvers: TResolvers,\n\t\toptions: EnvironmentBuilderOptions = {},\n\t) {\n\t\tthis.record = record;\n\t\tthis.resolvers = resolvers;\n\t\tthis.options = {\n\t\t\tonUnmatchedValue: options.onUnmatchedValue ?? ((_key, _value) => {}),\n\t\t};\n\t}\n\n\t/**\n\t * Build environment variables from the input record.\n\t *\n\t * - Plain string values are passed through with key transformation\n\t * - Object values with a `type` property are matched against resolvers\n\t * - Resolvers receive values without the `type` key\n\t * - Only root-level keys are transformed to UPPER_SNAKE_CASE\n\t *\n\t * @returns A record of environment variables\n\t */\n\tbuild(): EnvRecord {\n\t\tconst env: EnvRecord = {};\n\n\t\tfor (const [key, value] of Object.entries(this.record)) {\n\t\t\t// Handle plain string values\n\t\t\tif (typeof value === 'string') {\n\t\t\t\tenv[environmentCase(key)] = value;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Handle objects with type discriminator\n\t\t\tconst { type, ...rest } = value;\n\t\t\tconst resolver = this.resolvers[type];\n\t\t\tif (resolver) {\n\t\t\t\tconst resolved = resolver(key, rest);\n\t\t\t\t// Transform only root-level keys from resolver output\n\t\t\t\tfor (const [resolvedKey, resolvedValue] of Object.entries(resolved)) {\n\t\t\t\t\tenv[environmentCase(resolvedKey)] = resolvedValue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.options.onUnmatchedValue(key, value);\n\t\t\t}\n\t\t}\n\n\t\treturn env;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,gBAAgBA,MAAsB;AACrD,QAAO,UAAU,KAAK,CACpB,aAAa,CACb,QAAQ,SAAS,CAAC,MAAM;AACxB,SAAO,EAAE,QAAQ,KAAK,GAAG;CACzB,EAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;AAoHD,IAAa,qBAAb,MAGE;CACD,AAAiB;CACjB,AAAiB;CACjB,AAAiB;CAEjB,YACCC,QACAC,WACAC,UAAqC,CAAE,GACtC;AACD,OAAK,SAAS;AACd,OAAK,YAAY;AACjB,OAAK,UAAU,EACd,kBAAkB,QAAQ,qBAAqB,CAAC,MAAM,WAAW,CAAE,GACnE;CACD;;;;;;;;;;;CAYD,QAAmB;EAClB,MAAMC,MAAiB,CAAE;AAEzB,OAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,KAAK,OAAO,EAAE;AAEvD,cAAW,UAAU,UAAU;AAC9B,QAAI,gBAAgB,IAAI,IAAI;AAC5B;GACA;GAGD,MAAM,EAAE,KAAM,GAAG,MAAM,GAAG;GAC1B,MAAM,WAAW,KAAK,UAAU;AAChC,OAAI,UAAU;IACb,MAAM,WAAW,SAAS,KAAK,KAAK;AAEpC,SAAK,MAAM,CAAC,aAAa,cAAc,IAAI,OAAO,QAAQ,SAAS,CAClE,KAAI,gBAAgB,YAAY,IAAI;GAErC,MACA,MAAK,QAAQ,iBAAiB,KAAK,MAAM;EAE1C;AAED,SAAO;CACP;AACD"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* environmentCase('myVariable') // 'MY_VARIABLE'
|
|
11
|
-
* environmentCase('
|
|
11
|
+
* environmentCase('api2') // 'API2'
|
|
12
12
|
*/
|
|
13
13
|
declare function environmentCase(name: string): string;
|
|
14
14
|
/**
|
|
@@ -128,4 +128,4 @@ declare class EnvironmentBuilder<TRecord extends Record<string, InputValue> = Re
|
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
130
|
export { EnvRecord, EnvValue, EnvironmentBuilder, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, TypedInputValue, TypedResolvers, environmentCase };
|
|
131
|
-
//# sourceMappingURL=EnvironmentBuilder-
|
|
131
|
+
//# sourceMappingURL=EnvironmentBuilder-CoBQ9Xp2.d.mts.map
|
package/dist/{EnvironmentBuilder-CNgcdzSR.d.cts.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U,SAAA;EAAU,IAAzB,EAAA,KAAA,WAAA,MAAA;CAAM,GA3D4C,CA2D5C,GAAsC,KAAA;;;;KAtDxD,QAuD2B,CAAA,CAAA,CAAA,GAvDb,CAuDa,SAAA;EAAc,IAOpC,EAAA,MAAA;CAAO,GA9D+B,IA+DnC,CA/DwC,CA+DxC,EAAA,MAAA,CAAA,GAAA,KAAA;;;AAoBM;KA9Ed,8BAA8B,eAAe,6BACrC,UAAU,YAAY,QAAQ,YACnC;;;;KAKH,6BACY,eAAe,mDAGnB,UAAU,QAAQ;QAAmB;IAC9C,SAAS,QAAQ,oBAEb;;;;;KAMI,+BAA+B,eAAe,2BAC/C,cAAc,WAAW,oBAClC,aAAa,SAAS;;;;;;;;;;;;;;;;;;;;;;;cA0BX,mCACI,eAAe,cAAc,eAAe,gCACzC,YAAY,eAAe;;;;sBAOrC,oBACG,sBACF;;;;;;;;;;;WAmBD"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* environmentCase('myVariable') // 'MY_VARIABLE'
|
|
11
|
-
* environmentCase('
|
|
11
|
+
* environmentCase('api2') // 'API2'
|
|
12
12
|
*/
|
|
13
13
|
declare function environmentCase(name: string): string;
|
|
14
14
|
/**
|
|
@@ -128,4 +128,4 @@ declare class EnvironmentBuilder<TRecord extends Record<string, InputValue> = Re
|
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
130
|
export { EnvRecord, EnvValue, EnvironmentBuilder, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, TypedInputValue, TypedResolvers, environmentCase };
|
|
131
|
-
//# sourceMappingURL=EnvironmentBuilder-
|
|
131
|
+
//# sourceMappingURL=EnvironmentBuilder-DeIle4QN.d.cts.map
|
package/dist/{EnvironmentBuilder-DHfDXJUm.d.mts.map → EnvironmentBuilder-DeIle4QN.d.cts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentBuilder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AA,CAAA,CAAA,GAvDb,CAuDa,SAAA;EAAc,IAOpC,EAAA,MAAA;CAAO,GA9D+B,IA+DnC,CA/DwC,CA+DxC,EAAA,MAAA,CAAA,GAAA,KAAA;;;AAoBM;KA9Ed,8BAA8B,eAAe,6BACrC,UAAU,YAAY,QAAQ,YACnC;;;;KAKH,6BACY,eAAe,mDAGnB,UAAU,QAAQ;QAAmB;IAC9C,SAAS,QAAQ,oBAEb;;;;;KAMI,+BAA+B,eAAe,2BAC/C,cAAc,WAAW,oBAClC,aAAa,SAAS;;;;;;;;;;;;;;;;;;;;;;;cA0BX,mCACI,eAAe,cAAc,eAAe,gCACzC,YAAY,eAAe;;;;sBAOrC,oBACG,sBACF;;;;;;;;;;;WAmBD"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_EnvironmentParser = require('./EnvironmentParser-Bzg5yXG2.cjs');
|
|
2
|
-
const require_EnvironmentBuilder = require('./EnvironmentBuilder-
|
|
2
|
+
const require_EnvironmentBuilder = require('./EnvironmentBuilder-15SdFJdK.cjs');
|
|
3
3
|
|
|
4
4
|
exports.ConfigParser = require_EnvironmentParser.ConfigParser;
|
|
5
5
|
exports.EnvironmentBuilder = require_EnvironmentBuilder.EnvironmentBuilder;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigParser, EmptyObject, EnvFetcher, EnvironmentParser, InferConfig } from "./EnvironmentParser-DoooZm8n.cjs";
|
|
2
|
-
import { EnvRecord, EnvValue, EnvironmentBuilder, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, TypedInputValue, TypedResolvers, environmentCase } from "./EnvironmentBuilder-
|
|
2
|
+
import { EnvRecord, EnvValue, EnvironmentBuilder, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, TypedInputValue, TypedResolvers, environmentCase } from "./EnvironmentBuilder-DeIle4QN.cjs";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
4
|
|
|
5
5
|
//#region src/formatter.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigParser, EmptyObject, EnvFetcher, EnvironmentParser, InferConfig } from "./EnvironmentParser-BY1oCUsc.mjs";
|
|
2
|
-
import { EnvRecord, EnvValue, EnvironmentBuilder, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, TypedInputValue, TypedResolvers, environmentCase } from "./EnvironmentBuilder-
|
|
2
|
+
import { EnvRecord, EnvValue, EnvironmentBuilder, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, TypedInputValue, TypedResolvers, environmentCase } from "./EnvironmentBuilder-CoBQ9Xp2.mjs";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
4
|
|
|
5
5
|
//#region src/formatter.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ConfigParser, EnvironmentParser, formatParseError, isDevelopment } from "./EnvironmentParser-taAKfzT7.mjs";
|
|
2
|
-
import { EnvironmentBuilder, environmentCase } from "./EnvironmentBuilder-
|
|
2
|
+
import { EnvironmentBuilder, environmentCase } from "./EnvironmentBuilder-C-2fViCT.mjs";
|
|
3
3
|
|
|
4
4
|
export { ConfigParser, EnvironmentBuilder, EnvironmentParser, environmentCase, formatParseError, isDevelopment };
|
package/dist/sst.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_EnvironmentBuilder = require('./EnvironmentBuilder-
|
|
1
|
+
const require_EnvironmentBuilder = require('./EnvironmentBuilder-15SdFJdK.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/SstEnvironmentBuilder.ts
|
|
4
4
|
/**
|
|
@@ -9,7 +9,7 @@ let ResourceType = /* @__PURE__ */ function(ResourceType$1) {
|
|
|
9
9
|
ResourceType$1["ApiGatewayV2"] = "sst.aws.ApiGatewayV2";
|
|
10
10
|
ResourceType$1["Postgres"] = "sst.aws.Postgres";
|
|
11
11
|
ResourceType$1["Function"] = "sst.aws.Function";
|
|
12
|
-
ResourceType$1["
|
|
12
|
+
ResourceType$1["ObjectStorage"] = "sst.aws.Bucket";
|
|
13
13
|
ResourceType$1["Vpc"] = "sst.aws.Vpc";
|
|
14
14
|
ResourceType$1["Secret"] = "sst.sst.Secret";
|
|
15
15
|
ResourceType$1["Dynamo"] = "sst.aws.Dynamo";
|
|
@@ -18,10 +18,14 @@ let ResourceType = /* @__PURE__ */ function(ResourceType$1) {
|
|
|
18
18
|
ResourceType$1["SSTFunction"] = "sst:sst:Function";
|
|
19
19
|
ResourceType$1["SSTApiGatewayV2"] = "sst:aws:ApiGatewayV2";
|
|
20
20
|
ResourceType$1["SSTPostgres"] = "sst:aws:Postgres";
|
|
21
|
-
ResourceType$1["
|
|
21
|
+
ResourceType$1["SSTObjectStorage"] = "sst:aws:Bucket";
|
|
22
22
|
ResourceType$1["SnsTopic"] = "sst:aws:SnsTopic";
|
|
23
23
|
ResourceType$1["SSTDynamo"] = "sst:aws:Dynamo";
|
|
24
24
|
ResourceType$1["SSTQueue"] = "sst:aws:Queue";
|
|
25
|
+
ResourceType$1["FileServer"] = "sst:aws:Router";
|
|
26
|
+
ResourceType$1["StaticSite"] = "sst:aws:StaticSite";
|
|
27
|
+
ResourceType$1["Email"] = "gkm:aws:Email";
|
|
28
|
+
ResourceType$1["Cache"] = "gkm:aws:Cache";
|
|
25
29
|
return ResourceType$1;
|
|
26
30
|
}({});
|
|
27
31
|
const secretResolver = (name, value) => ({ [name]: value.value });
|
|
@@ -33,7 +37,10 @@ const postgresResolver = (key, value) => ({
|
|
|
33
37
|
[`${key}Username`]: value.username,
|
|
34
38
|
[`${key}Url`]: `postgresql://${encodeURIComponent(value.username)}:${encodeURIComponent(value.password)}@${value.host}:${value.port}/${value.database}`
|
|
35
39
|
});
|
|
36
|
-
const bucketResolver = (name, value) => ({
|
|
40
|
+
const bucketResolver = (name, value) => ({
|
|
41
|
+
[`${name}Name`]: value.name,
|
|
42
|
+
[`${name}Url`]: value.url ?? ""
|
|
43
|
+
});
|
|
37
44
|
const topicResolver = (name, value) => ({
|
|
38
45
|
[`${name}Arn`]: value.arn,
|
|
39
46
|
[`${name}PublisherConnectionString`]: `sns://?topicArn=${encodeURIComponent(value.arn)}`
|
|
@@ -54,11 +61,11 @@ const sstResolvers = {
|
|
|
54
61
|
[ResourceType.Vpc]: noopResolver,
|
|
55
62
|
[ResourceType.Secret]: secretResolver,
|
|
56
63
|
[ResourceType.Postgres]: postgresResolver,
|
|
57
|
-
[ResourceType.
|
|
64
|
+
[ResourceType.ObjectStorage]: bucketResolver,
|
|
58
65
|
[ResourceType.Dynamo]: dynamoResolver,
|
|
59
66
|
[ResourceType.Queue]: queueResolver,
|
|
60
67
|
[ResourceType.SSTSecret]: secretResolver,
|
|
61
|
-
[ResourceType.
|
|
68
|
+
[ResourceType.SSTObjectStorage]: bucketResolver,
|
|
62
69
|
[ResourceType.SSTFunction]: noopResolver,
|
|
63
70
|
[ResourceType.SSTPostgres]: postgresResolver,
|
|
64
71
|
[ResourceType.SSTApiGatewayV2]: noopResolver,
|
package/dist/sst.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sst.cjs","names":["name: string","value: SecretValue","key: string","value: PostgresValue","value: BucketValue","value: SnsTopicValue","value: QueueValue","value: DynamoValue","sstResolvers: Resolvers","record: TRecord","additionalResolvers?: CustomResolvers<TRecord>","options?: EnvironmentBuilderOptions","mergedResolvers: Resolvers","EnvironmentBuilder","platform: Platform","a: string","b: string","curr: number[]","missing: string","available: readonly string[]","args: {\n\t\tmissing: string[];\n\t\tavailable: string[];\n\t\tlinkVars: string[];\n\t\tsuggestions: Record<string, string[]>;\n\t\tcontext?: string;\n\t}","args: {\n\t\tmissing: string[];\n\t\tlinkVars: string[];\n\t\tsuggestions: Record<string, string[]>;\n\t\tcontext?: string;\n\t}","provided: string","record: LinkRecord","typeOnly: Record<string, InputValue>","EnvironmentBuilder","links: LinkRecord","options: EnvValidatorOptions","requestedEnvVars: readonly string[]","providers: string[]","suggestions: Record<string, string[]>","envVar: string","record: Record<string, SstResource | string>"],"sources":["../src/SstEnvironmentBuilder.ts","../src/SstEnvValidator.ts","../src/sst.ts"],"sourcesContent":["import {\n\tEnvironmentBuilder,\n\ttype EnvironmentBuilderOptions,\n\ttype EnvironmentResolver,\n\ttype EnvRecord,\n\ttype InputValue,\n\ttype Resolvers,\n} from './EnvironmentBuilder';\n\n/**\n * Enumeration of supported SST (Serverless Stack Toolkit) resource types.\n * Used to identify and process different AWS and SST resources.\n */\nexport enum ResourceType {\n\t// Legacy format (dot notation)\n\tApiGatewayV2 = 'sst.aws.ApiGatewayV2',\n\tPostgres = 'sst.aws.Postgres',\n\tFunction = 'sst.aws.Function',\n\tBucket = 'sst.aws.Bucket',\n\tVpc = 'sst.aws.Vpc',\n\tSecret = 'sst.sst.Secret',\n\tDynamo = 'sst.aws.Dynamo',\n\tQueue = 'sst.aws.Queue',\n\n\t// Modern format (colon notation)\n\tSSTSecret = 'sst:sst:Secret',\n\tSSTFunction = 'sst:sst:Function',\n\tSSTApiGatewayV2 = 'sst:aws:ApiGatewayV2',\n\tSSTPostgres = 'sst:aws:Postgres',\n\tSSTBucket = 'sst:aws:Bucket',\n\tSnsTopic = 'sst:aws:SnsTopic',\n\tSSTDynamo = 'sst:aws:Dynamo',\n\tSSTQueue = 'sst:aws:Queue',\n}\n\n/**\n * AWS API Gateway V2 resource type.\n * Represents an HTTP/WebSocket API.\n */\nexport type ApiGatewayV2 = {\n\ttype: ResourceType.ApiGatewayV2 | ResourceType.SSTApiGatewayV2;\n\turl: string;\n};\n\n/**\n * PostgreSQL database resource type.\n * Contains all connection details needed to connect to the database.\n */\nexport type Postgres = {\n\ttype: ResourceType.Postgres | ResourceType.SSTPostgres;\n\tdatabase: string;\n\thost: string;\n\tpassword: string;\n\tport: number;\n\tusername: string;\n};\n\n/**\n * AWS Lambda Function resource type.\n */\nexport type Function = {\n\ttype: ResourceType.Function | ResourceType.SSTFunction;\n\tname: string;\n};\n\n/**\n * AWS S3 Bucket resource type.\n */\nexport type Bucket = {\n\ttype: ResourceType.Bucket | ResourceType.SSTBucket;\n\tname: string;\n};\n\n/**\n * AWS VPC (Virtual Private Cloud) resource type.\n */\nexport type Vpc = {\n\ttype: ResourceType.Vpc;\n\tbastion: string;\n};\n\n/**\n * Secret resource type for storing sensitive values.\n */\nexport type Secret = {\n\ttype: ResourceType.Secret | ResourceType.SSTSecret;\n\tvalue: string;\n};\n\n/**\n * AWS SNS Topic resource type.\n */\nexport type SnsTopic = {\n\ttype: ResourceType.SnsTopic;\n\tarn: string;\n};\n\n/**\n * AWS SQS Queue resource type.\n */\nexport type Queue = {\n\ttype: ResourceType.Queue | ResourceType.SSTQueue;\n\turl: string;\n\tarn: string;\n};\n\n/**\n * AWS DynamoDB Table resource type.\n */\nexport type Dynamo = {\n\ttype: ResourceType.Dynamo | ResourceType.SSTDynamo;\n\tname: string;\n};\n\n/**\n * Union type of all supported SST resource types.\n */\nexport type SstResource =\n\t| ApiGatewayV2\n\t| Postgres\n\t| Function\n\t| Bucket\n\t| Vpc\n\t| Secret\n\t| SnsTopic\n\t| Queue\n\t| Dynamo;\n\n// Value types without the `type` key (for resolver parameters)\ntype SecretValue = Omit<Secret, 'type'>;\ntype PostgresValue = Omit<Postgres, 'type'>;\ntype BucketValue = Omit<Bucket, 'type'>;\ntype SnsTopicValue = Omit<SnsTopic, 'type'>;\ntype QueueValue = Omit<Queue, 'type'>;\ntype DynamoValue = Omit<Dynamo, 'type'>;\n\n/**\n * Function type for processing a specific resource type into environment variables.\n *\n * @template K - The specific resource type (without `type` key)\n * @param name - The resource name\n * @param value - The resource value (without `type` key)\n * @returns Object mapping environment variable names to values\n */\nexport type ResourceProcessor<K> = (name: string, value: K) => EnvRecord;\n\n// SST Resource Resolvers (receive values without `type` key)\n\nconst secretResolver = (name: string, value: SecretValue) => ({\n\t[name]: value.value,\n});\n\nconst postgresResolver = (key: string, value: PostgresValue) => ({\n\t[`${key}Name`]: value.database,\n\t[`${key}Host`]: value.host,\n\t[`${key}Password`]: value.password,\n\t[`${key}Port`]: value.port,\n\t[`${key}Username`]: value.username,\n\t[`${key}Url`]: `postgresql://${encodeURIComponent(value.username)}:${encodeURIComponent(value.password)}@${value.host}:${value.port}/${value.database}`,\n});\n\nconst bucketResolver = (name: string, value: BucketValue) => ({\n\t[`${name}Name`]: value.name,\n});\n\nconst topicResolver = (name: string, value: SnsTopicValue) => ({\n\t[`${name}Arn`]: value.arn,\n\t// A publisher connection string for `@geekmidas/events` (SNS); region is\n\t// resolved from the ARN / AWS_REGION at runtime.\n\t[`${name}PublisherConnectionString`]: `sns://?topicArn=${encodeURIComponent(value.arn)}`,\n});\n\nconst queueResolver = (name: string, value: QueueValue) => ({\n\t[`${name}Url`]: value.url,\n\t[`${name}Arn`]: value.arn,\n\t// A publisher connection string for `@geekmidas/events` (SQS); region is\n\t// resolved from the URL / AWS_REGION at runtime.\n\t[`${name}PublisherConnectionString`]: `sqs://?queueUrl=${encodeURIComponent(value.url)}`,\n});\n\nconst dynamoResolver = (name: string, value: DynamoValue) => ({\n\t[`${name}Name`]: value.name,\n});\n\nconst noopResolver = () => ({});\n\n/**\n * Pre-configured resolvers for all SST resource types.\n */\nexport const sstResolvers: Resolvers = {\n\t// Legacy format\n\t[ResourceType.ApiGatewayV2]: noopResolver,\n\t[ResourceType.Function]: noopResolver,\n\t[ResourceType.Vpc]: noopResolver,\n\t[ResourceType.Secret]: secretResolver,\n\t[ResourceType.Postgres]: postgresResolver,\n\t[ResourceType.Bucket]: bucketResolver,\n\t[ResourceType.Dynamo]: dynamoResolver,\n\t[ResourceType.Queue]: queueResolver,\n\n\t// Modern format\n\t[ResourceType.SSTSecret]: secretResolver,\n\t[ResourceType.SSTBucket]: bucketResolver,\n\t[ResourceType.SSTFunction]: noopResolver,\n\t[ResourceType.SSTPostgres]: postgresResolver,\n\t[ResourceType.SSTApiGatewayV2]: noopResolver,\n\t[ResourceType.SnsTopic]: topicResolver,\n\t[ResourceType.SSTDynamo]: dynamoResolver,\n\t[ResourceType.SSTQueue]: queueResolver,\n};\n\n/**\n * All known SST resource type strings.\n */\ntype SstResourceTypeString = `${ResourceType}`;\n\n/**\n * Extracts the `type` string value from an input value.\n */\ntype ExtractType<T> = T extends { type: infer U extends string } ? U : never;\n\n/**\n * Removes the `type` key from an object type.\n */\ntype OmitType<T> = T extends { type: string } ? Omit<T, 'type'> : never;\n\n/**\n * Extracts all unique `type` values from a record (excluding plain strings).\n */\ntype AllTypeValues<TRecord extends Record<string, InputValue>> = {\n\t[K in keyof TRecord]: ExtractType<TRecord[K]>;\n}[keyof TRecord];\n\n/**\n * Extracts only the custom (non-SST) type values from a record.\n */\ntype CustomTypeValues<TRecord extends Record<string, InputValue>> = Exclude<\n\tAllTypeValues<TRecord>,\n\tSstResourceTypeString\n>;\n\n/**\n * For a given type value, finds the corresponding value type (without `type` key).\n */\ntype ValueForType<\n\tTRecord extends Record<string, InputValue>,\n\tTType extends string,\n> = {\n\t[K in keyof TRecord]: TRecord[K] extends { type: TType }\n\t\t? OmitType<TRecord[K]>\n\t\t: never;\n}[keyof TRecord];\n\n/**\n * Generates typed resolvers for custom (non-SST) types in the input record.\n */\ntype CustomResolvers<TRecord extends Record<string, InputValue>> =\n\tCustomTypeValues<TRecord> extends never\n\t\t? Resolvers | undefined\n\t\t: {\n\t\t\t\t[TType in CustomTypeValues<TRecord>]: EnvironmentResolver<\n\t\t\t\t\tValueForType<TRecord, TType>\n\t\t\t\t>;\n\t\t\t};\n\n/**\n * SST-specific environment builder with built-in resolvers for all known\n * SST resource types.\n *\n * Wraps the generic EnvironmentBuilder with pre-configured SST resolvers.\n *\n * @template TRecord - The input record type for type inference\n *\n * @example\n * ```typescript\n * const env = new SstEnvironmentBuilder({\n * database: { type: 'sst:aws:Postgres', host: '...', ... },\n * apiKey: { type: 'sst:sst:Secret', value: 'secret' },\n * appName: 'my-app',\n * }).build();\n *\n * // With custom resolvers (typed based on input)\n * const env = new SstEnvironmentBuilder(\n * {\n * database: postgresResource,\n * custom: { type: 'my-custom' as const, data: 'foo' },\n * },\n * {\n * // TypeScript requires 'my-custom' resolver with typed value\n * 'my-custom': (key, value) => ({ [`${key}Data`]: value.data }),\n * }\n * ).build();\n * ```\n */\nexport class SstEnvironmentBuilder<\n\tTRecord extends Record<string, SstResource | InputValue | string>,\n> {\n\tprivate readonly builder: EnvironmentBuilder<\n\t\tRecord<string, InputValue>,\n\t\tResolvers\n\t>;\n\n\t/**\n\t * Create a new SST environment builder.\n\t *\n\t * @param record - Object containing SST resources, custom resources, and/or string values\n\t * @param additionalResolvers - Optional custom resolvers (typed based on custom types in record)\n\t * @param options - Optional configuration options\n\t */\n\tconstructor(\n\t\trecord: TRecord,\n\t\tadditionalResolvers?: CustomResolvers<TRecord>,\n\t\toptions?: EnvironmentBuilderOptions,\n\t) {\n\t\t// Merge resolvers with custom ones taking precedence\n\t\tconst mergedResolvers: Resolvers = additionalResolvers\n\t\t\t? { ...sstResolvers, ...additionalResolvers }\n\t\t\t: sstResolvers;\n\n\t\tthis.builder = new EnvironmentBuilder(\n\t\t\trecord as Record<string, InputValue>,\n\t\t\tmergedResolvers,\n\t\t\toptions,\n\t\t);\n\t}\n\n\t/**\n\t * Build environment variables from the input record.\n\t *\n\t * @returns A record of environment variables\n\t */\n\tbuild(): EnvRecord {\n\t\treturn this.builder.build();\n\t}\n}\n\nexport type {\n\tEnvironmentBuilderOptions,\n\tEnvRecord,\n\tEnvValue,\n} from './EnvironmentBuilder';\n// Re-export useful types\nexport { environmentCase } from './EnvironmentBuilder';\n","import { EnvironmentBuilder, type InputValue } from './EnvironmentBuilder';\nimport { type SstResource, sstResolvers } from './SstEnvironmentBuilder';\n\n/**\n * Variables AWS Lambda injects into the runtime. Always valid on AWS, but never\n * assumed — opt in via `platform: 'aws'` or by spreading {@link AWS_RUNTIME_ENV_VARS}\n * into `whitelist`.\n */\nexport const AWS_RUNTIME_ENV_VARS = [\n\t'AWS_REGION',\n\t'AWS_DEFAULT_REGION',\n\t'AWS_ENDPOINT_URL',\n\t'AWS_ENDPOINT',\n\t'AWS_ACCESS_KEY_ID',\n\t'AWS_SECRET_ACCESS_KEY',\n\t'AWS_SESSION_TOKEN',\n\t'AWS_LAMBDA_FUNCTION_NAME',\n\t'AWS_LAMBDA_FUNCTION_VERSION',\n] as const;\n\n/**\n * Variables GCP injects into Cloud Functions / Cloud Run.\n */\nexport const GCP_RUNTIME_ENV_VARS = [\n\t'GOOGLE_CLOUD_PROJECT',\n\t'GCP_PROJECT',\n\t'FUNCTION_TARGET',\n\t'FUNCTION_SIGNATURE_TYPE',\n\t'K_SERVICE',\n\t'K_REVISION',\n\t'K_CONFIGURATION',\n\t'PORT',\n] as const;\n\n/**\n * Variables Cloudflare exposes to Workers. Workers inject almost nothing into\n * the global env, so this is intentionally minimal.\n */\nexport const CLOUDFLARE_RUNTIME_ENV_VARS = [\n\t'CF_PAGES',\n\t'CF_PAGES_URL',\n] as const;\n\n/**\n * Registry of platform → always-valid runtime variables. Export, don't assume:\n * a caller states the platform it deploys to and the matching set is trusted.\n */\nexport const PLATFORM_ENV_VARS = {\n\taws: AWS_RUNTIME_ENV_VARS,\n\tgcp: GCP_RUNTIME_ENV_VARS,\n\tcloudflare: CLOUDFLARE_RUNTIME_ENV_VARS,\n} as const;\n\nexport type Platform = keyof typeof PLATFORM_ENV_VARS;\n\n/**\n * The always-valid runtime variables for a platform. The \"whitelist construct\":\n * resolve a platform to its set, to spread into `whitelist` or compare against.\n */\nexport function platformEnvVars(platform: Platform): readonly string[] {\n\treturn PLATFORM_ENV_VARS[platform];\n}\n\n/** How many link-provided vars to list in an error before truncating. */\nconst MAX_LISTED_VARS = 8;\n\n/** Minimum similarity for a variable to be offered as a \"did you mean\". */\nconst SUGGESTION_THRESHOLD = 0.3;\n\n/**\n * Input shape for the validator: the same record `SstEnvironmentBuilder`\n * accepts — keyed by resource name, valued by an SST resource (or a plain\n * string for pass-through env vars).\n */\nexport type LinkRecord = Record<string, SstResource | InputValue | string>;\n\nexport interface ValidationResult {\n\tvalid: boolean;\n\t/** Requested variables that are not available (excluding optional `?` vars). */\n\tinvalidVars: string[];\n\t/** Every variable the links + whitelist make available. */\n\tavailableVars: string[];\n\t/** Nearest available matches for each invalid variable (best first). */\n\tsuggestions: Record<string, string[]>;\n}\n\nexport interface EnvValidatorOptions {\n\t/**\n\t * Platform whose runtime-injected variables are always valid. Omit to assume\n\t * none — the validator never bakes in a platform's variables.\n\t */\n\tplatform?: Platform;\n\t/**\n\t * Extra always-valid variables in addition to the platform set — typically\n\t * the keys of a function's explicit `environment`.\n\t */\n\twhitelist?: readonly string[];\n\t/**\n\t * Label for the deployable unit (e.g. a function name), used in error\n\t * messages so a failure points at exactly one unit.\n\t */\n\tcontext?: string;\n}\n\n/**\n * Levenshtein edit distance between two strings.\n */\nfunction levenshtein(a: string, b: string): number {\n\tconst m = a.length;\n\tconst n = b.length;\n\tif (m === 0) return n;\n\tif (n === 0) return m;\n\n\tlet prev = Array.from({ length: n + 1 }, (_, i) => i);\n\n\tfor (let i = 1; i <= m; i++) {\n\t\tconst curr: number[] = [i];\n\t\tfor (let j = 1; j <= n; j++) {\n\t\t\tconst cost = a[i - 1] === b[j - 1] ? 0 : 1;\n\t\t\tconst del = (prev[j] ?? 0) + 1;\n\t\t\tconst ins = (curr[j - 1] ?? 0) + 1;\n\t\t\tconst sub = (prev[j - 1] ?? 0) + cost;\n\t\t\tcurr[j] = Math.min(del, ins, sub);\n\t\t}\n\t\tprev = curr;\n\t}\n\n\treturn prev[n] ?? 0;\n}\n\n/**\n * Similarity in `[0, 1]` combining edit distance with `_`-token overlap, so both\n * near-typos (a missing underscore) and renames (`DATABASE_URL` ~ `DB_URL`,\n * which share the `URL` token) are caught.\n */\nfunction similarity(a: string, b: string): number {\n\tconst editSim = 1 - levenshtein(a, b) / Math.max(a.length, b.length, 1);\n\n\tconst ta = new Set(a.split('_').filter(Boolean));\n\tconst tb = new Set(b.split('_').filter(Boolean));\n\tconst shared = [...ta].filter((t) => tb.has(t)).length;\n\tconst union = new Set([...ta, ...tb]).size || 1;\n\tconst tokenSim = shared / union;\n\n\t// Nudge token-overlap matches ahead of coincidental edit-distance ones, so a\n\t// rename like DATABASE_URL prefers DB_URL (shares `URL`) over DB_PASSWORD.\n\treturn Math.max(editSim, tokenSim * 1.15);\n}\n\n/**\n * Returns the nearest available variables to `missing`, best first, limited to\n * those above {@link SUGGESTION_THRESHOLD}.\n */\nfunction suggestionsFor(\n\tmissing: string,\n\tavailable: readonly string[],\n\tmax = 1,\n): string[] {\n\treturn available\n\t\t.map((candidate) => ({ candidate, score: similarity(missing, candidate) }))\n\t\t.filter((s) => s.score >= SUGGESTION_THRESHOLD)\n\t\t.sort((a, b) => b.score - a.score)\n\t\t.slice(0, max)\n\t\t.map((s) => s.candidate);\n}\n\n/**\n * Thrown when a deployable unit requires environment variables its links do not\n * provide. Carries the structured `missing`/`available`/`suggestions` so callers\n * can inspect the failure programmatically, not just read the message.\n */\nexport class EnvValidationError extends Error {\n\treadonly isEnvValidationError = true;\n\treadonly missing: string[];\n\treadonly available: string[];\n\treadonly suggestions: Record<string, string[]>;\n\treadonly context?: string;\n\n\tconstructor(args: {\n\t\tmissing: string[];\n\t\tavailable: string[];\n\t\tlinkVars: string[];\n\t\tsuggestions: Record<string, string[]>;\n\t\tcontext?: string;\n\t}) {\n\t\tsuper(EnvValidationError.format(args));\n\t\tthis.name = 'EnvValidationError';\n\t\tthis.missing = args.missing;\n\t\tthis.available = args.available;\n\t\tthis.suggestions = args.suggestions;\n\t\tthis.context = args.context;\n\t\t// V8-only; keeps the constructor out of the stack trace.\n\t\t(\n\t\t\tError as unknown as {\n\t\t\t\tcaptureStackTrace?(target: object, ctor?: unknown): void;\n\t\t\t}\n\t\t).captureStackTrace?.(this, EnvValidationError);\n\t}\n\n\tprivate static format(args: {\n\t\tmissing: string[];\n\t\tlinkVars: string[];\n\t\tsuggestions: Record<string, string[]>;\n\t\tcontext?: string;\n\t}): string {\n\t\tconst { missing, linkVars, suggestions, context } = args;\n\t\tconst who = context ? `'${context}'` : 'a deployable unit';\n\n\t\tconst width = Math.max(...missing.map((v) => v.length));\n\t\tconst lines = missing.map((v) => {\n\t\t\tconst hints = suggestions[v] ?? [];\n\t\t\tconst hint = hints.length ? `(did you mean ${hints.join(' or ')}?)` : '';\n\t\t\treturn ` - ${v.padEnd(width)} ${hint}`.trimEnd();\n\t\t});\n\n\t\tlet provided: string;\n\t\tif (linkVars.length === 0) {\n\t\t\tprovided = '(no links provide environment variables)';\n\t\t} else {\n\t\t\tconst shown = linkVars.slice(0, MAX_LISTED_VARS).join(', ');\n\t\t\tconst extra =\n\t\t\t\tlinkVars.length > MAX_LISTED_VARS\n\t\t\t\t\t? ` ...(+${linkVars.length - MAX_LISTED_VARS})`\n\t\t\t\t\t: '';\n\t\t\tprovided = `Provided by links: ${shown}${extra}`;\n\t\t}\n\n\t\treturn `${who} is missing required env vars:\\n${lines.join('\\n')}\\n\\n${provided}`;\n\t}\n}\n\n/**\n * Derives the set of environment-variable **keys** a group of linked resources\n * will produce at runtime — without resolving any value.\n *\n * This reuses the runtime resolvers (`sstResolvers`) via {@link EnvironmentBuilder},\n * so the keys computed here are exactly the keys a deployed function receives:\n * the validator and the runtime resolution share a single source of truth and\n * cannot drift. Because every resolver's output keys depend only on the record\n * key and the resource `type` (never the value), each resource is reduced to\n * `{ type }` before building, so no SST `Output` is ever read.\n *\n * @example\n * resolveEnvKeys({ db: { type: ResourceType.Postgres } });\n * // ['DB_NAME', 'DB_HOST', 'DB_PASSWORD', 'DB_PORT', 'DB_USERNAME', 'DB_URL']\n */\nexport function resolveEnvKeys(record: LinkRecord): string[] {\n\tconst typeOnly: Record<string, InputValue> = {};\n\tfor (const [key, value] of Object.entries(record)) {\n\t\ttypeOnly[key] = typeof value === 'string' ? '' : { type: value.type };\n\t}\n\treturn Object.keys(new EnvironmentBuilder(typeOnly, sstResolvers).build());\n}\n\n/**\n * Validates that the environment variables a deployable unit requires are\n * actually provided by its linked resources — at infra time, before deploy.\n *\n * Available variables are the union of the keys derived from `links`\n * ({@link resolveEnvKeys}), the chosen platform's runtime variables (only when\n * `options.platform` is set — nothing is assumed), and any `options.whitelist`\n * (e.g. the keys of a function's explicit `environment`). A requested variable\n * suffixed with `?` is treated as optional and never causes a failure.\n *\n * @example\n * const validator = new EnvValidator(\n * { db: { type: ResourceType.Postgres } },\n * { platform: 'aws', whitelist: ['APP_NAME'], context: 'orders-fn' },\n * );\n * validator.assert(['DB_HOST', 'AWS_REGION', 'APP_NAME', 'SENTRY_DSN?']); // ok\n * validator.assert(['DATABASE_URL']); // throws EnvValidationError (did you mean DB_URL?)\n */\nexport class EnvValidator {\n\t/** Every variable available — link-derived, platform, and extra whitelist. */\n\treadonly availableVars: string[];\n\t/** Just the variables the links provide (used for error context). */\n\treadonly linkVars: string[];\n\treadonly context?: string;\n\tprivate readonly availableSet: Set<string>;\n\t/** Per-link (record key → its env-var keys), for least-privilege filtering. */\n\tprivate readonly linkVarsByName: Map<string, string[]>;\n\n\tconstructor(links: LinkRecord, options: EnvValidatorOptions = {}) {\n\t\tconst { platform, whitelist = [], context } = options;\n\t\tthis.context = context;\n\t\tthis.linkVarsByName = new Map(\n\t\t\tObject.entries(links).map(([name, value]) => [\n\t\t\t\tname,\n\t\t\t\tresolveEnvKeys({ [name]: value }),\n\t\t\t]),\n\t\t);\n\t\tthis.linkVars = [...this.linkVarsByName.values()].flat();\n\t\tthis.availableVars = [\n\t\t\t...this.linkVars,\n\t\t\t...(platform ? PLATFORM_ENV_VARS[platform] : []),\n\t\t\t...whitelist,\n\t\t];\n\t\tthis.availableSet = new Set(this.availableVars);\n\t}\n\n\t/**\n\t * Returns the names of the links that provide at least one of the requested\n\t * variables — so a construct can attach only the links a unit actually needs\n\t * (least privilege) rather than the whole pool. Trailing `?` is ignored.\n\t */\n\tgetProvidersForEnvVars(requestedEnvVars: readonly string[]): string[] {\n\t\tconst requested = new Set(\n\t\t\trequestedEnvVars.map((v) => (v.endsWith('?') ? v.slice(0, -1) : v)),\n\t\t);\n\t\tconst providers: string[] = [];\n\t\tfor (const [name, vars] of this.linkVarsByName) {\n\t\t\tif (vars.some((v) => requested.has(v))) providers.push(name);\n\t\t}\n\t\treturn providers;\n\t}\n\n\t/**\n\t * Checks every requested variable against the available set. Variables\n\t * ending in `?` are optional and never reported as invalid. Invalid\n\t * variables come back with their nearest available matches.\n\t */\n\tvalidate(requestedEnvVars: readonly string[]): ValidationResult {\n\t\tconst invalidVars = requestedEnvVars.filter((envVar) => {\n\t\t\tif (envVar.endsWith('?')) return false;\n\t\t\treturn !this.availableSet.has(envVar);\n\t\t});\n\n\t\tconst suggestions: Record<string, string[]> = {};\n\t\tfor (const envVar of invalidVars) {\n\t\t\tconst matches = suggestionsFor(envVar, this.availableVars);\n\t\t\tif (matches.length) suggestions[envVar] = matches;\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: invalidVars.length === 0,\n\t\t\tinvalidVars,\n\t\t\tavailableVars: this.availableVars,\n\t\t\tsuggestions,\n\t\t};\n\t}\n\n\t/**\n\t * Asserts that every requested variable is available, throwing an\n\t * {@link EnvValidationError} otherwise. Intended to run in a construct's\n\t * constructor so a misconfigured `sst.config.ts` fails at synth time, before\n\t * any AWS call.\n\t */\n\tassert(requestedEnvVars: readonly string[]): void {\n\t\tconst { valid, invalidVars, suggestions } = this.validate(requestedEnvVars);\n\n\t\tif (!valid) {\n\t\t\tthrow new EnvValidationError({\n\t\t\t\tmissing: invalidVars,\n\t\t\t\tavailable: this.availableVars,\n\t\t\t\tlinkVars: this.linkVars,\n\t\t\t\tsuggestions,\n\t\t\t\tcontext: this.context,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Whether a single variable is available. Does not treat a trailing `?` as\n\t * optional — pass the bare name.\n\t */\n\thas(envVar: string): boolean {\n\t\treturn this.availableSet.has(envVar);\n\t}\n}\n","// Re-export everything from SstEnvironmentBuilder\n\n// Re-export types from EnvironmentBuilder\nexport type {\n\tEnvironmentBuilderOptions,\n\tEnvRecord,\n\tEnvValue,\n} from './EnvironmentBuilder';\n\n// Re-export environmentCase from EnvironmentBuilder\nexport { environmentCase } from './EnvironmentBuilder';\nexport {\n\ttype ApiGatewayV2,\n\ttype Bucket,\n\ttype Dynamo,\n\ttype Function,\n\ttype Postgres,\n\ttype Queue,\n\ttype ResourceProcessor,\n\tResourceType,\n\ttype Secret,\n\ttype SnsTopic,\n\tSstEnvironmentBuilder,\n\ttype SstResource,\n\tsstResolvers,\n\ttype Vpc,\n} from './SstEnvironmentBuilder';\n\nexport {\n\tAWS_RUNTIME_ENV_VARS,\n\tCLOUDFLARE_RUNTIME_ENV_VARS,\n\tEnvValidationError,\n\tEnvValidator,\n\ttype EnvValidatorOptions,\n\tGCP_RUNTIME_ENV_VARS,\n\ttype LinkRecord,\n\tPLATFORM_ENV_VARS,\n\ttype Platform,\n\tplatformEnvVars,\n\tresolveEnvKeys,\n\ttype ValidationResult,\n} from './SstEnvValidator';\n\n// Import for deprecated function\nimport {\n\tSstEnvironmentBuilder,\n\ttype SstResource,\n} from './SstEnvironmentBuilder';\n\n/**\n * @deprecated Use `new SstEnvironmentBuilder(record).build()` instead.\n *\n * Normalizes SST resources and plain strings into environment variables.\n * Processes resources based on their type and converts names to environment case.\n *\n * @param record - Object containing resources and/or string values\n * @returns Normalized environment variables object\n *\n * @example\n * // Old usage (deprecated):\n * normalizeResourceEnv({ database: postgresResource })\n *\n * // New usage:\n * new SstEnvironmentBuilder({ database: postgresResource }).build()\n */\nexport function normalizeResourceEnv(\n\trecord: Record<string, SstResource | string>,\n): Record<string, string | number | boolean | Record<string, unknown>> {\n\treturn new SstEnvironmentBuilder(record).build();\n}\n\n// Keep Resource type as deprecated alias for backwards compatibility\n/**\n * @deprecated Use `SstResource` instead.\n */\nexport type Resource = SstResource;\n"],"mappings":";;;;;;;AAaA,IAAY,wDAAL;AAEN;AACA;AACA;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I,mBAAmB;GAC5B,SAAS;GACT,WAAW,KAAK;GAChB,UAAU,KAAK;GACf;GACA,SAAS,KAAK;EACd;CAEF;;;;;CAMD,IAAIG,QAAyB;AAC5B,SAAO,KAAK,aAAa,IAAI,OAAO;CACpC;AACD;;;;;;;;;;;;;;;;;;;;AC/SD,SAAgB,qBACfC,QACsE;AACtE,QAAO,IAAI,sBAAsB,QAAQ,OAAO;AAChD"}
|
|
1
|
+
{"version":3,"file":"sst.cjs","names":["name: string","value: SecretValue","key: string","value: PostgresValue","value: BucketValue","value: SnsTopicValue","value: QueueValue","value: DynamoValue","sstResolvers: Resolvers","record: TRecord","additionalResolvers?: CustomResolvers<TRecord>","options?: EnvironmentBuilderOptions","mergedResolvers: Resolvers","EnvironmentBuilder","platform: Platform","a: string","b: string","curr: number[]","missing: string","available: readonly string[]","args: {\n\t\tmissing: string[];\n\t\tavailable: string[];\n\t\tlinkVars: string[];\n\t\tsuggestions: Record<string, string[]>;\n\t\tcontext?: string;\n\t}","args: {\n\t\tmissing: string[];\n\t\tlinkVars: string[];\n\t\tsuggestions: Record<string, string[]>;\n\t\tcontext?: string;\n\t}","provided: string","record: LinkRecord","typeOnly: Record<string, InputValue>","EnvironmentBuilder","links: LinkRecord","options: EnvValidatorOptions","requestedEnvVars: readonly string[]","providers: string[]","suggestions: Record<string, string[]>","envVar: string","record: Record<string, SstResource | string>"],"sources":["../src/SstEnvironmentBuilder.ts","../src/SstEnvValidator.ts","../src/sst.ts"],"sourcesContent":["import {\n\tEnvironmentBuilder,\n\ttype EnvironmentBuilderOptions,\n\ttype EnvironmentResolver,\n\ttype EnvRecord,\n\ttype InputValue,\n\ttype Resolvers,\n} from './EnvironmentBuilder';\n\n/**\n * Enumeration of supported SST (Serverless Stack Toolkit) resource types.\n * Used to identify and process different AWS and SST resources.\n */\nexport enum ResourceType {\n\t// Legacy format (dot notation)\n\tApiGatewayV2 = 'sst.aws.ApiGatewayV2',\n\tPostgres = 'sst.aws.Postgres',\n\tFunction = 'sst.aws.Function',\n\tObjectStorage = 'sst.aws.Bucket',\n\tVpc = 'sst.aws.Vpc',\n\tSecret = 'sst.sst.Secret',\n\tDynamo = 'sst.aws.Dynamo',\n\tQueue = 'sst.aws.Queue',\n\n\t// Modern format (colon notation)\n\tSSTSecret = 'sst:sst:Secret',\n\tSSTFunction = 'sst:sst:Function',\n\tSSTApiGatewayV2 = 'sst:aws:ApiGatewayV2',\n\tSSTPostgres = 'sst:aws:Postgres',\n\tSSTObjectStorage = 'sst:aws:Bucket',\n\tSnsTopic = 'sst:aws:SnsTopic',\n\tSSTDynamo = 'sst:aws:Dynamo',\n\tSSTQueue = 'sst:aws:Queue',\n\t// A distribution, twice over: a file server and a static site are the same\n\t// infrastructure with different contents behind it, and they are separate\n\t// entries because what they provide is read under different ids, not\n\t// because SST builds them differently.\n\tFileServer = 'sst:aws:Router',\n\tStaticSite = 'sst:aws:StaticSite',\n\t// Neither is an SST component: mail is an IAM chain and a composed URL, and\n\t// a cache is whatever the selected backend turned out to be.\n\tEmail = 'gkm:aws:Email',\n\tCache = 'gkm:aws:Cache',\n}\n\n/**\n * AWS API Gateway V2 resource type.\n * Represents an HTTP/WebSocket API.\n */\nexport type ApiGatewayV2 = {\n\ttype: ResourceType.ApiGatewayV2 | ResourceType.SSTApiGatewayV2;\n\turl: string;\n};\n\n/**\n * PostgreSQL database resource type.\n * Contains all connection details needed to connect to the database.\n */\nexport type Postgres = {\n\ttype: ResourceType.Postgres | ResourceType.SSTPostgres;\n\tdatabase: string;\n\thost: string;\n\tpassword: string;\n\tport: number;\n\tusername: string;\n};\n\n/**\n * AWS Lambda Function resource type.\n */\nexport type Function = {\n\ttype: ResourceType.Function | ResourceType.SSTFunction;\n\tname: string;\n};\n\n/**\n * AWS S3 Bucket resource type.\n */\nexport type Bucket = {\n\ttype: ResourceType.ObjectStorage | ResourceType.SSTObjectStorage;\n\tname: string;\n\t/**\n\t * Supplied by `@geekmidas/cloud`'s ObjectStorage, which widens SST's link to\n\t * carry them — a bucket may not be in the reader's region, and the URL is\n\t * composed where the resource's shape is known.\n\t */\n\tregion?: string;\n\turl?: string;\n};\n\n/**\n * AWS VPC (Virtual Private Cloud) resource type.\n */\nexport type Vpc = {\n\ttype: ResourceType.Vpc;\n\tbastion: string;\n};\n\n/**\n * Secret resource type for storing sensitive values.\n */\nexport type Secret = {\n\ttype: ResourceType.Secret | ResourceType.SSTSecret;\n\tvalue: string;\n};\n\n/**\n * AWS SNS Topic resource type.\n */\nexport type SnsTopic = {\n\ttype: ResourceType.SnsTopic;\n\tarn: string;\n};\n\n/**\n * AWS SQS Queue resource type.\n */\nexport type Queue = {\n\ttype: ResourceType.Queue | ResourceType.SSTQueue;\n\turl: string;\n\tarn: string;\n};\n\n/**\n * AWS DynamoDB Table resource type.\n */\nexport type Dynamo = {\n\ttype: ResourceType.Dynamo | ResourceType.SSTDynamo;\n\tname: string;\n};\n\n/**\n * Union type of all supported SST resource types.\n */\nexport type SstResource =\n\t| ApiGatewayV2\n\t| Postgres\n\t| Function\n\t| Bucket\n\t| Vpc\n\t| Secret\n\t| SnsTopic\n\t| Queue\n\t| Dynamo;\n\n// Value types without the `type` key (for resolver parameters)\ntype SecretValue = Omit<Secret, 'type'>;\ntype PostgresValue = Omit<Postgres, 'type'>;\ntype BucketValue = Omit<Bucket, 'type'>;\ntype SnsTopicValue = Omit<SnsTopic, 'type'>;\ntype QueueValue = Omit<Queue, 'type'>;\ntype DynamoValue = Omit<Dynamo, 'type'>;\n\n/**\n * Function type for processing a specific resource type into environment variables.\n *\n * @template K - The specific resource type (without `type` key)\n * @param name - The resource name\n * @param value - The resource value (without `type` key)\n * @returns Object mapping environment variable names to values\n */\nexport type ResourceProcessor<K> = (name: string, value: K) => EnvRecord;\n\n// SST Resource Resolvers (receive values without `type` key)\n\nconst secretResolver = (name: string, value: SecretValue) => ({\n\t[name]: value.value,\n});\n\nconst postgresResolver = (key: string, value: PostgresValue) => ({\n\t[`${key}Name`]: value.database,\n\t[`${key}Host`]: value.host,\n\t[`${key}Password`]: value.password,\n\t[`${key}Port`]: value.port,\n\t[`${key}Username`]: value.username,\n\t[`${key}Url`]: `postgresql://${encodeURIComponent(value.username)}:${encodeURIComponent(value.password)}@${value.host}:${value.port}/${value.database}`,\n});\n\nconst bucketResolver = (name: string, value: BucketValue) => ({\n\t[`${name}Name`]: value.name,\n\t// The single URL a construct reads. Composed by the component, which knows\n\t// its own shape; this only renames it into env case. Always emitted, even\n\t// when absent, so `resolveEnvKeys` can derive the key from the link's type\n\t// alone — a bucket linked without our component yields an empty one.\n\t[`${name}Url`]: value.url ?? '',\n});\n\nconst topicResolver = (name: string, value: SnsTopicValue) => ({\n\t[`${name}Arn`]: value.arn,\n\t// A publisher connection string for `@geekmidas/events` (SNS); region is\n\t// resolved from the ARN / AWS_REGION at runtime.\n\t[`${name}PublisherConnectionString`]: `sns://?topicArn=${encodeURIComponent(value.arn)}`,\n});\n\nconst queueResolver = (name: string, value: QueueValue) => ({\n\t[`${name}Url`]: value.url,\n\t[`${name}Arn`]: value.arn,\n\t// A publisher connection string for `@geekmidas/events` (SQS); region is\n\t// resolved from the URL / AWS_REGION at runtime.\n\t[`${name}PublisherConnectionString`]: `sqs://?queueUrl=${encodeURIComponent(value.url)}`,\n});\n\nconst dynamoResolver = (name: string, value: DynamoValue) => ({\n\t[`${name}Name`]: value.name,\n});\n\nconst noopResolver = () => ({});\n\n/**\n * Pre-configured resolvers for all SST resource types.\n */\nexport const sstResolvers: Resolvers = {\n\t// Legacy format\n\t[ResourceType.ApiGatewayV2]: noopResolver,\n\t[ResourceType.Function]: noopResolver,\n\t[ResourceType.Vpc]: noopResolver,\n\t[ResourceType.Secret]: secretResolver,\n\t[ResourceType.Postgres]: postgresResolver,\n\t[ResourceType.ObjectStorage]: bucketResolver,\n\t[ResourceType.Dynamo]: dynamoResolver,\n\t[ResourceType.Queue]: queueResolver,\n\n\t// Modern format\n\t[ResourceType.SSTSecret]: secretResolver,\n\t[ResourceType.SSTObjectStorage]: bucketResolver,\n\t[ResourceType.SSTFunction]: noopResolver,\n\t[ResourceType.SSTPostgres]: postgresResolver,\n\t[ResourceType.SSTApiGatewayV2]: noopResolver,\n\t[ResourceType.SnsTopic]: topicResolver,\n\t[ResourceType.SSTDynamo]: dynamoResolver,\n\t[ResourceType.SSTQueue]: queueResolver,\n};\n\n/**\n * All known SST resource type strings.\n */\ntype SstResourceTypeString = `${ResourceType}`;\n\n/**\n * Extracts the `type` string value from an input value.\n */\ntype ExtractType<T> = T extends { type: infer U extends string } ? U : never;\n\n/**\n * Removes the `type` key from an object type.\n */\ntype OmitType<T> = T extends { type: string } ? Omit<T, 'type'> : never;\n\n/**\n * Extracts all unique `type` values from a record (excluding plain strings).\n */\ntype AllTypeValues<TRecord extends Record<string, InputValue>> = {\n\t[K in keyof TRecord]: ExtractType<TRecord[K]>;\n}[keyof TRecord];\n\n/**\n * Extracts only the custom (non-SST) type values from a record.\n */\ntype CustomTypeValues<TRecord extends Record<string, InputValue>> = Exclude<\n\tAllTypeValues<TRecord>,\n\tSstResourceTypeString\n>;\n\n/**\n * For a given type value, finds the corresponding value type (without `type` key).\n */\ntype ValueForType<\n\tTRecord extends Record<string, InputValue>,\n\tTType extends string,\n> = {\n\t[K in keyof TRecord]: TRecord[K] extends { type: TType }\n\t\t? OmitType<TRecord[K]>\n\t\t: never;\n}[keyof TRecord];\n\n/**\n * Generates typed resolvers for custom (non-SST) types in the input record.\n */\ntype CustomResolvers<TRecord extends Record<string, InputValue>> =\n\tCustomTypeValues<TRecord> extends never\n\t\t? Resolvers | undefined\n\t\t: {\n\t\t\t\t[TType in CustomTypeValues<TRecord>]: EnvironmentResolver<\n\t\t\t\t\tValueForType<TRecord, TType>\n\t\t\t\t>;\n\t\t\t};\n\n/**\n * SST-specific environment builder with built-in resolvers for all known\n * SST resource types.\n *\n * Wraps the generic EnvironmentBuilder with pre-configured SST resolvers.\n *\n * @template TRecord - The input record type for type inference\n *\n * @example\n * ```typescript\n * const env = new SstEnvironmentBuilder({\n * database: { type: 'sst:aws:Postgres', host: '...', ... },\n * apiKey: { type: 'sst:sst:Secret', value: 'secret' },\n * appName: 'my-app',\n * }).build();\n *\n * // With custom resolvers (typed based on input)\n * const env = new SstEnvironmentBuilder(\n * {\n * database: postgresResource,\n * custom: { type: 'my-custom' as const, data: 'foo' },\n * },\n * {\n * // TypeScript requires 'my-custom' resolver with typed value\n * 'my-custom': (key, value) => ({ [`${key}Data`]: value.data }),\n * }\n * ).build();\n * ```\n */\nexport class SstEnvironmentBuilder<\n\tTRecord extends Record<string, SstResource | InputValue | string>,\n> {\n\tprivate readonly builder: EnvironmentBuilder<\n\t\tRecord<string, InputValue>,\n\t\tResolvers\n\t>;\n\n\t/**\n\t * Create a new SST environment builder.\n\t *\n\t * @param record - Object containing SST resources, custom resources, and/or string values\n\t * @param additionalResolvers - Optional custom resolvers (typed based on custom types in record)\n\t * @param options - Optional configuration options\n\t */\n\tconstructor(\n\t\trecord: TRecord,\n\t\tadditionalResolvers?: CustomResolvers<TRecord>,\n\t\toptions?: EnvironmentBuilderOptions,\n\t) {\n\t\t// Merge resolvers with custom ones taking precedence\n\t\tconst mergedResolvers: Resolvers = additionalResolvers\n\t\t\t? { ...sstResolvers, ...additionalResolvers }\n\t\t\t: sstResolvers;\n\n\t\tthis.builder = new EnvironmentBuilder(\n\t\t\trecord as Record<string, InputValue>,\n\t\t\tmergedResolvers,\n\t\t\toptions,\n\t\t);\n\t}\n\n\t/**\n\t * Build environment variables from the input record.\n\t *\n\t * @returns A record of environment variables\n\t */\n\tbuild(): EnvRecord {\n\t\treturn this.builder.build();\n\t}\n}\n\nexport type {\n\tEnvironmentBuilderOptions,\n\tEnvRecord,\n\tEnvValue,\n} from './EnvironmentBuilder';\n// Re-export useful types\nexport { environmentCase } from './EnvironmentBuilder';\n","import { EnvironmentBuilder, type InputValue } from './EnvironmentBuilder';\nimport { type SstResource, sstResolvers } from './SstEnvironmentBuilder';\n\n/**\n * Variables AWS Lambda injects into the runtime. Always valid on AWS, but never\n * assumed — opt in via `platform: 'aws'` or by spreading {@link AWS_RUNTIME_ENV_VARS}\n * into `whitelist`.\n */\nexport const AWS_RUNTIME_ENV_VARS = [\n\t'AWS_REGION',\n\t'AWS_DEFAULT_REGION',\n\t'AWS_ENDPOINT_URL',\n\t'AWS_ENDPOINT',\n\t'AWS_ACCESS_KEY_ID',\n\t'AWS_SECRET_ACCESS_KEY',\n\t'AWS_SESSION_TOKEN',\n\t'AWS_LAMBDA_FUNCTION_NAME',\n\t'AWS_LAMBDA_FUNCTION_VERSION',\n] as const;\n\n/**\n * Variables GCP injects into Cloud Functions / Cloud Run.\n */\nexport const GCP_RUNTIME_ENV_VARS = [\n\t'GOOGLE_CLOUD_PROJECT',\n\t'GCP_PROJECT',\n\t'FUNCTION_TARGET',\n\t'FUNCTION_SIGNATURE_TYPE',\n\t'K_SERVICE',\n\t'K_REVISION',\n\t'K_CONFIGURATION',\n\t'PORT',\n] as const;\n\n/**\n * Variables Cloudflare exposes to Workers. Workers inject almost nothing into\n * the global env, so this is intentionally minimal.\n */\nexport const CLOUDFLARE_RUNTIME_ENV_VARS = [\n\t'CF_PAGES',\n\t'CF_PAGES_URL',\n] as const;\n\n/**\n * Registry of platform → always-valid runtime variables. Export, don't assume:\n * a caller states the platform it deploys to and the matching set is trusted.\n */\nexport const PLATFORM_ENV_VARS = {\n\taws: AWS_RUNTIME_ENV_VARS,\n\tgcp: GCP_RUNTIME_ENV_VARS,\n\tcloudflare: CLOUDFLARE_RUNTIME_ENV_VARS,\n} as const;\n\nexport type Platform = keyof typeof PLATFORM_ENV_VARS;\n\n/**\n * The always-valid runtime variables for a platform. The \"whitelist construct\":\n * resolve a platform to its set, to spread into `whitelist` or compare against.\n */\nexport function platformEnvVars(platform: Platform): readonly string[] {\n\treturn PLATFORM_ENV_VARS[platform];\n}\n\n/** How many link-provided vars to list in an error before truncating. */\nconst MAX_LISTED_VARS = 8;\n\n/** Minimum similarity for a variable to be offered as a \"did you mean\". */\nconst SUGGESTION_THRESHOLD = 0.3;\n\n/**\n * Input shape for the validator: the same record `SstEnvironmentBuilder`\n * accepts — keyed by resource name, valued by an SST resource (or a plain\n * string for pass-through env vars).\n */\nexport type LinkRecord = Record<string, SstResource | InputValue | string>;\n\nexport interface ValidationResult {\n\tvalid: boolean;\n\t/** Requested variables that are not available (excluding optional `?` vars). */\n\tinvalidVars: string[];\n\t/** Every variable the links + whitelist make available. */\n\tavailableVars: string[];\n\t/** Nearest available matches for each invalid variable (best first). */\n\tsuggestions: Record<string, string[]>;\n}\n\nexport interface EnvValidatorOptions {\n\t/**\n\t * Platform whose runtime-injected variables are always valid. Omit to assume\n\t * none — the validator never bakes in a platform's variables.\n\t */\n\tplatform?: Platform;\n\t/**\n\t * Extra always-valid variables in addition to the platform set — typically\n\t * the keys of a function's explicit `environment`.\n\t */\n\twhitelist?: readonly string[];\n\t/**\n\t * Label for the deployable unit (e.g. a function name), used in error\n\t * messages so a failure points at exactly one unit.\n\t */\n\tcontext?: string;\n}\n\n/**\n * Levenshtein edit distance between two strings.\n */\nfunction levenshtein(a: string, b: string): number {\n\tconst m = a.length;\n\tconst n = b.length;\n\tif (m === 0) return n;\n\tif (n === 0) return m;\n\n\tlet prev = Array.from({ length: n + 1 }, (_, i) => i);\n\n\tfor (let i = 1; i <= m; i++) {\n\t\tconst curr: number[] = [i];\n\t\tfor (let j = 1; j <= n; j++) {\n\t\t\tconst cost = a[i - 1] === b[j - 1] ? 0 : 1;\n\t\t\tconst del = (prev[j] ?? 0) + 1;\n\t\t\tconst ins = (curr[j - 1] ?? 0) + 1;\n\t\t\tconst sub = (prev[j - 1] ?? 0) + cost;\n\t\t\tcurr[j] = Math.min(del, ins, sub);\n\t\t}\n\t\tprev = curr;\n\t}\n\n\treturn prev[n] ?? 0;\n}\n\n/**\n * Similarity in `[0, 1]` combining edit distance with `_`-token overlap, so both\n * near-typos (a missing underscore) and renames (`DATABASE_URL` ~ `DB_URL`,\n * which share the `URL` token) are caught.\n */\nfunction similarity(a: string, b: string): number {\n\tconst editSim = 1 - levenshtein(a, b) / Math.max(a.length, b.length, 1);\n\n\tconst ta = new Set(a.split('_').filter(Boolean));\n\tconst tb = new Set(b.split('_').filter(Boolean));\n\tconst shared = [...ta].filter((t) => tb.has(t)).length;\n\tconst union = new Set([...ta, ...tb]).size || 1;\n\tconst tokenSim = shared / union;\n\n\t// Nudge token-overlap matches ahead of coincidental edit-distance ones, so a\n\t// rename like DATABASE_URL prefers DB_URL (shares `URL`) over DB_PASSWORD.\n\treturn Math.max(editSim, tokenSim * 1.15);\n}\n\n/**\n * Returns the nearest available variables to `missing`, best first, limited to\n * those above {@link SUGGESTION_THRESHOLD}.\n */\nfunction suggestionsFor(\n\tmissing: string,\n\tavailable: readonly string[],\n\tmax = 1,\n): string[] {\n\treturn available\n\t\t.map((candidate) => ({ candidate, score: similarity(missing, candidate) }))\n\t\t.filter((s) => s.score >= SUGGESTION_THRESHOLD)\n\t\t.sort((a, b) => b.score - a.score)\n\t\t.slice(0, max)\n\t\t.map((s) => s.candidate);\n}\n\n/**\n * Thrown when a deployable unit requires environment variables its links do not\n * provide. Carries the structured `missing`/`available`/`suggestions` so callers\n * can inspect the failure programmatically, not just read the message.\n */\nexport class EnvValidationError extends Error {\n\treadonly isEnvValidationError = true;\n\treadonly missing: string[];\n\treadonly available: string[];\n\treadonly suggestions: Record<string, string[]>;\n\treadonly context?: string;\n\n\tconstructor(args: {\n\t\tmissing: string[];\n\t\tavailable: string[];\n\t\tlinkVars: string[];\n\t\tsuggestions: Record<string, string[]>;\n\t\tcontext?: string;\n\t}) {\n\t\tsuper(EnvValidationError.format(args));\n\t\tthis.name = 'EnvValidationError';\n\t\tthis.missing = args.missing;\n\t\tthis.available = args.available;\n\t\tthis.suggestions = args.suggestions;\n\t\tthis.context = args.context;\n\t\t// V8-only; keeps the constructor out of the stack trace.\n\t\t(\n\t\t\tError as unknown as {\n\t\t\t\tcaptureStackTrace?(target: object, ctor?: unknown): void;\n\t\t\t}\n\t\t).captureStackTrace?.(this, EnvValidationError);\n\t}\n\n\tprivate static format(args: {\n\t\tmissing: string[];\n\t\tlinkVars: string[];\n\t\tsuggestions: Record<string, string[]>;\n\t\tcontext?: string;\n\t}): string {\n\t\tconst { missing, linkVars, suggestions, context } = args;\n\t\tconst who = context ? `'${context}'` : 'a deployable unit';\n\n\t\tconst width = Math.max(...missing.map((v) => v.length));\n\t\tconst lines = missing.map((v) => {\n\t\t\tconst hints = suggestions[v] ?? [];\n\t\t\tconst hint = hints.length ? `(did you mean ${hints.join(' or ')}?)` : '';\n\t\t\treturn ` - ${v.padEnd(width)} ${hint}`.trimEnd();\n\t\t});\n\n\t\tlet provided: string;\n\t\tif (linkVars.length === 0) {\n\t\t\tprovided = '(no links provide environment variables)';\n\t\t} else {\n\t\t\tconst shown = linkVars.slice(0, MAX_LISTED_VARS).join(', ');\n\t\t\tconst extra =\n\t\t\t\tlinkVars.length > MAX_LISTED_VARS\n\t\t\t\t\t? ` ...(+${linkVars.length - MAX_LISTED_VARS})`\n\t\t\t\t\t: '';\n\t\t\tprovided = `Provided by links: ${shown}${extra}`;\n\t\t}\n\n\t\treturn `${who} is missing required env vars:\\n${lines.join('\\n')}\\n\\n${provided}`;\n\t}\n}\n\n/**\n * Derives the set of environment-variable **keys** a group of linked resources\n * will produce at runtime — without resolving any value.\n *\n * This reuses the runtime resolvers (`sstResolvers`) via {@link EnvironmentBuilder},\n * so the keys computed here are exactly the keys a deployed function receives:\n * the validator and the runtime resolution share a single source of truth and\n * cannot drift. Because every resolver's output keys depend only on the record\n * key and the resource `type` (never the value), each resource is reduced to\n * `{ type }` before building, so no SST `Output` is ever read.\n *\n * @example\n * resolveEnvKeys({ db: { type: ResourceType.Postgres } });\n * // ['DB_NAME', 'DB_HOST', 'DB_PASSWORD', 'DB_PORT', 'DB_USERNAME', 'DB_URL']\n */\nexport function resolveEnvKeys(record: LinkRecord): string[] {\n\tconst typeOnly: Record<string, InputValue> = {};\n\tfor (const [key, value] of Object.entries(record)) {\n\t\ttypeOnly[key] = typeof value === 'string' ? '' : { type: value.type };\n\t}\n\treturn Object.keys(new EnvironmentBuilder(typeOnly, sstResolvers).build());\n}\n\n/**\n * Validates that the environment variables a deployable unit requires are\n * actually provided by its linked resources — at infra time, before deploy.\n *\n * Available variables are the union of the keys derived from `links`\n * ({@link resolveEnvKeys}), the chosen platform's runtime variables (only when\n * `options.platform` is set — nothing is assumed), and any `options.whitelist`\n * (e.g. the keys of a function's explicit `environment`). A requested variable\n * suffixed with `?` is treated as optional and never causes a failure.\n *\n * @example\n * const validator = new EnvValidator(\n * { db: { type: ResourceType.Postgres } },\n * { platform: 'aws', whitelist: ['APP_NAME'], context: 'orders-fn' },\n * );\n * validator.assert(['DB_HOST', 'AWS_REGION', 'APP_NAME', 'SENTRY_DSN?']); // ok\n * validator.assert(['DATABASE_URL']); // throws EnvValidationError (did you mean DB_URL?)\n */\nexport class EnvValidator {\n\t/** Every variable available — link-derived, platform, and extra whitelist. */\n\treadonly availableVars: string[];\n\t/** Just the variables the links provide (used for error context). */\n\treadonly linkVars: string[];\n\treadonly context?: string;\n\tprivate readonly availableSet: Set<string>;\n\t/** Per-link (record key → its env-var keys), for least-privilege filtering. */\n\tprivate readonly linkVarsByName: Map<string, string[]>;\n\n\tconstructor(links: LinkRecord, options: EnvValidatorOptions = {}) {\n\t\tconst { platform, whitelist = [], context } = options;\n\t\tthis.context = context;\n\t\tthis.linkVarsByName = new Map(\n\t\t\tObject.entries(links).map(([name, value]) => [\n\t\t\t\tname,\n\t\t\t\tresolveEnvKeys({ [name]: value }),\n\t\t\t]),\n\t\t);\n\t\tthis.linkVars = [...this.linkVarsByName.values()].flat();\n\t\tthis.availableVars = [\n\t\t\t...this.linkVars,\n\t\t\t...(platform ? PLATFORM_ENV_VARS[platform] : []),\n\t\t\t...whitelist,\n\t\t];\n\t\tthis.availableSet = new Set(this.availableVars);\n\t}\n\n\t/**\n\t * Returns the names of the links that provide at least one of the requested\n\t * variables — so a construct can attach only the links a unit actually needs\n\t * (least privilege) rather than the whole pool. Trailing `?` is ignored.\n\t */\n\tgetProvidersForEnvVars(requestedEnvVars: readonly string[]): string[] {\n\t\tconst requested = new Set(\n\t\t\trequestedEnvVars.map((v) => (v.endsWith('?') ? v.slice(0, -1) : v)),\n\t\t);\n\t\tconst providers: string[] = [];\n\t\tfor (const [name, vars] of this.linkVarsByName) {\n\t\t\tif (vars.some((v) => requested.has(v))) providers.push(name);\n\t\t}\n\t\treturn providers;\n\t}\n\n\t/**\n\t * Checks every requested variable against the available set. Variables\n\t * ending in `?` are optional and never reported as invalid. Invalid\n\t * variables come back with their nearest available matches.\n\t */\n\tvalidate(requestedEnvVars: readonly string[]): ValidationResult {\n\t\tconst invalidVars = requestedEnvVars.filter((envVar) => {\n\t\t\tif (envVar.endsWith('?')) return false;\n\t\t\treturn !this.availableSet.has(envVar);\n\t\t});\n\n\t\tconst suggestions: Record<string, string[]> = {};\n\t\tfor (const envVar of invalidVars) {\n\t\t\tconst matches = suggestionsFor(envVar, this.availableVars);\n\t\t\tif (matches.length) suggestions[envVar] = matches;\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: invalidVars.length === 0,\n\t\t\tinvalidVars,\n\t\t\tavailableVars: this.availableVars,\n\t\t\tsuggestions,\n\t\t};\n\t}\n\n\t/**\n\t * Asserts that every requested variable is available, throwing an\n\t * {@link EnvValidationError} otherwise. Intended to run in a construct's\n\t * constructor so a misconfigured `sst.config.ts` fails at synth time, before\n\t * any AWS call.\n\t */\n\tassert(requestedEnvVars: readonly string[]): void {\n\t\tconst { valid, invalidVars, suggestions } = this.validate(requestedEnvVars);\n\n\t\tif (!valid) {\n\t\t\tthrow new EnvValidationError({\n\t\t\t\tmissing: invalidVars,\n\t\t\t\tavailable: this.availableVars,\n\t\t\t\tlinkVars: this.linkVars,\n\t\t\t\tsuggestions,\n\t\t\t\tcontext: this.context,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Whether a single variable is available. Does not treat a trailing `?` as\n\t * optional — pass the bare name.\n\t */\n\thas(envVar: string): boolean {\n\t\treturn this.availableSet.has(envVar);\n\t}\n}\n","// Re-export everything from SstEnvironmentBuilder\n\n// Re-export types from EnvironmentBuilder\nexport type {\n\tEnvironmentBuilderOptions,\n\tEnvRecord,\n\tEnvValue,\n} from './EnvironmentBuilder';\n\n// Re-export environmentCase from EnvironmentBuilder\nexport { environmentCase } from './EnvironmentBuilder';\nexport {\n\ttype ApiGatewayV2,\n\ttype Bucket,\n\ttype Dynamo,\n\ttype Function,\n\ttype Postgres,\n\ttype Queue,\n\ttype ResourceProcessor,\n\tResourceType,\n\ttype Secret,\n\ttype SnsTopic,\n\tSstEnvironmentBuilder,\n\ttype SstResource,\n\tsstResolvers,\n\ttype Vpc,\n} from './SstEnvironmentBuilder';\n\nexport {\n\tAWS_RUNTIME_ENV_VARS,\n\tCLOUDFLARE_RUNTIME_ENV_VARS,\n\tEnvValidationError,\n\tEnvValidator,\n\ttype EnvValidatorOptions,\n\tGCP_RUNTIME_ENV_VARS,\n\ttype LinkRecord,\n\tPLATFORM_ENV_VARS,\n\ttype Platform,\n\tplatformEnvVars,\n\tresolveEnvKeys,\n\ttype ValidationResult,\n} from './SstEnvValidator';\n\n// Import for deprecated function\nimport {\n\tSstEnvironmentBuilder,\n\ttype SstResource,\n} from './SstEnvironmentBuilder';\n\n/**\n * @deprecated Use `new SstEnvironmentBuilder(record).build()` instead.\n *\n * Normalizes SST resources and plain strings into environment variables.\n * Processes resources based on their type and converts names to environment case.\n *\n * @param record - Object containing resources and/or string values\n * @returns Normalized environment variables object\n *\n * @example\n * // Old usage (deprecated):\n * normalizeResourceEnv({ database: postgresResource })\n *\n * // New usage:\n * new SstEnvironmentBuilder({ database: postgresResource }).build()\n */\nexport function normalizeResourceEnv(\n\trecord: Record<string, SstResource | string>,\n): Record<string, string | number | boolean | Record<string, unknown>> {\n\treturn new SstEnvironmentBuilder(record).build();\n}\n\n// Keep Resource type as deprecated alias for backwards compatibility\n/**\n *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GAC9B;GACA,eAAe,KAAK;GACpB;EACA;CACD;;;;;;;CAQD,OAAOF,kBAA2C;EACjD,MAAM,EAAE,OAAO,aAAa,aAAa,GAAG,KAAK,SAAS,iBAAiB;AAE3E,OAAK,MACJ,OAAM,IAAI,mBAAmB;GAC5B,SAAS;GACT,WAAW,KAAK;GAChB,UAAU,KAAK;GACf;GACA,SAAS,KAAK;EACd;CAEF;;;;;CAMD,IAAIG,QAAyB;AAC5B,SAAO,KAAK,aAAa,IAAI,OAAO;CACpC;AACD;;;;;;;;;;;;;;;;;;;;AC/SD,SAAgB,qBACfC,QACsE;AACtE,QAAO,IAAI,sBAAsB,QAAQ,OAAO;AAChD"}
|
package/dist/sst.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvRecord, EnvValue, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, environmentCase } from "./EnvironmentBuilder-
|
|
1
|
+
import { EnvRecord, EnvValue, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, environmentCase } from "./EnvironmentBuilder-DeIle4QN.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/SstEnvironmentBuilder.d.ts
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ declare enum ResourceType {
|
|
|
10
10
|
ApiGatewayV2 = "sst.aws.ApiGatewayV2",
|
|
11
11
|
Postgres = "sst.aws.Postgres",
|
|
12
12
|
Function = "sst.aws.Function",
|
|
13
|
-
|
|
13
|
+
ObjectStorage = "sst.aws.Bucket",
|
|
14
14
|
Vpc = "sst.aws.Vpc",
|
|
15
15
|
Secret = "sst.sst.Secret",
|
|
16
16
|
Dynamo = "sst.aws.Dynamo",
|
|
@@ -19,10 +19,14 @@ declare enum ResourceType {
|
|
|
19
19
|
SSTFunction = "sst:sst:Function",
|
|
20
20
|
SSTApiGatewayV2 = "sst:aws:ApiGatewayV2",
|
|
21
21
|
SSTPostgres = "sst:aws:Postgres",
|
|
22
|
-
|
|
22
|
+
SSTObjectStorage = "sst:aws:Bucket",
|
|
23
23
|
SnsTopic = "sst:aws:SnsTopic",
|
|
24
24
|
SSTDynamo = "sst:aws:Dynamo",
|
|
25
25
|
SSTQueue = "sst:aws:Queue",
|
|
26
|
+
FileServer = "sst:aws:Router",
|
|
27
|
+
StaticSite = "sst:aws:StaticSite",
|
|
28
|
+
Email = "gkm:aws:Email",
|
|
29
|
+
Cache = "gkm:aws:Cache",
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
28
32
|
* AWS API Gateway V2 resource type.
|
|
@@ -55,8 +59,15 @@ type Function = {
|
|
|
55
59
|
* AWS S3 Bucket resource type.
|
|
56
60
|
*/
|
|
57
61
|
type Bucket = {
|
|
58
|
-
type: ResourceType.
|
|
62
|
+
type: ResourceType.ObjectStorage | ResourceType.SSTObjectStorage;
|
|
59
63
|
name: string;
|
|
64
|
+
/**
|
|
65
|
+
* Supplied by `@geekmidas/cloud`'s ObjectStorage, which widens SST's link to
|
|
66
|
+
* carry them — a bucket may not be in the reader's region, and the URL is
|
|
67
|
+
* composed where the resource's shape is known.
|
|
68
|
+
*/
|
|
69
|
+
region?: string;
|
|
70
|
+
url?: string;
|
|
60
71
|
};
|
|
61
72
|
/**
|
|
62
73
|
* AWS VPC (Virtual Private Cloud) resource type.
|
package/dist/sst.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sst.d.cts","names":[],"sources":["../src/SstEnvironmentBuilder.ts","../src/SstEnvValidator.ts","../src/sst.ts"],"sourcesContent":[],"mappings":";;;;;;AAaA;
|
|
1
|
+
{"version":3,"file":"sst.d.cts","names":[],"sources":["../src/SstEnvironmentBuilder.ts","../src/SstEnvValidator.ts","../src/sst.ts"],"sourcesContent":[],"mappings":";;;;;;AAaA;AAoCA;AAAwB,aApCZ,YAAA;EAoCY,YACjB,GAAA,sBAAa;EAAY,QAAG,GAAA,kBAAa;EAAe,QAAA,GAAA,kBAAA;EAQnD,aAAQ,GAAA,gBAAA;E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FaW,CAAA,MAAA,EEbI,WFaJ,GAAA,MAAA,CAAA,CAAA,EEZjB,MFYiB,CAAA,MAAA,EAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GEZ0B,MFY1B,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;;AAA6C;AAcjE;AAQY,KE1BA,QAAA,GAAW,WF0BL"}
|
package/dist/sst.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvRecord, EnvValue, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, environmentCase } from "./EnvironmentBuilder-
|
|
1
|
+
import { EnvRecord, EnvValue, EnvironmentBuilderOptions, EnvironmentResolver, InputValue, Resolvers, environmentCase } from "./EnvironmentBuilder-CoBQ9Xp2.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/SstEnvironmentBuilder.d.ts
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ declare enum ResourceType {
|
|
|
10
10
|
ApiGatewayV2 = "sst.aws.ApiGatewayV2",
|
|
11
11
|
Postgres = "sst.aws.Postgres",
|
|
12
12
|
Function = "sst.aws.Function",
|
|
13
|
-
|
|
13
|
+
ObjectStorage = "sst.aws.Bucket",
|
|
14
14
|
Vpc = "sst.aws.Vpc",
|
|
15
15
|
Secret = "sst.sst.Secret",
|
|
16
16
|
Dynamo = "sst.aws.Dynamo",
|
|
@@ -19,10 +19,14 @@ declare enum ResourceType {
|
|
|
19
19
|
SSTFunction = "sst:sst:Function",
|
|
20
20
|
SSTApiGatewayV2 = "sst:aws:ApiGatewayV2",
|
|
21
21
|
SSTPostgres = "sst:aws:Postgres",
|
|
22
|
-
|
|
22
|
+
SSTObjectStorage = "sst:aws:Bucket",
|
|
23
23
|
SnsTopic = "sst:aws:SnsTopic",
|
|
24
24
|
SSTDynamo = "sst:aws:Dynamo",
|
|
25
25
|
SSTQueue = "sst:aws:Queue",
|
|
26
|
+
FileServer = "sst:aws:Router",
|
|
27
|
+
StaticSite = "sst:aws:StaticSite",
|
|
28
|
+
Email = "gkm:aws:Email",
|
|
29
|
+
Cache = "gkm:aws:Cache",
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
28
32
|
* AWS API Gateway V2 resource type.
|
|
@@ -55,8 +59,15 @@ type Function = {
|
|
|
55
59
|
* AWS S3 Bucket resource type.
|
|
56
60
|
*/
|
|
57
61
|
type Bucket = {
|
|
58
|
-
type: ResourceType.
|
|
62
|
+
type: ResourceType.ObjectStorage | ResourceType.SSTObjectStorage;
|
|
59
63
|
name: string;
|
|
64
|
+
/**
|
|
65
|
+
* Supplied by `@geekmidas/cloud`'s ObjectStorage, which widens SST's link to
|
|
66
|
+
* carry them — a bucket may not be in the reader's region, and the URL is
|
|
67
|
+
* composed where the resource's shape is known.
|
|
68
|
+
*/
|
|
69
|
+
region?: string;
|
|
70
|
+
url?: string;
|
|
60
71
|
};
|
|
61
72
|
/**
|
|
62
73
|
* AWS VPC (Virtual Private Cloud) resource type.
|
package/dist/sst.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sst.d.mts","names":[],"sources":["../src/SstEnvironmentBuilder.ts","../src/SstEnvValidator.ts","../src/sst.ts"],"sourcesContent":[],"mappings":";;;;;;AAaA;
|
|
1
|
+
{"version":3,"file":"sst.d.mts","names":[],"sources":["../src/SstEnvironmentBuilder.ts","../src/SstEnvValidator.ts","../src/sst.ts"],"sourcesContent":[],"mappings":";;;;;;AAaA;AAoCA;AAAwB,aApCZ,YAAA;EAoCY,YACjB,GAAA,sBAAa;EAAY,QAAG,GAAA,kBAAa;EAAe,QAAA,GAAA,kBAAA;EAQnD,aAAQ,GAAA,gBAAA;EAAA,GAAA,GAAA,aAAA;EAAA,MACb,GAAA,gBAAa;EAAQ,MAAG,GAAA,gBAAa;EAAW,KAAA,GAAA,eAAA;EAW3C,SAAA,GAAQ,gBAAA;EAAA,WAAA,GAAA,kBAAA;EAAA,eACb,GAAa,sBAAA;EAAQ,WAAG,GAAA,kBAAa;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