nylas

nylas

Helping developers quickly build features that connect to every email, calendar, and contacts provider in the world.

Member Since 8 years ago

SF | NYC | Remote

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
82
repos
Activity
Jan
26
1 day ago
Activity icon
issue

mrashed-dev issue comment nylas/nylas-java

mrashed-dev
mrashed-dev

Using internal api of OkHttp stop us from using newer version of OkHttp

Describe the bug Using internal api of OkHttp stops us from using newer version of OkHttp https://github.com/nylas/nylas-java/blob/5e79d0733c8997b01ef829538858d880ebf73e7b/src/main/java/com/nylas/HttpLoggingInterceptor.java#L115-L115

import okhttp3.internal.http.HttpHeaders
...
  + " resBodySize=" + HttpHeaders.contentLength(response)

HttpHeaders is part of internal api of OkHttp and should not be used in the sdk.

To Reproduce Create a project, add nylas sdk as dependency and override OkHttp in your project, calling methods like account.events().list().fetchAll() ends up with such stacktrace:

	at com.nylas.HttpLoggingInterceptor.logResponse(HttpLoggingInterceptor.java:115)
	at com.nylas.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:73)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at com.nylas.AddVersionHeadersInterceptor.intercept(AddVersionHeadersInterceptor.java:24)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
	at com.nylas.NylasClient.executeRequest(NylasClient.java:170)
	at com.nylas.NylasClient.executeRequestWithAuth(NylasClient.java:153)
	at com.nylas.NylasClient.executeGet(NylasClient.java:112)
	at com.nylas.RestfulDAO.fetchQuery(RestfulDAO.java:56)
	at com.nylas.RemoteCollection.fetchSet(RemoteCollection.java:71)
	at com.nylas.RemoteCollection.fetchAll(RemoteCollection.java:58)```

// Helps us with reproducing the error :)


**Expected behavior**
Please remove HttpHeaders references from the sdk.

**SDK Version:**
The most recent version 1.11 and previous ones
mrashed-dev
mrashed-dev

@jzinedine Thanks for opening this issue, we will take a look at it and keep you posted!

Activity icon
issue

jzinedine issue nylas/nylas-java

jzinedine
jzinedine

Using internal api of OkHttp stop us from using newer version of OkHttp

Describe the bug Using internal api of OkHttp stop us from using newer version of OkHttp https://github.com/nylas/nylas-java/blob/5e79d0733c8997b01ef829538858d880ebf73e7b/src/main/java/com/nylas/HttpLoggingInterceptor.java#L115-L115

import okhttp3.internal.http.HttpHeaders
...
  + " resBodySize=" + HttpHeaders.contentLength(response)

HttpHeaders is part of internal api of OkHttp and should not be used in the sdk.

To Reproduce Create a project, add nylas sdk as dependency and override OkHttp in your project, calling methods like account.events().list().fetchAll() ends up with such stacktrace: Exception in thread "main" java.lang.NoSuchMethodError: okhttp3.internal.http.HttpHeaders.contentLength(Lokhttp3/Response;)J at com.nylas.HttpLoggingInterceptor.logResponse(HttpLoggingInterceptor.java:115) at com.nylas.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:73) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at com.nylas.AddVersionHeadersInterceptor.intercept(AddVersionHeadersInterceptor.java:24) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154) at com.nylas.NylasClient.executeRequest(NylasClient.java:170) at com.nylas.NylasClient.executeRequestWithAuth(NylasClient.java:153) at com.nylas.NylasClient.executeGet(NylasClient.java:112) at com.nylas.RestfulDAO.fetchQuery(RestfulDAO.java:56) at com.nylas.RemoteCollection.fetchSet(RemoteCollection.java:71) at com.nylas.RemoteCollection.fetchAll(RemoteCollection.java:58)

// Helps us with reproducing the error :)

Expected behavior Please remove HttpHeaders references from the sdk.

SDK Version: The most recent version 1.11 and previous ones

push

krisgardiner push nylas/components

krisgardiner
krisgardiner

[Agenda]: Removed unused/incorrect import (#351)

krisgardiner
krisgardiner

Revert "dummy for release"

This reverts commit be437faa3a7dc2e0e52586983239a2e826e6f0a3.

krisgardiner
krisgardiner

[email] reply, reply all tests (#304)

  • [email] ensure reply buttons available when passing properties

  • [mailbox]fix mailbox demo can not send emails (#296)

  • composer using wrong id

  • [cy] add mock response for thread requests

  • test(email): add tests for reply button and dispatched event

  • test(email): add tests for reply all button and dispatched event

  • refactor(email) use cypress.html

  • clean up cypress default functionality

  • conform to new standard

krisgardiner
krisgardiner

[composer] return focus to email textbox when formatting option clicked (#342)

krisgardiner
krisgardiner

[mailbox] fixes for delay when clicking email to see expanded view & scroll to latest message (#346)

krisgardiner
krisgardiner

[Mailbox]: Update thread when message is sent via composer (#343)

  • [Mailbox]: Update thread when message is sent via composer

  • Update components/mailbox/src/Mailbox.svelte

Co-authored-by: Oliver Zsivanov [email protected]

Co-authored-by: Oliver Zsivanov [email protected]

krisgardiner
krisgardiner

[Mailbox]: Bring back styles for threads with no messages (#347)

  • test

  • remove query_string from index

  • Fixed issue where thread expanded in the mailbox component

  • Revert "Fixed issue where thread expanded in the mailbox component"

This reverts commit fff60bac426411336870ba54dfe9c7af0c080e53.

  • test fix and revert

  • test fix

  • Update components/email/src/Email.svelte

krisgardiner
krisgardiner

Added auto theme based on user selected system theme for composer (#348)

  • Added auto theme for composer

  • added auto option

Added auto theme for composer

  • Fixed type error
krisgardiner
krisgardiner

Revert "Svelte child components (#331)" (#355)

This reverts commit c5a527176d87b6753a921c7d0dcaac8d4e449dc6.

krisgardiner
krisgardiner
krisgardiner
krisgardiner

[agenda] add min height to body of agenda (#339)

krisgardiner
krisgardiner

Prevent threadClicked from firing twice (#357)

krisgardiner
krisgardiner

[contact-list] support group prop (#341)

  • [contact-list] support group prop

  • [contact-list] fix broken tests

krisgardiner
krisgardiner

[availability] Improved performance of calculating list view options with consecutive availability (#352)

krisgardiner
krisgardiner

[Mailbox][Bug-fix]: Reply-all feature should include all participants except from & to within cc (#358)

krisgardiner
krisgardiner

[email] Show attachments in email condensed and expanded views (#359)

krisgardiner
krisgardiner

detect respone error messages from api (#354)

krisgardiner
krisgardiner

fix email tests (#353)

modify single sender message cc field for new canReplyAll check

adds default return value when you.email doesnt exist

commit sha: 638fbf6adac35f3ac8772b826a98c0fc592fefec

push time in 7 hours ago
open pull request

krisgardiner wants to merge nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

krisgardiner
krisgardiner

sveltes #await expects a Promise so I'm being explicit here rather than implicitly returning.

pull request

krisgardiner merge to nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

pull request

philrenaud merge to nylas/components

philrenaud
philrenaud

[availability] emit an event when displayed dates change

Adds a dispatcher that can be observed from a parent app anytime the dates in the Availability component change. Will only fire if the dates themselves change, regardless of how often the days reactive object changes.

Added an event listener from the index demo for availability

Note: had trouble working out how to get Cypress to wait for viewport changes in order to test dispatched array length, but manually testing reveals this works.

image

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

open pull request

philrenaud wants to merge nylas/components

philrenaud
philrenaud

[availability] emit an event when displayed dates change

Adds a dispatcher that can be observed from a parent app anytime the dates in the Availability component change. Will only fire if the dates themselves change, regardless of how often the days reactive object changes.

Added an event listener from the index demo for availability

Note: had trouble working out how to get Cypress to wait for viewport changes in order to test dispatched array length, but manually testing reveals this works.

image

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

philrenaud
philrenaud

We set canonicalDates to something else on line 836.

Try firing this up locally and see what the proposed modifications do to the dispatch; you'll see it changes the frequency to unnecessarily often.

pull request

pooja169usp merge to nylas/components

pooja169usp
pooja169usp

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

open pull request

pooja169usp wants to merge nylas/components

pooja169usp
pooja169usp

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

pooja169usp
pooja169usp
open pull request

krisgardiner wants to merge nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

krisgardiner
krisgardiner

Unfortunately, I don't see a way of simplifying this logic until we have child svelte components.

pull request

krisgardiner merge to nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

open pull request

krisgardiner wants to merge nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

krisgardiner
krisgardiner

_type to avoid conflict with API response payloads. _ to indicate that it's local to this component.

pull request

krisgardiner merge to nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

pull request

krisgardiner merge to nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

When I receive an email from someone including 3 CC and 4 BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

push

krisgardiner push nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

commit sha: 507a402e07320b02be682c359bb7ce25f8e778d5

push time in 9 hours ago
push

krisgardiner push nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

commit sha: 83257096d6abdcd201610e20c47b20d9dc2c14f4

push time in 9 hours ago
pull request

james10424 merge to nylas/components

james10424
james10424

[availability] emit an event when displayed dates change

Adds a dispatcher that can be observed from a parent app anytime the dates in the Availability component change. Will only fire if the dates themselves change, regardless of how often the days reactive object changes.

Added an event listener from the index demo for availability

Note: had trouble working out how to get Cypress to wait for viewport changes in order to test dispatched array length, but manually testing reveals this works.

image

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

open pull request

james10424 wants to merge nylas/components

james10424
james10424

[availability] emit an event when displayed dates change

Adds a dispatcher that can be observed from a parent app anytime the dates in the Availability component change. Will only fire if the dates themselves change, regardless of how often the days reactive object changes.

Added an event listener from the index demo for availability

Note: had trouble working out how to get Cypress to wait for viewport changes in order to test dispatched array length, but manually testing reveals this works.

image

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

james10424
james10424

Interesting to know, but don't you want it to fire when days is modified? So this won't get dateChanged dispatch because you converted it to a string? If you don't want to fire it when days is modified, then what's the point of $:? What about the variable canonicalDates? JSON.stringify(canonicalDates) can totally be JSON.stringify([]).

push

krisgardiner push nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

commit sha: 4e0371231d82c4a872f7eb3f8c463ee8ba6d02c8

push time in 9 hours ago
Activity icon
issue

shortcut-integration[bot] issue comment nylas/components

shortcut-integration[bot]
shortcut-integration[bot]

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Activity icon
issue

vercel[bot] issue comment nylas/components

vercel[bot]
vercel[bot]

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

vercel[bot]
vercel[bot]

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nylas/components/HEt3otw8L9x7Ed1MswYYzshbZ3Xm
✅ Preview: https://components-git-kg-sc-77406email-does-not-display-cc-bcc-nylas.vercel.app

pull request

krisgardiner pull request nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

Code changes

  • showing CC and BCC fields for expanded email

Screenshots:

When I send an email to others including CC and BCC: image

When I send an email to others more than PARTICIPANTS_TO_TRUNCATE including CC and BCC: image

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

push

krisgardiner push nylas/components

krisgardiner
krisgardiner

[email] display cc and bcc fields

commit sha: 14b1df1f7936bd988f6bfa7377bee782e501b5be

push time in 9 hours ago
Activity icon
created branch

krisgardiner in nylas/components create branch kg/sc-77406/email-does-not-display-cc-bcc

createdAt 9 hours ago
open pull request

mrashed-dev wants to merge nylas/nylas-nodejs

mrashed-dev
mrashed-dev

[78781] Support new `calendars` field in free-busy/availability queries

Description

In the free busy, availability, and consecutive availability endpoints of the Nylas Calendar API, there's a new field (calendar) that can be substituted for emails in the event that someone wants to check for availability/free-busy of other calendars within the same organization.

Usage

Nylas.config({clientId: 'clientId', clientSecret: 'clientSecret'});
const nylas = Nylas.with('access_token');

// To check free-busy with calendars:
const freeBusy = nylas.calendars.freeBusy({
  startTime: 1590454800,
  endTime: 1590780800,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

// To check availability with calendars:
const availability = nylas.calendars.availability({
  startTime: 1590454800,
  endTime: 1590780800,
  interval: 5,
  duration: 30,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

// To check consecutive availability with calendars:
const availability = nylas.calendars.consecutiveAvailability({
  startTime: 1590454800,
  endTime: 1590780800,
  interval: 5,
  duration: 30,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

mrashed-dev
mrashed-dev

@james10424 that's a great callout, I'm not sure how it got missed during the refactor. Unfortunately if I were to make this change now, it would likely be considered a breaking change as people would need to adapt their code to the new keywords. Thus I wouldn't be able to make this change until the next major release. I've created a shortcut story to track this change when the time comes for the next major release though: https://app.shortcut.com/nylas/story/79594/update-availability-queries-to-match-api-notati

pull request

mrashed-dev merge to nylas/nylas-nodejs

mrashed-dev
mrashed-dev

[78781] Support new `calendars` field in free-busy/availability queries

Description

In the free busy, availability, and consecutive availability endpoints of the Nylas Calendar API, there's a new field (calendar) that can be substituted for emails in the event that someone wants to check for availability/free-busy of other calendars within the same organization.

Usage

Nylas.config({clientId: 'clientId', clientSecret: 'clientSecret'});
const nylas = Nylas.with('access_token');

// To check free-busy with calendars:
const freeBusy = nylas.calendars.freeBusy({
  startTime: 1590454800,
  endTime: 1590780800,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

// To check availability with calendars:
const availability = nylas.calendars.availability({
  startTime: 1590454800,
  endTime: 1590780800,
  interval: 5,
  duration: 30,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

// To check consecutive availability with calendars:
const availability = nylas.calendars.consecutiveAvailability({
  startTime: 1590454800,
  endTime: 1590780800,
  interval: 5,
  duration: 30,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

open pull request

james10424 wants to merge nylas/nylas-nodejs

james10424
james10424

[78781] Support new `calendars` field in free-busy/availability queries

Description

In the free busy, availability, and consecutive availability endpoints of the Nylas Calendar API, there's a new field (calendar) that can be substituted for emails in the event that someone wants to check for availability/free-busy of other calendars within the same organization.

Usage

Nylas.config({clientId: 'clientId', clientSecret: 'clientSecret'});
const nylas = Nylas.with('access_token');

// To check free-busy with calendars:
const freeBusy = nylas.calendars.freeBusy({
  startTime: 1590454800,
  endTime: 1590780800,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

// To check availability with calendars:
const availability = nylas.calendars.availability({
  startTime: 1590454800,
  endTime: 1590780800,
  interval: 5,
  duration: 30,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

// To check consecutive availability with calendars:
const availability = nylas.calendars.consecutiveAvailability({
  startTime: 1590454800,
  endTime: 1590780800,
  interval: 5,
  duration: 30,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

james10424
james10424

Is there a reason why minutes is omitted? It would be better to stay consistent with the API

pull request

james10424 merge to nylas/nylas-nodejs

james10424
james10424

[78781] Support new `calendars` field in free-busy/availability queries

Description

In the free busy, availability, and consecutive availability endpoints of the Nylas Calendar API, there's a new field (calendar) that can be substituted for emails in the event that someone wants to check for availability/free-busy of other calendars within the same organization.

Usage

Nylas.config({clientId: 'clientId', clientSecret: 'clientSecret'});
const nylas = Nylas.with('access_token');

// To check free-busy with calendars:
const freeBusy = nylas.calendars.freeBusy({
  startTime: 1590454800,
  endTime: 1590780800,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

// To check availability with calendars:
const availability = nylas.calendars.availability({
  startTime: 1590454800,
  endTime: 1590780800,
  interval: 5,
  duration: 30,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

// To check consecutive availability with calendars:
const availability = nylas.calendars.consecutiveAvailability({
  startTime: 1590454800,
  endTime: 1590780800,
  interval: 5,
  duration: 30,
  calendars: [{
    accountId: "test_account_id",
    calendarIds: [
      "example_calendar_id_A",
       "example_calendar_id_B",
    ],
  }],
});

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

open pull request

philrenaud wants to merge nylas/components

philrenaud
philrenaud

[availability] emit an event when displayed dates change

Adds a dispatcher that can be observed from a parent app anytime the dates in the Availability component change. Will only fire if the dates themselves change, regardless of how often the days reactive object changes.

Added an event listener from the index demo for availability

Note: had trouble working out how to get Cypress to wait for viewport changes in order to test dispatched array length, but manually testing reveals this works.

image

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

philrenaud
philrenaud

Hey @james10424 , days is a reactive variable; it updates elsewhere. What we're comparing here is the dates shown in days.

This string compare prevents multiple dispatches from firing to the parent app. If we commit your suggestion here, we'll get a dateChanged dispatch several times unnecessarily (the days array is modified, and therefore all $: statements with days as a dependent fire, whenever someone hovers on a timeslot for example)

Previous