@sap/ux-ui5-tooling 1.15.6 → 1.16.2
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/CHANGELOG.md +5 -0
- package/README.md +2 -2
- package/dist/cli/index.js +65642 -67943
- package/dist/markdowns/add/add.en.md +0 -1
- package/dist/markdowns/deploy/deploy.en.md +28 -28
- package/dist/middlewares/fiori-tools-appreload.js +529 -586
- package/dist/middlewares/fiori-tools-preview.js +40487 -46465
- package/dist/middlewares/fiori-tools-proxy.js +23713 -30617
- package/dist/tasks/cf-deploy/index.js +19419 -25398
- package/dist/tasks/deploy/index.js +32030 -34331
- package/package.json +20 -21
|
@@ -39452,9 +39452,9 @@ var require_esprima = __commonJS({
|
|
|
39452
39452
|
}
|
|
39453
39453
|
});
|
|
39454
39454
|
|
|
39455
|
-
// ../../node_modules/core-util-is/lib/util.js
|
|
39455
|
+
// ../../node_modules/@sap/cf-tools/node_modules/core-util-is/lib/util.js
|
|
39456
39456
|
var require_util2 = __commonJS({
|
|
39457
|
-
"../../node_modules/core-util-is/lib/util.js"(exports2) {
|
|
39457
|
+
"../../node_modules/@sap/cf-tools/node_modules/core-util-is/lib/util.js"(exports2) {
|
|
39458
39458
|
function isArray(arg) {
|
|
39459
39459
|
if (Array.isArray) {
|
|
39460
39460
|
return Array.isArray(arg);
|
|
@@ -39515,7 +39515,7 @@ var require_util2 = __commonJS({
|
|
|
39515
39515
|
typeof arg === "undefined";
|
|
39516
39516
|
}
|
|
39517
39517
|
exports2.isPrimitive = isPrimitive;
|
|
39518
|
-
exports2.isBuffer = Buffer.isBuffer;
|
|
39518
|
+
exports2.isBuffer = require("buffer").Buffer.isBuffer;
|
|
39519
39519
|
function objectToString(o) {
|
|
39520
39520
|
return Object.prototype.toString.call(o);
|
|
39521
39521
|
}
|
|
@@ -40246,11 +40246,16 @@ var require_has_own_prop = __commonJS({
|
|
|
40246
40246
|
}
|
|
40247
40247
|
});
|
|
40248
40248
|
|
|
40249
|
-
// ../../node_modules/comment-json/src/common.js
|
|
40249
|
+
// ../../node_modules/@sap/cf-tools/node_modules/comment-json/src/common.js
|
|
40250
40250
|
var require_common4 = __commonJS({
|
|
40251
|
-
"../../node_modules/comment-json/src/common.js"(exports2, module2) {
|
|
40251
|
+
"../../node_modules/@sap/cf-tools/node_modules/comment-json/src/common.js"(exports2, module2) {
|
|
40252
40252
|
var hasOwnProperty = require_has_own_prop();
|
|
40253
|
-
var {
|
|
40253
|
+
var {
|
|
40254
|
+
isObject,
|
|
40255
|
+
isArray,
|
|
40256
|
+
isString,
|
|
40257
|
+
isNumber
|
|
40258
|
+
} = require_util2();
|
|
40254
40259
|
var PREFIX_BEFORE = "before";
|
|
40255
40260
|
var PREFIX_AFTER_PROP = "after-prop";
|
|
40256
40261
|
var PREFIX_AFTER_COLON = "after-colon";
|
|
@@ -40334,6 +40339,9 @@ var require_common4 = __commonJS({
|
|
|
40334
40339
|
};
|
|
40335
40340
|
var assign2 = (target, source, keys) => {
|
|
40336
40341
|
keys.forEach((key) => {
|
|
40342
|
+
if (!isString(key) && !isNumber(key)) {
|
|
40343
|
+
return;
|
|
40344
|
+
}
|
|
40337
40345
|
if (!hasOwnProperty(source, key)) {
|
|
40338
40346
|
return;
|
|
40339
40347
|
}
|
|
@@ -40386,9 +40394,9 @@ var require_common4 = __commonJS({
|
|
|
40386
40394
|
}
|
|
40387
40395
|
});
|
|
40388
40396
|
|
|
40389
|
-
// ../../node_modules/comment-json/src/array.js
|
|
40397
|
+
// ../../node_modules/@sap/cf-tools/node_modules/comment-json/src/array.js
|
|
40390
40398
|
var require_array = __commonJS({
|
|
40391
|
-
"../../node_modules/comment-json/src/array.js"(exports2, module2) {
|
|
40399
|
+
"../../node_modules/@sap/cf-tools/node_modules/comment-json/src/array.js"(exports2, module2) {
|
|
40392
40400
|
var { isArray } = require_util2();
|
|
40393
40401
|
var { sort } = require_src3();
|
|
40394
40402
|
var {
|
|
@@ -40517,6 +40525,7 @@ var require_array = __commonJS({
|
|
|
40517
40525
|
if (!items.length) {
|
|
40518
40526
|
return ret;
|
|
40519
40527
|
}
|
|
40528
|
+
move_comments(ret, this, 0, this.length, 0);
|
|
40520
40529
|
items.forEach((item) => {
|
|
40521
40530
|
const prev = length;
|
|
40522
40531
|
length += isArray(item) ? item.length : 1;
|
|
@@ -40544,6 +40553,7 @@ var require_array = __commonJS({
|
|
|
40544
40553
|
map2[index2] = real_source_index;
|
|
40545
40554
|
swap_comments(this, index2, real_source_index);
|
|
40546
40555
|
});
|
|
40556
|
+
return this;
|
|
40547
40557
|
}
|
|
40548
40558
|
};
|
|
40549
40559
|
module2.exports = {
|
|
@@ -40552,9 +40562,9 @@ var require_array = __commonJS({
|
|
|
40552
40562
|
}
|
|
40553
40563
|
});
|
|
40554
40564
|
|
|
40555
|
-
// ../../node_modules/comment-json/src/parse.js
|
|
40565
|
+
// ../../node_modules/@sap/cf-tools/node_modules/comment-json/src/parse.js
|
|
40556
40566
|
var require_parse = __commonJS({
|
|
40557
|
-
"../../node_modules/comment-json/src/parse.js"(exports2, module2) {
|
|
40567
|
+
"../../node_modules/@sap/cf-tools/node_modules/comment-json/src/parse.js"(exports2, module2) {
|
|
40558
40568
|
var esprima = require_esprima();
|
|
40559
40569
|
var {
|
|
40560
40570
|
CommentArray
|
|
@@ -40886,9 +40896,9 @@ var require_repeat_string = __commonJS({
|
|
|
40886
40896
|
}
|
|
40887
40897
|
});
|
|
40888
40898
|
|
|
40889
|
-
// ../../node_modules/comment-json/src/stringify.js
|
|
40899
|
+
// ../../node_modules/@sap/cf-tools/node_modules/comment-json/src/stringify.js
|
|
40890
40900
|
var require_stringify = __commonJS({
|
|
40891
|
-
"../../node_modules/comment-json/src/stringify.js"(exports2, module2) {
|
|
40901
|
+
"../../node_modules/@sap/cf-tools/node_modules/comment-json/src/stringify.js"(exports2, module2) {
|
|
40892
40902
|
var {
|
|
40893
40903
|
isArray,
|
|
40894
40904
|
isObject,
|
|
@@ -41088,9 +41098,9 @@ var require_stringify = __commonJS({
|
|
|
41088
41098
|
}
|
|
41089
41099
|
});
|
|
41090
41100
|
|
|
41091
|
-
// ../../node_modules/comment-json/src/index.js
|
|
41101
|
+
// ../../node_modules/@sap/cf-tools/node_modules/comment-json/src/index.js
|
|
41092
41102
|
var require_src4 = __commonJS({
|
|
41093
|
-
"../../node_modules/comment-json/src/index.js"(exports2, module2) {
|
|
41103
|
+
"../../node_modules/@sap/cf-tools/node_modules/comment-json/src/index.js"(exports2, module2) {
|
|
41094
41104
|
var { parse: parse2, tokenize } = require_parse();
|
|
41095
41105
|
var stringify = require_stringify();
|
|
41096
41106
|
var { CommentArray } = require_array();
|
|
@@ -46597,9 +46607,12 @@ var require_cli3 = __commonJS({
|
|
|
46597
46607
|
var types_1 = require_types2();
|
|
46598
46608
|
var Cli = class _Cli {
|
|
46599
46609
|
static execute(args, options, token2) {
|
|
46600
|
-
token2 = token2 || {
|
|
46601
|
-
|
|
46602
|
-
|
|
46610
|
+
token2 = token2 || {
|
|
46611
|
+
isCancellationRequested: false,
|
|
46612
|
+
onCancellationRequested: () => {
|
|
46613
|
+
return;
|
|
46614
|
+
}
|
|
46615
|
+
};
|
|
46603
46616
|
_Cli.updateSpawnOptions(options);
|
|
46604
46617
|
return new Promise((resolve2) => {
|
|
46605
46618
|
let stderr = "";
|
|
@@ -46621,7 +46634,7 @@ var require_cli3 = __commonJS({
|
|
|
46621
46634
|
});
|
|
46622
46635
|
childProcess.on("error", (err) => {
|
|
46623
46636
|
const message = _23.get(err, "code") === "ENOENT" ? `${_Cli.CF_CMD}: command not found` : _23.get(err, "message");
|
|
46624
|
-
resolve2({
|
|
46637
|
+
resolve2({ stdout, stderr, error: message, exitCode: types_1.CF_CMD_EXIT_CODE.ERROR });
|
|
46625
46638
|
});
|
|
46626
46639
|
token2.onCancellationRequested(() => {
|
|
46627
46640
|
childProcess.kill();
|
|
@@ -46635,26 +46648,26 @@ var require_cli3 = __commonJS({
|
|
|
46635
46648
|
try {
|
|
46636
46649
|
const cfErr = (0, comment_json_1.parse)(stdout);
|
|
46637
46650
|
const message = _23.get(cfErr, "code") === 10002 ? _Cli.CF_LOGIN_ERROR : _23.get(cfErr, "description", "Internal error occured");
|
|
46638
|
-
resolve2({
|
|
46651
|
+
resolve2({ stdout, stderr, exitCode: types_1.CF_CMD_EXIT_CODE.ERROR, error: message });
|
|
46639
46652
|
return;
|
|
46640
46653
|
} catch (e) {
|
|
46641
46654
|
}
|
|
46642
46655
|
} else if (stdout.startsWith("FAILED") && stdout.indexOf("Error creating request") > 0) {
|
|
46643
|
-
resolve2({
|
|
46656
|
+
resolve2({ stdout, stderr, error: _Cli.CF_LOGIN_ERROR, exitCode: types_1.CF_CMD_EXIT_CODE.ERROR });
|
|
46644
46657
|
return;
|
|
46645
46658
|
} else if (/failed.*\bError\b:/g.test(stdout)) {
|
|
46646
46659
|
try {
|
|
46647
46660
|
(0, comment_json_1.parse)(stdout);
|
|
46648
46661
|
} catch (e) {
|
|
46649
|
-
resolve2({
|
|
46662
|
+
resolve2({ stdout, stderr, error: stdout, exitCode: types_1.CF_CMD_EXIT_CODE.ERROR });
|
|
46650
46663
|
return;
|
|
46651
46664
|
}
|
|
46652
46665
|
} else if (stdout.startsWith("FAILED") && stdout.indexOf("No API endpoint set") > 0) {
|
|
46653
|
-
resolve2({
|
|
46666
|
+
resolve2({ stdout, stderr, error: stdout, exitCode: types_1.CF_CMD_EXIT_CODE.ERROR });
|
|
46654
46667
|
return;
|
|
46655
46668
|
}
|
|
46656
46669
|
}
|
|
46657
|
-
resolve2({
|
|
46670
|
+
resolve2({ stdout, stderr, exitCode: code });
|
|
46658
46671
|
}
|
|
46659
46672
|
static updateSpawnOptions(options) {
|
|
46660
46673
|
if (options) {
|
|
@@ -46694,33 +46707,6 @@ var require_messages = __commonJS({
|
|
|
46694
46707
|
var require_utils3 = __commonJS({
|
|
46695
46708
|
"../../node_modules/@sap/cf-tools/out/src/utils.js"(exports2) {
|
|
46696
46709
|
"use strict";
|
|
46697
|
-
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
46698
|
-
function adopt(value) {
|
|
46699
|
-
return value instanceof P ? value : new P(function(resolve2) {
|
|
46700
|
-
resolve2(value);
|
|
46701
|
-
});
|
|
46702
|
-
}
|
|
46703
|
-
return new (P || (P = Promise))(function(resolve2, reject2) {
|
|
46704
|
-
function fulfilled(value) {
|
|
46705
|
-
try {
|
|
46706
|
-
step(generator.next(value));
|
|
46707
|
-
} catch (e) {
|
|
46708
|
-
reject2(e);
|
|
46709
|
-
}
|
|
46710
|
-
}
|
|
46711
|
-
function rejected(value) {
|
|
46712
|
-
try {
|
|
46713
|
-
step(generator["throw"](value));
|
|
46714
|
-
} catch (e) {
|
|
46715
|
-
reject2(e);
|
|
46716
|
-
}
|
|
46717
|
-
}
|
|
46718
|
-
function step(result) {
|
|
46719
|
-
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
46720
|
-
}
|
|
46721
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46722
|
-
});
|
|
46723
|
-
};
|
|
46724
46710
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46725
46711
|
exports2.parseRawDictData = exports2.padQuerySpace = exports2.getSpaceGuidThrowIfUndefined = exports2.cfGetConfigFileField = exports2.cfGetConfigFileJson = exports2.isUpsType = exports2.cfGetConfigFilePath = exports2.getTags = exports2.getOrgGUID = exports2.getSpaceFieldGUID = exports2.getDescription = exports2.getLabel = exports2.getName = exports2.getGuid = exports2.padQuery = exports2.ensureQuery = exports2.dataContentAsObject = void 0;
|
|
46726
46712
|
var _23 = require_lodash();
|
|
@@ -46730,20 +46716,18 @@ var require_utils3 = __commonJS({
|
|
|
46730
46716
|
var comment_json_1 = require_src4();
|
|
46731
46717
|
var messages_1 = require_messages();
|
|
46732
46718
|
var types_1 = require_types2();
|
|
46733
|
-
function dataContentAsObject(filePath) {
|
|
46734
|
-
|
|
46735
|
-
|
|
46736
|
-
|
|
46737
|
-
|
|
46738
|
-
|
|
46739
|
-
|
|
46740
|
-
|
|
46741
|
-
|
|
46742
|
-
|
|
46743
|
-
|
|
46744
|
-
|
|
46745
|
-
}
|
|
46746
|
-
});
|
|
46719
|
+
async function dataContentAsObject(filePath) {
|
|
46720
|
+
try {
|
|
46721
|
+
return _23.reduce(_23.split(await fs.promises.readFile(filePath, { encoding: "utf8" }), os.EOL), (data, line) => {
|
|
46722
|
+
const parts = _23.split(line, "=");
|
|
46723
|
+
if (_23.size(parts) > 1) {
|
|
46724
|
+
data[_23.trim(parts[0])] = _23.trim(parts[1]);
|
|
46725
|
+
}
|
|
46726
|
+
return data;
|
|
46727
|
+
}, {});
|
|
46728
|
+
} catch (error2) {
|
|
46729
|
+
return {};
|
|
46730
|
+
}
|
|
46747
46731
|
}
|
|
46748
46732
|
exports2.dataContentAsObject = dataContentAsObject;
|
|
46749
46733
|
function ensureQuery(query) {
|
|
@@ -46801,40 +46785,34 @@ var require_utils3 = __commonJS({
|
|
|
46801
46785
|
return _23.get(resource, "type", types_1.eServiceTypes.managed) === types_1.eServiceTypes.user_provided;
|
|
46802
46786
|
}
|
|
46803
46787
|
exports2.isUpsType = isUpsType;
|
|
46804
|
-
function cfGetConfigFileJson(target) {
|
|
46805
|
-
|
|
46806
|
-
|
|
46807
|
-
|
|
46808
|
-
|
|
46809
|
-
}
|
|
46810
|
-
});
|
|
46788
|
+
async function cfGetConfigFileJson(target) {
|
|
46789
|
+
try {
|
|
46790
|
+
return (0, comment_json_1.parse)(await fs.promises.readFile(cfGetConfigFilePath(target), { encoding: "utf8" }));
|
|
46791
|
+
} catch (error2) {
|
|
46792
|
+
}
|
|
46811
46793
|
}
|
|
46812
46794
|
exports2.cfGetConfigFileJson = cfGetConfigFileJson;
|
|
46813
|
-
function cfGetConfigFileField(field, target) {
|
|
46814
|
-
return
|
|
46815
|
-
return _23.get(yield cfGetConfigFileJson(target), `${field}`);
|
|
46816
|
-
});
|
|
46795
|
+
async function cfGetConfigFileField(field, target) {
|
|
46796
|
+
return _23.get(await cfGetConfigFileJson(target), `${field}`);
|
|
46817
46797
|
}
|
|
46818
46798
|
exports2.cfGetConfigFileField = cfGetConfigFileField;
|
|
46819
|
-
function getSpaceGuidThrowIfUndefined() {
|
|
46820
|
-
|
|
46821
|
-
|
|
46822
|
-
|
|
46823
|
-
|
|
46824
|
-
|
|
46825
|
-
return space;
|
|
46826
|
-
});
|
|
46799
|
+
async function getSpaceGuidThrowIfUndefined() {
|
|
46800
|
+
const space = getSpaceFieldGUID(await cfGetConfigFileField("SpaceFields"));
|
|
46801
|
+
if (!space) {
|
|
46802
|
+
throw new Error(messages_1.messages.cf_setting_not_set);
|
|
46803
|
+
}
|
|
46804
|
+
return space;
|
|
46827
46805
|
}
|
|
46828
46806
|
exports2.getSpaceGuidThrowIfUndefined = getSpaceGuidThrowIfUndefined;
|
|
46829
|
-
function padQuerySpace(query, otherFilters) {
|
|
46830
|
-
|
|
46831
|
-
|
|
46832
|
-
|
|
46833
|
-
|
|
46834
|
-
|
|
46835
|
-
|
|
46836
|
-
|
|
46837
|
-
|
|
46807
|
+
async function padQuerySpace(query, otherFilters) {
|
|
46808
|
+
query = padQuery(query, otherFilters);
|
|
46809
|
+
const filter2 = _23.find(query.filters, ["key", types_1.eFilters.space_guids]);
|
|
46810
|
+
if (!_23.size(filter2 === null || filter2 === void 0 ? void 0 : filter2.value)) {
|
|
46811
|
+
query.filters = _23.concat(query.filters, [
|
|
46812
|
+
{ key: types_1.eFilters.space_guids, value: await getSpaceGuidThrowIfUndefined() }
|
|
46813
|
+
]);
|
|
46814
|
+
}
|
|
46815
|
+
return query;
|
|
46838
46816
|
}
|
|
46839
46817
|
exports2.padQuerySpace = padQuerySpace;
|
|
46840
46818
|
function parseRawDictData(data) {
|
|
@@ -46858,33 +46836,6 @@ var require_utils3 = __commonJS({
|
|
|
46858
46836
|
var require_cf_local = __commonJS({
|
|
46859
46837
|
"../../node_modules/@sap/cf-tools/out/src/cf-local.js"(exports2) {
|
|
46860
46838
|
"use strict";
|
|
46861
|
-
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
46862
|
-
function adopt(value) {
|
|
46863
|
-
return value instanceof P ? value : new P(function(resolve2) {
|
|
46864
|
-
resolve2(value);
|
|
46865
|
-
});
|
|
46866
|
-
}
|
|
46867
|
-
return new (P || (P = Promise))(function(resolve2, reject2) {
|
|
46868
|
-
function fulfilled(value) {
|
|
46869
|
-
try {
|
|
46870
|
-
step(generator.next(value));
|
|
46871
|
-
} catch (e) {
|
|
46872
|
-
reject2(e);
|
|
46873
|
-
}
|
|
46874
|
-
}
|
|
46875
|
-
function rejected(value) {
|
|
46876
|
-
try {
|
|
46877
|
-
step(generator["throw"](value));
|
|
46878
|
-
} catch (e) {
|
|
46879
|
-
reject2(e);
|
|
46880
|
-
}
|
|
46881
|
-
}
|
|
46882
|
-
function step(result) {
|
|
46883
|
-
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
46884
|
-
}
|
|
46885
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46886
|
-
});
|
|
46887
|
-
};
|
|
46888
46839
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46889
46840
|
exports2.cfApi = exports2.cfGetApps = exports2.cfGetServiceInstancesList = exports2.cfGetInstanceKeyParameters = exports2.cfGetInstanceCredentials = exports2.cfGetServiceKeys = exports2.cfLogout = exports2.cfGetServicePlans = exports2.cfGetTarget = exports2.cfGetAuthToken = exports2.cfGetInstanceMetadata = exports2.cfBindLocalUps = exports2.cfBindLocalServices = exports2.cfGetSpaceServices = exports2.cfGetServices = exports2.cfGetTargets = exports2.cfSetOrgSpace = exports2.cfGetManagedServiceInstances = exports2.cfGetServiceInstances = exports2.cfGetServicePlansList = exports2.cfGetAvailableSpaces = exports2.cfGetAvailableOrgs = exports2.cfLogin = exports2.cfCreateUpsInstance = exports2.cfCreateService = exports2.cfGetUpsInstances = exports2.clearCacheServiceInstances = exports2.resolveEndpoint = void 0;
|
|
46890
46841
|
var comment_json_1 = require_src4();
|
|
@@ -46970,22 +46921,30 @@ var require_cf_local = __commonJS({
|
|
|
46970
46921
|
};
|
|
46971
46922
|
var resourceApps = {
|
|
46972
46923
|
name: "apps",
|
|
46973
|
-
params: _23.uniq(_23.concat(baseParams, [
|
|
46924
|
+
params: _23.uniq(_23.concat(baseParams, [
|
|
46925
|
+
types_1.eFilters.names,
|
|
46926
|
+
types_1.eFilters.space_guids,
|
|
46927
|
+
types_1.eFilters.organization_guids,
|
|
46928
|
+
types_1.eFilters.guids,
|
|
46929
|
+
types_1.eFilters.include
|
|
46930
|
+
]))
|
|
46974
46931
|
};
|
|
46975
46932
|
function evaluateResponse(data) {
|
|
46976
46933
|
if (_23.size(_23.get(data, "errors"))) {
|
|
46977
|
-
throw new Error(`${_23.get(data, ["errors", "0", "detail"])} [code: ${_23.get(data, ["errors", "0", "code"])} title: ${_23.get(data, [
|
|
46934
|
+
throw new Error(`${_23.get(data, ["errors", "0", "detail"])} [code: ${_23.get(data, ["errors", "0", "code"])} title: ${_23.get(data, [
|
|
46935
|
+
"errors",
|
|
46936
|
+
"0",
|
|
46937
|
+
"title"
|
|
46938
|
+
])}]`);
|
|
46978
46939
|
}
|
|
46979
46940
|
return data;
|
|
46980
46941
|
}
|
|
46981
|
-
function resolveEndpoint(query) {
|
|
46982
|
-
|
|
46983
|
-
|
|
46984
|
-
|
|
46985
|
-
|
|
46986
|
-
|
|
46987
|
-
}
|
|
46988
|
-
});
|
|
46942
|
+
async function resolveEndpoint(query) {
|
|
46943
|
+
try {
|
|
46944
|
+
return /http/.test(new url_1.URL(query).protocol) ? _23.replace(query, (await cfGetTarget(true))["api endpoint"], "") : query;
|
|
46945
|
+
} catch (e) {
|
|
46946
|
+
return query;
|
|
46947
|
+
}
|
|
46989
46948
|
}
|
|
46990
46949
|
exports2.resolveEndpoint = resolveEndpoint;
|
|
46991
46950
|
var cacheServiceInstanceTypes = {};
|
|
@@ -47035,8 +46994,11 @@ var require_cf_local = __commonJS({
|
|
|
47035
46994
|
}
|
|
47036
46995
|
const state = _23.get(resource, "last_operation.state", ENTITY_STATE_INPROGRESS);
|
|
47037
46996
|
if (state === ENTITY_STATE_INPROGRESS) {
|
|
47038
|
-
progress.progress.report({
|
|
47039
|
-
|
|
46997
|
+
progress.progress.report({
|
|
46998
|
+
message: `
|
|
46999
|
+
${messages_1.messages.service_creation_started}`,
|
|
47000
|
+
increment: Math.floor(1 / maxNumberOfAttemps * 100)
|
|
47001
|
+
});
|
|
47040
47002
|
setTimeout(() => {
|
|
47041
47003
|
jobFunction().then((retriedResource) => {
|
|
47042
47004
|
waitForEntity(resolve2, reject2, retriedResource, attempt + 1, maxNumberOfAttemps, jobFunction, progress);
|
|
@@ -47047,7 +47009,7 @@ ${messages_1.messages.service_creation_started}`, increment: Math.floor(1 / maxN
|
|
|
47047
47009
|
} else if (state === ENTITY_STATE_FAILED) {
|
|
47048
47010
|
reject2(new Error(messages_1.messages.failed_creating_entity(_23.get(resource, "last_operation.description"), (0, utils_1.getName)(resource))));
|
|
47049
47011
|
} else {
|
|
47050
|
-
progress.progress.report({
|
|
47012
|
+
progress.progress.report({ message: `
|
|
47051
47013
|
${messages_1.messages.service_creation_started}`, increment: 100 });
|
|
47052
47014
|
resolve2(resource);
|
|
47053
47015
|
}
|
|
@@ -47055,44 +47017,36 @@ ${messages_1.messages.service_creation_started}`, increment: 100 });
|
|
|
47055
47017
|
reject2(new Error(messages_1.messages.exceed_number_of_attempts((0, utils_1.getName)(resource))));
|
|
47056
47018
|
}
|
|
47057
47019
|
}
|
|
47058
|
-
function execQuery(args, fncParse, reverseErrorOrder) {
|
|
47059
|
-
|
|
47060
|
-
|
|
47061
|
-
|
|
47062
|
-
|
|
47063
|
-
|
|
47064
|
-
return fncParse ? yield fncParse(evaluateResponse((0, comment_json_1.parse)(cliResult.stdout))) : cliResult.stdout || cliResult.stderr;
|
|
47065
|
-
});
|
|
47020
|
+
async function execQuery(args, fncParse, reverseErrorOrder) {
|
|
47021
|
+
const cliResult = await cli_1.Cli.execute(args.query, args.options, args.token);
|
|
47022
|
+
if (cliResult.exitCode !== 0) {
|
|
47023
|
+
throw new Error(reverseErrorOrder ? cliResult.stdout || cliResult.stderr || cliResult.error : cliResult.error || cliResult.stderr || cliResult.stdout);
|
|
47024
|
+
}
|
|
47025
|
+
return fncParse ? await fncParse(evaluateResponse((0, comment_json_1.parse)(cliResult.stdout))) : cliResult.stdout || cliResult.stderr;
|
|
47066
47026
|
}
|
|
47067
|
-
function execTotal(args, fncParse) {
|
|
47068
|
-
|
|
47069
|
-
|
|
47070
|
-
|
|
47071
|
-
|
|
47072
|
-
|
|
47073
|
-
|
|
47074
|
-
collection.push(fncParse ? yield fncParse(resource, _23.get(result, "included")) : resource);
|
|
47075
|
-
}
|
|
47076
|
-
query = _23.get(result, ["pagination", "next", "href"]);
|
|
47027
|
+
async function execTotal(args, fncParse) {
|
|
47028
|
+
const collection = [];
|
|
47029
|
+
let query = args.query;
|
|
47030
|
+
while (query) {
|
|
47031
|
+
const result = (0, comment_json_1.parse)(await execQuery({ query: ["curl", await resolveEndpoint(query)], options: args.options, token: args.token }));
|
|
47032
|
+
for (const resource of _23.get(result, "resources", [])) {
|
|
47033
|
+
collection.push(fncParse ? await fncParse(resource, _23.get(result, "included")) : resource);
|
|
47077
47034
|
}
|
|
47078
|
-
|
|
47079
|
-
}
|
|
47035
|
+
query = _23.get(result, ["pagination", "next", "href"]);
|
|
47036
|
+
}
|
|
47037
|
+
return _23.compact(collection);
|
|
47080
47038
|
}
|
|
47081
|
-
function getServiceInstance(query, token2) {
|
|
47082
|
-
|
|
47083
|
-
|
|
47084
|
-
|
|
47085
|
-
|
|
47086
|
-
|
|
47087
|
-
|
|
47088
|
-
|
|
47089
|
-
throw new Error(messages_1.messages.service_not_found(decodeURIComponent(_23.get(_23.find(query.filters, ["key", types_1.eFilters.names]), "value")) || "unknown"));
|
|
47090
|
-
});
|
|
47039
|
+
async function getServiceInstance(query, token2) {
|
|
47040
|
+
evaluateQueryFilters(query, resourceServiceInstances);
|
|
47041
|
+
query = await (0, utils_1.padQuerySpace)(query, [{ key: types_1.eFilters.type, value: types_1.eServiceTypes.managed }]);
|
|
47042
|
+
const result = await execTotal({ query: `/v3/service_instances?${composeQuery(query)}`, token: token2 });
|
|
47043
|
+
if (_23.size(result) >= 1) {
|
|
47044
|
+
return _23.head(result);
|
|
47045
|
+
}
|
|
47046
|
+
throw new Error(messages_1.messages.service_not_found(decodeURIComponent(_23.get(_23.find(query.filters, ["key", types_1.eFilters.names]), "value")) || "unknown"));
|
|
47091
47047
|
}
|
|
47092
|
-
function getUpsCredentials(instanceGuid, token2) {
|
|
47093
|
-
return
|
|
47094
|
-
return execQuery({ query: ["curl", `/v3/service_instances/${instanceGuid}/credentials`], token: token2 }, (data) => data);
|
|
47095
|
-
});
|
|
47048
|
+
async function getUpsCredentials(instanceGuid, token2) {
|
|
47049
|
+
return execQuery({ query: ["curl", `/v3/service_instances/${instanceGuid}/credentials`], token: token2 }, (data) => data);
|
|
47096
47050
|
}
|
|
47097
47051
|
function resolveCfResource(data, service) {
|
|
47098
47052
|
return _23.merge({
|
|
@@ -47110,7 +47064,10 @@ ${messages_1.messages.service_creation_started}`, increment: 100 });
|
|
|
47110
47064
|
function getCachedServicePlan(plan) {
|
|
47111
47065
|
if (!cacheServiceInstanceTypes[plan.guid]) {
|
|
47112
47066
|
cacheServiceInstanceTypes[plan.guid] = execQuery({ query: ["curl", `/v3/service_plans/${plan.guid}?include=service_offering`] }, (data) => {
|
|
47113
|
-
return Promise.resolve(resolveCfResource(data, _23.find(_23.get(data, ["included", "service_offerings"]), [
|
|
47067
|
+
return Promise.resolve(resolveCfResource(data, _23.find(_23.get(data, ["included", "service_offerings"]), [
|
|
47068
|
+
"guid",
|
|
47069
|
+
_23.get(data, ["relationships", "service_offering", "data", "guid"])
|
|
47070
|
+
])));
|
|
47114
47071
|
});
|
|
47115
47072
|
}
|
|
47116
47073
|
return cacheServiceInstanceTypes[plan.guid];
|
|
@@ -47130,117 +47087,145 @@ ${messages_1.messages.service_creation_started}`, increment: 100 });
|
|
|
47130
47087
|
}) : Promise.resolve()
|
|
47131
47088
|
});
|
|
47132
47089
|
}
|
|
47133
|
-
function resolveServiceInstances(results) {
|
|
47134
|
-
|
|
47135
|
-
|
|
47136
|
-
|
|
47137
|
-
|
|
47090
|
+
async function resolveServiceInstances(results) {
|
|
47091
|
+
const queries = _23.concat(_23.map(results, "serviceName"), _23.map(results, "credentials"));
|
|
47092
|
+
if (!_23.size(queries)) {
|
|
47093
|
+
return [];
|
|
47094
|
+
}
|
|
47095
|
+
return Promise.all(queries).then(async () => {
|
|
47096
|
+
const instances = [];
|
|
47097
|
+
for (const result of results) {
|
|
47098
|
+
const serviceName = await _23.get(result, "serviceName");
|
|
47099
|
+
instances.push({
|
|
47100
|
+
guid: (0, utils_1.getGuid)(result),
|
|
47101
|
+
label: (0, utils_1.getLabel)(result),
|
|
47102
|
+
serviceName: _23.get(serviceName, ["service_offering", "name"], "unknown"),
|
|
47103
|
+
plan_guid: _23.get(result, "plan_guid"),
|
|
47104
|
+
plan: _23.get(serviceName, "name", "unknown"),
|
|
47105
|
+
tags: _23.get(result, "tags"),
|
|
47106
|
+
credentials: await result.credentials
|
|
47107
|
+
});
|
|
47138
47108
|
}
|
|
47139
|
-
return
|
|
47140
|
-
const instances = [];
|
|
47141
|
-
for (const result of results) {
|
|
47142
|
-
const serviceName = yield _23.get(result, "serviceName");
|
|
47143
|
-
instances.push({
|
|
47144
|
-
guid: (0, utils_1.getGuid)(result),
|
|
47145
|
-
label: (0, utils_1.getLabel)(result),
|
|
47146
|
-
serviceName: _23.get(serviceName, ["service_offering", "name"], "unknown"),
|
|
47147
|
-
plan_guid: _23.get(result, "plan_guid"),
|
|
47148
|
-
plan: _23.get(serviceName, "name", "unknown"),
|
|
47149
|
-
tags: _23.get(result, "tags"),
|
|
47150
|
-
credentials: yield result.credentials
|
|
47151
|
-
});
|
|
47152
|
-
}
|
|
47153
|
-
return _23.compact(instances);
|
|
47154
|
-
}));
|
|
47109
|
+
return _23.compact(instances);
|
|
47155
47110
|
});
|
|
47156
47111
|
}
|
|
47157
|
-
function cfGetUpsInstances(query, token2) {
|
|
47158
|
-
|
|
47159
|
-
|
|
47160
|
-
|
|
47161
|
-
return resolveServiceInstances(yield execTotal({ query: `/v3/service_instances?${composeQuery(query)}`, token: token2 }, (info) => __awaiter(this, void 0, void 0, function* () {
|
|
47162
|
-
return getServiceInstanceItem(info);
|
|
47163
|
-
})));
|
|
47164
|
-
});
|
|
47112
|
+
async function cfGetUpsInstances(query, token2) {
|
|
47113
|
+
evaluateQueryFilters(query, resourceServiceInstances);
|
|
47114
|
+
query = await (0, utils_1.padQuerySpace)(query, [{ key: types_1.eFilters.type, value: types_1.eServiceTypes.user_provided }]);
|
|
47115
|
+
return resolveServiceInstances(await execTotal({ query: `/v3/service_instances?${composeQuery(query)}`, token: token2 }, async (info) => getServiceInstanceItem(info)));
|
|
47165
47116
|
}
|
|
47166
47117
|
exports2.cfGetUpsInstances = cfGetUpsInstances;
|
|
47167
|
-
function cfCreateService(planGuid, instanceName, params, tags, progress, maxNumberOfAttemps) {
|
|
47168
|
-
|
|
47169
|
-
|
|
47170
|
-
|
|
47171
|
-
|
|
47172
|
-
|
|
47173
|
-
|
|
47174
|
-
|
|
47175
|
-
|
|
47176
|
-
|
|
47177
|
-
|
|
47178
|
-
|
|
47179
|
-
|
|
47180
|
-
|
|
47181
|
-
|
|
47182
|
-
|
|
47183
|
-
progress.
|
|
47118
|
+
async function cfCreateService(planGuid, instanceName, params, tags, progress, maxNumberOfAttemps) {
|
|
47119
|
+
const spaceGuid = await (0, utils_1.getSpaceGuidThrowIfUndefined)();
|
|
47120
|
+
maxNumberOfAttemps = _23.isNil(maxNumberOfAttemps) ? 45 : maxNumberOfAttemps;
|
|
47121
|
+
progress = _23.defaults(progress, { progress: { report: () => "" } }, { cancelToken: { isCancellationRequested: false, onCancellationRequested: () => "" } });
|
|
47122
|
+
const request = {
|
|
47123
|
+
type: types_1.eServiceTypes.managed,
|
|
47124
|
+
name: instanceName,
|
|
47125
|
+
relationships: {
|
|
47126
|
+
space: { data: { guid: spaceGuid } },
|
|
47127
|
+
service_plan: { data: { guid: planGuid } }
|
|
47128
|
+
},
|
|
47129
|
+
parameters: params,
|
|
47130
|
+
tags
|
|
47131
|
+
};
|
|
47132
|
+
const result = await execQuery({
|
|
47133
|
+
query: ["curl", "/v3/service_instances", "-d", (0, comment_json_1.stringify)(request), "-X", "POST"],
|
|
47134
|
+
token: progress.cancelToken
|
|
47135
|
+
});
|
|
47136
|
+
progress.progress.report({ message: `
|
|
47184
47137
|
${messages_1.messages.service_creation_started}`, increment: 1 });
|
|
47185
|
-
|
|
47186
|
-
|
|
47187
|
-
|
|
47188
|
-
|
|
47138
|
+
const query = {
|
|
47139
|
+
filters: [
|
|
47140
|
+
{ key: types_1.eFilters.names, value: encodeURIComponent(instanceName) },
|
|
47141
|
+
{ key: types_1.eFilters.space_guids, value: spaceGuid }
|
|
47142
|
+
]
|
|
47143
|
+
};
|
|
47144
|
+
return new Promise((resolve2, reject2) => {
|
|
47145
|
+
waitForEntity(resolve2, reject2, !_23.isEmpty(_23.replace(result, "\n", "")) ? (0, comment_json_1.parse)(result) : result, 0, maxNumberOfAttemps, () => getServiceInstance(query, progress.cancelToken), progress);
|
|
47189
47146
|
});
|
|
47190
47147
|
}
|
|
47191
47148
|
exports2.cfCreateService = cfCreateService;
|
|
47192
|
-
function cfCreateUpsInstance(info) {
|
|
47193
|
-
|
|
47194
|
-
|
|
47195
|
-
|
|
47196
|
-
|
|
47197
|
-
|
|
47198
|
-
|
|
47199
|
-
|
|
47149
|
+
async function cfCreateUpsInstance(info) {
|
|
47150
|
+
let spaceGuid = info.space_guid;
|
|
47151
|
+
if (!spaceGuid) {
|
|
47152
|
+
spaceGuid = await (0, utils_1.getSpaceGuidThrowIfUndefined)();
|
|
47153
|
+
}
|
|
47154
|
+
return evaluateResponse((0, comment_json_1.parse)(await execQuery({
|
|
47155
|
+
query: [
|
|
47156
|
+
"curl",
|
|
47157
|
+
`/v3/service_instances`,
|
|
47158
|
+
"-d",
|
|
47159
|
+
(0, comment_json_1.stringify)(_23.merge({
|
|
47200
47160
|
name: info.instanceName,
|
|
47201
47161
|
type: types_1.eServiceTypes.user_provided,
|
|
47202
47162
|
relationships: { space: { data: { guid: spaceGuid } } }
|
|
47203
|
-
}, info.credentials ? {
|
|
47204
|
-
|
|
47205
|
-
|
|
47163
|
+
}, info.credentials ? { credentials: info.credentials } : {}, info.route_service_url ? { route_service_url: info.route_service_url } : {}, info.syslog_drain_url ? { syslog_drain_url: info.syslog_drain_url } : {}, info.tags ? { tags: info.tags } : {})),
|
|
47164
|
+
"-X",
|
|
47165
|
+
"POST"
|
|
47166
|
+
]
|
|
47167
|
+
})));
|
|
47206
47168
|
}
|
|
47207
47169
|
exports2.cfCreateUpsInstance = cfCreateUpsInstance;
|
|
47208
|
-
function cfLogin(
|
|
47209
|
-
|
|
47210
|
-
|
|
47211
|
-
|
|
47212
|
-
|
|
47213
|
-
|
|
47214
|
-
|
|
47215
|
-
|
|
47216
|
-
|
|
47217
|
-
|
|
47170
|
+
async function cfLogin(options) {
|
|
47171
|
+
let result;
|
|
47172
|
+
try {
|
|
47173
|
+
let query = ["login", "-a"];
|
|
47174
|
+
query = "ssoPasscode" in options ? _23.concat(query, [
|
|
47175
|
+
options.endpoint,
|
|
47176
|
+
"--sso-passcode",
|
|
47177
|
+
options.ssoPasscode,
|
|
47178
|
+
"-o",
|
|
47179
|
+
"no-org-for-now",
|
|
47180
|
+
"-s",
|
|
47181
|
+
"no-space-for-now"
|
|
47182
|
+
]) : _23.concat(query, [
|
|
47183
|
+
options.endpoint,
|
|
47184
|
+
"-u",
|
|
47185
|
+
options.user,
|
|
47186
|
+
"-p",
|
|
47187
|
+
options.password,
|
|
47188
|
+
"-o",
|
|
47189
|
+
"no-org-for-now",
|
|
47190
|
+
"-s",
|
|
47191
|
+
"no-space-for-now"
|
|
47192
|
+
]);
|
|
47193
|
+
query = _23.concat(query, options.origin ? ["--origin", options.origin] : []);
|
|
47194
|
+
result = await execQuery({
|
|
47195
|
+
query,
|
|
47196
|
+
options: { env: { CF_COLOR: "false" } }
|
|
47197
|
+
}, void 0, true);
|
|
47198
|
+
} catch (e) {
|
|
47199
|
+
result = _23.get(e, "message", "");
|
|
47200
|
+
}
|
|
47201
|
+
return result.includes(`Authenticating...${types_1.NEW_LINE}${types_1.OK}`) ? types_1.OK : result;
|
|
47218
47202
|
}
|
|
47219
47203
|
exports2.cfLogin = cfLogin;
|
|
47220
|
-
function cfGetAvailableOrgs(query) {
|
|
47221
|
-
|
|
47222
|
-
|
|
47223
|
-
return
|
|
47224
|
-
|
|
47204
|
+
async function cfGetAvailableOrgs(query) {
|
|
47205
|
+
evaluateQueryFilters(query, resourceOrganizations);
|
|
47206
|
+
const ret = execTotal({ query: `/v3/organizations?${composeQuery(query)}` }, (resource) => {
|
|
47207
|
+
return Promise.resolve({
|
|
47208
|
+
label: (0, utils_1.getName)(resource),
|
|
47209
|
+
guid: (0, utils_1.getGuid)(resource)
|
|
47225
47210
|
});
|
|
47226
47211
|
});
|
|
47212
|
+
return ret;
|
|
47227
47213
|
}
|
|
47228
47214
|
exports2.cfGetAvailableOrgs = cfGetAvailableOrgs;
|
|
47229
|
-
function cfGetAvailableSpaces(orgGuid) {
|
|
47230
|
-
|
|
47231
|
-
|
|
47232
|
-
|
|
47233
|
-
|
|
47234
|
-
|
|
47235
|
-
|
|
47236
|
-
return
|
|
47237
|
-
|
|
47238
|
-
|
|
47239
|
-
|
|
47240
|
-
orgGUID: (0, utils_1.getOrgGUID)(resource)
|
|
47241
|
-
});
|
|
47215
|
+
async function cfGetAvailableSpaces(orgGuid) {
|
|
47216
|
+
const query = (0, utils_1.ensureQuery)();
|
|
47217
|
+
if (orgGuid) {
|
|
47218
|
+
_23.merge(query.filters, [{ key: types_1.eFilters.organization_guids, value: orgGuid }]);
|
|
47219
|
+
}
|
|
47220
|
+
evaluateQueryFilters(query, resourceSpaces);
|
|
47221
|
+
const ret = execTotal({ query: `/v3/spaces?${composeQuery(query)}` }, (resource) => {
|
|
47222
|
+
return Promise.resolve({
|
|
47223
|
+
label: (0, utils_1.getName)(resource),
|
|
47224
|
+
guid: (0, utils_1.getGuid)(resource),
|
|
47225
|
+
orgGUID: (0, utils_1.getOrgGUID)(resource)
|
|
47242
47226
|
});
|
|
47243
47227
|
});
|
|
47228
|
+
return ret;
|
|
47244
47229
|
}
|
|
47245
47230
|
exports2.cfGetAvailableSpaces = cfGetAvailableSpaces;
|
|
47246
47231
|
function resolvePlanInfo(data, service) {
|
|
@@ -47256,224 +47241,193 @@ ${messages_1.messages.service_creation_started}`, increment: 1 });
|
|
|
47256
47241
|
}
|
|
47257
47242
|
} : {});
|
|
47258
47243
|
}
|
|
47259
|
-
function cfGetServicePlansList(query, token2) {
|
|
47260
|
-
|
|
47261
|
-
|
|
47262
|
-
|
|
47263
|
-
return
|
|
47264
|
-
|
|
47265
|
-
|
|
47244
|
+
async function cfGetServicePlansList(query, token2) {
|
|
47245
|
+
query = await (0, utils_1.padQuerySpace)(query, [{ key: types_1.eFilters.include, value: "service_offering" }]);
|
|
47246
|
+
evaluateQueryFilters(query, resourceServicePlan);
|
|
47247
|
+
return execTotal({ query: `/v3/service_plans?${composeQuery(query)}`, token: token2 }, (data, included) => {
|
|
47248
|
+
return Promise.resolve(resolvePlanInfo(data, _23.find(_23.get(included, "service_offerings"), [
|
|
47249
|
+
"guid",
|
|
47250
|
+
_23.get(data, ["relationships", "service_offering", "data", "guid"])
|
|
47251
|
+
])));
|
|
47266
47252
|
});
|
|
47267
47253
|
}
|
|
47268
47254
|
exports2.cfGetServicePlansList = cfGetServicePlansList;
|
|
47269
|
-
function cfGetServiceInstances(query, token2) {
|
|
47270
|
-
|
|
47271
|
-
|
|
47272
|
-
|
|
47273
|
-
|
|
47274
|
-
|
|
47275
|
-
|
|
47276
|
-
return resolveServiceInstances(yield execTotal({ query: `/v3/service_instances?${composeQuery(query)}`, token: token2 }, (info) => getServiceInstanceItem(info)));
|
|
47277
|
-
});
|
|
47255
|
+
async function cfGetServiceInstances(query, token2) {
|
|
47256
|
+
query = await (0, utils_1.padQuerySpace)(query, [
|
|
47257
|
+
{ key: types_1.eFilters.service_plan, value: "guid,name", op: types_1.eOperation.fields },
|
|
47258
|
+
{ key: types_1.eFilters.type, value: types_1.eServiceTypes.managed }
|
|
47259
|
+
]);
|
|
47260
|
+
evaluateQueryFilters(query, resourceServiceInstances);
|
|
47261
|
+
return resolveServiceInstances(await execTotal({ query: `/v3/service_instances?${composeQuery(query)}`, token: token2 }, (info) => getServiceInstanceItem(info)));
|
|
47278
47262
|
}
|
|
47279
47263
|
exports2.cfGetServiceInstances = cfGetServiceInstances;
|
|
47280
|
-
function cfGetManagedServiceInstances(query, token2) {
|
|
47281
|
-
return
|
|
47282
|
-
return cfGetServiceInstances(query, token2);
|
|
47283
|
-
});
|
|
47264
|
+
async function cfGetManagedServiceInstances(query, token2) {
|
|
47265
|
+
return cfGetServiceInstances(query, token2);
|
|
47284
47266
|
}
|
|
47285
47267
|
exports2.cfGetManagedServiceInstances = cfGetManagedServiceInstances;
|
|
47286
|
-
function cfSetOrgSpace(org, space) {
|
|
47287
|
-
|
|
47288
|
-
|
|
47289
|
-
|
|
47290
|
-
void cfGetManagedServiceInstances();
|
|
47291
|
-
});
|
|
47268
|
+
async function cfSetOrgSpace(org, space) {
|
|
47269
|
+
await execQuery({ query: _23.concat(["target", "-o", org], space ? ["-s", space] : []) });
|
|
47270
|
+
clearCacheServiceInstances();
|
|
47271
|
+
void cfGetManagedServiceInstances();
|
|
47292
47272
|
}
|
|
47293
47273
|
exports2.cfSetOrgSpace = cfSetOrgSpace;
|
|
47294
|
-
function cfGetTargets() {
|
|
47295
|
-
|
|
47296
|
-
|
|
47297
|
-
|
|
47298
|
-
|
|
47299
|
-
|
|
47300
|
-
|
|
47301
|
-
|
|
47302
|
-
|
|
47303
|
-
|
|
47304
|
-
|
|
47305
|
-
|
|
47306
|
-
|
|
47307
|
-
return { label: targetSubstring, isCurrent: false, isDirty: false };
|
|
47308
|
-
});
|
|
47274
|
+
async function cfGetTargets() {
|
|
47275
|
+
const targets = await execQuery({ query: ["targets"] });
|
|
47276
|
+
if (_23.includes(targets, "No targets have been saved yet") || _23.includes(targets, "is not a registered command")) {
|
|
47277
|
+
return [{ label: types_1.DEFAULT_TARGET, isCurrent: true, isDirty: false }];
|
|
47278
|
+
}
|
|
47279
|
+
const targetSubstrings = _23.compact(_23.map(targets.split(types_1.NEW_LINE), (targetSubstring) => targetSubstring.trim()));
|
|
47280
|
+
return _23.map(targetSubstrings, (targetSubstring) => {
|
|
47281
|
+
const parentthesisPos = targetSubstring.indexOf("(current");
|
|
47282
|
+
if (parentthesisPos > 0) {
|
|
47283
|
+
targetSubstring = targetSubstring.substring(0, parentthesisPos);
|
|
47284
|
+
return { label: targetSubstring.trim(), isCurrent: true, isDirty: targetSubstring.includes("modified") };
|
|
47285
|
+
}
|
|
47286
|
+
return { label: targetSubstring, isCurrent: false, isDirty: false };
|
|
47309
47287
|
});
|
|
47310
47288
|
}
|
|
47311
47289
|
exports2.cfGetTargets = cfGetTargets;
|
|
47312
|
-
function cfGetServices(query, cancellationToken) {
|
|
47313
|
-
|
|
47314
|
-
|
|
47315
|
-
return
|
|
47316
|
-
|
|
47317
|
-
|
|
47318
|
-
|
|
47319
|
-
|
|
47320
|
-
description: (0, utils_1.getDescription)(service)
|
|
47321
|
-
});
|
|
47290
|
+
async function cfGetServices(query, cancellationToken) {
|
|
47291
|
+
evaluateQueryFilters(query, resourceServiceOfferings);
|
|
47292
|
+
return execTotal({ query: `/v3/service_offerings?${composeQuery(await (0, utils_1.padQuerySpace)(query))}`, token: cancellationToken }, (service) => {
|
|
47293
|
+
return Promise.resolve({
|
|
47294
|
+
label: (0, utils_1.getName)(service),
|
|
47295
|
+
service_plans_url: _23.get(service, ["links", "service_plans", "href"]),
|
|
47296
|
+
guid: (0, utils_1.getGuid)(service),
|
|
47297
|
+
description: (0, utils_1.getDescription)(service)
|
|
47322
47298
|
});
|
|
47323
47299
|
});
|
|
47324
47300
|
}
|
|
47325
47301
|
exports2.cfGetServices = cfGetServices;
|
|
47326
|
-
function cfGetSpaceServices(query, spaceGUID, cancellationToken) {
|
|
47327
|
-
return
|
|
47328
|
-
return cfGetServices((0, utils_1.padQuery)(query, [{ key: types_1.eFilters.space_guids, value: spaceGUID }]), cancellationToken);
|
|
47329
|
-
});
|
|
47302
|
+
async function cfGetSpaceServices(query, spaceGUID, cancellationToken) {
|
|
47303
|
+
return cfGetServices((0, utils_1.padQuery)(query, [{ key: types_1.eFilters.space_guids, value: spaceGUID }]), cancellationToken);
|
|
47330
47304
|
}
|
|
47331
47305
|
exports2.cfGetSpaceServices = cfGetSpaceServices;
|
|
47332
|
-
function cfBindLocalServices(filePath, instanceNames, tags, serviceKeyNames, serviceKeyParams) {
|
|
47333
|
-
|
|
47334
|
-
|
|
47335
|
-
|
|
47336
|
-
|
|
47337
|
-
|
|
47338
|
-
|
|
47339
|
-
|
|
47340
|
-
|
|
47341
|
-
|
|
47342
|
-
|
|
47343
|
-
|
|
47344
|
-
|
|
47345
|
-
|
|
47346
|
-
|
|
47347
|
-
});
|
|
47306
|
+
async function cfBindLocalServices(filePath, instanceNames, tags, serviceKeyNames, serviceKeyParams, quoteVcap) {
|
|
47307
|
+
await execQuery({
|
|
47308
|
+
query: [
|
|
47309
|
+
"bind-local",
|
|
47310
|
+
"-path",
|
|
47311
|
+
filePath,
|
|
47312
|
+
"-service-names",
|
|
47313
|
+
...instanceNames,
|
|
47314
|
+
..._23.size(tags) ? _23.concat(["-tags"], tags) : [],
|
|
47315
|
+
..._23.size(serviceKeyNames) ? _23.concat(["-service-keys"], serviceKeyNames) : [],
|
|
47316
|
+
..._23.size(serviceKeyParams) ? _23.concat(["-params"], _23.map(serviceKeyParams, (param) => {
|
|
47317
|
+
return (0, comment_json_1.stringify)(param);
|
|
47318
|
+
})) : [],
|
|
47319
|
+
...quoteVcap ? ["-quote-vcap"] : []
|
|
47320
|
+
]
|
|
47348
47321
|
});
|
|
47349
47322
|
}
|
|
47350
47323
|
exports2.cfBindLocalServices = cfBindLocalServices;
|
|
47351
|
-
function cfBindLocalUps(filePath, instanceNames, tags) {
|
|
47352
|
-
|
|
47353
|
-
|
|
47354
|
-
|
|
47355
|
-
|
|
47356
|
-
|
|
47357
|
-
|
|
47358
|
-
|
|
47359
|
-
|
|
47360
|
-
}, []))
|
|
47361
|
-
});
|
|
47324
|
+
async function cfBindLocalUps(filePath, instanceNames, tags, quoteVcap) {
|
|
47325
|
+
await execQuery({
|
|
47326
|
+
query: _23.concat(["bind-local-ups", "-path", filePath], _23.reduce(instanceNames, (result, instanceName) => {
|
|
47327
|
+
result = _23.concat(result, [`-service-names`, `${instanceName}`]);
|
|
47328
|
+
return result;
|
|
47329
|
+
}, []), _23.reduce(tags, (result, tag) => {
|
|
47330
|
+
result = _23.concat(result, [`-tags`, `${tag}`]);
|
|
47331
|
+
return result;
|
|
47332
|
+
}, []), quoteVcap ? ["-quote-vcap"] : [])
|
|
47362
47333
|
});
|
|
47363
47334
|
}
|
|
47364
47335
|
exports2.cfBindLocalUps = cfBindLocalUps;
|
|
47365
|
-
function cfGetInstanceMetadata(instanceName) {
|
|
47366
|
-
|
|
47367
|
-
|
|
47368
|
-
|
|
47369
|
-
|
|
47370
|
-
|
|
47371
|
-
|
|
47372
|
-
|
|
47373
|
-
|
|
47374
|
-
|
|
47375
|
-
|
|
47376
|
-
|
|
47377
|
-
|
|
47378
|
-
|
|
47379
|
-
|
|
47380
|
-
|
|
47381
|
-
|
|
47382
|
-
};
|
|
47383
|
-
});
|
|
47336
|
+
async function cfGetInstanceMetadata(instanceName) {
|
|
47337
|
+
const result = await cfGetServiceInstances(await (0, utils_1.padQuerySpace)({
|
|
47338
|
+
filters: [
|
|
47339
|
+
{ key: types_1.eFilters.names, value: encodeURIComponent(instanceName) },
|
|
47340
|
+
{ key: types_1.eFilters.type, value: types_1.eServiceTypes.managed }
|
|
47341
|
+
]
|
|
47342
|
+
}));
|
|
47343
|
+
if (!_23.size(result)) {
|
|
47344
|
+
throw new Error(messages_1.messages.service_not_found(instanceName));
|
|
47345
|
+
}
|
|
47346
|
+
const serviceInstance = _23.head(result);
|
|
47347
|
+
return {
|
|
47348
|
+
serviceName: (0, utils_1.getLabel)(serviceInstance),
|
|
47349
|
+
plan: _23.get(serviceInstance, "plan"),
|
|
47350
|
+
plan_guid: _23.get(serviceInstance, "plan_guid"),
|
|
47351
|
+
service: _23.get(serviceInstance, "serviceName")
|
|
47352
|
+
};
|
|
47384
47353
|
}
|
|
47385
47354
|
exports2.cfGetInstanceMetadata = cfGetInstanceMetadata;
|
|
47386
|
-
function cfGetAuthToken() {
|
|
47387
|
-
return
|
|
47388
|
-
return yield execQuery({ query: ["oauth-token"] });
|
|
47389
|
-
});
|
|
47355
|
+
async function cfGetAuthToken() {
|
|
47356
|
+
return await execQuery({ query: ["oauth-token"] });
|
|
47390
47357
|
}
|
|
47391
47358
|
exports2.cfGetAuthToken = cfGetAuthToken;
|
|
47392
|
-
function cfGetTarget(weak) {
|
|
47393
|
-
|
|
47394
|
-
|
|
47395
|
-
|
|
47396
|
-
|
|
47397
|
-
return (0, utils_1.parseRawDictData)(yield execQuery({ query: ["target"], options: { env: { "CF_COLOR": "false" } } }));
|
|
47398
|
-
});
|
|
47359
|
+
async function cfGetTarget(weak) {
|
|
47360
|
+
if (!weak) {
|
|
47361
|
+
await cfGetAuthToken();
|
|
47362
|
+
}
|
|
47363
|
+
return (0, utils_1.parseRawDictData)(await execQuery({ query: ["target"], options: { env: { CF_COLOR: "false" } } }));
|
|
47399
47364
|
}
|
|
47400
47365
|
exports2.cfGetTarget = cfGetTarget;
|
|
47401
|
-
function cfGetServicePlans(servicePlansUrl) {
|
|
47402
|
-
return
|
|
47403
|
-
return
|
|
47404
|
-
return Promise.resolve({ label: (0, utils_1.getName)(data), guid: (0, utils_1.getGuid)(data), description: (0, utils_1.getDescription)(data) });
|
|
47405
|
-
});
|
|
47366
|
+
async function cfGetServicePlans(servicePlansUrl) {
|
|
47367
|
+
return execTotal({ query: servicePlansUrl }, (data) => {
|
|
47368
|
+
return Promise.resolve({ label: (0, utils_1.getName)(data), guid: (0, utils_1.getGuid)(data), description: (0, utils_1.getDescription)(data) });
|
|
47406
47369
|
});
|
|
47407
47370
|
}
|
|
47408
47371
|
exports2.cfGetServicePlans = cfGetServicePlans;
|
|
47409
|
-
function cfLogout() {
|
|
47410
|
-
|
|
47411
|
-
yield execQuery({ query: ["logout"] });
|
|
47412
|
-
});
|
|
47372
|
+
async function cfLogout() {
|
|
47373
|
+
await execQuery({ query: ["logout"] });
|
|
47413
47374
|
}
|
|
47414
47375
|
exports2.cfLogout = cfLogout;
|
|
47415
|
-
function cfGetServiceKeys(query, token2) {
|
|
47416
|
-
|
|
47417
|
-
|
|
47418
|
-
|
|
47376
|
+
async function cfGetServiceKeys(query, token2) {
|
|
47377
|
+
evaluateQueryFilters(query, resourceServiceCredentialsBinding);
|
|
47378
|
+
return execTotal({
|
|
47379
|
+
query: `/v3/service_credential_bindings?${composeQuery((0, utils_1.padQuery)(query, [{ key: types_1.eFilters.type, value: "key" }]))}`,
|
|
47380
|
+
token: token2
|
|
47419
47381
|
});
|
|
47420
47382
|
}
|
|
47421
47383
|
exports2.cfGetServiceKeys = cfGetServiceKeys;
|
|
47422
|
-
function cfGetInstanceCredentials(query, token2) {
|
|
47423
|
-
|
|
47424
|
-
|
|
47425
|
-
return
|
|
47426
|
-
return {};
|
|
47427
|
-
});
|
|
47384
|
+
async function cfGetInstanceCredentials(query, token2) {
|
|
47385
|
+
const results = _23.map(await cfGetServiceKeys(query, token2), (resource) => {
|
|
47386
|
+
return execQuery({ query: ["curl", `/v3/service_credential_bindings/${(0, utils_1.getGuid)(resource)}/details`], token: token2 }, (data) => data).then((data) => data).catch(() => {
|
|
47387
|
+
return {};
|
|
47428
47388
|
});
|
|
47429
|
-
return Promise.all(_23.compact(results));
|
|
47430
47389
|
});
|
|
47390
|
+
return Promise.all(_23.compact(results));
|
|
47431
47391
|
}
|
|
47432
47392
|
exports2.cfGetInstanceCredentials = cfGetInstanceCredentials;
|
|
47433
|
-
function cfGetInstanceKeyParameters(instanceName) {
|
|
47434
|
-
|
|
47435
|
-
|
|
47436
|
-
|
|
47437
|
-
|
|
47438
|
-
|
|
47439
|
-
|
|
47440
|
-
|
|
47441
|
-
}
|
|
47442
|
-
|
|
47443
|
-
|
|
47444
|
-
}
|
|
47393
|
+
async function cfGetInstanceKeyParameters(instanceName) {
|
|
47394
|
+
const instance = await getServiceInstance({
|
|
47395
|
+
filters: [{ key: types_1.eFilters.names, value: encodeURIComponent(instanceName) }]
|
|
47396
|
+
});
|
|
47397
|
+
const query = { filters: [{ key: types_1.eFilters.service_instance_guids, value: (0, utils_1.getGuid)(instance) }] };
|
|
47398
|
+
let keys = await cfGetServiceKeys(query);
|
|
47399
|
+
if (!_23.size(keys)) {
|
|
47400
|
+
await cli_1.Cli.execute(["create-service-key", encodeURIComponent(instanceName), "key", "--wait"]);
|
|
47401
|
+
keys = await cfGetServiceKeys((0, utils_1.padQuery)(query, [{ key: types_1.eFilters.names, value: "key" }]));
|
|
47402
|
+
}
|
|
47403
|
+
return execQuery({ query: ["curl", `/v3/service_credential_bindings/${(0, utils_1.getGuid)(_23.head(keys))}/details`] }, (data) => data).then((data) => data).catch(() => {
|
|
47404
|
+
return {};
|
|
47445
47405
|
});
|
|
47446
47406
|
}
|
|
47447
47407
|
exports2.cfGetInstanceKeyParameters = cfGetInstanceKeyParameters;
|
|
47448
|
-
function cfGetServiceInstancesList(query, token2) {
|
|
47449
|
-
|
|
47450
|
-
|
|
47451
|
-
|
|
47452
|
-
return resolveServiceInstances(yield execTotal({ query: `/v3/service_instances?${composeQuery(query)}`, token: token2 }, (info) => getServiceInstanceItem(info)));
|
|
47453
|
-
});
|
|
47408
|
+
async function cfGetServiceInstancesList(query, token2) {
|
|
47409
|
+
query = await (0, utils_1.padQuerySpace)(query, [{ key: types_1.eFilters.service_plan, value: "guid,name", op: types_1.eOperation.fields }]);
|
|
47410
|
+
evaluateQueryFilters(query, resourceServiceInstances);
|
|
47411
|
+
return resolveServiceInstances(await execTotal({ query: `/v3/service_instances?${composeQuery(query)}`, token: token2 }, (info) => getServiceInstanceItem(info)));
|
|
47454
47412
|
}
|
|
47455
47413
|
exports2.cfGetServiceInstancesList = cfGetServiceInstancesList;
|
|
47456
|
-
function cfGetApps(query, token2) {
|
|
47457
|
-
|
|
47458
|
-
|
|
47459
|
-
return execTotal({ query: `/v3/apps?${composeQuery(yield (0, utils_1.padQuerySpace)(query))}`, token: token2 });
|
|
47460
|
-
});
|
|
47414
|
+
async function cfGetApps(query, token2) {
|
|
47415
|
+
evaluateQueryFilters(query, resourceApps);
|
|
47416
|
+
return execTotal({ query: `/v3/apps?${composeQuery(await (0, utils_1.padQuerySpace)(query))}`, token: token2 });
|
|
47461
47417
|
}
|
|
47462
47418
|
exports2.cfGetApps = cfGetApps;
|
|
47463
|
-
function cfApi(params) {
|
|
47464
|
-
|
|
47465
|
-
|
|
47466
|
-
|
|
47467
|
-
|
|
47468
|
-
|
|
47469
|
-
|
|
47470
|
-
|
|
47471
|
-
|
|
47472
|
-
|
|
47473
|
-
|
|
47474
|
-
|
|
47475
|
-
return (0, utils_1.parseRawDictData)(yield execQuery({ query: [...query] }));
|
|
47476
|
-
});
|
|
47419
|
+
async function cfApi(params) {
|
|
47420
|
+
const query = ["api"];
|
|
47421
|
+
if (params === null || params === void 0 ? void 0 : params.url) {
|
|
47422
|
+
query.push(params.url);
|
|
47423
|
+
}
|
|
47424
|
+
if (params === null || params === void 0 ? void 0 : params.skip_ssl_validation) {
|
|
47425
|
+
query.push("--skip-ssl-validation");
|
|
47426
|
+
}
|
|
47427
|
+
if (params === null || params === void 0 ? void 0 : params.unset) {
|
|
47428
|
+
query.push("--unset");
|
|
47429
|
+
}
|
|
47430
|
+
return (0, utils_1.parseRawDictData)(await execQuery({ query: [...query] }));
|
|
47477
47431
|
}
|
|
47478
47432
|
exports2.cfApi = cfApi;
|
|
47479
47433
|
}
|
|
@@ -47483,55 +47437,31 @@ ${messages_1.messages.service_creation_started}`, increment: 1 });
|
|
|
47483
47437
|
var require_cfServicesUtil = __commonJS({
|
|
47484
47438
|
"../../node_modules/@sap/cf-tools/out/src/cfServicesUtil.js"(exports2) {
|
|
47485
47439
|
"use strict";
|
|
47486
|
-
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
47487
|
-
function adopt(value) {
|
|
47488
|
-
return value instanceof P ? value : new P(function(resolve2) {
|
|
47489
|
-
resolve2(value);
|
|
47490
|
-
});
|
|
47491
|
-
}
|
|
47492
|
-
return new (P || (P = Promise))(function(resolve2, reject2) {
|
|
47493
|
-
function fulfilled(value) {
|
|
47494
|
-
try {
|
|
47495
|
-
step(generator.next(value));
|
|
47496
|
-
} catch (e) {
|
|
47497
|
-
reject2(e);
|
|
47498
|
-
}
|
|
47499
|
-
}
|
|
47500
|
-
function rejected(value) {
|
|
47501
|
-
try {
|
|
47502
|
-
step(generator["throw"](value));
|
|
47503
|
-
} catch (e) {
|
|
47504
|
-
reject2(e);
|
|
47505
|
-
}
|
|
47506
|
-
}
|
|
47507
|
-
function step(result) {
|
|
47508
|
-
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
47509
|
-
}
|
|
47510
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47511
|
-
});
|
|
47512
|
-
};
|
|
47513
47440
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47514
47441
|
exports2.isTargetSet = exports2.getInstanceMetadata = exports2.createServiceInstance = exports2.getInstanceCredentials = exports2.getServicesInstancesFilteredByType = void 0;
|
|
47515
47442
|
var cli_1 = require_cli3();
|
|
47516
47443
|
var _23 = require_lodash();
|
|
47517
47444
|
var types_1 = require_types2();
|
|
47518
47445
|
var cf_local_1 = require_cf_local();
|
|
47519
|
-
function getServicesInstancesFilteredByType(serviceTypes) {
|
|
47520
|
-
|
|
47521
|
-
|
|
47522
|
-
|
|
47523
|
-
});
|
|
47446
|
+
async function getServicesInstancesFilteredByType(serviceTypes) {
|
|
47447
|
+
const guids = _23.map(await (0, cf_local_1.cfGetServicePlansList)({
|
|
47448
|
+
filters: [{ key: types_1.eFilters.service_offering_names, value: _23.join(_23.map(serviceTypes, encodeURIComponent)) }]
|
|
47449
|
+
}), "guid");
|
|
47450
|
+
return _23.size(guids) ? (0, cf_local_1.cfGetManagedServiceInstances)({ filters: [{ key: types_1.eFilters.service_plan_guids, value: _23.join(guids) }] }) : [];
|
|
47524
47451
|
}
|
|
47525
47452
|
exports2.getServicesInstancesFilteredByType = getServicesInstancesFilteredByType;
|
|
47526
47453
|
function getInstanceCredentials(instanceName) {
|
|
47527
47454
|
return (0, cf_local_1.cfGetInstanceKeyParameters)(instanceName);
|
|
47528
47455
|
}
|
|
47529
47456
|
exports2.getInstanceCredentials = getInstanceCredentials;
|
|
47530
|
-
function createServiceInstance(serviceType, servicePlan, serviceInstanceName, config) {
|
|
47457
|
+
function createServiceInstance(serviceType, servicePlan, serviceInstanceName, config, nowait) {
|
|
47531
47458
|
let args = ["create-service", serviceType, servicePlan, serviceInstanceName];
|
|
47532
47459
|
if (config) {
|
|
47533
47460
|
args = args.concat(["-c", config]);
|
|
47534
47461
|
}
|
|
47462
|
+
if (nowait !== true) {
|
|
47463
|
+
args.push("--wait");
|
|
47464
|
+
}
|
|
47535
47465
|
return cli_1.Cli.execute(args);
|
|
47536
47466
|
}
|
|
47537
47467
|
exports2.createServiceInstance = createServiceInstance;
|
|
@@ -47539,11 +47469,9 @@ var require_cfServicesUtil = __commonJS({
|
|
|
47539
47469
|
return (0, cf_local_1.cfGetInstanceMetadata)(instanceName);
|
|
47540
47470
|
}
|
|
47541
47471
|
exports2.getInstanceMetadata = getInstanceMetadata;
|
|
47542
|
-
function isTargetSet() {
|
|
47543
|
-
|
|
47544
|
-
|
|
47545
|
-
return !_23.isEmpty(target.org) && !_23.isEmpty(target.space);
|
|
47546
|
-
});
|
|
47472
|
+
async function isTargetSet() {
|
|
47473
|
+
const target = await (0, cf_local_1.cfGetTarget)();
|
|
47474
|
+
return !_23.isEmpty(target.org) && !_23.isEmpty(target.space);
|
|
47547
47475
|
}
|
|
47548
47476
|
exports2.isTargetSet = isTargetSet;
|
|
47549
47477
|
}
|
|
@@ -47555,9 +47483,13 @@ var require_src5 = __commonJS({
|
|
|
47555
47483
|
"use strict";
|
|
47556
47484
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
47557
47485
|
if (k2 === void 0) k2 = k;
|
|
47558
|
-
Object.
|
|
47559
|
-
|
|
47560
|
-
|
|
47486
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
47487
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
47488
|
+
desc = { enumerable: true, get: function() {
|
|
47489
|
+
return m[k];
|
|
47490
|
+
} };
|
|
47491
|
+
}
|
|
47492
|
+
Object.defineProperty(o, k2, desc);
|
|
47561
47493
|
} : function(o, m, k, k2) {
|
|
47562
47494
|
if (k2 === void 0) k2 = k;
|
|
47563
47495
|
o[k2] = m[k];
|
|
@@ -47565,33 +47497,6 @@ var require_src5 = __commonJS({
|
|
|
47565
47497
|
var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
47566
47498
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
47567
47499
|
};
|
|
47568
|
-
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
47569
|
-
function adopt(value) {
|
|
47570
|
-
return value instanceof P ? value : new P(function(resolve2) {
|
|
47571
|
-
resolve2(value);
|
|
47572
|
-
});
|
|
47573
|
-
}
|
|
47574
|
-
return new (P || (P = Promise))(function(resolve2, reject2) {
|
|
47575
|
-
function fulfilled(value) {
|
|
47576
|
-
try {
|
|
47577
|
-
step(generator.next(value));
|
|
47578
|
-
} catch (e) {
|
|
47579
|
-
reject2(e);
|
|
47580
|
-
}
|
|
47581
|
-
}
|
|
47582
|
-
function rejected(value) {
|
|
47583
|
-
try {
|
|
47584
|
-
step(generator["throw"](value));
|
|
47585
|
-
} catch (e) {
|
|
47586
|
-
reject2(e);
|
|
47587
|
-
}
|
|
47588
|
-
}
|
|
47589
|
-
function step(result) {
|
|
47590
|
-
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
47591
|
-
}
|
|
47592
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47593
|
-
});
|
|
47594
|
-
};
|
|
47595
47500
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47596
47501
|
exports2.apiGetInstanceMetadata = exports2.apiCreateServiceInstance = exports2.apiGetInstanceCredentials = exports2.apiGetServicesInstancesFilteredByType = void 0;
|
|
47597
47502
|
__exportStar(require_types2(), exports2);
|
|
@@ -47600,28 +47505,20 @@ var require_src5 = __commonJS({
|
|
|
47600
47505
|
__exportStar(require_messages(), exports2);
|
|
47601
47506
|
__exportStar(require_utils3(), exports2);
|
|
47602
47507
|
var serviceUtils = require_cfServicesUtil();
|
|
47603
|
-
function apiGetServicesInstancesFilteredByType(serviceTypes) {
|
|
47604
|
-
return
|
|
47605
|
-
return serviceUtils.getServicesInstancesFilteredByType(serviceTypes);
|
|
47606
|
-
});
|
|
47508
|
+
async function apiGetServicesInstancesFilteredByType(serviceTypes) {
|
|
47509
|
+
return serviceUtils.getServicesInstancesFilteredByType(serviceTypes);
|
|
47607
47510
|
}
|
|
47608
47511
|
exports2.apiGetServicesInstancesFilteredByType = apiGetServicesInstancesFilteredByType;
|
|
47609
|
-
function apiGetInstanceCredentials(instanceName) {
|
|
47610
|
-
return
|
|
47611
|
-
return serviceUtils.getInstanceCredentials(instanceName);
|
|
47612
|
-
});
|
|
47512
|
+
async function apiGetInstanceCredentials(instanceName) {
|
|
47513
|
+
return serviceUtils.getInstanceCredentials(instanceName);
|
|
47613
47514
|
}
|
|
47614
47515
|
exports2.apiGetInstanceCredentials = apiGetInstanceCredentials;
|
|
47615
|
-
function apiCreateServiceInstance(serviceType, servicePlan, instanceName, config) {
|
|
47616
|
-
return
|
|
47617
|
-
return serviceUtils.createServiceInstance(serviceType, servicePlan, instanceName, config);
|
|
47618
|
-
});
|
|
47516
|
+
async function apiCreateServiceInstance(serviceType, servicePlan, instanceName, config) {
|
|
47517
|
+
return serviceUtils.createServiceInstance(serviceType, servicePlan, instanceName, config);
|
|
47619
47518
|
}
|
|
47620
47519
|
exports2.apiCreateServiceInstance = apiCreateServiceInstance;
|
|
47621
|
-
function apiGetInstanceMetadata(instanceName) {
|
|
47622
|
-
return
|
|
47623
|
-
return serviceUtils.getInstanceMetadata(instanceName);
|
|
47624
|
-
});
|
|
47520
|
+
async function apiGetInstanceMetadata(instanceName) {
|
|
47521
|
+
return serviceUtils.getInstanceMetadata(instanceName);
|
|
47625
47522
|
}
|
|
47626
47523
|
exports2.apiGetInstanceMetadata = apiGetInstanceMetadata;
|
|
47627
47524
|
}
|
|
@@ -47641,87 +47538,12 @@ var require_app_studio_env = __commonJS({
|
|
|
47641
47538
|
}
|
|
47642
47539
|
});
|
|
47643
47540
|
|
|
47644
|
-
// ../../node_modules/@sap-ux/btp-utils/dist/app-studio.js
|
|
47645
|
-
var require_app_studio = __commonJS({
|
|
47646
|
-
"../../node_modules/@sap-ux/btp-utils/dist/app-studio.js"(exports2) {
|
|
47647
|
-
"use strict";
|
|
47648
|
-
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
47649
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
47650
|
-
};
|
|
47651
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47652
|
-
exports2.BAS_DEST_INSTANCE_CRED_HEADER = void 0;
|
|
47653
|
-
exports2.isAppStudio = isAppStudio;
|
|
47654
|
-
exports2.getAppStudioProxyURL = getAppStudioProxyURL;
|
|
47655
|
-
exports2.getAppStudioBaseURL = getAppStudioBaseURL;
|
|
47656
|
-
exports2.getCredentialsForDestinationService = getCredentialsForDestinationService;
|
|
47657
|
-
exports2.getDestinationUrlForAppStudio = getDestinationUrlForAppStudio;
|
|
47658
|
-
exports2.listDestinations = listDestinations;
|
|
47659
|
-
exports2.exposePort = exposePort;
|
|
47660
|
-
var axios_1 = __importDefault(require_axios());
|
|
47661
|
-
var cf_tools_1 = require_src5();
|
|
47662
|
-
var app_studio_env_1 = require_app_studio_env();
|
|
47663
|
-
exports2.BAS_DEST_INSTANCE_CRED_HEADER = "bas-destination-instance-cred";
|
|
47664
|
-
function isAppStudio() {
|
|
47665
|
-
return !!process.env[app_studio_env_1.ENV.H2O_URL];
|
|
47666
|
-
}
|
|
47667
|
-
function getAppStudioProxyURL() {
|
|
47668
|
-
return process.env[app_studio_env_1.ENV.PROXY_URL];
|
|
47669
|
-
}
|
|
47670
|
-
function getAppStudioBaseURL() {
|
|
47671
|
-
return process.env[app_studio_env_1.ENV.H2O_URL];
|
|
47672
|
-
}
|
|
47673
|
-
async function getCredentialsForDestinationService(instance) {
|
|
47674
|
-
var _a, _b;
|
|
47675
|
-
try {
|
|
47676
|
-
const serviceInfo = await (0, cf_tools_1.cfGetInstanceKeyParameters)(instance);
|
|
47677
|
-
if (!serviceInfo) {
|
|
47678
|
-
throw new Error(`No destination instance ${instance} found`);
|
|
47679
|
-
}
|
|
47680
|
-
const serviceCredentials = serviceInfo.credentials;
|
|
47681
|
-
if (!serviceCredentials) {
|
|
47682
|
-
throw new Error(`No credentials for destination instance ${instance} found`);
|
|
47683
|
-
}
|
|
47684
|
-
const clientId = ((_a = serviceCredentials.uaa) == null ? void 0 : _a.clientid) || serviceCredentials.clientid;
|
|
47685
|
-
const clientSecret = ((_b = serviceCredentials.uaa) == null ? void 0 : _b.clientsecret) || serviceCredentials.clientsecret;
|
|
47686
|
-
return Buffer.from(`${encodeURIComponent(clientId)}:${encodeURIComponent(clientSecret)}`).toString("base64");
|
|
47687
|
-
} catch (error2) {
|
|
47688
|
-
throw new Error(`An error occurred while retrieving service key for the destination instance ${instance}: ${error2}`);
|
|
47689
|
-
}
|
|
47690
|
-
}
|
|
47691
|
-
function getDestinationUrlForAppStudio(name, path) {
|
|
47692
|
-
const origin = `https://${name}.dest`;
|
|
47693
|
-
return path && path.length > 1 ? new URL(path, origin).toString() : origin;
|
|
47694
|
-
}
|
|
47695
|
-
async function listDestinations() {
|
|
47696
|
-
const destinations = {};
|
|
47697
|
-
await axios_1.default.get("/reload", { baseURL: process.env[app_studio_env_1.ENV.PROXY_URL] });
|
|
47698
|
-
const response = await axios_1.default.get("/api/listDestinations", { baseURL: process.env[app_studio_env_1.ENV.H2O_URL] });
|
|
47699
|
-
const list = Array.isArray(response.data) ? response.data : [];
|
|
47700
|
-
list.forEach((destination) => {
|
|
47701
|
-
if (destination.WebIDEEnabled) {
|
|
47702
|
-
destinations[destination.Name] = destination;
|
|
47703
|
-
}
|
|
47704
|
-
});
|
|
47705
|
-
return destinations;
|
|
47706
|
-
}
|
|
47707
|
-
async function exposePort(port, logger) {
|
|
47708
|
-
try {
|
|
47709
|
-
const response = await axios_1.default.get(`http://localhost:3001/AppStudio/api/getHostByPort?port=${port}`);
|
|
47710
|
-
return `${response.data.result}`;
|
|
47711
|
-
} catch (error2) {
|
|
47712
|
-
logger == null ? void 0 : logger.error(`Port ${port} was not exposed!`);
|
|
47713
|
-
return "";
|
|
47714
|
-
}
|
|
47715
|
-
}
|
|
47716
|
-
}
|
|
47717
|
-
});
|
|
47718
|
-
|
|
47719
47541
|
// ../../node_modules/@sap-ux/btp-utils/dist/destination.js
|
|
47720
47542
|
var require_destination = __commonJS({
|
|
47721
47543
|
"../../node_modules/@sap-ux/btp-utils/dist/destination.js"(exports2) {
|
|
47722
47544
|
"use strict";
|
|
47723
47545
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47724
|
-
exports2.DestinationProxyType = exports2.WebIDEAdditionalData = exports2.WebIDEUsage = exports2.ProxyType = exports2.Suffix = exports2.Authentication = void 0;
|
|
47546
|
+
exports2.AbapEnvType = exports2.DestinationProxyType = exports2.WebIDEAdditionalData = exports2.WebIDEUsage = exports2.ProxyType = exports2.Suffix = exports2.Authentication = void 0;
|
|
47725
47547
|
exports2.isAbapSystem = isAbapSystem;
|
|
47726
47548
|
exports2.isAbapEnvironmentOnBtp = isAbapEnvironmentOnBtp;
|
|
47727
47549
|
exports2.isGenericODataDestination = isGenericODataDestination;
|
|
@@ -47827,6 +47649,127 @@ var require_destination = __commonJS({
|
|
|
47827
47649
|
var _a;
|
|
47828
47650
|
return !!((_a = destination.WebIDEUsage) == null ? void 0 : _a.includes(WebIDEUsage.ODATA_ABAP));
|
|
47829
47651
|
}
|
|
47652
|
+
exports2.AbapEnvType = {
|
|
47653
|
+
/**
|
|
47654
|
+
* ABAP instance type
|
|
47655
|
+
*/
|
|
47656
|
+
ABAP: "abap",
|
|
47657
|
+
/**
|
|
47658
|
+
* ABAP trial instance type
|
|
47659
|
+
*/
|
|
47660
|
+
ABAP_TRIAL: "abap-trial",
|
|
47661
|
+
/**
|
|
47662
|
+
* ABAP CANARY trial instance type
|
|
47663
|
+
*/
|
|
47664
|
+
ABAP_CANARY: "abap-canary",
|
|
47665
|
+
/**
|
|
47666
|
+
* ABAP OEM instance type
|
|
47667
|
+
*/
|
|
47668
|
+
ABAP_OEM: "abap-oem",
|
|
47669
|
+
/**
|
|
47670
|
+
* ABAP OEM CANARY instance type
|
|
47671
|
+
*/
|
|
47672
|
+
ABAP_OEM_CANARY: "abap-oem-canary",
|
|
47673
|
+
/**
|
|
47674
|
+
* ABAP HAAS instance type
|
|
47675
|
+
*/
|
|
47676
|
+
ABAP_HAAS: "abap-haas",
|
|
47677
|
+
/**
|
|
47678
|
+
* Destination service instance type
|
|
47679
|
+
*/
|
|
47680
|
+
DESTINATION: "destination",
|
|
47681
|
+
/**
|
|
47682
|
+
* ABAP Staging service instance type
|
|
47683
|
+
*/
|
|
47684
|
+
ABAP_STAGING: "abap-staging",
|
|
47685
|
+
/**
|
|
47686
|
+
* ABAP Internal Staging service instance type
|
|
47687
|
+
*/
|
|
47688
|
+
ABAP_INTERNAL_STAGING: "abap-internal-staging"
|
|
47689
|
+
};
|
|
47690
|
+
}
|
|
47691
|
+
});
|
|
47692
|
+
|
|
47693
|
+
// ../../node_modules/@sap-ux/btp-utils/dist/app-studio.js
|
|
47694
|
+
var require_app_studio = __commonJS({
|
|
47695
|
+
"../../node_modules/@sap-ux/btp-utils/dist/app-studio.js"(exports2) {
|
|
47696
|
+
"use strict";
|
|
47697
|
+
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
47698
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
47699
|
+
};
|
|
47700
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47701
|
+
exports2.BAS_DEST_INSTANCE_CRED_HEADER = void 0;
|
|
47702
|
+
exports2.isAppStudio = isAppStudio;
|
|
47703
|
+
exports2.getAppStudioProxyURL = getAppStudioProxyURL;
|
|
47704
|
+
exports2.getAppStudioBaseURL = getAppStudioBaseURL;
|
|
47705
|
+
exports2.getCredentialsForDestinationService = getCredentialsForDestinationService;
|
|
47706
|
+
exports2.getDestinationUrlForAppStudio = getDestinationUrlForAppStudio;
|
|
47707
|
+
exports2.listDestinations = listDestinations;
|
|
47708
|
+
exports2.exposePort = exposePort;
|
|
47709
|
+
var axios_1 = __importDefault(require_axios());
|
|
47710
|
+
var cf_tools_1 = require_src5();
|
|
47711
|
+
var app_studio_env_1 = require_app_studio_env();
|
|
47712
|
+
var destination_1 = require_destination();
|
|
47713
|
+
exports2.BAS_DEST_INSTANCE_CRED_HEADER = "bas-destination-instance-cred";
|
|
47714
|
+
function isAppStudio() {
|
|
47715
|
+
return !!process.env[app_studio_env_1.ENV.H2O_URL];
|
|
47716
|
+
}
|
|
47717
|
+
function getAppStudioProxyURL() {
|
|
47718
|
+
return process.env[app_studio_env_1.ENV.PROXY_URL];
|
|
47719
|
+
}
|
|
47720
|
+
function getAppStudioBaseURL() {
|
|
47721
|
+
return process.env[app_studio_env_1.ENV.H2O_URL];
|
|
47722
|
+
}
|
|
47723
|
+
async function getCredentialsForDestinationService(instance) {
|
|
47724
|
+
var _a, _b;
|
|
47725
|
+
try {
|
|
47726
|
+
const serviceInfo = await (0, cf_tools_1.cfGetInstanceKeyParameters)(instance);
|
|
47727
|
+
if (!serviceInfo) {
|
|
47728
|
+
throw new Error(`No destination instance ${instance} found`);
|
|
47729
|
+
}
|
|
47730
|
+
const serviceCredentials = serviceInfo.credentials;
|
|
47731
|
+
if (!serviceCredentials) {
|
|
47732
|
+
throw new Error(`No credentials for destination instance ${instance} found`);
|
|
47733
|
+
}
|
|
47734
|
+
const clientId = ((_a = serviceCredentials.uaa) == null ? void 0 : _a.clientid) || serviceCredentials.clientid;
|
|
47735
|
+
const clientSecret = ((_b = serviceCredentials.uaa) == null ? void 0 : _b.clientsecret) || serviceCredentials.clientsecret;
|
|
47736
|
+
return Buffer.from(`${encodeURIComponent(clientId)}:${encodeURIComponent(clientSecret)}`).toString("base64");
|
|
47737
|
+
} catch (error2) {
|
|
47738
|
+
throw new Error(`An error occurred while retrieving service key for the destination instance ${instance}: ${error2}`);
|
|
47739
|
+
}
|
|
47740
|
+
}
|
|
47741
|
+
function getDestinationUrlForAppStudio(name, path) {
|
|
47742
|
+
const origin = `https://${name}.dest`;
|
|
47743
|
+
return path && path.length > 1 ? new URL(path, origin).toString() : origin;
|
|
47744
|
+
}
|
|
47745
|
+
function stripS4HCApiHost(host) {
|
|
47746
|
+
const [first, ...rest] = host.split(".");
|
|
47747
|
+
return [first.replace(/-api$/, ""), ...rest].join(".");
|
|
47748
|
+
}
|
|
47749
|
+
async function listDestinations(options) {
|
|
47750
|
+
const destinations = {};
|
|
47751
|
+
await axios_1.default.get("/reload", { baseURL: process.env[app_studio_env_1.ENV.PROXY_URL] });
|
|
47752
|
+
const response = await axios_1.default.get("/api/listDestinations", { baseURL: process.env[app_studio_env_1.ENV.H2O_URL] });
|
|
47753
|
+
const list = Array.isArray(response.data) ? response.data : [];
|
|
47754
|
+
list.forEach((destination) => {
|
|
47755
|
+
if ((options == null ? void 0 : options.stripS4HCApiHosts) && (0, destination_1.isS4HC)(destination)) {
|
|
47756
|
+
destination.Host = stripS4HCApiHost(destination.Host);
|
|
47757
|
+
}
|
|
47758
|
+
if (destination.WebIDEEnabled) {
|
|
47759
|
+
destinations[destination.Name] = destination;
|
|
47760
|
+
}
|
|
47761
|
+
});
|
|
47762
|
+
return destinations;
|
|
47763
|
+
}
|
|
47764
|
+
async function exposePort(port, logger) {
|
|
47765
|
+
try {
|
|
47766
|
+
const response = await axios_1.default.get(`http://localhost:3001/AppStudio/api/getHostByPort?port=${port}`);
|
|
47767
|
+
return `${response.data.result}`;
|
|
47768
|
+
} catch (error2) {
|
|
47769
|
+
logger == null ? void 0 : logger.error(`Port ${port} was not exposed!`);
|
|
47770
|
+
return "";
|
|
47771
|
+
}
|
|
47772
|
+
}
|
|
47830
47773
|
}
|
|
47831
47774
|
});
|
|
47832
47775
|
|
|
@@ -47942,7 +47885,7 @@ var require_livereload = __commonJS({
|
|
|
47942
47885
|
if (fileExtension === ".appdescr_variant") {
|
|
47943
47886
|
global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ = true;
|
|
47944
47887
|
} else if (fileExtension === ".change") {
|
|
47945
|
-
if (path.endsWith("appdescr_fe_changePageConfiguration.change") || path.endsWith("appdescr_ui_generic_app_changePageConfiguration.change")) {
|
|
47888
|
+
if (path.endsWith("appdescr_fe_changePageConfiguration.change") || path.endsWith("appdescr_ui_generic_app_changePageConfiguration.change") || path.endsWith("appdescr_ui_gen_app_changePageConfig.change") || path.endsWith("appdescr_app_addAnnotationsToOData.change")) {
|
|
47946
47889
|
global.__SAP_UX_MANIFEST_SYNC_REQUIRED__ = true;
|
|
47947
47890
|
}
|
|
47948
47891
|
}
|