@ones-open/cli 0.0.8

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 (210) hide show
  1. package/LICENSE +201 -0
  2. package/bin/ones.js +4 -0
  3. package/dist/index.cjs +1889 -0
  4. package/dist/index.js +1888 -0
  5. package/dist/types/actions/build/index.d.ts +4 -0
  6. package/dist/types/actions/build/index.d.ts.map +1 -0
  7. package/dist/types/actions/build/normalize.d.ts +6 -0
  8. package/dist/types/actions/build/normalize.d.ts.map +1 -0
  9. package/dist/types/actions/build/regexp.d.ts +2 -0
  10. package/dist/types/actions/build/regexp.d.ts.map +1 -0
  11. package/dist/types/actions/dev/enums.d.ts +11 -0
  12. package/dist/types/actions/dev/enums.d.ts.map +1 -0
  13. package/dist/types/actions/dev/index.d.ts +4 -0
  14. package/dist/types/actions/dev/index.d.ts.map +1 -0
  15. package/dist/types/actions/dev/normalize.d.ts +6 -0
  16. package/dist/types/actions/dev/normalize.d.ts.map +1 -0
  17. package/dist/types/actions/dev/types.d.ts +10 -0
  18. package/dist/types/actions/dev/types.d.ts.map +1 -0
  19. package/dist/types/actions/disable/index.d.ts +4 -0
  20. package/dist/types/actions/disable/index.d.ts.map +1 -0
  21. package/dist/types/actions/disable/normalize.d.ts +6 -0
  22. package/dist/types/actions/disable/normalize.d.ts.map +1 -0
  23. package/dist/types/actions/enable/index.d.ts +4 -0
  24. package/dist/types/actions/enable/index.d.ts.map +1 -0
  25. package/dist/types/actions/enable/normalize.d.ts +6 -0
  26. package/dist/types/actions/enable/normalize.d.ts.map +1 -0
  27. package/dist/types/actions/index.d.ts +15 -0
  28. package/dist/types/actions/index.d.ts.map +1 -0
  29. package/dist/types/actions/install/index.d.ts +5 -0
  30. package/dist/types/actions/install/index.d.ts.map +1 -0
  31. package/dist/types/actions/install/install.d.ts +3 -0
  32. package/dist/types/actions/install/install.d.ts.map +1 -0
  33. package/dist/types/actions/install/normalize.d.ts +6 -0
  34. package/dist/types/actions/install/normalize.d.ts.map +1 -0
  35. package/dist/types/actions/legacy/index.d.ts +4 -0
  36. package/dist/types/actions/legacy/index.d.ts.map +1 -0
  37. package/dist/types/actions/legacy/normalize.d.ts +6 -0
  38. package/dist/types/actions/legacy/normalize.d.ts.map +1 -0
  39. package/dist/types/actions/login/consts.d.ts +2 -0
  40. package/dist/types/actions/login/consts.d.ts.map +1 -0
  41. package/dist/types/actions/login/index.d.ts +4 -0
  42. package/dist/types/actions/login/index.d.ts.map +1 -0
  43. package/dist/types/actions/login/normalize.d.ts +6 -0
  44. package/dist/types/actions/login/normalize.d.ts.map +1 -0
  45. package/dist/types/actions/login/regexp.d.ts +2 -0
  46. package/dist/types/actions/login/regexp.d.ts.map +1 -0
  47. package/dist/types/actions/logout/index.d.ts +4 -0
  48. package/dist/types/actions/logout/index.d.ts.map +1 -0
  49. package/dist/types/actions/logout/normalize.d.ts +6 -0
  50. package/dist/types/actions/logout/normalize.d.ts.map +1 -0
  51. package/dist/types/actions/tunnel/consts.d.ts +4 -0
  52. package/dist/types/actions/tunnel/consts.d.ts.map +1 -0
  53. package/dist/types/actions/tunnel/index.d.ts +7 -0
  54. package/dist/types/actions/tunnel/index.d.ts.map +1 -0
  55. package/dist/types/actions/tunnel/normalize.d.ts +6 -0
  56. package/dist/types/actions/tunnel/normalize.d.ts.map +1 -0
  57. package/dist/types/actions/tunnel/regexp.d.ts +2 -0
  58. package/dist/types/actions/tunnel/regexp.d.ts.map +1 -0
  59. package/dist/types/actions/tunnel/tunnel-client.d.ts +25 -0
  60. package/dist/types/actions/tunnel/tunnel-client.d.ts.map +1 -0
  61. package/dist/types/actions/tunnel/tunnel.d.ts +3 -0
  62. package/dist/types/actions/tunnel/tunnel.d.ts.map +1 -0
  63. package/dist/types/actions/tunnel/types.d.ts +31 -0
  64. package/dist/types/actions/tunnel/types.d.ts.map +1 -0
  65. package/dist/types/actions/tunnel/utils.d.ts +7 -0
  66. package/dist/types/actions/tunnel/utils.d.ts.map +1 -0
  67. package/dist/types/actions/uninstall/index.d.ts +4 -0
  68. package/dist/types/actions/uninstall/index.d.ts.map +1 -0
  69. package/dist/types/actions/uninstall/normalize.d.ts +6 -0
  70. package/dist/types/actions/uninstall/normalize.d.ts.map +1 -0
  71. package/dist/types/actions/whoami/index.d.ts +4 -0
  72. package/dist/types/actions/whoami/index.d.ts.map +1 -0
  73. package/dist/types/actions/whoami/normalize.d.ts +6 -0
  74. package/dist/types/actions/whoami/normalize.d.ts.map +1 -0
  75. package/dist/types/cli/index.d.ts +2 -0
  76. package/dist/types/cli/index.d.ts.map +1 -0
  77. package/dist/types/command/app/index.d.ts +4 -0
  78. package/dist/types/command/app/index.d.ts.map +1 -0
  79. package/dist/types/command/build/index.d.ts +10 -0
  80. package/dist/types/command/build/index.d.ts.map +1 -0
  81. package/dist/types/command/dev/index.d.ts +11 -0
  82. package/dist/types/command/dev/index.d.ts.map +1 -0
  83. package/dist/types/command/disable/index.d.ts +8 -0
  84. package/dist/types/command/disable/index.d.ts.map +1 -0
  85. package/dist/types/command/enable/index.d.ts +8 -0
  86. package/dist/types/command/enable/index.d.ts.map +1 -0
  87. package/dist/types/command/index.d.ts +16 -0
  88. package/dist/types/command/index.d.ts.map +1 -0
  89. package/dist/types/command/install/index.d.ts +8 -0
  90. package/dist/types/command/install/index.d.ts.map +1 -0
  91. package/dist/types/command/legacy/index.d.ts +8 -0
  92. package/dist/types/command/legacy/index.d.ts.map +1 -0
  93. package/dist/types/command/login/index.d.ts +8 -0
  94. package/dist/types/command/login/index.d.ts.map +1 -0
  95. package/dist/types/command/logout/index.d.ts +8 -0
  96. package/dist/types/command/logout/index.d.ts.map +1 -0
  97. package/dist/types/command/tunnel/index.d.ts +9 -0
  98. package/dist/types/command/tunnel/index.d.ts.map +1 -0
  99. package/dist/types/command/uninstall/index.d.ts +8 -0
  100. package/dist/types/command/uninstall/index.d.ts.map +1 -0
  101. package/dist/types/command/whoami/index.d.ts +8 -0
  102. package/dist/types/command/whoami/index.d.ts.map +1 -0
  103. package/dist/types/common/base/index.d.ts +5 -0
  104. package/dist/types/common/base/index.d.ts.map +1 -0
  105. package/dist/types/common/base/utils.d.ts +7 -0
  106. package/dist/types/common/base/utils.d.ts.map +1 -0
  107. package/dist/types/common/command/index.d.ts +6 -0
  108. package/dist/types/common/command/index.d.ts.map +1 -0
  109. package/dist/types/common/command/types.d.ts +2 -0
  110. package/dist/types/common/command/types.d.ts.map +1 -0
  111. package/dist/types/common/command/utils.d.ts +2 -0
  112. package/dist/types/common/command/utils.d.ts.map +1 -0
  113. package/dist/types/common/config/consts.d.ts +5 -0
  114. package/dist/types/common/config/consts.d.ts.map +1 -0
  115. package/dist/types/common/config/index.d.ts +7 -0
  116. package/dist/types/common/config/index.d.ts.map +1 -0
  117. package/dist/types/common/config/types.d.ts +8 -0
  118. package/dist/types/common/config/types.d.ts.map +1 -0
  119. package/dist/types/common/config/utils.d.ts +3 -0
  120. package/dist/types/common/config/utils.d.ts.map +1 -0
  121. package/dist/types/common/context/index.d.ts +6 -0
  122. package/dist/types/common/context/index.d.ts.map +1 -0
  123. package/dist/types/common/context/types.d.ts +2 -0
  124. package/dist/types/common/context/types.d.ts.map +1 -0
  125. package/dist/types/common/context/utils.d.ts +2 -0
  126. package/dist/types/common/context/utils.d.ts.map +1 -0
  127. package/dist/types/common/error/enums.d.ts +20 -0
  128. package/dist/types/common/error/enums.d.ts.map +1 -0
  129. package/dist/types/common/error/index.d.ts +7 -0
  130. package/dist/types/common/error/index.d.ts.map +1 -0
  131. package/dist/types/common/error/types.d.ts +2 -0
  132. package/dist/types/common/error/types.d.ts.map +1 -0
  133. package/dist/types/common/error/utils.d.ts +2 -0
  134. package/dist/types/common/error/utils.d.ts.map +1 -0
  135. package/dist/types/common/locales/en/index.d.ts +41 -0
  136. package/dist/types/common/locales/en/index.d.ts.map +1 -0
  137. package/dist/types/common/locales/index.d.ts +6 -0
  138. package/dist/types/common/locales/index.d.ts.map +1 -0
  139. package/dist/types/common/locales/types.d.ts +4 -0
  140. package/dist/types/common/locales/types.d.ts.map +1 -0
  141. package/dist/types/common/locales/utils.d.ts +6 -0
  142. package/dist/types/common/locales/utils.d.ts.map +1 -0
  143. package/dist/types/common/package/index.d.ts +7 -0
  144. package/dist/types/common/package/index.d.ts.map +1 -0
  145. package/dist/types/common/package/schema.d.ts +3 -0
  146. package/dist/types/common/package/schema.d.ts.map +1 -0
  147. package/dist/types/common/package/types.d.ts +2 -0
  148. package/dist/types/common/package/types.d.ts.map +1 -0
  149. package/dist/types/common/package/utils.d.ts +16 -0
  150. package/dist/types/common/package/utils.d.ts.map +1 -0
  151. package/dist/types/common/public/consts.d.ts +2 -0
  152. package/dist/types/common/public/consts.d.ts.map +1 -0
  153. package/dist/types/common/public/index.d.ts +6 -0
  154. package/dist/types/common/public/index.d.ts.map +1 -0
  155. package/dist/types/common/public/utils.d.ts +2 -0
  156. package/dist/types/common/public/utils.d.ts.map +1 -0
  157. package/dist/types/common/request/consts.d.ts +16 -0
  158. package/dist/types/common/request/consts.d.ts.map +1 -0
  159. package/dist/types/common/request/fetch.d.ts +13 -0
  160. package/dist/types/common/request/fetch.d.ts.map +1 -0
  161. package/dist/types/common/request/index.d.ts +8 -0
  162. package/dist/types/common/request/index.d.ts.map +1 -0
  163. package/dist/types/common/request/types.d.ts +98 -0
  164. package/dist/types/common/request/types.d.ts.map +1 -0
  165. package/dist/types/common/request/utils.d.ts +11 -0
  166. package/dist/types/common/request/utils.d.ts.map +1 -0
  167. package/dist/types/common/store/index.d.ts +6 -0
  168. package/dist/types/common/store/index.d.ts.map +1 -0
  169. package/dist/types/common/store/schema.d.ts +75 -0
  170. package/dist/types/common/store/schema.d.ts.map +1 -0
  171. package/dist/types/common/store/utils.d.ts +13 -0
  172. package/dist/types/common/store/utils.d.ts.map +1 -0
  173. package/dist/types/common/template/index.d.ts +5 -0
  174. package/dist/types/common/template/index.d.ts.map +1 -0
  175. package/dist/types/common/template/utils.d.ts +3 -0
  176. package/dist/types/common/template/utils.d.ts.map +1 -0
  177. package/dist/types/index.d.ts +2 -0
  178. package/dist/types/index.d.ts.map +1 -0
  179. package/index.d.ts +2 -0
  180. package/index.js +2 -0
  181. package/package.json +83 -0
  182. package/public/callback.html +65 -0
  183. package/public/logo.svg +4 -0
  184. package/template/legacy/README.md +13 -0
  185. package/template/legacy/_backend_npmrc +5 -0
  186. package/template/legacy/_backend_tsconfig.json +23 -0
  187. package/template/legacy/_eslintignore +2 -0
  188. package/template/legacy/_eslintrc.js +97 -0
  189. package/template/legacy/_gitignore +21 -0
  190. package/template/legacy/_gitlab-ci.yml +3 -0
  191. package/template/legacy/_husky_pre-commit +1 -0
  192. package/template/legacy/_npmrc +5 -0
  193. package/template/legacy/_prettierignore +15 -0
  194. package/template/legacy/_prettierrc +6 -0
  195. package/template/legacy/_web_npmrc +5 -0
  196. package/template/legacy/_web_tsconfig.json +20 -0
  197. package/template/legacy/backend/package.json +10 -0
  198. package/template/legacy/backend/src/index.ts +139 -0
  199. package/template/legacy/backend/src/ones.d.ts +6 -0
  200. package/template/legacy/config/ci-deploy.yaml +11 -0
  201. package/template/legacy/config/local.yaml +30 -0
  202. package/template/legacy/config/plugin.yaml +25 -0
  203. package/template/legacy/config/upgrade.yaml +8 -0
  204. package/template/legacy/op.config.mjs +4 -0
  205. package/template/legacy/package-lock.json +17446 -0
  206. package/template/legacy/package.json +73 -0
  207. package/template/legacy/web/browserslist +4 -0
  208. package/template/legacy/web/package.json +29 -0
  209. package/template/legacy/web/public/logo.svg +5 -0
  210. package/template/legacy/workspace/plugin.sql +2 -0
