Skip to content

Commit fdc725a

Browse files
DEVORTEX-5439 Added endpoints for events
1 parent 92f11cd commit fdc725a

16 files changed

+285
-21
lines changed

api/base/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ export class SmartlingBaseApi {
162162
"dueDate",
163163
"actionTime",
164164
"publishDate",
165-
"lastModified"
165+
"lastModified",
166+
"attemptDate"
166167
];
167168

168169
if (dateProperties.includes(key) && value) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface ScrollableResponse<T> {
2+
items: Array<T>;
3+
hasMore: boolean;
4+
scrollId: string | null;
5+
}
6+
7+
export { ScrollableResponse };
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { SubscriptionEventAttemptStatus } from "./subscription-event-attempt-status";
2+
3+
interface SubscriptionAttemptedEventDto {
4+
eventId: string;
5+
eventType: string;
6+
createdDate: Date;
7+
lastAttemptStatus: SubscriptionEventAttemptStatus
8+
}
9+
10+
export { SubscriptionAttemptedEventDto };
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { SubscriptionEventAttemptStatus } from "./subscription-event-attempt-status";
2+
import { SubscriptionEventTriggerType } from "./subscription-event-trigger-type";
3+
4+
interface SubscriptionEventAttemptDto {
5+
attemptId: string;
6+
eventId: string;
7+
response: string | null;
8+
responseDurationMs: number;
9+
responseStatusCode: number;
10+
attemptStatus: SubscriptionEventAttemptStatus;
11+
attemptDate: Date;
12+
url: string;
13+
triggerType: SubscriptionEventTriggerType;
14+
}
15+
16+
export { SubscriptionEventAttemptDto };
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
enum SubscriptionEventAttemptStatus {
2+
SUCCESS = "SUCCESS",
3+
PENDING = "PENDING",
4+
FAIL = "FAIL",
5+
SENDING = "SENDING"
6+
}
7+
8+
export { SubscriptionEventAttemptStatus };
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
interface SubscriptionEventDto {
2+
eventId: string;
3+
eventType: string;
4+
createdDate: Date;
5+
payload: Record<string, unknown>;
6+
}
7+
8+
export { SubscriptionEventDto };
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
enum SubscriptionEventTriggerType {
2+
SCHEDULED = "SCHEDULED",
3+
MANUAL = "MANUAL"
4+
}
5+
6+
export { SubscriptionEventTriggerType };
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class WebhookEventTypeDto {
22
eventType: string;
33
description: string;
4-
schema: Record<string, any>;
4+
schema: Record<string, unknown>;
55
}
66

77
export { WebhookEventTypeDto };

api/webhooks/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
export { SmartlingWebhooksApi } from "./smartling-webhooks-api";
2+
export { ScrollableResponse } from "./dto/scrollable-response";
3+
export { SubscriptionAttemptedEventDto } from "./dto/subscription-attempted-event-dto";
4+
export { SubscriptionEventDto } from "./dto/subscription-event-dto";
5+
export { SubscriptionEventAttemptDto } from "./dto/subscription-event-attempt-dto";
6+
export { SubscriptionEventAttemptStatus } from "./dto/subscription-event-attempt-status";
7+
export { SubscriptionEventTriggerType } from "./dto/subscription-event-trigger-type";
8+
export { SubscriptionStatisticsDto } from "./dto/subscription-statistics-dto";
29
export { SubscriptionDto } from "./dto/subscription-dto";
310
export { SubscriptionSecretDto } from "./dto/subscription-secret-dto";
411
export { WebhookEventTypeDto } from "./dto/webhook-event-type.dto";

api/webhooks/params/create-subscription-parameters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CreateUpdateSubscriptionParameters } from "./create-update-subscription-parameters";
22

33
export class CreateSubscriptionParameters extends CreateUpdateSubscriptionParameters {
4-
setPayloadSecret(payloadSecret: string) {
4+
setPayloadSecret(payloadSecret: string): this {
55
this.set("payloadSecret", payloadSecret);
66

77
return this;

0 commit comments

Comments
 (0)