@unboundcx/sdk-internal 1.0.10 → 2.0.0
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 +3 -0
- package/package.json +3 -3
- package/services/branding.js +24 -0
- package/services/servers.js +12 -0
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { InternalProgrammableVoiceService } from './services/programmableVoice.j
|
|
|
7
7
|
import { InternalServersService } from './services/servers.js';
|
|
8
8
|
import { InternalSocketService } from './services/socket.js';
|
|
9
9
|
import { InternalMasterAuthService } from './services/masterAuth.js';
|
|
10
|
+
import { InternalBrandingService } from './services/branding.js';
|
|
10
11
|
|
|
11
12
|
export class InternalSDK {
|
|
12
13
|
constructor(sdk, buildMasterApiAuthFn) {
|
|
@@ -20,6 +21,7 @@ export class InternalSDK {
|
|
|
20
21
|
this.servers = new InternalServersService(sdk);
|
|
21
22
|
this.socket = new InternalSocketService(sdk);
|
|
22
23
|
this.masterAuth = new InternalMasterAuthService(sdk);
|
|
24
|
+
this.branding = new InternalBrandingService(sdk);
|
|
23
25
|
|
|
24
26
|
// Proxy all base SDK properties and methods
|
|
25
27
|
this._proxyBaseSDK();
|
|
@@ -120,3 +122,4 @@ export {
|
|
|
120
122
|
} from './services/servers.js';
|
|
121
123
|
export { InternalSocketService } from './services/socket.js';
|
|
122
124
|
export { InternalMasterAuthService } from './services/masterAuth.js';
|
|
125
|
+
export { InternalBrandingService } from './services/branding.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk-internal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "echo 'Build complete - ESM modules ready'",
|
|
50
|
-
"test": "
|
|
50
|
+
"test": "node --test 'test/*.test.js'",
|
|
51
51
|
"lint": "echo 'Linting would run here'",
|
|
52
52
|
"prepublishOnly": "npm run build"
|
|
53
53
|
},
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
"registry": "https://registry.npmjs.org/",
|
|
61
61
|
"access": "restricted"
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export class InternalBrandingService {
|
|
2
|
+
constructor(sdk) {
|
|
3
|
+
this.sdk = sdk;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* List trusted white-label domains for CORS validation.
|
|
8
|
+
*
|
|
9
|
+
* Backed by `GET /internal/branding/trustedDomains` on app1-api. Consumed by
|
|
10
|
+
* app1-socket to bootstrap its CORS allow-list; after bootstrap app1-socket
|
|
11
|
+
* keeps its cache current by subscribing to the `branding.domains.updated`
|
|
12
|
+
* NATS subject.
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<{ trustedDomains: string[] }>}
|
|
15
|
+
*/
|
|
16
|
+
async listTrustedDomains() {
|
|
17
|
+
const result = await this.sdk._fetch(
|
|
18
|
+
'/internal/branding/trustedDomains',
|
|
19
|
+
'GET',
|
|
20
|
+
{},
|
|
21
|
+
);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
}
|
package/services/servers.js
CHANGED
|
@@ -4,6 +4,18 @@ export class InternalServersService {
|
|
|
4
4
|
this.aws = new AwsServersService(sdk);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Register a server with app1-api.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated for `type: 'app1-video-server'`. Video pods no longer
|
|
11
|
+
* self-register; pod discovery now flows through NATS heartbeats on the
|
|
12
|
+
* `video.pod.heartbeat` subject, consumed by app1-api's `podRegistry`.
|
|
13
|
+
* For backwards compatibility during the rollout, `POST /internal/servers`
|
|
14
|
+
* continues to accept (and no-op) video-server registrations so that an
|
|
15
|
+
* old pod restarting mid-deploy does not crash. The no-op behavior — and
|
|
16
|
+
* this SDK path — will be removed in a subsequent release. Other server
|
|
17
|
+
* types (SIP, voice, etc.) continue to use this method normally.
|
|
18
|
+
*/
|
|
7
19
|
async create({
|
|
8
20
|
type,
|
|
9
21
|
region,
|