@socotra/ec-react-utils 2.5.1-next.10 → 2.5.1-next.11

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/index.d.ts CHANGED
@@ -50,7 +50,7 @@ declare interface DataModelToJsonSchemaProps {
50
50
  * based on the provided parameters and data model.
51
51
  */
52
52
  export declare const extractElementDataModel: ({ dataModel, quote, elementLocator, }: {
53
- quote: QuoteResponse;
53
+ quote: QuoteResponse | SegmentResponse;
54
54
  dataModel: DataModel;
55
55
  elementLocator: string;
56
56
  }) => ElementConfig | false;
@@ -78,7 +78,41 @@ export declare const extractElementDataModelFromType: ({ dataModel, elementType,
78
78
  * @returns The function `extractElementFromQuote` returns the element from the `QuoteResponse` object
79
79
  * that matches the provided `elementLocator`.
80
80
  */
81
- export declare const extractElementFromQuote: (quote: QuoteResponse, elementLocator: string) => false | ({
81
+ export declare const extractElementFromQuote: (quote: QuoteResponse | SegmentResponse, elementLocator: string) => false | ({
82
+ locator: string;
83
+ type: string;
84
+ staticLocator: string;
85
+ data?: Record<string, any> | undefined;
86
+ coverageTerms?: Record<string, string> | undefined;
87
+ parentLocator?: string | undefined;
88
+ rootLocator?: string | undefined;
89
+ tenantLocator?: string | undefined;
90
+ originalEffectiveTime?: string | undefined;
91
+ } & {
92
+ elements?: ({
93
+ locator: string;
94
+ type: string;
95
+ staticLocator: string;
96
+ data?: Record<string, any> | undefined;
97
+ coverageTerms?: Record<string, string> | undefined;
98
+ parentLocator?: string | undefined;
99
+ rootLocator?: string | undefined;
100
+ tenantLocator?: string | undefined;
101
+ originalEffectiveTime?: string | undefined;
102
+ } & any)[];
103
+ });
104
+
105
+ /**
106
+ * The function `extractElementFromTransactionSegment` takes a `SegmentResponse` object and an element locator string,
107
+ * and returns the element with the matching locator from the segment or its nested elements.
108
+ * @param {SegmentResponse} transactionSegment - The `transactionSegment` parameter is of type `SegmentResponse`, which is an object
109
+ * containing information about a transaction.
110
+ * @param {string} elementLocator - The `elementLocator` parameter is a string that represents the
111
+ * locator of the element you want to extract from the `transactionSegment` object.
112
+ * @returns The function `extractElementFromTransactionSegment` returns the element from the `SegmentResponse` object
113
+ * that matches the provided `elementLocator`.
114
+ */
115
+ export declare const extractElementFromTransactionSegment: (transactionSegment: SegmentResponse, elementLocator: string) => false | ({
82
116
  locator: string;
83
117
  type: string;
84
118
  staticLocator: string;
@@ -126,6 +160,30 @@ export declare const extractElementsFromQuote: (elements: Array<ElementResponse>
126
160
  } & any)[];
127
161
  })[];
128
162
 
163
+ export declare const extractElementsFromTransactionSegment: (elements: Array<ElementResponse>, elementType: string) => ({
164
+ locator: string;
165
+ type: string;
166
+ staticLocator: string;
167
+ data?: Record<string, any> | undefined;
168
+ coverageTerms?: Record<string, string> | undefined;
169
+ parentLocator?: string | undefined;
170
+ rootLocator?: string | undefined;
171
+ tenantLocator?: string | undefined;
172
+ originalEffectiveTime?: string | undefined;
173
+ } & {
174
+ elements?: ({
175
+ locator: string;
176
+ type: string;
177
+ staticLocator: string;
178
+ data?: Record<string, any> | undefined;
179
+ coverageTerms?: Record<string, string> | undefined;
180
+ parentLocator?: string | undefined;
181
+ rootLocator?: string | undefined;
182
+ tenantLocator?: string | undefined;
183
+ originalEffectiveTime?: string | undefined;
184
+ } & any)[];
185
+ })[];
186
+
129
187
  /**
130
188
  * The function `extractProductDataModel` extracts product data model based on the product name from a
131
189
  * given data model.