mock-config-server 3.5.0 → 3.6.0
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/README.md +2 -0
- package/dist/bin/bin.js +3 -3
- package/dist/bin/build.js +5 -5
- package/dist/bin/cli.js +18 -18
- package/dist/bin/helpers/createTemplate.js +4 -4
- package/dist/bin/helpers/getValidationMessageFromPath.js +2 -2
- package/dist/bin/helpers/isOnlyRequestedDataResolvingPropertyExists.js +3 -3
- package/dist/bin/helpers/resolveConfigFile.js +3 -3
- package/dist/bin/helpers/resolveExportsFromSourceCode.js +1 -1
- package/dist/bin/init.js +36 -36
- package/dist/bin/run.js +6 -6
- package/dist/bin/validateMockServerConfig/corsSchema/corsSchema.d.ts +2 -2
- package/dist/bin/validateMockServerConfig/corsSchema/corsSchema.js +6 -6
- package/dist/bin/validateMockServerConfig/graphqlConfigSchema/graphqlConfigSchema.d.ts +82 -72
- package/dist/bin/validateMockServerConfig/graphqlConfigSchema/graphqlConfigSchema.js +4 -4
- package/dist/bin/validateMockServerConfig/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.d.ts +25 -21
- package/dist/bin/validateMockServerConfig/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.js +3 -5
- package/dist/bin/validateMockServerConfig/queueSchema/queueSchema.d.ts +2 -2
- package/dist/bin/validateMockServerConfig/queueSchema/queueSchema.js +1 -1
- package/dist/bin/validateMockServerConfig/restConfigSchema/restConfigSchema.d.ts +270 -240
- package/dist/bin/validateMockServerConfig/restConfigSchema/restConfigSchema.js +6 -6
- package/dist/bin/validateMockServerConfig/restConfigSchema/routeConfigSchema/routeConfigSchema.d.ts +33 -28
- package/dist/bin/validateMockServerConfig/restConfigSchema/routeConfigSchema/routeConfigSchema.js +7 -9
- package/dist/bin/validateMockServerConfig/utils/entitiesSchema/entitiesSchema.d.ts +4 -8
- package/dist/bin/validateMockServerConfig/utils/entitiesSchema/entitiesSchema.js +11 -11
- package/dist/bin/validateMockServerConfig/utils/requiredPropertiesSchema/requiredPropertiesSchema.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/utils/sharedSchema/sharedSchema.js +2 -2
- package/dist/bin/validateMockServerConfig/validateApiMockServerConfig.js +3 -3
- package/dist/bin/validateMockServerConfig/validateMockServerConfig.js +1 -1
- package/dist/src/core/database/createDatabaseRoutes/createDatabaseRoutes.js +3 -3
- package/dist/src/core/database/createDatabaseRoutes/helpers/array/createNewId/createNewId.js +1 -1
- package/dist/src/core/database/createDatabaseRoutes/helpers/createNestedDatabaseRoutes/createNestedDatabaseRoutes.js +15 -13
- package/dist/src/core/database/createDatabaseRoutes/helpers/createShallowDatabaseRoutes/createShallowDatabaseRoutes.js +15 -13
- package/dist/src/core/database/createDatabaseRoutes/helpers/filter/filter.js +19 -13
- package/dist/src/core/database/createDatabaseRoutes/helpers/search/search.js +3 -3
- package/dist/src/core/database/createDatabaseRoutes/helpers/sort/sort.js +5 -5
- package/dist/src/core/database/createDatabaseRoutes/helpers/splitDatabaseByNesting/splitDatabaseByNesting.js +1 -1
- package/dist/src/core/database/createDatabaseRoutes/storages/File/FileStorage.js +1 -1
- package/dist/src/core/database/createDatabaseRoutes/storages/File/FileWriter.js +1 -1
- package/dist/src/core/graphql/createGraphQLRoutes/createGraphQLRoutes.js +24 -19
- package/dist/src/core/graphql/createGraphQLRoutes/helpers/prepareGraphQLRequestConfigs/prepareGraphQLRequestConfigs.js +1 -1
- package/dist/src/core/middlewares/cookieParseMiddleware/helpers/parseCookie/parseCookie.js +3 -3
- package/dist/src/core/middlewares/corsMiddleware/corsMiddleware.js +8 -8
- package/dist/src/core/middlewares/corsMiddleware/helpers/getAllowedOrigins/getAllowedOrigins.js +2 -2
- package/dist/src/core/middlewares/destroyerMiddleware/destroyerMiddleware.js +2 -2
- package/dist/src/core/middlewares/errorMiddleware/errorMiddleware.js +1 -1
- package/dist/src/core/middlewares/noCorsMiddleware/noCorsMiddleware.js +7 -7
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getGraphqlUrlSuggestions/getGraphqlUrlSuggestions.js +1 -1
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/getRestUrlSuggestions.js +2 -2
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/helpers/getActualRestUrlMeaningfulString/getActualRestUrlMeaningfulString.js +1 -1
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/helpers/getPatternRestUrlMeaningfulString/getPatternRestUrlMeaningfulString.js +1 -1
- package/dist/src/core/middlewares/notFoundMiddleware/notFoundMiddleware.js +7 -7
- package/dist/src/core/middlewares/requestInterceptorMiddleware/requestInterceptorMiddleware.js +1 -1
- package/dist/src/core/middlewares/staticMiddleware/staticMiddleware.js +2 -2
- package/dist/src/core/rest/createRestRoutes/createRestRoutes.js +19 -14
- package/dist/src/core/rest/createRestRoutes/helpers/prepareRestRequestConfigs/prepareRestRequestConfigs.js +1 -1
- package/dist/src/server/createDatabaseMockServer/createDatabaseMockServer.js +6 -6
- package/dist/src/server/createGraphQLMockServer/createGraphQLMockServer.js +6 -6
- package/dist/src/server/createMockServer/createMockServer.js +8 -8
- package/dist/src/server/createRestMockServer/createRestMockServer.js +6 -6
- package/dist/src/utils/constants/checkModes.js +18 -18
- package/dist/src/utils/constants/default.js +4 -4
- package/dist/src/utils/helpers/config/resolveEntityValues/resolveEntityValues.js +20 -20
- package/dist/src/utils/helpers/entities/convertToEntityDescriptor/convertToEntityDescriptor.js +1 -1
- package/dist/src/utils/helpers/entities/isEntityDescriptor/isEntityDescriptor.js +1 -1
- package/dist/src/utils/helpers/graphql/getGraphQLInput/getGraphQLInput.js +3 -3
- package/dist/src/utils/helpers/graphql/parseQuery/parseQuery.js +1 -1
- package/dist/src/utils/helpers/isPlainObject/isPlainObject.js +1 -1
- package/dist/src/utils/helpers/url/convertWin32PathToUnix/convertWin32PathToUnix.js +1 -1
- package/dist/src/utils/helpers/url/getUrlParts/getUrlParts.js +1 -1
- package/dist/src/utils/helpers/url/removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes.js +1 -1
- package/dist/src/utils/helpers/url/urlJoin/urlJoin.js +1 -1
- package/dist/src/utils/types/graphql.d.ts +1 -1
- package/dist/src/utils/types/rest.d.ts +1 -1
- package/package.json +21 -23
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const graphqlConfigSchema: z.ZodObject<{
|
|
3
3
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
4
|
-
configs: z.ZodArray<z.ZodUnion<[z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<{
|
|
5
|
-
query: z.ZodOptional<z.ZodString>;
|
|
4
|
+
configs: z.ZodArray<z.ZodUnion<[z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<z.objectUtil.extendShape<{
|
|
6
5
|
operationName: z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>;
|
|
6
|
+
query: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, {
|
|
7
8
|
operationType: z.ZodEnum<["query", "mutation"]>;
|
|
8
|
-
routes: z.ZodArray<z.ZodUnion<[z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<{
|
|
9
|
-
data: z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, z.ZodAny]>;
|
|
9
|
+
routes: z.ZodArray<z.ZodUnion<[z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<z.objectUtil.extendShape<{
|
|
10
10
|
settings: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
11
|
+
data: z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, z.ZodAny]>;
|
|
12
|
+
}, {
|
|
11
13
|
entities: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
12
14
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
13
|
-
}
|
|
15
|
+
}>, "strict", z.ZodTypeAny, {
|
|
14
16
|
data?: any;
|
|
15
|
-
settings?: any;
|
|
16
|
-
entities?: any;
|
|
17
17
|
interceptors?: any;
|
|
18
|
+
entities?: any;
|
|
19
|
+
settings?: any;
|
|
18
20
|
}, {
|
|
19
21
|
data?: any;
|
|
20
|
-
settings?: unknown;
|
|
21
|
-
entities?: unknown;
|
|
22
22
|
interceptors?: unknown;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
time?: number | undefined;
|
|
29
|
-
data?: any;
|
|
30
|
-
}>>, "many">;
|
|
31
|
-
settings: z.ZodObject<{
|
|
23
|
+
entities?: unknown;
|
|
24
|
+
settings?: unknown;
|
|
25
|
+
}>>, z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<z.objectUtil.extendShape<{
|
|
26
|
+
settings: z.ZodObject<z.objectUtil.extendShape<{
|
|
27
|
+
polling: z.ZodOptional<z.ZodBoolean>;
|
|
32
28
|
status: z.ZodOptional<z.ZodNumber>;
|
|
33
29
|
delay: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, {
|
|
34
31
|
polling: z.ZodLiteral<true>;
|
|
35
|
-
}
|
|
32
|
+
}>, "strict", z.ZodTypeAny, {
|
|
36
33
|
polling: true;
|
|
37
34
|
status?: number | undefined;
|
|
38
35
|
delay?: number | undefined;
|
|
@@ -41,20 +38,28 @@ export declare const graphqlConfigSchema: z.ZodObject<{
|
|
|
41
38
|
status?: number | undefined;
|
|
42
39
|
delay?: number | undefined;
|
|
43
40
|
}>;
|
|
41
|
+
queue: z.ZodArray<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodType<{
|
|
42
|
+
data?: any;
|
|
43
|
+
time?: number | undefined;
|
|
44
|
+
}, z.ZodTypeDef, {
|
|
45
|
+
data?: any;
|
|
46
|
+
time?: number | undefined;
|
|
47
|
+
}>>, "many">;
|
|
48
|
+
}, {
|
|
44
49
|
entities: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
45
50
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
46
|
-
}
|
|
51
|
+
}>, "strict", z.ZodTypeAny, {
|
|
47
52
|
queue: {
|
|
48
|
-
time?: number | undefined;
|
|
49
53
|
data?: any;
|
|
54
|
+
time?: number | undefined;
|
|
50
55
|
}[];
|
|
51
56
|
settings: {
|
|
52
57
|
polling: true;
|
|
53
58
|
status?: number | undefined;
|
|
54
59
|
delay?: number | undefined;
|
|
55
60
|
};
|
|
56
|
-
entities?: any;
|
|
57
61
|
interceptors?: any;
|
|
62
|
+
entities?: any;
|
|
58
63
|
}, {
|
|
59
64
|
queue: unknown[];
|
|
60
65
|
settings: {
|
|
@@ -62,71 +67,68 @@ export declare const graphqlConfigSchema: z.ZodObject<{
|
|
|
62
67
|
status?: number | undefined;
|
|
63
68
|
delay?: number | undefined;
|
|
64
69
|
};
|
|
65
|
-
entities?: unknown;
|
|
66
70
|
interceptors?: unknown;
|
|
71
|
+
entities?: unknown;
|
|
67
72
|
}>>]>, "many">;
|
|
68
73
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
69
|
-
}
|
|
74
|
+
}>, "strict", z.ZodTypeAny, {
|
|
70
75
|
routes: ({
|
|
71
76
|
data?: any;
|
|
72
|
-
settings?: any;
|
|
73
|
-
entities?: any;
|
|
74
77
|
interceptors?: any;
|
|
78
|
+
entities?: any;
|
|
79
|
+
settings?: any;
|
|
75
80
|
} | {
|
|
76
81
|
queue: {
|
|
77
|
-
time?: number | undefined;
|
|
78
82
|
data?: any;
|
|
83
|
+
time?: number | undefined;
|
|
79
84
|
}[];
|
|
80
85
|
settings: {
|
|
81
86
|
polling: true;
|
|
82
87
|
status?: number | undefined;
|
|
83
88
|
delay?: number | undefined;
|
|
84
89
|
};
|
|
85
|
-
entities?: any;
|
|
86
90
|
interceptors?: any;
|
|
91
|
+
entities?: any;
|
|
87
92
|
})[];
|
|
88
|
-
operationName:
|
|
93
|
+
operationName: string | RegExp;
|
|
89
94
|
operationType: "query" | "mutation";
|
|
90
95
|
query?: string | undefined;
|
|
91
96
|
interceptors?: any;
|
|
92
97
|
}, {
|
|
93
98
|
routes: unknown[];
|
|
94
|
-
operationName:
|
|
99
|
+
operationName: string | RegExp;
|
|
95
100
|
operationType: "query" | "mutation";
|
|
96
101
|
query?: string | undefined;
|
|
97
102
|
interceptors?: unknown;
|
|
98
|
-
}>>, z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<{
|
|
99
|
-
query: z.ZodString;
|
|
103
|
+
}>>, z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<z.objectUtil.extendShape<{
|
|
100
104
|
operationName: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>;
|
|
105
|
+
query: z.ZodString;
|
|
106
|
+
}, {
|
|
101
107
|
operationType: z.ZodEnum<["query", "mutation"]>;
|
|
102
|
-
routes: z.ZodArray<z.ZodUnion<[z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<{
|
|
103
|
-
data: z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, z.ZodAny]>;
|
|
108
|
+
routes: z.ZodArray<z.ZodUnion<[z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<z.objectUtil.extendShape<{
|
|
104
109
|
settings: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
110
|
+
data: z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, z.ZodAny]>;
|
|
111
|
+
}, {
|
|
105
112
|
entities: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
106
113
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
107
|
-
}
|
|
114
|
+
}>, "strict", z.ZodTypeAny, {
|
|
108
115
|
data?: any;
|
|
109
|
-
settings?: any;
|
|
110
|
-
entities?: any;
|
|
111
116
|
interceptors?: any;
|
|
117
|
+
entities?: any;
|
|
118
|
+
settings?: any;
|
|
112
119
|
}, {
|
|
113
120
|
data?: any;
|
|
114
|
-
settings?: unknown;
|
|
115
|
-
entities?: unknown;
|
|
116
121
|
interceptors?: unknown;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
time?: number | undefined;
|
|
123
|
-
data?: any;
|
|
124
|
-
}>>, "many">;
|
|
125
|
-
settings: z.ZodObject<{
|
|
122
|
+
entities?: unknown;
|
|
123
|
+
settings?: unknown;
|
|
124
|
+
}>>, z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<z.objectUtil.extendShape<{
|
|
125
|
+
settings: z.ZodObject<z.objectUtil.extendShape<{
|
|
126
|
+
polling: z.ZodOptional<z.ZodBoolean>;
|
|
126
127
|
status: z.ZodOptional<z.ZodNumber>;
|
|
127
128
|
delay: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
}, {
|
|
128
130
|
polling: z.ZodLiteral<true>;
|
|
129
|
-
}
|
|
131
|
+
}>, "strict", z.ZodTypeAny, {
|
|
130
132
|
polling: true;
|
|
131
133
|
status?: number | undefined;
|
|
132
134
|
delay?: number | undefined;
|
|
@@ -135,20 +137,28 @@ export declare const graphqlConfigSchema: z.ZodObject<{
|
|
|
135
137
|
status?: number | undefined;
|
|
136
138
|
delay?: number | undefined;
|
|
137
139
|
}>;
|
|
140
|
+
queue: z.ZodArray<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodType<{
|
|
141
|
+
data?: any;
|
|
142
|
+
time?: number | undefined;
|
|
143
|
+
}, z.ZodTypeDef, {
|
|
144
|
+
data?: any;
|
|
145
|
+
time?: number | undefined;
|
|
146
|
+
}>>, "many">;
|
|
147
|
+
}, {
|
|
138
148
|
entities: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
139
149
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
140
|
-
}
|
|
150
|
+
}>, "strict", z.ZodTypeAny, {
|
|
141
151
|
queue: {
|
|
142
|
-
time?: number | undefined;
|
|
143
152
|
data?: any;
|
|
153
|
+
time?: number | undefined;
|
|
144
154
|
}[];
|
|
145
155
|
settings: {
|
|
146
156
|
polling: true;
|
|
147
157
|
status?: number | undefined;
|
|
148
158
|
delay?: number | undefined;
|
|
149
159
|
};
|
|
150
|
-
entities?: any;
|
|
151
160
|
interceptors?: any;
|
|
161
|
+
entities?: any;
|
|
152
162
|
}, {
|
|
153
163
|
queue: unknown[];
|
|
154
164
|
settings: {
|
|
@@ -156,62 +166,62 @@ export declare const graphqlConfigSchema: z.ZodObject<{
|
|
|
156
166
|
status?: number | undefined;
|
|
157
167
|
delay?: number | undefined;
|
|
158
168
|
};
|
|
159
|
-
entities?: unknown;
|
|
160
169
|
interceptors?: unknown;
|
|
170
|
+
entities?: unknown;
|
|
161
171
|
}>>]>, "many">;
|
|
162
172
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
163
|
-
}
|
|
173
|
+
}>, "strict", z.ZodTypeAny, {
|
|
164
174
|
query: string;
|
|
165
175
|
routes: ({
|
|
166
176
|
data?: any;
|
|
167
|
-
settings?: any;
|
|
168
|
-
entities?: any;
|
|
169
177
|
interceptors?: any;
|
|
178
|
+
entities?: any;
|
|
179
|
+
settings?: any;
|
|
170
180
|
} | {
|
|
171
181
|
queue: {
|
|
172
|
-
time?: number | undefined;
|
|
173
182
|
data?: any;
|
|
183
|
+
time?: number | undefined;
|
|
174
184
|
}[];
|
|
175
185
|
settings: {
|
|
176
186
|
polling: true;
|
|
177
187
|
status?: number | undefined;
|
|
178
188
|
delay?: number | undefined;
|
|
179
189
|
};
|
|
180
|
-
entities?: any;
|
|
181
190
|
interceptors?: any;
|
|
191
|
+
entities?: any;
|
|
182
192
|
})[];
|
|
183
193
|
operationType: "query" | "mutation";
|
|
184
|
-
operationName?: string | RegExp | undefined;
|
|
185
194
|
interceptors?: any;
|
|
195
|
+
operationName?: string | RegExp | undefined;
|
|
186
196
|
}, {
|
|
187
197
|
query: string;
|
|
188
198
|
routes: unknown[];
|
|
189
199
|
operationType: "query" | "mutation";
|
|
190
|
-
operationName?: string | RegExp | undefined;
|
|
191
200
|
interceptors?: unknown;
|
|
201
|
+
operationName?: string | RegExp | undefined;
|
|
192
202
|
}>>]>, "many">;
|
|
193
203
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
194
204
|
}, "strict", z.ZodTypeAny, {
|
|
195
205
|
configs: ({
|
|
196
206
|
routes: ({
|
|
197
207
|
data?: any;
|
|
198
|
-
settings?: any;
|
|
199
|
-
entities?: any;
|
|
200
208
|
interceptors?: any;
|
|
209
|
+
entities?: any;
|
|
210
|
+
settings?: any;
|
|
201
211
|
} | {
|
|
202
212
|
queue: {
|
|
203
|
-
time?: number | undefined;
|
|
204
213
|
data?: any;
|
|
214
|
+
time?: number | undefined;
|
|
205
215
|
}[];
|
|
206
216
|
settings: {
|
|
207
217
|
polling: true;
|
|
208
218
|
status?: number | undefined;
|
|
209
219
|
delay?: number | undefined;
|
|
210
220
|
};
|
|
211
|
-
entities?: any;
|
|
212
221
|
interceptors?: any;
|
|
222
|
+
entities?: any;
|
|
213
223
|
})[];
|
|
214
|
-
operationName:
|
|
224
|
+
operationName: string | RegExp;
|
|
215
225
|
operationType: "query" | "mutation";
|
|
216
226
|
query?: string | undefined;
|
|
217
227
|
interceptors?: any;
|
|
@@ -219,30 +229,30 @@ export declare const graphqlConfigSchema: z.ZodObject<{
|
|
|
219
229
|
query: string;
|
|
220
230
|
routes: ({
|
|
221
231
|
data?: any;
|
|
222
|
-
settings?: any;
|
|
223
|
-
entities?: any;
|
|
224
232
|
interceptors?: any;
|
|
233
|
+
entities?: any;
|
|
234
|
+
settings?: any;
|
|
225
235
|
} | {
|
|
226
236
|
queue: {
|
|
227
|
-
time?: number | undefined;
|
|
228
237
|
data?: any;
|
|
238
|
+
time?: number | undefined;
|
|
229
239
|
}[];
|
|
230
240
|
settings: {
|
|
231
241
|
polling: true;
|
|
232
242
|
status?: number | undefined;
|
|
233
243
|
delay?: number | undefined;
|
|
234
244
|
};
|
|
235
|
-
entities?: any;
|
|
236
245
|
interceptors?: any;
|
|
246
|
+
entities?: any;
|
|
237
247
|
})[];
|
|
238
248
|
operationType: "query" | "mutation";
|
|
239
|
-
operationName?: string | RegExp | undefined;
|
|
240
249
|
interceptors?: any;
|
|
250
|
+
operationName?: string | RegExp | undefined;
|
|
241
251
|
})[];
|
|
242
|
-
baseUrl?: string | undefined;
|
|
243
252
|
interceptors?: any;
|
|
253
|
+
baseUrl?: string | undefined;
|
|
244
254
|
}, {
|
|
245
255
|
configs: unknown[];
|
|
246
|
-
baseUrl?: string | undefined;
|
|
247
256
|
interceptors?: unknown;
|
|
257
|
+
baseUrl?: string | undefined;
|
|
248
258
|
}>;
|
|
@@ -16,8 +16,8 @@ const _utils = require("../utils");
|
|
|
16
16
|
const _routeConfigSchema = require("./routeConfigSchema/routeConfigSchema");
|
|
17
17
|
const baseRequestConfigSchema = _zod.z.strictObject({
|
|
18
18
|
operationType: _zod.z.enum([
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
'query',
|
|
20
|
+
'mutation'
|
|
21
21
|
]),
|
|
22
22
|
routes: _zod.z.array(_routeConfigSchema.routeConfigSchema),
|
|
23
23
|
interceptors: (0, _utils.plainObjectSchema)(_interceptorsSchema.interceptorsSchema).optional()
|
|
@@ -37,8 +37,8 @@ const queryRequestConfigSchema = _zod.z.strictObject({
|
|
|
37
37
|
query: _zod.z.string()
|
|
38
38
|
}).merge(baseRequestConfigSchema);
|
|
39
39
|
const requestConfigSchema = _zod.z.union([
|
|
40
|
-
_zod.z.custom((value)=>(0, _helpers.isPlainObject)(value) &&
|
|
41
|
-
_zod.z.custom((value)=>(0, _helpers.isPlainObject)(value) &&
|
|
40
|
+
_zod.z.custom((value)=>(0, _helpers.isPlainObject)(value) && 'operationName' in value).pipe(operationNameRequestConfigSchema),
|
|
41
|
+
_zod.z.custom((value)=>(0, _helpers.isPlainObject)(value) && 'query' in value).pipe(queryRequestConfigSchema)
|
|
42
42
|
]);
|
|
43
43
|
const graphqlConfigSchema = _zod.z.strictObject({
|
|
44
44
|
baseUrl: _baseUrlSchema.baseUrlSchema.optional(),
|
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const routeConfigSchema: z.ZodUnion<[z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<{
|
|
3
|
-
data: z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, z.ZodAny]>;
|
|
2
|
+
export declare const routeConfigSchema: z.ZodUnion<[z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<z.objectUtil.extendShape<{
|
|
4
3
|
settings: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
4
|
+
data: z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, z.ZodAny]>;
|
|
5
|
+
}, {
|
|
5
6
|
entities: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
6
7
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
7
|
-
}
|
|
8
|
+
}>, "strict", z.ZodTypeAny, {
|
|
8
9
|
data?: any;
|
|
9
|
-
settings?: any;
|
|
10
|
-
entities?: any;
|
|
11
10
|
interceptors?: any;
|
|
11
|
+
entities?: any;
|
|
12
|
+
settings?: any;
|
|
12
13
|
}, {
|
|
13
14
|
data?: any;
|
|
14
|
-
settings?: unknown;
|
|
15
|
-
entities?: unknown;
|
|
16
15
|
interceptors?: unknown;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
time?: number | undefined;
|
|
23
|
-
data?: any;
|
|
24
|
-
}>>, "many">;
|
|
25
|
-
settings: z.ZodObject<{
|
|
16
|
+
entities?: unknown;
|
|
17
|
+
settings?: unknown;
|
|
18
|
+
}>>, z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodObject<z.objectUtil.extendShape<{
|
|
19
|
+
settings: z.ZodObject<z.objectUtil.extendShape<{
|
|
20
|
+
polling: z.ZodOptional<z.ZodBoolean>;
|
|
26
21
|
status: z.ZodOptional<z.ZodNumber>;
|
|
27
22
|
delay: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
}, {
|
|
28
24
|
polling: z.ZodLiteral<true>;
|
|
29
|
-
}
|
|
25
|
+
}>, "strict", z.ZodTypeAny, {
|
|
30
26
|
polling: true;
|
|
31
27
|
status?: number | undefined;
|
|
32
28
|
delay?: number | undefined;
|
|
@@ -35,20 +31,28 @@ export declare const routeConfigSchema: z.ZodUnion<[z.ZodPipeline<z.ZodType<unkn
|
|
|
35
31
|
status?: number | undefined;
|
|
36
32
|
delay?: number | undefined;
|
|
37
33
|
}>;
|
|
34
|
+
queue: z.ZodArray<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodType<{
|
|
35
|
+
data?: any;
|
|
36
|
+
time?: number | undefined;
|
|
37
|
+
}, z.ZodTypeDef, {
|
|
38
|
+
data?: any;
|
|
39
|
+
time?: number | undefined;
|
|
40
|
+
}>>, "many">;
|
|
41
|
+
}, {
|
|
38
42
|
entities: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
39
43
|
interceptors: z.ZodOptional<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeAny>>;
|
|
40
|
-
}
|
|
44
|
+
}>, "strict", z.ZodTypeAny, {
|
|
41
45
|
queue: {
|
|
42
|
-
time?: number | undefined;
|
|
43
46
|
data?: any;
|
|
47
|
+
time?: number | undefined;
|
|
44
48
|
}[];
|
|
45
49
|
settings: {
|
|
46
50
|
polling: true;
|
|
47
51
|
status?: number | undefined;
|
|
48
52
|
delay?: number | undefined;
|
|
49
53
|
};
|
|
50
|
-
entities?: any;
|
|
51
54
|
interceptors?: any;
|
|
55
|
+
entities?: any;
|
|
52
56
|
}, {
|
|
53
57
|
queue: unknown[];
|
|
54
58
|
settings: {
|
|
@@ -56,6 +60,6 @@ export declare const routeConfigSchema: z.ZodUnion<[z.ZodPipeline<z.ZodType<unkn
|
|
|
56
60
|
status?: number | undefined;
|
|
57
61
|
delay?: number | undefined;
|
|
58
62
|
};
|
|
59
|
-
entities?: unknown;
|
|
60
63
|
interceptors?: unknown;
|
|
64
|
+
entities?: unknown;
|
|
61
65
|
}>>]>;
|
package/dist/bin/validateMockServerConfig/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.js
CHANGED
|
@@ -22,9 +22,7 @@ const baseRouteConfigSchema = _zod.z.strictObject({
|
|
|
22
22
|
query: _utils.mappedEntitySchema.optional(),
|
|
23
23
|
variables: _utils.plainEntitySchema.optional()
|
|
24
24
|
})).optional(),
|
|
25
|
-
interceptors: (0, _utils.plainObjectSchema)(_interceptorsSchema.interceptorsSchema.
|
|
26
|
-
response: true
|
|
27
|
-
})).optional()
|
|
25
|
+
interceptors: (0, _utils.plainObjectSchema)(_interceptorsSchema.interceptorsSchema).optional()
|
|
28
26
|
});
|
|
29
27
|
const dataRouteConfigSchema = _zod.z.strictObject({
|
|
30
28
|
settings: (0, _utils.plainObjectSchema)(_settingsSchema.settingsSchema.extend({
|
|
@@ -42,6 +40,6 @@ const queueRouteConfigSchema = _zod.z.strictObject({
|
|
|
42
40
|
queue: _queueSchema.queueSchema
|
|
43
41
|
}).merge(baseRouteConfigSchema);
|
|
44
42
|
const routeConfigSchema = _zod.z.union([
|
|
45
|
-
_zod.z.custom((value)=>(0, _helpers.isPlainObject)(value) && (0, _helpers1.isOnlyRequestedDataResolvingPropertyExists)(value,
|
|
46
|
-
_zod.z.custom((value)=>(0, _helpers.isPlainObject)(value) && (0, _helpers1.isOnlyRequestedDataResolvingPropertyExists)(value,
|
|
43
|
+
_zod.z.custom((value)=>(0, _helpers.isPlainObject)(value) && (0, _helpers1.isOnlyRequestedDataResolvingPropertyExists)(value, 'data')).pipe(dataRouteConfigSchema),
|
|
44
|
+
_zod.z.custom((value)=>(0, _helpers.isPlainObject)(value) && (0, _helpers1.isOnlyRequestedDataResolvingPropertyExists)(value, 'queue')).pipe(queueRouteConfigSchema)
|
|
47
45
|
]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const queueSchema: z.ZodArray<z.ZodPipeline<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodType<{
|
|
3
|
-
time?: number | undefined;
|
|
4
3
|
data?: any;
|
|
5
|
-
}, z.ZodTypeDef, {
|
|
6
4
|
time?: number | undefined;
|
|
5
|
+
}, z.ZodTypeDef, {
|
|
7
6
|
data?: any;
|
|
7
|
+
time?: number | undefined;
|
|
8
8
|
}>>, "many">;
|