@fonoster/types 0.27.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 +75 -23
- package/dist/applications.types.js +1 -1
- 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/identity.types.d.ts +5 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/providers.types.d.ts +88 -0
- package/dist/providers.types.js +2 -0
- package/dist/records.types.d.ts +77 -0
- package/dist/records.types.js +2 -0
- package/dist/regions.types.d.ts +139 -0
- package/dist/regions.types.js +2 -0
- package/dist/usage.types.d.ts +49 -0
- package/dist/usage.types.js +2 -0
- package/dist/webhooks.types.d.ts +73 -0
- package/dist/webhooks.types.js +2 -0
- package/dist/workspaces.types.d.ts +12 -1
- package/package.json +3 -4
|
@@ -19,26 +19,67 @@
|
|
|
19
19
|
import { BaseApiObject, ListRequest, ListResponse } from "./common";
|
|
20
20
|
import { Flatten } from "./utils";
|
|
21
21
|
declare enum ApplicationType {
|
|
22
|
-
|
|
22
|
+
STREAM = "STREAM",
|
|
23
23
|
AUTOPILOT = "AUTOPILOT"
|
|
24
24
|
}
|
|
25
25
|
declare enum ExpectedTextType {
|
|
26
26
|
EXACT = "EXACT",
|
|
27
27
|
SIMILAR = "SIMILAR"
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
/** Speech defaults of an application; voices and models are catalog ids. */
|
|
30
|
+
type SpeechDefaults = {
|
|
31
|
+
voice?: string;
|
|
32
|
+
language?: string;
|
|
33
|
+
sttModel?: string;
|
|
34
|
+
ttsModel?: string;
|
|
35
|
+
silenceTimeoutMs?: number;
|
|
36
|
+
patience?: "low" | "normal" | "high";
|
|
37
|
+
};
|
|
38
|
+
type AudioFormat = {
|
|
39
|
+
codec: "pcm16" | "pcmu";
|
|
40
|
+
rate: number;
|
|
41
|
+
};
|
|
42
|
+
type AppListener = {
|
|
43
|
+
url: string;
|
|
44
|
+
tracks?: "inbound" | "outbound" | "both";
|
|
45
|
+
};
|
|
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
|
+
};
|
|
52
|
+
/** Answering-machine detection: one `amd.result` event per call. */
|
|
53
|
+
type AmdSettings = {
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
/** Caller audio to classify in ms (default 4000; 500 to 15000). */
|
|
56
|
+
windowMs?: number;
|
|
57
|
+
};
|
|
58
|
+
/** The application model (voice-session G2): a stream or an Autopilot agent. */
|
|
59
|
+
type SessionAppFields = {
|
|
60
|
+
/** ws:// or wss:// URL AppBridge dials (Autopilot agents: the hosted Autopilot). */
|
|
61
|
+
url?: string;
|
|
62
|
+
/** The stream's wire protocol (default fonoster). */
|
|
63
|
+
protocol?: "fonoster" | "twilio";
|
|
64
|
+
speech?: SpeechDefaults;
|
|
65
|
+
audio?: AudioFormat;
|
|
66
|
+
fallbackAppRef?: string;
|
|
67
|
+
fallbackMessage?: string;
|
|
68
|
+
listeners?: AppListener[];
|
|
69
|
+
/** Empty inherits the workspace's policy. */
|
|
70
|
+
recording?: RecordingPolicy | "";
|
|
71
|
+
/** Off when unset. */
|
|
72
|
+
amd?: AmdSettings;
|
|
73
|
+
/** Audio filters in order. An update replaces the whole app: leave them out and they are cleared. */
|
|
74
|
+
filters?: AudioFilter[];
|
|
75
|
+
};
|
|
76
|
+
type Application = SessionAppFields & {
|
|
30
77
|
ref: string;
|
|
31
78
|
name: string;
|
|
32
79
|
type: ApplicationType;
|
|
80
|
+
/** The last characters of the signing secret; the secret itself is never read back. */
|
|
81
|
+
signingSecretHint?: string;
|
|
33
82
|
endpoint?: string;
|
|
34
|
-
textToSpeech?: {
|
|
35
|
-
productRef: string;
|
|
36
|
-
config: Record<string, unknown>;
|
|
37
|
-
};
|
|
38
|
-
speechToText?: {
|
|
39
|
-
productRef: string;
|
|
40
|
-
config: Record<string, unknown>;
|
|
41
|
-
};
|
|
42
83
|
intelligence?: {
|
|
43
84
|
productRef: string;
|
|
44
85
|
config: Record<string, unknown>;
|
|
@@ -46,30 +87,41 @@ type Application = {
|
|
|
46
87
|
createdAt: Date;
|
|
47
88
|
updatedAt: Date;
|
|
48
89
|
};
|
|
49
|
-
type CreateApplicationRequest = {
|
|
90
|
+
type CreateApplicationRequest = SessionAppFields & {
|
|
50
91
|
name: string;
|
|
51
92
|
type: ApplicationType;
|
|
52
93
|
endpoint?: string;
|
|
53
|
-
|
|
54
|
-
productRef: string;
|
|
55
|
-
config: Record<string, unknown>;
|
|
56
|
-
};
|
|
57
|
-
speechToText?: {
|
|
58
|
-
productRef: string;
|
|
59
|
-
config: Record<string, unknown>;
|
|
60
|
-
};
|
|
94
|
+
/** Autopilot apps: the agent (sessionAgentSchema); productRef is derived from its model. */
|
|
61
95
|
intelligence?: {
|
|
62
|
-
productRef
|
|
63
|
-
credentials: Record<string, unknown>;
|
|
96
|
+
productRef?: string;
|
|
64
97
|
config: Record<string, unknown>;
|
|
65
98
|
};
|
|
66
99
|
};
|
|
67
100
|
type UpdateApplicationRequest = Flatten<BaseApiObject & Partial<CreateApplicationRequest>>;
|
|
68
101
|
type ListApplicationsRequest = ListRequest;
|
|
102
|
+
type CreateApplicationResponse = {
|
|
103
|
+
ref: string;
|
|
104
|
+
/** Shown only here and on rotation. */
|
|
105
|
+
signingSecret?: string;
|
|
106
|
+
signingSecretHint?: string;
|
|
107
|
+
};
|
|
108
|
+
type UpdateApplicationResponse = {
|
|
109
|
+
ref: string;
|
|
110
|
+
/** Set only when the update generated a new secret (the app stopped being an Autopilot app). */
|
|
111
|
+
signingSecret?: string;
|
|
112
|
+
signingSecretHint?: string;
|
|
113
|
+
};
|
|
114
|
+
type RotateSigningSecretResponse = {
|
|
115
|
+
ref: string;
|
|
116
|
+
signingSecret: string;
|
|
117
|
+
signingSecretHint: string;
|
|
118
|
+
};
|
|
69
119
|
type ListApplicationsResponse = ListResponse<Application>;
|
|
70
120
|
type EvaluateIntelligenceRequest = {
|
|
71
121
|
intelligence: {
|
|
72
|
-
|
|
122
|
+
/** Ignored: the agent's catalog id names the provider. */
|
|
123
|
+
productRef?: string;
|
|
124
|
+
/** A session agent with testCases. */
|
|
73
125
|
config: Record<string, unknown>;
|
|
74
126
|
};
|
|
75
127
|
};
|
|
@@ -122,4 +174,4 @@ type CreateTestTokenResponse = {
|
|
|
122
174
|
username: string;
|
|
123
175
|
token: string;
|
|
124
176
|
};
|
|
125
|
-
export { 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 };
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ExpectedTextType = exports.ApplicationType = void 0;
|
|
4
4
|
var ApplicationType;
|
|
5
5
|
(function (ApplicationType) {
|
|
6
|
-
ApplicationType["
|
|
6
|
+
ApplicationType["STREAM"] = "STREAM";
|
|
7
7
|
ApplicationType["AUTOPILOT"] = "AUTOPILOT";
|
|
8
8
|
})(ApplicationType || (exports.ApplicationType = ApplicationType = {}));
|
|
9
9
|
var 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/identity.types.d.ts
CHANGED
|
@@ -54,7 +54,10 @@ type CreateApiKeyResponse = {
|
|
|
54
54
|
type UpdateUserRequest = {
|
|
55
55
|
ref: string;
|
|
56
56
|
name?: string;
|
|
57
|
+
/** A new password; requires currentPassword. */
|
|
57
58
|
password?: string;
|
|
59
|
+
/** The account's current password, required to set a new one. */
|
|
60
|
+
currentPassword?: string;
|
|
58
61
|
avatar?: string;
|
|
59
62
|
phone?: string;
|
|
60
63
|
};
|
|
@@ -77,7 +80,8 @@ type ApiKey = {
|
|
|
77
80
|
};
|
|
78
81
|
type SendResetPasswordCodeRequest = {
|
|
79
82
|
username: string;
|
|
80
|
-
|
|
83
|
+
/** Deprecated and ignored: Identity links to its configured reset page. */
|
|
84
|
+
resetPasswordUrl?: string;
|
|
81
85
|
};
|
|
82
86
|
type ResetPasswordRequest = {
|
|
83
87
|
username: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,3 +28,9 @@ export * from "./numbers.types";
|
|
|
28
28
|
export * from "./secrets.types";
|
|
29
29
|
export * from "./trunks.types";
|
|
30
30
|
export * from "./workspaces.types";
|
|
31
|
+
export * from "./providers.types";
|
|
32
|
+
export * from "./webhooks.types";
|
|
33
|
+
export * from "./records.types";
|
|
34
|
+
export * from "./regions.types";
|
|
35
|
+
export * from "./usage.types";
|
|
36
|
+
export * from "./billing.types";
|
package/dist/index.js
CHANGED
|
@@ -44,3 +44,9 @@ __exportStar(require("./numbers.types"), exports);
|
|
|
44
44
|
__exportStar(require("./secrets.types"), exports);
|
|
45
45
|
__exportStar(require("./trunks.types"), exports);
|
|
46
46
|
__exportStar(require("./workspaces.types"), exports);
|
|
47
|
+
__exportStar(require("./providers.types"), exports);
|
|
48
|
+
__exportStar(require("./webhooks.types"), exports);
|
|
49
|
+
__exportStar(require("./records.types"), exports);
|
|
50
|
+
__exportStar(require("./regions.types"), exports);
|
|
51
|
+
__exportStar(require("./usage.types"), exports);
|
|
52
|
+
__exportStar(require("./billing.types"), exports);
|
|
@@ -0,0 +1,88 @@
|
|
|
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 catalog entry visible to the workspace (add-provider-registry). */
|
|
20
|
+
type CatalogItem = {
|
|
21
|
+
/** Catalog id, e.g. deepgram/nova-3; a provider's id has no slash. */
|
|
22
|
+
id: string;
|
|
23
|
+
kind: "provider" | "model" | "voice";
|
|
24
|
+
/** A display name; absent when the entry has none. */
|
|
25
|
+
label?: string;
|
|
26
|
+
state: "active" | "deprecated";
|
|
27
|
+
providerId: string;
|
|
28
|
+
/** Models: stt, tts or llm. */
|
|
29
|
+
type?: "stt" | "tts" | "llm" | "nc";
|
|
30
|
+
capabilities?: string[];
|
|
31
|
+
/** Providers: the adapter needs no key (fake, local models). */
|
|
32
|
+
keyless?: boolean;
|
|
33
|
+
languages?: string[];
|
|
34
|
+
features?: string[];
|
|
35
|
+
models?: string[];
|
|
36
|
+
gender?: string;
|
|
37
|
+
replacement?: string;
|
|
38
|
+
retireOn?: string;
|
|
39
|
+
};
|
|
40
|
+
type ListCatalogRequest = {
|
|
41
|
+
kind?: "provider" | "model" | "voice";
|
|
42
|
+
/** Models by type, or providers serving the capability (`nc`: noise cancelling). */
|
|
43
|
+
type?: "stt" | "tts" | "llm" | "nc";
|
|
44
|
+
};
|
|
45
|
+
type ListCatalogResponse = {
|
|
46
|
+
items: CatalogItem[];
|
|
47
|
+
};
|
|
48
|
+
/** A workspace's own vendor key; the key is only in its write-only Secret. */
|
|
49
|
+
type ProviderKey = {
|
|
50
|
+
ref: string;
|
|
51
|
+
providerId: string;
|
|
52
|
+
secretRef: string;
|
|
53
|
+
createdAt: Date;
|
|
54
|
+
updatedAt: Date;
|
|
55
|
+
};
|
|
56
|
+
type SetProviderKeyRequest = {
|
|
57
|
+
providerId: string;
|
|
58
|
+
key: string;
|
|
59
|
+
};
|
|
60
|
+
type ListProviderKeysResponse = {
|
|
61
|
+
items: ProviderKey[];
|
|
62
|
+
};
|
|
63
|
+
/** Where a warned item is used in the workspace. */
|
|
64
|
+
type WarningUse = {
|
|
65
|
+
kind: "app" | "agent";
|
|
66
|
+
ref: string;
|
|
67
|
+
name: string;
|
|
68
|
+
/** voice, ttsModel, sttModel or llm */
|
|
69
|
+
field: string;
|
|
70
|
+
/** For a TTS model: the voice the config uses with it. */
|
|
71
|
+
voice?: string;
|
|
72
|
+
};
|
|
73
|
+
/** A deprecated or retired catalog item the workspace uses (dashboard warnings). */
|
|
74
|
+
type CatalogWarning = {
|
|
75
|
+
id: string;
|
|
76
|
+
kind: "provider" | "model" | "voice";
|
|
77
|
+
state: "deprecated" | "retired";
|
|
78
|
+
replacement?: string;
|
|
79
|
+
retireOn?: string;
|
|
80
|
+
usedBy: WarningUse[];
|
|
81
|
+
runtimeApps: string[];
|
|
82
|
+
runtimeSessions: number;
|
|
83
|
+
lastUsedAt?: string;
|
|
84
|
+
};
|
|
85
|
+
type ListWarningsResponse = {
|
|
86
|
+
items: CatalogWarning[];
|
|
87
|
+
};
|
|
88
|
+
export { CatalogWarning, ListWarningsResponse, WarningUse, CatalogItem, ListCatalogRequest, ListCatalogResponse, ListProviderKeysResponse, ProviderKey, SetProviderKeyRequest };
|
|
@@ -0,0 +1,77 @@
|
|
|
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 call record's index entry (add-call-record, /api/records). */
|
|
20
|
+
type CallRecordSummary = {
|
|
21
|
+
callRef: string;
|
|
22
|
+
appRef: string | null;
|
|
23
|
+
from: string | null;
|
|
24
|
+
to: string | null;
|
|
25
|
+
direction: string | null;
|
|
26
|
+
/** completed, failed, erased, ... */
|
|
27
|
+
status: string;
|
|
28
|
+
endReason: string | null;
|
|
29
|
+
failureReason: string | null;
|
|
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;
|
|
33
|
+
startedAt: string;
|
|
34
|
+
endedAt: string | null;
|
|
35
|
+
durationSeconds: number;
|
|
36
|
+
region: string;
|
|
37
|
+
version: number;
|
|
38
|
+
size: number;
|
|
39
|
+
parts: string[];
|
|
40
|
+
};
|
|
41
|
+
type ListCallRecordsRequest = {
|
|
42
|
+
/** ISO time bounds on startedAt. */
|
|
43
|
+
after?: string;
|
|
44
|
+
before?: string;
|
|
45
|
+
/** Matches the from or to number. */
|
|
46
|
+
number?: string;
|
|
47
|
+
appRef?: string;
|
|
48
|
+
/** inbound, outbound or internal. */
|
|
49
|
+
direction?: string;
|
|
50
|
+
status?: string;
|
|
51
|
+
pageSize?: number;
|
|
52
|
+
pageToken?: string;
|
|
53
|
+
};
|
|
54
|
+
type ListCallRecordsResponse = {
|
|
55
|
+
items: CallRecordSummary[];
|
|
56
|
+
nextPageToken?: string;
|
|
57
|
+
};
|
|
58
|
+
/** One version of a record: the vCon (redacted unless `original`) and its signature. */
|
|
59
|
+
type CallRecordDetail = CallRecordSummary & {
|
|
60
|
+
currentVersion: number;
|
|
61
|
+
redacted: boolean;
|
|
62
|
+
vcon: Record<string, unknown>;
|
|
63
|
+
jws: unknown;
|
|
64
|
+
};
|
|
65
|
+
type CallRecordAuditEntry = {
|
|
66
|
+
action: string;
|
|
67
|
+
part: string;
|
|
68
|
+
reason: string;
|
|
69
|
+
actor: string;
|
|
70
|
+
version: number;
|
|
71
|
+
at: string;
|
|
72
|
+
};
|
|
73
|
+
type RetentionPolicy = {
|
|
74
|
+
part: string;
|
|
75
|
+
days: number | null;
|
|
76
|
+
};
|
|
77
|
+
export { CallRecordAuditEntry, CallRecordDetail, CallRecordSummary, ListCallRecordsRequest, ListCallRecordsResponse, RetentionPolicy };
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
/** Regions (add-private-regions). */
|
|
20
|
+
type RegionStatus = "waiting" | "connected" | "degraded" | "offline" | "unsupported";
|
|
21
|
+
type RegionKind = "public" | "private";
|
|
22
|
+
/** A region in a list (`GET /api/regions`): offered public regions and the caller's own. */
|
|
23
|
+
type RegionSummary = {
|
|
24
|
+
/** Absent for a configured public region. */
|
|
25
|
+
ref?: string;
|
|
26
|
+
id: string;
|
|
27
|
+
/** Same as displayName. */
|
|
28
|
+
name: string;
|
|
29
|
+
displayName: string;
|
|
30
|
+
kind: RegionKind;
|
|
31
|
+
default: boolean;
|
|
32
|
+
status: RegionStatus;
|
|
33
|
+
/** Same as status. */
|
|
34
|
+
state: RegionStatus;
|
|
35
|
+
sipDomain?: string;
|
|
36
|
+
/** The caller's private regions: how many workspaces use it. */
|
|
37
|
+
workspaces?: number;
|
|
38
|
+
published?: boolean;
|
|
39
|
+
};
|
|
40
|
+
/** @deprecated use RegionSummary */
|
|
41
|
+
type PublicRegion = RegionSummary;
|
|
42
|
+
type ListRegionsResponse = {
|
|
43
|
+
items: RegionSummary[];
|
|
44
|
+
};
|
|
45
|
+
type RegionSecret = {
|
|
46
|
+
name: string;
|
|
47
|
+
usedBy: string[];
|
|
48
|
+
set: boolean;
|
|
49
|
+
};
|
|
50
|
+
type SipTransport = "udp" | "tcp" | "tls" | "ws" | "wss";
|
|
51
|
+
/** Where carriers and softphones reach a region (contract §3 `region.R.endpoints`, §3a). */
|
|
52
|
+
type RegionEndpoints = {
|
|
53
|
+
sip: {
|
|
54
|
+
host: string;
|
|
55
|
+
port: number;
|
|
56
|
+
transport: SipTransport;
|
|
57
|
+
}[];
|
|
58
|
+
/** Public addresses carriers must allowlist for signaling. */
|
|
59
|
+
signalingAddresses: string[];
|
|
60
|
+
/** Public addresses media (RTP) comes from. */
|
|
61
|
+
mediaAddresses: string[];
|
|
62
|
+
rtpPorts?: {
|
|
63
|
+
min: number;
|
|
64
|
+
max: number;
|
|
65
|
+
};
|
|
66
|
+
/** The region's SIP domain (PR-16): workspaces get subdomains of it. */
|
|
67
|
+
sipDomain?: string;
|
|
68
|
+
updatedAt?: string;
|
|
69
|
+
};
|
|
70
|
+
type RegionWorkspace = {
|
|
71
|
+
ref: string;
|
|
72
|
+
accessKeyId: string;
|
|
73
|
+
name: string;
|
|
74
|
+
/** The workspace's SIP domain in this region (`<label>.<sipDomain>`). */
|
|
75
|
+
domain?: string;
|
|
76
|
+
};
|
|
77
|
+
/** A region and its status (contract §0 `Region`). */
|
|
78
|
+
type Region = {
|
|
79
|
+
ref: string;
|
|
80
|
+
id: string;
|
|
81
|
+
kind: RegionKind;
|
|
82
|
+
name: string;
|
|
83
|
+
displayName: string;
|
|
84
|
+
default?: boolean;
|
|
85
|
+
sipDomain?: string;
|
|
86
|
+
ownerRef?: string;
|
|
87
|
+
published?: boolean;
|
|
88
|
+
status: RegionStatus;
|
|
89
|
+
/** Same as status (alias). */
|
|
90
|
+
state: RegionStatus;
|
|
91
|
+
reason?: string;
|
|
92
|
+
unsupportedReason?: string;
|
|
93
|
+
requiredVersion?: string;
|
|
94
|
+
version?: string;
|
|
95
|
+
lastHeartbeatAt?: string;
|
|
96
|
+
/** Same as lastHeartbeatAt. */
|
|
97
|
+
lastSeenAt?: string;
|
|
98
|
+
enrolledAt?: string;
|
|
99
|
+
components?: {
|
|
100
|
+
roomrNodes: number;
|
|
101
|
+
appbridges: number;
|
|
102
|
+
autopilot: boolean;
|
|
103
|
+
};
|
|
104
|
+
roomrNodes?: number;
|
|
105
|
+
appbridges?: number;
|
|
106
|
+
activeCalls?: number;
|
|
107
|
+
configVersion?: number;
|
|
108
|
+
/** Owner views: the workspaces the region serves. */
|
|
109
|
+
workspaces?: RegionWorkspace[];
|
|
110
|
+
/** `getRegion()` of the current workspace: its SIP domain in the region. */
|
|
111
|
+
workspaceDomain?: string;
|
|
112
|
+
secretsNeeded?: string[];
|
|
113
|
+
secretsSet?: string[];
|
|
114
|
+
secrets: RegionSecret[];
|
|
115
|
+
/** Connection details; absent until a region's cell reports them. */
|
|
116
|
+
endpoints?: RegionEndpoints;
|
|
117
|
+
/** Private regions on the cloud: the flat monthly fee (PR-11); null when billing is off. */
|
|
118
|
+
monthlyFeeCents?: number | null;
|
|
119
|
+
/** Private regions: minutes reported this calendar month (UTC); shown, not billed. */
|
|
120
|
+
minutesThisMonth?: number;
|
|
121
|
+
};
|
|
122
|
+
type CreateRegionRequest = {
|
|
123
|
+
/** 3-32 lowercase letters, digits, hyphens; starts with a letter; never changes (PR-18). */
|
|
124
|
+
id: string;
|
|
125
|
+
displayName: string;
|
|
126
|
+
/** Your SIP domain (PR-16), e.g. sip.acme.com; point *.sip.acme.com at the region. */
|
|
127
|
+
sipDomain: string;
|
|
128
|
+
};
|
|
129
|
+
/** A one-time enrollment token (shown once); `enrollmentToken` is the same value. */
|
|
130
|
+
type RegionEnrollmentToken = {
|
|
131
|
+
token: string;
|
|
132
|
+
enrollmentToken: string;
|
|
133
|
+
expiresAt: string;
|
|
134
|
+
};
|
|
135
|
+
type CreateRegionResponse = RegionEnrollmentToken & {
|
|
136
|
+
ref: string;
|
|
137
|
+
id: string;
|
|
138
|
+
};
|
|
139
|
+
export { CreateRegionRequest, CreateRegionResponse, ListRegionsResponse, RegionKind, RegionSummary, RegionWorkspace, PublicRegion, Region, RegionEndpoints, RegionEnrollmentToken, RegionSecret, RegionStatus, SipTransport };
|
|
@@ -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 };
|
|
@@ -0,0 +1,73 @@
|
|
|
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 { ListRequest, ListResponse } from "./common";
|
|
20
|
+
/** A workspace webhook endpoint (add-workspace-webhooks). */
|
|
21
|
+
type Webhook = {
|
|
22
|
+
ref: string;
|
|
23
|
+
url: string;
|
|
24
|
+
events: string[];
|
|
25
|
+
/** The last characters of the current secret. */
|
|
26
|
+
secretHint: string;
|
|
27
|
+
/** Until when the previous secret still verifies (after a rotation). */
|
|
28
|
+
previousSecretUntil?: Date;
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
updatedAt: Date;
|
|
31
|
+
};
|
|
32
|
+
type CreateWebhookRequest = {
|
|
33
|
+
url: string;
|
|
34
|
+
events: string[];
|
|
35
|
+
};
|
|
36
|
+
type CreateWebhookResponse = {
|
|
37
|
+
ref: string;
|
|
38
|
+
/** Shown only here and on rotation. */
|
|
39
|
+
secret: string;
|
|
40
|
+
};
|
|
41
|
+
type UpdateWebhookRequest = {
|
|
42
|
+
ref: string;
|
|
43
|
+
url?: string;
|
|
44
|
+
events?: string[];
|
|
45
|
+
};
|
|
46
|
+
type ListWebhooksRequest = ListRequest;
|
|
47
|
+
type ListWebhooksResponse = ListResponse<Webhook>;
|
|
48
|
+
type RotateWebhookSecretResponse = {
|
|
49
|
+
ref: string;
|
|
50
|
+
secret: string;
|
|
51
|
+
previousSecretUntil: Date;
|
|
52
|
+
};
|
|
53
|
+
type WebhookDelivery = {
|
|
54
|
+
ref: string;
|
|
55
|
+
webhookRef: string;
|
|
56
|
+
eventId: string;
|
|
57
|
+
eventType: string;
|
|
58
|
+
status: "pending" | "succeeded" | "failed";
|
|
59
|
+
attempts: number;
|
|
60
|
+
/** HTTP status of the last attempt (0: no response). */
|
|
61
|
+
lastStatus?: number;
|
|
62
|
+
lastAttemptAt?: Date;
|
|
63
|
+
nextAttemptAt?: Date;
|
|
64
|
+
createdAt: Date;
|
|
65
|
+
};
|
|
66
|
+
type ListWebhookDeliveriesRequest = {
|
|
67
|
+
webhookRef?: string;
|
|
68
|
+
pageSize?: number;
|
|
69
|
+
};
|
|
70
|
+
type ListWebhookDeliveriesResponse = {
|
|
71
|
+
items: WebhookDelivery[];
|
|
72
|
+
};
|
|
73
|
+
export { CreateWebhookRequest, CreateWebhookResponse, ListWebhookDeliveriesRequest, ListWebhookDeliveriesResponse, ListWebhooksRequest, ListWebhooksResponse, RotateWebhookSecretResponse, UpdateWebhookRequest, Webhook, WebhookDelivery };
|
|
@@ -34,6 +34,8 @@ type Workspace = {
|
|
|
34
34
|
accessKeyId: string;
|
|
35
35
|
createdAt: Date;
|
|
36
36
|
updatedAt: Date;
|
|
37
|
+
/** A public region id (`default`, `us-east-1`) or a private region ref (`rg_…`). Immutable. */
|
|
38
|
+
region?: string;
|
|
37
39
|
owner?: {
|
|
38
40
|
ref: string;
|
|
39
41
|
name: string;
|
|
@@ -42,6 +44,15 @@ type Workspace = {
|
|
|
42
44
|
};
|
|
43
45
|
type CreateWorkspaceRequest = {
|
|
44
46
|
name: string;
|
|
47
|
+
/**
|
|
48
|
+
* An offered public region id (default `default`) or one of your private regions (id or ref),
|
|
49
|
+
* created first with `sdk.regions.createRegion`. Fixed for life.
|
|
50
|
+
*/
|
|
51
|
+
region?: string;
|
|
52
|
+
};
|
|
53
|
+
type CreateWorkspaceResponse = {
|
|
54
|
+
ref: string;
|
|
55
|
+
region?: string;
|
|
45
56
|
};
|
|
46
57
|
type UpdateWorkspaceRequest = {
|
|
47
58
|
ref: string;
|
|
@@ -70,4 +81,4 @@ type ResendWorkspaceMembershipInvitationRequest = {
|
|
|
70
81
|
type ResendWorkspaceMembershipInvitationResponse = {
|
|
71
82
|
userRef: string;
|
|
72
83
|
};
|
|
73
|
-
export { CreateWorkspaceRequest, InviteUserToWorkspaceRequest, InviteUserToWorkspaceResponse, ListWorkspacesResponse, RemoveUserFromWorkspaceRequest, RemoveUserFromWorkspaceResponse, ResendWorkspaceMembershipInvitationRequest, ResendWorkspaceMembershipInvitationResponse, UpdateWorkspaceRequest, Workspace, WorkspaceMemberStatus, Role };
|
|
84
|
+
export { CreateWorkspaceResponse, CreateWorkspaceRequest, InviteUserToWorkspaceRequest, InviteUserToWorkspaceResponse, ListWorkspacesResponse, RemoveUserFromWorkspaceRequest, RemoveUserFromWorkspaceResponse, ResendWorkspaceMembershipInvitationRequest, ResendWorkspaceMembershipInvitationResponse, UpdateWorkspaceRequest, Workspace, WorkspaceMemberStatus, Role };
|
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
|
}
|