Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-7331][WIP] V2 Project Reference PR #75

Draft
wants to merge 37 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aa5e9fd
Merge tag '24.01.0' into develop
cslzchen Sep 19, 2024
dde42b7
add first draft of Notification Subscription section
Johnetordoff Mar 10, 2025
266225a
Add actions and user settings
Johnetordoff Mar 13, 2025
ca1c6ac
add region
Johnetordoff Mar 14, 2025
c41145c
add tokens
Johnetordoff Mar 14, 2025
68752cb
add Application docs
Johnetordoff Mar 14, 2025
e7db481
add Oauth scopes
Johnetordoff Mar 14, 2025
54a6542
fix typo
Johnetordoff Mar 18, 2025
81259b4
Merge branch 'develop' of https://github.com/CenterForOpenScience/dev…
Johnetordoff Mar 18, 2025
254199e
Add Oauth scopes, Apps, tokens and Regions to docs
Johnetordoff Mar 18, 2025
cf105b2
Add miscellaneous and top-level API docs to complete documentation of…
Johnetordoff Mar 18, 2025
d4b6d2b
add routes for registrations, nodes and preprints
Johnetordoff Mar 17, 2025
1819611
add provider routes
Johnetordoff Mar 18, 2025
3a87868
add Identifier detail for top level route and add description text
Johnetordoff Mar 20, 2025
777fc69
fix mistakes and typos
Johnetordoff Mar 20, 2025
cc3746d
Merge pull request #67 from Johnetordoff/add-identifier-info
Johnetordoff Mar 21, 2025
426eedf
Merge branch 'develop' into add-user-settings-info
Johnetordoff Mar 21, 2025
9a7185b
Merge branch 'develop' into add-subscriptions-info
Johnetordoff Mar 21, 2025
81b216b
Merge pull request #66 from Johnetordoff/add-subscriptions-info
Johnetordoff Mar 21, 2025
30c68ac
Merge branch 'develop' into add-scopes
Johnetordoff Mar 21, 2025
6eeecc4
Merge pull request #74 from CenterForOpenScience/add-scopes
Johnetordoff Mar 21, 2025
f5ee6ed
Merge branch 'develop' into add-draft-registrations-request-logs-reso…
Johnetordoff Mar 21, 2025
37f880e
minor syntax and formatting changes
Johnetordoff Mar 24, 2025
ec34f36
Merge pull request #76 from Johnetordoff/clean-up-develop
Johnetordoff Mar 24, 2025
65c7485
fix preprint provider issues
Johnetordoff Mar 24, 2025
6261868
fix missing provider routes and definations
Johnetordoff Mar 24, 2025
acfe164
Merge branch 'develop' of https://github.com/CenterForOpenScience/dev…
Johnetordoff Mar 24, 2025
7846367
improve draft registration institution and subjects relationships
Johnetordoff Mar 27, 2025
eb56556
fix issues with resources, subjects, custom metadata and guids
Johnetordoff Mar 27, 2025
f8d41d4
Merge pull request #73 from CenterForOpenScience/add-draft-registrati…
Johnetordoff Mar 27, 2025
82ee1f9
Merge branch 'develop' of https://github.com/CenterForOpenScience/dev…
Johnetordoff Mar 28, 2025
ba3e9c2
remove cookie info
Johnetordoff Mar 28, 2025
3176ef5
add ` - Registration Providers` section
Johnetordoff Mar 28, 2025
f7eb71e
Merge pull request #71 from CenterForOpenScience/add-provider-routes
Johnetordoff Mar 28, 2025
aa317b0
Merge branch 'develop' of https://github.com/CenterForOpenScience/dev…
Johnetordoff Mar 28, 2025
33cc670
clean up OSF resource code
Johnetordoff Mar 31, 2025
a097519
Merge pull request #72 from CenterForOpenScience/add-registration-nod…
Johnetordoff Mar 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions swagger-spec/actions/action_detail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# /actions/{action_id}/:

get:
summary: Retrieve an Action by ID
description: >-
Retrieve the details of a specific Action by its unique identifier.

Actions represent state transitions and comments on reviewable resources
such as preprints, registrations, node requests, schema responses, and
collection submissions.

An Action includes information about who performed the action (creator),
the state change it caused (from_state to to_state), the trigger used to initiate
the action, and any optional comment. The action may also include links to
related resources, such as the target and the provider.

#### Returns

A JSON object with a `data` key containing the full representation of the action.

#### Permissions

