@pepperi-addons/ngx-composite-lib 0.0.13-beta.8 → 0.0.14-beta.1

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 (125) hide show
  1. package/bundles/pepperi-addons-ngx-composite-lib-color-settings.umd.js +123 -123
  2. package/bundles/pepperi-addons-ngx-composite-lib-dimx-export.umd.js +799 -807
  3. package/bundles/pepperi-addons-ngx-composite-lib-dimx-export.umd.js.map +1 -1
  4. package/bundles/pepperi-addons-ngx-composite-lib-file-status-panel.umd.js +93 -80
  5. package/bundles/pepperi-addons-ngx-composite-lib-file-status-panel.umd.js.map +1 -1
  6. package/bundles/pepperi-addons-ngx-composite-lib-generic-form.umd.js +671 -671
  7. package/bundles/pepperi-addons-ngx-composite-lib-generic-list.umd.js +918 -918
  8. package/bundles/pepperi-addons-ngx-composite-lib-group-buttons-settings.umd.js +176 -176
  9. package/bundles/pepperi-addons-ngx-composite-lib-shadow-settings.umd.js +117 -117
  10. package/bundles/pepperi-addons-ngx-composite-lib.umd.js +538 -538
  11. package/color-settings/color-settings.component.d.ts +22 -22
  12. package/color-settings/color-settings.model.d.ts +5 -5
  13. package/color-settings/color-settings.module.d.ts +12 -12
  14. package/color-settings/pepperi-addons-ngx-composite-lib-color-settings.d.ts +5 -5
  15. package/color-settings/public-api.d.ts +3 -3
  16. package/core/common/directives/index.d.ts +1 -1
  17. package/core/common/directives/public-api.d.ts +1 -1
  18. package/core/common/directives/reset-configuration-field.directive.d.ts +38 -38
  19. package/core/common/index.d.ts +1 -1
  20. package/core/common/public-api.d.ts +2 -2
  21. package/core/common/services/index.d.ts +1 -1
  22. package/core/common/services/public-api.d.ts +1 -1
  23. package/core/common/services/utilities.service.d.ts +6 -6
  24. package/core/index.d.ts +1 -1
  25. package/core/public-api.d.ts +1 -1
  26. package/dimx-export/dimx.component.d.ts +82 -82
  27. package/dimx-export/dimx.model.d.ts +5 -13
  28. package/dimx-export/dimx.module.d.ts +15 -15
  29. package/dimx-export/dimx.service.d.ts +20 -20
  30. package/dimx-export/index.d.ts +1 -1
  31. package/dimx-export/pepperi-addons-ngx-composite-lib-dimx-export.d.ts +5 -5
  32. package/dimx-export/public-api.d.ts +3 -3
  33. package/esm2015/color-settings/color-settings.component.js +81 -81
  34. package/esm2015/color-settings/color-settings.model.js +8 -8
  35. package/esm2015/color-settings/color-settings.module.js +39 -39
  36. package/esm2015/color-settings/pepperi-addons-ngx-composite-lib-color-settings.js +4 -4
  37. package/esm2015/color-settings/public-api.js +6 -6
  38. package/esm2015/core/common/directives/index.js +4 -4
  39. package/esm2015/core/common/directives/public-api.js +4 -4
  40. package/esm2015/core/common/directives/reset-configuration-field.directive.js +135 -135
  41. package/esm2015/core/common/index.js +4 -4
  42. package/esm2015/core/common/public-api.js +5 -5
  43. package/esm2015/core/common/services/index.js +4 -4
  44. package/esm2015/core/common/services/public-api.js +4 -4
  45. package/esm2015/core/common/services/utilities.service.js +18 -18
  46. package/esm2015/core/index.js +4 -4
  47. package/esm2015/core/public-api.js +4 -4
  48. package/esm2015/dimx-export/dimx.component.js +302 -302
  49. package/esm2015/dimx-export/dimx.model.js +8 -15
  50. package/esm2015/dimx-export/dimx.module.js +48 -48
  51. package/esm2015/dimx-export/dimx.service.js +49 -49
  52. package/esm2015/dimx-export/index.js +5 -5
  53. package/esm2015/dimx-export/pepperi-addons-ngx-composite-lib-dimx-export.js +4 -4
  54. package/esm2015/dimx-export/public-api.js +7 -7
  55. package/esm2015/file-status-panel/file-status-panel.component.js +43 -35
  56. package/esm2015/file-status-panel/file-status-panel.model.js +9 -8
  57. package/esm2015/file-status-panel/file-status-panel.module.js +48 -44
  58. package/esm2015/file-status-panel/pepperi-addons-ngx-composite-lib-file-status-panel.js +4 -4
  59. package/esm2015/file-status-panel/public-api.js +6 -6
  60. package/esm2015/generic-form/generic-form.component.js +93 -93
  61. package/esm2015/generic-form/generic-form.model.js +1 -1
  62. package/esm2015/generic-form/generic-form.module.js +73 -73
  63. package/esm2015/generic-form/generic-form.service.js +164 -164
  64. package/esm2015/generic-form/pepperi-addons-ngx-composite-lib-generic-form.js +4 -4
  65. package/esm2015/generic-form/public-api.js +7 -7
  66. package/esm2015/generic-list/generic-list.component.js +420 -420
  67. package/esm2015/generic-list/generic-list.model.js +1 -1
  68. package/esm2015/generic-list/generic-list.module.js +63 -63
  69. package/esm2015/generic-list/generic-list.service.js +40 -40
  70. package/esm2015/generic-list/pepperi-addons-ngx-composite-lib-generic-list.js +4 -4
  71. package/esm2015/generic-list/public-api.js +7 -7
  72. package/esm2015/group-buttons-settings/group-buttons-settings.component.js +134 -134
  73. package/esm2015/group-buttons-settings/group-buttons-settings.model.js +1 -1
  74. package/esm2015/group-buttons-settings/group-buttons-settings.module.js +46 -46
  75. package/esm2015/group-buttons-settings/pepperi-addons-ngx-composite-lib-group-buttons-settings.js +4 -4
  76. package/esm2015/group-buttons-settings/public-api.js +6 -6
  77. package/esm2015/ngx-composite-lib.module.js +44 -44
  78. package/esm2015/pepperi-addons-ngx-composite-lib.js +4 -4
  79. package/esm2015/public-api.js +5 -5
  80. package/esm2015/shadow-settings/pepperi-addons-ngx-composite-lib-shadow-settings.js +4 -4
  81. package/esm2015/shadow-settings/public-api.js +6 -6
  82. package/esm2015/shadow-settings/shadow-settings.component.js +72 -72
  83. package/esm2015/shadow-settings/shadow-settings.model.js +7 -7
  84. package/esm2015/shadow-settings/shadow-settings.module.js +43 -43
  85. package/fesm2015/pepperi-addons-ngx-composite-lib-color-settings.js +113 -113
  86. package/fesm2015/pepperi-addons-ngx-composite-lib-dimx-export.js +381 -389
  87. package/fesm2015/pepperi-addons-ngx-composite-lib-dimx-export.js.map +1 -1
  88. package/fesm2015/pepperi-addons-ngx-composite-lib-file-status-panel.js +88 -75
  89. package/fesm2015/pepperi-addons-ngx-composite-lib-file-status-panel.js.map +1 -1
  90. package/fesm2015/pepperi-addons-ngx-composite-lib-generic-form.js +304 -304
  91. package/fesm2015/pepperi-addons-ngx-composite-lib-generic-list.js +491 -491
  92. package/fesm2015/pepperi-addons-ngx-composite-lib-group-buttons-settings.js +167 -167
  93. package/fesm2015/pepperi-addons-ngx-composite-lib-shadow-settings.js +107 -107
  94. package/fesm2015/pepperi-addons-ngx-composite-lib.js +197 -197
  95. package/file-status-panel/file-status-panel.component.d.ts +17 -14
  96. package/file-status-panel/file-status-panel.model.d.ts +7 -6
  97. package/file-status-panel/file-status-panel.module.d.ts +14 -13
  98. package/file-status-panel/pepperi-addons-ngx-composite-lib-file-status-panel.d.ts +5 -5
  99. package/file-status-panel/public-api.d.ts +3 -3
  100. package/generic-form/generic-form.component.d.ts +28 -28
  101. package/generic-form/generic-form.model.d.ts +35 -35
  102. package/generic-form/generic-form.module.d.ts +13 -13
  103. package/generic-form/generic-form.service.d.ts +44 -44
  104. package/generic-form/pepperi-addons-ngx-composite-lib-generic-form.d.ts +5 -5
  105. package/generic-form/public-api.d.ts +4 -4
  106. package/generic-list/generic-list.component.d.ts +91 -91
  107. package/generic-list/generic-list.model.d.ts +41 -41
  108. package/generic-list/generic-list.module.d.ts +16 -16
  109. package/generic-list/generic-list.service.d.ts +13 -13
  110. package/generic-list/pepperi-addons-ngx-composite-lib-generic-list.d.ts +5 -5
  111. package/generic-list/public-api.d.ts +4 -4
  112. package/group-buttons-settings/group-buttons-settings.component.d.ts +33 -33
  113. package/group-buttons-settings/group-buttons-settings.model.d.ts +1 -1
  114. package/group-buttons-settings/group-buttons-settings.module.d.ts +14 -14
  115. package/group-buttons-settings/pepperi-addons-ngx-composite-lib-group-buttons-settings.d.ts +5 -5
  116. package/group-buttons-settings/public-api.d.ts +3 -3
  117. package/ngx-composite-lib.module.d.ts +11 -11
  118. package/package.json +1 -1
  119. package/pepperi-addons-ngx-composite-lib.d.ts +5 -5
  120. package/public-api.d.ts +2 -2
  121. package/shadow-settings/pepperi-addons-ngx-composite-lib-shadow-settings.d.ts +5 -5
  122. package/shadow-settings/public-api.d.ts +3 -3
  123. package/shadow-settings/shadow-settings.component.d.ts +23 -23
  124. package/shadow-settings/shadow-settings.model.d.ts +7 -7
  125. package/shadow-settings/shadow-settings.module.d.ts +13 -13
