@stacksjs/types 0.50.0 → 0.52.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/index.mjs CHANGED
@@ -1,11 +1,15 @@
1
1
  export * from "./app.mjs";
2
2
  export * from "./auto-imports.mjs";
3
3
  export * from "./build.mjs";
4
- export * from "./components.mjs";
4
+ export * from "./cache.mjs";
5
+ export * from "./cdn.mjs";
5
6
  export * from "./cli.mjs";
7
+ export * from "./components.mjs";
8
+ export * from "./cron-jobs.mjs";
6
9
  export * from "./database.mjs";
7
- export * from "./deploy.mjs";
8
10
  export * from "./debug.mjs";
11
+ export * from "./deploy.mjs";
12
+ export * from "./dns.mjs";
9
13
  export * from "./docs.mjs";
10
14
  export * from "./errors.mjs";
11
15
  export * from "./events.mjs";
@@ -19,13 +23,17 @@ export * from "./layout.mjs";
19
23
  export * from "./library.mjs";
20
24
  export * from "./manifest.mjs";
21
25
  export * from "./markdown.mjs";
26
+ export * from "./model.mjs";
22
27
  export * from "./notifications.mjs";
23
28
  export * from "./pages.mjs";
29
+ export * from "./payments.mjs";
24
30
  export * from "./promise.mjs";
25
31
  export * from "./pwa.mjs";
26
32
  export * from "./reactivity.mjs";
33
+ export * from "./router.mjs";
27
34
  export * from "./search-engine.mjs";
28
35
  export * from "./ssg.mjs";
36
+ export * from "./stacks.mjs";
29
37
  export * from "./tables.mjs";
30
38
  export * from "./ui.mjs";
31
39
  export * from "./utils.mjs";
package/dist/library.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { TagsOptions } from '.';
1
+ import type { TagsOptions } from './components';
2
2
  /**
3
3
  * **Library Options**
4
4
  *
5
- * This configuration defines all of your library options. Because Stacks is full-typed, you
5
+ * This configuration defines all of your library options. Because Stacks is fully-typed, you
6
6
  * may hover any of the options below and the definitions will be provided. In case you
7
7
  * have any questions, feel free to reach out via Discord or GitHub Discussions.
8
8
  */
