1.0.23 • Published 6 years ago

lemoncloud-engine-js v1.0.23

Weekly downloads
68
License
MIT
Repository
github
Last release
6 years ago

lemoncloud-engine-js

Common LEMON Engine Module by lemoncloud.

Usage

# install module
$ npm install lemoncloud-engine-js --save

# update module
$ npm update lemoncloud-engine-js --save

사용법.

코드에서 사용 방법.

//! define instance scope.
const $scope = 0 ? global : {
	name : 'LEMON-MESSAGES'                         // name of scope
	,env : process.env								// environment setting (see below)
}

//! load engine with configuration.
const handler = require('lemoncloud-engine-js')($scope);

//! instance manager in scope of $scope
const _$ = handler._$;

//! common user handler.
const user = handler.user;
const group = handler.group;
const chat = handler.chat;

// data properties.
const FIELDS = [
    'id', 'type', 'parent', 'name', 'message'
];
const ES_FIELDS = FIELDS;

//! create engine for Messages.
const $LEM = _$.LEM(_$, '_'+name, {
    ID_TYPE     : 'LemonMessagesSeq',			// WARN! '#' means no auto-generated id.
    ID_NEXT     : 1000,                         // ID Starts
    FIELDS      : FIELDS,                       // Properties
    DYNA_TABLE  : 'Messages',                   // DynamoDB Table
    REDIS_PKEY  : 'CMMS',                       // REDIS PKEY
    ES_INDEX    : 'messages-v1',				// ES Index Name
    ES_TYPE     : 'messages',					// ES Type Name
    ES_FIELDS   : ES_FIELDS,
    NS_NAME     : name,                         // Notify Service Name. (null means no notifications)
    ES_MASTER	: 1,							// ES Master NODE.
    ES_VERSION  : 6,                            // ES Version 6.x.
    CLONEABLE   : true,                         // 복제 가능하며, parent/cloned 필드를 지원함.
    PARENT_IMUT : false,						// parent-id 변경 가능함(2018.03.15)
	XECURE_KEY  : 'lemon',					    // Encryption Key (use '*' prefix at property name: ver 0.3.22)
});    // load core-service with parameters.
if (!$LEM) throw new Error(NS+'$LEM is required!');

환경변수(env)

$scope.env 에는 아래와 같이 backbone 의 엔드포인트 주소가 필요. (자세한 내용은 lemoncloud-backbone-js참고)

  # MySQL backbone api
  MS_ENDPOINT:  'http://localhost:8081/mysql'
  # DynamoDB backbone api
  DS_ENDPOINT:  'http://localhost:8081/dynamo'
  # ElasticSearch backbone api
  ES_ENDPOINT:  'http://localhost:8081/elastic'
  # Redis backbone api
  RS_ENDPOINT:  'http://localhost:8081/redis'
  # SQS backbone api
  SS_ENDPOINT:  'http://localhost:8081/sqs'
  # SNS backbone api
  SN_ENDPOINT:  'http://localhost:8081/sns'
  # Web backbone api
  WS_ENDPOINT:  'http://localhost:8081/web'

VERSION INFO

VersionDescription
1.0.23add agw-proxy as AG. @190509.
1.0.22improve log
1.0.21environ.TS for time-stamp.
1.0.20add $exist for elasticsearch to check existing field
1.0.19add do_queue_protocol in protocol-proxy
1.0.18add highlight $H for elasicsearch
1.0.17add 'qs_parse', 'qs_stringify' in utility
1.0.16cron-proxy support Rules in CloudWatch.
1.0.15reserved search param page/ipp.
1.0.14impromve ES6 index initializer. see do_initialize()
1.0.13support callback(url) as $protocol().do_post_notify_protocol(url, body, callback) vis SNS.
1.0.12bug: _current_time error in records
1.0.11bug: save when 404 NOT FOUND
1.0.10improve validate_properties.
1.0.9ES_TIMESERIES - onRecords, do not update cache if timeseries.
1.0.8ES_TIMESERIES to support Time-Series Data (ex: item-trace)
1.0.6hot-fix of iota.
1.0.5use elasticsearch as 1st cache. see REDIS_PKEY = '#'.
1.0.4optimized 'do_readX' for xecured property.
1.0.3add 'do_post_execute_notify'
1.0.2do_saveES() direct save into ES.
1.0.1updated package dependencies
1.0.0support in-memory cache for node transaction.
0.3.25s3-proxy support tags for S3 Tagging.
0.3.24add s3-proxy as S3. @180913.
0.3.23cognito: do_get_confirm_user(). @180911.
0.3.22support xecured fields see XECURE_KEY. @180801.
0.3.21add 'do_post_execute_protocol'
0.3.20try to parse body for http-proxy.
0.3.19get stringified param and body for protocol-proxy.
0.3.18add protocol-proxy.
0.3.17optimize http-proxy.
0.3.16optimize log msg.
0.3.15add ses-proxy as SE.
0.3.14add sqs stat as $SS.do_statistics().
0.3.13lambda-proxy as 'LS'. set LS_ENDPOINT.
0.3.12optimize 404 error message.
0.3.11allow ipp to be set 0.
0.3.10sns-proxy as 'SN'
0.3.9support ES6 with ES_VERSION = 6.
0.3.8minor fix for log of redis:my_save_node
0.3.7mysql id-generator configuration (see $LEM.do_next_id()).
0.3.6fix ElasticSearch create index error due to 'string'.
0.3.5support as _$.httpProxy(_$, name, uri).
0.3.4fix require error.
0.3.3add httpProxy service. (use _$.createHttpProxy(name, endpoint))
0.3.2cognito service - manager user/group.
0.3.1remove MMS,user,group service. and add cognito service.
0.2.13cognito-proxy as 'CS'
0.2.12try to create node in dynamo if error of "an attribute that does not exist in the item"
0.2.5web-proxy as 'WS'
0.2.4record event handler
0.2.3sqs-proxy as 'SS'
0.2.0support scope during initialize
1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.3.25

7 years ago

0.3.24

7 years ago

0.3.23

7 years ago

0.3.22

7 years ago

0.3.21

7 years ago

0.3.20

7 years ago

0.3.19

7 years ago

0.3.18

7 years ago

0.3.17

7 years ago

0.3.16

7 years ago

0.3.15

7 years ago

0.3.14

7 years ago

0.3.13

7 years ago

0.3.12

7 years ago

0.3.11

7 years ago

0.3.10

7 years ago

0.3.9

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago