@unboundcx/sdk 4.13.29 → 4.13.30

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
@@ -19,6 +19,7 @@ import { BrandService } from './services/brand.js';
19
19
  import { ContentService } from './services/content.js';
20
20
  import { VerificationService } from './services/verification.js';
21
21
  import { PortalsService } from './services/portals.js';
22
+ import { DealRegistrationsService } from './services/dealRegistrations.js';
22
23
  import { SipEndpointsService } from './services/sipEndpoints.js';
23
24
  import { WebchatService } from './services/webchat.js';
24
25
  import { ExternalOAuthService } from './services/externalOAuth.js';
@@ -105,6 +106,7 @@ class UnboundSDK extends BaseSDK {
105
106
  this.content = new ContentService(this);
106
107
  this.verification = new VerificationService(this);
107
108
  this.portals = new PortalsService(this);
109
+ this.dealRegistrations = new DealRegistrationsService(this);
108
110
  this.sipEndpoints = new SipEndpointsService(this);
109
111
  this.webchat = new WebchatService(this);
110
112
  this.externalOAuth = new ExternalOAuthService(this);
@@ -298,6 +300,7 @@ export {
298
300
  } from './services/content.js';
299
301
  export { VerificationService } from './services/verification.js';
300
302
  export { PortalsService } from './services/portals.js';
303
+ export { DealRegistrationsService } from './services/dealRegistrations.js';
301
304
  export { SipEndpointsService } from './services/sipEndpoints.js';
302
305
  export { WebchatService, WebchatWidgetsService } from './services/webchat.js';
303
306
  export { WebchatVisitorService } from './services/webchat/VisitorService.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.29",
3
+ "version": "4.13.30",
4
4
  "description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,47 @@
1
+ import { internalRequest } from '../base.js';
2
+
3
+ /**
4
+ * Staff-facing deal registration actions (P13 contracts §6). Endpoints
5
+ * live under `/deal-registrations/` (checkApiAuth), separate from the
6
+ * `dealRegistrations` generic object CRUD (which the layout builder's
7
+ * ApproveReject component calls through this mixin, not
8
+ * `sdk.objects.updateById`, since conversion is transactional and
9
+ * multi-record).
10
+ */
11
+ export class DealRegistrationsService {
12
+ constructor(sdk) {
13
+ this.sdk = sdk;
14
+ }
15
+
16
+ /**
17
+ * Approve a pending deal registration — converts it into real
18
+ * company/people/opportunity records (reusing matched records where
19
+ * possible) and stamps the registration approved.
20
+ * @param {string} id - dealRegistrations record id
21
+ * @returns {Promise<Object>} { registration, converted }
22
+ */
23
+ async approve(id) {
24
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
25
+ return internalRequest(this.sdk, `/deal-registrations/${id}/approve`, 'POST');
26
+ }
27
+
28
+ /**
29
+ * Reject a pending deal registration.
30
+ * @param {string} id - dealRegistrations record id
31
+ * @param {Object} options
32
+ * @param {string} options.reason
33
+ * @returns {Promise<Object>} { registration }
34
+ */
35
+ async reject(id, { reason } = {}) {
36
+ this.sdk.validateParams(
37
+ { id, reason },
38
+ {
39
+ id: { type: 'string', required: true },
40
+ reason: { type: 'string', required: true },
41
+ },
42
+ );
43
+ return internalRequest(this.sdk, `/deal-registrations/${id}/reject`, 'POST', {
44
+ body: { reason },
45
+ });
46
+ }
47
+ }