UNPKG

1.95 kBJavaScriptView Raw
1/**
2 * @file Defines the ServerlessClientExecutionContext class.
3 *
4 * @author Luke Chavers <luke@c2cschools.com>
5 * @author Kevin Sanders <kevin@c2cschools.com>
6 * @since 5.0.0
7 * @license See LICENSE.md for details about licensing.
8 * @copyright 2017 C2C Schools, LLC
9 */
10
11"use strict";
12
13// Important Note
14// --------------
15// This module only loads a single dependency, directly, which is the
16// parent class for the class defined within. This is intended to force
17// dependency loading through the parent class, by way of the `$dep()`
18// method, in order to centralize dependency definition and loading.
19
20const LambdaInvokeExecutionContext = require(
21 "./LambdaInvokeExecutionContext"
22);
23
24/**
25 * Represents an execution context whereby an endpoint is executed on
26 * AWS Lambda by way of a call through the `node-sls-client` library.
27 *
28 * @memberOf ExecutionContext
29 * @extends ExecutionContext.LambdaInvokeExecutionContext
30 */
31class ServerlessClientExecutionContext extends LambdaInvokeExecutionContext {
32
33 /*
34 _resolveParameters() {
35
36 // todo: finish this...
37 super._resolveParameters();
38
39 }
40
41 _processInitialContextData() {
42
43 // todo: look here
44 // >>>> sessionToken = event._sls.sessionToken; <<<
45
46 //const me = this;
47 //let data = me.initialContextData;
48
49 // todo: finish this...
50 // Call Parent
51 super._processInitialContextData();
52
53 // Append environment variables to
54 // the initialContextData object
55 data.env = process.env;
56
57 // Create the 'contextDataIndex'
58 me._createContextDataIndex( data );
59
60 // Process the context data index
61 // for known patterns.
62 me._resolveContextData();
63
64 // Process for callback
65 if( TIPE( data.callback ) === "function" ){
66 me.setConfigValue( "callback", data.callback );
67 }
68
69 // Process for parameters
70 me._resolveParameters();
71
72 }
73
74 _resolveContextData() {
75
76 // todo: finish this...
77 super._resolveContextData();
78
79 }
80 */
81}
82
83module.exports = ServerlessClientExecutionContext;