airbyte-faros-destination 0.19.57-rc5 → 0.19.57-rc7
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/lib/converters/azure-tfvc/changesets.d.ts +1 -5
- package/lib/converters/azure-tfvc/changesets.js +32 -60
- package/lib/converters/azure-tfvc/changesets.js.map +1 -1
- package/lib/converters/azure-tfvc/common.d.ts +1 -5
- package/lib/converters/azure-tfvc/common.js +0 -4
- package/lib/converters/azure-tfvc/common.js.map +1 -1
- package/lib/converters/cursor/agent_edits.d.ts +8 -0
- package/lib/converters/cursor/agent_edits.js +59 -0
- package/lib/converters/cursor/agent_edits.js.map +1 -0
- package/lib/converters/cursor/ask_mode_adoption.d.ts +8 -0
- package/lib/converters/cursor/ask_mode_adoption.js +47 -0
- package/lib/converters/cursor/ask_mode_adoption.js.map +1 -0
- package/lib/converters/cursor/client_versions.d.ts +8 -0
- package/lib/converters/cursor/client_versions.js +42 -0
- package/lib/converters/cursor/client_versions.js.map +1 -0
- package/lib/converters/cursor/commands_adoption.d.ts +8 -0
- package/lib/converters/cursor/commands_adoption.js +47 -0
- package/lib/converters/cursor/commands_adoption.js.map +1 -0
- package/lib/converters/cursor/common.d.ts +20 -2
- package/lib/converters/cursor/common.js +25 -4
- package/lib/converters/cursor/common.js.map +1 -1
- package/lib/converters/cursor/daily_active_users.d.ts +8 -0
- package/lib/converters/cursor/daily_active_users.js +67 -0
- package/lib/converters/cursor/daily_active_users.js.map +1 -0
- package/lib/converters/cursor/daily_usage.js +1 -1
- package/lib/converters/cursor/daily_usage.js.map +1 -1
- package/lib/converters/cursor/mcp_adoption.d.ts +8 -0
- package/lib/converters/cursor/mcp_adoption.js +47 -0
- package/lib/converters/cursor/mcp_adoption.js.map +1 -0
- package/lib/converters/cursor/model_usage.d.ts +8 -0
- package/lib/converters/cursor/model_usage.js +51 -0
- package/lib/converters/cursor/model_usage.js.map +1 -0
- package/lib/converters/cursor/plans_adoption.d.ts +8 -0
- package/lib/converters/cursor/plans_adoption.js +47 -0
- package/lib/converters/cursor/plans_adoption.js.map +1 -0
- package/lib/converters/cursor/tab_usage.d.ts +8 -0
- package/lib/converters/cursor/tab_usage.js +59 -0
- package/lib/converters/cursor/tab_usage.js.map +1 -0
- package/lib/converters/cursor/top_file_extensions.d.ts +8 -0
- package/lib/converters/cursor/top_file_extensions.js +57 -0
- package/lib/converters/cursor/top_file_extensions.js.map +1 -0
- package/lib/converters/harness/common.d.ts +6 -88
- package/lib/converters/harness/common.js +2 -2
- package/lib/converters/harness/common.js.map +1 -1
- package/lib/converters/harness/executions.d.ts +6 -7
- package/lib/converters/harness/executions.js +143 -170
- package/lib/converters/harness/executions.js.map +1 -1
- package/lib/converters/harness/organizations.d.ts +7 -0
- package/lib/converters/harness/organizations.js +29 -0
- package/lib/converters/harness/organizations.js.map +1 -0
- package/lib/converters/harness/pipelines.d.ts +7 -0
- package/lib/converters/harness/pipelines.js +29 -0
- package/lib/converters/harness/pipelines.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/resources/source-specific-configs/spec.json +0 -3
- package/resources/source-specific-configs/azure-tfvc.json +0 -26
|
@@ -4,17 +4,13 @@ import { AzureTfvcConverter } from './common';
|
|
|
4
4
|
export declare class Changesets extends AzureTfvcConverter {
|
|
5
5
|
private readonly branchCollector;
|
|
6
6
|
private readonly fileCollector;
|
|
7
|
-
private readonly mergeReferences;
|
|
8
|
-
private trackedChangesets;
|
|
9
7
|
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
10
8
|
id(record: AirbyteRecord): number;
|
|
11
9
|
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
12
10
|
private getDiffStats;
|
|
13
11
|
private processChanges;
|
|
12
|
+
private getMergedChangesetIds;
|
|
14
13
|
private createBranchAssociations;
|
|
15
14
|
private createTaskAssociations;
|
|
16
|
-
private getTrackedChangesets;
|
|
17
|
-
private collectMergeReferences;
|
|
18
15
|
onProcessingComplete(ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
19
|
-
private logMergeReferences;
|
|
20
16
|
}
|
|
@@ -10,7 +10,6 @@ class Changesets extends common_1.AzureTfvcConverter {
|
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.branchCollector = new vcs_1.BranchCollector();
|
|
12
12
|
this.fileCollector = new vcs_1.FileCollector();
|
|
13
|
-
this.mergeReferences = new Map();
|
|
14
13
|
this.destinationModels = [
|
|
15
14
|
'tms_TaskCommitAssociation',
|
|
16
15
|
'vcs_Branch',
|
|
@@ -54,9 +53,8 @@ class Changesets extends common_1.AzureTfvcConverter {
|
|
|
54
53
|
diffStats: this.getDiffStats(changeset),
|
|
55
54
|
},
|
|
56
55
|
};
|
|
57
|
-
const commitFiles = this.processChanges(commit, repository, changeset.changes);
|
|
58
|
-
this.
|
|
59
|
-
const branchAssociations = this.createBranchAssociations(commit, repository, changeset.branch, faros_js_client_1.Utils.toDate(changeset.createdDate));
|
|
56
|
+
const { commitFiles, mergedChangesetIds } = this.processChanges(commit, repository, changeset.changes);
|
|
57
|
+
const branchAssociations = this.createBranchAssociations(commit, repository, mergedChangesetIds, changeset.branch, faros_js_client_1.Utils.toDate(changeset.createdDate));
|
|
60
58
|
const taskAssociations = this.createTaskAssociations(commit, changeset.workItems);
|
|
61
59
|
return [
|
|
62
60
|
commitRecord,
|
|
@@ -80,6 +78,7 @@ class Changesets extends common_1.AzureTfvcConverter {
|
|
|
80
78
|
processChanges(commit, repository, changes) {
|
|
81
79
|
var _a;
|
|
82
80
|
const commitFiles = [];
|
|
81
|
+
const mergedIds = [];
|
|
83
82
|
for (const change of changes !== null && changes !== void 0 ? changes : []) {
|
|
84
83
|
if ((_a = change.item) === null || _a === void 0 ? void 0 : _a.path) {
|
|
85
84
|
const filePath = change.item.path;
|
|
@@ -94,24 +93,47 @@ class Changesets extends common_1.AzureTfvcConverter {
|
|
|
94
93
|
},
|
|
95
94
|
});
|
|
96
95
|
}
|
|
96
|
+
mergedIds.push(...this.getMergedChangesetIds(change));
|
|
97
97
|
}
|
|
98
|
-
return commitFiles;
|
|
98
|
+
return { commitFiles, mergedChangesetIds: new Set(mergedIds) };
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
getMergedChangesetIds(change) {
|
|
101
|
+
var _a, _b;
|
|
102
|
+
const ids = [];
|
|
103
|
+
for (const mergeSource of (_a = change.mergeSources) !== null && _a !== void 0 ? _a : []) {
|
|
104
|
+
if (mergeSource.isRename) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const from = mergeSource.versionFrom;
|
|
108
|
+
const to = (_b = mergeSource.versionTo) !== null && _b !== void 0 ? _b : from;
|
|
109
|
+
if (from && to) {
|
|
110
|
+
ids.push(...Array.from({ length: to - from + 1 }, (_, i) => from + i));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return ids;
|
|
114
|
+
}
|
|
115
|
+
createBranchAssociations(commit, repository, mergedChangesetIds, branchName, committedAt) {
|
|
101
116
|
const branch = this.branchCollector.collectBranch(branchName, repository);
|
|
102
117
|
if (!branch) {
|
|
103
118
|
return [];
|
|
104
119
|
}
|
|
105
|
-
|
|
120
|
+
const records = [
|
|
106
121
|
{
|
|
122
|
+
model: 'vcs_BranchCommitAssociation',
|
|
123
|
+
record: { commit, branch, committedAt },
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
for (const mergedId of mergedChangesetIds) {
|
|
127
|
+
records.push({
|
|
107
128
|
model: 'vcs_BranchCommitAssociation',
|
|
108
129
|
record: {
|
|
109
|
-
commit,
|
|
130
|
+
commit: { sha: String(mergedId), repository },
|
|
110
131
|
branch,
|
|
111
132
|
committedAt,
|
|
112
133
|
},
|
|
113
|
-
}
|
|
114
|
-
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return records;
|
|
115
137
|
}
|
|
116
138
|
createTaskAssociations(commit, workItems) {
|
|
117
139
|
const records = [];
|
|
@@ -128,62 +150,12 @@ class Changesets extends common_1.AzureTfvcConverter {
|
|
|
128
150
|
}
|
|
129
151
|
return records;
|
|
130
152
|
}
|
|
131
|
-
getTrackedChangesets(ctx) {
|
|
132
|
-
var _a;
|
|
133
|
-
if (!this.trackedChangesets) {
|
|
134
|
-
const trackList = (_a = this.azureTfvcConfig(ctx).track_changesets) !== null && _a !== void 0 ? _a : [];
|
|
135
|
-
this.trackedChangesets = new Set(trackList);
|
|
136
|
-
}
|
|
137
|
-
return this.trackedChangesets;
|
|
138
|
-
}
|
|
139
|
-
collectMergeReferences(ctx, changesetId, branch, createdDate, changes) {
|
|
140
|
-
var _a, _b;
|
|
141
|
-
const tracked = this.getTrackedChangesets(ctx);
|
|
142
|
-
if (tracked.size === 0) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
for (const change of changes !== null && changes !== void 0 ? changes : []) {
|
|
146
|
-
for (const mergeSource of (_a = change.mergeSources) !== null && _a !== void 0 ? _a : []) {
|
|
147
|
-
if (mergeSource.isRename) {
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
const from = mergeSource.versionFrom;
|
|
151
|
-
const to = (_b = mergeSource.versionTo) !== null && _b !== void 0 ? _b : from;
|
|
152
|
-
for (const trackedId of tracked) {
|
|
153
|
-
if (from && to && trackedId >= from && trackedId <= to) {
|
|
154
|
-
if (!this.mergeReferences.has(trackedId)) {
|
|
155
|
-
this.mergeReferences.set(trackedId, []);
|
|
156
|
-
}
|
|
157
|
-
this.mergeReferences.get(trackedId).push({
|
|
158
|
-
referencedBy: changesetId,
|
|
159
|
-
branch,
|
|
160
|
-
date: createdDate,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
153
|
async onProcessingComplete(ctx) {
|
|
168
|
-
this.logMergeReferences(ctx);
|
|
169
154
|
return [
|
|
170
155
|
...this.branchCollector.convertBranches(),
|
|
171
156
|
...this.fileCollector.convertFiles(),
|
|
172
157
|
];
|
|
173
158
|
}
|
|
174
|
-
logMergeReferences(ctx) {
|
|
175
|
-
var _a, _b, _c;
|
|
176
|
-
if (this.mergeReferences.size === 0) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
for (const [tracked, references] of this.mergeReferences) {
|
|
180
|
-
ctx.logger.info(`=== Merge references for tracked changeset ${tracked} ===`);
|
|
181
|
-
for (const ref of references) {
|
|
182
|
-
ctx.logger.info(` Changeset ${ref.referencedBy} | Branch: ${(_a = ref.branch) !== null && _a !== void 0 ? _a : 'unknown'} | Date: ${(_c = (_b = ref.date) === null || _b === void 0 ? void 0 : _b.toISOString()) !== null && _c !== void 0 ? _c : 'unknown'}`);
|
|
183
|
-
}
|
|
184
|
-
ctx.logger.info(` Total: ${references.length} references`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
159
|
}
|
|
188
160
|
exports.Changesets = Changesets;
|
|
189
161
|
//# sourceMappingURL=changesets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changesets.js","sourceRoot":"","sources":["../../../src/converters/azure-tfvc/changesets.ts"],"names":[],"mappings":";;;AACA,oEAA+E;AAE/E,qDAAsC;AAEtC,uCAOuB;AAEvB,qCAAoE;
|
|
1
|
+
{"version":3,"file":"changesets.js","sourceRoot":"","sources":["../../../src/converters/azure-tfvc/changesets.ts"],"names":[],"mappings":";;;AACA,oEAA+E;AAE/E,qDAAsC;AAEtC,uCAOuB;AAEvB,qCAAoE;AAOpE,MAAa,UAAW,SAAQ,2BAAkB;IAAlD;;QACmB,oBAAe,GAAG,IAAI,qBAAe,EAAE,CAAC;QACxC,kBAAa,GAAG,IAAI,mBAAa,EAAE,CAAC;QAE5C,sBAAiB,GAAoC;YAC5D,2BAA2B;YAC3B,YAAY;YACZ,6BAA6B;YAC7B,YAAY;YACZ,gBAAgB;YAChB,UAAU;SACX,CAAC;IA8LJ,CAAC;IA5LC,EAAE,CAAC,M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CAAC,oBAAoB,CACxB,GAAkB;QAElB,OAAO;YACL,GAAG,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE;YACzC,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE;SACrC,CAAC;IACJ,CAAC;CACF;AAzMD,gCAyMC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
2
|
import { OrgKey } from '../common/vcs';
|
|
3
|
-
import { Converter
|
|
3
|
+
import { Converter } from '../converter';
|
|
4
4
|
export declare const MAX_DESCRIPTION_LENGTH = 1000;
|
|
5
|
-
export interface AzureTfvcConfig {
|
|
6
|
-
track_changesets?: number[];
|
|
7
|
-
}
|
|
8
5
|
/** Azure TFVC converter base */
|
|
9
6
|
export declare abstract class AzureTfvcConverter extends Converter {
|
|
10
7
|
source: string;
|
|
11
|
-
protected azureTfvcConfig(ctx: StreamContext): AzureTfvcConfig;
|
|
12
8
|
id(record: AirbyteRecord): any;
|
|
13
9
|
private static readonly _uidsFromUsersStream;
|
|
14
10
|
get uidsFromUsersStream(): Set<string>;
|
|
@@ -9,10 +9,6 @@ class AzureTfvcConverter extends converter_1.Converter {
|
|
|
9
9
|
super(...arguments);
|
|
10
10
|
this.source = 'Azure-TFVC';
|
|
11
11
|
}
|
|
12
|
-
azureTfvcConfig(ctx) {
|
|
13
|
-
var _a, _b, _c;
|
|
14
|
-
return (_c = (_b = (_a = ctx.config) === null || _a === void 0 ? void 0 : _a.source_specific_configs) === null || _b === void 0 ? void 0 : _b['azure-tfvc']) !== null && _c !== void 0 ? _c : {};
|
|
15
|
-
}
|
|
16
12
|
id(record) {
|
|
17
13
|
var _a, _b;
|
|
18
14
|
return (_b = (_a = record === null || record === void 0 ? void 0 : record.record) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/azure-tfvc/common.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/azure-tfvc/common.ts"],"names":[],"mappings":";;;AAGA,4CAAuC;AAE1B,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C,gCAAgC;AAChC,MAAsB,kBAAmB,SAAQ,qBAAS;IAA1D;;QACE,WAAM,GAAG,YAAY,CAAC;IAiBxB,CAAC;IAfC,EAAE,CAAC,MAAqB;;QACtB,OAAO,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,EAAE,CAAC;IAClC,CAAC;IAMD,IAAW,mBAAmB;QAC5B,OAAO,kBAAkB,CAAC,oBAAoB,CAAC;IACjD,CAAC;IAED,SAAS,CAAC,IAAY;QACpB,OAAO,EAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC;IACxD,CAAC;;AAjBH,gDAkBC;AAXC,8EAA8E;AAC9E,4EAA4E;AAC5E,gBAAgB;AACQ,uCAAoB,GAAgB,IAAI,GAAG,EAAE,AAAzB,CAA0B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { CursorConverter } from './common';
|
|
4
|
+
export declare class AgentEdits extends CursorConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
id(record: AirbyteRecord): string;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentEdits = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const vcs_1 = require("../common/vcs");
|
|
7
|
+
const common_1 = require("./common");
|
|
8
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
9
|
+
const AgentEditsFieldToMetricType = {
|
|
10
|
+
total_accepted_diffs: vcs_1.AssistantMetric.SuggestionsAccepted,
|
|
11
|
+
total_rejected_diffs: vcs_1.AssistantMetric.SuggestionsDiscarded,
|
|
12
|
+
total_green_lines_suggested: vcs_1.AssistantMetric.LinesSuggestedToAdd,
|
|
13
|
+
total_green_lines_accepted: vcs_1.AssistantMetric.AILinesAdded,
|
|
14
|
+
total_red_lines_suggested: vcs_1.AssistantMetric.LinesSuggestedToRemove,
|
|
15
|
+
total_red_lines_accepted: vcs_1.AssistantMetric.AILinesRemoved,
|
|
16
|
+
};
|
|
17
|
+
class AgentEdits extends common_1.CursorConverter {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.destinationModels = [
|
|
21
|
+
'vcs_AssistantMetric',
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
id(record) {
|
|
25
|
+
const item = record.record.data;
|
|
26
|
+
return item.event_date;
|
|
27
|
+
}
|
|
28
|
+
async convert(record, ctx) {
|
|
29
|
+
const item = record.record.data;
|
|
30
|
+
if (!item.email) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
const day = faros_js_client_1.Utils.toDate(item.event_date);
|
|
34
|
+
const organization = {
|
|
35
|
+
uid: this.streamName.source,
|
|
36
|
+
source: this.streamName.source,
|
|
37
|
+
};
|
|
38
|
+
const res = [];
|
|
39
|
+
for (const [field, metricType] of Object.entries(AgentEditsFieldToMetricType)) {
|
|
40
|
+
const value = item[field];
|
|
41
|
+
if ((0, lodash_1.isNil)(value) || value <= 0) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
res.push(...this.getAssistantMetric({
|
|
45
|
+
startedAt: day,
|
|
46
|
+
endedAt: faros_js_client_1.Utils.toDate(day.getTime() + DAY_MS),
|
|
47
|
+
assistantMetricType: metricType,
|
|
48
|
+
assistantMetricTypeDetail: common_1.CursorStream.AgentEdits,
|
|
49
|
+
value,
|
|
50
|
+
organization,
|
|
51
|
+
userEmail: item.email,
|
|
52
|
+
feature: common_1.Feature.Agent,
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
return res;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.AgentEdits = AgentEdits;
|
|
59
|
+
//# sourceMappingURL=agent_edits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent_edits.js","sourceRoot":"","sources":["../../../src/converters/cursor/agent_edits.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AACtC,mCAA6B;AAE7B,uCAA8C;AAE9C,qCAAgE;AAEhE,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,MAAM,2BAA2B,GAE7B;IACF,oBAAoB,EAAE,qBAAe,CAAC,mBAAmB;IACzD,oBAAoB,EAAE,qBAAe,CAAC,oBAAoB;IAC1D,2BAA2B,EAAE,qBAAe,CAAC,mBAAmB;IAChE,0BAA0B,EAAE,qBAAe,CAAC,YAAY;IACxD,yBAAyB,EAAE,qBAAe,CAAC,sBAAsB;IACjE,wBAAwB,EAAE,qBAAe,CAAC,cAAc;CACzD,CAAC;AAEF,MAAa,UAAW,SAAQ,wBAAe;IAA/C;;QACW,sBAAiB,GAAoC;YAC5D,qBAAqB;SACtB,CAAC;IAgDJ,CAAC;IA9CC,EAAE,CAAC,MAAqB;QACtB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAsB,CAAC;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;QAElB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAsB,CAAC;QAElD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,GAAG,GAAG,uBAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG;YACnB,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;YAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;SAC/B,CAAC;QAEF,MAAM,GAAG,GAAwB,EAAE,CAAC;QAEpC,KAAK,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAC9C,2BAA2B,CAC5B,EAAE,CAAC;YACF,MAAM,KAAK,GAAG,IAAI,CAAC,KAA6B,CAAW,CAAC;YAC5D,IAAI,IAAA,cAAK,EAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;gBAC/B,SAAS;YACX,CAAC;YACD,GAAG,CAAC,IAAI,CACN,GAAG,IAAI,CAAC,kBAAkB,CAAC;gBACzB,SAAS,EAAE,GAAG;gBACd,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC;gBAC7C,mBAAmB,EAAE,UAAU;gBAC/B,yBAAyB,EAAE,qBAAY,CAAC,UAAU;gBAClD,KAAK;gBACL,YAAY;gBACZ,SAAS,EAAE,IAAI,CAAC,KAAK;gBACrB,OAAO,EAAE,gBAAO,CAAC,KAAK;aACvB,CAAC,CACH,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAnDD,gCAmDC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { CursorConverter } from './common';
|
|
4
|
+
export declare class AskModeAdoption extends CursorConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
id(record: AirbyteRecord): string;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AskModeAdoption = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const vcs_1 = require("../common/vcs");
|
|
7
|
+
const common_1 = require("./common");
|
|
8
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
9
|
+
class AskModeAdoption extends common_1.CursorConverter {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.destinationModels = [
|
|
13
|
+
'vcs_AssistantMetric',
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
id(record) {
|
|
17
|
+
const item = record.record.data;
|
|
18
|
+
return `${item.event_date}__${item.model}`;
|
|
19
|
+
}
|
|
20
|
+
async convert(record, ctx) {
|
|
21
|
+
const item = record.record.data;
|
|
22
|
+
if (!item.email) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
if ((0, lodash_1.isNil)(item.usage) || item.usage <= 0) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
const day = faros_js_client_1.Utils.toDate(item.event_date);
|
|
29
|
+
const organization = {
|
|
30
|
+
uid: this.streamName.source,
|
|
31
|
+
source: this.streamName.source,
|
|
32
|
+
};
|
|
33
|
+
return this.getAssistantMetric({
|
|
34
|
+
startedAt: day,
|
|
35
|
+
endedAt: faros_js_client_1.Utils.toDate(day.getTime() + DAY_MS),
|
|
36
|
+
assistantMetricType: vcs_1.AssistantMetric.Usages,
|
|
37
|
+
assistantMetricTypeDetail: common_1.CursorStream.AskModeAdoption,
|
|
38
|
+
value: item.usage,
|
|
39
|
+
organization,
|
|
40
|
+
userEmail: item.email,
|
|
41
|
+
feature: common_1.Feature.Ask,
|
|
42
|
+
model: item.model,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.AskModeAdoption = AskModeAdoption;
|
|
47
|
+
//# sourceMappingURL=ask_mode_adoption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask_mode_adoption.js","sourceRoot":"","sources":["../../../src/converters/cursor/ask_mode_adoption.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AACtC,mCAA6B;AAE7B,uCAA8C;AAE9C,qCAAgE;AAEhE,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,MAAa,eAAgB,SAAQ,wBAAe;IAApD;;QACW,sBAAiB,GAAoC;YAC5D,qBAAqB;SACtB,CAAC;IAuCJ,CAAC;IArCC,EAAE,CAAC,MAAqB;QACtB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAA2B,CAAC;QACvD,OAAO,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;QAElB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAA2B,CAAC;QAEvD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,IAAA,cAAK,EAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,GAAG,GAAG,uBAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG;YACnB,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;YAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;SAC/B,CAAC;QAEF,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC7B,SAAS,EAAE,GAAG;YACd,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC;YAC7C,mBAAmB,EAAE,qBAAe,CAAC,MAAM;YAC3C,yBAAyB,EAAE,qBAAY,CAAC,eAAe;YACvD,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY;YACZ,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,OAAO,EAAE,gBAAO,CAAC,GAAG;YACpB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CACF;AA1CD,0CA0CC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { CursorConverter } from './common';
|
|
4
|
+
export declare class ClientVersions extends CursorConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
id(record: AirbyteRecord): string;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientVersions = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const vcs_1 = require("../common/vcs");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
8
|
+
class ClientVersions extends common_1.CursorConverter {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.destinationModels = [
|
|
12
|
+
'vcs_AssistantMetric',
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
id(record) {
|
|
16
|
+
const item = record.record.data;
|
|
17
|
+
return `${item.event_date}__${item.client_version}`;
|
|
18
|
+
}
|
|
19
|
+
async convert(record, ctx) {
|
|
20
|
+
const item = record.record.data;
|
|
21
|
+
if (!item.email || !item.client_version) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
const day = faros_js_client_1.Utils.toDate(item.event_date);
|
|
25
|
+
const organization = {
|
|
26
|
+
uid: this.streamName.source,
|
|
27
|
+
source: this.streamName.source,
|
|
28
|
+
};
|
|
29
|
+
return this.getAssistantMetric({
|
|
30
|
+
startedAt: day,
|
|
31
|
+
endedAt: faros_js_client_1.Utils.toDate(day.getTime() + DAY_MS),
|
|
32
|
+
assistantMetricType: vcs_1.AssistantMetric.Engagement,
|
|
33
|
+
assistantMetricTypeDetail: common_1.CursorStream.ClientVersions,
|
|
34
|
+
value: true,
|
|
35
|
+
organization,
|
|
36
|
+
userEmail: item.email,
|
|
37
|
+
editor: item.client_version,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.ClientVersions = ClientVersions;
|
|
42
|
+
//# sourceMappingURL=client_versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client_versions.js","sourceRoot":"","sources":["../../../src/converters/cursor/client_versions.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AAEtC,uCAA8C;AAE9C,qCAAuD;AAEvD,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,MAAa,cAAe,SAAQ,wBAAe;IAAnD;;QACW,sBAAiB,GAAoC;YAC5D,qBAAqB;SACtB,CAAC;IAkCJ,CAAC;IAhCC,EAAE,CAAC,MAAqB;QACtB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAA0B,CAAC;QACtD,OAAO,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;QAElB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAA0B,CAAC;QAEtD,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,GAAG,GAAG,uBAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG;YACnB,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;YAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;SAC/B,CAAC;QAEF,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC7B,SAAS,EAAE,GAAG;YACd,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC;YAC7C,mBAAmB,EAAE,qBAAe,CAAC,UAAU;YAC/C,yBAAyB,EAAE,qBAAY,CAAC,cAAc;YACtD,KAAK,EAAE,IAAI;YACX,YAAY;YACZ,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,MAAM,EAAE,IAAI,CAAC,cAAc;SAC5B,CAAC,CAAC;IACL,CAAC;CACF;AArCD,wCAqCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { CursorConverter } from './common';
|
|
4
|
+
export declare class CommandsAdoption extends CursorConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
id(record: AirbyteRecord): string;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandsAdoption = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const vcs_1 = require("../common/vcs");
|
|
7
|
+
const common_1 = require("./common");
|
|
8
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
9
|
+
class CommandsAdoption extends common_1.CursorConverter {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.destinationModels = [
|
|
13
|
+
'vcs_AssistantMetric',
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
id(record) {
|
|
17
|
+
const item = record.record.data;
|
|
18
|
+
return `${item.event_date}__${item.command_name}`;
|
|
19
|
+
}
|
|
20
|
+
async convert(record, ctx) {
|
|
21
|
+
const item = record.record.data;
|
|
22
|
+
if (!item.email) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
if ((0, lodash_1.isNil)(item.usage) || item.usage <= 0) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
const day = faros_js_client_1.Utils.toDate(item.event_date);
|
|
29
|
+
const organization = {
|
|
30
|
+
uid: this.streamName.source,
|
|
31
|
+
source: this.streamName.source,
|
|
32
|
+
};
|
|
33
|
+
const feature = `Command:${item.command_name}`;
|
|
34
|
+
return this.getAssistantMetric({
|
|
35
|
+
startedAt: day,
|
|
36
|
+
endedAt: faros_js_client_1.Utils.toDate(day.getTime() + DAY_MS),
|
|
37
|
+
assistantMetricType: vcs_1.AssistantMetric.Usages,
|
|
38
|
+
assistantMetricTypeDetail: common_1.CursorStream.CommandsAdoption,
|
|
39
|
+
value: item.usage,
|
|
40
|
+
organization,
|
|
41
|
+
userEmail: item.email,
|
|
42
|
+
feature,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.CommandsAdoption = CommandsAdoption;
|
|
47
|
+
//# sourceMappingURL=commands_adoption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands_adoption.js","sourceRoot":"","sources":["../../../src/converters/cursor/commands_adoption.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AACtC,mCAA6B;AAE7B,uCAA8C;AAE9C,qCAAuD;AAEvD,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,MAAa,gBAAiB,SAAQ,wBAAe;IAArD;;QACW,sBAAiB,GAAoC;YAC5D,qBAAqB;SACtB,CAAC;IAwCJ,CAAC;IAtCC,EAAE,CAAC,MAAqB;QACtB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAA4B,CAAC;QACxD,OAAO,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;QAElB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAA4B,CAAC;QAExD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,IAAA,cAAK,EAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,GAAG,GAAG,uBAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG;YACnB,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;YAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;SAC/B,CAAC;QAEF,MAAM,OAAO,GAAG,WAAW,IAAI,CAAC,YAAY,EAAE,CAAC;QAE/C,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC7B,SAAS,EAAE,GAAG;YACd,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC;YAC7C,mBAAmB,EAAE,qBAAe,CAAC,MAAM;YAC3C,yBAAyB,EAAE,qBAAY,CAAC,gBAAgB;YACxD,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY;YACZ,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AA3CD,4CA2CC"}
|
|
@@ -9,13 +9,15 @@ export interface AssistantMetricConfig {
|
|
|
9
9
|
startedAt: Date;
|
|
10
10
|
endedAt: Date;
|
|
11
11
|
assistantMetricType: string;
|
|
12
|
+
assistantMetricTypeDetail?: string;
|
|
12
13
|
value: number | string | boolean;
|
|
13
14
|
organization: OrgKey;
|
|
14
15
|
userEmail: string;
|
|
15
|
-
customMetricName?: keyof DailyUsageItem;
|
|
16
16
|
model?: string;
|
|
17
17
|
feature?: string;
|
|
18
18
|
repository?: RepoKey;
|
|
19
|
+
editor?: string;
|
|
20
|
+
language?: string;
|
|
19
21
|
}
|
|
20
22
|
export declare enum Feature {
|
|
21
23
|
Tab = "Tab",
|
|
@@ -23,7 +25,23 @@ export declare enum Feature {
|
|
|
23
25
|
Chat = "Chat",
|
|
24
26
|
Agent = "Agent",
|
|
25
27
|
CmdK = "Cmd+K",
|
|
26
|
-
BugBot = "BugBot"
|
|
28
|
+
BugBot = "BugBot",
|
|
29
|
+
CLI = "CLI",
|
|
30
|
+
CloudAgent = "CloudAgent",
|
|
31
|
+
Ask = "Ask",
|
|
32
|
+
Plan = "Plan"
|
|
33
|
+
}
|
|
34
|
+
export declare enum CursorStream {
|
|
35
|
+
AgentEdits = "agent_edits",
|
|
36
|
+
TabUsage = "tab_usage",
|
|
37
|
+
DailyActiveUsers = "daily_active_users",
|
|
38
|
+
ModelUsage = "model_usage",
|
|
39
|
+
ClientVersions = "client_versions",
|
|
40
|
+
McpAdoption = "mcp_adoption",
|
|
41
|
+
CommandsAdoption = "commands_adoption",
|
|
42
|
+
PlansAdoption = "plans_adoption",
|
|
43
|
+
AskModeAdoption = "ask_mode_adoption",
|
|
44
|
+
TopFileExtensions = "top_file_extensions"
|
|
27
45
|
}
|
|
28
46
|
export declare abstract class CursorConverter extends Converter {
|
|
29
47
|
source: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CursorConverter = exports.Feature = void 0;
|
|
3
|
+
exports.CursorConverter = exports.CursorStream = exports.Feature = void 0;
|
|
4
4
|
const common_1 = require("faros-airbyte-common/common");
|
|
5
5
|
const lodash_1 = require("lodash");
|
|
6
6
|
const vcs_1 = require("../common/vcs");
|
|
@@ -13,7 +13,24 @@ var Feature;
|
|
|
13
13
|
Feature["Agent"] = "Agent";
|
|
14
14
|
Feature["CmdK"] = "Cmd+K";
|
|
15
15
|
Feature["BugBot"] = "BugBot";
|
|
16
|
+
Feature["CLI"] = "CLI";
|
|
17
|
+
Feature["CloudAgent"] = "CloudAgent";
|
|
18
|
+
Feature["Ask"] = "Ask";
|
|
19
|
+
Feature["Plan"] = "Plan";
|
|
16
20
|
})(Feature || (exports.Feature = Feature = {}));
|
|
21
|
+
var CursorStream;
|
|
22
|
+
(function (CursorStream) {
|
|
23
|
+
CursorStream["AgentEdits"] = "agent_edits";
|
|
24
|
+
CursorStream["TabUsage"] = "tab_usage";
|
|
25
|
+
CursorStream["DailyActiveUsers"] = "daily_active_users";
|
|
26
|
+
CursorStream["ModelUsage"] = "model_usage";
|
|
27
|
+
CursorStream["ClientVersions"] = "client_versions";
|
|
28
|
+
CursorStream["McpAdoption"] = "mcp_adoption";
|
|
29
|
+
CursorStream["CommandsAdoption"] = "commands_adoption";
|
|
30
|
+
CursorStream["PlansAdoption"] = "plans_adoption";
|
|
31
|
+
CursorStream["AskModeAdoption"] = "ask_mode_adoption";
|
|
32
|
+
CursorStream["TopFileExtensions"] = "top_file_extensions";
|
|
33
|
+
})(CursorStream || (exports.CursorStream = CursorStream = {}));
|
|
17
34
|
class CursorConverter extends converter_1.Converter {
|
|
18
35
|
constructor() {
|
|
19
36
|
super(...arguments);
|
|
@@ -28,7 +45,7 @@ class CursorConverter extends converter_1.Converter {
|
|
|
28
45
|
return (_c = (_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.config) === null || _a === void 0 ? void 0 : _a.source_specific_configs) === null || _b === void 0 ? void 0 : _b.cursor) !== null && _c !== void 0 ? _c : {};
|
|
29
46
|
}
|
|
30
47
|
getAssistantMetric(config) {
|
|
31
|
-
const { startedAt, endedAt, assistantMetricType, value, organization, userEmail,
|
|
48
|
+
const { startedAt, endedAt, assistantMetricType, assistantMetricTypeDetail, value, organization, userEmail, model, feature, repository, editor, language, } = config;
|
|
32
49
|
return [
|
|
33
50
|
{
|
|
34
51
|
model: 'vcs_AssistantMetric',
|
|
@@ -42,13 +59,15 @@ class CursorConverter extends converter_1.Converter {
|
|
|
42
59
|
startedAt.toISOString(),
|
|
43
60
|
organization.uid,
|
|
44
61
|
userEmail,
|
|
45
|
-
|
|
62
|
+
assistantMetricTypeDetail,
|
|
46
63
|
],
|
|
47
64
|
// newer fields (optional) to be included in the digest
|
|
48
65
|
...[
|
|
49
66
|
{ key: 'model', value: model },
|
|
50
67
|
{ key: 'feature', value: feature },
|
|
51
68
|
{ key: 'repository', value: repository === null || repository === void 0 ? void 0 : repository.uid },
|
|
69
|
+
{ key: 'editor', value: editor },
|
|
70
|
+
{ key: 'language', value: language },
|
|
52
71
|
]
|
|
53
72
|
.filter((v) => !(0, lodash_1.isNil)(v.value))
|
|
54
73
|
.map((v) => `${v.key}:${v.value}`))
|
|
@@ -58,7 +77,7 @@ class CursorConverter extends converter_1.Converter {
|
|
|
58
77
|
endedAt,
|
|
59
78
|
type: {
|
|
60
79
|
category: assistantMetricType,
|
|
61
|
-
...(
|
|
80
|
+
...(assistantMetricTypeDetail && { detail: assistantMetricTypeDetail }),
|
|
62
81
|
},
|
|
63
82
|
valueType: getValueType(value),
|
|
64
83
|
value: String(value),
|
|
@@ -71,6 +90,8 @@ class CursorConverter extends converter_1.Converter {
|
|
|
71
90
|
...(model && { model }),
|
|
72
91
|
...(feature && { feature }),
|
|
73
92
|
...(repository && { repository }),
|
|
93
|
+
...(editor && { editor }),
|
|
94
|
+
...(language && { language }),
|
|
74
95
|
},
|
|
75
96
|
},
|
|
76
97
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/cursor/common.ts"],"names":[],"mappings":";;;AACA,wDAAmD;AAEnD,mCAA6B;AAE7B,uCAA8E;AAC9E,4CAAyE;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/cursor/common.ts"],"names":[],"mappings":";;;AACA,wDAAmD;AAEnD,mCAA6B;AAE7B,uCAA8E;AAC9E,4CAAyE;AAqBzE,IAAY,OAWX;AAXD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,gCAAqB,CAAA;IACrB,wBAAa,CAAA;IACb,0BAAe,CAAA;IACf,yBAAc,CAAA;IACd,4BAAiB,CAAA;IACjB,sBAAW,CAAA;IACX,oCAAyB,CAAA;IACzB,sBAAW,CAAA;IACX,wBAAa,CAAA;AACf,CAAC,EAXW,OAAO,uBAAP,OAAO,QAWlB;AAED,IAAY,YAWX;AAXD,WAAY,YAAY;IACtB,0CAA0B,CAAA;IAC1B,sCAAsB,CAAA;IACtB,uDAAuC,CAAA;IACvC,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,4CAA4B,CAAA;IAC5B,sDAAsC,CAAA;IACtC,gDAAgC,CAAA;IAChC,qDAAqC,CAAA;IACrC,yDAAyC,CAAA;AAC3C,CAAC,EAXW,YAAY,4BAAZ,YAAY,QAWvB;AAED,MAAsB,eAAgB,SAAQ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;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { CursorConverter } from './common';
|
|
4
|
+
export declare class DailyActiveUsers extends CursorConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
id(record: AirbyteRecord): string;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
}
|