vr-commons 1.0.153 → 1.0.154

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.
@@ -255,31 +255,25 @@ export declare const enableDevicesSchema: z.ZodObject<{
255
255
  };
256
256
  }>;
257
257
  export declare const makeDevicesPermanentSchema: z.ZodObject<{
258
- body: z.ZodEffects<z.ZodObject<{
259
- pairIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
260
- serialNumbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
258
+ body: z.ZodObject<{
259
+ pairIds: z.ZodArray<z.ZodString, "many">;
260
+ reason: z.ZodOptional<z.ZodString>;
261
261
  }, "strip", z.ZodTypeAny, {
262
- pairIds?: string[] | undefined;
263
- serialNumbers?: string[] | undefined;
264
- }, {
265
- pairIds?: string[] | undefined;
266
- serialNumbers?: string[] | undefined;
267
- }>, {
268
- pairIds?: string[] | undefined;
269
- serialNumbers?: string[] | undefined;
262
+ pairIds: string[];
263
+ reason?: string | undefined;
270
264
  }, {
271
- pairIds?: string[] | undefined;
272
- serialNumbers?: string[] | undefined;
265
+ pairIds: string[];
266
+ reason?: string | undefined;
273
267
  }>;
274
268
  }, "strip", z.ZodTypeAny, {
275
269
  body: {
276
- pairIds?: string[] | undefined;
277
- serialNumbers?: string[] | undefined;
270
+ pairIds: string[];
271
+ reason?: string | undefined;
278
272
  };
279
273
  }, {
280
274
  body: {
281
- pairIds?: string[] | undefined;
282
- serialNumbers?: string[] | undefined;
275
+ pairIds: string[];
276
+ reason?: string | undefined;
283
277
  };
284
278
  }>;
285
279
  export declare const checkAvailabilitySchema: z.ZodObject<{
@@ -130,13 +130,11 @@ exports.enableDevicesSchema = zod_1.z.object({
130
130
  });
131
131
  // Make permanent schema
132
132
  exports.makeDevicesPermanentSchema = zod_1.z.object({
133
- body: zod_1.z.object(flexibleIdentifiersSchema).refine((data) => {
134
- const hasPairIds = data.pairIds && data.pairIds.length > 0;
135
- const hasSerialNumbers = data.serialNumbers && data.serialNumbers.length > 0;
136
- return ((hasPairIds || hasSerialNumbers) && !(hasPairIds && hasSerialNumbers));
137
- }, {
138
- message: "Either pairIds or serialNumbers must be provided, but not both",
139
- path: ["pairIds"],
133
+ body: zod_1.z.object({
134
+ pairIds: zod_1.z
135
+ .array(zod_1.z.string().regex(exports.PAIR_ID_REGEX, PAIR_ID_ERROR))
136
+ .min(1, "At least one pair ID required"),
137
+ reason: zod_1.z.string().optional(),
140
138
  }),
141
139
  });
142
140
  // Check availability schema (for assignment flow)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.153",
3
+ "version": "1.0.154",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",