@colijnit/articleapi 1.0.27 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/build/articles-auth.d.ts +4 -0
  2. package/build/articles-auth.js +32 -0
  3. package/build/articles-public.d.ts +2 -0
  4. package/build/articles-public.js +9 -2
  5. package/build/articles.d.ts +4 -0
  6. package/build/articles.js +6 -0
  7. package/build/articles.unit.test.js +24 -2
  8. package/build/enum/external-catalog-method.enum.d.ts +4 -0
  9. package/build/enum/external-catalog-method.enum.js +5 -0
  10. package/build/enum/ref-code-class-to-domain-name-map.d.ts +2 -0
  11. package/build/enum/ref-code-class-to-domain-name-map.js +9 -0
  12. package/build/enum/refcode/co-document-type.enum.d.ts +2 -1
  13. package/build/enum/refcode/co-document-type.enum.js +1 -0
  14. package/build/ione-api-articles.d.ts +4 -0
  15. package/build/model/article-flat-storage-request.d.ts +6 -0
  16. package/build/model/article-flat-storage-request.js +14 -0
  17. package/build/model/article-flat-tree.bo.d.ts +17 -0
  18. package/build/model/article-flat-tree.bo.js +48 -0
  19. package/build/model/article-price-list.d.ts +44 -0
  20. package/build/model/article-price-list.js +3 -0
  21. package/build/model/co-document.bo.d.ts +73 -0
  22. package/build/model/co-document.bo.js +251 -0
  23. package/build/model/composite-good.d.ts +11 -0
  24. package/build/model/composite-good.js +3 -0
  25. package/build/model/external-catalog-startup-info-request.d.ts +10 -0
  26. package/build/model/external-catalog-startup-info-request.js +3 -0
  27. package/build/model/external-catalog-startup-info.d.ts +12 -0
  28. package/build/model/external-catalog-startup-info.js +3 -0
  29. package/build/model/good.bo.d.ts +54 -0
  30. package/build/model/good.bo.js +3 -0
  31. package/build/model/price-list-info.d.ts +16 -0
  32. package/build/model/price-list-info.js +3 -0
  33. package/package.json +1 -1
@@ -14,6 +14,8 @@ import { ArticleTransaction } from './model/article-transaction';
14
14
  import { GetArticlePriceRequest } from './model/get-article-price-request';
15
15
  import { DataServiceResponseData } from '@colijnit/ioneconnector/build/model/data-service-response-data';
16
16
  import { PrintPriceStickersRequest } from './model/print-price-stickers-request';
