@dereekb/calcom 13.11.2 → 13.11.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/index.cjs.js +9 -0
- package/index.esm.js +9 -0
- package/nestjs/package.json +5 -5
- package/package.json +4 -4
- package/src/lib/calcom/calcom.api.booking.d.ts +1 -0
- package/src/lib/calcom/calcom.api.eventtype.d.ts +1 -0
- package/src/lib/calcom/calcom.api.webhook.d.ts +1 -0
- package/src/lib/calcom/calcom.factory.d.ts +1 -0
- package/src/lib/calcom.error.api.d.ts +2 -0
- package/src/lib/oauth/oauth.d.ts +1 -0
- package/src/lib/oauth/oauth.factory.d.ts +2 -0
package/index.cjs.js
CHANGED
|
@@ -269,6 +269,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
269
269
|
*
|
|
270
270
|
* @param calcomApiNamePrefix Prefix to use when logging. I.E. CalcomError, etc.
|
|
271
271
|
* @returns a LogCalcomServerErrorFunction that logs errors with the given prefix
|
|
272
|
+
* @__NO_SIDE_EFFECTS__
|
|
272
273
|
*/ function logCalcomServerErrorFunction(calcomApiNamePrefix) {
|
|
273
274
|
return function(error) {
|
|
274
275
|
if (_instanceof(error, CalcomServerFetchResponseError)) {
|
|
@@ -293,6 +294,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
293
294
|
* @param parseCalcomError - function to parse a FetchResponseError into a CalcomServerError
|
|
294
295
|
* @param defaultLogError - default error logging function used when no override is provided
|
|
295
296
|
* @returns a factory that wraps any ConfiguredFetch with Cal.com error handling
|
|
297
|
+
* @__NO_SIDE_EFFECTS__
|
|
296
298
|
*/ function handleCalcomErrorFetchFactory(parseCalcomError, defaultLogError) {
|
|
297
299
|
return function(fetch$1) {
|
|
298
300
|
var logError = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultLogError;
|
|
@@ -1026,6 +1028,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1026
1028
|
*
|
|
1027
1029
|
* @param calcomAccessTokenFactory - the factory that produces CalcomAccessToken objects
|
|
1028
1030
|
* @returns a factory function that returns the access token string
|
|
1031
|
+
* @__NO_SIDE_EFFECTS__
|
|
1029
1032
|
*/ function calcomAccessTokenStringFactory(calcomAccessTokenFactory) {
|
|
1030
1033
|
return function() {
|
|
1031
1034
|
return _async_to_generator$2(function() {
|
|
@@ -1258,6 +1261,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
1258
1261
|
*
|
|
1259
1262
|
* @param factoryConfig - configuration including OAuth context, rate limiter, and optional fetch/logging overrides
|
|
1260
1263
|
* @returns a factory function that accepts a CalcomConfig and produces a Calcom instance
|
|
1264
|
+
* @__NO_SIDE_EFFECTS__
|
|
1261
1265
|
*/ function calcomFactory(factoryConfig) {
|
|
1262
1266
|
var oauthContext = factoryConfig.oauthContext;
|
|
1263
1267
|
var serverAccessTokenStringFactory = calcomAccessTokenStringFactory(oauthContext.loadAccessToken);
|
|
@@ -1499,6 +1503,7 @@ var CALCOM_API_VERSION_HEADER = 'cal-api-version';
|
|
|
1499
1503
|
* });
|
|
1500
1504
|
* console.log(response.data.uid);
|
|
1501
1505
|
* ```
|
|
1506
|
+
* @__NO_SIDE_EFFECTS__
|
|
1502
1507
|
*/ function createBooking(context) {
|
|
1503
1508
|
return function(input) {
|
|
1504
1509
|
return context.fetchJson('/bookings', {
|
|
@@ -1593,6 +1598,7 @@ var CALCOM_API_VERSION_HEADER = 'cal-api-version';
|
|
|
1593
1598
|
* });
|
|
1594
1599
|
* console.log(response.data.id);
|
|
1595
1600
|
* ```
|
|
1601
|
+
* @__NO_SIDE_EFFECTS__
|
|
1596
1602
|
*/ function createEventType(context) {
|
|
1597
1603
|
return function(input) {
|
|
1598
1604
|
return context.fetchJson('/event-types', {
|
|
@@ -1714,6 +1720,7 @@ var CALCOM_API_VERSION_HEADER = 'cal-api-version';
|
|
|
1714
1720
|
* });
|
|
1715
1721
|
* console.log(response.data.id);
|
|
1716
1722
|
* ```
|
|
1723
|
+
* @__NO_SIDE_EFFECTS__
|
|
1717
1724
|
*/ function createWebhook(context) {
|
|
1718
1725
|
return function(input) {
|
|
1719
1726
|
return context.fetchJson('/webhooks', {
|
|
@@ -2011,6 +2018,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2011
2018
|
*
|
|
2012
2019
|
* @param factoryConfig - configuration including optional fetch factory and error logging
|
|
2013
2020
|
* @returns a factory function that accepts a CalcomOAuthConfig and produces a CalcomOAuth instance
|
|
2021
|
+
* @__NO_SIDE_EFFECTS__
|
|
2014
2022
|
*/ function calcomOAuthFactory(factoryConfig) {
|
|
2015
2023
|
var fetchHandler = calcomRateLimitedFetchHandler();
|
|
2016
2024
|
var logCalcomServerErrorFunction = factoryConfig.logCalcomServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function(_) {
|
|
@@ -2171,6 +2179,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2171
2179
|
*
|
|
2172
2180
|
* @param config - configuration including the token refresher, optional cache, and expiration buffer
|
|
2173
2181
|
* @returns a CalcomAccessTokenFactory that returns a valid access token on each call
|
|
2182
|
+
* @__NO_SIDE_EFFECTS__
|
|
2174
2183
|
*/ function calcomOAuthAccessTokenFactory(config) {
|
|
2175
2184
|
var tokenRefresher = config.tokenRefresher, accessTokenCache = config.accessTokenCache, inputTokenExpirationBuffer = config.tokenExpirationBuffer;
|
|
2176
2185
|
var tokenExpirationBuffer = inputTokenExpirationBuffer !== null && inputTokenExpirationBuffer !== void 0 ? inputTokenExpirationBuffer : util.MS_IN_MINUTE;
|
package/index.esm.js
CHANGED
|
@@ -267,6 +267,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
267
267
|
*
|
|
268
268
|
* @param calcomApiNamePrefix Prefix to use when logging. I.E. CalcomError, etc.
|
|
269
269
|
* @returns a LogCalcomServerErrorFunction that logs errors with the given prefix
|
|
270
|
+
* @__NO_SIDE_EFFECTS__
|
|
270
271
|
*/ function logCalcomServerErrorFunction(calcomApiNamePrefix) {
|
|
271
272
|
return function(error) {
|
|
272
273
|
if (_instanceof(error, CalcomServerFetchResponseError)) {
|
|
@@ -291,6 +292,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
291
292
|
* @param parseCalcomError - function to parse a FetchResponseError into a CalcomServerError
|
|
292
293
|
* @param defaultLogError - default error logging function used when no override is provided
|
|
293
294
|
* @returns a factory that wraps any ConfiguredFetch with Cal.com error handling
|
|
295
|
+
* @__NO_SIDE_EFFECTS__
|
|
294
296
|
*/ function handleCalcomErrorFetchFactory(parseCalcomError, defaultLogError) {
|
|
295
297
|
return function(fetch) {
|
|
296
298
|
var logError = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultLogError;
|
|
@@ -1024,6 +1026,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1024
1026
|
*
|
|
1025
1027
|
* @param calcomAccessTokenFactory - the factory that produces CalcomAccessToken objects
|
|
1026
1028
|
* @returns a factory function that returns the access token string
|
|
1029
|
+
* @__NO_SIDE_EFFECTS__
|
|
1027
1030
|
*/ function calcomAccessTokenStringFactory(calcomAccessTokenFactory) {
|
|
1028
1031
|
return function() {
|
|
1029
1032
|
return _async_to_generator$2(function() {
|
|
@@ -1256,6 +1259,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
1256
1259
|
*
|
|
1257
1260
|
* @param factoryConfig - configuration including OAuth context, rate limiter, and optional fetch/logging overrides
|
|
1258
1261
|
* @returns a factory function that accepts a CalcomConfig and produces a Calcom instance
|
|
1262
|
+
* @__NO_SIDE_EFFECTS__
|
|
1259
1263
|
*/ function calcomFactory(factoryConfig) {
|
|
1260
1264
|
var oauthContext = factoryConfig.oauthContext;
|
|
1261
1265
|
var serverAccessTokenStringFactory = calcomAccessTokenStringFactory(oauthContext.loadAccessToken);
|
|
@@ -1497,6 +1501,7 @@ var CALCOM_API_VERSION_HEADER = 'cal-api-version';
|
|
|
1497
1501
|
* });
|
|
1498
1502
|
* console.log(response.data.uid);
|
|
1499
1503
|
* ```
|
|
1504
|
+
* @__NO_SIDE_EFFECTS__
|
|
1500
1505
|
*/ function createBooking(context) {
|
|
1501
1506
|
return function(input) {
|
|
1502
1507
|
return context.fetchJson('/bookings', {
|
|
@@ -1591,6 +1596,7 @@ var CALCOM_API_VERSION_HEADER = 'cal-api-version';
|
|
|
1591
1596
|
* });
|
|
1592
1597
|
* console.log(response.data.id);
|
|
1593
1598
|
* ```
|
|
1599
|
+
* @__NO_SIDE_EFFECTS__
|
|
1594
1600
|
*/ function createEventType(context) {
|
|
1595
1601
|
return function(input) {
|
|
1596
1602
|
return context.fetchJson('/event-types', {
|
|
@@ -1712,6 +1718,7 @@ var CALCOM_API_VERSION_HEADER = 'cal-api-version';
|
|
|
1712
1718
|
* });
|
|
1713
1719
|
* console.log(response.data.id);
|
|
1714
1720
|
* ```
|
|
1721
|
+
* @__NO_SIDE_EFFECTS__
|
|
1715
1722
|
*/ function createWebhook(context) {
|
|
1716
1723
|
return function(input) {
|
|
1717
1724
|
return context.fetchJson('/webhooks', {
|
|
@@ -2009,6 +2016,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2009
2016
|
*
|
|
2010
2017
|
* @param factoryConfig - configuration including optional fetch factory and error logging
|
|
2011
2018
|
* @returns a factory function that accepts a CalcomOAuthConfig and produces a CalcomOAuth instance
|
|
2019
|
+
* @__NO_SIDE_EFFECTS__
|
|
2012
2020
|
*/ function calcomOAuthFactory(factoryConfig) {
|
|
2013
2021
|
var fetchHandler = calcomRateLimitedFetchHandler();
|
|
2014
2022
|
var logCalcomServerErrorFunction = factoryConfig.logCalcomServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function(_) {
|
|
@@ -2169,6 +2177,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2169
2177
|
*
|
|
2170
2178
|
* @param config - configuration including the token refresher, optional cache, and expiration buffer
|
|
2171
2179
|
* @returns a CalcomAccessTokenFactory that returns a valid access token on each call
|
|
2180
|
+
* @__NO_SIDE_EFFECTS__
|
|
2172
2181
|
*/ function calcomOAuthAccessTokenFactory(config) {
|
|
2173
2182
|
var tokenRefresher = config.tokenRefresher, accessTokenCache = config.accessTokenCache, inputTokenExpirationBuffer = config.tokenExpirationBuffer;
|
|
2174
2183
|
var tokenExpirationBuffer = inputTokenExpirationBuffer !== null && inputTokenExpirationBuffer !== void 0 ? inputTokenExpirationBuffer : MS_IN_MINUTE;
|
package/nestjs/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/calcom/nestjs",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/nestjs": "13.11.
|
|
6
|
-
"@dereekb/rxjs": "13.11.
|
|
7
|
-
"@dereekb/util": "13.11.
|
|
8
|
-
"@dereekb/calcom": "13.11.
|
|
5
|
+
"@dereekb/nestjs": "13.11.3",
|
|
6
|
+
"@dereekb/rxjs": "13.11.3",
|
|
7
|
+
"@dereekb/util": "13.11.3",
|
|
8
|
+
"@dereekb/calcom": "13.11.3",
|
|
9
9
|
"@nestjs/common": "^11.1.19",
|
|
10
10
|
"@nestjs/config": "^4.0.4",
|
|
11
11
|
"express": "^5.2.1"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/calcom",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.3",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./nestjs": {
|
|
6
6
|
"module": "./nestjs/index.esm.js",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@dereekb/nestjs": "13.11.
|
|
21
|
-
"@dereekb/rxjs": "13.11.
|
|
22
|
-
"@dereekb/util": "13.11.
|
|
20
|
+
"@dereekb/nestjs": "13.11.3",
|
|
21
|
+
"@dereekb/rxjs": "13.11.3",
|
|
22
|
+
"@dereekb/util": "13.11.3",
|
|
23
23
|
"@nestjs/common": "^11.1.19",
|
|
24
24
|
"@nestjs/config": "^4.0.4",
|
|
25
25
|
"express": "^5.2.1",
|
|
@@ -62,6 +62,7 @@ export interface CalcomCancelBookingResponse {
|
|
|
62
62
|
* });
|
|
63
63
|
* console.log(response.data.uid);
|
|
64
64
|
* ```
|
|
65
|
+
* @__NO_SIDE_EFFECTS__
|
|
65
66
|
*/
|
|
66
67
|
export declare function createBooking(context: CalcomContext): (input: CalcomCreateBookingInput) => Promise<CalcomCreateBookingResponse>;
|
|
67
68
|
/**
|
|
@@ -65,6 +65,7 @@ export declare function getEventTypes(context: CalcomContext): () => Promise<Cal
|
|
|
65
65
|
* });
|
|
66
66
|
* console.log(response.data.id);
|
|
67
67
|
* ```
|
|
68
|
+
* @__NO_SIDE_EFFECTS__
|
|
68
69
|
*/
|
|
69
70
|
export declare function createEventType(context: CalcomContext): (input: CalcomCreateEventTypeInput) => Promise<CalcomEventTypeResponse>;
|
|
70
71
|
/**
|
|
@@ -50,6 +50,7 @@ export interface CalcomGetWebhooksResponse {
|
|
|
50
50
|
* });
|
|
51
51
|
* console.log(response.data.id);
|
|
52
52
|
* ```
|
|
53
|
+
* @__NO_SIDE_EFFECTS__
|
|
53
54
|
*/
|
|
54
55
|
export declare function createWebhook(context: CalcomContext): (input: CalcomCreateWebhookInput) => Promise<CalcomWebhookResponse>;
|
|
55
56
|
/**
|
|
@@ -27,5 +27,6 @@ export type CalcomFactory = (config: CalcomConfig) => Calcom;
|
|
|
27
27
|
*
|
|
28
28
|
* @param factoryConfig - configuration including OAuth context, rate limiter, and optional fetch/logging overrides
|
|
29
29
|
* @returns a factory function that accepts a CalcomConfig and produces a Calcom instance
|
|
30
|
+
* @__NO_SIDE_EFFECTS__
|
|
30
31
|
*/
|
|
31
32
|
export declare function calcomFactory(factoryConfig: CalcomFactoryConfig): CalcomFactory;
|
|
@@ -41,6 +41,7 @@ export type LogCalcomServerErrorFunction = (error: FetchRequestFactoryError | Ca
|
|
|
41
41
|
*
|
|
42
42
|
* @param calcomApiNamePrefix Prefix to use when logging. I.E. CalcomError, etc.
|
|
43
43
|
* @returns a LogCalcomServerErrorFunction that logs errors with the given prefix
|
|
44
|
+
* @__NO_SIDE_EFFECTS__
|
|
44
45
|
*/
|
|
45
46
|
export declare function logCalcomServerErrorFunction(calcomApiNamePrefix: string): LogCalcomServerErrorFunction;
|
|
46
47
|
/**
|
|
@@ -55,6 +56,7 @@ export type ParseCalcomFetchResponseErrorFunction = (responseError: FetchRespons
|
|
|
55
56
|
* @param parseCalcomError - function to parse a FetchResponseError into a CalcomServerError
|
|
56
57
|
* @param defaultLogError - default error logging function used when no override is provided
|
|
57
58
|
* @returns a factory that wraps any ConfiguredFetch with Cal.com error handling
|
|
59
|
+
* @__NO_SIDE_EFFECTS__
|
|
58
60
|
*/
|
|
59
61
|
export declare function handleCalcomErrorFetchFactory(parseCalcomError: ParseCalcomFetchResponseErrorFunction, defaultLogError: LogCalcomServerErrorFunction): HandleCalcomErrorFetchFactory;
|
|
60
62
|
/**
|
package/src/lib/oauth/oauth.d.ts
CHANGED
|
@@ -65,5 +65,6 @@ export type CalcomAccessTokenStringFactory = () => Promise<CalcomAccessTokenStri
|
|
|
65
65
|
*
|
|
66
66
|
* @param calcomAccessTokenFactory - the factory that produces CalcomAccessToken objects
|
|
67
67
|
* @returns a factory function that returns the access token string
|
|
68
|
+
* @__NO_SIDE_EFFECTS__
|
|
68
69
|
*/
|
|
69
70
|
export declare function calcomAccessTokenStringFactory(calcomAccessTokenFactory: CalcomAccessTokenFactory): CalcomAccessTokenStringFactory;
|
|
@@ -21,6 +21,7 @@ export type CalcomOAuthFactory = (config: CalcomOAuthConfig) => CalcomOAuth;
|
|
|
21
21
|
*
|
|
22
22
|
* @param factoryConfig - configuration including optional fetch factory and error logging
|
|
23
23
|
* @returns a factory function that accepts a CalcomOAuthConfig and produces a CalcomOAuth instance
|
|
24
|
+
* @__NO_SIDE_EFFECTS__
|
|
24
25
|
*/
|
|
25
26
|
export declare function calcomOAuthFactory(factoryConfig: CalcomOAuthFactoryConfig): CalcomOAuthFactory;
|
|
26
27
|
export interface CalcomOAuthAccessTokenFactoryConfig {
|
|
@@ -40,5 +41,6 @@ export interface CalcomOAuthAccessTokenFactoryConfig {
|
|
|
40
41
|
*
|
|
41
42
|
* @param config - configuration including the token refresher, optional cache, and expiration buffer
|
|
42
43
|
* @returns a CalcomAccessTokenFactory that returns a valid access token on each call
|
|
44
|
+
* @__NO_SIDE_EFFECTS__
|
|
43
45
|
*/
|
|
44
46
|
export declare function calcomOAuthAccessTokenFactory(config: CalcomOAuthAccessTokenFactoryConfig): CalcomAccessTokenFactory;
|