TypeScript error TS2353: Object literal may only specify known properties when using ldapts in NestJS project

I’m working on a NestJS project that integrates with Active Directory using the ldapts library. I encountered a TypeScript error when trying to set certain attributes in my Active Directory service.

The errors are as follows:

[01:01:16] File change detected. Starting incremental compilation...

src/oracle-hrms/services/active-directory.service.ts:77:11 - error TS2353: Object literal may only specify known properties, and 'userAccountControl' does not exist in type 'Attribute'.

77           userAccountControl: '514', // Adjust this value based on your AD setup
             ~~~~~~~~~~~~~~~~~~

  node_modules/ldapts/dist/index.d.ts:785:5
    785     modification: Attribute;
            ~~~~~~~~~~~~
    The expected type comes from property 'modification' which is declared here on type 'ChangeOptions'

src/oracle-hrms/services/active-directory.service.ts:107:13 - error TS2353: Object literal may only specify known properties, and 'sn' does not exist in type 'Attribute'.

107             sn: accountData.sn,
                ~~

  node_modules/ldapts/dist/index.d.ts:785:5
    785     modification: Attribute;
            ~~~~~~~~~~~~
    The expected type comes from property 'modification' which is declared here on type 'ChangeOptions'   

src/oracle-hrms/services/active-directory.service.ts:113:13 - error TS2353: Object literal may only specify known properties, and 'mail' does not exist in type 'Attribute'.

113             mail: accountData.mail,
                ~~~~

  node_modules/ldapts/dist/index.d.ts:785:5
    785     modification: Attribute;
            ~~~~~~~~~~~~
    The expected type comes from property 'modification' which is declared here on type 'ChangeOptions'   

src/oracle-hrms/services/active-directory.service.ts:150:13 - error TS2353: Object literal may only specify known properties, and 'member' does not exist in type 'Attribute'.

150             member: userDN,
                ~~~~~~

  node_modules/ldapts/dist/index.d.ts:785:5
    785     modification: Attribute;
            ~~~~~~~~~~~~
    The expected type comes from property 'modification' which is declared here on type 'ChangeOptions'   

[01:01:16] Found 4 errors. Watching for file changes.

// In src/oracle-hrms/services/active-directory.service.ts

// Error at line 77
await this.ldapClient.modify(dn, [
  {
    operation: 'replace',
    modification: {
      userAccountControl: '514', // Adjust this value based on your AD setup
    },
  },
]);

// Error at line 107
await this.ldapClient.modify(dn, [
  {
    operation: 'replace',
    modification: {
      sn: accountData.sn,
    },
  },
]);

// Error at line 113
await this.ldapClient.modify(dn, [
  {
    operation: 'replace',
    modification: {
      mail: accountData.mail,
    },
  },
]);

// Error at line 150
await this.ldapClient.modify(dn, [
  {
    operation: 'add',
    modification: {
      member: userDN,
    },
  },
]);

It appears that userAccountControl, sn, mail, and member are not recognized as valid properties of the Attribute type defined in ldapts.

What I have tried:

Ensuring the attributes are correctly named and exist in AD.
Checking the ldapts documentation and type definitions.
Environment:

NestJS version: 8.0.0
ldapts version: 3.0.0
TypeScript version: 4.3.5

Questions:

How can I correctly specify these attributes in the modification object?
Is there a way to extend or modify the Attribute type definition to include these properties?
Are there any alternative approaches to setting these AD attributes using ldapts?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật