feat: Bring back API key sales channel management (#6976)
- Add API key sales channel management - Add HTTP responses for API keys and sales channels - Use HTTP responses in `dashboard` and remove now redundant types
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { ApiKeyType } from "../../../api-key"
|
||||
import { PaginatedResponse } from "../../../common"
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
interface ApiKeyResponse {
|
||||
id: string
|
||||
token: string
|
||||
redacted: string
|
||||
title: string
|
||||
type: ApiKeyType
|
||||
last_used_at: Date | null
|
||||
created_by: string
|
||||
created_at: Date
|
||||
revoked_by: string | null
|
||||
revoked_at: Date | null
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export interface AdminApiKeyResponse {
|
||||
api_key: ApiKeyResponse
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export interface AdminApiKeyListResponse extends PaginatedResponse {
|
||||
api_keys: ApiKeyResponse[]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./api-key"
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./admin"
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./paginated-response"
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface PaginatedResponse {
|
||||
limit: number
|
||||
offset: number
|
||||
count: number
|
||||
}
|
||||
@@ -1,2 +1,4 @@
|
||||
export * from "./stock-locations"
|
||||
export * from "./api-key"
|
||||
export * from "./fulfillment"
|
||||
export * from "./sales-channel"
|
||||
export * from "./stock-locations"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./sales-channel"
|
||||
@@ -0,0 +1,26 @@
|
||||
import { PaginatedResponse } from "../../common"
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
interface SalesChannelResponse {
|
||||
id: string
|
||||
name: string
|
||||
description: string | null
|
||||
is_disabled: boolean
|
||||
metadata: Record<string, unknown> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export interface AdminSalesChannelListResponse extends PaginatedResponse {
|
||||
sales_channels: SalesChannelResponse[]
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export interface AdminSalesChannelResponse {
|
||||
sales_channel: SalesChannelResponse
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./admin"
|
||||
Reference in New Issue
Block a user