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
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onSerialized = void 0;
|
|
4
4
|
const helpful_errors_1 = require("helpful-errors");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
5
|
+
const LambdaEndpointRefusal_1 = require("../../domain.objects/LambdaEndpointRefusal");
|
|
6
|
+
const askLambdaEndpoint_1 = require("../../domain.operations/askLambdaEndpoint/askLambdaEndpoint");
|
|
7
|
+
const asLambdaEndpoint_1 = require("../../domain.operations/asLambdaEndpoint/asLambdaEndpoint");
|
|
8
|
+
const getOneTrailExid_1 = require("../../domain.operations/lambdaEndpointWire/context/getOneTrailExid");
|
|
9
|
+
const throwIfCredentialsError_1 = require("../../domain.operations/lambdaEndpointWire/error/throwIfCredentialsError");
|
|
10
|
+
const getOneTrailCarrierOfEvent_1 = require("../../domain.operations/lambdaEndpointWire/frame/getOneTrailCarrierOfEvent");
|
|
11
|
+
const getParsedResponse_1 = require("../../domain.operations/lambdaEndpointWire/getParsedResponse");
|
|
11
12
|
const asLambdaEndpointDialect_1 = require("./dialect/asLambdaEndpointDialect");
|
|
12
13
|
const assertEventIsGiven_1 = require("./guard/assertEventIsGiven");
|
|
13
14
|
const assertHandlerIsRunnable_1 = require("./guard/assertHandlerIsRunnable");
|
|
@@ -17,6 +18,14 @@ const runLambdaEndpoint_onReferenced_1 = require("./runLambdaEndpoint.onReferenc
|
|
|
17
18
|
const asCarriedPayload_1 = require("./serde/asCarriedPayload");
|
|
18
19
|
const asWireFunctionErrorPayload_1 = require("./serde/asWireFunctionErrorPayload");
|
|
19
20
|
const asWirePayload_1 = require("./serde/asWirePayload");
|
|
21
|
+
/**
|
|
22
|
+
* .what = a refusal reaches the runner as a `ConstraintError`, on both loci
|
|
23
|
+
* .why = the runner composed the event itself, so no peer stands between it and the handler:
|
|
24
|
+
* the fault truly is the runner's to fix. `askLambdaEndpoint`'s default
|
|
25
|
+
* (`LambdaEndpointRefusedError`) states the opposite, for a caller that composed a request
|
|
26
|
+
* on its OWN caller's behalf
|
|
27
|
+
*/
|
|
28
|
+
const REFUSAL_OF_RUN = LambdaEndpointRefusal_1.REFUSAL_PASSTHROUGH;
|
|
20
29
|
/**
|
|
21
30
|
* .what = runs a lambda endpoint you hold the SLUG of — `{ service, function }`
|
|
22
31
|
* plus the ambient access
|
|
@@ -147,6 +156,7 @@ const onSerialized = async (input, context) => {
|
|
|
147
156
|
carrier,
|
|
148
157
|
}),
|
|
149
158
|
struct: { payload: 'ancient' },
|
|
159
|
+
refusal: REFUSAL_OF_RUN,
|
|
150
160
|
}, {
|
|
151
161
|
...context,
|
|
152
162
|
log: {
|
|
@@ -159,6 +169,7 @@ const onSerialized = async (input, context) => {
|
|
|
159
169
|
which: input.which,
|
|
160
170
|
event: input.event,
|
|
161
171
|
struct: structValidated,
|
|
172
|
+
refusal: REFUSAL_OF_RUN,
|
|
162
173
|
}, context).catch(asCredentialsFault);
|
|
163
174
|
}
|
|
164
175
|
// the local locus: look the handler up, run it, then hydrate exactly as the wire does
|
|
@@ -206,6 +217,7 @@ const onSerialized = async (input, context) => {
|
|
|
206
217
|
functionError: undefined,
|
|
207
218
|
endpoint,
|
|
208
219
|
exid,
|
|
220
|
+
refusal: REFUSAL_OF_RUN,
|
|
209
221
|
});
|
|
210
222
|
};
|
|
211
223
|
exports.onSerialized = onSerialized;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runLambdaEndpoint.onSerialized.js","sourceRoot":"","sources":["../../../src/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onSerialized.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAIjD,
|
|
1
|
+
{"version":3,"file":"runLambdaEndpoint.onSerialized.js","sourceRoot":"","sources":["../../../src/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onSerialized.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAIjD,sFAGoD;AACpD,mGAAgG;AAChG,gGAA6F;AAC7F,wGAAqG;AACrG,sHAAmH;AACnH,0HAAuH;AACvH,oGAAiG;AAEjG,+EAA4E;AAE5E,mEAAgE;AAChE,6EAA0E;AAC1E,mEAAgE;AAChE,2FAAwF;AACxF,qFAAgE;AAChE,+DAA4D;AAC5D,mFAAgF;AAChF,yDAAsD;AAWtD;;;;;;GAMG;AACH,MAAM,cAAc,GAA0B,2CAAmB,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACI,MAAM,YAAY,GAAG,KAAK,EAC/B,KAiCC,EACD,OAA+B,EACE,EAAE;IACnC,gFAAgF;IAChF,yEAAyE;IACzE,iFAAiF;IACjF,IAAA,uCAAkB,EAAC;QACjB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,IAAI,OAAO,EAAE;KAC1D,CAAC,CAAC;IAEH,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,OAAO,CAAC;IAE/B,+EAA+E;IAC/E,4EAA4E;IAC5E,+EAA+E;IAC/E,0EAA0E;IAC1E,0DAA0D;IAC1D,IAAI,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,OAAO;QAClC,OAAO,gCAAe,CAAC,KAAK,CAC1B,8CAA8C,EAC9C;YACE,EAAE;YACF,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;YAC3B,IAAI,EAAE,uLAAuL;SAC9L,CACF,CAAC;IAE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DAAuB,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAErC,0EAA0E;IAC1E,iEAAiE;IACjE,MAAM,IAAI,GAAG,IAAA,iCAAe,EAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEnD,+EAA+E;IAC/E,uDAAuD;IACvD,yCAAyC;IACzC,2EAA2E;IAC3E,6EAA6E;IAC7E,MAAM,MAAM,GAAG,MAAM,IAAA,6CAAY,EAAC;QAChC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO;QACP,MAAM,EAAE,eAAe;QAEvB,6EAA6E;QAC7E,4EAA4E;QAC5E,OAAO,EAAE,IAAA,uCAAkB,EAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QAErE,uEAAuE;QACvE,6EAA6E;QAC7E,kDAAkD;QAClD,0EAA0E;QAC1E,KAAK,EAAE,EAAE,IAAI,EAAE;KAChB,CAAC,CAAC,KAAK,CAAC,uDAA0B,CAAC,CAAC;IAErC,2EAA2E;IAC3E,8EAA8E;IAC9E,yDAAyD;IACzD,OAAO,IAAA,qCAAiB,EAAyB;QAC/C,OAAO,EAAE,IAAA,6BAAa,EAAC,MAAM,CAAC;QAC9B,aAAa,EAAE,SAAS;QACxB,QAAQ;QACR,IAAI;QACJ,OAAO,EAAE,cAAc;KACxB,CAAC,CAAC;AACL,CAAC,CAAC;AA1MW,QAAA,YAAY,GAAZ,YAAY,CA0MvB"}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.asCarriedPayload = void 0;
|
|
4
4
|
const helpful_errors_1 = require("helpful-errors");
|
|
5
5
|
const TrailExidHeader_1 = require("../../../domain.objects/TrailExidHeader");
|
|
6
|
-
const asHeadersWithoutKey_1 = require("
|
|
7
|
-
const asTrailExidHeaders_1 = require("
|
|
8
|
-
const getOneTrailExidFromHeaders_1 = require("
|
|
6
|
+
const asHeadersWithoutKey_1 = require("../../../domain.operations/lambdaEndpointWire/frame/asHeadersWithoutKey");
|
|
7
|
+
const asTrailExidHeaders_1 = require("../../../domain.operations/lambdaEndpointWire/frame/asTrailExidHeaders");
|
|
8
|
+
const getOneTrailExidFromHeaders_1 = require("../../../domain.operations/lambdaEndpointWire/frame/getOneTrailExidFromHeaders");
|
|
9
9
|
const asFramedPayload_1 = require("./asFramedPayload");
|
|
10
10
|
const getOneTrailWithExid_1 = require("./getOneTrailWithExid");
|
|
11
11
|
const isEventWithHeaders_1 = require("./isEventWithHeaders");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asCarriedPayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asCarriedPayload.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAIlD,
|
|
1
|
+
{"version":3,"file":"asCarriedPayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asCarriedPayload.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAIlD,0EAAyE;AACzE,8GAA2G;AAC3G,4GAAyG;AACzG,4HAAyH;AAEzH,uDAAoD;AACpD,+DAA4D;AAC5D,6DAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,MAAM,gBAAgB,GAAG,CAAC,KAKhC,EAAW,EAAE;IACZ,qGAAqG;IACrG,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAC5D,OAAO,iCAAgB,CAAC,KAAK,CAAC,0CAA0C,EAAE;YACxE,OAAO,EAAE,KAAK,CAAC,OAAuB;SACvC,CAAC,CAAC;IACL,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,IAAA,iCAAe,EAAC,KAAK,CAAC,CAAC;IAE/D,+EAA+E;IAC/E,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC;IAEpD,8FAA8F;IAC9F,kDAAkD;IAClD,MAAM,KAAK,GAAG,uCAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrD,MAAM,cAAc,GAAG,IAAA,uCAAkB,EAAC;QACxC,KAAK,EAAE,IAAA,yCAAmB,EAAC;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI;gBACpB,IAAI,EAAE,IAAA,uDAA0B,EAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;aAC7D;SACF,CAAC;KACH,CAAC,CAAC;IACH,OAAO;QACL,GAAG,KAAK;QACR,OAAO,EAAE;YACP,GAAG,IAAA,yCAAmB,EAAC;gBACrB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,GAAG,EAAE,mCAAiB;aACvB,CAAC;YACF,GAAG,cAAc;SAClB;QACD,GAAG,CAAC,KAAK,CAAC,iBAAiB;YACzB,CAAC,CAAC;gBACE,iBAAiB,EAAE;oBACjB,GAAG,IAAA,yCAAmB,EAAC;wBACrB,OAAO,EAAE,KAAK,CAAC,iBAAiB;wBAChC,GAAG,EAAE,mCAAiB;qBACvB,CAAC;oBACF,CAAC,mCAAiB,CAAC,EAAE,CAAC,cAAc,CAAC,mCAAiB,CAAC,CAAC;iBACzD;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,gBAAgB,GAAhB,gBAAgB,CA+C3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asErrorTypeOfErrorLike.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asErrorTypeOfErrorLike.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAyB,EAAU,EAAE;IAC1E,MAAM,KAAK,GAAG,KAAK,CAAC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KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACpE,IAAI,CAAC;QACH,uFAAuF;QACvF,MAAM,aAAa,GAAY,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;QAC5E,IAAI,OAAO,aAAa,KAAK,UAAU;YAAE,OAAO,KAAK,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asFramedPayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asFramedPayload.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACI,MAAM,eAAe,GAAG,CAAC,KAI/B,EAAW,EAAE;IACZ,qEAAqE;IACrE,8EAA8E;IAC9E,EAAE;IACF,+EAA+E;IAC/E,+EAA+E;IAC/E,+EAA+E;IAC/E,+EAA+E;IAC/E,4EAA4E;IAC5E,yBAAyB;IACzB,EAAE;IACF,+DAA+D;IAC/D,8EAA8E;IAC9E,gFAAgF;IAChF,gEAAgE;IAChE,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAC7B,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;SAC3D,CAAC;IAEJ,iFAAiF;IACjF,qEAAqE;IACrE,OAAO,KAAK,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC;AA5BW,QAAA,eAAe,
|
|
1
|
+
{"version":3,"file":"asFramedPayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asFramedPayload.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACI,MAAM,eAAe,GAAG,CAAC,KAI/B,EAAW,EAAE;IACZ,qEAAqE;IACrE,8EAA8E;IAC9E,EAAE;IACF,+EAA+E;IAC/E,+EAA+E;IAC/E,+EAA+E;IAC/E,+EAA+E;IAC/E,4EAA4E;IAC5E,yBAAyB;IACzB,EAAE;IACF,+DAA+D;IAC/D,8EAA8E;IAC9E,gFAAgF;IAChF,gEAAgE;IAChE,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAC7B,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;SAC3D,CAAC;IAEJ,iFAAiF;IACjF,qEAAqE;IACrE,OAAO,KAAK,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC;AA5BW,QAAA,eAAe,GAAf,eAAe,CA4B1B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.asWireFunctionErrorPayload = void 0;
|
|
4
|
-
const isErrorLike_1 = require("
|
|
4
|
+
const isErrorLike_1 = require("../../../domain.operations/runLambdaEndpoint/error/isErrorLike");
|
|
5
5
|
const asErrorTypeOfErrorLike_1 = require("./asErrorTypeOfErrorLike");
|
|
6
6
|
/**
|
|
7
7
|
* .what = the message the aws node runtime writes when its own reads of a thrown value throw
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asWireFunctionErrorPayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asWireFunctionErrorPayload.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"asWireFunctionErrorPayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asWireFunctionErrorPayload.ts"],"names":[],"mappings":";;;AAAA,6FAA0F;AAE1F,qEAAkE;AAElE;;;;;GAKG;AACH,MAAM,uBAAuB,GAC3B,2HAA2H,CAAC;AAE9H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACI,MAAM,0BAA0B,GAAG,CACxC,KAAc,EACqD,EAAE;IACrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,sFAAsF;IACtF,MAAM,MAAM,GAAG,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IAEzE,qFAAqF;IACrF,MAAM,SAAS,GAAG,IAAA,+CAAsB,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5D,IAAI,SAAS,KAAK,SAAS;QACzB,OAAO;YACL,YAAY,EAAE,uBAAuB;YACrC,SAAS;YACT,UAAU,EAAE,EAAE;SACf,CAAC;IAEJ,IAAI,CAAC,IAAA,yBAAW,EAAC,MAAM,CAAC;QACtB,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC;YAC5B,SAAS;YACT,UAAU,EAAE,EAAE;SACf,CAAC;IAEJ,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,OAAO;QAC5B,SAAS;QACT,sCAAsC;QACtC,UAAU,EACR,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;KACnE,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,0BAA0B,GAA1B,0BAA0B,CA2DrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asWirePayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asWirePayload.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACI,MAAM,aAAa,GAAG,CAAC,MAAe,EAAc,EAAE,CAC3D,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC;AAD9C,QAAA,aAAa,
|
|
1
|
+
{"version":3,"file":"asWirePayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asWirePayload.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACI,MAAM,aAAa,GAAG,CAAC,MAAe,EAAc,EAAE,CAC3D,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC;AAD9C,QAAA,aAAa,GAAb,aAAa,CACiC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.asWireStripped = void 0;
|
|
4
4
|
const helpful_errors_1 = require("helpful-errors");
|
|
5
|
-
const isErrorLike_1 = require("
|
|
5
|
+
const isErrorLike_1 = require("../../../domain.operations/runLambdaEndpoint/error/isErrorLike");
|
|
6
6
|
/**
|
|
7
7
|
* .what = casts a live object into the shape a json wire would deliver
|
|
8
8
|
* .why = the referenced boundary crosses no wire, so a Date, a class instance,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asWireStripped.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asWireStripped.ts"],"names":[],"mappings":";;;AAAA,mDAAmE;AAEnE,
|
|
1
|
+
{"version":3,"file":"asWireStripped.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/asWireStripped.ts"],"names":[],"mappings":";;;AAAA,mDAAmE;AAEnE,6FAA0F;AAE1F;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,cAAc,GAAG,CAAI,KAGjC,EAAK,EAAE;IACN;;;;;;;;;OASG;IACH,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,OAAO,SAAc,CAAC;IAErD,IAAI,CAAC;QACH;;;WAGG;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAM,CAAC;IACtD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4EAA4E;QAC5E,6EAA6E;QAC7E,6EAA6E;QAC7E,0EAA0E;QAC1E,kDAAkD;QAClD,EAAE;QACF,2EAA2E;QAC3E,6EAA6E;QAC7E,wEAAwE;QACxE,8EAA8E;QAC9E,wDAAwD;QACxD,qDAAqD;QACrD,EAAE;QACF,6EAA6E;QAC7E,yEAAyE;QACzE,iDAAiD;QACjD,EAAE;QACF,8EAA8E;QAC9E,yEAAyE;QACzE,0EAA0E;QAC1E,kBAAkB;QAClB,EAAE;QACF,4EAA4E;QAC5E,8EAA8E;QAC9E,MAAM,KAAK,GAAG,IAAA,yBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAEpE,IAAI,KAAK,CAAC,EAAE,KAAK,OAAO;YACtB,OAAO,gCAAe,CAAC,KAAK,CAC1B,sEAAsE,EACtE;gBACE,KAAK;gBACL,IAAI,EAAE,gNAAgN;aACvN,CACF,CAAC;QAEJ,MAAM,IAAI,iCAAgB,CACxB,wFAAwF,EACxF;YACE,KAAK;YACL,IAAI,EAAE,gOAAgO;SACvO,CACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAlEW,QAAA,cAAc,GAAd,cAAc,CAkEzB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOneTrailWithExid = void 0;
|
|
4
|
-
const getExidFromContext_1 = require("
|
|
4
|
+
const getExidFromContext_1 = require("../../../domain.operations/lambdaEndpointWire/context/getExidFromContext");
|
|
5
5
|
/**
|
|
6
6
|
* .what = the caller's trail, with an exid guaranteed — the caller's own, or a generated one
|
|
7
7
|
* .why = the `x-trail-exid` header carries a value or carries no opt-in, so a request that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOneTrailWithExid.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/getOneTrailWithExid.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"getOneTrailWithExid.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/serde/getOneTrailWithExid.ts"],"names":[],"mappings":";;;AAAA,8GAA2G;AAE3G;;;;;;GAMG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAEnC,EAAoB,EAAE,CAAC,CAAC;IACvB,IAAI,EAAE,IAAA,uCAAkB,EAAC;QACvB,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,IAAI,EAAE,EAAE;KACpD,CAAC,CAAC,IAAI;CACR,CAAC,CAAC;AANU,QAAA,mBAAmB,GAAnB,mBAAmB,CAM7B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,13 @@ export { LambdaDomainObjectRefUnbindableError } from './domain.objects/LambdaDom
|
|
|
35
35
|
export { LambdaEndpoint } from './domain.objects/LambdaEndpoint';
|
|
36
36
|
export type { LambdaEndpointDialect } from './domain.objects/LambdaEndpointDialect';
|
|
37
37
|
export { LambdaEndpointError } from './domain.objects/LambdaEndpointError';
|
|
38
|
+
/**
|
|
39
|
+
* .what = a peer's refusal of a request this caller composed, and the opt that names its class
|
|
40
|
+
* .why = `askLambdaEndpoint` throws it by default for a peer's caller fault, so a consumer must be
|
|
41
|
+
* able to catch it by class and to name the opt it passes
|
|
42
|
+
*/
|
|
43
|
+
export type { LambdaEndpointRefusal } from './domain.objects/LambdaEndpointRefusal';
|
|
44
|
+
export { LambdaEndpointRefusedError } from './domain.objects/LambdaEndpointRefusedError';
|
|
38
45
|
export type { LambdaEndpointSchema } from './domain.objects/LambdaEndpointSchema';
|
|
39
46
|
export { LambdaFunctionNotFoundError } from './domain.objects/LambdaFunctionNotFoundError';
|
|
40
47
|
export { LambdaIntrospectionBlockedError } from './domain.objects/LambdaIntrospectionBlockedError';
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* triggers mint a fresh `exid` per invoke (`domain.terms/trail.md`)
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.runLambdaEndpoint = exports.isLambdaEndpointErrorEnvelopeContemp = exports.isLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointErrorEnvelopeContemp = exports.asLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointOutput = exports.asLambdaContext = exports.asTrailExidHeaders = exports.getOneLambdaContract = exports.getAllLambdaFunctionsByPrefix = exports.getAllLambdaContracts = exports.genServiceSdk = exports.getValidatedOutput = exports.getValidatedInput = exports.genZodOutputValidationMiddleware = exports.genTrailMiddleware = exports.genIoLoggerMiddleware = exports.genIntrospectionMiddleware = exports.genInternalServiceErrorMiddleware = exports.genConstraintErrorMiddleware = exports.asContextTrailed = exports.genZodEventValidationMiddleware = exports.genZodInputValidationMiddleware = exports.genContentTypeCoherenceMiddleware = exports.genApiGatewayRequestEventNormalizationMiddleware = exports.isApiGatewayResponse = exports.asApiGatewayResponseSchema = exports.genLambdaEndpoint = exports.asLambdaEventSchema = exports.asLambdaEvent = exports.asLambdaEndpoint = exports.getAskLambdaCacheKey = exports.asCacheWithoutSet = exports.askLambdaEndpoint = exports.LambdaServiceNotFoundError = exports.LambdaIntrospectionNotSupportedError = exports.LambdaIntrospectionBlockedError = exports.LambdaFunctionNotFoundError = exports.LambdaEndpointError = exports.LambdaEndpoint = exports.LambdaDomainObjectRefUnbindableError = exports.LambdaDomainObjectNotCapturableError = exports.LambdaCredentialsAbsentError = exports.HttpStatusCode = exports.GeneratedFile = exports.delLambdaSdks = exports.BadRequestError = void 0;
|
|
13
|
+
exports.runLambdaEndpoint = exports.isLambdaEndpointErrorEnvelopeContemp = exports.isLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointErrorEnvelopeContemp = exports.asLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointOutput = exports.asLambdaContext = exports.asTrailExidHeaders = exports.getOneLambdaContract = exports.getAllLambdaFunctionsByPrefix = exports.getAllLambdaContracts = exports.genServiceSdk = exports.getValidatedOutput = exports.getValidatedInput = exports.genZodOutputValidationMiddleware = exports.genTrailMiddleware = exports.genIoLoggerMiddleware = exports.genIntrospectionMiddleware = exports.genInternalServiceErrorMiddleware = exports.genConstraintErrorMiddleware = exports.asContextTrailed = exports.genZodEventValidationMiddleware = exports.genZodInputValidationMiddleware = exports.genContentTypeCoherenceMiddleware = exports.genApiGatewayRequestEventNormalizationMiddleware = exports.isApiGatewayResponse = exports.asApiGatewayResponseSchema = exports.genLambdaEndpoint = exports.asLambdaEventSchema = exports.asLambdaEvent = exports.asLambdaEndpoint = exports.getAskLambdaCacheKey = exports.asCacheWithoutSet = exports.askLambdaEndpoint = exports.LambdaServiceNotFoundError = exports.LambdaIntrospectionNotSupportedError = exports.LambdaIntrospectionBlockedError = exports.LambdaFunctionNotFoundError = exports.LambdaEndpointRefusedError = exports.LambdaEndpointError = exports.LambdaEndpoint = exports.LambdaDomainObjectRefUnbindableError = exports.LambdaDomainObjectNotCapturableError = exports.LambdaCredentialsAbsentError = exports.HttpStatusCode = exports.GeneratedFile = exports.delLambdaSdks = exports.BadRequestError = void 0;
|
|
14
14
|
// re-export from helpful-errors for convenience
|
|
15
15
|
var helpful_errors_1 = require("helpful-errors");
|
|
16
16
|
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return helpful_errors_1.BadRequestError; } });
|
|
@@ -36,6 +36,8 @@ var LambdaEndpoint_1 = require("./domain.objects/LambdaEndpoint");
|
|
|
36
36
|
Object.defineProperty(exports, "LambdaEndpoint", { enumerable: true, get: function () { return LambdaEndpoint_1.LambdaEndpoint; } });
|
|
37
37
|
var LambdaEndpointError_1 = require("./domain.objects/LambdaEndpointError");
|
|
38
38
|
Object.defineProperty(exports, "LambdaEndpointError", { enumerable: true, get: function () { return LambdaEndpointError_1.LambdaEndpointError; } });
|
|
39
|
+
var LambdaEndpointRefusedError_1 = require("./domain.objects/LambdaEndpointRefusedError");
|
|
40
|
+
Object.defineProperty(exports, "LambdaEndpointRefusedError", { enumerable: true, get: function () { return LambdaEndpointRefusedError_1.LambdaEndpointRefusedError; } });
|
|
39
41
|
// contract discovery errors
|
|
40
42
|
var LambdaFunctionNotFoundError_1 = require("./domain.objects/LambdaFunctionNotFoundError");
|
|
41
43
|
Object.defineProperty(exports, "LambdaFunctionNotFoundError", { enumerable: true, get: function () { return LambdaFunctionNotFoundError_1.LambdaFunctionNotFoundError; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,gDAAgD;AAChD,iDAAiD;AAAxC,iHAAA,eAAe,OAAA;AAQxB;;;;;GAKG;AACH,kEAAkE;AAAzD,6GAAA,aAAa,OAAA;AAWtB,gEAA+D;AAAtD,8GAAA,aAAa,OAAA;AACtB,kEAAiE;AAAxD,gHAAA,cAAc,OAAA;AACvB,8FAA6F;AAApF,4IAAA,4BAA4B,OAAA;AACrC,8GAA6G;AAApG,4JAAA,oC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AC9E,0CAA0C;AAC1C,6HAKqF;AAJnF,qJAAA,oCAAoC,OAAA;AACpC,qJAAA,oCAAoC,OAAA;AACpC,qJAAA,oCAAoC,OAAA;AACpC,qJAAA,oCAAoC,OAAA;AAMtC,6FAA4F;AAAnF,sHAAA,iBAAiB,OAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"name": "sdk-aws-lambda",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "a simple and opinionated sdk for aws lambda. define endpoints, ask endpoints, auto-propagate trace-ids.",
|
|
5
|
-
"
|
|
5
|
+
"private": false,
|
|
6
|
+
"version": "0.8.2",
|
|
6
7
|
"repository": "ehmpathy/sdk-aws-lambda",
|
|
7
8
|
"homepage": "https://github.com/ehmpathy/sdk-aws-lambda",
|
|
8
9
|
"keywords": [
|
|
@@ -34,33 +35,38 @@
|
|
|
34
35
|
"fix:format": "npm run fix:format:biome",
|
|
35
36
|
"fix:lint": "biome check --write",
|
|
36
37
|
"fix": "npm run fix:format && npm run fix:lint",
|
|
37
|
-
"build:clean": "
|
|
38
|
-
"build:
|
|
38
|
+
"build:clean:bun": "rm -f ./bin/*.bc",
|
|
39
|
+
"build:clean:tsc": "(chmod -R u+w dist 2>/dev/null || true) && rm -rf dist/",
|
|
40
|
+
"build:clean": "npm run build:clean:tsc && npm run build:clean:bun",
|
|
41
|
+
"build:compile:tsc": "tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
|
|
42
|
+
"build:compile": "npm run build:compile:tsc && npm run build:compile:bun --if-present",
|
|
39
43
|
"build": "npm run build:clean && npm run build:compile && npm run build:complete --if-present",
|
|
40
|
-
"
|
|
44
|
+
"build:ifstale": "set -eu && if [ -f dist/.build.stamp ] && [ -z \"$(find src assets package.json pnpm-lock.yaml tsconfig.json tsconfig.build.json app.json app.config.ts -newer dist/.build.stamp -type f ! -name '*.test.ts' ! -name '*.test.tsx' ! -name '*.snap' -print -quit 2>/dev/null)\" ]; then echo '👌 dist is fresh, build skipped'; else npm run build && touch dist/.build.stamp; fi",
|
|
45
|
+
"test:commits": "LAST_TAG=$(git describe --tags --abbrev=0 @^ 2> /dev/null || git rev-list --max-parents=0 HEAD) && commitlint --from \"${LAST_TAG:-}\" --to HEAD --verbose",
|
|
41
46
|
"test:types": "tsc -p ./tsconfig.json --noEmit",
|
|
42
47
|
"test:format:biome": "biome format",
|
|
43
48
|
"test:format": "npm run test:format:biome",
|
|
44
|
-
"test:lint:deps": "
|
|
49
|
+
"test:lint:deps": "depcheck -c ./.depcheckrc.yml",
|
|
45
50
|
"test:lint:biome": "biome check --diagnostic-level=error",
|
|
46
51
|
"test:lint:biome:all": "biome check",
|
|
47
|
-
"test:lint": "npm run test:lint:biome && npm run test:lint:deps",
|
|
48
|
-
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=origin/main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
49
|
-
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=origin/main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
50
|
-
"test:acceptance:locally": "npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
51
|
-
"test": "npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally",
|
|
52
|
-
"test:acceptance": "npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
52
|
+
"test:lint": "npm run test:lint:biome && npm run test:lint:cycles && npm run test:lint:deps",
|
|
53
|
+
"test:unit": "set -eu && jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=origin/main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
54
|
+
"test:integration": "set -eu && jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=origin/main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
55
|
+
"test:acceptance:locally": "set -eu && npm run build:ifstale && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
56
|
+
"test": "set -eu && npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally",
|
|
57
|
+
"test:acceptance": "set -eu && npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
53
58
|
"prepush": "npm run test && npm run build",
|
|
54
59
|
"prepublish": "npm run build",
|
|
55
60
|
"preversion": "npm run prepush",
|
|
56
61
|
"postversion": "git push origin HEAD --tags --no-verify",
|
|
57
62
|
"prepare:husky": "husky install && chmod ug+x .husky/*",
|
|
58
63
|
"prepare:rhachet": "rhachet init --keys --hooks --roles mechanic behaver driver reviewer librarian ergonomist architect dispatcher learner achiever telepath operator observer deployer playwright enroller",
|
|
59
|
-
"prepare": "if [ -e .git ] && [ -z $CI ]; then npm run prepare:husky && npm run prepare:rhachet; fi",
|
|
60
|
-
"upgrade:rhachet": "rhachet upgrade"
|
|
64
|
+
"prepare": "if [ -e .git ] && [ -z \"${CI:-}\" ]; then npm run prepare:husky && npm run prepare:rhachet; fi",
|
|
65
|
+
"upgrade:rhachet": "rhachet upgrade",
|
|
66
|
+
"test:lint:cycles": "EXCL=$(node -p \"(require('yaml').parse(require('fs').readFileSync('.dpdmrc.yaml','utf8'))?.exclude ?? []).join('|')\") && dpdm --no-warning --no-tree --transform --exit-code circular:1 --exclude \"$EXCL\" 'src/**/!(*.test).ts'"
|
|
61
67
|
},
|
|
62
68
|
"dependencies": {
|
|
63
|
-
"@aws-sdk/client-lambda": "3.
|
|
69
|
+
"@aws-sdk/client-lambda": "3.1183.0",
|
|
64
70
|
"@biomejs/biome": "2.3.8",
|
|
65
71
|
"@ehmpathy/error-fns": "^1.3.7",
|
|
66
72
|
"@middy/core": "4.7.0",
|
|
@@ -69,18 +75,20 @@
|
|
|
69
75
|
"@middy/http-response-serializer": "4.7.0",
|
|
70
76
|
"@middy/http-security-headers": "4.7.0",
|
|
71
77
|
"domain-objects": "0.34.0",
|
|
72
|
-
"helpful-errors": "1.7.
|
|
78
|
+
"helpful-errors": "1.7.5",
|
|
73
79
|
"sdk-environment": "0.1.5",
|
|
74
|
-
"sdk-logs": "0.9.
|
|
75
|
-
"simple-in-memory-cache": "0.
|
|
80
|
+
"sdk-logs": "0.9.2",
|
|
81
|
+
"simple-in-memory-cache": "0.5.1",
|
|
76
82
|
"type-fns": "1.21.5",
|
|
77
|
-
"with-simple-cache": "0.
|
|
78
|
-
"yaml": "2.9.
|
|
83
|
+
"with-simple-cache": "0.17.3",
|
|
84
|
+
"yaml": "2.9.1",
|
|
79
85
|
"zod": "4.4.3"
|
|
80
86
|
},
|
|
81
87
|
"devDependencies": {
|
|
88
|
+
"@biomejs/biome": "2.3.8",
|
|
82
89
|
"@commitlint/cli": "19.5.0",
|
|
83
90
|
"@commitlint/config-conventional": "19.5.0",
|
|
91
|
+
"@jest/globals": "30.2.0",
|
|
84
92
|
"@swc/core": "1.15.3",
|
|
85
93
|
"@swc/jest": "0.2.39",
|
|
86
94
|
"@tsconfig/node20": "20.1.5",
|
|
@@ -92,37 +100,50 @@
|
|
|
92
100
|
"archiver": "8.0.0",
|
|
93
101
|
"cz-conventional-changelog": "3.3.0",
|
|
94
102
|
"declapract": "^0.13.27",
|
|
95
|
-
"declapract-typescript-ehmpathy": "^0.
|
|
96
|
-
"declastruct": "1.
|
|
103
|
+
"declapract-typescript-ehmpathy": "^0.51.2",
|
|
104
|
+
"declastruct": "1.9.2",
|
|
97
105
|
"declastruct-aws": "^1.5.2",
|
|
98
|
-
"declastruct-github": "1.
|
|
106
|
+
"declastruct-github": "1.8.0",
|
|
99
107
|
"depcheck": "1.4.3",
|
|
108
|
+
"dpdm": "4.0.1",
|
|
100
109
|
"esbuild": "0.28.1",
|
|
101
110
|
"esbuild-register": "3.6.0",
|
|
102
111
|
"husky": "8.0.3",
|
|
103
112
|
"iso-time": "1.11.7",
|
|
104
113
|
"jest": "30.2.0",
|
|
105
|
-
"rhachet": "1.
|
|
114
|
+
"rhachet": "1.55.1",
|
|
106
115
|
"rhachet-brains-anthropic": "0.4.3",
|
|
107
116
|
"rhachet-brains-fireworksai": "0.2.3",
|
|
108
|
-
"rhachet-brains-openrouter": "0.
|
|
117
|
+
"rhachet-brains-openrouter": "0.2.0",
|
|
109
118
|
"rhachet-brains-xai": "0.3.3",
|
|
110
|
-
"rhachet-roles-bhrain": "0.
|
|
111
|
-
"rhachet-roles-bhrowser": "0.
|
|
112
|
-
"rhachet-roles-bhuild": "0.
|
|
113
|
-
"rhachet-roles-ehmpathy": "1.
|
|
119
|
+
"rhachet-roles-bhrain": "0.45.0",
|
|
120
|
+
"rhachet-roles-bhrowser": "0.3.0",
|
|
121
|
+
"rhachet-roles-bhuild": "0.26.0",
|
|
122
|
+
"rhachet-roles-ehmpathy": "1.46.0",
|
|
114
123
|
"rhachet-roles-ghlitch": "0.4.0",
|
|
115
124
|
"rhachet-roles-rhachet": "0.1.7",
|
|
116
|
-
"
|
|
125
|
+
"sdk-logs": "0.9.2",
|
|
126
|
+
"test-fns": "1.17.0",
|
|
117
127
|
"tsc-alias": "1.8.10",
|
|
118
128
|
"tsx": "4.20.6",
|
|
119
|
-
"typescript": "
|
|
120
|
-
"yalc": "1.0.0-pre.53"
|
|
129
|
+
"typescript": "7.0.2",
|
|
130
|
+
"yalc": "1.0.0-pre.53",
|
|
131
|
+
"yaml": "2.9.1"
|
|
121
132
|
},
|
|
122
133
|
"config": {
|
|
123
134
|
"commitizen": {
|
|
124
135
|
"path": "./node_modules/cz-conventional-changelog"
|
|
125
136
|
}
|
|
126
137
|
},
|
|
127
|
-
"packageManager": "pnpm@10.
|
|
138
|
+
"packageManager": "pnpm@10.34.5",
|
|
139
|
+
"pnpm": {
|
|
140
|
+
"allowUnusedPatches": true,
|
|
141
|
+
"ignorePatchFailures": true,
|
|
142
|
+
"patchedDependencies": {
|
|
143
|
+
"@middy/core@4.7.0": "patches/@middy__core@4.7.0.patch",
|
|
144
|
+
"@middy/http-cors@4.7.0": "patches/@middy__http-cors@4.7.0.patch",
|
|
145
|
+
"@middy/http-response-serializer@4.7.0": "patches/@middy__http-response-serializer@4.7.0.patch",
|
|
146
|
+
"@middy/http-security-headers@4.7.0": "patches/@middy__http-security-headers@4.7.0.patch"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
128
149
|
}
|
package/readme.md
CHANGED
|
@@ -159,6 +159,8 @@ retried, and an answer the sdk cannot read retries the whole batch. its event so
|
|
|
159
159
|
a caller fault is never retried. a message the schema refuses, or a `ConstraintError` (or
|
|
160
160
|
`BadRequestError`) a `perRecord` handler throws, logs `sqs.record.refused` at warn and is deleted,
|
|
161
161
|
with no dead-letter entry. to retry a fault, throw a `MalfunctionError`; every other throw redrives.
|
|
162
|
+
a peer's refusal of a request the handler composed is the handler's own fault, so it redrives too
|
|
163
|
+
(see [when the endpoint refuses the request](#when-the-endpoint-refuses-the-request)).
|
|
162
164
|
|
|
163
165
|
- `sqs.record.refused` carries the full message as delivered (`message`: body, attributes, queue
|
|
164
166
|
arn), so an operator can requeue it from the log. alarm on its volume: a schema bug of ours
|
|
@@ -256,6 +258,43 @@ const result = await askLambdaEndpoint<TRequest, TResponse>(
|
|
|
256
258
|
|
|
257
259
|
the caller's `trail.exid` rides along, so logs correlate across the call.
|
|
258
260
|
|
|
261
|
+
### when the endpoint refuses the request
|
|
262
|
+
|
|
263
|
+
a peer that answers `ConstraintError` or `BadRequestError` (or an http 4xx) refuses the request **you
|
|
264
|
+
composed**. that is your malfunction, not your caller's fault, so the ask throws
|
|
265
|
+
`LambdaEndpointRefusedError`, a `MalfunctionError`. an api gateway endpoint then answers its caller a
|
|
266
|
+
500 with a `correlationId`, never a 400 the caller cannot fix, and logs the failure at error. the
|
|
267
|
+
message names the peer, its reason, and the fix.
|
|
268
|
+
|
|
269
|
+
where the request forwards your own caller's input verbatim, the refusal is your caller's to fix. opt
|
|
270
|
+
in per call, and the ask throws a `ConstraintError` instead:
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
await askLambdaEndpoint(
|
|
274
|
+
{ which, event, refusal: { as: 'ConstraintError' } },
|
|
275
|
+
{ log, env: { access: 'prep' } },
|
|
276
|
+
);
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
⚠️ upgrade from 0.7: a `catch (e) { if (e instanceof ConstraintError) … }` around an ask no longer
|
|
280
|
+
sees a peer refusal, with no compile error. catch `LambdaEndpointRefusedError`, or opt in where the
|
|
281
|
+
call forwards. in a `forSqs.perRecord` handler, a peer refusal now redrives the message, then
|
|
282
|
+
dead-letters it, unless the call opts in. a failed async invoke is retried by aws, and a retry
|
|
283
|
+
wrapper that retries a `MalfunctionError` retries a refusal too.
|
|
284
|
+
|
|
285
|
+
every failure an endpoint's chain observes logs `handler.output` at warn (a caller fault) or error
|
|
286
|
+
(all else), with its message and stack, where 0.7 logged it at debug. a warn-keyed alarm sees more
|
|
287
|
+
volume. one exception: a caller fault a `forSqs.perRecord` handler throws is acknowledged inside
|
|
288
|
+
the leaf, so the chain sees a success and writes `handler.output` at debug. its trace is the
|
|
289
|
+
`sqs.record.refused` warn line above.
|
|
290
|
+
|
|
291
|
+
a function generated by `genServiceSdk` takes the same opt as a third argument:
|
|
292
|
+
`svcJobs.getJob(event, context, { refusal: { as: 'ConstraintError' } })`. regenerate the sdk to get
|
|
293
|
+
the slot.
|
|
294
|
+
|
|
295
|
+
an http 429 is a throttle, not a refusal: it throws a `MalfunctionError` under either opt, with
|
|
296
|
+
`retry-after` in `metadata.headers`.
|
|
297
|
+
|
|
259
298
|
### ask an api gateway endpoint, over http
|
|
260
299
|
|
|
261
300
|
```ts
|
|
@@ -269,8 +308,9 @@ const { status, body } = await askLambdaEndpoint.viaApiGateway<TResponse>(
|
|
|
269
308
|
|
|
270
309
|
takes the standard http request: `{ url, method, headers, body }`. an object `body` is sent as json.
|
|
271
310
|
|
|
272
|
-
it resolves `{ status, headers, text, body }`. a 4xx throws a `
|
|
273
|
-
`
|
|
311
|
+
it resolves `{ status, headers, text, body }`. a 4xx throws a `LambdaEndpointRefusedError` (or a
|
|
312
|
+
`ConstraintError`, with `refusal: { as: 'ConstraintError' }`); a 429 or a 5xx throws a
|
|
313
|
+
`MalfunctionError`, and a 5xx carries the `correlationId`. your trail rides the request, so the endpoint's
|
|
274
314
|
logs join yours.
|
|
275
315
|
|
|
276
316
|
any other http caller spreads the `x-trail-exid` header in to send the trail. the header also opts the
|