Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/packages/avsc-isomet…
Browse files Browse the repository at this point in the history
…ric/webpack-5.94.0
  • Loading branch information
JohanObrink committed Nov 6, 2024
2 parents 6a02ca5 + e66c437 commit d99150f
Show file tree
Hide file tree
Showing 55 changed files with 3,950 additions and 3,268 deletions.
5 changes: 3 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true
},
Expand All @@ -15,7 +15,8 @@
"ts-extensions.ts",
"typescriptExtensions.ts",
"openSearchTypes.ts",
"openapi-core/src/types.ts"
"openapi-core/src/types.ts",
"schemas/**"
]
},
"formatter": {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"changeset": "changeset",
"dev": "turbo dev",
"format": "biome format --write",
"lint:write": "biome check --write",
"generate:package": "turbo gen package",
"lint": "turbo lint",
"lint:watch": "turbo watch lint",
Expand All @@ -22,14 +23,14 @@
"@changesets/cli": "2.27.5"
},
"devDependencies": {
"@biomejs/biome": "1.8.0",
"@biomejs/biome": "1.9.4",
"@turbo/gen": "2.0.1",
"@types/node": "20.14.2",
"@vitest/coverage-v8": "1.6.0",
"csv-parse": "5.5.6",
"fast-xml-parser": "4.4.0",
"fast-xml-parser": "4.4.1",
"tsup": "8.1.0",
"turbo": "2.0.1",
"turbo": "2.2.3",
"typescript": "5.4.5",
"vitest": "1.6.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/avsc-isometric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"string-replace-loader": "3.1.0",
"uglify-loader": "3.0.0",
"util": "0.12.5",
"webpack": "5.94.0",
"webpack": "5.96.1",
"webpack-cli": "5.1.4"
},
"dependencies": {
Expand Down
12 changes: 12 additions & 0 deletions packages/iso-10383/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @sebspark/iso-10383

## 0.10.0

### Minor Changes

- 089a3c9: Update ISO10383 specifications.

## 0.9.0

### Minor Changes

- 2583df0: Update ISO10383 specifications.

## 0.8.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/iso-10383/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sebspark/iso-10383",
"version": "0.8.0",
"version": "0.10.0",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
802 changes: 572 additions & 230 deletions packages/iso-10383/src/lib/generated/iso10383.ts

Large diffs are not rendered by default.

148 changes: 83 additions & 65 deletions packages/iso-10383/src/lib/specifications/iso10383.csv

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions packages/logging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# @sebspark/logging

## 1.4.0

### Minor Changes

- 639c691: bump some dependencies to non-vulnerable versions

## 1.3.0

### Minor Changes

- 265a850: upgrade express to 5.0.0

## 1.2.4

### Patch Changes

- 0a38227: bug fix stack false no longer clears formatting

## 1.2.3

### Patch Changes

- 4b4b691: fix express vulnerability in logging package

## 1.2.2

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/logging/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sebspark/logging",
"version": "1.2.2",
"version": "1.4.0",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand All @@ -23,9 +23,9 @@
},
"dependencies": {
"@google-cloud/logging-winston": "6.0.0",
"express": "4.19.2",
"express": "5.0.1",
"response-time": "2.3.2",
"socket.io": "4.7.5",
"socket.io": "4.8.0",
"socketio-wildcard": "2.0.0",
"winston": "3.13.0",
"winston-transport": "4.7.0"
Expand Down
4 changes: 1 addition & 3 deletions packages/logging/src/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ export const getLogger = ({
format.printf((info) => {
return `[${info.timestamp}] ${info.level}: ${info.message}`
}),
consoleFormattingOptions.stack
? format.errors({ stack: true })
: format.simple()
format.errors({ stack: consoleFormattingOptions.stack })
)

const loggingWinstonSettings: Options = {
Expand Down
6 changes: 6 additions & 0 deletions packages/openapi-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sebspark/openapi-core

## 1.5.3

### Patch Changes

- beda07a: add custom error response to err.cause

## 1.5.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sebspark/openapi-core",
"version": "1.5.2",
"version": "1.5.3",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
75 changes: 75 additions & 0 deletions packages/openapi-core/src/errors.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { AxiosError, AxiosHeaders } from 'axios'
import { describe, expect, test } from 'vitest'
import { fromAxiosError } from './errors'

const commonHeaders = new AxiosHeaders()
const commonResponseProperties = {
statusText: '',
headers: commonHeaders,
config: { headers: commonHeaders },
}

describe('fromAxiosError: ', async () => {
test('returns default HttpError (500) when response status is not available', () => {
const request = { path: '/enrollment/get-child' }
const response = {
...commonResponseProperties,
status: 0,
data: {},
}
const incomingError = new AxiosError('', '', undefined, request, response)
const returnedError = fromAxiosError(incomingError)

expect(returnedError.message).toBe('Internal Server Error') // fallback since response does not contain statusText property
expect(returnedError.statusCode).toBe(500) // fallback since response does not contain legit status
expect(returnedError.cause.name).toBe('AxiosError')
expect(returnedError.cause.stack).toBeDefined()
expect(returnedError.cause.cause).toStrictEqual({})
})

test('returns appropriate HttpError (404) based on response status and data', () => {
const request = { path: '/enrollment/get-child' }
const response = {
...commonResponseProperties,
status: 404,
data: {
code: 'CHILD_NOT_FOUND',
description: 'There is no child with that pnr',
status: 404,
statusText: 'CHILD_NOT_FOUND',
},
}
const incomingError = new AxiosError('', '', undefined, request, response)
const returnedError = fromAxiosError(incomingError)

expect(returnedError.message).toBe('Internal Server Error') // fallback since response does not contain statusText property
expect(returnedError.statusCode).toBe(404)
expect(returnedError.cause.cause).toStrictEqual(response.data)
})

test('returns appropriate HttpError (401) based on response status and data', () => {
const request = { path: '/accounts/balance' }
const response = {
...commonResponseProperties,
statusText: 'Unauthorized',
status: 401,
data: {
code: 'AUTH_ERROR',
description: 'Token expired',
status: 401,
},
}
const incomingError = new AxiosError(
'Unauthorized',
'AUTH_ERROR',
undefined,
request,
response
)
const returnedError = fromAxiosError(incomingError)

expect(returnedError.message).toBe('Unauthorized')
expect(returnedError.statusCode).toBe(401)
expect(returnedError.cause.cause).toStrictEqual(response.data)
})
})
2 changes: 2 additions & 0 deletions packages/openapi-core/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ export const fromAxiosError = (axiosError: AxiosError): HttpError => {
const cause = new Error(axiosError.message)
cause.name = axiosError.name
cause.stack = axiosError.stack
// If the error response has a data property pass it along
cause.cause = axiosError?.response?.data

return createHttpError(statusCode, message, cause)
}
2 changes: 1 addition & 1 deletion packages/openapi-e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@sebspark/openapi-client": "*",
"@sebspark/openapi-core": "*",
"@sebspark/openapi-express": "*",
"express": "4.19.2"
"express": "4.21.0"
},
"devDependencies": {
"@sebspark/openapi-typegen": "*",
Expand Down
6 changes: 6 additions & 0 deletions packages/openapi-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sebspark/openapi-express

## 1.1.5

### Patch Changes

- 6420f5e: Fixed vulnerable express dependency

## 1.1.4

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/openapi-express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sebspark/openapi-express",
"version": "1.1.4",
"version": "1.1.5",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand All @@ -17,12 +17,12 @@
},
"devDependencies": {
"@types/supertest": "6.0.2",
"express": "4.19.2",
"express": "4.21.0",
"supertest": "7.0.0",
"tsconfig": "*"
},
"dependencies": {
"@sebspark/openapi-core": "*",
"express": "4.19.2"
"express": "4.21.0"
}
}
24 changes: 24 additions & 0 deletions packages/openapi-typegen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# @sebspark/openapi-typegen

## 1.11.0

### Minor Changes

- 37984eb: Enums are now exported as a const (MY_ENUM_VALUES) and a type (MyEnum)

## 1.10.0

### Minor Changes

- 894bf2e: remove yarn as a dependency

## 1.9.0

### Minor Changes

- 052ad11: Added support for additionalProperties

## 1.8.5

### Patch Changes

- b7a0309: Handle array enums using oneOf in type generation

## 1.8.4

### Patch Changes
Expand Down
7 changes: 3 additions & 4 deletions packages/openapi-typegen/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sebspark/openapi-typegen",
"version": "1.8.4",
"version": "1.11.0",
"license": "Apache-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -28,8 +28,7 @@
"chalk": "<5",
"change-case": "4.1.2",
"prettier": "3.3.2",
"yaml": "2.4.3",
"yargs": "17.7.2",
"yarn": "1.22.22"
"yaml": "2.5.0",
"yargs": "17.7.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6232,7 +6232,7 @@ export type dev_infrontfinance_cdapi_structured_product_PurgeCacheRequest = {
/**
* Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
*/
export type google_protobuf_Any = {
export type google_protobuf_Any = Record<string, unknown> & {
/**
* The type of the serialized message.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export type User = {

export type UserList = User[]

export type UserType = 'HUMAN' | 'SYSTEM'
export const USER_TYPE_VALUES = ['HUMAN', 'SYSTEM'] as const
export type UserType = typeof USER_TYPE_VALUES[number]

export type HumanDetails = {
name?: string
Expand Down
Loading

0 comments on commit d99150f

Please sign in to comment.