@@ -32,827 +32,819 @@
32
32
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
33
33
  var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
34
34
 
35
- /*! *****************************************************************************
36
- Copyright (c) Microsoft Corporation.
37
-
38
- Permission to use, copy, modify, and/or distribute this software for any
39
- purpose with or without fee is hereby granted.
40
-
41
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
42
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
43
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
44
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
45
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47
- PERFORMANCE OF THIS SOFTWARE.
48
- ***************************************************************************** */
49
- /* global Reflect, Promise */
50
- var extendStatics = function (d, b) {
51
- extendStatics = Object.setPrototypeOf ||
52
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
53
- function (d, b) { for (var p in b)
54
- if (Object.prototype.hasOwnProperty.call(b, p))
55
- d[p] = b[p]; };
56
- return extendStatics(d, b);
57
- };
58
- function __extends(d, b) {
59
- if (typeof b !== "function" && b !== null)
60
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
61
- extendStatics(d, b);
62
- function __() { this.constructor = d; }
63
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
64
- }
65
- var __assign = function () {
66
- __assign = Object.assign || function __assign(t) {
67
- for (var s, i = 1, n = arguments.length; i < n; i++) {
68
- s = arguments[i];
69
- for (var p in s)
70
- if (Object.prototype.hasOwnProperty.call(s, p))
71
- t[p] = s[p];
72
- }
73
- return t;
74
- };
75
- return __assign.apply(this, arguments);
76
- };
77
- function __rest(s, e) {
78
- var t = {};
79
- for (var p in s)
80
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
81
- t[p] = s[p];
82
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
83
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
84
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
85
- t[p[i]] = s[p[i]];
86
- }
87
- return t;
88
- }
89
- function __decorate(decorators, target, key, desc) {
90
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
91
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
92
- r = Reflect.decorate(decorators, target, key, desc);
93
- else
94
- for (var i = decorators.length - 1; i >= 0; i--)
95
- if (d = decorators[i])
96
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
97
- return c > 3 && r && Object.defineProperty(target, key, r), r;
98
- }
99
- function __param(paramIndex, decorator) {
100
- return function (target, key) { decorator(target, key, paramIndex); };
101
- }
102
- function __metadata(metadataKey, metadataValue) {
103
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
104
- return Reflect.metadata(metadataKey, metadataValue);
105
- }
106
- function __awaiter(thisArg, _arguments, P, generator) {
107
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
108
- return new (P || (P = Promise))(function (resolve, reject) {
109
- function fulfilled(value) { try {
110
- step(generator.next(value));
111
- }
112
- catch (e) {
113
- reject(e);
114
- } }
115
- function rejected(value) { try {
116
- step(generator["throw"](value));
117
- }
118
- catch (e) {
119
- reject(e);
120
- } }
121
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
122
- step((generator = generator.apply(thisArg, _arguments || [])).next());
123
- });
124
- }
125
- function __generator(thisArg, body) {
126
- var _ = { label: 0, sent: function () { if (t[0] & 1)
127
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
128
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
129
- function verb(n) { return function (v) { return step([n, v]); }; }
130
- function step(op) {
131
- if (f)
132
- throw new TypeError("Generator is already executing.");
133
- while (_)
134
- try {
135
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
136
- return t;
137
- if (y = 0, t)
138
- op = [op[0] & 2, t.value];
139
- switch (op[0]) {
140
- case 0:
141
- case 1:
142
- t = op;
143
- break;
144
- case 4:
145
- _.label++;
146
- return { value: op[1], done: false };
147
- case 5:
148
- _.label++;
149
- y = op[1];
150
- op = [0];
151
- continue;
152
- case 7:
153
- op = _.ops.pop();
154
- _.trys.pop();
155
- continue;
156
- default:
157
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
158
- _ = 0;
159
- continue;
160
- }
161
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
162
- _.label = op[1];
163
- break;
164
- }
165
- if (op[0] === 6 && _.label < t[1]) {
166
- _.label = t[1];
167
- t = op;
168
- break;
169
- }
170
- if (t && _.label < t[2]) {
171
- _.label = t[2];
172
- _.ops.push(op);
173
- break;
174
- }
175
- if (t[2])
176
- _.ops.pop();
177
- _.trys.pop();
178
- continue;
179
- }
180
- op = body.call(thisArg, _);
181
- }
182
- catch (e) {
183
- op = [6, e];
184
- y = 0;
185
- }
186
- finally {
187
- f = t = 0;
188
- }
189
- if (op[0] & 5)
190
- throw op[1];
191
- return { value: op[0] ? op[1] : void 0, done: true };
192
- }
193
- }
194
- var __createBinding = Object.create ? (function (o, m, k, k2) {
195
- if (k2 === undefined)
196
- k2 = k;
197
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
198
- }) : (function (o, m, k, k2) {
199
- if (k2 === undefined)
200
- k2 = k;
201
- o[k2] = m[k];
202
- });
203
- function __exportStar(m, o) {
204
- for (var p in m)
205
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
206
- __createBinding(o, m, p);
207
- }
208
- function __values(o) {
209
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
210
- if (m)
211
- return m.call(o);
212
- if (o && typeof o.length === "number")
213
- return {
214
- next: function () {
215
- if (o && i >= o.length)
216
- o = void 0;
217
- return { value: o && o[i++], done: !o };
218
- }
219
- };
220
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
221
- }
222
- function __read(o, n) {
223
- var m = typeof Symbol === "function" && o[Symbol.iterator];
224
- if (!m)
225
- return o;
226
- var i = m.call(o), r, ar = [], e;
227
- try {
228
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
229
- ar.push(r.value);
230
- }
231
- catch (error) {
232
- e = { error: error };
233
- }
234
- finally {
235
- try {
236
- if (r && !r.done && (m = i["return"]))
237
- m.call(i);
238
- }
239
- finally {
240
- if (e)
241
- throw e.error;
242
- }
243
- }
244
- return ar;
245
- }
246
- /** @deprecated */
247
- function __spread() {
248
- for (var ar = [], i = 0; i < arguments.length; i++)
249
- ar = ar.concat(__read(arguments[i]));
250
- return ar;
251
- }
252
- /** @deprecated */
253
- function __spreadArrays() {
254
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
255
- s += arguments[i].length;
256
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
257
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
258
- r[k] = a[j];
259
- return r;
260
- }
261
- function __spreadArray(to, from, pack) {
262
- if (pack || arguments.length === 2)
263
- for (var i = 0, l = from.length, ar; i < l; i++) {
264
- if (ar || !(i in from)) {
265
- if (!ar)
266
- ar = Array.prototype.slice.call(from, 0, i);
267
- ar[i] = from[i];
268
- }
269
- }
270
- return to.concat(ar || Array.prototype.slice.call(from));
271
- }
272
- function __await(v) {
273
- return this instanceof __await ? (this.v = v, this) : new __await(v);
274
- }
275
- function __asyncGenerator(thisArg, _arguments, generator) {
276
- if (!Symbol.asyncIterator)
277
- throw new TypeError("Symbol.asyncIterator is not defined.");
278
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
279
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
280
- function verb(n) { if (g[n])
281
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
282
- function resume(n, v) { try {
283
- step(g[n](v));
284
- }
285
- catch (e) {
286
- settle(q[0][3], e);
287
- } }
288
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
289
- function fulfill(value) { resume("next", value); }
290
- function reject(value) { resume("throw", value); }
291
- function settle(f, v) { if (f(v), q.shift(), q.length)
292
- resume(q[0][0], q[0][1]); }
293
- }
294
- function __asyncDelegator(o) {
295
- var i, p;
296
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
297
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
298
- }
299
- function __asyncValues(o) {
300
- if (!Symbol.asyncIterator)
301
- throw new TypeError("Symbol.asyncIterator is not defined.");
302
- var m = o[Symbol.asyncIterator], i;
303
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
304
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
305
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
306
- }
307
- function __makeTemplateObject(cooked, raw) {
308
- if (Object.defineProperty) {
309
- Object.defineProperty(cooked, "raw", { value: raw });
310
- }
311
- else {
312
- cooked.raw = raw;
313
- }
314
- return cooked;
315
- }
316
- ;
317
- var __setModuleDefault = Object.create ? (function (o, v) {
318
- Object.defineProperty(o, "default", { enumerable: true, value: v });
319
- }) : function (o, v) {
320
- o["default"] = v;
321
- };
322
- function __importStar(mod) {
323
- if (mod && mod.__esModule)
324
- return mod;
325
- var result = {};
326
- if (mod != null)
327
- for (var k in mod)
328
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
329
- __createBinding(result, mod, k);
330
- __setModuleDefault(result, mod);
331
- return result;
332
- }
333
- function __importDefault(mod) {
334
- return (mod && mod.__esModule) ? mod : { default: mod };
335
- }
336
- function __classPrivateFieldGet(receiver, state, kind, f) {
337
- if (kind === "a" && !f)
338
- throw new TypeError("Private accessor was defined without a getter");
339
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
340
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
341
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
342
- }
343
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
344
- if (kind === "m")
345
- throw new TypeError("Private method is not writable");
346
- if (kind === "a" && !f)
347
- throw new TypeError("Private accessor was defined without a setter");
348
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
349
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
350
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
35
+ /*! *****************************************************************************
36
+ Copyright (c) Microsoft Corporation.
37
+
38
+ Permission to use, copy, modify, and/or distribute this software for any
39
+ purpose with or without fee is hereby granted.
40
+
41
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
42
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
43
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
44
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
45
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47
+ PERFORMANCE OF THIS SOFTWARE.
48
+ ***************************************************************************** */
49
+ /* global Reflect, Promise */
50
+ var extendStatics = function (d, b) {
51
+ extendStatics = Object.setPrototypeOf ||
52
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
53
+ function (d, b) { for (var p in b)
54
+ if (Object.prototype.hasOwnProperty.call(b, p))
55
+ d[p] = b[p]; };
56
+ return extendStatics(d, b);
57
+ };
58
+ function __extends(d, b) {
59
+ if (typeof b !== "function" && b !== null)
60
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
61
+ extendStatics(d, b);
62
+ function __() { this.constructor = d; }
63
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
64
+ }
65
+ var __assign = function () {
66
+ __assign = Object.assign || function __assign(t) {
67
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
68
+ s = arguments[i];
69
+ for (var p in s)
70
+ if (Object.prototype.hasOwnProperty.call(s, p))
71
+ t[p] = s[p];
72
+ }
73
+ return t;
74
+ };
75
+ return __assign.apply(this, arguments);
76
+ };
77
+ function __rest(s, e) {
78
+ var t = {};
79
+ for (var p in s)
80
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
81
+ t[p] = s[p];
82
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
83
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
84
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
85
+ t[p[i]] = s[p[i]];
86
+ }
87
+ return t;
88
+ }
89
+ function __decorate(decorators, target, key, desc) {
90
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
91
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
92
+ r = Reflect.decorate(decorators, target, key, desc);
93
+ else
94
+ for (var i = decorators.length - 1; i >= 0; i--)
95
+ if (d = decorators[i])
96
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
97
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
98
+ }
99
+ function __param(paramIndex, decorator) {
100
+ return function (target, key) { decorator(target, key, paramIndex); };
101
+ }
102
+ function __metadata(metadataKey, metadataValue) {
103
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
104
+ return Reflect.metadata(metadataKey, metadataValue);
105
+ }
106
+ function __awaiter(thisArg, _arguments, P, generator) {
107
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
108
+ return new (P || (P = Promise))(function (resolve, reject) {
109
+ function fulfilled(value) { try {
110
+ step(generator.next(value));
111
+ }
112
+ catch (e) {
113
+ reject(e);
114
+ } }
115
+ function rejected(value) { try {
116
+ step(generator["throw"](value));
117
+ }
118
+ catch (e) {
119
+ reject(e);
120
+ } }
121
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
122
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
123
+ });
124
+ }
125
+ function __generator(thisArg, body) {
126
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
127
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
128
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
129
+ function verb(n) { return function (v) { return step([n, v]); }; }
130
+ function step(op) {
131
+ if (f)
132
+ throw new TypeError("Generator is already executing.");
133
+ while (_)
134
+ try {
135
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
136
+ return t;
137
+ if (y = 0, t)
138
+ op = [op[0] & 2, t.value];
139
+ switch (op[0]) {
140
+ case 0:
141
+ case 1:
142
+ t = op;
143
+ break;
144
+ case 4:
145
+ _.label++;
146
+ return { value: op[1], done: false };
147
+ case 5:
148
+ _.label++;
149
+ y = op[1];
150
+ op = [0];
151
+ continue;
152
+ case 7:
153
+ op = _.ops.pop();
154
+ _.trys.pop();
155
+ continue;
156
+ default:
157
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
158
+ _ = 0;
159
+ continue;
160
+ }
161
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
162
+ _.label = op[1];
163
+ break;
164
+ }
165
+ if (op[0] === 6 && _.label < t[1]) {
166
+ _.label = t[1];
167
+ t = op;
168
+ break;
169
+ }
170
+ if (t && _.label < t[2]) {
171
+ _.label = t[2];
172
+ _.ops.push(op);
173
+ break;
174
+ }
175
+ if (t[2])
176
+ _.ops.pop();
177
+ _.trys.pop();
178
+ continue;
179
+ }
180
+ op = body.call(thisArg, _);
181
+ }
182
+ catch (e) {
183
+ op = [6, e];
184
+ y = 0;
185
+ }
186
+ finally {
187
+ f = t = 0;
188
+ }
189
+ if (op[0] & 5)
190
+ throw op[1];
191
+ return { value: op[0] ? op[1] : void 0, done: true };
192
+ }
193
+ }
194
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
195
+ if (k2 === undefined)
196
+ k2 = k;
197
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
198
+ }) : (function (o, m, k, k2) {
199
+ if (k2 === undefined)
200
+ k2 = k;
201
+ o[k2] = m[k];
202
+ });
203
+ function __exportStar(m, o) {
204
+ for (var p in m)
205
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
206
+ __createBinding(o, m, p);
207
+ }
208
+ function __values(o) {
209
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
210
+ if (m)
211
+ return m.call(o);
212
+ if (o && typeof o.length === "number")
213
+ return {
214
+ next: function () {
215
+ if (o && i >= o.length)
216
+ o = void 0;
217
+ return { value: o && o[i++], done: !o };
218
+ }
219
+ };
220
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
221
+ }
222
+ function __read(o, n) {
223
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
224
+ if (!m)
225
+ return o;
226
+ var i = m.call(o), r, ar = [], e;
227
+ try {
228
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
229
+ ar.push(r.value);
230
+ }
231
+ catch (error) {
232
+ e = { error: error };
233
+ }
234
+ finally {
235
+ try {
236
+ if (r && !r.done && (m = i["return"]))
237
+ m.call(i);
238
+ }
239
+ finally {
240
+ if (e)
241
+ throw e.error;
242
+ }
243
+ }
244
+ return ar;
245
+ }
246
+ /** @deprecated */
247
+ function __spread() {
248
+ for (var ar = [], i = 0; i < arguments.length; i++)
249
+ ar = ar.concat(__read(arguments[i]));
250
+ return ar;
251
+ }
252
+ /** @deprecated */
253
+ function __spreadArrays() {
254
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
255
+ s += arguments[i].length;
256
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
257
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
258
+ r[k] = a[j];
259
+ return r;
260
+ }
261
+ function __spreadArray(to, from, pack) {
262
+ if (pack || arguments.length === 2)
263
+ for (var i = 0, l = from.length, ar; i < l; i++) {
264
+ if (ar || !(i in from)) {
265
+ if (!ar)
266
+ ar = Array.prototype.slice.call(from, 0, i);
267
+ ar[i] = from[i];
268
+ }
269
+ }
270
+ return to.concat(ar || Array.prototype.slice.call(from));
271
+ }
272
+ function __await(v) {
273
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
274
+ }
275
+ function __asyncGenerator(thisArg, _arguments, generator) {
276
+ if (!Symbol.asyncIterator)
277
+ throw new TypeError("Symbol.asyncIterator is not defined.");
278
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
279
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
280
+ function verb(n) { if (g[n])
281
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
282
+ function resume(n, v) { try {
283
+ step(g[n](v));
284
+ }
285
+ catch (e) {
286
+ settle(q[0][3], e);
287
+ } }
288
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
289
+ function fulfill(value) { resume("next", value); }
290
+ function reject(value) { resume("throw", value); }
291
+ function settle(f, v) { if (f(v), q.shift(), q.length)
292
+ resume(q[0][0], q[0][1]); }
293
+ }
294
+ function __asyncDelegator(o) {
295
+ var i, p;
296
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
297
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
298
+ }
299
+ function __asyncValues(o) {
300
+ if (!Symbol.asyncIterator)
301
+ throw new TypeError("Symbol.asyncIterator is not defined.");
302
+ var m = o[Symbol.asyncIterator], i;
303
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
304
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
305
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
306
+ }
307
+ function __makeTemplateObject(cooked, raw) {
308
+ if (Object.defineProperty) {
309
+ Object.defineProperty(cooked, "raw", { value: raw });
310
+ }
311
+ else {
312
+ cooked.raw = raw;
313
+ }
314
+ return cooked;
315
+ }
316
+ ;
317
+ var __setModuleDefault = Object.create ? (function (o, v) {
318
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
319
+ }) : function (o, v) {
320
+ o["default"] = v;
321
+ };
322
+ function __importStar(mod) {
323
+ if (mod && mod.__esModule)
324
+ return mod;
325
+ var result = {};
326
+ if (mod != null)
327
+ for (var k in mod)
328
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
329
+ __createBinding(result, mod, k);
330
+ __setModuleDefault(result, mod);
331
+ return result;
332
+ }
333
+ function __importDefault(mod) {
334
+ return (mod && mod.__esModule) ? mod : { default: mod };
335
+ }
336
+ function __classPrivateFieldGet(receiver, state, kind, f) {
337
+ if (kind === "a" && !f)
338
+ throw new TypeError("Private accessor was defined without a getter");
339
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
340
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
341
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
342
+ }
343
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
344
+ if (kind === "m")
345
+ throw new TypeError("Private method is not writable");
346
+ if (kind === "a" && !f)
347
+ throw new TypeError("Private accessor was defined without a setter");
348
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
349
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
350
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
351
351
  }
