@aeriajs/common 0.0.115 → 0.0.117

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/dist/index.d.ts CHANGED
@@ -15,5 +15,4 @@ export * from './isGranted.js';
15
15
  export * from './isReference.js';
16
16
  export * from './isRequired.js';
17
17
  export * from './pipe.js';
18
- export * from './schema.js';
19
18
  export * from './serialize.js';
package/dist/index.js CHANGED
@@ -31,5 +31,4 @@ __exportStar(require("./isGranted.js"), exports);
31
31
  __exportStar(require("./isReference.js"), exports);
32
32
  __exportStar(require("./isRequired.js"), exports);
33
33
  __exportStar(require("./pipe.js"), exports);
34
- __exportStar(require("./schema.js"), exports);
35
34
  __exportStar(require("./serialize.js"), exports);
package/dist/index.mjs CHANGED
@@ -16,5 +16,4 @@ export * from "./isGranted.mjs";
16
16
  export * from "./isReference.mjs";
17
17
  export * from "./isRequired.mjs";
18
18
  export * from "./pipe.mjs";
19
- export * from "./schema.mjs";
20
19
  export * from "./serialize.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/common",
3
- "version": "0.0.115",
3
+ "version": "0.0.117",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "bson": "^6.5.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@aeriajs/types": "^0.0.98",
34
+ "@aeriajs/types": "^0.0.100",
35
35
  "bson": "^6.5.0"
36
36
  },
