@wishcbg/bobcode
Version:
基於店家同步功能的需求,讓店家能夠在不同的店家之間同步各項功能設定,並且能夠檢視各項功能的異動情況。 規劃出一套店家設定即程式碼的機制,讓店家能夠以 config file (.sac) 來定義各項功能設定,並且能夠還原店家各項功能設定。 暫且稱這個機制為「Settings as Code」「店家設定即程式碼」。
27 lines (26 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LineConfigResourceSchema = exports.lineConfigResourceSettingSchema = void 0;
const zod_1 = require("zod");
exports.lineConfigResourceSettingSchema = zod_1.z.object({
lineId: zod_1.z.string().describe('Line ID'),
channelId: zod_1.z.string().describe('Channel ID'),
channelSecret: zod_1.z.string().describe('Channel Secret'),
channelAccessToken: zod_1.z.string().describe('Channel Access Token'),
}).describe('LINE 串接設定');
// 改成export一個 config 而不是class
exports.LineConfigResourceSchema = {
// —— 基本欄位
resourceType: 'lineConfig',
resourceName: 'LINE 串接設定',
resourceSettingSchema: exports.lineConfigResourceSettingSchema,
// —— 關聯
relationScope: 'shop',
relationType: 'single',
relationResources: [],
// —— apply API path
applySingleUpdateApiPath: '/:shopId/lineConfig',
applyCreateApiPath: null,
applyUpdateApiPath: null,
applyDestroyApiPath: null,
};