@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
package/dist/ai.d.ts CHANGED
@@ -1,15 +1,18 @@
1
- type AiModel = "amazon.titan-embed-text-v1" | "amazon.titan-text-lite-v1" | "amazon.titan-text-express-v1" | "amazon.titan-embed-image-v1" | "amazon.titan-image-generator-v1" | "anthropic.claude-v1" | "anthropic.claude-v2" | "anthropic.claude-v2:1" | "anthropic.claude-instant-v1" | "meta.llama2-13b-chat-v1" | "meta.llama2-70b-chat-v1";
2
- /**
3
- * **AI Options**
4
- *
5
- * This configuration defines all of your AI options. Because Stacks is fully-typed, you
6
- * may hover any of the options below and the definitions will be provided. In case you
7
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
8
- */
9
- export interface AiOptions {
10
- default: AiModel;
11
- models: AiModel[];
12
- deploy: boolean;
1
+ declare type AiModel =
2
+ | 'amazon.titan-embed-text-v1'
3
+ | 'amazon.titan-text-lite-v1'
4
+ | 'amazon.titan-text-express-v1'
5
+ | 'amazon.titan-embed-image-v1'
6
+ | 'amazon.titan-image-generator-v1'
7
+ | 'anthropic.claude-v1'
8
+ | 'anthropic.claude-v2'
9
+ | 'anthropic.claude-v2:1'
10
+ | 'anthropic.claude-instant-v1'
11
+ | 'meta.llama2-13b-chat-v1'
12
+ | 'meta.llama2-70b-chat-v1'
13
+ export declare interface AiOptions {
14
+ default: AiModel
15
+ models: AiModel[]
16
+ deploy: boolean
13
17
  }
14
- export type AiConfig = Partial<AiOptions>;
15
- export {};
18
+ export declare type AiConfig = Partial<AiOptions>
@@ -1,15 +1,13 @@
1
- /**
2
- * **Analytics Options**
3
- *
4
- * This configuration defines all of your Analytics options. Because Stacks is fully-typed, you
5
- * may hover any of the options below and the definitions will be provided. In case you
6
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
7
- */
8
- export interface AnalyticsOptions {
9
- driver: "google-analytics" | "fathom";
10
- drivers: {
11
- googleAnalytics?: { trackingId: string };
12
- fathom?: { siteId: string };
13
- };
1
+ export declare interface AnalyticsOptions {
2
+ driver: 'google-analytics' | 'fathom'
3
+
4
+ drivers: {
5
+ googleAnalytics?: {
6
+ trackingId: string
7
+ }
8
+ fathom?: {
9
+ siteId: string
10
+ }
11
+ }
14
12
  }
15
- export type AnalyticsConfig = Partial<AnalyticsOptions>;
13
+ export declare type AnalyticsConfig = Partial<AnalyticsOptions>
package/dist/api.d.ts CHANGED
@@ -1,67 +1,26 @@
1
- /**
2
- * **API Options**
3
- *
4
- * This configuration defines all of your API options. Because Stacks is fully-typed, you
5
- * may hover any of the options below and the definitions will be provided. In case you
6
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
7
- */
8
- export interface ApiOptions {
9
- /**
10
- * **API Description**
11
- *
12
- * This value defines the description for your API.
13
- *
14
- * @default "Stacks API"
15
- */
16
- description: string;
17
- /**
18
- * **API Prefix**
19
- *
20
- * This value defines the prefix for all of your API routes. For example, if you set
21
- * this value to `api`, all of your API routes will be prefixed with `/api`. This
22
- * value is useful for when you want to version your API.
23
- *
24
- * @default string "api"
25
- * @example string "api/v1"
26
- */
27
- prefix: string;
28
- middleware: string[];
29
- routes: {
30
- index: boolean;
31
- show: boolean;
32
- store: boolean;
33
- update: boolean;
34
- destroy: boolean;
35
- } | boolean;
36
- /**
37
- * **API Prewarm**
38
- *
39
- * This configuration determines the prewarming behavior of your API. Prewarming eliminates
40
- * cold starts in your API. If this value is set to `true`, the API will be prewarmed
41
- * every 5 minutes. If you provide a number, Stacks will prewarm the
42
- * specified number of containers every 5 minutes.
43
- *
44
- * @default true
45
- * @example false
46
- * @example 10
47
- */
48
- prewarm: boolean | number;
49
- /**
50
- * **API Memory Size**
51
- *
52
- * This value defines the memory size for your API.
53
- *
54
- * @default 512
55
- */
56
- memorySize: number;
57
- /**
58
- * **API Timeout**
59
- *
60
- * This value defines the timeout for your API.
61
- *
62
- * @default 30
63
- */
64
- timeout: number;
65
- deploy: boolean;
1
+ export declare interface ApiOptions {
2
+ description: string
3
+
4
+ prefix: string
5
+
6
+ middleware: string[]
7
+
8
+ routes:
9
+ | {
10
+ index: boolean
11
+ show: boolean
12
+ store: boolean
13
+ update: boolean
14
+ destroy: boolean
15
+ }
16
+ | boolean
17
+
18
+ prewarm: boolean | number
19
+
20
+ memorySize: number
21
+
22
+ timeout: number
23
+
24
+ deploy: boolean
66
25
  }
67
- export type ApiConfig = Partial<ApiOptions>;
26
+ export declare type ApiConfig = Partial<ApiOptions>
package/dist/app.d.ts CHANGED
@@ -1,135 +1,30 @@
1
- export type AppEnvType = "local" | "dev" | "stage" | "prod" | "testing" | string;
2
- /**
3
- * **Application Options**
4
- *
5
- * This configuration defines all of your application options. Because Stacks is fully-typed,
6
- * you may hover any of the options below and the definitions will be provided. In case
7
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
8
- */
9
- export interface AppOptions {
10
- /**
11
- * **Application Name**
12
- *
13
- * This value is the name of your application. This value is used when the
14
- * framework needs to place the application's name in a log or any
15
- * other location as required by the application or its packages.
16
- *
17
- * @default string "Stacks"
18
- */
19
- name: string;
20
- /**
21
- * **Application Description**
22
- *
23
- * This value is the description of your application. This value is used when the
24
- * framework generates meta tags for the frontend.
25
- */
26
- description: string;
27
- /**
28
- * **Application Environment**
29
- *
30
- * This value determines the "environment" your application is currently
31
- * running in. This may determine how you prefer to configure various
32
- * services the application utilizes. Set this in your ".env" file
33
- *
34
- * @default "local"
35
- */
36
- env: AppEnvType;
37
- /**
38
- * **Application URL**
39
- *
40
- * This URL is used by the console to properly generate URLs when using
41
- * the Buddy command line tool. You should set this to the root of
42
- * your application so that it is used when running Buddy tasks.
43
- *
44
- * @default string "stacks.localhost"
45
- * @example "my-project.test"
46
- */
47
- url: string;
48
- /**
49
- * **Redirect URLs**
50
- *
51
- * A Redirect URL is a URL that permanently redirects to the Application URL.
52
- * This is useful for when you have multiple domains that you want to redirect
53
- * to your application. You can set this to a string or an array of strings.
54
- *
55
- * @default []
56
- * @example "['stacksjs.com', 'stacksjs.dev']"
57
- */
58
- redirectUrls: string | string[];
59
- /**
60
- * **Application Debug Mode**
61
- *
62
- * When your application is in debug mode, detailed error messages with
63
- * stack traces will be shown on every error that occurs within your
64
- * application. If disabled, a simple generic error page is shown.
65
- *
66
- * @default true
67
- */
68
- debug: boolean;
69
- /**
70
- * **Maintenance Mode**
71
- *
72
- * When your application is in maintenance mode, a simple maintenance
73
- * page will be shown on every request into your application.
74
- *
75
- * @default false
76
- */
77
- maintenanceMode: boolean;
78
- /**
79
- * **Encryption Key**
80
- *
81
- * This key is used by the Stacks encrypter service and should be set to
82
- * a random, 32 character string, otherwise these encrypted strings will
83
- * not be safe. Please do this before deploying an application!
84
- */
85
- key: string;
86
- /**
87
- * **Application Timezone**
88
- *
89
- * Here you may specify the default timezone for your application, which
90
- * will be used by Stacks and date-time functions. We have gone ahead
91
- * and set this to a sensible default for you out of the box.
92
- *
93
- * @default string "UTC"
94
- */
95
- timezone: string;
96
- /**
97
- * **Application Locale Configuration**
98
- *
99
- * The application locale determines the default locale that will be used
100
- * by the translation service provider. You are free to set this value
101
- * to any of the locales which will be supported by the application.
102
- *
103
- * @default string "en"
104
- * @example
105
- * de // ./lang/de.yml needs to be present for this
106
- */
107
- locale: string;
108
- /**
109
- * **Application Fallback Locale**
110
- *
111
- * The fallback locale determines the locale to use when the current one
112
- * is not available. You may change the value to correspond to any of
113
- * the language folders that are provided through your application.
114
- *
115
- * @default string "en"
116
- */
117
- fallbackLocale: "en";
118
- /**
119
- * **Cipher**
120
- *
121
- * Description WIP.
122
- *
123
- * @default string "aes-256-cbc"
124
- */
125
- cipher: string;
126
- /**
127
- * **Documentation Mode**
128
- *
129
- * $appUrl becomes your Documentation URL.
130
- *
131
- * @default false
132
- */
133
- docMode: boolean;
1
+ export declare type AppEnvType = 'local' | 'dev' | 'stage' | 'prod' | 'testing' | string
2
+ export declare interface AppOptions {
3
+ name: string
4
+
5
+ description: string
6
+
7
+ env: AppEnvType
8
+
9
+ url: string
10
+
11
+ redirectUrls: string | string[]
12
+
13
+ debug: boolean
14
+
15
+ maintenanceMode: boolean
16
+
17
+ key: string
18
+
19
+ timezone: string
20
+
21
+ locale: string
22
+
23
+ fallbackLocale: 'en'
24
+
25
+ cipher: string
26
+
27
+
28
+ docMode: boolean
134
29
  }
135
- export type AppConfig = Partial<AppOptions>;
30
+ export declare type AppConfig = Partial<AppOptions>
@@ -1 +1 @@
1
- export type { Options as AutoImportsOptions } from "unplugin-auto-import/types";
1
+ export type { Options as AutoImportsOptions } from 'unplugin-auto-import/types';
package/dist/binary.d.ts CHANGED
@@ -1,11 +1,8 @@
1
- /**
2
- * The Binary/CLI Options used in `./config/cli.ts`.
3
- */
4
- export interface BinaryOptions {
5
- name: string;
6
- command: string;
7
- description: string;
8
- source: string;
9
- deploy: boolean;
1
+ export declare interface BinaryOptions {
2
+ name: string
3
+ command: string
4
+ description: string
5
+ source: string
6
+ deploy: boolean
10
7
  }
11
- export type BinaryConfig = Partial<BinaryOptions>;
8
+ export declare type BinaryConfig = Partial<BinaryOptions>
package/dist/build.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export type { UserConfig as ViteConfig } from "vite";
2
- export type { ViteSSGContext } from "vite-ssg";
1
+ export type { UserConfig as ViteConfig } from 'vite';
2
+ export type { ViteSSGContext } from 'vite-ssg';
package/dist/cache.d.ts CHANGED
@@ -1,62 +1,49 @@
1
- export interface CacheOptions {
2
- /**
3
- * **Cache Driver**
4
- *
5
- * This value determines the cache driver that will be used by your application to store
6
- * cached data. By default, Stacks uses the "redis" driver, which stores cached data in
7
- * in a self-configufed Redis instance. You may use any of the other drivers provided
8
- * by Stacks or write your own custom driver.
9
- *
10
- * @default "redis"
11
- * @example "redis"
12
- * @example "memcached"
13
- * @example "dynamodb"
14
- *
15
- * @see https://stacks.js.org/docs/cache
16
- */
17
- driver: string;
18
- /**
19
- * **Cache Prefix**
20
- *
21
- * This value determines the prefix that will be used when storing items in the cache. This
22
- * prefix may be useful when multiple applications are sharing the same cache driver so that
23
- * they may avoid collisions when attempting to retrieve items from the cache.
24
- *
25
- * @default string "stacks"
26
- * @example "stacks"
27
- *
28
- * @see https://stacks.js.org/docs/cache
29
- */
30
- prefix: string;
31
- /**
32
- * **Cache TTL**
33
- *
34
- * This value determines the default time to live for items stored in the cache. This value
35
- * may be overridden when storing items in the cache. If no value is specified, the cache
36
- * driver will default to a reasonable time to live for the given item.
37
- *
38
- * @default number 3600
39
- * @example 3600
40
- * @example 3600 * 24
41
- * @example -1 (never expires)
42
- */
43
- ttl: number;
44
- drivers: {
45
- redis?: {
46
- connection: string;
47
- host: string;
48
- port: number;
49
- username: string;
50
- password: string;
51
- };
52
- memcached?: object;
53
- dynamodb?: {
54
- key: string;
55
- secret: string;
56
- region: string;
57
- table: string;
58
- endpoint: string;
59
- };
60
- };
1
+ import type { BentoCache } from 'bentocache';
2
+
3
+ export declare interface CacheOptions {
4
+ driver: string
5
+
6
+ prefix: string
7
+
8
+ ttl: number
9
+
10
+ drivers: {
11
+ redis?: {
12
+ connection: string
13
+
14
+ host: string
15
+
16
+ port: number
17
+
18
+ username: string
19
+
20
+ password: string
21
+ }
22
+
23
+ memcached?: object
24
+
25
+ dynamodb?: {
26
+ key: string
27
+ secret: string
28
+ region: string
29
+ table: string
30
+ endpoint: string
31
+ }
32
+ }
61
33
  }
62
- export type CacheConfig = Partial<CacheOptions>;
34
+ export declare type CacheConfig = Partial<CacheOptions>
35
+ export declare interface CacheDriver {
36
+ set: (key: string, value: string, ttl?: number) => Promise<void>
37
+ setForever: (key: string, value: string, ttl?: number) => Promise<void>
38
+ get: (key: string) => Promise<string | undefined | null>
39
+ getOrSet: (key: string, value: string) => Promise<string | undefined | null>
40
+ remove: (key: string) => Promise<void>
41
+ has: (key: string) => Promise<boolean>
42
+ missing: (key: string) => Promise<boolean>
43
+ del: (key: string) => Promise<void>
44
+ deleteMany: (keys: string[]) => Promise<void>
45
+ clear: () => Promise<void>
46
+ deleteAll: () => Promise<void>
47
+ disconnect: () => Promise<void>
48
+ client: BentoCache<Record<string, any>>
49
+ }
package/dist/cdn.d.ts CHANGED
@@ -1,16 +1,4 @@
1
- export interface CdnOptions {
2
- /**
3
- * **CDN Driver**
4
- *
5
- * This value determines the default CDN driver that will be used when interacting with the
6
- * CDN service. This value may be overridden when interacting with the CDN service.
7
- *
8
- * @default "cloudfront"
9
- * @example "cloudfront"
10
- * @example "fastly" wip
11
- *
12
- * @see https://stacks.js.org/docs/cdn
13
- */
14
- driver: string;
1
+ export declare interface CdnOptions {
2
+ driver: string
15
3
  }
16
- export type CdnConfig = Partial<CdnOptions>;
4
+ export declare type CdnConfig = Partial<CdnOptions>
package/dist/chat.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- interface ChatOptions {}
2
1
  export type { ChatOptions };
3
- export type ChatConfig = ChatOptions;
2
+ declare interface ChatOptions {}
3
+ export declare type ChatConfig = ChatOptions