sdk-aws-lambda 0.1.1 → 0.3.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.
Files changed (177) hide show
  1. package/dist/{domain.operations/askLambdaEndpoint/invoke/genLambdaClient.d.ts → access/sdks/lambda/genLambdaSdk.d.ts} +2 -2
  2. package/dist/{domain.operations/askLambdaEndpoint/invoke/genLambdaClient.js → access/sdks/lambda/genLambdaSdk.js} +7 -7
  3. package/dist/access/sdks/lambda/genLambdaSdk.js.map +1 -0
  4. package/dist/{domain.operations/askLambdaEndpoint/invoke → access/sdks/lambda}/sdkLambdaInvoke.d.ts +6 -2
  5. package/dist/{domain.operations/askLambdaEndpoint/invoke → access/sdks/lambda}/sdkLambdaInvoke.js +6 -3
  6. package/dist/access/sdks/lambda/sdkLambdaInvoke.js.map +1 -0
  7. package/dist/contract/cli/asGenArgs.d.ts +21 -0
  8. package/dist/contract/cli/asGenArgs.js +69 -0
  9. package/dist/contract/cli/asGenArgs.js.map +1 -0
  10. package/dist/contract/cli/gen.d.ts +23 -0
  11. package/dist/contract/cli/gen.js +72 -0
  12. package/dist/contract/cli/gen.js.map +1 -0
  13. package/dist/domain.objects/ContextAwsLambdaCaller.d.ts +25 -0
  14. package/dist/domain.objects/ContextAwsLambdaCaller.js +3 -0
  15. package/dist/domain.objects/ContextAwsLambdaCaller.js.map +1 -0
  16. package/dist/domain.objects/ContextAwsLambdaServer.d.ts +30 -0
  17. package/dist/domain.objects/ContextAwsLambdaServer.js +3 -0
  18. package/dist/domain.objects/ContextAwsLambdaServer.js.map +1 -0
  19. package/dist/domain.objects/DomainObjectCaptured.d.ts +51 -0
  20. package/dist/domain.objects/DomainObjectCaptured.js +8 -0
  21. package/dist/domain.objects/DomainObjectCaptured.js.map +1 -0
  22. package/dist/domain.objects/GeneratedFile.d.ts +18 -0
  23. package/dist/domain.objects/GeneratedFile.js +8 -0
  24. package/dist/domain.objects/GeneratedFile.js.map +1 -0
  25. package/dist/domain.objects/HttpStatusCode.d.ts +2 -2
  26. package/dist/domain.objects/HttpStatusCode.js +3 -3
  27. package/dist/domain.objects/LambdaCredentialsAbsentError.d.ts +11 -0
  28. package/dist/domain.objects/LambdaCredentialsAbsentError.js +16 -0
  29. package/dist/domain.objects/LambdaCredentialsAbsentError.js.map +1 -0
  30. package/dist/domain.objects/LambdaDomainObjectNotCapturableError.d.ts +12 -0
  31. package/dist/domain.objects/LambdaDomainObjectNotCapturableError.js +17 -0
  32. package/dist/domain.objects/LambdaDomainObjectNotCapturableError.js.map +1 -0
  33. package/dist/domain.objects/LambdaDomainObjectRefUnbindableError.d.ts +14 -0
  34. package/dist/domain.objects/LambdaDomainObjectRefUnbindableError.js +19 -0
  35. package/dist/domain.objects/LambdaDomainObjectRefUnbindableError.js.map +1 -0
  36. package/dist/domain.objects/LambdaEndpoint.d.ts +35 -0
  37. package/dist/domain.objects/LambdaEndpoint.js +10 -0
  38. package/dist/domain.objects/LambdaEndpoint.js.map +1 -0
  39. package/dist/domain.objects/LambdaEndpointError.d.ts +5 -8
  40. package/dist/domain.objects/LambdaEndpointError.js.map +1 -1
  41. package/dist/domain.objects/LambdaEndpointSchema.d.ts +9 -0
  42. package/dist/domain.objects/LambdaEndpointSchema.js +3 -0
  43. package/dist/domain.objects/LambdaEndpointSchema.js.map +1 -0
  44. package/dist/domain.objects/LambdaFunctionNotFoundError.d.ts +10 -0
  45. package/dist/domain.objects/LambdaFunctionNotFoundError.js +15 -0
  46. package/dist/domain.objects/LambdaFunctionNotFoundError.js.map +1 -0
  47. package/dist/domain.objects/LambdaIntrospectionBlockedError.d.ts +10 -0
  48. package/dist/domain.objects/LambdaIntrospectionBlockedError.js +15 -0
  49. package/dist/domain.objects/LambdaIntrospectionBlockedError.js.map +1 -0
  50. package/dist/domain.objects/LambdaIntrospectionNotSupportedError.d.ts +18 -0
  51. package/dist/domain.objects/LambdaIntrospectionNotSupportedError.js +15 -0
  52. package/dist/domain.objects/LambdaIntrospectionNotSupportedError.js.map +1 -0
  53. package/dist/domain.objects/LambdaServiceNotFoundError.d.ts +10 -0
  54. package/dist/domain.objects/LambdaServiceNotFoundError.js +15 -0
  55. package/dist/domain.objects/LambdaServiceNotFoundError.js.map +1 -0
  56. package/dist/domain.operations/asLambdaEndpoint/asLambdaEndpoint.d.ts +20 -0
  57. package/dist/domain.operations/asLambdaEndpoint/asLambdaEndpoint.js +47 -0
  58. package/dist/domain.operations/asLambdaEndpoint/asLambdaEndpoint.js.map +1 -0
  59. package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.d.ts +2 -12
  60. package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.js +13 -22
  61. package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.js.map +1 -1
  62. package/dist/domain.operations/askLambdaEndpoint/cache/asCachedExecutor.d.ts +2 -2
  63. package/dist/domain.operations/askLambdaEndpoint/cache/asCachedExecutor.js.map +1 -1
  64. package/dist/domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey.d.ts +3 -4
  65. package/dist/domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey.js +17 -5
  66. package/dist/domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey.js.map +1 -1
  67. package/dist/domain.operations/askLambdaEndpoint/error/getStatusCodeHint.d.ts +1 -1
  68. package/dist/domain.operations/askLambdaEndpoint/error/getStatusCodeHint.js +3 -3
  69. package/dist/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.d.ts +13 -8
  70. package/dist/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.js +20 -19
  71. package/dist/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.js.map +1 -1
  72. package/dist/domain.operations/askLambdaEndpoint/serde/asUnprefixedErrorMessage.d.ts +13 -0
  73. package/dist/domain.operations/askLambdaEndpoint/serde/asUnprefixedErrorMessage.js +26 -0
  74. package/dist/domain.operations/askLambdaEndpoint/serde/asUnprefixedErrorMessage.js.map +1 -0
  75. package/dist/domain.operations/askLambdaEndpoint/serde/getParsedResponse.d.ts +2 -2
  76. package/dist/domain.operations/askLambdaEndpoint/serde/getParsedResponse.js +15 -14
  77. package/dist/domain.operations/askLambdaEndpoint/serde/getParsedResponse.js.map +1 -1
  78. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.d.ts +15 -8
  79. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js +16 -9
  80. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js.map +1 -1
  81. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getCorsOrigin.d.ts +3 -3
  82. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getCorsOrigin.js +5 -5
  83. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayEvent.d.ts +1 -1
  84. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayEvent.js +1 -1
  85. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js +88 -63
  86. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js.map +1 -1
  87. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.d.ts +7 -9
  88. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js +14 -11
  89. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js.map +1 -1
  90. package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js +1 -1
  91. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.d.ts +22 -0
  92. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.d.ts +7 -0
  93. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.js +13 -0
  94. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.js.map +1 -0
  95. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.d.ts +5 -0
  96. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.js +16 -0
  97. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.js.map +1 -0
  98. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js +53 -0
  99. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js.map +1 -0
  100. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js +1 -1
  101. package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.d.ts +1 -1
  102. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.d.ts +1 -1
  103. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js +12 -4
  104. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js.map +1 -1
  105. package/dist/domain.operations/genServiceSdk/asServiceSymbols/asServiceSymbols.d.ts +16 -0
  106. package/dist/domain.operations/genServiceSdk/asServiceSymbols/asServiceSymbols.js +36 -0
  107. package/dist/domain.operations/genServiceSdk/asServiceSymbols/asServiceSymbols.js.map +1 -0
  108. package/dist/domain.operations/genServiceSdk/gen.file/asBarrelFileSource.d.ts +10 -0
  109. package/dist/domain.operations/genServiceSdk/gen.file/asBarrelFileSource.js +18 -0
  110. package/dist/domain.operations/genServiceSdk/gen.file/asBarrelFileSource.js.map +1 -0
  111. package/dist/domain.operations/genServiceSdk/gen.file/asMechanismsFileSource.d.ts +14 -0
  112. package/dist/domain.operations/genServiceSdk/gen.file/asMechanismsFileSource.js +44 -0
  113. package/dist/domain.operations/genServiceSdk/gen.file/asMechanismsFileSource.js.map +1 -0
  114. package/dist/domain.operations/genServiceSdk/gen.file/asResourcesFileSource.d.ts +11 -0
  115. package/dist/domain.operations/genServiceSdk/gen.file/asResourcesFileSource.js +42 -0
  116. package/dist/domain.operations/genServiceSdk/gen.file/asResourcesFileSource.js.map +1 -0
  117. package/dist/domain.operations/genServiceSdk/gen.file/banner.d.ts +9 -0
  118. package/dist/domain.operations/genServiceSdk/gen.file/banner.js +16 -0
  119. package/dist/domain.operations/genServiceSdk/gen.file/banner.js.map +1 -0
  120. package/dist/domain.operations/genServiceSdk/gen.file/formatTypescript.d.ts +20 -0
  121. package/dist/domain.operations/genServiceSdk/gen.file/formatTypescript.js +44 -0
  122. package/dist/domain.operations/genServiceSdk/gen.file/formatTypescript.js.map +1 -0
  123. package/dist/domain.operations/genServiceSdk/gen.file/setGeneratedFilesBatch.d.ts +13 -0
  124. package/dist/domain.operations/genServiceSdk/gen.file/setGeneratedFilesBatch.js +49 -0
  125. package/dist/domain.operations/genServiceSdk/gen.file/setGeneratedFilesBatch.js.map +1 -0
  126. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.d.ts +16 -0
  127. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js +39 -0
  128. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js.map +1 -0
  129. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.d.ts +35 -0
  130. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js +189 -0
  131. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js.map +1 -0
  132. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.d.ts +15 -0
  133. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js +37 -0
  134. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js.map +1 -0
  135. package/dist/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.d.ts +26 -0
  136. package/dist/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.js +106 -0
  137. package/dist/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.js.map +1 -0
  138. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.d.ts +15 -0
  139. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js +51 -0
  140. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js.map +1 -0
  141. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.d.ts +14 -0
  142. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js +68 -0
  143. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js.map +1 -0
  144. package/dist/domain.operations/genServiceSdk/genServiceSdk.d.ts +20 -0
  145. package/dist/domain.operations/genServiceSdk/genServiceSdk.js +88 -0
  146. package/dist/domain.operations/genServiceSdk/genServiceSdk.js.map +1 -0
  147. package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.d.ts +33 -0
  148. package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.js +134 -0
  149. package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.js.map +1 -0
  150. package/dist/domain.operations/getAllLambdaContracts/lambdaContract/asContractRecord.d.ts +6 -0
  151. package/dist/domain.operations/getAllLambdaContracts/lambdaContract/asContractRecord.js +12 -0
  152. package/dist/domain.operations/getAllLambdaContracts/lambdaContract/asContractRecord.js.map +1 -0
  153. package/dist/domain.operations/getAllLambdaContracts/lambdaFunction/getAllLambdaFunctionsByPrefix.d.ts +15 -0
  154. package/dist/domain.operations/getAllLambdaContracts/lambdaFunction/getAllLambdaFunctionsByPrefix.js +44 -0
  155. package/dist/domain.operations/getAllLambdaContracts/lambdaFunction/getAllLambdaFunctionsByPrefix.js.map +1 -0
  156. package/dist/domain.operations/getAllLambdaContracts/lambdaFunction/sdkLambdaGetAllFunctions.d.ts +16 -0
  157. package/dist/domain.operations/getAllLambdaContracts/lambdaFunction/sdkLambdaGetAllFunctions.js +26 -0
  158. package/dist/domain.operations/getAllLambdaContracts/lambdaFunction/sdkLambdaGetAllFunctions.js.map +1 -0
  159. package/dist/domain.operations/getOneLambdaContract/asLambdaEndpointSchema.d.ts +16 -0
  160. package/dist/domain.operations/getOneLambdaContract/asLambdaEndpointSchema.js +76 -0
  161. package/dist/domain.operations/getOneLambdaContract/asLambdaEndpointSchema.js.map +1 -0
  162. package/dist/domain.operations/getOneLambdaContract/getOneLambdaContract.d.ts +32 -0
  163. package/dist/domain.operations/getOneLambdaContract/getOneLambdaContract.js +112 -0
  164. package/dist/domain.operations/getOneLambdaContract/getOneLambdaContract.js.map +1 -0
  165. package/dist/index.d.ts +19 -1
  166. package/dist/index.js +35 -2
  167. package/dist/index.js.map +1 -1
  168. package/package.json +19 -14
  169. package/readme.md +64 -4
  170. package/dist/domain.operations/askLambdaEndpoint/context/getAccessFromContext.d.ts +0 -11
  171. package/dist/domain.operations/askLambdaEndpoint/context/getAccessFromContext.js +0 -21
  172. package/dist/domain.operations/askLambdaEndpoint/context/getAccessFromContext.js.map +0 -1
  173. package/dist/domain.operations/askLambdaEndpoint/invoke/genLambdaClient.js.map +0 -1
  174. package/dist/domain.operations/askLambdaEndpoint/invoke/sdkLambdaInvoke.js.map +0 -1
  175. package/dist/domain.operations/askLambdaEndpoint/serde/getLambdaFunctionName.d.ts +0 -9
  176. package/dist/domain.operations/askLambdaEndpoint/serde/getLambdaFunctionName.js +0 -12
  177. package/dist/domain.operations/askLambdaEndpoint/serde/getLambdaFunctionName.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { LambdaClient } from '@aws-sdk/client-lambda';
