-
Notifications
You must be signed in to change notification settings - Fork 0
feat: publish sdk 0.1.5 with below changes #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Pages API - Issue Relation API - ModuleIssue API - CycleIssue API
WalkthroughAdds new APIs for epics, pages, and workspaces; introduces work item relations and attachment upload endpoints; adjusts certain endpoints to return arrays; replaces AccessEnum with AccessBd4Enum; replaces RelationTypeEnum with IssuePropertyAPIRelationTypeEnum; adds Epic and paginated models; bumps README/package versions and updates many headers to API spec 0.0.2. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant EpicsApi
participant Auth as Auth (API Key/OAuth2)
participant Server as Plane API
Client->>EpicsApi: listEpics(projectId, slug, cursor?, perPage?)
EpicsApi->>Auth: Attach X-API-Key/Authorization
EpicsApi->>Server: GET /workspaces/{slug}/projects/{project_id}/epics
Server-->>EpicsApi: PaginatedEpicResponse (JSON)
EpicsApi-->>Client: PaginatedEpicResponse
Client->>EpicsApi: retrieveEpic(pk, projectId, slug, fields?)
EpicsApi->>Server: GET /.../epics/{pk}
Server-->>EpicsApi: Epic (JSON)
EpicsApi-->>Client: Epic
sequenceDiagram
autonumber
actor Client
participant WorkItemsApi
participant Server as Plane API
Note over Client,WorkItemsApi: Relations
Client->>WorkItemsApi: createWorkItemRelation({relationType, issues}, ids)
WorkItemsApi->>Server: POST /issues/{issue_id}/relations/
Server-->>WorkItemsApi: IssueRelation (JSON)
WorkItemsApi-->>Client: IssueRelation
Client->>WorkItemsApi: listWorkItemRelations(issueId,...)
WorkItemsApi->>Server: GET /issues/{issue_id}/relations/
Server-->>WorkItemsApi: IssueRelationResponse
WorkItemsApi-->>Client: IssueRelationResponse
Client->>WorkItemsApi: removeWorkItemRelation({relatedIssue}, ids)
WorkItemsApi->>Server: POST /issues/{issue_id}/relations/remove/
Server-->>WorkItemsApi: 204/OK
WorkItemsApi-->>Client: void
sequenceDiagram
autonumber
actor Client
participant PagesApi
participant Server as Plane API
Note over Client,PagesApi: Pages (Project/Workspace)
Client->>PagesApi: createProjectPage({name, descriptionHtml,...}, ids)
PagesApi->>Server: POST /projects/{project_id}/pages/
Server-->>PagesApi: PageCreateAPI
PagesApi-->>Client: PageCreateAPI
Client->>PagesApi: getWorkspacePageDetail(pk, slug)
PagesApi->>Server: GET /workspaces/{slug}/pages/{pk}/
Server-->>PagesApi: PageDetailAPI
PagesApi-->>Client: PageDetailAPI
sequenceDiagram
autonumber
actor Client
participant WorkspacesApi
participant Server as Plane API
Client->>WorkspacesApi: workspacesProjectsMembersCreate(projectId, slug)
WorkspacesApi->>Server: POST /workspaces/{slug}/projects/{project_id}/members/
Server-->>WorkspacesApi: 204/OK
WorkspacesApi-->>Client: void
sequenceDiagram
autonumber
actor Client
participant CyclesApi
participant ModulesApi
participant Server as Plane API
Note over Client,Server: add*WorkItems now return arrays
Client->>CyclesApi: addCycleWorkItems(...)
CyclesApi->>Server: POST /cycles/.../issues/
Server-->>CyclesApi: [CycleIssue]
CyclesApi-->>Client: Array<CycleIssue>
Client->>ModulesApi: addModuleWorkItems(...)
ModulesApi->>Server: POST /modules/.../issues/
Server-->>ModulesApi: [ModuleIssue]
ModulesApi-->>Client: Array<ModuleIssue>
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Nitpick comments (7)
src/apis/MembersApi.ts (2)
68-76
: Duplicate Authorization header assignment.
Authorization is set twice; second block is redundant. Remove the duplicate to avoid confusion.Apply this diff:
if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); } - if (this.configuration && this.configuration.accessToken) { - // oauth required - headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); - } -
117-125
: Duplicate Authorization header assignment.
Same redundancy in getWorkspaceMembersRaw. Remove the second block.Apply this diff:
if (this.configuration && this.configuration.accessToken) { // oauth required headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); } - if (this.configuration && this.configuration.accessToken) { - // oauth required - headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); - } -README.md (2)
39-39
: Consider unpinning version in install command for easier updates.
Using the package without the explicit version helps consumers get patch updates by default.Example:
- npm install @makeplane/plane-node-sdk --save
48-95
: Add a short example for newly added APIs.
A minimal snippet for Epics/Pages/Workspaces will help adopters of 0.1.5.Example:
import { Configuration, EpicsApi, PagesApi, WorkspacesApi } from "@makeplane/plane-node-sdk"; const config = new Configuration({ apiKey: "<PLANE_API_KEY>" }); const epics = new EpicsApi(config); const pages = new PagesApi(config); const workspaces = new WorkspacesApi(config); // e.g., list epics // await epics.listEpics({ slug: "<workspace-slug>", projectId: "<project-id>" });src/models/IssueRelationResponse.ts (1)
96-128
: Default relation arrays when deserializingRight now the deserializer forwards whatever the server returns. If an API response omits one of these relation groups or sends it as
null
, consumers of the SDK will seeundefined/null
even though the TypeScript contract promises an array. Defaulting each group to[]
keeps the client-side surface predictable and avoids downstream guards. Consider applying:- 'blocking': json['blocking'], - 'blockedBy': json['blocked_by'], - 'duplicate': json['duplicate'], - 'relatesTo': json['relates_to'], - 'startAfter': json['start_after'], - 'startBefore': json['start_before'], - 'finishAfter': json['finish_after'], - 'finishBefore': json['finish_before'], + 'blocking': json['blocking'] ?? [], + 'blockedBy': json['blocked_by'] ?? [], + 'duplicate': json['duplicate'] ?? [], + 'relatesTo': json['relates_to'] ?? [], + 'startAfter': json['start_after'] ?? [], + 'startBefore': json['start_before'] ?? [], + 'finishAfter': json['finish_after'] ?? [], + 'finishBefore': json['finish_before'] ?? [],src/apis/EpicsApi.ts (1)
81-89
: Remove the duplicate OAuth header assignmentEach block checks
configuration.accessToken
and writes the sameAuthorization
header twice. The second block is redundant, adds an extra awaited call, and makes it easier to introduce divergence later. Please drop the duplicate block in both places.- if (this.configuration && this.configuration.accessToken) { - // oauth required - headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); - }Also applies to: 148-156
src/apis/PagesApi.ts (1)
93-101
: Deduplicate the repeated Authorization header blockThe same
if (this.configuration && this.configuration.accessToken)
block appears twice in each method, performing identical work. Keeping only one instance in each spot eliminates unnecessary awaits and keeps the code generator-style output tidy.- if (this.configuration && this.configuration.accessToken) { - // oauth required - headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); - }Apply the change in all four affected locations (
createProjectPageRaw
,createWorkspacePageRaw
,getProjectPageDetailRaw
, andgetWorkspacePageDetailRaw
).Also applies to: 152-160, 216-224, 272-280
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (107)
.openapi-generator/FILES
(4 hunks)README.md
(2 hunks)package.json
(1 hunks)src/apis/AssetsApi.ts
(1 hunks)src/apis/CyclesApi.ts
(3 hunks)src/apis/EpicsApi.ts
(1 hunks)src/apis/IntakeApi.ts
(1 hunks)src/apis/LabelsApi.ts
(1 hunks)src/apis/MembersApi.ts
(1 hunks)src/apis/ModulesApi.ts
(3 hunks)src/apis/PagesApi.ts
(1 hunks)src/apis/ProjectsApi.ts
(1 hunks)src/apis/StatesApi.ts
(1 hunks)src/apis/UsersApi.ts
(1 hunks)src/apis/WorkItemActivityApi.ts
(1 hunks)src/apis/WorkItemAttachmentsApi.ts
(3 hunks)src/apis/WorkItemCommentsApi.ts
(1 hunks)src/apis/WorkItemLinksApi.ts
(1 hunks)src/apis/WorkItemPropertiesApi.ts
(3 hunks)src/apis/WorkItemTypesApi.ts
(1 hunks)src/apis/WorkItemWorklogsApi.ts
(1 hunks)src/apis/WorkItemsApi.ts
(9 hunks)src/apis/WorkspacesApi.ts
(1 hunks)src/apis/index.ts
(2 hunks)src/models/AccessBd4Enum.ts
(1 hunks)src/models/AccessEnum.ts
(0 hunks)src/models/Cycle.ts
(1 hunks)src/models/CycleCreateRequest.ts
(1 hunks)src/models/CycleIssue.ts
(1 hunks)src/models/CycleIssueRequestRequest.ts
(1 hunks)src/models/CycleLite.ts
(1 hunks)src/models/EntityTypeEnum.ts
(1 hunks)src/models/Epic.ts
(1 hunks)src/models/GenericAssetUploadRequest.ts
(1 hunks)src/models/GetWorkspaceMembers200ResponseInner.ts
(1 hunks)src/models/GroupEnum.ts
(1 hunks)src/models/IntakeIssue.ts
(1 hunks)src/models/IntakeIssueCreateRequest.ts
(1 hunks)src/models/IntakeWorkItemStatusEnum.ts
(1 hunks)src/models/Issue.ts
(1 hunks)src/models/IssueActivity.ts
(1 hunks)src/models/IssueAttachment.ts
(1 hunks)src/models/IssueAttachmentUploadRequest.ts
(1 hunks)src/models/IssueComment.ts
(4 hunks)src/models/IssueCommentCreateRequest.ts
(4 hunks)src/models/IssueDetail.ts
(1 hunks)src/models/IssueExpand.ts
(1 hunks)src/models/IssueForIntakeRequest.ts
(1 hunks)src/models/IssueLink.ts
(1 hunks)src/models/IssueLinkCreateRequest.ts
(1 hunks)src/models/IssuePropertyAPI.ts
(4 hunks)src/models/IssuePropertyAPIRelationTypeEnum.ts
(1 hunks)src/models/IssuePropertyAPIRequest.ts
(4 hunks)src/models/IssuePropertyOptionAPI.ts
(1 hunks)src/models/IssuePropertyOptionAPIRequest.ts
(1 hunks)src/models/IssuePropertyValueAPI.ts
(1 hunks)src/models/IssuePropertyValueAPIDetail.ts
(1 hunks)src/models/IssuePropertyValueAPIRequest.ts
(1 hunks)src/models/IssueRelation.ts
(1 hunks)src/models/IssueRelationCreateRelationTypeEnum.ts
(1 hunks)src/models/IssueRelationCreateRequest.ts
(1 hunks)src/models/IssueRelationRemoveRequest.ts
(1 hunks)src/models/IssueRelationResponse.ts
(1 hunks)src/models/IssueRequest.ts
(1 hunks)src/models/IssueSearch.ts
(1 hunks)src/models/IssueSearchItem.ts
(1 hunks)src/models/IssueTypeAPI.ts
(1 hunks)src/models/IssueTypeAPIRequest.ts
(1 hunks)src/models/IssueWorkLogAPI.ts
(1 hunks)src/models/IssueWorkLogAPIRequest.ts
(1 hunks)src/models/Label.ts
(1 hunks)src/models/LabelCreateUpdateRequest.ts
(1 hunks)src/models/Module.ts
(1 hunks)src/models/ModuleCreateRequest.ts
(1 hunks)src/models/ModuleIssue.ts
(1 hunks)src/models/ModuleIssueRequestRequest.ts
(1 hunks)src/models/ModuleLite.ts
(1 hunks)src/models/ModuleStatusEnum.ts
(1 hunks)src/models/NetworkEnum.ts
(1 hunks)src/models/PageCreateAPI.ts
(1 hunks)src/models/PageCreateAPIAccessEnum.ts
(1 hunks)src/models/PageCreateAPIRequest.ts
(1 hunks)src/models/PageDetailAPI.ts
(1 hunks)src/models/PaginatedArchivedCycleResponse.ts
(1 hunks)src/models/PaginatedArchivedModuleResponse.ts
(1 hunks)src/models/PaginatedCycleIssueResponse.ts
(1 hunks)src/models/PaginatedCycleResponse.ts
(1 hunks)src/models/PaginatedEpicResponse.ts
(1 hunks)src/models/PaginatedIntakeIssueResponse.ts
(1 hunks)src/models/PaginatedIssueActivityDetailResponse.ts
(1 hunks)src/models/PaginatedIssueActivityResponse.ts
(1 hunks)src/models/PaginatedIssueCommentResponse.ts
(1 hunks)src/models/PaginatedIssueLinkDetailResponse.ts
(1 hunks)src/models/PaginatedIssueLinkResponse.ts
(1 hunks)src/models/PaginatedLabelResponse.ts
(1 hunks)src/models/PaginatedModuleIssueResponse.ts
(1 hunks)src/models/PaginatedModuleResponse.ts
(1 hunks)src/models/PaginatedProjectResponse.ts
(1 hunks)src/models/PaginatedStateResponse.ts
(1 hunks)src/models/PaginatedWorkItemResponse.ts
(1 hunks)src/models/PatchedAssetUpdateRequest.ts
(1 hunks)src/models/PatchedCycleUpdateRequest.ts
(1 hunks)src/models/PatchedGenericAssetUpdateRequest.ts
(1 hunks)src/models/PatchedIntakeIssueUpdateRequest.ts
(1 hunks)src/models/PatchedIssueCommentCreateRequest.ts
(4 hunks)src/models/PatchedIssueLinkUpdateRequest.ts
(1 hunks)src/models/PatchedIssuePropertyAPIRequest.ts
(4 hunks)
⛔ Files not processed due to max files limit (27)
- src/models/PatchedIssuePropertyOptionAPIRequest.ts
- src/models/PatchedIssueRequest.ts
- src/models/PatchedIssueTypeAPIRequest.ts
- src/models/PatchedIssueWorkLogAPIRequest.ts
- src/models/PatchedLabelCreateUpdateRequest.ts
- src/models/PatchedModuleUpdateRequest.ts
- src/models/PatchedProjectUpdateRequest.ts
- src/models/PatchedStateRequest.ts
- src/models/PriorityEnum.ts
- src/models/Project.ts
- src/models/ProjectCreateRequest.ts
- src/models/ProjectWorklogSummary.ts
- src/models/PropertyTypeEnum.ts
- src/models/RelationTypeEnum.ts
- src/models/RetrieveWorkItemAttachment400Response.ts
- src/models/State.ts
- src/models/StateLite.ts
- src/models/StateRequest.ts
- src/models/TimezoneEnum.ts
- src/models/TransferCycleIssueRequestRequest.ts
- src/models/TransferCycleWorkItems200Response.ts
- src/models/TransferCycleWorkItems400Response.ts
- src/models/TypeEnum.ts
- src/models/UserAssetUploadRequest.ts
- src/models/UserLite.ts
- src/models/index.ts
- src/runtime.ts
💤 Files with no reviewable changes (1)
- src/models/AccessEnum.ts
🧰 Additional context used
🧬 Code graph analysis (19)
src/apis/WorkspacesApi.ts (1)
src/runtime.ts (3)
InitOverrideFunction
(297-297)ApiResponse
(392-395)HTTPHeaders
(291-291)
src/apis/WorkItemAttachmentsApi.ts (1)
src/runtime.ts (3)
InitOverrideFunction
(297-297)ApiResponse
(392-395)HTTPHeaders
(291-291)
src/models/PatchedIssueCommentCreateRequest.ts (1)
src/models/AccessBd4Enum.ts (2)
AccessBd4EnumFromJSON
(38-40)AccessBd4EnumToJSON
(46-48)
src/apis/WorkItemPropertiesApi.ts (2)
src/runtime.ts (3)
InitOverrideFunction
(297-297)ApiResponse
(392-395)HTTPHeaders
(291-291)src/models/IssuePropertyValueAPI.ts (2)
IssuePropertyValueAPI
(20-129)IssuePropertyValueAPIFromJSON
(140-142)
src/models/PaginatedEpicResponse.ts (1)
src/models/Epic.ts (3)
Epic
(28-209)EpicFromJSON
(223-225)EpicToJSON
(266-268)
src/apis/EpicsApi.ts (3)
src/runtime.ts (3)
InitOverrideFunction
(297-297)ApiResponse
(392-395)HTTPHeaders
(291-291)src/models/PaginatedEpicResponse.ts (2)
PaginatedEpicResponse
(28-101)PaginatedEpicResponseFromJSON
(122-124)src/models/Epic.ts (2)
Epic
(28-209)EpicFromJSON
(223-225)
src/apis/CyclesApi.ts (2)
src/runtime.ts (2)
InitOverrideFunction
(297-297)ApiResponse
(392-395)src/models/CycleIssue.ts (2)
CycleIssue
(23-90)CycleIssueFromJSON
(101-103)
src/models/PageCreateAPIRequest.ts (1)
src/models/PageCreateAPIAccessEnum.ts (2)
PageCreateAPIAccessEnumFromJSON
(38-40)PageCreateAPIAccessEnumToJSON
(46-48)
src/models/IssuePropertyAPIRequest.ts (1)
src/models/IssuePropertyAPIRelationTypeEnum.ts (2)
IssuePropertyAPIRelationTypeEnumFromJSON
(38-40)IssuePropertyAPIRelationTypeEnumToJSON
(46-48)
src/models/Epic.ts (1)
src/models/PriorityEnum.ts (2)
PriorityEnumFromJSON
(44-46)PriorityEnumToJSON
(52-54)
src/models/PageCreateAPI.ts (1)
src/models/PageCreateAPIAccessEnum.ts (2)
PageCreateAPIAccessEnumFromJSON
(38-40)PageCreateAPIAccessEnumToJSON
(46-48)
src/models/IssueComment.ts (1)
src/models/AccessBd4Enum.ts (2)
AccessBd4EnumFromJSON
(38-40)AccessBd4EnumToJSON
(46-48)
src/models/PatchedIssuePropertyAPIRequest.ts (1)
src/models/IssuePropertyAPIRelationTypeEnum.ts (2)
IssuePropertyAPIRelationTypeEnumFromJSON
(38-40)IssuePropertyAPIRelationTypeEnumToJSON
(46-48)
src/models/IssueCommentCreateRequest.ts (1)
src/models/AccessBd4Enum.ts (2)
AccessBd4EnumFromJSON
(38-40)AccessBd4EnumToJSON
(46-48)
src/apis/ModulesApi.ts (2)
src/runtime.ts (2)
InitOverrideFunction
(297-297)ApiResponse
(392-395)src/models/ModuleIssue.ts (2)
ModuleIssue
(23-90)ModuleIssueFromJSON
(101-103)
src/models/IssuePropertyAPI.ts (1)
src/models/IssuePropertyAPIRelationTypeEnum.ts (2)
IssuePropertyAPIRelationTypeEnumFromJSON
(38-40)IssuePropertyAPIRelationTypeEnumToJSON
(46-48)
src/apis/WorkItemsApi.ts (5)
src/models/IssueRelationCreateRequest.ts (2)
IssueRelationCreateRequest
(31-53)IssueRelationCreateRequestToJSON
(81-83)src/models/IssueRelationRemoveRequest.ts (2)
IssueRelationRemoveRequest
(23-30)IssueRelationRemoveRequestToJSON
(54-56)src/runtime.ts (3)
InitOverrideFunction
(297-297)ApiResponse
(392-395)HTTPHeaders
(291-291)src/models/IssueRelation.ts (2)
IssueRelation
(23-102)IssueRelationFromJSON
(111-113)src/models/IssueRelationResponse.ts (2)
IssueRelationResponse
(22-71)IssueRelationResponseFromJSON
(88-90)
src/models/IssueRelationCreateRequest.ts (1)
src/models/IssueRelationCreateRelationTypeEnum.ts (2)
IssueRelationCreateRelationTypeEnumFromJSON
(50-52)IssueRelationCreateRelationTypeEnumToJSON
(58-60)
src/apis/PagesApi.ts (4)
src/models/PageCreateAPIRequest.ts (1)
PageCreateAPIRequest
(28-89)src/runtime.ts (3)
InitOverrideFunction
(297-297)ApiResponse
(392-395)HTTPHeaders
(291-291)src/models/PageCreateAPI.ts (1)
PageCreateAPI
(28-137)src/models/PageDetailAPI.ts (1)
PageDetailAPI
(20-75)
🔇 Additional comments (26)
src/models/IssueAttachmentUploadRequest.ts (1)
7-7
: API spec version bump looks correctHeader now matches the 0.0.2 spec used elsewhere in the PR. No further changes needed.
src/models/IssueWorkLogAPIRequest.ts (1)
7-7
: API header version bump aligns with the broader spec upgrade.Matches the other 0.0.2 updates in this release.
src/models/GetWorkspaceMembers200ResponseInner.ts (1)
7-7
: API spec version bump verifiedHeader reflects the new 0.0.2 spec without touching runtime behavior. 👍
src/models/IssueDetail.ts (1)
7-7
: Header version bump looks good.Thanks for syncing the generated model with API spec 0.0.2; no further changes needed here.
src/apis/StatesApi.ts (1)
7-7
: Header version bump looks good.Thanks for aligning the generated client metadata with API spec 0.0.2. All good here.
src/models/PatchedCycleUpdateRequest.ts (1)
7-7
: Doc comment version bump looks good.The spec header now matches the 0.0.2 rollout noted elsewhere in the PR. No additional changes needed.
src/models/IssuePropertyValueAPI.ts (1)
7-7
: Version header bump aligns with API spec 0.0.2.src/apis/WorkItemTypesApi.ts (1)
7-7
: Spec header bump looks good.The header now reflects the 0.0.2 spec, matching the broader SDK update.
src/apis/LabelsApi.ts (1)
7-7
: Spec header update acknowledgedThe version bump to 0.0.2 keeps this generated client aligned with the latest spec. No further action needed here.
src/models/IssueActivity.ts (1)
7-7
: Spec header update acknowledgedConfirming the header now references API spec 0.0.2; no additional changes required.
src/models/Module.ts (1)
7-7
: Spec header update acknowledgedThanks for keeping the auto-generated header in sync with spec version 0.0.2.
src/apis/AssetsApi.ts (1)
7-7
: Spec header update acknowledgedThe header update to API spec 0.0.2 looks good; no behavior changes observed.
src/models/PaginatedArchivedModuleResponse.ts (1)
7-7
: Spec header update acknowledgedVerified the header now targets spec 0.0.2; nothing else changed in this serializer.
src/apis/WorkItemPropertiesApi.ts (1)
103-108
: Double-check the unusedpropertyId
parameter.This new request type enforces
propertyId
, but the path never serializes it. Please confirm with the 0.0.2 spec whether the parameter (and the associatedreplace
) should be removed, or whether the path is missing a{property_id}
segment. Avoid forcing consumers to supply a parameter that cannot affect the request.src/models/Issue.ts (1)
7-7
: Spec header bump consistent with updated APIAPI spec reference now points to 0.0.2, which matches the broader version uplift in this release.
src/models/IssuePropertyOptionAPI.ts (1)
7-7
: Header version aligns with API 0.0.2Confirmed the autogenerated spec banner reflects the new API spec version without impacting runtime behavior.
src/models/PaginatedIssueLinkResponse.ts (1)
7-7
: Spec reference updated appropriatelyThe documentation banner now references API spec 0.0.2, keeping the model metadata in sync with the release.
src/models/IssueLinkCreateRequest.ts (1)
7-7
: API spec metadata in syncThe header comment correctly reflects API spec version 0.0.2 for this autogenerated model.
src/apis/WorkItemLinksApi.ts (1)
7-7
: Work item links API banner reflects spec 0.0.2Spec metadata is updated consistently; no functional changes observed.
src/apis/MembersApi.ts (1)
7-7
: Spec version bump looks good.
No functional impact; aligns with API Spec 0.0.2.package.json (1)
3-3
: Version bump acknowledged.
0.1.5 set. Ensure README and tags are aligned (they appear updated).README.md (1)
1-1
: README version updated.
Matches package.json (0.1.5).src/apis/index.ts (3)
5-5
: New API exports look good.
EpicsApi is correctly re-exported.
10-10
: New API exports look good.
PagesApi is correctly re-exported.
22-22
: Approve API exports All referenced files in src/apis exist and export EpicsApi, PagesApi, and WorkspacesApi classes.src/models/Epic.ts (1)
17-21
: PriorityEnum imports confirmed
Exports for PriorityEnumFromJSONTyped and PriorityEnumToJSONTyped exist in src/models/PriorityEnum.ts; imports are valid.
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
if (this.configuration && this.configuration.apiKey) { | ||
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuthentication authentication | ||
} | ||
|
||
if (this.configuration && this.configuration.accessToken) { | ||
// oauth required | ||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | ||
} | ||
|
||
if (this.configuration && this.configuration.accessToken) { | ||
// oauth required | ||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | ||
} | ||
|
||
const response = await this.request({ | ||
path: `/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/{pk}/`.replace(`{${"issue_id"}}`, encodeURIComponent(String(requestParameters['issueId']))).replace(`{${"pk"}}`, encodeURIComponent(String(requestParameters['pk']))).replace(`{${"project_id"}}`, encodeURIComponent(String(requestParameters['projectId']))).replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))), | ||
method: 'PATCH', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
body: requestParameters['body'] as any, | ||
}, initOverrides); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serialize the PATCH payload before sending
fetch
rejects plain objects as a request body. With the current signature, callers will naturally pass an object (e.g. { uploaded: true }
), which will trigger a runtime TypeError
because we set the header to application/json
but never stringify the payload. Please JSON-encode the body (or reuse the existing serializer) before dispatching so the endpoint works in practice.
- const headerParameters: runtime.HTTPHeaders = {};
-
- headerParameters['Content-Type'] = 'application/json';
+ const headerParameters: runtime.HTTPHeaders = {};
+
+ let body: any = undefined;
+ if (requestParameters['body'] !== undefined && requestParameters['body'] !== null) {
+ headerParameters['Content-Type'] = 'application/json';
+ body = JSON.stringify(requestParameters['body']);
+ }
@@
- body: requestParameters['body'] as any,
+ body: body,
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const headerParameters: runtime.HTTPHeaders = {}; | |
headerParameters['Content-Type'] = 'application/json'; | |
if (this.configuration && this.configuration.apiKey) { | |
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuthentication authentication | |
} | |
if (this.configuration && this.configuration.accessToken) { | |
// oauth required | |
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | |
} | |
if (this.configuration && this.configuration.accessToken) { | |
// oauth required | |
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | |
} | |
const response = await this.request({ | |
path: `/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/{pk}/`.replace(`{${"issue_id"}}`, encodeURIComponent(String(requestParameters['issueId']))).replace(`{${"pk"}}`, encodeURIComponent(String(requestParameters['pk']))).replace(`{${"project_id"}}`, encodeURIComponent(String(requestParameters['projectId']))).replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))), | |
method: 'PATCH', | |
headers: headerParameters, | |
query: queryParameters, | |
body: requestParameters['body'] as any, | |
}, initOverrides); | |
const headerParameters: runtime.HTTPHeaders = {}; | |
let body: any = undefined; | |
if (requestParameters['body'] !== undefined && requestParameters['body'] !== null) { | |
headerParameters['Content-Type'] = 'application/json'; | |
body = JSON.stringify(requestParameters['body']); | |
} | |
if (this.configuration && this.configuration.apiKey) { | |
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuthentication authentication | |
} | |
if (this.configuration && this.configuration.accessToken) { | |
// oauth required | |
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | |
} | |
if (this.configuration && this.configuration.accessToken) { | |
// oauth required | |
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | |
} | |
const response = await this.request({ | |
path: `/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/{pk}/` | |
.replace(`{${"issue_id"}}`, encodeURIComponent(String(requestParameters['issueId']))) | |
.replace(`{${"pk"}}`, encodeURIComponent(String(requestParameters['pk']))) | |
.replace(`{${"project_id"}}`, encodeURIComponent(String(requestParameters['projectId']))) | |
.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))), | |
method: 'PATCH', | |
headers: headerParameters, | |
query: queryParameters, | |
body: body, | |
}, initOverrides); |
🤖 Prompt for AI Agents
In src/apis/WorkItemAttachmentsApi.ts around lines 378 to 402, the PATCH request
sets Content-Type: application/json but passes requestParameters['body']
directly (a plain object), which causes fetch to throw; JSON-encode the payload
before sending by replacing the raw body with
JSON.stringify(requestParameters['body']) (or run it through the module's
existing serializer if available) so the request body matches the header and is
accepted by fetch.
async listIssuePropertyValuesForAWorkitemRaw(requestParameters: ListIssuePropertyValuesForAWorkitemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IssuePropertyValueAPI>> { | ||
if (requestParameters['issueId'] == null) { | ||
throw new runtime.RequiredError( | ||
'issueId', | ||
'Required parameter "issueId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | ||
); | ||
} | ||
|
||
if (requestParameters['projectId'] == null) { | ||
throw new runtime.RequiredError( | ||
'projectId', | ||
'Required parameter "projectId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | ||
); | ||
} | ||
|
||
if (requestParameters['propertyId'] == null) { | ||
throw new runtime.RequiredError( | ||
'propertyId', | ||
'Required parameter "propertyId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | ||
); | ||
} | ||
|
||
if (requestParameters['slug'] == null) { | ||
throw new runtime.RequiredError( | ||
'slug', | ||
'Required parameter "slug" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | ||
); | ||
} | ||
|
||
const queryParameters: any = {}; | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
if (this.configuration && this.configuration.apiKey) { | ||
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuthentication authentication | ||
} | ||
|
||
if (this.configuration && this.configuration.accessToken) { | ||
// oauth required | ||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | ||
} | ||
|
||
if (this.configuration && this.configuration.accessToken) { | ||
// oauth required | ||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | ||
} | ||
|
||
const response = await this.request({ | ||
path: `/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-properties/values/`.replace(`{${"issue_id"}}`, encodeURIComponent(String(requestParameters['issueId']))).replace(`{${"project_id"}}`, encodeURIComponent(String(requestParameters['projectId']))).replace(`{${"property_id"}}`, encodeURIComponent(String(requestParameters['propertyId']))).replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))), | ||
method: 'GET', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
}, initOverrides); | ||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => IssuePropertyValueAPIFromJSON(jsonValue)); | ||
} | ||
|
||
/** | ||
* List issue property values for a workitem | ||
* List issue property values for a workitem | ||
*/ | ||
async listIssuePropertyValuesForAWorkitem(requestParameters: ListIssuePropertyValuesForAWorkitemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IssuePropertyValueAPI> { | ||
const response = await this.listIssuePropertyValuesForAWorkitemRaw(requestParameters, initOverrides); | ||
return await response.value(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the response type to an array.
The server returns a list here, but the SDK now deserializes it as a single IssuePropertyValueAPI
. IssuePropertyValueAPIFromJSON
will therefore run against the entire array, yielding an object full of undefined
fields. Please keep the return type as an array and map each element, consistent with the other “list” operations in this class.
- async listIssuePropertyValuesForAWorkitemRaw(requestParameters: ListIssuePropertyValuesForAWorkitemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IssuePropertyValueAPI>> {
+ async listIssuePropertyValuesForAWorkitemRaw(requestParameters: ListIssuePropertyValuesForAWorkitemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<IssuePropertyValueAPI>>> {
@@
- return new runtime.JSONApiResponse(response, (jsonValue) => IssuePropertyValueAPIFromJSON(jsonValue));
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(IssuePropertyValueAPIFromJSON));
}
@@
- async listIssuePropertyValuesForAWorkitem(requestParameters: ListIssuePropertyValuesForAWorkitemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IssuePropertyValueAPI> {
+ async listIssuePropertyValuesForAWorkitem(requestParameters: ListIssuePropertyValuesForAWorkitemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<IssuePropertyValueAPI>> {
const response = await this.listIssuePropertyValuesForAWorkitemRaw(requestParameters, initOverrides);
return await response.value();
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
async listIssuePropertyValuesForAWorkitemRaw(requestParameters: ListIssuePropertyValuesForAWorkitemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IssuePropertyValueAPI>> { | |
if (requestParameters['issueId'] == null) { | |
throw new runtime.RequiredError( | |
'issueId', | |
'Required parameter "issueId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | |
); | |
} | |
if (requestParameters['projectId'] == null) { | |
throw new runtime.RequiredError( | |
'projectId', | |
'Required parameter "projectId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | |
); | |
} | |
if (requestParameters['propertyId'] == null) { | |
throw new runtime.RequiredError( | |
'propertyId', | |
'Required parameter "propertyId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | |
); | |
} | |
if (requestParameters['slug'] == null) { | |
throw new runtime.RequiredError( | |
'slug', | |
'Required parameter "slug" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | |
); | |
} | |
const queryParameters: any = {}; | |
const headerParameters: runtime.HTTPHeaders = {}; | |
if (this.configuration && this.configuration.apiKey) { | |
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuthentication authentication | |
} | |
if (this.configuration && this.configuration.accessToken) { | |
// oauth required | |
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | |
} | |
if (this.configuration && this.configuration.accessToken) { | |
// oauth required | |
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | |
} | |
const response = await this.request({ | |
path: `/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-properties/values/`.replace(`{${"issue_id"}}`, encodeURIComponent(String(requestParameters['issueId']))).replace(`{${"project_id"}}`, encodeURIComponent(String(requestParameters['projectId']))).replace(`{${"property_id"}}`, encodeURIComponent(String(requestParameters['propertyId']))).replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))), | |
method: 'GET', | |
headers: headerParameters, | |
query: queryParameters, | |
}, initOverrides); | |
return new runtime.JSONApiResponse(response, (jsonValue) => IssuePropertyValueAPIFromJSON(jsonValue)); | |
} | |
/** | |
* List issue property values for a workitem | |
* List issue property values for a workitem | |
*/ | |
async listIssuePropertyValuesForAWorkitem(requestParameters: ListIssuePropertyValuesForAWorkitemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IssuePropertyValueAPI> { | |
const response = await this.listIssuePropertyValuesForAWorkitemRaw(requestParameters, initOverrides); | |
return await response.value(); | |
} | |
async listIssuePropertyValuesForAWorkitemRaw( | |
requestParameters: ListIssuePropertyValuesForAWorkitemRequest, | |
initOverrides?: RequestInit | runtime.InitOverrideFunction | |
): Promise<runtime.ApiResponse<Array<IssuePropertyValueAPI>>> { | |
if (requestParameters['issueId'] == null) { | |
throw new runtime.RequiredError( | |
'issueId', | |
'Required parameter "issueId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | |
); | |
} | |
if (requestParameters['projectId'] == null) { | |
throw new runtime.RequiredError( | |
'projectId', | |
'Required parameter "projectId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | |
); | |
} | |
if (requestParameters['propertyId'] == null) { | |
throw new runtime.RequiredError( | |
'propertyId', | |
'Required parameter "propertyId" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | |
); | |
} | |
if (requestParameters['slug'] == null) { | |
throw new runtime.RequiredError( | |
'slug', | |
'Required parameter "slug" was null or undefined when calling listIssuePropertyValuesForAWorkitem().' | |
); | |
} | |
const queryParameters: any = {}; | |
const headerParameters: runtime.HTTPHeaders = {}; | |
if (this.configuration && this.configuration.apiKey) { | |
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); | |
} | |
if (this.configuration && this.configuration.accessToken) { | |
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2Authentication", []); | |
} | |
const response = await this.request( | |
{ | |
path: `/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-properties/values/` | |
.replace(`{${"issue_id"}}`, encodeURIComponent(String(requestParameters['issueId']))) | |
.replace(`{${"project_id"}}`, encodeURIComponent(String(requestParameters['projectId']))) | |
.replace(`{${"property_id"}}`, encodeURIComponent(String(requestParameters['propertyId']))) | |
.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug']))), | |
method: 'GET', | |
headers: headerParameters, | |
query: queryParameters, | |
}, | |
initOverrides | |
); | |
return new runtime.JSONApiResponse( | |
response, | |
(jsonValue) => jsonValue.map(IssuePropertyValueAPIFromJSON) | |
); | |
} | |
/** | |
* List issue property values for a workitem | |
* List issue property values for a workitem | |
*/ | |
async listIssuePropertyValuesForAWorkitem( | |
requestParameters: ListIssuePropertyValuesForAWorkitemRequest, | |
initOverrides?: RequestInit | runtime.InitOverrideFunction | |
): Promise<Array<IssuePropertyValueAPI>> { | |
const response = await this.listIssuePropertyValuesForAWorkitemRaw(requestParameters, initOverrides); | |
return await response.value(); | |
} |
🤖 Prompt for AI Agents
In src/apis/WorkItemPropertiesApi.ts around lines 709 to 773, the response is
currently treated as a single IssuePropertyValueAPI but the server returns a
list; update the method to return IssuePropertyValueAPI[] by changing the
JSONApiResponse generic and its converter to parse an array (map each element
through IssuePropertyValueAPIFromJSON), and change
listIssuePropertyValuesForAWorkitem’s return type to
Promise<IssuePropertyValueAPI[]> (and await response.value() as an array).
Ensure the runtime.JSONApiResponse instantiation and the value() return types
reflect IssuePropertyValueAPI[] consistently.
export function EpicToJSON(json: any): Epic { | ||
return EpicToJSONTyped(json, false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
EpicToJSON has incorrect signature and parameter name.
It should accept Epic and return JSON, not the other way around.
Apply this diff:
-export function EpicToJSON(json: any): Epic {
- return EpicToJSONTyped(json, false);
-}
+export function EpicToJSON(value?: Epic | null): any {
+ return EpicToJSONTyped(value, false);
+}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export function EpicToJSON(json: any): Epic { | |
return EpicToJSONTyped(json, false); | |
} | |
export function EpicToJSON(value?: Epic | null): any { | |
return EpicToJSONTyped(value, false); | |
} |
🤖 Prompt for AI Agents
In src/models/Epic.ts around lines 266-268, the exported EpicToJSON currently
takes a JSON input and returns an Epic, but it should accept an Epic (or
null/undefined) and return a JSON representation; change the function signature
and parameter name accordingly (e.g. value?: Epic | null) and have it call
EpicToJSONTyped with that Epic value and false, returning the resulting JSON
type; update any TypeScript types/returns to reflect the correct input (Epic)
and output (any/JSON).
return EpicToJSONTyped(json, false); | ||
} | ||
|
||
export function EpicToJSONTyped(value?: Omit<Epic, 'id'|'deleted_at'|'created_at'|'updated_at'|'description_binary'|'assignees'|'labels'> | null, ignoreDiscriminator: boolean = false): any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Fix Omit keys to match Epic interface (camelCase).
Snake_case keys don’t exist on Epic and won’t be omitted.
Apply this diff:
-export function EpicToJSONTyped(value?: Omit<Epic, 'id'|'deleted_at'|'created_at'|'updated_at'|'description_binary'|'assignees'|'labels'> | null, ignoreDiscriminator: boolean = false): any {
+export function EpicToJSONTyped(value?: Omit<Epic, 'id'|'deletedAt'|'createdAt'|'updatedAt'|'descriptionBinary'|'assignees'|'labels'> | null, ignoreDiscriminator: boolean = false): any {
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export function EpicToJSONTyped(value?: Omit<Epic, 'id'|'deleted_at'|'created_at'|'updated_at'|'description_binary'|'assignees'|'labels'> | null, ignoreDiscriminator: boolean = false): any { | |
export function EpicToJSONTyped(value?: Omit<Epic, 'id'|'deletedAt'|'createdAt'|'updatedAt'|'descriptionBinary'|'assignees'|'labels'> | null, ignoreDiscriminator: boolean = false): any { |
🤖 Prompt for AI Agents
In src/models/Epic.ts around line 270, the Omit type uses snake_case keys that
don't exist on the Epic interface; change the omitted property names to the
interface's camelCase names so the type correctly omits them. Replace the
current Omit<Epic,
'id'|'deleted_at'|'created_at'|'updated_at'|'description_binary'|'assignees'|'labels'>
with Omit<Epic,
'id'|'deletedAt'|'createdAt'|'updatedAt'|'descriptionBinary'|'assignees'|'labels'>
(preserve the existing value?: ... | null and ignoreDiscriminator parameter).
export function IssueRelationToJSON(json: any): IssueRelation { | ||
return IssueRelationToJSONTyped(json, false); | ||
} | ||
|
||
export function IssueRelationToJSONTyped(value?: Omit<IssueRelation, 'id'|'project_id'|'sequence_id'|'relation_type'|'name'|'type_id'|'is_epic'|'state_id'|'priority'|'created_by'|'created_at'|'updated_at'|'updated_by'> | null, ignoreDiscriminator: boolean = false): any { | ||
if (value == null) { | ||
return value; | ||
} | ||
|
||
return { | ||
|
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix IssueRelation serialization
Line 141 currently returns an empty object for every IssueRelation
, so any consumer calling IssueRelationToJSON
silently loses all relation data. That’s a functional regression for downstream SDK users who rely on this helper to persist or forward serialized payloads. Please emit the actual fields instead of {}
.
-export function IssueRelationToJSON(json: any): IssueRelation {
- return IssueRelationToJSONTyped(json, false);
-}
-
-export function IssueRelationToJSONTyped(value?: Omit<IssueRelation, 'id'|'project_id'|'sequence_id'|'relation_type'|'name'|'type_id'|'is_epic'|'state_id'|'priority'|'created_by'|'created_at'|'updated_at'|'updated_by'> | null, ignoreDiscriminator: boolean = false): any {
- if (value == null) {
- return value;
- }
-
- return {
-
- };
-}
+export function IssueRelationToJSON(value?: IssueRelation | null): any {
+ if (value == null) {
+ return value;
+ }
+
+ return {
+ 'id': value['id'],
+ 'project_id': value['projectId'],
+ 'sequence_id': value['sequenceId'],
+ 'relation_type': value['relationType'],
+ 'name': value['name'],
+ 'type_id': value['typeId'],
+ 'is_epic': value['isEpic'],
+ 'state_id': value['stateId'],
+ 'priority': value['priority'],
+ 'created_by': value['createdBy'],
+ 'created_at': value['createdAt']?.toISOString(),
+ 'updated_at': value['updatedAt']?.toISOString(),
+ 'updated_by': value['updatedBy'],
+ };
+}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export function IssueRelationToJSON(json: any): IssueRelation { | |
return IssueRelationToJSONTyped(json, false); | |
} | |
export function IssueRelationToJSONTyped(value?: Omit<IssueRelation, 'id'|'project_id'|'sequence_id'|'relation_type'|'name'|'type_id'|'is_epic'|'state_id'|'priority'|'created_by'|'created_at'|'updated_at'|'updated_by'> | null, ignoreDiscriminator: boolean = false): any { | |
if (value == null) { | |
return value; | |
} | |
return { | |
}; | |
export function IssueRelationToJSON(value?: IssueRelation | null): any { | |
if (value == null) { | |
return value; | |
} | |
return { | |
'id': value['id'], | |
'project_id': value['projectId'], | |
'sequence_id': value['sequenceId'], | |
'relation_type': value['relationType'], | |
'name': value['name'], | |
'type_id': value['typeId'], | |
'is_epic': value['isEpic'], | |
'state_id': value['stateId'], | |
'priority': value['priority'], | |
'created_by': value['createdBy'], | |
'created_at': value['createdAt']?.toISOString(), | |
'updated_at': value['updatedAt']?.toISOString(), | |
'updated_by': value['updatedBy'], | |
}; | |
} |
🤖 Prompt for AI Agents
In src/models/IssueRelation.ts around lines 137 to 148, the
IssueRelationToJSONTyped function currently returns an empty object which drops
all relation data; update it to emit the actual IssueRelation fields instead of
{} by returning a serialized representation of the incoming value (i.e.,
construct and return an object containing all properties present on the value
argument so callers receive the full relation payload).
'archived_at': value['archivedAt'] == null ? undefined : ((value['archivedAt'] as any).toISOString().substring(0,10)), | ||
'view_props': value['viewProps'], | ||
'logo_props': value['logoProps'], | ||
'external_id': value['externalId'], | ||
'external_source': value['externalSource'], | ||
'description_html': value['descriptionHtml'], | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve archivedAt timestamp precision
Line 196 trims archivedAt
to YYYY-MM-DD
, discarding time and timezone. Serializing then deserializing will produce a different instant (new Date('2024-02-01')
=> local midnight), which breaks round-tripping and can shift the archived timestamp by several hours. Please emit the full ISO string and let the backend decide how to interpret it.
- 'archived_at': value['archivedAt'] == null ? undefined : ((value['archivedAt'] as any).toISOString().substring(0,10)),
+ 'archived_at':
+ value['archivedAt'] === undefined
+ ? undefined
+ : value['archivedAt'] === null
+ ? null
+ : (value['archivedAt'] as Date).toISOString(),
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'archived_at': value['archivedAt'] == null ? undefined : ((value['archivedAt'] as any).toISOString().substring(0,10)), | |
'view_props': value['viewProps'], | |
'logo_props': value['logoProps'], | |
'external_id': value['externalId'], | |
'external_source': value['externalSource'], | |
'description_html': value['descriptionHtml'], | |
}; | |
'archived_at': | |
value['archivedAt'] === undefined | |
? undefined | |
: value['archivedAt'] === null | |
? null | |
: (value['archivedAt'] as Date).toISOString(), | |
'view_props': value['viewProps'], | |
'logo_props': value['logoProps'], | |
'external_id': value['externalId'], | |
'external_source': value['externalSource'], | |
'description_html': value['descriptionHtml'], | |
}; |
🤖 Prompt for AI Agents
In src/models/PageCreateAPI.ts around lines 196 to 202, the serializer currently
trims archivedAt to YYYY-MM-DD which drops time and timezone; change it to emit
the full ISO timestamp instead (keep the same null/undefined handling) so use
the value's full toISOString() (or pass through a string if already one) rather
than substring(0,10), ensuring the backend receives the full instant.
Description
Summary by CodeRabbit