@yoooclaw/phone-notifications 1.10.6 → 1.10.7
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/dist/index.cjs +16 -18
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -290,7 +290,7 @@ function buildTranscriptDataFilename(recordingId) {
|
|
|
290
290
|
}
|
|
291
291
|
function buildTranscriptDocument(params) {
|
|
292
292
|
const segments = normalizeSegments(params.segments);
|
|
293
|
-
const text =
|
|
293
|
+
const text = normalizePossiblyEmptyText(params.text) ?? joinSegmentsText(segments) ?? "";
|
|
294
294
|
return {
|
|
295
295
|
schemaVersion: TRANSCRIPT_DOCUMENT_SCHEMA_VERSION,
|
|
296
296
|
recordingId: params.recordingId,
|
|
@@ -304,7 +304,7 @@ function buildTranscriptDocument(params) {
|
|
|
304
304
|
normalized: {
|
|
305
305
|
title: normalizeOptionalText(params.title),
|
|
306
306
|
category: normalizeOptionalText(params.category),
|
|
307
|
-
summary:
|
|
307
|
+
summary: normalizePossiblyEmptyText(params.summary),
|
|
308
308
|
text,
|
|
309
309
|
segments
|
|
310
310
|
},
|
|
@@ -335,11 +335,11 @@ function parseTranscriptDocument(value) {
|
|
|
335
335
|
}
|
|
336
336
|
function extractTranscriptTextFromDocument(doc) {
|
|
337
337
|
if (!doc) return void 0;
|
|
338
|
-
return
|
|
338
|
+
return normalizePossiblyEmptyText(doc.normalized.text) ?? joinSegmentsText(doc.normalized.segments);
|
|
339
339
|
}
|
|
340
340
|
function extractTranscriptSummaryFromDocument(doc) {
|
|
341
341
|
if (!doc) return void 0;
|
|
342
|
-
return
|
|
342
|
+
return normalizePossiblyEmptyText(doc.normalized.summary);
|
|
343
343
|
}
|
|
344
344
|
function extractTranscriptTitleFromDocument(doc) {
|
|
345
345
|
if (!doc) return void 0;
|
|
@@ -392,14 +392,14 @@ function normalizeDocumentBody(value) {
|
|
|
392
392
|
}
|
|
393
393
|
const normalized = value;
|
|
394
394
|
const segments = normalizeSegments(normalized.segments);
|
|
395
|
-
const text =
|
|
396
|
-
if (
|
|
395
|
+
const text = normalizePossiblyEmptyText(normalized.text) ?? joinSegmentsText(segments);
|
|
396
|
+
if (text === void 0) {
|
|
397
397
|
return void 0;
|
|
398
398
|
}
|
|
399
399
|
return {
|
|
400
400
|
title: normalizeOptionalText(normalized.title),
|
|
401
401
|
category: normalizeOptionalText(normalized.category),
|
|
402
|
-
summary:
|
|
402
|
+
summary: normalizePossiblyEmptyText(normalized.summary),
|
|
403
403
|
text,
|
|
404
404
|
segments
|
|
405
405
|
};
|
|
@@ -465,6 +465,9 @@ function extractRawSourceTextList(raw) {
|
|
|
465
465
|
function normalizeOptionalText(value) {
|
|
466
466
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
467
467
|
}
|
|
468
|
+
function normalizePossiblyEmptyText(value) {
|
|
469
|
+
return typeof value === "string" ? value.trim() : void 0;
|
|
470
|
+
}
|
|
468
471
|
function normalizeOptionalNumber(value) {
|
|
469
472
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
470
473
|
}
|
|
@@ -1342,7 +1345,7 @@ async function runTranscriptionWorkflow(params) {
|
|
|
1342
1345
|
return { ok: false, error: result.error };
|
|
1343
1346
|
}
|
|
1344
1347
|
const title = normalizeOptionalText2(result.summary) ? normalizeOptionalText2(result.summary) : extractSummary(result.text ?? "");
|
|
1345
|
-
const summary =
|
|
1348
|
+
const summary = result.summaryText ?? "";
|
|
1346
1349
|
result.summary = title;
|
|
1347
1350
|
const transcriptData = buildTranscriptDocument({
|
|
1348
1351
|
recordingId,
|
|
@@ -1603,16 +1606,11 @@ function buildLongRecordingSuccessResult(taskId, requestId, data, logger) {
|
|
|
1603
1606
|
);
|
|
1604
1607
|
const listResult = extractLongRecordingTextFromList(sourceTextList);
|
|
1605
1608
|
const sourceText = normalizeOptionalText2(data?.recordResult?.sourceText);
|
|
1606
|
-
const summaryText = normalizeOptionalText2(data?.recordResult?.summaryResult);
|
|
1609
|
+
const summaryText = normalizeOptionalText2(data?.recordResult?.summaryResult) ?? "";
|
|
1607
1610
|
const title = normalizeOptionalText2(data?.recordResult?.title);
|
|
1608
1611
|
const category = normalizeOptionalText2(data?.recordResult?.category);
|
|
1609
1612
|
const text = listResult.text ?? sourceText ?? summaryText;
|
|
1610
|
-
|
|
1611
|
-
return {
|
|
1612
|
-
ok: false,
|
|
1613
|
-
error: "Model Proxy ASR \u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u4F46\u672A\u8FD4\u56DE sourceTextList\u3001sourceText \u6216 summaryResult"
|
|
1614
|
-
};
|
|
1615
|
-
}
|
|
1613
|
+
const status = normalizeLongRecordingStatus(data?.status) ?? "SUCCEEDED";
|
|
1616
1614
|
if (!listResult.text && !sourceText && summaryText) {
|
|
1617
1615
|
logger.warn(
|
|
1618
1616
|
`[asr] Model Proxy \u957F\u5F55\u97F3\u7ED3\u679C\u7F3A\u5C11 sourceTextList/sourceText\uFF0C\u5DF2\u56DE\u9000\u4F7F\u7528 summaryResult \u4F5C\u4E3A\u8F6C\u5199\u6587\u672C: taskId=${taskId}`
|
|
@@ -1632,7 +1630,7 @@ function buildLongRecordingSuccessResult(taskId, requestId, data, logger) {
|
|
|
1632
1630
|
provider: "model-proxy",
|
|
1633
1631
|
taskId,
|
|
1634
1632
|
requestId,
|
|
1635
|
-
status
|
|
1633
|
+
status
|
|
1636
1634
|
},
|
|
1637
1635
|
rawResponse: data
|
|
1638
1636
|
};
|
|
@@ -5424,7 +5422,7 @@ function readBuildInjectedVersion() {
|
|
|
5424
5422
|
if (false) {
|
|
5425
5423
|
return void 0;
|
|
5426
5424
|
}
|
|
5427
|
-
const version = "1.10.
|
|
5425
|
+
const version = "1.10.7".trim();
|
|
5428
5426
|
return version || void 0;
|
|
5429
5427
|
}
|
|
5430
5428
|
function readPluginVersionFromPackageJson() {
|
|
@@ -10296,7 +10294,7 @@ var RecordingStorage = class {
|
|
|
10296
10294
|
if (entry.transcriptDataFile) {
|
|
10297
10295
|
const transcriptDoc = this.readRelativeTranscriptDocument(entry.transcriptDataFile);
|
|
10298
10296
|
const transcriptFromJson = extractTranscriptTextFromDocument(transcriptDoc);
|
|
10299
|
-
if (transcriptFromJson) {
|
|
10297
|
+
if (transcriptFromJson !== void 0) {
|
|
10300
10298
|
return transcriptFromJson;
|
|
10301
10299
|
}
|
|
10302
10300
|
}
|