@@ -0,0 +1,75 @@
1
+ import { z } from 'zod';
2
+ export declare const StoreONESTokenJSONSchema: z.ZodObject<{
3
+ token_type: z.ZodOptional<z.ZodString>;
4
+ expires_in: z.ZodOptional<z.ZodNumber>;
5
+ expires_at: z.ZodOptional<z.ZodNumber>;
6
+ access_token: z.ZodOptional<z.ZodString>;
7
+ refresh_token: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ token_type?: string | undefined;
10
+ expires_in?: number | undefined;
11
+ expires_at?: number | undefined;
12
+ access_token?: string | undefined;
13
+ refresh_token?: string | undefined;
14
+ }, {
15
+ token_type?: string | undefined;
16
+ expires_in?: number | undefined;
17
+ expires_at?: number | undefined;
18
+ access_token?: string | undefined;
19
+ refresh_token?: string | undefined;
20
+ }>;
21
+ export type StoreONESTokenJSON = z.infer<typeof StoreONESTokenJSONSchema>;
22
+ export declare const StoreJSONSchema: z.ZodObject<{
23
+ version: z.ZodOptional<z.ZodString>;
24
+ timestamp: z.ZodOptional<z.ZodNumber>;
25
+ base_url: z.ZodOptional<z.ZodString>;
26
+ region_url: z.ZodOptional<z.ZodString>;
27
+ host_token: z.ZodOptional<z.ZodString>;
28
+ ones_token: z.ZodOptional<z.ZodObject<{
29
+ token_type: z.ZodOptional<z.ZodString>;
30
+ expires_in: z.ZodOptional<z.ZodNumber>;
31
+ expires_at: z.ZodOptional<z.ZodNumber>;
32
+ access_token: z.ZodOptional<z.ZodString>;
33
+ refresh_token: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ token_type?: string | undefined;
36
+ expires_in?: number | undefined;
37
+ expires_at?: number | undefined;
38
+ access_token?: string | undefined;
39
+ refresh_token?: string | undefined;
40
+ }, {
41
+ token_type?: string | undefined;
42
+ expires_in?: number | undefined;
43
+ expires_at?: number | undefined;
44
+ access_token?: string | undefined;
45
+ refresh_token?: string | undefined;
46
+ }>>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ version?: string | undefined;
49
+ timestamp?: number | undefined;
50
+ base_url?: string | undefined;
51
+ region_url?: string | undefined;
52
+ host_token?: string | undefined;
53
+ ones_token?: {
54
+ token_type?: string | undefined;
55
+ expires_in?: number | undefined;
56
+ expires_at?: number | undefined;
57
+ access_token?: string | undefined;
58
+ refresh_token?: string | undefined;
59
+ } | undefined;
60
+ }, {
61
+ version?: string | undefined;
62
+ timestamp?: number | undefined;
63
+ base_url?: string | undefined;
64
+ region_url?: string | undefined;
65
+ host_token?: string | undefined;
66
+ ones_token?: {
67
+ token_type?: string | undefined;
68
+ expires_in?: number | undefined;
69
+ expires_at?: number | undefined;
70
+ access_token?: string | undefined;
71
+ refresh_token?: string | undefined;
72
+ } | undefined;
73
+ }>;
74
+ export type StoreJSON = z.infer<typeof StoreJSONSchema>;
75
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/common/store/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;EAMnC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO1B,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { StoreJSON, StoreONESTokenJSON } from './schema';
2
+ export declare const getStore: () => Promise<StoreJSON>;
3
+ export declare const setStore: (store: StoreJSON) => Promise<void>;
4
+ export declare const mergeStore: (store: StoreJSON) => Promise<void>;
5
+ export declare const getBaseURL: () => Promise<string>;
6
+ export declare const setBaseURL: (baseURL: string) => Promise<void>;
7
+ export declare const getRegionURL: () => Promise<string>;
8
+ export declare const setRegionURL: (regionURL: string) => Promise<void>;
9
+ export declare const getONESToken: () => Promise<StoreONESTokenJSON>;
10
+ export declare const setONESToken: (token: StoreONESTokenJSON) => Promise<void>;
11
+ export declare const getHostToken: () => Promise<string>;
12
+ export declare const setHostToken: (token: string) => Promise<void>;
13
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/common/store/utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAS7D,eAAO,MAAM,QAAQ,QAAa,OAAO,CAAC,SAAS,CA2BlD,CAAA;AAED,eAAO,MAAM,QAAQ,GAAU,OAAO,SAAS,KAAG,OAAO,CAAC,IAAI,CA4B7D,CAAA;AAED,eAAO,MAAM,UAAU,GAAU,OAAO,SAAS,KAAG,OAAO,CAAC,IAAI,CAM/D,CAAA;AAED,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,MAAM,CAGjD,CAAA;AAED,eAAO,MAAM,UAAU,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAE9D,CAAA;AAED,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,MAAM,CAGnD,CAAA;AAED,eAAO,MAAM,YAAY,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,CAElE,CAAA;AAED,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,kBAAkB,CAG/D,CAAA;AAED,eAAO,MAAM,YAAY,GAAU,OAAO,kBAAkB,KAAG,OAAO,CAAC,IAAI,CAE1E,CAAA;AAED,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,MAAM,CAGnD,CAAA;AAED,eAAO,MAAM,YAAY,GAAU,OAAO,MAAM,KAAG,OAAO,CAAC,IAAI,CAE9D,CAAA"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 对模板读写的工具
3
+ */
4
+ export * from './utils';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/template/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const getTemplatePath: () => string;
2
+ export declare const getTemplateLegacy: () => string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/common/template/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,cAG3B,CAAA;AAED,eAAO,MAAM,iBAAiB,cAE7B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { runCommandONES } from './cli';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA"}
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ // fallback entry for unsupported npm exports statement
2
+ export * from './dist/types/index'
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // fallback entry for unsupported npm exports statement
2
+ export * from './dist/index.js'
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@ones-open/cli",
3
+ "version": "0.0.8",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "scripts": {
17
+ "build": "pnpm clean && pnpm run tsc && vite build",
18
+ "clean": "rm -rf ./dist",
19
+ "test": "tsc --noEmit --emitDeclarationOnly false",
20
+ "tsc": "tsc && tsc-alias"
21
+ },
22
+ "engines": {
23
+ "node": ">=16.13.0"
24
+ },
25
+ "keywords": [
26
+ "ones"
27
+ ],
28
+ "author": {
29
+ "name": "lixinliang",
30
+ "email": "lixinliang@ones.cn"
31
+ },
32
+ "maintainers": [
33
+ {
34
+ "name": "ones"
35
+ }
36
+ ],
37
+ "files": [
38
+ "bin",
39
+ "dist",
40
+ "index.d.ts",
41
+ "index.js",
42
+ "public",
43
+ "template"
44
+ ],
45
+ "bin": {
46
+ "ones": "./bin/ones.js"
47
+ },
48
+ "license": "Apache-2.0",
49
+ "publishConfig": {
50
+ "registry": "https://registry.npmjs.org",
51
+ "access": "public"
52
+ },
53
+ "devDependencies": {
54
+ "@ones-op/node-logger": "workspace:*",
55
+ "@ones-op/node-types": "workspace:*",
56
+ "@ones-op/sdk": "1.70.21",
57
+ "@types/archiver": "^7.0.0",
58
+ "@types/fs-extra": "^11.0.4",
59
+ "@types/lodash-es": "^4.17.12"
60
+ },
61
+ "dependencies": {
62
+ "@babel/runtime-corejs3": "~7.26.10",
63
+ "archiver": "^7.0.1",
64
+ "axios": "1.13.2",
65
+ "chalk": "^5.0.1",
66
+ "commander": "~9.4.0",
67
+ "cosmiconfig": "^8.3.6",
68
+ "create-ones-app": "0.0.8",
69
+ "env-paths": "3.0.0",
70
+ "execa": "^6.1.0",
71
+ "fs-extra": "^11.3.0",
72
+ "get-port": "^7.1.0",
73
+ "lodash-es": "^4.17.21",
74
+ "open": "^11.0.0",
75
+ "ora": "^9.1.0",
76
+ "pkce-challenge": "3.1.0",
77
+ "type-fest": "4.41.0",
78
+ "uuid": "^13.0.0",
79
+ "ws": "^8.18.3",
80
+ "zod": "^3.22.2"
81
+ },
82
+ "gitHead": "abf183f0cf3af3573c4e24d96546b4ee05eb96b1"
83
+ }
@@ -0,0 +1,65 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta
6
+ name="viewport"
7
+ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
8
+ />
9
+ <title>ONES Open Platform</title>
10
+ <style type="text/css">
11
+ .app-loading {
12
+ animation-duration: 0.5s;
13
+ animation-timing-function: ease-in-out;
14
+ animation-fill-mode: both;
15
+ display: inline-block;
16
+ width: 32px;
17
+ height: 32px;
18
+ margin: auto;
19
+ position: absolute;
20
+ top: 0;
21
+ left: 0;
22
+ bottom: 0;
23
+ right: 0;
24
+ vertical-align: middle;
25
+ }
26
+
27
+ .app-loading-inner {
28
+ width: 100%;
29
+ height: 100%;
30
+ display: inline-block;
31
+ box-sizing: border-box;
32
+ border: solid 2px transparent;
33
+ border-top-color: #0064ff;
34
+ border-left-color: #0064ff;
35
+ border-radius: 50%;
36
+ animation: nprogress-spinner 400ms linear infinite;
37
+ }
38
+
39
+ @keyframes nprogress-spinner {
40
+ 0% {
41
+ transform: rotate(0deg);
42
+ }
43
+
44
+ 100% {
45
+ transform: rotate(360deg);
46
+ }
47
+ }
48
+ </style>
49
+ </head>
50
+ <body>
51
+ <div id="app-loading" class="app-loading">
52
+ <div class="app-loading-inner"></div>
53
+ </div>
54
+ <script>
55
+ ;(function () {
56
+ const searchParams = new URLSearchParams(window.location.search)
57
+ const url = searchParams.get('redirect_url')
58
+ searchParams.delete('redirect_url')
59
+ if (url) {
60
+ window.open(`${url}?${searchParams}`, '_self')
61
+ }
62
+ })()
63
+ </script>
64
+ </body>
65
+ </html>
@@ -0,0 +1,4 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="16" height="16" rx="2" fill="#0064FF"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.43816 2.66672C6.82458 2.66672 6.31279 3.17606 6.31279 3.82228V4.4445C6.31279 4.68996 6.11381 4.88894 5.86835 4.88894H3.55556V6.70091H4.56017C5.68056 6.70091 6.57443 7.62426 6.57443 8.74535C6.57443 9.83706 5.70842 10.8718 4.56017 10.8718H3.55556V12.4445H10.6667V10.4274C10.6667 10.1819 10.8657 9.98296 11.1111 9.98296H12.208C12.7937 9.98296 13.3333 9.42095 13.3333 8.74535C13.3333 8.09914 12.8215 7.5898 12.208 7.5898H11.1111C10.8657 7.5898 10.6667 7.39081 10.6667 7.14535V4.88894H9.00797C8.76251 4.88894 8.56353 4.68996 8.56353 4.4445V3.82228C8.56353 3.17606 8.05174 2.66672 7.43816 2.66672ZM5.4239 3.82228C5.4239 2.70118 6.31778 1.77783 7.43816 1.77783C8.55854 1.77783 9.45242 2.70118 9.45242 3.82228V4.00005H11.1111C11.3566 4.00005 11.5556 4.19904 11.5556 4.4445V6.70091H12.208C13.3284 6.70091 14.2222 7.62426 14.2222 8.74535C14.2222 9.83706 13.3562 10.8718 12.208 10.8718H11.5556V12.8889C11.5556 13.1344 11.3566 13.3334 11.1111 13.3334H3.11112C2.86566 13.3334 2.66667 13.1344 2.66667 12.8889V10.4274C2.66667 10.1819 2.86566 9.98296 3.11112 9.98296H4.56017C5.14589 9.98296 5.68554 9.42095 5.68554 8.74535C5.68554 8.09914 5.17375 7.5898 4.56017 7.5898H3.11112C2.86566 7.5898 2.66667 7.39081 2.66667 7.14535V4.4445C2.66667 4.32662 2.7135 4.21358 2.79685 4.13023C2.8802 4.04688 2.99324 4.00005 3.11112 4.00005H5.4239V3.82228Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,13 @@
1
+ # plugin
2
+
3
+ ## Getting Started
4
+
5
+ [https://developer.ones.com/docs/guide/getting-started](https://developer.ones.com/docs/guide/getting-started)
6
+
7
+ ## OP CLI Commands
8
+
9
+ [https://developer.ones.com/docs/tools/cli/op-cli](https://developer.ones.com/docs/tools/cli/op-cli)
10
+
11
+ ## Capabilities
12
+
13
+ [https://developer.ones.com/docs/abilities/about](https://developer.ones.com/docs/abilities/about)
@@ -0,0 +1,5 @@
1
+ save-exact = true
2
+ registry = https://registry.npmmirror.com/
3
+ @ones:registry = https://npm.partner.ones.cn/registry/
4
+ @ones-mf:registry = https://npm2.myones.net/
5
+ @ones-op:registry = https://npm.partner.ones.cn/registry/
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "allowSyntheticDefaultImports": true,
5
+ "baseUrl": ".",
6
+ "esModuleInterop": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "lib": ["esnext"],
9
+ "module": "esnext",
10
+ "moduleResolution": "node",
11
+ "noImplicitAny": false,
12
+ "paths": {
13
+ "@/*": ["src/*"],
14
+ "*": ["node_modules/*"]
15
+ },
16
+ "resolveJsonModule": true,
17
+ "skipLibCheck": true,
18
+ "strict": true,
19
+ "target": "ESNext"
20
+ },
21
+ "exclude": ["node_modules/**"],
22
+ "include": ["src/**/*"]
23
+ }
@@ -0,0 +1,2 @@
1
+ __test__/
2
+ op.config.mjs
@@ -0,0 +1,97 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ node: true,
6
+ },
7
+ parser: '@typescript-eslint/parser',
8
+ parserOptions: {
9
+ ecmaFeatures: {
10
+ impliedStrict: true,
11
+ jsx: true,
12
+ },
13
+ ecmaVersion: 'latest',
14
+ sourceType: 'module',
15
+ project: ['./*/tsconfig.json'],
16
+ tsconfigRootDir: __dirname,
17
+ },
18
+ ignorePatterns: ['.eslintrc.js', 'commitlint.config.js'],
19
+ plugins: ['react-hooks', '@typescript-eslint'],
20
+ extends: [
21
+ 'eslint:recommended',
22
+ 'plugin:@typescript-eslint/recommended',
23
+ 'plugin:react-hooks/recommended',
24
+ 'plugin:yml/standard',
25
+ 'prettier',
26
+ ],
27
+ overrides: [
28
+ {
29
+ files: ['*.tsx', '*.ts'],
30
+ parser: '@typescript-eslint/parser',
31
+ rules: {
32
+ '@typescript-eslint/no-this-alias': 'off',
33
+ '@typescript-eslint/ban-types': 'warn',
34
+ '@typescript-eslint/ban-ts-comment': 'warn',
35
+ '@typescript-eslint/no-unused-vars': 'warn',
36
+ '@typescript-eslint/no-explicit-any': 'warn',
37
+ '@typescript-eslint/member-ordering': 'warn',
38
+ '@typescript-eslint/no-redundant-type-constituents': 'warn',
39
+ '@typescript-eslint/explicit-module-boundary-types': 'warn',
40
+ '@typescript-eslint/prefer-optional-chain': 'error',
41
+ '@typescript-eslint/consistent-type-imports': 'error',
42
+ '@typescript-eslint/consistent-generic-constructors': 'error',
43
+ '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
44
+ '@typescript-eslint/no-use-before-define': [
45
+ 'error',
46
+ {
47
+ functions: false,
48
+ typedefs: false,
49
+ },
50
+ ],
51
+ '@typescript-eslint/consistent-type-exports': [
52
+ 'error',
53
+ {
54
+ fixMixedExportsWithInlineTypeSpecifier: true,
55
+ },
56
+ ],
57
+ },
58
+ },
59
+ {
60
+ files: ['*.yaml', '*.yml'],
61
+ parser: 'yaml-eslint-parser',
62
+ parserOptions: {
63
+ defaultYAMLVersion: '1.2',
64
+ },
65
+ rules: {
66
+ 'yml/quotes': 'off',
67
+ 'yml/spaced-comment': 'warn',
68
+ 'yml/no-empty-document': 'warn',
69
+ 'yml/no-empty-mapping-value': 'warn',
70
+ },
71
+ },
72
+ ],
73
+ rules: {
74
+ 'no-use-before-define': 'off',
75
+ 'no-constant-binary-expression': 'error',
76
+ 'no-console': [
77
+ 'warn',
78
+ {
79
+ allow: ['error', 'warn'],
80
+ },
81
+ ],
82
+ 'object-shorthand': [
83
+ 'error',
84
+ 'always',
85
+ {
86
+ avoidQuotes: true,
87
+ },
88
+ ],
89
+ 'prefer-const': [
90
+ 'error',
91
+ {
92
+ destructuring: 'all',
93
+ },
94
+ ],
95
+ 'react-hooks/exhaustive-deps': 'error',
96
+ },
97
+ }
@@ -0,0 +1,21 @@
1
+ .idea
2
+ .vscode
3
+ node_modules
4
+ *.gitkeep
5
+ /config/local.yaml
6
+ /config/local2.yaml
7
+ *.opk
8
+ *.log
9
+ .DS_Store
10
+
11
+ /backend/coverage/
12
+ /backend/npm-debug.log
13
+ /backend/dist
14
+ /backend/pkg
15
+ /backend/ones-plugin-node-host.log
16
+
17
+ /web/coverage/
18
+ /web/npm-debug.log
19
+ /web/dist
20
+ /web/pkg
21
+ /web/ones-plugin-node-host.log
@@ -0,0 +1,3 @@
1
+ include:
2
+ - project: root/plugin-ci-template
3
+ file: /plugin-nodejs.yml
@@ -0,0 +1 @@
1
+ npx lint-staged
@@ -0,0 +1,5 @@
1
+ save-exact = true
2
+ registry = https://registry.npmmirror.com/
3
+ @ones:registry = https://npm.partner.ones.cn/registry/
4
+ @ones-mf:registry = https://npm2.myones.net/
5
+ @ones-op:registry = https://npm.partner.ones.cn/registry/
@@ -0,0 +1,15 @@
1
+ .husky/
2
+ dist/
3
+ docs/
4
+ node_modules/
5
+ test/
6
+ *.png
7
+ *.svg
8
+ .gitignore
9
+ .npmrc
10
+ .prettierignore
11
+ .eslintignore
12
+ browserslist
13
+ LICENSE
14
+ package*.json
15
+ workspace/
@@ -0,0 +1,6 @@
1
+ {
2
+ "printWidth": 100,
3
+ "quoteProps": "consistent",
4
+ "semi": false,
5
+ "singleQuote": true
6
+ }
@@ -0,0 +1,5 @@
1
+ save-exact = true
2
+ registry = https://registry.npmmirror.com/
3
+ @ones:registry = https://npm.partner.ones.cn/registry/
4
+ @ones-mf:registry = https://npm2.myones.net/
5
+ @ones-op:registry = https://npm.partner.ones.cn/registry/
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "allowSyntheticDefaultImports": true,
5
+ "baseUrl": ".",
6
+ "isolatedModules": true,
7
+ "jsx": "preserve",
8
+ "moduleResolution": "node",
9
+ "noEmit": true,
10
+ "paths": {
11
+ "modules/*": ["src/modules/*"]
12
+ },
13
+ "resolveJsonModule": true,
14
+ "skipLibCheck": true,
15
+ "strict": true,
16
+ "target": "ESNext"
17
+ },
18
+ "exclude": ["node_modules/**"],
19
+ "include": ["src/**/*"]
20
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "node-plugin-template-backend",
3
+ "version": "1.0.0",
4
+ "description": "node.js 插件模版。",
5
+ "main": "dist/index.js",
6
+ "private": true,
7
+ "scripts": {
8
+ "lint": "tsc --noEmit && eslint \"src/**/*.{js,ts}\" --quiet --fix"
9
+ }
10
+ }