@@ -15,6 +15,10 @@ export interface LibraryOptions {
15
15
  * The name of your organization (parent).
16
16
  */
17
17
  parentName: string | null;
18
+ /**
19
+ * The package registry to use.
20
+ */
21
+ packageRegistry: 'npm';
18
22
  /**
19
23
  * The path of your repository.
20
24
  *
@@ -0,0 +1,41 @@
1
+ import type { ZodBoolean as Boolean, ZodDate as Date, ZodNumber as Number, ZodString as String } from 'zod';
2
+ import type { SearchIndexSettings } from './search-engine';
3
+ export interface SeedOptions {
4
+ count: number;
5
+ }
6
+ export interface TimestampOptions {
7
+ createdAt?: string;
8
+ updatedAt?: string;
9
+ deletedAt?: string;
10
+ }
11
+ /**
12
+ * Model.
13
+ */
14
+ export interface Model {
15
+ name?: string;
16
+ table?: string;
17
+ fields: Fields;
18
+ hasOne?: string;
19
+ hasMany?: string;
20
+ belongsToMany?: string;
21
+ hasThrough?: {
22
+ model: string;
23
+ through: string;
24
+ using: string;
25
+ };
26
+ seedable?: boolean | SeedOptions;
27
+ useSeed?: boolean | SeedOptions;
28
+ searchable?: boolean | SearchIndexSettings;
29
+ useSearch?: boolean | SearchIndexSettings;
30
+ useTimestamps?: boolean | TimestampOptions;
31
+ }
32
+ export interface Fields {
33
+ [key: string]: {
34
+ type: string;
35
+ default?: boolean;
36
+ unique?: boolean;
37
+ required?: boolean;
38
+ factory?: () => any;
39
+ validation?: String | Number | Boolean | Date;
40
+ };
41
+ }
package/dist/model.mjs ADDED
File without changes
@@ -1,112 +1,120 @@
1
- import type { IChatOptions, IEmailOptions, ISendMessageSuccessResponse, ISmsOptions } from '@novu/stateless';
1
+ import type { IEmailOptions } from '@novu/stateless';
2
2
  export interface NotificationOptions {
3
- type?: 'email' | 'sms' | 'chat' | 'push';
4
- driver?: 'sendgrid' | 'emailjs' | 'mailjet' | 'mandrill' | 'netcore' | 'nodemailer' | 'postmark' | 'ses' | 'mailgun' | 'twilio' | 'nexmo' | 'gupshup' | 'plivo' | 'sms77' | 'sns';
3
+ default: 'email' | 'sms' | 'chat' | string;
5
4
  email: {
6
- purgeCSS: boolean;
7
- sendgrid: {
8
- key: string;
9
- from: string;
10
- senderName: string;
11
- };
12
- emailjs: {
13
- from: string;
14
- host: string;
15
- user: string;
16
- password: string;
17
- port: number;
18
- secure: boolean;
19
- };
20
- mailgun: {
21
- key: string;
22
- domain: string;
23
- username: string;
24
- from: string;
25
- };
26
- mailjet: {
27
- key: string;
28
- secret: string;
29
- from: string;
30
- };
31
- mandrill: {
32
- key: string;
33
- from: string;
34
- };
35
- netcore: {
36
- key: string;
37
- from: string;
38
- };
39
- nodemailer: {
40
- from: string;
41
- host: string;
42
- user: string;
43
- password: string;
44
- port: number;
45
- secure: boolean;
46
- };
47
- postmark: {
48
- key: string;
49
- from: string;
50
- };
51
- ses: {
52
- region: string;
53
- key: string;
54
- secret: string;
55
- from: string;
5
+ default: 'emailjs' | 'mailgun' | 'mailjet' | 'mandrill' | 'netcore' | 'nodemailer' | 'postmark' | 'sendgrid' | 'ses' | string;
6
+ from: string;
7
+ to: string;
8
+ drivers: {
9
+ smtp: {
10
+ host: string;
11
+ port: number;
12
+ secure: boolean;
13
+ auth: {
14
+ user: string;
15
+ pass: string;
16
+ };
17
+ };
18
+ sendgrid: {
19
+ key: string;
20
+ senderName: string;
21
+ };
22
+ emailjs: {
23
+ host: string;
24
+ user: string;
25
+ password: string;
26
+ port: number;
27
+ secure: boolean;
28
+ };
29
+ mailgun: {
30
+ key: string;
31
+ domain: string;
32
+ username: string;
33
+ };
34
+ mailjet: {
35
+ key: string;
36
+ secret: string;
37
+ };
38
+ mandrill: {
39
+ key: string;
40
+ };
41
+ netcore: {
42
+ key: string;
43
+ };
44
+ nodemailer: {
45
+ host: string;
46
+ user: string;
47
+ password: string;
48
+ port: number;
49
+ secure: boolean;
50
+ };
51
+ postmark: {
52
+ key: string;
53
+ };
54
+ ses: {
55
+ region: string;
56
+ key: string;
57
+ secret: string;
58
+ };
56
59
  };
57
60
  };
58
61
  sms: {
59
- twilio: {
60
- sid: string;
61
- authToken: string;
62
- from: string;
63
- to: string;
64
- };
65
- nexmo: {
66
- key: string;
67
- secret: string;
68
- from: string;
69
- };
70
- gupshup: {
71
- user: string;
72
- password: string;
73
- };
74
- plivo: {
75
- sid: string;
76
- authToken: string;
77
- from: string;
78
- };
79
- sms77: {
80
- key: string;
81
- from: string;
82
- };
83
- sns: {
84
- region: string;
85
- key: string;
86
- secret: string;
87
- };
88
- telnyx: {
89
- key: string;
90
- messageProfileId: string;
91
- from: string;
92
- };
93
- termii: {
94
- key: string;
95
- from: string;
62
+ default: 'twilio' | 'nexmo' | 'gupshup' | 'plivo' | 'sms77' | 'sns' | 'telnyx' | 'termii' | string;
63
+ from: string;
64
+ to: string;
65
+ drivers: {
66
+ twilio: {
67
+ sid: string;
68
+ authToken: string;
69
+ };
70
+ nexmo: {
71
+ key: string;
72
+ secret: string;
73
+ };
74
+ gupshup: {
75
+ user: string;
76
+ password: string;
77
+ };
78
+ plivo: {
79
+ sid: string;
80
+ authToken: string;
81
+ };
82
+ sms77: {
83
+ key: string;
84
+ };
85
+ sns: {
86
+ region: string;
87
+ key: string;
88
+ secret: string;
89
+ };
90
+ telnyx: {
91
+ key: string;
92
+ messageProfileId: string;
93
+ };
94
+ termii: {
95
+ key: string;
96
+ };
96
97
  };
97
98
  };
98
99
  chat: {
99
- slack: {
100
- appId: string;
101
- clientId: string;
102
- secret: string;
100
+ default: 'slack' | 'msTeams' | 'discord' | string;
101
+ from: string;
102
+ to: string;
103
+ drivers: {
104
+ slack?: {
105
+ appId: string;
106
+ clientId: string;
107
+ secret: string;
108
+ };
109
+ msTeams?: {
110
+ appId: string;
111
+ clientId: string;
112
+ secret: string;
113
+ };
114
+ discord?: {};
103
115
  };
104
116
  };
105
117
  }
106
- export type EmailOptions = IEmailOptions;
107
- export type SendMessageSuccessResponse = ISendMessageSuccessResponse;
108
- export type ChatOptions = IChatOptions;
109
- export type SmsOptions = ISmsOptions;
110
118
  export interface FCMPushNotificationOptions {
111
119
  eventName: string;
112
120
  to: {
@@ -142,3 +150,15 @@ export interface ExpoPushNotificationOptions {
142
150
  mutableContent: boolean;
143
151
  };
144
152
  }
153
+ export type { IChatOptions as ChatOptions, ISendMessageSuccessResponse as SendMessageSuccessResponse, ISmsOptions as SmsOptions, } from '@novu/stateless';
154
+ export type EmailOptions = Omit<IEmailOptions, 'from'> & {
155
+ from: {
156
+ name?: string;
157
+ address?: string;
158
+ };
159
+ domain?: string;
160
+ mailboxes?: {
161
+ 'username': string;
162
+ 'forwardTo': string;
163
+ }[];
164
+ };
package/dist/pages.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- import type { UserOptions } from 'vite-plugin-pages';
2
- /**
3
- * **Pages Options**
4
- *
5
- * The pages options.
6
- */
7
- export type PagesOptions = UserOptions;
1
+ export interface PagesOption {
2
+ onboarding: {
3
+ path: string;
4
+ pages: string[];
5
+ };
6
+ settings: {
7
+ path: string;
8
+ pages: string[];
9
+ };
10
+ }
@@ -0,0 +1,59 @@
1
+ export interface PaymentOptions {
2
+ driver: 'stripe';
3
+ }
4
+ export interface ChargeOptions {
5
+ currency?: string;
6
+ source?: string;
7
+ description?: string;
8
+ chargeId?: string;
9
+ limit?: number;
10
+ metadata?: object;
11
+ searchOptions: {
12
+ query?: string;
13
+ limit?: number;
14
+ };
15
+ }
16
+ export interface CustomerOptions {
17
+ description?: string;
18
+ address?: string;
19
+ email?: string;
20
+ metadata?: object;
21
+ name?: string;
22
+ payment_method?: string;
23
+ shipping: string;
24
+ listOptions?: {
25
+ created?: object;
26
+ ending_before?: string;
27
+ limit?: number;
28
+ starting_after?: string;
29
+ test_clock?: string;
30
+ };
31
+ searchOptions?: {
32
+ query?: string;
33
+ limit?: number;
34
+ page?: number;
35
+ };
36
+ }
37
+ export interface DisputeOptions {
38
+ dp_id?: string;
39
+ metadata?: object;
40
+ listOptions?: {
41
+ charge?: string;
42
+ payment_intent?: string;
43
+ created?: string;
44
+ ending_before?: string;
45
+ limit?: number;
46
+ starting_after?: string;
47
+ };
48
+ }
49
+ export interface EventOptions {
50
+ event_id?: string;
51
+ listOptions?: {
52
+ created?: object;
53
+ delivery_success?: boolean;
54
+ ending_before?: string;
55
+ limit?: number;
56
+ starting_after?: string;
57
+ type?: string;
58
+ };
59
+ }
File without changes
@@ -1,2 +1 @@
1
- import type { Ref } from 'vue';
2
- export type { Ref };
1
+ export type { Ref } from 'vue';
@@ -0,0 +1,26 @@
1
+ export interface NitroEventHandler {
2
+ /**
3
+ * Path prefix or route
4
+ *
5
+ * If an empty string used, will be used as a middleware
6
+ */
7
+ route?: string;
8
+ /**
9
+ * Specifies this is a middleware handler.
10
+ * Middleware are called on every route and should normally return nothing to pass to the next handlers
11
+ */
12
+ middleware?: boolean;
13
+ /**
14
+ * Use lazy loading to import handler
15
+ */
16
+ lazy?: boolean;
17
+ /**
18
+ * Path to event handler
19
+ *
20
+ */
21
+ handler: string;
22
+ /**
23
+ * Router method matcher
24
+ */
25
+ method?: string;
26
+ }
File without changes
@@ -1,4 +1,4 @@
1
- import type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, Document as Record, DocumentOptions as RecordOptions, Documents as Records, DocumentsResults as RecordsResults, Settings as SearchEngineSettings, SearchParams, SearchResponse } from 'meilisearch';
1
+ import type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, DocumentOptions as RecordOptions, Settings as SearchIndexSettings, SearchParams, SearchResponse } from 'meilisearch';
2
2
  import type { MaybePromise } from '.';
3
3
  type Search = any;
4
4
  type Page = any;
@@ -26,6 +26,46 @@ export interface SearchEngineOptions {
26
26
  apiKey: string;
27
27
  };
28
28
  }
29
+ export interface ServicesOptions {
30
+ algolia?: {
31
+ appId: string;
32
+ apiKey: string;
33
+ };
34
+ meilisearch?: {
35
+ appId: string;
36
+ apiKey: string;
37
+ };
38
+ stripe?: {
39
+ appId: string;
40
+ apiKey: string;
41
+ };
42
+ planetscale?: {
43
+ appId: string;
44
+ apiKey: string;
45
+ };
46
+ supabase?: {
47
+ appId: string;
48
+ apiKey: string;
49
+ };
50
+ aws?: {
51
+ appId: string;
52
+ apiKey: string;
53
+ };
54
+ novu?: {
55
+ key: string;
56
+ };
57
+ }
58
+ export interface StorageOptions {
59
+ /**
60
+ * **Storage Driver**
61
+ *
62
+ * The storage driver to utilize.
63
+ *
64
+ * @default string 's3'
65
+ * @see https://stacksjs.dev/docs/storage
66
+ */
67
+ driver: 's3' | 'local';
68
+ }
29
69
  export interface MeiliSearchOptions {
30
70
  apiKey: string;
31
71
  host: string;
@@ -36,15 +76,15 @@ export interface SearchEngineDriver {
36
76
  getIndex: (name: string) => MaybePromise<Index>;
37
77
  updateIndex?: (name: string, options: IndexOptions) => MaybePromise<EnqueuedTask>;
38
78
  deleteIndex?: (name: string) => MaybePromise<EnqueuedTask>;
39
- updateIndexSettings: (name: string, settings: SearchEngineSettings) => MaybePromise<EnqueuedTask>;
79
+ updateIndexSettings: (name: string, settings: SearchIndexSettings) => MaybePromise<EnqueuedTask>;
40
80
  listAllIndexes: () => MaybePromise<IndexesResults<Index[]>>;
41
81
  listAllIndices: () => MaybePromise<IndexesResults<Index[]>>;
42
- getRecord?: (key: string) => MaybePromise<Record>;
82
+ getRecord?: (key: string) => MaybePromise<any>;
43
83
  getRecords?: (key: string) => MaybePromise<RecordOptions>;
44
- createRecord?: (record: Record, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
45
- createRecords?: (records: Records, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
46
- createOrReplaceRecord?: (record: Record, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
47
- createOrUpdateRecord?: (record: Record, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
84
+ createRecord?: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
85
+ createRecords?: (records: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
86
+ createOrReplaceRecord?: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
87
+ createOrUpdateRecord?: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
48
88
  deleteRecord?: (recordId: string | number, indexName: string) => MaybePromise<EnqueuedTask>;
49
89
  deleteAllRecords?: (indexName: string) => MaybePromise<EnqueuedTask>;
50
90
  batchDeleteRecords?: (recordIds: string[] | number[], indexName: string) => MaybePromise<EnqueuedTask>;
@@ -100,4 +140,4 @@ export interface SearchEngineStorage {
100
140
  */
101
141
  currentPage: number;
102
142
  }
103
- export type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, Record, RecordOptions, Records, RecordsResults, SearchEngineSettings, SearchParams, SearchResponse };
143
+ export type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, RecordOptions, SearchIndexSettings, SearchParams, SearchResponse };
package/dist/ssg.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { type ViteSSGContext } from '@stacksjs/types';
1
+ import { type ViteSSGContext } from './';
2
2
  export type UserModule = (ctx: ViteSSGContext) => void;