@uds-nexusai/aws-core 0.1.1 → 0.1.3

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/package.json CHANGED
@@ -1,10 +1,23 @@
1
1
  {
2
2
  "name": "@uds-nexusai/aws-core",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
7
7
  "license": "UNLICENSED",
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "type": "commonjs",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "require": "./dist/index.js",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
8
21
  "scripts": {
9
22
  "build": "nest build",
10
23
  "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "endOfLine": "auto"
5
- }
package/eslint.config.mjs DELETED
@@ -1,34 +0,0 @@
1
- // @ts-check
2
- import eslint from '@eslint/js';
3
- import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4
- import globals from 'globals';
5
- import tseslint from 'typescript-eslint';
6
-
7
- export default tseslint.config(
8
- {
9
- ignores: ['eslint.config.mjs'],
10
- },
11
- eslint.configs.recommended,
12
- ...tseslint.configs.recommendedTypeChecked,
13
- eslintPluginPrettierRecommended,
14
- {
15
- languageOptions: {
16
- globals: {
17
- ...globals.node,
18
- ...globals.jest,
19
- },
20
- sourceType: 'commonjs',
21
- parserOptions: {
22
- projectService: true,
23
- tsconfigRootDir: import.meta.dirname,
24
- },
25
- },
26
- },
27
- {
28
- rules: {
29
- '@typescript-eslint/no-explicit-any': 'off',
30
- '@typescript-eslint/no-floating-promises': 'warn',
31
- '@typescript-eslint/no-unsafe-argument': 'warn'
32
- },
33
- },
34
- );
package/nest-cli.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/nest-cli",
3
- "collection": "@nestjs/schematics",
4
- "sourceRoot": "src",
5
- "compilerOptions": {
6
- "deleteOutDir": true
7
- }
8
- }
@@ -1,62 +0,0 @@
1
- import { Provider } from '@nestjs/common';
2
- import { BaseModuleAsyncOptions } from 'src/interfaces/base.module.async.options';
3
-
4
- export function createAsyncOptionsProvider<TOptions>(params: {
5
- optionsToken: string | symbol;
6
- useFactory: (...args: any[]) => Promise<TOptions> | TOptions;
7
- inject?: any[];
8
- }): Provider {
9
- return {
10
- provide: params.optionsToken,
11
- useFactory: params.useFactory,
12
- inject: params.inject ?? [],
13
- };
14
- }
15
-
16
- export function createAsyncOptionsProviders<
17
- TOptions,
18
- TFactory extends {
19
- createOptions(): Promise<TOptions> | TOptions;
20
- },
21
- >(
22
- options: BaseModuleAsyncOptions<TOptions, TFactory>,
23
- optionsToken: string | symbol,
24
- ): Provider[] {
25
- if (options.useFactory) {
26
- return [
27
- createAsyncOptionsProvider({
28
- optionsToken,
29
- useFactory: options.useFactory,
30
- inject: options.inject,
31
- }),
32
- ];
33
- }
34
-
35
- if (options.useExisting) {
36
- return [
37
- {
38
- provide: optionsToken,
39
- useFactory: async (factory: TFactory) => factory.createOptions(),
40
- inject: [options.useExisting],
41
- },
42
- ];
43
- }
44
-
45
- if (options.useClass) {
46
- return [
47
- {
48
- provide: optionsToken,
49
- useFactory: async (factory: TFactory) => factory.createOptions(),
50
- inject: [options.useClass],
51
- },
52
- {
53
- provide: options.useClass,
54
- useClass: options.useClass,
55
- },
56
- ];
57
- }
58
-
59
- throw new Error(
60
- 'Invalid async options. Provide useFactory, useClass, or useExisting.',
61
- );
62
- }
@@ -1,13 +0,0 @@
1
- import { Provider } from '@nestjs/common';
2
-
3
- export function createAwsClientProvider<TOptions, TClient>(params: {
4
- clientToken: string | symbol;
5
- optionsToken: string | symbol;
6
- createClient: (options: TOptions) => TClient;
7
- }): Provider {
8
- return {
9
- provide: params.clientToken,
10
- useFactory: (options: TOptions) => params.createClient(options),
11
- inject: [params.optionsToken],
12
- };
13
- }
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './helpers/create.client.provider';
2
- export * from './helpers/create.async.options.provider';
3
-
4
- export * from './interfaces/aws.module.options.factory';
5
- export * from './interfaces/base.module.async.options';
@@ -1,3 +0,0 @@
1
- export interface AwsModuleOptionsFactory<TOptions> {
2
- createOptions(): Promise<TOptions> | TOptions;
3
- }
@@ -1,11 +0,0 @@
1
- import { ModuleMetadata, Type } from '@nestjs/common';
2
-
3
- export interface BaseModuleAsyncOptions<TOptions, TFactory = any> extends Pick<
4
- ModuleMetadata,
5
- 'imports'
6
- > {
7
- useExisting?: Type<TFactory>;
8
- useClass?: Type<TFactory>;
9
- useFactory?: (...args: any[]) => Promise<TOptions> | TOptions;
10
- inject?: any[];
11
- }
@@ -1,25 +0,0 @@
1
- import { Test, TestingModule } from '@nestjs/testing';
2
- import { INestApplication } from '@nestjs/common';
3
- import * as request from 'supertest';
4
- import { App } from 'supertest/types';
5
- import { AppModule } from './../src/app.module';
6
-
7
- describe('AppController (e2e)', () => {
8
- let app: INestApplication<App>;
9
-
10
- beforeEach(async () => {
11
- const moduleFixture: TestingModule = await Test.createTestingModule({
12
- imports: [AppModule],
13
- }).compile();
14
-
15
- app = moduleFixture.createNestApplication();
16
- await app.init();
17
- });
18
-
19
- it('/ (GET)', () => {
20
- return request(app.getHttpServer())
21
- .get('/')
22
- .expect(200)
23
- .expect('Hello World!');
24
- });
25
- });
@@ -1,9 +0,0 @@
1
- {
2
- "moduleFileExtensions": ["js", "json", "ts"],
3
- "rootDir": ".",
4
- "testEnvironment": "node",
5
- "testRegex": ".e2e-spec.ts$",
6
- "transform": {
7
- "^.+\\.(t|j)s$": "ts-jest"
8
- }
9
- }
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
4
- }
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "declaration": true,
5
- "removeComments": true,
6
- "emitDecoratorMetadata": true,
7
- "experimentalDecorators": true,
8
- "allowSyntheticDefaultImports": true,
9
- "target": "ES2023",
10
- "sourceMap": true,
11
- "outDir": "./dist",
12
- "baseUrl": "./",
13
- "incremental": true,
14
- "skipLibCheck": true,
15
- "strictNullChecks": true,
16
- "forceConsistentCasingInFileNames": true,
17
- "noImplicitAny": false,
18
- "strictBindCallApply": false,
19
- "noFallthroughCasesInSwitch": false,
20
- }
21
- }