@eluvio/elv-client-js 4.0.10 → 4.0.11
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/dist/ElvClient-min.js +10 -11
- package/dist/ElvClient-node-min.js +10 -11
- package/dist/ElvFrameClient-min.js +10 -11
- package/dist/ElvPermissionsClient-min.js +9 -10
- package/dist/ElvWalletClient-min.js +9 -10
- package/dist/ElvWalletClient-node-min.js +9 -10
- package/dist/src/AuthorizationClient.js +2070 -1550
- package/dist/src/ContentObjectVerification.js +185 -134
- package/dist/src/Crypto.js +319 -224
- package/dist/src/ElvClient.js +1114 -822
- package/dist/src/ElvWallet.js +106 -64
- package/dist/src/EthClient.js +974 -719
- package/dist/src/FrameClient.js +318 -222
- package/dist/src/HttpClient.js +154 -112
- package/dist/src/Id.js +6 -1
- package/dist/src/LogMessage.js +8 -4
- package/dist/src/PermissionsClient.js +1271 -973
- package/dist/src/RemoteSigner.js +232 -161
- package/dist/src/UserProfileClient.js +1038 -781
- package/dist/src/Utils.js +299 -159
- package/dist/src/Validation.js +17 -2
- package/dist/src/client/ABRPublishing.js +942 -772
- package/dist/src/client/AccessGroups.js +1095 -849
- package/dist/src/client/ContentAccess.js +4196 -3323
- package/dist/src/client/ContentManagement.js +2288 -1814
- package/dist/src/client/Contracts.js +614 -468
- package/dist/src/client/Files.js +1831 -1490
- package/dist/src/client/NFT.js +116 -94
- package/dist/src/client/NTP.js +425 -326
- package/dist/src/index.js +5 -2
- package/dist/src/walletClient/ClientMethods.js +1763 -1368
- package/dist/src/walletClient/Configuration.js +2 -4
- package/dist/src/walletClient/Notifications.js +127 -98
- package/dist/src/walletClient/Profile.js +246 -184
- package/dist/src/walletClient/Utils.js +122 -76
- package/dist/src/walletClient/index.js +1496 -1171
- package/package.json +1 -1
- package/src/AuthorizationClient.js +5 -5
- package/src/client/Files.js +1 -1
- package/testScripts/CreateMezMonolithic.js +0 -779
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
|
|
2
|
+
|
|
2
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
|
+
|
|
3
5
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
6
|
+
|
|
4
7
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
8
|
+
|
|
5
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
|
|
6
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
+
|
|
7
13
|
/**
|
|
8
14
|
* Methods for ABR video creation and management
|
|
9
15
|
*
|
|
@@ -11,15 +17,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
11
17
|
*
|
|
12
18
|
* @module ElvClient/ABRPublishing
|
|
13
19
|
*/
|
|
14
|
-
|
|
15
20
|
var R = require("ramda");
|
|
21
|
+
|
|
16
22
|
var UrlJoin = require("url-join");
|
|
23
|
+
|
|
17
24
|
var HttpClient = require("../HttpClient");
|
|
18
|
-
var _require = require("../Validation"),
|
|
19
|
-
ValidateLibrary = _require.ValidateLibrary,
|
|
20
|
-
ValidateVersion = _require.ValidateVersion,
|
|
21
|
-
ValidateParameters = _require.ValidateParameters;
|
|
22
25
|
|
|
26
|
+
var _require = require("../Validation"),
|
|
27
|
+
ValidateLibrary = _require.ValidateLibrary,
|
|
28
|
+
ValidateVersion = _require.ValidateVersion,
|
|
29
|
+
ValidateParameters = _require.ValidateParameters;
|
|
23
30
|
/**
|
|
24
31
|
* Create a master media content object with the given files.
|
|
25
32
|
*
|
|
@@ -72,223 +79,266 @@ var _require = require("../Validation"),
|
|
|
72
79
|
* @throws {Object} error - If the initialization of the master fails, error details can be found in error.body
|
|
73
80
|
* @return {Object} - The finalize response for the object, as well as logs, warnings and errors from the master initialization
|
|
74
81
|
*/
|
|
82
|
+
|
|
83
|
+
|
|
75
84
|
exports.CreateProductionMaster = /*#__PURE__*/function () {
|
|
76
85
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
77
86
|
var libraryId, type, name, description, _ref$metadata, metadata, fileInfo, _ref$encrypt, encrypt, _ref$access, access, _ref$copy, copy, callback, _ref$respLogLevel, respLogLevel, _ref$structLogLevel, structLogLevel, _yield$this$CreateCon, id, write_token, s3prefixRegex, i, oneFileInfo, matched, j, credentialSet, credentialSetBucket, matchers, k, matcher, fileSourcePath, s3prefixMatch, bucketName, _i, _credentialSet, region, bucket, accessKey, secret, _yield$this$CallBitco, logs, errors, warnings, finalizeResponse;
|
|
87
|
+
|
|
78
88
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
79
|
-
while (1)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
89
|
+
while (1) {
|
|
90
|
+
switch (_context.prev = _context.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
libraryId = _ref.libraryId, type = _ref.type, name = _ref.name, description = _ref.description, _ref$metadata = _ref.metadata, metadata = _ref$metadata === void 0 ? {} : _ref$metadata, fileInfo = _ref.fileInfo, _ref$encrypt = _ref.encrypt, encrypt = _ref$encrypt === void 0 ? true : _ref$encrypt, _ref$access = _ref.access, access = _ref$access === void 0 ? [] : _ref$access, _ref$copy = _ref.copy, copy = _ref$copy === void 0 ? false : _ref$copy, callback = _ref.callback, _ref$respLogLevel = _ref.respLogLevel, respLogLevel = _ref$respLogLevel === void 0 ? "warn" : _ref$respLogLevel, _ref$structLogLevel = _ref.structLogLevel, structLogLevel = _ref$structLogLevel === void 0 ? "none" : _ref$structLogLevel;
|
|
93
|
+
ValidateLibrary(libraryId);
|
|
94
|
+
_context.next = 4;
|
|
95
|
+
return this.CreateContentObject({
|
|
96
|
+
libraryId: libraryId,
|
|
97
|
+
options: type ? {
|
|
98
|
+
type: type
|
|
99
|
+
} : {}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
case 4:
|
|
103
|
+
_yield$this$CreateCon = _context.sent;
|
|
104
|
+
id = _yield$this$CreateCon.id;
|
|
105
|
+
write_token = _yield$this$CreateCon.write_token;
|
|
106
|
+
|
|
107
|
+
if (!fileInfo) {
|
|
108
|
+
_context.next = 59;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (!(access.length > 0)) {
|
|
113
|
+
_context.next = 57;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// S3 Upload
|
|
118
|
+
s3prefixRegex = /^s3:\/\/([^/]+)\//i; // for matching and extracting bucket name when full s3:// path is specified
|
|
119
|
+
// batch the cloud storage files by matching credential set, check each file's source path against credential set path_matchers
|
|
120
|
+
|
|
121
|
+
i = 0;
|
|
122
|
+
|
|
123
|
+
case 11:
|
|
124
|
+
if (!(i < fileInfo.length)) {
|
|
125
|
+
_context.next = 42;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
oneFileInfo = fileInfo[i];
|
|
130
|
+
matched = false;
|
|
131
|
+
j = 0;
|
|
132
|
+
|
|
133
|
+
case 15:
|
|
134
|
+
if (!(!matched && j < access.length)) {
|
|
135
|
+
_context.next = 37;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
credentialSet = access[j]; // strip trailing slash to get bucket name for credential set
|
|
140
|
+
|
|
141
|
+
credentialSetBucket = credentialSet.remote_access.path.replace(/\/$/, "");
|
|
142
|
+
matchers = credentialSet.path_matchers;
|
|
143
|
+
k = 0;
|
|
144
|
+
|
|
145
|
+
case 20:
|
|
146
|
+
if (!(!matched && k < matchers.length)) {
|
|
147
|
+
_context.next = 34;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
matcher = new RegExp(matchers[k]);
|
|
152
|
+
fileSourcePath = oneFileInfo.source;
|
|
153
|
+
|
|
154
|
+
if (!matcher.test(fileSourcePath)) {
|
|
155
|
+
_context.next = 31;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
matched = true; // if full s3 path supplied, check bucket name
|
|
160
|
+
|
|
161
|
+
s3prefixMatch = s3prefixRegex.exec(fileSourcePath);
|
|
162
|
+
|
|
163
|
+
if (!s3prefixMatch) {
|
|
164
|
+
_context.next = 30;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
bucketName = s3prefixMatch[1];
|
|
169
|
+
|
|
170
|
+
if (!(bucketName !== credentialSetBucket)) {
|
|
171
|
+
_context.next = 30;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
throw Error("Full S3 file path \"" + fileSourcePath + "\" matched to credential set with different bucket name '" + credentialSetBucket + "'");
|
|
176
|
+
|
|
177
|
+
case 30:
|
|
178
|
+
if (credentialSet.hasOwnProperty("matched")) {
|
|
179
|
+
credentialSet.matched.push(oneFileInfo);
|
|
180
|
+
} else {
|
|
181
|
+
// first matching file path for this credential set,
|
|
182
|
+
// initialize new 'matched' property to 1-element array
|
|
183
|
+
credentialSet.matched = [oneFileInfo];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
case 31:
|
|
187
|
+
k++;
|
|
188
|
+
_context.next = 20;
|
|
144
189
|
break;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
credentialSet.matched.push(oneFileInfo);
|
|
150
|
-
} else {
|
|
151
|
-
// first matching file path for this credential set,
|
|
152
|
-
// initialize new 'matched' property to 1-element array
|
|
153
|
-
credentialSet.matched = [oneFileInfo];
|
|
154
|
-
}
|
|
155
|
-
case 31:
|
|
156
|
-
k++;
|
|
157
|
-
_context.next = 20;
|
|
158
|
-
break;
|
|
159
|
-
case 34:
|
|
160
|
-
j++;
|
|
161
|
-
_context.next = 15;
|
|
162
|
-
break;
|
|
163
|
-
case 37:
|
|
164
|
-
if (matched) {
|
|
165
|
-
_context.next = 39;
|
|
190
|
+
|
|
191
|
+
case 34:
|
|
192
|
+
j++;
|
|
193
|
+
_context.next = 15;
|
|
166
194
|
break;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
195
|
+
|
|
196
|
+
case 37:
|
|
197
|
+
if (matched) {
|
|
198
|
+
_context.next = 39;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
throw Error("no credential set found for file path: \"" + filePath + "\"");
|
|
203
|
+
|
|
204
|
+
case 39:
|
|
205
|
+
i++;
|
|
206
|
+
_context.next = 11;
|
|
178
207
|
break;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
208
|
+
|
|
209
|
+
case 42:
|
|
210
|
+
_i = 0;
|
|
211
|
+
|
|
212
|
+
case 43:
|
|
213
|
+
if (!(_i < access.length)) {
|
|
214
|
+
_context.next = 55;
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
_credentialSet = access[_i];
|
|
219
|
+
|
|
220
|
+
if (!(_credentialSet.hasOwnProperty("matched") && _credentialSet.matched.length > 0)) {
|
|
221
|
+
_context.next = 52;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
region = _credentialSet.remote_access.storage_endpoint.region;
|
|
226
|
+
bucket = _credentialSet.remote_access.path.replace(/\/$/, "");
|
|
227
|
+
accessKey = _credentialSet.remote_access.cloud_credentials.access_key_id;
|
|
228
|
+
secret = _credentialSet.remote_access.cloud_credentials.secret_access_key;
|
|
182
229
|
_context.next = 52;
|
|
230
|
+
return this.UploadFilesFromS3({
|
|
231
|
+
libraryId: libraryId,
|
|
232
|
+
objectId: id,
|
|
233
|
+
writeToken: write_token,
|
|
234
|
+
fileInfo: _credentialSet.matched,
|
|
235
|
+
region: region,
|
|
236
|
+
bucket: bucket,
|
|
237
|
+
accessKey: accessKey,
|
|
238
|
+
secret: secret,
|
|
239
|
+
copy: copy,
|
|
240
|
+
callback: callback,
|
|
241
|
+
encryption: encrypt ? "cgck" : "none"
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
case 52:
|
|
245
|
+
_i++;
|
|
246
|
+
_context.next = 43;
|
|
183
247
|
break;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
writeToken: write_token,
|
|
271
|
-
commitMessage: "Create master",
|
|
272
|
-
awaitCommitConfirmation: false
|
|
273
|
-
});
|
|
274
|
-
case 71:
|
|
275
|
-
finalizeResponse = _context.sent;
|
|
276
|
-
return _context.abrupt("return", _objectSpread({
|
|
277
|
-
errors: errors || [],
|
|
278
|
-
logs: logs || [],
|
|
279
|
-
warnings: warnings || []
|
|
280
|
-
}, finalizeResponse));
|
|
281
|
-
case 73:
|
|
282
|
-
case "end":
|
|
283
|
-
return _context.stop();
|
|
248
|
+
|
|
249
|
+
case 55:
|
|
250
|
+
_context.next = 59;
|
|
251
|
+
break;
|
|
252
|
+
|
|
253
|
+
case 57:
|
|
254
|
+
_context.next = 59;
|
|
255
|
+
return this.UploadFiles({
|
|
256
|
+
libraryId: libraryId,
|
|
257
|
+
objectId: id,
|
|
258
|
+
writeToken: write_token,
|
|
259
|
+
fileInfo: fileInfo,
|
|
260
|
+
callback: callback,
|
|
261
|
+
encryption: encrypt ? "cgck" : "none"
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
case 59:
|
|
265
|
+
_context.next = 61;
|
|
266
|
+
return this.CreateEncryptionConk({
|
|
267
|
+
libraryId: libraryId,
|
|
268
|
+
objectId: id,
|
|
269
|
+
writeToken: write_token,
|
|
270
|
+
createKMSConk: true
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
case 61:
|
|
274
|
+
_context.next = 63;
|
|
275
|
+
return this.CallBitcodeMethod({
|
|
276
|
+
libraryId: libraryId,
|
|
277
|
+
objectId: id,
|
|
278
|
+
writeToken: write_token,
|
|
279
|
+
method: UrlJoin("media", "production_master", "init"),
|
|
280
|
+
queryParams: {
|
|
281
|
+
response_log_level: respLogLevel,
|
|
282
|
+
struct_log_level: structLogLevel
|
|
283
|
+
},
|
|
284
|
+
body: {
|
|
285
|
+
access: access
|
|
286
|
+
},
|
|
287
|
+
constant: false
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
case 63:
|
|
291
|
+
_yield$this$CallBitco = _context.sent;
|
|
292
|
+
logs = _yield$this$CallBitco.logs;
|
|
293
|
+
errors = _yield$this$CallBitco.errors;
|
|
294
|
+
warnings = _yield$this$CallBitco.warnings;
|
|
295
|
+
_context.next = 69;
|
|
296
|
+
return this.MergeMetadata({
|
|
297
|
+
libraryId: libraryId,
|
|
298
|
+
objectId: id,
|
|
299
|
+
writeToken: write_token,
|
|
300
|
+
metadata: _objectSpread(_objectSpread({}, metadata || {}), {}, {
|
|
301
|
+
name: name,
|
|
302
|
+
description: description,
|
|
303
|
+
reference: access && !copy,
|
|
304
|
+
"public": _objectSpread(_objectSpread({}, (metadata || {})["public"] || {}), {}, {
|
|
305
|
+
name: name || "",
|
|
306
|
+
description: description || ""
|
|
307
|
+
}),
|
|
308
|
+
elv_created_at: new Date().getTime()
|
|
309
|
+
})
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
case 69:
|
|
313
|
+
_context.next = 71;
|
|
314
|
+
return this.FinalizeContentObject({
|
|
315
|
+
libraryId: libraryId,
|
|
316
|
+
objectId: id,
|
|
317
|
+
writeToken: write_token,
|
|
318
|
+
commitMessage: "Create master",
|
|
319
|
+
awaitCommitConfirmation: false
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
case 71:
|
|
323
|
+
finalizeResponse = _context.sent;
|
|
324
|
+
return _context.abrupt("return", _objectSpread({
|
|
325
|
+
errors: errors || [],
|
|
326
|
+
logs: logs || [],
|
|
327
|
+
warnings: warnings || []
|
|
328
|
+
}, finalizeResponse));
|
|
329
|
+
|
|
330
|
+
case 73:
|
|
331
|
+
case "end":
|
|
332
|
+
return _context.stop();
|
|
333
|
+
}
|
|
284
334
|
}
|
|
285
335
|
}, _callee, this);
|
|
286
336
|
}));
|
|
337
|
+
|
|
287
338
|
return function (_x) {
|
|
288
339
|
return _ref2.apply(this, arguments);
|
|
289
340
|
};
|
|
290
341
|
}();
|
|
291
|
-
|
|
292
342
|
/**
|
|
293
343
|
* Create (or edit) a mezzanine offering based on the a given master content object version and variant key
|
|
294
344
|
*
|
|
@@ -312,250 +362,298 @@ exports.CreateProductionMaster = /*#__PURE__*/function () {
|
|
|
312
362
|
*
|
|
313
363
|
* @return {Object} - The finalize response for the object, as well as logs, warnings and errors from the mezzanine initialization
|
|
314
364
|
*/
|
|
365
|
+
|
|
366
|
+
|
|
315
367
|
exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
316
368
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
317
369
|
var libraryId, objectId, type, name, description, metadata, masterVersionHash, abrProfile, addlOfferingSpecs, _ref3$variant, variant, _ref3$offeringKey, offeringKey, _ref3$keepOtherStream, keepOtherStreams, _ref3$respLogLevel, respLogLevel, _ref3$structLogLevel, structLogLevel, streamKeys, existingMez, options, id, write_token, editResponse, createResponse, masterName, authorizationTokens, headers, body, storeClear, _yield$this$CallBitco2, logs, errors, warnings, existingMetadata, finalizeResponse;
|
|
370
|
+
|
|
318
371
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
319
|
-
while (1)
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
372
|
+
while (1) {
|
|
373
|
+
switch (_context2.prev = _context2.next) {
|
|
374
|
+
case 0:
|
|
375
|
+
libraryId = _ref3.libraryId, objectId = _ref3.objectId, type = _ref3.type, name = _ref3.name, description = _ref3.description, metadata = _ref3.metadata, masterVersionHash = _ref3.masterVersionHash, abrProfile = _ref3.abrProfile, addlOfferingSpecs = _ref3.addlOfferingSpecs, _ref3$variant = _ref3.variant, variant = _ref3$variant === void 0 ? "default" : _ref3$variant, _ref3$offeringKey = _ref3.offeringKey, offeringKey = _ref3$offeringKey === void 0 ? "default" : _ref3$offeringKey, _ref3$keepOtherStream = _ref3.keepOtherStreams, keepOtherStreams = _ref3$keepOtherStream === void 0 ? false : _ref3$keepOtherStream, _ref3$respLogLevel = _ref3.respLogLevel, respLogLevel = _ref3$respLogLevel === void 0 ? "warn" : _ref3$respLogLevel, _ref3$structLogLevel = _ref3.structLogLevel, structLogLevel = _ref3$structLogLevel === void 0 ? "none" : _ref3$structLogLevel, streamKeys = _ref3.streamKeys;
|
|
376
|
+
ValidateLibrary(libraryId);
|
|
377
|
+
ValidateVersion(masterVersionHash);
|
|
378
|
+
|
|
379
|
+
if (masterVersionHash) {
|
|
380
|
+
_context2.next = 5;
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
throw Error("Master version hash not specified");
|
|
385
|
+
|
|
386
|
+
case 5:
|
|
387
|
+
if (!(!objectId && keepOtherStreams)) {
|
|
388
|
+
_context2.next = 7;
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
throw Error("Existing mezzanine object ID required in order to use 'keepOtherStreams'");
|
|
393
|
+
|
|
394
|
+
case 7:
|
|
395
|
+
if (!(addlOfferingSpecs && !abrProfile)) {
|
|
396
|
+
_context2.next = 9;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
throw Error("abrProfile required when using addlOfferingSpecs");
|
|
401
|
+
|
|
402
|
+
case 9:
|
|
403
|
+
existingMez = !!objectId;
|
|
404
|
+
options = type ? {
|
|
405
|
+
type: type
|
|
406
|
+
} : {};
|
|
407
|
+
|
|
408
|
+
if (!existingMez) {
|
|
409
|
+
_context2.next = 19;
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
_context2.next = 14;
|
|
414
|
+
return this.EditContentObject({
|
|
415
|
+
libraryId: libraryId,
|
|
416
|
+
objectId: objectId,
|
|
417
|
+
options: options
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
case 14:
|
|
421
|
+
editResponse = _context2.sent;
|
|
422
|
+
id = editResponse.id;
|
|
423
|
+
write_token = editResponse.write_token;
|
|
424
|
+
_context2.next = 24;
|
|
348
425
|
break;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
426
|
+
|
|
427
|
+
case 19:
|
|
428
|
+
_context2.next = 21;
|
|
429
|
+
return this.CreateContentObject({
|
|
430
|
+
libraryId: libraryId,
|
|
431
|
+
options: options
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
case 21:
|
|
435
|
+
createResponse = _context2.sent;
|
|
436
|
+
id = createResponse.id;
|
|
437
|
+
write_token = createResponse.write_token;
|
|
438
|
+
|
|
439
|
+
case 24:
|
|
440
|
+
_context2.next = 26;
|
|
441
|
+
return this.CreateEncryptionConk({
|
|
442
|
+
libraryId: libraryId,
|
|
443
|
+
objectId: id,
|
|
444
|
+
writeToken: write_token,
|
|
445
|
+
createKMSConk: true
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
case 26:
|
|
449
|
+
_context2.next = 28;
|
|
450
|
+
return this.ContentObjectMetadata({
|
|
451
|
+
versionHash: masterVersionHash,
|
|
452
|
+
metadataSubtree: "public/name"
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
case 28:
|
|
456
|
+
masterName = _context2.sent;
|
|
457
|
+
// Include authorization for library, master, and mezzanine
|
|
458
|
+
authorizationTokens = [];
|
|
459
|
+
_context2.t0 = authorizationTokens;
|
|
460
|
+
_context2.next = 33;
|
|
461
|
+
return this.authClient.AuthorizationToken({
|
|
462
|
+
libraryId: libraryId,
|
|
463
|
+
objectId: id,
|
|
464
|
+
update: true
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
case 33:
|
|
468
|
+
_context2.t1 = _context2.sent;
|
|
469
|
+
|
|
470
|
+
_context2.t0.push.call(_context2.t0, _context2.t1);
|
|
471
|
+
|
|
472
|
+
_context2.t2 = authorizationTokens;
|
|
473
|
+
_context2.next = 38;
|
|
474
|
+
return this.authClient.AuthorizationToken({
|
|
475
|
+
libraryId: libraryId
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
case 38:
|
|
479
|
+
_context2.t3 = _context2.sent;
|
|
480
|
+
|
|
481
|
+
_context2.t2.push.call(_context2.t2, _context2.t3);
|
|
482
|
+
|
|
483
|
+
_context2.t4 = authorizationTokens;
|
|
484
|
+
_context2.next = 43;
|
|
485
|
+
return this.authClient.AuthorizationToken({
|
|
486
|
+
versionHash: masterVersionHash
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
case 43:
|
|
490
|
+
_context2.t5 = _context2.sent;
|
|
491
|
+
|
|
492
|
+
_context2.t4.push.call(_context2.t4, _context2.t5);
|
|
493
|
+
|
|
494
|
+
headers = {
|
|
495
|
+
Authorization: authorizationTokens.map(function (token) {
|
|
496
|
+
return "Bearer ".concat(token);
|
|
497
|
+
}).join(",")
|
|
498
|
+
};
|
|
499
|
+
body = {
|
|
500
|
+
additional_offering_specs: addlOfferingSpecs,
|
|
501
|
+
offering_key: offeringKey,
|
|
502
|
+
keep_other_streams: keepOtherStreams,
|
|
503
|
+
prod_master_hash: masterVersionHash,
|
|
504
|
+
stream_keys: streamKeys,
|
|
505
|
+
variant_key: variant
|
|
506
|
+
};
|
|
507
|
+
storeClear = false;
|
|
508
|
+
|
|
509
|
+
if (!abrProfile) {
|
|
510
|
+
_context2.next = 53;
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
body.abr_profile = abrProfile;
|
|
515
|
+
storeClear = abrProfile.store_clear;
|
|
516
|
+
_context2.next = 56;
|
|
432
517
|
break;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
518
|
+
|
|
519
|
+
case 53:
|
|
520
|
+
_context2.next = 55;
|
|
521
|
+
return this.ContentObjectMetadata({
|
|
522
|
+
libraryId: libraryId,
|
|
523
|
+
objectId: this.utils.AddressToObjectId(this.utils.HashToAddress(libraryId)),
|
|
524
|
+
metadataSubtree: "abr_profile/store_clear"
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
case 55:
|
|
528
|
+
storeClear = _context2.sent;
|
|
529
|
+
|
|
530
|
+
case 56:
|
|
531
|
+
if (storeClear) {
|
|
532
|
+
_context2.next = 59;
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
|
|
449
536
|
_context2.next = 59;
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
metadata["public"]
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
metadata["public"].
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
537
|
+
return this.EncryptionConk({
|
|
538
|
+
libraryId: libraryId,
|
|
539
|
+
objectId: id,
|
|
540
|
+
writeToken: write_token
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
case 59:
|
|
544
|
+
_context2.next = 61;
|
|
545
|
+
return this.CallBitcodeMethod({
|
|
546
|
+
libraryId: libraryId,
|
|
547
|
+
objectId: id,
|
|
548
|
+
writeToken: write_token,
|
|
549
|
+
method: UrlJoin("media", "abr_mezzanine", "init"),
|
|
550
|
+
queryParams: {
|
|
551
|
+
response_log_level: respLogLevel,
|
|
552
|
+
struct_log_level: structLogLevel
|
|
553
|
+
},
|
|
554
|
+
headers: headers,
|
|
555
|
+
body: body,
|
|
556
|
+
constant: false
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
case 61:
|
|
560
|
+
_yield$this$CallBitco2 = _context2.sent;
|
|
561
|
+
logs = _yield$this$CallBitco2.logs;
|
|
562
|
+
errors = _yield$this$CallBitco2.errors;
|
|
563
|
+
warnings = _yield$this$CallBitco2.warnings;
|
|
564
|
+
|
|
565
|
+
if (!metadata) {
|
|
566
|
+
metadata = {};
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
if (!metadata["public"]) {
|
|
570
|
+
metadata["public"] = {};
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
if (!metadata["public"].asset_metadata) {
|
|
574
|
+
metadata["public"].asset_metadata = {};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
metadata.master = {
|
|
578
|
+
name: masterName,
|
|
579
|
+
id: this.utils.DecodeVersionHash(masterVersionHash).objectId,
|
|
580
|
+
hash: masterVersionHash,
|
|
581
|
+
variant: variant
|
|
582
|
+
};
|
|
583
|
+
metadata["public"] = _objectSpread({}, metadata["public"]);
|
|
584
|
+
metadata["public"].asset_metadata = _objectSpread({
|
|
585
|
+
sources: _defineProperty({}, offeringKey, {
|
|
586
|
+
"/": "./rep/playout/".concat(offeringKey, "/options.json")
|
|
587
|
+
})
|
|
588
|
+
}, metadata["public"].asset_metadata);
|
|
589
|
+
|
|
590
|
+
if (name || !existingMez) {
|
|
591
|
+
metadata.name = name || "".concat(masterName, " Mezzanine");
|
|
592
|
+
metadata["public"].name = name || "".concat(masterName, " Mezzanine");
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
if (description || !existingMez) {
|
|
596
|
+
metadata.description = description || "";
|
|
597
|
+
metadata["public"].description = description || "";
|
|
598
|
+
} // retrieve existing metadata to merge with updated metadata
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
_context2.next = 75;
|
|
602
|
+
return this.ContentObjectMetadata({
|
|
603
|
+
libraryId: libraryId,
|
|
604
|
+
objectId: id,
|
|
605
|
+
writeToken: write_token
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
case 75:
|
|
609
|
+
existingMetadata = _context2.sent;
|
|
610
|
+
// newer metadata values replace existing metadata, unless both new and old values are objects,
|
|
611
|
+
// in which case their keys are merged recursively
|
|
612
|
+
metadata = R.mergeDeepRight(existingMetadata, metadata);
|
|
613
|
+
|
|
614
|
+
if (!existingMez) {
|
|
615
|
+
// set creation date
|
|
616
|
+
metadata.elv_created_at = new Date().getTime();
|
|
617
|
+
} // write metadata to mezzanine object
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
_context2.next = 80;
|
|
621
|
+
return this.ReplaceMetadata({
|
|
622
|
+
libraryId: libraryId,
|
|
623
|
+
objectId: id,
|
|
624
|
+
writeToken: write_token,
|
|
625
|
+
metadata: metadata
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
case 80:
|
|
629
|
+
_context2.next = 82;
|
|
630
|
+
return this.FinalizeContentObject({
|
|
631
|
+
libraryId: libraryId,
|
|
632
|
+
objectId: id,
|
|
633
|
+
writeToken: write_token,
|
|
634
|
+
commitMessage: "Create ABR mezzanine"
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
case 82:
|
|
638
|
+
finalizeResponse = _context2.sent;
|
|
639
|
+
return _context2.abrupt("return", _objectSpread({
|
|
640
|
+
logs: logs || [],
|
|
641
|
+
warnings: warnings || [],
|
|
642
|
+
errors: errors || []
|
|
643
|
+
}, finalizeResponse));
|
|
644
|
+
|
|
645
|
+
case 84:
|
|
646
|
+
case "end":
|
|
647
|
+
return _context2.stop();
|
|
648
|
+
}
|
|
551
649
|
}
|
|
552
650
|
}, _callee2, this);
|
|
553
651
|
}));
|
|
652
|
+
|
|
554
653
|
return function (_x2) {
|
|
555
654
|
return _ref4.apply(this, arguments);
|
|
556
655
|
};
|
|
557
656
|
}();
|
|
558
|
-
|
|
559
657
|
/**
|
|
560
658
|
* Start any incomplete jobs on the specified mezzanine
|
|
561
659
|
*
|
|
@@ -570,154 +668,176 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
570
668
|
*
|
|
571
669
|
* @return {Promise<Object>} - A write token for the mezzanine object, as well as any logs, warnings and errors from the job initialization
|
|
572
670
|
*/
|
|
671
|
+
|
|
672
|
+
|
|
573
673
|
exports.StartABRMezzanineJobs = /*#__PURE__*/function () {
|
|
574
674
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref5) {
|
|
575
675
|
var _this = this;
|
|
676
|
+
|
|
576
677
|
var libraryId, objectId, _ref5$offeringKey, offeringKey, _ref5$access, access, _ref5$jobIndexes, jobIndexes, mezzanineMetadata, prepSpecs, masterVersionHashes, authorizationTokens, headers, processingDraft, lroInfo, statusDraft, finalizeResponse, _yield$this$CallBitco3, data, errors, warnings, logs;
|
|
678
|
+
|
|
577
679
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
578
|
-
while (1)
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
680
|
+
while (1) {
|
|
681
|
+
switch (_context4.prev = _context4.next) {
|
|
682
|
+
case 0:
|
|
683
|
+
libraryId = _ref5.libraryId, objectId = _ref5.objectId, _ref5$offeringKey = _ref5.offeringKey, offeringKey = _ref5$offeringKey === void 0 ? "default" : _ref5$offeringKey, _ref5$access = _ref5.access, access = _ref5$access === void 0 ? [] : _ref5$access, _ref5$jobIndexes = _ref5.jobIndexes, jobIndexes = _ref5$jobIndexes === void 0 ? null : _ref5$jobIndexes;
|
|
684
|
+
ValidateParameters({
|
|
685
|
+
libraryId: libraryId,
|
|
686
|
+
objectId: objectId
|
|
687
|
+
});
|
|
688
|
+
_context4.next = 4;
|
|
689
|
+
return this.ContentObjectMetadata({
|
|
690
|
+
libraryId: libraryId,
|
|
691
|
+
objectId: objectId,
|
|
692
|
+
metadataSubtree: UrlJoin("abr_mezzanine", "offerings")
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
case 4:
|
|
696
|
+
mezzanineMetadata = _context4.sent;
|
|
697
|
+
prepSpecs = mezzanineMetadata[offeringKey].mez_prep_specs || []; // Retrieve all masters associated with this offering
|
|
698
|
+
|
|
699
|
+
masterVersionHashes = Object.keys(prepSpecs).map(function (spec) {
|
|
700
|
+
return (prepSpecs[spec].source_streams || []).map(function (stream) {
|
|
701
|
+
return stream.source_hash;
|
|
702
|
+
});
|
|
703
|
+
}); // Flatten and filter
|
|
704
|
+
|
|
705
|
+
masterVersionHashes = [].concat.apply([], masterVersionHashes).filter(function (hash) {
|
|
706
|
+
return hash;
|
|
707
|
+
}).filter(function (v, i, a) {
|
|
708
|
+
return a.indexOf(v) === i;
|
|
709
|
+
}); // Retrieve authorization tokens for all masters and the mezzanine
|
|
710
|
+
|
|
711
|
+
_context4.next = 10;
|
|
712
|
+
return Promise.all(masterVersionHashes.map( /*#__PURE__*/function () {
|
|
713
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(versionHash) {
|
|
714
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
715
|
+
while (1) {
|
|
716
|
+
switch (_context3.prev = _context3.next) {
|
|
717
|
+
case 0:
|
|
718
|
+
_context3.next = 2;
|
|
719
|
+
return _this.authClient.AuthorizationToken({
|
|
720
|
+
versionHash: versionHash
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
case 2:
|
|
724
|
+
return _context3.abrupt("return", _context3.sent);
|
|
725
|
+
|
|
726
|
+
case 3:
|
|
727
|
+
case "end":
|
|
728
|
+
return _context3.stop();
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}, _callee3);
|
|
732
|
+
}));
|
|
733
|
+
|
|
734
|
+
return function (_x4) {
|
|
735
|
+
return _ref7.apply(this, arguments);
|
|
736
|
+
};
|
|
737
|
+
}()));
|
|
738
|
+
|
|
739
|
+
case 10:
|
|
740
|
+
authorizationTokens = _context4.sent;
|
|
741
|
+
_context4.next = 13;
|
|
742
|
+
return this.authClient.AuthorizationToken({
|
|
743
|
+
libraryId: libraryId,
|
|
744
|
+
objectId: objectId,
|
|
745
|
+
update: true
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
case 13:
|
|
749
|
+
_context4.t0 = _context4.sent;
|
|
750
|
+
authorizationTokens = [_context4.t0].concat(_toConsumableArray(authorizationTokens));
|
|
751
|
+
headers = {
|
|
752
|
+
Authorization: authorizationTokens.map(function (token) {
|
|
753
|
+
return "Bearer ".concat(token);
|
|
754
|
+
}).join(",")
|
|
626
755
|
};
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
writeToken: processingDraft.write_token,
|
|
705
|
-
data: data,
|
|
706
|
-
logs: logs || [],
|
|
707
|
-
warnings: warnings || [],
|
|
708
|
-
errors: errors || []
|
|
709
|
-
});
|
|
710
|
-
case 36:
|
|
711
|
-
case "end":
|
|
712
|
-
return _context4.stop();
|
|
756
|
+
_context4.next = 18;
|
|
757
|
+
return this.EditContentObject({
|
|
758
|
+
libraryId: libraryId,
|
|
759
|
+
objectId: objectId
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
case 18:
|
|
763
|
+
processingDraft = _context4.sent;
|
|
764
|
+
lroInfo = {
|
|
765
|
+
write_token: processingDraft.write_token,
|
|
766
|
+
node: this.HttpClient.BaseURI().toString(),
|
|
767
|
+
offering: offeringKey
|
|
768
|
+
}; // Update metadata with LRO version write token
|
|
769
|
+
|
|
770
|
+
_context4.next = 22;
|
|
771
|
+
return this.EditContentObject({
|
|
772
|
+
libraryId: libraryId,
|
|
773
|
+
objectId: objectId
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
case 22:
|
|
777
|
+
statusDraft = _context4.sent;
|
|
778
|
+
_context4.next = 25;
|
|
779
|
+
return this.ReplaceMetadata({
|
|
780
|
+
libraryId: libraryId,
|
|
781
|
+
objectId: objectId,
|
|
782
|
+
writeToken: statusDraft.write_token,
|
|
783
|
+
metadataSubtree: "lro_draft_".concat(offeringKey),
|
|
784
|
+
metadata: lroInfo
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
case 25:
|
|
788
|
+
_context4.next = 27;
|
|
789
|
+
return this.FinalizeContentObject({
|
|
790
|
+
libraryId: libraryId,
|
|
791
|
+
objectId: objectId,
|
|
792
|
+
writeToken: statusDraft.write_token,
|
|
793
|
+
commitMessage: "Mezzanine LRO status"
|
|
794
|
+
});
|
|
795
|
+
|
|
796
|
+
case 27:
|
|
797
|
+
finalizeResponse = _context4.sent;
|
|
798
|
+
_context4.next = 30;
|
|
799
|
+
return this.CallBitcodeMethod({
|
|
800
|
+
libraryId: libraryId,
|
|
801
|
+
objectId: objectId,
|
|
802
|
+
writeToken: processingDraft.write_token,
|
|
803
|
+
headers: headers,
|
|
804
|
+
method: UrlJoin("media", "abr_mezzanine", "prep_start"),
|
|
805
|
+
constant: false,
|
|
806
|
+
body: {
|
|
807
|
+
access: access,
|
|
808
|
+
offering_key: offeringKey,
|
|
809
|
+
job_indexes: jobIndexes
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
case 30:
|
|
814
|
+
_yield$this$CallBitco3 = _context4.sent;
|
|
815
|
+
data = _yield$this$CallBitco3.data;
|
|
816
|
+
errors = _yield$this$CallBitco3.errors;
|
|
817
|
+
warnings = _yield$this$CallBitco3.warnings;
|
|
818
|
+
logs = _yield$this$CallBitco3.logs;
|
|
819
|
+
return _context4.abrupt("return", {
|
|
820
|
+
hash: finalizeResponse.hash,
|
|
821
|
+
lro_draft: lroInfo,
|
|
822
|
+
writeToken: processingDraft.write_token,
|
|
823
|
+
data: data,
|
|
824
|
+
logs: logs || [],
|
|
825
|
+
warnings: warnings || [],
|
|
826
|
+
errors: errors || []
|
|
827
|
+
});
|
|
828
|
+
|
|
829
|
+
case 36:
|
|
830
|
+
case "end":
|
|
831
|
+
return _context4.stop();
|
|
832
|
+
}
|
|
713
833
|
}
|
|
714
834
|
}, _callee4, this);
|
|
715
835
|
}));
|
|
836
|
+
|
|
716
837
|
return function (_x3) {
|
|
717
838
|
return _ref6.apply(this, arguments);
|
|
718
839
|
};
|
|
719
840
|
}();
|
|
720
|
-
|
|
721
841
|
/**
|
|
722
842
|
* Retrieve status information for a long running operation (LRO) on the given object.
|
|
723
843
|
*
|
|
@@ -729,80 +849,99 @@ exports.StartABRMezzanineJobs = /*#__PURE__*/function () {
|
|
|
729
849
|
*
|
|
730
850
|
* @return {Promise<Object>} - LRO status
|
|
731
851
|
*/
|
|
852
|
+
|
|
853
|
+
|
|
732
854
|
exports.LROStatus = /*#__PURE__*/function () {
|
|
733
855
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref8) {
|
|
734
856
|
var libraryId, objectId, _ref8$offeringKey, offeringKey, lroDraft, ready;
|
|
857
|
+
|
|
735
858
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
736
|
-
while (1)
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
_context5.
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
859
|
+
while (1) {
|
|
860
|
+
switch (_context5.prev = _context5.next) {
|
|
861
|
+
case 0:
|
|
862
|
+
libraryId = _ref8.libraryId, objectId = _ref8.objectId, _ref8$offeringKey = _ref8.offeringKey, offeringKey = _ref8$offeringKey === void 0 ? "default" : _ref8$offeringKey;
|
|
863
|
+
ValidateParameters({
|
|
864
|
+
libraryId: libraryId,
|
|
865
|
+
objectId: objectId
|
|
866
|
+
});
|
|
867
|
+
_context5.next = 4;
|
|
868
|
+
return this.ContentObjectMetadata({
|
|
869
|
+
libraryId: libraryId,
|
|
870
|
+
objectId: objectId,
|
|
871
|
+
metadataSubtree: "lro_draft_".concat(offeringKey)
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
case 4:
|
|
875
|
+
_context5.t0 = _context5.sent;
|
|
876
|
+
|
|
877
|
+
if (_context5.t0) {
|
|
878
|
+
_context5.next = 9;
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
_context5.next = 8;
|
|
883
|
+
return this.ContentObjectMetadata({
|
|
884
|
+
libraryId: libraryId,
|
|
885
|
+
objectId: objectId,
|
|
886
|
+
metadataSubtree: "lro_draft"
|
|
887
|
+
});
|
|
888
|
+
|
|
889
|
+
case 8:
|
|
890
|
+
_context5.t0 = _context5.sent;
|
|
891
|
+
|
|
892
|
+
case 9:
|
|
893
|
+
lroDraft = _context5.t0;
|
|
894
|
+
|
|
895
|
+
if (!(!lroDraft || !lroDraft.write_token)) {
|
|
896
|
+
_context5.next = 19;
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
_context5.next = 13;
|
|
901
|
+
return this.ContentObjectMetadata({
|
|
902
|
+
libraryId: libraryId,
|
|
903
|
+
objectId: objectId,
|
|
904
|
+
metadataSubtree: UrlJoin("abr_mezzanine", "offerings", offeringKey, "ready")
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
case 13:
|
|
908
|
+
ready = _context5.sent;
|
|
909
|
+
|
|
910
|
+
if (!ready) {
|
|
911
|
+
_context5.next = 18;
|
|
912
|
+
break;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
throw Error("Mezzanine already finalized for offering '".concat(offeringKey, "'"));
|
|
916
|
+
|
|
917
|
+
case 18:
|
|
918
|
+
throw Error("No LRO draft found for this mezzanine");
|
|
919
|
+
|
|
920
|
+
case 19:
|
|
921
|
+
this.HttpClient.RecordWriteToken(lroDraft.write_token, lroDraft.node);
|
|
922
|
+
_context5.next = 22;
|
|
923
|
+
return this.ContentObjectMetadata({
|
|
924
|
+
libraryId: libraryId,
|
|
925
|
+
objectId: objectId,
|
|
926
|
+
writeToken: lroDraft.write_token,
|
|
927
|
+
metadataSubtree: "lro_status"
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
case 22:
|
|
931
|
+
return _context5.abrupt("return", _context5.sent);
|
|
932
|
+
|
|
933
|
+
case 23:
|
|
934
|
+
case "end":
|
|
935
|
+
return _context5.stop();
|
|
936
|
+
}
|
|
798
937
|
}
|
|
799
938
|
}, _callee5, this);
|
|
800
939
|
}));
|
|
940
|
+
|
|
801
941
|
return function (_x5) {
|
|
802
942
|
return _ref9.apply(this, arguments);
|
|
803
943
|
};
|
|
804
944
|
}();
|
|
805
|
-
|
|
806
945
|
/**
|
|
807
946
|
* Finalize a mezzanine object after all jobs have finished
|
|
808
947
|
*
|
|
@@ -817,155 +956,186 @@ exports.LROStatus = /*#__PURE__*/function () {
|
|
|
817
956
|
*
|
|
818
957
|
* @return {Promise<Object>} - The finalize response for the mezzanine object, as well as any logs, warnings and errors from the finalization
|
|
819
958
|
*/
|
|
959
|
+
|
|
960
|
+
|
|
820
961
|
exports.FinalizeABRMezzanine = /*#__PURE__*/function () {
|
|
821
962
|
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref10) {
|
|
822
963
|
var libraryId, objectId, _ref10$offeringKey, offeringKey, preFinalizeFn, preFinalizeThrow, lroDraft, httpClient, error, result, mezzanineMetadata, masterHash, authorizationTokens, headers, _yield$this$CallBitco4, data, errors, warnings, logs, preFinalizeWarnings, params, finalizeResponse;
|
|
964
|
+
|
|
823
965
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
824
|
-
while (1)
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
966
|
+
while (1) {
|
|
967
|
+
switch (_context6.prev = _context6.next) {
|
|
968
|
+
case 0:
|
|
969
|
+
libraryId = _ref10.libraryId, objectId = _ref10.objectId, _ref10$offeringKey = _ref10.offeringKey, offeringKey = _ref10$offeringKey === void 0 ? "default" : _ref10$offeringKey, preFinalizeFn = _ref10.preFinalizeFn, preFinalizeThrow = _ref10.preFinalizeThrow;
|
|
970
|
+
ValidateParameters({
|
|
971
|
+
libraryId: libraryId,
|
|
972
|
+
objectId: objectId
|
|
973
|
+
});
|
|
974
|
+
_context6.next = 4;
|
|
975
|
+
return this.ContentObjectMetadata({
|
|
976
|
+
libraryId: libraryId,
|
|
977
|
+
objectId: objectId,
|
|
978
|
+
metadataSubtree: "lro_draft_".concat(offeringKey)
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
case 4:
|
|
982
|
+
lroDraft = _context6.sent;
|
|
983
|
+
|
|
984
|
+
if (!(!lroDraft || !lroDraft.write_token)) {
|
|
985
|
+
_context6.next = 7;
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
throw Error("No LRO draft found for this mezzanine");
|
|
990
|
+
|
|
991
|
+
case 7:
|
|
992
|
+
httpClient = this.HttpClient;
|
|
993
|
+
_context6.prev = 8;
|
|
994
|
+
// Point directly to the node containing the draft
|
|
995
|
+
this.HttpClient = new HttpClient({
|
|
996
|
+
uris: [lroDraft.node],
|
|
997
|
+
debug: httpClient.debug
|
|
998
|
+
});
|
|
999
|
+
_context6.next = 12;
|
|
1000
|
+
return this.ContentObjectMetadata({
|
|
1001
|
+
libraryId: libraryId,
|
|
1002
|
+
objectId: objectId,
|
|
1003
|
+
writeToken: lroDraft.write_token,
|
|
1004
|
+
metadataSubtree: UrlJoin("abr_mezzanine", "offerings")
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
case 12:
|
|
1008
|
+
mezzanineMetadata = _context6.sent;
|
|
1009
|
+
masterHash = mezzanineMetadata[offeringKey].prod_master_hash; // Authorization token for mezzanine and master
|
|
1010
|
+
|
|
1011
|
+
_context6.next = 16;
|
|
1012
|
+
return this.authClient.AuthorizationToken({
|
|
1013
|
+
libraryId: libraryId,
|
|
1014
|
+
objectId: objectId,
|
|
1015
|
+
update: true
|
|
1016
|
+
});
|
|
1017
|
+
|
|
1018
|
+
case 16:
|
|
1019
|
+
_context6.t0 = _context6.sent;
|
|
1020
|
+
_context6.next = 19;
|
|
1021
|
+
return this.authClient.AuthorizationToken({
|
|
1022
|
+
versionHash: masterHash
|
|
1023
|
+
});
|
|
1024
|
+
|
|
1025
|
+
case 19:
|
|
1026
|
+
_context6.t1 = _context6.sent;
|
|
1027
|
+
authorizationTokens = [_context6.t0, _context6.t1];
|
|
1028
|
+
headers = {
|
|
1029
|
+
Authorization: authorizationTokens.map(function (token) {
|
|
1030
|
+
return "Bearer ".concat(token);
|
|
1031
|
+
}).join(",")
|
|
1032
|
+
};
|
|
1033
|
+
_context6.next = 24;
|
|
1034
|
+
return this.CallBitcodeMethod({
|
|
1035
|
+
objectId: objectId,
|
|
1036
|
+
libraryId: libraryId,
|
|
1037
|
+
writeToken: lroDraft.write_token,
|
|
1038
|
+
method: UrlJoin("media", "abr_mezzanine", "offerings", offeringKey, "finalize"),
|
|
1039
|
+
headers: headers,
|
|
1040
|
+
constant: false
|
|
1041
|
+
});
|
|
1042
|
+
|
|
1043
|
+
case 24:
|
|
1044
|
+
_yield$this$CallBitco4 = _context6.sent;
|
|
1045
|
+
data = _yield$this$CallBitco4.data;
|
|
1046
|
+
errors = _yield$this$CallBitco4.errors;
|
|
1047
|
+
warnings = _yield$this$CallBitco4.warnings;
|
|
1048
|
+
logs = _yield$this$CallBitco4.logs;
|
|
1049
|
+
preFinalizeWarnings = [];
|
|
1050
|
+
|
|
1051
|
+
if (!preFinalizeFn) {
|
|
1052
|
+
_context6.next = 45;
|
|
1053
|
+
break;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
params = {
|
|
1057
|
+
elvClient: this,
|
|
1058
|
+
nodeUrl: lroDraft.node,
|
|
1059
|
+
writeToken: lroDraft.write_token
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
if (!preFinalizeThrow) {
|
|
1063
|
+
_context6.next = 37;
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
_context6.next = 35;
|
|
1068
|
+
return preFinalizeFn(params);
|
|
1069
|
+
|
|
1070
|
+
case 35:
|
|
899
1071
|
_context6.next = 45;
|
|
900
1072
|
break;
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
_context6.next =
|
|
1073
|
+
|
|
1074
|
+
case 37:
|
|
1075
|
+
_context6.prev = 37;
|
|
1076
|
+
_context6.next = 40;
|
|
1077
|
+
return preFinalizeFn(params);
|
|
1078
|
+
|
|
1079
|
+
case 40:
|
|
1080
|
+
_context6.next = 45;
|
|
909
1081
|
break;
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
});
|
|
936
|
-
case 47:
|
|
937
|
-
finalizeResponse = _context6.sent;
|
|
938
|
-
result = _objectSpread({
|
|
939
|
-
data: data,
|
|
940
|
-
logs: logs || [],
|
|
941
|
-
warnings: (warnings || []).concat(preFinalizeWarnings),
|
|
942
|
-
errors: errors || []
|
|
943
|
-
}, finalizeResponse);
|
|
944
|
-
_context6.next = 54;
|
|
945
|
-
break;
|
|
946
|
-
case 51:
|
|
947
|
-
_context6.prev = 51;
|
|
948
|
-
_context6.t3 = _context6["catch"](8);
|
|
949
|
-
error = _context6.t3;
|
|
950
|
-
case 54:
|
|
951
|
-
_context6.prev = 54;
|
|
952
|
-
// Ensure original http client is restored
|
|
953
|
-
this.HttpClient = httpClient;
|
|
954
|
-
return _context6.finish(54);
|
|
955
|
-
case 57:
|
|
956
|
-
if (!error) {
|
|
957
|
-
_context6.next = 59;
|
|
1082
|
+
|
|
1083
|
+
case 42:
|
|
1084
|
+
_context6.prev = 42;
|
|
1085
|
+
_context6.t2 = _context6["catch"](37);
|
|
1086
|
+
preFinalizeWarnings = "Error trying to set video stream codec descriptors: ".concat(_context6.t2);
|
|
1087
|
+
|
|
1088
|
+
case 45:
|
|
1089
|
+
_context6.next = 47;
|
|
1090
|
+
return this.FinalizeContentObject({
|
|
1091
|
+
libraryId: libraryId,
|
|
1092
|
+
objectId: objectId,
|
|
1093
|
+
writeToken: lroDraft.write_token,
|
|
1094
|
+
commitMessage: "Finalize ABR mezzanine",
|
|
1095
|
+
awaitCommitConfirmation: false
|
|
1096
|
+
});
|
|
1097
|
+
|
|
1098
|
+
case 47:
|
|
1099
|
+
finalizeResponse = _context6.sent;
|
|
1100
|
+
result = _objectSpread({
|
|
1101
|
+
data: data,
|
|
1102
|
+
logs: logs || [],
|
|
1103
|
+
warnings: (warnings || []).concat(preFinalizeWarnings),
|
|
1104
|
+
errors: errors || []
|
|
1105
|
+
}, finalizeResponse);
|
|
1106
|
+
_context6.next = 54;
|
|
958
1107
|
break;
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
1108
|
+
|
|
1109
|
+
case 51:
|
|
1110
|
+
_context6.prev = 51;
|
|
1111
|
+
_context6.t3 = _context6["catch"](8);
|
|
1112
|
+
error = _context6.t3;
|
|
1113
|
+
|
|
1114
|
+
case 54:
|
|
1115
|
+
_context6.prev = 54;
|
|
1116
|
+
// Ensure original http client is restored
|
|
1117
|
+
this.HttpClient = httpClient;
|
|
1118
|
+
return _context6.finish(54);
|
|
1119
|
+
|
|
1120
|
+
case 57:
|
|
1121
|
+
if (!error) {
|
|
1122
|
+
_context6.next = 59;
|
|
1123
|
+
break;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
throw error;
|
|
1127
|
+
|
|
1128
|
+
case 59:
|
|
1129
|
+
return _context6.abrupt("return", result);
|
|
1130
|
+
|
|
1131
|
+
case 60:
|
|
1132
|
+
case "end":
|
|
1133
|
+
return _context6.stop();
|
|
1134
|
+
}
|
|
966
1135
|
}
|
|
967
1136
|
}, _callee6, this, [[8, 51, 54, 57], [37, 42]]);
|
|
968
1137
|
}));
|
|
1138
|
+
|
|
969
1139
|
return function (_x6) {
|
|
970
1140
|
return _ref11.apply(this, arguments);
|
|
971
1141
|
};
|