@stacksjs/types 0.66.0 → 0.68.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.
Files changed (80) hide show
  1. package/dist/ai.d.ts +17 -14
  2. package/dist/analytics.d.ts +12 -14
  3. package/dist/api.d.ts +25 -66
  4. package/dist/app.d.ts +29 -134
  5. package/dist/auto-imports.d.ts +1 -1
  6. package/dist/binary.d.ts +7 -10
  7. package/dist/build.d.ts +2 -2
  8. package/dist/cache.d.ts +48 -61
  9. package/dist/cdn.d.ts +3 -15
  10. package/dist/chat.d.ts +2 -2
  11. package/dist/cli.d.ts +252 -238
  12. package/dist/cloud.d.ts +305 -68
  13. package/dist/components.d.ts +11 -59
  14. package/dist/configure.d.ts +11 -11
  15. package/dist/cron-jobs.d.ts +34 -41
  16. package/dist/database.d.ts +50 -45
  17. package/dist/dependencies.d.ts +15 -61
  18. package/dist/deploy.d.ts +10 -16
  19. package/dist/dns.d.ts +349 -167
  20. package/dist/docs.d.ts +20 -19
  21. package/dist/email.d.ts +15 -10
  22. package/dist/errors.d.ts +87 -69
  23. package/dist/events.d.ts +3 -30
  24. package/dist/exit-code.d.ts +4 -9
  25. package/dist/file-systems.d.ts +52 -56
  26. package/dist/git.d.ts +54 -126
  27. package/dist/hashing.d.ts +30 -97
  28. package/dist/helpers.d.ts +1 -1
  29. package/dist/i18n.d.ts +10 -18
  30. package/dist/index.d.ts +62 -61
  31. package/dist/index.js +1 -4
  32. package/dist/inspect.d.ts +3 -9
  33. package/dist/library.d.ts +798 -139
  34. package/dist/logging.d.ts +5 -27
  35. package/dist/manifest.d.ts +6 -9
  36. package/dist/model-names.d.ts +1 -1
  37. package/dist/model.d.ts +150 -130
  38. package/dist/notifications.d.ts +150 -105
  39. package/dist/pages.d.ts +10 -10
  40. package/dist/payments.d.ts +84 -55
  41. package/dist/ports.d.ts +13 -20
  42. package/dist/promise.d.ts +1 -1
  43. package/dist/push.d.ts +34 -30
  44. package/dist/pwa.d.ts +3 -7
  45. package/dist/queue.d.ts +36 -33
  46. package/dist/reactivity.d.ts +1 -1
  47. package/dist/request.d.ts +39 -26
  48. package/dist/router.d.ts +51 -51
  49. package/dist/saas.d.ts +32 -0
  50. package/dist/scheduler.d.ts +1 -1
  51. package/dist/search-engine.d.ts +85 -111
  52. package/dist/security.d.ts +18 -16
  53. package/dist/server.d.ts +16 -6
  54. package/dist/services.d.ts +34 -28
  55. package/dist/settings-config.d.ts +8 -8
  56. package/dist/ssg.d.ts +3 -2
  57. package/dist/stacks.d.ts +53 -203
  58. package/dist/storage.d.ts +29 -11
  59. package/dist/tables.d.ts +34 -52
  60. package/dist/team.d.ts +7 -8
  61. package/dist/ui.d.ts +39 -162
  62. package/dist/utils.d.ts +20 -30
  63. package/package.json +9 -10
  64. package/src/cache.ts +18 -0
  65. package/src/cli.ts +4 -0
  66. package/src/cloud.ts +16 -4
  67. package/src/errors.ts +8 -0
  68. package/src/index.ts +1 -0
  69. package/src/model-names.ts +1 -1
  70. package/src/model.ts +6 -0
  71. package/src/payments.ts +32 -0
  72. package/src/router.ts +1 -2
  73. package/src/saas.ts +33 -0
  74. package/src/stacks.ts +10 -0
  75. package/src/storage.ts +27 -0
  76. package/dist/env.d.ts +0 -0
  77. package/dist/index.js.map +0 -20
  78. package/dist/layout.d.ts +0 -0
  79. package/dist/native.d.ts +0 -0
  80. package/dist/sms.d.ts +0 -0
