@supernova-studio/model 0.16.0 → 0.18.0

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.
@@ -0,0 +1,636 @@
1
+ import slugifyImplementation from "@sindresorhus/slugify";
2
+
3
+ export function slugify(str: string, options?: slugifyImplementation.Options): string {
4
+ const slug = slugifyImplementation(str ?? "", options);
5
+ return slug?.length > 0 ? slug : "item";
6
+ }
7
+
8
+ export const RESERVED_SLUGS = [
9
+ "workspaces",
10
+ "workspace",
11
+ "api0",
12
+ "api1",
13
+ "api2",
14
+ "custom",
15
+ "x-sn-reserved",
16
+ // further elements copied from https://github.com/shouldbee/reserved-usernames/blob/master/reserved-usernames.json
17
+
18
+ "0",
19
+ "about",
20
+ "access",
21
+ "account",
22
+ "accounts",
23
+ "activate",
24
+ "activities",
25
+ "activity",
26
+ "ad",
27
+ "add",
28
+ "address",
29
+ "adm",
30
+ "admin",
31
+ "administration",
32
+ "administrator",
33
+ "ads",
34
+ "adult",
35
+ "advertising",
36
+ "affiliate",
37
+ "affiliates",
38
+ "ajax",
39
+ "all",
40
+ "alpha",
41
+ "analysis",
42
+ "analytics",
43
+ "android",
44
+ "anon",
45
+ "anonymous",
46
+ "api",
47
+ "app",
48
+ "apps",
49
+ "archive",
50
+ "archives",
51
+ "article",
52
+ "asct",
53
+ "asset",
54
+ "assets",
55
+ "atom",
56
+ "auth",
57
+ "authentication",
58
+ "avatar",
59
+ "backup",
60
+ "balancer-manager",
61
+ "banner",
62
+ "banners",
63
+ "beta",
64
+ "billing",
65
+ "bin",
66
+ "blog",
67
+ "blogs",
68
+ "board",
69
+ "book",
70
+ "bookmark",
71
+ "bot",
72
+ "bots",
73
+ "bug",
74
+ "business",
75
+ "cache",
76
+ "cadastro",
77
+ "calendar",
78
+ "call",
79
+ "campaign",
80
+ "cancel",
81
+ "captcha",
82
+ "career",
83
+ "careers",
84
+ "cart",
85
+ "categories",
86
+ "category",
87
+ "cgi",
88
+ "cgi-bin",
89
+ "changelog",
90
+ "chat",
91
+ "check",
92
+ "checking",
93
+ "checkout",
94
+ "client",
95
+ "cliente",
96
+ "clients",
97
+ "code",
98
+ "codereview",
99
+ "comercial",
100
+ "comment",
101
+ "comments",
102
+ "communities",
103
+ "community",
104
+ "company",
105
+ "compare",
106
+ "compras",
107
+ "config",
108
+ "configuration",
109
+ "connect",
110
+ "contact",
111
+ "contact-us",
112
+ "contact_us",
113
+ "contactus",
114
+ "contest",
115
+ "contribute",
116
+ "corp",
117
+ "create",
118
+ "css",
119
+ "dashboard",
120
+ "data",
121
+ "db",
122
+ "default",
123
+ "delete",
124
+ "demo",
125
+ "design",
126
+ "designer",
127
+ "destroy",
128
+ "dev",
129
+ "devel",
130
+ "developer",
131
+ "developers",
132
+ "diagram",
133
+ "diary",
134
+ "dict",
135
+ "dictionary",
136
+ "die",
137
+ "dir",
138
+ "direct_messages",
139
+ "directory",
140
+ "dist",
141
+ "doc",
142
+ "docs",
143
+ "documentation",
144
+ "domain",
145
+ "download",
146
+ "downloads",
147
+ "ecommerce",
148
+ "edit",
149
+ "editor",
150
+ "edu",
151
+ "education",
152
+ "email",
153
+ "employment",
154
+ "empty",
155
+ "end",
156
+ "enterprise",
157
+ "entries",
158
+ "entry",
159
+ "error",
160
+ "errors",
161
+ "eval",
162
+ "event",
163
+ "exit",
164
+ "explore",
165
+ "facebook",
166
+ "faq",
167
+ "favorite",
168
+ "favorites",
169
+ "feature",
170
+ "features",
171
+ "feed",
172
+ "feedback",
173
+ "feeds",
174
+ "file",
175
+ "files",
176
+ "first",
177
+ "flash",
178
+ "fleet",
179
+ "fleets",
180
+ "flog",
181
+ "follow",
182
+ "followers",
183
+ "following",
184
+ "forgot",
185
+ "form",
186
+ "forum",
187
+ "forums",
188
+ "founder",
189
+ "free",
190
+ "friend",
191
+ "friends",
192
+ "ftp",
193
+ "gadget",
194
+ "gadgets",
195
+ "game",
196
+ "games",
197
+ "get",
198
+ "ghost",
199
+ "gift",
200
+ "gifts",
201
+ "gist",
202
+ "github",
203
+ "graph",
204
+ "group",
205
+ "groups",
206
+ "guest",
207
+ "guests",
208
+ "help",
209
+ "home",
210
+ "homepage",
211
+ "host",
212
+ "hosting",
213
+ "hostmaster",
214
+ "hostname",
215
+ "howto",
216
+ "hpg",
217
+ "html",
218
+ "http",
219
+ "httpd",
220
+ "https",
221
+ "i",
222
+ "iamges",
223
+ "icon",
224
+ "icons",
225
+ "id",
226
+ "idea",
227
+ "ideas",
228
+ "image",
229
+ "images",
230
+ "imap",
231
+ "img",
232
+ "index",
233
+ "indice",
234
+ "info",
235
+ "information",
236
+ "inquiry",
237
+ "instagram",
238
+ "intranet",
239
+ "invitations",
240
+ "invite",
241
+ "ipad",
242
+ "iphone",
243
+ "irc",
244
+ "is",
245
+ "issue",
246
+ "issues",
247
+ "it",
248
+ "item",
249
+ "items",
250
+ "java",
251
+ "javascript",
252
+ "job",
253
+ "jobs",
254
+ "join",
255
+ "js",
256
+ "json",
257
+ "jump",
258
+ "knowledgebase",
259
+ "language",
260
+ "languages",
261
+ "last",
262
+ "ldap-status",
263
+ "legal",
264
+ "license",
265
+ "link",
266
+ "links",
267
+ "linux",
268
+ "list",
269
+ "lists",
270
+ "log",
271
+ "log-in",
272
+ "log-out",
273
+ "log_in",
274
+ "log_out",
275
+ "login",
276
+ "logout",
277
+ "logs",
278
+ "m",
279
+ "mac",
280
+ "mail",
281
+ "mail1",
282
+ "mail2",
283
+ "mail3",
284
+ "mail4",
285
+ "mail5",
286
+ "mailer",
287
+ "mailing",
288
+ "maintenance",
289
+ "manager",
290
+ "manual",
291
+ "map",
292
+ "maps",
293
+ "marketing",
294
+ "master",
295
+ "me",
296
+ "media",
297
+ "member",
298
+ "members",
299
+ "message",
300
+ "messages",
301
+ "messenger",
302
+ "microblog",
303
+ "microblogs",
304
+ "mine",
305
+ "mis",
306
+ "mob",
307
+ "mobile",
308
+ "movie",
309
+ "movies",
310
+ "mp3",
311
+ "msg",
312
+ "msn",
313
+ "music",
314
+ "musicas",
315
+ "mx",
316
+ "my",
317
+ "mysql",
318
+ "name",
319
+ "named",
320
+ "nan",
321
+ "navi",
322
+ "navigation",
323
+ "net",
324
+ "network",
325
+ "new",
326
+ "news",
327
+ "newsletter",
328
+ "nick",
329
+ "nickname",
330
+ "notes",
331
+ "noticias",
332
+ "notification",
333
+ "notifications",
334
+ "notify",
335
+ "ns",
336
+ "ns1",
337
+ "ns10",
338
+ "ns2",
339
+ "ns3",
340
+ "ns4",
341
+ "ns5",
342
+ "ns6",
343
+ "ns7",
344
+ "ns8",
345
+ "ns9",
346
+ "null",
347
+ "oauth",
348
+ "oauth_clients",
349
+ "offer",
350
+ "offers",
351
+ "official",
352
+ "old",
353
+ "online",
354
+ "openid",
355
+ "operator",
356
+ "order",
357
+ "orders",
358
+ "organization",
359
+ "organizations",
360
+ "overview",
361
+ "owner",
362
+ "owners",
363
+ "page",
364
+ "pager",
365
+ "pages",
366
+ "panel",
367
+ "password",
368
+ "payment",
369
+ "perl",
370
+ "phone",
371
+ "photo",
372
+ "photoalbum",
373
+ "photos",
374
+ "php",
375
+ "phpmyadmin",
376
+ "phppgadmin",
377
+ "phpredisadmin",
378
+ "pic",
379
+ "pics",
380
+ "ping",
381
+ "plan",
382
+ "plans",
383
+ "plugin",
384
+ "plugins",
385
+ "policy",
386
+ "pop",
387
+ "pop3",
388
+ "popular",
389
+ "portal",
390
+ "post",
391
+ "postfix",
392
+ "postmaster",
393
+ "posts",
394
+ "pr",
395
+ "premium",
396
+ "press",
397
+ "price",
398
+ "pricing",
399
+ "privacy",
400
+ "privacy-policy",
401
+ "privacy_policy",
402
+ "privacypolicy",
403
+ "private",
404
+ "product",
405
+ "products",
406
+ "profile",
407
+ "project",
408
+ "projects",
409
+ "promo",
410
+ "pub",
411
+ "public",
412
+ "purpose",
413
+ "put",
414
+ "python",
415
+ "query",
416
+ "random",
417
+ "ranking",
418
+ "read",
419
+ "readme",
420
+ "recent",
421
+ "recruit",
422
+ "recruitment",
423
+ "register",
424
+ "registration",
425
+ "release",
426
+ "remove",
427
+ "replies",
428
+ "report",
429
+ "reports",
430
+ "repositories",
431
+ "repository",
432
+ "req",
433
+ "request",
434
+ "requests",
435
+ "reset",
436
+ "roc",
437
+ "root",
438
+ "rss",
439
+ "ruby",
440
+ "rule",
441
+ "sag",
442
+ "sale",
443
+ "sales",
444
+ "sample",
445
+ "samples",
446
+ "save",
447
+ "school",
448
+ "script",
449
+ "scripts",
450
+ "search",
451
+ "secure",
452
+ "security",
453
+ "self",
454
+ "send",
455
+ "server",
456
+ "server-info",
457
+ "server-status",
458
+ "service",
459
+ "services",
460
+ "session",
461
+ "sessions",
462
+ "setting",
463
+ "settings",
464
+ "setup",
465
+ "share",
466
+ "shop",
467
+ "show",
468
+ "sign-in",
469
+ "sign-up",
470
+ "sign_in",
471
+ "sign_up",
472
+ "signin",
473
+ "signout",
474
+ "signup",
475
+ "site",
476
+ "sitemap",
477
+ "sites",
478
+ "smartphone",
479
+ "smtp",
480
+ "soporte",
481
+ "source",
482
+ "spec",
483
+ "special",
484
+ "sql",
485
+ "src",
486
+ "ssh",
487
+ "ssl",
488
+ "ssladmin",
489
+ "ssladministrator",
490
+ "sslwebmaster",
491
+ "staff",
492
+ "stage",
493
+ "staging",
494
+ "start",
495
+ "stat",
496
+ "state",
497
+ "static",
498
+ "stats",
499
+ "status",
500
+ "store",
501
+ "stores",
502
+ "stories",
503
+ "style",
504
+ "styleguide",
505
+ "stylesheet",
506
+ "stylesheets",
507
+ "subdomain",
508
+ "subscribe",
509
+ "subscriptions",
510
+ "suporte",
511
+ "support",
512
+ "svn",
513
+ "swf",
514
+ "sys",
515
+ "sysadmin",
516
+ "sysadministrator",
517
+ "system",
518
+ "tablet",
519
+ "tablets",
520
+ "tag",
521
+ "talk",
522
+ "task",
523
+ "tasks",
524
+ "team",
525
+ "teams",
526
+ "tech",
527
+ "telnet",
528
+ "term",
529
+ "terms",
530
+ "terms-of-service",
531
+ "terms_of_service",
532
+ "termsofservice",
533
+ "test",
534
+ "test1",
535
+ "test2",
536
+ "test3",
537
+ "teste",
538
+ "testing",
539
+ "tests",
540
+ "theme",
541
+ "themes",
542
+ "thread",
543
+ "threads",
544
+ "tmp",
545
+ "todo",
546
+ "tool",
547
+ "tools",
548
+ "top",
549
+ "topic",
550
+ "topics",
551
+ "tos",
552
+ "tour",
553
+ "translations",
554
+ "trends",
555
+ "tutorial",
556
+ "tux",
557
+ "tv",
558
+ "twitter",
559
+ "undef",
560
+ "unfollow",
561
+ "unsubscribe",
562
+ "update",
563
+ "upload",
564
+ "uploads",
565
+ "url",
566
+ "usage",
567
+ "user",
568
+ "username",
569
+ "users",
570
+ "usuario",
571
+ "vendas",
572
+ "ver",
573
+ "version",
574
+ "video",
575
+ "videos",
576
+ "visitor",
577
+ "watch",
578
+ "weather",
579
+ "web",
580
+ "webhook",
581
+ "webhooks",
582
+ "webmail",
583
+ "webmaster",
584
+ "website",
585
+ "websites",
586
+ "welcome",
587
+ "widget",
588
+ "widgets",
589
+ "wiki",
590
+ "win",
591
+ "windows",
592
+ "word",
593
+ "work",
594
+ "works",
595
+ "workshop",
596
+ "ww",
597
+ "wws",
598
+ "www",
599
+ "www1",
600
+ "www2",
601
+ "www3",
602
+ "www4",
603
+ "www5",
604
+ "www6",
605
+ "www7",
606
+ "wwws",
607
+ "wwww",
608
+ "xfn",
609
+ "xml",
610
+ "xmpp",
611
+ "xpg",
612
+ "xxx",
613
+ "yaml",
614
+ "year",
615
+ "yml",
616
+ "you",
617
+ "yourdomain",
618
+ "yourname",
619
+ "yoursite",
620
+ "yourusername",
621
+ "latest",
622
+ "live",
623
+ "preview",
624
+ "learn",
625
+ "supernova",
626
+ "super-nova",
627
+ ];
628
+
629
+ const RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);
630
+
631
+ export const RESERVED_SLUG_PREFIX = "x-sn-reserved-";
632
+
633
+ const isSlugReservedInternal = (slug: string) => slug?.startsWith(RESERVED_SLUG_PREFIX);
634
+ export function isSlugReserved(slug: string) {
635
+ return RESERVED_SLUGS_SET.has(slug) || isSlugReservedInternal(slug);
636
+ }
@@ -1 +0,0 @@
1
- export type OmitStrict<T, K extends keyof T> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;