{"version":3,"sources":["../../src/types/WebhookTypes.ts"],"sourcesContent":["import { deliveryResponseSchema, latLngSchema, refundDataSchema } from './DaasTypes'\nimport { z } from 'zod'\n\nexport enum WebhookEventKind {\n    DeliveryStatus = 'event.delivery_status',\n    CourierUpdate = 'event.courier_update',\n    RefundRequest = 'event.refund_request',\n    DapiStatusChanged = 'dapi.status_changed',\n    DapiRefundRequested = 'dapi.refund_requested',\n}\n\nexport const webhookEventKindSchema = z.nativeEnum(WebhookEventKind)\n\nexport const courierUpdateSchema = z.object({\n    location: latLngSchema.optional(),\n    kind: webhookEventKindSchema.describe('The kind of the event (always \"event.courier_update\")'),\n    live_mode: z.boolean().describe('Flag indicating if the event applies to a live vs. a test delivery'),\n    delivery_id: z.string().describe('The ID of the delivery the event applies to'),\n    job_id: z.string().optional().describe('The ID of the job the event applies to'),\n    data: deliveryResponseSchema,\n})\n\nexport type CourierUpdateWebookEvent = z.infer<typeof courierUpdateSchema>\n\nexport const refundRequestEventSchema = z.object({\n    kind: webhookEventKindSchema.describe('The kind of the event, (always \"event.courier_update\") '),\n    created: z.number().describe('Timestamp indicating when the event was generated.'),\n    delivery_id: z.string().describe('The ID of the delivery the event applies to.'),\n    id: z.string().describe('A unique ID for this event instance.'),\n    data: refundDataSchema.describe('Information about the refund.'),\n    external_id: z.string().optional().describe('An ID for an account as stored in an external system.'),\n    external_order_id: z.string().optional().describe('An ID for delivery in an external system.'),\n})\n\nexport type RefundRequestWebhookEvent = z.infer<typeof refundRequestEventSchema>\n\nexport const DeliveryStatusWebhookEventSchema = z.object({\n    status: z.string().describe('Status of the delivery the event refers to.'),\n    kind: z.string().describe('The kind of event in more detail (event.delivery_status).'),\n    created: z.string().describe('Timestamp indicating when the event was generated.'),\n    live_mode: z.boolean().describe('A flag indicating if the event applies to a live vs a test delivery.'),\n    delivery_id: z.string().describe('The id of the delivery the event applies to.'),\n    id: z.string().describe('A unique id for this event instance.'),\n    data: deliveryResponseSchema.describe('Information about the delivery'),\n    customer_id: z.string().describe('Unique identifier (prefixed cus_) for the customer this delivery belongs to.'),\n    developer_id: z.string().describe('Unique identifier (prefixed dev_) for the developer the above customer_id maps to.'),\n    account_id: z.string().describe('Unique identifier (prefixed acc_) for the account of the above developer that this delivery belongs to.'),\n    batch_id: z.string().describe('When a delivery is batched, this unique identifier (prefixed bat_) indicates the batch that this delivery belongs to. Can be used to identify deliveries batched with the same courier.'),\n    route_id: z.string().describe('Unique identifier (prefixed rte_) of the route a courier is taking.'),\n})\n\nexport type DeliveryStatusWebhookEvent = z.infer<typeof DeliveryStatusWebhookEventSchema>\n"],"mappings":";AAAA,SAAS,wBAAwB,cAAc,wBAAwB;AACvE,SAAS,SAAS;AAEX,IAAK,mBAAL,kBAAKA,sBAAL;AACH,EAAAA,kBAAA,oBAAiB;AACjB,EAAAA,kBAAA,mBAAgB;AAChB,EAAAA,kBAAA,mBAAgB;AAChB,EAAAA,kBAAA,uBAAoB;AACpB,EAAAA,kBAAA,yBAAsB;AALd,SAAAA;AAAA,GAAA;AAQL,MAAM,yBAAyB,EAAE,WAAW,gBAAgB;AAE5D,MAAM,sBAAsB,EAAE,OAAO;AAAA,EACxC,UAAU,aAAa,SAAS;AAAA,EAChC,MAAM,uBAAuB,SAAS,uDAAuD;AAAA,EAC7F,WAAW,EAAE,QAAQ,EAAE,SAAS,oEAAoE;AAAA,EACpG,aAAa,EAAE,OAAO,EAAE,SAAS,6CAA6C;AAAA,EAC9E,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,wCAAwC;AAAA,EAC/E,MAAM;AACV,CAAC;AAIM,MAAM,2BAA2B,EAAE,OAAO;AAAA,EAC7C,MAAM,uBAAuB,SAAS,yDAAyD;AAAA,EAC/F,SAAS,EAAE,OAAO,EAAE,SAAS,oDAAoD;AAAA,EACjF,aAAa,EAAE,OAAO,EAAE,SAAS,8CAA8C;AAAA,EAC/E,IAAI,EAAE,OAAO,EAAE,SAAS,sCAAsC;AAAA,EAC9D,MAAM,iBAAiB,SA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