@esri/solution-simple-types 4.1.2 → 5.0.1

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.
Files changed (69) hide show
  1. package/dist/cjs/dashboard.d.ts +93 -93
  2. package/dist/cjs/dashboard.js +352 -352
  3. package/dist/cjs/helpers/convert-item-to-template.d.ts +46 -46
  4. package/dist/cjs/helpers/convert-item-to-template.js +235 -209
  5. package/dist/cjs/helpers/convert-item-to-template.js.map +1 -1
  6. package/dist/cjs/helpers/create-item-from-template.d.ts +17 -17
  7. package/dist/cjs/helpers/create-item-from-template.js +153 -138
  8. package/dist/cjs/helpers/create-item-from-template.js.map +1 -1
  9. package/dist/cjs/helpers/notebook-helpers.d.ts +19 -19
  10. package/dist/cjs/helpers/notebook-helpers.js +24 -24
  11. package/dist/cjs/helpers/quickcapture-helpers.d.ts +18 -18
  12. package/dist/cjs/helpers/quickcapture-helpers.js +22 -22
  13. package/dist/cjs/helpers/simple-type-helpers.d.ts +18 -18
  14. package/dist/cjs/helpers/simple-type-helpers.js +22 -22
  15. package/dist/cjs/helpers/update-notebook-data.d.ts +17 -17
  16. package/dist/cjs/helpers/update-notebook-data.js +27 -27
  17. package/dist/cjs/index.d.ts +27 -27
  18. package/dist/cjs/index.js +36 -36
  19. package/dist/cjs/notebook.d.ts +66 -66
  20. package/dist/cjs/notebook.js +133 -133
  21. package/dist/cjs/oic.d.ts +53 -53
  22. package/dist/cjs/oic.js +170 -170
  23. package/dist/cjs/quickcapture.d.ts +76 -87
  24. package/dist/cjs/quickcapture.js +143 -192
  25. package/dist/cjs/quickcapture.js.map +1 -1
  26. package/dist/cjs/simple-types.d.ts +57 -57
  27. package/dist/cjs/simple-types.js +94 -94
  28. package/dist/cjs/webmap.d.ts +102 -102
  29. package/dist/cjs/webmap.js +325 -325
  30. package/dist/cjs/webmappingapplication.d.ts +176 -176
  31. package/dist/cjs/webmappingapplication.js +674 -674
  32. package/dist/cjs/webmappingapplication.js.map +1 -1
  33. package/dist/cjs/workforce.d.ts +34 -34
  34. package/dist/cjs/workforce.js +44 -44
  35. package/dist/esm/dashboard.d.ts +93 -93
  36. package/dist/esm/dashboard.js +339 -339
  37. package/dist/esm/helpers/convert-item-to-template.d.ts +46 -46
  38. package/dist/esm/helpers/convert-item-to-template.js +228 -202
  39. package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
  40. package/dist/esm/helpers/create-item-from-template.d.ts +17 -17
  41. package/dist/esm/helpers/create-item-from-template.js +148 -133
  42. package/dist/esm/helpers/create-item-from-template.js.map +1 -1
  43. package/dist/esm/helpers/notebook-helpers.d.ts +19 -19
  44. package/dist/esm/helpers/notebook-helpers.js +20 -20
  45. package/dist/esm/helpers/quickcapture-helpers.d.ts +18 -18
  46. package/dist/esm/helpers/quickcapture-helpers.js +19 -19
  47. package/dist/esm/helpers/simple-type-helpers.d.ts +18 -18
  48. package/dist/esm/helpers/simple-type-helpers.js +19 -19
  49. package/dist/esm/helpers/update-notebook-data.d.ts +17 -17
  50. package/dist/esm/helpers/update-notebook-data.js +23 -23
  51. package/dist/esm/index.d.ts +27 -27
  52. package/dist/esm/index.js +27 -27
  53. package/dist/esm/notebook.d.ts +66 -66
  54. package/dist/esm/notebook.js +123 -123
  55. package/dist/esm/oic.d.ts +53 -53
  56. package/dist/esm/oic.js +162 -162
  57. package/dist/esm/quickcapture.d.ts +76 -87
  58. package/dist/esm/quickcapture.js +131 -179
  59. package/dist/esm/quickcapture.js.map +1 -1
  60. package/dist/esm/simple-types.d.ts +57 -57
  61. package/dist/esm/simple-types.js +86 -86
  62. package/dist/esm/webmap.d.ts +102 -102
  63. package/dist/esm/webmap.js +312 -312
  64. package/dist/esm/webmappingapplication.d.ts +176 -176
  65. package/dist/esm/webmappingapplication.js +648 -648
  66. package/dist/esm/webmappingapplication.js.map +1 -1
  67. package/dist/esm/workforce.d.ts +34 -34
  68. package/dist/esm/workforce.js +38 -38
  69. package/package.json +7 -7
