From a007d752ae5fea541d8fe1d3cbfc13c4055adcca Mon Sep 17 00:00:00 2001 From: imfaruk Date: Tue, 31 Dec 2024 07:51:12 +0600 Subject: [PATCH 1/4] Convert Cxml application to TypeSpec --- api/signalwire-rest/fabric-api/_spec_.yaml | 1234 ++++++++--------- .../cxml-application-addresses/main.tsp | 23 + .../models/core.tsp | 45 + .../models/enums.tsp | 1 + .../models/responses.tsp | 18 + .../fabric-api/cxml-application/main.tsp | 58 + .../cxml-application/models/core.tsp | 77 + .../cxml-application/models/enums.tsp | 1 + .../cxml-application/models/errors.tsp | 16 + .../cxml-application/models/requests.tsp | 75 + .../cxml-application/models/responses.tsp | 18 + api/signalwire-rest/fabric-api/enums.tsp | 6 + api/signalwire-rest/fabric-api/main.tsp | 3 + .../@typespec/openapi3/openapi.yaml | 575 ++++++++ 14 files changed, 1497 insertions(+), 653 deletions(-) create mode 100644 api/signalwire-rest/fabric-api/cxml-application-addresses/main.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application-addresses/models/core.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application-addresses/models/enums.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application-addresses/models/responses.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application/main.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application/models/core.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application/models/enums.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application/models/errors.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application/models/requests.tsp create mode 100644 api/signalwire-rest/fabric-api/cxml-application/models/responses.tsp diff --git a/api/signalwire-rest/fabric-api/_spec_.yaml b/api/signalwire-rest/fabric-api/_spec_.yaml index 39b1c93..79e17de 100644 --- a/api/signalwire-rest/fabric-api/_spec_.yaml +++ b/api/signalwire-rest/fabric-api/_spec_.yaml @@ -110,6 +110,20 @@ components: description: Unique ID of a Subscriber. schema: $ref: '#/components/schemas/uuid' + CxmlApplicationID: + name: id + in: path + required: true + description: Unique ID of a cXML Application. + schema: + $ref: '#/components/schemas/uuid' + CxmlApplicationIDPath: + name: cxml_application_id + in: path + required: true + description: Unique ID of a cXML Application. + schema: + $ref: '#/components/schemas/uuid' schemas: AIAgent: @@ -3305,6 +3319,353 @@ components: type: string format: uuid description: Universal Unique Identifier. + CxmlApplication: + type: object + required: + - id + - name + - used_for + - call_handler_url + - call_handler_method + - call_handler_fallback_url + - call_handler_fallback_method + - call_status_callback_url + - call_status_callback_method + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 + description: Unique ID of the cXML Application. + name: + type: string + example: My cXML Application + description: Name of the cXML Application. + used_for: + allOf: + - $ref: '#/components/schemas/HandleCallsUsing' + example: script + description: Indicates whether the call will be handled by a script or an external URL. + call_handler_url: + type: string + example: https://example.com/cxml + description: Call handler URL + call_handler_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler URL method + call_handler_fallback_url: + type: string + example: https://example.com/cxml + description: Call handler callback URL. + call_handler_fallback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler fallback method. + call_status_callback_url: + type: string + example: https://callback.com + description: Call status callback URL + call_status_callback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: POST + description: Call status callback method. + CxmlApplicationAddress: + type: object + required: + - id + - resource_id + - name + - display_name + - type + - cover_url + - preview_url + - channel + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + example: 691af061-cd86-4893-a605-173f47afc4c2 + description: Unique ID of the Fabric Address. + resource_id: + allOf: + - $ref: '#/components/schemas/uuid' + example: 691af061-cd86-4893-a605-173f47afc4c2 + description: Fabric resource ID that the Fabric Address belongs to. + name: + type: string + example: justice-league + description: Name of the Fabric Address. + display_name: + type: string + example: Justice League + description: Display name of the Fabric Address. + type: + allOf: + - $ref: '#/components/schemas/DisplayTypes' + example: app + description: Type of the Fabric Address. + cover_url: + type: string + example: https://coverurl.com + description: Cover url of the Fabric Address. + preview_url: + type: string + example: https://previewurl.com + description: Preview url of the Fabric Address. + channel: + allOf: + - $ref: '#/components/schemas/AddressChannel' + description: Channels of the Fabric Address. + CxmlApplicationAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CxmlApplicationAddress' + links: + $ref: '#/components/schemas/CxmlApplicationAddressPaginationResponse' + CxmlApplicationAddressPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + description: Link of the current page + first: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + description: Link to the first page + next: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + description: Link to the next page + CxmlApplicationCreateRequest: + type: object + required: + - name + - call_handler_script + properties: + name: + type: string + example: My cXML Application + description: Name of the cXML Application. + used_for: + allOf: + - $ref: '#/components/schemas/HandleCallsUsing' + example: script + description: Indicates whether the call will be handled by a script or an external URL. + call_handler_url: + type: string + example: https://example.com/cxml + description: Call handler URL + call_handler_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler URL method + default: POST + call_handler_fallback_url: + type: string + example: https://example.com/cxml + description: Call handler callback URL. + call_handler_fallback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler fallback method. + default: POST + call_status_callback_url: + type: string + example: https://callback.com + description: Call status callback URL + call_status_callback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call status callback method. + default: POST + call_handler_script: + type: string + example: |- + + + https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3 + + description: Script to handle to call. + CxmlApplicationCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: Name is required + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + CxmlApplicationFabricResource: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - cxml_application + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 + description: Unique ID of the cXML Application. + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + example: 99151cf8-9548-4860-ba70-a8de824f3312 + description: Unique ID of the Project. + display_name: + type: string + example: Booking Assistant + description: Display name of the cXML Application Fabric Resource + type: + type: string + example: cxml_application + description: Type of the Fabric Resource + created_at: + type: string + format: date-time + example: 2024-10-17T14:14:53Z + description: Date and time when the resource was created. + updated_at: + type: string + format: date-time + example: 2024-10-17T14:14:53Z + description: Date and time when the resource was updated. + cxml_application: + allOf: + - $ref: '#/components/schemas/CxmlApplication' + description: cXML Application data. + CxmlApplicationListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CxmlApplicationFabricResource' + links: + $ref: '#/components/schemas/CxmlApplicationPaginationResponse' + CxmlApplicationPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 + description: Link of the current page + first: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 + description: Link to the first page + next: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + description: Link to the next page + CxmlApplicationUpdateRequest: + type: object + properties: + name: + type: string + example: My cXML Application + description: Name of the cXML Application. + used_for: + allOf: + - $ref: '#/components/schemas/HandleCallsUsing' + example: script + description: Indicates whether the call will be handled by a script or an external URL. + call_handler_url: + type: string + example: https://example.com/cxml + description: Call handler URL + call_handler_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler URL method + default: POST + call_handler_fallback_url: + type: string + example: https://example.com/cxml + description: Call handler callback URL. + call_handler_fallback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler fallback method. + default: POST + call_status_callback_url: + type: string + example: https://callback.com + description: Call status callback URL + call_status_callback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call status callback method. + default: POST + call_handler_script: + type: string + example: |- + + + https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3 + + description: Script to handle to call. + CxmlApplicationUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: Name is required + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter responses: '204': description: No Content @@ -3682,7 +4043,7 @@ paths: summary: List Fabric Addresses description: |- A list of Fabric Addresses. This endpoint uses the bearer token authentication method with the SAT (Subscriber Access Token) wich can be - generated using the [Create Subscriber Token endpoint](/rest/signalwire-rest/endpoints/fabric/subscriber-tokens-create). + generated using the [Create Subscriber Token endpoint](/rest/signalwire-rest/endpoints/fabric/subscriber-tokens-create). parameters: [] responses: '200': @@ -6695,19 +7056,19 @@ paths: responses: '204': description: No content - /resources/external_swml_handlers: + /resources/cxml_applications: get: - operationId: ExternalSWMLHandlers_list - summary: List External SWML Handlers - description: A list of External SWML Handlers - parameters: [ ] + operationId: CxmlApplications_list + summary: List cXML Applications + description: A list of cXML Applications + parameters: [] responses: '200': description: The request has succeeded. content: application/json: schema: - $ref: '#/components/schemas/ExternalSWMLHandlerListResponse' + $ref: '#/components/schemas/CxmlApplicationListResponse' '401': description: Access is unauthorized. content: @@ -6725,19 +7086,226 @@ paths: enum: - Not Found tags: - - External SWML Handler + - cXML Application post: - operationId: ExternalSWMLHandlers_create - summary: Create External SWML Handler - description: Creates an External SWML Handler - parameters: [ ] + operationId: CxmlApplications_create + summary: Create cXML Application + description: Creates an cXML Application + parameters: [] responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: - $ref: '#/components/schemas/ExternalSWMLHandler' + $ref: '#/components/schemas/CxmlApplication' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationCreateStatusCode422' + tags: + - cXML Application + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationCreateRequest' + /resources/cxml_applications/{cxml_application_id}/addresses: + get: + operationId: CxmlApplicationAddresses_list + summary: List cXML Application Addresses + description: A list of cXML Application Addresses + parameters: + - $ref: '#/components/parameters/CxmlApplicationIDPath' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + /resources/cxml_applications/{id}: + get: + operationId: CxmlApplications_read + summary: Get cXML Application + description: Returns an cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationFabricResource' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + patch: + operationId: CxmlApplications_update + summary: Update cXML Application + description: Updates an cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplication' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationUpdateStatusCode422' + tags: + - cXML Application + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationUpdateRequest' + delete: + operationId: CxmlApplications_delete + summary: Delete cXML Application + description: Deletes an cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + /resources/external_swml_handlers: + get: + operationId: ExternalSWMLHandlers_list + summary: List External SWML Handlers + description: A list of External SWML Handlers + parameters: [ ] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalSWMLHandlerListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - External SWML Handler + post: + operationId: ExternalSWMLHandlers_create + summary: Create External SWML Handler + description: Creates an External SWML Handler + parameters: [ ] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalSWMLHandler' '401': description: Access is unauthorized. content: @@ -10656,646 +11224,6 @@ paths: responses: '204': description: No content - /resources/cxml_applications/{id}/addresses: - get: - tags: - - cXML Applications - summary: List cXML Application Addresses - description: | - Returns a list of cXML Application addresses. - operationId: listCxmlApplicationAddresses - parameters: - - name: id - in: path - required: true - description: The ID of the cXML Application - schema: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - responses: - '200': - description: A list of cXML Application addresses - content: - application/json: - schema: - type: object - properties: - links: - type: object - properties: - self: - type: string - format: uri - example: >- - https://{space_name}.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_size=50 - first: - type: string - format: uri - example: >- - https://{space_name}.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_size=50 - next: - type: string - format: uri - example: >- - https://{space_name}.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=1&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad - prev: - type: string - format: uri - example: >- - https://{space_name}.signalwire.com/api/fabric/resources/016e5773-c197-4446-bcc2-9c48f14e2d0a/addresses?page_number=0&page_size=50&page_token=PA6581c1fa-d985-4c8f-b53e-2fee11b579ad - data: - type: array - items: - type: object - properties: - id: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - resource_id: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - name: - type: string - example: reception - display_name: - type: string - example: Reception - type: - type: string - example: room - cover_url: - type: string - format: uri - example: https://example.com/cover.jpg - preview_url: - type: string - format: uri - example: https://example.com/preview.jpg - channels: - type: object - properties: - video: - type: string - format: uri - example: /public/reception?channel=video - audio: - type: string - format: uri - example: /public/reception?channel=audio - messaging: - type: string - format: uri - example: /public/reception?channel=messaging - /resources/cxml_applications: - get: - tags: - - cXML Applications - summary: List cXML Applications - operationId: listCxmlApplications - responses: - '200': - description: A list of cXML Applications - content: - application/json: - schema: - type: array - items: - type: object - properties: - id: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - project_id: - type: string - format: uuid - example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 - display_name: - type: string - example: Reception - type: - type: string - example: cxml_application - created_at: - type: string - format: date-time - example: '2024-01-02T00:00:00Z' - updated_at: - type: string - format: date-time - example: '2024-01-02T00:00:00Z' - cxml_application: - allOf: - - type: object - properties: - id: - type: string - format: uuid - description: A unique identifier for the cXML Application - - type: object - properties: - name: - type: string - example: Booking Assistant - handle_calls_using: - type: string - example: script - enum: - - script - - external_url - call_handler_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_method: - type: string - example: POST - enum: - - POST - - GET - call_handler_fallback_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_fallback_method: - type: string - example: POST - enum: - - POST - - GET - call_status_callback_url: - type: string - format: uri - example: https://example.com/cxml - call_status_callback_method: - type: string - example: POST - enum: - - POST - - GET - post: - tags: - - cXML Applications - summary: Create cXML Application - operationId: createCxmlApplication - requestBody: - required: true - content: - application/json: - schema: - allOf: - - type: object - properties: - name: - type: string - example: Booking Assistant - handle_calls_using: - type: string - example: script - enum: - - script - - external_url - call_handler_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_method: - type: string - example: POST - enum: - - POST - - GET - call_handler_fallback_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_fallback_method: - type: string - example: POST - enum: - - POST - - GET - call_status_callback_url: - type: string - format: uri - example: https://example.com/cxml - call_status_callback_method: - type: string - example: POST - enum: - - POST - - GET - - type: object - properties: - call_handler_script: - type: string - example: >- - - responses: - '200': - description: A cXML Application - content: - application/json: - schema: - type: object - properties: - id: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - project_id: - type: string - format: uuid - example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 - display_name: - type: string - example: Reception - type: - type: string - example: cxml_application - created_at: - type: string - format: date-time - example: '2024-01-02T00:00:00Z' - updated_at: - type: string - format: date-time - example: '2024-01-02T00:00:00Z' - cxml_application: - allOf: - - type: object - properties: - id: - type: string - format: uuid - description: A unique identifier for the cXML Application - - type: object - properties: - name: - type: string - example: Booking Assistant - handle_calls_using: - type: string - example: script - enum: - - script - - external_url - call_handler_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_method: - type: string - example: POST - enum: - - POST - - GET - call_handler_fallback_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_fallback_method: - type: string - example: POST - enum: - - POST - - GET - call_status_callback_url: - type: string - format: uri - example: https://example.com/cxml - call_status_callback_method: - type: string - example: POST - enum: - - POST - - GET - '422': - description: Unprocessable Entity - content: - application/json: - schema: - type: object - properties: - type: - type: string - code: - type: string - message: - type: string - attribute: - type: string - url: - type: string - format: uri - required: - - type - - code - - message - - url - example: - type: validation_error - code: invalid_parameter - message: Name must be present - attribute: name - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter - /resources/cxml_applications/{id}: - get: - tags: - - cXML Applications - summary: Get cXML Application - description: | - Returns a cXML Application by ID. - operationId: getCxmlApplication - parameters: - - name: id - in: path - required: true - description: The ID of the cXML Application - schema: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - responses: - '200': - description: A cXML Application - content: - application/json: - schema: - type: object - properties: - id: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - project_id: - type: string - format: uuid - example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 - display_name: - type: string - example: Reception - type: - type: string - example: cxml_application - created_at: - type: string - format: date-time - example: '2024-01-02T00:00:00Z' - updated_at: - type: string - format: date-time - example: '2024-01-02T00:00:00Z' - cxml_application: - allOf: - - type: object - properties: - id: - type: string - format: uuid - description: A unique identifier for the cXML Application - - type: object - properties: - name: - type: string - example: Booking Assistant - handle_calls_using: - type: string - example: script - enum: - - script - - external_url - call_handler_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_method: - type: string - example: POST - enum: - - POST - - GET - call_handler_fallback_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_fallback_method: - type: string - example: POST - enum: - - POST - - GET - call_status_callback_url: - type: string - format: uri - example: https://example.com/cxml - call_status_callback_method: - type: string - example: POST - enum: - - POST - - GET - put: - tags: - - cXML Applications - summary: Update cXML Application - description: | - Updates a cXML Application by ID. - operationId: updateCxmlApplication - parameters: - - name: id - in: path - required: true - description: The ID of the cXML Application - schema: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - requestBody: - required: true - content: - application/json: - schema: - allOf: - - type: object - properties: - name: - type: string - example: Booking Assistant - handle_calls_using: - type: string - example: script - enum: - - script - - external_url - call_handler_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_method: - type: string - example: POST - enum: - - POST - - GET - call_handler_fallback_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_fallback_method: - type: string - example: POST - enum: - - POST - - GET - call_status_callback_url: - type: string - format: uri - example: https://example.com/cxml - call_status_callback_method: - type: string - example: POST - enum: - - POST - - GET - - type: object - properties: - call_handler_script: - type: string - example: >- - - responses: - '200': - description: A cXML Application - content: - application/json: - schema: - type: object - properties: - id: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - project_id: - type: string - format: uuid - example: 1313fe58-5e14-4c11-bbe7-6fdfa11fe780 - display_name: - type: string - example: Reception - type: - type: string - example: cxml_application - created_at: - type: string - format: date-time - example: '2024-01-02T00:00:00Z' - updated_at: - type: string - format: date-time - example: '2024-01-02T00:00:00Z' - cxml_application: - allOf: - - type: object - properties: - id: - type: string - format: uuid - description: A unique identifier for the cXML Application - - type: object - properties: - name: - type: string - example: Booking Assistant - handle_calls_using: - type: string - example: script - enum: - - script - - external_url - call_handler_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_method: - type: string - example: POST - enum: - - POST - - GET - call_handler_fallback_url: - type: string - format: uri - example: https://example.com/cxml - call_handler_fallback_method: - type: string - example: POST - enum: - - POST - - GET - call_status_callback_url: - type: string - format: uri - example: https://example.com/cxml - call_status_callback_method: - type: string - example: POST - enum: - - POST - - GET - '422': - description: Unprocessable Entity - content: - application/json: - schema: - type: object - properties: - type: - type: string - code: - type: string - message: - type: string - attribute: - type: string - url: - type: string - format: uri - required: - - type - - code - - message - - url - example: - type: validation_error - code: invalid_parameter - message: Name must be present - attribute: name - url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter - delete: - tags: - - cXML Applications - summary: Delete cXML Application - description: | - Deletes a cXML Application by ID. - operationId: deleteCxmlApplication - parameters: - - name: id - in: path - required: true - description: The ID of the cXML Application - schema: - type: string - format: uuid - example: 993ed018-9e79-4e50-b97b-984bd5534095 - responses: - '204': - description: No content /resources/{id}/addresses: get: tags: diff --git a/api/signalwire-rest/fabric-api/cxml-application-addresses/main.tsp b/api/signalwire-rest/fabric-api/cxml-application-addresses/main.tsp new file mode 100644 index 0000000..f52fd1a --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application-addresses/main.tsp @@ -0,0 +1,23 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/responses.tsp"; +import "../../types"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/cxml_applications/{cxml_application_id}/addresses") +namespace FabricAPI.CxmlApplicationAddresses { + @tag("cXML Application") + @friendlyName("cXML Applications") + interface CxmlApplicationAddresses { + @summary("List cXML Application Addresses") + @doc("A list of cXML Application Addresses") + list(...CxmlApplicationIDPath): + CxmlApplicationAddressListResponse | + StatusCode401 | + StatusCode404; + } +} + diff --git a/api/signalwire-rest/fabric-api/cxml-application-addresses/models/core.tsp b/api/signalwire-rest/fabric-api/cxml-application-addresses/models/core.tsp new file mode 100644 index 0000000..0ec3a24 --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application-addresses/models/core.tsp @@ -0,0 +1,45 @@ +import "@typespec/openapi3"; +import "./enums.tsp"; +import "../../../types"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +model CxmlApplicationIDPath { + @doc("Unique ID of a cXML Application.") + @path + cxml_application_id: uuid +} + +model CxmlApplicationAddress { + @doc("Unique ID of the Fabric Address.") + @example("691af061-cd86-4893-a605-173f47afc4c2") + id: uuid; + + @doc("Fabric resource ID that the Fabric Address belongs to.") + @example("691af061-cd86-4893-a605-173f47afc4c2") + resource_id: uuid; + + @doc("Name of the Fabric Address.") + @example("justice-league") + name: string; + + @doc("Display name of the Fabric Address.") + @example("Justice League") + display_name: string; + + @doc("Type of the Fabric Address.") + @example(DisplayTypes.App) + type: DisplayTypes; + + @doc("Cover url of the Fabric Address.") + @example("https://coverurl.com") + cover_url: string; + + @doc("Preview url of the Fabric Address.") + @example("https://previewurl.com") + preview_url: string; + + @doc("Channels of the Fabric Address.") + channel: AddressChannel; +} diff --git a/api/signalwire-rest/fabric-api/cxml-application-addresses/models/enums.tsp b/api/signalwire-rest/fabric-api/cxml-application-addresses/models/enums.tsp new file mode 100644 index 0000000..e7475bb --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application-addresses/models/enums.tsp @@ -0,0 +1 @@ +import "./../../enums.tsp"; diff --git a/api/signalwire-rest/fabric-api/cxml-application-addresses/models/responses.tsp b/api/signalwire-rest/fabric-api/cxml-application-addresses/models/responses.tsp new file mode 100644 index 0000000..f1c0d0d --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application-addresses/models/responses.tsp @@ -0,0 +1,18 @@ +model CxmlApplicationAddressListResponse { + data: CxmlApplicationAddress[]; + links: CxmlApplicationAddressPaginationResponse; +} + +model CxmlApplicationAddressPaginationResponse { + @doc("Link of the current page") + @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") + self: url; + + @doc("Link to the first page") + @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50") + first: url; + + @doc("Link to the next page") + @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next: url; +} diff --git a/api/signalwire-rest/fabric-api/cxml-application/main.tsp b/api/signalwire-rest/fabric-api/cxml-application/main.tsp new file mode 100644 index 0000000..9fb5381 --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application/main.tsp @@ -0,0 +1,58 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "./models/core.tsp"; +import "./models/requests.tsp"; +import "./models/responses.tsp"; +import "./models/errors.tsp"; +import "../../types"; + +using TypeSpec.Http; +using Types.StatusCodes; + +@route("/resources/cxml_applications") +namespace FabricAPI.CxmlApplications { + @tag("cXML Application") + @friendlyName("cXML Applications") + interface CxmlApplications { + @summary("List cXML Applications") + @doc("A list of cXML Applications") + list(): + CxmlApplicationListResponse | + StatusCode401 | + StatusCode404; + + @summary("Get cXML Application") + @doc("Returns an cXML Application by ID") + read(...CxmlApplicationID): { + @statusCode statusCode: 200; + @body cxml_application: CxmlApplicationFabricResource; + } | + StatusCode401 | + StatusCode404; + + @summary("Create cXML Application") + @doc("Creates acXML Application") + @post create(...CxmlApplicationCreateRequest): + { @statusCode statusCode: 201; @body cxml_application: CxmlApplication; } | + StatusCode401 | + StatusCode404 | + CxmlApplicationCreateStatusCode422; + + @summary("Update cXML Application") + @doc("Updates a cXML Application by ID") + @patch update(...CxmlApplicationID, ...CxmlApplicationUpdateRequest): { + @statusCode statusCode: 200; @body cxml_application: CxmlApplication; + } | + StatusCode401 | + StatusCode404 | + CxmlApplicationUpdateStatusCode422; + + @summary("Delete cXML Application") + @doc("Deletes a cXML Application by ID") + @delete delete(...CxmlApplicationID): + { @statusCode statusCode: 204; } | + StatusCode401 | + StatusCode404; + } +} + diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp new file mode 100644 index 0000000..e29c7eb --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp @@ -0,0 +1,77 @@ +import "./enums.tsp"; +import "../../../types"; + +using TypeSpec.Http; + +model CxmlApplicationID { + @doc("Unique ID of a cXML Application.") + @path + id: uuid +} + +model CxmlApplication { + @doc("Unique ID of the cXML Application.") + @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") + id: uuid; + + @doc("Name of the cXML Application.") + @example("My cXML Application") + name: string; + + @doc("Indicates whether the call will be handled by a script or an external URL.") + @example(HandleCallsUsing.Script) + used_for: HandleCallsUsing; + + @doc("Call handler URL") + @example("https://example.com/cxml") + call_handler_url: string; + + @doc("Call handler URL method") + @example(UrlMethodType.Get) + call_handler_method: UrlMethodType; + + @doc("Call handler callback URL.") + @example("https://example.com/cxml") + call_handler_fallback_url: string; + + @doc("Call handler fallback method.") + @example(UrlMethodType.Get) + call_handler_fallback_method: UrlMethodType; + + @doc("Call status callback URL") + @example("https://callback.com") + call_status_callback_url: string; + + @doc("Call status callback method.") + @example(UrlMethodType.Post) + call_status_callback_method: UrlMethodType; +} + +model CxmlApplicationFabricResource { + @doc("Unique ID of the cXML Application.") + @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") + id: uuid; + + @doc("Unique ID of the Project.") + @example("99151cf8-9548-4860-ba70-a8de824f3312") + project_id: uuid; + + @doc("Display name of the cXML Application Fabric Resource") + @example("Booking Assistant") + display_name: string; + + @doc("Type of the Fabric Resource") + @example("cxml_application") + type: string; + + @doc("Date and time when the resource was created.") + @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + updated_at: utcDateTime; + + @doc("cXML Application data.") + cxml_application: CxmlApplication; +} \ No newline at end of file diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/enums.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/enums.tsp new file mode 100644 index 0000000..e7475bb --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application/models/enums.tsp @@ -0,0 +1 @@ +import "./../../enums.tsp"; diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/errors.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/errors.tsp new file mode 100644 index 0000000..6f57698 --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application/models/errors.tsp @@ -0,0 +1,16 @@ +import "../../../types/status-codes"; + +using Types.StatusCodes; + +@example(#{ + errors: #[#{ + type: "validation_error", + code: "missing_required_parameter", + message: "Name is required", + attribute: "name", + url: "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter" + }], + }) + model CxmlApplicationCreateStatusCode422 is StatusCode422; + + model CxmlApplicationUpdateStatusCode422 is CxmlApplicationCreateStatusCode422; diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/requests.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/requests.tsp new file mode 100644 index 0000000..f86c13a --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application/models/requests.tsp @@ -0,0 +1,75 @@ +model CxmlApplicationCreateRequest { + @doc("Name of the cXML Application.") + @example("My cXML Application") + name: string; + + @doc("Indicates whether the call will be handled by a script or an external URL.") + @example(HandleCallsUsing.Script) + used_for?: HandleCallsUsing; + + @doc("Call handler URL") + @example("https://example.com/cxml") + call_handler_url?: string; + + @doc("Call handler URL method") + @example(UrlMethodType.Get) + call_handler_method?: UrlMethodType = UrlMethodType.Post; + + @doc("Call handler callback URL.") + @example("https://example.com/cxml") + call_handler_fallback_url?: string; + + @doc("Call handler fallback method.") + @example(UrlMethodType.Get) + call_handler_fallback_method?: UrlMethodType = UrlMethodType.Post; + + @doc("Call status callback URL") + @example("https://callback.com") + call_status_callback_url?: string; + + @doc("Call status callback method.") + @example(UrlMethodType.Get) + call_status_callback_method?: UrlMethodType = UrlMethodType.Post; + + @doc("Script to handle to call.") + @example("\n\n https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3\n") + call_handler_script: string; +} + +model CxmlApplicationUpdateRequest { + @doc("Name of the cXML Application.") + @example("My cXML Application") + name?: string; + + @doc("Indicates whether the call will be handled by a script or an external URL.") + @example(HandleCallsUsing.Script) + used_for?: HandleCallsUsing; + + @doc("Call handler URL") + @example("https://example.com/cxml") + call_handler_url?: string; + + @doc("Call handler URL method") + @example(UrlMethodType.Get) + call_handler_method?: UrlMethodType = UrlMethodType.Post; + + @doc("Call handler callback URL.") + @example("https://example.com/cxml") + call_handler_fallback_url?: string; + + @doc("Call handler fallback method.") + @example(UrlMethodType.Get) + call_handler_fallback_method?: UrlMethodType = UrlMethodType.Post; + + @doc("Call status callback URL") + @example("https://callback.com") + call_status_callback_url?: string; + + @doc("Call status callback method.") + @example(UrlMethodType.Get) + call_status_callback_method?: UrlMethodType = UrlMethodType.Post; + + @doc("Script to handle to call.") + @example("\n\n https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3\n") + call_handler_script: string; +} diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/responses.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/responses.tsp new file mode 100644 index 0000000..6b712d0 --- /dev/null +++ b/api/signalwire-rest/fabric-api/cxml-application/models/responses.tsp @@ -0,0 +1,18 @@ +model CxmlApplicationListResponse { + data: CxmlApplicationFabricResource[]; + links: CxmlApplicationPaginationResponse; +} + +model CxmlApplicationPaginationResponse { + @doc("Link of the current page") + @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50") + self: url; + + @doc("Link to the first page") + @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50") + first: url; + + @doc("Link to the next page") + @example("https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca") + next: url; +} diff --git a/api/signalwire-rest/fabric-api/enums.tsp b/api/signalwire-rest/fabric-api/enums.tsp index aadd8e5..52b2144 100644 --- a/api/signalwire-rest/fabric-api/enums.tsp +++ b/api/signalwire-rest/fabric-api/enums.tsp @@ -36,6 +36,12 @@ enum UrlMethodType { Post: "POST", } +@doc("Indicates whether the call will be handled by a script or an external url.") +enum HandleCallsUsing { + Script: "script", + ExternalUrl: "external_url", +} + union AddressChannel { AudioChannel, MessagingChannel, diff --git a/api/signalwire-rest/fabric-api/main.tsp b/api/signalwire-rest/fabric-api/main.tsp index 11e0d02..06f1f6b 100644 --- a/api/signalwire-rest/fabric-api/main.tsp +++ b/api/signalwire-rest/fabric-api/main.tsp @@ -10,6 +10,9 @@ import "./external-swml-handler"; import "./external-swml-handler-addresses"; import "./ai-agent"; import "./ai-agent-addresses"; +import "./cxml-application"; +import "./cxml-application-addresses"; + using TypeSpec.Http; using Types.StatusCodes; diff --git a/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml b/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml index edc973e..951e61f 100644 --- a/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -10,6 +10,7 @@ tags: - name: External LAML Handler - name: External SWML Handler - name: AI Agent + - name: cXML Application paths: /addresses: get: @@ -332,6 +333,213 @@ paths: - Not Found tags: - AI Agent + /resources/cxml_applications: + get: + operationId: CxmlApplications_list + summary: List cXML Applications + description: A list of cXML Applications + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + post: + operationId: CxmlApplications_create + summary: Create cXML Application + description: Creates acXML Application + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplication' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationCreateStatusCode422' + tags: + - cXML Application + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationCreateRequest' + /resources/cxml_applications/{cxml_application_id}/addresses: + get: + operationId: CxmlApplicationAddresses_list + summary: List cXML Application Addresses + description: A list of cXML Application Addresses + parameters: + - $ref: '#/components/parameters/CxmlApplicationIDPath' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + /resources/cxml_applications/{id}: + get: + operationId: CxmlApplications_read + summary: Get cXML Application + description: Returns an cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationFabricResource' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + patch: + operationId: CxmlApplications_update + summary: Update cXML Application + description: Updates a cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplication' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationUpdateStatusCode422' + tags: + - cXML Application + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationUpdateRequest' + delete: + operationId: CxmlApplications_delete + summary: Delete cXML Application + description: Deletes a cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application /resources/external_laml_handlers: get: operationId: ExternalLAMLHandlers_list @@ -1219,6 +1427,20 @@ components: description: Unique ID of an AI Agent. schema: $ref: '#/components/schemas/uuid' + CxmlApplicationID: + name: id + in: path + required: true + description: Unique ID of a cXML Application. + schema: + $ref: '#/components/schemas/uuid' + CxmlApplicationIDPath: + name: cxml_application_id + in: path + required: true + description: Unique ID of a cXML Application. + schema: + $ref: '#/components/schemas/uuid' ExternalLAMLHandlerID: name: id in: path @@ -2249,6 +2471,353 @@ components: additionalProperties: $ref: '#/components/schemas/ContextStepsUpdate' title: contexts + CxmlApplication: + type: object + required: + - id + - name + - used_for + - call_handler_url + - call_handler_method + - call_handler_fallback_url + - call_handler_fallback_method + - call_status_callback_url + - call_status_callback_method + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 + description: Unique ID of the cXML Application. + name: + type: string + example: My cXML Application + description: Name of the cXML Application. + used_for: + allOf: + - $ref: '#/components/schemas/HandleCallsUsing' + example: script + description: Indicates whether the call will be handled by a script or an external URL. + call_handler_url: + type: string + example: https://example.com/cxml + description: Call handler URL + call_handler_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler URL method + call_handler_fallback_url: + type: string + example: https://example.com/cxml + description: Call handler callback URL. + call_handler_fallback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler fallback method. + call_status_callback_url: + type: string + example: https://callback.com + description: Call status callback URL + call_status_callback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: POST + description: Call status callback method. + CxmlApplicationAddress: + type: object + required: + - id + - resource_id + - name + - display_name + - type + - cover_url + - preview_url + - channel + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + example: 691af061-cd86-4893-a605-173f47afc4c2 + description: Unique ID of the Fabric Address. + resource_id: + allOf: + - $ref: '#/components/schemas/uuid' + example: 691af061-cd86-4893-a605-173f47afc4c2 + description: Fabric resource ID that the Fabric Address belongs to. + name: + type: string + example: justice-league + description: Name of the Fabric Address. + display_name: + type: string + example: Justice League + description: Display name of the Fabric Address. + type: + allOf: + - $ref: '#/components/schemas/DisplayTypes' + example: app + description: Type of the Fabric Address. + cover_url: + type: string + example: https://coverurl.com + description: Cover url of the Fabric Address. + preview_url: + type: string + example: https://previewurl.com + description: Preview url of the Fabric Address. + channel: + allOf: + - $ref: '#/components/schemas/AddressChannel' + description: Channels of the Fabric Address. + CxmlApplicationAddressListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CxmlApplicationAddress' + links: + $ref: '#/components/schemas/CxmlApplicationAddressPaginationResponse' + CxmlApplicationAddressPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + description: Link of the current page + first: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=0&page_size=50 + description: Link to the first page + next: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applications/a87db7ed-8ebe-42e4-829f-8ba5a4152f54/addresses?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + description: Link to the next page + CxmlApplicationCreateRequest: + type: object + required: + - name + - call_handler_script + properties: + name: + type: string + example: My cXML Application + description: Name of the cXML Application. + used_for: + allOf: + - $ref: '#/components/schemas/HandleCallsUsing' + example: script + description: Indicates whether the call will be handled by a script or an external URL. + call_handler_url: + type: string + example: https://example.com/cxml + description: Call handler URL + call_handler_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler URL method + default: POST + call_handler_fallback_url: + type: string + example: https://example.com/cxml + description: Call handler callback URL. + call_handler_fallback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler fallback method. + default: POST + call_status_callback_url: + type: string + example: https://callback.com + description: Call status callback URL + call_status_callback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call status callback method. + default: POST + call_handler_script: + type: string + example: |- + + + https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3 + + description: Script to handle to call. + CxmlApplicationCreateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: Name is required + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + CxmlApplicationFabricResource: + type: object + required: + - id + - project_id + - display_name + - type + - created_at + - updated_at + - cxml_application + properties: + id: + allOf: + - $ref: '#/components/schemas/uuid' + example: a87db7ed-8ebe-42e4-829f-8ba5a4152f54 + description: Unique ID of the cXML Application. + project_id: + allOf: + - $ref: '#/components/schemas/uuid' + example: 99151cf8-9548-4860-ba70-a8de824f3312 + description: Unique ID of the Project. + display_name: + type: string + example: Booking Assistant + description: Display name of the cXML Application Fabric Resource + type: + type: string + example: cxml_application + description: Type of the Fabric Resource + created_at: + type: string + format: date-time + example: 2024-10-17T14:14:53Z + description: Date and time when the resource was created. + updated_at: + type: string + format: date-time + example: 2024-10-17T14:14:53Z + description: Date and time when the resource was updated. + cxml_application: + allOf: + - $ref: '#/components/schemas/CxmlApplication' + description: cXML Application data. + CxmlApplicationListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CxmlApplicationFabricResource' + links: + $ref: '#/components/schemas/CxmlApplicationPaginationResponse' + CxmlApplicationPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 + description: Link of the current page + first: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 + description: Link to the first page + next: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + description: Link to the next page + CxmlApplicationUpdateRequest: + type: object + properties: + name: + type: string + example: My cXML Application + description: Name of the cXML Application. + used_for: + allOf: + - $ref: '#/components/schemas/HandleCallsUsing' + example: script + description: Indicates whether the call will be handled by a script or an external URL. + call_handler_url: + type: string + example: https://example.com/cxml + description: Call handler URL + call_handler_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler URL method + default: POST + call_handler_fallback_url: + type: string + example: https://example.com/cxml + description: Call handler callback URL. + call_handler_fallback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call handler fallback method. + default: POST + call_status_callback_url: + type: string + example: https://callback.com + description: Call status callback URL + call_status_callback_method: + allOf: + - $ref: '#/components/schemas/UrlMethodType' + example: GET + description: Call status callback method. + default: POST + call_handler_script: + type: string + example: |- + + + https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3 + + description: Script to handle to call. + CxmlApplicationUpdateStatusCode422: + type: object + required: + - errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Types.StatusCodes.StatusCode422Error' + example: + errors: + - type: validation_error + code: missing_required_parameter + message: Name is required + attribute: name + url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter DataMap: oneOf: - $ref: '#/components/schemas/Output' @@ -3056,6 +3625,12 @@ components: message: The addresses must belong to the project attribute: allowed_addresses url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#must_belong_to_project + HandleCallsUsing: + type: string + enum: + - script + - external_url + description: Indicates whether the call will be handled by a script or an external url. IntegerProperty: type: object required: From 1eb59018c784ba36f51429ca6481b1181714db74 Mon Sep 17 00:00:00 2001 From: imfaruk Date: Tue, 31 Dec 2024 08:59:36 +0600 Subject: [PATCH 2/4] update --- api/signalwire-rest/fabric-api/cxml-application/main.tsp | 4 ++-- .../fabric-api/tsp-output/@typespec/openapi3/openapi.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/signalwire-rest/fabric-api/cxml-application/main.tsp b/api/signalwire-rest/fabric-api/cxml-application/main.tsp index 9fb5381..833b09f 100644 --- a/api/signalwire-rest/fabric-api/cxml-application/main.tsp +++ b/api/signalwire-rest/fabric-api/cxml-application/main.tsp @@ -33,7 +33,7 @@ namespace FabricAPI.CxmlApplications { @summary("Create cXML Application") @doc("Creates acXML Application") @post create(...CxmlApplicationCreateRequest): - { @statusCode statusCode: 201; @body cxml_application: CxmlApplication; } | + { @statusCode statusCode: 201; @body cxml_application: CxmlApplicationFabricResource; } | StatusCode401 | StatusCode404 | CxmlApplicationCreateStatusCode422; @@ -41,7 +41,7 @@ namespace FabricAPI.CxmlApplications { @summary("Update cXML Application") @doc("Updates a cXML Application by ID") @patch update(...CxmlApplicationID, ...CxmlApplicationUpdateRequest): { - @statusCode statusCode: 200; @body cxml_application: CxmlApplication; + @statusCode statusCode: 200; @body cxml_application: CxmlApplicationFabricResource; } | StatusCode401 | StatusCode404 | diff --git a/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml b/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml index 951e61f..e092576 100644 --- a/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -375,7 +375,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CxmlApplication' + $ref: '#/components/schemas/CxmlApplicationFabricResource' '401': description: Access is unauthorized. content: @@ -482,7 +482,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CxmlApplication' + $ref: '#/components/schemas/CxmlApplicationFabricResource' '401': description: Access is unauthorized. content: From f984130a1e11e1ebedbc91c4e53b04334e429024 Mon Sep 17 00:00:00 2001 From: imfaruk Date: Tue, 31 Dec 2024 09:46:03 +0600 Subject: [PATCH 3/4] update --- api/signalwire-rest/fabric-api/_spec_.yaml | 8 +- .../fabric-api/cxml-application/main.tsp | 6 +- .../cxml-application/models/core.tsp | 29 ------- .../cxml-application/models/responses.tsp | 31 +++++++- .../@typespec/openapi3/openapi.yaml | 76 +++++++++---------- 5 files changed, 75 insertions(+), 75 deletions(-) diff --git a/api/signalwire-rest/fabric-api/_spec_.yaml b/api/signalwire-rest/fabric-api/_spec_.yaml index 79e17de..e6ced9b 100644 --- a/api/signalwire-rest/fabric-api/_spec_.yaml +++ b/api/signalwire-rest/fabric-api/_spec_.yaml @@ -3523,7 +3523,7 @@ components: message: Name is required attribute: name url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter - CxmlApplicationFabricResource: + CxmlApplicationResponse: type: object required: - id @@ -3575,7 +3575,7 @@ components: data: type: array items: - $ref: '#/components/schemas/CxmlApplicationFabricResource' + $ref: '#/components/schemas/CxmlApplicationResponse' links: $ref: '#/components/schemas/CxmlApplicationPaginationResponse' CxmlApplicationPaginationResponse: @@ -7174,7 +7174,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CxmlApplicationFabricResource' + $ref: '#/components/schemas/CxmlApplicationResponse' '401': description: Access is unauthorized. content: @@ -7205,7 +7205,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CxmlApplication' + $ref: '#/components/schemas/CxmlApplicationResponse' '401': description: Access is unauthorized. content: diff --git a/api/signalwire-rest/fabric-api/cxml-application/main.tsp b/api/signalwire-rest/fabric-api/cxml-application/main.tsp index 833b09f..82af1ab 100644 --- a/api/signalwire-rest/fabric-api/cxml-application/main.tsp +++ b/api/signalwire-rest/fabric-api/cxml-application/main.tsp @@ -25,7 +25,7 @@ namespace FabricAPI.CxmlApplications { @doc("Returns an cXML Application by ID") read(...CxmlApplicationID): { @statusCode statusCode: 200; - @body cxml_application: CxmlApplicationFabricResource; + @body cxml_application: CxmlApplicationResponse; } | StatusCode401 | StatusCode404; @@ -33,7 +33,7 @@ namespace FabricAPI.CxmlApplications { @summary("Create cXML Application") @doc("Creates acXML Application") @post create(...CxmlApplicationCreateRequest): - { @statusCode statusCode: 201; @body cxml_application: CxmlApplicationFabricResource; } | + { @statusCode statusCode: 201; @body cxml_application: CxmlApplicationResponse; } | StatusCode401 | StatusCode404 | CxmlApplicationCreateStatusCode422; @@ -41,7 +41,7 @@ namespace FabricAPI.CxmlApplications { @summary("Update cXML Application") @doc("Updates a cXML Application by ID") @patch update(...CxmlApplicationID, ...CxmlApplicationUpdateRequest): { - @statusCode statusCode: 200; @body cxml_application: CxmlApplicationFabricResource; + @statusCode statusCode: 200; @body cxml_application: CxmlApplicationResponse; } | StatusCode401 | StatusCode404 | diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp index e29c7eb..b720c96 100644 --- a/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp +++ b/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp @@ -46,32 +46,3 @@ model CxmlApplication { @example(UrlMethodType.Post) call_status_callback_method: UrlMethodType; } - -model CxmlApplicationFabricResource { - @doc("Unique ID of the cXML Application.") - @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") - id: uuid; - - @doc("Unique ID of the Project.") - @example("99151cf8-9548-4860-ba70-a8de824f3312") - project_id: uuid; - - @doc("Display name of the cXML Application Fabric Resource") - @example("Booking Assistant") - display_name: string; - - @doc("Type of the Fabric Resource") - @example("cxml_application") - type: string; - - @doc("Date and time when the resource was created.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) - created_at: utcDateTime; - - @doc("Date and time when the resource was updated.") - @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) - updated_at: utcDateTime; - - @doc("cXML Application data.") - cxml_application: CxmlApplication; -} \ No newline at end of file diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/responses.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/responses.tsp index 6b712d0..8a0ad5e 100644 --- a/api/signalwire-rest/fabric-api/cxml-application/models/responses.tsp +++ b/api/signalwire-rest/fabric-api/cxml-application/models/responses.tsp @@ -1,5 +1,34 @@ + +model CxmlApplicationResponse { + @doc("Unique ID of the cXML Application.") + @example("a87db7ed-8ebe-42e4-829f-8ba5a4152f54") + id: uuid; + + @doc("Unique ID of the Project.") + @example("99151cf8-9548-4860-ba70-a8de824f3312") + project_id: uuid; + + @doc("Display name of the cXML Application Fabric Resource") + @example("Booking Assistant") + display_name: string; + + @doc("Type of the Fabric Resource") + @example("cxml_application") + type: string; + + @doc("Date and time when the resource was created.") + @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + created_at: utcDateTime; + + @doc("Date and time when the resource was updated.") + @example(utcDateTime.fromISO("2024-10-17T14:14:53Z")) + updated_at: utcDateTime; + + @doc("cXML Application data.") + cxml_application: CxmlApplication; +} model CxmlApplicationListResponse { - data: CxmlApplicationFabricResource[]; + data: CxmlApplicationResponse[]; links: CxmlApplicationPaginationResponse; } diff --git a/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml b/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml index e092576..8624124 100644 --- a/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -375,7 +375,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CxmlApplicationFabricResource' + $ref: '#/components/schemas/CxmlApplicationResponse' '401': description: Access is unauthorized. content: @@ -451,7 +451,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CxmlApplicationFabricResource' + $ref: '#/components/schemas/CxmlApplicationResponse' '401': description: Access is unauthorized. content: @@ -482,7 +482,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CxmlApplicationFabricResource' + $ref: '#/components/schemas/CxmlApplicationResponse' '401': description: Access is unauthorized. content: @@ -2675,7 +2675,41 @@ components: message: Name is required attribute: name url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter - CxmlApplicationFabricResource: + CxmlApplicationListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CxmlApplicationResponse' + links: + $ref: '#/components/schemas/CxmlApplicationPaginationResponse' + CxmlApplicationPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 + description: Link of the current page + first: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 + description: Link to the first page + next: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + description: Link to the next page + CxmlApplicationResponse: type: object required: - id @@ -2718,40 +2752,6 @@ components: allOf: - $ref: '#/components/schemas/CxmlApplication' description: cXML Application data. - CxmlApplicationListResponse: - type: object - required: - - data - - links - properties: - data: - type: array - items: - $ref: '#/components/schemas/CxmlApplicationFabricResource' - links: - $ref: '#/components/schemas/CxmlApplicationPaginationResponse' - CxmlApplicationPaginationResponse: - type: object - required: - - self - - first - - next - properties: - self: - type: string - format: uri - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 - description: Link of the current page - first: - type: string - format: uri - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 - description: Link to the first page - next: - type: string - format: uri - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - description: Link to the next page CxmlApplicationUpdateRequest: type: object properties: From 9db4cdc8ed56c486326d91c2511c1b2ffe658aa1 Mon Sep 17 00:00:00 2001 From: imfaruk Date: Tue, 31 Dec 2024 16:31:59 +0600 Subject: [PATCH 4/4] update --- api/signalwire-rest/fabric-api/_spec_.yaml | 509 +++++++++--------- .../cxml-application/models/core.tsp | 2 +- .../cxml-application/models/requests.tsp | 8 +- .../@typespec/openapi3/openapi.yaml | 9 +- 4 files changed, 266 insertions(+), 262 deletions(-) diff --git a/api/signalwire-rest/fabric-api/_spec_.yaml b/api/signalwire-rest/fabric-api/_spec_.yaml index e6ced9b..52b4640 100644 --- a/api/signalwire-rest/fabric-api/_spec_.yaml +++ b/api/signalwire-rest/fabric-api/_spec_.yaml @@ -3315,16 +3315,13 @@ components: message: Ciphers are invalid attribute: ciphers url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter - uuid: - type: string - format: uuid - description: Universal Unique Identifier. + CxmlApplication: type: object required: - id - name - - used_for + - handle_calls_using - call_handler_url - call_handler_method - call_handler_fallback_url @@ -3341,7 +3338,7 @@ components: type: string example: My cXML Application description: Name of the cXML Application. - used_for: + handle_calls_using: allOf: - $ref: '#/components/schemas/HandleCallsUsing' example: script @@ -3373,6 +3370,11 @@ components: - $ref: '#/components/schemas/UrlMethodType' example: POST description: Call status callback method. + HandleCallsUsing: + type: string + enum: + - script + - external_url CxmlApplicationAddress: type: object required: @@ -3458,13 +3460,12 @@ components: type: object required: - name - - call_handler_script properties: name: type: string example: My cXML Application description: Name of the cXML Application. - used_for: + handle_calls_using: allOf: - $ref: '#/components/schemas/HandleCallsUsing' example: script @@ -3523,6 +3524,40 @@ components: message: Name is required attribute: name url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + CxmlApplicationListResponse: + type: object + required: + - data + - links + properties: + data: + type: array + items: + $ref: '#/components/schemas/CxmlApplicationResponse' + links: + $ref: '#/components/schemas/CxmlApplicationPaginationResponse' + CxmlApplicationPaginationResponse: + type: object + required: + - self + - first + - next + properties: + self: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 + description: Link of the current page + first: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 + description: Link to the first page + next: + type: string + format: uri + example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca + description: Link to the next page CxmlApplicationResponse: type: object required: @@ -3566,40 +3601,6 @@ components: allOf: - $ref: '#/components/schemas/CxmlApplication' description: cXML Application data. - CxmlApplicationListResponse: - type: object - required: - - data - - links - properties: - data: - type: array - items: - $ref: '#/components/schemas/CxmlApplicationResponse' - links: - $ref: '#/components/schemas/CxmlApplicationPaginationResponse' - CxmlApplicationPaginationResponse: - type: object - required: - - self - - first - - next - properties: - self: - type: string - format: uri - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 - description: Link of the current page - first: - type: string - format: uri - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=0&page_size=50 - description: Link to the first page - next: - type: string - format: uri - example: https://{space_name}.signalwire.com/api/fabric/resources/cxml_applicationis?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca - description: Link to the next page CxmlApplicationUpdateRequest: type: object properties: @@ -3607,7 +3608,7 @@ components: type: string example: My cXML Application description: Name of the cXML Application. - used_for: + handle_calls_using: allOf: - $ref: '#/components/schemas/HandleCallsUsing' example: script @@ -3666,6 +3667,10 @@ components: message: Name is required attribute: name url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes/#missing_required_parameter + uuid: + type: string + format: uuid + description: Universal Unique Identifier. responses: '204': description: No Content @@ -3768,11 +3773,11 @@ components: tags: - name: AI Agents - name: Call Flows - - name: cXML Applications + - name: cXML Application - name: Dialogflow Agents - name: External LAML Handler - name: External SWML Handler - - name: Fabric Addresses + - name: Fabric Address - name: FreeSWITCH Connectors - name: LAML Applications - name: LAML Bins @@ -7056,213 +7061,6 @@ paths: responses: '204': description: No content - /resources/cxml_applications: - get: - operationId: CxmlApplications_list - summary: List cXML Applications - description: A list of cXML Applications - parameters: [] - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplicationListResponse' - '401': - description: Access is unauthorized. - content: - application/json: - schema: - type: string - enum: - - Unauthorized - '404': - description: The server cannot find the requested resource. - content: - application/json: - schema: - type: string - enum: - - Not Found - tags: - - cXML Application - post: - operationId: CxmlApplications_create - summary: Create cXML Application - description: Creates an cXML Application - parameters: [] - responses: - '201': - description: The request has succeeded and a new resource has been created as a result. - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplication' - '401': - description: Access is unauthorized. - content: - application/json: - schema: - type: string - enum: - - Unauthorized - '404': - description: The server cannot find the requested resource. - content: - application/json: - schema: - type: string - enum: - - Not Found - '422': - description: Client error - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplicationCreateStatusCode422' - tags: - - cXML Application - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplicationCreateRequest' - /resources/cxml_applications/{cxml_application_id}/addresses: - get: - operationId: CxmlApplicationAddresses_list - summary: List cXML Application Addresses - description: A list of cXML Application Addresses - parameters: - - $ref: '#/components/parameters/CxmlApplicationIDPath' - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplicationAddressListResponse' - '401': - description: Access is unauthorized. - content: - application/json: - schema: - type: string - enum: - - Unauthorized - '404': - description: The server cannot find the requested resource. - content: - application/json: - schema: - type: string - enum: - - Not Found - tags: - - cXML Application - /resources/cxml_applications/{id}: - get: - operationId: CxmlApplications_read - summary: Get cXML Application - description: Returns an cXML Application by ID - parameters: - - $ref: '#/components/parameters/CxmlApplicationID' - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplicationResponse' - '401': - description: Access is unauthorized. - content: - application/json: - schema: - type: string - enum: - - Unauthorized - '404': - description: The server cannot find the requested resource. - content: - application/json: - schema: - type: string - enum: - - Not Found - tags: - - cXML Application - patch: - operationId: CxmlApplications_update - summary: Update cXML Application - description: Updates an cXML Application by ID - parameters: - - $ref: '#/components/parameters/CxmlApplicationID' - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplicationResponse' - '401': - description: Access is unauthorized. - content: - application/json: - schema: - type: string - enum: - - Unauthorized - '404': - description: The server cannot find the requested resource. - content: - application/json: - schema: - type: string - enum: - - Not Found - '422': - description: Client error - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplicationUpdateStatusCode422' - tags: - - cXML Application - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CxmlApplicationUpdateRequest' - delete: - operationId: CxmlApplications_delete - summary: Delete cXML Application - description: Deletes an cXML Application by ID - parameters: - - $ref: '#/components/parameters/CxmlApplicationID' - responses: - '204': - description: 'There is no content to send for this request, but the headers may be useful. ' - '401': - description: Access is unauthorized. - content: - application/json: - schema: - type: string - enum: - - Unauthorized - '404': - description: The server cannot find the requested resource. - content: - application/json: - schema: - type: string - enum: - - Not Found - tags: - - cXML Application /resources/external_swml_handlers: get: operationId: ExternalSWMLHandlers_list @@ -11224,6 +11022,213 @@ paths: responses: '204': description: No content + /resources/cxml_applications: + get: + operationId: CxmlApplications_list + summary: List cXML Applications + description: A list of cXML Applications + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + post: + operationId: CxmlApplications_create + summary: Create cXML Application + description: Creates acXML Application + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationCreateStatusCode422' + tags: + - cXML Application + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationCreateRequest' + /resources/cxml_applications/{cxml_application_id}/addresses: + get: + operationId: CxmlApplicationAddresses_list + summary: List cXML Application Addresses + description: A list of cXML Application Addresses + parameters: + - $ref: '#/components/parameters/CxmlApplicationIDPath' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationAddressListResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + /resources/cxml_applications/{id}: + get: + operationId: CxmlApplications_read + summary: Get cXML Application + description: Returns an cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application + patch: + operationId: CxmlApplications_update + summary: Update cXML Application + description: Updates a cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationResponse' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + '422': + description: Client error + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationUpdateStatusCode422' + tags: + - cXML Application + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CxmlApplicationUpdateRequest' + delete: + operationId: CxmlApplications_delete + summary: Delete cXML Application + description: Deletes a cXML Application by ID + parameters: + - $ref: '#/components/parameters/CxmlApplicationID' + responses: + '204': + description: 'There is no content to send for this request, but the headers may be useful. ' + '401': + description: Access is unauthorized. + content: + application/json: + schema: + type: string + enum: + - Unauthorized + '404': + description: The server cannot find the requested resource. + content: + application/json: + schema: + type: string + enum: + - Not Found + tags: + - cXML Application /resources/{id}/addresses: get: tags: diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp index b720c96..a2685ec 100644 --- a/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp +++ b/api/signalwire-rest/fabric-api/cxml-application/models/core.tsp @@ -20,7 +20,7 @@ model CxmlApplication { @doc("Indicates whether the call will be handled by a script or an external URL.") @example(HandleCallsUsing.Script) - used_for: HandleCallsUsing; + handle_calls_using: HandleCallsUsing; @doc("Call handler URL") @example("https://example.com/cxml") diff --git a/api/signalwire-rest/fabric-api/cxml-application/models/requests.tsp b/api/signalwire-rest/fabric-api/cxml-application/models/requests.tsp index f86c13a..e53c11e 100644 --- a/api/signalwire-rest/fabric-api/cxml-application/models/requests.tsp +++ b/api/signalwire-rest/fabric-api/cxml-application/models/requests.tsp @@ -5,7 +5,7 @@ model CxmlApplicationCreateRequest { @doc("Indicates whether the call will be handled by a script or an external URL.") @example(HandleCallsUsing.Script) - used_for?: HandleCallsUsing; + handle_calls_using?: HandleCallsUsing; @doc("Call handler URL") @example("https://example.com/cxml") @@ -33,7 +33,7 @@ model CxmlApplicationCreateRequest { @doc("Script to handle to call.") @example("\n\n https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3\n") - call_handler_script: string; + call_handler_script?: string; } model CxmlApplicationUpdateRequest { @@ -43,7 +43,7 @@ model CxmlApplicationUpdateRequest { @doc("Indicates whether the call will be handled by a script or an external URL.") @example(HandleCallsUsing.Script) - used_for?: HandleCallsUsing; + handle_calls_using?: HandleCallsUsing; @doc("Call handler URL") @example("https://example.com/cxml") @@ -71,5 +71,5 @@ model CxmlApplicationUpdateRequest { @doc("Script to handle to call.") @example("\n\n https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3\n") - call_handler_script: string; + call_handler_script?: string; } diff --git a/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml b/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml index 8624124..1cbdab6 100644 --- a/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml +++ b/api/signalwire-rest/fabric-api/tsp-output/@typespec/openapi3/openapi.yaml @@ -2476,7 +2476,7 @@ components: required: - id - name - - used_for + - handle_calls_using - call_handler_url - call_handler_method - call_handler_fallback_url @@ -2493,7 +2493,7 @@ components: type: string example: My cXML Application description: Name of the cXML Application. - used_for: + handle_calls_using: allOf: - $ref: '#/components/schemas/HandleCallsUsing' example: script @@ -2610,13 +2610,12 @@ components: type: object required: - name - - call_handler_script properties: name: type: string example: My cXML Application description: Name of the cXML Application. - used_for: + handle_calls_using: allOf: - $ref: '#/components/schemas/HandleCallsUsing' example: script @@ -2759,7 +2758,7 @@ components: type: string example: My cXML Application description: Name of the cXML Application. - used_for: + handle_calls_using: allOf: - $ref: '#/components/schemas/HandleCallsUsing' example: script