Skip to content

Commit 92a062e

Browse files
Merge pull request #2898 from RedisInsight/release/2.40.0
Release/2.40.0
2 parents 80a927a + 3a22ae8 commit 92a062e

File tree

121 files changed

+1775
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+1775
-417
lines changed

redisinsight/api/config/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060
tlsKey: process.env.SERVER_TLS_KEY,
6161
staticContent: !!process.env.SERVER_STATIC_CONTENT || false,
6262
buildType: process.env.BUILD_TYPE || 'ELECTRON',
63-
appVersion: process.env.APP_VERSION || '2.38.0',
63+
appVersion: process.env.APP_VERSION || '2.40.0',
6464
requestTimeout: parseInt(process.env.REQUEST_TIMEOUT, 10) || 25000,
6565
excludeRoutes: [],
6666
excludeAuthRoutes: [],

redisinsight/api/config/features-config.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": 2.3402,
2+
"version": 2.3403,
33
"features": {
44
"insightsRecommendations": {
55
"flag": true,
@@ -47,6 +47,22 @@
4747
}
4848
}
4949
},
50+
"cloudSsoRecommendedSettings": {
51+
"flag": true,
52+
"perc": [[0, 50]],
53+
"filters": [
54+
{
55+
"name": "config.server.buildType",
56+
"value": "ELECTRON",
57+
"cond": "eq"
58+
},
59+
{
60+
"name": "agreements.analytics",
61+
"value": true,
62+
"cond": "eq"
63+
}
64+
]
65+
},
5066
"redisModuleFilter": {
5167
"flag": true,
5268
"perc": [[0, 100]],

redisinsight/api/config/swagger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const SWAGGER_CONFIG: Omit<OpenAPIObject, 'paths'> = {
55
info: {
66
title: 'RedisInsight Backend API',
77
description: 'RedisInsight Backend API',
8-
version: '2.38.0',
8+
version: '2.40.0',
99
},
1010
tags: [],
1111
};

redisinsight/api/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redisinsight-api",
3-
"version": "2.38.0",
3+
"version": "2.40.0",
44
"description": "RedisInsight API",
55
"private": true,
66
"author": {
@@ -60,6 +60,7 @@
6060
"analytics-node": "^4.0.1",
6161
"axios": "^0.25.0",
6262
"body-parser": "^1.19.0",
63+
"busboy": "^1.6.0",
6364
"class-transformer": "^0.2.3",
6465
"class-validator": "^0.14.0",
6566
"connect-timeout": "^1.9.0",

redisinsight/api/src/__mocks__/feature.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ export const mockFeatureSso = Object.assign(new Feature(), {
182182
redisStackPreview: [
183183
{
184184
provider: 'AWS',
185-
regions: ['us-east-2', 'ap-southeast-1', 'sa-east-1']
185+
regions: ['us-east-2', 'ap-southeast-1', 'sa-east-1'],
186186
},
187187
{
188188
provider: 'GCP',
189-
regions: ['asia-northeast1', 'europe-west1', 'us-central1']
190-
}
189+
regions: ['asia-northeast1', 'europe-west1', 'us-central1'],
190+
},
191191
],
192192
},
193193
},

redisinsight/api/src/modules/analytics/analytics.service.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ describe('AnalyticsService', () => {
196196
event: TelemetryEvents.ApplicationStarted,
197197
eventData: {},
198198
nonTracking: false,
199+
traits: {
200+
telemetry: 'will be overwritten',
201+
custom: 'trait',
202+
},
199203
});
200204

201205
expect(mockAnalyticsPage).toHaveBeenCalledWith({
@@ -205,6 +209,7 @@ describe('AnalyticsService', () => {
205209
context: {
206210
traits: {
207211
telemetry: Telemetry.Enabled,
212+
custom: 'trait',
208213
},
209214
},
210215
properties: {

redisinsight/api/src/modules/analytics/analytics.service.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface ITelemetryEvent {
1313
event: string;
1414
eventData: Object;
1515
nonTracking: boolean;
16+
traits?: Object;
1617
}
1718

1819
export interface ITelemetryInitEvent {
@@ -43,7 +44,7 @@ export class AnalyticsService {
4344

4445
private appVersion: string = '2.0.0';
4546

46-
private analytics;
47+
private analytics: Analytics;
4748

4849
constructor(
4950
private settingsService: SettingsService,
@@ -80,7 +81,9 @@ export class AnalyticsService {
8081
// for analytics is granted or not.
8182
// If permissions not granted
8283
// anonymousId will includes "00000000-0000-0000-0000-000000000001" value without any user identifiers.
83-
const { event, eventData, nonTracking } = payload;
84+
const {
85+
event, eventData, nonTracking, traits = {},
86+
} = payload;
8487
const isAnalyticsGranted = await this.checkIsAnalyticsGranted();
8588

8689
if (isAnalyticsGranted || nonTracking) {
@@ -90,8 +93,9 @@ export class AnalyticsService {
9093
event,
9194
context: {
9295
traits: {
96+
...traits,
9397
telemetry: isAnalyticsGranted ? Telemetry.Enabled : Telemetry.Disabled,
94-
}
98+
},
9599
},
96100
properties: {
97101
...eventData,
@@ -118,7 +122,9 @@ export class AnalyticsService {
118122
// user in any way. When `nonTracking` is True, the event is sent regardless of whether the user's permission
119123
// for analytics is granted or not.
120124
// If permissions not granted anonymousId includes "UNSET" value without any user identifiers.
121-
const { event, eventData, nonTracking } = payload;
125+
const {
126+
event, eventData, nonTracking, traits = {},
127+
} = payload;
122128
const isAnalyticsGranted = await this.checkIsAnalyticsGranted();
123129

124130
if (isAnalyticsGranted || nonTracking) {
@@ -128,8 +134,9 @@ export class AnalyticsService {
128134
integrations: { Amplitude: { session_id: this.sessionId } },
129135
context: {
130136
traits: {
137+
...traits,
131138
telemetry: isAnalyticsGranted ? Telemetry.Enabled : Telemetry.Disabled,
132-
}
139+
},
133140
},
134141
properties: {
135142
...eventData,

redisinsight/api/src/modules/analytics/dto/analytics.dto.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,13 @@ export class SendEventDto {
3636
@IsOptional()
3737
@IsBoolean()
3838
nonTracking: boolean = false;
39+
40+
@ApiPropertyOptional({
41+
description: 'User data.',
42+
type: Object,
43+
example: { telemetry: true },
44+
})
45+
@IsOptional()
46+
@ValidateNested()
47+
traits: Object = {};
3948
}

redisinsight/api/src/modules/browser/utils/clusterCursor.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const isClusterCursorValidTests = [
1515
},
1616
{ input: '172.17.0.1:7001@-1', expected: true },
1717
{ input: 'domain.com:7001@-1', expected: true },
18+
{ input: 'domain-with-hyphens.com:7001@-1', expected: true },
1819
{ input: '172.17.0.1:7001@1228822', expected: true },
1920
{ input: '172.17.0.1:7001@', expected: false },
2021
{ input: '172.17.0.1:7001@text', expected: false },

redisinsight/api/src/modules/browser/utils/clusterCursor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { IGetNodeKeysResult } from 'src/modules/browser/services/keys-business/s
44
const NODES_SEPARATOR = '||';
55
const CURSOR_SEPARATOR = '@';
66
// Correct format 172.17.0.1:7001@-1||172.17.0.1:7002@33
7-
const CLUSTER_CURSOR_REGEX = /^(([a-z0-9.])+:[0-9]+(@-?\d+)(?:\|{2}(?!$)|$))+$/;
7+
const CLUSTER_CURSOR_REGEX = /^(([a-z0-9.-])+:[0-9]+(@-?\d+)(?:\|{2}(?!$)|$))+$/;
88

99
export const isClusterCursorValid = (cursor) => CLUSTER_CURSOR_REGEX.test(cursor);
1010

0 commit comments

Comments
 (0)