-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* unexport PulpAPI * unused exports * remove FeatureFlagsAPI, SettingsAPI, MyNamespaceAPI, and related types * inline some types * task list - import src/api * cleanup unused exports, is_anonymous, settings, flags * move caching logic to utils * convert api to objects drop HubAPI * move auth handler to PulpAPI * template strings in api urls rg base.delete | cut -d: -f1 | while read fn; do echo fn=$fn ; api=`rg apiPath' =' "$fn" | cut -d\' -f2 ` ; echo api=$api ; perl -i -npe 's#base.delete\(([^,]+)\)#base.http.delete(`'"$api"'\${$1}/`)#g' "$fn" ; done * fixup GenericPulpAPI - make get not add pagination * tag apis that used to be HubAPI with a FIXME * fixup comments * drop most AppContext.user * drop context selectedRepo & updateTitle * fix collections versions list api
- Loading branch information
Showing
98 changed files
with
924 additions
and
1,411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { HubAPI } from './hub'; | ||
import { PulpAPI } from './pulp'; | ||
|
||
class API extends HubAPI { | ||
apiPath = 'v3/plugin/execution-environments/repositories/'; | ||
const base = new PulpAPI(); | ||
|
||
list(id, page) { | ||
return super.list({ page: page }, this.apiPath + id + '/_content/history/'); | ||
} | ||
} | ||
|
||
export const ActivitiesAPI = new API(); | ||
// FIXME HubAPI | ||
export const ActivitiesAPI = { | ||
listRepo: (id, params?) => | ||
base.list( | ||
`v3/plugin/execution-environments/repositories/${id}/_content/history/`, | ||
params, | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { PulpAPI } from './pulp'; | ||
|
||
class API extends PulpAPI { | ||
apiPath = 'distributions/ansible/ansible/'; | ||
const base = new PulpAPI(); | ||
|
||
// list(params?) | ||
// delete(pk) | ||
} | ||
export const AnsibleDistributionAPI = { | ||
create: (data) => base.http.post(`distributions/ansible/ansible/`, data), | ||
|
||
export const AnsibleDistributionAPI = new API(); | ||
delete: (id) => base.http.delete(`distributions/ansible/ansible/${id}/`), | ||
|
||
list: (params?) => base.list(`distributions/ansible/ansible/`, params), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,73 @@ | ||
import { PulpAPI } from './pulp'; | ||
|
||
class API extends PulpAPI { | ||
apiPath = 'repositories/ansible/ansible/'; | ||
const base = new PulpAPI(); | ||
|
||
// list(params?) | ||
|
||
listVersions(pulp_id: string, params?) { | ||
return this.list(params, this.apiPath + pulp_id + '/versions/'); | ||
} | ||
|
||
// delete(pulp_id: string) | ||
|
||
sync(pulp_id: string, body = {}) { | ||
return this.http.post(this.apiPath + pulp_id + '/sync/', body); | ||
} | ||
|
||
revert(pulp_id: string, version_href) { | ||
return this.http.post(this.apiPath + pulp_id + '/modify/', { | ||
base_version: version_href, | ||
}); | ||
} | ||
|
||
addContent(pulp_id: string, collection_version_hrefs) { | ||
return this.http.post(this.apiPath + pulp_id + '/modify/', { | ||
export const AnsibleRepositoryAPI = { | ||
addContent: (id: string, collection_version_hrefs) => | ||
base.http.post(`repositories/ansible/ansible/${id}/modify/`, { | ||
add_content_units: collection_version_hrefs, | ||
}); | ||
} | ||
}), | ||
|
||
removeContent(pulp_id: string, collection_version_href) { | ||
return this.http.post(this.apiPath + pulp_id + '/modify/', { | ||
remove_content_units: [collection_version_href], | ||
}); | ||
} | ||
|
||
listRoles(pulp_id: string, params?) { | ||
return super.list(params, this.apiPath + pulp_id + '/list_roles/'); | ||
} | ||
|
||
addRole(pulp_id: string, role) { | ||
return super.create(role, this.apiPath + pulp_id + '/add_role/'); | ||
} | ||
addRole: (id: string, role) => | ||
base.http.post(`repositories/ansible/ansible/${id}/add_role/`, role), | ||
|
||
myPermissions(pulp_id: string, params?) { | ||
return super.list(params, this.apiPath + pulp_id + '/my_permissions/'); | ||
} | ||
|
||
removeRole(pulp_id: string, role) { | ||
return super.create(role, this.apiPath + pulp_id + '/remove_role/'); | ||
} | ||
|
||
copyCollectionVersion( | ||
pulp_id: string, | ||
copyCollectionVersion: ( | ||
id: string, | ||
body: { | ||
collection_versions: string[]; | ||
destination_repositories: string[]; | ||
signing_service?: string; | ||
}, | ||
) { | ||
return this.http.post( | ||
this.apiPath + pulp_id + '/copy_collection_version/', | ||
) => | ||
base.http.post( | ||
`repositories/ansible/ansible/${id}/copy_collection_version/`, | ||
body, | ||
); | ||
} | ||
), | ||
|
||
create: (data) => base.http.post(`repositories/ansible/ansible/`, data), | ||
|
||
moveCollectionVersion( | ||
pulp_id: string, | ||
delete: (id) => base.http.delete(`repositories/ansible/ansible/${id}/`), | ||
|
||
list: (params?) => base.list(`repositories/ansible/ansible/`, params), | ||
|
||
listRoles: (id: string, params?) => | ||
base.list(`repositories/ansible/ansible/${id}/list_roles/`, params), | ||
|
||
listVersions: (id: string, params?) => | ||
base.list(`repositories/ansible/ansible/${id}/versions/`, params), | ||
|
||
moveCollectionVersion: ( | ||
id: string, | ||
body: { | ||
collection_versions: string[]; | ||
destination_repositories: string[]; | ||
signing_service?: string; | ||
}, | ||
) { | ||
return this.http.post( | ||
this.apiPath + pulp_id + '/move_collection_version/', | ||
) => | ||
base.http.post( | ||
`repositories/ansible/ansible/${id}/move_collection_version/`, | ||
body, | ||
); | ||
} | ||
} | ||
), | ||
|
||
myPermissions: (id: string, params?) => | ||
base.list(`repositories/ansible/ansible/${id}/my_permissions/`, params), | ||
|
||
removeContent: (id: string, collection_version_href) => | ||
base.http.post(`repositories/ansible/ansible/${id}/modify/`, { | ||
remove_content_units: [collection_version_href], | ||
}), | ||
|
||
removeRole: (id: string, role) => | ||
base.http.post(`repositories/ansible/ansible/${id}/remove_role/`, role), | ||
|
||
revert: (id: string, version_href) => | ||
base.http.post(`repositories/ansible/ansible/${id}/modify/`, { | ||
base_version: version_href, | ||
}), | ||
|
||
sync: (id: string, body = {}) => | ||
base.http.post(`repositories/ansible/ansible/${id}/sync/`, body), | ||
|
||
export const AnsibleRepositoryAPI = new API(); | ||
update: (id: string, data) => | ||
base.http.put(`repositories/ansible/ansible/${id}/`, data), | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.