cdk-serverless 2.17.2 → 2.19.0
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/README.md +100 -0
- package/docs/constructs/index.html +13 -1
- package/docs/lambda/index.html +13 -1
- package/docs/projen/assets/search.js +1 -1
- package/docs/projen/classes/GraphQlApi.html +4 -3
- package/docs/projen/index.html +13 -1
- package/files/aws.graphql +24 -0
- package/lib/projen/graphql.d.ts +2 -1
- package/lib/projen/graphql.js +14 -3
- package/lib/tests/index.d.ts +1 -0
- package/lib/tests/index.js +2 -1
- package/lib/tests/lambda-test-utils.d.ts +44 -0
- package/lib/tests/lambda-test-utils.js +174 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -72,6 +72,106 @@ const api = new TestApiRestApi(this, 'Api', {
|
|
|
72
72
|
|
|
73
73
|
This will also create Lambda functions for all operations defined in your spec and wire them accordingly.
|
|
74
74
|
|
|
75
|
+
## Testing Utilities
|
|
76
|
+
|
|
77
|
+
CDK Serverless provides two powerful test utilities to help you write comprehensive tests for your serverless applications.
|
|
78
|
+
|
|
79
|
+
### LambdaTestUtil
|
|
80
|
+
|
|
81
|
+
The `LambdaTestUtil` provides classes for testing both REST and GraphQL Lambda functions in isolation. It's perfect for unit testing your Lambda handlers.
|
|
82
|
+
|
|
83
|
+
#### REST API Testing
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { LambdaRestUnitTest } from 'cdk-serverless/tests/lambda-test-utils';
|
|
87
|
+
|
|
88
|
+
const test = new LambdaRestUnitTest(handler, {
|
|
89
|
+
// Optional default headers for all requests
|
|
90
|
+
headers: {
|
|
91
|
+
'Content-Type': 'application/json',
|
|
92
|
+
},
|
|
93
|
+
// Optional default Cognito user for all requests
|
|
94
|
+
cognito: {
|
|
95
|
+
username: 'test-user',
|
|
96
|
+
email: 'test@example.com',
|
|
97
|
+
groups: ['admin'],
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// Test a GET request
|
|
102
|
+
const result = await test.call({
|
|
103
|
+
path: '/items',
|
|
104
|
+
method: 'GET',
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Test a POST request with body
|
|
108
|
+
const result = await test.call({
|
|
109
|
+
path: '/items',
|
|
110
|
+
method: 'POST',
|
|
111
|
+
body: JSON.stringify({ name: 'test' }),
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### GraphQL Testing
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { LambdaGraphQLTest } from 'cdk-serverless/tests/lambda-test-utils';
|
|
119
|
+
|
|
120
|
+
const test = new LambdaGraphQLTest(handler, {
|
|
121
|
+
// Optional default Cognito user for all requests
|
|
122
|
+
cognito: {
|
|
123
|
+
username: 'test-user',
|
|
124
|
+
email: 'test@example.com',
|
|
125
|
+
groups: ['admin'],
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// Test a GraphQL query
|
|
130
|
+
const result = await test.call({
|
|
131
|
+
fieldName: 'getItem',
|
|
132
|
+
arguments: { id: '123' },
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### IntegTestUtil
|
|
137
|
+
|
|
138
|
+
The `IntegTestUtil` provides a comprehensive set of tools for integration testing your deployed serverless applications. It handles authentication, data cleanup, and API testing.
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
import { IntegTestUtil } from 'cdk-serverless/tests/integ-test-util';
|
|
142
|
+
|
|
143
|
+
// Initialize with your stack outputs
|
|
144
|
+
const test = new IntegTestUtil({
|
|
145
|
+
region: 'us-east-1',
|
|
146
|
+
apiOptions: {
|
|
147
|
+
baseURL: 'https://api.example.com',
|
|
148
|
+
},
|
|
149
|
+
authOptions: {
|
|
150
|
+
userPoolId: 'us-east-1_xxxxx',
|
|
151
|
+
userPoolClientId: 'xxxxxxxx',
|
|
152
|
+
identityPoolId: 'us-east-1:xxxxxxxx',
|
|
153
|
+
},
|
|
154
|
+
datastoreOptions: {
|
|
155
|
+
tableName: 'MyTable',
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// Create and authenticate a test user
|
|
160
|
+
await test.createUser('test@example.com', {
|
|
161
|
+
'custom:attribute': 'value',
|
|
162
|
+
}, ['admin']);
|
|
163
|
+
|
|
164
|
+
// Get an authenticated API client
|
|
165
|
+
const client = await test.getAuthenticatedClient('test@example.com');
|
|
166
|
+
|
|
167
|
+
// Make API calls
|
|
168
|
+
const response = await client.get('/items');
|
|
169
|
+
|
|
170
|
+
// Clean up test data
|
|
171
|
+
await test.cleanupItems();
|
|
172
|
+
await test.removeUser('test@example.com');
|
|
173
|
+
```
|
|
174
|
+
|
|
75
175
|
## Contribute
|
|
76
176
|
|
|
77
177
|
### How to contribute to CDK Serverless
|
|
@@ -33,6 +33,18 @@
|
|
|
33
33
|
</code><button type="button">Copy</button></pre>
|
|
34
34
|
|
|
35
35
|
<p>This will also create Lambda functions for all operations defined in your spec and wire them accordingly.</p>
|
|
36
|
+
<a id="testing-utilities" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Testing Utilities<a href="#testing-utilities" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>CDK Serverless provides two powerful test utilities to help you write comprehensive tests for your serverless applications.</p>
|
|
37
|
+
<a id="lambdatestutil" class="tsd-anchor"></a><h3 class="tsd-anchor-link">LambdaTestUtil<a href="#lambdatestutil" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>LambdaTestUtil</code> provides classes for testing both REST and GraphQL Lambda functions in isolation. It's perfect for unit testing your Lambda handlers.</p>
|
|
38
|
+
<a id="rest-api-testing" class="tsd-anchor"></a><h4 class="tsd-anchor-link">REST API Testing<a href="#rest-api-testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">LambdaRestUnitTest</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/lambda-test-utils'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">LambdaRestUnitTest</span><span class="hl-1">(</span><span class="hl-4">handler</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default headers for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">headers:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">'Content-Type'</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-2">'application/json'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default Cognito user for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">cognito:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">username:</span><span class="hl-1"> </span><span class="hl-2">'test-user'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-2">'test@example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">groups:</span><span class="hl-1"> [</span><span class="hl-2">'admin'</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a GET request</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">path:</span><span class="hl-1"> </span><span class="hl-2">'/items'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">method:</span><span class="hl-1"> </span><span class="hl-2">'GET'</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a POST request with body</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">path:</span><span class="hl-1"> </span><span class="hl-2">'/items'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">method:</span><span class="hl-1"> </span><span class="hl-2">'POST'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">body:</span><span class="hl-1"> </span><span class="hl-7">JSON</span><span class="hl-1">.</span><span class="hl-0">stringify</span><span class="hl-1">({ </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">'test'</span><span class="hl-1"> }),</span><br/><span class="hl-1">});</span>
|
|
39
|
+
</code><button type="button">Copy</button></pre>
|
|
40
|
+
|
|
41
|
+
<a id="graphql-testing" class="tsd-anchor"></a><h4 class="tsd-anchor-link">GraphQL Testing<a href="#graphql-testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">LambdaGraphQLTest</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/lambda-test-utils'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">LambdaGraphQLTest</span><span class="hl-1">(</span><span class="hl-4">handler</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default Cognito user for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">cognito:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">username:</span><span class="hl-1"> </span><span class="hl-2">'test-user'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-2">'test@example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">groups:</span><span class="hl-1"> [</span><span class="hl-2">'admin'</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a GraphQL query</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">fieldName:</span><span class="hl-1"> </span><span class="hl-2">'getItem'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">arguments:</span><span class="hl-1"> { </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">'123'</span><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
42
|
+
</code><button type="button">Copy</button></pre>
|
|
43
|
+
|
|
44
|
+
<a id="integtestutil" class="tsd-anchor"></a><h3 class="tsd-anchor-link">IntegTestUtil<a href="#integtestutil" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>IntegTestUtil</code> provides a comprehensive set of tools for integration testing your deployed serverless applications. It handles authentication, data cleanup, and API testing.</p>
|
|
45
|
+
<pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">IntegTestUtil</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/integ-test-util'</span><span class="hl-1">;</span><br/><br/><span class="hl-6">// Initialize with your stack outputs</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">IntegTestUtil</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">region:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">apiOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">baseURL:</span><span class="hl-1"> </span><span class="hl-2">'https://api.example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">authOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">userPoolId:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1_xxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">userPoolClientId:</span><span class="hl-1"> </span><span class="hl-2">'xxxxxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">identityPoolId:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1:xxxxxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">datastoreOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">tableName:</span><span class="hl-1"> </span><span class="hl-2">'MyTable'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Create and authenticate a test user</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">createUser</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-2">'custom:attribute'</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-2">'value'</span><span class="hl-1">,</span><br/><span class="hl-1">}, [</span><span class="hl-2">'admin'</span><span class="hl-1">]);</span><br/><br/><span class="hl-6">// Get an authenticated API client</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">client</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">getAuthenticatedClient</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Make API calls</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">response</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">get</span><span class="hl-1">(</span><span class="hl-2">'/items'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Clean up test data</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">cleanupItems</span><span class="hl-1">();</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">removeUser</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">);</span>
|
|
46
|
+
</code><button type="button">Copy</button></pre>
|
|
47
|
+
|
|
36
48
|
<a id="contribute" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Contribute<a href="#contribute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="how-to-contribute-to-cdk-serverless" class="tsd-anchor"></a><h3 class="tsd-anchor-link">How to contribute to CDK Serverless<a href="#how-to-contribute-to-cdk-serverless" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><a id="did-you-find-a-bug" class="tsd-anchor"></a><h4 class="tsd-anchor-link"><strong>Did you find a bug?</strong><a href="#did-you-find-a-bug" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><ul>
|
|
37
49
|
<li>
|
|
38
50
|
<p><strong>Ensure the bug was not already reported</strong> by searching on GitHub under <a href="https://github.com/taimos/cdk-serverless/issues">Issues</a>.</p>
|
|
@@ -62,4 +74,4 @@
|
|
|
62
74
|
<li>Just file a PR with your recommended changes</li>
|
|
63
75
|
</ul>
|
|
64
76
|
<a id="authors" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Authors<a href="#authors" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Brought to you by <a href="https://taimos.de">Taimos</a></p>
|
|
65
|
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cdk-serverless"><span>CDK <wbr/>Serverless</span></a><ul><li><ul><li><a href="#features"><span>Features</span></a></li></ul></li><li><a href="#quick-start"><span>Quick <wbr/>Start</span></a></li><li><ul><li><a href="#adding-projen-constructs"><span>Adding projen constructs</span></a></li><li><a href="#using-the-cdk-serverless-l3-constructs"><span>Using the CDK serverless <wbr/>L3 constructs</span></a></li></ul></li><li><a href="#contribute"><span>Contribute</span></a></li><li><ul><li><a href="#how-to-contribute-to-cdk-serverless"><span>How to contribute to CDK <wbr/>Serverless</span></a></li><li><ul><li><a href="#did-you-find-a-bug"><span>Did you find a bug?</span></a></li><li><a href="#did-you-write-a-patch-that-fixes-a-bug"><span>Did you write a patch that fixes a bug?</span></a></li><li><a href="#did-you-fix-whitespace-format-code-or-make-a-purely-cosmetic-patch"><span>Did you fix whitespace, format code, or make a purely cosmetic patch?</span></a></li><li><a href="#do-you-intend-to-add-a-new-feature-or-change-an-existing-one"><span>Do you intend to add a new feature or change an existing one?</span></a></li><li><a href="#do-you-want-to-contribute-to-the-cdk-serverless-documentation"><span>Do you want to contribute to the CDK <wbr/>Serverless documentation?</span></a></li></ul></li></ul></li><li><a href="#authors"><span>Authors</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">cdk-serverless</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
77
|
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cdk-serverless"><span>CDK <wbr/>Serverless</span></a><ul><li><ul><li><a href="#features"><span>Features</span></a></li></ul></li><li><a href="#quick-start"><span>Quick <wbr/>Start</span></a></li><li><ul><li><a href="#adding-projen-constructs"><span>Adding projen constructs</span></a></li><li><a href="#using-the-cdk-serverless-l3-constructs"><span>Using the CDK serverless <wbr/>L3 constructs</span></a></li></ul></li><li><a href="#testing-utilities"><span>Testing <wbr/>Utilities</span></a></li><li><ul><li><a href="#lambdatestutil"><span>Lambda<wbr/>Test<wbr/>Util</span></a></li><li><ul><li><a href="#rest-api-testing"><span>REST API <wbr/>Testing</span></a></li><li><a href="#graphql-testing"><span>GraphQL <wbr/>Testing</span></a></li></ul></li><li><a href="#integtestutil"><span>Integ<wbr/>Test<wbr/>Util</span></a></li></ul></li><li><a href="#contribute"><span>Contribute</span></a></li><li><ul><li><a href="#how-to-contribute-to-cdk-serverless"><span>How to contribute to CDK <wbr/>Serverless</span></a></li><li><ul><li><a href="#did-you-find-a-bug"><span>Did you find a bug?</span></a></li><li><a href="#did-you-write-a-patch-that-fixes-a-bug"><span>Did you write a patch that fixes a bug?</span></a></li><li><a href="#did-you-fix-whitespace-format-code-or-make-a-purely-cosmetic-patch"><span>Did you fix whitespace, format code, or make a purely cosmetic patch?</span></a></li><li><a href="#do-you-intend-to-add-a-new-feature-or-change-an-existing-one"><span>Do you intend to add a new feature or change an existing one?</span></a></li><li><a href="#do-you-want-to-contribute-to-the-cdk-serverless-documentation"><span>Do you want to contribute to the CDK <wbr/>Serverless documentation?</span></a></li></ul></li></ul></li><li><a href="#authors"><span>Authors</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">cdk-serverless</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/docs/lambda/index.html
CHANGED
|
@@ -33,6 +33,18 @@
|
|
|
33
33
|
</code><button type="button">Copy</button></pre>
|
|
34
34
|
|
|
35
35
|
<p>This will also create Lambda functions for all operations defined in your spec and wire them accordingly.</p>
|
|
36
|
+
<a id="testing-utilities" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Testing Utilities<a href="#testing-utilities" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>CDK Serverless provides two powerful test utilities to help you write comprehensive tests for your serverless applications.</p>
|
|
37
|
+
<a id="lambdatestutil" class="tsd-anchor"></a><h3 class="tsd-anchor-link">LambdaTestUtil<a href="#lambdatestutil" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>LambdaTestUtil</code> provides classes for testing both REST and GraphQL Lambda functions in isolation. It's perfect for unit testing your Lambda handlers.</p>
|
|
38
|
+
<a id="rest-api-testing" class="tsd-anchor"></a><h4 class="tsd-anchor-link">REST API Testing<a href="#rest-api-testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">LambdaRestUnitTest</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/lambda-test-utils'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">LambdaRestUnitTest</span><span class="hl-1">(</span><span class="hl-4">handler</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default headers for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">headers:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">'Content-Type'</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-2">'application/json'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default Cognito user for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">cognito:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">username:</span><span class="hl-1"> </span><span class="hl-2">'test-user'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-2">'test@example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">groups:</span><span class="hl-1"> [</span><span class="hl-2">'admin'</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a GET request</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">path:</span><span class="hl-1"> </span><span class="hl-2">'/items'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">method:</span><span class="hl-1"> </span><span class="hl-2">'GET'</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a POST request with body</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">path:</span><span class="hl-1"> </span><span class="hl-2">'/items'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">method:</span><span class="hl-1"> </span><span class="hl-2">'POST'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">body:</span><span class="hl-1"> </span><span class="hl-7">JSON</span><span class="hl-1">.</span><span class="hl-0">stringify</span><span class="hl-1">({ </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">'test'</span><span class="hl-1"> }),</span><br/><span class="hl-1">});</span>
|
|
39
|
+
</code><button type="button">Copy</button></pre>
|
|
40
|
+
|
|
41
|
+
<a id="graphql-testing" class="tsd-anchor"></a><h4 class="tsd-anchor-link">GraphQL Testing<a href="#graphql-testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">LambdaGraphQLTest</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/lambda-test-utils'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">LambdaGraphQLTest</span><span class="hl-1">(</span><span class="hl-4">handler</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default Cognito user for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">cognito:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">username:</span><span class="hl-1"> </span><span class="hl-2">'test-user'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-2">'test@example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">groups:</span><span class="hl-1"> [</span><span class="hl-2">'admin'</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a GraphQL query</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">fieldName:</span><span class="hl-1"> </span><span class="hl-2">'getItem'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">arguments:</span><span class="hl-1"> { </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">'123'</span><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
42
|
+
</code><button type="button">Copy</button></pre>
|
|
43
|
+
|
|
44
|
+
<a id="integtestutil" class="tsd-anchor"></a><h3 class="tsd-anchor-link">IntegTestUtil<a href="#integtestutil" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>IntegTestUtil</code> provides a comprehensive set of tools for integration testing your deployed serverless applications. It handles authentication, data cleanup, and API testing.</p>
|
|
45
|
+
<pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">IntegTestUtil</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/integ-test-util'</span><span class="hl-1">;</span><br/><br/><span class="hl-6">// Initialize with your stack outputs</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">IntegTestUtil</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">region:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">apiOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">baseURL:</span><span class="hl-1"> </span><span class="hl-2">'https://api.example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">authOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">userPoolId:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1_xxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">userPoolClientId:</span><span class="hl-1"> </span><span class="hl-2">'xxxxxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">identityPoolId:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1:xxxxxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">datastoreOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">tableName:</span><span class="hl-1"> </span><span class="hl-2">'MyTable'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Create and authenticate a test user</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">createUser</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-2">'custom:attribute'</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-2">'value'</span><span class="hl-1">,</span><br/><span class="hl-1">}, [</span><span class="hl-2">'admin'</span><span class="hl-1">]);</span><br/><br/><span class="hl-6">// Get an authenticated API client</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">client</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">getAuthenticatedClient</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Make API calls</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">response</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">get</span><span class="hl-1">(</span><span class="hl-2">'/items'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Clean up test data</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">cleanupItems</span><span class="hl-1">();</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">removeUser</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">);</span>
|
|
46
|
+
</code><button type="button">Copy</button></pre>
|
|
47
|
+
|
|
36
48
|
<a id="contribute" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Contribute<a href="#contribute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="how-to-contribute-to-cdk-serverless" class="tsd-anchor"></a><h3 class="tsd-anchor-link">How to contribute to CDK Serverless<a href="#how-to-contribute-to-cdk-serverless" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><a id="did-you-find-a-bug" class="tsd-anchor"></a><h4 class="tsd-anchor-link"><strong>Did you find a bug?</strong><a href="#did-you-find-a-bug" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><ul>
|
|
37
49
|
<li>
|
|
38
50
|
<p><strong>Ensure the bug was not already reported</strong> by searching on GitHub under <a href="https://github.com/taimos/cdk-serverless/issues">Issues</a>.</p>
|
|
@@ -62,4 +74,4 @@
|
|
|
62
74
|
<li>Just file a PR with your recommended changes</li>
|
|
63
75
|
</ul>
|
|
64
76
|
<a id="authors" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Authors<a href="#authors" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Brought to you by <a href="https://taimos.de">Taimos</a></p>
|
|
65
|
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cdk-serverless"><span>CDK <wbr/>Serverless</span></a><ul><li><ul><li><a href="#features"><span>Features</span></a></li></ul></li><li><a href="#quick-start"><span>Quick <wbr/>Start</span></a></li><li><ul><li><a href="#adding-projen-constructs"><span>Adding projen constructs</span></a></li><li><a href="#using-the-cdk-serverless-l3-constructs"><span>Using the CDK serverless <wbr/>L3 constructs</span></a></li></ul></li><li><a href="#contribute"><span>Contribute</span></a></li><li><ul><li><a href="#how-to-contribute-to-cdk-serverless"><span>How to contribute to CDK <wbr/>Serverless</span></a></li><li><ul><li><a href="#did-you-find-a-bug"><span>Did you find a bug?</span></a></li><li><a href="#did-you-write-a-patch-that-fixes-a-bug"><span>Did you write a patch that fixes a bug?</span></a></li><li><a href="#did-you-fix-whitespace-format-code-or-make-a-purely-cosmetic-patch"><span>Did you fix whitespace, format code, or make a purely cosmetic patch?</span></a></li><li><a href="#do-you-intend-to-add-a-new-feature-or-change-an-existing-one"><span>Do you intend to add a new feature or change an existing one?</span></a></li><li><a href="#do-you-want-to-contribute-to-the-cdk-serverless-documentation"><span>Do you want to contribute to the CDK <wbr/>Serverless documentation?</span></a></li></ul></li></ul></li><li><a href="#authors"><span>Authors</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">cdk-serverless</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
77
|
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cdk-serverless"><span>CDK <wbr/>Serverless</span></a><ul><li><ul><li><a href="#features"><span>Features</span></a></li></ul></li><li><a href="#quick-start"><span>Quick <wbr/>Start</span></a></li><li><ul><li><a href="#adding-projen-constructs"><span>Adding projen constructs</span></a></li><li><a href="#using-the-cdk-serverless-l3-constructs"><span>Using the CDK serverless <wbr/>L3 constructs</span></a></li></ul></li><li><a href="#testing-utilities"><span>Testing <wbr/>Utilities</span></a></li><li><ul><li><a href="#lambdatestutil"><span>Lambda<wbr/>Test<wbr/>Util</span></a></li><li><ul><li><a href="#rest-api-testing"><span>REST API <wbr/>Testing</span></a></li><li><a href="#graphql-testing"><span>GraphQL <wbr/>Testing</span></a></li></ul></li><li><a href="#integtestutil"><span>Integ<wbr/>Test<wbr/>Util</span></a></li></ul></li><li><a href="#contribute"><span>Contribute</span></a></li><li><ul><li><a href="#how-to-contribute-to-cdk-serverless"><span>How to contribute to CDK <wbr/>Serverless</span></a></li><li><ul><li><a href="#did-you-find-a-bug"><span>Did you find a bug?</span></a></li><li><a href="#did-you-write-a-patch-that-fixes-a-bug"><span>Did you write a patch that fixes a bug?</span></a></li><li><a href="#did-you-fix-whitespace-format-code-or-make-a-purely-cosmetic-patch"><span>Did you fix whitespace, format code, or make a purely cosmetic patch?</span></a></li><li><a href="#do-you-intend-to-add-a-new-feature-or-change-an-existing-one"><span>Do you intend to add a new feature or change an existing one?</span></a></li><li><a href="#do-you-want-to-contribute-to-the-cdk-serverless-documentation"><span>Do you want to contribute to the CDK <wbr/>Serverless documentation?</span></a></li></ul></li></ul></li><li><a href="#authors"><span>Authors</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">cdk-serverless</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.searchData = "
|
|
1
|
+
window.searchData = "eJytmm9vozgQxr+L+5ZNM2OSkLyrdnt7p9Pu9Vrp7gWqKjY4LVcKHLjtnaJ+95X5Zxsb6qR5RRX8PDN4fjMB0j0p89eKbMI9eUyymGwoeiSLnhjZkKuLz79ffL28+37x7ZJ45LlMyYa8RGUS/UhZda6enj3wp5R4ZJtGVcUqsiHkzesscbHsPW9Y+cLKlFXVVZn/w7b8j4IneVb1/knGWbmLtqw6H1s7GQwwGA/WR2mlZohJ7wXIzdnmWcXL5y3PS0fXM12iRPBIEZUs49aU7ft4zSp+USQTu6evmN6zOfq9c1Qk38VfbpZnUZFkzXL7BQ0SHQkas12SJWLJL0nqHFuqdo3q0BQUVtpFRi3bz0/CherlREOX1Miu5YPqW+PIRTIGr+JPSfWpKHPOtpzF0zFx7st92pYs4uxzl7xWLvt11oL+ao1KfSCXlyhN4oizq4g/XLPddB7d4iLiD2W9+CQ5RHEsVlyzKn8ut+zXKItTVt5ET8V7GxPFcckqXrbKh0ZZdcoTVusy4+X/rpViYvFHq6RMqi8Rjyqel2xiVg3XuE+rpzxm6di8stqe1ZLJmWWkfPTUsmfgOLem0lAmV7/MqG5/5iTTS3dzml8ytQMn2CDWoTPMFtfSF98ECda+GF5rvbwG56DOcMxjeppaczlunlrzUXr177x83KX560SrDpa4d+prKxxrVpvxWSeabNdh1kd3qzUFx2adSELp1W6VUeTuxEk6VTNzatQ+rwP7VI90aJtaoh7cHYNr/UBzvJdNybKYlTe8SWmX3H/pyXgnq0ZZ8Sa1XXIfq8pTZidTunn+UfGEPzunJ3OqdOnx+SmT5WsZFQ9/ptOPLMaikzy12F3ffXAxMz56roxk4DhZJhNRZotcZ9RbnjrJf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WoHRydT4cVbxUvYf3Nxe+7fsio0yp9GtQfQfHxQrpU3QbZh0Vra9UtBAhxLceqRICpYmGSOb8Pbt7Se2MsS1";
|
|
@@ -5,7 +5,8 @@ and provides methods to generate TypeScript types and resolvers from a GraphQL s
|
|
|
5
5
|
</code><button type="button">Copy</button></pre>
|
|
6
6
|
|
|
7
7
|
</div></div></section><section class="tsd-panel tsd-hierarchy" data-refl="512"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">Component</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">GraphQlApi</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="GraphQlApi.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
8
|
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="GraphQlApi.html#
|
|
8
|
+
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="GraphQlApi.html#codegenconfigfile" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>codegen<wbr/>Config<wbr/>File</span></a>
|
|
9
|
+
<a href="GraphQlApi.html#codegenconfigfilename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>codegen<wbr/>Config<wbr/>File<wbr/>Name</span></a>
|
|
9
10
|
<a href="GraphQlApi.html#node" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>node</span></a>
|
|
10
11
|
<a href="GraphQlApi.html#options" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>options</span></a>
|
|
11
12
|
<a href="GraphQlApi.html#project" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>project</span></a>
|
|
@@ -15,7 +16,7 @@ and provides methods to generate TypeScript types and resolvers from a GraphQL s
|
|
|
15
16
|
<a href="GraphQlApi.html#tostring" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>String</span></a>
|
|
16
17
|
<a href="GraphQlApi.html#iscomponent" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Component</span></a>
|
|
17
18
|
<a href="GraphQlApi.html#isconstruct" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Construct</span></a>
|
|
18
|
-
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructorgraphqlapi" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">GraphQlApi</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">app</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AwsCdkTypeScriptApp</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/GraphQlApiOptions.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="GraphQlApi.html" class="tsd-signature-type tsd-kind-class">GraphQlApi</a><a href="#constructorgraphqlapi" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">app</span>: <span class="tsd-signature-type">AwsCdkTypeScriptApp</span></span></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/GraphQlApiOptions.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiOptions</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="GraphQlApi.html" class="tsd-signature-type tsd-kind-class">GraphQlApi</a></h4><aside class="tsd-sources"><p>Overrides pj.Component.constructor</p></aside></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member
|
|
19
|
+
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructorgraphqlapi" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">GraphQlApi</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">app</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AwsCdkTypeScriptApp</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/GraphQlApiOptions.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="GraphQlApi.html" class="tsd-signature-type tsd-kind-class">GraphQlApi</a><a href="#constructorgraphqlapi" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">app</span>: <span class="tsd-signature-type">AwsCdkTypeScriptApp</span></span></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/GraphQlApiOptions.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiOptions</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="GraphQlApi.html" class="tsd-signature-type tsd-kind-class">GraphQlApi</a></h4><aside class="tsd-sources"><p>Overrides pj.Component.constructor</p></aside></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="codegenconfigfile" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>codegen<wbr/>Config<wbr/>File</span><a href="#codegenconfigfile" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">codegenConfigFile</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">YamlFile</span></div></section><section class="tsd-panel tsd-member"><a id="codegenconfigfilename" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>codegen<wbr/>Config<wbr/>File<wbr/>Name</span><a href="#codegenconfigfilename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">codegenConfigFileName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="node" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>node</span><a href="#node" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">node</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Node</span></div><div class="tsd-comment tsd-typography"><p>The tree node.</p>
|
|
19
20
|
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from pj.Component.node</p></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="options" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Protected</code><span>options</span><a href="#options" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/GraphQlApiOptions.html" class="tsd-signature-type tsd-kind-interface">GraphQlApiOptions</a></div></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="project" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>project</span><a href="#project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">project</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Project</span></div><aside class="tsd-sources"><p>Inherited from pj.Component.project</p></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="postsynthesize" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>post<wbr/>Synthesize</span><a href="#postsynthesize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="postsynthesize-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">postSynthesize</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#postsynthesize-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called after synthesis. Order is <em>not</em> guaranteed.</p>
|
|
20
21
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from pj.Component.postSynthesize</p></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="presynthesize" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>pre<wbr/>Synthesize</span><a href="#presynthesize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="presynthesize-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">preSynthesize</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#presynthesize-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Called before synthesis.</p>
|
|
21
22
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from pj.Component.preSynthesize</p></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="synthesize" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>synthesize</span><a href="#synthesize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="synthesize-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">synthesize</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#synthesize-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Synthesizes files to the project output directory.</p>
|
|
@@ -36,4 +37,4 @@ unpredictably. It is safest to avoid using <code>instanceof</code>, and using
|
|
|
36
37
|
this type-testing method instead.</p>
|
|
37
38
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">x</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>Any object</p>
|
|
38
39
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-kind-parameter">x</span> <span class="tsd-signature-keyword">is</span> <span class="tsd-signature-type">Construct</span></h4><p>true if <code>x</code> is an object created from a class which extends <code>Construct</code>.</p>
|
|
39
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from pj.Component.isConstruct</p></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#
|
|
40
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from pj.Component.isConstruct</p></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#codegenconfigfile" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>codegen<wbr/>Config<wbr/>File</span></a><a href="#codegenconfigfilename" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>codegen<wbr/>Config<wbr/>File<wbr/>Name</span></a><a href="#node" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>node</span></a><a href="#options" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>options</span></a><a href="#project" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>project</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#postsynthesize" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>post<wbr/>Synthesize</span></a><a href="#presynthesize" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pre<wbr/>Synthesize</span></a><a href="#synthesize" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>synthesize</span></a><a href="#tostring" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>String</span></a><a href="#iscomponent" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Component</span></a><a href="#isconstruct" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Construct</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">cdk-serverless</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/docs/projen/index.html
CHANGED
|
@@ -33,6 +33,18 @@
|
|
|
33
33
|
</code><button type="button">Copy</button></pre>
|
|
34
34
|
|
|
35
35
|
<p>This will also create Lambda functions for all operations defined in your spec and wire them accordingly.</p>
|
|
36
|
+
<a id="testing-utilities" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Testing Utilities<a href="#testing-utilities" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>CDK Serverless provides two powerful test utilities to help you write comprehensive tests for your serverless applications.</p>
|
|
37
|
+
<a id="lambdatestutil" class="tsd-anchor"></a><h3 class="tsd-anchor-link">LambdaTestUtil<a href="#lambdatestutil" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>LambdaTestUtil</code> provides classes for testing both REST and GraphQL Lambda functions in isolation. It's perfect for unit testing your Lambda handlers.</p>
|
|
38
|
+
<a id="rest-api-testing" class="tsd-anchor"></a><h4 class="tsd-anchor-link">REST API Testing<a href="#rest-api-testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">LambdaRestUnitTest</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/lambda-test-utils'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">LambdaRestUnitTest</span><span class="hl-1">(</span><span class="hl-4">handler</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default headers for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">headers:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">'Content-Type'</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-2">'application/json'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default Cognito user for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">cognito:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">username:</span><span class="hl-1"> </span><span class="hl-2">'test-user'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-2">'test@example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">groups:</span><span class="hl-1"> [</span><span class="hl-2">'admin'</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a GET request</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">path:</span><span class="hl-1"> </span><span class="hl-2">'/items'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">method:</span><span class="hl-1"> </span><span class="hl-2">'GET'</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a POST request with body</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">path:</span><span class="hl-1"> </span><span class="hl-2">'/items'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">method:</span><span class="hl-1"> </span><span class="hl-2">'POST'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">body:</span><span class="hl-1"> </span><span class="hl-7">JSON</span><span class="hl-1">.</span><span class="hl-0">stringify</span><span class="hl-1">({ </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">'test'</span><span class="hl-1"> }),</span><br/><span class="hl-1">});</span>
|
|
39
|
+
</code><button type="button">Copy</button></pre>
|
|
40
|
+
|
|
41
|
+
<a id="graphql-testing" class="tsd-anchor"></a><h4 class="tsd-anchor-link">GraphQL Testing<a href="#graphql-testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">LambdaGraphQLTest</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/lambda-test-utils'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">LambdaGraphQLTest</span><span class="hl-1">(</span><span class="hl-4">handler</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-6">// Optional default Cognito user for all requests</span><br/><span class="hl-1"> </span><span class="hl-4">cognito:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">username:</span><span class="hl-1"> </span><span class="hl-2">'test-user'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-2">'test@example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">groups:</span><span class="hl-1"> [</span><span class="hl-2">'admin'</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Test a GraphQL query</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">call</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">fieldName:</span><span class="hl-1"> </span><span class="hl-2">'getItem'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">arguments:</span><span class="hl-1"> { </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-2">'123'</span><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
42
|
+
</code><button type="button">Copy</button></pre>
|
|
43
|
+
|
|
44
|
+
<a id="integtestutil" class="tsd-anchor"></a><h3 class="tsd-anchor-link">IntegTestUtil<a href="#integtestutil" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>IntegTestUtil</code> provides a comprehensive set of tools for integration testing your deployed serverless applications. It handles authentication, data cleanup, and API testing.</p>
|
|
45
|
+
<pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">IntegTestUtil</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'cdk-serverless/tests/integ-test-util'</span><span class="hl-1">;</span><br/><br/><span class="hl-6">// Initialize with your stack outputs</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">test</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">IntegTestUtil</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">region:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">apiOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">baseURL:</span><span class="hl-1"> </span><span class="hl-2">'https://api.example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">authOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">userPoolId:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1_xxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">userPoolClientId:</span><span class="hl-1"> </span><span class="hl-2">'xxxxxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">identityPoolId:</span><span class="hl-1"> </span><span class="hl-2">'us-east-1:xxxxxxxx'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">datastoreOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">tableName:</span><span class="hl-1"> </span><span class="hl-2">'MyTable'</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">// Create and authenticate a test user</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">createUser</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-2">'custom:attribute'</span><span class="hl-4">:</span><span class="hl-1"> </span><span class="hl-2">'value'</span><span class="hl-1">,</span><br/><span class="hl-1">}, [</span><span class="hl-2">'admin'</span><span class="hl-1">]);</span><br/><br/><span class="hl-6">// Get an authenticated API client</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">client</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">getAuthenticatedClient</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Make API calls</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-7">response</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-0">get</span><span class="hl-1">(</span><span class="hl-2">'/items'</span><span class="hl-1">);</span><br/><br/><span class="hl-6">// Clean up test data</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">cleanupItems</span><span class="hl-1">();</span><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">test</span><span class="hl-1">.</span><span class="hl-0">removeUser</span><span class="hl-1">(</span><span class="hl-2">'test@example.com'</span><span class="hl-1">);</span>
|
|
46
|
+
</code><button type="button">Copy</button></pre>
|
|
47
|
+
|
|
36
48
|
<a id="contribute" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Contribute<a href="#contribute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="how-to-contribute-to-cdk-serverless" class="tsd-anchor"></a><h3 class="tsd-anchor-link">How to contribute to CDK Serverless<a href="#how-to-contribute-to-cdk-serverless" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><a id="did-you-find-a-bug" class="tsd-anchor"></a><h4 class="tsd-anchor-link"><strong>Did you find a bug?</strong><a href="#did-you-find-a-bug" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><ul>
|
|
37
49
|
<li>
|
|
38
50
|
<p><strong>Ensure the bug was not already reported</strong> by searching on GitHub under <a href="https://github.com/taimos/cdk-serverless/issues">Issues</a>.</p>
|
|
@@ -62,4 +74,4 @@
|
|
|
62
74
|
<li>Just file a PR with your recommended changes</li>
|
|
63
75
|
</ul>
|
|
64
76
|
<a id="authors" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Authors<a href="#authors" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Brought to you by <a href="https://taimos.de">Taimos</a></p>
|
|
65
|
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cdk-serverless"><span>CDK <wbr/>Serverless</span></a><ul><li><ul><li><a href="#features"><span>Features</span></a></li></ul></li><li><a href="#quick-start"><span>Quick <wbr/>Start</span></a></li><li><ul><li><a href="#adding-projen-constructs"><span>Adding projen constructs</span></a></li><li><a href="#using-the-cdk-serverless-l3-constructs"><span>Using the CDK serverless <wbr/>L3 constructs</span></a></li></ul></li><li><a href="#contribute"><span>Contribute</span></a></li><li><ul><li><a href="#how-to-contribute-to-cdk-serverless"><span>How to contribute to CDK <wbr/>Serverless</span></a></li><li><ul><li><a href="#did-you-find-a-bug"><span>Did you find a bug?</span></a></li><li><a href="#did-you-write-a-patch-that-fixes-a-bug"><span>Did you write a patch that fixes a bug?</span></a></li><li><a href="#did-you-fix-whitespace-format-code-or-make-a-purely-cosmetic-patch"><span>Did you fix whitespace, format code, or make a purely cosmetic patch?</span></a></li><li><a href="#do-you-intend-to-add-a-new-feature-or-change-an-existing-one"><span>Do you intend to add a new feature or change an existing one?</span></a></li><li><a href="#do-you-want-to-contribute-to-the-cdk-serverless-documentation"><span>Do you want to contribute to the CDK <wbr/>Serverless documentation?</span></a></li></ul></li></ul></li><li><a href="#authors"><span>Authors</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">cdk-serverless</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
77
|
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#cdk-serverless"><span>CDK <wbr/>Serverless</span></a><ul><li><ul><li><a href="#features"><span>Features</span></a></li></ul></li><li><a href="#quick-start"><span>Quick <wbr/>Start</span></a></li><li><ul><li><a href="#adding-projen-constructs"><span>Adding projen constructs</span></a></li><li><a href="#using-the-cdk-serverless-l3-constructs"><span>Using the CDK serverless <wbr/>L3 constructs</span></a></li></ul></li><li><a href="#testing-utilities"><span>Testing <wbr/>Utilities</span></a></li><li><ul><li><a href="#lambdatestutil"><span>Lambda<wbr/>Test<wbr/>Util</span></a></li><li><ul><li><a href="#rest-api-testing"><span>REST API <wbr/>Testing</span></a></li><li><a href="#graphql-testing"><span>GraphQL <wbr/>Testing</span></a></li></ul></li><li><a href="#integtestutil"><span>Integ<wbr/>Test<wbr/>Util</span></a></li></ul></li><li><a href="#contribute"><span>Contribute</span></a></li><li><ul><li><a href="#how-to-contribute-to-cdk-serverless"><span>How to contribute to CDK <wbr/>Serverless</span></a></li><li><ul><li><a href="#did-you-find-a-bug"><span>Did you find a bug?</span></a></li><li><a href="#did-you-write-a-patch-that-fixes-a-bug"><span>Did you write a patch that fixes a bug?</span></a></li><li><a href="#did-you-fix-whitespace-format-code-or-make-a-purely-cosmetic-patch"><span>Did you fix whitespace, format code, or make a purely cosmetic patch?</span></a></li><li><a href="#do-you-intend-to-add-a-new-feature-or-change-an-existing-one"><span>Do you intend to add a new feature or change an existing one?</span></a></li><li><a href="#do-you-want-to-contribute-to-the-cdk-serverless-documentation"><span>Do you want to contribute to the CDK <wbr/>Serverless documentation?</span></a></li></ul></li></ul></li><li><a href="#authors"><span>Authors</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">cdk-serverless</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
scalar AWSTime
|
|
2
|
+
scalar AWSDate
|
|
3
|
+
scalar AWSDateTime
|
|
4
|
+
scalar AWSTimestamp
|
|
5
|
+
scalar AWSEmail
|
|
6
|
+
scalar AWSJSON
|
|
7
|
+
scalar AWSURL
|
|
8
|
+
scalar AWSPhone
|
|
9
|
+
scalar AWSIPAddress
|
|
10
|
+
scalar BigInt
|
|
11
|
+
scalar Double
|
|
12
|
+
|
|
13
|
+
directive @aws_subscribe(mutations: [String!]!) on FIELD_DEFINITION
|
|
14
|
+
|
|
15
|
+
# Allows transformer libraries to deprecate directive arguments.
|
|
16
|
+
directive @deprecated(reason: String!) on INPUT_FIELD_DEFINITION | ENUM
|
|
17
|
+
|
|
18
|
+
directive @aws_auth(cognito_groups: [String!]!) on FIELD_DEFINITION
|
|
19
|
+
directive @aws_api_key on FIELD_DEFINITION | OBJECT
|
|
20
|
+
directive @aws_iam on FIELD_DEFINITION | OBJECT
|
|
21
|
+
directive @aws_oidc on FIELD_DEFINITION | OBJECT
|
|
22
|
+
directive @aws_cognito_user_pools(
|
|
23
|
+
cognito_groups: [String!]
|
|
24
|
+
) on FIELD_DEFINITION | OBJECT
|
package/lib/projen/graphql.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface GraphQlApiOptions {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class GraphQlApi extends pj.Component {
|
|
18
18
|
protected options: GraphQlApiOptions;
|
|
19
|
-
|
|
19
|
+
readonly codegenConfigFileName: string;
|
|
20
|
+
readonly codegenConfigFile: pj.YamlFile;
|
|
20
21
|
constructor(app: pj.awscdk.AwsCdkTypeScriptApp, options: GraphQlApiOptions);
|
|
21
22
|
}
|
package/lib/projen/graphql.js
CHANGED
|
@@ -60,12 +60,23 @@ class GraphQlApi extends pj.Component {
|
|
|
60
60
|
});
|
|
61
61
|
app.preCompileTask.prependSpawn(generateTask);
|
|
62
62
|
const codegenConfig = {
|
|
63
|
-
schema:
|
|
63
|
+
schema: [
|
|
64
|
+
this.options.definitionFile,
|
|
65
|
+
'node_modules/cdk-serverless/files/aws.graphql',
|
|
66
|
+
],
|
|
64
67
|
config: {
|
|
65
68
|
scalars: {
|
|
66
69
|
AWSDate: 'string',
|
|
67
70
|
AWSURL: 'string',
|
|
71
|
+
AWSEmail: 'string',
|
|
72
|
+
AWSTime: 'string',
|
|
73
|
+
AWSDateTime: 'string',
|
|
74
|
+
AWSTimestamp: 'string',
|
|
75
|
+
AWSPhone: 'string',
|
|
76
|
+
AWSIPAddress: 'string',
|
|
77
|
+
AWSJSON: 'string',
|
|
68
78
|
},
|
|
79
|
+
maybeValue: 'T | undefined',
|
|
69
80
|
},
|
|
70
81
|
generates: {
|
|
71
82
|
[`./src/generated/graphql.${this.options.apiName.toLowerCase()}-model.generated.ts`]: {
|
|
@@ -73,7 +84,7 @@ class GraphQlApi extends pj.Component {
|
|
|
73
84
|
},
|
|
74
85
|
},
|
|
75
86
|
};
|
|
76
|
-
new pj.YamlFile(this.project, this.codegenConfigFileName, {
|
|
87
|
+
this.codegenConfigFile = new pj.YamlFile(this.project, this.codegenConfigFileName, {
|
|
77
88
|
obj: codegenConfig,
|
|
78
89
|
});
|
|
79
90
|
const constructFile = new pj.TextFile(this.project, `src/generated/graphql.${this.options.apiName.toLowerCase()}-api.generated.ts`);
|
|
@@ -111,4 +122,4 @@ type User {
|
|
|
111
122
|
}
|
|
112
123
|
}
|
|
113
124
|
exports.GraphQlApi = GraphQlApi;
|
|
114
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
125
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JhcGhxbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcm9qZW4vZ3JhcGhxbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBNkI7QUFDN0IsaUNBQXNDO0FBT3RDOzs7Ozs7Ozs7O0dBVUc7QUFDSCxNQUFhLFVBQVcsU0FBUSxFQUFFLENBQUMsU0FBUztJQUsxQyxZQUFZLEdBQWtDLEVBQVksT0FBMEI7UUFDbEYsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBRDZDLFlBQU8sR0FBUCxPQUFPLENBQW1CO1FBR2xGLEdBQUcsQ0FBQyxVQUFVLENBQ1osc0JBQXNCLEVBQ3RCLDZCQUE2QixFQUM3Qix1Q0FBdUMsRUFDdkMsbUJBQW1CLEVBQ25CLG1CQUFtQixDQUNwQixDQUFDO1FBQ0YsR0FBRyxDQUFDLE9BQU8sQ0FDVCxTQUFTLEVBQ1Qsb0JBQW9CLEVBQ3BCLFNBQVMsQ0FDVixDQUFDO1FBRUYsSUFBS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GlOYW1lfScsXG4gICAgICBkZWZpbml0aW9uRmlsZU5hbWU6ICcke3RoaXMub3B0aW9ucy5kZWZpbml0aW9uRmlsZX0nLFxuICAgIH0pO1xuICB9XG5cbn1gKTtcblxuICAgIG5ldyBwai5TYW1wbGVGaWxlKHRoaXMucHJvamVjdCwgdGhpcy5vcHRpb25zLmRlZmluaXRpb25GaWxlLCB7XG4gICAgICBjb250ZW50czogYHR5cGUgUXVlcnkge1xuICB1c2VyczogW1VzZXJdXG59XG5cbnR5cGUgVXNlciB7XG4gIGlkOiBJRCFcbiAgbmFtZTogU3RyaW5nXG59YCxcbiAgICB9KTtcbiAgfVxuXG59XG4iXX0=
|
package/lib/tests/index.d.ts
CHANGED
package/lib/tests/index.js
CHANGED
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./integ-test-util"), exports);
|
|
18
|
-
|
|
18
|
+
__exportStar(require("./lambda-test-utils"), exports);
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGVzdHMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLG9EQUFrQztBQUNsQyxzREFBb0MiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2ludGVnLXRlc3QtdXRpbCc7XG5leHBvcnQgKiBmcm9tICcuL2xhbWJkYS10ZXN0LXV0aWxzJzsiXX0=
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { APIGatewayProxyEventMultiValueQueryStringParameters, APIGatewayProxyEventPathParameters, APIGatewayProxyResult, Context } from 'aws-lambda';
|
|
2
|
+
import { APIGatewayv1Handler } from '../lambda/handler';
|
|
3
|
+
export interface CognitoUser {
|
|
4
|
+
email: string;
|
|
5
|
+
username: string;
|
|
6
|
+
groups: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface LambdaRestTestOptionsBase {
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
cognito?: CognitoUser;
|
|
11
|
+
}
|
|
12
|
+
export interface LambdaRestTestOptions extends LambdaRestTestOptionsBase {
|
|
13
|
+
path?: string;
|
|
14
|
+
method?: string;
|
|
15
|
+
body?: string;
|
|
16
|
+
pathParameters?: APIGatewayProxyEventPathParameters;
|
|
17
|
+
queryStringParameters?: APIGatewayProxyEventMultiValueQueryStringParameters;
|
|
18
|
+
}
|
|
19
|
+
export declare function createContext(): Context;
|
|
20
|
+
export declare class LambdaRestUnitTest {
|
|
21
|
+
private handler;
|
|
22
|
+
private defaults?;
|
|
23
|
+
constructor(handler: APIGatewayv1Handler, defaults?: LambdaRestTestOptionsBase | undefined);
|
|
24
|
+
private createRestEvent;
|
|
25
|
+
call(options?: LambdaRestTestOptions): Promise<APIGatewayProxyResult>;
|
|
26
|
+
}
|
|
27
|
+
export interface LambdaGraphQLTestOptionsBase {
|
|
28
|
+
cognito?: CognitoUser;
|
|
29
|
+
stash?: Record<string, any>;
|
|
30
|
+
}
|
|
31
|
+
export interface LambdaGraphQLTestOptions extends LambdaGraphQLTestOptionsBase {
|
|
32
|
+
fieldName?: string;
|
|
33
|
+
arguments?: Record<string, any>;
|
|
34
|
+
source?: any;
|
|
35
|
+
parentTypeName?: string;
|
|
36
|
+
prevResult?: Record<string, any>;
|
|
37
|
+
}
|
|
38
|
+
export declare class LambdaGraphQLTest {
|
|
39
|
+
private handler;
|
|
40
|
+
private defaults?;
|
|
41
|
+
constructor(handler: AWSLambda.AppSyncResolverHandler<any, any>, defaults?: LambdaGraphQLTestOptionsBase | undefined);
|
|
42
|
+
private createGraphQLEvent;
|
|
43
|
+
call(options: LambdaGraphQLTestOptions): Promise<any>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LambdaGraphQLTest = exports.LambdaRestUnitTest = void 0;
|
|
4
|
+
exports.createContext = createContext;
|
|
5
|
+
function createContext() {
|
|
6
|
+
return {
|
|
7
|
+
callbackWaitsForEmptyEventLoop: false,
|
|
8
|
+
functionName: 'test',
|
|
9
|
+
functionVersion: '1',
|
|
10
|
+
invokedFunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:test',
|
|
11
|
+
memoryLimitInMB: '1024',
|
|
12
|
+
awsRequestId: 'requestId',
|
|
13
|
+
logGroupName: 'logGroupName',
|
|
14
|
+
logStreamName: 'logStreamName',
|
|
15
|
+
getRemainingTimeInMillis: () => 1000,
|
|
16
|
+
done: jest.fn(),
|
|
17
|
+
fail: jest.fn(),
|
|
18
|
+
succeed: jest.fn(),
|
|
19
|
+
identity: undefined,
|
|
20
|
+
clientContext: undefined,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
class LambdaRestUnitTest {
|
|
24
|
+
constructor(handler, defaults) {
|
|
25
|
+
this.handler = handler;
|
|
26
|
+
this.defaults = defaults;
|
|
27
|
+
}
|
|
28
|
+
createRestEvent(options = {}) {
|
|
29
|
+
var _a, _b, _c, _d;
|
|
30
|
+
const { path = '/', method = 'GET', body = '', } = options;
|
|
31
|
+
const headers = {
|
|
32
|
+
...(_a = this.defaults) === null || _a === void 0 ? void 0 : _a.headers,
|
|
33
|
+
...options.headers,
|
|
34
|
+
};
|
|
35
|
+
const cognitoClaims = {
|
|
36
|
+
username: 'DummyUser',
|
|
37
|
+
email: 'dummy@example.com',
|
|
38
|
+
groups: [],
|
|
39
|
+
...(_b = this.defaults) === null || _b === void 0 ? void 0 : _b.cognito,
|
|
40
|
+
...options.cognito,
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
body,
|
|
44
|
+
headers,
|
|
45
|
+
multiValueHeaders: Object.fromEntries(Object.entries(headers).map(([key, value]) => [key, value ? [value] : []])),
|
|
46
|
+
httpMethod: method,
|
|
47
|
+
isBase64Encoded: false,
|
|
48
|
+
path,
|
|
49
|
+
pathParameters: (_c = options.pathParameters) !== null && _c !== void 0 ? _c : null,
|
|
50
|
+
queryStringParameters: options.queryStringParameters ? Object.fromEntries(Object.entries(options.queryStringParameters).map(([key, value]) => [key, value === null || value === void 0 ? void 0 : value.join(',')])) : null,
|
|
51
|
+
multiValueQueryStringParameters: (_d = options.queryStringParameters) !== null && _d !== void 0 ? _d : null,
|
|
52
|
+
stageVariables: null,
|
|
53
|
+
requestContext: {
|
|
54
|
+
accountId: '123456789012',
|
|
55
|
+
apiId: 'appId',
|
|
56
|
+
authorizer: {
|
|
57
|
+
claims: {
|
|
58
|
+
'sub': cognitoClaims.username,
|
|
59
|
+
'cognito:username': cognitoClaims.username,
|
|
60
|
+
'cognito:groups': (cognitoClaims.groups),
|
|
61
|
+
'email': cognitoClaims.email,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
protocol: 'HTTP/1.1',
|
|
65
|
+
httpMethod: method,
|
|
66
|
+
identity: {
|
|
67
|
+
accessKey: null,
|
|
68
|
+
accountId: '123456789012',
|
|
69
|
+
apiKey: null,
|
|
70
|
+
apiKeyId: null,
|
|
71
|
+
caller: null,
|
|
72
|
+
clientCert: null,
|
|
73
|
+
cognitoAuthenticationProvider: null,
|
|
74
|
+
cognitoAuthenticationType: null,
|
|
75
|
+
cognitoIdentityId: null,
|
|
76
|
+
cognitoIdentityPoolId: null,
|
|
77
|
+
principalOrgId: null,
|
|
78
|
+
sourceIp: '',
|
|
79
|
+
user: null,
|
|
80
|
+
userAgent: null,
|
|
81
|
+
userArn: null,
|
|
82
|
+
},
|
|
83
|
+
path,
|
|
84
|
+
stage: 'prod',
|
|
85
|
+
requestId: 'requestId',
|
|
86
|
+
requestTimeEpoch: 0,
|
|
87
|
+
resourceId: '',
|
|
88
|
+
resourcePath: '',
|
|
89
|
+
},
|
|
90
|
+
resource: '',
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
async call(options = {}) {
|
|
94
|
+
const event = this.createRestEvent(options);
|
|
95
|
+
const context = createContext();
|
|
96
|
+
const result = await this.handler(event, context, () => { });
|
|
97
|
+
if (!result) {
|
|
98
|
+
throw new Error('No result returned from lambda');
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.LambdaRestUnitTest = LambdaRestUnitTest;
|
|
104
|
+
class LambdaGraphQLTest {
|
|
105
|
+
constructor(handler, defaults) {
|
|
106
|
+
this.handler = handler;
|
|
107
|
+
this.defaults = defaults;
|
|
108
|
+
}
|
|
109
|
+
createGraphQLEvent(options) {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
const { fieldName = 'testField', arguments: args = {}, source = null, parentTypeName = 'Query', prevResult = {}, stash = {}, } = options;
|
|
112
|
+
const cognitoClaims = {
|
|
113
|
+
username: 'DummyUser',
|
|
114
|
+
email: 'dummy@example.com',
|
|
115
|
+
groups: [],
|
|
116
|
+
...(_a = this.defaults) === null || _a === void 0 ? void 0 : _a.cognito,
|
|
117
|
+
...options.cognito,
|
|
118
|
+
};
|
|
119
|
+
return {
|
|
120
|
+
arguments: args,
|
|
121
|
+
source,
|
|
122
|
+
info: {
|
|
123
|
+
fieldName,
|
|
124
|
+
parentTypeName,
|
|
125
|
+
selectionSetGraphQL: '',
|
|
126
|
+
selectionSetList: [],
|
|
127
|
+
variables: {},
|
|
128
|
+
},
|
|
129
|
+
request: {
|
|
130
|
+
domainName: null,
|
|
131
|
+
headers: {},
|
|
132
|
+
},
|
|
133
|
+
identity: {
|
|
134
|
+
claims: {
|
|
135
|
+
'sub': cognitoClaims.username,
|
|
136
|
+
'cognito:username': cognitoClaims.username,
|
|
137
|
+
'cognito:groups': cognitoClaims.groups,
|
|
138
|
+
'email': cognitoClaims.email,
|
|
139
|
+
},
|
|
140
|
+
groups: cognitoClaims.groups,
|
|
141
|
+
sub: cognitoClaims.username,
|
|
142
|
+
accountId: '123456789012',
|
|
143
|
+
cognitoIdentityAuthProvider: null,
|
|
144
|
+
cognitoIdentityAuthType: null,
|
|
145
|
+
cognitoIdentityId: null,
|
|
146
|
+
cognitoIdentityPoolId: null,
|
|
147
|
+
resolverContext: null,
|
|
148
|
+
userArn: null,
|
|
149
|
+
defaultAuthStrategy: 'ALLOW',
|
|
150
|
+
issuer: 'https://cognito-idp.region.amazonaws.com/userPoolId',
|
|
151
|
+
sourceIp: ['127.0.0.1'],
|
|
152
|
+
username: cognitoClaims.username,
|
|
153
|
+
},
|
|
154
|
+
prev: {
|
|
155
|
+
result: prevResult,
|
|
156
|
+
},
|
|
157
|
+
stash: {
|
|
158
|
+
...(_b = this.defaults) === null || _b === void 0 ? void 0 : _b.stash,
|
|
159
|
+
...stash,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
async call(options) {
|
|
164
|
+
const event = this.createGraphQLEvent(options);
|
|
165
|
+
const context = createContext();
|
|
166
|
+
const result = await this.handler(event, context, () => { });
|
|
167
|
+
if (!result) {
|
|
168
|
+
throw new Error('No result returned from lambda');
|
|
169
|
+
}
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.LambdaGraphQLTest = LambdaGraphQLTest;
|
|
174
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFtYmRhLXRlc3QtdXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGVzdHMvbGFtYmRhLXRlc3QtdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBdUJBLHNDQWlCQztBQWpCRCxTQUFnQixhQUFhO0lBQzNCLE9BQU87UUFDTCw4QkFBOEIsRUFBRSxLQUFLO1FBQ3JDLFlBQVksRUFBRSxNQUF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zogKGNvZ25pdG9DbGFpbXMuZ3JvdXBzKSBhcyB1bmtub3duIGFzIHN0cmluZyxcbiAgICAgICAgICAgICdlbWFpbCc6IGNvZ25pdG9DbGFpbXMuZW1haWwsXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgcHJvdG9jb2w6ICdIVFRQLzEuMScsXG4gICAgICAgIGh0dHBNZXRob2Q6IG1ldGhvZCxcbiAgICAgICAgaWRlbnRpdHk6IHtcbiAgICAgICAgICBhY2Nlc3NLZXk6IG51bGwsXG4gICAgICAgICAgYWNjb3VudElkOiAnMTIzNDU2Nzg5MDEyJyxcbiAgICAgICAgICBhcGlLZXk6IG51bGwsXG4gICAgICAgICAgYXBpS2V5SWQ6IG51bGwsXG4gICAgICAgICAgY2FsbGVyOiBudWxsLFxuICAgICAgICAgIGNsaWVudENlcnQ6IG51bGwsXG4gICAgICAgICAgY29nbml0b0F1dGhlbnRpY2F0aW9uUHJvdmlkZXI6IG51bGwsXG4gICAgICAgICAgY29nbml0b0F1dGhlbnRpY2F0aW9uVHlwZTogbnVsbCxcbiAgICAgICAgICBjb2duaXRvSWRlbnRpdHlJZDogbnVsbCxcbiAgICAgICAgICBjb2duaXRvSWRlbnRpdHlQb29sSWQ6IG51bGwsXG4gICAgICAgICAgcHJpbmNpcGFsT3JnSWQ6IG51bGwsXG4gICAgICAgICAgc291cmNlSXA6ICcnLFxuICAgICAgICAgIHVzZXI6IG51bGwsXG4gICAgICAgICAgdXNlckFnZW50OiBudWxsLFxuICAgICAgICAgIHVzZXJBcm46IG51bGwsXG4gICAgICAgIH0sXG4gICAgICAgIHBhdGgsXG4gICAgICAgIHN0YWdlOiAncHJvZCcsXG4gICAgICAgIHJlcXVlc3RJZDogJ3JlcXVlc3RJZCcsXG4gICAgICAgIHJlcXVlc3RUaW1lRXBvY2g6IDAsXG4gICAgICAgIHJlc291cmNlSWQ6ICcnLFxuICAgICAgICByZXNvdXJjZVBhdGg6ICcnLFxuICAgICAgfSxcb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4gICAgICByZXF1ZXN0OiB7XG4gICAgICAgIGRvbWFpbk5hbWU6IG51bGwsXG4gICAgICAgIGhlYWRlcnM6IHt9LFxuICAgICAgfSxcbiAgICAgIGlkZW50aXR5OiB7XG4gICAgICAgIGNsYWltczoge1xuICAgICAgICAgICdzdWInOiBjb2duaXRvQ2xhaW1zLnVzZXJuYW1lLFxuICAgICAgICAgICdjb2duaXRvOnVzZXJuYW1lJzogY29nbml0b0NsYWltcy51c2VybmFtZSxcbiAgICAgICAgICAnY29nbml0bzpncm91cHMnOiBjb2duaXRvQ2xhaW1zLmdyb3VwcyBhcyB1bmtub3duIGFzIHN0cmluZyxcbiAgICAgICAgICAnZW1haWwnOiBjb2duaXRvQ2xhaW1zLmVtYWlsLFxuICAgICAgICB9LFxuICAgICAgICBncm91cHM6IGNvZ25pdG9DbGFpbXMuZ3JvdXBzLFxuICAgICAgICBzdWI6IGNvZ25pdG9DbGFpbXMudXNlcm5hbWUsXG4gICAgICAgIGFjY291bnRJZDogJzEyMzQ1Njc4OTAxMicsXG4gICAgICAgIGNvZ25pdG9JZGVudGl0eUF1dGhQcm92aWRlcjogbnVsbCxcbiAgICAgICAgY29nbml0b0lkZW50aXR5QXV0aFR5cGU6IG51bGwsXG4gICAgICAgIGNvZ25pdG9JZGVudGl0eUlkOiBudWxsLFxuICAgICAgICBjb2duaXRvSWRlbnRpdHlQb29sSWQ6IG51bGwsXG4gICAgICAgIHJlc29sdmVyQ29udGV4dDogbnVsbCxcbiAgICAgICAgdXNlckFybjogbnVsbCxcbiAgICAgICAgZGVmYXVsdEF1dGhTdHJhdGVneTogJ0FMTE9XJyxcbiAgICAgICAgaXNzdWVyOiAnaHR0cHM6Ly9jb2duaXRvLWlkcC5yZWdpb24uYW1hem9uYXdzLmNvbS91c2VyUG9vbElkJyxcbiAgICAgICAgc291cmNlSXA6IFsnMTI3LjAuMC4xJ10sXG4gICAgICAgIHVzZXJuYW1lOiBjb2duaXRvQ2xhaW1zLnVzZXJuYW1lLFxuICAgICAgfSxcbiAgICAgIHByZXY6IHtcbiAgICAgICAgcmVzdWx0OiBwcmV2UmVzdWx0LFxuICAgICAgfSxcbiAgICAgIHN0YXNoOiB7XG4gICAgICAgIC4uLnRoaXMuZGVmYXVsdHM/LnN0YXNoLFxuICAgICAgICAuLi5zdGFzaCxcbiAgICAgIH0sXG4gICAgfSBhcyBBV1NMYW1iZGEuQXBwU3luY1Jlc29sdmVyRXZlbnQ8UmVjb3JkPHN0cmluZywgYW55Pj47XG4gIH1cblxuICBhc3luYyBjYWxsKG9wdGlvbnM6IExhbWJkYUdyYXBoUUxUZXN0T3B0aW9ucyk6IFByb21pc2U8YW55PiB7XG4gICAgY29uc3QgZXZlbnQgPSB0aGlzLmNyZWF0ZUdyYXBoUUxFdmVudChvcHRpb25zKTtcbiAgICBjb25zdCBjb250ZXh0ID0gY3JlYXRlQ29udGV4dCgpO1xuICAgIGNvbnN0IHJlc3VsdCA9IGF3YWl0IHRoaXMuaGFuZGxlcihldmVudCwgY29udGV4dCwgKCkgPT4geyB9KTtcbiAgICBpZiAoIXJlc3VsdCkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdObyByZXN1bHQgcmV0dXJuZWQgZnJvbSBsYW1iZGEnKTtcbiAgICB9XG4gICAgcmV0dXJuIHJlc3VsdDtcbiAgfVxufVxuIl19
|
package/package.json
CHANGED
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"@aws-sdk/lib-dynamodb": "3.726.0",
|
|
39
39
|
"@hapi/boom": "^10.0.1",
|
|
40
40
|
"@stylistic/eslint-plugin": "^2",
|
|
41
|
-
"@types/aws-lambda": "^8.10.148",
|
|
42
41
|
"@types/jest": "^29.5.14",
|
|
43
42
|
"@types/js-yaml": "^4.0.9",
|
|
44
43
|
"@types/jsonwebtoken": "^9.0.9",
|
|
@@ -75,6 +74,7 @@
|
|
|
75
74
|
"projen": ">=0.91.6 <1.0.0"
|
|
76
75
|
},
|
|
77
76
|
"dependencies": {
|
|
77
|
+
"@types/aws-lambda": "^8.10.148",
|
|
78
78
|
"axios": "^1.8.4",
|
|
79
79
|
"constructs": "^10.3.0",
|
|
80
80
|
"date-fns": "^4.1.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"publishConfig": {
|
|
97
97
|
"access": "public"
|
|
98
98
|
},
|
|
99
|
-
"version": "2.
|
|
99
|
+
"version": "2.19.0",
|
|
100
100
|
"jest": {
|
|
101
101
|
"coverageProvider": "v8",
|
|
102
102
|
"testMatch": [
|