yidaconnector 2026.6.11
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/LICENSE +21 -0
- package/README.md +383 -0
- package/bin/yida.js +670 -0
- package/lib/app/form-navigation.js +58 -0
- package/lib/app/get-schema.js +538 -0
- package/lib/auth/auth.js +294 -0
- package/lib/auth/cdp-browser-login.js +390 -0
- package/lib/auth/codex-login.js +71 -0
- package/lib/auth/login.js +475 -0
- package/lib/auth/org.js +363 -0
- package/lib/auth/qr-login.js +1563 -0
- package/lib/core/chalk.js +384 -0
- package/lib/core/check-update.js +82 -0
- package/lib/core/cli-error.js +39 -0
- package/lib/core/command-manifest.js +106 -0
- package/lib/core/env-cmd.js +545 -0
- package/lib/core/env-manager.js +601 -0
- package/lib/core/env.js +287 -0
- package/lib/core/i18n.js +177 -0
- package/lib/core/locales/ar.js +805 -0
- package/lib/core/locales/de.js +805 -0
- package/lib/core/locales/en.js +1623 -0
- package/lib/core/locales/es.js +805 -0
- package/lib/core/locales/fr.js +805 -0
- package/lib/core/locales/hi.js +805 -0
- package/lib/core/locales/ja.js +1197 -0
- package/lib/core/locales/ko.js +807 -0
- package/lib/core/locales/pt.js +805 -0
- package/lib/core/locales/vi.js +805 -0
- package/lib/core/locales/zh-HK.js +1233 -0
- package/lib/core/locales/zh.js +1584 -0
- package/lib/core/query-data.js +781 -0
- package/lib/core/redact.js +100 -0
- package/lib/core/utils.js +799 -0
- package/lib/core/yida-client.js +117 -0
- package/package.json +94 -0
- package/project/config.json +4 -0
- package/project/pages/src/demo-birthday-game.oyd.jsx +832 -0
- package/project/pages/src/demo-chip-insight.oyd.jsx +983 -0
- package/project/pages/src/demo-compat-smoke.oyd.jsx +58 -0
- package/project/pages/src/demo-crm-batch-entry.oyd.jsx +805 -0
- package/project/pages/src/demo-crm-dashboard.oyd.jsx +677 -0
- package/project/pages/src/demo-future-vision-2026.oyd.jsx +1102 -0
- package/project/pages/src/demo-ppt.oyd.jsx +1192 -0
- package/project/pages/src/demo-salary-calculator.oyd.jsx +904 -0
- package/project/pages/src/yidaconnector-knowledge-doc.oyd.jsx +1714 -0
- package/project/prd/demo-birthday-game.md +39 -0
- package/project/prd/demo-crm.md +463 -0
- package/project/prd/demo-dingtalk-ai-solution-center.md +425 -0
- package/project/prd/demo-future-vision-2026.md +78 -0
- package/project/prd/demo-salary-calculator.md +101 -0
- package/scripts/build-skills-package.js +406 -0
- package/scripts/check-syntax.js +59 -0
- package/scripts/demo-dws.sh +106 -0
- package/scripts/e2e-real/cleanup.js +67 -0
- package/scripts/e2e-real/fixtures/form-fields.json +18 -0
- package/scripts/e2e-real/full-runner.js +1566 -0
- package/scripts/e2e-real/runner.js +293 -0
- package/scripts/e2e-real/skill-coverage.js +115 -0
- package/scripts/generate-command-docs.js +109 -0
- package/scripts/nightly-smoke.js +134 -0
- package/scripts/postinstall.js +545 -0
- package/scripts/solution-center-runner.js +368 -0
- package/scripts/validate-ci.sh +50 -0
- package/scripts/validate-command-manifest.js +119 -0
- package/scripts/validate-package-size.js +78 -0
- package/scripts/validate-skills.js +247 -0
- package/scripts/validate-structure.js +66 -0
- package/yida-skills/SKILL.md +163 -0
- package/yida-skills/references/yida-api.md +1309 -0
- package/yida-skills/skills/large-file-write/SKILL.md +91 -0
- package/yida-skills/skills/large-file-write/references/write-patterns.md +149 -0
- package/yida-skills/skills/large-file-write/scripts/write.js +157 -0
- package/yida-skills/skills/yida-data-management/SKILL.md +252 -0
- package/yida-skills/skills/yida-data-management/references/api-matrix.md +49 -0
- package/yida-skills/skills/yida-data-management/references/data-format-guide.md +159 -0
- package/yida-skills/skills/yida-data-management/references/verified-endpoints.md +62 -0
- package/yida-skills/skills/yida-login/SKILL.md +159 -0
- package/yida-skills/skills/yida-logout/SKILL.md +67 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const querystring = require('querystring');
|
|
4
|
+
const {
|
|
5
|
+
loadCookieData,
|
|
6
|
+
triggerLogin,
|
|
7
|
+
resolveBaseUrl,
|
|
8
|
+
extractInfoFromCookies,
|
|
9
|
+
httpPost,
|
|
10
|
+
httpPostJson,
|
|
11
|
+
httpGet,
|
|
12
|
+
requestWithAutoLogin,
|
|
13
|
+
} = require('./utils');
|
|
14
|
+
|
|
15
|
+
function createAuthRef(cookieData) {
|
|
16
|
+
const cachedCookieData = cookieData || loadCookieData();
|
|
17
|
+
const loadedCookieData = cachedCookieData && cachedCookieData.cookies
|
|
18
|
+
? cachedCookieData
|
|
19
|
+
: triggerLogin();
|
|
20
|
+
const safeCookieData = loadedCookieData || {};
|
|
21
|
+
const cookieInfo = typeof extractInfoFromCookies === 'function'
|
|
22
|
+
? extractInfoFromCookies(safeCookieData.cookies || [])
|
|
23
|
+
: {};
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
csrfToken: safeCookieData.csrf_token || cookieInfo.csrfToken || '',
|
|
27
|
+
cookies: safeCookieData.cookies || [],
|
|
28
|
+
baseUrl: resolveBaseUrl(safeCookieData),
|
|
29
|
+
cookieData: safeCookieData,
|
|
30
|
+
corpId: safeCookieData.corp_id || cookieInfo.corpId || '',
|
|
31
|
+
userId: safeCookieData.user_id || cookieInfo.userId || '',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
class YidaClient {
|
|
36
|
+
constructor(options = {}) {
|
|
37
|
+
this.authRef = options.authRef || createAuthRef(options.cookieData);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
getAuthRef() {
|
|
41
|
+
return this.authRef;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async get(requestPath, queryParams, options) {
|
|
45
|
+
return requestWithAutoLogin(
|
|
46
|
+
(ref) => {
|
|
47
|
+
const resolvedRequestPath = typeof requestPath === 'function'
|
|
48
|
+
? requestPath(ref)
|
|
49
|
+
: requestPath;
|
|
50
|
+
const resolvedQueryParams = typeof queryParams === 'function'
|
|
51
|
+
? queryParams(ref)
|
|
52
|
+
: queryParams;
|
|
53
|
+
if (options === undefined) {
|
|
54
|
+
return httpGet(ref.baseUrl, resolvedRequestPath, resolvedQueryParams || null, ref.cookies);
|
|
55
|
+
}
|
|
56
|
+
return httpGet(ref.baseUrl, resolvedRequestPath, resolvedQueryParams || null, ref.cookies, options);
|
|
57
|
+
},
|
|
58
|
+
this.authRef
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async postForm(requestPath, bodyParams, options) {
|
|
63
|
+
return requestWithAutoLogin(
|
|
64
|
+
(ref) => {
|
|
65
|
+
const resolvedRequestPath = typeof requestPath === 'function'
|
|
66
|
+
? requestPath(ref)
|
|
67
|
+
: requestPath;
|
|
68
|
+
const resolvedBodyParams = typeof bodyParams === 'function'
|
|
69
|
+
? bodyParams(ref)
|
|
70
|
+
: bodyParams;
|
|
71
|
+
const postData = typeof resolvedBodyParams === 'string'
|
|
72
|
+
? resolvedBodyParams
|
|
73
|
+
: querystring.stringify(resolvedBodyParams || {});
|
|
74
|
+
if (options === undefined) {
|
|
75
|
+
return httpPost(ref.baseUrl, resolvedRequestPath, postData, ref.cookies);
|
|
76
|
+
}
|
|
77
|
+
return httpPost(ref.baseUrl, resolvedRequestPath, postData, ref.cookies, options);
|
|
78
|
+
},
|
|
79
|
+
this.authRef
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async postJson(requestPath, bodyParams, options) {
|
|
84
|
+
return requestWithAutoLogin(
|
|
85
|
+
(ref) => {
|
|
86
|
+
const resolvedRequestPath = typeof requestPath === 'function'
|
|
87
|
+
? requestPath(ref)
|
|
88
|
+
: requestPath;
|
|
89
|
+
const resolvedBodyParams = typeof bodyParams === 'function'
|
|
90
|
+
? bodyParams(ref)
|
|
91
|
+
: bodyParams;
|
|
92
|
+
const resolvedOptions = typeof options === 'function'
|
|
93
|
+
? options(ref)
|
|
94
|
+
: options;
|
|
95
|
+
const requestOptions = Object.assign({ csrfToken: ref.csrfToken }, resolvedOptions || {});
|
|
96
|
+
return httpPostJson(
|
|
97
|
+
ref.baseUrl,
|
|
98
|
+
resolvedRequestPath,
|
|
99
|
+
resolvedBodyParams || {},
|
|
100
|
+
ref.cookies,
|
|
101
|
+
requestOptions
|
|
102
|
+
);
|
|
103
|
+
},
|
|
104
|
+
this.authRef
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function createYidaClient(options = {}) {
|
|
110
|
+
return new YidaClient(options);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
module.exports = {
|
|
114
|
+
YidaClient,
|
|
115
|
+
createAuthRef,
|
|
116
|
+
createYidaClient,
|
|
117
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "yidaconnector",
|
|
3
|
+
"version": "2026.6.11",
|
|
4
|
+
"description": "YidaConnector CLI - 宜搭低代码 AI 开发工具(安装即用,零配置)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"yidaconnector": "bin/yida.js",
|
|
7
|
+
"yida": "bin/yida.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"lib/",
|
|
12
|
+
"agent/",
|
|
13
|
+
"project/config.json",
|
|
14
|
+
"project/pages/src/demo-*.js",
|
|
15
|
+
"project/pages/src/demo-*.oyd.jsx",
|
|
16
|
+
"!project/pages/src/demo-agent-chatbox.oyd.jsx",
|
|
17
|
+
"!project/pages/src/demo-dingtalk-ai-solution-center.oyd.jsx",
|
|
18
|
+
"!project/pages/src/demo-yidaconnector-image2-slider.oyd.jsx",
|
|
19
|
+
"project/pages/src/yidaconnector-knowledge-doc.oyd.jsx",
|
|
20
|
+
"project/prd/demo-*.md",
|
|
21
|
+
"yida-skills/",
|
|
22
|
+
"scripts/",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"test": "jest",
|
|
28
|
+
"test:unit": "jest",
|
|
29
|
+
"test:e2e:real": "node scripts/e2e-real/runner.js",
|
|
30
|
+
"test:e2e:real:full": "node scripts/e2e-real/full-runner.js",
|
|
31
|
+
"test:e2e:real:skills": "node scripts/e2e-real/skill-coverage.js",
|
|
32
|
+
"test:e2e:real:cleanup": "node scripts/e2e-real/cleanup.js",
|
|
33
|
+
"test:coverage": "jest --coverage",
|
|
34
|
+
"lint": "eslint bin/ lib/ scripts/ tests/ --ext .js",
|
|
35
|
+
"lint:fix": "eslint bin/ lib/ scripts/ tests/ --ext .js --fix",
|
|
36
|
+
"solution:runner": "node scripts/solution-center-runner.js",
|
|
37
|
+
"build:skills": "node scripts/build-skills-package.js",
|
|
38
|
+
"docs:commands": "node scripts/generate-command-docs.js",
|
|
39
|
+
"check:quick": "npm run check:structure && npm run check:commands && npm run check:docs && npm run check:syntax && npm run lint",
|
|
40
|
+
"check:structure": "node scripts/validate-structure.js",
|
|
41
|
+
"check:commands": "node scripts/validate-command-manifest.js",
|
|
42
|
+
"check:docs": "node scripts/generate-command-docs.js --check",
|
|
43
|
+
"check:skills": "node scripts/validate-skills.js",
|
|
44
|
+
"check:syntax": "node scripts/check-syntax.js",
|
|
45
|
+
"check:package-size": "node scripts/validate-package-size.js",
|
|
46
|
+
"check:package": "npm pack --dry-run",
|
|
47
|
+
"check:release": "npm run check:ci",
|
|
48
|
+
"check:ci": "bash scripts/validate-ci.sh",
|
|
49
|
+
"postinstall": "node scripts/postinstall.js"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"yida",
|
|
53
|
+
"aliwork",
|
|
54
|
+
"dingtalk",
|
|
55
|
+
"cli",
|
|
56
|
+
"yidaconnector",
|
|
57
|
+
"low-code",
|
|
58
|
+
"ai",
|
|
59
|
+
"qoder",
|
|
60
|
+
"wukong"
|
|
61
|
+
],
|
|
62
|
+
"author": "YidaConnector Contributors",
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "git+https://github.com/bunnyrui/yidaconnector.git"
|
|
67
|
+
},
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://github.com/bunnyrui/yidaconnector/issues"
|
|
70
|
+
},
|
|
71
|
+
"homepage": "https://github.com/bunnyrui/yidaconnector#readme",
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@babel/standalone": "^7.15.1",
|
|
74
|
+
"qrcode": "^1.5.4",
|
|
75
|
+
"uglify-js": "^3.19.3"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"eslint": "^8.50.0",
|
|
79
|
+
"eslint-plugin-import": "^2.32.0",
|
|
80
|
+
"jest": "^29.7.0"
|
|
81
|
+
},
|
|
82
|
+
"jest": {
|
|
83
|
+
"testMatch": [
|
|
84
|
+
"**/tests/**/*.test.js"
|
|
85
|
+
],
|
|
86
|
+
"coverageReporters": [
|
|
87
|
+
"text",
|
|
88
|
+
"lcov"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"engines": {
|
|
92
|
+
"node": ">=18"
|
|
93
|
+
}
|
|
94
|
+
}
|