airbyte-faros-destination 0.16.6 → 0.16.8

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.
@@ -99,7 +99,6 @@ class AzurePipelineConverter extends converter_1.Converter {
99
99
  case 'canceled':
100
100
  return { category: cicd_1.BuildStateCategory.Canceled, detail: result };
101
101
  case 'failed':
102
- case 'skipped':
103
102
  return { category: cicd_1.BuildStateCategory.Failed, detail: result };
104
103
  case 'succeeded':
105
104
  case 'succeededWithIssues':
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/azurepipeline/common.ts"],"names":[],"mappings":";;;AAEA,mCAA+B;AAE/B,yDAA+D;AAC/D,yCAA2E;AAG3E,4CAAsD;AAWtD,mCAAmC;AACnC,MAAsB,sBAAuB,SAAQ,qBAAS;IAA9D;;QACE,WAAM,GAAG,eAAe,CAAC;IAuH3B,CAAC;IAtHC,yDAAyD;IACzD,EAAE,CAAC,MAAqB;;QACtB,OAAO,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,EAAE,CAAC;IAClC,CAAC;IAES,mBAAmB,CAAC,GAAkB;;QAC9C,OAAO,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,uBAAuB,0CAAE,aAAa,CAAC;IAC5D,CAAC;IAES,kBAAkB,CAAC,GAAkB;;QAC7C,OAAO,MAAA,MAAA,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,0CAAE,mBAAmB,mCAAI,EAAE,CAAC;IAClE,CAAC;IAED,iBAAiB,CAAC,MAA0B;QAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;QACT,CAAC;QACD,4CAA4C;QAC5C,kHAAkH;QAClH,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,UAAU;gBACb,OAAO,EAAC,QAAQ,EAAE,yBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM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ACD,iHAAiH;QACjH,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,WAAW,CAAC;YACjB,KAAK,UAAU;gBACb,OAAO,EAAC,QAAQ,EAAE,yBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC;YACjE,KAAK,QAAQ;gBACX,OAAO,EAAC,QAAQ,EAAE,yBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC;YAC/D,KAAK,WAAW,CAAC;YACjB,KAAK,qBAAqB;gBACxB,OAAO,EAAC,QAAQ,EAAE,yBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC;YAChE;gBACE,OAAO,EAAC,QAAQ,EAAE,yBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,oBAAoB,CAAC,IAAY;QAC/B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,OAAO,EAAC,QAAQ,EAAE,kBAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;IACtD,CAAC;IAES,SAAS,CAAC,IAAY,EAAE,MAAe;QAC/C,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE;YACvB,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,CAAC,UAAU,CAAC,MAAM;SACzC,CAAC;IACJ,CAAC;CACF;AAvHD,wDAuHC"}
@@ -14,7 +14,6 @@ class Pipelines extends common_1.AzurePipelineConverter {
14
14
  }
15
15
  async convert(record, ctx) {
16
16
  var _a;
17
- const source = this.streamName.source;
18
17
  const pipeline = record.record.data;
19
18
  const res = [];
20
19
  const organizationName = (0, azure_devops_1.getOrganizationFromUrl)(pipeline.url);
@@ -22,15 +21,14 @@ class Pipelines extends common_1.AzurePipelineConverter {
22
21
  ctx.logger.error(`No organization found for pipeline ${pipeline.id}. URL: ${pipeline.url}`);
23
22
  return [];
24
23
  }
25
- const organization = { uid: organizationName, source };
26
- if (!this.seenOrganizations.has(organizationName)) {
27
- this.seenOrganizations.add(organizationName);
24
+ const orgKey = this.getOrgKey(organizationName);
25
+ if (!this.seenOrganizations.has(orgKey.uid)) {
26
+ this.seenOrganizations.add(orgKey.uid);
28
27
  res.push({
29
28
  model: 'cicd_Organization',
30
29
  record: {
31
- uid: organizationName,
30
+ ...orgKey,
32
31
  name: organizationName,
33
- source,
34
32
  },
35
33
  });
36
34
  }
@@ -40,7 +38,8 @@ class Pipelines extends common_1.AzurePipelineConverter {
40
38
  uid: String(pipeline.id),
41
39
  name: `${(_a = pipeline.project) === null || _a === void 0 ? void 0 : _a.name}:${pipeline.name}`,
42
40
  url: pipeline.url,
43
- organization,
41
+ description: pipeline.folder,
42
+ organization: orgKey,
44
43
  },
45
44
  });
46
45
  return res;
@@ -1 +1 @@
1
- {"version":3,"file":"pipelines.js","sourceRoot":"","sources":["../../../src/converters/azurepipeline/pipelines.ts"],"names":[],"mappings":";;;AAGA,yDAA8D;AAE9D,qCAAgD;AAEhD,MAAa,SAAU,SAAQ,+BAAsB;IAArD;;QACW,sBAAiB,GAAoC;YAC5D,mBAAmB;YACnB,eAAe;SAChB,CAAC;QAEe,sBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IA4CzD,CAAC;IA1CC,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;;QAElB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAgB,CAAC;QAChD,MAAM,GAAG,GAAwB,EAAE,CAAC;QAEpC,MAAM,gBAAgB,GAAG,IAAA,qCAAsB,EAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,GAAG,CAAC,MAAM,CAAC,KAAK,CACd,sCAAsC,QAAQ,CAAC,EAAE,U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,GAAG,GAAwB,EAAE,CAAC;QAEpC,MAAM,gBAAgB,GAAG,IAAA,qCAAsB,EAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,GAAG,CAAC,MAAM,CAAC,KAAK,CACd,sCAAsC,QAAQ,CAAC,EAAE,UAAU,QAAQ,CAAC,GAAG,EAAE,CAC1E,CAAC;YACF,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QAEhD,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvC,GAAG,CAAC,IAAI,CAAC;gBACP,KAAK,EAAE,mBAAmB;gBAC1B,MAAM,EAAE;oBACN,GAAG,MAAM;oBACT,IAAI,EAAE,gBAAgB;iBACvB;aACF,CAAC,CAAC;QACL,CAAC;QAED,GAAG,CAAC,IAAI,CAAC;YACP,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE;gBACN,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACxB,IAAI,EAAE,GAAG,MAAA,QAAQ,CAAC,OAAO,0CAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE;gBAClD,GAAG,EAAE,QAAQ,CAAC,GAAG;gBACjB,WAAW,EAAE,QAAQ,CAAC,MAAM;gBAC5B,YAAY,EAAE,MAAM;aACrB;SACF,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAjDD,8BAiDC"}
@@ -1,12 +1,15 @@
1
1
  import { AirbyteRecord } from 'faros-airbyte-cdk';
2
2
  import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
3
3
  import { AzurePipelineConverter } from './common';
4
- export declare class Builds extends AzurePipelineConverter {
5
- readonly destinationModels: ReadonlyArray<DestinationModel>;
4
+ export declare class Runs extends AzurePipelineConverter {
6
5
  private readonly seenRepositories;
7
6
  private readonly seenTags;
7
+ readonly destinationModels: ReadonlyArray<DestinationModel>;
8
8
  convert(record: AirbyteRecord, ctx?: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
9
+ private convertRunState;
10
+ private processTags;
11
+ private processCommit;
9
12
  private processCoverageStats;
10
13
  private getMeasures;
11
- private processTags;
14
+ private processStages;
12
15
  }
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Runs = void 0;
4
+ const faros_js_client_1 = require("faros-js-client");
5
+ const azure_devops_1 = require("../common/azure-devops");
6
+ const cicd_1 = require("../common/cicd");
7
+ const common_1 = require("./common");
8
+ class Runs extends common_1.AzurePipelineConverter {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.seenRepositories = new Set();
12
+ this.seenTags = new Set();
13
+ this.destinationModels = ['cicd_Build'];
14
+ }
15
+ async convert(record, ctx) {
16
+ var _a, _b, _c, _d;
17
+ const run = record.record.data;
18
+ const res = [];
19
+ const organizationName = (0, azure_devops_1.getOrganizationFromUrl)(run.url);
20
+ if (!organizationName) {
21
+ ctx.logger.error(`No organization found for run ${run.id}. URL: ${run.url}`);
22
+ return [];
23
+ }
24
+ const organization = this.getOrgKey(organizationName);
25
+ const pipeline = {
26
+ uid: String((_a = run.pipeline) === null || _a === void 0 ? void 0 : _a.id),
27
+ organization,
28
+ };
29
+ const runKey = {
30
+ uid: String(run.id),
31
+ pipeline,
32
+ };
33
+ res.push(...this.processTags(run.tags, runKey));
34
+ res.push(...this.processCommit(run, runKey));
35
+ res.push(...this.processStages(run, runKey));
36
+ // Add build number revision???
37
+ const status = this.convertRunState(run.result);
38
+ res.push({
39
+ model: 'cicd_Build',
40
+ record: {
41
+ ...runKey,
42
+ name: run.name,
43
+ createdAt: faros_js_client_1.Utils.toDate(run.createdDate),
44
+ startedAt: faros_js_client_1.Utils.toDate(run.startTime),
45
+ endedAt: faros_js_client_1.Utils.toDate(run.finishedDate),
46
+ status,
47
+ url: (_d = (_c = (_b = run._links) === null || _b === void 0 ? void 0 : _b.web) === null || _c === void 0 ? void 0 : _c.href) !== null && _d !== void 0 ? _d : run.url,
48
+ },
49
+ });
50
+ return res;
51
+ }
52
+ // https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/list#runresult
53
+ convertRunState(result) {
54
+ if (!result) {
55
+ return;
56
+ }
57
+ switch (result) {
58
+ case 'canceled':
59
+ return { category: cicd_1.BuildStateCategory.Canceled, detail: result };
60
+ case 'failed':
61
+ return { category: cicd_1.BuildStateCategory.Failed, detail: result };
62
+ case 'succeeded':
63
+ return { category: cicd_1.BuildStateCategory.Success, detail: result };
64
+ default:
65
+ return { category: cicd_1.BuildStateCategory.Custom, detail: result };
66
+ }
67
+ }
68
+ processTags(tags, buildKey) {
69
+ const results = [];
70
+ for (const tag of tags !== null && tags !== void 0 ? tags : []) {
71
+ const tagKey = { uid: tag };
72
+ results.push({
73
+ model: 'cicd_BuildTag',
74
+ record: {
75
+ build: buildKey,
76
+ tag: tagKey,
77
+ },
78
+ });
79
+ if (this.seenTags.has(tag)) {
80
+ continue;
81
+ }
82
+ this.seenTags.add(tag);
83
+ results.push({
84
+ model: 'faros_Tag',
85
+ record: {
86
+ ...tagKey,
87
+ key: tag,
88
+ },
89
+ });
90
+ }
91
+ return results;
92
+ }
93
+ processCommit(run, buildKey, ctx) {
94
+ if (!run.sourceVersion || !run.repository) {
95
+ return [];
96
+ }
97
+ const res = [];
98
+ const { sourceVersion, repository } = run;
99
+ const vcsRepository = this.vcs_Repository(repository);
100
+ const commitKey = {
101
+ uid: sourceVersion,
102
+ sha: sourceVersion,
103
+ repository: vcsRepository,
104
+ };
105
+ if (vcsRepository) {
106
+ res.push({
107
+ model: 'cicd_BuildCommitAssociation',
108
+ record: {
109
+ build: buildKey,
110
+ commit: commitKey,
111
+ },
112
+ });
113
+ res.push(...this.processCoverageStats(run, vcsRepository, commitKey, ctx));
114
+ }
115
+ const cicdRepoUid = `${repository.type}:${repository.id}`;
116
+ const cicdRepoKey = {
117
+ uid: cicdRepoUid,
118
+ organization: buildKey.pipeline.organization,
119
+ };
120
+ if (!this.seenRepositories.has(cicdRepoUid)) {
121
+ this.seenRepositories.add(cicdRepoUid);
122
+ res.push({
123
+ model: 'cicd_Repository',
124
+ record: {
125
+ ...cicdRepoKey,
126
+ name: run.repository.name,
127
+ description: null,
128
+ url: run.repository.url,
129
+ },
130
+ });
131
+ }
132
+ for (const artifact of run.artifacts) {
133
+ const tags = [];
134
+ for (const [key, value] of Object.entries(artifact.resource.properties)) {
135
+ tags.push({ name: key, value: String(value) });
136
+ }
137
+ const artifactKey = {
138
+ uid: String(artifact.id),
139
+ repository: cicdRepoKey,
140
+ };
141
+ res.push({
142
+ model: 'cicd_Artifact',
143
+ record: {
144
+ ...artifactKey,
145
+ name: artifact.name,
146
+ url: artifact.resource.url,
147
+ type: artifact.resource.type,
148
+ createdAt: faros_js_client_1.Utils.toDate(run.finishedDate),
149
+ tags,
150
+ build: buildKey,
151
+ },
152
+ });
153
+ if (vcsRepository) {
154
+ res.push({
155
+ model: 'cicd_ArtifactCommitAssociation',
156
+ record: {
157
+ artifact: artifactKey,
158
+ commit: commitKey,
159
+ },
160
+ });
161
+ }
162
+ }
163
+ return res;
164
+ }
165
+ processCoverageStats(run, repoKey, commitKey, ctx) {
166
+ var _a;
167
+ if (!((_a = run.coverageStats) === null || _a === void 0 ? void 0 : _a.length)) {
168
+ return [];
169
+ }
170
+ const { triggerInfo } = run;
171
+ const prKey = (triggerInfo === null || triggerInfo === void 0 ? void 0 : triggerInfo['pr.number'])
172
+ ? {
173
+ uid: triggerInfo === null || triggerInfo === void 0 ? void 0 : triggerInfo['pr.number'],
174
+ number: Number(triggerInfo === null || triggerInfo === void 0 ? void 0 : triggerInfo['pr.number']),
175
+ repository: repoKey,
176
+ }
177
+ : undefined;
178
+ const res = [];
179
+ for (const coverage of run.coverageStats) {
180
+ const measures = this.getMeasures(coverage, ctx);
181
+ if (Object.keys(measures).length) {
182
+ res.push({
183
+ model: 'qa_CodeQuality',
184
+ record: {
185
+ ...measures,
186
+ uid: commitKey.sha,
187
+ createdAt: faros_js_client_1.Utils.toDate(run.finishedDate),
188
+ pullRequest: prKey,
189
+ commit: commitKey,
190
+ repository: repoKey,
191
+ },
192
+ });
193
+ }
194
+ }
195
+ return res;
196
+ }
197
+ getMeasures(coverage, ctx) {
198
+ if (coverage.label === 'Lines') {
199
+ return {
200
+ linesToCover: {
201
+ category: 'Coverage',
202
+ name: 'Lines to Cover',
203
+ type: 'Int',
204
+ value: String(coverage.total),
205
+ },
206
+ uncoveredLines: {
207
+ category: 'Coverage',
208
+ name: 'Uncovered Lines',
209
+ type: 'Int',
210
+ value: String(coverage.total - coverage.covered),
211
+ },
212
+ lineCoverage: {
213
+ category: 'Coverage',
214
+ name: 'Line Coverage',
215
+ type: 'Percent',
216
+ value: String(coverage.total ? (coverage.covered / coverage.total) * 100 : 0),
217
+ },
218
+ };
219
+ }
220
+ ctx === null || ctx === void 0 ? void 0 : ctx.logger.warn(`Unsupported coverage label: ${coverage.label}`);
221
+ return {};
222
+ }
223
+ processStages(run, buildKey) {
224
+ var _a;
225
+ const res = [];
226
+ for (const job of (_a = run.stages) !== null && _a !== void 0 ? _a : []) {
227
+ const jobCreatedAt = faros_js_client_1.Utils.toDate(job.startTime);
228
+ const jobStartedAt = faros_js_client_1.Utils.toDate(job.startTime);
229
+ const jobEndedAt = faros_js_client_1.Utils.toDate(job.finishTime);
230
+ const jobStatus = this.convertBuildStepState(job.result);
231
+ const jobType = this.convertBuildStepType(job.type);
232
+ res.push({
233
+ model: 'cicd_BuildStep',
234
+ record: {
235
+ uid: String(job.id),
236
+ build: buildKey,
237
+ name: job.name,
238
+ command: job.name,
239
+ type: jobType,
240
+ createdAt: jobCreatedAt,
241
+ startedAt: jobStartedAt,
242
+ endedAt: jobEndedAt,
243
+ status: jobStatus,
244
+ url: job.url,
245
+ },
246
+ });
247
+ }
248
+ return res;
249
+ }
250
+ }
251
+ exports.Runs = Runs;
252
+ //# sourceMappingURL=runs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../../src/converters/azurepipeline/runs.ts"],"names":[],"mappings":";;;AAGA,qDAAsC;AAEtC,yDAA8D;AAC9D,yCAA4D;AAI5D,qCAAgD;AAEhD,MAAa,IAAK,SAAQ,+BAAsB;IAAhD;;QACmB,qBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QACrC,aAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;QAErC,sBAAiB,GAAoC,CAAC,YAAY,CAAC,CAAC;IA+Q/E,CAAC;IA9QC,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAmB;;QAEnB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAW,CAAC;QACtC,MAAM,GAAG,GAAwB,EAAE,CAAC;QAEpC,MAAM,gBAAgB,GAAG,IAAA,qCAAsB,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACzD,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,GAAG,CAAC,MAAM,CAAC,KAAK,CACd,iCAAiC,GAAG,CAAC,EAAE,UAAU,GAAG,CAAC,GAAG,EAAE,CAC3D,CAAC;YACF,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG;YACf,GAAG,EAAE,MAAM,CAAC,MAAA,GAAG,CAAC,QAAQ,0CAAE,EAAE,CAAC;YAC7B,YAAY;SACb,CAAC;QAEF,MAAM,MAAM,GAAG;YACb,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,QAAQ;SACT,CAAC;QAEF,GAAG,CAAC,IAAI,CAAC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AAI;oBACjB,IAAI,EAAE,OAAO;oBACb,SAAS,EAAE,YAAY;oBACvB,SAAS,EAAE,YAAY;oBACvB,OAAO,EAAE,UAAU;oBACnB,MAAM,EAAE,SAAS;oBACjB,GAAG,EAAE,GAAG,CAAC,GAAG;iBACb;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAnRD,oBAmRC"}
@@ -103,17 +103,17 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
103
103
  description?: string;
104
104
  }>>;
105
105
  }, "strip", z.ZodTypeAny, {
106
+ kind?: string;
106
107
  properties?: {
107
108
  name?: string;
108
109
  description?: string;
109
110
  };
110
- kind?: string;
111
111
  }, {
112
+ kind?: string;
112
113
  properties?: {
113
114
  name?: string;
114
115
  description?: string;
115
116
  };
116
- kind?: string;
117
117
  }>;
