@esri/solution-deployer 6.6.1-next.5 → 6.6.1-next.50

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.
@@ -39,6 +39,14 @@ export declare function _addSourceId(templates: common.IItemTemplate[]): common.
39
39
  * @private
40
40
  */
41
41
  export declare function _applySourceToDeployOptions(deployOptions: common.IDeploySolutionOptions, solutionTemplateBase: any, templateDictionary: any, authentication: common.UserSession): common.IDeploySolutionOptions;
42
+ /**
43
+ * Update the custom parameters in template base
44
+ *
45
+ * @param solutionTemplateBase the item base to replace
46
+ * @param templateDictionary the template with substitution values
47
+ * @private
48
+ */
49
+ export declare function _replaceBaseParamVariables(solutionTemplateBase: any, templateDictionary: any): any;
42
50
  export declare function _replaceParamVariables(solutionTemplateData: any, templateDictionary: any): void;
43
51
  export declare function _updateProp(template: common.IItemTemplate, path: string, lookup: string, templateDictionary: any): common.IItemTemplate;
44
52
  export declare function _checkedReplaceAll(template: string, oldValue: string, newValue: string): string;
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports._getNewItemId = exports._purgeTemplateProperties = exports._updateGroupReferences = exports._getPortalBaseUrl = exports._checkedReplaceAll = exports._updateProp = exports._replaceParamVariables = exports._applySourceToDeployOptions = exports._addSourceId = exports._handleWorkflowManagedTemplates = exports.deploySolutionFromTemplate = void 0;
18
+ exports._getNewItemId = exports._purgeTemplateProperties = exports._updateGroupReferences = exports._getPortalBaseUrl = exports._checkedReplaceAll = exports._updateProp = exports._replaceParamVariables = exports._replaceBaseParamVariables = exports._applySourceToDeployOptions = exports._addSourceId = exports._handleWorkflowManagedTemplates = exports.deploySolutionFromTemplate = void 0;
19
19
  const tslib_1 = require("tslib");
20
20
  const common = tslib_1.__importStar(require("@esri/solution-common"));
21
21
  const deployItems = tslib_1.__importStar(require("./deploySolutionItems"));
@@ -62,6 +62,7 @@ async function deploySolutionFromTemplate(templateSolutionId, solutionTemplateBa
62
62
  // Fetch the thumbnail
63
63
  thumbDef = common.getBlobAsFile(thumbnailurl, thumbFilename, storageAuthentication, [400]);
64
64
  }
65
+ solutionTemplateBase = _replaceBaseParamVariables(solutionTemplateBase, templateDictionary);
65
66
  _replaceParamVariables(solutionTemplateData, templateDictionary);
66
67
  // Get information about deployment environment
