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

chore: pnpm generate-models support #25

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"scripts": {
"prepare": "husky",
"preinstall": "npx only-allow pnpm",
"build": "turbo run build",
"generate-models": "pnpm -r --if-present --stream run generate-models",
"build": "pnpm generate-models && turbo run build",
"prettier": "prettier --write \"{packages,__tests__,!dist}/**/*.{ts,js,json,md}\"",
"prettier:check": "prettier --check \"{packages,__tests__,!dist}/**/*.{ts,js,json,md}\"",
"test:ci": "jest --config=jest.json",
Expand All @@ -31,6 +32,7 @@
"@types/node": "^22.13.1",
"cross-env": "^7.0.3",
"husky": "^9.1.7",
"rimraf": "^6.0.1",
"jest": "^29.7.0",
"jest-environment-node": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
Expand Down
163 changes: 111 additions & 52 deletions packages/credential-showcase-openapi/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ paths:
schema:
type: array
items:
$ref: '#/components/schemas/ShowcaseResponse'
$ref: '#/components/schemas/ShowcasesResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
Expand All @@ -1631,7 +1631,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Showcase'
$ref: '#/components/schemas/ShowcaseRequest'
required: true
responses:
'201':
Expand Down Expand Up @@ -1667,7 +1667,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Showcase'
$ref: '#/components/schemas/ShowcaseResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
Expand All @@ -1686,14 +1686,14 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Showcase'
$ref: '#/components/schemas/ShowcaseRequest'
responses:
'200':
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/Showcase'
$ref: '#/components/schemas/ShowcaseResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
Expand Down Expand Up @@ -2608,53 +2608,112 @@ components:
example: 123e4567-e89b-12d3-a456-426614174123
description: Anonymous Credentials specific revocation information

# Showcase:
# type: object
# required:
# - name
# - description
# properties:
# id:
# type: string
# description: Unique identifier for the showcase
# example: 123e4567-e89b-12d3-a456-426614174456
# name:
# type: string
# description: Name of the showcase
# example: Credential Showcase BCGov
# description:
# type: string
# description: Description of the showcase
# example: Collection of credential usage scenarios
# status:
# type: string
# enum: [pending, active, archived]
# description: Current status of the showcase
# example: pending
# hidden:
# type: boolean
# description: Whether the showcase is hidden from public view
# default: false
# scenarios:
# type: array
# description: List of scenarios in this showcase
# items:
# $ref: '#/components/schemas/Scenario'
# credentials:
# type: array
# description: List of credential definitions used in this showcase
# items:
# $ref: '#/components/schemas/CredentialDefinitionsResponse'
# personas:
# type: object
# description: List of personas involved in this showcase
# items:
# $ref: '#/components/schemas/PersonasResponse'
# workflows:
# type: array
# description: List of workflows used in this showcase
# items:
# $ref: '#/components/schemas/Workflow'
Showcase:
type: object
required:
- id
- name
- description
- status
- scenarios
- personas
- credentials
- hidden
properties:
id:
type: string
description: Unique identifier for the showcase
example: 123e4567-e89b-12d3-a456-426614174456
name:
type: string
description: Name of the showcase
example: Credential Showcase BCGov
description:
type: string
description: Description of the showcase
example: Collection of credential usage scenarios
status:
type: string
enum: [pending, active, archived]
description: Current status of the showcase
example: pending
hidden:
type: boolean
description: Whether the showcase is hidden from public view
default: false
scenarios:
type: array
description: List of scenarios in this showcase
items:
$ref: '#/components/schemas/Workflow'
credentials:
type: array
description: List of credential definitions used in this showcase
items:
$ref: '#/components/schemas/CredentialDefinition'
personas:
type: object
description: List of personas involved in this showcase
items:
$ref: '#/components/schemas/Persona'
ShowcasesResponse:
type: object
properties:
showcases:
type: array
description: "List of showcases"
items:
$ref: '#/components/schemas/Showcase'
ShowcaseResponse:
type: object
properties:
showcase:
$ref: '#/components/schemas/Showcase'
ShowcaseRequest:
required:
- name
- description
- status
- scenarios
- personas
- credentials
- hidden
properties:
name:
type: string
description: Name of the showcase
example: Credential Showcase BCGov
description:
type: string
description: Description of the showcase
example: Collection of credential usage scenarios
status:
type: string
enum: [pending, active, archived]
description: Current status of the showcase
example: pending
hidden:
type: boolean
description: Whether the showcase is hidden from public view
default: false
scenarios:
type: array
description: List of scenarios in this showcase
items:
type: string
example: 123e4567-e89b-12d3-a456-426614174469
credentials:
type: array
description: List of credential definitions used in this showcase
items:
type: string
example: 123e4567-e89b-12d3-a456-426614174469
personas:
type: array
description: List of personas involved in this showcase
items:
type: string
example: 123e4567-e89b-12d3-a456-426614174469

# Scenario:
# type: object
Expand Down
3 changes: 2 additions & 1 deletion packages/credential-showcase-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"postinstall": "mvn clean generate-sources",
"postinstall": "pnpm generate-models",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we generate with MVN, and we will publish it, but for me is fine to keep a local version

"generate-models": "rimraf ./src && mvn clean generate-sources",
"dev": "tsc --watch",
"build": "tsc",
"build:clean": "tsc --build --clean && tsc --build"
Expand Down
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.