@uds-nexusai/aws-core 0.1.4 → 0.1.5
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/helpers/create.async.options.provider.d.ts +11 -0
- package/dist/helpers/create.async.options.provider.d.ts.map +1 -0
- package/dist/helpers/create.async.options.provider.js +46 -0
- package/dist/helpers/create.async.options.provider.js.map +1 -0
- package/dist/helpers/create.client.provider.d.ts +7 -0
- package/dist/helpers/create.client.provider.d.ts.map +1 -0
- package/dist/helpers/create.client.provider.js +11 -0
- package/dist/helpers/create.client.provider.js.map +1 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +19 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/aws.module.options.factory.d.ts +4 -0
- package/dist/interfaces/aws.module.options.factory.d.ts.map +1 -0
- package/dist/interfaces/aws.module.options.factory.js +3 -0
- package/dist/interfaces/aws.module.options.factory.js.map +1 -0
- package/dist/interfaces/base.module.async.options.d.ts +8 -0
- package/dist/interfaces/base.module.async.options.d.ts.map +1 -0
- package/dist/interfaces/base.module.async.options.js +3 -0
- package/dist/interfaces/base.module.async.options.js.map +1 -0
- package/dist/interfaces/index.d.ts +3 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +19 -0
- package/dist/interfaces/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Provider } from '@nestjs/common';
|
|
2
|
+
import { BaseModuleAsyncOptions } from 'src/interfaces/base.module.async.options';
|
|
3
|
+
export declare function createAsyncOptionsProvider<TOptions>(params: {
|
|
4
|
+
optionsToken: string | symbol;
|
|
5
|
+
useFactory: (...args: any[]) => Promise<TOptions> | TOptions;
|
|
6
|
+
inject?: any[];
|
|
7
|
+
}): Provider;
|
|
8
|
+
export declare function createAsyncOptionsProviders<TOptions, TFactory extends {
|
|
9
|
+
createOptions(): Promise<TOptions> | TOptions;
|
|
10
|
+
}>(options: BaseModuleAsyncOptions<TOptions, TFactory>, optionsToken: string | symbol): Provider[];
|
|
11
|
+
//# sourceMappingURL=create.async.options.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.async.options.provider.d.ts","sourceRoot":"","sources":["../../src/helpers/create.async.options.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAElF,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE;IAC3D,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAC7D,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;CAChB,GAAG,QAAQ,CAMX;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EACR,QAAQ,SAAS;IACf,aAAa,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;CAC/C,EAED,OAAO,EAAE,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACnD,YAAY,EAAE,MAAM,GAAG,MAAM,GAC5B,QAAQ,EAAE,CAsCZ"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAsyncOptionsProvider = createAsyncOptionsProvider;
|
|
4
|
+
exports.createAsyncOptionsProviders = createAsyncOptionsProviders;
|
|
5
|
+
function createAsyncOptionsProvider(params) {
|
|
6
|
+
return {
|
|
7
|
+
provide: params.optionsToken,
|
|
8
|
+
useFactory: params.useFactory,
|
|
9
|
+
inject: params.inject ?? [],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function createAsyncOptionsProviders(options, optionsToken) {
|
|
13
|
+
if (options.useFactory) {
|
|
14
|
+
return [
|
|
15
|
+
createAsyncOptionsProvider({
|
|
16
|
+
optionsToken,
|
|
17
|
+
useFactory: options.useFactory,
|
|
18
|
+
inject: options.inject,
|
|
19
|
+
}),
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
if (options.useExisting) {
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
provide: optionsToken,
|
|
26
|
+
useFactory: async (factory) => factory.createOptions(),
|
|
27
|
+
inject: [options.useExisting],
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
if (options.useClass) {
|
|
32
|
+
return [
|
|
33
|
+
{
|
|
34
|
+
provide: optionsToken,
|
|
35
|
+
useFactory: async (factory) => factory.createOptions(),
|
|
36
|
+
inject: [options.useClass],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
provide: options.useClass,
|
|
40
|
+
useClass: options.useClass,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
throw new Error('Invalid async options. Provide useFactory, useClass, or useExisting.');
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=create.async.options.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.async.options.provider.js","sourceRoot":"","sources":["../../src/helpers/create.async.options.provider.ts"],"names":[],"mappings":";;AAGA,gEAUC;AAED,kEA8CC;AA1DD,SAAgB,0BAA0B,CAAW,MAIpD;IACC,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,YAAY;QAC5B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;KAC5B,CAAC;AACJ,CAAC;AAED,SAAgB,2BAA2B,CAMzC,OAAmD,EACnD,YAA6B;IAE7B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,OAAO;YACL,0BAA0B,CAAC;gBACzB,YAAY;gBACZ,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC;SACH,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,OAAO;YACL;gBACE,OAAO,EAAE,YAAY;gBACrB,UAAU,EAAE,KAAK,EAAE,OAAiB,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE;gBAChE,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;aAC9B;SACF,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO;YACL;gBACE,OAAO,EAAE,YAAY;gBACrB,UAAU,EAAE,KAAK,EAAE,OAAiB,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE;gBAChE,MAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;aAC3B;YACD;gBACE,OAAO,EAAE,OAAO,CAAC,QAAQ;gBACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ;aAC3B;SACF,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Provider } from '@nestjs/common';
|
|
2
|
+
export declare function createAwsClientProvider<TOptions, TClient>(params: {
|
|
3
|
+
clientToken: string | symbol;
|
|
4
|
+
optionsToken: string | symbol;
|
|
5
|
+
createClient: (options: TOptions) => TClient;
|
|
6
|
+
}): Provider;
|
|
7
|
+
//# sourceMappingURL=create.client.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.client.provider.d.ts","sourceRoot":"","sources":["../../src/helpers/create.client.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE;IACjE,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,YAAY,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC;CAC9C,GAAG,QAAQ,CAMX"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAwsClientProvider = createAwsClientProvider;
|
|
4
|
+
function createAwsClientProvider(params) {
|
|
5
|
+
return {
|
|
6
|
+
provide: params.clientToken,
|
|
7
|
+
useFactory: (options) => params.createClient(options),
|
|
8
|
+
inject: [params.optionsToken],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=create.client.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.client.provider.js","sourceRoot":"","sources":["../../src/helpers/create.client.provider.ts"],"names":[],"mappings":";;AAEA,0DAUC;AAVD,SAAgB,uBAAuB,CAAoB,MAI1D;IACC,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,WAAW;QAC3B,UAAU,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC;QAC/D,MAAM,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create.async.options.provider"), exports);
|
|
18
|
+
__exportStar(require("./create.client.provider"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,2DAAyC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./helpers"), exports);
|
|
18
|
+
__exportStar(require("./interfaces"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,+CAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws.module.options.factory.d.ts","sourceRoot":"","sources":["../../src/interfaces/aws.module.options.factory.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB,CAAC,QAAQ;IAC/C,aAAa,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws.module.options.factory.js","sourceRoot":"","sources":["../../src/interfaces/aws.module.options.factory.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
export interface BaseModuleAsyncOptions<TOptions, TFactory = any> extends Pick<ModuleMetadata, 'imports'> {
|
|
3
|
+
useExisting?: Type<TFactory>;
|
|
4
|
+
useClass?: Type<TFactory>;
|
|
5
|
+
useFactory?: (...args: any[]) => Promise<TOptions> | TOptions;
|
|
6
|
+
inject?: any[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=base.module.async.options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.module.async.options.d.ts","sourceRoot":"","sources":["../../src/interfaces/base.module.async.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,WAAW,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAAE,SAAQ,IAAI,CAC5E,cAAc,EACd,SAAS,CACV;IACC,WAAW,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAC9D,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.module.async.options.js","sourceRoot":"","sources":["../../src/interfaces/base.module.async.options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./aws.module.options.factory"), exports);
|
|
18
|
+
__exportStar(require("./base.module.async.options"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,8DAA4C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uds-nexusai/aws-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"private": false,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "
|
|
23
|
+
"build": "tsc",
|
|
24
24
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
25
25
|
"start": "nest start",
|
|
26
26
|
"start:dev": "nest start --watch",
|