sdk-aws-lambda 0.8.0 → 0.8.2
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/dist/access/sdks/lambda/genLambdaSdk.js.map +1 -1
- package/dist/access/sdks/lambda/sdkLambdaInvoke.js.map +1 -1
- package/dist/contract/cli/asGenArgs.js.map +1 -1
- package/dist/contract/cli/gen.js.map +1 -1
- package/dist/domain.objects/DomainObjectCaptured.d.ts +3 -1
- package/dist/domain.objects/DomainObjectCaptured.js.map +1 -1
- package/dist/domain.objects/GeneratedFile.js.map +1 -1
- package/dist/domain.objects/HttpStatusCode.js.map +1 -1
- package/dist/domain.objects/LambdaCredentialsAbsentError.js.map +1 -1
- package/dist/domain.objects/LambdaDomainObjectNotCapturableError.js.map +1 -1
- package/dist/domain.objects/LambdaDomainObjectRefUnbindableError.js.map +1 -1
- package/dist/domain.objects/LambdaEndpoint.d.ts +2 -2
- package/dist/domain.objects/LambdaEndpoint.js.map +1 -1
- package/dist/domain.objects/LambdaEndpointError.d.ts +1 -1
- package/dist/domain.objects/LambdaEndpointError.js.map +1 -1
- package/dist/domain.objects/LambdaEndpointErrorResponseBody.d.ts +2 -2
- package/dist/domain.objects/LambdaEndpointErrorResponseBody.js.map +1 -1
- package/dist/domain.objects/LambdaEndpointRefusal.d.ts +25 -0
- package/dist/domain.objects/LambdaEndpointRefusal.js +19 -0
- package/dist/domain.objects/LambdaEndpointRefusal.js.map +1 -0
- package/dist/domain.objects/LambdaEndpointRefusedError.d.ts +25 -0
- package/dist/domain.objects/LambdaEndpointRefusedError.js +28 -0
- package/dist/domain.objects/LambdaEndpointRefusedError.js.map +1 -0
- package/dist/domain.objects/LambdaEndpointSchema.d.ts +3 -1
- package/dist/domain.objects/LambdaEventSchemaSource.d.ts +1 -1
- package/dist/domain.objects/LambdaFunctionNotFoundError.js.map +1 -1
- package/dist/domain.objects/LambdaIntrospectionBlockedError.js.map +1 -1
- package/dist/domain.objects/LambdaIntrospectionNotSupportedError.js.map +1 -1
- package/dist/domain.objects/LambdaServiceNotFoundError.js.map +1 -1
- package/dist/domain.objects/TrailExidHeader.d.ts +1 -1
- package/dist/domain.operations/asLambdaEndpoint/asLambdaEndpoint.js.map +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.asExampleUuid.js.map +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.constants.d.ts +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.constants.js +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.constants.js.map +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.d.ts +10 -36
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromApiGateway.js +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromApiGateway.js.map +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromKinesis.js.map +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromS3.js.map +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromSns.js.map +1 -1
- package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromSqs.js.map +1 -1
- package/dist/domain.operations/asLambdaEventSchema/asLambdaEventPayloadSchema.js +1 -1
- package/dist/domain.operations/asLambdaEventSchema/asLambdaEventPayloadSchema.js.map +1 -1
- package/dist/domain.operations/asLambdaEventSchema/asLambdaEventSchema.fromKinesis.js +2 -2
- package/dist/domain.operations/asLambdaEventSchema/asLambdaEventSchema.fromKinesis.js.map +1 -1
- package/dist/domain.operations/asLambdaEventSchema/asLambdaEventSchema.fromSns.js +2 -2
- package/dist/domain.operations/asLambdaEventSchema/asLambdaEventSchema.fromSns.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.d.ts +4 -41
- package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaApiGateway.d.ts +11 -2
- package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaApiGateway.js +8 -3
- package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaApiGateway.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaInvoke.d.ts +10 -0
- package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaInvoke.js +19 -7
- package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaInvoke.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/cache/asAskLambdaCacheKeyOfRefusal.d.ts +17 -0
- package/dist/domain.operations/askLambdaEndpoint/cache/asAskLambdaCacheKeyOfRefusal.js +22 -0
- package/dist/domain.operations/askLambdaEndpoint/cache/asAskLambdaCacheKeyOfRefusal.js.map +1 -0
- package/dist/domain.operations/askLambdaEndpoint/cache/asCacheWithoutSet.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/cache/asCachedExecutor.d.ts +1 -1
- package/dist/domain.operations/askLambdaEndpoint/cache/asCachedExecutor.js +1 -1
- package/dist/domain.operations/askLambdaEndpoint/cache/asCachedExecutor.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/error/getStatusCodeHint.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/invoke/executeHttpRequest.d.ts +1 -1
- package/dist/domain.operations/askLambdaEndpoint/invoke/executeHttpRequest.js +1 -1
- package/dist/domain.operations/askLambdaEndpoint/invoke/executeHttpRequest.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.d.ts +2 -0
- package/dist/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.js +3 -2
- package/dist/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/asErrorFromHttpResponse.d.ts +9 -5
- package/dist/domain.operations/askLambdaEndpoint/serde/asErrorFromHttpResponse.js +29 -11
- package/dist/domain.operations/askLambdaEndpoint/serde/asErrorFromHttpResponse.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/asHeadersRecord.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/asHttpMethod.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/asHttpRequestBody.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/asHttpRequestHeaders.js +2 -2
- package/dist/domain.operations/askLambdaEndpoint/serde/asHttpRequestHeaders.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/asLambdaEndpointRefusal.d.ts +15 -0
- package/dist/domain.operations/askLambdaEndpoint/serde/asLambdaEndpointRefusal.js +43 -0
- package/dist/domain.operations/askLambdaEndpoint/serde/asLambdaEndpointRefusal.js.map +1 -0
- package/dist/domain.operations/askLambdaEndpoint/serde/getIsHttpThrottle.d.ts +11 -0
- package/dist/domain.operations/askLambdaEndpoint/serde/getIsHttpThrottle.js +15 -0
- package/dist/domain.operations/askLambdaEndpoint/serde/getIsHttpThrottle.js.map +1 -0
- package/dist/domain.operations/askLambdaEndpoint/serde/getLambdaPayload.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/getOneBodyFromHttpText.js +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/getOneBodyFromHttpText.js.map +1 -1
- package/dist/domain.operations/askLambdaEndpoint/serde/getOneCorrelationIdFromBody.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/asContextLogTrail.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.d.ts +6 -4
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwireJson.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asCorsHeadersWithTrail.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.d.ts +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js +9 -9
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllResponseOnwireKeysFound.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getCorsOrigin.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV1ApiGatewayRequestEvent.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayRequestEvent.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware.js +2 -2
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.d.ts +15 -2
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.js +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.d.ts +2 -2
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.js +9 -9
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genLambdaEventRefusedLogMiddleware.js +3 -3
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genLambdaEventRefusedLogMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.js +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/getAllLambdaEventIds.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/logLambdaEventRefused.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsBatchResponse.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordIds.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.d.ts +4 -2
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.d.ts +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.js +3 -3
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.d.ts +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.js +4 -4
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.d.ts +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.js +3 -3
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getAllSqsIdsRetried.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getAllSqsIdsUnclaimable.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getAllSqsSuccessRefsMalformed.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/isSqsSuccessRef.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/logSqsRecordInvalid.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/logSqsRecordRefused.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.js +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordsValidated.js +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordsValidated.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/asCallerFault.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/asContextTrailed.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/asLogMethodOfFailure.d.ts +17 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/asLogMethodOfFailure.js +26 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/asLogMethodOfFailure.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js +2 -2
- package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.d.ts +4 -2
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.d.ts +16 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js +34 -13
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js +2 -2
- package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getIsConstraintError.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getIsFrozenMutatorRefusal.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getUnwrappedEventWithExid.d.ts +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getUnwrappedEventWithExid.js +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getUnwrappedEventWithExid.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/asServiceSymbols/asServiceSymbols.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.file/asBarrelFileSource.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.file/asMechanismsFileSource.js +2 -2
- package/dist/domain.operations/genServiceSdk/gen.file/asMechanismsFileSource.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.file/asResourcesFileSource.js +2 -2
- package/dist/domain.operations/genServiceSdk/gen.file/asResourcesFileSource.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.file/formatTypescript.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.file/setGeneratedFilesBatch.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.d.ts +2 -0
- package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js +8 -4
- package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.d.ts +3 -1
- package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js +1 -1
- package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.d.ts +3 -1
- package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.js +1 -1
- package/dist/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js +1 -1
- package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js +1 -1
- package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/genServiceSdk.js +1 -1
- package/dist/domain.operations/genServiceSdk/genServiceSdk.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/getAllJsonSchemaNodes.js.map +1 -1
- package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.js +5 -27
- package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.js.map +1 -1
- package/dist/domain.operations/getAllLambdaContracts/lambdaContract/asContractRecord.js.map +1 -1
- package/dist/domain.operations/getAllLambdaContracts/lambdaFunction/getAllLambdaFunctionsByPrefix.js.map +1 -1
- package/dist/domain.operations/getAllLambdaContracts/lambdaFunction/sdkLambdaGetAllFunctions.js.map +1 -1
- package/dist/domain.operations/getOneLambdaContract/asLambdaEndpointSchema.js.map +1 -1
- package/dist/domain.operations/getOneLambdaContract/getOneLambdaContract.js +3 -25
- package/dist/domain.operations/getOneLambdaContract/getOneLambdaContract.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/context/getExidFromContext.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/context/getLogForExidExtraction.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/context/getOneTrailExid.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/error/asErrorFromPeerRefusal.d.ts +22 -0
- package/dist/domain.operations/lambdaEndpointWire/error/asErrorFromPeerRefusal.js +34 -0
- package/dist/domain.operations/lambdaEndpointWire/error/asErrorFromPeerRefusal.js.map +1 -0
- package/dist/domain.operations/lambdaEndpointWire/error/getIsContempErrorTagged.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/error/getIsLambdaErrorResponse.d.ts +1 -1
- package/dist/domain.operations/lambdaEndpointWire/error/getIsLambdaErrorResponse.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/error/getLambdaErrorMetadata.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/error/getStackTraceString.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/error/throwIfCredentialsError.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/asHeadersWithoutKey.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/asTrailExidHeaders.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/getIsWrappedPayload.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/getOneLambdaEventSchemaSource.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/getOneTrailCarrierOfEvent.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/getOneTrailCarrierOfHandler.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/getOneTrailExidFromHeaders.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/isEventDeclaredAsApiGateway.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/isTrailExid.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/isTrailExidHeaderMalformed.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/setEventDeclaredAsApiGateway.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/setHandlerTrailCarrier.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/frame/setLambdaEventSchemaSource.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/getParsedResponse.d.ts +15 -4
- package/dist/domain.operations/lambdaEndpointWire/getParsedResponse.js +32 -17
- package/dist/domain.operations/lambdaEndpointWire/getParsedResponse.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/serde/asUnprefixedErrorMessage.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/serde/getDecodedPayload.js.map +1 -1
- package/dist/domain.operations/lambdaEndpointWire/serde/getParsedJson.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/context/asLambdaContext.d.ts +1 -1
- package/dist/domain.operations/runLambdaEndpoint/context/asLambdaContext.js +1 -1
- package/dist/domain.operations/runLambdaEndpoint/context/asLambdaContext.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointDialect.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointOutput.d.ts +2 -1
- package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointOutput.js +2 -1
- package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointOutput.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/dialect/isLambdaEndpointErrorEnvelope.d.ts +1 -1
- package/dist/domain.operations/runLambdaEndpoint/dialect/isLambdaEndpointErrorEnvelope.js +1 -1
- package/dist/domain.operations/runLambdaEndpoint/dialect/isLambdaEndpointErrorEnvelope.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/error/isErrorLike.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/guard/assertEventIsGiven.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/guard/assertHandlerIsRunnable.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/local/asLocalRunIdentity.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/local/getOneHandlerFromServerlessYml.js +19 -30
- package/dist/domain.operations/runLambdaEndpoint/local/getOneHandlerFromServerlessYml.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.d.ts +4 -23
- package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onReferenced.d.ts +1 -1
- package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onReferenced.js +2 -2
- package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onReferenced.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onSerialized.js +18 -6
- package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onSerialized.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/asCarriedPayload.js +3 -3
- package/dist/domain.operations/runLambdaEndpoint/serde/asCarriedPayload.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/asErrorTypeOfErrorLike.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/asFramedPayload.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/asWireFunctionErrorPayload.js +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/asWireFunctionErrorPayload.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/asWirePayload.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/asWireStripped.js +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/asWireStripped.js.map +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/getOneTrailWithExid.js +1 -1
- package/dist/domain.operations/runLambdaEndpoint/serde/getOneTrailWithExid.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +53 -32
- package/readme.md +42 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { viaApiGateway } from './askLambdaEndpoint.viaApiGateway';
|
|
1
2
|
import { viaInvoke } from './askLambdaEndpoint.viaInvoke';
|
|
2
3
|
/**
|
|
3
4
|
* .what = the `askLambdaEndpoint` family — every road a caller takes to an endpoint, under one name
|
|
@@ -14,47 +15,9 @@ import { viaInvoke } from './askLambdaEndpoint.viaInvoke';
|
|
|
14
15
|
* compatibility: a family that had shipped no bare name would be a plain object, as
|
|
15
16
|
* `genLambdaEndpoint` is
|
|
16
17
|
*/
|
|
17
|
-
export declare const askLambdaEndpoint:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function: string;
|
|
21
|
-
};
|
|
22
|
-
event: TRequest;
|
|
23
|
-
struct?: {
|
|
24
|
-
payload?: import("../..").LambdaEndpointDialect | undefined;
|
|
25
|
-
} | undefined;
|
|
26
|
-
}, context: import("../..").ContextAwsLambdaCaller & {
|
|
27
|
-
cache?: {
|
|
28
|
-
response?: import("with-simple-cache").SimpleCache<TResponse> | undefined;
|
|
29
|
-
dedupe?: import("simple-in-memory-cache").SimpleInMemoryCache<TResponse> | undefined;
|
|
30
|
-
} | undefined;
|
|
31
|
-
}) => Promise<TResponse>) & {
|
|
32
|
-
viaInvoke: <TRequest, TResponse>(input: {
|
|
33
|
-
which: {
|
|
34
|
-
service: string;
|
|
35
|
-
function: string;
|
|
36
|
-
};
|
|
37
|
-
event: TRequest;
|
|
38
|
-
struct?: {
|
|
39
|
-
payload?: import("../..").LambdaEndpointDialect | undefined;
|
|
40
|
-
} | undefined;
|
|
41
|
-
}, context: import("../..").ContextAwsLambdaCaller & {
|
|
42
|
-
cache?: {
|
|
43
|
-
response?: import("with-simple-cache").SimpleCache<TResponse> | undefined;
|
|
44
|
-
dedupe?: import("simple-in-memory-cache").SimpleInMemoryCache<TResponse> | undefined;
|
|
45
|
-
} | undefined;
|
|
46
|
-
}) => Promise<TResponse>;
|
|
47
|
-
viaApiGateway: <TResponse_1 = unknown>(input: {
|
|
48
|
-
url: string;
|
|
49
|
-
method?: string | undefined;
|
|
50
|
-
headers?: Record<string, string> | undefined;
|
|
51
|
-
body?: unknown;
|
|
52
|
-
}, context: import("sdk-logs").ContextLogTrail) => Promise<{
|
|
53
|
-
status: number;
|
|
54
|
-
headers: Record<string, string>;
|
|
55
|
-
text: string;
|
|
56
|
-
body: TResponse_1 | null;
|
|
57
|
-
}>;
|
|
18
|
+
export declare const askLambdaEndpoint: typeof viaInvoke & {
|
|
19
|
+
viaInvoke: typeof viaInvoke;
|
|
20
|
+
viaApiGateway: typeof viaApiGateway;
|
|
58
21
|
};
|
|
59
22
|
/**
|
|
60
23
|
* .what = input type for askLambdaEndpoint
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { ContextLogTrail } from 'sdk-logs';
|
|
2
|
+
import type { LambdaEndpointRefusal } from '../../domain.objects/LambdaEndpointRefusal';
|
|
2
3
|
/**
|
|
3
4
|
* .what = asks an api gateway endpoint over http, opted into the contemp dialect with the caller's trail
|
|
4
5
|
* .why = an aws-delivered event cannot hold a `{ event, trail }` wrapper, so the opt-in and the
|
|
5
6
|
* trail ride the request's own `x-trail-exid` header. this sends it, and casts a fault back
|
|
6
|
-
* into the throw `askLambdaEndpoint` gives, so one catch block serves both roads
|
|
7
|
+
* into the throw `askLambdaEndpoint` gives, so one catch block for a refusal serves both roads
|
|
7
8
|
* (`invariant.ancient-vs-contemp-callers.md`, `domain.terms/x-trail-exid.md`)
|
|
8
9
|
*
|
|
9
10
|
* | answer | the caller gets |
|
|
10
11
|
* |--------|-----------------|
|
|
11
12
|
* | < 400 | `{ status, headers, text, body }` — `body` is the json, or null where the answer has none |
|
|
12
|
-
* | 4xx | a thrown `ConstraintError`, with the endpoint's message |
|
|
13
|
+
* | 4xx, save 429 | a thrown `LambdaEndpointRefusedError` (or `ConstraintError`, with `refusal: { as: 'ConstraintError' }`), with the endpoint's message |
|
|
14
|
+
* | 429 | a thrown `MalfunctionError` under either opt: a throttle, not a refusal; `retry-after` rides `metadata.headers` |
|
|
13
15
|
* | 5xx | a thrown `MalfunctionError`, with the `correlationId` that finds the log line |
|
|
14
16
|
*
|
|
15
17
|
* .note = takes the standard http request — `{ url, method, headers, body }` — as fetch does, and
|
|
@@ -27,6 +29,13 @@ export declare const viaApiGateway: <TResponse = unknown>(input: {
|
|
|
27
29
|
method?: string;
|
|
28
30
|
headers?: Record<string, string>;
|
|
29
31
|
body?: unknown;
|
|
32
|
+
/**
|
|
33
|
+
* .what = the class a 4xx answer is thrown as (a 429 excepted: it is a throttle, a `MalfunctionError`)
|
|
34
|
+
* .why = this caller composed the request, so by default a refusal is this caller's own
|
|
35
|
+
* malfunction, as on the invoke road
|
|
36
|
+
* .default = { as: 'LambdaEndpointRefusedError' }
|
|
37
|
+
*/
|
|
38
|
+
refusal?: LambdaEndpointRefusal;
|
|
30
39
|
}, context: ContextLogTrail) => Promise<{
|
|
31
40
|
status: number;
|
|
32
41
|
headers: Record<string, string>;
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.viaApiGateway = void 0;
|
|
4
|
-
const getOneTrailExid_1 = require("
|
|
4
|
+
const getOneTrailExid_1 = require("../../domain.operations/lambdaEndpointWire/context/getOneTrailExid");
|
|
5
5
|
const executeHttpRequest_1 = require("./invoke/executeHttpRequest");
|
|
6
6
|
const asErrorFromHttpResponse_1 = require("./serde/asErrorFromHttpResponse");
|
|
7
7
|
const asHeadersRecord_1 = require("./serde/asHeadersRecord");
|
|
8
8
|
const asHttpMethod_1 = require("./serde/asHttpMethod");
|
|
9
9
|
const asHttpRequestBody_1 = require("./serde/asHttpRequestBody");
|
|
10
10
|
const asHttpRequestHeaders_1 = require("./serde/asHttpRequestHeaders");
|
|
11
|
+
const asLambdaEndpointRefusal_1 = require("./serde/asLambdaEndpointRefusal");
|
|
11
12
|
const getOneBodyFromHttpText_1 = require("./serde/getOneBodyFromHttpText");
|
|
12
13
|
/**
|
|
13
14
|
* .what = asks an api gateway endpoint over http, opted into the contemp dialect with the caller's trail
|
|
14
15
|
* .why = an aws-delivered event cannot hold a `{ event, trail }` wrapper, so the opt-in and the
|
|
15
16
|
* trail ride the request's own `x-trail-exid` header. this sends it, and casts a fault back
|
|
16
|
-
* into the throw `askLambdaEndpoint` gives, so one catch block serves both roads
|
|
17
|
+
* into the throw `askLambdaEndpoint` gives, so one catch block for a refusal serves both roads
|
|
17
18
|
* (`invariant.ancient-vs-contemp-callers.md`, `domain.terms/x-trail-exid.md`)
|
|
18
19
|
*
|
|
19
20
|
* | answer | the caller gets |
|
|
20
21
|
* |--------|-----------------|
|
|
21
22
|
* | < 400 | `{ status, headers, text, body }` — `body` is the json, or null where the answer has none |
|
|
22
|
-
* | 4xx | a thrown `ConstraintError`, with the endpoint's message |
|
|
23
|
+
* | 4xx, save 429 | a thrown `LambdaEndpointRefusedError` (or `ConstraintError`, with `refusal: { as: 'ConstraintError' }`), with the endpoint's message |
|
|
24
|
+
* | 429 | a thrown `MalfunctionError` under either opt: a throttle, not a refusal; `retry-after` rides `metadata.headers` |
|
|
23
25
|
* | 5xx | a thrown `MalfunctionError`, with the `correlationId` that finds the log line |
|
|
24
26
|
*
|
|
25
27
|
* .note = takes the standard http request — `{ url, method, headers, body }` — as fetch does, and
|
|
@@ -33,6 +35,8 @@ const getOneBodyFromHttpText_1 = require("./serde/getOneBodyFromHttpText");
|
|
|
33
35
|
* dependency, and sets no timeout: fetch waits as long as the endpoint does
|
|
34
36
|
*/
|
|
35
37
|
const viaApiGateway = async (input, context) => {
|
|
38
|
+
// refuse an unknown refusal opt before any request is sent
|
|
39
|
+
const refusal = (0, asLambdaEndpointRefusal_1.asLambdaEndpointRefusal)({ declared: input.refusal });
|
|
36
40
|
// the caller's exid, or a generated one — the same call `askLambdaEndpoint` makes
|
|
37
41
|
const exid = (0, getOneTrailExid_1.getOneTrailExid)({ log: context.log });
|
|
38
42
|
// send the request, opted in by the trail header
|
|
@@ -60,6 +64,7 @@ const viaApiGateway = async (input, context) => {
|
|
|
60
64
|
headers,
|
|
61
65
|
url: input.url,
|
|
62
66
|
exid,
|
|
67
|
+
refusal,
|
|
63
68
|
});
|
|
64
69
|
if (error)
|
|
65
70
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"askLambdaEndpoint.viaApiGateway.js","sourceRoot":"","sources":["../../../src/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaApiGateway.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"askLambdaEndpoint.viaApiGateway.js","sourceRoot":"","sources":["../../../src/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaApiGateway.ts"],"names":[],"mappings":";;;AAGA,wGAAqG;AAErG,oEAAiE;AACjE,6EAA0E;AAC1E,6DAA0D;AAC1D,uDAAoD;AACpD,iEAA8D;AAC9D,uEAAoE;AACpE,6EAA0E;AAC1E,2EAAwE;AAExE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,MAAM,aAAa,GAAG,KAAK,EAChC,KAYC,EACD,OAAwB,EAMvB,EAAE;IACH,2DAA2D;IAC3D,MAAM,OAAO,GAAG,IAAA,iDAAuB,EAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAErE,kFAAkF;IAClF,MAAM,IAAI,GAAG,IAAA,iCAAe,EAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEnD,iDAAiD;IACjD,MAAM,OAAO,GAAG,IAAA,qCAAiB,EAAC,EAAE,IAAI,EAAE,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SimpleCache } from 'with-simple-cache';
|
|
3
3
|
import type { ContextAwsLambdaCaller } from '../../domain.objects/ContextAwsLambdaCaller';
|
|
4
4
|
import type { LambdaEndpointDialect } from '../../domain.objects/LambdaEndpointDialect';
|
|
5
|
+
import type { LambdaEndpointRefusal } from '../../domain.objects/LambdaEndpointRefusal';
|
|
5
6
|
/**
|
|
6
7
|
* .what = invokes a lambda endpoint with trail propagation, over the aws lambda invoke api
|
|
7
8
|
* .why = enables service-to-service calls with observability
|
|
@@ -29,6 +30,15 @@ export declare const viaInvoke: <TRequest, TResponse>(input: {
|
|
|
29
30
|
*/
|
|
30
31
|
payload?: LambdaEndpointDialect;
|
|
31
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* .what = the class a peer's refusal (its ConstraintError / BadRequestError) is thrown as
|
|
35
|
+
* .why = this caller composed the request, so by default a refusal is this caller's own
|
|
36
|
+
* malfunction — an api-gateway caller answers 500, never a 400 its caller cannot fix
|
|
37
|
+
* .default = { as: 'LambdaEndpointRefusedError' }
|
|
38
|
+
* .note = name `{ as: 'ConstraintError' }` only where the request forwards your own caller's
|
|
39
|
+
* input verbatim, so the fault truly is theirs to fix
|
|
40
|
+
*/
|
|
41
|
+
refusal?: LambdaEndpointRefusal;
|
|
32
42
|
}, context: ContextAwsLambdaCaller & {
|
|
33
43
|
cache?: {
|
|
34
44
|
response?: SimpleCache<TResponse>;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.viaInvoke = void 0;
|
|
4
4
|
const genLambdaSdk_1 = require("../../access/sdks/lambda/genLambdaSdk");
|
|
5
|
-
const asLambdaEndpoint_1 = require("
|
|
6
|
-
const getOneTrailExid_1 = require("
|
|
5
|
+
const asLambdaEndpoint_1 = require("../../domain.operations/asLambdaEndpoint/asLambdaEndpoint");
|
|
6
|
+
const getOneTrailExid_1 = require("../../domain.operations/lambdaEndpointWire/context/getOneTrailExid");
|
|
7
|
+
const asAskLambdaCacheKeyOfRefusal_1 = require("./cache/asAskLambdaCacheKeyOfRefusal");
|
|
7
8
|
const asCachedExecutor_1 = require("./cache/asCachedExecutor");
|
|
8
9
|
const getAskLambdaCacheKey_1 = require("./cache/getAskLambdaCacheKey");
|
|
10
|
+
const asLambdaEndpointRefusal_1 = require("./serde/asLambdaEndpointRefusal");
|
|
9
11
|
const getLambdaPayload_1 = require("./serde/getLambdaPayload");
|
|
10
12
|
/**
|
|
11
13
|
* .what = invokes a lambda endpoint with trail propagation, over the aws lambda invoke api
|
|
@@ -17,6 +19,8 @@ const getLambdaPayload_1 = require("./serde/getLambdaPayload");
|
|
|
17
19
|
* .note = use struct: 'ancient' for handlers that don't understand wrapped payloads
|
|
18
20
|
*/
|
|
19
21
|
const viaInvoke = async (input, context) => {
|
|
22
|
+
// refuse an unknown refusal opt before any invoke is sent
|
|
23
|
+
const refusal = (0, asLambdaEndpointRefusal_1.asLambdaEndpointRefusal)({ declared: input.refusal });
|
|
20
24
|
// extract or generate the trail exid, and report the fallback if one was made.
|
|
21
25
|
// shared with `runLambdaEndpoint.onSerialized` so the two loci cannot diverge
|
|
22
26
|
// on the diagnostic — see `getOneTrailExid` for why that parity is structural
|
|
@@ -48,15 +52,23 @@ const viaInvoke = async (input, context) => {
|
|
|
48
52
|
env: { region: context.env.region },
|
|
49
53
|
});
|
|
50
54
|
// prepare invocation input + context
|
|
51
|
-
const invocationInput = {
|
|
55
|
+
const invocationInput = {
|
|
56
|
+
endpoint,
|
|
57
|
+
payload,
|
|
58
|
+
exid,
|
|
59
|
+
refusal,
|
|
60
|
+
};
|
|
52
61
|
const invocationContext = {
|
|
53
62
|
sdkLambda,
|
|
54
63
|
log: context.log,
|
|
55
64
|
};
|
|
56
|
-
// build cache key generator
|
|
57
|
-
const getCacheKey = () => (0,
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
// build cache key generator; a pass-through ask never shares a key with a default ask
|
|
66
|
+
const getCacheKey = () => (0, asAskLambdaCacheKeyOfRefusal_1.asAskLambdaCacheKeyOfRefusal)({
|
|
67
|
+
key: (0, getAskLambdaCacheKey_1.getAskLambdaCacheKey)({
|
|
68
|
+
endpoint,
|
|
69
|
+
event: input.event,
|
|
70
|
+
}),
|
|
71
|
+
refusal,
|
|
60
72
|
});
|
|
61
73
|
// get executor with cache wrapper
|
|
62
74
|
const execute = (0, asCachedExecutor_1.asCachedExecutor)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"askLambdaEndpoint.viaInvoke.js","sourceRoot":"","sources":["../../../src/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaInvoke.ts"],"names":[],"mappings":";;;AAGA,wEAAqE;
|
|
1
|
+
{"version":3,"file":"askLambdaEndpoint.viaInvoke.js","sourceRoot":"","sources":["../../../src/domain.operations/askLambdaEndpoint/askLambdaEndpoint.viaInvoke.ts"],"names":[],"mappings":";;;AAGA,wEAAqE;AAIrE,gGAA6F;AAC7F,wGAAqG;AAErG,uFAAoF;AACpF,+DAA4D;AAC5D,uEAAoE;AAKpE,6EAA0E;AAC1E,+DAA4D;AAE5D;;;;;;;;GAQG;AACI,MAAM,SAAS,GAAG,KAAK,EAC5B,KA2BC,EACD,OAKC,EACmB,EAAE;IACtB,0DAA0D;IAC1D,MAAM,OAAO,GAAG,IAAA,iDAAuB,EAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAErE,+EAA+E;IAC/E,8EAA8E;IAC9E,8EAA8E;IAC9E,yBAAyB;IACzB,MAAM,IAAI,GAAG,IAAA,iCAAe,EAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEnD,wEAAwE;IACxE,MAAM,QAAQ,GAAG,IAAA,mCAAgB,EAAC;QAChC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO;QAC5B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM;QAC1B,QAAQ,EAAE,KAAK,CAAC,KA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AAE,iBAAiB,CAAC,CAAC;AACrD,CAAC,CAAC;AAxGW,QAAA,SAAS,GAAT,SAAS,CAwGpB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LambdaEndpointRefusal } from '../../../domain.objects/LambdaEndpointRefusal';
|
|
2
|
+
/**
|
|
3
|
+
* .what = the cache key of one ask, under the refusal opt it was asked with
|
|
4
|
+
* .why = the dedupe cache shares one in-flight promise per key, and a rejection's class depends on
|
|
5
|
+
* the opt. so a pass-through ask must never share a key with a default ask, or a caller
|
|
6
|
+
* could catch the class the other caller asked for (sdk-aws-lambda#77)
|
|
7
|
+
*
|
|
8
|
+
* .note = the default opt keeps the key it had before the opt existed, so the public
|
|
9
|
+
* `getAskLambdaCacheKey` and every extant cached entry stay as they were
|
|
10
|
+
* .note = the cost: a pass-through ask no longer shares a cached success with a default ask of
|
|
11
|
+
* the same event. a class-neutral throw cast at the `viaInvoke` boundary would keep those
|
|
12
|
+
* hits, but needs a marker that tells a peer refusal from a local `ConstraintError`
|
|
13
|
+
*/
|
|
14
|
+
export declare const asAskLambdaCacheKeyOfRefusal: (input: {
|
|
15
|
+
key: string;
|
|
16
|
+
refusal: LambdaEndpointRefusal;
|
|
17
|
+
}) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asAskLambdaCacheKeyOfRefusal = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* .what = the cache key of one ask, under the refusal opt it was asked with
|
|
6
|
+
* .why = the dedupe cache shares one in-flight promise per key, and a rejection's class depends on
|
|
7
|
+
* the opt. so a pass-through ask must never share a key with a default ask, or a caller
|
|
8
|
+
* could catch the class the other caller asked for (sdk-aws-lambda#77)
|
|
9
|
+
*
|
|
10
|
+
* .note = the default opt keeps the key it had before the opt existed, so the public
|
|
11
|
+
* `getAskLambdaCacheKey` and every extant cached entry stay as they were
|
|
12
|
+
* .note = the cost: a pass-through ask no longer shares a cached success with a default ask of
|
|
13
|
+
* the same event. a class-neutral throw cast at the `viaInvoke` boundary would keep those
|
|
14
|
+
* hits, but needs a marker that tells a peer refusal from a local `ConstraintError`
|
|
15
|
+
*/
|
|
16
|
+
const asAskLambdaCacheKeyOfRefusal = (input) => {
|
|
17
|
+
if (input.refusal.as === 'LambdaEndpointRefusedError')
|
|
18
|
+
return input.key;
|
|
19
|
+
return `${input.key}::refusal=${input.refusal.as}`;
|
|
20
|
+
};
|
|
21
|
+
exports.asAskLambdaCacheKeyOfRefusal = asAskLambdaCacheKeyOfRefusal;
|
|
22
|
+
//# sourceMappingURL=asAskLambdaCacheKeyOfRefusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asAskLambdaCacheKeyOfRefusal.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/cache/asAskLambdaCacheKeyOfRefusal.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACI,MAAM,4BAA4B,GAAG,CAAC,KAG5C,EAAU,EAAE;IACX,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,4BAA4B;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC;IACxE,OAAO,GAAG,KAAK,CAAC,GAAG,aAAa,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;AACrD,CAAC,CAAC;AANW,QAAA,4BAA4B,GAA5B,4BAA4B,CAMvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asCacheWithoutSet.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/cache/asCacheWithoutSet.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACI,MAAM,iBAAiB,GAAG,CAAI,KAAqB,EAAkB,EAAE,CAC5E,CAAC;IACC,GAAG,KAAK;IACR,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAA0B;CACzC,CAAmB,CAAC;AAJV,QAAA,iBAAiB,
|
|
1
|
+
{"version":3,"file":"asCacheWithoutSet.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/cache/asCacheWithoutSet.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACI,MAAM,iBAAiB,GAAG,CAAI,KAAqB,EAAkB,EAAE,CAC5E,CAAC;IACC,GAAG,KAAK;IACR,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAA0B;CACzC,CAAmB,CAAC;AAJV,QAAA,iBAAiB,GAAjB,iBAAiB,CAIP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SimpleInMemoryCache } from 'simple-in-memory-cache';
|
|
2
2
|
import { type SimpleCache } from 'with-simple-cache';
|
|
3
|
-
import { type InvocationContext, type InvocationInput } from '
|
|
3
|
+
import { type InvocationContext, type InvocationInput } from '../../../domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation';
|
|
4
4
|
/**
|
|
5
5
|
* .what = executor type for lambda invocation
|
|
6
6
|
* .why = typed for cache wrapper composition
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.asCachedExecutor = void 0;
|
|
4
4
|
const with_simple_cache_1 = require("with-simple-cache");
|
|
5
|
-
const executeLambdaInvocation_1 = require("
|
|
5
|
+
const executeLambdaInvocation_1 = require("../../../domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation");
|
|
6
6
|
/**
|
|
7
7
|
* .what = wraps executor with cache if caches provided
|
|
8
8
|
* .why = extracts cache selection logic from orchestrator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asCachedExecutor.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/cache/asCachedExecutor.ts"],"names":[],"mappings":";;;AACA,yDAA2E;AAE3E
|
|
1
|
+
{"version":3,"file":"asCachedExecutor.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/cache/asCachedExecutor.ts"],"names":[],"mappings":";;;AACA,yDAA2E;AAE3E,sHAIkF;AAWlF;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAY,KAI3C,EAA6B,EAAE;IAC9B,+CAA+C;IAC/C,IAAI,CAAC,KAAK,CAAC,QAAQ;QACjB,OAAO,iDAAoD,CAAC;IAE9D,+CAA+C;IAC/C,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,IAAA,wCAAoB,EAAC,iDAAuB,EAAE;YACnD,KAAK,EAAE;gBACL,MAAM,EAAE,KAAK,CAAC,QAAQ;gBACtB,aAAa,EAAE,KAAK,CAAC,MAAM;aAC5B;YACD,SAAS,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,WAAW,EAAE;SACtC,CAA8B,CAAC;IAClC,CAAC;IAED,oBAAoB;IACpB,OAAO,IAAA,wCAAoB,EAAC,iDAAuB,EAAE;QACnD,KAAK,EAAE,KAAK,CAAC,QAAQ;QACrB,SAAS,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,WAAW,EAAE;KACtC,CAA8B,CAAC;AAClC,CAAC,CAAC;AAzBW,QAAA,gBAAgB,GAAhB,gBAAgB,CAyB3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAskLambdaCacheKey.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getAskLambdaCacheKey.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey.ts"],"names":[],"mappings":";;;AAEA,6CAAyC;AAEzC;;;GAGG;AACH,MAAM,YAAY,GAAG,CAAC,KAAc,EAAU,EAAE;IAC9C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC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AoB,GAApB,oBAAoB,CAkB/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStatusCodeHint.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/error/getStatusCodeHint.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAU,EAAE;IAC9D,uCAAuC;IACvC,IAAI,UAAU,KAAK,GAAG;QAAE,OAAO,6CAA6C,CAAC;IAC7E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,iEAAiE,CAAC;IAC3E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,uFAAuF,CAAC;IACjG,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,sDAAsD,CAAC;IAChE,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,qEAAqE,CAAC;IAC/E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,mEAAmE,CAAC;IAC7E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,2DAA2D,CAAC;IACrE,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,gEAAgE,CAAC;IAC1E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,8DAA8D,CAAC;IACxE,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,qDAAqD,CAAC;IAE/D,oCAAoC;IACpC,OAAO,UAAU,UAAU,wDAAwD,CAAC;AACtF,CAAC,CAAC;AAxBW,QAAA,iBAAiB,
|
|
1
|
+
{"version":3,"file":"getStatusCodeHint.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/error/getStatusCodeHint.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAU,EAAE;IAC9D,uCAAuC;IACvC,IAAI,UAAU,KAAK,GAAG;QAAE,OAAO,6CAA6C,CAAC;IAC7E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,iEAAiE,CAAC;IAC3E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,uFAAuF,CAAC;IACjG,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,sDAAsD,CAAC;IAChE,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,qEAAqE,CAAC;IAC/E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,mEAAmE,CAAC;IAC7E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,2DAA2D,CAAC;IACrE,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,gEAAgE,CAAC;IAC1E,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,8DAA8D,CAAC;IACxE,IAAI,UAAU,KAAK,GAAG;QACpB,OAAO,qDAAqD,CAAC;IAE/D,oCAAoC;IACpC,OAAO,UAAU,UAAU,wDAAwD,CAAC;AACtF,CAAC,CAAC;AAxBW,QAAA,iBAAiB,GAAjB,iBAAiB,CAwB5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* .what = sends one http request with the runtime's global fetch, and names the request on a fault
|
|
3
3
|
* .why = a network fault leaves fetch as a bare `TypeError: fetch failed`, which names no url, no
|
|
4
|
-
* method, and no trail exid. the reader
|
|
4
|
+
* method, and no trail exid. the on-call reader needs all three
|
|
5
5
|
*
|
|
6
6
|
* .note = the peer of `executeLambdaInvocation`: the raw i/o boundary for the http road
|
|
7
7
|
* .note = every fault is caught and re-thrown, never hidden. `cause` rides along where the fault is
|
|
@@ -5,7 +5,7 @@ const helpful_errors_1 = require("helpful-errors");
|
|
|
5
5
|
/**
|
|
6
6
|
* .what = sends one http request with the runtime's global fetch, and names the request on a fault
|
|
7
7
|
* .why = a network fault leaves fetch as a bare `TypeError: fetch failed`, which names no url, no
|
|
8
|
-
* method, and no trail exid. the reader
|
|
8
|
+
* method, and no trail exid. the on-call reader needs all three
|
|
9
9
|
*
|
|
10
10
|
* .note = the peer of `executeLambdaInvocation`: the raw i/o boundary for the http road
|
|
11
11
|
* .note = every fault is caught and re-thrown, never hidden. `cause` rides along where the fault is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeHttpRequest.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/invoke/executeHttpRequest.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAElD;;;;;;;;;GASG;AACI,MAAM,kBAAkB,GAAG,KAAK,EAAE,KAMxC,EAAqB,EAAE;IACtB,IAAI,CAAC;QACH,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE;YAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,iCAAgB,CAAC,6CAA6C,EAAE;YACxE,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC;YAC3B,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAtBW,QAAA,kBAAkB,
|
|
1
|
+
{"version":3,"file":"executeHttpRequest.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/invoke/executeHttpRequest.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAElD;;;;;;;;;GASG;AACI,MAAM,kBAAkB,GAAG,KAAK,EAAE,KAMxC,EAAqB,EAAE;IACtB,IAAI,CAAC;QACH,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE;YAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,iCAAgB,CAAC,6CAA6C,EAAE;YACxE,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC;YAC3B,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAtBW,QAAA,kBAAkB,GAAlB,kBAAkB,CAsB7B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LambdaClient } from '@aws-sdk/client-lambda';
|
|
2
2
|
import type { LambdaEndpoint } from '../../../domain.objects/LambdaEndpoint';
|
|
3
|
+
import type { LambdaEndpointRefusal } from '../../../domain.objects/LambdaEndpointRefusal';
|
|
3
4
|
/**
|
|
4
5
|
* .what = minimal log interface for lambda invocation
|
|
5
6
|
* .why = accepts console, sdk-logs LogMethods, or any object with debug method
|
|
@@ -15,6 +16,7 @@ export type InvocationInput = {
|
|
|
15
16
|
endpoint: LambdaEndpoint;
|
|
16
17
|
payload: unknown;
|
|
17
18
|
exid: string;
|
|
19
|
+
refusal: LambdaEndpointRefusal;
|
|
18
20
|
};
|
|
19
21
|
/**
|
|
20
22
|
* .what = invocation context for lambda execution
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeLambdaInvocation = void 0;
|
|
4
4
|
const sdkLambdaInvoke_1 = require("../../../access/sdks/lambda/sdkLambdaInvoke");
|
|
5
5
|
const LambdaEndpointError_1 = require("../../../domain.objects/LambdaEndpointError");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const getStatusCodeHint_1 = require("../../../domain.operations/askLambdaEndpoint/error/getStatusCodeHint");
|
|
7
|
+
const getParsedResponse_1 = require("../../../domain.operations/lambdaEndpointWire/getParsedResponse");
|
|
8
8
|
/**
|
|
9
9
|
* .what = the core lambda invocation logic
|
|
10
10
|
* .why = extracted to enable cache wrapper composition
|
|
@@ -49,6 +49,7 @@ const executeLambdaInvocation = async (input, context) => {
|
|
|
49
49
|
functionError: result.functionError,
|
|
50
50
|
endpoint: input.endpoint,
|
|
51
51
|
exid: input.exid,
|
|
52
|
+
refusal: input.refusal,
|
|
52
53
|
});
|
|
53
54
|
// log result
|
|
54
55
|
context.log?.debug('askLambdaEndpoint.result', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeLambdaInvocation.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"executeLambdaInvocation.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.ts"],"names":[],"mappings":";;;AAEA,8EAA2E;AAE3E,kFAA+E;AAE/E,yGAAsG;AACtG,oGAAiG;AA8BjG;;;GAGG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAC1C,KAAsB,EACtB,OAA0B,EACN,EAAE;IACtB,iBAAiB;IACjB,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,0BAA0B,EAAE;QAC7C,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI;QACzB,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC,CAAC;IAEH,iCAAiC;IACjC,8EAA8E;IAC9E,iFAAiF;IACjF,gEAAgE;IAChE,uDAAuD;IACvD,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAe,EAClC,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK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9B,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AA3DW,QAAA,uBAAuB,GAAvB,uBAAuB,CA2DlC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ConstraintError, MalfunctionError } from 'helpful-errors';
|
|
1
|
+
import { type ConstraintError, MalfunctionError } from 'helpful-errors';
|
|
2
|
+
import type { LambdaEndpointRefusal } from '../../../domain.objects/LambdaEndpointRefusal';
|
|
3
|
+
import type { LambdaEndpointRefusedError } from '../../../domain.objects/LambdaEndpointRefusedError';
|
|
2
4
|
/**
|
|
3
5
|
* .what = casts an http response into the error a caller should throw, or null for a success
|
|
4
6
|
* .why = an api gateway endpoint answers a fault as a RETURNED http response, never a lambda error
|
|
@@ -8,7 +10,8 @@ import { ConstraintError, MalfunctionError } from 'helpful-errors';
|
|
|
8
10
|
* | status | the error | because |
|
|
9
11
|
* |--------|-----------|---------|
|
|
10
12
|
* | < 400 | none | a success. a redirect is followed by fetch by default, so a 3xx seldom arrives here |
|
|
11
|
-
* | 4xx | `ConstraintError` |
|
|
13
|
+
* | 4xx, save 429 | the `refusal` class: `LambdaEndpointRefusedError` by default, `ConstraintError` on opt-in | this caller composed the request, so the refusal is its own malfunction — unless it forwards its own caller's input |
|
|
14
|
+
* | 429 | `MalfunctionError`, under either opt | a throttle, not a refusal: the same request succeeds after `retry-after` |
|
|
12
15
|
* | 5xx | `MalfunctionError` | the endpoint must fix itself; its `correlationId` finds the log line |
|
|
13
16
|
*
|
|
14
17
|
* .note = the message comes from the body's contemp envelope when it has one, else from the
|
|
@@ -18,8 +21,8 @@ import { ConstraintError, MalfunctionError } from 'helpful-errors';
|
|
|
18
21
|
* .note = the raw answer text rides the error metadata, cut to a bound, so a message no arm reads
|
|
19
22
|
* (an old endpoint's flat body, a proxy's html page) is never lost to the caller. it is null
|
|
20
23
|
* where the message came from the contemp envelope, which is the text already. the
|
|
21
|
-
* response headers ride it too, so a
|
|
22
|
-
*
|
|
24
|
+
* response headers ride it too, so a throttle's `retry-after` can be read from the thrown
|
|
25
|
+
* error
|
|
23
26
|
*/
|
|
24
27
|
export declare const asErrorFromHttpResponse: (input: {
|
|
25
28
|
status: number;
|
|
@@ -28,4 +31,5 @@ export declare const asErrorFromHttpResponse: (input: {
|
|
|
28
31
|
headers: Record<string, string>;
|
|
29
32
|
url: string;
|
|
30
33
|
exid: string;
|
|
31
|
-
|
|
34
|
+
refusal: LambdaEndpointRefusal;
|
|
35
|
+
}) => ConstraintError | LambdaEndpointRefusedError | MalfunctionError | null;
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.asErrorFromHttpResponse = void 0;
|
|
4
4
|
const helpful_errors_1 = require("helpful-errors");
|
|
5
5
|
const HttpStatusCode_1 = require("../../../domain.objects/HttpStatusCode");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const asErrorFromPeerRefusal_1 = require("../../../domain.operations/lambdaEndpointWire/error/asErrorFromPeerRefusal");
|
|
7
|
+
const getIsLambdaErrorResponse_1 = require("../../../domain.operations/lambdaEndpointWire/error/getIsLambdaErrorResponse");
|
|
8
|
+
const asUnprefixedErrorMessage_1 = require("../../../domain.operations/lambdaEndpointWire/serde/asUnprefixedErrorMessage");
|
|
9
|
+
const getIsHttpThrottle_1 = require("./getIsHttpThrottle");
|
|
8
10
|
const getOneCorrelationIdFromBody_1 = require("./getOneCorrelationIdFromBody");
|
|
9
11
|
const ERROR_TEXT_LENGTH_MAX = 1000;
|
|
10
12
|
/**
|
|
@@ -16,7 +18,8 @@ const ERROR_TEXT_LENGTH_MAX = 1000;
|
|
|
16
18
|
* | status | the error | because |
|
|
17
19
|
* |--------|-----------|---------|
|
|
18
20
|
* | < 400 | none | a success. a redirect is followed by fetch by default, so a 3xx seldom arrives here |
|
|
19
|
-
* | 4xx | `ConstraintError` |
|
|
21
|
+
* | 4xx, save 429 | the `refusal` class: `LambdaEndpointRefusedError` by default, `ConstraintError` on opt-in | this caller composed the request, so the refusal is its own malfunction — unless it forwards its own caller's input |
|
|
22
|
+
* | 429 | `MalfunctionError`, under either opt | a throttle, not a refusal: the same request succeeds after `retry-after` |
|
|
20
23
|
* | 5xx | `MalfunctionError` | the endpoint must fix itself; its `correlationId` finds the log line |
|
|
21
24
|
*
|
|
22
25
|
* .note = the message comes from the body's contemp envelope when it has one, else from the
|
|
@@ -26,14 +29,18 @@ const ERROR_TEXT_LENGTH_MAX = 1000;
|
|
|
26
29
|
* .note = the raw answer text rides the error metadata, cut to a bound, so a message no arm reads
|
|
27
30
|
* (an old endpoint's flat body, a proxy's html page) is never lost to the caller. it is null
|
|
28
31
|
* where the message came from the contemp envelope, which is the text already. the
|
|
29
|
-
* response headers ride it too, so a
|
|
30
|
-
*
|
|
32
|
+
* response headers ride it too, so a throttle's `retry-after` can be read from the thrown
|
|
33
|
+
* error
|
|
31
34
|
*/
|
|
32
35
|
const asErrorFromHttpResponse = (input) => {
|
|
33
36
|
if (input.status < HttpStatusCode_1.HttpStatusCode.BAD_REQUEST_400)
|
|
34
37
|
return null;
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
// the envelope, resolved once: every field below reads it, or the status where there is none
|
|
39
|
+
const envelope = (0, getIsLambdaErrorResponse_1.getIsContempErrorResponse)(input.body)
|
|
40
|
+
? input.body.error
|
|
41
|
+
: null;
|
|
42
|
+
const message = envelope
|
|
43
|
+
? (0, asUnprefixedErrorMessage_1.asUnprefixedErrorMessage)({ message: envelope.message })
|
|
37
44
|
: `the endpoint answered http ${input.status}`;
|
|
38
45
|
const metadata = {
|
|
39
46
|
url: input.url,
|
|
@@ -42,13 +49,24 @@ const asErrorFromHttpResponse = (input) => {
|
|
|
42
49
|
correlationId: (0, getOneCorrelationIdFromBody_1.getOneCorrelationIdFromBody)({ body: input.body }),
|
|
43
50
|
// the raw text rides only where the message did not come from it: an envelope's message is
|
|
44
51
|
// the text already, and a second copy would bury the fix a person reads first
|
|
45
|
-
text: (0,
|
|
46
|
-
? null
|
|
47
|
-
: input.text.slice(0, ERROR_TEXT_LENGTH_MAX),
|
|
52
|
+
text: envelope ? null : input.text.slice(0, ERROR_TEXT_LENGTH_MAX),
|
|
48
53
|
headers: input.headers,
|
|
49
54
|
};
|
|
55
|
+
// a 429: a throttle, not a refusal — the same request succeeds after `retry-after`, so it is a
|
|
56
|
+
// server fault under either opt, its headers kept for the retry (`domain.terms/refusal.md`)
|
|
57
|
+
if ((0, getIsHttpThrottle_1.getIsHttpThrottle)({ status: input.status }))
|
|
58
|
+
return new helpful_errors_1.MalfunctionError(message, metadata);
|
|
59
|
+
// any other 4xx: the endpoint refused the request this caller composed; the opt names the class
|
|
60
|
+
// .note = the peer's verdict is its envelope's class where it sent one, else the status alone
|
|
50
61
|
if (input.status < HttpStatusCode_1.HttpStatusCode.INTERNAL_SERVER_ERROR_500)
|
|
51
|
-
return
|
|
62
|
+
return (0, asErrorFromPeerRefusal_1.asErrorFromPeerRefusal)({
|
|
63
|
+
refusal: input.refusal,
|
|
64
|
+
peer: input.url,
|
|
65
|
+
message,
|
|
66
|
+
errorType: envelope ? envelope.class : `http ${input.status}`,
|
|
67
|
+
metadata,
|
|
68
|
+
});
|
|
69
|
+
// a 5xx: the endpoint must fix itself
|
|
52
70
|
return new helpful_errors_1.MalfunctionError(message, metadata);
|
|
53
71
|
};
|
|
54
72
|
exports.asErrorFromHttpResponse = asErrorFromHttpResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asErrorFromHttpResponse.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asErrorFromHttpResponse.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"asErrorFromHttpResponse.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asErrorFromHttpResponse.ts"],"names":[],"mappings":";;;AAAA,mDAAwE;AAExE,wEAAqE;AAGrE,oHAAiH;AACjH,wHAAsH;AACtH,wHAAqH;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K,CAAC,MAAM,GAAG,+BAAc,CAAC,yBAAyB;QACzD,OAAO,IAAA,+CAAsB,EAAC;YAC5B,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,IAAI,EAAE,KAAK,CAAC,GAAG;YACf,OAAO;YACP,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,MAAM,EAAE;YAC7D,QAAQ;SACT,CAAC,CAAC;IAEL,sCAAsC;IACtC,OAAO,IAAI,iCAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACjD,CAAC,CAAC;AAhDW,QAAA,uBAAuB,GAAvB,uBAAuB,CAgDlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asHeadersRecord.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asHeadersRecord.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACI,MAAM,eAAe,GAAG,CAAC,KAE/B,EAA0B,EAAE;IAC3B,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACnC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AARW,QAAA,eAAe,
|
|
1
|
+
{"version":3,"file":"asHeadersRecord.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asHeadersRecord.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACI,MAAM,eAAe,GAAG,CAAC,KAE/B,EAA0B,EAAE;IAC3B,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACnC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AARW,QAAA,eAAe,GAAf,eAAe,CAQ1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asHttpMethod.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asHttpMethod.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACI,MAAM,YAAY,GAAG,CAAC,KAG5B,EAAU,EAAE;IACX,IAAI,KAAK,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC;IACtC,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC,CAAC;AANW,QAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"asHttpMethod.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asHttpMethod.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACI,MAAM,YAAY,GAAG,CAAC,KAG5B,EAAU,EAAE;IACX,IAAI,KAAK,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC;IACtC,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC,CAAC;AANW,QAAA,YAAY,GAAZ,YAAY,CAMvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asHttpRequestBody.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asHttpRequestBody.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAE7C;;;;;;;;;;GAUG;AACI,MAAM,iBAAiB,GAAG,CAAC,KAEjC,EAA4D,EAAE;IAC7D,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAC5E,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAChC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IACjD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAC9E,CAAC,CAAC;AAPW,QAAA,iBAAiB,
|
|
1
|
+
{"version":3,"file":"asHttpRequestBody.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asHttpRequestBody.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAE7C;;;;;;;;;;GAUG;AACI,MAAM,iBAAiB,GAAG,CAAC,KAEjC,EAA4D,EAAE;IAC7D,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAC5E,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAChC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IACjD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAC9E,CAAC,CAAC;AAPW,QAAA,iBAAiB,GAAjB,iBAAiB,CAO5B"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.asHttpRequestHeaders = void 0;
|
|
4
4
|
const TrailExidHeader_1 = require("../../../domain.objects/TrailExidHeader");
|
|
5
|
-
const asHeadersWithoutKey_1 = require("
|
|
6
|
-
const asTrailExidHeaders_1 = require("
|
|
5
|
+
const asHeadersWithoutKey_1 = require("../../../domain.operations/lambdaEndpointWire/frame/asHeadersWithoutKey");
|
|
6
|
+
const asTrailExidHeaders_1 = require("../../../domain.operations/lambdaEndpointWire/frame/asTrailExidHeaders");
|
|
7
7
|
const CONTENT_TYPE_HEADER = 'content-type';
|
|
8
8
|
/**
|
|
9
9
|
* .what = the headers an http request is sent with: the body's content type, the caller's, and the trail's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asHttpRequestHeaders.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asHttpRequestHeaders.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"asHttpRequestHeaders.js","sourceRoot":"","sources":["../../../../src/domain.operations/askLambdaEndpoint/serde/asHttpRequestHeaders.ts"],"names":[],"mappings":";;;AAAA,0EAAyE;AACzE,8GAA2G;AAC3G,4GAAyG;AAEzG,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACI,MAAM,oBAAoB,GAAG,CAAC,KAIpC,EAA0B,EAAE;IAC3B,MAAM,eAAe,GAAG,IAAA,yCAAmB,EAAC;QAC1C,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,GAAG,EAAE,mCAAiB;KACvB,CAAC,CAAC;IACH,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAC1D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,mBAAmB,CACrD,CAAC;IACF,OAAO;QACL,GAAG,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,kBAAkB;YAC1C,CAAC,CAAC,EAAE,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,WAAW,EAAE;YAC9C,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,eAAe;QAClB,GAAG,IAAA,uCAAkB,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;KAC9C,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,oBAAoB,GAApB,oBAAoB,CAmB/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type LambdaEndpointRefusal } from '../../../domain.objects/LambdaEndpointRefusal';
|
|
2
|
+
/**
|
|
3
|
+
* .what = casts a declared `refusal` opt into one this sdk can honor, and refuses any other
|
|
4
|
+
* .why = the cast branches on one literal, so a typo or a config-driven value
|
|
5
|
+
* (`{ as: 'constraintError' }`) would fall to the default class, and the thrown message
|
|
6
|
+
* would then tell the caller to set the very opt they believe they set. a published sdk
|
|
7
|
+
* boundary is validated at runtime or it is not validated (rule.forbid.unexpected-defaults),
|
|
8
|
+
* as `asLambdaEndpointDialect` does for its peer field
|
|
9
|
+
*
|
|
10
|
+
* .note = refused at the ask, before any request is sent, so a bad opt fails on the first call —
|
|
11
|
+
* never only on the first peer refusal, which may come weeks later
|
|
12
|
+
*/
|
|
13
|
+
export declare const asLambdaEndpointRefusal: (input: {
|
|
14
|
+
declared?: unknown;
|
|
15
|
+
}) => LambdaEndpointRefusal;
|