352
352
 
353
- var DIMXService = /** @class */ (function () {
354
- function DIMXService(session, pepperiDataConverter, pepHttp) {
355
- this.session = session;
356
- this.pepperiDataConverter = pepperiDataConverter;
357
- this.pepHttp = pepHttp;
358
- //tempToken = ""
359
- this.accessToken = '';
360
- this.papiBaseURL = '';
361
- //window.sessionStorage.setItem('idp_token',this.tempToken)
362
- var accessToken = this.session.getIdpToken();
363
- this.parsedToken = jwt__default["default"](accessToken);
364
- this.papiBaseURL = this.parsedToken["pepperi.baseurl"];
365
- }
366
- Object.defineProperty(DIMXService.prototype, "papiClient", {
367
- get: function () {
368
- return new papiSdk.PapiClient({
369
- baseURL: this.papiBaseURL,
370
- token: this.session.getIdpToken(),
371
- suppressLogging: true
372
- });
373
- },
374
- enumerable: false,
375
- configurable: true
376
- });
377
- DIMXService.prototype.get = function (endpoint) {
378
- return __awaiter(this, void 0, void 0, function () {
379
- return __generator(this, function (_a) {
380
- switch (_a.label) {
381
- case 0: return [4 /*yield*/, this.papiClient.get(endpoint)];
382
- case 1: return [2 /*return*/, _a.sent()];
383
- }
384
- });
385
- });
386
- };
387
- DIMXService.prototype.post = function (endpoint, body) {
388
- return __awaiter(this, void 0, void 0, function () {
389
- return __generator(this, function (_a) {
390
- switch (_a.label) {
391
- case 0: return [4 /*yield*/, this.papiClient.post(endpoint, body)];
392
- case 1: return [2 /*return*/, _a.sent()];
393
- }
394
- });
395
- });
396
- };
397
- DIMXService.prototype.pepGet = function (endpoint) {
398
- return this.pepHttp.getPapiApiCall(endpoint);
399
- };
400
- DIMXService.prototype.pepPost = function (endpoint, body) {
401
- return this.pepHttp.postPapiApiCall(endpoint, body);
402
- };
403
- return DIMXService;
404
- }());
405
- DIMXService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, deps: [{ token: i1__namespace.PepSessionService }, { token: i1__namespace.PepDataConvertorService }, { token: i1__namespace.PepHttpService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
406
- DIMXService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, providedIn: 'root' });
407
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, decorators: [{
408
- type: i0.Injectable,
409
- args: [{ providedIn: 'root' }]
353
+ var DIMXService = /** @class */ (function () {
354
+ function DIMXService(session, pepperiDataConverter, pepHttp) {
355
+ this.session = session;
356
+ this.pepperiDataConverter = pepperiDataConverter;
357
+ this.pepHttp = pepHttp;
358
+ //tempToken = ""
359
+ this.accessToken = '';
360
+ this.papiBaseURL = '';
361
+ //window.sessionStorage.setItem('idp_token',this.tempToken)
362
+ var accessToken = this.session.getIdpToken();
363
+ this.parsedToken = jwt__default["default"](accessToken);
364
+ this.papiBaseURL = this.parsedToken["pepperi.baseurl"];
365
+ }
366
+ Object.defineProperty(DIMXService.prototype, "papiClient", {
367
+ get: function () {
368
+ return new papiSdk.PapiClient({
369
+ baseURL: this.papiBaseURL,
370
+ token: this.session.getIdpToken(),
371
+ suppressLogging: true
372
+ });
373
+ },
374
+ enumerable: false,
375
+ configurable: true
376
+ });
377
+ DIMXService.prototype.get = function (endpoint) {
378
+ return __awaiter(this, void 0, void 0, function () {
379
+ return __generator(this, function (_a) {
380
+ switch (_a.label) {
381
+ case 0: return [4 /*yield*/, this.papiClient.get(endpoint)];
382
+ case 1: return [2 /*return*/, _a.sent()];
383
+ }
384
+ });
385
+ });
386
+ };
387
+ DIMXService.prototype.post = function (endpoint, body) {
388
+ return __awaiter(this, void 0, void 0, function () {
389
+ return __generator(this, function (_a) {
390
+ switch (_a.label) {
391
+ case 0: return [4 /*yield*/, this.papiClient.post(endpoint, body)];
392
+ case 1: return [2 /*return*/, _a.sent()];
393
+ }
394
+ });
395
+ });
396
+ };
397
+ DIMXService.prototype.pepGet = function (endpoint) {
398
+ return this.pepHttp.getPapiApiCall(endpoint);
399
+ };
400
+ DIMXService.prototype.pepPost = function (endpoint, body) {
401
+ return this.pepHttp.postPapiApiCall(endpoint, body);
402
+ };
403
+ return DIMXService;
404
+ }());
405
+ DIMXService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, deps: [{ token: i1__namespace.PepSessionService }, { token: i1__namespace.PepDataConvertorService }, { token: i1__namespace.PepHttpService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
406
+ DIMXService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, providedIn: 'root' });
407
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, decorators: [{
408
+ type: i0.Injectable,
409
+ args: [{ providedIn: 'root' }]
410
410
  }], ctorParameters: function () { return [{ type: i1__namespace.PepSessionService }, { type: i1__namespace.PepDataConvertorService }, { type: i1__namespace.PepHttpService }]; } });
