@akanjs/nest 0.0.38 → 0.0.40

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.
@@ -0,0 +1,80 @@
1
+ import * as socket_io from 'socket.io';
2
+ import { Socket } from 'socket.io';
3
+ import { A as Account } from './signalDecorators-Bh7Aniud.js';
4
+ import { ExecutionContext, CanActivate } from '@nestjs/common';
5
+
6
+ interface RequestContext {
7
+ account: Account;
8
+ ip?: string;
9
+ userAgent?: string;
10
+ geolocation?: string;
11
+ headers: Record<string, string | undefined>;
12
+ cookies?: Record<string, string>;
13
+ }
14
+ interface ReqType {
15
+ method: string;
16
+ url: string;
17
+ params: object;
18
+ query: object;
19
+ body: object;
20
+ }
21
+ interface GqlReqType {
22
+ parentType?: {
23
+ name?: string;
24
+ };
25
+ fieldName?: string;
26
+ }
27
+ declare const getRequest: (context: ExecutionContext) => unknown;
28
+ declare const getResponse: (context: ExecutionContext) => unknown;
29
+ declare const getArgs: (context: ExecutionContext) => {
30
+ [key: string]: any;
31
+ };
32
+ declare const getSocket: (context: ExecutionContext) => Socket<socket_io.DefaultEventsMap, socket_io.DefaultEventsMap, socket_io.DefaultEventsMap, any>;
33
+ declare class Public implements CanActivate {
34
+ canActivate(context: ExecutionContext): boolean;
35
+ }
36
+ declare class None implements CanActivate {
37
+ canActivate(): boolean;
38
+ }
39
+ declare class Every implements CanActivate {
40
+ canActivate(context: ExecutionContext): boolean;
41
+ }
42
+ declare class Owner implements CanActivate {
43
+ canActivate(context: ExecutionContext): boolean;
44
+ }
45
+ declare class Admin implements CanActivate {
46
+ canActivate(context: ExecutionContext): boolean;
47
+ }
48
+ declare class SuperAdmin implements CanActivate {
49
+ canActivate(context: ExecutionContext): boolean;
50
+ }
51
+ declare class User implements CanActivate {
52
+ canActivate(context: ExecutionContext): boolean;
53
+ }
54
+
55
+ type authGuards_Admin = Admin;
56
+ declare const authGuards_Admin: typeof Admin;
57
+ type authGuards_Every = Every;
58
+ declare const authGuards_Every: typeof Every;
59
+ type authGuards_GqlReqType = GqlReqType;
60
+ type authGuards_None = None;
61
+ declare const authGuards_None: typeof None;
62
+ type authGuards_Owner = Owner;
63
+ declare const authGuards_Owner: typeof Owner;
64
+ type authGuards_Public = Public;
65
+ declare const authGuards_Public: typeof Public;
66
+ type authGuards_ReqType = ReqType;
67
+ type authGuards_RequestContext = RequestContext;
68
+ type authGuards_SuperAdmin = SuperAdmin;
69
+ declare const authGuards_SuperAdmin: typeof SuperAdmin;
70
+ type authGuards_User = User;
71
+ declare const authGuards_User: typeof User;
72
+ declare const authGuards_getArgs: typeof getArgs;
73
+ declare const authGuards_getRequest: typeof getRequest;
74
+ declare const authGuards_getResponse: typeof getResponse;
75
+ declare const authGuards_getSocket: typeof getSocket;
76
+ declare namespace authGuards {
77
+ export { authGuards_Admin as Admin, authGuards_Every as Every, type authGuards_GqlReqType as GqlReqType, authGuards_None as None, authGuards_Owner as Owner, authGuards_Public as Public, type authGuards_ReqType as ReqType, type authGuards_RequestContext as RequestContext, authGuards_SuperAdmin as SuperAdmin, authGuards_User as User, authGuards_getArgs as getArgs, authGuards_getRequest as getRequest, authGuards_getResponse as getResponse, authGuards_getSocket as getSocket };
78
+ }
79
+
80
+ export { Admin as A, Every as E, type GqlReqType as G, None as N, Owner as O, Public as P, type RequestContext as R, SuperAdmin as S, User as U, authGuards as a, type ReqType as b, getResponse as c, getArgs as d, getSocket as e, getRequest as g };
@@ -0,0 +1,33 @@
1
+ import { SshOptions } from 'tunnel-ssh';
2
+
3
+ type Environment = "testing" | "debug" | "develop" | "main";
4
+ interface BaseEnv {
5
+ repoName: string;
6
+ serveDomain: string;
7
+ appName: string;
8
+ environment: Environment;
9
+ operationType: "server" | "client";
10
+ operationMode: "local" | "edge" | "cloud" | "module";
11
+ networkType: "mainnet" | "testnet" | "debugnet";
12
+ tunnelUsername: string;
13
+ tunnelPassword: string;
14
+ }
15
+ type BackendEnv = BaseEnv & {
16
+ hostname: string | null;
17
+ appCode: number;
18
+ mongo: {
19
+ username?: string;
20
+ password?: string;
21
+ sshOptions?: SshOptions;
22
+ };
23
+ redis?: {
24
+ sshOptions?: SshOptions;
25
+ };
26
+ port?: number;
27
+ mongoUri?: string;
28
+ redisUri?: string;
29
+ meiliUri?: string;
30
+ onCleanup?: () => Promise<void>;
31
+ };
32
+
33
+ export type { BaseEnv as B, Environment as E, BackendEnv as a };
@@ -0,0 +1,36 @@
1
+ import * as fs from 'fs';
2
+
3
+ declare const objPath: (o: unknown, p: string) => unknown;
4
+ declare class FileSystem {
5
+ filename: string;
6
+ dirname: string;
7
+ writeStream?: fs.WriteStream;
8
+ constructor(dirname?: string, filename?: string);
9
+ init(): Promise<unknown>;
10
+ write(body: string): boolean;
11
+ }
12
+ interface ExportForm<T> {
13
+ items: T[];
14
+ path: string;
15
+ fields?: string[];
16
+ options?: {
17
+ append: boolean;
18
+ };
19
+ delimiter?: string;
20
+ }
21
+ declare const exportToCsv: <T>({ items, path, fields, delimiter, options }: ExportForm<T>) => Promise<void>;
22
+ declare const exportToJson: <T>(items: T | T[], localPath: string) => void;
23
+ declare const readJson: (localPath: string) => unknown;
24
+
25
+ type exporter_ExportForm<T> = ExportForm<T>;
26
+ type exporter_FileSystem = FileSystem;
27
+ declare const exporter_FileSystem: typeof FileSystem;
28
+ declare const exporter_exportToCsv: typeof exportToCsv;
29
+ declare const exporter_exportToJson: typeof exportToJson;
30
+ declare const exporter_objPath: typeof objPath;
31
+ declare const exporter_readJson: typeof readJson;
32
+ declare namespace exporter {
33
+ export { type exporter_ExportForm as ExportForm, exporter_FileSystem as FileSystem, exporter_exportToCsv as exportToCsv, exporter_exportToJson as exportToJson, exporter_objPath as objPath, exporter_readJson as readJson };
34
+ }
35
+
36
+ export { type ExportForm as E, FileSystem as F, exportToCsv as a, exportToJson as b, exporter as e, objPath as o, readJson as r };
package/index.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ export { allow, verifyToken } from './src/authorization.js';
2
+ export { A as Admin, E as Every, G as GqlReqType, N as None, O as Owner, P as Public, b as ReqType, R as RequestContext, S as SuperAdmin, U as User, d as getArgs, g as getRequest, c as getResponse, e as getSocket, a as guards } from './authGuards-BrXXzJa_.js';
3
+ export { Access, Account, Me, Req, Res, Self, UserIp, Ws } from './src/authentication.js';
4
+ export { CacheInterceptor, LoggingInterceptor, TimeoutInterceptor } from './src/interceptors.js';
5
+ export { RedisIoAdapter } from './src/redis-io.adapter.js';
6
+ export { ArrayifyPipe, BooleanPipe, DayjsPipe, FloatPipe, IntPipe, JSONPipe, MulterToUploadPipe, getBodyPipes, getQueryPipes } from './src/pipes.js';
7
+ export { E as ExportForm, e as Exporter, F as FileSystem, a as exportToCsv, b as exportToJson, o as objPath, r as readJson } from './exporter-BJ7Vr_DT.js';
8
+ export { verifyPayment } from './src/verifyPayment.js';
9
+ export { AppleCredential, FacebookResponse, GithubResponse, GoogleResponse, KakaoResponse, NaverResponse, SSOCredential, SSOOptions, SsoCookie, getSsoProviders, verifyAppleUser } from './src/sso.js';
10
+ export { AllExceptionsFilter } from './src/exceptions.js';
11
+ export { SALT_ROUNDS, generateAeskey, generateHost, generateJwtSecret, generateMeiliKey, generateMeiliUri, generateMongoUri, generateRedisUri } from './src/generateSecrets.js';
12
+ export { initMongoDB } from './src/mongoose.js';
13
+ export { SearchClient } from './src/searchClient.js';
14
+ export { CacheClient } from './src/cacheClient.js';
15
+ export { DatabaseClient } from './src/databaseClient.js';
16
+ export { Cache, Cron, Interval, Transaction, Try } from './src/decorators.js';
17
+ import './signalDecorators-Bh7Aniud.js';
18
+ import './baseEnv-Qb_Lg-a-.js';
19
+ import 'tunnel-ssh';
20
+ import 'dayjs';
21
+ import 'socket.io';
22
+ import '@nestjs/common';
23
+ import 'redis';
24
+ import 'rxjs';
25
+ import '@nestjs/platform-socket.io';
26
+ import 'stream';
27
+ import 'fs';
28
+ import 'jsonwebtoken';
29
+ import 'meilisearch';
30
+ import 'mongoose';
31
+ import '@nestjs/schedule';