faros-airbyte-common 0.14.13 → 0.15.0
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/azure-devops/azure-devops.d.ts +40 -0
- package/lib/azure-devops/azure-devops.js +264 -0
- package/lib/azure-devops/azure-devops.js.map +1 -0
- package/lib/azure-devops/index.d.ts +2 -0
- package/lib/azure-devops/index.js +21 -0
- package/lib/azure-devops/index.js.map +1 -0
- package/lib/azure-devops/types.d.ts +111 -0
- package/lib/azure-devops/types.js +3 -0
- package/lib/azure-devops/types.js.map +1 -0
- package/lib/bitbucket/index.d.ts +1 -0
- package/lib/bitbucket/index.js +18 -0
- package/lib/bitbucket/index.js.map +1 -0
- package/lib/bitbucket/types.d.ts +547 -0
- package/lib/bitbucket/types.js +3 -0
- package/lib/bitbucket/types.js.map +1 -0
- package/lib/bitbucket-server/index.d.ts +127 -0
- package/lib/bitbucket-server/index.js +23 -0
- package/lib/bitbucket-server/index.js.map +1 -0
- package/lib/circleci/index.d.ts +1 -0
- package/lib/circleci/index.js +18 -0
- package/lib/circleci/index.js.map +1 -0
- package/lib/circleci/types.d.ts +86 -0
- package/lib/circleci/types.js +3 -0
- package/lib/circleci/types.js.map +1 -0
- package/lib/clickup/index.d.ts +1 -0
- package/lib/clickup/index.js +18 -0
- package/lib/clickup/index.js.map +1 -0
- package/lib/clickup/types.d.ts +292 -0
- package/lib/clickup/types.js +3 -0
- package/lib/clickup/types.js.map +1 -0
- package/lib/common/bucket-set.d.ts +6 -0
- package/lib/common/bucket-set.js +71 -0
- package/lib/common/bucket-set.js.map +1 -0
- package/lib/common/bucketing.d.ts +20 -0
- package/lib/common/bucketing.js +67 -0
- package/lib/common/bucketing.js.map +1 -0
- package/lib/common/index.d.ts +25 -0
- package/lib/common/index.js +126 -0
- package/lib/common/index.js.map +1 -0
- package/lib/github/codegen.d.ts +3 -0
- package/lib/github/codegen.js +39 -0
- package/lib/github/codegen.js.map +1 -0
- package/lib/github/generated/index.d.ts +8241 -0
- package/lib/github/generated/index.js +3257 -0
- package/lib/github/generated/index.js.map +1 -0
- package/lib/github/index.d.ts +1 -0
- package/lib/github/index.js +18 -0
- package/lib/github/index.js.map +1 -0
- package/lib/github/queries.d.ts +16 -0
- package/lib/github/queries.js +47 -0
- package/lib/github/queries.js.map +1 -0
- package/lib/github/types.d.ts +213 -0
- package/lib/github/types.js +10 -0
- package/lib/github/types.js.map +1 -0
- package/lib/jira/index.d.ts +1 -0
- package/lib/jira/index.js +18 -0
- package/lib/jira/index.js.map +1 -0
- package/lib/jira/types.d.ts +140 -0
- package/lib/jira/types.js +12 -0
- package/lib/jira/types.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/vanta/index.d.ts +1 -0
- package/lib/vanta/index.js +18 -0
- package/lib/vanta/index.js.map +1 -0
- package/lib/vanta/types.d.ts +73 -0
- package/lib/vanta/types.js +3 -0
- package/lib/vanta/types.js.map +1 -0
- package/lib/wolken/index.d.ts +1 -0
- package/lib/wolken/index.js +18 -0
- package/lib/wolken/index.js.map +1 -0
- package/lib/wolken/types.d.ts +130 -0
- package/lib/wolken/types.js +3 -0
- package/lib/wolken/types.js.map +1 -0
- package/lib/xray/index.d.ts +1 -0
- package/lib/xray/index.js +18 -0
- package/lib/xray/index.js.map +1 -0
- package/lib/xray/types.d.ts +73 -0
- package/lib/xray/types.js +3 -0
- package/lib/xray/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/circleci/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export interface Project {
|
|
2
|
+
slug: string;
|
|
3
|
+
organization_name: string;
|
|
4
|
+
organization_id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
id: string;
|
|
7
|
+
organization_slug: string;
|
|
8
|
+
vcs_info: VcsInfo;
|
|
9
|
+
}
|
|
10
|
+
export interface VcsInfo {
|
|
11
|
+
vcs_url: string;
|
|
12
|
+
provider: string;
|
|
13
|
+
default_branch: string;
|
|
14
|
+
}
|
|
15
|
+
export interface Actor {
|
|
16
|
+
login: string;
|
|
17
|
+
avatar_url: string;
|
|
18
|
+
}
|
|
19
|
+
export interface Trigger {
|
|
20
|
+
received_at: Date;
|
|
21
|
+
type: string;
|
|
22
|
+
actor: Actor;
|
|
23
|
+
}
|
|
24
|
+
export interface Vcs {
|
|
25
|
+
origin_repository_url: string;
|
|
26
|
+
target_repository_url: string;
|
|
27
|
+
revision: string;
|
|
28
|
+
provider_name: string;
|
|
29
|
+
branch: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Pipeline {
|
|
32
|
+
id: string;
|
|
33
|
+
errors: any[];
|
|
34
|
+
project_slug: string;
|
|
35
|
+
updated_at: string;
|
|
36
|
+
number: number;
|
|
37
|
+
state: string;
|
|
38
|
+
created_at: string;
|
|
39
|
+
trigger: Trigger;
|
|
40
|
+
vcs: Vcs;
|
|
41
|
+
workflows: Workflow[];
|
|
42
|
+
computedProperties: {
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface Workflow {
|
|
47
|
+
pipeline_id: string;
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
project_slug: string;
|
|
51
|
+
status: string;
|
|
52
|
+
started_by: string;
|
|
53
|
+
pipeline_number: number;
|
|
54
|
+
created_at: string;
|
|
55
|
+
stopped_at: string;
|
|
56
|
+
jobs: Job[];
|
|
57
|
+
}
|
|
58
|
+
export interface Job {
|
|
59
|
+
dependencies: any[];
|
|
60
|
+
job_number: number;
|
|
61
|
+
id: string;
|
|
62
|
+
started_at: string;
|
|
63
|
+
name: string;
|
|
64
|
+
project_slug: string;
|
|
65
|
+
status: string;
|
|
66
|
+
type: string;
|
|
67
|
+
stopped_at: string;
|
|
68
|
+
}
|
|
69
|
+
export interface TestMetadata {
|
|
70
|
+
pipeline_id: string;
|
|
71
|
+
pipeline_vcs: Vcs;
|
|
72
|
+
project_slug: string;
|
|
73
|
+
workflow_id: string;
|
|
74
|
+
workflow_name: string;
|
|
75
|
+
job_id: string;
|
|
76
|
+
job_number: number;
|
|
77
|
+
job_started_at: string;
|
|
78
|
+
job_stopped_at: string;
|
|
79
|
+
message: string;
|
|
80
|
+
source: string;
|
|
81
|
+
run_time: number;
|
|
82
|
+
file: string;
|
|
83
|
+
result: string;
|
|
84
|
+
name: string;
|
|
85
|
+
classname: string;
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/circleci/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clickup/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
export interface Workspace {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
color: string;
|
|
5
|
+
avatar: string;
|
|
6
|
+
members: readonly Member[];
|
|
7
|
+
}
|
|
8
|
+
interface Member {
|
|
9
|
+
user: User;
|
|
10
|
+
}
|
|
11
|
+
interface User {
|
|
12
|
+
id: number;
|
|
13
|
+
username: string;
|
|
14
|
+
email: string;
|
|
15
|
+
color: string;
|
|
16
|
+
profilePicture: string;
|
|
17
|
+
initials: string;
|
|
18
|
+
role: number;
|
|
19
|
+
last_active: string;
|
|
20
|
+
date_joined: string;
|
|
21
|
+
date_invited: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Space {
|
|
24
|
+
computedProperties: {
|
|
25
|
+
workspace: {
|
|
26
|
+
id: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
private: boolean;
|
|
32
|
+
statuses: ReadonlyArray<Status>;
|
|
33
|
+
multiple_assignees: boolean;
|
|
34
|
+
features: Features;
|
|
35
|
+
}
|
|
36
|
+
interface Features {
|
|
37
|
+
due_dates: DueDates;
|
|
38
|
+
time_tracking: Checklists;
|
|
39
|
+
tags: Checklists;
|
|
40
|
+
time_estimates: Checklists;
|
|
41
|
+
checklists: Checklists;
|
|
42
|
+
custom_fields: Checklists;
|
|
43
|
+
remap_dependencies: Checklists;
|
|
44
|
+
dependency_warning: Checklists;
|
|
45
|
+
portfolios: Checklists;
|
|
46
|
+
}
|
|
47
|
+
interface Checklists {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
}
|
|
50
|
+
interface DueDates {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
start_date: boolean;
|
|
53
|
+
remap_due_dates: boolean;
|
|
54
|
+
remap_closed_due_date: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface Folder {
|
|
57
|
+
computedProperties: {
|
|
58
|
+
workspace: {
|
|
59
|
+
id: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
orderindex: number;
|
|
65
|
+
override_statuses: boolean;
|
|
66
|
+
hidden: boolean;
|
|
67
|
+
space: {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
access: boolean;
|
|
71
|
+
};
|
|
72
|
+
task_count: string;
|
|
73
|
+
lists: readonly any[];
|
|
74
|
+
}
|
|
75
|
+
export interface List {
|
|
76
|
+
computedProperties: {
|
|
77
|
+
workspace: {
|
|
78
|
+
id: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
orderindex: number;
|
|
84
|
+
content: string;
|
|
85
|
+
status: {
|
|
86
|
+
status: string;
|
|
87
|
+
color: string;
|
|
88
|
+
hide_label: boolean;
|
|
89
|
+
};
|
|
90
|
+
priority: {
|
|
91
|
+
priority: string;
|
|
92
|
+
color: string;
|
|
93
|
+
};
|
|
94
|
+
assignee: any;
|
|
95
|
+
task_count: any;
|
|
96
|
+
due_date: string;
|
|
97
|
+
start_date: any;
|
|
98
|
+
folder: {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
hidden?: boolean;
|
|
102
|
+
access: boolean;
|
|
103
|
+
};
|
|
104
|
+
space: {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
access: boolean;
|
|
108
|
+
};
|
|
109
|
+
archived: boolean;
|
|
110
|
+
override_statuses: boolean;
|
|
111
|
+
permission_level: string;
|
|
112
|
+
}
|
|
113
|
+
interface Status {
|
|
114
|
+
status: string;
|
|
115
|
+
color: string;
|
|
116
|
+
orderindex: number;
|
|
117
|
+
type: string;
|
|
118
|
+
}
|
|
119
|
+
export interface Task {
|
|
120
|
+
computedProperties: {
|
|
121
|
+
workspace: {
|
|
122
|
+
id: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
id: string;
|
|
126
|
+
custom_id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
text_content: string;
|
|
129
|
+
description: string;
|
|
130
|
+
status: Status;
|
|
131
|
+
orderindex: string;
|
|
132
|
+
date_created: string;
|
|
133
|
+
date_updated: string;
|
|
134
|
+
date_closed: string;
|
|
135
|
+
archived: boolean;
|
|
136
|
+
creator: Creator;
|
|
137
|
+
assignees: readonly Creator[];
|
|
138
|
+
watchers: readonly Creator[];
|
|
139
|
+
checklists: readonly Checklist[];
|
|
140
|
+
tags: readonly Tag[];
|
|
141
|
+
parent: string;
|
|
142
|
+
priority: string | {
|
|
143
|
+
color: string;
|
|
144
|
+
id: string;
|
|
145
|
+
orderindex: string;
|
|
146
|
+
priority: string;
|
|
147
|
+
};
|
|
148
|
+
due_date: string;
|
|
149
|
+
start_date: string;
|
|
150
|
+
points: number;
|
|
151
|
+
time_estimate: number;
|
|
152
|
+
custom_fields: readonly CustomField[];
|
|
153
|
+
dependencies: readonly any[];
|
|
154
|
+
linked_tasks: readonly {
|
|
155
|
+
task_id: string;
|
|
156
|
+
link_id: string;
|
|
157
|
+
date_created: string;
|
|
158
|
+
userid: string;
|
|
159
|
+
workspace_id: string;
|
|
160
|
+
}[];
|
|
161
|
+
team_id: string;
|
|
162
|
+
url: string;
|
|
163
|
+
permission_level: string;
|
|
164
|
+
list: FolderRef;
|
|
165
|
+
project: FolderRef;
|
|
166
|
+
folder: FolderRef;
|
|
167
|
+
space: SpaceRef;
|
|
168
|
+
}
|
|
169
|
+
interface Creator {
|
|
170
|
+
id: number;
|
|
171
|
+
username: string;
|
|
172
|
+
color: string;
|
|
173
|
+
email: string;
|
|
174
|
+
profilePicture: string;
|
|
175
|
+
}
|
|
176
|
+
interface Checklist {
|
|
177
|
+
id: string;
|
|
178
|
+
task_id: string;
|
|
179
|
+
name: string;
|
|
180
|
+
date_created: string;
|
|
181
|
+
orderindex: number;
|
|
182
|
+
creator: number;
|
|
183
|
+
resolved: number;
|
|
184
|
+
unresolved: number;
|
|
185
|
+
items: readonly Item[];
|
|
186
|
+
}
|
|
187
|
+
interface Item {
|
|
188
|
+
id: string;
|
|
189
|
+
name: string;
|
|
190
|
+
orderindex: number;
|
|
191
|
+
assignee: any;
|
|
192
|
+
resolved: boolean;
|
|
193
|
+
parent: any;
|
|
194
|
+
date_created: string;
|
|
195
|
+
children: readonly any[];
|
|
196
|
+
}
|
|
197
|
+
interface CustomField {
|
|
198
|
+
id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
type: string;
|
|
201
|
+
type_config: Record<string, unknown>;
|
|
202
|
+
date_created: string;
|
|
203
|
+
hide_from_guests: boolean;
|
|
204
|
+
required: boolean;
|
|
205
|
+
value: any;
|
|
206
|
+
}
|
|
207
|
+
interface FolderRef {
|
|
208
|
+
id: string;
|
|
209
|
+
name: string;
|
|
210
|
+
hidden?: boolean;
|
|
211
|
+
access: boolean;
|
|
212
|
+
}
|
|
213
|
+
interface SpaceRef {
|
|
214
|
+
id: string;
|
|
215
|
+
}
|
|
216
|
+
interface Tag {
|
|
217
|
+
name: string;
|
|
218
|
+
tag_fg: string;
|
|
219
|
+
tag_bg: string;
|
|
220
|
+
}
|
|
221
|
+
export interface Goal {
|
|
222
|
+
computedProperties: {
|
|
223
|
+
workspace: {
|
|
224
|
+
id: string;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
id: string;
|
|
228
|
+
name: string;
|
|
229
|
+
team_id: string;
|
|
230
|
+
date_created: string;
|
|
231
|
+
start_date: any;
|
|
232
|
+
due_date: string;
|
|
233
|
+
description: string;
|
|
234
|
+
private: boolean;
|
|
235
|
+
archived: boolean;
|
|
236
|
+
creator: number;
|
|
237
|
+
color: string;
|
|
238
|
+
pretty_id: string;
|
|
239
|
+
multiple_owners: boolean;
|
|
240
|
+
folder_id: any;
|
|
241
|
+
members: readonly any[];
|
|
242
|
+
owners: readonly Owner[];
|
|
243
|
+
key_results: readonly {
|
|
244
|
+
task_ids: readonly string[];
|
|
245
|
+
subcategory_ids: readonly string[];
|
|
246
|
+
}[];
|
|
247
|
+
percent_completed: number;
|
|
248
|
+
history: readonly any[];
|
|
249
|
+
pretty_url: string;
|
|
250
|
+
}
|
|
251
|
+
interface Owner {
|
|
252
|
+
id: number;
|
|
253
|
+
username: string;
|
|
254
|
+
initials: string;
|
|
255
|
+
email: string;
|
|
256
|
+
color: string;
|
|
257
|
+
profilePicture: string;
|
|
258
|
+
}
|
|
259
|
+
export interface StatusHistory {
|
|
260
|
+
computedProperties: {
|
|
261
|
+
task: {
|
|
262
|
+
id: string;
|
|
263
|
+
archived: boolean;
|
|
264
|
+
date_updated: string;
|
|
265
|
+
list: {
|
|
266
|
+
id: string;
|
|
267
|
+
};
|
|
268
|
+
workspace: {
|
|
269
|
+
id: string;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
current_status: {
|
|
274
|
+
status: string;
|
|
275
|
+
color: string;
|
|
276
|
+
total_time: {
|
|
277
|
+
by_minute: number;
|
|
278
|
+
since: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
status_history: readonly {
|
|
282
|
+
status: string;
|
|
283
|
+
color: string;
|
|
284
|
+
type: string;
|
|
285
|
+
total_time: {
|
|
286
|
+
by_minute: string;
|
|
287
|
+
since: string;
|
|
288
|
+
};
|
|
289
|
+
orderindex: number;
|
|
290
|
+
}[];
|
|
291
|
+
}
|
|
292
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/clickup/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BucketSet = void 0;
|
|
7
|
+
const verror_1 = __importDefault(require("verror"));
|
|
8
|
+
class BucketSet {
|
|
9
|
+
constructor(bucketTotal, bucketRanges) {
|
|
10
|
+
if (bucketTotal < 1) {
|
|
11
|
+
throw new verror_1.default('bucket_total must be a positive integer');
|
|
12
|
+
}
|
|
13
|
+
const rangeStrings = (typeof bucketRanges === 'string' ? bucketRanges.split(',') : bucketRanges).filter((s) => s.trim());
|
|
14
|
+
if (!(rangeStrings === null || rangeStrings === void 0 ? void 0 : rangeStrings.length)) {
|
|
15
|
+
throw new verror_1.default('bucket_ranges cannot be empty');
|
|
16
|
+
}
|
|
17
|
+
const buckets = new Set();
|
|
18
|
+
for (const range of rangeStrings) {
|
|
19
|
+
const [start, end] = this.parseRange(range);
|
|
20
|
+
if (start < 1 || end > bucketTotal) {
|
|
21
|
+
throw new verror_1.default(`Invalid bucket range ${range}: values must be between 1 and ${bucketTotal}`);
|
|
22
|
+
}
|
|
23
|
+
for (let i = start; i <= end; i++) {
|
|
24
|
+
buckets.add(i);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
this.sortedBuckets = Array.from(buckets).sort((a, b) => a - b);
|
|
28
|
+
}
|
|
29
|
+
parseRange(range) {
|
|
30
|
+
const parts = range.split('-').map((p) => p.trim());
|
|
31
|
+
if (parts.length > 2) {
|
|
32
|
+
throw new verror_1.default(`Invalid range format: ${range}. Valid formats are: single number (e.g., '7') or number range (e.g., '3-5')`);
|
|
33
|
+
}
|
|
34
|
+
const start = parseInt(parts[0]);
|
|
35
|
+
if (isNaN(start)) {
|
|
36
|
+
throw new verror_1.default(`Invalid number in range: ${parts[0]}`);
|
|
37
|
+
}
|
|
38
|
+
// If it's a single number, both start and end are the same
|
|
39
|
+
if (parts.length === 1) {
|
|
40
|
+
return [start, start];
|
|
41
|
+
}
|
|
42
|
+
const end = parseInt(parts[1]);
|
|
43
|
+
if (isNaN(end)) {
|
|
44
|
+
throw new verror_1.default(`Invalid number in range: ${parts[1]}`);
|
|
45
|
+
}
|
|
46
|
+
if (end < start) {
|
|
47
|
+
throw new verror_1.default(`Invalid range ${range}: end cannot be less than start`);
|
|
48
|
+
}
|
|
49
|
+
return [start, end];
|
|
50
|
+
}
|
|
51
|
+
next(bucketId) {
|
|
52
|
+
let low = 0;
|
|
53
|
+
let high = this.sortedBuckets.length - 1;
|
|
54
|
+
while (low <= high) {
|
|
55
|
+
const mid = Math.floor((low + high) / 2);
|
|
56
|
+
if (this.sortedBuckets[mid] <= bucketId) {
|
|
57
|
+
low = mid + 1;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
high = mid - 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (low < this.sortedBuckets.length) {
|
|
64
|
+
return this.sortedBuckets[low];
|
|
65
|
+
}
|
|
66
|
+
// Wrap around to first bucket if no larger bucket found
|
|
67
|
+
return this.sortedBuckets[0];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.BucketSet = BucketSet;
|
|
71
|
+
//# sourceMappingURL=bucket-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bucket-set.js","sourceRoot":"","sources":["../../src/common/bucket-set.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,MAAa,SAAS;IAGpB,YACE,WAAmB,EACnB,YAA4C;QAE5C,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,gBAAM,CAAC,yCAAyC,CAAC,CAAC;QAC9D,CAAC;QAED,MAAM,YAAY,GAAG,CACnB,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAC1E,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAE1B,IAAI,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,CAAA,EAAE,CAAC;YAC1B,MAAM,IAAI,gBAAM,CAAC,+BAA+B,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAElC,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;YACjC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAE5C,IAAI,KAAK,GAAG,CAAC,IAAI,GAAG,GAAG,WAAW,EAAE,CAAC;gBACnC,MAAM,IAAI,gBAAM,CACd,wBAAwB,KAAK,kCAAkC,WAAW,EAAE,CAC7E,CAAC;YACJ,CAAC;YAED,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,E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CAAC;QAC5E,CAAC;QAED,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,QAAgB;QACnB,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;QACzC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;YACnB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YACzC,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,QAAQ,EAAE,CAAC;gBACxC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;YACjB,CAAC;QACH,CAAC;QACD,IAAI,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;QACD,wDAAwD;QACxD,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;CACF;AAtFD,8BAsFC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface BucketExecutionState {
|
|
2
|
+
__bucket_execution_state?: {
|
|
3
|
+
last_executed_bucket_id: number;
|
|
4
|
+
};
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface RoundRobinConfig {
|
|
8
|
+
round_robin_bucket_execution?: boolean;
|
|
9
|
+
bucket_id?: number;
|
|
10
|
+
bucket_ranges?: string | ReadonlyArray<string>;
|
|
11
|
+
bucket_total?: number;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export declare function bucket(key: string, data: string, bucketTotal: number): number;
|
|
15
|
+
export declare function validateBucketingConfig(config: RoundRobinConfig, logger?: (message: string) => void): void;
|
|
16
|
+
export declare function nextBucketId(config: RoundRobinConfig, state?: BucketExecutionState): number;
|
|
17
|
+
export declare function applyRoundRobinBucketing(config: RoundRobinConfig, state?: BucketExecutionState, logger?: (message: string) => void): {
|
|
18
|
+
config: RoundRobinConfig;
|
|
19
|
+
state: BucketExecutionState;
|
|
20
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.bucket = bucket;
|
|
7
|
+
exports.validateBucketingConfig = validateBucketingConfig;
|
|
8
|
+
exports.nextBucketId = nextBucketId;
|
|
9
|
+
exports.applyRoundRobinBucketing = applyRoundRobinBucketing;
|
|
10
|
+
const crypto_1 = require("crypto");
|
|
11
|
+
const verror_1 = __importDefault(require("verror"));
|
|
12
|
+
const bucket_set_1 = require("./bucket-set");
|
|
13
|
+
function bucket(key, data, bucketTotal) {
|
|
14
|
+
const md5 = (0, crypto_1.createHmac)('md5', key);
|
|
15
|
+
md5.update(data);
|
|
16
|
+
const hex = md5.digest('hex').substring(0, 8);
|
|
17
|
+
return (parseInt(hex, 16) % bucketTotal) + 1; // 1-index for readability
|
|
18
|
+
}
|
|
19
|
+
function validateBucketingConfig(config, logger) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const bucketTotal = (_a = config.bucket_total) !== null && _a !== void 0 ? _a : 1;
|
|
22
|
+
const bucketId = (_b = config.bucket_id) !== null && _b !== void 0 ? _b : 1;
|
|
23
|
+
if (bucketTotal < 1) {
|
|
24
|
+
throw new verror_1.default('bucket_total must be a positive integer');
|
|
25
|
+
}
|
|
26
|
+
if (bucketId < 1 || bucketId > bucketTotal) {
|
|
27
|
+
throw new verror_1.default(`bucket_id must be between 1 and ${bucketTotal}`);
|
|
28
|
+
}
|
|
29
|
+
if (config.bucket_ranges) {
|
|
30
|
+
if (!config.round_robin_bucket_execution) {
|
|
31
|
+
logger === null || logger === void 0 ? void 0 : logger(`bucket_ranges ${config.bucket_ranges} ignored because round_robin_bucket_execution is not enabled`);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
new bucket_set_1.BucketSet(bucketTotal, config.bucket_ranges);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function nextBucketId(config, state) {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
const bucketTotal = (_a = config.bucket_total) !== null && _a !== void 0 ? _a : 1;
|
|
41
|
+
const lastExecutedBucketId = (_c = (_b = state === null || state === void 0 ? void 0 : state.__bucket_execution_state) === null || _b === void 0 ? void 0 : _b.last_executed_bucket_id) !== null && _c !== void 0 ? _c : bucketTotal;
|
|
42
|
+
if (config.round_robin_bucket_execution && config.bucket_ranges) {
|
|
43
|
+
const bucketSet = new bucket_set_1.BucketSet(bucketTotal, config.bucket_ranges);
|
|
44
|
+
return bucketSet.next(lastExecutedBucketId);
|
|
45
|
+
}
|
|
46
|
+
return (lastExecutedBucketId % bucketTotal) + 1;
|
|
47
|
+
}
|
|
48
|
+
function applyRoundRobinBucketing(config, state, logger) {
|
|
49
|
+
if (!config.round_robin_bucket_execution) {
|
|
50
|
+
return { config, state };
|
|
51
|
+
}
|
|
52
|
+
const next = nextBucketId(config, state);
|
|
53
|
+
logger === null || logger === void 0 ? void 0 : logger(`Using round robin bucket execution. Bucket id: ${next}`);
|
|
54
|
+
return {
|
|
55
|
+
config: {
|
|
56
|
+
...config,
|
|
57
|
+
bucket_id: next,
|
|
58
|
+
},
|
|
59
|
+
state: {
|
|
60
|
+
...state,
|
|
61
|
+
__bucket_execution_state: {
|
|
62
|
+
last_executed_bucket_id: next,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=bucketing.js.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|
|
2
|
+
export { bucket, validateBucketingConfig, nextBucketId, applyRoundRobinBucketing, RoundRobinConfig, } from './bucketing';
|
|
3
|
+
export interface FileDiff {
|
|
4
|
+
deletions: number;
|
|
5
|
+
additions: number;
|
|
6
|
+
from?: string;
|
|
7
|
+
to?: string;
|
|
8
|
+
deleted?: boolean;
|
|
9
|
+
new?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function normalizeString(str: string): string;
|
|
12
|
+
export declare function calculateDateRange(options: {
|
|
13
|
+
start_date?: string;
|
|
14
|
+
end_date?: string;
|
|
15
|
+
cutoff_days?: number;
|
|
16
|
+
logger: (message: string) => void;
|
|
17
|
+
}): {
|
|
18
|
+
startDate: Date;
|
|
19
|
+
endDate: Date;
|
|
20
|
+
};
|
|
21
|
+
export declare function collectReposByOrg(reposByOrg: Map<string, Set<string>>, repos: ReadonlyArray<string>): void;
|
|
22
|
+
export declare function getFarosOptions(optionsType: 'board' | 'repository', source: string, farosClient: FarosClient, graph: string): Promise<{
|
|
23
|
+
included: Set<string>;
|
|
24
|
+
excluded: Set<string>;
|
|
25
|
+
}>;
|