@colijnit/mainapi 259.1.0 → 259.1.2
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/build/enum/article-method.enum.d.ts +51 -0
- package/build/enum/article-method.enum.js +55 -0
- package/build/enum/co-document-type.enum.d.ts +2 -1
- package/build/enum/co-document-type.enum.js +1 -0
- package/build/enum/file-type.enum.d.ts +3 -1
- package/build/enum/file-type.enum.js +2 -0
- package/build/enum/good-type.d.ts +21 -0
- package/build/enum/good-type.js +25 -0
- package/build/main-api-connection.d.ts +4 -1
- package/build/main-api.d.ts +4 -1
- package/build/main-api.js +9 -0
- package/build/main-auth.d.ts +15 -8
- package/build/main-auth.js +109 -0
- package/build/main-public.d.ts +17 -11
- package/build/main-public.js +96 -3
- package/build/model/activity.bo.d.ts +1 -1
- package/build/model/category.bo.d.ts +1 -1
- package/build/model/{co-document.d.ts → co-document.bo.d.ts} +4 -1
- package/build/model/{co-document.js → co-document.bo.js} +60 -13
- package/build/model/co-report.bo.d.ts +1 -1
- package/build/model/co-report.bo.js +2 -2
- package/build/model/constant/ref-code-class-to-domain-name-map.d.ts +2 -0
- package/build/model/constant/ref-code-class-to-domain-name-map.js +12 -0
- package/build/model/image-content.bo.d.ts +5 -0
- package/build/model/image-content.bo.js +6 -0
- package/build/model/relation-small-object.bo.d.ts +1 -1
- package/build/model/relation-small-object.bo.js +3 -3
- package/build/model/remark.bo.d.ts +1 -1
- package/build/model/remark.bo.js +2 -2
- package/build/model/tag-tree-item.bo.d.ts +1 -1
- package/build/model/tag-tree-item.bo.js +3 -3
- package/build/model/tag.d.ts +1 -1
- package/build/model/tag.js +3 -3
- package/build/model/task.bo.d.ts +1 -1
- package/build/model/task.bo.js +2 -2
- package/build/model/work.bo.d.ts +1 -1
- package/build/model/work.bo.js +2 -2
- package/build/utils/file-utils.d.ts +1 -1
- package/build/utils/file-utils.js +5 -5
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare enum ArticleMethod {
|
|
2
|
+
GetArtSubnodeCount = "getArtSubnodeCount",
|
|
3
|
+
GetGoodIdFromArticleNr = "getGoodIdFromArticleNr",
|
|
4
|
+
GetArticleNrFromGoodId = "getArticleNrFromGoodId",
|
|
5
|
+
GetArticleCount = "getArticleCount",
|
|
6
|
+
GetArticleTree = "getArticleTree",
|
|
7
|
+
CheckChangableUnit = "checkChangableUnit",
|
|
8
|
+
InitNode = "initNode",
|
|
9
|
+
InitNodeInstance = "InitNodeInstance",
|
|
10
|
+
CopyInstance = "copyInstance",
|
|
11
|
+
ChangeInstance = "changeInstance",
|
|
12
|
+
StoreInstance = "storeInstance",
|
|
13
|
+
NextNode = "nextNode",
|
|
14
|
+
NextCombNode = "nextCombNode",
|
|
15
|
+
PrevNode = "prevNode",
|
|
16
|
+
Back2Node = "back2Node",
|
|
17
|
+
CancelBack2Node = "cancelBack2Node",
|
|
18
|
+
CheckOptRequired = "checkOptRequired",
|
|
19
|
+
RepeatOption = "repeatOption",
|
|
20
|
+
CopyOption = "copyOption",
|
|
21
|
+
CancelRepeat = "cancelRepeat",
|
|
22
|
+
GetStructure = "getStructure",
|
|
23
|
+
GetImgIdForNode = "getImgIdForNode",
|
|
24
|
+
GetCurrentNodesState = "getCurrentNodesState",
|
|
25
|
+
CheckUsedInTransaction = "checkUsedInTransaction",
|
|
26
|
+
ArticleNrExists = "articleNrExists",
|
|
27
|
+
GenerateFrozenArticle = "generateFrozenArticle",
|
|
28
|
+
GetLastFrozenArticle = "getLastFrozenArticle",
|
|
29
|
+
GetLastFrozenArticleArray = "getLastFrozenArticleArray",
|
|
30
|
+
GetCompositionArticles = "getCompositionArticles",
|
|
31
|
+
GetArticlesByBcArtNrEan = "getArticlesByBcArtNrEan",
|
|
32
|
+
ArticleQuickInsert = "articleQuickInsert",
|
|
33
|
+
ArticleQuickSel = "articleQuickSel",
|
|
34
|
+
SuperArtQuickSel = "superArtQuickSel",
|
|
35
|
+
DeactivateArticle = "deactivateArticle",
|
|
36
|
+
ActivateArticle = "activateArticle",
|
|
37
|
+
GetArticleTypes = "getArticleTypes",
|
|
38
|
+
GenerateSeoValues = "generateSeoValues",
|
|
39
|
+
GetSingleImage = "getSingleImage",
|
|
40
|
+
GetImageForSelectorNode = "getImageForSelectorNode",
|
|
41
|
+
GetArtStockStatus = "getArtStockStatus",
|
|
42
|
+
GetArticleDistribution = "getArticleDistribution",
|
|
43
|
+
CheckArticleUsage = "checkArticleUsage",
|
|
44
|
+
ManageEanCode = "manageEanCode",
|
|
45
|
+
SelectorActiveNodes = "selectorActiveNodes",
|
|
46
|
+
NavigateTo = "navigateTo",
|
|
47
|
+
SelectorMatchTable = "selectorMatchTabel",
|
|
48
|
+
GetAnswerTexts = "getAnswerTexts",
|
|
49
|
+
PrintPriceStickers = "printPriceStickers",
|
|
50
|
+
getGeneratedArtDirectly = "getGeneratedArtDirectly"
|
|
51
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArticleMethod = void 0;
|
|
4
|
+
var ArticleMethod;
|
|
5
|
+
(function (ArticleMethod) {
|
|
6
|
+
ArticleMethod["GetArtSubnodeCount"] = "getArtSubnodeCount";
|
|
7
|
+
ArticleMethod["GetGoodIdFromArticleNr"] = "getGoodIdFromArticleNr";
|
|
8
|
+
ArticleMethod["GetArticleNrFromGoodId"] = "getArticleNrFromGoodId";
|
|
9
|
+
ArticleMethod["GetArticleCount"] = "getArticleCount";
|
|
10
|
+
ArticleMethod["GetArticleTree"] = "getArticleTree";
|
|
11
|
+
ArticleMethod["CheckChangableUnit"] = "checkChangableUnit";
|
|
12
|
+
ArticleMethod["InitNode"] = "initNode";
|
|
13
|
+
ArticleMethod["InitNodeInstance"] = "InitNodeInstance";
|
|
14
|
+
ArticleMethod["CopyInstance"] = "copyInstance";
|
|
15
|
+
ArticleMethod["ChangeInstance"] = "changeInstance";
|
|
16
|
+
ArticleMethod["StoreInstance"] = "storeInstance";
|
|
17
|
+
ArticleMethod["NextNode"] = "nextNode";
|
|
18
|
+
ArticleMethod["NextCombNode"] = "nextCombNode";
|
|
19
|
+
ArticleMethod["PrevNode"] = "prevNode";
|
|
20
|
+
ArticleMethod["Back2Node"] = "back2Node";
|
|
21
|
+
ArticleMethod["CancelBack2Node"] = "cancelBack2Node";
|
|
22
|
+
ArticleMethod["CheckOptRequired"] = "checkOptRequired";
|
|
23
|
+
ArticleMethod["RepeatOption"] = "repeatOption";
|
|
24
|
+
ArticleMethod["CopyOption"] = "copyOption";
|
|
25
|
+
ArticleMethod["CancelRepeat"] = "cancelRepeat";
|
|
26
|
+
ArticleMethod["GetStructure"] = "getStructure";
|
|
27
|
+
ArticleMethod["GetImgIdForNode"] = "getImgIdForNode";
|
|
28
|
+
ArticleMethod["GetCurrentNodesState"] = "getCurrentNodesState";
|
|
29
|
+
ArticleMethod["CheckUsedInTransaction"] = "checkUsedInTransaction";
|
|
30
|
+
ArticleMethod["ArticleNrExists"] = "articleNrExists";
|
|
31
|
+
ArticleMethod["GenerateFrozenArticle"] = "generateFrozenArticle";
|
|
32
|
+
ArticleMethod["GetLastFrozenArticle"] = "getLastFrozenArticle";
|
|
33
|
+
ArticleMethod["GetLastFrozenArticleArray"] = "getLastFrozenArticleArray";
|
|
34
|
+
ArticleMethod["GetCompositionArticles"] = "getCompositionArticles";
|
|
35
|
+
ArticleMethod["GetArticlesByBcArtNrEan"] = "getArticlesByBcArtNrEan";
|
|
36
|
+
ArticleMethod["ArticleQuickInsert"] = "articleQuickInsert";
|
|
37
|
+
ArticleMethod["ArticleQuickSel"] = "articleQuickSel";
|
|
38
|
+
ArticleMethod["SuperArtQuickSel"] = "superArtQuickSel";
|
|
39
|
+
ArticleMethod["DeactivateArticle"] = "deactivateArticle";
|
|
40
|
+
ArticleMethod["ActivateArticle"] = "activateArticle";
|
|
41
|
+
ArticleMethod["GetArticleTypes"] = "getArticleTypes";
|
|
42
|
+
ArticleMethod["GenerateSeoValues"] = "generateSeoValues";
|
|
43
|
+
ArticleMethod["GetSingleImage"] = "getSingleImage";
|
|
44
|
+
ArticleMethod["GetImageForSelectorNode"] = "getImageForSelectorNode";
|
|
45
|
+
ArticleMethod["GetArtStockStatus"] = "getArtStockStatus";
|
|
46
|
+
ArticleMethod["GetArticleDistribution"] = "getArticleDistribution";
|
|
47
|
+
ArticleMethod["CheckArticleUsage"] = "checkArticleUsage";
|
|
48
|
+
ArticleMethod["ManageEanCode"] = "manageEanCode";
|
|
49
|
+
ArticleMethod["SelectorActiveNodes"] = "selectorActiveNodes";
|
|
50
|
+
ArticleMethod["NavigateTo"] = "navigateTo";
|
|
51
|
+
ArticleMethod["SelectorMatchTable"] = "selectorMatchTabel";
|
|
52
|
+
ArticleMethod["GetAnswerTexts"] = "getAnswerTexts";
|
|
53
|
+
ArticleMethod["PrintPriceStickers"] = "printPriceStickers";
|
|
54
|
+
ArticleMethod["getGeneratedArtDirectly"] = "getGeneratedArtDirectly";
|
|
55
|
+
})(ArticleMethod = exports.ArticleMethod || (exports.ArticleMethod = {}));
|
|
@@ -6,4 +6,5 @@ var CoDocumentType;
|
|
|
6
6
|
CoDocumentType["SaveAsDocument"] = "BN";
|
|
7
7
|
CoDocumentType["SaveAsLinkOnRandomLocation"] = "LS";
|
|
8
8
|
CoDocumentType["SaveAsLinkOnDefaultLocation"] = "LW";
|
|
9
|
+
CoDocumentType["SaveAsLinkOnCdnServerLocation"] = "CD";
|
|
9
10
|
})(CoDocumentType = exports.CoDocumentType || (exports.CoDocumentType = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum GoodType {
|
|
2
|
+
DeletedGood = "0",
|
|
3
|
+
NonExtraditableArticle = "4",
|
|
4
|
+
DummyArticle = "9",
|
|
5
|
+
Article = "A",
|
|
6
|
+
BaseArticle = "B",
|
|
7
|
+
ConfigurableArticle = "C",
|
|
8
|
+
Service = "D",
|
|
9
|
+
PreviouslyConfiguredArticle = "E",
|
|
10
|
+
LinkAnchorObject = "L",
|
|
11
|
+
CustomArticle = "M",
|
|
12
|
+
Node = "N",
|
|
13
|
+
Option = "O",
|
|
14
|
+
OptionQuestion = "Q",
|
|
15
|
+
UniqueNOV = "R",
|
|
16
|
+
StructureNode = "S",
|
|
17
|
+
TIS = "T",
|
|
18
|
+
OptionValue = "V",
|
|
19
|
+
Exception = "X",
|
|
20
|
+
CompoundGoodPart = "Z"
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoodType = void 0;
|
|
4
|
+
var GoodType;
|
|
5
|
+
(function (GoodType) {
|
|
6
|
+
GoodType["DeletedGood"] = "0";
|
|
7
|
+
GoodType["NonExtraditableArticle"] = "4";
|
|
8
|
+
GoodType["DummyArticle"] = "9";
|
|
9
|
+
GoodType["Article"] = "A";
|
|
10
|
+
GoodType["BaseArticle"] = "B";
|
|
11
|
+
GoodType["ConfigurableArticle"] = "C";
|
|
12
|
+
GoodType["Service"] = "D";
|
|
13
|
+
GoodType["PreviouslyConfiguredArticle"] = "E";
|
|
14
|
+
GoodType["LinkAnchorObject"] = "L";
|
|
15
|
+
GoodType["CustomArticle"] = "M";
|
|
16
|
+
GoodType["Node"] = "N";
|
|
17
|
+
GoodType["Option"] = "O";
|
|
18
|
+
GoodType["OptionQuestion"] = "Q";
|
|
19
|
+
GoodType["UniqueNOV"] = "R";
|
|
20
|
+
GoodType["StructureNode"] = "S";
|
|
21
|
+
GoodType["TIS"] = "T";
|
|
22
|
+
GoodType["OptionValue"] = "V";
|
|
23
|
+
GoodType["Exception"] = "X";
|
|
24
|
+
GoodType["CompoundGoodPart"] = "Z";
|
|
25
|
+
})(GoodType = exports.GoodType || (exports.GoodType = {}));
|
|
@@ -10,7 +10,7 @@ import { Preset } from "./model/preset.bo";
|
|
|
10
10
|
import { ReportType } from './enum/report-type.enum';
|
|
11
11
|
import { ModuleName } from './enum/module-name.enum';
|
|
12
12
|
import { TableName } from "./enum/table-name.enum";
|
|
13
|
-
import { CoDocument } from "./model/co-document";
|
|
13
|
+
import { CoDocument } from "./model/co-document.bo";
|
|
14
14
|
import { Activity } from "./model/activity.bo";
|
|
15
15
|
import { SelectReportTemplatesRequest } from "./model/select-report-templates-request";
|
|
16
16
|
import { EmailJob } from "./model/email-job";
|
|
@@ -80,5 +80,8 @@ export declare abstract class MainApiConnection {
|
|
|
80
80
|
abstract getInternalDefaultValue(param: InternalDefault): Promise<DataServiceResponseData>;
|
|
81
81
|
abstract emailActivity(request: EmailActivityRequest, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
82
82
|
abstract selectMultiple(moduleName: ModuleName, objectName: string, operationName?: string, parameterValues?: any, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
83
|
+
abstract getSingleImage(nodeId: number | string, publication: number, includeMimetype: boolean, thumb: boolean, tableName: TableName): Promise<DataServiceResponseData>;
|
|
84
|
+
abstract getImage(key: number | string, publication: number, includeMimetype: boolean, thumb: boolean, tableName: TableName): Promise<DataServiceResponseData>;
|
|
85
|
+
abstract getImageForCoDocument(document: CoDocument, thumb: boolean): Promise<DataServiceResponseData>;
|
|
83
86
|
protected endPoint: string;
|
|
84
87
|
}
|
package/build/main-api.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { ServerResponseData } from '@colijnit/ioneconnector/build/model/server-r
|
|
|
12
12
|
import { ReportType } from './enum/report-type.enum';
|
|
13
13
|
import { ModuleName } from './enum/module-name.enum';
|
|
14
14
|
import { TableName } from "./enum/table-name.enum";
|
|
15
|
-
import { CoDocument } from "./model/co-document";
|
|
15
|
+
import { CoDocument } from "./model/co-document.bo";
|
|
16
16
|
import { Activity } from "./model/activity.bo";
|
|
17
17
|
import { LoginResponse } from "@colijnit/ioneconnector/build/model/login-response";
|
|
18
18
|
import { SelectReportTemplatesRequest } from "./model/select-report-templates-request";
|
|
@@ -94,6 +94,9 @@ export declare class MainApi {
|
|
|
94
94
|
lockTask(id: number): Promise<DataServiceResponseData>;
|
|
95
95
|
getInternalDefaultValue(param: InternalDefault): Promise<DataServiceResponseData>;
|
|
96
96
|
emailActivity(request: EmailActivityRequest, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
97
|
+
getSingleImage(nodeId: number | string, publication: number, includeMimetype: boolean, thumb: boolean, tableName: TableName): Promise<DataServiceResponseData>;
|
|
98
|
+
getImage(key: number | string, publication: number, includeMimetype: boolean, thumb: boolean, tableName: TableName): Promise<DataServiceResponseData>;
|
|
99
|
+
getImageForCoDocument(document: CoDocument, thumb: boolean): Promise<DataServiceResponseData>;
|
|
97
100
|
static createConnector(isPublicSession: boolean, sessionExists: boolean): MainApiConnection;
|
|
98
101
|
private _handleConnectionReset;
|
|
99
102
|
}
|
package/build/main-api.js
CHANGED
|
@@ -253,6 +253,15 @@ class MainApi {
|
|
|
253
253
|
emailActivity(request, showLoader) {
|
|
254
254
|
return this.mainApi.emailActivity(request, showLoader);
|
|
255
255
|
}
|
|
256
|
+
getSingleImage(nodeId, publication, includeMimetype, thumb, tableName) {
|
|
257
|
+
return this.mainApi.getSingleImage(nodeId, publication, includeMimetype, thumb, tableName);
|
|
258
|
+
}
|
|
259
|
+
getImage(key, publication, includeMimetype, thumb, tableName) {
|
|
260
|
+
return this.mainApi.getImage(key, publication, includeMimetype, thumb, tableName);
|
|
261
|
+
}
|
|
262
|
+
getImageForCoDocument(document, thumb) {
|
|
263
|
+
return this.mainApi.getImageForCoDocument(document, thumb);
|
|
264
|
+
}
|
|
256
265
|
static createConnector(isPublicSession, sessionExists) {
|
|
257
266
|
if (!isPublicSession || sessionExists) {
|
|
258
267
|
return new main_auth_1.MainAuth();
|
package/build/main-auth.d.ts
CHANGED
|
@@ -8,14 +8,14 @@ import { Preset } from './model/preset.bo';
|
|
|
8
8
|
import { TagCategory } from './enum/tab-category.enum';
|
|
9
9
|
import { TagTreeItem } from './model/tag-tree-item.bo';
|
|
10
10
|
import { ReportType } from './enum/report-type.enum';
|
|
11
|
-
import { TableName } from
|
|
12
|
-
import { CoDocument } from
|
|
13
|
-
import { Activity } from
|
|
14
|
-
import { EmailJob } from
|
|
15
|
-
import { SelectReportTemplatesRequest } from
|
|
16
|
-
import { ActivityEmailHistory } from
|
|
17
|
-
import { InternalDefault } from
|
|
18
|
-
import { EmailActivityRequest } from
|
|
11
|
+
import { TableName } from './enum/table-name.enum';
|
|
12
|
+
import { CoDocument } from './model/co-document.bo';
|
|
13
|
+
import { Activity } from './model/activity.bo';
|
|
14
|
+
import { EmailJob } from './model/email-job';
|
|
15
|
+
import { SelectReportTemplatesRequest } from './model/select-report-templates-request';
|
|
16
|
+
import { ActivityEmailHistory } from './model/activity-email-history.bo';
|
|
17
|
+
import { InternalDefault } from './enum/internal-default.enum';
|
|
18
|
+
import { EmailActivityRequest } from './model/email-activity-request';
|
|
19
19
|
export declare class MainAuth extends MainApiConnection {
|
|
20
20
|
private _boSerializer;
|
|
21
21
|
private _boFactory;
|
|
@@ -73,7 +73,14 @@ export declare class MainAuth extends MainApiConnection {
|
|
|
73
73
|
emailReport(printJob: EmailJob): Promise<DataServiceResponseData>;
|
|
74
74
|
getWorkflowProcessInfoPerStatus(workflowCategory: string): Promise<DataServiceResponseData>;
|
|
75
75
|
getInternalDefaultValue(param: InternalDefault): Promise<DataServiceResponseData>;
|
|
76
|
+
getSingleImage(nodeId: number | string, publication?: number, includeMimetype?: boolean, thumb?: boolean, tableName?: TableName): Promise<DataServiceResponseData>;
|
|
77
|
+
getImage(key: number | string, publication?: number, includeMimetype?: boolean, thumb?: boolean, tableName?: TableName): Promise<DataServiceResponseData>;
|
|
78
|
+
getImageForCoDocument(document: CoDocument, thumb?: boolean): Promise<DataServiceResponseData>;
|
|
76
79
|
emailActivity(request: EmailActivityRequest, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
77
80
|
selectMultiple(moduleName: ModuleName, objectName: string, operationName?: string, parameterValues?: any, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
78
81
|
private _call;
|
|
82
|
+
private _callGetSingleImage;
|
|
83
|
+
private _handleDocumentBody;
|
|
84
|
+
private _handleDocumentUrl;
|
|
85
|
+
private _handleCoDocumentRequest;
|
|
79
86
|
}
|
package/build/main-auth.js
CHANGED
|
@@ -30,6 +30,7 @@ const tag_object_enum_1 = require("./enum/tag-object.enum");
|
|
|
30
30
|
const tag_operation_name_enum_1 = require("./enum/tag-operation-name.enum");
|
|
31
31
|
const printing_service_method_1 = require("./enum/printing-service-method");
|
|
32
32
|
const report_object_name_enum_1 = require("./enum/report-object-name.enum");
|
|
33
|
+
const table_name_enum_1 = require("./enum/table-name.enum");
|
|
33
34
|
const document_method_enum_1 = require("./enum/document-method.enum");
|
|
34
35
|
const activities_operation_name_enum_1 = require("./enum/activities-operation-name.enum");
|
|
35
36
|
const activity_type_1 = require("./enum/activity-type");
|
|
@@ -37,6 +38,11 @@ const activities_object_name_enum_1 = require("./enum/activities-object-name.enu
|
|
|
37
38
|
const event_notification_operation_name_enum_1 = require("./enum/event-notification-operation-name.enum");
|
|
38
39
|
const business_object_factory_1 = require("@colijnit/ioneconnector/build/service/business-object-factory");
|
|
39
40
|
const article_enum_1 = require("./enum/article.enum");
|
|
41
|
+
const is_nill_function_1 = require("@colijnit/ioneconnector/build/utils/function/is-nill.function");
|
|
42
|
+
const co_document_type_enum_1 = require("./enum/co-document-type.enum");
|
|
43
|
+
const article_method_enum_1 = require("./enum/article-method.enum");
|
|
44
|
+
const file_utils_1 = require("./utils/file-utils");
|
|
45
|
+
const image_content_bo_1 = require("./model/image-content.bo");
|
|
40
46
|
class MainAuth extends main_api_connection_1.MainApiConnection {
|
|
41
47
|
constructor() {
|
|
42
48
|
super(...arguments);
|
|
@@ -684,6 +690,43 @@ class MainAuth extends main_api_connection_1.MainApiConnection {
|
|
|
684
690
|
return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data);
|
|
685
691
|
});
|
|
686
692
|
}
|
|
693
|
+
getSingleImage(nodeId, publication = 4, includeMimetype = false, thumb = true, tableName = table_name_enum_1.TableName.Goods) {
|
|
694
|
+
return new Promise((resolve, reject) => {
|
|
695
|
+
if ((0, is_nill_function_1.isNill)(nodeId)) {
|
|
696
|
+
resolve();
|
|
697
|
+
}
|
|
698
|
+
const params = {
|
|
699
|
+
table: tableName,
|
|
700
|
+
key: nodeId.toString()
|
|
701
|
+
};
|
|
702
|
+
params.includeBody = thumb === undefined || thumb === false;
|
|
703
|
+
params.includeThumbnail = thumb === true;
|
|
704
|
+
params.publication = publication;
|
|
705
|
+
resolve(this._callGetSingleImage(params));
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
getImage(key, publication = 4, includeMimetype = false, thumb = true, tableName = table_name_enum_1.TableName.Goods) {
|
|
709
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
710
|
+
const getImageObject = yield this.getSingleImage(key, publication, includeMimetype, thumb, tableName);
|
|
711
|
+
if (getImageObject.validationResult && getImageObject.validationResult.success) {
|
|
712
|
+
if (getImageObject.resultObject) {
|
|
713
|
+
const document = getImageObject.resultObject;
|
|
714
|
+
const type = document.documentType;
|
|
715
|
+
const fileType = document.fileType;
|
|
716
|
+
const hasPublicAccess = document.hasPublicAccess;
|
|
717
|
+
return this._handleCoDocumentRequest(type, fileType, hasPublicAccess, document.documentId, document.mimeTypeInternal, thumb, document.filePath);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
getImageForCoDocument(document, thumb = false) {
|
|
723
|
+
if (document) {
|
|
724
|
+
const type = document.documentType;
|
|
725
|
+
const fileType = document.fileType;
|
|
726
|
+
const hasPublicAccess = document.hasPublicAccess;
|
|
727
|
+
return this._handleCoDocumentRequest(type, fileType, hasPublicAccess, document.documentId, document.mimeTypeInternal, thumb, document.filePath);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
687
730
|
emailActivity(request, showLoader) {
|
|
688
731
|
const data = {
|
|
689
732
|
moduleName: module_name_enum_1.ModuleName.ReportingDocuments,
|
|
@@ -714,5 +757,71 @@ class MainAuth extends main_api_connection_1.MainApiConnection {
|
|
|
714
757
|
return this.connector.call(method, data, showLoader, service, this.endPoint);
|
|
715
758
|
});
|
|
716
759
|
}
|
|
760
|
+
_callGetSingleImage(params) {
|
|
761
|
+
const data = {
|
|
762
|
+
methodName: article_method_enum_1.ArticleMethod.GetSingleImage,
|
|
763
|
+
moduleName: module_name_enum_1.ModuleName.Articles,
|
|
764
|
+
refCursorAsArray: true,
|
|
765
|
+
parameterValues: params
|
|
766
|
+
};
|
|
767
|
+
return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data);
|
|
768
|
+
}
|
|
769
|
+
_handleDocumentBody(documentId, mimeType, thumb, fileType) {
|
|
770
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
771
|
+
const returnObject = new data_service_response_data_1.DataServiceResponseData();
|
|
772
|
+
const documentBody = yield this.getDocumentContent(documentId, thumb);
|
|
773
|
+
const imageObject = new image_content_bo_1.ImageContent();
|
|
774
|
+
if (mimeType === undefined) {
|
|
775
|
+
mimeType = 'image/jpeg';
|
|
776
|
+
}
|
|
777
|
+
imageObject.mimeType = mimeType;
|
|
778
|
+
imageObject.fileType = fileType;
|
|
779
|
+
if (documentBody && documentBody.validationResult.success) {
|
|
780
|
+
returnObject.validationResult.success = true;
|
|
781
|
+
imageObject.image = file_utils_1.FileUtils.DocumentBodyToDataUri(documentBody.resultObject.documentContent, mimeType);
|
|
782
|
+
returnObject.resultObject = imageObject;
|
|
783
|
+
}
|
|
784
|
+
else {
|
|
785
|
+
returnObject.validationResult.success = false;
|
|
786
|
+
imageObject.image = null;
|
|
787
|
+
returnObject.resultObject = imageObject;
|
|
788
|
+
}
|
|
789
|
+
return returnObject;
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
_handleDocumentUrl(url, fileType) {
|
|
793
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
794
|
+
const returnObject = new data_service_response_data_1.DataServiceResponseData();
|
|
795
|
+
const imageObject = new image_content_bo_1.ImageContent();
|
|
796
|
+
imageObject.fileType = fileType;
|
|
797
|
+
if (url) {
|
|
798
|
+
returnObject.validationResult.success = true;
|
|
799
|
+
imageObject.image = url;
|
|
800
|
+
returnObject.resultObject = imageObject;
|
|
801
|
+
}
|
|
802
|
+
else {
|
|
803
|
+
returnObject.validationResult.success = false;
|
|
804
|
+
imageObject.image = null;
|
|
805
|
+
returnObject.resultObject = imageObject;
|
|
806
|
+
}
|
|
807
|
+
return returnObject;
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
_handleCoDocumentRequest(type, fileType, hasPublicAccess, documentId, mimeType, thumb, filePath) {
|
|
811
|
+
if (type === co_document_type_enum_1.CoDocumentType.SaveAsDocument) {
|
|
812
|
+
return this._handleDocumentBody(documentId, mimeType, thumb, fileType);
|
|
813
|
+
}
|
|
814
|
+
else if (type === co_document_type_enum_1.CoDocumentType.SaveAsLinkOnRandomLocation) {
|
|
815
|
+
return this._handleDocumentUrl(filePath, fileType);
|
|
816
|
+
}
|
|
817
|
+
else if (type === co_document_type_enum_1.CoDocumentType.SaveAsLinkOnDefaultLocation) {
|
|
818
|
+
}
|
|
819
|
+
else if (type === co_document_type_enum_1.CoDocumentType.SaveAsLinkOnCdnServerLocation && hasPublicAccess === 'T') {
|
|
820
|
+
return this._handleDocumentUrl(filePath, fileType);
|
|
821
|
+
}
|
|
822
|
+
else if (type === co_document_type_enum_1.CoDocumentType.SaveAsLinkOnCdnServerLocation && hasPublicAccess === 'F') {
|
|
823
|
+
return this._handleDocumentBody(documentId, mimeType, thumb, fileType);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
717
826
|
}
|
|
718
827
|
exports.MainAuth = MainAuth;
|
package/build/main-public.d.ts
CHANGED
|
@@ -3,19 +3,19 @@ import { SequenceName } from './enum/sequence-name.enum';
|
|
|
3
3
|
import { DataServiceResponseData } from '@colijnit/ioneconnector/build/model/data-service-response-data';
|
|
4
4
|
import { InternalParam } from './enum/internal-param.enum';
|
|
5
5
|
import { DomainName } from './enum/domain-name.enum';
|
|
6
|
-
import { TagCategory } from
|
|
7
|
-
import { TagTreeItem } from
|
|
8
|
-
import { Preset } from
|
|
6
|
+
import { TagCategory } from './enum/tab-category.enum';
|
|
7
|
+
import { TagTreeItem } from './model/tag-tree-item.bo';
|
|
8
|
+
import { Preset } from './model/preset.bo';
|
|
9
9
|
import { ReportType } from './enum/report-type.enum';
|
|
10
10
|
import { ModuleName } from './enum/module-name.enum';
|
|
11
|
-
import { TableName } from
|
|
12
|
-
import { CoDocument } from
|
|
13
|
-
import { Activity } from
|
|
14
|
-
import { SelectReportTemplatesRequest } from
|
|
15
|
-
import { EmailJob } from
|
|
16
|
-
import { ActivityEmailHistory } from
|
|
17
|
-
import { InternalDefault } from
|
|
18
|
-
import { EmailActivityRequest } from
|
|
11
|
+
import { TableName } from './enum/table-name.enum';
|
|
12
|
+
import { CoDocument } from './model/co-document.bo';
|
|
13
|
+
import { Activity } from './model/activity.bo';
|
|
14
|
+
import { SelectReportTemplatesRequest } from './model/select-report-templates-request';
|
|
15
|
+
import { EmailJob } from './model/email-job';
|
|
16
|
+
import { ActivityEmailHistory } from './model/activity-email-history.bo';
|
|
17
|
+
import { InternalDefault } from './enum/internal-default.enum';
|
|
18
|
+
import { EmailActivityRequest } from './model/email-activity-request';
|
|
19
19
|
export declare class MainPublic extends MainApiConnection {
|
|
20
20
|
protected endPoint: string;
|
|
21
21
|
getSequenceValue(sequenceName: SequenceName, noSequence?: boolean): Promise<DataServiceResponseData>;
|
|
@@ -74,7 +74,13 @@ export declare class MainPublic extends MainApiConnection {
|
|
|
74
74
|
getInternalDefaultValue(param: InternalDefault): Promise<DataServiceResponseData>;
|
|
75
75
|
emailActivity(request: EmailActivityRequest, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
76
76
|
selectMultiple(moduleName: ModuleName, objectName: string, operationName?: string, parameterValues?: any, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
77
|
+
getSingleImage(nodeId: number | string, publication?: number, includeMimetype?: boolean, thumb?: boolean, tableName?: TableName): Promise<DataServiceResponseData>;
|
|
78
|
+
getImage(key: number | string, publication?: number, includeMimetype?: boolean, thumb?: boolean): Promise<DataServiceResponseData>;
|
|
79
|
+
getImageForCoDocument(document: CoDocument, thumb?: boolean): Promise<DataServiceResponseData>;
|
|
77
80
|
private createServiceRequestData;
|
|
78
81
|
private _call;
|
|
79
82
|
private _callAjaxService;
|
|
83
|
+
private _handleDocumentBody;
|
|
84
|
+
private _handleDocumentUrl;
|
|
85
|
+
private _handleCoDocumentRequest;
|
|
80
86
|
}
|
package/build/main-public.js
CHANGED
|
@@ -15,6 +15,10 @@ const end_point_enum_1 = require("@colijnit/ioneconnector/build/enum/end-point.e
|
|
|
15
15
|
const public_service_method_1 = require("./enum/public-service-method");
|
|
16
16
|
const data_service_response_data_1 = require("@colijnit/ioneconnector/build/model/data-service-response-data");
|
|
17
17
|
const backend_service_name_enum_1 = require("./enum/backend-service-name.enum");
|
|
18
|
+
const table_name_enum_1 = require("./enum/table-name.enum");
|
|
19
|
+
const co_document_type_enum_1 = require("./enum/co-document-type.enum");
|
|
20
|
+
const image_content_bo_1 = require("./model/image-content.bo");
|
|
21
|
+
const file_utils_1 = require("./utils/file-utils");
|
|
18
22
|
class MainPublic extends main_api_connection_1.MainApiConnection {
|
|
19
23
|
constructor() {
|
|
20
24
|
super(...arguments);
|
|
@@ -107,10 +111,10 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
|
|
|
107
111
|
const message = {
|
|
108
112
|
service: backend_service_name_enum_1.BackendServiceName.PublicService,
|
|
109
113
|
method: public_service_method_1.PublicServiceMethod.GetPublicParams,
|
|
110
|
-
id:
|
|
114
|
+
id: '1',
|
|
111
115
|
data: data,
|
|
112
|
-
windowSessionId:
|
|
113
|
-
sessionId:
|
|
116
|
+
windowSessionId: '1',
|
|
117
|
+
sessionId: '1'
|
|
114
118
|
};
|
|
115
119
|
return this._callAjaxService(public_service_method_1.PublicServiceMethod.GetPublicParams, data, backend_service_name_enum_1.BackendServiceName.PublicService, false, message);
|
|
116
120
|
}
|
|
@@ -297,6 +301,38 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
|
|
|
297
301
|
console.warn('getOrderLineSetCategories not implemented');
|
|
298
302
|
return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
|
|
299
303
|
}
|
|
304
|
+
getSingleImage(nodeId, publication = 4, includeMimetype = false, thumb = true, tableName = table_name_enum_1.TableName.Goods) {
|
|
305
|
+
if (!nodeId) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const params = {
|
|
309
|
+
table: tableName,
|
|
310
|
+
key: nodeId.toString(),
|
|
311
|
+
includeBody: thumb === undefined || thumb === false,
|
|
312
|
+
includeThumbnail: thumb === true,
|
|
313
|
+
publication: publication
|
|
314
|
+
};
|
|
315
|
+
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
|
|
316
|
+
return this._call(public_service_method_1.PublicServiceMethod.GetSingleImage, data);
|
|
317
|
+
}
|
|
318
|
+
getImage(key, publication = 4, includeMimetype = false, thumb = true) {
|
|
319
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
320
|
+
const getImageObject = yield this.getSingleImage(key, publication, includeMimetype, thumb, table_name_enum_1.TableName.Goods);
|
|
321
|
+
if (getImageObject.validationResult && getImageObject.validationResult.success) {
|
|
322
|
+
if (getImageObject.resultObject) {
|
|
323
|
+
const document = getImageObject.resultObject;
|
|
324
|
+
const type = document.documentType;
|
|
325
|
+
const fileType = document.fileType;
|
|
326
|
+
const hasPublicAccess = document.hasPublicAccess;
|
|
327
|
+
return this._handleCoDocumentRequest(type, fileType, hasPublicAccess, document.documentId, document.mimeTypeInternal, thumb, document.filePath);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
getImageForCoDocument(document, thumb = false) {
|
|
333
|
+
console.warn('getImageForCoDocument not implemented');
|
|
334
|
+
return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
|
|
335
|
+
}
|
|
300
336
|
createServiceRequestData() {
|
|
301
337
|
const data = { languageCode: this.languageCode };
|
|
302
338
|
return data;
|
|
@@ -311,5 +347,62 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
|
|
|
311
347
|
return this.connector.call(method, data, showLoader, service, end_point_enum_1.EndPoint.AjaxService, ownMessage);
|
|
312
348
|
});
|
|
313
349
|
}
|
|
350
|
+
_handleDocumentBody(documentId, mimeType, thumb, fileType) {
|
|
351
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
+
const returnObject = new data_service_response_data_1.DataServiceResponseData();
|
|
353
|
+
const documentBody = yield this.getDocumentContent(documentId, thumb);
|
|
354
|
+
const imageObject = new image_content_bo_1.ImageContent();
|
|
355
|
+
if (mimeType === undefined) {
|
|
356
|
+
mimeType = 'image/jpeg';
|
|
357
|
+
}
|
|
358
|
+
imageObject.mimeType = mimeType;
|
|
359
|
+
imageObject.fileType = fileType;
|
|
360
|
+
if (documentBody && documentBody.validationResult.success) {
|
|
361
|
+
returnObject.validationResult.success = true;
|
|
362
|
+
imageObject.image = file_utils_1.FileUtils.DocumentBodyToDataUri(documentBody.resultObject.documentContent, mimeType);
|
|
363
|
+
returnObject.resultObject = imageObject;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
returnObject.validationResult.success = false;
|
|
367
|
+
imageObject.image = null;
|
|
368
|
+
returnObject.resultObject = imageObject;
|
|
369
|
+
}
|
|
370
|
+
return returnObject;
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
_handleDocumentUrl(url, fileType) {
|
|
374
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
375
|
+
const returnObject = new data_service_response_data_1.DataServiceResponseData();
|
|
376
|
+
const imageObject = new image_content_bo_1.ImageContent();
|
|
377
|
+
imageObject.fileType = fileType;
|
|
378
|
+
if (url) {
|
|
379
|
+
returnObject.validationResult.success = true;
|
|
380
|
+
imageObject.image = url;
|
|
381
|
+
returnObject.resultObject = imageObject;
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
returnObject.validationResult.success = false;
|
|
385
|
+
imageObject.image = null;
|
|
386
|
+
returnObject.resultObject = imageObject;
|
|
387
|
+
}
|
|
388
|
+
return returnObject;
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
_handleCoDocumentRequest(type, fileType, hasPublicAccess, documentId, mimeType, thumb, filePath) {
|
|
392
|
+
if (type === co_document_type_enum_1.CoDocumentType.SaveAsDocument) {
|
|
393
|
+
return this._handleDocumentBody(documentId, mimeType, thumb, fileType);
|
|
394
|
+
}
|
|
395
|
+
else if (type === co_document_type_enum_1.CoDocumentType.SaveAsLinkOnRandomLocation) {
|
|
396
|
+
return this._handleDocumentUrl(filePath, fileType);
|
|
397
|
+
}
|
|
398
|
+
else if (type === co_document_type_enum_1.CoDocumentType.SaveAsLinkOnDefaultLocation) {
|
|
399
|
+
}
|
|
400
|
+
else if (type === co_document_type_enum_1.CoDocumentType.SaveAsLinkOnCdnServerLocation && hasPublicAccess === 'T') {
|
|
401
|
+
return this._handleDocumentUrl(filePath, fileType);
|
|
402
|
+
}
|
|
403
|
+
else if (type === co_document_type_enum_1.CoDocumentType.SaveAsLinkOnCdnServerLocation && hasPublicAccess === 'F') {
|
|
404
|
+
return this._handleDocumentBody(documentId, mimeType, thumb, fileType);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
314
407
|
}
|
|
315
408
|
exports.MainPublic = MainPublic;
|
|
@@ -3,7 +3,7 @@ import { ActivityType } from "../enum/activity-type";
|
|
|
3
3
|
import { Workflow } from "./workflow.bo";
|
|
4
4
|
import { Task } from "./task.bo";
|
|
5
5
|
import { Work } from "./work.bo";
|
|
6
|
-
import { CoDocument } from "./co-document";
|
|
6
|
+
import { CoDocument } from "./co-document.bo";
|
|
7
7
|
import { RelationSmallObject } from "./relation-small-object.bo";
|
|
8
8
|
import { Remark } from "./remark.bo";
|
|
9
9
|
import { Transition } from "./transition.bo";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
|
|
2
|
-
import { CoDocument } from "./co-document";
|
|
2
|
+
import { CoDocument } from "./co-document.bo";
|
|
3
3
|
export declare class Category extends BusinessObject {
|
|
4
4
|
categoryCode: string;
|
|
5
5
|
description: string;
|
|
@@ -2,11 +2,11 @@ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-obj
|
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import { CoDocumentType } from '../enum/co-document-type.enum';
|
|
4
4
|
import { FileType } from '../enum/file-type.enum';
|
|
5
|
-
import { CoDocumentRight } from './co-document-right';
|
|
6
5
|
import { Tag } from './tag';
|
|
7
6
|
import { ArticleSeoValue } from './article-seo-value';
|
|
8
7
|
import { FileTypeInternal } from '../enum/file-type-internal.enum';
|
|
9
8
|
import { ObjectRightType } from '@colijnit/ioneconnector/build/enum/object-right-type.enum';
|
|
9
|
+
import { CoDocumentRight } from './co-document-right';
|
|
10
10
|
export declare class CoDocument extends BusinessObject {
|
|
11
11
|
set documentId(value: number);
|
|
12
12
|
get documentId(): number;
|
|
@@ -32,11 +32,13 @@ export declare class CoDocument extends BusinessObject {
|
|
|
32
32
|
downloadable: boolean;
|
|
33
33
|
attachToNotification: boolean;
|
|
34
34
|
pathIsUrl: boolean;
|
|
35
|
+
hasPublicAccess: string;
|
|
35
36
|
imageType: string;
|
|
36
37
|
imageDisplayKind: string;
|
|
37
38
|
tags: Tag[];
|
|
38
39
|
rightLevel: ObjectRightType;
|
|
39
40
|
rights: CoDocumentRight[];
|
|
41
|
+
convertToUSDZ: boolean;
|
|
40
42
|
set documentBody(documentBody: string);
|
|
41
43
|
get documentBody(): string;
|
|
42
44
|
seoTitles: ArticleSeoValue[];
|
|
@@ -61,4 +63,5 @@ export declare class CoDocument extends BusinessObject {
|
|
|
61
63
|
getId(): any;
|
|
62
64
|
isImageDocument(): boolean;
|
|
63
65
|
private _initMimetypeInternal;
|
|
66
|
+
isStoredAsLink(): boolean;
|
|
64
67
|
}
|
|
@@ -16,8 +16,8 @@ const no_db_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/d
|
|
|
16
16
|
const db_field_alias_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/db-field-alias.decorator");
|
|
17
17
|
const date_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/date-field.decorator");
|
|
18
18
|
const rxjs_1 = require("rxjs");
|
|
19
|
+
const co_document_type_enum_1 = require("../enum/co-document-type.enum");
|
|
19
20
|
const file_type_enum_1 = require("../enum/file-type.enum");
|
|
20
|
-
const co_document_right_1 = require("./co-document-right");
|
|
21
21
|
const tag_1 = require("./tag");
|
|
22
22
|
const article_seo_value_1 = require("./article-seo-value");
|
|
23
23
|
const file_type_internal_enum_1 = require("../enum/file-type-internal.enum");
|
|
@@ -26,7 +26,15 @@ const object_right_type_enum_1 = require("@colijnit/ioneconnector/build/enum/obj
|
|
|
26
26
|
const file_utils_1 = require("../utils/file-utils");
|
|
27
27
|
const co_document_image_display_kind_enum_1 = require("../enum/co-document-image-display-kind.enum");
|
|
28
28
|
const complex_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-field.decorator");
|
|
29
|
-
|
|
29
|
+
const business_object_data_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/business-object-data.decorator");
|
|
30
|
+
const data_mapping_enum_1 = require("../enum/data-mapping.enum");
|
|
31
|
+
const search_property_state_enum_1 = require("@colijnit/ioneconnector/build/enum/search-property-state.enum");
|
|
32
|
+
const filter_type_enum_1 = require("@colijnit/ioneconnector/build/enum/filter-type.enum");
|
|
33
|
+
const sort_type_enum_1 = require("@colijnit/ioneconnector/build/enum/sort-type.enum");
|
|
34
|
+
const sort_direction_1 = require("@colijnit/ioneconnector/build/enum/sort-direction");
|
|
35
|
+
const ref_code_class_to_domain_name_map_1 = require("./constant/ref-code-class-to-domain-name-map");
|
|
36
|
+
const co_document_right_1 = require("./co-document-right");
|
|
37
|
+
let CoDocument = class CoDocument extends business_object_1.BusinessObject {
|
|
30
38
|
set documentId(value) {
|
|
31
39
|
this._documentId = value;
|
|
32
40
|
this._idObject.docId = value;
|
|
@@ -42,6 +50,9 @@ class CoDocument extends business_object_1.BusinessObject {
|
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
get documentBody() {
|
|
53
|
+
if (this.isStoredAsLink()) {
|
|
54
|
+
return this.filePath;
|
|
55
|
+
}
|
|
45
56
|
return this._documentBody;
|
|
46
57
|
}
|
|
47
58
|
get fileTypeInternal() {
|
|
@@ -75,18 +86,26 @@ class CoDocument extends business_object_1.BusinessObject {
|
|
|
75
86
|
}
|
|
76
87
|
get documentBodyAsDataUri() {
|
|
77
88
|
try {
|
|
78
|
-
|
|
89
|
+
if (this.isStoredAsLink()) {
|
|
90
|
+
return this.filePath;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return file_utils_1.FileUtils.DocumentBodyToDataUri(this.documentBody, this.mimeTypeInternal);
|
|
94
|
+
}
|
|
79
95
|
}
|
|
80
96
|
catch (error) {
|
|
81
|
-
return
|
|
97
|
+
return '';
|
|
82
98
|
}
|
|
83
99
|
}
|
|
84
100
|
get thumbnailBodyAsDataUri() {
|
|
85
101
|
try {
|
|
102
|
+
if (this.isStoredAsLink()) {
|
|
103
|
+
return this.filePath;
|
|
104
|
+
}
|
|
86
105
|
return file_utils_1.FileUtils.DocumentBodyToDataUri(this.thumbnailBody, this.mimeTypeInternal);
|
|
87
106
|
}
|
|
88
107
|
catch (error) {
|
|
89
|
-
return
|
|
108
|
+
return '';
|
|
90
109
|
}
|
|
91
110
|
}
|
|
92
111
|
get isAvatar() {
|
|
@@ -98,6 +117,7 @@ class CoDocument extends business_object_1.BusinessObject {
|
|
|
98
117
|
constructor(rawData = {}) {
|
|
99
118
|
super();
|
|
100
119
|
this.pathIsUrl = false;
|
|
120
|
+
this.hasPublicAccess = 'F';
|
|
101
121
|
this.tags = [];
|
|
102
122
|
this.rights = [];
|
|
103
123
|
this.seoTitles = [];
|
|
@@ -113,11 +133,16 @@ class CoDocument extends business_object_1.BusinessObject {
|
|
|
113
133
|
}
|
|
114
134
|
_initMimetypeInternal() {
|
|
115
135
|
if ((this.fileType === file_type_enum_1.FileType.Image || !this.fileType) && this.fileName) {
|
|
116
|
-
const fileExtension = this.fileName.substr(this.fileName.lastIndexOf(
|
|
117
|
-
this._mimeTypeInternal =
|
|
136
|
+
const fileExtension = this.fileName.substr(this.fileName.lastIndexOf('.') + 1);
|
|
137
|
+
this._mimeTypeInternal = 'image/' + fileExtension;
|
|
118
138
|
}
|
|
119
139
|
}
|
|
120
|
-
|
|
140
|
+
isStoredAsLink() {
|
|
141
|
+
return this.documentType == co_document_type_enum_1.CoDocumentType.SaveAsLinkOnRandomLocation
|
|
142
|
+
|| this.documentType == co_document_type_enum_1.CoDocumentType.SaveAsLinkOnDefaultLocation
|
|
143
|
+
|| (this.documentType == co_document_type_enum_1.CoDocumentType.SaveAsLinkOnCdnServerLocation && this.hasPublicAccess === 'T');
|
|
144
|
+
}
|
|
145
|
+
};
|
|
121
146
|
__decorate([
|
|
122
147
|
(0, date_field_decorator_1.DateField)(),
|
|
123
148
|
__metadata("design:type", Date)
|
|
@@ -127,15 +152,15 @@ __decorate([
|
|
|
127
152
|
__metadata("design:type", Date)
|
|
128
153
|
], CoDocument.prototype, "modifiedDate", void 0);
|
|
129
154
|
__decorate([
|
|
130
|
-
(0, boolean_decorator_1.BooleanText)(
|
|
155
|
+
(0, boolean_decorator_1.BooleanText)('T'),
|
|
131
156
|
__metadata("design:type", Boolean)
|
|
132
157
|
], CoDocument.prototype, "downloadable", void 0);
|
|
133
158
|
__decorate([
|
|
134
|
-
(0, boolean_decorator_1.BooleanText)(
|
|
159
|
+
(0, boolean_decorator_1.BooleanText)('T'),
|
|
135
160
|
__metadata("design:type", Boolean)
|
|
136
161
|
], CoDocument.prototype, "attachToNotification", void 0);
|
|
137
162
|
__decorate([
|
|
138
|
-
(0, boolean_decorator_1.BooleanText)(
|
|
163
|
+
(0, boolean_decorator_1.BooleanText)('T'),
|
|
139
164
|
__metadata("design:type", Boolean)
|
|
140
165
|
], CoDocument.prototype, "pathIsUrl", void 0);
|
|
141
166
|
__decorate([
|
|
@@ -146,6 +171,10 @@ __decorate([
|
|
|
146
171
|
(0, complex_array_decorator_1.ComplexArray)(co_document_right_1.CoDocumentRight),
|
|
147
172
|
__metadata("design:type", Array)
|
|
148
173
|
], CoDocument.prototype, "rights", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
(0, no_db_field_decorator_1.NoDbField)(),
|
|
176
|
+
__metadata("design:type", Boolean)
|
|
177
|
+
], CoDocument.prototype, "convertToUSDZ", void 0);
|
|
149
178
|
__decorate([
|
|
150
179
|
(0, complex_array_decorator_1.ComplexArray)(article_seo_value_1.ArticleSeoValue),
|
|
151
180
|
__metadata("design:type", Array)
|
|
@@ -155,11 +184,11 @@ __decorate([
|
|
|
155
184
|
__metadata("design:type", Number)
|
|
156
185
|
], CoDocument.prototype, "idForLink", void 0);
|
|
157
186
|
__decorate([
|
|
158
|
-
(0, db_field_alias_decorator_1.DbFieldAlias)(
|
|
187
|
+
(0, db_field_alias_decorator_1.DbFieldAlias)('documentBody'),
|
|
159
188
|
__metadata("design:type", String)
|
|
160
189
|
], CoDocument.prototype, "_documentBody", void 0);
|
|
161
190
|
__decorate([
|
|
162
|
-
(0, db_field_alias_decorator_1.DbFieldAlias)(
|
|
191
|
+
(0, db_field_alias_decorator_1.DbFieldAlias)('documentId'),
|
|
163
192
|
__metadata("design:type", Number)
|
|
164
193
|
], CoDocument.prototype, "_documentId", void 0);
|
|
165
194
|
__decorate([
|
|
@@ -179,4 +208,22 @@ __decorate([
|
|
|
179
208
|
(0, no_db_field_decorator_1.NoDbField)(),
|
|
180
209
|
__metadata("design:type", Object)
|
|
181
210
|
], CoDocument.prototype, "_idObject", void 0);
|
|
211
|
+
CoDocument = __decorate([
|
|
212
|
+
(0, business_object_data_decorator_1.BusinessObjectData)({
|
|
213
|
+
name: "CoDocument",
|
|
214
|
+
mapping: data_mapping_enum_1.DataMapping.General,
|
|
215
|
+
groupField: "fileType",
|
|
216
|
+
groupDomainName: ref_code_class_to_domain_name_map_1.RefCodeClassToDomainNameMap.get(file_type_enum_1.FileType),
|
|
217
|
+
searchProperties: [
|
|
218
|
+
{ property: "fileName", state: search_property_state_enum_1.SearchPropertyState.LockedActive, label: "FILE_NAME" }
|
|
219
|
+
],
|
|
220
|
+
filterProperties: [
|
|
221
|
+
{ property: "downloadable", type: filter_type_enum_1.FilterType.BooleanSimple, label: "DOWNLOADABLE", active: false, valuePass: true }
|
|
222
|
+
],
|
|
223
|
+
sortProperties: [
|
|
224
|
+
{ property: "fileName", label: "FILE_NAME", active: false, type: sort_type_enum_1.SortType.String, direction: sort_direction_1.SortDirection.Ascending }
|
|
225
|
+
]
|
|
226
|
+
}),
|
|
227
|
+
__metadata("design:paramtypes", [Object])
|
|
228
|
+
], CoDocument);
|
|
182
229
|
exports.CoDocument = CoDocument;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SendMethod } from './send-method.bo';
|
|
2
2
|
import { ReportParam } from './report-param';
|
|
3
|
-
import { CoDocument } from './co-document';
|
|
3
|
+
import { CoDocument } from './co-document.bo';
|
|
4
4
|
import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
|
|
5
5
|
import { CoSubReport } from '../enum/co-sub-report.bo';
|
|
6
6
|
import { CoReportSjablonenDocumenten } from './co-report-sjablonen-documenten.bo';
|
|
@@ -13,7 +13,7 @@ exports.CoReport = void 0;
|
|
|
13
13
|
const date_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/date-field.decorator");
|
|
14
14
|
const report_param_1 = require("./report-param");
|
|
15
15
|
const complex_array_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator");
|
|
16
|
-
const
|
|
16
|
+
const co_document_bo_1 = require("./co-document.bo");
|
|
17
17
|
const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
|
|
18
18
|
const co_sub_report_bo_1 = require("../enum/co-sub-report.bo");
|
|
19
19
|
const co_report_sjablonen_documenten_bo_1 = require("./co-report-sjablonen-documenten.bo");
|
|
@@ -42,7 +42,7 @@ __decorate([
|
|
|
42
42
|
__metadata("design:type", Array)
|
|
43
43
|
], CoReport.prototype, "reportParameters", void 0);
|
|
44
44
|
__decorate([
|
|
45
|
-
(0, complex_array_decorator_1.ComplexArray)(
|
|
45
|
+
(0, complex_array_decorator_1.ComplexArray)(co_document_bo_1.CoDocument),
|
|
46
46
|
__metadata("design:type", Array)
|
|
47
47
|
], CoReport.prototype, "images", void 0);
|
|
48
48
|
__decorate([
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RefCodeClassToDomainNameMap = void 0;
|
|
4
|
+
const domain_name_enum_1 = require("../../enum/domain-name.enum");
|
|
5
|
+
const relation_kind_1 = require("../../enum/relation-kind");
|
|
6
|
+
const file_type_enum_1 = require("../../enum/file-type.enum");
|
|
7
|
+
const good_type_1 = require("../../enum/good-type");
|
|
8
|
+
exports.RefCodeClassToDomainNameMap = new Map([
|
|
9
|
+
[relation_kind_1.RelationKind, domain_name_enum_1.DomainName.RelationType],
|
|
10
|
+
[file_type_enum_1.FileType, domain_name_enum_1.DomainName.FileType],
|
|
11
|
+
[good_type_1.GoodType, domain_name_enum_1.DomainName.GoodType]
|
|
12
|
+
]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
|
|
2
|
-
import { CoDocument } from "./co-document";
|
|
2
|
+
import { CoDocument } from "./co-document.bo";
|
|
3
3
|
import { RelationKind } from "../enum/relation-kind";
|
|
4
4
|
import { RelmanCompleteName } from "../enum/relman-complete-name";
|
|
5
5
|
export declare class RelationSmallObject extends BusinessObject {
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.RelationSmallObject = void 0;
|
|
13
13
|
const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
|
|
14
14
|
const complex_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-field.decorator");
|
|
15
|
-
const
|
|
15
|
+
const co_document_bo_1 = require("./co-document.bo");
|
|
16
16
|
const business_object_utils_1 = require("@colijnit/ioneconnector/build/utils/business-object-utils");
|
|
17
17
|
class RelationSmallObject extends business_object_1.BusinessObject {
|
|
18
18
|
get displayName() {
|
|
@@ -57,7 +57,7 @@ class RelationSmallObject extends business_object_1.BusinessObject {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
__decorate([
|
|
60
|
-
(0, complex_field_decorator_1.ComplexField)(
|
|
61
|
-
__metadata("design:type",
|
|
60
|
+
(0, complex_field_decorator_1.ComplexField)(co_document_bo_1.CoDocument),
|
|
61
|
+
__metadata("design:type", co_document_bo_1.CoDocument)
|
|
62
62
|
], RelationSmallObject.prototype, "image", void 0);
|
|
63
63
|
exports.RelationSmallObject = RelationSmallObject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
|
|
2
2
|
import { RelationSmallObject } from "./relation-small-object.bo";
|
|
3
|
-
import { CoDocument } from "./co-document";
|
|
3
|
+
import { CoDocument } from "./co-document.bo";
|
|
4
4
|
import { TableName } from "../enum/table-name.enum";
|
|
5
5
|
import { ActivityEmailHistory } from "./activity-email-history.bo";
|
|
6
6
|
export declare class Remark extends BusinessObject {
|
package/build/model/remark.bo.js
CHANGED
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Remark = void 0;
|
|
13
13
|
const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
|
|
14
14
|
const relation_small_object_bo_1 = require("./relation-small-object.bo");
|
|
15
|
-
const
|
|
15
|
+
const co_document_bo_1 = require("./co-document.bo");
|
|
16
16
|
const complex_array_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator");
|
|
17
17
|
const date_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/date-field.decorator");
|
|
18
18
|
const boolean_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/boolean.decorator");
|
|
@@ -43,7 +43,7 @@ __decorate([
|
|
|
43
43
|
__metadata("design:type", Date)
|
|
44
44
|
], Remark.prototype, "dateTime", void 0);
|
|
45
45
|
__decorate([
|
|
46
|
-
(0, complex_array_decorator_1.ComplexArray)(
|
|
46
|
+
(0, complex_array_decorator_1.ComplexArray)(co_document_bo_1.CoDocument),
|
|
47
47
|
__metadata("design:type", Array)
|
|
48
48
|
], Remark.prototype, "documents", void 0);
|
|
49
49
|
__decorate([
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TagTreeItem = void 0;
|
|
13
13
|
const data_mapping_enum_1 = require("../enum/data-mapping.enum");
|
|
14
|
-
const
|
|
14
|
+
const co_document_bo_1 = require("./co-document.bo");
|
|
15
15
|
const tree_object_1 = require("./tree-object");
|
|
16
16
|
const business_object_data_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/business-object-data.decorator");
|
|
17
17
|
const search_property_state_enum_1 = require("@colijnit/ioneconnector/build/enum/search-property-state.enum");
|
|
@@ -32,8 +32,8 @@ __decorate([
|
|
|
32
32
|
__metadata("design:type", Date)
|
|
33
33
|
], TagTreeItem.prototype, "creationDate", void 0);
|
|
34
34
|
__decorate([
|
|
35
|
-
(0, complex_field_decorator_1.ComplexField)(
|
|
36
|
-
__metadata("design:type",
|
|
35
|
+
(0, complex_field_decorator_1.ComplexField)(co_document_bo_1.CoDocument),
|
|
36
|
+
__metadata("design:type", co_document_bo_1.CoDocument)
|
|
37
37
|
], TagTreeItem.prototype, "image", void 0);
|
|
38
38
|
TagTreeItem = __decorate([
|
|
39
39
|
(0, business_object_data_decorator_1.BusinessObjectData)({
|
package/build/model/tag.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
|
|
2
|
-
import { CoDocument } from "./co-document";
|
|
2
|
+
import { CoDocument } from "./co-document.bo";
|
|
3
3
|
export declare class Tag extends BusinessObject {
|
|
4
4
|
description: string;
|
|
5
5
|
tagCodeId: number;
|
package/build/model/tag.js
CHANGED
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Tag = void 0;
|
|
13
13
|
const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
|
|
14
|
-
const
|
|
14
|
+
const co_document_bo_1 = require("./co-document.bo");
|
|
15
15
|
const map_property_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/map-property.decorator");
|
|
16
16
|
const complex_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-field.decorator");
|
|
17
17
|
class Tag extends business_object_1.BusinessObject {
|
|
@@ -35,7 +35,7 @@ __decorate([
|
|
|
35
35
|
], Tag.prototype, "tagCodeId", void 0);
|
|
36
36
|
__decorate([
|
|
37
37
|
(0, map_property_decorator_1.MapProperty)('OMSCHRIJVING'),
|
|
38
|
-
(0, complex_field_decorator_1.ComplexField)(
|
|
39
|
-
__metadata("design:type",
|
|
38
|
+
(0, complex_field_decorator_1.ComplexField)(co_document_bo_1.CoDocument),
|
|
39
|
+
__metadata("design:type", co_document_bo_1.CoDocument)
|
|
40
40
|
], Tag.prototype, "image", void 0);
|
|
41
41
|
exports.Tag = Tag;
|
package/build/model/task.bo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
|
|
2
|
-
import { CoDocument } from "./co-document";
|
|
2
|
+
import { CoDocument } from "./co-document.bo";
|
|
3
3
|
import { TagTreeItem } from "./tag-tree-item.bo";
|
|
4
4
|
import { RelationSmallObject } from "./relation-small-object.bo";
|
|
5
5
|
import { PriorityType } from "../enum/priority-type.enum";
|
package/build/model/task.bo.js
CHANGED
|
@@ -16,7 +16,7 @@ const complex_field_decorator_1 = require("@colijnit/ioneconnector/build/factory
|
|
|
16
16
|
const date_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/date-field.decorator");
|
|
17
17
|
const db_field_alias_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/db-field-alias.decorator");
|
|
18
18
|
const complex_array_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator");
|
|
19
|
-
const
|
|
19
|
+
const co_document_bo_1 = require("./co-document.bo");
|
|
20
20
|
const tag_tree_item_bo_1 = require("./tag-tree-item.bo");
|
|
21
21
|
const relation_small_object_bo_1 = require("./relation-small-object.bo");
|
|
22
22
|
const no_db_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/no-db-field.decorator");
|
|
@@ -218,7 +218,7 @@ __decorate([
|
|
|
218
218
|
__metadata("design:type", Number)
|
|
219
219
|
], Task.prototype, "_estimate", void 0);
|
|
220
220
|
__decorate([
|
|
221
|
-
(0, complex_array_decorator_1.ComplexArray)(
|
|
221
|
+
(0, complex_array_decorator_1.ComplexArray)(co_document_bo_1.CoDocument),
|
|
222
222
|
__metadata("design:type", Array)
|
|
223
223
|
], Task.prototype, "documents", void 0);
|
|
224
224
|
__decorate([
|
package/build/model/work.bo.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
|
|
2
2
|
import { RelationSmallObject } from "./relation-small-object.bo";
|
|
3
3
|
import { TableName } from "../enum/table-name.enum";
|
|
4
|
-
import { CoDocument } from "./co-document";
|
|
4
|
+
import { CoDocument } from "./co-document.bo";
|
|
5
5
|
import { ActivityEmailHistory } from "./activity-email-history.bo";
|
|
6
6
|
export declare class Work extends BusinessObject {
|
|
7
7
|
calculationKey: string;
|
package/build/model/work.bo.js
CHANGED
|
@@ -16,7 +16,7 @@ const complex_array_decorator_1 = require("@colijnit/ioneconnector/build/factory
|
|
|
16
16
|
const relation_small_object_bo_1 = require("./relation-small-object.bo");
|
|
17
17
|
const complex_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-field.decorator");
|
|
18
18
|
const no_db_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/no-db-field.decorator");
|
|
19
|
-
const
|
|
19
|
+
const co_document_bo_1 = require("./co-document.bo");
|
|
20
20
|
const time_utils_1 = require("../utils/time-utils");
|
|
21
21
|
const activity_email_history_bo_1 = require("./activity-email-history.bo");
|
|
22
22
|
class Work extends business_object_1.BusinessObject {
|
|
@@ -40,7 +40,7 @@ __decorate([
|
|
|
40
40
|
__metadata("design:type", Date)
|
|
41
41
|
], Work.prototype, "dateTime", void 0);
|
|
42
42
|
__decorate([
|
|
43
|
-
(0, complex_array_decorator_1.ComplexArray)(
|
|
43
|
+
(0, complex_array_decorator_1.ComplexArray)(co_document_bo_1.CoDocument),
|
|
44
44
|
__metadata("design:type", Array)
|
|
45
45
|
], Work.prototype, "documents", void 0);
|
|
46
46
|
__decorate([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileTypeInternal } from '../enum/file-type-internal.enum';
|
|
2
|
-
import { CoDocument } from '../model/co-document';
|
|
2
|
+
import { CoDocument } from '../model/co-document.bo';
|
|
3
3
|
import { DocumentAllowedExtension } from '../model/document-allowed-extension.bo';
|
|
4
4
|
export declare class FileUtils {
|
|
5
5
|
static get DefaultMaxUploadSizeInMb(): number;
|
|
@@ -36,7 +36,7 @@ exports.FileUtils = void 0;
|
|
|
36
36
|
const string_utils_1 = require("@colijnit/ioneconnector/build/utils/string-utils");
|
|
37
37
|
const file_type_internal_enum_1 = require("../enum/file-type-internal.enum");
|
|
38
38
|
const co_document_type_enum_1 = require("../enum/co-document-type.enum");
|
|
39
|
-
const
|
|
39
|
+
const co_document_bo_1 = require("../model/co-document.bo");
|
|
40
40
|
const number_utils_1 = require("@colijnit/ioneconnector/build/utils/number-utils");
|
|
41
41
|
const QRCode = __importStar(require("qrcode"));
|
|
42
42
|
const DefaultMaxUploadSize = 3145728;
|
|
@@ -94,7 +94,7 @@ class FileUtils {
|
|
|
94
94
|
}
|
|
95
95
|
let fileName;
|
|
96
96
|
let mimeType;
|
|
97
|
-
if (file instanceof
|
|
97
|
+
if (file instanceof co_document_bo_1.CoDocument) {
|
|
98
98
|
fileName = file.fileName;
|
|
99
99
|
mimeType = file.mimeTypeInternal;
|
|
100
100
|
}
|
|
@@ -137,7 +137,7 @@ class FileUtils {
|
|
|
137
137
|
}
|
|
138
138
|
static CheckMaxUploadSize(file, maxSizeInBytesFromParameter) {
|
|
139
139
|
let fileSize = 0;
|
|
140
|
-
if (file instanceof
|
|
140
|
+
if (file instanceof co_document_bo_1.CoDocument) {
|
|
141
141
|
fileSize = number_utils_1.NumberUtils.ParseInt(file.fileSize);
|
|
142
142
|
}
|
|
143
143
|
else {
|
|
@@ -148,7 +148,7 @@ class FileUtils {
|
|
|
148
148
|
}
|
|
149
149
|
static CheckExtension(file, allowedExtensions) {
|
|
150
150
|
let filename = '';
|
|
151
|
-
if (file instanceof
|
|
151
|
+
if (file instanceof co_document_bo_1.CoDocument) {
|
|
152
152
|
filename = file.fileName;
|
|
153
153
|
}
|
|
154
154
|
else {
|
|
@@ -286,7 +286,7 @@ class FileUtils {
|
|
|
286
286
|
reader.readAsDataURL(file);
|
|
287
287
|
reader.onloadend = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
288
288
|
if (event.target.readyState === 2) {
|
|
289
|
-
const coDocument = new
|
|
289
|
+
const coDocument = new co_document_bo_1.CoDocument();
|
|
290
290
|
if (file.type.toLowerCase().indexOf("image") > -1 && resize) {
|
|
291
291
|
const src = yield FileUtils.ResizeImage(event.target.result, file.type, maxSizeInPixels);
|
|
292
292
|
const len = src.length - (src.indexOf(",") + 1);
|