mock-config-server 4.0.3 → 5.0.0-beta.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 +229 -237
- package/dist/bin/build.d.ts +3 -3
- package/dist/bin/build.js +1 -11
- package/dist/bin/helpers/createTemplate.js +6 -6
- package/dist/bin/helpers/resolveConfigFile.d.ts +2 -2
- package/dist/bin/helpers/resolveConfigFile.js +2 -3
- package/dist/bin/helpers/resolveConfigFilePath.js +4 -4
- package/dist/bin/init.d.ts +2 -2
- package/dist/bin/init.js +7 -7
- package/dist/bin/run.d.ts +3 -3
- package/dist/bin/run.js +17 -24
- package/dist/bin/templates/js/full/mock-requests/graphql/index.js +2 -2
- package/dist/bin/templates/js/full/mock-requests/graphql/user.js +35 -35
- package/dist/bin/templates/js/full/mock-requests/graphql/users.js +12 -12
- package/dist/bin/templates/js/full/mock-requests/rest/index.js +2 -2
- package/dist/bin/templates/js/full/mock-requests/rest/user.js +35 -35
- package/dist/bin/templates/js/full/mock-requests/rest/users.js +12 -12
- package/dist/bin/templates/js/full/mock-server.config.js +19 -19
- package/dist/bin/templates/js/graphql/mock-requests/index.js +2 -2
- package/dist/bin/templates/js/graphql/mock-requests/user.js +35 -35
- package/dist/bin/templates/js/graphql/mock-requests/users.js +12 -12
- package/dist/bin/templates/js/graphql/mock-server.config.js +14 -14
- package/dist/bin/templates/js/rest/mock-requests/index.js +2 -2
- package/dist/bin/templates/js/rest/mock-requests/user.js +35 -35
- package/dist/bin/templates/js/rest/mock-requests/users.js +12 -12
- package/dist/bin/templates/js/rest/mock-server.config.js +14 -14
- package/dist/bin/templates/ts/full/mock-requests/graphql/index.ts +2 -2
- package/dist/bin/templates/ts/full/mock-requests/graphql/user.ts +37 -37
- package/dist/bin/templates/ts/full/mock-requests/graphql/users.ts +14 -14
- package/dist/bin/templates/ts/full/mock-requests/rest/index.ts +2 -2
- package/dist/bin/templates/ts/full/mock-requests/rest/user.ts +37 -37
- package/dist/bin/templates/ts/full/mock-requests/rest/users.ts +14 -14
- package/dist/bin/templates/ts/full/mock-server.config.ts +21 -21
- package/dist/bin/templates/ts/graphql/mock-requests/index.ts +2 -2
- package/dist/bin/templates/ts/graphql/mock-requests/user.ts +37 -37
- package/dist/bin/templates/ts/graphql/mock-requests/users.ts +14 -14
- package/dist/bin/templates/ts/graphql/mock-server.config.ts +16 -16
- package/dist/bin/templates/ts/rest/mock-requests/index.ts +2 -2
- package/dist/bin/templates/ts/rest/mock-requests/user.ts +37 -37
- package/dist/bin/templates/ts/rest/mock-requests/users.ts +14 -14
- package/dist/bin/templates/ts/rest/mock-server.config.ts +16 -16
- package/dist/src/core/database/createDatabaseRoutes/helpers/search/search.js +3 -3
- package/dist/src/core/database/createDatabaseRoutes/storages/File/FileStorage.js +4 -4
- package/dist/src/core/database/createDatabaseRoutes/storages/File/FileWriter.js +2 -2
- package/dist/src/core/functions/graphql/graphql.d.ts +54 -0
- package/dist/src/core/functions/graphql/graphql.js +126 -0
- package/dist/src/core/functions/graphql/helpers/createQueueHandler/createQueueHandler.d.ts +5 -0
- package/dist/src/core/functions/graphql/helpers/createQueueHandler/createQueueHandler.js +35 -0
- package/dist/src/core/functions/graphql/helpers/index.d.ts +1 -0
- package/dist/src/core/{rest/createRestRoutes → functions/graphql}/helpers/index.js +1 -1
- package/dist/src/core/functions/index.d.ts +3 -0
- package/dist/src/core/functions/index.js +20 -0
- package/dist/src/core/functions/mock.d.ts +2 -0
- package/dist/src/core/functions/mock.js +11 -0
- package/dist/src/core/functions/rest/helpers/createFileHandler/createFileHandler.d.ts +2 -0
- package/dist/src/core/functions/rest/helpers/createFileHandler/createFileHandler.js +29 -0
- package/dist/src/core/functions/rest/helpers/createQueueHandler/createQueueHandler.d.ts +5 -0
- package/dist/src/core/functions/rest/helpers/createQueueHandler/createQueueHandler.js +35 -0
- package/dist/src/core/functions/rest/helpers/formatSsePayload/formatSsePayload.d.ts +5 -0
- package/dist/src/core/functions/rest/helpers/formatSsePayload/formatSsePayload.js +50 -0
- package/dist/src/core/functions/rest/helpers/index.d.ts +3 -0
- package/dist/src/core/functions/rest/helpers/index.js +20 -0
- package/dist/src/core/functions/rest/index.d.ts +1 -0
- package/dist/src/core/{graphql/createGraphQLRoutes/helpers → functions/rest}/index.js +1 -1
- package/dist/src/core/functions/rest/rest.d.ts +102 -0
- package/dist/src/core/functions/rest/rest.js +165 -0
- package/dist/src/core/graphql/createGraphQLRoute/createGraphQLRoute.d.ts +8 -0
- package/dist/src/core/graphql/createGraphQLRoute/createGraphQLRoute.js +158 -0
- package/dist/src/core/graphql/createGraphQLRoute/helpers/calculateGraphQLRouteConfigWeight/calculateGraphQLRouteConfigWeight.d.ts +2 -0
- package/dist/src/core/graphql/{createGraphQLRoutes/helpers/prepareGraphQLRequestConfigs/prepareGraphQLRequestConfigs.js → createGraphQLRoute/helpers/calculateGraphQLRouteConfigWeight/calculateGraphQLRouteConfigWeight.js} +3 -11
- package/dist/src/core/graphql/createGraphQLRoute/helpers/index.d.ts +3 -0
- package/dist/src/core/graphql/createGraphQLRoute/helpers/index.js +20 -0
- package/dist/src/core/graphql/createGraphQLRoute/helpers/matchGraphQLRequestArtifacts/matchGraphQLRequestArtifacts.d.ts +12 -0
- package/dist/src/core/graphql/createGraphQLRoute/helpers/matchGraphQLRequestArtifacts/matchGraphQLRequestArtifacts.js +28 -0
- package/dist/src/core/graphql/createGraphQLRoute/helpers/prepareGraphQLRequestArtifacts/prepareGraphQLRequestArtifacts.d.ts +2 -0
- package/dist/src/core/graphql/createGraphQLRoute/helpers/prepareGraphQLRequestArtifacts/prepareGraphQLRequestArtifacts.js +11 -0
- package/dist/src/core/graphql/index.d.ts +2 -1
- package/dist/src/core/graphql/index.js +2 -1
- package/dist/src/core/middlewares/contextMiddleware/contextMiddleware.d.ts +6 -4
- package/dist/src/core/rest/createRestRoute/createRestRoute.d.ts +8 -0
- package/dist/src/core/rest/createRestRoute/createRestRoute.js +190 -0
- package/dist/src/core/rest/createRestRoute/helpers/calculateRestRouteConfigWeight/calculateRestRouteConfigWeight.d.ts +2 -0
- package/dist/src/core/rest/createRestRoute/helpers/calculateRestRouteConfigWeight/calculateRestRouteConfigWeight.js +35 -0
- package/dist/src/core/rest/createRestRoute/helpers/index.d.ts +3 -0
- package/dist/src/core/rest/createRestRoute/helpers/index.js +20 -0
- package/dist/src/core/rest/createRestRoute/helpers/matchRestRequestArtifacts/matchRestRequestArtifacts.d.ts +11 -0
- package/dist/src/core/rest/createRestRoute/helpers/matchRestRequestArtifacts/matchRestRequestArtifacts.js +31 -0
- package/dist/src/core/rest/createRestRoute/helpers/prepareRestRequestArtifacts/prepareRestRequestArtifacts.d.ts +2 -0
- package/dist/src/core/rest/createRestRoute/helpers/prepareRestRequestArtifacts/prepareRestRequestArtifacts.js +37 -0
- package/dist/src/core/rest/index.d.ts +2 -1
- package/dist/src/core/rest/index.js +2 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/server/createMockServer/createMockServer.d.ts +1 -1
- package/dist/src/server/createMockServer/createMockServer.js +76 -45
- package/dist/src/server/index.d.ts +0 -8
- package/dist/src/server/index.js +0 -8
- package/dist/src/server/startMockServer/startMockServer.d.ts +2 -2
- package/dist/src/server/startMockServer/startMockServer.js +4 -3
- package/dist/src/utils/constants/checkModes.js +7 -7
- package/dist/src/utils/helpers/config/resolveEntityValues/resolveEntityValues.js +1 -1
- package/dist/src/utils/helpers/files/isFileDescriptor/isFileDescriptor.js +2 -2
- package/dist/src/utils/helpers/files/isFilePathValid/isFilePathValid.js +3 -3
- package/dist/src/utils/helpers/interceptors/callResponseInterceptors/callResponseInterceptors.d.ts +3 -3
- package/dist/src/utils/helpers/interceptors/callResponseInterceptors/callResponseInterceptors.js +2 -2
- package/dist/src/utils/helpers/tests/createTmpDir.js +4 -4
- package/dist/src/utils/helpers/url/index.d.ts +1 -2
- package/dist/src/utils/helpers/url/index.js +1 -2
- package/dist/src/utils/helpers/url/normalizeUrl/normalizeUrl.d.ts +1 -0
- package/dist/src/utils/helpers/url/normalizeUrl/normalizeUrl.js +15 -0
- package/dist/src/utils/helpers/url/urlJoin/urlJoin.js +4 -4
- package/dist/src/utils/types/graphql.d.ts +44 -18
- package/dist/src/utils/types/rest.d.ts +44 -27
- package/dist/src/utils/types/server.d.ts +7 -24
- package/dist/src/utils/types/values.d.ts +6 -1
- package/dist/src/utils/validate/graphqlConfigSchema/graphqlConfigSchema.d.ts +41 -383
- package/dist/src/utils/validate/graphqlConfigSchema/graphqlConfigSchema.js +3 -3
- package/dist/src/utils/validate/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.d.ts +3 -66
- package/dist/src/utils/validate/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.js +7 -22
- package/dist/src/utils/validate/index.d.ts +0 -2
- package/dist/src/utils/validate/index.js +0 -2
- package/dist/src/utils/validate/queueSchema/queueSchema.d.ts +2 -11
- package/dist/src/utils/validate/queueSchema/queueSchema.js +7 -13
- package/dist/src/utils/validate/restConfigSchema/restConfigSchema.d.ts +101 -1309
- package/dist/src/utils/validate/restConfigSchema/restConfigSchema.js +3 -3
- package/dist/src/utils/validate/restConfigSchema/routeConfigSchema/routeConfigSchema.d.ts +3 -82
- package/dist/src/utils/validate/restConfigSchema/routeConfigSchema/routeConfigSchema.js +6 -28
- package/dist/src/utils/validate/settingsSchema/settingsSchema.d.ts +0 -3
- package/dist/src/utils/validate/settingsSchema/settingsSchema.js +0 -1
- package/dist/src/utils/validate/utils/checkModeSchema/checkModeSchema.js +6 -6
- package/dist/src/utils/validate/utils/entitiesSchema/entitiesSchema.js +4 -4
- package/dist/src/utils/validate/utils/jsonSchema/jsonSchema.js +3 -3
- package/dist/src/utils/validate/utils/requiredPropertiesSchema/requiredPropertiesSchema.js +1 -1
- package/dist/src/utils/validate/utils/sharedSchema/sharedSchema.js +3 -3
- package/dist/src/utils/validate/validateMockServerConfig.js +18 -8
- package/package.json +17 -40
- package/LICENSE +0 -21
- package/dist/bin/runFlatConfig.d.ts +0 -5
- package/dist/bin/runFlatConfig.js +0 -36
- package/dist/src/core/graphql/createGraphQLRoutes/createGraphQLRoutes.d.ts +0 -9
- package/dist/src/core/graphql/createGraphQLRoutes/createGraphQLRoutes.js +0 -160
- package/dist/src/core/graphql/createGraphQLRoutes/helpers/index.d.ts +0 -1
- package/dist/src/core/graphql/createGraphQLRoutes/helpers/prepareGraphQLRequestConfigs/prepareGraphQLRequestConfigs.d.ts +0 -2
- package/dist/src/core/rest/createRestRoutes/createRestRoutes.d.ts +0 -9
- package/dist/src/core/rest/createRestRoutes/createRestRoutes.js +0 -184
- package/dist/src/core/rest/createRestRoutes/helpers/index.d.ts +0 -1
- package/dist/src/core/rest/createRestRoutes/helpers/prepareRestRequestConfigs/prepareRestRequestConfigs.d.ts +0 -2
- package/dist/src/core/rest/createRestRoutes/helpers/prepareRestRequestConfigs/prepareRestRequestConfigs.js +0 -67
- package/dist/src/server/createDatabaseMockServer/createDatabaseMockServer.d.ts +0 -3
- package/dist/src/server/createDatabaseMockServer/createDatabaseMockServer.js +0 -62
- package/dist/src/server/createFlatMockServer/createFlatMockServer.d.ts +0 -3
- package/dist/src/server/createFlatMockServer/createFlatMockServer.js +0 -128
- package/dist/src/server/createGraphQLMockServer/createGraphQLMockServer.d.ts +0 -3
- package/dist/src/server/createGraphQLMockServer/createGraphQLMockServer.js +0 -67
- package/dist/src/server/createRestMockServer/createRestMockServer.d.ts +0 -3
- package/dist/src/server/createRestMockServer/createRestMockServer.js +0 -67
- package/dist/src/server/startDatabaseMockServer/startDatabaseMockServer.d.ts +0 -4
- package/dist/src/server/startDatabaseMockServer/startDatabaseMockServer.js +0 -29
- package/dist/src/server/startFlatMockServer/startFlatMockServer.d.ts +0 -4
- package/dist/src/server/startFlatMockServer/startFlatMockServer.js +0 -30
- package/dist/src/server/startGraphQLMockServer/startGraphQLMockServer.d.ts +0 -4
- package/dist/src/server/startGraphQLMockServer/startGraphQLMockServer.js +0 -29
- package/dist/src/server/startRestMockServer/startRestMockServer.d.ts +0 -4
- package/dist/src/server/startRestMockServer/startRestMockServer.js +0 -29
- package/dist/src/utils/helpers/url/getUrlParts/getUrlParts.d.ts +0 -1
- package/dist/src/utils/helpers/url/getUrlParts/getUrlParts.js +0 -12
- package/dist/src/utils/helpers/url/removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes.d.ts +0 -1
- package/dist/src/utils/helpers/url/removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes.js +0 -11
- package/dist/src/utils/validate/isOnlyRequestedDataResolvingPropertyExists.d.ts +0 -4
- package/dist/src/utils/validate/isOnlyRequestedDataResolvingPropertyExists.js +0 -16
- package/dist/src/utils/validate/validateApiMockServerConfig.d.ts +0 -2
- package/dist/src/utils/validate/validateApiMockServerConfig.js +0 -48
package/README.md
CHANGED
|
@@ -41,17 +41,17 @@ Create a `mock-server.config.js` file with server configuration
|
|
|
41
41
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
42
42
|
const flatMockServerConfig = [
|
|
43
43
|
{
|
|
44
|
-
baseUrl:
|
|
44
|
+
baseUrl: "/api",
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
configs: [
|
|
48
48
|
{
|
|
49
|
-
path:
|
|
50
|
-
method:
|
|
51
|
-
routes: [{ data: { emoji:
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
49
|
+
path: "/user",
|
|
50
|
+
method: "get",
|
|
51
|
+
routes: [{ data: { emoji: "🦁", name: "Nursultan" } }],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
55
|
];
|
|
56
56
|
|
|
57
57
|
export default flatMockServerConfig;
|
|
@@ -99,7 +99,7 @@ Every route must be configured to handle response content in one of three ways:
|
|
|
99
99
|
- `data?` `any` mock data of request
|
|
100
100
|
- `queue?` `Array<{ time?: number; data: any}>` queue for polling with opportunity to set time for each response
|
|
101
101
|
- `file?` `string` path to file for return in response
|
|
102
|
-
- `settings?` `Settings` settings for route (
|
|
102
|
+
- `settings?` `Settings` settings for route (status, delay)
|
|
103
103
|
- `entities?` `Object<headers | cookies | query | params | body>` object that helps in data retrieval
|
|
104
104
|
- `interceptors?` `Interceptors` functions to change request or response parameters, [read](#interceptors)
|
|
105
105
|
- `interceptors?` `Interceptors` functions to change request or response parameters, [read](#interceptors)
|
|
@@ -110,30 +110,30 @@ Every route must be configured to handle response content in one of three ways:
|
|
|
110
110
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
111
111
|
const flatMockServerConfig = [
|
|
112
112
|
{
|
|
113
|
-
baseUrl:
|
|
113
|
+
baseUrl: "/api",
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
configs: [
|
|
117
117
|
{
|
|
118
|
-
path:
|
|
119
|
-
method:
|
|
118
|
+
path: "/user",
|
|
119
|
+
method: "get",
|
|
120
120
|
routes: [
|
|
121
121
|
{
|
|
122
122
|
entities: {
|
|
123
|
-
headers: {
|
|
123
|
+
headers: { "name-header": "Nursultan" },
|
|
124
124
|
},
|
|
125
|
-
data: { emoji:
|
|
125
|
+
data: { emoji: "🦁", name: "Nursultan" },
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
entities: {
|
|
129
|
-
headers: {
|
|
129
|
+
headers: { "name-header": "Dmitriy" },
|
|
130
130
|
},
|
|
131
|
-
data: { emoji:
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
]
|
|
136
|
-
}
|
|
131
|
+
data: { emoji: "☄", name: "Dmitriy" },
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
137
|
];
|
|
138
138
|
|
|
139
139
|
export default flatMockServerConfig;
|
|
@@ -142,11 +142,11 @@ export default flatMockServerConfig;
|
|
|
142
142
|
Now you can make a request with an additional header and get the desired result
|
|
143
143
|
|
|
144
144
|
```javascript
|
|
145
|
-
fetch(
|
|
145
|
+
fetch("http://localhost:31299/api/user", {
|
|
146
146
|
headers: {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
147
|
+
"name-header": "Nursultan",
|
|
148
|
+
"Content-Type": "application/json",
|
|
149
|
+
},
|
|
150
150
|
})
|
|
151
151
|
.then((response) => response.json())
|
|
152
152
|
.then((data) => console.log(data)); // { emoji: '🦁', name: 'Nursultan' }
|
|
@@ -175,30 +175,30 @@ Every route must be configured to handle response content in one of two ways: da
|
|
|
175
175
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
176
176
|
const flatMockServerConfig = [
|
|
177
177
|
{
|
|
178
|
-
baseUrl:
|
|
178
|
+
baseUrl: "/graphql",
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
181
|
configs: [
|
|
182
182
|
{
|
|
183
|
-
operationType:
|
|
184
|
-
operationName:
|
|
183
|
+
operationType: "query",
|
|
184
|
+
operationName: "GetUser",
|
|
185
185
|
routes: [
|
|
186
186
|
{
|
|
187
187
|
entities: {
|
|
188
|
-
headers: {
|
|
188
|
+
headers: { "name-header": "Nursultan" },
|
|
189
189
|
},
|
|
190
|
-
data: { emoji:
|
|
190
|
+
data: { emoji: "🦁", name: "Nursultan" },
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
entities: {
|
|
194
|
-
headers: {
|
|
194
|
+
headers: { "name-header": "Dmitriy" },
|
|
195
195
|
},
|
|
196
|
-
data: { emoji:
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
|
-
]
|
|
201
|
-
}
|
|
196
|
+
data: { emoji: "☄", name: "Dmitriy" },
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
202
|
];
|
|
203
203
|
|
|
204
204
|
export default flatMockServerConfig;
|
|
@@ -208,16 +208,16 @@ Now you can make a request with an additional header and get the desired result
|
|
|
208
208
|
|
|
209
209
|
```javascript
|
|
210
210
|
const body = JSON.stringify({
|
|
211
|
-
query:
|
|
211
|
+
query: "query GetUser { name }",
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
-
fetch(
|
|
215
|
-
method:
|
|
214
|
+
fetch("http://localhost:31299/graphql", {
|
|
215
|
+
method: "POST",
|
|
216
216
|
headers: {
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
"name-header": "Nursultan",
|
|
218
|
+
"Content-Type": "application/json",
|
|
219
219
|
},
|
|
220
|
-
body
|
|
220
|
+
body,
|
|
221
221
|
})
|
|
222
222
|
.then((response) => response.json())
|
|
223
223
|
.then((data) => console.log(data)); // { emoji: '🦁', name: 'Nursultan' }
|
|
@@ -247,44 +247,44 @@ Allowed `checkModes`
|
|
|
247
247
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
248
248
|
const flatMockServerConfig = [
|
|
249
249
|
{
|
|
250
|
-
baseUrl:
|
|
250
|
+
baseUrl: "/api",
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
253
|
configs: [
|
|
254
254
|
{
|
|
255
|
-
path:
|
|
256
|
-
method:
|
|
255
|
+
path: "/user",
|
|
256
|
+
method: "get",
|
|
257
257
|
routes: [
|
|
258
258
|
{
|
|
259
259
|
entities: {
|
|
260
260
|
headers: {
|
|
261
261
|
// 'name-header' is 'Dmitriy'
|
|
262
|
-
|
|
263
|
-
checkMode:
|
|
264
|
-
value:
|
|
262
|
+
"name-header": {
|
|
263
|
+
checkMode: "equals",
|
|
264
|
+
value: "Dmitriy",
|
|
265
265
|
},
|
|
266
266
|
// check for 'equals' if descriptor not provided
|
|
267
267
|
// i.e. it is the same as `role: { checkMode: 'equals', value: 'developer' }`
|
|
268
|
-
role:
|
|
268
|
+
role: "developer",
|
|
269
269
|
},
|
|
270
270
|
cookies: {
|
|
271
271
|
// any 'token' cookie
|
|
272
272
|
token: {
|
|
273
|
-
checkMode:
|
|
273
|
+
checkMode: "exists",
|
|
274
274
|
},
|
|
275
275
|
// 'someSecretToken' cookie can be '123-abc' or '456-abc' for example
|
|
276
276
|
someSecretToken: {
|
|
277
|
-
checkMode:
|
|
278
|
-
value: /^\d\d\d-abc
|
|
279
|
-
}
|
|
280
|
-
}
|
|
277
|
+
checkMode: "regExp",
|
|
278
|
+
value: /^\d\d\d-abc$/,
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
281
|
},
|
|
282
|
-
data:
|
|
283
|
-
}
|
|
284
|
-
]
|
|
285
|
-
}
|
|
286
|
-
]
|
|
287
|
-
}
|
|
282
|
+
data: "Some user data for Dmitriy",
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
288
|
];
|
|
289
289
|
|
|
290
290
|
export default flatMockServerConfig;
|
|
@@ -300,40 +300,40 @@ To be able to use this functionality you need to explicitly set `oneOf: true` pr
|
|
|
300
300
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
301
301
|
const flatMockServerConfig = [
|
|
302
302
|
{
|
|
303
|
-
baseUrl:
|
|
303
|
+
baseUrl: "/api",
|
|
304
304
|
},
|
|
305
305
|
{
|
|
306
306
|
configs: [
|
|
307
307
|
{
|
|
308
|
-
path:
|
|
309
|
-
method:
|
|
308
|
+
path: "/user",
|
|
309
|
+
method: "post",
|
|
310
310
|
routes: [
|
|
311
311
|
{
|
|
312
312
|
entities: {
|
|
313
313
|
// if body equals to { key1: 'value1' } OR { key2: 'value2' } then mock-config-server return 'Some user data 1'
|
|
314
314
|
body: {
|
|
315
|
-
checkMode:
|
|
316
|
-
value: [{ key1:
|
|
317
|
-
oneOf: true
|
|
318
|
-
}
|
|
315
|
+
checkMode: "equals",
|
|
316
|
+
value: [{ key1: "value1" }, { key2: "value2" }],
|
|
317
|
+
oneOf: true,
|
|
318
|
+
},
|
|
319
319
|
},
|
|
320
|
-
data:
|
|
320
|
+
data: "Some user data 1",
|
|
321
321
|
},
|
|
322
322
|
{
|
|
323
323
|
entities: {
|
|
324
324
|
// if body equals to [{ key1: 'value1' }, { key2: 'value2' }] then mock-config-server return 'Some user data 2'
|
|
325
325
|
// NO `oneOf` => array processed entirely
|
|
326
326
|
body: {
|
|
327
|
-
checkMode:
|
|
328
|
-
value: [{ key1:
|
|
329
|
-
}
|
|
327
|
+
checkMode: "equals",
|
|
328
|
+
value: [{ key1: "value1" }, { key2: "value2" }],
|
|
329
|
+
},
|
|
330
330
|
},
|
|
331
|
-
data:
|
|
332
|
-
}
|
|
333
|
-
]
|
|
334
|
-
}
|
|
335
|
-
]
|
|
336
|
-
}
|
|
331
|
+
data: "Some user data 2",
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
337
|
];
|
|
338
338
|
|
|
339
339
|
export default flatMockServerConfig;
|
|
@@ -353,37 +353,38 @@ You can use the `checkFunction` from second argument if you want to describe you
|
|
|
353
353
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
354
354
|
const flatMockServerConfig = [
|
|
355
355
|
{
|
|
356
|
-
baseUrl:
|
|
356
|
+
baseUrl: "/api",
|
|
357
357
|
},
|
|
358
358
|
{
|
|
359
359
|
configs: [
|
|
360
360
|
{
|
|
361
|
-
path:
|
|
362
|
-
method:
|
|
361
|
+
path: "/posts/:postId",
|
|
362
|
+
method: "post",
|
|
363
363
|
routes: [
|
|
364
364
|
{
|
|
365
365
|
entities: {
|
|
366
366
|
params: {
|
|
367
367
|
postId: {
|
|
368
|
-
checkMode:
|
|
369
|
-
value: (actualValue) =>
|
|
368
|
+
checkMode: "function",
|
|
369
|
+
value: (actualValue) =>
|
|
370
|
+
+actualValue >= 0 && +actualValue <= 50,
|
|
370
371
|
},
|
|
371
372
|
},
|
|
372
373
|
cookies: {
|
|
373
374
|
authToken: {
|
|
374
|
-
checkMode:
|
|
375
|
+
checkMode: "function",
|
|
375
376
|
value: (actualValue, checkFunction) =>
|
|
376
|
-
checkFunction(
|
|
377
|
-
checkFunction(
|
|
378
|
-
}
|
|
379
|
-
}
|
|
377
|
+
checkFunction("equals", actualValue, 123) ||
|
|
378
|
+
checkFunction("startsWith", actualValue, 2),
|
|
379
|
+
},
|
|
380
|
+
},
|
|
380
381
|
},
|
|
381
|
-
data:
|
|
382
|
-
}
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
]
|
|
386
|
-
}
|
|
382
|
+
data: "Some user data",
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
],
|
|
387
|
+
},
|
|
387
388
|
];
|
|
388
389
|
|
|
389
390
|
module.exports = flatMockServerConfig;
|
|
@@ -397,30 +398,30 @@ If you want to check a deep nested property of your body or variables via descri
|
|
|
397
398
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
398
399
|
const flatMockServerConfig = [
|
|
399
400
|
{
|
|
400
|
-
baseUrl:
|
|
401
|
+
baseUrl: "/api",
|
|
401
402
|
},
|
|
402
403
|
{
|
|
403
404
|
configs: [
|
|
404
405
|
{
|
|
405
|
-
path:
|
|
406
|
-
method:
|
|
406
|
+
path: "/users",
|
|
407
|
+
method: "post",
|
|
407
408
|
routes: [
|
|
408
409
|
{
|
|
409
410
|
entities: {
|
|
410
411
|
body: {
|
|
411
412
|
// if body has properties like { user: { name: 'Sergey' } } OR { 'user.name': 'Sergey' } then mock-config-server return data
|
|
412
|
-
|
|
413
|
-
checkMode:
|
|
414
|
-
value:
|
|
415
|
-
}
|
|
416
|
-
}
|
|
413
|
+
"user.name": {
|
|
414
|
+
checkMode: "equals",
|
|
415
|
+
value: "Sergey",
|
|
416
|
+
},
|
|
417
|
+
},
|
|
417
418
|
},
|
|
418
|
-
data: 'user.name in body is "Sergey"'
|
|
419
|
-
}
|
|
420
|
-
]
|
|
421
|
-
}
|
|
422
|
-
]
|
|
423
|
-
}
|
|
419
|
+
data: 'user.name in body is "Sergey"',
|
|
420
|
+
},
|
|
421
|
+
],
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
},
|
|
424
425
|
];
|
|
425
426
|
|
|
426
427
|
export default flatMockServerConfig;
|
|
@@ -434,34 +435,34 @@ You can also use descriptor for whole body or variables entity.
|
|
|
434
435
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
435
436
|
const flatMockServerConfig = [
|
|
436
437
|
{
|
|
437
|
-
baseUrl:
|
|
438
|
+
baseUrl: "/api",
|
|
438
439
|
},
|
|
439
440
|
{
|
|
440
441
|
configs: [
|
|
441
442
|
{
|
|
442
|
-
path:
|
|
443
|
-
method:
|
|
443
|
+
path: "/users",
|
|
444
|
+
method: "post",
|
|
444
445
|
routes: [
|
|
445
446
|
{
|
|
446
447
|
entities: {
|
|
447
448
|
body: {
|
|
448
449
|
// if actual body contains some extra property(-ies) then this entity won't match
|
|
449
|
-
checkMode:
|
|
450
|
+
checkMode: "equals",
|
|
450
451
|
value: {
|
|
451
452
|
user: {
|
|
452
|
-
name:
|
|
453
|
-
emoji:
|
|
454
|
-
roles: [
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
453
|
+
name: "Sergey",
|
|
454
|
+
emoji: "🐘",
|
|
455
|
+
roles: ["developer", "moderator"],
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
},
|
|
458
459
|
},
|
|
459
|
-
data:
|
|
460
|
-
}
|
|
461
|
-
]
|
|
462
|
-
}
|
|
463
|
-
]
|
|
464
|
-
}
|
|
460
|
+
data: "your body is strictly equals object from body entity value",
|
|
461
|
+
},
|
|
462
|
+
],
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
},
|
|
465
466
|
];
|
|
466
467
|
|
|
467
468
|
export default flatMockServerConfig;
|
|
@@ -475,21 +476,21 @@ Rest routes support paths to files. If a route is matched, the server will send
|
|
|
475
476
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
476
477
|
const flatMockServerConfig = [
|
|
477
478
|
{
|
|
478
|
-
baseUrl:
|
|
479
|
+
baseUrl: "/api",
|
|
479
480
|
},
|
|
480
481
|
{
|
|
481
482
|
configs: [
|
|
482
483
|
{
|
|
483
|
-
path:
|
|
484
|
-
method:
|
|
484
|
+
path: "/files/settings",
|
|
485
|
+
method: "get",
|
|
485
486
|
routes: [
|
|
486
487
|
{
|
|
487
|
-
file:
|
|
488
|
-
}
|
|
489
|
-
]
|
|
490
|
-
}
|
|
491
|
-
]
|
|
492
|
-
}
|
|
488
|
+
file: "./settings.json",
|
|
489
|
+
},
|
|
490
|
+
],
|
|
491
|
+
},
|
|
492
|
+
],
|
|
493
|
+
},
|
|
493
494
|
];
|
|
494
495
|
|
|
495
496
|
export default flatMockServerConfig;
|
|
@@ -497,55 +498,48 @@ export default flatMockServerConfig;
|
|
|
497
498
|
|
|
498
499
|
> If the file path is absolute, then this path will be used as is. If the file path is relative, it will be appended to the current working directory.
|
|
499
500
|
|
|
500
|
-
If the file exists, response interceptors will receive
|
|
501
|
-
|
|
502
|
-
`File descriptor` is an object with `path` and `file` fields that describe file location and file content.
|
|
503
|
-
|
|
504
|
-
- `path` `string` path to the file. Same as `file` passed in route
|
|
505
|
-
- `file` `Buffer` file content as binary buffer
|
|
501
|
+
If the file exists, response interceptors will receive file content `Buffer` as the `data` argument.
|
|
506
502
|
|
|
507
|
-
|
|
508
|
-
> If you return invalid file descriptor, server will send it as json data.
|
|
503
|
+
`Content-Type` and `Content-Disposition` headers are set before response interceptors are called.
|
|
509
504
|
|
|
510
505
|
```javascript
|
|
511
506
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
512
507
|
const flatMockServerConfig = [
|
|
513
508
|
{
|
|
514
|
-
baseUrl:
|
|
509
|
+
baseUrl: "/api",
|
|
515
510
|
},
|
|
516
511
|
{
|
|
517
512
|
configs: [
|
|
518
513
|
{
|
|
519
|
-
path:
|
|
520
|
-
method:
|
|
514
|
+
path: "/files/settings",
|
|
515
|
+
method: "get",
|
|
521
516
|
routes: [
|
|
522
517
|
{
|
|
523
|
-
file:
|
|
518
|
+
file: "./settings.json",
|
|
524
519
|
interceptors: {
|
|
525
|
-
response: (data) => {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
520
|
+
response: (data, { setHeader, getResponseHeader }) => {
|
|
521
|
+
// Content-Type and Content-Disposition are available before response interceptor runs.
|
|
522
|
+
console.log("Content-Type:", getResponseHeader("Content-Type"));
|
|
523
|
+
console.log("Content-Disposition:", getResponseHeader("Content-Disposition"));
|
|
524
|
+
|
|
525
|
+
const buffer = data;
|
|
526
|
+
const updatedBuffer = Buffer.from(buffer.toString("utf-8").replace("name", "title"));
|
|
527
|
+
return updatedBuffer;
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
],
|
|
532
|
+
},
|
|
533
|
+
],
|
|
534
|
+
},
|
|
537
535
|
];
|
|
538
536
|
|
|
539
537
|
export default flatMockServerConfig;
|
|
540
538
|
```
|
|
541
539
|
|
|
542
|
-
> Any changes to the data will not affect the file on disk unless you manually rewrite it.
|
|
543
|
-
|
|
544
|
-
> If you return a new `path` from interceptor, server will send file corresponding to this path or 404 error otherwise.
|
|
545
|
-
|
|
546
540
|
#### Polling
|
|
547
541
|
|
|
548
|
-
Routes support polling for data. To add polling for data,
|
|
542
|
+
Routes support polling for data. To add polling for data, use `queue` property instead of `data` or `file`.
|
|
549
543
|
|
|
550
544
|
`queue` is an array containing `data` or `file` that should be returned in order.
|
|
551
545
|
|
|
@@ -555,26 +549,25 @@ Routes support polling for data. To add polling for data, you must specify the `
|
|
|
555
549
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
556
550
|
const flatMockServerConfig = [
|
|
557
551
|
{
|
|
558
|
-
baseUrl:
|
|
552
|
+
baseUrl: "/api",
|
|
559
553
|
},
|
|
560
554
|
{
|
|
561
555
|
configs: [
|
|
562
556
|
{
|
|
563
|
-
path:
|
|
564
|
-
method:
|
|
557
|
+
path: "/user",
|
|
558
|
+
method: "get",
|
|
565
559
|
routes: [
|
|
566
560
|
{
|
|
567
|
-
settings: { polling: true },
|
|
568
561
|
queue: [
|
|
569
|
-
{ data: { emoji:
|
|
570
|
-
{ data: { emoji:
|
|
571
|
-
{ file:
|
|
572
|
-
]
|
|
573
|
-
}
|
|
574
|
-
]
|
|
575
|
-
}
|
|
576
|
-
]
|
|
577
|
-
}
|
|
562
|
+
{ data: { emoji: "🦁", name: "Nursultan" } },
|
|
563
|
+
{ data: { emoji: "☄", name: "Dmitriy" } },
|
|
564
|
+
{ file: "./users/Sergey.json" },
|
|
565
|
+
],
|
|
566
|
+
},
|
|
567
|
+
],
|
|
568
|
+
},
|
|
569
|
+
],
|
|
570
|
+
},
|
|
578
571
|
];
|
|
579
572
|
|
|
580
573
|
export default flatMockServerConfig;
|
|
@@ -586,25 +579,24 @@ Using the additional `time` properties in milliseconds, you can specify how much
|
|
|
586
579
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
587
580
|
const flatMockServerConfig = [
|
|
588
581
|
{
|
|
589
|
-
baseUrl:
|
|
582
|
+
baseUrl: "/api",
|
|
590
583
|
},
|
|
591
584
|
{
|
|
592
585
|
configs: [
|
|
593
586
|
{
|
|
594
|
-
path:
|
|
595
|
-
method:
|
|
587
|
+
path: "/user",
|
|
588
|
+
method: "get",
|
|
596
589
|
routes: [
|
|
597
590
|
{
|
|
598
|
-
settings: { polling: true },
|
|
599
591
|
queue: [
|
|
600
|
-
{ time: 5000, data: { emoji:
|
|
601
|
-
{ data: { emoji:
|
|
602
|
-
]
|
|
603
|
-
}
|
|
604
|
-
]
|
|
605
|
-
}
|
|
606
|
-
]
|
|
607
|
-
}
|
|
592
|
+
{ time: 5000, data: { emoji: "🦁", name: "Nursultan" } },
|
|
593
|
+
{ data: { emoji: "☄", name: "Dmitriy" } },
|
|
594
|
+
],
|
|
595
|
+
},
|
|
596
|
+
],
|
|
597
|
+
},
|
|
598
|
+
],
|
|
599
|
+
},
|
|
608
600
|
];
|
|
609
601
|
|
|
610
602
|
export default flatMockServerConfig;
|
|
@@ -718,13 +710,13 @@ You can log requests and responses using `log` function in any [interceptor](#in
|
|
|
718
710
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
719
711
|
const flatMockServerConfig = [
|
|
720
712
|
{
|
|
721
|
-
baseUrl:
|
|
713
|
+
baseUrl: "/api",
|
|
722
714
|
},
|
|
723
715
|
{
|
|
724
716
|
configs: [
|
|
725
717
|
{
|
|
726
|
-
path:
|
|
727
|
-
method:
|
|
718
|
+
path: "/posts",
|
|
719
|
+
method: "get",
|
|
728
720
|
routes: [
|
|
729
721
|
{
|
|
730
722
|
interceptors: {
|
|
@@ -737,8 +729,8 @@ const flatMockServerConfig = [
|
|
|
737
729
|
type: true, // type: 'request',
|
|
738
730
|
timestamp: true, // timestamp: '31.12.2024, 23:59:59,999',
|
|
739
731
|
method: true, // method: 'GET',
|
|
740
|
-
url: true // url: 'http://localhost:31299/api/rest/posts/1'
|
|
741
|
-
} // }
|
|
732
|
+
url: true, // url: 'http://localhost:31299/api/rest/posts/1'
|
|
733
|
+
}, // }
|
|
742
734
|
});
|
|
743
735
|
},
|
|
744
736
|
response: (data, { log }) => {
|
|
@@ -749,20 +741,20 @@ const flatMockServerConfig = [
|
|
|
749
741
|
type: true,
|
|
750
742
|
statusCode: true,
|
|
751
743
|
method: true,
|
|
752
|
-
url: true
|
|
744
|
+
url: true,
|
|
753
745
|
},
|
|
754
746
|
rewrite: ({ type, statusCode, method, url }) => {
|
|
755
747
|
console.info(`${type} ${method}: ${url} => ${statusCode}`);
|
|
756
|
-
}
|
|
748
|
+
},
|
|
757
749
|
});
|
|
758
750
|
return data;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
]
|
|
763
|
-
}
|
|
764
|
-
]
|
|
765
|
-
}
|
|
751
|
+
},
|
|
752
|
+
},
|
|
753
|
+
},
|
|
754
|
+
],
|
|
755
|
+
},
|
|
756
|
+
],
|
|
757
|
+
},
|
|
766
758
|
];
|
|
767
759
|
|
|
768
760
|
export default flatMockServerConfig;
|
|
@@ -807,13 +799,13 @@ In that case logger will use following logic:
|
|
|
807
799
|
/** @type {import('mock-config-server').FlatMockServerConfig} */
|
|
808
800
|
const flatMockServerConfig = [
|
|
809
801
|
{
|
|
810
|
-
baseUrl:
|
|
802
|
+
baseUrl: "/api",
|
|
811
803
|
},
|
|
812
804
|
{
|
|
813
805
|
configs: [
|
|
814
806
|
{
|
|
815
|
-
path:
|
|
816
|
-
method:
|
|
807
|
+
path: "/posts",
|
|
808
|
+
method: "get",
|
|
817
809
|
routes: [
|
|
818
810
|
{
|
|
819
811
|
interceptors: {
|
|
@@ -823,9 +815,9 @@ const flatMockServerConfig = [
|
|
|
823
815
|
options: {
|
|
824
816
|
query: {
|
|
825
817
|
query1: true,
|
|
826
|
-
query2: true
|
|
827
|
-
}
|
|
828
|
-
}
|
|
818
|
+
query2: true,
|
|
819
|
+
},
|
|
820
|
+
},
|
|
829
821
|
});
|
|
830
822
|
log({
|
|
831
823
|
// whitelist. only cookie1 and cookie2 will be logged
|
|
@@ -833,26 +825,26 @@ const flatMockServerConfig = [
|
|
|
833
825
|
cookies: {
|
|
834
826
|
cookie1: true,
|
|
835
827
|
cookie2: true,
|
|
836
|
-
cookie3: false
|
|
837
|
-
}
|
|
838
|
-
}
|
|
828
|
+
cookie3: false,
|
|
829
|
+
},
|
|
830
|
+
},
|
|
839
831
|
});
|
|
840
832
|
log({
|
|
841
833
|
// blacklist. all headers will be logged except header1
|
|
842
834
|
options: {
|
|
843
835
|
headers: {
|
|
844
|
-
header1: false
|
|
845
|
-
}
|
|
846
|
-
}
|
|
836
|
+
header1: false,
|
|
837
|
+
},
|
|
838
|
+
},
|
|
847
839
|
});
|
|
848
|
-
}
|
|
840
|
+
},
|
|
849
841
|
},
|
|
850
|
-
data: {}
|
|
851
|
-
}
|
|
852
|
-
]
|
|
853
|
-
}
|
|
854
|
-
]
|
|
855
|
-
}
|
|
842
|
+
data: {},
|
|
843
|
+
},
|
|
844
|
+
],
|
|
845
|
+
},
|
|
846
|
+
],
|
|
847
|
+
},
|
|
856
848
|
];
|
|
857
849
|
|
|
858
850
|
export default flatMockServerConfig;
|
|
@@ -872,13 +864,13 @@ const flatMockServerConfig = [
|
|
|
872
864
|
{
|
|
873
865
|
database: {
|
|
874
866
|
data: {
|
|
875
|
-
users: [{ id: 1, name:
|
|
867
|
+
users: [{ id: 1, name: "John" }],
|
|
876
868
|
settings: {
|
|
877
|
-
blocked: false
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
}
|
|
869
|
+
blocked: false,
|
|
870
|
+
},
|
|
871
|
+
},
|
|
872
|
+
},
|
|
873
|
+
},
|
|
882
874
|
];
|
|
883
875
|
```
|
|
884
876
|
|
|
@@ -920,17 +912,17 @@ const flatMockServerConfig = [
|
|
|
920
912
|
{
|
|
921
913
|
database: {
|
|
922
914
|
data: {
|
|
923
|
-
users: [{ id: 1, name:
|
|
915
|
+
users: [{ id: 1, name: "John" }],
|
|
924
916
|
settings: {
|
|
925
|
-
blocked: false
|
|
926
|
-
}
|
|
917
|
+
blocked: false,
|
|
918
|
+
},
|
|
927
919
|
},
|
|
928
920
|
routes: {
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
}
|
|
921
|
+
"/api/users/:id": "/users/:id",
|
|
922
|
+
"/*/my-settings": "/settings",
|
|
923
|
+
},
|
|
924
|
+
},
|
|
925
|
+
},
|
|
934
926
|
];
|
|
935
927
|
```
|
|
936
928
|
|
|
@@ -1035,10 +1027,10 @@ GET /users?_q=siberia&_q=24
|
|
|
1035
1027
|
const flatMockServerConfig = [
|
|
1036
1028
|
{
|
|
1037
1029
|
database: {
|
|
1038
|
-
data:
|
|
1039
|
-
routes:
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1030
|
+
data: "./data.json",
|
|
1031
|
+
routes: "./routes.json",
|
|
1032
|
+
},
|
|
1033
|
+
},
|
|
1042
1034
|
];
|
|
1043
1035
|
```
|
|
1044
1036
|
|