2019-10-02 07:18:17 -04:00
|
|
|
/**
|
2024-05-30 14:13:41 -04:00
|
|
|
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-08-30 05:35:18 -04:00
|
|
|
*/
|
|
|
|
|
|
2019-10-03 11:08:39 -04:00
|
|
|
import { loadState } from '@nextcloud/initial-state'
|
2020-05-07 15:27:35 -04:00
|
|
|
import { generateOcsUrl } from '@nextcloud/router'
|
2019-10-03 11:08:39 -04:00
|
|
|
|
2019-10-15 14:19:38 -04:00
|
|
|
const scopeValue = loadState('workflowengine', 'scope') === 0 ? 'global' : 'user'
|
|
|
|
|
|
2025-10-01 10:03:40 -04:00
|
|
|
/**
|
|
|
|
|
*
|
2019-08-30 05:35:18 -04:00
|
|
|
* @param url
|
2025-10-01 10:03:40 -04:00
|
|
|
*/
|
2019-08-30 05:35:18 -04:00
|
|
|
function getApiUrl(url) {
|
2021-07-15 08:46:14 -04:00
|
|
|
return generateOcsUrl('apps/workflowengine/api/v1/workflows/{scopeValue}', { scopeValue }) + url + '?format=json'
|
2019-08-30 05:35:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export {
|
2019-11-13 07:05:10 -05:00
|
|
|
getApiUrl,
|
2019-08-30 05:35:18 -04:00
|
|
|
}
|