{"_id":"@goodtok/sdk","_rev":"50-adbf5e909b624c01e1195fd65ac2b04c","name":"@goodtok/sdk","dist-tags":{"latest":"0.1.18","next":"0.1.18"},"versions":{"0.0.1":{"name":"@goodtok/sdk","version":"0.0.1","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.1","@goodtok/common":"^0.0.1","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","ws":"^8.14.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"ebd8920cde102ff806a6a2e50292e6e6eb2c042c","_id":"@goodtok/sdk@0.0.1","_nodeVersion":"18.17.1","_npmVersion":"lerna/7.3.0/node@v18.17.1+arm64 (darwin)","dist":{"integrity":"sha512-/BON+R0EZL8bEHd1ta4XySqnZW10RtMKSt5AvFEPoh6mVy/xyUC5ONdG3GopV+GqXrP5pHmzPEtjqBz3PNF5xA==","shasum":"bd16620d11f00700c75b03b0156779b6a6b1a602","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.1.tgz","fileCount":32,"unpackedSize":23558,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1P0hB6WahLEft4bKaLlkC+5F7wQj0XU6yzx0PQqbaHAiBHcY3hcCSiN5Zx04OvnQqaAL/GGmRAomO9xgD/DAae0w=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.1_1696775461950_0.4818788168938064"},"_hasShrinkwrap":false},"0.0.2":{"name":"@goodtok/sdk","version":"0.0.2","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.2","@goodtok/common":"^0.0.2","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","ws":"^8.14.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"dc8c1398e1bd29af8c716988de2501a0b44879e5","_id":"@goodtok/sdk@0.0.2","_nodeVersion":"18.18.0","_npmVersion":"lerna/7.3.0/node@v18.18.0+x64 (linux)","dist":{"integrity":"sha512-OTtIjYAfdbziE2NylpKp52Gy6XJMe2y2vYrnrvejDIMUnHVUai+oe4ZpD1MO9LZTi5wtFiBwwlywd3jUZHoGDA==","shasum":"25b13825fbcac5252627a6a947553bac3c09a712","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.2.tgz","fileCount":32,"unpackedSize":22158,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDqUeucSfPXzc42DdSX+eQrsqKkl8m3wd94/UxHNdImQIhALpLfqOS1HiBHUHwJNB5HBhqO+DSCqzW9vEipbe6QeD6"}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.2_1697473772312_0.06247803094564097"},"_hasShrinkwrap":false},"0.0.3":{"name":"@goodtok/sdk","version":"0.0.3","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.3","@goodtok/common":"^0.0.3","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","jwt-decode":"^3.1.2","ws":"^8.14.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"9f9656cee35191f039171a81e378f18ea82d3279","readme":"sdk\n=================\n\nSDK for Goodtok Server\n\n[![goodtok](https://img.shields.io/badge/goodtok-sdk-brightgreen.svg)](https://goodtok.io)\n[![Version](https://img.shields.io/npm/v/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![Downloads/week](https://img.shields.io/npm/dw/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![License](https://img.shields.io/npm/l/@goodtok/sdk.svg)](https://github.com/fonoster/goodtok/blob/main/package.json)\n\n<!-- toc -->\n* [Installation](#installation)\n* [APIs](#apis)\n<!-- tocstop -->\n# Installation\n<!-- installation -->\n```sh-session\n$ npm install --save @goodtok/sdk\n```\n<!-- usagestop -->\n# APIs\n<!-- apis -->\n* [`Customers`](#Customers)\n* [`Users`](#Users)\n* [`Workspaces`](#Workspaces)\n* [`Tokens`](#Tokens)\n\n\n<a name=\"Customers\"></a>\n\n## Customers\nUse the Goodtok Customers capability to retrieve and manage customers.\nEnsure the Goodtok API Server is running for the Customers API to function.\n\n**Kind**: global class  \n**See**: module:sdk:Client  \n\n* [Customers](#Customers)\n    * [new Customers(client)](#new_Customers_new)\n    * [.getCustomerById(id)](#Customers+getCustomerById) ⇒ <code>Promise.&lt;Customer&gt;</code>\n\n<a name=\"new_Customers_new\"></a>\n\n### new Customers(client)\nConstructs a new Customers API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getCustomer() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const customers = new SDK.Customers(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const customer = await customers.getCustomerById(id);\n\n  console.log(customer);\n}\n\ngetCustomer().catch(console.error);\n```\n<a name=\"Customers+getCustomerById\"></a>\n\n### customers.getCustomerById(id) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer by its ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\ncustomers.getCustomerById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Tokens\"></a>\n\n## Tokens\nUse the Goodtok Tokens capability to create and verify JWT tokens.\nEnsure the Goodtok API Server is running for the Tokens API to function.\n\n**Kind**: global class  \n**See**: module:sdk:Client  \n\n* [Tokens](#Tokens)\n    * [new Tokens(client)](#new_Tokens_new)\n    * [.createAnonymousToken(request)](#Tokens+createAnonymousToken) ⇒ <code>Promise.&lt;CreateAnonymousTokenResponse&gt;</code>\n    * [.createToken(request)](#Tokens+createToken) ⇒ <code>Promise.&lt;CreateTokenResponse&gt;</code>\n\n<a name=\"new_Tokens_new\"></a>\n\n### new Tokens(client)\nConstructs a new Tokens API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function createAnonymousToken() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const tokens = new SDK.Tokens(client);\n  const request = {\n    ref: \"myref\",\n    aor: \"anonymous@sip.goodtok.io\",\n    aorLink: \"anonymous@sip.goodtok.io\",\n  };\n\n  const connectionObject = await tokens.createAnonymousToken(request);\n  console.log(connectionObject);\n}\n\ncreateAnonymousToken().catch(console.error);\n```\n<a name=\"Tokens+createAnonymousToken\"></a>\n\n### tokens.createAnonymousToken(request) ⇒ <code>Promise.&lt;CreateAnonymousTokenResponse&gt;</code>\nCreates a new anonymous token with `allowedMethods=[REGISTER]` permissions.\nDoes not require authentication. The token will be issued only if the workspace has the `anonymous` feature enabled.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;CreateAnonymousTokenResponse&gt;</code> - A promise resolving to the connection object which contains the token  \n**Throws**:\n\n- Will throw an error if the workspace does not have the `anonymous` feature enabled\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateAnonymousTokenInput</code> | A request with claims required to create a token |\n| request.ref | <code>string</code> | A reference for the anonymous user |\n| request.aor | <code>string</code> | The address of record (AOR) for the user |\n| request.aorLink | <code>string</code> | The address of record (AOR) for the user |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  aor: \"anonymous@sip.goodtok.io\",\n  aorLink: \"anonymous@sip.goodtok.io\"\n}\n\ntokens.createAnonymousToken(request)\n  .then(console.log)\n  .catch(console.error) // handle any errors\n```\n<a name=\"Tokens+createToken\"></a>\n\n### tokens.createToken(request) ⇒ <code>Promise.&lt;CreateTokenResponse&gt;</code>\nCreates a new token with the specified permissions.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;CreateTokenResponse&gt;</code> - A promise resolving to the connection object containing the token  \n**Throws**:\n\n- Will throw an error if the user is not logged in\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateTokenInput</code> | A request with claims required to create the token |\n| request.ref | <code>string</code> | A reference for the user |\n| request.aor | <code>string</code> | The address of record (AOR) for the user |\n| request.aorLink | <code>string</code> | The address of record (AOR) for the user |\n| request.allowedMethods | <code>Array.&lt;string&gt;</code> | The list of methods the token is permitted to use (e.g. [\"INVITE\", \"REGISTER\"]) |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  aor: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d@sip.goodtok.io\",\n  aorLink: \"anonymous@sip.goodtok.io\",\n  allowedMethods: [\"INVITE\"],\n};\n\ntokens.createToken(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Users\"></a>\n\n## Users\nUse the Goodtok Users capability to retrieve and manage users.\nEnsure the Goodtok API Server is running for the Users API to function.\n\n**Kind**: global class  \n**See**: module:sdk:Client  \n\n* [Users](#Users)\n    * [new Users(client)](#new_Users_new)\n    * [.getCurrentUser()](#Users+getCurrentUser) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.getUserById(id)](#Users+getUserById) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.updateUser(request)](#Users+updateUser) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\n\n<a name=\"new_Users_new\"></a>\n\n### new Users(client)\nConstructs a new Users API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getUser() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const users = new SDK.Users(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const user = await users.getUserById(id);\n\n  console.log(user);\n}\n\ngetUser().catch(console.error);\n```\n<a name=\"Users+getCurrentUser\"></a>\n\n### users.getCurrentUser() ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves the logged-in user.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if user is not logged in or the JWT token has expired\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getCurrentUser(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+getUserById\"></a>\n\n### users.getUserById(id) ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves a user by its ID. The calling user must have an admin role to retrieve other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if the user is not found\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The user ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getUserById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+updateUser\"></a>\n\n### users.updateUser(request) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\nUpdates a user's details. The calling user must have an admin role to update other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;UpdateUserResponse&gt;</code> - A promise resolving to the updated user's details  \n**Throws**:\n\n- Will throw an error if the user is not found\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateUserRequest</code> | A request object containing the user ID and update data |\n| request.id | <code>string</code> | The user ID |\n| request.name | <code>string</code> | Optional parameter to update the user's name |\n| request.email | <code>string</code> | Optional parameter to update the user's email |\n| request.password | <code>string</code> | Optional parameter to update the user's password |\n| request.avatar | <code>string</code> | Optional parameter to update the user's avatar |\n\n**Example**  \n```js\nconst request = {\n  id: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\",\n  name: \"John Doe\",\n  email: \"john@example.com\",\n  password: \"mysecretpassword\",\n  avatar: \"https://example.com/avatar.png\"\n};\n\nusers.updateUser(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Workspaces\"></a>\n\n## Workspaces\nUse the Goodtok Workspaces capability to retrieve and manage workspaces.\nEnsure the Goodtok API Server is running for the Workspaces API to function.\n\n**Kind**: global class  \n**See**: module:sdk:Client  \n\n* [Workspaces](#Workspaces)\n    * [new Workspaces(client)](#new_Workspaces_new)\n    * [.getDefaultWorkspaceId()](#Workspaces+getDefaultWorkspaceId) ⇒ <code>string</code>\n    * [.getDefaultWorkspace()](#Workspaces+getDefaultWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceQueue()](#Workspaces+getDefaultWorkspaceQueue) ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\n    * [.getDefaultWorkspaceMembers()](#Workspaces+getDefaultWorkspaceMembers) ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\n    * [.getWorkspaceById(id)](#Workspaces+getWorkspaceById) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getMembersByWorkspaceId(id)](#Workspaces+getMembersByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getQueueByWorkspaceId(id)](#Workspaces+getQueueByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.updateWorkspace(request)](#Workspaces+updateWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getWorkspaces()](#Workspaces+getWorkspaces) ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\n    * [.watchQueue(id, callback)](#Workspaces+watchQueue)\n\n<a name=\"new_Workspaces_new\"></a>\n\n### new Workspaces(client)\nConstructs a new Workspaces API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaces = new SDK.Workspaces(client);\n  const workspace = await workspaces.getDefaultWorkspace();\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Workspaces+getDefaultWorkspaceId\"></a>\n\n### workspaces.getDefaultWorkspaceId() ⇒ <code>string</code>\nRetrieves the default workspace ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>string</code> - The default workspace ID  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceId();\n```\n<a name=\"Workspaces+getDefaultWorkspace\"></a>\n\n### workspaces.getDefaultWorkspace() ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n**Example**  \n```js\nworkspaces.getDefaultWorkspace()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceQueue\"></a>\n\n### workspaces.getDefaultWorkspaceQueue() ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\nRetrieves the queue for the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;GetQueueResponse&gt;</code> - A promise resolving to the queue  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceQueue()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceMembers\"></a>\n\n### workspaces.getDefaultWorkspaceMembers() ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\nRetrieves the members for the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;GetQueueResponse&gt;</code> - A promise resolving to the queue  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceMembers()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaceById\"></a>\n\n### workspaces.getWorkspaceById(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getWorkspaceById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getMembersByWorkspaceId\"></a>\n\n### workspaces.getMembersByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the members for a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of members  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getMembersByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getQueueByWorkspaceId\"></a>\n\n### workspaces.getQueueByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the queue for a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of queue entries  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getQueueByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+updateWorkspace\"></a>\n\n### workspaces.updateWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nUpdates the details of a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the updated workspace's details  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateWorkspaceRequest</code> | The request object containing the workspace ID and update data |\n| request.id | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  id: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    monday: [\n      {\n        start: \"09:00\",\n        end: \"17:00\"\n      }\n    ],\n    // ...\n  }\n};\n\nworkspaces.updateWorkspace(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaces\"></a>\n\n### workspaces.getWorkspaces() ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\nRetrieves all workspaces for the authenticated user.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code> - A promise resolving to an array of workspaces  \n<a name=\"Workspaces+watchQueue\"></a>\n\n### workspaces.watchQueue(id, callback)\nRegisters a callback for real-time updates on queue entries within a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when a queue entry updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.watchQueue(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n\n","readmeFilename":"README.md","_id":"@goodtok/sdk@0.0.3","_nodeVersion":"18.18.0","_npmVersion":"lerna/7.3.0/node@v18.18.0+x64 (linux)","dist":{"integrity":"sha512-wWkzHlhMGxMLBPfsG3jQFeGTTy8ZSOQAS0v6US10dYQUdSnLN/eGBlj5Hnj1Ll3qYefzhCugkJCb41w2Gbyv0A==","shasum":"79f4978f363302d2df33d425c1bae73db1b25ee7","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.3.tgz","fileCount":33,"unpackedSize":69584,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCstDS6dEhDc3qpCF3CCiw8DqaHMNkR50YAtvnL2XQWjAIhANZ+PmsyJQ3ipUb/ucW9MNeK3bTHGg15PDOT2qC8n+Q/"}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.3_1697561018423_0.9789765536490307"},"_hasShrinkwrap":false},"0.0.4":{"name":"@goodtok/sdk","version":"0.0.4","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.4","@goodtok/common":"^0.0.4","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^3.1.2","ws":"^8.14.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"70a27fa6f62b197585415f6763b9c2df264ab6da","_id":"@goodtok/sdk@0.0.4","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.3.0/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-g5DNSZLvq3JNV+Gmj3RYohdACrE6dCAUl43sMLwy9WGwQGzJ5BWnnIqqEOaeGpUyNRntAXE12xbyIhv+628dZw==","shasum":"1efbabc2ebcf1dbc326f1d986ac9833feca5fa27","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.4.tgz","fileCount":35,"unpackedSize":112053,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3r4NgN80VmbOAqMa0UMRmRVYukBEmhSbv3+HTsNPZFQIgNe2OR++ZioyMgfdVx6kjfK2UKjYGe07SpgJ+C8xNtGk="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.4_1697757076105_0.6724675165967475"},"_hasShrinkwrap":false},"0.0.5":{"name":"@goodtok/sdk","version":"0.0.5","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.5","@goodtok/common":"^0.0.5","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^3.1.2","ws":"^8.14.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"3a2bdac6d018bf2cd1a962f02dbd784db3f1128c","_id":"@goodtok/sdk@0.0.5","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.3.0/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-3N7wZahfp/f3t4sM+mn7weJnYDAo6WYagR6lyWlZNvpSyrSTCXkJnzYluqzDZy7h9BMZ21u1SdNCY2GuXmJEzQ==","shasum":"020257847d2bd1b14bc4a94c27c449f63740caec","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.5.tgz","fileCount":35,"unpackedSize":111597,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfwALWer6dUVJFIKarXWPkKgPRfRSMrEZwAvor89gpmwIgFjoXbWodRt8rPL7UTdGzMT6D5zrrhVCEasffM/z+Cd0="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.5_1698107589222_0.21427563120252402"},"_hasShrinkwrap":false},"0.0.6":{"name":"@goodtok/sdk","version":"0.0.6","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.6","@goodtok/common":"^0.0.6","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^3.1.2","ws":"^8.14.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"2b66a416a3c4d86d0a4b9bec012f711f19ac22ec","_id":"@goodtok/sdk@0.0.6","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.3.0/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-xQ/TqLcMuO8S/qXb6eP4i9Hcrwzf+f++yyBLdXmvt5DJ0c92uESJuGHVaRG33TOhC2SvP0H1arKDR+Ga9LzkQw==","shasum":"a6441c134ba34c4e9c541ccaae263c34923b34d4","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.6.tgz","fileCount":35,"unpackedSize":111597,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGyZ9kjaVrAO731osucqPmPEbCGKGzaH+lHb8asvH1j3AiAjHTWIrPCXgXnjpYLrAJgNV+2Loft3NcsbNLxtSdCSEw=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.6_1698114114459_0.7268771497065503"},"_hasShrinkwrap":false},"0.0.7":{"name":"@goodtok/sdk","version":"0.0.7","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.7","@goodtok/common":"^0.0.7","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^3.1.2","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"8e0c3f696e7b122bbbeaff485f916e216d110dc9","_id":"@goodtok/sdk@0.0.7","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.3.0/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-JlYtkm7T0crTs6AFUE4YCvI00+ulY8MoF5ACYi0BHhDp4fMV2Mu/qolqCttbratosmTAG2Yx7X/FjNXS4Tp1zg==","shasum":"dc7dbba1c0e94d3a5ef3dcf63b669a4dbee0e157","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.7.tgz","fileCount":35,"unpackedSize":118215,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBIK0uhCCxkNNHUiNbsmcCf9eFmgM5P4yVVAqlrb1uEAiA7tzl8VrMHF17fUDcTe553xcSE+TFFenpzNCT7NYn8ow=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.7_1698184737621_0.0375745493241213"},"_hasShrinkwrap":false},"0.0.8":{"name":"@goodtok/sdk","version":"0.0.8","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.8","@goodtok/common":"^0.0.8","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^3.1.2","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"10ddd5caf69b2336aa61ea5ed10e941d79d10694","_id":"@goodtok/sdk@0.0.8","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.3.0/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-uumRiXYRAGusb9LRLNCqxKQlcGLfCacU2oXY2jXgDI/y8T2vf7b9ZgCoggDWk1PLhLV2iFiKM4U9ji2wGZvXWA==","shasum":"e6d6077f03cce07652b701972fb0858c24c05a19","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.8.tgz","fileCount":35,"unpackedSize":118210,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClc7fK5hgKZ+ysI0BLoJ7coj2pylh3vKhn3B7nBBVVRgIgNan87BOJyf49SW4K8Y6nETVaRHvsAA2N2J1GsFuHpfs="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.8_1698190863041_0.018799119143586784"},"_hasShrinkwrap":false},"0.0.9":{"name":"@goodtok/sdk","version":"0.0.9","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.9","@goodtok/common":"^0.0.9","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^3.1.2","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"7568f38112d95dcdd886e565bc5fac9c7b3e9b05","_id":"@goodtok/sdk@0.0.9","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.3.0/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-HKqTCj39ehR0cH1GEfrsQzIzM4NVo1N/fChptXvOApxWnSjViZ2WVu0W9KDLBStm7m29epqnSXgfyCnI/N1z5g==","shasum":"bfecfa4dfa7f1cc4bf2bab879fc4501ae921422c","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.9.tgz","fileCount":35,"unpackedSize":118210,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjUCy8KrInWcldtiZvJ0JqilpfskCwIh0aCVAayYL5gAIhAIwumEpMtUXeTwtRuurBrwuuKbfEYOHXd64swMJ/Bl8U"}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.9_1698191960664_0.9968362867091081"},"_hasShrinkwrap":false},"0.0.10":{"name":"@goodtok/sdk","version":"0.0.10","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.10","@goodtok/common":"^0.0.10","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^3.1.2","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"67f4b65c937d5ffb5dbdefbfa04e2108c52c7ad6","_id":"@goodtok/sdk@0.0.10","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.3.0/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-Jfb9WpvSPC1jVo7lfWv1ct4cEuRPPF3CZpAvPDf1Y9BfFUacpNLaCOpZ8OwMwn7JhOlxOkiejdLKZIufF3rVeQ==","shasum":"b4bc79fdf899cdbb81c4baec370f56bfe7c54d8e","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.10.tgz","fileCount":35,"unpackedSize":118213,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC37OJaQ04af2Li/CN/LI9n0VM13jeNHgINumdSO/6blAIgPytAIKTj/onTZ0z0oT0cpxUSeLptFiUtvGh6zYEiaBE="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.10_1698192512935_0.13213312231273422"},"_hasShrinkwrap":false},"0.0.11":{"name":"@goodtok/sdk","version":"0.0.11","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.11","@goodtok/common":"^0.0.11","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^3.1.2","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"687e5f1c3c2027d497a8a07c2e75057293e29dec","_id":"@goodtok/sdk@0.0.11","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.3.0/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-KCGH5ErU1BGf9Q2rHqDBPc2HfoNF+9N5QprSdowKAX1oK12kegvA/1mfNIfCrmzAjq+s1dtMmPCBI+LvAY4XJg==","shasum":"d29290a25d66cbebea0f2767d895d490d9934ffb","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.11.tgz","fileCount":35,"unpackedSize":118213,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTD2lRiBTjCs2Q0r2MDI7QELhK64MsLWDz5FYLzCBTmAiEA6s65uA6/DT5SpPe9W5Sr2qxD7Knl4e0JKVBD3tuS1YY="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.11_1698456488071_0.4225016708411815"},"_hasShrinkwrap":false},"0.0.12":{"name":"@goodtok/sdk","version":"0.0.12","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.12","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"b98416d214ecd65d4a7775070f24c1efffe15299","readme":"sdk\n=================\n\nSDK for Goodtok Server\n\n[![goodtok](https://img.shields.io/badge/goodtok-sdk-brightgreen.svg)](https://goodtok.io)\n[![Version](https://img.shields.io/npm/v/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![Downloads/week](https://img.shields.io/npm/dw/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![License](https://img.shields.io/npm/l/@goodtok/sdk.svg)](https://github.com/fonoster/goodtok/blob/main/package.json)\n\n* [Installation](#installation)\n* [APIs](#apis)\n\n# Installation\n\n```sh-session\n$ npm install --save @goodtok/sdk\n```\n\n# APIs\n\n* [`Customers`](#Customers)\n* [`Users`](#Users)\n* [`Workspaces`](#Workspaces)\n* [`Tokens`](#Tokens)\n\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Customers capability to retrieve and manage customers.\nEnsure the Goodtok API Server is running for the Customers API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Customers API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getCustomer() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const customers = new SDK.Customers(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const customer = await customers.getCustomerById(id);\n\n  console.log(customer);\n}\n\ngetCustomer().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Queues capability to retrieve and manage queues.\nEnsure the Goodtok API Server is running for the Queues API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Queues API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaceId = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\n  const queues = new SDK.Queues(client);\n  const queue = await workspaces.getQueueByWorkspaceId(workspaceId);\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Tokens capability to create and verify JWT tokens.\nEnsure the Goodtok API Server is running for the Tokens API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Tokens API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function createAnonymousToken() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const tokens = new SDK.Tokens(client);\n  const request = {\n    ref: \"myref\",\n    aor: \"anonymous@sip.goodtok.io\",\n    aorLink: \"anonymous@sip.goodtok.io\",\n  };\n\n  const connectionObject = await tokens.createAnonymousToken(request);\n  console.log(connectionObject);\n}\n\ncreateAnonymousToken().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Users capability to retrieve and manage users.\nEnsure the Goodtok API Server is running for the Users API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Users API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getUser() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const users = new SDK.Users(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const user = await users.getUserById(id);\n\n  console.log(user);\n}\n\ngetUser().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Workspaces capability to retrieve and manage workspaces.\nEnsure the Goodtok API Server is running for the Workspaces API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Workspaces API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaces = new SDK.Workspaces(client);\n  const workspace = await workspaces.getDefaultWorkspace();\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n\n","readmeFilename":"README.md","_id":"@goodtok/sdk@0.0.12","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-3gfKXYdqFO5quMk1cwWcg7rRc9tvI190J3ON6f+Oq3nEqUfowf0+bEP3j/Dq6iUqK3f9UX7uDZDlGHTzI0uPFw==","shasum":"6026a1172b32e1e9839e1aa695e9e8fbc0554aa1","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.12.tgz","fileCount":49,"unpackedSize":302658,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBl3FNXURtUVvNxSbd4tb1kNEW/ju+HzyiiSAfoVhmHQIgGZT6XXwVi8wfXwDqX34d6avLvZ0/qocG9p9HF41YzgI="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.12_1699842464128_0.8045547447360277"},"_hasShrinkwrap":false},"0.0.13":{"name":"@goodtok/sdk","version":"0.0.13","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.13","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"76654b96bbd072bef3371013bcf1fffd89f07d79","readme":"sdk\n=================\n\nSDK for Goodtok Server\n\n[![goodtok](https://img.shields.io/badge/goodtok-sdk-brightgreen.svg)](https://goodtok.io)\n[![Version](https://img.shields.io/npm/v/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![Downloads/week](https://img.shields.io/npm/dw/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![License](https://img.shields.io/npm/l/@goodtok/sdk.svg)](https://github.com/fonoster/goodtok/blob/main/package.json)\n\n* [Installation](#installation)\n* [APIs](#apis)\n\n# Installation\n\n```sh-session\n$ npm install --save @goodtok/sdk\n```\n\n# APIs\n\n* [`Customers`](#Customers)\n* [`Users`](#Users)\n* [`Workspaces`](#Workspaces)\n* [`Tokens`](#Tokens)\n\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Customers capability to retrieve and manage customers.\nEnsure the Goodtok API Server is running for the Customers API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Customers API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getCustomer() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const customers = new SDK.Customers(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const customer = await customers.getCustomerById(id);\n\n  console.log(customer);\n}\n\ngetCustomer().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Queues capability to retrieve and manage queues.\nEnsure the Goodtok API Server is running for the Queues API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Queues API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaceId = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\n  const queues = new SDK.Queues(client);\n  const queue = await workspaces.getQueueByWorkspaceId(workspaceId);\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Tokens capability to create and verify JWT tokens.\nEnsure the Goodtok API Server is running for the Tokens API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Tokens API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function createAnonymousToken() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const tokens = new SDK.Tokens(client);\n  const request = {\n    ref: \"myref\",\n    aor: \"anonymous@sip.goodtok.io\",\n    aorLink: \"anonymous@sip.goodtok.io\",\n  };\n\n  const connectionObject = await tokens.createAnonymousToken(request);\n  console.log(connectionObject);\n}\n\ncreateAnonymousToken().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Users capability to retrieve and manage users.\nEnsure the Goodtok API Server is running for the Users API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Users API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getUser() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const users = new SDK.Users(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const user = await users.getUserById(id);\n\n  console.log(user);\n}\n\ngetUser().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Workspaces capability to retrieve and manage workspaces.\nEnsure the Goodtok API Server is running for the Workspaces API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Workspaces API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaces = new SDK.Workspaces(client);\n  const workspace = await workspaces.getDefaultWorkspace();\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n\n","readmeFilename":"README.md","_id":"@goodtok/sdk@0.0.13","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-1a5d0fdyPn8hq22XoXXwwMtuOLfUSrKOsHaYhsQlM+Zt8G4WZFi99kpdKps5z/iqKmfQ4wy6vhxERNvjYlKM/g==","shasum":"4889e95e1c835aa10a7c722c4c5e5e7857745ab2","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.13.tgz","fileCount":49,"unpackedSize":302658,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHdlM1GmRRYYgmx8LEjoVBNu0agX70fd/BD17C3eoajNAiA4AyhHNJLIX3NUwoEnmEBxnZxIu6+2x+3CN5vV9fs9tQ=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.13_1699902145080_0.5814071607754656"},"_hasShrinkwrap":false},"0.0.14":{"name":"@goodtok/sdk","version":"0.0.14","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","generate:readme":"node ../../.scripts/gen-readme.js"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.14","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"6b5051a0fa6ea9c576771cb1577f65d71999bb15","readme":"sdk\n=================\n\nSDK for Goodtok Server\n\n[![goodtok](https://img.shields.io/badge/goodtok-sdk-brightgreen.svg)](https://goodtok.io)\n[![Version](https://img.shields.io/npm/v/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![Downloads/week](https://img.shields.io/npm/dw/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![License](https://img.shields.io/npm/l/@goodtok/sdk.svg)](https://github.com/fonoster/goodtok/blob/main/package.json)\n\n* [Installation](#installation)\n* [APIs](#apis)\n\n# Installation\n\n```sh-session\n$ npm install --save @goodtok/sdk\n```\n\n# APIs\n\n* [`Customers`](#Customers)\n* [`Users`](#Users)\n* [`Workspaces`](#Workspaces)\n* [`Tokens`](#Tokens)\n\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Customers capability to retrieve and manage customers.\nEnsure the Goodtok API Server is running for the Customers API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Customers API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getCustomer() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const customers = new SDK.Customers(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const customer = await customers.getCustomerById(id);\n\n  console.log(customer);\n}\n\ngetCustomer().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Queues capability to retrieve and manage queues.\nEnsure the Goodtok API Server is running for the Queues API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Queues API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaceId = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\n  const queues = new SDK.Queues(client);\n  const queue = await workspaces.getQueueByWorkspaceId(workspaceId);\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Tokens capability to create and verify JWT tokens.\nEnsure the Goodtok API Server is running for the Tokens API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Tokens API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function createAnonymousToken() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const tokens = new SDK.Tokens(client);\n  const request = {\n    ref: \"myref\",\n    aor: \"anonymous@sip.goodtok.io\",\n    aorLink: \"anonymous@sip.goodtok.io\",\n  };\n\n  const connectionObject = await tokens.createAnonymousToken(request);\n  console.log(connectionObject);\n}\n\ncreateAnonymousToken().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Users capability to retrieve and manage users.\nEnsure the Goodtok API Server is running for the Users API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Users API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getUser() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const users = new SDK.Users(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const user = await users.getUserById(id);\n\n  console.log(user);\n}\n\ngetUser().catch(console.error);\n```\n\n<a name=\"module.exports\"></a>\n\n## module.exports ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Workspaces capability to retrieve and manage workspaces.\nEnsure the Goodtok API Server is running for the Workspaces API to function.\n\n**Kind**: static class of <code>module</code>  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n<a name=\"new_module.exports_new\"></a>\n\n### new module.exports(client)\nConstructs a new Workspaces API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaces = new SDK.Workspaces(client);\n  const workspace = await workspaces.getDefaultWorkspace();\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n\n","readmeFilename":"README.md","_id":"@goodtok/sdk@0.0.14","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-qFE1j46eLUIqJemX+C77pIDHVM2rHVMKNtlDzN4O0D1x6QIJDgyelrJy2DffO5mY11t+xBH0EwDTUe0rfYKXyA==","shasum":"f98ea27c7a2863bb2be2ed52b64b3b90825b777f","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.14.tgz","fileCount":49,"unpackedSize":302658,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMi0rovYW4yY+rQSCN+9Z+fPPegS7VdYANX0EfohZDMAiB3H6bZ5wloijajCkYYYZ/sb3SLjuiWk3z/9nC13oKd/w=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.14_1699921341562_0.19080324203234533"},"_hasShrinkwrap":false},"0.0.15":{"name":"@goodtok/sdk","version":"0.0.15","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.0.15","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"cb3e89fd3a2a129cfe44dc711a51012d097fbc66","_id":"@goodtok/sdk@0.0.15","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-U9TzId0ub2+IBAbeO4mbW/717KMXyGLo8TJKKu73sPmemxfPGIv2ndLeAVXIFIMa6hByJzyjBzd0eM0D6FruZw==","shasum":"3aedd6a06c3b5909f3b0b0790493199272af60d4","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.0.15.tgz","fileCount":49,"unpackedSize":324899,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0Ch5rCTB+MzXcVsiQlJb9HVtT2WY/IKox8Zqi7pwBPAIgXxDLDojCO3OuoibznthCZuaeSV0hN5M9ut0nkL9cqBM="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.15_1699988428066_0.6966251110070061"},"_hasShrinkwrap":false},"0.1.0":{"name":"@goodtok/sdk","version":"0.1.0","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.0","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"e9f150ff058aad6a29c9fb38cf32c38aa7844c8c","_id":"@goodtok/sdk@0.1.0","_nodeVersion":"18.17.1","_npmVersion":"lerna/7.4.2/node@v18.17.1+arm64 (darwin)","dist":{"integrity":"sha512-PbFHrWyPtlDMGJYJnVID0A5UXZtdwP2V0/9LFrB5HBlsf/sNej4Mo1SArSgpzsqTnJjQ1xr0Ky4aV2PuWTqP0g==","shasum":"333d689dc33bd185a4ccc4f690f36dfbc7bf0b60","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.0.tgz","fileCount":49,"unpackedSize":303500,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBQIE6ynjcDAYOk6Sko7wzzvlvTNsjDu3vBzP2moZAOAiEAhSInbXTpaqc6eq3yr72OQr6QwmZrWV5BCtdnz6IUJ04="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.0_1700068033487_0.11565619163360363"},"_hasShrinkwrap":false},"0.1.1":{"name":"@goodtok/sdk","version":"0.1.1","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist tsconfig.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules tsconfig.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.1","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"4c58a4ffe4dce045b6f18dd62b88e1694f829c8a","_id":"@goodtok/sdk@0.1.1","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-4i0XQB7L5nUTMROdPWhdfB06M7BLVs+/MAKWCpSVkJS1UzvwaRC9RsmEFbKx/w0sgA8vYqzWO8luXx2bvVZWGw==","shasum":"c656f9577388a14ff768c332553a233e8b39022b","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.1.tgz","fileCount":49,"unpackedSize":327001,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1znWJwbwt0zC/Yur4ibTYxavXGJQIdHl+UhmnqgikPgIgA9b25rQiIffsTUSh/ncRJYvpOs+NsboYYs1/i4UDq5I="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.1_1700352821798_0.45457123910763064"},"_hasShrinkwrap":false},"0.1.2":{"name":"@goodtok/sdk","version":"0.1.2","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.2","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"dd8c0fdd70a559320ff5f978d486a36567f6df62","_id":"@goodtok/sdk@0.1.2","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-Nl59Aw106CyyPrvKKOT68ALy0Wj8dhPjQ50gYmnecgp08Q4siYUugwPEEyYwHNSDZCwOkKu1YpAyzVxXzxtamQ==","shasum":"1d1ed7c3577aa517e32c1fe070b9d8caf6ef5a1f","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.2.tgz","fileCount":49,"unpackedSize":326883,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDb/kt9quV8heEnFSJLmZj3hmbAYuaBEBnv/RIgekJFaQIgAtxFzRxxzUZ4XDv2PcfaLU3fDyH+8E2eX7IfH7elMH8="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.2_1700442253559_0.43520324802839383"},"_hasShrinkwrap":false},"0.1.4":{"name":"@goodtok/sdk","version":"0.1.4","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.4","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"1c18c71e910ab69b91269fc6917ec0eb09a98b3d","_id":"@goodtok/sdk@0.1.4","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-QdhZMX70JvUnQm3mD7NXpLTTDsNko01b8mM/usfoZIHUFjgXujxScOl5g8YCynuFGckwdGc+R+/Pa1uoNmaHmg==","shasum":"9586c991ab1a803f642bcac26bc49e50793f40b9","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.4.tgz","fileCount":49,"unpackedSize":326186,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDa8JvLvdSbxj5abj+zWftHx/DYlO8gi3NHFSFGLJo3OwIgbxTGNAYZadQFUaniuvz4BhB0pajAMRfGNFpbdRGLz24="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.4_1700788823477_0.11605541396002872"},"_hasShrinkwrap":false},"0.1.5":{"name":"@goodtok/sdk","version":"0.1.5","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.5","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"c088ddba2e6beeb9b4d287d65ca05d5507bd5897","_id":"@goodtok/sdk@0.1.5","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-udKrbejDawIcDU949l4FBlJ9zG3fhlvv7j/G9eYYeFffbrydTVs4PpgmybiJSLbAhEMr9e8MioUfzKlek24GoQ==","shasum":"1844afd90abdc7477f760970b59eb76fe7307fcd","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.5.tgz","fileCount":49,"unpackedSize":326432,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFz/OaRDR75vwNYzmMfuzOt15+9DWu6swjKDQ5oaPU15AiBWZxf55ge0ZPaENy1+LnpGBmwch7e6W5ImIoJxAb/S1Q=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.5_1700932970816_0.7489693434952562"},"_hasShrinkwrap":false},"0.1.6":{"name":"@goodtok/sdk","version":"0.1.6","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.5","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"08bc8527d6cc9bfdd0e14ec75d722b06cd69cc52","_id":"@goodtok/sdk@0.1.6","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-LY8FBiZiih6rm7mHC3HZpAE3VoFvvZCj092bQZR0xDiq8Kpbl31hQcY4Ng3mpk6e8nT3xe4URYw5tRIyvRlCNQ==","shasum":"b56d9e5283aa93e71a21f5618c22d3d1b31303b5","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.6.tgz","fileCount":49,"unpackedSize":326432,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBtG5tOkhvK+94woTpOTFhR7J6RnGOUAj3346mmMH2RQIgP7OF2uufZIpQXFaSk2pCV3sHv+KiHTSM1m1u5AU1lqQ="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.6_1700938913015_0.1916903175156679"},"_hasShrinkwrap":false},"0.1.8":{"name":"@goodtok/sdk","version":"0.1.8","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.8","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"394a80e884a2d92b67e49a096951115c3f8605e6","_id":"@goodtok/sdk@0.1.8","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-gwJcW7BLx563rDhNcd0N2TrkhN+xjM6FmaHku+f2pISJ+z40QAzhaev8TgL7jDU0R6KuIJcvng0JJ6A+WCCXVw==","shasum":"897ee225ec2a124cf1590ab83dbabbf1beef3c4a","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.8.tgz","fileCount":49,"unpackedSize":326432,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCt4Z0iBqD2FbDHQxM9TLI5sbHRF98lBeYe6g7xdFQu4gIgEzlyh/gBkT167IQbhFppePBboITqcZi8bAQW8+Jahbo="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.8_1700952450157_0.24248377516264386"},"_hasShrinkwrap":false},"0.1.10":{"name":"@goodtok/sdk","version":"0.1.10","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.10","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"ba4750d4e4a873dc487b4367fdc96b87c25eb108","readme":"sdk\n=================\n\nSDK for Goodtok Server\n\n[![goodtok](https://img.shields.io/badge/goodtok-sdk-brightgreen.svg)](https://goodtok.io)\n[![Version](https://img.shields.io/npm/v/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![Downloads/week](https://img.shields.io/npm/dw/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![License](https://img.shields.io/npm/l/@goodtok/sdk.svg)](https://github.com/fonoster/goodtok/blob/main/package.json)\n\n* [Installation](#installation)\n* [APIs](#apis)\n\n# Installation\n\n```sh-session\n$ npm install --save @goodtok/sdk\n```\n\n# APIs\n\n* [`Customers`](#Customers)\n* [`Users`](#Users)\n* [`Workspaces`](#Workspaces)\n* [`Tokens`](#Tokens)\n\n\n<a name=\"Customers\"></a>\n\n## Customers ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Customers capability to retrieve and manage customers.\nEnsure the Goodtok API Server is running for the Customers API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Customers](#Customers) ⇐ <code>AbstractBaseClient</code>\n    * [new Customers(client)](#new_Customers_new)\n    * [.getCustomerById(request)](#Customers+getCustomerById) ⇒ <code>Promise.&lt;Customer&gt;</code>\n    * [.getOrdersByCustomerId(request)](#Customers+getOrdersByCustomerId) ⇒ <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code>\n    * [.getCustomerInDefaultWorkspace(id)](#Customers+getCustomerInDefaultWorkspace) ⇒ <code>Promise.&lt;Customer&gt;</code>\n\n<a name=\"new_Customers_new\"></a>\n\n### new Customers(client)\nConstructs a new Customers API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getCustomer() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const customers = new SDK.Customers(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const customer = await customers.getCustomerById(id);\n\n  console.log(customer);\n}\n\ngetCustomer().catch(console.error);\n```\n<a name=\"Customers+getCustomerById\"></a>\n\n### customers.getCustomerById(request) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer for a workspace by customer ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>GetCustomerRequest</code> | Request object containing the customer ID and workspace ID |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"452b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b\",\n  customerId: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\"\n};\n\ncustomers.getCustomer(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Customers+getOrdersByCustomerId\"></a>\n\n### customers.getOrdersByCustomerId(request) ⇒ <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code>\nRetrieves a list of orders for a customer by customer ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code> - A promise resolving to the list of orders  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>GetOrdersByCustomerIdRequest</code> | Request object containing the customer ID and workspace ID |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"452b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b\",\n  customerId: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\"\n};\n\ncustomers.getOrdersByCustomerId(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Customers+getCustomerInDefaultWorkspace\"></a>\n\n### customers.getCustomerInDefaultWorkspace(id) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer by ID in the default workspace.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\ncustomers.getCustomerInDefaultWorkspace(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Queues\"></a>\n\n## Queues ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Queues capability to retrieve and manage queues.\nEnsure the Goodtok API Server is running for the Queues API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Queues](#Queues) ⇐ <code>AbstractBaseClient</code>\n    * [new Queues(client)](#new_Queues_new)\n    * [.getDefaultWorkspaceQueue()](#Queues+getDefaultWorkspaceQueue) ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\n    * [.getQueueByWorkspaceId(id)](#Queues+getQueueByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.watchQueue(id, callback)](#Queues+watchQueue)\n    * [.updateQueueEntryStatus(request)](#Queues+updateQueueEntryStatus) ⇒ <code>Promise.&lt;void&gt;</code>\n\n<a name=\"new_Queues_new\"></a>\n\n### new Queues(client)\nConstructs a new Queues API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaceId = \"g-7b7c46fb05\";\n\n  const queues = new SDK.Queues(client);\n  const queue = await workspaces.getQueueByWorkspaceId(workspaceId);\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Queues+getDefaultWorkspaceQueue\"></a>\n\n### queues.getDefaultWorkspaceQueue() ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\nRetrieves the queue for the default workspace.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;GetQueueResponse&gt;</code> - A promise resolving to the queue  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceQueue()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+getQueueByWorkspaceId\"></a>\n\n### queues.getQueueByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the queue for a workspace by its ID.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of queue entries  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"g-7b7c46fb05\";\n\nqueues.getQueueByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+watchQueue\"></a>\n\n### queues.watchQueue(id, callback)\nRegisters a callback for real-time updates on queue entries within a workspace.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when a queue entry updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nqueues.watchQueue(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n<a name=\"Queues+updateQueueEntryStatus\"></a>\n\n### queues.updateQueueEntryStatus(request) ⇒ <code>Promise.&lt;void&gt;</code>\nUpdates the status of a queue entry.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateQueueEntryStatusRequest</code> | The request object |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID to update the queue entry for |\n| request.status | <code>string</code> | The status to update the queue entry to |\n\n**Example**  \n```js\nconst request = {\n workspaceId: \"g-7b7c46fb05\",\n customerId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n status: \"DEQUEUED\"\n};\n\nqueues.updateQueueEntryStatus(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Tokens\"></a>\n\n## Tokens ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Tokens capability to create and verify JWT tokens.\nEnsure the Goodtok API Server is running for the Tokens API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Tokens](#Tokens) ⇐ <code>AbstractBaseClient</code>\n    * [new Tokens(client)](#new_Tokens_new)\n    * [.createAnonymousToken(request)](#Tokens+createAnonymousToken) ⇒ <code>Promise.&lt;string&gt;</code>\n    * [.createToken(request)](#Tokens+createToken) ⇒ <code>Promise.&lt;string&gt;</code>\n\n<a name=\"new_Tokens_new\"></a>\n\n### new Tokens(client)\nConstructs a new Tokens API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function createAnonymousToken() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const tokens = new SDK.Tokens(client);\n  const request = {\n    ref: \"myref\",\n    aor: \"anonymous@sip.goodtok.io\",\n    aorLink: \"anonymous@sip.goodtok.io\",\n  };\n\n  const connectionObject = await tokens.createAnonymousToken(request);\n  console.log(connectionObject);\n}\n\ncreateAnonymousToken().catch(console.error);\n```\n<a name=\"Tokens+createAnonymousToken\"></a>\n\n### tokens.createAnonymousToken(request) ⇒ <code>Promise.&lt;string&gt;</code>\nCreates a new anonymous token with `allowedMethods=[REGISTER]` permissions.\nDoes not require authentication. The token will be issued only if the workspace has the `anonymous` feature enabled.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;string&gt;</code> - A promise resolving to the token  \n**Throws**:\n\n- Will throw an error if the workspace does not have the `anonymous` feature enabled\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateAnonymousTokenInput</code> | A request with claims required to create a token |\n| request.ref | <code>string</code> | A reference for the anonymous user |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.metadata | <code>string</code> | Custom metadata to be included in the token |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  workspaceId: \"g-1234567890\",\n  metadata: {\n   customField: \"customValue\"\n  }\n}\n\ntokens.createAnonymousToken(request)\n  .then(console.log)\n  .catch(console.error) // handle any errors\n```\n<a name=\"Tokens+createToken\"></a>\n\n### tokens.createToken(request) ⇒ <code>Promise.&lt;string&gt;</code>\nCreates a new token with the specified permissions.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;string&gt;</code> - A promise resolving to the token  \n**Throws**:\n\n- Will throw an error if the user is not logged in\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateTokenInput</code> | A request with claims required to create the token |\n| request.ref | <code>string</code> | A reference for the user |\n| request.aor | <code>string</code> | The address of record (AOR) for the user |\n| request.aorLink | <code>string</code> | The address of record (AOR) for the user |\n| request.allowedMethods | <code>Array.&lt;string&gt;</code> | The list of methods the token is permitted to use (e.g. [\"INVITE\", \"REGISTER\"]) |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  aor: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d@sip.goodtok.io\",\n  aorLink: \"anonymous@sip.goodtok.io\",\n  allowedMethods: [\"INVITE\"],\n};\n\ntokens.createToken(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Users\"></a>\n\n## Users ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Users capability to retrieve and manage users.\nEnsure the Goodtok API Server is running for the Users API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Users](#Users) ⇐ <code>AbstractBaseClient</code>\n    * [new Users(client)](#new_Users_new)\n    * [.getCurrentUser()](#Users+getCurrentUser) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.getUserById(id)](#Users+getUserById) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.updateUser(request)](#Users+updateUser) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\n\n<a name=\"new_Users_new\"></a>\n\n### new Users(client)\nConstructs a new Users API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getUser() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const users = new SDK.Users(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const user = await users.getUserById(id);\n\n  console.log(user);\n}\n\ngetUser().catch(console.error);\n```\n<a name=\"Users+getCurrentUser\"></a>\n\n### users.getCurrentUser() ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves the logged-in user.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if user is not logged in or the JWT token has expired\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getCurrentUser(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+getUserById\"></a>\n\n### users.getUserById(id) ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves a user by its ID. The calling user must have an admin role to retrieve other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if the user is not found\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The user ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getUserById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+updateUser\"></a>\n\n### users.updateUser(request) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\nUpdates a user's details. The calling user must have an admin role to update other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;UpdateUserResponse&gt;</code> - A promise resolving to the updated user's details  \n**Throws**:\n\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateUserRequest</code> | A request object containing the user ID and update data |\n| request.name | <code>string</code> | Optional parameter to update the user's name |\n| request.password | <code>string</code> | Optional parameter to update the user's password |\n| request.avatar | <code>string</code> | Optional parameter to update the user's avatar |\n\n**Example**  \n```js\nconst request = {\n  name: \"John Doe\",\n  password: \"mysecretpassword\",\n  avatar: \"https://example.com/avatar.png\"\n};\n\nusers.updateUser(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Workspaces\"></a>\n\n## Workspaces ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Workspaces capability to retrieve and manage workspaces.\nEnsure the Goodtok API Server is running for the Workspaces API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Workspaces](#Workspaces) ⇐ <code>AbstractBaseClient</code>\n    * [new Workspaces(client)](#new_Workspaces_new)\n    * [.createWorkspace(request)](#Workspaces+createWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceId()](#Workspaces+getDefaultWorkspaceId) ⇒ <code>string</code>\n    * [.getDefaultWorkspace()](#Workspaces+getDefaultWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceMembers()](#Workspaces+getDefaultWorkspaceMembers) ⇒ <code>Promise.&lt;GetMembersResponse&gt;</code>\n    * [.getWorkspaceById(id)](#Workspaces+getWorkspaceById) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getMembersByWorkspaceId(id)](#Workspaces+getMembersByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.updateWorkspace(request)](#Workspaces+updateWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getWorkspaces()](#Workspaces+getWorkspaces) ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\n    * [.addWorkspaceMember(request)](#Workspaces+addWorkspaceMember) ⇒ <code>Promise.&lt;Member&gt;</code>\n    * [.removeWorkspaceMember(id)](#Workspaces+removeWorkspaceMember) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.removeWorkspace(id)](#Workspaces+removeWorkspace) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.resendWorkspaceMemberInvite(id)](#Workspaces+resendWorkspaceMemberInvite) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.watchWorkspaceStatus(id, callback)](#Workspaces+watchWorkspaceStatus) ⇒ <code>Unsubscribable</code>\n\n<a name=\"new_Workspaces_new\"></a>\n\n### new Workspaces(client)\nConstructs a new Workspaces API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaces = new SDK.Workspaces(client);\n  const workspace = await workspaces.getDefaultWorkspace();\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Workspaces+createWorkspace\"></a>\n\n### workspaces.createWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nCreates a new workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the created workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateWorkspaceRequest</code> | The request object containing the workspace name, timezone, and hours of operation |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    Monday: { from: \"09:00\", to: \"17:00\" },\n    Tuesday: { from: \"09:00\", to: \"17:00\" },\n    // ...\n  }\n};\n\nworkspaces.createWorkspace(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceId\"></a>\n\n### workspaces.getDefaultWorkspaceId() ⇒ <code>string</code>\nRetrieves the default workspace ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>string</code> - The default workspace ID  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceId();\n```\n<a name=\"Workspaces+getDefaultWorkspace\"></a>\n\n### workspaces.getDefaultWorkspace() ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n**Example**  \n```js\nworkspaces.getDefaultWorkspace()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceMembers\"></a>\n\n### workspaces.getDefaultWorkspaceMembers() ⇒ <code>Promise.&lt;GetMembersResponse&gt;</code>\nRetrieves the members for the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;GetMembersResponse&gt;</code> - A promise resolving to the members  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceMembers()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaceById\"></a>\n\n### workspaces.getWorkspaceById(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getWorkspaceById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getMembersByWorkspaceId\"></a>\n\n### workspaces.getMembersByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the members for a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of members  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getMembersByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+updateWorkspace\"></a>\n\n### workspaces.updateWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nUpdates the details of a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the updated workspace's details  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateWorkspaceRequest</code> | The request object containing the workspace ID and update data |\n| request.id | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  id: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    Monday: { from: \"09:00\", to: \"17:00\" },\n    Tuesday: { from: \"09:00\", to: \"17:00\" },\n    // ...\n  }\n};\n\nworkspaces.updateWorkspace(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaces\"></a>\n\n### workspaces.getWorkspaces() ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\nRetrieves all workspaces for the authenticated user.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code> - A promise resolving to an array of workspaces  \n**Example**  \n```js\nworkspaces.getWorkspaces()\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+addWorkspaceMember\"></a>\n\n### workspaces.addWorkspaceMember(request) ⇒ <code>Promise.&lt;Member&gt;</code>\nAdds a member to a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Member&gt;</code> - A promise resolving to the added member  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>AddWorkspaceMemberRequest</code> | The request object containing the workspace ID and member details |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The member name |\n| request.email | <code>string</code> | The member email |\n| request.role | <code>string</code> | The member role |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"John Doe\",\n  email: \"jhon@example.com\",\n  role: \"MEMBER\"\n};\n\nworkspaces.addWorkspaceMember(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+removeWorkspaceMember\"></a>\n\n### workspaces.removeWorkspaceMember(id) ⇒ <code>Promise.&lt;void&gt;</code>\nRemoves a member from a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The member ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.removeWorkspaceMember(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+removeWorkspace\"></a>\n\n### workspaces.removeWorkspace(id) ⇒ <code>Promise.&lt;void&gt;</code>\nRemoves a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.removeWorkspace(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+resendWorkspaceMemberInvite\"></a>\n\n### workspaces.resendWorkspaceMemberInvite(id) ⇒ <code>Promise.&lt;void&gt;</code>\nResends a workspace member invite.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The member ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.resendWorkspaceMemberInvite(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+watchWorkspaceStatus\"></a>\n\n### workspaces.watchWorkspaceStatus(id, callback) ⇒ <code>Unsubscribable</code>\nRegisters a callback for real-time updates on workspace status.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Unsubscribable</code> - An object containing the unsubscribe method  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when the workspace status updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.watchWorkspaceStatus(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n\n","readmeFilename":"README.md","_id":"@goodtok/sdk@0.1.10","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-uPH0HNgNLUCF98rn50T0WDXm8cUeXqAljpMMh4drO1r3rZjo+erMfg7zCdwavYi2iiz7Vwh7XErZMWdhFZqFbQ==","shasum":"a4217339cf024805d677a52d53119a0462f22e17","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.10.tgz","fileCount":49,"unpackedSize":326434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB1ASbijucr2LBM3FmZOpp8gJW0mjsXZDKKpK0okzdcLAiBAcGrONA2gE3iTTjUyLmae2m8zkoj9+PuUe2DPryYMgg=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.10_1701454870868_0.924838090375774"},"_hasShrinkwrap":false},"0.1.11":{"name":"@goodtok/sdk","version":"0.1.11","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.3.24","@goodtok/apiserver":"^0.1.11","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"4a041308735c135337228ce29e782b02040a5b65","_id":"@goodtok/sdk@0.1.11","_nodeVersion":"18.18.2","_npmVersion":"lerna/7.4.2/node@v18.18.2+x64 (linux)","dist":{"integrity":"sha512-12NAxTvLx3XLZ2vFuOomIQT0UwLP5brTGnRmlsY9J4jukt0Vf5WXVXtfuDMCX7qckh2U+oSxIN/buytjpfE1gQ==","shasum":"eb0423fed26010357ddbeac009c451ed3bc018a6","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.11.tgz","fileCount":49,"unpackedSize":326434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtRjWK/SrSNyhdLuD+NBNe3EmLly6CQxd1z61Ln2vIFwIhAOqfAMCNf2WhF7xw4tNZzFagnFi3Xyg+Pu9ONMmS1PqB"}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.11_1701921436043_0.3427181113589397"},"_hasShrinkwrap":false},"0.1.13":{"name":"@goodtok/sdk","version":"0.1.13","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.4.9","@goodtok/apiserver":"^0.1.13","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","Routr","SIP","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"4c2a473cffd8e2406d8ef5b953f3fd345ac18c71","_id":"@goodtok/sdk@0.1.13","_nodeVersion":"18.19.0","_npmVersion":"lerna/7.4.2/node@v18.19.0+x64 (linux)","dist":{"integrity":"sha512-thsZbtQfkXWz41Y2wNBGm6lSCTKDJ+xAUj4NMglil4VW51fMAWkHGPsvFTo0xeYs1dU00qWsrXFVGMXhW+wEGQ==","shasum":"7dcf2a60addb41a020d793811dafd9eb60ee8d7d","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.13.tgz","fileCount":49,"unpackedSize":326433,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAIui27XvOjJcyN5mXnx6C3kzNsq7rbV3JOXldPmy2x5AiBKBchQk6kZW0evDlWQd+oum4+SJxw/SzfLKgCdwToLEQ=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.13_1702342279790_0.5800552245706903"},"_hasShrinkwrap":false},"0.1.14":{"name":"@goodtok/sdk","version":"0.1.14","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.4.9","@goodtok/apiserver":"^0.1.14","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","PeerJS","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"486807538cb017ad772df7432089379da020bee5","readme":"sdk\n=================\n\nSDK for Goodtok Server\n\n[![goodtok](https://img.shields.io/badge/goodtok-sdk-brightgreen.svg)](https://goodtok.io)\n[![Version](https://img.shields.io/npm/v/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![Downloads/week](https://img.shields.io/npm/dw/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![License](https://img.shields.io/npm/l/@goodtok/sdk.svg)](https://github.com/fonoster/goodtok/blob/main/package.json)\n\n* [Installation](#installation)\n* [APIs](#apis)\n\n# Installation\n\n```sh-session\n$ npm install --save @goodtok/sdk\n```\n\n# APIs\n\n* [`Customers`](#Customers)\n* [`Users`](#Users)\n* [`Workspaces`](#Workspaces)\n* [`Tokens`](#Tokens)\n\n\n<a name=\"Customers\"></a>\n\n## Customers ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Customers capability to retrieve and manage customers.\nEnsure the Goodtok API Server is running for the Customers API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Customers](#Customers) ⇐ <code>AbstractBaseClient</code>\n    * [new Customers(client)](#new_Customers_new)\n    * [.getCustomerById(request)](#Customers+getCustomerById) ⇒ <code>Promise.&lt;Customer&gt;</code>\n    * [.getOrdersByCustomerId(request)](#Customers+getOrdersByCustomerId) ⇒ <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code>\n    * [.getCustomerInDefaultWorkspace(id)](#Customers+getCustomerInDefaultWorkspace) ⇒ <code>Promise.&lt;Customer&gt;</code>\n\n<a name=\"new_Customers_new\"></a>\n\n### new Customers(client)\nConstructs a new Customers API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getCustomer() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const customers = new SDK.Customers(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const customer = await customers.getCustomerById(id);\n\n  console.log(customer);\n}\n\ngetCustomer().catch(console.error);\n```\n<a name=\"Customers+getCustomerById\"></a>\n\n### customers.getCustomerById(request) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer for a workspace by customer ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>GetCustomerRequest</code> | Request object containing the customer ID and workspace ID |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"452b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b\",\n  customerId: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\"\n};\n\ncustomers.getCustomer(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Customers+getOrdersByCustomerId\"></a>\n\n### customers.getOrdersByCustomerId(request) ⇒ <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code>\nRetrieves a list of orders for a customer by customer ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code> - A promise resolving to the list of orders  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>GetOrdersByCustomerIdRequest</code> | Request object containing the customer ID and workspace ID |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"452b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b\",\n  customerId: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\"\n};\n\ncustomers.getOrdersByCustomerId(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Customers+getCustomerInDefaultWorkspace\"></a>\n\n### customers.getCustomerInDefaultWorkspace(id) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer by ID in the default workspace.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\ncustomers.getCustomerInDefaultWorkspace(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Queues\"></a>\n\n## Queues ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Queues capability to retrieve and manage queues.\nEnsure the Goodtok API Server is running for the Queues API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Queues](#Queues) ⇐ <code>AbstractBaseClient</code>\n    * [new Queues(client)](#new_Queues_new)\n    * [.getDefaultWorkspaceQueue()](#Queues+getDefaultWorkspaceQueue) ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\n    * [.getQueueByWorkspaceId(id)](#Queues+getQueueByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.watchQueue(id, callback)](#Queues+watchQueue)\n    * [.updateQueueEntryStatus(request)](#Queues+updateQueueEntryStatus) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.joinQueue(request)](#Queues+joinQueue) ⇒ <code>Promise.&lt;void&gt;</code>\n\n<a name=\"new_Queues_new\"></a>\n\n### new Queues(client)\nConstructs a new Queues API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaceId = \"g-7b7c46fb05\";\n\n  const queues = new SDK.Queues(client);\n  const queue = await workspaces.getQueueByWorkspaceId(workspaceId);\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Queues+getDefaultWorkspaceQueue\"></a>\n\n### queues.getDefaultWorkspaceQueue() ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\nRetrieves the queue for the default workspace.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;GetQueueResponse&gt;</code> - A promise resolving to the queue  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceQueue()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+getQueueByWorkspaceId\"></a>\n\n### queues.getQueueByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the queue for a workspace by its ID.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of queue entries  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"g-7b7c46fb05\";\n\nqueues.getQueueByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+watchQueue\"></a>\n\n### queues.watchQueue(id, callback)\nRegisters a callback for real-time updates on queue entries within a workspace.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when a queue entry updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nqueues.watchQueue(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n<a name=\"Queues+updateQueueEntryStatus\"></a>\n\n### queues.updateQueueEntryStatus(request) ⇒ <code>Promise.&lt;void&gt;</code>\nUpdates the status of a queue entry.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateQueueEntryStatusRequest</code> | The request object |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID to update the queue entry for |\n| request.status | <code>string</code> | The status to update the queue entry to |\n\n**Example**  \n```js\nconst request = {\n workspaceId: \"g-7b7c46fb05\",\n customerId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n status: \"DEQUEUED\"\n};\n\nqueues.updateQueueEntryStatus(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+joinQueue\"></a>\n\n### queues.joinQueue(request) ⇒ <code>Promise.&lt;void&gt;</code>\nAdds a customer to a queue.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>JoinQueueRequest</code> | The request object |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID to add to the queue |\n\n**Example**  \n```js\nconst request = {\n workspaceId: \"g-7b7c46fb05\",\n customerId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\"\n};\n\nqueues.joinQueue(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n\n<a name=\"Tokens\"></a>\n\n## Tokens ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Tokens capability to create and verify JWT tokens.\nEnsure the Goodtok API Server is running for the Tokens API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Tokens](#Tokens) ⇐ <code>AbstractBaseClient</code>\n    * [new Tokens(client)](#new_Tokens_new)\n    * [.createAnonymousToken(request)](#Tokens+createAnonymousToken) ⇒ <code>Promise.&lt;string&gt;</code>\n    * [.createToken(request)](#Tokens+createToken) ⇒ <code>Promise.&lt;string&gt;</code>\n\n<a name=\"new_Tokens_new\"></a>\n\n### new Tokens(client)\nConstructs a new Tokens API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function createAnonymousToken() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const tokens = new SDK.Tokens(client);\n\n  const request = {\n    ref: \"myref\",\n    workspaceId: \"g-1234567890\",\n    metadata: {\n     customField: \"customValue\"\n    }\n  }\n\n  const connectionObject = await tokens.createAnonymousToken(request);\n  console.log(connectionObject);\n}\n\ncreateAnonymousToken().catch(console.error);\n```\n<a name=\"Tokens+createAnonymousToken\"></a>\n\n### tokens.createAnonymousToken(request) ⇒ <code>Promise.&lt;string&gt;</code>\nCreates a new anonymous token for the specified workspace, and does not require authentication.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;string&gt;</code> - A promise resolving to the token  \n**Throws**:\n\n- Will throw an error if the workspace does not have the `anonymous` feature enabled\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateAnonymousTokenInput</code> | A request with claims required to create a token |\n| request.ref | <code>string</code> | A reference for the anonymous user |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.metadata | <code>string</code> | Custom metadata to be included in the token |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  workspaceId: \"g-1234567890\",\n  metadata: {\n   customField: \"customValue\"\n  }\n}\n\ntokens.createAnonymousToken(request)\n  .then(console.log)\n  .catch(console.error) // handle any errors\n```\n<a name=\"Tokens+createToken\"></a>\n\n### tokens.createToken(request) ⇒ <code>Promise.&lt;string&gt;</code>\nCreates a new token with the specified permissions.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;string&gt;</code> - A promise resolving to the token  \n**Throws**:\n\n- Will throw an error if the user is not logged in\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateTokenInput</code> | A request with claims required to create the token |\n| request.ref | <code>string</code> | A reference for the user |\n| request.peerId | <code>string</code> | The peer ID for the user |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  customerId: \"121a4579\",\n  workspaceId: \"g-1234567890\"\n};\n\ntokens.createToken(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Users\"></a>\n\n## Users ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Users capability to retrieve and manage users.\nEnsure the Goodtok API Server is running for the Users API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Users](#Users) ⇐ <code>AbstractBaseClient</code>\n    * [new Users(client)](#new_Users_new)\n    * [.getCurrentUser()](#Users+getCurrentUser) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.getUserById(id)](#Users+getUserById) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.updateUser(request)](#Users+updateUser) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\n\n<a name=\"new_Users_new\"></a>\n\n### new Users(client)\nConstructs a new Users API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getUser() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const users = new SDK.Users(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const user = await users.getUserById(id);\n\n  console.log(user);\n}\n\ngetUser().catch(console.error);\n```\n<a name=\"Users+getCurrentUser\"></a>\n\n### users.getCurrentUser() ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves the logged-in user.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if user is not logged in or the JWT token has expired\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getCurrentUser(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+getUserById\"></a>\n\n### users.getUserById(id) ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves a user by its ID. The calling user must have an admin role to retrieve other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if the user is not found\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The user ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getUserById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+updateUser\"></a>\n\n### users.updateUser(request) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\nUpdates a user's details. The calling user must have an admin role to update other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;UpdateUserResponse&gt;</code> - A promise resolving to the updated user's details  \n**Throws**:\n\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateUserRequest</code> | A request object containing the user ID and update data |\n| request.name | <code>string</code> | Optional parameter to update the user's name |\n| request.password | <code>string</code> | Optional parameter to update the user's password |\n| request.avatar | <code>string</code> | Optional parameter to update the user's avatar |\n\n**Example**  \n```js\nconst request = {\n  name: \"John Doe\",\n  password: \"mysecretpassword\",\n  avatar: \"https://example.com/avatar.png\"\n};\n\nusers.updateUser(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Workspaces\"></a>\n\n## Workspaces ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Workspaces capability to retrieve and manage workspaces.\nEnsure the Goodtok API Server is running for the Workspaces API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Workspaces](#Workspaces) ⇐ <code>AbstractBaseClient</code>\n    * [new Workspaces(client)](#new_Workspaces_new)\n    * [.createWorkspace(request)](#Workspaces+createWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceId()](#Workspaces+getDefaultWorkspaceId) ⇒ <code>string</code>\n    * [.getDefaultWorkspace()](#Workspaces+getDefaultWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceMembers()](#Workspaces+getDefaultWorkspaceMembers) ⇒ <code>Promise.&lt;GetMembersResponse&gt;</code>\n    * [.getWorkspaceById(id)](#Workspaces+getWorkspaceById) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getMembersByWorkspaceId(id)](#Workspaces+getMembersByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.updateWorkspace(request)](#Workspaces+updateWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getWorkspaces()](#Workspaces+getWorkspaces) ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\n    * [.addWorkspaceMember(request)](#Workspaces+addWorkspaceMember) ⇒ <code>Promise.&lt;Member&gt;</code>\n    * [.removeWorkspaceMember(id)](#Workspaces+removeWorkspaceMember) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.removeWorkspace(id)](#Workspaces+removeWorkspace) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.resendWorkspaceMemberInvite(id)](#Workspaces+resendWorkspaceMemberInvite) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.watchWorkspaceStatus(id, callback)](#Workspaces+watchWorkspaceStatus) ⇒ <code>Unsubscribable</code>\n\n<a name=\"new_Workspaces_new\"></a>\n\n### new Workspaces(client)\nConstructs a new Workspaces API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaces = new SDK.Workspaces(client);\n  const workspace = await workspaces.getDefaultWorkspace();\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Workspaces+createWorkspace\"></a>\n\n### workspaces.createWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nCreates a new workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the created workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateWorkspaceRequest</code> | The request object containing the workspace name, timezone, and hours of operation |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    Monday: { from: \"09:00\", to: \"17:00\" },\n    Tuesday: { from: \"09:00\", to: \"17:00\" },\n    // ...\n  }\n};\n\nworkspaces.createWorkspace(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceId\"></a>\n\n### workspaces.getDefaultWorkspaceId() ⇒ <code>string</code>\nRetrieves the default workspace ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>string</code> - The default workspace ID  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceId();\n```\n<a name=\"Workspaces+getDefaultWorkspace\"></a>\n\n### workspaces.getDefaultWorkspace() ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n**Example**  \n```js\nworkspaces.getDefaultWorkspace()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceMembers\"></a>\n\n### workspaces.getDefaultWorkspaceMembers() ⇒ <code>Promise.&lt;GetMembersResponse&gt;</code>\nRetrieves the members for the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;GetMembersResponse&gt;</code> - A promise resolving to the members  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceMembers()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaceById\"></a>\n\n### workspaces.getWorkspaceById(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getWorkspaceById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getMembersByWorkspaceId\"></a>\n\n### workspaces.getMembersByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the members for a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of members  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getMembersByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+updateWorkspace\"></a>\n\n### workspaces.updateWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nUpdates the details of a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the updated workspace's details  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateWorkspaceRequest</code> | The request object containing the workspace ID and update data |\n| request.id | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  id: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    Monday: { from: \"09:00\", to: \"17:00\" },\n    Tuesday: { from: \"09:00\", to: \"17:00\" },\n    // ...\n  }\n};\n\nworkspaces.updateWorkspace(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaces\"></a>\n\n### workspaces.getWorkspaces() ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\nRetrieves all workspaces for the authenticated user.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code> - A promise resolving to an array of workspaces  \n**Example**  \n```js\nworkspaces.getWorkspaces()\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+addWorkspaceMember\"></a>\n\n### workspaces.addWorkspaceMember(request) ⇒ <code>Promise.&lt;Member&gt;</code>\nAdds a member to a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Member&gt;</code> - A promise resolving to the added member  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>AddWorkspaceMemberRequest</code> | The request object containing the workspace ID and member details |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The member name |\n| request.email | <code>string</code> | The member email |\n| request.role | <code>string</code> | The member role |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"John Doe\",\n  email: \"jhon@example.com\",\n  role: \"MEMBER\"\n};\n\nworkspaces.addWorkspaceMember(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+removeWorkspaceMember\"></a>\n\n### workspaces.removeWorkspaceMember(id) ⇒ <code>Promise.&lt;void&gt;</code>\nRemoves a member from a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The member ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.removeWorkspaceMember(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+removeWorkspace\"></a>\n\n### workspaces.removeWorkspace(id) ⇒ <code>Promise.&lt;void&gt;</code>\nRemoves a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.removeWorkspace(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+resendWorkspaceMemberInvite\"></a>\n\n### workspaces.resendWorkspaceMemberInvite(id) ⇒ <code>Promise.&lt;void&gt;</code>\nResends a workspace member invite.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The member ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.resendWorkspaceMemberInvite(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+watchWorkspaceStatus\"></a>\n\n### workspaces.watchWorkspaceStatus(id, callback) ⇒ <code>Unsubscribable</code>\nRegisters a callback for real-time updates on workspace status.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Unsubscribable</code> - An object containing the unsubscribe method  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when the workspace status updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.watchWorkspaceStatus(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n\n","readmeFilename":"README.md","_id":"@goodtok/sdk@0.1.14","_nodeVersion":"18.19.0","_npmVersion":"lerna/7.4.2/node@v18.19.0+x64 (linux)","dist":{"integrity":"sha512-dH3OSOvcHBzHJfrnaCdSJl1I1tzjEIj00wrlrylxWKh1XzzUheU/KTxPl6bgMTA15NlN7JokPa2qgR7PLReGuA==","shasum":"2ef2a39e8a355ab5f61d1dbfeed8fdb308c8837a","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.14.tgz","fileCount":49,"unpackedSize":319892,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFvHS6szAsddLvk8TVFyXsJRqR/7h9jaK9zrvqDSW1AMAiAFVPDJJqmzG8o+DyPYlTEulyJZGVfLBJNvQL/IJUwhWQ=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.14_1703104350250_0.9895169887571507"},"_hasShrinkwrap":false},"0.1.16":{"name":"@goodtok/sdk","version":"0.1.16","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.4.9","@goodtok/apiserver":"^0.1.16","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","PeerJS","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"eeec793a40a0ed4374493a6df9a6b52de3f7cc0a","_id":"@goodtok/sdk@0.1.16","_nodeVersion":"18.17.1","_npmVersion":"lerna/7.4.2/node@v18.17.1+arm64 (darwin)","dist":{"integrity":"sha512-NdCnotFqakRkOgf8EasfIoFa1gFKLCHCFzqmNyvzIAibn6euPyAifL10MXry/TkC80MNxevfmaOhdAVUT3cL6A==","shasum":"7c1153cecd8ddef8a788238ee11e7212c9d2ac6a","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.16.tgz","fileCount":49,"unpackedSize":325489,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyQ9THYx9fFiJ46/5vJeLHdck1yZyVVvF28dnEjomgxgIgFBateN7FOcFT2kprPf1WqJo8JHHox1IRuGNByH8phRw="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.16_1703300137902_0.9354719386253454"},"_hasShrinkwrap":false},"0.1.17":{"name":"@goodtok/sdk","version":"0.1.17","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.4.9","@goodtok/apiserver":"^0.1.17","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","PeerJS","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"ec538bf2f236dfc22d52490763999681bffe5103","_id":"@goodtok/sdk@0.1.17","_nodeVersion":"18.17.1","_npmVersion":"lerna/7.4.2/node@v18.17.1+arm64 (darwin)","dist":{"integrity":"sha512-yaIoYhS0+a0Kugbq6wQggE03vIbFp0ElzrTXOAdpgM1PYXzb4Nh36lDbFvHJppuIVtLrHqH+vjpqqSfx/DAhhA==","shasum":"0c30af096bdc047bf3cfe1cafd415a9349f91542","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.17.tgz","fileCount":49,"unpackedSize":325489,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAqXOcHRFaih3RwsuMVF2HZ/XL4gISbuwlkm6TUiiPoUAiBjxcLRKj9Q14uddF2E/EHZt/B0VvC86PyqFV96/BjUJQ=="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.17_1703300291788_0.005112124562323794"},"_hasShrinkwrap":false},"0.1.18":{"name":"@goodtok/sdk","version":"0.1.18","description":"SDK for Goodtok","author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"homepage":"https://github.com/fonoster/goodtok#readme","license":"MIT","main":"dist/index","types":"dist/index","directories":{"src":"src","test":"test"},"scripts":{"prebuild":"rimraf ./dist *.tsbuildinfo","build":"tsc -b tsconfig.json","clean":"rimraf ./dist node_modules *.tsbuildinfo","pregenerate:readme":"tsc -b tsconfig.docs.json","generate:readme":"node ../../.scripts/gen-readme.js","postgenerate:readme":"npm run build"},"dependencies":{"@fonoster/logger":"0.4.9","@goodtok/apiserver":"^0.1.18","@trpc/client":"^10.38.5","@trpc/server":"^10.38.5","buffer":"^6.0.3","isomorphic-ws":"^5.0.0","jwt-decode":"^4.0.0","ws":"^8.14.2"},"keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","PeerJS","Contact Center"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"gitHead":"99693b211c9e6339785b1c6c9925f74a587146d0","readme":"sdk\n=================\n\nSDK for Goodtok Server\n\n[![goodtok](https://img.shields.io/badge/goodtok-sdk-brightgreen.svg)](https://goodtok.io)\n[![Version](https://img.shields.io/npm/v/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![Downloads/week](https://img.shields.io/npm/dw/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![License](https://img.shields.io/npm/l/@goodtok/sdk.svg)](https://github.com/fonoster/goodtok/blob/main/package.json)\n\n* [Installation](#installation)\n* [APIs](#apis)\n\n# Installation\n\n```sh-session\n$ npm install --save @goodtok/sdk\n```\n\n# APIs\n\n* [`Customers`](#Customers)\n* [`Users`](#Users)\n* [`Workspaces`](#Workspaces)\n* [`Tokens`](#Tokens)\n\n\n<a name=\"Customers\"></a>\n\n## Customers ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Customers capability to retrieve and manage customers.\nEnsure the Goodtok API Server is running for the Customers API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Customers](#Customers) ⇐ <code>AbstractBaseClient</code>\n    * [new Customers(client)](#new_Customers_new)\n    * [.getCustomerById(request)](#Customers+getCustomerById) ⇒ <code>Promise.&lt;Customer&gt;</code>\n    * [.getOrdersByCustomerId(request)](#Customers+getOrdersByCustomerId) ⇒ <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code>\n    * [.getCustomerInDefaultWorkspace(id)](#Customers+getCustomerInDefaultWorkspace) ⇒ <code>Promise.&lt;Customer&gt;</code>\n\n<a name=\"new_Customers_new\"></a>\n\n### new Customers(client)\nConstructs a new Customers API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getCustomer() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const customers = new SDK.Customers(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const customer = await customers.getCustomerById(id);\n\n  console.log(customer);\n}\n\ngetCustomer().catch(console.error);\n```\n<a name=\"Customers+getCustomerById\"></a>\n\n### customers.getCustomerById(request) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer for a workspace by customer ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>GetCustomerRequest</code> | Request object containing the customer ID and workspace ID |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"452b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b\",\n  customerId: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\"\n};\n\ncustomers.getCustomer(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Customers+getOrdersByCustomerId\"></a>\n\n### customers.getOrdersByCustomerId(request) ⇒ <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code>\nRetrieves a list of orders for a customer by customer ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code> - A promise resolving to the list of orders  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>GetOrdersByCustomerIdRequest</code> | Request object containing the customer ID and workspace ID |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"452b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b\",\n  customerId: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\"\n};\n\ncustomers.getOrdersByCustomerId(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Customers+getCustomerInDefaultWorkspace\"></a>\n\n### customers.getCustomerInDefaultWorkspace(id) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer by ID in the default workspace.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\ncustomers.getCustomerInDefaultWorkspace(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Queues\"></a>\n\n## Queues ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Queues capability to retrieve and manage queues.\nEnsure the Goodtok API Server is running for the Queues API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Queues](#Queues) ⇐ <code>AbstractBaseClient</code>\n    * [new Queues(client)](#new_Queues_new)\n    * [.getDefaultWorkspaceQueue()](#Queues+getDefaultWorkspaceQueue) ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\n    * [.getQueueByWorkspaceId(id)](#Queues+getQueueByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.watchQueue(id, callback)](#Queues+watchQueue)\n    * [.updateQueueEntryStatus(request)](#Queues+updateQueueEntryStatus) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.joinQueue(request)](#Queues+joinQueue) ⇒ <code>Promise.&lt;void&gt;</code>\n\n<a name=\"new_Queues_new\"></a>\n\n### new Queues(client)\nConstructs a new Queues API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaceId = \"g-7b7c46fb05\";\n\n  const queues = new SDK.Queues(client);\n  const queue = await workspaces.getQueueByWorkspaceId(workspaceId);\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Queues+getDefaultWorkspaceQueue\"></a>\n\n### queues.getDefaultWorkspaceQueue() ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\nRetrieves the queue for the default workspace.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;GetQueueResponse&gt;</code> - A promise resolving to the queue  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceQueue()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+getQueueByWorkspaceId\"></a>\n\n### queues.getQueueByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the queue for a workspace by its ID.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of queue entries  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"g-7b7c46fb05\";\n\nqueues.getQueueByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+watchQueue\"></a>\n\n### queues.watchQueue(id, callback)\nRegisters a callback for real-time updates on queue entries within a workspace.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when a queue entry updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nqueues.watchQueue(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n<a name=\"Queues+updateQueueEntryStatus\"></a>\n\n### queues.updateQueueEntryStatus(request) ⇒ <code>Promise.&lt;void&gt;</code>\nUpdates the status of a queue entry.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateQueueEntryStatusRequest</code> | The request object |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID to update the queue entry for |\n| request.status | <code>string</code> | The status to update the queue entry to |\n\n**Example**  \n```js\nconst request = {\n workspaceId: \"g-7b7c46fb05\",\n customerId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n status: \"DEQUEUED\"\n};\n\nqueues.updateQueueEntryStatus(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+joinQueue\"></a>\n\n### queues.joinQueue(request) ⇒ <code>Promise.&lt;void&gt;</code>\nAdds a customer to a queue.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>JoinQueueRequest</code> | The request object |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID to add to the queue |\n\n**Example**  \n```js\nconst request = {\n workspaceId: \"g-7b7c46fb05\",\n customerId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\"\n};\n\nqueues.joinQueue(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n\n<a name=\"Tokens\"></a>\n\n## Tokens ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Tokens capability to create and verify JWT tokens.\nEnsure the Goodtok API Server is running for the Tokens API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Tokens](#Tokens) ⇐ <code>AbstractBaseClient</code>\n    * [new Tokens(client)](#new_Tokens_new)\n    * [.createAnonymousToken(request)](#Tokens+createAnonymousToken) ⇒ <code>Promise.&lt;string&gt;</code>\n    * [.createToken(request)](#Tokens+createToken) ⇒ <code>Promise.&lt;string&gt;</code>\n\n<a name=\"new_Tokens_new\"></a>\n\n### new Tokens(client)\nConstructs a new Tokens API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function createAnonymousToken() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const tokens = new SDK.Tokens(client);\n\n  const request = {\n    ref: \"myref\",\n    workspaceId: \"g-1234567890\",\n    metadata: {\n     customField: \"customValue\"\n    }\n  }\n\n  const connectionObject = await tokens.createAnonymousToken(request);\n  console.log(connectionObject);\n}\n\ncreateAnonymousToken().catch(console.error);\n```\n<a name=\"Tokens+createAnonymousToken\"></a>\n\n### tokens.createAnonymousToken(request) ⇒ <code>Promise.&lt;string&gt;</code>\nCreates a new anonymous token for the specified workspace, and does not require authentication.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;string&gt;</code> - A promise resolving to the token  \n**Throws**:\n\n- Will throw an error if the workspace does not have the `anonymous` feature enabled\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateAnonymousTokenInput</code> | A request with claims required to create a token |\n| request.ref | <code>string</code> | A reference for the anonymous user |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.metadata | <code>string</code> | Custom metadata to be included in the token |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  workspaceId: \"g-1234567890\",\n  metadata: {\n   customField: \"customValue\"\n  }\n}\n\ntokens.createAnonymousToken(request)\n  .then(console.log)\n  .catch(console.error) // handle any errors\n```\n<a name=\"Tokens+createToken\"></a>\n\n### tokens.createToken(request) ⇒ <code>Promise.&lt;string&gt;</code>\nCreates a new token with the specified permissions.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;string&gt;</code> - A promise resolving to the token  \n**Throws**:\n\n- Will throw an error if the user is not logged in\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateTokenInput</code> | A request with claims required to create the token |\n| request.ref | <code>string</code> | A reference for the user |\n| request.peerId | <code>string</code> | The peer ID for the user |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  customerId: \"121a4579\",\n  workspaceId: \"g-1234567890\"\n};\n\ntokens.createToken(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Users\"></a>\n\n## Users ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Users capability to retrieve and manage users.\nEnsure the Goodtok API Server is running for the Users API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Users](#Users) ⇐ <code>AbstractBaseClient</code>\n    * [new Users(client)](#new_Users_new)\n    * [.getCurrentUser()](#Users+getCurrentUser) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.getUserById(id)](#Users+getUserById) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.updateUser(request)](#Users+updateUser) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\n\n<a name=\"new_Users_new\"></a>\n\n### new Users(client)\nConstructs a new Users API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getUser() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const users = new SDK.Users(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const user = await users.getUserById(id);\n\n  console.log(user);\n}\n\ngetUser().catch(console.error);\n```\n<a name=\"Users+getCurrentUser\"></a>\n\n### users.getCurrentUser() ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves the logged-in user.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if user is not logged in or the JWT token has expired\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getCurrentUser(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+getUserById\"></a>\n\n### users.getUserById(id) ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves a user by its ID. The calling user must have an admin role to retrieve other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if the user is not found\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The user ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getUserById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+updateUser\"></a>\n\n### users.updateUser(request) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\nUpdates a user's details. The calling user must have an admin role to update other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;UpdateUserResponse&gt;</code> - A promise resolving to the updated user's details  \n**Throws**:\n\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateUserRequest</code> | A request object containing the user ID and update data |\n| request.name | <code>string</code> | Optional parameter to update the user's name |\n| request.password | <code>string</code> | Optional parameter to update the user's password |\n| request.avatar | <code>string</code> | Optional parameter to update the user's avatar |\n\n**Example**  \n```js\nconst request = {\n  name: \"John Doe\",\n  password: \"mysecretpassword\",\n  avatar: \"https://example.com/avatar.png\"\n};\n\nusers.updateUser(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Workspaces\"></a>\n\n## Workspaces ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Workspaces capability to retrieve and manage workspaces.\nEnsure the Goodtok API Server is running for the Workspaces API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Workspaces](#Workspaces) ⇐ <code>AbstractBaseClient</code>\n    * [new Workspaces(client)](#new_Workspaces_new)\n    * [.createWorkspace(request)](#Workspaces+createWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceId()](#Workspaces+getDefaultWorkspaceId) ⇒ <code>string</code>\n    * [.getDefaultWorkspace()](#Workspaces+getDefaultWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceMembers()](#Workspaces+getDefaultWorkspaceMembers) ⇒ <code>Promise.&lt;GetMembersResponse&gt;</code>\n    * [.getWorkspaceById(id)](#Workspaces+getWorkspaceById) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getMembersByWorkspaceId(id)](#Workspaces+getMembersByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.updateWorkspace(request)](#Workspaces+updateWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getWorkspaces()](#Workspaces+getWorkspaces) ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\n    * [.addWorkspaceMember(request)](#Workspaces+addWorkspaceMember) ⇒ <code>Promise.&lt;Member&gt;</code>\n    * [.removeWorkspaceMember(id)](#Workspaces+removeWorkspaceMember) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.removeWorkspace(id)](#Workspaces+removeWorkspace) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.resendWorkspaceMemberInvite(id)](#Workspaces+resendWorkspaceMemberInvite) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.watchWorkspaceStatus(id, callback)](#Workspaces+watchWorkspaceStatus) ⇒ <code>Unsubscribable</code>\n\n<a name=\"new_Workspaces_new\"></a>\n\n### new Workspaces(client)\nConstructs a new Workspaces API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaces = new SDK.Workspaces(client);\n  const workspace = await workspaces.getDefaultWorkspace();\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Workspaces+createWorkspace\"></a>\n\n### workspaces.createWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nCreates a new workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the created workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateWorkspaceRequest</code> | The request object containing the workspace name, timezone, and hours of operation |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    Monday: { from: \"09:00\", to: \"17:00\" },\n    Tuesday: { from: \"09:00\", to: \"17:00\" },\n    // ...\n  }\n};\n\nworkspaces.createWorkspace(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceId\"></a>\n\n### workspaces.getDefaultWorkspaceId() ⇒ <code>string</code>\nRetrieves the default workspace ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>string</code> - The default workspace ID  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceId();\n```\n<a name=\"Workspaces+getDefaultWorkspace\"></a>\n\n### workspaces.getDefaultWorkspace() ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n**Example**  \n```js\nworkspaces.getDefaultWorkspace()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceMembers\"></a>\n\n### workspaces.getDefaultWorkspaceMembers() ⇒ <code>Promise.&lt;GetMembersResponse&gt;</code>\nRetrieves the members for the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;GetMembersResponse&gt;</code> - A promise resolving to the members  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceMembers()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaceById\"></a>\n\n### workspaces.getWorkspaceById(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getWorkspaceById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getMembersByWorkspaceId\"></a>\n\n### workspaces.getMembersByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the members for a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of members  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getMembersByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+updateWorkspace\"></a>\n\n### workspaces.updateWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nUpdates the details of a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the updated workspace's details  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateWorkspaceRequest</code> | The request object containing the workspace ID and update data |\n| request.id | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  id: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    Monday: { from: \"09:00\", to: \"17:00\" },\n    Tuesday: { from: \"09:00\", to: \"17:00\" },\n    // ...\n  }\n};\n\nworkspaces.updateWorkspace(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaces\"></a>\n\n### workspaces.getWorkspaces() ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\nRetrieves all workspaces for the authenticated user.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code> - A promise resolving to an array of workspaces  \n**Example**  \n```js\nworkspaces.getWorkspaces()\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+addWorkspaceMember\"></a>\n\n### workspaces.addWorkspaceMember(request) ⇒ <code>Promise.&lt;Member&gt;</code>\nAdds a member to a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Member&gt;</code> - A promise resolving to the added member  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>AddWorkspaceMemberRequest</code> | The request object containing the workspace ID and member details |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The member name |\n| request.email | <code>string</code> | The member email |\n| request.role | <code>string</code> | The member role |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"John Doe\",\n  email: \"jhon@example.com\",\n  role: \"MEMBER\"\n};\n\nworkspaces.addWorkspaceMember(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+removeWorkspaceMember\"></a>\n\n### workspaces.removeWorkspaceMember(id) ⇒ <code>Promise.&lt;void&gt;</code>\nRemoves a member from a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The member ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.removeWorkspaceMember(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+removeWorkspace\"></a>\n\n### workspaces.removeWorkspace(id) ⇒ <code>Promise.&lt;void&gt;</code>\nRemoves a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.removeWorkspace(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+resendWorkspaceMemberInvite\"></a>\n\n### workspaces.resendWorkspaceMemberInvite(id) ⇒ <code>Promise.&lt;void&gt;</code>\nResends a workspace member invite.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The member ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.resendWorkspaceMemberInvite(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+watchWorkspaceStatus\"></a>\n\n### workspaces.watchWorkspaceStatus(id, callback) ⇒ <code>Unsubscribable</code>\nRegisters a callback for real-time updates on workspace status.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Unsubscribable</code> - An object containing the unsubscribe method  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when the workspace status updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.watchWorkspaceStatus(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n\n","readmeFilename":"README.md","_id":"@goodtok/sdk@0.1.18","_nodeVersion":"18.19.0","_npmVersion":"lerna/7.4.2/node@v18.19.0+x64 (linux)","dist":{"integrity":"sha512-VedeNGHTbSFkdFHvx5kAjEPULImBxnOKZKkHhh18PJi4ID1ecwyy3e1EBPHfKumYTt0RlwS/5jY/c4a8H8ZrVw==","shasum":"a668d6166a48d30baaa92ba2bdadd4d85646e2ee","tarball":"https://registry.npmjs.org/@goodtok/sdk/-/sdk-0.1.18.tgz","fileCount":49,"unpackedSize":325489,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOKAUsClMp1eXtU7hrh/i+us3zbLmy9lTV1iXmRHY6HgIgGzjVBKTHKxoo3uwEE+nKrFTV0LGLGyAdrnkO7eQpQag="}]},"_npmUser":{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.1.18_1703305125613_0.6313926929332736"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-08T14:31:01.806Z","0.0.1":"2023-10-08T14:31:02.203Z","modified":"2024-03-11T02:06:29.361Z","0.0.2":"2023-10-16T16:29:32.462Z","0.0.3":"2023-10-17T16:43:38.774Z","0.0.4":"2023-10-19T23:11:16.521Z","0.0.5":"2023-10-24T00:33:09.452Z","0.0.6":"2023-10-24T02:21:54.736Z","0.0.7":"2023-10-24T21:58:57.899Z","0.0.8":"2023-10-24T23:41:03.368Z","0.0.9":"2023-10-24T23:59:20.883Z","0.0.10":"2023-10-25T00:08:33.225Z","0.0.11":"2023-10-28T01:28:08.316Z","0.0.12":"2023-11-13T02:27:44.326Z","0.0.13":"2023-11-13T19:02:25.290Z","0.0.14":"2023-11-14T00:22:21.750Z","0.0.15":"2023-11-14T19:00:28.374Z","0.1.0":"2023-11-15T17:07:13.639Z","0.1.1":"2023-11-19T00:13:42.007Z","0.1.2":"2023-11-20T01:04:13.823Z","0.1.4":"2023-11-24T01:20:23.812Z","0.1.5":"2023-11-25T17:22:50.996Z","0.1.6":"2023-11-25T19:01:53.220Z","0.1.8":"2023-11-25T22:47:30.314Z","0.1.10":"2023-12-01T18:21:11.073Z","0.1.11":"2023-12-07T03:57:16.252Z","0.1.13":"2023-12-12T00:51:20.008Z","0.1.14":"2023-12-20T20:32:30.439Z","0.1.16":"2023-12-23T02:55:38.070Z","0.1.17":"2023-12-23T02:58:11.967Z","0.1.18":"2023-12-23T04:18:45.805Z"},"maintainers":[{"name":"fonoster-oss","email":"fonosterteam@fonoster.com"}],"description":"SDK for Goodtok","homepage":"https://github.com/fonoster/goodtok#readme","repository":{"type":"git","url":"git+https://github.com/fonoster/goodtok.git"},"author":{"name":"Pedro Sanders","email":"psanders@fonoster.com"},"bugs":{"url":"https://github.com/fonoster/goodtok/issues"},"license":"MIT","readme":"sdk\n=================\n\nSDK for Goodtok Server\n\n[![goodtok](https://img.shields.io/badge/goodtok-sdk-brightgreen.svg)](https://goodtok.io)\n[![Version](https://img.shields.io/npm/v/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![Downloads/week](https://img.shields.io/npm/dw/@goodtok/sdk.svg)](https://npmjs.org/package/@goodtok/sdk)\n[![License](https://img.shields.io/npm/l/@goodtok/sdk.svg)](https://github.com/fonoster/goodtok/blob/main/package.json)\n\n* [Installation](#installation)\n* [APIs](#apis)\n\n# Installation\n\n```sh-session\n$ npm install --save @goodtok/sdk\n```\n\n# APIs\n\n* [`Customers`](#Customers)\n* [`Users`](#Users)\n* [`Workspaces`](#Workspaces)\n* [`Tokens`](#Tokens)\n\n\n<a name=\"Customers\"></a>\n\n## Customers ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Customers capability to retrieve and manage customers.\nEnsure the Goodtok API Server is running for the Customers API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Customers](#Customers) ⇐ <code>AbstractBaseClient</code>\n    * [new Customers(client)](#new_Customers_new)\n    * [.getCustomerById(request)](#Customers+getCustomerById) ⇒ <code>Promise.&lt;Customer&gt;</code>\n    * [.getOrdersByCustomerId(request)](#Customers+getOrdersByCustomerId) ⇒ <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code>\n    * [.getCustomerInDefaultWorkspace(id)](#Customers+getCustomerInDefaultWorkspace) ⇒ <code>Promise.&lt;Customer&gt;</code>\n\n<a name=\"new_Customers_new\"></a>\n\n### new Customers(client)\nConstructs a new Customers API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getCustomer() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const customers = new SDK.Customers(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const customer = await customers.getCustomerById(id);\n\n  console.log(customer);\n}\n\ngetCustomer().catch(console.error);\n```\n<a name=\"Customers+getCustomerById\"></a>\n\n### customers.getCustomerById(request) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer for a workspace by customer ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>GetCustomerRequest</code> | Request object containing the customer ID and workspace ID |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"452b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b\",\n  customerId: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\"\n};\n\ncustomers.getCustomer(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Customers+getOrdersByCustomerId\"></a>\n\n### customers.getOrdersByCustomerId(request) ⇒ <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code>\nRetrieves a list of orders for a customer by customer ID.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Array.&lt;Order&gt;&gt;</code> - A promise resolving to the list of orders  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>GetOrdersByCustomerIdRequest</code> | Request object containing the customer ID and workspace ID |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"452b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b\",\n  customerId: \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\"\n};\n\ncustomers.getOrdersByCustomerId(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Customers+getCustomerInDefaultWorkspace\"></a>\n\n### customers.getCustomerInDefaultWorkspace(id) ⇒ <code>Promise.&lt;Customer&gt;</code>\nRetrieves a customer by ID in the default workspace.\n\n**Kind**: instance method of [<code>Customers</code>](#Customers)  \n**Returns**: <code>Promise.&lt;Customer&gt;</code> - A promise resolving to the customer  \n**Throws**:\n\n- Will throw an error if the customer is not found\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The customer ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\ncustomers.getCustomerInDefaultWorkspace(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Queues\"></a>\n\n## Queues ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Queues capability to retrieve and manage queues.\nEnsure the Goodtok API Server is running for the Queues API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Queues](#Queues) ⇐ <code>AbstractBaseClient</code>\n    * [new Queues(client)](#new_Queues_new)\n    * [.getDefaultWorkspaceQueue()](#Queues+getDefaultWorkspaceQueue) ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\n    * [.getQueueByWorkspaceId(id)](#Queues+getQueueByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.watchQueue(id, callback)](#Queues+watchQueue)\n    * [.updateQueueEntryStatus(request)](#Queues+updateQueueEntryStatus) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.joinQueue(request)](#Queues+joinQueue) ⇒ <code>Promise.&lt;void&gt;</code>\n\n<a name=\"new_Queues_new\"></a>\n\n### new Queues(client)\nConstructs a new Queues API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaceId = \"g-7b7c46fb05\";\n\n  const queues = new SDK.Queues(client);\n  const queue = await workspaces.getQueueByWorkspaceId(workspaceId);\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Queues+getDefaultWorkspaceQueue\"></a>\n\n### queues.getDefaultWorkspaceQueue() ⇒ <code>Promise.&lt;GetQueueResponse&gt;</code>\nRetrieves the queue for the default workspace.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;GetQueueResponse&gt;</code> - A promise resolving to the queue  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceQueue()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+getQueueByWorkspaceId\"></a>\n\n### queues.getQueueByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the queue for a workspace by its ID.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of queue entries  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"g-7b7c46fb05\";\n\nqueues.getQueueByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+watchQueue\"></a>\n\n### queues.watchQueue(id, callback)\nRegisters a callback for real-time updates on queue entries within a workspace.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when a queue entry updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nqueues.watchQueue(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n<a name=\"Queues+updateQueueEntryStatus\"></a>\n\n### queues.updateQueueEntryStatus(request) ⇒ <code>Promise.&lt;void&gt;</code>\nUpdates the status of a queue entry.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateQueueEntryStatusRequest</code> | The request object |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID to update the queue entry for |\n| request.status | <code>string</code> | The status to update the queue entry to |\n\n**Example**  \n```js\nconst request = {\n workspaceId: \"g-7b7c46fb05\",\n customerId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n status: \"DEQUEUED\"\n};\n\nqueues.updateQueueEntryStatus(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Queues+joinQueue\"></a>\n\n### queues.joinQueue(request) ⇒ <code>Promise.&lt;void&gt;</code>\nAdds a customer to a queue.\n\n**Kind**: instance method of [<code>Queues</code>](#Queues)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>JoinQueueRequest</code> | The request object |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.customerId | <code>string</code> | The customer ID to add to the queue |\n\n**Example**  \n```js\nconst request = {\n workspaceId: \"g-7b7c46fb05\",\n customerId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\"\n};\n\nqueues.joinQueue(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n\n<a name=\"Tokens\"></a>\n\n## Tokens ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Tokens capability to create and verify JWT tokens.\nEnsure the Goodtok API Server is running for the Tokens API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Tokens](#Tokens) ⇐ <code>AbstractBaseClient</code>\n    * [new Tokens(client)](#new_Tokens_new)\n    * [.createAnonymousToken(request)](#Tokens+createAnonymousToken) ⇒ <code>Promise.&lt;string&gt;</code>\n    * [.createToken(request)](#Tokens+createToken) ⇒ <code>Promise.&lt;string&gt;</code>\n\n<a name=\"new_Tokens_new\"></a>\n\n### new Tokens(client)\nConstructs a new Tokens API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function createAnonymousToken() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const tokens = new SDK.Tokens(client);\n\n  const request = {\n    ref: \"myref\",\n    workspaceId: \"g-1234567890\",\n    metadata: {\n     customField: \"customValue\"\n    }\n  }\n\n  const connectionObject = await tokens.createAnonymousToken(request);\n  console.log(connectionObject);\n}\n\ncreateAnonymousToken().catch(console.error);\n```\n<a name=\"Tokens+createAnonymousToken\"></a>\n\n### tokens.createAnonymousToken(request) ⇒ <code>Promise.&lt;string&gt;</code>\nCreates a new anonymous token for the specified workspace, and does not require authentication.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;string&gt;</code> - A promise resolving to the token  \n**Throws**:\n\n- Will throw an error if the workspace does not have the `anonymous` feature enabled\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateAnonymousTokenInput</code> | A request with claims required to create a token |\n| request.ref | <code>string</code> | A reference for the anonymous user |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.metadata | <code>string</code> | Custom metadata to be included in the token |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  workspaceId: \"g-1234567890\",\n  metadata: {\n   customField: \"customValue\"\n  }\n}\n\ntokens.createAnonymousToken(request)\n  .then(console.log)\n  .catch(console.error) // handle any errors\n```\n<a name=\"Tokens+createToken\"></a>\n\n### tokens.createToken(request) ⇒ <code>Promise.&lt;string&gt;</code>\nCreates a new token with the specified permissions.\n\n**Kind**: instance method of [<code>Tokens</code>](#Tokens)  \n**Returns**: <code>Promise.&lt;string&gt;</code> - A promise resolving to the token  \n**Throws**:\n\n- Will throw an error if the user is not logged in\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateTokenInput</code> | A request with claims required to create the token |\n| request.ref | <code>string</code> | A reference for the user |\n| request.peerId | <code>string</code> | The peer ID for the user |\n\n**Example**  \n```js\nconst request = {\n  ref: \"myref\",\n  customerId: \"121a4579\",\n  workspaceId: \"g-1234567890\"\n};\n\ntokens.createToken(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Users\"></a>\n\n## Users ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Users capability to retrieve and manage users.\nEnsure the Goodtok API Server is running for the Users API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Users](#Users) ⇐ <code>AbstractBaseClient</code>\n    * [new Users(client)](#new_Users_new)\n    * [.getCurrentUser()](#Users+getCurrentUser) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.getUserById(id)](#Users+getUserById) ⇒ <code>Promise.&lt;User&gt;</code>\n    * [.updateUser(request)](#Users+updateUser) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\n\n<a name=\"new_Users_new\"></a>\n\n### new Users(client)\nConstructs a new Users API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getUser() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const users = new SDK.Users(client);\n  const id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n  const user = await users.getUserById(id);\n\n  console.log(user);\n}\n\ngetUser().catch(console.error);\n```\n<a name=\"Users+getCurrentUser\"></a>\n\n### users.getCurrentUser() ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves the logged-in user.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if user is not logged in or the JWT token has expired\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getCurrentUser(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+getUserById\"></a>\n\n### users.getUserById(id) ⇒ <code>Promise.&lt;User&gt;</code>\nRetrieves a user by its ID. The calling user must have an admin role to retrieve other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;User&gt;</code> - A promise resolving to the user  \n**Throws**:\n\n- Will throw an error if the user is not found\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The user ID |\n\n**Example**  \n```js\nconst id = \"5f9d7a3a-2b2b-4b7a-9b9b-8e9d9d9d9d9d\";\n\nusers.getUserById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Users+updateUser\"></a>\n\n### users.updateUser(request) ⇒ <code>Promise.&lt;UpdateUserResponse&gt;</code>\nUpdates a user's details. The calling user must have an admin role to update other users.\n\n**Kind**: instance method of [<code>Users</code>](#Users)  \n**Returns**: <code>Promise.&lt;UpdateUserResponse&gt;</code> - A promise resolving to the updated user's details  \n**Throws**:\n\n- If the user is not an admin and the user ID does not match the logged-in user's ID\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateUserRequest</code> | A request object containing the user ID and update data |\n| request.name | <code>string</code> | Optional parameter to update the user's name |\n| request.password | <code>string</code> | Optional parameter to update the user's password |\n| request.avatar | <code>string</code> | Optional parameter to update the user's avatar |\n\n**Example**  \n```js\nconst request = {\n  name: \"John Doe\",\n  password: \"mysecretpassword\",\n  avatar: \"https://example.com/avatar.png\"\n};\n\nusers.updateUser(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n\n<a name=\"Workspaces\"></a>\n\n## Workspaces ⇐ <code>AbstractBaseClient</code>\nUse the Goodtok Workspaces capability to retrieve and manage workspaces.\nEnsure the Goodtok API Server is running for the Workspaces API to function.\n\n**Kind**: global class  \n**Extends**: <code>AbstractBaseClient</code>  \n**See**: module:sdk:Client  \n\n* [Workspaces](#Workspaces) ⇐ <code>AbstractBaseClient</code>\n    * [new Workspaces(client)](#new_Workspaces_new)\n    * [.createWorkspace(request)](#Workspaces+createWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceId()](#Workspaces+getDefaultWorkspaceId) ⇒ <code>string</code>\n    * [.getDefaultWorkspace()](#Workspaces+getDefaultWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getDefaultWorkspaceMembers()](#Workspaces+getDefaultWorkspaceMembers) ⇒ <code>Promise.&lt;GetMembersResponse&gt;</code>\n    * [.getWorkspaceById(id)](#Workspaces+getWorkspaceById) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getMembersByWorkspaceId(id)](#Workspaces+getMembersByWorkspaceId) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.updateWorkspace(request)](#Workspaces+updateWorkspace) ⇒ <code>Promise.&lt;Workspace&gt;</code>\n    * [.getWorkspaces()](#Workspaces+getWorkspaces) ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\n    * [.addWorkspaceMember(request)](#Workspaces+addWorkspaceMember) ⇒ <code>Promise.&lt;Member&gt;</code>\n    * [.removeWorkspaceMember(id)](#Workspaces+removeWorkspaceMember) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.removeWorkspace(id)](#Workspaces+removeWorkspace) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.resendWorkspaceMemberInvite(id)](#Workspaces+resendWorkspaceMemberInvite) ⇒ <code>Promise.&lt;void&gt;</code>\n    * [.watchWorkspaceStatus(id, callback)](#Workspaces+watchWorkspaceStatus) ⇒ <code>Unsubscribable</code>\n\n<a name=\"new_Workspaces_new\"></a>\n\n### new Workspaces(client)\nConstructs a new Workspaces API object.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| client | <code>Client</code> | Object containing the client configuration |\n\n**Example**  \n```js\nconst SDK = require(\"@goodtok/sdk\");\n\nasync function getWorkspace() {\n  const client = new SDK.Client({ workspace: \"myworkspace\" });\n  await client.login(\"goodtok\", \"mysecretpassword\");\n\n  const workspaces = new SDK.Workspaces(client);\n  const workspace = await workspaces.getDefaultWorkspace();\n\n  console.log(workspace);\n}\n\ngetWorkspace().catch(console.error);\n```\n<a name=\"Workspaces+createWorkspace\"></a>\n\n### workspaces.createWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nCreates a new workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the created workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>CreateWorkspaceRequest</code> | The request object containing the workspace name, timezone, and hours of operation |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    Monday: { from: \"09:00\", to: \"17:00\" },\n    Tuesday: { from: \"09:00\", to: \"17:00\" },\n    // ...\n  }\n};\n\nworkspaces.createWorkspace(request)\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceId\"></a>\n\n### workspaces.getDefaultWorkspaceId() ⇒ <code>string</code>\nRetrieves the default workspace ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>string</code> - The default workspace ID  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceId();\n```\n<a name=\"Workspaces+getDefaultWorkspace\"></a>\n\n### workspaces.getDefaultWorkspace() ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n**Example**  \n```js\nworkspaces.getDefaultWorkspace()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getDefaultWorkspaceMembers\"></a>\n\n### workspaces.getDefaultWorkspaceMembers() ⇒ <code>Promise.&lt;GetMembersResponse&gt;</code>\nRetrieves the members for the default workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;GetMembersResponse&gt;</code> - A promise resolving to the members  \n**Example**  \n```js\nworkspaces.getDefaultWorkspaceMembers()\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaceById\"></a>\n\n### workspaces.getWorkspaceById(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the workspace  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getWorkspaceById(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getMembersByWorkspaceId\"></a>\n\n### workspaces.getMembersByWorkspaceId(id) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nRetrieves the members for a workspace by its ID.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to an object containing an array of members  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.getMembersByWorkspaceId(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+updateWorkspace\"></a>\n\n### workspaces.updateWorkspace(request) ⇒ <code>Promise.&lt;Workspace&gt;</code>\nUpdates the details of a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Workspace&gt;</code> - A promise resolving to the updated workspace's details  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>UpdateWorkspaceRequest</code> | The request object containing the workspace ID and update data |\n| request.id | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The workspace name |\n| request.timezone | <code>string</code> | The workspace timezone |\n| request.hoursOfOperation | <code>object</code> | The workspace hours of operation |\n\n**Example**  \n```js\nconst request = {\n  id: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"My Workspace\",\n  timezone: \"America/New_York\",\n  hoursOfOperation: {\n    Monday: { from: \"09:00\", to: \"17:00\" },\n    Tuesday: { from: \"09:00\", to: \"17:00\" },\n    // ...\n  }\n};\n\nworkspaces.updateWorkspace(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+getWorkspaces\"></a>\n\n### workspaces.getWorkspaces() ⇒ <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code>\nRetrieves all workspaces for the authenticated user.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Array.&lt;Workspace&gt;&gt;</code> - A promise resolving to an array of workspaces  \n**Example**  \n```js\nworkspaces.getWorkspaces()\n .then(console.log)\n .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+addWorkspaceMember\"></a>\n\n### workspaces.addWorkspaceMember(request) ⇒ <code>Promise.&lt;Member&gt;</code>\nAdds a member to a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;Member&gt;</code> - A promise resolving to the added member  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| request | <code>AddWorkspaceMemberRequest</code> | The request object containing the workspace ID and member details |\n| request.workspaceId | <code>string</code> | The workspace ID |\n| request.name | <code>string</code> | The member name |\n| request.email | <code>string</code> | The member email |\n| request.role | <code>string</code> | The member role |\n\n**Example**  \n```js\nconst request = {\n  workspaceId: \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\",\n  name: \"John Doe\",\n  email: \"jhon@example.com\",\n  role: \"MEMBER\"\n};\n\nworkspaces.addWorkspaceMember(request)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+removeWorkspaceMember\"></a>\n\n### workspaces.removeWorkspaceMember(id) ⇒ <code>Promise.&lt;void&gt;</code>\nRemoves a member from a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The member ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.removeWorkspaceMember(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+removeWorkspace\"></a>\n\n### workspaces.removeWorkspace(id) ⇒ <code>Promise.&lt;void&gt;</code>\nRemoves a workspace.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The workspace ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.removeWorkspace(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+resendWorkspaceMemberInvite\"></a>\n\n### workspaces.resendWorkspaceMemberInvite(id) ⇒ <code>Promise.&lt;void&gt;</code>\nResends a workspace member invite.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Promise.&lt;void&gt;</code> - A promise resolving to void  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The member ID |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.resendWorkspaceMemberInvite(id)\n  .then(console.log)\n  .catch(console.error); // handle any errors\n```\n<a name=\"Workspaces+watchWorkspaceStatus\"></a>\n\n### workspaces.watchWorkspaceStatus(id, callback) ⇒ <code>Unsubscribable</code>\nRegisters a callback for real-time updates on workspace status.\n\n**Kind**: instance method of [<code>Workspaces</code>](#Workspaces)  \n**Returns**: <code>Unsubscribable</code> - An object containing the unsubscribe method  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The ID of the workspace |\n| callback | <code>function</code> | The callback to be invoked when the workspace status updates |\n\n**Example**  \n```js\nconst id = \"4f9d5a3a-362b-7b7a-34gb-4e94969d7d2d\";\n\nworkspaces.watchWorkspaceStatus(id, (err, data) => {\n  if (err) {\n   console.error(err);\n   return;\n  }\n\n  console.log(data);\n});\n```\n\n","readmeFilename":"README.md","keywords":["Goodtok","VoIP","WebRTC","Fonoster","SIP.js","Web Phone","Phone","PeerJS","Contact Center"]}