@tellescope/schema 1.4.46 → 1.4.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/schema.d.ts +34 -2
- package/lib/cjs/schema.d.ts.map +1 -1
- package/lib/cjs/schema.js +193 -12
- package/lib/cjs/schema.js.map +1 -1
- package/lib/esm/schema.d.ts +34 -2
- package/lib/esm/schema.d.ts.map +1 -1
- package/lib/esm/schema.js +194 -13
- package/lib/esm/schema.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/schema.ts +271 -13
package/lib/esm/schema.js
CHANGED
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { WEBHOOK_MODELS, } from "@tellescope/types-models";
|
|
13
|
-
import { booleanValidator, dateValidator, emailValidator, fieldsValidator, journeysValidator, journeyStatesValidator, phoneValidator, nameValidator, nonNegNumberValidator, mongoIdValidator, mongoIdStringRequired as mongoIdStringValidator, listOfMongoIdStringValidator, preferenceValidator, objectAnyFieldsAnyValuesValidator, stringValidator, stringValidator100, listOfStringsValidator, emailEncodingValidator, numberToDateValidator, SMSMessageValidator, chatRoomTypeValidator, idStringToDateValidator, subdomainValidator, messageTemplateTypeValidator, stringValidator250, stringValidator5000, listOfDisplayNameInfo, fileTypeValidator, fileSizeValidator, meetingStatusValidator, listOfAttendeesValidator, meetingInfoValidator, listOfUserIndentitiesValidator, meetingsListValidator, urlValidator, WebhookSubscriptionValidator, attendeeValidator, meetingDisplayInfoValidator, intakePhoneValidator, formResponsesValidator, stringValidator25000, automationActionValidator, automationEventValidator, automatedActionStatusValidator, listOfStringsValidatorEmptyOk, listOfChatAttachmentsValidator, listOfCalendarEventRemindersValidator, messageTemplateModeValidator, listOfAutomationConditionsValidator, chatRoomUserInfoValidator, CUDStringValidator, listOfRelatedRecordsValidator, cancelConditionsValidator, notificationPreferencesValidator, FHIRObservationCategoryValidator, FHIRObservationStatusCodeValidator, FHIRObservationValueValidator, userIdentityValidator, formFieldTypeValidator, previousFormFieldsValidator, numberValidator, organizationThemeValidator, managedContentRecordTypeValidator, passwordValidator, flowchartUIValidator, integrationAuthenticationsValidator, listOfMongoIdStringValidatorEmptyOk, formFieldOptionsValidator, blocksValidator, sessionTypeValidator, portalSettingsValidator, emailValidatorEmptyOkay, phoneValidatorOptional, stringValidator1000, databaseFieldsValidator, databaseRecordValuesValidator, automationEventsValidator, portalPageValidator, portalBlocksValidator, enduserFormResponsesForEventValidator, enduserTasksForEventValidator, stateCredentialsValidator, stateValidator, availabilityBlocksValidator, weeklyAvailabilitiesValidator, timezoneValidator, formTypeValidator, managedContentRecordAssignmentTypeValidator, listOfGenericAttachmentsValidator, accessPermissionsValidator, organizationLimitsValidator, organizationSettingsValidator, communicationsChannelValidator, genericUnitWithQuantityValidator, stringValidator25000EmptyOkay, slugValidator, stringValidator5000EmptyOkay, loginFlowResultValidator, sharedWithOrganizationIdsValidator, stringValidator1000Optional, tellescopeGenderValidator, } from "@tellescope/validation";
|
|
13
|
+
import { booleanValidator, dateValidator, emailValidator, fieldsValidator, journeysValidator, journeyStatesValidator, phoneValidator, nameValidator, nonNegNumberValidator, mongoIdValidator, mongoIdStringRequired as mongoIdStringValidator, listOfMongoIdStringValidator, preferenceValidator, objectAnyFieldsAnyValuesValidator, stringValidator, stringValidator100, listOfStringsValidator, emailEncodingValidator, numberToDateValidator, SMSMessageValidator, chatRoomTypeValidator, idStringToDateValidator, subdomainValidator, messageTemplateTypeValidator, stringValidator250, stringValidator5000, listOfDisplayNameInfo, fileTypeValidator, fileSizeValidator, meetingStatusValidator, listOfAttendeesValidator, meetingInfoValidator, listOfUserIndentitiesValidator, meetingsListValidator, urlValidator, WebhookSubscriptionValidator, attendeeValidator, meetingDisplayInfoValidator, intakePhoneValidator, formResponsesValidator, stringValidator25000, automationActionValidator, automationEventValidator, automatedActionStatusValidator, listOfStringsValidatorEmptyOk, listOfChatAttachmentsValidator, listOfCalendarEventRemindersValidator, messageTemplateModeValidator, listOfAutomationConditionsValidator, chatRoomUserInfoValidator, CUDStringValidator, listOfRelatedRecordsValidator, cancelConditionsValidator, notificationPreferencesValidator, FHIRObservationCategoryValidator, FHIRObservationStatusCodeValidator, FHIRObservationValueValidator, userIdentityValidator, formFieldTypeValidator, previousFormFieldsValidator, numberValidator, organizationThemeValidator, managedContentRecordTypeValidator, passwordValidator, flowchartUIValidator, integrationAuthenticationsValidator, listOfMongoIdStringValidatorEmptyOk, formFieldOptionsValidator, blocksValidator, sessionTypeValidator, portalSettingsValidator, emailValidatorEmptyOkay, phoneValidatorOptional, stringValidator1000, databaseFieldsValidator, databaseRecordValuesValidator, automationEventsValidator, portalPageValidator, portalBlocksValidator, enduserFormResponsesForEventValidator, enduserTasksForEventValidator, stateCredentialsValidator, stateValidator, availabilityBlocksValidator, weeklyAvailabilitiesValidator, timezoneValidator, formTypeValidator, managedContentRecordAssignmentTypeValidator, listOfGenericAttachmentsValidator, accessPermissionsValidator, organizationLimitsValidator, organizationSettingsValidator, communicationsChannelValidator, genericUnitWithQuantityValidator, stringValidator25000EmptyOkay, slugValidator, stringValidator5000EmptyOkay, loginFlowResultValidator, sharedWithOrganizationIdsValidator, stringValidator1000Optional, tellescopeGenderValidator, appointmentTermsValidator, paymentProcessorValidator, purchaseCreditValueValidator, costValidator, integrationTitleValidator, } from "@tellescope/validation";
|
|
14
14
|
import { CREATOR_ONLY_ACCESS, DEFAULT_OPERATIONS, PLACEHOLDER_ID, ENDUSER_SESSION_TYPE, USER_SESSION_TYPE, } from "@tellescope/constants";
|
|
15
15
|
var sideEffects = {
|
|
16
16
|
handleJourneyStateChange: {
|
|
@@ -460,21 +460,32 @@ export var schema = build_schema({
|
|
|
460
460
|
op: 'custom', access: 'create', method: 'post',
|
|
461
461
|
path: '/generate-google-auth-url',
|
|
462
462
|
name: 'Generates a link to create a Google integration with Tellescope',
|
|
463
|
+
description: "", parameters: {},
|
|
464
|
+
returns: { authUrl: { validator: stringValidator, required: true }, }
|
|
465
|
+
},
|
|
466
|
+
disconnect_google_integration: {
|
|
467
|
+
op: 'custom', access: 'create', method: 'post',
|
|
468
|
+
path: '/generate-square-auth-url',
|
|
469
|
+
name: 'Generates a link to create a Square integration with Tellescope',
|
|
470
|
+
description: "", parameters: {},
|
|
471
|
+
returns: { authUrl: { validator: stringValidator, required: true }, }
|
|
472
|
+
},
|
|
473
|
+
generate_oauth2_auth_url: {
|
|
474
|
+
op: 'custom', access: 'delete', method: 'post',
|
|
475
|
+
path: '/generate-oauth2-auth-url',
|
|
463
476
|
description: "",
|
|
464
|
-
parameters: {},
|
|
477
|
+
parameters: { integration: { validator: integrationTitleValidator, } },
|
|
465
478
|
returns: {
|
|
466
|
-
authUrl: {
|
|
467
|
-
|
|
468
|
-
required: true
|
|
469
|
-
},
|
|
479
|
+
authUrl: { validator: stringValidator, required: true },
|
|
480
|
+
state: { validator: stringValidator, required: true },
|
|
470
481
|
}
|
|
471
482
|
},
|
|
472
|
-
|
|
483
|
+
disconnect_oauth2_integration: {
|
|
473
484
|
op: 'custom', access: 'delete', method: 'post',
|
|
474
|
-
path: '/disconnect-
|
|
475
|
-
name: 'Disconnects an integration with
|
|
476
|
-
|
|
477
|
-
parameters: {},
|
|
485
|
+
path: '/disconnect-oauth2-integration',
|
|
486
|
+
name: 'Disconnects an integration with Square',
|
|
487
|
+
refresh_oauth2_sessiondescription: "",
|
|
488
|
+
parameters: { integration: { validator: integrationTitleValidator } },
|
|
478
489
|
returns: {}
|
|
479
490
|
},
|
|
480
491
|
refresh_oauth2_session: {
|
|
@@ -1119,6 +1130,8 @@ export var schema = build_schema({
|
|
|
1119
1130
|
}, fields: {
|
|
1120
1131
|
validator: fieldsValidator,
|
|
1121
1132
|
redactions: ['enduser'],
|
|
1133
|
+
}, unredactedFields: {
|
|
1134
|
+
validator: fieldsValidator,
|
|
1122
1135
|
}, username: {
|
|
1123
1136
|
validator: subdomainValidator,
|
|
1124
1137
|
readonly: true,
|
|
@@ -1806,9 +1819,11 @@ export var schema = build_schema({
|
|
|
1806
1819
|
parameters: {
|
|
1807
1820
|
calendarEventTemplateId: { validator: mongoIdStringValidator, required: true },
|
|
1808
1821
|
from: { validator: dateValidator, required: true },
|
|
1822
|
+
locationId: { validator: mongoIdStringValidator },
|
|
1809
1823
|
restrictedByState: { validator: booleanValidator },
|
|
1810
1824
|
to: { validator: dateValidator },
|
|
1811
1825
|
limit: { validator: nonNegNumberValidator },
|
|
1826
|
+
businessId: { validator: mongoIdStringValidator }, // required for unauthenticated access
|
|
1812
1827
|
},
|
|
1813
1828
|
returns: {
|
|
1814
1829
|
availabilityBlocks: { validator: availabilityBlocksValidator, required: true }
|
|
@@ -1829,7 +1844,43 @@ export var schema = build_schema({
|
|
|
1829
1844
|
},
|
|
1830
1845
|
},
|
|
1831
1846
|
},
|
|
1832
|
-
|
|
1847
|
+
publicActions: {
|
|
1848
|
+
session_for_public_appointment_booking: {
|
|
1849
|
+
op: "custom", access: 'create', method: "post",
|
|
1850
|
+
path: '/session-for-public-appointment-booking',
|
|
1851
|
+
name: 'Generate Session for Public Appointment Booking',
|
|
1852
|
+
description: "Generates a session for booking an appointment",
|
|
1853
|
+
parameters: {
|
|
1854
|
+
email: { validator: emailValidator, required: true },
|
|
1855
|
+
calendarEventTemplateId: { validator: mongoIdStringValidator, required: true },
|
|
1856
|
+
businessId: { validator: mongoIdStringValidator, required: true },
|
|
1857
|
+
dateOfBirth: { validator: stringValidator },
|
|
1858
|
+
phone: { validator: phoneValidator },
|
|
1859
|
+
fname: { validator: nameValidator },
|
|
1860
|
+
lname: { validator: nameValidator },
|
|
1861
|
+
},
|
|
1862
|
+
returns: {
|
|
1863
|
+
authToken: { validator: stringValidator250, required: true },
|
|
1864
|
+
},
|
|
1865
|
+
},
|
|
1866
|
+
details_for_appointment_booking_page: {
|
|
1867
|
+
op: "custom", access: 'read', method: "get",
|
|
1868
|
+
path: '/details-for-appointment-booking-page',
|
|
1869
|
+
name: 'Gets Appointment Booking Details',
|
|
1870
|
+
description: "Gets details related to booking an appointment",
|
|
1871
|
+
parameters: {
|
|
1872
|
+
appointmentBookingPageId: { validator: mongoIdStringValidator, required: true },
|
|
1873
|
+
businessId: { validator: mongoIdStringValidator, required: true }, // organizationIds can be pulled from the corresponding appointment
|
|
1874
|
+
},
|
|
1875
|
+
returns: {
|
|
1876
|
+
appointmentBookingPage: { validator: 'appointment_booking_page', required: true },
|
|
1877
|
+
calendarEventTemplates: { validator: 'calendar_event_templates', required: true },
|
|
1878
|
+
locations: { validator: 'appointment_locations', required: true },
|
|
1879
|
+
products: { validator: 'products', required: true },
|
|
1880
|
+
},
|
|
1881
|
+
}
|
|
1882
|
+
},
|
|
1883
|
+
enduserActions: { read: {}, readMany: {}, get_appointment_availability: {}, book_appointment: {}, session_for_public_appointment_booking: {} },
|
|
1833
1884
|
fields: __assign(__assign({}, BuiltInFields), { title: {
|
|
1834
1885
|
validator: stringValidator250,
|
|
1835
1886
|
required: true,
|
|
@@ -1892,7 +1943,7 @@ export var schema = build_schema({
|
|
|
1892
1943
|
validator: nonNegNumberValidator,
|
|
1893
1944
|
examples: [100],
|
|
1894
1945
|
required: true,
|
|
1895
|
-
}, type: { validator: stringValidator100 }, description: { validator: stringValidator5000 }, reminders: {
|
|
1946
|
+
}, productIds: { validator: listOfMongoIdStringValidatorEmptyOk }, type: { validator: stringValidator100 }, description: { validator: stringValidator5000 }, reminders: {
|
|
1896
1947
|
validator: listOfCalendarEventRemindersValidator,
|
|
1897
1948
|
initializer: function () { return []; },
|
|
1898
1949
|
}, publicRead: { validator: booleanValidator }, enableVideoCall: { validator: booleanValidator }, enableSelfScheduling: { validator: booleanValidator }, restrictedByState: { validator: booleanValidator }, image: { validator: stringValidator5000 } })
|
|
@@ -2725,6 +2776,136 @@ export var schema = build_schema({
|
|
|
2725
2776
|
]
|
|
2726
2777
|
} })
|
|
2727
2778
|
},
|
|
2779
|
+
appointment_booking_pages: {
|
|
2780
|
+
info: {},
|
|
2781
|
+
constraints: {
|
|
2782
|
+
unique: ['title'],
|
|
2783
|
+
relationship: [],
|
|
2784
|
+
},
|
|
2785
|
+
defaultActions: DEFAULT_OPERATIONS,
|
|
2786
|
+
customActions: {},
|
|
2787
|
+
enduserActions: {},
|
|
2788
|
+
fields: __assign(__assign({}, BuiltInFields), { title: {
|
|
2789
|
+
validator: stringValidator100,
|
|
2790
|
+
required: true,
|
|
2791
|
+
examples: ["Appointment Booking Title"]
|
|
2792
|
+
}, calendarEventTemplateIds: {
|
|
2793
|
+
validator: listOfMongoIdStringValidator,
|
|
2794
|
+
required: true,
|
|
2795
|
+
examples: [[PLACEHOLDER_ID]]
|
|
2796
|
+
}, locationIds: {
|
|
2797
|
+
validator: listOfMongoIdStringValidatorEmptyOk,
|
|
2798
|
+
required: true,
|
|
2799
|
+
examples: [[PLACEHOLDER_ID]]
|
|
2800
|
+
}, terms: { validator: appointmentTermsValidator }, endDate: { validator: dateValidator }, startDate: { validator: dateValidator }, backgroundColor: { validator: stringValidator100 }, primaryColor: { validator: stringValidator100 }, secondaryColor: { validator: stringValidator100 } })
|
|
2801
|
+
},
|
|
2802
|
+
appointment_locations: {
|
|
2803
|
+
info: {},
|
|
2804
|
+
constraints: {
|
|
2805
|
+
unique: ['title'],
|
|
2806
|
+
relationship: [],
|
|
2807
|
+
},
|
|
2808
|
+
defaultActions: DEFAULT_OPERATIONS,
|
|
2809
|
+
customActions: {},
|
|
2810
|
+
enduserActions: {},
|
|
2811
|
+
fields: __assign(__assign({}, BuiltInFields), { title: {
|
|
2812
|
+
validator: stringValidator100,
|
|
2813
|
+
required: true,
|
|
2814
|
+
examples: ["Appointment Booking Title"]
|
|
2815
|
+
} })
|
|
2816
|
+
},
|
|
2817
|
+
products: {
|
|
2818
|
+
info: {},
|
|
2819
|
+
constraints: {
|
|
2820
|
+
unique: ['title'],
|
|
2821
|
+
relationship: [],
|
|
2822
|
+
},
|
|
2823
|
+
defaultActions: DEFAULT_OPERATIONS,
|
|
2824
|
+
customActions: {},
|
|
2825
|
+
enduserActions: {},
|
|
2826
|
+
fields: __assign(__assign({}, BuiltInFields), { title: {
|
|
2827
|
+
validator: stringValidator100,
|
|
2828
|
+
required: true,
|
|
2829
|
+
examples: ["Product Title"]
|
|
2830
|
+
}, cost: {
|
|
2831
|
+
validator: costValidator,
|
|
2832
|
+
required: true,
|
|
2833
|
+
examples: [{ amount: 500, currency: 'USD' }],
|
|
2834
|
+
}, processor: {
|
|
2835
|
+
validator: paymentProcessorValidator,
|
|
2836
|
+
required: true,
|
|
2837
|
+
examples: ['Stripe'],
|
|
2838
|
+
}, description: { validator: stringValidator5000EmptyOkay } })
|
|
2839
|
+
},
|
|
2840
|
+
purchases: {
|
|
2841
|
+
info: {},
|
|
2842
|
+
constraints: { unique: [], relationship: [] },
|
|
2843
|
+
defaultActions: DEFAULT_OPERATIONS,
|
|
2844
|
+
customActions: {},
|
|
2845
|
+
enduserActions: {},
|
|
2846
|
+
fields: __assign(__assign({}, BuiltInFields), { productId: {
|
|
2847
|
+
validator: mongoIdStringValidator,
|
|
2848
|
+
required: true,
|
|
2849
|
+
examples: [PLACEHOLDER_ID],
|
|
2850
|
+
dependencies: [{
|
|
2851
|
+
dependsOn: ['products'],
|
|
2852
|
+
dependencyField: '_id',
|
|
2853
|
+
relationship: 'foreignKey',
|
|
2854
|
+
onDependencyDelete: 'nop',
|
|
2855
|
+
}]
|
|
2856
|
+
}, enduserId: {
|
|
2857
|
+
validator: mongoIdStringValidator,
|
|
2858
|
+
examples: [PLACEHOLDER_ID],
|
|
2859
|
+
required: true,
|
|
2860
|
+
dependencies: [{
|
|
2861
|
+
dependsOn: ['endusers'],
|
|
2862
|
+
dependencyField: '_id',
|
|
2863
|
+
relationship: 'foreignKey',
|
|
2864
|
+
onDependencyDelete: 'delete',
|
|
2865
|
+
}]
|
|
2866
|
+
}, title: {
|
|
2867
|
+
validator: stringValidator100,
|
|
2868
|
+
required: true,
|
|
2869
|
+
examples: ["Product Title"]
|
|
2870
|
+
}, cost: {
|
|
2871
|
+
validator: costValidator,
|
|
2872
|
+
required: true,
|
|
2873
|
+
examples: [{ amount: 500, currency: 'USD' }],
|
|
2874
|
+
}, processor: {
|
|
2875
|
+
validator: paymentProcessorValidator,
|
|
2876
|
+
required: true,
|
|
2877
|
+
examples: ['Stripe'],
|
|
2878
|
+
}, description: { validator: stringValidator5000EmptyOkay } })
|
|
2879
|
+
},
|
|
2880
|
+
purchase_credits: {
|
|
2881
|
+
info: {},
|
|
2882
|
+
constraints: { unique: [], relationship: [], },
|
|
2883
|
+
defaultActions: DEFAULT_OPERATIONS,
|
|
2884
|
+
customActions: {},
|
|
2885
|
+
enduserActions: {},
|
|
2886
|
+
fields: __assign(__assign({}, BuiltInFields), { enduserId: {
|
|
2887
|
+
validator: mongoIdStringValidator,
|
|
2888
|
+
examples: [PLACEHOLDER_ID],
|
|
2889
|
+
required: true,
|
|
2890
|
+
dependencies: [{
|
|
2891
|
+
dependsOn: ['endusers'],
|
|
2892
|
+
dependencyField: '_id',
|
|
2893
|
+
relationship: 'foreignKey',
|
|
2894
|
+
onDependencyDelete: 'delete',
|
|
2895
|
+
}]
|
|
2896
|
+
}, title: {
|
|
2897
|
+
validator: stringValidator100,
|
|
2898
|
+
required: true,
|
|
2899
|
+
examples: ["Purchase Credit"]
|
|
2900
|
+
}, value: {
|
|
2901
|
+
validator: purchaseCreditValueValidator,
|
|
2902
|
+
required: true,
|
|
2903
|
+
examples: [{
|
|
2904
|
+
type: "Voucher",
|
|
2905
|
+
info: {},
|
|
2906
|
+
}]
|
|
2907
|
+
}, usedAt: { validator: dateValidator, }, description: { validator: stringValidator5000EmptyOkay } })
|
|
2908
|
+
},
|
|
2728
2909
|
});
|
|
2729
2910
|
// export type SchemaType = typeof schema
|
|
2730
2911
|
// export type SchemaV1 = SchemaType// & Schema
|