@crystaldesign/diva-core 26.12.0-beta.4 → 26.12.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/esm/{ModalsWrapper-295ae4f7.js → ModalsWrapper-a4822f5c.js} +1 -1
- package/build/esm/{index-07a0ab90.js → index-828554cb.js} +327 -206
- package/build/esm/{index-caf6b87d.js → index-d7d2bbf9.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/types/core/src/externalTypes.d.ts +4 -0
- package/build/types/core/src/externalTypes.d.ts.map +1 -1
- package/build/types/core/src/handler/AIHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/MediaHandler/index.d.ts +5 -0
- package/build/types/core/src/handler/MediaHandler/index.d.ts.map +1 -1
- package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
- package/build/types/core/src/tests/MediaHandler.refsByIds.test.d.ts +2 -0
- package/build/types/core/src/tests/MediaHandler.refsByIds.test.d.ts.map +1 -0
- package/build/types/core/src/utils/updateCssThemeVariables.d.ts.map +1 -1
- package/build/types/core/src/utils/usdzExporterCompat.d.ts +3 -0
- package/build/types/core/src/utils/usdzExporterCompat.d.ts.map +1 -0
- package/build/umd/388.diva-core.umd.min.js +1 -1
- package/build/umd/626.diva-core.umd.min.js +408 -0
- package/build/umd/{229.diva-core.umd.min.js.LICENSE.txt → 626.diva-core.umd.min.js.LICENSE.txt} +1 -8
- package/build/umd/741.diva-core.umd.min.js +1 -1
- package/build/umd/89.diva-core.umd.min.js +2 -0
- package/build/umd/89.diva-core.umd.min.js.LICENSE.txt +7 -0
- package/build/umd/diva-core.umd.min.js +2 -2
- package/build/umd/report.html +1 -1
- package/package.json +10 -10
- package/build/umd/229.diva-core.umd.min.js +0 -408
|
@@ -43,7 +43,7 @@ import HelpOutline from '@mui/icons-material/HelpOutline';
|
|
|
43
43
|
import { actions } from '@storybook/addon-actions';
|
|
44
44
|
|
|
45
45
|
(function() {
|
|
46
|
-
const env = {"STAGE":"production","VERSION":"26.12.0-beta.
|
|
46
|
+
const env = {"STAGE":"production","VERSION":"26.12.0-beta.40"};
|
|
47
47
|
try {
|
|
48
48
|
if (process) {
|
|
49
49
|
process.env = Object.assign({}, process.env);
|
|
@@ -2129,6 +2129,47 @@ function buildResizeObserver(ref, onResize) {
|
|
|
2129
2129
|
return resizeObserver;
|
|
2130
2130
|
}
|
|
2131
2131
|
|
|
2132
|
+
var applied = false;
|
|
2133
|
+
|
|
2134
|
+
/** Restores the promise-returning `USDZExporter.parse(scene)` that @google/model-viewer 3.5.0 awaits; three >= 0.170 made it callback-based. */
|
|
2135
|
+
function ensureUsdzExporterParseCompat() {
|
|
2136
|
+
return _ensureUsdzExporterParseCompat.apply(this, arguments);
|
|
2137
|
+
}
|
|
2138
|
+
function _ensureUsdzExporterParseCompat() {
|
|
2139
|
+
_ensureUsdzExporterParseCompat = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
2140
|
+
var _yield$import, USDZExporter, originalParse;
|
|
2141
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2142
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2143
|
+
case 0:
|
|
2144
|
+
if (!applied) {
|
|
2145
|
+
_context.next = 2;
|
|
2146
|
+
break;
|
|
2147
|
+
}
|
|
2148
|
+
return _context.abrupt("return");
|
|
2149
|
+
case 2:
|
|
2150
|
+
applied = true;
|
|
2151
|
+
_context.next = 5;
|
|
2152
|
+
return import('three/examples/jsm/exporters/USDZExporter.js');
|
|
2153
|
+
case 5:
|
|
2154
|
+
_yield$import = _context.sent;
|
|
2155
|
+
USDZExporter = _yield$import.USDZExporter;
|
|
2156
|
+
originalParse = USDZExporter.prototype.parse;
|
|
2157
|
+
USDZExporter.prototype.parse = function (scene, onDone, onError, options) {
|
|
2158
|
+
if (typeof onDone === 'function') {
|
|
2159
|
+
originalParse.call(this, scene, onDone, onError, options);
|
|
2160
|
+
return;
|
|
2161
|
+
}
|
|
2162
|
+
return this.parseAsync(scene, options);
|
|
2163
|
+
};
|
|
2164
|
+
case 9:
|
|
2165
|
+
case "end":
|
|
2166
|
+
return _context.stop();
|
|
2167
|
+
}
|
|
2168
|
+
}, _callee);
|
|
2169
|
+
}));
|
|
2170
|
+
return _ensureUsdzExporterParseCompat.apply(this, arguments);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2132
2173
|
var THEME_VARIABLES = [['--diva-theme-palette-primary-main', function (t) {
|
|
2133
2174
|
return t.palette.primary.main;
|
|
2134
2175
|
}], ['--diva-theme-palette-primary-dark', function (t) {
|
|
@@ -2149,6 +2190,15 @@ var THEME_VARIABLES = [['--diva-theme-palette-primary-main', function (t) {
|
|
|
2149
2190
|
return t.palette.text.primary;
|
|
2150
2191
|
}], ['--diva-theme-palette-text-secondary', function (t) {
|
|
2151
2192
|
return t.palette.text.secondary;
|
|
2193
|
+
}],
|
|
2194
|
+
// Background is optional in org themes — fall back to the MUI-light look so
|
|
2195
|
+
// the variables always resolve for consumers.
|
|
2196
|
+
['--diva-theme-palette-background-default', function (t) {
|
|
2197
|
+
var _t$palette$background, _t$palette;
|
|
2198
|
+
return (_t$palette$background = (_t$palette = t.palette) === null || _t$palette === void 0 || (_t$palette = _t$palette.background) === null || _t$palette === void 0 ? void 0 : _t$palette["default"]) !== null && _t$palette$background !== void 0 ? _t$palette$background : '#fafafa';
|
|
2199
|
+
}], ['--diva-theme-palette-background-paper', function (t) {
|
|
2200
|
+
var _t$palette$background2, _t$palette2;
|
|
2201
|
+
return (_t$palette$background2 = (_t$palette2 = t.palette) === null || _t$palette2 === void 0 || (_t$palette2 = _t$palette2.background) === null || _t$palette2 === void 0 ? void 0 : _t$palette2.paper) !== null && _t$palette$background2 !== void 0 ? _t$palette$background2 : '#ffffff';
|
|
2152
2202
|
}], ['--diva-typography-font-family', function (t) {
|
|
2153
2203
|
return t.typography.fontFamily;
|
|
2154
2204
|
}]];
|
|
@@ -2183,7 +2233,7 @@ function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.lengt
|
|
|
2183
2233
|
function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2184
2234
|
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2185
2235
|
var LOG$a = getLogger('Framework', 'ContentStore');
|
|
2186
|
-
var ALLOWED_WRAPPER_MODULES = ['ARCHIVE', 'PRODUCT_LIST', 'SALES_MANAGER', 'DIVA_BACKOFFICE_NEW'];
|
|
2236
|
+
var ALLOWED_WRAPPER_MODULES = ['ARCHIVE', 'PRODUCT_LIST', 'SALES_MANAGER', 'DIVA_BACKOFFICE_NEW', 'DIVA_DATA_ENGINE'];
|
|
2187
2237
|
var ContentStore = /*#__PURE__*/function () {
|
|
2188
2238
|
function ContentStore(components, root) {
|
|
2189
2239
|
var _this = this;
|
|
@@ -2236,6 +2286,8 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2236
2286
|
return 'Planner';
|
|
2237
2287
|
case 'DIVA_BACKOFFICE_NEW':
|
|
2238
2288
|
return 'BackofficeNew';
|
|
2289
|
+
case 'DIVA_DATA_ENGINE':
|
|
2290
|
+
return 'DataEngine';
|
|
2239
2291
|
case 'AR_VIEWER':
|
|
2240
2292
|
return 'ARViewer';
|
|
2241
2293
|
case 'USER_MANAGER':
|
|
@@ -2421,13 +2473,16 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2421
2473
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2422
2474
|
case 0:
|
|
2423
2475
|
if (!(!this._modelViewerHasLoaded && !window.customElements.get('model-viewer'))) {
|
|
2424
|
-
_context2.next =
|
|
2476
|
+
_context2.next = 6;
|
|
2425
2477
|
break;
|
|
2426
2478
|
}
|
|
2427
2479
|
this._modelViewerHasLoaded = true;
|
|
2428
2480
|
_context2.next = 4;
|
|
2429
|
-
return
|
|
2481
|
+
return ensureUsdzExporterParseCompat();
|
|
2430
2482
|
case 4:
|
|
2483
|
+
_context2.next = 6;
|
|
2484
|
+
return import('@google/model-viewer');
|
|
2485
|
+
case 6:
|
|
2431
2486
|
case "end":
|
|
2432
2487
|
return _context2.stop();
|
|
2433
2488
|
}
|
|
@@ -6264,6 +6319,8 @@ function initCookieBot(cbid, onConsentReady, onCookieBotError) {
|
|
|
6264
6319
|
}, COOKIEBOT_LOAD_TIMEOUT_MS);
|
|
6265
6320
|
}
|
|
6266
6321
|
|
|
6322
|
+
/** Ref ids one `getMediaItemRefsByIds` request names, so the URL stays well below the usual length limits. */
|
|
6323
|
+
var MEDIA_ITEM_REF_CHUNK_SIZE = 100;
|
|
6267
6324
|
var MediaHandler = /*#__PURE__*/function () {
|
|
6268
6325
|
function MediaHandler(root) {
|
|
6269
6326
|
_classCallCheck(this, MediaHandler);
|
|
@@ -6411,18 +6468,79 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6411
6468
|
return _getMediaItemByRefId.apply(this, arguments);
|
|
6412
6469
|
}
|
|
6413
6470
|
return getMediaItemByRefId;
|
|
6414
|
-
}()
|
|
6471
|
+
}()
|
|
6472
|
+
/**
|
|
6473
|
+
* Fetches the MediaItemRef documents of many ref ids with one request per 100 ids, instead of one request per id.
|
|
6474
|
+
* The list endpoint answers 20 documents unless told otherwise, so each request asks for as many as it names.
|
|
6475
|
+
*/
|
|
6415
6476
|
}, {
|
|
6416
|
-
key: "
|
|
6477
|
+
key: "getMediaItemRefsByIds",
|
|
6417
6478
|
value: (function () {
|
|
6418
|
-
var
|
|
6419
|
-
var
|
|
6479
|
+
var _getMediaItemRefsByIds = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(ids) {
|
|
6480
|
+
var refs, i, _resData$data, chunk, params, res, resData;
|
|
6420
6481
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
6421
6482
|
while (1) switch (_context4.prev = _context4.next) {
|
|
6483
|
+
case 0:
|
|
6484
|
+
refs = [];
|
|
6485
|
+
i = 0;
|
|
6486
|
+
case 2:
|
|
6487
|
+
if (!(i < ids.length)) {
|
|
6488
|
+
_context4.next = 17;
|
|
6489
|
+
break;
|
|
6490
|
+
}
|
|
6491
|
+
chunk = ids.slice(i, i + MEDIA_ITEM_REF_CHUNK_SIZE);
|
|
6492
|
+
params = new URLSearchParams({
|
|
6493
|
+
filter: "[{_id,in,".concat(chunk.join(','), "}]"),
|
|
6494
|
+
limit: String(chunk.length)
|
|
6495
|
+
});
|
|
6496
|
+
_context4.next = 7;
|
|
6497
|
+
return fetch("".concat(this.mediaService, "/v1/mediaitems/refs?").concat(params.toString()), {
|
|
6498
|
+
headers: {
|
|
6499
|
+
Authorization: 'Bearer ' + this.jwt,
|
|
6500
|
+
'Content-Type': 'application/json'
|
|
6501
|
+
}
|
|
6502
|
+
});
|
|
6503
|
+
case 7:
|
|
6504
|
+
res = _context4.sent;
|
|
6505
|
+
_context4.next = 10;
|
|
6506
|
+
return res.json();
|
|
6507
|
+
case 10:
|
|
6508
|
+
resData = _context4.sent;
|
|
6509
|
+
if (res.ok) {
|
|
6510
|
+
_context4.next = 13;
|
|
6511
|
+
break;
|
|
6512
|
+
}
|
|
6513
|
+
throw new Error(resData.error || 'Could not fetch mediaItemRefs');
|
|
6514
|
+
case 13:
|
|
6515
|
+
refs.push.apply(refs, _toConsumableArray((_resData$data = resData.data) !== null && _resData$data !== void 0 ? _resData$data : []));
|
|
6516
|
+
case 14:
|
|
6517
|
+
i += MEDIA_ITEM_REF_CHUNK_SIZE;
|
|
6518
|
+
_context4.next = 2;
|
|
6519
|
+
break;
|
|
6520
|
+
case 17:
|
|
6521
|
+
return _context4.abrupt("return", refs);
|
|
6522
|
+
case 18:
|
|
6523
|
+
case "end":
|
|
6524
|
+
return _context4.stop();
|
|
6525
|
+
}
|
|
6526
|
+
}, _callee4, this);
|
|
6527
|
+
}));
|
|
6528
|
+
function getMediaItemRefsByIds(_x4) {
|
|
6529
|
+
return _getMediaItemRefsByIds.apply(this, arguments);
|
|
6530
|
+
}
|
|
6531
|
+
return getMediaItemRefsByIds;
|
|
6532
|
+
}() /** Fetches the MediaItemRef document by ref id (not the parent media item). */)
|
|
6533
|
+
}, {
|
|
6534
|
+
key: "getMediaItemRefById",
|
|
6535
|
+
value: (function () {
|
|
6536
|
+
var _getMediaItemRefById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id) {
|
|
6537
|
+
var fullUrl, res, resData;
|
|
6538
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
6539
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
6422
6540
|
case 0:
|
|
6423
6541
|
fullUrl = this.mediaService + '/v1/mediaitems/refs';
|
|
6424
|
-
|
|
6425
|
-
|
|
6542
|
+
_context5.prev = 1;
|
|
6543
|
+
_context5.next = 4;
|
|
6426
6544
|
return fetch("".concat(fullUrl, "?filter=").concat(encodeURIComponent("[{_id,eq,".concat(id, "}]"))), {
|
|
6427
6545
|
headers: {
|
|
6428
6546
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6430,32 +6548,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6430
6548
|
}
|
|
6431
6549
|
});
|
|
6432
6550
|
case 4:
|
|
6433
|
-
res =
|
|
6434
|
-
|
|
6551
|
+
res = _context5.sent;
|
|
6552
|
+
_context5.next = 7;
|
|
6435
6553
|
return res.json();
|
|
6436
6554
|
case 7:
|
|
6437
|
-
resData =
|
|
6438
|
-
|
|
6555
|
+
resData = _context5.sent;
|
|
6556
|
+
_context5.next = 13;
|
|
6439
6557
|
break;
|
|
6440
6558
|
case 10:
|
|
6441
|
-
|
|
6442
|
-
|
|
6559
|
+
_context5.prev = 10;
|
|
6560
|
+
_context5.t0 = _context5["catch"](1);
|
|
6443
6561
|
throw new Error('Could not fetch mediaItemRef');
|
|
6444
6562
|
case 13:
|
|
6445
6563
|
if (!res.ok) {
|
|
6446
|
-
|
|
6564
|
+
_context5.next = 15;
|
|
6447
6565
|
break;
|
|
6448
6566
|
}
|
|
6449
|
-
return
|
|
6567
|
+
return _context5.abrupt("return", resData);
|
|
6450
6568
|
case 15:
|
|
6451
6569
|
throw new Error(resData.error);
|
|
6452
6570
|
case 16:
|
|
6453
6571
|
case "end":
|
|
6454
|
-
return
|
|
6572
|
+
return _context5.stop();
|
|
6455
6573
|
}
|
|
6456
|
-
},
|
|
6574
|
+
}, _callee5, this, [[1, 10]]);
|
|
6457
6575
|
}));
|
|
6458
|
-
function getMediaItemRefById(
|
|
6576
|
+
function getMediaItemRefById(_x5) {
|
|
6459
6577
|
return _getMediaItemRefById.apply(this, arguments);
|
|
6460
6578
|
}
|
|
6461
6579
|
return getMediaItemRefById;
|
|
@@ -6463,14 +6581,14 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6463
6581
|
}, {
|
|
6464
6582
|
key: "getHQRenderScriptById",
|
|
6465
6583
|
value: function () {
|
|
6466
|
-
var _getHQRenderScriptById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6584
|
+
var _getHQRenderScriptById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
|
6467
6585
|
var fullUrl, res, resData;
|
|
6468
|
-
return _regeneratorRuntime.wrap(function
|
|
6469
|
-
while (1) switch (
|
|
6586
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
6587
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
6470
6588
|
case 0:
|
|
6471
6589
|
fullUrl = this.mediaService + '/hqrenderscripts';
|
|
6472
|
-
|
|
6473
|
-
|
|
6590
|
+
_context6.prev = 1;
|
|
6591
|
+
_context6.next = 4;
|
|
6474
6592
|
return fetch("".concat(fullUrl, "/").concat(id), {
|
|
6475
6593
|
headers: {
|
|
6476
6594
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6478,32 +6596,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6478
6596
|
}
|
|
6479
6597
|
});
|
|
6480
6598
|
case 4:
|
|
6481
|
-
res =
|
|
6482
|
-
|
|
6599
|
+
res = _context6.sent;
|
|
6600
|
+
_context6.next = 7;
|
|
6483
6601
|
return res.json();
|
|
6484
6602
|
case 7:
|
|
6485
|
-
resData =
|
|
6486
|
-
|
|
6603
|
+
resData = _context6.sent;
|
|
6604
|
+
_context6.next = 13;
|
|
6487
6605
|
break;
|
|
6488
6606
|
case 10:
|
|
6489
|
-
|
|
6490
|
-
|
|
6607
|
+
_context6.prev = 10;
|
|
6608
|
+
_context6.t0 = _context6["catch"](1);
|
|
6491
6609
|
throw new Error('Could not fetch mediaItem');
|
|
6492
6610
|
case 13:
|
|
6493
6611
|
if (!res.ok) {
|
|
6494
|
-
|
|
6612
|
+
_context6.next = 15;
|
|
6495
6613
|
break;
|
|
6496
6614
|
}
|
|
6497
|
-
return
|
|
6615
|
+
return _context6.abrupt("return", resData);
|
|
6498
6616
|
case 15:
|
|
6499
6617
|
throw new Error(resData.error);
|
|
6500
6618
|
case 16:
|
|
6501
6619
|
case "end":
|
|
6502
|
-
return
|
|
6620
|
+
return _context6.stop();
|
|
6503
6621
|
}
|
|
6504
|
-
},
|
|
6622
|
+
}, _callee6, this, [[1, 10]]);
|
|
6505
6623
|
}));
|
|
6506
|
-
function getHQRenderScriptById(
|
|
6624
|
+
function getHQRenderScriptById(_x6) {
|
|
6507
6625
|
return _getHQRenderScriptById.apply(this, arguments);
|
|
6508
6626
|
}
|
|
6509
6627
|
return getHQRenderScriptById;
|
|
@@ -6511,10 +6629,10 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6511
6629
|
}, {
|
|
6512
6630
|
key: "getRooms",
|
|
6513
6631
|
value: function () {
|
|
6514
|
-
var _getRooms = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6632
|
+
var _getRooms = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, mainCategory, style, name) {
|
|
6515
6633
|
var fullUrl, filterParts, filter, res, resData;
|
|
6516
|
-
return _regeneratorRuntime.wrap(function
|
|
6517
|
-
while (1) switch (
|
|
6634
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
6635
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
6518
6636
|
case 0:
|
|
6519
6637
|
fullUrl = new URL(this.mediaService + '/rooms');
|
|
6520
6638
|
fullUrl.searchParams.append('limit', '20');
|
|
@@ -6537,8 +6655,8 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6537
6655
|
if (filter) {
|
|
6538
6656
|
fullUrl.searchParams.append('filter', encodeURIComponent(filter));
|
|
6539
6657
|
}
|
|
6540
|
-
|
|
6541
|
-
|
|
6658
|
+
_context7.prev = 7;
|
|
6659
|
+
_context7.next = 10;
|
|
6542
6660
|
return fetch(fullUrl.toString(), {
|
|
6543
6661
|
headers: {
|
|
6544
6662
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6546,32 +6664,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6546
6664
|
}
|
|
6547
6665
|
});
|
|
6548
6666
|
case 10:
|
|
6549
|
-
res =
|
|
6550
|
-
|
|
6667
|
+
res = _context7.sent;
|
|
6668
|
+
_context7.next = 13;
|
|
6551
6669
|
return res.json();
|
|
6552
6670
|
case 13:
|
|
6553
|
-
resData =
|
|
6554
|
-
|
|
6671
|
+
resData = _context7.sent;
|
|
6672
|
+
_context7.next = 19;
|
|
6555
6673
|
break;
|
|
6556
6674
|
case 16:
|
|
6557
|
-
|
|
6558
|
-
|
|
6675
|
+
_context7.prev = 16;
|
|
6676
|
+
_context7.t0 = _context7["catch"](7);
|
|
6559
6677
|
throw new Error('Could not get rooms');
|
|
6560
6678
|
case 19:
|
|
6561
6679
|
if (!res.ok) {
|
|
6562
|
-
|
|
6680
|
+
_context7.next = 21;
|
|
6563
6681
|
break;
|
|
6564
6682
|
}
|
|
6565
|
-
return
|
|
6683
|
+
return _context7.abrupt("return", resData.data);
|
|
6566
6684
|
case 21:
|
|
6567
6685
|
throw new Error(resData.error);
|
|
6568
6686
|
case 22:
|
|
6569
6687
|
case "end":
|
|
6570
|
-
return
|
|
6688
|
+
return _context7.stop();
|
|
6571
6689
|
}
|
|
6572
|
-
},
|
|
6690
|
+
}, _callee7, this, [[7, 16]]);
|
|
6573
6691
|
}));
|
|
6574
|
-
function getRooms(
|
|
6692
|
+
function getRooms(_x7, _x8, _x9, _x10) {
|
|
6575
6693
|
return _getRooms.apply(this, arguments);
|
|
6576
6694
|
}
|
|
6577
6695
|
return getRooms;
|
|
@@ -6579,10 +6697,10 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6579
6697
|
}, {
|
|
6580
6698
|
key: "getRoomsNew",
|
|
6581
6699
|
value: function () {
|
|
6582
|
-
var _getRoomsNew = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6700
|
+
var _getRoomsNew = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(id, mainCategory, organizationId) {
|
|
6583
6701
|
var fullUrl, filterParts, filter, res, resData;
|
|
6584
|
-
return _regeneratorRuntime.wrap(function
|
|
6585
|
-
while (1) switch (
|
|
6702
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
6703
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
6586
6704
|
case 0:
|
|
6587
6705
|
fullUrl = new URL(this.mediaService + '/rooms');
|
|
6588
6706
|
fullUrl.searchParams.append('limit', '1000');
|
|
@@ -6602,8 +6720,8 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6602
6720
|
if (filter) {
|
|
6603
6721
|
fullUrl.searchParams.append('filter', encodeURIComponent(filter));
|
|
6604
6722
|
}
|
|
6605
|
-
|
|
6606
|
-
|
|
6723
|
+
_context8.prev = 8;
|
|
6724
|
+
_context8.next = 11;
|
|
6607
6725
|
return fetch(fullUrl.toString(), {
|
|
6608
6726
|
headers: {
|
|
6609
6727
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6611,32 +6729,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6611
6729
|
}
|
|
6612
6730
|
});
|
|
6613
6731
|
case 11:
|
|
6614
|
-
res =
|
|
6615
|
-
|
|
6732
|
+
res = _context8.sent;
|
|
6733
|
+
_context8.next = 14;
|
|
6616
6734
|
return res.json();
|
|
6617
6735
|
case 14:
|
|
6618
|
-
resData =
|
|
6619
|
-
|
|
6736
|
+
resData = _context8.sent;
|
|
6737
|
+
_context8.next = 20;
|
|
6620
6738
|
break;
|
|
6621
6739
|
case 17:
|
|
6622
|
-
|
|
6623
|
-
|
|
6740
|
+
_context8.prev = 17;
|
|
6741
|
+
_context8.t0 = _context8["catch"](8);
|
|
6624
6742
|
throw new Error('Could not get rooms');
|
|
6625
6743
|
case 20:
|
|
6626
6744
|
if (!res.ok) {
|
|
6627
|
-
|
|
6745
|
+
_context8.next = 22;
|
|
6628
6746
|
break;
|
|
6629
6747
|
}
|
|
6630
|
-
return
|
|
6748
|
+
return _context8.abrupt("return", resData.data);
|
|
6631
6749
|
case 22:
|
|
6632
6750
|
throw new Error(resData.error);
|
|
6633
6751
|
case 23:
|
|
6634
6752
|
case "end":
|
|
6635
|
-
return
|
|
6753
|
+
return _context8.stop();
|
|
6636
6754
|
}
|
|
6637
|
-
},
|
|
6755
|
+
}, _callee8, this, [[8, 17]]);
|
|
6638
6756
|
}));
|
|
6639
|
-
function getRoomsNew(
|
|
6757
|
+
function getRoomsNew(_x11, _x12, _x13) {
|
|
6640
6758
|
return _getRoomsNew.apply(this, arguments);
|
|
6641
6759
|
}
|
|
6642
6760
|
return getRoomsNew;
|
|
@@ -6644,10 +6762,10 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6644
6762
|
}, {
|
|
6645
6763
|
key: "getRoomsGrouped",
|
|
6646
6764
|
value: function () {
|
|
6647
|
-
var _getRoomsGrouped = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6765
|
+
var _getRoomsGrouped = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(id, mainCategory, style, organizationId) {
|
|
6648
6766
|
var fullUrl, filterParts, filter, res, resData;
|
|
6649
|
-
return _regeneratorRuntime.wrap(function
|
|
6650
|
-
while (1) switch (
|
|
6767
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
6768
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
6651
6769
|
case 0:
|
|
6652
6770
|
fullUrl = new URL(this.mediaService + '/rooms');
|
|
6653
6771
|
if (organizationId) {
|
|
@@ -6670,8 +6788,8 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6670
6788
|
if (filter) {
|
|
6671
6789
|
fullUrl.searchParams.append('filter', encodeURIComponent(filter));
|
|
6672
6790
|
}
|
|
6673
|
-
|
|
6674
|
-
|
|
6791
|
+
_context9.prev = 8;
|
|
6792
|
+
_context9.next = 11;
|
|
6675
6793
|
return fetch(fullUrl.toString(), {
|
|
6676
6794
|
headers: {
|
|
6677
6795
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6679,32 +6797,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6679
6797
|
}
|
|
6680
6798
|
});
|
|
6681
6799
|
case 11:
|
|
6682
|
-
res =
|
|
6683
|
-
|
|
6800
|
+
res = _context9.sent;
|
|
6801
|
+
_context9.next = 14;
|
|
6684
6802
|
return res.json();
|
|
6685
6803
|
case 14:
|
|
6686
|
-
resData =
|
|
6687
|
-
|
|
6804
|
+
resData = _context9.sent;
|
|
6805
|
+
_context9.next = 20;
|
|
6688
6806
|
break;
|
|
6689
6807
|
case 17:
|
|
6690
|
-
|
|
6691
|
-
|
|
6808
|
+
_context9.prev = 17;
|
|
6809
|
+
_context9.t0 = _context9["catch"](8);
|
|
6692
6810
|
throw new Error('Could not get rooms');
|
|
6693
6811
|
case 20:
|
|
6694
6812
|
if (!res.ok) {
|
|
6695
|
-
|
|
6813
|
+
_context9.next = 22;
|
|
6696
6814
|
break;
|
|
6697
6815
|
}
|
|
6698
|
-
return
|
|
6816
|
+
return _context9.abrupt("return", organizationId ? resData : resData.data);
|
|
6699
6817
|
case 22:
|
|
6700
6818
|
throw new Error(resData.error);
|
|
6701
6819
|
case 23:
|
|
6702
6820
|
case "end":
|
|
6703
|
-
return
|
|
6821
|
+
return _context9.stop();
|
|
6704
6822
|
}
|
|
6705
|
-
},
|
|
6823
|
+
}, _callee9, this, [[8, 17]]);
|
|
6706
6824
|
}));
|
|
6707
|
-
function getRoomsGrouped(
|
|
6825
|
+
function getRoomsGrouped(_x14, _x15, _x16, _x17) {
|
|
6708
6826
|
return _getRoomsGrouped.apply(this, arguments);
|
|
6709
6827
|
}
|
|
6710
6828
|
return getRoomsGrouped;
|
|
@@ -6712,15 +6830,15 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6712
6830
|
}, {
|
|
6713
6831
|
key: "getRoomColors",
|
|
6714
6832
|
value: function () {
|
|
6715
|
-
var _getRoomColors = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6833
|
+
var _getRoomColors = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(name) {
|
|
6716
6834
|
var fullUrl, res, resData;
|
|
6717
|
-
return _regeneratorRuntime.wrap(function
|
|
6718
|
-
while (1) switch (
|
|
6835
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
6836
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
6719
6837
|
case 0:
|
|
6720
6838
|
fullUrl = this.mediaService + '/rooms/' + name + '/colors';
|
|
6721
6839
|
resData = [];
|
|
6722
|
-
|
|
6723
|
-
|
|
6840
|
+
_context10.prev = 2;
|
|
6841
|
+
_context10.next = 5;
|
|
6724
6842
|
return fetch(fullUrl, {
|
|
6725
6843
|
headers: {
|
|
6726
6844
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6728,32 +6846,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6728
6846
|
}
|
|
6729
6847
|
});
|
|
6730
6848
|
case 5:
|
|
6731
|
-
res =
|
|
6732
|
-
|
|
6849
|
+
res = _context10.sent;
|
|
6850
|
+
_context10.next = 8;
|
|
6733
6851
|
return res.json();
|
|
6734
6852
|
case 8:
|
|
6735
|
-
resData =
|
|
6736
|
-
|
|
6853
|
+
resData = _context10.sent;
|
|
6854
|
+
_context10.next = 14;
|
|
6737
6855
|
break;
|
|
6738
6856
|
case 11:
|
|
6739
|
-
|
|
6740
|
-
|
|
6857
|
+
_context10.prev = 11;
|
|
6858
|
+
_context10.t0 = _context10["catch"](2);
|
|
6741
6859
|
throw new Error('Could not get room variants');
|
|
6742
6860
|
case 14:
|
|
6743
6861
|
if (!res.ok) {
|
|
6744
|
-
|
|
6862
|
+
_context10.next = 16;
|
|
6745
6863
|
break;
|
|
6746
6864
|
}
|
|
6747
|
-
return
|
|
6865
|
+
return _context10.abrupt("return", resData);
|
|
6748
6866
|
case 16:
|
|
6749
6867
|
throw new Error(resData.error);
|
|
6750
6868
|
case 17:
|
|
6751
6869
|
case "end":
|
|
6752
|
-
return
|
|
6870
|
+
return _context10.stop();
|
|
6753
6871
|
}
|
|
6754
|
-
},
|
|
6872
|
+
}, _callee10, this, [[2, 11]]);
|
|
6755
6873
|
}));
|
|
6756
|
-
function getRoomColors(
|
|
6874
|
+
function getRoomColors(_x18) {
|
|
6757
6875
|
return _getRoomColors.apply(this, arguments);
|
|
6758
6876
|
}
|
|
6759
6877
|
return getRoomColors;
|
|
@@ -6761,15 +6879,15 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6761
6879
|
}, {
|
|
6762
6880
|
key: "getRoomVariants",
|
|
6763
6881
|
value: function () {
|
|
6764
|
-
var _getRoomVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6882
|
+
var _getRoomVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(id) {
|
|
6765
6883
|
var fullUrl, res, resData;
|
|
6766
|
-
return _regeneratorRuntime.wrap(function
|
|
6767
|
-
while (1) switch (
|
|
6884
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
6885
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
6768
6886
|
case 0:
|
|
6769
6887
|
fullUrl = this.mediaService + '/rooms/' + id + '/variants';
|
|
6770
6888
|
resData = [];
|
|
6771
|
-
|
|
6772
|
-
|
|
6889
|
+
_context11.prev = 2;
|
|
6890
|
+
_context11.next = 5;
|
|
6773
6891
|
return fetch(fullUrl, {
|
|
6774
6892
|
headers: {
|
|
6775
6893
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6777,32 +6895,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6777
6895
|
}
|
|
6778
6896
|
});
|
|
6779
6897
|
case 5:
|
|
6780
|
-
res =
|
|
6781
|
-
|
|
6898
|
+
res = _context11.sent;
|
|
6899
|
+
_context11.next = 8;
|
|
6782
6900
|
return res.json();
|
|
6783
6901
|
case 8:
|
|
6784
|
-
resData =
|
|
6785
|
-
|
|
6902
|
+
resData = _context11.sent;
|
|
6903
|
+
_context11.next = 14;
|
|
6786
6904
|
break;
|
|
6787
6905
|
case 11:
|
|
6788
|
-
|
|
6789
|
-
|
|
6906
|
+
_context11.prev = 11;
|
|
6907
|
+
_context11.t0 = _context11["catch"](2);
|
|
6790
6908
|
throw new Error('Could not get room variants');
|
|
6791
6909
|
case 14:
|
|
6792
6910
|
if (!res.ok) {
|
|
6793
|
-
|
|
6911
|
+
_context11.next = 16;
|
|
6794
6912
|
break;
|
|
6795
6913
|
}
|
|
6796
|
-
return
|
|
6914
|
+
return _context11.abrupt("return", resData);
|
|
6797
6915
|
case 16:
|
|
6798
6916
|
throw new Error(resData.error);
|
|
6799
6917
|
case 17:
|
|
6800
6918
|
case "end":
|
|
6801
|
-
return
|
|
6919
|
+
return _context11.stop();
|
|
6802
6920
|
}
|
|
6803
|
-
},
|
|
6921
|
+
}, _callee11, this, [[2, 11]]);
|
|
6804
6922
|
}));
|
|
6805
|
-
function getRoomVariants(
|
|
6923
|
+
function getRoomVariants(_x19) {
|
|
6806
6924
|
return _getRoomVariants.apply(this, arguments);
|
|
6807
6925
|
}
|
|
6808
6926
|
return getRoomVariants;
|
|
@@ -6810,25 +6928,25 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6810
6928
|
}, {
|
|
6811
6929
|
key: "getRenderJobs",
|
|
6812
6930
|
value: function () {
|
|
6813
|
-
var _getRenderJobs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6931
|
+
var _getRenderJobs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
6814
6932
|
var query,
|
|
6815
6933
|
fullUrl,
|
|
6816
6934
|
res,
|
|
6817
6935
|
resData,
|
|
6818
6936
|
err,
|
|
6819
|
-
|
|
6820
|
-
return _regeneratorRuntime.wrap(function
|
|
6821
|
-
while (1) switch (
|
|
6937
|
+
_args12 = arguments;
|
|
6938
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
6939
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
6822
6940
|
case 0:
|
|
6823
|
-
query =
|
|
6941
|
+
query = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
|
|
6824
6942
|
fullUrl = new URL(this.mediaService + '/renderjobs');
|
|
6825
6943
|
if (this.organizationId) fullUrl.searchParams.append('organizationId', this.organizationId);
|
|
6826
6944
|
if (query.limit) fullUrl.searchParams.append('limit', String(query.limit));
|
|
6827
6945
|
if (query.skip) fullUrl.searchParams.append('skip', String(query.skip));
|
|
6828
6946
|
if (query.filter) fullUrl.searchParams.append('filter', encodeURIComponent(query.filter));
|
|
6829
6947
|
if (query.sort) fullUrl.searchParams.append('sort', encodeURIComponent(query.sort));
|
|
6830
|
-
|
|
6831
|
-
|
|
6948
|
+
_context12.prev = 7;
|
|
6949
|
+
_context12.next = 10;
|
|
6832
6950
|
return fetch(fullUrl.toString(), {
|
|
6833
6951
|
headers: {
|
|
6834
6952
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6836,32 +6954,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6836
6954
|
}
|
|
6837
6955
|
});
|
|
6838
6956
|
case 10:
|
|
6839
|
-
res =
|
|
6840
|
-
|
|
6957
|
+
res = _context12.sent;
|
|
6958
|
+
_context12.next = 13;
|
|
6841
6959
|
return res.json();
|
|
6842
6960
|
case 13:
|
|
6843
|
-
resData =
|
|
6844
|
-
|
|
6961
|
+
resData = _context12.sent;
|
|
6962
|
+
_context12.next = 19;
|
|
6845
6963
|
break;
|
|
6846
6964
|
case 16:
|
|
6847
|
-
|
|
6848
|
-
|
|
6965
|
+
_context12.prev = 16;
|
|
6966
|
+
_context12.t0 = _context12["catch"](7);
|
|
6849
6967
|
throw new Error('Could not get render jobs');
|
|
6850
6968
|
case 19:
|
|
6851
6969
|
if (!res.ok) {
|
|
6852
|
-
|
|
6970
|
+
_context12.next = 21;
|
|
6853
6971
|
break;
|
|
6854
6972
|
}
|
|
6855
|
-
return
|
|
6973
|
+
return _context12.abrupt("return", resData);
|
|
6856
6974
|
case 21:
|
|
6857
6975
|
err = new Error(resData.error);
|
|
6858
6976
|
err.status = res.status;
|
|
6859
6977
|
throw err;
|
|
6860
6978
|
case 24:
|
|
6861
6979
|
case "end":
|
|
6862
|
-
return
|
|
6980
|
+
return _context12.stop();
|
|
6863
6981
|
}
|
|
6864
|
-
},
|
|
6982
|
+
}, _callee12, this, [[7, 16]]);
|
|
6865
6983
|
}));
|
|
6866
6984
|
function getRenderJobs() {
|
|
6867
6985
|
return _getRenderJobs.apply(this, arguments);
|
|
@@ -6871,24 +6989,24 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6871
6989
|
}, {
|
|
6872
6990
|
key: "getAiProductPhotoCampaignSummaries",
|
|
6873
6991
|
value: (function () {
|
|
6874
|
-
var _getAiProductPhotoCampaignSummaries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6992
|
+
var _getAiProductPhotoCampaignSummaries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
6875
6993
|
var query,
|
|
6876
6994
|
fullUrl,
|
|
6877
6995
|
res,
|
|
6878
6996
|
resData,
|
|
6879
|
-
|
|
6880
|
-
return _regeneratorRuntime.wrap(function
|
|
6881
|
-
while (1) switch (
|
|
6997
|
+
_args13 = arguments;
|
|
6998
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
6999
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
6882
7000
|
case 0:
|
|
6883
|
-
query =
|
|
7001
|
+
query = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
|
|
6884
7002
|
fullUrl = new URL(this.mediaService + '/renderjobs/aiproductphoto/campaigns/summary');
|
|
6885
7003
|
if (this.organizationId) fullUrl.searchParams.append('organizationId', this.organizationId);
|
|
6886
7004
|
if (query.search) fullUrl.searchParams.append('search', query.search);
|
|
6887
7005
|
if (query.sort) fullUrl.searchParams.append('sort', query.sort);
|
|
6888
7006
|
if (query.skip) fullUrl.searchParams.append('skip', String(query.skip));
|
|
6889
7007
|
if (query.limit) fullUrl.searchParams.append('limit', String(query.limit));
|
|
6890
|
-
|
|
6891
|
-
|
|
7008
|
+
_context13.prev = 7;
|
|
7009
|
+
_context13.next = 10;
|
|
6892
7010
|
return fetch(fullUrl.toString(), {
|
|
6893
7011
|
headers: {
|
|
6894
7012
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6896,30 +7014,30 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6896
7014
|
}
|
|
6897
7015
|
});
|
|
6898
7016
|
case 10:
|
|
6899
|
-
res =
|
|
6900
|
-
|
|
7017
|
+
res = _context13.sent;
|
|
7018
|
+
_context13.next = 13;
|
|
6901
7019
|
return res.json();
|
|
6902
7020
|
case 13:
|
|
6903
|
-
resData =
|
|
6904
|
-
|
|
7021
|
+
resData = _context13.sent;
|
|
7022
|
+
_context13.next = 19;
|
|
6905
7023
|
break;
|
|
6906
7024
|
case 16:
|
|
6907
|
-
|
|
6908
|
-
|
|
7025
|
+
_context13.prev = 16;
|
|
7026
|
+
_context13.t0 = _context13["catch"](7);
|
|
6909
7027
|
throw new Error('Could not get AI product photo campaign summaries');
|
|
6910
7028
|
case 19:
|
|
6911
7029
|
if (!res.ok) {
|
|
6912
|
-
|
|
7030
|
+
_context13.next = 21;
|
|
6913
7031
|
break;
|
|
6914
7032
|
}
|
|
6915
|
-
return
|
|
7033
|
+
return _context13.abrupt("return", resData);
|
|
6916
7034
|
case 21:
|
|
6917
7035
|
throw new Error(resData.error);
|
|
6918
7036
|
case 22:
|
|
6919
7037
|
case "end":
|
|
6920
|
-
return
|
|
7038
|
+
return _context13.stop();
|
|
6921
7039
|
}
|
|
6922
|
-
},
|
|
7040
|
+
}, _callee13, this, [[7, 16]]);
|
|
6923
7041
|
}));
|
|
6924
7042
|
function getAiProductPhotoCampaignSummaries() {
|
|
6925
7043
|
return _getAiProductPhotoCampaignSummaries.apply(this, arguments);
|
|
@@ -6929,13 +7047,13 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6929
7047
|
}, {
|
|
6930
7048
|
key: "archiveRenderJob",
|
|
6931
7049
|
value: (function () {
|
|
6932
|
-
var _archiveRenderJob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7050
|
+
var _archiveRenderJob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(id, archived) {
|
|
6933
7051
|
var res, resData;
|
|
6934
|
-
return _regeneratorRuntime.wrap(function
|
|
6935
|
-
while (1) switch (
|
|
7052
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
7053
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
6936
7054
|
case 0:
|
|
6937
|
-
|
|
6938
|
-
|
|
7055
|
+
_context14.prev = 0;
|
|
7056
|
+
_context14.next = 3;
|
|
6939
7057
|
return fetch("".concat(this.mediaService, "/renderjobs/").concat(id, "/archive"), {
|
|
6940
7058
|
method: 'PATCH',
|
|
6941
7059
|
headers: {
|
|
@@ -6947,32 +7065,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6947
7065
|
})
|
|
6948
7066
|
});
|
|
6949
7067
|
case 3:
|
|
6950
|
-
res =
|
|
6951
|
-
|
|
7068
|
+
res = _context14.sent;
|
|
7069
|
+
_context14.next = 6;
|
|
6952
7070
|
return res.json();
|
|
6953
7071
|
case 6:
|
|
6954
|
-
resData =
|
|
6955
|
-
|
|
7072
|
+
resData = _context14.sent;
|
|
7073
|
+
_context14.next = 12;
|
|
6956
7074
|
break;
|
|
6957
7075
|
case 9:
|
|
6958
|
-
|
|
6959
|
-
|
|
7076
|
+
_context14.prev = 9;
|
|
7077
|
+
_context14.t0 = _context14["catch"](0);
|
|
6960
7078
|
throw new Error('Could not archive render job');
|
|
6961
7079
|
case 12:
|
|
6962
7080
|
if (res.ok) {
|
|
6963
|
-
|
|
7081
|
+
_context14.next = 14;
|
|
6964
7082
|
break;
|
|
6965
7083
|
}
|
|
6966
7084
|
throw new Error(resData.error);
|
|
6967
7085
|
case 14:
|
|
6968
|
-
return
|
|
7086
|
+
return _context14.abrupt("return");
|
|
6969
7087
|
case 15:
|
|
6970
7088
|
case "end":
|
|
6971
|
-
return
|
|
7089
|
+
return _context14.stop();
|
|
6972
7090
|
}
|
|
6973
|
-
},
|
|
7091
|
+
}, _callee14, this, [[0, 9]]);
|
|
6974
7092
|
}));
|
|
6975
|
-
function archiveRenderJob(
|
|
7093
|
+
function archiveRenderJob(_x20, _x21) {
|
|
6976
7094
|
return _archiveRenderJob.apply(this, arguments);
|
|
6977
7095
|
}
|
|
6978
7096
|
return archiveRenderJob;
|
|
@@ -6980,13 +7098,13 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6980
7098
|
}, {
|
|
6981
7099
|
key: "getRenderJob",
|
|
6982
7100
|
value: function () {
|
|
6983
|
-
var _getRenderJob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7101
|
+
var _getRenderJob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id) {
|
|
6984
7102
|
var res, resData;
|
|
6985
|
-
return _regeneratorRuntime.wrap(function
|
|
6986
|
-
while (1) switch (
|
|
7103
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
7104
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
6987
7105
|
case 0:
|
|
6988
|
-
|
|
6989
|
-
|
|
7106
|
+
_context15.prev = 0;
|
|
7107
|
+
_context15.next = 3;
|
|
6990
7108
|
return fetch("".concat(this.mediaService, "/renderjobs/").concat(id), {
|
|
6991
7109
|
headers: {
|
|
6992
7110
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -6994,32 +7112,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6994
7112
|
}
|
|
6995
7113
|
});
|
|
6996
7114
|
case 3:
|
|
6997
|
-
res =
|
|
6998
|
-
|
|
7115
|
+
res = _context15.sent;
|
|
7116
|
+
_context15.next = 6;
|
|
6999
7117
|
return res.json();
|
|
7000
7118
|
case 6:
|
|
7001
|
-
resData =
|
|
7002
|
-
|
|
7119
|
+
resData = _context15.sent;
|
|
7120
|
+
_context15.next = 12;
|
|
7003
7121
|
break;
|
|
7004
7122
|
case 9:
|
|
7005
|
-
|
|
7006
|
-
|
|
7123
|
+
_context15.prev = 9;
|
|
7124
|
+
_context15.t0 = _context15["catch"](0);
|
|
7007
7125
|
throw new Error('Could not get render job');
|
|
7008
7126
|
case 12:
|
|
7009
7127
|
if (!res.ok) {
|
|
7010
|
-
|
|
7128
|
+
_context15.next = 14;
|
|
7011
7129
|
break;
|
|
7012
7130
|
}
|
|
7013
|
-
return
|
|
7131
|
+
return _context15.abrupt("return", resData);
|
|
7014
7132
|
case 14:
|
|
7015
7133
|
throw new Error(resData.error);
|
|
7016
7134
|
case 15:
|
|
7017
7135
|
case "end":
|
|
7018
|
-
return
|
|
7136
|
+
return _context15.stop();
|
|
7019
7137
|
}
|
|
7020
|
-
},
|
|
7138
|
+
}, _callee15, this, [[0, 9]]);
|
|
7021
7139
|
}));
|
|
7022
|
-
function getRenderJob(
|
|
7140
|
+
function getRenderJob(_x22) {
|
|
7023
7141
|
return _getRenderJob.apply(this, arguments);
|
|
7024
7142
|
}
|
|
7025
7143
|
return getRenderJob;
|
|
@@ -7027,16 +7145,16 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
7027
7145
|
}, {
|
|
7028
7146
|
key: "getRenderPackages",
|
|
7029
7147
|
value: function () {
|
|
7030
|
-
var _getRenderPackages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7148
|
+
var _getRenderPackages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(organizationId) {
|
|
7031
7149
|
var fullUrl, res, resData;
|
|
7032
|
-
return _regeneratorRuntime.wrap(function
|
|
7033
|
-
while (1) switch (
|
|
7150
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
7151
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
7034
7152
|
case 0:
|
|
7035
7153
|
fullUrl = new URL(this.mediaService + '/renderpackages');
|
|
7036
7154
|
if (organizationId) fullUrl.searchParams.append('organizationId', organizationId);
|
|
7037
7155
|
fullUrl.searchParams.append('sort', encodeURIComponent('{position}'));
|
|
7038
|
-
|
|
7039
|
-
|
|
7156
|
+
_context16.prev = 3;
|
|
7157
|
+
_context16.next = 6;
|
|
7040
7158
|
return fetch(fullUrl, {
|
|
7041
7159
|
headers: {
|
|
7042
7160
|
Authorization: 'Bearer ' + this.jwt,
|
|
@@ -7044,32 +7162,32 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
7044
7162
|
}
|
|
7045
7163
|
});
|
|
7046
7164
|
case 6:
|
|
7047
|
-
res =
|
|
7048
|
-
|
|
7165
|
+
res = _context16.sent;
|
|
7166
|
+
_context16.next = 9;
|
|
7049
7167
|
return res.json();
|
|
7050
7168
|
case 9:
|
|
7051
|
-
resData =
|
|
7052
|
-
|
|
7169
|
+
resData = _context16.sent;
|
|
7170
|
+
_context16.next = 15;
|
|
7053
7171
|
break;
|
|
7054
7172
|
case 12:
|
|
7055
|
-
|
|
7056
|
-
|
|
7173
|
+
_context16.prev = 12;
|
|
7174
|
+
_context16.t0 = _context16["catch"](3);
|
|
7057
7175
|
throw new Error('Could not get render packages');
|
|
7058
7176
|
case 15:
|
|
7059
7177
|
if (!res.ok) {
|
|
7060
|
-
|
|
7178
|
+
_context16.next = 17;
|
|
7061
7179
|
break;
|
|
7062
7180
|
}
|
|
7063
|
-
return
|
|
7181
|
+
return _context16.abrupt("return", resData);
|
|
7064
7182
|
case 17:
|
|
7065
7183
|
throw new Error(resData.error);
|
|
7066
7184
|
case 18:
|
|
7067
7185
|
case "end":
|
|
7068
|
-
return
|
|
7186
|
+
return _context16.stop();
|
|
7069
7187
|
}
|
|
7070
|
-
},
|
|
7188
|
+
}, _callee16, this, [[3, 12]]);
|
|
7071
7189
|
}));
|
|
7072
|
-
function getRenderPackages(
|
|
7190
|
+
function getRenderPackages(_x23) {
|
|
7073
7191
|
return _getRenderPackages.apply(this, arguments);
|
|
7074
7192
|
}
|
|
7075
7193
|
return getRenderPackages;
|
|
@@ -8993,18 +9111,21 @@ var AIHandler = /*#__PURE__*/function () {
|
|
|
8993
9111
|
}
|
|
8994
9112
|
return _context3.abrupt("return", resData);
|
|
8995
9113
|
case 9:
|
|
9114
|
+
// The services carry an `errorCode` alongside the message for cases a caller has to tell apart
|
|
9115
|
+
// (e.g. a product that cannot be named for the MAM). Drop it here and the caller only sees a bare 400.
|
|
8996
9116
|
err = new Error(resData === null || resData === void 0 ? void 0 : resData.error);
|
|
8997
9117
|
err.status = response.status;
|
|
9118
|
+
err.errorCode = resData === null || resData === void 0 ? void 0 : resData.errorCode;
|
|
8998
9119
|
return _context3.abrupt("return", Promise.reject(err));
|
|
8999
|
-
case
|
|
9000
|
-
_context3.prev =
|
|
9120
|
+
case 15:
|
|
9121
|
+
_context3.prev = 15;
|
|
9001
9122
|
_context3.t0 = _context3["catch"](0);
|
|
9002
9123
|
return _context3.abrupt("return", Promise.reject(_context3.t0));
|
|
9003
|
-
case
|
|
9124
|
+
case 18:
|
|
9004
9125
|
case "end":
|
|
9005
9126
|
return _context3.stop();
|
|
9006
9127
|
}
|
|
9007
|
-
}, _callee3, this, [[0,
|
|
9128
|
+
}, _callee3, this, [[0, 15]]);
|
|
9008
9129
|
}));
|
|
9009
9130
|
function generateProductPhoto(_x4) {
|
|
9010
9131
|
return _generateProductPhoto.apply(this, arguments);
|
|
@@ -11139,7 +11260,7 @@ var DrawerMenu$1 = observer(DrawerMenu);
|
|
|
11139
11260
|
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11140
11261
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11141
11262
|
var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
|
|
11142
|
-
return import('./ModalsWrapper-
|
|
11263
|
+
return import('./ModalsWrapper-a4822f5c.js');
|
|
11143
11264
|
});
|
|
11144
11265
|
function Fullscreen(_ref) {
|
|
11145
11266
|
var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
|
|
@@ -11601,10 +11722,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
11601
11722
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11602
11723
|
var LOG$2 = getLogger('Framework', 'Root');
|
|
11603
11724
|
var LazyAuth = /*#__PURE__*/React.lazy(function () {
|
|
11604
|
-
return import('./index-
|
|
11725
|
+
return import('./index-d7d2bbf9.js');
|
|
11605
11726
|
});
|
|
11606
11727
|
var LazyModals = /*#__PURE__*/React.lazy(function () {
|
|
11607
|
-
return import('./ModalsWrapper-
|
|
11728
|
+
return import('./ModalsWrapper-a4822f5c.js');
|
|
11608
11729
|
});
|
|
11609
11730
|
function ContentComponent() {
|
|
11610
11731
|
var context = useDivaCoreContext();
|