@wats/graph 0.3.23 → 0.3.24
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.
|
@@ -61,6 +61,12 @@ function normalizeSupportedApps(value) {
|
|
|
61
61
|
};
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
+
function assertBoolean(value, fieldName, helperName) {
|
|
65
|
+
if (typeof value !== "boolean") {
|
|
66
|
+
throw validationError(`Invalid ${helperName} input: ${fieldName} must be a boolean.`);
|
|
67
|
+
}
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
64
70
|
function normalizeButton(input, index) {
|
|
65
71
|
const record = assertPlainRecord(input, "buildTemplateButtonComponent", `buttons[${index}]`);
|
|
66
72
|
const type = assertString(record.type, "button.type", "buildTemplateButtonComponent", 32).toUpperCase();
|
|
@@ -102,6 +108,10 @@ function normalizeButton(input, index) {
|
|
|
102
108
|
out.otp_type = assertString(record.otpType, "button.otpType", "buildTemplateButtonComponent", 32).toUpperCase();
|
|
103
109
|
if (record.text !== undefined)
|
|
104
110
|
out.text = assertString(record.text, "button.text", "buildTemplateButtonComponent", TEMPLATE_SHORT_TEXT_MAX_LENGTH);
|
|
111
|
+
if (record.autofillText !== undefined)
|
|
112
|
+
out.autofill_text = assertString(record.autofillText, "button.autofillText", "buildTemplateButtonComponent", TEMPLATE_SHORT_TEXT_MAX_LENGTH);
|
|
113
|
+
if (record.zeroTapTermsAccepted !== undefined)
|
|
114
|
+
out.zero_tap_terms_accepted = assertBoolean(record.zeroTapTermsAccepted, "button.zeroTapTermsAccepted", "buildTemplateButtonComponent");
|
|
105
115
|
if (out.otp_type === "ONE_TAP" || out.otp_type === "ZERO_TAP") {
|
|
106
116
|
out.supported_apps = normalizeSupportedApps(record.supportedApps);
|
|
107
117
|
} else if (record.supportedApps !== undefined) {
|
|
@@ -126,6 +126,8 @@ export type TemplateButtonInput = {
|
|
|
126
126
|
readonly type: "OTP";
|
|
127
127
|
readonly otpType: TemplateOtpType;
|
|
128
128
|
readonly text?: string;
|
|
129
|
+
readonly autofillText?: string;
|
|
130
|
+
readonly zeroTapTermsAccepted?: boolean;
|
|
129
131
|
readonly supportedApps?: readonly TemplateSupportedAppInput[];
|
|
130
132
|
readonly [key: string]: unknown;
|
|
131
133
|
};
|