import { IInitiativeModel , IModel } from "@esri/hub-common" ; import { IRequestOptions } from "@esri/arcgis-rest-request" ; import { saveModel } from "./model" ; import { getHubApiUrl } from "@esri/hub-common" ; export const INITIATIVE_TYPE_NAME = "Hub Initiative" ; export param { IInitiativeModel } model param { IRequestOptions } requestOptions returns { Promise < IInitiativeModel > } export function addInitiative ( model , requestOptions ) { return saveModel ( model , requestOptions ) ; } export param { string } itemId param { IRequestOptions } requestOptions returns { string } export function getInitiativeUrl ( itemId , requestOptions ? ) { return `${ getHubApiUrl ( requestOptions ) }/admin/initiatives/${ itemId }` ; }