@esri/solution-simple-types 4.1.2 → 5.0.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/cjs/dashboard.d.ts +93 -93
- package/dist/cjs/dashboard.js +352 -352
- package/dist/cjs/helpers/convert-item-to-template.d.ts +46 -46
- package/dist/cjs/helpers/convert-item-to-template.js +235 -209
- package/dist/cjs/helpers/convert-item-to-template.js.map +1 -1
- package/dist/cjs/helpers/create-item-from-template.d.ts +17 -17
- package/dist/cjs/helpers/create-item-from-template.js +153 -138
- package/dist/cjs/helpers/create-item-from-template.js.map +1 -1
- package/dist/cjs/helpers/notebook-helpers.d.ts +19 -19
- package/dist/cjs/helpers/notebook-helpers.js +24 -24
- package/dist/cjs/helpers/quickcapture-helpers.d.ts +18 -18
- package/dist/cjs/helpers/quickcapture-helpers.js +22 -22
- package/dist/cjs/helpers/simple-type-helpers.d.ts +18 -18
- package/dist/cjs/helpers/simple-type-helpers.js +22 -22
- package/dist/cjs/helpers/update-notebook-data.d.ts +17 -17
- package/dist/cjs/helpers/update-notebook-data.js +27 -27
- package/dist/cjs/index.d.ts +27 -27
- package/dist/cjs/index.js +36 -36
- package/dist/cjs/notebook.d.ts +66 -66
- package/dist/cjs/notebook.js +133 -133
- package/dist/cjs/oic.d.ts +53 -53
- package/dist/cjs/oic.js +170 -170
- package/dist/cjs/quickcapture.d.ts +76 -87
- package/dist/cjs/quickcapture.js +143 -192
- package/dist/cjs/quickcapture.js.map +1 -1
- package/dist/cjs/simple-types.d.ts +57 -57
- package/dist/cjs/simple-types.js +94 -94
- package/dist/cjs/webmap.d.ts +102 -102
- package/dist/cjs/webmap.js +325 -325
- package/dist/cjs/webmappingapplication.d.ts +176 -176
- package/dist/cjs/webmappingapplication.js +674 -674
- package/dist/cjs/webmappingapplication.js.map +1 -1
- package/dist/cjs/workforce.d.ts +34 -34
- package/dist/cjs/workforce.js +44 -44
- package/dist/esm/dashboard.d.ts +93 -93
- package/dist/esm/dashboard.js +339 -339
- package/dist/esm/helpers/convert-item-to-template.d.ts +46 -46
- package/dist/esm/helpers/convert-item-to-template.js +228 -202
- package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
- package/dist/esm/helpers/create-item-from-template.d.ts +17 -17
- package/dist/esm/helpers/create-item-from-template.js +148 -133
- package/dist/esm/helpers/create-item-from-template.js.map +1 -1
- package/dist/esm/helpers/notebook-helpers.d.ts +19 -19
- package/dist/esm/helpers/notebook-helpers.js +20 -20
- package/dist/esm/helpers/quickcapture-helpers.d.ts +18 -18
- package/dist/esm/helpers/quickcapture-helpers.js +19 -19
- package/dist/esm/helpers/simple-type-helpers.d.ts +18 -18
- package/dist/esm/helpers/simple-type-helpers.js +19 -19
- package/dist/esm/helpers/update-notebook-data.d.ts +17 -17
- package/dist/esm/helpers/update-notebook-data.js +23 -23
- package/dist/esm/index.d.ts +27 -27
- package/dist/esm/index.js +27 -27
- package/dist/esm/notebook.d.ts +66 -66
- package/dist/esm/notebook.js +123 -123
- package/dist/esm/oic.d.ts +53 -53
- package/dist/esm/oic.js +162 -162
- package/dist/esm/quickcapture.d.ts +76 -87
- package/dist/esm/quickcapture.js +131 -179
- package/dist/esm/quickcapture.js.map +1 -1
- package/dist/esm/simple-types.d.ts +57 -57
- package/dist/esm/simple-types.js +86 -86
- package/dist/esm/webmap.d.ts +102 -102
- package/dist/esm/webmap.js +312 -312
- package/dist/esm/webmappingapplication.d.ts +176 -176
- package/dist/esm/webmappingapplication.js +648 -648
- package/dist/esm/webmappingapplication.js.map +1 -1
- package/dist/esm/workforce.d.ts +34 -34
- package/dist/esm/workforce.js +38 -38
- package/package.json +6 -6
|
@@ -1,17 +1,17 @@
|
|
|
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
|
+
/** @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 +1,28 @@
|
|
|
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;
|
|
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
28
|
//# sourceMappingURL=update-notebook-data.js.map
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
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 };
|
|
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/cjs/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
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;
|
|
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
37
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/notebook.d.ts
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* Converts a notebook 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: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
28
|
-
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
|
29
|
-
/**
|
|
30
|
-
* Converts a Python Notebook item to a template.
|
|
31
|
-
*
|
|
32
|
-
* @param itemTemplate template for the Python Notebook
|
|
33
|
-
* @returns templatized itemTemplate
|
|
34
|
-
*/
|
|
35
|
-
export declare function convertNotebookToTemplate(itemTemplate: common.IItemTemplate): common.IItemTemplate;
|
|
36
|
-
/**
|
|
37
|
-
* Remove interpreter and papermill props
|
|
38
|
-
*
|
|
39
|
-
* This function will update the data passed in by removing key props
|
|
40
|
-
*
|
|
41
|
-
* @param data The notebooks data object
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
export declare function deleteProps(data: any): void;
|
|
45
|
-
/**
|
|
46
|
-
* Update the notebooks data
|
|
47
|
-
*
|
|
48
|
-
* @param originalTemplate The original template item
|
|
49
|
-
* @param newlyCreatedItem The current item that may have unswapped variables
|
|
50
|
-
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
51
|
-
* @param authentication Credentials for the requests to the destination
|
|
52
|
-
*
|
|
53
|
-
* @returns A promise that will resolve once any updates have been made
|
|
54
|
-
*/
|
|
55
|
-
export declare function fineTuneCreatedItem(originalTemplate: common.IItemTemplate, newlyCreatedItem: common.IItemTemplate, templateDictionary: any, authentication: common.UserSession): Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* Notebook specific post-processing actions
|
|
58
|
-
*
|
|
59
|
-
* @param {string} itemId The item ID
|
|
60
|
-
* @param {string} type The template type
|
|
61
|
-
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
62
|
-
* @param {any} templateDictionary The template dictionary
|
|
63
|
-
* @param {UserSession} authentication The destination session info
|
|
64
|
-
* @returns {Promise<any>}
|
|
65
|
-
*/
|
|
66
|
-
export declare function postProcess(itemId: string, type: string, itemInfos: any[], template: common.IItemTemplate, templates: common.IItemTemplate[], templateDictionary: any, authentication: common.UserSession): Promise<any>;
|
|
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
|
+
/**
|
|
18
|
+
* Converts a notebook 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: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
28
|
+
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Converts a Python Notebook item to a template.
|
|
31
|
+
*
|
|
32
|
+
* @param itemTemplate template for the Python Notebook
|
|
33
|
+
* @returns templatized itemTemplate
|
|
34
|
+
*/
|
|
35
|
+
export declare function convertNotebookToTemplate(itemTemplate: common.IItemTemplate): common.IItemTemplate;
|
|
36
|
+
/**
|
|
37
|
+
* Remove interpreter and papermill props
|
|
38
|
+
*
|
|
39
|
+
* This function will update the data passed in by removing key props
|
|
40
|
+
*
|
|
41
|
+
* @param data The notebooks data object
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
export declare function deleteProps(data: any): void;
|
|
45
|
+
/**
|
|
46
|
+
* Update the notebooks data
|
|
47
|
+
*
|
|
48
|
+
* @param originalTemplate The original template item
|
|
49
|
+
* @param newlyCreatedItem The current item that may have unswapped variables
|
|
50
|
+
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
51
|
+
* @param authentication Credentials for the requests to the destination
|
|
52
|
+
*
|
|
53
|
+
* @returns A promise that will resolve once any updates have been made
|
|
54
|
+
*/
|
|
55
|
+
export declare function fineTuneCreatedItem(originalTemplate: common.IItemTemplate, newlyCreatedItem: common.IItemTemplate, templateDictionary: any, authentication: common.UserSession): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Notebook specific post-processing actions
|
|
58
|
+
*
|
|
59
|
+
* @param {string} itemId The item ID
|
|
60
|
+
* @param {string} type The template type
|
|
61
|
+
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
62
|
+
* @param {any} templateDictionary The template dictionary
|
|
63
|
+
* @param {UserSession} authentication The destination session info
|
|
64
|
+
* @returns {Promise<any>}
|
|
65
|
+
*/
|
|
66
|
+
export declare function postProcess(itemId: string, type: string, itemInfos: any[], template: common.IItemTemplate, templates: common.IItemTemplate[], templateDictionary: any, authentication: common.UserSession): Promise<any>;
|
package/dist/cjs/notebook.js
CHANGED
|
@@ -1,134 +1,134 @@
|
|
|
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.postProcess = exports.fineTuneCreatedItem = exports.deleteProps = exports.convertNotebookToTemplate = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const common = tslib_1.__importStar(require("@esri/solution-common"));
|
|
21
|
-
// Need to import collectively to enable spying
|
|
22
|
-
const notebookHelpers = tslib_1.__importStar(require("./helpers/notebook-helpers"));
|
|
23
|
-
/**
|
|
24
|
-
* Converts a notebook item into a template.
|
|
25
|
-
*
|
|
26
|
-
* @param solutionItemId The solution to contain the template
|
|
27
|
-
* @param itemInfo Info about the item
|
|
28
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
29
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
30
|
-
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
31
|
-
* @returns A promise that will resolve when the template has been created
|
|
32
|
-
*/
|
|
33
|
-
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
34
|
-
// Delegate back to simple-types, which will in-turn delegate
|
|
35
|
-
// to convertNotebookToTemplate at the correct point in the process
|
|
36
|
-
// This is a temporary refactor step
|
|
37
|
-
return notebookHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
38
|
-
}
|
|
39
|
-
exports.convertItemToTemplate = convertItemToTemplate;
|
|
40
|
-
// Delegate back to simple-types
|
|
41
|
-
// This is a temporary refactor step
|
|
42
|
-
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
43
|
-
return notebookHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
|
|
44
|
-
}
|
|
45
|
-
exports.createItemFromTemplate = createItemFromTemplate;
|
|
46
|
-
/**
|
|
47
|
-
* Converts a Python Notebook item to a template.
|
|
48
|
-
*
|
|
49
|
-
* @param itemTemplate template for the Python Notebook
|
|
50
|
-
* @returns templatized itemTemplate
|
|
51
|
-
*/
|
|
52
|
-
function convertNotebookToTemplate(itemTemplate) {
|
|
53
|
-
// The templates data to process
|
|
54
|
-
const data = itemTemplate.data;
|
|
55
|
-
deleteProps(data);
|
|
56
|
-
let dataString = JSON.stringify(data);
|
|
57
|
-
const idTest = /[0-9A-F]{32}/gim;
|
|
58
|
-
if (data && idTest.test(dataString)) {
|
|
59
|
-
const ids = dataString.match(idTest);
|
|
60
|
-
const verifiedIds = [];
|
|
61
|
-
ids.forEach(id => {
|
|
62
|
-
if (verifiedIds.indexOf(id) === -1) {
|
|
63
|
-
verifiedIds.push(id);
|
|
64
|
-
// templatize the itemId--but only once per unique id
|
|
65
|
-
const regEx = new RegExp(id, "gm");
|
|
66
|
-
dataString = dataString.replace(regEx, "{{" + id + ".itemId}}");
|
|
67
|
-
// update the dependencies
|
|
68
|
-
if (itemTemplate.dependencies.indexOf(id) === -1) {
|
|
69
|
-
itemTemplate.dependencies.push(id);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
itemTemplate.data = JSON.parse(dataString);
|
|
74
|
-
}
|
|
75
|
-
return itemTemplate;
|
|
76
|
-
}
|
|
77
|
-
exports.convertNotebookToTemplate = convertNotebookToTemplate;
|
|
78
|
-
/**
|
|
79
|
-
* Remove interpreter and papermill props
|
|
80
|
-
*
|
|
81
|
-
* This function will update the data passed in by removing key props
|
|
82
|
-
*
|
|
83
|
-
* @param data The notebooks data object
|
|
84
|
-
*
|
|
85
|
-
*/
|
|
86
|
-
function deleteProps(data) {
|
|
87
|
-
/* istanbul ignore else */
|
|
88
|
-
if (data) {
|
|
89
|
-
const props = ["metadata.interpreter", "metadata.papermill"];
|
|
90
|
-
common.deleteProps(data, props);
|
|
91
|
-
(data.cells || []).forEach((cell) => {
|
|
92
|
-
common.deleteProps(cell, props);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.deleteProps = deleteProps;
|
|
97
|
-
/**
|
|
98
|
-
* Update the notebooks data
|
|
99
|
-
*
|
|
100
|
-
* @param originalTemplate The original template item
|
|
101
|
-
* @param newlyCreatedItem The current item that may have unswapped variables
|
|
102
|
-
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
103
|
-
* @param authentication Credentials for the requests to the destination
|
|
104
|
-
*
|
|
105
|
-
* @returns A promise that will resolve once any updates have been made
|
|
106
|
-
*/
|
|
107
|
-
function fineTuneCreatedItem(originalTemplate, newlyCreatedItem, templateDictionary, authentication) {
|
|
108
|
-
return new Promise((resolve, reject) => {
|
|
109
|
-
const updateOptions = {
|
|
110
|
-
id: newlyCreatedItem.itemId,
|
|
111
|
-
url: newlyCreatedItem.item.url,
|
|
112
|
-
data: common.jsonToFile(newlyCreatedItem.data, newlyCreatedItem.itemId + ".ipynb")
|
|
113
|
-
};
|
|
114
|
-
common
|
|
115
|
-
.updateItem(updateOptions, authentication)
|
|
116
|
-
.then(() => resolve(null), reject);
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
exports.fineTuneCreatedItem = fineTuneCreatedItem;
|
|
120
|
-
/**
|
|
121
|
-
* Notebook specific post-processing actions
|
|
122
|
-
*
|
|
123
|
-
* @param {string} itemId The item ID
|
|
124
|
-
* @param {string} type The template type
|
|
125
|
-
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
126
|
-
* @param {any} templateDictionary The template dictionary
|
|
127
|
-
* @param {UserSession} authentication The destination session info
|
|
128
|
-
* @returns {Promise<any>}
|
|
129
|
-
*/
|
|
130
|
-
function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
131
|
-
return common.updateItemTemplateFromDictionary(itemId, templateDictionary, authentication);
|
|
132
|
-
}
|
|
133
|
-
exports.postProcess = postProcess;
|
|
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.postProcess = exports.fineTuneCreatedItem = exports.deleteProps = exports.convertNotebookToTemplate = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const common = tslib_1.__importStar(require("@esri/solution-common"));
|
|
21
|
+
// Need to import collectively to enable spying
|
|
22
|
+
const notebookHelpers = tslib_1.__importStar(require("./helpers/notebook-helpers"));
|
|
23
|
+
/**
|
|
24
|
+
* Converts a notebook item into a template.
|
|
25
|
+
*
|
|
26
|
+
* @param solutionItemId The solution to contain the template
|
|
27
|
+
* @param itemInfo Info about the item
|
|
28
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
29
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
30
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
31
|
+
* @returns A promise that will resolve when the template has been created
|
|
32
|
+
*/
|
|
33
|
+
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
34
|
+
// Delegate back to simple-types, which will in-turn delegate
|
|
35
|
+
// to convertNotebookToTemplate at the correct point in the process
|
|
36
|
+
// This is a temporary refactor step
|
|
37
|
+
return notebookHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
38
|
+
}
|
|
39
|
+
exports.convertItemToTemplate = convertItemToTemplate;
|
|
40
|
+
// Delegate back to simple-types
|
|
41
|
+
// This is a temporary refactor step
|
|
42
|
+
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
43
|
+
return notebookHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
|
|
44
|
+
}
|
|
45
|
+
exports.createItemFromTemplate = createItemFromTemplate;
|
|
46
|
+
/**
|
|
47
|
+
* Converts a Python Notebook item to a template.
|
|
48
|
+
*
|
|
49
|
+
* @param itemTemplate template for the Python Notebook
|
|
50
|
+
* @returns templatized itemTemplate
|
|
51
|
+
*/
|
|
52
|
+
function convertNotebookToTemplate(itemTemplate) {
|
|
53
|
+
// The templates data to process
|
|
54
|
+
const data = itemTemplate.data;
|
|
55
|
+
deleteProps(data);
|
|
56
|
+
let dataString = JSON.stringify(data);
|
|
57
|
+
const idTest = /[0-9A-F]{32}/gim;
|
|
58
|
+
if (data && idTest.test(dataString)) {
|
|
59
|
+
const ids = dataString.match(idTest);
|
|
60
|
+
const verifiedIds = [];
|
|
61
|
+
ids.forEach(id => {
|
|
62
|
+
if (verifiedIds.indexOf(id) === -1) {
|
|
63
|
+
verifiedIds.push(id);
|
|
64
|
+
// templatize the itemId--but only once per unique id
|
|
65
|
+
const regEx = new RegExp(id, "gm");
|
|
66
|
+
dataString = dataString.replace(regEx, "{{" + id + ".itemId}}");
|
|
67
|
+
// update the dependencies
|
|
68
|
+
if (itemTemplate.dependencies.indexOf(id) === -1) {
|
|
69
|
+
itemTemplate.dependencies.push(id);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
itemTemplate.data = JSON.parse(dataString);
|
|
74
|
+
}
|
|
75
|
+
return itemTemplate;
|
|
76
|
+
}
|
|
77
|
+
exports.convertNotebookToTemplate = convertNotebookToTemplate;
|
|
78
|
+
/**
|
|
79
|
+
* Remove interpreter and papermill props
|
|
80
|
+
*
|
|
81
|
+
* This function will update the data passed in by removing key props
|
|
82
|
+
*
|
|
83
|
+
* @param data The notebooks data object
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
function deleteProps(data) {
|
|
87
|
+
/* istanbul ignore else */
|
|
88
|
+
if (data) {
|
|
89
|
+
const props = ["metadata.interpreter", "metadata.papermill"];
|
|
90
|
+
common.deleteProps(data, props);
|
|
91
|
+
(data.cells || []).forEach((cell) => {
|
|
92
|
+
common.deleteProps(cell, props);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.deleteProps = deleteProps;
|
|
97
|
+
/**
|
|
98
|
+
* Update the notebooks data
|
|
99
|
+
*
|
|
100
|
+
* @param originalTemplate The original template item
|
|
101
|
+
* @param newlyCreatedItem The current item that may have unswapped variables
|
|
102
|
+
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
103
|
+
* @param authentication Credentials for the requests to the destination
|
|
104
|
+
*
|
|
105
|
+
* @returns A promise that will resolve once any updates have been made
|
|
106
|
+
*/
|
|
107
|
+
function fineTuneCreatedItem(originalTemplate, newlyCreatedItem, templateDictionary, authentication) {
|
|
108
|
+
return new Promise((resolve, reject) => {
|
|
109
|
+
const updateOptions = {
|
|
110
|
+
id: newlyCreatedItem.itemId,
|
|
111
|
+
url: newlyCreatedItem.item.url,
|
|
112
|
+
data: common.jsonToFile(newlyCreatedItem.data, newlyCreatedItem.itemId + ".ipynb")
|
|
113
|
+
};
|
|
114
|
+
common
|
|
115
|
+
.updateItem(updateOptions, authentication)
|
|
116
|
+
.then(() => resolve(null), reject);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
exports.fineTuneCreatedItem = fineTuneCreatedItem;
|
|
120
|
+
/**
|
|
121
|
+
* Notebook specific post-processing actions
|
|
122
|
+
*
|
|
123
|
+
* @param {string} itemId The item ID
|
|
124
|
+
* @param {string} type The template type
|
|
125
|
+
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
126
|
+
* @param {any} templateDictionary The template dictionary
|
|
127
|
+
* @param {UserSession} authentication The destination session info
|
|
128
|
+
* @returns {Promise<any>}
|
|
129
|
+
*/
|
|
130
|
+
function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
131
|
+
return common.updateItemTemplateFromDictionary(itemId, templateDictionary, authentication);
|
|
132
|
+
}
|
|
133
|
+
exports.postProcess = postProcess;
|
|
134
134
|
//# sourceMappingURL=notebook.js.map
|