skedify-types
Advanced tools
Comparing version 0.2.9 to 0.2.10
# skedify-types | ||
## 0.2.10 | ||
### Patch Changes | ||
- 7e2f169d: add plugin-remix Questions step | ||
- b643b835: Provide a new type: `APIErrorResponse`, this should be used over `APIResponse` when catching errors. | ||
## 0.2.9 | ||
@@ -4,0 +11,0 @@ |
{ | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"name": "skedify-types", | ||
@@ -4,0 +4,0 @@ "description": "Skedify Types", |
@@ -10,10 +10,25 @@ export interface APIError<Entity> { | ||
export interface APIResponse<Entity> { | ||
interface BaseResponse { | ||
status: number; | ||
headers: Record<string, string>; | ||
url: string; | ||
method: string; | ||
query: Record<string, string | number>; | ||
} | ||
export interface APIResponse<Entity> extends BaseResponse { | ||
data: Entity; | ||
warnings: unknown[]; | ||
errors: APIError<Entity>[]; | ||
status: number; | ||
meta: Record<string, unknown> | []; | ||
paging?: PagingResponse; | ||
} | ||
export interface APIErrorResponse<Entity> extends BaseResponse { | ||
data: null; | ||
warnings?: unknown[]; | ||
errors: APIError<Entity>[]; | ||
meta?: Record<string, unknown>; | ||
} | ||
export interface PagingResponse { | ||
@@ -20,0 +35,0 @@ currentPage: number; |
@@ -151,21 +151,26 @@ import { BaseFields, Locale } from "."; | ||
} | ||
/** | ||
* No support for enum in d.ts files | ||
* Use QuestionDataTypeEnum for mapped enum value | ||
*/ | ||
export type SubjectQuestionDataType = "final_remarks" | "text" | "number" | "website"; | ||
/** | ||
* No support for enum in d.ts files | ||
* Use QuestionInputTypeEnum for mapped enum value | ||
*/ | ||
export type SubjectQuestionInputType = "text_area" | "text_field" | "check_boxes" | "radio_buttons"; | ||
/** | ||
* No support for enum in d.ts files | ||
* Use QuestionTypeEnum for mapped enum value | ||
*/ | ||
export type SubjectQuestionType = "long_text" | "short_text" | "select" | "number"; | ||
export const QuestionDataTypeEnum = { | ||
FINAL_REMARKS: "final_remarks", | ||
TEXT: "text", | ||
NUMBER: "number", | ||
WEBSITE: "website", | ||
} as const; | ||
export const QuestionInputTypeEnum = { | ||
TEXT_AREA: "text_area", | ||
TEXT_FIELD: "text_field", | ||
CHECK_BOXES: "check_boxes", | ||
RADIO_BUTTONS: "radio_buttons", | ||
} as const; | ||
export const QuestionTypeEnum = { | ||
LONG_TEXT: "long_text", | ||
SHORT_TEXT: "short_text", | ||
SELECT: "select", | ||
NUMBER: "number", | ||
} as const; | ||
interface SubjectSettings { | ||
@@ -172,0 +177,0 @@ label_visible: boolean; |
@@ -9,9 +9,22 @@ export interface APIError<Entity> { | ||
} | ||
export interface APIResponse<Entity> { | ||
interface BaseResponse { | ||
status: number; | ||
headers: Record<string, string>; | ||
url: string; | ||
method: string; | ||
query: Record<string, string | number>; | ||
} | ||
export interface APIResponse<Entity> extends BaseResponse { | ||
data: Entity; | ||
warnings: unknown[]; | ||
errors: APIError<Entity>[]; | ||
status: number; | ||
meta: Record<string, unknown> | []; | ||
paging?: PagingResponse; | ||
} | ||
export interface APIErrorResponse<Entity> extends BaseResponse { | ||
data: null; | ||
warnings?: unknown[]; | ||
errors: APIError<Entity>[]; | ||
meta?: Record<string, unknown>; | ||
} | ||
export interface PagingResponse { | ||
@@ -33,2 +46,3 @@ currentPage: number; | ||
} | ||
export {}; | ||
//# sourceMappingURL=shared.d.ts.map |
@@ -141,17 +141,23 @@ import { BaseFields, Locale } from "."; | ||
} | ||
/** | ||
* No support for enum in d.ts files | ||
* Use QuestionDataTypeEnum for mapped enum value | ||
*/ | ||
export declare type SubjectQuestionDataType = "final_remarks" | "text" | "number" | "website"; | ||
/** | ||
* No support for enum in d.ts files | ||
* Use QuestionInputTypeEnum for mapped enum value | ||
*/ | ||
export declare type SubjectQuestionInputType = "text_area" | "text_field" | "check_boxes" | "radio_buttons"; | ||
/** | ||
* No support for enum in d.ts files | ||
* Use QuestionTypeEnum for mapped enum value | ||
*/ | ||
export declare type SubjectQuestionType = "long_text" | "short_text" | "select" | "number"; | ||
export declare const QuestionDataTypeEnum: { | ||
readonly FINAL_REMARKS: "final_remarks"; | ||
readonly TEXT: "text"; | ||
readonly NUMBER: "number"; | ||
readonly WEBSITE: "website"; | ||
}; | ||
export declare const QuestionInputTypeEnum: { | ||
readonly TEXT_AREA: "text_area"; | ||
readonly TEXT_FIELD: "text_field"; | ||
readonly CHECK_BOXES: "check_boxes"; | ||
readonly RADIO_BUTTONS: "radio_buttons"; | ||
}; | ||
export declare const QuestionTypeEnum: { | ||
readonly LONG_TEXT: "long_text"; | ||
readonly SHORT_TEXT: "short_text"; | ||
readonly SELECT: "select"; | ||
readonly NUMBER: "number"; | ||
}; | ||
interface SubjectSettings { | ||
@@ -158,0 +164,0 @@ label_visible: boolean; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217158
2347