import { P as PlatformAdapterInterface, a as HTTPMethod, A as ActionHandlerResult, G as GenericCreateAppRegisterHandlerOptions, d as WebhookContext } from '../../saleor-webhook-De0XK_dM.js'; import { APIGatewayProxyEventV2, Context, APIGatewayProxyStructuredResultV2 } from 'aws-lambda'; import { C as CreateManifestHandlerOptions$1, P as ProtectedHandlerContext, G as GenericSaleorWebhook, a as GenericWebhookConfig } from '../../generic-saleor-webhook-wKiXRuB5.js'; import { APL } from '../../APL/index.js'; import { Permission, AsyncWebhookEventType, SyncWebhookEventType } from '../../types.js'; import '../../saleor-app.js'; import 'graphql'; import '../../verify-signature-mKf0fpOE.js'; type AwsLambdaHandlerInput = APIGatewayProxyEventV2; type AWSLambdaHandler = (event: APIGatewayProxyEventV2, context: Context) => Promise; /** PlatformAdapter for AWS Lambda HTTP events * * Platform adapters are used in Actions to handle generic request logic * like getting body, headers, etc. * * Thanks to this Actions logic can be re-used for each platform * @see {PlatformAdapterInterface} * */ declare class AwsLambdaAdapter implements PlatformAdapterInterface { private event; private context; request: AwsLambdaHandlerInput; constructor(event: APIGatewayProxyEventV2, context: Context); getHeader(requestedName: string): string | null; getBody(): Promise; getRawBody(): Promise; private DEFAULT_STAGE_NAME; getBaseUrl(): string; get method(): HTTPMethod; send(result: ActionHandlerResult): Promise; } type CreateAppRegisterHandlerOptions = GenericCreateAppRegisterHandlerOptions; /** * Returns API route handler for AWS Lambda HTTP triggered events * (created by Amazon API Gateway, Lambda Function URL) * that use signature: (event: APIGatewayProxyEventV2, context: Context) => APIGatewayProxyResultV2 * * Handler is for register endpoint that is called by Saleor when installing the app * * It verifies the request and stores `app_token` from Saleor * in APL and along with all required AuthData fields (jwks, saleorApiUrl, ...) * * **Recommended path**: `/api/register` * (configured in manifest handler) * * To learn more check Saleor docs * @see {@link https://docs.saleor.io/developer/extending/apps/architecture/app-requirements#register-url} * @see {@link https://www.npmjs.com/package/@types/aws-lambda} * */ declare const createAppRegisterHandler: (config: CreateAppRegisterHandlerOptions) => AWSLambdaHandler; type CreateManifestHandlerOptions = CreateManifestHandlerOptions$1; /** Returns app manifest API route handler for AWS Lambda HTTP triggered events * (created by Amazon API Gateway, Lambda Function URL) * that use signature: (event: APIGatewayProxyEventV2, context: Context) => APIGatewayProxyResultV2 * * App manifest is an endpoint that Saleor will call your App metadata. * It has the App's name and description, as well as all the necessary information to * register webhooks, permissions, and extensions. * * **Recommended path**: `/api/manifest` * * To learn more check Saleor docs * @see {@link https://docs.saleor.io/developer/extending/apps/architecture/app-requirements#manifest-url} * */ declare const createManifestHandler: (config: CreateManifestHandlerOptions) => AWSLambdaHandler; type AwsLambdaProtectedHandler = (event: APIGatewayProxyEventV2, context: Context, saleorContext: ProtectedHandlerContext) => Promise | APIGatewayProxyStructuredResultV2; /** * Wraps provided function, to ensure incoming request comes from Saleor Dashboard. * Also provides additional `saleorContext` object containing request properties. */ declare const createProtectedHandler: (handlerFn: AwsLambdaProtectedHandler, apl: APL, requiredPermissions?: Permission[]) => AWSLambdaHandler; type WebhookConfig = GenericWebhookConfig; /** Function type provided by consumer in `SaleorWebApiWebhook.createHandler` */ type AwsLambdaWebhookHandler = (event: AwsLambdaHandlerInput, context: Context, ctx: WebhookContext) => Promise | APIGatewayProxyStructuredResultV2; declare abstract class SaleorWebApiWebhook extends GenericSaleorWebhook { /** * Wraps provided function, to ensure incoming request comes from registered Saleor instance. * Also provides additional `context` object containing typed payload and request properties. */ createHandler(handlerFn: AwsLambdaWebhookHandler): AWSLambdaHandler; } declare class SaleorAsyncWebhook extends SaleorWebApiWebhook { readonly event: AsyncWebhookEventType; protected readonly eventType: "async"; constructor(configuration: WebhookConfig); createHandler(handlerFn: AwsLambdaWebhookHandler): AWSLambdaHandler; } type AwsLambdaSyncWebhookHandler = AwsLambdaWebhookHandler; declare class SaleorSyncWebhook extends SaleorWebApiWebhook { readonly event: TEvent; protected readonly eventType: "sync"; constructor(configuration: WebhookConfig); createHandler(handlerFn: AwsLambdaSyncWebhookHandler): AWSLambdaHandler; } export { type AWSLambdaHandler, AwsLambdaAdapter, type AwsLambdaHandlerInput, type AwsLambdaProtectedHandler, type AwsLambdaSyncWebhookHandler, type CreateAppRegisterHandlerOptions, type CreateManifestHandlerOptions, SaleorAsyncWebhook, SaleorSyncWebhook, createAppRegisterHandler, createManifestHandler, createProtectedHandler };