diff --git a/lib/post_message_definition.yml b/lib/post_message_definition.yml index d94d1bc..eba86fe 100644 --- a/lib/post_message_definition.yml +++ b/lib/post_message_definition.yml @@ -125,7 +125,9 @@ post_messages: backToSearch: payload: <<: *user_session_properties - context: string + context: + type: string + optional: true pulse: overdraftWarning/cta/transferFunds: payload: diff --git a/packages/swift/Sources/Generated.swift b/packages/swift/Sources/Generated.swift index e2421f9..7f23c8b 100644 --- a/packages/swift/Sources/Generated.swift +++ b/packages/swift/Sources/Generated.swift @@ -237,7 +237,7 @@ public enum ConnectWidgetEvent { public struct BackToSearch: Event { public var userGuid: String public var sessionGuid: String - public var context: String + public var context: String? public static func == (lhs: ConnectWidgetEvent.BackToSearch, rhs: ConnectWidgetEvent.BackToSearch) -> Bool { return lhs.userGuid == rhs.userGuid diff --git a/packages/typescript/docs/react-native-sdk-generated.md b/packages/typescript/docs/react-native-sdk-generated.md index 31ef762..4360156 100644 --- a/packages/typescript/docs/react-native-sdk-generated.md +++ b/packages/typescript/docs/react-native-sdk-generated.md @@ -443,7 +443,7 @@ import { ConnectWidget } from "@mxenabled/react-native-widget-sdk" - Payload fields: - `user_guid` (`string`) - `session_guid` (`string`) - - `context` (`string`) + - `context` (optional) (`string`)
Click here to view a sample usage of onBackToSearch. diff --git a/packages/typescript/docs/web-sdk-generated.md b/packages/typescript/docs/web-sdk-generated.md index 378cfd5..25a735c 100644 --- a/packages/typescript/docs/web-sdk-generated.md +++ b/packages/typescript/docs/web-sdk-generated.md @@ -415,7 +415,7 @@ const widget = widgetSdk.ConnectWidget({ - Payload fields: - `user_guid` (`string`) - `session_guid` (`string`) - - `context` (`string`) + - `context` (optional) (`string`)
Click here to view a sample usage of onBackToSearch. diff --git a/packages/typescript/package-lock.json b/packages/typescript/package-lock.json index ba9cb83..1fe566b 100644 --- a/packages/typescript/package-lock.json +++ b/packages/typescript/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mxenabled/widget-post-message-definitions", - "version": "1.2.0", + "version": "1.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@mxenabled/widget-post-message-definitions", - "version": "1.2.0", + "version": "1.3.0", "license": "MIT", "devDependencies": { "@types/jest": "^27.4.1", diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 3ab2143..e0884eb 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@mxenabled/widget-post-message-definitions", - "version": "1.2.0", + "version": "1.3.0", "description": "Widget Post Message Definitions for use in SDKs", "main": "dist/index.js", "license": "MIT", diff --git a/packages/typescript/src/generated.ts b/packages/typescript/src/generated.ts index d0570df..1cb26ff 100644 --- a/packages/typescript/src/generated.ts +++ b/packages/typescript/src/generated.ts @@ -221,7 +221,7 @@ export type ConnectBackToSearchPayload = { type: Type.ConnectBackToSearch, user_guid: string, session_guid: string, - context: string, + context?: string, } export type PulseOverdraftWarningCtaTransferFundsPayload = { @@ -509,13 +509,15 @@ function buildPayload(type: Type, metadata: Metadata): Payload { case Type.ConnectBackToSearch: assertMessageProp(metadata, "mx/connect/backToSearch", "user_guid", "string") assertMessageProp(metadata, "mx/connect/backToSearch", "session_guid", "string") - assertMessageProp(metadata, "mx/connect/backToSearch", "context", "string") + assertMessageProp(metadata, "mx/connect/backToSearch", "context", "string", { + optional: true, + }) return { type, user_guid: metadata.user_guid as string, session_guid: metadata.session_guid as string, - context: metadata.context as string, + context: metadata.context as string | undefined, } case Type.PulseOverdraftWarningCtaTransferFunds: