|
| 1 | +/** |
| 2 | + * @oas [get] /admin/locales |
| 3 | + * operationId: GetLocales |
| 4 | + * summary: List Locales |
| 5 | + * description: Retrieve a list of locales. The locales can be filtered by fields such as `code`. The locales can also be sorted or paginated. |
| 6 | + * x-authenticated: true |
| 7 | + * parameters: |
| 8 | + * - name: q |
| 9 | + * in: query |
| 10 | + * description: Search query to filter locales by code or other fields. |
| 11 | + * required: false |
| 12 | + * schema: |
| 13 | + * type: string |
| 14 | + * title: q |
| 15 | + * description: Search query to filter locales by code or other fields. |
| 16 | + * - name: code |
| 17 | + * in: query |
| 18 | + * required: false |
| 19 | + * schema: |
| 20 | + * oneOf: |
| 21 | + * - type: string |
| 22 | + * title: code |
| 23 | + * description: Filter locales by a code. |
| 24 | + * - type: array |
| 25 | + * description: Filter locales by multiple codes. |
| 26 | + * items: |
| 27 | + * type: string |
| 28 | + * title: code |
| 29 | + * description: A locale code. |
| 30 | + * - name: limit |
| 31 | + * in: query |
| 32 | + * description: Limit the number of items returned in the list. |
| 33 | + * required: false |
| 34 | + * schema: |
| 35 | + * type: number |
| 36 | + * title: limit |
| 37 | + * description: Limit the number of items returned in the list. |
| 38 | + * externalDocs: |
| 39 | + * url: "#pagination" |
| 40 | + * - name: offset |
| 41 | + * in: query |
| 42 | + * description: The number of items to skip when retrieving a list. |
| 43 | + * required: false |
| 44 | + * schema: |
| 45 | + * type: number |
| 46 | + * title: offset |
| 47 | + * description: The number of items to skip when retrieving a list. |
| 48 | + * externalDocs: |
| 49 | + * url: "#pagination" |
| 50 | + * - name: order |
| 51 | + * in: query |
| 52 | + * 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 `-`. |
| 53 | + * required: false |
| 54 | + * schema: |
| 55 | + * type: string |
| 56 | + * title: order |
| 57 | + * 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 `-`. |
| 58 | + * externalDocs: |
| 59 | + * url: "#pagination" |
| 60 | + * - name: with_deleted |
| 61 | + * in: query |
| 62 | + * description: The locale's with deleted. |
| 63 | + * required: false |
| 64 | + * schema: |
| 65 | + * type: boolean |
| 66 | + * title: with_deleted |
| 67 | + * description: The locale's with deleted. |
| 68 | + * - name: fields |
| 69 | + * in: query |
| 70 | + * 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 |
| 71 | + * fields. Without prefix it will replace the entire default fields. |
| 72 | + * required: false |
| 73 | + * schema: |
| 74 | + * type: string |
| 75 | + * title: fields |
| 76 | + * 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 |
| 77 | + * fields. Without prefix it will replace the entire default fields. |
| 78 | + * externalDocs: |
| 79 | + * url: "#select-fields-and-relations" |
| 80 | + * - name: $and |
| 81 | + * in: query |
| 82 | + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. |
| 83 | + * required: false |
| 84 | + * schema: |
| 85 | + * type: array |
| 86 | + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. |
| 87 | + * items: |
| 88 | + * type: object |
| 89 | + * title: $and |
| 90 | + * - name: $or |
| 91 | + * in: query |
| 92 | + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. |
| 93 | + * required: false |
| 94 | + * schema: |
| 95 | + * type: array |
| 96 | + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. |
| 97 | + * items: |
| 98 | + * type: object |
| 99 | + * title: $or |
| 100 | + * security: |
| 101 | + * - api_token: [] |
| 102 | + * - cookie_auth: [] |
| 103 | + * - jwt_token: [] |
| 104 | + * x-codeSamples: |
| 105 | + * - lang: JavaScript |
| 106 | + * label: JS SDK |
| 107 | + * source: |- |
| 108 | + * import Medusa from "@medusajs/js-sdk" |
| 109 | + * |
| 110 | + * export const sdk = new Medusa({ |
| 111 | + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", |
| 112 | + * debug: import.meta.env.DEV, |
| 113 | + * auth: { |
| 114 | + * type: "session", |
| 115 | + * }, |
| 116 | + * }) |
| 117 | + * |
| 118 | + * sdk.admin.locale.list() |
| 119 | + * .then(({ locales, count, limit, offset }) => { |
| 120 | + * console.log(locales) |
| 121 | + * }) |
| 122 | + * - lang: Shell |
| 123 | + * label: cURL |
| 124 | + * source: |- |
| 125 | + * curl '{backend_url}/admin/locales' \ |
| 126 | + * -H 'Authorization: Bearer {access_token}' |
| 127 | + * tags: |
| 128 | + * - Locales |
| 129 | + * responses: |
| 130 | + * "200": |
| 131 | + * description: OK |
| 132 | + * content: |
| 133 | + * application/json: |
| 134 | + * schema: |
| 135 | + * $ref: "#/components/schemas/AdminLocaleListResponse" |
| 136 | + * "400": |
| 137 | + * $ref: "#/components/responses/400_error" |
| 138 | + * "401": |
| 139 | + * $ref: "#/components/responses/unauthorized" |
| 140 | + * "404": |
| 141 | + * $ref: "#/components/responses/not_found_error" |
| 142 | + * "409": |
| 143 | + * $ref: "#/components/responses/invalid_state_error" |
| 144 | + * "422": |
| 145 | + * $ref: "#/components/responses/invalid_request_error" |
| 146 | + * "500": |
| 147 | + * $ref: "#/components/responses/500_error" |
| 148 | + * x-since: 2.12.3 |
| 149 | + * x-featureFlag: translation |
| 150 | + * |
| 151 | +*/ |
| 152 | + |
0 commit comments