Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@signalwire/js

Package Overview
Dependencies
Maintainers
0
Versions
366
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@signalwire/js - npm Package Compare versions

Comparing version 3.28.0-dev.202407241358.62ba0f6.0 to 3.28.0-dev.202408051204.fe44c5d.0

dist/js/src/fabric/utils/typeGuard.d.ts

2

dist/js/src/fabric/HTTPClient.d.ts

@@ -10,3 +10,3 @@ import { type UserOptions } from '@signalwire/core';

get httpHost(): string;
getAddress(params: GetAddressParams): Promise<GetAddressResult>;
getAddress(params: GetAddressParams): Promise<GetAddressResult | undefined>;
getAddresses(params?: GetAddressesParams): Promise<GetAddressesResult>;

@@ -13,0 +13,0 @@ registerDevice(params: RegisterDeviceParams): Promise<RegisterDeviceResult>;

@@ -157,5 +157,9 @@ import type { ConversationEventParams, UserOptions } from '@signalwire/core';

}
export interface GetAddressParams {
export interface GetAddressByIdParams {
id: string;
}
export interface GetAddressByNameParams {
name: string;
}
export declare type GetAddressParams = GetAddressByIdParams | GetAddressByNameParams;
export declare type GetAddressResult = GetAddressResponse;

@@ -162,0 +166,0 @@ export declare type GetAddressesResponse = PaginatedResponse<GetAddressResponse>;

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "3.28.0-dev.202407241358.62ba0f6.0",
"version": "3.28.0-dev.202408051204.fe44c5d.0",
"main": "dist/index.js",

@@ -43,4 +43,4 @@ "module": "dist/index.esm.js",

"dependencies": {
"@signalwire/core": "4.2.0-dev.202407241358.62ba0f6.0",
"@signalwire/webrtc": "3.12.2-dev.202407241358.62ba0f6.0",
"@signalwire/core": "4.2.0-dev.202408051204.fe44c5d.0",
"@signalwire/webrtc": "3.12.2-dev.202408051204.fe44c5d.0",
"jwt-decode": "^3.1.2"

@@ -47,0 +47,0 @@ },

@@ -19,2 +19,3 @@ import jwtDecode from 'jwt-decode'

import { makeQueryParamsUrls } from '../utils/makeQueryParamsUrl'
import { isGetAddressByIdParams, isGetAddressByNameParams, isGetAddressesResponse } from './utils/typeGuard'

@@ -58,7 +59,16 @@ type JWTHeader = { ch?: string; typ?: string }

public async getAddress(params: GetAddressParams): Promise<GetAddressResult> {
const { id } = params
let path = `/api/fabric/addresses/${id}`
public async getAddress(params: GetAddressParams): Promise<GetAddressResult | undefined> {
let path = '/api/fabric/addresses'
if (isGetAddressByNameParams(params)) {
path = `${path}?name=${params.name}`
} else if (isGetAddressByIdParams(params)) {
path = `${path}/${params.id}`
}
const { body } = await this.httpClient<GetAddressResponse>(path)
const { body } = await this.httpClient<GetAddressResponse | GetAddressesResponse>(path)
if (isGetAddressesResponse(body)) {
// FIXME until the server handles a index lookup by name we need to handle it as a search result
return body.data[0]
}
return body

@@ -65,0 +75,0 @@ }

@@ -180,6 +180,12 @@ import type { ConversationEventParams, UserOptions } from '@signalwire/core'

export interface GetAddressParams {
export interface GetAddressByIdParams {
id: string
}
export interface GetAddressByNameParams {
name: string
}
export type GetAddressParams = GetAddressByIdParams | GetAddressByNameParams
export type GetAddressResult = GetAddressResponse

@@ -186,0 +192,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc