@esri/solution-simple-types 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/helpers/convert-item-to-template.js +1 -0
- package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
- package/dist/esm/webmap.js +6 -5
- package/dist/esm/webmap.js.map +1 -1
- package/package.json +7 -7
- package/dist/node/dashboard.d.ts +0 -93
- package/dist/node/dashboard.js +0 -354
- package/dist/node/dashboard.js.map +0 -1
- package/dist/node/helpers/convert-item-to-template.d.ts +0 -39
- package/dist/node/helpers/convert-item-to-template.js +0 -184
- package/dist/node/helpers/convert-item-to-template.js.map +0 -1
- package/dist/node/helpers/create-item-from-template.d.ts +0 -17
- package/dist/node/helpers/create-item-from-template.js +0 -138
- package/dist/node/helpers/create-item-from-template.js.map +0 -1
- package/dist/node/helpers/notebook-helpers.d.ts +0 -19
- package/dist/node/helpers/notebook-helpers.js +0 -25
- package/dist/node/helpers/notebook-helpers.js.map +0 -1
- package/dist/node/helpers/quickcapture-helpers.d.ts +0 -18
- package/dist/node/helpers/quickcapture-helpers.js +0 -23
- package/dist/node/helpers/quickcapture-helpers.js.map +0 -1
- package/dist/node/helpers/simple-type-helpers.d.ts +0 -18
- package/dist/node/helpers/simple-type-helpers.js +0 -23
- package/dist/node/helpers/simple-type-helpers.js.map +0 -1
- package/dist/node/helpers/update-notebook-data.d.ts +0 -17
- package/dist/node/helpers/update-notebook-data.js +0 -28
- package/dist/node/helpers/update-notebook-data.js.map +0 -1
- package/dist/node/index.d.ts +0 -27
- package/dist/node/index.js +0 -37
- package/dist/node/index.js.map +0 -1
- package/dist/node/notebook.d.ts +0 -66
- package/dist/node/notebook.js +0 -134
- package/dist/node/notebook.js.map +0 -1
- package/dist/node/oic.d.ts +0 -53
- package/dist/node/oic.js +0 -171
- package/dist/node/oic.js.map +0 -1
- package/dist/node/quickcapture.d.ts +0 -87
- package/dist/node/quickcapture.js +0 -193
- package/dist/node/quickcapture.js.map +0 -1
- package/dist/node/simple-types.d.ts +0 -57
- package/dist/node/simple-types.js +0 -95
- package/dist/node/simple-types.js.map +0 -1
- package/dist/node/webmap.d.ts +0 -101
- package/dist/node/webmap.js +0 -273
- package/dist/node/webmap.js.map +0 -1
- package/dist/node/webmappingapplication.d.ts +0 -176
- package/dist/node/webmappingapplication.js +0 -675
- package/dist/node/webmappingapplication.js.map +0 -1
- package/dist/node/workforce.d.ts +0 -34
- package/dist/node/workforce.js +0 -45
- package/dist/node/workforce.js.map +0 -1
- package/dist/umd/simple-types/src/dashboard.d.ts +0 -93
- package/dist/umd/simple-types/src/helpers/convert-item-to-template.d.ts +0 -39
- package/dist/umd/simple-types/src/helpers/create-item-from-template.d.ts +0 -17
- package/dist/umd/simple-types/src/helpers/notebook-helpers.d.ts +0 -19
- package/dist/umd/simple-types/src/helpers/quickcapture-helpers.d.ts +0 -18
- package/dist/umd/simple-types/src/helpers/simple-type-helpers.d.ts +0 -18
- package/dist/umd/simple-types/src/helpers/update-notebook-data.d.ts +0 -17
- package/dist/umd/simple-types/src/index.d.ts +0 -27
- package/dist/umd/simple-types/src/notebook.d.ts +0 -66
- package/dist/umd/simple-types/src/oic.d.ts +0 -53
- package/dist/umd/simple-types/src/quickcapture.d.ts +0 -87
- package/dist/umd/simple-types/src/simple-types.d.ts +0 -57
- package/dist/umd/simple-types/src/webmap.d.ts +0 -101
- package/dist/umd/simple-types/src/webmappingapplication.d.ts +0 -176
- package/dist/umd/simple-types/src/workforce.d.ts +0 -34
- package/dist/umd/simple-types.umd.js +0 -2296
- package/dist/umd/simple-types.umd.js.map +0 -1
- package/dist/umd/simple-types.umd.min.js +0 -19
- package/dist/umd/simple-types.umd.min.js.map +0 -1
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @license
|
|
3
|
-
* Copyright 2020 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._getFormDataFilename = exports.convertItemToTemplate = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const common = tslib_1.__importStar(require("@esri/solution-common"));
|
|
21
|
-
const dashboard = tslib_1.__importStar(require("../dashboard"));
|
|
22
|
-
const notebook = tslib_1.__importStar(require("../notebook"));
|
|
23
|
-
const oic = tslib_1.__importStar(require("../oic"));
|
|
24
|
-
const quickcapture = tslib_1.__importStar(require("../quickcapture"));
|
|
25
|
-
const webmap = tslib_1.__importStar(require("../webmap"));
|
|
26
|
-
const webmappingapplication = tslib_1.__importStar(require("../webmappingapplication"));
|
|
27
|
-
const workforce = tslib_1.__importStar(require("../workforce"));
|
|
28
|
-
/**
|
|
29
|
-
* Converts an item into a template.
|
|
30
|
-
*
|
|
31
|
-
* @param solutionItemId The solution to contain the template
|
|
32
|
-
* @param itemInfo Info about the item
|
|
33
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
34
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
35
|
-
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
36
|
-
*
|
|
37
|
-
* @returns A promise that will resolve when the template has been created
|
|
38
|
-
*/
|
|
39
|
-
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
// Init template
|
|
42
|
-
const itemTemplate = common.createInitializedItemTemplate(itemInfo);
|
|
43
|
-
// Templatize item info property values
|
|
44
|
-
itemTemplate.item.id = common.templatizeTerm(itemTemplate.item.id, itemTemplate.item.id, ".itemId");
|
|
45
|
-
// Request related items
|
|
46
|
-
const relatedPromise = common.getItemRelatedItemsInSameDirection(itemTemplate.itemId, "forward", srcAuthentication);
|
|
47
|
-
// Perform type-specific handling
|
|
48
|
-
let dataPromise = Promise.resolve({});
|
|
49
|
-
let resourcesPromise = Promise.resolve([]);
|
|
50
|
-
switch (itemInfo.type) {
|
|
51
|
-
case "Dashboard":
|
|
52
|
-
case "Feature Collection":
|
|
53
|
-
case "Feature Service":
|
|
54
|
-
case "Hub Initiative":
|
|
55
|
-
case "Hub Page":
|
|
56
|
-
case "Hub Site Application":
|
|
57
|
-
case "Insights Model":
|
|
58
|
-
case "Oriented Imagery Catalog":
|
|
59
|
-
case "Project Package":
|
|
60
|
-
case "Workforce Project":
|
|
61
|
-
case "Web Map":
|
|
62
|
-
case "Web Mapping Application":
|
|
63
|
-
case "Web Scene":
|
|
64
|
-
case "Notebook":
|
|
65
|
-
dataPromise = new Promise(resolveJSON => {
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
67
|
-
common
|
|
68
|
-
.getItemDataAsJson(itemTemplate.itemId, srcAuthentication)
|
|
69
|
-
.then(json => resolveJSON(json));
|
|
70
|
-
});
|
|
71
|
-
break;
|
|
72
|
-
case "Form":
|
|
73
|
-
dataPromise = common.getItemDataAsFile(itemTemplate.itemId, itemTemplate.item.name, srcAuthentication);
|
|
74
|
-
break;
|
|
75
|
-
case "QuickCapture Project":
|
|
76
|
-
dataPromise = new Promise(resolveJSON => {
|
|
77
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
78
|
-
common
|
|
79
|
-
.getItemDataAsJson(itemTemplate.itemId, srcAuthentication)
|
|
80
|
-
.then(json => resolveJSON(json));
|
|
81
|
-
});
|
|
82
|
-
resourcesPromise = common.getItemResourcesFiles(itemTemplate.itemId, srcAuthentication);
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
// Errors are handled as resolved empty values; this means that there's no `reject` clause to handle, hence:
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
87
|
-
Promise.all([dataPromise, relatedPromise, resourcesPromise]).then(responses => {
|
|
88
|
-
const [itemDataResponse, relatedItemsResponse, resourcesResponse] = responses;
|
|
89
|
-
// need to pre-process for velocity urls before they could be templatized by other processors
|
|
90
|
-
itemTemplate.data = common.updateVelocityReferences(itemDataResponse, itemInfo.type, templateDictionary);
|
|
91
|
-
const relationships = relatedItemsResponse;
|
|
92
|
-
// Save the mappings to related items & add those items to the dependencies, but not WMA Code Attachments
|
|
93
|
-
itemTemplate.dependencies = [];
|
|
94
|
-
itemTemplate.relatedItems = [];
|
|
95
|
-
relationships.forEach(relationship => {
|
|
96
|
-
/* istanbul ignore else */
|
|
97
|
-
if (relationship.relationshipType !== "WMA2Code") {
|
|
98
|
-
itemTemplate.relatedItems.push(relationship);
|
|
99
|
-
relationship.relatedItemIds.forEach(relatedItemId => {
|
|
100
|
-
if (itemTemplate.dependencies.indexOf(relatedItemId) < 0) {
|
|
101
|
-
itemTemplate.dependencies.push(relatedItemId);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
// Add QuickCapture basemap webmap references
|
|
107
|
-
if (itemInfo.type === "QuickCapture Project") {
|
|
108
|
-
const basemap = itemDataResponse?.application?.basemap;
|
|
109
|
-
if (basemap?.type === "WebMap") {
|
|
110
|
-
itemTemplate.dependencies.push(basemap.itemId);
|
|
111
|
-
}
|
|
112
|
-
itemTemplate.resources = resourcesResponse;
|
|
113
|
-
}
|
|
114
|
-
// Create the template
|
|
115
|
-
let templateModifyingPromise = Promise.resolve(itemTemplate);
|
|
116
|
-
switch (itemInfo.type) {
|
|
117
|
-
case "Dashboard":
|
|
118
|
-
dashboard.convertItemToTemplate(itemTemplate, templateDictionary);
|
|
119
|
-
break;
|
|
120
|
-
case "Form":
|
|
121
|
-
// Store the form's data in the solution resources, not in template
|
|
122
|
-
itemTemplate.data = null;
|
|
123
|
-
// Add the form data to the template for a post-process resource upload
|
|
124
|
-
if (itemDataResponse) {
|
|
125
|
-
itemTemplate.item.name = _getFormDataFilename(itemTemplate.item.name, itemDataResponse.name, `${itemTemplate.itemId}.zip`);
|
|
126
|
-
const storageName = common.convertItemResourceToStorageResource(itemTemplate.itemId, itemTemplate.item.name, common.SolutionTemplateFormatVersion, common.SolutionResourceType.data);
|
|
127
|
-
// Add the data file to the template so that it can be uploaded with the other resources in the solution
|
|
128
|
-
const dataFile = {
|
|
129
|
-
itemId: itemTemplate.itemId,
|
|
130
|
-
file: itemDataResponse,
|
|
131
|
-
folder: storageName.folder,
|
|
132
|
-
filename: itemTemplate.item.name
|
|
133
|
-
};
|
|
134
|
-
itemTemplate.dataFile = dataFile;
|
|
135
|
-
// Update the template's resources
|
|
136
|
-
itemTemplate.resources.push(storageName.folder + "/" + storageName.filename);
|
|
137
|
-
}
|
|
138
|
-
break;
|
|
139
|
-
case "Notebook":
|
|
140
|
-
notebook.convertNotebookToTemplate(itemTemplate);
|
|
141
|
-
break;
|
|
142
|
-
case "Oriented Imagery Catalog":
|
|
143
|
-
templateModifyingPromise = oic.convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication);
|
|
144
|
-
break;
|
|
145
|
-
case "Web Map":
|
|
146
|
-
case "Web Scene":
|
|
147
|
-
templateModifyingPromise = webmap.convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication, templateDictionary);
|
|
148
|
-
break;
|
|
149
|
-
case "Web Mapping Application":
|
|
150
|
-
if (itemDataResponse) {
|
|
151
|
-
templateModifyingPromise = webmappingapplication.convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication, templateDictionary);
|
|
152
|
-
}
|
|
153
|
-
break;
|
|
154
|
-
case "Workforce Project":
|
|
155
|
-
templateModifyingPromise = workforce.convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication, templateDictionary);
|
|
156
|
-
break;
|
|
157
|
-
case "QuickCapture Project":
|
|
158
|
-
templateModifyingPromise = quickcapture.convertQuickCaptureToTemplate(itemTemplate);
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
templateModifyingPromise.then(resolve, err => reject(common.fail(err)));
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
exports.convertItemToTemplate = convertItemToTemplate;
|
|
166
|
-
/**
|
|
167
|
-
* Encapsulates the rules for naming a form's data file.
|
|
168
|
-
* Chooses the first parameter that's defined and is not the string "undefined".
|
|
169
|
-
*
|
|
170
|
-
* @param itemName Template's item name
|
|
171
|
-
* @param dataFilename The data file name
|
|
172
|
-
* @param itemIdAsName A name constructed from the template's id suffixed with ".zip"
|
|
173
|
-
*
|
|
174
|
-
* @return A name for the data file
|
|
175
|
-
*/
|
|
176
|
-
function _getFormDataFilename(itemName, dataFilename, itemIdAsName) {
|
|
177
|
-
const originalFilename = itemName || dataFilename;
|
|
178
|
-
const filename = originalFilename && originalFilename !== "undefined"
|
|
179
|
-
? originalFilename
|
|
180
|
-
: itemIdAsName;
|
|
181
|
-
return filename;
|
|
182
|
-
}
|
|
183
|
-
exports._getFormDataFilename = _getFormDataFilename;
|
|
184
|
-
//# sourceMappingURL=convert-item-to-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-item-to-template.js","sourceRoot":"","sources":["../../../src/helpers/convert-item-to-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,sEAAgD;AAChD,gEAA0C;AAC1C,8DAAwC;AACxC,oDAA8B;AAC9B,sEAAgD;AAChD,0DAAoC;AACpC,wFAAkE;AAClE,gEAA0C;AAE1C;;;;;;;;;;GAUG;AACH,SAAgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,E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ACb,CAAC;oBACF,MAAM;aACT;YAED,wBAAwB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACzB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AArMD,sDAqMC;AAED;;;;;;;;;GASG;AACH,SAAgB,oBAAoB,CAClC,QAAgB,EAChB,YAAoB,EACpB,YAAoB;IAEpB,MAAM,gBAAgB,GAAG,QAAQ,IAAI,YAAY,CAAC;IAClD,MAAM,QAAQ,GACZ,gBAAgB,IAAI,gBAAgB,KAAK,WAAW;QAClD,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,YAAY,CAAC;IACnB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAXD,oDAWC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 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 common from "@esri/solution-common";
|
|
17
|
-
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createItemFromTemplate = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
/** @license
|
|
6
|
-
* Copyright 2020 Esri
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
const common = tslib_1.__importStar(require("@esri/solution-common"));
|
|
21
|
-
const notebook = tslib_1.__importStar(require("../notebook"));
|
|
22
|
-
const webmappingapplication = tslib_1.__importStar(require("../webmappingapplication"));
|
|
23
|
-
const workforce = tslib_1.__importStar(require("../workforce"));
|
|
24
|
-
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
25
|
-
return new Promise(resolve => {
|
|
26
|
-
// Interrupt process if progress callback returns `false`
|
|
27
|
-
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Started, 0)) {
|
|
28
|
-
itemProgressCallback(template.itemId, common.EItemProgressStatus.Ignored, 0);
|
|
29
|
-
resolve(common.generateEmptyCreationResponse(template.type));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// Replace the templatized symbols in a copy of the template
|
|
33
|
-
let newItemTemplate = common.cloneObject(template);
|
|
34
|
-
newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
|
|
35
|
-
// Create the item, then update its URL with its new id
|
|
36
|
-
// some fieldnames are used as keys for objects
|
|
37
|
-
// when we templatize field references for web applications we first stringify the components of the
|
|
38
|
-
// web application that could contain field references and then serach for them with a regular expression.
|
|
39
|
-
// We also need to stringify the web application when de-templatizing so it will find all of these occurrences as well.
|
|
40
|
-
if (template.type === "Web Mapping Application" && template.data) {
|
|
41
|
-
newItemTemplate = JSON.parse(common.replaceInTemplate(JSON.stringify(newItemTemplate), templateDictionary));
|
|
42
|
-
}
|
|
43
|
-
if (template.item.thumbnail) {
|
|
44
|
-
newItemTemplate.item.thumbnail = template.item.thumbnail; // make sure that our File is still there
|
|
45
|
-
}
|
|
46
|
-
common
|
|
47
|
-
.createItemWithData(newItemTemplate.item, newItemTemplate.data, destinationAuthentication, templateDictionary.folderId)
|
|
48
|
-
.then(createResponse => {
|
|
49
|
-
// Interrupt process if progress callback returns `false`
|
|
50
|
-
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.id)) {
|
|
51
|
-
itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
|
|
52
|
-
common
|
|
53
|
-
.removeItem(createResponse.id, destinationAuthentication)
|
|
54
|
-
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
// Add the new item to the settings
|
|
58
|
-
templateDictionary[template.itemId] = {
|
|
59
|
-
itemId: createResponse.id
|
|
60
|
-
};
|
|
61
|
-
newItemTemplate.itemId = createResponse.id;
|
|
62
|
-
// Set the appItemId manually to get around cases where the path was incorrectly set
|
|
63
|
-
// in legacy deployments
|
|
64
|
-
if (newItemTemplate.type === "Web Mapping Application" &&
|
|
65
|
-
template.data) {
|
|
66
|
-
common.setProp(newItemTemplate, "data.appItemId", createResponse.id);
|
|
67
|
-
}
|
|
68
|
-
const postProcess = common.hasUnresolvedVariables(newItemTemplate.data);
|
|
69
|
-
// Update the template again now that we have the new item id
|
|
70
|
-
const originalURL = newItemTemplate.item.url;
|
|
71
|
-
newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
|
|
72
|
-
// Update relationships
|
|
73
|
-
let relationshipsDef = Promise.resolve([]);
|
|
74
|
-
if (newItemTemplate.relatedItems) {
|
|
75
|
-
// Templatize references in relationships obj
|
|
76
|
-
const updatedRelatedItems = common.replaceInTemplate(common.templatizeIds(newItemTemplate.relatedItems), templateDictionary);
|
|
77
|
-
// Add the relationships
|
|
78
|
-
relationshipsDef = common.addForwardItemRelationships(newItemTemplate.itemId, updatedRelatedItems, destinationAuthentication);
|
|
79
|
-
}
|
|
80
|
-
// Check for extra processing for web mapping application et al.
|
|
81
|
-
let customProcDef;
|
|
82
|
-
if (template.type === "Web Mapping Application" &&
|
|
83
|
-
template.data &&
|
|
84
|
-
common.hasAnyKeyword(template, [
|
|
85
|
-
"WAB2D",
|
|
86
|
-
"WAB3D",
|
|
87
|
-
"Web AppBuilder"
|
|
88
|
-
])) {
|
|
89
|
-
// If this is a Web AppBuilder application, we will create a Code Attachment for downloading
|
|
90
|
-
customProcDef = webmappingapplication.fineTuneCreatedItem(template, newItemTemplate, templateDictionary, destinationAuthentication);
|
|
91
|
-
}
|
|
92
|
-
else if (template.type === "Workforce Project") {
|
|
93
|
-
customProcDef = workforce.fineTuneCreatedItem(newItemTemplate, destinationAuthentication, templateDictionary);
|
|
94
|
-
}
|
|
95
|
-
else if (template.type === "Notebook") {
|
|
96
|
-
customProcDef = notebook.fineTuneCreatedItem(template, newItemTemplate, templateDictionary, destinationAuthentication);
|
|
97
|
-
}
|
|
98
|
-
else if (originalURL !== newItemTemplate.item.url) {
|
|
99
|
-
// For web mapping applications that are not Web AppBuilder apps
|
|
100
|
-
customProcDef = new Promise((resolve2, reject2) => {
|
|
101
|
-
common
|
|
102
|
-
.updateItemURL(createResponse.id, newItemTemplate.item.url, destinationAuthentication)
|
|
103
|
-
.then(() => resolve2(), reject2);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
customProcDef = Promise.resolve(null);
|
|
108
|
-
}
|
|
109
|
-
Promise.all([relationshipsDef, customProcDef]).then(() => {
|
|
110
|
-
// Interrupt process if progress callback returns `false`
|
|
111
|
-
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.id)) {
|
|
112
|
-
itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
|
|
113
|
-
common
|
|
114
|
-
.removeItem(createResponse.id, destinationAuthentication)
|
|
115
|
-
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
resolve({
|
|
119
|
-
item: newItemTemplate,
|
|
120
|
-
id: createResponse.id,
|
|
121
|
-
type: newItemTemplate.type,
|
|
122
|
-
postProcess: postProcess
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}, () => {
|
|
126
|
-
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
127
|
-
resolve(common.generateEmptyCreationResponse(template.type)); // fails to deploy all resources to the item
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}, () => {
|
|
131
|
-
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
132
|
-
resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
exports.createItemFromTemplate = createItemFromTemplate;
|
|
138
|
-
//# sourceMappingURL=create-item-from-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-item-from-template.js","sourceRoot":"","sources":["../../../src/helpers/create-item-from-template.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,sEAAgD;AAChD,8DAAwC;AACxC,wFAAkE;AAClE,gEAA0C;AAE1C,SAAgB,sBAAsB,CACpC,QAA8B,EAC9B,kBAAuB,EACvB,yBAA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C,EACD,GAAG,EAAE;gBACH,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;gBACF,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB;YACvF,CAAC,CACF,CAAC;SACL;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA3OD,wDA2OC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 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 { convertItemToTemplate } from "./convert-item-to-template";
|
|
17
|
-
import { createItemFromTemplate } from "./create-item-from-template";
|
|
18
|
-
import { updateNotebookData } from "./update-notebook-data";
|
|
19
|
-
export { createItemFromTemplate, convertItemToTemplate, updateNotebookData };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateNotebookData = exports.convertItemToTemplate = exports.createItemFromTemplate = void 0;
|
|
4
|
-
/** @license
|
|
5
|
-
* Copyright 2020 Esri
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
const convert_item_to_template_1 = require("./convert-item-to-template");
|
|
20
|
-
Object.defineProperty(exports, "convertItemToTemplate", { enumerable: true, get: function () { return convert_item_to_template_1.convertItemToTemplate; } });
|
|
21
|
-
const create_item_from_template_1 = require("./create-item-from-template");
|
|
22
|
-
Object.defineProperty(exports, "createItemFromTemplate", { enumerable: true, get: function () { return create_item_from_template_1.createItemFromTemplate; } });
|
|
23
|
-
const update_notebook_data_1 = require("./update-notebook-data");
|
|
24
|
-
Object.defineProperty(exports, "updateNotebookData", { enumerable: true, get: function () { return update_notebook_data_1.updateNotebookData; } });
|
|
25
|
-
//# sourceMappingURL=notebook-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notebook-helpers.js","sourceRoot":"","sources":["../../../src/helpers/notebook-helpers.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,yEAAmE;AAKlC,sGALxB,gDAAqB,OAKwB;AAJtD,2EAAqE;AAI5D,uGAJA,kDAAsB,OAIA;AAH/B,iEAA4D;AAGJ,mGAH/C,yCAAkB,OAG+C"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 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 { convertItemToTemplate } from "./convert-item-to-template";
|
|
17
|
-
import { createItemFromTemplate } from "./create-item-from-template";
|
|
18
|
-
export { createItemFromTemplate, convertItemToTemplate };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertItemToTemplate = exports.createItemFromTemplate = void 0;
|
|
4
|
-
/** @license
|
|
5
|
-
* Copyright 2020 Esri
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
const convert_item_to_template_1 = require("./convert-item-to-template");
|
|
20
|
-
Object.defineProperty(exports, "convertItemToTemplate", { enumerable: true, get: function () { return convert_item_to_template_1.convertItemToTemplate; } });
|
|
21
|
-
const create_item_from_template_1 = require("./create-item-from-template");
|
|
22
|
-
Object.defineProperty(exports, "createItemFromTemplate", { enumerable: true, get: function () { return create_item_from_template_1.createItemFromTemplate; } });
|
|
23
|
-
//# sourceMappingURL=quickcapture-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quickcapture-helpers.js","sourceRoot":"","sources":["../../../src/helpers/quickcapture-helpers.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,yEAAmE;AAIlC,sGAJxB,gDAAqB,OAIwB;AAHtD,2EAAqE;AAG5D,uGAHA,kDAAsB,OAGA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 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 { convertItemToTemplate } from "./convert-item-to-template";
|
|
17
|
-
import { createItemFromTemplate } from "./create-item-from-template";
|
|
18
|
-
export { createItemFromTemplate, convertItemToTemplate };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertItemToTemplate = exports.createItemFromTemplate = void 0;
|
|
4
|
-
/** @license
|
|
5
|
-
* Copyright 2020 Esri
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
const convert_item_to_template_1 = require("./convert-item-to-template");
|
|
20
|
-
Object.defineProperty(exports, "convertItemToTemplate", { enumerable: true, get: function () { return convert_item_to_template_1.convertItemToTemplate; } });
|
|
21
|
-
const create_item_from_template_1 = require("./create-item-from-template");
|
|
22
|
-
Object.defineProperty(exports, "createItemFromTemplate", { enumerable: true, get: function () { return create_item_from_template_1.createItemFromTemplate; } });
|
|
23
|
-
//# sourceMappingURL=simple-type-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-type-helpers.js","sourceRoot":"","sources":["../../../src/helpers/simple-type-helpers.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,yEAAmE;AAIlC,sGAJxB,gDAAqB,OAIwB;AAHtD,2EAAqE;AAG5D,uGAHA,kDAAsB,OAGA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 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 { UserSession } from "@esri/solution-common";
|
|
17
|
-
export declare function updateNotebookData(itemId: string, data: any, authentication: UserSession): Promise<any>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateNotebookData = void 0;
|
|
4
|
-
/** @license
|
|
5
|
-
* Copyright 2020 Esri
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
const solution_common_1 = require("@esri/solution-common");
|
|
20
|
-
function updateNotebookData(itemId, data, authentication) {
|
|
21
|
-
const updateOptions = {
|
|
22
|
-
id: itemId,
|
|
23
|
-
data: (0, solution_common_1.jsonToBlob)(data)
|
|
24
|
-
};
|
|
25
|
-
return (0, solution_common_1.updateItem)(updateOptions, authentication);
|
|
26
|
-
}
|
|
27
|
-
exports.updateNotebookData = updateNotebookData;
|
|
28
|
-
//# sourceMappingURL=update-notebook-data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-notebook-data.js","sourceRoot":"","sources":["../../../src/helpers/update-notebook-data.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,2DAK+B;AAE/B,SAAgB,kBAAkB,CAChC,MAAc,EACd,IAAS,EACT,cAA2B;IAE3B,MAAM,aAAa,GAAgB;QACjC,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,IAAA,4BAAU,EAAC,IAAI,CAAC;KACvB,CAAC;IACF,OAAO,IAAA,4BAAU,EAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AACnD,CAAC;AAVD,gDAUC"}
|
package/dist/node/index.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2018 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 simple item types.
|
|
18
|
-
*
|
|
19
|
-
* @module simple-types
|
|
20
|
-
*/
|
|
21
|
-
import * as simpleTypeHelpers from "./helpers/simple-type-helpers";
|
|
22
|
-
import * as notebookHelpers from "./helpers/notebook-helpers";
|
|
23
|
-
import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
|
|
24
|
-
import * as simpleTypes from "./simple-types";
|
|
25
|
-
import * as notebookProcessor from "./notebook";
|
|
26
|
-
import * as quickcaptureProcessor from "./quickcapture";
|
|
27
|
-
export { simpleTypes, notebookProcessor, notebookHelpers, simpleTypeHelpers, quickcaptureHelpers, quickcaptureProcessor };
|
package/dist/node/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @license
|
|
3
|
-
* Copyright 2018 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.quickcaptureProcessor = exports.quickcaptureHelpers = exports.simpleTypeHelpers = exports.notebookHelpers = exports.notebookProcessor = exports.simpleTypes = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
/**
|
|
21
|
-
* Manages the creation and deployment of simple item types.
|
|
22
|
-
*
|
|
23
|
-
* @module simple-types
|
|
24
|
-
*/
|
|
25
|
-
const simpleTypeHelpers = tslib_1.__importStar(require("./helpers/simple-type-helpers"));
|
|
26
|
-
exports.simpleTypeHelpers = simpleTypeHelpers;
|
|
27
|
-
const notebookHelpers = tslib_1.__importStar(require("./helpers/notebook-helpers"));
|
|
28
|
-
exports.notebookHelpers = notebookHelpers;
|
|
29
|
-
const quickcaptureHelpers = tslib_1.__importStar(require("./helpers/quickcapture-helpers"));
|
|
30
|
-
exports.quickcaptureHelpers = quickcaptureHelpers;
|
|
31
|
-
const simpleTypes = tslib_1.__importStar(require("./simple-types"));
|
|
32
|
-
exports.simpleTypes = simpleTypes;
|
|
33
|
-
const notebookProcessor = tslib_1.__importStar(require("./notebook"));
|
|
34
|
-
exports.notebookProcessor = notebookProcessor;
|
|
35
|
-
const quickcaptureProcessor = tslib_1.__importStar(require("./quickcapture"));
|
|
36
|
-
exports.quickcaptureProcessor = quickcaptureProcessor;
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AACH,yFAAmE;AAWjE,8CAAiB;AAVnB,oFAA8D;AAS5D,0CAAe;AARjB,4FAAsE;AAUpE,kDAAmB;AATrB,oEAA8C;AAK5C,kCAAW;AAJb,sEAAgD;AAK9C,8CAAiB;AAJnB,8EAAwD;AAQtD,sDAAqB"}
|