@colijnit/mainapi 1.0.3 → 1.0.5

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.
@@ -10,5 +10,6 @@ export declare enum DataServiceMethod {
10
10
  UpdateMultipleObjects = "updateMultipleObjects",
11
11
  InsertMultipleObjects = "insertMultipleObjects",
12
12
  DeleteMultipleObjects = "deleteMultipleObjects",
13
- Commit = "commit"
13
+ Commit = "commit",
14
+ Rollback = "rollback"
14
15
  }
@@ -14,4 +14,5 @@ var DataServiceMethod;
14
14
  DataServiceMethod["InsertMultipleObjects"] = "insertMultipleObjects";
15
15
  DataServiceMethod["DeleteMultipleObjects"] = "deleteMultipleObjects";
16
16
  DataServiceMethod["Commit"] = "commit";
17
+ DataServiceMethod["Rollback"] = "rollback";
17
18
  })(DataServiceMethod = exports.DataServiceMethod || (exports.DataServiceMethod = {}));
@@ -1,5 +1,6 @@
1
1
  export declare enum ModuleName {
2
2
  General = "General",
3
3
  Report = "Report",
4
- ReportingDocuments = "ReportingDocuments"
4
+ ReportingDocuments = "ReportingDocuments",
5
+ Tags = "Tags"
5
6
  }
@@ -5,4 +5,5 @@ var ModuleName;
5
5
  ModuleName["General"] = "General";
6
6
  ModuleName["Report"] = "Report";
7
7
  ModuleName["ReportingDocuments"] = "ReportingDocuments";
8
+ ModuleName["Tags"] = "Tags";
8
9
  })(ModuleName = exports.ModuleName || (exports.ModuleName = {}));
