opensoma 0.5.0 → 0.6.0
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/dist/package.json +5 -1
- package/dist/src/agent-browser-launcher.d.ts +43 -0
- package/dist/src/agent-browser-launcher.d.ts.map +1 -0
- package/dist/src/agent-browser-launcher.js +97 -0
- package/dist/src/agent-browser-launcher.js.map +1 -0
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +3 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/client.d.ts +36 -7
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +231 -63
- package/dist/src/client.js.map +1 -1
- package/dist/src/commands/agent-browser.d.ts +3 -0
- package/dist/src/commands/agent-browser.d.ts.map +1 -0
- package/dist/src/commands/agent-browser.js +27 -0
- package/dist/src/commands/agent-browser.js.map +1 -0
- package/dist/src/commands/auth.d.ts +1 -1
- package/dist/src/commands/auth.d.ts.map +1 -1
- package/dist/src/commands/auth.js +4 -2
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/dashboard.d.ts +13 -0
- package/dist/src/commands/dashboard.d.ts.map +1 -1
- package/dist/src/commands/dashboard.js +10 -18
- package/dist/src/commands/dashboard.js.map +1 -1
- package/dist/src/commands/helpers.d.ts +1 -1
- package/dist/src/commands/helpers.d.ts.map +1 -1
- package/dist/src/commands/helpers.js +2 -2
- package/dist/src/commands/helpers.js.map +1 -1
- package/dist/src/commands/index.d.ts +2 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +2 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/mentoring.d.ts.map +1 -1
- package/dist/src/commands/mentoring.js +54 -29
- package/dist/src/commands/mentoring.js.map +1 -1
- package/dist/src/commands/notice.d.ts.map +1 -1
- package/dist/src/commands/notice.js +2 -1
- package/dist/src/commands/notice.js.map +1 -1
- package/dist/src/commands/report.d.ts.map +1 -1
- package/dist/src/commands/report.js +4 -2
- package/dist/src/commands/report.js.map +1 -1
- package/dist/src/commands/room.d.ts.map +1 -1
- package/dist/src/commands/room.js +125 -2
- package/dist/src/commands/room.js.map +1 -1
- package/dist/src/commands/schedule.d.ts +3 -0
- package/dist/src/commands/schedule.d.ts.map +1 -0
- package/dist/src/commands/schedule.js +27 -0
- package/dist/src/commands/schedule.js.map +1 -0
- package/dist/src/commands/team.d.ts.map +1 -1
- package/dist/src/commands/team.js +55 -4
- package/dist/src/commands/team.js.map +1 -1
- package/dist/src/constants.d.ts +5 -5
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +20 -8
- package/dist/src/constants.js.map +1 -1
- package/dist/src/credential-manager.d.ts +9 -0
- package/dist/src/credential-manager.d.ts.map +1 -1
- package/dist/src/credential-manager.js +24 -0
- package/dist/src/credential-manager.js.map +1 -1
- package/dist/src/formatters.d.ts +11 -3
- package/dist/src/formatters.d.ts.map +1 -1
- package/dist/src/formatters.js +281 -52
- package/dist/src/formatters.js.map +1 -1
- package/dist/src/http.d.ts +8 -0
- package/dist/src/http.d.ts.map +1 -1
- package/dist/src/http.js +29 -1
- package/dist/src/http.js.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/shared/utils/swmaestro.d.ts +34 -1
- package/dist/src/shared/utils/swmaestro.d.ts.map +1 -1
- package/dist/src/shared/utils/swmaestro.js +102 -43
- package/dist/src/shared/utils/swmaestro.js.map +1 -1
- package/dist/src/shared/utils/team-action-params.d.ts +3 -0
- package/dist/src/shared/utils/team-action-params.d.ts.map +1 -0
- package/dist/src/shared/utils/team-action-params.js +10 -0
- package/dist/src/shared/utils/team-action-params.js.map +1 -0
- package/dist/src/shared/utils/team-params.d.ts +12 -0
- package/dist/src/shared/utils/team-params.d.ts.map +1 -0
- package/dist/src/shared/utils/team-params.js +38 -0
- package/dist/src/shared/utils/team-params.js.map +1 -0
- package/dist/src/types.d.ts +147 -10
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +74 -6
- package/dist/src/types.js.map +1 -1
- package/package.json +5 -1
- package/src/agent-browser-launcher.test.ts +263 -0
- package/src/agent-browser-launcher.ts +159 -0
- package/src/cli.ts +4 -2
- package/src/client.test.ts +801 -140
- package/src/client.ts +293 -79
- package/src/commands/agent-browser.ts +33 -0
- package/src/commands/auth.test.ts +83 -32
- package/src/commands/auth.ts +5 -3
- package/src/commands/dashboard.test.ts +57 -0
- package/src/commands/dashboard.ts +22 -19
- package/src/commands/helpers.test.ts +79 -32
- package/src/commands/helpers.ts +3 -3
- package/src/commands/index.ts +2 -1
- package/src/commands/mentoring.ts +60 -29
- package/src/commands/notice.ts +2 -1
- package/src/commands/report.test.ts +7 -7
- package/src/commands/report.ts +4 -2
- package/src/commands/room.ts +160 -1
- package/src/commands/schedule.ts +32 -0
- package/src/commands/team.ts +73 -5
- package/src/constants.ts +20 -8
- package/src/credential-manager.test.ts +49 -5
- package/src/credential-manager.ts +27 -0
- package/src/formatters.test.ts +548 -53
- package/src/formatters.ts +309 -55
- package/src/http.test.ts +108 -39
- package/src/http.ts +41 -2
- package/src/index.ts +10 -1
- package/src/shared/utils/mentoring-params.test.ts +16 -16
- package/src/shared/utils/swmaestro.test.ts +326 -11
- package/src/shared/utils/swmaestro.ts +150 -52
- package/src/shared/utils/team-action-params.test.ts +32 -0
- package/src/shared/utils/team-action-params.ts +10 -0
- package/src/shared/utils/team-params.test.ts +141 -0
- package/src/shared/utils/team-params.ts +53 -0
- package/src/shared/utils/toz.test.ts +12 -7
- package/src/token-extractor.test.ts +12 -12
- package/src/toz-http.test.ts +11 -11
- package/src/types.test.ts +235 -206
- package/src/types.ts +87 -7
- package/dist/src/commands/event.d.ts +0 -3
- package/dist/src/commands/event.d.ts.map +0 -1
- package/dist/src/commands/event.js +0 -58
- package/dist/src/commands/event.js.map +0 -1
- package/src/commands/event.ts +0 -73
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { MENU_NO } from '../constants.js';
|
|
3
|
-
import * as formatters from '../formatters.js';
|
|
4
|
-
import { handleError } from '../shared/utils/error-handler.js';
|
|
5
|
-
import { formatOutput } from '../shared/utils/output.js';
|
|
6
|
-
import { buildApplicationPayload, parseEventDetail } from '../shared/utils/swmaestro.js';
|
|
7
|
-
import { getHttpOrExit } from './helpers.js';
|
|
8
|
-
async function listAction(options) {
|
|
9
|
-
try {
|
|
10
|
-
const http = await getHttpOrExit();
|
|
11
|
-
const html = await http.get('/mypage/applicants/list.do', {
|
|
12
|
-
menuNo: MENU_NO.EVENT,
|
|
13
|
-
...(options.page ? { pageIndex: options.page } : {}),
|
|
14
|
-
});
|
|
15
|
-
console.log(formatOutput({ items: formatters.parseEventList(html), pagination: formatters.parsePagination(html) }, options.pretty));
|
|
16
|
-
}
|
|
17
|
-
catch (error) {
|
|
18
|
-
handleError(error);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
async function getAction(id, options) {
|
|
22
|
-
try {
|
|
23
|
-
const http = await getHttpOrExit();
|
|
24
|
-
const html = await http.get('/mypage/applicants/view.do', { menuNo: MENU_NO.EVENT, bbsId: id });
|
|
25
|
-
console.log(formatOutput(parseEventDetail(html), options.pretty));
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
handleError(error);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
async function applyAction(id, options) {
|
|
32
|
-
try {
|
|
33
|
-
const http = await getHttpOrExit();
|
|
34
|
-
await http.post('/application/application/application.do', buildApplicationPayload(Number.parseInt(id, 10)));
|
|
35
|
-
console.log(formatOutput({ ok: true }, options.pretty));
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
handleError(error);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
export const eventCommand = new Command('event')
|
|
42
|
-
.description('Browse and apply to events')
|
|
43
|
-
.addCommand(new Command('list')
|
|
44
|
-
.description('List events')
|
|
45
|
-
.option('--page <n>', 'Page number')
|
|
46
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
47
|
-
.action(listAction))
|
|
48
|
-
.addCommand(new Command('get')
|
|
49
|
-
.description('Get event detail')
|
|
50
|
-
.argument('<id>')
|
|
51
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
52
|
-
.action(getAction))
|
|
53
|
-
.addCommand(new Command('apply')
|
|
54
|
-
.description('Apply to an event')
|
|
55
|
-
.argument('<id>')
|
|
56
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
57
|
-
.action(applyAction));
|
|
58
|
-
//# sourceMappingURL=event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/commands/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAKzC,KAAK,UAAU,UAAU,CAAC,OAAoB;IAC5C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,aAAa,EAAE,CAAA;QAClC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,4BAA4B,EAAE;YACxD,MAAM,EAAE,OAAO,CAAC,KAAK;YACrB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrD,CAAC,CAAA;QAC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CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CAAC,4BAA4B,CAAC;KACzC,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,aAAa,CAAC;KAC1B,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC;KACnC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,UAAU,CAAC,CACtB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,KAAK,CAAC;KACf,WAAW,CAAC,kBAAkB,CAAC;KAC/B,QAAQ,CAAC,MAAM,CAAC;KAChB,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,SAAS,CAAC,CACrB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,OAAO,CAAC;KACjB,WAAW,CAAC,mBAAmB,CAAC;KAChC,QAAQ,CAAC,MAAM,CAAC;KAChB,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,WAAW,CAAC,CACvB,CAAA"}
|
package/src/commands/event.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander'
|
|
2
|
-
|
|
3
|
-
import { MENU_NO } from '../constants'
|
|
4
|
-
import * as formatters from '../formatters'
|
|
5
|
-
import { handleError } from '../shared/utils/error-handler'
|
|
6
|
-
import { formatOutput } from '../shared/utils/output'
|
|
7
|
-
import { buildApplicationPayload, parseEventDetail } from '../shared/utils/swmaestro'
|
|
8
|
-
import { getHttpOrExit } from './helpers'
|
|
9
|
-
|
|
10
|
-
type ListOptions = { page?: string; pretty?: boolean }
|
|
11
|
-
type GetOptions = { pretty?: boolean }
|
|
12
|
-
|
|
13
|
-
async function listAction(options: ListOptions): Promise<void> {
|
|
14
|
-
try {
|
|
15
|
-
const http = await getHttpOrExit()
|
|
16
|
-
const html = await http.get('/mypage/applicants/list.do', {
|
|
17
|
-
menuNo: MENU_NO.EVENT,
|
|
18
|
-
...(options.page ? { pageIndex: options.page } : {}),
|
|
19
|
-
})
|
|
20
|
-
console.log(
|
|
21
|
-
formatOutput(
|
|
22
|
-
{ items: formatters.parseEventList(html), pagination: formatters.parsePagination(html) },
|
|
23
|
-
options.pretty,
|
|
24
|
-
),
|
|
25
|
-
)
|
|
26
|
-
} catch (error) {
|
|
27
|
-
handleError(error)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async function getAction(id: string, options: GetOptions): Promise<void> {
|
|
32
|
-
try {
|
|
33
|
-
const http = await getHttpOrExit()
|
|
34
|
-
const html = await http.get('/mypage/applicants/view.do', { menuNo: MENU_NO.EVENT, bbsId: id })
|
|
35
|
-
console.log(formatOutput(parseEventDetail(html), options.pretty))
|
|
36
|
-
} catch (error) {
|
|
37
|
-
handleError(error)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async function applyAction(id: string, options: GetOptions): Promise<void> {
|
|
42
|
-
try {
|
|
43
|
-
const http = await getHttpOrExit()
|
|
44
|
-
await http.post('/application/application/application.do', buildApplicationPayload(Number.parseInt(id, 10)))
|
|
45
|
-
console.log(formatOutput({ ok: true }, options.pretty))
|
|
46
|
-
} catch (error) {
|
|
47
|
-
handleError(error)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const eventCommand = new Command('event')
|
|
52
|
-
.description('Browse and apply to events')
|
|
53
|
-
.addCommand(
|
|
54
|
-
new Command('list')
|
|
55
|
-
.description('List events')
|
|
56
|
-
.option('--page <n>', 'Page number')
|
|
57
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
58
|
-
.action(listAction),
|
|
59
|
-
)
|
|
60
|
-
.addCommand(
|
|
61
|
-
new Command('get')
|
|
62
|
-
.description('Get event detail')
|
|
63
|
-
.argument('<id>')
|
|
64
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
65
|
-
.action(getAction),
|
|
66
|
-
)
|
|
67
|
-
.addCommand(
|
|
68
|
-
new Command('apply')
|
|
69
|
-
.description('Apply to an event')
|
|
70
|
-
.argument('<id>')
|
|
71
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
72
|
-
.action(applyAction),
|
|
73
|
-
)
|