@insure-os/client 0.0.81 → 0.0.83
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/bundle-sizes.json +11 -11
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +39 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,18 @@ declare class EnhancedHttpClient {
|
|
|
25
25
|
getBaseUrl(): string;
|
|
26
26
|
private makeRequest;
|
|
27
27
|
getQuoteIntent(url: string): Promise<QuoteIntentResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Fetch a single org-configured document by its code. Used by the
|
|
30
|
+
* DocumentModal helper when a form field references a document
|
|
31
|
+
* (e.g. terms-and-conditions link on the declarations page).
|
|
32
|
+
*/
|
|
33
|
+
getDocument(code: string): Promise<{
|
|
34
|
+
id: string;
|
|
35
|
+
code: string;
|
|
36
|
+
name: string;
|
|
37
|
+
content: string;
|
|
38
|
+
kind: string;
|
|
39
|
+
}>;
|
|
28
40
|
fetchAvailableProducts(productCodes?: string[]): Promise<{
|
|
29
41
|
products: Product[];
|
|
30
42
|
organisation: {
|
|
@@ -808,6 +820,7 @@ type QuoteIntentState = {
|
|
|
808
820
|
theme: {
|
|
809
821
|
css_url: string;
|
|
810
822
|
} | null;
|
|
823
|
+
client_settings?: _insure_os_types.ClientSettings | null;
|
|
811
824
|
};
|
|
812
825
|
payment_return?: {
|
|
813
826
|
paymentTransactionId: string | null;
|
|
@@ -830,7 +843,26 @@ declare class InsureOSQuoteWrapperClient {
|
|
|
830
843
|
response: QuoteIntentResponse;
|
|
831
844
|
constructor(httpClient: EnhancedHttpClient, response: QuoteIntentResponse);
|
|
832
845
|
get(): Promise<QuoteIntentResponse>;
|
|
846
|
+
/**
|
|
847
|
+
* Test-fixture helper: takes a sparse `{ fieldCode: value }` map and
|
|
848
|
+
* fills the rest of the form definition with placeholder defaults
|
|
849
|
+
* (`"sample"`, `1`, `true`, `"Sample details for: …"`) so the engine
|
|
850
|
+
* accepts the payload. **Do not use for production data flows** —
|
|
851
|
+
* the placeholders will pollute real quotes. For clean passthrough
|
|
852
|
+
* (e.g. cloning an existing quote), use `replaceFormData()`.
|
|
853
|
+
*/
|
|
833
854
|
update(data: Record<string, any>): Promise<QuoteIntentResponse>;
|
|
855
|
+
/**
|
|
856
|
+
* Clean passthrough — sends the supplied page_data verbatim. No
|
|
857
|
+
* placeholder defaults, no `__answers__` rewriting. Use for cloning
|
|
858
|
+
* an existing quote (`save_type: 'full'`, the default — the source
|
|
859
|
+
* already had all required fields) or for seeding a partial draft
|
|
860
|
+
* (`save_type: 'auto-save'` — skips required-field validation so
|
|
861
|
+
* the engine accepts a sparse page_data).
|
|
862
|
+
*/
|
|
863
|
+
replaceFormData(pageData: Record<string, Record<string, unknown>>, options?: {
|
|
864
|
+
saveType?: "page" | "auto-save" | "full";
|
|
865
|
+
}): Promise<QuoteIntentResponse>;
|
|
834
866
|
}
|
|
835
867
|
declare class InsureOSWrapperClient {
|
|
836
868
|
private httpClient;
|
|
@@ -932,6 +964,13 @@ interface AppErrorOrganisation {
|
|
|
932
964
|
admin_email?: string | null;
|
|
933
965
|
phone?: string | null;
|
|
934
966
|
quote_page_url?: string | null;
|
|
967
|
+
/**
|
|
968
|
+
* Optional snapshot of the org's client_settings. Carried so error/maintenance
|
|
969
|
+
* pages — which run before a quote intent is loaded — can still resolve any
|
|
970
|
+
* org-configured copy. Populated by the engine on error responses where
|
|
971
|
+
* available; treated as null when missing.
|
|
972
|
+
*/
|
|
973
|
+
client_settings?: _insure_os_types.ClientSettings | null;
|
|
935
974
|
}
|
|
936
975
|
interface AppError {
|
|
937
976
|
id: string;
|