@makeplane/plane-node-sdk 0.1.1 → 0.1.3

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.
@@ -1,6 +1,7 @@
1
1
  .gitignore
2
2
  .npmignore
3
3
  README.md
4
+ eslint.config.mjs
4
5
  package.json
5
6
  src/apis/AssetsApi.ts
6
7
  src/apis/CyclesApi.ts
@@ -52,6 +53,7 @@ src/models/IssuePropertyValueAPI.ts
52
53
  src/models/IssuePropertyValueAPIRequest.ts
53
54
  src/models/IssueRequest.ts
54
55
  src/models/IssueSearch.ts
56
+ src/models/IssueSearchItem.ts
55
57
  src/models/IssueTypeAPI.ts
56
58
  src/models/IssueTypeAPIRequest.ts
57
59
  src/models/IssueWorkLogAPI.ts
@@ -115,5 +117,7 @@ src/models/TypeEnum.ts
115
117
  src/models/UserAssetUploadRequest.ts
116
118
  src/models/UserLite.ts
117
119
  src/models/index.ts
120
+ src/oauth/api.ts
121
+ src/oauth/models.ts
118
122
  src/runtime.ts
119
123
  tsconfig.json
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @makeplane/plane-node-sdk@0.1.1
1
+ ## @makeplane/plane-node-sdk@0.1.3
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @makeplane/plane-node-sdk@0.1.1 --save
39
+ npm install @makeplane/plane-node-sdk@0.1.3 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -25,12 +25,12 @@ export declare class MembersApi extends runtime.BaseAPI {
25
25
  * Retrieve all users who are members of the specified project.
26
26
  * List project members
27
27
  */
28
- getProjectMembersRaw(requestParameters: GetProjectMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserLite>>;
28
+ getProjectMembersRaw(requestParameters: GetProjectMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<UserLite>>>;
29
29
  /**
30
30
  * Retrieve all users who are members of the specified project.
31
31
  * List project members
32
32
  */
33
- getProjectMembers(requestParameters: GetProjectMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserLite>;
33
+ getProjectMembers(requestParameters: GetProjectMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<UserLite>>;
34
34
  /**
35
35
  * Retrieve all users who are members of the specified workspace.
36
36
  * List workspace members
@@ -127,7 +127,7 @@ var MembersApi = /** @class */ (function (_super) {
127
127
  }, initOverrides)];
128
128
  case 7:
129
129
  response = _g.sent();
130
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.UserLiteFromJSON)(jsonValue); })];
130
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.UserLiteFromJSON); })];
131
131
  }
132
132
  });
133
133
  });
@@ -63,12 +63,12 @@ export declare class WorkItemTypesApi extends runtime.BaseAPI {
63
63
  * List all issue types for a project
64
64
  * List issue types
65
65
  */
66
- listIssueTypesRaw(requestParameters: ListIssueTypesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IssueTypeAPI>>;
66
+ listIssueTypesRaw(requestParameters: ListIssueTypesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<IssueTypeAPI>>>;
67
67
  /**
68
68
  * List all issue types for a project
69
69
  * List issue types
70
70
  */
71
- listIssueTypes(requestParameters: ListIssueTypesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IssueTypeAPI>;
71
+ listIssueTypes(requestParameters: ListIssueTypesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<IssueTypeAPI>>;
72
72
  /**
73
73
  * Retrieve an issue type by id
74
74
  * Retrieve an issue type by id
@@ -285,7 +285,7 @@ var WorkItemTypesApi = /** @class */ (function (_super) {
285
285
  }, initOverrides)];
286
286
  case 7:
287
287
  response = _g.sent();
288
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.IssueTypeAPIFromJSON)(jsonValue); })];
288
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.IssueTypeAPIFromJSON); })];
289
289
  }
290
290
  });
291
291
  });
@@ -8,6 +8,7 @@
8
8
  * NOTE: This class is auto generated.
9
9
  * Do not edit the class manually.
10
10
  */
11
+ import type { IssueSearchItem } from './IssueSearchItem';
11
12
  /**
12
13
  * Serializer for work item search result data formatting.
13
14
  *
@@ -18,41 +19,11 @@
18
19
  */
