@revenexx/cli 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 (130) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +293 -0
  3. package/dist/cli.cjs +104461 -0
  4. package/dist/cli.d.ts +4 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/index.cjs +36040 -0
  7. package/dist/index.d.ts +9 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +36021 -0
  10. package/dist/lib/client.d.ts +108 -0
  11. package/dist/lib/client.d.ts.map +1 -0
  12. package/dist/lib/commands/about.d.ts +8 -0
  13. package/dist/lib/commands/about.d.ts.map +1 -0
  14. package/dist/lib/commands/apps-aliases.d.ts +67 -0
  15. package/dist/lib/commands/apps-aliases.d.ts.map +1 -0
  16. package/dist/lib/commands/config-validations.d.ts +55 -0
  17. package/dist/lib/commands/config-validations.d.ts.map +1 -0
  18. package/dist/lib/commands/config.d.ts +591 -0
  19. package/dist/lib/commands/config.d.ts.map +1 -0
  20. package/dist/lib/commands/errors.d.ts +68 -0
  21. package/dist/lib/commands/errors.d.ts.map +1 -0
  22. package/dist/lib/commands/generate.d.ts +12 -0
  23. package/dist/lib/commands/generate.d.ts.map +1 -0
  24. package/dist/lib/commands/generators/base.d.ts +92 -0
  25. package/dist/lib/commands/generators/base.d.ts.map +1 -0
  26. package/dist/lib/commands/generators/index.d.ts +26 -0
  27. package/dist/lib/commands/generators/index.d.ts.map +1 -0
  28. package/dist/lib/commands/generators/language-detector.d.ts +42 -0
  29. package/dist/lib/commands/generators/language-detector.d.ts.map +1 -0
  30. package/dist/lib/commands/generators/typescript/databases.d.ts +35 -0
  31. package/dist/lib/commands/generators/typescript/databases.d.ts.map +1 -0
  32. package/dist/lib/commands/generic.d.ts +42 -0
  33. package/dist/lib/commands/generic.d.ts.map +1 -0
  34. package/dist/lib/commands/services/apps.d.ts +3 -0
  35. package/dist/lib/commands/services/apps.d.ts.map +1 -0
  36. package/dist/lib/commands/services/avatars.d.ts +3 -0
  37. package/dist/lib/commands/services/avatars.d.ts.map +1 -0
  38. package/dist/lib/commands/services/carts.d.ts +3 -0
  39. package/dist/lib/commands/services/carts.d.ts.map +1 -0
  40. package/dist/lib/commands/services/channels.d.ts +3 -0
  41. package/dist/lib/commands/services/channels.d.ts.map +1 -0
  42. package/dist/lib/commands/services/customers.d.ts +3 -0
  43. package/dist/lib/commands/services/customers.d.ts.map +1 -0
  44. package/dist/lib/commands/services/greetings.d.ts +3 -0
  45. package/dist/lib/commands/services/greetings.d.ts.map +1 -0
  46. package/dist/lib/commands/services/locale.d.ts +3 -0
  47. package/dist/lib/commands/services/locale.d.ts.map +1 -0
  48. package/dist/lib/commands/services/markets.d.ts +3 -0
  49. package/dist/lib/commands/services/markets.d.ts.map +1 -0
  50. package/dist/lib/commands/services/messaging.d.ts +3 -0
  51. package/dist/lib/commands/services/messaging.d.ts.map +1 -0
  52. package/dist/lib/commands/services/products.d.ts +3 -0
  53. package/dist/lib/commands/services/products.d.ts.map +1 -0
  54. package/dist/lib/commands/services/search.d.ts +3 -0
  55. package/dist/lib/commands/services/search.d.ts.map +1 -0
  56. package/dist/lib/commands/services/sites.d.ts +3 -0
  57. package/dist/lib/commands/services/sites.d.ts.map +1 -0
  58. package/dist/lib/commands/services/storage.d.ts +3 -0
  59. package/dist/lib/commands/services/storage.d.ts.map +1 -0
  60. package/dist/lib/commands/services/tokens.d.ts +3 -0
  61. package/dist/lib/commands/services/tokens.d.ts.map +1 -0
  62. package/dist/lib/commands/tenants.d.ts +25 -0
  63. package/dist/lib/commands/tenants.d.ts.map +1 -0
  64. package/dist/lib/commands/types.d.ts +3 -0
  65. package/dist/lib/commands/types.d.ts.map +1 -0
  66. package/dist/lib/commands/update.d.ts +3 -0
  67. package/dist/lib/commands/update.d.ts.map +1 -0
  68. package/dist/lib/commands/utils/deployment.d.ts +6 -0
  69. package/dist/lib/commands/utils/deployment.d.ts.map +1 -0
  70. package/dist/lib/config.d.ts +119 -0
  71. package/dist/lib/config.d.ts.map +1 -0
  72. package/dist/lib/constants.d.ts +15 -0
  73. package/dist/lib/constants.d.ts.map +1 -0
  74. package/dist/lib/id.d.ts +7 -0
  75. package/dist/lib/id.d.ts.map +1 -0
  76. package/dist/lib/json.d.ts +8 -0
  77. package/dist/lib/json.d.ts.map +1 -0
  78. package/dist/lib/parser.d.ts +32 -0
  79. package/dist/lib/parser.d.ts.map +1 -0
  80. package/dist/lib/project-config.d.ts +26 -0
  81. package/dist/lib/project-config.d.ts.map +1 -0
  82. package/dist/lib/questions.d.ts +19 -0
  83. package/dist/lib/questions.d.ts.map +1 -0
  84. package/dist/lib/sdks.d.ts +3 -0
  85. package/dist/lib/sdks.d.ts.map +1 -0
  86. package/dist/lib/shared/typescript-type-utils.d.ts +39 -0
  87. package/dist/lib/shared/typescript-type-utils.d.ts.map +1 -0
  88. package/dist/lib/spinner.d.ts +28 -0
  89. package/dist/lib/spinner.d.ts.map +1 -0
  90. package/dist/lib/type-generation/attribute.d.ts +21 -0
  91. package/dist/lib/type-generation/attribute.d.ts.map +1 -0
  92. package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
  93. package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
  94. package/dist/lib/type-generation/languages/dart.d.ts +9 -0
  95. package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
  96. package/dist/lib/type-generation/languages/java.d.ts +7 -0
  97. package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
  98. package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
  99. package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
  100. package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
  101. package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
  102. package/dist/lib/type-generation/languages/language.d.ts +43 -0
  103. package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
  104. package/dist/lib/type-generation/languages/php.d.ts +7 -0
  105. package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
  106. package/dist/lib/type-generation/languages/swift.d.ts +7 -0
  107. package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
  108. package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
  109. package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
  110. package/dist/lib/types.d.ts +66 -0
  111. package/dist/lib/types.d.ts.map +1 -0
  112. package/dist/lib/utils.d.ts +25 -0
  113. package/dist/lib/utils.d.ts.map +1 -0
  114. package/dist/lib/validations.d.ts +2 -0
  115. package/dist/lib/validations.d.ts.map +1 -0
  116. package/dist/tests/api-key-probe.test.d.ts +2 -0
  117. package/dist/tests/api-key-probe.test.d.ts.map +1 -0
  118. package/dist/tests/apps-manifest.test.d.ts +2 -0
  119. package/dist/tests/apps-manifest.test.d.ts.map +1 -0
  120. package/dist/tests/auth-hint.test.d.ts +2 -0
  121. package/dist/tests/auth-hint.test.d.ts.map +1 -0
  122. package/dist/tests/project-config.test.d.ts +2 -0
  123. package/dist/tests/project-config.test.d.ts.map +1 -0
  124. package/dist/tests/redact.test.d.ts +2 -0
  125. package/dist/tests/redact.test.d.ts.map +1 -0
  126. package/dist/tests/tenants.test.d.ts +2 -0
  127. package/dist/tests/tenants.test.d.ts.map +1 -0
  128. package/dist/vitest.config.d.ts +3 -0
  129. package/dist/vitest.config.d.ts.map +1 -0
  130. package/package.json +104 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Revenexx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,293 @@
1
+ > **This repository is auto-generated by the [Revenexx SDK Generator](https://github.com/revenexx/sdk-generator). Do not submit changes directly — they will be overwritten on the next generation run.**
2
+
3
+ # Revenexx API — revenexx Revenexx CLI SDK
4
+
5
+ ![License](https://img.shields.io/github/license/revenexx-sdks/cli.svg?style=flat-square)
6
+ ![Version](https://img.shields.io/badge/api%20version-1.0.0-blue.svg?style=flat-square)
7
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/revenexx-sdks/cli/ci.yml?style=flat-square)](https://github.com/revenexx-sdks/cli/actions)
8
+ [![Twitter Account](https://img.shields.io/twitter/follow/revenexx?color=00acee&label=twitter&style=flat-square)](https://twitter.com/revenexx)
9
+
10
+ Revenexx command-line interface for managing your platform.
11
+
12
+ ![Revenexx API — revenexx](https://revenexx.com/images/logo.svg)
13
+
14
+ ## Installation
15
+
16
+ The Revenexx API — revenexx CLI is a Node based command line tool to help you interact with the Revenexx API — revenexx API. The CLI is distributed both as an [`npm package`](https://www.npmjs.com/package/@revenexx/cli) as well as [pre built binaries](https://github.com/revenexx-sdks/cli/releases/latest) for specific operating systems and architectures.
17
+
18
+ ### Install using NPM
19
+ ---
20
+
21
+ Install the CLI globally from the [npm registry](https://www.npmjs.com/package/@revenexx/cli):
22
+
23
+ ```sh
24
+ $ npm install -g @revenexx/cli
25
+ ```
26
+
27
+ Once the installation is complete, you can verify the install using
28
+
29
+ ```sh
30
+ $ revenexx -v
31
+ 0.0.1
32
+ ```
33
+
34
+ ### Install using prebuilt binaries
35
+ ---
36
+
37
+ If you do not have `npm` installed, you can always install the prebuilt binaries for your architecture and OS using our convenient installation scripts.
38
+
39
+ ### Linux / MacOS Terminal
40
+ ```bash
41
+ $ wget -q https://revenexx.com/cli/install.sh -O - | /bin/bash
42
+ ```
43
+
44
+ ### MacOS via [Homebrew](https://brew.sh)
45
+
46
+ > **Coming soon** — Homebrew support is not yet available.
47
+
48
+ ```bash
49
+ $ brew install revenexx
50
+ ```
51
+
52
+ ### Windows
53
+ Via Powershell
54
+ ```powershell
55
+ $ iwr -useb https://revenexx.com/cli/install.ps1 | iex
56
+ ```
57
+ Via [Scoop](https://scoop.sh)
58
+ ```powershell
59
+ $ scoop install https://raw.githubusercontent.com/revenexx-sdks/cli/master/scoop/revenexx.config.json
60
+ ```
61
+
62
+ Once the installation completes, you can verify your install using
63
+ ```
64
+ $ revenexx -v
65
+ 0.0.1
66
+ ```
67
+
68
+ ## Getting Started
69
+
70
+ Before you can use the CLI, you need to login to your Revenexx account.
71
+
72
+ ```sh
73
+ $ revenexx login
74
+
75
+ ? Enter your email test@test.com
76
+ ? Enter your password ********
77
+ ✓ Success
78
+ ```
79
+ This will also prompt you to enter your Revenexx endpoint ( default: https://revenexx.com/v1 )
80
+
81
+ * ### Initialising your project
82
+ Once logged in, the CLI needs to be initialised before you can use it with your Revenexx project. You can do this with the `revenexx init project` command.
83
+
84
+ ```sh
85
+ $ revenexx init project
86
+ ```
87
+
88
+ The following prompt will guide you through the setup process. The `init` command also creates a `revenexx.json` file representing your Revenexx project.
89
+
90
+ The `revenexx.json` file does a lot of things.
91
+ * Provides context to the CLI
92
+ * Keeps track of all your cloud functions
93
+ * Keeps track of all your project's collections
94
+ * Helps you deploy your Revenexx project to production and more..
95
+
96
+ You can also fetch all the collections in your current project using
97
+ ```sh
98
+ revenexx init collection
99
+ ```
100
+
101
+ * ### Creating and deploying cloud functions
102
+
103
+ The CLI makes it extremely easy to create and deploy Revenexx's cloud functions. Initialise your new function using
104
+
105
+ ```
106
+ $ revenexx init function
107
+ ? What would you like to name your function? My Awesome Function
108
+ ? What runtime would you like to use? Node.js (node-15.5)
109
+ ✓ Success
110
+ ```
111
+
112
+ This will create a new function `My Awesome Function` in your current Revenexx project and also create a template function for you to get started.
113
+
114
+ ```sh
115
+ $ tree My\ Awesome\ Function
116
+
117
+ My Awesome Function
118
+ ├── README.md
119
+ ├── index.js
120
+ ├── package-lock.json
121
+ └── package.json
122
+
123
+ 0 directories, 4 files
124
+ ```
125
+
126
+ You can now deploy this function using
127
+
128
+ ```sh
129
+ $ revenexx push function
130
+
131
+ ? Which functions would you like to deploy? My Awesome Function (61d1a4c81dfcd95bc834)
132
+ ℹ Info Deploying function My Awesome Function ( 61d1a4c81dfcd95bc834 )
133
+ ✓ Success Deployed My Awesome Function ( 61d1a4c81dfcd95bc834 )
134
+ ```
135
+
136
+ Your function has now been deployed on your Revenexx server! As soon as the build process is finished, you can start executing the function.
137
+
138
+ * ### Deploying Collections
139
+
140
+ Similarly, you can deploy all your collections to your Revenexx server using
141
+
142
+ ```sh
143
+ revenexx push collection
144
+ ```
145
+
146
+ > ### Note
147
+ > By default, requests to domains with self signed SSL certificates (or no certificates) are disabled. If you trust the domain, you can bypass the certificate validation using
148
+ ```sh
149
+ $ revenexx client --selfSigned true
150
+ ```
151
+
152
+ ## Authentication
153
+
154
+ The CLI is token-based. There is no email/password flow — every session uses a gateway API key.
155
+
156
+ ### Default (non-interactive)
157
+
158
+ ```sh
159
+ $ revenexx login
160
+ ```
161
+
162
+ With no flags, `login` resolves a token from (in order) `--token`, `REVENEXX_API_KEY`, then `.revenexx.yaml`. If a token is found, it's validated against the gateway (`GET /locale`) and persisted to `~/.revenexx/prefs.json`. If no token is found, the command errors out and tells you how to supply one.
163
+
164
+ Typical setups:
165
+
166
+ ```sh
167
+ # CI / scripts
168
+ $ revenexx login --token <token> --tenant <tenant>
169
+
170
+ # Project workspace — drop credentials in `.env` or `.revenexx.yaml`
171
+ $ revenexx login
172
+ ```
173
+
174
+ ### Credential resolution order
175
+
176
+ For any command that needs auth, credentials are resolved as:
177
+
178
+ 1. CLI flag — `--token`, `--endpoint`, `--project-id`, `--tenant`
179
+ 2. Environment variables — `REVENEXX_API_KEY`, `REVENEXX_API_URL`, `REVENEXX_TENANT` (legacy alias `REVENEXX_PROJECT` is still honoured)
180
+ 3. Project file `.revenexx.yaml` — nearest one, walking up from the current directory
181
+ 4. Global config at `~/.revenexx/prefs.json` — populated by `revenexx login`
182
+ 5. Built-in default endpoint
183
+
184
+ Exception: the tenant slug prefers the explicit `tenants use` switch — `--tenant` flag → `~/.revenexx/tenant` → `REVENEXX_TENANT` → `.revenexx.yaml`.
185
+
186
+ ## Versioning & changesets
187
+
188
+ The CLI uses [Changesets](https://github.com/changesets/changesets) for reviewable version bumps. When you ship a user-visible change, add a changeset alongside your PR:
189
+
190
+ ```sh
191
+ $ npx changeset
192
+ ```
193
+
194
+ The CLI prompts for a semver bump (major / minor / patch) and a short summary, then writes the answer to `.changeset/<random-name>.md`. Commit that file with the rest of the PR — the entry shows up in the PR diff and is reviewable like any other change.
195
+
196
+ At release time, the publish workflow runs `npx changeset version`, which:
197
+
198
+ - bumps `package.json`,
199
+ - aggregates all pending `.changeset/*.md` into `CHANGELOG.md`,
200
+ - removes the consumed changesets.
201
+
202
+ The workflow then stamps the git-tag version (so `v1.2.3` always ends up as `1.2.3` regardless of what changesets computed) and publishes to the [npm registry](https://www.npmjs.com/package/@revenexx/cli).
203
+
204
+ See `.changeset/README.md` for a deeper walkthrough.
205
+
206
+ ## Clean-machine install verification
207
+
208
+ A throwaway-container smoke test for the install path lives at `scripts/verify-install.sh`. It boots a fresh `node:20-bookworm-slim` image, installs the CLI from the npm registry, and asserts `revenexx -v` / `--help` / `login --help` work.
209
+
210
+ ```sh
211
+ # Verify the published npm build:
212
+ $ npm run verify:install
213
+
214
+ # Verify a local working copy (npm pack → install inside the container):
215
+ $ npm run verify:install:local
216
+ ```
217
+
218
+ Use the `--image` flag on the script to pin a specific Node base (e.g. `--image node:22-alpine`).
219
+
220
+ ## Tenants
221
+
222
+ `revenexx tenants` scopes follow-up commands to a specific Revenexx tenant.
223
+
224
+ | Command | Status |
225
+ |---|---|
226
+ | `revenexx tenants use <slug>` | ✅ Persists the active slug to `~/.revenexx/tenant` (overriding `REVENEXX_TENANT`). When an API key is available the slug is validated against the gateway first; a tenant the key can't access is rejected unless `--force` is passed. |
227
+ | `revenexx tenants current` | ✅ Prints the active slug. Pass `--check` to verify it against the gateway. |
228
+ | `revenexx tenants list` | ✅ Lists every tenant known to this machine (flag, env, `.revenexx.yaml`, `~/.revenexx/tenant`, login sessions) with its sources and whether the current API key can access it. The gateway doesn't expose a `/v1/tenants` endpoint (and by design never discloses whether a tenant exists), so this is a client-side aggregate verified per-slug. |
229
+
230
+ ## Global Configuration
231
+
232
+ The CLI stores its configuration in `~/.revenexx/prefs.json`. You can seed this file manually before running any commands:
233
+
234
+ ```json
235
+ {
236
+ "current": "",
237
+ "endpoint": "https://api.revenexx.com",
238
+ "selfSigned": false,
239
+ "project": "",
240
+ "key": "",
241
+ "locale": "en-US",
242
+ "mode": "default"
243
+ }
244
+ ```
245
+
246
+ | Key | Description |
247
+ |-----|-------------|
248
+ | `current` | Active session ID (set automatically on login) |
249
+ | `endpoint` | Your Revenexx API — revenexx server URL |
250
+ | `selfSigned` | Allow self-signed TLS certificates (`true`/`false`) |
251
+ | `project` | Default project ID |
252
+ | `key` | API key for server-side access |
253
+ | `locale` | Locale for API responses |
254
+ | `mode` | Auth mode — `default` (API key) or `admin` (cookie session) |
255
+
256
+ You can also configure these values via the CLI:
257
+
258
+ ```sh
259
+ $ revenexx client --endpoint https://api.revenexx.com
260
+ $ revenexx client --key YOUR_API_KEY
261
+ $ revenexx client --self-signed true
262
+ ```
263
+
264
+ ## Contribution
265
+
266
+ This library is auto-generated by RevenexxAPIRevenexx custom [SDK Generator](https://github.com/revenexx api — revenexx/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/revenexx api — revenexx/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
267
+
268
+ To build and test the CLI for development, follow these steps
269
+
270
+ 1. Clone the CLI repository and install dependencies
271
+ ```sh
272
+ $ git clone https://github.com/revenexx-sdks/cli
273
+ $ cd cli
274
+ $ bun install
275
+ ```
276
+
277
+ 2. Build the CLI
278
+ ```sh
279
+ $ npm run build
280
+ ```
281
+
282
+ 3. Install the CLI globally from the local build
283
+ ```sh
284
+ $ npm install -g .
285
+ ```
286
+
287
+ 4. You can now use the CLI
288
+ ```sh
289
+ $ revenexx -v
290
+ ```
291
+ ## License
292
+
293
+ Please see the [ license]() file for more information.