@twentyhq/teams 1.1.2 → 1.2.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/dependencies/yarn.lock +723 -3
- package/manifest.json +46 -29
- package/package.json +4 -2
- package/src/features/chat/logic-functions/teams-activities-enqueue.mjs +378 -162
- package/src/features/chat/logic-functions/teams-activities-enqueue.mjs.map +4 -4
- package/src/features/chat/logic-functions/teams-activities-enqueue.ts +1 -1
- package/src/features/chat/logic-functions/teams-activities-resolver.mjs +500 -40
- package/src/features/chat/logic-functions/teams-activities-resolver.mjs.map +4 -4
- package/src/features/chat/logic-functions/teams-activities-resolver.ts +13 -2
- package/src/features/chat/logic-functions/teams-list-unlinked-users.mjs +95 -61
- package/src/features/chat/logic-functions/teams-list-unlinked-users.mjs.map +4 -4
- package/src/features/chat/logic-functions/teams-match-user-links.mjs +105 -86
- package/src/features/chat/logic-functions/teams-match-user-links.mjs.map +4 -4
- package/src/features/chat/logic-functions/teams-register-connection.mjs +119 -101
- package/src/features/chat/logic-functions/teams-register-connection.mjs.map +4 -4
- package/src/features/chat/logic-functions/teams-register-connection.ts +1 -1
- package/src/features/chat/logic-functions/teams-search-users.mjs +96 -62
- package/src/features/chat/logic-functions/teams-search-users.mjs.map +4 -4
- package/src/features/chat/logic-functions/teams-set-user-link.mjs +88 -54
- package/src/features/chat/logic-functions/teams-set-user-link.mjs.map +4 -4
- package/src/features/chat/logic-functions/teams-tenant-release.mjs +72 -41
- package/src/features/chat/logic-functions/teams-tenant-release.mjs.map +4 -4
- package/src/features/transcripts/logic-functions/teams-count-transcript-history.mjs +99 -68
- package/src/features/transcripts/logic-functions/teams-count-transcript-history.mjs.map +4 -4
- package/src/features/transcripts/logic-functions/teams-import-transcript-history.mjs +99 -68
- package/src/features/transcripts/logic-functions/teams-import-transcript-history.mjs.map +4 -4
- package/src/features/transcripts/logic-functions/teams-import-transcript.mjs +96 -65
- package/src/features/transcripts/logic-functions/teams-import-transcript.mjs.map +4 -4
- package/src/features/transcripts/logic-functions/teams-list-organizer-transcripts.mjs +89 -58
- package/src/features/transcripts/logic-functions/teams-list-organizer-transcripts.mjs.map +4 -4
- package/src/features/transcripts/logic-functions/teams-sync-transcript.mjs +96 -65
- package/src/features/transcripts/logic-functions/teams-sync-transcript.mjs.map +4 -4
- package/src/features/transcripts/logic-functions/teams-transcript-history-count.mjs +0 -1
- package/src/features/transcripts/logic-functions/teams-transcript-history-count.mjs.map +2 -2
- package/src/features/transcripts/logic-functions/teams-transcript-history-import.mjs +0 -1
- package/src/features/transcripts/logic-functions/teams-transcript-history-import.mjs.map +2 -2
- package/src/features/transcripts/logic-functions/teams-transcript-history-status.mjs +0 -1
- package/src/features/transcripts/logic-functions/teams-transcript-history-status.mjs.map +2 -2
- package/src/features/transcripts/logic-functions/teams-transcripts-webhook.mjs +104 -73
- package/src/features/transcripts/logic-functions/teams-transcripts-webhook.mjs.map +4 -4
- package/src/features/transcripts/logic-functions/teams-uninstall.mjs +72 -41
- package/src/features/transcripts/logic-functions/teams-uninstall.mjs.map +4 -4
- package/src/front-components/settings.front-component.mjs +113 -113
- package/src/front-components/settings.front-component.mjs.map +4 -4
- package/src/logic-functions/teams-health-check.mjs +46 -25
- package/src/logic-functions/teams-health-check.mjs.map +4 -4
- package/src/logic-functions/teams-health-check.ts +21 -6
- package/src/logic-functions/teams-post-install.mjs +1270 -0
- package/src/logic-functions/teams-post-install.mjs.map +7 -0
- package/src/logic-functions/teams-post-install.ts +15 -0
|
@@ -124,10 +124,10 @@ var require_convenience = __commonJS({
|
|
|
124
124
|
return structural_1.isArray(term) && term.length > 0;
|
|
125
125
|
};
|
|
126
126
|
exports.isNonEmptyArray = isNonEmptyArray2;
|
|
127
|
-
var
|
|
127
|
+
var isNonEmptyString13 = (term) => {
|
|
128
128
|
return primitives_1.isString(term) && term.length > 0;
|
|
129
129
|
};
|
|
130
|
-
exports.isNonEmptyString =
|
|
130
|
+
exports.isNonEmptyString = isNonEmptyString13;
|
|
131
131
|
var isNumberOrNaN = (term) => {
|
|
132
132
|
return typeof term === "number";
|
|
133
133
|
};
|
|
@@ -193,7 +193,7 @@ var require_build = __commonJS({
|
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
// src/features/transcripts/logic-functions/teams-import-transcript.ts
|
|
196
|
-
var
|
|
196
|
+
var import_guards14 = __toESM(require_build());
|
|
197
197
|
|
|
198
198
|
// twenty-sdk-define-stub:__twenty-sdk-define-stub__
|
|
199
199
|
var __defineFactoryStub = (config) => ({
|
|
@@ -520,7 +520,7 @@ var GRAPH_SPEAKER_ATTRIBUTION_NOT_ALLOWED_ERROR_CODE = "SpeakerAttributionNotAll
|
|
|
520
520
|
var GRAPH_UNATTRIBUTED_TRANSCRIPT_FORMAT = "application/vnd.microsoft.graph.transcript+text";
|
|
521
521
|
|
|
522
522
|
// src/features/transcripts/logic-functions/utils/fetch-graph-response.ts
|
|
523
|
-
var
|
|
523
|
+
var import_guards5 = __toESM(require_build());
|
|
524
524
|
|
|
525
525
|
// src/features/transcripts/logic-functions/constants/graph-request-max-attempts.ts
|
|
526
526
|
var GRAPH_REQUEST_MAX_ATTEMPTS = 4;
|
|
@@ -543,62 +543,93 @@ var resolveGraphUrlOrThrow = (url) => {
|
|
|
543
543
|
return resolvedUrl.toString();
|
|
544
544
|
};
|
|
545
545
|
|
|
546
|
-
// src/
|
|
546
|
+
// src/utils/parse-retry-after-ms.ts
|
|
547
|
+
var import_guards4 = __toESM(require_build());
|
|
548
|
+
var parseRetryAfterMs = (retryAfter) => {
|
|
549
|
+
if (!(0, import_guards4.isNonEmptyString)(retryAfter)) {
|
|
550
|
+
return void 0;
|
|
551
|
+
}
|
|
552
|
+
const retryAfterSeconds = Number(retryAfter);
|
|
553
|
+
if (Number.isFinite(retryAfterSeconds)) {
|
|
554
|
+
return Math.max(retryAfterSeconds * 1e3, 0);
|
|
555
|
+
}
|
|
556
|
+
const retryAtMs = Date.parse(retryAfter);
|
|
557
|
+
return Number.isNaN(retryAtMs) ? void 0 : Math.max(retryAtMs - Date.now(), 0);
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
// src/utils/sleep-for-milliseconds.ts
|
|
547
561
|
var sleepForMilliseconds = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
548
562
|
|
|
563
|
+
// src/utils/fetch-with-retries.ts
|
|
564
|
+
var fetchWithRetries = async ({
|
|
565
|
+
sendRequest,
|
|
566
|
+
maxAttempts,
|
|
567
|
+
isRetryableStatus,
|
|
568
|
+
getRetryDelayMs,
|
|
569
|
+
retryAbortSignal
|
|
570
|
+
}) => {
|
|
571
|
+
const sendAttempt = async ({
|
|
572
|
+
attempt,
|
|
573
|
+
waitedMs
|
|
574
|
+
}) => {
|
|
575
|
+
const response = await sendRequest();
|
|
576
|
+
if (response.ok || !isRetryableStatus(response.status) || attempt + 1 >= maxAttempts) {
|
|
577
|
+
return response;
|
|
578
|
+
}
|
|
579
|
+
const delayMs = getRetryDelayMs({
|
|
580
|
+
attempt,
|
|
581
|
+
retryAfterMs: parseRetryAfterMs(response.headers.get("retry-after")),
|
|
582
|
+
waitedMs
|
|
583
|
+
});
|
|
584
|
+
if (!o(delayMs)) {
|
|
585
|
+
return response;
|
|
586
|
+
}
|
|
587
|
+
await sleepForMilliseconds(delayMs);
|
|
588
|
+
if (o(retryAbortSignal) && retryAbortSignal.aborted) {
|
|
589
|
+
return response;
|
|
590
|
+
}
|
|
591
|
+
await response.body?.cancel();
|
|
592
|
+
return sendAttempt({ attempt: attempt + 1, waitedMs: waitedMs + delayMs });
|
|
593
|
+
};
|
|
594
|
+
return sendAttempt({ attempt: 0, waitedMs: 0 });
|
|
595
|
+
};
|
|
596
|
+
|
|
549
597
|
// src/features/transcripts/logic-functions/utils/fetch-graph-response.ts
|
|
550
|
-
var
|
|
598
|
+
var fetchGraphResponse = async ({
|
|
551
599
|
accessToken,
|
|
552
600
|
url,
|
|
553
601
|
accept,
|
|
554
602
|
method,
|
|
555
|
-
body
|
|
556
|
-
attempt
|
|
603
|
+
body
|
|
557
604
|
}) => {
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
605
|
+
const resolvedUrl = resolveGraphUrlOrThrow(url);
|
|
606
|
+
const response = await fetchWithRetries({
|
|
607
|
+
sendRequest: () => fetch(resolvedUrl, {
|
|
608
|
+
method,
|
|
609
|
+
redirect: "error",
|
|
610
|
+
headers: {
|
|
611
|
+
Authorization: `Bearer ${accessToken}`,
|
|
612
|
+
Accept: accept,
|
|
613
|
+
...o(body) ? { "Content-Type": "application/json" } : {}
|
|
614
|
+
},
|
|
615
|
+
body: o(body) ? JSON.stringify(body) : void 0
|
|
616
|
+
}),
|
|
617
|
+
maxAttempts: GRAPH_REQUEST_MAX_ATTEMPTS,
|
|
618
|
+
isRetryableStatus: (status) => GRAPH_RETRYABLE_STATUSES.has(status),
|
|
619
|
+
getRetryDelayMs: ({ attempt, retryAfterMs }) => o(retryAfterMs) && retryAfterMs > 0 ? retryAfterMs : GRAPH_REQUEST_RETRY_BASE_DELAY_MILLISECONDS * 2 ** attempt
|
|
567
620
|
});
|
|
568
621
|
if (response.ok) {
|
|
569
622
|
return response;
|
|
570
623
|
}
|
|
571
|
-
if (GRAPH_RETRYABLE_STATUSES.has(response.status) && attempt + 1 < GRAPH_REQUEST_MAX_ATTEMPTS) {
|
|
572
|
-
const retryAfterSeconds = Number(response.headers.get("Retry-After"));
|
|
573
|
-
await sleepForMilliseconds(
|
|
574
|
-
retryAfterSeconds > 0 ? retryAfterSeconds * 1e3 : GRAPH_REQUEST_RETRY_BASE_DELAY_MILLISECONDS * 2 ** attempt
|
|
575
|
-
);
|
|
576
|
-
return fetchGraphResponseWithRetries({
|
|
577
|
-
accessToken,
|
|
578
|
-
url,
|
|
579
|
-
accept,
|
|
580
|
-
method,
|
|
581
|
-
body,
|
|
582
|
-
attempt: attempt + 1
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
624
|
const errorBody = await response.json().catch(() => ({}));
|
|
586
|
-
const innerErrorCode = (0,
|
|
587
|
-
const message = (0,
|
|
625
|
+
const innerErrorCode = (0, import_guards5.isNonEmptyString)(errorBody.error?.innerError?.code) ? errorBody.error.innerError.code : void 0;
|
|
626
|
+
const message = (0, import_guards5.isNonEmptyString)(errorBody.error?.message) ? errorBody.error.message : response.statusText;
|
|
588
627
|
throw new GraphRequestError({
|
|
589
|
-
message: `Microsoft Graph request failed (${response.status}${(0,
|
|
628
|
+
message: `Microsoft Graph request failed (${response.status}${(0, import_guards5.isNonEmptyString)(innerErrorCode) ? ` ${innerErrorCode}` : ""}): ${message}`,
|
|
590
629
|
status: response.status,
|
|
591
630
|
innerErrorCode
|
|
592
631
|
});
|
|
593
632
|
};
|
|
594
|
-
var fetchGraphResponse = ({
|
|
595
|
-
url,
|
|
596
|
-
...request
|
|
597
|
-
}) => fetchGraphResponseWithRetries({
|
|
598
|
-
...request,
|
|
599
|
-
url: resolveGraphUrlOrThrow(url),
|
|
600
|
-
attempt: 0
|
|
601
|
-
});
|
|
602
633
|
|
|
603
634
|
// src/features/transcripts/logic-functions/utils/fetch-graph-text.ts
|
|
604
635
|
var fetchGraphText = async ({
|
|
@@ -690,7 +721,7 @@ var fetchTeamsTranscriptData = async ({
|
|
|
690
721
|
};
|
|
691
722
|
|
|
692
723
|
// src/features/transcripts/logic-functions/utils/find-teams-transcript-calendar-event-id-or-throw.ts
|
|
693
|
-
var
|
|
724
|
+
var import_guards12 = __toESM(require_build());
|
|
694
725
|
|
|
695
726
|
// src/features/transcripts/logic-functions/constants/teams-occurrence-margin-milliseconds.ts
|
|
696
727
|
var TEAMS_OCCURRENCE_MARGIN_MILLISECONDS = 15 * 60 * 1e3;
|
|
@@ -720,7 +751,7 @@ var buildTeamsCalendarViewUrl = ({
|
|
|
720
751
|
};
|
|
721
752
|
|
|
722
753
|
// src/features/transcripts/logic-functions/utils/find-teams-calendar-event-ids-or-throw.ts
|
|
723
|
-
var
|
|
754
|
+
var import_guards8 = __toESM(require_build());
|
|
724
755
|
|
|
725
756
|
// src/features/transcripts/logic-functions/constants/teams-calendar-event-lookup-concurrency.ts
|
|
726
757
|
var TEAMS_CALENDAR_EVENT_LOOKUP_CONCURRENCY = 4;
|
|
@@ -735,7 +766,7 @@ var chunkIntoBatches = (items, batchSize) => Array.from(
|
|
|
735
766
|
);
|
|
736
767
|
|
|
737
768
|
// src/features/transcripts/logic-functions/utils/get-teams-calendar-event-ical-uid-or-throw.ts
|
|
738
|
-
var
|
|
769
|
+
var import_guards6 = __toESM(require_build());
|
|
739
770
|
var getTeamsCalendarEventICalUIdOrThrow = async ({
|
|
740
771
|
accessToken,
|
|
741
772
|
eventId
|
|
@@ -745,7 +776,7 @@ var getTeamsCalendarEventICalUIdOrThrow = async ({
|
|
|
745
776
|
accessToken,
|
|
746
777
|
url: `me/events/${encodeURIComponent(eventId)}?$select=iCalUId`
|
|
747
778
|
});
|
|
748
|
-
return (0,
|
|
779
|
+
return (0, import_guards6.isNonEmptyString)(event.iCalUId) ? event.iCalUId : void 0;
|
|
749
780
|
} catch (error) {
|
|
750
781
|
if (!(error instanceof GraphRequestError)) {
|
|
751
782
|
throw error;
|
|
@@ -772,7 +803,7 @@ var groupCalendarEventIdsByKey = (entries) => {
|
|
|
772
803
|
};
|
|
773
804
|
|
|
774
805
|
// src/features/transcripts/logic-functions/utils/match-teams-calendar-event-ids.ts
|
|
775
|
-
var
|
|
806
|
+
var import_guards7 = __toESM(require_build());
|
|
776
807
|
var findUniqueCalendarEventId = (calendarEventIds) => calendarEventIds?.size === 1 ? [...calendarEventIds][0] : void 0;
|
|
777
808
|
var matchTeamsCalendarEventIds = ({
|
|
778
809
|
references,
|
|
@@ -789,7 +820,7 @@ var matchTeamsCalendarEventIds = ({
|
|
|
789
820
|
);
|
|
790
821
|
const calendarEventIdsByICalUid = groupCalendarEventIdsByKey(
|
|
791
822
|
calendarEvents.flatMap(
|
|
792
|
-
({ id, iCalUid }) => (0,
|
|
823
|
+
({ id, iCalUid }) => (0, import_guards7.isNonEmptyString)(iCalUid) ? [[iCalUid, id]] : []
|
|
793
824
|
)
|
|
794
825
|
);
|
|
795
826
|
return new Map(
|
|
@@ -813,7 +844,7 @@ var listAllNodesInBatchesOrThrow = async ({
|
|
|
813
844
|
do {
|
|
814
845
|
const connection = await fetchPage({ batch, after });
|
|
815
846
|
nodes.push(...connection?.edges.map((edge) => edge.node) ?? []);
|
|
816
|
-
after = connection?.pageInfo.hasNextPage && (0,
|
|
847
|
+
after = connection?.pageInfo.hasNextPage && (0, import_guards8.isNonEmptyString)(connection.pageInfo.endCursor) ? connection.pageInfo.endCursor : void 0;
|
|
817
848
|
} while (o(after));
|
|
818
849
|
}
|
|
819
850
|
return nodes;
|
|
@@ -845,7 +876,7 @@ var listCalendarChannelEventAssociationsOrThrow = ({
|
|
|
845
876
|
({
|
|
846
877
|
node
|
|
847
878
|
}) => {
|
|
848
|
-
if (!(0,
|
|
879
|
+
if (!(0, import_guards8.isNonEmptyString)(node.eventExternalId) || !(0, import_guards8.isNonEmptyString)(node.calendarEventId)) {
|
|
849
880
|
return [];
|
|
850
881
|
}
|
|
851
882
|
return [
|
|
@@ -951,7 +982,7 @@ var findTeamsCalendarEventIdsOrThrow = async ({
|
|
|
951
982
|
});
|
|
952
983
|
const fallbackICalUIds = [
|
|
953
984
|
...new Set(
|
|
954
|
-
iCalUIdFallbackReferences.map(({ iCalUId }) => iCalUId).filter(
|
|
985
|
+
iCalUIdFallbackReferences.map(({ iCalUId }) => iCalUId).filter(import_guards8.isNonEmptyString)
|
|
955
986
|
)
|
|
956
987
|
];
|
|
957
988
|
return matchTeamsCalendarEventIds({
|
|
@@ -965,12 +996,12 @@ var findTeamsCalendarEventIdsOrThrow = async ({
|
|
|
965
996
|
};
|
|
966
997
|
|
|
967
998
|
// src/features/transcripts/logic-functions/utils/is-transcript-during-occurrence.ts
|
|
968
|
-
var
|
|
999
|
+
var import_guards9 = __toESM(require_build());
|
|
969
1000
|
var isTranscriptDuringOccurrence = ({
|
|
970
1001
|
transcript,
|
|
971
1002
|
occurrence
|
|
972
1003
|
}) => {
|
|
973
|
-
if (!(0,
|
|
1004
|
+
if (!(0, import_guards9.isNonEmptyString)(transcript.createdDateTime)) {
|
|
974
1005
|
return false;
|
|
975
1006
|
}
|
|
976
1007
|
const createdMilliseconds = Date.parse(transcript.createdDateTime);
|
|
@@ -989,10 +1020,10 @@ var findTeamsTranscriptCalendarReference = ({
|
|
|
989
1020
|
};
|
|
990
1021
|
|
|
991
1022
|
// src/features/transcripts/logic-functions/utils/list-teams-calendar-page.ts
|
|
992
|
-
var
|
|
1023
|
+
var import_guards11 = __toESM(require_build());
|
|
993
1024
|
|
|
994
1025
|
// src/features/transcripts/logic-functions/utils/to-teams-meeting-occurrence.ts
|
|
995
|
-
var
|
|
1026
|
+
var import_guards10 = __toESM(require_build());
|
|
996
1027
|
|
|
997
1028
|
// src/features/transcripts/logic-functions/utils/parse-graph-utc-date-time.ts
|
|
998
1029
|
var parseGraphUtcDateTime = (dateTimeTimeZone) => {
|
|
@@ -1008,12 +1039,12 @@ var toTeamsMeetingOccurrence = (event) => {
|
|
|
1008
1039
|
const joinWebUrl = event.onlineMeeting?.joinUrl;
|
|
1009
1040
|
const startDateTime = parseGraphUtcDateTime(event.start);
|
|
1010
1041
|
const endDateTime = parseGraphUtcDateTime(event.end);
|
|
1011
|
-
if (!event.isOrganizer || event.isCancelled || event.onlineMeetingProvider !== "teamsForBusiness" || !(0,
|
|
1042
|
+
if (!event.isOrganizer || event.isCancelled || event.onlineMeetingProvider !== "teamsForBusiness" || !(0, import_guards10.isNonEmptyString)(joinWebUrl) || !(0, import_guards10.isNonEmptyString)(event.id) || !o(startDateTime) || !o(endDateTime)) {
|
|
1012
1043
|
return void 0;
|
|
1013
1044
|
}
|
|
1014
|
-
const calendarReference = (0,
|
|
1045
|
+
const calendarReference = (0, import_guards10.isNonEmptyString)(event.seriesMasterId) ? { eventExternalId: event.seriesMasterId } : {
|
|
1015
1046
|
eventExternalId: event.id,
|
|
1016
|
-
...(0,
|
|
1047
|
+
...(0, import_guards10.isNonEmptyString)(event.iCalUId) ? { iCalUId: event.iCalUId } : {}
|
|
1017
1048
|
};
|
|
1018
1049
|
return { joinWebUrl, startDateTime, endDateTime, calendarReference };
|
|
1019
1050
|
};
|
|
@@ -1033,7 +1064,7 @@ var listTeamsCalendarPage = async ({
|
|
|
1033
1064
|
});
|
|
1034
1065
|
return {
|
|
1035
1066
|
occurrences,
|
|
1036
|
-
nextPageUrl: (0,
|
|
1067
|
+
nextPageUrl: (0, import_guards11.isNonEmptyString)(page["@odata.nextLink"]) ? page["@odata.nextLink"] : void 0
|
|
1037
1068
|
};
|
|
1038
1069
|
};
|
|
1039
1070
|
|
|
@@ -1105,7 +1136,7 @@ var findTeamsTranscriptCalendarEventIdOrThrow = async ({
|
|
|
1105
1136
|
meeting,
|
|
1106
1137
|
transcript
|
|
1107
1138
|
}) => {
|
|
1108
|
-
if (!(0,
|
|
1139
|
+
if (!(0, import_guards12.isNonEmptyString)(meeting.joinWebUrl) || !(0, import_guards12.isNonEmptyString)(transcript.createdDateTime)) {
|
|
1109
1140
|
return void 0;
|
|
1110
1141
|
}
|
|
1111
1142
|
const transcriptStartMilliseconds = Date.parse(transcript.createdDateTime);
|
|
@@ -1134,7 +1165,7 @@ var findTeamsTranscriptCalendarEventIdOrThrow = async ({
|
|
|
1134
1165
|
};
|
|
1135
1166
|
|
|
1136
1167
|
// src/features/transcripts/logic-functions/utils/map-teams-transcript-to-entries.ts
|
|
1137
|
-
var
|
|
1168
|
+
var import_guards13 = __toESM(require_build());
|
|
1138
1169
|
var isCueTimingLine = (line) => /^-?(?:\d+:)?\d{1,2}:\d{2}[.,]\d{1,3}\s+-->\s+-?(?:\d+:)?\d{1,2}:\d{2}[.,]\d{1,3}/.test(
|
|
1139
1170
|
line.trim()
|
|
1140
1171
|
);
|
|
@@ -1150,7 +1181,7 @@ var parseCueStartSeconds = (timingLine) => {
|
|
|
1150
1181
|
var splitIntoBlocks = (content) => {
|
|
1151
1182
|
const blocks = [[]];
|
|
1152
1183
|
for (const line of content.replace(/^/, "").split(/\r?\n/)) {
|
|
1153
|
-
if ((0,
|
|
1184
|
+
if ((0, import_guards13.isNonEmptyString)(line.trim())) {
|
|
1154
1185
|
blocks[blocks.length - 1].push(line);
|
|
1155
1186
|
} else {
|
|
1156
1187
|
blocks.push([]);
|
|
@@ -1193,12 +1224,12 @@ var toUtterance = ({
|
|
|
1193
1224
|
/<v(?:\.[^\s>]*)?\s+([^>]*)>/i.exec(cueText)?.[1] ?? ""
|
|
1194
1225
|
).trim();
|
|
1195
1226
|
const text = decodeHtmlEntities(stripCueTags(cueText)).replace(/\s+/g, " ").trim();
|
|
1196
|
-
if (!(0,
|
|
1227
|
+
if (!(0, import_guards13.isNonEmptyString)(text)) {
|
|
1197
1228
|
return void 0;
|
|
1198
1229
|
}
|
|
1199
1230
|
return {
|
|
1200
1231
|
startSeconds,
|
|
1201
|
-
speakerName: (0,
|
|
1232
|
+
speakerName: (0, import_guards13.isNonEmptyString)(speakerName) ? speakerName : void 0,
|
|
1202
1233
|
text
|
|
1203
1234
|
};
|
|
1204
1235
|
};
|
|
@@ -1428,7 +1459,7 @@ var isTeamsTranscriptImportEnabled = () => process.env[TRANSCRIPTS_ENABLED_APPLI
|
|
|
1428
1459
|
// src/features/transcripts/logic-functions/teams-import-transcript.ts
|
|
1429
1460
|
var teamsImportTranscriptHandler = async (payload) => {
|
|
1430
1461
|
const { connectedAccountId, meetingId, transcriptId, attempt } = payload;
|
|
1431
|
-
if (!(0,
|
|
1462
|
+
if (!(0, import_guards14.isNonEmptyString)(connectedAccountId) || !(0, import_guards14.isNonEmptyString)(meetingId) || !(0, import_guards14.isNonEmptyString)(transcriptId) || !(0, import_guards14.isPositiveInteger)(attempt)) {
|
|
1432
1463
|
return { success: false, error: "Invalid Teams transcript import job" };
|
|
1433
1464
|
}
|
|
1434
1465
|
if (!isTeamsTranscriptImportEnabled()) {
|