@pikku/cli 0.6.15 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @pikku/cli
2
2
 
3
+ ## 0.6.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 9fb2b99: refactor: moving schemas to pikku state
8
+ - Updated dependencies [9fb2b99]
9
+ - @pikku/core@0.6.19
10
+
3
11
  ## 0.6.15
4
12
 
5
13
  ### Patch Changes
@@ -1,8 +1,9 @@
1
- import { getErrors } from '@pikku/core';
1
+ import { pikkuState } from '@pikku/core';
2
2
  import _convertSchema from '@openapi-contrib/json-schema-to-openapi-schema';
3
3
  const convertSchema = 'default' in _convertSchema ? _convertSchema.default : _convertSchema;
4
4
  const getErrorResponseForConstructorName = (constructorName) => {
5
- const foundError = Array.from(getErrors().entries()).find(([e]) => e.name === constructorName);
5
+ const errors = Array.from(pikkuState('misc', 'errors').entries());
6
+ const foundError = errors.find(([e]) => e.name === constructorName);
6
7
  if (foundError) {
7
8
  return foundError[1];
8
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/cli",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@openapi-contrib/json-schema-to-openapi-schema": "^3.0.2",
25
- "@pikku/core": "^0.6.17",
25
+ "@pikku/core": "^0.6.19",
26
26
  "@pikku/inspector": "^0.6.3",
27
27
  "@types/cookie": "^0.6.0",
28
28
  "@types/uuid": "^10.0.0",
@@ -1,4 +1,4 @@
1
- import { getErrors, HTTPRoutesMeta } from '@pikku/core'
1
+ import { HTTPRoutesMeta, pikkuState } from '@pikku/core'
2
2
  import _convertSchema from '@openapi-contrib/json-schema-to-openapi-schema'
3
3
  const convertSchema =
4
4
  'default' in _convertSchema ? (_convertSchema.default as any) : _convertSchema
@@ -66,9 +66,8 @@ export interface OpenAPISpecInfo {
66
66
  }
67
67
 
68
68
  const getErrorResponseForConstructorName = (constructorName: string) => {
69
- const foundError = Array.from(getErrors().entries()).find(
70
- ([e]) => e.name === constructorName
71
- )
69
+ const errors = Array.from(pikkuState('misc', 'errors').entries())
70
+ const foundError = errors.find(([e]) => e.name === constructorName)
72
71
  if (foundError) {
73
72
  return foundError[1]
74
73
  }