Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5eaa076
Initial push
Devon-White Jul 9, 2025
a018cf0
Convert all Fabric api spec to TypeSpec
Devon-White Jul 9, 2025
02ed089
Merge branch 'main' into Devon/fabric-typespec
Devon-White Jul 9, 2025
8a11399
Merge branch 'main' into Devon/fabric-typespec
Devon-White Jul 9, 2025
f6ba52d
add newline
Devon-White Jul 9, 2025
7011b0d
Update main.tsp
Devon-White Jul 9, 2025
0b5ce7b
Update responses.tsp
Devon-White Jul 9, 2025
34ac7f2
Update main.tsp
Devon-White Jul 9, 2025
7c9287b
Update core.tsp
Devon-White Jul 9, 2025
551a212
Update errors.tsp
Devon-White Jul 9, 2025
e78bc80
Update requests.tsp
Devon-White Jul 9, 2025
8cae635
Push audit edits (in-progress)
Devon-White Jul 11, 2025
6684162
Push audit edits (in-progress)
Devon-White Jul 11, 2025
daf59c6
Update specs/signalwire-rest/fabric-api/dialogflow-agents/addresses/m…
Devon-White Jul 14, 2025
34120a9
Add enums for Ciphers, Codecs, and Encryption in globally_shared specs
Devon-White Jul 14, 2025
29eaa76
Merge branch 'Devon/fabric-typespec' of https://github.com/signalwire…
Devon-White Jul 14, 2025
8c4a9cd
Merge branch 'main' into Devon/fabric-typespec
Devon-White Jul 14, 2025
d09a11d
edits
Devon-White Jul 14, 2025
40b1241
Merge branch 'Devon/fabric-typespec' of https://github.com/signalwire…
Devon-White Jul 14, 2025
aa6d7c6
edits
Devon-White Jul 14, 2025
56ac6c3
edits
Devon-White Jul 14, 2025
3069f94
edits
Devon-White Jul 14, 2025
5fcbf43
edits
Devon-White Jul 15, 2025
45f0c59
Add global constants and SIP endpoint enums
Devon-White Jul 16, 2025
590e639
Refactor API tags and documentation for SignalWire Fabric API
Devon-White Jul 16, 2025
9958b36
Fix bad summary
Devon-White Jul 16, 2025
3910d85
Conference Room edits
Devon-White Jul 17, 2025
0761904
add missing fps property to conference rooms
Devon-White Jul 17, 2025
009d58c
Merge branch 'main' into Devon/fabric-typespec
Devon-White Jul 17, 2025
3eac605
Merge branch 'main' into Devon/fabric-typespec
Devon-White Jul 17, 2025
7eb40aa
Add redirects
Devon-White Jul 17, 2025
090f1ee
Merge branch 'Devon/fabric-typespec' of https://github.com/signalwire…
Devon-White Jul 17, 2025
02d33a1
Add status callback fields to CXML and SWML Scripts endpoints (#387)
diego-signalwire Jul 17, 2025
0c44189
recompile spec after additions
Devon-White Jul 17, 2025
3453b74
Update specs/signalwire-rest/fabric-api/cxml-applications/models/requ…
Devon-White Jul 17, 2025
db0d1ff
Update specs/signalwire-rest/fabric-api/cxml-applications/models/core…
Devon-White Jul 17, 2025
a061bab
Update specs/signalwire-rest/fabric-api/cxml-applications/models/core…
Devon-White Jul 17, 2025
ad6c99d
Update specs/signalwire-rest/fabric-api/cxml-applications/models/requ…
Devon-White Jul 17, 2025
f58a2f2
Update specs/signalwire-rest/fabric-api/cxml-applications/models/requ…
Devon-White Jul 17, 2025
573ebae
Update specs/signalwire-rest/fabric-api/cxml-applications/models/resp…
Devon-White Jul 17, 2025
2053e92
Update specs/signalwire-rest/fabric-api/cxml-applications/models/resp…
Devon-White Jul 17, 2025
663975e
Ran TypeSpec formatter
Devon-White Jul 17, 2025
afcdddd
Ran formatter, and recompiled spec
Devon-White Jul 17, 2025
1c1584d
Ran formatter, and recompiled spec
Devon-White Jul 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
457 changes: 457 additions & 0 deletions .cursor/rules/openapi-comparison-prompt.md

Large diffs are not rendered by default.

649 changes: 649 additions & 0 deletions .cursor/rules/typespec.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"scripts": {
"build": "yarn --cwd website build",
"serve": "yarn --cwd website serve",
"start": "yarn --cwd website start",
"start-fresh": "yarn --cwd website start-fresh",
"build:website": "yarn --cwd website build",
Expand Down
14 changes: 8 additions & 6 deletions specs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"build:fabric-api": "cd ./signalwire-rest/fabric-api && tsp compile . && cd ../../",
"build:logs-api": "cd ./signalwire-rest/logs-api && tsp compile . && cd ../../",
"clean": "echo 'Skipping clean step'",
"prebuild": "yarn clean"
"prebuild": "yarn clean",
"format": "tsp format **/*.tsp",
"format:check": "tsp format --check **/*.tsp"
},
"dependencies": {
"@typespec/compiler": "1.0.0",
"@typespec/http": "1.0.0",
"@typespec/openapi": "1.0.0",
"@typespec/openapi3": "1.0.0",
"@typespec/rest": "0.70.0"
"@typespec/compiler": "1.1.0",
"@typespec/http": "1.1.0",
"@typespec/openapi": "1.1.0",
"@typespec/openapi3": "1.1.0",
"@typespec/rest": "0.71.0"
},
"devDependencies": {
"typescript": "^5.5.4"
Expand Down
21 changes: 21 additions & 0 deletions specs/signalwire-rest/_globally_shared/const.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const SERVER_URL = "signalwire.com/api";

const TERMS_OF_SERVICE = "https://signalwire.com/legal/signalwire-cloud-agreement";

const CONTACT_NAME = "SignalWire";

const CONTACT_URL = "https://support.signalwire.com/portal/en/newticket?departmentId=1029313000000006907&layoutId=1029313000000074011";

const CONTACT_EMAIL = "support@signalwire.com";

const LICENSE_URL = "https://github.com/signalwire/docs/blob/main/LICENSE";

const LICENSE_NAME = "MIT";

const CONTACT_INFO = #{
name: CONTACT_NAME,
url: CONTACT_URL,
email: CONTACT_EMAIL,
};

const LICENSE_INFO = #{ name: LICENSE_NAME, url: LICENSE_URL };
23 changes: 23 additions & 0 deletions specs/signalwire-rest/_globally_shared/enums.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
enum Ciphers {
AEAD_AES_256_GCM_8: "AEAD_AES_256_GCM_8",
AES_256_CM_HMAC_SHA1_80: "AES_256_CM_HMAC_SHA1_80",
AES_CM_128_HMAC_SHA1_80: "AES_CM_128_HMAC_SHA1_80",
AES_256_CM_HMAC_SHA1_32: "AES_256_CM_HMAC_SHA1_32",
AES_CM_128_HMAC_SHA1_32: "AES_CM_128_HMAC_SHA1_32",
}

enum Codecs {
PCMU: "PCMU",
PCMA: "PCMA",
G722: "G722",
G729: "G729",
OPUS: "OPUS",
VP8: "VP8",
H264: "H264",
}

enum Encryption {
Required: "required",
Optional: "optional",
Default: "default",
}
81 changes: 49 additions & 32 deletions specs/signalwire-rest/calling-api/calls/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,57 @@ import "./models/requests.tsp";
import "./models/responses.tsp";
import "./models/examples.tsp";


using TypeSpec.Http;
using Types.StatusCodes;

@route("/calls")
namespace CallingAPI.Calls {

@tag("Calls")
@friendlyName("Calls")
interface Calls {

@summary("Create a Call")
@doc("To create a new call, you send a `POST` request to the Call resource with a payload including a `dial` command and additional nested `params`.")
create(@body request: CallCreateRequest):
{ @statusCode statusCode: 201; @body call: CallResponse; } |
StatusCode401 |
StatusCode404 |
CallCreate422Error;


@summary("Update a Call")
@doc("To update an existing call, you send a `PUT` request to the Call resource with a payload including a `command` and additional nested `params`.")
@opExample(#{parameters: holdCallExample}, #{title: "Hold active call", description: "Put an active AI call on hold, pausing the conversation"})
@opExample(#{parameters: unholdCallExample}, #{title: "Unhold active call", description: "Resume an AI call that was previously put on hold"})
@opExample(#{parameters: aiMessageExample}, #{title: "Inject AI message", description: "Send a message to the AI conversation to modify behavior or add context"})
//@opExample(#{parameters: #{request: #{command: "update", params: #{id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", url: "https://example.com/swml", fallback_url: "https://example.com/fallback"}}}}, #{title: "Update active call", description: "Modify an active call's behavior using new SWML instructions"})
@put update(@body request: CallUpdateRequest):
{ @statusCode statusCode: 200; @body call: CallResponse; } |
StatusCode401 |
StatusCode404 |
CallUpdate422Error;
}




}
@tag("Calls")
@friendlyName("Calls")
interface Calls {
@summary("Create a Call")
@doc("To create a new call, you send a `POST` request to the Call resource with a payload including a `dial` command and additional nested `params`.")
create(@body request: CallCreateRequest):
| {
@statusCode statusCode: 201;
@body call: CallResponse;
}
| StatusCode401
| StatusCode404
| CallCreate422Error;

@summary("Update a Call")
@doc("To update an existing call, you send a `PUT` request to the Call resource with a payload including a `command` and additional nested `params`.")
@opExample(
#{ parameters: holdCallExample },
#{
title: "Hold active call",
description: "Put an active AI call on hold, pausing the conversation",
}
)
@opExample(
#{ parameters: unholdCallExample },
#{
title: "Unhold active call",
description: "Resume an AI call that was previously put on hold",
}
)
@opExample(
#{ parameters: aiMessageExample },
#{
title: "Inject AI message",
description: "Send a message to the AI conversation to modify behavior or add context",
}
)
//@opExample(#{parameters: #{request: #{command: "update", params: #{id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", url: "https://example.com/swml", fallback_url: "https://example.com/fallback"}}}}, #{title: "Update active call", description: "Modify an active call's behavior using new SWML instructions"})
@put
update(@body request: CallUpdateRequest):
| {
@statusCode statusCode: 200;
@body call: CallResponse;
}
| StatusCode401
| StatusCode404
| CallUpdate422Error;
}
}
79 changes: 37 additions & 42 deletions specs/signalwire-rest/calling-api/calls/models/core.tsp
Original file line number Diff line number Diff line change
@@ -1,57 +1,52 @@
model Call {
@doc("The unique identifier of the call on SignalWire. This can be used to update the call programmatically.")
@example("3fa85f64-5717-4562-b3fc-2c963f66afa6")
id: string;

@doc("The unique identifier of the call on SignalWire. This can be used to update the call programmatically.")
@example("3fa85f64-5717-4562-b3fc-2c963f66afa6")
id: string;
@doc("The origin number or address.")
@example("sip:from-sip@example-112233445566.sip.signalwire.com")
from: string;

@doc("The origin number or address.")
@example("sip:from-sip@example-112233445566.sip.signalwire.com")
from: string;
@doc("The destination number or address.")
@example("sip:from-sip@example-112233445567.sip.signalwire.com")
to: string;

@doc("The destination number or address.")
@example("sip:from-sip@example-112233445567.sip.signalwire.com")
to: string;
@doc("The direction of the call.")
@example("outbound-api")
direction: "outbound-api";

@doc("The direction of the call.")
@example("outbound-api")
direction: "outbound-api";
@doc("The status of the call.")
@example("queued")
status: "answered" | "queued" | "initiated" | "ringing" | "ending" | "ended";

@doc("The status of the call.")
@example("queued")
status: "answered" | "queued" | "initiated" | "ringing" | "ending" | "ended";
@doc("The duration of the call in seconds.")
@example(60)
duration: integer;

@doc("The duration of the call in seconds.")
@example(60)
duration: integer;
@doc("The duration of the call in milliseconds.")
@example(60000)
duration_ms: integer;

@doc("The duration of the call in milliseconds.")
@example(60000)
duration_ms: integer;
@doc("The billable duration of the call in seconds.")
@example(60)
billable_duration: integer;

@doc("The billable duration of the call in seconds.")
@example(60)
billable_duration: integer;
@doc("Source of this call.")
@example("realtime_api")
source: "realtime_api";

@doc("Source of this call.")
@example("realtime_api")
source: "realtime_api";

@doc("Type of this call.")
@example("relay_sip_call")
type: "relay_pstn_call" | "relay_sip_call" | "relay_webrtc_call" ;

@doc("Details on charges associated with this call.")
charge: ChargeDetails[];
@doc("Type of this call.")
@example("relay_sip_call")
type: "relay_pstn_call" | "relay_sip_call" | "relay_webrtc_call";

@doc("Details on charges associated with this call.")
charge: ChargeDetails[];
}


