@forge/teamwork-graph 1.0.0-next.0-experimental-97e4b11 → 1.0.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.
@@ -21,14 +21,6 @@ describe('Teamwork Graph Client', () => {
21
21
  jest.clearAllMocks();
22
22
  });
23
23
  describe('Context Validation', () => {
24
- const entityPayload = {
25
- id: 'test-entity-123',
26
- schemaVersion: '1',
27
- updateSequenceNumber: 1,
28
- displayName: 'Test Entity',
29
- url: 'https://example.com/entity/123',
30
- createdAt: new Date().toISOString()
31
- };
32
24
  const userPayload = {
33
25
  externalId: 'user-123'
34
26
  };
@@ -37,9 +29,6 @@ describe('Teamwork Graph Client', () => {
37
29
  name: 'Test Group'
38
30
  };
39
31
  const errorMessage = 'Please pass the context object in your method. Refer this - https://developer.atlassian.com/platform/forge/function-reference/';
40
- it('should throw error when context is missing for setEntity', async () => {
41
- await expect(graphClient.setEntity(undefined, entityPayload)).rejects.toThrow(errorMessage);
42
- });
43
32
  it('should throw error when context is missing for deleteEntity', async () => {
44
33
  await expect(graphClient.deleteEntity(undefined, 'entity-123')).rejects.toThrow(errorMessage);
45
34
  });
@@ -71,49 +60,6 @@ describe('Teamwork Graph Client', () => {
71
60
  })).rejects.toThrow(errorMessage);
72
61
  });
73
62
  });
