@encatch/schema 0.1.23 → 0.1.25

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/esm/index.js CHANGED
@@ -409,22 +409,19 @@ var AnswerItemSchema = z2.object({
409
409
  long_text: z2.string().optional().describe("Long text answer, e.g., paragraph or essay"),
410
410
  short_answer: z2.string().optional().describe("Short text answer, e.g., single sentence or word"),
411
411
  single_choice: z2.string().optional().describe(
412
- "Array with a single selected option ID (for single choice questions)"
412
+ "single selected option ID (for single choice questions)"
413
413
  ),
414
414
  rating: z2.number().optional().describe("Star rating value (e.g., 1-5)"),
415
415
  multiple_choice_multiple: z2.array(z2.string()).optional().describe("Array of selected option IDs for multiple choice questions"),
416
416
  annotation: AnnotationSchema.optional().describe(
417
417
  "Annotation object containing file and marker details"
418
+ ),
419
+ others: z2.string().optional().describe(
420
+ "For multiple choice questions and single choice questions, this is the value of the other option"
418
421
  )
419
- }).catchall(z2.any()).describe(
422
+ }).describe(
420
423
  "Flexible answer item supporting various question types and custom fields"
421
424
  );
422
- var QuestionsResponseSchema = z2.object({
423
- question_id: z2.string(),
424
- title: z2.string(),
425
- answer: AnswerItemSchema,
426
- type: z2.string()
427
- });
428
425
  var AnswerSchema = AnswerItemSchema;
429
426
 
430
427
  // src/schemas/fields/form-schema.ts
@@ -1001,28 +998,35 @@ var DeviceThemes = {
1001
998
  SYSTEM: "system"
1002
999
  };
1003
1000
  var deviceInfoSchema = z10.object({
1004
- deviceType: z10.string().describe("Type of device being used"),
1005
- timezone: z10.string().describe("Device timezone (e.g., 'Asia/Calcutta')"),
1006
- theme: deviceThemeSchema.describe("Current theme mode preference"),
1007
- os: z10.string().describe("Operating system running on the device"),
1008
- osVersion: z10.string().describe("Version of the operating system"),
1009
- appVersion: z10.string().describe("Version of the application"),
1010
- app: z10.string().describe("Browser or application being used"),
1011
- language: z10.string().describe("Language preference (e.g., 'en-GB')")
1001
+ $deviceType: z10.string().describe("Type of device being used"),
1002
+ $timezone: z10.string().describe("Device timezone (e.g., 'Asia/Calcutta')"),
1003
+ $theme: deviceThemeSchema.describe("Current theme mode preference"),
1004
+ $os: z10.string().describe("Operating system running on the device"),
1005
+ $osVersion: z10.string().describe("Version of the operating system"),
1006
+ $appVersion: z10.string().describe("Version of the application"),
1007
+ $app: z10.string().describe("Browser or application being used"),
1008
+ $language: z10.string().describe("Language preference (e.g., 'en-GB')")
1012
1009
  }).describe("Device information collected from the client");
1013
1010
  var sessionInfoSchema = z10.object({
1014
- sessionId: z10.string().uuid().describe("Unique session identifier")
1011
+ $sessionId: z10.string().uuid().describe("Unique session identifier"),
1012
+ $timestamp: z10.string().optional().describe("ISO timestamp of the session")
1015
1013
  }).describe("Session information for tracking user sessions");
1016
1014
  var deviceSessionInfoSchema = z10.object({
1017
1015
  deviceInfo: deviceInfoSchema.describe("Device information"),
1018
1016
  sessionInfo: sessionInfoSchema.describe("Session information")
1019
1017
  }).describe("Combined device and session information");