@@ -1,180 +1,132 @@
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
- import * as common from "@esri/solution-common";
17
- import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
18
- //#region Publish Process ---------------------------------------------------------------------------------------//
19
- /**
20
- * Converts a Quick Capture item into a template.
21
- *
22
- * @param solutionItemId The solution to contain the template
23
- * @param itemInfo Info about the item
24
- * @param destAuthentication Credentials for requests to the destination organization
25
- * @param srcAuthentication Credentials for requests to source items
26
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
27
- * @returns A promise that will resolve when the template has been created
28
- */
29
- export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
30
- // Delegate back to simple-types, which will in-turn delegate
31
- // to convertNotebookToTemplate at the correct point in the process
32
- // This is a temporary refactor step
33
- return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
34
- }
35
- /**
36
- * Converts an quick capture item to a template.
37
- *
38
- * @param itemTemplate template for the quick capture project item
39
- * @returns templatized itemTemplate
40
- */
41
- export function convertQuickCaptureToTemplate(itemTemplate) {
42
- return new Promise((resolve, reject) => {
43
- // The templates data to process
44
- const data = itemTemplate.data;
45
- if (data && Array.isArray(data)) {
46
- let applicationRequest = Promise.resolve(null);
47
- let applicationName = "";
48
- data.some((item) => {
49
- if (item.type === "application/json") {
50
- applicationName = item.name;
51
- applicationRequest = common.getBlobText(item);
52
- return true;
53
- }
54
- });
55
- applicationRequest.then(result => {
56
- // replace the template data array with the templatized application JSON
57
- itemTemplate.data = result
58
- ? {
59
- application: _templatizeApplication(JSON.parse(result), itemTemplate),
60
- name: applicationName
61
- }
62
- : {};
63
- resolve(itemTemplate);
64
- }, reject);
65
- }
66
- else {
67
- resolve(itemTemplate);
68
- }
69
- });
70
- }
71
- /**
72
- * Templatizes key properties for a quick capture project and gathers item dependencies
73
- *
74
- * @param data the projects json
75
- * @param itemTemplate template for the quick capture project item
76
- * @returns templatized itemTemplate
77
- * @private
78
- */
79
- export function _templatizeApplication(data, itemTemplate) {
80
- // Quick Project item id
81
- _templatizeId(data, "itemId");
82
- // Set the admin email
83
- _templatizeAdminEmail(data);
84
- // datasource item id and url
85
- const dataSources = data.dataSources;
86
- if (dataSources && Array.isArray(dataSources)) {
87
- dataSources.forEach(ds => {
88
- const id = ds.featureServiceItemId;
89
- if (id) {
90
- _updateDependencies(id, itemTemplate);
91
- _templatizeUrl(ds, "featureServiceItemId", "url");
92
- _templatizeId(ds, "featureServiceItemId");
93
- }
94
- });
95
- }
96
- return data;
97
- }
98
- /**
99
- * Templatize the email property
100
- *
101
- * @param data the quick capture application
102
- * @private
103
- */
104
- export function _templatizeAdminEmail(data) {
105
- if (common.getProp(data, "preferences.adminEmail")) {
106
- common.setProp(data, "preferences.adminEmail", "{{user.email}}");
107
- }
108
- }
109
- /**
110
- * Updates the templates dependencies list with unique item ids
111
- *
112
- * @param id the item id of the dependency
113
- * @param itemTemplate template for the quick capture project item
114
- * @returns templatized itemTemplate
115
- */
116
- export function _updateDependencies(id, itemTemplate) {
117
- if (itemTemplate.dependencies.indexOf(id) === -1) {
118
- itemTemplate.dependencies.push(id);
119
- }
120
- }
121
- /**
122
- * Templatize a url property
123
- *
124
- * @param obj the datasource object
125
- * @param idPath the path to the id property
126
- * @param urlPath the path to the url property
127
- * @private
128
- */
129
- export function _templatizeUrl(obj, idPath, urlPath) {
130
- const id = common.getProp(obj, idPath);
131
- const url = common.getProp(obj, urlPath);
132
- if (url) {
133
- const layerId = url.substr(url.lastIndexOf("/") + 1);
134
- common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
135
- }
136
- }
137
- /**
138
- * Templatize the item id property
139
- *
140
- * @param obj the datasource or object that contains the item id property
141
- * @param path the path to the id property
142
- * @private
143
- */
144
- export function _templatizeId(obj, path) {
145
- const id = common.getProp(obj, path);
146
- if (id) {
147
- common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
148
- }
149
- }
150
- //#endregion
151
- //#region Deploy Process ---------------------------------------------------------------------------------------//
152
- // Delegate back to simple-types
153
- // This is a temporary refactor step
154
- export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
155
- return quickcaptureHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
156
- }
157
- /**
158
- * QuickCapture post-processing actions
159
- *
160
- * @param {string} itemId The item ID
161
- * @param {string} type The template type
162
- * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
163
- * @param {any} templateDictionary The template dictionary
164
- * @param {UserSession} authentication The destination session info
165
- * @returns Promise resolving to successfulness of update
166
- */
167
- export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
168
- return new Promise((resolve, reject) => {
169
- template.data = common.replaceInTemplate(template.data, templateDictionary);
170
- common
171
- .updateItemTemplateFromDictionary(itemId, templateDictionary, authentication)
172
- .then(() => {
173
- common
174
- .updateItemResourceText(itemId, template.data.name, JSON.stringify(template.data.application), authentication)
175
- .then(resolve, reject);
176
- }, reject);
177
- });
178
- }
179
- //#endregion
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
+ import * as common from "@esri/solution-common";
17
+ import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
18
+ //#region Publish Process ---------------------------------------------------------------------------------------//
19
+ /**
20
+ * Converts a Quick Capture item into a template.
21
+ *
22
+ * @param solutionItemId The solution to contain the template
23
+ * @param itemInfo Info about the item
24
+ * @param destAuthentication Credentials for requests to the destination organization
25
+ * @param srcAuthentication Credentials for requests to source items
26
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
27
+ * @returns A promise that will resolve when the template has been created
28
+ */
29
+ export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
30
+ // Delegate back to simple-types, which will in-turn delegate
31
+ // to convertNotebookToTemplate at the correct point in the process
32
+ // This is a temporary refactor step
33
+ return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
34
+ }
35
+ /**
36
+ * Converts an quick capture item to a template.
37
+ *
38
+ * @param itemTemplate template for the quick capture project item
39
+ * @returns templatized itemTemplate
40
+ */
41
+ export function convertQuickCaptureToTemplate(itemTemplate) {
42
+ common.setProp(itemTemplate, "data.application", _templatizeApplication(itemTemplate.data.application, itemTemplate));
43
+ return itemTemplate;
44
+ }
45
+ /**
46
+ * Templatizes key properties for a quick capture project and gathers item dependencies
47
+ *
48
+ * @param data the projects json
49
+ * @param itemTemplate template for the quick capture project item
50
+ * @returns templatized itemTemplate
51
+ * @private
52
+ */
53
+ export function _templatizeApplication(data, itemTemplate) {
54
+ // Quick Project item id
55
+ _templatizeId(data, "itemId");
56
+ // Set the admin email
57
+ _templatizeAdminEmail(data);
58
+ // datasource item id and url
59
+ const dataSources = data?.dataSources;
60
+ if (dataSources && Array.isArray(dataSources)) {
61
+ dataSources.forEach(ds => {
62
+ const id = ds.featureServiceItemId;
63
+ if (id) {
64
+ _updateDependencies(id, itemTemplate);
65
+ _templatizeUrl(ds, "featureServiceItemId", "url");
66
+ _templatizeId(ds, "featureServiceItemId");
67
+ }
68
+ });
69
+ }
70
+ return data;
71
+ }
72
+ /**
73
+ * Templatize the email property
74
+ *
75
+ * @param data the quick capture application
76
+ * @private
77
+ */
78
+ export function _templatizeAdminEmail(data) {
79
+ if (common.getProp(data, "preferences.adminEmail")) {
80
+ common.setProp(data, "preferences.adminEmail", "{{user.email}}");
81
+ }
82
+ }
83
+ /**
84
+ * Updates the templates dependencies list with unique item ids
85
+ *
86
+ * @param id the item id of the dependency
87
+ * @param itemTemplate template for the quick capture project item
88
+ * @returns templatized itemTemplate
89
+ */
90
+ export function _updateDependencies(id, itemTemplate) {
91
+ if (itemTemplate.dependencies.indexOf(id) === -1) {
92
+ itemTemplate.dependencies.push(id);
93
+ }
94
+ }
95
+ /**
96
+ * Templatize a url property
97
+ *
98
+ * @param obj the datasource object
99
+ * @param idPath the path to the id property
100
+ * @param urlPath the path to the url property
101
+ * @private
102
+ */
103
+ export function _templatizeUrl(obj, idPath, urlPath) {
104
+ const id = common.getProp(obj, idPath);
105
+ const url = common.getProp(obj, urlPath);
106
+ if (url) {
107
+ const layerId = url.substr(url.lastIndexOf("/") + 1);
108
+ common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
109
+ }
110
+ }
111
+ /**
112
+ * Templatize the item id property
113
+ *
114
+ * @param obj the datasource or object that contains the item id property
115
+ * @param path the path to the id property
116
+ * @private
117
+ */
118
+ export function _templatizeId(obj, path) {
119
+ const id = common.getProp(obj, path);
120
+ if (id) {
121
+ common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
122
+ }
123
+ }
124
+ //#endregion
125
+ //#region Deploy Process ---------------------------------------------------------------------------------------//
126
+ // Delegate back to simple-types
127
+ // This is a temporary refactor step
128
+ export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
129
+ return quickcaptureHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
130
+ }
131
+ //#endregion
180
132
  //# sourceMappingURL=quickcapture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,mBAAmB,MAAM,gCAAgC,CAAC;AAEtE,mHAAmH;AAEnH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,6DAA6D;IAC7D,mEAAmE;IACnE,oCAAoC;IACpC,OAAO,mBAAmB,CAAC,qBAAqB,CAC9C,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,CACnB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,YAAkC;IAElC,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,gCAAgC;QAChC,MAAM,IAAI,GAAQ,YAAY,CAAC,IAAI,CAAC;QACpC,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC/B,IAAI,kBAAkB,GAAiB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC7D,IAAI,eAAe,GAAW,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAU,EAAE,EAAE;gBACvB,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAAE;oBACpC,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC;oBAC5B,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oBAC9C,OAAO,IAAI,CAAC;iBACb;YACH,CAAC,CAAC,CAAC;YAEH,kBAAkB,CAAC,IAAI,CAAC,MA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C,sBAAsB,CAC/C,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,CACrB,CAAC;AACJ,CAAC;AAED,YAAY"}
