@forge/teamwork-graph 0.1.0 → 0.1.1-next.1

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.
@@ -183,7 +183,7 @@ describe('Teamwork Graph Client', () => {
183
183
  });
184
184
  });
185
185
  describe('deleteUser', () => {
186
- const userId = 'user-123';
186
+ const userId = 'user-Folder/user-123';
187
187
  it('should successfully delete a user', async () => {
188
188
  const expectedResponse = { success: true };
189
189
  mockFetch.mockResolvedValueOnce({
@@ -191,7 +191,7 @@ describe('Teamwork Graph Client', () => {
191
191
  json: () => Promise.resolve(expectedResponse)
192
192
  });
193
193
  const result = await graphClient.deleteUser(mockContext, userId);
194
- expect(mockFetch).toHaveBeenCalledWith('/graph/connector/api/v1/user/user-123', {
194
+ expect(mockFetch).toHaveBeenCalledWith('/graph/connector/api/v1/user/?resourceId=user-Folder/user-123', {
195
195
  method: 'DELETE',
196
196
  redirect: 'follow',
197
197
  headers: { 'Content-Type': 'application/json' }
@@ -224,7 +224,7 @@ describe('Teamwork Graph Client', () => {
224
224
  json: () => Promise.resolve(expectedResponse)
225
225
  });
226
226
  const result = await graphClient.deleteEntity(mockContext, entityId);
227
- expect(mockFetch).toHaveBeenCalledWith('/graph/connector/api/v1/entity/entity-123', {
227
+ expect(mockFetch).toHaveBeenCalledWith('/graph/connector/api/v1/entity/?resourceId=entity-123', {
228
228
  method: 'DELETE',
229
229
  redirect: 'follow',
230
230
  headers: { 'Content-Type': 'application/json' }
@@ -249,7 +249,7 @@ describe('Teamwork Graph Client', () => {
249
249
  });
250
250
  });
251
251
  describe('deleteGroup', () => {
252
- const groupId = 'group-123';
252
+ const groupId = 'group-Folder/group-123';
253
253
  it('should successfully delete a group', async () => {
254
254
  const expectedResponse = { success: true };
255
255
  mockFetch.mockResolvedValueOnce({
@@ -257,7 +257,7 @@ describe('Teamwork Graph Client', () => {
257
257
  json: () => Promise.resolve(expectedResponse)
258
258
  });
259
259
  const result = await graphClient.deleteGroup(mockContext, groupId);
260
- expect(mockFetch).toHaveBeenCalledWith('/graph/connector/api/v1/group/group-123', {
260
+ expect(mockFetch).toHaveBeenCalledWith('/graph/connector/api/v1/group/?resourceId=group-Folder/group-123', {
261
261
  method: 'DELETE',
262
262
  redirect: 'follow',
263
263
  headers: { 'Content-Type': 'application/json' }
package/out/graph.js CHANGED
@@ -11,7 +11,7 @@ class TeamWorkGraphClient {
11
11
  };
12
12
  deleteEntity = async (context, entityId) => {
13
13
  this.validateContext(context);
14
- const path = '/api/v1/entity/' + entityId;
14
+ const path = '/api/v1/entity/?resourceId=' + entityId;
15
15
  return this.sendDeleteRequest(path);
16
16
  };
17
17
  setUser = async (context, user) => {
@@ -20,7 +20,7 @@ class TeamWorkGraphClient {
20
20
  };
21
21
  deleteUser = async (context, userId) => {
22
22
  this.validateContext(context);
23
- const path = '/api/v1/user/' + userId;
23
+ const path = '/api/v1/user/?resourceId=' + userId;
24
24
  return this.sendDeleteRequest(path);
25
25
  };
26
26
  setGroup = async (context, group) => {
@@ -29,7 +29,7 @@ class TeamWorkGraphClient {
29
29
  };
30
30
  deleteGroup = async (context, groupId) => {
31
31
  this.validateContext(context);
32
- const path = '/api/v1/group/' + groupId;
32
+ const path = '/api/v1/group/?resourceId=' + groupId;
33
33
  return this.sendDeleteRequest(path);
34
34
  };
35
35
  fetchData = async (context, requestConfig, onResult) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/teamwork-graph",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-next.1",
4
4
  "description": "Forge TeamworkGraph SDK",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -22,7 +22,7 @@
22
22
  "jest-when": "^3.6.0"
23
23
  },
24
24
  "dependencies": {
25
- "@forge/api": "^5.1.0"
25
+ "@forge/api": "^5.1.1-next.0"
26
26
  },
27
27
  "publishConfig": {
28
28
  "registry": "https://packages.atlassian.com/api/npm/npm-public/"