@diplodoc/cli-tests 5.0.8 → 5.0.9

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