@coralogix/rum-cli 1.1.5 → 1.1.7
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 +16 -28
- package/package.json +4 -1
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -31
- package/.github/workflows/npm-publish.yml +0 -41
- package/api/rum-api.ts +0 -79
- package/assets/docs-illustration.png +0 -0
- package/cli/rum-cli.ts +0 -54
- package/cli/theme/index.ts +0 -5
- package/cli/validators/index.ts +0 -14
- package/config/config.ts +0 -31
- package/config/index.js +0 -7
- package/config/index.ts +0 -3
- package/dist/api/rum-api.d.ts +0 -5
- package/dist/api/rum-api.js +0 -98
- package/dist/cli/rum-cli.d.ts +0 -2
- package/dist/cli/theme/index.d.ts +0 -3
- package/dist/cli/theme/index.js +0 -7
- package/dist/cli/validators/index.d.ts +0 -1
- package/dist/cli/validators/index.js +0 -16
- package/dist/config/config.d.ts +0 -16
- package/dist/config/config.js +0 -16
- package/dist/config/index.d.ts +0 -2
- package/dist/config/index.js +0 -8
- package/dist/model/cli.model.d.ts +0 -1
- package/dist/model/cli.model.js +0 -11
- package/dist/proto-models/com/coralogix/rum/v2/audit_log.d.ts +0 -24
- package/dist/proto-models/com/coralogix/rum/v2/audit_log.js +0 -62
- package/dist/proto-models/com/coralogix/rum/v2/chunk.d.ts +0 -56
- package/dist/proto-models/com/coralogix/rum/v2/chunk.js +0 -330
- package/dist/proto-models/com/coralogix/rum/v2/file.d.ts +0 -26
- package/dist/proto-models/com/coralogix/rum/v2/file.js +0 -140
- package/dist/proto-models/com/coralogix/rum/v2/rum_service.d.ts +0 -72
- package/dist/proto-models/com/coralogix/rum/v2/rum_service.js +0 -233
- package/dist/proto-models/com/coralogix/rum/v2/rum_source_map_service.d.ts +0 -69
- package/dist/proto-models/com/coralogix/rum/v2/rum_source_map_service.js +0 -181
- package/dist/proto-models/com/coralogix/rum/v2/source_code_file_mapping.d.ts +0 -55
- package/dist/proto-models/com/coralogix/rum/v2/source_code_file_mapping.js +0 -277
- package/dist/proto-models/google/protobuf/descriptor.d.ts +0 -1140
- package/dist/proto-models/google/protobuf/descriptor.js +0 -3612
- package/dist/services/source-maps/source-maps.service.d.ts +0 -3
- package/dist/services/source-maps/source-maps.service.js +0 -42
- package/dist/services/source-maps/utils/traverse-folder.util.d.ts +0 -2
- package/dist/services/source-maps/utils/traverse-folder.util.js +0 -42
- package/generate-protos.sh +0 -14
- package/meta.yaml +0 -4
- package/model/cli.model.ts +0 -7
- package/prepublish.sh +0 -19
- package/proto-models/com/coralogix/rum/v2/audit_log.ts +0 -76
- package/proto-models/com/coralogix/rum/v2/chunk.ts +0 -391
- package/proto-models/com/coralogix/rum/v2/file.ts +0 -164
- package/proto-models/com/coralogix/rum/v2/rum_service.ts +0 -272
- package/proto-models/com/coralogix/rum/v2/rum_source_map_service.ts +0 -216
- package/proto-models/com/coralogix/rum/v2/source_code_file_mapping.ts +0 -331
- package/proto-models/google/protobuf/descriptor.ts +0 -4715
- package/protofetch.lock +0 -18
- package/protofetch.toml +0 -7
- package/protos/com/coralogix/rum/v2/audit_log.proto +0 -13
- package/protos/com/coralogix/rum/v2/chunk.proto +0 -24
- package/protos/com/coralogix/rum/v2/file.proto +0 -8
- package/protos/com/coralogix/rum/v2/rum_service.proto +0 -23
- package/protos/com/coralogix/rum/v2/rum_source_map_service.proto +0 -19
- package/protos/com/coralogix/rum/v2/source_code_file_mapping.proto +0 -16
- package/protoset.bin +0 -0
- package/services/source-maps/source-maps.service.ts +0 -31
- package/services/source-maps/utils/traverse-folder.util.ts +0 -33
- package/tsconfig.build.json +0 -6
- package/tsconfig.json +0 -25
package/protofetch.lock
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
module_name = 'rum-cli'
|
|
2
|
-
proto_out_dir = 'protos'
|
|
3
|
-
|
|
4
|
-
[[dependencies]]
|
|
5
|
-
commit_hash = '286c7b5b71275dc431e800c0f1c91e7b4d583944'
|
|
6
|
-
|
|
7
|
-
[dependencies.coordinate]
|
|
8
|
-
forge = 'github.com'
|
|
9
|
-
organization = 'coralogix'
|
|
10
|
-
protocol = 'ssh'
|
|
11
|
-
repository = 'cx-api-rum'
|
|
12
|
-
|
|
13
|
-
[dependencies.name]
|
|
14
|
-
value = 'cx-api-rum'
|
|
15
|
-
|
|
16
|
-
[dependencies.rules]
|
|
17
|
-
prune = false
|
|
18
|
-
transitive = false
|
package/protofetch.toml
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package com.coralogix.rum.v2;
|
|
4
|
-
|
|
5
|
-
import "google/protobuf/descriptor.proto";
|
|
6
|
-
|
|
7
|
-
message AuditLogDescription {
|
|
8
|
-
optional string description = 1;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
extend google.protobuf.MethodOptions {
|
|
12
|
-
AuditLogDescription audit_log_description = 5000;
|
|
13
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
package com.coralogix.rum.v2;
|
|
3
|
-
|
|
4
|
-
message Chunk {
|
|
5
|
-
string chunk_name = 1;
|
|
6
|
-
int64 generated_line_number = 2;
|
|
7
|
-
int64 generated_column_number = 3;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
message CodeLine {
|
|
11
|
-
int64 line_index = 2;
|
|
12
|
-
string line_code = 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message MappedChunk {
|
|
16
|
-
string chunk_name = 1;
|
|
17
|
-
int64 original_line_number = 2;
|
|
18
|
-
int64 original_column_number = 3;
|
|
19
|
-
string source_file_name = 4;
|
|
20
|
-
repeated CodeLine source_code_lines = 5;
|
|
21
|
-
int64 generated_line_number = 6;
|
|
22
|
-
int64 generated_column_number = 7;
|
|
23
|
-
string source_function_name = 8;
|
|
24
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
package com.coralogix.rum.v2;
|
|
3
|
-
|
|
4
|
-
import "com/coralogix/rum/v2/chunk.proto";
|
|
5
|
-
|
|
6
|
-
message GetMappedStackTraceRequest {
|
|
7
|
-
string application = 1;
|
|
8
|
-
string release_id = 2;
|
|
9
|
-
repeated Chunk chunks = 3;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
message GetMappedStackTraceResponse {
|
|
13
|
-
string application = 1;
|
|
14
|
-
string release_id = 2;
|
|
15
|
-
repeated MappedChunk mapped_chunks = 3;
|
|
16
|
-
optional string commit_hash = 4;
|
|
17
|
-
optional string repo_name = 5;
|
|
18
|
-
optional string user = 6;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
service RumService {
|
|
22
|
-
rpc GetMappedStackTrace(GetMappedStackTraceRequest) returns (GetMappedStackTraceResponse) {}
|
|
23
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
package com.coralogix.rum.v2;
|
|
3
|
-
|
|
4
|
-
import "com/coralogix/rum/v2/file.proto";
|
|
5
|
-
|
|
6
|
-
message UploadSourceMapsRequest {
|
|
7
|
-
string application = 1;
|
|
8
|
-
string release_id = 2;
|
|
9
|
-
optional string commit_hash = 3;
|
|
10
|
-
optional string repo_name = 4;
|
|
11
|
-
optional string user = 5;
|
|
12
|
-
repeated FileMetadata files = 6;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message UploadSourceMapsResponse {}
|
|
16
|
-
|
|
17
|
-
service RumSourceMapService {
|
|
18
|
-
rpc UploadSourceMaps(UploadSourceMapsRequest) returns (UploadSourceMapsResponse) {}
|
|
19
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
package com.coralogix.rum.v2;
|
|
3
|
-
|
|
4
|
-
message FileSourceCodeMap {
|
|
5
|
-
map<string, string> file_name_to_code = 1;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
message SourceCodeLineMapping {
|
|
9
|
-
string chunk_name = 1;
|
|
10
|
-
string source_file_name = 2;
|
|
11
|
-
int32 original_line_number = 3;
|
|
12
|
-
int32 generated_line_number = 4;
|
|
13
|
-
int32 original_column_number = 5;
|
|
14
|
-
int32 generated_column_number = 6;
|
|
15
|
-
string source_function_name = 7;
|
|
16
|
-
}
|
package/protoset.bin
DELETED
|
Binary file
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {UploadSourceMapsRequest} from "../../proto-models/com/coralogix/rum/v2/rum_source_map_service";
|
|
2
|
-
import {traverseFolder} from "./utils/traverse-folder.util";
|
|
3
|
-
import {RumApi} from "../../api/rum-api";
|
|
4
|
-
import {GRAY_COLOR, GREEN_COLOR, RED_COLOR} from "../../cli/theme";
|
|
5
|
-
|
|
6
|
-
export class SourceMapsService {
|
|
7
|
-
static async upload(application: string, releaseId: string, repoName: string, commitHash: string, orgName: string, folderPath: string, env: string, privateKey: string): Promise<void> {
|
|
8
|
-
const request = UploadSourceMapsRequest.create();
|
|
9
|
-
|
|
10
|
-
request.application = application;
|
|
11
|
-
request.releaseId = releaseId;
|
|
12
|
-
request.repoName = repoName;
|
|
13
|
-
request.commitHash = commitHash;
|
|
14
|
-
request.user = orgName;
|
|
15
|
-
|
|
16
|
-
console.log(GRAY_COLOR, '🚀 Uploading source maps...');
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
await traverseFolder(folderPath, request);
|
|
20
|
-
|
|
21
|
-
await RumApi.uploadSourceMaps(request, env, privateKey);
|
|
22
|
-
|
|
23
|
-
console.log(GREEN_COLOR, '✅ Source maps uploaded successfully!');
|
|
24
|
-
console.log(GREEN_COLOR, `✅ Total chunk files processed: ${request.files.length}`);
|
|
25
|
-
console.log(GREEN_COLOR, '✅ Processing complete.');
|
|
26
|
-
} catch (error) {
|
|
27
|
-
console.log(RED_COLOR, '❌ An error occurred');
|
|
28
|
-
console.error(RED_COLOR, error);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {Dirent, promises as fsPromises} from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import {UploadSourceMapsRequest} from "../../../proto-models/com/coralogix/rum/v2/rum_source_map_service";
|
|
4
|
-
import {FileMetadata} from "../../../proto-models/com/coralogix/rum/v2/file";
|
|
5
|
-
|
|
6
|
-
const {readdir, stat, readFile} = fsPromises;
|
|
7
|
-
|
|
8
|
-
export const traverseFolder = async (folderPath: string, request: UploadSourceMapsRequest): Promise<void> => {
|
|
9
|
-
const stack: string[] = [folderPath];
|
|
10
|
-
|
|
11
|
-
while (stack.length) {
|
|
12
|
-
const currentPath = stack.pop();
|
|
13
|
-
const entries: Dirent[] = await readdir(currentPath!, {withFileTypes: true});
|
|
14
|
-
|
|
15
|
-
await Promise.all(entries.map(async (file: Dirent) => {
|
|
16
|
-
const {name} = file;
|
|
17
|
-
const entryPath = path.join(currentPath as string, name);
|
|
18
|
-
const isDotMapFile = file.isFile() && name.endsWith('.js.map');
|
|
19
|
-
|
|
20
|
-
if (file.isDirectory()) stack.push(entryPath);
|
|
21
|
-
|
|
22
|
-
else if (isDotMapFile) request.files.push(await getFileMetadata(entryPath));
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const getFileMetadata = async (filePath: string): Promise<FileMetadata> => {
|
|
28
|
-
const {size} = await stat(filePath);
|
|
29
|
-
const {name} = path.parse(filePath);
|
|
30
|
-
const content = await readFile(filePath);
|
|
31
|
-
|
|
32
|
-
return {chunkName: name, size, content};
|
|
33
|
-
}
|
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"downlevelIteration": true,
|
|
4
|
-
"strict": true,
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"forceConsistentCasingInFileNames": true,
|
|
7
|
-
"module": "commonjs",
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"target": "es6",
|
|
10
|
-
"noImplicitAny": true,
|
|
11
|
-
"moduleResolution": "node",
|
|
12
|
-
"allowSyntheticDefaultImports": true,
|
|
13
|
-
"experimentalDecorators": true,
|
|
14
|
-
"declaration": true,
|
|
15
|
-
"inlineSourceMap": true,
|
|
16
|
-
"inlineSources": true,
|
|
17
|
-
"outDir": "dist",
|
|
18
|
-
"baseUrl": ".",
|
|
19
|
-
"paths": {
|
|
20
|
-
"*": [
|
|
21
|
-
"node_modules/*"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|