@vercel/connect 0.3.1 → 0.3.3
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/authorization.d.ts
CHANGED
|
@@ -12,5 +12,28 @@ export interface ConnectAuthorizationResponse {
|
|
|
12
12
|
url: string;
|
|
13
13
|
deviceCode?: string;
|
|
14
14
|
expiresAt?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Connector (client) being authorized, matching the `connector`
|
|
17
|
+
* object on the Vercel Connect token response. Present once the
|
|
18
|
+
* Vercel API supports returning it.
|
|
19
|
+
*/
|
|
20
|
+
connector?: {
|
|
21
|
+
/** Client id. */
|
|
22
|
+
id: string;
|
|
23
|
+
/** Client uid. */
|
|
24
|
+
uid: string;
|
|
25
|
+
/** Client type, eg. `oauth`, `salesforce`. */
|
|
26
|
+
type: string;
|
|
27
|
+
/** Resolved service id when known, eg. `salesforce`. */
|
|
28
|
+
service?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Curated display name of the resolved service, eg. `Salesforce`,
|
|
31
|
+
* present when the service is known to Vercel Connect. Suited for
|
|
32
|
+
* end-user surfaces like "Sign in with {serviceName}".
|
|
33
|
+
*/
|
|
34
|
+
serviceName?: string;
|
|
35
|
+
/** The connector's own (operator-given) name. */
|
|
36
|
+
name: string;
|
|
37
|
+
};
|
|
15
38
|
}
|
|
16
39
|
export declare function startAuthorization(connector: string, params: ConnectTokenParams, options?: ConnectAuthorizationOptions): Promise<ConnectAuthorizationResponse>;
|
|
@@ -157,6 +157,14 @@ export interface EveAuthorizationOptions {
|
|
|
157
157
|
* from the connection's filename.
|
|
158
158
|
*/
|
|
159
159
|
readonly instructions?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Manual override for the human-readable provider name channels
|
|
162
|
+
* render on the authorization affordance (eg. a
|
|
163
|
+
* `Sign in with Salesforce` button). When omitted, the connector's
|
|
164
|
+
* service display name reported by Vercel Connect is used, falling
|
|
165
|
+
* back to the connector's own name for unknown services.
|
|
166
|
+
*/
|
|
167
|
+
readonly displayName?: string;
|
|
160
168
|
/**
|
|
161
169
|
* Escape hatch for turning an unexpected Vercel Connect / network
|
|
162
170
|
* error into an Eve-recognizable error. Called once per failure
|
|
@@ -121,6 +121,14 @@ function buildInteractiveDefinition(options) {
|
|
|
121
121
|
...(completionWebhook ? { webhook: completionWebhook } : null),
|
|
122
122
|
deviceCode: true,
|
|
123
123
|
});
|
|
124
|
+
// Sign-in buttons name the destination service ("Sign in with
|
|
125
|
+
// Salesforce"), matching the OAuth idiom — the consent screen
|
|
126
|
+
// names the specific requesting app. The connector's own name is
|
|
127
|
+
// the fallback for custom connectors on unknown services, and an
|
|
128
|
+
// author-provided override wins over both.
|
|
129
|
+
const displayName = options.displayName ??
|
|
130
|
+
response.connector?.serviceName ??
|
|
131
|
+
response.connector?.name;
|
|
124
132
|
return {
|
|
125
133
|
challenge: {
|
|
126
134
|
url: response.url,
|
|
@@ -131,6 +139,7 @@ function buildInteractiveDefinition(options) {
|
|
|
131
139
|
...(options.instructions
|
|
132
140
|
? { instructions: options.instructions }
|
|
133
141
|
: null),
|
|
142
|
+
...(displayName ? { displayName } : null),
|
|
134
143
|
},
|
|
135
144
|
};
|
|
136
145
|
}
|
package/dist/token.d.ts
CHANGED
|
@@ -38,6 +38,11 @@ export interface ConnectTokenParams {
|
|
|
38
38
|
}
|
|
39
39
|
export interface ConnectTokenResponse {
|
|
40
40
|
token: string;
|
|
41
|
+
/**
|
|
42
|
+
* Per-issuance identifier for the token (`stk_…`), stable for its lifetime;
|
|
43
|
+
* use it to correlate the token with its usage in Vercel observability data.
|
|
44
|
+
*/
|
|
45
|
+
tokenId?: string;
|
|
41
46
|
/** Token expiration timestamp in milliseconds since epoch. */
|
|
42
47
|
expiresAt: number;
|
|
43
48
|
connector: {
|