591 lines
16 KiB
YAML
591 lines
16 KiB
YAML
---
|
|
# This is direct conversion from old api/*/spec.json files
|
|
# using https://www.json2yaml.com/
|
|
#
|
|
# Next step: swagger.
|
|
|
|
endpoints:
|
|
- title: Federation node handshake
|
|
path: "/nodes/{nodeID}/handshake"
|
|
entrypoint: nodeHandshake
|
|
parameters:
|
|
path:
|
|
- name: nodeID
|
|
type: uint64
|
|
required: true
|
|
title: NodeID
|
|
apis:
|
|
- name: initialize
|
|
method: POST
|
|
title: Initialize the handshake step with node B
|
|
path: ""
|
|
parameters:
|
|
post:
|
|
- name: pairToken
|
|
type: string
|
|
required: true
|
|
title: Pairing token to authenticate handshake initialization request
|
|
- name: sharedNodeID
|
|
type: uint64
|
|
required: true
|
|
title: Remote (invoker's) node ID
|
|
- name: authToken
|
|
type: string
|
|
required: true
|
|
title: Authentication token so that remote
|
|
|
|
- title: Federation nodes
|
|
path: "/nodes"
|
|
entrypoint: node
|
|
apis:
|
|
- name: search
|
|
method: GET
|
|
title: Search federated nodes
|
|
path: "/"
|
|
parameters:
|
|
get:
|
|
- name: query
|
|
type: string
|
|
title: Filter nodes by name and host
|
|
- name: status
|
|
type: string
|
|
title: Filter by status
|
|
- type: uint
|
|
name: limit
|
|
title: Limit
|
|
- type: bool
|
|
name: incTotal
|
|
title: Include total counter
|
|
- type: string
|
|
name: pageCursor
|
|
title: Page cursor
|
|
- type: string
|
|
name: sort
|
|
title: Sort items
|
|
|
|
- name: create
|
|
method: POST
|
|
title: Create a new federation node
|
|
path: "/"
|
|
parameters:
|
|
post:
|
|
- name: baseURL
|
|
type: string
|
|
required: false
|
|
title: Federation API base URL
|
|
- name: name
|
|
type: string
|
|
required: false
|
|
title: Name for this node
|
|
- name: contact
|
|
type: string
|
|
required: false
|
|
title: Contact email
|
|
- name: pairingURI
|
|
type: string
|
|
required: false
|
|
title: Pairing URI
|
|
|
|
- name: read
|
|
method: GET
|
|
title: Read a federation node
|
|
path: "/{nodeID}"
|
|
parameters:
|
|
path: [ { name: nodeID, type: uint64, required: true, title: NodeID } ]
|
|
|
|
- name: generateURI
|
|
method: POST
|
|
title: Creates new sharable federation URI
|
|
path: "/{nodeID}/uri"
|
|
parameters: { path: [ { name: nodeID, type: uint64, required: true, title: NodeID } ] }
|
|
|
|
- name: update
|
|
method: POST
|
|
title: Updates existing node
|
|
path: "/{nodeID}"
|
|
parameters:
|
|
path: [ { name: nodeID, type: uint64, required: true, title: NodeID } ]
|
|
post:
|
|
- name: name
|
|
type: string
|
|
required: false
|
|
title: Name for this node
|
|
- name: contact
|
|
type: string
|
|
required: false
|
|
title: Contact email
|
|
- name: baseURL
|
|
type: string
|
|
required: false
|
|
title: Federation API base URL
|
|
|
|
- name: delete
|
|
method: DELETE
|
|
title: Deletes node
|
|
path: "/{nodeID}"
|
|
parameters: { path: [ { name: nodeID, type: uint64, required: true, title: NodeID } ] }
|
|
|
|
- name: undelete
|
|
method: POST
|
|
title: Undeletes a node
|
|
path: "/{nodeID}/undelete"
|
|
parameters: { path: [ { name: nodeID, type: uint64, required: true, title: NodeID } ] }
|
|
|
|
- name: pair
|
|
method: POST
|
|
title: Initialize the pairing process between the two nodes
|
|
path: "/{nodeID}/pair"
|
|
parameters: { path: [ { name: nodeID, type: uint64, required: true, title: NodeID } ] }
|
|
|
|
- name: handshake confirm
|
|
method: POST
|
|
title: Confirm the requested handshake
|
|
path: "/{nodeID}/handshake-confirm"
|
|
parameters: { path: [ { name: nodeID, type: uint64, required: true, title: NodeID } ] }
|
|
|
|
- name: handshake complete
|
|
method: POST
|
|
title: Complete the handshake
|
|
path: "/{nodeID}/handshake-complete"
|
|
parameters:
|
|
path: [ { name: nodeID, type: uint64, required: true, title: NodeID } ]
|
|
post:
|
|
- name: authToken
|
|
type: string
|
|
required: true
|
|
title: Node A token
|
|
|
|
- title: Manage structure
|
|
description: Manage structure
|
|
entrypoint: manageStructure
|
|
path: "/nodes/{nodeID}/modules"
|
|
authentication: []
|
|
imports:
|
|
- github.com/cortezaproject/corteza/server/federation/types
|
|
apis:
|
|
- name: readExposed
|
|
method: GET
|
|
title: Exposed settings for module
|
|
path: "/{moduleID}/exposed"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
- type: uint64
|
|
name: moduleID
|
|
required: true
|
|
title: Module ID
|
|
- name: createExposed
|
|
method: PUT
|
|
title: Add module to federation
|
|
path: "/"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
post:
|
|
- type: uint64
|
|
name: composeModuleID
|
|
required: true
|
|
title: Compose module id
|
|
- type: uint64
|
|
name: composeNamespaceID
|
|
required: true
|
|
title: Compose namespace id
|
|
- type: string
|
|
name: name
|
|
required: true
|
|
title: Module name
|
|
- type: string
|
|
name: handle
|
|
required: true
|
|
title: Module handle
|
|
- type: types.ModuleFieldSet
|
|
name: fields
|
|
required: false
|
|
title: Exposed module fields
|
|
- name: updateExposed
|
|
method: POST
|
|
title: Update already exposed module
|
|
path: "/{moduleID}/exposed"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
- type: uint64
|
|
name: moduleID
|
|
required: true
|
|
title: Module ID
|
|
post:
|
|
- type: uint64
|
|
name: composeModuleID
|
|
required: true
|
|
title: Compose module id
|
|
- type: uint64
|
|
name: composeNamespaceID
|
|
required: true
|
|
title: Compose namespace id
|
|
- type: string
|
|
name: name
|
|
required: true
|
|
title: Module name
|
|
- type: string
|
|
name: handle
|
|
required: true
|
|
title: Module handle
|
|
- type: types.ModuleFieldSet
|
|
name: fields
|
|
required: false
|
|
title: Exposed module fields
|
|
- name: removeExposed
|
|
method: DELETE
|
|
title: Remove from federation
|
|
path: "/{moduleID}/exposed"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
- type: uint64
|
|
name: moduleID
|
|
required: true
|
|
title: Module ID
|
|
- name: readShared
|
|
method: GET
|
|
title: Shared settings for module
|
|
path: "/{moduleID}/shared"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
- type: uint64
|
|
name: moduleID
|
|
required: true
|
|
title: Module ID
|
|
- name: createMappings
|
|
method: PUT
|
|
title: Add fields mappings to federated module
|
|
path: "/{moduleID}/mapped"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
- type: uint64
|
|
name: moduleID
|
|
required: true
|
|
title: Module ID
|
|
post:
|
|
- type: uint64
|
|
name: composeModuleID
|
|
required: true
|
|
title: Compose module id
|
|
- type: uint64
|
|
name: composeNamespaceID
|
|
required: true
|
|
title: Compose namespace id
|
|
- type: types.ModuleFieldMappingSet
|
|
name: fields
|
|
required: false
|
|
title: Exposed module fields
|
|
- name: readMappings
|
|
method: GET
|
|
title: Fields mappings for module
|
|
path: "/{moduleID}/mapped"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
- type: uint64
|
|
name: moduleID
|
|
required: true
|
|
title: Module ID
|
|
get:
|
|
- name: composeModuleID
|
|
type: uint64
|
|
required: false
|
|
title: Compose module id
|
|
- name: listAll
|
|
method: GET
|
|
title: List of shared/exposed/mapped modules
|
|
path: "/"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
get:
|
|
- name: shared
|
|
type: bool
|
|
required: false
|
|
title: List shared modules
|
|
- name: exposed
|
|
type: bool
|
|
required: false
|
|
title: List exposed modules
|
|
- name: mapped
|
|
type: bool
|
|
required: false
|
|
title: List mapped modules
|
|
|
|
- title: Sync structure
|
|
description: Sync structure
|
|
entrypoint: syncStructure
|
|
path: "/nodes/{nodeID}/modules/exposed"
|
|
authentication: []
|
|
apis:
|
|
- name: readExposedInternal
|
|
method: GET
|
|
title: List all exposed modules changes
|
|
path: "/"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
get:
|
|
- type: uint64
|
|
name: lastSync
|
|
required: false
|
|
title: Last sync timestamp
|
|
- type: string
|
|
name: query
|
|
required: false
|
|
title: Search query
|
|
- type: uint
|
|
name: limit
|
|
title: Limit
|
|
- type: string
|
|
name: pageCursor
|
|
title: Page cursor
|
|
- type: string
|
|
name: sort
|
|
title: Sort items
|
|
- name: readExposedSocial
|
|
method: GET
|
|
title: List all exposed modules changes in activity streams format
|
|
path: "/activity-stream"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
get:
|
|
- type: uint64
|
|
name: lastSync
|
|
required: false
|
|
title: Last sync timestamp
|
|
- type: string
|
|
name: query
|
|
required: false
|
|
title: Search query
|
|
- type: uint
|
|
name: limit
|
|
title: Limit
|
|
- type: string
|
|
name: pageCursor
|
|
title: Page cursor
|
|
- type: string
|
|
name: sort
|
|
title: Sort items
|
|
|
|
- title: Sync data
|
|
description: Sync data
|
|
entrypoint: syncData
|
|
path: "/nodes/{nodeID}/modules"
|
|
authentication: []
|
|
apis:
|
|
- name: readExposedAll
|
|
method: GET
|
|
title: List all record changes
|
|
path: "/exposed/records/"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
get:
|
|
- type: uint64
|
|
name: lastSync
|
|
required: false
|
|
title: Last sync timestamp
|
|
- type: string
|
|
name: query
|
|
required: false
|
|
title: Search query
|
|
- type: uint
|
|
name: limit
|
|
title: Limit
|
|
- type: string
|
|
name: pageCursor
|
|
title: Page cursor
|
|
- type: string
|
|
name: sort
|
|
title: Sort items
|
|
- name: readExposedInternal
|
|
method: GET
|
|
title: List all records per module
|
|
path: "/{moduleID}/records/"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
- type: uint64
|
|
name: moduleID
|
|
required: true
|
|
title: Module ID
|
|
get:
|
|
- type: uint64
|
|
name: lastSync
|
|
required: false
|
|
title: Last sync timestamp
|
|
- type: string
|
|
name: query
|
|
required: false
|
|
title: Search query
|
|
- type: uint
|
|
name: limit
|
|
required: false
|
|
title: Limit
|
|
- type: string
|
|
name: pageCursor
|
|
required: false
|
|
title: Page cursor
|
|
- type: string
|
|
name: sort
|
|
required: false
|
|
title: Sort items
|
|
- name: readExposedSocial
|
|
method: GET
|
|
title: List all records per module in activitystreams format
|
|
path: "/{moduleID}/records/activity-stream/"
|
|
parameters:
|
|
path:
|
|
- type: uint64
|
|
name: nodeID
|
|
required: true
|
|
title: Node ID
|
|
- type: uint64
|
|
name: moduleID
|
|
required: true
|
|
title: Module ID
|
|
get:
|
|
- type: uint64
|
|
name: lastSync
|
|
required: false
|
|
title: Last sync timestamp
|
|
- type: string
|
|
name: query
|
|
required: false
|
|
title: Search query
|
|
- type: uint
|
|
name: limit
|
|
required: false
|
|
title: Limit
|
|
- type: string
|
|
name: pageCursor
|
|
required: false
|
|
title: Page cursor
|
|
- type: string
|
|
name: sort
|
|
required: false
|
|
title: Sort items
|
|
|
|
- title: Permissions
|
|
entrypoint: permissions
|
|
path: "/permissions"
|
|
authentication:
|
|
- Client ID
|
|
- Session ID
|
|
imports:
|
|
- github.com/cortezaproject/corteza/server/pkg/rbac
|
|
apis:
|
|
- name: list
|
|
path: "/"
|
|
method: GET
|
|
title: Retrieve defined permissions
|
|
- name: effective
|
|
path: "/effective"
|
|
method: GET
|
|
title: Effective rules for current user
|
|
parameters:
|
|
get:
|
|
- name: resource
|
|
type: string
|
|
required: false
|
|
title: Show only rules for a specific resource
|
|
- name: trace
|
|
path: "/trace"
|
|
method: GET
|
|
title: Evaluate rules for given user/role combo
|
|
parameters:
|
|
get:
|
|
- name: resource
|
|
type: "[]string"
|
|
required: false
|
|
title: Show only rules for a specific resource
|
|
- name: userID
|
|
type: uint64
|
|
required: false
|
|
- name: roleID
|
|
type: "[]uint64"
|
|
required: false
|
|
- name: read
|
|
path: "/{roleID}/rules"
|
|
method: GET
|
|
title: Retrieve role permissions
|
|
parameters:
|
|
path:
|
|
- name: roleID
|
|
type: uint64
|
|
required: true
|
|
title: Role ID
|
|
get:
|
|
- name: resource
|
|
type: "[]string"
|
|
required: false
|
|
title: Show only rules for a specific resource
|
|
- name: delete
|
|
path: "/{roleID}/rules"
|
|
method: DELETE
|
|
title: Remove all defined role permissions
|
|
parameters:
|
|
path:
|
|
- name: roleID
|
|
type: uint64
|
|
required: true
|
|
title: Role ID
|
|
- name: update
|
|
path: "/{roleID}/rules"
|
|
method: PATCH
|
|
title: Update permission settings
|
|
parameters:
|
|
path:
|
|
- name: roleID
|
|
type: uint64
|
|
required: true
|
|
title: Role ID
|
|
post:
|
|
- name: rules
|
|
type: rbac.RuleSet
|
|
required: true
|
|
title: List of permission rules to set
|