@intelligentgraphics/ig.gfx.packager 2.1.2 → 2.2.0
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/index.js +308 -176
- package/build/index.js.map +1 -1
- package/locales/en.json +5 -4
- package/package.json +11 -29
- package/readme.md +56 -4
package/build/index.js
CHANGED
|
@@ -3265,6 +3265,157 @@ exports.WorkSlave = WorkSlave;
|
|
|
3265
3265
|
|
|
3266
3266
|
/***/ }),
|
|
3267
3267
|
|
|
3268
|
+
/***/ "./src/assetService.ts":
|
|
3269
|
+
/*!*****************************!*\
|
|
3270
|
+
!*** ./src/assetService.ts ***!
|
|
3271
|
+
\*****************************/
|
|
3272
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3273
|
+
|
|
3274
|
+
"use strict";
|
|
3275
|
+
|
|
3276
|
+
|
|
3277
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
3278
|
+
value: true
|
|
3279
|
+
}));
|
|
3280
|
+
exports.uploadPackage = exports.startSession = exports.closeSession = void 0;
|
|
3281
|
+
|
|
3282
|
+
__webpack_require__(/*! core-js/modules/es.promise.js */ "../../node_modules/core-js/modules/es.promise.js");
|
|
3283
|
+
|
|
3284
|
+
var _axios = _interopRequireDefault(__webpack_require__(/*! axios */ "axios"));
|
|
3285
|
+
|
|
3286
|
+
var fs = _interopRequireWildcard(__webpack_require__(/*! fs */ "fs"));
|
|
3287
|
+
|
|
3288
|
+
const _excluded = ["url", "authentication"];
|
|
3289
|
+
|
|
3290
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
3291
|
+
|
|
3292
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
3293
|
+
|
|
3294
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3295
|
+
|
|
3296
|
+
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; }
|
|
3297
|
+
|
|
3298
|
+
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; }
|
|
3299
|
+
|
|
3300
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3301
|
+
|
|
3302
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3303
|
+
|
|
3304
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
3305
|
+
|
|
3306
|
+
/**
|
|
3307
|
+
* Starts an asset service session and returns the sessionId
|
|
3308
|
+
*
|
|
3309
|
+
* @param {SessionStartParams} params
|
|
3310
|
+
* @returns
|
|
3311
|
+
*/
|
|
3312
|
+
const startSession = async _ref => {
|
|
3313
|
+
let {
|
|
3314
|
+
url,
|
|
3315
|
+
authentication
|
|
3316
|
+
} = _ref,
|
|
3317
|
+
params = _objectWithoutProperties(_ref, _excluded);
|
|
3318
|
+
|
|
3319
|
+
const payload = _objectSpread(_objectSpread({}, params), {}, {
|
|
3320
|
+
user: undefined,
|
|
3321
|
+
password: undefined,
|
|
3322
|
+
license: undefined
|
|
3323
|
+
});
|
|
3324
|
+
|
|
3325
|
+
if (authentication.type === "credentials") {
|
|
3326
|
+
payload.user = authentication.username;
|
|
3327
|
+
payload.password = authentication.password;
|
|
3328
|
+
} else if (authentication.type === "license") {
|
|
3329
|
+
payload.license = authentication.license;
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
const {
|
|
3333
|
+
data: {
|
|
3334
|
+
session: sessionId,
|
|
3335
|
+
state
|
|
3336
|
+
}
|
|
3337
|
+
} = await _axios.default.post(`Session/Start2`, JSON.stringify(payload), {
|
|
3338
|
+
baseURL: url
|
|
3339
|
+
});
|
|
3340
|
+
|
|
3341
|
+
if (state !== "SUCCESS") {
|
|
3342
|
+
throw new Error(`Could not start session: Asset server responded with ${state}`);
|
|
3343
|
+
}
|
|
3344
|
+
|
|
3345
|
+
return sessionId;
|
|
3346
|
+
};
|
|
3347
|
+
|
|
3348
|
+
exports.startSession = startSession;
|
|
3349
|
+
|
|
3350
|
+
const closeSession = async (url, sessionId) => {
|
|
3351
|
+
await _axios.default.get(`Session/Close/${sessionId}`, {
|
|
3352
|
+
baseURL: url
|
|
3353
|
+
});
|
|
3354
|
+
};
|
|
3355
|
+
|
|
3356
|
+
exports.closeSession = closeSession;
|
|
3357
|
+
|
|
3358
|
+
const uploadPackage = async (url, sessionId, packageName, zipFilePath) => {
|
|
3359
|
+
try {
|
|
3360
|
+
await uploadPackageToUrl(url, `UploadPackage/${sessionId}/${packageName}`, zipFilePath);
|
|
3361
|
+
} catch (err) {
|
|
3362
|
+
await uploadPackageToUrl(url, `UploadPackage/${sessionId}/${packageName}/`, zipFilePath);
|
|
3363
|
+
}
|
|
3364
|
+
};
|
|
3365
|
+
|
|
3366
|
+
exports.uploadPackage = uploadPackage;
|
|
3367
|
+
|
|
3368
|
+
const uploadPackageToUrl = (url, path, zipFilePath) => _axios.default.post(path, fs.createReadStream(zipFilePath), {
|
|
3369
|
+
baseURL: url
|
|
3370
|
+
}).then(({
|
|
3371
|
+
data,
|
|
3372
|
+
status
|
|
3373
|
+
}) => {
|
|
3374
|
+
let objectBody;
|
|
3375
|
+
|
|
3376
|
+
if (typeof data === "string") {
|
|
3377
|
+
try {
|
|
3378
|
+
objectBody = JSON.parse(data);
|
|
3379
|
+
} catch (err) {}
|
|
3380
|
+
} else if (typeof data === "object") {
|
|
3381
|
+
objectBody = data;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
if (objectBody !== undefined) {
|
|
3385
|
+
if ("state" in objectBody && objectBody.state !== "SUCCESS") {
|
|
3386
|
+
var _objectBody$response;
|
|
3387
|
+
|
|
3388
|
+
throw new Error((_objectBody$response = objectBody.response) !== null && _objectBody$response !== void 0 ? _objectBody$response : objectBody.state);
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
if (status >= 400) {
|
|
3393
|
+
if (objectBody !== undefined) {
|
|
3394
|
+
let text = "";
|
|
3395
|
+
|
|
3396
|
+
for (const key in objectBody) {
|
|
3397
|
+
text += key + ": \n";
|
|
3398
|
+
|
|
3399
|
+
if (typeof objectBody[key] === "object") {
|
|
3400
|
+
text += JSON.stringify(objectBody[key], undefined, 2);
|
|
3401
|
+
} else {
|
|
3402
|
+
text += objectBody[key];
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3405
|
+
text += "\n\n";
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3408
|
+
throw new Error(text);
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
throw new Error(data);
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
return data;
|
|
3415
|
+
});
|
|
3416
|
+
|
|
3417
|
+
/***/ }),
|
|
3418
|
+
|
|
3268
3419
|
/***/ "./src/commands/build.ts":
|
|
3269
3420
|
/*!*******************************!*\
|
|
3270
3421
|
!*** ./src/commands/build.ts ***!
|
|
@@ -3545,8 +3696,7 @@ const releaseFolder = async (folderPath, options) => {
|
|
|
3545
3696
|
cwd: options.cwd,
|
|
3546
3697
|
upload: !options.noUpload,
|
|
3547
3698
|
service: options.service,
|
|
3548
|
-
|
|
3549
|
-
password: options.password,
|
|
3699
|
+
authentication: options.authentication,
|
|
3550
3700
|
folderPath,
|
|
3551
3701
|
pushOnly: options.pushOnly
|
|
3552
3702
|
});
|
|
@@ -3720,14 +3870,19 @@ var glob = _interopRequireWildcard(__webpack_require__(/*! glob */ "glob"));
|
|
|
3720
3870
|
|
|
3721
3871
|
var _typescript = __webpack_require__(/*! typescript */ "typescript");
|
|
3722
3872
|
|
|
3873
|
+
var path = _interopRequireWildcard(__webpack_require__(/*! path */ "path"));
|
|
3874
|
+
|
|
3723
3875
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
3724
3876
|
|
|
3725
3877
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
3726
3878
|
|
|
3727
3879
|
const generateDocs = async (folderPath, declarationFile, outFolder, name) => {
|
|
3728
3880
|
const app = new typedoc.Application();
|
|
3881
|
+
const mediaDir = path.join(folderPath, "Media");
|
|
3729
3882
|
app.bootstrap({
|
|
3730
|
-
entryPoints: [declarationFile]
|
|
3883
|
+
entryPoints: [declarationFile],
|
|
3884
|
+
media: mediaDir,
|
|
3885
|
+
out: outFolder
|
|
3731
3886
|
});
|
|
3732
3887
|
app.options.setCompilerOptions([declarationFile], {
|
|
3733
3888
|
target: _typescript.ScriptTarget.ES5
|
|
@@ -3830,6 +3985,8 @@ var _igTools = __webpack_require__(/*! @intelligentgraphics/ig.tools.core */ "..
|
|
|
3830
3985
|
|
|
3831
3986
|
var _util2 = __webpack_require__(/*! ./util */ "./src/util.ts");
|
|
3832
3987
|
|
|
3988
|
+
var AssetService = _interopRequireWildcard(__webpack_require__(/*! ./assetService */ "./src/assetService.ts"));
|
|
3989
|
+
|
|
3833
3990
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3834
3991
|
|
|
3835
3992
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -3847,21 +4004,14 @@ const PLUGIN_ID = "0feba3a0-b6d1-11e6-9598-0800200c9a66";
|
|
|
3847
4004
|
const PACKAGE_FILE = "_Package.json";
|
|
3848
4005
|
const INDEX_FILE = "_Index.json";
|
|
3849
4006
|
const ANIMATION_FILE = ".animation.json";
|
|
3850
|
-
var Mode;
|
|
3851
|
-
|
|
3852
|
-
(function (Mode) {
|
|
3853
|
-
Mode[Mode["Standard"] = 0] = "Standard";
|
|
3854
|
-
Mode[Mode["IG_GFX"] = 1] = "IG_GFX";
|
|
3855
|
-
})(Mode || (Mode = {}));
|
|
3856
|
-
|
|
3857
4007
|
let validateSchema;
|
|
3858
4008
|
const runtimeScripts = ["Interactor", "Core", "Mixed"];
|
|
3859
4009
|
const notRuntimeScripts = ["Context", "Evaluator"];
|
|
3860
4010
|
|
|
3861
4011
|
const executePackager = async options => {
|
|
3862
|
-
const logStep = step => (0, _util2.logPackageMessage)(
|
|
4012
|
+
const logStep = step => (0, _util2.logPackageMessage)(options.data.Package, step);
|
|
3863
4013
|
|
|
3864
|
-
const packageName = `${options.
|
|
4014
|
+
const packageName = `${options.data.Package}_${options.version}`;
|
|
3865
4015
|
const binDir = path.join(options.cwd, "bin");
|
|
3866
4016
|
fs.ensureDirSync(binDir);
|
|
3867
4017
|
const zipFilePath = path.join(binDir, packageName + ".zip");
|
|
@@ -3884,7 +4034,8 @@ const buildArchive = async ({
|
|
|
3884
4034
|
domain,
|
|
3885
4035
|
subdomain,
|
|
3886
4036
|
cwd,
|
|
3887
|
-
folderPath
|
|
4037
|
+
folderPath,
|
|
4038
|
+
data
|
|
3888
4039
|
}, zipFilePath, logStep) => {
|
|
3889
4040
|
if (validateSchema === undefined) {
|
|
3890
4041
|
validateSchema = await _axios.default.get("https://archive.intelligentgraphics.biz/schemas/gfx/animation.json").then(({
|
|
@@ -3898,41 +4049,14 @@ const buildArchive = async ({
|
|
|
3898
4049
|
}).compile(data));
|
|
3899
4050
|
}
|
|
3900
4051
|
|
|
3901
|
-
let mode = Mode.Standard;
|
|
3902
|
-
|
|
3903
|
-
if (domain === "IG") {
|
|
3904
|
-
switch (subdomain) {
|
|
3905
|
-
case "GFX.Standard":
|
|
3906
|
-
case "GFX.Furniture":
|
|
3907
|
-
mode = Mode.IG_GFX;
|
|
3908
|
-
console.log("Special Mode: IG.GFX");
|
|
3909
|
-
break;
|
|
3910
|
-
}
|
|
3911
|
-
}
|
|
3912
|
-
|
|
3913
4052
|
const scriptDirectories = [];
|
|
3914
4053
|
let primaryScriptDir;
|
|
3915
4054
|
const libFilePath = path.join(cwd, "bin", `${domain}.${subdomain}.min.js`);
|
|
3916
4055
|
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
if (dir === "Standard") {
|
|
3923
|
-
scriptDirectories.push(path.join(cwd, "src", dir, "images"));
|
|
3924
|
-
}
|
|
3925
|
-
|
|
3926
|
-
break;
|
|
3927
|
-
|
|
3928
|
-
default:
|
|
3929
|
-
if (fs.existsSync(path.join(folderPath, "Scripts"))) {
|
|
3930
|
-
scriptDirectories.push(path.join(folderPath, "Scripts"));
|
|
3931
|
-
} else {
|
|
3932
|
-
scriptDirectories.push(folderPath);
|
|
3933
|
-
}
|
|
3934
|
-
|
|
3935
|
-
break;
|
|
4056
|
+
if (fs.existsSync(path.join(folderPath, "Scripts"))) {
|
|
4057
|
+
scriptDirectories.push(path.join(folderPath, "Scripts"));
|
|
4058
|
+
} else {
|
|
4059
|
+
scriptDirectories.push(folderPath);
|
|
3936
4060
|
}
|
|
3937
4061
|
|
|
3938
4062
|
try {
|
|
@@ -3942,6 +4066,11 @@ const buildArchive = async ({
|
|
|
3942
4066
|
throw new Error(`Expected scripts directory "${scriptDirectories[0]}" to exist`);
|
|
3943
4067
|
}
|
|
3944
4068
|
|
|
4069
|
+
if (subdomain === "GFX.Standard") {
|
|
4070
|
+
logStep(`Including Images folder`);
|
|
4071
|
+
scriptDirectories.push(path.join(folderPath, "Images"));
|
|
4072
|
+
}
|
|
4073
|
+
|
|
3945
4074
|
const manifest = _igTools.FileUtil.readJsonFile(path.join(primaryScriptDir, PACKAGE_FILE));
|
|
3946
4075
|
|
|
3947
4076
|
if (manifest !== undefined) {
|
|
@@ -3972,9 +4101,26 @@ const buildArchive = async ({
|
|
|
3972
4101
|
continue;
|
|
3973
4102
|
}
|
|
3974
4103
|
|
|
3975
|
-
const
|
|
4104
|
+
const scriptFilePath = path.join(primaryScriptDir, scriptFile);
|
|
4105
|
+
|
|
4106
|
+
const content = _igTools.FileUtil.readFile(scriptFilePath);
|
|
4107
|
+
|
|
4108
|
+
let data;
|
|
4109
|
+
|
|
4110
|
+
try {
|
|
4111
|
+
data = JSON.parse(content);
|
|
4112
|
+
} catch (err) {
|
|
4113
|
+
const relativePath = path.relative(cwd, scriptFilePath);
|
|
4114
|
+
|
|
4115
|
+
if (err instanceof SyntaxError) {
|
|
4116
|
+
throw new Error(`Encountered invalid syntax in file "${relativePath}": ${String(err)}`);
|
|
4117
|
+
}
|
|
4118
|
+
|
|
4119
|
+
throw new Error(`Encountered an unexpected error while parsing animation json file at path "${relativePath}"`, {
|
|
4120
|
+
cause: err
|
|
4121
|
+
});
|
|
4122
|
+
}
|
|
3976
4123
|
|
|
3977
|
-
const data = JSON.parse(content);
|
|
3978
4124
|
validateSchema(data);
|
|
3979
4125
|
animations.set(data.Id, JSON.stringify(data));
|
|
3980
4126
|
}
|
|
@@ -4005,22 +4151,19 @@ Packaging without a javascript file is only allowed when animation json files ar
|
|
|
4005
4151
|
* Copyright (C) ${date.getFullYear()} intelligentgraphics. All Rights Reserved. */`;
|
|
4006
4152
|
}
|
|
4007
4153
|
|
|
4008
|
-
if (!library.includes(`${domain}.${subdomain}`)) {
|
|
4009
|
-
library += `
|
|
4010
|
-
var ${domain};
|
|
4011
|
-
(function (${domain}) {
|
|
4012
|
-
var ${subdomain};
|
|
4013
|
-
(function (${subdomain}) {
|
|
4014
|
-
})(${subdomain} = ${domain}.${subdomain} || (${domain}.${subdomain} = {}));
|
|
4015
|
-
})(${domain} || (${domain} = {}));
|
|
4016
|
-
`;
|
|
4017
|
-
}
|
|
4018
|
-
|
|
4019
4154
|
if (animations.size > 0) {
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4155
|
+
const [scriptDomain, scriptSubdomain] = data.Scope.split(".");
|
|
4156
|
+
const scope = `${scriptDomain}.${scriptSubdomain}`;
|
|
4157
|
+
|
|
4158
|
+
if (!library.includes(scope)) {
|
|
4159
|
+
library += `
|
|
4160
|
+
var ${scriptDomain};
|
|
4161
|
+
(function (${scriptDomain}) {
|
|
4162
|
+
var ${scriptSubdomain};
|
|
4163
|
+
(function (${scriptSubdomain}) {
|
|
4164
|
+
})(${scriptSubdomain} = ${scriptDomain}.${scriptSubdomain} || (${scriptDomain}.${scriptSubdomain} = {}));
|
|
4165
|
+
})(${scriptDomain} || (${scriptDomain} = {}));
|
|
4166
|
+
`;
|
|
4024
4167
|
}
|
|
4025
4168
|
|
|
4026
4169
|
for (const [name, data] of animations) {
|
|
@@ -4032,7 +4175,7 @@ Packaging without a javascript file is only allowed when animation json files ar
|
|
|
4032
4175
|
const minifyResult = terser.minify(library, {
|
|
4033
4176
|
ecma: 5
|
|
4034
4177
|
});
|
|
4035
|
-
archive.file(`${
|
|
4178
|
+
archive.file(`${data.Package}.js`, minifyResult.code);
|
|
4036
4179
|
|
|
4037
4180
|
for (const directory of scriptDirectories) {
|
|
4038
4181
|
try {
|
|
@@ -4078,8 +4221,7 @@ const uploadArchive = async ({
|
|
|
4078
4221
|
version,
|
|
4079
4222
|
service,
|
|
4080
4223
|
upload,
|
|
4081
|
-
|
|
4082
|
-
password
|
|
4224
|
+
authentication
|
|
4083
4225
|
}, zipFilePath, packageName, logStep) => {
|
|
4084
4226
|
const resolvedTargetDomain = targetDomain && targetDomain !== domain ? targetDomain : domain;
|
|
4085
4227
|
const resolvedTargetSubdomain = targetSubdomain && targetSubdomain !== subdomain ? targetSubdomain : subdomain;
|
|
@@ -4091,88 +4233,22 @@ const uploadArchive = async ({
|
|
|
4091
4233
|
return;
|
|
4092
4234
|
}
|
|
4093
4235
|
|
|
4094
|
-
|
|
4236
|
+
if (!authentication) {
|
|
4237
|
+
throw new Error(`Expected authentication to be available`);
|
|
4238
|
+
}
|
|
4239
|
+
|
|
4240
|
+
logStep(`Opening connection to asset server`);
|
|
4241
|
+
const sessionId = await AssetService.startSession({
|
|
4242
|
+
url: service,
|
|
4095
4243
|
plugin: PLUGIN_ID,
|
|
4096
4244
|
address: resolvedAddress,
|
|
4097
4245
|
domain: resolvedTargetDomain,
|
|
4098
4246
|
subDomain: resolvedTargetSubdomain,
|
|
4099
|
-
|
|
4100
|
-
password
|
|
4101
|
-
};
|
|
4102
|
-
logStep(`Opening connection to bridge server`);
|
|
4103
|
-
const {
|
|
4104
|
-
data: {
|
|
4105
|
-
session: sessionId,
|
|
4106
|
-
state
|
|
4107
|
-
}
|
|
4108
|
-
} = await _axios.default.post(`Session/Start2`, JSON.stringify(startPayload), {
|
|
4109
|
-
baseURL: service
|
|
4110
|
-
});
|
|
4111
|
-
|
|
4112
|
-
if (state !== "SUCCESS") {
|
|
4113
|
-
throw new Error(`Could not start session: Bridge server responded with ${state}`);
|
|
4114
|
-
}
|
|
4115
|
-
|
|
4116
|
-
const uploadPackage = relativePath => _axios.default.post(relativePath, fs.readFileSync(zipFilePath), {
|
|
4117
|
-
baseURL: service
|
|
4118
|
-
}).then(({
|
|
4119
|
-
data,
|
|
4120
|
-
status
|
|
4121
|
-
}) => {
|
|
4122
|
-
let objectBody;
|
|
4123
|
-
|
|
4124
|
-
if (typeof data === "string") {
|
|
4125
|
-
try {
|
|
4126
|
-
objectBody = JSON.parse(data);
|
|
4127
|
-
} catch (err) {}
|
|
4128
|
-
} else if (typeof data === "object") {
|
|
4129
|
-
objectBody = data;
|
|
4130
|
-
}
|
|
4131
|
-
|
|
4132
|
-
if (objectBody !== undefined) {
|
|
4133
|
-
if ("state" in objectBody && objectBody.state !== "SUCCESS") {
|
|
4134
|
-
var _objectBody$response;
|
|
4135
|
-
|
|
4136
|
-
throw new Error((_objectBody$response = objectBody.response) !== null && _objectBody$response !== void 0 ? _objectBody$response : objectBody.state);
|
|
4137
|
-
}
|
|
4138
|
-
}
|
|
4139
|
-
|
|
4140
|
-
if (status >= 400) {
|
|
4141
|
-
if (objectBody !== undefined) {
|
|
4142
|
-
let text = "";
|
|
4143
|
-
|
|
4144
|
-
for (const key in objectBody) {
|
|
4145
|
-
text += key + ": \n";
|
|
4146
|
-
|
|
4147
|
-
if (typeof objectBody[key] === "object") {
|
|
4148
|
-
text += JSON.stringify(objectBody[key], undefined, 2);
|
|
4149
|
-
} else {
|
|
4150
|
-
text += objectBody[key];
|
|
4151
|
-
}
|
|
4152
|
-
|
|
4153
|
-
text += "\n\n";
|
|
4154
|
-
}
|
|
4155
|
-
|
|
4156
|
-
throw new Error(text);
|
|
4157
|
-
}
|
|
4158
|
-
|
|
4159
|
-
throw new Error(data);
|
|
4160
|
-
}
|
|
4161
|
-
|
|
4162
|
-
return data;
|
|
4247
|
+
authentication
|
|
4163
4248
|
});
|
|
4164
|
-
|
|
4165
4249
|
logStep(`Uploading package to ${resolvedTargetDomain}.${resolvedTargetSubdomain}`);
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
await uploadPackage(`UploadPackage/${sessionId}/${packageName}`);
|
|
4169
|
-
} catch (err) {
|
|
4170
|
-
await uploadPackage(`UploadPackage/${sessionId}/${packageName}/`);
|
|
4171
|
-
}
|
|
4172
|
-
|
|
4173
|
-
await _axios.default.get(`Session/Close/${sessionId}`, {
|
|
4174
|
-
baseURL: service
|
|
4175
|
-
});
|
|
4250
|
+
await AssetService.uploadPackage(service, sessionId, packageName, zipFilePath);
|
|
4251
|
+
await AssetService.closeSession(service, sessionId);
|
|
4176
4252
|
};
|
|
4177
4253
|
|
|
4178
4254
|
/***/ }),
|
|
@@ -4860,8 +4936,10 @@ module.exports = function (O, key, value, options) {
|
|
|
4860
4936
|
if (simple) O[key] = value;
|
|
4861
4937
|
else defineGlobalProperty(key, value);
|
|
4862
4938
|
} else {
|
|
4863
|
-
|
|
4864
|
-
|
|
4939
|
+
try {
|
|
4940
|
+
if (!options.unsafe) delete O[key];
|
|
4941
|
+
else if (O[key]) simple = true;
|
|
4942
|
+
} catch (error) { /* empty */ }
|
|
4865
4943
|
if (simple) O[key] = value;
|
|
4866
4944
|
else definePropertyModule.f(O, key, {
|
|
4867
4945
|
value: value,
|
|
@@ -4943,6 +5021,18 @@ module.exports = function (it) {
|
|
|
4943
5021
|
module.exports = typeof window == 'object' && typeof Deno != 'object';
|
|
4944
5022
|
|
|
4945
5023
|
|
|
5024
|
+
/***/ }),
|
|
5025
|
+
|
|
5026
|
+
/***/ "../../node_modules/core-js/internals/engine-is-deno.js":
|
|
5027
|
+
/*!**************************************************************!*\
|
|
5028
|
+
!*** ../../node_modules/core-js/internals/engine-is-deno.js ***!
|
|
5029
|
+
\**************************************************************/
|
|
5030
|
+
/***/ ((module) => {
|
|
5031
|
+
|
|
5032
|
+
/* global Deno -- Deno case */
|
|
5033
|
+
module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
|
|
5034
|
+
|
|
5035
|
+
|
|
4946
5036
|
/***/ }),
|
|
4947
5037
|
|
|
4948
5038
|
/***/ "../../node_modules/core-js/internals/engine-is-ios-pebble.js":
|
|
@@ -5805,6 +5895,7 @@ var ResultPrototype = Result.prototype;
|
|
|
5805
5895
|
module.exports = function (iterable, unboundFunction, options) {
|
|
5806
5896
|
var that = options && options.that;
|
|
5807
5897
|
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
5898
|
+
var IS_RECORD = !!(options && options.IS_RECORD);
|
|
5808
5899
|
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
5809
5900
|
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
5810
5901
|
var fn = bind(unboundFunction, that);
|
|
@@ -5822,7 +5913,9 @@ module.exports = function (iterable, unboundFunction, options) {
|
|
|
5822
5913
|
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
5823
5914
|
};
|
|
5824
5915
|
|
|
5825
|
-
if (
|
|
5916
|
+
if (IS_RECORD) {
|
|
5917
|
+
iterator = iterable.iterator;
|
|
5918
|
+
} else if (IS_ITERATOR) {
|
|
5826
5919
|
iterator = iterable;
|
|
5827
5920
|
} else {
|
|
5828
5921
|
iterFn = getIteratorMethod(iterable);
|
|
@@ -5837,7 +5930,7 @@ module.exports = function (iterable, unboundFunction, options) {
|
|
|
5837
5930
|
iterator = getIterator(iterable, iterFn);
|
|
5838
5931
|
}
|
|
5839
5932
|
|
|
5840
|
-
next = iterator.next;
|
|
5933
|
+
next = IS_RECORD ? iterable.next : iterator.next;
|
|
5841
5934
|
while (!(step = call(next, iterator)).done) {
|
|
5842
5935
|
try {
|
|
5843
5936
|
result = callFn(step.value);
|
|
@@ -5944,7 +6037,8 @@ var makeBuiltIn = module.exports = function (value, name, options) {
|
|
|
5944
6037
|
if (options && options.getter) name = 'get ' + name;
|
|
5945
6038
|
if (options && options.setter) name = 'set ' + name;
|
|
5946
6039
|
if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
5947
|
-
defineProperty(value, 'name', { value: name, configurable: true });
|
|
6040
|
+
if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
|
|
6041
|
+
else value.name = name;
|
|
5948
6042
|
}
|
|
5949
6043
|
if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
|
|
5950
6044
|
defineProperty(value, 'length', { value: options.arity });
|
|
@@ -6457,6 +6551,7 @@ var isForced = __webpack_require__(/*! ../internals/is-forced */ "../../node_mod
|
|
|
6457
6551
|
var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "../../node_modules/core-js/internals/inspect-source.js");
|
|
6458
6552
|
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
|
|
6459
6553
|
var IS_BROWSER = __webpack_require__(/*! ../internals/engine-is-browser */ "../../node_modules/core-js/internals/engine-is-browser.js");
|
|
6554
|
+
var IS_DENO = __webpack_require__(/*! ../internals/engine-is-deno */ "../../node_modules/core-js/internals/engine-is-deno.js");
|
|
6460
6555
|
var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
|
|
6461
6556
|
var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "../../node_modules/core-js/internals/engine-v8-version.js");
|
|
6462
6557
|
|
|
@@ -6477,18 +6572,18 @@ var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
|
|
|
6477
6572
|
// We can't use @@species feature detection in V8 since it causes
|
|
6478
6573
|
// deoptimization and performance degradation
|
|
6479
6574
|
// https://github.com/zloirock/core-js/issues/679
|
|
6480
|
-
if (V8_VERSION
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6575
|
+
if (V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
|
|
6576
|
+
// Detect correctness of subclassing with @@species support
|
|
6577
|
+
var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
|
|
6578
|
+
var FakePromise = function (exec) {
|
|
6579
|
+
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
6580
|
+
};
|
|
6581
|
+
var constructor = promise.constructor = {};
|
|
6582
|
+
constructor[SPECIES] = FakePromise;
|
|
6583
|
+
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
|
|
6584
|
+
if (!SUBCLASSING) return true;
|
|
6490
6585
|
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
6491
|
-
return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
|
|
6586
|
+
} return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;
|
|
6492
6587
|
});
|
|
6493
6588
|
|
|
6494
6589
|
module.exports = {
|
|
@@ -6702,10 +6797,10 @@ var store = __webpack_require__(/*! ../internals/shared-store */ "../../node_mod
|
|
|
6702
6797
|
(module.exports = function (key, value) {
|
|
6703
6798
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
6704
6799
|
})('versions', []).push({
|
|
6705
|
-
version: '3.
|
|
6800
|
+
version: '3.24.0',
|
|
6706
6801
|
mode: IS_PURE ? 'pure' : 'global',
|
|
6707
6802
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
6708
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
6803
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.24.0/LICENSE',
|
|
6709
6804
|
source: 'https://github.com/zloirock/core-js'
|
|
6710
6805
|
});
|
|
6711
6806
|
|
|
@@ -7987,7 +8082,7 @@ module.exports = require("util");
|
|
|
7987
8082
|
/***/ ((module) => {
|
|
7988
8083
|
|
|
7989
8084
|
"use strict";
|
|
7990
|
-
module.exports = JSON.parse('{"name":"@intelligentgraphics/ig.gfx.packager","version":"2.
|
|
8085
|
+
module.exports = JSON.parse('{"name":"@intelligentgraphics/ig.gfx.packager","version":"2.2.0","description":"IG.GFX.Packager 2.2.0 (2.2.0.100)","author":"Michael Beier <mb@intelligentgraphics.biz>","main":"build/index.js","private":false,"publishConfig":{"access":"public"},"engines":{"node":">=14.0.0"},"bin":{"packager":"./build/index.js"},"files":["build","locales","scripts"],"scripts":{"dist":"webpack","clean":"rimraf build *.tsbuildinfo","prepublishOnly":"yarn clean && yarn dist","test":"jest","_postinstall":"node scripts/postinstall.js"},"dependencies":{"ajv":"^8.6.2","axios":"^0.21.1","core-js":"^3.16.0","execa":"^5.1.1","fs-extra":"^10.0.0","glob":"^7.1.4","jszip":"^3.10.0","rimraf":"^3.0.2","source-map-support":"^0.5.19","terser":"^4.8.0","typedoc":"~0.23.2","typescript":"~4.7.4","update-notifier":"^5.1.0","v8-compile-cache":"^2.1.1","y18n":"^5.0.8","yargs":"^17.0.1"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-proposal-object-rest-spread":"^7.18.9","@babel/preset-env":"^7.18.9","@intelligentgraphics/ig.tools.core":"^1.5.1","@intelligentgraphics/ig.utilities":"^1.6.6","@types/fs-extra":"^9.0.12","@types/glob":"^7.1.4","@types/node":"^16.4.11","@types/rimraf":"^3.0.1","@types/update-notifier":"^5.1.0","@types/yargs":"^17.0.2","babel-loader":"^8.1.0","ts-loader":"^9.2.5","ts-node":"^10.1.0","webpack":"^5.64.4","webpack-cli":"^4.7.2"}}');
|
|
7991
8086
|
|
|
7992
8087
|
/***/ })
|
|
7993
8088
|
|
|
@@ -8033,9 +8128,9 @@ __webpack_require__(/*! v8-compile-cache */ "v8-compile-cache");
|
|
|
8033
8128
|
|
|
8034
8129
|
var _updateNotifier = _interopRequireDefault(__webpack_require__(/*! update-notifier */ "update-notifier"));
|
|
8035
8130
|
|
|
8036
|
-
var
|
|
8131
|
+
var fs = _interopRequireWildcard(__webpack_require__(/*! fs */ "fs"));
|
|
8037
8132
|
|
|
8038
|
-
var
|
|
8133
|
+
var yargs = _interopRequireWildcard(__webpack_require__(/*! yargs */ "yargs"));
|
|
8039
8134
|
|
|
8040
8135
|
var _igTools = __webpack_require__(/*! @intelligentgraphics/ig.tools.core */ "../core/build/index.js");
|
|
8041
8136
|
|
|
@@ -8044,7 +8139,7 @@ var _localization = __webpack_require__(/*! ./localization */ "./src/localizatio
|
|
|
8044
8139
|
var _build = __webpack_require__(/*! ./commands/build */ "./src/commands/build.ts");
|
|
8045
8140
|
|
|
8046
8141
|
const _excluded = ["directories"],
|
|
8047
|
-
_excluded2 = ["directory", "user", "password", "service"];
|
|
8142
|
+
_excluded2 = ["directory", "user", "password", "service", "license"];
|
|
8048
8143
|
|
|
8049
8144
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8050
8145
|
|
|
@@ -8083,7 +8178,7 @@ const applyBuildOptions = argv => argv.options({
|
|
|
8083
8178
|
description: (0, _localization.translate)("options.outDir.description"),
|
|
8084
8179
|
type: "string",
|
|
8085
8180
|
default: "bin",
|
|
8086
|
-
coerce: input =>
|
|
8181
|
+
coerce: input => input === undefined || input === null ? undefined : _igTools.PathUtil.ensureAbsolute(input, process.cwd())
|
|
8087
8182
|
},
|
|
8088
8183
|
minimize: {
|
|
8089
8184
|
description: (0, _localization.translate)("options.minimize.description"),
|
|
@@ -8173,6 +8268,11 @@ yargs.command({
|
|
|
8173
8268
|
type: "boolean",
|
|
8174
8269
|
default: false,
|
|
8175
8270
|
description: (0, _localization.translate)("options.pushOnly.description")
|
|
8271
|
+
},
|
|
8272
|
+
license: {
|
|
8273
|
+
type: "string",
|
|
8274
|
+
description: (0, _localization.translate)("options.license.description"),
|
|
8275
|
+
default: process.env.IG_GFX_LICENSE
|
|
8176
8276
|
}
|
|
8177
8277
|
}),
|
|
8178
8278
|
handler: async _ref2 => {
|
|
@@ -8180,7 +8280,8 @@ yargs.command({
|
|
|
8180
8280
|
directory,
|
|
8181
8281
|
user,
|
|
8182
8282
|
password,
|
|
8183
|
-
service
|
|
8283
|
+
service,
|
|
8284
|
+
license
|
|
8184
8285
|
} = _ref2,
|
|
8185
8286
|
options = _objectWithoutProperties(_ref2, _excluded2);
|
|
8186
8287
|
|
|
@@ -8188,32 +8289,63 @@ yargs.command({
|
|
|
8188
8289
|
|
|
8189
8290
|
if (!options.noUpload) {
|
|
8190
8291
|
if (!service) {
|
|
8191
|
-
|
|
8292
|
+
captureError(new Error((0, _localization.translate)("options.service.demands", "IG_GFX_ASSET_SERVICE")));
|
|
8293
|
+
return;
|
|
8192
8294
|
}
|
|
8193
8295
|
|
|
8194
|
-
if (!user) {
|
|
8195
|
-
|
|
8296
|
+
if (!license && (!user || !password)) {
|
|
8297
|
+
captureError(new Error(`Expected authentication to be provided through either of the following methods:
|
|
8298
|
+
- as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable
|
|
8299
|
+
- as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`));
|
|
8300
|
+
return;
|
|
8196
8301
|
}
|
|
8197
8302
|
|
|
8198
|
-
if (!
|
|
8199
|
-
|
|
8303
|
+
if (license && !license.endsWith(".iglic")) {
|
|
8304
|
+
captureError(new Error(`Expected the license path to end with the extension .iglic`));
|
|
8305
|
+
return;
|
|
8200
8306
|
}
|
|
8307
|
+
}
|
|
8308
|
+
|
|
8309
|
+
let authentication;
|
|
8201
8310
|
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8311
|
+
if (license) {
|
|
8312
|
+
const fullLicensePath = _igTools.PathUtil.ensureAbsolute(license, process.cwd());
|
|
8313
|
+
|
|
8314
|
+
try {
|
|
8315
|
+
const content = fs.readFileSync(fullLicensePath);
|
|
8316
|
+
authentication = {
|
|
8317
|
+
type: "license",
|
|
8318
|
+
license: content.toString("base64")
|
|
8319
|
+
};
|
|
8320
|
+
} catch (err) {
|
|
8321
|
+
if ((err === null || err === void 0 ? void 0 : err.code) === "ENOENT") {
|
|
8322
|
+
captureError(new Error(`Expected to find a license file at path: ${fullLicensePath}`));
|
|
8323
|
+
return;
|
|
8324
|
+
}
|
|
8325
|
+
|
|
8326
|
+
captureError(new Error(`Failed to read license file at path: ${fullLicensePath}`));
|
|
8327
|
+
return;
|
|
8205
8328
|
}
|
|
8329
|
+
} else if (user && password) {
|
|
8330
|
+
console.log(`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`);
|
|
8331
|
+
authentication = {
|
|
8332
|
+
type: "credentials",
|
|
8333
|
+
username: user,
|
|
8334
|
+
password
|
|
8335
|
+
};
|
|
8206
8336
|
}
|
|
8207
8337
|
|
|
8208
8338
|
const {
|
|
8209
8339
|
releaseFolders
|
|
8210
8340
|
} = await Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! ./commands/release */ "./src/commands/release.ts")));
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8341
|
+
|
|
8342
|
+
const fullOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
8343
|
+
authentication,
|
|
8214
8344
|
service: service,
|
|
8215
8345
|
directories: [directory]
|
|
8216
|
-
})
|
|
8346
|
+
});
|
|
8347
|
+
|
|
8348
|
+
releaseFolders(fullOptions).catch(captureError);
|
|
8217
8349
|
}
|
|
8218
8350
|
});
|
|
8219
8351
|
yargs.demandCommand().pkgConf("packager").showHelpOnFail(false).version().argv;
|