@resconet/qp-bridge 0.0.1-alpha.20 → 0.0.1-alpha.21

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.
@@ -581,6 +581,63 @@ export declare const getEntityByIdSuccessResponseMessageSchema: z.ZodObject<z.ob
581
581
  entity: Record<string, unknown>;
582
582
  id?: string | undefined;
583
583
  }>;
584
+ export declare const repeatGroupRequestMessageSchema: z.ZodObject<z.objectUtil.extendShape<{
585
+ type: z.ZodLiteral<"qp-bridge">;
586
+ id: z.ZodOptional<z.ZodString>;
587
+ }, {
588
+ action: z.ZodLiteral<"repeatGroup">;
589
+ parentGroupName: z.ZodString;
590
+ groupIndex: z.ZodNumber;
591
+ }>, "strip", z.ZodTypeAny, {
592
+ type: "qp-bridge";
593
+ action: "repeatGroup";
594
+ parentGroupName: string;
595
+ groupIndex: number;
596
+ id?: string | undefined;
597
+ }, {
598
+ type: "qp-bridge";
599
+ action: "repeatGroup";
600
+ parentGroupName: string;
601
+ groupIndex: number;
602
+ id?: string | undefined;
603
+ }>;
604
+ export declare const addNewGroupRequestMessageSchema: z.ZodObject<z.objectUtil.extendShape<{
605
+ type: z.ZodLiteral<"qp-bridge">;
606
+ id: z.ZodOptional<z.ZodString>;
607
+ }, {
608
+ action: z.ZodLiteral<"addNewGroup">;
609
+ groupName: z.ZodString;
610
+ }>, "strip", z.ZodTypeAny, {
611
+ type: "qp-bridge";
612
+ action: "addNewGroup";
613
+ groupName: string;
614
+ id?: string | undefined;
615
+ }, {
616
+ type: "qp-bridge";
617
+ action: "addNewGroup";
618
+ groupName: string;
619
+ id?: string | undefined;
620
+ }>;
621
+ export declare const deleteGroupRequestMessageSchema: z.ZodObject<z.objectUtil.extendShape<{
622
+ type: z.ZodLiteral<"qp-bridge">;
623
+ id: z.ZodOptional<z.ZodString>;
624
+ }, {
625
+ action: z.ZodLiteral<"deleteGroup">;
626
+ parentGroupName: z.ZodString;
627
+ groupIndex: z.ZodNumber;
628
+ }>, "strip", z.ZodTypeAny, {
629
+ type: "qp-bridge";
630
+ action: "deleteGroup";
631
+ parentGroupName: string;
632
+ groupIndex: number;
633
+ id?: string | undefined;
634
+ }, {
635
+ type: "qp-bridge";
636
+ action: "deleteGroup";
637
+ parentGroupName: string;
638
+ groupIndex: number;
639
+ id?: string | undefined;
640
+ }>;
584
641
  export type QpBridgeMessage = z.infer<typeof qpBridgeMessageSchema>;
585
642
  export type ResponseSuccessMessage = z.infer<typeof responseSuccessMessageSchema>;
586
643
  export type ResponseErrorMessage = z.infer<typeof responseErrorMessageSchema>;
@@ -609,6 +666,9 @@ export type ExecuteCustomCommandRequestMessage = z.infer<typeof executeCustomCom
609
666
  export type CanSaveRequestMessage = z.infer<typeof canSaveRequestMessageSchema>;
610
667
  export type FetchEntitiesRequestMessage = z.infer<typeof fetchEntitiesRequestMessageSchema>;
611
668
  export type GetEntityByIdRequestMessage = z.infer<typeof getEntityByIdRequestMessageSchema>;
669
+ export type RepeatGroupRequestMessage = z.infer<typeof repeatGroupRequestMessageSchema>;
670
+ export type AddNewGroupRequestMessage = z.infer<typeof addNewGroupRequestMessageSchema>;
671
+ export type DeleteGroupRequestMessage = z.infer<typeof deleteGroupRequestMessageSchema>;
612
672
  export type WithBusyIndicatorRequestMessage = BusyIndicatorStartRequestMessage | BusyIndicatorEndRequestMessage;
613
673
  export declare function isMediaItem(data: unknown): data is MediaItem;
