@vritti/api-sdk 0.4.7 → 0.4.9

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.
@@ -2,3 +2,4 @@ export { default } from 'decimal.js';
2
2
  import 'drizzle-orm';
3
3
  import 'lodash';
4
4
  import 'pluralize-esm';
5
+ import 'zod';
package/dist/decimal.d.ts CHANGED
@@ -2,3 +2,4 @@ export { default } from 'decimal.js';
2
2
  import 'drizzle-orm';
3
3
  import 'lodash';
4
4
  import 'pluralize-esm';
5
+ import 'zod';
@@ -1,24 +1,11 @@
1
- import { HttpException, HttpStatus } from '@nestjs/common';
2
- import { FieldError } from './types.cjs';
3
-
4
- interface ProblemOptions {
5
- type?: string;
6
- label?: string;
7
- detail?: string;
8
- errors?: FieldError[];
9
- }
10
- declare abstract class HttpProblemException extends HttpException {
11
- constructor(detailOrOptions: string | ProblemOptions, httpStatus: HttpStatus);
12
- }
1
+ import { H as HttpProblemException, P as ProblemOptions, B as BadRequestException } from './bad-request.exception-D-KmhiXQ.cjs';
2
+ export { FieldError } from './types.cjs';
3
+ import '@nestjs/common';
13
4
 
14
5
  declare class BadGatewayException extends HttpProblemException {
15
6
  constructor(detailOrOptions?: string | ProblemOptions);
16
7
  }
17
8
 
18
- declare class BadRequestException extends HttpProblemException {
19
- constructor(detailOrOptions?: string | ProblemOptions);
20
- }
21
-
22
9
  declare class ConflictException extends HttpProblemException {
23
10
  constructor(detailOrOptions?: string | ProblemOptions);
24
11
  }
@@ -87,4 +74,4 @@ declare class ValidationException extends HttpProblemException {
87
74
  constructor(detailOrOptions?: string | ProblemOptions);
88
75
  }
89
76
 
90
- export { BadGatewayException, BadRequestException, ConflictException, FieldError, ForbiddenException, GoneException, HttpProblemException, InternalServerErrorException, InvalidCursorException, MethodNotAllowedException, NotAcceptableException, NotFoundException, NotImplementedException, PayloadTooLargeException, type ProblemOptions, RequestTimeoutException, ServiceUnavailableException, TooManyRequestsException, UnauthorizedException, UnprocessableEntityException, UnsupportedMediaTypeException, ValidationException };
77
+ export { BadGatewayException, BadRequestException, ConflictException, ForbiddenException, GoneException, HttpProblemException, InternalServerErrorException, InvalidCursorException, MethodNotAllowedException, NotAcceptableException, NotFoundException, NotImplementedException, PayloadTooLargeException, ProblemOptions, RequestTimeoutException, ServiceUnavailableException, TooManyRequestsException, UnauthorizedException, UnprocessableEntityException, UnsupportedMediaTypeException, ValidationException };
@@ -1,24 +1,11 @@
1
- import { HttpException, HttpStatus } from '@nestjs/common';
2
- import { FieldError } from './types.js';
3
-
4
- interface ProblemOptions {
5
- type?: string;
6
- label?: string;
7
- detail?: string;
8
- errors?: FieldError[];
9
- }
10
- declare abstract class HttpProblemException extends HttpException {
11
- constructor(detailOrOptions: string | ProblemOptions, httpStatus: HttpStatus);
12
- }
1
+ import { H as HttpProblemException, P as ProblemOptions, B as BadRequestException } from './bad-request.exception-Db94kZxY.js';
2
+ export { FieldError } from './types.js';
3
+ import '@nestjs/common';
13
4
 
14
5
  declare class BadGatewayException extends HttpProblemException {
15
6
  constructor(detailOrOptions?: string | ProblemOptions);
16
7
  }
17
8
 
18
- declare class BadRequestException extends HttpProblemException {
19
- constructor(detailOrOptions?: string | ProblemOptions);
20
- }
21
-
22
9
  declare class ConflictException extends HttpProblemException {
23
10
  constructor(detailOrOptions?: string | ProblemOptions);
24
11
  }
@@ -87,4 +74,4 @@ declare class ValidationException extends HttpProblemException {
87
74
  constructor(detailOrOptions?: string | ProblemOptions);
88
75
  }
89
76
 
90
- export { BadGatewayException, BadRequestException, ConflictException, FieldError, ForbiddenException, GoneException, HttpProblemException, InternalServerErrorException, InvalidCursorException, MethodNotAllowedException, NotAcceptableException, NotFoundException, NotImplementedException, PayloadTooLargeException, type ProblemOptions, RequestTimeoutException, ServiceUnavailableException, TooManyRequestsException, UnauthorizedException, UnprocessableEntityException, UnsupportedMediaTypeException, ValidationException };
77
+ export { BadGatewayException, BadRequestException, ConflictException, ForbiddenException, GoneException, HttpProblemException, InternalServerErrorException, InvalidCursorException, MethodNotAllowedException, NotAcceptableException, NotFoundException, NotImplementedException, PayloadTooLargeException, ProblemOptions, RequestTimeoutException, ServiceUnavailableException, TooManyRequestsException, UnauthorizedException, UnprocessableEntityException, UnsupportedMediaTypeException, ValidationException };
package/dist/index.d.cts CHANGED
@@ -62,12 +62,17 @@ interface CookieConfig {
62
62
  refreshCookieSameSite: 'strict' | 'lax' | 'none';
63
63
  refreshCookieDomain?: string;
64
64
  }
65
+ interface OAuthChallengeConfig {
66
+ realm?: string;
67
+ resourceMetadataUrl?: string;
68
+ }
65
69
  interface GuardConfig {
66
70
  authHeaderName: string;
67
71
  tokenPrefix: string;
68
72
  csrfExemptSessionTypes?: string[];
69
73
  csrfExemptTransports?: string[];
70
74
  refreshTokenBindingExemptSessionTypes?: string[];
75
+ oauth?: OAuthChallengeConfig;
71
76
  onAuthenticated?: OnAuthenticatedCallback;
72
77
  }
73
78
  interface AuthConfig {
@@ -141,7 +146,16 @@ declare module 'fastify' {
141
146
  interface VrittiCloudAuth extends VrittiAuthBase {
142
147
  kind: 'cloud';
143
148
  }
144
- type VrittiAuth = VrittiSessionAuth | VrittiAppAuth | VrittiCloudAuth;
149
+ interface VrittiOAuthAuth extends VrittiAuthBase {
150
+ kind: 'oauth';
151
+ token: string;
152
+ userId?: string;
153
+ grantId?: string;
154
+ clientId?: string;
155
+ scopes?: string[];
156
+ organizationId?: string;
157
+ }
158
+ type VrittiAuth = VrittiSessionAuth | VrittiAppAuth | VrittiCloudAuth | VrittiOAuthAuth;
145
159
  interface FastifyRequest {
146
160
  auth?: VrittiAuth;
147
161
  authConfig?: AuthConfig;
@@ -149,4 +163,4 @@ declare module 'fastify' {
149
163
  }
150
164
  }
151
165
 
152
- export { type AuthConfig as A, type CookieConfig as C, type DecodedAccessToken as D, type GuardConfig as G, type OnAuthenticatedCallback as O, RequestService as R, type TokenExpiry as T, TokenType as a, type DecodedRefreshToken as b, AUTH_CONFIG as c, AUTH_CONFIG_DEFAULTS as d, type AccessTokenPayload as e, type CookieSerializeOptions as f, type RefreshTokenPayload as g, type TokenExpiryString as h };
166
+ export { type AuthConfig as A, type CookieConfig as C, type DecodedAccessToken as D, type GuardConfig as G, type OAuthChallengeConfig as O, RequestService as R, type TokenExpiry as T, TokenType as a, type DecodedRefreshToken as b, AUTH_CONFIG as c, AUTH_CONFIG_DEFAULTS as d, type AccessTokenPayload as e, type CookieSerializeOptions as f, type OnAuthenticatedCallback as g, type RefreshTokenPayload as h, type TokenExpiryString as i };
package/dist/index.d.ts CHANGED
@@ -62,12 +62,17 @@ interface CookieConfig {
62
62
  refreshCookieSameSite: 'strict' | 'lax' | 'none';
63
63
  refreshCookieDomain?: string;
64
64
  }
65
+ interface OAuthChallengeConfig {
66
+ realm?: string;
67
+ resourceMetadataUrl?: string;
68
+ }
65
69
  interface GuardConfig {
66
70
  authHeaderName: string;
67
71
  tokenPrefix: string;
68
72
  csrfExemptSessionTypes?: string[];
69
73
  csrfExemptTransports?: string[];
70
74
  refreshTokenBindingExemptSessionTypes?: string[];
75
+ oauth?: OAuthChallengeConfig;
71
76
  onAuthenticated?: OnAuthenticatedCallback;
72
77
  }
73
78
  interface AuthConfig {
@@ -141,7 +146,16 @@ declare module 'fastify' {
141
146
  interface VrittiCloudAuth extends VrittiAuthBase {
142
147
  kind: 'cloud';
143
148
  }
144
- type VrittiAuth = VrittiSessionAuth | VrittiAppAuth | VrittiCloudAuth;
149
+ interface VrittiOAuthAuth extends VrittiAuthBase {
150
+ kind: 'oauth';
151
+ token: string;
152
+ userId?: string;
153
+ grantId?: string;
154
+ clientId?: string;
155
+ scopes?: string[];
156
+ organizationId?: string;
157
+ }
158
+ type VrittiAuth = VrittiSessionAuth | VrittiAppAuth | VrittiCloudAuth | VrittiOAuthAuth;
145
159
  interface FastifyRequest {
146
160
  auth?: VrittiAuth;
147
161
  authConfig?: AuthConfig;
@@ -149,4 +163,4 @@ declare module 'fastify' {
149
163
  }
150
164
  }
151
165
 
152
- export { type AuthConfig as A, type CookieConfig as C, type DecodedAccessToken as D, type GuardConfig as G, type OnAuthenticatedCallback as O, RequestService as R, type TokenExpiry as T, TokenType as a, type DecodedRefreshToken as b, AUTH_CONFIG as c, AUTH_CONFIG_DEFAULTS as d, type AccessTokenPayload as e, type CookieSerializeOptions as f, type RefreshTokenPayload as g, type TokenExpiryString as h };
166
+ export { type AuthConfig as A, type CookieConfig as C, type DecodedAccessToken as D, type GuardConfig as G, type OAuthChallengeConfig as O, RequestService as R, type TokenExpiry as T, TokenType as a, type DecodedRefreshToken as b, AUTH_CONFIG as c, AUTH_CONFIG_DEFAULTS as d, type AccessTokenPayload as e, type CookieSerializeOptions as f, type OnAuthenticatedCallback as g, type RefreshTokenPayload as h, type TokenExpiryString as i };