@esri/solution-form 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/convert-item-to-template.d.ts +3 -2
- package/dist/esm/convert-item-to-template.js +4 -3
- package/dist/esm/convert-item-to-template.js.map +1 -1
- package/dist/esm/helpers/build-create-params.js +27 -19
- package/dist/esm/helpers/build-create-params.js.map +1 -1
- package/dist/esm/helpers/create-item-from-hub-template.js +14 -11
- package/dist/esm/helpers/create-item-from-hub-template.js.map +1 -1
- package/dist/esm/helpers/create-survey.js +10 -9
- package/dist/esm/helpers/create-survey.js.map +1 -1
- package/dist/esm/helpers/encode-survey-form.js +12 -12
- package/dist/esm/helpers/encode-survey-form.js.map +1 -1
- package/dist/esm/helpers/post-process-survey.js +19 -25
- package/dist/esm/helpers/post-process-survey.js.map +1 -1
- package/dist/node/convert-item-to-template.d.ts +3 -2
- package/dist/node/convert-item-to-template.js +5 -4
- package/dist/node/convert-item-to-template.js.map +1 -1
- package/dist/node/create-item-from-template.js +3 -3
- package/dist/node/create-item-from-template.js.map +1 -1
- package/dist/node/helpers/build-create-params.js +29 -21
- package/dist/node/helpers/build-create-params.js.map +1 -1
- package/dist/node/helpers/create-item-from-hub-template.js +17 -14
- package/dist/node/helpers/create-item-from-hub-template.js.map +1 -1
- package/dist/node/helpers/create-survey.js +11 -10
- package/dist/node/helpers/create-survey.js.map +1 -1
- package/dist/node/helpers/encode-survey-form.js +13 -13
- package/dist/node/helpers/encode-survey-form.js.map +1 -1
- package/dist/node/helpers/is-hub-form-template.js +1 -1
- package/dist/node/helpers/is-hub-form-template.js.map +1 -1
- package/dist/node/helpers/post-process-survey.js +21 -27
- package/dist/node/helpers/post-process-survey.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/post-process.js +3 -3
- package/dist/node/post-process.js.map +1 -1
- package/dist/umd/convert-item-to-template.d.ts +3 -2
- package/dist/umd/form.umd.js +112 -124
- package/dist/umd/form.umd.js.map +1 -1
- package/dist/umd/form.umd.min.js +3 -3
- package/dist/umd/form.umd.min.js.map +1 -1
- package/package.json +29 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-item-from-hub-template.js","sourceRoot":"","sources":["../../../src/helpers/create-item-from-hub-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"create-item-from-hub-template.js","sourceRoot":"","sources":["../../../src/helpers/create-item-from-hub-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAW+B;AAC/B,mDAA+C;AAC/C,+DAA0D;AAE1D;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,SAAgB,yBAAyB,CACvC,QAAuB,EACvB,kBAAuB,EACvB,yBAAsC,EACtC,oBAA2C;IAE3C,MAAM,oBAAoB,GAAG,IAAA,mCAAiB,EAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAC7E,MAAM,EAAE,YAAY,EAAE,GAAG,kBAAkB,CAAC;IAE5C,OAAO,IAAA,uCAAiB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,CAC1B;SACE,IAAI,CAAC,CAAC,MAA8B,EAAE,EAAE;QACvC,OAAO,IAAA,4BAAY,EAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC5C,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,oBAA4C,EAAE,EAAE;QACrD,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,oBAAoB,CAAC;QAE1D,qCAAqC;QACrC,IAAI,QAAQ,GAAiB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnD,0BAA0B;QAC1B,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE;YAC3B,QAAQ,GAAG,IAAA,oCAAkB,EAC3B,EAAE,EAAE,EAAE,MAAM,EAAE,EACd,IAAI,EACJ,yBAAyB,EACzB,QAAQ,CAAC,IAAI,CAAC,SAAS,CACxB,CAAC;SACH;QAED,OAAO,QAAQ;aACZ,IAAI,CAAC,GAAG,EAAE,CAAC,IAAA,6BAAW,EAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;aAC1D,IAAI,CAAC,IAAI,CAAC,EAAE;YACX,kBAAkB,CAAC,oBAAoB,CAAC,MAAM,CAAC,GAAG;gBAChD,MAAM,EAAE,MAAM;aACf,CAAC;YACF,kBAAkB,CAChB,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CACxD,GAAG;gBACF,MAAM,EAAE,gBAAgB;aACzB,CAAC;YACF,oBAAoB,CAClB,oBAAoB,CAAC,MAAM,EAC3B,qCAAmB,CAAC,QAAQ,EAC5B,oBAAoB,CAAC,6BAA6B,EAClD,MAAM,CACP,CAAC;YACF,OAAO;gBACL,IAAI,EAAE;oBACJ,GAAG,QAAQ;oBACX,IAAI;oBACJ,MAAM,EAAE,MAAM;iBACf;gBACD,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,IAAI;aAClB,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,CAAC,EAAE;QACT,oBAAoB,CAClB,oBAAoB,CAAC,MAAM,EAC3B,qCAAmB,CAAC,MAAM,EAC1B,CAAC,CACF,CAAC;QACF,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,CAAC;AArED,8DAqEC"}
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.createSurvey = void 0;
|
|
19
|
-
|
|
20
|
-
var arcgis_rest_request_1 = require("@esri/arcgis-rest-request");
|
|
19
|
+
const arcgis_rest_request_1 = require("@esri/arcgis-rest-request");
|
|
21
20
|
/**
|
|
22
21
|
* Provides utility method to call Survey123 create endpoint
|
|
23
22
|
*
|
|
@@ -31,22 +30,24 @@ var arcgis_rest_request_1 = require("@esri/arcgis-rest-request");
|
|
|
31
30
|
* @throws Will throw if the Survey123 API returns an error response
|
|
32
31
|
* @returns {Promise<ISurvey123CreateResult>}
|
|
33
32
|
*/
|
|
34
|
-
function createSurvey(params, survey123Url) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var ro = {
|
|
33
|
+
function createSurvey(params, survey123Url = "https://survey123.arcgis.com") {
|
|
34
|
+
const createUrl = `${survey123Url}/api/survey/create`;
|
|
35
|
+
const ro = {
|
|
38
36
|
credentials: "same-origin",
|
|
39
37
|
method: "POST",
|
|
40
|
-
body: (0, arcgis_rest_request_1.encodeFormData)(
|
|
38
|
+
body: (0, arcgis_rest_request_1.encodeFormData)({
|
|
39
|
+
f: "json",
|
|
40
|
+
...params
|
|
41
|
+
}, true)
|
|
41
42
|
};
|
|
42
43
|
// Using @esri/arcgis-request "request" method was resulting in a 404 for
|
|
43
44
|
// a CORS preflight request related to this request, but calling fetch directly
|
|
44
45
|
// circumvents the issue.
|
|
45
46
|
return fetch(createUrl, ro)
|
|
46
|
-
.then(
|
|
47
|
-
.then(
|
|
47
|
+
.then(response => response.json())
|
|
48
|
+
.then(response => {
|
|
48
49
|
if (!response.success) {
|
|
49
|
-
throw new Error(
|
|
50
|
+
throw new Error(`Failed to create survey: ${response.error.message}`);
|
|
50
51
|
}
|
|
51
52
|
return {
|
|
52
53
|
formId: response.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-survey.js","sourceRoot":"","sources":["../../../src/helpers/create-survey.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"create-survey.js","sourceRoot":"","sources":["../../../src/helpers/create-survey.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAMH,mEAA2D;AAE3D;;;;GAIG;AAEH;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,MAA8B,EAC9B,YAAY,GAAG,8BAA8B;IAE7C,MAAM,SAAS,GAAG,GAAG,YAAY,oBAAoB,CAAC;IACtD,MAAM,EAAE,GAAG;QACT,WAAW,EAAE,aAAmC;QAChD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAA,oCAAc,EAClB;YACE,CAAC,EAAE,MAAM;YACT,GAAG,MAAM;SACV,EACD,IAAI,CACL;KACF,CAAC;IACF,yEAAyE;IACzE,+EAA+E;IAC/E,yBAAyB;IACzB,OAAO,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC;SACxB,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;SACjC,IAAI,CAAC,QAAQ,CAAC,EAAE;QACf,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;SACvE;QACD,OAAO;YACL,MAAM,EAAE,QAAQ,CAAC,EAAE;YACnB,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM;YACvD,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,WAAW;SAC5C,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC;AA/BD,oCA+BC"}
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.encodeSurveyForm = void 0;
|
|
19
|
-
|
|
20
|
-
var solution_common_1 = require("@esri/solution-common");
|
|
19
|
+
const solution_common_1 = require("@esri/solution-common");
|
|
21
20
|
/**
|
|
22
21
|
* Manages Survey123 parameter encoding
|
|
23
22
|
*
|
|
@@ -30,29 +29,30 @@ var solution_common_1 = require("@esri/solution-common");
|
|
|
30
29
|
* @param {any} form Unencoded form data
|
|
31
30
|
* @returns {any} Encoded form data
|
|
32
31
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const encodeSurveyForm = function encodeForm(form) {
|
|
33
|
+
const clone = (0, solution_common_1.cloneObject)(form);
|
|
34
|
+
const props = [
|
|
36
35
|
["header", "content"],
|
|
37
36
|
["subHeader", "content"],
|
|
38
37
|
["footer", "content"],
|
|
39
38
|
["settings", "thankYouScreenContent"]
|
|
40
39
|
];
|
|
41
|
-
|
|
40
|
+
const encode = (obj, key) => {
|
|
42
41
|
if (obj && obj[key]) {
|
|
43
42
|
obj[key] = encodeURIComponent(obj[key]);
|
|
44
43
|
}
|
|
45
44
|
return obj;
|
|
46
45
|
};
|
|
47
46
|
// encode props from array above
|
|
48
|
-
props.forEach(
|
|
49
|
-
|
|
50
|
-
return encode(clone[objKey], propKey);
|
|
51
|
-
});
|
|
47
|
+
props.forEach(([objKey, propKey]) => encode(clone[objKey], propKey));
|
|
48
|
+
const encodeQuestion = (question) => encode(question, "description");
|
|
52
49
|
// encode question descriptions
|
|
53
|
-
clone.questions = (clone.questions || []).map(
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
clone.questions = (clone.questions || []).map((question) => !question.questions
|
|
51
|
+
? encodeQuestion(question)
|
|
52
|
+
: {
|
|
53
|
+
...question,
|
|
54
|
+
questions: question.questions.map(encodeQuestion)
|
|
55
|
+
});
|
|
56
56
|
return clone;
|
|
57
57
|
};
|
|
58
58
|
exports.encodeSurveyForm = encodeSurveyForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode-survey-form.js","sourceRoot":"","sources":["../../../src/helpers/encode-survey-form.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"encode-survey-form.js","sourceRoot":"","sources":["../../../src/helpers/encode-survey-form.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAAoD;AAEpD;;;;GAIG;AAEH;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,SAAS,UAAU,CAAC,IAAS;IAC3D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value: true });
|
|
18
18
|
exports.isHubFormTemplate = void 0;
|
|
19
|
-
|
|
19
|
+
const common = require("@esri/solution-common");
|
|
20
20
|
/**
|
|
21
21
|
* Determines if the given template is a Hub Survey
|
|
22
22
|
* template vs Solutions.js Survey template.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-hub-form-template.js","sourceRoot":"","sources":["../../../src/helpers/is-hub-form-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"is-hub-form-template.js","sourceRoot":"","sources":["../../../src/helpers/is-hub-form-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,gDAAgD;AAEhD;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,QAA8B;IAC9D,2EAA2E;IAC3E,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AAC3D,CAAC;AAHD,8CAGC"}
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.postProcessHubSurvey = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const solution_common_1 = require("@esri/solution-common");
|
|
20
|
+
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
21
21
|
/**
|
|
22
22
|
* Provides utility method to post process Hub surveys
|
|
23
23
|
*
|
|
@@ -35,11 +35,11 @@ var arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
|
35
35
|
* @returns {Promise<any>}
|
|
36
36
|
*/
|
|
37
37
|
function postProcessHubSurvey(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return (0, solution_common_1.getItemBase)(featureServiceResultId, authentication).then(
|
|
42
|
-
|
|
38
|
+
const featureServiceSourceId = template.properties.info.serviceInfo.itemId;
|
|
39
|
+
const { itemId: featureServiceResultId } = templateDictionary[featureServiceSourceId];
|
|
40
|
+
const interpolated = (0, solution_common_1.replaceInTemplate)(template, templateDictionary);
|
|
41
|
+
return (0, solution_common_1.getItemBase)(featureServiceResultId, authentication).then(featureServiceResultBase => {
|
|
42
|
+
const itemUpdates = [
|
|
43
43
|
// fix/update form properties we couldn't control via the API
|
|
44
44
|
{
|
|
45
45
|
id: itemId,
|
|
@@ -52,32 +52,26 @@ function postProcessHubSurvey(itemId, type, itemInfos, template, templates, temp
|
|
|
52
52
|
{
|
|
53
53
|
id: featureServiceResultId,
|
|
54
54
|
extent: interpolated.item.extent,
|
|
55
|
-
typeKeywords: [
|
|
55
|
+
typeKeywords: [`source-${featureServiceSourceId}`].concat(featureServiceResultBase.typeKeywords)
|
|
56
56
|
}
|
|
57
57
|
];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
var updatePromises = itemUpdates.map(toUpdatePromise);
|
|
58
|
+
const toUpdatePromise = (updatedItem) => (0, solution_common_1.updateItem)(updatedItem, authentication);
|
|
59
|
+
const updatePromises = itemUpdates.map(toUpdatePromise);
|
|
62
60
|
return Promise.all(updatePromises)
|
|
63
|
-
.then(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
var movePromises = itemIdsToMove.map(toMovePromise);
|
|
61
|
+
.then(() => {
|
|
62
|
+
const itemIdsToMove = [itemId, featureServiceResultId];
|
|
63
|
+
const toMovePromise = (id) => (0, arcgis_rest_portal_1.moveItem)({
|
|
64
|
+
itemId: id,
|
|
65
|
+
folderId: templateDictionary.folderId,
|
|
66
|
+
authentication: authentication
|
|
67
|
+
});
|
|
68
|
+
const movePromises = itemIdsToMove.map(toMovePromise);
|
|
73
69
|
return Promise.all(movePromises);
|
|
74
70
|
})
|
|
75
|
-
.then(
|
|
76
|
-
|
|
77
|
-
})
|
|
78
|
-
.then(function () {
|
|
71
|
+
.then(() => (0, solution_common_1.removeFolder)(featureServiceResultBase.ownerFolder, authentication))
|
|
72
|
+
.then(() => {
|
|
79
73
|
// Create a template item for the Feature Service that was created by the API
|
|
80
|
-
|
|
74
|
+
const featureServiceTemplate = (0, solution_common_1.createInitializedItemTemplate)(featureServiceResultBase);
|
|
81
75
|
templates.push(featureServiceTemplate);
|
|
82
76
|
template.dependencies.push(featureServiceResultBase.id);
|
|
83
77
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-process-survey.js","sourceRoot":"","sources":["../../../src/helpers/post-process-survey.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"post-process-survey.js","sourceRoot":"","sources":["../../../src/helpers/post-process-survey.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAS+B;AAC/B,iEAAoD;AAEpD;;;;GAIG;AAEH;;;;;;;;;;GAUG;AACH,SAAgB,oBAAoB,CAClC,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAAuB,EACvB,SAA0B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,MAAM,sBAAsB,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;IAC3E,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,GAAG,kBAAkB,CAC3D,sBAAsB,CACvB,CAAC;IACF,MAAM,YAAY,GAAG,IAAA,mCAAiB,EAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IACrE,OAAO,IAAA,6BAAW,EAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC,IAAI,CAC7D,wBAAwB,CAAC,EAAE;QACzB,MAAM,WAAW,GAAG;YAClB,6DAA6D;YAC7D;gBACE,EAAE,EAAE,MAAM;gBACV,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK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AAC,sBAAsB,CAAC,CAAC;YACvC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC,CACF,CAAC;AACJ,CAAC;AA/DD,oDA+DC"}
|
package/dist/node/index.js
CHANGED
|
@@ -21,9 +21,9 @@ exports.postProcess = void 0;
|
|
|
21
21
|
*
|
|
22
22
|
* @module post-process
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const solution_common_1 = require("@esri/solution-common");
|
|
25
|
+
const is_hub_form_template_1 = require("./helpers/is-hub-form-template");
|
|
26
|
+
const post_process_survey_1 = require("./helpers/post-process-survey");
|
|
27
27
|
/**
|
|
28
28
|
* Form post-processing actions
|
|
29
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-process.js","sourceRoot":"","sources":["../../src/post-process.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"post-process.js","sourceRoot":"","sources":["../../src/post-process.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,2DAI+B;AAC/B,yEAAmE;AACnE,uEAAqE;AAErE;;;;;;;;;GASG;AACH,SAAgB,WAAW,CACzB,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAAuB,EACvB,SAA0B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,IAAI,IAAA,wCAAiB,EAAC,QAAQ,CAAC,EAAE;QAC/B,OAAO,IAAA,0CAAoB,EACzB,MAAM,EACN,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,cAAc,CACf,CAAC;KACH;IAED,OAAO,IAAA,kDAAgC,EACrC,MAAM,EACN,kBAAkB,EAClB,cAAc,CACf,CAAC;AACJ,CAAC;AA1BD,kCA0BC"}
|
|
@@ -24,8 +24,9 @@ import { UserSession, IItemTemplate } from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param {string} solutionItemId The solution item ID
|
|
26
26
|
* @param {any} itemInfo: The base item info
|
|
27
|
-
* @param {UserSession}
|
|
27
|
+
* @param {UserSession} destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param {UserSession} srcAuthentication Credentials for requests to source items
|
|
28
29
|
* @param {any} templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
29
30
|
* @returns {Promise<IItemTemplate>}
|
|
30
31
|
*/
|
|
31
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
32
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
|