17
+ import { ExternalCatalogStartupInfoRequest } from "./model/external-catalog-startup-info-request";
18
+ import { ArticleFlatTreeDTO } from "./model/article-flat-tree.bo";
17
19
  export declare class ArticlesAuth extends IoneApiArticles {
18
20
  private _boSerializer;
19
21
  searchArticles(request: ArticleExtendedRequest, showLoader: boolean): Promise<DataServiceResponseData>;
@@ -77,6 +79,8 @@ export declare class ArticlesAuth extends IoneApiArticles {
77
79
  getStockManagementWarehouses(): Promise<DataServiceResponseData>;
78
80
  getStockManagementLocations(warehouseNo: number): Promise<DataServiceResponseData>;
79
81
  transferStock(transferStock: TransferStock): Promise<DataServiceResponseData>;
82
+ getWebviewStartupInfo(request: ExternalCatalogStartupInfoRequest): Promise<DataServiceResponseData>;
83
+ storeCatFarmCompositionArticle(catalogId: number, articleFlatTree: ArticleFlatTreeDTO): Promise<DataServiceResponseData>;
80
84
  private _getDomainCollection;
81
85
  private _getMultipleDomainCollection;
82
86
  private _callGetSingleImage;
@@ -26,6 +26,8 @@ import { BusinessObjectSerializer } from '@colijnit/ioneconnector/build/factory/
26
26
  import { isNill } from '@colijnit/ioneconnector/build/utils/function/is-nill.function';
27
27
  import { ReportingDocumentsMethod } from './enum/reporting-documents-method.enum';
28
28
  import { LogisticsMethod } from './enum/logistics-method.enum';
29
+ import { ExternalCatalogMethod } from "./enum/external-catalog-method.enum";
30
+ import { ArticleFlatStorageRequest } from "./model/article-flat-storage-request";
29
31
  export class ArticlesAuth extends IoneApiArticles {
30
32
  constructor() {
31
33
  super(...arguments);
@@ -657,6 +659,36 @@ export class ArticlesAuth extends IoneApiArticles {
657
659
  };
658
660
  return this._call(DataServiceMethod.UpdateObject, data);
659
661
  }
662
+ getWebviewStartupInfo(request) {
663
+ const params = {
664
+ catalogId: request.catalogId,
665
+ articleNumber: request.articleNumber,
666
+ posStatus: request.posStatus,
667
+ ioneOrderNr: request.ioneOrderNr,
668
+ posAuping: request.posAuping,
669
+ posName: request.posName,
670
+ posEmployee: request.posEmployee
671
+ };
672
+ const data = {
673
+ moduleName: ModuleName.Articles,
674
+ methodName: ExternalCatalogMethod.GetWebviewStartupInfo,
675
+ refCursorAsArray: true,
676
+ parameterValues: params
677
+ };
678
+ return this._call(DataServiceMethod.ExecuteMethod, data);
679
+ }
680
+ storeCatFarmCompositionArticle(catalogId, articleFlatTree) {
681
+ const request = new ArticleFlatStorageRequest();
682
+ request.catalogId = catalogId;
683
+ request.articleFlatTreeDTO = articleFlatTree;
684
+ const data = {
685
+ moduleName: ModuleName.Articles,
686
+ methodName: ExternalCatalogMethod.StoreCatFarmCompositionArticle,
687
+ refCursorAsArray: true,
688
+ parameterValues: request
689
+ };
690
+ return this._call(DataServiceMethod.ExecuteMethod, data);
691
+ }
660
692
  _getDomainCollection(languageCode, domainName) {
661
693
  const params = {
662
694
  domainName: domainName,
@@ -79,6 +79,8 @@ export declare class ArticlesPublic extends IoneApiArticles {
79
79
  getDeliveryDate2(goodId: number, branchNr?: string): Promise<any>;
80
80
  getArticleQuickSel(goodId: number, branch: string): Promise<DataServiceResponseData>;
81
81
  getSuperArticleQuickSel(id: string, branch: string): Promise<DataServiceResponseData>;
82
+ getWebviewStartupInfo(): Promise<DataServiceResponseData>;
83
+ storeCatFarmCompositionArticle(): Promise<DataServiceResponseData>;
82
84
  private createServiceRequestData;
83
85
  private _getDomainCollection;
84
86
  private _getMultipleDomainCollection;
@@ -22,8 +22,7 @@ export class ArticlesPublic extends IoneApiArticles {
22
22
  this._instanceId = value;
23
23
  }
24
24
  searchArticles(request, showLoader) {
25
- const params = { request: request };
26
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
25
+ const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: request });
27
26
  return this._call(PublicServiceMethod.SearchArticles, data, showLoader);
28
27
  }
29
28
  searchArticlesLight(request, showLoader) {
@@ -355,6 +354,14 @@ export class ArticlesPublic extends IoneApiArticles {
355
354
  return this._call(PublicServiceMethod.SuperArticleQuickSel, data);
356
355
  });
357
356
  }
357
+ getWebviewStartupInfo() {
358
+ console.warn('getWebviewStartupInfo not implemented');
359
+ return Promise.resolve(new DataServiceResponseData());
360
+ }
361
+ storeCatFarmCompositionArticle() {
362
+ console.warn('storeCatFarmCompositionArticle not implemented');
363
+ return Promise.resolve(new DataServiceResponseData());
364
+ }
358
365
  createServiceRequestData() {
359
366
  const data = { languageCode: this.languageCode };
360
367
  return data;
@@ -16,6 +16,8 @@ import { GetArticlePriceRequest } from './model/get-article-price-request';
16
16
  import { DataServiceResponseData } from '@colijnit/ioneconnector/build/model/data-service-response-data';
17
17
  import { PagingParameters } from '@colijnit/ioneconnector/build/model/paging-parameters';
18
18
  import { PrintPriceStickersRequest } from './model/print-price-stickers-request';
19
+ import { ExternalCatalogStartupInfoRequest } from "./model/external-catalog-startup-info-request";
20
+ import { ArticleFlatTreeDTO } from "./model/article-flat-tree.bo";
19
21
  export declare class Articles {
20
22
  readonly showLoader: Subject<boolean>;
21
23
  readonly connectionAborted: Subject<void>;
@@ -94,6 +96,8 @@ export declare class Articles {
94
96
  getDeliveryPrognosis(goodId: number, branchNr?: string): Promise<DataServiceResponseData>;
95
97
  getSelectorDeliveryDate(): Promise<DataServiceResponseData>;
96
98
  getDeliveryDate2(goodId: number): Promise<DataServiceResponseData>;
99
+ getWebviewStartupInfo(request: ExternalCatalogStartupInfoRequest): Promise<DataServiceResponseData>;
100
+ storeCatFarmCompositionArticle(catalogId: number, articleFlatTree: ArticleFlatTreeDTO): Promise<DataServiceResponseData>;
97
101
  getJsonConfiguredArticles(configuratorStatistics?: ConfiguratorStatisticsEnvironment, showLoader?: boolean, instanceId?: number): Promise<DataServiceResponseData>;
98
102
  getJsonArticleFlatTree(goodId: number, goodType: string, quantity: number, showLoader?: boolean, instanceId?: number, configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
99
103
  static createConnector(options: Options, sessionExists: boolean): IoneApiArticles;
package/build/articles.js CHANGED
@@ -220,6 +220,12 @@ export class Articles {
220
220
  getDeliveryDate2(goodId) {
221
221
  return this.articles.getDeliveryDate2(goodId);
222
222
  }
223
+ getWebviewStartupInfo(request) {
224
+ return this.articles.getWebviewStartupInfo(request);
225
+ }
226
+ storeCatFarmCompositionArticle(catalogId, articleFlatTree) {
227
+ return this.articles.storeCatFarmCompositionArticle(catalogId, articleFlatTree);
228
+ }
223
229
  getJsonConfiguredArticles(configuratorStatistics, showLoader = true, instanceId = undefined) {
224
230
  return this.articles.getFrozenArticle(configuratorStatistics, showLoader, instanceId);
225
231
  }
@@ -15,13 +15,16 @@ import { ArticleDetailsBo } from "./model/article-details.bo";
15
15
  import { ArticleTransaction } from "./model/article-transaction";
16
16
  import { GetArticlePriceRequest } from './model/get-article-price-request';
17
17
  import { PagingParameters } from '@colijnit/ioneconnector/build/model/paging-parameters';
18
+ import { ExternalCatalogStartupInfoRequest } from "./model/external-catalog-startup-info-request";
19
+ import { ArticleFlatTreeDTO } from "./model/article-flat-tree.bo";
20
+ import { ArticleFlat } from "./model/article-flat.bo";
18
21
  const localOptions = {
19
22
  url: "http://localhost:8080/ione",
20
23
  schema: "815",
21
24
  version: "252",
22
25
  useLoginEncryption: true,
23
- username: "patrick",
24
- password: "patrick"
26
+ username: "elske",
27
+ password: "elske1"
25
28
  };
26
29
  const remoteOptions = {
27
30
  url: "http://130.62.7.55:8888/ione",
@@ -169,6 +172,7 @@ describe("ArticlesAPI", () => {
169
172
  expect(result).toBeDefined();
170
173
  }));
171
174
  it('searchArticles', () => __awaiter(void 0, void 0, void 0, function* () {
175
+ yield articles.connect();
172
176
  const result = yield articles.searchArticles(articleExtendedRequest);
173
177
  expect(result).toBeDefined();
174
178
  }));
@@ -260,4 +264,22 @@ describe("ArticlesAPI", () => {
260
264
  const result = yield articles.getPriceTagPrintLayouts();
261
265
  expect(result).toBeDefined();
262
266
  }));
267
+ it('getWebviewStartupInfo', () => __awaiter(void 0, void 0, void 0, function* () {
268
+ yield articles.connect();
269
+ const request = new ExternalCatalogStartupInfoRequest();
270
+ request.catalogId = 45;
271
+ request.ioneOrderNr = "76786";
272
+ request.posEmployee = 36053;
273
+ request.posName = "Ketchum";
274
+ const result = yield articles.getWebviewStartupInfo(request);
275
+ expect(result).toBeDefined();
276
+ }));
277
+ it('storeCatFarmCompositionArticle', () => __awaiter(void 0, void 0, void 0, function* () {
278
+ yield articles.connect();
279
+ const tree = new ArticleFlatTreeDTO();
280
+ const art = new ArticleFlat();
281
+ tree.article = art;
282
+ const result = yield articles.storeCatFarmCompositionArticle(45, tree);
283
+ expect(result).toBeDefined();
284
+ }));
263
285
  });
@@ -0,0 +1,4 @@
1
+ export declare enum ExternalCatalogMethod {
2
+ GetWebviewStartupInfo = "getWebviewStartupInfo",
3
+ StoreCatFarmCompositionArticle = "storeCatFarmCompositionArticleArtReturn"
4
+ }
@@ -0,0 +1,5 @@
1
+ export var ExternalCatalogMethod;
2
+ (function (ExternalCatalogMethod) {
3
+ ExternalCatalogMethod["GetWebviewStartupInfo"] = "getWebviewStartupInfo";
4
+ ExternalCatalogMethod["StoreCatFarmCompositionArticle"] = "storeCatFarmCompositionArticleArtReturn";
5
+ })(ExternalCatalogMethod || (ExternalCatalogMethod = {}));
@@ -0,0 +1,2 @@
1
+ import { DomainName } from "./domain-name.enum";
2
+ export declare const RefCodeClassToDomainNameMap: Map<any, DomainName>;
@@ -0,0 +1,9 @@
1
+ import { DomainName } from "./domain-name.enum";
2
+ import { RelationKind } from "./relation-kind.enum";
3
+ import { FileType } from "@colijnit/mainapi/build/enum/file-type.enum";
4
+ import { GoodType } from "./refcode/good-type.enum";
5
+ export const RefCodeClassToDomainNameMap = new Map([
6
+ [RelationKind, DomainName.RelationType],
7
+ [FileType, DomainName.FileType],
8
+ [GoodType, DomainName.GoodType]
9
+ ]);
@@ -1,5 +1,6 @@
1
1
  export declare enum CoDocumentType {
2
2
  SaveAsDocument = "BN",
3
3
  SaveAsLinkOnRandomLocation = "LS",
4
- SaveAsLinkOnDefaultLocation = "LW"
4
+ SaveAsLinkOnDefaultLocation = "LW",
5
+ SaveAsLinkOnCdnServerLocation = "CD"
5
6
  }
@@ -3,4 +3,5 @@ export var CoDocumentType;
3
3
  CoDocumentType["SaveAsDocument"] = "BN";
4
4
  CoDocumentType["SaveAsLinkOnRandomLocation"] = "LS";
5
5
  CoDocumentType["SaveAsLinkOnDefaultLocation"] = "LW";
6
+ CoDocumentType["SaveAsLinkOnCdnServerLocation"] = "CD";
6
7
  })(CoDocumentType || (CoDocumentType = {}));
@@ -15,6 +15,8 @@ import { GetArticlePriceRequest } from './model/get-article-price-request';
15
15
  import { DataServiceResponseData } from '@colijnit/ioneconnector/build/model/data-service-response-data';
16
16
  import { PagingParameters } from '@colijnit/ioneconnector/build/model/paging-parameters';
17
17
  import { PrintPriceStickersRequest } from './model/print-price-stickers-request';
18
+ import { ExternalCatalogStartupInfoRequest } from "./model/external-catalog-startup-info-request";
19
+ import { ArticleFlatTreeDTO } from "./model/article-flat-tree.bo";
18
20
  export declare abstract class IoneApiArticles {
19
21
  readonly showLoader: Subject<boolean>;
20
22
  readonly connectionAborted: Subject<void>;
@@ -83,5 +85,7 @@ export declare abstract class IoneApiArticles {
83
85
  abstract getStockStickerPrintLayouts(): Promise<DataServiceResponseData>;
84
86
  abstract getPackageStickerPrintLayouts(): Promise<DataServiceResponseData>;
85
87
  abstract getPriceTagPrintLayouts(): Promise<DataServiceResponseData>;
88
+ abstract getWebviewStartupInfo(request: ExternalCatalogStartupInfoRequest): Promise<DataServiceResponseData>;
89
+ abstract storeCatFarmCompositionArticle(catalogId: number, articleFlatTree: ArticleFlatTreeDTO): Promise<DataServiceResponseData>;
86
90
  protected endPoint: string;
87
91
  }
@@ -0,0 +1,6 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ import { ArticleFlatTreeDTO } from "./article-flat-tree.bo";
3
+ export declare class ArticleFlatStorageRequest extends BusinessObject {
4
+ catalogId: number;
5
+ articleFlatTreeDTO: ArticleFlatTreeDTO;
6
+ }
@@ -0,0 +1,14 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
8
+ import { ArticleFlatTreeDTO } from "./article-flat-tree.bo";
9
+ import { ComplexField } from "@colijnit/ioneconnector/build/factory/decorators/complex-field.decorator";
10
+ export class ArticleFlatStorageRequest extends BusinessObject {
11
+ }
12
+ __decorate([
13
+ ComplexField(ArticleFlatTreeDTO)
14
+ ], ArticleFlatStorageRequest.prototype, "articleFlatTreeDTO", void 0);
@@ -0,0 +1,17 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ import { ArticleFlat } from "./article-flat.bo";
3
+ import { Good } from "./good.bo";
4
+ import { CompositeGood } from "./composite-good";
5
+ import { ArticlePriceList } from "./article-price-list";
6
+ import { PriceListInfo } from "./price-list-info";
7
+ import { CoDocument } from "./co-document.bo";
8
+ export declare class ArticleFlatTreeDTO extends BusinessObject {
9
+ article: ArticleFlat;
10
+ subArticles: ArticleFlat[];
11
+ subGoods: Good[];
12
+ compositeGoods: CompositeGood[];
13
+ articlePriceLists: ArticlePriceList[];
14
+ priceLists: PriceListInfo[];
15
+ supplierIdToNumber: Object;
16
+ documents: CoDocument[];
17
+ }
@@ -0,0 +1,48 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
8
+ import { ArticleFlat } from "./article-flat.bo";
9
+ import { Good } from "./good.bo";
10
+ import { CompositeGood } from "./composite-good";
11
+ import { ArticlePriceList } from "./article-price-list";
12
+ import { PriceListInfo } from "./price-list-info";
13
+ import { CoDocument } from "./co-document.bo";
14
+ import { ComplexField } from "@colijnit/ioneconnector/build/factory/decorators/complex-field.decorator";
15
+ import { ComplexArray } from "@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator";
16
+ export class ArticleFlatTreeDTO extends BusinessObject {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.subArticles = [];
20
+ this.subGoods = [];
21
+ this.compositeGoods = [];
22
+ this.articlePriceLists = [];
23
+ this.priceLists = [];
24
+ this.supplierIdToNumber = {};
25
+ this.documents = [];
26
+ }
27
+ }
28
+ __decorate([
29
+ ComplexField(ArticleFlat)
30
+ ], ArticleFlatTreeDTO.prototype, "article", void 0);
31
+ __decorate([
32
+ ComplexArray(ArticleFlat)
33
+ ], ArticleFlatTreeDTO.prototype, "subArticles", void 0);
34
+ __decorate([
35
+ ComplexArray(Good)
36
+ ], ArticleFlatTreeDTO.prototype, "subGoods", void 0);
37
+ __decorate([
38
+ ComplexArray(CompositeGood)
39
+ ], ArticleFlatTreeDTO.prototype, "compositeGoods", void 0);
40
+ __decorate([
41
+ ComplexArray(ArticlePriceList)
42
+ ], ArticleFlatTreeDTO.prototype, "articlePriceLists", void 0);
43
+ __decorate([
44
+ ComplexArray(PriceListInfo)
45
+ ], ArticleFlatTreeDTO.prototype, "priceLists", void 0);
46
+ __decorate([
47
+ ComplexArray(CoDocument)
48
+ ], ArticleFlatTreeDTO.prototype, "documents", void 0);
@@ -0,0 +1,44 @@
1
+ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
2
+ export declare class ArticlePriceList extends BusinessObject {
3
+ priceListCode: string;
4
+ goodId: number;
5
+ guaranteeId: number;
6
+ vatCode: number;
7
+ currencyCode: string;
8
+ description: string;
9
+ defaultPrice: number;
10
+ discountAmount: number;
11
+ discountPercent: number;
12
+ quantityMatrixId: number;
13
+ active: boolean;
14
+ net: boolean;
15
+ shipmentCost: number;
16
+ priceRecommended: number;
17
+ surchargeCode: number;
18
+ calcFactorByPurchase: number;
19
+ calcFactorBySales: number;
20
+ priceFixed: boolean;
21
+ priceBaseline: number;
22
+ assemblyCosts: number;
23
+ priceRoundingKind: string;
24
+ priceRoundingDigit: number;
25
+ discountPercent2: number;
26
+ calcFactorRecommended: number;
27
+ startDate: Date;
28
+ endDate: Date;
29
+ periodCode: string;
30
+ customsFee: number;
31
+ harborFee: number;
32
+ additionalCosts: number;
33
+ manufacturingPrice: number;
34
+ manufacturingCurrency: string;
35
+ transportCurrency: string;
36
+ customsCurrency: string;
37
+ harborCurrency: string;
38
+ additionalCurrency: string;
39
+ addAfterRounding: number;
40
+ roundingRuleLinkId: number;
41
+ name: string;
42
+ guarantee: number;
43
+ commercialText: string;
44
+ }
@@ -0,0 +1,3 @@
1
+ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
2
+ export class ArticlePriceList extends BusinessObject {
3
+ }
@@ -0,0 +1,73 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ import { TableName } from "../enum/table-name.enum";
3
+ import { CoDocumentType } from "../enum/refcode/co-document-type.enum";
4
+ import { FileType } from "@colijnit/mainapi/build/enum/file-type.enum";
5
+ import { CoDocumentImageDisplayKind } from "../enum/co-document-image-display-kind.enum";
6
+ import { TagTreeItem } from "@colijnit/mainapi/build/model/tag-tree-item.bo";
7
+ import { ObjectRightType } from "../enum/refcode/object-right-type.enum";
8
+ import { CoDocumentRight } from "@colijnit/mainapi/build/model/co-document-right";
9
+ import { ArticleSeoValue } from "./article-seo-value";
10
+ import { FileTypeInternal } from "@colijnit/mainapi/build/enum/file-type-internal.enum";
11
+ import { Subject } from "rxjs";
12
+ export declare class CoDocument extends BusinessObject {
13
+ set documentId(value: number);
14
+ get documentId(): number;
15
+ creationDate: Date;
16
+ modifiedDate: Date;
17
+ creationUser: string;
18
+ modifiedUser: string;
19
+ description: string;
20
+ thumbnailBody: string;
21
+ table: TableName;
22
+ key: string;
23
+ filePath: string;
24
+ documentType: CoDocumentType;
25
+ mimeType: string;
26
+ publication: number;
27
+ fileSize: string;
28
+ fileType: FileType;
29
+ isLoaded: boolean;
30
+ index: number;
31
+ imageDimensions: string;
32
+ title: string;
33
+ downloadable: boolean;
34
+ attachToNotification: boolean;
35
+ pathIsUrl: boolean;
36
+ imageType: string;
37
+ imageDisplayKind: CoDocumentImageDisplayKind;
38
+ tags: TagTreeItem[];
39
+ rightLevel: ObjectRightType;
40
+ rights: CoDocumentRight[];
41
+ set documentBody(documentBody: string);
42
+ get documentBody(): string;
43
+ seoTitles: ArticleSeoValue[];
44
+ fileName: string;
45
+ retailFormulas: string[];
46
+ idForLink: number;
47
+ convertToUSDZ: boolean;
48
+ get fileTypeInternal(): FileTypeInternal;
49
+ get mimeTypeInternal(): string;
50
+ set mimeTypeInternal(value: string);
51
+ get bodyAsDataUri(): string;
52
+ get documentBodyAsDataUri(): string;
53
+ get thumbnailBodyAsDataUri(): string;
54
+ get isAvatar(): boolean;
55
+ private _documentBody;
56
+ private _documentId;
57
+ readonly documentBodyChange: Subject<string>;
58
+ private _fileTypeInternal;
59
+ private _mimeTypeInternal;
60
+ private _idObject;
61
+ private readonly _documentType;
62
+ get readonly(): boolean;
63
+ set readonly(value: boolean);
64
+ constructor();
65
+ getId(): any;
66
+ isImageDocument(): boolean;
67
+ getDocumentImageDimensions(): string;
68
+ getDocumentFileSizeAsString(): string;
69
+ getImageDisplayKind(): CoDocumentImageDisplayKind;
70
+ preventOverridingThumbnailToEmpty(): void;
71
+ private _initMimetypeInternal;
72
+ isStoredAsLink(): boolean;
73
+ }
@@ -0,0 +1,251 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BusinessObjectData } from "@colijnit/ioneconnector/build/factory/decorators/business-object-data.decorator";
8
+ import { DataMapping } from "../enum/data-mapping.enum";
9
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
10
+ import { DateField } from "@colijnit/ioneconnector/build/factory/decorators/date-field.decorator";
11
+ import { CoDocumentType } from "../enum/refcode/co-document-type.enum";
12
+ import { FileType } from "@colijnit/mainapi/build/enum/file-type.enum";
13
+ import { BooleanText } from "@colijnit/ioneconnector/build/factory/decorators/boolean.decorator";
14
+ import { DefaultSendValue } from "@colijnit/ioneconnector/build/factory/decorators/default-send-value.decorator";
15
+ import { CoDocumentImageDisplayKind } from "../enum/co-document-image-display-kind.enum";
16
+ import { ComplexArray } from "@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator";
17
+ import { TagTreeItem } from "@colijnit/mainapi/build/model/tag-tree-item.bo";
18
+ import { ObjectRightType } from "../enum/refcode/object-right-type.enum";
19
+ import { CoDocumentRight } from "@colijnit/mainapi/build/model/co-document-right";
20
+ import { NoDbField } from "@colijnit/ioneconnector/build/factory/decorators/no-db-field.decorator";
21
+ import { ArticleSeoValue } from "./article-seo-value";
22
+ import { FileTypeInternal } from "@colijnit/mainapi/build/enum/file-type-internal.enum";
23
+ import { FileUtils } from "@colijnit/mainapi/build/utils/file-utils";
24
+ import { DbFieldAlias } from "@colijnit/ioneconnector/build/factory/decorators/db-field-alias.decorator";
25
+ import { ComplexField } from "@colijnit/ioneconnector/build/factory/decorators/complex-field.decorator";
26
+ import { Subject } from "rxjs";
27
+ import { StringUtils } from "@colijnit/ioneconnector/build/utils/string-utils";
28
+ import { BoSerializerStep } from "@colijnit/ioneconnector/build/factory/decorators/bo-serializer-step.decorator";
29
+ import { FilterType } from "@colijnit/ioneconnector/build/enum/filter-type.enum";
30
+ import { SearchPropertyState } from "@colijnit/ioneconnector/build/enum/search-property-state.enum";
31
+ import { SortType } from "@colijnit/ioneconnector/build/enum/sort-type.enum";
32
+ import { SortDirection } from "@colijnit/ioneconnector/build/enum/sort-direction";
33
+ import { RefCodeClassToDomainNameMap } from "../enum/ref-code-class-to-domain-name-map";
34
+ let CoDocument = class CoDocument extends BusinessObject {
35
+ constructor() {
36
+ super();
37
+ this.pathIsUrl = false;
38
+ this.tags = [];
39
+ this.rights = [];
40
+ this.seoTitles = [];
41
+ this.retailFormulas = [];
42
+ this.documentBodyChange = new Subject();
43
+ this._idObject = {};
44
+ this._documentType = CoDocumentType;
45
+ }
46
+ set documentId(value) {
47
+ this._documentId = value;
48
+ this._idObject.docId = value;
49
+ }
50
+ get documentId() {
51
+ return this._documentId;
52
+ }
53
+ set documentBody(documentBody) {
54
+ const prev = this._documentBody;
55
+ this._documentBody = documentBody;
56
+ if (prev !== this._documentBody) {
57
+ this.documentBodyChange.next(this._documentBody);
58
+ }
59
+ }
60
+ get documentBody() {
61
+ if ((this.documentType !== this._documentType.SaveAsDocument)
62
+ && (this.documentType !== this._documentType.SaveAsLinkOnCdnServerLocation)) {
63
+ return this.filePath;
64
+ }
65
+ return this._documentBody;
66
+ }
67
+ get fileTypeInternal() {
68
+ if (!this._fileTypeInternal) {
69
+ const fileType = FileUtils.FileNameToFileTypeInternal(this.fileName);
70
+ if (fileType) {
71
+ this._fileTypeInternal = fileType;
72
+ }
73
+ }
74
+ return this._fileTypeInternal;
75
+ }
76
+ get mimeTypeInternal() {
77
+ if (this._mimeTypeInternal) {
78
+ return this._mimeTypeInternal;
79
+ }
80
+ else {
81
+ this._initMimetypeInternal();
82
+ return this._mimeTypeInternal;
83
+ }
84
+ }
85
+ set mimeTypeInternal(value) {
86
+ this._mimeTypeInternal = value;
87
+ }
88
+ get bodyAsDataUri() {
89
+ if (this.documentBody) {
90
+ return this.documentBodyAsDataUri;
91
+ }
92
+ else if (this.thumbnailBody) {
93
+ return this.thumbnailBodyAsDataUri;
94
+ }
95
+ }
96
+ get documentBodyAsDataUri() {
97
+ try {
98
+ if (this.isStoredAsLink()) {
99
+ return this.filePath;
100
+ }
101
+ else {
102
+ return FileUtils.DocumentBodyToDataUri(this.documentBody, this.mimeTypeInternal);
103
+ }
104
+ }
105
+ catch (error) {
106
+ return "";
107
+ }
108
+ }
109
+ get thumbnailBodyAsDataUri() {
110
+ try {
111
+ if (this.isStoredAsLink()) {
112
+ return this.filePath;
113
+ }
114
+ return FileUtils.DocumentBodyToDataUri(this.thumbnailBody, this.mimeTypeInternal);
115
+ }
116
+ catch (error) {
117
+ return "";
118
+ }
119
+ }
120
+ get isAvatar() {
121
+ return this.imageDisplayKind === CoDocumentImageDisplayKind.Avatar;
122
+ }
123
+ get readonly() {
124
+ return this.rightLevel === ObjectRightType.ReadOnly;
125
+ }
126
+ set readonly(value) {
127
+ if (value) {
128
+ this.rightLevel = ObjectRightType.ReadOnly;
129
+ }
130
+ else {
131
+ this.rightLevel = ObjectRightType.ReadWrite;
132
+ }
133
+ }
134
+ getId() {
135
+ return this.documentId;
136
+ }
137
+ isImageDocument() {
138
+ return (this.fileTypeInternal === FileTypeInternal.Image);
139
+ }
140
+ getDocumentImageDimensions() {
141
+ if (this.isImageDocument() && this.imageDimensions === undefined) {
142
+ const image = new Image();
143
+ image.src = this.documentBodyAsDataUri;
144
+ return StringUtils.Format("{0}x{1}", [image.width, image.height]);
145
+ }
146
+ return this.imageDimensions;
147
+ }
148
+ getDocumentFileSizeAsString() {
149
+ if (this.fileSize === undefined) {
150
+ return this.documentBody.length === 0 ? " kB" :
151
+ this.documentBody.length < 1024 ? this.documentBody.length + "B" :
152
+ (this.documentBody.length / 1024).toFixed(0).toString() + " kB";
153
+ }
154
+ return this.fileSize;
155
+ }
156
+ getImageDisplayKind() {
157
+ if (this.imageDisplayKind === undefined) {
158
+ this.imageDisplayKind = CoDocumentImageDisplayKind.NormalImage;
159
+ }
160
+ return this.imageDisplayKind;
161
+ }
162
+ preventOverridingThumbnailToEmpty() {
163
+ if (!this.thumbnailBody) {
164
+ this.thumbnailBody = this._documentBody;
165
+ }
166
+ }
167
+ _initMimetypeInternal() {
168
+ if ((this.fileType === FileType.Image || !this.fileType || this.isImageDocument()) && this.fileName) {
169
+ const fileExtension = this.fileName.substr(this.fileName.lastIndexOf(".") + 1);
170
+ this._mimeTypeInternal = "image/" + fileExtension;
171
+ }
172
+ }
173
+ isStoredAsLink() {
174
+ return this.documentType == CoDocumentType.SaveAsLinkOnRandomLocation || this.documentType == CoDocumentType.SaveAsLinkOnDefaultLocation;
175
+ }
176
+ };
177
+ __decorate([
178
+ DateField()
179
+ ], CoDocument.prototype, "creationDate", void 0);
180
+ __decorate([
181
+ DateField()
182
+ ], CoDocument.prototype, "modifiedDate", void 0);
183
+ __decorate([
184
+ BooleanText("T")
185
+ ], CoDocument.prototype, "downloadable", void 0);
186
+ __decorate([
187
+ BooleanText("T")
188
+ ], CoDocument.prototype, "attachToNotification", void 0);
189
+ __decorate([
190
+ BooleanText("T"),
191
+ DefaultSendValue("F")
192
+ ], CoDocument.prototype, "pathIsUrl", void 0);
193
+ __decorate([
194
+ ComplexArray(TagTreeItem)
195
+ ], CoDocument.prototype, "tags", void 0);
196
+ __decorate([
197
+ ComplexArray(CoDocumentRight)
198
+ ], CoDocument.prototype, "rights", void 0);
199
+ __decorate([
200
+ DefaultSendValue([]),
201
+ ComplexArray(ArticleSeoValue)
202
+ ], CoDocument.prototype, "seoTitles", void 0);
203
+ __decorate([
204
+ NoDbField()
205
+ ], CoDocument.prototype, "idForLink", void 0);
206
+ __decorate([
207
+ NoDbField()
208
+ ], CoDocument.prototype, "convertToUSDZ", void 0);
209
+ __decorate([
210
+ DbFieldAlias("documentBody")
211
+ ], CoDocument.prototype, "_documentBody", void 0);
212
+ __decorate([
213
+ DbFieldAlias("documentId")
214
+ ], CoDocument.prototype, "_documentId", void 0);
215
+ __decorate([
216
+ NoDbField(),
217
+ ComplexField(Subject)
218
+ ], CoDocument.prototype, "documentBodyChange", void 0);
219
+ __decorate([
220
+ NoDbField()
221
+ ], CoDocument.prototype, "_fileTypeInternal", void 0);
222
+ __decorate([
223
+ NoDbField()
224
+ ], CoDocument.prototype, "_mimeTypeInternal", void 0);
225
+ __decorate([
226
+ NoDbField()
227
+ ], CoDocument.prototype, "_idObject", void 0);
228
+ __decorate([
229
+ NoDbField()
230
+ ], CoDocument.prototype, "_documentType", void 0);
231
+ __decorate([
232
+ BoSerializerStep()
233
+ ], CoDocument.prototype, "preventOverridingThumbnailToEmpty", null);
234
+ CoDocument = __decorate([
235
+ BusinessObjectData({
236
+ name: "CoDocument",
237
+ mapping: DataMapping.General,
238
+ groupField: "fileType",
239
+ groupDomainName: RefCodeClassToDomainNameMap.get(FileType),
240
+ searchProperties: [
241
+ { property: "fileName", state: SearchPropertyState.LockedActive, label: "FILE_NAME" }
242
+ ],
243
+ filterProperties: [
244
+ { property: "downloadable", type: FilterType.BooleanSimple, label: "DOWNLOADABLE", active: false, valuePass: true }
245
+ ],
246
+ sortProperties: [
247
+ { property: "fileName", label: "FILE_NAME", active: false, type: SortType.String, direction: SortDirection.Ascending }
248
+ ]
249
+ })
250
+ ], CoDocument);
251
+ export { CoDocument };
@@ -0,0 +1,11 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ export declare class CompositeGood extends BusinessObject {
3
+ baseGoodId: number;
4
+ versionNumber: number;
5
+ description: string;
6
+ quantity: number;
7
+ price: number;
8
+ memberGoodId: number;
9
+ partSpecificationGoodId: number;
10
+ isRepresentedArticle: boolean;
11
+ }
@@ -0,0 +1,3 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ export class CompositeGood extends BusinessObject {
3
+ }
@@ -0,0 +1,10 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ export declare class ExternalCatalogStartupInfoRequest extends BusinessObject {
3
+ catalogId: number;
4
+ articleNumber: string;
5
+ posStatus: string;
6
+ ioneOrderNr: string;
7
+ posAuping: string;
8
+ posName: string;
9
+ posEmployee: number;
10
+ }
@@ -0,0 +1,3 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ export class ExternalCatalogStartupInfoRequest extends BusinessObject {
3
+ }
@@ -0,0 +1,12 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ import { ExternalSource } from "./external-source.bo";
3
+ export declare class ExternalCatalogStartupInfo extends BusinessObject {
4
+ externalSource: ExternalSource;
5
+ username: string;
6
+ password: string;
7
+ token: string;
8
+ apiUrl: string;
9
+ externalGoodId: string;
10
+ flattenedGoodId: string;
11
+ assetUrl: string;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ export class ExternalCatalogStartupInfo extends BusinessObject {
3
+ }
@@ -0,0 +1,54 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ export declare class Good extends BusinessObject {
3
+ goodId: number;
4
+ goodKind: string;
5
+ stock: boolean;
6
+ replacementGood: number;
7
+ composed: boolean;
8
+ active: boolean;
9
+ perUnit: boolean;
10
+ material: string;
11
+ priceClass: string;
12
+ model: string;
13
+ followingGood: number;
14
+ dateModified: Date;
15
+ publication: number;
16
+ publicationWebshopSales: number;
17
+ goodIdReference: number;
18
+ eanNumber: string;
19
+ dateIn: Date;
20
+ dateOut: Date;
21
+ hashId: string;
22
+ eanHash: string;
23
+ catalogId: number;
24
+ readOnly: boolean;
25
+ brandId: number;
26
+ url: string;
27
+ title: string;
28
+ textFormat: number;
29
+ hdecoId: string;
30
+ configuration: string;
31
+ hdecoType: string;
32
+ hdecoDefault: string;
33
+ hdecoPlacement: number;
34
+ hdecoGameObject: string;
35
+ hdecoAddAdjust: string;
36
+ hdecoBrandId: string;
37
+ hdecoCategory: string;
38
+ hdecoBrandName: string;
39
+ hdecoOrderLink: boolean;
40
+ selectorType: string;
41
+ productItemsAmount: number;
42
+ defaultDeliveryTime: number;
43
+ deliveryUnit: string;
44
+ defaultDeliveryTimeSales: number;
45
+ deliveryTimeSales: string;
46
+ packageHeight: number;
47
+ packageWidth: number;
48
+ packageLength: number;
49
+ packageWeight: number;
50
+ packageVolume: number;
51
+ packagesAmount: number;
52
+ reference: string;
53
+ externalSourceType: string;
54
+ }
@@ -0,0 +1,3 @@
1
+ import { BusinessObject } from "@colijnit/ioneconnector/build/model/business-object";
2
+ export class Good extends BusinessObject {
3
+ }
@@ -0,0 +1,16 @@
1
+ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
2
+ export declare class PriceListInfo extends BusinessObject {
3
+ listCode: string;
4
+ listKind: string;
5
+ description: string;
6
+ dateIn: Date;
7
+ dateOut: Date;
8
+ priceKind: string;
9
+ vatCode: number;
10
+ languageCode: string;
11
+ currencyCode: string;
12
+ netto: boolean;
13
+ discountPercentage: number;
14
+ selected: boolean;
15
+ editAllowed: boolean;
16
+ }
@@ -0,0 +1,3 @@
1
+ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
2
+ export class PriceListInfo extends BusinessObject {
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/articleapi",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "scripts": {
5
5
  "build": "grunt clean && tsc",
6
6
  "browserify": "browserify build/connector.js --s colijn -o dist/out-tsc/bundle.js",