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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +10 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "activitysmith-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Command-line interface for ActivitySmith. Send push notifications, start, update and end live activities directly from your terminal.",
5
5
  "keywords": [
6
6
  "activitysmith",
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("0.1.1")
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.send({
378
- ...withTargetChannels(
381
+ const response = await client.notifications.sendPushNotification({
382
+ pushNotificationRequest: withTargetChannels(
379
383
  {
380
- title: options.title,
381
- message: options.message,
382
- subtitle: options.subtitle,
384
+ title: options.title,
385
+ message: options.message,
386
+ subtitle: options.subtitle,
383
387
  },
384
388
  options.channels
385
389
  ),