19
20
  export interface IssueSearch {
20
21
  /**
21
- * Issue ID
22
- * @type {string}
22
+ * Array of search result issues
23
+ * @type {Array<IssueSearchItem>}
23
24
  * @memberof IssueSearch
24
25
  */
25
- id: string;
26
- /**
27
- * Issue name
28
- * @type {string}
29
- * @memberof IssueSearch
30
- */
31
- name: string;
32
- /**
33
- * Issue sequence ID
34
- * @type {string}
35
- * @memberof IssueSearch
36
- */
37
- sequenceId: string;
38
- /**
39
- * Project identifier
40
- * @type {string}
41
- * @memberof IssueSearch
42
- */
43
- projectIdentifier: string;
44
- /**
45
- * Project ID
46
- * @type {string}
47
- * @memberof IssueSearch
48
- */
49
- projectId: string;
50
- /**
51
- * Workspace slug
52
- * @type {string}
53
- * @memberof IssueSearch
54
- */
55
- workspaceSlug: string;
26
+ issues: Array<IssueSearchItem>;
56
27
  }
57
28
  /**
58
29
  * Check if a given object implements the IssueSearch interface.
@@ -17,21 +17,12 @@ exports.IssueSearchFromJSON = IssueSearchFromJSON;
17
17
  exports.IssueSearchFromJSONTyped = IssueSearchFromJSONTyped;
18
18
  exports.IssueSearchToJSON = IssueSearchToJSON;
19
19
  exports.IssueSearchToJSONTyped = IssueSearchToJSONTyped;
20
+ var IssueSearchItem_1 = require("./IssueSearchItem");
20
21
  /**
21
22
  * Check if a given object implements the IssueSearch interface.
22
23
  */
23
24
  function instanceOfIssueSearch(value) {
24
- if (!('id' in value) || value['id'] === undefined)
25
- return false;
26
- if (!('name' in value) || value['name'] === undefined)
27
- return false;
28
- if (!('sequenceId' in value) || value['sequenceId'] === undefined)
29
- return false;
30
- if (!('projectIdentifier' in value) || value['projectIdentifier'] === undefined)
31
- return false;
32
- if (!('projectId' in value) || value['projectId'] === undefined)
33
- return false;
34
- if (!('workspaceSlug' in value) || value['workspaceSlug'] === undefined)
25
+ if (!('issues' in value) || value['issues'] === undefined)
35
26
  return false;
36
27
  return true;
37
28
  }
@@ -43,12 +34,7 @@ function IssueSearchFromJSONTyped(json, ignoreDiscriminator) {
43
34
  return json;
44
35
  }
45
36
  return {
46
- 'id': json['id'],
47
- 'name': json['name'],
48
- 'sequenceId': json['sequence_id'],
49
- 'projectIdentifier': json['project__identifier'],
50
- 'projectId': json['project_id'],
51
- 'workspaceSlug': json['workspace__slug'],
37
+ 'issues': (json['issues'].map(IssueSearchItem_1.IssueSearchItemFromJSON)),
52
38
  };
53
39
  }
54
40
  function IssueSearchToJSON(json) {
@@ -60,11 +46,6 @@ function IssueSearchToJSONTyped(value, ignoreDiscriminator) {
60
46
  return value;
61
47
  }
62
48
  return {
63
- 'id': value['id'],
64
- 'name': value['name'],
65
- 'sequence_id': value['sequenceId'],
66
- 'project__identifier': value['projectIdentifier'],
67
- 'project_id': value['projectId'],
68
- 'workspace__slug': value['workspaceSlug'],
49
+ 'issues': (value['issues'].map(IssueSearchItem_1.IssueSearchItemToJSON)),
69
50
  };
70
51
  }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * The Plane REST API
