@twin.org/api-auth-entity-storage-models 0.0.3-next.4 → 0.0.3-next.40

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.
Files changed (101) hide show
  1. package/README.md +2 -2
  2. package/dist/es/index.js +17 -0
  3. package/dist/es/index.js.map +1 -1
  4. package/dist/es/models/IAuthenticationAdminComponent.js.map +1 -1
  5. package/dist/es/models/IAuthenticationAuditComponent.js +2 -0
  6. package/dist/es/models/IAuthenticationAuditComponent.js.map +1 -0
  7. package/dist/es/models/IAuthenticationAuditEntry.js +2 -0
  8. package/dist/es/models/IAuthenticationAuditEntry.js.map +1 -0
  9. package/dist/es/models/IAuthenticationComponent.js.map +1 -1
  10. package/dist/es/models/IAuthenticationRateActionConfig.js +4 -0
  11. package/dist/es/models/IAuthenticationRateActionConfig.js.map +1 -0
  12. package/dist/es/models/IAuthenticationRateComponent.js +2 -0
  13. package/dist/es/models/IAuthenticationRateComponent.js.map +1 -0
  14. package/dist/es/models/IAuthenticationUser.js +4 -0
  15. package/dist/es/models/IAuthenticationUser.js.map +1 -0
  16. package/dist/es/models/IAuthenticationUserSecure.js +2 -0
  17. package/dist/es/models/IAuthenticationUserSecure.js.map +1 -0
  18. package/dist/es/models/api/IAdminUserCreateRequest.js +2 -0
  19. package/dist/es/models/api/IAdminUserCreateRequest.js.map +1 -0
  20. package/dist/es/models/api/IAdminUserGetByIdentityRequest.js +4 -0
  21. package/dist/es/models/api/IAdminUserGetByIdentityRequest.js.map +1 -0
  22. package/dist/es/models/api/IAdminUserGetRequest.js +4 -0
  23. package/dist/es/models/api/IAdminUserGetRequest.js.map +1 -0
  24. package/dist/es/models/api/IAdminUserGetResponse.js +2 -0
  25. package/dist/es/models/api/IAdminUserGetResponse.js.map +1 -0
  26. package/dist/es/models/api/IAdminUserRemoveRequest.js +4 -0
  27. package/dist/es/models/api/IAdminUserRemoveRequest.js.map +1 -0
  28. package/dist/es/models/api/IAdminUserUpdatePasswordRequest.js +4 -0
  29. package/dist/es/models/api/IAdminUserUpdatePasswordRequest.js.map +1 -0
  30. package/dist/es/models/api/IAdminUserUpdateRequest.js +2 -0
  31. package/dist/es/models/api/IAdminUserUpdateRequest.js.map +1 -0
  32. package/dist/es/models/api/IAuditCreateRequest.js +2 -0
  33. package/dist/es/models/api/IAuditCreateRequest.js.map +1 -0
  34. package/dist/es/models/api/IAuditQueryRequest.js +2 -0
  35. package/dist/es/models/api/IAuditQueryRequest.js.map +1 -0
  36. package/dist/es/models/api/IAuditQueryResponse.js +2 -0
  37. package/dist/es/models/api/IAuditQueryResponse.js.map +1 -0
  38. package/dist/es/models/api/ILoginResponse.js +0 -2
  39. package/dist/es/models/api/ILoginResponse.js.map +1 -1
  40. package/dist/es/models/api/ILogoutRequest.js.map +1 -1
  41. package/dist/es/models/api/IRefreshTokenRequest.js.map +1 -1
  42. package/dist/es/models/api/IRefreshTokenResponse.js +0 -2
  43. package/dist/es/models/api/IRefreshTokenResponse.js.map +1 -1
  44. package/dist/es/models/api/IUpdatePasswordRequest.js.map +1 -1
  45. package/dist/es/models/authAuditEvent.js +49 -0
  46. package/dist/es/models/authAuditEvent.js.map +1 -0
  47. package/dist/types/index.d.ts +17 -0
  48. package/dist/types/models/IAuthenticationAdminComponent.d.ts +24 -6
  49. package/dist/types/models/IAuthenticationAuditComponent.d.ts +40 -0
  50. package/dist/types/models/IAuthenticationAuditEntry.d.ts +50 -0
  51. package/dist/types/models/IAuthenticationComponent.d.ts +1 -2
  52. package/dist/types/models/IAuthenticationRateActionConfig.d.ts +13 -0
  53. package/dist/types/models/IAuthenticationRateComponent.d.ts +46 -0
  54. package/dist/types/models/IAuthenticationUser.d.ts +21 -0
  55. package/dist/types/models/IAuthenticationUserSecure.d.ts +18 -0
  56. package/dist/types/models/api/IAdminUserCreateRequest.d.ts +12 -0
  57. package/dist/types/models/api/IAdminUserGetByIdentityRequest.d.ts +14 -0
  58. package/dist/types/models/api/IAdminUserGetRequest.d.ts +14 -0
  59. package/dist/types/models/api/IAdminUserGetResponse.d.ts +10 -0
  60. package/dist/types/models/api/IAdminUserRemoveRequest.d.ts +14 -0
  61. package/dist/types/models/api/IAdminUserUpdatePasswordRequest.d.ts +27 -0
  62. package/dist/types/models/api/IAdminUserUpdateRequest.d.ts +19 -0
  63. package/dist/types/models/api/IAuditCreateRequest.d.ts +10 -0
  64. package/dist/types/models/api/IAuditQueryRequest.d.ts +47 -0
  65. package/dist/types/models/api/IAuditQueryResponse.d.ts +19 -0
  66. package/dist/types/models/api/ILoginResponse.d.ts +10 -4
  67. package/dist/types/models/api/ILogoutRequest.d.ts +1 -1
  68. package/dist/types/models/api/IRefreshTokenRequest.d.ts +1 -1
  69. package/dist/types/models/api/IRefreshTokenResponse.d.ts +10 -4
  70. package/dist/types/models/api/IUpdatePasswordRequest.d.ts +1 -10
  71. package/dist/types/models/authAuditEvent.d.ts +49 -0
  72. package/docs/changelog.md +328 -65
  73. package/docs/examples.md +80 -1
  74. package/docs/reference/index.md +24 -0
  75. package/docs/reference/interfaces/IAdminUserCreateRequest.md +17 -0
  76. package/docs/reference/interfaces/IAdminUserGetByIdentityRequest.md +17 -0
  77. package/docs/reference/interfaces/IAdminUserGetRequest.md +17 -0
  78. package/docs/reference/interfaces/IAdminUserGetResponse.md +11 -0
  79. package/docs/reference/interfaces/IAdminUserRemoveRequest.md +17 -0
  80. package/docs/reference/interfaces/IAdminUserUpdatePasswordRequest.md +37 -0
  81. package/docs/reference/interfaces/IAdminUserUpdateRequest.md +25 -0
  82. package/docs/reference/interfaces/IAuditCreateRequest.md +11 -0
  83. package/docs/reference/interfaces/IAuditQueryRequest.md +65 -0
  84. package/docs/reference/interfaces/IAuditQueryResponse.md +23 -0
  85. package/docs/reference/interfaces/IAuthenticationAdminComponent.md +64 -16
  86. package/docs/reference/interfaces/IAuthenticationAuditComponent.md +103 -0
  87. package/docs/reference/interfaces/IAuthenticationAuditEntry.md +91 -0
  88. package/docs/reference/interfaces/IAuthenticationComponent.md +5 -11
  89. package/docs/reference/interfaces/IAuthenticationRateActionConfig.md +19 -0
  90. package/docs/reference/interfaces/IAuthenticationRateComponent.md +165 -0
  91. package/docs/reference/interfaces/IAuthenticationUser.md +39 -0
  92. package/docs/reference/interfaces/IAuthenticationUserSecure.md +79 -0
  93. package/docs/reference/interfaces/ILoginRequest.md +1 -1
  94. package/docs/reference/interfaces/ILoginResponse.md +14 -6
  95. package/docs/reference/interfaces/ILogoutRequest.md +3 -3
  96. package/docs/reference/interfaces/IRefreshTokenRequest.md +3 -3
  97. package/docs/reference/interfaces/IRefreshTokenResponse.md +14 -6
  98. package/docs/reference/interfaces/IUpdatePasswordRequest.md +2 -16
  99. package/docs/reference/type-aliases/AuthAuditEvent.md +5 -0
  100. package/docs/reference/variables/AuthAuditEvent.md +67 -0
  101. package/package.json +4 -4
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # TWIN Auth Entity Storage Models
1
+ # TWIN API Auth Entity Storage Models
2
2
 
