|
1
|
/** |
|
2
|
* @oas [get] /admin/translations |
|
3
|
* operationId: GetTranslations |
|
4
|
* summary: List Translations |
|
5
|
* description: Retrieve a list of translations. The translations can be filtered by fields such as `reference_id` (For example, the ID of a product). The translations can also be sorted or paginated. |
|
6
|
* x-authenticated: true |
|
7
|
* parameters: |
|
8
|
* - name: q |
|
9
|
* in: query |
|
10
|
* description: Search query to filter translations by their fields. |
|
11
|
* required: false |
|
12
|
* schema: |
|
13
|
* type: string |
|
14
|
* title: q |
|
15
|
* description: Search query to filter translations by their fields. |
|
16
|
* - name: reference_id |
|
17
|
* in: query |
|
18
|
* required: false |
|
19
|
* schema: |
|
20
|
* oneOf: |
|
21
|
* - type: string |
|
22
|
* title: reference_id |
|
23
|
* description: Filter translations by a reference ID. For example, the ID of a product. |
|
24
|
* example: prod_123 |
|
25
|
* - type: array |
|
26
|
* description: Filter translations by multiple reference IDs. For example, the IDs of products. |
|
27
|
* items: |
|
28
|
* type: string |
|
29
|
* title: reference_id |
|
30
|
* description: The reference ID's details. For example, the ID of a product. |
|
31
|
* example: prod_123 |
|
32
|
* - name: reference |
|
33
|
* in: query |
|
34
|
* description: Filter translations by the resource they belong to. For example, `product` or `product_variant`. |
|
35
|
* required: false |
|
36
|
* schema: |
|
37
|
* type: string |
|
38
|
* title: reference |
|
39
|
* description: Filter translations by the resource they belong to. For example, `product` or `product_variant`. |
|
40
|
* - name: locale_code |
|
41
|
* in: query |
|
42
|
* required: false |
|
43
|
* schema: |
|
44
|
* oneOf: |
|
45
|
* - type: string |
|
46
|
* title: locale_code |
|
47
|
* description: Filter translations by a locale code in BCP 47 format. |
|
48
|
* example: fr-FR |
|
49
|
* - type: array |
|
50
|
* description: Filter translations by multiple locale codes in BCP 47 format. |
|
51
|
* items: |
|
52
|
* type: string |
|
53
|
* title: locale_code |
|
54
|
* description: A locale code in BCP 47 format. |
|
55
|
* example: fr-FR |
|
56
|
* - name: limit |
|
57
|
* in: query |
|
58
|
* description: Limit the number of items returned in the list. |
|
59
|
* required: false |
|
60
|
* schema: |
|
61
|
* type: number |
|
62
|
* title: limit |
|
63
|
* description: Limit the number of items returned in the list. |
|
64
|
* externalDocs: |
|
65
|
* url: "#pagination" |
|
66
|
* - name: offset |
|
67
|
* in: query |
|
68
|
* description: The number of items to skip when retrieving a list. |
|
69
|
* required: false |
|
70
|
* schema: |
|
71
|
* type: number |
|
72
|
* title: offset |
|
73
|
* description: The number of items to skip when retrieving a list. |
|
74
|
* externalDocs: |
|
75
|
* url: "#pagination" |
|
76
|
* - name: order |
|
77
|
* in: query |
|
78
|
* description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. |
|
79
|
* required: false |
|
80
|
* schema: |
|
81
|
* type: string |
|
82
|
* title: order |
|
83
|
* description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. |
|
84
|
* externalDocs: |
|
85
|
* url: "#pagination" |
|
86
|
* - name: with_deleted |
|
87
|
* in: query |
|
88
|
* description: The translation's with deleted. |
|
89
|
* required: false |
|
90
|
* schema: |
|
91
|
* type: boolean |
|
92
|
* title: with_deleted |
|
93
|
* description: The translation's with deleted. |
|
94
|
* - name: fields |
|
95
|
* in: query |
|
96
|
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default |
|
97
|
* fields. Without prefix it will replace the entire default fields. |
|
98
|
* required: false |
|
99
|
* schema: |
|
100
|
* type: string |
|
101
|
* title: fields |
|
102
|
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default |
|
103
|
* fields. Without prefix it will replace the entire default fields. |
|
104
|
* externalDocs: |
|
105
|
* url: "#select-fields-and-relations" |
|
106
|
* - name: $and |
|
107
|
* in: query |
|
108
|
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. |
|
109
|
* required: false |
|
110
|
* schema: |
|
111
|
* type: array |
|
112
|
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. |
|
113
|
* items: |
|
114
|
* type: object |
|
115
|
* title: $and |
|
116
|
* - name: $or |
|
117
|
* in: query |
|
118
|
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. |
|
119
|
* required: false |
|
120
|
* schema: |
|
121
|
* type: array |
|
122
|
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. |
|
123
|
* items: |
|
124
|
* type: object |
|
125
|
* title: $or |
|
126
|
* security: |
|
127
|
* - api_token: [] |
|
128
|
* - cookie_auth: [] |
|
129
|
* - jwt_token: [] |
|
130
|
* x-codeSamples: |
|
131
|
* - lang: JavaScript |
|
132
|
* label: JS SDK |
|
133
|
* source: |- |
|
134
|
* import Medusa from "@medusajs/js-sdk" |
|
135
|
* |
|
136
|
* export const sdk = new Medusa({ |
|
137
|
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/", |
|
138
|
* debug: import.meta.env.DEV, |
|
139
|
* auth: { |
|
140
|
* type: "session", |
|
141
|
* }, |
|
142
|
* }) |
|
143
|
* |
|
144
|
* sdk.admin.translation.list() |
|
145
|
* .then(({ translations, count, limit, offset }) => { |
|
146
|
* console.log(translations) |
|
147
|
* }) |
|
148
|
* - lang: Shell |
|
149
|
* label: cURL |
|
150
|
* source: |- |
|
151
|
* curl '{backend_url}/admin/translations' \ |
|
152
|
* -H 'Authorization: Bearer {access_token}' |
|
153
|
* tags: |
|
154
|
* - Translations |
|
155
|
* responses: |
|
156
|
* "200": |
|
157
|
* description: OK |
|
158
|
* content: |
|
159
|
* application/json: |
|
160
|
* schema: |
|
161
|
* allOf: |
|
162
|
* - type: object |
|
163
|
* description: The list of translations with pagination. |
|
164
|
* required: |
|
165
|
* - limit |
|
166
|
* - offset |
|
167
|
* - count |
|
168
|
* properties: |
|
169
|
* limit: |
|
170
|
* type: number |
|
171
|
* title: limit |
|
172
|
* description: The maximum number of translations returned. |
|
173
|
* offset: |
|
174
|
* type: number |
|
175
|
* title: offset |
|
176
|
* description: The number of translations skipped before retrieving the returned translations. |
|
177
|
* count: |
|
178
|
* type: number |
|
179
|
* title: count |
|
180
|
* description: The total number of translations matching the query. |
|
181
|
* estimate_count: |
|
182
|
* type: number |
|
183
|
* title: estimate_count |
|
184
|
* description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. |
|
185
|
* x-featureFlag: index_engine |
|
186
|
* - type: object |
|
187
|
* description: SUMMARY |
|
188
|
* required: |
|
189
|
* - translations |
|
190
|
* properties: |
|
191
|
* translations: |
|
192
|
* type: array |
|
193
|
* description: The list of translations. |
|
194
|
* items: |
|
195
|
* $ref: "#/components/schemas/AdminTranslation" |
|
196
|
* "400": |
|
197
|
* $ref: "#/components/responses/400_error" |
|
198
|
* "401": |
|
199
|
* $ref: "#/components/responses/unauthorized" |
|
200
|
* "404": |
|
201
|
* $ref: "#/components/responses/not_found_error" |
|
202
|
* "409": |
|
203
|
* $ref: "#/components/responses/invalid_state_error" |
|
204
|
* "422": |
|
205
|
* $ref: "#/components/responses/invalid_request_error" |
|
206
|
* "500": |
|
207
|
* $ref: "#/components/responses/500_error" |
|
208
|
* x-since: 2.12.3 |
|
209
|
* x-featureFlag: translation |
|
210
|
* |
|
211
|
*/ |
|
212
|
|