@adminide-stack/account-api-server
Advanced tools
Comparing version 0.0.16-86 to 0.0.16-87
@@ -488,2 +488,3 @@ module.exports = | ||
const account_1 = __webpack_require__(/*! @adminide-stack/account */ "@adminide-stack/account"); | ||
const _ = __webpack_require__(/*! lodash */ "lodash"); | ||
const constants_1 = __webpack_require__(/*! ../constants */ "./src/constants/index.ts"); | ||
@@ -496,3 +497,4 @@ let OrganizationService = OrganizationService_1 = class OrganizationService { | ||
createDefaultOrganization(user) { | ||
const username = user.username || user.nickname || user.name; | ||
const rawUsername = user.username || user.nickname || user.name; | ||
const username = _.kebabCase(rawUsername); | ||
const userId = user.user_id || user.sub; | ||
@@ -499,0 +501,0 @@ const request = { |
{ | ||
"name": "@adminide-stack/account-api-server", | ||
"version": "0.0.16-86", | ||
"version": "0.0.16-87", | ||
"description": "Sample core for higher packages to depend on", | ||
@@ -53,3 +53,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@adminide-stack/account": "^0.0.16-86" | ||
"@adminide-stack/account": "^0.0.16-87" | ||
}, | ||
@@ -56,0 +56,0 @@ "peerDependencies": { |
@@ -8,3 +8,3 @@ | ||
} from '@adminide-stack/account'; | ||
import * as _ from 'lodash'; | ||
import { TYPES } from '../constants'; | ||
@@ -28,5 +28,14 @@ import { IOrganizationService, IOrganizationRepository } from '../interfaces'; | ||
/** | ||
* Organization name should be match '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*' | ||
* DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', | ||
* and must start and end with an alphanumeric character | ||
* @param user | ||
*/ | ||
public createDefaultOrganization(user): Promise<IOrganization> { | ||
const username = user.username || user.nickname || user.name; | ||
const rawUsername = user.username || user.nickname || user.name; | ||
const username = _.kebabCase(rawUsername); | ||
const userId = user.user_id || user.sub; | ||
const request: IOrganizationCreateRequest = { | ||
@@ -33,0 +42,0 @@ name: username, |
Sorry, the diff of this file is not supported yet
180533
2514