彻底修复 lewan 自动发货问题-8-8
This commit is contained in:
@@ -12,6 +12,9 @@ export async function getCloudtentaclesAsset(payload: JsonObject = {}) {
|
||||
method: 'GET',
|
||||
token,
|
||||
contentType: 'application/json',
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'asset_get', sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_asset_failed',
|
||||
})
|
||||
@@ -32,6 +35,9 @@ export async function getCloudtentaclesCategories(payload: JsonObject = {}) {
|
||||
method: 'GET',
|
||||
token,
|
||||
contentType: 'application/json',
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'categories_list', sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_categories_failed',
|
||||
})
|
||||
@@ -55,6 +61,9 @@ export async function listCloudtentaclesSku(payload: JsonObject = {}) {
|
||||
method: 'GET',
|
||||
token,
|
||||
contentType: 'application/json',
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'sku_list', sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_sku_list_failed',
|
||||
})
|
||||
@@ -85,6 +94,8 @@ export async function buyCloudtentaclesSku(payload: JsonObject = {}) {
|
||||
},
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_sku_buy_failed',
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: {
|
||||
operation: 'sku_buy',
|
||||
skuId,
|
||||
|
||||
@@ -187,6 +187,9 @@ export async function cloudtentaclesRequest(pathname: unknown, options: JsonObje
|
||||
pathname: normalizedPathname,
|
||||
status: response.status,
|
||||
attempt: attempt + 1,
|
||||
sourceKey: options.sourceKey,
|
||||
accountLabel: options.accountLabel,
|
||||
context: options.context,
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -18,6 +18,9 @@ export async function getCloudtentaclesKnapsack(payload: JsonObject = {}) {
|
||||
method: 'GET',
|
||||
token,
|
||||
contentType: 'application/json',
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'knapsack_get', sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_knapsack_failed',
|
||||
})
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { JsonObject } from '../../../types/json.js'
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { cloudtentaclesRequest } from './http-client.js'
|
||||
import { resolveCloudtentaclesConfig } from './helpers.js'
|
||||
import { maskPhone } from '../../../utils/masking.js'
|
||||
|
||||
const BIND_URL_PROBE_MAX_BODY_BYTES = 64 * 1024
|
||||
const AMS_SIGNATURE_EXPIRED_CODE = '99998'
|
||||
@@ -49,6 +50,9 @@ export async function listCloudtentaclesVirtualNumbers(payload: JsonObject = {})
|
||||
method: 'POST',
|
||||
token,
|
||||
body: { key },
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'vn_list', vnKey: key, sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_vn_list_failed',
|
||||
})
|
||||
@@ -74,6 +78,9 @@ export async function appointCloudtentaclesVirtualNumber(payload: JsonObject = {
|
||||
method: 'POST',
|
||||
token,
|
||||
body: { key },
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'vn_appoint', vnKey: key, sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_vn_appoint_failed',
|
||||
})
|
||||
@@ -97,6 +104,9 @@ export async function generateCloudtentaclesLoginCode(payload: JsonObject = {})
|
||||
method: 'POST',
|
||||
token,
|
||||
body: { key, id },
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'vn_generate_code', vnKey: key, vnId: id, sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_vn_generate_code_failed',
|
||||
})
|
||||
@@ -126,6 +136,9 @@ export async function fetchCloudtentaclesVirtualNumberCode(payload: JsonObject =
|
||||
method: 'POST',
|
||||
token,
|
||||
body: { key, phone },
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'vn_fetch_code', vnKey: key, phoneMasked: maskPhone(phone), sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_vn_verif_code_failed',
|
||||
})
|
||||
@@ -157,6 +170,9 @@ export async function verifyCloudtentaclesLoginCode(payload: JsonObject = {}) {
|
||||
method: 'POST',
|
||||
token,
|
||||
body: { key, id, code },
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'vn_verify_code', vnKey: key, vnId: id, sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
businessErrorStatusCode: 401,
|
||||
businessErrorCode: 'cloudtentacles_vn_verify_code_failed',
|
||||
})
|
||||
@@ -305,6 +321,9 @@ export async function getCloudtentaclesBindInfo(payload: JsonObject = {}) {
|
||||
rateLimitRetryDelayMs: BIND_INFO_RATE_LIMIT_RETRY_DELAY_MS,
|
||||
rateLimitRetries: 2,
|
||||
rateLimitIsolatePath: true,
|
||||
sourceKey: payload.sourceKey || payload.resolvedSourceKey,
|
||||
accountLabel: payload.accountLabel,
|
||||
context: { operation: 'vn_bind_info', vnKey: key, vnId: id, sourceKey: payload.sourceKey || payload.resolvedSourceKey || '' },
|
||||
})
|
||||
|
||||
const items = Array.isArray(result.payload?.data) ? result.payload.data : []
|
||||
|
||||
Reference in New Issue
Block a user