@unboundcx/sdk-internal 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -6,6 +6,7 @@ import { InternalEmailService } from './services/email.js';
6
6
  import { InternalProgrammableVoiceService } from './services/programmableVoice.js';
7
7
  import { InternalServersService } from './services/servers.js';
8
8
  import { InternalSocketService } from './services/socket.js';
9
+ import { InternalMasterAuthService } from './services/masterAuth.js';
9
10
 
10
11
  export class InternalSDK {
11
12
  constructor(sdk, buildMasterApiAuthFn) {
@@ -18,6 +19,7 @@ export class InternalSDK {
18
19
  this.programmableVoice = new InternalProgrammableVoiceService(sdk);
19
20
  this.servers = new InternalServersService(sdk);
20
21
  this.socket = new InternalSocketService(sdk);
22
+ this.masterAuth = new InternalMasterAuthService(sdk);
21
23
 
22
24
  // Proxy all base SDK properties and methods
23
25
  this._proxyBaseSDK();
@@ -117,3 +119,4 @@ export {
117
119
  AwsServersService,
118
120
  } from './services/servers.js';
119
121
  export { InternalSocketService } from './services/socket.js';
122
+ export { InternalMasterAuthService } from './services/masterAuth.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk-internal",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Internal SDK extension for Unbound - Provides access to internal APIs and administrative functions",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,35 @@
1
+ export class InternalMasterAuthService {
2
+ constructor(sdk) {
3
+ this.sdk = sdk;
4
+ }
5
+
6
+ async create({ namespace, accountId, userId, expiresIn = 30 }) {
7
+ this.sdk.validateParams(
8
+ { namespace, accountId, userId, expiresIn },
9
+ {
10
+ namespace: { type: 'string', required: true },
11
+ accountId: { type: 'string', required: true },
12
+ userId: { type: 'string', required: false },
13
+ expiresIn: { type: 'number', required: false },
14
+ },
15
+ );
16
+
17
+ const params = {
18
+ body: {
19
+ namespace,
20
+ accountId,
21
+ userId,
22
+ },
23
+ query: {
24
+ expiresIn,
25
+ },
26
+ };
27
+
28
+ const result = await this.sdk._fetch(
29
+ '/internal/masterAuth/',
30
+ 'POST',
31
+ params,
32
+ );
33
+ return result;
34
+ }
35
+ }
package/services/sip.js CHANGED
@@ -53,13 +53,7 @@ export class InternalSipService {
53
53
  ...params,
54
54
  },
55
55
  };
56
- const result = await this.sdk._fetch(
57
- `/internal/sip/log`,
58
- 'POST',
59
- options,
60
- true,
61
- false,
62
- );
56
+ const result = await this.sdk._fetch(`/internal/sip/log`, 'POST', options);
63
57
  return result;
64
58
  }
65
59