@palmetto/users-sdk 1.2.0 → 1.2.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.
@@ -925,6 +925,11 @@ export interface components {
925
925
  /** @enum {string} */
926
926
  grant_type: "authorization_code";
927
927
  code: string;
928
+ /**
929
+ * @deprecated
930
+ * @description Obtain access tokens without verifying that the user exists
931
+ */
932
+ skip_user_verification?: boolean;
928
933
  } | {
929
934
  /** @enum {string} */
930
935
  grant_type: "refresh_token";
@@ -2282,6 +2287,15 @@ export interface operations {
2282
2287
  "application/json": components["schemas"]["BadRequestErrorDto"];
2283
2288
  };
2284
2289
  };
2290
+ /** @description When the user does not exist for the exchange token */
2291
+ 404: {
2292
+ headers: {
2293
+ [name: string]: unknown;
2294
+ };
2295
+ content: {
2296
+ "application/json": components["schemas"]["NotFoundErrorDto"];
2297
+ };
2298
+ };
2285
2299
  };
2286
2300
  };
2287
2301
  SignUpsController_findAll: {
package/dist/client.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { ApiInput, ApiResponse, BaseSdkClient, CreateSdkClientInput, RequestOptions, SdkError } from "@palmetto/base-sdk-client";
2
2
  import { ResultOk } from "@palmetto/result";
3
+ import { ErrorResponse } from "openapi-typescript-helpers";
3
4
  import { paths } from "./__generated__/schema";
5
+ export type ReExportedErrorResponse<T extends Record<string | number, any>> = ErrorResponse<T>;
4
6
  export declare class UsersApiClient extends BaseSdkClient<paths> {
5
7
  constructor(input: CreateSdkClientInput);
6
8
  me(input: MeInput, opts?: RequestOptions): Promise<ResultOk<MeResponseV2> | SdkError<paths["/api/v2/users/me"]["get"]["responses"]["401"]["content"]["application/json"] | paths["/api/v2/users/me"]["get"]["responses"]["403"]["content"]["application/json"]>>;
@@ -23,7 +25,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
23
25
  phoneNumber: string;
24
26
  organizationId: string;
25
27
  hasPAT: boolean;
26
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
28
+ }> | SdkError<ErrorResponse<{
27
29
  200: {
28
30
  headers: {
29
31
  [name: string]: unknown;
@@ -77,7 +79,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
77
79
  totalRecords: number;
78
80
  totalPages: number;
79
81
  };
80
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
82
+ }> | SdkError<ErrorResponse<{
81
83
  200: {
82
84
  headers: {
83
85
  [name: string]: unknown;
@@ -129,7 +131,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
129
131
  phoneNumber: string;
130
132
  organizationId: string;
131
133
  hasPAT: boolean;
132
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
134
+ }> | SdkError<ErrorResponse<{
133
135
  200: {
134
136
  headers: {
135
137
  [name: string]: unknown;
@@ -181,7 +183,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
181
183
  permissions: {
182
184
  [key: string]: string[];
183
185
  };
184
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
186
+ }> | SdkError<ErrorResponse<{
185
187
  200: {
186
188
  headers: {
187
189
  [name: string]: unknown;
@@ -233,7 +235,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
233
235
  permissions: {
234
236
  [key: string]: string[];
235
237
  };
236
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
238
+ }> | SdkError<ErrorResponse<{
237
239
  200: {
238
240
  headers: {
239
241
  [name: string]: unknown;
@@ -277,7 +279,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
277
279
  }, `${string}/${string}`>>>;
278
280
  createSignUp(input: CreateSignUpInput, opts?: RequestOptions): Promise<ResultOk<{
279
281
  token: string;
280
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
282
+ }> | SdkError<ErrorResponse<{
281
283
  201: {
282
284
  headers: {
283
285
  [name: string]: unknown;
@@ -320,7 +322,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
320
322
  lastName?: string;
321
323
  email?: string;
322
324
  expiresAt: string;
323
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
325
+ }> | SdkError<ErrorResponse<{
324
326
  200: {
325
327
  headers: {
326
328
  [name: string]: unknown;
@@ -358,7 +360,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
358
360
  totalRecords: number;
359
361
  totalPages: number;
360
362
  };
361
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
363
+ }> | SdkError<ErrorResponse<{
362
364
  200: {
363
365
  headers: {
364
366
  [name: string]: unknown;
@@ -403,7 +405,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
403
405
  lastName?: string;
404
406
  email?: string;
405
407
  expiresAt: string;
406
- }> | SdkError<import("openapi-typescript-helpers").ErrorResponse<{
408
+ }> | SdkError<ErrorResponse<{
407
409
  200: {
408
410
  headers: {
409
411
  [name: string]: unknown;
@@ -445,34 +447,38 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
445
447
  };
446
448
  };
447
449
  }, `${string}/${string}`>>>;
448
- getAuthToken({ code }: GetAuthTokenInput, opts?: RequestOptions): Promise<ResultOk<{
449
- accessToken: string;
450
- idToken: string;
451
- refreshToken: string;
452
- expiresIn: number;
453
- }> | SdkError<{
454
- error: "BadRequest";
455
- statusCode: 400;
456
- message: string;
457
- reason: string;
458
- validations: {
459
- [key: string]: string[];
460
- };
461
- }>>;
450
+ getAuthToken({ code, skipUserVerification }: GetAuthTokenInput, opts?: RequestOptions): Promise<ResultOk<GetTokenResponse> | SdkError<ReExportedErrorResponse<paths["/api/auth/token"]["post"]["responses"]>>>;
462
451
  refreshToken({ refreshToken }: RefreshTokenInput, opts?: RequestOptions): Promise<ResultOk<{
463
452
  accessToken: string;
464
453
  idToken: string;
465
454
  refreshToken: string;
466
455
  expiresIn: number;
467
- }> | SdkError<{
468
- error: "BadRequest";
469
- statusCode: 400;
470
- message: string;
471
- reason: string;
472
- validations: {
473
- [key: string]: string[];
456
+ }> | SdkError<ErrorResponse<{
457
+ 200: {
458
+ headers: {
459
+ [name: string]: unknown;
460
+ };
461
+ content: {
462
+ "application/json": import("./__generated__/schema").components["schemas"]["TokenResponseDto"];
463
+ };
464
+ };
465
+ 400: {
466
+ headers: {
467
+ [name: string]: unknown;
468
+ };
469
+ content: {
470
+ "application/json": import("./__generated__/schema").components["schemas"]["BadRequestErrorDto"];
471
+ };
474
472
  };
475
- }>>;
473
+ 404: {
474
+ headers: {
475
+ [name: string]: unknown;
476
+ };
477
+ content: {
478
+ "application/json": import("./__generated__/schema").components["schemas"]["NotFoundErrorDto"];
479
+ };
480
+ };
481
+ }, `${string}/${string}`>>>;
476
482
  private getToken;
477
483
  }
478
484
  export interface MeInput {
@@ -506,6 +512,7 @@ export type CreateSignUpUserInput = ApiInput<paths["/api/sign-ups/{token}/user"]
506
512
  export type CreateSignUpUserResponse = ApiResponse<paths["/api/sign-ups/{token}/user"]["post"]>;
507
513
  export interface GetAuthTokenInput {
508
514
  code: string;
515
+ skipUserVerification: boolean;
509
516
  }
510
517
  export interface RefreshTokenInput {
511
518
  refreshToken: string;
package/dist/client.js CHANGED
@@ -23,7 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.UsersApiClient = void 0;
24
24
  const base_sdk_client_1 = require("@palmetto/base-sdk-client");
25
25
  const result_1 = require("@palmetto/result");
26
- const SDK_VERSION_SLUG = "palmetto-users-sdk/1.2.0";
26
+ const SDK_VERSION_SLUG = "palmetto-users-sdk/1.2.1";
27
27
  class UsersApiClient extends base_sdk_client_1.BaseSdkClient {
28
28
  constructor(input) {
29
29
  super(Object.assign(Object.assign({}, input), { sdkVersion: SDK_VERSION_SLUG }));
@@ -177,8 +177,12 @@ class UsersApiClient extends base_sdk_client_1.BaseSdkClient {
177
177
  });
178
178
  }
179
179
  getAuthToken(_a, opts_1) {
180
- return __awaiter(this, arguments, void 0, function* ({ code }, opts) {
181
- return this.getToken({ grant_type: "authorization_code", code }, opts);
180
+ return __awaiter(this, arguments, void 0, function* ({ code, skipUserVerification }, opts) {
181
+ return this.getToken({
182
+ grant_type: "authorization_code",
183
+ code,
184
+ skip_user_verification: skipUserVerification,
185
+ }, opts);
182
186
  });
183
187
  }
184
188
  refreshToken(_a, opts_1) {
package/dist/main.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./client.js";
2
2
  export * from "./scopes.js";
3
- export { type RequestOptions } from "@palmetto/base-sdk-client";
3
+ export { type RequestOptions, type SdkError } from "@palmetto/base-sdk-client";
4
+ export { type ErrorResponse } from "openapi-typescript-helpers";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palmetto/users-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "main": "./dist/main.js",
5
5
  "files": [
6
6
  "dist/**/*",