Skip to content

Document interface doesn't have instanceId #1271

@shotainoguchi

Description

@shotainoguchi

Describe the bug
Document interface doesn't have instanceId as its members while we can get a response including instanceId.

To Reproduce
Execute the following code:

const res = await client.documents.list({
  limit: 1000,
});
return res.items.filter((item) => item.instanceId);

You will see an TypeScript error Property 'instanceId' does not exist on type 'Document'.
Image

However, the response from document.list includes a document item linked to a CDM instance like this:

"items": [
    {
      "id": 81749123269072,
      "sourceFile": {
        "name": "改定通知表.pdf",
        "directory": "D:\\Box\\【千葉事業所】ポータル掲載\\千葉事業所規定基準類\\8.共同要領\\スタッフ及び保全部門\\40.設備建設業務要領(工務)",
        "hash": "475e72619923a23de0e731e38f0b65e5e7da743511d99d95e5933c77482bcfd1",
        "size": 119424
      },
      "instanceId": {
        "space": "File_Search",
        "externalId": "377471e4-c9cf-4a3b-9e35-49981c8b576a"
      },
      "title": "保安検査方法",
      "author": "高圧ガス保安協会",
      "producer": "Microsoft® Word for Microsoft 365",
      "mimeType": "application/pdf",
      "extension": "pdf",
      "pageCount": 1,
      "type": "PDF",
      "language": "ja",
      "truncatedContent": "\n(1/1) \n\n付表-2 \n\n改  定  通  知  表 (2025年 01月 07日改定) \n\n要領名称:千共同領-1-2 設備建設業務要領 \n番\n\n号 \n頁 改  定  前 改  定  後 改 定 理 由 \n\n1  4.業務の推進 \n\n(3)設計、製作、施工管理 \n\nコ.設備担当課は、設備の新増設および",
      "createdTime": 1736813303000,
      "modifiedTime": 1736813303000,
      "lastIndexedTime": 1738667625217
    }, ...
]

Expected behavior
I'd suggest adding instanceId to Document interface.
https://github.com/cognitedata/cognite-sdk-js/blob/c278e56ae3/packages/stable/src/api/documents/types.gen.ts#L21

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions