sdk-environment 0.1.4 → 0.1.7

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 (54) hide show
  1. package/bin/run.bun.sdk-environment.bc +2 -2
  2. package/dist/contract/cli/getCommit.js.map +1 -1
  3. package/dist/domain.operations/getEnvironment/getEnvironment.d.ts +11 -3
  4. package/dist/domain.operations/getEnvironment/getEnvironment.js +26 -27
  5. package/dist/domain.operations/getEnvironment/getEnvironment.js.map +1 -1
  6. package/dist/domain.operations/parsers/access/asCacheKeyFromAccessKeyId.d.ts +8 -0
  7. package/dist/domain.operations/parsers/access/asCacheKeyFromAccessKeyId.js +12 -0
  8. package/dist/domain.operations/parsers/access/asCacheKeyFromAccessKeyId.js.map +1 -0
  9. package/dist/domain.operations/parsers/access/getAccessKeyIdFromAccountClient.d.ts +15 -0
  10. package/dist/domain.operations/parsers/access/getAccessKeyIdFromAccountClient.js +18 -0
  11. package/dist/domain.operations/parsers/access/getAccessKeyIdFromAccountClient.js.map +1 -0
  12. package/dist/domain.operations/parsers/access/getEnvAccess.d.ts +4 -0
  13. package/dist/domain.operations/parsers/access/getEnvAccessFromAwsAccountAlias.js +6 -24
  14. package/dist/domain.operations/parsers/access/getEnvAccessFromAwsAccountAlias.js.map +1 -1
  15. package/dist/domain.operations/parsers/access/getEnvAccessFromAwsAccountName.d.ts +23 -0
  16. package/dist/domain.operations/parsers/access/getEnvAccessFromAwsAccountName.js +67 -48
  17. package/dist/domain.operations/parsers/access/getEnvAccessFromAwsAccountName.js.map +1 -1
  18. package/dist/domain.operations/parsers/access/getEnvAccessFromEnvar.js +1 -1
  19. package/dist/domain.operations/parsers/access/getEnvAccessFromEnvar.js.map +1 -1
  20. package/dist/domain.operations/parsers/access/isCredentialError.d.ts +9 -0
  21. package/dist/domain.operations/parsers/access/isCredentialError.js +38 -0
  22. package/dist/domain.operations/parsers/access/isCredentialError.js.map +1 -0
  23. package/dist/domain.operations/parsers/access/isModuleNotFoundError.d.ts +8 -0
  24. package/dist/domain.operations/parsers/access/isModuleNotFoundError.js +15 -0
  25. package/dist/domain.operations/parsers/access/isModuleNotFoundError.js.map +1 -0
  26. package/dist/domain.operations/parsers/access/isServerTransientError.d.ts +11 -0
  27. package/dist/domain.operations/parsers/access/isServerTransientError.js +22 -0
  28. package/dist/domain.operations/parsers/access/isServerTransientError.js.map +1 -0
  29. package/dist/domain.operations/parsers/access/isThrottleError.d.ts +10 -0
  30. package/dist/domain.operations/parsers/access/isThrottleError.js +30 -0
  31. package/dist/domain.operations/parsers/access/isThrottleError.js.map +1 -0
  32. package/dist/domain.operations/parsers/access/sleep.d.ts +6 -0
  33. package/dist/domain.operations/parsers/access/sleep.js +11 -0
  34. package/dist/domain.operations/parsers/access/sleep.js.map +1 -0
  35. package/dist/domain.operations/parsers/access/withCacheAcrossProcesses.d.ts +29 -0
  36. package/dist/domain.operations/parsers/access/withCacheAcrossProcesses.js +451 -0
  37. package/dist/domain.operations/parsers/access/withCacheAcrossProcesses.js.map +1 -0
  38. package/dist/domain.operations/parsers/access/withRetryOnThrottle.d.ts +11 -0
  39. package/dist/domain.operations/parsers/access/withRetryOnThrottle.js +44 -0
  40. package/dist/domain.operations/parsers/access/withRetryOnThrottle.js.map +1 -0
  41. package/dist/domain.operations/parsers/commit/getEnvCommitFromEnvar.js +1 -1
  42. package/dist/domain.operations/parsers/commit/getEnvCommitFromEnvar.js.map +1 -1
  43. package/dist/domain.operations/parsers/config/getEnvConfigFromEnvar.js +1 -1
  44. package/dist/domain.operations/parsers/config/getEnvConfigFromEnvar.js.map +1 -1
  45. package/dist/domain.operations/parsers/factories.d.ts +2 -1
  46. package/dist/domain.operations/parsers/factories.js +4 -1
  47. package/dist/domain.operations/parsers/factories.js.map +1 -1
  48. package/dist/domain.operations/parsers/server/getEnvServerFromEnvar.js +1 -1
  49. package/dist/domain.operations/parsers/server/getEnvServerFromEnvar.js.map +1 -1
  50. package/dist/domain.operations/validators/isEnvironmentConfigSlug.js.map +1 -1
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.js.map +1 -1
  53. package/package.json +48 -31
  54. package/readme.md +36 -1
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/run.bun.sdk-environment.bc
3
- size: 104445301 bytes
4
- sha256: bbff486d195ef9d2e3488f4168a512b325eb06d7fae6ee4c1f5ced63eef02369
3
+ size: 104400419 bytes
4
+ sha256: d350e9f6e1747dd38d343f11c421b28fbb2d07fa0939499ec3c246d20a4db0f7
@@ -1 +1 @@
1
- {"version":3,"file":"getCommit.js","sourceRoot":"","sources":["../../../src/contract/cli/getCommit.ts"],"names":[],"mappings":";;;AAAA,oGAAiG;AAEjG;;;GAGG;AACI,MAAM,SAAS,GAAG,GAAS,EAAE;IAClC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,yCAAmB,CAAC,IAAI,EAAE,CAAC;QACxC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,sEAAsE,CACvE,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CACrE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAjBW,QAAA,SAAS,aAiBpB"}
1
+ {"version":3,"file":"getCommit.js","sourceRoot":"","sources":["../../../src/contract/cli/getCommit.ts"],"names":[],"mappings":";;;AAAA,mGAAgG;AAEhG;;;GAGG;AACI,MAAM,SAAS,GAAG,GAAS,EAAE;IAClC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,yCAAmB,CAAC,IAAI,EAAE,CAAC;QACxC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,sEAAsE,CACvE,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CACrE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAjBW,QAAA,SAAS,aAiBpB"}
@@ -9,12 +9,20 @@ import type { EnvironmentServerTier } from '../../domain.objects/EnvironmentServ
9
9
  * .why = enables custom parser configuration
10
10
  */
11
11
  export type SyncParser<T> = () => T | null;
12
- export type AsyncParser<T> = () => T | null | Promise<T | null>;
12
+ export type AsyncParser<T> = (context?: ParserContext) => T | null | Promise<T | null>;
13
+ /**
14
+ * .what = what getEnvironment.filled() hands each async parser
15
+ * .why = a parser with a cache of its own (e.g. the shared aws account name file)
16
+ * honors the caller's cache: 'skip'; a parser that takes no arg ignores it
17
+ */
18
+ export interface ParserContext {
19
+ cache: 'skip' | null;
20
+ }
13
21
  /**
14
22
  * .what = union parser type for public API
15
- * .why = matches README: type Parser<T> = () => T | null | Promise<T | null>
23
+ * .why = matches README: type Parser<T> = (context?) => T | null | Promise<T | null>
16
24
  */
17
- export type Parser<T> = () => T | null | Promise<T | null>;
25
+ export type Parser<T> = (context?: ParserContext) => T | null | Promise<T | null>;
18
26
  /**
19
27
  * .what = cached version of _filled
20
28
  * .why = avoid repeated parser invocations
@@ -4,15 +4,15 @@ exports.getEnvironment = void 0;
4
4
  const helpful_errors_1 = require("helpful-errors");
5
5
  const simple_in_memory_cache_1 = require("simple-in-memory-cache");
6
6
  const with_simple_cache_1 = require("with-simple-cache");
7
- const getEnvAccess_1 = require("../parsers/access/getEnvAccess");
8
- const getEnvCommit_1 = require("../parsers/commit/getEnvCommit");
9
- const getEnvConfig_1 = require("../parsers/config/getEnvConfig");
10
- const getEnvServer_1 = require("../parsers/server/getEnvServer");
11
- const isEnvironmentAccessTier_1 = require("../validators/isEnvironmentAccessTier");
12
- const isEnvironmentCommitSlug_1 = require("../validators/isEnvironmentCommitSlug");
13
- const isEnvironmentConfigSlug_1 = require("../validators/isEnvironmentConfigSlug");
14
- const isEnvironmentServerTier_1 = require("../validators/isEnvironmentServerTier");
15
- const isValidConfigForAccess_1 = require("../validators/isValidConfigForAccess");
7
+ const getEnvAccess_1 = require("../../domain.operations/parsers/access/getEnvAccess");
8
+ const getEnvCommit_1 = require("../../domain.operations/parsers/commit/getEnvCommit");
9
+ const getEnvConfig_1 = require("../../domain.operations/parsers/config/getEnvConfig");
10
+ const getEnvServer_1 = require("../../domain.operations/parsers/server/getEnvServer");
11
+ const isEnvironmentAccessTier_1 = require("../../domain.operations/validators/isEnvironmentAccessTier");
12
+ const isEnvironmentCommitSlug_1 = require("../../domain.operations/validators/isEnvironmentCommitSlug");
13
+ const isEnvironmentConfigSlug_1 = require("../../domain.operations/validators/isEnvironmentConfigSlug");
14
+ const isEnvironmentServerTier_1 = require("../../domain.operations/validators/isEnvironmentServerTier");
15
+ const isValidConfigForAccess_1 = require("../../domain.operations/validators/isValidConfigForAccess");
16
16
  /**
17
17
  * .what = compute display name for a parser function
18
18
  * .why = use function.name if available, fallback to index-based name
@@ -74,21 +74,17 @@ const DEFAULT_COMMIT_PARSERS_SYNC = [
74
74
  const defaultFilledCache = (0, simple_in_memory_cache_1.createCache)();
75
75
  const defaultStaticCache = (0, simple_in_memory_cache_1.createCache)();
76
76
  /**
77
- * .what = create cache that skips reads but writes to target
78
- * .why = used when callers pass 'skip' to bypass cache lookup
79
- * but still populate cache for subsequent calls
77
+ * .what = determine if cache read should be bypassed
78
+ * .why = when cache: 'skip', force fresh parse but still populate cache
80
79
  */
