@unboundcx/sdk 1.7.2 → 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/package.json +1 -1
- package/services/objects.js +27 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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",
|
package/services/objects.js
CHANGED
|
@@ -334,16 +334,20 @@ export class ObjectsService {
|
|
|
334
334
|
columnName,
|
|
335
335
|
value,
|
|
336
336
|
type = 'string',
|
|
337
|
+
columnType = 'varchar',
|
|
338
|
+
length = '255',
|
|
337
339
|
isActive = true,
|
|
338
340
|
isSystem = 0,
|
|
339
341
|
}) {
|
|
340
342
|
this.sdk.validateParams(
|
|
341
|
-
{ objectName, columnName, value, type, isActive, isSystem },
|
|
343
|
+
{ objectName, columnName, value, type, columnType, length, isActive, isSystem },
|
|
342
344
|
{
|
|
343
345
|
objectName: { type: 'string', required: true },
|
|
344
346
|
columnName: { type: 'string', required: true },
|
|
345
347
|
value: { type: 'string', required: true },
|
|
346
348
|
type: { type: 'string', required: false },
|
|
349
|
+
columnType: { type: 'string', required: false },
|
|
350
|
+
length: { type: 'string', required: false },
|
|
347
351
|
isActive: { type: 'boolean', required: false },
|
|
348
352
|
isSystem: { type: 'number', required: false },
|
|
349
353
|
},
|
|
@@ -354,6 +358,8 @@ export class ObjectsService {
|
|
|
354
358
|
columnName,
|
|
355
359
|
value,
|
|
356
360
|
type,
|
|
361
|
+
columnType,
|
|
362
|
+
length,
|
|
357
363
|
isActive,
|
|
358
364
|
isSystem,
|
|
359
365
|
};
|
|
@@ -415,16 +421,20 @@ export class ObjectsService {
|
|
|
415
421
|
columnName = null,
|
|
416
422
|
value = null,
|
|
417
423
|
type = null,
|
|
424
|
+
columnType = null,
|
|
425
|
+
length = null,
|
|
418
426
|
isActive = null,
|
|
419
427
|
}) {
|
|
420
428
|
this.sdk.validateParams(
|
|
421
|
-
{ id, objectName, columnName, value, type, isActive },
|
|
429
|
+
{ id, objectName, columnName, value, type, columnType, length, isActive },
|
|
422
430
|
{
|
|
423
431
|
id: { type: 'string', required: true },
|
|
424
432
|
objectName: { type: 'string', required: false },
|
|
425
433
|
columnName: { type: 'string', required: false },
|
|
426
434
|
value: { type: 'string', required: false },
|
|
427
435
|
type: { type: 'string', required: false },
|
|
436
|
+
columnType: { type: 'string', required: false },
|
|
437
|
+
length: { type: 'string', required: false },
|
|
428
438
|
isActive: { type: 'boolean', required: false },
|
|
429
439
|
},
|
|
430
440
|
);
|
|
@@ -434,6 +444,8 @@ export class ObjectsService {
|
|
|
434
444
|
if (columnName !== null) body.columnName = columnName;
|
|
435
445
|
if (value !== null) body.value = value;
|
|
436
446
|
if (type !== null) body.type = type;
|
|
447
|
+
if (columnType !== null) body.columnType = columnType;
|
|
448
|
+
if (length !== null) body.length = length;
|
|
437
449
|
if (isActive !== null) body.isActive = isActive;
|
|
438
450
|
|
|
439
451
|
const params = { body };
|
|
@@ -548,4 +560,17 @@ export class ObjectsService {
|
|
|
548
560
|
const result = await this.sdk._fetch(`/object/manage/${objectName}/${columnName}`, 'PUT', params);
|
|
549
561
|
return result;
|
|
550
562
|
}
|
|
563
|
+
|
|
564
|
+
async deleteColumn({ objectName, columnName }) {
|
|
565
|
+
this.sdk.validateParams(
|
|
566
|
+
{ objectName, columnName },
|
|
567
|
+
{
|
|
568
|
+
objectName: { type: 'string', required: true },
|
|
569
|
+
columnName: { type: 'string', required: true },
|
|
570
|
+
},
|
|
571
|
+
);
|
|
572
|
+
|
|
573
|
+
const result = await this.sdk._fetch(`/object/manage/${objectName}/${columnName}`, 'DELETE');
|
|
574
|
+
return result;
|
|
575
|
+
}
|
|
551
576
|
}
|