@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,665 @@
|
|
|
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 isNonEmptyArray = (term) => {
|
|
124
|
+
return structural_1.isArray(term) && term.length > 0;
|
|
125
|
+
};
|
|
126
|
+
exports.isNonEmptyArray = isNonEmptyArray;
|
|
127
|
+
var isNonEmptyString5 = (term) => {
|
|
128
|
+
return primitives_1.isString(term) && term.length > 0;
|
|
129
|
+
};
|
|
130
|
+
exports.isNonEmptyString = isNonEmptyString5;
|
|
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-handle-event.ts
|
|
196
|
+
var import_guards6 = __toESM(require_build());
|
|
197
|
+
|
|
198
|
+
// twenty-sdk-define-stub:__twenty-sdk-define-stub__
|
|
199
|
+
var __defineFactoryStub = (config) => ({
|
|
200
|
+
success: true,
|
|
201
|
+
config,
|
|
202
|
+
errors: []
|
|
203
|
+
});
|
|
204
|
+
var __anyHandler = {
|
|
205
|
+
get(_target, prop) {
|
|
206
|
+
if (prop === "__esModule") return true;
|
|
207
|
+
if (prop === Symbol.toPrimitive) return () => "";
|
|
208
|
+
if (typeof prop === "symbol") return void 0;
|
|
209
|
+
return new Proxy(() => void 0, __anyHandler);
|
|
210
|
+
},
|
|
211
|
+
apply() {
|
|
212
|
+
return new Proxy(() => void 0, __anyHandler);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
var __anyStub = new Proxy(() => void 0, __anyHandler);
|
|
216
|
+
var defineLogicFunction = __defineFactoryStub;
|
|
217
|
+
|
|
218
|
+
// node_modules/twenty-sdk/dist/logic-function/index.mjs
|
|
219
|
+
var import_guards = __toESM(require_build(), 1);
|
|
220
|
+
import { MetadataApiClient as o } from "twenty-client-sdk/metadata";
|
|
221
|
+
var p = class extends Error {
|
|
222
|
+
constructor(e3) {
|
|
223
|
+
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;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
var h = "TWENTY_API_URL";
|
|
227
|
+
var g = "TWENTY_APP_ACCESS_TOKEN";
|
|
228
|
+
var ee = "TWENTY_APP_APPLICATION_ACCESS_TOKEN";
|
|
229
|
+
var te = "TWENTY_INTERNAL_API_URL";
|
|
230
|
+
var ne = {
|
|
231
|
+
USER: "user",
|
|
232
|
+
WORKSPACE: "workspace"
|
|
233
|
+
};
|
|
234
|
+
var re = (e3) => {
|
|
235
|
+
let n3 = e3[te];
|
|
236
|
+
return (0, import_guards.isNonEmptyString)(n3) ? n3 : e3[h];
|
|
237
|
+
};
|
|
238
|
+
var _ = (e3) => ({
|
|
239
|
+
...e3,
|
|
240
|
+
visibility: ne[e3.scope]
|
|
241
|
+
});
|
|
242
|
+
var v = () => process.env.TWENTY_APP_APPLICATION_ACCESS_TOKEN ?? process.env.TWENTY_APP_ACCESS_TOKEN;
|
|
243
|
+
var y = () => process.env.TWENTY_APP_ACCESS_TOKEN ?? process.env.TWENTY_APP_APPLICATION_ACCESS_TOKEN;
|
|
244
|
+
var b = ({ caller: e3, isActingAsCaller: n3 = false }) => {
|
|
245
|
+
let r2 = re(process.env), i2 = n3 ? y() : v();
|
|
246
|
+
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}).`);
|
|
247
|
+
return {
|
|
248
|
+
apiUrl: r2,
|
|
249
|
+
accessToken: i2
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
var x = async ({ query: e3, variables: t3, caller: n3, signal: r2, isActingAsCaller: i2 = false }) => {
|
|
253
|
+
let { apiUrl: a2, accessToken: o2 } = b({
|
|
254
|
+
caller: n3,
|
|
255
|
+
isActingAsCaller: i2
|
|
256
|
+
}), s = await fetch(`${a2}/metadata`, {
|
|
257
|
+
method: "POST",
|
|
258
|
+
headers: {
|
|
259
|
+
"Content-Type": "application/json",
|
|
260
|
+
Authorization: `Bearer ${o2}`
|
|
261
|
+
},
|
|
262
|
+
body: JSON.stringify({
|
|
263
|
+
query: e3,
|
|
264
|
+
variables: t3
|
|
265
|
+
}),
|
|
266
|
+
signal: r2
|
|
267
|
+
});
|
|
268
|
+
if (!s.ok) throw Error(`${n3}() failed: HTTP ${s.status} ${s.statusText}`);
|
|
269
|
+
let c = await s.json();
|
|
270
|
+
if (c.errors && c.errors.length > 0) throw Error(`${n3}() failed: ${c.errors.map((e4) => e4.message).join(", ")}`);
|
|
271
|
+
if (!c.data) throw Error(`${n3}() failed: response contained no data.`);
|
|
272
|
+
return c.data;
|
|
273
|
+
};
|
|
274
|
+
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";
|
|
275
|
+
var ae = async (e3) => {
|
|
276
|
+
let { appConnection: t3 } = await x({
|
|
277
|
+
query: ie,
|
|
278
|
+
variables: { id: e3 },
|
|
279
|
+
caller: "getConnection"
|
|
280
|
+
});
|
|
281
|
+
if (t3.authFailedAt !== null) throw new p(t3.id);
|
|
282
|
+
return _(t3);
|
|
283
|
+
};
|
|
284
|
+
var S = ({ objectNameSingular: e3, recordId: t3, displayName: n3 }) => `[[record:${e3}:${t3}:${n3}]]`;
|
|
285
|
+
var C = "\n id\n handle\n displayName\n visibility\n connectedAccountId\n isSyncEnabled\n participantHandleFieldUniversalIdentifier\n messagingProviderUniversalIdentifier\n";
|
|
286
|
+
var w = `
|
|
287
|
+
mutation CreateAppMessageChannel($input: CreateAppMessageChannelInput!) {
|
|
288
|
+
createAppMessageChannel(input: $input) {
|
|
289
|
+
${C}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
`;
|
|
293
|
+
var E = `
|
|
294
|
+
query ListAppMessageChannels($filter: ListAppMessageChannelsInput) {
|
|
295
|
+
appMessageChannels(filter: $filter) {
|
|
296
|
+
${C}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
`;
|
|
300
|
+
var O = `
|
|
301
|
+
mutation UpdateAppMessageChannel($input: UpdateAppMessageChannelInput!) {
|
|
302
|
+
updateAppMessageChannel(input: $input) {
|
|
303
|
+
${C}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
307
|
+
var A = `
|
|
308
|
+
mutation DeleteAppMessageChannel($id: UUID!) {
|
|
309
|
+
deleteAppMessageChannel(id: $id) {
|
|
310
|
+
${C}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
`;
|
|
314
|
+
var L = "\n id\n externalId\n name\n isSynced\n messageChannelId\n";
|
|
315
|
+
var R = `
|
|
316
|
+
query ListAppMessageFolders($filter: ListAppMessageFoldersInput) {
|
|
317
|
+
appMessageFolders(filter: $filter) {
|
|
318
|
+
${L}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
`;
|
|
322
|
+
var B = `
|
|
323
|
+
mutation SyncAppMessageFolders($input: SyncAppMessageFoldersInput!) {
|
|
324
|
+
syncAppMessageFolders(input: $input) {
|
|
325
|
+
${L}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
`;
|
|
329
|
+
var U = "agentChatAssistant";
|
|
330
|
+
var ze = S({
|
|
331
|
+
objectNameSingular: U,
|
|
332
|
+
recordId: U,
|
|
333
|
+
displayName: "Ada"
|
|
334
|
+
});
|
|
335
|
+
var Ue = async (e3) => {
|
|
336
|
+
let { enqueueJobs: t3 } = await new o().mutation({ enqueueJobs: {
|
|
337
|
+
__args: { input: e3 },
|
|
338
|
+
enqueued: true,
|
|
339
|
+
logicFunctionUniversalIdentifier: true,
|
|
340
|
+
enqueuedJobsCount: true,
|
|
341
|
+
jobIds: true,
|
|
342
|
+
jobs: {
|
|
343
|
+
jobId: true,
|
|
344
|
+
sizeBytes: true
|
|
345
|
+
},
|
|
346
|
+
availableBytes: true
|
|
347
|
+
} });
|
|
348
|
+
return t3;
|
|
349
|
+
};
|
|
350
|
+
var qe = "\n query GetAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n appKeyValue(key: $key, scope: $scope) {\n key\n value\n scope\n }\n }\n";
|
|
351
|
+
var Je = "\n mutation SetAppKeyValue($input: SetAppKeyValueInput!) {\n setAppKeyValue(input: $input) {\n key\n value\n scope\n }\n }\n";
|
|
352
|
+
var Ye = "\n mutation DeleteAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n deleteAppKeyValue(key: $key, scope: $scope)\n }\n";
|
|
353
|
+
var $ = "WORKSPACE";
|
|
354
|
+
var Xe = {
|
|
355
|
+
async get(e3, t3) {
|
|
356
|
+
let { appKeyValue: n3 } = await x({
|
|
357
|
+
query: qe,
|
|
358
|
+
variables: {
|
|
359
|
+
key: e3,
|
|
360
|
+
scope: t3?.scope ?? $
|
|
361
|
+
},
|
|
362
|
+
caller: "kv.get"
|
|
363
|
+
});
|
|
364
|
+
return n3?.value ?? null;
|
|
365
|
+
},
|
|
366
|
+
async set(e3, t3, n3) {
|
|
367
|
+
await x({
|
|
368
|
+
query: Je,
|
|
369
|
+
variables: { input: {
|
|
370
|
+
key: e3,
|
|
371
|
+
value: t3,
|
|
372
|
+
scope: n3?.scope ?? $
|
|
373
|
+
} },
|
|
374
|
+
caller: "kv.set"
|
|
375
|
+
});
|
|
376
|
+
},
|
|
377
|
+
async delete(e3, t3) {
|
|
378
|
+
let { deleteAppKeyValue: n3 } = await x({
|
|
379
|
+
query: Ye,
|
|
380
|
+
variables: {
|
|
381
|
+
key: e3,
|
|
382
|
+
scope: t3?.scope ?? $
|
|
383
|
+
},
|
|
384
|
+
caller: "kv.delete"
|
|
385
|
+
});
|
|
386
|
+
return n3;
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
// src/constants/universal-identifiers.ts
|
|
391
|
+
var MEET_IMPORT_CONFERENCE_UNIVERSAL_IDENTIFIER = "7df0892f-dab3-4d16-b22f-fb5902d274e9";
|
|
392
|
+
var MEET_HANDLE_EVENT_UNIVERSAL_IDENTIFIER = "7f40cfd3-93f1-4e50-9846-e25b4119c8f9";
|
|
393
|
+
|
|
394
|
+
// src/logic-functions/constants/google-workspace-events.constant.ts
|
|
395
|
+
var MEET_TRANSCRIPT_GENERATED_EVENT_TYPE = "google.workspace.meet.transcript.v2.fileGenerated";
|
|
396
|
+
var MEET_SMART_NOTE_GENERATED_EVENT_TYPE = "google.workspace.meet.smartNote.v2.fileGenerated";
|
|
397
|
+
var MEET_RECORDING_GENERATED_EVENT_TYPE = "google.workspace.meet.recording.v2.fileGenerated";
|
|
398
|
+
var MEET_EVENT_TYPES = [
|
|
399
|
+
MEET_TRANSCRIPT_GENERATED_EVENT_TYPE,
|
|
400
|
+
MEET_SMART_NOTE_GENERATED_EVENT_TYPE,
|
|
401
|
+
MEET_RECORDING_GENERATED_EVENT_TYPE
|
|
402
|
+
];
|
|
403
|
+
|
|
404
|
+
// src/logic-functions/utils/build-meet-artifact-import-job.util.ts
|
|
405
|
+
import { createHash } from "crypto";
|
|
406
|
+
|
|
407
|
+
// src/logic-functions/utils/build-meet-conference-import-payload.util.ts
|
|
408
|
+
var buildMeetConferenceImportPayload = ({
|
|
409
|
+
connectedAccountId,
|
|
410
|
+
conferenceRecord
|
|
411
|
+
}) => ({
|
|
412
|
+
connectedAccountId,
|
|
413
|
+
conferenceRecordName: conferenceRecord.name,
|
|
414
|
+
startTime: conferenceRecord.startTime,
|
|
415
|
+
endTime: conferenceRecord.endTime,
|
|
416
|
+
spaceName: conferenceRecord.space
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
// src/logic-functions/utils/build-meet-artifact-import-job.util.ts
|
|
420
|
+
var buildMeetArtifactImportJob = ({
|
|
421
|
+
connectedAccountId,
|
|
422
|
+
conferenceRecord,
|
|
423
|
+
artifactName
|
|
424
|
+
}) => ({
|
|
425
|
+
// One run per transcript or smart note: Pub/Sub can deliver the same event more than once.
|
|
426
|
+
jobId: `google-meet-artifact-${createHash("sha256").update(artifactName).digest("hex")}`,
|
|
427
|
+
payload: buildMeetConferenceImportPayload({
|
|
428
|
+
connectedAccountId,
|
|
429
|
+
conferenceRecord
|
|
430
|
+
})
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
// src/logic-functions/utils/get-conference-record-name-from-artifact-name.util.ts
|
|
434
|
+
var ARTIFACT_NAME_PATTERN = /^(conferenceRecords\/[^/]+)\/(?:transcripts|smartNotes|recordings)\/[^/]+$/;
|
|
435
|
+
var getConferenceRecordNameFromArtifactName = (artifactName) => ARTIFACT_NAME_PATTERN.exec(artifactName)?.[1];
|
|
436
|
+
|
|
437
|
+
// node_modules/twenty-sdk/dist/utils/index.mjs
|
|
438
|
+
var import_guards2 = __toESM(require_build(), 1);
|
|
439
|
+
var l = (e3) => !(0, import_guards2.isUndefined)(e3) && !(0, import_guards2.isNull)(e3);
|
|
440
|
+
|
|
441
|
+
// src/logic-functions/types/meet-exception.type.ts
|
|
442
|
+
var MeetException = class extends Error {
|
|
443
|
+
constructor({
|
|
444
|
+
message,
|
|
445
|
+
code,
|
|
446
|
+
httpStatus,
|
|
447
|
+
googleStatus
|
|
448
|
+
}) {
|
|
449
|
+
super(message);
|
|
450
|
+
this.name = "MeetException";
|
|
451
|
+
this.code = code;
|
|
452
|
+
this.httpStatus = httpStatus;
|
|
453
|
+
this.googleStatus = googleStatus;
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
// src/logic-functions/utils/get-connection-access-token-or-throw.util.ts
|
|
458
|
+
var getConnectionAccessTokenOrThrow = ({
|
|
459
|
+
id,
|
|
460
|
+
accessToken
|
|
461
|
+
}) => {
|
|
462
|
+
if (!l(accessToken)) {
|
|
463
|
+
throw new MeetException({
|
|
464
|
+
message: `Connection ${id} has no access token`,
|
|
465
|
+
code: "CONNECTION_WITHOUT_ACCESS_TOKEN"
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
return accessToken;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
// src/logic-functions/constants/meet-api.constant.ts
|
|
472
|
+
var MEET_API_BASE_URL = "https://meet.googleapis.com/v2";
|
|
473
|
+
var MEET_REQUEST_MAX_ATTEMPTS = 4;
|
|
474
|
+
var MEET_REQUEST_RETRY_BASE_DELAY_MILLISECONDS = 1e3;
|
|
475
|
+
var MEET_REQUEST_RETRY_BUDGET_MILLISECONDS = 8e3;
|
|
476
|
+
var MEET_RETRYABLE_STATUSES = /* @__PURE__ */ new Set([
|
|
477
|
+
429,
|
|
478
|
+
500,
|
|
479
|
+
502,
|
|
480
|
+
503,
|
|
481
|
+
504
|
|
482
|
+
]);
|
|
483
|
+
|
|
484
|
+
// src/logic-functions/utils/build-google-api-url-or-throw.util.ts
|
|
485
|
+
var import_guards3 = __toESM(require_build());
|
|
486
|
+
var buildGoogleApiUrlOrThrow = ({
|
|
487
|
+
baseUrl,
|
|
488
|
+
path,
|
|
489
|
+
queryParameters
|
|
490
|
+
}) => {
|
|
491
|
+
const url = new URL(`${baseUrl}/${path}`);
|
|
492
|
+
if (!url.href.startsWith(`${baseUrl}/`)) {
|
|
493
|
+
throw new MeetException({
|
|
494
|
+
message: `Google resource paths must stay under ${baseUrl}`,
|
|
495
|
+
code: "INVALID_RESOURCE_PATH"
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
for (const [name, value] of Object.entries(queryParameters)) {
|
|
499
|
+
if ((0, import_guards3.isNonEmptyString)(value)) {
|
|
500
|
+
url.searchParams.set(name, value);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
return url.toString();
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
// src/logic-functions/utils/build-meet-url-or-throw.util.ts
|
|
507
|
+
var buildMeetUrlOrThrow = ({
|
|
508
|
+
path,
|
|
509
|
+
queryParameters
|
|
510
|
+
}) => buildGoogleApiUrlOrThrow({
|
|
511
|
+
baseUrl: MEET_API_BASE_URL,
|
|
512
|
+
path,
|
|
513
|
+
queryParameters
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
// src/logic-functions/utils/fetch-meet-json.util.ts
|
|
517
|
+
var import_guards5 = __toESM(require_build());
|
|
518
|
+
|
|
519
|
+
// src/logic-functions/utils/parse-retry-after-milliseconds.util.ts
|
|
520
|
+
var import_guards4 = __toESM(require_build());
|
|
521
|
+
var parseRetryAfterMilliseconds = ({
|
|
522
|
+
retryAfter,
|
|
523
|
+
now
|
|
524
|
+
}) => {
|
|
525
|
+
if (!(0, import_guards4.isNonEmptyString)(retryAfter)) {
|
|
526
|
+
return void 0;
|
|
527
|
+
}
|
|
528
|
+
const seconds = Number(retryAfter);
|
|
529
|
+
if (Number.isFinite(seconds)) {
|
|
530
|
+
return seconds > 0 ? seconds * 1e3 : void 0;
|
|
531
|
+
}
|
|
532
|
+
const retryAt = Date.parse(retryAfter);
|
|
533
|
+
if (Number.isNaN(retryAt) || retryAt <= now.getTime()) {
|
|
534
|
+
return void 0;
|
|
535
|
+
}
|
|
536
|
+
return retryAt - now.getTime();
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
// src/logic-functions/utils/sleep-for-milliseconds.util.ts
|
|
540
|
+
var sleepForMilliseconds = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
541
|
+
|
|
542
|
+
// src/logic-functions/utils/fetch-meet-json.util.ts
|
|
543
|
+
var fetchMeetResponseWithRetriesOrThrow = async ({
|
|
544
|
+
accessToken,
|
|
545
|
+
url,
|
|
546
|
+
method,
|
|
547
|
+
body,
|
|
548
|
+
attempt,
|
|
549
|
+
waitedMilliseconds
|
|
550
|
+
}) => {
|
|
551
|
+
const response = await fetch(url, {
|
|
552
|
+
method,
|
|
553
|
+
redirect: "error",
|
|
554
|
+
headers: {
|
|
555
|
+
Authorization: `Bearer ${accessToken}`,
|
|
556
|
+
Accept: "application/json",
|
|
557
|
+
...l(body) ? { "Content-Type": "application/json" } : {}
|
|
558
|
+
},
|
|
559
|
+
body: l(body) ? JSON.stringify(body) : void 0
|
|
560
|
+
});
|
|
561
|
+
if (response.ok) {
|
|
562
|
+
return response;
|
|
563
|
+
}
|
|
564
|
+
const retryDelayMilliseconds = parseRetryAfterMilliseconds({
|
|
565
|
+
retryAfter: response.headers.get("Retry-After"),
|
|
566
|
+
now: /* @__PURE__ */ new Date()
|
|
567
|
+
}) ?? MEET_REQUEST_RETRY_BASE_DELAY_MILLISECONDS * 2 ** attempt;
|
|
568
|
+
if (method !== "POST" && MEET_RETRYABLE_STATUSES.has(response.status) && attempt + 1 < MEET_REQUEST_MAX_ATTEMPTS && waitedMilliseconds + retryDelayMilliseconds <= MEET_REQUEST_RETRY_BUDGET_MILLISECONDS) {
|
|
569
|
+
await sleepForMilliseconds(retryDelayMilliseconds);
|
|
570
|
+
return fetchMeetResponseWithRetriesOrThrow({
|
|
571
|
+
accessToken,
|
|
572
|
+
url,
|
|
573
|
+
method,
|
|
574
|
+
body,
|
|
575
|
+
attempt: attempt + 1,
|
|
576
|
+
waitedMilliseconds: waitedMilliseconds + retryDelayMilliseconds
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
const errorBody = await response.json().catch(() => ({}));
|
|
580
|
+
const googleStatus = (0, import_guards5.isNonEmptyString)(errorBody.error?.status) ? errorBody.error.status : void 0;
|
|
581
|
+
const message = (0, import_guards5.isNonEmptyString)(errorBody.error?.message) ? errorBody.error.message : response.statusText;
|
|
582
|
+
throw new MeetException({
|
|
583
|
+
message: `Google Meet request failed (${response.status}${(0, import_guards5.isNonEmptyString)(googleStatus) ? ` ${googleStatus}` : ""}): ${message}`,
|
|
584
|
+
code: "REQUEST_FAILED",
|
|
585
|
+
httpStatus: response.status,
|
|
586
|
+
googleStatus
|
|
587
|
+
});
|
|
588
|
+
};
|
|
589
|
+
var fetchMeetJson = async (request) => {
|
|
590
|
+
const response = await fetchMeetResponseWithRetriesOrThrow({
|
|
591
|
+
...request,
|
|
592
|
+
attempt: 0,
|
|
593
|
+
waitedMilliseconds: 0
|
|
594
|
+
});
|
|
595
|
+
const responseBody = await response.json();
|
|
596
|
+
return responseBody;
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
// src/logic-functions/utils/get-meet-conference-record.util.ts
|
|
600
|
+
var getMeetConferenceRecord = ({
|
|
601
|
+
accessToken,
|
|
602
|
+
conferenceRecordName
|
|
603
|
+
}) => fetchMeetJson({
|
|
604
|
+
accessToken,
|
|
605
|
+
url: buildMeetUrlOrThrow({
|
|
606
|
+
path: conferenceRecordName,
|
|
607
|
+
queryParameters: {}
|
|
608
|
+
})
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// src/logic-functions/utils/get-meet-event-subscription-key.util.ts
|
|
612
|
+
var getMeetEventSubscriptionKey = (subscriptionName) => `google-meet-event-subscription:${subscriptionName}`;
|
|
613
|
+
|
|
614
|
+
// src/logic-functions/meet-handle-event.ts
|
|
615
|
+
var meetHandleEventHandler = async ({
|
|
616
|
+
subscriptionName,
|
|
617
|
+
eventType,
|
|
618
|
+
artifactName
|
|
619
|
+
}) => {
|
|
620
|
+
if (!(0, import_guards6.isNonEmptyString)(subscriptionName) || !(0, import_guards6.isNonEmptyString)(eventType)) {
|
|
621
|
+
return { success: false, error: "Invalid Google Meet event" };
|
|
622
|
+
}
|
|
623
|
+
if (!MEET_EVENT_TYPES.includes(eventType)) {
|
|
624
|
+
return { success: true, outcome: "EVENT_TYPE_IGNORED" };
|
|
625
|
+
}
|
|
626
|
+
const conferenceRecordName = (0, import_guards6.isNonEmptyString)(artifactName) ? getConferenceRecordNameFromArtifactName(artifactName) : void 0;
|
|
627
|
+
if (!(0, import_guards6.isNonEmptyString)(artifactName) || !(0, import_guards6.isNonEmptyString)(conferenceRecordName)) {
|
|
628
|
+
return { success: false, error: "Invalid Google Meet artifact event" };
|
|
629
|
+
}
|
|
630
|
+
const connectedAccountId = await Xe.get(
|
|
631
|
+
getMeetEventSubscriptionKey(subscriptionName)
|
|
632
|
+
);
|
|
633
|
+
if (!(0, import_guards6.isNonEmptyString)(connectedAccountId)) {
|
|
634
|
+
return { success: true, outcome: "SUBSCRIPTION_WITHOUT_CONNECTION" };
|
|
635
|
+
}
|
|
636
|
+
const conferenceRecord = await getMeetConferenceRecord({
|
|
637
|
+
accessToken: getConnectionAccessTokenOrThrow(
|
|
638
|
+
await ae(connectedAccountId)
|
|
639
|
+
),
|
|
640
|
+
conferenceRecordName
|
|
641
|
+
});
|
|
642
|
+
await Ue({
|
|
643
|
+
logicFunctionUniversalIdentifier: MEET_IMPORT_CONFERENCE_UNIVERSAL_IDENTIFIER,
|
|
644
|
+
jobs: [
|
|
645
|
+
buildMeetArtifactImportJob({
|
|
646
|
+
connectedAccountId,
|
|
647
|
+
conferenceRecord,
|
|
648
|
+
artifactName
|
|
649
|
+
})
|
|
650
|
+
]
|
|
651
|
+
});
|
|
652
|
+
return { success: true, outcome: "IMPORT_QUEUED" };
|
|
653
|
+
};
|
|
654
|
+
var meet_handle_event_default = defineLogicFunction({
|
|
655
|
+
universalIdentifier: MEET_HANDLE_EVENT_UNIVERSAL_IDENTIFIER,
|
|
656
|
+
name: "meet-handle-event",
|
|
657
|
+
description: "Queues the import of a Google Meet conference when Google reports that its transcript, Gemini notes or recording is ready.",
|
|
658
|
+
timeoutSeconds: 60,
|
|
659
|
+
handler: meetHandleEventHandler
|
|
660
|
+
});
|
|
661
|
+
export {
|
|
662
|
+
meet_handle_event_default as default,
|
|
663
|
+
meetHandleEventHandler
|
|
664
|
+
};
|
|
665
|
+
//# sourceMappingURL=meet-handle-event.mjs.map
|