1 /**
2 * @oas [get] /admin/translations/statistics
3 * operationId: GetTranslationsStatistics
4 * summary: Retrieve Translation Statistics
5 * x-sidebar-summary: Get Statistics
6 * description: Get statistics on translations for specified locales and entity types. This includes overall translation progress for each entity type, and statistics for each locale within those entity types.
7 * x-authenticated: true
8 * parameters:
9 * - name: locales
10 * in: query
11 * description: The locale codes to retrieve translation statistics for. Locale codes are in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format.
12 * required: true
13 * schema:
14 * oneOf:
15 * - type: string
16 * title: locales
17 * description: A locale code to retrieve translation statistics for. Locale codes are in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format.
18 * - type: array
19 * description: Locale codes to retrieve translation statistics for.
20 * items:
21 * type: string
22 * title: locales
23 * description: A locale code in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format.
24 * - name: entity_types
25 * in: query
26 * description: The table names of entities to retrieve translation statistics for.
27 * required: true
28 * schema:
29 * oneOf:
30 * - type: string
31 * title: entity_types
32 * description: The table name of an entity type to retrieve translation statistics for.
33 * - type: array
34 * description: The table names of entity types to retrieve translation statistics for.
35 * items:
36 * type: string
37 * title: entity_types
38 * description: A table name.
39 * security:
40 * - api_token: []
41 * - cookie_auth: []
42 * - jwt_token: []
43 * x-codeSamples:
44 * - lang: JavaScript
45 * label: JS SDK
46 * source: |-
47 * import Medusa from "@medusajs/js-sdk"
48 *
49 * export const sdk = new Medusa({
50 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
51 * debug: import.meta.env.DEV,
52 * auth: {
53 * type: "session",
54 * },
55 * })
56 *
57 * sdk.admin.translation.statistics({
58 * entity_type: "product"
59 * })
60 * .then(({ statistics }) => {
61 * console.log(statistics)
62 * })
63 * - lang: Shell
64 * label: cURL
65 * source: |-
66 * curl '{backend_url}/admin/translations/statistics' \
67 * -H 'Authorization: Bearer {access_token}'
68 * tags:
69 * - Translations
70 * responses:
71 * "200":
72 * description: OK
73 * content:
74 * application/json:
75 * schema:
76 * $ref: "#/components/schemas/AdminTranslationStatisticsResponse"
77 * "400":
78 * $ref: "#/components/responses/400_error"
79 * "401":
80 * $ref: "#/components/responses/unauthorized"
81 * "404":
82 * $ref: "#/components/responses/not_found_error"
83 * "409":
84 * $ref: "#/components/responses/invalid_state_error"
85 * "422":
86 * $ref: "#/components/responses/invalid_request_error"
87 * "500":
88 * $ref: "#/components/responses/500_error"
89 * x-since: 2.12.3
90 * x-featureFlag: translation
91 *
92 */
93