mock-config-server 3.4.1 → 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 -6
- package/dist/bin/build.js +52 -50
- package/dist/bin/cli.js +50 -43
- package/dist/bin/helpers/createTemplate.js +29 -21
- package/dist/bin/helpers/getMostSpecificPathFromError.js +34 -30
- package/dist/bin/helpers/getValidationMessageFromPath.js +11 -8
- package/dist/bin/helpers/index.js +21 -79
- package/dist/bin/helpers/isOnlyRequestedDataResolvingPropertyExists.js +13 -6
- package/dist/bin/helpers/resolveConfigFile.js +22 -19
- package/dist/bin/helpers/resolveConfigFilePath.js +19 -12
- package/dist/bin/helpers/resolveExportsFromSourceCode.js +13 -10
- package/dist/bin/init.js +114 -97
- package/dist/bin/run.js +42 -43
- package/dist/bin/validateMockServerConfig/baseUrlSchema/baseUrlSchema.js +9 -5
- package/dist/bin/validateMockServerConfig/corsSchema/corsSchema.d.ts +2 -2
- package/dist/bin/validateMockServerConfig/corsSchema/corsSchema.js +32 -14
- package/dist/bin/validateMockServerConfig/databaseConfigSchema/databaseConfigSchema.js +19 -9
- package/dist/bin/validateMockServerConfig/graphqlConfigSchema/graphqlConfigSchema.d.ts +82 -72
- package/dist/bin/validateMockServerConfig/graphqlConfigSchema/graphqlConfigSchema.js +38 -22
- package/dist/bin/validateMockServerConfig/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.d.ts +25 -21
- package/dist/bin/validateMockServerConfig/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.js +36 -28
- package/dist/bin/validateMockServerConfig/interceptorsSchema/interceptorsSchema.js +12 -8
- package/dist/bin/validateMockServerConfig/portSchema/portSchema.js +9 -5
- package/dist/bin/validateMockServerConfig/queueSchema/queueSchema.d.ts +2 -2
- package/dist/bin/validateMockServerConfig/queueSchema/queueSchema.js +18 -9
- package/dist/bin/validateMockServerConfig/restConfigSchema/restConfigSchema.d.ts +270 -240
- package/dist/bin/validateMockServerConfig/restConfigSchema/restConfigSchema.js +33 -19
- package/dist/bin/validateMockServerConfig/restConfigSchema/routeConfigSchema/routeConfigSchema.d.ts +33 -28
- package/dist/bin/validateMockServerConfig/restConfigSchema/routeConfigSchema/routeConfigSchema.js +60 -48
- package/dist/bin/validateMockServerConfig/settingsSchema/settingsSchema.js +13 -9
- package/dist/bin/validateMockServerConfig/staticPathSchema/staticPathSchema.js +19 -9
- package/dist/bin/validateMockServerConfig/utils/checkModeSchema/checkModeSchema.js +27 -9
- package/dist/bin/validateMockServerConfig/utils/entitiesSchema/entitiesSchema.d.ts +4 -8
- package/dist/bin/validateMockServerConfig/utils/entitiesSchema/entitiesSchema.js +117 -60
- package/dist/bin/validateMockServerConfig/utils/index.js +20 -68
- package/dist/bin/validateMockServerConfig/utils/jsonSchema/jsonSchema.js +30 -10
- package/dist/bin/validateMockServerConfig/utils/plainObjectSchema/plainObjectSchema.js +9 -8
- package/dist/bin/validateMockServerConfig/utils/requiredPropertiesSchema/requiredPropertiesSchema.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/utils/requiredPropertiesSchema/requiredPropertiesSchema.js +10 -7
- package/dist/bin/validateMockServerConfig/utils/sharedSchema/sharedSchema.js +18 -6
- package/dist/bin/validateMockServerConfig/validateApiMockServerConfig.js +43 -40
- package/dist/bin/validateMockServerConfig/validateMockServerConfig.js +38 -35
- package/dist/index.js +15 -13
- package/dist/src/core/database/createDatabaseRoutes/createDatabaseRoutes.js +25 -28
- package/dist/src/core/database/createDatabaseRoutes/helpers/array/createNewId/createNewId.js +14 -11
- package/dist/src/core/database/createDatabaseRoutes/helpers/array/findIndexById/findIndexById.js +8 -5
- package/dist/src/core/database/createDatabaseRoutes/helpers/array/index.js +17 -35
- package/dist/src/core/database/createDatabaseRoutes/helpers/array/isIndex/isIndex.js +8 -5
- package/dist/src/core/database/createDatabaseRoutes/helpers/createNestedDatabaseRoutes/createNestedDatabaseRoutes.js +159 -143
- package/dist/src/core/database/createDatabaseRoutes/helpers/createRewrittenDatabaseRoutes/createRewrittenDatabaseRoutes.js +15 -8
- package/dist/src/core/database/createDatabaseRoutes/helpers/createShallowDatabaseRoutes/createShallowDatabaseRoutes.js +90 -94
- package/dist/src/core/database/createDatabaseRoutes/helpers/filter/filter.js +49 -46
- package/dist/src/core/database/createDatabaseRoutes/helpers/index.js +19 -57
- package/dist/src/core/database/createDatabaseRoutes/helpers/pagination/pagination.js +32 -31
- package/dist/src/core/database/createDatabaseRoutes/helpers/search/search.js +34 -24
- package/dist/src/core/database/createDatabaseRoutes/helpers/sort/sort.js +37 -33
- package/dist/src/core/database/createDatabaseRoutes/helpers/splitDatabaseByNesting/splitDatabaseByNesting.js +26 -25
- package/dist/src/core/database/createDatabaseRoutes/storages/File/FileStorage.js +65 -50
- package/dist/src/core/database/createDatabaseRoutes/storages/File/FileWriter.js +55 -48
- package/dist/src/core/database/createDatabaseRoutes/storages/Memory/MemoryStorage.js +51 -41
- package/dist/src/core/database/createDatabaseRoutes/storages/index.js +16 -24
- package/dist/src/core/database/index.js +15 -13
- package/dist/src/core/graphql/createGraphQLRoutes/createGraphQLRoutes.js +131 -140
- package/dist/src/core/graphql/createGraphQLRoutes/helpers/index.js +15 -13
- package/dist/src/core/graphql/createGraphQLRoutes/helpers/prepareGraphQLRequestConfigs/prepareGraphQLRequestConfigs.js +36 -41
- package/dist/src/core/graphql/index.js +15 -13
- package/dist/src/core/middlewares/cookieParseMiddleware/cookieParseMiddleware.js +16 -13
- package/dist/src/core/middlewares/cookieParseMiddleware/helpers/index.js +15 -13
- package/dist/src/core/middlewares/cookieParseMiddleware/helpers/parseCookie/parseCookie.js +18 -15
- package/dist/src/core/middlewares/corsMiddleware/corsMiddleware.js +50 -47
- package/dist/src/core/middlewares/corsMiddleware/helpers/getAllowedOrigins/getAllowedOrigins.js +17 -12
- package/dist/src/core/middlewares/corsMiddleware/helpers/index.js +15 -13
- package/dist/src/core/middlewares/destroyerMiddleware/destroyerMiddleware.js +23 -20
- package/dist/src/core/middlewares/errorMiddleware/errorMiddleware.js +23 -17
- package/dist/src/core/middlewares/index.js +23 -91
- package/dist/src/core/middlewares/noCorsMiddleware/noCorsMiddleware.js +22 -19
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getGraphqlUrlSuggestions/getGraphqlUrlSuggestions.js +21 -23
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getLevenshteinDistance/getLevenshteinDistance.js +80 -80
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/getRestUrlSuggestions.js +34 -34
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/helpers/getActualRestUrlMeaningfulString/getActualRestUrlMeaningfulString.js +8 -5
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/helpers/getPatternRestUrlMeaningfulString/getPatternRestUrlMeaningfulString.js +8 -5
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/helpers/index.js +16 -24
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/index.js +17 -35
- package/dist/src/core/middlewares/notFoundMiddleware/notFoundMiddleware.js +58 -60
- package/dist/src/core/middlewares/requestInterceptorMiddleware/requestInterceptorMiddleware.js +16 -17
- package/dist/src/core/middlewares/staticMiddleware/staticMiddleware.js +32 -25
- package/dist/src/core/rest/createRestRoutes/createRestRoutes.js +125 -130
- package/dist/src/core/rest/createRestRoutes/helpers/index.js +15 -13
- package/dist/src/core/rest/createRestRoutes/helpers/prepareRestRequestConfigs/prepareRestRequestConfigs.js +37 -43
- package/dist/src/core/rest/index.js +15 -13
- package/dist/src/index.js +16 -24
- package/dist/src/server/createDatabaseMockServer/createDatabaseMockServer.js +56 -53
- package/dist/src/server/createGraphQLMockServer/createGraphQLMockServer.js +64 -62
- package/dist/src/server/createMockServer/createMockServer.js +94 -91
- package/dist/src/server/createRestMockServer/createRestMockServer.js +64 -62
- package/dist/src/server/index.js +23 -91
- package/dist/src/server/startDatabaseMockServer/startDatabaseMockServer.js +25 -19
- package/dist/src/server/startGraphQLMockServer/startGraphQLMockServer.js +25 -19
- package/dist/src/server/startMockServer/startMockServer.js +25 -19
- package/dist/src/server/startRestMockServer/startRestMockServer.js +25 -19
- package/dist/src/utils/constants/appPath.js +8 -4
- package/dist/src/utils/constants/checkModes.js +74 -11
- package/dist/src/utils/constants/default.js +18 -14
- package/dist/src/utils/constants/index.js +17 -35
- package/dist/src/utils/helpers/asyncHandler.js +8 -5
- package/dist/src/utils/helpers/config/index.js +15 -13
- package/dist/src/utils/helpers/config/resolveEntityValues/resolveEntityValues.js +103 -110
- package/dist/src/utils/helpers/entities/convertToEntityDescriptor/convertToEntityDescriptor.js +12 -9
- package/dist/src/utils/helpers/entities/index.js +16 -24
- package/dist/src/utils/helpers/entities/isEntityDescriptor/isEntityDescriptor.js +9 -6
- package/dist/src/utils/helpers/files/index.js +15 -13
- package/dist/src/utils/helpers/files/isFilePathValid/isFilePathValid.js +22 -15
- package/dist/src/utils/helpers/graphql/getGraphQLInput/getGraphQLInput.js +25 -29
- package/dist/src/utils/helpers/graphql/index.js +17 -35
- package/dist/src/utils/helpers/graphql/parseGraphQLRequest/parseGraphQLRequest.js +13 -10
- package/dist/src/utils/helpers/graphql/parseQuery/parseQuery.js +23 -19
- package/dist/src/utils/helpers/index.js +26 -124
- package/dist/src/utils/helpers/interceptors/callRequestInterceptor/callRequestInterceptor.js +21 -21
- package/dist/src/utils/helpers/interceptors/callResponseInterceptors/callResponseInterceptors.js +62 -64
- package/dist/src/utils/helpers/interceptors/helpers/setDelay.js +10 -7
- package/dist/src/utils/helpers/interceptors/index.js +16 -24
- package/dist/src/utils/helpers/isPlainObject/isPlainObject.js +8 -5
- package/dist/src/utils/helpers/isPrimitive/isPrimitive.js +8 -5
- package/dist/src/utils/helpers/isRegExp/isRegExp.js +8 -5
- package/dist/src/utils/helpers/sleep.js +9 -6
- package/dist/src/utils/helpers/tests/createTmpDir.js +16 -9
- package/dist/src/utils/helpers/tests/index.js +15 -13
- package/dist/src/utils/helpers/url/convertWin32PathToUnix/convertWin32PathToUnix.js +8 -5
- package/dist/src/utils/helpers/url/getUrlParts/getUrlParts.js +9 -6
- package/dist/src/utils/helpers/url/index.js +18 -46
- package/dist/src/utils/helpers/url/removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes.js +8 -5
- package/dist/src/utils/helpers/url/urlJoin/urlJoin.js +18 -11
- package/dist/src/utils/types/checkModes.js +4 -1
- package/dist/src/utils/types/database.js +4 -1
- package/dist/src/utils/types/entities.js +4 -1
- package/dist/src/utils/types/graphql.d.ts +1 -1
- package/dist/src/utils/types/graphql.js +4 -1
- package/dist/src/utils/types/index.js +24 -102
- package/dist/src/utils/types/interceptors.js +4 -1
- package/dist/src/utils/types/rest.d.ts +1 -1
- package/dist/src/utils/types/rest.js +4 -1
- package/dist/src/utils/types/server.js +4 -1
- package/dist/src/utils/types/utils.js +4 -1
- package/dist/src/utils/types/values.js +4 -1
- package/package.json +26 -29
- package/dist/bin/templates/.eslintrc.js +0 -14
- package/dist/bin/templates/tsconfig.json +0 -11
|
@@ -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
|
}>;
|
|
@@ -1,31 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
Object.defineProperty(exports, "graphqlConfigSchema", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return graphqlConfigSchema;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _zod = require("zod");
|
|
12
|
+
const _helpers = require("../../../src/utils/helpers");
|
|
13
|
+
const _baseUrlSchema = require("../baseUrlSchema/baseUrlSchema");
|
|
14
|
+
const _interceptorsSchema = require("../interceptorsSchema/interceptorsSchema");
|
|
15
|
+
const _utils = require("../utils");
|
|
16
|
+
const _routeConfigSchema = require("./routeConfigSchema/routeConfigSchema");
|
|
13
17
|
const baseRequestConfigSchema = _zod.z.strictObject({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
operationType: _zod.z.enum([
|
|
19
|
+
'query',
|
|
20
|
+
'mutation'
|
|
21
|
+
]),
|
|
22
|
+
routes: _zod.z.array(_routeConfigSchema.routeConfigSchema),
|
|
23
|
+
interceptors: (0, _utils.plainObjectSchema)(_interceptorsSchema.interceptorsSchema).optional()
|
|
17
24
|
});
|
|
18
25
|
const operationNameRequestConfigSchema = _zod.z.strictObject({
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
operationName: _zod.z.union([
|
|
27
|
+
_zod.z.string(),
|
|
28
|
+
_zod.z.instanceof(RegExp)
|
|
29
|
+
]),
|
|
30
|
+
query: _zod.z.string().optional()
|
|
21
31
|
}).merge(baseRequestConfigSchema);
|
|
22
32
|
const queryRequestConfigSchema = _zod.z.strictObject({
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
operationName: _zod.z.union([
|
|
34
|
+
_zod.z.string(),
|
|
35
|
+
_zod.z.instanceof(RegExp)
|
|
36
|
+
]).optional(),
|
|
37
|
+
query: _zod.z.string()
|
|
25
38
|
}).merge(baseRequestConfigSchema);
|
|
26
|
-
const requestConfigSchema = _zod.z.union([
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
const requestConfigSchema = _zod.z.union([
|
|
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
|
+
]);
|
|
43
|
+
const graphqlConfigSchema = _zod.z.strictObject({
|
|
44
|
+
baseUrl: _baseUrlSchema.baseUrlSchema.optional(),
|
|
45
|
+
configs: _zod.z.array(requestConfigSchema),
|
|
46
|
+
interceptors: (0, _utils.plainObjectSchema)(_interceptorsSchema.interceptorsSchema).optional()
|
|
47
|
+
});
|
|
@@ -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
|
@@ -1,37 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
Object.defineProperty(exports, "routeConfigSchema", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return routeConfigSchema;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _zod = require("zod");
|
|
12
|
+
const _helpers = require("../../../../src/utils/helpers");
|
|
13
|
+
const _helpers1 = require("../../../helpers");
|
|
14
|
+
const _interceptorsSchema = require("../../interceptorsSchema/interceptorsSchema");
|
|
15
|
+
const _queueSchema = require("../../queueSchema/queueSchema");
|
|
16
|
+
const _settingsSchema = require("../../settingsSchema/settingsSchema");
|
|
17
|
+
const _utils = require("../../utils");
|
|
14
18
|
const baseRouteConfigSchema = _zod.z.strictObject({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
response: true
|
|
23
|
-
})).optional()
|
|
19
|
+
entities: (0, _utils.plainObjectSchema)(_zod.z.strictObject({
|
|
20
|
+
headers: _utils.mappedEntitySchema.optional(),
|
|
21
|
+
cookies: _utils.mappedEntitySchema.optional(),
|
|
22
|
+
query: _utils.mappedEntitySchema.optional(),
|
|
23
|
+
variables: _utils.plainEntitySchema.optional()
|
|
24
|
+
})).optional(),
|
|
25
|
+
interceptors: (0, _utils.plainObjectSchema)(_interceptorsSchema.interceptorsSchema).optional()
|
|
24
26
|
});
|
|
25
27
|
const dataRouteConfigSchema = _zod.z.strictObject({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
settings: (0, _utils.plainObjectSchema)(_settingsSchema.settingsSchema.extend({
|
|
29
|
+
polling: _zod.z.literal(false).optional()
|
|
30
|
+
})).optional(),
|
|
31
|
+
data: _zod.z.union([
|
|
32
|
+
_zod.z.function(),
|
|
33
|
+
_zod.z.any()
|
|
34
|
+
])
|
|
30
35
|
}).merge(baseRouteConfigSchema);
|
|
31
36
|
const queueRouteConfigSchema = _zod.z.strictObject({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
settings: _settingsSchema.settingsSchema.extend({
|
|
38
|
+
polling: _zod.z.literal(true)
|
|
39
|
+
}),
|
|
40
|
+
queue: _queueSchema.queueSchema
|
|
36
41
|
}).merge(baseRouteConfigSchema);
|
|
37
|
-
const routeConfigSchema =
|
|
42
|
+
const routeConfigSchema = _zod.z.union([
|
|
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)
|
|
45
|
+
]);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "interceptorsSchema", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return interceptorsSchema;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _zod = require("zod");
|
|
12
|
+
const interceptorsSchema = _zod.z.strictObject({
|
|
13
|
+
request: _zod.z.function().optional(),
|
|
14
|
+
response: _zod.z.function().optional()
|
|
5
15
|
});
|
|
6
|
-
exports.interceptorsSchema = void 0;
|
|
7
|
-
var _zod = require("zod");
|
|
8
|
-
const interceptorsSchema = exports.interceptorsSchema = _zod.z.strictObject({
|
|
9
|
-
request: _zod.z.function().optional(),
|
|
10
|
-
response: _zod.z.function().optional()
|
|
11
|
-
});
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
5
|
+
Object.defineProperty(exports, "portSchema", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return portSchema;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _zod = require("zod");
|
|
8
12
|
const MAX_PORT = 65535;
|
|
9
|
-
const portSchema =
|
|
13
|
+
const portSchema = _zod.z.number().int().nonnegative().max(MAX_PORT);
|
|
@@ -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">;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
Object.defineProperty(exports, "queueSchema", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return queueSchema;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _zod = require("zod");
|
|
12
|
+
const _utils = require("../utils");
|
|
13
|
+
const queueSchema = _zod.z.array((0, _utils.requiredPropertiesSchema)(_zod.z.strictObject({
|
|
14
|
+
time: _zod.z.number().int().nonnegative().optional(),
|
|
15
|
+
data: _zod.z.union([
|
|
16
|
+
_zod.z.function(),
|
|
17
|
+
_zod.z.any()
|
|
18
|
+
])
|
|
19
|
+
}), [
|
|
20
|
+
'data'
|
|
21
|
+
]));
|