@stacksjs/types 0.75.89 → 0.75.91
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/dashboard.d.ts +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/mobile.d.ts +1 -0
- package/dist/socials.d.ts +150 -0
- package/dist/stacks.d.ts +2 -1
- package/package.json +4 -4
package/dist/dashboard.d.ts
CHANGED
|
@@ -61,6 +61,16 @@ export declare interface DashboardOptions {
|
|
|
61
61
|
retentionHours?: number
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
feedback?: {
|
|
65
|
+
attachments?: {
|
|
66
|
+
disk?: string
|
|
67
|
+
}
|
|
68
|
+
notifications?: {
|
|
69
|
+
enabled?: boolean
|
|
70
|
+
channels?: Array<'email' | 'sms' | 'chat' | 'database'>
|
|
71
|
+
recipients?: Array<{ email?: string, phone?: string, userId?: number }>
|
|
72
|
+
}
|
|
73
|
+
}
|
|
64
74
|
providers?: DashboardProviderOptions
|
|
65
75
|
}
|
|
66
76
|
/**
|
package/dist/index.d.ts
CHANGED
package/dist/mobile.d.ts
CHANGED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **Socials Options**
|
|
3
|
+
*
|
|
4
|
+
* Which social accounts this application posts as, and where each one's
|
|
5
|
+
* credentials come from. Because Stacks is fully-typed, you may hover any of
|
|
6
|
+
* the options below and the definitions will be provided. In case you have any
|
|
7
|
+
* questions, feel free to reach out via Discord or GitHub Discussions.
|
|
8
|
+
*/
|
|
9
|
+
export declare interface SocialsOptions {
|
|
10
|
+
default?: string
|
|
11
|
+
identities?: Record<string, SocialIdentityOptions>
|
|
12
|
+
}
|
|
13
|
+
/** One account, and the platforms it posts on. */
|
|
14
|
+
export declare interface SocialIdentityOptions {
|
|
15
|
+
handle?: string
|
|
16
|
+
platforms?: readonly SocialCredentialPlatform[]
|
|
17
|
+
credentials?: Partial<SocialCredentialsByPlatform>
|
|
18
|
+
}
|
|
19
|
+
export declare interface SocialCredentialsByPlatform {
|
|
20
|
+
bluesky: BlueskyCredentialOptions
|
|
21
|
+
twitter: TwitterCredentialOptions
|
|
22
|
+
linkedin: LinkedInCredentialOptions
|
|
23
|
+
mastodon: MastodonCredentialOptions
|
|
24
|
+
instagram: InstagramCredentialOptions
|
|
25
|
+
threads: ThreadsCredentialOptions
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Bluesky authenticates with an app password, not an OAuth token.
|
|
29
|
+
*
|
|
30
|
+
* Generate it in Settings, App Passwords; it is not the account password and
|
|
31
|
+
* can be revoked on its own. The driver mints a session per use from these,
|
|
32
|
+
* so there is nothing short-lived to store or refresh.
|
|
33
|
+
*
|
|
34
|
+
* Environment convention: `SOCIALS_<IDENTITY>_BLUESKY_IDENTIFIER` and
|
|
35
|
+
* `SOCIALS_<IDENTITY>_BLUESKY_PASSWORD`.
|
|
36
|
+
*/
|
|
37
|
+
export declare interface BlueskyCredentialOptions {
|
|
38
|
+
identifier?: string
|
|
39
|
+
password?: string
|
|
40
|
+
service?: string
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* X authenticates posting with a user-context OAuth 2.0 token (PKCE).
|
|
44
|
+
*
|
|
45
|
+
* Only `clientId` and `clientSecret` are static. The access and refresh
|
|
46
|
+
* tokens are per identity and come out of a consent flow, so unlike Bluesky
|
|
47
|
+
* they cannot simply be pasted into `.env` ahead of time: something has to run
|
|
48
|
+
* the flow and persist the result. Until then an identity can be declared and
|
|
49
|
+
* will report that it is not yet authorized, rather than appearing to work.
|
|
50
|
+
*
|
|
51
|
+
* Environment convention: `SOCIALS_<IDENTITY>_TWITTER_CLIENT_ID`,
|
|
52
|
+
* `_CLIENT_SECRET`, `_ACCESS_TOKEN` and `_REFRESH_TOKEN`.
|
|
53
|
+
*/
|
|
54
|
+
export declare interface TwitterCredentialOptions {
|
|
55
|
+
clientId?: string
|
|
56
|
+
clientSecret?: string
|
|
57
|
+
accessToken?: string
|
|
58
|
+
refreshToken?: string
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* LinkedIn posts as a member, named by URN.
|
|
62
|
+
*
|
|
63
|
+
* `LinkedInPublishingDriver.publish()` reads `identity.did` as the author
|
|
64
|
+
* URN and refuses without it, so the URN is a credential here rather than
|
|
65
|
+
* something to look up per post. It comes out of the consent flow's
|
|
66
|
+
* `getProfile()` as `urn:li:person:{sub}`.
|
|
67
|
+
*
|
|
68
|
+
* `clientId` and `clientSecret` are only for refreshing: posting itself needs
|
|
69
|
+
* the access token and the URN.
|
|
70
|
+
*
|
|
71
|
+
* Environment convention: `SOCIALS_<IDENTITY>_LINKEDIN_ACCESS_TOKEN`,
|
|
72
|
+
* `_MEMBER_URN`, and optionally `_CLIENT_ID`, `_CLIENT_SECRET`,
|
|
73
|
+
* `_API_VERSION`.
|
|
74
|
+
*/
|
|
75
|
+
export declare interface LinkedInCredentialOptions {
|
|
76
|
+
accessToken?: string
|
|
77
|
+
memberUrn?: string
|
|
78
|
+
clientId?: string
|
|
79
|
+
clientSecret?: string
|
|
80
|
+
apiVersion?: string
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Mastodon is one protocol across many hosts, so the host is a credential.
|
|
84
|
+
*
|
|
85
|
+
* `MastodonPublishingDriver` reads `identity.did` as the instance base URL,
|
|
86
|
+
* because an access token means nothing without the instance that issued it.
|
|
87
|
+
*
|
|
88
|
+
* The token is generated by hand in the instance's Preferences, Development,
|
|
89
|
+
* so there is no consent URL or code exchange to run: this is the one platform
|
|
90
|
+
* here whose credentials can be pasted into `.env` complete.
|
|
91
|
+
*
|
|
92
|
+
* Environment convention: `SOCIALS_<IDENTITY>_MASTODON_ACCESS_TOKEN` and
|
|
93
|
+
* `_INSTANCE_URL`.
|
|
94
|
+
*/
|
|
95
|
+
export declare interface MastodonCredentialOptions {
|
|
96
|
+
accessToken?: string
|
|
97
|
+
instanceUrl?: string
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Instagram posts to a Business account, named by id.
|
|
101
|
+
*
|
|
102
|
+
* `InstagramPublishingDriver` reads `identity.did` as the account id and
|
|
103
|
+
* refuses without it. Note that Instagram also refuses a text-only post: its
|
|
104
|
+
* `publish()` requires `media[0].url` to be a publicly reachable image, so an
|
|
105
|
+
* identity configured for Instagram alone cannot post what the others can.
|
|
106
|
+
*
|
|
107
|
+
* Environment convention: `SOCIALS_<IDENTITY>_INSTAGRAM_ACCESS_TOKEN` and
|
|
108
|
+
* `_ACCOUNT_ID`.
|
|
109
|
+
*/
|
|
110
|
+
export declare interface InstagramCredentialOptions {
|
|
111
|
+
accessToken?: string
|
|
112
|
+
accountId?: string
|
|
113
|
+
clientId?: string
|
|
114
|
+
clientSecret?: string
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Threads posts as a user, named by id.
|
|
118
|
+
*
|
|
119
|
+
* `ThreadsPublishingDriver` reads `identity.did` as the user id, which the
|
|
120
|
+
* token exchange returns alongside the access token.
|
|
121
|
+
*
|
|
122
|
+
* Environment convention: `SOCIALS_<IDENTITY>_THREADS_ACCESS_TOKEN` and
|
|
123
|
+
* `_USER_ID`.
|
|
124
|
+
*/
|
|
125
|
+
export declare interface ThreadsCredentialOptions {
|
|
126
|
+
accessToken?: string
|
|
127
|
+
userId?: string
|
|
128
|
+
clientId?: string
|
|
129
|
+
clientSecret?: string
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The platforms whose credential shape is confirmed against their driver.
|
|
133
|
+
*
|
|
134
|
+
* Read off each driver's `publish()` rather than from its documentation: what
|
|
135
|
+
* a driver refuses to post without is the only authority on what a credential
|
|
136
|
+
* has to carry. Every one of these is the full set of fields its driver
|
|
137
|
+
* dereferences.
|
|
138
|
+
*
|
|
139
|
+
* Deliberately not {@link SocialProviderName}, which is the OAuth sign-in
|
|
140
|
+
* layer. Signing a visitor in with Google and posting as an account are
|
|
141
|
+
* different capabilities, and a type that conflates them lets a sign-in
|
|
142
|
+
* provider be passed where a publishing driver is meant.
|
|
143
|
+
*/
|
|
144
|
+
export type SocialCredentialPlatform = | 'bluesky'
|
|
145
|
+
| 'twitter'
|
|
146
|
+
| 'linkedin'
|
|
147
|
+
| 'mastodon'
|
|
148
|
+
| 'instagram'
|
|
149
|
+
| 'threads';
|
|
150
|
+
export type SocialsConfig = Partial<SocialsOptions>;
|
package/dist/stacks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AiConfig, AnalyticsConfig, AppConfig, AuthConfig, BinaryConfig, CacheConfig, CloudConfig, CmsConfig, CommerceConfig, CorsConfig, DashboardConfig, DatabaseConfig, DnsConfig, DocsConfig, EmailConfig, ErrorConfig, FeatureFlagsConfig, FilesystemsConfig, GitConfig, HashingConfig, ImagesConfig, LibraryConfig, LoggingConfig, MarketingConfig, MonitoringConfig, NotificationConfig, PaymentConfig, Ports, QueueConfig, RealtimeConfig, SaasConfig, SearchEngineConfig, FormsConfig, SitesConfig, SmsConfig, SecurityConfig, ServerConfig, ServicesConfig, Team, UiConfig } from '.';
|
|
1
|
+
import type { AiConfig, AnalyticsConfig, AppConfig, AuthConfig, BinaryConfig, CacheConfig, CloudConfig, CmsConfig, CommerceConfig, CorsConfig, DashboardConfig, DatabaseConfig, DnsConfig, DocsConfig, EmailConfig, ErrorConfig, FeatureFlagsConfig, FilesystemsConfig, GitConfig, HashingConfig, ImagesConfig, LibraryConfig, LoggingConfig, MarketingConfig, MonitoringConfig, NotificationConfig, PaymentConfig, Ports, QueueConfig, RealtimeConfig, SaasConfig, SearchEngineConfig, FormsConfig, SitesConfig, SmsConfig, SocialsConfig, SecurityConfig, ServerConfig, ServicesConfig, Team, UiConfig } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* **Stacks Options**
|
|
4
4
|
*
|
|
@@ -43,6 +43,7 @@ export declare interface StacksOptions {
|
|
|
43
43
|
sites: SitesConfig
|
|
44
44
|
forms: FormsConfig
|
|
45
45
|
sms: SmsConfig
|
|
46
|
+
socials: SocialsConfig
|
|
46
47
|
services: ServicesConfig
|
|
47
48
|
filesystems: FilesystemsConfig
|
|
48
49
|
team: Team
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.75.
|
|
4
|
+
"version": "0.75.91",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@stacksjs/bunpress": "^0.2.15",
|
|
60
60
|
"@stacksjs/clapp": "^0.2.12",
|
|
61
|
-
"@stacksjs/events": "0.75.
|
|
62
|
-
"@stacksjs/strings": "0.75.
|
|
61
|
+
"@stacksjs/events": "0.75.91",
|
|
62
|
+
"@stacksjs/strings": "0.75.91",
|
|
63
63
|
"@stacksjs/stx": "^0.2.395",
|
|
64
64
|
"@stacksjs/ts-validation": "^0.5.6",
|
|
65
65
|
"bun-query-builder": "^0.3.5"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@stacksjs/validation": "0.75.
|
|
76
|
+
"@stacksjs/validation": "0.75.91",
|
|
77
77
|
"better-dx": "^0.2.24",
|
|
78
78
|
"meilisearch": "^0.62.0"
|
|
79
79
|
},
|