1020
1018
  var userPropertiesSchema = z10.object({
1021
- $counter: z10.record(z10.string(), z10.number().int()).describe("Counter properties for user tracking (can be positive or negative)").optional(),
1019
+ $counter: z10.record(z10.string(), z10.number().int()).describe(
1020
+ "Counter properties for user tracking (can be positive or negative)"
1021
+ ).optional(),
1022
1022
  $set: z10.record(z10.string(), z10.any()).describe("Properties to set for the user").optional(),
1023
- $setOnce: z10.record(z10.string(), z10.any()).describe("Properties to set once for the user (won't overwrite existing values)").optional(),
1023
+ $setOnce: z10.record(z10.string(), z10.any()).describe(
1024
+ "Properties to set once for the user (won't overwrite existing values)"
1025
+ ).optional(),
1024
1026
  $unset: z10.array(z10.string()).describe("Array of property names to unset/remove from the user").optional()
1025
- }).passthrough().describe("User properties including counters, set operations, and other dynamic data");
1027
+ }).loose().describe(
1028
+ "User properties including counters, set operations, and other dynamic data"
1029
+ );
1026
1030
  var userInfoSchema = z10.object({
1027
1031
  userName: z10.string().email().describe("User's email address as username"),
1028
1032
  properties: userPropertiesSchema.describe("User properties and counters")
@@ -1155,8 +1159,29 @@ var fetchConfigurationListResponseSchema = z12.object({
1155
1159
  feedbackConfiguration: z12.array(feedbackConfigurationItemSchema).describe("Array of available feedback configurations")
1156
1160
  }).strict().describe("Response schema for fetchConfigurationList API");
1157
1161
 
1158
- // src/index.ts
1162
+ // src/schemas/api/refine-text-schema.ts
1159
1163
  import { z as z13 } from "zod";
1164
+ var refineTextParamsSchema = z13.object({
1165
+ question_id: z13.string().describe("Unique identifier for the question"),
1166
+ identifier: z13.string().uuid().describe("Unique identifier for the feedback instance"),
1167
+ feedback_configuration_id: z13.string().uuid().describe("Unique identifier for the feedback configuration"),
1168
+ user_text: z13.string().describe("Original text input from the user")
1169
+ }).strict().describe("Request schema for refining user text input");
1170
+ var refineTextDataSchema = z13.object({
1171
+ user_text: z13.string().describe("Original text input from the user"),
1172
+ refined_text: z13.string().describe("Refined/improved version of the user text")
1173
+ }).describe("Data containing original and refined text");
1174
+ var refineTextResponseSchema = z13.object({
1175
+ success: z13.boolean().describe("Indicates whether the operation was successful"),
1176
+ code: z13.string().describe("Response code indicating the status"),
1177
+ message: z13.string().describe("Human-readable message describing the result"),
1178
+ messageId: z13.string().describe("Unique identifier for the response message"),
1179
+ data: refineTextDataSchema.describe("Response data containing original and refined text"),
1180
+ error: z13.string().optional().describe("Error message if the operation failed (optional)")
1181
+ }).strict().describe("Response schema for refine text API operation");
1182
+
1183
+ // src/index.ts
1184
+ import { z as z14 } from "zod";
1160
1185
  export {
1161
1186
  AnnotationMarkerSchema,
1162
1187
  AnnotationSchema,
@@ -1177,7 +1202,6 @@ export {
1177
1202
  PublicationStatuses,
1178
1203
  QuestionStatuses,
1179
1204
  QuestionTypes,
1180
- QuestionsResponseSchema,
1181
1205
  RatingDisplayStyles,
1182
1206
  RatingRepresentationSizes,
1183
1207
  RecurringUnits,
@@ -1256,6 +1280,9 @@ export {
1256
1280
  ratingQuestionTranslationSchema,
1257
1281
  ratingRepresentationSizeSchema,
1258
1282
  recurringUnitSchema,
1283
+ refineTextDataSchema,
1284
+ refineTextParamsSchema,
1285
+ refineTextResponseSchema,
1259
1286
  responseSchema,
1260
1287
  sectionSchema,
1261
1288
  sessionInfoSchema,
@@ -1281,6 +1308,6 @@ export {
1281
1308
  welcomeScreenPropertiesSchema,
1282
1309
  whoSchema,
1283
1310
  yesNoSchema,
1284
- z13 as z
1311
+ z14 as z
1285
1312
  };
1286
1313
  //# sourceMappingURL=index.js.map