Merge branch 'main' into dev
This commit is contained in:
@@ -13,7 +13,7 @@ export type DevMockStatus = {
|
||||
}
|
||||
|
||||
export type DevMockCreateResult = {
|
||||
platform: 'lewan' | 'feifei' | 'affiliate_dash'
|
||||
platform: 'affiliate_dash'
|
||||
orderId: number
|
||||
orderNo: string
|
||||
taskId: number
|
||||
@@ -49,26 +49,6 @@ export function fetchDevMockStatus() {
|
||||
return apiGet<DevMockStatus>('/api/v1/admin/dev-mock/status')
|
||||
}
|
||||
|
||||
export function createLewanDevMock(payload: {
|
||||
step?: string
|
||||
uid?: string
|
||||
orderNo?: string
|
||||
productNo?: string
|
||||
}) {
|
||||
return apiPost<DevMockCreateResult>('/api/v1/admin/dev-mock/lewan', payload)
|
||||
}
|
||||
|
||||
export function createFeifeiDevMock(payload: {
|
||||
step?: string
|
||||
uid?: string
|
||||
orderNo?: string
|
||||
productName?: string
|
||||
productCode?: string
|
||||
h5Url?: string
|
||||
}) {
|
||||
return apiPost<DevMockCreateResult>('/api/v1/admin/dev-mock/feifei', payload)
|
||||
}
|
||||
|
||||
export function createAffiliateDashDevMock(payload: {
|
||||
step?: string
|
||||
uid?: string
|
||||
|
||||
@@ -1,335 +0,0 @@
|
||||
import { apiDelete, apiGet, apiPost } from '@/lib/http'
|
||||
import type {
|
||||
AdminCloudtentaclesLoginTestResult,
|
||||
AdminCloudtentaclesDeliveryRecordListResult,
|
||||
AdminCloudtentaclesOverrideRuleConfig,
|
||||
AdminCloudtentaclesSkuListResult,
|
||||
AdminCloudtentaclesSendSmsResult,
|
||||
AdminCloudtentaclesSourceConfigResponse,
|
||||
AdminCloudtentaclesSourceItem,
|
||||
AdminCloudtentaclesSourcesConfig,
|
||||
AdminCloudtentaclesValidateSessionResult,
|
||||
AdminCloudtentaclesVnListResult,
|
||||
} from '@/types/admin'
|
||||
|
||||
export function fetchAdminCloudtentaclesSourceConfig() {
|
||||
return apiGet<AdminCloudtentaclesSourceConfigResponse>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles-source',
|
||||
)
|
||||
}
|
||||
|
||||
export function saveAdminCloudtentaclesSourceConfig(
|
||||
payload:
|
||||
| AdminCloudtentaclesSourcesConfig
|
||||
| ({ sourceKey: string } & Partial<AdminCloudtentaclesSourceItem>),
|
||||
) {
|
||||
return apiPost<AdminCloudtentaclesSourceConfigResponse>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles-source',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function deleteAdminCloudtentaclesSource(sourceKey: string) {
|
||||
return apiDelete<{ success: boolean }>(
|
||||
`/api/v1/admin/platform-config/cloudtentacles-source/${sourceKey}`,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesOverrideRules() {
|
||||
return apiGet<AdminCloudtentaclesOverrideRuleConfig>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/override-rules',
|
||||
)
|
||||
}
|
||||
|
||||
export function saveAdminCloudtentaclesOverrideRules(payload: {
|
||||
enabled: boolean
|
||||
rules: Array<{
|
||||
id?: string
|
||||
enabled?: boolean
|
||||
productName?: string
|
||||
sourceKey?: string
|
||||
deliveryItems?: Array<{
|
||||
cloudSkuId?: number
|
||||
cloudSkuName?: string
|
||||
quantity?: number
|
||||
}>
|
||||
notes?: string
|
||||
}>
|
||||
}) {
|
||||
return apiPost<AdminCloudtentaclesOverrideRuleConfig>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/override-rules',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function sendAdminCloudtentaclesSmsCode(payload: {
|
||||
baseUrl?: string
|
||||
username?: string
|
||||
phone?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<AdminCloudtentaclesSendSmsResult>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/send-sms-code',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function testAdminCloudtentaclesLogin(payload: {
|
||||
baseUrl?: string
|
||||
username?: string
|
||||
password?: string
|
||||
phone?: string
|
||||
code?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<AdminCloudtentaclesLoginTestResult>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/test-login',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function validateAdminCloudtentaclesSession(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<AdminCloudtentaclesValidateSessionResult>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/validate-session',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesAsset(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/asset',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesCategories(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/categories',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesSkuList(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<AdminCloudtentaclesSkuListResult>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/sku/list',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function buyAdminCloudtentaclesSku(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
id?: number
|
||||
count?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/sku/buy',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function useAdminCloudtentaclesSku(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
id?: number
|
||||
virtualNumberId?: number
|
||||
phone?: string
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/sku/use',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesKnapsack(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/knapsack',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesDeliveryRecords(payload: {
|
||||
sourceKey?: string
|
||||
page?: number
|
||||
size?: number
|
||||
startDate?: string
|
||||
endDate?: string
|
||||
platformOrderId?: string
|
||||
}) {
|
||||
return apiPost<AdminCloudtentaclesDeliveryRecordListResult>(
|
||||
'/api/v1/admin/cloudtentacles-records',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesRecordSources() {
|
||||
return apiGet<{
|
||||
sources: Array<{
|
||||
key: string
|
||||
label: string
|
||||
enabled: boolean
|
||||
hasToken: boolean
|
||||
loggedInAt: string
|
||||
}>
|
||||
}>('/api/v1/admin/cloudtentacles-records/sources')
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesVnList(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<AdminCloudtentaclesVnListResult>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/vn/list',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function appointAdminCloudtentaclesVn(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/vn/appoint',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function generateAdminCloudtentaclesVnLoginCode(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
id?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/vn/generate-login-code',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesVnCode(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
phone?: string
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/vn/fetch-code',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function verifyAdminCloudtentaclesVnCode(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
id?: number
|
||||
code?: string
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/vn/verify-code',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminCloudtentaclesBindUrl(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
id?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/vn/bind-url',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function backAdminCloudtentaclesVn(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
key?: string
|
||||
id?: number
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/vn/back',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function runAdminCloudtentaclesFullFlow(payload: {
|
||||
baseUrl?: string
|
||||
token?: string
|
||||
deviceId?: string
|
||||
deviceType?: number
|
||||
skuId?: number
|
||||
skuCount?: number
|
||||
vnKey?: string
|
||||
sourceKey?: string
|
||||
}) {
|
||||
return apiPost<Record<string, unknown>>(
|
||||
'/api/v1/admin/platform-config/cloudtentacles/debug/full-flow',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
export * from './notifications'
|
||||
export * from './scheduled-jobs'
|
||||
export * from './kuaishou-industry'
|
||||
export * from './kuaishou-feifei'
|
||||
export * from './affiliate-dash'
|
||||
export * from './cloudtentacles'
|
||||
export * from './fulfillment-routing'
|
||||
export * from './pdd'
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
import { apiGet, apiPost } from '@/lib/http'
|
||||
import type {
|
||||
AdminKuaishouFeifeiConfig,
|
||||
AdminKuaishouFeifeiConfigResponse,
|
||||
AdminKuaishouFeifeiMatchResult,
|
||||
AdminKuaishouFeifeiOrderResult,
|
||||
AdminKuaishouFeifeiProductListResult,
|
||||
AdminKuaishouFeifeiProductSyncResult,
|
||||
} from '@/types/admin'
|
||||
|
||||
export function fetchAdminKuaishouFeifeiConfig() {
|
||||
return apiGet<AdminKuaishouFeifeiConfigResponse>('/api/v1/admin/platform-config/kuaishou-feifei')
|
||||
}
|
||||
|
||||
export function saveAdminKuaishouFeifeiConfig(payload: AdminKuaishouFeifeiConfig) {
|
||||
return apiPost<AdminKuaishouFeifeiConfigResponse>(
|
||||
'/api/v1/admin/platform-config/kuaishou-feifei',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function matchAdminKuaishouFeifeiProduct(productName: string) {
|
||||
return apiPost<AdminKuaishouFeifeiMatchResult>(
|
||||
'/api/v1/admin/platform-config/kuaishou-feifei/match',
|
||||
{ productName },
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchAdminKuaishouFeifeiProducts(payload: {
|
||||
page?: number
|
||||
perPage?: number
|
||||
status?: string
|
||||
supplyProductName?: string
|
||||
}) {
|
||||
return apiPost<AdminKuaishouFeifeiProductListResult>(
|
||||
'/api/v1/admin/platform-config/kuaishou-feifei/products',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function syncAdminKuaishouFeifeiProducts(
|
||||
payload: {
|
||||
status?: string
|
||||
supplyProductName?: string
|
||||
} = {},
|
||||
) {
|
||||
return apiPost<AdminKuaishouFeifeiProductSyncResult>(
|
||||
'/api/v1/admin/platform-config/kuaishou-feifei/sync-products',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function createAdminKuaishouFeifeiTestOrder(payload: {
|
||||
platformOrderNo: string
|
||||
productCode: string
|
||||
platformBuyNum?: number
|
||||
platformAmount?: number | null
|
||||
playerAccount?: string
|
||||
playerGameRegion?: string
|
||||
playerGameSrv?: string
|
||||
playerGameRole?: string
|
||||
submitPlayer?: boolean
|
||||
notifyUrl?: string
|
||||
}) {
|
||||
return apiPost<AdminKuaishouFeifeiOrderResult>(
|
||||
'/api/v1/admin/platform-config/kuaishou-feifei/test-order',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function queryAdminKuaishouFeifeiOrder(payload: {
|
||||
platformOrderNo?: string
|
||||
orderNo?: string
|
||||
}) {
|
||||
return apiPost<AdminKuaishouFeifeiOrderResult>(
|
||||
'/api/v1/admin/platform-config/kuaishou-feifei/query-order',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
AdminPddTestCookieResult,
|
||||
AdminPddSyncResult,
|
||||
AdminPddSyncAllResponse,
|
||||
AdminPddStoreSyncTokenResponse,
|
||||
} from '@/types/admin/platform-config'
|
||||
|
||||
export function fetchAdminPddConfig() {
|
||||
@@ -49,3 +50,9 @@ export function triggerAdminPddSync(
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function generateAdminPddStoreSyncToken(shopId: string) {
|
||||
return apiPost<AdminPddStoreSyncTokenResponse>(
|
||||
`/api/v1/admin/platform-config/pdd/stores/${encodeURIComponent(shopId)}/sync-token`,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -52,41 +52,6 @@ export function completeAdminTaskManualDispatch(
|
||||
)
|
||||
}
|
||||
|
||||
export function prepareAdminTaskKuaishouCloudFulfillment(taskId: number | string) {
|
||||
return apiPost<AdminTaskActionResponse>(
|
||||
`/api/v1/admin/tasks/${taskId}/kuaishou-cloud/prepare`,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
export function refreshAdminTaskKuaishouCloudRoleInfo(taskId: number | string) {
|
||||
return apiPost<AdminTaskActionResponse>(
|
||||
`/api/v1/admin/tasks/${taskId}/kuaishou-cloud/refresh-role-info`,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
export function rebindAdminTaskKuaishouCloudRole(taskId: number | string) {
|
||||
return apiPost<AdminTaskActionResponse>(
|
||||
`/api/v1/admin/tasks/${taskId}/kuaishou-cloud/rebind-role`,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
export function dispatchAdminTaskKuaishouCloudFulfillment(taskId: number | string) {
|
||||
return apiPost<AdminTaskActionResponse>(
|
||||
`/api/v1/admin/tasks/${taskId}/kuaishou-cloud/dispatch`,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
export function returnNumberAdminTaskKuaishouCloudFulfillment(taskId: number | string) {
|
||||
return apiPost<AdminTaskActionResponse>(
|
||||
`/api/v1/admin/tasks/${taskId}/kuaishou-cloud/return-number`,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
export function resendAdminTaskKuaishouIndustryVoucherCode(taskId: number | string) {
|
||||
return apiPost<AdminTaskActionResponse>(
|
||||
`/api/v1/admin/tasks/${taskId}/kuaishou-industry/resend-code`,
|
||||
|
||||
@@ -349,6 +349,26 @@ export function testAdminKuaishouProductMatch(rawPayload: string) {
|
||||
mappingId: number | null
|
||||
rule: WorkProductRule | null
|
||||
candidates: Array<{ ruleKey: string; score: number; mappingId: number | null }>
|
||||
diagnostics?: {
|
||||
outSkuSn: string
|
||||
orderProvider: string
|
||||
orderPlatform: string
|
||||
orderShopId: string
|
||||
contextSellerId: string
|
||||
legacyFallbackEnabled: boolean
|
||||
useLegacyFallback: boolean
|
||||
enabledRules: number
|
||||
enabledMappings: number
|
||||
rejectSamples: Array<{
|
||||
ruleKey: string
|
||||
productName: string
|
||||
provider: string
|
||||
platform: string
|
||||
shopId: string
|
||||
skuCode: string
|
||||
reason: string
|
||||
}>
|
||||
}
|
||||
}>('/api/v1/admin/worker-platform/product-match-test', { rawPayload })
|
||||
}
|
||||
|
||||
|
||||
@@ -15,15 +15,3 @@ export function submitAffiliateDashClaim(
|
||||
) {
|
||||
return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/affiliate-dash/submit`, payload)
|
||||
}
|
||||
|
||||
export function confirmKuaishouCloudClaimRole(token: string) {
|
||||
return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/kuaishou-cloud/confirm-role`, {})
|
||||
}
|
||||
|
||||
export function rebindKuaishouCloudClaimRole(token: string) {
|
||||
return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/kuaishou-cloud/rebind-role`, {})
|
||||
}
|
||||
|
||||
export function redeemKuaishouCloudClaim(token: string) {
|
||||
return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/kuaishou-cloud/redeem`, {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user