@stacksjs/types 0.58.73 → 0.59.2

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.
Files changed (71) hide show
  1. package/dist/ai.d.ts +15 -0
  2. package/dist/analytics.d.ts +19 -0
  3. package/dist/api.d.ts +59 -0
  4. package/dist/app.d.ts +135 -0
  5. package/dist/auto-imports.d.ts +1 -0
  6. package/dist/binary.d.ts +11 -0
  7. package/dist/build.d.ts +2 -0
  8. package/dist/cache.d.ts +88 -0
  9. package/dist/cdn.d.ts +16 -0
  10. package/dist/chat.d.ts +4 -0
  11. package/dist/cli.d.ts +278 -0
  12. package/dist/cloud.d.ts +69 -0
  13. package/dist/components.d.ts +60 -0
  14. package/dist/configure.d.ts +12 -0
  15. package/dist/cron-jobs.d.ts +43 -0
  16. package/dist/database.d.ts +37 -0
  17. package/dist/dependencies.d.ts +62 -0
  18. package/dist/deploy.d.ts +12 -0
  19. package/dist/dns.d.ts +175 -0
  20. package/dist/docs.d.ts +22 -0
  21. package/dist/email.d.ts +14 -0
  22. package/dist/env.d.ts +1 -0
  23. package/dist/errors.d.ts +1 -0
  24. package/dist/events.d.ts +30 -0
  25. package/dist/exit-code.d.ts +10 -0
  26. package/dist/file-systems.d.ts +60 -0
  27. package/dist/git.d.ts +129 -0
  28. package/dist/hashing.d.ts +109 -0
  29. package/dist/helpers.d.ts +1 -0
  30. package/dist/i18n.d.ts +19 -0
  31. package/dist/index.d.ts +58 -0
  32. package/dist/index.js +8 -1785
  33. package/dist/inspect.d.ts +9 -0
  34. package/dist/library.d.ts +134 -0
  35. package/dist/logger.d.ts +49 -0
  36. package/dist/manifest.d.ts +9 -0
  37. package/dist/model.d.ts +70 -0
  38. package/dist/money.d.ts +2 -0
  39. package/dist/notifications.d.ts +117 -0
  40. package/dist/pages.d.ts +10 -0
  41. package/dist/payments.d.ts +60 -0
  42. package/dist/ports.d.ts +19 -0
  43. package/dist/promise.d.ts +1 -0
  44. package/dist/push.d.ts +35 -0
  45. package/dist/pwa.d.ts +7 -0
  46. package/dist/queue.d.ts +36 -0
  47. package/dist/reactivity.d.ts +1 -0
  48. package/dist/router.d.ts +78 -0
  49. package/dist/scheduler.d.ts +1 -0
  50. package/dist/search-engine.d.ts +118 -0
  51. package/dist/security.d.ts +18 -0
  52. package/dist/services.d.ts +33 -0
  53. package/dist/sms.d.ts +1 -0
  54. package/dist/ssg.d.ts +2 -0
  55. package/dist/stacks.d.ts +196 -0
  56. package/dist/storage.d.ts +12 -0
  57. package/dist/tables.d.ts +52 -0
  58. package/dist/team.d.ts +8 -0
  59. package/dist/ui.d.ts +165 -0
  60. package/dist/utils.d.ts +33 -0
  61. package/package.json +8 -9
  62. package/src/chat.ts +1 -2
  63. package/src/cli.ts +1 -1
  64. package/src/cloud.ts +2 -0
  65. package/src/index.ts +0 -1
  66. package/src/model.ts +19 -9
  67. package/src/router.ts +22 -2
  68. package/src/scheduler.ts +1 -1
  69. package/src/services.ts +0 -4
  70. package/src/sms.ts +3 -3
  71. package/src/request.ts +0 -3
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Null or whatever.
3
+ */
4
+ export type Nullable<T> = T | null | undefined;
5
+ /**
6
+ * Function
7
+ */
8
+ export type Fn<T = void> = () => T;
9
+ /**
10
+ * Array, or not yet
11
+ */
12
+ export type Arrayable<T> = T | Array<T>;
13
+ /**
14
+ * Constructor.
15
+ */
16
+ export type Constructor<T = void> = new (...args: any[]) => T;
17
+ /**
18
+ * Defines an intersection type of all union items.
19
+ *
20
+ * @param U Union of any types that will be intersected.
21
+ * @returns U items intersected
22
+ * @see https://stackoverflow.com/a/50375286/9259330
23
+ */
24
+ export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
25
+ export type MergeInsertions<T> = T extends object ? {
26
+ [K in keyof T]: MergeInsertions<T[K]>;
27
+ } : T;
28
+ export type DeepMerge<F, S> = MergeInsertions<{
29
+ [K in keyof F | keyof S]: K extends keyof S & keyof F ? DeepMerge<F[K], S[K]> : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never;
30
+ }>;
31
+ export type DeepPartial<T> = {
32
+ [P in keyof T]?: DeepPartial<T[P]>;
33
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.58.73",
4
+ "version": "0.59.2",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -51,18 +51,17 @@
51
51
  "@mdit-vue/plugin-component": "^2.0.0",
52
52
  "@mdit-vue/plugin-frontmatter": "^2.0.0",
53
53
  "@mdit-vue/types": "^2.0.0",
54
- "@novu/stateless": "^0.23.1",
55
54
  "@rollup/pluginutils": "^5.1.0",
56
55
  "@stacksjs/validation": "latest",
57
56
  "@types/aws4": "^1.11.6",
58
57
  "@types/bcryptjs": "^2.4.6",
59
- "@types/bun": "^1.0.6",
58
+ "@types/bun": "^1.0.8",
60
59
  "@types/crypto-js": "^4.2.2",
61
- "@types/eslint": "^8.56.2",
60
+ "@types/eslint": "^8.56.5",
62
61
  "@types/fs-extra": "^11.0.4",
63
62
  "@types/markdown-it-link-attributes": "^3.0.4",
64
63
  "@types/minimatch": "^5.1.2",
65
- "@types/node": "^20.11.19",
64
+ "@types/node": "^20.11.24",
66
65
  "@types/nprogress": "^0.2.3",
67
66
  "@vinejs/vine": "^1.7.1",
68
67
  "cac": "^6.7.14",
@@ -73,15 +72,15 @@
73
72
  "unocss": "^0.58.5",
74
73
  "unplugin-auto-import": "^0.17.5",
75
74
  "unplugin-vue-components": "^0.26.0",
76
- "vite": "^5.1.3",
75
+ "vite": "^5.1.5",
77
76
  "vite-plugin-inspect": "^0.8.3",
78
- "vite-plugin-pwa": "^0.19.0",
77
+ "vite-plugin-pwa": "^0.19.2",
79
78
  "vite-ssg": "^0.23.6",
80
79
  "vitepress": "1.0.0-rc.44",
81
- "vue": "^3.4.19"
80
+ "vue": "^3.4.21"
82
81
  },
