fix: add missing fields and concrete types to Entity definitions#136
Conversation
Add fields found by comparing with backlog-scala API formatters: - User: NulabAccount interface, nulabAccount and keyword fields - DiskUsage: document and pullRequest fields - PullRequest.Comment: oldBlobId, newBlobId, filePath, position fields - Notification: repository field - License: nulabAppsIntegration, issueTemplate, and admin-only fields Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace CustomField index signature [key: string]: any with specific optional properties (min, max, items, allowAddItem, etc.) based on Scala CustomFieldWritesImplicits - Add CustomFieldValue namespace with discriminated union types for issue custom field values (fieldTypeId-based discrimination) - Add Activity content union type (ActivityContent) covering all 17 content types from Scala ProjectActivityWrites - Add supporting interfaces: CustomFieldItem, CustomFieldInitialDate, CustomFieldValueItem, and various Activity sub-types Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- PullRequestContent.issue is Option[IssueSnapshot] in the Scala source, so it should be PullRequestIssue | null - Rebuild dist to reflect all type definition changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
I can't find these changes. Can you check? |
|
It looks like these types are based on our internal type definitions. Since backlog-js is a public library, it might be better to align with the official public documentation instead. For example, the
Should we ask the internal section to update these pages to match the actual specs first? |
|
@lollipop-onl |
….comment nullable Add ActivityType enum entries for StatusDeleted(34), DocumentCreated(36), DocumentUpdated(37), DocumentDeleted(38), IssueMultiCreated(47), and DocumentMultiCreated(48) that were confirmed via API but missing from the enum. Fix PullRequestContent.comment to be nullable as the API returns null for PR creation events (type=18). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@mmktomato Upon checking regarding the additional properties, I was informed that there are no particular restrictions on what the API returns in its response. |
Add DocumentCommentCreated(40), DocumentCommentUpdated(41), DocumentCommentDeleted(42), DocumentCommentReplyCreated(43), DocumentCommentReplyUpdated(44), DocumentCommentReplyDeleted(45), and DocumentAttachmentCreated(46) to ActivityType enum. Fix DocumentUpdated(37) → DocumentDeleted(37) and DocumentDeleted(38) → DocumentTitleUpdated(38) naming. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@lollipop-onl |
Regarding the type definitions in
entity.ts, I will add missing fields based on a comparison with the actual API responses.Changes
User,DiskUsage,PullRequest.Comment,Notification,Licence[key: string]: anyfromProject.CustomField.anyfromActivity.content.Issue.customFields.Breaking changes
anytypes have been changed, type errors may occur in existing code that directly accesses these fields.