Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function createFeatureService(
requestOptions: ICreateServiceOptions
): Promise {
const owner = determineOwner(requestOptions);
const baseUrl = `${getPortalUrl(requestOptions)}/content/users/${owner}`;
const url = `${baseUrl}/createService`;
const options: ICreateServiceOptions = {
...requestOptions,
rawResponse: false
};
// Create the service
options.params = {
createParameters: options.item,
outputType: "featureService",
...options.params
};
if (!options.folderId || options.folderId === "/") {
// If the service is destined for the root folder, just send the request