@@ -1,57 +1,57 @@
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
- import { ICreateItemFromTemplateResponse, IDatasourceInfo, IItemProgressCallback, IItemTemplate, IUpdateItemResponse, UserSession } from "@esri/solution-common";
17
- /**
18
- * Converts an item into a template.
19
- *
20
- * @param solutionItemId The solution to contain the template
21
- * @param itemInfo Info about the item
22
- * @param destAuthentication Credentials for requests to the destination organization
23
- * @param srcAuthentication Credentials for requests to source items
24
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
25
- * @returns A promise that will resolve when the template has been created
26
- */
27
- export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
28
- /**
29
- * Delegate to simpleType creator
30
- *
31
- * @param template
32
- * @param templateDictionary
33
- * @param destinationAuthentication
34
- * @param itemProgressCallback
35
- */
36
- export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
37
- /**
38
- * Templatizes field references within specific template types.
39
- * Currently only handles web mapping applications
40
- *
41
- * @param template A solution template
42
- * @param datasourceInfos A list of objects that store key datasource info used to templatizing field references
43
- * @param type The item type
44
- * @returns The updated solution template
45
- */
46
- export declare function postProcessFieldReferences(solutionTemplate: IItemTemplate, datasourceInfos: IDatasourceInfo[], type: string): IItemTemplate;
47
- /**
48
- * Simple Type post-processing actions
49
- *
50
- * @param {string} itemId The item ID
51
- * @param {string} type The template type
52
- * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
53
- * @param {any} templateDictionary The template dictionary
54
- * @param {UserSession} authentication The destination session info
55
- * @returns Promise resolving to successfulness of update
56
- */
57
- export declare function postProcess(itemId: string, type: string, itemInfos: any[], template: IItemTemplate, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<IUpdateItemResponse>;
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
+ import { ICreateItemFromTemplateResponse, IDatasourceInfo, IItemProgressCallback, IItemTemplate, IUpdateItemResponse, UserSession } from "@esri/solution-common";
17
+ /**
18
+ * Converts an item into a template.
19
+ *
20
+ * @param solutionItemId The solution to contain the template
21
+ * @param itemInfo Info about the item
22
+ * @param destAuthentication Credentials for requests to the destination organization
23
+ * @param srcAuthentication Credentials for requests to source items
24
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
25
+ * @returns A promise that will resolve when the template has been created
26
+ */
27
+ export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
28
+ /**
29
+ * Delegate to simpleType creator
30
+ *
31
+ * @param template
32
+ * @param templateDictionary
33
+ * @param destinationAuthentication
34
+ * @param itemProgressCallback
35
+ */
36
+ export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
37
+ /**
38
+ * Templatizes field references within specific template types.
39
+ * Currently only handles web mapping applications
40
+ *
41
+ * @param template A solution template
42
+ * @param datasourceInfos A list of objects that store key datasource info used to templatizing field references
43
+ * @param type The item type
44
+ * @returns The updated solution template
45
+ */
46
+ export declare function postProcessFieldReferences(solutionTemplate: IItemTemplate, datasourceInfos: IDatasourceInfo[], type: string): IItemTemplate;
47
+ /**
48
+ * Simple Type post-processing actions
49
+ *
50
+ * @param {string} itemId The item ID
51
+ * @param {string} type The template type
52
+ * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
53
+ * @param {any} templateDictionary The template dictionary
54
+ * @param {UserSession} authentication The destination session info
55
+ * @returns Promise resolving to successfulness of update
56
+ */
57
+ export declare function postProcess(itemId: string, type: string, itemInfos: any[], template: IItemTemplate, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<IUpdateItemResponse>;
@@ -1,87 +1,87 @@
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 dashboard from "./dashboard";
22
- import * as webmap from "./webmap";
23
- import * as webmappingapplication from "./webmappingapplication";
24
- import { updateItemTemplateFromDictionary } from "@esri/solution-common";
25
- // Need to import collectively to enable spying
26
- import * as simpleTypeHelpers from "./helpers/simple-type-helpers";
27
- /**
28
- * Converts an item into a template.
29
- *
30
- * @param solutionItemId The solution to contain the template
31
- * @param itemInfo Info about the item
32
- * @param destAuthentication Credentials for requests to the destination organization
33
- * @param srcAuthentication Credentials for requests to source items
34
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
35
- * @returns A promise that will resolve when the template has been created
36
- */
37
- export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
38
- return simpleTypeHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
39
- }
40
- /**
41
- * Delegate to simpleType creator
42
- *
43
- * @param template
44
- * @param templateDictionary
45
- * @param destinationAuthentication
46
- * @param itemProgressCallback
47
- */
48
- export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
49
- return simpleTypeHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
50
- }
51
- /**
52
- * Templatizes field references within specific template types.
53
- * Currently only handles web mapping applications
54
- *
55
- * @param template A solution template
56
- * @param datasourceInfos A list of objects that store key datasource info used to templatizing field references
57
- * @param type The item type
58
- * @returns The updated solution template
59
- */
60
- export function postProcessFieldReferences(solutionTemplate, datasourceInfos, type) {
61
- switch (type) {
62
- case "Web Mapping Application":
63
- webmappingapplication.postProcessFieldReferences(solutionTemplate, datasourceInfos);
64
- break;
65
- case "Dashboard":
66
- dashboard.postProcessFieldReferences(solutionTemplate, datasourceInfos);
67
- break;
68
- case "Web Map":
69
- webmap.postProcessFieldReferences(solutionTemplate, datasourceInfos);
70
- break;
71
- }
72
- return solutionTemplate;
73
- }
74
- /**
75
- * Simple Type post-processing actions
76
- *
77
- * @param {string} itemId The item ID
78
- * @param {string} type The template type
79
- * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
80
- * @param {any} templateDictionary The template dictionary
81
- * @param {UserSession} authentication The destination session info
82
- * @returns Promise resolving to successfulness of update
83
- */
84
- export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
85
- return updateItemTemplateFromDictionary(itemId, templateDictionary, authentication);
86
- }
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 dashboard from "./dashboard";
22
+ import * as webmap from "./webmap";
23
+ import * as webmappingapplication from "./webmappingapplication";
24
+ import { updateItemTemplateFromDictionary } from "@esri/solution-common";
25
+ // Need to import collectively to enable spying
26
+ import * as simpleTypeHelpers from "./helpers/simple-type-helpers";
27
+ /**
28
+ * Converts an item into a template.
29
+ *
30
+ * @param solutionItemId The solution to contain the template
31
+ * @param itemInfo Info about the item
32
+ * @param destAuthentication Credentials for requests to the destination organization
33
+ * @param srcAuthentication Credentials for requests to source items
34
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
35
+ * @returns A promise that will resolve when the template has been created
36
+ */
37
+ export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
38
+ return simpleTypeHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
39
+ }
40
+ /**
41
+ * Delegate to simpleType creator
42
+ *
43
+ * @param template
44
+ * @param templateDictionary
45
+ * @param destinationAuthentication
46
+ * @param itemProgressCallback
47
+ */
48
+ export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
49
+ return simpleTypeHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
50
+ }
51
+ /**
52
+ * Templatizes field references within specific template types.
53
+ * Currently only handles web mapping applications
54
+ *
55
+ * @param template A solution template
56
+ * @param datasourceInfos A list of objects that store key datasource info used to templatizing field references
57
+ * @param type The item type
58
+ * @returns The updated solution template
59
+ */
60
+ export function postProcessFieldReferences(solutionTemplate, datasourceInfos, type) {
61
+ switch (type) {
62
+ case "Web Mapping Application":
63
+ webmappingapplication.postProcessFieldReferences(solutionTemplate, datasourceInfos);
64
+ break;
65
+ case "Dashboard":
66
+ dashboard.postProcessFieldReferences(solutionTemplate, datasourceInfos);
67
+ break;
68
+ case "Web Map":
69
+ webmap.postProcessFieldReferences(solutionTemplate, datasourceInfos);
70
+ break;
71
+ }
72
+ return solutionTemplate;
73
+ }
74
+ /**
75
+ * Simple Type post-processing actions
76
+ *
77
+ * @param {string} itemId The item ID
78
+ * @param {string} type The template type
79
+ * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
80
+ * @param {any} templateDictionary The template dictionary
81
+ * @param {UserSession} authentication The destination session info
82
+ * @returns Promise resolving to successfulness of update
83
+ */
84
+ export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
85
+ return updateItemTemplateFromDictionary(itemId, templateDictionary, authentication);
86
+ }
87
87
  //# sourceMappingURL=simple-types.js.map