mavenagi 1.2.68 → 1.2.69

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/BaseClient.js CHANGED
@@ -46,8 +46,8 @@ function normalizeClientOptions(options) {
46
46
  const headers = (0, headers_1.mergeHeaders)({
47
47
  "X-Fern-Language": "JavaScript",
48
48
  "X-Fern-SDK-Name": "mavenagi",
49
- "X-Fern-SDK-Version": "1.2.68",
50
- "User-Agent": "mavenagi/1.2.68",
49
+ "X-Fern-SDK-Version": "1.2.69",
50
+ "User-Agent": "mavenagi/1.2.69",
51
51
  "X-Fern-Runtime": core.RUNTIME.type,
52
52
  "X-Fern-Runtime-Version": core.RUNTIME.version,
53
53
  "X-Organization-Id": options === null || options === void 0 ? void 0 : options.organizationId,
@@ -14,7 +14,8 @@ export declare class VoiceClient {
14
14
  * Creates a short-lived session token for authenticating voice connections.
15
15
  *
16
16
  * Supports two token types:
17
- * - **webrtc**: A Twilio-compatible access token for browser-based WebRTC calls
17
+ * - **webrtc**: A token for browser-based WebRTC calls. The `transport` field selects the token format:
18
+ * a token for the Maven telephony gateway (default) or a Twilio access token.
18
19
  * - **websocket**: An ES256 JWT for direct WebSocket connections to /v1/realtime/conversations
19
20
  *
20
21
  * Session tokens are required before establishing any voice connection.
@@ -61,7 +61,8 @@ class VoiceClient {
61
61
  * Creates a short-lived session token for authenticating voice connections.
62
62
  *
63
63
  * Supports two token types:
64
- * - **webrtc**: A Twilio-compatible access token for browser-based WebRTC calls
64
+ * - **webrtc**: A token for browser-based WebRTC calls. The `transport` field selects the token format:
65
+ * a token for the Maven telephony gateway (default) or a Twilio access token.
65
66
  * - **websocket**: An ES256 JWT for direct WebSocket connections to /v1/realtime/conversations
66
67
  *
67
68
  * Session tokens are required before establishing any voice connection.
@@ -8,9 +8,18 @@ export interface VoiceSessionTokenRequest {
8
8
  appUserId: string;
9
9
  /**
10
10
  * The type of session token to generate.
11
- * Use "webrtc" for browser-based calls via Twilio, or "websocket" for direct WebSocket connections.
11
+ * Use "webrtc" for browser-based calls, or "websocket" for direct WebSocket connections.
12
+ * For "webrtc", `transport` selects the Maven telephony gateway (default) or Twilio.
12
13
  */
13
14
  type: MavenAGI.VoiceTokenType;
15
+ /**
16
+ * The transport for a "webrtc" call. Default: "gateway".
17
+ * - "gateway": the response `token` is a token for the Maven telephony gateway, and the response includes `connectUrl`.
18
+ * - "twilio": the response `token` is a Twilio access token.
19
+ *
20
+ * The server ignores this field for "websocket" tokens.
21
+ */
22
+ transport?: MavenAGI.VoiceWebRtcTransport;
14
23
  /**
15
24
  * Arbitrary key-value metadata to associate with this session (e.g., conversationId, topic).
16
25
  *
@@ -1,6 +1,10 @@
1
1
  import type * as MavenAGI from "../../../index";
2
2
  export interface VoiceSessionTokenResponse {
3
- /** Opaque JWT session token. Pass this in the Authorization header when connecting. */
3
+ /**
4
+ * Opaque session token. Pass this in the Authorization header when connecting.
5
+ * For "websocket", the token is an ES256 JWT.
6
+ * For "webrtc", the token format depends on `transport`.
7
+ */
4
8
  token: string;
5
9
  /** The identity string associated with this token (echoes appUserId). */
6
10
  identity: string;
@@ -8,4 +12,10 @@ export interface VoiceSessionTokenResponse {
8
12
  type: MavenAGI.VoiceTokenType;
9
13
  /** Time in seconds until the token expires. */
10
14
  expiresIn: number;
15
+ /**
16
+ * The URL that starts a "webrtc" call through the Maven telephony gateway.
17
+ * The client sends `token` to this URL to start the call.
18
+ * Present only when the request sets `transport` to "gateway".
19
+ */
20
+ connectUrl?: string;
11
21
  }
@@ -0,0 +1,10 @@
1
+ /** The transport that carries a "webrtc" call. */
2
+ export declare const VoiceWebRtcTransport: {
3
+ /**
4
+ * The Maven telephony gateway. The token is a gateway token. */
5
+ readonly Gateway: "gateway";
6
+ /**
7
+ * Twilio Voice. The token is a Twilio access token. */
8
+ readonly Twilio: "twilio";
9
+ };
10
+ export type VoiceWebRtcTransport = (typeof VoiceWebRtcTransport)[keyof typeof VoiceWebRtcTransport] | string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VoiceWebRtcTransport = void 0;
5
+ /** The transport that carries a "webrtc" call. */
6
+ exports.VoiceWebRtcTransport = {
7
+ /**
8
+ * The Maven telephony gateway. The token is a gateway token. */
9
+ Gateway: "gateway",
10
+ /**
11
+ * Twilio Voice. The token is a Twilio access token. */
12
+ Twilio: "twilio",
13
+ };
@@ -1,3 +1,4 @@
1
1
  export * from "./VoiceSessionTokenRequest";
2
2
  export * from "./VoiceSessionTokenResponse";
3
3
  export * from "./VoiceTokenType";
4
+ export * from "./VoiceWebRtcTransport";
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./VoiceSessionTokenRequest"), exports);
18
18
  __exportStar(require("./VoiceSessionTokenResponse"), exports);
19
19
  __exportStar(require("./VoiceTokenType"), exports);
20
+ __exportStar(require("./VoiceWebRtcTransport"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mavenagi",
3
- "version": "1.2.68",
3
+ "version": "1.2.69",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -9277,7 +9277,8 @@ await client.users.delete("user-0");
9277
9277
  Creates a short-lived session token for authenticating voice connections.
9278
9278
 
9279
9279
  Supports two token types:
9280
- - **webrtc**: A Twilio-compatible access token for browser-based WebRTC calls
9280
+ - **webrtc**: A token for browser-based WebRTC calls. The `transport` field selects the token format:
9281
+ a token for the Maven telephony gateway (default) or a Twilio access token.
9281
9282
  - **websocket**: An ES256 JWT for direct WebSocket connections to /v1/realtime/conversations
9282
9283
 
9283
9284
  Session tokens are required before establishing any voice connection.
@@ -2,11 +2,13 @@ import type * as MavenAGI from "../../../../api/index";
2
2
  import * as core from "../../../../core";
3
3
  import type * as serializers from "../../../index";
4
4
  import { VoiceTokenType } from "./VoiceTokenType";
5
+ import { VoiceWebRtcTransport } from "./VoiceWebRtcTransport";
5
6
  export declare const VoiceSessionTokenRequest: core.serialization.ObjectSchema<serializers.VoiceSessionTokenRequest.Raw, MavenAGI.VoiceSessionTokenRequest>;
6
7
  export declare namespace VoiceSessionTokenRequest {
7
8
  interface Raw {
8
9
  appUserId: string;
9
10
  type: VoiceTokenType.Raw;
11
+ transport?: VoiceWebRtcTransport.Raw | null;
10
12
  customData?: Record<string, string> | null;
11
13
  }
12
14
  }
@@ -37,8 +37,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.VoiceSessionTokenRequest = void 0;
38
38
  const core = __importStar(require("../../../../core"));
39
39
  const VoiceTokenType_1 = require("./VoiceTokenType");
40
+ const VoiceWebRtcTransport_1 = require("./VoiceWebRtcTransport");
40
41
  exports.VoiceSessionTokenRequest = core.serialization.object({
41
42
  appUserId: core.serialization.string(),
42
43
  type: VoiceTokenType_1.VoiceTokenType,
44
+ transport: VoiceWebRtcTransport_1.VoiceWebRtcTransport.optional(),
43
45
  customData: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(),
44
46
  });
@@ -9,5 +9,6 @@ export declare namespace VoiceSessionTokenResponse {
9
9
  identity: string;
10
10
  type: VoiceTokenType.Raw;
11
11
  expiresIn: number;
12
+ connectUrl?: string | null;
12
13
  }
13
14
  }
@@ -42,4 +42,5 @@ exports.VoiceSessionTokenResponse = core.serialization.object({
42
42
  identity: core.serialization.string(),
43
43
  type: VoiceTokenType_1.VoiceTokenType,
44
44
  expiresIn: core.serialization.number(),
45
+ connectUrl: core.serialization.string().optional(),
45
46
  });
@@ -0,0 +1,7 @@
1
+ import type * as MavenAGI from "../../../../api/index";
2
+ import * as core from "../../../../core";
3
+ import type * as serializers from "../../../index";
4
+ export declare const VoiceWebRtcTransport: core.serialization.Schema<serializers.VoiceWebRtcTransport.Raw, MavenAGI.VoiceWebRtcTransport>;
5
+ export declare namespace VoiceWebRtcTransport {
6
+ type Raw = "gateway" | "twilio";
7
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.VoiceWebRtcTransport = void 0;
38
+ const core = __importStar(require("../../../../core"));
39
+ exports.VoiceWebRtcTransport = core.serialization.forwardCompatibleEnum_(["gateway", "twilio"]);
@@ -1,3 +1,4 @@
1
1
  export * from "./VoiceSessionTokenRequest";
2
2
  export * from "./VoiceSessionTokenResponse";
3
3
  export * from "./VoiceTokenType";
4
+ export * from "./VoiceWebRtcTransport";
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./VoiceSessionTokenRequest"), exports);
18
18
  __exportStar(require("./VoiceSessionTokenResponse"), exports);
19
19
  __exportStar(require("./VoiceTokenType"), exports);
20
+ __exportStar(require("./VoiceWebRtcTransport"), exports);
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.2.68";
1
+ export declare const SDK_VERSION = "1.2.69";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.2.68";
4
+ exports.SDK_VERSION = "1.2.69";