Skip to content

Commit

Permalink
Update swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Oct 8, 2024
1 parent c8faf47 commit e08ba7f
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/controllers/api/accreditation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,10 @@ export class AccreditationController {
* content:
* application/x-www-form-urlencoded:
* schema:
* $ref: '#/components/schemas/AccreditationSuspendRequest'
* $ref: '#/components/schemas/AccreditationRevokeRequest'
* application/json:
* schema:
* $ref: '#/components/schemas/AccreditationSuspendRequest'
* $ref: '#/components/schemas/AccreditationRevokeRequest'
* responses:
* 200:
* description: The request was successful.
Expand Down Expand Up @@ -682,10 +682,10 @@ export class AccreditationController {
* content:
* application/x-www-form-urlencoded:
* schema:
* $ref: '#/components/schemas/AccreditationReinstateRequest'
* $ref: '#/components/schemas/AccreditationRevokeRequest'
* application/json:
* schema:
* $ref: '#/components/schemas/AccreditationReinstateRequest'
* $ref: '#/components/schemas/AccreditationRevokeRequest'
* responses:
* 200:
* description: The request was successful.
Expand Down
49 changes: 38 additions & 11 deletions src/static/swagger-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -688,20 +688,17 @@
],
"example": {
"issuerDid": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0",
"subjectDid": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK",
"subjectDid": "did:cheqd:testnet:2582fe17-9b25-45e4-8104-1cfca430f0c3",
"schemas": [
{
"type": "MuseumPassCredential",
"url": "https://resolver.cheqd.net/1.0/identifiers/did:cheqd:testnet:0a5b94d0-a417-48ed-a6f5-4abc9e95888d?resourceName=MuseumPassCredentialSchema&resourceType=JsonSchemaValidator2018"
}
],
"@context": [
"https://schema.org"
],
"type": [
"Person"
],
"format": "jwt",
"accreditationName": "authorizeAccreditation",
"trustFramework": "https://learn.cheqd.io/governance/start",
"trustFrameworkId": "cheqd Governance Framework",
"credentialStatus": {
"statusPurpose": "revocation",
"statusListName": "employee-credentials",
Expand Down Expand Up @@ -771,6 +768,36 @@
"subjectDid"
]
},
"AccreditationRevokeRequest": {
"type": "object",
"properties": {
"didUrl": {
"description": "Verifiable Accreditation to be verified as a VC-JWT string or a JSON object.",
"type": "string",
"example": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e?resourceName=cheqd-issuer-logo&resourceType=CredentialArtwork"
},
"did": {
"type": "string",
"example": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e"
},
"resourceId": {
"type": "string",
"example": "398cee0a-efac-4643-9f4c-74c48c72a14b"
},
"resourceName": {
"type": "string",
"example": "cheqd-issuer-logo"
},
"resourceType": {
"type": "string",
"example": "CredentialArtwork"
},
"symmetricKey": {
"description": "The symmetric key used to encrypt the StatusList2021 DID-Linked Resource. Required if the StatusList2021 DID-Linked Resource is encrypted.",
"type": "string"
}
}
},
"PresentationCreateRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -2669,12 +2696,12 @@
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/AccreditationSuspendRequest"
"$ref": "#/components/schemas/AccreditationRevokeRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccreditationSuspendRequest"
"$ref": "#/components/schemas/AccreditationRevokeRequest"
}
}
}
Expand Down Expand Up @@ -2726,12 +2753,12 @@
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/AccreditationReinstateRequest"
"$ref": "#/components/schemas/AccreditationRevokeRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccreditationReinstateRequest"
"$ref": "#/components/schemas/AccreditationRevokeRequest"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const DEFAULT_DENOM_EXPONENT = 9;
export const TESTNET_MINIMUM_BALANCE = process.env.TESTNET_MINIMUM_BALANCE || 1000;

// Verifiable Credential constants
export const VC_CONTEXT = ['https://www.w3.org/2018/credentials/v1', 'https://veramo.io/contexts/profile/v1'];
export const VC_CONTEXT = ['https://www.w3.org/2018/credentials/v1'];
export const VC_TYPE = 'VerifiableCredential';
export const VC_PROOF_FORMAT = 'jwt';
export const VC_REMOVE_ORIGINAL_FIELDS = true;
Expand Down
31 changes: 26 additions & 5 deletions src/types/swagger-api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,14 @@
* - schemas
* example:
* issuerDid: did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0
* subjectDid: did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK
* subjectDid: did:cheqd:testnet:2582fe17-9b25-45e4-8104-1cfca430f0c3
* schemas:
* - type: MuseumPassCredential
* url: https://resolver.cheqd.net/1.0/identifiers/did:cheqd:testnet:0a5b94d0-a417-48ed-a6f5-4abc9e95888d?resourceName=MuseumPassCredentialSchema&resourceType=JsonSchemaValidator2018
* '@context':
* - https://schema.org
* type:
* - Person
* format: jwt
* accreditationName: authorizeAccreditation
* trustFramework: https://learn.cheqd.io/governance/start
* trustFrameworkId: cheqd Governance Framework
* credentialStatus:
* statusPurpose: revocation
* statusListName: employee-credentials
Expand Down Expand Up @@ -515,6 +514,28 @@
* default: false
* required:
* - subjectDid
* AccreditationRevokeRequest:
* type: object
* properties:
* didUrl:
* description: Verifiable Accreditation to be verified as a VC-JWT string or a JSON object.
* type: string
* example: did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e?resourceName=cheqd-issuer-logo&resourceType=CredentialArtwork
* did:
* type: string
* example: did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e
* resourceId:
* type: string
* example: 398cee0a-efac-4643-9f4c-74c48c72a14b
* resourceName:
* type: string
* example: cheqd-issuer-logo
* resourceType:
* type: string
* example: CredentialArtwork
* symmetricKey:
* description: The symmetric key used to encrypt the StatusList2021 DID-Linked Resource. Required if the StatusList2021 DID-Linked Resource is encrypted.
* type: string
* PresentationCreateRequest:
* type: object
* required:
Expand Down

0 comments on commit e08ba7f

Please sign in to comment.