81
- const createCacheSkipRead = (target) => ({
82
- get: () => undefined,
83
- set: (key, value) => target.set(key, value),
84
- });
80
+ const shouldBypassCacheGet = (input) => input?.cache === 'skip';
85
81
  /**
86
82
  * .what = run parser chain until first non-null result
87
83
  * .why = first-wins precedence
88
84
  */
89
- const getOneFromParsersAsync = async (parsers, validate, attributeName) => {
85
+ const getOneFromParsersAsync = async (parsers, validate, attributeName, context) => {
90
86
  for (const { parser, name } of parsers) {
91
- const result = await parser();
87
+ const result = await parser(context);
92
88
  if (result !== null) {
93
89
  if (!validate(result)) {
94
90
  throw new helpful_errors_1.BadRequestError(`invalid ${attributeName} value: ${JSON.stringify(result)}. parser: ${name}`);
@@ -119,13 +115,13 @@ const getOneFromParsersSync = (parsers, validate, attributeName) => {
119
115
  * .why = separated to enable cache wrapper
120
116
  */
121
117
  const computeFilledEnvironment = async (input) => {
122
- const access = await getOneFromParsersAsync(asParsersNamed(input.accessParsers), isEnvironmentAccessTier_1.isEnvironmentAccessTier, 'access');
118
+ const access = await getOneFromParsersAsync(asParsersNamed(input.accessParsers), isEnvironmentAccessTier_1.isEnvironmentAccessTier, 'access', input.context);
123
119
  // config depends on access
124
120
  const configParsers = input.configParsersFactory(access);
125
121
  const config = getOneFromParsersSync(asParsersNamed(configParsers), isEnvironmentConfigSlug_1.isEnvironmentConfigSlug, 'config');
126
122
  (0, isValidConfigForAccess_1.isValidConfigForAccess)({ config, access });
127
- const server = await getOneFromParsersAsync(asParsersNamed(input.serverParsers), isEnvironmentServerTier_1.isEnvironmentServerTier, 'server');
128
- const commit = await getOneFromParsersAsync(asParsersNamed(input.commitParsers), isEnvironmentCommitSlug_1.isEnvironmentCommitSlug, 'commit');
123
+ const server = await getOneFromParsersAsync(asParsersNamed(input.serverParsers), isEnvironmentServerTier_1.isEnvironmentServerTier, 'server', input.context);
124
+ const commit = await getOneFromParsersAsync(asParsersNamed(input.commitParsers), isEnvironmentCommitSlug_1.isEnvironmentCommitSlug, 'commit', input.context);
129
125
  return { access, config, server, commit };
130
126
  };
131
127
  /**
@@ -138,6 +134,7 @@ const _filled = async (input) => {
138
134
  configParsersFactory: input?.parsers?.config ?? DEFAULT_CONFIG_PARSERS,
139
135
  serverParsers: input?.parsers?.server ?? DEFAULT_SERVER_PARSERS,
140
136
  commitParsers: input?.parsers?.commit ?? DEFAULT_COMMIT_PARSERS,
137
+ context: { cache: input?.cache === 'skip' ? 'skip' : null }, // a parser's own cache honors the skip too
141
138
  };
142
139
  return computeFilledEnvironment(parsersConfig);
143
140
  };
@@ -147,12 +144,13 @@ const _filled = async (input) => {
147
144
  * .note = callers can supply their own cache via input
148
145
  */
149
146
  const filled = (0, with_simple_cache_1.withSimpleCache)(_filled, {
150
- cache: ({ fromInput }) => {
151
- const inputCache = fromInput[0]?.cache;
147
+ cache: (input) => {
148
+ const inputCache = input?.cache;
152
149
  if (inputCache === 'skip')
153
- return createCacheSkipRead(defaultFilledCache);
150
+ return defaultFilledCache; // use default cache even on skip
154
151
  return inputCache ?? defaultFilledCache;
155
152
  },
153
+ bypass: { get: shouldBypassCacheGet },
156
154
  serialize: { key: () => 'filled' },
157
155
  });
158
156
  /**
@@ -188,12 +186,13 @@ const _staticEnv = (input) => {
188
186
  * .note = callers can supply their own cache via input
189
187
  */
190
188
  const staticEnv = (0, with_simple_cache_1.withSimpleCache)(_staticEnv, {
191
- cache: ({ fromInput }) => {
192
- const inputCache = fromInput[0]?.cache;
189
+ cache: (input) => {
190
+ const inputCache = input?.cache;
193
191
  if (inputCache === 'skip')
194
- return createCacheSkipRead(defaultStaticCache);
192
+ return defaultStaticCache; // use default cache even on skip
195
193
  return inputCache ?? defaultStaticCache;
196
194
  },
195
+ bypass: { get: shouldBypassCacheGet },
197
196
  serialize: { key: () => 'static' },
198
197
  });
199
198
  const getEnvironmentFn = Object.assign(
@@ -1 +1 @@
1
- {"version":3,"file":"getEnvironment.js","sourceRoot":"","sources":["../../../src/domain.operations/getEnvironment/getEnvironment.ts"],"names":[],"mappings":";;;AAAA,mDAA0E;AAC1E,mEAA+E;AAC/E,yDAAoD;AAOpD,iEAA8D;AAC9D,iEAA8D;AAC9D,iEAA8D;AAC9D,iEAA8D;AAC9D,mFAAgF;AAChF,mFAAgF;AAChF,mFAAgF;AAChF,mFAAgF;AAChF,iFAA8E;AAe9E;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAG1B,EAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,UAAU,KAAK,CAAC,KAAK,GAAG,CAAC;AAE5D;;;GAGG;AACH,MAAM,cAAc,GAAG,CACrB,OAAuB,EACmB,EAAE,CAC5C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9B,MAAM;IACN,IAAI,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;CAC3C,CAAC,CAAC,CAAC;AAEN;;;GAGG;AACH,MAAM,aAAa,GAAG,CACpB,OAAiD,EACvC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAE1C,kBAAkB;AAClB,MAAM,sBAAsB,GAAyC;IACnE,2BAAY,CAAC,SAAS;IACtB,2BAAY,CAAC,mBAAmB;IAChC,2BAAY,CAAC,kBAAkB;IAC/B,2BAAY,CAAC,WAAW;CACzB,CAAC;AAEF,MAAM,sBAAsB,GAAwC;IAClE,2BAAY,CAAC,SAAS;IACtB,2BAAY,C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Aa,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,SAAS,GAAG,IAAA,mCAAe,EAAC,UAAU,EAAE;IAC5C,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACvB,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;QACvC,IAAI,UAAU,KAAK,MAAM;YAAE,OAAO,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;QAC1E,OAAO,UAAU,IAAI,kBAAkB,CAAC;IAC1C,CAAC;IACD,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAYH,MAAM,gBAAgB,GAAmB,MAAM,CAAC,MAAM;AACpD,kCAAkC;AAClC,CAAC,KAAoC,EAAwB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7E;IACE;;OAEG;IACH,MAAM;IAEN;;OAEG;IACH,MAAM,EAAE,SAAS;CAClB,CACF,CAAC;AAEW,QAAA,cAAc,GAAG,gBAAgB,CAAC"}
1
+ {"version":3,"file":"getEnvironment.js","sourceRoot":"","sources":["../../../src/domain.operations/getEnvironment/getEnvironment.ts"],"names":[],"mappings":";;;AAAA,mDAA0E;AAC1E,mEAA+E;AAC/E,yDAAoD;AAOpD,qFAAkF;AAClF,qFAAkF;AAClF,qFAAkF;AAClF,qFAAkF;AAClF,uGAAoG;AACpG,uGAAoG;AACpG,uGAAoG;AACpG,uGAAoG;AACpG,qGAAkG;AA4BlG;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAG1B,EAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,UAAU,KAAK,CAAC,KAAK,GAAG,CAAC;AAE5D;;;GAGG;AACH,MAAM,cAAc,GAAG,CACrB,OAAuB,EACmB,EAAE,CAC5C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE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,EAAE,SAAS;CAClB,CACF,CAAC;AAEW,QAAA,cAAc,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * .what = derive a filesystem-safe cache key from an aws access key id
3
+ * .why = names the caller with no network call; the hash keeps the key id off disk,
4
+ * and other credentials always map to another key, so no caller reads another's name
5
+ */
6
+ export declare const asCacheKeyFromAccessKeyId: (input: {
7
+ accessKeyId: string;
8
+ }) => string;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asCacheKeyFromAccessKeyId = void 0;
4
+ const node_crypto_1 = require("node:crypto");
5
+ /**
6
+ * .what = derive a filesystem-safe cache key from an aws access key id
7
+ * .why = names the caller with no network call; the hash keeps the key id off disk,
8
+ * and other credentials always map to another key, so no caller reads another's name
9
+ */
10
+ const asCacheKeyFromAccessKeyId = (input) => (0, node_crypto_1.createHash)('sha256').update(input.accessKeyId).digest('hex').slice(0, 32);
11
+ exports.asCacheKeyFromAccessKeyId = asCacheKeyFromAccessKeyId;
12
+ //# sourceMappingURL=asCacheKeyFromAccessKeyId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asCacheKeyFromAccessKeyId.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/asCacheKeyFromAccessKeyId.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC;;;;GAIG;AACI,MAAM,yBAAyB,GAAG,CAAC,KAEzC,EAAU,EAAE,CACX,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAH/D,QAAA,yBAAyB,6BAGsC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * .what = read the caller's access key id from an aws account client
3
+ * .why = names the caller for the shared cache with no aws api call; a client
4
+ * built by a module-level mock of the sdk holds no config, so no key names
5
+ * the caller and the parser asks aws direct
6
+ */
7
+ export declare const getAccessKeyIdFromAccountClient: (input: {
8
+ client: {
9
+ config?: {
10
+ credentials?: () => Promise<{
11
+ accessKeyId: string;
12
+ }>;
13
+ };
14
+ };
15
+ }) => Promise<string | null>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAccessKeyIdFromAccountClient = void 0;
4
+ /**
5
+ * .what = read the caller's access key id from an aws account client
6
+ * .why = names the caller for the shared cache with no aws api call; a client
7
+ * built by a module-level mock of the sdk holds no config, so no key names
8
+ * the caller and the parser asks aws direct
9
+ */
10
+ const getAccessKeyIdFromAccountClient = async (input) => {
11
+ // a module-level mock of the sdk builds a client with no config; it holds no key
12
+ const credentials = input.client.config?.credentials;
13
+ if (typeof credentials !== 'function')
14
+ return null;
15
+ return (await credentials()).accessKeyId;
16
+ };
17
+ exports.getAccessKeyIdFromAccountClient = getAccessKeyIdFromAccountClient;
18
+ //# sourceMappingURL=getAccessKeyIdFromAccountClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAccessKeyIdFromAccountClient.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/getAccessKeyIdFromAccountClient.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,MAAM,+BAA+B,GAAG,KAAK,EAAE,KAIrD,EAA0B,EAAE;IAC3B,iFAAiF;IACjF,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;IACrD,IAAI,OAAO,WAAW,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IACnD,OAAO,CAAC,MAAM,WAAW,EAAE,CAAC,CAAC,WAAW,CAAC;AAC3C,CAAC,CAAC;AATW,QAAA,+BAA+B,mCAS1C"}
@@ -9,6 +9,10 @@ export declare const getEnvAccess: {
9
9
  } | undefined) => Promise<import("../../..").EnvironmentAccessTier | null>;
10
10
  fromAwsAccountName: (input?: {
11
11
  map?: import("./getEnvAccessFromAwsAccountName").AwsAccountPatternMap | undefined;
12
+ cache?: "skip" | null | undefined;
13
+ } | undefined, context?: {
14
+ sdkAwsAccount?: import("./getEnvAccessFromAwsAccountName").SdkAwsAccount | undefined;
15
+ cacheDir?: string | undefined;
12
16
  } | undefined) => Promise<import("../../..").EnvironmentAccessTier | null>;
13
17
  fromNodeEnv: () => import("../../..").EnvironmentAccessTier | null;
14
18
  };
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.getEnvAccessFromAwsAccountAlias = exports.matchAliasToAccess = void 0;
27
4
  const DEFAULT_MAP = {
@@ -56,7 +33,7 @@ const getEnvAccessFromAwsAccountAlias = async (input) => {
56
33
  const map = input?.map ?? DEFAULT_MAP;
57
34
  try {
58
35
  // dynamic import to avoid bundle size when not used
59
- const { IAMClient, ListAccountAliasesCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-iam')));
36
+ const { IAMClient, ListAccountAliasesCommand } = await import('@aws-sdk/client-iam');
60
37
  const client = new IAMClient({});
61
38
  const response = await client.send(new ListAccountAliasesCommand({}));
62
39
  const alias = response.AccountAliases?.[0];
@@ -69,6 +46,11 @@ const getEnvAccessFromAwsAccountAlias = async (input) => {
69
46
  if (error instanceof Error) {
70
47
  const message = error.message.toLowerCase();
71
48
  const name = error.name.toLowerCase();
49
+ const code = error.code;
50
+ // sdk not installed — gracefully skip
51
+ if (code === 'ERR_MODULE_NOT_FOUND' || code === 'MODULE_NOT_FOUND') {
52
+ return null;
53
+ }
72
54
  if (message.includes('region') ||
73
55
  message.includes('could not load credentials') ||
74
56
  message.includes('no credentials') ||
@@ -1 +1 @@
1
- {"version":3,"file":"getEnvAccessFromAwsAccountAlias.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/getEnvAccessFromAwsAccountAlias.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,WAAW,GAAuB;IACtC,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAChC,KAAa,EACb,GAAuB,EACO,EAAE;IAChC,oBAAoB;IACpB,IAAI,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC,KAAK,CAAE,CAAC;IAEnC,sBAAsB;IACtB,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9D,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;gBAAE,OAAO,GAAG,CAAC,OAAO,CAAE,CAAC;QAC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AgB,CAAC;gBAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAC3B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAClC,IAAI,CAAC,QAAQ,CAAC,sBAAsB,CAAC;gBACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EACpC,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,4BAA4B;QAC5B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AA1CW,QAAA,+BAA+B,mCA0C1C"}
1
+ {"version":3,"file":"getEnvAccessFromAwsAccountAlias.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/getEnvAccessFromAwsAccountAlias.ts"],"names":[],"mappings":";;;AAUA,MAAM,WAAW,GAAuB;IACtC,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAChC,KAAa,EACb,GAAuB,EACO,EAAE;IAChC,oBAAoB;IACpB,IAAI,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC,KAAK,CAAE,CAAC;IAEnC,sBAAsB;IACtB,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9D,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;gBAAE,OAAO,GAAG,CAAC,OAAO,CAAE,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;A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OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;gBACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAC3B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAClC,IAAI,CAAC,QAAQ,CAAC,sBAAsB,CAAC;gBACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EACpC,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,4BAA4B;QAC5B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAjDW,QAAA,+BAA+B,mCAiD1C"}
@@ -12,10 +12,33 @@ export interface AwsAccountPatternMap {
12
12
  * .why = exact match wins, then glob match in order
13
13
  */
14
14
  export declare const matchNameToAccess: (name: string, map: AwsAccountPatternMap) => EnvironmentAccessTier | null;
15
+ /**
16
+ * .what = the aws account calls this parser needs
17
+ * .why = one seam for the real sdk and for a test double
18
+ */
19
+ export interface SdkAwsAccount {
20
+ /**
21
+ * reads the caller's access key id from its loaded credentials. no aws api call
22
+ * for static (env) credentials; a profile provider (sso, assume-role, instance role)
23
+ * loads them from its own source, once per process
24
+ * null = the client holds no credential provider (e.g. a module-level mock), so no key names the caller
25
+ */
26
+ getAccessKeyId: () => Promise<string | null>;
27
+ /** calls GetAccountInformation */
28
+ getAccountName: () => Promise<string | null>;
29
+ }
15
30
  /**
16
31
  * .what = parse access tier from aws account name
17
32
  * .why = fallback when alias not set (name is always present)
33
+ * .note = the name is shared across processes via a file cache keyed by the
34
+ * caller's access key id, so N cold processes make one aws call;
35
+ * a throttle reply backs off and retries
36
+ * .note = cache 'skip' asks aws fresh past the shared file, then rewrites it
18
37
  */
19
38
  export declare const getEnvAccessFromAwsAccountName: (input?: {
20
39
  map?: AwsAccountPatternMap;
40
+ cache?: 'skip' | null;
41
+ }, context?: {
42
+ sdkAwsAccount?: SdkAwsAccount;
43
+ cacheDir?: string;
21
44
  }) => Promise<EnvironmentAccessTier | null>;
@@ -1,29 +1,15 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.getEnvAccessFromAwsAccountName = exports.matchNameToAccess = void 0;
4
+ const os_1 = require("os");
5
+ const path_1 = require("path");
6
+ const asCacheKeyFromAccessKeyId_1 = require("./asCacheKeyFromAccessKeyId");
7
+ const getAccessKeyIdFromAccountClient_1 = require("./getAccessKeyIdFromAccountClient");
8
+ const isCredentialError_1 = require("./isCredentialError");
9
+ const isModuleNotFoundError_1 = require("./isModuleNotFoundError");
10
+ const isServerTransientError_1 = require("./isServerTransientError");
11
+ const withCacheAcrossProcesses_1 = require("./withCacheAcrossProcesses");
12
+ const withRetryOnThrottle_1 = require("./withRetryOnThrottle");
27
13
  const DEFAULT_MAP = {
28
14
  '*-prod': 'prod',
29
15
  '*-prep': 'prep',
@@ -48,42 +34,75 @@ const matchNameToAccess = (name, map) => {
48
34
  return null;
49
35
  };
50
36
  exports.matchNameToAccess = matchNameToAccess;
37
+ /**
38
+ * .what = build the real aws account sdk
39
+ * .why = dynamic import keeps the optional peer dep out of the bundle when unused
40
+ */
41
+ const getSdkAwsAccountDefault = async () => {
42
+ const { AccountClient, GetAccountInformationCommand } = await import('@aws-sdk/client-account');
43
+ const client = new AccountClient({});
44
+ return {
45
+ getAccessKeyId: () => (0, getAccessKeyIdFromAccountClient_1.getAccessKeyIdFromAccountClient)({ client }),
46
+ getAccountName: async () => (await client.send(new GetAccountInformationCommand({}))).AccountName ??
47
+ null,
48
+ };
49
+ };
50
+ /**
51
+ * .what = where the shared account-name cache lives on this host
52
+ * .why = one dir per os account (uid) under the os temp dir, so accounts never share or block each other
53
+ */
54
+ const getCacheDirDefault = () => (0, path_1.join)((0, os_1.tmpdir)(), `sdk-environment.uid=${process.getuid?.() ?? 'na'}`, 'aws-account-name');
55
+ /**
56
+ * .what = shared cache + throttle retry tune
57
+ * .why = ttl bounds how long a rename takes to show: an access key id belongs to one
58
+ * principal in one account for life, so a key never maps to another account's name,
59
+ * and only a rare rename ages; retry outlasts the sdk's own 3 attempts;
60
+ * a live holder's lock is never broken before the stale bound
61
+ */
62
+ const CACHE_TTL_MS = 60 * 60 * 1000;
63
+ const LOCK_STALE_MS = 60 * 1000;
64
+ const LOCK_POLL_MS = 75;
65
+ const RETRY = { attempts: 6, baseMs: 250, capMs: 4000 };
51
66
  /**
52
67
  * .what = parse access tier from aws account name
53
68
  * .why = fallback when alias not set (name is always present)
69
+ * .note = the name is shared across processes via a file cache keyed by the
70
+ * caller's access key id, so N cold processes make one aws call;
71
+ * a throttle reply backs off and retries
72
+ * .note = cache 'skip' asks aws fresh past the shared file, then rewrites it
54
73
  */
55
- const getEnvAccessFromAwsAccountName = async (input) => {
74
+ const getEnvAccessFromAwsAccountName = async (input, context) => {
56
75
  const map = input?.map ?? DEFAULT_MAP;
57
76
  try {
58
- // dynamic import to avoid bundle size when not used
59
- const { AccountClient, GetAccountInformationCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-account')));
60
- const client = new AccountClient({});
61
- const response = await client.send(new GetAccountInformationCommand({}));
62
- const accountName = response.AccountName;
77
+ const sdkAwsAccount = context?.sdkAwsAccount ?? (await getSdkAwsAccountDefault());
78
+ // fetch once per host per caller; retry on throttle
79
+ const getAccountNameDirect = (0, withRetryOnThrottle_1.withRetryOnThrottle)(() => sdkAwsAccount.getAccountName(), // bound at the seam, so a class-based double keeps its `this`
80
+ RETRY);
81
+ const getAccountNameShared = (0, withCacheAcrossProcesses_1.withCacheAcrossProcesses)(getAccountNameDirect, {
82
+ dir: context?.cacheDir ?? getCacheDirDefault(),
83
+ ttlMs: CACHE_TTL_MS,
84
+ staleMs: LOCK_STALE_MS,
85
+ pollMs: LOCK_POLL_MS,
86
+ isQueueKeptOnError: isServerTransientError_1.isServerTransientError, // a throttle or a 5xx keeps one caller at a time; any other error frees the waiters to see it at once
87
+ });
88
+ // with no key to name the caller, ask direct and share naught
89
+ const accessKeyId = await sdkAwsAccount.getAccessKeyId();
90
+ const accountName = accessKeyId === null
91
+ ? await getAccountNameDirect()
92
+ : await getAccountNameShared({
93
+ key: (0, asCacheKeyFromAccessKeyId_1.asCacheKeyFromAccessKeyId)({ accessKeyId }),
94
+ cache: input?.cache ?? null,
95
+ });
63
96
  if (!accountName)
64
97
  return null;
65
98
  return (0, exports.matchNameToAccess)(accountName, map);
66
99
  }
67
100
  catch (error) {
68
- // allowlist: config/credential/auth errors return null (parser should be skipped)
69
- if (error instanceof Error) {
70
- const message = error.message.toLowerCase();
71
- const errorName = error.name.toLowerCase();
72
- if (message.includes('region') ||
73
- message.includes('could not load credentials') ||
74
- message.includes('no credentials') ||
75
- message.includes('credential') ||
76
- message.includes('access denied') ||
77
- message.includes('not authorized') ||
78
- message.includes('security token') ||
79
- message.includes('session') ||
80
- message.includes('expired') ||
81
- message.includes('reauthenticate') ||
82
- errorName.includes('invalidclienttokenid') ||
83
- errorName.includes('credentialsprovider')) {
84
- return null;
85
- }
86
- }
101
+ // allowlist: sdk not installed, or config/credential/auth errors, skip this parser
102
+ if ((0, isModuleNotFoundError_1.isModuleNotFoundError)({ error }))
103
+ return null;
104
+ if ((0, isCredentialError_1.isCredentialError)({ error }))
105
+ return null;
87
106
  // rethrow unexpected errors
88
107
  throw error;
89
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getEnvAccessFromAwsAccountName.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/getEnvAccessFromAwsAccountName.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,WAAW,GAAyB;IACxC,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EACZ,GAAyB,EACK,EAAE;IAChC,oBAAoB;IACpB,IAAI,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC,IAAI,CAAE,CAAC;IAEjC,sBAAsB;IACtB,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9D,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,GAAG,CAAC,OAAO,CAAE,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAhBW,QAAA,iBAAiB,qBAgB5B;AAEF;;;GAGG;AACI,MAAM,8BAA8B,GAAG,KA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ClC,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC;gBAC1C,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EACzC,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,4BAA4B;QAC5B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AA1CW,QAAA,8BAA8B,kCA0CzC"}
1
+ {"version":3,"file":"getEnvAccessFromAwsAccountName.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/getEnvAccessFromAwsAccountName.ts"],"names":[],"mappings":";;;AAAA,2BAA4B;AAC5B,+BAA4B;AAI5B,2EAAwE;AACxE,uFAAoF;AACpF,2DAAwD;AACxD,mEAAgE;AAChE,qEAAkE;AAClE,yEAAsE;AACtE,+DAA4D;AAW5D,MAAM,WAAW,GAAyB;IACxC,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EACZ,GAAyB,EACK,EAAE;IAChC,oBAAoB;IACpB,IAAI,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC,IAAI,CAAE,CAAC;IAEjC,sBAAsB;IACtB,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9D,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,GAAG,CAAC,OAAO,CAAE,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAhBW,QAAA,iBAAiB,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AAA,yCAAmB,EAC9C,GAAG,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,EAAE,8DAA8D;QACpG,KAAK,CACN,CAAC;QACF,MAAM,oBAAoB,GAAG,IAAA,mDAAwB,EACnD,oBAAoB,EACpB;YACE,GAAG,EAAE,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE;YAC9C,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;YACpB,kBAAkB,EAAE,+CAAsB,EAAE,sGAAsG;SACnJ,CACF,CAAC;QACF,8DAA8D;QAC9D,MAAM,WAAW,GAAG,MAAM,aAAa,CAAC,cAAc,EAAE,CAAC;QACzD,MAAM,WAAW,GACf,WAAW,KAAK,IAAI;YAClB,CAAC,CAAC,MAAM,oBAAoB,EAAE;YAC9B,CAAC,CAAC,MAAM,oBAAoB,CAAC;gBACzB,GAAG,EAAE,IAAA,qDAAyB,EAAC,EAAE,WAAW,EAAE,CAAC;gBAC/C,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,IAAI;aAC5B,CAAC,CAAC;QAET,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAC9B,OAAO,IAAA,yBAAiB,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,mFAAmF;QACnF,IAAI,IAAA,6CAAqB,EAAC,EAAE,KAAK,EAAE,CAAC;YAAE,OAAO,IAAI,CAAC;QAClD,IAAI,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,CAAC;YAAE,OAAO,IAAI,CAAC;QAE9C,4BAA4B;QAC5B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAnDW,QAAA,8BAA8B,kCAmDzC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getEnvAccessFromEnvar = void 0;
4
- const isEnvironmentAccessTier_1 = require("../../validators/isEnvironmentAccessTier");
4
+ const isEnvironmentAccessTier_1 = require("../../../domain.operations/validators/isEnvironmentAccessTier");
5
5
  /**
6
6
  * .what = parse access tier from ACCESS environment variable
7
7
  * .why = explicit override via ACCESS=prod
@@ -1 +1 @@
1
- {"version":3,"file":"getEnvAccessFromEnvar.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/getEnvAccessFromEnvar.ts"],"names":[],"mappings":";;;AACA,sFAAmF;AAEnF;;;GAGG;AACI,MAAM,qBAAqB,GAAG,GAAiC,EAAE;IACtE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;IACjC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,CAAC,IAAA,iDAAuB,EAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AALW,QAAA,qBAAqB,yBAKhC"}
1
+ {"version":3,"file":"getEnvAccessFromEnvar.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/getEnvAccessFromEnvar.ts"],"names":[],"mappings":";;;AACA,uGAAoG;AAEpG;;;GAGG;AACI,MAAM,qBAAqB,GAAG,GAAiC,EAAE;IACtE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;IACjC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,CAAC,IAAA,iDAAuB,EAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AALW,QAAA,qBAAqB,yBAKhC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * .what = decide whether an aws error says the caller's credentials or config are absent or refused
3
+ * .why = such an error means this parser cannot answer for these credentials, so the
4
+ * parser reads it as "skip this parser" and the next parser in the chain is tried
5
+ * .note = matched by shape (message, name), never `instanceof`: jest runs code in another realm
6
+ */
7
+ export declare const isCredentialError: (input: {
8
+ error: unknown;
9
+ }) => boolean;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isCredentialError = void 0;
4
+ /**
5
+ * .what = decide whether an aws error says the caller's credentials or config are absent or refused
6
+ * .why = such an error means this parser cannot answer for these credentials, so the
7
+ * parser reads it as "skip this parser" and the next parser in the chain is tried
8
+ * .note = matched by shape (message, name), never `instanceof`: jest runs code in another realm
9
+ */
10
+ const isCredentialError = (input) => {
11
+ if (!(typeof input.error === 'object' && input.error !== null))
12
+ return false;
13
+ // a TypeError is a code defect (e.g. a property of undefined named `credentials`), never a refusal
14
+ if ('name' in input.error && input.error.name === 'TypeError')
15
+ return false;
16
+ const message = String('message' in input.error ? input.error.message : '').toLowerCase();
17
+ const name = String('name' in input.error ? input.error.name : '').toLowerCase();
18
+ return (MESSAGE_SIGNS.some((sign) => message.includes(sign)) ||
19
+ NAME_SIGNS.some((sign) => name.includes(sign)));
20
+ };
21
+ exports.isCredentialError = isCredentialError;
22
+ const MESSAGE_SIGNS = [
23
+ 'region',
24
+ 'could not load credentials',
25
+ 'no credentials',
26
+ 'credential',
27
+ 'access denied',
28
+ 'not authorized',
29
+ 'security token',
30
+ 'session',
31
+ 'expired',
32
+ 'reauthenticate',
33
+ ];
34
+ const NAME_SIGNS = [
35
+ 'invalidclienttokenid',
36
+ 'credentialsprovider',
37
+ ];
38
+ //# sourceMappingURL=isCredentialError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isCredentialError.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/isCredentialError.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAyB,EAAW,EAAE;IACtE,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAE7E,mGAAmG;IACnG,IAAI,MAAM,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC;IAE5E,MAAM,OAAO,GAAG,MAAM,CACpB,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CACpD,CAAC,WAAW,EAAE,CAAC;IAChB,MAAM,IAAI,GAAG,MAAM,CACjB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAC9C,CAAC,WAAW,EAAE,CAAC;IAChB,OAAO,CACL,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAC/C,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,iBAAiB,qBAgB5B;AAEF,MAAM,aAAa,GAAsB;IACvC,QAAQ;IACR,4BAA4B;IAC5B,gBAAgB;IAChB,YAAY;IACZ,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,SAAS;IACT,SAAS;IACT,gBAAgB;CACjB,CAAC;AAEF,MAAM,UAAU,GAAsB;IACpC,sBAAsB;IACtB,qBAAqB;CACtB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * .what = decide whether an error says an import could not be found
3
+ * .why = the aws sdk is an optional peer dep; when it is absent, the parser is skipped
4
+ * .note = matched by shape (`code`), never `instanceof`: jest runs code in another realm
5
+ */
6
+ export declare const isModuleNotFoundError: (input: {
7
+ error: unknown;
8
+ }) => boolean;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isModuleNotFoundError = void 0;
4
+ /**
5
+ * .what = decide whether an error says an import could not be found
6
+ * .why = the aws sdk is an optional peer dep; when it is absent, the parser is skipped
7
+ * .note = matched by shape (`code`), never `instanceof`: jest runs code in another realm
8
+ */
9
+ const isModuleNotFoundError = (input) => typeof input.error === 'object' &&
10
+ input.error !== null &&
11
+ 'code' in input.error &&
12
+ (input.error.code === 'ERR_MODULE_NOT_FOUND' ||
13
+ input.error.code === 'MODULE_NOT_FOUND');
14
+ exports.isModuleNotFoundError = isModuleNotFoundError;
15
+ //# sourceMappingURL=isModuleNotFoundError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isModuleNotFoundError.js","sourceRoot":"","sources":["../../../../src/domain.operations/parsers/access/isModuleNotFoundError.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAyB,EAAW,EAAE,CAC1E,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;IAC/B,KAAK,CAAC,KAAK,KAAK,IAAI;IACpB,MAAM,IAAI,KAAK,CAAC,KAAK;IACrB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,sBAAsB;QAC1C,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB,CAAC,CAAC;AALhC,QAAA,qBAAqB,yBAKW"}