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.
Files changed (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +383 -0
  3. package/bin/yida.js +670 -0
  4. package/lib/app/form-navigation.js +58 -0
  5. package/lib/app/get-schema.js +538 -0
  6. package/lib/auth/auth.js +294 -0
  7. package/lib/auth/cdp-browser-login.js +390 -0
  8. package/lib/auth/codex-login.js +71 -0
  9. package/lib/auth/login.js +475 -0
  10. package/lib/auth/org.js +363 -0
  11. package/lib/auth/qr-login.js +1563 -0
  12. package/lib/core/chalk.js +384 -0
  13. package/lib/core/check-update.js +82 -0
  14. package/lib/core/cli-error.js +39 -0
  15. package/lib/core/command-manifest.js +106 -0
  16. package/lib/core/env-cmd.js +545 -0
  17. package/lib/core/env-manager.js +601 -0
  18. package/lib/core/env.js +287 -0
  19. package/lib/core/i18n.js +177 -0
  20. package/lib/core/locales/ar.js +805 -0
  21. package/lib/core/locales/de.js +805 -0
  22. package/lib/core/locales/en.js +1623 -0
  23. package/lib/core/locales/es.js +805 -0
  24. package/lib/core/locales/fr.js +805 -0
  25. package/lib/core/locales/hi.js +805 -0
  26. package/lib/core/locales/ja.js +1197 -0
  27. package/lib/core/locales/ko.js +807 -0
  28. package/lib/core/locales/pt.js +805 -0
  29. package/lib/core/locales/vi.js +805 -0
  30. package/lib/core/locales/zh-HK.js +1233 -0
  31. package/lib/core/locales/zh.js +1584 -0
  32. package/lib/core/query-data.js +781 -0
  33. package/lib/core/redact.js +100 -0
  34. package/lib/core/utils.js +799 -0
  35. package/lib/core/yida-client.js +117 -0
  36. package/package.json +94 -0
  37. package/project/config.json +4 -0
  38. package/project/pages/src/demo-birthday-game.oyd.jsx +832 -0
  39. package/project/pages/src/demo-chip-insight.oyd.jsx +983 -0
  40. package/project/pages/src/demo-compat-smoke.oyd.jsx +58 -0
  41. package/project/pages/src/demo-crm-batch-entry.oyd.jsx +805 -0
  42. package/project/pages/src/demo-crm-dashboard.oyd.jsx +677 -0
  43. package/project/pages/src/demo-future-vision-2026.oyd.jsx +1102 -0
  44. package/project/pages/src/demo-ppt.oyd.jsx +1192 -0
  45. package/project/pages/src/demo-salary-calculator.oyd.jsx +904 -0
  46. package/project/pages/src/yidaconnector-knowledge-doc.oyd.jsx +1714 -0
  47. package/project/prd/demo-birthday-game.md +39 -0
  48. package/project/prd/demo-crm.md +463 -0
  49. package/project/prd/demo-dingtalk-ai-solution-center.md +425 -0
  50. package/project/prd/demo-future-vision-2026.md +78 -0
  51. package/project/prd/demo-salary-calculator.md +101 -0
  52. package/scripts/build-skills-package.js +406 -0
  53. package/scripts/check-syntax.js +59 -0
  54. package/scripts/demo-dws.sh +106 -0
  55. package/scripts/e2e-real/cleanup.js +67 -0
  56. package/scripts/e2e-real/fixtures/form-fields.json +18 -0
  57. package/scripts/e2e-real/full-runner.js +1566 -0
  58. package/scripts/e2e-real/runner.js +293 -0
  59. package/scripts/e2e-real/skill-coverage.js +115 -0
  60. package/scripts/generate-command-docs.js +109 -0
  61. package/scripts/nightly-smoke.js +134 -0
  62. package/scripts/postinstall.js +545 -0
  63. package/scripts/solution-center-runner.js +368 -0
  64. package/scripts/validate-ci.sh +50 -0
  65. package/scripts/validate-command-manifest.js +119 -0
  66. package/scripts/validate-package-size.js +78 -0
  67. package/scripts/validate-skills.js +247 -0
  68. package/scripts/validate-structure.js +66 -0
  69. package/yida-skills/SKILL.md +163 -0
  70. package/yida-skills/references/yida-api.md +1309 -0
  71. package/yida-skills/skills/large-file-write/SKILL.md +91 -0
  72. package/yida-skills/skills/large-file-write/references/write-patterns.md +149 -0
  73. package/yida-skills/skills/large-file-write/scripts/write.js +157 -0
  74. package/yida-skills/skills/yida-data-management/SKILL.md +252 -0
  75. package/yida-skills/skills/yida-data-management/references/api-matrix.md +49 -0
  76. package/yida-skills/skills/yida-data-management/references/data-format-guide.md +159 -0
  77. package/yida-skills/skills/yida-data-management/references/verified-endpoints.md +62 -0
  78. package/yida-skills/skills/yida-login/SKILL.md +159 -0
  79. package/yida-skills/skills/yida-logout/SKILL.md +67 -0
@@ -0,0 +1,100 @@
1
+ 'use strict';
2
+
3
+ const SENSITIVE_KEY_PATTERN = /(^|[_-])(authorization|auth|cookie|csrf|token|secret|password|passwd|api[_-]?key|access[_-]?key|signature|sign)([_-]|$)/i;
4
+ const EMAIL_PATTERN = /([A-Z0-9._%+-])([A-Z0-9._%+-]*)(@[A-Z0-9.-]+\.[A-Z]{2,})/gi;
5
+ const MAINLAND_PHONE_PATTERN = /(^|[^\d])(1[3-9]\d)(\d{4})(\d{4})(?!\d)/g;
6
+
7
+ function maskString(value, options = {}) {
8
+ const text = String(value);
9
+ const start = options.start === null || options.start === undefined ? 4 : options.start;
10
+ const end = options.end === null || options.end === undefined ? 4 : options.end;
11
+
12
+ if (!text) {
13
+ return '';
14
+ }
15
+ if (text.length <= start + end + 3) {
16
+ return '***';
17
+ }
18
+
19
+ return `${text.slice(0, start)}***${text.slice(text.length - end)}`;
20
+ }
21
+
22
+ function redactString(value) {
23
+ return String(value)
24
+ .replace(/\bBearer\s+([A-Za-z0-9._~+/=-]+)/gi, 'Bearer ***')
25
+ .replace(/\bBasic\s+([A-Za-z0-9._~+/=-]+)/gi, 'Basic ***')
26
+ .replace(/(access[_-]?token|csrf[_-]?token|api[_-]?key|secret|password|token)=([^&\s]+)/gi, '$1=***')
27
+ .replace(/(Cookie:\s*)([^\r\n]+)/gi, '$1***')
28
+ .replace(EMAIL_PATTERN, function(_match, first, _middle, domain) {
29
+ return `${first}***${domain}`;
30
+ })
31
+ .replace(MAINLAND_PHONE_PATTERN, function(_match, prefix, first, _middle, last) {
32
+ return `${prefix}${first}****${last}`;
33
+ });
34
+ }
35
+
36
+ function isPlainObject(value) {
37
+ if (!value || typeof value !== 'object') {
38
+ return false;
39
+ }
40
+ const prototype = Object.getPrototypeOf(value);
41
+ return prototype === Object.prototype || prototype === null;
42
+ }
43
+
44
+ function shouldMaskKey(key) {
45
+ return SENSITIVE_KEY_PATTERN.test(String(key || ''));
46
+ }
47
+
48
+ function redactSensitive(value, options = {}) {
49
+ const seen = options.seen || new WeakSet();
50
+ const key = options.key || '';
51
+
52
+ if (value === null || value === undefined) {
53
+ return value;
54
+ }
55
+
56
+ if (shouldMaskKey(key)) {
57
+ if (typeof value === 'string') {
58
+ return maskString(value);
59
+ }
60
+ return '***';
61
+ }
62
+
63
+ if (typeof value === 'string') {
64
+ return redactString(value);
65
+ }
66
+
67
+ if (typeof value !== 'object') {
68
+ return value;
69
+ }
70
+
71
+ if (seen.has(value)) {
72
+ return '[Circular]';
73
+ }
74
+ seen.add(value);
75
+
76
+ if (Array.isArray(value)) {
77
+ return value.map(item => redactSensitive(item, { seen }));
78
+ }
79
+
80
+ if (!isPlainObject(value)) {
81
+ return value;
82
+ }
83
+
84
+ const redacted = {};
85
+ for (const [entryKey, entryValue] of Object.entries(value)) {
86
+ redacted[entryKey] = redactSensitive(entryValue, { seen, key: entryKey });
87
+ }
88
+ return redacted;
89
+ }
90
+
91
+ function safeJsonStringify(value, spacing = 2) {
92
+ return JSON.stringify(redactSensitive(value), null, spacing);
93
+ }
94
+
95
+ module.exports = {
96
+ maskString,
97
+ redactSensitive,
98
+ redactString,
99
+ safeJsonStringify,
100
+ };