@go-labs-sg/rsvp 1.1.0 → 1.2.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.
Files changed (2) hide show
  1. package/dist/index.js +43 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10078,10 +10078,13 @@ var eventCheckInQrReleaseSchema = discriminatedUnion("mode", [
10078
10078
  var eventPublicPageSchema = object({
10079
10079
  accessNotice: string2().trim().min(1).max(500).optional(),
10080
10080
  deadlineLabel: string2().trim().min(1).max(60).optional(),
10081
+ paymentRedirectMessage: string2().trim().min(1).max(500).optional(),
10082
+ paymentRedirectTitle: string2().trim().min(1).max(120).optional(),
10081
10083
  registrationDescription: string2().trim().min(1).max(500).optional(),
10082
10084
  registrationActionLabel: string2().trim().min(1).max(100).optional(),
10083
10085
  registrationTitle: string2().trim().min(1).max(120).optional(),
10084
10086
  responseUpdateNotice: string2().trim().min(1).max(300).optional(),
10087
+ scheduleNote: string2().trim().min(1).max(300).optional(),
10085
10088
  showAccessNotice: boolean2().optional(),
10086
10089
  showDeadlineNotice: boolean2().optional(),
10087
10090
  showResponseUpdateNotice: boolean2().optional()
@@ -10139,6 +10142,44 @@ var requiredEventDetailsRichTextSchema = (label, maxLength) => eventDetailsRichT
10139
10142
  });
10140
10143
  }
10141
10144
  });
10145
+ var maxEventDescriptionLength = 2000;
10146
+ var isJsonRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
10147
+ var getEventDescriptionPlainText = (richText) => {
10148
+ const lines = [];
10149
+ let line = "";
10150
+ const flush = () => {
10151
+ const text = line.replace(/[\u200B-\u200D\uFEFF]/g, "").replace(/\s+/g, " ").trim();
10152
+ if (text)
10153
+ lines.push(text);
10154
+ line = "";
10155
+ };
10156
+ const visit = (node, depth) => {
10157
+ if (!isJsonRecord(node) || depth > 32)
10158
+ return;
10159
+ if (node.type === "text") {
10160
+ if (typeof node.text === "string")
10161
+ line += node.text;
10162
+ return;
10163
+ }
10164
+ if (node.type === "hardBreak") {
10165
+ flush();
10166
+ return;
10167
+ }
10168
+ const children = Array.isArray(node.content) ? node.content : [];
10169
+ const isTextBlock = children.some((child) => isJsonRecord(child) && (child.type === "text" || child.type === "hardBreak"));
10170
+ if (!isTextBlock)
10171
+ flush();
10172
+ for (const child of children)
10173
+ visit(child, depth + 1);
10174
+ flush();
10175
+ };
10176
+ visit(richText?.json, 0);
10177
+ return lines.join(`
10178
+ `);
10179
+ };
10180
+ var eventDescriptionRichTextSchema = eventDetailsRichTextSchema.refine((value) => getEventDescriptionPlainText(value).length <= maxEventDescriptionLength, {
10181
+ message: `Description must be ${maxEventDescriptionLength} characters or fewer`
10182
+ });
10142
10183
  var eventDetailsPageSchema = object({
10143
10184
  titleRichText: requiredEventDetailsRichTextSchema("a page title", 180),
10144
10185
  subtitleRichText: eventDetailsRichTextSchema.nullable().optional(),
@@ -10402,7 +10443,8 @@ var updateRetentionSetupStepInputSchema = setupStepScopeSchema.extend({
10402
10443
  var updateEventDetailsInputSchema = setupStepScopeSchema.extend({
10403
10444
  section: literal("DETAILS"),
10404
10445
  name: createEventInputSchema.shape.name,
10405
- description: string2().trim().max(2000).nullable(),
10446
+ description: string2().trim().max(maxEventDescriptionLength).nullable(),
10447
+ descriptionRichText: eventDescriptionRichTextSchema.nullable().optional(),
10406
10448
  venueName: string2().trim().max(220).nullable(),
10407
10449
  slug: eventSlugSchema,
10408
10450
  timeZone: eventTimeZoneSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-labs-sg/rsvp",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "RSVP CLI for authorized event operations.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",