feat(utils,types,framework,medusa): store endpoints should require publishable key (#9068)
* feat(utils,types,framework,medusa): store endpoints should require publishable key * chore: fix specs * chore: fix more specs * chore: update js-sdk * chore: fix specs wrt to default SC * chore: revert custom headers + change error message * chore: fix specs * chore: fix new store specs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ZodObject } from "zod"
|
||||
import type { NextFunction, Request, Response } from "express"
|
||||
import { ZodObject } from "zod"
|
||||
|
||||
import { MedusaPricingContext, RequestQueryFields } from "@medusajs/types"
|
||||
import * as core from "express-serve-static-core"
|
||||
@@ -162,9 +162,20 @@ export interface AuthContext {
|
||||
app_metadata: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface PublishableKeyContext {
|
||||
key: string
|
||||
sales_channel_ids: string[]
|
||||
}
|
||||
|
||||
export interface AuthenticatedMedusaRequest<Body = never>
|
||||
extends MedusaRequest<Body> {
|
||||
auth_context: AuthContext
|
||||
publishable_key_context?: PublishableKeyContext
|
||||
}
|
||||
|
||||
export interface MedusaStoreRequest<Body = never> extends MedusaRequest<Body> {
|
||||
auth_context?: AuthContext
|
||||
publishable_key_context: PublishableKeyContext
|
||||
}
|
||||
|
||||
export type MedusaResponse<Body = unknown> = Response<Body>
|
||||
|
||||
Reference in New Issue
Block a user