@telia-ace/alliance-internal-node-utilities 1.0.1 → 1.0.2-next.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @telia-ace/alliance-internal-node-utilities
2
2
 
3
+ ## 1.0.2-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 9c6dc92: Added utility for creating public static files used in all Alliance portal distributions.
8
+
9
+ ## 1.0.2-next.0
10
+
11
+ ### Patch Changes
12
+
13
+ - 59f0d3f: Remove unnecessary scripts.
14
+
3
15
  ## 1.0.1
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1,13 @@
1
+ import { ConfigService } from '@nestjs/config';
2
+ import type { RequestHandler } from 'express';
3
+ import { ConfigParams } from 'express-openid-connect';
4
+ type Settings = {
5
+ baseURL?: ConfigParams['baseURL'];
6
+ clientID?: ConfigParams['clientID'];
7
+ clientSecret?: ConfigParams['clientSecret'];
8
+ authRequired?: ConfigParams['authRequired'];
9
+ authorizationParams?: ConfigParams['authorizationParams'];
10
+ afterCallback?: ConfigParams['afterCallback'];
11
+ };
12
+ export declare function authMiddleware(configService: ConfigService, { baseURL, clientSecret, clientID, authRequired, authorizationParams, afterCallback, }?: Settings): RequestHandler;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './auth.middleware';
2
+ export * from './tokens';
@@ -0,0 +1,2 @@
1
+ export * from './config';
2
+ export * from './headers';
@@ -0,0 +1,2 @@
1
+ import { LooseObject } from '@/types';
2
+ export declare function generateCookiePolicyHtml(appManifests: LooseObject): string;
@@ -0,0 +1 @@
1
+ export declare function createPublicDistributionFiles(): Promise<void>;
@@ -0,0 +1 @@
1
+ export { createPublicDistributionFiles } from './create-public-files';
@@ -0,0 +1,7 @@
1
+ import type { Schema } from 'jsonschema';
2
+ type JsonSchemas = {
3
+ appConfig: Schema;
4
+ appManifest: Schema;
5
+ };
6
+ export declare function getJsonSchemas(): JsonSchemas;
7
+ export {};
@@ -0,0 +1,13 @@
1
+ import { LooseObject } from '@/types';
2
+ type PkgJson = LooseObject & {
3
+ name: string;
4
+ version: string;
5
+ };
6
+ export type AlliancePortalDistPkgJson = PkgJson & {
7
+ alliance?: {
8
+ apps?: string[];
9
+ };
10
+ };
11
+ export declare function getPkgJson(): AlliancePortalDistPkgJson;
12
+ export declare function getManifests(pkgJson: AlliancePortalDistPkgJson): Promise<LooseObject>;
13
+ export {};
@@ -0,0 +1,7 @@
1
+ import { HttpException } from '@nestjs/common';
2
+ import { ErrorCodes } from './codes';
3
+ export declare class AllianceException extends HttpException {
4
+ info: string;
5
+ code: ErrorCodes;
6
+ constructor(code: ErrorCodes, variables?: Record<string, string>);
7
+ }
@@ -1,4 +1,4 @@
1
- import { ArgumentsHost, ExceptionFilter, HttpException } from '@nestjs/common';
1
+ import { HttpStatus } from '@nestjs/common';
2
2
  export declare enum GatewayErrorCodes {
3
3
  NoMatchingEndpoint = 10000,
4
4
  NoObjectId = 10001,
@@ -16,18 +16,19 @@ export declare enum GatewayErrorCodes {
16
16
  }
17
17
  export declare enum DatabasesErrorCodes {
18
18
  NoPublicKey = 11000,
19
- NoAuthHeader = 11001
19
+ NoAuthHeader = 11001,
20
+ FailedFileStore = 11002,
21
+ FailedFileRead = 11003
20
22
  }
21
23
  export declare enum PortalErrorCodes {
22
24
  NoObjectId = 12000
23
25
  }
24
- type ErrorCodes = GatewayErrorCodes | DatabasesErrorCodes | PortalErrorCodes;
25
- export declare class AllianceException extends HttpException {
26
- info: string;
27
- code: ErrorCodes;
28
- constructor(code: ErrorCodes, variables?: Record<string, string>);
29
- }
30
- export declare class AllianceExceptionFilter implements ExceptionFilter {
31
- catch(exception: AllianceException, host: ArgumentsHost): void;
32
- }
26
+ export type ErrorCodes = GatewayErrorCodes | DatabasesErrorCodes | PortalErrorCodes;
27
+ type AllianceErrors = {
28
+ [key in ErrorCodes]: {
29
+ httpCode: HttpStatus;
30
+ message: string;
31
+ };
32
+ };
33
+ export declare const allianceErrors: AllianceErrors;
33
34
  export {};
@@ -0,0 +1,5 @@
1
+ import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
2
+ import { AllianceException } from './alliance.exception';
3
+ export declare class AllianceExceptionFilter implements ExceptionFilter {
4
+ catch(exception: AllianceException, host: ArgumentsHost): void;
5
+ }
@@ -0,0 +1,3 @@
1
+ export * from './alliance.exception';
2
+ export * from './codes';
3
+ export * from './exception.filter';
@@ -0,0 +1,2 @@
1
+ import { LooseObject } from './types';
2
+ export declare function getAppManifests(apps: string[]): Promise<LooseObject[]>;