@sqaoss/flowy 0.1.1 → 1.0.2

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.
@@ -1,134 +0,0 @@
1
- import { Command } from 'commander'
2
- import { graphql } from '../util/client.ts'
3
- import { output, outputError } from '../util/format.ts'
4
-
5
- export const nodeCommand = new Command('node').description('Manage work nodes')
6
-
7
- nodeCommand
8
- .command('create')
9
- .description('Create a new node')
10
- .requiredOption(
11
- '--type <type>',
12
- 'Node type (client, project, feature, epic, task)',
13
- )
14
- .requiredOption('--title <title>', 'Node title')
15
- .option('--description <desc>', 'Node description')
16
- .option('--status <status>', 'Initial status')
17
- .option('--metadata <json>', 'Metadata as JSON string')
18
- .action(async (opts) => {
19
- try {
20
- const data = await graphql<{ createNode: unknown }>(
21
- `mutation CreateNode($type: String!, $title: String!, $description: String, $status: String, $metadata: String) {
22
- createNode(type: $type, title: $title, description: $description, status: $status, metadata: $metadata) {
23
- id type title description status metadata createdAt updatedAt
24
- }
25
- }`,
26
- {
27
- type: opts.type,
28
- title: opts.title,
29
- description: opts.description,
30
- status: opts.status,
31
- metadata: opts.metadata,
32
- },
33
- )
34
- output(data.createNode)
35
- } catch (error) {
36
- outputError(error)
37
- }
38
- })
39
-
40
- nodeCommand
41
- .command('get')
42
- .description('Get a node by ID')
43
- .requiredOption('--id <id>', 'Node ID')
44
- .action(async (opts) => {
45
- try {
46
- const data = await graphql<{ node: unknown }>(
47
- `query GetNode($id: String!) {
48
- node(id: $id) {
49
- id type title description status metadata createdAt updatedAt
50
- }
51
- }`,
52
- { id: opts.id },
53
- )
54
- output(data.node)
55
- } catch (error) {
56
- outputError(error)
57
- }
58
- })
59
-
60
- nodeCommand
61
- .command('list')
62
- .description('List nodes')
63
- .option('--type <type>', 'Filter by type')
64
- .option('--status <status>', 'Filter by status')
65
- .option('--limit <n>', 'Limit results', '50')
66
- .option('--offset <n>', 'Offset results', '0')
67
- .action(async (opts) => {
68
- try {
69
- const data = await graphql<{ nodes: unknown[] }>(
70
- `query ListNodes($type: String, $status: String, $limit: Int, $offset: Int) {
71
- nodes(type: $type, status: $status, limit: $limit, offset: $offset) {
72
- id type title description status metadata createdAt updatedAt
73
- }
74
- }`,
75
- {
76
- type: opts.type,
77
- status: opts.status,
78
- limit: Number.parseInt(opts.limit, 10),
79
- offset: Number.parseInt(opts.offset, 10),
80
- },
81
- )
82
- output(data.nodes)
83
- } catch (error) {
84
- outputError(error)
85
- }
86
- })
87
-
88
- nodeCommand
89
- .command('update')
90
- .description('Update a node')
91
- .requiredOption('--id <id>', 'Node ID')
92
- .option('--title <title>', 'New title')
93
- .option('--description <desc>', 'New description')
94
- .option('--status <status>', 'New status')
95
- .option('--metadata <json>', 'New metadata as JSON string')
96
- .action(async (opts) => {
97
- try {
98
- const data = await graphql<{ updateNode: unknown }>(
99
- `mutation UpdateNode($id: String!, $title: String, $description: String, $status: String, $metadata: String) {
100
- updateNode(id: $id, title: $title, description: $description, status: $status, metadata: $metadata) {
101
- id type title description status metadata createdAt updatedAt
102
- }
103
- }`,
104
- {
105
- id: opts.id,
106
- title: opts.title,
107
- description: opts.description,
108
- status: opts.status,
109
- metadata: opts.metadata,
110
- },
111
- )
112
- output(data.updateNode)
113
- } catch (error) {
114
- outputError(error)
115
- }
116
- })
117
-
118
- nodeCommand
119
- .command('delete')
120
- .description('Delete a node')
121
- .requiredOption('--id <id>', 'Node ID')
122
- .action(async (opts) => {
123
- try {
124
- const data = await graphql<{ deleteNode: boolean }>(
125
- `mutation DeleteNode($id: String!) {
126
- deleteNode(id: $id)
127
- }`,
128
- { id: opts.id },
129
- )
130
- output({ deleted: data.deleteNode })
131
- } catch (error) {
132
- outputError(error)
133
- }
134
- })
@@ -1,25 +0,0 @@
1
- import { Command } from 'commander'
2
- import { graphql } from '../util/client.ts'
3
- import { output, outputError } from '../util/format.ts'
4
-
5
- export const registerCommand = new Command('register')
6
- .description('Register a new account')
7
- .requiredOption('--email <email>', 'Your email address')
8
- .action(async (opts) => {
9
- try {
10
- const data = await graphql<{
11
- register: { user: { id: string; email: string }; apiKey: string }
12
- }>(
13
- `mutation Register($email: String!) {
14
- register(email: $email) {
15
- user { id email tier createdAt }
16
- apiKey
17
- }
18
- }`,
19
- { email: opts.email },
20
- )
21
- output(data.register)
22
- } catch (error) {
23
- outputError(error)
24
- }
25
- })