activitysmith 0.1.8 → 1.1.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.
@@ -20,7 +20,7 @@ const runtime = require("../runtime");
20
20
  */
21
21
  class LiveActivitiesApi extends runtime.BaseAPI {
22
22
  /**
23
- * Ends a Live Activity and archives its lifecycle. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
23
+ * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
24
24
  * End a Live Activity
25
25
  */
26
26
  async endLiveActivityRaw(requestParameters, initOverrides) {
@@ -47,7 +47,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
47
47
  return new runtime.JSONApiResponse(response);
48
48
  }
49
49
  /**
50
- * Ends a Live Activity and archives its lifecycle. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
50
+ * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
51
51
  * End a Live Activity
52
52
  */
53
53
  async endLiveActivity(requestParameters, initOverrides) {
@@ -55,7 +55,80 @@ class LiveActivitiesApi extends runtime.BaseAPI {
55
55
  return await response.value();
56
56
  }
57
57
  /**
58
- * Starts a Live Activity on devices matched by API key scope and optional target channels. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
58
+ * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead.
59
+ * End a stream
60
+ */
61
+ async endLiveActivityStreamRaw(requestParameters, initOverrides) {
62
+ if (requestParameters['streamKey'] == null) {
63
+ throw new runtime.RequiredError('streamKey', 'Required parameter "streamKey" was null or undefined when calling endLiveActivityStream().');
64
+ }
65
+ const queryParameters = {};
66
+ const headerParameters = {};
67
+ headerParameters['Content-Type'] = 'application/json';
68
+ if (this.configuration && this.configuration.accessToken) {
69
+ const token = this.configuration.accessToken;
70
+ const tokenString = await token("apiKeyAuth", []);
71
+ if (tokenString) {
72
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
73
+ }
74
+ }
75
+ const response = await this.request({
76
+ path: `/live-activity/stream/{stream_key}`.replace(`{${"stream_key"}}`, encodeURIComponent(String(requestParameters['streamKey']))),
77
+ method: 'DELETE',
78
+ headers: headerParameters,
79
+ query: queryParameters,
80
+ body: requestParameters['liveActivityStreamDeleteRequest'],
81
+ }, initOverrides);
82
+ return new runtime.JSONApiResponse(response);
83
+ }
84
+ /**
85
+ * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead.
86
+ * End a stream
87
+ */
88
+ async endLiveActivityStream(requestParameters, initOverrides) {
89
+ const response = await this.endLiveActivityStreamRaw(requestParameters, initOverrides);
90
+ return await response.value();
91
+ }
92
+ /**
93
+ * Use this endpoint when you want the easiest, stateless way to trigger Live Activities. You do not need to store activity_id or manage the Live Activity lifecycle yourself. Send the latest state for a stable stream_key and ActivitySmith will handle the rest for you: if there is no Live Activity yet, it starts one; if there is already one for this stream, it updates it. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead.
94
+ * Send a stream update
95
+ */
96
+ async reconcileLiveActivityStreamRaw(requestParameters, initOverrides) {
97
+ if (requestParameters['streamKey'] == null) {
98
+ throw new runtime.RequiredError('streamKey', 'Required parameter "streamKey" was null or undefined when calling reconcileLiveActivityStream().');
99
+ }
100
+ if (requestParameters['liveActivityStreamRequest'] == null) {
101
+ throw new runtime.RequiredError('liveActivityStreamRequest', 'Required parameter "liveActivityStreamRequest" was null or undefined when calling reconcileLiveActivityStream().');
102
+ }
103
+ const queryParameters = {};
104
+ const headerParameters = {};
105
+ headerParameters['Content-Type'] = 'application/json';
106
+ if (this.configuration && this.configuration.accessToken) {
107
+ const token = this.configuration.accessToken;
108
+ const tokenString = await token("apiKeyAuth", []);
109
+ if (tokenString) {
110
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
111
+ }
112
+ }
113
+ const response = await this.request({
114
+ path: `/live-activity/stream/{stream_key}`.replace(`{${"stream_key"}}`, encodeURIComponent(String(requestParameters['streamKey']))),
115
+ method: 'PUT',
116
+ headers: headerParameters,
117
+ query: queryParameters,
118
+ body: requestParameters['liveActivityStreamRequest'],
119
+ }, initOverrides);
120
+ return new runtime.JSONApiResponse(response);
121
+ }
122
+ /**
123
+ * Use this endpoint when you want the easiest, stateless way to trigger Live Activities. You do not need to store activity_id or manage the Live Activity lifecycle yourself. Send the latest state for a stable stream_key and ActivitySmith will handle the rest for you: if there is no Live Activity yet, it starts one; if there is already one for this stream, it updates it. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead.
124
+ * Send a stream update
125
+ */
126
+ async reconcileLiveActivityStream(requestParameters, initOverrides) {
127
+ const response = await this.reconcileLiveActivityStreamRaw(requestParameters, initOverrides);
128
+ return await response.value();
129
+ }
130
+ /**
131
+ * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
59
132
  * Start a Live Activity
60
133
  */
61
134
  async startLiveActivityRaw(requestParameters, initOverrides) {
@@ -82,7 +155,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
82
155
  return new runtime.JSONApiResponse(response);
83
156
  }
84
157
  /**
85
- * Starts a Live Activity on devices matched by API key scope and optional target channels. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
158
+ * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
86
159
  * Start a Live Activity
87
160
  */
88
161
  async startLiveActivity(requestParameters, initOverrides) {
@@ -90,7 +163,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
90
163
  return await response.value();
91
164
  }
92
165
  /**
93
- * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
166
+ * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
94
167
  * Update a Live Activity
95
168
  */
96
169
  async updateLiveActivityRaw(requestParameters, initOverrides) {
@@ -117,7 +190,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
117
190
  return new runtime.JSONApiResponse(response);
118
191
  }
119
192
  /**
120
- * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
193
+ * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
121
194
  * Update a Live Activity
122
195
  */
123
196
  async updateLiveActivity(requestParameters, initOverrides) {