@tellescope/sdk 1.247.0 → 1.248.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/sdk.d.ts +6 -1
- package/lib/cjs/sdk.d.ts.map +1 -1
- package/lib/cjs/sdk.js +2 -0
- package/lib/cjs/sdk.js.map +1 -1
- package/lib/cjs/tests/api_tests/date_string_validation.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/date_string_validation.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/date_string_validation.test.js +142 -0
- package/lib/cjs/tests/api_tests/date_string_validation.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/enduser_session_invalidation.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/enduser_session_invalidation.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/enduser_session_invalidation.test.js +243 -0
- package/lib/cjs/tests/api_tests/enduser_session_invalidation.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/field_redaction.test.d.ts +13 -0
- package/lib/cjs/tests/api_tests/field_redaction.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/field_redaction.test.js +818 -0
- package/lib/cjs/tests/api_tests/field_redaction.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/form_submitted_trigger.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/form_submitted_trigger.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/form_submitted_trigger.test.js +429 -0
- package/lib/cjs/tests/api_tests/form_submitted_trigger.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/integrations_redacted.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/integrations_redacted.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/integrations_redacted.test.js +273 -0
- package/lib/cjs/tests/api_tests/integrations_redacted.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/openloop_webhooks.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/openloop_webhooks.test.js +108 -24
- package/lib/cjs/tests/api_tests/openloop_webhooks.test.js.map +1 -1
- package/lib/cjs/tests/tests.d.ts.map +1 -1
- package/lib/cjs/tests/tests.js +294 -183
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/esm/sdk.d.ts +6 -1
- package/lib/esm/sdk.d.ts.map +1 -1
- package/lib/esm/sdk.js +2 -0
- package/lib/esm/sdk.js.map +1 -1
- package/lib/esm/tests/api_tests/date_string_validation.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/date_string_validation.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/date_string_validation.test.js +138 -0
- package/lib/esm/tests/api_tests/date_string_validation.test.js.map +1 -0
- package/lib/esm/tests/api_tests/enduser_session_invalidation.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/enduser_session_invalidation.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/enduser_session_invalidation.test.js +239 -0
- package/lib/esm/tests/api_tests/enduser_session_invalidation.test.js.map +1 -0
- package/lib/esm/tests/api_tests/field_redaction.test.d.ts +13 -0
- package/lib/esm/tests/api_tests/field_redaction.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/field_redaction.test.js +814 -0
- package/lib/esm/tests/api_tests/field_redaction.test.js.map +1 -0
- package/lib/esm/tests/api_tests/form_submitted_trigger.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/form_submitted_trigger.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/form_submitted_trigger.test.js +425 -0
- package/lib/esm/tests/api_tests/form_submitted_trigger.test.js.map +1 -0
- package/lib/esm/tests/api_tests/integrations_redacted.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/integrations_redacted.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/integrations_redacted.test.js +269 -0
- package/lib/esm/tests/api_tests/integrations_redacted.test.js.map +1 -0
- package/lib/esm/tests/api_tests/openloop_webhooks.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/openloop_webhooks.test.js +108 -24
- package/lib/esm/tests/api_tests/openloop_webhooks.test.js.map +1 -1
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +294 -183
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/sdk.ts +10 -0
- package/src/tests/api_tests/date_string_validation.test.ts +107 -0
- package/src/tests/api_tests/enduser_session_invalidation.test.ts +138 -0
- package/src/tests/api_tests/field_redaction.test.ts +669 -0
- package/src/tests/api_tests/form_started_trigger.test.ts +1 -1
- package/src/tests/api_tests/form_submitted_trigger.test.ts +281 -0
- package/src/tests/api_tests/integrations_redacted.test.ts +245 -0
- package/src/tests/api_tests/openloop_webhooks.test.ts +64 -0
- package/src/tests/tests.ts +86 -6
- package/test_generated.pdf +0 -0
package/src/tests/tests.ts
CHANGED
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
|
|
37
37
|
import { Session, APIQuery, EnduserSession } from "../sdk"
|
|
38
38
|
import { enduser_observations_acknowledge_tests } from "./api_tests/enduser_observations_acknowledge.test"
|
|
39
|
+
import { integrations_redacted_tests } from "./api_tests/integrations_redacted.test"
|
|
39
40
|
import { get_some_projection_tests } from "./api_tests/get_some_projection.test"
|
|
40
41
|
import { mdb_sort_tests } from "./api_tests/mdb_sort.test"
|
|
41
42
|
import { create_user_notifications_trigger_tests } from "./api_tests/create_user_notifications_trigger.test"
|
|
@@ -80,6 +81,7 @@ import { monthly_availability_restrictions_tests } from "./api_tests/monthly_ava
|
|
|
80
81
|
import { calendar_event_limits_tests } from "./api_tests/calendar_event_limits.test";
|
|
81
82
|
import { custom_aggregation_tests } from "./api_tests/custom_aggregation.test";
|
|
82
83
|
import { no_access_permission_checks_tests } from "./api_tests/no_access_permission_checks.test";
|
|
84
|
+
import { field_redaction_tests } from "./api_tests/field_redaction.test";
|
|
83
85
|
import { bulk_assignment_tests } from "./api_tests/bulk_assignment.test";
|
|
84
86
|
import { managed_content_enduser_access_tests } from "./api_tests/managed_content_enduser_access.test";
|
|
85
87
|
import { auto_merge_form_submission_tests } from "./api_tests/auto_merge_form_submission.test";
|
|
@@ -87,12 +89,15 @@ import { database_cascade_delete_tests } from "./api_tests/database_cascade_dele
|
|
|
87
89
|
import { ai_conversations_tests } from "./api_tests/ai_conversations.test";
|
|
88
90
|
import { load_team_chat_tests } from "./api_tests/load_team_chat.test";
|
|
89
91
|
import { form_started_trigger_tests } from "./api_tests/form_started_trigger.test";
|
|
92
|
+
import { form_submitted_trigger_tests } from "./api_tests/form_submitted_trigger.test";
|
|
90
93
|
import { medication_added_trigger_tests } from "./api_tests/medication_added_trigger.test";
|
|
91
94
|
import { elation_user_id_tests } from "./api_tests/elation_user_id.test";
|
|
92
95
|
import { organization_settings_duplicates_tests } from "./api_tests/organization_settings_duplicates.test";
|
|
93
96
|
import { calendar_events_bulk_update_tests } from "./api_tests/calendar_events_bulk_update.test";
|
|
94
97
|
import { openloop_webhooks_tests } from "./api_tests/openloop_webhooks.test";
|
|
95
98
|
import { beluga_pharmacy_mappings_tests } from "./api_tests/beluga_pharmacy_mappings.test";
|
|
99
|
+
import { date_string_validation_tests } from "./api_tests/date_string_validation.test";
|
|
100
|
+
import { enduser_session_invalidation_tests } from "./api_tests/enduser_session_invalidation.test";
|
|
96
101
|
|
|
97
102
|
const UniquenessViolationMessage = 'Uniqueness Violation'
|
|
98
103
|
|
|
@@ -3429,6 +3434,12 @@ const order_status_equals_tests = async () => {
|
|
|
3429
3434
|
status: 'Active',
|
|
3430
3435
|
title: "Title Partial And Condition"
|
|
3431
3436
|
})
|
|
3437
|
+
const t9 = await sdk.api.automation_triggers.createOne({
|
|
3438
|
+
event: { type: 'Order Status Equals', info: { source: 'Source', status: "Update", protocols: ['Protocol-A'] } },
|
|
3439
|
+
action: { type: 'Add Tags', info: { tags: ['Protocol Match'] }},
|
|
3440
|
+
status: 'Active',
|
|
3441
|
+
title: "Protocol Condition"
|
|
3442
|
+
})
|
|
3432
3443
|
|
|
3433
3444
|
const e = await sdk.api.endusers.createOne({})
|
|
3434
3445
|
|
|
@@ -3610,6 +3621,38 @@ const order_status_equals_tests = async () => {
|
|
|
3610
3621
|
) }
|
|
3611
3622
|
)
|
|
3612
3623
|
|
|
3624
|
+
await sdk.api.enduser_orders.updateOne(u.id, { status: 'Toggle', externalId: "also avoid rate limit 7" })
|
|
3625
|
+
await sdk.api.enduser_orders.updateOne(u.id, { status: "Update", protocol: 'Protocol-Mismatch', externalId: 'avoid rate limiting 7' })
|
|
3626
|
+
await wait(undefined, 500) // allow triggers to happen
|
|
3627
|
+
await async_test(
|
|
3628
|
+
"Protocol no match (wrong protocol)",
|
|
3629
|
+
() => sdk.api.endusers.getOne(e.id),
|
|
3630
|
+
{ onResult: e => !!(
|
|
3631
|
+
e.tags?.length === 8
|
|
3632
|
+
&& !e.tags?.includes('Protocol Match')
|
|
3633
|
+
) }
|
|
3634
|
+
)
|
|
3635
|
+
|
|
3636
|
+
await sdk.api.enduser_orders.updateOne(u.id, { status: 'Toggle', externalId: "also avoid rate limit 8" })
|
|
3637
|
+
await sdk.api.enduser_orders.updateOne(u.id, { status: "Update", protocol: 'Protocol-A', externalId: 'avoid rate limiting 8' })
|
|
3638
|
+
await wait(undefined, 500) // allow triggers to happen
|
|
3639
|
+
await async_test(
|
|
3640
|
+
"Protocol match tag added",
|
|
3641
|
+
() => sdk.api.endusers.getOne(e.id),
|
|
3642
|
+
{ onResult: e => !!(
|
|
3643
|
+
e.tags?.length === 9
|
|
3644
|
+
&& e.tags?.includes('Source')
|
|
3645
|
+
&& e.tags?.includes('Fill')
|
|
3646
|
+
&& e.tags?.includes('Status Update')
|
|
3647
|
+
&& e.tags?.includes('Fill Update')
|
|
3648
|
+
&& e.tags?.includes('SKU Update')
|
|
3649
|
+
&& e.tags?.includes('SKU Partial Update')
|
|
3650
|
+
&& e.tags?.includes('Title Partial Update')
|
|
3651
|
+
&& e.tags?.includes('Title Partial And Update')
|
|
3652
|
+
&& e.tags?.includes('Protocol Match')
|
|
3653
|
+
) }
|
|
3654
|
+
)
|
|
3655
|
+
|
|
3613
3656
|
await Promise.all([
|
|
3614
3657
|
sdk.api.automation_triggers.deleteOne(t1.id),
|
|
3615
3658
|
sdk.api.automation_triggers.deleteOne(t2.id),
|
|
@@ -3619,6 +3662,7 @@ const order_status_equals_tests = async () => {
|
|
|
3619
3662
|
sdk.api.automation_triggers.deleteOne(t6.id),
|
|
3620
3663
|
sdk.api.automation_triggers.deleteOne(t7.id),
|
|
3621
3664
|
sdk.api.automation_triggers.deleteOne(t8.id),
|
|
3665
|
+
sdk.api.automation_triggers.deleteOne(t9.id),
|
|
3622
3666
|
sdk.api.endusers.deleteOne(e.id),
|
|
3623
3667
|
])
|
|
3624
3668
|
}
|
|
@@ -5016,8 +5060,8 @@ const trigger_events_api_tests = async () => {
|
|
|
5016
5060
|
const automation_trigger_tests = async () => {
|
|
5017
5061
|
log_header("Automation Trigger Tests")
|
|
5018
5062
|
|
|
5019
|
-
await medication_added_trigger_tests({ sdk, sdkNonAdmin })
|
|
5020
5063
|
await order_status_equals_tests()
|
|
5064
|
+
await medication_added_trigger_tests({ sdk, sdkNonAdmin })
|
|
5021
5065
|
await appointment_cancelled_tests()
|
|
5022
5066
|
await set_fields_tests()
|
|
5023
5067
|
await purchase_made_trigger_tests({ sdk, sdkNonAdmin })
|
|
@@ -8588,7 +8632,7 @@ export const formsort_tests = async () => {
|
|
|
8588
8632
|
const form = await sdk.api.forms.createOne({ title: "FormSort" })
|
|
8589
8633
|
|
|
8590
8634
|
const postToFormsort = async ({ matchByName=false, createNewEnduser=false, enduserId, returnJSON=false, ...o }: {
|
|
8591
|
-
answers: { key: string, value: any }[],
|
|
8635
|
+
answers: { key: string, value: any, label?: string }[],
|
|
8592
8636
|
responder_uuid: string,
|
|
8593
8637
|
finalized: boolean,
|
|
8594
8638
|
matchByName?: boolean,
|
|
@@ -8605,8 +8649,8 @@ export const formsort_tests = async () => {
|
|
|
8605
8649
|
return await axios.post(url.toString(), o)
|
|
8606
8650
|
}
|
|
8607
8651
|
|
|
8608
|
-
const postToFormsortGeneric = async ({ matchByName=false, createNewEnduser=false, ...o }: {
|
|
8609
|
-
answers: { key: string, value: any }[],
|
|
8652
|
+
const postToFormsortGeneric = async ({ matchByName=false, createNewEnduser=false, ...o }: {
|
|
8653
|
+
answers: { key: string, value: any, label?: string }[],
|
|
8610
8654
|
responder_uuid: string,
|
|
8611
8655
|
finalized: boolean,
|
|
8612
8656
|
matchByName?: boolean,
|
|
@@ -8985,6 +9029,37 @@ export const formsort_tests = async () => {
|
|
|
8985
9029
|
onResult: r => r?.fname === 'ChangedFirst' && r?.lname === 'ChangedLast'
|
|
8986
9030
|
})
|
|
8987
9031
|
|
|
9032
|
+
// Test label as fieldTitle
|
|
9033
|
+
const validateFieldTitle = (fr: { responses?: { externalId?: string, fieldTitle?: string }[] }, key: string, expectedTitle: string): boolean => {
|
|
9034
|
+
return fr.responses?.find(r => r.externalId === key)?.fieldTitle === expectedTitle
|
|
9035
|
+
}
|
|
9036
|
+
|
|
9037
|
+
// Label provided: fieldTitle should use label, externalId should use key
|
|
9038
|
+
await postToFormsort({
|
|
9039
|
+
answers: [
|
|
9040
|
+
{ key: 'email', value: 'label-test@tellescope.com' },
|
|
9041
|
+
{ key: 'label_test_key', value: 'test_value', label: 'My Custom Label' },
|
|
9042
|
+
],
|
|
9043
|
+
responder_uuid: "label-test",
|
|
9044
|
+
finalized: true,
|
|
9045
|
+
})
|
|
9046
|
+
await async_test(`label as fieldTitle`, () => sdk.api.form_responses.getOne({ externalId: 'label-test' }), {
|
|
9047
|
+
onResult: r => validateFieldTitle(r, 'label_test_key', 'My Custom Label')
|
|
9048
|
+
})
|
|
9049
|
+
|
|
9050
|
+
// No label: fieldTitle should fall back to key
|
|
9051
|
+
await postToFormsort({
|
|
9052
|
+
answers: [
|
|
9053
|
+
{ key: 'email', value: 'no-label-test@tellescope.com' },
|
|
9054
|
+
{ key: 'no_label_key', value: 'test_value' },
|
|
9055
|
+
],
|
|
9056
|
+
responder_uuid: "no-label-test",
|
|
9057
|
+
finalized: true,
|
|
9058
|
+
})
|
|
9059
|
+
await async_test(`no label falls back to key as fieldTitle`, () => sdk.api.form_responses.getOne({ externalId: 'no-label-test' }), {
|
|
9060
|
+
onResult: r => validateFieldTitle(r, 'no_label_key', 'no_label_key')
|
|
9061
|
+
})
|
|
9062
|
+
|
|
8988
9063
|
// cleanup
|
|
8989
9064
|
const endusers = await sdk.api.endusers.getSome()
|
|
8990
9065
|
await Promise.all([
|
|
@@ -14126,6 +14201,12 @@ const ip_address_form_tests = async () => {
|
|
|
14126
14201
|
await replace_enduser_template_values_tests()
|
|
14127
14202
|
await mfa_tests()
|
|
14128
14203
|
await setup_tests(sdk, sdkNonAdmin)
|
|
14204
|
+
await field_redaction_tests({ sdk, sdkNonAdmin })
|
|
14205
|
+
await form_submitted_trigger_tests({ sdk, sdkNonAdmin })
|
|
14206
|
+
await date_string_validation_tests({ sdk, sdkNonAdmin })
|
|
14207
|
+
await openloop_webhooks_tests({ sdk, sdkNonAdmin })
|
|
14208
|
+
await automation_trigger_tests()
|
|
14209
|
+
await integrations_redacted_tests({ sdk, sdkNonAdmin })
|
|
14129
14210
|
await mdb_sort_tests({ sdk, sdkNonAdmin })
|
|
14130
14211
|
await organization_settings_duplicates_tests({ sdk, sdkNonAdmin })
|
|
14131
14212
|
await search_tests()
|
|
@@ -14136,8 +14217,6 @@ const ip_address_form_tests = async () => {
|
|
|
14136
14217
|
await time_tracks_lock_tests({ sdk, sdkNonAdmin })
|
|
14137
14218
|
await time_tracks_edge_case_tests({ sdk, sdkNonAdmin })
|
|
14138
14219
|
await calendar_event_limits_tests({ sdk, sdkNonAdmin })
|
|
14139
|
-
await openloop_webhooks_tests({ sdk, sdkNonAdmin })
|
|
14140
|
-
await automation_trigger_tests()
|
|
14141
14220
|
await get_some_projection_tests({ sdk, sdkNonAdmin })
|
|
14142
14221
|
await elation_user_id_tests({ sdk, sdkNonAdmin })
|
|
14143
14222
|
await custom_dashboards_tests({ sdk, sdkNonAdmin })
|
|
@@ -14168,6 +14247,7 @@ const ip_address_form_tests = async () => {
|
|
|
14168
14247
|
await inbox_threads_loading_tests()
|
|
14169
14248
|
await load_inbox_data_tests({ sdk, sdkNonAdmin })
|
|
14170
14249
|
await enduser_observations_acknowledge_tests({ sdk, sdkNonAdmin })
|
|
14250
|
+
await enduser_session_invalidation_tests({ sdk, sdkNonAdmin })
|
|
14171
14251
|
await create_user_notifications_trigger_tests({ sdk })
|
|
14172
14252
|
await group_mms_active_tests()
|
|
14173
14253
|
await auto_reply_tests()
|
package/test_generated.pdf
CHANGED
|
Binary file
|