airbyte-faros-destination 0.6.42 → 0.6.44
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/abstract-surveys/surveys.d.ts +2 -0
- package/lib/converters/abstract-surveys/surveys.js +30 -15
- package/lib/converters/abstract-surveys/surveys.js.map +1 -1
- package/lib/converters/workday/customreports.d.ts +41 -0
- package/lib/converters/workday/customreports.js +379 -0
- package/lib/converters/workday/customreports.js.map +1 -0
- package/lib/converters/workday/models.d.ts +26 -0
- package/lib/converters/workday/models.js +15 -0
- package/lib/converters/workday/models.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/resources/source-specific-configs/spec.json +3 -0
- package/resources/source-specific-configs/surveys.json +10 -0
- package/resources/source-specific-configs/workday.json +36 -0
|
@@ -23,6 +23,7 @@ export interface SurveysConfig {
|
|
|
23
23
|
question_metadata_table_name?: string;
|
|
24
24
|
question_category_mapping?: QuestionCategoryMapping;
|
|
25
25
|
column_names_mapping?: ColumnNameMapping;
|
|
26
|
+
exclude_columns?: ReadonlyArray<string>;
|
|
26
27
|
}
|
|
27
28
|
export declare abstract class AbstractSurveys extends Converter {
|
|
28
29
|
abstract getSurveyId(record: AirbyteRecord): string | undefined;
|
|
@@ -58,5 +59,6 @@ export declare abstract class AbstractSurveys extends Converter {
|
|
|
58
59
|
static createQuestionUid(surveyId: string, question: string): string;
|
|
59
60
|
static getTeamUid(teamName: string): string | undefined;
|
|
60
61
|
static digest(input: string): string;
|
|
62
|
+
static getColumnValue(row: any, columnName: string): string | null;
|
|
61
63
|
}
|
|
62
64
|
export {};
|
|
@@ -35,7 +35,7 @@ class AbstractSurveys extends converter_1.Converter {
|
|
|
35
35
|
getSubmittedAt(record) {
|
|
36
36
|
var _a, _b;
|
|
37
37
|
const submittedAtColumnName = this.config.column_names_mapping.response_submitted_at_column_name;
|
|
38
|
-
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.row
|
|
38
|
+
return AbstractSurveys.getColumnValue((_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.row, submittedAtColumnName);
|
|
39
39
|
}
|
|
40
40
|
initialize(ctx) {
|
|
41
41
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -193,12 +193,12 @@ class AbstractSurveys extends converter_1.Converter {
|
|
|
193
193
|
return updateRecords;
|
|
194
194
|
}
|
|
195
195
|
getQuestionWithMetadata(surveyId, row) {
|
|
196
|
-
const question = row
|
|
196
|
+
const question = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.question_column_name);
|
|
197
197
|
if (!question) {
|
|
198
198
|
return undefined;
|
|
199
199
|
}
|
|
200
|
-
const category = row
|
|
201
|
-
const responseType = row
|
|
200
|
+
const category = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.question_category_column_name);
|
|
201
|
+
const responseType = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.response_type_column_name);
|
|
202
202
|
return {
|
|
203
203
|
uid: AbstractSurveys.createQuestionUid(surveyId, question),
|
|
204
204
|
source: this.source,
|
|
@@ -230,7 +230,7 @@ class AbstractSurveys extends converter_1.Converter {
|
|
|
230
230
|
uid: responseId,
|
|
231
231
|
source: this.source,
|
|
232
232
|
submittedAt,
|
|
233
|
-
response: row
|
|
233
|
+
response: AbstractSurveys.getColumnValue(row, question).toString(),
|
|
234
234
|
surveyQuestion: {
|
|
235
235
|
survey: { uid: surveyId, source: this.source },
|
|
236
236
|
question: { uid: questionRecord.uid, source: this.source },
|
|
@@ -292,6 +292,8 @@ class AbstractSurveys extends converter_1.Converter {
|
|
|
292
292
|
this.surveyStats.set(surveyId, stats);
|
|
293
293
|
}
|
|
294
294
|
getFilteredQuestions(row) {
|
|
295
|
+
var _a;
|
|
296
|
+
const excludeColumns = (_a = this.config.exclude_columns) !== null && _a !== void 0 ? _a : [];
|
|
295
297
|
return Object.keys(row).filter((question) => ![
|
|
296
298
|
this.config.column_names_mapping.survey_name_column_name,
|
|
297
299
|
this.config.column_names_mapping.survey_type_column_name,
|
|
@@ -303,22 +305,24 @@ class AbstractSurveys extends converter_1.Converter {
|
|
|
303
305
|
this.config.column_names_mapping.respondent_email_column_name,
|
|
304
306
|
this.config.column_names_mapping.respondent_team_name_column_name,
|
|
305
307
|
this.config.column_names_mapping.respondent_team_id_column_name,
|
|
308
|
+
this.config.column_names_mapping.response_submitted_at_column_name,
|
|
309
|
+
...excludeColumns,
|
|
306
310
|
].includes(question));
|
|
307
311
|
}
|
|
308
312
|
getSurveyData(row) {
|
|
309
313
|
var _a, _b, _c, _d, _e, _f;
|
|
310
314
|
return {
|
|
311
|
-
name: (_a = row
|
|
312
|
-
type: (_b = row
|
|
313
|
-
description: (_c = row
|
|
314
|
-
startedAt: (_d = row
|
|
315
|
-
endedAt: (_e = row
|
|
316
|
-
status: (_f = row
|
|
315
|
+
name: (_a = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.survey_name_column_name)) !== null && _a !== void 0 ? _a : null,
|
|
316
|
+
type: (_b = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.survey_type_column_name)) !== null && _b !== void 0 ? _b : null,
|
|
317
|
+
description: (_c = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.survey_description_column_name)) !== null && _c !== void 0 ? _c : null,
|
|
318
|
+
startedAt: (_d = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.survey_started_at_column_name)) !== null && _d !== void 0 ? _d : null,
|
|
319
|
+
endedAt: (_e = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.survey_ended_at_column_name)) !== null && _e !== void 0 ? _e : null,
|
|
320
|
+
status: (_f = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.survey_status_column_name)) !== null && _f !== void 0 ? _f : null,
|
|
317
321
|
};
|
|
318
322
|
}
|
|
319
323
|
getSurveyUser(row) {
|
|
320
324
|
var _a;
|
|
321
|
-
const uid = row
|
|
325
|
+
const uid = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.respondent_email_column_name);
|
|
322
326
|
if (!uid) {
|
|
323
327
|
return undefined;
|
|
324
328
|
}
|
|
@@ -326,19 +330,19 @@ class AbstractSurveys extends converter_1.Converter {
|
|
|
326
330
|
uid,
|
|
327
331
|
source: this.source,
|
|
328
332
|
email: uid,
|
|
329
|
-
name: (_a = row
|
|
333
|
+
name: (_a = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.respondent_name_column_name)) !== null && _a !== void 0 ? _a : null,
|
|
330
334
|
};
|
|
331
335
|
}
|
|
332
336
|
getSurveyTeam(row) {
|
|
333
337
|
var _a;
|
|
334
|
-
const uid = (_a = row
|
|
338
|
+
const uid = (_a = AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.respondent_team_id_column_name)) !== null && _a !== void 0 ? _a : AbstractSurveys.getTeamUid(AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.respondent_team_name_column_name));
|
|
335
339
|
if (!uid) {
|
|
336
340
|
return undefined;
|
|
337
341
|
}
|
|
338
342
|
return {
|
|
339
343
|
uid,
|
|
340
344
|
source: this.source,
|
|
341
|
-
name: row
|
|
345
|
+
name: AbstractSurveys.getColumnValue(row, this.config.column_names_mapping.respondent_team_name_column_name),
|
|
342
346
|
};
|
|
343
347
|
}
|
|
344
348
|
static createQuestionUid(surveyId, question) {
|
|
@@ -353,6 +357,17 @@ class AbstractSurveys extends converter_1.Converter {
|
|
|
353
357
|
static digest(input) {
|
|
354
358
|
return (0, crypto_1.createHash)('sha256').update(input).digest('hex');
|
|
355
359
|
}
|
|
360
|
+
// Get column value either from string or an array of single string (lookup result)
|
|
361
|
+
static getColumnValue(row, columnName) {
|
|
362
|
+
const columnValue = row[columnName];
|
|
363
|
+
if (!columnValue) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
if (Array.isArray(columnValue)) {
|
|
367
|
+
return columnValue.length === 0 ? null : columnValue[0];
|
|
368
|
+
}
|
|
369
|
+
return columnValue;
|
|
370
|
+
}
|
|
356
371
|
}
|
|
357
372
|
exports.AbstractSurveys = AbstractSurveys;
|
|
358
373
|
//# sourceMappingURL=surveys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surveys.js","sourceRoot":"","sources":["../../../src/converters/abstract-surveys/surveys.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAkC;AAClC,yDAAwD;AACxD,qDAAsC;AACtC,oDAAuB;AAEvB,4CAMsB;AACtB,qCAWkB;AA2BlB,MAAsB,eAAgB,SAAQ,qBAAS;IAAvD;;QAUW,sBAAiB,GAAoC;YAC5D,eAAe;YACf,iBAAiB;YACjB,kCAAkC;YAClC,yBAAyB;YACzB,aAAa;YACb,aAAa;YACb,uBAAuB;SACxB,CAAC;QAEM,qBAAgB,GAAgC,IAAI,GAAG,EAAE,CAAC;QAC1D,mBAAc,GAAwB,IAAI,GAAG,EAAE,CAAC;QAChD,gBAAW,GAA6B,IAAI,GAAG,EAAE,CAAC;QAElD,cAAS,GAAG,IAAI,GAAG,EAAU,CAAC;QAC9B,cAAS,GAAG,IAAI,GAAG,EAAU,CAAC;QAC9B,gBAAW,GAAG,IAAI,GAAG,EAAU,CAAC;QAChC,kBAAa,GAAG,IAAI,GAAG,EAAU,CAAC;QAElC,YAAO,GAAkB,SAAS,CAAC;QACnC,6BAAwB,GAA4B,SAAS,CAAC;IAgcxE,CAAC;IA1dC,cAAc,CAAC,MAAqB;;QAClC,MAAM,qBAAqB,GACzB,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,iCAAiC,CAAC;QACrE,OAAO,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAC1D,CAAC;IAwBO,UAAU,CAAC,GAAkB;;QACnC,IAAI,CAAC,OAAO;YACV,MA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} from '../converter';
|
|
3
|
+
import { EmployeeRecord, ManagerTimeRecord } from './models';
|
|
4
|
+
export declare class Customreports extends Converter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
source: string;
|
|
7
|
+
FAROS_TEAM_ROOT: string;
|
|
8
|
+
recordCount: {
|
|
9
|
+
skippedRecords: number;
|
|
10
|
+
storedRecords: number;
|
|
11
|
+
};
|
|
12
|
+
employeeIDtoRecord: Record<string, EmployeeRecord>;
|
|
13
|
+
teamNameToManagerIDs: Record<string, ManagerTimeRecord[]>;
|
|
14
|
+
cycleChains: ReadonlyArray<string>[];
|
|
15
|
+
replacedParentTeams: string[];
|
|
16
|
+
seenLocations: Set<string>;
|
|
17
|
+
generalLogCollection: string[];
|
|
18
|
+
orgs_to_keep: any;
|
|
19
|
+
orgs_to_ignore: any;
|
|
20
|
+
/** Almost every SquadCast record have id property */
|
|
21
|
+
id(record: AirbyteRecord): any;
|
|
22
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
23
|
+
private extractRecordInfo;
|
|
24
|
+
private updateTeamToManagerRecord;
|
|
25
|
+
private convertRecordToStandardizedForm;
|
|
26
|
+
private checkRecordValidity;
|
|
27
|
+
private getManagerIDFromList;
|
|
28
|
+
private computeTeamToParentTeamMapping;
|
|
29
|
+
private computeOwnershipChain;
|
|
30
|
+
setOrgsToKeepAndIgnore(ctx: StreamContext): [string[], string[]];
|
|
31
|
+
private shouldKeepTeam;
|
|
32
|
+
private checkIfTeamIsAcceptable;
|
|
33
|
+
private getAcceptableTeams;
|
|
34
|
+
private printReport;
|
|
35
|
+
private createEmployeeRecordList;
|
|
36
|
+
private createOrgTeamRecord;
|
|
37
|
+
private replaceTeamParents;
|
|
38
|
+
setField(fieldName: string, value: any): void;
|
|
39
|
+
generateFinalRecords(ctx: StreamContext): [ReadonlyArray<DestinationRecord>, Record<string, string>];
|
|
40
|
+
onProcessingComplete(ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Customreports = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const converter_1 = require("../converter");
|
|
6
|
+
const models_1 = require("./models");
|
|
7
|
+
class Customreports extends converter_1.Converter {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.destinationModels = [
|
|
11
|
+
'org_Team',
|
|
12
|
+
'org_Employee',
|
|
13
|
+
'identity_Identity',
|
|
14
|
+
'geo_Location',
|
|
15
|
+
'org_TeamMembership',
|
|
16
|
+
];
|
|
17
|
+
this.source = 'workday';
|
|
18
|
+
this.FAROS_TEAM_ROOT = 'all_teams';
|
|
19
|
+
this.recordCount = {
|
|
20
|
+
skippedRecords: 0,
|
|
21
|
+
storedRecords: 0,
|
|
22
|
+
};
|
|
23
|
+
this.employeeIDtoRecord = {};
|
|
24
|
+
this.teamNameToManagerIDs = {};
|
|
25
|
+
this.cycleChains = [];
|
|
26
|
+
this.replacedParentTeams = [];
|
|
27
|
+
this.seenLocations = new Set();
|
|
28
|
+
this.generalLogCollection = [];
|
|
29
|
+
this.orgs_to_keep = null;
|
|
30
|
+
this.orgs_to_ignore = null;
|
|
31
|
+
}
|
|
32
|
+
/** Almost every SquadCast record have id property */
|
|
33
|
+
id(record) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
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.Employee_Id;
|
|
36
|
+
}
|
|
37
|
+
async convert(record) {
|
|
38
|
+
const rec = record.record.data;
|
|
39
|
+
if (!this.checkRecordValidity(rec)) {
|
|
40
|
+
this.recordCount.skippedRecords += 1;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.recordCount.storedRecords += 1;
|
|
44
|
+
this.extractRecordInfo(rec);
|
|
45
|
+
}
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
extractRecordInfo(rec) {
|
|
49
|
+
// Extracts information from record to class structures
|
|
50
|
+
// in order to be used once all records are processed
|
|
51
|
+
this.employeeIDtoRecord[rec.Employee_ID] = rec;
|
|
52
|
+
this.updateTeamToManagerRecord(rec);
|
|
53
|
+
}
|
|
54
|
+
updateTeamToManagerRecord(rec) {
|
|
55
|
+
// We store all the possible Manager IDs for a Team,
|
|
56
|
+
// The last one in the list will be the most recent time.
|
|
57
|
+
// We check if the Team Name happens to be FAROS_TEAM_ROOT.
|
|
58
|
+
// If this is the case, then the rest of the processing won't work.
|
|
59
|
+
if (rec.Team_Name === this.FAROS_TEAM_ROOT) {
|
|
60
|
+
let error_str = `Record team name is the same as Faros Team Root, ${this.FAROS_TEAM_ROOT}:`;
|
|
61
|
+
error_str += `Record: ${JSON.stringify(rec)}`;
|
|
62
|
+
throw new Error(error_str);
|
|
63
|
+
}
|
|
64
|
+
// Here we check if we haven't yet stored info for this Team Name:
|
|
65
|
+
if (!(rec.Team_Name in this.teamNameToManagerIDs)) {
|
|
66
|
+
this.teamNameToManagerIDs[rec.Team_Name] = [
|
|
67
|
+
{ Manager_ID: rec.Manager_ID, Timestamp: rec.Start_Date },
|
|
68
|
+
];
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// We have already stored info for this team. This should be a list
|
|
72
|
+
const recs_list = this.teamNameToManagerIDs[rec.Team_Name];
|
|
73
|
+
const crt_last_rec = recs_list[recs_list.length - 1];
|
|
74
|
+
if (crt_last_rec.Manager_ID === rec.Manager_ID) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (faros_js_client_1.Utils.toDate(rec.Start_Date) > faros_js_client_1.Utils.toDate(crt_last_rec.Timestamp)) {
|
|
78
|
+
this.teamNameToManagerIDs[rec.Team_Name].push({
|
|
79
|
+
Manager_ID: rec.Manager_ID,
|
|
80
|
+
Timestamp: rec.Start_Date,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
convertRecordToStandardizedForm(rec) {
|
|
85
|
+
const new_rec = {};
|
|
86
|
+
for (const [k, v] of Object.entries(rec)) {
|
|
87
|
+
const alphanum_key = k.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
|
|
88
|
+
if (alphanum_key in models_1.recordKeyTyping) {
|
|
89
|
+
new_rec[models_1.recordKeyTyping[alphanum_key]] = v;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return new_rec;
|
|
93
|
+
}
|
|
94
|
+
checkRecordValidity(rec) {
|
|
95
|
+
rec = this.convertRecordToStandardizedForm(rec);
|
|
96
|
+
if (!rec.Employee_ID ||
|
|
97
|
+
!rec.Full_Name ||
|
|
98
|
+
!rec.Manager_ID ||
|
|
99
|
+
!rec.Manager_Name ||
|
|
100
|
+
!rec.Start_Date ||
|
|
101
|
+
!rec.Team_Name) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
// We're only keeping active records
|
|
105
|
+
if (rec.Termination_Date) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
getManagerIDFromList(recs) {
|
|
111
|
+
if (!recs) {
|
|
112
|
+
throw new Error('Missing recs');
|
|
113
|
+
}
|
|
114
|
+
const last_record = recs[recs.length - 1];
|
|
115
|
+
const manager_id = last_record.Manager_ID;
|
|
116
|
+
return manager_id;
|
|
117
|
+
}
|
|
118
|
+
computeTeamToParentTeamMapping(ctx) {
|
|
119
|
+
ctx.logger.info('Computing team to parent mapping');
|
|
120
|
+
const teamNameToParentTeamName = {};
|
|
121
|
+
teamNameToParentTeamName[this.FAROS_TEAM_ROOT] = null;
|
|
122
|
+
const potential_root_teams = [];
|
|
123
|
+
for (const [teamName, recs] of Object.entries(this.teamNameToManagerIDs)) {
|
|
124
|
+
const manager_id = this.getManagerIDFromList(recs);
|
|
125
|
+
if (!manager_id) {
|
|
126
|
+
this.generalLogCollection.push(`Failed to get manager id for team ${teamName}`);
|
|
127
|
+
teamNameToParentTeamName[teamName] = this.FAROS_TEAM_ROOT;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
let parent_team_uid = this.FAROS_TEAM_ROOT;
|
|
131
|
+
if (manager_id in this.employeeIDtoRecord) {
|
|
132
|
+
// This is the expected case
|
|
133
|
+
parent_team_uid = this.employeeIDtoRecord[manager_id].Team_Name;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// This is in the rare case where manager ID isn't in one of the employee records.
|
|
137
|
+
// It can occur if the currently observed team is the root team in the org
|
|
138
|
+
potential_root_teams.push(teamName);
|
|
139
|
+
}
|
|
140
|
+
teamNameToParentTeamName[teamName] = parent_team_uid;
|
|
141
|
+
}
|
|
142
|
+
if (potential_root_teams.length > 1) {
|
|
143
|
+
ctx.logger.warn(`Found more than one potential root team: "${JSON.stringify(potential_root_teams)}"`);
|
|
144
|
+
}
|
|
145
|
+
return teamNameToParentTeamName;
|
|
146
|
+
}
|
|
147
|
+
computeOwnershipChain(elementId, allOrgId, teamToParent) {
|
|
148
|
+
// In the case of a cycle, it means that the second to last
|
|
149
|
+
// team in the cycle is has a parent that has been previously
|
|
150
|
+
// seen in the chain. So we need to make it so the second to
|
|
151
|
+
// last element in the chain points to the top team.
|
|
152
|
+
// The length of the ownership chain will be at least
|
|
153
|
+
// 2 if there is a cycle.
|
|
154
|
+
// You must return this in ascending order left to right
|
|
155
|
+
let id = elementId;
|
|
156
|
+
const ownershipChain = [];
|
|
157
|
+
const visited = new Set();
|
|
158
|
+
do {
|
|
159
|
+
ownershipChain.push(id);
|
|
160
|
+
if (visited.has(id)) {
|
|
161
|
+
return { cycle: true, ownershipChain };
|
|
162
|
+
}
|
|
163
|
+
visited.add(id);
|
|
164
|
+
id = teamToParent[id];
|
|
165
|
+
} while (id);
|
|
166
|
+
ownershipChain.push(allOrgId);
|
|
167
|
+
return { cycle: false, ownershipChain };
|
|
168
|
+
}
|
|
169
|
+
setOrgsToKeepAndIgnore(ctx) {
|
|
170
|
+
var _a, _b, _c, _d;
|
|
171
|
+
const orgs_to_keep = (_b = (_a = ctx.config.source_specific_configs) === null || _a === void 0 ? void 0 : _a.workday) === null || _b === void 0 ? void 0 : _b.orgs_to_keep;
|
|
172
|
+
const orgs_to_ignore = (_d = (_c = ctx.config.source_specific_configs) === null || _c === void 0 ? void 0 : _c.workday) === null || _d === void 0 ? void 0 : _d.orgs_to_ignore;
|
|
173
|
+
if (!orgs_to_keep || !orgs_to_ignore) {
|
|
174
|
+
throw new Error('orgs_to_keep or orgs_to_ignore missing from source specific configs');
|
|
175
|
+
}
|
|
176
|
+
for (const org of orgs_to_keep) {
|
|
177
|
+
if (orgs_to_ignore.includes(org)) {
|
|
178
|
+
throw new Error('Overlap between orgs_to_keep and orgs_to_ignore');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (orgs_to_keep.length == 0) {
|
|
182
|
+
// we keep all teams
|
|
183
|
+
orgs_to_keep.push(this.FAROS_TEAM_ROOT);
|
|
184
|
+
}
|
|
185
|
+
// Setting the values
|
|
186
|
+
this.orgs_to_keep = orgs_to_keep;
|
|
187
|
+
this.orgs_to_ignore = orgs_to_ignore;
|
|
188
|
+
return [orgs_to_keep, orgs_to_ignore];
|
|
189
|
+
}
|
|
190
|
+
shouldKeepTeam(ownershipChain) {
|
|
191
|
+
// To determine whether a team is kept, we simply go up the ownership chain.
|
|
192
|
+
// if we first hit an ignored team, we return false (not kept).
|
|
193
|
+
// Otherwise if we first hit a kept team, we return true (keep the team)
|
|
194
|
+
// If we hit neither kept nor ignored, we return false (not kept).
|
|
195
|
+
for (const org of ownershipChain) {
|
|
196
|
+
if (this.orgs_to_keep.includes(org)) {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
if (this.orgs_to_ignore.includes(org)) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
checkIfTeamIsAcceptable(team, teamToParent, ctx) {
|
|
206
|
+
// This continues the complicated logic which defines which teams to keep
|
|
207
|
+
// We need to use the ownershipChain, which goes
|
|
208
|
+
// from lowest in the tree to highest in the tree,
|
|
209
|
+
// Left to Right, how to keep certain teams,
|
|
210
|
+
// and to repoint them to their correct parent.
|
|
211
|
+
const ownershipInfo = this.computeOwnershipChain(team, this.FAROS_TEAM_ROOT, teamToParent);
|
|
212
|
+
const ownershipChain = ownershipInfo.ownershipChain;
|
|
213
|
+
if (ownershipInfo.cycle) {
|
|
214
|
+
// Cycle found - this should mean ownershipChain exists with length greater than 1
|
|
215
|
+
ctx.logger.info(JSON.stringify(ownershipChain));
|
|
216
|
+
const fix_team = ownershipChain[ownershipChain.length - 2];
|
|
217
|
+
teamToParent[fix_team] = this.FAROS_TEAM_ROOT;
|
|
218
|
+
this.cycleChains.push(ownershipChain);
|
|
219
|
+
}
|
|
220
|
+
return this.shouldKeepTeam(ownershipChain);
|
|
221
|
+
}
|
|
222
|
+
getAcceptableTeams(teamToParent, ctx) {
|
|
223
|
+
// This is the entry point for the logic which defines which teams to keep
|
|
224
|
+
// (ctx is included for potential debugging)
|
|
225
|
+
ctx.logger.info('Getting Acceptable teams');
|
|
226
|
+
const acceptableTeams = new Set();
|
|
227
|
+
ctx.logger.info('Computing ownership chains.');
|
|
228
|
+
for (const team of Object.keys(teamToParent)) {
|
|
229
|
+
const include_bool = this.checkIfTeamIsAcceptable(team, teamToParent, ctx);
|
|
230
|
+
if (include_bool) {
|
|
231
|
+
acceptableTeams.add(team);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return acceptableTeams;
|
|
235
|
+
}
|
|
236
|
+
printReport(ctx, acceptableTeams) {
|
|
237
|
+
const teamNames = Object.keys(this.teamNameToManagerIDs);
|
|
238
|
+
const report_obj = {
|
|
239
|
+
nAcceptableTeams: acceptableTeams.size,
|
|
240
|
+
nOriginalTeams: teamNames ? teamNames.length : 0,
|
|
241
|
+
records_skipped: this.recordCount.skippedRecords,
|
|
242
|
+
records_stored: this.recordCount.storedRecords,
|
|
243
|
+
cycleChains: this.cycleChains,
|
|
244
|
+
generalLogs: this.generalLogCollection,
|
|
245
|
+
};
|
|
246
|
+
ctx.logger.info('Report:');
|
|
247
|
+
ctx.logger.info(JSON.stringify(report_obj));
|
|
248
|
+
if (this.cycleChains.length > 0) {
|
|
249
|
+
let error_str = 'Cycles found. Please address the issue. ';
|
|
250
|
+
error_str +=
|
|
251
|
+
'The cycle chains are listed in log message above, and here: ';
|
|
252
|
+
error_str += JSON.stringify(this.cycleChains);
|
|
253
|
+
throw new Error(error_str);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
createEmployeeRecordList(employeeID, acceptable_teams) {
|
|
257
|
+
// org_Employee, identity_Identity, geo_Location, org_TeamMembership
|
|
258
|
+
const records = [];
|
|
259
|
+
const employee_record = this.employeeIDtoRecord[employeeID];
|
|
260
|
+
if (!acceptable_teams.has(employee_record.Team_Name)) {
|
|
261
|
+
return records;
|
|
262
|
+
}
|
|
263
|
+
records.push({
|
|
264
|
+
model: 'org_Employee',
|
|
265
|
+
record: {
|
|
266
|
+
uid: employee_record.Employee_ID,
|
|
267
|
+
joinedAt: employee_record.Start_Date,
|
|
268
|
+
inactive: false,
|
|
269
|
+
manager: { uid: employee_record.Manager_ID },
|
|
270
|
+
identity: { uid: employee_record.Employee_ID },
|
|
271
|
+
location: employee_record.Location
|
|
272
|
+
? { uid: employee_record.Location }
|
|
273
|
+
: null,
|
|
274
|
+
},
|
|
275
|
+
}, {
|
|
276
|
+
model: 'identity_Identity',
|
|
277
|
+
record: {
|
|
278
|
+
uid: employee_record.Employee_ID,
|
|
279
|
+
fullName: employee_record.Full_Name,
|
|
280
|
+
emails: employee_record.Email ? [employee_record.Email] : null,
|
|
281
|
+
},
|
|
282
|
+
}, {
|
|
283
|
+
model: 'org_TeamMembership',
|
|
284
|
+
record: {
|
|
285
|
+
team: { uid: employee_record.Team_Name },
|
|
286
|
+
member: { uid: employee_record.Employee_ID },
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
if (employee_record.Location &&
|
|
290
|
+
!this.seenLocations.has(employee_record.Location)) {
|
|
291
|
+
records.push({
|
|
292
|
+
model: 'geo_Location',
|
|
293
|
+
record: {
|
|
294
|
+
uid: employee_record.Location,
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
this.seenLocations.add(employee_record.Location);
|
|
298
|
+
}
|
|
299
|
+
return records;
|
|
300
|
+
}
|
|
301
|
+
createOrgTeamRecord(team, teamToParent) {
|
|
302
|
+
const manager_id = this.getManagerIDFromList(this.teamNameToManagerIDs[team]);
|
|
303
|
+
return {
|
|
304
|
+
model: 'org_Team',
|
|
305
|
+
record: {
|
|
306
|
+
uid: team,
|
|
307
|
+
name: team,
|
|
308
|
+
lead: { uid: manager_id },
|
|
309
|
+
parentTeam: { uid: teamToParent[team] },
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
replaceTeamParents(acceptable_teams, teamToParent) {
|
|
314
|
+
// Within this function we use the new acceptable teams set to
|
|
315
|
+
// ensure team's parents are within the system.
|
|
316
|
+
const newTeamToParent = {};
|
|
317
|
+
for (const team of acceptable_teams) {
|
|
318
|
+
const seenParentTeams = new Set();
|
|
319
|
+
let parent_team = teamToParent[team];
|
|
320
|
+
while (parent_team && !acceptable_teams.has(parent_team)) {
|
|
321
|
+
if (seenParentTeams.has(parent_team)) {
|
|
322
|
+
let err_str = `Cycle found in team Parent Replace function. Team: "${parent_team}". `;
|
|
323
|
+
err_str += `All teams: ${JSON.stringify([...seenParentTeams])}`;
|
|
324
|
+
err_str += `Please reach out to Faros Support.`;
|
|
325
|
+
throw new Error(err_str);
|
|
326
|
+
}
|
|
327
|
+
seenParentTeams.add(parent_team);
|
|
328
|
+
parent_team = teamToParent[parent_team];
|
|
329
|
+
}
|
|
330
|
+
if (parent_team) {
|
|
331
|
+
newTeamToParent[team] = parent_team;
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
newTeamToParent[team] = this.FAROS_TEAM_ROOT;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return newTeamToParent;
|
|
338
|
+
}
|
|
339
|
+
// This method is used during testing
|
|
340
|
+
setField(fieldName, value) {
|
|
341
|
+
this[fieldName] = value;
|
|
342
|
+
}
|
|
343
|
+
generateFinalRecords(ctx) {
|
|
344
|
+
// Class fields required to be filled (reference for testing):
|
|
345
|
+
// recordCount, teamNameToManagerIDs, employeeIDtoRecord
|
|
346
|
+
// FAROS_TEAM_ROOT, cycleChains, generalLogCollection
|
|
347
|
+
const res = [];
|
|
348
|
+
const teamToParent = this.computeTeamToParentTeamMapping(ctx);
|
|
349
|
+
// Here we get a set of teams to keep
|
|
350
|
+
// This is the entry point to the densest logical aspect of the connector
|
|
351
|
+
const acceptable_teams = this.getAcceptableTeams(teamToParent, ctx);
|
|
352
|
+
ctx.logger.info('Got acceptable teams and computed team to parent team mapping.');
|
|
353
|
+
ctx.logger.info('Acceptable teams: ' + JSON.stringify(Array.from(acceptable_teams)));
|
|
354
|
+
ctx.logger.info('Finished computing ownership chains.');
|
|
355
|
+
const newTeamToParent = this.replaceTeamParents(acceptable_teams, teamToParent);
|
|
356
|
+
for (const team of acceptable_teams) {
|
|
357
|
+
if (team != 'all_teams') {
|
|
358
|
+
res.push(this.createOrgTeamRecord(team, newTeamToParent));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
for (const employeeID of Object.keys(this.employeeIDtoRecord)) {
|
|
362
|
+
res.push(...this.createEmployeeRecordList(employeeID, acceptable_teams));
|
|
363
|
+
}
|
|
364
|
+
this.printReport(ctx, acceptable_teams);
|
|
365
|
+
ctx.logger.info(res.length.toString());
|
|
366
|
+
return [res, newTeamToParent];
|
|
367
|
+
}
|
|
368
|
+
async onProcessingComplete(ctx) {
|
|
369
|
+
ctx.logger.info(`Starting 'onProcessingComplete'. Records skipped: '${this.recordCount.skippedRecords}',` +
|
|
370
|
+
` records kept: '${this.recordCount.storedRecords}'.`);
|
|
371
|
+
// Checking orgs to keep / ignore
|
|
372
|
+
this.setOrgsToKeepAndIgnore(ctx);
|
|
373
|
+
const [res, finalTeamToParent] = this.generateFinalRecords(ctx);
|
|
374
|
+
ctx.logger.debug(`final team to parent mapping: ${JSON.stringify(finalTeamToParent)}`);
|
|
375
|
+
return res;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
exports.Customreports = Customreports;
|
|
379
|
+
//# sourceMappingURL=customreports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customreports.js","sourceRoot":"","sources":["../../../src/converters/workday/customreports.ts"],"names":[],"mappings":";;;AACA,qDAAsC;AAEtC,4CAKsB;AACtB,qCAA4E;AAE5E,MAAa,aAAc,SAAQ,qBAAS;IAA5C;;QACW,sBAAiB,GAAoC;YAC5D,UAAU;YACV,cAAc;YACd,mBAAmB;YACnB,cAAc;YACd,oBAAoB;SACrB,CAAC;QACF,WAAM,GAAG,SAAS,CAAC;QACnB,oBAAe,GAAG,WAAW,CAAC;QAC9B,gBAAW,GAAG;YACZ,cAAc,EAAE,CAAC;YACjB,aAAa,EAAE,CAAC;SACjB,CAAC;QACF,uBAAkB,GAAmC,EAAE,CAAC;QACxD,yBAAoB,GAAwC,EAAE,CAAC;QAC/D,gBAAW,GAA4B,EAAE,CAAC;QAC1C,wBAAmB,GAAa,EAAE,CAAC;QACnC,kBAAa,GAAgB,IAAI,GAAG,EAAU,CAAC;QAC/C,yBAAoB,GAAa,EAAE,CAAC;QACpC,iBAAY,GAAG,IAAI,CAAC;QACpB,mBAAc,GAAG,IAAI,CAAC;IA4bxB,CAAC;IA1bC,qDAAqD;IACrD,EAAE,CAAC,MAAqB;;QACtB,OAAO,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE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AC;QACF,iCAAiC;QACjC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,EAAE,iBAAiB,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAChE,GAAG,CAAC,MAAM,CAAC,KAAK,CACd,iCAAiC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CACrE,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAjdD,sCAidC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare type EmployeeRecord = {
|
|
2
|
+
Start_Date: Date;
|
|
3
|
+
Full_Name: string;
|
|
4
|
+
Employee_ID: string;
|
|
5
|
+
Manager_Name: string;
|
|
6
|
+
Manager_ID: string;
|
|
7
|
+
Team_Name: string;
|
|
8
|
+
Termination_Date?: Date;
|
|
9
|
+
Location?: string;
|
|
10
|
+
Email?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type ManagerTimeRecord = {
|
|
13
|
+
Manager_ID: string;
|
|
14
|
+
Timestamp: Date;
|
|
15
|
+
};
|
|
16
|
+
export declare const recordKeyTyping: {
|
|
17
|
+
startdate: string;
|
|
18
|
+
fullname: string;
|
|
19
|
+
employeeid: string;
|
|
20
|
+
managername: string;
|
|
21
|
+
managerid: string;
|
|
22
|
+
teamname: string;
|
|
23
|
+
terminationdate: string;
|
|
24
|
+
location: string;
|
|
25
|
+
email: string;
|
|
26
|
+
};
|