@purpleschool/gptbot 0.14.52 → 0.14.53

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.
@@ -1,8 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  export declare namespace CreateAdminBroadcastUiNotificationCommand {
3
3
  const RequestBodySchema: z.ZodObject<{
4
- title: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
5
- message: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
4
+ title: z.ZodObject<{
5
+ en: z.ZodOptional<z.ZodString>;
6
+ es: z.ZodOptional<z.ZodString>;
7
+ ru: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>;
9
+ message: z.ZodObject<{
10
+ en: z.ZodOptional<z.ZodString>;
11
+ es: z.ZodOptional<z.ZodString>;
12
+ ru: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
6
14
  onlyRegistered: z.ZodOptional<z.ZodBoolean>;
7
15
  }, z.core.$strip>;
8
16
  type Request = z.infer<typeof RequestBodySchema>;
@@ -6,8 +6,8 @@ const localized_text_schema_1 = require("../../helpers/localized-text.schema");
6
6
  var CreateAdminBroadcastUiNotificationCommand;
7
7
  (function (CreateAdminBroadcastUiNotificationCommand) {
8
8
  CreateAdminBroadcastUiNotificationCommand.RequestBodySchema = zod_1.z.object({
9
- title: (0, localized_text_schema_1.buildLocalizedTextSchema)(zod_1.z.string().trim().min(1)),
10
- message: (0, localized_text_schema_1.buildLocalizedTextSchema)(zod_1.z.string().trim().min(1)),
9
+ title: (0, localized_text_schema_1.buildPartialLocalizedTextSchema)(zod_1.z.string().trim().min(1)),
10
+ message: (0, localized_text_schema_1.buildPartialLocalizedTextSchema)(zod_1.z.string().trim().min(1)),
11
11
  onlyRegistered: zod_1.z.boolean().optional(),
12
12
  });
13
13
  CreateAdminBroadcastUiNotificationCommand.ResponseSchema = zod_1.z.object({
@@ -1,3 +1,8 @@
1
1
  import { LOCALE } from '@purpleschool/rugpt-lib-common';
2
2
  import { z } from 'zod';
3
3
  export declare function buildLocalizedTextSchema<T extends z.ZodTypeAny>(value: T): z.ZodObject<Record<LOCALE, T>>;
4
+ export declare function buildPartialLocalizedTextSchema<T extends z.ZodTypeAny>(value: T): z.ZodObject<{
5
+ en: z.ZodOptional<T>;
6
+ es: z.ZodOptional<T>;
7
+ ru: z.ZodOptional<T>;
8
+ }, z.core.$strip>;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildLocalizedTextSchema = buildLocalizedTextSchema;
4
+ exports.buildPartialLocalizedTextSchema = buildPartialLocalizedTextSchema;
4
5
  const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
5
6
  const zod_1 = require("zod");
6
7
  function buildLocalizedTextSchema(value) {
@@ -10,3 +11,10 @@ function buildLocalizedTextSchema(value) {
10
11
  }, {});
11
12
  return zod_1.z.object(shape);
12
13
  }
14
+ function buildPartialLocalizedTextSchema(value) {
15
+ return buildLocalizedTextSchema(value)
16
+ .partial()
17
+ .refine((localizedText) => Object.keys(localizedText).length > 0, {
18
+ message: 'At least one localized value is required',
19
+ });
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.14.52",
3
+ "version": "0.14.53",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",