@heynixie/contract 0.61.0 → 0.63.0
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/host-contract.d.ts +33 -0
- package/dist/index.js +18 -1
- package/package.json +1 -1
package/dist/host-contract.d.ts
CHANGED
|
@@ -166,6 +166,39 @@ export declare const hostContract: {
|
|
|
166
166
|
status: number;
|
|
167
167
|
};
|
|
168
168
|
}>, Record<never, never>>;
|
|
169
|
+
raise: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
170
|
+
taskID: z.ZodString;
|
|
171
|
+
turns: z.ZodOptional<z.ZodInt>;
|
|
172
|
+
dollars: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
174
|
+
taskID: z.ZodString;
|
|
175
|
+
state: z.ZodEnum<{
|
|
176
|
+
closed: "closed";
|
|
177
|
+
done: "done";
|
|
178
|
+
failed: "failed";
|
|
179
|
+
paused: "paused";
|
|
180
|
+
ready: "ready";
|
|
181
|
+
running: "running";
|
|
182
|
+
stopped: "stopped";
|
|
183
|
+
waiting: "waiting";
|
|
184
|
+
}>;
|
|
185
|
+
isPauseRequested: z.ZodBoolean;
|
|
186
|
+
turns: z.ZodInt;
|
|
187
|
+
dollars: z.ZodNumber;
|
|
188
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
189
|
+
TASK_NOT_FOUND: {
|
|
190
|
+
message: string;
|
|
191
|
+
status: number;
|
|
192
|
+
};
|
|
193
|
+
TASK_NOT_AT_LIMIT: {
|
|
194
|
+
message: string;
|
|
195
|
+
status: number;
|
|
196
|
+
};
|
|
197
|
+
LIMIT_NOT_RAISED: {
|
|
198
|
+
message: string;
|
|
199
|
+
status: number;
|
|
200
|
+
};
|
|
201
|
+
}>, Record<never, never>>;
|
|
169
202
|
};
|
|
170
203
|
sessions: {
|
|
171
204
|
issueCode: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -1145,7 +1145,24 @@ var hostContract = {
|
|
|
1145
1145
|
close: taskControl2.errors({
|
|
1146
1146
|
CONVERSATION_NEVER_CLOSES: { message: "the conversation is never closed", status: 409 }
|
|
1147
1147
|
}),
|
|
1148
|
-
interrupt: taskControl2
|
|
1148
|
+
interrupt: taskControl2,
|
|
1149
|
+
raise: oc3.errors({
|
|
1150
|
+
TASK_NOT_FOUND: { message: "no task has that ID", status: 404 },
|
|
1151
|
+
TASK_NOT_AT_LIMIT: { message: "the task is not paused at its limit", status: 409 },
|
|
1152
|
+
LIMIT_NOT_RAISED: { message: "the new limits are not above the old ones", status: 409 }
|
|
1153
|
+
}).input(z10.strictObject({
|
|
1154
|
+
taskID: z10.string().min(1),
|
|
1155
|
+
turns: z10.int().positive().optional(),
|
|
1156
|
+
dollars: z10.number().positive().optional()
|
|
1157
|
+
}).refine((input) => input.turns !== undefined || input.dollars !== undefined, {
|
|
1158
|
+
message: "a raise sets turns, dollars or both"
|
|
1159
|
+
})).output(z10.object({
|
|
1160
|
+
taskID: z10.string(),
|
|
1161
|
+
state: hostTaskStateSchema,
|
|
1162
|
+
isPauseRequested: z10.boolean(),
|
|
1163
|
+
turns: z10.int().positive(),
|
|
1164
|
+
dollars: z10.number().positive()
|
|
1165
|
+
}))
|
|
1149
1166
|
},
|
|
1150
1167
|
sessions: {
|
|
1151
1168
|
issueCode: oc3.output(z10.object({ code: z10.string(), expiresAt: z10.date() })),
|