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:
Oli Juhl
2024-04-06 16:30:27 +00:00
committed by GitHub
parent 58c68f6715
commit 5724d80286
22 changed files with 533 additions and 607 deletions
@@ -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"
+1
View File
@@ -0,0 +1 @@
export * from "./admin"
+1
View File
@@ -0,0 +1 @@
export * from "./paginated-response"
@@ -0,0 +1,5 @@
export interface PaginatedResponse {
limit: number
offset: number
count: number
}
+3 -1
View File
@@ -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"