UNPKG

@fairmint/canton-node-sdk

Version:
114 lines 4.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JsSubmitAndWaitForReassignmentResponseSchema = exports.JsReassignmentSchema = exports.JsReassignmentEventSchema = exports.JsUnassignedEventSchema = exports.JsAssignmentEventSchema = exports.SubmitAndWaitForReassignmentRequestSchema = exports.SubmitReassignmentResponseSchema = exports.SubmitReassignmentRequestSchema = exports.ReassignmentCommandsSchema = exports.ReassignmentCommandSchema = void 0; const zod_1 = require("zod"); const commands_1 = require("./commands"); const event_details_1 = require("./event-details"); const events_1 = require("./events"); const common_1 = require("../common"); /** * Reassignment command wrapper. */ exports.ReassignmentCommandSchema = zod_1.z.object({ /** The reassignment command. */ command: zod_1.z.union([ zod_1.z.object({ AssignCommand: commands_1.AssignCommandSchema }), zod_1.z.object({ UnassignCommand: commands_1.UnassignCommandSchema }), zod_1.z.object({ Empty: event_details_1.EmptyCommandSchema }), ]), }); /** * Reassignment commands container. */ exports.ReassignmentCommandsSchema = zod_1.z.object({ /** Workflow ID (optional). */ workflowId: zod_1.z.string().optional(), /** User ID submitting the command. */ userId: zod_1.z.string(), /** Unique identifier for the command. */ commandId: zod_1.z.string(), /** Party submitting the command. */ submitter: zod_1.z.string(), /** Submission ID (optional). */ submissionId: zod_1.z.string().optional(), /** List of reassignment commands. */ commands: zod_1.z.array(exports.ReassignmentCommandSchema), }); /** * Submit reassignment request. */ exports.SubmitReassignmentRequestSchema = zod_1.z.object({ /** The reassignment commands to submit. */ reassignmentCommands: exports.ReassignmentCommandsSchema, }); /** * Submit reassignment response. */ exports.SubmitReassignmentResponseSchema = zod_1.z.object({}); /** * Submit and wait for reassignment request. */ exports.SubmitAndWaitForReassignmentRequestSchema = zod_1.z.object({ /** The reassignment commands to submit. */ reassignmentCommands: exports.ReassignmentCommandsSchema, /** Event format for the response (optional). */ eventFormat: events_1.EventFormatSchema.optional(), }); /** * Assignment event details. */ exports.JsAssignmentEventSchema = zod_1.z.object({ /** Source synchronizer ID. */ source: zod_1.z.string(), /** Target synchronizer ID. */ target: zod_1.z.string(), /** Reassignment ID. */ reassignmentId: zod_1.z.string(), /** Party submitting the assignment. */ submitter: zod_1.z.string(), /** Reassignment counter. */ reassignmentCounter: zod_1.z.number(), /** Created event details. */ createdEvent: event_details_1.CreatedEventDetailsSchema, }); /** * Unassigned event details. */ exports.JsUnassignedEventSchema = zod_1.z.object({ /** Unassigned event details. */ value: event_details_1.UnassignedEventDetailsSchema, }); /** * Reassignment event (oneOf assignment or unassigned). */ exports.JsReassignmentEventSchema = zod_1.z.union([ zod_1.z.object({ JsAssignmentEvent: exports.JsAssignmentEventSchema }), zod_1.z.object({ JsUnassignedEvent: exports.JsUnassignedEventSchema }), ]); /** * Complete reassignment view. */ exports.JsReassignmentSchema = zod_1.z.object({ /** Unique update ID for the reassignment. */ updateId: zod_1.z.string(), /** Command ID that resulted in this reassignment (optional). */ commandId: zod_1.z.string().optional(), /** Workflow ID (optional). */ workflowId: zod_1.z.string().optional(), /** Offset of the reassignment. */ offset: zod_1.z.number(), /** Collection of reassignment events. */ events: zod_1.z.array(exports.JsReassignmentEventSchema), /** Trace context (optional). */ traceContext: common_1.TraceContextSchema.optional(), /** Record time of the reassignment. */ recordTime: zod_1.z.string(), }); /** * Submit and wait for reassignment response. */ exports.JsSubmitAndWaitForReassignmentResponseSchema = zod_1.z.object({ /** The reassignment that resulted from the submitted command. */ reassignment: exports.JsReassignmentSchema, }); //# sourceMappingURL=reassignment.js.map