cat-documents-ng 0.3.70 → 0.3.71
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.
|
@@ -261,6 +261,7 @@ export declare class SHARED {
|
|
|
261
261
|
static PDF_TYPE: string;
|
|
262
262
|
static EXCEL_XLSX_MIME_TYPE: string;
|
|
263
263
|
static EXCEL_XLS_MIME_TYPE: string;
|
|
264
|
+
static OCTET_STREAM: string;
|
|
264
265
|
static WORD_DOCX_MIME_TYPE: string;
|
|
265
266
|
static WORD_DOC_MIME_TYPE: string;
|
|
266
267
|
static CSV_MIME_TYPE: string;
|
|
@@ -326,6 +326,7 @@ class SHARED {
|
|
|
326
326
|
// MIME Type Constants
|
|
327
327
|
static EXCEL_XLSX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
328
328
|
static EXCEL_XLS_MIME_TYPE = 'application/vnd.ms-excel';
|
|
329
|
+
static OCTET_STREAM = 'application/octet-stream';
|
|
329
330
|
static WORD_DOCX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
330
331
|
static WORD_DOC_MIME_TYPE = 'application/msword';
|
|
331
332
|
static CSV_MIME_TYPE = 'text/csv';
|
|
@@ -1413,7 +1414,7 @@ class DocumentHttpService {
|
|
|
1413
1414
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1414
1415
|
*/
|
|
1415
1416
|
getDocumentCatagories(contextId) {
|
|
1416
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1417
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1417
1418
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers })
|
|
1418
1419
|
.pipe(tap((response) => {
|
|
1419
1420
|
if (response && response.categories) {
|
|
@@ -1472,7 +1473,7 @@ class DocumentHttpService {
|
|
|
1472
1473
|
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
1473
1474
|
*/
|
|
1474
1475
|
updateDocumentName(documentId, payload) {
|
|
1475
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1476
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1476
1477
|
return this.http.put(`${this.apiUrl}${URLS.ALIAS_NAME}${documentId}`, payload, { headers: headers }).pipe(catchError((error) => {
|
|
1477
1478
|
return throwError(() => new Error(error));
|
|
1478
1479
|
}));
|
|
@@ -1485,7 +1486,7 @@ class DocumentHttpService {
|
|
|
1485
1486
|
getUserListByContextId(contextId) {
|
|
1486
1487
|
if (!contextId)
|
|
1487
1488
|
return EMPTY;
|
|
1488
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1489
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1489
1490
|
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers: headers }).pipe(tap((userList) => {
|
|
1490
1491
|
this.documentStore.setUserList(userList);
|
|
1491
1492
|
}), catchError((error) => {
|
|
@@ -1511,7 +1512,7 @@ class DocumentHttpService {
|
|
|
1511
1512
|
if (categoryId) {
|
|
1512
1513
|
params = params.set(SHARED.CATEGORY, categoryId);
|
|
1513
1514
|
}
|
|
1514
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1515
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1515
1516
|
return this.http.get(url, { params, headers }).pipe(tap((statusData) => {
|
|
1516
1517
|
this.documentStore.setStatusData(statusData);
|
|
1517
1518
|
}), catchError((error) => {
|
|
@@ -1540,7 +1541,7 @@ class DocumentHttpService {
|
|
|
1540
1541
|
if (searchKey) {
|
|
1541
1542
|
params = params.set(SHARED.SEARCH_KEY, searchKey);
|
|
1542
1543
|
}
|
|
1543
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1544
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1544
1545
|
return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params, headers }).pipe(tap((response) => {
|
|
1545
1546
|
if (response.documents) {
|
|
1546
1547
|
this.documentStore.setDocumentList(response.documents);
|
|
@@ -1553,7 +1554,7 @@ class DocumentHttpService {
|
|
|
1553
1554
|
if (!documentId) {
|
|
1554
1555
|
return of([]);
|
|
1555
1556
|
}
|
|
1556
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1557
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1557
1558
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers }).pipe(catchError((error) => {
|
|
1558
1559
|
return throwError(() => new Error(error));
|
|
1559
1560
|
}));
|
|
@@ -1566,7 +1567,7 @@ class DocumentHttpService {
|
|
|
1566
1567
|
getCategoriesBySource(source) {
|
|
1567
1568
|
if (!source)
|
|
1568
1569
|
return EMPTY;
|
|
1569
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1570
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1570
1571
|
return this.http.get(`${this.apiUrl}${URLS.GET_CATEGORIES_BY_SOURCE}${source}`, { headers }).pipe(catchError((error) => {
|
|
1571
1572
|
return throwError(() => new Error(error));
|
|
1572
1573
|
}));
|
|
@@ -1579,7 +1580,7 @@ class DocumentHttpService {
|
|
|
1579
1580
|
getDocumentTypesByCategory(categoryId) {
|
|
1580
1581
|
if (!categoryId)
|
|
1581
1582
|
return EMPTY;
|
|
1582
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1583
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1583
1584
|
return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`, { headers }).pipe(catchError((error) => {
|
|
1584
1585
|
return throwError(() => new Error(error));
|
|
1585
1586
|
}));
|
|
@@ -1590,7 +1591,7 @@ class DocumentHttpService {
|
|
|
1590
1591
|
* @returns {Observable<any>} Observable that emits the upload response.
|
|
1591
1592
|
*/
|
|
1592
1593
|
uploadFile(formData) {
|
|
1593
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1594
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1594
1595
|
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData, { headers }).pipe(catchError((error) => {
|
|
1595
1596
|
return throwError(() => new Error(error));
|
|
1596
1597
|
}));
|
|
@@ -1601,7 +1602,7 @@ class DocumentHttpService {
|
|
|
1601
1602
|
* @returns {Observable<any>} Observable that emits the save response.
|
|
1602
1603
|
*/
|
|
1603
1604
|
saveDocumentUpload(payload) {
|
|
1604
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1605
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1605
1606
|
return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload, { headers }).pipe(catchError((error) => {
|
|
1606
1607
|
return throwError(() => new Error(error));
|
|
1607
1608
|
}));
|
|
@@ -1617,7 +1618,7 @@ class DocumentHttpService {
|
|
|
1617
1618
|
const payload = {
|
|
1618
1619
|
statusUpdateDescription: statusUpdateDescription
|
|
1619
1620
|
};
|
|
1620
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1621
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1621
1622
|
return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
|
|
1622
1623
|
if (response && response.status) {
|
|
1623
1624
|
const normalizedStatus = this.normalizeStatus(response.status);
|
|
@@ -1651,7 +1652,7 @@ class DocumentHttpService {
|
|
|
1651
1652
|
* @returns {Observable<any>} Observable that emits the delete response
|
|
1652
1653
|
*/
|
|
1653
1654
|
deleteDocument(documentId, contextId) {
|
|
1654
|
-
let headers = new HttpHeaders({ Authorization: 'Bearer
|
|
1655
|
+
let headers = new HttpHeaders({ Authorization: 'Bearer b4bde345-19f7-45f7-a405-7a82a6d97d8f' });
|
|
1655
1656
|
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
|
|
1656
1657
|
this.getDocumentCatagories(contextId).subscribe();
|
|
1657
1658
|
this.getUserListByContextId(contextId).subscribe();
|
|
@@ -7433,7 +7434,8 @@ class DocumentContentViewerComponent {
|
|
|
7433
7434
|
*/
|
|
7434
7435
|
get isExcel() {
|
|
7435
7436
|
return this.contentType === SHARED.EXCEL_XLSX_MIME_TYPE ||
|
|
7436
|
-
this.contentType === SHARED.EXCEL_XLS_MIME_TYPE
|
|
7437
|
+
this.contentType === SHARED.EXCEL_XLS_MIME_TYPE ||
|
|
7438
|
+
this.contentType === SHARED.OCTET_STREAM;
|
|
7437
7439
|
}
|
|
7438
7440
|
/**
|
|
7439
7441
|
* Computed property to determine if the document is a Word file
|
|
@@ -7441,7 +7443,7 @@ class DocumentContentViewerComponent {
|
|
|
7441
7443
|
*/
|
|
7442
7444
|
get isWord() {
|
|
7443
7445
|
return this.contentType === SHARED.WORD_DOCX_MIME_TYPE ||
|
|
7444
|
-
this.contentType === SHARED.WORD_DOC_MIME_TYPE;
|
|
7446
|
+
this.contentType === SHARED.WORD_DOC_MIME_TYPE || this.contentType === SHARED.OCTET_STREAM;
|
|
7445
7447
|
}
|
|
7446
7448
|
/**
|
|
7447
7449
|
* Computed property to determine if the document is a CSV file
|