@forge/teamwork-graph 1.2.0-next.3-experimental-255e232 → 1.2.0-next.5

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/out/graph.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { TeamWorkGraph, ForgeExtendedContext, RequestConfig, BulkEntityRequest, BulkEntityResponse, BulkUsersRequest, BulkUsersResponse, DeleteUsersByExternalIdRequest, DeleteUsersByExternalIdResponse, GetUserByExternalIdRequest, GetUserByExternalIdResponse, MapUsersRequest, MapUsersResponse, BulkGroupsRequest, BulkGroupsResponse, DeleteGroupsByExternalIdRequest, DeleteGroupsByExternalIdResponse, GetGroupByExternalIdRequest, GetGroupByExternalIdResponse, GetEntityByExternalIdRequest, GetEntityByExternalIdResponse, DeleteEntitiesByExternalIdRequest, DeleteEntitiesByExternalIdResponse, DeleteEntitiesByPropertiesRequest, DeleteEntitiesByPropertiesResponse } from './types';
1
+ import { TeamWorkGraph, BulkEntityRequest, BulkEntityResponse, BulkUsersRequest, BulkUsersResponse, DeleteUsersByExternalIdRequest, DeleteUsersByExternalIdResponse, GetUserByExternalIdRequest, GetUserByExternalIdResponse, MapUsersRequest, MapUsersResponse, BulkGroupsRequest, BulkGroupsResponse, DeleteGroupsByExternalIdRequest, DeleteGroupsByExternalIdResponse, GetGroupByExternalIdRequest, GetGroupByExternalIdResponse, GetEntityByExternalIdRequest, GetEntityByExternalIdResponse, DeleteEntitiesByExternalIdRequest, DeleteEntitiesByExternalIdResponse, DeleteEntitiesByPropertiesRequest, DeleteEntitiesByPropertiesResponse, FetchDataRequest, FetchDataResponse, TransformDataRequest, TransformDataResponse } from './types';
2
2
  export declare class TeamWorkGraphClient implements TeamWorkGraph {
3
3
  setEntities: (request: BulkEntityRequest) => Promise<BulkEntityResponse>;
4
4
  getEntityByExternalId: (request: GetEntityByExternalIdRequest) => Promise<GetEntityByExternalIdResponse>;
@@ -11,11 +11,8 @@ export declare class TeamWorkGraphClient implements TeamWorkGraph {
11
11
  deleteUsersByExternalId: (request: DeleteUsersByExternalIdRequest) => Promise<DeleteUsersByExternalIdResponse>;
12
12
  getUserByExternalId: (request: GetUserByExternalIdRequest) => Promise<GetUserByExternalIdResponse>;
13
13
  mapUsers: (request: MapUsersRequest) => Promise<MapUsersResponse>;
14
- fetchData: (context: ForgeExtendedContext, requestConfig: RequestConfig, onResult: (data: any) => any) => Promise<any>;
15
- transformData: (context: ForgeExtendedContext, data: any, transformMethod: (data: any) => any) => Promise<any>;
16
- private saveToStage;
17
- private validateData;
18
- private validateContext;
14
+ fetchData: (request: FetchDataRequest) => Promise<FetchDataResponse>;
15
+ transformData: (request: TransformDataRequest) => Promise<TransformDataResponse>;
19
16
  private sendPostRequest;
20
17
  private sendDeleteRequest;
21
18
  private sendGetRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAiC,EACjC,kCAAkC,EAClC,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,SAAS,CAAC;AASjB,qBAAa,mBAAoB,YAAW,aAAa;IACvD,WAAW,YAAmB,iBAAiB,KAAG,QAAQ,kBAAkB,CAAC,CAe3E;IAKF,qBAAqB,YAAmB,4BAA4B,KAAG,QAAQ,6BAA6B,CAAC,CA0B3G;IAKF,0BAA0B,YACf,iCAAiC,KACzC,QAAQ,kCAAkC,CAAC,CAuB5C;IAKF,0BAA0B,YACf,iCA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B,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAIjB,qBAAa,mBAAoB,YAAW,aAAa;IACvD,WAAW,YAAmB,iBAAiB,KAAG,QAAQ,kBAAkB,CAAC,CAM3E;IAKF,qBAAqB,YAAmB,4BAA4B,KAAG,QAAQ,6BAA6B,CAAC,CAoB3G;IAKF,0BAA0B,YACf,iCAAiC,KACzC,QAAQ,kCAAkC,CAAC,CAS5C;IAKF,0BAA0B,YACf,iCAAiC,KACzC,QAAQ,kCAAkC,CAAC,CAK5C;IAKF,SAAS,YAAmB,iBAAiB,KAAG,QAAQ,kBAAkB,CAAC,CAMzE;IAKF,wBAAwB,YACb,+BAA+B,KACvC,QAAQ,gCAAgC,CAAC,CAQ1C;IAKF,oBAAoB,YAAmB,2BAA2B,KAAG,QAAQ,4BAA4B,CAAC,CAmBxG;IAEF,QAAQ,YAAmB,gBAAgB,KAAG,QAAQ,iBAAiB,CAAC,CAMtE;IAEF,uBAAuB,YACZ,8BAA8B,KACtC,QAAQ,+BAA+B,CAAC,CAQzC;IAEF,mBAAmB,YAAmB,0BAA0B,KAAG,QAAQ,2BAA2B,CAAC,CAmBrG;IAEF,QAAQ,YAAmB,eAAe,KAAG,QAAQ,gBAAgB,CAAC,CAQpE;IAEF,SAAS,YAAmB,gBAAgB,KAAG,QAAQ,iBAAiB,CAAC,CA6BvE;IAEF,aAAa,YAAmB,oBAAoB,KAAG,QAAQ,qBAAqB,CAAC,CAiBnF;YAEY,eAAe;YAaf,iBAAiB;YAajB,cAAc;YAYd,WAAW;CAY1B;AAED,eAAO,MAAM,aAAa,qBAA4B,CAAC"}
package/out/graph.js CHANGED
@@ -3,35 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.teamworkgraph = exports.TeamWorkGraphClient = void 0;
4
4
  const api_1 = require("@forge/api");
5
5
  const error_handling_1 = require("./error-handling");
6
+ const validators_1 = require("./utils/validators");
6
7
  const STARGATE_BASE = '/graph/connector';
7
- const MAX_BULK_ENTITIES = 100;
8
- const MAX_BULK_USERS = 100;
9
- const MAX_BULK_GROUPS = 100;
10
- const MAX_BULK_ENTITIES_DELETE = 100;
11
- const MAX_USER_MAPPINGS = 100;
12
8
  class TeamWorkGraphClient {
13
9
  setEntities = async (request) => {
14
10
  const { entities } = request;
15
- if (!Array.isArray(entities)) {
16
- throw new Error('entities must be an array');
17
- }
18
- if (entities.length === 0) {
19
- throw new Error('entities array cannot be empty');
20
- }
21
- if (entities.length > MAX_BULK_ENTITIES) {
22
- throw new Error(`Bulk ingestion supports maximum ${MAX_BULK_ENTITIES} entities. Received ${entities.length}`);
23
- }
11
+ (0, validators_1.validateSetEntitiesRequest)(entities);
24
12
  const response = await this.sendPostRequest('/api/v1/entities/bulk', { entities });
25
13
  return response;
26
14
  };
27
15
  getEntityByExternalId = async (request) => {
28
16
  const { entityType, externalId } = request;
29
- if (!entityType || entityType.trim() === '') {
30
- throw new Error('entityType is required');
31
- }
32
- if (!externalId || externalId.trim() === '') {
33
- throw new Error('externalId is required');
34
- }
17
+ (0, validators_1.validateGetEntityByExternalIdRequest)(entityType, externalId);
35
18
  try {
36
19
  const url = new URL('/api/v1/entities', 'https://teamwork-graph.atlassian.net/api');
37
20
  url.searchParams.set('entityType', entityType);
@@ -52,18 +35,7 @@ class TeamWorkGraphClient {
52
35
  };
53
36
  deleteEntitiesByExternalId = async (request) => {
54
37
  const { entityType, externalIds } = request;
55
- if (!entityType || entityType.trim() === '') {
56
- throw new Error('entityType is required');
57
- }
58
- if (!Array.isArray(externalIds)) {
59
- throw new Error('externalIds must be an array');
60
- }
61
- if (externalIds.length === 0) {
62
- throw new Error('externalIds array cannot be empty');
63
- }
64
- if (externalIds.length > MAX_BULK_ENTITIES_DELETE) {
65
- throw new Error(`Bulk entity deletion supports maximum ${MAX_BULK_ENTITIES_DELETE} entities. Received ${externalIds.length}`);
66
- }
38
+ (0, validators_1.validateDeleteEntitiesByExternalIdRequest)(entityType, externalIds);
67
39
  const response = await this.sendDeleteRequest('/api/v1/entities/bulk/delete', {
68
40
  entityType,
69
41
  externalIds
@@ -71,37 +43,19 @@ class TeamWorkGraphClient {
71
43
  return response;
72
44
  };
73
45
  deleteEntitiesByProperties = async (request) => {
74
- if (!request || typeof request !== 'object') {
75
- throw new Error('properties must be an object');
76
- }
77
- if (Object.keys(request).length === 0) {
78
- throw new Error('properties object cannot be empty');
79
- }
46
+ (0, validators_1.validateDeleteEntitiesByPropertiesRequest)(request);
80
47
  const response = await this.sendDeleteRequest('/api/v1/entities/bulk/delete-by-properties', request);
81
48
  return response;
82
49
  };
83
50
  setGroups = async (request) => {
84
51
  const { groups } = request;
85
- if (!Array.isArray(groups)) {
86
- throw new Error('groups must be an array');
87
- }
88
- if (groups.length === 0) {
89
- throw new Error('groups array cannot be empty');
90
- }
91
- if (groups.length > MAX_BULK_GROUPS) {
92
- throw new Error(`Bulk group ingestion supports maximum ${MAX_BULK_GROUPS} groups. Received ${groups.length}`);
93
- }
52
+ (0, validators_1.validateSetGroupsRequest)(groups);
94
53
  const response = await this.sendPostRequest('/api/v1/groups/bulk', { groups });
95
54
  return response;
96
55
  };
97
56
  deleteGroupsByExternalId = async (request) => {
98
57
  const { externalIds } = request;
99
- if (!Array.isArray(externalIds)) {
100
- throw new Error('externalIds must be an array');
101
- }
102
- if (externalIds.length === 0) {
103
- throw new Error('externalIds array cannot be empty');
104
- }
58
+ (0, validators_1.validateDeleteGroupsByExternalIdRequest)(externalIds);
105
59
  const response = await this.sendPostRequest('/api/v1/groups/bulk/delete', {
106
60
  externalIds
107
61
  });
@@ -109,9 +63,7 @@ class TeamWorkGraphClient {
109
63
  };
110
64
  getGroupByExternalId = async (request) => {
111
65
  const { externalId } = request;
112
- if (!externalId || externalId.trim() === '') {
113
- throw new Error('externalId is required');
114
- }
66
+ (0, validators_1.validateGetGroupByExternalIdRequest)(externalId);
115
67
  try {
116
68
  const url = new URL('/api/v1/groups', 'https://teamwork-graph.atlassian.net/api');
117
69
  url.searchParams.set('externalId', externalId);
@@ -131,26 +83,13 @@ class TeamWorkGraphClient {
131
83
  };
132
84
  setUsers = async (request) => {
133
85
  const { users } = request;
134
- if (!Array.isArray(users)) {
135
- throw new Error('users must be an array');
136
- }
137
- if (users.length === 0) {
138
- throw new Error('users array cannot be empty');
139
- }
140
- if (users.length > MAX_BULK_USERS) {
141
- throw new Error(`Bulk user ingestion supports maximum ${MAX_BULK_USERS} users. Received ${users.length}`);
142
- }
86
+ (0, validators_1.validateSetUsersRequest)(users);
143
87
  const response = await this.sendPostRequest('/api/v1/users/bulk', { users });
144
88
  return response;
145
89
  };
146
90
  deleteUsersByExternalId = async (request) => {
147
91
  const { externalIds } = request;
148
- if (!Array.isArray(externalIds)) {
149
- throw new Error('externalIds must be an array');
150
- }
151
- if (externalIds.length === 0) {
152
- throw new Error('externalIds array cannot be empty');
153
- }
92
+ (0, validators_1.validateDeleteUsersByExternalIdRequest)(externalIds);
154
93
  const response = await this.sendPostRequest('/api/v1/users/bulk/delete', {
155
94
  externalIds
156
95
  });
@@ -158,9 +97,7 @@ class TeamWorkGraphClient {
158
97
  };
159
98
  getUserByExternalId = async (request) => {
160
99
  const { externalId } = request;
161
- if (!externalId || externalId.trim() === '') {
162
- throw new Error('externalId is required');
163
- }
100
+ (0, validators_1.validateGetUserByExternalIdRequest)(externalId);
164
101
  try {
165
102
  const url = new URL('/api/v1/users', 'https://teamwork-graph.atlassian.net/api');
166
103
  url.searchParams.set('externalId', externalId);
@@ -180,57 +117,55 @@ class TeamWorkGraphClient {
180
117
  };
181
118
  mapUsers = async (request) => {
182
119
  const { directMappings } = request;
183
- if (!Array.isArray(directMappings)) {
184
- throw new Error('directMappings must be an array');
185
- }
186
- if (directMappings.length === 0) {
187
- throw new Error('directMappings array cannot be empty');
188
- }
189
- if (directMappings.length > MAX_USER_MAPPINGS) {
190
- throw new Error(`Bulk user mapping supports maximum ${MAX_USER_MAPPINGS} mappings. Received ${directMappings.length}`);
191
- }
192
- const invalidMapping = directMappings.find((mapping) => !mapping.accountId && !mapping.externalEmailAddress);
193
- if (invalidMapping) {
194
- throw new Error('Each mapping must have either accountId or externalEmailAddress');
195
- }
196
- const mappingWithoutExternalId = directMappings.find((mapping) => !mapping.externalId);
197
- if (mappingWithoutExternalId) {
198
- throw new Error('Each mapping must have an externalId');
199
- }
120
+ (0, validators_1.validateMapUsersRequest)(directMappings);
200
121
  const response = await this.sendPostRequest('/api/v1/users/mappings', {
201
122
  directMappings
202
123
  });
203
124
  return response;
204
125
  };
205
- fetchData = async (context, requestConfig, onResult) => {
206
- this.validateContext(context);
126
+ fetchData = async (request) => {
127
+ (0, validators_1.validateFetchDataRequest)(request);
128
+ const { requestConfig, onResult } = request;
207
129
  const { url, method, headers } = requestConfig;
208
- const res = await (0, api_1.fetch)(url, {
209
- method: method,
210
- headers: headers
211
- });
212
- if (!res.ok) {
213
- throw new Error(`Remote call failed with status: ${res.status}`);
130
+ try {
131
+ const res = await (0, api_1.fetch)(url, {
132
+ method: method,
133
+ headers: headers
134
+ });
135
+ if (!res.ok) {
136
+ throw new Error(`Remote call failed with status: ${res.status}`);
137
+ }
138
+ const data = await res.json();
139
+ onResult(data);
140
+ return {
141
+ success: true,
142
+ data: data
143
+ };
144
+ }
145
+ catch (error) {
146
+ return {
147
+ success: false,
148
+ error: error instanceof Error ? error.message : 'Unknown error'
149
+ };
214
150
  }
215
- const data = await res.json();
216
- await this.saveToStage(data);
217
- await this.validateData(data);
218
- onResult(data);
219
- return data;
220
- };
221
- transformData = async (context, data, transformMethod) => {
222
- this.validateContext(context);
223
- return transformMethod(data);
224
151
  };
225
- async saveToStage(data) {
226
- }
227
- async validateData(data) {
228
- }
229
- validateContext(context) {
230
- if (!context) {
231
- throw new Error('Please pass the context object in your method. Refer this - https://developer.atlassian.com/platform/forge/function-reference/');
152
+ transformData = async (request) => {
153
+ (0, validators_1.validateTransformDataRequest)(request);
154
+ const { data, transformMethod } = request;
155
+ try {
156
+ const transformedData = transformMethod(data);
157
+ return {
158
+ success: true,
159
+ transformedData: transformedData
160
+ };
232
161
  }
233
- }
162
+ catch (error) {
163
+ return {
164
+ success: false,
165
+ error: error instanceof Error ? error.message : 'Unknown error'
166
+ };
167
+ }
168
+ };
234
169
  async sendPostRequest(path, body) {
235
170
  const response = await this.sendRequest(path, {
236
171
  method: 'POST',
@@ -54,25 +54,4 @@ export declare type AssociationObject = {
54
54
  export declare type Associations = {
55
55
  set: AssociationObject[];
56
56
  };
57
- export declare type IngestionContext = {
58
- id: string;
59
- [key: string]: string;
60
- };
61
- export declare type ForgeExtendedContext = {
62
- principal: {
63
- accountId: string;
64
- };
65
- installContext: string;
66
- workspaceId?: string;
67
- license: {
68
- isActive: boolean;
69
- };
70
- ingestionContext?: IngestionContext;
71
- };
72
- export declare type RequestConfig = {
73
- url: string;
74
- method: 'GET' | 'POST' | 'PUT' | 'DELETE';
75
- params?: Record<string, any>;
76
- headers?: any;
77
- };
78
57
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,oBAAY,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,qBAAqB,GAAG,WAAW,CAAC;IAC1E,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,aAAa,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,iBAAiB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC7C,CAA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from './commit';
3
+ export declare type BranchAttributes = {
4
+ name?: string;
5
+ lastCommit?: CommitEntity;
6
+ createPullRequestUrl?: string;
7
+ };
8
+ export declare type BranchEntity = BaseEntityProperties & {
9
+ displayName: string;
10
+ lastUpdatedAt: string;
11
+ permissions: NonNullable<BaseEntityProperties['permissions']>;
12
+ 'atlassian:branch': BranchAttributes;
13
+ };
14
+ //# sourceMappingURL=branch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/types/entities/branch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,oBAAY,YAAY,GAAG,oBAAoB,GAAG;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,kBAAkB,EAAE,gBAAgB,CAAC;CACtC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { BaseEntityProperties } from '../common';
2
+ import { User } from '../users';
3
+ export declare type FileInfo = {
4
+ path: string;
5
+ url: string;
6
+ changeType: string;
7
+ linesAdded: number;
8
+ linesRemoved: number;
9
+ };
10
+ export declare type CommitAttributes = {
11
+ hash?: string;
12
+ displayId?: string;
13
+ message?: string;
14
+ author?: User;
15
+ flags: string[];
16
+ fileCount: number;
17
+ files: FileInfo[];
18
+ authorTimestamp?: string;
19
+ };
20
+ export declare type CommitEntity = BaseEntityProperties & {
21
+ displayName: string;
22
+ lastUpdatedAt: string;
23
+ permissions: NonNullable<BaseEntityProperties['permissions']>;
24
+ 'atlassian:commit': CommitAttributes;
25
+ };
26
+ //# sourceMappingURL=commit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../src/types/entities/commit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,oBAAY,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,oBAAY,YAAY,GAAG,oBAAoB,GAAG;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,kBAAkB,EAAE,gBAAgB,CAAC;CACtC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,8 @@
1
+ import { BranchEntity } from './branch';
2
+ import { CommitEntity } from './commit';
1
3
  import { DocumentEntity } from './document';
2
4
  import { MessageEntity } from './message';
3
5
  import { OrganisationEntity } from './organisation';
4
- export { DocumentEntity, MessageEntity, OrganisationEntity };
5
- export declare type Entity = DocumentEntity | MessageEntity | OrganisationEntity;
6
+ export { BranchEntity, CommitEntity, DocumentEntity, MessageEntity, OrganisationEntity };
7
+ export declare type Entity = BranchEntity | CommitEntity | DocumentEntity | MessageEntity | OrganisationEntity;
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC;AAG7D,oBAAY,MAAM,GAAG,cAAc,GAAG,aAAa,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC;AAGzF,oBAAY,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,cAAc,GAAG,aAAa,GAAG,kBAAkB,CAAC"}
@@ -1,12 +1,11 @@
1
- import { Result } from '@forge/api';
2
- import { ForgeExtendedContext, RequestConfig, BulkEntityRequest, BulkEntityResponse, BulkUsersRequest, BulkUsersResponse, DeleteUsersByExternalIdRequest, DeleteUsersByExternalIdResponse, GetUserByExternalIdRequest, GetUserByExternalIdResponse, MapUsersRequest, MapUsersResponse, BulkGroupsRequest, BulkGroupsResponse, DeleteGroupsByExternalIdRequest, DeleteGroupsByExternalIdResponse, GetGroupByExternalIdRequest, GetGroupByExternalIdResponse, GetEntityByExternalIdRequest, GetEntityByExternalIdResponse, DeleteEntitiesByExternalIdRequest, DeleteEntitiesByExternalIdResponse, DeleteEntitiesByPropertiesRequest, DeleteEntitiesByPropertiesResponse } from './';
1
+ import { BulkEntityRequest, BulkEntityResponse, BulkUsersRequest, BulkUsersResponse, DeleteUsersByExternalIdRequest, DeleteUsersByExternalIdResponse, GetUserByExternalIdRequest, GetUserByExternalIdResponse, MapUsersRequest, MapUsersResponse, BulkGroupsRequest, BulkGroupsResponse, DeleteGroupsByExternalIdRequest, DeleteGroupsByExternalIdResponse, GetGroupByExternalIdRequest, GetGroupByExternalIdResponse, GetEntityByExternalIdRequest, GetEntityByExternalIdResponse, DeleteEntitiesByExternalIdRequest, DeleteEntitiesByExternalIdResponse, DeleteEntitiesByPropertiesRequest, DeleteEntitiesByPropertiesResponse, FetchDataRequest, FetchDataResponse, TransformDataRequest, TransformDataResponse } from './';
3
2
  export interface TeamWorkGraph {
4
3
  setEntities(request: BulkEntityRequest): Promise<BulkEntityResponse>;
5
4
  getEntityByExternalId(request: GetEntityByExternalIdRequest): Promise<GetEntityByExternalIdResponse>;
6
5
  deleteEntitiesByExternalId(request: DeleteEntitiesByExternalIdRequest): Promise<DeleteEntitiesByExternalIdResponse>;
7
6
  deleteEntitiesByProperties(request: DeleteEntitiesByPropertiesRequest): Promise<DeleteEntitiesByPropertiesResponse>;
8
- fetchData(context: ForgeExtendedContext, requestConfig: RequestConfig, onResult: Function): Promise<Result>;
9
- transformData(context: ForgeExtendedContext, data: any, transformMethod: Function): Promise<any>;
7
+ fetchData(request: FetchDataRequest): Promise<FetchDataResponse>;
8
+ transformData(request: TransformDataRequest): Promise<TransformDataResponse>;
10
9
  setUsers(request: BulkUsersRequest): Promise<BulkUsersResponse>;
11
10
  deleteUsersByExternalId(request: DeleteUsersByExternalIdRequest): Promise<DeleteUsersByExternalIdResponse>;
12
11
  getUserByExternalId(request: GetUserByExternalIdRequest): Promise<GetUserByExternalIdResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/types/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAiC,EACjC,kCAAkC,EAClC,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,IAAI,CAAC;AAEZ,MAAM,WAAW,aAAa;IAE5B,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrE,qBAAqB,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACrG,0BAA0B,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;IACpH,0BAA0B,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;IAGpH,SAAS,CAAC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5G,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,IAAI,EA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qBAAqB,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACrG,0BAA0B,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;IACpH,0BAA0B,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;IAGpH,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACjE,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAG7E,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChE,uBAAuB,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAC3G,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC/F,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAG9D,SAAS,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACnE,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC9G,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CACnG"}
@@ -119,4 +119,26 @@ export declare type GetGroupByExternalIdResponse = {
119
119
  group?: Group;
120
120
  error?: string;
121
121
  };
122
+ export declare type FetchDataRequest = {
123
+ requestConfig: {
124
+ url: string;
125
+ method: string;
126
+ headers?: Record<string, string>;
127
+ };
128
+ onResult: (data: any) => any;
129
+ };
130
+ export declare type FetchDataResponse = {
131
+ success: boolean;
132
+ data?: any;
133
+ error?: string;
134
+ };
135
+ export declare type TransformDataRequest = {
136
+ data: any;
137
+ transformMethod: (data: any) => any;
138
+ };
139
+ export declare type TransformDataResponse = {
140
+ success: boolean;
141
+ transformedData?: any;
142
+ error?: string;
143
+ };
122
144
  //# sourceMappingURL=requests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/types/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAGpE,oBAAY,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,6BAA6B,GAAG;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,iCAAiC,GAAG;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,oBAAY,kCAAkC,GAAG;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ,CAAC;AAEF,oBAAY,iCAAiC,GAAG,MAAM,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AAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,IAAI,EAAE,GAAG,CAAC;IACV,eAAe,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CACrC,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,23 @@
1
+ export declare const MAX_BULK_ENTITIES = 100;
2
+ export declare const MAX_BULK_USERS = 100;
3
+ export declare const MAX_BULK_GROUPS = 100;
4
+ export declare const MAX_BULK_ENTITIES_DELETE = 100;
5
+ export declare const MAX_USER_MAPPINGS = 100;
6
+ export declare function validateArray(value: any, fieldName: string): void;
7
+ export declare function validateArrayMaxLength(value: any[], fieldName: string, maxLength: number, itemType?: string): void;
8
+ export declare function validateRequiredString(value: string | undefined, fieldName: string): void;
9
+ export declare function validateObject(value: any, fieldName: string): void;
10
+ export declare function validateSetEntitiesRequest(entities: any[]): void;
11
+ export declare function validateSetUsersRequest(users: any[]): void;
12
+ export declare function validateSetGroupsRequest(groups: any[]): void;
13
+ export declare function validateDeleteEntitiesByExternalIdRequest(entityType: string, externalIds: string[]): void;
14
+ export declare function validateDeleteUsersByExternalIdRequest(externalIds: string[]): void;
15
+ export declare function validateDeleteGroupsByExternalIdRequest(externalIds: string[]): void;
16
+ export declare function validateGetEntityByExternalIdRequest(entityType: string, externalId: string): void;
17
+ export declare function validateGetUserByExternalIdRequest(externalId: string): void;
18
+ export declare function validateGetGroupByExternalIdRequest(externalId: string): void;
19
+ export declare function validateMapUsersRequest(directMappings: any[]): void;
20
+ export declare function validateDeleteEntitiesByPropertiesRequest(properties: any): void;
21
+ export declare function validateFetchDataRequest(request: any): void;
22
+ export declare function validateTransformDataRequest(request: any): void;
23
+ //# sourceMappingURL=validators.d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AG,IAAI,CAGjG;AAKD,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAE3E;AAKD,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAE5E;AAKD,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,IAAI,CAenE;AAKD,wBAAgB,yCAAyC,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI,CAE/E;AAKD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAoB3D;AAKD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAQ/D"}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateTransformDataRequest = exports.validateFetchDataRequest = exports.validateDeleteEntitiesByPropertiesRequest = exports.validateMapUsersRequest = exports.validateGetGroupByExternalIdRequest = exports.validateGetUserByExternalIdRequest = exports.validateGetEntityByExternalIdRequest = exports.validateDeleteGroupsByExternalIdRequest = exports.validateDeleteUsersByExternalIdRequest = exports.validateDeleteEntitiesByExternalIdRequest = exports.validateSetGroupsRequest = exports.validateSetUsersRequest = exports.validateSetEntitiesRequest = exports.validateObject = exports.validateRequiredString = exports.validateArrayMaxLength = exports.validateArray = exports.MAX_USER_MAPPINGS = exports.MAX_BULK_ENTITIES_DELETE = exports.MAX_BULK_GROUPS = exports.MAX_BULK_USERS = exports.MAX_BULK_ENTITIES = void 0;
4
+ exports.MAX_BULK_ENTITIES = 100;
5
+ exports.MAX_BULK_USERS = 100;
6
+ exports.MAX_BULK_GROUPS = 100;
7
+ exports.MAX_BULK_ENTITIES_DELETE = 100;
8
+ exports.MAX_USER_MAPPINGS = 100;
9
+ function validateArray(value, fieldName) {
10
+ if (!Array.isArray(value)) {
11
+ throw new Error(`${fieldName} must be an array`);
12
+ }
13
+ if (value.length === 0) {
14
+ throw new Error(`${fieldName} array cannot be empty`);
15
+ }
16
+ }
17
+ exports.validateArray = validateArray;
18
+ function validateArrayMaxLength(value, fieldName, maxLength, itemType = 'items') {
19
+ if (value.length > maxLength) {
20
+ throw new Error(`${fieldName} supports maximum ${maxLength} ${itemType}. Received ${value.length}`);
21
+ }
22
+ }
23
+ exports.validateArrayMaxLength = validateArrayMaxLength;
24
+ function validateRequiredString(value, fieldName) {
25
+ if (!value || value.trim() === '') {
26
+ throw new Error(`${fieldName} is required`);
27
+ }
28
+ }
29
+ exports.validateRequiredString = validateRequiredString;
30
+ function validateObject(value, fieldName) {
31
+ if (!value || typeof value !== 'object') {
32
+ throw new Error(`${fieldName} must be an object`);
33
+ }
34
+ if (Object.keys(value).length === 0) {
35
+ throw new Error(`${fieldName} object cannot be empty`);
36
+ }
37
+ }
38
+ exports.validateObject = validateObject;
39
+ function validateSetEntitiesRequest(entities) {
40
+ validateArray(entities, 'entities');
41
+ validateArrayMaxLength(entities, 'Bulk ingestion', exports.MAX_BULK_ENTITIES, 'entities');
42
+ }
43
+ exports.validateSetEntitiesRequest = validateSetEntitiesRequest;
44
+ function validateSetUsersRequest(users) {
45
+ validateArray(users, 'users');
46
+ validateArrayMaxLength(users, 'Bulk user ingestion', exports.MAX_BULK_USERS, 'users');
47
+ }
48
+ exports.validateSetUsersRequest = validateSetUsersRequest;
49
+ function validateSetGroupsRequest(groups) {
50
+ validateArray(groups, 'groups');
51
+ validateArrayMaxLength(groups, 'Bulk group ingestion', exports.MAX_BULK_GROUPS, 'groups');
52
+ }
53
+ exports.validateSetGroupsRequest = validateSetGroupsRequest;
54
+ function validateDeleteEntitiesByExternalIdRequest(entityType, externalIds) {
55
+ validateRequiredString(entityType, 'entityType');
56
+ validateArray(externalIds, 'externalIds');
57
+ validateArrayMaxLength(externalIds, 'Bulk entity deletion', exports.MAX_BULK_ENTITIES_DELETE, 'entities');
58
+ }
59
+ exports.validateDeleteEntitiesByExternalIdRequest = validateDeleteEntitiesByExternalIdRequest;
60
+ function validateDeleteUsersByExternalIdRequest(externalIds) {
61
+ validateArray(externalIds, 'externalIds');
62
+ }
63
+ exports.validateDeleteUsersByExternalIdRequest = validateDeleteUsersByExternalIdRequest;
64
+ function validateDeleteGroupsByExternalIdRequest(externalIds) {
65
+ validateArray(externalIds, 'externalIds');
66
+ }
67
+ exports.validateDeleteGroupsByExternalIdRequest = validateDeleteGroupsByExternalIdRequest;
68
+ function validateGetEntityByExternalIdRequest(entityType, externalId) {
69
+ validateRequiredString(entityType, 'entityType');
70
+ validateRequiredString(externalId, 'externalId');
71
+ }
72
+ exports.validateGetEntityByExternalIdRequest = validateGetEntityByExternalIdRequest;
73
+ function validateGetUserByExternalIdRequest(externalId) {
74
+ validateRequiredString(externalId, 'externalId');
75
+ }
76
+ exports.validateGetUserByExternalIdRequest = validateGetUserByExternalIdRequest;
77
+ function validateGetGroupByExternalIdRequest(externalId) {
78
+ validateRequiredString(externalId, 'externalId');
79
+ }
80
+ exports.validateGetGroupByExternalIdRequest = validateGetGroupByExternalIdRequest;
81
+ function validateMapUsersRequest(directMappings) {
82
+ validateArray(directMappings, 'directMappings');
83
+ validateArrayMaxLength(directMappings, 'Bulk user mapping', exports.MAX_USER_MAPPINGS, 'mappings');
84
+ const invalidMapping = directMappings.find((mapping) => !mapping.accountId && !mapping.externalEmailAddress);
85
+ if (invalidMapping) {
86
+ throw new Error('Each mapping must have either accountId or externalEmailAddress');
87
+ }
88
+ const mappingWithoutExternalId = directMappings.find((mapping) => !mapping.externalId);
89
+ if (mappingWithoutExternalId) {
90
+ throw new Error('Each mapping must have an externalId');
91
+ }
92
+ }
93
+ exports.validateMapUsersRequest = validateMapUsersRequest;
94
+ function validateDeleteEntitiesByPropertiesRequest(properties) {
95
+ validateObject(properties, 'properties');
96
+ }
97
+ exports.validateDeleteEntitiesByPropertiesRequest = validateDeleteEntitiesByPropertiesRequest;
98
+ function validateFetchDataRequest(request) {
99
+ if (!request || typeof request !== 'object') {
100
+ throw new Error('request must be an object');
101
+ }
102
+ if (!request.requestConfig || typeof request.requestConfig !== 'object') {
103
+ throw new Error('requestConfig is required and must be an object');
104
+ }
105
+ if (!request.requestConfig.url || typeof request.requestConfig.url !== 'string') {
106
+ throw new Error('requestConfig.url is required and must be a string');
107
+ }
108
+ if (!request.requestConfig.method || typeof request.requestConfig.method !== 'string') {
109
+ throw new Error('requestConfig.method is required and must be a string');
110
+ }
111
+ if (!request.onResult || typeof request.onResult !== 'function') {
112
+ throw new Error('onResult is required and must be a function');
113
+ }
114
+ }
115
+ exports.validateFetchDataRequest = validateFetchDataRequest;
116
+ function validateTransformDataRequest(request) {
117
+ if (!request || typeof request !== 'object') {
118
+ throw new Error('request must be an object');
119
+ }
120
+ if (!request.transformMethod || typeof request.transformMethod !== 'function') {
121
+ throw new Error('transformMethod is required and must be a function');
122
+ }
123
+ }
124
+ exports.validateTransformDataRequest = validateTransformDataRequest;