@fonoster/types 0.30.0 → 0.31.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/dist/applications.types.d.ts +12 -5
- package/dist/billing.types.d.ts +61 -0
- package/dist/billing.types.js +22 -0
- package/dist/calls.types.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/providers.types.d.ts +8 -3
- package/dist/records.types.d.ts +4 -0
- package/dist/regions.types.d.ts +4 -4
- package/dist/usage.types.d.ts +49 -0
- package/dist/usage.types.js +2 -0
- package/package.json +3 -4
|
@@ -44,6 +44,11 @@ type AppListener = {
|
|
|
44
44
|
tracks?: "inbound" | "outbound" | "both";
|
|
45
45
|
};
|
|
46
46
|
type RecordingPolicy = "off" | "on" | "consent";
|
|
47
|
+
/** An audio filter run on the caller's audio before STT (voice-session, "Audio filters"). */
|
|
48
|
+
type AudioFilter = {
|
|
49
|
+
name: string;
|
|
50
|
+
options?: Record<string, unknown>;
|
|
51
|
+
};
|
|
47
52
|
/** Answering-machine detection: one `amd.result` event per call. */
|
|
48
53
|
type AmdSettings = {
|
|
49
54
|
enabled: boolean;
|
|
@@ -52,7 +57,7 @@ type AmdSettings = {
|
|
|
52
57
|
};
|
|
53
58
|
/** The application model (voice-session G2): a stream or an Autopilot agent. */
|
|
54
59
|
type SessionAppFields = {
|
|
55
|
-
/** ws:// or wss:// URL
|
|
60
|
+
/** ws:// or wss:// URL AppBridge dials (Autopilot agents: the hosted Autopilot). */
|
|
56
61
|
url?: string;
|
|
57
62
|
/** The stream's wire protocol (default fonoster). */
|
|
58
63
|
protocol?: "fonoster" | "twilio";
|
|
@@ -65,6 +70,8 @@ type SessionAppFields = {
|
|
|
65
70
|
recording?: RecordingPolicy | "";
|
|
66
71
|
/** Off when unset. */
|
|
67
72
|
amd?: AmdSettings;
|
|
73
|
+
/** Audio filters in order. An update replaces the whole app: leave them out and they are cleared. */
|
|
74
|
+
filters?: AudioFilter[];
|
|
68
75
|
};
|
|
69
76
|
type Application = SessionAppFields & {
|
|
70
77
|
ref: string;
|
|
@@ -84,7 +91,7 @@ type CreateApplicationRequest = SessionAppFields & {
|
|
|
84
91
|
name: string;
|
|
85
92
|
type: ApplicationType;
|
|
86
93
|
endpoint?: string;
|
|
87
|
-
/** Autopilot apps: the
|
|
94
|
+
/** Autopilot apps: the agent (sessionAgentSchema); productRef is derived from its model. */
|
|
88
95
|
intelligence?: {
|
|
89
96
|
productRef?: string;
|
|
90
97
|
config: Record<string, unknown>;
|
|
@@ -112,9 +119,9 @@ type RotateSigningSecretResponse = {
|
|
|
112
119
|
type ListApplicationsResponse = ListResponse<Application>;
|
|
113
120
|
type EvaluateIntelligenceRequest = {
|
|
114
121
|
intelligence: {
|
|
115
|
-
/** Ignored: the
|
|
122
|
+
/** Ignored: the agent's catalog id names the provider. */
|
|
116
123
|
productRef?: string;
|
|
117
|
-
/** A session
|
|
124
|
+
/** A session agent with testCases. */
|
|
118
125
|
config: Record<string, unknown>;
|
|
119
126
|
};
|
|
120
127
|
};
|
|
@@ -167,4 +174,4 @@ type CreateTestTokenResponse = {
|
|
|
167
174
|
username: string;
|
|
168
175
|
token: string;
|
|
169
176
|
};
|
|
170
|
-
export { AmdSettings, AppListener, AudioFormat, CreateApplicationResponse, UpdateApplicationResponse, RecordingPolicy, RotateSigningSecretResponse, SessionAppFields, SpeechDefaults, Application, ApplicationType, CreateApplicationRequest, CreateTestTokenResponse, ListApplicationsRequest, ListApplicationsResponse, UpdateApplicationRequest, EvaluateIntelligenceRequest, EvaluateIntelligenceEvent, ScenarioEvaluationReport, StepEvaluationReport, ToolEvaluationReport, ExpectedTextType };
|
|
177
|
+
export { AmdSettings, AppListener, AudioFilter, AudioFormat, CreateApplicationResponse, UpdateApplicationResponse, RecordingPolicy, RotateSigningSecretResponse, SessionAppFields, SpeechDefaults, Application, ApplicationType, CreateApplicationRequest, CreateTestTokenResponse, ListApplicationsRequest, ListApplicationsResponse, UpdateApplicationRequest, EvaluateIntelligenceRequest, EvaluateIntelligenceEvent, ScenarioEvaluationReport, StepEvaluationReport, ToolEvaluationReport, ExpectedTextType };
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
/** Where credits came from: the plan, a top-up or the Trial. */
|
|
20
|
+
type CreditSource = {
|
|
21
|
+
/** plan, topup or trial */
|
|
22
|
+
kind: string;
|
|
23
|
+
credits: number;
|
|
24
|
+
/** ISO 8601; empty when they don't expire */
|
|
25
|
+
expiresAt: string;
|
|
26
|
+
};
|
|
27
|
+
type BillingSummary = {
|
|
28
|
+
/** trial or payg */
|
|
29
|
+
plan: string;
|
|
30
|
+
/** active, past_due, closed, or ended (a Trial past its 30 days) */
|
|
31
|
+
status: string;
|
|
32
|
+
/** Credits; negative while in the overdraft */
|
|
33
|
+
balance: number;
|
|
34
|
+
/** How far below zero the balance may go, in credits */
|
|
35
|
+
overdraft: number;
|
|
36
|
+
sources: CreditSource[];
|
|
37
|
+
/** ISO 8601; empty on the Trial */
|
|
38
|
+
periodEnd: string;
|
|
39
|
+
autoRecharge: boolean;
|
|
40
|
+
rechargeThreshold: number;
|
|
41
|
+
rechargeAmount: number;
|
|
42
|
+
};
|
|
43
|
+
type UpdateAutoRechargeRequest = {
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
/** Recharge when the balance falls below this many credits */
|
|
46
|
+
threshold: number;
|
|
47
|
+
/** Credits bought each time (at least the smallest top-up) */
|
|
48
|
+
amount: number;
|
|
49
|
+
};
|
|
50
|
+
type CreateTopUpRequest = {
|
|
51
|
+
/** Credits to buy (at least the smallest top-up); tax is added on top */
|
|
52
|
+
credits: number;
|
|
53
|
+
};
|
|
54
|
+
type CreatePortalSessionRequest = {
|
|
55
|
+
/** Where the Stripe Customer Portal sends the owner back to */
|
|
56
|
+
returnUrl: string;
|
|
57
|
+
};
|
|
58
|
+
type CreatePortalSessionResponse = {
|
|
59
|
+
url: string;
|
|
60
|
+
};
|
|
61
|
+
export { BillingSummary, CreateTopUpRequest, CreatePortalSessionRequest, CreatePortalSessionResponse, CreditSource, UpdateAutoRechargeRequest };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
4
|
+
* http://github.com/fonoster/fonoster
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Fonoster
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the MIT License (the "License");
|
|
9
|
+
* you may not use this file except in compliance with
|
|
10
|
+
* the License. You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* https://opensource.org/licenses/MIT
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
// Fonoster Cloud's billing (billing.proto), for the workspace owner. Amounts are credits
|
|
21
|
+
// (1 credit = $0.01). There is no owner field: the account is always the caller's.
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/calls.types.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ type CallDetailRecord = {
|
|
|
62
62
|
amdDetector?: string;
|
|
63
63
|
amdLatencyMs?: number;
|
|
64
64
|
amdCause?: string;
|
|
65
|
+
appRef?: string;
|
|
65
66
|
};
|
|
66
67
|
type ListCallsRequest = {
|
|
67
68
|
after?: string;
|
|
@@ -70,6 +71,7 @@ type ListCallsRequest = {
|
|
|
70
71
|
status?: CallStatus;
|
|
71
72
|
from?: string;
|
|
72
73
|
to?: string;
|
|
74
|
+
appRef?: string;
|
|
73
75
|
pageSize?: number;
|
|
74
76
|
pageToken?: string;
|
|
75
77
|
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -48,3 +48,5 @@ __exportStar(require("./providers.types"), exports);
|
|
|
48
48
|
__exportStar(require("./webhooks.types"), exports);
|
|
49
49
|
__exportStar(require("./records.types"), exports);
|
|
50
50
|
__exportStar(require("./regions.types"), exports);
|
|
51
|
+
__exportStar(require("./usage.types"), exports);
|
|
52
|
+
__exportStar(require("./billing.types"), exports);
|
|
@@ -21,11 +21,15 @@ type CatalogItem = {
|
|
|
21
21
|
/** Catalog id, e.g. deepgram/nova-3; a provider's id has no slash. */
|
|
22
22
|
id: string;
|
|
23
23
|
kind: "provider" | "model" | "voice";
|
|
24
|
+
/** A display name; absent when the entry has none. */
|
|
25
|
+
label?: string;
|
|
24
26
|
state: "active" | "deprecated";
|
|
25
27
|
providerId: string;
|
|
26
28
|
/** Models: stt, tts or llm. */
|
|
27
|
-
type?: "stt" | "tts" | "llm";
|
|
29
|
+
type?: "stt" | "tts" | "llm" | "nc";
|
|
28
30
|
capabilities?: string[];
|
|
31
|
+
/** Providers: the adapter needs no key (fake, local models). */
|
|
32
|
+
keyless?: boolean;
|
|
29
33
|
languages?: string[];
|
|
30
34
|
features?: string[];
|
|
31
35
|
models?: string[];
|
|
@@ -35,7 +39,8 @@ type CatalogItem = {
|
|
|
35
39
|
};
|
|
36
40
|
type ListCatalogRequest = {
|
|
37
41
|
kind?: "provider" | "model" | "voice";
|
|
38
|
-
type
|
|
42
|
+
/** Models by type, or providers serving the capability (`nc`: noise cancelling). */
|
|
43
|
+
type?: "stt" | "tts" | "llm" | "nc";
|
|
39
44
|
};
|
|
40
45
|
type ListCatalogResponse = {
|
|
41
46
|
items: CatalogItem[];
|
|
@@ -57,7 +62,7 @@ type ListProviderKeysResponse = {
|
|
|
57
62
|
};
|
|
58
63
|
/** Where a warned item is used in the workspace. */
|
|
59
64
|
type WarningUse = {
|
|
60
|
-
kind: "app" | "
|
|
65
|
+
kind: "app" | "agent";
|
|
61
66
|
ref: string;
|
|
62
67
|
name: string;
|
|
63
68
|
/** voice, ttsModel, sttModel or llm */
|
package/dist/records.types.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ type CallRecordSummary = {
|
|
|
28
28
|
endReason: string | null;
|
|
29
29
|
failureReason: string | null;
|
|
30
30
|
sipStatus: number | null;
|
|
31
|
+
/** Who answered, by AMD: human, voicemail, ivr, machine or unknown; null when AMD didn't run. */
|
|
32
|
+
amdStatus: string | null;
|
|
31
33
|
startedAt: string;
|
|
32
34
|
endedAt: string | null;
|
|
33
35
|
durationSeconds: number;
|
|
@@ -43,6 +45,8 @@ type ListCallRecordsRequest = {
|
|
|
43
45
|
/** Matches the from or to number. */
|
|
44
46
|
number?: string;
|
|
45
47
|
appRef?: string;
|
|
48
|
+
/** inbound, outbound or internal. */
|
|
49
|
+
direction?: string;
|
|
46
50
|
status?: string;
|
|
47
51
|
pageSize?: number;
|
|
48
52
|
pageToken?: string;
|
package/dist/regions.types.d.ts
CHANGED
|
@@ -97,12 +97,12 @@ type Region = {
|
|
|
97
97
|
lastSeenAt?: string;
|
|
98
98
|
enrolledAt?: string;
|
|
99
99
|
components?: {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
roomrNodes: number;
|
|
101
|
+
appbridges: number;
|
|
102
102
|
autopilot: boolean;
|
|
103
103
|
};
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
roomrNodes?: number;
|
|
105
|
+
appbridges?: number;
|
|
106
106
|
activeCalls?: number;
|
|
107
107
|
configVersion?: number;
|
|
108
108
|
/** Owner views: the workspaces the region serves. */
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
/** A dimension usage totals can be grouped by (usage.proto). */
|
|
20
|
+
type UsageGroupBy = "day" | "workspace" | "meter" | "provider" | "model" | "key_source" | "origin";
|
|
21
|
+
type GetUsageRequest = {
|
|
22
|
+
/** YYYY-MM-DD (UTC), inclusive. */
|
|
23
|
+
fromDay: string;
|
|
24
|
+
/** YYYY-MM-DD (UTC), inclusive. */
|
|
25
|
+
toDay: string;
|
|
26
|
+
/** Totals are always split by meter. */
|
|
27
|
+
groupBy?: UsageGroupBy[];
|
|
28
|
+
/** Owners only: every workspace the caller owns. */
|
|
29
|
+
allOwned?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** One usage total: quantities only, never money. Unrequested dimensions are empty. */
|
|
32
|
+
type UsageRow = {
|
|
33
|
+
day: string;
|
|
34
|
+
workspaceRef: string;
|
|
35
|
+
meter: string;
|
|
36
|
+
/** second, character, token, count or byte */
|
|
37
|
+
unit: string;
|
|
38
|
+
provider: string;
|
|
39
|
+
model: string;
|
|
40
|
+
/** platform or workspace; empty for meters that call no vendor */
|
|
41
|
+
keySource: string;
|
|
42
|
+
/** call, browser_test, eval or api */
|
|
43
|
+
origin: string;
|
|
44
|
+
quantity: number;
|
|
45
|
+
};
|
|
46
|
+
type GetUsageResponse = {
|
|
47
|
+
rows: UsageRow[];
|
|
48
|
+
};
|
|
49
|
+
export { GetUsageRequest, GetUsageResponse, UsageGroupBy, UsageRow };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Common types for Fonoster projects",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"prebuild": "rimraf ./dist tsconfig.tsbuildinfo",
|
|
16
|
-
"build": "tsc -b tsconfig.json"
|
|
17
|
-
"clean": "rimraf ./dist node_modules tsconfig.tsbuildinfo"
|
|
16
|
+
"build": "tsc -b tsconfig.json"
|
|
18
17
|
},
|
|
19
18
|
"files": [
|
|
20
19
|
"dist"
|
|
@@ -29,5 +28,5 @@
|
|
|
29
28
|
"bugs": {
|
|
30
29
|
"url": "https://github.com/fonoster/fonoster/issues"
|
|
31
30
|
},
|
|
32
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "f0a5102dddeea0f70f659234108805bc10690f2e"
|
|
33
32
|
}
|