cloudcc-cli 2.3.2 → 2.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.json +18 -2
- package/.cloudcc-cache.json +17 -1
- package/.cursor/skills/{cloudcc-cli-usage → cloudcc-dev-usage}/SKILL.md +3 -2
- package/README.md +22 -0
- package/bin/index.js +2 -0
- package/build/{component-CCPlugin1774500425584.common.js → component-cc-cc-dd.common.js} +25 -25
- package/build/component-cc-cc-dd.common.js.map +1 -0
- package/build/component-cc-cc-dd.css +1 -0
- package/build/{component-CCPlugin1774500425584.umd.js → component-cc-cc-dd.umd.js} +27 -27
- package/build/component-cc-cc-dd.umd.js.map +1 -0
- package/build/{component-CCPlugin1774500425584.umd.min.js → component-cc-cc-dd.umd.min.js} +3 -3
- package/build/component-cc-cc-dd.umd.min.js.map +1 -0
- package/build/demo.html +1 -1
- package/package.json +3 -2
- package/plugins/cc-cc-dd/cc-cc-dd.vue +32 -0
- package/plugins/cc-cc-dd/components/HelloWorld.vue +11 -0
- package/plugins/cc-cc-dd/config.json +6 -0
- package/src/classes/docs/devguide.md +90 -0
- package/src/fields/create.js +12 -0
- package/src/globalSelectList/docs/devguide.md +0 -59
- package/src/menu/create-object.js +1 -0
- package/src/menu/create-page.js +1 -0
- package/src/menu/create-script.js +1 -0
- package/src/menu/create-site.js +1 -0
- package/src/menu/docs/devguide.md +57 -131
- package/src/object/create.js +2 -1
- package/src/object/docs/devguide.md +1 -5
- package/src/pagelayout/create.js +2 -2
- package/src/pagelayout/delete.js +57 -0
- package/src/pagelayout/docs/devguide.md +17 -229
- package/src/pagelayout/get.js +9 -9
- package/src/pagelayout/index.js +1 -0
- package/src/plugin/docs/devguide.md +90 -17
- package/src/profile/docs/devguide.md +3 -258
- package/src/role/create.js +2 -1
- package/src/role/delete.js +1 -0
- package/src/role/docs/devguide.md +5 -311
- package/src/timer/docs/devguide.md +83 -1
- package/src/triggers/docs/devguide.md +108 -0
- package/src/user/create.js +502 -19
- package/src/user/docs/devguide.md +22 -534
- package/src/validationRule/create.js +153 -0
- package/src/validationRule/delete.js +60 -0
- package/src/validationRule/doc.js +46 -0
- package/src/validationRule/docs/devguide.md +76 -0
- package/src/validationRule/docs/introduction.md +122 -0
- package/src/validationRule/get.js +47 -0
- package/src/validationRule/index.js +10 -0
- package/build/component-CCPlugin1774500425584.common.js.map +0 -1
- package/build/component-CCPlugin1774500425584.css +0 -1
- package/build/component-CCPlugin1774500425584.umd.js.map +0 -1
- package/build/component-CCPlugin1774500425584.umd.min.js.map +0 -1
- package/tmp_customsetting_detail.json +0 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const inquirer = require('inquirer');
|
|
3
|
+
const { postClass } = require("../../utils/http");
|
|
4
|
+
const { getPackageJson } = require("../../utils/config");
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 创建验证规则
|
|
8
|
+
* 用法:cc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMessage]
|
|
9
|
+
* 流程:
|
|
10
|
+
* 1. 调用 validateRule/queryByPrefix 获取对象ID和现有规则列表
|
|
11
|
+
* 2. 交互式输入规则名称、规则内容、错误信息(未指定时)
|
|
12
|
+
* 3. 调用 validateRule/validateFunction 保存新规则
|
|
13
|
+
* @param {Array} argvs - 命令行参数数组
|
|
14
|
+
* @returns {Promise<Object>} 创建结果
|
|
15
|
+
*/
|
|
16
|
+
async function create(argvs) {
|
|
17
|
+
try {
|
|
18
|
+
// 命令行参数格式:cc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMessage]
|
|
19
|
+
const projectPath = argvs[2] || process.cwd();
|
|
20
|
+
const objectPrefix = argvs[3];
|
|
21
|
+
let ruleName = argvs[4] || '';
|
|
22
|
+
let ruleContent = argvs[5] || '';
|
|
23
|
+
let errorMessage = argvs[6] || '';
|
|
24
|
+
|
|
25
|
+
if (!objectPrefix) {
|
|
26
|
+
console.error();
|
|
27
|
+
console.error(chalk.red('Error: 缺少对象前缀'));
|
|
28
|
+
console.error('用法: cc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMessage]');
|
|
29
|
+
console.error('示例:');
|
|
30
|
+
console.error(' cc create validationRule . "b00" # 交互式输入所有信息');
|
|
31
|
+
console.error(' cc create validationRule . "b00" "规则1" "Batch_Size__c__f==5" "数量必须是5"');
|
|
32
|
+
console.error();
|
|
33
|
+
throw new Error('缺少必需参数: objectPrefix');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const config = await getPackageJson(projectPath);
|
|
37
|
+
if (!config || !config.accessToken) {
|
|
38
|
+
console.error();
|
|
39
|
+
console.error(chalk.red('Error: 配置未找到或 accessToken 缺失'));
|
|
40
|
+
console.error();
|
|
41
|
+
throw new Error('配置未找到或 accessToken 缺失');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console.error();
|
|
45
|
+
console.error(chalk.green(`Creating validation rule for object (${objectPrefix}), please wait...`));
|
|
46
|
+
console.error();
|
|
47
|
+
|
|
48
|
+
// 步骤1:调用 queryByPrefix 获取对象ID
|
|
49
|
+
console.error(chalk.blue('Step 1: 获取对象信息...'));
|
|
50
|
+
const queryRes = await postClass(
|
|
51
|
+
config.setupSvc + "/api/validateRule/queryByPrefix",
|
|
52
|
+
{ prefix: objectPrefix },
|
|
53
|
+
config.accessToken
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
if (!queryRes || !queryRes.result) {
|
|
57
|
+
const msg = queryRes && (queryRes.returnInfo || queryRes.message)
|
|
58
|
+
? (queryRes.returnInfo || queryRes.message)
|
|
59
|
+
: "获取对象信息失败";
|
|
60
|
+
throw new Error(msg);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const objId = queryRes.data?.objid;
|
|
64
|
+
if (!objId) {
|
|
65
|
+
throw new Error('无法获取对象ID,请检查对象前缀是否正确');
|
|
66
|
+
}
|
|
67
|
+
console.error(chalk.blue(`对象ID: ${objId}`));
|
|
68
|
+
|
|
69
|
+
// 步骤2:交互式输入规则信息
|
|
70
|
+
if (!ruleName) {
|
|
71
|
+
const result = await inquirer.prompt([
|
|
72
|
+
{
|
|
73
|
+
type: 'input',
|
|
74
|
+
name: 'ruleName',
|
|
75
|
+
message: '请输入规则名称:',
|
|
76
|
+
validate: (input) => input.trim() !== '' || '规则名称不能为空'
|
|
77
|
+
}
|
|
78
|
+
]);
|
|
79
|
+
ruleName = result.ruleName;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!ruleContent) {
|
|
83
|
+
const result = await inquirer.prompt([
|
|
84
|
+
{
|
|
85
|
+
type: 'input',
|
|
86
|
+
name: 'ruleContent',
|
|
87
|
+
message: '请输入规则内容(例如: Batch_Size__c__f==5):',
|
|
88
|
+
validate: (input) => input.trim() !== '' || '规则内容不能为空'
|
|
89
|
+
}
|
|
90
|
+
]);
|
|
91
|
+
ruleContent = result.ruleContent;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!errorMessage) {
|
|
95
|
+
const result = await inquirer.prompt([
|
|
96
|
+
{
|
|
97
|
+
type: 'input',
|
|
98
|
+
name: 'errorMessage',
|
|
99
|
+
message: '请输入错误提示信息:',
|
|
100
|
+
validate: (input) => input.trim() !== '' || '错误提示信息不能为空'
|
|
101
|
+
}
|
|
102
|
+
]);
|
|
103
|
+
errorMessage = result.errorMessage;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
console.error();
|
|
107
|
+
|
|
108
|
+
// 步骤3:调用 validateFunction 保存规则
|
|
109
|
+
console.error(chalk.blue('Step 2: 保存验证规则...'));
|
|
110
|
+
const validateData = {
|
|
111
|
+
objid: objId,
|
|
112
|
+
validate: {
|
|
113
|
+
name: ruleName,
|
|
114
|
+
description: "",
|
|
115
|
+
isactive: "true",
|
|
116
|
+
functionCode: ruleContent,
|
|
117
|
+
msgLocation: "top",
|
|
118
|
+
errorMessage: errorMessage,
|
|
119
|
+
objId: objId
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const saveRes = await postClass(
|
|
124
|
+
config.setupSvc + "/api/validateRule/validateFunction",
|
|
125
|
+
validateData,
|
|
126
|
+
config.accessToken
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
if (saveRes && saveRes.result) {
|
|
130
|
+
console.error();
|
|
131
|
+
console.error(chalk.green('Success! Validation rule created.'));
|
|
132
|
+
console.error(` 规则名称: ${ruleName}`);
|
|
133
|
+
console.error(` 对象前缀: ${objectPrefix}`);
|
|
134
|
+
console.error(` 对象ID: ${objId}`);
|
|
135
|
+
console.error(` 规则内容: ${ruleContent}`);
|
|
136
|
+
console.error(` 错误信息: ${errorMessage}`);
|
|
137
|
+
console.error();
|
|
138
|
+
return saveRes;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const msg = saveRes && (saveRes.returnInfo || saveRes.message)
|
|
142
|
+
? (saveRes.returnInfo || saveRes.message)
|
|
143
|
+
: "Unknown error";
|
|
144
|
+
throw new Error("Save ValidationRule Failed: " + msg);
|
|
145
|
+
|
|
146
|
+
} catch (error) {
|
|
147
|
+
console.error();
|
|
148
|
+
console.error(chalk.red("验证规则创建失败:"), error.message || error);
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
module.exports = create;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const chalk = require("chalk");
|
|
2
|
+
const { postClass } = require("../../utils/http");
|
|
3
|
+
const { getPackageJson } = require("../../utils/config");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 删除验证规则
|
|
7
|
+
* 用法:cc delete validationRule <projectPath> <ruleId>
|
|
8
|
+
*/
|
|
9
|
+
async function remove(argvs) {
|
|
10
|
+
try {
|
|
11
|
+
const projectPath = argvs[2] || process.cwd();
|
|
12
|
+
const ruleId = argvs[3];
|
|
13
|
+
|
|
14
|
+
if (!ruleId) {
|
|
15
|
+
console.error();
|
|
16
|
+
console.error(chalk.red("Error: 缺少规则 ID"));
|
|
17
|
+
console.error(chalk.yellow("用法: cc delete validationRule <projectPath> <ruleId>"));
|
|
18
|
+
console.error();
|
|
19
|
+
throw new Error("缺少必需参数: ruleId");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const config = await getPackageJson(projectPath);
|
|
23
|
+
if (!config || !config.accessToken) {
|
|
24
|
+
console.error();
|
|
25
|
+
console.error(chalk.red("Error: 配置未找到或 accessToken 缺失"));
|
|
26
|
+
console.error();
|
|
27
|
+
throw new Error("配置未找到或 accessToken 缺失");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.error();
|
|
31
|
+
console.error(chalk.green(`Deleting validation rule (${ruleId}), please wait...`));
|
|
32
|
+
console.error();
|
|
33
|
+
|
|
34
|
+
const result = await postClass(
|
|
35
|
+
config.setupSvc + "/api/validateRule/delete",
|
|
36
|
+
{ id: ruleId },
|
|
37
|
+
config.accessToken
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
if (result && result.result) {
|
|
41
|
+
console.error();
|
|
42
|
+
console.error(chalk.green("Success! Validation rule deleted."));
|
|
43
|
+
console.error(chalk.blue("返回结果:"), JSON.stringify(result, null, 2));
|
|
44
|
+
console.error();
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const msg = result && (result.returnInfo || result.message) ? (result.returnInfo || result.message) : "Unknown error";
|
|
49
|
+
console.error();
|
|
50
|
+
console.error(chalk.red("Error: " + msg));
|
|
51
|
+
console.error();
|
|
52
|
+
throw new Error("Delete ValidationRule Failed: " + msg);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.error();
|
|
55
|
+
console.error(chalk.red("验证规则删除失败:"), error);
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = remove;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* validationRule 文档入口:正文均在 `docs/` 目录。
|
|
3
|
+
*/
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
const DOCS_DIR = path.join(__dirname, "docs");
|
|
8
|
+
|
|
9
|
+
function readDocFile(basename) {
|
|
10
|
+
return fs.readFileSync(path.join(DOCS_DIR, `${basename}.md`), "utf8");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** 介绍文档:验证规则能力 */
|
|
14
|
+
function getIntroductionDoc() {
|
|
15
|
+
return readDocFile("introduction");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** 开发指导:CLI 创建/查询/删除等 */
|
|
19
|
+
function getDevGuideDoc() {
|
|
20
|
+
return readDocFile("devguide");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* cc doc validationRule <introduction|devguide>
|
|
25
|
+
* @param {string[]} argvs [doc, type, introduction|devguide, ...]
|
|
26
|
+
*/
|
|
27
|
+
function doc(argvs) {
|
|
28
|
+
const subType = argvs[2];
|
|
29
|
+
const key = String(subType || "").trim().toLowerCase();
|
|
30
|
+
if (!key) {
|
|
31
|
+
throw new Error("cc doc validationRule 需要子命令:introduction 或 devguide");
|
|
32
|
+
}
|
|
33
|
+
if (key === "introduction") {
|
|
34
|
+
const content = getIntroductionDoc();
|
|
35
|
+
console.log(content);
|
|
36
|
+
return content;
|
|
37
|
+
}
|
|
38
|
+
if (key === "devguide") {
|
|
39
|
+
const content = getDevGuideDoc();
|
|
40
|
+
console.log(content);
|
|
41
|
+
return content;
|
|
42
|
+
}
|
|
43
|
+
throw new Error(`doc 不支持的子命令: ${subType},请使用 introduction 或 devguide`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = doc;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# CloudCC 验证规则 CLI 命令说明
|
|
2
|
+
|
|
3
|
+
## 支持的命令
|
|
4
|
+
|
|
5
|
+
| 操作 | 说明 |
|
|
6
|
+
|------|------|
|
|
7
|
+
| `create` | 创建新验证规则 |
|
|
8
|
+
| `get` | 查询验证规则列表 |
|
|
9
|
+
| `delete` | 删除验证规则 |
|
|
10
|
+
|
|
11
|
+
## CLI 命令详解
|
|
12
|
+
|
|
13
|
+
### 创建验证规则
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMessage]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**参数说明:**
|
|
20
|
+
|
|
21
|
+
| 参数 | 必填 | 说明 |
|
|
22
|
+
|------|------|------|
|
|
23
|
+
| `path` | 是 | 项目路径,`.` 表示当前目录 |
|
|
24
|
+
| `objectPrefix` | 是 | 对象前缀,如 `b00` |
|
|
25
|
+
| `ruleName` | 否 | 规则名称(不传则交互式输入) |
|
|
26
|
+
| `ruleContent` | 否 | 规则内容,如 `Batch_Size__c__f==5`(不传则交互式输入) |
|
|
27
|
+
| `errorMessage` | 否 | 错误提示信息(不传则交互式输入) |
|
|
28
|
+
|
|
29
|
+
**示例:**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# 交互式输入所有信息
|
|
33
|
+
cc create validationRule . "b00"
|
|
34
|
+
|
|
35
|
+
# 非交互式创建
|
|
36
|
+
cc create validationRule . "b00" "规则1" "Batch_Size__c__f==5" "数量必须是5"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 查询验证规则列表
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cc get validationRule <projectPath> <objectPrefix>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**参数说明:**
|
|
46
|
+
|
|
47
|
+
| 参数 | 必填 | 说明 |
|
|
48
|
+
|------|------|------|
|
|
49
|
+
| `projectPath` | 否 | 项目路径,默认当前目录 |
|
|
50
|
+
| `objectPrefix` | 是 | 对象前缀,如 `b00` |
|
|
51
|
+
|
|
52
|
+
**示例:**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# 获取对象 b00 的所有验证规则
|
|
56
|
+
cc get validationRule . "b00"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 删除验证规则
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cc delete validationRule <projectPath> <ruleId>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**参数说明:**
|
|
66
|
+
|
|
67
|
+
| 参数 | 必填 | 说明 |
|
|
68
|
+
|------|------|------|
|
|
69
|
+
| `projectPath` | 否 | 项目路径,默认当前目录 |
|
|
70
|
+
| `ruleId` | 是 | 规则 ID |
|
|
71
|
+
|
|
72
|
+
**示例:**
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
cc delete validationRule . 202689E55795D38oAQlN
|
|
76
|
+
```
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# CloudCC 验证规则使用总结
|
|
2
|
+
|
|
3
|
+
验证规则(Validation Rule)用于在数据保存前进行校验,确保数据的完整性和正确性。当数据不符合规则时,系统会显示错误信息阻止保存。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 快速开始(CLI 命令)
|
|
8
|
+
|
|
9
|
+
### 支持的验证规则操作
|
|
10
|
+
|
|
11
|
+
| 操作 | 说明 |
|
|
12
|
+
|------|------|
|
|
13
|
+
| `create` | 创建新验证规则 |
|
|
14
|
+
| `get` | 查询验证规则列表 |
|
|
15
|
+
| `delete` | 删除验证规则 |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## CLI 命令详解
|
|
20
|
+
|
|
21
|
+
### 创建验证规则
|
|
22
|
+
|
|
23
|
+
创建一个新的 CloudCC 验证规则。
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMessage]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**参数说明:**
|
|
30
|
+
|
|
31
|
+
| 参数 | 必填 | 说明 |
|
|
32
|
+
|------|------|------|
|
|
33
|
+
| `path` | 是 | 项目路径,`.` 表示当前目录 |
|
|
34
|
+
| `objectPrefix` | 是 | 对象前缀,如 `b00` |
|
|
35
|
+
| `ruleName` | 否 | 规则名称(不传则交互式输入) |
|
|
36
|
+
| `ruleContent` | 否 | 规则内容,如 `Batch_Size__c__f==5`(不传则交互式输入) |
|
|
37
|
+
| `errorMessage` | 否 | 错误提示信息(不传则交互式输入) |
|
|
38
|
+
|
|
39
|
+
**示例:**
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 交互式输入所有信息
|
|
43
|
+
cc create validationRule . "b00"
|
|
44
|
+
|
|
45
|
+
# 非交互式创建
|
|
46
|
+
cc create validationRule . "b00" "规则1" "Batch_Size__c__f==5" "数量必须是5"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### 查询验证规则列表
|
|
52
|
+
|
|
53
|
+
获取指定对象的所有验证规则列表。
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cc get validationRule <projectPath> <objectPrefix>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**参数说明:**
|
|
60
|
+
|
|
61
|
+
| 参数 | 必填 | 说明 |
|
|
62
|
+
|------|------|------|
|
|
63
|
+
| `projectPath` | 否 | 项目路径,默认当前目录 |
|
|
64
|
+
| `objectPrefix` | 是 | 对象前缀,如 `b00` |
|
|
65
|
+
|
|
66
|
+
**示例:**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# 获取对象 b00 的所有验证规则
|
|
70
|
+
cc get validationRule . "b00"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### 删除验证规则
|
|
76
|
+
|
|
77
|
+
删除指定的验证规则。
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cc delete validationRule <projectPath> <ruleId>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**参数说明:**
|
|
84
|
+
|
|
85
|
+
| 参数 | 必填 | 说明 |
|
|
86
|
+
|------|------|------|
|
|
87
|
+
| `projectPath` | 否 | 项目路径,默认当前目录 |
|
|
88
|
+
| `ruleId` | 是 | 规则 ID |
|
|
89
|
+
|
|
90
|
+
**示例:**
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# 删除指定规则
|
|
94
|
+
cc delete validationRule . 202689E55795D38oAQlN
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 完整工作流示例
|
|
100
|
+
|
|
101
|
+
### 场景:为订单对象创建验证规则
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# 1. 确认项目已初始化(有 cloudcc-cli.config.js)
|
|
105
|
+
cat cloudcc-cli.config.js
|
|
106
|
+
|
|
107
|
+
# 2. 查询对象现有的验证规则
|
|
108
|
+
cc get validationRule . "b00"
|
|
109
|
+
|
|
110
|
+
# 3. 创建新验证规则
|
|
111
|
+
cc create validationRule . "b00"
|
|
112
|
+
|
|
113
|
+
# 4. 验证规则创建成功
|
|
114
|
+
cc get validationRule . "b00"
|
|
115
|
+
|
|
116
|
+
# 5. 如需删除
|
|
117
|
+
# cc delete validationRule . <ruleId>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
*文档版本:1.0 | 最后更新:2026-03-27*
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const { postClass } = require("../../utils/http");
|
|
2
|
+
const { getPackageJson } = require("../../utils/config");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 查询验证规则列表
|
|
6
|
+
* 用法:cc get validationRule <projectPath> <objectPrefix>
|
|
7
|
+
* 接口:POST /api/validateRule/queryByPrefix
|
|
8
|
+
* 参数:{ prefix: "b00" }
|
|
9
|
+
*/
|
|
10
|
+
async function get(argvs, isMcp = false) {
|
|
11
|
+
const projectPath = argvs[2] || process.cwd();
|
|
12
|
+
const objectPrefix = argvs[3];
|
|
13
|
+
|
|
14
|
+
if (!objectPrefix) {
|
|
15
|
+
const msg = "缺少对象前缀参数";
|
|
16
|
+
if (!isMcp) {
|
|
17
|
+
console.error(msg);
|
|
18
|
+
}
|
|
19
|
+
throw new Error("Get ValidationRule Failed: " + msg);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const body = { prefix: objectPrefix };
|
|
23
|
+
|
|
24
|
+
const config = await getPackageJson(projectPath);
|
|
25
|
+
const res = await postClass(
|
|
26
|
+
config.setupSvc + "/api/validateRule/queryByPrefix",
|
|
27
|
+
body,
|
|
28
|
+
config.accessToken
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
if (res && res.result) {
|
|
32
|
+
const data = res.data;
|
|
33
|
+
let rawList = [];
|
|
34
|
+
if (data && Array.isArray(data.list)) {
|
|
35
|
+
rawList = data.list;
|
|
36
|
+
}
|
|
37
|
+
if (!isMcp) {
|
|
38
|
+
console.log(JSON.stringify(rawList));
|
|
39
|
+
}
|
|
40
|
+
return rawList;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const msg = res && (res.returnInfo || res.message) ? (res.returnInfo || res.message) : "Unknown error";
|
|
44
|
+
throw new Error("Get ValidationRule Failed: " + msg);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = get;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-CCPlugin1774500425584.common.js","mappings":";;UAAA;UACA;;;;;WCDA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA,2B;;;;;;;ACAA;AACA;;AAEA;AACA;AACA,MAAM,KAAuC,EAAE;AAAA,yBAQ5C;;AAEH;AACA;AACA,IAAI,qBAAuB;AAC3B;AACA;;AAEA;AACA,oDAAe,IAAI;;;ACtBnB,MAAM,4DAA4B,kB;;;ACAlC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,iCAAiC,2CAA2C,gBAAgB,kBAAkB,OAAO,2BAA2B,wDAAwD,gCAAgC,uDAAuD,+DAA+D,yDAAyD,qEAAqE,6DAA6D,wBAAwB;;AAEjjB,kDAAkD,0CAA0C;;AAE5F,kDAAkD,aAAa,yFAAyF;;AAExJ,2CAA2C,+DAA+D,uGAAuG,yEAAyE,eAAe,0EAA0E,GAAG;;AAEtX;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qGAAqG,qBAAqB,mBAAmB;;AAE7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA,qFAAqF,aAAa;AAClG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;;AAEA;AACA;AACA;;AAEA,sEAAsE,aAAa;AACnF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,iCAAiC;AACjC,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,YAAY;AACZ;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,6DAAe,OAAO,EAAC;;;ACziBvB,0BAA0B,aAAa,0BAA0B,wBAAwB,iBAAiB,2BAA2B;AACrI;;;;ACDA,IAAI,0DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB;AACzF,IAAI,mEAAe;;;;;;;;;;ACKnB,wEAAe,EAAE,EAAC;;;ACNuJ,CAAC,mFAAe,iCAAG,EAAC,C;;ACA7L;;AAEA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AC/FoG;AACvC;AACL;;;AAGxD;AACA,CAAuI;AACvI,gBAAgB,kBAAU;AAC1B,EAAE,4CAAM;AACR,EAAE,0DAAM;AACR,EAAE,mEAAe;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA,iDAAe,iB;;;;;;;;;ACXsC;AACrD,mFAAe;AACf;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;ACxB+K,CAAC,yGAAe,4CAAG,EAAC,C;;ACArM;;;;;AEA+G;AACvC;AACL;AACnE,CAA8G;;;AAG9G;AACoI;AACpI,IAAI,+BAAS,GAAG,kBAAU;AAC1B,EAAE,kEAAM;AACR,EAAE,MAAM;AACR,EAAE,eAAe;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA,4DAAe,+BAAS,Q;;ACnBxB;AACA,YAAiC;AACjC,YAA6D;AAC7D,YAAY,0DAAO,CAAC,sBAAgB;AACpC;AACA,YAAiF;AACjF,YAAY,oEAAiB,oCAAoC,qBAAK,GAAG,yBAAyB;AAClG,Q;;ACPwB;AACF","sources":["webpack://cloudcc-cli/webpack/bootstrap","webpack://cloudcc-cli/webpack/runtime/compat get default export","webpack://cloudcc-cli/webpack/runtime/define property getters","webpack://cloudcc-cli/webpack/runtime/hasOwnProperty shorthand","webpack://cloudcc-cli/webpack/runtime/publicPath","webpack://cloudcc-cli/../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://cloudcc-cli/external commonjs2 {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://cloudcc-cli/./node_modules/vue-custom-element/dist/vue-custom-element.esm.js","webpack://cloudcc-cli/./plugins/CCPlugin1774500425584/CCPlugin1774500425584.vue?9833","webpack://cloudcc-cli/./plugins/CCPlugin1774500425584/components/HelloWorld.vue?3b55","webpack://cloudcc-cli/plugins/CCPlugin1774500425584/components/HelloWorld.vue","webpack://cloudcc-cli/./plugins/CCPlugin1774500425584/components/HelloWorld.vue?6d6c","webpack://cloudcc-cli/../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js","webpack://cloudcc-cli/./plugins/CCPlugin1774500425584/components/HelloWorld.vue","webpack://cloudcc-cli/plugins/CCPlugin1774500425584/CCPlugin1774500425584.vue","webpack://cloudcc-cli/./plugins/CCPlugin1774500425584/CCPlugin1774500425584.vue?85a6","webpack://cloudcc-cli/./plugins/CCPlugin1774500425584/CCPlugin1774500425584.vue?d9c4","webpack://cloudcc-cli/./plugins/CCPlugin1774500425584/CCPlugin1774500425584.vue?a0a4","webpack://cloudcc-cli/./plugins/CCPlugin1774500425584/CCPlugin1774500425584.vue","webpack://cloudcc-cli/./plugins/plginTemp.js","webpack://cloudcc-cli/../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.p = \"\";","/* eslint-disable no-var */\n// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"vue\");","/**\n * vue-custom-element v3.3.0\n * (c) 2021 Karol Fabjańczuk\n * @license MIT\n */\n/**\n * ES6 Object.getPrototypeOf Polyfill\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf\n */\n\nObject.setPrototypeOf = Object.setPrototypeOf || setPrototypeOf;\n\nfunction setPrototypeOf(obj, proto) {\n obj.__proto__ = proto;\n return obj;\n}\n\nvar setPrototypeOf_1 = setPrototypeOf.bind(Object);\n\nfunction isES2015() {\n if (typeof Symbol === 'undefined' || typeof Reflect === 'undefined' || typeof Proxy === 'undefined' || Object.isSealed(Proxy)) return false;\n\n return true;\n}\n\nvar isES2015$1 = isES2015();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _CustomElement() {\n return Reflect.construct(HTMLElement, [], this.__proto__.constructor);\n}\n\n\nObject.setPrototypeOf(_CustomElement.prototype, HTMLElement.prototype);\nObject.setPrototypeOf(_CustomElement, HTMLElement);\nfunction registerCustomElement(tag) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (typeof customElements === 'undefined') {\n return;\n }\n\n function constructorCallback() {\n if (options.shadow === true && HTMLElement.prototype.attachShadow) {\n this.attachShadow({ mode: 'open' });\n }\n typeof options.constructorCallback === 'function' && options.constructorCallback.call(this);\n }\n function connectedCallback() {\n typeof options.connectedCallback === 'function' && options.connectedCallback.call(this);\n }\n\n function disconnectedCallback() {\n typeof options.disconnectedCallback === 'function' && options.disconnectedCallback.call(this);\n }\n\n function attributeChangedCallback(name, oldValue, value) {\n typeof options.attributeChangedCallback === 'function' && options.attributeChangedCallback.call(this, name, oldValue, value);\n }\n\n function define(tagName, CustomElement) {\n var existingCustomElement = customElements.get(tagName);\n return typeof existingCustomElement !== 'undefined' ? existingCustomElement : customElements.define(tagName, CustomElement);\n }\n\n if (isES2015$1) {\n var CustomElement = function (_CustomElement2) {\n _inherits(CustomElement, _CustomElement2);\n\n function CustomElement(self) {\n var _ret;\n\n _classCallCheck(this, CustomElement);\n\n var _this = _possibleConstructorReturn(this, (CustomElement.__proto__ || Object.getPrototypeOf(CustomElement)).call(this));\n\n var me = self ? HTMLElement.call(self) : _this;\n\n constructorCallback.call(me);\n return _ret = me, _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(CustomElement, null, [{\n key: 'observedAttributes',\n get: function get() {\n return options.observedAttributes || [];\n }\n }]);\n\n return CustomElement;\n }(_CustomElement);\n\n CustomElement.prototype.connectedCallback = connectedCallback;\n CustomElement.prototype.disconnectedCallback = disconnectedCallback;\n CustomElement.prototype.attributeChangedCallback = attributeChangedCallback;\n\n define(tag, CustomElement);\n return CustomElement;\n } else {\n var _CustomElement3 = function _CustomElement3(self) {\n var me = self ? HTMLElement.call(self) : this;\n\n constructorCallback.call(me);\n return me;\n };\n\n _CustomElement3.observedAttributes = options.observedAttributes || [];\n\n _CustomElement3.prototype = Object.create(HTMLElement.prototype, {\n constructor: {\n configurable: true,\n writable: true,\n value: _CustomElement3\n }\n });\n\n _CustomElement3.prototype.connectedCallback = connectedCallback;\n _CustomElement3.prototype.disconnectedCallback = disconnectedCallback;\n _CustomElement3.prototype.attributeChangedCallback = attributeChangedCallback;\n\n define(tag, _CustomElement3);\n return _CustomElement3;\n }\n}\n\nvar camelizeRE = /-(\\w)/g;\nvar camelize = function camelize(str) {\n return str.replace(camelizeRE, function (_, c) {\n return c ? c.toUpperCase() : '';\n });\n};\nvar hyphenateRE = /([^-])([A-Z])/g;\nvar hyphenate = function hyphenate(str) {\n return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();\n};\n\nfunction toArray(list) {\n var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var i = list.length - start;\n var ret = new Array(i);\n while (i--) {\n ret[i] = list[i + start];\n }\n return ret;\n}\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction convertAttributeValue(value, overrideType) {\n if (value === null || value === undefined) {\n return overrideType === Boolean ? false : undefined;\n }\n var propsValue = value;\n var isBoolean = ['true', 'false'].indexOf(value) > -1;\n var valueParsed = parseFloat(propsValue, 10);\n var isNumber = !isNaN(valueParsed) && isFinite(propsValue) && typeof propsValue === 'string' && !propsValue.match(/^0+[^.]\\d*$/g);\n\n if (overrideType && overrideType !== Boolean && (typeof propsValue === 'undefined' ? 'undefined' : _typeof(propsValue)) !== overrideType) {\n propsValue = overrideType(value);\n } else if (isBoolean || overrideType === Boolean) {\n propsValue = propsValue === '' ? true : propsValue === 'true' || propsValue === true;\n } else if (isNumber) {\n propsValue = valueParsed;\n }\n\n return propsValue;\n}\n\nfunction extractProps(collection, props) {\n if (collection && collection.length) {\n collection.forEach(function (prop) {\n var camelCaseProp = camelize(prop);\n props.camelCase.indexOf(camelCaseProp) === -1 && props.camelCase.push(camelCaseProp);\n });\n } else if (collection && (typeof collection === 'undefined' ? 'undefined' : _typeof(collection)) === 'object') {\n for (var prop in collection) {\n var camelCaseProp = camelize(prop);\n props.camelCase.indexOf(camelCaseProp) === -1 && props.camelCase.push(camelCaseProp);\n\n if (collection[camelCaseProp] && collection[camelCaseProp].type) {\n props.types[prop] = [].concat(collection[camelCaseProp].type)[0];\n }\n }\n }\n}\n\nfunction getProps() {\n var componentDefinition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var props = {\n camelCase: [],\n hyphenate: [],\n types: {}\n };\n\n if (componentDefinition.mixins) {\n componentDefinition.mixins.forEach(function (mixin) {\n extractProps(mixin.props, props);\n });\n }\n\n if (componentDefinition.extends && componentDefinition.extends.props) {\n var parentProps = componentDefinition.extends.props;\n\n\n extractProps(parentProps, props);\n }\n\n extractProps(componentDefinition.props, props);\n\n props.camelCase.forEach(function (prop) {\n props.hyphenate.push(hyphenate(prop));\n });\n\n return props;\n}\n\nfunction reactiveProps(element, props) {\n props.camelCase.forEach(function (name, index) {\n Object.defineProperty(element, name, {\n get: function get() {\n return this.__vue_custom_element__[name];\n },\n set: function set(value) {\n if (((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' || typeof value === 'function') && this.__vue_custom_element__) {\n var propName = props.camelCase[index];\n this.__vue_custom_element__[propName] = value;\n } else {\n var type = props.types[props.camelCase[index]];\n this.setAttribute(props.hyphenate[index], convertAttributeValue(value, type));\n }\n }\n });\n });\n}\n\nfunction getPropsData(element, componentDefinition, props) {\n var propsData = componentDefinition.propsData || {};\n\n props.hyphenate.forEach(function (name, index) {\n var propCamelCase = props.camelCase[index];\n var propValue = element.attributes[name] || element[propCamelCase];\n\n var type = null;\n if (props.types[propCamelCase]) {\n type = props.types[propCamelCase];\n }\n\n if (propValue instanceof Attr) {\n propsData[propCamelCase] = convertAttributeValue(propValue.value, type);\n } else if (typeof propValue !== 'undefined') {\n propsData[propCamelCase] = propValue;\n }\n });\n\n return propsData;\n}\n\nfunction getAttributes(children) {\n var attributes = {};\n\n toArray(children.attributes).forEach(function (attribute) {\n attributes[attribute.nodeName === 'vue-slot' ? 'slot' : attribute.nodeName] = attribute.nodeValue;\n });\n\n return attributes;\n}\n\nfunction getChildNodes(element) {\n if (element.childNodes.length) return element.childNodes;\n if (element.content && element.content.childNodes && element.content.childNodes.length) {\n return element.content.childNodes;\n }\n\n var placeholder = document.createElement('div');\n\n placeholder.innerHTML = element.innerHTML;\n\n return placeholder.childNodes;\n}\n\nfunction templateElement(createElement, element, elementOptions) {\n var templateChildren = getChildNodes(element);\n\n var vueTemplateChildren = toArray(templateChildren).map(function (child) {\n if (child.nodeName === '#text') return child.nodeValue;\n\n return createElement(child.tagName, {\n attrs: getAttributes(child),\n domProps: {\n innerHTML: child.innerHTML\n }\n });\n });\n\n elementOptions.slot = element.id;\n\n return createElement('template', elementOptions, vueTemplateChildren);\n}\n\nfunction getSlots() {\n var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var createElement = arguments[1];\n\n var slots = [];\n toArray(children).forEach(function (child) {\n if (child.nodeName === '#text') {\n if (child.nodeValue.trim()) {\n slots.push(createElement('span', child.nodeValue));\n }\n } else if (child.nodeName !== '#comment') {\n var attributes = getAttributes(child);\n var elementOptions = {\n attrs: attributes,\n domProps: {\n innerHTML: child.innerHTML === '' ? child.innerText : child.innerHTML\n }\n };\n\n if (attributes.slot) {\n elementOptions.slot = attributes.slot;\n attributes.slot = undefined;\n }\n\n var slotVueElement = child.tagName === 'TEMPLATE' ? templateElement(createElement, child, elementOptions) : createElement(child.tagName, elementOptions);\n\n slots.push(slotVueElement);\n }\n });\n\n return slots;\n}\n\nfunction customEvent(eventName, detail) {\n var params = { bubbles: false, cancelable: false, detail: detail };\n var event = void 0;\n if (typeof window.CustomEvent === 'function') {\n event = new CustomEvent(eventName, params);\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail);\n }\n return event;\n}\n\nfunction customEmit(element, eventName) {\n for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n var event = customEvent(eventName, [].concat(args));\n element.dispatchEvent(event);\n}\n\nfunction createVueInstance(element, Vue, componentDefinition, props, options) {\n if (element.__vue_custom_element__) {\n return Promise.resolve(element);\n }\n var ComponentDefinition = Vue.util.extend({}, componentDefinition);\n var propsData = getPropsData(element, ComponentDefinition, props);\n var vueVersion = Vue.version && parseInt(Vue.version.split('.')[0], 10) || 0;\n\n function beforeCreate() {\n this.$emit = function emit() {\n var _proto__$$emit;\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n customEmit.apply(undefined, [element].concat(args));\n this.__proto__ && (_proto__$$emit = this.__proto__.$emit).call.apply(_proto__$$emit, [this].concat(args));\n };\n }\n ComponentDefinition.beforeCreate = [].concat(ComponentDefinition.beforeCreate || [], beforeCreate);\n\n if (ComponentDefinition._compiled) {\n var constructorOptions = {};\n var _constructor = ComponentDefinition._Ctor;\n if (_constructor) {\n constructorOptions = Object.keys(_constructor).map(function (key) {\n return _constructor[key];\n })[0].options;\n }\n constructorOptions.beforeCreate = ComponentDefinition.beforeCreate;\n }\n\n var rootElement = void 0;\n\n if (vueVersion >= 2) {\n var elementOriginalChildren = element.cloneNode(true).childNodes;\n rootElement = {\n propsData: propsData,\n props: props.camelCase,\n computed: {\n reactiveProps: function reactiveProps$$1() {\n var _this = this;\n\n var reactivePropsList = {};\n props.camelCase.forEach(function (prop) {\n typeof _this[prop] !== 'undefined' && (reactivePropsList[prop] = _this[prop]);\n });\n\n return reactivePropsList;\n }\n },\n render: function render(createElement) {\n var data = {\n props: this.reactiveProps\n };\n\n return createElement(ComponentDefinition, data, getSlots(elementOriginalChildren, createElement));\n }\n };\n } else if (vueVersion === 1) {\n rootElement = ComponentDefinition;\n rootElement.propsData = propsData;\n } else {\n rootElement = ComponentDefinition;\n var propsWithDefault = {};\n Object.keys(propsData).forEach(function (prop) {\n propsWithDefault[prop] = { default: propsData[prop] };\n });\n rootElement.props = propsWithDefault;\n }\n\n var elementInnerHtml = vueVersion >= 2 ? '<div></div>' : ('<div>' + element.innerHTML + '</div>').replace(/vue-slot=/g, 'slot=');\n if (options.shadow && element.shadowRoot) {\n element.shadowRoot.innerHTML = elementInnerHtml;\n rootElement.el = element.shadowRoot.children[0];\n } else {\n element.innerHTML = elementInnerHtml;\n rootElement.el = element.children[0];\n }\n\n if (options.shadow && options.shadowCss && element.shadowRoot) {\n var style = document.createElement('style');\n style.type = 'text/css';\n style.appendChild(document.createTextNode(options.shadowCss));\n\n element.shadowRoot.appendChild(style);\n }\n\n reactiveProps(element, props);\n\n if (typeof options.beforeCreateVueInstance === 'function') {\n rootElement = options.beforeCreateVueInstance(rootElement) || rootElement;\n }\n\n return Promise.resolve(rootElement).then(function (vueOpts) {\n element.__vue_custom_element__ = new Vue(vueOpts);\n element.__vue_custom_element_props__ = props;\n element.getVueInstance = function () {\n var vueInstance = element.__vue_custom_element__;\n return vueInstance.$children.length ? vueInstance.$children[0] : vueInstance;\n };\n\n element.removeAttribute('vce-cloak');\n element.setAttribute('vce-ready', '');\n customEmit(element, 'vce-ready');\n return element;\n });\n}\n\nfunction install(Vue) {\n Vue.customElement = function vueCustomElement(tag, componentDefinition) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var isAsyncComponent = typeof componentDefinition === 'function';\n var optionsProps = isAsyncComponent && { props: options.props || [] };\n var props = getProps(isAsyncComponent ? optionsProps : componentDefinition);\n\n var CustomElement = registerCustomElement(tag, {\n constructorCallback: function constructorCallback() {\n typeof options.constructorCallback === 'function' && options.constructorCallback.call(this);\n },\n connectedCallback: function connectedCallback() {\n var _this = this;\n\n var asyncComponentPromise = isAsyncComponent && componentDefinition();\n var isAsyncComponentPromise = asyncComponentPromise && asyncComponentPromise.then && typeof asyncComponentPromise.then === 'function';\n\n typeof options.connectedCallback === 'function' && options.connectedCallback.call(this);\n\n if (isAsyncComponent && !isAsyncComponentPromise) {\n throw new Error('Async component ' + tag + ' do not returns Promise');\n }\n if (!this.__detached__) {\n if (isAsyncComponentPromise) {\n asyncComponentPromise.then(function (lazyComponent) {\n var lazyProps = getProps(lazyComponent);\n createVueInstance(_this, Vue, lazyComponent, lazyProps, options).then(function () {\n typeof options.vueInstanceCreatedCallback === 'function' && options.vueInstanceCreatedCallback.call(_this);\n });\n });\n } else {\n createVueInstance(this, Vue, componentDefinition, props, options).then(function () {\n typeof options.vueInstanceCreatedCallback === 'function' && options.vueInstanceCreatedCallback.call(_this);\n });\n }\n }\n\n this.__detached__ = false;\n },\n disconnectedCallback: function disconnectedCallback() {\n var _this2 = this;\n\n this.__detached__ = true;\n typeof options.disconnectedCallback === 'function' && options.disconnectedCallback.call(this);\n\n options.destroyTimeout !== null && setTimeout(function () {\n if (_this2.__detached__ && _this2.__vue_custom_element__) {\n _this2.__detached__ = false;\n _this2.__vue_custom_element__.$destroy(true);\n delete _this2.__vue_custom_element__;\n delete _this2.__vue_custom_element_props__;\n }\n }, options.destroyTimeout || 3000);\n },\n attributeChangedCallback: function attributeChangedCallback(name, oldValue, value) {\n if (this.__vue_custom_element__ && typeof value !== 'undefined') {\n var nameCamelCase = camelize(name);\n typeof options.attributeChangedCallback === 'function' && options.attributeChangedCallback.call(this, name, oldValue, value);\n var type = this.__vue_custom_element_props__.types[nameCamelCase];\n this.__vue_custom_element__[nameCamelCase] = convertAttributeValue(value, type);\n }\n },\n\n\n observedAttributes: props.hyphenate,\n\n shadow: !!options.shadow && !!HTMLElement.prototype.attachShadow\n });\n\n return CustomElement;\n };\n}\n\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(install);\n if (install.installed) {\n install.installed = false;\n }\n}\n\nexport default install;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"cc-container\"},[_c('HelloWorld')],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._v(\"Hello world\")])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n<template>\n <div>Hello world</div>\n</template>\n\n<script>\nexport default {};\n</script>\n\n<style lang=\"scss\" scoped>\n</style>\n","import mod from \"-!../../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./HelloWorld.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./HelloWorld.vue?vue&type=script&lang=js\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./HelloWorld.vue?vue&type=template&id=0ad47a6b&scoped=true\"\nimport script from \"./HelloWorld.vue?vue&type=script&lang=js\"\nexport * from \"./HelloWorld.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"0ad47a6b\",\n null\n \n)\n\nexport default component.exports","<template>\n <div class=\"cc-container\">\n <HelloWorld />\n </div>\n</template>\n\n<script>\nimport HelloWorld from \"./components/HelloWorld.vue\";\nexport default {\ncomponents: {\n HelloWorld,\n},\ndata() {\n return {\n componentInfo: {\n \n component: \"component-CCPlugin1774500425584\",\n \n compName: \"compName-CCPlugin1774500425584\",\n \n compDesc: \"Component description information\",\n }\n };\n},\n};\n</script>\n<style lang=\"scss\" scoped>\n.cc-container {\n text-align: center;\n padding: 8px;\n}\n</style>","import mod from \"-!../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./CCPlugin1774500425584.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./CCPlugin1774500425584.vue?vue&type=script&lang=js\"","// extracted by mini-css-extract-plugin\nexport {};","export * from \"-!../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./CCPlugin1774500425584.vue?vue&type=style&index=0&id=45cf9904&prod&lang=scss&scoped=true\"","import { render, staticRenderFns } from \"./CCPlugin1774500425584.vue?vue&type=template&id=45cf9904&scoped=true\"\nimport script from \"./CCPlugin1774500425584.vue?vue&type=script&lang=js\"\nexport * from \"./CCPlugin1774500425584.vue?vue&type=script&lang=js\"\nimport style0 from \"./CCPlugin1774500425584.vue?vue&type=style&index=0&id=45cf9904&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../.npm/_npx/14f5bcddd9f17f34/node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"45cf9904\",\n null\n \n)\n\nexport default component.exports"," \n import Vue from \"vue\"\n import VueCustomElement from \"vue-custom-element\"\n Vue.use(VueCustomElement);\n \n import index from \"./CCPlugin1774500425584/CCPlugin1774500425584.vue\"\n Vue.customElement('component-CCPlugin1774500425584', index,{ destroyTimeout: 1200000 });\n ","import './setPublicPath'\nexport * from '~entry'\n"],"names":[],"ignoreList":[],"sourceRoot":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.cc-container[data-v-45cf9904]{text-align:center;padding:8px}
|