断开快手后端旧依赖
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
export function normalizeAgisoMessageTemplate(value: unknown): string {
|
||||
return String(value || "")
|
||||
.replaceAll("\\r\\n", "\n")
|
||||
.replaceAll("\\n", "\n")
|
||||
.replaceAll("\r\n", "\n");
|
||||
}
|
||||
@@ -49,7 +49,7 @@ import {
|
||||
resolveAdminCloudtentaclesCredentialPayload,
|
||||
resolveAdminCloudtentaclesSessionPayload,
|
||||
} from "./cloudtentacles.js";
|
||||
import { normalizeAdminCloudtentaclesSourceConfigPayload } from "./writes.js";
|
||||
import { normalizeAdminCloudtentaclesSourceConfigPayload } from "./cloudtentacles-writes.js";
|
||||
import {
|
||||
mapAdminCloudtentaclesSession,
|
||||
mapAdminCloudtentaclesSourceConfig,
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
type JsonObject = Record<string, any>;
|
||||
|
||||
export function normalizeAdminCloudtentaclesSourceConfigPayload(
|
||||
payload: JsonObject = {}
|
||||
) {
|
||||
const sourceKey =
|
||||
String(payload.sourceKey || payload.key || "").trim() || "default";
|
||||
return {
|
||||
key: sourceKey,
|
||||
label: String(payload.label || "").trim(),
|
||||
enabled: payload.enabled !== false,
|
||||
baseUrl: String(payload.baseUrl || "").trim() || "https://123.207.217.176",
|
||||
username: String(payload.username || "").trim(),
|
||||
password: String(payload.password || "").trim(),
|
||||
phone: String(payload.phone || "").trim(),
|
||||
deviceId: String(payload.deviceId || "-").trim() || "-",
|
||||
deviceType: Number(payload.deviceType || 0),
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { normalizeAgisoMessageTemplate } from '../../platforms/agiso/xianyu/message-service.js'
|
||||
import { normalizeAgisoMessageTemplate } from './agiso-template.js'
|
||||
import { maskSecret } from './mappers.js'
|
||||
|
||||
type JsonObject = Record<string, any>
|
||||
|
||||
@@ -98,19 +98,3 @@ export function buildAdminAgisoMessagingSavePayload(
|
||||
shops: nextMap,
|
||||
};
|
||||
}
|
||||
|
||||
export function normalizeAdminCloudtentaclesSourceConfigPayload(payload: JsonObject = {}) {
|
||||
const sourceKey =
|
||||
String(payload.sourceKey || payload.key || "").trim() || "default";
|
||||
return {
|
||||
key: sourceKey,
|
||||
label: String(payload.label || "").trim(),
|
||||
enabled: payload.enabled !== false,
|
||||
baseUrl: String(payload.baseUrl || "").trim() || "https://123.207.217.176",
|
||||
username: String(payload.username || "").trim(),
|
||||
password: String(payload.password || "").trim(),
|
||||
phone: String(payload.phone || "").trim(),
|
||||
deviceId: String(payload.deviceId || "-").trim() || "-",
|
||||
deviceType: Number(payload.deviceType || 0),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user