3
- Models which define the structure of the Auth Entity Storage contracts.
3
+ This package provides contracts for authentication flows and admin user management with entity storage.
4
4
 
5
5
  ## Installation
6
6
 
package/dist/es/index.js CHANGED
@@ -1,11 +1,28 @@
1
1
  // Copyright 2024 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./models/api/IAdminUserCreateRequest.js";
4
+ export * from "./models/api/IAdminUserGetByIdentityRequest.js";
5
+ export * from "./models/api/IAdminUserGetRequest.js";
6
+ export * from "./models/api/IAdminUserGetResponse.js";
7
+ export * from "./models/api/IAdminUserRemoveRequest.js";
8
+ export * from "./models/api/IAdminUserUpdatePasswordRequest.js";
9
+ export * from "./models/api/IAdminUserUpdateRequest.js";
10
+ export * from "./models/api/IAuditCreateRequest.js";
11
+ export * from "./models/api/IAuditQueryRequest.js";
12
+ export * from "./models/api/IAuditQueryResponse.js";
3
13
  export * from "./models/api/ILoginRequest.js";
4
14
  export * from "./models/api/ILoginResponse.js";
5
15
  export * from "./models/api/ILogoutRequest.js";
6
16
  export * from "./models/api/IRefreshTokenRequest.js";
7
17
  export * from "./models/api/IRefreshTokenResponse.js";
8
18
  export * from "./models/api/IUpdatePasswordRequest.js";
19
+ export * from "./models/authAuditEvent.js";
9
20
  export * from "./models/IAuthenticationAdminComponent.js";
21
+ export * from "./models/IAuthenticationAuditComponent.js";
22
+ export * from "./models/IAuthenticationAuditEntry.js";
10
23
  export * from "./models/IAuthenticationComponent.js";
