@digitraffic/common 2023.8.10-1 → 2023.9.8-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt ADDED
@@ -0,0 +1,287 @@
1
+ EUROPEAN UNION PUBLIC LICENCE v. 1.2
2
+ EUPL © the European Union 2007, 2016
3
+
4
+ This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
5
+ below) which is provided under the terms of this Licence. Any use of the Work,
6
+ other than as authorised under this Licence is prohibited (to the extent such
7
+ use is covered by a right of the copyright holder of the Work).
8
+
9
+ The Work is provided under the terms of this Licence when the Licensor (as
10
+ defined below) has placed the following notice immediately following the
11
+ copyright notice for the Work:
12
+
13
+ Licensed under the EUPL
14
+
15
+ or has expressed by any other means his willingness to license under the EUPL.
16
+
17
+ 1. Definitions
18
+
19
+ In this Licence, the following terms have the following meaning:
20
+
21
+ - ‘The Licence’: this Licence.
22
+
23
+ - ‘The Original Work’: the work or software distributed or communicated by the
24
+ Licensor under this Licence, available as Source Code and also as Executable
25
+ Code as the case may be.
26
+
27
+ - ‘Derivative Works’: the works or software that could be created by the
28
+ Licensee, based upon the Original Work or modifications thereof. This Licence
29
+ does not define the extent of modification or dependence on the Original Work
30
+ required in order to classify a work as a Derivative Work; this extent is
31
+ determined by copyright law applicable in the country mentioned in Article 15.
32
+
33
+ - ‘The Work’: the Original Work or its Derivative Works.
34
+
35
+ - ‘The Source Code’: the human-readable form of the Work which is the most
36
+ convenient for people to study and modify.
37
+
38
+ - ‘The Executable Code’: any code which has generally been compiled and which is
39
+ meant to be interpreted by a computer as a program.
40
+
41
+ - ‘The Licensor’: the natural or legal person that distributes or communicates
42
+ the Work under the Licence.
43
+
44
+ - ‘Contributor(s)’: any natural or legal person who modifies the Work under the
45
+ Licence, or otherwise contributes to the creation of a Derivative Work.
46
+
47
+ - ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
48
+ the Work under the terms of the Licence.
49
+
50
+ - ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
51
+ renting, distributing, communicating, transmitting, or otherwise making
52
+ available, online or offline, copies of the Work or providing access to its
53
+ essential functionalities at the disposal of any other natural or legal
54
+ person.
55
+
56
+ 2. Scope of the rights granted by the Licence
57
+
58
+ The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
59
+ sublicensable licence to do the following, for the duration of copyright vested
60
+ in the Original Work:
61
+
62
+ - use the Work in any circumstance and for all usage,
63
+ - reproduce the Work,
64
+ - modify the Work, and make Derivative Works based upon the Work,
65
+ - communicate to the public, including the right to make available or display
66
+ the Work or copies thereof to the public and perform publicly, as the case may
67
+ be, the Work,
68
+ - distribute the Work or copies thereof,
69
+ - lend and rent the Work or copies thereof,
70
+ - sublicense rights in the Work or copies thereof.
71
+
72
+ Those rights can be exercised on any media, supports and formats, whether now
73
+ known or later invented, as far as the applicable law permits so.
74
+
75
+ In the countries where moral rights apply, the Licensor waives his right to
76
+ exercise his moral right to the extent allowed by law in order to make effective
77
+ the licence of the economic rights here above listed.
78
+
79
+ The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
80
+ any patents held by the Licensor, to the extent necessary to make use of the
81
+ rights granted on the Work under this Licence.
82
+
83
+ 3. Communication of the Source Code
84
+
85
+ The Licensor may provide the Work either in its Source Code form, or as
86
+ Executable Code. If the Work is provided as Executable Code, the Licensor
87
+ provides in addition a machine-readable copy of the Source Code of the Work
88
+ along with each copy of the Work that the Licensor distributes or indicates, in
89
+ a notice following the copyright notice attached to the Work, a repository where
90
+ the Source Code is easily and freely accessible for as long as the Licensor
91
+ continues to distribute or communicate the Work.
92
+
93
+ 4. Limitations on copyright
94
+
95
+ Nothing in this Licence is intended to deprive the Licensee of the benefits from
96
+ any exception or limitation to the exclusive rights of the rights owners in the
97
+ Work, of the exhaustion of those rights or of other applicable limitations
98
+ thereto.
99
+
100
+ 5. Obligations of the Licensee
101
+
102
+ The grant of the rights mentioned above is subject to some restrictions and
103
+ obligations imposed on the Licensee. Those obligations are the following:
104
+
105
+ Attribution right: The Licensee shall keep intact all copyright, patent or
106
+ trademarks notices and all notices that refer to the Licence and to the
107
+ disclaimer of warranties. The Licensee must include a copy of such notices and a
108
+ copy of the Licence with every copy of the Work he/she distributes or
109
+ communicates. The Licensee must cause any Derivative Work to carry prominent
110
+ notices stating that the Work has been modified and the date of modification.
111
+
112
+ Copyleft clause: If the Licensee distributes or communicates copies of the
113
+ Original Works or Derivative Works, this Distribution or Communication will be
114
+ done under the terms of this Licence or of a later version of this Licence
115
+ unless the Original Work is expressly distributed only under this version of the
116
+ Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
117
+ (becoming Licensor) cannot offer or impose any additional terms or conditions on
118
+ the Work or Derivative Work that alter or restrict the terms of the Licence.
119
+
120
+ Compatibility clause: If the Licensee Distributes or Communicates Derivative
121
+ Works or copies thereof based upon both the Work and another work licensed under
122
+ a Compatible Licence, this Distribution or Communication can be done under the
123
+ terms of this Compatible Licence. For the sake of this clause, ‘Compatible
124
+ Licence’ refers to the licences listed in the appendix attached to this Licence.
125
+ Should the Licensee's obligations under the Compatible Licence conflict with
126
+ his/her obligations under this Licence, the obligations of the Compatible
127
+ Licence shall prevail.
128
+
129
+ Provision of Source Code: When distributing or communicating copies of the Work,
130
+ the Licensee will provide a machine-readable copy of the Source Code or indicate
131
+ a repository where this Source will be easily and freely available for as long
132
+ as the Licensee continues to distribute or communicate the Work.
133
+
134
+ Legal Protection: This Licence does not grant permission to use the trade names,
135
+ trademarks, service marks, or names of the Licensor, except as required for
136
+ reasonable and customary use in describing the origin of the Work and
137
+ reproducing the content of the copyright notice.
138
+
139
+ 6. Chain of Authorship
140
+
141
+ The original Licensor warrants that the copyright in the Original Work granted
142
+ hereunder is owned by him/her or licensed to him/her and that he/she has the
143
+ power and authority to grant the Licence.
144
+
145
+ Each Contributor warrants that the copyright in the modifications he/she brings
146
+ to the Work are owned by him/her or licensed to him/her and that he/she has the
147
+ power and authority to grant the Licence.
148
+
149
+ Each time You accept the Licence, the original Licensor and subsequent
150
+ Contributors grant You a licence to their contributions to the Work, under the
151
+ terms of this Licence.
152
+
153
+ 7. Disclaimer of Warranty
154
+
155
+ The Work is a work in progress, which is continuously improved by numerous
156
+ Contributors. It is not a finished work and may therefore contain defects or
157
+ ‘bugs’ inherent to this type of development.
158
+
159
+ For the above reason, the Work is provided under the Licence on an ‘as is’ basis
160
+ and without warranties of any kind concerning the Work, including without
161
+ limitation merchantability, fitness for a particular purpose, absence of defects
162
+ or errors, accuracy, non-infringement of intellectual property rights other than
163
+ copyright as stated in Article 6 of this Licence.
164
+
165
+ This disclaimer of warranty is an essential part of the Licence and a condition
166
+ for the grant of any rights to the Work.
167
+
168
+ 8. Disclaimer of Liability
169
+
170
+ Except in the cases of wilful misconduct or damages directly caused to natural
171
+ persons, the Licensor will in no event be liable for any direct or indirect,
172
+ material or moral, damages of any kind, arising out of the Licence or of the use
173
+ of the Work, including without limitation, damages for loss of goodwill, work
174
+ stoppage, computer failure or malfunction, loss of data or any commercial
175
+ damage, even if the Licensor has been advised of the possibility of such damage.
176
+ However, the Licensor will be liable under statutory product liability laws as
177
+ far such laws apply to the Work.
178
+
179
+ 9. Additional agreements
180
+
181
+ While distributing the Work, You may choose to conclude an additional agreement,
182
+ defining obligations or services consistent with this Licence. However, if
183
+ accepting obligations, You may act only on your own behalf and on your sole
184
+ responsibility, not on behalf of the original Licensor or any other Contributor,
185
+ and only if You agree to indemnify, defend, and hold each Contributor harmless
186
+ for any liability incurred by, or claims asserted against such Contributor by
187
+ the fact You have accepted any warranty or additional liability.
188
+
189
+ 10. Acceptance of the Licence
190
+
191
+ The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
192
+ placed under the bottom of a window displaying the text of this Licence or by
193
+ affirming consent in any other similar way, in accordance with the rules of
194
+ applicable law. Clicking on that icon indicates your clear and irrevocable
195
+ acceptance of this Licence and all of its terms and conditions.
196
+
197
+ Similarly, you irrevocably accept this Licence and all of its terms and
198
+ conditions by exercising any rights granted to You by Article 2 of this Licence,
199
+ such as the use of the Work, the creation by You of a Derivative Work or the
200
+ Distribution or Communication by You of the Work or copies thereof.
201
+
202
+ 11. Information to the public
203
+
204
+ In case of any Distribution or Communication of the Work by means of electronic
205
+ communication by You (for example, by offering to download the Work from a
206
+ remote location) the distribution channel or media (for example, a website) must
207
+ at least provide to the public the information requested by the applicable law
208
+ regarding the Licensor, the Licence and the way it may be accessible, concluded,
209
+ stored and reproduced by the Licensee.
210
+
211
+ 12. Termination of the Licence
212
+
213
+ The Licence and the rights granted hereunder will terminate automatically upon
214
+ any breach by the Licensee of the terms of the Licence.
215
+
216
+ Such a termination will not terminate the licences of any person who has
217
+ received the Work from the Licensee under the Licence, provided such persons
218
+ remain in full compliance with the Licence.
219
+
220
+ 13. Miscellaneous
221
+
222
+ Without prejudice of Article 9 above, the Licence represents the complete
223
+ agreement between the Parties as to the Work.
224
+
225
+ If any provision of the Licence is invalid or unenforceable under applicable
226
+ law, this will not affect the validity or enforceability of the Licence as a
227
+ whole. Such provision will be construed or reformed so as necessary to make it
228
+ valid and enforceable.
229
+
230
+ The European Commission may publish other linguistic versions or new versions of
231
+ this Licence or updated versions of the Appendix, so far this is required and
232
+ reasonable, without reducing the scope of the rights granted by the Licence. New
233
+ versions of the Licence will be published with a unique version number.
234
+
235
+ All linguistic versions of this Licence, approved by the European Commission,
236
+ have identical value. Parties can take advantage of the linguistic version of
237
+ their choice.
238
+
239
+ 14. Jurisdiction
240
+
241
+ Without prejudice to specific agreement between parties,
242
+
243
+ - any litigation resulting from the interpretation of this License, arising
244
+ between the European Union institutions, bodies, offices or agencies, as a
245
+ Licensor, and any Licensee, will be subject to the jurisdiction of the Court
246
+ of Justice of the European Union, as laid down in article 272 of the Treaty on
247
+ the Functioning of the European Union,
248
+
249
+ - any litigation arising between other parties and resulting from the
250
+ interpretation of this License, will be subject to the exclusive jurisdiction
251
+ of the competent court where the Licensor resides or conducts its primary
252
+ business.
253
+
254
+ 15. Applicable Law
255
+
256
+ Without prejudice to specific agreement between parties,
257
+
258
+ - this Licence shall be governed by the law of the European Union Member State
259
+ where the Licensor has his seat, resides or has his registered office,
260
+
261
+ - this licence shall be governed by Belgian law if the Licensor has no seat,
262
+ residence or registered office inside a European Union Member State.
263
+
264
+ Appendix
265
+
266
+ ‘Compatible Licences’ according to Article 5 EUPL are:
267
+
268
+ - GNU General Public License (GPL) v. 2, v. 3
269
+ - GNU Affero General Public License (AGPL) v. 3
270
+ - Open Software License (OSL) v. 2.1, v. 3.0
271
+ - Eclipse Public License (EPL) v. 1.0
272
+ - CeCILL v. 2.0, v. 2.1
273
+ - Mozilla Public Licence (MPL) v. 2
274
+ - GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
275
+ - Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
276
+ works other than software
277
+ - European Union Public Licence (EUPL) v. 1.1, v. 1.2
278
+ - Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
279
+ Reciprocity (LiLiQ-R+).
280
+
281
+ The European Commission may update this Appendix to later versions of the above
282
+ licences without producing a new version of the EUPL, as long as they provide
283
+ the rights granted in Article 2 of this Licence and protect the covered Source
284
+ Code from exclusive appropriation.
285
+
286
+ All other changes or additions to this Appendix require the production of a new
287
+ EUPL version.
@@ -1,7 +1,7 @@
1
1
  import { IntegrationResponse, LambdaIntegration } from "aws-cdk-lib/aws-apigateway";