3
+ * The Plane REST API Visit our quick start guide and full API documentation at [developers.plane.so](https://developers.plane.so/api-reference/introduction).
4
+ *
5
+ * The version of the API Spec: 0.0.1
6
+ * Contact: support@plane.so
7
+ *
8
+ * NOTE: This class is auto generated.
9
+ * Do not edit the class manually.
10
+ */
11
+ /**
12
+ * Individual issue component for search results.
13
+ *
14
+ * Provides standardized search result structure including work item identifiers,
15
+ * project context, and workspace information for search API responses.
16
+ * @export
17
+ * @interface IssueSearchItem
18
+ */
19
+ export interface IssueSearchItem {
20
+ /**
21
+ * Issue ID
22
+ * @type {string}
23
+ * @memberof IssueSearchItem
24
+ */
25
+ id: string;
26
+ /**
27
+ * Issue name
28
+ * @type {string}
29
+ * @memberof IssueSearchItem
30
+ */
31
+ name: string;
32
+ /**
33
+ * Issue sequence ID
34
+ * @type {string}
35
+ * @memberof IssueSearchItem
36
+ */
37
+ sequenceId: string;
38
+ /**
39
+ * Project identifier
40
+ * @type {string}
41
+ * @memberof IssueSearchItem
42
+ */
43
+ projectIdentifier: string;
44
+ /**
45
+ * Project ID
46
+ * @type {string}
47
+ * @memberof IssueSearchItem
48
+ */
49
+ projectId: string;
50
+ /**
51
+ * Workspace slug
52
+ * @type {string}
53
+ * @memberof IssueSearchItem
54
+ */
55
+ workspaceSlug: string;
56
+ }
57
+ /**
58
+ * Check if a given object implements the IssueSearchItem interface.
59
+ */
60
+ export declare function instanceOfIssueSearchItem(value: object): value is IssueSearchItem;
61
+ export declare function IssueSearchItemFromJSON(json: any): IssueSearchItem;
62
+ export declare function IssueSearchItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): IssueSearchItem;
63
+ export declare function IssueSearchItemToJSON(json: any): IssueSearchItem;
64
+ export declare function IssueSearchItemToJSONTyped(value?: IssueSearchItem | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Plane REST API
6
+ * The Plane REST API Visit our quick start guide and full API documentation at [developers.plane.so](https://developers.plane.so/api-reference/introduction).
7
+ *
8
+ * The version of the API Spec: 0.0.1
9
+ * Contact: support@plane.so
10
+ *
11
+ * NOTE: This class is auto generated.
12
+ * Do not edit the class manually.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.instanceOfIssueSearchItem = instanceOfIssueSearchItem;
16
+ exports.IssueSearchItemFromJSON = IssueSearchItemFromJSON;
17
+ exports.IssueSearchItemFromJSONTyped = IssueSearchItemFromJSONTyped;
18
+ exports.IssueSearchItemToJSON = IssueSearchItemToJSON;
19
+ exports.IssueSearchItemToJSONTyped = IssueSearchItemToJSONTyped;
20
+ /**
21
+ * Check if a given object implements the IssueSearchItem interface.
22
+ */
23
+ function instanceOfIssueSearchItem(value) {
24
+ if (!('id' in value) || value['id'] === undefined)
25
+ return false;
26
+ if (!('name' in value) || value['name'] === undefined)
27
+ return false;
28
+ if (!('sequenceId' in value) || value['sequenceId'] === undefined)
29
+ return false;
30
+ if (!('projectIdentifier' in value) || value['projectIdentifier'] === undefined)
31
+ return false;
32
+ if (!('projectId' in value) || value['projectId'] === undefined)
33
+ return false;
34
+ if (!('workspaceSlug' in value) || value['workspaceSlug'] === undefined)
35
+ return false;
36
+ return true;
37
+ }
38
+ function IssueSearchItemFromJSON(json) {
39
+ return IssueSearchItemFromJSONTyped(json, false);
40
+ }
41
+ function IssueSearchItemFromJSONTyped(json, ignoreDiscriminator) {
42
+ if (json == null) {
43
+ return json;
44
+ }
45
+ return {
46
+ 'id': json['id'],
47
+ 'name': json['name'],
48
+ 'sequenceId': json['sequence_id'],
49
+ 'projectIdentifier': json['project__identifier'],
50
+ 'projectId': json['project_id'],
51
+ 'workspaceSlug': json['workspace__slug'],
52
+ };
53
+ }
54
+ function IssueSearchItemToJSON(json) {
55
+ return IssueSearchItemToJSONTyped(json, false);
56
+ }
57
+ function IssueSearchItemToJSONTyped(value, ignoreDiscriminator) {
58
+ if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
59
+ if (value == null) {
60
+ return value;
61
+ }
62
+ return {
63
+ 'id': value['id'],
64
+ 'name': value['name'],
65
+ 'sequence_id': value['sequenceId'],
66
+ 'project__identifier': value['projectIdentifier'],
67
+ 'project_id': value['projectId'],
68
+ 'workspace__slug': value['workspaceSlug'],
69
+ };
70
+ }
@@ -60,12 +60,6 @@ export interface State {
60
60
  * @memberof State
61
61
  */
62
62
  color: string;
63
- /**
64
- *
65
- * @type {string}
66
- * @memberof State
67
- */
68
- readonly slug?: string;
69
63
  /**
70
64
  *
71
65
  * @type {number}
@@ -134,4 +128,4 @@ export declare function instanceOfState(value: object): value is State;
134
128
  export declare function StateFromJSON(json: any): State;
135
129
  export declare function StateFromJSONTyped(json: any, ignoreDiscriminator: boolean): State;
136
130
  export declare function StateToJSON(json: any): State;
137
- export declare function StateToJSONTyped(value?: Omit<State, 'id' | 'created_at' | 'updated_at' | 'deleted_at' | 'slug' | 'created_by' | 'updated_by' | 'project' | 'workspace'> | null, ignoreDiscriminator?: boolean): any;
131
+ export declare function StateToJSONTyped(value?: Omit<State, 'id' | 'created_at' | 'updated_at' | 'deleted_at' | 'created_by' | 'updated_by' | 'project' | 'workspace'> | null, ignoreDiscriminator?: boolean): any;
@@ -43,7 +43,6 @@ function StateFromJSONTyped(json, ignoreDiscriminator) {
43
43
  'name': json['name'],
44
44
  'description': json['description'] == null ? undefined : json['description'],
45
45
  'color': json['color'],
46
- 'slug': json['slug'] == null ? undefined : json['slug'],
47
46
  'sequence': json['sequence'] == null ? undefined : json['sequence'],
48
47
  'group': json['group'] == null ? undefined : (0, GroupEnum_1.GroupEnumFromJSON)(json['group']),
49
48
  'isTriage': json['is_triage'] == null ? undefined : json['is_triage'],
@@ -29,6 +29,7 @@ export * from './IssuePropertyValueAPI';
29
29
  export * from './IssuePropertyValueAPIRequest';
30
30
  export * from './IssueRequest';
31
31
  export * from './IssueSearch';
32
+ export * from './IssueSearchItem';
32
33
  export * from './IssueTypeAPI';
33
34
  export * from './IssueTypeAPIRequest';
34
35
  export * from './IssueWorkLogAPI';
@@ -46,6 +46,7 @@ __exportStar(require("./IssuePropertyValueAPI"), exports);
46
46
  __exportStar(require("./IssuePropertyValueAPIRequest"), exports);
47
47
  __exportStar(require("./IssueRequest"), exports);
48
48
  __exportStar(require("./IssueSearch"), exports);
49
+ __exportStar(require("./IssueSearchItem"), exports);
49
50
  __exportStar(require("./IssueTypeAPI"), exports);
50
51
  __exportStar(require("./IssueTypeAPIRequest"), exports);
51
52
  __exportStar(require("./IssueWorkLogAPI"), exports);
@@ -8,7 +8,7 @@ export declare class OAuthApi extends runtime.BaseAPI {
8
8
  private clientSecret;
9
9
  private redirectUri;
10
10
  private baseUrl;
11
- constructor(configuration: runtime.Configuration, oauthConfig: {
11
+ constructor(configuration: runtime.Configuration, oauthConfig?: {
12
12
  clientId: string;
13
13
  clientSecret: string;
14
14
  redirectUri: string;
@@ -45,7 +45,7 @@ export declare class OAuthApi extends runtime.BaseAPI {
45
45
  * @param appInstallationId - The app installation ID
46
46
  * @returns Promise resolving to app installation
47
47
  */
48
- getAppInstallation(token: string, appInstallationId: string): Promise<PlaneOAuthAppInstallation>;
48
+ getAppInstallations(token: string, appInstallationId?: string): Promise<PlaneOAuthAppInstallation[]>;
49
49
  /**
50
50
  * Generate basic auth token from client_id and client_secret
51
51
  * @returns Base64 encoded basic auth token
package/dist/oauth/api.js CHANGED
@@ -60,10 +60,12 @@ var OAuthApi = /** @class */ (function (_super) {
60
60
  __extends(OAuthApi, _super);
61
61
  function OAuthApi(configuration, oauthConfig) {
62
62
  var _this = _super.call(this, configuration) || this;
63
- _this.clientId = oauthConfig.clientId;
64
- _this.clientSecret = oauthConfig.clientSecret;
65
- _this.redirectUri = oauthConfig.redirectUri;
66
- _this.baseUrl = configuration.basePath || "https://api.plane.so";
63
+ if (oauthConfig) {
64
+ _this.clientId = oauthConfig.clientId;
65
+ _this.clientSecret = oauthConfig.clientSecret;
66
+ _this.redirectUri = oauthConfig.redirectUri;
67
+ _this.baseUrl = configuration.basePath || "https://api.plane.so";
68
+ }
67
69
  return _this;
68
70
  }
69
71
  /**
@@ -197,17 +199,21 @@ var OAuthApi = /** @class */ (function (_super) {
197
199
  * @param appInstallationId - The app installation ID
198
200
  * @returns Promise resolving to app installation
199
201
  */
200
- OAuthApi.prototype.getAppInstallation = function (token, appInstallationId) {
202
+ OAuthApi.prototype.getAppInstallations = function (token, appInstallationId) {
201
203
  return __awaiter(this, void 0, void 0, function () {
202
- var headers, response, data;
204
+ var headers, path, response, data;
203
205
  return __generator(this, function (_a) {
204
206
  switch (_a.label) {
205
207
  case 0:
206
208
  headers = {
207
209
  Authorization: "Bearer ".concat(token),
208
210
  };
211
+ path = "/auth/o/app-installation/";
212
+ if (appInstallationId) {
213
+ path += "?id=".concat(appInstallationId);
214
+ }
209
215
  return [4 /*yield*/, this.request({
210
- path: "/auth/o/app-installation/?id=".concat(appInstallationId),
216
+ path: path,
211
217
  method: "GET",
212
218
  headers: headers,
213
219
  })];
@@ -219,7 +225,7 @@ var OAuthApi = /** @class */ (function (_super) {
219
225
  if (!data || data.length === 0) {
220
226
  throw new runtime.ResponseError(response, "App installation not found");
221
227
  }
222
- return [2 /*return*/, data[0]];
228
+ return [2 /*return*/, data];
223
229
  }
224
230
  });
225
231
  });
package/dist/runtime.js CHANGED
@@ -148,7 +148,7 @@ var Configuration = /** @class */ (function () {
148
148
  Object.defineProperty(Configuration.prototype, "accessToken", {
149
149
  get: function () {
150
150
  var _this = this;
151
- var accessToken = this.configuration.accessToken;
151
+ var accessToken = "Bearer ".concat(this.configuration.accessToken);
152
152
  if (accessToken) {
153
153
  return typeof accessToken === 'function' ? accessToken : function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
154
154
  return [2 /*return*/, accessToken];
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@makeplane/plane-node-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Node SDK for Plane",
5
5
  "author": "Plane <support@plane.so>",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/makeplane/plane-node-sdk.git"
9
9
  },
10
+ "engines": {
11
+ "node": ">=18.0.0"
12
+ },
10
13
  "main": "./dist/index.js",
11
14
  "typings": "./dist/index.d.ts",
12
15
  "scripts": {
@@ -42,7 +42,7 @@ export class MembersApi extends runtime.BaseAPI {
42
42
  * Retrieve all users who are members of the specified project.
43
43
  * List project members
44
44
  */
45
- async getProjectMembersRaw(requestParameters: GetProjectMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserLite>> {
45
+ async getProjectMembersRaw(requestParameters: GetProjectMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<UserLite>>> {
46
46
  if (requestParameters['projectId'] == null) {
47
47
  throw new runtime.RequiredError(
48
48
  'projectId',
@@ -82,14 +82,14 @@ export class MembersApi extends runtime.BaseAPI {
82
82
  query: queryParameters,
83
83
  }, initOverrides);
84
84
 
85
- return new runtime.JSONApiResponse(response, (jsonValue) => UserLiteFromJSON(jsonValue));
85
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UserLiteFromJSON));
86
86
  }
87
87
 
88
88
  /**
89
89
  * Retrieve all users who are members of the specified project.
90
90
  * List project members
91
91
  */
92
- async getProjectMembers(requestParameters: GetProjectMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserLite> {
92
+ async getProjectMembers(requestParameters: GetProjectMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<UserLite>> {
93
93
  const response = await this.getProjectMembersRaw(requestParameters, initOverrides);
94
94
  return await response.value();
95
95
  }
@@ -194,7 +194,7 @@ export class WorkItemTypesApi extends runtime.BaseAPI {
194
194
  * List all issue types for a project
195
195
  * List issue types
196
196
  */
197
- async listIssueTypesRaw(requestParameters: ListIssueTypesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IssueTypeAPI>> {
197
+ async listIssueTypesRaw(requestParameters: ListIssueTypesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<IssueTypeAPI>>> {
198
198
  if (requestParameters['projectId'] == null) {
199
199
  throw new runtime.RequiredError(
200
200
  'projectId',
@@ -234,14 +234,14 @@ export class WorkItemTypesApi extends runtime.BaseAPI {
234
234
  query: queryParameters,
235
235
  }, initOverrides);
236
236
 
237
- return new runtime.JSONApiResponse(response, (jsonValue) => IssueTypeAPIFromJSON(jsonValue));
237
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(IssueTypeAPIFromJSON));
238
238
  }
239
239
 
240
240
  /**
241
241
  * List all issue types for a project
242
242
  * List issue types
243
243
  */
244
- async listIssueTypes(requestParameters: ListIssueTypesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IssueTypeAPI> {
244
+ async listIssueTypes(requestParameters: ListIssueTypesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<IssueTypeAPI>> {
245
245
  const response = await this.listIssueTypesRaw(requestParameters, initOverrides);
246
246
  return await response.value();
247
247
  }
@@ -12,6 +12,14 @@
12
12
  */
13
13
 
14
14
  import { mapValues } from '../runtime';
15
+ import type { IssueSearchItem } from './IssueSearchItem';
16
+ import {
17
+ IssueSearchItemFromJSON,
18
+ IssueSearchItemFromJSONTyped,
19
+ IssueSearchItemToJSON,
20
+ IssueSearchItemToJSONTyped,
21
+ } from './IssueSearchItem';
22
+
15
23
  /**
16
24
  * Serializer for work item search result data formatting.
17
25
  *
@@ -22,53 +30,18 @@ import { mapValues } from '../runtime';
22
30
  */
23
31
  export interface IssueSearch {
24
32
  /**
25
- * Issue ID
26
- * @type {string}
27
- * @memberof IssueSearch
28
- */
29
- id: string;
30
- /**
31
- * Issue name
32
- * @type {string}
33
- * @memberof IssueSearch
34
- */
35
- name: string;
36
- /**
37
- * Issue sequence ID
38
- * @type {string}
39
- * @memberof IssueSearch
40
- */
41
- sequenceId: string;
42
- /**
43
- * Project identifier
44
- * @type {string}
45
- * @memberof IssueSearch
46
- */
47
- projectIdentifier: string;
48
- /**
49
- * Project ID
50
- * @type {string}
51
- * @memberof IssueSearch
52
- */
53
- projectId: string;
54
- /**
55
- * Workspace slug
56
- * @type {string}
33
+ * Array of search result issues
34
+ * @type {Array<IssueSearchItem>}
57
35
  * @memberof IssueSearch
58
36
  */
59
- workspaceSlug: string;
37
+ issues: Array<IssueSearchItem>;
60
38
  }
61
39
 
62
40
  /**
63
41
  * Check if a given object implements the IssueSearch interface.
64
42
  */
65
43
  export function instanceOfIssueSearch(value: object): value is IssueSearch {
66
- if (!('id' in value) || value['id'] === undefined) return false;
67
- if (!('name' in value) || value['name'] === undefined) return false;
68
- if (!('sequenceId' in value) || value['sequenceId'] === undefined) return false;
69
- if (!('projectIdentifier' in value) || value['projectIdentifier'] === undefined) return false;
70
- if (!('projectId' in value) || value['projectId'] === undefined) return false;
71
- if (!('workspaceSlug' in value) || value['workspaceSlug'] === undefined) return false;
44
+ if (!('issues' in value) || value['issues'] === undefined) return false;
72
45
  return true;
73
46
  }
74
47
 
@@ -82,12 +55,7 @@ export function IssueSearchFromJSONTyped(json: any, ignoreDiscriminator: boolean
82
55
  }
83
56
  return {
84
57
 
85
- 'id': json['id'],
86
- 'name': json['name'],
87
- 'sequenceId': json['sequence_id'],
88
- 'projectIdentifier': json['project__identifier'],
89
- 'projectId': json['project_id'],
90
- 'workspaceSlug': json['workspace__slug'],
58
+ 'issues': ((json['issues'] as Array<any>).map(IssueSearchItemFromJSON)),
91
59
  };
92
60
  }
93
61
 
@@ -102,12 +70,7 @@ export function IssueSearchToJSONTyped(value?: IssueSearch | null, ignoreDiscrim
102
70
 
103
71
  return {
104
72
 
105
- 'id': value['id'],
106
- 'name': value['name'],
107
- 'sequence_id': value['sequenceId'],
108
- 'project__identifier': value['projectIdentifier'],
109
- 'project_id': value['projectId'],
110
- 'workspace__slug': value['workspaceSlug'],
73
+ 'issues': ((value['issues'] as Array<any>).map(IssueSearchItemToJSON)),
111
74
  };
112
75
  }
113
76
 
@@ -0,0 +1,113 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * The Plane REST API
5
+ * The Plane REST API Visit our quick start guide and full API documentation at [developers.plane.so](https://developers.plane.so/api-reference/introduction).
6
+ *
7
+ * The version of the API Spec: 0.0.1
8
+ * Contact: support@plane.so
9
+ *
10
+ * NOTE: This class is auto generated.
11
+ * Do not edit the class manually.
12
+ */
13
+
14
+ import { mapValues } from '../runtime';
15
+ /**
16
+ * Individual issue component for search results.
17
+ *
18
+ * Provides standardized search result structure including work item identifiers,
19
+ * project context, and workspace information for search API responses.
20
+ * @export
21
+ * @interface IssueSearchItem
22
+ */
23
+ export interface IssueSearchItem {
24
+ /**
25
+ * Issue ID
26
+ * @type {string}
27
+ * @memberof IssueSearchItem
28
+ */
29
+ id: string;
30
+ /**
31
+ * Issue name
32
+ * @type {string}
33
+ * @memberof IssueSearchItem
34
+ */
35
+ name: string;
36
+ /**
37
+ * Issue sequence ID
38
+ * @type {string}
39
+ * @memberof IssueSearchItem
40
+ */
41
+ sequenceId: string;
42
+ /**
43
+ * Project identifier
44
+ * @type {string}
45
+ * @memberof IssueSearchItem
46
+ */
47
+ projectIdentifier: string;
48
+ /**
49
+ * Project ID
50
+ * @type {string}
51
+ * @memberof IssueSearchItem
52
+ */
53
+ projectId: string;
54
+ /**
55
+ * Workspace slug
56
+ * @type {string}
57
+ * @memberof IssueSearchItem
58
+ */
59
+ workspaceSlug: string;
60
+ }
61
+
62
+ /**
63
+ * Check if a given object implements the IssueSearchItem interface.
64
+ */
65
+ export function instanceOfIssueSearchItem(value: object): value is IssueSearchItem {
66
+ if (!('id' in value) || value['id'] === undefined) return false;
67
+ if (!('name' in value) || value['name'] === undefined) return false;
68
+ if (!('sequenceId' in value) || value['sequenceId'] === undefined) return false;
69
+ if (!('projectIdentifier' in value) || value['projectIdentifier'] === undefined) return false;
70
+ if (!('projectId' in value) || value['projectId'] === undefined) return false;
71
+ if (!('workspaceSlug' in value) || value['workspaceSlug'] === undefined) return false;
72
+ return true;
73
+ }
74
+
75
+ export function IssueSearchItemFromJSON(json: any): IssueSearchItem {
76
+ return IssueSearchItemFromJSONTyped(json, false);
77
+ }
78
+
79
+ export function IssueSearchItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): IssueSearchItem {
80
+ if (json == null) {
81
+ return json;
82
+ }
83
+ return {
84
+
85
+ 'id': json['id'],
86
+ 'name': json['name'],
87
+ 'sequenceId': json['sequence_id'],
88
+ 'projectIdentifier': json['project__identifier'],
89
+ 'projectId': json['project_id'],
90
+ 'workspaceSlug': json['workspace__slug'],
91
+ };
92
+ }
93
+
94
+ export function IssueSearchItemToJSON(json: any): IssueSearchItem {
95
+ return IssueSearchItemToJSONTyped(json, false);
96
+ }
97
+
98
+ export function IssueSearchItemToJSONTyped(value?: IssueSearchItem | null, ignoreDiscriminator: boolean = false): any {
99
+ if (value == null) {
100
+ return value;
101
+ }
102
+
103
+ return {
104
+
105
+ 'id': value['id'],
106
+ 'name': value['name'],
107
+ 'sequence_id': value['sequenceId'],
108
+ 'project__identifier': value['projectIdentifier'],
109
+ 'project_id': value['projectId'],
110
+ 'workspace__slug': value['workspaceSlug'],
111
+ };
112
+ }
113
+
@@ -71,12 +71,6 @@ export interface State {
71
71
  * @memberof State
72
72
  */
73
73
  color: string;
74
- /**
75
- *
76
- * @type {string}
77
- * @memberof State
78
- */
79
- readonly slug?: string;
80
74
  /**
81
75
  *
82
76
  * @type {number}
@@ -167,7 +161,6 @@ export function StateFromJSONTyped(json: any, ignoreDiscriminator: boolean): Sta
167
161
  'name': json['name'],
168
162
  'description': json['description'] == null ? undefined : json['description'],
169
163
  'color': json['color'],
170
- 'slug': json['slug'] == null ? undefined : json['slug'],
171
164
  'sequence': json['sequence'] == null ? undefined : json['sequence'],
172
165
  'group': json['group'] == null ? undefined : GroupEnumFromJSON(json['group']),
173
166
  'isTriage': json['is_triage'] == null ? undefined : json['is_triage'],
@@ -185,7 +178,7 @@ export function StateToJSON(json: any): State {
185
178
  return StateToJSONTyped(json, false);
186
179
  }
187
180
 
188
- export function StateToJSONTyped(value?: Omit<State, 'id'|'created_at'|'updated_at'|'deleted_at'|'slug'|'created_by'|'updated_by'|'project'|'workspace'> | null, ignoreDiscriminator: boolean = false): any {
181
+ export function StateToJSONTyped(value?: Omit<State, 'id'|'created_at'|'updated_at'|'deleted_at'|'created_by'|'updated_by'|'project'|'workspace'> | null, ignoreDiscriminator: boolean = false): any {
189
182
  if (value == null) {
190
183
  return value;
191
184
  }
@@ -31,6 +31,7 @@ export * from './IssuePropertyValueAPI';
31
31
  export * from './IssuePropertyValueAPIRequest';
32
32
  export * from './IssueRequest';
33
33
  export * from './IssueSearch';
34
+ export * from './IssueSearchItem';
34
35
  export * from './IssueTypeAPI';
35
36
  export * from './IssueTypeAPIRequest';
36
37
  export * from './IssueWorkLogAPI';
package/src/oauth/api.ts CHANGED
@@ -12,17 +12,19 @@ export class OAuthApi extends runtime.BaseAPI {
12
12
 
13
13
  constructor(
14
14
  configuration: runtime.Configuration,
15
- oauthConfig: {
15
+ oauthConfig?: {
16
16
  clientId: string;
17
17
  clientSecret: string;
18
18
  redirectUri: string;
19
19
  }
20
20
  ) {
21
21
  super(configuration);
22
- this.clientId = oauthConfig.clientId;
23
- this.clientSecret = oauthConfig.clientSecret;
24
- this.redirectUri = oauthConfig.redirectUri;
25
- this.baseUrl = configuration.basePath || "https://api.plane.so";
22
+ if (oauthConfig) {
23
+ this.clientId = oauthConfig.clientId;
24
+ this.clientSecret = oauthConfig.clientSecret;
25
+ this.redirectUri = oauthConfig.redirectUri;
26
+ this.baseUrl = configuration.basePath || "https://api.plane.so";
27
+ }
26
28
  }
27
29
 
28
30
  /**
@@ -143,16 +145,21 @@ export class OAuthApi extends runtime.BaseAPI {
143
145
  * @param appInstallationId - The app installation ID
144
146
  * @returns Promise resolving to app installation
145
147
  */
146
- async getAppInstallation(
148
+ async getAppInstallations(
147
149
  token: string,
148
- appInstallationId: string
149
- ): Promise<PlaneOAuthAppInstallation> {
150
+ appInstallationId?: string
151
+ ): Promise<PlaneOAuthAppInstallation[]> {
150
152
  const headers: runtime.HTTPHeaders = {
151
153
  Authorization: `Bearer ${token}`,
152
154
  };
153
155
 
156
+ let path = `/auth/o/app-installation/`;
157
+ if (appInstallationId) {
158
+ path += `?id=${appInstallationId}`;
159
+ }
160
+
154
161
  const response = await this.request({
155
- path: `/auth/o/app-installation/?id=${appInstallationId}`,
162
+ path: path,
156
163
  method: "GET",
157
164
  headers: headers,
158
165
  });
@@ -162,7 +169,7 @@ export class OAuthApi extends runtime.BaseAPI {
162
169
  throw new runtime.ResponseError(response, "App installation not found");
163
170
  }
164
171
 
165
- return data[0];
172
+ return data;
166
173
  }
167
174
 
168
175
  /**
package/src/runtime.ts CHANGED
@@ -67,7 +67,7 @@ export class Configuration {
67
67
  }
68
68
 
69
69
  get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
70
- const accessToken = this.configuration.accessToken;
70
+ const accessToken = `Bearer ${this.configuration.accessToken}`;
71
71
  if (accessToken) {
72
72
  return typeof accessToken === 'function' ? accessToken : async () => accessToken;
73
73
  }