411
411
 
412
- var DIMXComponent = /** @class */ (function () {
413
- function DIMXComponent(translate, addonService) {
414
- this.translate = translate;
415
- this.addonService = addonService;
416
- this.DIMXProcessDone = new i0.EventEmitter();
417
- this.iFileID = 0;
418
- this.iFileArray = [];
419
- this.toBase64 = function (file) { return new Promise(function (resolve, reject) {
420
- var reader = new FileReader();
421
- reader.readAsDataURL(file);
422
- reader.onload = function () { return resolve(reader.result); };
423
- reader.onerror = function (error) { return reject(error); };
424
- }); };
425
- }
426
- DIMXComponent.prototype.ngOnInit = function () {
427
- // Get the first translation for load all translations.
428
- this.translate.get('SHADOW_SETTINGS.INTENSITY_SOFT').toPromise().then(function (typeSoft) {
429
- console.log("something");
430
- });
431
- };
432
- DIMXComponent.prototype.getDIMXExportPOSTBody = function (value) {
433
- return {
434
- "Format": value.DIMXExportFormat,
435
- "IncludeDeleted": value.DIMXExportIncludeDeleted,
436
- "Where": value.DIMXExportWhere,
437
- "Fields": value.DIMXExportFields,
438
- "Delimiter": value.DIMXExportDelimiter
439
- };
440
- };
441
- DIMXComponent.prototype.pollDIMXResult = function (pollingURL, ifile) {
442
- return __awaiter(this, void 0, void 0, function () {
443
- var delay, seconds, waitingTime, result, _a, ex_1;
444
- return __generator(this, function (_b) {
445
- switch (_b.label) {
446
- case 0:
447
- console.log("polling audit with the executionUUID: " + pollingURL);
448
- delay = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); };
449
- seconds = 0;
450
- waitingTime = 1000;
451
- _b.label = 1;
452
- case 1:
453
- _b.trys.push([1, 14, , 16]);
454
- result = void 0;
455
- _b.label = 2;
456
- case 2:
457
- if (!true) return [3 /*break*/, 7];
458
- return [4 /*yield*/, this.addonService.papiClient.get("/audit_logs/" + pollingURL)];
459
- case 3:
460
- result = _b.sent();
461
- console.log("result from auditlog get is: " + result);
462
- if (!(!result || result["Status"]["ID"] === 2 || result["Status"]["ID"] === 4)) return [3 /*break*/, 5];
463
- console.log("waited for " + seconds++ + " seconds");
464
- return [4 /*yield*/, delay(waitingTime)];
465
- case 4:
466
- _b.sent();
467
- return [3 /*break*/, 6];
468
- case 5: return [3 /*break*/, 7];
469
- case 6: return [3 /*break*/, 2];
470
- case 7:
471
- _a = result["Status"]["ID"];
472
- switch (_a) {
473
- case 0: return [3 /*break*/, 8];
474
- case 1: return [3 /*break*/, 10];
475
- }
476
- return [3 /*break*/, 11];
477
- case 8:
478
- ifile.status = "failed";
479
- ifile.returnedObject = { "ErrorMessage": result["AuditInfo"]["ErrorMessage"] };
480
- return [4 /*yield*/, this.SendDoneEventIfDone()];
481
- case 9:
482
- _b.sent();
483
- return [2 /*return*/, null];
484
- case 10:
485
- console.log("polling result: " + result["AuditInfo"]["ResultObject"]);
486
- return [2 /*return*/, JSON.parse(result["AuditInfo"]["ResultObject"])];
487
- case 11:
488
- ifile.status = "failed";
489
- ifile.returnedObject = { "ErrorMessage": "unknown audit log type: " + result["Status"] };
490
- return [4 /*yield*/, this.SendDoneEventIfDone()];
491
- case 12:
492
- _b.sent();
493
- return [2 /*return*/, null];
494
- case 13: return [3 /*break*/, 16];
495
- case 14:
496
- ex_1 = _b.sent();
497
- console.log("pollDIMXResult: " + ex_1);
498
- ifile.status = "failed";
499
- ifile.returnedObject = { "ErrorMessage": ex_1.message };
500
- return [4 /*yield*/, this.SendDoneEventIfDone()];
501
- case 15:
502
- _b.sent();
503
- return [2 /*return*/, null];
504
- case 16: return [2 /*return*/];
505
- }
506
- });
507
- });
508
- };
509
- DIMXComponent.prototype.getNewFileName = function (value) {
510
- var extension;
511
- switch (value.DIMXExportFormat.toLowerCase()) {
512
- case "json":
513
- extension = ".json";
514
- break;
515
- case "csv":
516
- extension = '.csv';
517
- break;
518
- default:
519
- extension = "";
520
- }
521
- var filename = value.DIMXExportFileName;
522
- return filename + extension;
523
- };
524
- DIMXComponent.prototype.createNewIFile = function (fileName, status) {
525
- return {
526
- "key": this.iFileID++,
527
- "name": fileName,
528
- "status": status
529
- };
530
- };
531
- DIMXComponent.prototype.removeIfilesWithDelay = function (iFile, delay) {
532
- if (delay === void 0) { delay = 2000; }
533
- return __awaiter(this, void 0, void 0, function () {
534
- var _this = this;
535
- return __generator(this, function (_a) {
536
- window.setTimeout(function () {
537
- var index = _this.iFileArray.findIndex(function (element) { return element === iFile; });
538
- if (index >= 0) {
539
- _this.iFileArray.splice(index, 1);
540
- }
541
- }, delay);
542
- return [2 /*return*/];
543
- });
544
- });
545
- };
546
- DIMXComponent.prototype.clearIFilesWithDelay = function (delay) {
547
- if (delay === void 0) { delay = 2000; }
548
- return __awaiter(this, void 0, void 0, function () {
549
- var _this = this;
550
- return __generator(this, function (_a) {
551
- window.setTimeout(function () {
552
- _this.iFileArray = [];
553
- }, delay);
554
- return [2 /*return*/];
555
- });
556
- });
557
- };
558
- DIMXComponent.prototype.uploadFile = function (options) {
559
- this.dimxImportOptions = options;
560
- var elem = document.getElementById("fileuploader");
561
- if (elem && document.createEvent) {
562
- var evt = document.createEvent("MouseEvents");
563
- evt.initEvent("click", true, false);
564
- elem.dispatchEvent(evt);
565
- }
566
- // this.fileField?.nativeElement.click();
567
- };
568
- DIMXComponent.prototype.IsFileInProgress = function (iFile) {
569
- return iFile.status == "downloading" || iFile.status == "uploading";
570
- };
571
- DIMXComponent.prototype.AnyFilesInProgress = function () {
572
- if (this.iFileArray.find(this.IsFileInProgress) === undefined) {
573
- return false;
574
- }
575
- return true;
576
- };
577
- DIMXComponent.prototype.GetDoneEventBody = function () {
578
- return this.iFileArray.map(function (iFile) {
579
- return {
580
- "FileName": iFile.name,
581
- "Status": iFile.status,
582
- "ReturnedObject": iFile.returnedObject
583
- };
584
- });
585
- };
586
- DIMXComponent.prototype.SendDoneEventIfDone = function () {
587
- return __awaiter(this, void 0, void 0, function () {
588
- var eventObject;
589
- return __generator(this, function (_a) {
590
- switch (_a.label) {
591
- case 0:
592
- if (this.AnyFilesInProgress()) {
593
- return [2 /*return*/];
594
- }
595
- eventObject = this.GetDoneEventBody();
596
- this.DIMXProcessDone.emit(eventObject);
597
- return [4 /*yield*/, this.clearIFilesWithDelay()];
598
- case 1:
599
- _a.sent();
600
- return [2 /*return*/];
601
- }
602
- });
603
- });
604
- };
605
- DIMXComponent.prototype.dimximportrun = function (e) {
606
- return __awaiter(this, void 0, void 0, function () {
607
- var files, fileListAsArray;
608
- var _this = this;
609
- return __generator(this, function (_a) {
610
- console.log("Enter DIMXImportRun");
611
- files = e.target.files;
612
- fileListAsArray = Array.from(files);
613
- fileListAsArray.forEach(function (file, i) { return __awaiter(_this, void 0, void 0, function () {
614
- var filex, dimx_import_relativeURL, str, ext, value, dimxUploadObject, iFile, header, res, poll_result, ex_2;
615
- return __generator(this, function (_a) {
616
- switch (_a.label) {
617
- case 0:
618
- filex = file;
619
- dimx_import_relativeURL = "/addons/api/44c97115-6d14-4626-91dc-83f176e9a0fc/api/file_import_upload";
620
- return [4 /*yield*/, this.toBase64(filex)];
621
- case 1:
622
- str = (_a.sent());
623
- ext = filex.name.split('.')[1];
624
- value = { fileStr: str, fileExt: ext };
625
- dimxUploadObject = Object.assign(Object.assign(Object.assign({}, this.getPFSUploadObject(value)), this.dimxImportOptions), { Resource: this.DIMXResource, AddonUUID: this.DIMXAddonUUID });
626
- iFile = this.createNewIFile(filex.name, "uploading");
627
- console.log("created new iFile: " + iFile);
628
- this.iFileArray.push(iFile);
629
- console.log("added iFile to iFileArray");
630
- _a.label = 2;
631
- case 2:
632
- _a.trys.push([2, 6, , 8]);
633
- console.log("posting to dimx import_upload now");
634
- header = {};
635
- if (dimxUploadObject.ActionID) {
636
- header["X-Pepperi-ActionID"] = dimxUploadObject.ActionID;
637
- }
638
- if (dimxUploadObject.OwnerID) {
639
- header["X-Pepperi-OwnerID"] = dimxUploadObject.OwnerID;
640
- }
641
- return [4 /*yield*/, this.addonService.papiClient.post(dimx_import_relativeURL, dimxUploadObject, header)];
642
- case 3:
643
- res = _a.sent();
644
- console.log("Got reply from dimx, calling poll with the result:");
645
- console.log(JSON.stringify(res));
646
- return [4 /*yield*/, this.pollDIMXResult(res['ExecutionUUID'], iFile)];
647
- case 4:
648
- poll_result = _a.sent();
649
- if (poll_result === null) {
650
- return [2 /*return*/];
651
- }
652
- console.log("done polling, got result: " + JSON.stringify(poll_result));
653
- iFile.status = "done";
654
- iFile.returnedObject = poll_result;
655
- return [4 /*yield*/, this.SendDoneEventIfDone()];
656
- case 5:
657
- _a.sent();
658
- console.log("Imported the file");
659
- return [3 /*break*/, 8];
660
- case 6:
661
- ex_2 = _a.sent();
662
- console.log("DIMXImportRun: " + ex_2);
663
- iFile.status = "failed";
664
- iFile.returnedObject = { "ErrorMessage": ex_2.message };
665
- return [4 /*yield*/, this.SendDoneEventIfDone()];
666
- case 7:
667
- _a.sent();
668
- //await this.removeIfileWithDelay(iFile, 2000);
669
- return [2 /*return*/];
670
- case 8: return [2 /*return*/];
671
- }
672
- });
673
- }); });
674
- return [2 /*return*/];
675
- });
676
- });
677
- };
678
- DIMXComponent.prototype.getNewPFSUploadKey = function (fileExt) {
679
- var uuid = i1.PepGuid.newGuid();
680
- var folder = 'DIMX_import';
681
- var pfsKey = "/" + folder + "/" + uuid + "." + fileExt;
682
- return pfsKey;
683
- };
684
- DIMXComponent.prototype.getPFSUploadObject = function (value) {
685
- var fileStrArr = value.fileStr.split(';');
686
- var mime = fileStrArr[0].split(':')[1];
687
- var pfsKey = this.getNewPFSUploadKey(value.fileExt);
688
- var pfsUploadObject = {
689
- "Key": pfsKey,
690
- "MIME": mime,
691
- "URI": value.fileStr
692
- };
693
- return pfsUploadObject;
694
- };
695
- DIMXComponent.prototype.DIMXExportRun = function (value) {
696
- return __awaiter(this, void 0, void 0, function () {
697
- var bod, fileName, iFile, header, res, result, url, blob, ex_3;
698
- return __generator(this, function (_a) {
699
- switch (_a.label) {
700
- case 0:
701
- if (!value) {
702
- value = {};
703
- }
704
- if (!value.DIMXExportFormat) {
705
- value.DIMXExportFormat = 'json';
706
- }
707
- if (!value.DIMXExportIncludeDeleted) {
708
- value.DIMXExportIncludeDeleted = false;
709
- }
710
- if (!value.DIMXExportFileName) {
711
- value.DIMXExportFileName = 'export';
712
- }
713
- bod = this.getDIMXExportPOSTBody(value ? value : {});
714
- fileName = this.getNewFileName(value);
715
- iFile = this.createNewIFile(fileName, "downloading");
716
- console.log("created new iFile: " + iFile);
717
- this.iFileArray.push(iFile);
718
- console.log("added iFile to iFileArray");
719
- _a.label = 1;
720
- case 1:
721
- _a.trys.push([1, 6, , 8]);
722
- console.log("posting to dimx export now");
723
- header = {};
724
- if (value.ActionID) {
725
- header["X-Pepperi-ActionID"] = value.ActionID;
726
- }
727
- return [4 /*yield*/, this.addonService.papiClient.post("/addons/data/export/file/" + this.DIMXAddonUUID + "/" + this.DIMXResource, bod, header)];
728
- case 2:
729
- res = _a.sent();
730
- console.log("Got reply from dimx, calling poll with the result:");
731
- console.log(res);
732
- return [4 /*yield*/, this.pollDIMXResult(res['ExecutionUUID'], iFile)];
733
- case 3:
734
- result = _a.sent();
735
- if (result === null) {
736
- return [2 /*return*/];
737
- }
738
- url = result["DownloadURL"];
739
- console.log("attempting to download the file");
740
- console.log("url is: " + url);
741
- return [4 /*yield*/, fetch(url).then(function (r) { return r.blob(); })];
742
- case 4:
743
- blob = _a.sent();
744
- fileSaver.saveAs(blob, fileName);
745
- iFile.status = "done";
746
- iFile.returnedObject = result;
747
- return [4 /*yield*/, this.SendDoneEventIfDone()];
748
- case 5:
749
- _a.sent();
750
- console.log("downloaded the file");
751
- return [3 /*break*/, 8];
752
- case 6:
753
- ex_3 = _a.sent();
754
- iFile.status = "failed";
755
- iFile.returnedObject = { "ErrorMessage": ex_3.message };
756
- return [4 /*yield*/, this.SendDoneEventIfDone()];
757
- case 7:
758
- _a.sent();
759
- //await this.removeIfileWithDelay(iFile);
760
- console.log("buttonClick: " + ex_3);
761
- return [2 /*return*/];
762
- case 8: return [2 /*return*/];
763
- }
764
- });
765
- });
766
- };
767
- return DIMXComponent;
768
- }());
769
- DIMXComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXComponent, deps: [{ token: i1__namespace$1.TranslateService }, { token: DIMXService }], target: i0__namespace.ɵɵFactoryTarget.Component });
770
- DIMXComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: DIMXComponent, selector: "pep-dimx", inputs: { DIMXAddonUUID: "DIMXAddonUUID", DIMXResource: "DIMXResource" }, outputs: { DIMXProcessDone: "DIMXProcessDone" }, viewQueries: [{ propertyName: "fileField", first: true, predicate: ["fileField"], descendants: true }], ngImport: i0__namespace, template: "<pep-file-status-panel [title]=\"'File Imports/Exports'\" *ngIf=\"iFileArray?.length\" [filesList]=\"iFileArray\"></pep-file-status-panel>\n<input type=\"file\" multiple=\"multiple\" name=\"avatars\" id=\"fileuploader\" #fileField (change)=\"dimximportrun($event)\">\n<!-- <pep-button\n value=\"export\"\n styleType=\"strong\"\n styleStateType=\"success\"\n sizeType=\"sm\"\n classNames=\"hahah\"\n iconName=\"system_doc\"\n (buttonClick)=\"buttonClick($event)\"\n></pep-button> -->", styles: ["#fileuploader{display:none}:host{width:100%}:host .shadow-size-group,:host .shadow-type-group{display:block;margin-bottom:var(--pep-form-spacing, 1rem)}\n"], components: [{ type: i3__namespace.FileStatusPanelComponent, selector: "pep-file-status-panel", inputs: ["title", "filesList"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
771
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXComponent, decorators: [{
772
- type: i0.Component,
773
- args: [{
774
- selector: 'pep-dimx',
775
- templateUrl: './dimx.component.html',
776
- styleUrls: ['./dimx.component.scss']
777
- }]
778
- }], ctorParameters: function () { return [{ type: i1__namespace$1.TranslateService }, { type: DIMXService }]; }, propDecorators: { fileField: [{
779
- type: i0.ViewChild,
780
- args: ['fileField']
781
- }], DIMXAddonUUID: [{
782
- type: i0.Input
783
- }], DIMXResource: [{
784
- type: i0.Input
785
- }], DIMXProcessDone: [{
786
- type: i0.Output
412
+ var DIMXComponent = /** @class */ (function () {
413
+ function DIMXComponent(translate, addonService) {
414
+ this.translate = translate;
415
+ this.addonService = addonService;
416
+ this.DIMXProcessDone = new i0.EventEmitter();
417
+ this.iFileID = 0;
418
+ this.iFileArray = [];
419
+ this.toBase64 = function (file) { return new Promise(function (resolve, reject) {
420
+ var reader = new FileReader();
421
+ reader.readAsDataURL(file);
422
+ reader.onload = function () { return resolve(reader.result); };
423
+ reader.onerror = function (error) { return reject(error); };
424
+ }); };
425
+ }
426
+ DIMXComponent.prototype.ngOnInit = function () {
427
+ // Get the first translation for load all translations.
428
+ this.translate.get('SHADOW_SETTINGS.INTENSITY_SOFT').toPromise().then(function (typeSoft) {
429
+ console.log("something");
430
+ });
431
+ };
432
+ DIMXComponent.prototype.getDIMXExportPOSTBody = function (value) {
433
+ return {
434
+ "Format": value.DIMXExportFormat,
435
+ "IncludeDeleted": value.DIMXExportIncludeDeleted,
436
+ "Where": value.DIMXExportWhere,
437
+ "Fields": value.DIMXExportFields,
438
+ "Delimiter": value.DIMXExportDelimiter
439
+ };
440
+ };
441
+ DIMXComponent.prototype.pollDIMXResult = function (pollingURL, ifile) {
442
+ return __awaiter(this, void 0, void 0, function () {
443
+ var delay, seconds, waitingTime, result, _a, ex_1;
444
+ return __generator(this, function (_b) {
445
+ switch (_b.label) {
446
+ case 0:
447
+ console.log("polling audit with the executionUUID: " + pollingURL);
448
+ delay = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); };
449
+ seconds = 0;
450
+ waitingTime = 1000;
451
+ _b.label = 1;
452
+ case 1:
453
+ _b.trys.push([1, 14, , 16]);
454
+ result = void 0;
455
+ _b.label = 2;
456
+ case 2:
457
+ if (!true) return [3 /*break*/, 7];
458
+ return [4 /*yield*/, this.addonService.papiClient.get("/audit_logs/" + pollingURL)];
459
+ case 3:
460
+ result = _b.sent();
461
+ console.log("result from auditlog get is: " + result);
462
+ if (!(!result || result["Status"]["ID"] === 2 || result["Status"]["ID"] === 4)) return [3 /*break*/, 5];
463
+ console.log("waited for " + seconds++ + " seconds");
464
+ return [4 /*yield*/, delay(waitingTime)];
465
+ case 4:
466
+ _b.sent();
467
+ return [3 /*break*/, 6];
468
+ case 5: return [3 /*break*/, 7];
469
+ case 6: return [3 /*break*/, 2];
470
+ case 7:
471
+ _a = result["Status"]["ID"];
472
+ switch (_a) {
473
+ case 0: return [3 /*break*/, 8];
474
+ case 1: return [3 /*break*/, 10];
475
+ }
476
+ return [3 /*break*/, 11];
477
+ case 8:
478
+ ifile.status = "failed";
479
+ ifile.returnedObject = { "ErrorMessage": result["AuditInfo"]["ErrorMessage"] };
480
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
481
+ case 9:
482
+ _b.sent();
483
+ return [2 /*return*/, null];
484
+ case 10:
485
+ console.log("polling result: " + result["AuditInfo"]["ResultObject"]);
486
+ return [2 /*return*/, JSON.parse(result["AuditInfo"]["ResultObject"])];
487
+ case 11:
488
+ ifile.status = "failed";
489
+ ifile.returnedObject = { "ErrorMessage": "unknown audit log type: " + result["Status"] };
490
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
491
+ case 12:
492
+ _b.sent();
493
+ return [2 /*return*/, null];
494
+ case 13: return [3 /*break*/, 16];
495
+ case 14:
496
+ ex_1 = _b.sent();
497
+ console.log("pollDIMXResult: " + ex_1);
498
+ ifile.status = "failed";
499
+ ifile.returnedObject = { "ErrorMessage": ex_1.message };
500
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
501
+ case 15:
502
+ _b.sent();
503
+ return [2 /*return*/, null];
504
+ case 16: return [2 /*return*/];
505
+ }
506
+ });
507
+ });
508
+ };
509
+ DIMXComponent.prototype.getNewFileName = function (value) {
510
+ var extension;
511
+ switch (value.DIMXExportFormat.toLowerCase()) {
512
+ case "json":
513
+ extension = ".json";
514
+ break;
515
+ case "csv":
516
+ extension = '.csv';
517
+ break;
518
+ default:
519
+ extension = "";
520
+ }
521
+ var filename = value.DIMXExportFileName;
522
+ return filename + extension;
523
+ };
524
+ DIMXComponent.prototype.createNewIFile = function (fileName, status) {
525
+ return {
526
+ "key": this.iFileID++,
527
+ "name": fileName,
528
+ "status": status
529
+ };
530
+ };
531
+ DIMXComponent.prototype.removeIfilesWithDelay = function (iFile, delay) {
532
+ if (delay === void 0) { delay = 2000; }
533
+ return __awaiter(this, void 0, void 0, function () {
534
+ var _this = this;
535
+ return __generator(this, function (_a) {
536
+ window.setTimeout(function () {
537
+ var index = _this.iFileArray.findIndex(function (element) { return element === iFile; });
538
+ if (index >= 0) {
539
+ _this.iFileArray.splice(index, 1);
540
+ }
541
+ }, delay);
542
+ return [2 /*return*/];
543
+ });
544
+ });
545
+ };
546
+ DIMXComponent.prototype.clearIFilesWithDelay = function (delay) {
547
+ if (delay === void 0) { delay = 2000; }
548
+ return __awaiter(this, void 0, void 0, function () {
549
+ var _this = this;
550
+ return __generator(this, function (_a) {
551
+ window.setTimeout(function () {
552
+ _this.iFileArray = [];
553
+ }, delay);
554
+ return [2 /*return*/];
555
+ });
556
+ });
557
+ };
558
+ DIMXComponent.prototype.uploadFile = function (options) {
559
+ this.dimxImportOptions = options;
560
+ var elem = document.getElementById("fileuploader");
561
+ if (elem && document.createEvent) {
562
+ var evt = document.createEvent("MouseEvents");
563
+ evt.initEvent("click", true, false);
564
+ elem.dispatchEvent(evt);
565
+ }
566
+ // this.fileField?.nativeElement.click();
567
+ };
568
+ DIMXComponent.prototype.IsFileInProgress = function (iFile) {
569
+ return iFile.status == "downloading" || iFile.status == "uploading";
570
+ };
571
+ DIMXComponent.prototype.AnyFilesInProgress = function () {
572
+ if (this.iFileArray.find(this.IsFileInProgress) === undefined) {
573
+ return false;
574
+ }
575
+ return true;
576
+ };
577
+ DIMXComponent.prototype.GetDoneEventBody = function () {
578
+ return this.iFileArray.map(function (iFile) {
579
+ return {
580
+ "FileName": iFile.name,
581
+ "Status": iFile.status,
582
+ "ReturnedObject": iFile.returnedObject
583
+ };
584
+ });
585
+ };
586
+ DIMXComponent.prototype.SendDoneEventIfDone = function () {
587
+ return __awaiter(this, void 0, void 0, function () {
588
+ var eventObject;
589
+ return __generator(this, function (_a) {
590
+ switch (_a.label) {
591
+ case 0:
592
+ if (this.AnyFilesInProgress()) {
593
+ return [2 /*return*/];
594
+ }
595
+ eventObject = this.GetDoneEventBody();
596
+ this.DIMXProcessDone.emit(eventObject);
597
+ return [4 /*yield*/, this.clearIFilesWithDelay()];
598
+ case 1:
599
+ _a.sent();
600
+ return [2 /*return*/];
601
+ }
602
+ });
603
+ });
604
+ };
605
+ DIMXComponent.prototype.dimximportrun = function (e) {
606
+ return __awaiter(this, void 0, void 0, function () {
607
+ var files, fileListAsArray;
608
+ var _this = this;
609
+ return __generator(this, function (_a) {
610
+ console.log("Enter DIMXImportRun");
611
+ files = e.target.files;
612
+ fileListAsArray = Array.from(files);
613
+ fileListAsArray.forEach(function (file, i) { return __awaiter(_this, void 0, void 0, function () {
614
+ var filex, dimx_import_relativeURL, str, ext, value, dimxUploadObject, iFile, header, res, poll_result, ex_2;
615
+ return __generator(this, function (_a) {
616
+ switch (_a.label) {
617
+ case 0:
618
+ filex = file;
619
+ dimx_import_relativeURL = "/addons/api/44c97115-6d14-4626-91dc-83f176e9a0fc/api/file_import_upload";
620
+ return [4 /*yield*/, this.toBase64(filex)];
621
+ case 1:
622
+ str = (_a.sent());
623
+ ext = filex.name.split('.')[1];
624
+ value = { fileStr: str, fileExt: ext };
625
+ dimxUploadObject = Object.assign(Object.assign(Object.assign({}, this.getPFSUploadObject(value)), this.dimxImportOptions), { Resource: this.DIMXResource, AddonUUID: this.DIMXAddonUUID });
626
+ iFile = this.createNewIFile(filex.name, "uploading");
627
+ console.log("created new iFile: " + iFile);
628
+ this.iFileArray.push(iFile);
629
+ console.log("added iFile to iFileArray");
630
+ _a.label = 2;
631
+ case 2:
632
+ _a.trys.push([2, 6, , 8]);
633
+ console.log("posting to dimx import_upload now");
634
+ header = {};
635
+ if (dimxUploadObject.ActionID) {
636
+ header["X-Pepperi-ActionID"] = dimxUploadObject.ActionID;
637
+ }
638
+ if (dimxUploadObject.OwnerID) {
639
+ header["X-Pepperi-OwnerID"] = dimxUploadObject.OwnerID;
640
+ }
641
+ return [4 /*yield*/, this.addonService.papiClient.post(dimx_import_relativeURL, dimxUploadObject, header)];
642
+ case 3:
643
+ res = _a.sent();
644
+ console.log("Got reply from dimx, calling poll with the result:");
645
+ console.log(JSON.stringify(res));
646
+ return [4 /*yield*/, this.pollDIMXResult(res['ExecutionUUID'], iFile)];
647
+ case 4:
648
+ poll_result = _a.sent();
649
+ if (poll_result === null) {
650
+ return [2 /*return*/];
651
+ }
652
+ console.log("done polling, got result: " + JSON.stringify(poll_result));
653
+ iFile.status = "done";
654
+ iFile.returnedObject = poll_result;
655
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
656
+ case 5:
657
+ _a.sent();
658
+ console.log("Imported the file");
659
+ return [3 /*break*/, 8];
660
+ case 6:
661
+ ex_2 = _a.sent();
662
+ console.log("DIMXImportRun: " + ex_2);
663
+ iFile.status = "failed";
664
+ iFile.returnedObject = { "ErrorMessage": ex_2.message };
665
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
666
+ case 7:
667
+ _a.sent();
668
+ //await this.removeIfileWithDelay(iFile, 2000);
669
+ return [2 /*return*/];
670
+ case 8: return [2 /*return*/];
671
+ }
672
+ });
673
+ }); });
674
+ return [2 /*return*/];
675
+ });
676
+ });
677
+ };
678
+ DIMXComponent.prototype.getNewPFSUploadKey = function (fileExt) {
679
+ var uuid = i1.PepGuid.newGuid();
680
+ var folder = 'DIMX_import';
681
+ var pfsKey = "/" + folder + "/" + uuid + "." + fileExt;
682
+ return pfsKey;
683
+ };
684
+ DIMXComponent.prototype.getPFSUploadObject = function (value) {
685
+ var fileStrArr = value.fileStr.split(';');
686
+ var mime = fileStrArr[0].split(':')[1];
687
+ var pfsKey = this.getNewPFSUploadKey(value.fileExt);
688
+ var pfsUploadObject = {
689
+ "Key": pfsKey,
690
+ "MIME": mime,
691
+ "URI": value.fileStr
692
+ };
693
+ return pfsUploadObject;
694
+ };
695
+ DIMXComponent.prototype.DIMXExportRun = function (value) {
696
+ return __awaiter(this, void 0, void 0, function () {
697
+ var bod, fileName, iFile, header, res, result, url, blob, ex_3;
698
+ return __generator(this, function (_a) {
699
+ switch (_a.label) {
700
+ case 0:
701
+ if (!value) {
702
+ value = {};
703
+ }
704
+ if (!value.DIMXExportFormat) {
705
+ value.DIMXExportFormat = 'json';
706
+ }
707
+ if (!value.DIMXExportIncludeDeleted) {
708
+ value.DIMXExportIncludeDeleted = false;
709
+ }
710
+ if (!value.DIMXExportFileName) {
711
+ value.DIMXExportFileName = 'export';
712
+ }
713
+ bod = this.getDIMXExportPOSTBody(value ? value : {});
714
+ fileName = this.getNewFileName(value);
715
+ iFile = this.createNewIFile(fileName, "downloading");
716
+ console.log("created new iFile: " + iFile);
717
+ this.iFileArray.push(iFile);
718
+ console.log("added iFile to iFileArray");
719
+ _a.label = 1;
720
+ case 1:
721
+ _a.trys.push([1, 6, , 8]);
722
+ console.log("posting to dimx export now");
723
+ header = {};
724
+ if (value.ActionID) {
725
+ header["X-Pepperi-ActionID"] = value.ActionID;
726
+ }
727
+ return [4 /*yield*/, this.addonService.papiClient.post("/addons/data/export/file/" + this.DIMXAddonUUID + "/" + this.DIMXResource, bod, header)];
728
+ case 2:
729
+ res = _a.sent();
730
+ console.log("Got reply from dimx, calling poll with the result:");
731
+ console.log(res);
732
+ return [4 /*yield*/, this.pollDIMXResult(res['ExecutionUUID'], iFile)];
733
+ case 3:
734
+ result = _a.sent();
735
+ if (result === null) {
736
+ return [2 /*return*/];
737
+ }
738
+ url = result["DownloadURL"];
739
+ console.log("attempting to download the file");
740
+ console.log("url is: " + url);
741
+ return [4 /*yield*/, fetch(url).then(function (r) { return r.blob(); })];
742
+ case 4:
743
+ blob = _a.sent();
744
+ fileSaver.saveAs(blob, fileName);
745
+ iFile.status = "done";
746
+ iFile.returnedObject = result;
747
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
748
+ case 5:
749
+ _a.sent();
750
+ console.log("downloaded the file");
751
+ return [3 /*break*/, 8];
752
+ case 6:
753
+ ex_3 = _a.sent();
754
+ iFile.status = "failed";
755
+ iFile.returnedObject = { "ErrorMessage": ex_3.message };
756
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
757
+ case 7:
758
+ _a.sent();
759
+ //await this.removeIfileWithDelay(iFile);
760
+ console.log("buttonClick: " + ex_3);
761
+ return [2 /*return*/];
762
+ case 8: return [2 /*return*/];
763
+ }
764
+ });
765
+ });
766
+ };
767
+ return DIMXComponent;
768
+ }());
769
+ DIMXComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXComponent, deps: [{ token: i1__namespace$1.TranslateService }, { token: DIMXService }], target: i0__namespace.ɵɵFactoryTarget.Component });
770
+ DIMXComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: DIMXComponent, selector: "pep-dimx", inputs: { DIMXAddonUUID: "DIMXAddonUUID", DIMXResource: "DIMXResource" }, outputs: { DIMXProcessDone: "DIMXProcessDone" }, viewQueries: [{ propertyName: "fileField", first: true, predicate: ["fileField"], descendants: true }], ngImport: i0__namespace, template: "<pep-file-status-panel [title]=\"'File Imports/Exports'\" *ngIf=\"iFileArray?.length\" [filesList]=\"iFileArray\"></pep-file-status-panel>\n<input type=\"file\" multiple=\"multiple\" name=\"avatars\" id=\"fileuploader\" #fileField (change)=\"dimximportrun($event)\">\n<!-- <pep-button\n value=\"export\"\n styleType=\"strong\"\n styleStateType=\"success\"\n sizeType=\"sm\"\n classNames=\"hahah\"\n iconName=\"system_doc\"\n (buttonClick)=\"buttonClick($event)\"\n></pep-button> -->", styles: ["#fileuploader{display:none}:host{width:100%}:host .shadow-size-group,:host .shadow-type-group{display:block;margin-bottom:var(--pep-form-spacing, 1rem)}\n"], components: [{ type: i3__namespace.FileStatusPanelComponent, selector: "pep-file-status-panel", inputs: ["title", "filesList"], outputs: ["closeClick"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
771
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXComponent, decorators: [{
772
+ type: i0.Component,
773
+ args: [{
774
+ selector: 'pep-dimx',
775
+ templateUrl: './dimx.component.html',
776
+ styleUrls: ['./dimx.component.scss']
777
+ }]
778
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.TranslateService }, { type: DIMXService }]; }, propDecorators: { fileField: [{
779
+ type: i0.ViewChild,
780
+ args: ['fileField']
781
+ }], DIMXAddonUUID: [{
782
+ type: i0.Input
783
+ }], DIMXResource: [{
784
+ type: i0.Input
785
+ }], DIMXProcessDone: [{
786
+ type: i0.Output
787
787
  }] } });
788
788
 
789
- var pepIcons = [
790
- i1$2.pepIconSystemDoc,
791
- ];
792
- var PepDIMXModule = /** @class */ (function () {
793
- function PepDIMXModule(pepIconRegistry) {
794
- this.pepIconRegistry = pepIconRegistry;
795
- this.pepIconRegistry.registerIcons(pepIcons);
796
- }
797
- return PepDIMXModule;
798
- }());
799
- PepDIMXModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, deps: [{ token: i1__namespace$2.PepIconRegistry }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
800
- PepDIMXModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, declarations: [DIMXComponent], imports: [i4.CommonModule,
801
- i1.PepNgxLibModule,
802
- button.PepButtonModule,
803
- i1$2.PepIconModule,
804
- i3.PepFileStatusPanelModule], exports: [DIMXComponent] });
805
- PepDIMXModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, imports: [[
806
- i4.CommonModule,
807
- i1.PepNgxLibModule,
808
- button.PepButtonModule,
809
- i1$2.PepIconModule,
810
- i3.PepFileStatusPanelModule,
811
- ]] });
812
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, decorators: [{
813
- type: i0.NgModule,
814
- args: [{
815
- declarations: [
816
- DIMXComponent
817
- ],
818
- imports: [
819
- i4.CommonModule,
820
- i1.PepNgxLibModule,
821
- button.PepButtonModule,
822
- i1$2.PepIconModule,
823
- i3.PepFileStatusPanelModule,
824
- ],
825
- exports: [DIMXComponent]
826
- }]
789
+ var pepIcons = [
790
+ i1$2.pepIconSystemDoc,
791
+ ];
792
+ var PepDIMXModule = /** @class */ (function () {
793
+ function PepDIMXModule(pepIconRegistry) {
794
+ this.pepIconRegistry = pepIconRegistry;
795
+ this.pepIconRegistry.registerIcons(pepIcons);
796
+ }
797
+ return PepDIMXModule;
798
+ }());
799
+ PepDIMXModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, deps: [{ token: i1__namespace$2.PepIconRegistry }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
800
+ PepDIMXModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, declarations: [DIMXComponent], imports: [i4.CommonModule,
801
+ i1.PepNgxLibModule,
802
+ button.PepButtonModule,
803
+ i1$2.PepIconModule,
804
+ i3.PepFileStatusPanelModule], exports: [DIMXComponent] });
805
+ PepDIMXModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, imports: [[
806
+ i4.CommonModule,
807
+ i1.PepNgxLibModule,
808
+ button.PepButtonModule,
809
+ i1$2.PepIconModule,
810
+ i3.PepFileStatusPanelModule,
811
+ ]] });
812
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, decorators: [{
813
+ type: i0.NgModule,
814
+ args: [{
815
+ declarations: [
816
+ DIMXComponent
817
+ ],
818
+ imports: [
819
+ i4.CommonModule,
820
+ i1.PepNgxLibModule,
821
+ button.PepButtonModule,
822
+ i1$2.PepIconModule,
823
+ i3.PepFileStatusPanelModule,
824
+ ],
825
+ exports: [DIMXComponent]
826
+ }]
827
827
  }], ctorParameters: function () { return [{ type: i1__namespace$2.PepIconRegistry }]; } });