2
2
  import { IFunction } from "aws-cdk-lib/aws-lambda";
3
3
  import { MediaType } from "../../types/mediatypes";
4
- type ParameterType = "path" | "querystring" | "context";
4
+ type ParameterType = "path" | "querystring" | "context" | "header";
5
5
  interface ApiParameter {
6
6
  type: ParameterType;
7
7
  name: string;
@@ -14,7 +14,19 @@ export declare class DigitrafficIntegration {
14
14
  constructor(lambda: IFunction, mediaType?: MediaType, sunset?: string);
15
15
  addPathParameter(...names: string[]): this;
16
16
  addQueryParameter(...names: string[]): this;
17
+ /**
18
+ * Note that context parameter values needs to be in json format as they will be parsed in template as json.
19
+ * See createRequestTemplates below.
20
+ * @param names for the parameters
21
+ * @returns
22
+ */
17
23
  addContextParameter(...names: string[]): this;
24
+ /**
25
+ * Do not use Authorization header as that will be consumed by ApiGW.
26
+ * If Authorization header is needed, use lambda authorizers.
27
+ * @param names for the headers
28
+ */
29
+ addHeaderParameter(...names: string[]): this;
18
30
  build(): LambdaIntegration;
19
31
  createRequestParameters(): Record<string, string>;
20
32
  createRequestTemplates(): Record<string, string>;
@@ -19,10 +19,25 @@ class DigitrafficIntegration {
19
19
  names.forEach((name) => this.parameters.push({ type: "querystring", name }));
20
20
  return this;
21
21
  }
22
+ /**
23
+ * Note that context parameter values needs to be in json format as they will be parsed in template as json.
24
+ * See createRequestTemplates below.
25
+ * @param names for the parameters
26
+ * @returns
27
+ */
22
28
  addContextParameter(...names) {
23
29
  names.forEach((name) => this.parameters.push({ type: "context", name }));
24
30
  return this;
25
31
  }
32
+ /**
33
+ * Do not use Authorization header as that will be consumed by ApiGW.
34
+ * If Authorization header is needed, use lambda authorizers.
35
+ * @param names for the headers
36
+ */
37
+ addHeaderParameter(...names) {
38
+ names.forEach((name) => this.parameters.push({ type: "header", name }));
39
+ return this;
40
+ }
26
41
  build() {
27
42
  const integrationResponses = this.createResponses();
28
43
  return new aws_apigateway_1.LambdaIntegration(this.lambda, {
@@ -1,9 +1,9 @@
1
- import { RestApi, RestApiProps, JsonSchema, Resource } from "aws-cdk-lib/aws-apigateway";
1
+ import { IResource, JsonSchema, Resource, RestApi, RestApiProps } from "aws-cdk-lib/aws-apigateway";
2
2
  import { PolicyDocument } from "aws-cdk-lib/aws-iam";
3
3
  import { Construct } from "constructs";
4
- import { DigitrafficStack } from "./stack";
5
4
  import { ModelWithReference } from "../../types/model-with-reference";
6
5
  import { DocumentationPart } from "../documentation";
6
+ import { DigitrafficStack } from "./stack";
7
7
  export declare class DigitrafficRestApi extends RestApi {
8
8
  readonly apiKeyIds: string[];
9
9
  readonly enableDocumentation: boolean;
@@ -16,6 +16,12 @@ export declare class DigitrafficRestApi extends RestApi {
16
16
  private getModelWithReference;
17
17
  private addDocumentationPart;
18
18
  documentResource(resource: Resource, ...documentationPart: DocumentationPart[]): void;
19
+ /**
20
+ * Add support for HTTP OPTIONS to an API GW resource,
21
+ * this is required for preflight CORS requests made by browsers.
22
+ * @param apiResource
23
+ */
24
+ addCorsOptions(apiResource: IResource): void;
19
25
  }
20
26
  /**
21
27
  * Due to AWS API design API Gateway will always return 403 'Missing Authentication Token' for requests
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createIpRestrictionPolicyDocument = exports.createDefaultPolicyDocument = exports.createRestApi = exports.setReturnCodeForMissingAuthenticationToken = exports.add401Support = exports.add404Support = exports.DigitrafficRestApi = void 0;
4
4
  const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
5
5
  const aws_iam_1 = require("aws-cdk-lib/aws-iam");
6
- const usage_plans_1 = require("../usage-plans");
7
6
  const api_model_1 = require("../../../utils/api-model");
8
7
  const mediatypes_1 = require("../../types/mediatypes");
8
+ const usage_plans_1 = require("../usage-plans");
9
9
  const R = require("ramda");
10
10
  class DigitrafficRestApi extends aws_apigateway_1.RestApi {
11
11
  constructor(stack, apiId, apiName, allowFromIpAddresses, config) {
@@ -80,6 +80,39 @@ class DigitrafficRestApi extends aws_apigateway_1.RestApi {
80
80
  console.info("Skipping documentation for %s", resource.path);
81
81
  }
82
82
  }
83
+ /**
84
+ * Add support for HTTP OPTIONS to an API GW resource,
85
+ * this is required for preflight CORS requests made by browsers.
86
+ * @param apiResource
87
+ */
88
+ addCorsOptions(apiResource) {
89
+ apiResource.addMethod("OPTIONS", new aws_apigateway_1.MockIntegration({
90
+ integrationResponses: [
91
+ {
92
+ statusCode: "200",
93
+ responseParameters: {
94
+ "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,Digitraffic-User'",
95
+ "method.response.header.Access-Control-Allow-Origin": "'*'",
96
+ "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,HEAD'",
97
+ },
98
+ },
99
+ ],
100
+ requestTemplates: {
101
+ "application/json": '{"statusCode": 200}',
102
+ },
103
+ }), {
104
+ methodResponses: [
105
+ {
106
+ statusCode: "200",
107
+ responseParameters: {
108
+ "method.response.header.Access-Control-Allow-Headers": true,
109
+ "method.response.header.Access-Control-Allow-Methods": true,
110
+ "method.response.header.Access-Control-Allow-Origin": true,
111
+ },
112
+ },
113
+ ],
114
+ });
115
+ }
83
116
  }
84
117
  exports.DigitrafficRestApi = DigitrafficRestApi;
85
118
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitraffic/common",
3
- "version": "2023.8.10-1",
3
+ "version": "2023.9.8-1",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -7,7 +7,7 @@ import { IFunction } from "aws-cdk-lib/aws-lambda";
7
7
  import { MediaType } from "../../types/mediatypes";
8
8
  import { DigitrafficIntegrationResponse } from "../../runtime/digitraffic-integration-response";
9
9
 
10
- type ParameterType = "path" | "querystring" | "context";
10
+ type ParameterType = "path" | "querystring" | "context" | "header";
11
11
 
12
12
  interface ApiParameter {
13
13
  type: ParameterType;
@@ -40,10 +40,15 @@ export class DigitrafficIntegration {
40
40
  names.forEach((name) =>
41
41
  this.parameters.push({ type: "querystring", name })
42
42
  );
43
-
44
43
  return this;
45
44
  }
46
45
 
46
+ /**
47
+ * Note that context parameter values needs to be in json format as they will be parsed in template as json.
48
+ * See createRequestTemplates below.
49
+ * @param names for the parameters
50
+ * @returns
51
+ */
47
52
  addContextParameter(...names: string[]): this {
48
53
  names.forEach((name) =>
49
54
  this.parameters.push({ type: "context", name })
@@ -52,6 +57,17 @@ export class DigitrafficIntegration {
52
57
  return this;
53
58
  }
54
59
 
60
+ /**
61
+ * Do not use Authorization header as that will be consumed by ApiGW.
62
+ * If Authorization header is needed, use lambda authorizers.
63
+ * @param names for the headers
64
+ */
65
+ addHeaderParameter(...names: string[]): this {
66
+ names.forEach((name) => this.parameters.push({ type: "header", name }));
67
+
68
+ return this;
69
+ }
70
+
55
71
  build(): LambdaIntegration {
56
72
  const integrationResponses = this.createResponses();
57
73
 
@@ -1,28 +1,30 @@
1
1
  import {
2
- RestApi,
3
- MethodLoggingLevel,
4
- GatewayResponse,
5
- ResponseType,
2
+ CfnDocumentationPart,
6
3
  EndpointType,
7
- RestApiProps,
4
+ GatewayResponse,
5
+ IResource,
8
6
  JsonSchema,
7
+ MethodLoggingLevel,
8
+ MockIntegration,
9
9
  Model,
10
- CfnDocumentationPart,
11
10
  Resource,
11
+ ResponseType,
12
+ RestApi,
13
+ RestApiProps,
12
14
  } from "aws-cdk-lib/aws-apigateway";
13
15
  import {
16
+ AnyPrincipal,
17
+ Effect,
14
18
  PolicyDocument,
15
19
  PolicyStatement,
16
- Effect,
17
- AnyPrincipal,
18
20
  } from "aws-cdk-lib/aws-iam";
19
21
  import { Construct } from "constructs";
20
- import { DigitrafficStack } from "./stack";
21
- import { createDefaultUsagePlan, createUsagePlan } from "../usage-plans";
22
- import { ModelWithReference } from "../../types/model-with-reference";
23
22
  import { getModelReference } from "../../../utils/api-model";
24
23
  import { MediaType } from "../../types/mediatypes";
24
+ import { ModelWithReference } from "../../types/model-with-reference";
25
25
  import { DocumentationPart, DocumentationProperties } from "../documentation";
26
+ import { createDefaultUsagePlan, createUsagePlan } from "../usage-plans";
27
+ import { DigitrafficStack } from "./stack";
26
28
 
27
29
  import R = require("ramda");
28
30
 
@@ -152,6 +154,50 @@ export class DigitrafficRestApi extends RestApi {
152
154
  console.info("Skipping documentation for %s", resource.path);
153
155
  }
154
156
  }
157
+
158
+ /**
159
+ * Add support for HTTP OPTIONS to an API GW resource,
160
+ * this is required for preflight CORS requests made by browsers.
161
+ * @param apiResource
162
+ */
163
+ addCorsOptions(apiResource: IResource): void {
164
+ apiResource.addMethod(
165
+ "OPTIONS",
166
+ new MockIntegration({
167
+ integrationResponses: [
168
+ {
169
+ statusCode: "200",
170
+ responseParameters: {
171
+ "method.response.header.Access-Control-Allow-Headers":
172
+ "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,Digitraffic-User'",
173
+ "method.response.header.Access-Control-Allow-Origin":
174
+ "'*'",
175
+ "method.response.header.Access-Control-Allow-Methods":
176
+ "'OPTIONS,GET,HEAD'",
177
+ },
178
+ },
179
+ ],
180
+ requestTemplates: {
181
+ "application/json": '{"statusCode": 200}',
182
+ },
183
+ }),
184
+ {
185
+ methodResponses: [
186
+ {
187
+ statusCode: "200",
188
+ responseParameters: {
189
+ "method.response.header.Access-Control-Allow-Headers":
190
+ true,
191
+ "method.response.header.Access-Control-Allow-Methods":
192
+ true,
193
+ "method.response.header.Access-Control-Allow-Origin":
194
+ true,
195
+ },
196
+ },
197
+ ],
198
+ }
199
+ );
200
+ }
155
201
  }
156
202
 
157
203
  /**
package/LICENSE DELETED
@@ -1,291 +0,0 @@
1
- European Union Public Licence
2
- V. 1.2
3
-
4
-
5
- EUPL © the European Union 2007, 2013
6
-
7
-
8
- This European Union Public Licence (the “EUPL”) applies to the Work (as defined
9
- below) which is provided under the terms of this Licence. Any use of the Work, other
10
- than as authorised under this Licence is prohibited (to the extent such use is covered by
11
- a right of the copyright holder of the Work).
12
-
13
- The Original Work is provided under the terms of this Licence when the Licensor (as
14
- defined below) has placed the following notice immediately following the copyright
15
- notice for the Original Work:
16
-
17
- Licensed under the EUPL
18
-
19
- or has expressed by any other means his willingness to license under the EUPL.
20
-
21
- 1. Definitions
22
-
23
- In this Licence, the following terms have the following meaning:
24
-
25
- - The Licence: this Licence.
26
-
27
- - The Original Work: the work or software distributed and/or communicated by the
28
- Licensor under this Licence, available as Source Code and also as Executable Code as
29
- the case may be.
30
-
31
- - Derivative Works: the works or software that could be created by the Licensee, based
32
- upon the Original Work or modifications thereof. This Licence does not define the
33
- extent of modification or dependence on the Original Work required in order to classify
34
- a work as a Derivative Work; this extent is determined by copyright law applicable in
35
- the country mentioned in Article 15.
36
-
37
- - The Work: the Original Work and/or its Derivative Works.
38
-
39
- - The Source Code: the human-readable form of the Work which is the most convenient
40
- for people to study and modify.
41
-
42
- - The Executable Code: any code which has generally been compiled and which is
43
- meant to be interpreted by a computer as a program.
44
-
45
- - The Licensor: the natural or legal person that distributes and/or communicates the
46
- Work under the Licence.
47
-
48
- - Contributor(s): any natural or legal person who modifies the Work under the Licence,
49
- or otherwise contributes to the creation of a Derivative Work.
50
-
51
- - The Licensee or “You”: any natural or legal person who makes any usage of the Work
52
- under the terms of the Licence.
53
-
54
- - Distribution and/or Communication: any act of selling, giving, lending, renting,
55
- distributing, communicating, transmitting, or otherwise making available, on-line or
56
- off-line, copies of the Work or providing access to its essential functionalities at the
57
- disposal of any other natural or legal person.
58
-
59
- 2. Scope of the rights granted by the Licence
60
-
61
- The Licensor hereby grants You a world-wide, royalty-free, non-exclusive, sub-
62
- licensable licence to do the following, for the duration of copyright vested in the
63
- Original Work:
64
-
65
- - use the Work in any circumstance and for all usage,
66
- - reproduce the Work,
67
- - modify the Original Work, and make Derivative Works based upon the Work,
68
- - communicate to the public, including the right to make available or display the
69
- Work or copies thereof to the public and perform publicly, as the case may be,
70
- the Work,
71
- - distribute the Work or copies thereof,
72
- - lend and rent the Work or copies thereof,
73
- - sub-license rights in the Work or copies thereof.
74
-
75
- Those rights can be exercised on any media, supports and formats, whether now known
76
- or later invented, as far as the applicable law permits so.
77
-
78
- In the countries where moral rights apply, the Licensor waives his right to exercise his
79
- moral right to the extent allowed by law in order to make effective the licence of the
80
- economic rights here above listed.
81
-
82
- The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any
83
- patents held by the Licensor, to the extent necessary to make use of the rights granted
84
- on the Work under this Licence.
85
-
86
- 3. Communication of the Source Code
87
-
88
- The Licensor may provide the Work either in its Source Code form, or as Executable
89
- Code. If the Work is provided as Executable Code, the Licensor provides in addition a
90
- machine-readable copy of the Source Code of the Work along with each copy of the
91
- Work that the Licensor distributes or indicates, in a notice following the copyright
92
- notice attached to the Work, a repository where the Source Code is easily and freely
93
- accessible for as long as the Licensor continues to distribute and/or communicate the
94
- Work.
95
-
96
- 4. Limitations on copyright
97
-
98
- Nothing in this Licence is intended to deprive the Licensee of the benefits from any
99
- exception or limitation to the exclusive rights of the rights owners in the Original Work,
100
- of the exhaustion of those rights or of other applicable limitations thereto.
101
-
102
- 5. Obligations of the Licensee
103
-
104
- The grant of the rights mentioned above is subject to some restrictions and obligations
105
- imposed on the Licensee. Those obligations are the following:
106
-
107
- Attribution right: the Licensee shall keep intact all copyright, patent or trademarks
108
- notices and all notices that refer to the Licence and to the disclaimer of warranties. The
109
- Licensee must include a copy of such notices and a copy of the Licence with every copy
110
- of the Work he/she distributes and/or communicates. The Licensee must cause any
111
- Derivative Work to carry prominent notices stating that the Work has been modified
112
- and the date of modification.
113
-
114
- Copyleft clause: If the Licensee distributes or communicates copies of the Original
115
- Works or Derivative Works, this Distribution or Communication will be done under the
116
- terms of this Licence or of a later version of this Licence unless the Original Work is
117
- expressly distributed only under this version of the Licence – for example by stating
118
- “EUPL v. 1.2 only”. The Licensee (becoming Licensor) cannot offer or impose any
119
- additional terms or conditions on the Work or Derivative Work that alter or restrict the
120
- terms of the Licence.
121
-
122
- Compatibility clause: If the Licensee Distributes or Communicates Derivative Works
123
- or copies thereof based upon both the Original Work and another work licensed under
124
- a Compatible Licence, this Distribution or Communication can be done under the terms
125
- of this Compatible Licence. For the sake of this clause, “Compatible Licence” refers to
126
- the licences listed in the appendix attached to this Licence. Should the Licensee’s
127
- obligations under the Compatible Licence conflict with his/her obligations under this
128
- Licence, the obligations of the Compatible Licence shall prevail.
129
-
130
- Provision of Source Code: When distributing and/or communicating copies of the
131
- Work, the Licensee will provide a machine-readable copy of the Source Code or
132
- indicate a repository where this Source will be easily and freely available for as long as
133
- the Licensee continues to distribute and/or communicate the Work.
134
-
135
- Legal Protection: This Licence does not grant permission to use the trade names,
136
- trademarks, service marks, or names of the Licensor, except as required for reasonable
137
- and customary use in describing the origin of the Work and reproducing the content of
138
- the copyright notice.
139
-
140
- 6. Chain of Authorship
141
-
142
- The original Licensor warrants that the copyright in the Original Work granted
143
- hereunder is owned by him/her or licensed to him/her and that he/she has the power and
144
- authority to grant the Licence.
145
-
146
- Each Contributor warrants that the copyright in the modifications he/she brings to the
147
- Work are owned by him/her or licensed to him/her and that he/she has the power and
148
- authority to grant the Licence.
149
-
150
- Each time You accept the Licence, the original Licensor and subsequent Contributors
151
- grant You a licence to their contributions to the Work, under the terms of this Licence.
152
-
153
- 7. Disclaimer of Warranty
154
-
155
- The Work is a work in progress, which is continuously improved by numerous
156
- Contributors. It is not a finished work and may therefore contain defects or “bugs”
157
- inherent to this type of development.
158
-
159
- For the above reason, the Work is provided under the Licence on an “as is” basis and
160
- without warranties of any kind concerning the Work, including without limitation
161
- merchantability, fitness for a particular purpose, absence of defects or errors, accuracy,
162
- non-infringement of intellectual property rights other than copyright as stated in Article
163
- 6 of this Licence.
164
-
165
- This disclaimer of warranty is an essential part of the Licence and a condition for the
166
- grant of any rights to the Work.
167
-
168
- 8. Disclaimer of Liability
169
-
170
- Except in the cases of wilful misconduct or damages directly caused to natural persons,
171
- the Licensor will in no event be liable for any direct or indirect, material or moral,
172
- damages of any kind, arising out of the Licence or of the use of the Work, including
173
- without limitation, damages for loss of goodwill, work stoppage, computer failure or
174
- malfunction, loss of data or any commercial damage, even if the Licensor has been
175
- advised of the possibility of such damage. However, the Licensor will be liable under
176
- statutory product liability laws as far such laws apply to the Work.
177
-
178
- 9. Additional agreements
179
-
180
- While distributing the Original Work or Derivative Works, You may choose to
181
- conclude an additional agreement, defining obligations and/or services consistent with
182
- this Licence. However, if accepting obligations, You may act only on your own behalf
183
- and on your sole responsibility, not on behalf of the original Licensor or any other
184
- Contributor, and only if You agree to indemnify, defend, and hold each Contributor
185
- harmless for any liability incurred by, or claims asserted against such Contributor by
186
- the fact You have accepted any warranty or additional liability.
187
-
188
- 10. Acceptance of the Licence
189
-
190
- The provisions of this Licence can be accepted by clicking on an icon “I agree” placed
191
- under the bottom of a window displaying the text of this Licence or by affirming
192
- consent in any other similar way, in accordance with the rules of applicable law.
193
- Clicking on that icon indicates your clear and irrevocable acceptance of this Licence
194
- and all of its terms and conditions.
195
-
196
- Similarly, you irrevocably accept this Licence and all of its terms and conditions by
197
- exercising any rights granted to You by Article 2 of this Licence, such as the use of the
198
- Work, the creation by You of a Derivative Work or the Distribution or Communication
199
- by You of the Work or copies thereof.
200
-
201
- 11. Information to the public
202
-
203
- In case of any Distribution and/or Communication of the Work by means of electronic
204
- communication by You (for example, by offering to download the Work from a remote
205
- location) the distribution channel or media (for example, a website) must at least
206
- provide to the public the information requested by the applicable law regarding the
207
- Licensor, the Licence and the way it may be accessible, concluded, stored and
208
- reproduced by the Licensee.
209
-
210
- 12. Termination of the Licence
211
-
212
- The Licence and the rights granted hereunder will terminate automatically upon any
213
- breach by the Licensee of the terms of the Licence.
214
-
215
- Such a termination will not terminate the licences of any person who has received the
216
- Work from the Licensee under the Licence, provided such persons remain in full
217
- compliance with the Licence.
218
-
219
- 13. Miscellaneous
220
-
221
- Without prejudice of Article 9 above, the Licence represents the complete agreement
222
- between the Parties as to the Work.
223
-
224
- If any provision of the Licence is invalid or unenforceable under applicable law, this
225
- will not affect the validity or enforceability of the Licence as a whole. Such provision
226
- will be construed and/or reformed so as necessary to make it valid and enforceable.
227
-
228
- The European Commission may publish other linguistic versions and/or new versions
229
- of this Licence and/or updated versions of the Appendix, so far this is required and
230
- reasonable, without reducing the scope of the rights granted by the Licence. New
231
- versions of the Licence will be published with a unique version number.
232
-
233
- All linguistic versions of this Licence, approved by the European Commission, have
234
- identical value. Parties can take advantage of the linguistic version of their choice.
235
-
236
- 14. Jurisdiction
237
-
238
- Without prejudice to specific agreement between parties,
239
- - any litigation resulting from the interpretation of this License, arising between the
240
- European Union institutions, bodies, offices or agencies, as a Licensor, and any
241
- Licensee, will be subject to the jurisdiction of the Court of Justice of the European
242
- Union, as laid down in article 272 of the Treaty on the Functioning of the European
243
- Union,
244
- - any litigation arising between other parties and resulting from the interpretation of
245
- this License, will be subject to the exclusive jurisdiction of the competent court
246
- where the Licensor resides or conducts its primary business.
247
-
248
- 15. Applicable Law
249
-
250
- Without prejudice to specific agreement between parties,
251
- - this Licence shall be governed by the law of the European Union Member State
252
- where the Licensor has his seat, resides or has his registered office,
253
- - this licence shall be governed by Belgian law if the Licensor has no seat, residence
254
- or registered office inside a European Union Member State.
255
-
256
- ===
257
-
258
-
259
- Appendix
260
-
261
-
262
-
263
- “Compatible Licences” according to Article 5 EUPL are:
264
-
265
-
266
- - GNU General Public License (GPL) v. 2, v. 3
267
-
268
- - GNU Affero General Public License (AGPL) v. 3
269
-
270
- - Open Software License (OSL) v. 2.1, v. 3.0
271
-
272
- - Eclipse Public License (EPL) v. 1.0
273
-
274
- - Cecill v. 2.0, v. 2.1
275
-
276
- - Mozilla Public Licence (MPL) v. 2
277
-
278
- - GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
279
-
280
- - Creative Commons Attribution-ShareAlike v. 3.0 Unported
281
- (CC BY-SA 3.0) for works other than software
282
-
283
- - European Union Public Licence (EUPL)v. 1.1, v. 1.2
284
-
285
- - The European Commission may update this Appendix to later versions of
286
- the above licences without producing a new version of the EUPL, as long
287
- as they provide the rights granted in Article 2 of this Licence and protect
288
- the covered Source Code from exclusive appropriation.
289
- - All other changes or additions to this Appendix require the production of a
290
- new EUPL version.
291
-