@halix/action-sdk 1.0.15 → 1.0.17
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/lib/cjs/index.js +237 -0
- package/lib/cjs/types/index.d.ts +127 -0
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/index.mjs +220 -0
- package/lib/esm/types/index.d.ts +127 -0
- package/package.json +1 -1
package/lib/cjs/index.js
CHANGED
|
@@ -33,6 +33,15 @@ exports.getValueFromObject = getValueFromObject;
|
|
|
33
33
|
exports.prepareSuccessResponse = prepareSuccessResponse;
|
|
34
34
|
exports.prepareErrorResponse = prepareErrorResponse;
|
|
35
35
|
exports.initialize = initialize;
|
|
36
|
+
exports.getOrCreateResource = getOrCreateResource;
|
|
37
|
+
exports.getOrCreateResourceAsObservable = getOrCreateResourceAsObservable;
|
|
38
|
+
exports.saveResource = saveResource;
|
|
39
|
+
exports.saveResourceAsObservable = saveResourceAsObservable;
|
|
40
|
+
exports.sendFileContents = sendFileContents;
|
|
41
|
+
exports.sendFileContentsAsObservable = sendFileContentsAsObservable;
|
|
42
|
+
exports.createOrUpdateResource = createOrUpdateResource;
|
|
43
|
+
exports.createOrUpdateResourceAsObservable = createOrUpdateResourceAsObservable;
|
|
44
|
+
exports.debounceFn = debounceFn;
|
|
36
45
|
/**
|
|
37
46
|
* @module @halix/action-sdk
|
|
38
47
|
* @description Halix Platform action SDK for developing NodeJS Lambda-based actions on the Halix
|
|
@@ -367,3 +376,231 @@ function initialize(event) {
|
|
|
367
376
|
}
|
|
368
377
|
}
|
|
369
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* getOrCreateResource retrieves an existing content resource by its key, or creates a new one
|
|
381
|
+
* if the key is not provided. If a resource key is provided, it attempts to fetch the existing
|
|
382
|
+
* resource from the server. If no key is provided, it creates a new resource with the specified
|
|
383
|
+
* properties.
|
|
384
|
+
*
|
|
385
|
+
* @param resourceKey - Optional key of the existing resource to retrieve
|
|
386
|
+
* @param fileToUpload - Optional file or blob to upload
|
|
387
|
+
* @param publicFlag - Whether the resource should be public
|
|
388
|
+
* @param resourceType - The type of resource
|
|
389
|
+
* @param tags - Array of tags for the resource
|
|
390
|
+
*
|
|
391
|
+
* @returns Promise resolving to a ContentResource
|
|
392
|
+
*/
|
|
393
|
+
function getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
|
|
394
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
395
|
+
if (!exports.userContext) {
|
|
396
|
+
throw new Error("userContext is required but not available; check that the initialize function has been called");
|
|
397
|
+
}
|
|
398
|
+
if (resourceKey) {
|
|
399
|
+
let url = `${exports.serviceAddress}/sandboxes/${exports.sandboxKey}/contentResource/${resourceKey}`;
|
|
400
|
+
let authToken = yield (0, rxjs_1.lastValueFrom)((0, exports.getAuthToken)());
|
|
401
|
+
console.log("Sending GET request to " + url + " with token " + authToken);
|
|
402
|
+
let response = yield axios_1.default.get(url, {
|
|
403
|
+
headers: { "Authorization": `Bearer ${authToken}` },
|
|
404
|
+
});
|
|
405
|
+
let resource = response.data;
|
|
406
|
+
if (fileToUpload) {
|
|
407
|
+
resource.contentType = fileToUpload.type;
|
|
408
|
+
// Null out the name and extension; the server will set these if they are blank
|
|
409
|
+
resource.name = null;
|
|
410
|
+
resource.extension = null;
|
|
411
|
+
}
|
|
412
|
+
return resource;
|
|
413
|
+
}
|
|
414
|
+
let newResource = {
|
|
415
|
+
isPublic: publicFlag,
|
|
416
|
+
resourceType: resourceType,
|
|
417
|
+
tags: tags,
|
|
418
|
+
organizationKey: exports.userContext.orgKey,
|
|
419
|
+
sandboxKey: exports.sandboxKey,
|
|
420
|
+
userKey: exports.userContext.user.objKey
|
|
421
|
+
};
|
|
422
|
+
if (fileToUpload) {
|
|
423
|
+
newResource.contentType = fileToUpload.type;
|
|
424
|
+
// Null out the name and extension; the server will set these if they are blank
|
|
425
|
+
newResource.name = null;
|
|
426
|
+
newResource.extension = null;
|
|
427
|
+
}
|
|
428
|
+
return newResource;
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* getOrCreateResourceAsObservable retrieves an existing content resource by its key, or creates a new one
|
|
433
|
+
* if the key is not provided. If a resource key is provided, it attempts to fetch the existing
|
|
434
|
+
* resource from the server. If no key is provided, it creates a new resource with the specified
|
|
435
|
+
* properties.
|
|
436
|
+
*
|
|
437
|
+
* @param resourceKey - Optional key of the existing resource to retrieve
|
|
438
|
+
* @param fileToUpload - Optional file or blob to upload
|
|
439
|
+
* @param publicFlag - Whether the resource should be public
|
|
440
|
+
* @param resourceType - The type of resource
|
|
441
|
+
* @param tags - Array of tags for the resource
|
|
442
|
+
*
|
|
443
|
+
* @returns Observable resolving to a ContentResource
|
|
444
|
+
*/
|
|
445
|
+
function getOrCreateResourceAsObservable(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
|
|
446
|
+
return (0, rxjs_1.from)(getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags));
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* saveResource saves a content resource to the server. The resource is saved with appropriate
|
|
450
|
+
* ownership parameters based on the current context (solution builder vs regular organization view).
|
|
451
|
+
*
|
|
452
|
+
* @param resource - The ContentResource to save
|
|
453
|
+
*
|
|
454
|
+
* @returns Promise resolving to the saved ContentResource
|
|
455
|
+
*/
|
|
456
|
+
function saveResource(resource) {
|
|
457
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
458
|
+
if (!exports.userContext) {
|
|
459
|
+
throw new Error("userContext is required but not available; check that the initialize function has been called");
|
|
460
|
+
}
|
|
461
|
+
let params = {};
|
|
462
|
+
if (exports.userContext.orgProxy.objType === "Solution") {
|
|
463
|
+
// When in the solution builder view, content is owned by the solution. The solution key is the org proxy key in
|
|
464
|
+
// the builder view.
|
|
465
|
+
params.solutionKey = exports.userContext.orgProxyKey;
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
params.organizationKey = exports.userContext.orgKey;
|
|
469
|
+
params.userKey = exports.userContext.user.objKey;
|
|
470
|
+
}
|
|
471
|
+
let url = `${exports.serviceAddress}/sandboxes/${exports.sandboxKey}/contentResource`;
|
|
472
|
+
let authToken = yield (0, rxjs_1.lastValueFrom)((0, exports.getAuthToken)());
|
|
473
|
+
console.log("Sending POST request to " + url + " with token " + authToken);
|
|
474
|
+
let response = yield axios_1.default.post(url, JSON.stringify(resource), {
|
|
475
|
+
headers: { "Authorization": `Bearer ${authToken}` },
|
|
476
|
+
params: params,
|
|
477
|
+
});
|
|
478
|
+
return response.data;
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* saveResourceAsObservable saves a content resource to the server. The resource is saved with appropriate
|
|
483
|
+
* ownership parameters based on the current context (solution builder vs regular organization view).
|
|
484
|
+
*
|
|
485
|
+
* @param resource - The ContentResource to save
|
|
486
|
+
*
|
|
487
|
+
* @returns Observable resolving to the saved ContentResource
|
|
488
|
+
*/
|
|
489
|
+
function saveResourceAsObservable(resource) {
|
|
490
|
+
return (0, rxjs_1.from)(saveResource(resource));
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* sendFileContents uploads file contents to the server for a specific resource. The file is uploaded
|
|
494
|
+
* via FormData with the appropriate scope and public flag settings.
|
|
495
|
+
*
|
|
496
|
+
* @param resourceKey - The key of the resource to upload file contents for
|
|
497
|
+
* @param fileToUpload - The file or blob to upload
|
|
498
|
+
* @param publicFlag - Whether the file should be public
|
|
499
|
+
*
|
|
500
|
+
* @returns Promise resolving to true if upload was successful
|
|
501
|
+
*/
|
|
502
|
+
function sendFileContents(resourceKey, fileToUpload, publicFlag) {
|
|
503
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
504
|
+
if (!exports.userContext) {
|
|
505
|
+
throw new Error("userContext is required but not available; check that the initialize function has been called");
|
|
506
|
+
}
|
|
507
|
+
let url = `${exports.serviceAddress}/filecontent/${exports.sandboxKey}/${resourceKey}`;
|
|
508
|
+
let authToken = yield (0, rxjs_1.lastValueFrom)((0, exports.getAuthToken)());
|
|
509
|
+
console.log("Sending file upload request to " + url + " with token " + authToken);
|
|
510
|
+
let formData = new FormData();
|
|
511
|
+
formData.append("fileUpload", fileToUpload);
|
|
512
|
+
formData.append("scopeKeyPath", exports.userContext.orgProxyKey);
|
|
513
|
+
formData.append("public", String(publicFlag));
|
|
514
|
+
let response = yield axios_1.default.post(url, formData, {
|
|
515
|
+
headers: {
|
|
516
|
+
"Authorization": `Bearer ${authToken}`,
|
|
517
|
+
"Content-Type": "multipart/form-data"
|
|
518
|
+
},
|
|
519
|
+
});
|
|
520
|
+
return response.status === 204;
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* sendFileContentsAsObservable uploads file contents to the server for a specific resource. The file is uploaded
|
|
525
|
+
* via FormData with the appropriate scope and public flag settings.
|
|
526
|
+
*
|
|
527
|
+
* @param resourceKey - The key of the resource to upload file contents for
|
|
528
|
+
* @param fileToUpload - The file or blob to upload
|
|
529
|
+
* @param publicFlag - Whether the file should be public
|
|
530
|
+
*
|
|
531
|
+
* @returns Observable resolving to true if upload was successful
|
|
532
|
+
*/
|
|
533
|
+
function sendFileContentsAsObservable(resourceKey, fileToUpload, publicFlag) {
|
|
534
|
+
return (0, rxjs_1.from)(sendFileContents(resourceKey, fileToUpload, publicFlag));
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* createOrUpdateResource creates a new content resource or updates an existing one, then uploads
|
|
538
|
+
* the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
|
|
539
|
+
* otherwise, it creates a new resource and uploads the file to the newly created resource.
|
|
540
|
+
*
|
|
541
|
+
* @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
|
|
542
|
+
* @param fileToUpload - The file or blob to upload
|
|
543
|
+
* @param publicFlag - Whether the resource should be public
|
|
544
|
+
* @param resourceType - The type of resource
|
|
545
|
+
* @param tags - Array of tags for the resource
|
|
546
|
+
*
|
|
547
|
+
* @returns Promise resolving to the ContentResource with uploaded file
|
|
548
|
+
*/
|
|
549
|
+
function createOrUpdateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
|
|
550
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
551
|
+
if (!exports.userContext) {
|
|
552
|
+
throw new Error("userContext is required but not available; check that the initialize function has been called");
|
|
553
|
+
}
|
|
554
|
+
// Get or create the resource
|
|
555
|
+
let resource = yield getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags);
|
|
556
|
+
// Save the resource to get the objKey if it's new
|
|
557
|
+
let savedResource = yield saveResource(resource);
|
|
558
|
+
// Upload the file contents
|
|
559
|
+
if (!savedResource.objKey) {
|
|
560
|
+
throw new Error("Resource was saved but no objKey was returned");
|
|
561
|
+
}
|
|
562
|
+
let uploadSuccess = yield sendFileContents(savedResource.objKey, fileToUpload, publicFlag);
|
|
563
|
+
if (!uploadSuccess) {
|
|
564
|
+
throw new Error("Failed to upload file contents");
|
|
565
|
+
}
|
|
566
|
+
// Get the updated resource with file metadata
|
|
567
|
+
let updatedResource = yield getOrCreateResource(savedResource.objKey, fileToUpload, publicFlag, resourceType, []);
|
|
568
|
+
// Set the name if it's not set and we have a File with a name
|
|
569
|
+
if (updatedResource && !updatedResource.name && fileToUpload instanceof File) {
|
|
570
|
+
updatedResource.name = fileToUpload.name;
|
|
571
|
+
}
|
|
572
|
+
return updatedResource;
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* createOrUpdateResourceAsObservable creates a new content resource or updates an existing one, then uploads
|
|
577
|
+
* the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
|
|
578
|
+
* otherwise, it creates a new resource and uploads the file to the newly created resource.
|
|
579
|
+
*
|
|
580
|
+
* @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
|
|
581
|
+
* @param fileToUpload - The file or blob to upload
|
|
582
|
+
* @param publicFlag - Whether the resource should be public
|
|
583
|
+
* @param resourceType - The type of resource
|
|
584
|
+
* @param tags - Array of tags for the resource
|
|
585
|
+
*
|
|
586
|
+
* @returns Observable resolving to the ContentResource with uploaded file
|
|
587
|
+
*/
|
|
588
|
+
function createOrUpdateResourceAsObservable(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
|
|
589
|
+
return (0, rxjs_1.from)(createOrUpdateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags));
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* debounceFn is a utility function that debounces a function call. It is used to prevent multiple
|
|
593
|
+
* calls to the same function within a short period of time.
|
|
594
|
+
*
|
|
595
|
+
* @param fn - The function to debounce
|
|
596
|
+
* @param wait - The number of milliseconds to wait before calling the function
|
|
597
|
+
*
|
|
598
|
+
* @returns The debounced function
|
|
599
|
+
*/
|
|
600
|
+
function debounceFn(fn, wait = 200) {
|
|
601
|
+
let timeout;
|
|
602
|
+
return (...args) => {
|
|
603
|
+
clearTimeout(timeout);
|
|
604
|
+
timeout = setTimeout(() => fn(...args), wait);
|
|
605
|
+
};
|
|
606
|
+
}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -407,4 +407,131 @@ export interface UserContext {
|
|
|
407
407
|
orgKey: string;
|
|
408
408
|
userProxyKey: string;
|
|
409
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* ContentResource is an interface defining the properties of a content resource.
|
|
412
|
+
*/
|
|
413
|
+
export interface ContentResource {
|
|
414
|
+
objKey?: string;
|
|
415
|
+
isPublic: boolean;
|
|
416
|
+
resourceType: string;
|
|
417
|
+
tags: string[];
|
|
418
|
+
organizationKey: string;
|
|
419
|
+
sandboxKey: string;
|
|
420
|
+
userKey: string;
|
|
421
|
+
fileName?: string;
|
|
422
|
+
fileSize?: number;
|
|
423
|
+
mimeType?: string;
|
|
424
|
+
contentType?: string;
|
|
425
|
+
name?: string | null;
|
|
426
|
+
extension?: string | null;
|
|
427
|
+
deserialize?: (data: any) => ContentResource;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* getOrCreateResource retrieves an existing content resource by its key, or creates a new one
|
|
431
|
+
* if the key is not provided. If a resource key is provided, it attempts to fetch the existing
|
|
432
|
+
* resource from the server. If no key is provided, it creates a new resource with the specified
|
|
433
|
+
* properties.
|
|
434
|
+
*
|
|
435
|
+
* @param resourceKey - Optional key of the existing resource to retrieve
|
|
436
|
+
* @param fileToUpload - Optional file or blob to upload
|
|
437
|
+
* @param publicFlag - Whether the resource should be public
|
|
438
|
+
* @param resourceType - The type of resource
|
|
439
|
+
* @param tags - Array of tags for the resource
|
|
440
|
+
*
|
|
441
|
+
* @returns Promise resolving to a ContentResource
|
|
442
|
+
*/
|
|
443
|
+
export declare function getOrCreateResource(resourceKey: string | null, fileToUpload: File | Blob | null, publicFlag: boolean, resourceType: string, tags: string[]): Promise<ContentResource>;
|
|
444
|
+
/**
|
|
445
|
+
* getOrCreateResourceAsObservable retrieves an existing content resource by its key, or creates a new one
|
|
446
|
+
* if the key is not provided. If a resource key is provided, it attempts to fetch the existing
|
|
447
|
+
* resource from the server. If no key is provided, it creates a new resource with the specified
|
|
448
|
+
* properties.
|
|
449
|
+
*
|
|
450
|
+
* @param resourceKey - Optional key of the existing resource to retrieve
|
|
451
|
+
* @param fileToUpload - Optional file or blob to upload
|
|
452
|
+
* @param publicFlag - Whether the resource should be public
|
|
453
|
+
* @param resourceType - The type of resource
|
|
454
|
+
* @param tags - Array of tags for the resource
|
|
455
|
+
*
|
|
456
|
+
* @returns Observable resolving to a ContentResource
|
|
457
|
+
*/
|
|
458
|
+
export declare function getOrCreateResourceAsObservable(resourceKey: string | null, fileToUpload: File | Blob | null, publicFlag: boolean, resourceType: string, tags: string[]): Observable<ContentResource>;
|
|
459
|
+
/**
|
|
460
|
+
* saveResource saves a content resource to the server. The resource is saved with appropriate
|
|
461
|
+
* ownership parameters based on the current context (solution builder vs regular organization view).
|
|
462
|
+
*
|
|
463
|
+
* @param resource - The ContentResource to save
|
|
464
|
+
*
|
|
465
|
+
* @returns Promise resolving to the saved ContentResource
|
|
466
|
+
*/
|
|
467
|
+
export declare function saveResource(resource: ContentResource): Promise<ContentResource>;
|
|
468
|
+
/**
|
|
469
|
+
* saveResourceAsObservable saves a content resource to the server. The resource is saved with appropriate
|
|
470
|
+
* ownership parameters based on the current context (solution builder vs regular organization view).
|
|
471
|
+
*
|
|
472
|
+
* @param resource - The ContentResource to save
|
|
473
|
+
*
|
|
474
|
+
* @returns Observable resolving to the saved ContentResource
|
|
475
|
+
*/
|
|
476
|
+
export declare function saveResourceAsObservable(resource: ContentResource): Observable<ContentResource>;
|
|
477
|
+
/**
|
|
478
|
+
* sendFileContents uploads file contents to the server for a specific resource. The file is uploaded
|
|
479
|
+
* via FormData with the appropriate scope and public flag settings.
|
|
480
|
+
*
|
|
481
|
+
* @param resourceKey - The key of the resource to upload file contents for
|
|
482
|
+
* @param fileToUpload - The file or blob to upload
|
|
483
|
+
* @param publicFlag - Whether the file should be public
|
|
484
|
+
*
|
|
485
|
+
* @returns Promise resolving to true if upload was successful
|
|
486
|
+
*/
|
|
487
|
+
export declare function sendFileContents(resourceKey: string, fileToUpload: File | Blob, publicFlag: boolean): Promise<boolean>;
|
|
488
|
+
/**
|
|
489
|
+
* sendFileContentsAsObservable uploads file contents to the server for a specific resource. The file is uploaded
|
|
490
|
+
* via FormData with the appropriate scope and public flag settings.
|
|
491
|
+
*
|
|
492
|
+
* @param resourceKey - The key of the resource to upload file contents for
|
|
493
|
+
* @param fileToUpload - The file or blob to upload
|
|
494
|
+
* @param publicFlag - Whether the file should be public
|
|
495
|
+
*
|
|
496
|
+
* @returns Observable resolving to true if upload was successful
|
|
497
|
+
*/
|
|
498
|
+
export declare function sendFileContentsAsObservable(resourceKey: string, fileToUpload: File | Blob, publicFlag: boolean): Observable<boolean>;
|
|
499
|
+
/**
|
|
500
|
+
* createOrUpdateResource creates a new content resource or updates an existing one, then uploads
|
|
501
|
+
* the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
|
|
502
|
+
* otherwise, it creates a new resource and uploads the file to the newly created resource.
|
|
503
|
+
*
|
|
504
|
+
* @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
|
|
505
|
+
* @param fileToUpload - The file or blob to upload
|
|
506
|
+
* @param publicFlag - Whether the resource should be public
|
|
507
|
+
* @param resourceType - The type of resource
|
|
508
|
+
* @param tags - Array of tags for the resource
|
|
509
|
+
*
|
|
510
|
+
* @returns Promise resolving to the ContentResource with uploaded file
|
|
511
|
+
*/
|
|
512
|
+
export declare function createOrUpdateResource(resourceKey: string | null, fileToUpload: File | Blob, publicFlag: boolean, resourceType: string, tags: string[]): Promise<ContentResource>;
|
|
513
|
+
/**
|
|
514
|
+
* createOrUpdateResourceAsObservable creates a new content resource or updates an existing one, then uploads
|
|
515
|
+
* the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
|
|
516
|
+
* otherwise, it creates a new resource and uploads the file to the newly created resource.
|
|
517
|
+
*
|
|
518
|
+
* @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
|
|
519
|
+
* @param fileToUpload - The file or blob to upload
|
|
520
|
+
* @param publicFlag - Whether the resource should be public
|
|
521
|
+
* @param resourceType - The type of resource
|
|
522
|
+
* @param tags - Array of tags for the resource
|
|
523
|
+
*
|
|
524
|
+
* @returns Observable resolving to the ContentResource with uploaded file
|
|
525
|
+
*/
|
|
526
|
+
export declare function createOrUpdateResourceAsObservable(resourceKey: string | null, fileToUpload: File | Blob, publicFlag: boolean, resourceType: string, tags: string[]): Observable<ContentResource>;
|
|
527
|
+
/**
|
|
528
|
+
* debounceFn is a utility function that debounces a function call. It is used to prevent multiple
|
|
529
|
+
* calls to the same function within a short period of time.
|
|
530
|
+
*
|
|
531
|
+
* @param fn - The function to debounce
|
|
532
|
+
* @param wait - The number of milliseconds to wait before calling the function
|
|
533
|
+
*
|
|
534
|
+
* @returns The debounced function
|
|
535
|
+
*/
|
|
536
|
+
export declare function debounceFn<T extends (...args: any[]) => void>(fn: T, wait?: number): (...args: Parameters<T>) => void;
|
|
410
537
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAQ,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAQ,UAAU,EAAqB,MAAM,MAAM,CAAC;AAE3D;;;;GAIG;AACH,eAAO,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;AAElD;;;;GAIG;AACH,eAAO,IAAI,UAAU,EAAE,MAAM,CAAC;AAE9B;;;GAGG;AACH,eAAO,IAAI,cAAc,EAAE,MAAM,CAAC;AAElC;;;;;;;;;;;GAWG;AACH,eAAO,IAAI,aAAa,EAAE,GAAG,CAAC;AAE9B;;;GAGG;AACH,eAAO,IAAI,WAAW,EAAE,WAAW,CAAC;AAEpC;;;;GAIG;AACH,eAAO,IAAI,MAAM,EAAE,MAAM,CAAC;AAE1B;;;;;GAKG;AACH,eAAO,IAAI,OAAO,EAAE,OAAO,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CA2BvK;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CA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Ae,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,YAAY,YAAY,IAAI,EAAE,CAAC;QAC3E,eAAe,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;IAC7C,CAAC;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kCAAkC,CAAC,WAA0B,EAAE,YAAyB,EAAE,UAAmB,EAAE,YAAoB,EAAE,IAAc;IAC/J,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;AACnG,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAqC,EAAK,EAAE,IAAI,GAAG,GAAG;IAC5E,IAAI,OAAuB,CAAC;IAC5B,OAAO,CAAC,GAAG,IAAmB,EAAE,EAAE;QAC9B,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC,CAAC;AACN,CAAC"}
|
package/lib/esm/index.mjs
CHANGED
|
@@ -382,4 +382,224 @@ export function initialize(event) {
|
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* getOrCreateResource retrieves an existing content resource by its key, or creates a new one
|
|
387
|
+
* if the key is not provided. If a resource key is provided, it attempts to fetch the existing
|
|
388
|
+
* resource from the server. If no key is provided, it creates a new resource with the specified
|
|
389
|
+
* properties.
|
|
390
|
+
*
|
|
391
|
+
* @param resourceKey - Optional key of the existing resource to retrieve
|
|
392
|
+
* @param fileToUpload - Optional file or blob to upload
|
|
393
|
+
* @param publicFlag - Whether the resource should be public
|
|
394
|
+
* @param resourceType - The type of resource
|
|
395
|
+
* @param tags - Array of tags for the resource
|
|
396
|
+
*
|
|
397
|
+
* @returns Promise resolving to a ContentResource
|
|
398
|
+
*/
|
|
399
|
+
export async function getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
|
|
400
|
+
if (!userContext) {
|
|
401
|
+
throw new Error("userContext is required but not available; check that the initialize function has been called");
|
|
402
|
+
}
|
|
403
|
+
if (resourceKey) {
|
|
404
|
+
let url = `${serviceAddress}/sandboxes/${sandboxKey}/contentResource/${resourceKey}`;
|
|
405
|
+
let authToken = await lastValueFrom(getAuthToken());
|
|
406
|
+
console.log("Sending GET request to " + url + " with token " + authToken);
|
|
407
|
+
let response = await axios.get(url, {
|
|
408
|
+
headers: { "Authorization": `Bearer ${authToken}` },
|
|
409
|
+
});
|
|
410
|
+
let resource = response.data;
|
|
411
|
+
if (fileToUpload) {
|
|
412
|
+
resource.contentType = fileToUpload.type;
|
|
413
|
+
// Null out the name and extension; the server will set these if they are blank
|
|
414
|
+
resource.name = null;
|
|
415
|
+
resource.extension = null;
|
|
416
|
+
}
|
|
417
|
+
return resource;
|
|
418
|
+
}
|
|
419
|
+
let newResource = {
|
|
420
|
+
isPublic: publicFlag,
|
|
421
|
+
resourceType: resourceType,
|
|
422
|
+
tags: tags,
|
|
423
|
+
organizationKey: userContext.orgKey,
|
|
424
|
+
sandboxKey: sandboxKey,
|
|
425
|
+
userKey: userContext.user.objKey
|
|
426
|
+
};
|
|
427
|
+
if (fileToUpload) {
|
|
428
|
+
newResource.contentType = fileToUpload.type;
|
|
429
|
+
// Null out the name and extension; the server will set these if they are blank
|
|
430
|
+
newResource.name = null;
|
|
431
|
+
newResource.extension = null;
|
|
432
|
+
}
|
|
433
|
+
return newResource;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* getOrCreateResourceAsObservable retrieves an existing content resource by its key, or creates a new one
|
|
437
|
+
* if the key is not provided. If a resource key is provided, it attempts to fetch the existing
|
|
438
|
+
* resource from the server. If no key is provided, it creates a new resource with the specified
|
|
439
|
+
* properties.
|
|
440
|
+
*
|
|
441
|
+
* @param resourceKey - Optional key of the existing resource to retrieve
|
|
442
|
+
* @param fileToUpload - Optional file or blob to upload
|
|
443
|
+
* @param publicFlag - Whether the resource should be public
|
|
444
|
+
* @param resourceType - The type of resource
|
|
445
|
+
* @param tags - Array of tags for the resource
|
|
446
|
+
*
|
|
447
|
+
* @returns Observable resolving to a ContentResource
|
|
448
|
+
*/
|
|
449
|
+
export function getOrCreateResourceAsObservable(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
|
|
450
|
+
return from(getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags));
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* saveResource saves a content resource to the server. The resource is saved with appropriate
|
|
454
|
+
* ownership parameters based on the current context (solution builder vs regular organization view).
|
|
455
|
+
*
|
|
456
|
+
* @param resource - The ContentResource to save
|
|
457
|
+
*
|
|
458
|
+
* @returns Promise resolving to the saved ContentResource
|
|
459
|
+
*/
|
|
460
|
+
export async function saveResource(resource) {
|
|
461
|
+
if (!userContext) {
|
|
462
|
+
throw new Error("userContext is required but not available; check that the initialize function has been called");
|
|
463
|
+
}
|
|
464
|
+
let params = {};
|
|
465
|
+
if (userContext.orgProxy.objType === "Solution") {
|
|
466
|
+
// When in the solution builder view, content is owned by the solution. The solution key is the org proxy key in
|
|
467
|
+
// the builder view.
|
|
468
|
+
params.solutionKey = userContext.orgProxyKey;
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
params.organizationKey = userContext.orgKey;
|
|
472
|
+
params.userKey = userContext.user.objKey;
|
|
473
|
+
}
|
|
474
|
+
let url = `${serviceAddress}/sandboxes/${sandboxKey}/contentResource`;
|
|
475
|
+
let authToken = await lastValueFrom(getAuthToken());
|
|
476
|
+
console.log("Sending POST request to " + url + " with token " + authToken);
|
|
477
|
+
let response = await axios.post(url, JSON.stringify(resource), {
|
|
478
|
+
headers: { "Authorization": `Bearer ${authToken}` },
|
|
479
|
+
params: params,
|
|
480
|
+
});
|
|
481
|
+
return response.data;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* saveResourceAsObservable saves a content resource to the server. The resource is saved with appropriate
|
|
485
|
+
* ownership parameters based on the current context (solution builder vs regular organization view).
|
|
486
|
+
*
|
|
487
|
+
* @param resource - The ContentResource to save
|
|
488
|
+
*
|
|
489
|
+
* @returns Observable resolving to the saved ContentResource
|
|
490
|
+
*/
|
|
491
|
+
export function saveResourceAsObservable(resource) {
|
|
492
|
+
return from(saveResource(resource));
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* sendFileContents uploads file contents to the server for a specific resource. The file is uploaded
|
|
496
|
+
* via FormData with the appropriate scope and public flag settings.
|
|
497
|
+
*
|
|
498
|
+
* @param resourceKey - The key of the resource to upload file contents for
|
|
499
|
+
* @param fileToUpload - The file or blob to upload
|
|
500
|
+
* @param publicFlag - Whether the file should be public
|
|
501
|
+
*
|
|
502
|
+
* @returns Promise resolving to true if upload was successful
|
|
503
|
+
*/
|
|
504
|
+
export async function sendFileContents(resourceKey, fileToUpload, publicFlag) {
|
|
505
|
+
if (!userContext) {
|
|
506
|
+
throw new Error("userContext is required but not available; check that the initialize function has been called");
|
|
507
|
+
}
|
|
508
|
+
let url = `${serviceAddress}/filecontent/${sandboxKey}/${resourceKey}`;
|
|
509
|
+
let authToken = await lastValueFrom(getAuthToken());
|
|
510
|
+
console.log("Sending file upload request to " + url + " with token " + authToken);
|
|
511
|
+
let formData = new FormData();
|
|
512
|
+
formData.append("fileUpload", fileToUpload);
|
|
513
|
+
formData.append("scopeKeyPath", userContext.orgProxyKey);
|
|
514
|
+
formData.append("public", String(publicFlag));
|
|
515
|
+
let response = await axios.post(url, formData, {
|
|
516
|
+
headers: {
|
|
517
|
+
"Authorization": `Bearer ${authToken}`,
|
|
518
|
+
"Content-Type": "multipart/form-data"
|
|
519
|
+
},
|
|
520
|
+
});
|
|
521
|
+
return response.status === 204;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* sendFileContentsAsObservable uploads file contents to the server for a specific resource. The file is uploaded
|
|
525
|
+
* via FormData with the appropriate scope and public flag settings.
|
|
526
|
+
*
|
|
527
|
+
* @param resourceKey - The key of the resource to upload file contents for
|
|
528
|
+
* @param fileToUpload - The file or blob to upload
|
|
529
|
+
* @param publicFlag - Whether the file should be public
|
|
530
|
+
*
|
|
531
|
+
* @returns Observable resolving to true if upload was successful
|
|
532
|
+
*/
|
|
533
|
+
export function sendFileContentsAsObservable(resourceKey, fileToUpload, publicFlag) {
|
|
534
|
+
return from(sendFileContents(resourceKey, fileToUpload, publicFlag));
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* createOrUpdateResource creates a new content resource or updates an existing one, then uploads
|
|
538
|
+
* the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
|
|
539
|
+
* otherwise, it creates a new resource and uploads the file to the newly created resource.
|
|
540
|
+
*
|
|
541
|
+
* @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
|
|
542
|
+
* @param fileToUpload - The file or blob to upload
|
|
543
|
+
* @param publicFlag - Whether the resource should be public
|
|
544
|
+
* @param resourceType - The type of resource
|
|
545
|
+
* @param tags - Array of tags for the resource
|
|
546
|
+
*
|
|
547
|
+
* @returns Promise resolving to the ContentResource with uploaded file
|
|
548
|
+
*/
|
|
549
|
+
export async function createOrUpdateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
|
|
550
|
+
if (!userContext) {
|
|
551
|
+
throw new Error("userContext is required but not available; check that the initialize function has been called");
|
|
552
|
+
}
|
|
553
|
+
// Get or create the resource
|
|
554
|
+
let resource = await getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags);
|
|
555
|
+
// Save the resource to get the objKey if it's new
|
|
556
|
+
let savedResource = await saveResource(resource);
|
|
557
|
+
// Upload the file contents
|
|
558
|
+
if (!savedResource.objKey) {
|
|
559
|
+
throw new Error("Resource was saved but no objKey was returned");
|
|
560
|
+
}
|
|
561
|
+
let uploadSuccess = await sendFileContents(savedResource.objKey, fileToUpload, publicFlag);
|
|
562
|
+
if (!uploadSuccess) {
|
|
563
|
+
throw new Error("Failed to upload file contents");
|
|
564
|
+
}
|
|
565
|
+
// Get the updated resource with file metadata
|
|
566
|
+
let updatedResource = await getOrCreateResource(savedResource.objKey, fileToUpload, publicFlag, resourceType, []);
|
|
567
|
+
// Set the name if it's not set and we have a File with a name
|
|
568
|
+
if (updatedResource && !updatedResource.name && fileToUpload instanceof File) {
|
|
569
|
+
updatedResource.name = fileToUpload.name;
|
|
570
|
+
}
|
|
571
|
+
return updatedResource;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* createOrUpdateResourceAsObservable creates a new content resource or updates an existing one, then uploads
|
|
575
|
+
* the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
|
|
576
|
+
* otherwise, it creates a new resource and uploads the file to the newly created resource.
|
|
577
|
+
*
|
|
578
|
+
* @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
|
|
579
|
+
* @param fileToUpload - The file or blob to upload
|
|
580
|
+
* @param publicFlag - Whether the resource should be public
|
|
581
|
+
* @param resourceType - The type of resource
|
|
582
|
+
* @param tags - Array of tags for the resource
|
|
583
|
+
*
|
|
584
|
+
* @returns Observable resolving to the ContentResource with uploaded file
|
|
585
|
+
*/
|
|
586
|
+
export function createOrUpdateResourceAsObservable(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
|
|
587
|
+
return from(createOrUpdateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags));
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* debounceFn is a utility function that debounces a function call. It is used to prevent multiple
|
|
591
|
+
* calls to the same function within a short period of time.
|
|
592
|
+
*
|
|
593
|
+
* @param fn - The function to debounce
|
|
594
|
+
* @param wait - The number of milliseconds to wait before calling the function
|
|
595
|
+
*
|
|
596
|
+
* @returns The debounced function
|
|
597
|
+
*/
|
|
598
|
+
export function debounceFn(fn, wait = 200) {
|
|
599
|
+
let timeout;
|
|
600
|
+
return (...args) => {
|
|
601
|
+
clearTimeout(timeout);
|
|
602
|
+
timeout = setTimeout(() => fn(...args), wait);
|
|
603
|
+
};
|
|
604
|
+
}
|
|
385
605
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -407,3 +407,130 @@ export interface UserContext {
|
|
|
407
407
|
orgKey: string;
|
|
408
408
|
userProxyKey: string;
|
|
409
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* ContentResource is an interface defining the properties of a content resource.
|
|
412
|
+
*/
|
|
413
|
+
export interface ContentResource {
|
|
414
|
+
objKey?: string;
|
|
415
|
+
isPublic: boolean;
|
|
416
|
+
resourceType: string;
|
|
417
|
+
tags: string[];
|
|
418
|
+
organizationKey: string;
|
|
419
|
+
sandboxKey: string;
|
|
420
|
+
userKey: string;
|
|
421
|
+
fileName?: string;
|
|
422
|
+
fileSize?: number;
|
|
423
|
+
mimeType?: string;
|
|
424
|
+
contentType?: string;
|
|
425
|
+
name?: string | null;
|
|
426
|
+
extension?: string | null;
|
|
427
|
+
deserialize?: (data: any) => ContentResource;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* getOrCreateResource retrieves an existing content resource by its key, or creates a new one
|
|
431
|
+
* if the key is not provided. If a resource key is provided, it attempts to fetch the existing
|
|
432
|
+
* resource from the server. If no key is provided, it creates a new resource with the specified
|
|
433
|
+
* properties.
|
|
434
|
+
*
|
|
435
|
+
* @param resourceKey - Optional key of the existing resource to retrieve
|
|
436
|
+
* @param fileToUpload - Optional file or blob to upload
|
|
437
|
+
* @param publicFlag - Whether the resource should be public
|
|
438
|
+
* @param resourceType - The type of resource
|
|
439
|
+
* @param tags - Array of tags for the resource
|
|
440
|
+
*
|
|
441
|
+
* @returns Promise resolving to a ContentResource
|
|
442
|
+
*/
|
|
443
|
+
export declare function getOrCreateResource(resourceKey: string | null, fileToUpload: File | Blob | null, publicFlag: boolean, resourceType: string, tags: string[]): Promise<ContentResource>;
|
|
444
|
+
/**
|
|
445
|
+
* getOrCreateResourceAsObservable retrieves an existing content resource by its key, or creates a new one
|
|
446
|
+
* if the key is not provided. If a resource key is provided, it attempts to fetch the existing
|
|
447
|
+
* resource from the server. If no key is provided, it creates a new resource with the specified
|
|
448
|
+
* properties.
|
|
449
|
+
*
|
|
450
|
+
* @param resourceKey - Optional key of the existing resource to retrieve
|
|
451
|
+
* @param fileToUpload - Optional file or blob to upload
|
|
452
|
+
* @param publicFlag - Whether the resource should be public
|
|
453
|
+
* @param resourceType - The type of resource
|
|
454
|
+
* @param tags - Array of tags for the resource
|
|
455
|
+
*
|
|
456
|
+
* @returns Observable resolving to a ContentResource
|
|
457
|
+
*/
|
|
458
|
+
export declare function getOrCreateResourceAsObservable(resourceKey: string | null, fileToUpload: File | Blob | null, publicFlag: boolean, resourceType: string, tags: string[]): Observable<ContentResource>;
|
|
459
|
+
/**
|
|
460
|
+
* saveResource saves a content resource to the server. The resource is saved with appropriate
|
|
461
|
+
* ownership parameters based on the current context (solution builder vs regular organization view).
|
|
462
|
+
*
|
|
463
|
+
* @param resource - The ContentResource to save
|
|
464
|
+
*
|
|
465
|
+
* @returns Promise resolving to the saved ContentResource
|
|
466
|
+
*/
|
|
467
|
+
export declare function saveResource(resource: ContentResource): Promise<ContentResource>;
|
|
468
|
+
/**
|
|
469
|
+
* saveResourceAsObservable saves a content resource to the server. The resource is saved with appropriate
|
|
470
|
+
* ownership parameters based on the current context (solution builder vs regular organization view).
|
|
471
|
+
*
|
|
472
|
+
* @param resource - The ContentResource to save
|
|
473
|
+
*
|
|
474
|
+
* @returns Observable resolving to the saved ContentResource
|
|
475
|
+
*/
|
|
476
|
+
export declare function saveResourceAsObservable(resource: ContentResource): Observable<ContentResource>;
|
|
477
|
+
/**
|
|
478
|
+
* sendFileContents uploads file contents to the server for a specific resource. The file is uploaded
|
|
479
|
+
* via FormData with the appropriate scope and public flag settings.
|
|
480
|
+
*
|
|
481
|
+
* @param resourceKey - The key of the resource to upload file contents for
|
|
482
|
+
* @param fileToUpload - The file or blob to upload
|
|
483
|
+
* @param publicFlag - Whether the file should be public
|
|
484
|
+
*
|
|
485
|
+
* @returns Promise resolving to true if upload was successful
|
|
486
|
+
*/
|
|
487
|
+
export declare function sendFileContents(resourceKey: string, fileToUpload: File | Blob, publicFlag: boolean): Promise<boolean>;
|
|
488
|
+
/**
|
|
489
|
+
* sendFileContentsAsObservable uploads file contents to the server for a specific resource. The file is uploaded
|
|
490
|
+
* via FormData with the appropriate scope and public flag settings.
|
|
491
|
+
*
|
|
492
|
+
* @param resourceKey - The key of the resource to upload file contents for
|
|
493
|
+
* @param fileToUpload - The file or blob to upload
|
|
494
|
+
* @param publicFlag - Whether the file should be public
|
|
495
|
+
*
|
|
496
|
+
* @returns Observable resolving to true if upload was successful
|
|
497
|
+
*/
|
|
498
|
+
export declare function sendFileContentsAsObservable(resourceKey: string, fileToUpload: File | Blob, publicFlag: boolean): Observable<boolean>;
|
|
499
|
+
/**
|
|
500
|
+
* createOrUpdateResource creates a new content resource or updates an existing one, then uploads
|
|
501
|
+
* the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
|
|
502
|
+
* otherwise, it creates a new resource and uploads the file to the newly created resource.
|
|
503
|
+
*
|
|
504
|
+
* @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
|
|
505
|
+
* @param fileToUpload - The file or blob to upload
|
|
506
|
+
* @param publicFlag - Whether the resource should be public
|
|
507
|
+
* @param resourceType - The type of resource
|
|
508
|
+
* @param tags - Array of tags for the resource
|
|
509
|
+
*
|
|
510
|
+
* @returns Promise resolving to the ContentResource with uploaded file
|
|
511
|
+
*/
|
|
512
|
+
export declare function createOrUpdateResource(resourceKey: string | null, fileToUpload: File | Blob, publicFlag: boolean, resourceType: string, tags: string[]): Promise<ContentResource>;
|
|
513
|
+
/**
|
|
514
|
+
* createOrUpdateResourceAsObservable creates a new content resource or updates an existing one, then uploads
|
|
515
|
+
* the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
|
|
516
|
+
* otherwise, it creates a new resource and uploads the file to the newly created resource.
|
|
517
|
+
*
|
|
518
|
+
* @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
|
|
519
|
+
* @param fileToUpload - The file or blob to upload
|
|
520
|
+
* @param publicFlag - Whether the resource should be public
|
|
521
|
+
* @param resourceType - The type of resource
|
|
522
|
+
* @param tags - Array of tags for the resource
|
|
523
|
+
*
|
|
524
|
+
* @returns Observable resolving to the ContentResource with uploaded file
|
|
525
|
+
*/
|
|
526
|
+
export declare function createOrUpdateResourceAsObservable(resourceKey: string | null, fileToUpload: File | Blob, publicFlag: boolean, resourceType: string, tags: string[]): Observable<ContentResource>;
|
|
527
|
+
/**
|
|
528
|
+
* debounceFn is a utility function that debounces a function call. It is used to prevent multiple
|
|
529
|
+
* calls to the same function within a short period of time.
|
|
530
|
+
*
|
|
531
|
+
* @param fn - The function to debounce
|
|
532
|
+
* @param wait - The number of milliseconds to wait before calling the function
|
|
533
|
+
*
|
|
534
|
+
* @returns The debounced function
|
|
535
|
+
*/
|
|
536
|
+
export declare function debounceFn<T extends (...args: any[]) => void>(fn: T, wait?: number): (...args: Parameters<T>) => void;
|