614
674
  export declare function isOnAnswerChangeMessage(data: unknown): data is OnAnswerChangeMessage;
@@ -634,3 +694,6 @@ export declare function isFetchEntitiesRequestMessage(data: unknown): data is Fe
634
694
  export declare function isFetchEntitiesSuccessResponseMessage(data: unknown): data is FetchEntitiesSuccessResponseMessage;
635
695
  export declare function isGetEntityByIdRequestMessage(data: unknown): data is GetEntityByIdRequestMessage;
636
696
  export declare function isGetEntityByIdSuccessResponseMessage(data: unknown): data is GetEntityByIdSuccessResponseMessage;
697
+ export declare function isRepeatGroupRequestMessage(data: unknown): data is RepeatGroupRequestMessage;
698
+ export declare function isAddNewGroupRequestMessage(data: unknown): data is AddNewGroupRequestMessage;
699
+ export declare function isDeleteGroupRequestMessage(data: unknown): data is DeleteGroupRequestMessage;
@@ -1,4 +1,4 @@
1
- import { Group, GroupOptional, MediaItem, Question, QuestionOptional, Entity } from './qp-bridge-types';
1
+ import { Entity, Group, GroupOptional, MediaItem, Question, QuestionOptional } from './qp-bridge-types';
2
2
  /**
3
3
  * Creates a MediaItem from the provided parameters and content.
4
4
  *
@@ -265,4 +265,48 @@ export declare function fetchEntities(fetchXml: string): Promise<Entity[]>;
265
265
  * ```
266
266
  */
267
267
  export declare function getEntityById(entityName: string, id: string): Promise<Entity>;
268
+ /**
269
+ * Repeats a specific group within a repeatable group by creating a copy of the group at the specified index.
270
+ * The parent group must be a repeatable group and the index must refer to an existing group instance.
271
+ *
272
+ * @param {string} parentGroupName - The name of the parent repeatable group.
273
+ * @param {number} groupIndex - The index (0-based) of the group instance to repeat.
274
+ * @returns {Promise<void>} A promise that resolves when the group has been successfully repeated.
275
+ * @throws {Error} Throws if the parent group is not found, is not a repeatable group, the index is invalid, or the operation fails.
276
+ * @example
277
+ * ```typescript
278
+ * await repeatGroup('personalInfoRepeatable', 1);
279
+ * console.log('Group repeated successfully');
280
+ * ```
281
+ */
282
+ export declare function repeatGroup(parentGroupName: string, groupIndex: number): Promise<void>;
283
+ /**
284
+ * Adds a new group instance to a repeatable group.
285
+ * The specified name must refer to a repeatable group.
286
+ *
287
+ * @param {string} name - The name of the repeatable group to add a new instance to.
288
+ * @returns {Promise<void>} A promise that resolves when the new group has been successfully added.
289
+ * @throws {Error} Throws if the repeatable group is not found or the operation fails.
290
+ * @example
291
+ * ```typescript
292
+ * await addNewGroup('personalInfoRepeatable');
293
+ * console.log('New group added successfully');
294
+ * ```
295
+ */
296
+ export declare function addNewGroup(name: string): Promise<void>;
297
+ /**
298
+ * Deletes a specific group instance from a repeatable group by index.
299
+ * The parent group must be a repeatable group and the index must refer to an existing group instance.
300
+ *
301
+ * @param {string} parentGroupName - The name of the parent repeatable group.
302
+ * @param {number} groupIndex - The index (0-based) of the group instance to delete.
303
+ * @returns {Promise<void>} A promise that resolves when the group has been successfully deleted.
304
+ * @throws {Error} Throws if the parent group is not found, is not a repeatable group, the index is invalid, or the operation fails.
305
+ * @example
306
+ * ```typescript
307
+ * await deleteGroup('personalInfoRepeatable', 1);
308
+ * console.log('Group deleted successfully');
309
+ * ```
310
+ */
311
+ export declare function deleteGroup(parentGroupName: string, groupIndex: number): Promise<void>;
268
312
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resconet/qp-bridge",
3
- "version": "0.0.1-alpha.20",
3
+ "version": "0.0.1-alpha.21",
4
4
  "dependencies": {
5
5
  "zod": "^3.23.8",
6
6
  "uuid": "^9.0.1"