@stacksjs/types 0.69.3 → 0.70.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.
package/dist/cache.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BentoCache } from 'bentocache';
1
+ import type { GetOptions } from 'bentocache/types';
2
2
 
3
3
  export declare interface CacheOptions {
4
4
  driver: string
@@ -36,8 +36,8 @@ export declare type CacheConfig = Partial<CacheOptions>
36
36
  export interface CacheDriver {
37
37
  set: (key: string, value: string, ttl?: number) => Promise<void>
38
38
  setForever: (key: string, value: string, ttl?: number) => Promise<void>
39
- get: (key: string) => Promise<string | undefined | null>
40
- getOrSet: (key: string, value: string) => Promise<string | undefined | null>
39
+ get: <T> (key: GetOptions<T>) => Promise<T>
40
+ getOrSet: <T> (key: string, value: T) => Promise<T>
41
41
  remove: (key: string) => Promise<void>
42
42
  has: (key: string) => Promise<boolean>
43
43
  missing: (key: string) => Promise<boolean>
@@ -46,5 +46,4 @@ export interface CacheDriver {
46
46
  clear: () => Promise<void>
47
47
  deleteAll: () => Promise<void>
48
48
  disconnect: () => Promise<void>
49
- client: BentoCache<Record<string, any>>
50
49
  }
package/dist/chat.d.ts CHANGED
@@ -1,3 +1,88 @@
1
- export type { ChatOptions }
2
- declare interface ChatOptions {}
3
- export declare type ChatConfig = ChatOptions
1
+ export declare type ChatConfig = ChatOptions
2
+
3
+
4
+ export interface ChatDriverConfig {
5
+ maxRetries?: number
6
+
7
+ retryTimeout?: number
8
+
9
+ [key: string]: any
10
+ }
11
+
12
+ export interface ChatMessage {
13
+ to: string | string[]
14
+
15
+ from?: {
16
+ id?: string
17
+ name?: string
18
+ avatar?: string
19
+ }
20
+
21
+ subject?: string
22
+
23
+ content?: string
24
+
25
+ template?: string
26
+
27
+ data?: Record<string, any>
28
+
29
+ attachments?: ChatAttachment[]
30
+
31
+ onSuccess?: () => void | Promise<void> | Partial<ChatResult>
32
+
33
+ onError?: (error: Error) => void | Promise<void> | Partial<ChatResult>
34
+
35
+ handle?: () => void | Promise<void> | Partial<ChatResult>
36
+
37
+ [key: string]: any
38
+ }
39
+
40
+ export interface ChatAttachment {
41
+ filename: string
42
+
43
+ content: string | Uint8Array
44
+
45
+ contentType: string
46
+
47
+ options?: Record<string, any>
48
+ }
49
+
50
+ export interface ChatResult {
51
+ success: boolean
52
+
53
+ message: string
54
+
55
+ provider: string
56
+
57
+ messageId?: string
58
+
59
+ data?: Record<string, any>
60
+ }
61
+
62
+ export type ChatOptions = Record<string, any>
63
+
64
+ export interface ChatDriver {
65
+ name: string
66
+
67
+ configure: (config: ChatDriverConfig) => void
68
+
69
+ send: (message: ChatMessage, options?: ChatOptions) => Promise<ChatResult>
70
+ }
71
+
72
+ export interface SlackResponse {
73
+ id: string
74
+
75
+ channel?: string
76
+
77
+ ts?: string
78
+
79
+ [key: string]: any
80
+ }
81
+
82
+ export interface RenderOptions {
83
+ data?: Record<string, any>
84
+
85
+ engineOptions?: Record<string, any>
86
+
87
+ [key: string]: any
88
+ }
package/dist/cloud.d.ts CHANGED
@@ -259,7 +259,7 @@ interface SiteConfig {
259
259
  path: string
260
260
  }
261
261
 
262
- type InfrastuctureOptions = Partial<{
262
+ type InfrastructureOptions = Partial<{
263
263
  type: 'serverless'
264
264
  driver: 'aws'
265
265
  api: ApiConfig
@@ -305,7 +305,7 @@ export interface CloudOptions {
305
305
  [site: string]: string | SiteConfig
306
306
  }
307
307
 
308
- infrastructure: InfrastuctureOptions
308
+ infrastructure: InfrastructureOptions
309
309
  }
310
310
 
311
311
  export type CloudConfig = Partial<CloudOptions>
package/dist/email.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { I18n } from 'vue-email';
2
+
1
3
  export declare interface EmailOptions {
2
4
  from: {
3
5
  name: string
@@ -7,10 +9,99 @@ export declare interface EmailOptions {
7
9
  mailboxes: string[]
8
10
 
9
11
  url: string
10
- charset: string
12
+ charset: string
11
13
 
12
14
  server: {
13
15
  scan?: boolean
14
16
  }
17
+
18
+ default: 'ses' | 'sendgrid' | 'mailgun' | 'mailtrap'
19
+ }
20
+ export declare type EmailConfig = Partial<EmailOptions>
21
+
22
+ export interface MailtrapConfig extends EmailDriverConfig {
23
+ token: string
24
+ inboxId?: number
25
+ }
26
+ export interface EmailResult {
27
+ message: string
28
+ success: boolean
29
+ provider: string
30
+ messageId?: string
31
+ [key: string]: any
32
+ }
33
+
34
+ export interface EmailDriverConfig {
35
+ maxRetries?: number
36
+ retryTimeout?: number
37
+ [key: string]: any
38
+ }
39
+
40
+ export interface EmailDriver {
41
+ name: string
42
+
43
+ send: (message: EmailMessage, options?: RenderOptions) => Promise<EmailResult>
44
+
45
+ configure: (config: EmailDriverConfig) => void
46
+ }
47
+
48
+ export interface EmailMessage {
49
+ from: EmailAddress
50
+ to: string | string[] | EmailAddress[]
51
+ cc?: string | string[] | EmailAddress[]
52
+ bcc?: string | string[] | EmailAddress[]
53
+ subject: string
54
+ template?: string
55
+ text?: string
56
+ attachments?: EmailAttachment[]
57
+ onSuccess?: () => Promise<{ message: string }> | { message: string }
58
+ onError?: (error: Error) => Promise<{ message: string }> | { message: string }
59
+ handle?: () => Promise<{ message: string }> | { message: string }
60
+ }
61
+
62
+ export interface EmailAddress {
63
+ address: string
64
+ name?: string
65
+ }
66
+
67
+ export interface EmailAttachment {
68
+ filename: string
69
+ content: string | Uint8Array
70
+ contentType?: string
71
+ encoding?: 'base64' | 'binary' | 'hex' | 'utf8'
72
+ }
73
+
74
+ export interface SESConfig extends EmailDriverConfig {
75
+ region: string
76
+ credentials?: {
77
+ accessKeyId: string
78
+ secretAccessKey: string
79
+ }
80
+ }
81
+
82
+ export interface SendGridConfig extends EmailDriverConfig {
83
+ apiKey: string
15
84
  }
16
- export declare type EmailConfig = Partial<EmailOptions>
85
+
86
+ export interface RenderOptions {
87
+ props?: Record<string, unknown>
88
+ i18n?: I18n
89
+ }
90
+
91
+ export interface MailtrapSuccessResponse {
92
+ success: boolean
93
+ message_ids: string[]
94
+ errors?: never
95
+ }
96
+
97
+ export interface MailtrapErrorResponse {
98
+ success: false
99
+ errors: {
100
+ email?: string[]
101
+ message?: string[]
102
+ [key: string]: string[] | undefined
103
+ }
104
+ message_ids?: never
105
+ }
106
+
107
+ export type MailtrapResponse = MailtrapSuccessResponse | MailtrapErrorResponse
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- var x;((a)=>{a.Second="* * * * * *";a.FiveSeconds="*/5 * * * * *";a.TenSeconds="*/10 * * * * *";a.ThirtySeconds="*/30 * * * * *";a.Minute="* * * * *";a.TwoMinutes="*/2 * * * *";a.FiveMinutes="*/5 * * * *";a.TenMinutes="*/10 * * * *";a.FifteenMinutes="*/15 * * * *";a.ThirtyMinutes="*/30 * * * *";a.Hour="0 * * * *";a.HalfHour="0,30 * * * *";a.Day="0 0 * * *";a.Week="0 0 * * 0";a.Weekday="0 0 * * 1-5";a.Weekend="0 0 * * 0,6";a.Month="0 0 1 * *";a.Year="0 0 1 1 *"})(x||={});var $;((o)=>{o.Bluesky="bluesky";o.Discord="discord";o.Facebook="facebook";o.GitHub="github";o.Instagram="instagram";o.LinkedIn="linkedin";o.Mastodon="mastodon";o.Slack="slack";o.Twitter="twitter";o.YouTube="youtube"})($||={});var O;((t)=>{t[t.Success=0]="Success";t[t.FatalError=1]="FatalError";t[t.InvalidArgument=9]="InvalidArgument"})(O||={});var v=new Set([".","!","?"]),H=new Set([...v,":",'"',"'","\u201D"]);function p(e){return Object.prototype.toString.call(e)}var u=[],c=[],b={},g={},m={};function f(e){return typeof e==="string"?new RegExp(`^${e}$`,"i"):e}function l(e,r){if(e===r)return r;if(e===e.toLowerCase())return r.toLowerCase();if(e===e.toUpperCase())return r.toUpperCase();if(e[0]===e[0].toUpperCase())return r.charAt(0).toUpperCase()+r.slice(1).toLowerCase();return r.toLowerCase()}function C(e,...r){return e.replace(/\$(\d{1,2})/g,(s,t)=>r[Number(t)]||"")}function j(e,r){return e.replace(r[0],(...s)=>{let t=C(r[1],...s);if(s[0]==="")return l(e[s[s.length-2]-1],t);return l(s[0],t)})}function y(e,r,s){if(!e.length||b[e])return r;for(let t=s.length-1;t>=0;t--){let i=s[t];if(i[0].test(r))return j(r,i)}return r}function d(e,r,s){return(t)=>{let i=t.toLowerCase();if(r[i])return l(t,i);if(e[i])return l(t,e[i]);return y(i,t,s)}}function h(e,r,s){return(t)=>{let i=t.toLowerCase();if(r[i])return!0;if(e[i])return!1;return y(i,i,s)===i}}var n=(e,r={})=>{let{count:s=2,inclusive:t=!1}=r;if(typeof e!=="string")throw new TypeError("Word must be a string");let i=s===1?n.singular(e):n.plural(e);return t?`${s} ${i}`:i};n.plural=d(m,g,u);n.isPlural=h(m,g,u);n.singular=d(g,m,c);n.isSingular=h(g,m,c);n.addPluralRule=(e,r)=>{u.push([f(e),r])};n.addSingularRule=(e,r)=>{c.push([f(e),r])};n.addUncountableRule=(e)=>{if(typeof e==="string"){b[e.toLowerCase()]=!0;return}n.addPluralRule(e,"$0"),n.addSingularRule(e,"$0")};n.addIrregularRule=(e,r)=>{let s=r.toLowerCase(),t=e.toLowerCase();m[t]=s,g[s]=t};[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]].forEach(([e,r])=>n.addIrregularRule(e,r));[[/s?$/i,"s"],[/[^\x20-\x7F]$/,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(([e,r])=>n.addPluralRule(e,r));[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|\W|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(([e,r])=>n.addSingularRule(e,r));["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[e\u00E9]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(n.addUncountableRule);var A=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E\'","\u0538":"Y\'","\u0539":"T\'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C\'","\u053F":"K","\u0540":"H","\u0541":"D\'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R\'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P\'","\u0554":"Q\'","\u0555":"O\'\'","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"\'","\u2019":"\'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}'),B=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');function _e(e){if(e===null)return"null";let r=p(e).slice(8,-1).toLowerCase();return typeof e==="object"||typeof e==="function"?r:typeof e}export{_e as getTypeName,$ as SocialLinkIcon,O as ExitCode,x as Every};
2
+ var x;((i)=>{i.Second="* * * * * *";i.FiveSeconds="*/5 * * * * *";i.TenSeconds="*/10 * * * * *";i.ThirtySeconds="*/30 * * * * *";i.Minute="* * * * *";i.TwoMinutes="*/2 * * * *";i.FiveMinutes="*/5 * * * *";i.TenMinutes="*/10 * * * *";i.FifteenMinutes="*/15 * * * *";i.ThirtyMinutes="*/30 * * * *";i.Hour="0 * * * *";i.HalfHour="0,30 * * * *";i.Day="0 0 * * *";i.Week="0 0 * * 0";i.Weekday="0 0 * * 1-5";i.Weekend="0 0 * * 0,6";i.Month="0 0 1 * *";i.Year="0 0 1 1 *"})(x||={});var _;((o)=>{o.Bluesky="bluesky";o.Discord="discord";o.Facebook="facebook";o.GitHub="github";o.Instagram="instagram";o.LinkedIn="linkedin";o.Mastodon="mastodon";o.Slack="slack";o.Twitter="twitter";o.YouTube="youtube"})(_||={});var $;((t)=>{t[t.Success=0]="Success";t[t.FatalError=1]="FatalError";t[t.InvalidArgument=9]="InvalidArgument"})($||={});var v=new Set([".","!","?"]),D=new Set([...v,":",'"',"'","\u201D"]);function d(e){return Object.prototype.toString.call(e)}var l=[],c=[],p={},g={},m={};function b(e){return typeof e==="string"?new RegExp(`^${e}$`,"i"):e}function u(e,r){if(e===r)return r;if(e===e.toLowerCase())return r.toLowerCase();if(e===e.toUpperCase())return r.toUpperCase();if(e[0]===e[0].toUpperCase())return r.charAt(0).toUpperCase()+r.slice(1).toLowerCase();return r.toLowerCase()}function O(e,...r){return e.replace(/\$(\d{1,2})/g,(a,t)=>r[Number(t)]||"")}function k(e,r){return e.replace(r[0],(...a)=>{let t=O(r[1],...a);if(a[0]==="")return u(e[a[a.length-2]-1],t);return u(a[0],t)})}function y(e,r,a){if(!e.length||p[e])return r;for(let t=a.length-1;t>=0;t--){let s=a[t];if(s[0].test(r))return k(r,s)}return r}function f(e,r,a){return(t)=>{let s=t.toLowerCase();if(r[s])return u(t,s);if(e[s])return u(t,e[s]);return y(s,t,a)}}function h(e,r,a){return(t)=>{let s=t.toLowerCase();if(r[s])return!0;if(e[s])return!1;return y(s,s,a)===s}}var n=(e,r={})=>{let{count:a=2,inclusive:t=!1}=r;if(typeof e!=="string")throw new TypeError("Word must be a string");let s=a===1?n.singular(e):n.plural(e);return t?`${a} ${s}`:s};n.plural=f(m,g,l);n.isPlural=h(m,g,l);n.singular=f(g,m,c);n.isSingular=h(g,m,c);n.addPluralRule=(e,r)=>{l.push([b(e),r])};n.addSingularRule=(e,r)=>{c.push([b(e),r])};n.addUncountableRule=(e)=>{if(typeof e==="string"){p[e.toLowerCase()]=!0;return}n.addPluralRule(e,"$0"),n.addSingularRule(e,"$0")};n.addIrregularRule=(e,r)=>{let a=r.toLowerCase(),t=e.toLowerCase();m[t]=a,g[a]=t};[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]].forEach(([e,r])=>n.addIrregularRule(e,r));[[/s?$/i,"s"],[/[^\x20-\x7F]$/,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(([e,r])=>n.addPluralRule(e,r));[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|\W|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(([e,r])=>n.addSingularRule(e,r));["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[e\u00E9]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(n.addUncountableRule);var Q=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E\'","\u0538":"Y\'","\u0539":"T\'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C\'","\u053F":"K","\u0540":"H","\u0541":"D\'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R\'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P\'","\u0554":"Q\'","\u0555":"O\'\'","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"\'","\u2019":"\'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}'),B=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');function ze(e){if(e===null)return"null";let r=d(e).slice(8,-1).toLowerCase();return typeof e==="object"||typeof e==="function"?r:typeof e}export{ze as getTypeName,_ as SocialLinkIcon,$ as ExitCode,x as Every};
@@ -1 +1 @@
1
- export declare type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Activity' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'FailedJob' | 'Product' | 'PaymentMethod' | 'Transaction' | 'Job' | 'Subscription' | 'Error'
1
+ export declare type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'Category' | 'Payment' | 'Manufacturer' | 'OrderItem' | 'Customer' | 'Product' | 'ProductVariant' | 'Review' | 'ProductUnit' | 'GiftCard' | 'Order' | 'Coupon' | 'Transaction' | 'LoyaltyPoint' | 'ProductItem' | 'LoyaltyReward' | 'FailedJob' | 'PaymentMethod' | 'PaymentTransaction' | 'Request' | 'Job' | 'Subscription' | 'PaymentProduct' | 'Error'
package/dist/model.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { DeepPartial, Nullable } from '.';
2
+ import type { Faker } from '@stacksjs/faker';
3
+ import type { ModelNames, TableNames } from '@stacksjs/types';
2
4
  import type { SearchOptions } from './search-engine';
3
- import type { TableNames } from '@stacksjs/types';
4
5
  import type { VineBoolean, VineNumber, VineString } from '@vinejs/vine';
5
6
 
6
7
  export declare type Model = Partial<ModelOptions>
@@ -15,6 +16,20 @@ export interface Relation<T = string> extends BaseRelation {
15
16
  }
16
17
 
17
18
  export interface HasOne<T = string> extends Array<Relation<T>> {}
19
+
20
+ export interface MorphTo {
21
+ name: string
22
+ }
23
+
24
+ export interface MorphOne<T = string> extends BaseRelation {
25
+ model: T
26
+ morphName?: string
27
+ type?: string
28
+ id?: string
29
+ }
30
+
31
+ export interface MorphMany<T = string> extends MorphOne<T> {}
32
+
18
33
  export interface HasMany<T = string> extends Array<Relation<T>> {}
19
34
  export interface BelongsTo<T = string> extends Array<Relation<T>> {}
20
35
 
@@ -45,6 +60,7 @@ export interface ModelElement {
45
60
  field: string
46
61
  default: string | number | boolean | Date | undefined | null
47
62
  unique: boolean
63
+ required: boolean
48
64
  fieldArray: FieldArrayElement | null
49
65
  }
50
66
 
@@ -114,6 +130,7 @@ interface Base {}
114
130
 
115
131
  export interface ModelOptions extends Base {
116
132
  name: string
133
+ description?: string
117
134
  table?: string
118
135
  primaryKey?: string
119
136
  autoIncrement?: boolean
@@ -154,6 +171,12 @@ export interface ModelOptions extends Base {
154
171
 
155
172
  hasOneThrough?: HasOneThrough<ModelNames> | ModelNames[]
156
173
 
174
+ morphOne?: MorphOne<ModelNames> | ModelNames
175
+
176
+ morphMany?: MorphMany<ModelNames>[] | ModelNames[]
177
+
178
+ morphTo?: MorphTo
179
+
157
180
  scopes?: {
158
181
  [key: string]: (value: any) => any
159
182
  }
@@ -175,7 +198,7 @@ export interface Attribute {
175
198
  hidden?: boolean
176
199
  fillable?: boolean
177
200
  guarded?: boolean
178
- factory?: () => any
201
+ factory?: (faker: Faker) => any
179
202
  validation?: {
180
203
  rule: VineType
181
204
  message?: ValidatorMessage
package/dist/request.d.ts CHANGED
@@ -23,7 +23,7 @@ export interface RequestInstance {
23
23
 
24
24
  addParam: (param: RouteParams) => void
25
25
 
26
- get: <T>(element: T) => string | undefined
26
+ get: <T>(element: string, defaultValue?: T) => T
27
27
 
28
28
  header: (element: string) => string | number | boolean | null
29
29
 
package/dist/router.d.ts CHANGED
@@ -23,7 +23,7 @@ export interface MiddlewareOptions {
23
23
  name: string
24
24
  description?: string
25
25
  priority: number
26
- handle: Function
26
+ handle: () => Promise<void>
27
27
  }
28
28
 
29
29
  export type StatusCode = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 500
@@ -4,32 +4,78 @@ export declare interface ServicesOptions {
4
4
  apiKey: string
5
5
  }
6
6
 
7
+ aws?: {
8
+ accountId: string
9
+ appId: string
10
+ apiKey: string
11
+ region: string
12
+ }
13
+
7
14
  godaddy?: {
8
15
  apiKey: string
9
16
  apiSecret: string
10
17
  }
11
18
 
12
- meilisearch?: {
19
+ hetzner: {
13
20
  appId: string
14
21
  apiKey: string
15
22
  }
16
23
 
17
- lemonSqueezy?: {
24
+ digitalOcean: {
18
25
  appId: string
19
26
  apiKey: string
20
27
  }
21
28
 
22
- stripe?: {
29
+
30
+ mailgun?: {
31
+ apiKey?: string
32
+ domain?: string
33
+ endpoint?: string
34
+ maxRetries?: number
35
+ retryTimeout?: number
36
+ }
37
+
38
+ mailtrap?: {
39
+ token: string
40
+ host: string
41
+ inboxId?: string | number
42
+ maxRetries?: number
43
+ retryTimeout?: number
44
+ }
45
+
46
+ meilisearch?: {
23
47
  appId: string
24
48
  apiKey: string
25
49
  }
26
50
 
51
+ sendgrid?: {
52
+ apiKey?: string
53
+ maxRetries?: number
54
+ retryTimeout?: number
55
+ }
27
56
 
28
- aws?: {
29
- accountId: string
57
+ ses?: {
58
+ region: string
59
+ credentials: {
60
+ accessKeyId?: string
61
+ secretAccessKey?: string
62
+ }
63
+ maxRetries?: number
64
+ retryTimeout?: number
65
+ }
66
+
67
+ slack?: {
68
+ appId: string
69
+ clientId: string
70
+ secretKey: string
71
+ maxRetries?: number
72
+ retryTimeout?: number
73
+ }
74
+
75
+ stripe?: {
30
76
  appId: string
31
77
  apiKey: string
32
- region: string
33
78
  }
79
+
34
80
  }
35
81
  export declare type ServicesConfig = Partial<ServicesOptions>
@@ -1 +1 @@
1
- export declare type TableNames = 'projects' | 'subscriber_emails' | 'personal_access_tokens' | 'team_users' | 'teams' | 'activities' | 'subscribers' | 'deployments' | 'releases' | 'team_users' | 'users' | 'posts' | 'failed_jobs' | 'products' | 'payment_methods' | 'transactions' | 'jobs' | 'subscriptions' | 'errors'
1
+ export declare type TableNames = 'projects' | 'subscriber_emails' | 'personal_access_tokens' | 'team_users' | 'teams' | 'subscribers' | 'deployments' | 'releases' | 'team_users' | 'users' | 'posts' | 'categories' | 'payments' | 'manufacturers' | 'order_items' | 'customers' | 'products' | 'product_variants' | 'reviews' | 'product_units' | 'gift_cards' | 'orders' | 'coupons' | 'transactions' | 'loyalty_points' | 'product_items' | 'loyalty_rewards' | 'failed_jobs' | 'payment_methods' | 'payment_transactions' | 'requests' | 'jobs' | 'subscriptions' | 'payment_products' | 'errors'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.69.3",
4
+ "version": "0.70.0",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -48,27 +48,27 @@
48
48
  "@mdit-vue/plugin-frontmatter": "^2.1.3",
49
49
  "@mdit-vue/types": "^2.1.0",
50
50
  "@rollup/pluginutils": "^5.1.4",
51
- "@stacksjs/validation": "0.69.2",
51
+ "@stacksjs/validation": "0.70.0",
52
52
  "@types/aws4": "^1.11.6",
53
- "@types/bun": "^1.2.2",
53
+ "@types/bun": "^1.2.5",
54
54
  "@types/crypto-js": "^4.2.2",
55
55
  "@types/fs-extra": "^11.0.4",
56
56
  "@types/markdown-it-link-attributes": "^3.0.5",
57
57
  "@types/minimatch": "^5.1.2",
58
58
  "@types/nprogress": "^0.2.3",
59
- "@vinejs/vine": "^3.0.0",
60
- "aws-cdk-lib": "^2.179.0",
59
+ "@vinejs/vine": "^3.0.1",
60
+ "aws-cdk-lib": "^2.185.0",
61
61
  "cac": "^6.7.14",
62
62
  "markdown-it": "^14.1.0",
63
63
  "meilisearch": "^0.49.0",
64
- "neverthrow": "^8.1.1",
64
+ "neverthrow": "^8.2.0",
65
65
  "ora": "^8.2.0",
66
- "typescript": "^5.7.3",
66
+ "typescript": "^5.8.2",
67
67
  "unocss": "66.0.0",
68
- "unplugin-auto-import": "^19.1.0",
69
- "unplugin-vue-components": "^28.2.0",
70
- "vite": "^6.1.0",
71
- "vite-plugin-inspect": "^10.2.1",
68
+ "unplugin-auto-import": "^19.1.1",
69
+ "unplugin-vue-components": "^28.4.1",
70
+ "vite": "^6.2.2",
71
+ "vite-plugin-inspect": "^11.0.0",
72
72
  "vite-plugin-pwa": "^0.21.1",
73
73
  "vite-ssg": "^25.2.0",
74
74
  "vitepress": "1.6.3",
package/src/cache.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BentoCache } from 'bentocache'
1
+ import type { GetOptions } from 'bentocache/types'
2
2
 
3
3
  export interface CacheOptions {
4
4
  /**
@@ -108,8 +108,8 @@ export type CacheConfig = Partial<CacheOptions>
108
108
  export interface CacheDriver {
109
109
  set: (key: string, value: string, ttl?: number) => Promise<void>
110
110
  setForever: (key: string, value: string, ttl?: number) => Promise<void>
111
- get: (key: string) => Promise<string | undefined | null>
112
- getOrSet: (key: string, value: string) => Promise<string | undefined | null>
111
+ get: <T> (key: GetOptions<T>) => Promise<T>
112
+ getOrSet: <T> (key: string, value: T) => Promise<T>
113
113
  remove: (key: string) => Promise<void>
114
114
  has: (key: string) => Promise<boolean>
115
115
  missing: (key: string) => Promise<boolean>
@@ -118,5 +118,4 @@ export interface CacheDriver {
118
118
  clear: () => Promise<void>
119
119
  deleteAll: () => Promise<void>
120
120
  disconnect: () => Promise<void>
121
- client: BentoCache<Record<string, any>>
122
121
  }
package/src/chat.ts CHANGED
@@ -1,4 +1,213 @@
1
- interface ChatOptions {}
2
- export type { ChatOptions }
3
-
4
1
  export type ChatConfig = ChatOptions
2
+
3
+ // Chat Message Types
4
+
5
+ /**
6
+ * Configuration options for chat drivers
7
+ */
8
+ export interface ChatDriverConfig {
9
+ /**
10
+ * Maximum number of retry attempts
11
+ */
12
+ maxRetries?: number
13
+
14
+ /**
15
+ * Timeout between retry attempts in milliseconds
16
+ */
17
+ retryTimeout?: number
18
+
19
+ /**
20
+ * Any additional driver-specific configuration
21
+ */
22
+ [key: string]: any
23
+ }
24
+
25
+ /**
26
+ * Base chat message interface
27
+ */
28
+ export interface ChatMessage {
29
+ /**
30
+ * Recipient(s) of the message
31
+ * This could be channel ID, user ID, or other identifier
32
+ */
33
+ to: string | string[]
34
+
35
+ /**
36
+ * Optional sender information
37
+ */
38
+ from?: {
39
+ id?: string
40
+ name?: string
41
+ avatar?: string
42
+ }
43
+
44
+ /**
45
+ * Optional message subject or title
46
+ */
47
+ subject?: string
48
+
49
+ /**
50
+ * Message content in plain text
51
+ */
52
+ content?: string
53
+
54
+ /**
55
+ * Template to be used for rendering the message
56
+ */
57
+ template?: string
58
+
59
+ /**
60
+ * Template data
61
+ */
62
+ data?: Record<string, any>
63
+
64
+ /**
65
+ * Any attachments to include with the message
66
+ */
67
+ attachments?: ChatAttachment[]
68
+
69
+ /**
70
+ * Callback triggered on successful message delivery
71
+ */
72
+ onSuccess?: () => void | Promise<void> | Partial<ChatResult>
73
+
74
+ /**
75
+ * Callback triggered on message delivery failure
76
+ */
77
+ onError?: (error: Error) => void | Promise<void> | Partial<ChatResult>
78
+
79
+ /**
80
+ * General handler for both success and error cases
81
+ */
82
+ handle?: () => void | Promise<void> | Partial<ChatResult>
83
+
84
+ /**
85
+ * Custom fields for platform-specific options
86
+ */
87
+ [key: string]: any
88
+ }
89
+
90
+ /**
91
+ * Structure for message attachments
92
+ */
93
+ export interface ChatAttachment {
94
+ /**
95
+ * Filename of the attachment
96
+ */
97
+ filename: string
98
+
99
+ /**
100
+ * Content of the attachment
101
+ */
102
+ content: string | Uint8Array
103
+
104
+ /**
105
+ * MIME type of the attachment
106
+ */
107
+ contentType: string
108
+
109
+ /**
110
+ * Additional options for the attachment
111
+ */
112
+ options?: Record<string, any>
113
+ }
114
+
115
+ /**
116
+ * Standard result object for chat operations
117
+ */
118
+ export interface ChatResult {
119
+ /**
120
+ * Indicates whether the operation was successful
121
+ */
122
+ success: boolean
123
+
124
+ /**
125
+ * Human-readable message about the result
126
+ */
127
+ message: string
128
+
129
+ /**
130
+ * Name of the provider that handled the message
131
+ */
132
+ provider: string
133
+
134
+ /**
135
+ * Optional message ID returned from the provider
136
+ */
137
+ messageId?: string
138
+
139
+ /**
140
+ * Any additional provider-specific response data
141
+ */
142
+ data?: Record<string, any>
143
+ }
144
+
145
+ /**
146
+ * Chat driver options
147
+ */
148
+ export type ChatOptions = Record<string, any>
149
+
150
+ /**
151
+ * Base chat driver interface
152
+ */
153
+ export interface ChatDriver {
154
+ /**
155
+ * Name of the chat provider
156
+ */
157
+ name: string
158
+
159
+ /**
160
+ * Configure the driver
161
+ */
162
+ configure: (config: ChatDriverConfig) => void
163
+
164
+ /**
165
+ * Send a message
166
+ */
167
+ send: (message: ChatMessage, options?: ChatOptions) => Promise<ChatResult>
168
+ }
169
+
170
+ /**
171
+ * Slack-specific response
172
+ */
173
+ export interface SlackResponse {
174
+ /**
175
+ * ID of the sent message
176
+ */
177
+ id: string
178
+
179
+ /**
180
+ * Channel where the message was sent
181
+ */
182
+ channel?: string
183
+
184
+ /**
185
+ * Timestamp of the message
186
+ */
187
+ ts?: string
188
+
189
+ /**
190
+ * Any additional response data
191
+ */
192
+ [key: string]: any
193
+ }
194
+
195
+ /**
196
+ * Render options for templates
197
+ */
198
+ export interface RenderOptions {
199
+ /**
200
+ * Data to be used for template rendering
201
+ */
202
+ data?: Record<string, any>
203
+
204
+ /**
205
+ * Template engine options
206
+ */
207
+ engineOptions?: Record<string, any>
208
+
209
+ /**
210
+ * Additional rendering options
211
+ */
212
+ [key: string]: any
213
+ }
package/src/cloud.ts CHANGED
@@ -259,7 +259,7 @@ interface SiteConfig {
259
259
  path: string
260
260
  }
261
261
 
262
- type InfrastuctureOptions = Partial<{
262
+ type InfrastructureOptions = Partial<{
263
263
  type: 'serverless' // | 'server' coming soon
264
264
  driver: 'aws'
265
265
  api: ApiConfig
@@ -336,7 +336,7 @@ export interface CloudOptions {
336
336
  [site: string]: string | SiteConfig
337
337
  }
338
338
 
339
- infrastructure: InfrastuctureOptions
339
+ infrastructure: InfrastructureOptions
340
340
  }
341
341
 
342
342
  export type CloudConfig = Partial<CloudOptions>
package/src/email.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { I18n } from 'vue-email'
2
+
1
3
  export interface EmailOptions {
2
4
  from: {
3
5
  name: string
@@ -7,11 +9,119 @@ export interface EmailOptions {
7
9
  mailboxes: string[]
8
10
 
9
11
  url: string
10
- charset: string // e.g. UTF-8
12
+ charset: string
11
13
 
12
14
  server: {
13
15
  scan?: boolean
14
16
  }
17
+
18
+ default: 'ses' | 'sendgrid' | 'mailgun' | 'mailtrap'
15
19
  }
16
20
 
17
21
  export type EmailConfig = Partial<EmailOptions>
22
+
23
+ export interface MailtrapConfig extends EmailDriverConfig {
24
+ token: string
25
+ inboxId?: number
26
+ }
27
+ export interface EmailResult {
28
+ message: string
29
+ success: boolean
30
+ provider: string
31
+ messageId?: string
32
+ [key: string]: any
33
+ }
34
+
35
+ // Base configuration interface
36
+ export interface EmailDriverConfig {
37
+ maxRetries?: number
38
+ retryTimeout?: number
39
+ [key: string]: any
40
+ }
41
+
42
+ // Email driver interface
43
+ export interface EmailDriver {
44
+ /** Driver name */
45
+ name: string
46
+
47
+ /** Send an email */
48
+ send: (message: EmailMessage, options?: RenderOptions) => Promise<EmailResult>
49
+
50
+ /** Configure the driver */
51
+ configure: (config: EmailDriverConfig) => void
52
+ }
53
+
54
+ export interface EmailMessage {
55
+ /** Required sender email address */
56
+ from: EmailAddress
57
+ /** Primary recipient(s) */
58
+ to: string | string[] | EmailAddress[]
59
+ /** Carbon copy recipient(s) */
60
+ cc?: string | string[] | EmailAddress[]
61
+ /** Blind carbon copy recipient(s) */
62
+ bcc?: string | string[] | EmailAddress[]
63
+ /** Email subject line */
64
+ subject: string
65
+ /** Path to email template or HTML content */
66
+ template?: string
67
+ /** Optional plain text fallback */
68
+ text?: string
69
+ /** Optional attachments */
70
+ attachments?: EmailAttachment[]
71
+ /** Optional callback after successful delivery */
72
+ onSuccess?: () => Promise<{ message: string }> | { message: string }
73
+ /** Optional callback after failed delivery */
74
+ onError?: (error: Error) => Promise<{ message: string }> | { message: string }
75
+ /** Optional custom handler */
76
+ handle?: () => Promise<{ message: string }> | { message: string }
77
+ }
78
+
79
+ // Email interfaces
80
+ export interface EmailAddress {
81
+ address: string
82
+ name?: string
83
+ }
84
+
85
+ export interface EmailAttachment {
86
+ filename: string
87
+ content: string | Uint8Array
88
+ contentType?: string
89
+ encoding?: 'base64' | 'binary' | 'hex' | 'utf8'
90
+ }
91
+ // Helper functions for all drivers
92
+
93
+ export interface SESConfig extends EmailDriverConfig {
94
+ region: string
95
+ credentials?: {
96
+ accessKeyId: string
97
+ secretAccessKey: string
98
+ }
99
+ }
100
+
101
+ // SendGrid implementation
102
+ export interface SendGridConfig extends EmailDriverConfig {
103
+ apiKey: string
104
+ }
105
+
106
+ export interface RenderOptions {
107
+ props?: Record<string, unknown>
108
+ i18n?: I18n
109
+ }
110
+
111
+ export interface MailtrapSuccessResponse {
112
+ success: boolean
113
+ message_ids: string[]
114
+ errors?: never
115
+ }
116
+
117
+ export interface MailtrapErrorResponse {
118
+ success: false
119
+ errors: {
120
+ email?: string[]
121
+ message?: string[]
122
+ [key: string]: string[] | undefined
123
+ }
124
+ message_ids?: never
125
+ }
126
+
127
+ export type MailtrapResponse = MailtrapSuccessResponse | MailtrapErrorResponse
@@ -1 +1 @@
1
- export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Activity' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'FailedJob' | 'Product' | 'PaymentMethod' | 'Transaction' | 'Job' | 'Subscription' | 'Error'
1
+ export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'Category' | 'Payment' | 'Manufacturer' | 'OrderItem' | 'Customer' | 'Product' | 'ProductVariant' | 'Review' | 'ProductUnit' | 'GiftCard' | 'Order' | 'Coupon' | 'Transaction' | 'LoyaltyPoint' | 'ProductItem' | 'LoyaltyReward' | 'FailedJob' | 'PaymentMethod' | 'PaymentTransaction' | 'Request' | 'Job' | 'Subscription' | 'PaymentProduct' | 'Error'
package/src/model.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Faker } from '@stacksjs/faker'
1
2
  import type { ModelNames, TableNames } from '@stacksjs/types'
2
3
  import type { VineBoolean, VineNumber, VineString } from '@vinejs/vine'
3
4
  import type { DeepPartial, Nullable } from '.'
@@ -15,6 +16,20 @@ export interface Relation<T = string> extends BaseRelation {
15
16
  }
16
17
 
17
18
  export interface HasOne<T = string> extends Array<Relation<T>> {}
19
+
20
+ export interface MorphTo {
21
+ name: string
22
+ }
23
+
24
+ export interface MorphOne<T = string> extends BaseRelation {
25
+ model: T
26
+ morphName?: string
27
+ type?: string
28
+ id?: string
29
+ }
30
+
31
+ export interface MorphMany<T = string> extends MorphOne<T> {}
32
+
18
33
  export interface HasMany<T = string> extends Array<Relation<T>> {}
19
34
  export interface BelongsTo<T = string> extends Array<Relation<T>> {}
20
35
 
@@ -46,6 +61,7 @@ export interface ModelElement {
46
61
  field: string
47
62
  default: string | number | boolean | Date | undefined | null
48
63
  unique: boolean
64
+ required: boolean
49
65
  fieldArray: FieldArrayElement | null
50
66
  }
51
67
 
@@ -123,6 +139,7 @@ export interface ModelOptions extends Base {
123
139
  * @default string - The file name of the model.
124
140
  */
125
141
  name: string // defaults to the file name of the model
142
+ description?: string // defaults to the file name of the model
126
143
  table?: string // defaults to the lowercase, plural name of the model name (or the name of the model file)
127
144
  primaryKey?: string // defaults to `id`
128
145
  autoIncrement?: boolean // defaults to true
@@ -164,6 +181,12 @@ export interface ModelOptions extends Base {
164
181
 
165
182
  hasOneThrough?: HasOneThrough<ModelNames> | ModelNames[]
166
183
 
184
+ morphOne?: MorphOne<ModelNames> | ModelNames
185
+
186
+ morphMany?: MorphMany<ModelNames>[] | ModelNames[]
187
+
188
+ morphTo?: MorphTo
189
+
167
190
  scopes?: {
168
191
  [key: string]: (value: any) => any
169
192
  }
@@ -185,12 +208,11 @@ export interface Attribute {
185
208
  hidden?: boolean
186
209
  fillable?: boolean
187
210
  guarded?: boolean
188
- factory?: () => any
211
+ factory?: (faker: Faker) => any
189
212
  validation?: {
190
213
  rule: VineType
191
214
  message?: ValidatorMessage
192
215
  }
193
- // validation?: String | Number | Boolean | Date
194
216
  }
195
217
 
196
218
  export interface AttributesElements {
package/src/request.ts CHANGED
@@ -23,7 +23,7 @@ export interface RequestInstance {
23
23
 
24
24
  addParam: (param: RouteParams) => void
25
25
 
26
- get: <T>(element: T) => string | undefined
26
+ get: <T>(element: string, defaultValue?: T) => T
27
27
 
28
28
  header: (element: string) => string | number | boolean | null
29
29
 
package/src/router.ts CHANGED
@@ -24,8 +24,7 @@ export interface MiddlewareOptions {
24
24
  name: string
25
25
  description?: string
26
26
  priority: number
27
- // eslint-disable-next-line ts/no-unsafe-function-type
28
- handle: Function
27
+ handle: () => Promise<void>
29
28
  }
30
29
 
31
30
  export type StatusCode = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 500
package/src/services.ts CHANGED
@@ -4,37 +4,87 @@ export interface ServicesOptions {
4
4
  apiKey: string
5
5
  }
6
6
 
7
- godaddy?: {
7
+ aws?: {
8
+ accountId: string
9
+ appId: string
8
10
  apiKey: string
9
- apiSecret: string
11
+ region: string
10
12
  }
11
13
 
12
- meilisearch?: {
13
- appId: string
14
+ godaddy?: {
14
15
  apiKey: string
16
+ apiSecret: string
15
17
  }
16
18
 
17
- lemonSqueezy?: {
19
+ hetzner: {
18
20
  appId: string
19
21
  apiKey: string
20
22
  }
21
23
 
22
- stripe?: {
24
+ digitalOcean: {
23
25
  appId: string
24
26
  apiKey: string
25
27
  }
26
28
 
27
- // supabase?: {
29
+ // lemonSqueezy?: {
28
30
  // appId: string
29
31
  // apiKey: string
30
32
  // }
31
33
 
32
- aws?: {
33
- accountId: string
34
+ mailgun?: {
35
+ apiKey?: string
36
+ domain?: string
37
+ endpoint?: string
38
+ maxRetries?: number
39
+ retryTimeout?: number
40
+ }
41
+
42
+ mailtrap?: {
43
+ token: string
44
+ host: string
45
+ inboxId?: string | number
46
+ maxRetries?: number
47
+ retryTimeout?: number
48
+ }
49
+
50
+ meilisearch?: {
34
51
  appId: string
35
52
  apiKey: string
53
+ }
54
+
55
+ sendgrid?: {
56
+ apiKey?: string
57
+ maxRetries?: number
58
+ retryTimeout?: number
59
+ }
60
+
61
+ ses?: {
36
62
  region: string
63
+ credentials: {
64
+ accessKeyId?: string
65
+ secretAccessKey?: string
66
+ }
67
+ maxRetries?: number
68
+ retryTimeout?: number
69
+ }
70
+
71
+ slack?: {
72
+ appId: string
73
+ clientId: string
74
+ secretKey: string
75
+ maxRetries?: number
76
+ retryTimeout?: number
77
+ }
78
+
79
+ stripe?: {
80
+ appId: string
81
+ apiKey: string
37
82
  }
83
+
84
+ // supabase?: {
85
+ // appId: string
86
+ // apiKey: string
87
+ // }
38
88
  }
39
89
 
40
90
  export type ServicesConfig = Partial<ServicesOptions>
@@ -1 +1 @@
1
- export type TableNames = 'projects' | 'subscriber_emails' | 'personal_access_tokens' | 'team_users' | 'teams' | 'activities' | 'subscribers' | 'deployments' | 'releases' | 'team_users' | 'users' | 'posts' | 'failed_jobs' | 'products' | 'payment_methods' | 'transactions' | 'jobs' | 'subscriptions' | 'errors'
1
+ export type TableNames = 'projects' | 'subscriber_emails' | 'personal_access_tokens' | 'team_users' | 'teams' | 'subscribers' | 'deployments' | 'releases' | 'team_users' | 'users' | 'posts' | 'categories' | 'payments' | 'manufacturers' | 'order_items' | 'customers' | 'products' | 'product_variants' | 'reviews' | 'product_units' | 'gift_cards' | 'orders' | 'coupons' | 'transactions' | 'loyalty_points' | 'product_items' | 'loyalty_rewards' | 'failed_jobs' | 'payment_methods' | 'payment_transactions' | 'requests' | 'jobs' | 'subscriptions' | 'payment_products' | 'errors'
package/src/ui.ts CHANGED
@@ -157,7 +157,7 @@ export interface UiOptions {
157
157
  * ```
158
158
  * @example
159
159
  * ```html
160
- * <i class="i-heroicons-outline-book-open w-8 h-8 text-gray-500" aria-hidden="true" />
160
+ * <i class="i-hugeicons-outline-book-open w-8 h-8 text-gray-500" aria-hidden="true" />
161
161
  * ```
162
162
  */
163
163
  icons: Icon | Icon[]