@tellescope/schema 1.4.0 → 1.4.1
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 +12 -16
- package/lib/cjs/schema.d.ts.map +1 -1
- package/lib/cjs/schema.js +139 -121
- package/lib/cjs/schema.js.map +1 -1
- package/lib/esm/schema.d.ts +12 -16
- package/lib/esm/schema.d.ts.map +1 -1
- package/lib/esm/schema.js +41 -23
- package/lib/esm/schema.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/schema.ts +57 -36
package/lib/cjs/schema.js
CHANGED
|
@@ -60,11 +60,11 @@ var BuiltInFields = {
|
|
|
60
60
|
readonly: true,
|
|
61
61
|
},
|
|
62
62
|
businessId: {
|
|
63
|
-
validator: validation_1.
|
|
63
|
+
validator: validation_1.mongoIdStringRequired,
|
|
64
64
|
readonly: true,
|
|
65
65
|
},
|
|
66
66
|
creator: {
|
|
67
|
-
validator: validation_1.
|
|
67
|
+
validator: validation_1.mongoIdStringRequired,
|
|
68
68
|
readonly: true,
|
|
69
69
|
},
|
|
70
70
|
updatedAt: {
|
|
@@ -77,6 +77,7 @@ exports.build_schema = build_schema;
|
|
|
77
77
|
exports.schema = (0, exports.build_schema)({
|
|
78
78
|
endusers: {
|
|
79
79
|
info: {
|
|
80
|
+
description: "Used to represent patients or other endusers. See Users for managing your team member's accounts.",
|
|
80
81
|
sideEffects: {
|
|
81
82
|
create: [sideEffects.handleJourneyStateChange],
|
|
82
83
|
update: [sideEffects.handleJourneyStateChange],
|
|
@@ -130,7 +131,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
130
131
|
initializer: function (e) { return !!e.email; },
|
|
131
132
|
redactions: ['enduser'],
|
|
132
133
|
}, phone: {
|
|
133
|
-
validator: validation_1.
|
|
134
|
+
validator: validation_1.phoneValidatorOptional,
|
|
134
135
|
examples: ['+14155555555'],
|
|
135
136
|
redactions: ['enduser'],
|
|
136
137
|
}, phoneConsent: {
|
|
@@ -204,7 +205,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
204
205
|
description: "Adds (or restarts) endusers in a journey",
|
|
205
206
|
parameters: {
|
|
206
207
|
enduserIds: { validator: validation_1.listOfMongoIdStringValidator, required: true },
|
|
207
|
-
journeyId: { validator: validation_1.
|
|
208
|
+
journeyId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
208
209
|
},
|
|
209
210
|
returns: {}
|
|
210
211
|
},
|
|
@@ -214,7 +215,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
214
215
|
path: '/set-enduser-password',
|
|
215
216
|
description: "Sets (or resets) an enduser's password. Minimum length 8 characters.",
|
|
216
217
|
parameters: {
|
|
217
|
-
id: { validator: validation_1.
|
|
218
|
+
id: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
218
219
|
password: { validator: validation_1.stringValidator100, required: true },
|
|
219
220
|
},
|
|
220
221
|
returns: {} //authToken: { validator: stringValidator5000 } },
|
|
@@ -225,7 +226,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
225
226
|
path: '/enduser-is-authenticated',
|
|
226
227
|
description: "Checks the validity of an enduser's authToken",
|
|
227
228
|
parameters: {
|
|
228
|
-
id: { validator: validation_1.
|
|
229
|
+
id: { validator: validation_1.mongoIdStringRequired },
|
|
229
230
|
authToken: { validator: validation_1.stringValidator5000, required: true },
|
|
230
231
|
},
|
|
231
232
|
returns: {
|
|
@@ -251,7 +252,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
251
252
|
path: '/generate-enduser-auth-token',
|
|
252
253
|
description: "Generates an authToken for use by an enduser. Useful for integrating a 3rd-party authentication process or creating a session for an enduser without a set password in Tellescope.",
|
|
253
254
|
parameters: {
|
|
254
|
-
id: { validator: validation_1.
|
|
255
|
+
id: { validator: validation_1.mongoIdStringRequired },
|
|
255
256
|
externalId: { validator: validation_1.stringValidator250 },
|
|
256
257
|
email: { validator: validation_1.emailValidator },
|
|
257
258
|
phone: { validator: validation_1.phoneValidator },
|
|
@@ -290,7 +291,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
290
291
|
description: "Generates an authentication token for access to enduser-facing endpoints",
|
|
291
292
|
enduserOnly: true,
|
|
292
293
|
parameters: {
|
|
293
|
-
id: { validator: validation_1.
|
|
294
|
+
id: { validator: validation_1.mongoIdStringRequired },
|
|
294
295
|
phone: { validator: validation_1.phoneValidator },
|
|
295
296
|
email: { validator: validation_1.emailValidator },
|
|
296
297
|
password: { validator: validation_1.stringValidator100, required: true },
|
|
@@ -321,7 +322,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
321
322
|
description: "Sends a password reset email",
|
|
322
323
|
parameters: {
|
|
323
324
|
email: { validator: validation_1.emailValidator, required: true },
|
|
324
|
-
businessId: { validator: validation_1.
|
|
325
|
+
businessId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
325
326
|
},
|
|
326
327
|
returns: {},
|
|
327
328
|
},
|
|
@@ -333,7 +334,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
333
334
|
parameters: {
|
|
334
335
|
resetToken: { validator: validation_1.stringValidator250, required: true },
|
|
335
336
|
newPassword: { validator: validation_1.passwordValidator, required: true },
|
|
336
|
-
businessId: { validator: validation_1.
|
|
337
|
+
businessId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
337
338
|
},
|
|
338
339
|
returns: {},
|
|
339
340
|
},
|
|
@@ -344,7 +345,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
344
345
|
sideEffects: { create: [sideEffects.updateEnduserStatus], createMany: [sideEffects.updateEnduserStatus] },
|
|
345
346
|
},
|
|
346
347
|
fields: __assign(__assign({}, BuiltInFields), { journeyId: {
|
|
347
|
-
validator: validation_1.
|
|
348
|
+
validator: validation_1.mongoIdStringRequired,
|
|
348
349
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
349
350
|
required: true,
|
|
350
351
|
dependencies: [{
|
|
@@ -354,7 +355,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
354
355
|
onDependencyDelete: 'delete',
|
|
355
356
|
}]
|
|
356
357
|
}, enduserId: {
|
|
357
|
-
validator: validation_1.
|
|
358
|
+
validator: validation_1.mongoIdStringRequired,
|
|
358
359
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
359
360
|
required: true,
|
|
360
361
|
dependencies: [{
|
|
@@ -388,7 +389,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
388
389
|
parameters: {},
|
|
389
390
|
returns: {
|
|
390
391
|
id: {
|
|
391
|
-
validator: validation_1.
|
|
392
|
+
validator: validation_1.mongoIdStringRequired,
|
|
392
393
|
},
|
|
393
394
|
key: {
|
|
394
395
|
validator: validation_1.stringValidator,
|
|
@@ -453,7 +454,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
453
454
|
engagement_events: {
|
|
454
455
|
info: {},
|
|
455
456
|
fields: __assign(__assign({}, BuiltInFields), { enduserId: {
|
|
456
|
-
validator: validation_1.
|
|
457
|
+
validator: validation_1.mongoIdStringRequired,
|
|
457
458
|
required: true,
|
|
458
459
|
updatesDisabled: true,
|
|
459
460
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
@@ -519,27 +520,27 @@ exports.schema = (0, exports.build_schema)({
|
|
|
519
520
|
],
|
|
520
521
|
} }),
|
|
521
522
|
customActions: {
|
|
522
|
-
update_state: {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
},
|
|
523
|
+
// update_state: {
|
|
524
|
+
// op: 'custom', access: 'update', method: "patch",
|
|
525
|
+
// name: 'Update State',
|
|
526
|
+
// path: '/journey/:id/state/:name',
|
|
527
|
+
// description: "Updates a state in a journey. Endusers and automations are updated automatically.",
|
|
528
|
+
// parameters: {
|
|
529
|
+
// id: { validator: mongoIdStringValidator },
|
|
530
|
+
// name: { validator: stringValidator100 },
|
|
531
|
+
// updates: { validator: journeyStateUpdateValidator, required: true },
|
|
532
|
+
// },
|
|
533
|
+
// returns: {
|
|
534
|
+
// updated: { validator: 'journey' as any }
|
|
535
|
+
// },
|
|
536
|
+
// },
|
|
536
537
|
delete_states: {
|
|
537
538
|
op: 'custom', access: 'update', method: "delete",
|
|
538
539
|
name: 'Delete States',
|
|
539
540
|
path: '/journey/:id/states',
|
|
540
541
|
description: "Deletes states in a journey. Endusers and automations are updated automatically.",
|
|
541
542
|
parameters: {
|
|
542
|
-
id: { validator: validation_1.
|
|
543
|
+
id: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
543
544
|
states: { validator: validation_1.listOfStringsValidator, required: true },
|
|
544
545
|
},
|
|
545
546
|
returns: { updated: 'journey' },
|
|
@@ -560,7 +561,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
560
561
|
}, dueDate: {
|
|
561
562
|
validator: validation_1.dateValidator,
|
|
562
563
|
}, assignedTo: {
|
|
563
|
-
validator: validation_1.
|
|
564
|
+
validator: validation_1.mongoIdStringRequired,
|
|
564
565
|
dependencies: [{
|
|
565
566
|
dependsOn: ['users'],
|
|
566
567
|
dependencyField: '_id',
|
|
@@ -568,7 +569,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
568
569
|
onDependencyDelete: 'unset',
|
|
569
570
|
}]
|
|
570
571
|
}, enduserId: {
|
|
571
|
-
validator: validation_1.
|
|
572
|
+
validator: validation_1.mongoIdStringRequired,
|
|
572
573
|
dependencies: [{
|
|
573
574
|
dependsOn: ['endusers'],
|
|
574
575
|
dependencyField: '_id',
|
|
@@ -627,7 +628,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
627
628
|
examples: [true],
|
|
628
629
|
initializer: function () { return false; },
|
|
629
630
|
}, enduserId: {
|
|
630
|
-
validator: validation_1.
|
|
631
|
+
validator: validation_1.mongoIdStringRequired,
|
|
631
632
|
required: true,
|
|
632
633
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
633
634
|
dependencies: [{
|
|
@@ -637,7 +638,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
637
638
|
onDependencyDelete: 'delete',
|
|
638
639
|
}]
|
|
639
640
|
}, userId: {
|
|
640
|
-
validator: validation_1.
|
|
641
|
+
validator: validation_1.mongoIdStringRequired,
|
|
641
642
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
642
643
|
updatesDisabled: true,
|
|
643
644
|
initializer: function (a, s) { return s.id; },
|
|
@@ -692,7 +693,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
692
693
|
readonly: true,
|
|
693
694
|
}, readBy: {
|
|
694
695
|
validator: validation_1.idStringToDateValidator,
|
|
695
|
-
}, templateId: { validator: validation_1.
|
|
696
|
+
}, templateId: { validator: validation_1.mongoIdStringRequired }, automationStepId: { validator: validation_1.mongoIdStringRequired } }),
|
|
696
697
|
customActions: {
|
|
697
698
|
sync_integrations: {
|
|
698
699
|
op: "custom", access: 'read', method: "post",
|
|
@@ -754,7 +755,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
754
755
|
readonly: true,
|
|
755
756
|
examples: [{ 0: new Date() }]
|
|
756
757
|
}, enduserId: {
|
|
757
|
-
validator: validation_1.
|
|
758
|
+
validator: validation_1.mongoIdStringRequired,
|
|
758
759
|
required: true,
|
|
759
760
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
760
761
|
updatesDisabled: true,
|
|
@@ -765,7 +766,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
765
766
|
onDependencyDelete: 'delete',
|
|
766
767
|
}]
|
|
767
768
|
}, userId: {
|
|
768
|
-
validator: validation_1.
|
|
769
|
+
validator: validation_1.mongoIdStringRequired,
|
|
769
770
|
initializer: function (a, s) { return s.id; },
|
|
770
771
|
updatesDisabled: true,
|
|
771
772
|
dependencies: [{
|
|
@@ -790,7 +791,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
790
791
|
readonly: true,
|
|
791
792
|
}, readBy: {
|
|
792
793
|
validator: validation_1.idStringToDateValidator,
|
|
793
|
-
}, templateId: { validator: validation_1.
|
|
794
|
+
}, templateId: { validator: validation_1.mongoIdStringRequired }, automationStepId: { validator: validation_1.mongoIdStringRequired } }),
|
|
794
795
|
customActions: {},
|
|
795
796
|
},
|
|
796
797
|
chat_rooms: {
|
|
@@ -832,11 +833,11 @@ exports.schema = (0, exports.build_schema)({
|
|
|
832
833
|
initializer: function () { return ''; },
|
|
833
834
|
readonly: true,
|
|
834
835
|
}, recentSender: {
|
|
835
|
-
validator: validation_1.
|
|
836
|
+
validator: validation_1.mongoIdStringRequired,
|
|
836
837
|
initializer: function () { return ''; },
|
|
837
838
|
readonly: true,
|
|
838
839
|
}, ticketId: {
|
|
839
|
-
validator: validation_1.
|
|
840
|
+
validator: validation_1.mongoIdStringRequired,
|
|
840
841
|
}, endedAt: {
|
|
841
842
|
validator: validation_1.dateValidator,
|
|
842
843
|
}, tags: {
|
|
@@ -852,7 +853,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
852
853
|
name: 'Join chat room',
|
|
853
854
|
path: '/join-chat-room',
|
|
854
855
|
description: "Allows a user to join a chat room with no other users, for use in accepting support chats.",
|
|
855
|
-
parameters: { id: { validator: validation_1.
|
|
856
|
+
parameters: { id: { validator: validation_1.mongoIdStringRequired, required: true } },
|
|
856
857
|
returns: {
|
|
857
858
|
room: { validator: 'Room' },
|
|
858
859
|
} // add room eventually, when validator defined
|
|
@@ -862,7 +863,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
862
863
|
name: 'Mark Read',
|
|
863
864
|
path: '/mark-chat-room-read',
|
|
864
865
|
description: "Marks the conversation read by the authenticated user",
|
|
865
|
-
parameters: { id: { validator: validation_1.
|
|
866
|
+
parameters: { id: { validator: validation_1.mongoIdStringRequired, required: true } },
|
|
866
867
|
returns: {
|
|
867
868
|
updated: { validator: 'Room' },
|
|
868
869
|
} // add room eventually, when validator defined
|
|
@@ -872,10 +873,10 @@ exports.schema = (0, exports.build_schema)({
|
|
|
872
873
|
name: 'Attendee display info',
|
|
873
874
|
path: '/chat-room-display-info',
|
|
874
875
|
description: "Returns an object which maps userIds/enduserIds to display information. Includes the roomId as the 'id' field.",
|
|
875
|
-
parameters: { id: { validator: validation_1.
|
|
876
|
+
parameters: { id: { validator: validation_1.mongoIdStringRequired, required: true } },
|
|
876
877
|
returns: {
|
|
877
878
|
display_info: { validator: validation_1.meetingDisplayInfoValidator, required: true },
|
|
878
|
-
id: { validator: validation_1.
|
|
879
|
+
id: { validator: validation_1.mongoIdStringRequired },
|
|
879
880
|
}
|
|
880
881
|
},
|
|
881
882
|
},
|
|
@@ -900,7 +901,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
900
901
|
enduserActions: { create: {}, read: {}, readMany: {} },
|
|
901
902
|
customActions: {},
|
|
902
903
|
fields: __assign(__assign({}, BuiltInFields), { roomId: {
|
|
903
|
-
validator: validation_1.
|
|
904
|
+
validator: validation_1.mongoIdStringRequired,
|
|
904
905
|
required: true,
|
|
905
906
|
updatesDisabled: true,
|
|
906
907
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
@@ -915,7 +916,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
915
916
|
readonly: true,
|
|
916
917
|
examples: [{ 0: new Date() }]
|
|
917
918
|
}, senderId: {
|
|
918
|
-
validator: validation_1.
|
|
919
|
+
validator: validation_1.mongoIdStringRequired,
|
|
919
920
|
readonly: true,
|
|
920
921
|
initializer: function (a, s) { return s.id; },
|
|
921
922
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
@@ -930,7 +931,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
930
931
|
required: true,
|
|
931
932
|
examples: ["Message"]
|
|
932
933
|
}, html: { validator: validation_1.stringValidator5000 }, replyId: {
|
|
933
|
-
validator: validation_1.
|
|
934
|
+
validator: validation_1.mongoIdStringRequired,
|
|
934
935
|
updatesDisabled: true,
|
|
935
936
|
dependencies: [{
|
|
936
937
|
dependsOn: ['chats'],
|
|
@@ -942,14 +943,17 @@ exports.schema = (0, exports.build_schema)({
|
|
|
942
943
|
validator: validation_1.idStringToDateValidator,
|
|
943
944
|
}, attachments: {
|
|
944
945
|
validator: validation_1.listOfChatAttachmentsValidator,
|
|
945
|
-
}, templateId: { validator: validation_1.
|
|
946
|
+
}, templateId: { validator: validation_1.mongoIdStringRequired }, automationStepId: { validator: validation_1.mongoIdStringRequired } }),
|
|
946
947
|
},
|
|
947
948
|
users: {
|
|
948
|
-
info: {
|
|
949
|
+
info: {
|
|
950
|
+
description: "Used to represent your team member accounts. See Endusers for representing patients and other types of stakeholders.",
|
|
951
|
+
},
|
|
949
952
|
constraints: {
|
|
950
953
|
unique: ['username'],
|
|
951
954
|
globalUnique: ['email', 'phone'],
|
|
952
|
-
relationship: [
|
|
955
|
+
relationship: [
|
|
956
|
+
{
|
|
953
957
|
explanation: "Only admin users can update others' profiles",
|
|
954
958
|
evaluate: function (_a, _, session) {
|
|
955
959
|
var _b;
|
|
@@ -960,7 +964,22 @@ exports.schema = (0, exports.build_schema)({
|
|
|
960
964
|
return;
|
|
961
965
|
return "Only admin users can update others' profiles";
|
|
962
966
|
}
|
|
963
|
-
}
|
|
967
|
+
}, {
|
|
968
|
+
explanation: "Only admin users can update user roles",
|
|
969
|
+
evaluate: function (_a, _, session, method, _b) {
|
|
970
|
+
var _c;
|
|
971
|
+
var roles = _a.roles;
|
|
972
|
+
var updates = _b.updates;
|
|
973
|
+
if ((_c = session === null || session === void 0 ? void 0 : session.roles) === null || _c === void 0 ? void 0 : _c.includes('Admin'))
|
|
974
|
+
return; // admin can do this
|
|
975
|
+
if (method === 'create')
|
|
976
|
+
return; // create already admin restricted
|
|
977
|
+
if (!(updates === null || updates === void 0 ? void 0 : updates.roles))
|
|
978
|
+
return; // roles not provided
|
|
979
|
+
return "Only admin users can update others' profiles";
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
],
|
|
964
983
|
},
|
|
965
984
|
defaultActions: {
|
|
966
985
|
create: { adminOnly: true }, createMany: { adminOnly: true }, delete: { adminOnly: true },
|
|
@@ -974,7 +993,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
974
993
|
path: '/generate-auth-token',
|
|
975
994
|
description: "Generates an authToken for a user or enduser. Useful for integrating a 3rd-party authentication process.",
|
|
976
995
|
parameters: {
|
|
977
|
-
id: { validator: validation_1.
|
|
996
|
+
id: { validator: validation_1.mongoIdStringRequired },
|
|
978
997
|
externalId: { validator: validation_1.stringValidator250 },
|
|
979
998
|
email: { validator: validation_1.emailValidator },
|
|
980
999
|
phone: { validator: validation_1.phoneValidator },
|
|
@@ -1053,7 +1072,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1053
1072
|
}, lname: {
|
|
1054
1073
|
validator: validation_1.nameValidator,
|
|
1055
1074
|
}, suffixes: { validator: validation_1.listOfStringsValidatorEmptyOk }, organization: {
|
|
1056
|
-
validator: validation_1.
|
|
1075
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1057
1076
|
updatesDisabled: true,
|
|
1058
1077
|
}, orgEmail: {
|
|
1059
1078
|
validator: validation_1.emailValidator,
|
|
@@ -1062,10 +1081,9 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1062
1081
|
validator: validation_1.accountTypeValidator,
|
|
1063
1082
|
}, roles: {
|
|
1064
1083
|
validator: validation_1.listOfStringsValidator,
|
|
1065
|
-
updatesDisabled: true,
|
|
1066
1084
|
redactions: ['enduser'],
|
|
1067
1085
|
}, acknowledgedIntegrations: { validator: validation_1.dateValidator }, skills: {
|
|
1068
|
-
validator: validation_1.
|
|
1086
|
+
validator: validation_1.listOfStringsValidatorEmptyOk,
|
|
1069
1087
|
}, verifiedEmail: {
|
|
1070
1088
|
updatesDisabled: true,
|
|
1071
1089
|
validator: validation_1.booleanValidator,
|
|
@@ -1137,7 +1155,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1137
1155
|
validator: validation_1.fileTypeValidator,
|
|
1138
1156
|
required: true
|
|
1139
1157
|
}, enduserId: {
|
|
1140
|
-
validator: validation_1.
|
|
1158
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1141
1159
|
}, secureName: {
|
|
1142
1160
|
validator: validation_1.stringValidator250,
|
|
1143
1161
|
readonly: true,
|
|
@@ -1165,7 +1183,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1165
1183
|
publicRead: { validator: validation_1.booleanValidator },
|
|
1166
1184
|
publicName: { validator: validation_1.stringValidator5000 },
|
|
1167
1185
|
enduserId: {
|
|
1168
|
-
validator: validation_1.
|
|
1186
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1169
1187
|
dependencies: [{
|
|
1170
1188
|
dependsOn: ['endusers'],
|
|
1171
1189
|
dependencyField: '_id',
|
|
@@ -1227,7 +1245,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1227
1245
|
required: true,
|
|
1228
1246
|
examples: ["Ticket Name"],
|
|
1229
1247
|
}, enduserId: {
|
|
1230
|
-
validator: validation_1.
|
|
1248
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1231
1249
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1232
1250
|
dependencies: [{
|
|
1233
1251
|
dependsOn: ['endusers'],
|
|
@@ -1236,19 +1254,19 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1236
1254
|
onDependencyDelete: 'setNull',
|
|
1237
1255
|
}]
|
|
1238
1256
|
}, automationStepId: {
|
|
1239
|
-
validator: validation_1.
|
|
1257
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1240
1258
|
}, closedForReason: {
|
|
1241
1259
|
validator: validation_1.stringValidator,
|
|
1242
1260
|
}, closeReasons: {
|
|
1243
1261
|
validator: validation_1.listOfStringsValidatorEmptyOk,
|
|
1244
1262
|
}, chatRoomId: {
|
|
1245
|
-
validator: validation_1.
|
|
1263
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1246
1264
|
}, dueDateInMS: {
|
|
1247
1265
|
validator: validation_1.nonNegNumberValidator,
|
|
1248
1266
|
}, closedAt: {
|
|
1249
1267
|
validator: validation_1.dateValidator,
|
|
1250
1268
|
}, owner: {
|
|
1251
|
-
validator: validation_1.
|
|
1269
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1252
1270
|
}, message: {
|
|
1253
1271
|
validator: validation_1.stringValidator5000,
|
|
1254
1272
|
examples: ["Message"],
|
|
@@ -1276,7 +1294,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1276
1294
|
op: "read", access: 'read', method: "get",
|
|
1277
1295
|
description: "Get a meeting",
|
|
1278
1296
|
parameters: {
|
|
1279
|
-
id: { validator: validation_1.
|
|
1297
|
+
id: { validator: validation_1.mongoIdStringRequired },
|
|
1280
1298
|
},
|
|
1281
1299
|
returns: 'meeting',
|
|
1282
1300
|
},
|
|
@@ -1290,7 +1308,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1290
1308
|
publicRead: { validator: validation_1.booleanValidator },
|
|
1291
1309
|
},
|
|
1292
1310
|
returns: {
|
|
1293
|
-
id: { validator: validation_1.
|
|
1311
|
+
id: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1294
1312
|
meeting: { validator: validation_1.meetingInfoValidator, required: true },
|
|
1295
1313
|
host: { validator: validation_1.attendeeValidator, required: true },
|
|
1296
1314
|
},
|
|
@@ -1301,8 +1319,8 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1301
1319
|
path: '/send-meeting-invite',
|
|
1302
1320
|
description: "Sends a meeting invite via email to the given enduser",
|
|
1303
1321
|
parameters: {
|
|
1304
|
-
meetingId: { validator: validation_1.
|
|
1305
|
-
enduserId: { validator: validation_1.
|
|
1322
|
+
meetingId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1323
|
+
enduserId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1306
1324
|
},
|
|
1307
1325
|
returns: {},
|
|
1308
1326
|
},
|
|
@@ -1311,7 +1329,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1311
1329
|
name: "End Meeting",
|
|
1312
1330
|
path: '/end-meeting',
|
|
1313
1331
|
description: "Ends a video meeting",
|
|
1314
|
-
parameters: { id: { validator: validation_1.
|
|
1332
|
+
parameters: { id: { validator: validation_1.mongoIdStringRequired, required: true } },
|
|
1315
1333
|
returns: {},
|
|
1316
1334
|
},
|
|
1317
1335
|
add_attendees_to_meeting: {
|
|
@@ -1320,7 +1338,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1320
1338
|
path: '/add-attendees-to-meeting',
|
|
1321
1339
|
description: "Adds other attendees to a meeting",
|
|
1322
1340
|
parameters: {
|
|
1323
|
-
id: { validator: validation_1.
|
|
1341
|
+
id: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1324
1342
|
attendees: { validator: validation_1.listOfUserIndentitiesValidator, required: true },
|
|
1325
1343
|
},
|
|
1326
1344
|
returns: {},
|
|
@@ -1331,7 +1349,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1331
1349
|
path: '/attendee-info',
|
|
1332
1350
|
description: "Gets meeting info for the current user, and details about other attendees",
|
|
1333
1351
|
parameters: {
|
|
1334
|
-
id: { validator: validation_1.
|
|
1352
|
+
id: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1335
1353
|
},
|
|
1336
1354
|
returns: {
|
|
1337
1355
|
attendee: { validator: validation_1.attendeeValidator, required: true },
|
|
@@ -1352,10 +1370,10 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1352
1370
|
path: '/start-meeting-for-event',
|
|
1353
1371
|
description: "Generates an video meeting room",
|
|
1354
1372
|
parameters: {
|
|
1355
|
-
calendarEventId: { validator: validation_1.
|
|
1373
|
+
calendarEventId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1356
1374
|
},
|
|
1357
1375
|
returns: {
|
|
1358
|
-
id: { validator: validation_1.
|
|
1376
|
+
id: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1359
1377
|
meeting: { validator: validation_1.meetingInfoValidator, required: true },
|
|
1360
1378
|
host: { validator: validation_1.attendeeValidator, required: true },
|
|
1361
1379
|
},
|
|
@@ -1366,10 +1384,10 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1366
1384
|
path: '/join-meeting-for-event',
|
|
1367
1385
|
description: "Generates an video meeting room",
|
|
1368
1386
|
parameters: {
|
|
1369
|
-
calendarEventId: { validator: validation_1.
|
|
1387
|
+
calendarEventId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1370
1388
|
},
|
|
1371
1389
|
returns: {
|
|
1372
|
-
id: { validator: validation_1.
|
|
1390
|
+
id: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1373
1391
|
meeting: { validator: validation_1.meetingInfoValidator, required: true },
|
|
1374
1392
|
attendee: { validator: validation_1.attendeeValidator, required: true },
|
|
1375
1393
|
},
|
|
@@ -1399,7 +1417,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1399
1417
|
customActions: {},
|
|
1400
1418
|
enduserActions: {},
|
|
1401
1419
|
fields: __assign(__assign({}, BuiltInFields), { enduserId: {
|
|
1402
|
-
validator: validation_1.
|
|
1420
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1403
1421
|
required: true,
|
|
1404
1422
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1405
1423
|
dependencies: [{
|
|
@@ -1409,7 +1427,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1409
1427
|
onDependencyDelete: 'delete',
|
|
1410
1428
|
}]
|
|
1411
1429
|
}, ticketId: {
|
|
1412
|
-
validator: validation_1.
|
|
1430
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1413
1431
|
}, text: {
|
|
1414
1432
|
validator: validation_1.stringValidator5000,
|
|
1415
1433
|
examples: ["Text"],
|
|
@@ -1455,7 +1473,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1455
1473
|
customActions: {},
|
|
1456
1474
|
enduserActions: { read: {}, readMany: {} },
|
|
1457
1475
|
fields: __assign(__assign({}, BuiltInFields), { formId: {
|
|
1458
|
-
validator: validation_1.
|
|
1476
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1459
1477
|
required: true,
|
|
1460
1478
|
dependencies: [
|
|
1461
1479
|
{
|
|
@@ -1485,7 +1503,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1485
1503
|
relationship: [],
|
|
1486
1504
|
},
|
|
1487
1505
|
fields: __assign(__assign({}, BuiltInFields), { formId: {
|
|
1488
|
-
validator: validation_1.
|
|
1506
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1489
1507
|
required: true,
|
|
1490
1508
|
dependencies: [
|
|
1491
1509
|
{
|
|
@@ -1497,7 +1515,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1497
1515
|
],
|
|
1498
1516
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1499
1517
|
}, enduserId: {
|
|
1500
|
-
validator: validation_1.
|
|
1518
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1501
1519
|
dependencies: [{
|
|
1502
1520
|
dependsOn: ['endusers'],
|
|
1503
1521
|
dependencyField: '_id',
|
|
@@ -1520,9 +1538,9 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1520
1538
|
name: 'Prepare Form Response',
|
|
1521
1539
|
description: "Generates an access code that allows an enduser to submit a form response.",
|
|
1522
1540
|
parameters: {
|
|
1523
|
-
formId: { validator: validation_1.
|
|
1524
|
-
enduserId: { validator: validation_1.
|
|
1525
|
-
automationStepId: { validator: validation_1.
|
|
1541
|
+
formId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1542
|
+
enduserId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1543
|
+
automationStepId: { validator: validation_1.mongoIdStringRequired },
|
|
1526
1544
|
expireAt: { validator: validation_1.dateValidator },
|
|
1527
1545
|
},
|
|
1528
1546
|
returns: {
|
|
@@ -1539,7 +1557,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1539
1557
|
parameters: {
|
|
1540
1558
|
accessCode: { validator: validation_1.stringValidator250, required: true },
|
|
1541
1559
|
responses: { validator: validation_1.formResponsesValidator, required: true },
|
|
1542
|
-
automationStepId: { validator: validation_1.
|
|
1560
|
+
automationStepId: { validator: validation_1.mongoIdStringRequired },
|
|
1543
1561
|
},
|
|
1544
1562
|
returns: {
|
|
1545
1563
|
formResponse: 'form response',
|
|
@@ -1568,8 +1586,8 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1568
1586
|
description: "Generates a session for filling out a public form.",
|
|
1569
1587
|
parameters: {
|
|
1570
1588
|
email: { validator: validation_1.emailValidator, required: true },
|
|
1571
|
-
formId: { validator: validation_1.
|
|
1572
|
-
businessId: { validator: validation_1.
|
|
1589
|
+
formId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1590
|
+
businessId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1573
1591
|
phone: { validator: validation_1.phoneValidator },
|
|
1574
1592
|
fname: { validator: validation_1.nameValidator },
|
|
1575
1593
|
lname: { validator: validation_1.nameValidator },
|
|
@@ -1644,7 +1662,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1644
1662
|
path: '/send-calendar-event-reminder-webhook',
|
|
1645
1663
|
description: "Sends a webhook with the calendar reminder format, useful for testing integrations",
|
|
1646
1664
|
parameters: {
|
|
1647
|
-
id: { validator: validation_1.
|
|
1665
|
+
id: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1648
1666
|
},
|
|
1649
1667
|
returns: {},
|
|
1650
1668
|
},
|
|
@@ -1677,7 +1695,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1677
1695
|
path: '/events-for-user',
|
|
1678
1696
|
description: "Combines internal and external events, formatted as a Tellescope events",
|
|
1679
1697
|
parameters: {
|
|
1680
|
-
userId: { validator: validation_1.
|
|
1698
|
+
userId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1681
1699
|
from: { validator: validation_1.dateValidator, required: true },
|
|
1682
1700
|
to: { validator: validation_1.dateValidator },
|
|
1683
1701
|
limit: { validator: validation_1.nonNegNumberValidator },
|
|
@@ -1692,14 +1710,14 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1692
1710
|
path: '/calendar-availability',
|
|
1693
1711
|
description: "Gets availability blocks for different users based on their internal and external calendars",
|
|
1694
1712
|
parameters: {
|
|
1695
|
-
calendarEventTemplateId: { validator: validation_1.
|
|
1713
|
+
calendarEventTemplateId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1696
1714
|
from: { validator: validation_1.dateValidator, required: true },
|
|
1697
1715
|
restrictedByState: { validator: validation_1.booleanValidator },
|
|
1698
1716
|
to: { validator: validation_1.dateValidator },
|
|
1699
1717
|
limit: { validator: validation_1.nonNegNumberValidator },
|
|
1700
1718
|
},
|
|
1701
1719
|
returns: {
|
|
1702
|
-
availabilityBlocks: { validator: validation_1.availabilityBlocksValidator }
|
|
1720
|
+
availabilityBlocks: { validator: validation_1.availabilityBlocksValidator, required: true }
|
|
1703
1721
|
},
|
|
1704
1722
|
},
|
|
1705
1723
|
book_appointment: {
|
|
@@ -1708,8 +1726,8 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1708
1726
|
path: '/book-appointment',
|
|
1709
1727
|
description: "Books an appointment with a given user if available",
|
|
1710
1728
|
parameters: {
|
|
1711
|
-
calendarEventTemplateId: { validator: validation_1.
|
|
1712
|
-
userId: { validator: validation_1.
|
|
1729
|
+
calendarEventTemplateId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1730
|
+
userId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1713
1731
|
startTime: { validator: validation_1.dateValidator, required: true },
|
|
1714
1732
|
},
|
|
1715
1733
|
returns: {
|
|
@@ -1730,8 +1748,8 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1730
1748
|
validator: validation_1.nonNegNumberValidator,
|
|
1731
1749
|
examples: [100],
|
|
1732
1750
|
required: true,
|
|
1733
|
-
}, type: { validator: validation_1.stringValidator100 }, description: { validator: validation_1.stringValidator5000 }, meetingId: { validator: validation_1.
|
|
1734
|
-
validator: validation_1.
|
|
1751
|
+
}, type: { validator: validation_1.stringValidator100 }, description: { validator: validation_1.stringValidator5000 }, meetingId: { validator: validation_1.mongoIdStringRequired, readonly: true }, meetingStatus: { validator: validation_1.meetingStatusValidator }, chatRoomId: {
|
|
1752
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1735
1753
|
dependencies: [{
|
|
1736
1754
|
dependsOn: ['chat_rooms'],
|
|
1737
1755
|
dependencyField: '_id',
|
|
@@ -1739,7 +1757,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1739
1757
|
onDependencyDelete: 'setNull',
|
|
1740
1758
|
}]
|
|
1741
1759
|
}, carePlanId: {
|
|
1742
|
-
validator: validation_1.
|
|
1760
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1743
1761
|
dependencies: [{
|
|
1744
1762
|
dependsOn: ['care_plans'],
|
|
1745
1763
|
dependencyField: '_id',
|
|
@@ -1753,7 +1771,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1753
1771
|
validator: validation_1.listOfCalendarEventRemindersValidator,
|
|
1754
1772
|
initializer: function () { return []; },
|
|
1755
1773
|
}, templateId: {
|
|
1756
|
-
validator: validation_1.
|
|
1774
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1757
1775
|
dependencies: [{
|
|
1758
1776
|
dependsOn: ['calendar_event_templates'],
|
|
1759
1777
|
dependencyField: '_id',
|
|
@@ -1797,7 +1815,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1797
1815
|
defaultActions: __assign(__assign({}, constants_1.DEFAULT_OPERATIONS), { update: { creatorOnly: true }, delete: { creatorOnly: true } }),
|
|
1798
1816
|
enduserActions: { create: {}, read: {}, readMany: {}, update: {}, delete: {} },
|
|
1799
1817
|
fields: __assign(__assign({}, BuiltInFields), { eventId: {
|
|
1800
|
-
validator: validation_1.
|
|
1818
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1801
1819
|
required: true,
|
|
1802
1820
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1803
1821
|
dependencies: [{
|
|
@@ -1834,7 +1852,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1834
1852
|
customActions: {},
|
|
1835
1853
|
enduserActions: {},
|
|
1836
1854
|
fields: __assign(__assign({}, BuiltInFields), { journeyId: {
|
|
1837
|
-
validator: validation_1.
|
|
1855
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1838
1856
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1839
1857
|
required: true,
|
|
1840
1858
|
dependencies: [{
|
|
@@ -1880,7 +1898,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1880
1898
|
fields: __assign(__assign({}, BuiltInFields), { cancelConditions: {
|
|
1881
1899
|
validator: validation_1.cancelConditionsValidator,
|
|
1882
1900
|
}, automationStepId: {
|
|
1883
|
-
validator: validation_1.
|
|
1901
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1884
1902
|
required: true,
|
|
1885
1903
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1886
1904
|
dependencies: [{
|
|
@@ -1890,7 +1908,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1890
1908
|
onDependencyDelete: 'nop', // worth keeping as a log of some automated action, even if the automation itself is no longer active
|
|
1891
1909
|
}]
|
|
1892
1910
|
}, enduserId: {
|
|
1893
|
-
validator: validation_1.
|
|
1911
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1894
1912
|
required: true,
|
|
1895
1913
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1896
1914
|
dependencies: [{
|
|
@@ -1900,7 +1918,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1900
1918
|
onDependencyDelete: 'delete',
|
|
1901
1919
|
}]
|
|
1902
1920
|
}, journeyId: {
|
|
1903
|
-
validator: validation_1.
|
|
1921
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1904
1922
|
required: true,
|
|
1905
1923
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1906
1924
|
dependencies: [{
|
|
@@ -1947,7 +1965,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1947
1965
|
customActions: {},
|
|
1948
1966
|
enduserActions: {},
|
|
1949
1967
|
fields: __assign(__assign({}, BuiltInFields), { userId: {
|
|
1950
|
-
validator: validation_1.
|
|
1968
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1951
1969
|
required: true,
|
|
1952
1970
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1953
1971
|
// dependencies: [{
|
|
@@ -1961,7 +1979,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1961
1979
|
required: true,
|
|
1962
1980
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1963
1981
|
}, resourceId: {
|
|
1964
|
-
validator: validation_1.
|
|
1982
|
+
validator: validation_1.mongoIdStringRequired,
|
|
1965
1983
|
required: true,
|
|
1966
1984
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
1967
1985
|
}, action: {
|
|
@@ -1987,7 +2005,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1987
2005
|
path: '/send-user-email-notification',
|
|
1988
2006
|
description: "Sends an email notification to a team member (user)",
|
|
1989
2007
|
parameters: {
|
|
1990
|
-
userId: { validator: validation_1.
|
|
2008
|
+
userId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
1991
2009
|
message: { validator: validation_1.stringValidator5000, required: true },
|
|
1992
2010
|
subject: { validator: validation_1.stringValidator250 },
|
|
1993
2011
|
},
|
|
@@ -1996,7 +2014,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
1996
2014
|
},
|
|
1997
2015
|
enduserActions: {},
|
|
1998
2016
|
fields: __assign(__assign({}, BuiltInFields), { userId: {
|
|
1999
|
-
validator: validation_1.
|
|
2017
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2000
2018
|
required: true,
|
|
2001
2019
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2002
2020
|
dependencies: [{
|
|
@@ -2033,7 +2051,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2033
2051
|
}],
|
|
2034
2052
|
}, enduserId: {
|
|
2035
2053
|
required: true,
|
|
2036
|
-
validator: validation_1.
|
|
2054
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2037
2055
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2038
2056
|
dependencies: [{
|
|
2039
2057
|
dependsOn: ['endusers'],
|
|
@@ -2107,7 +2125,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2107
2125
|
customActions: {},
|
|
2108
2126
|
enduserActions: { create: {}, read: {}, readMany: {}, update: { creatorOnly: true }, delete: { creatorOnly: true } },
|
|
2109
2127
|
fields: __assign(__assign({}, BuiltInFields), { forumId: {
|
|
2110
|
-
validator: validation_1.
|
|
2128
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2111
2129
|
required: true,
|
|
2112
2130
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2113
2131
|
dependencies: [{
|
|
@@ -2159,7 +2177,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2159
2177
|
customActions: {},
|
|
2160
2178
|
enduserActions: { create: {}, read: {}, readMany: {}, delete: { creatorOnly: true } },
|
|
2161
2179
|
fields: __assign(__assign({}, BuiltInFields), { forumId: {
|
|
2162
|
-
validator: validation_1.
|
|
2180
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2163
2181
|
required: true,
|
|
2164
2182
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2165
2183
|
dependencies: [{
|
|
@@ -2169,7 +2187,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2169
2187
|
onDependencyDelete: 'delete',
|
|
2170
2188
|
}]
|
|
2171
2189
|
}, postId: {
|
|
2172
|
-
validator: validation_1.
|
|
2190
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2173
2191
|
required: true,
|
|
2174
2192
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2175
2193
|
dependencies: [{
|
|
@@ -2179,7 +2197,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2179
2197
|
onDependencyDelete: 'delete',
|
|
2180
2198
|
}]
|
|
2181
2199
|
}, threadId: {
|
|
2182
|
-
validator: validation_1.
|
|
2200
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2183
2201
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2184
2202
|
initializer: function (s) { var _a; return (_a = s.replyTo) !== null && _a !== void 0 ? _a : ''; },
|
|
2185
2203
|
dependencies: [{
|
|
@@ -2189,7 +2207,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2189
2207
|
onDependencyDelete: 'nop',
|
|
2190
2208
|
}]
|
|
2191
2209
|
}, replyTo: {
|
|
2192
|
-
validator: validation_1.
|
|
2210
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2193
2211
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2194
2212
|
dependencies: [{
|
|
2195
2213
|
dependsOn: ['post_comments'],
|
|
@@ -2228,8 +2246,8 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2228
2246
|
path: '/post-like',
|
|
2229
2247
|
description: "Likes a post",
|
|
2230
2248
|
parameters: {
|
|
2231
|
-
postId: { validator: validation_1.
|
|
2232
|
-
forumId: { validator: validation_1.
|
|
2249
|
+
postId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
2250
|
+
forumId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
2233
2251
|
},
|
|
2234
2252
|
returns: {} //authToken: { validator: stringValidator5000 } },
|
|
2235
2253
|
},
|
|
@@ -2239,8 +2257,8 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2239
2257
|
path: '/unlike-forum-post',
|
|
2240
2258
|
description: "Removes a like for a given forum post",
|
|
2241
2259
|
parameters: {
|
|
2242
|
-
postId: { validator: validation_1.
|
|
2243
|
-
forumId: { validator: validation_1.
|
|
2260
|
+
postId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
2261
|
+
forumId: { validator: validation_1.mongoIdStringRequired, required: true },
|
|
2244
2262
|
},
|
|
2245
2263
|
returns: {} //authToken: { validator: stringValidator5000 } },
|
|
2246
2264
|
},
|
|
@@ -2263,7 +2281,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2263
2281
|
// ],
|
|
2264
2282
|
// },
|
|
2265
2283
|
forumId: {
|
|
2266
|
-
validator: validation_1.
|
|
2284
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2267
2285
|
required: true,
|
|
2268
2286
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2269
2287
|
dependencies: [{
|
|
@@ -2273,7 +2291,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2273
2291
|
onDependencyDelete: 'delete',
|
|
2274
2292
|
}]
|
|
2275
2293
|
}, postId: {
|
|
2276
|
-
validator: validation_1.
|
|
2294
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2277
2295
|
required: true,
|
|
2278
2296
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2279
2297
|
dependencies: [{
|
|
@@ -2297,7 +2315,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2297
2315
|
defaultActions: { create: {}, read: {}, readMany: {}, delete: { creatorOnly: true } },
|
|
2298
2316
|
enduserActions: { create: {}, read: {}, readMany: {}, delete: {} },
|
|
2299
2317
|
fields: __assign(__assign({}, BuiltInFields), { forumId: {
|
|
2300
|
-
validator: validation_1.
|
|
2318
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2301
2319
|
required: true,
|
|
2302
2320
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2303
2321
|
dependencies: [{
|
|
@@ -2307,7 +2325,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2307
2325
|
onDependencyDelete: 'delete',
|
|
2308
2326
|
}]
|
|
2309
2327
|
}, postId: {
|
|
2310
|
-
validator: validation_1.
|
|
2328
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2311
2329
|
required: true,
|
|
2312
2330
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2313
2331
|
dependencies: [{
|
|
@@ -2317,7 +2335,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2317
2335
|
onDependencyDelete: 'delete',
|
|
2318
2336
|
}]
|
|
2319
2337
|
}, commentId: {
|
|
2320
|
-
validator: validation_1.
|
|
2338
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2321
2339
|
required: true,
|
|
2322
2340
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2323
2341
|
dependencies: [{
|
|
@@ -2344,7 +2362,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2344
2362
|
path: '/organization-theme',
|
|
2345
2363
|
description: "Gets theme information for an organization",
|
|
2346
2364
|
parameters: {
|
|
2347
|
-
businessId: { validator: validation_1.
|
|
2365
|
+
businessId: { validator: validation_1.mongoIdStringRequired },
|
|
2348
2366
|
},
|
|
2349
2367
|
returns: {
|
|
2350
2368
|
theme: { validator: validation_1.organizationThemeValidator, required: true },
|
|
@@ -2359,7 +2377,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2359
2377
|
validator: validation_1.stringValidator100,
|
|
2360
2378
|
required: true,
|
|
2361
2379
|
examples: ["subdomain"],
|
|
2362
|
-
}, subscriptionExpiresAt: { validator: validation_1.dateValidator }, subscriptionPeriod: { validator: validation_1.numberValidator }, logoVersion: { validator: validation_1.numberValidator }, faviconVersion: { validator: validation_1.numberValidator }, roles: { validator: validation_1.
|
|
2380
|
+
}, subscriptionExpiresAt: { validator: validation_1.dateValidator }, subscriptionPeriod: { validator: validation_1.numberValidator }, logoVersion: { validator: validation_1.numberValidator }, faviconVersion: { validator: validation_1.numberValidator }, roles: { validator: validation_1.listOfStringsValidatorEmptyOk }, skills: { validator: validation_1.listOfStringsValidator }, themeColor: { validator: validation_1.stringValidator100 }, customPortalURL: { validator: validation_1.stringValidator250 }, portalSettings: { validator: validation_1.portalSettingsValidator } }),
|
|
2363
2381
|
},
|
|
2364
2382
|
databases: {
|
|
2365
2383
|
info: {},
|
|
@@ -2394,7 +2412,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2394
2412
|
customActions: {},
|
|
2395
2413
|
enduserActions: {},
|
|
2396
2414
|
fields: __assign(__assign({}, BuiltInFields), { databaseId: {
|
|
2397
|
-
validator: validation_1.
|
|
2415
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2398
2416
|
required: true,
|
|
2399
2417
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2400
2418
|
dependencies: [{
|
|
@@ -2459,7 +2477,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2459
2477
|
required: true,
|
|
2460
2478
|
examples: ['Example Title']
|
|
2461
2479
|
}, enduserId: {
|
|
2462
|
-
validator: validation_1.
|
|
2480
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2463
2481
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2464
2482
|
required: true,
|
|
2465
2483
|
dependencies: [{
|
|
@@ -2487,7 +2505,7 @@ exports.schema = (0, exports.build_schema)({
|
|
|
2487
2505
|
required: true,
|
|
2488
2506
|
examples: ['Example Title']
|
|
2489
2507
|
}, enduserId: {
|
|
2490
|
-
validator: validation_1.
|
|
2508
|
+
validator: validation_1.mongoIdStringRequired,
|
|
2491
2509
|
examples: [constants_1.PLACEHOLDER_ID],
|
|
2492
2510
|
required: true,
|
|
2493
2511
|
dependencies: [{
|