@duffel/components 3.7.11 → 3.7.12--canary.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.
- package/components/DuffelCardForm/DuffelCardFormCustomElement.d.ts +2 -0
- package/components/DuffelCardForm/lib/getIFrameEventListener.d.ts +2 -2
- package/components/DuffelCardForm/lib/types.d.ts +7 -0
- package/custom-elements.js +17 -17
- package/custom-elements.js.map +3 -3
- package/index.js +12 -12
- package/index.js.map +3 -3
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -18,6 +18,7 @@ declare global {
|
|
|
18
18
|
onSaveCardFailure: typeof onSaveCardFailure;
|
|
19
19
|
onCreateCardForTemporaryUseSuccess: typeof onCreateCardForTemporaryUseSuccess;
|
|
20
20
|
onCreateCardForTemporaryUseFailure: typeof onCreateCardForTemporaryUseFailure;
|
|
21
|
+
onSecurityPolicyViolation: typeof onSecurityPolicyViolation;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
export declare function renderDuffelCardFormCustomElement(props: DuffelCardFormCustomElementRenderArguments): void;
|
|
@@ -29,4 +30,5 @@ export declare const onSaveCardSuccess: (callback: (data: import("./lib/types").
|
|
|
29
30
|
export declare const onSaveCardFailure: (callback: (error: import("./lib/types").SaveCardError) => void) => void;
|
|
30
31
|
export declare const onCreateCardForTemporaryUseSuccess: (callback: (data: import("./lib/types").CreateCardForTemporaryUseData) => void) => void;
|
|
31
32
|
export declare const onCreateCardForTemporaryUseFailure: (callback: (error: import("./lib/types").CreateCardForTemporaryUseError) => void) => void;
|
|
33
|
+
export declare const onSecurityPolicyViolation: (callback: (data: import("./lib/types").SecurityPolicyViolationData) => void) => void;
|
|
32
34
|
export {};
|
|
@@ -2,6 +2,6 @@ import { DuffelCardFormProps } from "./types";
|
|
|
2
2
|
type Inputs = {
|
|
3
3
|
setIFrameHeight: (height: string) => void;
|
|
4
4
|
postMessageWithStyles: () => void;
|
|
5
|
-
} & Pick<DuffelCardFormProps, "onValidateSuccess" | "onValidateFailure" | "onCreateCardForTemporaryUseSuccess" | "onCreateCardForTemporaryUseFailure" | "onSaveCardSuccess" | "onSaveCardFailure">;
|
|
6
|
-
export declare function getIFrameEventListener(iFrameURL: URL, { postMessageWithStyles, setIFrameHeight, onValidateSuccess, onValidateFailure, onCreateCardForTemporaryUseSuccess, onCreateCardForTemporaryUseFailure, onSaveCardSuccess, onSaveCardFailure, }: Inputs): (event: MessageEvent) => void;
|
|
5
|
+
} & Pick<DuffelCardFormProps, "onValidateSuccess" | "onValidateFailure" | "onCreateCardForTemporaryUseSuccess" | "onCreateCardForTemporaryUseFailure" | "onSaveCardSuccess" | "onSaveCardFailure" | "onSecurityPolicyViolation">;
|
|
6
|
+
export declare function getIFrameEventListener(iFrameURL: URL, { postMessageWithStyles, setIFrameHeight, onValidateSuccess, onValidateFailure, onCreateCardForTemporaryUseSuccess, onCreateCardForTemporaryUseFailure, onSaveCardSuccess, onSaveCardFailure, onSecurityPolicyViolation, }: Inputs): (event: MessageEvent) => void;
|
|
7
7
|
export {};
|
|
@@ -7,6 +7,9 @@ interface CardActionError {
|
|
|
7
7
|
status: number;
|
|
8
8
|
message: string;
|
|
9
9
|
}
|
|
10
|
+
export interface SecurityPolicyViolationData {
|
|
11
|
+
violated_directive: string;
|
|
12
|
+
}
|
|
10
13
|
export interface CreateCardForTemporaryUseData extends CommonCardData {
|
|
11
14
|
saved: false;
|
|
12
15
|
/** The card will no longer be available for use after this time. */
|
|
@@ -122,5 +125,9 @@ export interface DuffelCardFormProps {
|
|
|
122
125
|
* `useDuffelCardFormActions` hook.
|
|
123
126
|
*/
|
|
124
127
|
onSaveCardFailure?: (error: SaveCardError) => void;
|
|
128
|
+
/**
|
|
129
|
+
* This function will be called if a security policy violation is detected.
|
|
130
|
+
*/
|
|
131
|
+
onSecurityPolicyViolation?: (data: SecurityPolicyViolationData) => void;
|
|
125
132
|
}
|
|
126
133
|
export {};
|