@abyss-project/reflex 6.4.0 → 6.6.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.
- package/.eslintrc.js +32 -32
- package/.prettierrc +5 -5
- package/README.md +15 -15
- package/dist/api/function-run.api.d.ts +2 -1
- package/dist/api/function-run.api.js +3 -1
- package/dist/api/function-run.api.js.map +1 -1
- package/dist/discord/discord-command-tree.d.ts +5 -0
- package/dist/discord/discord-command-tree.js +38 -0
- package/dist/discord/discord-command-tree.js.map +1 -0
- package/dist/discord/discord-event-filter-cases.js +27 -11
- package/dist/discord/discord-event-filter-cases.js.map +1 -1
- package/dist/discord/discord-event-filters.js +7 -3
- package/dist/discord/discord-event-filters.js.map +1 -1
- package/dist/discord/discord-event-intents.d.ts +8 -2
- package/dist/discord/discord-event-intents.js +13 -2
- package/dist/discord/discord-event-intents.js.map +1 -1
- package/dist/discord/index.d.ts +1 -0
- package/dist/discord/index.js +1 -0
- package/dist/discord/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/enum/discord-command-node-type.enum.d.ts +5 -0
- package/dist/types/enum/discord-command-node-type.enum.js +10 -0
- package/dist/types/enum/discord-command-node-type.enum.js.map +1 -0
- package/dist/types/enum/discord-command-type.enum.d.ts +5 -0
- package/dist/types/enum/discord-command-type.enum.js +10 -0
- package/dist/types/enum/discord-command-type.enum.js.map +1 -0
- package/dist/types/enum/discord-event-type.enum.d.ts +3 -1
- package/dist/types/enum/discord-event-type.enum.js +2 -0
- package/dist/types/enum/discord-event-type.enum.js.map +1 -1
- package/dist/types/enum/index.d.ts +2 -0
- package/dist/types/enum/index.js +2 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/reflex-error-code.enum.d.ts +10 -0
- package/dist/types/enum/reflex-error-code.enum.js +10 -0
- package/dist/types/enum/reflex-error-code.enum.js.map +1 -1
- package/dist/types/interface/api/requests/function-run.request.d.ts +8 -0
- package/dist/types/interface/api/requests/service-discord.request.d.ts +7 -3
- package/dist/types/interface/api/responses/function-run.response.d.ts +8 -0
- package/dist/types/interface/models/reflex-discord.model.d.ts +18 -2
- package/dist/types/interface/models/reflex-discord.model.js +4 -0
- package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
- package/dist/types/interface/models/reflex-run.model.d.ts +4 -0
- package/dist/types/interface/models/reflex-run.model.js +4 -1
- package/dist/types/interface/models/reflex-run.model.js.map +1 -1
- package/jest.config.ts +11 -11
- package/package.json +1 -1
- package/src/api/alert-rule.api.test.ts +72 -72
- package/src/api/alert-rule.api.ts +57 -57
- package/src/api/application-insights.api.test.ts +42 -42
- package/src/api/application-insights.api.ts +38 -38
- package/src/api/application-run-settings.api.test.ts +62 -62
- package/src/api/application-run-settings.api.ts +30 -30
- package/src/api/function-access.api.ts +87 -87
- package/src/api/function-insights.api.test.ts +27 -27
- package/src/api/function-insights.api.ts +18 -18
- package/src/api/function-run.api.ts +19 -0
- package/src/api/function-settings.api.ts +96 -96
- package/src/api/function-template.api.test.ts +72 -72
- package/src/api/function-template.api.ts +52 -52
- package/src/api/function-test.api.ts +34 -34
- package/src/api/function-version.api.ts +66 -66
- package/src/api/function.api.test.ts +346 -346
- package/src/api/function.api.ts +62 -62
- package/src/api/health.api.ts +10 -10
- package/src/api/route-stats.api.test.ts +45 -45
- package/src/api/route-stats.api.ts +36 -36
- package/src/api/service-completion-webhook.api.test.ts +97 -97
- package/src/api/service-completion-webhook.api.ts +39 -39
- package/src/api/service-configuration.api.ts +16 -16
- package/src/api/service-consumer.api.test.ts +104 -104
- package/src/api/service-consumer.api.ts +90 -90
- package/src/api/service-deployment.api.ts +79 -79
- package/src/api/service-discord-event.api.test.ts +106 -106
- package/src/api/service-discord-event.api.ts +78 -78
- package/src/api/service-discord.api.test.ts +178 -178
- package/src/api/service-discord.api.ts +222 -222
- package/src/api/service-insights.api.test.ts +36 -36
- package/src/api/service-insights.api.ts +42 -42
- package/src/api/service-limits.api.test.ts +100 -100
- package/src/api/service-limits.api.ts +37 -37
- package/src/api/service-openapi.api.test.ts +52 -52
- package/src/api/service-openapi.api.ts +21 -21
- package/src/api/service-route.api.ts +74 -74
- package/src/api/service-task.api.test.ts +140 -140
- package/src/api/service-task.api.ts +141 -141
- package/src/api/service-version.api.ts +54 -54
- package/src/api/service.api.test.ts +220 -220
- package/src/api/service.api.ts +55 -55
- package/src/api/storage-surplus.admin.api.test.ts +66 -66
- package/src/api/storage-surplus.admin.api.ts +45 -45
- package/src/discord/discord-command-tree.test.ts +47 -0
- package/src/discord/discord-command-tree.ts +60 -0
- package/src/discord/discord-event-filter-cases.ts +299 -261
- package/src/discord/discord-event-filters.test.ts +120 -91
- package/src/discord/discord-event-filters.ts +103 -95
- package/src/discord/discord-event-intents.test.ts +139 -112
- package/src/discord/discord-event-intents.ts +80 -55
- package/src/discord/index.ts +4 -3
- package/src/index.test.ts +104 -104
- package/src/index.ts +2 -0
- package/src/insights/index.ts +1 -1
- package/src/insights/percentiles.test.ts +75 -75
- package/src/insights/percentiles.ts +37 -37
- package/src/types/enum/discord-command-node-type.enum.ts +10 -0
- package/src/types/enum/discord-command-type.enum.ts +9 -0
- package/src/types/enum/discord-event-type.enum.ts +4 -0
- package/src/types/enum/discord-host-action.enum.ts +37 -37
- package/src/types/enum/index.ts +2 -0
- package/src/types/enum/reflex-error-code.enum.ts +112 -89
- package/src/types/interface/api/requests/application-run-settings.request.ts +13 -13
- package/src/types/interface/api/requests/function-run.request.ts +53 -42
- package/src/types/interface/api/requests/function-settings.request.ts +50 -50
- package/src/types/interface/api/requests/index.ts +25 -25
- package/src/types/interface/api/requests/service-discord.request.ts +168 -155
- package/src/types/interface/api/requests/service.request.ts +48 -48
- package/src/types/interface/api/requests/storage-surplus.admin.request.ts +12 -12
- package/src/types/interface/api/responses/function-run.response.ts +35 -23
- package/src/types/interface/api/responses/function-settings.response.ts +57 -57
- package/src/types/interface/api/responses/index.ts +25 -25
- package/src/types/interface/api/responses/storage-surplus.admin.response.ts +10 -10
- package/src/types/interface/models/index.ts +29 -29
- package/src/types/interface/models/reflex-discord.model.ts +249 -208
- package/src/types/interface/models/reflex-price-list.model.ts +22 -22
- package/src/types/interface/models/reflex-run-retention.model.ts +24 -24
- package/src/types/interface/models/reflex-run-settings.model.ts +39 -39
- package/src/types/interface/models/reflex-run.model.ts +317 -309
- package/src/types/interface/models/reflex-service-deployment.model.ts +48 -48
- package/src/types/interface/models/reflex-service.model.ts +47 -47
- package/src/types/interface/models/reflex-storage-surplus.model.ts +23 -23
- package/tsconfig.check.json +15 -15
- package/tsconfig.json +35 -35
|
@@ -18,6 +18,16 @@ var ReflexErrorCode;
|
|
|
18
18
|
ReflexErrorCode["DISCORD_TOKEN_REJECTED"] = "DISCORD_TOKEN_REJECTED";
|
|
19
19
|
ReflexErrorCode["DISCORD_TEST_GUILD_REQUIRED"] = "DISCORD_TEST_GUILD_REQUIRED";
|
|
20
20
|
ReflexErrorCode["DISCORD_COMMAND_CONFLICT"] = "DISCORD_COMMAND_CONFLICT";
|
|
21
|
+
ReflexErrorCode["DISCORD_COMMAND_TREE_INVALID"] = "DISCORD_COMMAND_TREE_INVALID";
|
|
22
|
+
ReflexErrorCode["DISCORD_COMMAND_ROOT_ONLY_FIELD"] = "DISCORD_COMMAND_ROOT_ONLY_FIELD";
|
|
23
|
+
ReflexErrorCode["DISCORD_COMMAND_EMPTY_PARENT"] = "DISCORD_COMMAND_EMPTY_PARENT";
|
|
24
|
+
ReflexErrorCode["DISCORD_COMMAND_LIMIT"] = "DISCORD_COMMAND_LIMIT";
|
|
25
|
+
ReflexErrorCode["REPLAY_NOT_EVENT_RUN"] = "REPLAY_NOT_EVENT_RUN";
|
|
26
|
+
ReflexErrorCode["RUN_DETAIL_GONE"] = "RUN_DETAIL_GONE";
|
|
27
|
+
ReflexErrorCode["REPLAY_INPUT_TRUNCATED"] = "REPLAY_INPUT_TRUNCATED";
|
|
28
|
+
ReflexErrorCode["REPLAY_TRIGGER_GONE"] = "REPLAY_TRIGGER_GONE";
|
|
29
|
+
ReflexErrorCode["BOT_EVENTS_BLOCKED"] = "BOT_EVENTS_BLOCKED";
|
|
30
|
+
ReflexErrorCode["REPLAY_RATE_LIMITED"] = "REPLAY_RATE_LIMITED";
|
|
21
31
|
ReflexErrorCode["DISCORD_COMPONENT_PREFIX_CONFLICT"] = "DISCORD_COMPONENT_PREFIX_CONFLICT";
|
|
22
32
|
ReflexErrorCode["SERVICE_TYPE_FIELD_REFUSED"] = "SERVICE_TYPE_FIELD_REFUSED";
|
|
23
33
|
ReflexErrorCode["ROUTE_SEGMENT_RESERVED"] = "ROUTE_SEGMENT_RESERVED";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflex-error-code.enum.js","sourceRoot":"","sources":["../../../src/types/enum/reflex-error-code.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,
|
|
1
|
+
{"version":3,"file":"reflex-error-code.enum.js","sourceRoot":"","sources":["../../../src/types/enum/reflex-error-code.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,eA8GX;AA9GD,WAAY,eAAe;IAEzB,4DAAyC,CAAA;IAEzC,sDAAmC,CAAA;IAEnC,4CAAyB,CAAA;IAEzB,8DAA2C,CAAA;IAE3C,kEAA+C,CAAA;IAE/C,oDAAiC,CAAA;IAEjC,8EAA2D,CAAA;IAE3D,oDAAiC,CAAA;IAEjC,8DAA2C,CAAA;IAE3C,oDAAiC,CAAA;IAEjC,0DAAuC,CAAA;IAEvC,kEAA+C,CAAA;IAE/C,oEAAiD,CAAA;IAEjD,8EAA2D,CAAA;IAE3D,wEAAqD,CAAA;IAKrD,gFAA6D,CAAA;IAE7D,sFAAmE,CAAA;IAEnE,gFAA6D,CAAA;IAE7D,kEAA+C,CAAA;IAE/C,gEAA6C,CAAA;IAE7C,sDAAmC,CAAA;IAEnC,oEAAiD,CAAA;IAEjD,8DAA2C,CAAA;IAE3C,4DAAyC,CAAA;IAEzC,8DAA2C,CAAA;IAE3C,0FAAuE,CAAA;IAEvE,4EAAyD,CAAA;IAKzD,oEAAiD,CAAA;IAEjD,4EAAyD,CAAA;IAEzD,4EAAyD,CAAA;IAKzD,sDAAmC,CAAA;IAKnC,0DAAuC,CAAA;IAMvC,oDAAiC,CAAA;IAEjC,wDAAqC,CAAA;IAErC,oEAAiD,CAAA;IAEjD,4EAAyD,CAAA;IAKzD,oFAAiE,CAAA;IAKjE,8DAA2C,CAAA;IAK3C,sDAAmC,CAAA;IAMnC,sEAAmD,CAAA;AACrD,CAAC,EA9GW,eAAe,+BAAf,eAAe,QA8G1B"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { RunMode } from '../../../enum';
|
|
2
|
+
export interface IReplayFunctionRunParams {
|
|
3
|
+
applicationId: string;
|
|
4
|
+
functionId: string;
|
|
5
|
+
runId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IReplayFunctionRunBody {
|
|
8
|
+
mode: RunMode.DRY_RUN | RunMode.LIVE;
|
|
9
|
+
}
|
|
2
10
|
export interface IListFunctionRunParams {
|
|
3
11
|
applicationId: string;
|
|
4
12
|
functionId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DiscordActivityType, DiscordComponentKind, DiscordPresenceStatus } from '../../../enum';
|
|
1
|
+
import type { DiscordActivityType, DiscordCommandNodeType, DiscordCommandType, DiscordComponentKind, DiscordPresenceStatus } from '../../../enum';
|
|
2
2
|
import type { IReflexDiscordCommandOption, ReflexDiscordLocalizations } from '../../models';
|
|
3
3
|
export interface IListServiceDiscordCommandParams {
|
|
4
4
|
applicationId: string;
|
|
@@ -9,10 +9,13 @@ export interface ICreateServiceDiscordCommandParams {
|
|
|
9
9
|
serviceId: string;
|
|
10
10
|
}
|
|
11
11
|
export interface ICreateServiceDiscordCommandBody {
|
|
12
|
+
type?: DiscordCommandType;
|
|
13
|
+
nodeType?: DiscordCommandNodeType;
|
|
14
|
+
parentId?: string;
|
|
12
15
|
name: string;
|
|
13
|
-
description
|
|
16
|
+
description?: string;
|
|
14
17
|
options?: IReflexDiscordCommandOption[];
|
|
15
|
-
functionId
|
|
18
|
+
functionId?: string;
|
|
16
19
|
defaultMemberPermissions?: string | null;
|
|
17
20
|
allowedInDirectMessages?: boolean;
|
|
18
21
|
nameLocalizations?: ReflexDiscordLocalizations | null;
|
|
@@ -91,6 +94,7 @@ export interface ISetServiceDiscordEnvironmentBody {
|
|
|
91
94
|
activityType?: DiscordActivityType | null;
|
|
92
95
|
activityText?: string | null;
|
|
93
96
|
maxAttachmentBytes?: number;
|
|
97
|
+
pollVotesEnabled?: boolean;
|
|
94
98
|
}
|
|
95
99
|
export interface ICheckServiceDiscordConnectionParams {
|
|
96
100
|
applicationId: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IReflexExecutionState, IReflexRun, IReflexRunDetail } from '../../models';
|
|
2
2
|
import type { IResponse } from '../response';
|
|
3
|
+
import type { RunMode } from '../../../enum';
|
|
3
4
|
export interface IListFunctionRunData {
|
|
4
5
|
runs: IReflexRun[];
|
|
5
6
|
}
|
|
@@ -8,6 +9,13 @@ export interface IGetFunctionRunData {
|
|
|
8
9
|
run: IReflexRunDetail;
|
|
9
10
|
}
|
|
10
11
|
export type IGetFunctionRunResponse = IResponse<IGetFunctionRunData>;
|
|
12
|
+
export interface IReplayFunctionRunData {
|
|
13
|
+
mode: RunMode.DRY_RUN | RunMode.LIVE;
|
|
14
|
+
masked: boolean;
|
|
15
|
+
run?: IReflexRun;
|
|
16
|
+
eventId?: string;
|
|
17
|
+
}
|
|
18
|
+
export type IReplayFunctionRunResponse = IResponse<IReplayFunctionRunData>;
|
|
11
19
|
export interface IGetFunctionRunStateData {
|
|
12
20
|
state: IReflexExecutionState;
|
|
13
21
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type { DiscordActivityType, DiscordChannelType, DiscordComponentKind, DiscordLocale, DiscordGatewayFailureCode, DiscordGatewayState, DiscordOptionType, DiscordPresenceStatus, DiscordTokenState } from '../../enum';
|
|
1
|
+
import type { DiscordActivityType, DiscordChannelType, DiscordCommandNodeType, DiscordCommandType, DiscordComponentKind, DiscordLocale, DiscordGatewayFailureCode, DiscordGatewayState, DiscordOptionType, DiscordPresenceStatus, DiscordTokenState } from '../../enum';
|
|
2
2
|
export declare const REFLEX_DISCORD_LIMITS: {
|
|
3
3
|
readonly commandNamePattern: RegExp;
|
|
4
4
|
readonly localizedNamePattern: RegExp;
|
|
5
5
|
readonly commandDescriptionMaxLength: 100;
|
|
6
6
|
readonly commandsPerServiceMax: 100;
|
|
7
|
+
readonly userCommandsPerServiceMax: 15;
|
|
8
|
+
readonly messageCommandsPerServiceMax: 15;
|
|
9
|
+
readonly contextMenuNameMaxLength: 32;
|
|
10
|
+
readonly subcommandsPerLevelMax: 25;
|
|
7
11
|
readonly optionsPerCommandMax: 25;
|
|
8
12
|
readonly choicesPerOptionMax: 25;
|
|
9
13
|
readonly componentPrefixPattern: RegExp;
|
|
@@ -38,7 +42,10 @@ export interface IReflexDiscordCommandOption {
|
|
|
38
42
|
export interface IReflexDiscordCommand {
|
|
39
43
|
id: string;
|
|
40
44
|
serviceId: string;
|
|
41
|
-
|
|
45
|
+
type: DiscordCommandType;
|
|
46
|
+
nodeType: DiscordCommandNodeType;
|
|
47
|
+
parentId: string | null;
|
|
48
|
+
functionId: string | null;
|
|
42
49
|
name: string;
|
|
43
50
|
description: string;
|
|
44
51
|
options: IReflexDiscordCommandOption[];
|
|
@@ -63,7 +70,14 @@ export type IReflexDiscordCommandSnapshot = Pick<IReflexDiscordCommand, 'id' | '
|
|
|
63
70
|
nameLocalizations?: ReflexDiscordLocalizations;
|
|
64
71
|
descriptionLocalizations?: ReflexDiscordLocalizations;
|
|
65
72
|
userInstallable?: true;
|
|
73
|
+
type?: DiscordCommandType;
|
|
74
|
+
nodeType?: DiscordCommandNodeType;
|
|
75
|
+
parentId?: string;
|
|
66
76
|
};
|
|
77
|
+
export interface IReflexDiscordCommandTreeNode<T extends Pick<IReflexDiscordCommand, 'id' | 'parentId' | 'name'> = IReflexDiscordCommand> {
|
|
78
|
+
command: T;
|
|
79
|
+
children: IReflexDiscordCommandTreeNode<T>[];
|
|
80
|
+
}
|
|
67
81
|
export type IReflexDiscordComponentSnapshot = Pick<IReflexDiscordComponent, 'id' | 'functionId' | 'customIdPrefix' | 'kind'>;
|
|
68
82
|
export interface IReflexDiscordEnvironmentSettings {
|
|
69
83
|
id: string;
|
|
@@ -75,6 +89,7 @@ export interface IReflexDiscordEnvironmentSettings {
|
|
|
75
89
|
activityType: DiscordActivityType | null;
|
|
76
90
|
activityText: string | null;
|
|
77
91
|
maxAttachmentBytes: number;
|
|
92
|
+
pollVotesEnabled: boolean;
|
|
78
93
|
createdAt: Date;
|
|
79
94
|
updatedAt: Date;
|
|
80
95
|
}
|
|
@@ -97,6 +112,7 @@ export interface IReflexDiscordEnvironmentConnection {
|
|
|
97
112
|
activityType: DiscordActivityType | null;
|
|
98
113
|
activityText: string | null;
|
|
99
114
|
maxAttachmentBytes: number;
|
|
115
|
+
pollVotesEnabled: boolean;
|
|
100
116
|
presence: IReflexDiscordPresence | null;
|
|
101
117
|
interactionsUrl: string;
|
|
102
118
|
inviteUrl: string | null;
|
|
@@ -6,6 +6,10 @@ exports.REFLEX_DISCORD_LIMITS = {
|
|
|
6
6
|
localizedNamePattern: /^[-_'\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$/u,
|
|
7
7
|
commandDescriptionMaxLength: 100,
|
|
8
8
|
commandsPerServiceMax: 100,
|
|
9
|
+
userCommandsPerServiceMax: 15,
|
|
10
|
+
messageCommandsPerServiceMax: 15,
|
|
11
|
+
contextMenuNameMaxLength: 32,
|
|
12
|
+
subcommandsPerLevelMax: 25,
|
|
9
13
|
optionsPerCommandMax: 25,
|
|
10
14
|
choicesPerOptionMax: 25,
|
|
11
15
|
componentPrefixPattern: /^[a-z0-9_-]{1,40}$/,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflex-discord.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/reflex-discord.model.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"reflex-discord.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/reflex-discord.model.ts"],"names":[],"mappings":";;;AAea,QAAA,qBAAqB,GAAG;IAEnC,kBAAkB,EAAE,oBAAoB;IAKxC,oBAAoB,EAAE,gDAAgD;IACtE,2BAA2B,EAAE,GAAG;IAEhC,qBAAqB,EAAE,GAAG;IAE1B,yBAAyB,EAAE,EAAE;IAC7B,4BAA4B,EAAE,EAAE;IAEhC,wBAAwB,EAAE,EAAE;IAE5B,sBAAsB,EAAE,EAAE;IAC1B,oBAAoB,EAAE,EAAE;IACxB,mBAAmB,EAAE,EAAE;IAEvB,sBAAsB,EAAE,oBAAoB;IAC5C,kBAAkB,EAAE,GAAG;IAEvB,eAAe,EAAE,IAAI;IAErB,mBAAmB,EAAE,GAAG;IAExB,yBAAyB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IAC1C,uBAAuB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;CAChC,CAAC;AAGJ,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAW,EAAE,CAC5D,6BAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;AAD1E,QAAA,oBAAoB,wBACsD"}
|
|
@@ -65,6 +65,9 @@ export interface IReflexRunTrace {
|
|
|
65
65
|
truncated: boolean;
|
|
66
66
|
truncatedFields: string[];
|
|
67
67
|
}
|
|
68
|
+
export declare const REFLEX_REPLAY_LIMITS: {
|
|
69
|
+
readonly liveReplaysPerMinute: 10;
|
|
70
|
+
};
|
|
68
71
|
export interface IReflexRun {
|
|
69
72
|
id: string;
|
|
70
73
|
functionId: string;
|
|
@@ -79,6 +82,7 @@ export interface IReflexRun {
|
|
|
79
82
|
componentId: string | null;
|
|
80
83
|
taskId: string | null;
|
|
81
84
|
eventTriggerId: string | null;
|
|
85
|
+
replayOfRunId: string | null;
|
|
82
86
|
traceId: string | null;
|
|
83
87
|
scheduledRunOrigin: ScheduledRunOrigin | null;
|
|
84
88
|
originLabel: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REFLEX_RUN_DETAIL_LIMITS = void 0;
|
|
3
|
+
exports.REFLEX_REPLAY_LIMITS = exports.REFLEX_RUN_DETAIL_LIMITS = void 0;
|
|
4
4
|
exports.REFLEX_RUN_DETAIL_LIMITS = {
|
|
5
5
|
totalBytes: 65_536,
|
|
6
6
|
errorBytes: 4_096,
|
|
@@ -9,4 +9,7 @@ exports.REFLEX_RUN_DETAIL_LIMITS = {
|
|
|
9
9
|
responseBytes: 16_384,
|
|
10
10
|
entryBytes: 4_096,
|
|
11
11
|
};
|
|
12
|
+
exports.REFLEX_REPLAY_LIMITS = {
|
|
13
|
+
liveReplaysPerMinute: 10,
|
|
14
|
+
};
|
|
12
15
|
//# sourceMappingURL=reflex-run.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflex-run.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/reflex-run.model.ts"],"names":[],"mappings":";;;AAoDa,QAAA,wBAAwB,GAAG;IAEtC,UAAU,EAAE,MAAM;IAElB,UAAU,EAAE,KAAK;IAEjB,gBAAgB,EAAE,KAAK;IAEvB,gBAAgB,EAAE,MAAM;IAExB,aAAa,EAAE,MAAM;IAErB,UAAU,EAAE,KAAK;CACT,CAAC"}
|
|
1
|
+
{"version":3,"file":"reflex-run.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/reflex-run.model.ts"],"names":[],"mappings":";;;AAoDa,QAAA,wBAAwB,GAAG;IAEtC,UAAU,EAAE,MAAM;IAElB,UAAU,EAAE,KAAK;IAEjB,gBAAgB,EAAE,KAAK;IAEvB,gBAAgB,EAAE,MAAM;IAExB,aAAa,EAAE,MAAM;IAErB,UAAU,EAAE,KAAK;CACT,CAAC;AAkDE,QAAA,oBAAoB,GAAG;IAElC,oBAAoB,EAAE,EAAE;CAChB,CAAC"}
|
package/jest.config.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Config } from '@jest/types';
|
|
2
|
-
|
|
3
|
-
const config: Config.InitialOptions = {
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
transform: {
|
|
6
|
-
'^.+\\.tsx?$': ['ts-jest', { isolatedModules: true }],
|
|
7
|
-
},
|
|
8
|
-
modulePathIgnorePatterns: ['dist'],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default config;
|
|
1
|
+
import type { Config } from '@jest/types';
|
|
2
|
+
|
|
3
|
+
const config: Config.InitialOptions = {
|
|
4
|
+
testEnvironment: 'node',
|
|
5
|
+
transform: {
|
|
6
|
+
'^.+\\.tsx?$': ['ts-jest', { isolatedModules: true }],
|
|
7
|
+
},
|
|
8
|
+
modulePathIgnorePatterns: ['dist'],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { AxiosAdapter, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
-
import { AbyssReflexCore, ReflexAlertMetric, ReflexAlertScope } from '..';
|
|
3
|
-
|
|
4
|
-
const adapter = jest.fn<ReturnType<AxiosAdapter>, [InternalAxiosRequestConfig]>(async (config) => ({
|
|
5
|
-
data: { data: {} },
|
|
6
|
-
status: 200,
|
|
7
|
-
statusText: '',
|
|
8
|
-
headers: {},
|
|
9
|
-
config,
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
beforeAll(() => {
|
|
13
|
-
AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/', token: 'session-token' });
|
|
14
|
-
AbyssReflexCore.axios.defaults.adapter = adapter;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
beforeEach(() => adapter.mockClear());
|
|
18
|
-
|
|
19
|
-
const APP = { applicationId: 'app-1' };
|
|
20
|
-
|
|
21
|
-
describe('AbyssReflexCore alert rule routes', () => {
|
|
22
|
-
it('alertRule.list calls GET .../alert-rule, filtered by environment when given', async () => {
|
|
23
|
-
await AbyssReflexCore.sdk.application.alertRule.list(APP, { environmentId: 'e-1' });
|
|
24
|
-
|
|
25
|
-
const config = adapter.mock.calls[0][0];
|
|
26
|
-
expect(config.method).toBe('get');
|
|
27
|
-
expect(config.url).toBe('api/application/app-1/alert-rule');
|
|
28
|
-
expect(config.params).toEqual({ environmentId: 'e-1' });
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('alertRule.list works without a query', async () => {
|
|
32
|
-
await AbyssReflexCore.sdk.application.alertRule.list(APP);
|
|
33
|
-
|
|
34
|
-
expect(adapter.mock.calls[0][0].params).toEqual({});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('alertRule.create calls POST .../alert-rule with the rule', async () => {
|
|
38
|
-
const body = {
|
|
39
|
-
environmentId: 'e-1',
|
|
40
|
-
scope: ReflexAlertScope.SERVICE,
|
|
41
|
-
serviceId: 'svc-1',
|
|
42
|
-
metric: ReflexAlertMetric.ERROR_RATE,
|
|
43
|
-
threshold: 5,
|
|
44
|
-
windowMinutes: 15,
|
|
45
|
-
name: 'Errors',
|
|
46
|
-
};
|
|
47
|
-
await AbyssReflexCore.sdk.application.alertRule.create(APP, body);
|
|
48
|
-
|
|
49
|
-
const config = adapter.mock.calls[0][0];
|
|
50
|
-
expect(config.method).toBe('post');
|
|
51
|
-
expect(config.url).toBe('api/application/app-1/alert-rule');
|
|
52
|
-
expect(JSON.parse(config.data)).toEqual(body);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('alertRule.update calls PUT .../alert-rule/:ruleId with the editable values', async () => {
|
|
56
|
-
const body = { threshold: 10, windowMinutes: 30, minRuns: 20, enabled: false, name: 'Errors' };
|
|
57
|
-
await AbyssReflexCore.sdk.application.alertRule.update({ ...APP, ruleId: 'rule-1' }, body);
|
|
58
|
-
|
|
59
|
-
const config = adapter.mock.calls[0][0];
|
|
60
|
-
expect(config.method).toBe('put');
|
|
61
|
-
expect(config.url).toBe('api/application/app-1/alert-rule/rule-1');
|
|
62
|
-
expect(JSON.parse(config.data)).toEqual(body);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('alertRule.delete calls DELETE .../alert-rule/:ruleId', async () => {
|
|
66
|
-
await AbyssReflexCore.sdk.application.alertRule.delete({ ...APP, ruleId: 'rule-1' });
|
|
67
|
-
|
|
68
|
-
const config = adapter.mock.calls[0][0];
|
|
69
|
-
expect(config.method).toBe('delete');
|
|
70
|
-
expect(config.url).toBe('api/application/app-1/alert-rule/rule-1');
|
|
71
|
-
});
|
|
72
|
-
});
|
|
1
|
+
import { AxiosAdapter, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
import { AbyssReflexCore, ReflexAlertMetric, ReflexAlertScope } from '..';
|
|
3
|
+
|
|
4
|
+
const adapter = jest.fn<ReturnType<AxiosAdapter>, [InternalAxiosRequestConfig]>(async (config) => ({
|
|
5
|
+
data: { data: {} },
|
|
6
|
+
status: 200,
|
|
7
|
+
statusText: '',
|
|
8
|
+
headers: {},
|
|
9
|
+
config,
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
beforeAll(() => {
|
|
13
|
+
AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/', token: 'session-token' });
|
|
14
|
+
AbyssReflexCore.axios.defaults.adapter = adapter;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
beforeEach(() => adapter.mockClear());
|
|
18
|
+
|
|
19
|
+
const APP = { applicationId: 'app-1' };
|
|
20
|
+
|
|
21
|
+
describe('AbyssReflexCore alert rule routes', () => {
|
|
22
|
+
it('alertRule.list calls GET .../alert-rule, filtered by environment when given', async () => {
|
|
23
|
+
await AbyssReflexCore.sdk.application.alertRule.list(APP, { environmentId: 'e-1' });
|
|
24
|
+
|
|
25
|
+
const config = adapter.mock.calls[0][0];
|
|
26
|
+
expect(config.method).toBe('get');
|
|
27
|
+
expect(config.url).toBe('api/application/app-1/alert-rule');
|
|
28
|
+
expect(config.params).toEqual({ environmentId: 'e-1' });
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('alertRule.list works without a query', async () => {
|
|
32
|
+
await AbyssReflexCore.sdk.application.alertRule.list(APP);
|
|
33
|
+
|
|
34
|
+
expect(adapter.mock.calls[0][0].params).toEqual({});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('alertRule.create calls POST .../alert-rule with the rule', async () => {
|
|
38
|
+
const body = {
|
|
39
|
+
environmentId: 'e-1',
|
|
40
|
+
scope: ReflexAlertScope.SERVICE,
|
|
41
|
+
serviceId: 'svc-1',
|
|
42
|
+
metric: ReflexAlertMetric.ERROR_RATE,
|
|
43
|
+
threshold: 5,
|
|
44
|
+
windowMinutes: 15,
|
|
45
|
+
name: 'Errors',
|
|
46
|
+
};
|
|
47
|
+
await AbyssReflexCore.sdk.application.alertRule.create(APP, body);
|
|
48
|
+
|
|
49
|
+
const config = adapter.mock.calls[0][0];
|
|
50
|
+
expect(config.method).toBe('post');
|
|
51
|
+
expect(config.url).toBe('api/application/app-1/alert-rule');
|
|
52
|
+
expect(JSON.parse(config.data)).toEqual(body);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('alertRule.update calls PUT .../alert-rule/:ruleId with the editable values', async () => {
|
|
56
|
+
const body = { threshold: 10, windowMinutes: 30, minRuns: 20, enabled: false, name: 'Errors' };
|
|
57
|
+
await AbyssReflexCore.sdk.application.alertRule.update({ ...APP, ruleId: 'rule-1' }, body);
|
|
58
|
+
|
|
59
|
+
const config = adapter.mock.calls[0][0];
|
|
60
|
+
expect(config.method).toBe('put');
|
|
61
|
+
expect(config.url).toBe('api/application/app-1/alert-rule/rule-1');
|
|
62
|
+
expect(JSON.parse(config.data)).toEqual(body);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('alertRule.delete calls DELETE .../alert-rule/:ruleId', async () => {
|
|
66
|
+
await AbyssReflexCore.sdk.application.alertRule.delete({ ...APP, ruleId: 'rule-1' });
|
|
67
|
+
|
|
68
|
+
const config = adapter.mock.calls[0][0];
|
|
69
|
+
expect(config.method).toBe('delete');
|
|
70
|
+
expect(config.url).toBe('api/application/app-1/alert-rule/rule-1');
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { AbyssReflexCore } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
ICreateAlertRuleBody,
|
|
4
|
-
ICreateAlertRuleParams,
|
|
5
|
-
ICreateAlertRuleResponse,
|
|
6
|
-
IDeleteAlertRuleParams,
|
|
7
|
-
IDeleteAlertRuleResponse,
|
|
8
|
-
IListAlertRuleParams,
|
|
9
|
-
IListAlertRuleQuery,
|
|
10
|
-
IListAlertRuleResponse,
|
|
11
|
-
IUpdateAlertRuleBody,
|
|
12
|
-
IUpdateAlertRuleParams,
|
|
13
|
-
IUpdateAlertRuleResponse,
|
|
14
|
-
} from '../types';
|
|
15
|
-
|
|
16
|
-
const alertRuleUrl = (params: { applicationId: string }): string =>
|
|
17
|
-
`api/application/${params.applicationId}/alert-rule`;
|
|
18
|
-
|
|
19
|
-
/** `GET .../alert-rule`: the rules of the application and the state of their last evaluation. Needs REFLEX_READ. */
|
|
20
|
-
export const listAlertRule = async (
|
|
21
|
-
params: IListAlertRuleParams,
|
|
22
|
-
query: IListAlertRuleQuery = {},
|
|
23
|
-
): Promise<IListAlertRuleResponse> =>
|
|
24
|
-
(
|
|
25
|
-
await AbyssReflexCore.axios.get<IListAlertRuleResponse>(alertRuleUrl(params), {
|
|
26
|
-
params: query,
|
|
27
|
-
})
|
|
28
|
-
).data;
|
|
29
|
-
|
|
30
|
-
/** `POST .../alert-rule`: creates a rule. Needs REFLEX_FUNCTION_UPDATE. */
|
|
31
|
-
export const createAlertRule = async (
|
|
32
|
-
params: ICreateAlertRuleParams,
|
|
33
|
-
body: ICreateAlertRuleBody,
|
|
34
|
-
): Promise<ICreateAlertRuleResponse> =>
|
|
35
|
-
(await AbyssReflexCore.axios.post<ICreateAlertRuleResponse>(alertRuleUrl(params), body)).data;
|
|
36
|
-
|
|
37
|
-
/** `PUT .../alert-rule/:ruleId`: changes the threshold, window, minimum of runs, name and switch of a rule. Needs REFLEX_FUNCTION_UPDATE. */
|
|
38
|
-
export const updateAlertRule = async (
|
|
39
|
-
params: IUpdateAlertRuleParams,
|
|
40
|
-
body: IUpdateAlertRuleBody,
|
|
41
|
-
): Promise<IUpdateAlertRuleResponse> =>
|
|
42
|
-
(
|
|
43
|
-
await AbyssReflexCore.axios.put<IUpdateAlertRuleResponse>(
|
|
44
|
-
`${alertRuleUrl(params)}/${params.ruleId}`,
|
|
45
|
-
body,
|
|
46
|
-
)
|
|
47
|
-
).data;
|
|
48
|
-
|
|
49
|
-
/** `DELETE .../alert-rule/:ruleId`: deletes a rule and its state. Needs REFLEX_FUNCTION_UPDATE. */
|
|
50
|
-
export const deleteAlertRule = async (
|
|
51
|
-
params: IDeleteAlertRuleParams,
|
|
52
|
-
): Promise<IDeleteAlertRuleResponse> =>
|
|
53
|
-
(
|
|
54
|
-
await AbyssReflexCore.axios.delete<IDeleteAlertRuleResponse>(
|
|
55
|
-
`${alertRuleUrl(params)}/${params.ruleId}`,
|
|
56
|
-
)
|
|
57
|
-
).data;
|
|
1
|
+
import { AbyssReflexCore } from '..';
|
|
2
|
+
import type {
|
|
3
|
+
ICreateAlertRuleBody,
|
|
4
|
+
ICreateAlertRuleParams,
|
|
5
|
+
ICreateAlertRuleResponse,
|
|
6
|
+
IDeleteAlertRuleParams,
|
|
7
|
+
IDeleteAlertRuleResponse,
|
|
8
|
+
IListAlertRuleParams,
|
|
9
|
+
IListAlertRuleQuery,
|
|
10
|
+
IListAlertRuleResponse,
|
|
11
|
+
IUpdateAlertRuleBody,
|
|
12
|
+
IUpdateAlertRuleParams,
|
|
13
|
+
IUpdateAlertRuleResponse,
|
|
14
|
+
} from '../types';
|
|
15
|
+
|
|
16
|
+
const alertRuleUrl = (params: { applicationId: string }): string =>
|
|
17
|
+
`api/application/${params.applicationId}/alert-rule`;
|
|
18
|
+
|
|
19
|
+
/** `GET .../alert-rule`: the rules of the application and the state of their last evaluation. Needs REFLEX_READ. */
|
|
20
|
+
export const listAlertRule = async (
|
|
21
|
+
params: IListAlertRuleParams,
|
|
22
|
+
query: IListAlertRuleQuery = {},
|
|
23
|
+
): Promise<IListAlertRuleResponse> =>
|
|
24
|
+
(
|
|
25
|
+
await AbyssReflexCore.axios.get<IListAlertRuleResponse>(alertRuleUrl(params), {
|
|
26
|
+
params: query,
|
|
27
|
+
})
|
|
28
|
+
).data;
|
|
29
|
+
|
|
30
|
+
/** `POST .../alert-rule`: creates a rule. Needs REFLEX_FUNCTION_UPDATE. */
|
|
31
|
+
export const createAlertRule = async (
|
|
32
|
+
params: ICreateAlertRuleParams,
|
|
33
|
+
body: ICreateAlertRuleBody,
|
|
34
|
+
): Promise<ICreateAlertRuleResponse> =>
|
|
35
|
+
(await AbyssReflexCore.axios.post<ICreateAlertRuleResponse>(alertRuleUrl(params), body)).data;
|
|
36
|
+
|
|
37
|
+
/** `PUT .../alert-rule/:ruleId`: changes the threshold, window, minimum of runs, name and switch of a rule. Needs REFLEX_FUNCTION_UPDATE. */
|
|
38
|
+
export const updateAlertRule = async (
|
|
39
|
+
params: IUpdateAlertRuleParams,
|
|
40
|
+
body: IUpdateAlertRuleBody,
|
|
41
|
+
): Promise<IUpdateAlertRuleResponse> =>
|
|
42
|
+
(
|
|
43
|
+
await AbyssReflexCore.axios.put<IUpdateAlertRuleResponse>(
|
|
44
|
+
`${alertRuleUrl(params)}/${params.ruleId}`,
|
|
45
|
+
body,
|
|
46
|
+
)
|
|
47
|
+
).data;
|
|
48
|
+
|
|
49
|
+
/** `DELETE .../alert-rule/:ruleId`: deletes a rule and its state. Needs REFLEX_FUNCTION_UPDATE. */
|
|
50
|
+
export const deleteAlertRule = async (
|
|
51
|
+
params: IDeleteAlertRuleParams,
|
|
52
|
+
): Promise<IDeleteAlertRuleResponse> =>
|
|
53
|
+
(
|
|
54
|
+
await AbyssReflexCore.axios.delete<IDeleteAlertRuleResponse>(
|
|
55
|
+
`${alertRuleUrl(params)}/${params.ruleId}`,
|
|
56
|
+
)
|
|
57
|
+
).data;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { AxiosAdapter, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
-
import { AbyssReflexCore, InsightsPeriod } from '..';
|
|
3
|
-
|
|
4
|
-
const adapter = jest.fn<ReturnType<AxiosAdapter>, [InternalAxiosRequestConfig]>(async (config) => ({
|
|
5
|
-
data: { data: {} },
|
|
6
|
-
status: 200,
|
|
7
|
-
statusText: '',
|
|
8
|
-
headers: {},
|
|
9
|
-
config,
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
beforeAll(() => {
|
|
13
|
-
AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/', token: 'session-token' });
|
|
14
|
-
AbyssReflexCore.axios.defaults.adapter = adapter;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
beforeEach(() => adapter.mockClear());
|
|
18
|
-
|
|
19
|
-
const QUERY = { environmentId: 'e-1', period: InsightsPeriod.DAYS_7 };
|
|
20
|
-
|
|
21
|
-
describe('AbyssReflexCore application insights routes', () => {
|
|
22
|
-
it('insights.get calls GET .../insights with the environment and the period', async () => {
|
|
23
|
-
await AbyssReflexCore.sdk.application.insights.get({ applicationId: 'app-1' }, QUERY);
|
|
24
|
-
|
|
25
|
-
const config = adapter.mock.calls[0][0];
|
|
26
|
-
expect(config.method).toBe('get');
|
|
27
|
-
expect(config.url).toBe('api/application/app-1/insights');
|
|
28
|
-
expect(config.params).toEqual({ environmentId: 'e-1', period: '7d' });
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('insights.calendar calls GET .../insights/calendar with the environment only', async () => {
|
|
32
|
-
await AbyssReflexCore.sdk.application.insights.calendar(
|
|
33
|
-
{ applicationId: 'app-1' },
|
|
34
|
-
{ environmentId: 'e-1' },
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
const config = adapter.mock.calls[0][0];
|
|
38
|
-
expect(config.method).toBe('get');
|
|
39
|
-
expect(config.url).toBe('api/application/app-1/insights/calendar');
|
|
40
|
-
expect(config.params).toEqual({ environmentId: 'e-1' });
|
|
41
|
-
});
|
|
42
|
-
});
|
|
1
|
+
import { AxiosAdapter, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
import { AbyssReflexCore, InsightsPeriod } from '..';
|
|
3
|
+
|
|
4
|
+
const adapter = jest.fn<ReturnType<AxiosAdapter>, [InternalAxiosRequestConfig]>(async (config) => ({
|
|
5
|
+
data: { data: {} },
|
|
6
|
+
status: 200,
|
|
7
|
+
statusText: '',
|
|
8
|
+
headers: {},
|
|
9
|
+
config,
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
beforeAll(() => {
|
|
13
|
+
AbyssReflexCore.setConfig({ baseURL: 'http://reflex.test/', token: 'session-token' });
|
|
14
|
+
AbyssReflexCore.axios.defaults.adapter = adapter;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
beforeEach(() => adapter.mockClear());
|
|
18
|
+
|
|
19
|
+
const QUERY = { environmentId: 'e-1', period: InsightsPeriod.DAYS_7 };
|
|
20
|
+
|
|
21
|
+
describe('AbyssReflexCore application insights routes', () => {
|
|
22
|
+
it('insights.get calls GET .../insights with the environment and the period', async () => {
|
|
23
|
+
await AbyssReflexCore.sdk.application.insights.get({ applicationId: 'app-1' }, QUERY);
|
|
24
|
+
|
|
25
|
+
const config = adapter.mock.calls[0][0];
|
|
26
|
+
expect(config.method).toBe('get');
|
|
27
|
+
expect(config.url).toBe('api/application/app-1/insights');
|
|
28
|
+
expect(config.params).toEqual({ environmentId: 'e-1', period: '7d' });
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('insights.calendar calls GET .../insights/calendar with the environment only', async () => {
|
|
32
|
+
await AbyssReflexCore.sdk.application.insights.calendar(
|
|
33
|
+
{ applicationId: 'app-1' },
|
|
34
|
+
{ environmentId: 'e-1' },
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const config = adapter.mock.calls[0][0];
|
|
38
|
+
expect(config.method).toBe('get');
|
|
39
|
+
expect(config.url).toBe('api/application/app-1/insights/calendar');
|
|
40
|
+
expect(config.params).toEqual({ environmentId: 'e-1' });
|
|
41
|
+
});
|
|
42
|
+
});
|