- You must have at least read permissions on the resource the action applies to.
- Only authorized users can view non-public actions (`visible: false`).

#### Errors

If the request is unsuccessful, an `errors` key will be returned. Refer to the
[Errors and Error Codes documentation](#tag/Errors-and-Error-Codes) for more information.

tags:
- Actions
operationId: action_detail_read
parameters:
- in: path
name: action_id
type: string
required: true
description: >-
The unique identifier of the action to retrieve.

Example: `abc123`
responses:
'200':
description: Action retrieved successfully.
examples:
application/json:
data:
id: abc123
type: review-actions
attributes:
trigger: accept
comment: "The submission was approved by the moderator."
from_state: pending
to_state: accepted
date_created: '2024-01-01T00:00:00Z'
date_modified: '2024-01-01T01:00:00Z'
auto: false
visible: true
relationships:
creator:
links:
related:
href: 'https://api.osf.io/v2/users/user456/'
meta: {}
data:
id: user456
type: users
target:
links:
related:
href: 'https://api.osf.io/v2/preprints/preprint789/'
meta: {}
data:
id: preprint789
type: preprints
provider:
links:
related:
href: 'https://api.osf.io/v2/providers/osf/'
meta: {}
data:
id: osf
type: providers
links:
self: 'https://api.osf.io/v2/actions/abc123/'
'403':
description: >-
Permission denied.

You do not have permission to view this action. Only users with the
appropriate permissions on the resource or provider can view actions.
'404':
description: >-
Action not found.

The specified action ID does not exist or is not accessible. Ensure you
have the correct ID and necessary permissions.
183 changes: 183 additions & 0 deletions swagger-spec/actions/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
type: object
required:
- id
- type
- attributes
- relationships
properties:
id:
type: string
description: The unique identifier of the action.
example: abc123

type:
type: string
description: The type of action resource.
enum:
- review-actions
- node-request-actions
- preprint-request-actions
- registration-actions
- schema-response-actions
- collection-submission-actions
example: review-actions

attributes:
type: object
required:
- trigger
- from_state
- to_state
- date_created
- date_modified
properties:
trigger:
type: string
description: >
The trigger that initiated the action.
Triggers correspond to state changes in the workflow and may include submit, accept, reject, withdraw, etc.
example: accept

comment:
type: string
description: >
Optional comment explaining the rationale for the action or providing additional details.
example: This submission looks good to me.

from_state:
type: string
description: >
The state of the resource before the action was performed.
This reflects the resource's state prior to the trigger being executed.
example: pending

to_state:
type: string
description: >
The state of the resource after the action was performed.
This reflects the resource's updated state as a result of the trigger.
example: accepted

date_created:
type: string
format: date-time
description: The date and time when the action was created.
example: '2024-01-01T00:00:00Z'

date_modified:
type: string
format: date-time
description: The date and time when the action was last modified.
example: '2024-01-01T01:00:00Z'

auto:
type: boolean
description: >
Indicates whether the action was automatically generated by the system (true)
or manually triggered by a user (false).
example: false

visible:
type: boolean
description: >
Indicates whether the action is visible to non-admin users (true)
or only visible to admins and moderators (false).
Visibility typically depends on the provider's review workflow and moderation settings.
example: true

relationships:
type: object
required:
- creator
- target
properties:
creator:
type: object
description: The user who performed the action.
properties:
links:
type: object
properties:
related:
type: object
properties:
href:
type: string
format: uri
example: 'https://api.osf.io/v2/users/user456/'
meta:
type: object
example: {}
data:
type: object
properties:
id:
type: string
example: user456
type:
type: string
example: users

target:
type: object
description: The resource (preprint, registration, node request, etc.) on which the action was performed.
properties:
links:
type: object
properties:
related:
type: object
properties:
href:
type: string
format: uri
example: 'https://api.osf.io/v2/preprints/preprint789/'
meta:
type: object
example: {}
data:
type: object
properties:
id:
type: string
example: preprint789
type:
type: string
example: preprints

provider:
type: object
description: >
The provider responsible for managing the review or moderation workflow for the target resource.
properties:
links:
type: object
properties:
related:
type: object
properties:
href:
type: string
format: uri
example: 'https://api.osf.io/v2/providers/osf/'
meta:
type: object
example: {}
data:
type: object
properties:
id:
type: string
example: osf
type:
type: string
example: providers

links:
type: object
properties:
self:
type: string
format: uri
description: The canonical API endpoint for this action.
example: 'https://api.osf.io/v2/actions/abc123/'
Loading