828
828
 
829
- var IFile = /** @class */ (function () {
830
- function IFile() {
831
- this.key = 0;
832
- this.name = '';
833
- this.status = 'downloading';
834
- }
835
- return IFile;
836
- }());
837
- var IFileExt = /** @class */ (function () {
838
- function IFileExt() {
839
- this.key = 0;
840
- this.name = '';
841
- this.status = 'downloading';
842
- }
843
- return IFileExt;
844
- }());
829
+ var IFileExt = /** @class */ (function (_super) {
830
+ __extends(IFileExt, _super);
831
+ function IFileExt() {
832
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
833
+ _this.status = 'downloading';
834
+ return _this;
835
+ }
836
+ return IFileExt;
837
+ }(i3.FileStatus));
845
838
 
846
- /*
847
- * Public API Surface of ngx-composite-lib/shadow-settings
839
+ /*
840
+ * Public API Surface of ngx-composite-lib/dimx-export
848
841
  */
849
842
 
850
- /**
851
- * Generated bundle index. Do not edit.
843
+ /**
844
+ * Generated bundle index. Do not edit.
852
845
  */
853
846
 
854
847
  exports.DIMXComponent = DIMXComponent;
855
- exports.IFile = IFile;
856
848
  exports.IFileExt = IFileExt;
857
849
  exports.PepDIMXModule = PepDIMXModule;
858
850