2
2
  /**
3
- * .what = returns the injected lambda client or creates a new one
3
+ * .what = returns the injected LambdaClient or creates a new one
4
4
  * .why = named transformer for clear narrative in orchestrator
5
5
  */
6
- export declare const genLambdaClient: (input: {
6
+ export declare const genLambdaSdk: (input: {
7
7
  sdk?: LambdaClient;
8
8
  env?: {
9
9
  region?: string;
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genLambdaClient = void 0;
3
+ exports.genLambdaSdk = void 0;
4
4
  const client_lambda_1 = require("@aws-sdk/client-lambda");
5
5
  /**
6
- * .what = returns the injected lambda client or creates a new one
6
+ * .what = returns the injected LambdaClient or creates a new one
7
7
  * .why = named transformer for clear narrative in orchestrator
8
8
  */
9
- const genLambdaClient = (input) => {
10
- // return injected client if provided
9
+ const genLambdaSdk = (input) => {
10
+ // return injected LambdaClient if provided
11
11
  if (input.sdk)
12
12
  return input.sdk;
13
- // create client, let SDK infer region unless explicitly provided
13
+ // create LambdaClient, let sdk infer region unless explicitly provided
14
14
  return new client_lambda_1.LambdaClient(input.env?.region ? { region: input.env.region } : {});
15
15
  };
16
- exports.genLambdaClient = genLambdaClient;
17
- //# sourceMappingURL=genLambdaClient.js.map
16
+ exports.genLambdaSdk = genLambdaSdk;
17
+ //# sourceMappingURL=genLambdaSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genLambdaSdk.js","sourceRoot":"","sources":["../../../../src/access/sdks/lambda/genLambdaSdk.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AAEtD;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,KAG5B,EAAgB,EAAE;IACjB,2CAA2C;IAC3C,IAAI,KAAK,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC;IAEhC,uEAAuE;IACvE,OAAO,IAAI,4BAAY,CACrB,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CACtD,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,YAAY,gBAWvB"}
@@ -11,9 +11,13 @@ export interface LambdaInvokeResponse {
11
11
  /**
12
12
  * .what = invoke a lambda function via aws sdk
13
13
  * .why = communicator encapsulates raw aws sdk i/o at boundary
14
+ *
15
+ * .note = input.slug is the endpoint slug = the aws function name (wire id);
16
+ * sdkLambda (the client dependency) is injected via context
14
17
  */
15
18
  export declare const sdkLambdaInvoke: (input: {
16
- client: LambdaClient;
17
- functionName: string;
19
+ slug: string;
18
20
  payload: unknown;
21
+ }, context: {
22
+ sdkLambda: LambdaClient;
19
23
  }) => Promise<LambdaInvokeResponse>;
@@ -5,10 +5,13 @@ const client_lambda_1 = require("@aws-sdk/client-lambda");
5
5
  /**
6
6
  * .what = invoke a lambda function via aws sdk
7
7
  * .why = communicator encapsulates raw aws sdk i/o at boundary
8
+ *
9
+ * .note = input.slug is the endpoint slug = the aws function name (wire id);
10
+ * sdkLambda (the client dependency) is injected via context
8
11
  */
9
- const sdkLambdaInvoke = async (input) => {
10
- const result = await input.client.send(new client_lambda_1.InvokeCommand({
11
- FunctionName: input.functionName,
12
+ const sdkLambdaInvoke = async (input, context) => {
13
+ const result = await context.sdkLambda.send(new client_lambda_1.InvokeCommand({
14
+ FunctionName: input.slug,
12
15
  Payload: Buffer.from(JSON.stringify(input.payload)),
13
16
  }));
14
17
  return {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdkLambdaInvoke.js","sourceRoot":"","sources":["../../../../src/access/sdks/lambda/sdkLambdaInvoke.ts"],"names":[],"mappings":";;;AAAA,0DAA0E;AAY1E;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,KAAK,EAClC,KAGC,EACD,OAEC,EAC8B,EAAE;IACjC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,IAAI,CACzC,IAAI,6BAAa,CAAC;QAChB,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KACpD,CAAC,CACH,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,eAAe,mBAqB1B"}
@@ -0,0 +1,21 @@
1
+ import { type EnvironmentAccessTier } from 'sdk-environment';
2
+ /**
3
+ * .what = parse + validate the `gen` cli args into a typed, safe shape
4
+ * .why = the cli boundary must fail loud on bad input (per rule.require.failfast)
5
+ * before the orchestrator runs; a malformed invocation should never reach
6
+ * the spine
7
+ *
8
+ * .args
9
+ * --for <service> a svc-{noun} service name (required)
10
+ * --into <dir> the target directory (required)
11
+ * --env <access> the env access tier: test | prep | prod (required)
12
+ *
13
+ * .throws ConstraintError — a required arg is absent or invalid (with usage hint)
14
+ */
15
+ export declare const asGenArgs: (input: {
16
+ argv: string[];
17
+ }) => {
18
+ service: string;
19
+ into: string;
20
+ access: EnvironmentAccessTier;
21
+ };
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asGenArgs = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ const sdk_environment_1 = require("sdk-environment");
6
+ /**
7
+ * .what = parse + validate the `gen` cli args into a typed, safe shape
8
+ * .why = the cli boundary must fail loud on bad input (per rule.require.failfast)
9
+ * before the orchestrator runs; a malformed invocation should never reach
10
+ * the spine
11
+ *
12
+ * .args
13
+ * --for <service> a svc-{noun} service name (required)
14
+ * --into <dir> the target directory (required)
15
+ * --env <access> the env access tier: test | prep | prod (required)
16
+ *
17
+ * .throws ConstraintError — a required arg is absent or invalid (with usage hint)
18
+ */
19
+ const asGenArgs = (input) => {
20
+ // parse `--flag value` pairs from argv
21
+ const flags = asFlagMap(input.argv);
22
+ // --for: required, must be svc-<noun> shaped. distinguish the two faults so the
23
+ // user sees which mistake they made — absent flag vs a malformed value
24
+ const service = flags['for'];
25
+ if (!service)
26
+ return throwUsage(`--for is required; must be a svc-<noun> service name`);
27
+ if (!/^svc-[a-z0-9]+$/.test(service))
28
+ return throwUsage(`invalid --for value '${service}'; must be a svc-<noun> service name`);
29
+ // --into: required, non-empty
30
+ const into = flags['into'];
31
+ if (!into)
32
+ return throwUsage(`--into <dir> is required`);
33
+ // --env: required, must be a valid access tier
34
+ const env = flags['env'];
35
+ if (!env)
36
+ return throwUsage(`--env <test|prep|prod> is required`);
37
+ if (!(0, sdk_environment_1.isEnvironmentAccessTier)(env))
38
+ return throwUsage(`--env must be one of: test | prep | prod`);
39
+ return { service, into, access: env };
40
+ };
41
+ exports.asGenArgs = asGenArgs;
42
+ /**
43
+ * .what = collect `--flag value` pairs from an argv array into a map
44
+ * .why = a tiny hand-parse; a full arg framework is unwarranted for 3 flags
45
+ */
46
+ const asFlagMap = (argv) => {
47
+ const flags = {};
48
+ for (let i = 0; i < argv.length; i += 1) {
49
+ const token = argv[i];
50
+ if (token?.startsWith('--')) {
51
+ const key = token.slice(2);
52
+ const value = argv[i + 1];
53
+ if (value !== undefined && !value.startsWith('--')) {
54
+ flags[key] = value;
55
+ i += 1;
56
+ }
57
+ }
58
+ }
59
+ return flags;
60
+ };
61
+ /**
62
+ * .what = throw a ConstraintError with the standard usage hint
63
+ */
64
+ const throwUsage = (reason) => {
65
+ throw new helpful_errors_1.ConstraintError(reason, {
66
+ usage: 'sdk-aws-lambda gen --for svc-<noun> --into <dir> --env <test|prep|prod>',
67
+ });
68
+ };
69
+ //# sourceMappingURL=asGenArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asGenArgs.js","sourceRoot":"","sources":["../../../src/contract/cli/asGenArgs.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AACjD,qDAGyB;AAEzB;;;;;;;;;;;;GAYG;AACI,MAAM,SAAS,GAAG,CAAC,KAEzB,EAAoE,EAAE;IACrE,uCAAuC;IACvC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEpC,gFAAgF;IAChF,uEAAuE;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,OAAO;QACV,OAAO,UAAU,CAAC,sDAAsD,CAAC,CAAC;IAC5E,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC;QAClC,OAAO,UAAU,CACf,wBAAwB,OAAO,sCAAsC,CACtE,CAAC;IAEJ,8BAA8B;IAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,IAAI,CAAC,IAAI;QAAE,OAAO,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAEzD,+CAA+C;IAC/C,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACzB,IAAI,CAAC,GAAG;QAAE,OAAO,UAAU,CAAC,oCAAoC,CAAC,CAAC;IAClE,IAAI,CAAC,IAAA,yCAAuB,EAAC,GAAG,CAAC;QAC/B,OAAO,UAAU,CAAC,0CAA0C,CAAC,CAAC;IAEhE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AACxC,CAAC,CAAC;AA3BW,QAAA,SAAS,aA2BpB;AAEF;;;GAGG;AACH,MAAM,SAAS,GAAG,CAAC,IAAc,EAA0B,EAAE;IAC3D,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1B,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnD,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACnB,CAAC,IAAI,CAAC,CAAC;YACT,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,MAAc,EAAS,EAAE;IAC3C,MAAM,IAAI,gCAAe,CAAC,MAAM,EAAE;QAChC,KAAK,EACH,yEAAyE;KAC5E,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import { type ContextLogTrail } from 'sdk-logs';
3
+ import type { ContextAwsLambdaCaller } from '../../domain.objects/ContextAwsLambdaCaller';
4
+ /**
5
+ * .what = the `sdk-aws-lambda gen` cli entrypoint
6
+ * .why = generates a per-service sdk into a target dir from live introspection;
7
+ * validates args, routes --env into ambient context, and maps errors to
8
+ * semantic exit codes (0 ok / 1 malfunction / 2 constraint)
9
+ *
10
+ * .context = the caller may inject `log` (observability) + `aws` (sdk seam for
11
+ * tests); both default when absent so the bin can call `gen({ argv })`.
12
+ * `env.access` is NOT injected here — it is parsed from `--env` (the cli
13
+ * is the composition root that maps the flag into ambient access).
14
+ */
15
+ export declare const gen: (input: {
16
+ argv: string[];
17
+ }, context?: {
18
+ log?: ContextLogTrail['log'];
19
+ aws?: ContextAwsLambdaCaller['aws'];
20
+ }) => Promise<{
21
+ exit: number;
22
+ message: string | null;
23
+ }>;
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.gen = void 0;
5
+ const helpful_errors_1 = require("helpful-errors");
6
+ const sdk_logs_1 = require("sdk-logs");
7
+ const genServiceSdk_1 = require("../../domain.operations/genServiceSdk/genServiceSdk");
8
+ const asGenArgs_1 = require("./asGenArgs");
9
+ /**
10
+ * .what = the `sdk-aws-lambda gen` cli entrypoint
11
+ * .why = generates a per-service sdk into a target dir from live introspection;
12
+ * validates args, routes --env into ambient context, and maps errors to
13
+ * semantic exit codes (0 ok / 1 malfunction / 2 constraint)
14
+ *
15
+ * .context = the caller may inject `log` (observability) + `aws` (sdk seam for
16
+ * tests); both default when absent so the bin can call `gen({ argv })`.
17
+ * `env.access` is NOT injected here — it is parsed from `--env` (the cli
18
+ * is the composition root that maps the flag into ambient access).
19
+ */
20
+ const gen = async (input, context) => {
21
+ const log = context?.log ?? (0, sdk_logs_1.genContextLogTrail)({ trail: null, env: null }).log;
22
+ try {
23
+ // validate args at the boundary (throws ConstraintError → exit 2)
24
+ const args = (0, asGenArgs_1.asGenArgs)({ argv: input.argv });
25
+ // route the --env flag into ambient context.env.access, then generate
26
+ await (0, genServiceSdk_1.genServiceSdk)({ which: { service: args.service }, into: args.into }, { log, env: { access: args.access }, aws: context?.aws });
27
+ return { exit: 0, message: null };
28
+ }
29
+ catch (error) {
30
+ // caller-must-fix errors → exit 2; server/unexpected → exit 1. surface the
31
+ // message on the result (not only via log) so callers + tests can assert +
32
+ // snapshot exactly what the user sees
33
+ const exit = getExitForError({ error });
34
+ const message = error instanceof Error ? error.message : String(error);
35
+ log.error('gen failed', { exit, error: message });
36
+ return { exit, message };
37
+ }
38
+ };
39
+ exports.gen = gen;
40
+ /**
41
+ * .what = decide whether a thrown error is a caller-must-fix constraint
42
+ * .why = every codegen error class (LambdaCredentialsAbsentError,
43
+ * LambdaIntrospectionBlockedError, LambdaServiceNotFoundError,
44
+ * LambdaFunctionNotFoundError, LambdaIntrospectionNotSupportedError,
45
+ * LambdaDomainObjectNotCapturableError) extends ConstraintError, so a single
46
+ * `instanceof ConstraintError` covers them all — no per-class chain to keep in
47
+ * sync (a new Lambda*Error extends ConstraintError is caught automatically)
48
+ */
49
+ const isConstraintError = (error) => error instanceof helpful_errors_1.ConstraintError;
50
+ /**
51
+ * .what = map a thrown error to its semantic exit code
52
+ * .why = constraint errors (caller must fix) exit 2; malfunctions exit 1
53
+ */
54
+ const getExitForError = (input) => {
55
+ if (isConstraintError(input.error))
56
+ return 2;
57
+ if (input.error instanceof helpful_errors_1.MalfunctionError)
58
+ return 1;
59
+ return 1;
60
+ };
61
+ // when invoked as a bin, run + set the process exit code
62
+ /* istanbul ignore next */
63
+ if (require.main === module) {
64
+ (0, exports.gen)({ argv: process.argv.slice(2) })
65
+ .then(({ exit }) => {
66
+ process.exitCode = exit;
67
+ })
68
+ .catch(() => {
69
+ process.exitCode = 1;
70
+ });
71
+ }
72
+ //# sourceMappingURL=gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gen.js","sourceRoot":"","sources":["../../../src/contract/cli/gen.ts"],"names":[],"mappings":";;;;AAEA,mDAAmE;AACnE,uCAAoE;AAGpE,uFAAoF;AACpF,2CAAwC;AAExC;;;;;;;;;;GAUG;AACI,MAAM,GAAG,GAAG,KAAK,EACtB,KAEC,EACD,OAGC,EACkD,EAAE;IACrD,MAAM,GAAG,GACP,OAAO,EAAE,GAAG,IAAI,IAAA,6BAAkB,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC;IAErE,IAAI,CAAC;QACH,kEAAkE;QAClE,MAAM,IAAI,GAAG,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAE7C,sEAAsE;QACtE,MAAM,IAAA,6BAAa,EACjB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EACrD,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CACzD,CAAC;QAEF,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,2EAA2E;QAC3E,2EAA2E;QAC3E,sCAAsC;QACtC,MAAM,IAAI,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QAClD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC3B,CAAC;AACH,CAAC,CAAC;AAhCW,QAAA,GAAG,OAgCd;AAEF;;;;;;;;GAQG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAAc,EAAW,EAAE,CACpD,KAAK,YAAY,gCAAe,CAAC;AAEnC;;;GAGG;AACH,MAAM,eAAe,GAAG,CAAC,KAAyB,EAAU,EAAE;IAC5D,IAAI,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,KAAK,YAAY,iCAAgB;QAAE,OAAO,CAAC,CAAC;IACtD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,yDAAyD;AACzD,0BAA0B;AAC1B,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAA,WAAG,EAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;SACjC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC1B,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE;QACV,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { LambdaClient } from '@aws-sdk/client-lambda';
2
+ import type { EnvironmentAccessTier } from 'sdk-environment';
3
+ import type { ContextLogTrail } from 'sdk-logs';
4
+ /**
5
+ * .what = caller-side context to invoke lambda endpoints
6
+ * .why = the context for code that INVOKES a lambda
7
+ * (askLambdaEndpoint, getOneLambdaContract, getAllLambdaContracts share it)
8
+ *
9
+ * - log: required (extends ContextLogTrail) for trail propagation + observability
10
+ * - env: the caller's ambient runtime; access is required (no default) per
11
+ * rule.require.env-access-in-context. access is the canonical
12
+ * EnvironmentAccessTier (test | prep | prod) from sdk-environment
13
+ * - aws: injectable sdk client (dependency injection: test seams, reuse)
14
+ */
15
+ export interface ContextAwsLambdaCaller extends ContextLogTrail {
16
+ env: {
17
+ access: EnvironmentAccessTier;
18
+ region?: string;
19
+ };
20
+ aws?: {
21
+ lambda?: {
22
+ sdk?: LambdaClient;
23
+ };
24
+ };
25
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ContextAwsLambdaCaller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextAwsLambdaCaller.js","sourceRoot":"","sources":["../../src/domain.objects/ContextAwsLambdaCaller.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import type { EnvironmentAccessTier } from 'sdk-environment';
2
+ import type { LogMethods } from 'sdk-logs';
3
+ /**
4
+ * .what = env access level for the introspection gate
5
+ * .why = constrains a handler's declared access to valid values; the canonical
6
+ * access tier from sdk-environment (test | prep | prod)
7
+ */
8
+ export type EnvAccess = EnvironmentAccessTier;
9
+ /**
10
+ * .what = handler env config — static or async access extraction
11
+ * .why = a deployed handler declares its own access (sync or via async lookup)
12
+ * so the introspection middleware can gate on env.access === 'prep'
13
+ */
14
+ export type EnvConfig = {
15
+ access: EnvAccess;
16
+ } | (() => Promise<{
17
+ access: EnvAccess;
18
+ }>);
19
+ /**
20
+ * .what = server-side context for lambda handler generators
21
+ * .why = the context for code that DEFINES a lambda handler
22
+ * (genLambdaEndpoint, forApiGateway, and future forXyz variants share it)
23
+ *
24
+ * - env: the handler declares its own access for the introspection gate
25
+ * - log: optional gen-time override; the trail middleware injects log at runtime
26
+ */
27
+ export interface ContextAwsLambdaServer {
28
+ env?: EnvConfig;
29
+ log?: LogMethods;
30
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ContextAwsLambdaServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextAwsLambdaServer.js","sourceRoot":"","sources":["../../src/domain.objects/ContextAwsLambdaServer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { DomainLiteral, type DomainObjectKind } from 'domain-objects';
2
+ import type { JSONSchema } from 'zod/v4/core/json-schema';
3
+ /**
4
+ * .what = a domain-object captured from an introspected `x-domain-object` pragma,
5
+ * normalized for emit (the raw domain-objects `DomainObjectPragma` fields +
6
+ * the json-schema `shape`, with the key-fields defaulted)
7
+ * .why = parse the wire pragma once at the boundary into a structured value; all
8
+ * downstream ops speak in this instead of a re-read of the raw json
9
+ *
10
+ * .kind = which base class the upstream dobj extended (from the pragma's stamped
11
+ * `kind`); governs which base class asResourceClassSource emits
12
+ */
13
+ export interface DomainObjectCaptured {
14
+ /**
15
+ * .what = the upstream domain-object's unqualified class name (e.g. 'Job')
16
+ * .why = the codegen prefixes this with the service (e.g. 'SvcJobsJob')
17
+ */
18
+ name: string;
19
+ /**
20
+ * .what = which base class the upstream dobj extended (entity/literal/event/object)
21
+ * .why = the codegen emits the base class this maps to
22
+ */
23
+ kind: DomainObjectKind;
24
+ /**
25
+ * .what = the primary key parts (artificial/serialized key), if any
26
+ */
27
+ primary: string[];
28
+ /**
29
+ * .what = the unique key parts (natural key), if any
30
+ */
31
+ unique: string[];
32
+ /**
33
+ * .what = the colloquial alias, if declared upstream
34
+ */
35
+ alias: null | string | {
36
+ singular?: string;
37
+ plural?: string;
38
+ };
39
+ /**
40
+ * .what = map of nested-property name → nested dobj type name(s), unprefixed
41
+ * .why = the codegen prefixes each nested type name with the service; a value
42
+ * is an array when the nested position is polymorphic (choice of dobjs)
43
+ */
44
+ nested: Record<string, string | string[]>;
45
+ /**
46
+ * .what = the json-schema shape of the dobj (for TS type emit)
47
+ */
48
+ shape: JSONSchema;
49
+ }
50
+ export declare class DomainObjectCaptured extends DomainLiteral<DomainObjectCaptured> implements DomainObjectCaptured {
51
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DomainObjectCaptured = void 0;
4
+ const domain_objects_1 = require("domain-objects");
5
+ class DomainObjectCaptured extends domain_objects_1.DomainLiteral {
6
+ }
7
+ exports.DomainObjectCaptured = DomainObjectCaptured;
8
+ //# sourceMappingURL=DomainObjectCaptured.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DomainObjectCaptured.js","sourceRoot":"","sources":["../../src/domain.objects/DomainObjectCaptured.ts"],"names":[],"mappings":";;;AAAA,mDAAsE;AAsDtE,MAAa,oBACX,SAAQ,8BAAmC;CACT;AAFpC,oDAEoC"}
@@ -0,0 +1,18 @@
1
+ import { DomainLiteral } from 'domain-objects';
2
+ /**
3
+ * .what = one file the codegen will emit (path + content)
4
+ * .why = the emit boundary speaks in a named domain literal, not raw tuples;
5
+ * the batch communicator writes a list of these atomically
6
+ */
7
+ export interface GeneratedFile {
8
+ /**
9
+ * .what = the absolute-or-relative path the file will be written to
10
+ */
11
+ path: string;
12
+ /**
13
+ * .what = the full text content of the file (already formatted)
14
+ */
15
+ content: string;
16
+ }
17
+ export declare class GeneratedFile extends DomainLiteral<GeneratedFile> implements GeneratedFile {
18
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeneratedFile = void 0;
4
+ const domain_objects_1 = require("domain-objects");
5
+ class GeneratedFile extends domain_objects_1.DomainLiteral {
6
+ }
7
+ exports.GeneratedFile = GeneratedFile;
8
+ //# sourceMappingURL=GeneratedFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneratedFile.js","sourceRoot":"","sources":["../../src/domain.objects/GeneratedFile.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAmB/C,MAAa,aACX,SAAQ,8BAA4B;CACT;AAF7B,sCAE6B"}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * .what = HTTP status codes enum
3
- * .why = provides typed status codes for API responses
2
+ * .what = http status codes enum
3
+ * .why = provides typed status codes for api responses
4
4
  *
5
5
  * ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
6
6
  */
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpStatusCode = void 0;
4
4
  /**
5
- * .what = HTTP status codes enum
6
- * .why = provides typed status codes for API responses
5
+ * .what = http status codes enum
6
+ * .why = provides typed status codes for api responses
7
7
  *
8
8
  * ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
9
9
  */
@@ -18,7 +18,7 @@ var HttpStatusCode;
18
18
  HttpStatusCode[HttpStatusCode["MOVED_PERMANENTLY_301"] = 301] = "MOVED_PERMANENTLY_301";
19
19
  HttpStatusCode[HttpStatusCode["FOUND_302"] = 302] = "FOUND_302";
20
20
  HttpStatusCode[HttpStatusCode["NOT_MODIFIED_304"] = 304] = "NOT_MODIFIED_304";
21
- // client error
21
+ // caller error
22
22
  HttpStatusCode[HttpStatusCode["BAD_REQUEST_400"] = 400] = "BAD_REQUEST_400";
23
23
  HttpStatusCode[HttpStatusCode["UNAUTHORIZED_401"] = 401] = "UNAUTHORIZED_401";
24
24
  HttpStatusCode[HttpStatusCode["FORBIDDEN_403"] = 403] = "FORBIDDEN_403";
@@ -0,0 +1,11 @@
1
+ import { ConstraintError } from 'helpful-errors';
2
+ /**
3
+ * .what = error when the aws sdk cannot load credentials for introspection
4
+ * .why = a clear, caller-must-fix error (with an unlock hint) instead of a raw
5
+ * aws CredentialsProviderError; introspection needs live prep creds
6
+ *
7
+ * .note = bare subclass per helpful-errors convention; pass message + metadata
8
+ * at the throw site via `new LambdaCredentialsAbsentError(message, { ... })`
9
+ */
10
+ export declare class LambdaCredentialsAbsentError extends ConstraintError {
11
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LambdaCredentialsAbsentError = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ /**
6
+ * .what = error when the aws sdk cannot load credentials for introspection
7
+ * .why = a clear, caller-must-fix error (with an unlock hint) instead of a raw
8
+ * aws CredentialsProviderError; introspection needs live prep creds
9
+ *
10
+ * .note = bare subclass per helpful-errors convention; pass message + metadata
11
+ * at the throw site via `new LambdaCredentialsAbsentError(message, { ... })`
12
+ */
13
+ class LambdaCredentialsAbsentError extends helpful_errors_1.ConstraintError {
14
+ }
15
+ exports.LambdaCredentialsAbsentError = LambdaCredentialsAbsentError;
16
+ //# sourceMappingURL=LambdaCredentialsAbsentError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LambdaCredentialsAbsentError.js","sourceRoot":"","sources":["../../src/domain.objects/LambdaCredentialsAbsentError.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAEjD;;;;;;;GAOG;AACH,MAAa,4BAA6B,SAAQ,gCAAe;CAAG;AAApE,oEAAoE"}
@@ -0,0 +1,12 @@
1
+ import { ConstraintError } from 'helpful-errors';
2
+ /**
3
+ * .what = error when a contract-surfaced domain-object cannot be captured
4
+ * .why = a dobj referenced by an endpoint that declares no `static schema` has no
5
+ * shape to reconstruct; fail loud and name the dobj (uc.9) rather than
6
+ * silently drop it
7
+ *
8
+ * .note = bare subclass per helpful-errors convention; pass message + metadata
9
+ * at the throw site via `new LambdaDomainObjectNotCapturableError(message, { ... })`
10
+ */
11
+ export declare class LambdaDomainObjectNotCapturableError extends ConstraintError {
12
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LambdaDomainObjectNotCapturableError = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ /**
6
+ * .what = error when a contract-surfaced domain-object cannot be captured
7
+ * .why = a dobj referenced by an endpoint that declares no `static schema` has no
8
+ * shape to reconstruct; fail loud and name the dobj (uc.9) rather than
9
+ * silently drop it
10
+ *
11
+ * .note = bare subclass per helpful-errors convention; pass message + metadata
12
+ * at the throw site via `new LambdaDomainObjectNotCapturableError(message, { ... })`
13
+ */
14
+ class LambdaDomainObjectNotCapturableError extends helpful_errors_1.ConstraintError {
15
+ }
16
+ exports.LambdaDomainObjectNotCapturableError = LambdaDomainObjectNotCapturableError;
17
+ //# sourceMappingURL=LambdaDomainObjectNotCapturableError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LambdaDomainObjectNotCapturableError.js","sourceRoot":"","sources":["../../src/domain.objects/LambdaDomainObjectNotCapturableError.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAEjD;;;;;;;;GAQG;AACH,MAAa,oCAAqC,SAAQ,gCAAe;CAAG;AAA5E,oFAA4E"}
@@ -0,0 +1,14 @@
1
+ import { ConstraintError } from 'helpful-errors';
2
+ /**
3
+ * .what = error when a domain-object REFERENCE names a dobj that is not captured in
4
+ * full anywhere in the service's contracts, so the generated `typeof
5
+ * Svc<Prefix><Name>` cannot bind
6
+ * .why = a ref emits `RefByPrimary<typeof SvcSurfSeaturtle>`; that resource must
7
+ * exist. if no endpoint surfaces the referenced dobj whole, the generated sdk
8
+ * would not compile — fail loud (caller must surface the dobj on an endpoint)
9
+ *
10
+ * .note = bare subclass per helpful-errors convention; pass message + metadata at
11
+ * the throw site via `new LambdaDomainObjectRefUnbindableError(message, { ... })`
12
+ */
13
+ export declare class LambdaDomainObjectRefUnbindableError extends ConstraintError {
14
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LambdaDomainObjectRefUnbindableError = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ /**
6
+ * .what = error when a domain-object REFERENCE names a dobj that is not captured in
7
+ * full anywhere in the service's contracts, so the generated `typeof
8
+ * Svc<Prefix><Name>` cannot bind
9
+ * .why = a ref emits `RefByPrimary<typeof SvcSurfSeaturtle>`; that resource must
10
+ * exist. if no endpoint surfaces the referenced dobj whole, the generated sdk
11
+ * would not compile — fail loud (caller must surface the dobj on an endpoint)
12
+ *
13
+ * .note = bare subclass per helpful-errors convention; pass message + metadata at
14
+ * the throw site via `new LambdaDomainObjectRefUnbindableError(message, { ... })`
15
+ */
16
+ class LambdaDomainObjectRefUnbindableError extends helpful_errors_1.ConstraintError {
17
+ }
18
+ exports.LambdaDomainObjectRefUnbindableError = LambdaDomainObjectRefUnbindableError;
19
+ //# sourceMappingURL=LambdaDomainObjectRefUnbindableError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LambdaDomainObjectRefUnbindableError.js","sourceRoot":"","sources":["../../src/domain.objects/LambdaDomainObjectRefUnbindableError.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAEjD;;;;;;;;;;GAUG;AACH,MAAa,oCAAqC,SAAQ,gCAAe;CAAG;AAA5E,oFAA4E"}
@@ -0,0 +1,35 @@
1
+ import { DomainEntity } from 'domain-objects';
2
+ /**
3
+ * .what = the domain entity for a callable lambda endpoint
4
+ * .why = a single ubiquitous concept to address a lambda, instead of a flat
5
+ * functionName string + loose service/function fields
6
+ *
7
+ * .keys
8
+ * - primary = ['slug'] — serialized natural key; also the aws function name
9
+ * - unique = ['service', 'access', 'function'] — the natural key
10
+ *
11
+ * .slug = '{service}-{access}-{function}' e.g. 'svc-invoice-prep-getInvoice'
12
+ */
13
+ export interface LambdaEndpoint {
14
+ /**
15
+ * .what = the owner service, in svc-$noun form
16
+ */
17
+ service: string;
18
+ /**
19
+ * .what = the env access level (test | prep | prod)
20
+ */
21
+ access: string;
22
+ /**
23
+ * .what = the function (the "bare" name, no service/access prefix)
24
+ */
25
+ function: string;
26
+ /**
27
+ * .what = the serialized key '{service}-{access}-{function}'
28
+ * .why = the aws lambda function name; doubles as the wire identifier
29
+ */
30
+ slug: string;
31
+ }
32
+ export declare class LambdaEndpoint extends DomainEntity<LambdaEndpoint> implements LambdaEndpoint {
33
+ static primary: readonly ["slug"];
34
+ static unique: readonly ["service", "access", "function"];
35
+ }