37
37
  "scripts": {
package/dist/schema.d.ts DELETED
@@ -1,88 +0,0 @@
1
- import type { Property, HTTPStatus } from '@aeriajs/types';
2
- export declare const errorSchema: <const TObject extends Property>(object: TObject) => {
3
- readonly type: "object";
4
- readonly properties: {
5
- readonly _tag: {
6
- readonly const: "Error";
7
- };
8
- readonly error: Property;
9
- readonly result: {
10
- readonly const: undefined;
11
- };
12
- };
13
- };
14
- export declare const resultSchema: <const TObject extends Property>(object: TObject) => {
15
- readonly type: "object";
16
- readonly properties: {
17
- readonly _tag: {
18
- readonly const: "Result";
19
- };
20
- readonly error: {
21
- readonly const: undefined;
22
- };
23
- readonly result: Property;
24
- };
25
- };
26
- export declare const endpointErrorSchema: <const THTTPStatus extends HTTPStatus[], const TCode extends string[]>(error: {
27
- httpStatus: THTTPStatus;
28
- code: TCode;
29
- }) => {
30
- readonly type: "object";
31
- readonly properties: {
32
- readonly _tag: {
33
- readonly const: "Error";
34
- };
35
- readonly result: {
36
- readonly const: undefined;
37
- };
38
- readonly error: {
39
- readonly type: "object";
40
- readonly required: readonly ["httpStatus", "code"];
41
- readonly properties: {
42
- readonly httpStatus: {
43
- readonly enum: THTTPStatus;
44
- };
45
- readonly code: {
46
- readonly enum: TCode;
47
- };
48
- readonly message: {
49
- readonly type: "string";
50
- };
51
- readonly details: {
52
- readonly type: "object";
53
- readonly variable: true;
54
- };
55
- };
56
- };
57
- };
58
- };
59
- export declare const genericEndpointErrorSchema: () => {
60
- readonly type: "object";
61
- readonly properties: {
62
- readonly _tag: {
63
- readonly const: "Error";
64
- };
65
- readonly result: {
66
- readonly const: undefined;
67
- };
68
- readonly error: {
69
- readonly type: "object";
70
- readonly required: readonly ["httpStatus", "code"];
71
- readonly properties: {
72
- readonly httpStatus: {
73
- readonly type: "number";
74
- };
75
- readonly code: {
76
- readonly type: "string";
77
- };
78
- readonly message: {
79
- readonly type: "string";
80
- };
81
- readonly details: {
82
- readonly type: "object";
83
- readonly variable: true;
84
- };
85
- };
86
- };
87
- };
88
- };
package/dist/schema.js DELETED
@@ -1,105 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genericEndpointErrorSchema = exports.endpointErrorSchema = exports.resultSchema = exports.errorSchema = void 0;
4
- const errorSchema = (object) => {
5
- return {
6
- type: 'object',
7
- properties: {
8
- _tag: {
9
- const: 'Error',
10
- },
11
- error: object,
12
- result: {
13
- const: undefined,
14
- },
15
- },
16
- };
17
- };
18
- exports.errorSchema = errorSchema;
19
- const resultSchema = (object) => {
20
- return {
21
- type: 'object',
22
- properties: {
23
- _tag: {
24
- const: 'Result',
25
- },
26
- error: {
27
- const: undefined,
28
- },
29
- result: object,
30
- },
31
- };
32
- };
33
- exports.resultSchema = resultSchema;
34
- const endpointErrorSchema = (error) => {
35
- return {
36
- type: 'object',
37
- properties: {
38
- _tag: {
39
- const: 'Error',
40
- },
41
- result: {
42
- const: undefined,
43
- },
44
- error: {
45
- type: 'object',
46
- required: [
47
- 'httpStatus',
48
- 'code',
49
- ],
50
- properties: {
51
- httpStatus: {
52
- enum: error.httpStatus,
53
- },
54
- code: {
55
- enum: error.code,
56
- },
57
- message: {
58
- type: 'string',
59
- },
60
- details: {
61
- type: 'object',
62
- variable: true,
63
- },
64
- },
65
- },
66
- },
67
- };
68
- };
69
- exports.endpointErrorSchema = endpointErrorSchema;
70
- const genericEndpointErrorSchema = () => {
71
- return {
72
- type: 'object',
73
- properties: {
74
- _tag: {
75
- const: 'Error',
76
- },
77
- result: {
78
- const: undefined,
79
- },
80
- error: {
81
- type: 'object',
82
- required: [
83
- 'httpStatus',
84
- 'code',
85
- ],
86
- properties: {
87
- httpStatus: {
88
- type: 'number',
89
- },
90
- code: {
91
- type: 'string',
92
- },
93
- message: {
94
- type: 'string',
95
- },
96
- details: {
97
- type: 'object',
98
- variable: true,
99
- },
100
- },
101
- },
102
- },
103
- };
104
- };
105
- exports.genericEndpointErrorSchema = genericEndpointErrorSchema;
package/dist/schema.mjs DELETED
@@ -1,99 +0,0 @@
1
- "use strict";
2
- export const errorSchema = (object) => {
3
- return {
4
- type: "object",
5
- properties: {
6
- _tag: {
7
- const: "Error"
8
- },
9
- error: object,
10
- result: {
11
- const: void 0
12
- }
13
- }
14
- };
15
- };
16
- export const resultSchema = (object) => {
17
- return {
18
- type: "object",
19
- properties: {
20
- _tag: {
21
- const: "Result"
22
- },
23
- error: {
24
- const: void 0
25
- },
26
- result: object
27
- }
28
- };
29
- };
30
- export const endpointErrorSchema = (error) => {
31
- return {
32
- type: "object",
33
- properties: {
34
- _tag: {
35
- const: "Error"
36
- },
37
- result: {
38
- const: void 0
39
- },
40
- error: {
41
- type: "object",
42
- required: [
43
- "httpStatus",
44
- "code"
45
- ],
46
- properties: {
47
- httpStatus: {
48
- enum: error.httpStatus
49
- },
50
- code: {
51
- enum: error.code
52
- },
53
- message: {
54
- type: "string"
55
- },
56
- details: {
57
- type: "object",
58
- variable: true
59
- }
60
- }
61
- }
62
- }
63
- };
64
- };
65
- export const genericEndpointErrorSchema = () => {
66
- return {
67
- type: "object",
68
- properties: {
69
- _tag: {
70
- const: "Error"
71
- },
72
- result: {
73
- const: void 0
74
- },
75
- error: {
76
- type: "object",
77
- required: [
78
- "httpStatus",
79
- "code"
80
- ],
81
- properties: {
82
- httpStatus: {
83
- type: "number"
84
- },
85
- code: {
86
- type: "string"
87
- },
88
- message: {
89
- type: "string"
90
- },
91
- details: {
92
- type: "object",
93
- variable: true
94
- }
95
- }
96
- }
97
- }
98
- };
99
- };