Skip to content

Commit c6e58e5

Browse files
authored
docs: fixes to API and JS SDK references (medusajs#13795)
1 parent 3d0f408 commit c6e58e5

File tree

15 files changed

+7188
-7423
lines changed

15 files changed

+7188
-7423
lines changed

www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const sdk = new Medusa({
99
})
1010

1111
sdk.admin.refundReason.create({
12-
value: "refund",
12+
code: "refund",
1313
label: "Refund",
1414
})
1515
.then(({ refund_reason }) => {

www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const sdk = new Medusa({
99
})
1010

1111
sdk.admin.refundReason.update("ret_123", {
12-
value: "refund",
12+
code: "refund",
1313
label: "Refund",
1414
})
1515
.then(({ refund_reason }) => {

www/apps/api-reference/specs/admin/code_samples/Shell/admin_refund-reasons/post.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ curl -X POST '{backend_url}/admin/refund-reasons' \
33
-H 'Content-Type: application/json' \
44
--data-raw '{
55
"label": "{value}",
6+
"code": "{value}",
67
"description": "{value}"
78
}'

www/apps/api-reference/specs/admin/openapi.full.yaml

Lines changed: 3 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -29213,44 +29213,6 @@ paths:
2921329213
type: boolean
2921429214
title: include_descendants_tree
2921529215
description: Whether to retrieve a list of child categories. If you enable this, add to the `fields` query parameter `category_children` to set the children of a category in this field. You can either pass `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, `fields=category_children.id,category_children.name`.
29216-
- name: offset
29217-
in: query
29218-
description: The number of items to skip when retrieving a list.
29219-
required: false
29220-
schema:
29221-
type: number
29222-
title: offset
29223-
description: The number of items to skip when retrieving a list.
29224-
externalDocs:
29225-
url: '#pagination'
29226-
- name: limit
29227-
in: query
29228-
description: Limit the number of items returned in the list.
29229-
required: false
29230-
schema:
29231-
type: number
29232-
title: limit
29233-
description: Limit the number of items returned in the list.
29234-
externalDocs:
29235-
url: '#pagination'
29236-
- name: order
29237-
in: query
29238-
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 `-`.
29239-
required: false
29240-
schema:
29241-
type: string
29242-
title: order
29243-
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 `-`.
29244-
externalDocs:
29245-
url: '#pagination'
29246-
- name: with_deleted
29247-
in: query
29248-
description: Whether to include deleted records in the result.
29249-
required: false
29250-
schema:
29251-
type: boolean
29252-
title: with_deleted
29253-
description: Whether to include deleted records in the result.
2925429216
security:
2925529217
- api_token: []
2925629218
- cookie_auth: []
@@ -29321,44 +29283,6 @@ paths:
2932129283
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 fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation.
2932229284
externalDocs:
2932329285
url: '#select-fields-and-relations'
29324-
- name: offset
29325-
in: query
29326-
description: The number of items to skip when retrieving a list.
29327-
required: false
29328-
schema:
29329-
type: number
29330-
title: offset
29331-
description: The number of items to skip when retrieving a list.
29332-
externalDocs:
29333-
url: '#pagination'
29334-
- name: limit
29335-
in: query
29336-
description: Limit the number of items returned in the list.
29337-
required: false
29338-
schema:
29339-
type: number
29340-
title: limit
29341-
description: Limit the number of items returned in the list.
29342-
externalDocs:
29343-
url: '#pagination'
29344-
- name: order
29345-
in: query
29346-
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 `-`.
29347-
required: false
29348-
schema:
29349-
type: string
29350-
title: order
29351-
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 `-`.
29352-
externalDocs:
29353-
url: '#pagination'
29354-
- name: with_deleted
29355-
in: query
29356-
description: Whether to include deleted records in the result.
29357-
required: false
29358-
schema:
29359-
type: boolean
29360-
title: with_deleted
29361-
description: Whether to include deleted records in the result.
2936229286
security:
2936329287
- api_token: []
2936429288
- cookie_auth: []
@@ -38236,7 +38160,7 @@ paths:
3823638160
})
3823738161

3823838162
sdk.admin.refundReason.create({
38239-
value: "refund",
38163+
code: "refund",
3824038164
label: "Refund",
3824138165
})
3824238166
.then(({ refund_reason }) => {
@@ -38250,6 +38174,7 @@ paths:
3825038174
-H 'Content-Type: application/json' \
3825138175
--data-raw '{
3825238176
"label": "{value}",
38177+
"code": "{value}",
3825338178
"description": "{value}"
3825438179
}'
3825538180
tags:
@@ -38392,7 +38317,7 @@ paths:
3839238317
})
3839338318

3839438319
sdk.admin.refundReason.update("ret_123", {
38395-
value: "refund",
38320+
code: "refund",
3839638321
label: "Refund",
3839738322
})
3839838323
.then(({ refund_reason }) => {

www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -78,49 +78,6 @@ get:
7878
`*category_children` to retreieve the fields of all child categories,
7979
or select specific fields to make the response size smaller. For
8080
example, `fields=category_children.id,category_children.name`.
81-
- name: offset
82-
in: query
83-
description: The number of items to skip when retrieving a list.
84-
required: false
85-
schema:
86-
type: number
87-
title: offset
88-
description: The number of items to skip when retrieving a list.
89-
externalDocs:
90-
url: '#pagination'
91-
- name: limit
92-
in: query
93-
description: Limit the number of items returned in the list.
94-
required: false
95-
schema:
96-
type: number
97-
title: limit
98-
description: Limit the number of items returned in the list.
99-
externalDocs:
100-
url: '#pagination'
101-
- name: order
102-
in: query
103-
description: >-
104-
The field to sort the data by. By default, the sort order is ascending.
105-
To change the order to descending, prefix the field name with `-`.
106-
required: false
107-
schema:
108-
type: string
109-
title: order
110-
description: >-
111-
The field to sort the data by. By default, the sort order is
112-
ascending. To change the order to descending, prefix the field name
113-
with `-`.
114-
externalDocs:
115-
url: '#pagination'
116-
- name: with_deleted
117-
in: query
118-
description: Whether to include deleted records in the result.
119-
required: false
120-
schema:
121-
type: boolean
122-
title: with_deleted
123-
description: Whether to include deleted records in the result.
12481
security:
12582
- api_token: []
12683
- cookie_auth: []
@@ -193,49 +150,6 @@ post:
193150
documentation.
194151
externalDocs:
195152
url: '#select-fields-and-relations'
196-
- name: offset
197-
in: query
198-
description: The number of items to skip when retrieving a list.
199-
required: false
200-
schema:
201-
type: number
202-
title: offset
203-
description: The number of items to skip when retrieving a list.
204-
externalDocs:
205-
url: '#pagination'
206-
- name: limit
207-
in: query
208-
description: Limit the number of items returned in the list.
209-
required: false
210-
schema:
211-
type: number
212-
title: limit
213-
description: Limit the number of items returned in the list.
214-
externalDocs:
215-
url: '#pagination'
216-
- name: order
217-
in: query
218-
description: >-
219-
The field to sort the data by. By default, the sort order is ascending.
220-
To change the order to descending, prefix the field name with `-`.
221-
required: false
222-
schema:
223-
type: string
224-
title: order
225-
description: >-
226-
The field to sort the data by. By default, the sort order is
227-
ascending. To change the order to descending, prefix the field name
228-
with `-`.
229-
externalDocs:
230-
url: '#pagination'
231-
- name: with_deleted
232-
in: query
233-
description: Whether to include deleted records in the result.
234-
required: false
235-
schema:
236-
type: boolean
237-
title: with_deleted
238-
description: Whether to include deleted records in the result.
239153
security:
240154
- api_token: []
241155
- cookie_auth: []

www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.refundReason/page.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ To specify the fields and relations to retrieve:
9595

9696
```ts
9797
sdk.admin.refundReason.retrieve("refr_123", {
98-
fields: "id,value"
98+
fields: "id,code"
9999
})
100100
.then(({ refund_reason }) => {
101101
console.log(refund_reason)
@@ -130,7 +130,7 @@ This is available starting from [Medusa v2.11.0](https://github.com/medusajs/med
130130

131131
```ts
132132
sdk.admin.refundReason.create({
133-
value: "refund",
133+
code: "refund",
134134
label: "Refund",
135135
})
136136
.then(({ refund_reason }) => {
@@ -164,7 +164,7 @@ This is available starting from [Medusa v2.11.0](https://github.com/medusajs/med
164164

165165
```ts
166166
sdk.admin.refundReason.update("ret_123", {
167-
value: "refund",
167+
code: "refund",
168168
label: "Refund",
169169
})
170170
.then(({ refund_reason }) => {

www/apps/resources/references/js_sdk/admin/RefundReason/methods/js_sdk.admin.RefundReason.create/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This is available starting from [Medusa v2.11.0](https://github.com/medusajs/med
1616

1717
```ts
1818
sdk.admin.refundReason.create({
19-
value: "refund",
19+
code: "refund",
2020
label: "Refund",
2121
})
2222
.then(({ refund_reason }) => {

www/apps/resources/references/js_sdk/admin/RefundReason/methods/js_sdk.admin.RefundReason.retrieve/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To specify the fields and relations to retrieve:
2727

2828
```ts
2929
sdk.admin.refundReason.retrieve("refr_123", {
30-
fields: "id,value"
30+
fields: "id,code"
3131
})
3232
.then(({ refund_reason }) => {
3333
console.log(refund_reason)

www/apps/resources/references/js_sdk/admin/RefundReason/methods/js_sdk.admin.RefundReason.update/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This is available starting from [Medusa v2.11.0](https://github.com/medusajs/med
1616

1717
```ts
1818
sdk.admin.refundReason.update("ret_123", {
19-
value: "refund",
19+
code: "refund",
2020
label: "Refund",
2121
})
2222
.then(({ refund_reason }) => {

www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,6 @@
4747
* description: Whether to retrieve a list of child categories. If you enable this, add to the `fields` query parameter `category_children` to set the children of a category in this field. You can either
4848
* pass `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example,
4949
* `fields=category_children.id,category_children.name`.
50-
* - name: offset
51-
* in: query
52-
* description: The number of items to skip when retrieving a list.
53-
* required: false
54-
* schema:
55-
* type: number
56-
* title: offset
57-
* description: The number of items to skip when retrieving a list.
58-
* externalDocs:
59-
* url: "#pagination"
60-
* - name: limit
61-
* in: query
62-
* description: Limit the number of items returned in the list.
63-
* required: false
64-
* schema:
65-
* type: number
66-
* title: limit
67-
* description: Limit the number of items returned in the list.
68-
* externalDocs:
69-
* url: "#pagination"
70-
* - name: order
71-
* in: query
72-
* 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 `-`.
73-
* required: false
74-
* schema:
75-
* type: string
76-
* title: order
77-
* 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 `-`.
78-
* externalDocs:
79-
* url: "#pagination"
80-
* - name: with_deleted
81-
* in: query
82-
* description: Whether to include deleted records in the result.
83-
* required: false
84-
* schema:
85-
* type: boolean
86-
* title: with_deleted
87-
* description: Whether to include deleted records in the result.
8850
* security:
8951
* - api_token: []
9052
* - cookie_auth: []

0 commit comments

Comments
 (0)