@tellescope/schema 1.247.0 → 1.249.0
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 +22 -1
- package/lib/cjs/schema.d.ts.map +1 -1
- package/lib/cjs/schema.js +87 -7
- package/lib/cjs/schema.js.map +1 -1
- package/lib/esm/schema.d.ts +22 -1
- package/lib/esm/schema.d.ts.map +1 -1
- package/lib/esm/schema.js +88 -8
- package/lib/esm/schema.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/schema.ts +110 -7
package/src/schema.ts
CHANGED
|
@@ -74,6 +74,8 @@ import {
|
|
|
74
74
|
Addendum,
|
|
75
75
|
GroupCancellation,
|
|
76
76
|
FormResponseFollowup,
|
|
77
|
+
FormResponseProcedureCode,
|
|
78
|
+
FormResponseDiagnosisCode,
|
|
77
79
|
DevelopHealthRunBenefitVerificationBaseArguments,
|
|
78
80
|
WeeklyAvailability,
|
|
79
81
|
CanvasCreateNoteAutomationAction,
|
|
@@ -140,6 +142,7 @@ import {
|
|
|
140
142
|
phoneValidator,
|
|
141
143
|
nameValidator,
|
|
142
144
|
nonNegNumberValidator,
|
|
145
|
+
nonNegNumberValidatorOptional,
|
|
143
146
|
mongoIdValidator,
|
|
144
147
|
mongoIdStringRequired as mongoIdStringValidator,
|
|
145
148
|
listOfMongoIdStringValidator,
|
|
@@ -275,6 +278,7 @@ import {
|
|
|
275
278
|
listValidator,
|
|
276
279
|
userCallRoutingBehaviorValidator,
|
|
277
280
|
userUIRestrictionsValidator,
|
|
281
|
+
userFieldRedactionsValidator,
|
|
278
282
|
externalChatGPTMessagesValidator,
|
|
279
283
|
enduserProfileViewBlocksValidator,
|
|
280
284
|
customDashboardBlocksValidator,
|
|
@@ -728,6 +732,8 @@ export type CustomActions = {
|
|
|
728
732
|
groupInstance?: string,
|
|
729
733
|
groupPosition?: number,
|
|
730
734
|
startedViaPinnedForm?: boolean,
|
|
735
|
+
procedureCodes?: FormResponseProcedureCode[],
|
|
736
|
+
diagnosisCodes?: FormResponseDiagnosisCode[],
|
|
731
737
|
},
|
|
732
738
|
{ accessCode: string, url: string, response: FormResponse, fullURL: string }>
|
|
733
739
|
,
|
|
@@ -995,6 +1001,8 @@ export type CustomActions = {
|
|
|
995
1001
|
update_zoom: CustomAction<{ clientId?: string, clientSecret?: string }, { }>,
|
|
996
1002
|
proxy_read: CustomAction<{ integration: string, type: string, id?: string, query?: string }, { data: any }>,
|
|
997
1003
|
proxy_write: CustomAction<{ integration: string, type: string, id?: string, query?: Record<string, any> }, { data: any }>,
|
|
1004
|
+
load_redacted: CustomAction<{}, { integrations: Integration[] }>,
|
|
1005
|
+
update_settings: CustomAction<{ id: string, updates: Partial<Integration> }, { integration: Integration }>,
|
|
998
1006
|
},
|
|
999
1007
|
emails: {
|
|
1000
1008
|
sync_integrations: CustomAction<{ enduserEmail: string, allUsers?: boolean }, { newEmails: Email[] }>,
|
|
@@ -1184,7 +1192,11 @@ export type CustomActions = {
|
|
|
1184
1192
|
},
|
|
1185
1193
|
purchases: {
|
|
1186
1194
|
charge_card_on_file: CustomAction<
|
|
1187
|
-
{ enduserId: string, productIds?: string[], priceIds?: string[], cost?: Purchase['cost'], stripeKey?: string, description?: string, subscriptionPriceId?: string },
|
|
1195
|
+
{ enduserId: string, productIds?: string[], priceIds?: string[], cost?: Purchase['cost'], stripeKey?: string, description?: string, subscriptionPriceId?: string },
|
|
1196
|
+
{ }
|
|
1197
|
+
>,
|
|
1198
|
+
chargebee_charge_card_on_file: CustomAction<
|
|
1199
|
+
{ enduserId: string, chargebeeEnvironment: string, chargeType: string, itemPriceId?: string, quantity?: number, couponIds?: string[], cost?: Purchase['cost'], description?: string },
|
|
1188
1200
|
{ }
|
|
1189
1201
|
>,
|
|
1190
1202
|
},
|
|
@@ -1402,6 +1414,18 @@ export type SchemaV1 = Schema & {
|
|
|
1402
1414
|
|
|
1403
1415
|
export const build_schema = <T extends Schema>(schema: T) => schema
|
|
1404
1416
|
|
|
1417
|
+
const procedureCodesValidator = listValidatorOptionalOrEmptyOk(objectValidator<FormResponseProcedureCode>({
|
|
1418
|
+
code: stringValidator100,
|
|
1419
|
+
units: nonNegNumberValidator,
|
|
1420
|
+
feeCents: nonNegNumberValidatorOptional,
|
|
1421
|
+
modifiers: listOfStringsValidatorOptionalOrEmptyOk,
|
|
1422
|
+
}))
|
|
1423
|
+
|
|
1424
|
+
const diagnosisCodesValidator = listValidatorOptionalOrEmptyOk(objectValidator<FormResponseDiagnosisCode>({
|
|
1425
|
+
code: stringValidator100,
|
|
1426
|
+
description: stringValidatorOptionalEmptyOkay,
|
|
1427
|
+
}))
|
|
1428
|
+
|
|
1405
1429
|
export const schema: SchemaV1 = build_schema({
|
|
1406
1430
|
endusers: {
|
|
1407
1431
|
info: {
|
|
@@ -1443,6 +1467,17 @@ export const schema: SchemaV1 = build_schema({
|
|
|
1443
1467
|
|
|
1444
1468
|
return "Enduser organizationIds can only be updated by users"
|
|
1445
1469
|
}
|
|
1470
|
+
}, {
|
|
1471
|
+
explanation: 'invalidateSessionsBefore can only be set forward in time, never backwards',
|
|
1472
|
+
evaluate: (_v, _deps, _session, method, { updates, original }) => {
|
|
1473
|
+
if (method === 'create') return
|
|
1474
|
+
if (!updates?.invalidateSessionsBefore) return
|
|
1475
|
+
const orig = original as any
|
|
1476
|
+
if (!orig?.invalidateSessionsBefore) return
|
|
1477
|
+
if (new Date(updates.invalidateSessionsBefore) < new Date(orig.invalidateSessionsBefore)) {
|
|
1478
|
+
return "invalidateSessionsBefore can only be set forward in time"
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1446
1481
|
}
|
|
1447
1482
|
],
|
|
1448
1483
|
access: [ // for non-admins, limit access to endusers the user is assigned to, by default
|
|
@@ -1573,6 +1608,7 @@ export const schema: SchemaV1 = build_schema({
|
|
|
1573
1608
|
validator: dateValidator,
|
|
1574
1609
|
},
|
|
1575
1610
|
lastLogout: { validator: dateValidator },
|
|
1611
|
+
invalidateSessionsBefore: { validator: dateValidator },
|
|
1576
1612
|
termsSigned: { validator: dateValidator },
|
|
1577
1613
|
termsVersion: { validator: stringValidator100 },
|
|
1578
1614
|
lastCommunication: {
|
|
@@ -2203,6 +2239,10 @@ export const schema: SchemaV1 = build_schema({
|
|
|
2203
2239
|
validator: stringValidator,
|
|
2204
2240
|
readonly: true,
|
|
2205
2241
|
},
|
|
2242
|
+
approvedBusinessIds: {
|
|
2243
|
+
validator: listOfMongoIdStringValidator,
|
|
2244
|
+
readonly: true,
|
|
2245
|
+
},
|
|
2206
2246
|
},
|
|
2207
2247
|
constraints: { unique: [], relationship: [], access: [{ type: CREATOR_ONLY_ACCESS }] },
|
|
2208
2248
|
defaultActions: { read: {}, readMany: {}, delete: {} },
|
|
@@ -2508,6 +2548,32 @@ export const schema: SchemaV1 = build_schema({
|
|
|
2508
2548
|
next_page_token: { validator: stringValidator }
|
|
2509
2549
|
},
|
|
2510
2550
|
},
|
|
2551
|
+
load_redacted: {
|
|
2552
|
+
op: 'custom', access: 'read', method: 'get',
|
|
2553
|
+
path: '/integrations/load-redacted',
|
|
2554
|
+
name: 'Load Redacted Integrations',
|
|
2555
|
+
description: "Loads all integrations for the organization with sensitive fields removed",
|
|
2556
|
+
parameters: {},
|
|
2557
|
+
returns: {
|
|
2558
|
+
integrations: {
|
|
2559
|
+
validator: listValidatorEmptyOk(optionalAnyObjectValidator as any),
|
|
2560
|
+
required: true,
|
|
2561
|
+
},
|
|
2562
|
+
},
|
|
2563
|
+
},
|
|
2564
|
+
update_settings: {
|
|
2565
|
+
op: 'custom', access: 'update', method: 'post',
|
|
2566
|
+
path: '/integrations/update-settings',
|
|
2567
|
+
name: 'Update Integration Settings',
|
|
2568
|
+
description: "Updates non-sensitive integration settings",
|
|
2569
|
+
parameters: {
|
|
2570
|
+
id: { validator: mongoIdStringRequired, required: true },
|
|
2571
|
+
updates: { validator: objectAnyFieldsAnyValuesValidator, required: true },
|
|
2572
|
+
},
|
|
2573
|
+
returns: {
|
|
2574
|
+
integration: { validator: optionalAnyObjectValidator as any, required: true },
|
|
2575
|
+
},
|
|
2576
|
+
},
|
|
2511
2577
|
}
|
|
2512
2578
|
},
|
|
2513
2579
|
engagement_events: {
|
|
@@ -4616,6 +4682,7 @@ export const schema: SchemaV1 = build_schema({
|
|
|
4616
4682
|
belugaVerificationId: { validator: stringValidator },
|
|
4617
4683
|
belugaPharmacyMappings: {
|
|
4618
4684
|
validator: listValidatorOptionalOrEmptyOk(objectValidator<BelugaPharmacyMapping>({
|
|
4685
|
+
title: stringValidatorOptionalEmptyOkay,
|
|
4619
4686
|
pharmacyId: stringValidator100,
|
|
4620
4687
|
patientPreference: stringValidator5000,
|
|
4621
4688
|
conditions: compoundFilterValidator,
|
|
@@ -4627,6 +4694,8 @@ export const schema: SchemaV1 = build_schema({
|
|
|
4627
4694
|
}))
|
|
4628
4695
|
},
|
|
4629
4696
|
autoMergeOnSubmission: { validator: booleanValidator },
|
|
4697
|
+
procedureCodes: { validator: procedureCodesValidator },
|
|
4698
|
+
diagnosisCodes: { validator: diagnosisCodesValidator },
|
|
4630
4699
|
gtmTag: { validator: stringValidator100EscapeHTML },
|
|
4631
4700
|
dontSyncToCanvasOnSubmission: { validator: booleanValidator },
|
|
4632
4701
|
archivedAt: { validator: dateOptionalOrEmptyStringValidator },
|
|
@@ -4909,9 +4978,11 @@ export const schema: SchemaV1 = build_schema({
|
|
|
4909
4978
|
}))
|
|
4910
4979
|
},
|
|
4911
4980
|
startedViaPinnedForm: { validator: booleanValidator },
|
|
4981
|
+
procedureCodes: { validator: procedureCodesValidator },
|
|
4982
|
+
diagnosisCodes: { validator: diagnosisCodesValidator },
|
|
4912
4983
|
},
|
|
4913
4984
|
defaultActions: DEFAULT_OPERATIONS,
|
|
4914
|
-
enduserActions: {
|
|
4985
|
+
enduserActions: {
|
|
4915
4986
|
prepare_form_response: {}, info_for_access_code: {}, submit_form_response: {}, stripe_details: {}, chargebee_details: {},
|
|
4916
4987
|
read: {}, readMany: {}, save_field_response: {},
|
|
4917
4988
|
update: { } /* allows for hiding from client portal, storing partial responses while submitting form */
|
|
@@ -4939,6 +5010,8 @@ export const schema: SchemaV1 = build_schema({
|
|
|
4939
5010
|
groupInstance: { validator: stringValidator100 },
|
|
4940
5011
|
groupPosition: { validator: nonNegNumberValidator },
|
|
4941
5012
|
startedViaPinnedForm: { validator: booleanValidator },
|
|
5013
|
+
procedureCodes: { validator: procedureCodesValidator },
|
|
5014
|
+
diagnosisCodes: { validator: diagnosisCodesValidator },
|
|
4942
5015
|
},
|
|
4943
5016
|
returns: {
|
|
4944
5017
|
accessCode: { validator: stringValidator250, required: true },
|
|
@@ -7001,6 +7074,7 @@ export const schema: SchemaV1 = build_schema({
|
|
|
7001
7074
|
subdomain: {
|
|
7002
7075
|
validator: slugValidator,
|
|
7003
7076
|
required: true,
|
|
7077
|
+
readonly: true, // mutated only by Tellescope (internal); see CloudFront portal-v2 alias safety
|
|
7004
7078
|
examples: ["subdomain"],
|
|
7005
7079
|
},
|
|
7006
7080
|
limits: {
|
|
@@ -7065,6 +7139,8 @@ export const schema: SchemaV1 = build_schema({
|
|
|
7065
7139
|
number: stringValidator100,
|
|
7066
7140
|
}))
|
|
7067
7141
|
},
|
|
7142
|
+
faxCoverPageEnabled: { validator: booleanValidator },
|
|
7143
|
+
faxCoverPageId: { validator: stringValidator250 },
|
|
7068
7144
|
athenaFieldsSync: { validator: fieldsSyncValidator },
|
|
7069
7145
|
athenaDepartments: {
|
|
7070
7146
|
validator: listValidatorOptionalOrEmptyOk(objectValidator<{ id: string, timezone: Timezone }>({
|
|
@@ -7112,6 +7188,7 @@ export const schema: SchemaV1 = build_schema({
|
|
|
7112
7188
|
},
|
|
7113
7189
|
groups: { validator: listOfStringsValidatorUniqueOptionalOrEmptyOkay },
|
|
7114
7190
|
canvasURL: { validator: stringValidator },
|
|
7191
|
+
healthiePortalURL: { validator: stringValidator },
|
|
7115
7192
|
observationInvalidationReasons: { validator: listOfStringsValidatorUniqueOptionalOrEmptyOkay },
|
|
7116
7193
|
customNotificationTypes: { validator: listOfStringsValidatorUniqueOptionalOrEmptyOkay },
|
|
7117
7194
|
customerIOFields: { validator: listOfStringsValidatorUniqueOptionalOrEmptyOkay },
|
|
@@ -7123,15 +7200,18 @@ export const schema: SchemaV1 = build_schema({
|
|
|
7123
7200
|
skipActivePatientBilling: { validator: booleanValidator },
|
|
7124
7201
|
portalV2SchemaURL: { validator: stringValidator },
|
|
7125
7202
|
timeTrackingPrograms: {
|
|
7126
|
-
validator: listValidatorOptionalOrEmptyOk(objectValidator<{ title: string, billingCodes: { billingCode: string, timeInMinutes: number }[], forms?: { id: string }[] }>({
|
|
7203
|
+
validator: listValidatorOptionalOrEmptyOk(objectValidator<{ title: string, billingCodes: { billingCode: string, timeInMinutes: number, repeatable?: boolean, feeCents?: number }[], forms?: { id: string }[], summaryFormId?: string }>({
|
|
7127
7204
|
title: stringValidator100,
|
|
7128
|
-
billingCodes: listValidatorEmptyOk(objectValidator<{ billingCode: string, timeInMinutes: number }>({
|
|
7205
|
+
billingCodes: listValidatorEmptyOk(objectValidator<{ billingCode: string, timeInMinutes: number, repeatable?: boolean, feeCents?: number }>({
|
|
7129
7206
|
billingCode: stringValidator100,
|
|
7130
7207
|
timeInMinutes: nonNegNumberValidator,
|
|
7208
|
+
repeatable: booleanValidatorOptional,
|
|
7209
|
+
feeCents: nonNegNumberValidatorOptional,
|
|
7131
7210
|
})),
|
|
7132
7211
|
forms: listValidatorOptionalOrEmptyOk(objectValidator<{ id: string }>({
|
|
7133
7212
|
id: mongoIdStringRequired,
|
|
7134
7213
|
})),
|
|
7214
|
+
summaryFormId: mongoIdStringOptional,
|
|
7135
7215
|
}))
|
|
7136
7216
|
},
|
|
7137
7217
|
},
|
|
@@ -7363,6 +7443,7 @@ export const schema: SchemaV1 = build_schema({
|
|
|
7363
7443
|
]
|
|
7364
7444
|
},
|
|
7365
7445
|
uiRestrictions: { validator: userUIRestrictionsValidator },
|
|
7446
|
+
fieldRedactions: { validator: userFieldRedactionsValidator },
|
|
7366
7447
|
}
|
|
7367
7448
|
},
|
|
7368
7449
|
appointment_booking_pages: {
|
|
@@ -7577,11 +7658,11 @@ export const schema: SchemaV1 = build_schema({
|
|
|
7577
7658
|
defaultActions: DEFAULT_OPERATIONS,
|
|
7578
7659
|
customActions: {
|
|
7579
7660
|
charge_card_on_file: {
|
|
7580
|
-
op: "custom", access: 'create', method: "post",
|
|
7661
|
+
op: "custom", access: 'create', method: "post",
|
|
7581
7662
|
name: 'Charge Stripe Card on File',
|
|
7582
7663
|
path: '/purchases/charge-card',
|
|
7583
7664
|
description: "Charges an existing card on file (if saved), otherwise throws an error",
|
|
7584
|
-
parameters: {
|
|
7665
|
+
parameters: {
|
|
7585
7666
|
enduserId: { validator: mongoIdStringValidator, required: true },
|
|
7586
7667
|
productIds: { validator: listOfMongoIdStringValidatorEmptyOk },
|
|
7587
7668
|
priceIds: { validator: listOfStringsValidatorOptionalOrEmptyOk }, // stripe price IDs, not Tellescope ids
|
|
@@ -7593,7 +7674,25 @@ export const schema: SchemaV1 = build_schema({
|
|
|
7593
7674
|
returns: {
|
|
7594
7675
|
|
|
7595
7676
|
},
|
|
7596
|
-
},
|
|
7677
|
+
},
|
|
7678
|
+
chargebee_charge_card_on_file: {
|
|
7679
|
+
op: "custom", access: 'create', method: "post",
|
|
7680
|
+
name: 'Charge Chargebee Card on File',
|
|
7681
|
+
path: '/purchases/chargebee-charge-card',
|
|
7682
|
+
description: "Charges a Chargebee customer's card on file",
|
|
7683
|
+
parameters: {
|
|
7684
|
+
enduserId: { validator: mongoIdStringValidator, required: true },
|
|
7685
|
+
chargebeeEnvironment: { validator: stringValidator, required: true },
|
|
7686
|
+
chargeType: { validator: stringValidator, required: true },
|
|
7687
|
+
itemPriceId: { validator: stringValidator100 },
|
|
7688
|
+
quantity: { validator: numberValidator },
|
|
7689
|
+
couponIds: { validator: listOfStringsValidatorOptionalOrEmptyOk },
|
|
7690
|
+
cost: { validator: costValidator },
|
|
7691
|
+
description: { validator: stringValidator },
|
|
7692
|
+
},
|
|
7693
|
+
returns: {
|
|
7694
|
+
},
|
|
7695
|
+
},
|
|
7597
7696
|
},
|
|
7598
7697
|
enduserActions: { read: {}, readMany: {} },
|
|
7599
7698
|
fields: {
|
|
@@ -8566,6 +8665,9 @@ If a voicemail is left, it is indicated by recordingURI, transcription, or recor
|
|
|
8566
8665
|
},
|
|
8567
8666
|
customFields: {
|
|
8568
8667
|
validator: customEnduserFieldsValidatorOptionalOrEmpty,
|
|
8668
|
+
},
|
|
8669
|
+
createEnduserForms: {
|
|
8670
|
+
validator: listOfMongoIdStringValidatorOptionalOrEmptyOk,
|
|
8569
8671
|
}
|
|
8570
8672
|
}
|
|
8571
8673
|
},
|
|
@@ -9160,6 +9262,7 @@ If a voicemail is left, it is indicated by recordingURI, transcription, or recor
|
|
|
9160
9262
|
cancellationReason: { validator: stringValidatorOptional },
|
|
9161
9263
|
medication: { validator: stringValidatorOptional },
|
|
9162
9264
|
medicationSku: { validator: stringValidatorOptional },
|
|
9265
|
+
protocol: { validator: stringValidator1000 },
|
|
9163
9266
|
}
|
|
9164
9267
|
},
|
|
9165
9268
|
vital_configurations: {
|