UNPKG

@esri/solution-common

Version:

Provides general helper functions for @esri/solution.js.

58 lines (57 loc) 2.68 kB
/** @license * Copyright 2024 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { IItemTemplate } from "./interfaces"; /** * Store any web tool urls in the templateDictionary so we can use them to search other items * after they have been converted to templates * * @param template the current template * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements * */ export declare function preProcessWebTool(template: IItemTemplate, templateDictionary: any): void; /** * Use any stored GPServer urls to search all other templates for potential references * This will allow us to replace the base server name as will as the itemId * * @param templates the list of all the templates in the solution * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements * * @returns potentially updated list of all the templates in the solution */ export declare function postProcessWebToolReferences(templates: IItemTemplate[], templateDictionary: any): IItemTemplate[]; /** * Use any stored GPServer urls to search all other templates for potential references * This will allow us to replace the base server name as will as the itemId * * @param templates the list of all the templates in the solution * @param orgUrl the item url of the GPServer * @param templatizedUrl the templatized GPServer Url * @param orgItemId the item id of the GPServer * * @returns potentially updated list of all the templates in the solution */ export declare function _globalTemplatize(templates: IItemTemplate[], orgUrl: string, templatizedUrl: string, orgItemId: string): IItemTemplate[]; /** * Update the templates dependencies if we can detect differences after we try and replace a GPServer url * * @param template the current template * @param itemString stringified version of the the templates item before we replaced anything * @param dataString stringified version of the the templates data before we replaced anything * @param id the current item Id of the GPServer * */ export declare function _updateDependencies(template: IItemTemplate, itemString: string, dataString: string, id: string): void;