24
+ export * from "./models/IAuthenticationRateActionConfig.js";
25
+ export * from "./models/IAuthenticationRateComponent.js";
26
+ export * from "./models/IAuthenticationUser.js";
27
+ export * from "./models/IAuthenticationUserSecure.js";
11
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./models/api/ILoginRequest.js\";\nexport * from \"./models/api/ILoginResponse.js\";\nexport * from \"./models/api/ILogoutRequest.js\";\nexport * from \"./models/api/IRefreshTokenRequest.js\";\nexport * from \"./models/api/IRefreshTokenResponse.js\";\nexport * from \"./models/api/IUpdatePasswordRequest.js\";\nexport * from \"./models/IAuthenticationAdminComponent.js\";\nexport * from \"./models/IAuthenticationComponent.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./models/api/IAdminUserCreateRequest.js\";\nexport * from \"./models/api/IAdminUserGetByIdentityRequest.js\";\nexport * from \"./models/api/IAdminUserGetRequest.js\";\nexport * from \"./models/api/IAdminUserGetResponse.js\";\nexport * from \"./models/api/IAdminUserRemoveRequest.js\";\nexport * from \"./models/api/IAdminUserUpdatePasswordRequest.js\";\nexport * from \"./models/api/IAdminUserUpdateRequest.js\";\nexport * from \"./models/api/IAuditCreateRequest.js\";\nexport * from \"./models/api/IAuditQueryRequest.js\";\nexport * from \"./models/api/IAuditQueryResponse.js\";\nexport * from \"./models/api/ILoginRequest.js\";\nexport * from \"./models/api/ILoginResponse.js\";\nexport * from \"./models/api/ILogoutRequest.js\";\nexport * from \"./models/api/IRefreshTokenRequest.js\";\nexport * from \"./models/api/IRefreshTokenResponse.js\";\nexport * from \"./models/api/IUpdatePasswordRequest.js\";\nexport * from \"./models/authAuditEvent.js\";\nexport * from \"./models/IAuthenticationAdminComponent.js\";\nexport * from \"./models/IAuthenticationAuditComponent.js\";\nexport * from \"./models/IAuthenticationAuditEntry.js\";\nexport * from \"./models/IAuthenticationComponent.js\";\nexport * from \"./models/IAuthenticationRateActionConfig.js\";\nexport * from \"./models/IAuthenticationRateComponent.js\";\nexport * from \"./models/IAuthenticationUser.js\";\nexport * from \"./models/IAuthenticationUserSecure.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IAuthenticationAdminComponent.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationAdminComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\n\n/**\n * Contract definition for authentication admin component.\n */\nexport interface IAuthenticationAdminComponent extends IComponent {\n\t/**\n\t * Create a login for the user.\n\t * @param email The email address for the user.\n\t * @param password The password for the user.\n\t * @param userIdentity The DID to associate with the account.\n\t * @param organizationIdentity The organization of the user.\n\t * @returns Nothing.\n\t */\n\tcreate(\n\t\temail: string,\n\t\tpassword: string,\n\t\tuserIdentity: string,\n\t\torganizationIdentity: string\n\t): Promise<void>;\n\n\t/**\n\t * Remove the current user.\n\t * @param email The email address of the user to remove.\n\t * @returns Nothing.\n\t */\n\tremove(email: string): Promise<void>;\n\n\t/**\n\t * Update the user's password.\n\t * @param email The email address of the user to update.\n\t * @param newPassword The new password for the user.\n\t * @param currentPassword The current password, optional, if supplied will check against existing.\n\t * @returns Nothing.\n\t */\n\tupdatePassword(email: string, newPassword: string, currentPassword?: string): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"IAuthenticationAdminComponent.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationAdminComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IAuthenticationUser } from \"./IAuthenticationUser.js\";\n\n/**\n * Contract definition for authentication admin component.\n */\nexport interface IAuthenticationAdminComponent extends IComponent {\n\t/**\n\t * Create a login for the user.\n\t * @param user The user to create.\n\t * @returns Nothing.\n\t */\n\tcreate(user: IAuthenticationUser & { password: string }): Promise<void>;\n\n\t/**\n\t * Update a login for the user.\n\t * @param user The user to update.\n\t * @returns Nothing.\n\t */\n\tupdate(user: Partial<IAuthenticationUser>): Promise<void>;\n\n\t/**\n\t * Get a user by email.\n\t * @param email The email address of the user to get.\n\t * @returns The user details.\n\t */\n\tget(email: string): Promise<IAuthenticationUser>;\n\n\t/**\n\t * Get a user by identity.\n\t * @param identity The identity of the user to get.\n\t * @returns The user details.\n\t */\n\tgetByIdentity(identity: string): Promise<IAuthenticationUser>;\n\n\t/**\n\t * Remove a user.\n\t * @param email The email address of the user to remove.\n\t * @returns Nothing.\n\t */\n\tremove(email: string): Promise<void>;\n\n\t/**\n\t * Update the user's password.\n\t * @param email The email address of the user to update.\n\t * @param newPassword The new password for the user.\n\t * @param currentPassword The current password, optional, if supplied will check against existing.\n\t * @returns Nothing.\n\t */\n\tupdatePassword(email: string, newPassword: string, currentPassword?: string): Promise<void>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAuthenticationAuditComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuthenticationAuditComponent.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationAuditComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { AuthAuditEvent } from \"./authAuditEvent.js\";\nimport type { IAuthenticationAuditEntry } from \"./IAuthenticationAuditEntry.js\";\n\n/**\n * Contract definition for authentication audit component.\n */\nexport interface IAuthenticationAuditComponent extends IComponent {\n\t/**\n\t * Create a new audit entry.\n\t * @param entry The audit entry to be logged.\n\t * @returns The unique identifier of the created audit entry.\n\t */\n\tcreate(entry: Omit<IAuthenticationAuditEntry, \"id\" | \"dateCreated\">): Promise<string>;\n\n\t/**\n\t * Query the audit entries.\n\t * @param options The query options.\n\t * @param options.actorId The actor identifier to filter the audit entries, optional.\n\t * @param options.organizationId The organization identifier to filter the audit entries, optional.\n\t * @param options.tenantId The tenant identifier to filter the audit entries, optional.\n\t * @param options.nodeId The node identifier to filter the audit entries, optional.\n\t * @param options.event The audit event to filter the audit entries, optional.\n\t * @param options.startDate The start date to filter the audit entries, optional.\n\t * @param options.endDate The end date to filter the audit entries, optional.\n\t * @param cursor The cursor for pagination.\n\t * @param limit The maximum number of entries to return.\n\t * @returns The audit entries.\n\t */\n\tquery(\n\t\toptions?: {\n\t\t\tactorId?: string;\n\t\t\torganizationId?: string;\n\t\t\ttenantId?: string;\n\t\t\tnodeId?: string;\n\t\t\tevent?: AuthAuditEvent | string;\n\t\t\tstartDate?: string;\n\t\t\tendDate?: string;\n\t\t},\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuthenticationAuditEntry[];\n\t\tcursor?: string;\n\t}>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAuthenticationAuditEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuthenticationAuditEntry.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationAuditEntry.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { AuthAuditEvent } from \"./authAuditEvent.js\";\n\n/**\n * Contract definition for authentication audit entry.\n */\nexport interface IAuthenticationAuditEntry {\n\t/**\n\t * The unique identifier for the audit entry.\n\t */\n\tid: string;\n\n\t/**\n\t * The audit event that occurred.\n\t */\n\tevent: AuthAuditEvent | string;\n\n\t/**\n\t * The timestamp of the audit entry in ISO 8601 format.\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The actor identifier, could be e-mail, username, or other unique identifier.\n\t */\n\tactorId?: string;\n\n\t/**\n\t * The node identifier associated with the audit entry, if applicable.\n\t */\n\tnodeId?: string;\n\n\t/**\n\t * The organization identifier associated with the audit entry, if applicable.\n\t */\n\torganizationId?: string;\n\n\t/**\n\t * The tenant identifier associated with the audit entry, if applicable.\n\t */\n\ttenantId?: string;\n\n\t/**\n\t * The hashed IP addresses of the client.\n\t */\n\tipAddressHashes?: string[];\n\n\t/**\n\t * The user agent string of the client.\n\t */\n\tuserAgent?: string;\n\n\t/**\n\t * The correlation ID for request tracing.\n\t */\n\tcorrelationId?: string;\n\n\t/**\n\t * Additional data related to the audit entry, such as IP address, user agent, etc.\n\t */\n\tdata?: unknown;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IAuthenticationComponent.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\n\n/**\n * Contract definition for authentication component.\n */\nexport interface IAuthenticationComponent extends IComponent {\n\t/**\n\t * Perform a login for the user.\n\t * @param email The email address for the user.\n\t * @param password The password for the user.\n\t * @returns The authentication token for the user, if it uses a mechanism with public access.\n\t */\n\tlogin(\n\t\temail: string,\n\t\tpassword: string\n\t): Promise<{\n\t\ttoken?: string;\n\t\texpiry: number;\n\t}>;\n\n\t/**\n\t * Logout the current user.\n\t * @param token The token to logout, if it uses a mechanism with public access.\n\t * @returns Nothing.\n\t */\n\tlogout(token?: string): Promise<void>;\n\n\t/**\n\t * Refresh the token.\n\t * @param token The token to refresh, if it uses a mechanism with public access.\n\t * @returns The refreshed token, if it uses a mechanism with public access.\n\t */\n\trefresh(token?: string): Promise<{\n\t\ttoken?: string;\n\t\texpiry: number;\n\t}>;\n\n\t/**\n\t * Update the user's password.\n\t * @param email The email address of the user to update.\n\t * @param currentPassword The current password for the user.\n\t * @param newPassword The new password for the user.\n\t * @returns Nothing.\n\t */\n\tupdatePassword(email: string, currentPassword: string, newPassword: string): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"IAuthenticationComponent.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\n\n/**\n * Contract definition for authentication component.\n */\nexport interface IAuthenticationComponent extends IComponent {\n\t/**\n\t * Perform a login for the user.\n\t * @param email The email address for the user.\n\t * @param password The password for the user.\n\t * @returns The authentication token for the user, if it uses a mechanism with public access.\n\t */\n\tlogin(\n\t\temail: string,\n\t\tpassword: string\n\t): Promise<{\n\t\ttoken?: string;\n\t\texpiry: number;\n\t}>;\n\n\t/**\n\t * Logout the current user.\n\t * @param token The token to logout, if it uses a mechanism with public access.\n\t * @returns Nothing.\n\t */\n\tlogout(token?: string): Promise<void>;\n\n\t/**\n\t * Refresh the token.\n\t * @param token The token to refresh, if it uses a mechanism with public access.\n\t * @returns The refreshed token, if it uses a mechanism with public access.\n\t */\n\trefresh(token?: string): Promise<{\n\t\ttoken?: string;\n\t\texpiry: number;\n\t}>;\n\n\t/**\n\t * Update the user's password.\n\t * @param currentPassword The current password for the user.\n\t * @param newPassword The new password for the user.\n\t * @returns Nothing.\n\t */\n\tupdatePassword(currentPassword: string, newPassword: string): Promise<void>;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAuthenticationRateActionConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuthenticationRateActionConfig.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationRateActionConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for an authentication rate limited action.\n */\nexport interface IAuthenticationRateActionConfig {\n\t/**\n\t * Maximum number of failed attempts allowed per window.\n\t */\n\tmaxAttempts: number;\n\n\t/**\n\t * Rate limit window duration in minutes.\n\t */\n\twindowMinutes: number;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAuthenticationRateComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuthenticationRateComponent.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationRateComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IAuthenticationRateActionConfig } from \"./IAuthenticationRateActionConfig.js\";\n\n/**\n * Contract definition for authentication rate component.\n */\nexport interface IAuthenticationRateComponent extends IComponent {\n\t/**\n\t * The service needs to be started when the application is initialized.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns Nothing.\n\t */\n\tstart(nodeLoggingComponentType?: string): Promise<void>;\n\n\t/**\n\t * The component needs to be stopped when the node is closed.\n\t * @param nodeLoggingComponentType The node logging component type.\n\t * @returns Nothing.\n\t */\n\tstop(nodeLoggingComponentType?: string): Promise<void>;\n\n\t/**\n\t * Register or update rate-limit configuration for an action.\n\t * @param action The action name.\n\t * @param config The action configuration.\n\t * @returns Nothing.\n\t */\n\tregisterAction(action: string, config: IAuthenticationRateActionConfig): Promise<void>;\n\n\t/**\n\t * Unregister rate-limit configuration for an action.\n\t * @param action The action name.\n\t * @returns Nothing.\n\t */\n\tunregisterAction(action: string): Promise<void>;\n\n\t/**\n\t * Check the authentication rate for a given action and identifier.\n\t * @param action The action to be checked.\n\t * @param identifier The identifier to be checked.\n\t * @returns The result of the rate check.\n\t */\n\tcheck(action: string, identifier: string): Promise<string>;\n\n\t/**\n\t * Clear the authentication rate entry for the given action and identifier.\n\t * @param action The action to clear.\n\t * @param identifier The identifier to clear.\n\t * @returns Nothing.\n\t */\n\tclear(action: string, identifier: string): Promise<void>;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAuthenticationUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuthenticationUser.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationUser.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Contract definition for authentication user.\n */\nexport interface IAuthenticationUser {\n\t/**\n\t * The user e-mail address.\n\t */\n\temail: string;\n\n\t/**\n\t * The user identity.\n\t */\n\tuserIdentity: string;\n\n\t/**\n\t * The users organization.\n\t */\n\torganizationIdentity: string;\n\n\t/**\n\t * The scope assigned to the user, comma separated.\n\t */\n\tscope: string[];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAuthenticationUserSecure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuthenticationUserSecure.js","sourceRoot":"","sources":["../../../src/models/IAuthenticationUserSecure.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationUser } from \"./IAuthenticationUser.js\";\n\n/**\n * Contract definition for authentication user.\n */\nexport interface IAuthenticationUserSecure extends IAuthenticationUser {\n\t/**\n\t * The encrypted password for the user.\n\t */\n\tpassword: string;\n\n\t/**\n\t * The salt for the password.\n\t */\n\tsalt: string;\n\n\t/**\n\t * The tenant ID associated with the user, optional in single tenant contexts.\n\t */\n\ttenantId: string;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAdminUserCreateRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAdminUserCreateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAdminUserCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationUser } from \"../IAuthenticationUser.js\";\n\n/**\n * Create a new user as an admin.\n */\nexport interface IAdminUserCreateRequest {\n\t/**\n\t * The body of the request.\n\t */\n\tbody: IAuthenticationUser & { password: string };\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAdminUserGetByIdentityRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAdminUserGetByIdentityRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAdminUserGetByIdentityRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a user as an admin.\n */\nexport interface IAdminUserGetByIdentityRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The user identity.\n\t\t */\n\t\tidentity: string;\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAdminUserGetRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAdminUserGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAdminUserGetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a user as an admin.\n */\nexport interface IAdminUserGetRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The user email.\n\t\t */\n\t\temail: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAdminUserGetResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAdminUserGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IAdminUserGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationUser } from \"../IAuthenticationUser.js\";\n\n/**\n * Get a user as an admin.\n */\nexport interface IAdminUserGetResponse {\n\t/**\n\t * The body of the request.\n\t */\n\tbody: IAuthenticationUser;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAdminUserRemoveRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAdminUserRemoveRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAdminUserRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Remove a user as an admin.\n */\nexport interface IAdminUserRemoveRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The user email.\n\t\t */\n\t\temail: string;\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAdminUserUpdatePasswordRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAdminUserUpdatePasswordRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAdminUserUpdatePasswordRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Update a users password as an admin.\n */\nexport interface IAdminUserUpdatePasswordRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The user email.\n\t\t */\n\t\temail: string;\n\t};\n\n\t/**\n\t * The body of the request.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The new password for the user.\n\t\t */\n\t\tnewPassword: string;\n\n\t\t/**\n\t\t * The current password for the user.\n\t\t */\n\t\tcurrentPassword?: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAdminUserUpdateRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAdminUserUpdateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAdminUserUpdateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationUser } from \"../IAuthenticationUser.js\";\n\n/**\n * Update a user as an admin.\n */\nexport interface IAdminUserUpdateRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The user email.\n\t\t */\n\t\temail: string;\n\t};\n\n\t/**\n\t * The body of the request.\n\t */\n\tbody: Partial<Omit<IAuthenticationUser, \"email\">>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAuditCreateRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuditCreateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAuditCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationAuditEntry } from \"../IAuthenticationAuditEntry.js\";\n\n/**\n * Create an authentication audit entry.\n */\nexport interface IAuditCreateRequest {\n\t/**\n\t * The body of the request.\n\t */\n\tbody: Omit<IAuthenticationAuditEntry, \"id\" | \"dateCreated\">;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAuditQueryRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuditQueryRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAuditQueryRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { AuthAuditEvent } from \"../authAuditEvent.js\";\n\n/**\n * Query authentication audit entries.\n */\nexport interface IAuditQueryRequest {\n\t/**\n\t * The query parameters for the request.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The actor identifier to filter by.\n\t\t */\n\t\tactorId?: string;\n\n\t\t/**\n\t\t * The organization identifier to filter by.\n\t\t */\n\t\torganizationId?: string;\n\n\t\t/**\n\t\t * The tenant identifier to filter by.\n\t\t */\n\t\ttenantId?: string;\n\n\t\t/**\n\t\t * The node identifier to filter by.\n\t\t */\n\t\tnodeId?: string;\n\n\t\t/**\n\t\t * The event to filter by.\n\t\t */\n\t\tevent?: AuthAuditEvent | string;\n\n\t\t/**\n\t\t * The inclusive start date for filtering, in ISO 8601 format.\n\t\t */\n\t\tstartDate?: string;\n\n\t\t/**\n\t\t * The inclusive end date for filtering, in ISO 8601 format.\n\t\t */\n\t\tendDate?: string;\n\n\t\t/**\n\t\t * The pagination cursor.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * The maximum number of results to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAuditQueryResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAuditQueryResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IAuditQueryResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthenticationAuditEntry } from \"../IAuthenticationAuditEntry.js\";\n\n/**\n * Response from querying authentication audit entries.\n */\nexport interface IAuditQueryResponse {\n\t/**\n\t * The response body.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The returned audit entries.\n\t\t */\n\t\tentries: IAuthenticationAuditEntry[];\n\n\t\t/**\n\t\t * The cursor to retrieve the next page, if any.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
@@ -1,4 +1,2 @@
1
- // Copyright 2024 IOTA Stiftung.
2
- // SPDX-License-Identifier: Apache-2.0.
3
1
  export {};
4
2
  //# sourceMappingURL=ILoginResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ILoginResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ILoginResponse.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Response from a login on the server.\n */\nexport interface ILoginResponse {\n\t/**\n\t * The login response details.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The access token, if it uses a mechanism with public access.\n\t\t */\n\t\ttoken?: string;\n\n\t\t/**\n\t\t * The expiry time of the token.\n\t\t */\n\t\texpiry: number;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ILoginResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ILoginResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes } from \"@twin.org/web\";\n\n/**\n * Response from a login on the server.\n */\nexport interface ILoginResponse {\n\t/**\n\t * Response headers.\n\t */\n\theaders?: {\n\t\t/**\n\t\t * The cookie containing the auth token.\n\t\t */\n\t\t[HeaderTypes.SetCookie]?: string;\n\t};\n\n\t/**\n\t * The login response details.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The expiry time of the token.\n\t\t */\n\t\texpiry: number;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ILogoutRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ILogoutRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Perform a logout on the auth token.\n */\nexport interface ILogoutRequest {\n\t/**\n\t * The logout token details.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The token to logout, if it uses a mechanism with public access.\n\t\t */\n\t\ttoken?: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ILogoutRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ILogoutRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Perform a logout on the auth token.\n */\nexport interface ILogoutRequest {\n\t/**\n\t * The logout token details.\n\t */\n\tbody?: {\n\t\t/**\n\t\t * The token to logout, if it uses a mechanism with public access.\n\t\t */\n\t\ttoken?: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IRefreshTokenRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IRefreshTokenRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Perform a refresh of the auth token.\n */\nexport interface IRefreshTokenRequest {\n\t/**\n\t * The refresh token details.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The token to refresh, if it uses a mechanism with public access.\n\t\t */\n\t\ttoken?: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"IRefreshTokenRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IRefreshTokenRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Perform a refresh of the auth token.\n */\nexport interface IRefreshTokenRequest {\n\t/**\n\t * The refresh token details.\n\t */\n\tbody?: {\n\t\t/**\n\t\t * The token to refresh, if it uses a mechanism with public access.\n\t\t */\n\t\ttoken?: string;\n\t};\n}\n"]}
@@ -1,4 +1,2 @@
1
- // Copyright 2024 IOTA Stiftung.
2
- // SPDX-License-Identifier: Apache-2.0.
3
1
  export {};
4
2
  //# sourceMappingURL=IRefreshTokenResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IRefreshTokenResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IRefreshTokenResponse.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Response from a refresh on the auth token.\n */\nexport interface IRefreshTokenResponse {\n\t/**\n\t * The refresh token details.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The refreshed token, if it uses a mechanism with public access.\n\t\t */\n\t\ttoken?: string;\n\n\t\t/**\n\t\t * The expiry time of the token.\n\t\t */\n\t\texpiry: number;\n\t};\n}\n"]}
1
+ {"version":3,"file":"IRefreshTokenResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IRefreshTokenResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes } from \"@twin.org/web\";\n\n/**\n * Response from a refresh on the auth token.\n */\nexport interface IRefreshTokenResponse {\n\t/**\n\t * Response headers.\n\t */\n\theaders?: {\n\t\t/**\n\t\t * The cookie containing the auth token.\n\t\t */\n\t\t[HeaderTypes.SetCookie]?: string;\n\t};\n\n\t/**\n\t * The refresh token details.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The expiry time of the token.\n\t\t */\n\t\texpiry: number;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IUpdatePasswordRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IUpdatePasswordRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Update a users password.\n */\nexport interface IUpdatePasswordRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The user email.\n\t\t */\n\t\temail: string;\n\t};\n\n\t/**\n\t * The body of the request.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The current password for the user.\n\t\t */\n\t\tcurrentPassword: string;\n\n\t\t/**\n\t\t * The new password for the user.\n\t\t */\n\t\tnewPassword: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"IUpdatePasswordRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IUpdatePasswordRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Update the current user's password.\n */\nexport interface IUpdatePasswordRequest {\n\t/**\n\t * The body of the request.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The current password for the user.\n\t\t */\n\t\tcurrentPassword: string;\n\n\t\t/**\n\t\t * The new password for the user.\n\t\t */\n\t\tnewPassword: string;\n\t};\n}\n"]}
@@ -0,0 +1,49 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * Supported authentication audit events.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const AuthAuditEvent = {
8
+ /**
9
+ * Login success.
10
+ */
11
+ LoginSuccess: "login-success",
12
+ /**
13
+ * Login failure.
14
+ */
15
+ LoginFailure: "login-failure",
16
+ /**
17
+ * Logout.
18
+ */
19
+ Logout: "logout",
20
+ /**
21
+ * Token refreshed.
22
+ */
23
+ TokenRefreshed: "token-refreshed",
24
+ /**
25
+ * Account created.
26
+ */
27
+ AccountCreated: "account-created",
28
+ /**
29
+ * Account deleted.
30
+ */
31
+ AccountDeleted: "account-deleted",
32
+ /**
33
+ * Account updated.
34
+ */
35
+ AccountUpdated: "account-updated",
36
+ /**
37
+ * Account locked.
38
+ */
39
+ AccountLocked: "account-locked",
40
+ /**
41
+ * Account unlocked.
42
+ */
43
+ AccountUnlocked: "account-unlocked",
44
+ /**
45
+ * Password changed.
46
+ */
47
+ PasswordChanged: "password-changed"
48
+ };
49
+ //# sourceMappingURL=authAuditEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authAuditEvent.js","sourceRoot":"","sources":["../../../src/models/authAuditEvent.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B;;OAEG;IACH,YAAY,EAAE,eAAe;IAE7B;;OAEG;IACH,YAAY,EAAE,eAAe;IAE7B;;OAEG;IACH,MAAM,EAAE,QAAQ;IAEhB;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,cAAc,EAAE,iBAAiB;IAEjC;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAE/B;;OAEG;IACH,eAAe,EAAE,kBAAkB;IAEnC;;OAEG;IACH,eAAe,EAAE,kBAAkB;CAC1B,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Supported authentication audit events.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AuthAuditEvent = {\n\t/**\n\t * Login success.\n\t */\n\tLoginSuccess: \"login-success\",\n\n\t/**\n\t * Login failure.\n\t */\n\tLoginFailure: \"login-failure\",\n\n\t/**\n\t * Logout.\n\t */\n\tLogout: \"logout\",\n\n\t/**\n\t * Token refreshed.\n\t */\n\tTokenRefreshed: \"token-refreshed\",\n\n\t/**\n\t * Account created.\n\t */\n\tAccountCreated: \"account-created\",\n\n\t/**\n\t * Account deleted.\n\t */\n\tAccountDeleted: \"account-deleted\",\n\n\t/**\n\t * Account updated.\n\t */\n\tAccountUpdated: \"account-updated\",\n\n\t/**\n\t * Account locked.\n\t */\n\tAccountLocked: \"account-locked\",\n\n\t/**\n\t * Account unlocked.\n\t */\n\tAccountUnlocked: \"account-unlocked\",\n\n\t/**\n\t * Password changed.\n\t */\n\tPasswordChanged: \"password-changed\"\n} as const;\n\n/**\n * Supported authentication audit event values.\n */\nexport type AuthAuditEvent = (typeof AuthAuditEvent)[keyof typeof AuthAuditEvent];\n"]}
@@ -1,8 +1,25 @@
1
+ export * from "./models/api/IAdminUserCreateRequest.js";
2
+ export * from "./models/api/IAdminUserGetByIdentityRequest.js";
3
+ export * from "./models/api/IAdminUserGetRequest.js";
4
+ export * from "./models/api/IAdminUserGetResponse.js";
5
+ export * from "./models/api/IAdminUserRemoveRequest.js";
6
+ export * from "./models/api/IAdminUserUpdatePasswordRequest.js";
7
+ export * from "./models/api/IAdminUserUpdateRequest.js";
8
+ export * from "./models/api/IAuditCreateRequest.js";
9
+ export * from "./models/api/IAuditQueryRequest.js";
10
+ export * from "./models/api/IAuditQueryResponse.js";
1
11
  export * from "./models/api/ILoginRequest.js";
2
12
  export * from "./models/api/ILoginResponse.js";
3
13
  export * from "./models/api/ILogoutRequest.js";
4
14
  export * from "./models/api/IRefreshTokenRequest.js";
5
15
  export * from "./models/api/IRefreshTokenResponse.js";
6
16
  export * from "./models/api/IUpdatePasswordRequest.js";
17
+ export * from "./models/authAuditEvent.js";
7
18
  export * from "./models/IAuthenticationAdminComponent.js";
19
+ export * from "./models/IAuthenticationAuditComponent.js";
20
+ export * from "./models/IAuthenticationAuditEntry.js";
8
21
  export * from "./models/IAuthenticationComponent.js";
22
+ export * from "./models/IAuthenticationRateActionConfig.js";
23
+ export * from "./models/IAuthenticationRateComponent.js";
24
+ export * from "./models/IAuthenticationUser.js";
25
+ export * from "./models/IAuthenticationUserSecure.js";
@@ -1,19 +1,37 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
+ import type { IAuthenticationUser } from "./IAuthenticationUser.js";
2
3
  /**
3
4
  * Contract definition for authentication admin component.
4
5
  */
5
6
  export interface IAuthenticationAdminComponent extends IComponent {
6
7
  /**
7
8
  * Create a login for the user.
8
- * @param email The email address for the user.
9
- * @param password The password for the user.
10
- * @param userIdentity The DID to associate with the account.
11
- * @param organizationIdentity The organization of the user.
9
+ * @param user The user to create.
12
10
  * @returns Nothing.
13
11
  */
14
- create(email: string, password: string, userIdentity: string, organizationIdentity: string): Promise<void>;
12
+ create(user: IAuthenticationUser & {
13
+ password: string;
14
+ }): Promise<void>;
15
15
  /**
16
- * Remove the current user.
16
+ * Update a login for the user.
17
+ * @param user The user to update.
18
+ * @returns Nothing.
19
+ */
20
+ update(user: Partial<IAuthenticationUser>): Promise<void>;
21
+ /**
22
+ * Get a user by email.
23
+ * @param email The email address of the user to get.
24
+ * @returns The user details.
25
+ */
26
+ get(email: string): Promise<IAuthenticationUser>;
27
+ /**
28
+ * Get a user by identity.
29
+ * @param identity The identity of the user to get.
30
+ * @returns The user details.
31
+ */
32
+ getByIdentity(identity: string): Promise<IAuthenticationUser>;
33
+ /**
34
+ * Remove a user.
17
35
  * @param email The email address of the user to remove.
18
36
  * @returns Nothing.
19
37
  */
@@ -0,0 +1,40 @@
1
+ import type { IComponent } from "@twin.org/core";
2
+ import type { AuthAuditEvent } from "./authAuditEvent.js";
3
+ import type { IAuthenticationAuditEntry } from "./IAuthenticationAuditEntry.js";
4
+ /**
5
+ * Contract definition for authentication audit component.
6
+ */
7
+ export interface IAuthenticationAuditComponent extends IComponent {
8
+ /**
9
+ * Create a new audit entry.
10
+ * @param entry The audit entry to be logged.
11
+ * @returns The unique identifier of the created audit entry.
12
+ */
13
+ create(entry: Omit<IAuthenticationAuditEntry, "id" | "dateCreated">): Promise<string>;
14
+ /**
15
+ * Query the audit entries.
16
+ * @param options The query options.
17
+ * @param options.actorId The actor identifier to filter the audit entries, optional.
18
+ * @param options.organizationId The organization identifier to filter the audit entries, optional.
19
+ * @param options.tenantId The tenant identifier to filter the audit entries, optional.
20
+ * @param options.nodeId The node identifier to filter the audit entries, optional.
21
+ * @param options.event The audit event to filter the audit entries, optional.
22
+ * @param options.startDate The start date to filter the audit entries, optional.
23
+ * @param options.endDate The end date to filter the audit entries, optional.
24
+ * @param cursor The cursor for pagination.
25
+ * @param limit The maximum number of entries to return.
26
+ * @returns The audit entries.
27
+ */
28
+ query(options?: {
29
+ actorId?: string;
30
+ organizationId?: string;
31
+ tenantId?: string;
32
+ nodeId?: string;
33
+ event?: AuthAuditEvent | string;
34
+ startDate?: string;
35
+ endDate?: string;
36
+ }, cursor?: string, limit?: number): Promise<{
37
+ entries: IAuthenticationAuditEntry[];
38
+ cursor?: string;
39
+ }>;
40
+ }
@@ -0,0 +1,50 @@
1
+ import type { AuthAuditEvent } from "./authAuditEvent.js";
2
+ /**
3
+ * Contract definition for authentication audit entry.
4
+ */
5
+ export interface IAuthenticationAuditEntry {
6
+ /**
7
+ * The unique identifier for the audit entry.
8
+ */
9
+ id: string;
10
+ /**
11
+ * The audit event that occurred.
12
+ */
13
+ event: AuthAuditEvent | string;
14
+ /**
15
+ * The timestamp of the audit entry in ISO 8601 format.
16
+ */
17
+ dateCreated: string;
18
+ /**
19
+ * The actor identifier, could be e-mail, username, or other unique identifier.
20
+ */
21
+ actorId?: string;
22
+ /**
23
+ * The node identifier associated with the audit entry, if applicable.
24
+ */
25
+ nodeId?: string;
26
+ /**
27
+ * The organization identifier associated with the audit entry, if applicable.
28
+ */
29
+ organizationId?: string;
30
+ /**
31
+ * The tenant identifier associated with the audit entry, if applicable.
32
+ */
33
+ tenantId?: string;
34
+ /**
35
+ * The hashed IP addresses of the client.
36
+ */
37
+ ipAddressHashes?: string[];
38
+ /**
39
+ * The user agent string of the client.
40
+ */
41
+ userAgent?: string;
42
+ /**
43
+ * The correlation ID for request tracing.
44
+ */
45
+ correlationId?: string;
46
+ /**
47
+ * Additional data related to the audit entry, such as IP address, user agent, etc.
48
+ */
49
+ data?: unknown;
50
+ }
@@ -30,10 +30,9 @@ export interface IAuthenticationComponent extends IComponent {
30
30
  }>;
31
31
  /**
32
32
  * Update the user's password.
33
- * @param email The email address of the user to update.
34
33
  * @param currentPassword The current password for the user.
35
34
  * @param newPassword The new password for the user.
36
35
  * @returns Nothing.
37
36
  */
38
- updatePassword(email: string, currentPassword: string, newPassword: string): Promise<void>;
37
+ updatePassword(currentPassword: string, newPassword: string): Promise<void>;
39
38
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Configuration for an authentication rate limited action.
3
+ */
4
+ export interface IAuthenticationRateActionConfig {
5
+ /**
6
+ * Maximum number of failed attempts allowed per window.
7
+ */
8
+ maxAttempts: number;
9
+ /**
10
+ * Rate limit window duration in minutes.
11
+ */
12
+ windowMinutes: number;
13
+ }
@@ -0,0 +1,46 @@
1
+ import type { IComponent } from "@twin.org/core";
2
+ import type { IAuthenticationRateActionConfig } from "./IAuthenticationRateActionConfig.js";
3
+ /**
4
+ * Contract definition for authentication rate component.
5
+ */
6
+ export interface IAuthenticationRateComponent extends IComponent {
7
+ /**
8
+ * The service needs to be started when the application is initialized.
9
+ * @param nodeLoggingComponentType The node logging component type.
10
+ * @returns Nothing.
11
+ */
12
+ start(nodeLoggingComponentType?: string): Promise<void>;
13
+ /**
14
+ * The component needs to be stopped when the node is closed.
15
+ * @param nodeLoggingComponentType The node logging component type.
16
+ * @returns Nothing.
17
+ */
18
+ stop(nodeLoggingComponentType?: string): Promise<void>;
19
+ /**
20
+ * Register or update rate-limit configuration for an action.
21
+ * @param action The action name.
22
+ * @param config The action configuration.
23
+ * @returns Nothing.
24
+ */
25
+ registerAction(action: string, config: IAuthenticationRateActionConfig): Promise<void>;
26
+ /**
27
+ * Unregister rate-limit configuration for an action.
28
+ * @param action The action name.
29
+ * @returns Nothing.
30
+ */
31
+ unregisterAction(action: string): Promise<void>;
32
+ /**
33
+ * Check the authentication rate for a given action and identifier.
34
+ * @param action The action to be checked.
35
+ * @param identifier The identifier to be checked.
36
+ * @returns The result of the rate check.
37
+ */
38
+ check(action: string, identifier: string): Promise<string>;
39
+ /**
40
+ * Clear the authentication rate entry for the given action and identifier.
41
+ * @param action The action to clear.
42
+ * @param identifier The identifier to clear.
43
+ * @returns Nothing.
44
+ */
45
+ clear(action: string, identifier: string): Promise<void>;
46
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Contract definition for authentication user.
3
+ */
4
+ export interface IAuthenticationUser {
5
+ /**
6
+ * The user e-mail address.
7
+ */
8
+ email: string;
9
+ /**
10
+ * The user identity.
11
+ */
12
+ userIdentity: string;
13
+ /**
14
+ * The users organization.
15
+ */
16
+ organizationIdentity: string;
17
+ /**
18
+ * The scope assigned to the user, comma separated.
19
+ */
20
+ scope: string[];
21
+ }