@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.
- package/LICENSE +201 -0
- package/bin/ones.js +4 -0
- package/dist/index.cjs +1889 -0
- package/dist/index.js +1888 -0
- package/dist/types/actions/build/index.d.ts +4 -0
- package/dist/types/actions/build/index.d.ts.map +1 -0
- package/dist/types/actions/build/normalize.d.ts +6 -0
- package/dist/types/actions/build/normalize.d.ts.map +1 -0
- package/dist/types/actions/build/regexp.d.ts +2 -0
- package/dist/types/actions/build/regexp.d.ts.map +1 -0
- package/dist/types/actions/dev/enums.d.ts +11 -0
- package/dist/types/actions/dev/enums.d.ts.map +1 -0
- package/dist/types/actions/dev/index.d.ts +4 -0
- package/dist/types/actions/dev/index.d.ts.map +1 -0
- package/dist/types/actions/dev/normalize.d.ts +6 -0
- package/dist/types/actions/dev/normalize.d.ts.map +1 -0
- package/dist/types/actions/dev/types.d.ts +10 -0
- package/dist/types/actions/dev/types.d.ts.map +1 -0
- package/dist/types/actions/disable/index.d.ts +4 -0
- package/dist/types/actions/disable/index.d.ts.map +1 -0
- package/dist/types/actions/disable/normalize.d.ts +6 -0
- package/dist/types/actions/disable/normalize.d.ts.map +1 -0
- package/dist/types/actions/enable/index.d.ts +4 -0
- package/dist/types/actions/enable/index.d.ts.map +1 -0
- package/dist/types/actions/enable/normalize.d.ts +6 -0
- package/dist/types/actions/enable/normalize.d.ts.map +1 -0
- package/dist/types/actions/index.d.ts +15 -0
- package/dist/types/actions/index.d.ts.map +1 -0
- package/dist/types/actions/install/index.d.ts +5 -0
- package/dist/types/actions/install/index.d.ts.map +1 -0
- package/dist/types/actions/install/install.d.ts +3 -0
- package/dist/types/actions/install/install.d.ts.map +1 -0
- package/dist/types/actions/install/normalize.d.ts +6 -0
- package/dist/types/actions/install/normalize.d.ts.map +1 -0
- package/dist/types/actions/legacy/index.d.ts +4 -0
- package/dist/types/actions/legacy/index.d.ts.map +1 -0
- package/dist/types/actions/legacy/normalize.d.ts +6 -0
- package/dist/types/actions/legacy/normalize.d.ts.map +1 -0
- package/dist/types/actions/login/consts.d.ts +2 -0
- package/dist/types/actions/login/consts.d.ts.map +1 -0
- package/dist/types/actions/login/index.d.ts +4 -0
- package/dist/types/actions/login/index.d.ts.map +1 -0
- package/dist/types/actions/login/normalize.d.ts +6 -0
- package/dist/types/actions/login/normalize.d.ts.map +1 -0
- package/dist/types/actions/login/regexp.d.ts +2 -0
- package/dist/types/actions/login/regexp.d.ts.map +1 -0
- package/dist/types/actions/logout/index.d.ts +4 -0
- package/dist/types/actions/logout/index.d.ts.map +1 -0
- package/dist/types/actions/logout/normalize.d.ts +6 -0
- package/dist/types/actions/logout/normalize.d.ts.map +1 -0
- package/dist/types/actions/tunnel/consts.d.ts +4 -0
- package/dist/types/actions/tunnel/consts.d.ts.map +1 -0
- package/dist/types/actions/tunnel/index.d.ts +7 -0
- package/dist/types/actions/tunnel/index.d.ts.map +1 -0
- package/dist/types/actions/tunnel/normalize.d.ts +6 -0
- package/dist/types/actions/tunnel/normalize.d.ts.map +1 -0
- package/dist/types/actions/tunnel/regexp.d.ts +2 -0
- package/dist/types/actions/tunnel/regexp.d.ts.map +1 -0
- package/dist/types/actions/tunnel/tunnel-client.d.ts +25 -0
- package/dist/types/actions/tunnel/tunnel-client.d.ts.map +1 -0
- package/dist/types/actions/tunnel/tunnel.d.ts +3 -0
- package/dist/types/actions/tunnel/tunnel.d.ts.map +1 -0
- package/dist/types/actions/tunnel/types.d.ts +31 -0
- package/dist/types/actions/tunnel/types.d.ts.map +1 -0
- package/dist/types/actions/tunnel/utils.d.ts +7 -0
- package/dist/types/actions/tunnel/utils.d.ts.map +1 -0
- package/dist/types/actions/uninstall/index.d.ts +4 -0
- package/dist/types/actions/uninstall/index.d.ts.map +1 -0
- package/dist/types/actions/uninstall/normalize.d.ts +6 -0
- package/dist/types/actions/uninstall/normalize.d.ts.map +1 -0
- package/dist/types/actions/whoami/index.d.ts +4 -0
- package/dist/types/actions/whoami/index.d.ts.map +1 -0
- package/dist/types/actions/whoami/normalize.d.ts +6 -0
- package/dist/types/actions/whoami/normalize.d.ts.map +1 -0
- package/dist/types/cli/index.d.ts +2 -0
- package/dist/types/cli/index.d.ts.map +1 -0
- package/dist/types/command/app/index.d.ts +4 -0
- package/dist/types/command/app/index.d.ts.map +1 -0
- package/dist/types/command/build/index.d.ts +10 -0
- package/dist/types/command/build/index.d.ts.map +1 -0
- package/dist/types/command/dev/index.d.ts +11 -0
- package/dist/types/command/dev/index.d.ts.map +1 -0
- package/dist/types/command/disable/index.d.ts +8 -0
- package/dist/types/command/disable/index.d.ts.map +1 -0
- package/dist/types/command/enable/index.d.ts +8 -0
- package/dist/types/command/enable/index.d.ts.map +1 -0
- package/dist/types/command/index.d.ts +16 -0
- package/dist/types/command/index.d.ts.map +1 -0
- package/dist/types/command/install/index.d.ts +8 -0
- package/dist/types/command/install/index.d.ts.map +1 -0
- package/dist/types/command/legacy/index.d.ts +8 -0
- package/dist/types/command/legacy/index.d.ts.map +1 -0
- package/dist/types/command/login/index.d.ts +8 -0
- package/dist/types/command/login/index.d.ts.map +1 -0
- package/dist/types/command/logout/index.d.ts +8 -0
- package/dist/types/command/logout/index.d.ts.map +1 -0
- package/dist/types/command/tunnel/index.d.ts +9 -0
- package/dist/types/command/tunnel/index.d.ts.map +1 -0
- package/dist/types/command/uninstall/index.d.ts +8 -0
- package/dist/types/command/uninstall/index.d.ts.map +1 -0
- package/dist/types/command/whoami/index.d.ts +8 -0
- package/dist/types/command/whoami/index.d.ts.map +1 -0
- package/dist/types/common/base/index.d.ts +5 -0
- package/dist/types/common/base/index.d.ts.map +1 -0
- package/dist/types/common/base/utils.d.ts +7 -0
- package/dist/types/common/base/utils.d.ts.map +1 -0
- package/dist/types/common/command/index.d.ts +6 -0
- package/dist/types/common/command/index.d.ts.map +1 -0
- package/dist/types/common/command/types.d.ts +2 -0
- package/dist/types/common/command/types.d.ts.map +1 -0
- package/dist/types/common/command/utils.d.ts +2 -0
- package/dist/types/common/command/utils.d.ts.map +1 -0
- package/dist/types/common/config/consts.d.ts +5 -0
- package/dist/types/common/config/consts.d.ts.map +1 -0
- package/dist/types/common/config/index.d.ts +7 -0
- package/dist/types/common/config/index.d.ts.map +1 -0
- package/dist/types/common/config/types.d.ts +8 -0
- package/dist/types/common/config/types.d.ts.map +1 -0
- package/dist/types/common/config/utils.d.ts +3 -0
- package/dist/types/common/config/utils.d.ts.map +1 -0
- package/dist/types/common/context/index.d.ts +6 -0
- package/dist/types/common/context/index.d.ts.map +1 -0
- package/dist/types/common/context/types.d.ts +2 -0
- package/dist/types/common/context/types.d.ts.map +1 -0
- package/dist/types/common/context/utils.d.ts +2 -0
- package/dist/types/common/context/utils.d.ts.map +1 -0
- package/dist/types/common/error/enums.d.ts +20 -0
- package/dist/types/common/error/enums.d.ts.map +1 -0
- package/dist/types/common/error/index.d.ts +7 -0
- package/dist/types/common/error/index.d.ts.map +1 -0
- package/dist/types/common/error/types.d.ts +2 -0
- package/dist/types/common/error/types.d.ts.map +1 -0
- package/dist/types/common/error/utils.d.ts +2 -0
- package/dist/types/common/error/utils.d.ts.map +1 -0
- package/dist/types/common/locales/en/index.d.ts +41 -0
- package/dist/types/common/locales/en/index.d.ts.map +1 -0
- package/dist/types/common/locales/index.d.ts +6 -0
- package/dist/types/common/locales/index.d.ts.map +1 -0
- package/dist/types/common/locales/types.d.ts +4 -0
- package/dist/types/common/locales/types.d.ts.map +1 -0
- package/dist/types/common/locales/utils.d.ts +6 -0
- package/dist/types/common/locales/utils.d.ts.map +1 -0
- package/dist/types/common/package/index.d.ts +7 -0
- package/dist/types/common/package/index.d.ts.map +1 -0
- package/dist/types/common/package/schema.d.ts +3 -0
- package/dist/types/common/package/schema.d.ts.map +1 -0
- package/dist/types/common/package/types.d.ts +2 -0
- package/dist/types/common/package/types.d.ts.map +1 -0
- package/dist/types/common/package/utils.d.ts +16 -0
- package/dist/types/common/package/utils.d.ts.map +1 -0
- package/dist/types/common/public/consts.d.ts +2 -0
- package/dist/types/common/public/consts.d.ts.map +1 -0
- package/dist/types/common/public/index.d.ts +6 -0
- package/dist/types/common/public/index.d.ts.map +1 -0
- package/dist/types/common/public/utils.d.ts +2 -0
- package/dist/types/common/public/utils.d.ts.map +1 -0
- package/dist/types/common/request/consts.d.ts +16 -0
- package/dist/types/common/request/consts.d.ts.map +1 -0
- package/dist/types/common/request/fetch.d.ts +13 -0
- package/dist/types/common/request/fetch.d.ts.map +1 -0
- package/dist/types/common/request/index.d.ts +8 -0
- package/dist/types/common/request/index.d.ts.map +1 -0
- package/dist/types/common/request/types.d.ts +98 -0
- package/dist/types/common/request/types.d.ts.map +1 -0
- package/dist/types/common/request/utils.d.ts +11 -0
- package/dist/types/common/request/utils.d.ts.map +1 -0
- package/dist/types/common/store/index.d.ts +6 -0
- package/dist/types/common/store/index.d.ts.map +1 -0
- package/dist/types/common/store/schema.d.ts +75 -0
- package/dist/types/common/store/schema.d.ts.map +1 -0
- package/dist/types/common/store/utils.d.ts +13 -0
- package/dist/types/common/store/utils.d.ts.map +1 -0
- package/dist/types/common/template/index.d.ts +5 -0
- package/dist/types/common/template/index.d.ts.map +1 -0
- package/dist/types/common/template/utils.d.ts +3 -0
- package/dist/types/common/template/utils.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +83 -0
- package/public/callback.html +65 -0
- package/public/logo.svg +4 -0
- package/template/legacy/README.md +13 -0
- package/template/legacy/_backend_npmrc +5 -0
- package/template/legacy/_backend_tsconfig.json +23 -0
- package/template/legacy/_eslintignore +2 -0
- package/template/legacy/_eslintrc.js +97 -0
- package/template/legacy/_gitignore +21 -0
- package/template/legacy/_gitlab-ci.yml +3 -0
- package/template/legacy/_husky_pre-commit +1 -0
- package/template/legacy/_npmrc +5 -0
- package/template/legacy/_prettierignore +15 -0
- package/template/legacy/_prettierrc +6 -0
- package/template/legacy/_web_npmrc +5 -0
- package/template/legacy/_web_tsconfig.json +20 -0
- package/template/legacy/backend/package.json +10 -0
- package/template/legacy/backend/src/index.ts +139 -0
- package/template/legacy/backend/src/ones.d.ts +6 -0
- package/template/legacy/config/ci-deploy.yaml +11 -0
- package/template/legacy/config/local.yaml +30 -0
- package/template/legacy/config/plugin.yaml +25 -0
- package/template/legacy/config/upgrade.yaml +8 -0
- package/template/legacy/op.config.mjs +4 -0
- package/template/legacy/package-lock.json +17446 -0
- package/template/legacy/package.json +73 -0
- package/template/legacy/web/browserslist +4 -0
- package/template/legacy/web/package.json +29 -0
- package/template/legacy/web/public/logo.svg +5 -0
- package/template/legacy/workspace/plugin.sql +2 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Logger } from '@ones-op/node-logger'
|
|
2
|
+
import { env } from '@ones-op/sdk/backend'
|
|
3
|
+
import type { PluginRequest, PluginResponse } from '@ones-op/node-types'
|
|
4
|
+
|
|
5
|
+
// Method called when the team level plugin is being installed.
|
|
6
|
+
export async function Install() {
|
|
7
|
+
Logger.info('[Plugin] Install')
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Method called when the team level plugin is being launched.
|
|
11
|
+
export async function Enable() {
|
|
12
|
+
Logger.info('[Plugin] Enable')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Method called when the team level plugin is being suspended.
|
|
16
|
+
export function Disable() {
|
|
17
|
+
Logger.info('[Plugin] Disable')
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Method called when the team level plugin is being uninstalled.
|
|
21
|
+
export function UnInstall() {
|
|
22
|
+
Logger.info('[Plugin] UnInstall')
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Method called when the team level plugin is being upgraded.
|
|
26
|
+
export function Upgrade(oldPluginInfo: any) {
|
|
27
|
+
const oldVersion = oldPluginInfo.version
|
|
28
|
+
Logger.info('[Plugin] Upgrade', 'old version:', oldVersion)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
Method called when the organization level plugin is being installed.
|
|
33
|
+
|
|
34
|
+
Request parameter description:
|
|
35
|
+
request:
|
|
36
|
+
request.parsedHeaders state multi-language, for example,when the request user context is chinese,
|
|
37
|
+
the parameter will be {"Accept-Language":["zh"]}, there are other cases like {"Accept-Language":["en"]},
|
|
38
|
+
{"Accept-Language":["ja"]}.
|
|
39
|
+
teamUUIDList:
|
|
40
|
+
The uuid list with the team which installed by this time.
|
|
41
|
+
firstInstall:
|
|
42
|
+
True if plugin has never been installed.
|
|
43
|
+
*/
|
|
44
|
+
export async function OrgInstall(
|
|
45
|
+
request: PluginRequest,
|
|
46
|
+
teamUUIDList: string[],
|
|
47
|
+
firstInstall: boolean,
|
|
48
|
+
) {
|
|
49
|
+
Logger.info('[Plugin] OrgInstall')
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
Method called when the organization level plugin is being launched.
|
|
54
|
+
|
|
55
|
+
Request parameters description:
|
|
56
|
+
request:
|
|
57
|
+
request.parsedHeaders state multi-language, for example,when the request user context is chinese,
|
|
58
|
+
the parameter will be {"Accept-Language":["zh"]}, there are other cases like {"Accept-Language":["en"]},
|
|
59
|
+
{"Accept-Language":["ja"]}.
|
|
60
|
+
teamUUIDList:
|
|
61
|
+
The uuid list with the team which launched by this time.
|
|
62
|
+
|
|
63
|
+
Response parameters description:
|
|
64
|
+
Return the failed team uuid list.
|
|
65
|
+
*/
|
|
66
|
+
export function OrgEnable(
|
|
67
|
+
request: PluginRequest,
|
|
68
|
+
teamUUIDList: string[],
|
|
69
|
+
): void | string[] | Promise<string[]> {
|
|
70
|
+
Logger.info('[Plugin] OrgEnable')
|
|
71
|
+
return []
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
Method called when the organization level plugin is being suspended.
|
|
76
|
+
|
|
77
|
+
Request parameters description:
|
|
78
|
+
request:
|
|
79
|
+
request.parsedHeaders state multi-language, for example,when the request user context is chinese,
|
|
80
|
+
the parameter will be {"Accept-Language":["zh"]}, there are other cases like {"Accept-Language":["en"]},
|
|
81
|
+
{"Accept-Language":["ja"]}.
|
|
82
|
+
teamUUIDList:
|
|
83
|
+
The uuid list with the team which suspended by this time.
|
|
84
|
+
|
|
85
|
+
Response parameters description:
|
|
86
|
+
Return the failed team uuid list.
|
|
87
|
+
*/
|
|
88
|
+
export function OrgDisable(
|
|
89
|
+
request: PluginRequest,
|
|
90
|
+
teamUUIDList: string[],
|
|
91
|
+
): void | string[] | Promise<string[]> {
|
|
92
|
+
Logger.info('[Plugin] OrgDisable')
|
|
93
|
+
return []
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
Method called when the organization level plugin is being uninstalled.
|
|
98
|
+
|
|
99
|
+
Request parameters description:
|
|
100
|
+
request:
|
|
101
|
+
request.parsedHeaders state multi-language, for example,when the request user context is chinese,
|
|
102
|
+
the parameter will be {"Accept-Language":["zh"]}, there are other cases like {"Accept-Language":["en"]},
|
|
103
|
+
{"Accept-Language":["ja"]}.
|
|
104
|
+
teamUUIDList:
|
|
105
|
+
The uuid list with the team which uninstalled by this time.
|
|
106
|
+
*/
|
|
107
|
+
export function OrgUnInstall(request: PluginRequest, teamUUIDList: string[]) {
|
|
108
|
+
Logger.info('[Plugin] OrgUnInstall')
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/*
|
|
112
|
+
Method called when the organization level plugin is being upgraded.
|
|
113
|
+
|
|
114
|
+
Request parameters description:
|
|
115
|
+
request:
|
|
116
|
+
request.parsedHeaders state multi-language, for example,when the request user context is chinese,
|
|
117
|
+
the parameter will be {"Accept-Language":["zh"]}, there are other cases like {"Accept-Language":["en"]},
|
|
118
|
+
{"Accept-Language":["ja"]}.
|
|
119
|
+
teamUUIDList:
|
|
120
|
+
The uuid list with the team which upgraded by this time.
|
|
121
|
+
*/
|
|
122
|
+
export function OrgUpgrade(oldPluginInfo: any, request: PluginRequest, teamUUIDList: string[]) {
|
|
123
|
+
const oldVersion = oldPluginInfo.version
|
|
124
|
+
Logger.info('[Plugin] OrgUpgrade', 'old version:', oldVersion)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// example function
|
|
128
|
+
export async function hello(request: PluginRequest): Promise<PluginResponse> {
|
|
129
|
+
const body = request.body || {}
|
|
130
|
+
Logger.info('[Plugin] hello ======= 请求成功')
|
|
131
|
+
return {
|
|
132
|
+
body: {
|
|
133
|
+
res: 'hello world',
|
|
134
|
+
orgId: await env.getOrgId(),
|
|
135
|
+
teamID: await env.getTeamID(),
|
|
136
|
+
requestBody: body,
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
platform:
|
|
2
|
+
address: ''
|
|
3
|
+
baseURL: ''
|
|
4
|
+
username: ''
|
|
5
|
+
plugin:
|
|
6
|
+
app_id: ''
|
|
7
|
+
scope: 0
|
|
8
|
+
local:
|
|
9
|
+
id: '4085451291'
|
|
10
|
+
language: nodejs
|
|
11
|
+
debug_mode: false
|
|
12
|
+
timeout_sec: 30
|
|
13
|
+
organization_uuid: ''
|
|
14
|
+
team_uuid: ''
|
|
15
|
+
web_service_port: '3000'
|
|
16
|
+
web_service_ip: 127.0.0.1
|
|
17
|
+
server_port: 3001
|
|
18
|
+
user_uuid: ''
|
|
19
|
+
log_in_local: false
|
|
20
|
+
log_level: info
|
|
21
|
+
file_in_local: false
|
|
22
|
+
mysql_in_local: false
|
|
23
|
+
mysql_user_name: ''
|
|
24
|
+
mysql_user_password: ''
|
|
25
|
+
mysql_database_name: ''
|
|
26
|
+
mysql_host: ''
|
|
27
|
+
mysql_port: ''
|
|
28
|
+
instance_uuid: ''
|
|
29
|
+
dangerously_accept_unauthorized_https: false
|
|
30
|
+
host_dist_tag: ''
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
service:
|
|
2
|
+
app_id: plugin
|
|
3
|
+
name: plugin
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: plugin
|
|
6
|
+
mode: org
|
|
7
|
+
logo: null
|
|
8
|
+
language: nodejs
|
|
9
|
+
language_version: 16.13.0
|
|
10
|
+
host_version: 1.0.4
|
|
11
|
+
host_sub_version: 1.0.0
|
|
12
|
+
min_system_version: 3.5.0
|
|
13
|
+
auth: null
|
|
14
|
+
config: null
|
|
15
|
+
scope: 1
|
|
16
|
+
policy:
|
|
17
|
+
policy: simple
|
|
18
|
+
target: ''
|
|
19
|
+
apis:
|
|
20
|
+
- type: addition
|
|
21
|
+
methods:
|
|
22
|
+
- POST
|
|
23
|
+
url: /hello
|
|
24
|
+
function: hello
|
|
25
|
+
modules: []
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#Indicates the processing rules for plugin workspace file conflicts. Enumeration value [save_new, save_old]:
|
|
2
|
+
# save_old, save the old file when the old file conflicts with the new file;
|
|
3
|
+
# save_new,which contrary to the save_old.
|
|
4
|
+
workspace:
|
|
5
|
+
rule: save_new
|
|
6
|
+
#Array of regular expressions, expressing files that are not in default rules.
|
|
7
|
+
exclude:
|
|
8
|
+
# - example.txt
|