feat(server): simple unique random default stream names

This commit is contained in:
Dimitrie Stefanescu
2021-09-13 17:39:24 +01:00
parent d0a95591f2
commit dfa5bc6c84
4 changed files with 12 additions and 133 deletions
@@ -8,11 +8,6 @@ const Acl = ( ) => knex( 'stream_acl' )
const debug = require( 'debug' )
const { createBranch } = require( './branches' )
const { uniqueNamesGenerator, adjectives } = require( 'unique-names-generator' )
const architects = require( `${appRoot}/modules/shared/architects` )
const generateStreamName = () =>
`${uniqueNamesGenerator( { dictionaries: [ architects ],style: 'capital' } )}\'s ${uniqueNamesGenerator( { dictionaries: [ adjectives ] } )} stream`
module.exports = {
@@ -175,3 +170,15 @@ module.exports = {
return await query
}
}
const adjectives = [
'Tall', 'Curved', 'Stacked', 'Purple', 'Pink', 'Rectangular', 'Circular', 'Oval', 'Shiny', 'Speckled', 'Blue', 'Stretched', 'Round', 'Spherical', 'Majestic', 'Symmetrical'
]
const nouns = [
'Building', 'House', 'Treehouse', 'Tower', 'Tunnel', 'Bridge', 'Pyramid', 'Structure', 'Edifice', 'Palace', 'Castle', 'Villa'
]
const generateStreamName = () => {
return `${adjectives[Math.floor( Math.random()*adjectives.length )]} ${nouns[Math.floor( Math.random()*nouns.length )]}`
}
@@ -1,122 +0,0 @@
'use strict'
module.exports = [
'Amenhotep, son of Hapu',
'Imhotep',
'Yu Hao',
'Villard de Honnecourt',
'Peter Parler',
'Leon Battista Alberti',
'Donato Bramante',
'Filippo Brunelleschi',
'Michelozzo Michelozzi',
'Bernardo Rossellino',
'Leonardo da Vinci',
'Vincenzo Scamozzi',
'Sebastiano Serlio',
'Lambert Sustris',
'Pellegrino Tibaldi',
'Giorgio Vasari',
'Gian Lorenzo Bernini',
'Francesco Borromini',
'Ustad Ahmad Lahauri',
'Jacob van Campen',
'Johann Dientzenhofer',
'Tumas Dingli',
'Léopold Durand',
'Pietro Paolo Floriani',
'François Mansart',
'Andreas Schlüter',
'Robert Adam',
'John Carr of York',
'William Kent',
'Jacques-Germain Soufflot',
'Manuel Caetano de Sousa',
'William Thornton',
'James Fowler (architect)|James Fowler',
'Thomas Fuller (architect)|Thomas Fuller',
'Friedrich von Gärtner',
'Edward William Godwin',
'Philip Charles Hardwick',
'Victor Horta',
'William LeBaron Jenney',
'Leo von Klenze',
'Henri Labrouste',
'Alexander Wadsworth Longfellow, Jr.',
'Auguste de Montferrand',
'John Nash (architect)|John Nash',
'Joseph Maria Olbrich',
'Joseph Paxton',
'Francis Penrose',
'Francis Petre',
'Augustus Pugin',
'Karl Friedrich Schinkel',
'Gottfried Semper',
'J. J. Stevenson',
'Louis Sullivan',
'Thomas Telford',
'Eugène Viollet-le-Duc',
'Otto Wagner',
'John Dodsley Webster',
'Alvar Aalto',
'Max Abramovitz',
'Gunnar Asplund',
'Luis Barragán',
'Peter Behrens',
'Pietro Belluschi',
'Antonio Bilbao La Vieja',
'Marcel Breuer',
'Le Corbusier',
'Charles Eames',
'Buckminster Fuller',
'Antoni Gaudí',
'Walter Gropius',
'Hector Guimard',
'Victor Horta',
'Friedensreich Hundertwasser',
'Arne Jacobsen',
'Philip Johnson',
'Josep Maria Jujol',
'Louis Kahn',
'Károly Kós',
'Kisho Kurokawa',
'Edgar-Johan Kuusik',
'Ricardo Legorreta',
'Jan Letzel',
'Liang Sicheng',
'Adolf Loos',
'Charles Rennie Mackintosh',
'Wayne McAllister',
'Konstantin Melnikov',
'Erich Mendelsohn',
'Paulo Mendes da Rocha',
'Henry Mercer',
'Giovanni Michelucci',
'Ludwig Mies van der Rohe',
'Riccardo Morandi',
'Luigi Moretti',
'Pier Luigi Nervi',
'Ngo Viet Thu',
'Oscar Niemeyer',
'Oscar Nitzchke',
'Frei Otto',
'Mihály Párkányi',
'Arthur Peabody',
'I. M. Pei',
'Stjepan Planić',
'Hans Poelzig',
'William Gray Purcell',
'Steen Eiler Rasmussen',
'Aldo Rossi',
'Eero Saarinen',
'Rogelio Salmona',
'Guðjón Samúelsson',
'Carlo Scarpa',
'Elisabeth Scott',
'Albert Speer',
'Kenzo Tange',
'Jørn Utzon',
'Geoffrey Wooding',
'Frank Lloyd Wright',
]
-5
View File
@@ -12467,11 +12467,6 @@
"unique-slug": "^2.0.0"
}
},
"unique-names-generator": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/unique-names-generator/-/unique-names-generator-4.6.0.tgz",
"integrity": "sha512-m0fke1emBeT96UYn2psPQYwljooDWRTKt9oUZ5vlt88ZFMBGxqwPyLHXwCfkbgdm8jzioCp7oIpo6KdM+fnUlQ=="
},
"unique-slug": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz",
-1
View File
@@ -63,7 +63,6 @@
"sanitize-html": "^2.4.0",
"sharp": "^0.28.3",
"string-pixel-width": "^1.10.0",
"unique-names-generator": "^4.6.0",
"xml-escape": "^1.1.0",
"zxcvbn": "^4.4.2"
},