import { IProcessorConversionOutput, IProcessor, IItemTemplate, IDeployedTemplateResponse, ISolutionVariables, IDeployable, IRemovedItem, IPostProcessResult } from '@esri/templates-common'; import { IItem, IPortal } from '@esri/arcgis-rest-portal'; import { ITable } from '@esri/arcgis-rest-types'; import { IUser, UserSession } from '@esri/arcgis-rest-auth'; import { ILayerDefinition, IAddToServiceDefinitionOptions } from '@esri/arcgis-rest-service-admin'; import { IExtent } from '@esri/arcgis-rest-feature-layer'; /** * Handles Processing for Feature Services, and Feature Service Views * * Note: The conversion process requires access to the /admin/.../FeatureServer * route, which is restricted to the item owner or the org admin. */ export default class FeatureServiceProcessor implements IProcessor { constructor(); name: string; /** * Can this processor convert this item to a template? * * @param {IItem} item * @return {*} {boolean} */ canConvert(item: IItem): boolean; /** * Can this processor deploy this item template? * * @param {IItemTemplate} itemTemplate * @return {*} {boolean} */ canDeploy(itemTemplate: IItemTemplate): boolean; /** * Can this processor remove this item? * * @param {IItem} item * @return {*} {boolean} */ canRemove(item: IItem): boolean; /** * Can a specific user deploy this specific template? * * * @param {IItemTemplate} item * @param {IUser} user * @return {*} {IDeployable} */ canUserDeploy(item: IItemTemplate, user: IUser, _portal: IPortal): IDeployable; /** * Convert a Feature Service into a Template * * @param {IItem} item * @param {UserSession} srcSession Credentials for fetching information * @param {Record} [params] * @return {*} {Promise} */ convertToTemplate(item: IItem, srcSession: UserSession): Promise; /** * Deploy a Feature Service from a template. * * Handles Feature Services and Feature Service Views * * @param {IItemTemplate} template * @param {ISolutionVariables} variables * @param {UserSession} srcSession Credentials for fetching information * @param {UserSession} destSession Credentials for writing information * @return {*} {Promise} */ deployFromTemplate(template: IItemTemplate, variables: ISolutionVariables, srcSession: UserSession, destSession: UserSession): Promise; /** * Can this handle post-processing for a specific item * * @param {IItem} item * @return {*} {boolean} */ canPostProcess(item: IItem): boolean; /** * Post Process the Service * * Previous solution.js would do a second pass interpolation * over the item, but it seems like that was "default" behavior * vs there being an actual case where the "item" json would have * un-interpolated values in it. * Thus, until we run into a scenario that requires that, we are * simply resolving */ postProcess(): Promise; /** * Remove the Feature Service Item * * At this point, this is very simplistic - just removes the item * We may need to make this smarter so that it checks Related Items * and due to cascading deletes, we may want to check the failure * to see if the item has actually been removed prior to getting * to this call * * @param {IItem} item * @param {UserSession} session * @return {*} {Promise} */ remove(item: IItem, session: UserSession): Promise; } export declare function withoutPrimaryKeys(indexes: ILayerDefinition[]): ILayerDefinition[]; export declare function createDefinitionOptions(layerTemplates: ILayerDefinition[], tableTemplates: ITable[], session: UserSession, extent: IExtent, isView: boolean): IAddToServiceDefinitionOptions;