@twentyhq/meet 0.0.0-stage → 1.0.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/README.md +48 -2
- package/dependencies/yarn.lock +1863 -0
- package/manifest.json +1901 -0
- package/package.json +44 -4
- package/public/gallery/meet-cover-image-1.png +0 -0
- package/public/gallery/meet-cover-image-2.png +0 -0
- package/public/gallery/meet-cover-image-3.png +0 -0
- package/public/logo.svg +1 -0
- package/src/constants/meet-call-summary-prompt.constant.ts +54 -0
- package/src/constants/meet.constant.ts +17 -0
- package/src/constants/universal-identifiers.ts +35 -0
- package/src/logic-functions/constants/calendar-event-matching.constant.ts +3 -0
- package/src/logic-functions/constants/google-docs-api.constant.ts +10 -0
- package/src/logic-functions/constants/google-drive-api.constant.ts +1 -0
- package/src/logic-functions/constants/google-pubsub-push.constant.ts +7 -0
- package/src/logic-functions/constants/google-user-info.constant.ts +2 -0
- package/src/logic-functions/constants/google-workspace-events.constant.ts +17 -0
- package/src/logic-functions/constants/meet-api.constant.ts +9 -0
- package/src/logic-functions/constants/meet-call-summary.constant.ts +3 -0
- package/src/logic-functions/constants/meet-import.constant.ts +7 -0
- package/src/logic-functions/constants/meet-recording-import.constant.ts +7 -0
- package/src/logic-functions/constants/restricted-field-placeholder.constant.ts +2 -0
- package/src/logic-functions/meet-events-resolver.mjs +1345 -0
- package/src/logic-functions/meet-events-resolver.mjs.map +7 -0
- package/src/logic-functions/meet-events-resolver.ts +89 -0
- package/src/logic-functions/meet-handle-event.mjs +665 -0
- package/src/logic-functions/meet-handle-event.mjs.map +7 -0
- package/src/logic-functions/meet-handle-event.ts +86 -0
- package/src/logic-functions/meet-identify-account.mjs +369 -0
- package/src/logic-functions/meet-identify-account.mjs.map +7 -0
- package/src/logic-functions/meet-identify-account.ts +42 -0
- package/src/logic-functions/meet-import-conference.mjs +1465 -0
- package/src/logic-functions/meet-import-conference.mjs.map +7 -0
- package/src/logic-functions/meet-import-conference.ts +101 -0
- package/src/logic-functions/meet-import-recording.mjs +794 -0
- package/src/logic-functions/meet-import-recording.mjs.map +7 -0
- package/src/logic-functions/meet-import-recording.ts +99 -0
- package/src/logic-functions/meet-queue-conference-imports.mjs +711 -0
- package/src/logic-functions/meet-queue-conference-imports.mjs.map +7 -0
- package/src/logic-functions/meet-queue-conference-imports.ts +62 -0
- package/src/logic-functions/meet-refresh-connections.mjs +457 -0
- package/src/logic-functions/meet-refresh-connections.mjs.map +7 -0
- package/src/logic-functions/meet-refresh-connections.ts +64 -0
- package/src/logic-functions/meet-register-connection.mjs +837 -0
- package/src/logic-functions/meet-register-connection.mjs.map +7 -0
- package/src/logic-functions/meet-register-connection.ts +81 -0
- package/src/logic-functions/meet-summarize-call-recording.mjs +645 -0
- package/src/logic-functions/meet-summarize-call-recording.mjs.map +7 -0
- package/src/logic-functions/meet-summarize-call-recording.ts +111 -0
- package/src/logic-functions/meet-unregister-connection.mjs +610 -0
- package/src/logic-functions/meet-unregister-connection.mjs.map +7 -0
- package/src/logic-functions/meet-unregister-connection.ts +57 -0
- package/src/logic-functions/types/calendar-event-candidate.type.ts +6 -0
- package/src/logic-functions/types/call-recording-for-summary.type.ts +5 -0
- package/src/logic-functions/types/call-recording-sync-fields.type.ts +12 -0
- package/src/logic-functions/types/call-recording-upsert-outcome.type.ts +4 -0
- package/src/logic-functions/types/google-doc-lists.type.ts +4 -0
- package/src/logic-functions/types/google-doc-markdown-segment.type.ts +5 -0
- package/src/logic-functions/types/google-doc-paragraph-element.type.ts +8 -0
- package/src/logic-functions/types/google-doc-paragraph.type.ts +7 -0
- package/src/logic-functions/types/google-doc-tab.type.ts +10 -0
- package/src/logic-functions/types/google-doc.type.ts +6 -0
- package/src/logic-functions/types/google-pubsub-push-body.type.ts +6 -0
- package/src/logic-functions/types/google-request-method.type.ts +1 -0
- package/src/logic-functions/types/google-user-info.type.ts +4 -0
- package/src/logic-functions/types/google-workspace-events-operation.type.ts +8 -0
- package/src/logic-functions/types/meet-call-summary-outcome.type.ts +6 -0
- package/src/logic-functions/types/meet-collection-page.type.ts +3 -0
- package/src/logic-functions/types/meet-conference-record.type.ts +7 -0
- package/src/logic-functions/types/meet-conference-sync-outcome.type.ts +5 -0
- package/src/logic-functions/types/meet-conference-sync-result.type.ts +7 -0
- package/src/logic-functions/types/meet-daily-job-name.type.ts +1 -0
- package/src/logic-functions/types/meet-event-data.type.ts +5 -0
- package/src/logic-functions/types/meet-event-outcome.type.ts +4 -0
- package/src/logic-functions/types/meet-event-subscription.type.ts +8 -0
- package/src/logic-functions/types/meet-event.type.ts +5 -0
- package/src/logic-functions/types/meet-exception-code.type.ts +12 -0
- package/src/logic-functions/types/meet-exception.type.ts +25 -0
- package/src/logic-functions/types/meet-participant.type.ts +8 -0
- package/src/logic-functions/types/meet-recording-import-outcome.type.ts +6 -0
- package/src/logic-functions/types/meet-recording.type.ts +7 -0
- package/src/logic-functions/types/meet-smart-note.type.ts +7 -0
- package/src/logic-functions/types/meet-space.type.ts +5 -0
- package/src/logic-functions/types/meet-transcript-entry.type.ts +8 -0
- package/src/logic-functions/types/meet-transcript.type.ts +7 -0
- package/src/logic-functions/types/transcript-entry.type.ts +7 -0
- package/src/logic-functions/utils/build-google-api-url-or-throw.util.ts +30 -0
- package/src/logic-functions/utils/build-google-doc-markdown-segment.util.ts +67 -0
- package/src/logic-functions/utils/build-meet-artifact-import-job.util.ts +25 -0
- package/src/logic-functions/utils/build-meet-call-recording-sync-fields.util.ts +48 -0
- package/src/logic-functions/utils/build-meet-call-summary-job.util.ts +19 -0
- package/src/logic-functions/utils/build-meet-call-summary-prompt.util.ts +50 -0
- package/src/logic-functions/utils/build-meet-conference-import-job.util.ts +26 -0
- package/src/logic-functions/utils/build-meet-conference-import-payload.util.ts +18 -0
- package/src/logic-functions/utils/build-meet-conference-record-filter.util.ts +8 -0
- package/src/logic-functions/utils/build-meet-daily-job.util.ts +17 -0
- package/src/logic-functions/utils/build-meet-recording-import-job.util.ts +20 -0
- package/src/logic-functions/utils/build-meet-url-or-throw.util.ts +15 -0
- package/src/logic-functions/utils/build-meet-user-target-resource.util.ts +2 -0
- package/src/logic-functions/utils/can-renew-meet-event-subscription.util.ts +18 -0
- package/src/logic-functions/utils/chunk-into-batches.util.ts +10 -0
- package/src/logic-functions/utils/claim-meet-event-subscription.util.ts +10 -0
- package/src/logic-functions/utils/compute-call-recording-id-for-meet-conference.util.ts +16 -0
- package/src/logic-functions/utils/convert-google-doc-paragraph-to-markdown.util.ts +62 -0
- package/src/logic-functions/utils/convert-google-doc-tab-to-markdown.util.ts +49 -0
- package/src/logic-functions/utils/create-meet-event-subscription-or-throw.util.ts +41 -0
- package/src/logic-functions/utils/delete-meet-event-subscription.util.ts +22 -0
- package/src/logic-functions/utils/enqueue-meet-conference-imports-or-throw.util.ts +39 -0
- package/src/logic-functions/utils/enqueue-meet-daily-jobs-or-throw.util.ts +35 -0
- package/src/logic-functions/utils/ensure-meet-event-subscription-or-throw.util.ts +51 -0
- package/src/logic-functions/utils/escape-markdown-text.util.ts +4 -0
- package/src/logic-functions/utils/escape-sql-like-pattern.util.ts +2 -0
- package/src/logic-functions/utils/extract-bearer-token.util.ts +23 -0
- package/src/logic-functions/utils/extract-meet-name-from-doc-title.util.ts +16 -0
- package/src/logic-functions/utils/fetch-meet-json.util.ts +107 -0
- package/src/logic-functions/utils/find-call-recording-for-summary.util.ts +38 -0
- package/src/logic-functions/utils/find-call-recording-video-state.util.ts +25 -0
- package/src/logic-functions/utils/find-meet-calendar-event.util.ts +74 -0
- package/src/logic-functions/utils/find-meet-conference-title.util.ts +38 -0
- package/src/logic-functions/utils/find-meet-event-subscription.util.ts +32 -0
- package/src/logic-functions/utils/find-meet-smart-notes-markdown.util.ts +32 -0
- package/src/logic-functions/utils/format-seconds-as-clock-timestamp.util.ts +20 -0
- package/src/logic-functions/utils/get-conference-record-name-from-artifact-name.util.ts +6 -0
- package/src/logic-functions/utils/get-connection-access-token-or-throw.util.ts +18 -0
- package/src/logic-functions/utils/get-google-doc-title.util.ts +31 -0
- package/src/logic-functions/utils/get-google-doc.util.ts +30 -0
- package/src/logic-functions/utils/get-google-drive-file-size-bytes-or-throw.util.ts +31 -0
- package/src/logic-functions/utils/get-meet-conference-record.util.ts +18 -0
- package/src/logic-functions/utils/get-meet-connection-subscription-key.util.ts +3 -0
- package/src/logic-functions/utils/get-meet-event-subscription-key.util.ts +2 -0
- package/src/logic-functions/utils/get-meet-participant-display-name.util.ts +20 -0
- package/src/logic-functions/utils/get-meet-recording-drive-file-id.util.ts +16 -0
- package/src/logic-functions/utils/get-meet-recording.util.ts +18 -0
- package/src/logic-functions/utils/get-meet-space.util.ts +15 -0
- package/src/logic-functions/utils/get-random-delay-milliseconds.util.ts +4 -0
- package/src/logic-functions/utils/is-google-doc-unreadable-error.util.ts +9 -0
- package/src/logic-functions/utils/is-google-pubsub-push-authorized.util.ts +31 -0
- package/src/logic-functions/utils/is-meet-ai-summary-enabled-for-member.util.ts +22 -0
- package/src/logic-functions/utils/is-transcript-entry-list.util.ts +16 -0
- package/src/logic-functions/utils/join-google-doc-markdown-segments.util.ts +102 -0
- package/src/logic-functions/utils/list-calendar-events-in-window.util.ts +142 -0
- package/src/logic-functions/utils/list-meet-collection.util.ts +79 -0
- package/src/logic-functions/utils/list-meet-conference-records.util.ts +22 -0
- package/src/logic-functions/utils/list-meet-participants.util.ts +15 -0
- package/src/logic-functions/utils/list-meet-recordings.util.ts +15 -0
- package/src/logic-functions/utils/list-meet-smart-notes.util.ts +15 -0
- package/src/logic-functions/utils/list-meet-transcript-entries.util.ts +15 -0
- package/src/logic-functions/utils/list-meet-transcripts.util.ts +15 -0
- package/src/logic-functions/utils/map-meet-transcript-entries.util.ts +64 -0
- package/src/logic-functions/utils/normalize-meeting-url.util.ts +18 -0
- package/src/logic-functions/utils/open-google-drive-file-download-or-throw.util.ts +36 -0
- package/src/logic-functions/utils/parse-meet-call-summary-response.util.ts +36 -0
- package/src/logic-functions/utils/parse-meet-event-data-or-throw.util.ts +36 -0
- package/src/logic-functions/utils/parse-meet-event-or-throw.util.ts +35 -0
- package/src/logic-functions/utils/parse-retry-after-milliseconds.util.ts +27 -0
- package/src/logic-functions/utils/put-stream-to-upload-url-or-throw.util.ts +73 -0
- package/src/logic-functions/utils/read-meet-event-subscription-or-throw.util.ts +24 -0
- package/src/logic-functions/utils/release-meet-event-subscription.util.ts +29 -0
- package/src/logic-functions/utils/renew-meet-event-subscription-or-throw.util.ts +32 -0
- package/src/logic-functions/utils/run-meet-call-summarizer-or-throw.util.ts +28 -0
- package/src/logic-functions/utils/save-call-recording-summary-if-empty.util.ts +29 -0
- package/src/logic-functions/utils/save-call-recording-video.util.ts +23 -0
- package/src/logic-functions/utils/should-generate-meet-ai-summary.util.ts +17 -0
- package/src/logic-functions/utils/sleep-for-milliseconds.util.ts +2 -0
- package/src/logic-functions/utils/split-surrounding-whitespace.util.ts +10 -0
- package/src/logic-functions/utils/store-meet-connection-subscription.util.ts +46 -0
- package/src/logic-functions/utils/sync-meet-conference-or-throw.util.ts +129 -0
- package/src/logic-functions/utils/upload-google-drive-file-as-call-recording-video-or-throw.util.ts +73 -0
- package/src/logic-functions/utils/upsert-call-recording-or-throw.util.ts +104 -0
- package/src/logic-functions/utils/verify-google-pubsub-push-token-or-throw.util.ts +71 -0
- package/src/logic-functions/utils/wait-for-google-workspace-events-operation-or-throw.util.ts +53 -0
- package/tsconfig.json +39 -0
|
@@ -0,0 +1,1465 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
try {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
} catch (e3) {
|
|
13
|
+
throw mod = 0, e3;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
// node_modules/@sniptt/guards/build/guards/primitives.js
|
|
34
|
+
var require_primitives = __commonJS({
|
|
35
|
+
"node_modules/@sniptt/guards/build/guards/primitives.js"(exports) {
|
|
36
|
+
"use strict";
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.isSymbol = exports.isBigInt = exports.isString = exports.isNumber = exports.isBoolean = exports.isUndefined = void 0;
|
|
39
|
+
var isUndefined = (term) => {
|
|
40
|
+
return typeof term === "undefined";
|
|
41
|
+
};
|
|
42
|
+
exports.isUndefined = isUndefined;
|
|
43
|
+
var isBoolean = (term) => {
|
|
44
|
+
return typeof term === "boolean";
|
|
45
|
+
};
|
|
46
|
+
exports.isBoolean = isBoolean;
|
|
47
|
+
var isNumber = (term) => {
|
|
48
|
+
return typeof term === "number" && !Number.isNaN(term);
|
|
49
|
+
};
|
|
50
|
+
exports.isNumber = isNumber;
|
|
51
|
+
var isString = (term) => {
|
|
52
|
+
return typeof term === "string";
|
|
53
|
+
};
|
|
54
|
+
exports.isString = isString;
|
|
55
|
+
var isBigInt = (term) => {
|
|
56
|
+
return typeof term === "bigint";
|
|
57
|
+
};
|
|
58
|
+
exports.isBigInt = isBigInt;
|
|
59
|
+
var isSymbol = (term) => {
|
|
60
|
+
return typeof term === "symbol";
|
|
61
|
+
};
|
|
62
|
+
exports.isSymbol = isSymbol;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// node_modules/@sniptt/guards/build/guards/structural.js
|
|
67
|
+
var require_structural = __commonJS({
|
|
68
|
+
"node_modules/@sniptt/guards/build/guards/structural.js"(exports) {
|
|
69
|
+
"use strict";
|
|
70
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
|
+
exports.isDate = exports.isWeakSet = exports.isWeakMap = exports.isSet = exports.isMap = exports.isArray = exports.isObject = exports.isFunction = exports.isNull = void 0;
|
|
72
|
+
var isNull = (term) => {
|
|
73
|
+
return term === null;
|
|
74
|
+
};
|
|
75
|
+
exports.isNull = isNull;
|
|
76
|
+
var isFunction = (term) => {
|
|
77
|
+
return typeof term === "function";
|
|
78
|
+
};
|
|
79
|
+
exports.isFunction = isFunction;
|
|
80
|
+
var isObject = (term) => {
|
|
81
|
+
return !exports.isNull(term) && typeof term === "object";
|
|
82
|
+
};
|
|
83
|
+
exports.isObject = isObject;
|
|
84
|
+
var isArray = (term) => {
|
|
85
|
+
return Array.isArray(term);
|
|
86
|
+
};
|
|
87
|
+
exports.isArray = isArray;
|
|
88
|
+
var isMap = (term) => {
|
|
89
|
+
return term instanceof Map;
|
|
90
|
+
};
|
|
91
|
+
exports.isMap = isMap;
|
|
92
|
+
var isSet = (term) => {
|
|
93
|
+
return term instanceof Set;
|
|
94
|
+
};
|
|
95
|
+
exports.isSet = isSet;
|
|
96
|
+
var isWeakMap = (term) => {
|
|
97
|
+
return term instanceof WeakMap;
|
|
98
|
+
};
|
|
99
|
+
exports.isWeakMap = isWeakMap;
|
|
100
|
+
var isWeakSet = (term) => {
|
|
101
|
+
return term instanceof WeakSet;
|
|
102
|
+
};
|
|
103
|
+
exports.isWeakSet = isWeakSet;
|
|
104
|
+
var isDate = (term) => {
|
|
105
|
+
return term instanceof Date;
|
|
106
|
+
};
|
|
107
|
+
exports.isDate = isDate;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// node_modules/@sniptt/guards/build/guards/convenience.js
|
|
112
|
+
var require_convenience = __commonJS({
|
|
113
|
+
"node_modules/@sniptt/guards/build/guards/convenience.js"(exports) {
|
|
114
|
+
"use strict";
|
|
115
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
116
|
+
exports.isNegativeInteger = exports.isNonNegativeInteger = exports.isPositiveInteger = exports.isInteger = exports.isNumberOrNaN = exports.isNonEmptyString = exports.isNonEmptyArray = exports.isObjectOrNull = void 0;
|
|
117
|
+
var primitives_1 = require_primitives();
|
|
118
|
+
var structural_1 = require_structural();
|
|
119
|
+
var isObjectOrNull = (term) => {
|
|
120
|
+
return typeof term === "object";
|
|
121
|
+
};
|
|
122
|
+
exports.isObjectOrNull = isObjectOrNull;
|
|
123
|
+
var isNonEmptyArray4 = (term) => {
|
|
124
|
+
return structural_1.isArray(term) && term.length > 0;
|
|
125
|
+
};
|
|
126
|
+
exports.isNonEmptyArray = isNonEmptyArray4;
|
|
127
|
+
var isNonEmptyString20 = (term) => {
|
|
128
|
+
return primitives_1.isString(term) && term.length > 0;
|
|
129
|
+
};
|
|
130
|
+
exports.isNonEmptyString = isNonEmptyString20;
|
|
131
|
+
var isNumberOrNaN = (term) => {
|
|
132
|
+
return typeof term === "number";
|
|
133
|
+
};
|
|
134
|
+
exports.isNumberOrNaN = isNumberOrNaN;
|
|
135
|
+
var isInteger = (term) => {
|
|
136
|
+
return primitives_1.isNumber(term) && Number.isInteger(term);
|
|
137
|
+
};
|
|
138
|
+
exports.isInteger = isInteger;
|
|
139
|
+
var isPositiveInteger = (term) => {
|
|
140
|
+
return exports.isInteger(term) && term > 0;
|
|
141
|
+
};
|
|
142
|
+
exports.isPositiveInteger = isPositiveInteger;
|
|
143
|
+
var isNonNegativeInteger = (term) => {
|
|
144
|
+
return exports.isInteger(term) && term >= 0;
|
|
145
|
+
};
|
|
146
|
+
exports.isNonNegativeInteger = isNonNegativeInteger;
|
|
147
|
+
var isNegativeInteger = (term) => {
|
|
148
|
+
return exports.isInteger(term) && term < 0;
|
|
149
|
+
};
|
|
150
|
+
exports.isNegativeInteger = isNegativeInteger;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// node_modules/@sniptt/guards/build/index.js
|
|
155
|
+
var require_build = __commonJS({
|
|
156
|
+
"node_modules/@sniptt/guards/build/index.js"(exports) {
|
|
157
|
+
"use strict";
|
|
158
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o2, m, k, k2) {
|
|
159
|
+
if (k2 === void 0) k2 = k;
|
|
160
|
+
Object.defineProperty(o2, k2, { enumerable: true, get: function() {
|
|
161
|
+
return m[k];
|
|
162
|
+
} });
|
|
163
|
+
}) : (function(o2, m, k, k2) {
|
|
164
|
+
if (k2 === void 0) k2 = k;
|
|
165
|
+
o2[k2] = m[k];
|
|
166
|
+
}));
|
|
167
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o2, v2) {
|
|
168
|
+
Object.defineProperty(o2, "default", { enumerable: true, value: v2 });
|
|
169
|
+
}) : function(o2, v2) {
|
|
170
|
+
o2["default"] = v2;
|
|
171
|
+
});
|
|
172
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
173
|
+
if (mod && mod.__esModule) return mod;
|
|
174
|
+
var result = {};
|
|
175
|
+
if (mod != null) {
|
|
176
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
177
|
+
}
|
|
178
|
+
__setModuleDefault(result, mod);
|
|
179
|
+
return result;
|
|
180
|
+
};
|
|
181
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
182
|
+
for (var p2 in m) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2)) __createBinding(exports2, m, p2);
|
|
183
|
+
};
|
|
184
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
|
+
exports.structural = exports.primitives = exports.convenience = void 0;
|
|
186
|
+
exports.convenience = __importStar(require_convenience());
|
|
187
|
+
__exportStar(require_convenience(), exports);
|
|
188
|
+
exports.primitives = __importStar(require_primitives());
|
|
189
|
+
__exportStar(require_primitives(), exports);
|
|
190
|
+
exports.structural = __importStar(require_structural());
|
|
191
|
+
__exportStar(require_structural(), exports);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// src/logic-functions/meet-import-conference.ts
|
|
196
|
+
var import_guards21 = __toESM(require_build());
|
|
197
|
+
import { CoreApiClient } from "twenty-client-sdk/core";
|
|
198
|
+
|
|
199
|
+
// twenty-sdk-define-stub:__twenty-sdk-define-stub__
|
|
200
|
+
var __defineFactoryStub = (config) => ({
|
|
201
|
+
success: true,
|
|
202
|
+
config,
|
|
203
|
+
errors: []
|
|
204
|
+
});
|
|
205
|
+
var __anyHandler = {
|
|
206
|
+
get(_target, prop) {
|
|
207
|
+
if (prop === "__esModule") return true;
|
|
208
|
+
if (prop === Symbol.toPrimitive) return () => "";
|
|
209
|
+
if (typeof prop === "symbol") return void 0;
|
|
210
|
+
return new Proxy(() => void 0, __anyHandler);
|
|
211
|
+
},
|
|
212
|
+
apply() {
|
|
213
|
+
return new Proxy(() => void 0, __anyHandler);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
var __anyStub = new Proxy(() => void 0, __anyHandler);
|
|
217
|
+
var defineLogicFunction = __defineFactoryStub;
|
|
218
|
+
|
|
219
|
+
// node_modules/twenty-sdk/dist/logic-function/index.mjs
|
|
220
|
+
var import_guards = __toESM(require_build(), 1);
|
|
221
|
+
import { MetadataApiClient as o } from "twenty-client-sdk/metadata";
|
|
222
|
+
var p = class extends Error {
|
|
223
|
+
constructor(e3) {
|
|
224
|
+
super(`App connection ${e3} requires the user to reconnect (authFailedAt is set). Surface a "Reconnect" prompt in your UI.`), this.name = "AppConnectionAuthFailedError", this.connectionId = e3;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
var h = "TWENTY_API_URL";
|
|
228
|
+
var g = "TWENTY_APP_ACCESS_TOKEN";
|
|
229
|
+
var ee = "TWENTY_APP_APPLICATION_ACCESS_TOKEN";
|
|
230
|
+
var te = "TWENTY_INTERNAL_API_URL";
|
|
231
|
+
var ne = {
|
|
232
|
+
USER: "user",
|
|
233
|
+
WORKSPACE: "workspace"
|
|
234
|
+
};
|
|
235
|
+
var re = (e3) => {
|
|
236
|
+
let n3 = e3[te];
|
|
237
|
+
return (0, import_guards.isNonEmptyString)(n3) ? n3 : e3[h];
|
|
238
|
+
};
|
|
239
|
+
var _ = (e3) => ({
|
|
240
|
+
...e3,
|
|
241
|
+
visibility: ne[e3.scope]
|
|
242
|
+
});
|
|
243
|
+
var v = () => process.env.TWENTY_APP_APPLICATION_ACCESS_TOKEN ?? process.env.TWENTY_APP_ACCESS_TOKEN;
|
|
244
|
+
var y = () => process.env.TWENTY_APP_ACCESS_TOKEN ?? process.env.TWENTY_APP_APPLICATION_ACCESS_TOKEN;
|
|
245
|
+
var b = ({ caller: e3, isActingAsCaller: n3 = false }) => {
|
|
246
|
+
let r2 = re(process.env), i2 = n3 ? y() : v();
|
|
247
|
+
if (!(0, import_guards.isNonEmptyString)(r2) || !(0, import_guards.isNonEmptyString)(i2)) throw Error(`${e3}() requires the app runtime env vars ${h} and ${ee} (or ${g}).`);
|
|
248
|
+
return {
|
|
249
|
+
apiUrl: r2,
|
|
250
|
+
accessToken: i2
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
var x = async ({ query: e3, variables: t3, caller: n3, signal: r2, isActingAsCaller: i2 = false }) => {
|
|
254
|
+
let { apiUrl: a2, accessToken: o2 } = b({
|
|
255
|
+
caller: n3,
|
|
256
|
+
isActingAsCaller: i2
|
|
257
|
+
}), s = await fetch(`${a2}/metadata`, {
|
|
258
|
+
method: "POST",
|
|
259
|
+
headers: {
|
|
260
|
+
"Content-Type": "application/json",
|
|
261
|
+
Authorization: `Bearer ${o2}`
|
|
262
|
+
},
|
|
263
|
+
body: JSON.stringify({
|
|
264
|
+
query: e3,
|
|
265
|
+
variables: t3
|
|
266
|
+
}),
|
|
267
|
+
signal: r2
|
|
268
|
+
});
|
|
269
|
+
if (!s.ok) throw Error(`${n3}() failed: HTTP ${s.status} ${s.statusText}`);
|
|
270
|
+
let c = await s.json();
|
|
271
|
+
if (c.errors && c.errors.length > 0) throw Error(`${n3}() failed: ${c.errors.map((e4) => e4.message).join(", ")}`);
|
|
272
|
+
if (!c.data) throw Error(`${n3}() failed: response contained no data.`);
|
|
273
|
+
return c.data;
|
|
274
|
+
};
|
|
275
|
+
var ie = "\n query GetAppConnection($id: ID!) {\n appConnection(id: $id) {\n id\n providerName\n name\n handle\n externalAccountId\n scope\n userWorkspaceId\n workspaceMemberId\n providerType\n accessToken\n scopes\n authFailedAt\n authFailedReason\n }\n }\n";
|
|
276
|
+
var ae = async (e3) => {
|
|
277
|
+
let { appConnection: t3 } = await x({
|
|
278
|
+
query: ie,
|
|
279
|
+
variables: { id: e3 },
|
|
280
|
+
caller: "getConnection"
|
|
281
|
+
});
|
|
282
|
+
if (t3.authFailedAt !== null) throw new p(t3.id);
|
|
283
|
+
return _(t3);
|
|
284
|
+
};
|
|
285
|
+
var S = ({ objectNameSingular: e3, recordId: t3, displayName: n3 }) => `[[record:${e3}:${t3}:${n3}]]`;
|
|
286
|
+
var C = "\n id\n handle\n displayName\n visibility\n connectedAccountId\n isSyncEnabled\n participantHandleFieldUniversalIdentifier\n messagingProviderUniversalIdentifier\n";
|
|
287
|
+
var w = `
|
|
288
|
+
mutation CreateAppMessageChannel($input: CreateAppMessageChannelInput!) {
|
|
289
|
+
createAppMessageChannel(input: $input) {
|
|
290
|
+
${C}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
`;
|
|
294
|
+
var E = `
|
|
295
|
+
query ListAppMessageChannels($filter: ListAppMessageChannelsInput) {
|
|
296
|
+
appMessageChannels(filter: $filter) {
|
|
297
|
+
${C}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
`;
|
|
301
|
+
var O = `
|
|
302
|
+
mutation UpdateAppMessageChannel($input: UpdateAppMessageChannelInput!) {
|
|
303
|
+
updateAppMessageChannel(input: $input) {
|
|
304
|
+
${C}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
var A = `
|
|
309
|
+
mutation DeleteAppMessageChannel($id: UUID!) {
|
|
310
|
+
deleteAppMessageChannel(id: $id) {
|
|
311
|
+
${C}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
`;
|
|
315
|
+
var L = "\n id\n externalId\n name\n isSynced\n messageChannelId\n";
|
|
316
|
+
var R = `
|
|
317
|
+
query ListAppMessageFolders($filter: ListAppMessageFoldersInput) {
|
|
318
|
+
appMessageFolders(filter: $filter) {
|
|
319
|
+
${L}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
`;
|
|
323
|
+
var B = `
|
|
324
|
+
mutation SyncAppMessageFolders($input: SyncAppMessageFoldersInput!) {
|
|
325
|
+
syncAppMessageFolders(input: $input) {
|
|
326
|
+
${L}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
`;
|
|
330
|
+
var U = "agentChatAssistant";
|
|
331
|
+
var ze = S({
|
|
332
|
+
objectNameSingular: U,
|
|
333
|
+
recordId: U,
|
|
334
|
+
displayName: "Ada"
|
|
335
|
+
});
|
|
336
|
+
var Ue = async (e3) => {
|
|
337
|
+
let { enqueueJobs: t3 } = await new o().mutation({ enqueueJobs: {
|
|
338
|
+
__args: { input: e3 },
|
|
339
|
+
enqueued: true,
|
|
340
|
+
logicFunctionUniversalIdentifier: true,
|
|
341
|
+
enqueuedJobsCount: true,
|
|
342
|
+
jobIds: true,
|
|
343
|
+
jobs: {
|
|
344
|
+
jobId: true,
|
|
345
|
+
sizeBytes: true
|
|
346
|
+
},
|
|
347
|
+
availableBytes: true
|
|
348
|
+
} });
|
|
349
|
+
return t3;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
// src/constants/universal-identifiers.ts
|
|
353
|
+
var MEET_IMPORT_CONFERENCE_UNIVERSAL_IDENTIFIER = "7df0892f-dab3-4d16-b22f-fb5902d274e9";
|
|
354
|
+
var MEET_SUMMARIZE_CALL_RECORDING_UNIVERSAL_IDENTIFIER = "707864b1-2b1c-438a-b1b8-f4a0ba99a413";
|
|
355
|
+
var MEET_IMPORT_RECORDING_UNIVERSAL_IDENTIFIER = "b1076ce0-d85c-4270-a420-ed34c2bb5cca";
|
|
356
|
+
|
|
357
|
+
// src/logic-functions/constants/meet-call-summary.constant.ts
|
|
358
|
+
var MEET_CALL_SUMMARY_JOB_RETRY_LIMIT = 2;
|
|
359
|
+
|
|
360
|
+
// src/logic-functions/constants/meet-recording-import.constant.ts
|
|
361
|
+
var MEET_RECORDING_MAX_FILE_SIZE_BYTES = 500 * 1024 * 1024;
|
|
362
|
+
var MEET_RECORDING_TRANSFER_TIMEOUT_MILLISECONDS = 14 * 60 * 1e3;
|
|
363
|
+
var MEET_RECORDING_IMPORT_JOB_RETRY_LIMIT = 2;
|
|
364
|
+
|
|
365
|
+
// src/logic-functions/utils/compute-call-recording-id-for-meet-conference.util.ts
|
|
366
|
+
import { createHash } from "crypto";
|
|
367
|
+
var computeCallRecordingIdForMeetConference = (conferenceRecordName) => {
|
|
368
|
+
const bytes = createHash("sha256").update(`google-meet-conference:${conferenceRecordName}`).digest();
|
|
369
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
370
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
371
|
+
const hexadecimalValue = bytes.subarray(0, 16).toString("hex");
|
|
372
|
+
return `${hexadecimalValue.slice(0, 8)}-${hexadecimalValue.slice(8, 12)}-${hexadecimalValue.slice(12, 16)}-${hexadecimalValue.slice(16, 20)}-${hexadecimalValue.slice(20)}`;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
// src/logic-functions/utils/build-meet-call-summary-job.util.ts
|
|
376
|
+
var buildMeetCallSummaryJob = ({
|
|
377
|
+
conferenceRecordName,
|
|
378
|
+
userWorkspaceId
|
|
379
|
+
}) => {
|
|
380
|
+
const callRecordingId = computeCallRecordingIdForMeetConference(conferenceRecordName);
|
|
381
|
+
return {
|
|
382
|
+
jobId: `google-meet-summary-${callRecordingId}`,
|
|
383
|
+
payload: { callRecordingId, userWorkspaceId }
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
// src/logic-functions/utils/build-meet-recording-import-job.util.ts
|
|
388
|
+
import { createHash as createHash2 } from "crypto";
|
|
389
|
+
|
|
390
|
+
// src/logic-functions/constants/meet-import.constant.ts
|
|
391
|
+
var MILLISECONDS_PER_HOUR = 60 * 60 * 1e3;
|
|
392
|
+
var MILLISECONDS_PER_DAY = 24 * MILLISECONDS_PER_HOUR;
|
|
393
|
+
var MEET_RECENT_CONFERENCE_WINDOW_MILLISECONDS = 50 * MILLISECONDS_PER_HOUR;
|
|
394
|
+
|
|
395
|
+
// src/logic-functions/utils/build-meet-recording-import-job.util.ts
|
|
396
|
+
var buildMeetRecordingImportJob = ({
|
|
397
|
+
connectedAccountId,
|
|
398
|
+
conferenceRecordName,
|
|
399
|
+
recordingName,
|
|
400
|
+
now
|
|
401
|
+
}) => ({
|
|
402
|
+
// One run per recording and hour: the queue keeps a failed job for days, so a fixed id would block later retries.
|
|
403
|
+
jobId: `google-meet-recording-${createHash2("sha256").update(recordingName).digest("hex")}-${Math.floor(now.getTime() / MILLISECONDS_PER_HOUR)}`,
|
|
404
|
+
payload: { connectedAccountId, conferenceRecordName, recordingName }
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
// node_modules/twenty-sdk/dist/utils/index.mjs
|
|
408
|
+
var import_guards2 = __toESM(require_build(), 1);
|
|
409
|
+
var l = (e3) => !(0, import_guards2.isUndefined)(e3) && !(0, import_guards2.isNull)(e3);
|
|
410
|
+
|
|
411
|
+
// src/logic-functions/types/meet-exception.type.ts
|
|
412
|
+
var MeetException = class extends Error {
|
|
413
|
+
constructor({
|
|
414
|
+
message,
|
|
415
|
+
code,
|
|
416
|
+
httpStatus,
|
|
417
|
+
googleStatus
|
|
418
|
+
}) {
|
|
419
|
+
super(message);
|
|
420
|
+
this.name = "MeetException";
|
|
421
|
+
this.code = code;
|
|
422
|
+
this.httpStatus = httpStatus;
|
|
423
|
+
this.googleStatus = googleStatus;
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
// src/logic-functions/utils/get-connection-access-token-or-throw.util.ts
|
|
428
|
+
var getConnectionAccessTokenOrThrow = ({
|
|
429
|
+
id,
|
|
430
|
+
accessToken
|
|
431
|
+
}) => {
|
|
432
|
+
if (!l(accessToken)) {
|
|
433
|
+
throw new MeetException({
|
|
434
|
+
message: `Connection ${id} has no access token`,
|
|
435
|
+
code: "CONNECTION_WITHOUT_ACCESS_TOKEN"
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
return accessToken;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
// src/logic-functions/utils/sync-meet-conference-or-throw.util.ts
|
|
442
|
+
var import_guards20 = __toESM(require_build());
|
|
443
|
+
|
|
444
|
+
// src/logic-functions/utils/build-meet-call-recording-sync-fields.util.ts
|
|
445
|
+
var import_guards3 = __toESM(require_build());
|
|
446
|
+
var buildMeetCallRecordingSyncFields = ({
|
|
447
|
+
conferenceRecord,
|
|
448
|
+
title,
|
|
449
|
+
summaryMarkdown,
|
|
450
|
+
transcriptEntries,
|
|
451
|
+
hasRecordingFile,
|
|
452
|
+
calendarEvent
|
|
453
|
+
}) => {
|
|
454
|
+
return {
|
|
455
|
+
...(0, import_guards3.isNonEmptyString)(title) ? { title } : {},
|
|
456
|
+
status: (0, import_guards3.isNonEmptyArray)(transcriptEntries) || (0, import_guards3.isNonEmptyString)(summaryMarkdown) || hasRecordingFile ? "COMPLETED" : "PROCESSING",
|
|
457
|
+
externalRecordingId: conferenceRecord.name,
|
|
458
|
+
startedAt: conferenceRecord.startTime,
|
|
459
|
+
...(0, import_guards3.isNonEmptyString)(conferenceRecord.endTime) ? { endedAt: conferenceRecord.endTime } : {},
|
|
460
|
+
...(0, import_guards3.isNonEmptyArray)(transcriptEntries) ? { transcript: transcriptEntries } : {},
|
|
461
|
+
...(0, import_guards3.isNonEmptyString)(summaryMarkdown) ? { summary: { blocknote: null, markdown: summaryMarkdown } } : {},
|
|
462
|
+
...l(calendarEvent) ? { calendarEventId: calendarEvent.id } : {}
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
// src/logic-functions/utils/find-meet-calendar-event.util.ts
|
|
467
|
+
var import_guards6 = __toESM(require_build());
|
|
468
|
+
|
|
469
|
+
// src/logic-functions/constants/calendar-event-matching.constant.ts
|
|
470
|
+
var CALENDAR_EVENT_MATCHING_WINDOW_MILLISECONDS = 60 * 60 * 1e3;
|
|
471
|
+
var CALENDAR_EVENT_PAGE_SIZE = 200;
|
|
472
|
+
var MAX_CALENDAR_EVENT_PAGES = 10;
|
|
473
|
+
|
|
474
|
+
// src/logic-functions/utils/list-calendar-events-in-window.util.ts
|
|
475
|
+
var import_guards4 = __toESM(require_build());
|
|
476
|
+
|
|
477
|
+
// src/logic-functions/constants/restricted-field-placeholder.constant.ts
|
|
478
|
+
var RESTRICTED_FIELD_PLACEHOLDER = "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED";
|
|
479
|
+
|
|
480
|
+
// src/logic-functions/utils/escape-sql-like-pattern.util.ts
|
|
481
|
+
var escapeSqlLikePattern = (value) => value.replace(/[\\%_]/g, (wildcard) => `\\${wildcard}`);
|
|
482
|
+
|
|
483
|
+
// src/logic-functions/utils/list-calendar-events-in-window.util.ts
|
|
484
|
+
var listCalendarEventPages = async ({
|
|
485
|
+
coreApiClient,
|
|
486
|
+
earliestStart,
|
|
487
|
+
latestStart,
|
|
488
|
+
conferenceLinkFragment,
|
|
489
|
+
cursor,
|
|
490
|
+
pageIndex
|
|
491
|
+
}) => {
|
|
492
|
+
if (pageIndex >= MAX_CALENDAR_EVENT_PAGES) {
|
|
493
|
+
return void 0;
|
|
494
|
+
}
|
|
495
|
+
const queryResult = await coreApiClient.query({
|
|
496
|
+
calendarEvents: {
|
|
497
|
+
__args: {
|
|
498
|
+
filter: {
|
|
499
|
+
and: [
|
|
500
|
+
{ startsAt: { gte: earliestStart } },
|
|
501
|
+
{ startsAt: { lte: latestStart } },
|
|
502
|
+
{ isCanceled: { eq: false } },
|
|
503
|
+
{
|
|
504
|
+
conferenceLink: {
|
|
505
|
+
primaryLinkUrl: {
|
|
506
|
+
ilike: `%${escapeSqlLikePattern(conferenceLinkFragment)}%`
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
]
|
|
511
|
+
},
|
|
512
|
+
first: CALENDAR_EVENT_PAGE_SIZE,
|
|
513
|
+
...(0, import_guards4.isNonEmptyString)(cursor) ? { after: cursor } : {}
|
|
514
|
+
},
|
|
515
|
+
edges: {
|
|
516
|
+
node: {
|
|
517
|
+
id: true,
|
|
518
|
+
title: true,
|
|
519
|
+
startsAt: true,
|
|
520
|
+
conferenceLink: { primaryLinkUrl: true }
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
pageInfo: { hasNextPage: true, endCursor: true }
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
const nodes = (queryResult.calendarEvents?.edges ?? []).map(
|
|
527
|
+
({ node }) => node
|
|
528
|
+
);
|
|
529
|
+
const calendarEvents = nodes.flatMap(
|
|
530
|
+
({ id, title, startsAt, conferenceLink }) => (0, import_guards4.isNonEmptyString)(startsAt) ? [
|
|
531
|
+
{
|
|
532
|
+
id,
|
|
533
|
+
title: title === RESTRICTED_FIELD_PLACEHOLDER ? null : title ?? null,
|
|
534
|
+
startsAt,
|
|
535
|
+
conferenceLink: conferenceLink ?? null
|
|
536
|
+
}
|
|
537
|
+
] : []
|
|
538
|
+
);
|
|
539
|
+
if (calendarEvents.length !== nodes.length) {
|
|
540
|
+
return void 0;
|
|
541
|
+
}
|
|
542
|
+
const pageInfo = queryResult.calendarEvents?.pageInfo;
|
|
543
|
+
if (!(pageInfo?.hasNextPage ?? false)) {
|
|
544
|
+
return calendarEvents;
|
|
545
|
+
}
|
|
546
|
+
if (!(0, import_guards4.isNonEmptyString)(pageInfo?.endCursor)) {
|
|
547
|
+
return void 0;
|
|
548
|
+
}
|
|
549
|
+
const followingCalendarEvents = await listCalendarEventPages({
|
|
550
|
+
coreApiClient,
|
|
551
|
+
earliestStart,
|
|
552
|
+
latestStart,
|
|
553
|
+
conferenceLinkFragment,
|
|
554
|
+
cursor: pageInfo.endCursor,
|
|
555
|
+
pageIndex: pageIndex + 1
|
|
556
|
+
});
|
|
557
|
+
return l(followingCalendarEvents) ? [...calendarEvents, ...followingCalendarEvents] : void 0;
|
|
558
|
+
};
|
|
559
|
+
var listCalendarEventsInWindow = ({
|
|
560
|
+
coreApiClient,
|
|
561
|
+
earliestStart,
|
|
562
|
+
latestStart,
|
|
563
|
+
conferenceLinkFragment
|
|
564
|
+
}) => listCalendarEventPages({
|
|
565
|
+
coreApiClient,
|
|
566
|
+
earliestStart,
|
|
567
|
+
latestStart,
|
|
568
|
+
conferenceLinkFragment,
|
|
569
|
+
cursor: void 0,
|
|
570
|
+
pageIndex: 0
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
// src/logic-functions/utils/normalize-meeting-url.util.ts
|
|
574
|
+
var import_guards5 = __toESM(require_build());
|
|
575
|
+
var normalizeMeetingUrl = (meetingUrl) => {
|
|
576
|
+
if (!(0, import_guards5.isNonEmptyString)(meetingUrl) || !URL.canParse(meetingUrl)) {
|
|
577
|
+
return void 0;
|
|
578
|
+
}
|
|
579
|
+
const parsedUrl = new URL(meetingUrl);
|
|
580
|
+
parsedUrl.hash = "";
|
|
581
|
+
parsedUrl.search = "";
|
|
582
|
+
parsedUrl.hostname = parsedUrl.hostname.toLowerCase().replace(/^www\./, "");
|
|
583
|
+
parsedUrl.pathname = parsedUrl.pathname.replace(/\/+$/, "");
|
|
584
|
+
return parsedUrl.toString();
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
// src/logic-functions/utils/find-meet-calendar-event.util.ts
|
|
588
|
+
var findMeetCalendarEvent = async ({
|
|
589
|
+
coreApiClient,
|
|
590
|
+
conferenceRecord,
|
|
591
|
+
space
|
|
592
|
+
}) => {
|
|
593
|
+
const meetingUrl = normalizeMeetingUrl(space.meetingUri);
|
|
594
|
+
if (!l(meetingUrl)) {
|
|
595
|
+
return void 0;
|
|
596
|
+
}
|
|
597
|
+
const meetingCode = meetingUrl.slice(meetingUrl.lastIndexOf("/") + 1);
|
|
598
|
+
if (!(0, import_guards6.isNonEmptyString)(meetingCode)) {
|
|
599
|
+
return void 0;
|
|
600
|
+
}
|
|
601
|
+
const conferenceStartMilliseconds = Date.parse(conferenceRecord.startTime);
|
|
602
|
+
const calendarEvents = await listCalendarEventsInWindow({
|
|
603
|
+
coreApiClient,
|
|
604
|
+
earliestStart: new Date(
|
|
605
|
+
conferenceStartMilliseconds - CALENDAR_EVENT_MATCHING_WINDOW_MILLISECONDS
|
|
606
|
+
).toISOString(),
|
|
607
|
+
latestStart: new Date(
|
|
608
|
+
conferenceStartMilliseconds + CALENDAR_EVENT_MATCHING_WINDOW_MILLISECONDS
|
|
609
|
+
).toISOString(),
|
|
610
|
+
conferenceLinkFragment: meetingCode
|
|
611
|
+
});
|
|
612
|
+
if (!l(calendarEvents)) {
|
|
613
|
+
return void 0;
|
|
614
|
+
}
|
|
615
|
+
const [closestCandidate, nextCandidate] = calendarEvents.filter(
|
|
616
|
+
({ conferenceLink }) => normalizeMeetingUrl(conferenceLink?.primaryLinkUrl) === meetingUrl
|
|
617
|
+
).map(({ id, title, startsAt }) => ({
|
|
618
|
+
id,
|
|
619
|
+
title,
|
|
620
|
+
startDifference: Math.abs(
|
|
621
|
+
Date.parse(startsAt) - conferenceStartMilliseconds
|
|
622
|
+
)
|
|
623
|
+
})).sort(
|
|
624
|
+
(firstCandidate, secondCandidate) => firstCandidate.startDifference - secondCandidate.startDifference
|
|
625
|
+
);
|
|
626
|
+
if (!l(closestCandidate) || closestCandidate.startDifference === nextCandidate?.startDifference) {
|
|
627
|
+
return void 0;
|
|
628
|
+
}
|
|
629
|
+
return { id: closestCandidate.id, title: closestCandidate.title };
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
// src/logic-functions/utils/find-meet-conference-title.util.ts
|
|
633
|
+
var import_guards11 = __toESM(require_build());
|
|
634
|
+
|
|
635
|
+
// src/logic-functions/utils/extract-meet-name-from-doc-title.util.ts
|
|
636
|
+
var import_guards7 = __toESM(require_build());
|
|
637
|
+
var extractMeetNameFromDocTitle = (docTitle) => {
|
|
638
|
+
if (!(0, import_guards7.isNonEmptyString)(docTitle)) {
|
|
639
|
+
return void 0;
|
|
640
|
+
}
|
|
641
|
+
const suffixStart = docTitle.lastIndexOf(" - ");
|
|
642
|
+
const meetingName = (suffixStart === -1 ? docTitle : docTitle.slice(0, suffixStart)).trim();
|
|
643
|
+
return (0, import_guards7.isNonEmptyString)(meetingName) ? meetingName : void 0;
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
// src/logic-functions/constants/google-docs-api.constant.ts
|
|
647
|
+
var GOOGLE_DOCS_API_BASE_URL = "https://docs.googleapis.com/v1";
|
|
648
|
+
var GOOGLE_DOC_UNREADABLE_STATUSES = /* @__PURE__ */ new Set([403, 404]);
|
|
649
|
+
var GOOGLE_DOC_ORDERED_GLYPH_TYPES = /* @__PURE__ */ new Set([
|
|
650
|
+
"DECIMAL",
|
|
651
|
+
"ZERO_DECIMAL",
|
|
652
|
+
"UPPER_ALPHA",
|
|
653
|
+
"ALPHA",
|
|
654
|
+
"UPPER_ROMAN",
|
|
655
|
+
"ROMAN"
|
|
656
|
+
]);
|
|
657
|
+
|
|
658
|
+
// src/logic-functions/utils/build-google-api-url-or-throw.util.ts
|
|
659
|
+
var import_guards8 = __toESM(require_build());
|
|
660
|
+
var buildGoogleApiUrlOrThrow = ({
|
|
661
|
+
baseUrl,
|
|
662
|
+
path,
|
|
663
|
+
queryParameters
|
|
664
|
+
}) => {
|
|
665
|
+
const url = new URL(`${baseUrl}/${path}`);
|
|
666
|
+
if (!url.href.startsWith(`${baseUrl}/`)) {
|
|
667
|
+
throw new MeetException({
|
|
668
|
+
message: `Google resource paths must stay under ${baseUrl}`,
|
|
669
|
+
code: "INVALID_RESOURCE_PATH"
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
for (const [name, value] of Object.entries(queryParameters)) {
|
|
673
|
+
if ((0, import_guards8.isNonEmptyString)(value)) {
|
|
674
|
+
url.searchParams.set(name, value);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
return url.toString();
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
// src/logic-functions/utils/fetch-meet-json.util.ts
|
|
681
|
+
var import_guards10 = __toESM(require_build());
|
|
682
|
+
|
|
683
|
+
// src/logic-functions/constants/meet-api.constant.ts
|
|
684
|
+
var MEET_API_BASE_URL = "https://meet.googleapis.com/v2";
|
|
685
|
+
var MEET_REQUEST_MAX_ATTEMPTS = 4;
|
|
686
|
+
var MEET_REQUEST_RETRY_BASE_DELAY_MILLISECONDS = 1e3;
|
|
687
|
+
var MEET_REQUEST_RETRY_BUDGET_MILLISECONDS = 8e3;
|
|
688
|
+
var MEET_RETRYABLE_STATUSES = /* @__PURE__ */ new Set([
|
|
689
|
+
429,
|
|
690
|
+
500,
|
|
691
|
+
502,
|
|
692
|
+
503,
|
|
693
|
+
504
|
|
694
|
+
]);
|
|
695
|
+
var MEET_LIST_PAGE_SIZE = 100;
|
|
696
|
+
var MAX_MEET_LIST_PAGES = 50;
|
|
697
|
+
|
|
698
|
+
// src/logic-functions/utils/parse-retry-after-milliseconds.util.ts
|
|
699
|
+
var import_guards9 = __toESM(require_build());
|
|
700
|
+
var parseRetryAfterMilliseconds = ({
|
|
701
|
+
retryAfter,
|
|
702
|
+
now
|
|
703
|
+
}) => {
|
|
704
|
+
if (!(0, import_guards9.isNonEmptyString)(retryAfter)) {
|
|
705
|
+
return void 0;
|
|
706
|
+
}
|
|
707
|
+
const seconds = Number(retryAfter);
|
|
708
|
+
if (Number.isFinite(seconds)) {
|
|
709
|
+
return seconds > 0 ? seconds * 1e3 : void 0;
|
|
710
|
+
}
|
|
711
|
+
const retryAt = Date.parse(retryAfter);
|
|
712
|
+
if (Number.isNaN(retryAt) || retryAt <= now.getTime()) {
|
|
713
|
+
return void 0;
|
|
714
|
+
}
|
|
715
|
+
return retryAt - now.getTime();
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
// src/logic-functions/utils/sleep-for-milliseconds.util.ts
|
|
719
|
+
var sleepForMilliseconds = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
720
|
+
|
|
721
|
+
// src/logic-functions/utils/fetch-meet-json.util.ts
|
|
722
|
+
var fetchMeetResponseWithRetriesOrThrow = async ({
|
|
723
|
+
accessToken,
|
|
724
|
+
url,
|
|
725
|
+
method,
|
|
726
|
+
body,
|
|
727
|
+
attempt,
|
|
728
|
+
waitedMilliseconds
|
|
729
|
+
}) => {
|
|
730
|
+
const response = await fetch(url, {
|
|
731
|
+
method,
|
|
732
|
+
redirect: "error",
|
|
733
|
+
headers: {
|
|
734
|
+
Authorization: `Bearer ${accessToken}`,
|
|
735
|
+
Accept: "application/json",
|
|
736
|
+
...l(body) ? { "Content-Type": "application/json" } : {}
|
|
737
|
+
},
|
|
738
|
+
body: l(body) ? JSON.stringify(body) : void 0
|
|
739
|
+
});
|
|
740
|
+
if (response.ok) {
|
|
741
|
+
return response;
|
|
742
|
+
}
|
|
743
|
+
const retryDelayMilliseconds = parseRetryAfterMilliseconds({
|
|
744
|
+
retryAfter: response.headers.get("Retry-After"),
|
|
745
|
+
now: /* @__PURE__ */ new Date()
|
|
746
|
+
}) ?? MEET_REQUEST_RETRY_BASE_DELAY_MILLISECONDS * 2 ** attempt;
|
|
747
|
+
if (method !== "POST" && MEET_RETRYABLE_STATUSES.has(response.status) && attempt + 1 < MEET_REQUEST_MAX_ATTEMPTS && waitedMilliseconds + retryDelayMilliseconds <= MEET_REQUEST_RETRY_BUDGET_MILLISECONDS) {
|
|
748
|
+
await sleepForMilliseconds(retryDelayMilliseconds);
|
|
749
|
+
return fetchMeetResponseWithRetriesOrThrow({
|
|
750
|
+
accessToken,
|
|
751
|
+
url,
|
|
752
|
+
method,
|
|
753
|
+
body,
|
|
754
|
+
attempt: attempt + 1,
|
|
755
|
+
waitedMilliseconds: waitedMilliseconds + retryDelayMilliseconds
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
const errorBody = await response.json().catch(() => ({}));
|
|
759
|
+
const googleStatus = (0, import_guards10.isNonEmptyString)(errorBody.error?.status) ? errorBody.error.status : void 0;
|
|
760
|
+
const message = (0, import_guards10.isNonEmptyString)(errorBody.error?.message) ? errorBody.error.message : response.statusText;
|
|
761
|
+
throw new MeetException({
|
|
762
|
+
message: `Google Meet request failed (${response.status}${(0, import_guards10.isNonEmptyString)(googleStatus) ? ` ${googleStatus}` : ""}): ${message}`,
|
|
763
|
+
code: "REQUEST_FAILED",
|
|
764
|
+
httpStatus: response.status,
|
|
765
|
+
googleStatus
|
|
766
|
+
});
|
|
767
|
+
};
|
|
768
|
+
var fetchMeetJson = async (request) => {
|
|
769
|
+
const response = await fetchMeetResponseWithRetriesOrThrow({
|
|
770
|
+
...request,
|
|
771
|
+
attempt: 0,
|
|
772
|
+
waitedMilliseconds: 0
|
|
773
|
+
});
|
|
774
|
+
const responseBody = await response.json();
|
|
775
|
+
return responseBody;
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
// src/logic-functions/utils/is-google-doc-unreadable-error.util.ts
|
|
779
|
+
var isGoogleDocUnreadableError = (error) => error instanceof MeetException && l(error.httpStatus) && GOOGLE_DOC_UNREADABLE_STATUSES.has(error.httpStatus);
|
|
780
|
+
|
|
781
|
+
// src/logic-functions/utils/get-google-doc-title.util.ts
|
|
782
|
+
var getGoogleDocTitle = async ({
|
|
783
|
+
accessToken,
|
|
784
|
+
documentId
|
|
785
|
+
}) => {
|
|
786
|
+
try {
|
|
787
|
+
const document = await fetchMeetJson({
|
|
788
|
+
accessToken,
|
|
789
|
+
url: buildGoogleApiUrlOrThrow({
|
|
790
|
+
baseUrl: GOOGLE_DOCS_API_BASE_URL,
|
|
791
|
+
path: `documents/${documentId}`,
|
|
792
|
+
queryParameters: { fields: "title" }
|
|
793
|
+
})
|
|
794
|
+
});
|
|
795
|
+
return document.title;
|
|
796
|
+
} catch (error) {
|
|
797
|
+
if (isGoogleDocUnreadableError(error)) {
|
|
798
|
+
return void 0;
|
|
799
|
+
}
|
|
800
|
+
throw error;
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
// src/logic-functions/utils/find-meet-conference-title.util.ts
|
|
805
|
+
var findMeetConferenceTitle = async ({
|
|
806
|
+
accessToken,
|
|
807
|
+
calendarEvent,
|
|
808
|
+
artifacts
|
|
809
|
+
}) => {
|
|
810
|
+
const calendarEventTitle = calendarEvent?.title?.trim();
|
|
811
|
+
if ((0, import_guards11.isNonEmptyString)(calendarEventTitle)) {
|
|
812
|
+
return calendarEventTitle;
|
|
813
|
+
}
|
|
814
|
+
const documentId = artifacts.map(({ docsDestination }) => docsDestination?.document).find(import_guards11.isNonEmptyString);
|
|
815
|
+
if (!(0, import_guards11.isNonEmptyString)(documentId)) {
|
|
816
|
+
return void 0;
|
|
817
|
+
}
|
|
818
|
+
return extractMeetNameFromDocTitle(
|
|
819
|
+
await getGoogleDocTitle({ accessToken, documentId })
|
|
820
|
+
);
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
// src/logic-functions/utils/find-meet-smart-notes-markdown.util.ts
|
|
824
|
+
var import_guards15 = __toESM(require_build());
|
|
825
|
+
|
|
826
|
+
// src/logic-functions/utils/convert-google-doc-paragraph-to-markdown.util.ts
|
|
827
|
+
var import_guards14 = __toESM(require_build());
|
|
828
|
+
|
|
829
|
+
// src/logic-functions/utils/build-google-doc-markdown-segment.util.ts
|
|
830
|
+
var import_guards12 = __toESM(require_build());
|
|
831
|
+
|
|
832
|
+
// src/logic-functions/utils/escape-markdown-text.util.ts
|
|
833
|
+
var MARKDOWN_SPECIAL_CHARACTER_PATTERN = /[\\`*_[\]]/g;
|
|
834
|
+
var escapeMarkdownText = (text) => text.replace(MARKDOWN_SPECIAL_CHARACTER_PATTERN, "\\$&");
|
|
835
|
+
|
|
836
|
+
// src/logic-functions/utils/split-surrounding-whitespace.util.ts
|
|
837
|
+
var SURROUNDING_WHITESPACE_PATTERN = /^(\s*)([\s\S]*?)(\s*)$/;
|
|
838
|
+
var splitSurroundingWhitespace = (text) => {
|
|
839
|
+
const [, leading = "", content = "", trailing = ""] = SURROUNDING_WHITESPACE_PATTERN.exec(text) ?? [];
|
|
840
|
+
return { leading, content, trailing };
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
// src/logic-functions/utils/build-google-doc-markdown-segment.util.ts
|
|
844
|
+
var linkMarkdownText = ({
|
|
845
|
+
text,
|
|
846
|
+
url
|
|
847
|
+
}) => {
|
|
848
|
+
const { leading, content, trailing } = splitSurroundingWhitespace(text);
|
|
849
|
+
if (!(0, import_guards12.isNonEmptyString)(url) || !(0, import_guards12.isNonEmptyString)(content)) {
|
|
850
|
+
return text;
|
|
851
|
+
}
|
|
852
|
+
return `${leading}[${content}](${url})${trailing}`;
|
|
853
|
+
};
|
|
854
|
+
var buildGoogleDocMarkdownSegment = (element) => {
|
|
855
|
+
if (l(element.textRun)) {
|
|
856
|
+
const { content, textStyle } = element.textRun;
|
|
857
|
+
return {
|
|
858
|
+
markdown: linkMarkdownText({
|
|
859
|
+
text: escapeMarkdownText(
|
|
860
|
+
(content ?? "").replace(/\n/g, "").replace(/\u000b/g, "\n")
|
|
861
|
+
),
|
|
862
|
+
url: textStyle?.link?.url
|
|
863
|
+
}),
|
|
864
|
+
isBold: textStyle?.bold,
|
|
865
|
+
isItalic: textStyle?.italic
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
const personProperties = element.person?.personProperties;
|
|
869
|
+
if (l(personProperties)) {
|
|
870
|
+
return {
|
|
871
|
+
markdown: escapeMarkdownText(
|
|
872
|
+
personProperties.name ?? personProperties.email ?? ""
|
|
873
|
+
)
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
const richLinkProperties = element.richLink?.richLinkProperties;
|
|
877
|
+
if ((0, import_guards12.isNonEmptyString)(richLinkProperties?.uri)) {
|
|
878
|
+
return {
|
|
879
|
+
markdown: linkMarkdownText({
|
|
880
|
+
text: escapeMarkdownText(
|
|
881
|
+
richLinkProperties.title ?? richLinkProperties.uri
|
|
882
|
+
),
|
|
883
|
+
url: richLinkProperties.uri
|
|
884
|
+
})
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
return { markdown: "" };
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
// src/logic-functions/utils/join-google-doc-markdown-segments.util.ts
|
|
891
|
+
var import_guards13 = __toESM(require_build());
|
|
892
|
+
var BOLD_MARKER = "**";
|
|
893
|
+
var ITALIC_MARKER = "*";
|
|
894
|
+
var closeMarkerBeforeTrailingWhitespace = ({
|
|
895
|
+
markdown,
|
|
896
|
+
marker,
|
|
897
|
+
shouldClose
|
|
898
|
+
}) => {
|
|
899
|
+
if (!shouldClose) {
|
|
900
|
+
return markdown;
|
|
901
|
+
}
|
|
902
|
+
const { trailing } = splitSurroundingWhitespace(markdown);
|
|
903
|
+
return `${markdown.slice(0, markdown.length - trailing.length)}${marker}${trailing}`;
|
|
904
|
+
};
|
|
905
|
+
var switchEmphasis = ({
|
|
906
|
+
joined,
|
|
907
|
+
isBold,
|
|
908
|
+
isItalic
|
|
909
|
+
}) => {
|
|
910
|
+
const shouldCloseBold = joined.isBold && (!isBold || joined.isItalic !== isItalic);
|
|
911
|
+
const shouldOpenItalic = isItalic && !joined.isItalic;
|
|
912
|
+
const shouldOpenBold = isBold && (!joined.isBold || shouldCloseBold);
|
|
913
|
+
const closedMarkdown = closeMarkerBeforeTrailingWhitespace({
|
|
914
|
+
markdown: closeMarkerBeforeTrailingWhitespace({
|
|
915
|
+
markdown: joined.markdown,
|
|
916
|
+
marker: BOLD_MARKER,
|
|
917
|
+
shouldClose: shouldCloseBold
|
|
918
|
+
}),
|
|
919
|
+
marker: ITALIC_MARKER,
|
|
920
|
+
shouldClose: joined.isItalic && !isItalic
|
|
921
|
+
});
|
|
922
|
+
return {
|
|
923
|
+
closedMarkdown,
|
|
924
|
+
openingMarkers: `${shouldOpenItalic ? ITALIC_MARKER : ""}${shouldOpenBold ? BOLD_MARKER : ""}`
|
|
925
|
+
};
|
|
926
|
+
};
|
|
927
|
+
var appendSegment = ({
|
|
928
|
+
joined,
|
|
929
|
+
segment
|
|
930
|
+
}) => {
|
|
931
|
+
const { leading, content, trailing } = splitSurroundingWhitespace(
|
|
932
|
+
segment.markdown
|
|
933
|
+
);
|
|
934
|
+
if (!(0, import_guards13.isNonEmptyString)(content)) {
|
|
935
|
+
return { ...joined, markdown: `${joined.markdown}${segment.markdown}` };
|
|
936
|
+
}
|
|
937
|
+
const isBold = segment.isBold ?? false;
|
|
938
|
+
const isItalic = segment.isItalic ?? false;
|
|
939
|
+
const { closedMarkdown, openingMarkers } = switchEmphasis({
|
|
940
|
+
joined,
|
|
941
|
+
isBold,
|
|
942
|
+
isItalic
|
|
943
|
+
});
|
|
944
|
+
return {
|
|
945
|
+
markdown: `${closedMarkdown}${leading}${openingMarkers}${content}${trailing}`,
|
|
946
|
+
isBold,
|
|
947
|
+
isItalic
|
|
948
|
+
};
|
|
949
|
+
};
|
|
950
|
+
var joinGoogleDocMarkdownSegments = (segments) => {
|
|
951
|
+
const joined = segments.reduce(
|
|
952
|
+
(joinedSoFar, segment) => appendSegment({ joined: joinedSoFar, segment }),
|
|
953
|
+
{ markdown: "", isBold: false, isItalic: false }
|
|
954
|
+
);
|
|
955
|
+
return switchEmphasis({ joined, isBold: false, isItalic: false }).closedMarkdown;
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
// src/logic-functions/utils/convert-google-doc-paragraph-to-markdown.util.ts
|
|
959
|
+
var HEADING_STYLE_PATTERN = /^HEADING_([1-6])$/;
|
|
960
|
+
var getHeadingPrefix = (namedStyleType) => {
|
|
961
|
+
if (namedStyleType === "TITLE") {
|
|
962
|
+
return "# ";
|
|
963
|
+
}
|
|
964
|
+
const headingLevel = HEADING_STYLE_PATTERN.exec(namedStyleType ?? "")?.[1];
|
|
965
|
+
return l(headingLevel) ? `${"#".repeat(Number(headingLevel))} ` : "";
|
|
966
|
+
};
|
|
967
|
+
var getBulletPrefix = ({
|
|
968
|
+
bullet,
|
|
969
|
+
lists
|
|
970
|
+
}) => {
|
|
971
|
+
if (!l(bullet)) {
|
|
972
|
+
return "";
|
|
973
|
+
}
|
|
974
|
+
const nestingLevel = bullet.nestingLevel ?? 0;
|
|
975
|
+
const indentation = " ".repeat(nestingLevel);
|
|
976
|
+
const glyphType = lists[bullet.listId]?.listProperties?.nestingLevels?.[nestingLevel]?.glyphType;
|
|
977
|
+
if (l(glyphType) && GOOGLE_DOC_ORDERED_GLYPH_TYPES.has(glyphType)) {
|
|
978
|
+
return `${indentation}1. `;
|
|
979
|
+
}
|
|
980
|
+
return `${indentation}- `;
|
|
981
|
+
};
|
|
982
|
+
var convertGoogleDocParagraphToMarkdown = ({
|
|
983
|
+
paragraph,
|
|
984
|
+
lists
|
|
985
|
+
}) => {
|
|
986
|
+
const text = joinGoogleDocMarkdownSegments(
|
|
987
|
+
(paragraph.elements ?? []).map(buildGoogleDocMarkdownSegment)
|
|
988
|
+
).trim();
|
|
989
|
+
if (!(0, import_guards14.isNonEmptyString)(text)) {
|
|
990
|
+
return void 0;
|
|
991
|
+
}
|
|
992
|
+
return `${getBulletPrefix({ bullet: paragraph.bullet, lists })}${getHeadingPrefix(paragraph.paragraphStyle?.namedStyleType)}${text}`;
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
// src/logic-functions/utils/convert-google-doc-tab-to-markdown.util.ts
|
|
996
|
+
var getBlockSeparator = ({
|
|
997
|
+
previousBlock,
|
|
998
|
+
block
|
|
999
|
+
}) => {
|
|
1000
|
+
if (!l(previousBlock)) {
|
|
1001
|
+
return "";
|
|
1002
|
+
}
|
|
1003
|
+
return previousBlock.isListItem && block.isListItem ? "\n" : "\n\n";
|
|
1004
|
+
};
|
|
1005
|
+
var convertGoogleDocTabToMarkdown = (tab) => {
|
|
1006
|
+
const lists = tab.documentTab?.lists ?? {};
|
|
1007
|
+
const blocks = (tab.documentTab?.body?.content ?? []).flatMap(
|
|
1008
|
+
({ paragraph }) => {
|
|
1009
|
+
if (!l(paragraph)) {
|
|
1010
|
+
return [];
|
|
1011
|
+
}
|
|
1012
|
+
const markdown = convertGoogleDocParagraphToMarkdown({
|
|
1013
|
+
paragraph,
|
|
1014
|
+
lists
|
|
1015
|
+
});
|
|
1016
|
+
if (!l(markdown)) {
|
|
1017
|
+
return [];
|
|
1018
|
+
}
|
|
1019
|
+
return [{ markdown, isListItem: l(paragraph.bullet) }];
|
|
1020
|
+
}
|
|
1021
|
+
);
|
|
1022
|
+
return blocks.map(
|
|
1023
|
+
(block, index) => `${getBlockSeparator({ previousBlock: blocks[index - 1], block })}${block.markdown}`
|
|
1024
|
+
).join("");
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
// src/logic-functions/utils/get-google-doc.util.ts
|
|
1028
|
+
var getGoogleDoc = async ({
|
|
1029
|
+
accessToken,
|
|
1030
|
+
documentId
|
|
1031
|
+
}) => {
|
|
1032
|
+
try {
|
|
1033
|
+
return await fetchMeetJson({
|
|
1034
|
+
accessToken,
|
|
1035
|
+
url: buildGoogleApiUrlOrThrow({
|
|
1036
|
+
baseUrl: GOOGLE_DOCS_API_BASE_URL,
|
|
1037
|
+
path: `documents/${documentId}`,
|
|
1038
|
+
queryParameters: { includeTabsContent: "true" }
|
|
1039
|
+
})
|
|
1040
|
+
});
|
|
1041
|
+
} catch (error) {
|
|
1042
|
+
if (isGoogleDocUnreadableError(error)) {
|
|
1043
|
+
return void 0;
|
|
1044
|
+
}
|
|
1045
|
+
throw error;
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
// src/logic-functions/utils/find-meet-smart-notes-markdown.util.ts
|
|
1050
|
+
var findMeetSmartNotesMarkdown = async ({
|
|
1051
|
+
accessToken,
|
|
1052
|
+
smartNotes
|
|
1053
|
+
}) => {
|
|
1054
|
+
const documentId = smartNotes.map(({ docsDestination }) => docsDestination?.document).find(import_guards15.isNonEmptyString);
|
|
1055
|
+
if (!(0, import_guards15.isNonEmptyString)(documentId)) {
|
|
1056
|
+
return void 0;
|
|
1057
|
+
}
|
|
1058
|
+
const [notesTab] = (await getGoogleDoc({ accessToken, documentId }))?.tabs ?? [];
|
|
1059
|
+
if (!l(notesTab)) {
|
|
1060
|
+
return void 0;
|
|
1061
|
+
}
|
|
1062
|
+
const markdown = convertGoogleDocTabToMarkdown(notesTab);
|
|
1063
|
+
return (0, import_guards15.isNonEmptyString)(markdown) ? markdown : void 0;
|
|
1064
|
+
};
|
|
1065
|
+
|
|
1066
|
+
// src/logic-functions/utils/build-meet-url-or-throw.util.ts
|
|
1067
|
+
var buildMeetUrlOrThrow = ({
|
|
1068
|
+
path,
|
|
1069
|
+
queryParameters
|
|
1070
|
+
}) => buildGoogleApiUrlOrThrow({
|
|
1071
|
+
baseUrl: MEET_API_BASE_URL,
|
|
1072
|
+
path,
|
|
1073
|
+
queryParameters
|
|
1074
|
+
});
|
|
1075
|
+
|
|
1076
|
+
// src/logic-functions/utils/get-meet-space.util.ts
|
|
1077
|
+
var getMeetSpace = ({
|
|
1078
|
+
accessToken,
|
|
1079
|
+
spaceName
|
|
1080
|
+
}) => fetchMeetJson({
|
|
1081
|
+
accessToken,
|
|
1082
|
+
url: buildMeetUrlOrThrow({ path: spaceName, queryParameters: {} })
|
|
1083
|
+
});
|
|
1084
|
+
|
|
1085
|
+
// src/logic-functions/utils/list-meet-collection.util.ts
|
|
1086
|
+
var import_guards16 = __toESM(require_build());
|
|
1087
|
+
var listMeetCollectionPagesOrThrow = async ({
|
|
1088
|
+
accessToken,
|
|
1089
|
+
path,
|
|
1090
|
+
collectionKey,
|
|
1091
|
+
filter,
|
|
1092
|
+
pageToken,
|
|
1093
|
+
pageIndex
|
|
1094
|
+
}) => {
|
|
1095
|
+
if (pageIndex >= MAX_MEET_LIST_PAGES) {
|
|
1096
|
+
throw new MeetException({
|
|
1097
|
+
message: `Google Meet ${collectionKey} pagination exceeded its limit`,
|
|
1098
|
+
code: "PAGINATION_LIMIT_EXCEEDED"
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
const page = await fetchMeetJson({
|
|
1102
|
+
accessToken,
|
|
1103
|
+
url: buildMeetUrlOrThrow({
|
|
1104
|
+
path,
|
|
1105
|
+
queryParameters: {
|
|
1106
|
+
filter,
|
|
1107
|
+
pageSize: String(MEET_LIST_PAGE_SIZE),
|
|
1108
|
+
pageToken
|
|
1109
|
+
}
|
|
1110
|
+
})
|
|
1111
|
+
});
|
|
1112
|
+
const items = page[collectionKey] ?? [];
|
|
1113
|
+
if (!(0, import_guards16.isNonEmptyString)(page.nextPageToken)) {
|
|
1114
|
+
return items;
|
|
1115
|
+
}
|
|
1116
|
+
return [
|
|
1117
|
+
...items,
|
|
1118
|
+
...await listMeetCollectionPagesOrThrow({
|
|
1119
|
+
accessToken,
|
|
1120
|
+
path,
|
|
1121
|
+
collectionKey,
|
|
1122
|
+
filter,
|
|
1123
|
+
pageToken: page.nextPageToken,
|
|
1124
|
+
pageIndex: pageIndex + 1
|
|
1125
|
+
})
|
|
1126
|
+
];
|
|
1127
|
+
};
|
|
1128
|
+
var listMeetCollection = (request) => listMeetCollectionPagesOrThrow({
|
|
1129
|
+
...request,
|
|
1130
|
+
pageToken: void 0,
|
|
1131
|
+
pageIndex: 0
|
|
1132
|
+
});
|
|
1133
|
+
|
|
1134
|
+
// src/logic-functions/utils/list-meet-participants.util.ts
|
|
1135
|
+
var listMeetParticipants = ({
|
|
1136
|
+
accessToken,
|
|
1137
|
+
conferenceRecordName
|
|
1138
|
+
}) => listMeetCollection({
|
|
1139
|
+
accessToken,
|
|
1140
|
+
path: `${conferenceRecordName}/participants`,
|
|
1141
|
+
collectionKey: "participants"
|
|
1142
|
+
});
|
|
1143
|
+
|
|
1144
|
+
// src/logic-functions/utils/list-meet-recordings.util.ts
|
|
1145
|
+
var listMeetRecordings = ({
|
|
1146
|
+
accessToken,
|
|
1147
|
+
conferenceRecordName
|
|
1148
|
+
}) => listMeetCollection({
|
|
1149
|
+
accessToken,
|
|
1150
|
+
path: `${conferenceRecordName}/recordings`,
|
|
1151
|
+
collectionKey: "recordings"
|
|
1152
|
+
});
|
|
1153
|
+
|
|
1154
|
+
// src/logic-functions/utils/list-meet-smart-notes.util.ts
|
|
1155
|
+
var listMeetSmartNotes = ({
|
|
1156
|
+
accessToken,
|
|
1157
|
+
conferenceRecordName
|
|
1158
|
+
}) => listMeetCollection({
|
|
1159
|
+
accessToken,
|
|
1160
|
+
path: `${conferenceRecordName}/smartNotes`,
|
|
1161
|
+
collectionKey: "smartNotes"
|
|
1162
|
+
});
|
|
1163
|
+
|
|
1164
|
+
// src/logic-functions/utils/list-meet-transcript-entries.util.ts
|
|
1165
|
+
var listMeetTranscriptEntries = ({
|
|
1166
|
+
accessToken,
|
|
1167
|
+
transcriptName
|
|
1168
|
+
}) => listMeetCollection({
|
|
1169
|
+
accessToken,
|
|
1170
|
+
path: `${transcriptName}/entries`,
|
|
1171
|
+
collectionKey: "transcriptEntries"
|
|
1172
|
+
});
|
|
1173
|
+
|
|
1174
|
+
// src/logic-functions/utils/list-meet-transcripts.util.ts
|
|
1175
|
+
var listMeetTranscripts = ({
|
|
1176
|
+
accessToken,
|
|
1177
|
+
conferenceRecordName
|
|
1178
|
+
}) => listMeetCollection({
|
|
1179
|
+
accessToken,
|
|
1180
|
+
path: `${conferenceRecordName}/transcripts`,
|
|
1181
|
+
collectionKey: "transcripts"
|
|
1182
|
+
});
|
|
1183
|
+
|
|
1184
|
+
// src/logic-functions/utils/map-meet-transcript-entries.util.ts
|
|
1185
|
+
var import_guards18 = __toESM(require_build());
|
|
1186
|
+
|
|
1187
|
+
// src/logic-functions/utils/get-meet-participant-display-name.util.ts
|
|
1188
|
+
var import_guards17 = __toESM(require_build());
|
|
1189
|
+
var getMeetParticipantDisplayName = ({
|
|
1190
|
+
signedinUser,
|
|
1191
|
+
anonymousUser,
|
|
1192
|
+
phoneUser
|
|
1193
|
+
}) => {
|
|
1194
|
+
const displayName = (signedinUser?.displayName ?? anonymousUser?.displayName ?? phoneUser?.displayName)?.trim();
|
|
1195
|
+
return (0, import_guards17.isNonEmptyString)(displayName) ? displayName : null;
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
// src/logic-functions/utils/map-meet-transcript-entries.util.ts
|
|
1199
|
+
var mapMeetTranscriptEntries = ({
|
|
1200
|
+
conferenceRecord,
|
|
1201
|
+
participants,
|
|
1202
|
+
transcriptEntries
|
|
1203
|
+
}) => {
|
|
1204
|
+
const conferenceStartMilliseconds = Date.parse(conferenceRecord.startTime);
|
|
1205
|
+
const displayNameByParticipantName = new Map(
|
|
1206
|
+
participants.map((participant) => [
|
|
1207
|
+
participant.name,
|
|
1208
|
+
getMeetParticipantDisplayName(participant)
|
|
1209
|
+
])
|
|
1210
|
+
);
|
|
1211
|
+
return transcriptEntries.flatMap(({ participant, text, startTime }) => {
|
|
1212
|
+
const trimmedText = text?.trim();
|
|
1213
|
+
const startMilliseconds = Date.parse(startTime ?? "");
|
|
1214
|
+
if (!(0, import_guards18.isNonEmptyString)(trimmedText) || Number.isNaN(startMilliseconds)) {
|
|
1215
|
+
return [];
|
|
1216
|
+
}
|
|
1217
|
+
return [
|
|
1218
|
+
{ participantName: participant, text: trimmedText, startMilliseconds }
|
|
1219
|
+
];
|
|
1220
|
+
}).sort(
|
|
1221
|
+
(firstEntry, secondEntry) => firstEntry.startMilliseconds - secondEntry.startMilliseconds
|
|
1222
|
+
).map(({ participantName, text, startMilliseconds }) => ({
|
|
1223
|
+
participant: {
|
|
1224
|
+
name: l(participantName) ? displayNameByParticipantName.get(participantName) ?? null : null
|
|
1225
|
+
},
|
|
1226
|
+
words: [
|
|
1227
|
+
{
|
|
1228
|
+
text,
|
|
1229
|
+
start_timestamp: {
|
|
1230
|
+
relative: Math.max(startMilliseconds - conferenceStartMilliseconds, 0) / 1e3
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
]
|
|
1234
|
+
}));
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
// src/logic-functions/utils/should-generate-meet-ai-summary.util.ts
|
|
1238
|
+
var import_guards19 = __toESM(require_build());
|
|
1239
|
+
var shouldGenerateMeetAiSummary = ({
|
|
1240
|
+
transcriptEntries,
|
|
1241
|
+
summaryMarkdown,
|
|
1242
|
+
smartNotes
|
|
1243
|
+
}) => (0, import_guards19.isNonEmptyArray)(transcriptEntries) && !(0, import_guards19.isNonEmptyString)(summaryMarkdown) && smartNotes.every(({ state }) => state === "FILE_GENERATED");
|
|
1244
|
+
|
|
1245
|
+
// src/logic-functions/utils/upsert-call-recording-or-throw.util.ts
|
|
1246
|
+
var doesCallRecordingMatchOrThrow = async ({
|
|
1247
|
+
coreApiClient,
|
|
1248
|
+
filter
|
|
1249
|
+
}) => {
|
|
1250
|
+
const queryResult = await coreApiClient.query({
|
|
1251
|
+
callRecordings: {
|
|
1252
|
+
__args: { filter, first: 1 },
|
|
1253
|
+
edges: { node: { id: true } }
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1256
|
+
return l(queryResult.callRecordings?.edges?.[0]?.node);
|
|
1257
|
+
};
|
|
1258
|
+
var updateCallRecordingOrThrow = async ({
|
|
1259
|
+
coreApiClient,
|
|
1260
|
+
callRecordingId,
|
|
1261
|
+
fields
|
|
1262
|
+
}) => {
|
|
1263
|
+
await coreApiClient.mutation({
|
|
1264
|
+
updateCallRecording: {
|
|
1265
|
+
__args: { id: callRecordingId, data: fields },
|
|
1266
|
+
id: true
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
};
|
|
1270
|
+
var upsertCallRecordingOrThrow = async ({
|
|
1271
|
+
coreApiClient,
|
|
1272
|
+
callRecordingId,
|
|
1273
|
+
fields
|
|
1274
|
+
}) => {
|
|
1275
|
+
if (await doesCallRecordingMatchOrThrow({
|
|
1276
|
+
coreApiClient,
|
|
1277
|
+
filter: { id: { eq: callRecordingId }, deletedAt: { is: "NOT_NULL" } }
|
|
1278
|
+
})) {
|
|
1279
|
+
return "SKIPPED_DELETED";
|
|
1280
|
+
}
|
|
1281
|
+
if (await doesCallRecordingMatchOrThrow({
|
|
1282
|
+
coreApiClient,
|
|
1283
|
+
filter: { id: { eq: callRecordingId } }
|
|
1284
|
+
})) {
|
|
1285
|
+
await updateCallRecordingOrThrow({
|
|
1286
|
+
coreApiClient,
|
|
1287
|
+
callRecordingId,
|
|
1288
|
+
fields
|
|
1289
|
+
});
|
|
1290
|
+
return "UPDATED";
|
|
1291
|
+
}
|
|
1292
|
+
try {
|
|
1293
|
+
await coreApiClient.mutation({
|
|
1294
|
+
createCallRecording: {
|
|
1295
|
+
__args: { data: { id: callRecordingId, ...fields } },
|
|
1296
|
+
id: true
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
1299
|
+
return "CREATED";
|
|
1300
|
+
} catch (error) {
|
|
1301
|
+
const wasCreatedConcurrently = await doesCallRecordingMatchOrThrow({
|
|
1302
|
+
coreApiClient,
|
|
1303
|
+
filter: { id: { eq: callRecordingId } }
|
|
1304
|
+
});
|
|
1305
|
+
if (!wasCreatedConcurrently) {
|
|
1306
|
+
throw error;
|
|
1307
|
+
}
|
|
1308
|
+
await updateCallRecordingOrThrow({
|
|
1309
|
+
coreApiClient,
|
|
1310
|
+
callRecordingId,
|
|
1311
|
+
fields
|
|
1312
|
+
});
|
|
1313
|
+
return "UPDATED";
|
|
1314
|
+
}
|
|
1315
|
+
};
|
|
1316
|
+
|
|
1317
|
+
// src/logic-functions/utils/sync-meet-conference-or-throw.util.ts
|
|
1318
|
+
var syncMeetConferenceOrThrow = async ({
|
|
1319
|
+
accessToken,
|
|
1320
|
+
coreApiClient,
|
|
1321
|
+
conferenceRecord
|
|
1322
|
+
}) => {
|
|
1323
|
+
const [transcripts, smartNotes, recordings] = await Promise.all([
|
|
1324
|
+
listMeetTranscripts({
|
|
1325
|
+
accessToken,
|
|
1326
|
+
conferenceRecordName: conferenceRecord.name
|
|
1327
|
+
}),
|
|
1328
|
+
listMeetSmartNotes({
|
|
1329
|
+
accessToken,
|
|
1330
|
+
conferenceRecordName: conferenceRecord.name
|
|
1331
|
+
}),
|
|
1332
|
+
listMeetRecordings({
|
|
1333
|
+
accessToken,
|
|
1334
|
+
conferenceRecordName: conferenceRecord.name
|
|
1335
|
+
})
|
|
1336
|
+
]);
|
|
1337
|
+
if (!(0, import_guards20.isNonEmptyArray)(transcripts) && !(0, import_guards20.isNonEmptyArray)(smartNotes) && !(0, import_guards20.isNonEmptyArray)(recordings)) {
|
|
1338
|
+
return { outcome: "NO_ARTIFACT", shouldGenerateAiSummary: false };
|
|
1339
|
+
}
|
|
1340
|
+
const [participants, transcriptEntriesByTranscript, space, summaryMarkdown] = await Promise.all([
|
|
1341
|
+
listMeetParticipants({
|
|
1342
|
+
accessToken,
|
|
1343
|
+
conferenceRecordName: conferenceRecord.name
|
|
1344
|
+
}),
|
|
1345
|
+
Promise.all(
|
|
1346
|
+
transcripts.map(
|
|
1347
|
+
({ name }) => listMeetTranscriptEntries({
|
|
1348
|
+
accessToken,
|
|
1349
|
+
transcriptName: name
|
|
1350
|
+
})
|
|
1351
|
+
)
|
|
1352
|
+
),
|
|
1353
|
+
(0, import_guards20.isNonEmptyString)(conferenceRecord.space) ? getMeetSpace({ accessToken, spaceName: conferenceRecord.space }) : void 0,
|
|
1354
|
+
findMeetSmartNotesMarkdown({ accessToken, smartNotes })
|
|
1355
|
+
]);
|
|
1356
|
+
const calendarEvent = l(space) ? await findMeetCalendarEvent({
|
|
1357
|
+
coreApiClient,
|
|
1358
|
+
conferenceRecord,
|
|
1359
|
+
space
|
|
1360
|
+
}) : void 0;
|
|
1361
|
+
const transcriptEntries = mapMeetTranscriptEntries({
|
|
1362
|
+
conferenceRecord,
|
|
1363
|
+
participants,
|
|
1364
|
+
transcriptEntries: transcriptEntriesByTranscript.flat()
|
|
1365
|
+
});
|
|
1366
|
+
const recordingToImport = recordings.find(
|
|
1367
|
+
({ state }) => state === "FILE_GENERATED"
|
|
1368
|
+
);
|
|
1369
|
+
const outcome = await upsertCallRecordingOrThrow({
|
|
1370
|
+
coreApiClient,
|
|
1371
|
+
callRecordingId: computeCallRecordingIdForMeetConference(
|
|
1372
|
+
conferenceRecord.name
|
|
1373
|
+
),
|
|
1374
|
+
fields: buildMeetCallRecordingSyncFields({
|
|
1375
|
+
conferenceRecord,
|
|
1376
|
+
title: await findMeetConferenceTitle({
|
|
1377
|
+
accessToken,
|
|
1378
|
+
calendarEvent,
|
|
1379
|
+
artifacts: [...transcripts, ...smartNotes]
|
|
1380
|
+
}),
|
|
1381
|
+
summaryMarkdown,
|
|
1382
|
+
transcriptEntries,
|
|
1383
|
+
hasRecordingFile: l(recordingToImport),
|
|
1384
|
+
calendarEvent
|
|
1385
|
+
})
|
|
1386
|
+
});
|
|
1387
|
+
if (outcome === "SKIPPED_DELETED") {
|
|
1388
|
+
return { outcome, shouldGenerateAiSummary: false };
|
|
1389
|
+
}
|
|
1390
|
+
return {
|
|
1391
|
+
outcome,
|
|
1392
|
+
shouldGenerateAiSummary: shouldGenerateMeetAiSummary({
|
|
1393
|
+
transcriptEntries,
|
|
1394
|
+
summaryMarkdown,
|
|
1395
|
+
smartNotes
|
|
1396
|
+
}),
|
|
1397
|
+
...l(recordingToImport) ? { recordingNameToImport: recordingToImport.name } : {}
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
|
|
1401
|
+
// src/logic-functions/meet-import-conference.ts
|
|
1402
|
+
var meetImportConferenceHandler = async ({
|
|
1403
|
+
connectedAccountId,
|
|
1404
|
+
conferenceRecordName,
|
|
1405
|
+
startTime,
|
|
1406
|
+
endTime,
|
|
1407
|
+
spaceName
|
|
1408
|
+
}) => {
|
|
1409
|
+
if (!(0, import_guards21.isNonEmptyString)(connectedAccountId) || !(0, import_guards21.isNonEmptyString)(conferenceRecordName) || !(0, import_guards21.isNonEmptyString)(startTime)) {
|
|
1410
|
+
return {
|
|
1411
|
+
success: false,
|
|
1412
|
+
error: "Invalid Google Meet conference import job"
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1415
|
+
const connection = await ae(connectedAccountId);
|
|
1416
|
+
const { outcome, shouldGenerateAiSummary, recordingNameToImport } = await syncMeetConferenceOrThrow({
|
|
1417
|
+
accessToken: getConnectionAccessTokenOrThrow(connection),
|
|
1418
|
+
coreApiClient: new CoreApiClient({ runAs: "application" }),
|
|
1419
|
+
conferenceRecord: {
|
|
1420
|
+
name: conferenceRecordName,
|
|
1421
|
+
startTime,
|
|
1422
|
+
...(0, import_guards21.isNonEmptyString)(endTime) ? { endTime } : {},
|
|
1423
|
+
...(0, import_guards21.isNonEmptyString)(spaceName) ? { space: spaceName } : {}
|
|
1424
|
+
}
|
|
1425
|
+
});
|
|
1426
|
+
if (shouldGenerateAiSummary) {
|
|
1427
|
+
await Ue({
|
|
1428
|
+
logicFunctionUniversalIdentifier: MEET_SUMMARIZE_CALL_RECORDING_UNIVERSAL_IDENTIFIER,
|
|
1429
|
+
retryLimit: MEET_CALL_SUMMARY_JOB_RETRY_LIMIT,
|
|
1430
|
+
jobs: [
|
|
1431
|
+
buildMeetCallSummaryJob({
|
|
1432
|
+
conferenceRecordName,
|
|
1433
|
+
userWorkspaceId: connection.userWorkspaceId
|
|
1434
|
+
})
|
|
1435
|
+
]
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
if ((0, import_guards21.isNonEmptyString)(recordingNameToImport)) {
|
|
1439
|
+
await Ue({
|
|
1440
|
+
logicFunctionUniversalIdentifier: MEET_IMPORT_RECORDING_UNIVERSAL_IDENTIFIER,
|
|
1441
|
+
retryLimit: MEET_RECORDING_IMPORT_JOB_RETRY_LIMIT,
|
|
1442
|
+
jobs: [
|
|
1443
|
+
buildMeetRecordingImportJob({
|
|
1444
|
+
connectedAccountId,
|
|
1445
|
+
conferenceRecordName,
|
|
1446
|
+
recordingName: recordingNameToImport,
|
|
1447
|
+
now: /* @__PURE__ */ new Date()
|
|
1448
|
+
})
|
|
1449
|
+
]
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
return { success: true, outcome };
|
|
1453
|
+
};
|
|
1454
|
+
var meet_import_conference_default = defineLogicFunction({
|
|
1455
|
+
universalIdentifier: MEET_IMPORT_CONFERENCE_UNIVERSAL_IDENTIFIER,
|
|
1456
|
+
name: "meet-import-conference",
|
|
1457
|
+
description: "Imports the transcript and Gemini notes of one Google Meet conference into a Call Recording, and queues the import of its video.",
|
|
1458
|
+
timeoutSeconds: 300,
|
|
1459
|
+
handler: meetImportConferenceHandler
|
|
1460
|
+
});
|
|
1461
|
+
export {
|
|
1462
|
+
meet_import_conference_default as default,
|
|
1463
|
+
meetImportConferenceHandler
|
|
1464
|
+
};
|
|
1465
|
+
//# sourceMappingURL=meet-import-conference.mjs.map
|