activitysmith-cli 0.1.2 → 0.1.3
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/package.json +1 -1
- package/src/cli.js +10 -6
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
import { Command, InvalidArgumentError } from "commander";
|
|
4
4
|
import ActivitySmith from "activitysmith";
|
|
5
|
+
import { createRequire } from "module";
|
|
5
6
|
import { readFile } from "fs/promises";
|
|
6
7
|
import { resolve } from "path";
|
|
7
8
|
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const { version } = require("../package.json");
|
|
11
|
+
|
|
8
12
|
const program = new Command();
|
|
9
13
|
|
|
10
14
|
program
|
|
11
15
|
.name("activitysmith-cli")
|
|
12
16
|
.description("CLI for ActivitySmith API")
|
|
13
|
-
.version(
|
|
17
|
+
.version(version)
|
|
14
18
|
.option(
|
|
15
19
|
"--api-key <key>",
|
|
16
20
|
"ActivitySmith API key (defaults to ACTIVITYSMITH_API_KEY)"
|
|
@@ -374,12 +378,12 @@ program
|
|
|
374
378
|
const apiKey = requireApiKey(globalOptions);
|
|
375
379
|
const client = createClient(apiKey);
|
|
376
380
|
|
|
377
|
-
const response = await client.notifications.
|
|
378
|
-
|
|
381
|
+
const response = await client.notifications.sendPushNotification({
|
|
382
|
+
pushNotificationRequest: withTargetChannels(
|
|
379
383
|
{
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
384
|
+
title: options.title,
|
|
385
|
+
message: options.message,
|
|
386
|
+
subtitle: options.subtitle,
|
|
383
387
|
},
|
|
384
388
|
options.channels
|
|
385
389
|
),
|