@gaias/client_node 1.0.3

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 (65) hide show
  1. package/.npmrc.example +14 -0
  2. package/LICENSE +21 -0
  3. package/PUBLISHING.md +170 -0
  4. package/README.md +2 -0
  5. package/config/CommonParam.yaml +2 -0
  6. package/config/RestClientA.yaml +5 -0
  7. package/config/RestClientB.yaml +8 -0
  8. package/dist/configclient/ConfigClient.d.ts +12 -0
  9. package/dist/configclient/ConfigClient.d.ts.map +1 -0
  10. package/dist/configclient/ConfigClient.js +112 -0
  11. package/dist/configclient/ConfigClient.js.map +1 -0
  12. package/dist/configclient/index.d.ts +2 -0
  13. package/dist/configclient/index.d.ts.map +1 -0
  14. package/dist/configclient/index.js +18 -0
  15. package/dist/configclient/index.js.map +1 -0
  16. package/dist/globalstorage/globalstorage.d.ts +9 -0
  17. package/dist/globalstorage/globalstorage.d.ts.map +1 -0
  18. package/dist/globalstorage/globalstorage.js +39 -0
  19. package/dist/globalstorage/globalstorage.js.map +1 -0
  20. package/dist/globalstorage/index.d.ts +2 -0
  21. package/dist/globalstorage/index.d.ts.map +1 -0
  22. package/dist/globalstorage/index.js +18 -0
  23. package/dist/globalstorage/index.js.map +1 -0
  24. package/dist/index.d.ts +5 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +21 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/messageclient/Email.d.ts +32 -0
  29. package/dist/messageclient/Email.d.ts.map +1 -0
  30. package/dist/messageclient/Email.js +29 -0
  31. package/dist/messageclient/Email.js.map +1 -0
  32. package/dist/messageclient/Events.d.ts +4 -0
  33. package/dist/messageclient/Events.d.ts.map +1 -0
  34. package/dist/messageclient/Events.js +7 -0
  35. package/dist/messageclient/Events.js.map +1 -0
  36. package/dist/messageclient/index.d.ts +3 -0
  37. package/dist/messageclient/index.d.ts.map +1 -0
  38. package/dist/messageclient/index.js +19 -0
  39. package/dist/messageclient/index.js.map +1 -0
  40. package/dist/restclient/FSBackend.d.ts +14 -0
  41. package/dist/restclient/FSBackend.d.ts.map +1 -0
  42. package/dist/restclient/FSBackend.js +44 -0
  43. package/dist/restclient/FSBackend.js.map +1 -0
  44. package/dist/restclient/HttpBackend.d.ts +28 -0
  45. package/dist/restclient/HttpBackend.d.ts.map +1 -0
  46. package/dist/restclient/HttpBackend.js +126 -0
  47. package/dist/restclient/HttpBackend.js.map +1 -0
  48. package/dist/restclient/NextSSRBackend.d.ts +15 -0
  49. package/dist/restclient/NextSSRBackend.d.ts.map +1 -0
  50. package/dist/restclient/NextSSRBackend.js +58 -0
  51. package/dist/restclient/NextSSRBackend.js.map +1 -0
  52. package/dist/restclient/RestClient.d.ts +58 -0
  53. package/dist/restclient/RestClient.d.ts.map +1 -0
  54. package/dist/restclient/RestClient.js +167 -0
  55. package/dist/restclient/RestClient.js.map +1 -0
  56. package/dist/restclient/Yamls.d.ts +2 -0
  57. package/dist/restclient/Yamls.d.ts.map +1 -0
  58. package/dist/restclient/Yamls.js +26 -0
  59. package/dist/restclient/Yamls.js.map +1 -0
  60. package/dist/restclient/index.d.ts +6 -0
  61. package/dist/restclient/index.d.ts.map +1 -0
  62. package/dist/restclient/index.js +22 -0
  63. package/dist/restclient/index.js.map +1 -0
  64. package/eslint.config.js +141 -0
  65. package/package.json +102 -0
