@stacksjs/types 0.70.86 → 0.70.87
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/package.json +19 -5
- package/src/ai.ts +0 -41
- package/src/analytics.ts +0 -58
- package/src/api.ts +0 -77
- package/src/app.ts +0 -189
- package/src/attributes.ts +0 -5
- package/src/auth.ts +0 -161
- package/src/auto-imports.ts +0 -8
- package/src/binary.ts +0 -13
- package/src/cache.ts +0 -325
- package/src/cdn.ts +0 -17
- package/src/chat.ts +0 -193
- package/src/cli.ts +0 -445
- package/src/cloud.ts +0 -381
- package/src/cms.ts +0 -14
- package/src/commerce.ts +0 -18
- package/src/components.ts +0 -62
- package/src/configure.ts +0 -13
- package/src/cors.ts +0 -86
- package/src/cron-jobs.ts +0 -146
- package/src/dashboard.ts +0 -218
- package/src/database.ts +0 -117
- package/src/dependencies.ts +0 -69
- package/src/deploy.ts +0 -17
- package/src/dns.ts +0 -470
- package/src/docs.ts +0 -27
- package/src/email.ts +0 -511
- package/src/env.ts +0 -1
- package/src/errors.ts +0 -110
- package/src/events.ts +0 -37
- package/src/exit-code.ts +0 -10
- package/src/file-systems.ts +0 -70
- package/src/git.ts +0 -133
- package/src/hashing.ts +0 -127
- package/src/helpers.ts +0 -9
- package/src/i18n.ts +0 -121
- package/src/index.ts +0 -80
- package/src/library.ts +0 -911
- package/src/logging.ts +0 -62
- package/src/manifest.ts +0 -9
- package/src/marketing.ts +0 -14
- package/src/model-dashboard-augmentation.ts +0 -51
- package/src/model-names.ts +0 -1
- package/src/model.ts +0 -353
- package/src/monitoring.ts +0 -14
- package/src/native.ts +0 -0
- package/src/notifications.ts +0 -153
- package/src/oauth.ts +0 -488
- package/src/pages.ts +0 -10
- package/src/payments.ts +0 -440
- package/src/phone.ts +0 -78
- package/src/ports.ts +0 -20
- package/src/promise.ts +0 -1
- package/src/push.ts +0 -143
- package/src/queue.ts +0 -413
- package/src/reactivity.ts +0 -1
- package/src/realtime.ts +0 -584
- package/src/request.ts +0 -541
- package/src/response.ts +0 -16
- package/src/router.ts +0 -124
- package/src/saas.ts +0 -33
- package/src/scheduler.ts +0 -1
- package/src/search-engine.ts +0 -251
- package/src/security.ts +0 -23
- package/src/server.ts +0 -16
- package/src/services.ts +0 -211
- package/src/settings-config.ts +0 -10
- package/src/sms.ts +0 -265
- package/src/stack-extensions.ts +0 -184
- package/src/stacks.ts +0 -339
- package/src/storage.ts +0 -173
- package/src/table-names.ts +0 -1
- package/src/tables.ts +0 -57
- package/src/team.ts +0 -8
- package/src/ui.ts +0 -197
- package/src/utils.ts +0 -46
package/src/cloud.ts
DELETED
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
import type { ApiConfig } from './api'
|
|
2
|
-
import type { FirewallConfig } from './security'
|
|
3
|
-
|
|
4
|
-
export type CountryCode =
|
|
5
|
-
| 'AD'
|
|
6
|
-
| 'AE'
|
|
7
|
-
| 'AF'
|
|
8
|
-
| 'AG'
|
|
9
|
-
| 'AI'
|
|
10
|
-
| 'AL'
|
|
11
|
-
| 'AM'
|
|
12
|
-
| 'AO'
|
|
13
|
-
| 'AQ'
|
|
14
|
-
| 'AR'
|
|
15
|
-
| 'AS'
|
|
16
|
-
| 'AT'
|
|
17
|
-
| 'AU'
|
|
18
|
-
| 'AW'
|
|
19
|
-
| 'AX'
|
|
20
|
-
| 'AZ'
|
|
21
|
-
| 'BA'
|
|
22
|
-
| 'BB'
|
|
23
|
-
| 'BD'
|
|
24
|
-
| 'BE'
|
|
25
|
-
| 'BF'
|
|
26
|
-
| 'BG'
|
|
27
|
-
| 'BH'
|
|
28
|
-
| 'BI'
|
|
29
|
-
| 'BJ'
|
|
30
|
-
| 'BL'
|
|
31
|
-
| 'BM'
|
|
32
|
-
| 'BN'
|
|
33
|
-
| 'BO'
|
|
34
|
-
| 'BQ'
|
|
35
|
-
| 'BR'
|
|
36
|
-
| 'BS'
|
|
37
|
-
| 'BT'
|
|
38
|
-
| 'BV'
|
|
39
|
-
| 'BW'
|
|
40
|
-
| 'BY'
|
|
41
|
-
| 'BZ'
|
|
42
|
-
| 'CA'
|
|
43
|
-
| 'CC'
|
|
44
|
-
| 'CD'
|
|
45
|
-
| 'CF'
|
|
46
|
-
| 'CG'
|
|
47
|
-
| 'CH'
|
|
48
|
-
| 'CI'
|
|
49
|
-
| 'CK'
|
|
50
|
-
| 'CL'
|
|
51
|
-
| 'CM'
|
|
52
|
-
| 'CN'
|
|
53
|
-
| 'CO'
|
|
54
|
-
| 'CR'
|
|
55
|
-
| 'CU'
|
|
56
|
-
| 'CV'
|
|
57
|
-
| 'CW'
|
|
58
|
-
| 'CX'
|
|
59
|
-
| 'CY'
|
|
60
|
-
| 'CZ'
|
|
61
|
-
| 'DE'
|
|
62
|
-
| 'DJ'
|
|
63
|
-
| 'DK'
|
|
64
|
-
| 'DM'
|
|
65
|
-
| 'DO'
|
|
66
|
-
| 'DZ'
|
|
67
|
-
| 'EC'
|
|
68
|
-
| 'EE'
|
|
69
|
-
| 'EG'
|
|
70
|
-
| 'EH'
|
|
71
|
-
| 'ER'
|
|
72
|
-
| 'ES'
|
|
73
|
-
| 'ET'
|
|
74
|
-
| 'FI'
|
|
75
|
-
| 'FJ'
|
|
76
|
-
| 'FK'
|
|
77
|
-
| 'FM'
|
|
78
|
-
| 'FO'
|
|
79
|
-
| 'FR'
|
|
80
|
-
| 'GA'
|
|
81
|
-
| 'GB'
|
|
82
|
-
| 'GD'
|
|
83
|
-
| 'GE'
|
|
84
|
-
| 'GF'
|
|
85
|
-
| 'GG'
|
|
86
|
-
| 'GH'
|
|
87
|
-
| 'GI'
|
|
88
|
-
| 'GL'
|
|
89
|
-
| 'GM'
|
|
90
|
-
| 'GN'
|
|
91
|
-
| 'GP'
|
|
92
|
-
| 'GQ'
|
|
93
|
-
| 'GR'
|
|
94
|
-
| 'GS'
|
|
95
|
-
| 'GT'
|
|
96
|
-
| 'GU'
|
|
97
|
-
| 'GW'
|
|
98
|
-
| 'GY'
|
|
99
|
-
| 'HK'
|
|
100
|
-
| 'HM'
|
|
101
|
-
| 'HN'
|
|
102
|
-
| 'HR'
|
|
103
|
-
| 'HT'
|
|
104
|
-
| 'HU'
|
|
105
|
-
| 'ID'
|
|
106
|
-
| 'IE'
|
|
107
|
-
| 'IL'
|
|
108
|
-
| 'IM'
|
|
109
|
-
| 'IN'
|
|
110
|
-
| 'IO'
|
|
111
|
-
| 'IQ'
|
|
112
|
-
| 'IR'
|
|
113
|
-
| 'IS'
|
|
114
|
-
| 'IT'
|
|
115
|
-
| 'JE'
|
|
116
|
-
| 'JM'
|
|
117
|
-
| 'JO'
|
|
118
|
-
| 'JP'
|
|
119
|
-
| 'KE'
|
|
120
|
-
| 'KG'
|
|
121
|
-
| 'KH'
|
|
122
|
-
| 'KI'
|
|
123
|
-
| 'KM'
|
|
124
|
-
| 'KN'
|
|
125
|
-
| 'KP'
|
|
126
|
-
| 'KR'
|
|
127
|
-
| 'KW'
|
|
128
|
-
| 'KY'
|
|
129
|
-
| 'KZ'
|
|
130
|
-
| 'LA'
|
|
131
|
-
| 'LB'
|
|
132
|
-
| 'LC'
|
|
133
|
-
| 'LI'
|
|
134
|
-
| 'LK'
|
|
135
|
-
| 'LR'
|
|
136
|
-
| 'LS'
|
|
137
|
-
| 'LT'
|
|
138
|
-
| 'LU'
|
|
139
|
-
| 'LV'
|
|
140
|
-
| 'LY'
|
|
141
|
-
| 'MA'
|
|
142
|
-
| 'MC'
|
|
143
|
-
| 'MD'
|
|
144
|
-
| 'ME'
|
|
145
|
-
| 'MF'
|
|
146
|
-
| 'MG'
|
|
147
|
-
| 'MH'
|
|
148
|
-
| 'MK'
|
|
149
|
-
| 'ML'
|
|
150
|
-
| 'MM'
|
|
151
|
-
| 'MN'
|
|
152
|
-
| 'MO'
|
|
153
|
-
| 'MP'
|
|
154
|
-
| 'MQ'
|
|
155
|
-
| 'MR'
|
|
156
|
-
| 'MS'
|
|
157
|
-
| 'MT'
|
|
158
|
-
| 'MU'
|
|
159
|
-
| 'MV'
|
|
160
|
-
| 'MW'
|
|
161
|
-
| 'MX'
|
|
162
|
-
| 'MY'
|
|
163
|
-
| 'MZ'
|
|
164
|
-
| 'NA'
|
|
165
|
-
| 'NC'
|
|
166
|
-
| 'NE'
|
|
167
|
-
| 'NF'
|
|
168
|
-
| 'NG'
|
|
169
|
-
| 'NI'
|
|
170
|
-
| 'NL'
|
|
171
|
-
| 'NO'
|
|
172
|
-
| 'NP'
|
|
173
|
-
| 'NR'
|
|
174
|
-
| 'NU'
|
|
175
|
-
| 'NZ'
|
|
176
|
-
| 'OM'
|
|
177
|
-
| 'PA'
|
|
178
|
-
| 'PE'
|
|
179
|
-
| 'PF'
|
|
180
|
-
| 'PG'
|
|
181
|
-
| 'PH'
|
|
182
|
-
| 'PK'
|
|
183
|
-
| 'PL'
|
|
184
|
-
| 'PM'
|
|
185
|
-
| 'PN'
|
|
186
|
-
| 'PR'
|
|
187
|
-
| 'PS'
|
|
188
|
-
| 'PT'
|
|
189
|
-
| 'PW'
|
|
190
|
-
| 'PY'
|
|
191
|
-
| 'QA'
|
|
192
|
-
| 'RE'
|
|
193
|
-
| 'RO'
|
|
194
|
-
| 'RS'
|
|
195
|
-
| 'RU'
|
|
196
|
-
| 'RW'
|
|
197
|
-
| 'SA'
|
|
198
|
-
| 'SB'
|
|
199
|
-
| 'SC'
|
|
200
|
-
| 'SD'
|
|
201
|
-
| 'SE'
|
|
202
|
-
| 'SG'
|
|
203
|
-
| 'SH'
|
|
204
|
-
| 'SI'
|
|
205
|
-
| 'SJ'
|
|
206
|
-
| 'SK'
|
|
207
|
-
| 'SL'
|
|
208
|
-
| 'SM'
|
|
209
|
-
| 'SN'
|
|
210
|
-
| 'SO'
|
|
211
|
-
| 'SR'
|
|
212
|
-
| 'SS'
|
|
213
|
-
| 'ST'
|
|
214
|
-
| 'SV'
|
|
215
|
-
| 'SX'
|
|
216
|
-
| 'SY'
|
|
217
|
-
| 'SZ'
|
|
218
|
-
| 'TC'
|
|
219
|
-
| 'TD'
|
|
220
|
-
| 'TF'
|
|
221
|
-
| 'TG'
|
|
222
|
-
| 'TH'
|
|
223
|
-
| 'TJ'
|
|
224
|
-
| 'TK'
|
|
225
|
-
| 'TL'
|
|
226
|
-
| 'TM'
|
|
227
|
-
| 'TN'
|
|
228
|
-
| 'TO'
|
|
229
|
-
| 'TR'
|
|
230
|
-
| 'TT'
|
|
231
|
-
| 'TV'
|
|
232
|
-
| 'TW'
|
|
233
|
-
| 'TZ'
|
|
234
|
-
| 'UA'
|
|
235
|
-
| 'UG'
|
|
236
|
-
| 'UM'
|
|
237
|
-
| 'US'
|
|
238
|
-
| 'UY'
|
|
239
|
-
| 'UZ'
|
|
240
|
-
| 'VA'
|
|
241
|
-
| 'VC'
|
|
242
|
-
| 'VE'
|
|
243
|
-
| 'VG'
|
|
244
|
-
| 'VI'
|
|
245
|
-
| 'VN'
|
|
246
|
-
| 'VU'
|
|
247
|
-
| 'WF'
|
|
248
|
-
| 'WS'
|
|
249
|
-
| 'YE'
|
|
250
|
-
| 'YT'
|
|
251
|
-
| 'ZA'
|
|
252
|
-
| 'ZM'
|
|
253
|
-
| 'ZW'
|
|
254
|
-
|
|
255
|
-
type Environment = 'development' | 'staging' | 'production'
|
|
256
|
-
|
|
257
|
-
interface SiteConfig {
|
|
258
|
-
domain: string
|
|
259
|
-
path: string
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
type InfrastructureOptions = Partial<{
|
|
263
|
-
type: 'serverless' // | 'server' coming soon
|
|
264
|
-
driver: 'aws'
|
|
265
|
-
api: ApiConfig
|
|
266
|
-
storage: object
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* **Firewall Settings**
|
|
270
|
-
*
|
|
271
|
-
* These settings are used to configure the firewall.
|
|
272
|
-
*
|
|
273
|
-
* @see https://stacksjs.com/docs/cloud#firewall
|
|
274
|
-
*
|
|
275
|
-
* @example
|
|
276
|
-
* ```ts
|
|
277
|
-
* firewall: {
|
|
278
|
-
* enabled: true, // default: true
|
|
279
|
-
* countryCodes: ['RU', 'IN'], // default: []
|
|
280
|
-
* ipAddresses: ['56.123.456.789'], // default: []
|
|
281
|
-
* queryString: ['foo', 'bar'], // default: []
|
|
282
|
-
* httpHeaders: ['x-foo', 'x-bar'], // default: []
|
|
283
|
-
* rateLimitPerMinute: 1000, // default: 1000
|
|
284
|
-
* useIpReputationLists: true, // default: true
|
|
285
|
-
* useKnownBadInputsRuleSet: true // default: true
|
|
286
|
-
* },
|
|
287
|
-
* ```
|
|
288
|
-
*/
|
|
289
|
-
firewall: FirewallConfig
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* **Environments**
|
|
293
|
-
*
|
|
294
|
-
* These are the environments that your cloud will deploy.
|
|
295
|
-
*
|
|
296
|
-
* @example
|
|
297
|
-
* ```ts
|
|
298
|
-
* environments: ['production', 'staging', 'development']
|
|
299
|
-
* ```
|
|
300
|
-
*/
|
|
301
|
-
environments: Environment[]
|
|
302
|
-
|
|
303
|
-
cdn: {
|
|
304
|
-
allowedMethods: 'GET_HEAD' | 'GET_HEAD_OPTIONS' | 'ALL'
|
|
305
|
-
cachedMethods: 'GET_HEAD' | 'GET_HEAD_OPTIONS'
|
|
306
|
-
minTtl: number
|
|
307
|
-
defaultTtl: number
|
|
308
|
-
maxTtl: number
|
|
309
|
-
compress: boolean
|
|
310
|
-
priceClass?: 'PriceClass_100' | 'PriceClass_200' | 'PriceClass_All'
|
|
311
|
-
originShieldRegion: string
|
|
312
|
-
cookieBehavior: 'none' | 'allowList' | 'all'
|
|
313
|
-
|
|
314
|
-
allowList: {
|
|
315
|
-
cookies: string[]
|
|
316
|
-
headers: string[]
|
|
317
|
-
queryStrings: string[]
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
realtimeLogs: {
|
|
321
|
-
enabled: boolean
|
|
322
|
-
samplingRate: number
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
ai: boolean
|
|
327
|
-
cli: boolean
|
|
328
|
-
docs: boolean
|
|
329
|
-
fileSystem: boolean
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* **Tunnel Configuration**
|
|
333
|
-
*
|
|
334
|
-
* Deploy a custom tunnel server for sharing local dev servers.
|
|
335
|
-
* Only needed for custom domains — localtunnel.dev is the shared default.
|
|
336
|
-
*
|
|
337
|
-
* @example
|
|
338
|
-
* ```ts
|
|
339
|
-
* tunnel: {
|
|
340
|
-
* enabled: true,
|
|
341
|
-
* domain: 'tunnel.mycompany.com',
|
|
342
|
-
* ssl: { enabled: true },
|
|
343
|
-
* }
|
|
344
|
-
* ```
|
|
345
|
-
*/
|
|
346
|
-
tunnel: TunnelCloudConfig
|
|
347
|
-
}>
|
|
348
|
-
|
|
349
|
-
export interface TunnelCloudConfig {
|
|
350
|
-
/** Enable custom tunnel server deployment (opt-in) */
|
|
351
|
-
enabled: boolean
|
|
352
|
-
/** Custom domain for the tunnel server (must NOT be localtunnel.dev) */
|
|
353
|
-
domain?: string
|
|
354
|
-
/** AWS region to deploy to */
|
|
355
|
-
region?: string
|
|
356
|
-
/** EC2 instance type */
|
|
357
|
-
instanceType?: string
|
|
358
|
-
/** Resource name prefix */
|
|
359
|
-
prefix?: string
|
|
360
|
-
/** SSL configuration */
|
|
361
|
-
ssl?: {
|
|
362
|
-
enabled: boolean
|
|
363
|
-
porkbunApiKey?: string
|
|
364
|
-
porkbunSecretKey?: string
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
export interface CloudOptions {
|
|
369
|
-
sites: {
|
|
370
|
-
root: string
|
|
371
|
-
path: string
|
|
372
|
-
[site: string]: string | SiteConfig
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
infrastructure: InfrastructureOptions
|
|
376
|
-
cdn: any
|
|
377
|
-
api: any
|
|
378
|
-
firewall: any
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
export type CloudConfig = Partial<CloudOptions>
|
package/src/cms.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* **CMS Options**
|
|
3
|
-
*
|
|
4
|
-
* Top-level feature gate plus any future CMS-wide settings. The CMS bundle
|
|
5
|
-
* (Post / Page / Author / Comment / Tag / Category models + edit dashboards)
|
|
6
|
-
* stays inert at boot when `enabled` is `false`.
|
|
7
|
-
*/
|
|
8
|
-
export interface CmsOptions {
|
|
9
|
-
enabled?: boolean
|
|
10
|
-
/** Optional deploy-target gate, e.g. `['production']`. */
|
|
11
|
-
env?: string[]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type CmsConfig = Partial<CmsOptions>
|
package/src/commerce.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* **Commerce Options**
|
|
3
|
-
*
|
|
4
|
-
* Top-level feature gate plus storefront defaults. The commerce bundle
|
|
5
|
-
* (Order / Cart / Product / Customer / Coupon / GiftCard / Shipping models +
|
|
6
|
-
* storefront API) stays inert at boot when `enabled` is `false`.
|
|
7
|
-
*/
|
|
8
|
-
export interface CommerceOptions {
|
|
9
|
-
enabled?: boolean
|
|
10
|
-
/** Optional deploy-target gate, e.g. `['production']`. */
|
|
11
|
-
env?: string[]
|
|
12
|
-
/** Default storefront currency (ISO 4217), e.g. `'USD'`. */
|
|
13
|
-
currency?: string
|
|
14
|
-
/** Default tax rate applied when no product/region rule overrides. */
|
|
15
|
-
defaultTaxRate?: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type CommerceConfig = Partial<CommerceOptions>
|
package/src/components.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export interface TagOption {
|
|
2
|
-
/**
|
|
3
|
-
* **Tag Name**
|
|
4
|
-
*
|
|
5
|
-
* This is the name of the component to be included in your library build.
|
|
6
|
-
* When defining a tag, ensure that the name corresponds to a file within
|
|
7
|
-
* root component directory.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* {
|
|
11
|
-
* tags: [{
|
|
12
|
-
* name: 'HelloWorld' // results in `<HelloWorld />`
|
|
13
|
-
* }]
|
|
14
|
-
* }
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* {
|
|
18
|
-
* tags: [{
|
|
19
|
-
* name: ['HelloWorld', 'AppHelloWorld'] // results in `<AppHelloWorld />`
|
|
20
|
-
* }]
|
|
21
|
-
* }
|
|
22
|
-
* @see https://stacksjs.com/docs/components
|
|
23
|
-
*/
|
|
24
|
-
name: string | string[]
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* **Tag Description**
|
|
28
|
-
*
|
|
29
|
-
* This is the description of your component. This value is
|
|
30
|
-
* used when to provide additional information to IDEs.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* {
|
|
34
|
-
* name: 'HelloWorld' // results in `<HelloWorld />`
|
|
35
|
-
* }
|
|
36
|
-
* @see https://stacksjs.com/docs/components
|
|
37
|
-
*/
|
|
38
|
-
description?: string
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* **Tag Attributes**
|
|
42
|
-
*
|
|
43
|
-
* These are your component's attributes. While it’s an optional field, you should aim
|
|
44
|
-
* to define all of your component attributes here, to provide as much context
|
|
45
|
-
* to your IDEs as possible, when actually using the library as an end-user.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* {
|
|
49
|
-
* attributes: {
|
|
50
|
-
* name: 'greeting',
|
|
51
|
-
* description: 'The way to greet the user.',
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* @see https://stacksjs.com/docs/components
|
|
55
|
-
*/
|
|
56
|
-
attributes?: {
|
|
57
|
-
name: string
|
|
58
|
-
description: string
|
|
59
|
-
}[]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type TagsOptions = TagOption[]
|
package/src/configure.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface ConfigureOptions {
|
|
2
|
-
aws: boolean
|
|
3
|
-
profile: string
|
|
4
|
-
project: boolean
|
|
5
|
-
verbose: boolean
|
|
6
|
-
accessKeyId: string
|
|
7
|
-
secretAccessKey: string
|
|
8
|
-
region: string
|
|
9
|
-
output: string
|
|
10
|
-
quiet: boolean
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type ConfigureConfig = Partial<ConfigureOptions>
|
package/src/cors.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CORS configuration types (stacksjs/stacks#1859 H-2).
|
|
3
|
-
*
|
|
4
|
-
* Lives in `@stacksjs/types` so userland `config/cors.ts` files can
|
|
5
|
-
* `import type { CorsConfig } from '@stacksjs/types'` and get full
|
|
6
|
-
* IntelliSense, and so the Cors middleware can read
|
|
7
|
-
* `config.cors` with proper typing instead of an `as any` cast.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Raw CORS configuration — every field optional. Defaults fill in
|
|
12
|
-
* any field that's missing when the middleware resolves config.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* // config/cors.ts
|
|
17
|
-
* import type { CorsConfig } from '@stacksjs/types'
|
|
18
|
-
*
|
|
19
|
-
* export default {
|
|
20
|
-
* origin: ['https://app.example.com', 'https://admin.example.com'],
|
|
21
|
-
* credentials: true,
|
|
22
|
-
* methods: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
23
|
-
* allowedHeaders: ['Content-Type', 'Authorization', 'X-CSRF-Token'],
|
|
24
|
-
* maxAge: 600,
|
|
25
|
-
* } satisfies CorsConfig
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export interface CorsConfig {
|
|
29
|
-
/**
|
|
30
|
-
* Allowed origins.
|
|
31
|
-
*
|
|
32
|
-
* - `'*'` permits any origin (incompatible with `credentials: true`).
|
|
33
|
-
* - A string array enumerates the explicit allow-list; the request's
|
|
34
|
-
* `Origin` header is reflected verbatim when it matches.
|
|
35
|
-
* - A predicate function lets you implement dynamic allow-lists
|
|
36
|
-
* (e.g. wildcards, regex, environment-dependent).
|
|
37
|
-
*/
|
|
38
|
-
origin?: '*' | string[] | ((origin: string) => boolean)
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* HTTP methods the server accepts cross-origin. Echoed back in
|
|
42
|
-
* preflight `Access-Control-Allow-Methods` responses.
|
|
43
|
-
*/
|
|
44
|
-
methods?: string[]
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Request headers the browser is allowed to send cross-origin.
|
|
48
|
-
* Echoed back in preflight `Access-Control-Allow-Headers` responses.
|
|
49
|
-
*/
|
|
50
|
-
allowedHeaders?: string[]
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Response headers the browser is allowed to expose to JS via
|
|
54
|
-
* `fetch(...).then(r => r.headers.get(...))`. Anything not listed
|
|
55
|
-
* here is hidden from the SPA even though it's on the wire.
|
|
56
|
-
*/
|
|
57
|
-
exposedHeaders?: string[]
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Whether cookies / Authorization headers may be included
|
|
61
|
-
* cross-origin. **Setting this to `true` is incompatible with
|
|
62
|
-
* `origin: '*'`** — the spec requires an explicit origin.
|
|
63
|
-
*/
|
|
64
|
-
credentials?: boolean
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* How long the browser may cache the preflight response, in
|
|
68
|
-
* seconds. Default 86_400 (24h). Lower values cost more preflights
|
|
69
|
-
* but pick up policy changes faster.
|
|
70
|
-
*/
|
|
71
|
-
maxAge?: number
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Resolved CORS configuration with all defaults applied. This is the
|
|
76
|
-
* shape the middleware passes through `applyCorsHeaders` /
|
|
77
|
-
* `buildPreflightResponse`.
|
|
78
|
-
*/
|
|
79
|
-
export interface ResolvedCorsConfig {
|
|
80
|
-
origin: '*' | string[] | ((origin: string) => boolean)
|
|
81
|
-
methods: string[]
|
|
82
|
-
allowedHeaders: string[]
|
|
83
|
-
exposedHeaders: string[]
|
|
84
|
-
credentials: boolean
|
|
85
|
-
maxAge: number
|
|
86
|
-
}
|
package/src/cron-jobs.ts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import type { IntRange } from '@stacksjs/cron'
|
|
2
|
-
|
|
3
|
-
export type Job = JobOptions
|
|
4
|
-
export type Jobs = Job[]
|
|
5
|
-
export type CronJob = Job
|
|
6
|
-
export type CronJobs = Jobs
|
|
7
|
-
|
|
8
|
-
export enum Every {
|
|
9
|
-
Second = '* * * * * *',
|
|
10
|
-
FiveSeconds = '*/5 * * * * *',
|
|
11
|
-
TenSeconds = '*/10 * * * * *',
|
|
12
|
-
ThirtySeconds = '*/30 * * * * *',
|
|
13
|
-
Minute = '* * * * *',
|
|
14
|
-
TwoMinutes = '*/2 * * * *',
|
|
15
|
-
FiveMinutes = '*/5 * * * *',
|
|
16
|
-
TenMinutes = '*/10 * * * *',
|
|
17
|
-
FifteenMinutes = '*/15 * * * *',
|
|
18
|
-
ThirtyMinutes = '*/30 * * * *',
|
|
19
|
-
Hour = '0 * * * *',
|
|
20
|
-
HalfHour = '0,30 * * * *',
|
|
21
|
-
Day = '0 0 * * *',
|
|
22
|
-
Week = '0 0 * * 0',
|
|
23
|
-
Weekday = '0 0 * * 1-5',
|
|
24
|
-
Weekend = '0 0 * * 0,6',
|
|
25
|
-
Month = '0 0 1 * *',
|
|
26
|
-
Year = '0 0 1 1 *',
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type JobHandler = (_data?: any) => Promise<any> | any
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Represents different backoff strategies for job retries
|
|
33
|
-
*/
|
|
34
|
-
type BackoffStrategy = 'fixed' | 'exponential' | 'linear' | 'random'
|
|
35
|
-
|
|
36
|
-
export interface JitterConfig {
|
|
37
|
-
/**
|
|
38
|
-
* Enable/disable jitter
|
|
39
|
-
*/
|
|
40
|
-
enabled: boolean
|
|
41
|
-
/**
|
|
42
|
-
* Maximum percentage of variation (0-1)
|
|
43
|
-
*/
|
|
44
|
-
factor?: number
|
|
45
|
-
/**
|
|
46
|
-
* Minimum delay in milliseconds
|
|
47
|
-
*/
|
|
48
|
-
minDelay?: number
|
|
49
|
-
/**
|
|
50
|
-
* Maximum delay in milliseconds
|
|
51
|
-
*/
|
|
52
|
-
maxDelay?: number
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface BackoffConfig {
|
|
56
|
-
/**
|
|
57
|
-
* The strategy to use for calculating delay between retries
|
|
58
|
-
*/
|
|
59
|
-
strategy: BackoffStrategy
|
|
60
|
-
/**
|
|
61
|
-
* Initial delay in milliseconds
|
|
62
|
-
*/
|
|
63
|
-
initialDelay: number
|
|
64
|
-
/**
|
|
65
|
-
* For exponential/linear backoff: the multiplier/increment to apply
|
|
66
|
-
*/
|
|
67
|
-
factor?: number
|
|
68
|
-
/**
|
|
69
|
-
* Maximum delay between retries in milliseconds
|
|
70
|
-
*/
|
|
71
|
-
maxDelay?: number
|
|
72
|
-
/**
|
|
73
|
-
* Jitter configuration to add randomness to delays
|
|
74
|
-
*/
|
|
75
|
-
jitter?: JitterConfig
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface JobOptions {
|
|
79
|
-
/**
|
|
80
|
-
* The name of the job
|
|
81
|
-
*/
|
|
82
|
-
name?: string
|
|
83
|
-
/**
|
|
84
|
-
* Job handler function or identifier string
|
|
85
|
-
*/
|
|
86
|
-
handle?: string | JobHandler
|
|
87
|
-
/**
|
|
88
|
-
* Action identifier
|
|
89
|
-
*/
|
|
90
|
-
action?: string
|
|
91
|
-
/**
|
|
92
|
-
* Job description
|
|
93
|
-
*/
|
|
94
|
-
description?: string
|
|
95
|
-
/**
|
|
96
|
-
* Queue name
|
|
97
|
-
*/
|
|
98
|
-
queue?: string
|
|
99
|
-
/**
|
|
100
|
-
* Timezone for scheduling
|
|
101
|
-
*/
|
|
102
|
-
timezone?: string
|
|
103
|
-
/**
|
|
104
|
-
* Number of retry attempts. Must be between 0 and 185
|
|
105
|
-
*/
|
|
106
|
-
tries?: IntRange<0, 185>
|
|
107
|
-
/**
|
|
108
|
-
* Simple backoff configuration using delay values
|
|
109
|
-
* Can be a single number for fixed delay,
|
|
110
|
-
* or an array of delays for custom retry delays
|
|
111
|
-
*/
|
|
112
|
-
backoff?: number | number[]
|
|
113
|
-
/**
|
|
114
|
-
* Advanced backoff configuration
|
|
115
|
-
*/
|
|
116
|
-
backoffConfig?: BackoffConfig
|
|
117
|
-
/**
|
|
118
|
-
* Rate limiting configuration
|
|
119
|
-
* Can be a string like "5/minute" or an Every object
|
|
120
|
-
*/
|
|
121
|
-
rate?: string | Every
|
|
122
|
-
/**
|
|
123
|
-
* Whether the job is enabled
|
|
124
|
-
*/
|
|
125
|
-
enabled?: boolean
|
|
126
|
-
/**
|
|
127
|
-
* Maximum execution time in milliseconds
|
|
128
|
-
*/
|
|
129
|
-
timeout?: number
|
|
130
|
-
/**
|
|
131
|
-
* Unique job key to prevent duplicates
|
|
132
|
-
*/
|
|
133
|
-
key?: string
|
|
134
|
-
/**
|
|
135
|
-
* Time-to-live in seconds for the job key
|
|
136
|
-
*/
|
|
137
|
-
ttl?: number
|
|
138
|
-
/**
|
|
139
|
-
* Whether to run the job immediately when added
|
|
140
|
-
*/
|
|
141
|
-
immediate?: boolean
|
|
142
|
-
/**
|
|
143
|
-
* Custom metadata for the job
|
|
144
|
-
*/
|
|
145
|
-
meta?: Record<string, any>
|
|
146
|
-
}
|