@ooneex/user 0.0.1 → 0.0.5
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.
- package/dist/index.d.ts +37 -1
- package/dist/index.js.map +1 -1
- package/package.json +14 -6
package/dist/index.d.ts
CHANGED
|
@@ -119,4 +119,40 @@ interface IUserProfileUpdate extends IBase {
|
|
|
119
119
|
user?: IUser;
|
|
120
120
|
verification?: IVerification;
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
interface IUserFollowed extends IBase {
|
|
123
|
+
user?: IUser;
|
|
124
|
+
userId?: string;
|
|
125
|
+
followedBy?: string;
|
|
126
|
+
followedById?: string;
|
|
127
|
+
}
|
|
128
|
+
interface IUserBlocked extends IBase {
|
|
129
|
+
user?: IUser;
|
|
130
|
+
userId?: string;
|
|
131
|
+
blockedBy?: string;
|
|
132
|
+
blockedById?: string;
|
|
133
|
+
reason?: string;
|
|
134
|
+
}
|
|
135
|
+
interface IUserReport extends IBase {
|
|
136
|
+
user?: IUser;
|
|
137
|
+
userId?: string;
|
|
138
|
+
reason: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
reportedBy?: string;
|
|
141
|
+
reportedById?: string;
|
|
142
|
+
}
|
|
143
|
+
interface IUserViewed extends IBase {
|
|
144
|
+
user?: IUser;
|
|
145
|
+
userId?: string;
|
|
146
|
+
viewedBy?: string;
|
|
147
|
+
viewedById?: string;
|
|
148
|
+
}
|
|
149
|
+
interface IUserStat extends IBase {
|
|
150
|
+
user?: IUser;
|
|
151
|
+
userId?: string;
|
|
152
|
+
followersCount?: number;
|
|
153
|
+
followingCount?: number;
|
|
154
|
+
blockedCount?: number;
|
|
155
|
+
viewsCount?: number;
|
|
156
|
+
reportsCount?: number;
|
|
157
|
+
}
|
|
158
|
+
export { VerificationType, ProfileUpdateStatusType, IVerification, IUserViewed, IUserStat, IUserReport, IUserProfileUpdate, IUserFollowed, IUserBlocked, IUser, ISession, IAccount, EVerificationType, EProfileUpdateStatus, EAccountType, AccountType };
|
package/dist/index.js.map
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/types.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { IImage } from \"@ooneex/image\";\nimport type { ERole } from \"@ooneex/role\";\nimport type { IBase } from \"@ooneex/types\";\n\nexport enum EAccountType {\n OAUTH = \"oauth\",\n EMAIL = \"email\",\n CREDENTIALS = \"credentials\",\n WEBAUTHN = \"webauthn\",\n}\n\nexport enum EVerificationType {\n EMAIL = \"email\",\n PHONE = \"phone\",\n PASSWORD_RESET = \"password_reset\",\n TWO_FACTOR = \"two_factor\",\n ACCOUNT_ACTIVATION = \"account_activation\",\n}\n\nexport enum EProfileUpdateStatus {\n PENDING = \"pending\",\n COMPLETED = \"completed\",\n FAILED = \"failed\",\n REVERTED = \"reverted\",\n}\n\nexport type AccountType = `${EAccountType}`;\nexport type VerificationType = `${EVerificationType}`;\nexport type ProfileUpdateStatusType = `${EProfileUpdateStatus}`;\n\nexport interface IUser extends IBase {\n email: string;\n roles: ERole[];\n name?: string;\n lastName?: string;\n firstName?: string;\n username?: string;\n avatar?: IImage;\n bio?: string;\n phone?: string;\n birthDate?: Date;\n timezone?: string;\n isEmailVerified?: boolean;\n isPhoneVerified?: boolean;\n lastActiveAt?: Date;\n emailVerifiedAt?: Date;\n phoneVerifiedAt?: Date;\n lastLoginAt?: Date;\n passwordChangedAt?: Date;\n twoFactorEnabled?: boolean;\n twoFactorSecret?: string;\n recoveryTokens?: string[];\n sessions?: ISession[];\n accounts?: IAccount[];\n verifications?: IVerification[];\n}\n\nexport interface ISession extends IBase {\n // Unique authentication token for the session\n token: string;\n // Token used to refresh the main session token when it expires\n refreshToken?: string;\n // Browser user agent string for device/browser identification\n userAgent?: string;\n // IP address from which the session was created\n ipAddress?: string;\n // Type of device (e.g., \"mobile\", \"desktop\", \"tablet\")\n deviceType?: string;\n // User-friendly device name (e.g., \"John's iPhone\", \"MacBook Pro\")\n deviceName?: string;\n // Browser name and version (e.g., \"Chrome 120.0\", \"Safari 17.1\")\n browser?: string;\n // Operating system information (e.g., \"macOS 14.2\", \"Windows 11\")\n operatingSystem?: string;\n // Geographic location where session was created (e.g., \"New York, US\")\n location?: string;\n // Whether the session is currently active and valid\n isActive: boolean;\n // When the session expires and becomes invalid\n expiresAt: Date;\n // Last time this session was used for authentication\n lastAccessAt?: Date;\n // When the session was manually revoked/terminated\n revokedAt?: Date;\n // Reason for session revocation (e.g., \"user_logout\", \"admin_revoked\", \"security_breach\")\n revokedReason?: string;\n user?: IUser;\n}\n\nexport interface IAccount extends IBase {\n // OAuth provider name (e.g., \"google\", \"github\", \"facebook\", \"microsoft\")\n provider?: string;\n // Unique account ID from the external provider\n providerAccountId?: string;\n // Authentication method used for this account\n type: EAccountType;\n // Hashed password for credentials-based accounts\n password?: string;\n // Token for accessing provider APIs on behalf of the user\n accessToken?: string;\n // When the access token expires and needs refresh\n accessTokenExpiresAt?: Date;\n // Token used to obtain new access tokens\n refreshToken?: string;\n // When the refresh token expires\n refreshTokenExpiresAt?: Date;\n // General expiration date for the account connection\n expiresAt?: Date;\n // e.g., \"Bearer\", \"Basic\", \"JWT\" - defines how the access token should be used\n tokenType?: string;\n // OAuth scopes granted (e.g., \"read:user,user:email\")\n scope?: string;\n // OpenID Connect ID token containing user identity claims\n idToken?: string;\n // OAuth session state parameter for security\n sessionState?: string;\n // Email address associated with this provider account\n email?: string;\n // Whether the email is verified by the provider\n emailVerified?: boolean;\n // Display name from the provider profile\n name?: string;\n // Profile picture/avatar from the provider\n picture?: string;\n // Additional profile data from the provider\n profile?: Record<string, unknown>;\n user?: IUser;\n}\n\nexport interface IVerification extends IBase {\n // Email address to be verified (for email verification types)\n email?: string;\n // Phone number to be verified (for phone verification types)\n phone?: string;\n // Secure token used for verification (typically UUID or similar)\n token: string;\n // Type of verification being performed\n type: EVerificationType;\n // Short numeric code sent to user (alternative to token for SMS/email)\n code?: string;\n // Whether this verification has been successfully completed\n isUsed: boolean;\n // When the verification was successfully completed\n usedAt?: Date;\n // When this verification expires and becomes invalid\n expiresAt: Date;\n // Number of verification attempts made so far\n attemptsCount: number;\n // Maximum allowed verification attempts before blocking\n maxAttempts: number;\n // IP address from which verification was requested\n ipAddress?: string;\n // Browser user agent string for security tracking\n userAgent?: string;\n // Additional data specific to the verification type\n metadata?: Record<string, unknown>;\n description?: string;\n user?: IUser;\n}\n\nexport interface IUserProfileUpdate extends IBase {\n // What fields were changed in this update\n changedFields: string[];\n // Previous values before the update (for audit trail)\n previousValues?: Record<string, unknown>;\n // New values after the update\n newValues?: Record<string, unknown>;\n // Reason for the update (e.g., \"profile_completion\", \"user_edit\", \"admin_correction\")\n updateReason?: string;\n // IP address from which the update was made\n ipAddress?: string;\n // Browser user agent string for security tracking\n userAgent?: string;\n // Whether this update requires verification (e.g., email/phone changes)\n requiresVerification?: boolean;\n // Status of the update (e.g., \"pending\", \"completed\", \"failed\", \"reverted\")\n status: EProfileUpdateStatus;\n // When the update was applied/completed\n appliedAt?: Date;\n // Additional metadata specific to the update\n metadata?: Record<string, unknown>;\n description?: string;\n user?: IUser;\n // Reference to verification if update requires it\n verification?: IVerification;\n}\n"
|
|
5
|
+
"import type { IImage } from \"@ooneex/image\";\nimport type { ERole } from \"@ooneex/role\";\nimport type { IBase } from \"@ooneex/types\";\n\nexport enum EAccountType {\n OAUTH = \"oauth\",\n EMAIL = \"email\",\n CREDENTIALS = \"credentials\",\n WEBAUTHN = \"webauthn\",\n}\n\nexport enum EVerificationType {\n EMAIL = \"email\",\n PHONE = \"phone\",\n PASSWORD_RESET = \"password_reset\",\n TWO_FACTOR = \"two_factor\",\n ACCOUNT_ACTIVATION = \"account_activation\",\n}\n\nexport enum EProfileUpdateStatus {\n PENDING = \"pending\",\n COMPLETED = \"completed\",\n FAILED = \"failed\",\n REVERTED = \"reverted\",\n}\n\nexport type AccountType = `${EAccountType}`;\nexport type VerificationType = `${EVerificationType}`;\nexport type ProfileUpdateStatusType = `${EProfileUpdateStatus}`;\n\nexport interface IUser extends IBase {\n email: string;\n roles: ERole[];\n name?: string;\n lastName?: string;\n firstName?: string;\n username?: string;\n avatar?: IImage;\n bio?: string;\n phone?: string;\n birthDate?: Date;\n timezone?: string;\n isEmailVerified?: boolean;\n isPhoneVerified?: boolean;\n lastActiveAt?: Date;\n emailVerifiedAt?: Date;\n phoneVerifiedAt?: Date;\n lastLoginAt?: Date;\n passwordChangedAt?: Date;\n twoFactorEnabled?: boolean;\n twoFactorSecret?: string;\n recoveryTokens?: string[];\n sessions?: ISession[];\n accounts?: IAccount[];\n verifications?: IVerification[];\n}\n\nexport interface ISession extends IBase {\n // Unique authentication token for the session\n token: string;\n // Token used to refresh the main session token when it expires\n refreshToken?: string;\n // Browser user agent string for device/browser identification\n userAgent?: string;\n // IP address from which the session was created\n ipAddress?: string;\n // Type of device (e.g., \"mobile\", \"desktop\", \"tablet\")\n deviceType?: string;\n // User-friendly device name (e.g., \"John's iPhone\", \"MacBook Pro\")\n deviceName?: string;\n // Browser name and version (e.g., \"Chrome 120.0\", \"Safari 17.1\")\n browser?: string;\n // Operating system information (e.g., \"macOS 14.2\", \"Windows 11\")\n operatingSystem?: string;\n // Geographic location where session was created (e.g., \"New York, US\")\n location?: string;\n // Whether the session is currently active and valid\n isActive: boolean;\n // When the session expires and becomes invalid\n expiresAt: Date;\n // Last time this session was used for authentication\n lastAccessAt?: Date;\n // When the session was manually revoked/terminated\n revokedAt?: Date;\n // Reason for session revocation (e.g., \"user_logout\", \"admin_revoked\", \"security_breach\")\n revokedReason?: string;\n user?: IUser;\n}\n\nexport interface IAccount extends IBase {\n // OAuth provider name (e.g., \"google\", \"github\", \"facebook\", \"microsoft\")\n provider?: string;\n // Unique account ID from the external provider\n providerAccountId?: string;\n // Authentication method used for this account\n type: EAccountType;\n // Hashed password for credentials-based accounts\n password?: string;\n // Token for accessing provider APIs on behalf of the user\n accessToken?: string;\n // When the access token expires and needs refresh\n accessTokenExpiresAt?: Date;\n // Token used to obtain new access tokens\n refreshToken?: string;\n // When the refresh token expires\n refreshTokenExpiresAt?: Date;\n // General expiration date for the account connection\n expiresAt?: Date;\n // e.g., \"Bearer\", \"Basic\", \"JWT\" - defines how the access token should be used\n tokenType?: string;\n // OAuth scopes granted (e.g., \"read:user,user:email\")\n scope?: string;\n // OpenID Connect ID token containing user identity claims\n idToken?: string;\n // OAuth session state parameter for security\n sessionState?: string;\n // Email address associated with this provider account\n email?: string;\n // Whether the email is verified by the provider\n emailVerified?: boolean;\n // Display name from the provider profile\n name?: string;\n // Profile picture/avatar from the provider\n picture?: string;\n // Additional profile data from the provider\n profile?: Record<string, unknown>;\n user?: IUser;\n}\n\nexport interface IVerification extends IBase {\n // Email address to be verified (for email verification types)\n email?: string;\n // Phone number to be verified (for phone verification types)\n phone?: string;\n // Secure token used for verification (typically UUID or similar)\n token: string;\n // Type of verification being performed\n type: EVerificationType;\n // Short numeric code sent to user (alternative to token for SMS/email)\n code?: string;\n // Whether this verification has been successfully completed\n isUsed: boolean;\n // When the verification was successfully completed\n usedAt?: Date;\n // When this verification expires and becomes invalid\n expiresAt: Date;\n // Number of verification attempts made so far\n attemptsCount: number;\n // Maximum allowed verification attempts before blocking\n maxAttempts: number;\n // IP address from which verification was requested\n ipAddress?: string;\n // Browser user agent string for security tracking\n userAgent?: string;\n // Additional data specific to the verification type\n metadata?: Record<string, unknown>;\n description?: string;\n user?: IUser;\n}\n\nexport interface IUserProfileUpdate extends IBase {\n // What fields were changed in this update\n changedFields: string[];\n // Previous values before the update (for audit trail)\n previousValues?: Record<string, unknown>;\n // New values after the update\n newValues?: Record<string, unknown>;\n // Reason for the update (e.g., \"profile_completion\", \"user_edit\", \"admin_correction\")\n updateReason?: string;\n // IP address from which the update was made\n ipAddress?: string;\n // Browser user agent string for security tracking\n userAgent?: string;\n // Whether this update requires verification (e.g., email/phone changes)\n requiresVerification?: boolean;\n // Status of the update (e.g., \"pending\", \"completed\", \"failed\", \"reverted\")\n status: EProfileUpdateStatus;\n // When the update was applied/completed\n appliedAt?: Date;\n // Additional metadata specific to the update\n metadata?: Record<string, unknown>;\n description?: string;\n user?: IUser;\n // Reference to verification if update requires it\n verification?: IVerification;\n}\n\nexport interface IUserFollowed extends IBase {\n user?: IUser;\n userId?: string;\n followedBy?: string;\n followedById?: string;\n}\n\nexport interface IUserBlocked extends IBase {\n user?: IUser;\n userId?: string;\n blockedBy?: string;\n blockedById?: string;\n reason?: string;\n}\n\nexport interface IUserReport extends IBase {\n user?: IUser;\n userId?: string;\n reason: string;\n description?: string;\n reportedBy?: string;\n reportedById?: string;\n}\n\nexport interface IUserViewed extends IBase {\n user?: IUser;\n userId?: string;\n viewedBy?: string;\n viewedById?: string;\n}\n\nexport interface IUserStat extends IBase {\n user?: IUser;\n userId?: string;\n followersCount?: number;\n followingCount?: number;\n blockedCount?: number;\n viewsCount?: number;\n reportsCount?: number;\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "AAIO,IAAK,GAAL,CAAK,IAAL,CACL,QAAQ,QACR,QAAQ,QACR,cAAc,cACd,WAAW,aAJD,QAOL,IAAK,GAAL,CAAK,IAAL,CACL,QAAQ,QACR,QAAQ,QACR,iBAAiB,iBACjB,aAAa,aACb,qBAAqB,uBALX,QAQL,IAAK,GAAL,CAAK,IAAL,CACL,UAAU,UACV,YAAY,YACZ,SAAS,SACT,WAAW,aAJD",
|
|
8
8
|
"debugId": "F14F79B7E6C44C2164756E2164756E21",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ooneex/user",
|
|
3
|
-
"description": "",
|
|
4
|
-
"version": "0.0.
|
|
3
|
+
"description": "User entity types and interfaces for user profiles, authentication data, and role-based identity management",
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -24,9 +24,8 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "bunup",
|
|
26
26
|
"lint": "tsgo --noEmit && bunx biome lint",
|
|
27
|
-
"publish
|
|
28
|
-
"
|
|
29
|
-
"publish:dry": "bun publish --dry-run"
|
|
27
|
+
"npm:publish": "bun publish --tolerate-republish --access public",
|
|
28
|
+
"test": "bun test tests"
|
|
30
29
|
},
|
|
31
30
|
"dependencies": {},
|
|
32
31
|
"devDependencies": {
|
|
@@ -34,5 +33,14 @@
|
|
|
34
33
|
"@ooneex/role": "0.0.1",
|
|
35
34
|
"@ooneex/types": "0.0.1"
|
|
36
35
|
},
|
|
37
|
-
"
|
|
36
|
+
"keywords": [
|
|
37
|
+
"account",
|
|
38
|
+
"bun",
|
|
39
|
+
"identity",
|
|
40
|
+
"ooneex",
|
|
41
|
+
"profile",
|
|
42
|
+
"typescript",
|
|
43
|
+
"user",
|
|
44
|
+
"users"
|
|
45
|
+
]
|
|
38
46
|
}
|