docs: generate OAS manually for 2.7.0 (#12158)
* original changes * changes * fixes for delete operations * generate oas
This commit is contained in:
@@ -5,12 +5,31 @@
|
||||
* description: Delete Session
|
||||
* x-authenticated: false
|
||||
* x-codeSamples:
|
||||
* - lang: JavaScript
|
||||
* label: JS SDK
|
||||
* source: |-
|
||||
* import Medusa from "@medusajs/js-sdk"
|
||||
*
|
||||
* export const sdk = new Medusa({
|
||||
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
|
||||
* debug: import.meta.env.DEV,
|
||||
* auth: {
|
||||
* type: "session",
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* await sdk.auth.logout()
|
||||
*
|
||||
* // user is now logged out
|
||||
* // you can't send any requests that require authentication
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: curl -X DELETE '{backend_url}/auth/session'
|
||||
* tags:
|
||||
* - Session
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
+2
@@ -24,6 +24,8 @@
|
||||
* tags:
|
||||
* - "[actor_type]"
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
+29
@@ -18,12 +18,41 @@
|
||||
* schema:
|
||||
* type: string
|
||||
* x-codeSamples:
|
||||
* - lang: JavaScript
|
||||
* label: JS SDK
|
||||
* source: |-
|
||||
* import Medusa from "@medusajs/js-sdk"
|
||||
*
|
||||
* export const sdk = new Medusa({
|
||||
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
|
||||
* debug: import.meta.env.DEV,
|
||||
* auth: {
|
||||
* type: "session",
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* await sdk.auth.callback(
|
||||
* "customer",
|
||||
* "google",
|
||||
* {
|
||||
* code: "123",
|
||||
* state: "456"
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* // all subsequent requests will use the token in the header
|
||||
* const { customer } = await sdk.store.customer.create({
|
||||
* email: "customer@gmail.com",
|
||||
* password: "supersecret"
|
||||
* })
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: curl '{backend_url}/auth/{actor_type}/{auth_provider}/callback'
|
||||
* tags:
|
||||
* - "[actor_type]"
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
+34
@@ -18,12 +18,46 @@
|
||||
* schema:
|
||||
* type: string
|
||||
* x-codeSamples:
|
||||
* - lang: JavaScript
|
||||
* label: JS SDK
|
||||
* source: |-
|
||||
* import Medusa from "@medusajs/js-sdk"
|
||||
*
|
||||
* export const sdk = new Medusa({
|
||||
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
|
||||
* debug: import.meta.env.DEV,
|
||||
* auth: {
|
||||
* type: "session",
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* const result = await sdk.auth.login(
|
||||
* "customer",
|
||||
* "emailpass",
|
||||
* {
|
||||
* email: "customer@gmail.com",
|
||||
* password: "supersecret"
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* if (typeof result !== "string") {
|
||||
* alert("Authentication requires additional steps")
|
||||
* // replace with the redirect logic of your application
|
||||
* window.location.href = result.location
|
||||
* return
|
||||
* }
|
||||
*
|
||||
* // customer is now authenticated
|
||||
* // all subsequent requests will use the token in the header
|
||||
* const { customer } = await sdk.store.customer.retrieve()
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: curl -X POST '{backend_url}/auth/{actor_type}/{auth_provider}'
|
||||
* tags:
|
||||
* - "[actor_type]"
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
+2
@@ -24,6 +24,8 @@
|
||||
* tags:
|
||||
* - "[actor_type]"
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
+29
@@ -18,12 +18,41 @@
|
||||
* schema:
|
||||
* type: string
|
||||
* x-codeSamples:
|
||||
* - lang: JavaScript
|
||||
* label: JS SDK
|
||||
* source: |-
|
||||
* import Medusa from "@medusajs/js-sdk"
|
||||
*
|
||||
* export const sdk = new Medusa({
|
||||
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
|
||||
* debug: import.meta.env.DEV,
|
||||
* auth: {
|
||||
* type: "session",
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* await sdk.auth.register(
|
||||
* "customer",
|
||||
* "emailpass",
|
||||
* {
|
||||
* email: "customer@gmail.com",
|
||||
* password: "supersecret"
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* // all subsequent requests will use the token in the header
|
||||
* const { customer } = await sdk.store.customer.create({
|
||||
* email: "customer@gmail.com",
|
||||
* password: "supersecret"
|
||||
* })
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: curl -X POST '{backend_url}/auth/{actor_type}/{auth_provider}/register'
|
||||
* tags:
|
||||
* - "[actor_type]"
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
+25
@@ -18,12 +18,37 @@
|
||||
* schema:
|
||||
* type: string
|
||||
* x-codeSamples:
|
||||
* - lang: JavaScript
|
||||
* label: JS SDK
|
||||
* source: |-
|
||||
* import Medusa from "@medusajs/js-sdk"
|
||||
*
|
||||
* export const sdk = new Medusa({
|
||||
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
|
||||
* debug: import.meta.env.DEV,
|
||||
* auth: {
|
||||
* type: "session",
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* sdk.auth.resetPassword(
|
||||
* "customer",
|
||||
* "emailpass",
|
||||
* {
|
||||
* identifier: "customer@gmail.com"
|
||||
* }
|
||||
* )
|
||||
* .then(() => {
|
||||
* // user receives token
|
||||
* })
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: curl -X POST '{backend_url}/auth/{actor_type}/{auth_provider}/reset-password'
|
||||
* tags:
|
||||
* - "[actor_type]"
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
+26
@@ -18,12 +18,38 @@
|
||||
* schema:
|
||||
* type: string
|
||||
* x-codeSamples:
|
||||
* - lang: JavaScript
|
||||
* label: JS SDK
|
||||
* source: |-
|
||||
* import Medusa from "@medusajs/js-sdk"
|
||||
*
|
||||
* export const sdk = new Medusa({
|
||||
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
|
||||
* debug: import.meta.env.DEV,
|
||||
* auth: {
|
||||
* type: "session",
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* sdk.auth.updateProvider(
|
||||
* "customer",
|
||||
* "emailpass",
|
||||
* {
|
||||
* password: "supersecret"
|
||||
* },
|
||||
* token
|
||||
* )
|
||||
* .then(() => {
|
||||
* // password updated
|
||||
* })
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: curl -X POST '{backend_url}/auth/{actor_type}/{auth_provider}/update'
|
||||
* tags:
|
||||
* - "[actor_type]"
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
* tags:
|
||||
* - Session
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -5,12 +5,31 @@
|
||||
* description: Create a token.
|
||||
* x-authenticated: false
|
||||
* x-codeSamples:
|
||||
* - lang: JavaScript
|
||||
* label: JS SDK
|
||||
* source: |-
|
||||
* import Medusa from "@medusajs/js-sdk"
|
||||
*
|
||||
* export const sdk = new Medusa({
|
||||
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
|
||||
* debug: import.meta.env.DEV,
|
||||
* auth: {
|
||||
* type: "session",
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* const token = await sdk.auth.refresh()
|
||||
*
|
||||
* // all subsequent requests will use the token in the header
|
||||
* const { customer } = await sdk.store.customer.retrieve()
|
||||
* - lang: Shell
|
||||
* label: cURL
|
||||
* source: curl -X POST '{backend_url}/auth/token/refresh'
|
||||
* tags:
|
||||
* - Token
|
||||
* responses:
|
||||
* "200":
|
||||
* description: OK
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
Reference in New Issue
Block a user