@resconet/qp-bridge 1.0.0 → 1.0.1-alpha.28
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/index.js +1 -1
- package/index.mjs +323 -303
- package/lib/qp-bridge-types.d.ts +19 -0
- package/lib/qp-bridge.d.ts +10 -0
- package/package.json +1 -1
package/lib/qp-bridge-types.d.ts
CHANGED
|
@@ -597,6 +597,23 @@ export declare const getEntityByIdSuccessResponseMessageSchema: z.ZodObject<z.ob
|
|
|
597
597
|
entity: Record<string, unknown>;
|
|
598
598
|
id?: string | undefined;
|
|
599
599
|
}>;
|
|
600
|
+
export declare const saveEntityRequestMessageSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
601
|
+
type: z.ZodLiteral<"qp-bridge">;
|
|
602
|
+
id: z.ZodOptional<z.ZodString>;
|
|
603
|
+
}, {
|
|
604
|
+
action: z.ZodLiteral<"saveEntity">;
|
|
605
|
+
entity: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
606
|
+
}>, "strip", z.ZodTypeAny, {
|
|
607
|
+
type: "qp-bridge";
|
|
608
|
+
action: "saveEntity";
|
|
609
|
+
entity: Record<string, unknown>;
|
|
610
|
+
id?: string | undefined;
|
|
611
|
+
}, {
|
|
612
|
+
type: "qp-bridge";
|
|
613
|
+
action: "saveEntity";
|
|
614
|
+
entity: Record<string, unknown>;
|
|
615
|
+
id?: string | undefined;
|
|
616
|
+
}>;
|
|
600
617
|
export declare const repeatGroupRequestMessageSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
601
618
|
type: z.ZodLiteral<"qp-bridge">;
|
|
602
619
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -682,6 +699,7 @@ export type ExecuteCustomCommandRequestMessage = z.infer<typeof executeCustomCom
|
|
|
682
699
|
export type CanSaveRequestMessage = z.infer<typeof canSaveRequestMessageSchema>;
|
|
683
700
|
export type FetchEntitiesRequestMessage = z.infer<typeof fetchEntitiesRequestMessageSchema>;
|
|
684
701
|
export type GetEntityByIdRequestMessage = z.infer<typeof getEntityByIdRequestMessageSchema>;
|
|
702
|
+
export type SaveEntityRequestMessage = z.infer<typeof saveEntityRequestMessageSchema>;
|
|
685
703
|
export type RepeatGroupRequestMessage = z.infer<typeof repeatGroupRequestMessageSchema>;
|
|
686
704
|
export type AddNewGroupRequestMessage = z.infer<typeof addNewGroupRequestMessageSchema>;
|
|
687
705
|
export type DeleteGroupRequestMessage = z.infer<typeof deleteGroupRequestMessageSchema>;
|
|
@@ -711,6 +729,7 @@ export declare function isFetchEntitiesRequestMessage(data: unknown): data is Fe
|
|
|
711
729
|
export declare function isFetchEntitiesSuccessResponseMessage(data: unknown): data is FetchEntitiesSuccessResponseMessage;
|
|
712
730
|
export declare function isGetEntityByIdRequestMessage(data: unknown): data is GetEntityByIdRequestMessage;
|
|
713
731
|
export declare function isGetEntityByIdSuccessResponseMessage(data: unknown): data is GetEntityByIdSuccessResponseMessage;
|
|
732
|
+
export declare function isSaveEntityRequestMessage(data: unknown): data is SaveEntityRequestMessage;
|
|
714
733
|
export declare function isRepeatGroupRequestMessage(data: unknown): data is RepeatGroupRequestMessage;
|
|
715
734
|
export declare function isAddNewGroupRequestMessage(data: unknown): data is AddNewGroupRequestMessage;
|
|
716
735
|
export declare function isDeleteGroupRequestMessage(data: unknown): data is DeleteGroupRequestMessage;
|
package/lib/qp-bridge.d.ts
CHANGED
|
@@ -265,6 +265,16 @@ 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
|
+
* Creates a new entity marker that can be enriched before saving.
|
|
270
|
+
* The returned entity is flagged with `isNew` so the host can distinguish new records.
|
|
271
|
+
*/
|
|
272
|
+
export declare function createNewEntity(): Entity;
|
|
273
|
+
/**
|
|
274
|
+
* Persists an entity through the bridge. Supports both new and existing entities.
|
|
275
|
+
* @param entity - Entity payload; include `isNew` for newly created entities.
|
|
276
|
+
*/
|
|
277
|
+
export declare function saveEntity(entity: Entity): Promise<void>;
|
|
268
278
|
/**
|
|
269
279
|
* Repeats a specific group within a repeatable group by creating a copy of the group at the specified index.
|
|
270
280
|
* The parent group must be a repeatable group and the index must refer to an existing group instance.
|