@esri/solution-velocity 4.1.0 → 4.1.2-alpha.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.
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2021 Esri
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports._templatizeDatasources = exports._templatizeFeed = exports._templatizeFeeds = exports._templatize = exports.templatizeVelocity = void 0;
19
+ const solution_common_1 = require("@esri/solution-common");
20
+ /**
21
+ * Updates the template by adding variables for key properties that will
22
+ * need to be swapped when deploying
23
+ *
24
+ * @param template velocity item info that should be templatized
25
+ *
26
+ * @returns void
27
+ *
28
+ */
29
+ function templatizeVelocity(template) {
30
+ _templatize(template, "data.sources", _templatizeDatasources);
31
+ _templatize(template, "data.feeds", _templatizeFeeds);
32
+ _templatize(template, "data.feed", _templatizeFeed);
33
+ }
34
+ exports.templatizeVelocity = templatizeVelocity;
35
+ /**
36
+ * Generic wrapper for the templatize functions that
37
+ * will get and set the key properties
38
+ *
39
+ * @param template velocity item info that should be templatized
40
+ * @param prop the prop path to evaluate and set with a templatized variable
41
+ * @param fn the templatize function that should be called for this prop
42
+ *
43
+ * @returns void
44
+ *
45
+ * @private
46
+ */
47
+ function _templatize(template, prop, fn) {
48
+ const obj = (0, solution_common_1.getProp)(template, prop);
49
+ /* istanbul ignore else */
50
+ if (obj) {
51
+ (0, solution_common_1.setProp)(template, prop, fn(obj));
52
+ }
53
+ }
54
+ exports._templatize = _templatize;
55
+ /**
56
+ * Updates the template by adding variables for the itemId and the label
57
+ * The label controls the name and must be unique for the org.
58
+ *
59
+ * @param feeds array of velocity feeds that should be templatized
60
+ *
61
+ * @returns The updated list of feed objects with templatized id and label
62
+ *
63
+ * @private
64
+ */
65
+ function _templatizeFeeds(feeds) {
66
+ return feeds.map((feed) => {
67
+ feed.label = feed.label && feed.id ? `{{${feed.id}.label}}` : feed.label;
68
+ feed.id = feed.id ? `{{${feed.id}.itemId}}` : feed.id;
69
+ return feed;
70
+ });
71
+ }
72
+ exports._templatizeFeeds = _templatizeFeeds;
73
+ /**
74
+ * Updates the portal item id and feature layer id variables for the feed properties.
75
+ *
76
+ * @param feed the feed object from the item
77
+ *
78
+ * @returns the updated feed object with templatized portalItemId and layer id
79
+ *
80
+ * @private
81
+ */
82
+ function _templatizeFeed(feed) {
83
+ let id = (0, solution_common_1.getProp)(feed, "properties.feature-layer.portalItemId");
84
+ /* istanbul ignore else */
85
+ if (feed.properties) {
86
+ /* istanbul ignore else */
87
+ if (feed.properties["feature-layer.portalItemId"]) {
88
+ id = feed.properties["feature-layer.portalItemId"];
89
+ feed.properties["feature-layer.portalItemId"] = `{{${id}.itemId}}`;
90
+ }
91
+ /* istanbul ignore else */
92
+ if (id && feed.properties.hasOwnProperty("feature-layer.layerId")) {
93
+ const flId = feed.properties["feature-layer.layerId"];
94
+ feed.properties["feature-layer.layerId"] = `{{${id}.layer${flId}.layerId}}`;
95
+ }
96
+ }
97
+ return feed;
98
+ }
99
+ exports._templatizeFeed = _templatizeFeed;
100
+ /**
101
+ * Velocity datasources share the same props as feeds so they can leverage
102
+ * the same templatize function
103
+ *
104
+ * @param dataSources array of data sources from the item
105
+ *
106
+ * @returns the updated dataSources object with templatized ids and labels
107
+ *
108
+ * @private
109
+ */
110
+ function _templatizeDatasources(dataSources) {
111
+ return dataSources.map((ds) => _templatizeFeed(ds));
112
+ }
113
+ exports._templatizeDatasources = _templatizeDatasources;
114
+ //# sourceMappingURL=velocity-templatize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"velocity-templatize.js","sourceRoot":"","sources":["../../../src/helpers/velocity-templatize.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAAwE;AAExE;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CAAC,QAAuB;IACxD,WAAW,CAAC,QAAQ,EAAE,cAAc,EAAE,sBAAsB,CAAC,CAAC;IAC9D,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;IACtD,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAJD,gDAIC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,WAAW,CACzB,QAAuB,EACvB,IAAY,EACZ,EAAsB;IAEtB,MAAM,GAAG,GAAQ,IAAA,yBAAO,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACzC,0BAA0B;IAC1B,IAAI,GAAG,EAAE;QACP,IAAA,yBAAO,EAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAClC;AACH,CAAC;AAVD,kCAUC;AAED;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAAC,KAAY;IAC3C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;QACzE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAND,4CAMC;AAED;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,IAAS;IACvC,IAAI,EAAE,GAAG,IAAA,yBAAO,EAAC,IAAI,EAAE,uCAAuC,CAAC,CAAC;IAChE,0BAA0B;IAC1B,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC,EAAE;YACjD,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC;YACnD,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC;SACpE;QACD,0BAA0B;QAC1B,IAAI,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,uBAAuB,CAAC,EAAE;YACjE,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;YACtD,IAAI,CAAC,UAAU,CACb,uBAAuB,CACxB,GAAG,KAAK,EAAE,SAAS,IAAI,YAAY,CAAC;SACtC;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAlBD,0CAkBC;AAED;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CAAC,WAAkB;IACvD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,EAAO,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAFD,wDAEC"}
@@ -0,0 +1,17 @@
1
+ /** @license
2
+ * Copyright 2021 Esri
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import * as VelocityProcessor from "./velocity-processor";
17
+ export { VelocityProcessor };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2021 Esri
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.VelocityProcessor = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const VelocityProcessor = tslib_1.__importStar(require("./velocity-processor"));
21
+ exports.VelocityProcessor = VelocityProcessor;
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,gFAA0D;AAEjD,8CAAiB"}
@@ -0,0 +1,61 @@
1
+ /** @license
2
+ * Copyright 2021 Esri
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Manages the creation and deployment of velocity item types.
18
+ *
19
+ * @module velocity
20
+ */
21
+ import { UserSession, IItemProgressCallback, IItemTemplate, ICreateItemFromTemplateResponse } from "@esri/solution-common";
22
+ /**
23
+ * Convert a Velocity item into a Template
24
+ *
25
+ * @param solutionItemId The solution to contain the item
26
+ * @param itemInfo The basic item info
27
+ * @param destAuthentication Credentials for requests to the destination organization
28
+ * @param srcAuthentication Credentials for requests to source items
29
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
30
+ *
31
+ * @returns a promise that will resolve the constructed IItemTemplate from the input itemInfo
32
+ *
33
+ */
34
+ export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
35
+ /**
36
+ * Create Velocity analytics and feeds from a Template
37
+ *
38
+ * @param template The template for the volocity items
39
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
40
+ * @param destinationAuthentication Credentials for the deployment requests
41
+ * @param itemProgressCallback Function for reporting progress updates from type-specific template handlers
42
+ *
43
+ * @returns a promise that will resolve with the new item info, id, type, and postProcess flag
44
+ *
45
+ */
46
+ export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
47
+ /**
48
+ * Velocity post-processing actions
49
+ *
50
+ * Move all velocity items to the deployment folder.
51
+ *
52
+ * @param {string} itemId The item ID
53
+ * @param {string} type The template type
54
+ * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
55
+ * @param {IItemTemplate} template The item template
56
+ * @param {IItemTemplate[]} templates The full collection of item templates
57
+ * @param {any} templateDictionary Hash of facts such as the folder id for the deployment
58
+ * @param {UserSession} authentication The destination session info
59
+ * @returns Promise resolving to successfulness of update
60
+ */
61
+ export declare function postProcess(itemId: string, type: string, itemInfos: any[], template: IItemTemplate, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<any>;
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2021 Esri
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.postProcess = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
19
+ /**
20
+ * Manages the creation and deployment of velocity item types.
21
+ *
22
+ * @module velocity
23
+ */
24
+ const solution_common_1 = require("@esri/solution-common");
25
+ const velocity_templatize_1 = require("./helpers/velocity-templatize");
26
+ const get_velocity_dependencies_1 = require("./helpers/get-velocity-dependencies");
27
+ const velocity_helpers_1 = require("./helpers/velocity-helpers");
28
+ const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
29
+ /**
30
+ * Convert a Velocity item into a Template
31
+ *
32
+ * @param solutionItemId The solution to contain the item
33
+ * @param itemInfo The basic item info
34
+ * @param destAuthentication Credentials for requests to the destination organization
35
+ * @param srcAuthentication Credentials for requests to source items
36
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
37
+ *
38
+ * @returns a promise that will resolve the constructed IItemTemplate from the input itemInfo
39
+ *
40
+ */
41
+ function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
42
+ const template = (0, solution_common_1.createInitializedItemTemplate)(itemInfo);
43
+ return (0, velocity_helpers_1.getVelocityUrl)(srcAuthentication, templateDictionary, itemInfo.type, itemInfo.id).then((url) => {
44
+ if (url) {
45
+ return fetch(url)
46
+ .then(data => data.json())
47
+ .then(data_json => {
48
+ template.item.title = data_json.label;
49
+ template.data = data_json;
50
+ return (0, get_velocity_dependencies_1.getVelocityDependencies)(template, srcAuthentication).then(deps => {
51
+ template.dependencies = deps;
52
+ (0, velocity_helpers_1.cleanDataSourcesAndFeeds)(template, templateDictionary.velocityUrl);
53
+ (0, velocity_templatize_1.templatizeVelocity)(template);
54
+ template.item = (0, solution_common_1.updateVelocityReferences)(template.item, template.type, templateDictionary);
55
+ return Promise.resolve(template);
56
+ });
57
+ });
58
+ }
59
+ else {
60
+ // In case the org used to have velocity and they still have items
61
+ return Promise.reject("Velocity NOT Supported by Organization");
62
+ }
63
+ }, e => Promise.reject((0, solution_common_1.fail)(e)));
64
+ }
65
+ exports.convertItemToTemplate = convertItemToTemplate;
66
+ /**
67
+ * Create Velocity analytics and feeds from a Template
68
+ *
69
+ * @param template The template for the volocity items
70
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
71
+ * @param destinationAuthentication Credentials for the deployment requests
72
+ * @param itemProgressCallback Function for reporting progress updates from type-specific template handlers
73
+ *
74
+ * @returns a promise that will resolve with the new item info, id, type, and postProcess flag
75
+ *
76
+ */
77
+ function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
78
+ // let the progress system know we've started...
79
+ const startStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Started, 0);
80
+ // and if it returned false, just resolve out
81
+ /* istanbul ignore else */
82
+ if (!startStatus) {
83
+ return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
84
+ }
85
+ const orgId = template.itemId;
86
+ return (0, velocity_helpers_1.postVelocityData)(destinationAuthentication, template, template.data, templateDictionary).then(result => {
87
+ const finalStatus = itemProgressCallback(orgId, solution_common_1.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor || 2, result.id);
88
+ if (!finalStatus) {
89
+ return (0, solution_common_1.removeItem)(result.id, destinationAuthentication).then(() => Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type)), () => Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type)));
90
+ }
91
+ else {
92
+ const response = {
93
+ item: {
94
+ ...template,
95
+ ...result
96
+ },
97
+ id: result.item.id,
98
+ type: template.type,
99
+ postProcess: true
100
+ };
101
+ response.item.itemId = result.item.id;
102
+ return response;
103
+ }
104
+ });
105
+ }
106
+ exports.createItemFromTemplate = createItemFromTemplate;
107
+ /**
108
+ * Velocity post-processing actions
109
+ *
110
+ * Move all velocity items to the deployment folder.
111
+ *
112
+ * @param {string} itemId The item ID
113
+ * @param {string} type The template type
114
+ * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
115
+ * @param {IItemTemplate} template The item template
116
+ * @param {IItemTemplate[]} templates The full collection of item templates
117
+ * @param {any} templateDictionary Hash of facts such as the folder id for the deployment
118
+ * @param {UserSession} authentication The destination session info
119
+ * @returns Promise resolving to successfulness of update
120
+ */
121
+ function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
122
+ const itemUpdate = itemInfos.filter(ii => ii.id === itemId);
123
+ const item = itemUpdate[0].item.item;
124
+ delete item.url;
125
+ delete item.origUrl;
126
+ return (0, solution_common_1.updateItem)(item, authentication).then(() => {
127
+ return (0, arcgis_rest_portal_1.moveItem)({
128
+ owner: authentication.username,
129
+ itemId,
130
+ folderId: templateDictionary.folderId,
131
+ authentication
132
+ });
133
+ });
134
+ }
135
+ exports.postProcess = postProcess;
136
+ //# sourceMappingURL=velocity-processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"velocity-processor.js","sourceRoot":"","sources":["../../src/velocity-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,2DAY+B;AAC/B,uEAAmE;AACnE,mFAA8E;AAC9E,iEAIoC;AACpC,iEAEkC;AAElC;;;;;;;;;;;GAWG;AACH,SAAgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAA+B,EAC/B,iBAA8B,EAC9B,kBAAuB;IAEvB,MAAM,QAAQ,GAAG,IAAA,+CAA6B,EAAC,QAAQ,CAAC,CAAC;IACzD,OAAO,IAAA,iCAAc,EACnB,iBAAiB,EACjB,kBAA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CAAC;SACjB;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AArDD,wDAqDC;AAGD;;;;;;;;;;;;;GAaG;AACF,SAAgB,WAAW,CAC1B,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAAuB,EACvB,SAA0B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1C,OAAO,IAAI,CAAC,GAAG,CAAC;IAChB,OAAO,IAAI,CAAC,OAAO,CAAC;IACnB,OAAO,IAAA,4BAAU,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QAChD,OAAO,IAAA,6BAAQ,EAAC;YACd,KAAK,EAAE,cAAc,CAAC,QAAQ;YAC9B,MAAM;YACN,QAAQ,EAAE,kBAAkB,CAAC,QAAQ;YACrC,cAAc;SACf,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACN,CAAC;AArBA,kCAqBA"}
package/package.json CHANGED
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "name": "@esri/solution-velocity",
3
- "version": "4.1.0",
3
+ "version": "4.1.2-alpha.0",
4
4
  "description": "Manages the creation and deployment of Velocity item types for @esri/solution.js.",