@@ -0,0 +1,3 @@
1
+ export declare enum TagMethod {
2
+ GetJoinedTags = "getJoinedTags"
3
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var TagMethod;
4
+ (function (TagMethod) {
5
+ TagMethod["GetJoinedTags"] = "getJoinedTags";
6
+ })(TagMethod = exports.TagMethod || (exports.TagMethod = {}));
@@ -13,5 +13,6 @@ export declare abstract class MainApiConnection {
13
13
  abstract listAllPrinters(): Promise<DataServiceResponseData>;
14
14
  abstract getSendMethods(): Promise<DataServiceResponseData>;
15
15
  abstract getDocumentContent(id: number, thumbnail: boolean): Promise<DataServiceResponseData>;
16
+ abstract getJoinedTags(table: string, key: string): Promise<DataServiceResponseData>;
16
17
  protected endPoint: string;
17
18
  }
@@ -24,6 +24,7 @@ export declare class MainApi {
24
24
  listAllPrinters(): Promise<DataServiceResponseData>;
25
25
  getSendMethods(): Promise<DataServiceResponseData>;
26
26
  getDocumentContent(id: number, thumbnail?: boolean): Promise<DataServiceResponseData>;
27
+ getJoinedTags(table: string, key: string): Promise<DataServiceResponseData>;
27
28
  static createConnector(options: Options): MainApiConnection;
28
29
  private _handleConnectionReset;
29
30
  }
package/build/main-api.js CHANGED
@@ -55,6 +55,9 @@ class MainApi {
55
55
  getDocumentContent(id, thumbnail = true) {
56
56
  return this.mainApi.getDocumentContent(id, thumbnail);
57
57
  }
58
+ getJoinedTags(table, key) {
59
+ return this.mainApi.getJoinedTags(table, key);
60
+ }
58
61
  static createConnector(options) {
59
62
  if ((options.username && options.password) || options.session) {
60
63
  return new main_auth_1.MainAuth();
@@ -49,4 +49,10 @@ describe("Connector", () => {
49
49
  const result = yield connector.getSendMethods();
50
50
  expect(result).toBeDefined();
51
51
  }));
52
+ it('getJoinedTags', () => __awaiter(void 0, void 0, void 0, function* () {
53
+ const table = 'TRANSACTIES';
54
+ const key = '76996';
55
+ const result = yield connector.getJoinedTags(table, key);
56
+ expect(result).toBeDefined();
57
+ }));
52
58
  });
@@ -7,6 +7,7 @@ export declare class MainAuth extends MainApiConnection {
7
7
  listAllPrinters(): Promise<DataServiceResponseData>;
8
8
  getSendMethods(): Promise<DataServiceResponseData>;
9
9
  getDocumentContent(id: number, thumbnail?: boolean): Promise<DataServiceResponseData>;
10
+ getJoinedTags(table: string, key: string): Promise<DataServiceResponseData>;
10
11
  private selectMultiple;
11
12
  private _call;
12
13
  }
@@ -18,6 +18,7 @@ const data_service_response_data_1 = require("@colijnit/ioneconnector/build/mode
18
18
  const business_object_serializer_1 = require("@colijnit/ioneconnector/build/factory/business-object-serializer");
19
19
  const reporting_documents_method_enum_1 = require("./enum/reporting-documents-method.enum");
20
20
  const report_method_enum_1 = require("./enum/report-method.enum");
21
+ const tag_method_enum_1 = require("./enum/tag-method.enum");
21
22
  class MainAuth extends main_api_connection_1.MainApiConnection {
22
23
  constructor() {
23
24
  super(...arguments);
@@ -76,6 +77,19 @@ class MainAuth extends main_api_connection_1.MainApiConnection {
76
77
  };
77
78
  return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data);
78
79
  }
80
+ getJoinedTags(table, key) {
81
+ const inputParams = {
82
+ table: table,
83
+ key: key
84
+ };
85
+ const data = {
86
+ moduleName: module_name_enum_1.ModuleName.Tags,
87
+ methodName: tag_method_enum_1.TagMethod.GetJoinedTags,
88
+ refCursorAsArray: true,
89
+ parameterValues: inputParams
90
+ };
91
+ return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data);
92
+ }
79
93
  selectMultiple(moduleName, objectName, operationName, parameterValues) {
80
94
  let stronglyTypedResults = [];
81
95
  const data = {
@@ -7,6 +7,7 @@ export declare class MainPublic extends MainApiConnection {
7
7
  listAllPrinters(): Promise<DataServiceResponseData>;
8
8
  getSendMethods(): Promise<DataServiceResponseData>;
9
9
  getDocumentContent(id: number, thumbnail: boolean): Promise<DataServiceResponseData>;
10
+ getJoinedTags(table: string, key: string): Promise<DataServiceResponseData>;
10
11
  private createServiceRequestData;
11
12
  private _call;
12
13
  }
@@ -40,6 +40,10 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
40
40
  console.warn('getDocumentContent not implemented');
41
41
  return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
42
42
  }
43
+ getJoinedTags(table, key) {
44
+ console.warn('getJoinedTags not implemented');
45
+ return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
46
+ }
43
47
  createServiceRequestData() {
44
48
  const data = { languageCode: this.languageCode };
45
49
  return data;
@@ -0,0 +1,18 @@
1
+ export declare class CssUtils {
2
+ static AnimateMaxWidthTransitionOn(nativeElement: any, transitionTime?: number, startWidth?: string, endWidth?: string): Promise<void>;
3
+ static AnimateMaxHeightTransitionOn(nativeElement: any, transitionTime?: number, startHeight?: string, endHeight?: string): Promise<void>;
4
+ static FindOffsetWidthOfElementWithTransition(nativeElement: any): string;
5
+ static FindOffsetHeightOfElementWithTransition(nativeElement: any): string;
6
+ static GetComputedStyleVal(nativeElement: any, styleName: string): any;
7
+ static ElementHasStyle(nativeElement: any, styleName: string, styleValue: string): boolean;
8
+ static SetStyleOnElement(nativeElement: any, styleName: string, styleValue: string, pushChanges?: boolean): void;
9
+ static HideElement(nativeElement: any): void;
10
+ static GetStyleValue(nativeElement: any, styleName: string): any;
11
+ static DbRgbColorStringToCssRgbColor(dbRgbColorStr: string): string;
12
+ static PushCssChanges(nativeElement: any): void;
13
+ static TransparentColor(hexColor: string, opacity: number): string;
14
+ static ElementHasClass(element: Element, cssClass: string): boolean;
15
+ private static _FindOffsetHeightOrWidthOfElementWithTransition;
16
+ private static _AddTransitionStyleOn;
17
+ private static _returnPromise;
18
+ }
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class CssUtils {
4
+ static AnimateMaxWidthTransitionOn(nativeElement, transitionTime = 0.2, startWidth = "0px", endWidth) {
5
+ if (!nativeElement) {
6
+ return;
7
+ }
8
+ if (!endWidth) {
9
+ endWidth = CssUtils.FindOffsetWidthOfElementWithTransition(nativeElement);
10
+ }
11
+ const transitionStyle = `max-width ${transitionTime}s ease-out`;
12
+ if (!CssUtils.ElementHasStyle(nativeElement, "transition", transitionStyle)) {
13
+ CssUtils._AddTransitionStyleOn(nativeElement, transitionStyle);
14
+ }
15
+ nativeElement.style.maxWidth = startWidth;
16
+ CssUtils.PushCssChanges(nativeElement);
17
+ nativeElement.style.maxWidth = endWidth;
18
+ return this._returnPromise(transitionTime);
19
+ }
20
+ static AnimateMaxHeightTransitionOn(nativeElement, transitionTime = 0.2, startHeight = "0px", endHeight) {
21
+ if (!nativeElement) {
22
+ return;
23
+ }
24
+ if (!endHeight) {
25
+ endHeight = CssUtils.FindOffsetHeightOfElementWithTransition(nativeElement);
26
+ }
27
+ const transitionStyle = `max-height ${transitionTime}s ease-out`;
28
+ if (!CssUtils.ElementHasStyle(nativeElement, "transition", transitionStyle)) {
29
+ CssUtils._AddTransitionStyleOn(nativeElement, transitionStyle);
30
+ }
31
+ nativeElement.style.maxHeight = startHeight;
32
+ CssUtils.PushCssChanges(nativeElement);
33
+ nativeElement.style.maxHeight = endHeight;
34
+ return this._returnPromise(transitionTime);
35
+ }
36
+ static FindOffsetWidthOfElementWithTransition(nativeElement) {
37
+ return this._FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, false);
38
+ }
39
+ static FindOffsetHeightOfElementWithTransition(nativeElement) {
40
+ return this._FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, true);
41
+ }
42
+ static GetComputedStyleVal(nativeElement, styleName) {
43
+ return document.defaultView.getComputedStyle(nativeElement, "").getPropertyValue("styleName");
44
+ }
45
+ static ElementHasStyle(nativeElement, styleName, styleValue) {
46
+ if (!nativeElement || !styleName) {
47
+ return false;
48
+ }
49
+ return (nativeElement.style[styleName] === styleValue);
50
+ }
51
+ static SetStyleOnElement(nativeElement, styleName, styleValue, pushChanges = false) {
52
+ if (!nativeElement || !styleName) {
53
+ return;
54
+ }
55
+ nativeElement.style[styleName] = styleValue;
56
+ if (pushChanges) {
57
+ CssUtils.PushCssChanges(nativeElement);
58
+ }
59
+ }
60
+ static HideElement(nativeElement) {
61
+ if (nativeElement) {
62
+ CssUtils.SetStyleOnElement(nativeElement, "display", "none");
63
+ }
64
+ }
65
+ static GetStyleValue(nativeElement, styleName) {
66
+ if (!nativeElement || !styleName) {
67
+ return;
68
+ }
69
+ return nativeElement.style[styleName];
70
+ }
71
+ static DbRgbColorStringToCssRgbColor(dbRgbColorStr) {
72
+ if (!dbRgbColorStr || dbRgbColorStr.length === 0) {
73
+ return undefined;
74
+ }
75
+ dbRgbColorStr = dbRgbColorStr.split("0x")[1];
76
+ if (!dbRgbColorStr) {
77
+ return undefined;
78
+ }
79
+ const strLen = dbRgbColorStr.length;
80
+ if (strLen > 6) {
81
+ dbRgbColorStr = dbRgbColorStr.slice(0, 6);
82
+ }
83
+ else if (strLen > 3 && strLen < 6) {
84
+ dbRgbColorStr = dbRgbColorStr.slice(0, 3);
85
+ }
86
+ else if (strLen === 1) {
87
+ dbRgbColorStr += dbRgbColorStr + dbRgbColorStr;
88
+ }
89
+ else if (strLen === 2) {
90
+ dbRgbColorStr += dbRgbColorStr[1];
91
+ }
92
+ return "#" + dbRgbColorStr;
93
+ }
94
+ static PushCssChanges(nativeElement) {
95
+ const notUnused = nativeElement.offsetHeight;
96
+ return;
97
+ }
98
+ static TransparentColor(hexColor, opacity) {
99
+ const hex = hexColor.replace("#", "");
100
+ return `rgba(${Array.from({ length: 3 }, (v, i) => parseInt(hex.substring(i * 2, (i + 1) * 2), 16)).join(",")},${opacity})`;
101
+ }
102
+ static ElementHasClass(element, cssClass) {
103
+ return element && element.classList && element.classList.contains(cssClass);
104
+ }
105
+ static _FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, wantHeight) {
106
+ if (!nativeElement) {
107
+ return "0px";
108
+ }
109
+ const originalTransitionStyle = nativeElement.style.transition;
110
+ CssUtils._AddTransitionStyleOn(nativeElement, "none");
111
+ if (wantHeight) {
112
+ nativeElement.style.maxHeight = "";
113
+ }
114
+ else {
115
+ nativeElement.style.maxWidth = "";
116
+ }
117
+ let trueHeightOrWidth;
118
+ if (wantHeight) {
119
+ trueHeightOrWidth = nativeElement.offsetHeight;
120
+ }
121
+ else {
122
+ trueHeightOrWidth = nativeElement.offsetWidth;
123
+ }
124
+ trueHeightOrWidth += "px";
125
+ nativeElement.style.transition = originalTransitionStyle;
126
+ return trueHeightOrWidth;
127
+ }
128
+ static _AddTransitionStyleOn(nativeElement, styleText) {
129
+ if (!nativeElement || !styleText) {
130
+ return;
131
+ }
132
+ if (nativeElement.style.transition) {
133
+ styleText = ", " + styleText;
134
+ }
135
+ nativeElement.style.transition += styleText;
136
+ nativeElement.style.WebkitTransition += styleText;
137
+ nativeElement.style.MozTransition += styleText;
138
+ }
139
+ static _returnPromise(transitionTime) {
140
+ return new Promise((resolve) => {
141
+ setTimeout(() => {
142
+ resolve();
143
+ }, transitionTime * 1000);
144
+ });
145
+ }
146
+ }
147
+ exports.CssUtils = CssUtils;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/mainapi",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "scripts": {
5
5
  "build": "grunt clean && tsc",
6
6
  "browserify": "browserify build/connector.js --s colijn -o dist/out-tsc/bundle.js",