nylas 7.0.0-beta.1 → 7.0.0-beta.2

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 (39) hide show
  1. package/README.md +1 -1
  2. package/lib/cjs/apiClient.js +11 -12
  3. package/lib/cjs/nylas.js +14 -14
  4. package/lib/cjs/package.json +3 -0
  5. package/lib/cjs/resources/applications.js +4 -4
  6. package/lib/cjs/resources/auth.js +4 -4
  7. package/lib/cjs/resources/calendars.js +2 -2
  8. package/lib/cjs/resources/events.js +2 -2
  9. package/lib/cjs/resources/grants.js +2 -2
  10. package/lib/cjs/resources/redirectUris.js +2 -2
  11. package/lib/cjs/resources/webhooks.js +2 -2
  12. package/lib/cjs/version.js +5 -0
  13. package/lib/esm/apiClient.js +3 -4
  14. package/lib/esm/nylas.js +7 -7
  15. package/lib/esm/package.json +3 -0
  16. package/lib/esm/resources/applications.js +2 -2
  17. package/lib/esm/resources/auth.js +2 -2
  18. package/lib/esm/resources/calendars.js +1 -1
  19. package/lib/esm/resources/events.js +1 -1
  20. package/lib/esm/resources/grants.js +1 -1
  21. package/lib/esm/resources/redirectUris.js +1 -1
  22. package/lib/esm/resources/webhooks.js +1 -1
  23. package/lib/esm/version.js +2 -0
  24. package/lib/types/apiClient.d.ts +1 -1
  25. package/lib/types/models/applicationDetails.d.ts +1 -1
  26. package/lib/types/models/calendars.d.ts +1 -1
  27. package/lib/types/models/events.d.ts +3 -3
  28. package/lib/types/models/grants.d.ts +1 -1
  29. package/lib/types/nylas.d.ts +7 -7
  30. package/lib/types/resources/applications.d.ts +6 -6
  31. package/lib/types/resources/auth.d.ts +4 -4
  32. package/lib/types/resources/calendars.d.ts +5 -5
  33. package/lib/types/resources/events.d.ts +4 -4
  34. package/lib/types/resources/grants.d.ts +4 -4
  35. package/lib/types/resources/redirectUris.d.ts +4 -4
  36. package/lib/types/resources/resource.d.ts +4 -4
  37. package/lib/types/resources/webhooks.d.ts +4 -4
  38. package/lib/types/version.d.ts +1 -0
  39. package/package.json +8 -3
