@fonoster/apiserver 0.30.0 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applications/buildService.d.ts +1 -1
- package/dist/applications/buildService.js +4 -3
- package/dist/applications/createCreateApplication.js +6 -3
- package/dist/applications/createCreateTestToken.d.ts +3 -1
- package/dist/applications/createCreateTestToken.js +18 -13
- package/dist/applications/createGetFnUtil.d.ts +1 -1
- package/dist/applications/createUpdateApplication.js +6 -4
- package/dist/applications/evalKeys.d.ts +7 -1
- package/dist/applications/evalKeys.js +9 -3
- package/dist/applications/session/appModel.d.ts +28 -4
- package/dist/applications/session/appModel.js +74 -35
- package/dist/billing/buildService.d.ts +24 -0
- package/dist/billing/buildService.js +116 -0
- package/dist/{migration/cli.js → bin/usage.js} +46 -22
- package/dist/calls/buildService.d.ts +1 -20
- package/dist/calls/buildService.js +50 -10
- package/dist/calls/createCall.d.ts +16 -2
- package/dist/calls/createCall.js +29 -6
- package/dist/calls/createCallPublisher.d.ts +6 -4
- package/dist/calls/createCallPublisher.js +6 -5
- package/dist/calls/createTrackCall.d.ts +16 -13
- package/dist/calls/createTrackCall.js +78 -55
- package/dist/calls/getCall.d.ts +3 -3
- package/dist/calls/getCall.js +2 -3
- package/dist/calls/listCalls.d.ts +4 -4
- package/dist/calls/listCalls.js +2 -3
- package/dist/calls/types.d.ts +2 -1
- package/dist/capabilities/createGetCapabilities.d.ts +3 -0
- package/dist/capabilities/createGetCapabilities.js +2 -1
- package/dist/config/index.js +1 -3
- package/dist/config/schema.d.ts +106 -102
- package/dist/config/schema.js +39 -47
- package/dist/core/applyCatalog.d.ts +3 -3
- package/dist/core/applyCatalog.js +5 -4
- package/dist/core/regionHooks.d.ts +1 -0
- package/dist/core/runServices.js +25 -4
- package/dist/core/services.d.ts +25 -1
- package/dist/core/services.js +35 -11
- package/dist/core/testTokenConfig.js +2 -2
- package/dist/core/upsertRoomrPeer.d.ts +6 -0
- package/dist/core/{upsertMediaNodePeer.js → upsertRoomrPeer.js} +9 -9
- package/dist/envs.d.ts +30 -16
- package/dist/envs.js +49 -31
- package/dist/index.js +23 -22
- package/dist/outbound/createNodeDirectory.d.ts +35 -13
- package/dist/outbound/createNodeDirectory.js +54 -20
- package/dist/outbound/index.d.ts +1 -0
- package/dist/outbound/index.js +1 -0
- package/dist/outbound/placeOutboundCall.d.ts +53 -13
- package/dist/outbound/placeOutboundCall.js +135 -88
- package/dist/outbound/placementSweep.d.ts +56 -0
- package/dist/outbound/placementSweep.js +127 -0
- package/dist/outbound/runOutboundCalls.d.ts +18 -14
- package/dist/outbound/runOutboundCalls.js +46 -34
- package/dist/providers/createProvidersHandlers.d.ts +1 -10
- package/dist/providers/createProvidersHandlers.js +20 -25
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.js +2 -2
- package/dist/providers/registryUsage.d.ts +2 -2
- package/dist/providers/registryUsage.js +5 -5
- package/dist/records/createIndexRecord.d.ts +26 -3
- package/dist/records/createIndexRecord.js +37 -10
- package/dist/records/createRecordsRouter.js +4 -2
- package/dist/records/createSearchRecords.d.ts +4 -3
- package/dist/records/createSearchRecords.js +9 -21
- package/dist/records/maintenance.d.ts +1 -1
- package/dist/records/maintenance.js +1 -1
- package/dist/records/runCallRecords.d.ts +2 -0
- package/dist/records/runCallRecords.js +1 -1
- package/dist/records/types.d.ts +2 -0
- package/dist/regions/configSync.d.ts +5 -5
- package/dist/regions/configSync.js +9 -9
- package/dist/regions/createRegionsRouter.d.ts +6 -6
- package/dist/regions/createRegionsRouter.js +5 -5
- package/dist/regions/link.js +1 -1
- package/dist/regions/runRegions.d.ts +2 -0
- package/dist/regions/runRegions.js +4 -0
- package/dist/regions/service.js +4 -4
- package/dist/regions/sources.d.ts +1 -1
- package/dist/regions/sources.js +4 -4
- package/dist/regions/status.js +5 -4
- package/dist/regions/types.d.ts +2 -2
- package/dist/usage/buildService.d.ts +16 -0
- package/dist/{calls/influxdb.js → usage/buildService.js} +16 -9
- package/dist/{events/createPerCallCache.d.ts → usage/createGetUsage.d.ts} +7 -7
- package/dist/usage/createGetUsage.js +118 -0
- package/dist/usage/ingestUsage.d.ts +7 -0
- package/dist/usage/ingestUsage.js +87 -0
- package/dist/usage/publishRecordedUsage.d.ts +52 -0
- package/dist/usage/publishRecordedUsage.js +103 -0
- package/dist/usage/publishUsage.d.ts +29 -0
- package/dist/usage/publishUsage.js +50 -0
- package/dist/usage/rebuildUsage.d.ts +48 -0
- package/dist/usage/rebuildUsage.js +104 -0
- package/dist/usage/runUsageConsumer.d.ts +22 -0
- package/dist/usage/runUsageConsumer.js +78 -0
- package/dist/usage/snapshotStorage.d.ts +14 -0
- package/dist/usage/snapshotStorage.js +95 -0
- package/dist/usage/types.d.ts +36 -0
- package/dist/voice/stt/types.js +1 -1
- package/dist/webhooks/lostCalls.d.ts +35 -12
- package/dist/webhooks/lostCalls.js +86 -48
- package/dist/webhooks/nodeCallEvents.d.ts +73 -0
- package/dist/webhooks/nodeCallEvents.js +177 -0
- package/dist/webhooks/runWebhookFanout.d.ts +10 -4
- package/dist/webhooks/runWebhookFanout.js +41 -39
- package/package.json +17 -19
- package/dist/applications/migration/PrismaApplicationStore.d.ts +0 -55
- package/dist/applications/migration/PrismaApplicationStore.js +0 -92
- package/dist/applications/migration/convertLegacyApplication.d.ts +0 -11
- package/dist/applications/migration/convertLegacyApplication.js +0 -112
- package/dist/applications/migration/index.d.ts +0 -22
- package/dist/applications/migration/index.js +0 -38
- package/dist/applications/migration/migrateApplications.d.ts +0 -43
- package/dist/applications/migration/migrateApplications.js +0 -87
- package/dist/applications/migration/types.d.ts +0 -92
- package/dist/applications/migration/types.js +0 -20
- package/dist/calls/createFetchCalls.d.ts +0 -22
- package/dist/calls/createFetchCalls.js +0 -88
- package/dist/calls/createFetchSingleCall.d.ts +0 -22
- package/dist/calls/createFetchSingleCall.js +0 -54
- package/dist/calls/influxdb.d.ts +0 -2
- package/dist/core/upsertMediaNodePeer.d.ts +0 -6
- package/dist/events/callRefs.d.ts +0 -29
- package/dist/events/callRefs.js +0 -103
- package/dist/events/createCdrWriter.d.ts +0 -25
- package/dist/events/createCdrWriter.js +0 -95
- package/dist/events/createInfluxDbPub.d.ts +0 -10
- package/dist/events/createInfluxDbPub.js +0 -46
- package/dist/events/createPerCallCache.js +0 -46
- package/dist/events/mapCallDirectionToEnum.d.ts +0 -21
- package/dist/events/mapCallDirectionToEnum.js +0 -37
- package/dist/events/nats.d.ts +0 -44
- package/dist/events/nats.js +0 -93
- package/dist/events/transformEvent.d.ts +0 -4
- package/dist/events/transformEvent.js +0 -87
- package/dist/events/types.d.ts +0 -26
- package/dist/migration/argv.d.ts +0 -22
- package/dist/migration/argv.js +0 -42
- package/dist/migration/catalogMapping.d.ts +0 -30
- package/dist/migration/catalogMapping.js +0 -53
- package/dist/migration/index.d.ts +0 -27
- package/dist/migration/index.js +0 -43
- package/dist/migration/migrateAssistants.d.ts +0 -8
- package/dist/migration/migrateAssistants.js +0 -169
- package/dist/migration/migrateCredentials.d.ts +0 -4
- package/dist/migration/migrateCredentials.js +0 -107
- package/dist/migration/migrateIntegrations.d.ts +0 -32
- package/dist/migration/migrateIntegrations.js +0 -136
- package/dist/migration/migrateLegacy.d.ts +0 -41
- package/dist/migration/migrateLegacy.js +0 -76
- package/dist/migration/providerKeys.d.ts +0 -14
- package/dist/migration/providerKeys.js +0 -61
- package/dist/migration/seedCatalog.d.ts +0 -2
- package/dist/migration/seedCatalog.js +0 -160
- package/dist/migration/types.d.ts +0 -42
- package/dist/migration/types.js +0 -31
- /package/dist/{migration/cli.d.ts → bin/usage.d.ts} +0 -0
- /package/dist/{events → usage}/types.js +0 -0
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.keyFromCredentials = keyFromCredentials;
|
|
13
|
-
exports.migrateCredentials = migrateCredentials;
|
|
14
|
-
/**
|
|
15
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
16
|
-
* http://github.com/fonoster/fonoster
|
|
17
|
-
*
|
|
18
|
-
* This file is part of Fonoster
|
|
19
|
-
*
|
|
20
|
-
* Licensed under the MIT License (the "License");
|
|
21
|
-
* you may not use this file except in compliance with
|
|
22
|
-
* the License. You may obtain a copy of the License at
|
|
23
|
-
*
|
|
24
|
-
* https://opensource.org/licenses/MIT
|
|
25
|
-
*
|
|
26
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
-
* See the License for the specific language governing permissions and
|
|
30
|
-
* limitations under the License.
|
|
31
|
-
*/
|
|
32
|
-
const catalogMapping_1 = require("./catalogMapping");
|
|
33
|
-
const providerKeys_1 = require("./providerKeys");
|
|
34
|
-
const types_1 = require("./types");
|
|
35
|
-
// add-provider-registry 5.2: the per-application `credentials` columns of TextToSpeech,
|
|
36
|
-
// SpeechToText and Intelligence rows become the workspace's vendor keys (one per provider, as the
|
|
37
|
-
// dashboard's Vendor keys page stores them). A moved column is cleared, so the key lives only in
|
|
38
|
-
// the Secret and a re-run finds nothing to move.
|
|
39
|
-
const TABLES = [
|
|
40
|
-
["textToSpeech", "TTS"],
|
|
41
|
-
["speechToText", "STT"],
|
|
42
|
-
["intelligence", "LLM"]
|
|
43
|
-
];
|
|
44
|
-
/** A stored credentials value as the key a provider adapter takes. */
|
|
45
|
-
function keyFromCredentials(raw) {
|
|
46
|
-
try {
|
|
47
|
-
const parsed = JSON.parse(raw);
|
|
48
|
-
if (parsed && typeof parsed === "object") {
|
|
49
|
-
const keys = Object.keys(parsed);
|
|
50
|
-
if (typeof parsed.apiKey === "string" && keys.length === 1)
|
|
51
|
-
return parsed.apiKey;
|
|
52
|
-
// Several fields (a Google service account, Azure key + region): the adapter takes the JSON.
|
|
53
|
-
return JSON.stringify(parsed);
|
|
54
|
-
}
|
|
55
|
-
if (typeof parsed === "string")
|
|
56
|
-
return parsed;
|
|
57
|
-
}
|
|
58
|
-
catch (_a) {
|
|
59
|
-
// A bare key.
|
|
60
|
-
}
|
|
61
|
-
return raw;
|
|
62
|
-
}
|
|
63
|
-
function migrateCredentials(db_1) {
|
|
64
|
-
return __awaiter(this, arguments, void 0, function* (db, options = {}) {
|
|
65
|
-
const report = (0, types_1.newStepReport)("credentials");
|
|
66
|
-
for (const [table, kind] of TABLES) {
|
|
67
|
-
const rows = yield db[table].findMany({
|
|
68
|
-
// Filtered here, not in SQL: the column is encrypted.
|
|
69
|
-
include: { application: { select: { ref: true, accessKeyId: true } } },
|
|
70
|
-
orderBy: { applicationRef: "asc" }
|
|
71
|
-
});
|
|
72
|
-
for (const row of rows) {
|
|
73
|
-
const id = `${kind}:${row.application.ref}`;
|
|
74
|
-
if (!row.credentials)
|
|
75
|
-
continue;
|
|
76
|
-
const providerId = (0, catalogMapping_1.providerOfProductRef)(row.productRef);
|
|
77
|
-
const note = (level, message) => report.notices.push({
|
|
78
|
-
ref: row.application.ref,
|
|
79
|
-
workspaceRef: row.application.accessKeyId,
|
|
80
|
-
level,
|
|
81
|
-
message
|
|
82
|
-
});
|
|
83
|
-
if (!providerId) {
|
|
84
|
-
report.skipped.push(id);
|
|
85
|
-
note("action", `${kind} credentials for ${row.productRef} were not moved: the provider has no adapter in this release`);
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
const result = yield (0, providerKeys_1.bindWorkspaceKey)(db, {
|
|
89
|
-
accessKeyId: row.application.accessKeyId,
|
|
90
|
-
providerId,
|
|
91
|
-
key: keyFromCredentials(row.credentials)
|
|
92
|
-
}, options.dryRun);
|
|
93
|
-
if (result === "kept-existing")
|
|
94
|
-
note("action", `the workspace already has a different ${providerId} key; it is kept and this app's ${kind} credentials were dropped`);
|
|
95
|
-
else if (result === "created")
|
|
96
|
-
note("info", `${kind} credentials moved to the workspace's ${providerId} vendor key`);
|
|
97
|
-
if (!options.dryRun)
|
|
98
|
-
yield db[table].update({
|
|
99
|
-
where: { ref: row.ref },
|
|
100
|
-
data: { credentials: null }
|
|
101
|
-
});
|
|
102
|
-
report.changed.push(id);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return report;
|
|
106
|
-
});
|
|
107
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { StepOptions, StepReport } from "./types";
|
|
2
|
-
export type IntegrationsMigrationOptions = StepOptions & {
|
|
3
|
-
/** The legacy integrations file (JSON or YAML). */
|
|
4
|
-
file: string;
|
|
5
|
-
/** Where to write the config fragment (JSON, which every config loader accepts as YAML). */
|
|
6
|
-
out: string;
|
|
7
|
-
/** Where to write one file per key; without it, keys are referenced by environment variable. */
|
|
8
|
-
secretsDir?: string;
|
|
9
|
-
};
|
|
10
|
-
export type CredentialsFragment = {
|
|
11
|
-
credentials: Record<string, {
|
|
12
|
-
value: string;
|
|
13
|
-
} | {
|
|
14
|
-
env: string;
|
|
15
|
-
}>;
|
|
16
|
-
providers: Record<string, {
|
|
17
|
-
adapter: string;
|
|
18
|
-
capabilities: string[];
|
|
19
|
-
credential: {
|
|
20
|
-
value: string;
|
|
21
|
-
} | {
|
|
22
|
-
env: string;
|
|
23
|
-
};
|
|
24
|
-
}>;
|
|
25
|
-
registry: {
|
|
26
|
-
platformCredentials: string[];
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export declare const envNameFor: (credentialRef: string) => string;
|
|
30
|
-
export declare function migrateIntegrations(options: IntegrationsMigrationOptions): StepReport & {
|
|
31
|
-
fragment: CredentialsFragment;
|
|
32
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.envNameFor = void 0;
|
|
37
|
-
exports.migrateIntegrations = migrateIntegrations;
|
|
38
|
-
/**
|
|
39
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
40
|
-
* http://github.com/fonoster/fonoster
|
|
41
|
-
*
|
|
42
|
-
* This file is part of Fonoster
|
|
43
|
-
*
|
|
44
|
-
* Licensed under the MIT License (the "License");
|
|
45
|
-
* you may not use this file except in compliance with
|
|
46
|
-
* the License. You may obtain a copy of the License at
|
|
47
|
-
*
|
|
48
|
-
* https://opensource.org/licenses/MIT
|
|
49
|
-
*
|
|
50
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
51
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
-
* See the License for the specific language governing permissions and
|
|
54
|
-
* limitations under the License.
|
|
55
|
-
*/
|
|
56
|
-
const fs = __importStar(require("fs"));
|
|
57
|
-
const path = __importStar(require("path"));
|
|
58
|
-
const common_1 = require("@fonoster/common");
|
|
59
|
-
const catalogMapping_1 = require("./catalogMapping");
|
|
60
|
-
const migrateCredentials_1 = require("./migrateCredentials");
|
|
61
|
-
const types_1 = require("./types");
|
|
62
|
-
const envNameFor = (credentialRef) => credentialRef.toUpperCase().replace(/[^A-Z0-9]/g, "_");
|
|
63
|
-
exports.envNameFor = envNameFor;
|
|
64
|
-
function migrateIntegrations(options) {
|
|
65
|
-
var _a, _b;
|
|
66
|
-
const report = (0, types_1.newStepReport)("integrations");
|
|
67
|
-
const integrations = (0, common_1.getIntegrationsFromFile)(options.file);
|
|
68
|
-
const keys = new Map();
|
|
69
|
-
const capabilities = new Map();
|
|
70
|
-
const fragment = {
|
|
71
|
-
credentials: {},
|
|
72
|
-
providers: {},
|
|
73
|
-
registry: { platformCredentials: [] }
|
|
74
|
-
};
|
|
75
|
-
for (const i of integrations) {
|
|
76
|
-
const providerId = (0, catalogMapping_1.providerOfProductRef)(i.productRef);
|
|
77
|
-
if (!providerId) {
|
|
78
|
-
report.skipped.push(i.productRef);
|
|
79
|
-
report.notices.push({
|
|
80
|
-
ref: i.productRef,
|
|
81
|
-
level: "info",
|
|
82
|
-
message: `${i.name} (${i.productRef}) has no adapter in this release; dropped`
|
|
83
|
-
});
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
const ref = (0, catalogMapping_1.credentialRefFor)(providerId);
|
|
87
|
-
const key = (0, migrateCredentials_1.keyFromCredentials)(JSON.stringify(i.credentials));
|
|
88
|
-
const set = (_a = capabilities.get(providerId)) !== null && _a !== void 0 ? _a : new Set();
|
|
89
|
-
set.add(i.type);
|
|
90
|
-
capabilities.set(providerId, set);
|
|
91
|
-
const known = keys.get(ref);
|
|
92
|
-
if (known !== undefined) {
|
|
93
|
-
if (known !== key)
|
|
94
|
-
report.notices.push({
|
|
95
|
-
ref,
|
|
96
|
-
level: "action",
|
|
97
|
-
message: `${i.name} has a different key than another ${providerId} integration; ${ref} keeps the first`
|
|
98
|
-
});
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
keys.set(ref, key);
|
|
102
|
-
}
|
|
103
|
-
if (options.secretsDir && !options.dryRun)
|
|
104
|
-
fs.mkdirSync(options.secretsDir, { recursive: true, mode: 0o700 });
|
|
105
|
-
for (const [ref, key] of [...keys].sort()) {
|
|
106
|
-
let source;
|
|
107
|
-
if (options.secretsDir) {
|
|
108
|
-
const file = path.resolve(options.secretsDir, ref);
|
|
109
|
-
if (!options.dryRun)
|
|
110
|
-
fs.writeFileSync(file, key, { mode: 0o600 });
|
|
111
|
-
source = { value: `secret://file${file}` };
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
source = { env: (0, exports.envNameFor)(ref) };
|
|
115
|
-
report.notices.push({
|
|
116
|
-
ref,
|
|
117
|
-
level: "action",
|
|
118
|
-
message: `set ${(0, exports.envNameFor)(ref)} to the ${ref} key (from ${options.file}) wherever the fragment is used`
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
const providerId = ref.replace(/-default$/, "");
|
|
122
|
-
fragment.credentials[ref] = source;
|
|
123
|
-
fragment.providers[providerId] = {
|
|
124
|
-
adapter: providerId,
|
|
125
|
-
capabilities: [...((_b = capabilities.get(providerId)) !== null && _b !== void 0 ? _b : [])].sort(),
|
|
126
|
-
credential: source
|
|
127
|
-
};
|
|
128
|
-
fragment.registry.platformCredentials.push(ref);
|
|
129
|
-
report.changed.push(ref);
|
|
130
|
-
}
|
|
131
|
-
if (!options.dryRun)
|
|
132
|
-
fs.writeFileSync(options.out, JSON.stringify(fragment, null, 2) + "\n", {
|
|
133
|
-
mode: 0o600
|
|
134
|
-
});
|
|
135
|
-
return Object.assign(Object.assign({}, report), { fragment });
|
|
136
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { MigratedApplication, MigrationOptions } from "../applications/migration";
|
|
20
|
-
import { AssistantMigrationOptions } from "./migrateAssistants";
|
|
21
|
-
import { IntegrationsMigrationOptions } from "./migrateIntegrations";
|
|
22
|
-
import { MigrationDb, StepReport } from "./types";
|
|
23
|
-
export type LegacyMigrationOptions = AssistantMigrationOptions & {
|
|
24
|
-
/** App routing (rework-autopilot 8.3): see the applications migration. */
|
|
25
|
-
apps?: Omit<MigrationOptions, "defaults"> & {
|
|
26
|
-
defaults?: MigrationOptions["defaults"];
|
|
27
|
-
refs?: string[];
|
|
28
|
-
};
|
|
29
|
-
/** integrations.json → operator config (add-provider-registry 5.3); skipped when absent. */
|
|
30
|
-
integrations?: Omit<IntegrationsMigrationOptions, "dryRun">;
|
|
31
|
-
};
|
|
32
|
-
export type LegacyMigrationReport = {
|
|
33
|
-
steps: StepReport[];
|
|
34
|
-
/** The migrated apps (with signing secrets; never printed). */
|
|
35
|
-
apps: MigratedApplication[];
|
|
36
|
-
};
|
|
37
|
-
export declare const DEFAULT_APP_SPEECH: {
|
|
38
|
-
voice: string;
|
|
39
|
-
language: string;
|
|
40
|
-
};
|
|
41
|
-
export declare function migrateLegacy(db: MigrationDb, options?: LegacyMigrationOptions): Promise<LegacyMigrationReport>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.DEFAULT_APP_SPEECH = void 0;
|
|
24
|
-
exports.migrateLegacy = migrateLegacy;
|
|
25
|
-
/**
|
|
26
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
27
|
-
* http://github.com/fonoster/fonoster
|
|
28
|
-
*
|
|
29
|
-
* This file is part of Fonoster
|
|
30
|
-
*
|
|
31
|
-
* Licensed under the MIT License (the "License");
|
|
32
|
-
* you may not use this file except in compliance with
|
|
33
|
-
* the License. You may obtain a copy of the License at
|
|
34
|
-
*
|
|
35
|
-
* https://opensource.org/licenses/MIT
|
|
36
|
-
*
|
|
37
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
38
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
39
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
40
|
-
* See the License for the specific language governing permissions and
|
|
41
|
-
* limitations under the License.
|
|
42
|
-
*/
|
|
43
|
-
const migration_1 = require("../applications/migration");
|
|
44
|
-
const migrateAssistants_1 = require("./migrateAssistants");
|
|
45
|
-
const migrateCredentials_1 = require("./migrateCredentials");
|
|
46
|
-
const migrateIntegrations_1 = require("./migrateIntegrations");
|
|
47
|
-
const seedCatalog_1 = require("./seedCatalog");
|
|
48
|
-
const types_1 = require("./types");
|
|
49
|
-
exports.DEFAULT_APP_SPEECH = {
|
|
50
|
-
voice: "deepgram/aura-2-thalia-en",
|
|
51
|
-
language: "en-US"
|
|
52
|
-
};
|
|
53
|
-
function migrateLegacy(db_1) {
|
|
54
|
-
return __awaiter(this, arguments, void 0, function* (db, options = {}) {
|
|
55
|
-
var _a, _b;
|
|
56
|
-
const steps = [];
|
|
57
|
-
// The catalog first: keys bind to its providers, and apps and assistants name its ids.
|
|
58
|
-
steps.push(yield (0, seedCatalog_1.seedCatalog)(db, options));
|
|
59
|
-
steps.push(yield (0, migrateCredentials_1.migrateCredentials)(db, options));
|
|
60
|
-
// Assistants before apps: an Autopilot app is only re-pointed once its assistant runs on the hosted
|
|
61
|
-
// engine.
|
|
62
|
-
steps.push(yield (0, migrateAssistants_1.migrateAssistants)(db, options));
|
|
63
|
-
const apps = yield (0, migration_1.migrateApplications)(new migration_1.PrismaApplicationStore(db), Object.assign(Object.assign({}, options.apps), { defaults: (_b = (_a = options.apps) === null || _a === void 0 ? void 0 : _a.defaults) !== null && _b !== void 0 ? _b : exports.DEFAULT_APP_SPEECH, dryRun: options.dryRun }));
|
|
64
|
-
const appStep = (0, types_1.newStepReport)("apps");
|
|
65
|
-
appStep.changed.push(...apps.migrated.map((a) => a.ref));
|
|
66
|
-
appStep.skipped.push(...apps.skipped);
|
|
67
|
-
appStep.notices.push(...apps.notices);
|
|
68
|
-
steps.push(appStep);
|
|
69
|
-
if (options.integrations) {
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
71
|
-
const _c = (0, migrateIntegrations_1.migrateIntegrations)(Object.assign(Object.assign({}, options.integrations), { dryRun: options.dryRun })), { fragment } = _c, step = __rest(_c, ["fragment"]);
|
|
72
|
-
steps.push(step);
|
|
73
|
-
}
|
|
74
|
-
return { steps, apps: apps.migrated };
|
|
75
|
-
});
|
|
76
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { MigrationDb } from "./types";
|
|
2
|
-
export type BindResult =
|
|
3
|
-
/** A new binding (and Secret) was written. */
|
|
4
|
-
"created"
|
|
5
|
-
/** The workspace already has this exact key. */
|
|
6
|
-
| "same"
|
|
7
|
-
/** The workspace already has a different key for the provider; it is kept. */
|
|
8
|
-
| "kept-existing";
|
|
9
|
-
/** Binds `key` as the workspace's key for `providerId` unless one is bound already. */
|
|
10
|
-
export declare function bindWorkspaceKey(db: MigrationDb, input: {
|
|
11
|
-
accessKeyId: string;
|
|
12
|
-
providerId: string;
|
|
13
|
-
key: string;
|
|
14
|
-
}, dryRun?: boolean): Promise<BindResult>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.bindWorkspaceKey = bindWorkspaceKey;
|
|
13
|
-
/**
|
|
14
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
15
|
-
* http://github.com/fonoster/fonoster
|
|
16
|
-
*
|
|
17
|
-
* This file is part of Fonoster
|
|
18
|
-
*
|
|
19
|
-
* Licensed under the MIT License (the "License");
|
|
20
|
-
* you may not use this file except in compliance with
|
|
21
|
-
* the License. You may obtain a copy of the License at
|
|
22
|
-
*
|
|
23
|
-
* https://opensource.org/licenses/MIT
|
|
24
|
-
*
|
|
25
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
-
* See the License for the specific language governing permissions and
|
|
29
|
-
* limitations under the License.
|
|
30
|
-
*/
|
|
31
|
-
const createProvidersHandlers_1 = require("../providers/createProvidersHandlers");
|
|
32
|
-
/** Binds `key` as the workspace's key for `providerId` unless one is bound already. */
|
|
33
|
-
function bindWorkspaceKey(db_1, input_1) {
|
|
34
|
-
return __awaiter(this, arguments, void 0, function* (db, input, dryRun = false) {
|
|
35
|
-
const { accessKeyId, providerId, key } = input;
|
|
36
|
-
const existing = yield db.workspaceProviderKey.findUnique({
|
|
37
|
-
where: { accessKeyId_providerId: { accessKeyId, providerId } }
|
|
38
|
-
});
|
|
39
|
-
if (existing) {
|
|
40
|
-
const secret = yield db.secret.findUnique({
|
|
41
|
-
where: { ref: existing.secretRef }
|
|
42
|
-
});
|
|
43
|
-
return (secret === null || secret === void 0 ? void 0 : secret.secret) === key ? "same" : "kept-existing";
|
|
44
|
-
}
|
|
45
|
-
if (dryRun)
|
|
46
|
-
return "created";
|
|
47
|
-
const secret = yield db.secret.create({
|
|
48
|
-
data: { accessKeyId, name: (0, createProvidersHandlers_1.providerKeySecretName)(providerId), secret: key }
|
|
49
|
-
});
|
|
50
|
-
try {
|
|
51
|
-
yield db.workspaceProviderKey.create({
|
|
52
|
-
data: { accessKeyId, providerId, secretRef: secret.ref }
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
yield db.secret.delete({ where: { ref: secret.ref } }).catch(() => { });
|
|
57
|
-
throw e;
|
|
58
|
-
}
|
|
59
|
-
return "created";
|
|
60
|
-
});
|
|
61
|
-
}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.seedCatalog = seedCatalog;
|
|
13
|
-
/**
|
|
14
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
15
|
-
* http://github.com/fonoster/fonoster
|
|
16
|
-
*
|
|
17
|
-
* This file is part of Fonoster
|
|
18
|
-
*
|
|
19
|
-
* Licensed under the MIT License (the "License");
|
|
20
|
-
* you may not use this file except in compliance with
|
|
21
|
-
* the License. You may obtain a copy of the License at
|
|
22
|
-
*
|
|
23
|
-
* https://opensource.org/licenses/MIT
|
|
24
|
-
*
|
|
25
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
-
* See the License for the specific language governing permissions and
|
|
29
|
-
* limitations under the License.
|
|
30
|
-
*/
|
|
31
|
-
const common_1 = require("@fonoster/common");
|
|
32
|
-
const catalogMapping_1 = require("./catalogMapping");
|
|
33
|
-
const types_1 = require("./types");
|
|
34
|
-
const str = (v) => typeof v === "string" && v.trim() ? v.trim() : undefined;
|
|
35
|
-
const LLM_FEATURES = ["streaming", "tool-calling"];
|
|
36
|
-
const STREAMING = ["streaming"];
|
|
37
|
-
function seedCatalog(db_1) {
|
|
38
|
-
return __awaiter(this, arguments, void 0, function* (db, options = {}) {
|
|
39
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40
|
-
const report = (0, types_1.newStepReport)("catalog");
|
|
41
|
-
const persistent = yield common_1.Registry.PrismaRegistryStore.open(db);
|
|
42
|
-
let store = persistent;
|
|
43
|
-
if (options.dryRun) {
|
|
44
|
-
store = new common_1.Registry.MemoryRegistryStore();
|
|
45
|
-
persistent.all().forEach((e) => store.put(e));
|
|
46
|
-
}
|
|
47
|
-
const registry = new common_1.Registry.Registry({
|
|
48
|
-
store,
|
|
49
|
-
actor: "fonoster-migrate-legacy",
|
|
50
|
-
commandLine: "fonoster-migrate-legacy"
|
|
51
|
-
});
|
|
52
|
-
const note = (ref, level, message) => report.notices.push({ ref, level, message });
|
|
53
|
-
// Providers from products.
|
|
54
|
-
const capabilities = new Map();
|
|
55
|
-
const products = yield db.product.findMany({ orderBy: { ref: "asc" } });
|
|
56
|
-
for (const p of products) {
|
|
57
|
-
const id = catalogMapping_1.VENDOR_PROVIDERS[p.vendor];
|
|
58
|
-
if (!id) {
|
|
59
|
-
note(p.ref, "info", `product ${p.ref} (${p.vendor}) has no adapter in this release; not added to the catalog`);
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
const set = (_a = capabilities.get(id)) !== null && _a !== void 0 ? _a : new Set();
|
|
63
|
-
set.add(catalogMapping_1.PRODUCT_TYPES[p.type]);
|
|
64
|
-
capabilities.set(id, set);
|
|
65
|
-
}
|
|
66
|
-
// Models and voices the rows use.
|
|
67
|
-
const models = new Map();
|
|
68
|
-
const voices = new Map();
|
|
69
|
-
const model = (id, type, language) => {
|
|
70
|
-
var _a, _b;
|
|
71
|
-
const m = (_a = models.get(id)) !== null && _a !== void 0 ? _a : { type, languages: new Set() };
|
|
72
|
-
if (language)
|
|
73
|
-
m.languages.add(language.split("-")[0]);
|
|
74
|
-
models.set(id, m);
|
|
75
|
-
const provider = id.split("/")[0];
|
|
76
|
-
const set = (_b = capabilities.get(provider)) !== null && _b !== void 0 ? _b : new Set();
|
|
77
|
-
set.add(type);
|
|
78
|
-
capabilities.set(provider, set);
|
|
79
|
-
};
|
|
80
|
-
const tts = yield db.textToSpeech.findMany({
|
|
81
|
-
select: { productRef: true, config: true }
|
|
82
|
-
});
|
|
83
|
-
for (const r of tts) {
|
|
84
|
-
const provider = (0, catalogMapping_1.providerOfProductRef)(r.productRef);
|
|
85
|
-
const voice = str((_b = r.config) === null || _b === void 0 ? void 0 : _b.voice);
|
|
86
|
-
if (!provider || !voice)
|
|
87
|
-
continue;
|
|
88
|
-
const ttsModel = (0, catalogMapping_1.ttsModelFor)(provider, voice, (_c = r.config) !== null && _c !== void 0 ? _c : {});
|
|
89
|
-
model(ttsModel, "tts");
|
|
90
|
-
voices.set((0, catalogMapping_1.catalogId)(provider, voice), {
|
|
91
|
-
model: ttsModel,
|
|
92
|
-
language: str((_d = r.config) === null || _d === void 0 ? void 0 : _d.languageCode)
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
const stt = yield db.speechToText.findMany({
|
|
96
|
-
select: { productRef: true, config: true }
|
|
97
|
-
});
|
|
98
|
-
for (const r of stt) {
|
|
99
|
-
const provider = (0, catalogMapping_1.providerOfProductRef)(r.productRef);
|
|
100
|
-
const name = str((_e = r.config) === null || _e === void 0 ? void 0 : _e.model);
|
|
101
|
-
if (provider && name)
|
|
102
|
-
model((0, catalogMapping_1.catalogId)(provider, name), "stt", str((_f = r.config) === null || _f === void 0 ? void 0 : _f.languageCode));
|
|
103
|
-
}
|
|
104
|
-
const assistants = yield db.intelligence.findMany({
|
|
105
|
-
select: { productRef: true, config: true }
|
|
106
|
-
});
|
|
107
|
-
for (const r of assistants) {
|
|
108
|
-
const lm = ((_h = (_g = r.config) === null || _g === void 0 ? void 0 : _g.languageModel) !== null && _h !== void 0 ? _h : {});
|
|
109
|
-
const name = str(lm.model);
|
|
110
|
-
if (!name)
|
|
111
|
-
continue;
|
|
112
|
-
// A session assistant names a catalog id; a legacy one a provider and a raw model name.
|
|
113
|
-
const provider = (_j = str(lm.provider)) !== null && _j !== void 0 ? _j : (name.includes("/") ? name.split("/")[0] : undefined);
|
|
114
|
-
if (provider && Object.values(catalogMapping_1.VENDOR_PROVIDERS).includes(provider))
|
|
115
|
-
model((0, catalogMapping_1.catalogId)(provider, name), "llm");
|
|
116
|
-
}
|
|
117
|
-
const add = (id, fn) => {
|
|
118
|
-
if (store.get(id)) {
|
|
119
|
-
report.unchanged.push(id);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
try {
|
|
123
|
-
fn();
|
|
124
|
-
report.changed.push(id);
|
|
125
|
-
}
|
|
126
|
-
catch (e) {
|
|
127
|
-
report.skipped.push(id);
|
|
128
|
-
note(id, "action", `not added to the catalog: ${e.message}`);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
for (const [id, caps] of [...capabilities].sort()) {
|
|
132
|
-
const existing = store.get(id);
|
|
133
|
-
if ((existing === null || existing === void 0 ? void 0 : existing.kind) === "provider") {
|
|
134
|
-
const missing = [...caps].filter((c) => !existing.capabilities.includes(c));
|
|
135
|
-
if (missing.length)
|
|
136
|
-
note(id, "action", `provider ${id} is in the catalog without ${missing.join(", ")}; models of that type were not added`);
|
|
137
|
-
}
|
|
138
|
-
add(id, () => registry.addProvider({
|
|
139
|
-
id,
|
|
140
|
-
adapter: id,
|
|
141
|
-
capabilities: [...caps].sort(),
|
|
142
|
-
credentialRef: (0, catalogMapping_1.credentialRefFor)(id)
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
|
-
for (const [id, m] of [...models].sort()) {
|
|
146
|
-
add(id, () => registry.addModel({
|
|
147
|
-
id,
|
|
148
|
-
type: m.type,
|
|
149
|
-
features: m.type === "llm" ? LLM_FEATURES : STREAMING,
|
|
150
|
-
languages: [...m.languages].sort()
|
|
151
|
-
}));
|
|
152
|
-
}
|
|
153
|
-
for (const [id, v] of [...voices].sort()) {
|
|
154
|
-
add(id, () => registry.addVoice({ id, models: [v.model], language: v.language }));
|
|
155
|
-
}
|
|
156
|
-
if (!options.dryRun)
|
|
157
|
-
yield persistent.flush();
|
|
158
|
-
return report;
|
|
159
|
-
});
|
|
160
|
-
}
|