83
82
  "devDependencies": {
84
- "aws-cdk-lib": "^2.128.0",
83
+ "aws-cdk-lib": "^2.131.0",
85
84
  "typescript": "^5.3.3"
86
85
  }
87
86
  }
package/src/chat.ts CHANGED
@@ -1,5 +1,4 @@
1
- import type { IChatOptions as ChatOptions } from '@novu/stateless'
2
-
1
+ interface ChatOptions {}
3
2
  export type { ChatOptions }
4
3
 
5
4
  export type ChatConfig = ChatOptions
package/src/cli.ts CHANGED
@@ -322,7 +322,7 @@ export interface ProjectsOptions extends CliOptions {
322
322
  }
323
323
  export interface PreinstallOptions extends CliOptions { }
324
324
  export interface PrepublishOptions extends CliOptions { }
325
- export interface CheckOptions extends CliOptions {
325
+ export interface PortsOptions extends CliOptions {
326
326
  ports?: Partial<Ports>
327
327
  }
328
328
  export interface TinkerOptions extends CliOptions { }
package/src/cloud.ts CHANGED
@@ -31,6 +31,8 @@ export type CountryCode =
31
31
  type Environment = 'development' | 'staging' | 'production'
32
32
 
33
33
  export interface CloudOptions {
34
+ type: 'serverless' // | 'server' coming soon
35
+
34
36
  driver: 'aws'
35
37
 
36
38
  // eslint-disable-next-line ts/ban-types
package/src/index.ts CHANGED
@@ -43,7 +43,6 @@ export * from './pwa'
43
43
  export * from './push'
44
44
  export * from './queue'
45
45
  export * from './reactivity'
46
- export * from './request'
47
46
  export * from './router'
48
47
  export * from './scheduler'
49
48
  export * from './search-engine'
package/src/model.ts CHANGED
@@ -25,27 +25,37 @@ interface Base {}
25
25
  export interface ModelOptions extends Base {
26
26
  name: string // defaults to the file name of the model
27
27
  table: string // defaults to the lowercase, plural name of the model
28
- useUuid: boolean
28
+ primaryKey?: string // defaults to `id`
29
+ autoIncrement?: boolean // defaults to true
30
+
31
+ traits: {
32
+ useUuid?: boolean // defaults to false
33
+ useTimestamps?: boolean | TimestampOptions // defaults to true
34
+ useSoftDeletes?: boolean | SoftDeleteOptions // defaults to false
35
+
36
+ useAuth?: boolean | AuthOptions // defaults to false
37
+ authenticatable?: boolean | AuthOptions // useAuth alias
38
+ useSeeder?: boolean | SeedOptions // defaults to a count of 10
39
+ seedable?: boolean | SeedOptions // useSeeder alias
40
+ useSearch?: boolean | SearchEngineSettings // defaults to false
41
+ searchable?: boolean | SearchEngineSettings // useSearch alias
42
+ }
43
+
29
44
  fields: Fields
45
+
46
+ // relationships
30
47
  hasOne: string // hasOne: 'Post'
31
48
  hasMany: {
32
49
  model: string // should be typed as ModelName
33
50
  foreignKey?: string
34
51
  }
52
+ belongsTo: string // belongsTo: 'User'
35
53
  belongsToMany: object
36
54
  hasThrough: {
37
55
  model: string // should be typed as ModelName
38
56
  through: string
39
57
  using: string
40
58
  }
41
- authenticatable: boolean | AuthOptions
42
- seedable: boolean | SeedOptions
43
- searchable: boolean | SearchEngineSettings
44
- useSeed: boolean | SeedOptions
45
- useSearch: boolean | SearchEngineSettings
46
- useSearchEngine: boolean | SearchEngineSettings
47
- useTimestamps: boolean | TimestampOptions
48
- useSoftDeletes: boolean | SoftDeleteOptions
49
59
 
50
60
  attributes: {
51
61
  [key: string]: {
package/src/router.ts CHANGED
@@ -49,10 +49,10 @@ export interface Route {
49
49
  statusCode?: StatusCode
50
50
  }
51
51
 
52
- export interface MiddlewareType {
52
+ export interface MiddlewareOptions {
53
53
  name: string
54
+ description?: string
54
55
  priority: number
55
-
56
56
  handle: Function
57
57
  }
58
58
 
@@ -71,3 +71,23 @@ export interface RouteGroupOptions {
71
71
  prefix?: string
72
72
  middleware?: Route['middleware']
73
73
  }
74
+
75
+ type Prefix = string
76
+
77
+ export interface RouterInterface {
78
+ get: (url: Route['url'], callback: Route['callback']) => Promise<this>
79
+ post: (url: Route['url'], callback: Route['callback']) => this
80
+ view: (url: Route['url'], callback: Route['callback']) => this
81
+ redirect: (url: Route['url'], callback: Route['callback'], status?: RedirectCode) => this
82
+ delete: (url: Route['url'], callback: Route['callback']) => this
83
+ patch: (url: Route['url'], callback: Route['callback']) => this
84
+ put: (url: Route['url'], callback: Route['callback']) => this
85
+ email: (url: Route['url']) => Promise<this>
86
+ health: () => Promise<this>
87
+ job: (url: Route['url']) => Promise<this>
88
+ action: (url: Route['url']) => Promise<this>
89
+ group: (options: Prefix | RouteGroupOptions, callback: () => void) => this
90
+ name: (name: string) => this
91
+ middleware: (middleware: Route['middleware']) => this
92
+ getRoutes: () => Promise<Route[]>
93
+ }
package/src/scheduler.ts CHANGED
@@ -1 +1 @@
1
- export type { Schedule, Scheduler } from '@stacksjs/scheduler'
1
+ export type { Schedule } from '@stacksjs/scheduler'
package/src/services.ts CHANGED
@@ -35,10 +35,6 @@ export interface ServicesOptions {
35
35
  apiKey: string
36
36
  region: string
37
37
  }
38
-
39
- novu?: {
40
- key: string
41
- }
42
38
  }
43
39
 
44
40
  export type ServicesConfig = Partial<ServicesOptions>
package/src/sms.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { ISmsOptions as SmsOptions } from '@novu/stateless'
1
+ // import type { ISmsOptions as SmsOptions } from '@novu/stateless'
2
2
 
3
- export type { SmsOptions }
3
+ // export type { SmsOptions }
4
4
 
5
- export type SmsConfig = SmsOptions
5
+ // export type SmsConfig = SmsOptions
package/src/request.ts DELETED
@@ -1,3 +0,0 @@
1
- export interface Request {
2
- [key: string]: any
3
- }