完成后端类型与平台配置目录分组
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import type { PoolClient, QueryResult } from 'pg'
|
import type { PoolClient, QueryResult } from 'pg'
|
||||||
|
|
||||||
import { query, withTransaction } from '../db/client.js'
|
import { query, withTransaction } from '../db/client.js'
|
||||||
import type { OrderItemReplaceInput } from '../types/repository-inputs.js'
|
import type { OrderItemReplaceInput } from '../types/repository/inputs.js'
|
||||||
import type { OrderItemRow } from '../types/repository-rows.js'
|
import type { OrderItemRow } from '../types/repository/rows.js'
|
||||||
|
|
||||||
type QueryExecutor = (text: string, params?: unknown[]) => Promise<QueryResult<any>>
|
type QueryExecutor = (text: string, params?: unknown[]) => Promise<QueryResult<any>>
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import type {
|
|||||||
OrderCreateInput,
|
OrderCreateInput,
|
||||||
OrderListQueryInput,
|
OrderListQueryInput,
|
||||||
OrderUpdateInput,
|
OrderUpdateInput,
|
||||||
} from '../types/repository-inputs.js'
|
} from '../types/repository/inputs.js'
|
||||||
import type {
|
import type {
|
||||||
OrderListQueryResult,
|
OrderListQueryResult,
|
||||||
OrderListRow,
|
OrderListRow,
|
||||||
OrderRow,
|
OrderRow,
|
||||||
} from '../types/repository-rows.js'
|
} from '../types/repository/rows.js'
|
||||||
|
|
||||||
type OrderPlatformLookupInput = {
|
type OrderPlatformLookupInput = {
|
||||||
provider?: string
|
provider?: string
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import type {
|
|||||||
TaskListQueryInput,
|
TaskListQueryInput,
|
||||||
TaskRuntimeContextPatch,
|
TaskRuntimeContextPatch,
|
||||||
TaskUpdatePatch,
|
TaskUpdatePatch,
|
||||||
} from '../types/repository-inputs.js'
|
} from '../types/repository/inputs.js'
|
||||||
import type {
|
import type {
|
||||||
TaskListQueryResult,
|
TaskListQueryResult,
|
||||||
TaskRow,
|
TaskRow,
|
||||||
} from '../types/repository-rows.js'
|
} from '../types/repository/rows.js'
|
||||||
|
|
||||||
type TaskQueryExecutor = (text: string, params?: unknown[]) => Promise<{ rows: unknown[] }>
|
type TaskQueryExecutor = (text: string, params?: unknown[]) => Promise<{ rows: unknown[] }>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createJsonHandler } from './session.js'
|
|||||||
import type {
|
import type {
|
||||||
AdminOrderRouteParams,
|
AdminOrderRouteParams,
|
||||||
AdminOrderRouteQuery,
|
AdminOrderRouteQuery,
|
||||||
} from '../../types/admin-route-inputs.js'
|
} from '../../types/admin/route-inputs.js'
|
||||||
|
|
||||||
const router = Router()
|
const router = Router()
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
useAdminCloudtentaclesSku,
|
useAdminCloudtentaclesSku,
|
||||||
validateAdminCloudtentaclesSession,
|
validateAdminCloudtentaclesSession,
|
||||||
verifyAdminCloudtentaclesLoginCode,
|
verifyAdminCloudtentaclesLoginCode,
|
||||||
} from "../../../services/admin/platform-config/cloudtentacles-service.js";
|
} from "../../../services/admin/platform-config/cloudtentacles/index.js";
|
||||||
import type {
|
import type {
|
||||||
AdminCloudtentaclesCatalogQueryRouteBody,
|
AdminCloudtentaclesCatalogQueryRouteBody,
|
||||||
AdminCloudtentaclesFullFlowRouteBody,
|
AdminCloudtentaclesFullFlowRouteBody,
|
||||||
@@ -32,7 +32,7 @@ import type {
|
|||||||
AdminCloudtentaclesTestLoginRouteBody,
|
AdminCloudtentaclesTestLoginRouteBody,
|
||||||
AdminCloudtentaclesValidateSessionRouteBody,
|
AdminCloudtentaclesValidateSessionRouteBody,
|
||||||
AdminCloudtentaclesVirtualNumberRouteBody,
|
AdminCloudtentaclesVirtualNumberRouteBody,
|
||||||
} from "../../../types/admin-route-inputs.js";
|
} from "../../../types/admin/route-inputs.js";
|
||||||
import { createJsonHandler } from "../session.js";
|
import { createJsonHandler } from "../session.js";
|
||||||
import type { JsonRecord } from "../../../types/json.js";
|
import type { JsonRecord } from "../../../types/json.js";
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
getAdminKuaishouCloudFulfillmentConfig,
|
getAdminKuaishouCloudFulfillmentConfig,
|
||||||
updateAdminKuaishouCloudFulfillmentConfig,
|
updateAdminKuaishouCloudFulfillmentConfig,
|
||||||
} from "../../../services/admin/platform-config/kuaishou-cloud-fulfillment-service.js";
|
} from "../../../services/admin/platform-config/kuaishou-cloud-fulfillment-service.js";
|
||||||
import type { AdminKuaishouCloudFulfillmentConfigRouteBody } from "../../../types/admin-route-inputs.js";
|
import type { AdminKuaishouCloudFulfillmentConfigRouteBody } from "../../../types/admin/route-inputs.js";
|
||||||
import { createJsonHandler } from "../session.js";
|
import { createJsonHandler } from "../session.js";
|
||||||
import type { JsonRecord } from "../../../types/json.js";
|
import type { JsonRecord } from "../../../types/json.js";
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import type {
|
|||||||
AdminKuaishouEticketDetailQueryRouteBody,
|
AdminKuaishouEticketDetailQueryRouteBody,
|
||||||
AdminKuaishouEticketShopInfoRouteBody,
|
AdminKuaishouEticketShopInfoRouteBody,
|
||||||
AdminKuaishouEticketSourceConfigRouteBody,
|
AdminKuaishouEticketSourceConfigRouteBody,
|
||||||
} from "../../../types/admin-route-inputs.js";
|
} from "../../../types/admin/route-inputs.js";
|
||||||
import { createJsonHandler } from "../session.js";
|
import { createJsonHandler } from "../session.js";
|
||||||
import type { JsonRecord } from "../../../types/json.js";
|
import type { JsonRecord } from "../../../types/json.js";
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
getAdminNinetyoneOrders,
|
getAdminNinetyoneOrders,
|
||||||
retryAdminNinetyoneOrder,
|
retryAdminNinetyoneOrder,
|
||||||
} from "../../../services/admin/platform-config/ninetyone-service.js";
|
} from "../../../services/admin/platform-config/ninetyone-service.js";
|
||||||
import type { AdminEntityRouteParams } from "../../../types/admin-route-inputs.js";
|
import type { AdminEntityRouteParams } from "../../../types/admin/route-inputs.js";
|
||||||
import { createJsonHandler } from "../session.js";
|
import { createJsonHandler } from "../session.js";
|
||||||
import type { JsonRecord } from "../../../types/json.js";
|
import type { JsonRecord } from "../../../types/json.js";
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import type {
|
|||||||
AdminNotificationConfigRouteBody,
|
AdminNotificationConfigRouteBody,
|
||||||
AdminNotificationTestRouteBody,
|
AdminNotificationTestRouteBody,
|
||||||
AdminScheduledJobsConfigRouteBody,
|
AdminScheduledJobsConfigRouteBody,
|
||||||
} from "../../../types/admin-route-inputs.js";
|
} from "../../../types/admin/route-inputs.js";
|
||||||
import { createJsonHandler } from "../session.js";
|
import { createJsonHandler } from "../session.js";
|
||||||
import type { JsonRecord } from "../../../types/json.js";
|
import type { JsonRecord } from "../../../types/json.js";
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import type {
|
|||||||
AdminTaskKuaishouCloudDispatchRouteBody,
|
AdminTaskKuaishouCloudDispatchRouteBody,
|
||||||
AdminTaskRouteParams,
|
AdminTaskRouteParams,
|
||||||
AdminTaskRouteQuery,
|
AdminTaskRouteQuery,
|
||||||
} from "../../types/admin-route-inputs.js";
|
} from "../../types/admin/route-inputs.js";
|
||||||
import type { AdminTaskActionResponse } from "../../types/admin-write-models.js";
|
import type { AdminTaskActionResponse } from "../../types/admin/write-models.js";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { formatFenToAmount, normalizeFen } from '../../utils/money.js'
|
|||||||
import { resolveDisplayShopName, resolveOrderItemTitle } from './admin-read-shared-helpers.js'
|
import { resolveDisplayShopName, resolveOrderItemTitle } from './admin-read-shared-helpers.js'
|
||||||
import { buildOrderBindingSummary } from './admin-task-read-helpers.js'
|
import { buildOrderBindingSummary } from './admin-task-read-helpers.js'
|
||||||
|
|
||||||
import type { AdminOrderListItem } from '../../types/admin-read-models.js'
|
import type { AdminOrderListItem } from '../../types/admin/read-models.js'
|
||||||
import type { OrderItemRow, OrderListRow } from '../../types/repository-rows.js'
|
import type { OrderItemRow, OrderListRow } from '../../types/repository/rows.js'
|
||||||
|
|
||||||
export async function mapAdminOrderListItem(item: OrderListRow): Promise<AdminOrderListItem> {
|
export async function mapAdminOrderListItem(item: OrderListRow): Promise<AdminOrderListItem> {
|
||||||
const [tasks, orderItems] = await Promise.all([
|
const [tasks, orderItems] = await Promise.all([
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ import {
|
|||||||
import type {
|
import type {
|
||||||
AdminOrderListResponse,
|
AdminOrderListResponse,
|
||||||
AdminTaskListResponse,
|
AdminTaskListResponse,
|
||||||
} from '../../types/admin-read-models.js'
|
} from '../../types/admin/read-models.js'
|
||||||
import type {
|
import type {
|
||||||
AdminEntityIdInput,
|
AdminEntityIdInput,
|
||||||
AdminOrderListQueryInput,
|
AdminOrderListQueryInput,
|
||||||
AdminTaskListQueryInput,
|
AdminTaskListQueryInput,
|
||||||
AdminViewerSessionInput,
|
AdminViewerSessionInput,
|
||||||
} from '../../types/admin-read-inputs.js'
|
} from '../../types/admin/read-inputs.js'
|
||||||
|
|
||||||
type JsonRecord = Record<string, any>
|
type JsonRecord = Record<string, any>
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import {
|
|||||||
parseTaskState as parseTaskStateValue,
|
parseTaskState as parseTaskStateValue,
|
||||||
} from '../../utils/task-json.js'
|
} from '../../utils/task-json.js'
|
||||||
|
|
||||||
import type { AdminViewerSessionInput } from '../../types/admin-read-inputs.js'
|
import type { AdminViewerSessionInput } from '../../types/admin/read-inputs.js'
|
||||||
import type { OrderItemRow, TaskRow } from '../../types/repository-rows.js'
|
import type { OrderItemRow, TaskRow } from '../../types/repository/rows.js'
|
||||||
|
|
||||||
type JsonRecord = Record<string, any>
|
type JsonRecord = Record<string, any>
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import {
|
|||||||
import type {
|
import type {
|
||||||
AdminTaskBindingSummary,
|
AdminTaskBindingSummary,
|
||||||
AdminTaskListItem,
|
AdminTaskListItem,
|
||||||
} from '../../types/admin-read-models.js'
|
} from '../../types/admin/read-models.js'
|
||||||
import type { AdminTaskActionPayload } from '../../types/admin-write-models.js'
|
import type { AdminTaskActionPayload } from '../../types/admin/write-models.js'
|
||||||
import type {
|
import type {
|
||||||
TaskEventRow,
|
TaskEventRow,
|
||||||
TaskRow,
|
TaskRow,
|
||||||
} from '../../types/repository-rows.js'
|
} from '../../types/repository/rows.js'
|
||||||
import type { AdminViewerContext } from './admin-read-shared-helpers.js'
|
import type { AdminViewerContext } from './admin-read-shared-helpers.js'
|
||||||
|
|
||||||
type JsonRecord = Record<string, any>
|
type JsonRecord = Record<string, any>
|
||||||
|
|||||||
+2
-2
@@ -41,8 +41,8 @@ export function resolveKuaishouEticketAdminContext(payload: JsonObject = {}, opt
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
import { getCloudtentaclesSourceByKey } from "../../platforms/cloudtentacles/source-config-service.js";
|
import { getCloudtentaclesSourceByKey } from "../../../platforms/cloudtentacles/source-config-service.js";
|
||||||
import { getCloudtentaclesSessionStateByKey } from "../../platforms/cloudtentacles/session-state-service.js";
|
import { getCloudtentaclesSessionStateByKey } from "../../../platforms/cloudtentacles/session-state-service.js";
|
||||||
|
|
||||||
export function resolveCloudtentaclesAdminContext(payload: JsonObject = {}, options: JsonObject = {}) {
|
export function resolveCloudtentaclesAdminContext(payload: JsonObject = {}, options: JsonObject = {}) {
|
||||||
const sourceKey = String(
|
const sourceKey = String(
|
||||||
+10
-10
@@ -5,7 +5,7 @@ import {
|
|||||||
saveCloudtentaclesSourceByKey,
|
saveCloudtentaclesSourceByKey,
|
||||||
saveCloudtentaclesSourcesList,
|
saveCloudtentaclesSourcesList,
|
||||||
deleteCloudtentaclesSourceByKey,
|
deleteCloudtentaclesSourceByKey,
|
||||||
} from "../../platforms/cloudtentacles/source-config-service.js";
|
} from "../../../platforms/cloudtentacles/source-config-service.js";
|
||||||
import {
|
import {
|
||||||
clearCloudtentaclesSessionStateByKey,
|
clearCloudtentaclesSessionStateByKey,
|
||||||
deleteCloudtentaclesSessionStateByKey,
|
deleteCloudtentaclesSessionStateByKey,
|
||||||
@@ -14,20 +14,20 @@ import {
|
|||||||
saveCloudtentaclesSessionStateByKey,
|
saveCloudtentaclesSessionStateByKey,
|
||||||
getAllCloudtentaclesSessionStates,
|
getAllCloudtentaclesSessionStates,
|
||||||
pruneCloudtentaclesSessionStates,
|
pruneCloudtentaclesSessionStates,
|
||||||
} from "../../platforms/cloudtentacles/session-state-service.js";
|
} from "../../../platforms/cloudtentacles/session-state-service.js";
|
||||||
import {
|
import {
|
||||||
loginCloudtentaclesSession,
|
loginCloudtentaclesSession,
|
||||||
sendCloudtentaclesSmsCode,
|
sendCloudtentaclesSmsCode,
|
||||||
validateCloudtentaclesSession,
|
validateCloudtentaclesSession,
|
||||||
} from "../../platforms/cloudtentacles/session-service.js";
|
} from "../../../platforms/cloudtentacles/session-service.js";
|
||||||
import {
|
import {
|
||||||
buyCloudtentaclesSku,
|
buyCloudtentaclesSku,
|
||||||
getCloudtentaclesAsset,
|
getCloudtentaclesAsset,
|
||||||
getCloudtentaclesCategories,
|
getCloudtentaclesCategories,
|
||||||
listCloudtentaclesSku,
|
listCloudtentaclesSku,
|
||||||
useCloudtentaclesSku,
|
useCloudtentaclesSku,
|
||||||
} from "../../platforms/cloudtentacles/catalog-service.js";
|
} from "../../../platforms/cloudtentacles/catalog-service.js";
|
||||||
import { getCloudtentaclesKnapsack } from "../../platforms/cloudtentacles/knapsack-service.js";
|
import { getCloudtentaclesKnapsack } from "../../../platforms/cloudtentacles/knapsack-service.js";
|
||||||
import {
|
import {
|
||||||
appointCloudtentaclesVirtualNumber,
|
appointCloudtentaclesVirtualNumber,
|
||||||
backCloudtentaclesVirtualNumber,
|
backCloudtentaclesVirtualNumber,
|
||||||
@@ -36,8 +36,8 @@ import {
|
|||||||
getCloudtentaclesBindUrl,
|
getCloudtentaclesBindUrl,
|
||||||
listCloudtentaclesVirtualNumbers,
|
listCloudtentaclesVirtualNumbers,
|
||||||
verifyCloudtentaclesLoginCode,
|
verifyCloudtentaclesLoginCode,
|
||||||
} from "../../platforms/cloudtentacles/virtual-number-service.js";
|
} from "../../../platforms/cloudtentacles/virtual-number-service.js";
|
||||||
import { runCloudtentaclesFullDebugFlow } from "../../platforms/cloudtentacles/debug-flow-service.js";
|
import { runCloudtentaclesFullDebugFlow } from "../../../platforms/cloudtentacles/debug-flow-service.js";
|
||||||
import {
|
import {
|
||||||
hasCloudtentaclesCredentialContextChanged,
|
hasCloudtentaclesCredentialContextChanged,
|
||||||
pickFirstNonEmpty,
|
pickFirstNonEmpty,
|
||||||
@@ -48,8 +48,8 @@ import {
|
|||||||
buildAdminCloudtentaclesValidateResult,
|
buildAdminCloudtentaclesValidateResult,
|
||||||
resolveAdminCloudtentaclesCredentialPayload,
|
resolveAdminCloudtentaclesCredentialPayload,
|
||||||
resolveAdminCloudtentaclesSessionPayload,
|
resolveAdminCloudtentaclesSessionPayload,
|
||||||
} from "./cloudtentacles.js";
|
} from "./payloads.js";
|
||||||
import { normalizeAdminCloudtentaclesSourceConfigPayload } from "./cloudtentacles-writes.js";
|
import { normalizeAdminCloudtentaclesSourceConfigPayload } from "./writes.js";
|
||||||
import {
|
import {
|
||||||
mapAdminCloudtentaclesSession,
|
mapAdminCloudtentaclesSession,
|
||||||
mapAdminCloudtentaclesSourceConfig,
|
mapAdminCloudtentaclesSourceConfig,
|
||||||
@@ -66,7 +66,7 @@ import type {
|
|||||||
AdminCloudtentaclesTestLoginInput,
|
AdminCloudtentaclesTestLoginInput,
|
||||||
AdminCloudtentaclesValidateSessionInput,
|
AdminCloudtentaclesValidateSessionInput,
|
||||||
AdminCloudtentaclesVirtualNumberInput,
|
AdminCloudtentaclesVirtualNumberInput,
|
||||||
} from "../../../types/admin-write-inputs.js";
|
} from "../../../../types/admin/write-inputs.js";
|
||||||
|
|
||||||
type JsonObject = Record<string, any>;
|
type JsonObject = Record<string, any>;
|
||||||
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
maskPhone as maskPhoneValue,
|
maskPhone as maskPhoneValue,
|
||||||
maskSecret as maskSecretValue,
|
maskSecret as maskSecretValue,
|
||||||
} from "../../../utils/masking.js";
|
} from "../../../../utils/masking.js";
|
||||||
|
|
||||||
type JsonObject = Record<string, any>
|
type JsonObject = Record<string, any>
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { query } from '../../../db/client.js'
|
import { query } from '../../../../db/client.js'
|
||||||
import { mapAdminObservedProductItem } from './domain.js'
|
import { mapAdminObservedProductItem } from './domain.js'
|
||||||
|
|
||||||
type JsonObject = Record<string, any>
|
type JsonObject = Record<string, any>
|
||||||
+1
-1
@@ -8,7 +8,7 @@ import {
|
|||||||
buildAdminCloudtentaclesValidateResult,
|
buildAdminCloudtentaclesValidateResult,
|
||||||
resolveAdminCloudtentaclesCredentialPayload,
|
resolveAdminCloudtentaclesCredentialPayload,
|
||||||
resolveAdminCloudtentaclesSessionPayload,
|
resolveAdminCloudtentaclesSessionPayload,
|
||||||
} from './cloudtentacles.js'
|
} from './payloads.js'
|
||||||
|
|
||||||
test('resolveAdminCloudtentaclesCredentialPayload merges payload and saved source defaults', () => {
|
test('resolveAdminCloudtentaclesCredentialPayload merges payload and saved source defaults', () => {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { getCloudtentaclesSourceByKey } from "../../platforms/cloudtentacles/source-config-service.js";
|
import { getCloudtentaclesSourceByKey } from "../../../platforms/cloudtentacles/source-config-service.js";
|
||||||
import { getCloudtentaclesSessionStateByKey } from "../../platforms/cloudtentacles/session-state-service.js";
|
import { getCloudtentaclesSessionStateByKey } from "../../../platforms/cloudtentacles/session-state-service.js";
|
||||||
import {
|
import {
|
||||||
pickFirstNonEmpty,
|
pickFirstNonEmpty,
|
||||||
resolveCloudtentaclesAdminContext,
|
resolveCloudtentaclesAdminContext,
|
||||||
+1
-1
@@ -4,7 +4,7 @@ import {
|
|||||||
saveKuaishouCloudFulfillmentConfig,
|
saveKuaishouCloudFulfillmentConfig,
|
||||||
} from '../../order/kuaishou-cloud-fulfillment-config-service.js'
|
} from '../../order/kuaishou-cloud-fulfillment-config-service.js'
|
||||||
import { syncConfiguredFulfillmentBindings } from '../../bootstrap/fulfillment-bootstrap-service.js'
|
import { syncConfiguredFulfillmentBindings } from '../../bootstrap/fulfillment-bootstrap-service.js'
|
||||||
import { mapAdminKuaishouCloudFulfillmentSource } from './mappers.js'
|
import { mapAdminKuaishouCloudFulfillmentSource } from './cloudtentacles/mappers.js'
|
||||||
|
|
||||||
type JsonObject = Record<string, any>
|
type JsonObject = Record<string, any>
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import {
|
|||||||
saveKuaishouEticketSourceConfig,
|
saveKuaishouEticketSourceConfig,
|
||||||
} from '../../platforms/kuaishou-eticket/source-config-service.js'
|
} from '../../platforms/kuaishou-eticket/source-config-service.js'
|
||||||
import { queryKuaishouEticketStableInfo } from '../../platforms/kuaishou-eticket/info-service.js'
|
import { queryKuaishouEticketStableInfo } from '../../platforms/kuaishou-eticket/info-service.js'
|
||||||
import { resolveKuaishouEticketAdminContext } from './context.js'
|
import { resolveKuaishouEticketAdminContext } from './cloudtentacles/context.js'
|
||||||
import { mapAdminKuaishouEticketSourceConfig } from './mappers.js'
|
import { mapAdminKuaishouEticketSourceConfig } from './cloudtentacles/mappers.js'
|
||||||
|
|
||||||
type JsonObject = Record<string, any>
|
type JsonObject = Record<string, any>
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ import {
|
|||||||
reloadScheduledJobs,
|
reloadScheduledJobs,
|
||||||
runScheduledJobNow,
|
runScheduledJobNow,
|
||||||
} from '../../scheduler/scheduler-service.js'
|
} from '../../scheduler/scheduler-service.js'
|
||||||
import { maskPhone, maskSecret } from './mappers.js'
|
import { maskPhone, maskSecret } from './cloudtentacles/mappers.js'
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
AdminNotificationConfigInput,
|
AdminNotificationConfigInput,
|
||||||
AdminNotificationTestInput,
|
AdminNotificationTestInput,
|
||||||
AdminScheduledJobsConfigInput,
|
AdminScheduledJobsConfigInput,
|
||||||
} from '../../../types/admin-write-inputs.js'
|
} from '../../../types/admin/write-inputs.js'
|
||||||
|
|
||||||
type JsonObject = Record<string, any>
|
type JsonObject = Record<string, any>
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
maskPhone as maskPhoneValue,
|
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 = {
|
type TaskClaimLink = {
|
||||||
token: string
|
token: string
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ import {
|
|||||||
import type {
|
import type {
|
||||||
AdminEntityIdInput,
|
AdminEntityIdInput,
|
||||||
AdminViewerSessionInput,
|
AdminViewerSessionInput,
|
||||||
} from '../../../types/admin-read-inputs.js'
|
} from '../../../types/admin/read-inputs.js'
|
||||||
import type { AdminTaskKuaishouCloudDispatchInput } from '../../../types/admin-write-inputs.js'
|
import type { AdminTaskKuaishouCloudDispatchInput } from '../../../types/admin/write-inputs.js'
|
||||||
import type { AdminTaskActionResponse } from '../../../types/admin-write-models.js'
|
import type { AdminTaskActionResponse } from '../../../types/admin/write-models.js'
|
||||||
|
|
||||||
export async function prepareAdminTaskKuaishouCloudFulfillment(
|
export async function prepareAdminTaskKuaishouCloudFulfillment(
|
||||||
taskId: AdminEntityIdInput,
|
taskId: AdminEntityIdInput,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { formatFenToAmount, normalizeFen } from '../../utils/money.js'
|
|||||||
import { parseTaskContext as parseTaskContextValue } from '../../utils/task-json.js'
|
import { parseTaskContext as parseTaskContextValue } from '../../utils/task-json.js'
|
||||||
import { nowIso } from '../../utils/time.js'
|
import { nowIso } from '../../utils/time.js'
|
||||||
import { buildClaimUrl } from './claim-service.js'
|
import { buildClaimUrl } from './claim-service.js'
|
||||||
import type { ClaimTokenRow, OrderItemRow, OrderRow, TaskRow } from '../../types/repository-rows.js'
|
import type { ClaimTokenRow, OrderItemRow, OrderRow, TaskRow } from '../../types/repository/rows.js'
|
||||||
|
|
||||||
export const CLAIM_TERMINAL_STATUSES = new Set(['expired', 'closed'])
|
export const CLAIM_TERMINAL_STATUSES = new Set(['expired', 'closed'])
|
||||||
export const KUAISHOU_CLOUD_CLAIM_GUIDE_BASE_PATH = '/kuaishou-cloud-guide'
|
export const KUAISHOU_CLOUD_CLAIM_GUIDE_BASE_PATH = '/kuaishou-cloud-guide'
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
} from '../fulfillment/kuaishou-cloud/index.js'
|
} from '../fulfillment/kuaishou-cloud/index.js'
|
||||||
import { buildClaimDetailPayload, getClaimContext } from './kuaishou-cloud-claim-context.js'
|
import { buildClaimDetailPayload, getClaimContext } from './kuaishou-cloud-claim-context.js'
|
||||||
import { syncKuaishouCloudRoleInfo } from './kuaishou-cloud-sync-service.js'
|
import { syncKuaishouCloudRoleInfo } from './kuaishou-cloud-sync-service.js'
|
||||||
import type { TaskRow } from '../../types/repository-rows.js'
|
import type { TaskRow } from '../../types/repository/rows.js'
|
||||||
|
|
||||||
const KUAISHOU_CLOUD_GUIDE_DIR = path.resolve(PROJECT_ROOT, '../../tems/imgs')
|
const KUAISHOU_CLOUD_GUIDE_DIR = path.resolve(PROJECT_ROOT, '../../tems/imgs')
|
||||||
const ALLOWED_GUIDE_FILES = new Set(['1.png', '2.png', '3.png'])
|
const ALLOWED_GUIDE_FILES = new Set(['1.png', '2.png', '3.png'])
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
probeKuaishouCloudTaskBindUrl,
|
probeKuaishouCloudTaskBindUrl,
|
||||||
refreshKuaishouCloudTaskRoleInfo,
|
refreshKuaishouCloudTaskRoleInfo,
|
||||||
} from '../fulfillment/kuaishou-cloud/index.js'
|
} from '../fulfillment/kuaishou-cloud/index.js'
|
||||||
import type { TaskRow } from '../../types/repository-rows.js'
|
import type { TaskRow } from '../../types/repository/rows.js'
|
||||||
|
|
||||||
export async function syncKuaishouCloudRoleInfo(task: TaskRow) {
|
export async function syncKuaishouCloudRoleInfo(task: TaskRow) {
|
||||||
const flow = normalizeKuaishouCloudFlow(parseTaskContext(task).kuaishouCloudFulfillment)
|
const flow = normalizeKuaishouCloudFlow(parseTaskContext(task).kuaishouCloudFulfillment)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import {
|
|||||||
normalizeActor,
|
normalizeActor,
|
||||||
parseTaskContext,
|
parseTaskContext,
|
||||||
} from "./task-context.js";
|
} from "./task-context.js";
|
||||||
import type { TaskRow } from "../../../types/repository-rows.js";
|
import type { TaskRow } from "../../../types/repository/rows.js";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
isKuaishouCloudBindUrlFresh,
|
isKuaishouCloudBindUrlFresh,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { parseTaskContext as parseTaskContextValue } from "../../../utils/task-json.js";
|
import { parseTaskContext as parseTaskContextValue } from "../../../utils/task-json.js";
|
||||||
import type { TaskRow } from "../../../types/repository-rows.js";
|
import type { TaskRow } from "../../../types/repository/rows.js";
|
||||||
|
|
||||||
type JsonObject = Record<string, any>;
|
type JsonObject = Record<string, any>;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
} from "./domain.js";
|
} from "./domain.js";
|
||||||
import { resolvePersistedCloudtentaclesContextWithFallback } from "./cloudtentacles-context.js";
|
import { resolvePersistedCloudtentaclesContextWithFallback } from "./cloudtentacles-context.js";
|
||||||
import { normalizeActor, parseTaskContext } from "./task-context.js";
|
import { normalizeActor, parseTaskContext } from "./task-context.js";
|
||||||
import type { TaskRow } from "../../../types/repository-rows.js";
|
import type { TaskRow } from "../../../types/repository/rows.js";
|
||||||
|
|
||||||
export async function dispatchKuaishouCloudFulfillmentTask(
|
export async function dispatchKuaishouCloudFulfillmentTask(
|
||||||
task: TaskRow,
|
task: TaskRow,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {
|
|||||||
buildOpen91SuccessResponse,
|
buildOpen91SuccessResponse,
|
||||||
resolveOpen91QueryState,
|
resolveOpen91QueryState,
|
||||||
} from './response.js'
|
} from './response.js'
|
||||||
import type { OrderRow } from '../../types/repository-rows.js'
|
import type { OrderRow } from '../../types/repository/rows.js'
|
||||||
|
|
||||||
type JsonObject = Record<string, any>
|
type JsonObject = Record<string, any>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { createTaskClaimToken } from '../claim/claim-service.js'
|
|||||||
import { notifyTaskAutoManualReview } from '../notification/domain-notifications.js'
|
import { notifyTaskAutoManualReview } from '../notification/domain-notifications.js'
|
||||||
import { nowIso } from '../../utils/time.js'
|
import { nowIso } from '../../utils/time.js'
|
||||||
import { randomId } from '../../utils/random.js'
|
import { randomId } from '../../utils/random.js'
|
||||||
import type { OrderItemRow, OrderRow, TaskRow } from '../../types/repository-rows.js'
|
import type { OrderItemRow, OrderRow, TaskRow } from '../../types/repository/rows.js'
|
||||||
|
|
||||||
type JsonObject = Record<string, unknown>
|
type JsonObject = Record<string, unknown>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { syncDeliveryTasksForOrder } from './delivery-task-service.js'
|
|||||||
import { resolveOrderItemForFulfillment } from './product-match-service.js'
|
import { resolveOrderItemForFulfillment } from './product-match-service.js'
|
||||||
import { nowIso } from '../../utils/time.js'
|
import { nowIso } from '../../utils/time.js'
|
||||||
import { logIntegration } from '../../utils/logger.js'
|
import { logIntegration } from '../../utils/logger.js'
|
||||||
import type { OrderItemRow, OrderRow, TaskRow } from '../../types/repository-rows.js'
|
import type { OrderItemRow, OrderRow, TaskRow } from '../../types/repository/rows.js'
|
||||||
|
|
||||||
type SourceOrderItem = {
|
type SourceOrderItem = {
|
||||||
quantity?: number
|
quantity?: number
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { normalizeOpen91CreatePayload } from '../../open-91/payload.js'
|
|||||||
import { buildOpen91OutTradeNo } from '../../open-91/response.js'
|
import { buildOpen91OutTradeNo } from '../../open-91/response.js'
|
||||||
import { createHttpError } from '../../../utils/http.js'
|
import { createHttpError } from '../../../utils/http.js'
|
||||||
import { nowIso } from '../../../utils/time.js'
|
import { nowIso } from '../../../utils/time.js'
|
||||||
import type { OrderItemRow, OrderRow } from '../../../types/repository-rows.js'
|
import type { OrderItemRow, OrderRow } from '../../../types/repository/rows.js'
|
||||||
|
|
||||||
export const OPEN_91_PENDING_CONFIG_STATUS = 'pending_config'
|
export const OPEN_91_PENDING_CONFIG_STATUS = 'pending_config'
|
||||||
export const OPEN_91_MANUAL_FAILED_STATUS = 'manual_failed'
|
export const OPEN_91_MANUAL_FAILED_STATUS = 'manual_failed'
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import type {
|
|||||||
AdminOrderListQueryInput,
|
AdminOrderListQueryInput,
|
||||||
AdminTaskListQueryInput,
|
AdminTaskListQueryInput,
|
||||||
AdminViewerSessionInput,
|
AdminViewerSessionInput,
|
||||||
} from './admin-read-inputs.js'
|
} from './read-inputs.js'
|
||||||
import type {
|
import type {
|
||||||
AdminCloudtentaclesCatalogQueryInput,
|
AdminCloudtentaclesCatalogQueryInput,
|
||||||
AdminCloudtentaclesFullFlowInput,
|
AdminCloudtentaclesFullFlowInput,
|
||||||
@@ -23,7 +23,7 @@ import type {
|
|||||||
AdminScheduledJobsConfigInput,
|
AdminScheduledJobsConfigInput,
|
||||||
AdminTaskKuaishouCloudDispatchInput,
|
AdminTaskKuaishouCloudDispatchInput,
|
||||||
AdminTaskManualDispatchInput,
|
AdminTaskManualDispatchInput,
|
||||||
} from './admin-write-inputs.js'
|
} from './write-inputs.js'
|
||||||
|
|
||||||
export type AdminOrderRouteQuery = AdminOrderListQueryInput
|
export type AdminOrderRouteQuery = AdminOrderListQueryInput
|
||||||
export type AdminTaskRouteQuery = AdminTaskListQueryInput
|
export type AdminTaskRouteQuery = AdminTaskListQueryInput
|
||||||
Reference in New Issue
Block a user