nylas 8.0.1 → 8.0.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.
@@ -163,6 +163,12 @@ class Auth extends resource_js_1.Resource {
163
163
  if (config.state) {
164
164
  url.searchParams.set('state', config.state);
165
165
  }
166
+ if (config.smtpRequired) {
167
+ url.searchParams.set('options', 'smtp_required');
168
+ }
169
+ if (config.credentialId) {
170
+ url.searchParams.set('credential_id', config.credentialId);
171
+ }
166
172
  return url;
167
173
  }
168
174
  hashPKCESecret(secret) {
@@ -44,7 +44,7 @@ class Credentials extends resource_js_1.Resource {
44
44
  * @return The updated credential
45
45
  */
46
46
  update({ provider, credentialsId, requestBody, overrides, }) {
47
- return super._update({
47
+ return super._updatePatch({
48
48
  path: (0, utils_js_1.makePathParams)('/v3/connectors/{provider}/creds/{credentialsId}', {
49
49
  provider,
50
50
  credentialsId,
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
4
  // This file is generated by scripts/exportVersion.js
5
- exports.SDK_VERSION = '8.0.1';
5
+ exports.SDK_VERSION = '8.0.3';
@@ -160,6 +160,12 @@ export class Auth extends Resource {
160
160
  if (config.state) {
161
161
  url.searchParams.set('state', config.state);
162
162
  }
163
+ if (config.smtpRequired) {
164
+ url.searchParams.set('options', 'smtp_required');
165
+ }
166
+ if (config.credentialId) {
167
+ url.searchParams.set('credential_id', config.credentialId);
168
+ }
163
169
  return url;
164
170
  }
165
171
  hashPKCESecret(secret) {
@@ -41,7 +41,7 @@ export class Credentials extends Resource {
41
41
  * @return The updated credential
42
42
  */
43
43
  update({ provider, credentialsId, requestBody, overrides, }) {
44
- return super._update({
44
+ return super._updatePatch({
45
45
  path: makePathParams('/v3/connectors/{provider}/creds/{credentialsId}', {
46
46
  provider,
47
47
  credentialsId,
@@ -1,2 +1,2 @@
1
1
  // This file is generated by scripts/exportVersion.js
2
- export const SDK_VERSION = '8.0.1';
2
+ export const SDK_VERSION = '8.0.3';
@@ -49,6 +49,19 @@ export interface URLForAuthenticationConfig {
49
49
  * If a Grant for the provided email already exists, a Grant's re-auth will automatically be initiated.
50
50
  */
51
51
  loginHint?: string;
52
+ /**
53
+ * If set to true, the options=smtp_required parameter is added to the authentication URL.
54
+ * This forces users to provide SMTP settings during IMAP authentication, preventing
55
+ * send failures from missing SMTP configuration.
56
+ */
57
+ smtpRequired?: boolean;
58
+ /**
59
+ * Optional credential ID to use for hosted authentication.
60
+ * Allows selecting a specific set of provider credentials when multiple are configured under a connector.
61
+ * If not specified, the connector's default credential will be used.
62
+ * This is supported for standard OAuth flows (response_type=code).
63
+ */
64
+ credentialId?: string;
52
65
  }
53
66
  /**
54
67
  * Configuration for generating a URL for admin consent authentication for Microsoft.
@@ -16,6 +16,11 @@ export interface Connector {
16
16
  * Default scopes for the connector
17
17
  */
18
18
  scope?: string[];
19
+ /**
20
+ * The active credential ID for the connector.
21
+ * This is the default credential used for authentication when no specific credential is specified.
22
+ */
23
+ activeCredentialId?: string;
19
24
  }
20
25
  /**
21
26
  * Interface representing a Google connector creation request.
@@ -115,6 +120,11 @@ export interface UpdateConnectorRequest {
115
120
  * The OAuth scopes
116
121
  */
117
122
  scope?: string[];
123
+ /**
124
+ * The active credential ID to set as the default for this connector.
125
+ * When specified, this credential will be used for authentication when no specific credential is provided.
126
+ */
127
+ activeCredentialId?: string;
118
128
  }
119
129
  /**
120
130
  * Interface of the query parameters for listing connectors.
@@ -55,6 +55,11 @@ export interface Grant {
55
55
  * Settings required by the provider that were sent as part of the OAuth request.
56
56
  */
57
57
  settings?: Record<string, unknown>;
58
+ /**
59
+ * The credential ID that was used to create this grant.
60
+ * This links the grant to a specific set of provider credentials.
61
+ */
62
+ credentialId?: string;
58
63
  }
59
64
  /**
60
65
  * Interface representing a request to create a grant.
@@ -66,8 +71,16 @@ export interface CreateGrantRequest {
66
71
  provider: Provider;
67
72
  /**
68
73
  * Settings required by provider.
69
- */
70
- settings: Record<string, unknown>;
74
+ * Can include 'credentialId' to specify which credential to use for authentication.
75
+ * If not specified, the connector's default credential will be used.
76
+ */
77
+ settings: Record<string, unknown> & {
78
+ /**
79
+ * Optional credential ID to use for this authentication.
80
+ * Allows selecting a specific set of provider credentials when multiple are configured.
81
+ */
82
+ credentialId?: string;
83
+ };
71
84
  /**
72
85
  * Optional state value to return to developer's website after authentication flow is completed.
73
86
  */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "8.0.1";
1
+ export declare const SDK_VERSION = "8.0.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nylas",
3
- "version": "8.0.1",
3
+ "version": "8.0.3",
4
4
  "description": "A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.",
5
5
  "main": "lib/cjs/nylas.js",
6
6
  "types": "lib/types/nylas.d.ts",