@@ -1,60 +1,89 @@
1
- export interface PaymentOptions {
2
- driver: "stripe";
1
+ import type { Stripe } from 'stripe';
2
+
3
+ export declare interface PaymentOptions {
4
+ driver: 'stripe'
5
+
6
+ stripe: {
7
+ publishableKey: string
8
+ secretKey: string
9
+ }
3
10
  }
4
- export type PaymentConfig = Partial<PaymentOptions>;
5
- export interface ChargeOptions {
6
- currency?: string;
7
- source?: string;
8
- description?: string;
9
- chargeId?: string;
10
- limit?: number;
11
- metadata?: object;
12
- searchOptions: {
13
- query?: string;
14
- limit?: number;
15
- };
11
+ export declare type PaymentConfig = Partial<PaymentOptions>
12
+ export declare interface ChargeOptions {
13
+ currency?: string
14
+ source?: string
15
+ description?: string
16
+ chargeId?: string
17
+ limit?: number
18
+ metadata?: object
19
+ searchOptions: {
20
+ query?: string
21
+ limit?: number
22
+ }
16
23
  }
17
- export interface CustomerOptions {
18
- description?: string;
19
- address?: string;
20
- email?: string;
21
- metadata?: object;
22
- name?: string;
23
- payment_method?: string;
24
- shipping: string;
25
- listOptions?: {
26
- created?: object;
27
- ending_before?: string;
28
- limit?: number;
29
- starting_after?: string;
30
- test_clock?: string;
31
- };
32
- searchOptions?: {
33
- query?: string;
34
- limit?: number;
35
- page?: number;
36
- };
24
+ export declare interface StripeCustomerOptions {
25
+ address?: {
26
+ line1?: string
27
+ city?: string
28
+ state?: string
29
+ postal_code?: string
30
+ country?: string
31
+ }
32
+ name?: string
33
+ phone?: string
34
+ metadata?: Stripe.Emptyable<Stripe.MetadataParam>
35
+ email?: string
36
+ preferred_locales?: string[]
37
37
  }
38
- export interface DisputeOptions {
39
- dp_id?: string;
40
- metadata?: object;
41
- listOptions?: {
42
- charge?: string;
43
- payment_intent?: string;
44
- created?: string;
45
- ending_before?: string;
46
- limit?: number;
47
- starting_after?: string;
48
- };
38
+ export declare interface CustomerOptions {
39
+ description?: string
40
+ address?: string
41
+ email?: string
42
+ metadata?: object
43
+ name?: string
44
+ payment_method?: string
45
+ shipping: string
46
+ listOptions?: {
47
+ created?: object
48
+ ending_before?: string
49
+ limit?: number
50
+ starting_after?: string
51
+ test_clock?: string
52
+ }
53
+ searchOptions?: {
54
+ query?: string
55
+ limit?: number
56
+ page?: number
57
+ }
49
58
  }
50
- export interface EventOptions {
51
- event_id?: string;
52
- listOptions?: {
53
- created?: object;
54
- delivery_success?: boolean;
55
- ending_before?: string;
56
- limit?: number;
57
- starting_after?: string;
58
- type?: string;
59
- };
59
+ export declare interface DisputeOptions {
60
+ dp_id?: string
61
+ metadata?: object
62
+ listOptions?: {
63
+ charge?: string
64
+ payment_intent?: string
65
+ created?: string
66
+ ending_before?: string
67
+ limit?: number
68
+ starting_after?: string
69
+ }
60
70
  }
71
+ export declare interface EventOptions {
72
+ event_id?: string
73
+ listOptions?: {
74
+ created?: object
75
+ delivery_success?: boolean
76
+ ending_before?: string
77
+ limit?: number
78
+ starting_after?: string
79
+ type?: string
80
+ }
81
+ }
82
+ export declare interface CheckoutLineItem {
83
+ priceId: string
84
+ quantity: number
85
+ }
86
+ export declare interface CheckoutOptions extends Partial<Stripe.Checkout.SessionCreateParams> {
87
+ enableTax?: boolean
88
+ allowPromotions?: boolean
89
+ }
package/dist/ports.d.ts CHANGED
@@ -1,20 +1,13 @@
1
- /**
2
- * **Stacks Ports**
3
- *
4
- * This port is used by the Stacks servers when running your application, library, email services,
5
- * and other services. You may change this port to any other port that is free
6
- * on your machine, as long as the following 6 ports are also available.
7
- */
8
- export interface Ports {
9
- frontend: number;
10
- backend: number;
11
- admin: number;
12
- library: number;
13
- desktop: number;
14
- email: number;
15
- docs: number;
16
- inspect: number;
17
- api: number;
18
- systemTray: number;
19
- database: number;
20
- }
1
+ export declare interface Ports {
2
+ frontend: number
3
+ backend: number
4
+ admin: number
5
+ library: number
6
+ desktop: number
7
+ email: number
8
+ docs: number
9
+ inspect: number
10
+ api: number
11
+ systemTray: number
12
+ database: number
13
+ }
package/dist/promise.d.ts CHANGED
@@ -1 +1 @@
1
- export type MaybePromise<T> = T | Promise<T>;
1
+ export declare type MaybePromise<T> = T | Promise<T>
package/dist/push.d.ts CHANGED
@@ -1,31 +1,35 @@
1
- export interface FCMPushNotificationOptions {
2
- eventName: string;
3
- to: { subscriberId: string };
4
- payload: {
5
- deviceTokens: Array<string>;
6
- badge: boolean;
7
- clickAction: string;
8
- color: string;
9
- icon: string;
10
- sound: string;
11
- };
12
- }
13
- export interface ExpoPushNotificationOptions {
14
- eventName: string;
15
- to: { subscriberId: string };
16
- payload: {
17
- to: string[];
18
- data: object;
19
- title: string;
20
- body: string;
21
- ttl: number;
22
- expiration: number;
23
- priority: "default" | "normal" | "high";
24
- subtitle: string;
25
- sound: "default" | null;
26
- badge: number;
27
- channelId: string;
28
- categoryId: string;
29
- mutableContent: boolean;
30
- };
1
+ export declare interface FCMPushNotificationOptions {
2
+ eventName: string
3
+ to: {
4
+ subscriberId: string
5
+ }
6
+ payload: {
7
+ deviceTokens: Array<string>
8
+ badge: boolean
9
+ clickAction: string
10
+ color: string
11
+ icon: string
12
+ sound: string
13
+ }
31
14
  }
15
+ export declare interface ExpoPushNotificationOptions {
16
+ eventName: string
17
+ to: {
18
+ subscriberId: string
19
+ }
20
+ payload: {
21
+ to: string[]
22
+ data: object
23
+ title: string
24
+ body: string
25
+ ttl: number
26
+ expiration: number
27
+ priority: 'default' | 'normal' | 'high'
28
+ subtitle: string
29
+ sound: 'default' | null
30
+ badge: number
31
+ channelId: string
32
+ categoryId: string
33
+ mutableContent: boolean
34
+ }
35
+ }
package/dist/pwa.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- import type { Options } from "vite-plugin-pwa";
2
- /**
3
- * **PWA Options**
4
- *
5
- * The PWA options.
6
- */
7
- export type PwaOptions = Options;
1
+ import type { Options } from 'vite-plugin-pwa';
2
+
3
+ export declare type PwaOptions = Options
package/dist/queue.d.ts CHANGED
@@ -1,34 +1,37 @@
1
- import type { DeepPartial } from "./utils";
2
- export interface QueueOptions {
3
- default: "sync" | "database" | "redis" | "sqs";
4
- connections: {
5
- sync: { driver: "sync" };
6
- database: {
7
- driver: "database";
8
- table: "jobs";
9
- queue: "default";
10
- retry_after: 90;
11
- };
12
- redis: {
13
- driver: "redis";
14
- connection: "default";
15
- queue: "default";
16
- retry_after: 90;
17
- };
18
- sqs: {
19
- driver: "sqs";
20
- key: "";
21
- secret: "";
22
- prefix: "";
23
- suffix: "";
24
- queue: "default";
25
- region: "us-east-1";
26
- };
27
- };
28
- failed: {
29
- driver: "database";
30
- database: "mysql";
31
- table: "failed_jobs";
32
- };
1
+ import type { DeepPartial } from './utils';
2
+
3
+ export declare interface QueueOptions {
4
+ default: 'sync' | 'database' | 'redis' | 'sqs'
5
+ connections: {
6
+ sync: {
7
+ driver: 'sync'
8
+ }
9
+ database: {
10
+ driver: 'database'
11
+ table: 'jobs'
12
+ queue: 'default'
13
+ retry_after: 90
14
+ }
15
+ redis: {
16
+ driver: 'redis'
17
+ connection: 'default'
18
+ queue: 'default'
19
+ retry_after: 90
20
+ }
21
+ sqs: {
22
+ driver: 'sqs'
23
+ key: ''
24
+ secret: ''
25
+ prefix: ''
26
+ suffix: ''
27
+ queue: 'default'
28
+ region: 'us-east-1'
29
+ }
30
+ }
31
+ failed: {
32
+ driver: 'database'
33
+ database: 'mysql'
34
+ table: 'failed_jobs'
35
+ }
33
36
  }
34
- export type QueueConfig = DeepPartial<QueueOptions>;
37
+ export declare type QueueConfig = DeepPartial<QueueOptions>
@@ -1 +1 @@
1
- export type { Ref } from "vue";
1
+ export type { Ref } from 'vue';
package/dist/request.d.ts CHANGED
@@ -1,30 +1,43 @@
1
- import type { VineType } from "@stacksjs/types";
2
- export type * from "../../../types/requests";
1
+ import type { VineType } from '@stacksjs/types';
2
+
3
+ export declare type * from '../../../types/requests'
3
4
  interface RequestData {
4
- [key: string]: any;
5
+ [key: string]: any
5
6
  }
6
- type RouteParams = { [key: string]: string | number } | null;
7
- interface ValidationField {
8
- rule: VineType;
9
- message: Record<string, string>;
7
+ declare type RouteParams = { [key: string]: string | number } | null
8
+ declare interface ValidationField {
9
+ rule: VineType
10
+ message: Record<string, string>
10
11
  }
11
- interface CustomAttributes {
12
- [key: string]: ValidationField;
12
+ declare interface CustomAttributes {
13
+ [key: string]: ValidationField
13
14
  }
14
- export interface RequestInstance {
15
- addQuery: (url: URL) => void;
16
- addBodies: (params: any) => void;
17
- addParam: (param: RouteParams) => void;
18
- get: <T>(element: T) => string | undefined;
19
- header: (element: string) => string | number | boolean | null;
20
- Header: (element: string) => string | number | boolean | null;
21
- all: () => RequestData;
22
- validate: (attributes: CustomAttributes) => void;
23
- has: (element: string) => boolean;
24
- isEmpty: () => boolean;
25
- extractParamsFromRoute: (routePattern: string, pathname: string) => void;
26
- getParam: (key: string) => number | string | null;
27
- getParams: () => RouteParams;
28
- getParamAsInt: (key: string) => number | null;
29
- }
30
- export {};
15
+ export declare interface RequestInstance {
16
+ addQuery: (url: URL) => void
17
+
18
+ addBodies: (params: any) => void
19
+
20
+ addParam: (param: RouteParams) => void
21
+
22
+ get: <T>(element: T) => string | undefined
23
+
24
+ header: (element: string) => string | number | boolean | null
25
+
26
+ Header: (element: string) => string | number | boolean | null
27
+
28
+ all: () => RequestData
29
+
30
+ validate: (attributes: CustomAttributes) => void
31
+
32
+ has: (element: string) => boolean
33
+
34
+ isEmpty: () => boolean
35
+
36
+ extractParamsFromRoute: (routePattern: string, pathname: string) => void
37
+
38
+ getParam: (key: string) => number | string | null
39
+
40
+ getParams: () => RouteParams
41
+
42
+ getParamAsInt: (key: string) => number | null
43
+ }
package/dist/router.d.ts CHANGED
@@ -1,55 +1,55 @@
1
- import type { Action } from "@stacksjs/actions";
2
- type ActionPath = string;
3
- export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "before" | "after" | "view";
4
- export type RouteCallback = (params?: Record<string, any>) => any | string | object;
5
- export interface Route {
6
- name: string;
7
- uri: string;
8
- url: string;
9
- path?: string;
10
- prefix?: string;
11
- method: HttpMethod;
12
- pattern: RegExp;
13
- callback: RouteCallback | ActionPath | Action | Promise<any>;
14
- paramNames: string[];
15
- middleware?: string | string[];
16
- statusCode?: StatusCode;
1
+ import type { Action } from '@stacksjs/actions';
2
+
3
+ declare type ActionPath = string
4
+ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'before' | 'after' | 'view'
5
+ export declare type RouteCallback = (params?: Record<string, any>) => any | string | object
6
+ export declare interface Route {
7
+ name: string
8
+ uri: string
9
+ url: string
10
+ path?: string
11
+ prefix?: string
12
+ method: HttpMethod
13
+ pattern: RegExp
14
+ callback: RouteCallback | ActionPath | Action | Promise<any>
15
+ paramNames: string[]
16
+ middleware?: string | string[]
17
+ statusCode?: StatusCode
17
18
  }
18
- export interface MiddlewareOptions {
19
- name: string;
20
- description?: string;
21
- priority: number;
22
- handle: Function;
19
+ export declare interface MiddlewareOptions {
20
+ name: string
21
+ description?: string
22
+ priority: number
23
+ handle: Function
23
24
  }
24
- export type StatusCode = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 500;
25
- export type RedirectCode = Extract<StatusCode, 301 | 302>;
26
- export type RouteParam = { [key: string]: string | number } | null;
27
- export type MiddlewareFn = () => void;
28
- export interface Middlewares {
29
- logger: MiddlewareFn;
30
- auth: MiddlewareFn;
31
- [key: string]: MiddlewareFn;
25
+ export declare type StatusCode = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 500
26
+ export type RedirectCode = Extract<StatusCode, 301 | 302>
27
+ export declare type RouteParam = { [key: string]: string | number } | null
28
+ export declare type MiddlewareFn = () => void
29
+ export declare interface Middlewares {
30
+ logger: MiddlewareFn
31
+ auth: MiddlewareFn
32
+ [key: string]: MiddlewareFn
32
33
  }
33
- export interface RouteGroupOptions {
34
- prefix?: string;
35
- middleware?: Route["middleware"];
34
+ export declare interface RouteGroupOptions {
35
+ prefix?: string
36
+ middleware?: Route['middleware']
36
37
  }
37
- type Prefix = string;
38
- export interface RouterInterface {
39
- get: (url: Route["url"], callback: Route["callback"]) => this;
40
- post: (url: Route["url"], callback: Route["callback"]) => this;
41
- view: (url: Route["url"], callback: Route["callback"]) => this;
42
- redirect: (url: Route["url"], callback: Route["callback"], status?: RedirectCode) => this;
43
- delete: (url: Route["url"], callback: Route["callback"]) => this;
44
- patch: (url: Route["url"], callback: Route["callback"]) => this;
45
- put: (url: Route["url"], callback: Route["callback"]) => this;
46
- email: (url: Route["url"]) => Promise<this>;
47
- health: () => Promise<this>;
48
- job: (url: Route["url"]) => Promise<this>;
49
- action: (url: Route["url"]) => Promise<this>;
50
- group: (options: Prefix | RouteGroupOptions, callback: () => void) => this;
51
- name: (name: string) => this;
52
- middleware: (middleware: Route["middleware"]) => this;
53
- getRoutes: () => Promise<Route[]>;
54
- }
55
- export {};
38
+ declare type Prefix = string
39
+ export declare interface RouterInterface {
40
+ get: (url: Route['url'], callback: Route['callback']) => this
41
+ post: (url: Route['url'], callback: Route['callback']) => this
42
+ view: (url: Route['url'], callback: Route['callback']) => this
43
+ redirect: (url: Route['url'], callback: Route['callback'], status?: RedirectCode) => this
44
+ delete: (url: Route['url'], callback: Route['callback']) => this
45
+ patch: (url: Route['url'], callback: Route['callback']) => this
46
+ put: (url: Route['url'], callback: Route['callback']) => this
47
+ email: (url: Route['url']) => Promise<this>
48
+ health: () => Promise<this>
49
+ job: (url: Route['url']) => Promise<this>
50
+ action: (url: Route['url']) => Promise<this>
51
+ group: (options: Prefix | RouteGroupOptions, callback: () => void) => this
52
+ name: (name: string) => this
53
+ middleware: (middleware: Route['middleware']) => this
54
+ getRoutes: () => Promise<Route[]>
55
+ }
package/dist/saas.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ export declare interface SaasOption {
2
+ plans: {
3
+ productName: string
4
+ description: string
5
+ pricing: {
6
+ key: string
7
+ price: number
8
+ interval: 'day' | 'month' | 'week' | 'year'
9
+ currency: string
10
+ }[]
11
+ metadata: {
12
+ createdBy: string
13
+ version: string
14
+ }
15
+ }[]
16
+ webhook: {
17
+ endpoint: string
18
+ secret: string
19
+ }
20
+ currencies: string[]
21
+ coupons: {
22
+ code: string
23
+ amountOff: number
24
+ duration: 'once' | 'repeating' | 'forever'
25
+ }[]
26
+ products: {
27
+ name: string
28
+ description: string
29
+ images: string[]
30
+ }[]
31
+ }
32
+ export declare type SaasConfig = Partial<SaasOption>
@@ -1 +1 @@
1
- export type { Schedule } from "@stacksjs/scheduler";
1
+ export type { Schedule } from '@stacksjs/scheduler';