@unboundcx/sdk 4.13.18 → 4.13.20

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/services/portals.js +575 -36
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.18",
3
+ "version": "4.13.20",
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",
@@ -1,4 +1,4 @@
1
- import { internalRequest } from '../base.js';
1
+ import { internalRequest } from "../base.js";
2
2
  export class PortalsService {
3
3
  constructor(sdk) {
4
4
  this.sdk = sdk;
@@ -9,8 +9,11 @@ export class PortalsService {
9
9
  *
10
10
  * @param {object} params
11
11
  * @param {string} params.name - Display name of the portal.
12
- * @param {string} params.domain - Custom domain for the portal (e.g. `portal.example.com`).
12
+ * @param {string} [params.kind] - Portal kind (`marketing` | `support` | `partner`).
13
+ * @param {string} [params.domain] - Custom domain for the portal (e.g. `portal.example.com`).
13
14
  * A CNAME DNS record pointing to the platform's portal host is required.
15
+ * @param {string} [params.slug] - Per-account preview slug (not a custom domain).
16
+ * At least one of `domain` or `slug` is required by the API.
14
17
  * @param {object} [params.settings] - Optional portal configuration settings.
15
18
  * @param {boolean} [params.isPublic] - Whether the portal is publicly accessible without
16
19
  * authentication. Defaults to private if omitted.
@@ -28,7 +31,9 @@ export class PortalsService {
28
31
  */
29
32
  async create({
30
33
  name,
34
+ kind,
31
35
  domain,
36
+ slug,
32
37
  settings,
33
38
  isPublic,
34
39
  customCss,
@@ -37,20 +42,25 @@ export class PortalsService {
37
42
  logo,
38
43
  }) {
39
44
  this.sdk.validateParams(
40
- { name, domain },
45
+ { name, kind, domain, slug },
41
46
  {
42
- name: { type: 'string', required: true },
43
- domain: { type: 'string', required: true },
44
- settings: { type: 'object', required: false },
45
- isPublic: { type: 'boolean', required: false },
46
- customCss: { type: 'string', required: false },
47
- customJs: { type: 'string', required: false },
48
- favicon: { type: 'string', required: false },
49
- logo: { type: 'string', required: false },
47
+ name: { type: "string", required: true },
48
+ kind: { type: "string", required: false },
49
+ domain: { type: "string", required: false },
50
+ slug: { type: "string", required: false },
51
+ settings: { type: "object", required: false },
52
+ isPublic: { type: "boolean", required: false },
53
+ customCss: { type: "string", required: false },
54
+ customJs: { type: "string", required: false },
55
+ favicon: { type: "string", required: false },
56
+ logo: { type: "string", required: false },
50
57
  },
51
58
  );
52
59
 
53
- const portalData = { name, domain };
60
+ const portalData = { name };
61
+ if (kind) portalData.kind = kind;
62
+ if (domain) portalData.domain = domain;
63
+ if (slug) portalData.slug = slug;
54
64
  if (settings) portalData.settings = settings;
55
65
  if (isPublic !== undefined) portalData.isPublic = isPublic;
56
66
  if (customCss) portalData.customCss = customCss;
@@ -62,7 +72,7 @@ export class PortalsService {
62
72
  body: portalData,
63
73
  };
64
74
 
65
- const result = await internalRequest(this.sdk, '/portals', 'POST', params);
75
+ const result = await internalRequest(this.sdk, "/portals", "POST", params);
66
76
  return result;
67
77
  }
68
78
 
@@ -91,26 +101,38 @@ export class PortalsService {
91
101
  */
92
102
  async update(
93
103
  portalId,
94
- { name, domain, settings, isPublic, customCss, customJs, favicon, logo },
104
+ {
105
+ name,
106
+ domain,
107
+ slug,
108
+ settings,
109
+ isPublic,
110
+ customCss,
111
+ customJs,
112
+ favicon,
113
+ logo,
114
+ },
95
115
  ) {
96
116
  this.sdk.validateParams(
97
117
  { portalId },
98
118
  {
99
- portalId: { type: 'string', required: true },
100
- name: { type: 'string', required: false },
101
- domain: { type: 'string', required: false },
102
- settings: { type: 'object', required: false },
103
- isPublic: { type: 'boolean', required: false },
104
- customCss: { type: 'string', required: false },
105
- customJs: { type: 'string', required: false },
106
- favicon: { type: 'string', required: false },
107
- logo: { type: 'string', required: false },
119
+ portalId: { type: "string", required: true },
120
+ name: { type: "string", required: false },
121
+ domain: { type: "string", required: false },
122
+ slug: { type: "string", required: false },
123
+ settings: { type: "object", required: false },
124
+ isPublic: { type: "boolean", required: false },
125
+ customCss: { type: "string", required: false },
126
+ customJs: { type: "string", required: false },
127
+ favicon: { type: "string", required: false },
128
+ logo: { type: "string", required: false },
108
129
  },
109
130
  );
110
131
 
111
132
  const updateData = {};
112
133
  if (name) updateData.name = name;
113
- if (domain) updateData.domain = domain;
134
+ if (domain !== undefined) updateData.domain = domain;
135
+ if (slug !== undefined) updateData.slug = slug;
114
136
  if (settings) updateData.settings = settings;
115
137
  if (isPublic !== undefined) updateData.isPublic = isPublic;
116
138
  if (customCss) updateData.customCss = customCss;
@@ -122,7 +144,12 @@ export class PortalsService {
122
144
  body: updateData,
123
145
  };
124
146
 
125
- const result = await internalRequest(this.sdk, `/portals/${portalId}`, 'PUT', params);
147
+ const result = await internalRequest(
148
+ this.sdk,
149
+ `/portals/${portalId}`,
150
+ "PUT",
151
+ params,
152
+ );
126
153
  return result;
127
154
  }
128
155
 
@@ -136,11 +163,15 @@ export class PortalsService {
136
163
  this.sdk.validateParams(
137
164
  { portalId },
138
165
  {
139
- portalId: { type: 'string', required: true },
166
+ portalId: { type: "string", required: true },
140
167
  },
141
168
  );
142
169
 
143
- const result = await internalRequest(this.sdk, `/portals/${portalId}`, 'DELETE');
170
+ const result = await internalRequest(
171
+ this.sdk,
172
+ `/portals/${portalId}`,
173
+ "DELETE",
174
+ );
144
175
  return result;
145
176
  }
146
177
 
@@ -154,11 +185,15 @@ export class PortalsService {
154
185
  this.sdk.validateParams(
155
186
  { portalId },
156
187
  {
157
- portalId: { type: 'string', required: true },
188
+ portalId: { type: "string", required: true },
158
189
  },
159
190
  );
160
191
 
161
- const result = await internalRequest(this.sdk, `/portals/${portalId}`, 'GET');
192
+ const result = await internalRequest(
193
+ this.sdk,
194
+ `/portals/${portalId}`,
195
+ "GET",
196
+ );
162
197
  return result;
163
198
  }
164
199
 
@@ -177,7 +212,7 @@ export class PortalsService {
177
212
  this.sdk.validateParams(
178
213
  { domain },
179
214
  {
180
- domain: { type: 'string', required: true },
215
+ domain: { type: "string", required: true },
181
216
  },
182
217
  );
183
218
 
@@ -185,7 +220,12 @@ export class PortalsService {
185
220
  query: { domain },
186
221
  };
187
222
 
188
- const result = await internalRequest(this.sdk, '/portals/public', 'GET', params);
223
+ const result = await internalRequest(
224
+ this.sdk,
225
+ "/portals/public",
226
+ "GET",
227
+ params,
228
+ );
189
229
  return result;
190
230
  }
191
231
 
@@ -195,7 +235,7 @@ export class PortalsService {
195
235
  * @returns {Promise<{ portals: object[] }>} An object containing an array of portal records.
196
236
  */
197
237
  async list() {
198
- const result = await internalRequest(this.sdk, '/portals', 'GET');
238
+ const result = await internalRequest(this.sdk, "/portals", "GET");
199
239
  return result;
200
240
  }
201
241
 
@@ -219,14 +259,513 @@ export class PortalsService {
219
259
  this.sdk.validateParams(
220
260
  { portalId },
221
261
  {
222
- portalId: { type: 'string', required: true },
262
+ portalId: { type: "string", required: true },
223
263
  },
224
264
  );
225
265
 
226
- const result = await internalRequest(this.sdk,
227
- `/portals/${portalId}/verify-dns`,
228
- 'POST',
266
+ const result = await internalRequest(
267
+ this.sdk,
268
+ "/portals/dns/verify",
269
+ "GET",
270
+ {
271
+ query: { id: portalId },
272
+ },
229
273
  );
230
274
  return result;
231
275
  }
276
+
277
+ /**
278
+ * Lists pages for a portal.
279
+ *
280
+ * @param {string} portalId
281
+ * @returns {Promise<{ pages: object[] }>}
282
+ */
283
+ async listPages(portalId) {
284
+ this.sdk.validateParams(
285
+ { portalId },
286
+ {
287
+ portalId: { type: "string", required: true },
288
+ },
289
+ );
290
+
291
+ return internalRequest(this.sdk, `/portals/${portalId}/pages`, "GET");
292
+ }
293
+
294
+ /**
295
+ * Creates a portal page.
296
+ *
297
+ * @param {string} portalId
298
+ * @param {object} params
299
+ * @param {string} params.path - `/` or a slash-prefixed path like `/spring-sale`.
300
+ * @param {string} params.title
301
+ * @param {string} params.type - landing|html|layout|kbHome|kbArticle|ticketList|ticketDetail|login|redirect
302
+ * @param {boolean} [params.requiresLogin] - Require a signed-in portal session to view this page.
303
+ * @returns {Promise<object>}
304
+ */
305
+ async createPage(portalId, { path, title, type, requiresLogin }) {
306
+ this.sdk.validateParams(
307
+ { portalId, path, title, type, requiresLogin },
308
+ {
309
+ portalId: { type: "string", required: true },
310
+ path: { type: "string", required: true },
311
+ title: { type: "string", required: true },
312
+ type: { type: "string", required: true },
313
+ requiresLogin: { type: "boolean", required: false },
314
+ },
315
+ );
316
+
317
+ const body = { path, title, type };
318
+ if (requiresLogin !== undefined) body.requiresLogin = requiresLogin;
319
+
320
+ return internalRequest(this.sdk, `/portals/${portalId}/pages`, "POST", {
321
+ body,
322
+ });
323
+ }
324
+
325
+ /**
326
+ * Retrieves a portal page by ID.
327
+ *
328
+ * @param {string} portalId
329
+ * @param {string} pageId
330
+ * @returns {Promise<object>}
331
+ */
332
+ async getPage(portalId, pageId) {
333
+ this.sdk.validateParams(
334
+ { portalId, pageId },
335
+ {
336
+ portalId: { type: "string", required: true },
337
+ pageId: { type: "string", required: true },
338
+ },
339
+ );
340
+
341
+ return internalRequest(
342
+ this.sdk,
343
+ `/portals/${portalId}/pages/${pageId}`,
344
+ "GET",
345
+ );
346
+ }
347
+
348
+ /**
349
+ * Updates a portal page. Only provided fields are changed.
350
+ *
351
+ * @param {string} portalId
352
+ * @param {string} pageId
353
+ * @param {object} [updates]
354
+ * @returns {Promise<object>}
355
+ */
356
+ async updatePage(
357
+ portalId,
358
+ pageId,
359
+ {
360
+ path,
361
+ title,
362
+ type,
363
+ isPublished,
364
+ publishedVersionId,
365
+ draftVersionId,
366
+ requiresLogin,
367
+ } = {},
368
+ ) {
369
+ this.sdk.validateParams(
370
+ {
371
+ portalId,
372
+ pageId,
373
+ path,
374
+ title,
375
+ type,
376
+ isPublished,
377
+ publishedVersionId,
378
+ draftVersionId,
379
+ requiresLogin,
380
+ },
381
+ {
382
+ portalId: { type: "string", required: true },
383
+ pageId: { type: "string", required: true },
384
+ path: { type: "string", required: false },
385
+ title: { type: "string", required: false },
386
+ type: { type: "string", required: false },
387
+ isPublished: { type: "boolean", required: false },
388
+ publishedVersionId: { type: "string", required: false },
389
+ draftVersionId: { type: "string", required: false },
390
+ requiresLogin: { type: "boolean", required: false },
391
+ },
392
+ );
393
+
394
+ const body = {};
395
+ if (path !== undefined) body.path = path;
396
+ if (title !== undefined) body.title = title;
397
+ if (type !== undefined) body.type = type;
398
+ if (isPublished !== undefined) body.isPublished = isPublished;
399
+ if (publishedVersionId !== undefined) {
400
+ body.publishedVersionId = publishedVersionId;
401
+ }
402
+ if (draftVersionId !== undefined) body.draftVersionId = draftVersionId;
403
+ if (requiresLogin !== undefined) body.requiresLogin = requiresLogin;
404
+
405
+ return internalRequest(
406
+ this.sdk,
407
+ `/portals/${portalId}/pages/${pageId}`,
408
+ "PUT",
409
+ { body },
410
+ );
411
+ }
412
+
413
+ /**
414
+ * Soft-deletes a portal page.
415
+ *
416
+ * @param {string} portalId
417
+ * @param {string} pageId
418
+ * @returns {Promise<{ message: string }>}
419
+ */
420
+ async deletePage(portalId, pageId) {
421
+ this.sdk.validateParams(
422
+ { portalId, pageId },
423
+ {
424
+ portalId: { type: "string", required: true },
425
+ pageId: { type: "string", required: true },
426
+ },
427
+ );
428
+
429
+ return internalRequest(
430
+ this.sdk,
431
+ `/portals/${portalId}/pages/${pageId}`,
432
+ "DELETE",
433
+ );
434
+ }
435
+
436
+ /**
437
+ * Lists versions for a portal page.
438
+ *
439
+ * @param {string} portalId
440
+ * @param {string} pageId
441
+ * @returns {Promise<{ versions: object[] }>}
442
+ */
443
+ async listPageVersions(portalId, pageId) {
444
+ this.sdk.validateParams(
445
+ { portalId, pageId },
446
+ {
447
+ portalId: { type: "string", required: true },
448
+ pageId: { type: "string", required: true },
449
+ },
450
+ );
451
+
452
+ return internalRequest(
453
+ this.sdk,
454
+ `/portals/${portalId}/pages/${pageId}/versions`,
455
+ "GET",
456
+ );
457
+ }
458
+
459
+ /**
460
+ * Creates a page version (S3 pointers / layout / object only; no HTML compile).
461
+ *
462
+ * @param {string} portalId
463
+ * @param {string} pageId
464
+ * @param {object} [params]
465
+ * @returns {Promise<object>}
466
+ */
467
+ async createPageVersion(
468
+ portalId,
469
+ pageId,
470
+ { designStorageId, htmlStorageId, layoutId, objectName } = {},
471
+ ) {
472
+ this.sdk.validateParams(
473
+ {
474
+ portalId,
475
+ pageId,
476
+ designStorageId,
477
+ htmlStorageId,
478
+ layoutId,
479
+ objectName,
480
+ },
481
+ {
482
+ portalId: { type: "string", required: true },
483
+ pageId: { type: "string", required: true },
484
+ designStorageId: { type: "string", required: false },
485
+ htmlStorageId: { type: "string", required: false },
486
+ layoutId: { type: "string", required: false },
487
+ objectName: { type: "string", required: false },
488
+ },
489
+ );
490
+
491
+ const body = {};
492
+ if (designStorageId !== undefined) body.designStorageId = designStorageId;
493
+ if (htmlStorageId !== undefined) body.htmlStorageId = htmlStorageId;
494
+ if (layoutId !== undefined) body.layoutId = layoutId;
495
+ if (objectName !== undefined) body.objectName = objectName;
496
+
497
+ return internalRequest(
498
+ this.sdk,
499
+ `/portals/${portalId}/pages/${pageId}/versions`,
500
+ "POST",
501
+ { body },
502
+ );
503
+ }
504
+
505
+ /**
506
+ * Autosave a page draft. Landing pages pass a block `tree`; `html`-type
507
+ * pages (marketing portals only, P7.1) pass the raw full-document `html`
508
+ * string instead.
509
+ *
510
+ * @param {string} portalId
511
+ * @param {string} pageId
512
+ * @param {object} params
513
+ * @param {object|Array} [params.tree] - Block tree JSON (landing pages).
514
+ * @param {string} [params.html] - Raw full-document HTML (html pages).
515
+ * @returns {Promise<object>}
516
+ */
517
+ async savePageDraft(portalId, pageId, { tree, html } = {}) {
518
+ this.sdk.validateParams(
519
+ { portalId, pageId, tree, html },
520
+ {
521
+ portalId: { type: "string", required: true },
522
+ pageId: { type: "string", required: true },
523
+ tree: { type: "object", required: false },
524
+ html: { type: "string", required: false },
525
+ },
526
+ );
527
+
528
+ const body = {};
529
+ if (tree !== undefined) body.tree = tree;
530
+ if (html !== undefined) body.html = html;
531
+
532
+ return internalRequest(
533
+ this.sdk,
534
+ `/portals/${portalId}/pages/${pageId}/draft`,
535
+ "PUT",
536
+ { body },
537
+ );
538
+ }
539
+
540
+ /**
541
+ * Compile a landing-page draft (P1.4) and publish HTML, or (for `html`-type
542
+ * pages, P7.1) store the raw document string verbatim.
543
+ *
544
+ * @param {string} portalId
545
+ * @param {string} pageId
546
+ * @param {object} [params]
547
+ * @param {object|Array} [params.tree] - Optional tree; otherwise the draft design is loaded.
548
+ * @param {string} [params.html] - Raw full-document HTML (html pages); otherwise the draft is loaded.
549
+ * @returns {Promise<object>}
550
+ */
551
+ async publishPage(portalId, pageId, { tree, html } = {}) {
552
+ this.sdk.validateParams(
553
+ { portalId, pageId, tree, html },
554
+ {
555
+ portalId: { type: "string", required: true },
556
+ pageId: { type: "string", required: true },
557
+ tree: { type: "object", required: false },
558
+ html: { type: "string", required: false },
559
+ },
560
+ );
561
+
562
+ const body = {};
563
+ if (tree !== undefined) body.tree = tree;
564
+ if (html !== undefined) body.html = html;
565
+
566
+ return internalRequest(
567
+ this.sdk,
568
+ `/portals/${portalId}/pages/${pageId}/publish`,
569
+ "POST",
570
+ { body },
571
+ );
572
+ }
573
+
574
+ /**
575
+ * Staff-only portal credential status for a person. Never includes hashes.
576
+ *
577
+ * @param {string} peopleId
578
+ * @returns {Promise<{
579
+ * hasPassword: boolean,
580
+ * ssoLinked: boolean,
581
+ * lastLoginAt: string|null,
582
+ * lastLoginMethod: string|null,
583
+ * mustReset: boolean
584
+ * }>}
585
+ */
586
+ async getPeopleAccess(peopleId) {
587
+ this.sdk.validateParams(
588
+ { peopleId },
589
+ {
590
+ peopleId: { type: "string", required: true },
591
+ },
592
+ );
593
+
594
+ return internalRequest(
595
+ this.sdk,
596
+ `/portals/people/${encodeURIComponent(peopleId)}/access`,
597
+ "GET",
598
+ );
599
+ }
600
+
601
+ /**
602
+ * Force the person to reset their portal password on next login (`mustReset=1`).
603
+ *
604
+ * @param {string} peopleId
605
+ * @returns {Promise<{
606
+ * hasPassword: boolean,
607
+ * ssoLinked: boolean,
608
+ * lastLoginAt: string|null,
609
+ * lastLoginMethod: string|null,
610
+ * mustReset: boolean
611
+ * }>}
612
+ */
613
+ async forceResetPeopleAccess(peopleId) {
614
+ this.sdk.validateParams(
615
+ { peopleId },
616
+ {
617
+ peopleId: { type: "string", required: true },
618
+ },
619
+ );
620
+
621
+ return internalRequest(
622
+ this.sdk,
623
+ `/portals/people/${encodeURIComponent(peopleId)}/access/force-reset`,
624
+ "POST",
625
+ );
626
+ }
627
+
628
+ /**
629
+ * Lists the customer-facing labels configured for each engagement status.
630
+ *
631
+ * One entry per valid `engagementSessions.status` value; `customerLabel`
632
+ * is `null` when unset (P4.2: the portal hides statuses with no label).
633
+ *
634
+ * @returns {Promise<{ statuses: Array<{ status: string, customerLabel: string|null }> }>}
635
+ */
636
+ async listTicketStatuses() {
637
+ return internalRequest(this.sdk, "/portals/ticket-statuses", "GET");
638
+ }
639
+
640
+ /**
641
+ * Upserts customer-facing labels for engagement statuses.
642
+ *
643
+ * @param {object} params
644
+ * @param {Array<{ status: string, customerLabel: string|null }>} params.statuses
645
+ * @returns {Promise<{ statuses: Array<{ status: string, customerLabel: string|null }> }>}
646
+ */
647
+ async updateTicketStatuses({ statuses }) {
648
+ this.sdk.validateParams(
649
+ { statuses },
650
+ {
651
+ statuses: { type: "array", required: true },
652
+ },
653
+ );
654
+
655
+ return internalRequest(this.sdk, "/portals/ticket-statuses", "PUT", {
656
+ body: { statuses },
657
+ });
658
+ }
659
+
660
+ /**
661
+ * Retrieves the single-sign-on (OIDC) connection configured for a portal.
662
+ *
663
+ * Never includes the client secret; `hasClientSecret` indicates whether
664
+ * one is on file.
665
+ *
666
+ * @param {string} portalId
667
+ * @returns {Promise<{ connection: {
668
+ * id: string,
669
+ * provider: string,
670
+ * name: string,
671
+ * issuer: string,
672
+ * clientId: string,
673
+ * tenant: string|null,
674
+ * scopes: string,
675
+ * status: string,
676
+ * requireVerifiedEmail: boolean,
677
+ * hasClientSecret: boolean,
678
+ * redirectUri: string,
679
+ * updatedAt: string
680
+ * } | null }>}
681
+ */
682
+ async getSsoConnection(portalId) {
683
+ this.sdk.validateParams(
684
+ { portalId },
685
+ {
686
+ portalId: { type: "string", required: true },
687
+ },
688
+ );
689
+
690
+ return internalRequest(this.sdk, `/portals/${portalId}/sso`, "GET");
691
+ }
692
+
693
+ /**
694
+ * Creates or updates a portal's single-sign-on (OIDC) connection.
695
+ *
696
+ * Only `support`/`partner` portals may have a connection. `clientSecret`
697
+ * is required when creating a connection and optional on update (omit it
698
+ * to keep the existing secret).
699
+ *
700
+ * @param {string} portalId
701
+ * @param {object} params
702
+ * @param {string} [params.name] - Display name shown to visitors (e.g. "Single sign-on").
703
+ * @param {string} params.issuer - OIDC issuer URL (https, no query/fragment).
704
+ * @param {string} params.clientId
705
+ * @param {string} [params.clientSecret] - Required to create; omit on update to keep existing.
706
+ * @param {string} [params.tenant] - Provider tenant hint (e.g. an Azure tenant id).
707
+ * @param {string} [params.scopes] - Space-separated scopes; must include `openid` and `email`.
708
+ * @param {string} [params.status] - `active` | `disabled`.
709
+ * @param {boolean} [params.requireVerifiedEmail]
710
+ * @returns {Promise<{ connection: object }>}
711
+ */
712
+ async upsertSsoConnection(
713
+ portalId,
714
+ {
715
+ name,
716
+ issuer,
717
+ clientId,
718
+ clientSecret,
719
+ tenant,
720
+ scopes,
721
+ status,
722
+ requireVerifiedEmail,
723
+ } = {},
724
+ ) {
725
+ this.sdk.validateParams(
726
+ { portalId, issuer, clientId },
727
+ {
728
+ portalId: { type: "string", required: true },
729
+ issuer: { type: "string", required: true },
730
+ clientId: { type: "string", required: true },
731
+ name: { type: "string", required: false },
732
+ clientSecret: { type: "string", required: false },
733
+ tenant: { type: "string", required: false },
734
+ scopes: { type: "string", required: false },
735
+ status: { type: "string", required: false },
736
+ requireVerifiedEmail: { type: "boolean", required: false },
737
+ },
738
+ );
739
+
740
+ const body = { issuer, clientId };
741
+ if (name !== undefined) body.name = name;
742
+ if (clientSecret !== undefined) body.clientSecret = clientSecret;
743
+ if (tenant !== undefined) body.tenant = tenant;
744
+ if (scopes !== undefined) body.scopes = scopes;
745
+ if (status !== undefined) body.status = status;
746
+ if (requireVerifiedEmail !== undefined) {
747
+ body.requireVerifiedEmail = requireVerifiedEmail;
748
+ }
749
+
750
+ return internalRequest(this.sdk, `/portals/${portalId}/sso`, "PUT", {
751
+ body,
752
+ });
753
+ }
754
+
755
+ /**
756
+ * Soft-deletes a portal's single-sign-on (OIDC) connection.
757
+ *
758
+ * @param {string} portalId
759
+ * @returns {Promise<{ message: string }>}
760
+ */
761
+ async deleteSsoConnection(portalId) {
762
+ this.sdk.validateParams(
763
+ { portalId },
764
+ {
765
+ portalId: { type: "string", required: true },
766
+ },
767
+ );
768
+
769
+ return internalRequest(this.sdk, `/portals/${portalId}/sso`, "DELETE");
770
+ }
232
771
  }