model ChargeDetails {
@doc("Description for this charge.")
description: string;

@doc("Description for this charge.")
description: string;

@doc("Charged amount.")
amount: integer;

}
@doc("Charged amount.")
amount: integer;
}
33 changes: 11 additions & 22 deletions specs/signalwire-rest/calling-api/calls/models/examples.tsp
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
/**
* Operation examples for the Calling API
*
*
* These examples can be imported and used with @opExample decorator on operations
*/

const callId = "3fa85f64-5717-4562-b3fc-2c963f66afa6";

// Hangup Call Examples
const hangupCallExample = #{
request: #{
id: callId,
command: "calling.end",
params: #{
reason: "hangup"
}
}
params: #{ reason: "hangup" },
},
};

const holdCallExample = #{
request: #{
id: callId,
command: "calling.ai_hold",
params: #{}
}
request: #{ id: callId, command: "calling.ai_hold", params: #{} },
};

const unholdCallExample = #{
request: #{
id: callId,
command: "calling.ai_unhold",
params: #{}
}
request: #{ id: callId, command: "calling.ai_unhold", params: #{} },
};

const aiMessageExample = #{
Expand All @@ -39,9 +28,9 @@ const aiMessageExample = #{
command: "calling.ai_message",
params: #{
role: "system",
message_text: "You are now in expert mode. Provide detailed technical responses and use industry terminology."
}
}
message_text: "You are now in expert mode. Provide detailed technical responses and use industry terminology.",
},
},
};

const updateCallExample = #{
Expand All @@ -50,7 +39,7 @@ const updateCallExample = #{
params: #{
id: callId,
url: "https://example.com/swml",
fallback_url: "https://example.com/fallback"
}
}
fallback_url: "https://example.com/fallback",
},
},
};
Loading