activitysmith 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/README.md +2 -0
- package/dist/generated/apis/LiveActivitiesApi.d.ts +2 -2
- package/dist/generated/apis/LiveActivitiesApi.js +2 -2
- package/dist/generated/apis/PushNotificationsApi.d.ts +2 -2
- package/dist/generated/apis/PushNotificationsApi.js +2 -2
- package/dist/generated/models/index.d.ts +163 -0
- package/dist/src/ActivitySmith.d.ts +8 -2
- package/dist/src/ActivitySmith.js +14 -2
- package/package.json +1 -1
- package/dist/generated/apis/NotificationsApi.d.ts +0 -31
- package/dist/generated/apis/NotificationsApi.js +0 -59
- package/dist/generated/models/ContentStateEnd.d.ts +0 -97
- package/dist/generated/models/ContentStateEnd.js +0 -89
- package/dist/generated/models/ContentStateStart.d.ts +0 -104
- package/dist/generated/models/ContentStateStart.js +0 -99
- package/dist/generated/models/ContentStateUpdate.d.ts +0 -91
- package/dist/generated/models/ContentStateUpdate.js +0 -87
- package/dist/generated/models/LiveActivityEndRequest.d.ts +0 -38
- package/dist/generated/models/LiveActivityEndRequest.js +0 -51
- package/dist/generated/models/LiveActivityEndResponse.d.ts +0 -55
- package/dist/generated/models/LiveActivityEndResponse.js +0 -58
- package/dist/generated/models/LiveActivityLimitError.d.ts +0 -49
- package/dist/generated/models/LiveActivityLimitError.js +0 -58
- package/dist/generated/models/LiveActivityStartRequest.d.ts +0 -32
- package/dist/generated/models/LiveActivityStartRequest.js +0 -47
- package/dist/generated/models/LiveActivityStartResponse.d.ts +0 -55
- package/dist/generated/models/LiveActivityStartResponse.js +0 -58
- package/dist/generated/models/LiveActivityUpdateRequest.d.ts +0 -38
- package/dist/generated/models/LiveActivityUpdateRequest.js +0 -51
- package/dist/generated/models/LiveActivityUpdateResponse.d.ts +0 -55
- package/dist/generated/models/LiveActivityUpdateResponse.js +0 -58
- package/dist/generated/models/PushNotificationRequest.d.ts +0 -43
- package/dist/generated/models/PushNotificationRequest.js +0 -50
- package/dist/generated/models/PushNotificationResponse.d.ts +0 -49
- package/dist/generated/models/PushNotificationResponse.js +0 -54
- package/dist/generated/models/RateLimitError.d.ts +0 -37
- package/dist/generated/models/RateLimitError.js +0 -50
- package/dist/generated/models/SendPushNotification429Response.d.ts +0 -22
- package/dist/generated/models/SendPushNotification429Response.js +0 -46
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ const activitysmith = new ActivitySmith({
|
|
|
40
40
|
const response = await activitysmith.notifications.send({
|
|
41
41
|
title: "Build Failed",
|
|
42
42
|
message: "CI pipeline failed on main branch",
|
|
43
|
+
channels: ["devs", "ops"], // Optional
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
console.log(response.success);
|
|
@@ -58,6 +59,7 @@ const start = await activitysmith.liveActivities.start({
|
|
|
58
59
|
type: "segmented_progress",
|
|
59
60
|
color: "yellow",
|
|
60
61
|
},
|
|
62
|
+
channels: ["devs", "ops"], // Optional
|
|
61
63
|
});
|
|
62
64
|
|
|
63
65
|
const activityId = start.activity_id;
|
|
@@ -35,12 +35,12 @@ export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
35
35
|
*/
|
|
36
36
|
endLiveActivity(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityEndResponse>;
|
|
37
37
|
/**
|
|
38
|
-
* Starts a Live Activity on
|
|
38
|
+
* Starts a Live Activity on devices matched by API key scope and optional target channels.
|
|
39
39
|
* Start a Live Activity
|
|
40
40
|
*/
|
|
41
41
|
startLiveActivityRaw(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityStartResponse>>;
|
|
42
42
|
/**
|
|
43
|
-
* Starts a Live Activity on
|
|
43
|
+
* Starts a Live Activity on devices matched by API key scope and optional target channels.
|
|
44
44
|
* Start a Live Activity
|
|
45
45
|
*/
|
|
46
46
|
startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStartResponse>;
|
|
@@ -55,7 +55,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
55
55
|
return await response.value();
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
* Starts a Live Activity on
|
|
58
|
+
* Starts a Live Activity on devices matched by API key scope and optional target channels.
|
|
59
59
|
* Start a Live Activity
|
|
60
60
|
*/
|
|
61
61
|
async startLiveActivityRaw(requestParameters, initOverrides) {
|
|
@@ -82,7 +82,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
82
82
|
return new runtime.JSONApiResponse(response);
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* Starts a Live Activity on
|
|
85
|
+
* Starts a Live Activity on devices matched by API key scope and optional target channels.
|
|
86
86
|
* Start a Live Activity
|
|
87
87
|
*/
|
|
88
88
|
async startLiveActivity(requestParameters, initOverrides) {
|
|
@@ -19,12 +19,12 @@ export interface SendPushNotificationRequest {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare class PushNotificationsApi extends runtime.BaseAPI {
|
|
21
21
|
/**
|
|
22
|
-
* Sends a push notification to
|
|
22
|
+
* Sends a push notification to devices matched by API key scope and optional target channels.
|
|
23
23
|
* Send a push notification
|
|
24
24
|
*/
|
|
25
25
|
sendPushNotificationRaw(requestParameters: SendPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PushNotificationResponse>>;
|
|
26
26
|
/**
|
|
27
|
-
* Sends a push notification to
|
|
27
|
+
* Sends a push notification to devices matched by API key scope and optional target channels.
|
|
28
28
|
* Send a push notification
|
|
29
29
|
*/
|
|
30
30
|
sendPushNotification(requestParameters: SendPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PushNotificationResponse>;
|
|
@@ -20,7 +20,7 @@ const runtime = require("../runtime");
|
|
|
20
20
|
*/
|
|
21
21
|
class PushNotificationsApi extends runtime.BaseAPI {
|
|
22
22
|
/**
|
|
23
|
-
* Sends a push notification to
|
|
23
|
+
* Sends a push notification to devices matched by API key scope and optional target channels.
|
|
24
24
|
* Send a push notification
|
|
25
25
|
*/
|
|
26
26
|
async sendPushNotificationRaw(requestParameters, initOverrides) {
|
|
@@ -47,7 +47,7 @@ class PushNotificationsApi extends runtime.BaseAPI {
|
|
|
47
47
|
return new runtime.JSONApiResponse(response);
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* Sends a push notification to
|
|
50
|
+
* Sends a push notification to devices matched by API key scope and optional target channels.
|
|
51
51
|
* Send a push notification
|
|
52
52
|
*/
|
|
53
53
|
async sendPushNotification(requestParameters, initOverrides) {
|
|
@@ -1,9 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @export
|
|
4
|
+
* @interface AlertPayload
|
|
5
|
+
*/
|
|
6
|
+
export interface AlertPayload {
|
|
7
|
+
[key: string]: any | any;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @type {string}
|
|
11
|
+
* @memberof AlertPayload
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @type {string}
|
|
17
|
+
* @memberof AlertPayload
|
|
18
|
+
*/
|
|
19
|
+
body?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
* @interface BadRequestError
|
|
25
|
+
*/
|
|
26
|
+
export interface BadRequestError {
|
|
27
|
+
[key: string]: any | any;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof BadRequestError
|
|
32
|
+
*/
|
|
33
|
+
error: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof BadRequestError
|
|
38
|
+
*/
|
|
39
|
+
message: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
* @interface ChannelTarget
|
|
45
|
+
*/
|
|
46
|
+
export interface ChannelTarget {
|
|
47
|
+
[key: string]: any | any;
|
|
48
|
+
/**
|
|
49
|
+
* Channel slugs. When omitted, API key scope determines recipients.
|
|
50
|
+
* @type {Array<string>}
|
|
51
|
+
* @memberof ChannelTarget
|
|
52
|
+
*/
|
|
53
|
+
channels: Array<string>;
|
|
54
|
+
}
|
|
1
55
|
/**
|
|
2
56
|
* End payload. Required fields are title and current_step. number_of_steps is optional.
|
|
3
57
|
* @export
|
|
4
58
|
* @interface ContentStateEnd
|
|
5
59
|
*/
|
|
6
60
|
export interface ContentStateEnd {
|
|
61
|
+
[key: string]: any | any;
|
|
7
62
|
/**
|
|
8
63
|
*
|
|
9
64
|
* @type {string}
|
|
@@ -83,6 +138,7 @@ export type ContentStateEndStepColorEnum = typeof ContentStateEndStepColorEnum[k
|
|
|
83
138
|
* @interface ContentStateStart
|
|
84
139
|
*/
|
|
85
140
|
export interface ContentStateStart {
|
|
141
|
+
[key: string]: any | any;
|
|
86
142
|
/**
|
|
87
143
|
*
|
|
88
144
|
* @type {string}
|
|
@@ -169,6 +225,7 @@ export type ContentStateStartStepColorEnum = typeof ContentStateStartStepColorEn
|
|
|
169
225
|
* @interface ContentStateUpdate
|
|
170
226
|
*/
|
|
171
227
|
export interface ContentStateUpdate {
|
|
228
|
+
[key: string]: any | any;
|
|
172
229
|
/**
|
|
173
230
|
*
|
|
174
231
|
* @type {string}
|
|
@@ -236,12 +293,33 @@ export declare const ContentStateUpdateStepColorEnum: {
|
|
|
236
293
|
readonly Yellow: "yellow";
|
|
237
294
|
};
|
|
238
295
|
export type ContentStateUpdateStepColorEnum = typeof ContentStateUpdateStepColorEnum[keyof typeof ContentStateUpdateStepColorEnum];
|
|
296
|
+
/**
|
|
297
|
+
*
|
|
298
|
+
* @export
|
|
299
|
+
* @interface ForbiddenError
|
|
300
|
+
*/
|
|
301
|
+
export interface ForbiddenError {
|
|
302
|
+
[key: string]: any | any;
|
|
303
|
+
/**
|
|
304
|
+
*
|
|
305
|
+
* @type {string}
|
|
306
|
+
* @memberof ForbiddenError
|
|
307
|
+
*/
|
|
308
|
+
error: string;
|
|
309
|
+
/**
|
|
310
|
+
*
|
|
311
|
+
* @type {string}
|
|
312
|
+
* @memberof ForbiddenError
|
|
313
|
+
*/
|
|
314
|
+
message: string;
|
|
315
|
+
}
|
|
239
316
|
/**
|
|
240
317
|
*
|
|
241
318
|
* @export
|
|
242
319
|
* @interface LiveActivityEndRequest
|
|
243
320
|
*/
|
|
244
321
|
export interface LiveActivityEndRequest {
|
|
322
|
+
[key: string]: any | any;
|
|
245
323
|
/**
|
|
246
324
|
*
|
|
247
325
|
* @type {string}
|
|
@@ -261,6 +339,7 @@ export interface LiveActivityEndRequest {
|
|
|
261
339
|
* @interface LiveActivityEndResponse
|
|
262
340
|
*/
|
|
263
341
|
export interface LiveActivityEndResponse {
|
|
342
|
+
[key: string]: any | any;
|
|
264
343
|
/**
|
|
265
344
|
*
|
|
266
345
|
* @type {boolean}
|
|
@@ -298,6 +377,7 @@ export interface LiveActivityEndResponse {
|
|
|
298
377
|
* @interface LiveActivityLimitError
|
|
299
378
|
*/
|
|
300
379
|
export interface LiveActivityLimitError {
|
|
380
|
+
[key: string]: any | any;
|
|
301
381
|
/**
|
|
302
382
|
*
|
|
303
383
|
* @type {string}
|
|
@@ -329,12 +409,25 @@ export interface LiveActivityLimitError {
|
|
|
329
409
|
* @interface LiveActivityStartRequest
|
|
330
410
|
*/
|
|
331
411
|
export interface LiveActivityStartRequest {
|
|
412
|
+
[key: string]: any | any;
|
|
332
413
|
/**
|
|
333
414
|
*
|
|
334
415
|
* @type {ContentStateStart}
|
|
335
416
|
* @memberof LiveActivityStartRequest
|
|
336
417
|
*/
|
|
337
418
|
content_state: ContentStateStart;
|
|
419
|
+
/**
|
|
420
|
+
*
|
|
421
|
+
* @type {AlertPayload}
|
|
422
|
+
* @memberof LiveActivityStartRequest
|
|
423
|
+
*/
|
|
424
|
+
alert?: AlertPayload;
|
|
425
|
+
/**
|
|
426
|
+
*
|
|
427
|
+
* @type {ChannelTarget}
|
|
428
|
+
* @memberof LiveActivityStartRequest
|
|
429
|
+
*/
|
|
430
|
+
target?: ChannelTarget;
|
|
338
431
|
}
|
|
339
432
|
/**
|
|
340
433
|
*
|
|
@@ -342,6 +435,7 @@ export interface LiveActivityStartRequest {
|
|
|
342
435
|
* @interface LiveActivityStartResponse
|
|
343
436
|
*/
|
|
344
437
|
export interface LiveActivityStartResponse {
|
|
438
|
+
[key: string]: any | any;
|
|
345
439
|
/**
|
|
346
440
|
*
|
|
347
441
|
* @type {boolean}
|
|
@@ -366,6 +460,12 @@ export interface LiveActivityStartResponse {
|
|
|
366
460
|
* @memberof LiveActivityStartResponse
|
|
367
461
|
*/
|
|
368
462
|
activity_id: string;
|
|
463
|
+
/**
|
|
464
|
+
*
|
|
465
|
+
* @type {Array<string>}
|
|
466
|
+
* @memberof LiveActivityStartResponse
|
|
467
|
+
*/
|
|
468
|
+
effective_channel_slugs?: Array<string>;
|
|
369
469
|
/**
|
|
370
470
|
*
|
|
371
471
|
* @type {string}
|
|
@@ -379,6 +479,7 @@ export interface LiveActivityStartResponse {
|
|
|
379
479
|
* @interface LiveActivityUpdateRequest
|
|
380
480
|
*/
|
|
381
481
|
export interface LiveActivityUpdateRequest {
|
|
482
|
+
[key: string]: any | any;
|
|
382
483
|
/**
|
|
383
484
|
*
|
|
384
485
|
* @type {string}
|
|
@@ -398,6 +499,7 @@ export interface LiveActivityUpdateRequest {
|
|
|
398
499
|
* @interface LiveActivityUpdateResponse
|
|
399
500
|
*/
|
|
400
501
|
export interface LiveActivityUpdateResponse {
|
|
502
|
+
[key: string]: any | any;
|
|
401
503
|
/**
|
|
402
504
|
*
|
|
403
505
|
* @type {boolean}
|
|
@@ -429,12 +531,39 @@ export interface LiveActivityUpdateResponse {
|
|
|
429
531
|
*/
|
|
430
532
|
timestamp: string;
|
|
431
533
|
}
|
|
534
|
+
/**
|
|
535
|
+
*
|
|
536
|
+
* @export
|
|
537
|
+
* @interface NoRecipientsError
|
|
538
|
+
*/
|
|
539
|
+
export interface NoRecipientsError {
|
|
540
|
+
[key: string]: any | any;
|
|
541
|
+
/**
|
|
542
|
+
*
|
|
543
|
+
* @type {string}
|
|
544
|
+
* @memberof NoRecipientsError
|
|
545
|
+
*/
|
|
546
|
+
error: string;
|
|
547
|
+
/**
|
|
548
|
+
*
|
|
549
|
+
* @type {string}
|
|
550
|
+
* @memberof NoRecipientsError
|
|
551
|
+
*/
|
|
552
|
+
message: string;
|
|
553
|
+
/**
|
|
554
|
+
*
|
|
555
|
+
* @type {Array<string>}
|
|
556
|
+
* @memberof NoRecipientsError
|
|
557
|
+
*/
|
|
558
|
+
effective_channel_slugs?: Array<string>;
|
|
559
|
+
}
|
|
432
560
|
/**
|
|
433
561
|
*
|
|
434
562
|
* @export
|
|
435
563
|
* @interface PushNotificationRequest
|
|
436
564
|
*/
|
|
437
565
|
export interface PushNotificationRequest {
|
|
566
|
+
[key: string]: any | any;
|
|
438
567
|
/**
|
|
439
568
|
*
|
|
440
569
|
* @type {string}
|
|
@@ -453,6 +582,32 @@ export interface PushNotificationRequest {
|
|
|
453
582
|
* @memberof PushNotificationRequest
|
|
454
583
|
*/
|
|
455
584
|
subtitle?: string;
|
|
585
|
+
/**
|
|
586
|
+
*
|
|
587
|
+
* @type {{ [key: string]: any; }}
|
|
588
|
+
* @memberof PushNotificationRequest
|
|
589
|
+
*/
|
|
590
|
+
payload?: {
|
|
591
|
+
[key: string]: any;
|
|
592
|
+
};
|
|
593
|
+
/**
|
|
594
|
+
*
|
|
595
|
+
* @type {number}
|
|
596
|
+
* @memberof PushNotificationRequest
|
|
597
|
+
*/
|
|
598
|
+
badge?: number;
|
|
599
|
+
/**
|
|
600
|
+
*
|
|
601
|
+
* @type {string}
|
|
602
|
+
* @memberof PushNotificationRequest
|
|
603
|
+
*/
|
|
604
|
+
sound?: string;
|
|
605
|
+
/**
|
|
606
|
+
*
|
|
607
|
+
* @type {ChannelTarget}
|
|
608
|
+
* @memberof PushNotificationRequest
|
|
609
|
+
*/
|
|
610
|
+
target?: ChannelTarget;
|
|
456
611
|
}
|
|
457
612
|
/**
|
|
458
613
|
*
|
|
@@ -460,6 +615,7 @@ export interface PushNotificationRequest {
|
|
|
460
615
|
* @interface PushNotificationResponse
|
|
461
616
|
*/
|
|
462
617
|
export interface PushNotificationResponse {
|
|
618
|
+
[key: string]: any | any;
|
|
463
619
|
/**
|
|
464
620
|
*
|
|
465
621
|
* @type {boolean}
|
|
@@ -478,6 +634,12 @@ export interface PushNotificationResponse {
|
|
|
478
634
|
* @memberof PushNotificationResponse
|
|
479
635
|
*/
|
|
480
636
|
users_notified?: number;
|
|
637
|
+
/**
|
|
638
|
+
*
|
|
639
|
+
* @type {Array<string>}
|
|
640
|
+
* @memberof PushNotificationResponse
|
|
641
|
+
*/
|
|
642
|
+
effective_channel_slugs?: Array<string>;
|
|
481
643
|
/**
|
|
482
644
|
*
|
|
483
645
|
* @type {string}
|
|
@@ -491,6 +653,7 @@ export interface PushNotificationResponse {
|
|
|
491
653
|
* @interface RateLimitError
|
|
492
654
|
*/
|
|
493
655
|
export interface RateLimitError {
|
|
656
|
+
[key: string]: any | any;
|
|
494
657
|
/**
|
|
495
658
|
*
|
|
496
659
|
* @type {string}
|
|
@@ -8,17 +8,23 @@ type StartRequestBody = Parameters<LiveActivitiesApi["startLiveActivity"]>[0]["l
|
|
|
8
8
|
type UpdateRequestBody = Parameters<LiveActivitiesApi["updateLiveActivity"]>[0]["liveActivityUpdateRequest"];
|
|
9
9
|
type EndRequestBody = Parameters<LiveActivitiesApi["endLiveActivity"]>[0]["liveActivityEndRequest"];
|
|
10
10
|
type LiveInitOverrides = Parameters<LiveActivitiesApi["startLiveActivity"]>[1];
|
|
11
|
+
type PushSendRequest = PushRequestBody & {
|
|
12
|
+
channels?: string[];
|
|
13
|
+
};
|
|
14
|
+
type LiveStartSendRequest = StartRequestBody & {
|
|
15
|
+
channels?: string[];
|
|
16
|
+
};
|
|
11
17
|
export declare class NotificationsResource {
|
|
12
18
|
private readonly api;
|
|
13
19
|
constructor(api: PushNotificationsApi);
|
|
14
|
-
send(request:
|
|
20
|
+
send(request: PushSendRequest, initOverrides?: SendInitOverrides): Promise<import("../generated/models").PushNotificationResponse>;
|
|
15
21
|
sendPushNotification(...args: Parameters<PushNotificationsApi["sendPushNotification"]>): Promise<import("../generated/models").PushNotificationResponse>;
|
|
16
22
|
sendPushNotificationRaw(...args: Parameters<PushNotificationsApi["sendPushNotificationRaw"]>): Promise<import("../generated/runtime").ApiResponse<import("../generated/models").PushNotificationResponse>>;
|
|
17
23
|
}
|
|
18
24
|
export declare class LiveActivitiesResource {
|
|
19
25
|
private readonly api;
|
|
20
26
|
constructor(api: LiveActivitiesApi);
|
|
21
|
-
start(request:
|
|
27
|
+
start(request: LiveStartSendRequest, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityStartResponse>;
|
|
22
28
|
update(request: UpdateRequestBody, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityUpdateResponse>;
|
|
23
29
|
end(request: EndRequestBody, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityEndResponse>;
|
|
24
30
|
startLiveActivity(...args: Parameters<LiveActivitiesApi["startLiveActivity"]>): Promise<import("../generated/models").LiveActivityStartResponse>;
|
|
@@ -2,12 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActivitySmith = exports.LiveActivitiesResource = exports.NotificationsResource = void 0;
|
|
4
4
|
const index_1 = require("../generated/index");
|
|
5
|
+
function withTargetChannels(request) {
|
|
6
|
+
const channels = request.channels;
|
|
7
|
+
if (!channels || channels.length === 0 || request.target) {
|
|
8
|
+
const { channels: _ignored, ...rest } = request;
|
|
9
|
+
return rest;
|
|
10
|
+
}
|
|
11
|
+
const { channels: _ignored, ...rest } = request;
|
|
12
|
+
return {
|
|
13
|
+
...rest,
|
|
14
|
+
target: { channels },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
5
17
|
class NotificationsResource {
|
|
6
18
|
constructor(api) {
|
|
7
19
|
this.api = api;
|
|
8
20
|
}
|
|
9
21
|
send(request, initOverrides) {
|
|
10
|
-
return this.api.sendPushNotification({ pushNotificationRequest: request }, initOverrides);
|
|
22
|
+
return this.api.sendPushNotification({ pushNotificationRequest: withTargetChannels(request) }, initOverrides);
|
|
11
23
|
}
|
|
12
24
|
// Backward-compatible alias.
|
|
13
25
|
sendPushNotification(...args) {
|
|
@@ -23,7 +35,7 @@ class LiveActivitiesResource {
|
|
|
23
35
|
this.api = api;
|
|
24
36
|
}
|
|
25
37
|
start(request, initOverrides) {
|
|
26
|
-
return this.api.startLiveActivity({ liveActivityStartRequest: request }, initOverrides);
|
|
38
|
+
return this.api.startLiveActivity({ liveActivityStartRequest: withTargetChannels(request) }, initOverrides);
|
|
27
39
|
}
|
|
28
40
|
update(request, initOverrides) {
|
|
29
41
|
return this.api.updateLiveActivity({ liveActivityUpdateRequest: request }, initOverrides);
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ActivitySmith API
|
|
3
|
-
* Send push notifications and Live Activities to your own devices via a single API key.
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.0.0
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
import * as runtime from '../runtime';
|
|
13
|
-
import type { PushNotificationRequest, PushNotificationResponse } from '../models/index';
|
|
14
|
-
export interface SendPushNotificationRequest {
|
|
15
|
-
pushNotificationRequest: PushNotificationRequest;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export declare class NotificationsApi extends runtime.BaseAPI {
|
|
21
|
-
/**
|
|
22
|
-
* Sends a push notification to every paired device in your account.
|
|
23
|
-
* Send a push notification
|
|
24
|
-
*/
|
|
25
|
-
sendPushNotificationRaw(requestParameters: SendPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PushNotificationResponse>>;
|
|
26
|
-
/**
|
|
27
|
-
* Sends a push notification to every paired device in your account.
|
|
28
|
-
* Send a push notification
|
|
29
|
-
*/
|
|
30
|
-
sendPushNotification(requestParameters: SendPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PushNotificationResponse>;
|
|
31
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* ActivitySmith API
|
|
6
|
-
* Send push notifications and Live Activities to your own devices via a single API key.
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 1.0.0
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.NotificationsApi = void 0;
|
|
17
|
-
const runtime = require("../runtime");
|
|
18
|
-
const index_1 = require("../models/index");
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
class NotificationsApi extends runtime.BaseAPI {
|
|
23
|
-
/**
|
|
24
|
-
* Sends a push notification to every paired device in your account.
|
|
25
|
-
* Send a push notification
|
|
26
|
-
*/
|
|
27
|
-
async sendPushNotificationRaw(requestParameters, initOverrides) {
|
|
28
|
-
if (requestParameters['pushNotificationRequest'] == null) {
|
|
29
|
-
throw new runtime.RequiredError('pushNotificationRequest', 'Required parameter "pushNotificationRequest" was null or undefined when calling sendPushNotification().');
|
|
30
|
-
}
|
|
31
|
-
const queryParameters = {};
|
|
32
|
-
const headerParameters = {};
|
|
33
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
34
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
35
|
-
const token = this.configuration.accessToken;
|
|
36
|
-
const tokenString = await token("bearerAuth", []);
|
|
37
|
-
if (tokenString) {
|
|
38
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const response = await this.request({
|
|
42
|
-
path: `/push-notification`,
|
|
43
|
-
method: 'POST',
|
|
44
|
-
headers: headerParameters,
|
|
45
|
-
query: queryParameters,
|
|
46
|
-
body: (0, index_1.PushNotificationRequestToJSON)(requestParameters['pushNotificationRequest']),
|
|
47
|
-
}, initOverrides);
|
|
48
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PushNotificationResponseFromJSON)(jsonValue));
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Sends a push notification to every paired device in your account.
|
|
52
|
-
* Send a push notification
|
|
53
|
-
*/
|
|
54
|
-
async sendPushNotification(requestParameters, initOverrides) {
|
|
55
|
-
const response = await this.sendPushNotificationRaw(requestParameters, initOverrides);
|
|
56
|
-
return await response.value();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.NotificationsApi = NotificationsApi;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ActivitySmith API
|
|
3
|
-
* Send push notifications and Live Activities to your own devices via a single API key.
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.0.0
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* End payload. Required fields are title and current_step. number_of_steps is optional.
|
|
14
|
-
* @export
|
|
15
|
-
* @interface ContentStateEnd
|
|
16
|
-
*/
|
|
17
|
-
export interface ContentStateEnd {
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @type {string}
|
|
21
|
-
* @memberof ContentStateEnd
|
|
22
|
-
*/
|
|
23
|
-
title: string;
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @type {string}
|
|
27
|
-
* @memberof ContentStateEnd
|
|
28
|
-
*/
|
|
29
|
-
subtitle?: string;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @type {number}
|
|
33
|
-
* @memberof ContentStateEnd
|
|
34
|
-
*/
|
|
35
|
-
numberOfSteps?: number;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @type {number}
|
|
39
|
-
* @memberof ContentStateEnd
|
|
40
|
-
*/
|
|
41
|
-
currentStep: number;
|
|
42
|
-
/**
|
|
43
|
-
* Optional. Accent color for the Live Activity. Defaults to blue.
|
|
44
|
-
* @type {string}
|
|
45
|
-
* @memberof ContentStateEnd
|
|
46
|
-
*/
|
|
47
|
-
color?: ContentStateEndColorEnum;
|
|
48
|
-
/**
|
|
49
|
-
* Optional. Overrides color for the current step.
|
|
50
|
-
* @type {string}
|
|
51
|
-
* @memberof ContentStateEnd
|
|
52
|
-
*/
|
|
53
|
-
stepColor?: ContentStateEndStepColorEnum;
|
|
54
|
-
/**
|
|
55
|
-
* Optional. Minutes before the ended Live Activity is dismissed. Default 3. Set 0 for immediate dismissal. iOS will dismiss ended Live Activities after ~4 hours max.
|
|
56
|
-
* @type {number}
|
|
57
|
-
* @memberof ContentStateEnd
|
|
58
|
-
*/
|
|
59
|
-
autoDismissMinutes?: number;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @export
|
|
63
|
-
*/
|
|
64
|
-
export declare const ContentStateEndColorEnum: {
|
|
65
|
-
readonly Lime: "lime";
|
|
66
|
-
readonly Green: "green";
|
|
67
|
-
readonly Cyan: "cyan";
|
|
68
|
-
readonly Blue: "blue";
|
|
69
|
-
readonly Purple: "purple";
|
|
70
|
-
readonly Magenta: "magenta";
|
|
71
|
-
readonly Red: "red";
|
|
72
|
-
readonly Orange: "orange";
|
|
73
|
-
readonly Yellow: "yellow";
|
|
74
|
-
};
|
|
75
|
-
export type ContentStateEndColorEnum = typeof ContentStateEndColorEnum[keyof typeof ContentStateEndColorEnum];
|
|
76
|
-
/**
|
|
77
|
-
* @export
|
|
78
|
-
*/
|
|
79
|
-
export declare const ContentStateEndStepColorEnum: {
|
|
80
|
-
readonly Lime: "lime";
|
|
81
|
-
readonly Green: "green";
|
|
82
|
-
readonly Cyan: "cyan";
|
|
83
|
-
readonly Blue: "blue";
|
|
84
|
-
readonly Purple: "purple";
|
|
85
|
-
readonly Magenta: "magenta";
|
|
86
|
-
readonly Red: "red";
|
|
87
|
-
readonly Orange: "orange";
|
|
88
|
-
readonly Yellow: "yellow";
|
|
89
|
-
};
|
|
90
|
-
export type ContentStateEndStepColorEnum = typeof ContentStateEndStepColorEnum[keyof typeof ContentStateEndStepColorEnum];
|
|
91
|
-
/**
|
|
92
|
-
* Check if a given object implements the ContentStateEnd interface.
|
|
93
|
-
*/
|
|
94
|
-
export declare function instanceOfContentStateEnd(value: object): value is ContentStateEnd;
|
|
95
|
-
export declare function ContentStateEndFromJSON(json: any): ContentStateEnd;
|
|
96
|
-
export declare function ContentStateEndFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContentStateEnd;
|
|
97
|
-
export declare function ContentStateEndToJSON(value?: ContentStateEnd | null): any;
|