Skip to content

Commit

Permalink
chore: update api and schema
Browse files Browse the repository at this point in the history
  • Loading branch information
sinatragianpaolo committed Aug 14, 2024
1 parent f9a42cf commit a9162b4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 14 deletions.
33 changes: 27 additions & 6 deletions src/services/tryberApi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2130,7 +2130,9 @@ export type GetUsersMeCampaignsByCampaignIdDevicesApiArg = {
campaignId: string;
};
export type GetUsersMeCampaignsByCampaignIdFormsApiResponse =
/** status 200 OK */ (PreselectionFormQuestion & {
/** status 200 OK */ ({
question: string;
short_name?: string;
value?:
| number
| {
Expand All @@ -2144,7 +2146,19 @@ export type GetUsersMeCampaignsByCampaignIdFormsApiResponse =
error?: string;
};
id: number;
})[];
} & (
| {
type: PreselectionQuestionSimple;
}
| {
type: PreselectionQuestionMultiple;
options: string[];
}
| {
type: PreselectionQuestionCuf;
options?: number[];
}
))[];
export type GetUsersMeCampaignsByCampaignIdFormsApiArg = {
campaignId: string;
};
Expand Down Expand Up @@ -2829,22 +2843,29 @@ export type TaskRequired = {
campaign_id: number;
};
export type Task = TaskOptional & TaskRequired;
export type PreselectionQuestionSimple =
| "gender"
| "text"
| "phone_number"
| "address";
export type PreselectionQuestionMultiple = "multiselect" | "select" | "radio";
export type PreselectionQuestionCuf = string;
export type PreselectionFormQuestion = {
question: string;
short_name?: string;
} & (
| {
type: "text" | "gender" | "phone_number" | "address";
type: PreselectionQuestionSimple;
}
| {
type: "multiselect" | "select" | "radio";
options: {
type: PreselectionQuestionMultiple;
options?: {
value: string;
isInvalid?: boolean;
}[];
}
| {
type: string;
type: PreselectionQuestionCuf;
options?: {
value: number;
isInvalid?: boolean;
Expand Down
40 changes: 32 additions & 8 deletions src/utils/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,19 +805,17 @@ export interface components {
short_name?: string;
} & (
| {
/** @enum {string} */
type: "text" | "gender" | "phone_number" | "address";
type: components["schemas"]["PreselectionQuestionSimple"];
}
| {
/** @enum {string} */
type: "multiselect" | "select" | "radio";
options: {
type: components["schemas"]["PreselectionQuestionMultiple"];
options?: {
value: string;
isInvalid?: boolean;
}[];
}
| {
type: string;
type: components["schemas"]["PreselectionQuestionCuf"];
options?: {
value: number;
isInvalid?: boolean;
Expand Down Expand Up @@ -947,6 +945,18 @@ export interface components {
productType?: number;
notes?: string;
};
/**
* PreselectionQuestionSimple
* @enum {string}
*/
PreselectionQuestionSimple: "gender" | "text" | "phone_number" | "address";
/**
* PreselectionQuestionMultiple
* @enum {string}
*/
PreselectionQuestionMultiple: "multiselect" | "select" | "radio";
/** PreselectionQuestionCuf */
PreselectionQuestionCuf: string;
};
responses: {
/** A user */
Expand Down Expand Up @@ -3299,7 +3309,9 @@ export interface operations {
/** OK */
200: {
content: {
"application/json": (components["schemas"]["PreselectionFormQuestion"] & {
"application/json": ({
question: string;
short_name?: string;
value?:
| number
| {
Expand All @@ -3313,7 +3325,19 @@ export interface operations {
error?: string;
};
id: number;
})[];
} & (
| {
type: components["schemas"]["PreselectionQuestionSimple"];
}
| {
type: components["schemas"]["PreselectionQuestionMultiple"];
options: string[];
}
| {
type: components["schemas"]["PreselectionQuestionCuf"];
options?: number[];
}
))[];
};
};
403: components["responses"]["NotAuthorized"];
Expand Down

0 comments on commit a9162b4

Please sign in to comment.