timekit-io / js-sdk Goto Github PK
View Code? Open in Web Editor NEW:star2: JavaScript SDK for Timekit's scheduling & calendar API
Home Page: http://developers.timekit.io
:star2: JavaScript SDK for Timekit's scheduling & calendar API
Home Page: http://developers.timekit.io
Hi there,
We are getting security alerts due to the use of this library which is depending on quite an old version of axios.
Could you please update to axios version 0.18.1 or later?
Hi!
orderBy event.start & event.end doesnt work when using .getGroupBookings()
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'event.start' in 'order clause' (SQL: select bookings
.* from bookings
where app_id
= 34445 and project_id
= 131273 and exists (select * from booking_attributes
where bookings
.id
= booking_attributes
.booking_id
and group
= event_info and name
= start and value
>= 2021-12-12 14:48:03) and (state
= tentative and graph
= group_owner) and exists (select * from booking_attributes
where bookings
.id
= booking_attributes
.booking_id
and group
= group_booking and name
= available_seats and value
> 0) order by event
.start
desc limit 10 offset 0)
Erik from Sweden Unlimited here. I'm looking for a way to set up a testing account to use in unit testing our Timekit based scheduling app. In order for this to work, I have to be able to either delete users or delete an app wholesale to clear the users. Since there's no DELETE route for either of those resources, it doesn't seem that there's a clean way to do this at the moment.
UPDATE
I see that there is now a 'DELETE' route for apps in the SDK. However, when I attempt to use this method to delete a test app, the API responds with a 404 error. Is the delete route for apps not actually implemented?
unable to start
When attempting to create a new event for a user, I receive a 500 error in response.
Sample request body with UUID obfuscated:
{
start: 'Wed Nov 11 2015 15:34:45 GMT-0500 (EST)',
end: 'Wed Nov 11 2015 16:34:45 GMT-0500 (EST)',
what: 'Appointment with Foo Bar',
where: 'http://some.url',
calendar_id: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
I think perhaps the format of my date time strings is not what the API is expecting, however there isn't any documentation of the correct format for the start
and end
properties in the Timekit docs.
https://github.com/timekit-io/js-sdk/blob/master/src/endpoints.js#L329-L340
How to restrict to a project_id or resource id or calendar id?
timekitEventsResponse = await timekit.getEvents({
page,
// calendar_id: '3f5e3a3e-900d-4ef5-a3f2-u23hid2', // Does nothing
// project_id: '5cd55254-4762-4b45-b58b-aa6f69e3751', // Same
// resource_id: '308040d6-357d-4da8-885e-232hd23d', // Same
start,
end,
});
I'm trying to get resource IDs to include in a /findtime/team
API call, but I don't see any documentation for how do to that?
Am I missing something?
I was trying to check the last activity of this sdk and I see it's using v2 TimeKit API but it doesn't have the new endpoints for Availability nor I see a deprecation notice for the /findTime endpoints.
Is it coming soon?
Thanks.
I have entered an event in Microsoft Calendar. But I am not getting proper time slots. The time slot that is booked on Microsoft Calendar, is shown as available.
v1.19.0 of this package is not yet available through npm. Are there plans to publish it there soon?
please put this in the sdk. ๐
https://developers.timekit.io/reference/appsinvite
thanks!
Steps to reproduce:
I am getting '500 - Internal Server Error' on updating Microsoft Calendar. I updated it with false and it run smooth. But when I try to update it with true there is problem. I have made new account and calendar. We had an old account (we recently changed password of old one and than cleared all permissions); but we got '502 - Bad Gateway'. For google it runs smooth.
It would be really helpful to know these to reduce trial and error.
Hi,
Theres a vulnerability with axios, a dependency of the timekitsdk and I've been trying to update it to the fixed version of 0.19.0 but it seems to not be doing the trick.
Thinking maybe something that needs to be fixed on your guys side of things?
I'm a newbie to this so apologies if there is a fix I can't see.
It would be great if this project included TypeScript typings!
I am writing an app in Ionic. I have read through the docs and can't find a way to authenticate properly with an API key (without booking-js). Only credentials. The only way to authenticate in the examples in the repo is with a plaintext username and password. This is obviously unacceptable in a mobile app. How might I authenticate given my situation?
Used the endpoint described here.
Passed a Project ID and a resource who was not part of the project in the request. Request returned availability for that specific resource, even though that person was not in the project.
In the documentation there is an endpoint for deleting a resource but this doesn't seem to exist in this sdk. Will try to make a PR for this ASAP.
the code is as simple as this:
await Timekit.sdk.updateBooking({id: id, action: action});
the data passed is:
{
"id": "41ca328e-7cd1-48d9-a5b2-a822a6899b3c",
"action": "confirm"
}
and in I'm getting response with statusMessage: 'Unprocessable Entity',
and data: { error: 'Index 1: url: Invalid URL format, ' }
here is full response object:
{
status: 422,
statusText: 'Unprocessable Entity',
headers: {
server: 'nginx/1.9.13',
'content-type': 'application/json',
'transfer-encoding': 'chunked',
connection: 'close',
'cache-control': 'no-cache',
vary: 'Origin',
'x-ratelimit-remaining': '806',
'timekit-testmode': 'true',
'access-control-expose-headers': 'Timekit-TestMode',
'timekit-request-id': 'd37d74e7-5a37-44e0-bf3e-87c4c28c721c',
date: 'Mon, 27 Apr 2020 07:17:19 GMT',
'set-cookie': [
'laravel_session=sUd7O6IqeHQSQRaiPRJO5OcVHmR66ZjCwHz5Werl; expires=Mon, 27-Apr-2020 09:17:19 GMT; Max-Age=7200; path=/; HttpOnly'
]
},
config: {
transformRequest: { '0': [Function: transformRequest] },
transformResponse: { '0': [Function: transformResponse] },
headers: {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json;charset=utf-8',
Authorization: 'Basic OnRlc3RfYXBpX2tleV9oUnE4bjBEVWxENnhLeWtUNlR1djc3dTltbVRpUUdOMA==',
'User-Agent': 'axios/0.12.0',
'Content-Length': 2
},
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus],
method: 'put',
url: 'https://api.timekit.io/v2/bookings/41ca328e-7cd1-48d9-a5b2-a822a6899b3c/confirm',
data: '{}',
withCredentials: undefined
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype] {
error: [Function: handleRequestError],
prefinish: [Function: requestOnPrefinish]
},
_eventsCount: 2,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: 2,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'api.timekit.io',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: 'api.timekit.io',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular *1],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 5896,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
_header: 'PUT /v2/bookings/41ca328e-7cd1-48d9-a5b2-a822a6899b3c/confirm HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json;charset=utf-8\r\n' +
'Authorization: Basic OnRlc3RfYXBpX2tleV9oUnE4bjBEVWxENnhLeWtUNlR1djc3dTltbVRpUUdOMA==\r\n' +
'User-Agent: axios/0.12.0\r\n' +
'Content-Length: 2\r\n' +
'Host: api.timekit.io\r\n' +
'Connection: close\r\n' +
'\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'PUT',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/v2/bookings/41ca328e-7cd1-48d9-a5b2-a822a6899b3c/confirm',
_ended: true,
res: IncomingMessage {
_readableState: [ReadableState],
readable: false,
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
socket: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 422,
statusMessage: 'Unprocessable Entity',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular *1],
fetchedUrls: [Array],
[Symbol(kCapture)]: false
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
'content-type': [Array],
authorization: [Array],
'user-agent': [Array],
'content-length': [Array],
host: [Array]
}
},
data: { error: 'Index 1: url: Invalid URL format, ' }
}
I think it would be really nice if using this SDK you did not have to write the search
string yourself.
Ideally the API of this library would allow you to do something like:
timekit.getBookings({
search: {
'meta.some_property': 'someValue'
}
})
And this would be converted to a call to /bookings?search=meta.some_property:someValue
automatically.
A function like this should do the trick (quickly tested and tried in my own code using lodash/fp):
function createSearchString(search) {
const keyValues = fp.map.convert({ cap: false })(
(val, key) => `${key}:${val}`,
search
)
return keyValues.join(';')
}
Add support to connect to CalDav calendars like FastMail.
Hello everyone!
There is a small question. Does API (and SDK) support filtering events by "where" field. For example, I want to find all events for current location ('where' field).
Thanks.
With a created resource, try the following:
timekit.updateResource({
id: // resource-id,
name: 'New name'
})
When I do this I am unable to update the name
field, but I can confirm the update is working correctly as I am able to update the timezone
field.
Hello,
Line 527 in e249e86
The endpoint supports specifying the exact start and end times for bookings but not range.
For example I will like to get all bookings happening between 10/01/2020 - 12/01/2020.
Or I will like to get all bookings happening after 6pm today.
The reference docs do not mention anything about this feature.
https://developers.timekit.io/reference
I don't see a license file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.