@workos-inc/node
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"name": "@workos-inc/node", | ||
@@ -42,3 +42,3 @@ "author": "WorkOS", | ||
"@types/jest": "26.0.23", | ||
"@types/node": "12.20.12", | ||
"@types/node": "12.20.14", | ||
"@types/pluralize": "0.0.29", | ||
@@ -51,4 +51,4 @@ "axios-mock-adapter": "1.19.0", | ||
"tslint": "6.1.3", | ||
"typescript": "4.2.4" | ||
"typescript": "4.3.2" | ||
} | ||
} |
@@ -24,3 +24,5 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.get('/events', options); | ||
const { data } = yield this.workos.get('/events', { | ||
query: options, | ||
}); | ||
return data; | ||
@@ -27,0 +29,0 @@ }); |
@@ -1,4 +0,5 @@ | ||
export { UnprocessableEntityError } from './unprocessable-entity-error.interface'; | ||
export { WorkOSOptions } from './workos-options.interface'; | ||
export { PostOptions } from './post-options.interface'; | ||
export { PutOptions } from './put-options.interface'; | ||
export * from './get-options.interface'; | ||
export * from './post-options.interface'; | ||
export * from './put-options.interface'; | ||
export * from './unprocessable-entity-error.interface'; | ||
export * from './workos-options.interface'; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./get-options.interface"), exports); | ||
__exportStar(require("./post-options.interface"), exports); | ||
__exportStar(require("./put-options.interface"), exports); | ||
__exportStar(require("./unprocessable-entity-error.interface"), exports); | ||
__exportStar(require("./workos-options.interface"), exports); |
@@ -19,3 +19,5 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.get('/directories', options); | ||
const { data } = yield this.workos.get('/directories', { | ||
query: options, | ||
}); | ||
return data; | ||
@@ -31,3 +33,5 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.get(`/directory_groups`, options); | ||
const { data } = yield this.workos.get(`/directory_groups`, { | ||
query: options, | ||
}); | ||
return data; | ||
@@ -38,3 +42,5 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.get(`/directory_users`, options); | ||
const { data } = yield this.workos.get(`/directory_users`, { | ||
query: options, | ||
}); | ||
return data; | ||
@@ -41,0 +47,0 @@ }); |
@@ -12,3 +12,5 @@ import { List } from '../common/interfaces/list.interface'; | ||
}): Promise<Organization>; | ||
deleteOrganization(id: string): Promise<void>; | ||
getOrganization(id: string): Promise<Organization>; | ||
updateOrganization(options: UpdateOrganizationOptions): Promise<Organization>; | ||
} |
@@ -30,3 +30,5 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.get('/organizations', options); | ||
const { data } = yield this.workos.get('/organizations', { | ||
query: options, | ||
}); | ||
return data; | ||
@@ -44,2 +46,13 @@ }); | ||
} | ||
deleteOrganization(id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.workos.delete(`/organizations/${id}`); | ||
}); | ||
} | ||
getOrganization(id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.get(`/organizations/${id}`); | ||
return data; | ||
}); | ||
} | ||
updateOrganization(options) { | ||
@@ -46,0 +59,0 @@ return __awaiter(this, void 0, void 0, function* () { |
export interface CreatePasswordlessSessionOptions { | ||
type: 'MagicLink'; | ||
email: string; | ||
@@ -6,3 +7,3 @@ redirectURI?: string; | ||
connection?: string; | ||
type: 'MagicLink'; | ||
expiresIn?: number; | ||
} |
@@ -8,4 +8,4 @@ import { WorkOS } from '../workos'; | ||
constructor(workos: WorkOS); | ||
createSession({ redirectURI, ...options }: CreatePasswordlessSessionOptions): Promise<PasswordlessSession>; | ||
createSession({ redirectURI, expiresIn, ...options }: CreatePasswordlessSessionOptions): Promise<PasswordlessSession>; | ||
sendSession(sessionId: string): Promise<SendSessionResponse>; | ||
} |
@@ -29,5 +29,5 @@ "use strict"; | ||
createSession(_a) { | ||
var { redirectURI } = _a, options = __rest(_a, ["redirectURI"]); | ||
var { redirectURI, expiresIn } = _a, options = __rest(_a, ["redirectURI", "expiresIn"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.post('/passwordless/sessions', Object.assign(Object.assign({}, options), { redirect_uri: redirectURI })); | ||
const { data } = yield this.workos.post('/passwordless/sessions', Object.assign(Object.assign({}, options), { redirect_uri: redirectURI, expires_in: expiresIn })); | ||
return data; | ||
@@ -34,0 +34,0 @@ }); |
@@ -6,4 +6,6 @@ import { List } from '../common/interfaces/list.interface'; | ||
import { GetProfileAndTokenOptions } from './interfaces/get-profile-and-token-options.interface'; | ||
import { GetProfileOptions } from './interfaces/get-profile-options.interface'; | ||
import { ListConnectionsOptions } from './interfaces/list-connections-options.interface'; | ||
import { ProfileAndToken } from './interfaces/profile-and-token.interface'; | ||
import { Profile } from './interfaces/profile.interface'; | ||
export declare class SSO { | ||
@@ -16,3 +18,4 @@ private readonly workos; | ||
getProfileAndToken({ code, clientID, }: GetProfileAndTokenOptions): Promise<ProfileAndToken>; | ||
getProfile({ accessToken }: GetProfileOptions): Promise<Profile>; | ||
listConnections(options?: ListConnectionsOptions): Promise<List<Connection>>; | ||
} |
@@ -59,5 +59,15 @@ "use strict"; | ||
} | ||
getProfile({ accessToken }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.get('/sso/profile', { | ||
accessToken, | ||
}); | ||
return data; | ||
}); | ||
} | ||
listConnections(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.workos.get(`/connections`, options); | ||
const { data } = yield this.workos.get(`/connections`, { | ||
query: options, | ||
}); | ||
return data; | ||
@@ -64,0 +74,0 @@ }); |
import { AxiosResponse } from 'axios'; | ||
import { AuditTrail } from './audit-trail/audit-trail'; | ||
import { PostOptions, PutOptions, WorkOSOptions } from './common/interfaces'; | ||
import { GetOptions, PostOptions, PutOptions, WorkOSOptions } from './common/interfaces'; | ||
import { DirectorySync } from './directory-sync/directory-sync'; | ||
@@ -22,3 +22,3 @@ import { Organizations } from './organizations/organizations'; | ||
post(path: string, entity: any, options?: PostOptions): Promise<AxiosResponse>; | ||
get(path: string, query?: any): Promise<AxiosResponse>; | ||
get(path: string, options?: GetOptions): Promise<AxiosResponse>; | ||
put(path: string, entity: any, options?: PutOptions): Promise<AxiosResponse>; | ||
@@ -25,0 +25,0 @@ delete(path: string, query?: any): Promise<AxiosResponse>; |
@@ -97,7 +97,13 @@ "use strict"; | ||
} | ||
get(path, query) { | ||
get(path, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const { accessToken } = options; | ||
return yield this.client.get(path, { | ||
params: query, | ||
params: options.query, | ||
headers: accessToken | ||
? { | ||
Authorization: `Bearer ${accessToken}`, | ||
} | ||
: undefined, | ||
}); | ||
@@ -104,0 +110,0 @@ } |
{ | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"name": "@workos-inc/node", | ||
@@ -42,3 +42,3 @@ "author": "WorkOS", | ||
"@types/jest": "26.0.23", | ||
"@types/node": "12.20.12", | ||
"@types/node": "12.20.14", | ||
"@types/pluralize": "0.0.29", | ||
@@ -51,4 +51,4 @@ "axios-mock-adapter": "1.19.0", | ||
"tslint": "6.1.3", | ||
"typescript": "4.2.4" | ||
"typescript": "4.3.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54524
112
1218