diff --git a/src/openapi/schemas/content.yaml b/src/openapi/schemas/content.yaml index 95508a9..fdd72fd 100644 --- a/src/openapi/schemas/content.yaml +++ b/src/openapi/schemas/content.yaml @@ -219,3 +219,14 @@ components: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineMessagePrompt additionalProperties: true # todo + + ClientEventInfo: + required: + - component + - elemen + properties: + component: + type: string # enum half_cover + element: + type: string + pattern: "^(january|february|march|april|may|june|july|august|september|october|november|december)-[0-9]{4}-([a-z]-)+[a-z]+$" # august-2023-privacy-prompt-candidate diff --git a/src/openapi/schemas/instruction.yaml b/src/openapi/schemas/instruction.yaml index 881f9dd..73bb9e6 100644 --- a/src/openapi/schemas/instruction.yaml +++ b/src/openapi/schemas/instruction.yaml @@ -15,6 +15,8 @@ components: - $ref: "#/components/schemas/TimelineReplaceEntry" - $ref: "#/components/schemas/TimelineShowAlert" - $ref: "#/components/schemas/TimelineTerminateTimeline" + - $ref: "#/components/schemas/TimelineShowCover" + discriminator: propertyName: type mapping": # deprecated @@ -25,6 +27,7 @@ components: TimelineReplaceEntry: "#/components/schemas/TimelineReplaceEntry" TimelineShowAlert: "#/components/schemas/TimelineShowAlert" TimelineTerminateTimeline: "#/components/schemas/TimelineTerminateTimeline" + TimelineShowCover: "#/components/schemas/TimelineShowCover" InstructionType: type: string @@ -37,6 +40,7 @@ components: TimelineReplaceEntry, TimelineShowAlert, TimelineTerminateTimeline, + TimelineShowCover, ] TimelineAddEntries: @@ -162,3 +166,132 @@ components: sortIndex: type: string pattern: "[0-9]+$" + + TimelineShowCover: + required: + - type + - clientEventInfo + - cover + properties: + type: + $ref: "#/components/schemas/InstructionType" # TimelineShowCover + clientEventInfo: + $ref: "./content.yaml#/components/schemas/ClientEventInfo" + cover: + $ref: "#/components/schemas/TimelineHalfCover" + + TimelineHalfCover: + required: + - type + - halfCoverDisplayType + - primaryText + - primaryCoverCta + - secondaryText + - impressionCallbacks + - dismissible + properties: + type: + type: string + enum: [TimelineHalfCover] + halfCoverDisplayType: + type: string + enum: [Cover] + primaryText: + $ref: "#/components/schemas/Text" + secondaryText: + $ref: "#/components/schemas/Text" + primaryCoverCta: + $ref: "#/components/schemas/CoverCta" + impressionCallbacks: + type: array + items: + $ref: "#/components/schemas/Callback" + dismissible: + type: boolean + + Text: + required: + - text + - entities + properties: + text: + type: string + entities: + type: array + items: + $ref: "#/components/schemas/TextEntity" + + TextEntity: + required: + - fromIndex + - toIndex + - ref + properties: + fromIndex: + type: integer + toIndex: + type: integer + ref: + $ref: "#/components/schemas/TextEntityRef" + + TextEntityRef: + required: + - type + - url + - urlType + properties: + type: + type: string + enum: [TimelineUrl] + url: + type: string + format: uri + urlType: + type: string + enum: [ExternalUrl] + + CoverCta: + required: + - text + - ctaBehavior + - callbacks + - clientEventInfo + - buttonStyle + properties: + Text: + type: string + ctaBehavior: + $ref: "#/components/schemas/TimelineCoverBehavior" + callbacks: + type: array + items: + $ref: "#/components/schemas/Callback" + clientEventInfo: + $ref: "#/components/schemas/ClientEventInfo" + buttonStyle: + type: string + enum: ["Primary"] + + TimelineCoverBehavior: + required: + - type + properties: + type: + type: string + enum: [TimelineCoverBehaviorDismiss] + + Callback: + required: + - endpoint + properties: + endpoint: + type: string + # pattern: '^/1\.1/[a-z]+/[a-z]+\.json\?[a-z_]+=[a-z0-9-]+(&[a-z_]+=[a-z0-9-]+)+?$' #/1.1/onboarding/fatigue.json?{params} + + ClientEventInfo: + required: + - action + properties: + action: + type: string + enum: [primary_cta]