118
118
  epics: z.ZodObject<{
119
119
  kind: z.ZodString;
@@ -199,6 +199,7 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
199
199
  project?: string;
200
200
  }>>;
201
201
  }, "strip", z.ZodTypeAny, {
202
+ kind?: string;
202
203
  properties?: {
203
204
  status?: {
204
205
  property: string;
@@ -219,8 +220,8 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
219
220
  description?: string;
220
221
  project?: string;
221
222
  };
222
- kind?: string;
223
223
  }, {
224
+ kind?: string;
224
225
  properties?: {
225
226
  status?: string | {
226
227
  property?: string;
@@ -234,7 +235,6 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
234
235
  description?: string;
235
236
  project?: string;
236
237
  };
237
- kind?: string;
238
238
  }>;
239
239
  sprints: z.ZodObject<{
240
240
  kind: z.ZodString;
@@ -326,6 +326,7 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
326
326
  closed_at?: string;
327
327
  }>>;
328
328
  }, "strip", z.ZodTypeAny, {
329
+ kind?: string;
329
330
  properties?: {
330
331
  status?: {
331
332
  property: string;
@@ -348,8 +349,8 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
348
349
  ended_at?: string;
349
350
  closed_at?: string;
350
351
  };
351
- kind?: string;
352
352
  }, {
353
+ kind?: string;
353
354
  properties?: {
354
355
  status?: string | {
355
356
  property?: string;
@@ -365,7 +366,6 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
365
366
  ended_at?: string;
366
367
  closed_at?: string;
367
368
  };
368
- kind?: string;
369
369
  }>;
370
370
  tasks: z.ZodObject<{
371
371
  kind: z.ZodString;
@@ -538,6 +538,7 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
538
538
  resolved_at?: string;
539
539
  }>>;
540
540
  }, "strip", z.ZodTypeAny, {
541
+ kind?: string;
541
542
  properties?: {
542
543
  priority?: string;
543
544
  status?: {
@@ -579,9 +580,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
579
580
  epic?: string;
580
581
  resolved_at?: string;
581
582
  };
582
- kind?: string;
583
583
  include_additional_properties?: boolean;
584
584
  }, {
585
+ kind?: string;
585
586
  properties?: {
586
587
  priority?: string;
587
588
  status?: string | {
@@ -609,19 +610,19 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
609
610
  epic?: string;
610
611
  resolved_at?: string;
611
612
  };
612
- kind?: string;
613
613
  include_additional_properties?: boolean;
614
614
  }>;
615
615
  }, "strip", z.ZodTypeAny, {
616
616
  projects?: {
617
+ kind?: string;
617
618
  properties?: {
618
619
  name?: string;
619
620
  description?: string;
620
621
  };
621
- kind?: string;
622
622
  };
623
623
  kind_property?: string;
624
624
  epics?: {
625
+ kind?: string;
625
626
  properties?: {
626
627
  status?: {
627
628
  property: string;
@@ -642,9 +643,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
642
643
  description?: string;
643
644
  project?: string;
644
645
  };
645
- kind?: string;
646
646
  };
647
647
  sprints?: {
648
+ kind?: string;
648
649
  properties?: {
649
650
  status?: {
650
651
  property: string;
@@ -667,9 +668,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
667
668
  ended_at?: string;
668
669
  closed_at?: string;
669
670
  };
670
- kind?: string;
671
671
  };
672
672
  tasks?: {
673
+ kind?: string;
673
674
  properties?: {
674
675
  priority?: string;
675
676
  status?: {
@@ -711,19 +712,19 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
711
712
  epic?: string;
712
713
  resolved_at?: string;
713
714
  };
714
- kind?: string;
715
715
  include_additional_properties?: boolean;
716
716
  };
717
717
  }, {
718
718
  projects?: {
719
+ kind?: string;
719
720
  properties?: {
720
721
  name?: string;
721
722
  description?: string;
722
723
  };
723
- kind?: string;
724
724
  };
725
725
  kind_property?: string;
726
726
  epics?: {
727
+ kind?: string;
727
728
  properties?: {
728
729
  status?: string | {
729
730
  property?: string;
@@ -737,9 +738,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
737
738
  description?: string;
738
739
  project?: string;
739
740
  };
740
- kind?: string;
741
741
  };
742
742
  sprints?: {
743
+ kind?: string;
743
744
  properties?: {
744
745
  status?: string | {
745
746
  property?: string;
@@ -755,9 +756,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
755
756
  ended_at?: string;
756
757
  closed_at?: string;
757
758
  };
758
- kind?: string;
759
759
  };
760
760
  tasks?: {
761
+ kind?: string;
761
762
  properties?: {
762
763
  priority?: string;
763
764
  status?: string | {
@@ -785,19 +786,19 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
785
786
  epic?: string;
786
787
  resolved_at?: string;
787
788
  };
788
- kind?: string;
789
789
  include_additional_properties?: boolean;
790
790
  };
791
791
  }>, {
792
792
  projects?: {
793
+ kind?: string;
793
794
  properties?: {
794
795
  name?: string;
795
796
  description?: string;
796
797
  };
797
- kind?: string;
798
798
  };
799
799
  kind_property?: string;
800
800
  epics?: {
801
+ kind?: string;
801
802
  properties?: {
802
803
  status?: {
803
804
  property: string;
@@ -818,9 +819,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
818
819
  description?: string;
819
820
  project?: string;
820
821
  };
821
- kind?: string;
822
822
  };
823
823
  sprints?: {
824
+ kind?: string;
824
825
  properties?: {
825
826
  status?: {
826
827
  property: string;
@@ -843,9 +844,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
843
844
  ended_at?: string;
844
845
  closed_at?: string;
845
846
  };
846
- kind?: string;
847
847
  };
848
848
  tasks?: {
849
+ kind?: string;
849
850
  properties?: {
850
851
  priority?: string;
851
852
  status?: {
@@ -887,19 +888,19 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
887
888
  epic?: string;
888
889
  resolved_at?: string;
889
890
  };
890
- kind?: string;
891
891
  include_additional_properties?: boolean;
892
892
  };
893
893
  }, {
894
894
  projects?: {
895
+ kind?: string;
895
896
  properties?: {
896
897
  name?: string;
897
898
  description?: string;
898
899
  };
899
- kind?: string;
900
900
  };
901
901
  kind_property?: string;
902
902
  epics?: {
903
+ kind?: string;
903
904
  properties?: {
904
905
  status?: string | {
905
906
  property?: string;
@@ -913,9 +914,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
913
914
  description?: string;
914
915
  project?: string;
915
916
  };
916
- kind?: string;
917
917
  };
918
918
  sprints?: {
919
+ kind?: string;
919
920
  properties?: {
920
921
  status?: string | {
921
922
  property?: string;
@@ -931,9 +932,9 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
931
932
  ended_at?: string;
932
933
  closed_at?: string;
933
934
  };
934
- kind?: string;
935
935
  };
936
936
  tasks?: {
937
+ kind?: string;
937
938
  properties?: {
938
939
  priority?: string;
939
940
  status?: string | {
@@ -961,7 +962,6 @@ export declare const notionConfig: z.ZodEffects<z.ZodObject<{
961
962
  epic?: string;
962
963
  resolved_at?: string;
963
964
  };
964
- kind?: string;
965
965
  include_additional_properties?: boolean;
966
966
  };
967
967
  }>;
@@ -44,6 +44,7 @@ export declare class Customreports extends Converter {
44
44
  private getAllEmployeeRecords;
45
45
  private getAdditionalTeamInfo;
46
46
  private initializeTeamToParentWithInput;
47
+ private cleanVendor;
47
48
  private computeTeamToParentTeamMappingUsingParentIDField;
48
49
  private computeTeamToParentTeamMapping;
49
50
  private computeOwnershipChain;
@@ -370,6 +370,18 @@ class Customreports extends converter_1.Converter {
370
370
  map[this.FAROS_TEAM_ROOT] = null;
371
371
  return map;
372
372
  }
373
+ cleanVendor(vendor) {
374
+ // We only take the first line of many if it's a multiline string
375
+ // We take away any non-alphanumeric characters (other than spaces)
376
+ // We take any grouping of more than one space and make it one space
377
+ // We remove any leading or trailing spaces
378
+ // We lowercase the string
379
+ vendor = vendor.split('\n')[0];
380
+ vendor = vendor.replace(/[^a-zA-Z0-9\s]/g, '');
381
+ vendor = vendor.replace(/\s+/g, ' ').trim();
382
+ vendor = vendor.toLowerCase();
383
+ return vendor;
384
+ }
373
385
  computeTeamToParentTeamMappingUsingParentIDField(ctx, teamIDToParentTeamID) {
374
386
  ctx.logger.info('Computing team to parent mapping via Parent_Team_ID');
375
387
  const all_employee_records = this.getAllEmployeeRecords();
@@ -646,6 +658,24 @@ class Customreports extends converter_1.Converter {
646
658
  },
647
659
  });
648
660
  this.writtenEmployeeIds.add(employee_record.Employee_ID);
661
+ if (employee_record.Vendor) {
662
+ const vendor = this.cleanVendor(employee_record.Vendor);
663
+ const tagUid = `vendor__${vendor}`;
664
+ records.push({
665
+ model: 'faros_Tag',
666
+ record: {
667
+ uid: tagUid,
668
+ key: 'vendor',
669
+ value: vendor,
670
+ },
671
+ }, {
672
+ model: 'org_EmployeeTag',
673
+ record: {
674
+ employee: { uid: employee_record.Employee_ID },
675
+ tag: { uid: tagUid },
676
+ },
677
+ });
678
+ }
649
679
  return records;
650
680
  }
651
681
  createOrgTeamRecord(teamID, teamIDToParentID, ctx) {