airbyte-faros-destination 0.1.58 → 0.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -57,8 +57,8 @@ import {AirbyteRecord} from 'faros-airbyte-cdk';
57
57
  import {Converter, DestinationModel, DestinationRecord,FarosDestinationRunner,StreamContext} from 'airbyte-faros-destination'
58
58
 
59
59
  class Builds extends Converter {
60
- source: string = 'CustomSource'
61
- destinationModels: ReadonlyArray<DestinationModel> = ['cicd_Build'];
60
+ source = 'CustomSource'
61
+ destinationModels = ['cicd_Build'];
62
62
 
63
63
  id(record: AirbyteRecord): string {
64
64
  return record.record.data.id;
@@ -66,7 +66,7 @@ class Builds extends Converter {
66
66
 
67
67
  async convert(
68
68
  record: AirbyteRecord,
69
- _ctx: StreamContext
69
+ ctx: StreamContext
70
70
  ): Promise<ReadonlyArray<DestinationRecord>> {
71
71
  const build = record.record.data
72
72
  return [
@@ -83,12 +83,13 @@ class Builds extends Converter {
83
83
  ];
84
84
  }
85
85
  }
86
+
86
87
  class Pipelines extends Converter {
87
88
  // similar to the Builds in the example above
88
89
  ...
89
90
  }
90
91
 
91
- // main entry point
92
+ // Main entry point
92
93
  export function mainCommand(): Command {
93
94
  const destinationRunner = new FarosDestinationRunner();
94
95
 
@@ -97,7 +98,6 @@ export function mainCommand(): Command {
97
98
  new Builds(),
98
99
  new Pipelines()
99
100
  );
100
-
101
101
  return destinationRunner.program;
102
102
  }
103
103
  ```
@@ -0,0 +1,8 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { Converter } from '../converter';
3
+ /** AzureActiveDirectory converter base */
4
+ export declare abstract class AzureActiveDirectoryConverter extends Converter {
5
+ source: string;
6
+ /** Almost every Azure Active Directory record have id property */
7
+ id(record: AirbyteRecord): any;
8
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AzureActiveDirectoryConverter = void 0;
4
+ const converter_1 = require("../converter");
5
+ /** AzureActiveDirectory converter base */
6
+ class AzureActiveDirectoryConverter extends converter_1.Converter {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.source = 'AzureActiveDirectory';
10
+ }
11
+ /** Almost every Azure Active Directory record have id property */
12
+ id(record) {
13
+ var _a, _b;
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;
15
+ }
16
+ }
17
+ exports.AzureActiveDirectoryConverter = AzureActiveDirectoryConverter;
@@ -0,0 +1,7 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
3
+ import { AzureActiveDirectoryConverter } from './common';
4
+ export declare class Groups extends AzureActiveDirectoryConverter {
5
+ readonly destinationModels: ReadonlyArray<DestinationModel>;
6
+ convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
7
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Groups = void 0;
4
+ const common_1 = require("./common");
5
+ class Groups extends common_1.AzureActiveDirectoryConverter {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.destinationModels = [
9
+ 'org_Team',
10
+ 'org_TeamMembership',
11
+ ];
12
+ }
13
+ async convert(record, ctx) {
14
+ var _a;
15
+ const source = this.streamName.source;
16
+ const group = record.record.data;
17
+ const res = [];
18
+ const uid = group.id;
19
+ const lead = group.owners.length >= 1
20
+ ? {
21
+ uid: group.owners[0],
22
+ source,
23
+ }
24
+ : undefined;
25
+ res.push({
26
+ model: 'org_Team',
27
+ record: {
28
+ uid,
29
+ name: group.displayName,
30
+ description: group.description,
31
+ lead,
32
+ parentTeam: { uid: 'all_teams' },
33
+ teamChain: ['all_teams'],
34
+ source,
35
+ },
36
+ });
37
+ for (const user of (_a = group.members) !== null && _a !== void 0 ? _a : []) {
38
+ res.push({
39
+ model: 'org_TeamMembership',
40
+ record: {
41
+ team: { uid },
42
+ member: { uid: user },
43
+ },
44
+ });
45
+ }
46
+ return res;
47
+ }
48
+ }
49
+ exports.Groups = Groups;
@@ -0,0 +1,61 @@
1
+ interface UserIdentity {
2
+ signInType?: string;
3
+ issuer: string;
4
+ issuerAssignedId?: string;
5
+ }
6
+ export interface User {
7
+ businessPhones: string[];
8
+ displayName: string;
9
+ givenName: string;
10
+ jobTitle: string;
11
+ mail: string;
12
+ mobilePhone: string;
13
+ officeLocation: string;
14
+ preferredLanguage?: string;
15
+ surname: string;
16
+ userPrincipalName: string;
17
+ id: string;
18
+ department?: string;
19
+ postalCode?: string;
20
+ manager?: string;
21
+ createdDateTime?: string;
22
+ streetAddress?: string;
23
+ identities: UserIdentity[];
24
+ }
25
+ export interface Group {
26
+ id: string;
27
+ deletedDateTime?: string;
28
+ classification?: string;
29
+ createdDateTime: string;
30
+ creationOptions: any[];
31
+ description: string;
32
+ displayName: string;
33
+ expirationDateTime?: string;
34
+ groupTypes: string[];
35
+ isAssignableToRole?: string;
36
+ mail?: string;
37
+ mailEnabled: boolean;
38
+ mailNickname: string;
39
+ membershipRule?: string;
40
+ membershipRuleProcessingState?: string;
41
+ onPremisesDomainName?: string;
42
+ onPremisesLastSyncDateTime?: string;
43
+ onPremisesNetBiosName?: string;
44
+ onPremisesSamAccountName?: string;
45
+ onPremisesSecurityIdentifier?: string;
46
+ onPremisesSyncEnabled?: string;
47
+ preferredDataLocation?: string;
48
+ preferredLanguage?: string;
49
+ proxyAddresses: string[];
50
+ renewedDateTime: Date;
51
+ resourceBehaviorOptions: string[];
52
+ resourceProvisioningOptions: string[];
53
+ securityEnabled: boolean;
54
+ securityIdentifier: string;
55
+ theme?: string;
56
+ visibility?: string;
57
+ onPremisesProvisioningErrors: string[];
58
+ members: string[];
59
+ owners: string[];
60
+ }
61
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
3
+ import { AzureActiveDirectoryConverter } from './common';
4
+ export declare class Users extends AzureActiveDirectoryConverter {
5
+ readonly destinationModels: ReadonlyArray<DestinationModel>;
6
+ private seenDepartments;
7
+ convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
8
+ }
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Users = void 0;
4
+ const faros_feeds_sdk_1 = require("faros-feeds-sdk");
5
+ const common_1 = require("./common");
6
+ class Users extends common_1.AzureActiveDirectoryConverter {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.destinationModels = [
10
+ 'geo_Address',
11
+ 'geo_Location',
12
+ 'identity_Identity',
13
+ 'org_Department',
14
+ 'org_Employee',
15
+ ];
16
+ this.seenDepartments = new Set();
17
+ }
18
+ async convert(record, ctx) {
19
+ const source = this.streamName.source;
20
+ const user = record.record.data;
21
+ const joinedAt = faros_feeds_sdk_1.Utils.toDate(user.createdDateTime);
22
+ const manager = user.manager ? { uid: user.manager, source } : undefined;
23
+ const uid = user.id;
24
+ const res = [];
25
+ if (user.department && !this.seenDepartments.has(user.department)) {
26
+ this.seenDepartments.add(user.department);
27
+ res.push({
28
+ model: 'org_Department',
29
+ record: {
30
+ uid: user.department,
31
+ name: user.department,
32
+ },
33
+ });
34
+ }
35
+ res.push({
36
+ model: 'identity_Identity',
37
+ record: {
38
+ uid,
39
+ fullName: `${user.givenName} ${user.surname}`,
40
+ lastName: user.surname,
41
+ primaryEmail: user.mail,
42
+ emails: [user.mail],
43
+ },
44
+ });
45
+ const location = user.streetAddress
46
+ ? { uid: user.streetAddress, source }
47
+ : undefined;
48
+ if (user.streetAddress) {
49
+ res.push({
50
+ model: 'geo_Address',
51
+ record: {
52
+ uid: user.streetAddress,
53
+ fullAddress: user.streetAddress,
54
+ street: user.streetAddress,
55
+ postalCode: user.postalCode,
56
+ },
57
+ });
58
+ const geo_Location = {
59
+ uid: user.streetAddress,
60
+ name: user.streetAddress,
61
+ raw: user.streetAddress,
62
+ address: { uid: user.streetAddress },
63
+ };
64
+ res.push({ model: 'geo_Location', record: geo_Location });
65
+ }
66
+ res.push({
67
+ model: 'org_Employee',
68
+ record: {
69
+ uid,
70
+ title: user.displayName,
71
+ level: 0,
72
+ joinedAt,
73
+ department: { uid: user.department },
74
+ identity: { uid, source },
75
+ manager,
76
+ location,
77
+ source,
78
+ },
79
+ });
80
+ return res;
81
+ }
82
+ }
83
+ exports.Users = Users;
@@ -12,10 +12,15 @@ export interface CategoryRef {
12
12
  readonly category: string;
13
13
  readonly detail: string;
14
14
  }
15
+ export interface ProjectKey {
16
+ uid: string;
17
+ source: string;
18
+ }
15
19
  /** Common functions shares across Bitbucket converters */
16
20
  export declare class BitbucketCommon {
17
21
  static MAX_DESCRIPTION_LENGTH: number;
18
22
  static vcsUser(user: User, source: string): DestinationRecord | undefined;
23
+ static tms_ProjectBoard_with_TaskBoard(projectKey: ProjectKey, name: string, description: string | null, createdAt: string | null | undefined, updatedAt: string | null | undefined): DestinationRecord[];
19
24
  }
20
25
  /** Bitbucket converter base */
21
26
  export declare abstract class BitbucketConverter extends Converter {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BitbucketConverter = exports.BitbucketCommon = void 0;
4
+ const faros_feeds_sdk_1 = require("faros-feeds-sdk");
4
5
  const converter_1 = require("../converter");
5
6
  var UserTypeCategory;
6
7
  (function (UserTypeCategory) {
@@ -29,6 +30,34 @@ class BitbucketCommon {
29
30
  },
30
31
  };
31
32
  }
33
+ static tms_ProjectBoard_with_TaskBoard(projectKey, name, description, createdAt, updatedAt) {
34
+ return [
35
+ {
36
+ model: 'tms_Project',
37
+ record: {
38
+ ...projectKey,
39
+ name: name,
40
+ description: description === null || description === void 0 ? void 0 : description.substring(0, BitbucketCommon.MAX_DESCRIPTION_LENGTH),
41
+ createdAt: faros_feeds_sdk_1.Utils.toDate(createdAt),
42
+ updatedAt: faros_feeds_sdk_1.Utils.toDate(updatedAt),
43
+ },
44
+ },
45
+ {
46
+ model: 'tms_TaskBoard',
47
+ record: {
48
+ ...projectKey,
49
+ name,
50
+ },
51
+ },
52
+ {
53
+ model: 'tms_TaskBoardProjectRelationship',
54
+ record: {
55
+ board: projectKey,
56
+ project: projectKey,
57
+ },
58
+ },
59
+ ];
60
+ }
32
61
  }
33
62
  exports.BitbucketCommon = BitbucketCommon;
34
63
  // max length for free-form description text field
@@ -24,6 +24,8 @@ class Issues extends common_1.BitbucketConverter {
24
24
  this.destinationModels = [
25
25
  'tms_Task',
26
26
  'tms_TaskAssignment',
27
+ 'tms_TaskProjectRelationship',
28
+ 'tms_TaskBoardRelationship',
27
29
  'tms_User',
28
30
  ];
29
31
  this.workspacesStream = new converter_1.StreamName('bitbucket', 'workspace');
@@ -52,6 +54,21 @@ class Issues extends common_1.BitbucketConverter {
52
54
  },
53
55
  });
54
56
  }
57
+ const projectRef = { uid: String(issue.repository.name), source };
58
+ res.push({
59
+ model: 'tms_TaskProjectRelationship',
60
+ record: {
61
+ task: taskRef,
62
+ project: projectRef,
63
+ },
64
+ });
65
+ res.push({
66
+ model: 'tms_TaskBoardRelationship',
67
+ record: {
68
+ task: taskRef,
69
+ board: projectRef,
70
+ },
71
+ });
55
72
  res.push({
56
73
  model: 'tms_Task',
57
74
  record: {
@@ -1,9 +1,7 @@
1
1
  import { AirbyteRecord } from 'faros-airbyte-cdk';
2
- import { DestinationModel, DestinationRecord, StreamContext, StreamName } from '../converter';
2
+ import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
3
3
  import { BitbucketConverter } from './common';
4
4
  export declare class Repositories extends BitbucketConverter {
5
5
  readonly destinationModels: ReadonlyArray<DestinationModel>;
6
- private readonly workspacesStream;
7
- get dependencies(): ReadonlyArray<StreamName>;
8
6
  convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
9
7
  }
@@ -1,41 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Repositories = void 0;
4
- const converter_1 = require("../converter");
4
+ const faros_feeds_sdk_1 = require("faros-feeds-sdk");
5
5
  const common_1 = require("./common");
6
6
  class Repositories extends common_1.BitbucketConverter {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  this.destinationModels = [
10
10
  'cicd_Repository',
11
+ 'vcs_Repository',
12
+ 'tms_Project',
13
+ 'tms_TaskBoard',
14
+ 'tms_TaskBoardProjectRelationship',
11
15
  ];
12
- this.workspacesStream = new converter_1.StreamName('bitbucket', 'workspace');
13
- }
14
- get dependencies() {
15
- return [this.workspacesStream];
16
16
  }
17
17
  async convert(record, ctx) {
18
- var _a, _b;
18
+ var _a, _b, _c, _d, _e;
19
19
  const source = this.streamName.source;
20
20
  const repository = record.record.data;
21
- const workspacesStream = this.workspacesStream.asString;
22
- const workspacesRecord = ctx.get(workspacesStream, repository.workspace.uuid);
23
- const workspace = (_a = workspacesRecord === null || workspacesRecord === void 0 ? void 0 : workspacesRecord.record) === null || _a === void 0 ? void 0 : _a.data;
24
- if (!workspace) {
25
- return [];
26
- }
27
- return [
28
- {
29
- model: 'cicd_Repository',
30
- record: {
31
- uid: repository.slug.toLowerCase(),
32
- name: repository.name,
33
- description: (_b = repository.description) === null || _b === void 0 ? void 0 : _b.substring(0, common_1.BitbucketCommon.MAX_DESCRIPTION_LENGTH),
34
- url: repository.links.htmlUrl,
35
- organization: { uid: workspace === null || workspace === void 0 ? void 0 : workspace.uuid, source },
36
- },
21
+ const workspace = repository.workspace;
22
+ const res = [];
23
+ const description = (_a = repository.description) === null || _a === void 0 ? void 0 : _a.substring(0, common_1.BitbucketCommon.MAX_DESCRIPTION_LENGTH);
24
+ // Create a TMS Project/Board per repo that we sync
25
+ res.push(...common_1.BitbucketCommon.tms_ProjectBoard_with_TaskBoard({ uid: repository.name, source }, repository.name, repository.description, repository.createdOn, repository.updatedOn));
26
+ res.push({
27
+ model: 'cicd_Repository',
28
+ record: {
29
+ uid: repository.slug.toLowerCase(),
30
+ name: repository.fullName,
31
+ description,
32
+ url: (_b = repository === null || repository === void 0 ? void 0 : repository.links) === null || _b === void 0 ? void 0 : _b.htmlUrl,
33
+ organization: { uid: workspace.uuid, source },
37
34
  },
38
- ];
35
+ });
36
+ res.push({
37
+ model: 'vcs_Repository',
38
+ record: {
39
+ name: repository.slug.toLowerCase(),
40
+ fullName: repository.fullName,
41
+ description,
42
+ private: repository.isPrivate,
43
+ language: (_c = repository.language) !== null && _c !== void 0 ? _c : null,
44
+ size: BigInt(repository.size),
45
+ htmlUrl: (_d = repository === null || repository === void 0 ? void 0 : repository.links) === null || _d === void 0 ? void 0 : _d.htmlUrl,
46
+ createdAt: faros_feeds_sdk_1.Utils.toDate(repository.createdOn),
47
+ updatedAt: faros_feeds_sdk_1.Utils.toDate(repository.updatedOn),
48
+ mainBranch: (_e = repository.mainBranch) === null || _e === void 0 ? void 0 : _e.name,
49
+ organization: { uid: workspace.uuid, source },
50
+ },
51
+ });
52
+ return res;
39
53
  }
40
54
  }
41
55
  exports.Repositories = Repositories;
@@ -19,7 +19,7 @@ export declare class ConverterRegistry {
19
19
  */
20
20
  static getConverter(streamName: StreamName, onLoadError?: (err: Error) => void): Converter | undefined;
21
21
  /**
22
- * Add a convertor to the registory.
22
+ * Add a convertor to the registry.
23
23
  */
24
24
  static addConverter(converter: Converter): void;
25
25
  }
@@ -53,7 +53,7 @@ class ConverterRegistry {
53
53
  }
54
54
  }
55
55
  /**
56
- * Add a convertor to the registory.
56
+ * Add a convertor to the registry.
57
57
  */
58
58
  static addConverter(converter) {
59
59
  const name = converter.streamName.asString;
@@ -2,19 +2,28 @@ import { AirbyteConfig, AirbyteLogger, AirbyteRecord } from 'faros-airbyte-cdk';
2
2
  import { FarosClient } from 'faros-feeds-sdk';
3
3
  import { Dictionary } from 'ts-essentials';
4
4
  /** Airbyte -> Faros record converter */
5
- export declare abstract class Converter {
5
+ export declare abstract class ConverterTyped<R> {
6
6
  private stream;
7
7
  /** Name of the source system that records were fetched from (e.g. GitHub) **/
8
8
  abstract readonly source: string;
9
9
  /** Input stream supported by converter */
10
10
  get streamName(): StreamName;
11
+ /** Dependencies on other streams (if any).
12
+ * !!! USE WITH CAUTION !!! Will result in increased memory usage
13
+ * due to accumulation of records in StreamContext (ctx) */
11
14
  get dependencies(): ReadonlyArray<StreamName>;
12
15
  /** Function to extract record id */
13
16
  abstract id(record: AirbyteRecord): any;
14
17
  /** All the record models produced by converter */
15
18
  abstract get destinationModels(): ReadonlyArray<DestinationModel>;
16
- /** Function converts an input Airbyte record to Faros destination canonical record */
17
- abstract convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
19
+ /** Function to convert an input Airbyte record to Faros Destination canonical record(s) */
20
+ abstract convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecordTyped<R>>>;
21
+ /** On processing complete handler called by the Faros Destination
22
+ * after the input processing is complete.
23
+ * Use this to release any resources or produce any additional records if necessary. */
24
+ onProcessingComplete(ctx: StreamContext): Promise<ReadonlyArray<DestinationRecordTyped<R>>>;
25
+ }
26
+ export declare abstract class Converter extends ConverterTyped<Dictionary<any>> {
18
27
  }
19
28
  export declare function parseObjectConfig<T>(obj: any, name: string): T | undefined;
20
29
  /** Stream context to store records by stream and other helpers */
@@ -56,9 +65,10 @@ export declare class StreamName {
56
65
  * }
57
66
  * }
58
67
  */
59
- export declare type DestinationRecord = {
68
+ export declare type DestinationRecordTyped<R extends Dictionary<any>> = {
60
69
  readonly model: DestinationModel;
61
- readonly record: Dictionary<any>;
70
+ readonly record: R;
62
71
  };
72
+ export declare type DestinationRecord = DestinationRecordTyped<Dictionary<any>>;
63
73
  /** Faros destination model name, e.g identity_Identity, vcs_Commit */
64
74
  export declare type DestinationModel = string;
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.StreamName = exports.StreamNameSeparator = exports.StreamContext = exports.parseObjectConfig = exports.Converter = void 0;
6
+ exports.StreamName = exports.StreamNameSeparator = exports.StreamContext = exports.parseObjectConfig = exports.Converter = exports.ConverterTyped = void 0;
7
7
  const lodash_1 = require("lodash");
8
8
  const object_sizeof_1 = __importDefault(require("object-sizeof"));
9
9
  const verror_1 = require("verror");
10
10
  /** Airbyte -> Faros record converter */
11
- class Converter {
11
+ class ConverterTyped {
12
12
  /** Input stream supported by converter */
13
13
  get streamName() {
14
14
  if (this.stream)
@@ -16,12 +16,21 @@ class Converter {
16
16
  this.stream = StreamName.fromString(`${this.source}${exports.StreamNameSeparator}${(0, lodash_1.snakeCase)(this.constructor.name)}`);
17
17
  return this.stream;
18
18
  }
19
- // Dependencies on other streams (if any).
20
- // !!! Use with caution !!! Will result in increased memory usage
21
- // due to accumulation of records in StreamContext (ctx)
19
+ /** Dependencies on other streams (if any).
20
+ * !!! USE WITH CAUTION !!! Will result in increased memory usage
21
+ * due to accumulation of records in StreamContext (ctx) */
22
22
  get dependencies() {
23
23
  return [];
24
24
  }
25
+ /** On processing complete handler called by the Faros Destination
26
+ * after the input processing is complete.
27
+ * Use this to release any resources or produce any additional records if necessary. */
28
+ async onProcessingComplete(ctx) {
29
+ return [];
30
+ }
31
+ }
32
+ exports.ConverterTyped = ConverterTyped;
33
+ class Converter extends ConverterTyped {
25
34
  }
26
35
  exports.Converter = Converter;
27
36
  // Helper function for reading object type configurations that
@@ -1,5 +1,5 @@
1
1
  import { AirbyteRecord } from 'faros-airbyte-cdk';
2
- import { Converter } from '../converter';
2
+ import { Converter, DestinationRecord } from '../converter';
3
3
  export interface CategoryRef {
4
4
  readonly category: string;
5
5
  readonly detail: string;
@@ -16,6 +16,7 @@ interface RepositoryKey {
16
16
  /** Common functions shares across GitLab converters */
17
17
  export declare class GitlabCommon {
18
18
  static readonly MAX_DESCRIPTION_LENGTH = 1000;
19
+ static tms_ProjectBoard_with_TaskBoard(projectKey: ProjectKey, name: string, description: string | null, createdAt: string | null | undefined, updatedAt: string | null | undefined): DestinationRecord[];
19
20
  static parseRepositoryKey(webUrl: string | undefined, source: string, startIndex?: number): undefined | RepositoryKey;
20
21
  static convertBuildStatus(status?: string): CategoryRef;
21
22
  }
@@ -27,4 +28,8 @@ export declare abstract class GitlabConverter extends Converter {
27
28
  */
28
29
  id(record: AirbyteRecord): any;
29
30
  }
31
+ export interface ProjectKey {
32
+ uid: string;
33
+ source: string;
34
+ }
30
35
  export {};
@@ -1,9 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GitlabConverter = exports.GitlabCommon = void 0;
4
+ const faros_feeds_sdk_1 = require("faros-feeds-sdk");
4
5
  const converter_1 = require("../converter");
5
6
  /** Common functions shares across GitLab converters */
6
7
  class GitlabCommon {
8
+ static tms_ProjectBoard_with_TaskBoard(projectKey, name, description, createdAt, updatedAt) {
9
+ return [
10
+ {
11
+ model: 'tms_Project',
12
+ record: {
13
+ ...projectKey,
14
+ name: name,
15
+ description: description === null || description === void 0 ? void 0 : description.substring(0, GitlabCommon.MAX_DESCRIPTION_LENGTH),
16
+ createdAt: faros_feeds_sdk_1.Utils.toDate(createdAt),
17
+ updatedAt: faros_feeds_sdk_1.Utils.toDate(updatedAt),
18
+ },
19
+ },
20
+ {
21
+ model: 'tms_TaskBoard',
22
+ record: {
23
+ ...projectKey,
24
+ name,
25
+ },
26
+ },
27
+ {
28
+ model: 'tms_TaskBoardProjectRelationship',
29
+ record: {
30
+ board: projectKey,
31
+ project: projectKey,
32
+ },
33
+ },
34
+ ];
35
+ }
7
36
  static parseRepositoryKey(webUrl, source, startIndex = 3) {
8
37
  if (!webUrl)
9
38
  return undefined;