@workos-inc/node 2.14.0 → 2.15.1

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.
@@ -23,4 +23,4 @@ export interface CreateAuditLogEventOptions {
23
23
  };
24
24
  metadata?: Record<string, string | number | boolean>;
25
25
  }
26
- export declare type CreateAuditLogEventRequestOptions = Pick<PostOptions, 'idempotencyKey'>;
26
+ export type CreateAuditLogEventRequestOptions = Pick<PostOptions, 'idempotencyKey'>;
@@ -1,5 +1,5 @@
1
1
  import { Group } from './group.interface';
2
- export declare type DefaultCustomAttributes = Record<string, unknown>;
2
+ export type DefaultCustomAttributes = Record<string, unknown>;
3
3
  export interface User<TCustomAttributes extends object = DefaultCustomAttributes, TRawAttributes = any> {
4
4
  id: string;
5
5
  directory_id: string;
@@ -1,4 +1,4 @@
1
- export declare type ChallengeFactorOptions = {
1
+ export type ChallengeFactorOptions = {
2
2
  authenticationFactorId: string;
3
3
  } | {
4
4
  authenticationFactorId: string;
@@ -1,4 +1,4 @@
1
- export declare type EnrollFactorOptions = {
1
+ export type EnrollFactorOptions = {
2
2
  type: 'sms';
3
3
  phoneNumber: string;
4
4
  } | {
@@ -1,4 +1,7 @@
1
1
  export interface Totp {
2
+ issuer: string;
3
+ user: string;
2
4
  qr_code: string;
3
5
  secret: string;
6
+ uri: string;
4
7
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @deprecated Please use `VerifyChallengeOptions` instead.
3
3
  */
4
- export declare type VerifyFactorOptions = {
4
+ export type VerifyFactorOptions = {
5
5
  authenticationChallengeId: string;
6
6
  code: string;
7
7
  };
@@ -73,8 +73,11 @@ describe('MFA', () => {
73
73
  updated_at: '2022-03-15T20:39:19.892Z',
74
74
  type: 'totp',
75
75
  totp: {
76
+ issuer: 'WorkOS',
76
77
  qr_code: 'qr-code-test',
77
78
  secret: 'secret-test',
79
+ uri: 'uri-test',
80
+ user: 'some_user',
78
81
  },
79
82
  });
80
83
  const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU', {
@@ -91,8 +94,11 @@ describe('MFA', () => {
91
94
  "id": "auth_factor_1234",
92
95
  "object": "authentication_factor",
93
96
  "totp": Object {
97
+ "issuer": "WorkOS",
94
98
  "qr_code": "qr-code-test",
95
99
  "secret": "secret-test",
100
+ "uri": "uri-test",
101
+ "user": "some_user",
96
102
  },
97
103
  "type": "totp",
98
104
  "updated_at": "2022-03-15T20:39:19.892Z",
@@ -3,10 +3,11 @@ import { GeneratePortalLinkIntent } from './interfaces/generate-portal-link-inte
3
3
  export declare class Portal {
4
4
  private readonly workos;
5
5
  constructor(workos: WorkOS);
6
- generateLink({ intent, organization, returnUrl, }: {
6
+ generateLink({ intent, organization, returnUrl, successUrl, }: {
7
7
  intent: GeneratePortalLinkIntent;
8
8
  organization: string;
9
9
  returnUrl?: string;
10
+ successUrl?: string;
10
11
  }): Promise<{
11
12
  link: string;
12
13
  }>;
@@ -14,12 +14,13 @@ class Portal {
14
14
  constructor(workos) {
15
15
  this.workos = workos;
16
16
  }
17
- generateLink({ intent, organization, returnUrl, }) {
17
+ generateLink({ intent, organization, returnUrl, successUrl, }) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  const { data } = yield this.workos.post('/portal/generate_link', {
20
20
  intent,
21
21
  organization,
22
22
  return_url: returnUrl,
23
+ success_url: successUrl,
23
24
  });
24
25
  return data;
25
26
  });
@@ -1,5 +1,5 @@
1
- export declare type WebhookDirectoryType = 'okta scim v1.1' | 'okta scim v2.0' | 'azure scim v2.0' | 'bamboohr' | 'breathe hr' | 'cyberark scim v2.0' | 'fourth hr' | 'gsuite directory' | 'generic scim v1.1' | 'generic scim v2.0' | 'gusto' | 'hibob' | 'jump cloud scim v2.0' | 'onelogin scim v2.0' | 'people hr' | 'pingfederate scim v2.0' | 'rippling' | 's3' | 'workday';
2
- export declare type WebhookDirectoryState = 'active' | 'validating' | 'invalid_credentials' | 'inactive' | 'deleting';
1
+ export type WebhookDirectoryType = 'okta scim v1.1' | 'okta scim v2.0' | 'azure scim v2.0' | 'bamboohr' | 'breathe hr' | 'cyberark scim v2.0' | 'fourth hr' | 'gsuite directory' | 'generic scim v1.1' | 'generic scim v2.0' | 'gusto' | 'hibob' | 'jump cloud scim v2.0' | 'onelogin scim v2.0' | 'people hr' | 'pingfederate scim v2.0' | 'rippling' | 's3' | 'workday';
2
+ export type WebhookDirectoryState = 'active' | 'validating' | 'invalid_credentials' | 'inactive' | 'deleting';
3
3
  interface WebhookDirectoryDomain {
4
4
  object: 'organization_domain';
5
5
  id: string;
@@ -69,5 +69,5 @@ export interface DsyncUserUpdatedWebhook extends WebhookBase {
69
69
  event: 'dsync.user.updated';
70
70
  data: User & Record<'previous_attributes', any>;
71
71
  }
72
- export declare type Webhook = ConnectionActivatedWebhook | ConnectionDeactivatedWebhook | ConnectionDeletedWebhook | DsyncActivatedWebhook | DsyncDeactivatedWebhook | DsyncDeletedWebhook | DsyncGroupCreatedWebhook | DsyncGroupUpdatedWebhook | DsyncGroupDeletedWebhook | DsyncGroupUserAddedWebhook | DsyncGroupUserRemovedWebhook | DsyncUserCreatedWebhook | DsyncUserUpdatedWebhook | DsyncUserDeletedWebhook;
72
+ export type Webhook = ConnectionActivatedWebhook | ConnectionDeactivatedWebhook | ConnectionDeletedWebhook | DsyncActivatedWebhook | DsyncDeactivatedWebhook | DsyncDeletedWebhook | DsyncGroupCreatedWebhook | DsyncGroupUpdatedWebhook | DsyncGroupDeletedWebhook | DsyncGroupUserAddedWebhook | DsyncGroupUserRemovedWebhook | DsyncUserCreatedWebhook | DsyncUserUpdatedWebhook | DsyncUserDeletedWebhook;
73
73
  export {};
package/lib/workos.js CHANGED
@@ -25,7 +25,7 @@ const webhooks_1 = require("./webhooks/webhooks");
25
25
  const mfa_1 = require("./mfa/mfa");
26
26
  const audit_logs_1 = require("./audit-logs/audit-logs");
27
27
  const bad_request_exception_1 = require("./common/exceptions/bad-request.exception");
28
- const VERSION = '2.14.0';
28
+ const VERSION = '2.15.1';
29
29
  const DEFAULT_HOSTNAME = 'api.workos.com';
30
30
  class WorkOS {
31
31
  constructor(key, options = {}) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.14.0",
2
+ "version": "2.15.1",
3
3
  "name": "@workos-inc/node",
4
4
  "author": "WorkOS",
5
5
  "description": "A Node wrapper for the WorkOS API",
@@ -9,7 +9,7 @@
9
9
  "workos"
10
10
  ],
11
11
  "volta": {
12
- "node": "14.20.1",
12
+ "node": "14.21.1",
13
13
  "yarn": "1.22.19"
14
14
  },
15
15
  "main": "lib/index.js",
@@ -40,14 +40,14 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/jest": "27.5.2",
43
- "@types/node": "14.18.32",
43
+ "@types/node": "14.18.33",
44
44
  "@types/pluralize": "0.0.29",
45
45
  "axios-mock-adapter": "1.21.2",
46
46
  "jest": "27.5.1",
47
- "prettier": "2.7.1",
47
+ "prettier": "2.8.0",
48
48
  "supertest": "6.2.3",
49
49
  "ts-jest": "27.1.5",
50
50
  "tslint": "6.1.3",
51
- "typescript": "4.8.4"
51
+ "typescript": "4.9.3"
52
52
  }
53
53
  }