74
- describe('setEntity', () => {
75
- const entityPayload = {
76
- id: 'test-entity-123',
77
- type: 'test-type',
78
- schemaVersion: '1',
79
- updateSequenceNumber: 1,
80
- displayName: 'Test Entity',
81
- url: 'https://example.com/entity/123',
82
- createdAt: new Date().toISOString(),
83
- properties: { name: 'Test Entity' }
84
- };
85
- it('should successfully post entity data', async () => {
86
- const expectedResponse = { success: true, entity: entityPayload };
87
- mockFetch.mockResolvedValueOnce({
88
- ok: true,
89
- json: () => Promise.resolve(expectedResponse)
90
- });
91
- const result = await graphClient.setEntity(mockContext, entityPayload);
92
- expect(mockFetch).toHaveBeenCalledWith('/graph/connector/api/v1/entity', {
93
- method: 'POST',
94
- body: JSON.stringify(entityPayload),
95
- redirect: 'follow',
96
- headers: { 'Content-Type': 'application/json' }
97
- });
98
- expect(result).toEqual(expectedResponse);
99
- });
100
- it('should throw ForgeGraphAPIError when request fails', async () => {
101
- const errorResponse = {
102
- ok: false,
103
- status: 400,
104
- statusText: 'Bad Request',
105
- headers: {
106
- get: () => null
107
- },
108
- text: () => Promise.resolve(JSON.stringify({
109
- code: errors_1.errorCodes.INVALID_REQUEST_BODY,
110
- message: 'Invalid entity payload'
111
- }))
112
- };
113
- mockFetch.mockResolvedValueOnce(errorResponse);
114
- await expect(graphClient.setEntity(mockContext, entityPayload)).rejects.toThrow(errors_1.ForgeGraphAPIError);
115
- });
116
- });
117
63
  describe('setUser', () => {
118
64
  const userPayload = {
119
65
  externalId: 'user-123',
package/out/graph.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Result } from '@forge/api';
2
- import { EntityPayload, UserObject, GroupObject, TeamWorkGraph, ForgeExtendedContext, RequestConfig } from './utils/types';
2
+ import { TeamWorkGraph, ForgeExtendedContext, GroupObject, RequestConfig, UserObject } from './types';
3
3
  export declare class TeamWorkGraphClient implements TeamWorkGraph {
4
- setEntity: (context: ForgeExtendedContext, entity: EntityPayload) => Promise<Result>;
5
4
  deleteEntity: (context: ForgeExtendedContext, entityId: string) => Promise<Result>;
6
5
  setUser: (context: ForgeExtendedContext, user: UserObject) => Promise<Result>;
7
6
  deleteUser: (context: ForgeExtendedContext, userId: string) => Promise<Result>;
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,MAAM,EAAsB,MAAM,YAAY,CAAC;AAErF,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,aAAa,EACd,MAAM,eAAe,CAAC;AAGvB,qBAAa,mBAAoB,YAAW,aAAa;IACvD,SAAS,YAAmB,oBAAoB,UAAU,aAAa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,WAAW,YAAmB,oBAAoB,WAAW,MAAM,KAAG,QAAQ,MAAM,CAAC,CAInF;IAEF,SAAS,YAAmB,oBAAoB,iBAAiB,aAAa,mBAAmB,GAAG,KAAK,GAAG,kBAuB1G;IAEF,aAAa,YAAmB,oBAAoB,QAAQ,GAAG,0BAA0B,GAAG,KAAK,GAAG,kBAIlG;YAEY,WAAW;YAIX,YAAY;IAI1B,OAAO,CAAC,eAAe;YAQT,eAAe;YAaf,iBAAiB;YAajB,WAAW;CAY1B;AAED,eAAO,MAAM,aAAa,qBAA4B,CAAC"}
package/out/graph.js CHANGED
@@ -5,10 +5,6 @@ const api_1 = require("@forge/api");
5
5
  const error_handling_1 = require("./error-handling");
6
6
  const starGateBase = '/graph/connector';
7
7
  class TeamWorkGraphClient {
8
- setEntity = async (context, entity) => {
9
- this.validateContext(context);
10
- return this.sendPostRequest('/api/v1/entity', entity);
11
- };
12
8
  deleteEntity = async (context, entityId) => {
13
9
  this.validateContext(context);
14
10
  const path = '/api/v1/entity/?resourceId=' + entityId;
package/out/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { teamworkgraph } from './graph';
2
2
  import { errorCodes, ForgeGraphAPIError } from './utils/errors';
3
- import * as types from './utils/types';
3
+ import * as types from './types';
4
4
  export { errorCodes, types, teamworkgraph as graph, ForgeGraphAPIError };
5
5
  export default teamworkgraph;
6
6
  //# 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,eAAe,CAAC;AACvC,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,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"}
package/out/index.js CHANGED
@@ -7,6 +7,6 @@ Object.defineProperty(exports, "graph", { enumerable: true, get: function () { r
7
7
  const errors_1 = require("./utils/errors");
8
8
  Object.defineProperty(exports, "errorCodes", { enumerable: true, get: function () { return errors_1.errorCodes; } });
9
9
  Object.defineProperty(exports, "ForgeGraphAPIError", { enumerable: true, get: function () { return errors_1.ForgeGraphAPIError; } });
10
- const types = tslib_1.__importStar(require("./utils/types"));
10
+ const types = tslib_1.__importStar(require("./types"));
11
11
  exports.types = types;
12
12
  exports.default = graph_1.teamworkgraph;
@@ -1,4 +1,3 @@
1
- import { Result } from '@forge/api';
2
1
  export declare type UserObject = {
3
2
  accountId?: string;
4
3
  id?: string;
@@ -34,29 +33,6 @@ export declare type Permissions = {
34
33
  accessControls?: AccessControl[];
35
34
  smartLinkViewedBy?: SmartLinkViewedByUser[];
36
35
  };
37
- export declare type DocumentCategory = 'folder' | 'document' | 'presentation' | 'spreadsheet' | 'image' | 'audio' | 'video' | 'pdf' | 'shortcut' | 'code' | 'archive' | 'form' | 'web-page' | 'other';
38
- export declare type DocumentType = {
39
- category?: DocumentCategory;
40
- mimeType?: string;
41
- iconUrl?: string;
42
- fileExtension?: string;
43
- };
44
- export declare type DocumentContent = {
45
- mimeType?: string;
46
- text?: string;
47
- binary?: string;
48
- };
49
- export declare type ExportLink = {
50
- mimeType: string;
51
- url: string;
52
- };
53
- export declare type DocumentAttributes = {
54
- collaborators?: Partial<UserObject>[];
55
- type: DocumentType;
56
- content: DocumentContent;
57
- byteSize?: number;
58
- exportLinks?: ExportLink[];
59
- };
60
36
  export declare type ContainerKeyObject = {
61
37
  type: string;
62
38
  value: {
@@ -69,7 +45,7 @@ export declare type ParentKeyObject = {
69
45
  entityId: string;
70
46
  };
71
47
  };
72
- export declare type EntityPayload = {
48
+ export declare type BaseEntityProperties = {
73
49
  schemaVersion: string;
74
50
  id: string;
75
51
  updateSequenceNumber: number;
@@ -86,7 +62,6 @@ export declare type EntityPayload = {
86
62
  containerKey?: ContainerKeyObject | string;
87
63
  permissions?: Permissions;
88
64
  associations?: Associations;
89
- 'atlassian:document'?: DocumentAttributes;
90
65
  };
91
66
  export declare type GroupObject = {
92
67
  id?: string;
@@ -128,14 +103,4 @@ export declare type RequestConfig = {
128
103
  params?: Record<string, any>;
129
104
  headers?: any;
130
105
  };
131
- export interface TeamWorkGraph {
132
- setEntity(context: ForgeExtendedContext, entity: EntityPayload): Promise<Result>;
133
- deleteEntity(context: ForgeExtendedContext, entityId: string): Promise<Result>;
134
- setUser(context: ForgeExtendedContext, user: UserObject): Promise<Result>;
135
- deleteUser(context: ForgeExtendedContext, userId: string): Promise<Result>;
136
- setGroup(context: ForgeExtendedContext, group: GroupObject): Promise<Result>;
137
- deleteGroup(context: ForgeExtendedContext, groupId: string): Promise<Result>;
138
- fetchData(context: ForgeExtendedContext, requestConfig: RequestConfig, onResult: Function): Promise<Result>;
139
- transformData(context: ForgeExtendedContext, data: any, transformMethod: Function): Promise<any>;
140
- }
141
- //# sourceMappingURL=types.d.ts.map
106
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAA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X,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,SAAS,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { UserObject } from '../common';
2
+ export declare type DocumentCategory = 'folder' | 'document' | 'presentation' | 'spreadsheet' | 'image' | 'audio' | 'video' | 'pdf' | 'shortcut' | 'code' | 'archive' | 'form' | 'web-page' | 'other';
3
+ export declare type DocumentType = {
4
+ category?: DocumentCategory;
5
+ mimeType?: string;
6
+ iconUrl?: string;
7
+ fileExtension?: string;
8
+ };
9
+ export declare type DocumentContent = {
10
+ mimeType?: string;
11
+ text?: string;
12
+ binary?: string;
13
+ };
14
+ export declare type ExportLink = {
15
+ mimeType: string;
16
+ url: string;
17
+ };
18
+ export declare type DocumentAttributes = {
19
+ collaborators?: Partial<UserObject>[];
20
+ type: DocumentType;
21
+ content: DocumentContent;
22
+ byteSize?: number;
23
+ exportLinks?: ExportLink[];
24
+ };
25
+ //# sourceMappingURL=document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/types/entities/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,oBAAY,gBAAgB,GACxB,QAAQ,GACR,UAAU,GACV,cAAc,GACd,aAAa,GACb,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,UAAU,GACV,MAAM,GACN,SAAS,GACT,MAAM,GACN,UAAU,GACV,OAAO,CAAC;AAEZ,oBAAY,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IACtC,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { BaseEntityProperties } from '../common';
2
+ import { DocumentAttributes } from './document';
3
+ export declare type EntityTypeMap = {
4
+ 'atlassian:document': DocumentAttributes;
5
+ };
6
+ export declare type SupportedEntityType = keyof EntityTypeMap;
7
+ export declare type Entity<T extends SupportedEntityType = SupportedEntityType> = BaseEntityProperties & {
8
+ [K in T]: EntityTypeMap[K];
9
+ };
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,oBAAY,aAAa,GAAG;IAC1B,oBAAoB,EAAE,kBAAkB,CAAC;CAG1C,CAAC;AAGF,oBAAY,mBAAmB,GAAG,MAAM,aAAa,CAAC;AAGtD,oBAAY,MAAM,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,IAAI,oBAAoB,GAAG;KAC9F,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;CAC3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import { Result } from '@forge/api';
2
+ import { ForgeExtendedContext, GroupObject, RequestConfig, UserObject } from '.';
3
+ export interface TeamWorkGraph {
4
+ deleteEntity(context: ForgeExtendedContext, entityId: string): Promise<Result>;
5
+ setUser(context: ForgeExtendedContext, user: UserObject): Promise<Result>;
6
+ deleteUser(context: ForgeExtendedContext, userId: string): Promise<Result>;
7
+ setGroup(context: ForgeExtendedContext, group: GroupObject): Promise<Result>;
8
+ deleteGroup(context: ForgeExtendedContext, groupId: string): Promise<Result>;
9
+ fetchData(context: ForgeExtendedContext, requestConfig: RequestConfig, onResult: Function): Promise<Result>;
10
+ transformData(context: ForgeExtendedContext, data: any, transformMethod: Function): Promise<any>;
11
+ }
12
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +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,EAAE,oBAAoB,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEjF,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/E,OAAO,CAAC,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1E,UAAU,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3E,QAAQ,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7E,WAAW,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7E,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,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAClG"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export * from './common';
2
+ export * from './entities';
3
+ export * from './requests';
4
+ export * from './graph';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAGzB,cAAc,YAAY,CAAC;AAG3B,cAAc,YAAY,CAAC;AAE3B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./common"), exports);
5
+ tslib_1.__exportStar(require("./entities"), exports);
6
+ tslib_1.__exportStar(require("./requests"), exports);
7
+ tslib_1.__exportStar(require("./graph"), exports);
@@ -0,0 +1,17 @@
1
+ import { ForgeExtendedContext } from './common';
2
+ import { Entity, SupportedEntityType } from './entities';
3
+ export declare type BulkEntityRequest = {
4
+ context: ForgeExtendedContext;
5
+ entities: Array<{
6
+ entityType: SupportedEntityType;
7
+ } & Entity>;
8
+ };
9
+ export declare type BulkEntityResponse = {
10
+ success: boolean;
11
+ results: Array<{
12
+ entityId: string;
13
+ success: boolean;
14
+ error?: string;
15
+ }>;
16
+ };
17
+ //# sourceMappingURL=requests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/types/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGzD,oBAAY,iBAAiB,GAAG;IAC9B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,EAAE,KAAK,CACb;QACE,UAAU,EAAE,mBAAmB,CAAC;KACjC,GAAG,MAAM,CACX,CAAC;CACH,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"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/teamwork-graph",
3
- "version": "1.0.0-next.0-experimental-97e4b11",
3
+ "version": "1.0.0",
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": "^6.0.0-next.0-experimental-97e4b11"
25
+ "@forge/api": "^6.0.0"
26
26
  },
27
27
  "publishConfig": {
28
28
  "registry": "https://packages.atlassian.com/api/npm/npm-public/"
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,oBAAY,UAAU,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE;QACL,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAChD,CAAC;AAEF,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;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