activitysmith 1.2.0 → 1.2.2

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/README.md CHANGED
@@ -525,7 +525,7 @@ await activitysmith.notifications.send({
525
525
  <img src="https://cdn.activitysmith.com/features/lock-screen-widgets.png" alt="Lock screen widgets" width="680" />
526
526
  </p>
527
527
 
528
- ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Create a metric in the web app, then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically.
528
+ ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Create a metric in the <a href="https://activitysmith.com/app/widgets" target="_blank" rel="noopener noreferrer">web app</a>, then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically.
529
529
 
530
530
  <p align="center">
531
531
  <img src="https://cdn.activitysmith.com/features/create-widget-metric.png" alt="Create widget metric" width="680" />
@@ -20,12 +20,12 @@ export interface UpdateMetricValueRequest {
20
20
  */
21
21
  export declare class MetricsApi extends runtime.BaseAPI {
22
22
  /**
23
- * Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
23
+ * Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key.
24
24
  * Update a widget metric value
25
25
  */
26
26
  updateMetricValueRaw(requestParameters: UpdateMetricValueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MetricValueUpdateResponse>>;
27
27
  /**
28
- * Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
28
+ * Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key.
29
29
  * Update a widget metric value
30
30
  */
31
31
  updateMetricValue(requestParameters: UpdateMetricValueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MetricValueUpdateResponse>;
@@ -20,7 +20,7 @@ const runtime = require("../runtime");
20
20
  */
21
21
  class MetricsApi extends runtime.BaseAPI {
22
22
  /**
23
- * Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
23
+ * Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key.
24
24
  * Update a widget metric value
25
25
  */
26
26
  async updateMetricValueRaw(requestParameters, initOverrides) {
@@ -50,7 +50,7 @@ class MetricsApi extends runtime.BaseAPI {
50
50
  return new runtime.JSONApiResponse(response);
51
51
  }
52
52
  /**
53
- * Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
53
+ * Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key.
54
54
  * Update a widget metric value
55
55
  */
56
56
  async updateMetricValue(requestParameters, initOverrides) {
@@ -1020,27 +1020,6 @@ export interface MetricError {
1020
1020
  */
1021
1021
  message?: string;
1022
1022
  }
1023
- /**
1024
- *
1025
- * @export
1026
- */
1027
- export declare const MetricFormat: {
1028
- readonly Number: "number";
1029
- readonly Currency: "currency";
1030
- readonly Percent: "percent";
1031
- readonly Unit: "unit";
1032
- readonly String: "string";
1033
- };
1034
- export type MetricFormat = typeof MetricFormat[keyof typeof MetricFormat];
1035
- /**
1036
- *
1037
- * @export
1038
- */
1039
- export declare const MetricUnitSpacing: {
1040
- readonly None: "none";
1041
- readonly Space: "space";
1042
- };
1043
- export type MetricUnitSpacing = typeof MetricUnitSpacing[keyof typeof MetricUnitSpacing];
1044
1023
  /**
1045
1024
  * Latest metric value to display in widgets.
1046
1025
  * @export
@@ -1076,10 +1055,10 @@ export interface MetricValueUpdateResponse {
1076
1055
  [key: string]: any | any;
1077
1056
  /**
1078
1057
  *
1079
- * @type {WidgetMetric}
1058
+ * @type {boolean}
1080
1059
  * @memberof MetricValueUpdateResponse
1081
1060
  */
1082
- metric: WidgetMetric;
1061
+ success: boolean;
1083
1062
  }
1084
1063
  /**
1085
1064
  *
@@ -1465,84 +1444,3 @@ export declare const StreamContentStateStepColorsEnum: {
1465
1444
  readonly Yellow: "yellow";
1466
1445
  };
1467
1446
  export type StreamContentStateStepColorsEnum = typeof StreamContentStateStepColorsEnum[keyof typeof StreamContentStateStepColorsEnum];
1468
- /**
1469
- * A metric configured for ActivitySmith widgets.
1470
- * @export
1471
- * @interface WidgetMetric
1472
- */
1473
- export interface WidgetMetric {
1474
- [key: string]: any | any;
1475
- /**
1476
- *
1477
- * @type {string}
1478
- * @memberof WidgetMetric
1479
- */
1480
- public_id: string;
1481
- /**
1482
- *
1483
- * @type {string}
1484
- * @memberof WidgetMetric
1485
- */
1486
- key: string;
1487
- /**
1488
- *
1489
- * @type {string}
1490
- * @memberof WidgetMetric
1491
- */
1492
- label: string;
1493
- /**
1494
- * Present when format is currency.
1495
- * @type {string}
1496
- * @memberof WidgetMetric
1497
- */
1498
- currency_code: string | null;
1499
- /**
1500
- * Present when format is unit.
1501
- * @type {string}
1502
- * @memberof WidgetMetric
1503
- */
1504
- unit: string | null;
1505
- /**
1506
- *
1507
- * @type {MetricUnitSpacing}
1508
- * @memberof WidgetMetric
1509
- */
1510
- unit_spacing: MetricUnitSpacing;
1511
- /**
1512
- *
1513
- * @type {MetricFormat}
1514
- * @memberof WidgetMetric
1515
- */
1516
- format: MetricFormat;
1517
- /**
1518
- *
1519
- * @type {WidgetMetricLatestValue}
1520
- * @memberof WidgetMetric
1521
- */
1522
- latest_value: WidgetMetricLatestValue | null;
1523
- /**
1524
- *
1525
- * @type {string}
1526
- * @memberof WidgetMetric
1527
- */
1528
- latest_value_at: string | null;
1529
- /**
1530
- *
1531
- * @type {string}
1532
- * @memberof WidgetMetric
1533
- */
1534
- created_at: string;
1535
- /**
1536
- *
1537
- * @type {string}
1538
- * @memberof WidgetMetric
1539
- */
1540
- updated_at: string;
1541
- }
1542
- /**
1543
- * Latest metric value. Numeric formats return a number. String metrics return text.
1544
- * @export
1545
- * @interface WidgetMetricLatestValue
1546
- */
1547
- export interface WidgetMetricLatestValue {
1548
- }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamContentStateStepColorsEnum = exports.StreamContentStateStepColorEnum = exports.StreamContentStateColorEnum = exports.StreamContentStateTypeEnum = exports.PushNotificationWebhookMethod = exports.PushNotificationActionType = exports.MetricUnitSpacing = exports.MetricFormat = exports.LiveActivityWebhookMethod = exports.LiveActivityStreamPutResponseOperationEnum = exports.LiveActivityStreamDeleteResponseOperationEnum = exports.LiveActivityActionType = exports.ContentStateUpdateStepColorsEnum = exports.ContentStateUpdateStepColorEnum = exports.ContentStateUpdateColorEnum = exports.ContentStateUpdateTypeEnum = exports.ContentStateStartStepColorsEnum = exports.ContentStateStartStepColorEnum = exports.ContentStateStartColorEnum = exports.ContentStateStartTypeEnum = exports.ContentStateEndStepColorsEnum = exports.ContentStateEndStepColorEnum = exports.ContentStateEndColorEnum = exports.ContentStateEndTypeEnum = void 0;
3
+ exports.StreamContentStateStepColorsEnum = exports.StreamContentStateStepColorEnum = exports.StreamContentStateColorEnum = exports.StreamContentStateTypeEnum = exports.PushNotificationWebhookMethod = exports.PushNotificationActionType = exports.LiveActivityWebhookMethod = exports.LiveActivityStreamPutResponseOperationEnum = exports.LiveActivityStreamDeleteResponseOperationEnum = exports.LiveActivityActionType = exports.ContentStateUpdateStepColorsEnum = exports.ContentStateUpdateStepColorEnum = exports.ContentStateUpdateColorEnum = exports.ContentStateUpdateTypeEnum = exports.ContentStateStartStepColorsEnum = exports.ContentStateStartStepColorEnum = exports.ContentStateStartColorEnum = exports.ContentStateStartTypeEnum = exports.ContentStateEndStepColorsEnum = exports.ContentStateEndStepColorEnum = exports.ContentStateEndColorEnum = exports.ContentStateEndTypeEnum = void 0;
4
4
  /**
5
5
  * @export
6
6
  */
@@ -183,25 +183,6 @@ exports.LiveActivityWebhookMethod = {
183
183
  Get: 'GET',
184
184
  Post: 'POST'
185
185
  };
186
- /**
187
- *
188
- * @export
189
- */
190
- exports.MetricFormat = {
191
- Number: 'number',
192
- Currency: 'currency',
193
- Percent: 'percent',
194
- Unit: 'unit',
195
- String: 'string'
196
- };
197
- /**
198
- *
199
- * @export
200
- */
201
- exports.MetricUnitSpacing = {
202
- None: 'none',
203
- Space: 'space'
204
- };
205
186
  /**
206
187
  *
207
188
  * @export
@@ -176,12 +176,17 @@ class BaseAPI {
176
176
  body: context.body,
177
177
  credentials: this.configuration.credentials,
178
178
  };
179
+ const override = await initOverrideFn({
180
+ init: initParams,
181
+ context,
182
+ });
179
183
  const overriddenInit = {
180
184
  ...initParams,
181
- ...(await initOverrideFn({
182
- init: initParams,
183
- context,
184
- }))
185
+ ...override,
186
+ headers: {
187
+ ...headers,
188
+ ...(override?.headers || {}),
189
+ },
185
190
  };
186
191
  let body;
187
192
  if (isFormData(overriddenInit.body)
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActivitySmith = exports.MetricsResource = exports.LiveActivitiesResource = exports.NotificationsResource = void 0;
4
4
  const index_1 = require("../generated/index");
5
- const SDK_VERSION = "1.1.0";
5
+ const SDK_VERSION = "1.2.2";
6
6
  const SDK_HEADER_NAME = "X-ActivitySmith-SDK";
7
7
  const SDK_HEADER_VALUE = `node-v${SDK_VERSION}`;
8
8
  function withTargetChannels(request) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "activitysmith",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Official ActivitySmith Node.js SDK",
5
5
  "keywords": [
6
6
  "activitysmith",