@message-queue-toolkit/core
Version:
Useful utilities, interfaces and base classes for message queue handling. Supports AMQP and SQS with a common abstraction on top currently
20 lines • 1 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.OFFLOADED_PAYLOAD_POINTER_PAYLOAD_SCHEMA = void 0;
exports.isOffloadedPayloadPointerPayload = isOffloadedPayloadPointerPayload;
const zod_1 = require("zod");
/**
* When the payload is too large to be sent in a single message, it is offloaded to a storage service and a pointer to the offloaded payload is sent instead.
* This schema represents the payload that is sent in place of the original payload.
*/
exports.OFFLOADED_PAYLOAD_POINTER_PAYLOAD_SCHEMA = zod_1.z
.object({
offloadedPayloadPointer: zod_1.z.string().min(1),
offloadedPayloadSize: zod_1.z.number().int().positive(),
})
// Pass-through allows to pass message ID, type, timestamp and message-deduplication-related fields that are using dynamic keys.
.passthrough();
function isOffloadedPayloadPointerPayload(value) {
return value.offloadedPayloadPointer !== undefined;
}
//# sourceMappingURL=offloadedPayloadMessageSchemas.js.map
;