recal-sdk 0.1.0
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/LICENSE +21 -0
- package/dist/entities/organization.d.ts +21 -0
- package/dist/entities/organization.d.ts.map +1 -0
- package/dist/entities/user.d.ts +23 -0
- package/dist/entities/user.d.ts.map +1 -0
- package/dist/errors.d.ts +22 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.mts +55 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7046 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +99 -0
- package/dist/index.mjs.map +1 -0
- package/dist/services/calendar.service.d.ts +106 -0
- package/dist/services/calendar.service.d.ts.map +1 -0
- package/dist/services/oauth.service.d.ts +78 -0
- package/dist/services/oauth.service.d.ts.map +1 -0
- package/dist/services/organizations.service.d.ts +63 -0
- package/dist/services/organizations.service.d.ts.map +1 -0
- package/dist/services/scheduling.service.d.ts +48 -0
- package/dist/services/scheduling.service.d.ts.map +1 -0
- package/dist/services/users.service.d.ts +46 -0
- package/dist/services/users.service.d.ts.map +1 -0
- package/dist/typebox/calendar.tb.d.ts +112 -0
- package/dist/typebox/calendar.tb.d.ts.map +1 -0
- package/dist/typebox/oauth.tb.d.ts +14 -0
- package/dist/typebox/oauth.tb.d.ts.map +1 -0
- package/dist/typebox/organization.stripped.tb.d.ts +6 -0
- package/dist/typebox/organization.stripped.tb.d.ts.map +1 -0
- package/dist/typebox/organization.tb.d.ts +10 -0
- package/dist/typebox/organization.tb.d.ts.map +1 -0
- package/dist/typebox/scheduling.tb.d.ts +94 -0
- package/dist/typebox/scheduling.tb.d.ts.map +1 -0
- package/dist/typebox/timeString.tb.d.ts +3 -0
- package/dist/typebox/timeString.tb.d.ts.map +1 -0
- package/dist/typebox/user.stripped.tb.d.ts +5 -0
- package/dist/typebox/user.stripped.tb.d.ts.map +1 -0
- package/dist/typebox/user.tb.d.ts +19 -0
- package/dist/typebox/user.tb.d.ts.map +1 -0
- package/dist/typedi.d.ts +3 -0
- package/dist/typedi.d.ts.map +1 -0
- package/dist/types/calendar.types.d.mts +72 -0
- package/dist/types/calendar.types.d.ts +125 -0
- package/dist/types/calendar.types.d.ts.map +1 -0
- package/dist/types/calendar.types.js +56 -0
- package/dist/types/calendar.types.js.map +1 -0
- package/dist/types/calendar.types.mjs +22 -0
- package/dist/types/calendar.types.mjs.map +1 -0
- package/dist/types/entity.types.d.mts +11 -0
- package/dist/types/entity.types.d.ts +11 -0
- package/dist/types/entity.types.js +22 -0
- package/dist/types/entity.types.js.map +1 -0
- package/dist/types/entity.types.mjs +1 -0
- package/dist/types/entity.types.mjs.map +1 -0
- package/dist/types/index.d.mts +12 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +58 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +22 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/internal.types.d.ts +7 -0
- package/dist/types/internal.types.d.ts.map +1 -0
- package/dist/types/oauth.types.d.ts +15 -0
- package/dist/types/oauth.types.d.ts.map +1 -0
- package/dist/types/scheduling.types.d.ts +48 -0
- package/dist/types/scheduling.types.d.ts.map +1 -0
- package/dist/utils/fetch.helper.d.ts +59 -0
- package/dist/utils/fetch.helper.d.ts.map +1 -0
- package/dist/utils/fetchErrorHandler.d.ts +22 -0
- package/dist/utils/fetchErrorHandler.d.ts.map +1 -0
- package/dist/utils/functionize.d.ts +5 -0
- package/dist/utils/functionize.d.ts.map +1 -0
- package/dist/utils/includes.helper.d.ts +4 -0
- package/dist/utils/includes.helper.d.ts.map +1 -0
- package/dist/utils/omit.d.ts +2 -0
- package/dist/utils/omit.d.ts.map +1 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Torben Köhler
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Static } from '@sinclair/typebox';
|
|
2
|
+
import type { organizationSchema } from 'src/typebox/organization.tb';
|
|
3
|
+
import type { FetchHelper } from '../utils/fetch.helper';
|
|
4
|
+
import { User } from './user';
|
|
5
|
+
export declare class Organization {
|
|
6
|
+
private fetchHelper;
|
|
7
|
+
slug: string;
|
|
8
|
+
name: string | null;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
members?: User[];
|
|
11
|
+
constructor({ slug, name, createdAt, members, fetchHelper, }: {
|
|
12
|
+
slug: string;
|
|
13
|
+
name: string | null;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
members?: User[];
|
|
16
|
+
fetchHelper: FetchHelper;
|
|
17
|
+
});
|
|
18
|
+
static fromJson(json: Static<typeof organizationSchema>, fetchHelper: FetchHelper): Organization;
|
|
19
|
+
getMembers(refetch?: boolean): Promise<User[]>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/entities/organization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,qBAAa,YAAY;IACrB,OAAO,CAAC,WAAW,CAAa;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,SAAS,EAAE,IAAI,CAAA;IACf,OAAO,CAAC,EAAE,IAAI,EAAE,CAAA;gBAEX,EACR,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,OAAO,EACP,WAAW,GACd,EAAE;QACC,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;QACnB,SAAS,EAAE,IAAI,CAAA;QACf,OAAO,CAAC,EAAE,IAAI,EAAE,CAAA;QAChB,WAAW,EAAE,WAAW,CAAA;KAC3B;IAQD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,kBAAkB,CAAC,EAAE,WAAW,EAAE,WAAW,GAAG,YAAY;IAQnF,UAAU,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAQ5D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Static } from '@sinclair/typebox';
|
|
2
|
+
import type { userSchema } from 'src/typebox/user.tb';
|
|
3
|
+
import type { OAuthConnection } from '../types/oauth.types';
|
|
4
|
+
import type { FetchHelper } from '../utils/fetch.helper';
|
|
5
|
+
import { Organization } from './organization';
|
|
6
|
+
export declare class User {
|
|
7
|
+
private fetchHelper;
|
|
8
|
+
id: string;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
organizations?: Organization[];
|
|
11
|
+
oauthConnections?: OAuthConnection[];
|
|
12
|
+
constructor({ id, createdAt, organizations, oauthConnections, fetchHelper, }: {
|
|
13
|
+
id: string;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
organizations?: Organization[];
|
|
16
|
+
oauthConnections?: OAuthConnection[];
|
|
17
|
+
fetchHelper: FetchHelper;
|
|
18
|
+
});
|
|
19
|
+
static fromJson(json: Static<typeof userSchema>, fetchHelper: FetchHelper): User;
|
|
20
|
+
getOrganizations(refetch?: boolean): Promise<Organization[]>;
|
|
21
|
+
getOAuthConnections(refetch?: boolean): Promise<OAuthConnection[]>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/entities/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAI/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,qBAAa,IAAI;IACb,OAAO,CAAC,WAAW,CAAa;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,IAAI,CAAA;IACf,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IAC9B,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAA;gBAE/B,EACR,EAAE,EACF,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,WAAW,GACd,EAAE;QACC,EAAE,EAAE,MAAM,CAAA;QACV,SAAS,EAAE,IAAI,CAAA;QACf,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;QAC9B,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAA;QACpC,WAAW,EAAE,WAAW,CAAA;KAC3B;IAQD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,UAAU,CAAC,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI;IASnE,gBAAgB,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAU1D,mBAAmB,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAQhF"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare class OrganizationNotFoundError extends Error {
|
|
2
|
+
constructor(slug: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class OrganizationAlreadyExistsError extends Error {
|
|
5
|
+
constructor(slug: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class UserAlreadyExistsError extends Error {
|
|
8
|
+
constructor(userId: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class UserNotFoundError extends Error {
|
|
11
|
+
constructor(userId: string);
|
|
12
|
+
}
|
|
13
|
+
export declare class ProviderCredentialsNotSetError extends Error {
|
|
14
|
+
constructor(provider: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class OAuthConnectionNotFoundError extends Error {
|
|
17
|
+
constructor(userId: string, provider: string);
|
|
18
|
+
}
|
|
19
|
+
export declare class EventNotFoundError extends Error {
|
|
20
|
+
constructor(eventId: string);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,yBAA0B,SAAQ,KAAK;gBAC7B,IAAI,EAAE,MAAM;CAGlC;AAED,qBAAa,8BAA+B,SAAQ,KAAK;gBAClC,IAAI,EAAE,MAAM;CAGlC;AAED,qBAAa,sBAAuB,SAAQ,KAAK;gBAC1B,MAAM,EAAE,MAAM;CAGpC;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBACrB,MAAM,EAAE,MAAM;CAGpC;AAED,qBAAa,8BAA+B,SAAQ,KAAK;gBAClC,QAAQ,EAAE,MAAM;CAGtC;AAED,qBAAa,4BAA6B,SAAQ,KAAK;gBAChC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAGtD;AAED,qBAAa,kBAAmB,SAAQ,KAAK;gBACtB,OAAO,EAAE,MAAM;CAGrC"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Organization } from './types/entity.types.mjs'
|
|
2
|
+
export { OrganizationMember } from './types/entity.types.mjs'
|
|
3
|
+
export {
|
|
4
|
+
Attendee,
|
|
5
|
+
AttendeeResponseStatus,
|
|
6
|
+
Calendar,
|
|
7
|
+
CalendarAccessRoles,
|
|
8
|
+
Event,
|
|
9
|
+
FreeBusy,
|
|
10
|
+
Meeting,
|
|
11
|
+
Provider,
|
|
12
|
+
TimeRange,
|
|
13
|
+
} from './types/calendar.types.mjs'
|
|
14
|
+
|
|
15
|
+
interface RecalOptions {
|
|
16
|
+
token?: string
|
|
17
|
+
baseURL?: string
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Recal SDK
|
|
21
|
+
* @description Recal SDK for Node.js
|
|
22
|
+
* @version 0.1.0
|
|
23
|
+
* @author Recal <team@recal.dev>
|
|
24
|
+
* @license MIT
|
|
25
|
+
*/
|
|
26
|
+
declare class Recal {
|
|
27
|
+
private token
|
|
28
|
+
private baseURL
|
|
29
|
+
/**
|
|
30
|
+
* Recal SDK constructor
|
|
31
|
+
* @param token Recal API token
|
|
32
|
+
*/
|
|
33
|
+
constructor(options?: RecalOptions)
|
|
34
|
+
/**
|
|
35
|
+
* Fetch function with Recal authentication
|
|
36
|
+
* @param input Request input
|
|
37
|
+
* @param init Request init
|
|
38
|
+
* @returns Promise<Response>
|
|
39
|
+
*/
|
|
40
|
+
private _fetch
|
|
41
|
+
private fetch
|
|
42
|
+
/**
|
|
43
|
+
* Get all organizations
|
|
44
|
+
* @returns Promise<PublicOrganization[]>
|
|
45
|
+
*/
|
|
46
|
+
listOrganizations(): Promise<Organization[]>
|
|
47
|
+
/**
|
|
48
|
+
* Get organization by slug
|
|
49
|
+
* @param slug Organization slug
|
|
50
|
+
* @returns Promise<Organization>
|
|
51
|
+
*/
|
|
52
|
+
getOrganization(slug: string): Promise<Organization>
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { Organization, Recal, Recal as default }
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CalendarService } from './services/calendar.service';
|
|
2
|
+
import { OAuthService } from './services/oauth.service';
|
|
3
|
+
import { OrganizationsService } from './services/organizations.service';
|
|
4
|
+
import { SchedulingService } from './services/scheduling.service';
|
|
5
|
+
import { UsersService } from './services/users.service';
|
|
6
|
+
import type { RecalOptions } from './types/internal.types';
|
|
7
|
+
/**
|
|
8
|
+
* Recal SDK
|
|
9
|
+
* @description Recal SDK for Node.js
|
|
10
|
+
* @version 0.1.0
|
|
11
|
+
* @author Recal <team@recal.dev>
|
|
12
|
+
* @license MIT
|
|
13
|
+
*/
|
|
14
|
+
export declare class RecalClient {
|
|
15
|
+
private token;
|
|
16
|
+
private baseUrl;
|
|
17
|
+
private fetchHelper;
|
|
18
|
+
oauth: OAuthService;
|
|
19
|
+
organizations: OrganizationsService;
|
|
20
|
+
users: UsersService;
|
|
21
|
+
calendar: CalendarService;
|
|
22
|
+
scheduling: SchedulingService;
|
|
23
|
+
constructor(options: RecalOptions);
|
|
24
|
+
}
|
|
25
|
+
export * from './entities/organization';
|
|
26
|
+
export * from './entities/user';
|
|
27
|
+
export * from './errors';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAI1D;;;;;;GAMG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,WAAW,CAAa;IAGhC,KAAK,EAAE,YAAY,CAAA;IACnB,aAAa,EAAE,oBAAoB,CAAA;IACnC,KAAK,EAAE,YAAY,CAAA;IACnB,QAAQ,EAAE,eAAe,CAAA;IACzB,UAAU,EAAE,iBAAiB,CAAA;gBAEV,OAAO,EAAE,YAAY;CAe3C;AAED,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA"}
|