@diplodoc/cli-tests 5.0.8 → 5.0.10

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.
@@ -1,5 +1,332 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
+ exports[`Translate command > extract openapi spec files > filelist 1`] = `
4
+ "[
5
+ "openapi-spec.yaml.skl",
6
+ "openapi-spec.yaml.xliff",
7
+ "toc.yaml.skl",
8
+ "toc.yaml.xliff"
9
+ ]"
10
+ `;
11
+
12
+ exports[`Translate command > extract openapi spec files 1`] = `
13
+ "openapi: 3.0.1
14
+ info:
15
+ title: '%%%0%%%'
16
+ version: v0
17
+ servers:
18
+ - url: http://localhost:8080
19
+ description: '%%%1%%%'
20
+ paths:
21
+ /test:
22
+ get:
23
+ tags:
24
+ - test-controller
25
+ summary: '%%%2%%%'
26
+ description: '%%%3%%%'
27
+ operationId: getWithPayloadResponse
28
+ responses:
29
+ '200':
30
+ description: '%%%4%%%'
31
+ content:
32
+ application/json:
33
+ schema:
34
+ $ref: '#/components/schemas/RecurceTop'
35
+ components:
36
+ schemas:
37
+ RecurceTop:
38
+ type: object
39
+ properties:
40
+ A:
41
+ type: string
42
+ description: |
43
+ %%%5%%%
44
+ - %%%6%%%
45
+ - %%%7%%%
46
+ - %%%8%%%
47
+ RecurceMiddle:
48
+ type: object
49
+ properties:
50
+ B:
51
+ type: array
52
+ items:
53
+ $ref: '#/components/schemas/RecurceTop'
54
+ "
55
+ `;
56
+
57
+ exports[`Translate command > extract openapi spec files 2`] = `
58
+ "<?xml version="1.0" encoding="UTF-8"?>
59
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
60
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
61
+ <header>
62
+ <skeleton>
63
+ <external-file href="file.skl"></external-file>
64
+ </skeleton>
65
+ </header>
66
+ <body>
67
+ <trans-unit id="0">
68
+ <source xml:space="preserve">OpenAPI definition</source>
69
+ </trans-unit>
70
+ <trans-unit id="1">
71
+ <source xml:space="preserve">Generated server url</source>
72
+ </trans-unit>
73
+ <trans-unit id="2">
74
+ <source xml:space="preserve">Simple get operation. тест новой верстки 3</source>
75
+ </trans-unit>
76
+ <trans-unit id="3">
77
+ <source xml:space="preserve">Defines a simple get operation with no inputs and a complex</source>
78
+ </trans-unit>
79
+ <trans-unit id="4">
80
+ <source xml:space="preserve">200!!!!</source>
81
+ </trans-unit>
82
+ <trans-unit id="5">
83
+ <source xml:space="preserve">Статус загрузки:</source>
84
+ </trans-unit>
85
+ <trans-unit id="6">
86
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="\`" id="x-1"/>UPLOADED<x ctype="code_close" equiv-text="\`" id="x-2"/> — загрузка завершена.</source>
87
+ </trans-unit>
88
+ <trans-unit id="7">
89
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="\`" id="x-3"/>IN_PROGRESS<x ctype="code_close" equiv-text="\`" id="x-4"/> — загрузка находится в процессе обработки.</source>
90
+ </trans-unit>
91
+ <trans-unit id="8">
92
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="\`" id="x-5"/>PROCESSED<x ctype="code_close" equiv-text="\`" id="x-6"/> — загрузка успешно обработана.</source>
93
+ </trans-unit>
94
+ </body>
95
+ </file>
96
+ </xliff>"
97
+ `;
98
+
99
+ exports[`Translate command > extract openapi spec files 3`] = `
100
+ "items:
101
+ - name: '%%%0%%%'
102
+ include:
103
+ path: openapi
104
+ includers:
105
+ - name: openapi
106
+ input: openapi-spec.yaml
107
+ "
108
+ `;
109
+
110
+ exports[`Translate command > extract openapi spec files 4`] = `
111
+ "<?xml version="1.0" encoding="UTF-8"?>
112
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
113
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
114
+ <header>
115
+ <skeleton>
116
+ <external-file href="file.skl"></external-file>
117
+ </skeleton>
118
+ </header>
119
+ <body>
120
+ <trans-unit id="0">
121
+ <source xml:space="preserve">openapi</source>
122
+ </trans-unit>
123
+ </body>
124
+ </file>
125
+ </xliff>"
126
+ `;
127
+
128
+ exports[`Translate command > extract openapi spec files 5`] = `
129
+ "<div class="openapi">
130
+
131
+ # %%%0%%%
132
+
133
+ %%%1%%%
134
+
135
+ ## %%%2%%%
136
+
137
+ <div class="openapi__requests">
138
+
139
+ <div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-get);margin-bottom: 12px">
140
+
141
+ <div class="openapi__request">
142
+
143
+ %%%3%%% {.openapi__method}
144
+ \`\`\`text translate=no
145
+ http://localhost:8080/test
146
+ \`\`\`
147
+
148
+
149
+
150
+ </div>
151
+
152
+ %%%4%%%
153
+
154
+ </div>
155
+
156
+ </div>
157
+
158
+ ## %%%5%%%
159
+
160
+ <div class="openapi__response__code__200">
161
+
162
+ ## %%%6%%%
163
+
164
+ %%%7%%%
165
+
166
+ <div class="openapi-entity">
167
+
168
+ ### %%%8%%%
169
+
170
+ {% cut "%%%9%%%" %}
171
+
172
+
173
+ \`\`\`json translate=no
174
+ {
175
+ "A": "string"
176
+ }
177
+ \`\`\`
178
+
179
+
180
+ {% endcut %}
181
+
182
+
183
+ #|||
184
+ %%%10%%%
185
+ |
186
+ %%%11%%%
187
+ ||
188
+
189
+ ||
190
+ %%%12%%% {.openapi-table-parameter-name}
191
+ |
192
+ %%%13%%%
193
+ |||#
194
+
195
+ </div>
196
+
197
+ </div>
198
+ <!-- markdownlint-disable-file -->
199
+
200
+ </div>
201
+
202
+
203
+
204
+ [*Deprecated]: %%%14%%%"
205
+ `;
206
+
207
+ exports[`Translate command > extract openapi spec files 6`] = `
208
+ "<?xml version="1.0" encoding="UTF-8"?>
209
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
210
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
211
+ <header>
212
+ <skeleton>
213
+ <external-file href="file.skl"></external-file>
214
+ </skeleton>
215
+ </header>
216
+ <body>
217
+ <trans-unit id="0">
218
+ <source xml:space="preserve">Simple get operation. тест новой верстки 3</source>
219
+ </trans-unit>
220
+ <trans-unit id="1">
221
+ <source xml:space="preserve">Defines a simple get operation with no inputs and a complex</source>
222
+ </trans-unit>
223
+ <trans-unit id="2">
224
+ <source xml:space="preserve">Request</source>
225
+ </trans-unit>
226
+ <trans-unit id="3">
227
+ <source xml:space="preserve">GET</source>
228
+ </trans-unit>
229
+ <trans-unit id="4">
230
+ <source xml:space="preserve">Generated server url</source>
231
+ </trans-unit>
232
+ <trans-unit id="5">
233
+ <source xml:space="preserve">Responses</source>
234
+ </trans-unit>
235
+ <trans-unit id="6">
236
+ <source xml:space="preserve">200 OK</source>
237
+ </trans-unit>
238
+ <trans-unit id="7">
239
+ <source xml:space="preserve">200!!!!</source>
240
+ </trans-unit>
241
+ <trans-unit id="8">
242
+ <source xml:space="preserve">Body</source>
243
+ </trans-unit>
244
+ <trans-unit id="9">
245
+ <source xml:space="preserve">application/json</source>
246
+ </trans-unit>
247
+ <trans-unit id="10">
248
+ <source xml:space="preserve"><g ctype="bold" equiv-text="**{{text}}**" id="g-4" x-begin="**" x-end="**">Name</g></source>
249
+ </trans-unit>
250
+ <trans-unit id="11">
251
+ <source xml:space="preserve"><g ctype="bold" equiv-text="**{{text}}**" id="g-5" x-begin="**" x-end="**">Description</g></source>
252
+ </trans-unit>
253
+ <trans-unit id="12">
254
+ <source xml:space="preserve">A</source>
255
+ </trans-unit>
256
+ <trans-unit id="13">
257
+ <source xml:space="preserve"><g ctype="bold" equiv-text="**{{text}}**" id="g-6" x-begin="**" x-end="**">Type:</g> string</source>
258
+ </trans-unit>
259
+ <trans-unit id="14">
260
+ <source xml:space="preserve">No longer supported, please use an alternative and newer version.</source>
261
+ </trans-unit>
262
+ </body>
263
+ </file>
264
+ </xliff>"
265
+ `;
266
+
267
+ exports[`Translate command > extract openapi spec files 7`] = `
268
+ "# %%%0%%%
269
+
270
+ ## %%%1%%%
271
+
272
+ - %%%2%%%
273
+
274
+ <!-- markdownlint-disable-file -->"
275
+ `;
276
+
277
+ exports[`Translate command > extract openapi spec files 8`] = `
278
+ "<?xml version="1.0" encoding="UTF-8"?>
279
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
280
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
281
+ <header>
282
+ <skeleton>
283
+ <external-file href="file.skl"></external-file>
284
+ </skeleton>
285
+ </header>
286
+ <body>
287
+ <trans-unit id="0">
288
+ <source xml:space="preserve">test-controller</source>
289
+ </trans-unit>
290
+ <trans-unit id="1">
291
+ <source xml:space="preserve">Endpoints</source>
292
+ </trans-unit>
293
+ <trans-unit id="2">
294
+ <source xml:space="preserve"><g ctype="link" equiv-text="[{{text}}](getWithPayloadResponse.md)" id="g-3" x-begin="[" x-end="](getWithPayloadResponse.md)">Simple get operation. тест новой верстки 3</g></source>
295
+ </trans-unit>
296
+ </body>
297
+ </file>
298
+ </xliff>"
299
+ `;
300
+
301
+ exports[`Translate command > extract openapi spec files 9`] = `
302
+ "items:
303
+ - name: '%%%0%%%'
304
+ include:
305
+ path: openapi
306
+ includers:
307
+ - name: openapi
308
+ input: openapi-spec.yaml
309
+ "
310
+ `;
311
+
312
+ exports[`Translate command > extract openapi spec files 10`] = `
313
+ "<?xml version="1.0" encoding="UTF-8"?>
314
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
315
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
316
+ <header>
317
+ <skeleton>
318
+ <external-file href="file.skl"></external-file>
319
+ </skeleton>
320
+ </header>
321
+ <body>
322
+ <trans-unit id="0">
323
+ <source xml:space="preserve">openapi</source>
324
+ </trans-unit>
325
+ </body>
326
+ </file>
327
+ </xliff>"
328
+ `;
329
+
3
330
  exports[`Translate command > extract yaml scheme files > en/index.yaml.skl 1`] = `
4
331
  "blocks:
5
332
  - type: content-layout-block
@@ -30,6 +30,12 @@ const generateFilesYamlTestTemplate = (
30
30
  };
31
31
 
32
32
  describe('Translate command', () => {
33
+ generateFilesYamlTestTemplate('extract openapi spec files', 'mocks/translation/openapi', {
34
+ subcommand: 'extract',
35
+ source: 'ru-RU',
36
+ target: 'es-ES',
37
+ });
38
+
33
39
  generateMapTestTemplate('filter files on extract', 'mocks/translation/dir-files', {
34
40
  subcommand: 'extract',
35
41
  source: 'ru-RU',
@@ -0,0 +1,42 @@
1
+ openapi: 3.0.1
2
+ info:
3
+ title: OpenAPI definition
4
+ version: v0
5
+ servers:
6
+ - url: http://localhost:8080
7
+ description: Generated server url
8
+ paths:
9
+ /test:
10
+ get:
11
+ tags:
12
+ - test-controller
13
+ summary: Simple get operation. тест новой верстки 3
14
+ description: Defines a simple get operation with no inputs and a complex
15
+ operationId: getWithPayloadResponse
16
+ responses:
17
+ "200":
18
+ description: 200!!!!
19
+ content:
20
+ application/json:
21
+ schema:
22
+ $ref: '#/components/schemas/RecurceTop'
23
+ components:
24
+ schemas:
25
+ RecurceTop:
26
+ type: object
27
+ properties:
28
+ A:
29
+ type: string
30
+ description: |
31
+ Статус загрузки:
32
+ - `UPLOADED` — загрузка завершена.
33
+ - `IN_PROGRESS` — загрузка находится в процессе обработки.
34
+ - `PROCESSED` — загрузка успешно обработана.
35
+ # $ref: '#/components/schemas/RecurceMiddle'
36
+ RecurceMiddle:
37
+ type: object
38
+ properties:
39
+ B:
40
+ type: array
41
+ items:
42
+ $ref: '#/components/schemas/RecurceTop'
@@ -0,0 +1,8 @@
1
+ items:
2
+ - name: openapi
3
+ include:
4
+ path: openapi
5
+ includers:
6
+ - name: openapi
7
+ input: openapi-spec.yaml
8
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.0.8",
3
+ "version": "5.0.10",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },