@shuffl/cli 0.5.11 → 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/commands.generated.js +45 -0
- package/dist/index.js +6 -6
- package/package.json +3 -3
|
@@ -2365,6 +2365,10 @@ export const commands = [
|
|
|
2365
2365
|
const: 'groups.automationChoices',
|
|
2366
2366
|
type: 'string',
|
|
2367
2367
|
},
|
|
2368
|
+
{
|
|
2369
|
+
const: 'groups.automationRuns',
|
|
2370
|
+
type: 'string',
|
|
2371
|
+
},
|
|
2368
2372
|
{
|
|
2369
2373
|
const: 'groups.automations',
|
|
2370
2374
|
type: 'string',
|
|
@@ -4211,6 +4215,47 @@ export const commands = [
|
|
|
4211
4215
|
scope: 'users:read',
|
|
4212
4216
|
summary: 'The Pulse questions, badges and Shuffl lists a group automation can ask, give or add people to',
|
|
4213
4217
|
},
|
|
4218
|
+
{
|
|
4219
|
+
access: 'read',
|
|
4220
|
+
command: ['groups', 'automation-runs'],
|
|
4221
|
+
input: {
|
|
4222
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
4223
|
+
additionalProperties: false,
|
|
4224
|
+
properties: {
|
|
4225
|
+
cursor: {
|
|
4226
|
+
type: 'string',
|
|
4227
|
+
},
|
|
4228
|
+
groupId: {
|
|
4229
|
+
type: 'string',
|
|
4230
|
+
},
|
|
4231
|
+
outcome: {
|
|
4232
|
+
anyOf: [
|
|
4233
|
+
{
|
|
4234
|
+
const: 'done',
|
|
4235
|
+
type: 'string',
|
|
4236
|
+
},
|
|
4237
|
+
{
|
|
4238
|
+
const: 'failed',
|
|
4239
|
+
type: 'string',
|
|
4240
|
+
},
|
|
4241
|
+
{
|
|
4242
|
+
const: 'scheduled',
|
|
4243
|
+
type: 'string',
|
|
4244
|
+
},
|
|
4245
|
+
{
|
|
4246
|
+
const: 'skipped',
|
|
4247
|
+
type: 'string',
|
|
4248
|
+
},
|
|
4249
|
+
],
|
|
4250
|
+
},
|
|
4251
|
+
},
|
|
4252
|
+
type: 'object',
|
|
4253
|
+
},
|
|
4254
|
+
path: ['groups', 'automationRuns'],
|
|
4255
|
+
permission: 'groups.automationRuns',
|
|
4256
|
+
scope: 'users:read',
|
|
4257
|
+
summary: 'Every group automation run in the workspace, newest first, 50 at a time (`next` is the cursor for the page after), with `counts` by outcome; `outcome` and `groupId` narrow it',
|
|
4258
|
+
},
|
|
4214
4259
|
{
|
|
4215
4260
|
access: 'read',
|
|
4216
4261
|
command: ['groups', 'automations'],
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { chmod, mkdir, readFile, rename, rm, writeFile, } from 'node:fs/promises
|
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
|
-
import {
|
|
6
|
+
import { ORPCError, Shuffl } from '@shuffl/sdk';
|
|
7
7
|
import { commands } from './commands.generated.js';
|
|
8
8
|
// package.json sits one level above both src/ and dist/.
|
|
9
9
|
const { version } = createRequire(import.meta.url)('../package.json');
|
|
@@ -144,7 +144,7 @@ export async function runCli(args, io = {
|
|
|
144
144
|
if (!/^shuffl_company_[A-Za-z0-9_-]{43}$/.test(token))
|
|
145
145
|
throw new Error('Expected a Shuffl company key.');
|
|
146
146
|
const baseUrl = new URL(flags['base-url']).origin;
|
|
147
|
-
const company = await request(() =>
|
|
147
|
+
const company = await request(() => new Shuffl({ apiKey: token, baseUrl }).company.current());
|
|
148
148
|
await save(companyFile, { baseUrl, token });
|
|
149
149
|
io.stdout(json
|
|
150
150
|
? JSON.stringify({ company }) + '\n'
|
|
@@ -154,9 +154,9 @@ export async function runCli(args, io = {
|
|
|
154
154
|
if (!/^shuffl_api_[A-Za-z0-9_-]{43}$/.test(token))
|
|
155
155
|
throw new Error('Expected a Shuffl API token.');
|
|
156
156
|
const baseUrl = new URL(flags['base-url']).origin;
|
|
157
|
-
const client =
|
|
157
|
+
const client = new Shuffl({
|
|
158
|
+
apiKey: token,
|
|
158
159
|
baseUrl,
|
|
159
|
-
token,
|
|
160
160
|
});
|
|
161
161
|
const team = await request(() => client.teams.current());
|
|
162
162
|
await save(configFile, { baseUrl, token });
|
|
@@ -211,8 +211,8 @@ export async function runCli(args, io = {
|
|
|
211
211
|
new URL(baseUrl).origin !== new URL(saved.baseUrl).origin)
|
|
212
212
|
throw new Error('Saved credentials belong to a different server. Sign in to the target server first.');
|
|
213
213
|
let method = company
|
|
214
|
-
?
|
|
215
|
-
:
|
|
214
|
+
? new Shuffl({ apiKey: token, baseUrl }).company
|
|
215
|
+
: new Shuffl({ apiKey: token, baseUrl });
|
|
216
216
|
for (const name of command.path)
|
|
217
217
|
method = method[name];
|
|
218
218
|
const output = await request(() => method(input));
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@orpc/client": "1.15.3",
|
|
4
|
-
"@shuffl/api-contracts": "0.
|
|
5
|
-
"@shuffl/sdk": "0.
|
|
4
|
+
"@shuffl/api-contracts": "0.6.0",
|
|
5
|
+
"@shuffl/sdk": "0.6.0"
|
|
6
6
|
},
|
|
7
7
|
"description": "Shuffl command line: every public API operation as a scriptable command with JSON output.",
|
|
8
8
|
"engines": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"type": "module",
|
|
35
35
|
"types": "./dist/index.d.ts",
|
|
36
|
-
"version": "0.
|
|
36
|
+
"version": "0.6.0",
|
|
37
37
|
"bin": {
|
|
38
38
|
"shuffl": "./dist/bin.js"
|
|
39
39
|
}
|