67
68
  const environResponses = await Promise.all([
@@ -176,6 +177,10 @@ async function deploySolutionFromTemplate(templateSolutionId, solutionTemplateBa
176
177
  if (iTemplateKeyword >= 0) {
177
178
  solutionTemplateBase.typeKeywords.splice(iTemplateKeyword, 1);
178
179
  }
180
+ const iBuildKeyword = solutionTemplateBase.typeKeywords.indexOf("Build");
181
+ if (iBuildKeyword >= 0) {
182
+ solutionTemplateBase.typeKeywords.splice(iBuildKeyword, 1);
183
+ }
179
184
  solutionTemplateData.templates = solutionTemplateData.templates.map((itemTemplate) => _purgeTemplateProperties(itemTemplate));
180
185
  _handleWorkflowManagedTemplates(preProcessResponse, solutionTemplateData);
181
186
  solutionTemplateData.templates = _updateGroupReferences(solutionTemplateData.templates, templateDictionary);
@@ -252,6 +257,20 @@ function _applySourceToDeployOptions(deployOptions, solutionTemplateBase, templa
252
257
  return deployOptions;
253
258
  }
254
259
  exports._applySourceToDeployOptions = _applySourceToDeployOptions;
260
+ /**
261
+ * Update the custom parameters in template base
262
+ *
263
+ * @param solutionTemplateBase the item base to replace
264
+ * @param templateDictionary the template with substitution values
265
+ * @private
266
+ */
267
+ function _replaceBaseParamVariables(solutionTemplateBase, templateDictionary) {
268
+ // a custom params object can be passed in with the options to deploy a solution
269
+ // to replace parameters in the based such has title, description and tags
270
+ solutionTemplateBase = common.replaceInTemplate(solutionTemplateBase, templateDictionary);
271
+ return solutionTemplateBase;
272
+ }
273
+ exports._replaceBaseParamVariables = _replaceBaseParamVariables;
255
274
  //TODO: function doc
256
275
  function _replaceParamVariables(solutionTemplateData, templateDictionary) {
257
276
  // a custom params object can be passed in with the options to deploy a solution
@@ -104,7 +104,8 @@ function isSolutionTemplateItem(item) {
104
104
  // Solution items
105
105
  let result = false;
106
106
  if (item.type === "Solution") {
107
- if (kwds.indexOf("Solution") > -1 && (kwds.indexOf("Template") > -1 || kwds.indexOf("solutionTemplate") > -1)) {
107
+ if (kwds.indexOf("Solution") > -1 &&
108
+ (kwds.indexOf("Template") > -1 || kwds.indexOf("solutionTemplate") > -1 || kwds.indexOf("Build") > -1)) {
108
109
  result = true;
109
110
  }
110
111
  }
@@ -39,6 +39,14 @@ export declare function _addSourceId(templates: common.IItemTemplate[]): common.
39
39
  * @private
40
40
  */
41
41
  export declare function _applySourceToDeployOptions(deployOptions: common.IDeploySolutionOptions, solutionTemplateBase: any, templateDictionary: any, authentication: common.UserSession): common.IDeploySolutionOptions;
42
+ /**
43
+ * Update the custom parameters in template base
44
+ *
45
+ * @param solutionTemplateBase the item base to replace
46
+ * @param templateDictionary the template with substitution values
47
+ * @private
48
+ */
49
+ export declare function _replaceBaseParamVariables(solutionTemplateBase: any, templateDictionary: any): any;
42
50
  export declare function _replaceParamVariables(solutionTemplateData: any, templateDictionary: any): void;
43
51
  export declare function _updateProp(template: common.IItemTemplate, path: string, lookup: string, templateDictionary: any): common.IItemTemplate;
44
52
  export declare function _checkedReplaceAll(template: string, oldValue: string, newValue: string): string;
@@ -58,6 +58,7 @@ export async function deploySolutionFromTemplate(templateSolutionId, solutionTem
58
58
  // Fetch the thumbnail
59
59
  thumbDef = common.getBlobAsFile(thumbnailurl, thumbFilename, storageAuthentication, [400]);
60
60
  }
61
+ solutionTemplateBase = _replaceBaseParamVariables(solutionTemplateBase, templateDictionary);
61
62
  _replaceParamVariables(solutionTemplateData, templateDictionary);
62
63
  // Get information about deployment environment
63
64
  const environResponses = await Promise.all([
@@ -172,6 +173,10 @@ export async function deploySolutionFromTemplate(templateSolutionId, solutionTem
172
173
  if (iTemplateKeyword >= 0) {
173
174
  solutionTemplateBase.typeKeywords.splice(iTemplateKeyword, 1);
174
175
  }
176
+ const iBuildKeyword = solutionTemplateBase.typeKeywords.indexOf("Build");
177
+ if (iBuildKeyword >= 0) {
178
+ solutionTemplateBase.typeKeywords.splice(iBuildKeyword, 1);
179
+ }
175
180
  solutionTemplateData.templates = solutionTemplateData.templates.map((itemTemplate) => _purgeTemplateProperties(itemTemplate));
176
181
  _handleWorkflowManagedTemplates(preProcessResponse, solutionTemplateData);
177
182
  solutionTemplateData.templates = _updateGroupReferences(solutionTemplateData.templates, templateDictionary);
@@ -244,6 +249,19 @@ export function _applySourceToDeployOptions(deployOptions, solutionTemplateBase,
244
249
  }
245
250
  return deployOptions;
246
251
  }
252
+ /**
253
+ * Update the custom parameters in template base
254
+ *
255
+ * @param solutionTemplateBase the item base to replace
256
+ * @param templateDictionary the template with substitution values
257
+ * @private
258
+ */
259
+ export function _replaceBaseParamVariables(solutionTemplateBase, templateDictionary) {
260
+ // a custom params object can be passed in with the options to deploy a solution
261
+ // to replace parameters in the based such has title, description and tags
262
+ solutionTemplateBase = common.replaceInTemplate(solutionTemplateBase, templateDictionary);
263
+ return solutionTemplateBase;
264
+ }
247
265
  //TODO: function doc
248
266
  export function _replaceParamVariables(solutionTemplateData, templateDictionary) {
249
267
  // a custom params object can be passed in with the options to deploy a solution
@@ -97,7 +97,8 @@ export function isSolutionTemplateItem(item) {
97
97
  // Solution items
98
98
  let result = false;
99
99
  if (item.type === "Solution") {
100
- if (kwds.indexOf("Solution") > -1 && (kwds.indexOf("Template") > -1 || kwds.indexOf("solutionTemplate") > -1)) {
100
+ if (kwds.indexOf("Solution") > -1 &&
101
+ (kwds.indexOf("Template") > -1 || kwds.indexOf("solutionTemplate") > -1 || kwds.indexOf("Build") > -1)) {
101
102
  result = true;
102
103
  }
103
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solution-deployer",
3
- "version": "6.6.1-next.5",
3
+ "version": "6.6.1-next.50",
4
4
  "description": "Manages the deployment of a Solution for @esri/solution.js.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -24,28 +24,28 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@esri/hub-common": "^17.0.2",
27
- "@esri/solution-common": "^6.6.1-next.5",
28
- "@esri/solution-feature-layer": "^6.6.1-next.5",
29
- "@esri/solution-file": "^6.6.1-next.5",
30
- "@esri/solution-form": "^6.6.1-next.5",
31
- "@esri/solution-group": "^6.6.1-next.5",
32
- "@esri/solution-hub-types": "^6.6.1-next.5",
33
- "@esri/solution-simple-types": "^6.6.1-next.5",
34
- "@esri/solution-storymap": "^6.6.1-next.5",
35
- "@esri/solution-velocity": "^6.6.1-next.5",
36
- "@esri/solution-web-experience": "^6.6.1-next.5",
37
- "@esri/solution-web-tool": "^6.6.1-next.5",
38
- "@esri/solution-workflow": "^6.6.1-next.5",
27
+ "@esri/solution-common": "^6.6.1-next.50",
28
+ "@esri/solution-feature-layer": "^6.6.1-next.50",
29
+ "@esri/solution-file": "^6.6.1-next.50",
30
+ "@esri/solution-form": "^6.6.1-next.50",
31
+ "@esri/solution-group": "^6.6.1-next.50",
32
+ "@esri/solution-hub-types": "^6.6.1-next.50",
33
+ "@esri/solution-simple-types": "^6.6.1-next.50",
34
+ "@esri/solution-storymap": "^6.6.1-next.50",
35
+ "@esri/solution-velocity": "^6.6.1-next.50",
36
+ "@esri/solution-web-experience": "^6.6.1-next.50",
37
+ "@esri/solution-web-tool": "^6.6.1-next.50",
38
+ "@esri/solution-workflow": "^6.6.1-next.50",
39
39
  "tslib": "1.14.1"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "npm-run-all --parallel build:*",
43
- "build:cjs": "tsc --outDir ./dist/cjs -m commonjs",
43
+ "build:cjs": "tsc --outDir ./dist/cjs -m commonjs --moduleResolution node",
44
44
  "postbuild:cjs": "node ../../scripts/create-dist-package-jsons.mjs",
45
45
  "build:esm": "tsc --outDir ./dist/esm --declaration",
46
46
  "postbuild:esm": "node ../../scripts/create-dist-package-jsons.mjs",
47
47
  "dev": "npm-run-all --parallel dev:*",
48
- "dev:cjs": "tsc -w --outDir ./dist/cjs -m commonjs",
48
+ "dev:cjs": "tsc -w --outDir ./dist/cjs -m commonjs --moduleResolution node",
49
49
  "dev:esm": "tsc -w --outDir ./dist/esm --declaration",
50
50
  "getupdates": "npm-check-updates --upgrade"
51
51
  },
@@ -90,5 +90,5 @@
90
90
  "esri",
91
91
  "ES6"
92
92
  ],
93
- "gitHead": "ff40b6693f9ff51ffc1e6d35dc3e4a90c8b72dcc"
93
+ "gitHead": "f7b95e868f625922e508b8413ef31f84e3c536d7"
94
94
  }