Skip to content

Commit

Permalink
feat: bump api v0.43.1 (#354)
Browse files Browse the repository at this point in the history
* feat: bump api v0.43.1

* update

* update
  • Loading branch information
franklevasseur authored Oct 3, 2024
1 parent 5e7ba23 commit 870eec8
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 159 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@botpress/api": "0.42.1",
"@botpress/api": "0.43.1",
"@botpress/webchat": "1.3.11",
"@heroicons/react": "^2.0.18",
"@types/user-agents": "^1.0.4",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

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

295 changes: 147 additions & 148 deletions public/sitemap-0.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/static/openApi/openapi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/generateApiDocumentationPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function getParameterMd({ name, schema, description }: Parameter) {
}

export function getPropertyType(property: JSONSchemaProperty | Parameter['schema']): string {
if (!property?.type) {
if (!('type' in property) || !property?.type) {
return ''
}
if (property.type === 'object' && property.additionalProperties) {
Expand Down
3 changes: 2 additions & 1 deletion scripts/generateApiDocumentationPage.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const ParameterSchema = z
in: z.enum(['path', 'query']),
description: z.string(),
required: z.boolean().optional(),
schema: z.discriminatedUnion('type', [
schema: z.union([
z.object({ type: z.literal('string') }),
z.object({ type: z.literal('boolean') }),
z.object({ type: z.literal('integer') }),
Expand All @@ -62,6 +62,7 @@ export const ParameterSchema = z
type: z.literal('array'),
items: z.object({ type: z.literal('string') }).optional(),
}),
z.object({}),
]),
})
.strict()
Expand Down
6 changes: 3 additions & 3 deletions scripts/openApiContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Parameter = z.object({
required: z.boolean().optional(),
deprecated: z.boolean().optional(),
allowEmptyValue: z.boolean().optional(),
schema: z.object({ type: z.string() }).optional(),
schema: z.object({ type: z.string().optional() }).optional(),
})

const RequestBody = z
Expand Down Expand Up @@ -121,9 +121,9 @@ const Paths = z.record(Operations).transform((paths) => {
)
)

type PathRecord = Record<string, typeof denormalizedOperations[number]>
type PathRecord = Record<string, (typeof denormalizedOperations)[number]>

return denormalizedOperations.reduce((acc: PathRecord, operation: typeof denormalizedOperations[number]) => {
return denormalizedOperations.reduce((acc: PathRecord, operation: (typeof denormalizedOperations)[number]) => {
return { ...acc, [operation.operationId]: operation }
}, {})
})
Expand Down

0 comments on commit 870eec8

Please sign in to comment.