@propelauth/nextjs
Advanced tools
Comparing version 0.0.115 to 0.0.118
import React from 'react'; | ||
declare enum SocialLoginProvider { | ||
Google = "Google", | ||
GitHub = "GitHub", | ||
Microsoft = "Microsoft", | ||
Slack = "Slack", | ||
LinkedIn = "LinkedIn", | ||
Salesforce = "Salesforce", | ||
Xero = "Xero", | ||
QuickBooksOnline = "QuickBooks Online" | ||
} | ||
declare enum SamlLoginProvider { | ||
Google = "Google", | ||
Rippling = "Rippling", | ||
OneLogin = "OneLogin", | ||
JumpCloud = "JumpCloud", | ||
Okta = "Okta", | ||
Azure = "Azure", | ||
Duo = "Duo", | ||
Generic = "Generic" | ||
} | ||
type PasswordLoginMethod = { | ||
loginMethod: 'password'; | ||
}; | ||
type MagicLinkLoginMethod = { | ||
loginMethod: 'magic_link'; | ||
}; | ||
type SocialSsoLoginMethod = { | ||
loginMethod: 'social_sso'; | ||
provider: SocialLoginProvider; | ||
}; | ||
type EmailConfirmationLinkLoginMethod = { | ||
loginMethod: 'email_confirmation_link'; | ||
}; | ||
type SamlSsoLoginMethod = { | ||
loginMethod: 'saml_sso'; | ||
provider: SamlLoginProvider; | ||
orgId: string; | ||
}; | ||
type ImpersonationLoginMethod = { | ||
loginMethod: 'impersonation'; | ||
}; | ||
type GeneratedFromBackendApiLoginMethod = { | ||
loginMethod: 'generated_from_backend_api'; | ||
}; | ||
type UnknownLoginMethod = { | ||
loginMethod: 'unknown'; | ||
}; | ||
type LoginMethod = PasswordLoginMethod | MagicLinkLoginMethod | SocialSsoLoginMethod | EmailConfirmationLinkLoginMethod | SamlSsoLoginMethod | ImpersonationLoginMethod | GeneratedFromBackendApiLoginMethod | UnknownLoginMethod; | ||
declare class UserFromToken { | ||
@@ -13,2 +62,3 @@ userId: string; | ||
}; | ||
loginMethod?: LoginMethod; | ||
legacyUserId?: string; | ||
@@ -18,3 +68,3 @@ impersonatorUserId?: string; | ||
[key: string]: unknown; | ||
}); | ||
}, loginMethod?: LoginMethod); | ||
getOrg(orgId: string): OrgMemberInfo | undefined; | ||
@@ -21,0 +71,0 @@ getOrgByName(orgName: string): OrgMemberInfo | undefined; |
@@ -87,3 +87,3 @@ "use client"; | ||
var UserFromToken = class { | ||
constructor(userId, email, orgIdToOrgMemberInfo, firstName, lastName, username, legacyUserId, impersonatorUserId, properties) { | ||
constructor(userId, email, orgIdToOrgMemberInfo, firstName, lastName, username, legacyUserId, impersonatorUserId, properties, loginMethod) { | ||
this.userId = userId; | ||
@@ -98,2 +98,3 @@ this.orgIdToOrgMemberInfo = orgIdToOrgMemberInfo; | ||
this.properties = properties; | ||
this.loginMethod = loginMethod; | ||
} | ||
@@ -132,5 +133,3 @@ getOrg(orgId) { | ||
for (const orgId in obj.orgIdToOrgMemberInfo) { | ||
orgIdToOrgMemberInfo[orgId] = OrgMemberInfo.fromJSON( | ||
JSON.stringify(obj.orgIdToOrgMemberInfo[orgId]) | ||
); | ||
orgIdToOrgMemberInfo[orgId] = OrgMemberInfo.fromJSON(JSON.stringify(obj.orgIdToOrgMemberInfo[orgId])); | ||
} | ||
@@ -146,3 +145,4 @@ return new UserFromToken( | ||
obj.impersonatorUserId, | ||
obj.properties | ||
obj.properties, | ||
obj.loginMethod | ||
); | ||
@@ -149,0 +149,0 @@ } |
@@ -14,2 +14,51 @@ import { NextRequest } from 'next/server.js'; | ||
declare enum SocialLoginProvider { | ||
Google = "Google", | ||
GitHub = "GitHub", | ||
Microsoft = "Microsoft", | ||
Slack = "Slack", | ||
LinkedIn = "LinkedIn", | ||
Salesforce = "Salesforce", | ||
Xero = "Xero", | ||
QuickBooksOnline = "QuickBooks Online" | ||
} | ||
declare enum SamlLoginProvider { | ||
Google = "Google", | ||
Rippling = "Rippling", | ||
OneLogin = "OneLogin", | ||
JumpCloud = "JumpCloud", | ||
Okta = "Okta", | ||
Azure = "Azure", | ||
Duo = "Duo", | ||
Generic = "Generic" | ||
} | ||
type PasswordLoginMethod = { | ||
loginMethod: 'password'; | ||
}; | ||
type MagicLinkLoginMethod = { | ||
loginMethod: 'magic_link'; | ||
}; | ||
type SocialSsoLoginMethod = { | ||
loginMethod: 'social_sso'; | ||
provider: SocialLoginProvider; | ||
}; | ||
type EmailConfirmationLinkLoginMethod = { | ||
loginMethod: 'email_confirmation_link'; | ||
}; | ||
type SamlSsoLoginMethod = { | ||
loginMethod: 'saml_sso'; | ||
provider: SamlLoginProvider; | ||
orgId: string; | ||
}; | ||
type ImpersonationLoginMethod = { | ||
loginMethod: 'impersonation'; | ||
}; | ||
type GeneratedFromBackendApiLoginMethod = { | ||
loginMethod: 'generated_from_backend_api'; | ||
}; | ||
type UnknownLoginMethod = { | ||
loginMethod: 'unknown'; | ||
}; | ||
type LoginMethod = PasswordLoginMethod | MagicLinkLoginMethod | SocialSsoLoginMethod | EmailConfirmationLinkLoginMethod | SamlSsoLoginMethod | ImpersonationLoginMethod | GeneratedFromBackendApiLoginMethod | UnknownLoginMethod; | ||
declare class UserFromToken { | ||
@@ -25,2 +74,3 @@ userId: string; | ||
}; | ||
loginMethod?: LoginMethod; | ||
legacyUserId?: string; | ||
@@ -30,3 +80,3 @@ impersonatorUserId?: string; | ||
[key: string]: unknown; | ||
}); | ||
}, loginMethod?: LoginMethod); | ||
getOrg(orgId: string): OrgMemberInfo | undefined; | ||
@@ -33,0 +83,0 @@ getOrgByName(orgName: string): OrgMemberInfo | undefined; |
@@ -84,5 +84,30 @@ "use strict"; | ||
// src/loginMethod.ts | ||
function toLoginMethod(snake_case) { | ||
if (!snake_case) { | ||
return { loginMethod: "unknown" }; | ||
} | ||
switch (snake_case.login_method) { | ||
case "password": | ||
return { loginMethod: "password" }; | ||
case "magic_link": | ||
return { loginMethod: "magic_link" }; | ||
case "social_sso": | ||
return { loginMethod: "social_sso", provider: snake_case.provider }; | ||
case "email_confirmation_link": | ||
return { loginMethod: "email_confirmation_link" }; | ||
case "saml_sso": | ||
return { loginMethod: "saml_sso", provider: snake_case.provider, orgId: snake_case.org_id }; | ||
case "impersonation": | ||
return { loginMethod: "impersonation" }; | ||
case "generated_from_backend_api": | ||
return { loginMethod: "generated_from_backend_api" }; | ||
default: | ||
return { loginMethod: "unknown" }; | ||
} | ||
} | ||
// src/user.ts | ||
var UserFromToken = class { | ||
constructor(userId, email, orgIdToOrgMemberInfo, firstName, lastName, username, legacyUserId, impersonatorUserId, properties) { | ||
constructor(userId, email, orgIdToOrgMemberInfo, firstName, lastName, username, legacyUserId, impersonatorUserId, properties, loginMethod) { | ||
this.userId = userId; | ||
@@ -97,2 +122,3 @@ this.orgIdToOrgMemberInfo = orgIdToOrgMemberInfo; | ||
this.properties = properties; | ||
this.loginMethod = loginMethod; | ||
} | ||
@@ -131,5 +157,3 @@ getOrg(orgId) { | ||
for (const orgId in obj.orgIdToOrgMemberInfo) { | ||
orgIdToOrgMemberInfo[orgId] = OrgMemberInfo.fromJSON( | ||
JSON.stringify(obj.orgIdToOrgMemberInfo[orgId]) | ||
); | ||
orgIdToOrgMemberInfo[orgId] = OrgMemberInfo.fromJSON(JSON.stringify(obj.orgIdToOrgMemberInfo[orgId])); | ||
} | ||
@@ -145,3 +169,4 @@ return new UserFromToken( | ||
obj.impersonatorUserId, | ||
obj.properties | ||
obj.properties, | ||
obj.loginMethod | ||
); | ||
@@ -206,3 +231,4 @@ } | ||
snake_case.impersonatorUserId, | ||
snake_case.properties | ||
snake_case.properties, | ||
toLoginMethod(snake_case.login_method) | ||
); | ||
@@ -209,0 +235,0 @@ } |
import * as _propelauth_node_apis from '@propelauth/node-apis'; | ||
export { AccessToken, AccessTokenCreationException, AddUserToOrgException, AddUserToOrgRequest, ApiKeyCreateException, ApiKeyDeleteException, ApiKeyFetchException, ApiKeyFull, ApiKeyNew, ApiKeyResultPage, ApiKeyUpdateException, ApiKeyUpdateRequest, ApiKeyValidateException, ApiKeyValidation, ApiKeysCreateRequest, ApiKeysQueryRequest, ChangeUserRoleInOrgException, CreateAccessTokenRequest, CreateMagicLinkRequest, CreateOrgException, CreateOrgRequest, CreateUserException, CreateUserRequest, ForbiddenException, MagicLink, MagicLinkCreationException, MigrateUserException, MigrateUserFromExternalSourceRequest, OrgApiKeyValidation, OrgQuery, OrgQueryResponse, PersonalApiKeyValidation, RemoveUserFromOrgException, RemoveUserFromOrgRequest, TokenVerificationMetadata, UnexpectedException, UpdateOrgException, UpdateOrgRequest, UpdateUserEmailException, UpdateUserEmailRequest, UpdateUserMetadataException, UpdateUserMetadataRequest, UpdateUserPasswordException, UpdateUserPasswordRequest, UserNotFoundException, UsersInOrgQuery, UsersPagedResponse, UsersQuery } from '@propelauth/node-apis'; | ||
declare enum SocialLoginProvider { | ||
Google = "Google", | ||
GitHub = "GitHub", | ||
Microsoft = "Microsoft", | ||
Slack = "Slack", | ||
LinkedIn = "LinkedIn", | ||
Salesforce = "Salesforce", | ||
Xero = "Xero", | ||
QuickBooksOnline = "QuickBooks Online" | ||
} | ||
declare enum SamlLoginProvider { | ||
Google = "Google", | ||
Rippling = "Rippling", | ||
OneLogin = "OneLogin", | ||
JumpCloud = "JumpCloud", | ||
Okta = "Okta", | ||
Azure = "Azure", | ||
Duo = "Duo", | ||
Generic = "Generic" | ||
} | ||
type PasswordLoginMethod = { | ||
loginMethod: 'password'; | ||
}; | ||
type MagicLinkLoginMethod = { | ||
loginMethod: 'magic_link'; | ||
}; | ||
type SocialSsoLoginMethod = { | ||
loginMethod: 'social_sso'; | ||
provider: SocialLoginProvider; | ||
}; | ||
type EmailConfirmationLinkLoginMethod = { | ||
loginMethod: 'email_confirmation_link'; | ||
}; | ||
type SamlSsoLoginMethod = { | ||
loginMethod: 'saml_sso'; | ||
provider: SamlLoginProvider; | ||
orgId: string; | ||
}; | ||
type ImpersonationLoginMethod = { | ||
loginMethod: 'impersonation'; | ||
}; | ||
type GeneratedFromBackendApiLoginMethod = { | ||
loginMethod: 'generated_from_backend_api'; | ||
}; | ||
type UnknownLoginMethod = { | ||
loginMethod: 'unknown'; | ||
}; | ||
type LoginMethod = PasswordLoginMethod | MagicLinkLoginMethod | SocialSsoLoginMethod | EmailConfirmationLinkLoginMethod | SamlSsoLoginMethod | ImpersonationLoginMethod | GeneratedFromBackendApiLoginMethod | UnknownLoginMethod; | ||
declare class UserFromToken { | ||
@@ -14,2 +63,3 @@ userId: string; | ||
}; | ||
loginMethod?: LoginMethod; | ||
legacyUserId?: string; | ||
@@ -19,3 +69,3 @@ impersonatorUserId?: string; | ||
[key: string]: unknown; | ||
}); | ||
}, loginMethod?: LoginMethod); | ||
getOrg(orgId: string): OrgMemberInfo | undefined; | ||
@@ -22,0 +72,0 @@ getOrgByName(orgName: string): OrgMemberInfo | undefined; |
@@ -63,5 +63,30 @@ "use strict"; | ||
// src/loginMethod.ts | ||
function toLoginMethod(snake_case) { | ||
if (!snake_case) { | ||
return { loginMethod: "unknown" }; | ||
} | ||
switch (snake_case.login_method) { | ||
case "password": | ||
return { loginMethod: "password" }; | ||
case "magic_link": | ||
return { loginMethod: "magic_link" }; | ||
case "social_sso": | ||
return { loginMethod: "social_sso", provider: snake_case.provider }; | ||
case "email_confirmation_link": | ||
return { loginMethod: "email_confirmation_link" }; | ||
case "saml_sso": | ||
return { loginMethod: "saml_sso", provider: snake_case.provider, orgId: snake_case.org_id }; | ||
case "impersonation": | ||
return { loginMethod: "impersonation" }; | ||
case "generated_from_backend_api": | ||
return { loginMethod: "generated_from_backend_api" }; | ||
default: | ||
return { loginMethod: "unknown" }; | ||
} | ||
} | ||
// src/user.ts | ||
var UserFromToken = class { | ||
constructor(userId, email, orgIdToOrgMemberInfo, firstName, lastName, username, legacyUserId, impersonatorUserId, properties) { | ||
constructor(userId, email, orgIdToOrgMemberInfo, firstName, lastName, username, legacyUserId, impersonatorUserId, properties, loginMethod) { | ||
this.userId = userId; | ||
@@ -76,2 +101,3 @@ this.orgIdToOrgMemberInfo = orgIdToOrgMemberInfo; | ||
this.properties = properties; | ||
this.loginMethod = loginMethod; | ||
} | ||
@@ -110,5 +136,3 @@ getOrg(orgId) { | ||
for (const orgId in obj.orgIdToOrgMemberInfo) { | ||
orgIdToOrgMemberInfo[orgId] = OrgMemberInfo.fromJSON( | ||
JSON.stringify(obj.orgIdToOrgMemberInfo[orgId]) | ||
); | ||
orgIdToOrgMemberInfo[orgId] = OrgMemberInfo.fromJSON(JSON.stringify(obj.orgIdToOrgMemberInfo[orgId])); | ||
} | ||
@@ -124,3 +148,4 @@ return new UserFromToken( | ||
obj.impersonatorUserId, | ||
obj.properties | ||
obj.properties, | ||
obj.loginMethod | ||
); | ||
@@ -185,3 +210,4 @@ } | ||
snake_case.impersonatorUserId, | ||
snake_case.properties | ||
snake_case.properties, | ||
toLoginMethod(snake_case.login_method) | ||
); | ||
@@ -188,0 +214,0 @@ } |
import { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from 'next'; | ||
declare enum SocialLoginProvider { | ||
Google = "Google", | ||
GitHub = "GitHub", | ||
Microsoft = "Microsoft", | ||
Slack = "Slack", | ||
LinkedIn = "LinkedIn", | ||
Salesforce = "Salesforce", | ||
Xero = "Xero", | ||
QuickBooksOnline = "QuickBooks Online" | ||
} | ||
declare enum SamlLoginProvider { | ||
Google = "Google", | ||
Rippling = "Rippling", | ||
OneLogin = "OneLogin", | ||
JumpCloud = "JumpCloud", | ||
Okta = "Okta", | ||
Azure = "Azure", | ||
Duo = "Duo", | ||
Generic = "Generic" | ||
} | ||
type PasswordLoginMethod = { | ||
loginMethod: 'password'; | ||
}; | ||
type MagicLinkLoginMethod = { | ||
loginMethod: 'magic_link'; | ||
}; | ||
type SocialSsoLoginMethod = { | ||
loginMethod: 'social_sso'; | ||
provider: SocialLoginProvider; | ||
}; | ||
type EmailConfirmationLinkLoginMethod = { | ||
loginMethod: 'email_confirmation_link'; | ||
}; | ||
type SamlSsoLoginMethod = { | ||
loginMethod: 'saml_sso'; | ||
provider: SamlLoginProvider; | ||
orgId: string; | ||
}; | ||
type ImpersonationLoginMethod = { | ||
loginMethod: 'impersonation'; | ||
}; | ||
type GeneratedFromBackendApiLoginMethod = { | ||
loginMethod: 'generated_from_backend_api'; | ||
}; | ||
type UnknownLoginMethod = { | ||
loginMethod: 'unknown'; | ||
}; | ||
type LoginMethod = PasswordLoginMethod | MagicLinkLoginMethod | SocialSsoLoginMethod | EmailConfirmationLinkLoginMethod | SamlSsoLoginMethod | ImpersonationLoginMethod | GeneratedFromBackendApiLoginMethod | UnknownLoginMethod; | ||
declare class UserFromToken { | ||
@@ -13,2 +62,3 @@ userId: string; | ||
}; | ||
loginMethod?: LoginMethod; | ||
legacyUserId?: string; | ||
@@ -18,3 +68,3 @@ impersonatorUserId?: string; | ||
[key: string]: unknown; | ||
}); | ||
}, loginMethod?: LoginMethod); | ||
getOrg(orgId: string): OrgMemberInfo | undefined; | ||
@@ -21,0 +71,0 @@ getOrgByName(orgName: string): OrgMemberInfo | undefined; |
@@ -58,5 +58,30 @@ "use strict"; | ||
// src/loginMethod.ts | ||
function toLoginMethod(snake_case) { | ||
if (!snake_case) { | ||
return { loginMethod: "unknown" }; | ||
} | ||
switch (snake_case.login_method) { | ||
case "password": | ||
return { loginMethod: "password" }; | ||
case "magic_link": | ||
return { loginMethod: "magic_link" }; | ||
case "social_sso": | ||
return { loginMethod: "social_sso", provider: snake_case.provider }; | ||
case "email_confirmation_link": | ||
return { loginMethod: "email_confirmation_link" }; | ||
case "saml_sso": | ||
return { loginMethod: "saml_sso", provider: snake_case.provider, orgId: snake_case.org_id }; | ||
case "impersonation": | ||
return { loginMethod: "impersonation" }; | ||
case "generated_from_backend_api": | ||
return { loginMethod: "generated_from_backend_api" }; | ||
default: | ||
return { loginMethod: "unknown" }; | ||
} | ||
} | ||
// src/user.ts | ||
var UserFromToken = class { | ||
constructor(userId, email, orgIdToOrgMemberInfo, firstName, lastName, username, legacyUserId, impersonatorUserId, properties) { | ||
constructor(userId, email, orgIdToOrgMemberInfo, firstName, lastName, username, legacyUserId, impersonatorUserId, properties, loginMethod) { | ||
this.userId = userId; | ||
@@ -71,2 +96,3 @@ this.orgIdToOrgMemberInfo = orgIdToOrgMemberInfo; | ||
this.properties = properties; | ||
this.loginMethod = loginMethod; | ||
} | ||
@@ -105,5 +131,3 @@ getOrg(orgId) { | ||
for (const orgId in obj.orgIdToOrgMemberInfo) { | ||
orgIdToOrgMemberInfo[orgId] = OrgMemberInfo.fromJSON( | ||
JSON.stringify(obj.orgIdToOrgMemberInfo[orgId]) | ||
); | ||
orgIdToOrgMemberInfo[orgId] = OrgMemberInfo.fromJSON(JSON.stringify(obj.orgIdToOrgMemberInfo[orgId])); | ||
} | ||
@@ -119,3 +143,4 @@ return new UserFromToken( | ||
obj.impersonatorUserId, | ||
obj.properties | ||
obj.properties, | ||
obj.loginMethod | ||
); | ||
@@ -180,3 +205,4 @@ } | ||
snake_case.impersonatorUserId, | ||
snake_case.properties | ||
snake_case.properties, | ||
toLoginMethod(snake_case.login_method) | ||
); | ||
@@ -183,0 +209,0 @@ } |
{ | ||
"name": "@propelauth/nextjs", | ||
"version": "0.0.115", | ||
"version": "0.0.118", | ||
"exports": { | ||
@@ -5,0 +5,0 @@ "./server": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
460009
4924