@forge/teamwork-graph 1.2.0-next.4 → 2.0.0-experimental-8191ad1

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.
Files changed (89) hide show
  1. package/README.md +276 -169
  2. package/out/__test__/entity-operations.test.js +1231 -10
  3. package/out/__test__/error-handling.test.js +38 -96
  4. package/out/__test__/graph-extended.test.js +12 -2
  5. package/out/__test__/group-operations.test.js +5 -4
  6. package/out/__test__/user-operations.test.js +16 -5
  7. package/out/__test__/validators.test.js +254 -218
  8. package/out/graph.d.ts +0 -3
  9. package/out/graph.d.ts.map +1 -1
  10. package/out/graph.js +121 -91
  11. package/out/index.d.ts +1 -2
  12. package/out/index.d.ts.map +1 -1
  13. package/out/index.js +1 -4
  14. package/out/types/entities/branch.d.ts +14 -0
  15. package/out/types/entities/branch.d.ts.map +1 -0
  16. package/out/types/entities/branch.js +2 -0
  17. package/out/types/entities/build.d.ts +33 -0
  18. package/out/types/entities/build.d.ts.map +1 -0
  19. package/out/types/entities/build.js +2 -0
  20. package/out/types/entities/calendar-event.d.ts +45 -0
  21. package/out/types/entities/calendar-event.d.ts.map +1 -0
  22. package/out/types/entities/calendar-event.js +2 -0
  23. package/out/types/entities/comment.d.ts +18 -0
  24. package/out/types/entities/comment.d.ts.map +1 -0
  25. package/out/types/entities/comment.js +2 -0
  26. package/out/types/entities/commit.d.ts +26 -0
  27. package/out/types/entities/commit.d.ts.map +1 -0
  28. package/out/types/entities/commit.js +2 -0
  29. package/out/types/entities/conversation.d.ts +28 -0
  30. package/out/types/entities/conversation.d.ts.map +1 -0
  31. package/out/types/entities/conversation.js +2 -0
  32. package/out/types/entities/customer-org.d.ts +36 -0
  33. package/out/types/entities/customer-org.d.ts.map +1 -0
  34. package/out/types/entities/customer-org.js +2 -0
  35. package/out/types/entities/deal.d.ts +37 -0
  36. package/out/types/entities/deal.d.ts.map +1 -0
  37. package/out/types/entities/deal.js +2 -0
  38. package/out/types/entities/deployment.d.ts +43 -0
  39. package/out/types/entities/deployment.d.ts.map +1 -0
  40. package/out/types/entities/deployment.js +2 -0
  41. package/out/types/entities/design.d.ts +15 -0
  42. package/out/types/entities/design.d.ts.map +1 -0
  43. package/out/types/entities/design.js +2 -0
  44. package/out/types/entities/index.d.ts +22 -2
  45. package/out/types/entities/index.d.ts.map +1 -1
  46. package/out/types/entities/position.d.ts +24 -0
  47. package/out/types/entities/position.d.ts.map +1 -0
  48. package/out/types/entities/position.js +2 -0
  49. package/out/types/entities/project.d.ts +40 -0
  50. package/out/types/entities/project.d.ts.map +1 -0
  51. package/out/types/entities/project.js +2 -0
  52. package/out/types/entities/pull-request.d.ts +44 -0
  53. package/out/types/entities/pull-request.d.ts.map +1 -0
  54. package/out/types/entities/pull-request.js +2 -0
  55. package/out/types/entities/remote-link.d.ts +33 -0
  56. package/out/types/entities/remote-link.d.ts.map +1 -0
  57. package/out/types/entities/remote-link.js +2 -0
  58. package/out/types/entities/repository.d.ts +14 -0
  59. package/out/types/entities/repository.d.ts.map +1 -0
  60. package/out/types/entities/repository.js +2 -0
  61. package/out/types/entities/software-service.d.ts +17 -0
  62. package/out/types/entities/software-service.d.ts.map +1 -0
  63. package/out/types/entities/software-service.js +2 -0
  64. package/out/types/entities/space.d.ts +21 -0
  65. package/out/types/entities/space.d.ts.map +1 -0
  66. package/out/types/entities/space.js +2 -0
  67. package/out/types/entities/video.d.ts +48 -0
  68. package/out/types/entities/video.d.ts.map +1 -0
  69. package/out/types/entities/video.js +2 -0
  70. package/out/types/entities/work-item.d.ts +44 -0
  71. package/out/types/entities/work-item.d.ts.map +1 -0
  72. package/out/types/entities/work-item.js +2 -0
  73. package/out/types/entities/worker.d.ts +23 -0
  74. package/out/types/entities/worker.d.ts.map +1 -0
  75. package/out/types/entities/worker.js +2 -0
  76. package/out/types/requests.d.ts +29 -8
  77. package/out/types/requests.d.ts.map +1 -1
  78. package/out/utils/error-handling.d.ts +4 -0
  79. package/out/utils/error-handling.d.ts.map +1 -0
  80. package/out/utils/error-handling.js +77 -0
  81. package/out/utils/errors.d.ts +21 -15
  82. package/out/utils/errors.d.ts.map +1 -1
  83. package/out/utils/errors.js +43 -15
  84. package/out/utils/validators.d.ts.map +1 -1
  85. package/out/utils/validators.js +18 -15
  86. package/package.json +2 -2
  87. package/out/error-handling.d.ts +0 -3
  88. package/out/error-handling.d.ts.map +0 -1
  89. package/out/error-handling.js +0 -36
