Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jameson/CT-80 #66

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/post_message_definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ post_messages:
backToSearch:
payload:
<<: *user_session_properties
context: string
context:
type: string
optional: true
pulse:
overdraftWarning/cta/transferFunds:
payload:
Expand Down
2 changes: 1 addition & 1 deletion packages/swift/Sources/Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript/docs/react-native-sdk-generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

<details>
<summary>Click here to view a sample usage of <code>onBackToSearch</code>.</summary>
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript/docs/web-sdk-generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ const widget = widgetSdk.ConnectWidget({
- Payload fields:
- `user_guid` (`string`)
- `session_guid` (`string`)
- `context` (`string`)
- `context` (optional) (`string`)

<details>
<summary>Click here to view a sample usage of <code>onBackToSearch</code>.</summary>
Expand Down
4 changes: 2 additions & 2 deletions packages/typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/typescript/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 5 additions & 3 deletions packages/typescript/src/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export type ConnectBackToSearchPayload = {
type: Type.ConnectBackToSearch,
user_guid: string,
session_guid: string,
context: string,
context?: string,
}

export type PulseOverdraftWarningCtaTransferFundsPayload = {
Expand Down Expand Up @@ -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:
Expand Down
Loading