1.0.45 • Published 1 year ago

@rainbow-o23/n2 v1.0.45

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Static Badge

Nest

Module Formats

o23/n2

In simple terms, o23/n2 is a tool that publishes a given pipeline as a web application using NestJS. In this module, we handle the following tasks:

  • Registering all pipelines and exposing the specified ones as REST APIs,
  • Redirecting logs to standard web log output,
  • Providing standard error handling, where all errors will be caught and processed uniformly,
  • Providing a health check API and a version API,
  • Providing a standard pipeline invocation API. Please note that this API is fully compatible with all data processing pipelines but not with file processing pipelines.

Request

Support request parsing as following:

  • API path,
  • Method,
  • Request headers,
  • Path parameters,
  • Query string parameters,
  • Files,
  • Json body.

The thing to note is that when multiple types of request data are enabled, o23/n2 will degrade and merge them into a single JSON object, and each part has its own naming conventions as follows:

  • Request headers: headers, or given names,
  • Path parameters: pathParams, or given names,
  • Query string parameters: queryParams, or given names,
  • Files: file for single file, files for multiple files, or given names,
  • Json body: body.

Response

Support response outputs as following:

  • Response headers,
  • File download,
  • Json body.

APIs

Health Check

- URL: /
- Method: Get
- Response: { up: true, message: 'Hello there, I am OK now.' }

App Version

- URL: /version
- Method: Get
- Response: { version: 'UNDOCUMENTED', builtAt: 'UNDOCUMENTED' }

Pipeline Trigger

- URL: /pipeline
- Method: Post
- Request: { code: 'string'; payload: 'any' }
- Response: 'any'

The specific data format for the request payload and response depends on the pipeline that needs to be executed.

Referring to the example in o23/scaffold on how to build an application based on o23/n2, won't go into detail here.

Environment Parameters

NameTypeDefault ValueComments
app.portnumber3100Application server port.
app.contextstring/o23Application api context.
app.namestringO23-N99Application name.
app.providerstringRainbow TeamApplication provider.
app.versionstringUNDOCUMENTEDApplication build version.
app.built.atstringUNDOCUMENTEDApplication build time.
app.body.json.max.sizestring50mbRequest maximum body size, for json body.
app.body.urlencoded.max.sizestring50mbRequest maximum body size, for urlencoded body.
app.cors.enabledbooleanfalseEnable cors.
app.cors.optionsjsonCorsOptions of @nestjs/common.
logger.file.enabledbooleanfalseEnable file log.
logger.file.rotate.enabledbooleantrueEnable rotate file log.
logger.error.filestringlogs/error-%DATE%.logError log file.
logger.error.levelstringerrorLogger level for error log file.
logger.error.jsonbooleantrueUse json format.
logger.error.date.patternstringYYYY-MM-DDError log file date pattern.
logger.error.zipped.archivebooleanfalseEnabled zip for error log file.
logger.error.max.filesstring30dError log file keeping time.
logger.error.max.sizestring10mError log file maximum size.
logger.combined.filestringlogs/combined-%DATE%.logStandard log file.
logger.combined.levelstringlogLogger level for standard log file.
logger.combined.jsonbooleantrueUse json format.
logger.combined.date.patternstringYYYY-MM-DDStandard log file date pattern.
logger.combined.zipped.archivebooleanfalseEnabled zip for standard log file.
logger.combined.max.filesstring7dStandard log file keeping time.
logger.combined.max.sizestring10mStandard log file maximum size.
logger.console.enabledbooleanfalseEnable console log.
logger.console.levelstringdebugLogger level for console log.
1.0.45

1 year ago

1.0.44

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.40

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.33

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

0.1.21

2 years ago

0.1.21-alpha.2

2 years ago

0.1.21-alpha.1

2 years ago

0.1.20

2 years ago

0.1.16

2 years ago

0.1.17

2 years ago

0.1.18

2 years ago

0.1.19

2 years ago

0.1.15

2 years ago

0.1.10

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.2-alpha.3

2 years ago

0.1.2-alpha.2

2 years ago

0.1.2-alpha

2 years ago

0.1.1

2 years ago