-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278 from skedify/feat/experimental-ts-definition-…
…files feat(project): experimental TS definition files
- Loading branch information
Showing
24 changed files
with
996 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.snap | ||
*.snap | ||
/**/*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
declare module "skedify-sdk" { | ||
export interface CalendarEventTemplate extends Omit<BaseFields, "external_id"> { | ||
locale: Locale; | ||
meeting_type: string; | ||
receiver_type: string; | ||
title: string; | ||
description: string; | ||
updated_at: string; | ||
deleted_at: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
declare module "skedify-sdk" { | ||
export interface ContactOfficeSubject { | ||
id: string; | ||
contact_office_id: string; | ||
subject_id: string; | ||
created_at: string; | ||
updated_at: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
declare module "skedify-sdk" { | ||
export interface ContactOffice { | ||
id: string; | ||
contact_id: string; | ||
office_id: string; | ||
created_at: string | null; | ||
updated_at: string | null; | ||
} | ||
|
||
export interface WithContact<T> { | ||
contact: Contact & T; | ||
} | ||
|
||
export interface WithOffice { | ||
office: Office; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
declare module "skedify-sdk" { | ||
export interface User { | ||
id: string; | ||
created_at: string; | ||
email: string; | ||
external_id: string | null; | ||
first_name: string | null; | ||
gender: string | null; | ||
last_name: string | null; | ||
language: string | null; | ||
phone_number: string | null; | ||
profile_picture: string | null; | ||
state: State; | ||
timezone: string; | ||
updated_at: string; | ||
} | ||
|
||
interface BaseRole { | ||
id: string; | ||
created_at: string; | ||
updated_at: string; | ||
} | ||
|
||
interface ContactRole extends BaseRole { | ||
uuid: string; | ||
default_week_template: string | null; | ||
function: string | null; | ||
introduction: string | null; | ||
is_active: boolean; | ||
video_url?: string | null; | ||
timezone: null | string; | ||
} | ||
|
||
interface AdminRole extends BaseRole { | ||
is_owner: boolean; | ||
} | ||
|
||
interface CentralPlannerRole extends BaseRole {} | ||
interface OfficeManagerRole extends BaseRole {} | ||
|
||
/** | ||
* No support for enum in d.ts | ||
* Use StateEnum for mapped enum value | ||
* corresponds with: | ||
* - PENDING = 0, | ||
* - SUSPENDED = 4, | ||
* - ACTIVE = 8, | ||
*/ | ||
export type State = 0 | 4 | 8; | ||
|
||
export type RoleIdentifier = "central_planner" | "contact" | "admin" | "office_manager"; | ||
|
||
export interface ContactInfo extends BaseFields { | ||
email: string; | ||
phone_number: string | null; | ||
profile_picture: string | null; | ||
state: State; | ||
updated_at: string; | ||
user_id: string; | ||
} | ||
|
||
export interface WithEmployeeUser { | ||
user: User | null; | ||
} | ||
|
||
export interface WithEmployeeRoles { | ||
roles: { | ||
central_planner?: CentralPlannerRole; | ||
contact?: ContactRole; | ||
admin?: AdminRole; | ||
office_manager?: OfficeManagerRole; | ||
}; | ||
} | ||
|
||
export interface Employee extends ContactInfo {} | ||
|
||
export interface WithContactEmployee { | ||
roles: { | ||
contact: ContactRole; | ||
}; | ||
} | ||
|
||
export interface WithOfficeManagerEmployee { | ||
roles: { | ||
office_manager: OfficeManagerRole; | ||
}; | ||
} | ||
|
||
export interface Admin extends ContactInfo { | ||
roles: { | ||
admin?: AdminRole; | ||
}; | ||
} | ||
|
||
export interface CentralPlanner extends ContactInfo { | ||
roles: { | ||
admin?: CentralPlannerRole; | ||
}; | ||
} | ||
|
||
export interface OfficeManager extends ContactInfo { | ||
roles: { | ||
office_manager?: OfficeManagerRole; | ||
}; | ||
} | ||
|
||
export interface Contact extends ContactInfo { | ||
roles: { | ||
contact?: ContactRole; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
declare module "skedify-sdk" { | ||
export interface Enterprise { | ||
id: string; | ||
country: string; | ||
default_timezone: string; | ||
name: string; | ||
logo: string; | ||
picture_id: string | number; | ||
created_at: string; | ||
updated_at: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
declare module "skedify-sdk" { | ||
export type ReminderTypes = "textMessage" | "email"; | ||
|
||
export type NotificationSettings = Record<ReminderTypes, boolean>; | ||
|
||
/** | ||
* No enum support in d.ts files, | ||
* Use NotificationKeysEnum for mapped enum value | ||
* corresponds with: | ||
* - acceptedByContact = 0, | ||
* - assignedByContact= 1, | ||
* - completedByContact = 2, | ||
* - invitedByContact = 3, | ||
* - cancelledByContact = 4, | ||
* - cancelledByCustomer = 5, | ||
* - dateCreatedByContact = 6, | ||
* - dateCreatedByCustomer =7, | ||
* - dateChangedByContact = 8, | ||
* - dateChangedByCustomer = 9, | ||
* - possibilitiesCreatedByCustomer = 10, | ||
* - possibilitiesChangedByCustomer = 11, | ||
* - possibilitiesRequestedByContact = 12, | ||
*/ | ||
export type NotificationKeys = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; | ||
|
||
export type Notifications = { | ||
[k in NotificationKeys]: NotificationSettings; | ||
}; | ||
|
||
interface ReminderInterval { | ||
time: number; | ||
} | ||
|
||
export type ReminderSettings = Record<ReminderTypes, ReminderInterval[]>; | ||
|
||
interface DefaultEnterpriseSettings { | ||
allow_office_365_login: boolean; | ||
allowed_sync_providers: string[]; | ||
appointment_block_suggestions: string; | ||
appointment_completion_max_future_days: number; | ||
appointment_contact_select: string; | ||
appointment_max_suggestions: number; | ||
appointment_min_preparation_time: number; | ||
appointment_min_suggestions: number; | ||
availability_max_future_days_to_sync: number; | ||
contact_notifications: Notifications; | ||
default_language: Locale; | ||
enterprise_id: number; | ||
first_time_customer_fields: FirstTimeCustomerFields; | ||
id: string; | ||
internal_customer_fields: unknown; | ||
notifications_window?: unknown; | ||
notifications: Notifications; | ||
reminders: ReminderSettings; | ||
returning_customer_fields: ReturningCustomerFields; | ||
sender_email_addresses?: null | { | ||
[locale: string]: string | undefined | null; | ||
}; | ||
show_qr_code_in_customer_email: boolean; | ||
video_provider_test_url: string; | ||
web_app_is_reassign_search_enabled: boolean; | ||
} | ||
|
||
export interface EnterpriseCustomerSettings { | ||
appointment_create_allow_change_customer: boolean; | ||
appointment_create_allow_create_customer: boolean; | ||
appointment_create_allow_customer_instigator: boolean; | ||
appointment_create_allow_invite_customer: boolean; | ||
web_app_customers_behaviour: "enabled" | "disabled"; | ||
} | ||
|
||
export interface EnterpriseSubjectSettings { | ||
appointment_create_allow_set_subject: boolean; | ||
default_subject_id?: string | null; | ||
} | ||
|
||
export interface EnterpriseAvailabilitySettings { | ||
appointment_default_duration: number; | ||
appointment_earliest_possible: number; | ||
appointment_latest_possible: number; | ||
time_slot_granularity: number; | ||
} | ||
|
||
export interface EnterprisePluginSettings { | ||
redirect_url: string; | ||
localized_redirect_urls: [] | { [lang: string]: string }; | ||
terms_conditions_url: string; | ||
} | ||
|
||
export type EnterpriseSettings = DefaultEnterpriseSettings & | ||
EnterpriseCustomerSettings & | ||
EnterpriseSubjectSettings & | ||
EnterpriseAvailabilitySettings & | ||
EnterprisePluginSettings; | ||
|
||
export interface CustomerFieldSetting { | ||
ask: boolean; | ||
required: boolean; | ||
order: number; | ||
} | ||
|
||
export interface FirstTimeCustomerFields { | ||
address: CustomerFieldSetting; | ||
cell_phone_number: CustomerFieldSetting; | ||
company: CustomerFieldSetting; | ||
credit_card_number: CustomerFieldSetting; | ||
customer_number: CustomerFieldSetting; | ||
debit_card_number: CustomerFieldSetting; | ||
dob: CustomerFieldSetting; | ||
/** | ||
* Mandatory | ||
*/ | ||
email: CustomerFieldSetting; | ||
home_phone_number: CustomerFieldSetting; | ||
is_existing: CustomerFieldSetting; | ||
/** | ||
* Mandatory | ||
*/ | ||
name: CustomerFieldSetting; | ||
title: CustomerFieldSetting; | ||
} | ||
|
||
export interface ReturningCustomerFields extends FirstTimeCustomerFields { | ||
/** | ||
* Mandatory | ||
*/ | ||
external_customer_id: CustomerFieldSetting; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare module "skedify-sdk" { | ||
export interface FeatureFlag extends Omit<BaseFields, "enterprise_id"> { | ||
is_enabled: boolean; | ||
} | ||
} |
Oops, something went wrong.