openapi: massive crud

This commit is contained in:
Quaternions 2024-12-05 16:32:48 -08:00
parent 1a48a4fb5a
commit 3b85c98e10

View File

@ -10,6 +10,8 @@ tags:
description: Submission operations description: Submission operations
- name: Scripts - name: Scripts
description: Script operations description: Script operations
- name: ScriptPolicy
description: Script policy operations
security: security:
- cookieAuth: [] - cookieAuth: []
paths: paths:
@ -326,15 +328,38 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/script-policy/hash/{Hash}: /script-policy:
# /script-policy/id/{ScriptPolicyID}: post:
summary: Create a new script policy
operationId: createScriptPolicy
tags:
- ScriptPolicy
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ScriptPolicyCreate'
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/Id"
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/script-policy/hash/{FromScriptHash}:
get: get:
summary: Get the policy for the given hash of script source code summary: Get the policy for the given hash of script source code
operationId: getScriptPolicyFromHash operationId: getScriptPolicyFromHash
tags: tags:
- Scripts - ScriptPolicy
parameters: parameters:
- name: Hash - name: FromScriptHash
in: path in: path
required: true required: true
schema: schema:
@ -352,6 +377,103 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/script-policy/id/{ScriptPolicyID}:
get:
summary: Get the specified script policy by ID
operationId: getScriptPolicy
tags:
- ScriptPolicy
parameters:
- name: ScriptPolicyID
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/ScriptPolicy"
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
patch:
summary: Update the specified script policy by ID
operationId: updateScriptPolicy
tags:
- ScriptPolicy
parameters:
- name: ScriptPolicyID
in: path
required: true
schema:
type: integer
format: int64
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ScriptPolicyUpdate'
responses:
"200":
description: Successful response
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
delete:
summary: Delete the specified script policy by ID
operationId: deleteScriptPolicy
tags:
- ScriptPolicy
parameters:
- name: ScriptPolicyID
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Successful response
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/scripts:
post:
summary: Create a new script
operationId: createScript
tags:
- Scripts
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ScriptCreate'
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/Id"
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/scripts/{ScriptID}: /scripts/{ScriptID}:
get: get:
summary: Get the specified script by ID summary: Get the specified script by ID
@ -378,6 +500,53 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
patch:
summary: Update the specified script by ID
operationId: updateScript
tags:
- Scripts
parameters:
- name: ScriptID
in: path
required: true
schema:
type: integer
format: int64
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ScriptUpdate'
responses:
"200":
description: Successful response
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
delete:
summary: Delete the specified script by ID
operationId: deleteScript
tags:
- Scripts
parameters:
- name: ScriptID
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Successful response
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components: components:
securitySchemes: securitySchemes:
cookieAuth: cookieAuth:
@ -386,23 +555,27 @@ components:
name: SESSIONID name: SESSIONID
schemas: schemas:
Id: Id:
required:
- ID
type: object type: object
properties: properties:
ID: ID:
type: integer type: integer
format: int64 format: int64
User:
type: object
properties:
ID:
type: integer
format: int64
Username:
type: string
StateID:
type: integer
format: int32
Submission: Submission:
required:
- ID
- DisplayName
- Creator
- GameID
- Date
- Submitter
- AssetID
- AssetVersion
- Completed
- SubmissionType
# - TargetAssetID
- StatusID
type: object type: object
properties: properties:
ID: ID:
@ -439,6 +612,8 @@ components:
type: integer type: integer
format: int32 format: int32
SubmissionFilter: SubmissionFilter:
required:
- ID
type: object type: object
properties: properties:
ID: ID:
@ -455,6 +630,16 @@ components:
type: integer type: integer
format: int64 format: int64
SubmissionCreate: SubmissionCreate:
required:
- ID
- DisplayName
- Creator
- GameID
- Submitter
- AssetID
- AssetVersion
- SubmissionType
# - TargetAssetID
type: object type: object
properties: properties:
DisplayName: DisplayName:
@ -480,6 +665,11 @@ components:
type: integer type: integer
format: int64 format: int64
Script: Script:
required:
- ID
- Hash
- Source
# - SubmissionID
type: object type: object
properties: properties:
ID: ID:
@ -492,15 +682,77 @@ components:
SubmissionID: SubmissionID:
type: integer type: integer
format: int64 format: int64
ScriptPolicy: ScriptCreate:
required:
- Source
# - SubmissionID
type: object
properties:
Source:
type: string
SubmissionID:
type: integer
format: int64
ScriptUpdate:
required:
- ID
type: object type: object
properties: properties:
ID: ID:
type: integer type: integer
format: int64 format: int64
Hash: Source:
type: string type: string
ScriptID: SubmissionID:
type: integer
format: int64
ScriptPolicy:
required:
- ID
- FromScriptHash
- ToScriptID
- Policy
type: object
properties:
ID:
type: integer
format: int64
FromScriptHash:
type: string
ToScriptID:
type: integer
format: int64
Policy:
type: integer
format: int32
ScriptPolicyCreate:
required:
- FromScriptID
- ToScriptID
- Policy
type: object
properties:
FromScriptID:
type: integer
format: int64
ToScriptID:
type: integer
format: int64
Policy:
type: integer
format: int32
ScriptPolicyUpdate:
required:
- ID
type: object
properties:
ID:
type: integer
format: int64
FromScriptID:
type: integer
format: int64
ToScriptID:
type: integer type: integer
format: int64 format: int64
Policy: Policy: