@docyrus/docyrus 0.0.1

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 (4) hide show
  1. package/README.md +128 -0
  2. package/main.js +42107 -0
  3. package/main.js.map +7 -0
  4. package/package.json +19 -0
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # @docyrus/docyrus
2
+
3
+ Docyrus API CLI.
4
+
5
+ CLI state files are stored under `~/.docyrus/` (`auth.json`, `config.json`).
6
+ Tenant OpenAPI files are stored under `~/docyrus/tenans/<tenantId>/openapi.json`.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install -g @docyrus/docyrus
12
+ ```
13
+
14
+ or
15
+
16
+ ```bash
17
+ pnpm add -g @docyrus/docyrus
18
+ ```
19
+
20
+ ## Environments
21
+
22
+ List and switch environments:
23
+
24
+ ```bash
25
+ docyrus env list
26
+ docyrus env use live
27
+ ```
28
+
29
+ Default environments:
30
+ - `live` -> `https://api.docyrus.com`
31
+ - `beta` -> `https://beta-api.docyrus.com`
32
+ - `alpha` -> `https://alpha-api.docyrus.com`
33
+ - `dev` -> `https://localhost:3366`
34
+
35
+ Aliases:
36
+ - `prod` -> `live`
37
+
38
+ ## Authentication
39
+
40
+ Login with explicit client ID:
41
+
42
+ ```bash
43
+ docyrus auth login --clientId "<your-client-id>"
44
+ ```
45
+
46
+ After a successful login, the client ID is saved in `~/.docyrus/config.json` and reused by default.
47
+
48
+ Logout active account:
49
+
50
+ ```bash
51
+ docyrus auth logout
52
+ ```
53
+
54
+ ## Help
55
+
56
+ ```bash
57
+ docyrus
58
+ docyrus --help
59
+ docyrus env --help
60
+ docyrus auth --help
61
+ docyrus discover --help
62
+ docyrus ds --help
63
+ docyrus apps --help
64
+ ```
65
+
66
+ ## Example Usages
67
+
68
+ Get current environment and active user/tenant context:
69
+
70
+ ```bash
71
+ docyrus --json
72
+ ```
73
+
74
+ Switch environment:
75
+
76
+ ```bash
77
+ docyrus env use beta
78
+ docyrus env list --json
79
+ ```
80
+
81
+ Login and inspect current identity:
82
+
83
+ ```bash
84
+ docyrus auth login --clientId "83a8df32-3738-4b5a-a0c7-87976adb1631"
85
+ docyrus auth who --json
86
+ ```
87
+
88
+ List apps:
89
+
90
+ ```bash
91
+ docyrus apps list --json
92
+ ```
93
+
94
+ Download current tenant OpenAPI spec:
95
+
96
+ ```bash
97
+ docyrus discover api --json
98
+ ```
99
+
100
+ Work with accounts and tenants:
101
+
102
+ ```bash
103
+ docyrus auth accounts list --json
104
+ docyrus auth accounts use --userId "<user-id>" --json
105
+ docyrus auth tenants list --userId "<user-id>" --json
106
+ docyrus auth tenants use --tenantId "<tenant-id>" --userId "<user-id>" --json
107
+ ```
108
+
109
+ Query data source items:
110
+
111
+ ```bash
112
+ docyrus ds list base task --columns "id,name,status" --limit 10 --orderBy "created_on desc" --json
113
+ ```
114
+
115
+ Create, update, delete data source items:
116
+
117
+ ```bash
118
+ docyrus ds create base task --data '{"name":"My Task","status":"open"}' --json
119
+ docyrus ds update base task "<record-id>" --data '{"status":"done"}' --json
120
+ docyrus ds delete base task "<record-id>" --json
121
+ ```
122
+
123
+ Call raw API endpoints via curl command:
124
+
125
+ ```bash
126
+ docyrus curl /users/me -i --json
127
+ docyrus curl /dev/apps --json
128
+ ```