@serialized/serialized-client
Advanced tools
Comparing version 4.10.0 to 4.11.0
@@ -28,3 +28,3 @@ import { BaseClient } from "./"; | ||
export declare type Action = HttpAction | SlackAction | IftttAction | AutomateAction | ZapierAction; | ||
export interface ScheduledReaction { | ||
export interface Reaction { | ||
reactionId: string; | ||
@@ -38,44 +38,26 @@ reactionName: string; | ||
} | ||
export interface TriggeredReaction { | ||
reactionId: string; | ||
reactionName: string; | ||
aggregateType: string; | ||
aggregateId: string; | ||
eventId: string; | ||
createdAt: number; | ||
finishedAt: number; | ||
export interface ListReactionsResponse { | ||
reactions: Reaction[]; | ||
} | ||
export interface LoadScheduledReactionsResponse { | ||
reactions: ScheduledReaction[]; | ||
} | ||
export interface GetReactionDefinitionRequest { | ||
reactionName: string; | ||
} | ||
export interface DeleteScheduledReactionRequest { | ||
export interface DeleteReactionRequest { | ||
reactionId: string; | ||
} | ||
export interface ExecuteScheduledReactionRequest { | ||
export interface ExecuteReactionRequest { | ||
reactionId: string; | ||
} | ||
export interface ListScheduledReactionOptions { | ||
export interface ListReactionsOptions { | ||
tenantId?: string; | ||
status?: string; | ||
skip?: number; | ||
limit?: number; | ||
} | ||
export interface ListTriggeredReactionOptions { | ||
export interface ExecuteReactionOptions { | ||
tenantId?: string; | ||
} | ||
export interface ExecuteScheduledReactionOptions { | ||
export interface DeleteReactionOptions { | ||
tenantId?: string; | ||
} | ||
export interface ReExecuteTriggeredReactionOptions { | ||
tenantId?: string; | ||
} | ||
export interface DeleteScheduledReactionOptions { | ||
tenantId?: string; | ||
} | ||
export interface LoadTriggeredReactionsResponse { | ||
reactions: TriggeredReaction[]; | ||
} | ||
export interface ReExecuteTriggeredReactionRequest { | ||
reactionId: string; | ||
} | ||
export interface CreateReactionDefinitionRequest { | ||
@@ -108,14 +90,10 @@ reactionName: string; | ||
getReactionDefinition(request: GetReactionDefinitionRequest): Promise<LoadReactionDefinitionResponse>; | ||
listScheduledReactions(options?: ListScheduledReactionOptions): Promise<LoadScheduledReactionsResponse>; | ||
deleteScheduledReaction(request: DeleteScheduledReactionRequest, options?: DeleteScheduledReactionOptions): Promise<void>; | ||
deleteTriggeredReaction(request: DeleteScheduledReactionRequest, options?: DeleteScheduledReactionOptions): Promise<void>; | ||
executeScheduledReaction(request: ExecuteScheduledReactionRequest, options?: ExecuteScheduledReactionOptions): Promise<void>; | ||
listTriggeredReactions(options?: ListTriggeredReactionOptions): Promise<LoadTriggeredReactionsResponse>; | ||
reExecuteTriggeredReaction(request: ReExecuteTriggeredReactionRequest, options?: ReExecuteTriggeredReactionOptions): Promise<void>; | ||
listReactions(options?: ListReactionsOptions): Promise<ListReactionsResponse>; | ||
deleteReaction(request: DeleteReactionRequest, options?: DeleteReactionOptions): Promise<void>; | ||
executeReaction(request: ExecuteReactionRequest, options?: ExecuteReactionOptions): Promise<void>; | ||
static reactionDefinitionsUrl(): string; | ||
static reactionDefinitionUrl(reactionName: string): string; | ||
static scheduledReactionsUrl(): string; | ||
static scheduledReactionUrl(reactionId: string): string; | ||
static triggeredReactionsUrl(): string; | ||
static triggeredReactionUrl(reactionId: string): string; | ||
static reactionsUrl(): string; | ||
static reactionUrl(reactionId: string): string; | ||
static reactionExecutionUrl(reactionId: string): string; | ||
} |
@@ -94,3 +94,3 @@ "use strict"; | ||
; | ||
ReactionsClient.prototype.listScheduledReactions = function (options) { | ||
ReactionsClient.prototype.listReactions = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -103,3 +103,12 @@ var config; | ||
config.params = new URLSearchParams(); | ||
return [4 /*yield*/, this.axiosClient.get(ReactionsClient.scheduledReactionsUrl(), config)]; | ||
if (options.status !== undefined) { | ||
config.params.set('status', options.status); | ||
} | ||
if (options.skip !== undefined) { | ||
config.params.set('skip', options.skip.toString()); | ||
} | ||
if (options.limit !== undefined) { | ||
config.params.set('limit', options.limit.toString()); | ||
} | ||
return [4 /*yield*/, this.axiosClient.get(ReactionsClient.reactionsUrl(), config)]; | ||
case 1: return [2 /*return*/, (_a.sent()).data]; | ||
@@ -111,3 +120,3 @@ } | ||
; | ||
ReactionsClient.prototype.deleteScheduledReaction = function (request, options) { | ||
ReactionsClient.prototype.deleteReaction = function (request, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -120,3 +129,3 @@ var config; | ||
config.params = new URLSearchParams(); | ||
return [4 /*yield*/, this.axiosClient.delete(ReactionsClient.scheduledReactionUrl(request.reactionId), config)]; | ||
return [4 /*yield*/, this.axiosClient.delete(ReactionsClient.reactionUrl(request.reactionId), config)]; | ||
case 1: | ||
@@ -130,3 +139,3 @@ _a.sent(); | ||
; | ||
ReactionsClient.prototype.deleteTriggeredReaction = function (request, options) { | ||
ReactionsClient.prototype.executeReaction = function (request, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -139,3 +148,3 @@ var config; | ||
config.params = new URLSearchParams(); | ||
return [4 /*yield*/, this.axiosClient.delete(ReactionsClient.triggeredReactionUrl(request.reactionId), config)]; | ||
return [4 /*yield*/, this.axiosClient.post(ReactionsClient.reactionExecutionUrl(request.reactionId), '', config)]; | ||
case 1: | ||
@@ -149,51 +158,2 @@ _a.sent(); | ||
; | ||
ReactionsClient.prototype.executeScheduledReaction = function (request, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var config; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
config = options && options.tenantId ? this.axiosConfig(options.tenantId) : this.axiosConfig(); | ||
config.params = new URLSearchParams(); | ||
return [4 /*yield*/, this.axiosClient.post(ReactionsClient.scheduledReactionUrl(request.reactionId), config)]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
; | ||
ReactionsClient.prototype.listTriggeredReactions = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var config; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
config = options && options.tenantId ? this.axiosConfig(options.tenantId) : this.axiosConfig(); | ||
config.params = new URLSearchParams(); | ||
return [4 /*yield*/, this.axiosClient.get(ReactionsClient.triggeredReactionsUrl(), config)]; | ||
case 1: return [2 /*return*/, (_a.sent()).data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
; | ||
ReactionsClient.prototype.reExecuteTriggeredReaction = function (request, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var config; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
config = options && options.tenantId ? this.axiosConfig(options.tenantId) : this.axiosConfig(); | ||
config.params = new URLSearchParams(); | ||
return [4 /*yield*/, this.axiosClient.post(ReactionsClient.triggeredReactionUrl(request.reactionId), {}, config)]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
; | ||
ReactionsClient.reactionDefinitionsUrl = function () { | ||
@@ -205,16 +165,13 @@ return "/reactions/definitions"; | ||
}; | ||
ReactionsClient.scheduledReactionsUrl = function () { | ||
return "/reactions/scheduled"; | ||
ReactionsClient.reactionsUrl = function () { | ||
return "/reactions"; | ||
}; | ||
ReactionsClient.scheduledReactionUrl = function (reactionId) { | ||
return "/reactions/scheduled/".concat(reactionId); | ||
ReactionsClient.reactionUrl = function (reactionId) { | ||
return "/reactions/".concat(reactionId); | ||
}; | ||
ReactionsClient.triggeredReactionsUrl = function () { | ||
return "/reactions/triggered"; | ||
ReactionsClient.reactionExecutionUrl = function (reactionId) { | ||
return "/reactions/".concat(reactionId, "/execute"); | ||
}; | ||
ReactionsClient.triggeredReactionUrl = function (reactionId) { | ||
return "/reactions/triggered/".concat(reactionId); | ||
}; | ||
return ReactionsClient; | ||
}(_1.BaseClient)); | ||
exports.ReactionsClient = ReactionsClient; |
@@ -5,4 +5,4 @@ { | ||
"license": "MIT", | ||
"author": "Mattias Holmqvist", | ||
"version": "4.10.0", | ||
"author": "Serialized", | ||
"version": "4.11.0", | ||
"main": "dist/index.js", | ||
@@ -9,0 +9,0 @@ "types": "dist/index.d.ts", |
120672
2540