5
- "main": "dist/node/index.js",
6
- "unpkg": "dist/umd/velocity.umd.min.js",
5
+ "main": "dist/cjs/index.js",
7
6
  "module": "dist/esm/index.js",
8
- "js:next": "dist/esm/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/esm/index.js",
10
+ "require": "./dist/cjs/index.js"
11
+ },
12
+ "./package.json": "./package.json"
13
+ },
9
14
  "types": "dist/esm/index.d.ts",
10
15
  "author": "Esri",
11
16
  "license": "Apache-2.0",
@@ -22,17 +27,23 @@
22
27
  "@esri/hub-initiatives": "^13.0.0",
23
28
  "@esri/hub-sites": "^13.0.1",
24
29
  "@esri/hub-teams": "^13.0.0",
25
- "@esri/solution-common": "^4.1.0",
26
- "@esri/solution-simple-types": "^4.1.0",
30
+ "@esri/solution-common": "^4.1.2-alpha.0",
31
+ "@esri/solution-simple-types": "^4.1.2-alpha.0",
27
32
  "rollup": "2.79.1"
28
33
  },
29
34
  "dependencies": {
30
35
  "tslib": "1.14.1"
31
36
  },
32
37
  "scripts": {
33
- "prepare": "npm run build",
34
- "build": "tsc -p ./tsconfig.json --module esnext --outDir ./dist/esm --declaration",
35
- "build:dev": "tsc -w --module esnext --outDir ./dist/esm --declaration",
38
+ "build": "npm-run-all --parallel build:*",
39
+ "postbuild": "node ../../scripts/create-dist-package-jsons.mjs",
40
+ "build:cjs": "tsc --outDir ./dist/cjs -m commonjs",
41
+ "postbuild:cjs": "node ../../scripts/create-dist-package-jsons.mjs",
42
+ "build:esm": "tsc --outDir ./dist/esm --declaration",
43
+ "postbuild:esm": "node ../../scripts/create-dist-package-jsons.mjs",
44
+ "dev": "npm-run-all --parallel dev:*",
45
+ "dev:cjs": "tsc -w --outDir ./dist/cjs -m commonjs",
46
+ "dev:esm": "tsc -w --outDir ./dist/esm --declaration",
36
47
  "getupdates": "npm-check-updates --upgrade"
37
48
  },
38
49
  "publishConfig": {
@@ -68,5 +79,5 @@
68
79
  "esri",
69
80
  "ES6"
70
81
  ],
71
- "gitHead": "91d7d92d8a58800d1e2ab18b7365981ee96903b4"
82
+ "gitHead": "9740175be347ee23b5b788eda6e369b948d907fe"
72
83
  }