@@ -0,0 +1,141 @@
1
+ // eslint.config.js
2
+ const js = require('@eslint/js');
3
+ const tsPlugin = require('@typescript-eslint/eslint-plugin');
4
+ const tsParser = require('@typescript-eslint/parser');
5
+ const globals = require('globals');
6
+
7
+ module.exports = [
8
+ {
9
+ ignores: [
10
+ '**/node_modules/**',
11
+ '**/temp/**',
12
+ '**/dist/**',
13
+ '**/*.js',
14
+ '**/*.d.ts',
15
+ ],
16
+ },
17
+
18
+ js.configs.recommended,
19
+
20
+ // 配置 1: src/ 和 example/ 目录(需要类型检查)
21
+ {
22
+ files: ['src/**/*.ts', 'example/**/*.ts'],
23
+ languageOptions: {
24
+ parser: tsParser,
25
+ parserOptions: {
26
+ ecmaVersion: 2018,
27
+ sourceType: 'module',
28
+ project: './tsconfig.json', // 使用项目配置
29
+ },
30
+ globals: {
31
+ ...globals.node,
32
+ ...globals.es6,
33
+ NodeJS: 'readonly',
34
+ Atomics: 'readonly',
35
+ SharedArrayBuffer: 'readonly',
36
+ },
37
+ },
38
+ plugins: {
39
+ '@typescript-eslint': tsPlugin,
40
+ },
41
+ rules: {
42
+ ...tsPlugin.configs.recommended.rules,
43
+ '@typescript-eslint/no-require-imports': 'off',
44
+ '@typescript-eslint/no-var-requires': 'off',
45
+ '@typescript-eslint/explicit-function-return-type': 'off',
46
+ '@typescript-eslint/no-non-null-assertion': 'off',
47
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
48
+ '@typescript-eslint/ban-types': 'off',
49
+ '@typescript-eslint/no-empty-function': 'off',
50
+ '@typescript-eslint/no-explicit-any': 'off',
51
+ '@typescript-eslint/no-unused-vars': 'off',
52
+ // 新增推荐规则 / New recommended rules
53
+ '@typescript-eslint/no-floating-promises': 'warn', // 警告未处理的 Promise
54
+ '@typescript-eslint/await-thenable': 'warn', // 避免 await 非 thenable
55
+ '@typescript-eslint/no-misused-promises': 'warn', // Promise 误用检查
56
+ 'no-console': 'off', // 允许使用 console(生产环境可以考虑启用)
57
+ 'lines-between-class-members': ['warn', 'always'],
58
+ 'no-undef': 'off',
59
+ },
60
+ },
61
+
62
+ // 配置 2: tools/ 目录(不需要类型检查)
63
+ {
64
+ files: ['tools/**/*.ts'],
65
+ languageOptions: {
66
+ parser: tsParser,
67
+ parserOptions: {
68
+ ecmaVersion: 2018,
69
+ sourceType: 'module',
70
+ // ✅ 不使用 project,避免解析错误
71
+ },
72
+ globals: {
73
+ ...globals.node,
74
+ ...globals.es6,
75
+ NodeJS: 'readonly',
76
+ Atomics: 'readonly',
77
+ SharedArrayBuffer: 'readonly',
78
+ },
79
+ },
80
+ plugins: {
81
+ '@typescript-eslint': tsPlugin,
82
+ },
83
+ rules: {
84
+ ...tsPlugin.configs.recommended.rules,
85
+ '@typescript-eslint/no-require-imports': 'off',
86
+ '@typescript-eslint/no-var-requires': 'off',
87
+ '@typescript-eslint/explicit-function-return-type': 'off',
88
+ '@typescript-eslint/no-non-null-assertion': 'off',
89
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
90
+ '@typescript-eslint/ban-types': 'off',
91
+ '@typescript-eslint/no-empty-function': 'off',
92
+ '@typescript-eslint/no-explicit-any': 'off',
93
+ '@typescript-eslint/no-unused-vars': 'off',
94
+ // 注意:tools/ 目录不启用需要类型信息的规则
95
+ // Note: Type-aware rules are not enabled for tools/ directory
96
+ 'no-console': 'off', // tools 目录允许使用 console
97
+ 'lines-between-class-members': ['warn', 'always'],
98
+ 'no-undef': 'off',
99
+ },
100
+ },
101
+
102
+ // 配置 3: __tests__ 目录(不需要类型检查)
103
+ {
104
+ files: ['__tests__/**/*.ts'],
105
+ languageOptions: {
106
+ parser: tsParser,
107
+ parserOptions: {
108
+ ecmaVersion: 2018,
109
+ sourceType: 'module',
110
+ // ✅ 不使用 project,避免解析错误
111
+ },
112
+ globals: {
113
+ ...globals.node,
114
+ ...globals.es6,
115
+ NodeJS: 'readonly',
116
+ Atomics: 'readonly',
117
+ SharedArrayBuffer: 'readonly',
118
+ },
119
+ },
120
+ plugins: {
121
+ '@typescript-eslint': tsPlugin,
122
+ },
123
+ rules: {
124
+ ...tsPlugin.configs.recommended.rules,
125
+ '@typescript-eslint/no-require-imports': 'off',
126
+ '@typescript-eslint/no-var-requires': 'off',
127
+ '@typescript-eslint/explicit-function-return-type': 'off',
128
+ '@typescript-eslint/no-non-null-assertion': 'off',
129
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
130
+ '@typescript-eslint/ban-types': 'off',
131
+ '@typescript-eslint/no-empty-function': 'off',
132
+ '@typescript-eslint/no-explicit-any': 'off',
133
+ '@typescript-eslint/no-unused-vars': 'off',
134
+ // 注意:测试目录不启用需要类型信息的规则
135
+ // Note: Type-aware rules are not enabled for test directory
136
+ 'no-console': 'off', // 测试目录允许使用 console
137
+ 'lines-between-class-members': ['warn', 'always'],
138
+ 'no-undef': 'off',
139
+ },
140
+ },
141
+ ];
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "@gaias/client_node",
3
+ "version": "1.0.3",
4
+ "description": "store data in cookie and localstorage",
5
+ "main": "dist/single/index.js",
6
+ "types": "dist/single/index.d.ts",
7
+ "license": "UNLICENSED",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/TonyYang1985/client_node.git"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public",
14
+ "registry": "https://registry.npmjs.org/"
15
+ },
16
+ "keywords": [
17
+ "restclient",
18
+ "globalstorage",
19
+ "messageclient",
20
+ "configclient"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18.0.0",
24
+ "yarn": ">=1.22.x"
25
+ },
26
+ "scripts": {
27
+ "//===ncc build===": "",
28
+ "ncc:build": "ncc build ./src/index.ts -m -o ./dist/single -e sqlite3 --no-source-map-register && ncc cache clean",
29
+ "buildNum": "yarn npe buildNumber $(yarn -s buildnumgen)",
30
+ "//===dev===": "",
31
+ "dev": "http-server",
32
+ "upver": "ncu -u && yarn install",
33
+ "gen:idx": "cti create ./src",
34
+ "prepub": "rimraf dist && mkdir dist && tsc && mv temp/* dist/ && rimraf temp",
35
+ "//===test===": "",
36
+ "test": "jest",
37
+ "//===lint===": "",
38
+ "lint": "tsc --noEmit && eslint . --ext .ts",
39
+ "lint:fix": "eslint . --ext .ts --fix",
40
+ "//===security===": "",
41
+ "security": "yarn audit",
42
+ "security:summary": "yarn audit --summary",
43
+ "security:json": "yarn audit --json",
44
+ "security:check": "node tools/security-check.js",
45
+ "precommit": "yarn lint"
46
+ },
47
+ "devDependencies": {
48
+ "@eslint/js": "^9.38.0",
49
+ "@types/babel-traverse": "^6.25.10",
50
+ "@types/cls-hooked": "^4.3.9",
51
+ "@types/dot-object": "^2.1.6",
52
+ "@types/faker": "^6.6.11",
53
+ "@types/jest": "^30.0.0",
54
+ "@types/js-cookie": "^3.0.6",
55
+ "@types/js-yaml": "^4.0.9",
56
+ "@types/lodash": "^4.17.20",
57
+ "@types/mocha": "^10.0.10",
58
+ "@types/mustache": "^4.2.6",
59
+ "@types/node": "^24.9.0",
60
+ "@types/whatwg-url": "^13.0.0",
61
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
62
+ "@typescript-eslint/parser": "^8.46.2",
63
+ "@typescript-eslint/scope-manager": "8.46.2",
64
+ "@typescript-eslint/types": "8.46.2",
65
+ "@typescript-eslint/visitor-keys": "8.46.2",
66
+ "@vercel/ncc": "^0.38.4",
67
+ "create-ts-index": "^1.14.0",
68
+ "cross-env": "^10.1.0",
69
+ "eslint": "^9.38.0",
70
+ "eslint-config-prettier": "^10.1.8",
71
+ "eslint-plugin-prettier": "^5.5.4",
72
+ "faker": "^5.5.3",
73
+ "glob": "^11.0.3",
74
+ "http-server": "^14.1.1",
75
+ "jest": "^30.2.0",
76
+ "npm-check-updates": "^19.1.1",
77
+ "prettier": "^3.6.2",
78
+ "reflect-metadata": "^0.2.2",
79
+ "rimraf": "^6.0.1",
80
+ "ts-jest": "^29.4.5",
81
+ "ts-node": "^10.9.2",
82
+ "tsconfig-paths": "^4.2.0",
83
+ "typescript": "^5.9.3"
84
+ },
85
+ "dependencies": {
86
+ "axios": "^1.12.2",
87
+ "cls-hooked": "^4.2.2",
88
+ "dot-object": "^2.1.5",
89
+ "eventemitter3": "^5.0.1",
90
+ "ioredis": "^5.8.1",
91
+ "js-cookie": "^3.0.5",
92
+ "js-yaml": "^4.1.0",
93
+ "jsonata": "^2.1.0",
94
+ "lodash": "^4.17.21",
95
+ "merge-json": "^0.1.0-b.3",
96
+ "mustache": "^4.2.0",
97
+ "storage-manager-js": "^4.2.6",
98
+ "store2": "^2.14.4",
99
+ "typedi": "^0.10.0",
100
+ "whatwg-url": "^15.1.0"
101
+ }
102
+ }