package/out/graph.js CHANGED
@@ -2,15 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.teamworkgraph = exports.TeamWorkGraphClient = void 0;
4
4
  const api_1 = require("@forge/api");
5
- const error_handling_1 = require("./error-handling");
5
+ const error_handling_1 = require("./utils/error-handling");
6
6
  const validators_1 = require("./utils/validators");
7
+ const errors_1 = require("./utils/errors");
7
8
  const STARGATE_BASE = '/graph/connector';
8
9
  class TeamWorkGraphClient {
9
10
  setEntities = async (request) => {
10
11
  const { entities } = request;
11
12
  (0, validators_1.validateSetEntitiesRequest)(entities);
12
- const response = await this.sendPostRequest('/api/v1/entities/bulk', { entities });
13
- return response;
13
+ try {
14
+ const response = await this.sendRequest('/api/v1/entities/bulk', {
15
+ method: 'POST',
16
+ body: JSON.stringify({ entities })
17
+ });
18
+ return response;
19
+ }
20
+ catch (error) {
21
+ return (0, error_handling_1.handleError)(error, 'set entities');
22
+ }
14
23
  };
15
24
  getEntityByExternalId = async (request) => {
16
25
  const { entityType, externalId } = request;
@@ -20,46 +29,72 @@ class TeamWorkGraphClient {
20
29
  url.searchParams.set('entityType', entityType);
21
30
  url.searchParams.set('externalId', externalId);
22
31
  const path = url.pathname + url.search;
23
- const response = await this.sendGetRequest(path);
32
+ const response = await this.sendRequest(path, {
33
+ method: 'GET'
34
+ });
24
35
  return {
25
36
  success: true,
26
37
  entity: response
27
38
  };
28
39
  }
29
40
  catch (error) {
30
- return {
31
- success: false,
32
- error: error instanceof Error ? error.message : 'Unknown error'
33
- };
41
+ return (0, error_handling_1.handleError)(error, 'get entity by external ID');
34
42
  }
35
43
  };
36
44
  deleteEntitiesByExternalId = async (request) => {
37
45
  const { entityType, externalIds } = request;
38
46
  (0, validators_1.validateDeleteEntitiesByExternalIdRequest)(entityType, externalIds);
39
- const response = await this.sendDeleteRequest('/api/v1/entities/bulk/delete', {
40
- entityType,
41
- externalIds
42
- });
43
- return response;
47
+ try {
48
+ const response = await this.sendRequest('/api/v1/entities/bulk/delete', {
49
+ method: 'DELETE',
50
+ body: JSON.stringify({ entityType, externalIds })
51
+ });
52
+ return response;
53
+ }
54
+ catch (error) {
55
+ return (0, error_handling_1.handleError)(error, 'delete entities by external ID');
56
+ }
44
57
  };
45
58
  deleteEntitiesByProperties = async (request) => {
46
59
  (0, validators_1.validateDeleteEntitiesByPropertiesRequest)(request);
47
- const response = await this.sendDeleteRequest('/api/v1/entities/bulk/delete-by-properties', request);
48
- return response;
60
+ try {
61
+ const response = await this.sendRequest('/api/v1/entities/bulk/delete-by-properties', {
62
+ method: 'DELETE',
63
+ body: JSON.stringify(request)
64
+ });
65
+ return response;
66
+ }
67
+ catch (error) {
68
+ return (0, error_handling_1.handleError)(error, 'delete entities by properties');
69
+ }
49
70
  };
50
71
  setGroups = async (request) => {
51
72
  const { groups } = request;
52
73
  (0, validators_1.validateSetGroupsRequest)(groups);
53
- const response = await this.sendPostRequest('/api/v1/groups/bulk', { groups });
54
- return response;
74
+ try {
75
+ const response = await this.sendRequest('/api/v1/groups/bulk', {
76
+ method: 'POST',
77
+ body: JSON.stringify({ groups })
78
+ });
79
+ return response;
80
+ }
81
+ catch (error) {
82
+ return (0, error_handling_1.handleError)(error, 'set groups');
83
+ }
55
84
  };
56
85
  deleteGroupsByExternalId = async (request) => {
57
86
  const { externalIds } = request;
58
87
  (0, validators_1.validateDeleteGroupsByExternalIdRequest)(externalIds);
59
- const response = await this.sendPostRequest('/api/v1/groups/bulk/delete', {
60
- externalIds
61
- });
62
- return response;
88
+ try {
89
+ const response = await this.sendRequest('/api/v1/groups/bulk/delete', {
90
+ method: 'POST',
91
+ body: JSON.stringify({ externalIds })
92
+ });
93
+ return response;
94
+ }
95
+ catch (error) {
96
+ return (0, error_handling_1.handleError)(error, 'delete groups by external ID');
97
+ }
63
98
  };
64
99
  getGroupByExternalId = async (request) => {
65
100
  const { externalId } = request;
@@ -68,32 +103,45 @@ class TeamWorkGraphClient {
68
103
  const url = new URL('/api/v1/groups', 'https://teamwork-graph.atlassian.net/api');
69
104
  url.searchParams.set('externalId', externalId);
70
105
  const path = url.pathname + url.search;
71
- const response = await this.sendGetRequest(path);
106
+ const response = await this.sendRequest(path, {
107
+ method: 'GET'
108
+ });
72
109
  return {
73
110
  success: true,
74
111
  group: response
75
112
  };
76
113
  }
77
114
  catch (error) {
78
- return {
79
- success: false,
80
- error: error instanceof Error ? error.message : 'Unknown error'
81
- };
115
+ return (0, error_handling_1.handleError)(error, 'get group by external ID');
82
116
  }
83
117
  };
84
118
  setUsers = async (request) => {
85
119
  const { users } = request;
86
120
  (0, validators_1.validateSetUsersRequest)(users);
87
- const response = await this.sendPostRequest('/api/v1/users/bulk', { users });
88
- return response;
121
+ try {
122
+ const response = await this.sendRequest('/api/v1/users/bulk', {
123
+ method: 'POST',
124
+ body: JSON.stringify({ users })
125
+ });
126
+ return response;
127
+ }
128
+ catch (error) {
129
+ return (0, error_handling_1.handleError)(error, 'set users');
130
+ }
89
131
  };
90
132
  deleteUsersByExternalId = async (request) => {
91
133
  const { externalIds } = request;
92
134
  (0, validators_1.validateDeleteUsersByExternalIdRequest)(externalIds);
93
- const response = await this.sendPostRequest('/api/v1/users/bulk/delete', {
94
- externalIds
95
- });
96
- return response;
135
+ try {
136
+ const response = await this.sendRequest('/api/v1/users/bulk/delete', {
137
+ method: 'POST',
138
+ body: JSON.stringify({ externalIds })
139
+ });
140
+ return response;
141
+ }
142
+ catch (error) {
143
+ return (0, error_handling_1.handleError)(error, 'delete users by external ID');
144
+ }
97
145
  };
98
146
  getUserByExternalId = async (request) => {
99
147
  const { externalId } = request;
@@ -102,38 +150,43 @@ class TeamWorkGraphClient {
102
150
  const url = new URL('/api/v1/users', 'https://teamwork-graph.atlassian.net/api');
103
151
  url.searchParams.set('externalId', externalId);
104
152
  const path = url.pathname + url.search;
105
- const response = await this.sendGetRequest(path);
153
+ const response = await this.sendRequest(path, {
154
+ method: 'GET'
155
+ });
106
156
  return {
107
157
  success: true,
108
158
  user: response
109
159
  };
110
160
  }
111
161
  catch (error) {
112
- return {
113
- success: false,
114
- error: error instanceof Error ? error.message : 'Unknown error'
115
- };
162
+ return (0, error_handling_1.handleError)(error, 'get user by external ID');
116
163
  }
117
164
  };
118
165
  mapUsers = async (request) => {
119
166
  const { directMappings } = request;
120
167
  (0, validators_1.validateMapUsersRequest)(directMappings);
121
- const response = await this.sendPostRequest('/api/v1/users/mappings', {
122
- directMappings
123
- });
124
- return response;
168
+ try {
169
+ const response = await this.sendRequest('/api/v1/users/mappings', {
170
+ method: 'POST',
171
+ body: JSON.stringify({ directMappings })
172
+ });
173
+ return response;
174
+ }
175
+ catch (error) {
176
+ return (0, error_handling_1.handleError)(error, 'map users');
177
+ }
125
178
  };
126
179
  fetchData = async (request) => {
127
180
  (0, validators_1.validateFetchDataRequest)(request);
128
- const { requestConfig, onResult } = request;
129
- const { url, method, headers } = requestConfig;
130
181
  try {
182
+ const { requestConfig, onResult } = request;
183
+ const { url, method, headers } = requestConfig;
131
184
  const res = await (0, api_1.fetch)(url, {
132
185
  method: method,
133
186
  headers: headers
134
187
  });
135
188
  if (!res.ok) {
136
- throw new Error(`Remote call failed with status: ${res.status}`);
189
+ throw new errors_1.ForgeTeamWorkGraphFetchError(`Remote call failed with status: ${res.status}`);
137
190
  }
138
191
  const data = await res.json();
139
192
  onResult(data);
@@ -143,16 +196,13 @@ class TeamWorkGraphClient {
143
196
  };
144
197
  }
145
198
  catch (error) {
146
- return {
147
- success: false,
148
- error: error instanceof Error ? error.message : 'Unknown error'
149
- };
199
+ return (0, error_handling_1.handleError)(error, 'fetch data');
150
200
  }
151
201
  };
152
202
  transformData = async (request) => {
153
203
  (0, validators_1.validateTransformDataRequest)(request);
154
- const { data, transformMethod } = request;
155
204
  try {
205
+ const { data, transformMethod } = request;
156
206
  const transformedData = transformMethod(data);
157
207
  return {
158
208
  success: true,
@@ -160,52 +210,32 @@ class TeamWorkGraphClient {
160
210
  };
161
211
  }
162
212
  catch (error) {
163
- return {
164
- success: false,
165
- error: error instanceof Error ? error.message : 'Unknown error'
166
- };
213
+ const transformError = new errors_1.ForgeTeamWorkGraphTransformError('Transform failed', error instanceof Error ? error : undefined);
214
+ return (0, error_handling_1.handleError)(transformError, 'transform data');
167
215
  }
168
216
  };
169
- async sendPostRequest(path, body) {
170
- const response = await this.sendRequest(path, {
171
- method: 'POST',
172
- body: JSON.stringify(body)
173
- });
174
- if (!response.ok) {
175
- await (0, error_handling_1.handleResponseError)(response, `Error posting to ${path}`);
176
- }
177
- return response.json();
178
- }
179
- async sendDeleteRequest(path, body) {
180
- const response = await this.sendRequest(path, {
181
- method: 'DELETE',
182
- body: body ? JSON.stringify(body) : undefined
183
- });
184
- if (!response.ok) {
185
- await (0, error_handling_1.handleResponseError)(response, `Error deleting from ${path}`);
186
- }
187
- return response.json();
188
- }
189
- async sendGetRequest(path) {
190
- const response = await this.sendRequest(path, {
191
- method: 'GET'
192
- });
193
- if (!response.ok) {
194
- await (0, error_handling_1.handleResponseError)(response, `Error getting from ${path}`);
195
- }
196
- return response.json();
197
- }
198
217
  async sendRequest(path, options) {
199
- const reqPath = STARGATE_BASE + path;
200
- const response = await (0, api_1.__fetchProduct)({ provider: 'app', remote: 'stargate', type: 'fpp' })(reqPath, {
201
- ...options,
202
- redirect: 'follow',
203
- headers: {
204
- ...options?.headers,
205
- 'Content-Type': 'application/json'
218
+ try {
219
+ const reqPath = STARGATE_BASE + path;
220
+ const response = await (0, api_1.__fetchProduct)({ provider: 'app', remote: 'stargate', type: 'fpp' })(reqPath, {
221
+ ...options,
222
+ redirect: 'follow',
223
+ headers: {
224
+ ...options?.headers,
225
+ 'Content-Type': 'application/json'
226
+ }
227
+ });
228
+ if (!response.ok) {
229
+ await (0, error_handling_1.handleResponseError)(response, `API request failed`);
206
230
  }
207
- });
208
- return response;
231
+ return response.json();
232
+ }
233
+ catch (error) {
234
+ if (error instanceof errors_1.ForgeTeamWorkGraphAPIError) {
235
+ throw error;
236
+ }
237
+ throw new errors_1.ForgeTeamWorkGraphNetworkError(`Network request failed`, error instanceof Error ? error : undefined);
238
+ }
209
239
  }
210
240
  }
211
241
  exports.TeamWorkGraphClient = TeamWorkGraphClient;
package/out/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { teamworkgraph } from './graph';
2
- import { errorCodes, ForgeGraphAPIError } from './utils/errors';
3
2
  import * as types from './types';
4
- export { errorCodes, types, teamworkgraph as graph, ForgeGraphAPIError };
3
+ export { types, teamworkgraph as graph };
5
4
  export default teamworkgraph;
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,IAAI,KAAK,EAAE,kBAAkB,EAAE,CAAC;AAEzE,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,aAAa,IAAI,KAAK,EAAE,CAAC;AAEzC,eAAe,aAAa,CAAC"}
package/out/index.js CHANGED
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ForgeGraphAPIError = exports.graph = exports.types = exports.errorCodes = void 0;
3
+ exports.graph = exports.types = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const graph_1 = require("./graph");
6
6
  Object.defineProperty(exports, "graph", { enumerable: true, get: function () { return graph_1.teamworkgraph; } });
7
- const errors_1 = require("./utils/errors");
8
- Object.defineProperty(exports, "errorCodes", { enumerable: true, get: function () { return errors_1.errorCodes; } });
9
- Object.defineProperty(exports, "ForgeGraphAPIError", { enumerable: true, get: function () { return errors_1.ForgeGraphAPIError; } });
10
7
  const types = tslib_1.__importStar(require("./types"));
11
8
  exports.types = types;
12
9
  exports.default = graph_1.teamworkgraph;
@@ -0,0 +1,14 @@
1
+ import { BaseEntityProperties } from '../common';
2
+ import { CommitEntity } 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,33 @@
1
+ import { BaseEntityProperties } from '../common';
2
+ export declare type TestInfo = {
3
+ totalNumber: number;
4
+ numberPassed: number;
5
+ numberFailed: number;
6
+ numberSkipped?: number;
7
+ };
8
+ export declare type BuildReferences = {
9
+ commit?: {
10
+ id: string;
11
+ repositoryUri: string;
12
+ };
13
+ ref?: {
14
+ name: string;
15
+ uri: string;
16
+ };
17
+ };
18
+ export declare type BuildAttributes = {
19
+ pipelineId: string;
20
+ buildNumber: number;
21
+ label?: string;
22
+ state: string;
23
+ duration?: number;
24
+ testInfo?: TestInfo;
25
+ references?: BuildReferences[];
26
+ };
27
+ export declare type BuildEntity = BaseEntityProperties & {
28
+ displayName: string;
29
+ lastUpdatedAt: string;
30
+ permissions: NonNullable<BaseEntityProperties['permissions']>;
31
+ 'atlassian:build': BuildAttributes;
32
+ };
33
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/types/entities/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,oBAAY,QAAQ,GAAG;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF,oBAAY,WAAW,GAAG,oBAAoB,GAAG;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,iBAAiB,EAAE,eAAe,CAAC;CACpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,45 @@
1
+ import { BaseEntityProperties } from '../common';
2
+ import { User } from '../users';
3
+ export declare type Attachment = {
4
+ url?: string;
5
+ thumbnailUrl?: string;
6
+ title?: string;
7
+ mimeType?: string;
8
+ byteSize?: number;
9
+ };
10
+ export declare type Attendee = {
11
+ user?: string;
12
+ isOptional?: boolean;
13
+ rsvpStatus?: 'accepted' | 'tentatively_accepted' | 'declined' | 'not_responded' | 'other';
14
+ };
15
+ export declare type Location = {
16
+ name?: string;
17
+ address?: string;
18
+ url?: string;
19
+ coordinates?: string;
20
+ };
21
+ export declare type CalendarEventAttributes = {
22
+ eventStartTime: string;
23
+ eventEndTime: string;
24
+ attendees?: Attendee[];
25
+ location?: Location;
26
+ videoMeetingUrl?: string;
27
+ recordingUrl?: string;
28
+ isAllDayEvent?: boolean;
29
+ attendeeCount?: number;
30
+ exceedsMaxAttendees?: boolean;
31
+ videoMeetingProvider?: string;
32
+ isRecurringEvent?: boolean;
33
+ recurringEventId?: string;
34
+ eventType: string;
35
+ attachments?: Attachment[];
36
+ };
37
+ export declare type CalendarEventEntity = BaseEntityProperties & {
38
+ displayName: string;
39
+ description: string;
40
+ createdBy: Partial<User>;
41
+ lastUpdatedAt: string;
42
+ permissions: NonNullable<BaseEntityProperties['permissions']>;
43
+ 'atlassian:calendar-event': CalendarEventAttributes;
44
+ };
45
+ //# sourceMappingURL=calendar-event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-event.d.ts","sourceRoot":"","sources":["../../../src/types/entities/calendar-event.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,oBAAY,UAAU,GAAG;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,GAAG,sBAAsB,GAAG,UAAU,GAAG,eAAe,GAAG,OAAO,CAAC;CAC3F,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC;AAEF,oBAAY,mBAAmB,GAAG,oBAAoB,GAAG;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,0BAA0B,EAAE,uBAAuB,CAAC;CACrD,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { BaseEntityProperties } from '../common';
2
+ import { User } from '../';
3
+ export declare type Reaction = {
4
+ reactionType: string;
5
+ total: number;
6
+ };
7
+ export declare type CommentAttributes = {
8
+ text?: string;
9
+ reactionsV2?: Reaction[];
10
+ };
11
+ export declare type CommentEntity = Omit<BaseEntityProperties, 'description' | 'createdBy'> & {
12
+ displayName: string;
13
+ lastUpdatedAt: string;
14
+ createdBy: Partial<User>;
15
+ permissions: NonNullable<BaseEntityProperties['permissions']>;
16
+ 'atlassian:comment': CommentAttributes;
17
+ };
18
+ //# sourceMappingURL=comment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../src/types/entities/comment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,oBAAY,QAAQ,GAAG;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAC;CAC1B,CAAC;AAEF,oBAAY,aAAa,GAAG,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,WAAW,CAAC,GAAG;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,mBAAmB,EAAE,iBAAiB,CAAC;CACxC,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 });
@@ -0,0 +1,28 @@
1
+ import { BaseEntityProperties } from '../common';
2
+ export declare type User = {
3
+ accountId?: string;
4
+ email?: string;
5
+ externalId?: string;
6
+ ari?: string;
7
+ name?: string;
8
+ userName?: string;
9
+ avatar?: string;
10
+ url?: string;
11
+ };
12
+ export declare type ConversationAttributes = {
13
+ type: string;
14
+ membershipType: string;
15
+ workspace: string;
16
+ topic?: string;
17
+ isArchived?: boolean;
18
+ members: User[];
19
+ lastActive?: string;
20
+ memberCount?: number;
21
+ };
22
+ export declare type ConversationEntity = BaseEntityProperties & {
23
+ displayName: string;
24
+ lastUpdatedAt: string;
25
+ permissions: NonNullable<BaseEntityProperties['permissions']>;
26
+ 'atlassian:conversation': ConversationAttributes;
27
+ };
28
+ //# sourceMappingURL=conversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/types/entities/conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,oBAAY,IAAI,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,IAAI,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,kBAAkB,GAAG,oBAAoB,GAAG;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,wBAAwB,EAAE,sBAAsB,CAAC;CAClD,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,36 @@
1
+ import { BaseEntityProperties } from '../common';
2
+ export declare type User = {
3
+ accountId?: string;
4
+ email?: string;
5
+ externalId?: string;
6
+ ari?: string;
7
+ name?: string;
8
+ userName?: string;
9
+ avatar?: string;
10
+ url?: string;
11
+ };
12
+ export declare type CustomerOrgLastActivity = {
13
+ lastActivityAt: string;
14
+ event: string;
15
+ };
16
+ export declare type CustomerOrgLifeTimeValue = {
17
+ value: number;
18
+ currencyCode: string;
19
+ };
20
+ export declare type CustomerOrgAttributes = {
21
+ contacts?: User[];
22
+ customerOrgLastActivity?: CustomerOrgLastActivity;
23
+ customerOrgLifeTimeValue?: CustomerOrgLifeTimeValue;
24
+ websiteUrl?: string;
25
+ industry?: string;
26
+ contributors?: User[];
27
+ country?: string;
28
+ accountType?: string;
29
+ };
30
+ export declare type CustomerOrgEntity = BaseEntityProperties & {
31
+ displayName: string;
32
+ lastUpdatedAt: string;
33
+ permissions: NonNullable<BaseEntityProperties['permissions']>;
34
+ 'atlassian:customer-org': CustomerOrgAttributes;
35
+ };
36
+ //# sourceMappingURL=customer-org.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer-org.d.ts","sourceRoot":"","sources":["../../../src/types/entities/customer-org.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,oBAAY,IAAI,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;IAClB,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,iBAAiB,GAAG,oBAAoB,GAAG;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,wBAAwB,EAAE,qBAAqB,CAAC;CACjD,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });