@vritti/api-sdk 0.2.7 → 0.2.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.
- package/dist/index.cjs +74 -502
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -82
- package/dist/index.d.ts +2 -82
- package/dist/index.js +54 -473
- package/dist/index.js.map +1 -1
- package/dist/migrate.cjs +88 -0
- package/dist/migrate.cjs.map +1 -0
- package/dist/migrate.d.cts +7 -0
- package/dist/migrate.d.ts +7 -0
- package/dist/migrate.js +63 -0
- package/dist/migrate.js.map +1 -0
- package/dist/nats.cjs +519 -0
- package/dist/nats.cjs.map +1 -0
- package/dist/nats.d.cts +85 -0
- package/dist/nats.d.ts +85 -0
- package/dist/nats.js +486 -0
- package/dist/nats.js.map +1 -0
- package/package.json +21 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FastifyRequest, FastifyReply
|
|
1
|
+
import { FastifyRequest, FastifyReply } from 'fastify';
|
|
2
2
|
import * as _nestjs_common from '@nestjs/common';
|
|
3
3
|
import { InjectionToken, DynamicModule, CanActivate, ExecutionContext, OnModuleInit, OnModuleDestroy, Logger, HttpException, HttpStatus, ExceptionFilter, ArgumentsHost, ModuleMetadata, Type, LoggerService as LoggerService$1, NestInterceptor, CallHandler, NestModule, MiddlewareConsumer, NestMiddleware } from '@nestjs/common';
|
|
4
4
|
import { Reflector } from '@nestjs/core';
|
|
@@ -13,7 +13,6 @@ import { ValidationOptions } from 'class-validator';
|
|
|
13
13
|
import { Observable } from 'rxjs';
|
|
14
14
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
15
15
|
export { Currency, CurrencyCode, SUPPORTED_CURRENCIES, majorToMinor, minorToMajor } from './money.cjs';
|
|
16
|
-
import { ClientProxy } from '@nestjs/microservices';
|
|
17
16
|
import 'dinero.js/bigint';
|
|
18
17
|
|
|
19
18
|
declare class RequestService {
|
|
@@ -820,13 +819,6 @@ declare class HttpExceptionFilter implements ExceptionFilter {
|
|
|
820
819
|
private isProblemLikeObject;
|
|
821
820
|
}
|
|
822
821
|
|
|
823
|
-
declare class RpcProblemExceptionFilter {
|
|
824
|
-
private readonly logger;
|
|
825
|
-
catch(exception: unknown, _host: ArgumentsHost): Observable<never>;
|
|
826
|
-
private toProblemPayload;
|
|
827
|
-
private isHttpException;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
822
|
type LogLevel = 'error' | 'warn' | 'log' | 'debug' | 'verbose';
|
|
831
823
|
type LogFormat = 'json' | 'text';
|
|
832
824
|
interface LogMetadata {
|
|
@@ -939,78 +931,6 @@ declare const DEFAULT_CORRELATION_HEADER = "x-correlation-id";
|
|
|
939
931
|
declare function generateCorrelationId(): string;
|
|
940
932
|
declare function addCorrelationIdToResponse(reply: FastifyReply, correlationId: string, headerName?: string): void;
|
|
941
933
|
|
|
942
|
-
declare const RpcNatsHeaders: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
943
|
-
declare const RpcBuId: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
944
|
-
declare const RpcBuCurrencyCode: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
945
|
-
|
|
946
|
-
interface NatsHeaders {
|
|
947
|
-
orgId: string;
|
|
948
|
-
userId: string;
|
|
949
|
-
buId: string;
|
|
950
|
-
buTimezone: string;
|
|
951
|
-
buCurrencyCode: string;
|
|
952
|
-
buAncestorIds: string[];
|
|
953
|
-
buDescendantIds: string[];
|
|
954
|
-
}
|
|
955
|
-
declare const NATS_HEADER_KEYS: {
|
|
956
|
-
readonly ORG_ID: "x-org-id";
|
|
957
|
-
readonly USER_ID: "x-user-id";
|
|
958
|
-
readonly BU_ID: "x-bu-id";
|
|
959
|
-
readonly BU_TIMEZONE: "x-bu-timezone";
|
|
960
|
-
readonly BU_CURRENCY_CODE: "x-bu-currency-code";
|
|
961
|
-
readonly BU_ANCESTOR_IDS: "x-bu-ancestor-ids";
|
|
962
|
-
readonly BU_DESCENDANT_IDS: "x-bu-descendant-ids";
|
|
963
|
-
};
|
|
964
|
-
declare function parseNatsHeaders(headers: unknown): NatsHeaders | null;
|
|
965
|
-
|
|
966
|
-
type ContextResolverFn = (sessionInfo: VrittiSessionInfo) => Promise<NatsHeaders>;
|
|
967
|
-
interface NatsServiceConfig {
|
|
968
|
-
name: string;
|
|
969
|
-
}
|
|
970
|
-
interface NatsModuleBaseOptions {
|
|
971
|
-
natsUrl?: string;
|
|
972
|
-
services: NatsServiceConfig[];
|
|
973
|
-
}
|
|
974
|
-
interface NatsRootModuleOptions extends NatsModuleBaseOptions {
|
|
975
|
-
contextResolver: ContextResolverFn;
|
|
976
|
-
}
|
|
977
|
-
interface NatsMicroserviceModuleOptions extends NatsModuleBaseOptions {
|
|
978
|
-
}
|
|
979
|
-
interface NatsRootModuleAsyncOptions {
|
|
980
|
-
imports?: ModuleMetadata['imports'];
|
|
981
|
-
inject?: InjectionToken[];
|
|
982
|
-
useFactory: (...args: any[]) => Promise<NatsRootModuleOptions> | NatsRootModuleOptions;
|
|
983
|
-
}
|
|
984
|
-
interface NatsMicroserviceModuleAsyncOptions {
|
|
985
|
-
imports?: ModuleMetadata['imports'];
|
|
986
|
-
inject?: InjectionToken[];
|
|
987
|
-
useFactory: (...args: any[]) => Promise<NatsMicroserviceModuleOptions> | NatsMicroserviceModuleOptions;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
declare class NatsClientModule implements OnModuleDestroy {
|
|
991
|
-
private static readonly logger;
|
|
992
|
-
private static allClients;
|
|
993
|
-
onModuleDestroy(): Promise<void>;
|
|
994
|
-
private static buildClients;
|
|
995
|
-
static forRoot(asyncOptions: NatsRootModuleAsyncOptions): DynamicModule;
|
|
996
|
-
static forMicroservice(asyncOptions: NatsMicroserviceModuleAsyncOptions): DynamicModule;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
declare class NatsClientService {
|
|
1000
|
-
private readonly request;
|
|
1001
|
-
private readonly contextResolver;
|
|
1002
|
-
private readonly clients;
|
|
1003
|
-
private cachedContext;
|
|
1004
|
-
constructor(request: FastifyRequest, contextResolver: ContextResolverFn, clients: Map<string, ClientProxy>);
|
|
1005
|
-
send<T>(service: string, cmd: string, data?: object): Promise<T>;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
declare class NatsMicroserviceClientService {
|
|
1009
|
-
private readonly clients;
|
|
1010
|
-
constructor(clients: Map<string, ClientProxy>);
|
|
1011
|
-
send<T>(service: string, cmd: string, natsHeaders: NatsHeaders, data?: object): Promise<T>;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
934
|
declare class RootModule {
|
|
1015
935
|
}
|
|
1016
936
|
|
|
@@ -1021,4 +941,4 @@ declare function normalizePhoneNumber(phone: string): string;
|
|
|
1021
941
|
|
|
1022
942
|
declare function parseExpiryToMs(expiry: string): number;
|
|
1023
943
|
|
|
1024
|
-
export { AUTH_CONFIG, AUTH_CONFIG_DEFAULTS, AccessToken, type AccessTokenPayload, type ApiErrorResponse, type AuthConfig, AuthConfigModule, BadGatewayException, BadRequestException, CACHE_PROVIDER, CacheModule, CacheService, type ColumnPinning, ConflictException, type
|
|
944
|
+
export { AUTH_CONFIG, AUTH_CONFIG_DEFAULTS, AccessToken, type AccessTokenPayload, type ApiErrorResponse, type AuthConfig, AuthConfigModule, BadGatewayException, BadRequestException, CACHE_PROVIDER, CacheModule, CacheService, type ColumnPinning, ConflictException, type CookieConfig, CookieDomain, CookieName, type CookieSerializeOptions, type CorrelationContext, CorrelationIdMiddleware, CreateDataTableViewDto, CreateResponseDto, CurrencyAmountDto, DATA_TABLE_VIEWS_TABLE, DEFAULT_CORRELATION_HEADER, DataTableModule, type DataTableModuleOptions, DataTableStateService, DataTableViewDto, type DataTableViewRecord, DataTableViewsService, DatabaseModule, type DatabaseModuleOptions, type DecodedAccessToken, type DecodedRefreshToken, type DensityType, EmailModule, EmailService, type FieldDefinition, type FieldError, type FieldMap, type FilterCondition, type FilterOperator, FilterOperators, FilterProcessor, type FindForSelectConfig, type FindForSelectJoin, ForbiddenException, GoneException, type GuardConfig, Hostname, HttpExceptionFilter, HttpLoggerInterceptor, type HttpLoggerOptions, HttpProblemException, type ICacheProvider, ImportResponseDto, ImportSummaryDto, InternalServerErrorException, IsCurrency, IsCurrencyCode, IsDateTime, LOGGER_MODULE_OPTIONS, type LogFormat, type LogLevel, type LogMetadata, LoggerModule, type LoggerModuleAsyncOptions, type LoggerModuleOptions, type LoggerOptionsFactory, LoggerService, MethodNotAllowedException, type NewDataTableViewRecord, NotAcceptableException, NotFoundException, NotImplementedException, type OnAuthenticatedCallback, PayloadTooLargeException, PrimaryBaseRepository, PrimaryDatabaseService, type PrimaryDbConfig, type ProblemDetails, type ProblemOptions, Public, REQUIRE_SESSION_KEY, RedisCacheProvider, RefreshCookieOptions, RefreshTokenCookie, type RefreshTokenPayload, RenameDataTableViewDto, RequestTimeoutException, RequireSession, RootModule, SKIP_CSRF_KEY, type SearchState, SelectOptionsQueryDto, type SelectQueryGroup, type SelectQueryOption, type SelectQueryResult, ServiceUnavailableException, SessionData, type SessionInfo$1 as SessionInfo, SkipCsrf, type SortCondition, Subdomain, SuccessResponseDto, TableResponseDto, type TableViewState, ToggleShareDataTableViewDto, type TokenExpiry, type TokenExpiryString, TokenService, TokenType, TooManyRequestsException, type TypedDrizzleClient, UnauthorizedException, UnprocessableEntityException, UnsupportedMediaTypeException, UpdateDataTableViewDto, UploadedFile, type UploadedFileResult, UploadedFiles, UpsertDataTableStateDto, UserId, ValidatedRowDto, ValidationException, VrittiAuthGuard, addCorrelationIdToResponse, correlationStorage, dataTableViewsColumns, dataTableViewsIndexes, extractCountryFromPhone, gcd, generateCorrelationId, getCorrelationContext, getHttpStatusTitle, hashToken, normalizePhoneNumber, parseExpiryToMs, runWithCorrelationContext, updateCorrelationContext, verifyTokenHash };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FastifyRequest, FastifyReply
|
|
1
|
+
import { FastifyRequest, FastifyReply } from 'fastify';
|
|
2
2
|
import * as _nestjs_common from '@nestjs/common';
|
|
3
3
|
import { InjectionToken, DynamicModule, CanActivate, ExecutionContext, OnModuleInit, OnModuleDestroy, Logger, HttpException, HttpStatus, ExceptionFilter, ArgumentsHost, ModuleMetadata, Type, LoggerService as LoggerService$1, NestInterceptor, CallHandler, NestModule, MiddlewareConsumer, NestMiddleware } from '@nestjs/common';
|
|
4
4
|
import { Reflector } from '@nestjs/core';
|
|
@@ -13,7 +13,6 @@ import { ValidationOptions } from 'class-validator';
|
|
|
13
13
|
import { Observable } from 'rxjs';
|
|
14
14
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
15
15
|
export { Currency, CurrencyCode, SUPPORTED_CURRENCIES, majorToMinor, minorToMajor } from './money.js';
|
|
16
|
-
import { ClientProxy } from '@nestjs/microservices';
|
|
17
16
|
import 'dinero.js/bigint';
|
|
18
17
|
|
|
19
18
|
declare class RequestService {
|
|
@@ -820,13 +819,6 @@ declare class HttpExceptionFilter implements ExceptionFilter {
|
|
|
820
819
|
private isProblemLikeObject;
|
|
821
820
|
}
|
|
822
821
|
|
|
823
|
-
declare class RpcProblemExceptionFilter {
|
|
824
|
-
private readonly logger;
|
|
825
|
-
catch(exception: unknown, _host: ArgumentsHost): Observable<never>;
|
|
826
|
-
private toProblemPayload;
|
|
827
|
-
private isHttpException;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
822
|
type LogLevel = 'error' | 'warn' | 'log' | 'debug' | 'verbose';
|
|
831
823
|
type LogFormat = 'json' | 'text';
|
|
832
824
|
interface LogMetadata {
|
|
@@ -939,78 +931,6 @@ declare const DEFAULT_CORRELATION_HEADER = "x-correlation-id";
|
|
|
939
931
|
declare function generateCorrelationId(): string;
|
|
940
932
|
declare function addCorrelationIdToResponse(reply: FastifyReply, correlationId: string, headerName?: string): void;
|
|
941
933
|
|
|
942
|
-
declare const RpcNatsHeaders: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
943
|
-
declare const RpcBuId: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
944
|
-
declare const RpcBuCurrencyCode: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
945
|
-
|
|
946
|
-
interface NatsHeaders {
|
|
947
|
-
orgId: string;
|
|
948
|
-
userId: string;
|
|
949
|
-
buId: string;
|
|
950
|
-
buTimezone: string;
|
|
951
|
-
buCurrencyCode: string;
|
|
952
|
-
buAncestorIds: string[];
|
|
953
|
-
buDescendantIds: string[];
|
|
954
|
-
}
|
|
955
|
-
declare const NATS_HEADER_KEYS: {
|
|
956
|
-
readonly ORG_ID: "x-org-id";
|
|
957
|
-
readonly USER_ID: "x-user-id";
|
|
958
|
-
readonly BU_ID: "x-bu-id";
|
|
959
|
-
readonly BU_TIMEZONE: "x-bu-timezone";
|
|
960
|
-
readonly BU_CURRENCY_CODE: "x-bu-currency-code";
|
|
961
|
-
readonly BU_ANCESTOR_IDS: "x-bu-ancestor-ids";
|
|
962
|
-
readonly BU_DESCENDANT_IDS: "x-bu-descendant-ids";
|
|
963
|
-
};
|
|
964
|
-
declare function parseNatsHeaders(headers: unknown): NatsHeaders | null;
|
|
965
|
-
|
|
966
|
-
type ContextResolverFn = (sessionInfo: VrittiSessionInfo) => Promise<NatsHeaders>;
|
|
967
|
-
interface NatsServiceConfig {
|
|
968
|
-
name: string;
|
|
969
|
-
}
|
|
970
|
-
interface NatsModuleBaseOptions {
|
|
971
|
-
natsUrl?: string;
|
|
972
|
-
services: NatsServiceConfig[];
|
|
973
|
-
}
|
|
974
|
-
interface NatsRootModuleOptions extends NatsModuleBaseOptions {
|
|
975
|
-
contextResolver: ContextResolverFn;
|
|
976
|
-
}
|
|
977
|
-
interface NatsMicroserviceModuleOptions extends NatsModuleBaseOptions {
|
|
978
|
-
}
|
|
979
|
-
interface NatsRootModuleAsyncOptions {
|
|
980
|
-
imports?: ModuleMetadata['imports'];
|
|
981
|
-
inject?: InjectionToken[];
|
|
982
|
-
useFactory: (...args: any[]) => Promise<NatsRootModuleOptions> | NatsRootModuleOptions;
|
|
983
|
-
}
|
|
984
|
-
interface NatsMicroserviceModuleAsyncOptions {
|
|
985
|
-
imports?: ModuleMetadata['imports'];
|
|
986
|
-
inject?: InjectionToken[];
|
|
987
|
-
useFactory: (...args: any[]) => Promise<NatsMicroserviceModuleOptions> | NatsMicroserviceModuleOptions;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
declare class NatsClientModule implements OnModuleDestroy {
|
|
991
|
-
private static readonly logger;
|
|
992
|
-
private static allClients;
|
|
993
|
-
onModuleDestroy(): Promise<void>;
|
|
994
|
-
private static buildClients;
|
|
995
|
-
static forRoot(asyncOptions: NatsRootModuleAsyncOptions): DynamicModule;
|
|
996
|
-
static forMicroservice(asyncOptions: NatsMicroserviceModuleAsyncOptions): DynamicModule;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
declare class NatsClientService {
|
|
1000
|
-
private readonly request;
|
|
1001
|
-
private readonly contextResolver;
|
|
1002
|
-
private readonly clients;
|
|
1003
|
-
private cachedContext;
|
|
1004
|
-
constructor(request: FastifyRequest, contextResolver: ContextResolverFn, clients: Map<string, ClientProxy>);
|
|
1005
|
-
send<T>(service: string, cmd: string, data?: object): Promise<T>;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
declare class NatsMicroserviceClientService {
|
|
1009
|
-
private readonly clients;
|
|
1010
|
-
constructor(clients: Map<string, ClientProxy>);
|
|
1011
|
-
send<T>(service: string, cmd: string, natsHeaders: NatsHeaders, data?: object): Promise<T>;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
934
|
declare class RootModule {
|
|
1015
935
|
}
|
|
1016
936
|
|
|
@@ -1021,4 +941,4 @@ declare function normalizePhoneNumber(phone: string): string;
|
|
|
1021
941
|
|
|
1022
942
|
declare function parseExpiryToMs(expiry: string): number;
|
|
1023
943
|
|
|
1024
|
-
export { AUTH_CONFIG, AUTH_CONFIG_DEFAULTS, AccessToken, type AccessTokenPayload, type ApiErrorResponse, type AuthConfig, AuthConfigModule, BadGatewayException, BadRequestException, CACHE_PROVIDER, CacheModule, CacheService, type ColumnPinning, ConflictException, type
|
|
944
|
+
export { AUTH_CONFIG, AUTH_CONFIG_DEFAULTS, AccessToken, type AccessTokenPayload, type ApiErrorResponse, type AuthConfig, AuthConfigModule, BadGatewayException, BadRequestException, CACHE_PROVIDER, CacheModule, CacheService, type ColumnPinning, ConflictException, type CookieConfig, CookieDomain, CookieName, type CookieSerializeOptions, type CorrelationContext, CorrelationIdMiddleware, CreateDataTableViewDto, CreateResponseDto, CurrencyAmountDto, DATA_TABLE_VIEWS_TABLE, DEFAULT_CORRELATION_HEADER, DataTableModule, type DataTableModuleOptions, DataTableStateService, DataTableViewDto, type DataTableViewRecord, DataTableViewsService, DatabaseModule, type DatabaseModuleOptions, type DecodedAccessToken, type DecodedRefreshToken, type DensityType, EmailModule, EmailService, type FieldDefinition, type FieldError, type FieldMap, type FilterCondition, type FilterOperator, FilterOperators, FilterProcessor, type FindForSelectConfig, type FindForSelectJoin, ForbiddenException, GoneException, type GuardConfig, Hostname, HttpExceptionFilter, HttpLoggerInterceptor, type HttpLoggerOptions, HttpProblemException, type ICacheProvider, ImportResponseDto, ImportSummaryDto, InternalServerErrorException, IsCurrency, IsCurrencyCode, IsDateTime, LOGGER_MODULE_OPTIONS, type LogFormat, type LogLevel, type LogMetadata, LoggerModule, type LoggerModuleAsyncOptions, type LoggerModuleOptions, type LoggerOptionsFactory, LoggerService, MethodNotAllowedException, type NewDataTableViewRecord, NotAcceptableException, NotFoundException, NotImplementedException, type OnAuthenticatedCallback, PayloadTooLargeException, PrimaryBaseRepository, PrimaryDatabaseService, type PrimaryDbConfig, type ProblemDetails, type ProblemOptions, Public, REQUIRE_SESSION_KEY, RedisCacheProvider, RefreshCookieOptions, RefreshTokenCookie, type RefreshTokenPayload, RenameDataTableViewDto, RequestTimeoutException, RequireSession, RootModule, SKIP_CSRF_KEY, type SearchState, SelectOptionsQueryDto, type SelectQueryGroup, type SelectQueryOption, type SelectQueryResult, ServiceUnavailableException, SessionData, type SessionInfo$1 as SessionInfo, SkipCsrf, type SortCondition, Subdomain, SuccessResponseDto, TableResponseDto, type TableViewState, ToggleShareDataTableViewDto, type TokenExpiry, type TokenExpiryString, TokenService, TokenType, TooManyRequestsException, type TypedDrizzleClient, UnauthorizedException, UnprocessableEntityException, UnsupportedMediaTypeException, UpdateDataTableViewDto, UploadedFile, type UploadedFileResult, UploadedFiles, UpsertDataTableStateDto, UserId, ValidatedRowDto, ValidationException, VrittiAuthGuard, addCorrelationIdToResponse, correlationStorage, dataTableViewsColumns, dataTableViewsIndexes, extractCountryFromPhone, gcd, generateCorrelationId, getCorrelationContext, getHttpStatusTitle, hashToken, normalizePhoneNumber, parseExpiryToMs, runWithCorrelationContext, updateCorrelationContext, verifyTokenHash };
|