优化后端目录命名与模块归位
This commit is contained in:
+3
-3
@@ -1,10 +1,10 @@
|
||||
import { buildClaimUrl, createTaskClaimToken } from '../../claim/claim-service.js'
|
||||
import { buildClaimUrl, createTaskClaimToken } from '../claim/claim-service.js'
|
||||
import {
|
||||
maskCode as maskCodeValue,
|
||||
maskPhone as maskPhoneValue,
|
||||
} from '../../../utils/masking.js'
|
||||
} from '../../utils/masking.js'
|
||||
|
||||
import type { TaskRow } from '../../../types/repository-rows.js'
|
||||
import type { TaskRow } from '../../types/repository-rows.js'
|
||||
|
||||
type TaskClaimLink = {
|
||||
token: string
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
getTaskClaimExpiresAt,
|
||||
maskCode,
|
||||
maskPhone,
|
||||
} from './shared.js'
|
||||
} from '../write-helpers.js'
|
||||
import {
|
||||
isKuaishouCloudTask,
|
||||
normalizeKuaishouCloudFlow,
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
normalizeKuaishouCloudFlow,
|
||||
prepareKuaishouCloudFulfillmentTask,
|
||||
refreshKuaishouCloudTaskRoleInfo,
|
||||
} from '../fulfillment/kuaishou-cloud-task-service.js'
|
||||
} from '../fulfillment/kuaishou-cloud/index.js'
|
||||
import { buildClaimDetailPayload, getClaimContext } from './kuaishou-cloud-claim-context.js'
|
||||
import { syncKuaishouCloudRoleInfo } from './kuaishou-cloud-sync-service.js'
|
||||
import type { TaskRow } from '../../types/repository-rows.js'
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
prepareKuaishouCloudFulfillmentTask,
|
||||
probeKuaishouCloudTaskBindUrl,
|
||||
refreshKuaishouCloudTaskRoleInfo,
|
||||
} from '../fulfillment/kuaishou-cloud-task-service.js'
|
||||
} from '../fulfillment/kuaishou-cloud/index.js'
|
||||
import type { TaskRow } from '../../types/repository-rows.js'
|
||||
|
||||
export async function syncKuaishouCloudRoleInfo(task: TaskRow) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { resolveCloudtentaclesConfig } from "../../platforms/cloudtentacles/shared.js";
|
||||
import { resolveCloudtentaclesConfig } from "../../platforms/cloudtentacles/helpers.js";
|
||||
import {
|
||||
maskCode as maskCodeValue,
|
||||
maskPhone as maskPhoneValue,
|
||||
|
||||
+18
-18
@@ -1,24 +1,24 @@
|
||||
import { createTaskEvent } from "../../repositories/task-event-repo.js";
|
||||
import { updateTask } from "../../repositories/task-repo.js";
|
||||
import { buildClaimUrl, createTaskClaimToken } from "../claim/claim-service.js";
|
||||
import { createTaskEvent } from "../../../repositories/task-event-repo.js";
|
||||
import { updateTask } from "../../../repositories/task-repo.js";
|
||||
import { buildClaimUrl, createTaskClaimToken } from "../../claim/claim-service.js";
|
||||
import {
|
||||
buyCloudtentaclesSku,
|
||||
getCloudtentaclesAsset,
|
||||
listCloudtentaclesSku,
|
||||
} from "../platforms/cloudtentacles/catalog-service.js";
|
||||
import { getCloudtentaclesKnapsack } from "../platforms/cloudtentacles/knapsack-service.js";
|
||||
} from "../../platforms/cloudtentacles/catalog-service.js";
|
||||
import { getCloudtentaclesKnapsack } from "../../platforms/cloudtentacles/knapsack-service.js";
|
||||
import {
|
||||
backCloudtentaclesVirtualNumber,
|
||||
getCloudtentaclesBindInfo,
|
||||
probeCloudtentaclesBindUrl,
|
||||
} from "../platforms/cloudtentacles/virtual-number-service.js";
|
||||
import { resolveCloudtentaclesConfig } from "../platforms/cloudtentacles/shared.js";
|
||||
} from "../../platforms/cloudtentacles/virtual-number-service.js";
|
||||
import { resolveCloudtentaclesConfig } from "../../platforms/cloudtentacles/helpers.js";
|
||||
import {
|
||||
notifyKuaishouCloudAssetNotEnough,
|
||||
notifyKuaishouCloudBindUrlRefreshFailed,
|
||||
} from "../notification/domain-notifications.js";
|
||||
import { createHttpError } from "../../utils/http.js";
|
||||
import { nowIso } from "../../utils/time.js";
|
||||
} from "../../notification/domain-notifications.js";
|
||||
import { createHttpError } from "../../../utils/http.js";
|
||||
import { nowIso } from "../../../utils/time.js";
|
||||
import {
|
||||
KUAISHOU_CLOUD_FIXED_VN_KEY,
|
||||
isKuaishouCloudBindUrlFresh,
|
||||
@@ -28,22 +28,22 @@ import {
|
||||
normalizeKuaishouCloudRoleInfo,
|
||||
resolveKuaishouCloudBindUrlExpiresAt,
|
||||
type JsonObject,
|
||||
} from "./kuaishou-cloud/domain.js";
|
||||
} from "./domain.js";
|
||||
import {
|
||||
prepareKuaishouCloudBindResourceWithFallback,
|
||||
resolveKuaishouCloudBindingResources,
|
||||
resolveKuaishouCloudVnKeyCandidates,
|
||||
} from "./kuaishou-cloud/binding-resources.js";
|
||||
} from "./binding-resources.js";
|
||||
import {
|
||||
resolvePersistedCloudtentaclesContextWithFallback,
|
||||
} from "./kuaishou-cloud/cloudtentacles-context.js";
|
||||
} from "./cloudtentacles-context.js";
|
||||
import {
|
||||
getTaskClaimExpiresAt,
|
||||
isClaimExpired,
|
||||
normalizeActor,
|
||||
parseTaskContext,
|
||||
} from "./kuaishou-cloud/task-context.js";
|
||||
import type { TaskRow } from "../../types/repository-rows.js";
|
||||
} from "./task-context.js";
|
||||
import type { TaskRow } from "../../../types/repository-rows.js";
|
||||
|
||||
export {
|
||||
isKuaishouCloudBindUrlFresh,
|
||||
@@ -53,11 +53,11 @@ export {
|
||||
normalizeKuaishouCloudFlow,
|
||||
normalizeKuaishouCloudRoleInfo,
|
||||
resolveKuaishouCloudBindUrlExpiresAt,
|
||||
} from "./kuaishou-cloud/domain.js";
|
||||
} from "./domain.js";
|
||||
export {
|
||||
resolvePersistedCloudtentaclesContext,
|
||||
resolvePersistedCloudtentaclesContextWithFallback,
|
||||
} from "./kuaishou-cloud/cloudtentacles-context.js";
|
||||
} from "./cloudtentacles-context.js";
|
||||
|
||||
export async function ensureTaskClaimLink(task: TaskRow) {
|
||||
const tokenStatus = String(task?.primary_claim_token_status || "").trim();
|
||||
@@ -775,4 +775,4 @@ export async function refreshKuaishouCloudTaskRoleInfo(
|
||||
export {
|
||||
dispatchKuaishouCloudFulfillmentTask,
|
||||
returnKuaishouCloudFulfillmentTask,
|
||||
} from "./kuaishou-cloud/task-finalization.js";
|
||||
} from "./task-finalization.js";
|
||||
@@ -1,7 +1,7 @@
|
||||
import { findOrderByPlatformOrderId } from '../../repositories/order-repo.js'
|
||||
import { listTasksByOrderId } from '../../repositories/task-repo.js'
|
||||
import { buildClaimUrl } from '../claim/claim-service.js'
|
||||
import { ensureTaskClaimLink } from '../fulfillment/kuaishou-cloud-task-service.js'
|
||||
import { ensureTaskClaimLink } from '../fulfillment/kuaishou-cloud/index.js'
|
||||
import { logIntegration } from '../../utils/logger.js'
|
||||
import {
|
||||
OPEN_91_MANUAL_FAILED_STATUS,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { cloudtentaclesRequest } from './http-client.js'
|
||||
import { resolveCloudtentaclesConfig } from './shared.js'
|
||||
import { resolveCloudtentaclesConfig } from './helpers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createHash, constants, publicEncrypt } from 'node:crypto'
|
||||
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { resolveCloudtentaclesConfig } from './shared.js'
|
||||
import { resolveCloudtentaclesConfig } from './helpers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import https from 'node:https'
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { logInfo } from '../../../utils/logger.js'
|
||||
import { notifyCloudtentaclesAuthExpired } from '../../notification/domain-notifications.js'
|
||||
import { buildCloudtentaclesHeaders, buildCloudtentaclesUrl, resolveCloudtentaclesConfig } from './shared.js'
|
||||
import { buildCloudtentaclesHeaders, buildCloudtentaclesUrl, resolveCloudtentaclesConfig } from './helpers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
type HeaderAdapter = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { cloudtentaclesRequest } from './http-client.js'
|
||||
import { resolveCloudtentaclesConfig } from './shared.js'
|
||||
import { resolveCloudtentaclesConfig } from './helpers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createHttpError } from '../../../utils/http.js'
|
||||
import { logInfo } from '../../../utils/logger.js'
|
||||
import { encryptCloudtentaclesPayload, md5CloudtentaclesPassword } from './crypto-service.js'
|
||||
import { cloudtentaclesRequest } from './http-client.js'
|
||||
import { resolveCloudtentaclesConfig } from './shared.js'
|
||||
import { resolveCloudtentaclesConfig } from './helpers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import https from 'node:https'
|
||||
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { cloudtentaclesRequest } from './http-client.js'
|
||||
import { resolveCloudtentaclesConfig } from './shared.js'
|
||||
import { resolveCloudtentaclesConfig } from './helpers.js'
|
||||
|
||||
const BIND_URL_PROBE_MAX_BODY_BYTES = 64 * 1024
|
||||
const AMS_SIGNATURE_EXPIRED_CODE = '99998'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { kuaishouEticketRequest } from './http-client.js'
|
||||
import { resolveKuaishouEticketConfig } from './shared.js'
|
||||
import { resolveKuaishouEticketConfig } from './helpers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { IncomingHttpHeaders } from 'node:http'
|
||||
import { parseJsonObject } from '../../../utils/json.js'
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { logInfo } from '../../../utils/logger.js'
|
||||
import { buildKuaishouEticketHeaders, buildKuaishouEticketUrl, resolveKuaishouEticketConfig } from './shared.js'
|
||||
import { buildKuaishouEticketHeaders, buildKuaishouEticketUrl, resolveKuaishouEticketConfig } from './helpers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createHttpError } from '../../../utils/http.js'
|
||||
import { kuaishouEticketRequest } from './http-client.js'
|
||||
import { resolveKuaishouEticketConfig } from './shared.js'
|
||||
import { resolveKuaishouEticketConfig } from './helpers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user