package/README.md CHANGED
@@ -26,7 +26,7 @@ Here are some resources to help you get started:
26
26
  To run the Nylas Node SDK, you will first need to have [Node](https://nodejs.org/en/download/) and [npm](https://www.npmjs.com/get-npm) installed on your machine.
27
27
 
28
28
  Then, head to the nearest command line and run the following:
29
- `npm install nylas`
29
+ `npm install nylas@beta`
30
30
 
31
31
  Alternatively, if you prefer to use [Yarn](https://yarnpkg.com/en/), you can install the Nylas Node SDK with `yarn add nylas`
32
32
 
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const node_fetch_1 = require("node-fetch");
4
- const error_1 = require("./models/error");
5
- const utils_1 = require("./utils");
6
- const PACKAGE_JSON = require('package.json').default;
7
- const SDK_VERSION = PACKAGE_JSON.version;
4
+ const error_js_1 = require("./models/error.js");
5
+ const utils_js_1 = require("./utils.js");
6
+ const version_js_1 = require("./version.js");
8
7
  /**
9
8
  * The API client for communicating with the Nylas API
10
9
  * @ignore Not for public use
@@ -21,7 +20,7 @@ class APIClient {
21
20
  }
22
21
  setQueryStrings(url, queryParams) {
23
22
  if (queryParams) {
24
- const snakeCaseParams = (0, utils_1.objKeysToSnakeCase)(queryParams, ['metadataPair']);
23
+ const snakeCaseParams = (0, utils_js_1.objKeysToSnakeCase)(queryParams, ['metadataPair']);
25
24
  for (const [key, value] of Object.entries(snakeCaseParams)) {
26
25
  if (key == 'metadataPair') {
27
26
  // The API understands a metadata_pair filter in the form of:
@@ -42,7 +41,7 @@ class APIClient {
42
41
  setRequestHeaders({ headers, overrides, }) {
43
42
  return {
44
43
  Accept: 'application/json',
45
- 'User-Agent': `Nylas Node SDK v${SDK_VERSION}`,
44
+ 'User-Agent': `Nylas Node SDK v${version_js_1.SDK_VERSION}`,
46
45
  Authorization: `Bearer ${overrides?.apiKey || this.apiKey}`,
47
46
  ...headers,
48
47
  };
@@ -53,7 +52,7 @@ class APIClient {
53
52
  requestOptions.headers = this.setRequestHeaders(optionParams);
54
53
  requestOptions.method = optionParams.method;
55
54
  if (optionParams.body) {
56
- requestOptions.body = JSON.stringify((0, utils_1.objKeysToSnakeCase)(optionParams.body));
55
+ requestOptions.body = JSON.stringify((0, utils_js_1.objKeysToSnakeCase)(optionParams.body));
57
56
  requestOptions.headers['Content-Type'] = 'application/json';
58
57
  }
59
58
  return requestOptions;
@@ -70,7 +69,7 @@ class APIClient {
70
69
  const text = await response.text();
71
70
  try {
72
71
  const responseJSON = JSON.parse(text);
73
- return (0, utils_1.objKeysToCamelCase)(responseJSON);
72
+ return (0, utils_js_1.objKeysToCamelCase)(responseJSON);
74
73
  }
75
74
  catch (e) {
76
75
  throw new Error(`Could not parse response from the server: ${text}`);
@@ -81,7 +80,7 @@ class APIClient {
81
80
  const controller = new AbortController();
82
81
  const timeout = setTimeout(() => {
83
82
  controller.abort();
84
- throw new error_1.NylasSdkTimeoutError(req.url, this.timeout);
83
+ throw new error_js_1.NylasSdkTimeoutError(req.url, this.timeout);
85
84
  }, this.timeout);
86
85
  const response = await (0, node_fetch_1.default)(req, { signal: controller.signal });
87
86
  clearTimeout(timeout);
@@ -96,12 +95,12 @@ class APIClient {
96
95
  let error;
97
96
  try {
98
97
  const parsedError = JSON.parse(text);
99
- const camelCaseError = (0, utils_1.objKeysToCamelCase)(parsedError);
98
+ const camelCaseError = (0, utils_js_1.objKeysToCamelCase)(parsedError);
100
99
  if (authErrorResponse) {
101
- error = new error_1.NylasOAuthError(camelCaseError, response.status);
100
+ error = new error_js_1.NylasOAuthError(camelCaseError, response.status);
102
101
  }
103
102
  else {
104
- error = new error_1.NylasApiError(camelCaseError, response.status);
103
+ error = new error_js_1.NylasApiError(camelCaseError, response.status);
105
104
  }
106
105
  }
107
106
  catch (e) {
package/lib/cjs/nylas.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const apiClient_1 = require("./apiClient");
4
- const config_1 = require("./config");
5
- const calendars_1 = require("./resources/calendars");
6
- const events_1 = require("./resources/events");
7
- const auth_1 = require("./resources/auth");
8
- const webhooks_1 = require("./resources/webhooks");
9
- const applications_1 = require("./resources/applications");
3
+ const apiClient_js_1 = require("./apiClient.js");
4
+ const config_js_1 = require("./config.js");
5
+ const calendars_js_1 = require("./resources/calendars.js");
6
+ const events_js_1 = require("./resources/events.js");
7
+ const auth_js_1 = require("./resources/auth.js");
8
+ const webhooks_js_1 = require("./resources/webhooks.js");
9
+ const applications_js_1 = require("./resources/applications.js");
10
10
  /**
11
11
  * The entry point to the Node SDK
12
12
  *
@@ -18,16 +18,16 @@ class Nylas {
18
18
  * @param config Configuration options for the Nylas SDK
19
19
  */
20
20
  constructor(config) {
21
- this.apiClient = new apiClient_1.default({
21
+ this.apiClient = new apiClient_js_1.default({
22
22
  apiKey: config.apiKey,
23
- apiUri: config.apiUri || config_1.DEFAULT_SERVER_URL,
23
+ apiUri: config.apiUri || config_js_1.DEFAULT_SERVER_URL,
24
24
  timeout: config.timeout || 30,
25
25
  });
26
- this.applications = new applications_1.Applications(this.apiClient);
27
- this.auth = new auth_1.Auth(this.apiClient);
28
- this.calendars = new calendars_1.Calendars(this.apiClient);
29
- this.events = new events_1.Events(this.apiClient);
30
- this.webhooks = new webhooks_1.Webhooks(this.apiClient);
26
+ this.applications = new applications_js_1.Applications(this.apiClient);
27
+ this.auth = new auth_js_1.Auth(this.apiClient);
28
+ this.calendars = new calendars_js_1.Calendars(this.apiClient);
29
+ this.events = new events_js_1.Events(this.apiClient);
30
+ this.webhooks = new webhooks_js_1.Webhooks(this.apiClient);
31
31
  return this;
32
32
  }
33
33
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -1,20 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Applications = void 0;
4
- const resource_1 = require("./resource");
5
- const redirectUris_1 = require("./redirectUris");
4
+ const resource_js_1 = require("./resource.js");
5
+ const redirectUris_js_1 = require("./redirectUris.js");
6
6
  /**
7
7
  * Nylas Applications API
8
8
  *
9
9
  * This endpoint allows for getting application details as well as redirect URI operations.
10
10
  */
11
- class Applications extends resource_1.Resource {
11
+ class Applications extends resource_js_1.Resource {
12
12
  /**
13
13
  * @param apiClient client The configured Nylas API client
14
14
  */
15
15
  constructor(apiClient) {
16
16
  super(apiClient);
17
- this.redirectUris = new redirectUris_1.RedirectUris(apiClient);
17
+ this.redirectUris = new redirectUris_js_1.RedirectUris(apiClient);
18
18
  }
19
19
  /**
20
20
  * Get application details
@@ -3,22 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Auth = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  const sha256_1 = require("sha256");
6
- const resource_1 = require("./resource");
7
- const grants_1 = require("./grants");
6
+ const resource_js_1 = require("./resource.js");
7
+ const grants_js_1 = require("./grants.js");
8
8
  /**
9
9
  * A collection of authentication related API endpoints
10
10
  *
11
11
  * These endpoints allow for various functionality related to authentication.
12
12
  * Also contains the Grants API and collection of provider API endpoints.
13
13
  */
14
- class Auth extends resource_1.Resource {
14
+ class Auth extends resource_js_1.Resource {
15
15
  /**
16
16
  * @param apiClient The configured Nylas API client
17
17
  */
18
18
  constructor(apiClient) {
19
19
  super(apiClient);
20
20
  this.apiClient = apiClient;
21
- this.grants = new grants_1.Grants(apiClient);
21
+ this.grants = new grants_js_1.Grants(apiClient);
22
22
  }
23
23
  /**
24
24
  * Build the URL for authenticating users to your application with OAuth 2.0
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Calendars = void 0;
4
- const resource_1 = require("./resource");
4
+ const resource_js_1 = require("./resource.js");
5
5
  /**
6
6
  * Nylas Calendar API
7
7
  *
8
8
  * The Nylas calendar API allows you to create new calendars or manage existing ones.
9
9
  * A calendar can be accessed by one, or several people, and can contain events.
10
10
  */
11
- class Calendars extends resource_1.Resource {
11
+ class Calendars extends resource_js_1.Resource {
12
12
  /**
13
13
  * Return all Calendars
14
14
  * @return A list of calendars
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Events = void 0;
4
- const resource_1 = require("./resource");
4
+ const resource_js_1 = require("./resource.js");
5
5
  /**
6
6
  * Nylas Events API
7
7
  *
8
8
  * The Nylas Events API allows you to create, update, and delete events on user calendars.
9
9
  */
10
- class Events extends resource_1.Resource {
10
+ class Events extends resource_js_1.Resource {
11
11
  /**
12
12
  * Return all Events
13
13
  * @return The list of Events
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Grants = void 0;
4
- const resource_1 = require("./resource");
4
+ const resource_js_1 = require("./resource.js");
5
5
  /**
6
6
  * Nylas Grants API
7
7
  *
8
8
  * The Nylas Grants API allows for the management of grants.
9
9
  */
10
- class Grants extends resource_1.Resource {
10
+ class Grants extends resource_js_1.Resource {
11
11
  /**
12
12
  * Return all Grants
13
13
  * @return The list of Grants
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RedirectUris = void 0;
4
- const resource_1 = require("./resource");
4
+ const resource_js_1 = require("./resource.js");
5
5
  /**
6
6
  * A collection of redirect URI related API endpoints.
7
7
  *
8
8
  * These endpoints allows for the management of redirect URIs.
9
9
  */
10
- class RedirectUris extends resource_1.Resource {
10
+ class RedirectUris extends resource_js_1.Resource {
11
11
  /**
12
12
  * Return all Redirect URIs
13
13
  * @return The list of Redirect URIs
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Webhooks = void 0;
4
- const resource_1 = require("./resource");
4
+ const resource_js_1 = require("./resource.js");
5
5
  /**
6
6
  * Nylas Webhooks API
7
7
  *
8
8
  * The Nylas Webhooks API allows your application to receive notifications in real-time when certain events occur.
9
9
  */
10
- class Webhooks extends resource_1.Resource {
10
+ class Webhooks extends resource_js_1.Resource {
11
11
  /**
12
12
  * List all webhook destinations for the application
13
13
  * @returns The list of webhook destinations
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SDK_VERSION = void 0;
4
+ // This file is generated by scripts/exportVersion.js
5
+ exports.SDK_VERSION = '7.0.0-beta.2';
@@ -1,8 +1,7 @@
1
1
  import fetch, { Request } from 'node-fetch';
2
- import { NylasApiError, NylasOAuthError, NylasSdkTimeoutError, } from './models/error';
3
- import { objKeysToCamelCase, objKeysToSnakeCase } from './utils';
4
- const PACKAGE_JSON = require('package.json').default;
5
- const SDK_VERSION = PACKAGE_JSON.version;
2
+ import { NylasApiError, NylasOAuthError, NylasSdkTimeoutError, } from './models/error.js';
3
+ import { objKeysToCamelCase, objKeysToSnakeCase } from './utils.js';
4
+ import { SDK_VERSION } from './version.js';
6
5
  /**
7
6
  * The API client for communicating with the Nylas API
8
7
  * @ignore Not for public use
package/lib/esm/nylas.js CHANGED
@@ -1,10 +1,10 @@
1
- import APIClient from './apiClient';
2
- import { DEFAULT_SERVER_URL } from './config';
3
- import { Calendars } from './resources/calendars';
4
- import { Events } from './resources/events';
5
- import { Auth } from './resources/auth';
6
- import { Webhooks } from './resources/webhooks';
7
- import { Applications } from './resources/applications';
1
+ import APIClient from './apiClient.js';
2
+ import { DEFAULT_SERVER_URL } from './config.js';
3
+ import { Calendars } from './resources/calendars.js';
4
+ import { Events } from './resources/events.js';
5
+ import { Auth } from './resources/auth.js';
6
+ import { Webhooks } from './resources/webhooks.js';
7
+ import { Applications } from './resources/applications.js';
8
8
  /**
9
9
  * The entry point to the Node SDK
10
10
  *
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -1,5 +1,5 @@
1
- import { Resource } from './resource';
2
- import { RedirectUris } from './redirectUris';
1
+ import { Resource } from './resource.js';
2
+ import { RedirectUris } from './redirectUris.js';
3
3
  /**
4
4
  * Nylas Applications API
5
5
  *
@@ -1,7 +1,7 @@
1
1
  import { v4 as uuid } from 'uuid';
2
2
  import sha256 from 'sha256';
3
- import { Resource } from './resource';
4
- import { Grants } from './grants';
3
+ import { Resource } from './resource.js';
4
+ import { Grants } from './grants.js';
5
5
  /**
6
6
  * A collection of authentication related API endpoints
7
7
  *
@@ -1,4 +1,4 @@
1
- import { Resource } from './resource';
1
+ import { Resource } from './resource.js';
2
2
  /**
3
3
  * Nylas Calendar API
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Resource } from './resource';
1
+ import { Resource } from './resource.js';
2
2
  /**
3
3
  * Nylas Events API
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Resource } from './resource';
1
+ import { Resource } from './resource.js';
2
2
  /**
3
3
  * Nylas Grants API
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Resource } from './resource';
1
+ import { Resource } from './resource.js';
2
2
  /**
3
3
  * A collection of redirect URI related API endpoints.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Resource } from './resource';
1
+ import { Resource } from './resource.js';
2
2
  /**
3
3
  * Nylas Webhooks API
4
4
  *
@@ -0,0 +1,2 @@
1
+ // This file is generated by scripts/exportVersion.js
2
+ export const SDK_VERSION = '7.0.0-beta.2';
@@ -1,5 +1,5 @@
1
1
  import { Request, Response } from 'node-fetch';
2
- import { NylasConfig, OverridableNylasConfig } from './config';
2
+ import { NylasConfig, OverridableNylasConfig } from './config.js';
3
3
  /**
4
4
  * Options for a request to the Nylas API
5
5
  * @property path The path to the API endpoint
@@ -1,4 +1,4 @@
1
- import { RedirectUri } from './redirectUri';
1
+ import { RedirectUri } from './redirectUri.js';
2
2
  /**
3
3
  * Interface for a Nylas application details object
4
4
  */
@@ -1,4 +1,4 @@
1
- import { ListQueryParams } from './listQueryParams';
1
+ import { ListQueryParams } from './listQueryParams.js';
2
2
  /**
3
3
  * Interface of the query parameters for listing calendars.
4
4
  */
@@ -1,5 +1,5 @@
1
- import { ListQueryParams } from './listQueryParams';
2
- import { Subset } from '../utils';
1
+ import { ListQueryParams } from './listQueryParams.js';
2
+ import { Subset } from '../utils.js';
3
3
  /**
4
4
  * Interface representing a Nylas Event object.
5
5
  */
@@ -256,7 +256,7 @@ export interface ListEventQueryParams extends ListQueryParams {
256
256
  limit?: number;
257
257
  /**
258
258
  * An identifier that specifies which page of data to return.
259
- * This value should be taken from the {@link ListResponse.nextCursor} response field.
259
+ * This value should be taken from the {@link NylasListResponse.nextCursor} response field.
260
260
  */
261
261
  pageToken?: string;
262
262
  }
@@ -1,4 +1,4 @@
1
- import { Provider } from './auth';
1
+ import { Provider } from './auth.js';
2
2
  /**
3
3
  * Interface representing a Nylas Grant object.
4
4
  */
@@ -1,10 +1,10 @@
1
- import APIClient from './apiClient';
2
- import { NylasConfig } from './config';
3
- import { Calendars } from './resources/calendars';
4
- import { Events } from './resources/events';
5
- import { Auth } from './resources/auth';
6
- import { Webhooks } from './resources/webhooks';
7
- import { Applications } from './resources/applications';
1
+ import APIClient from './apiClient.js';
2
+ import { NylasConfig } from './config.js';
3
+ import { Calendars } from './resources/calendars.js';
4
+ import { Events } from './resources/events.js';
5
+ import { Auth } from './resources/auth.js';
6
+ import { Webhooks } from './resources/webhooks.js';
7
+ import { Applications } from './resources/applications.js';
8
8
  /**
9
9
  * The entry point to the Node SDK
10
10
  *
@@ -1,9 +1,9 @@
1
- import { Resource } from './resource';
2
- import { RedirectUris } from './redirectUris';
3
- import APIClient from '../apiClient';
4
- import { ApplicationDetails } from '../models/applicationDetails';
5
- import { NylasResponse } from '../models/response';
6
- import { Overrides } from '../config';
1
+ import { Resource } from './resource.js';
2
+ import { RedirectUris } from './redirectUris.js';
3
+ import APIClient from '../apiClient.js';
4
+ import { ApplicationDetails } from '../models/applicationDetails.js';
5
+ import { NylasResponse } from '../models/response.js';
6
+ import { Overrides } from '../config.js';
7
7
  /**
8
8
  * Nylas Applications API
9
9
  *
@@ -1,7 +1,7 @@
1
- import APIClient from '../apiClient';
2
- import { Resource } from './resource';
3
- import { Grants } from './grants';
4
- import { URLForAdminConsentConfig, URLForAuthenticationConfig, CodeExchangeRequest, PKCEAuthURL, TokenExchangeRequest, CodeExchangeResponse, ProviderDetectParams, ProviderDetectResponse } from '../models/auth';
1
+ import APIClient from '../apiClient.js';
2
+ import { Resource } from './resource.js';
3
+ import { Grants } from './grants.js';
4
+ import { URLForAdminConsentConfig, URLForAuthenticationConfig, CodeExchangeRequest, PKCEAuthURL, TokenExchangeRequest, CodeExchangeResponse, ProviderDetectParams, ProviderDetectResponse } from '../models/auth.js';
5
5
  /**
6
6
  * A collection of authentication related API endpoints
7
7
  *
@@ -1,8 +1,8 @@
1
- import { Overrides } from '../config';
2
- import { Calendar, CreateCalenderRequest, ListCalendersQueryParams, UpdateCalenderRequest } from '../models/calendars';
3
- import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response';
4
- import { Resource, AsyncListResponse } from './resource';
5
- import { GetAvailabilityRequest, GetAvailabilityResponse } from '../models/availability';
1
+ import { Overrides } from '../config.js';
2
+ import { Calendar, CreateCalenderRequest, ListCalendersQueryParams, UpdateCalenderRequest } from '../models/calendars.js';
3
+ import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response.js';
4
+ import { Resource, AsyncListResponse } from './resource.js';
5
+ import { GetAvailabilityRequest, GetAvailabilityResponse } from '../models/availability.js';
6
6
  /**
7
7
  * The parameters for the {@link Calendars.find} method
8
8
  * @property calendarId The id of the Calendar to retrieve. Use "primary" to refer to the primary calendar associated with grant.
@@ -1,7 +1,7 @@
1
- import { Overrides } from '../config';
2
- import { CreateEventQueryParams, CreateEventRequest, DestroyEventQueryParams, Event, FindEventQueryParams, ListEventQueryParams, UpdateEventQueryParams, UpdateEventRequest } from '../models/events';
3
- import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response';
4
- import { AsyncListResponse, Resource } from './resource';
1
+ import { Overrides } from '../config.js';
2
+ import { CreateEventQueryParams, CreateEventRequest, DestroyEventQueryParams, Event, FindEventQueryParams, ListEventQueryParams, UpdateEventQueryParams, UpdateEventRequest } from '../models/events.js';
3
+ import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response.js';
4
+ import { AsyncListResponse, Resource } from './resource.js';
5
5
  /**
6
6
  * @property eventId The id of the Event to retrieve.
7
7
  * @property identifier The identifier of the grant to act upon
@@ -1,7 +1,7 @@
1
- import { Resource } from './resource';
2
- import { Overrides } from '../config';
3
- import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response';
4
- import { CreateGrantRequest, Grant, ListGrantsQueryParams, UpdateGrantRequest } from '../models/grants';
1
+ import { Resource } from './resource.js';
2
+ import { Overrides } from '../config.js';
3
+ import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response.js';
4
+ import { CreateGrantRequest, Grant, ListGrantsQueryParams, UpdateGrantRequest } from '../models/grants.js';
5
5
  /**
6
6
  * @property grantId The id of the Grant to retrieve.
7
7
  */
@@ -1,7 +1,7 @@
1
- import { AsyncListResponse, Resource } from './resource';
2
- import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response';
3
- import { CreateRedirectUriRequest, RedirectUri, UpdateRedirectUriRequest } from '../models/redirectUri';
4
- import { Overrides } from '../config';
1
+ import { AsyncListResponse, Resource } from './resource.js';
2
+ import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response.js';
3
+ import { CreateRedirectUriRequest, RedirectUri, UpdateRedirectUriRequest } from '../models/redirectUri.js';
4
+ import { Overrides } from '../config.js';
5
5
  /**
6
6
  * @property redirectUriId The id of the Redirect URI to retrieve.
7
7
  */
@@ -1,7 +1,7 @@
1
- import APIClient from '../apiClient';
2
- import { OverridableNylasConfig } from '../config';
3
- import { ListQueryParams } from '../models/listQueryParams';
4
- import { NylasResponse, NylasListResponse, ListResponseInnerType } from '../models/response';
1
+ import APIClient from '../apiClient.js';
2
+ import { OverridableNylasConfig } from '../config.js';
3
+ import { ListQueryParams } from '../models/listQueryParams.js';
4
+ import { NylasResponse, NylasListResponse, ListResponseInnerType } from '../models/response.js';
5
5
  interface ListParams<T> {
6
6
  queryParams?: ListQueryParams;
7
7
  path: string;
@@ -1,7 +1,7 @@
1
- import { AsyncListResponse, Resource } from './resource';
2
- import { Overrides } from '../config';
3
- import { NylasResponse, NylasListResponse } from '../models/response';
4
- import { CreateWebhookRequest, UpdateWebhookRequest, Webhook, WebhookDeleteResponse, WebhookIpAddressesResponse, WebhookWithSecret } from '../models/webhooks';
1
+ import { AsyncListResponse, Resource } from './resource.js';
2
+ import { Overrides } from '../config.js';
3
+ import { NylasResponse, NylasListResponse } from '../models/response.js';
4
+ import { CreateWebhookRequest, UpdateWebhookRequest, Webhook, WebhookDeleteResponse, WebhookIpAddressesResponse, WebhookWithSecret } from '../models/webhooks.js';
5
5
  /**
6
6
  * @property webhookId The ID of the webhook destination to update
7
7
  */
@@ -0,0 +1 @@
1
+ export declare const SDK_VERSION = "7.0.0-beta.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nylas",
3
- "version": "7.0.0-beta.1",
3
+ "version": "7.0.0-beta.2",
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",
@@ -19,11 +19,15 @@
19
19
  "lint:ci": "npm run lint:fix -- --quiet",
20
20
  "lint:prettier": "prettier --write '**/*.{ts,js}'",
21
21
  "lint:prettier:check": "prettier --check '**/*.{ts,js}'",
22
- "build": "rm -rf lib && npm run build-esm && npm run build-cjs",
22
+ "export-version": "node scripts/exportVersion.js",
23
+ "generate-lib-package-json": "node scripts/generateLibPackageJson.js",
24
+ "prebuild": "npm run export-version",
25
+ "build": "rm -rf lib && npm run build-esm && npm run build-cjs && npm run generate-lib-package-json",
23
26
  "build-esm": "tsc -p tsconfig.esm.json",
24
27
  "build-cjs": "tsc -p tsconfig.cjs.json",
25
28
  "prepare": "npm run build",
26
- "build:docs": "typedoc --out docs"
29
+ "build:docs": "typedoc --out docs",
30
+ "version": "npm run export-version && git add src/version.ts"
27
31
  },
28
32
  "keywords": [
29
33
  "email",
@@ -35,6 +39,7 @@
35
39
  "license": "MIT",
36
40
  "dependencies": {
37
41
  "change-case": "^4.1.2",
42
+ "eslint-plugin-import": "^2.28.1",
38
43
  "node-fetch": "^2.6.12",
39
44
  "sha256": "^0.2.0",
40
45
  "uuid": "^8.3.2"