@digitraffic/common 2024.10.25-1 → 2024.11.29-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/README.md CHANGED
@@ -72,3 +72,4 @@ const lambda = MonitoredDBFunction.create(stack, 'get-metadata');
72
72
  ```
73
73
 
74
74
  See the documentation for more information.
75
+
@@ -43,7 +43,10 @@ describe("integration tests", () => {
43
43
  parseJson: (data) => JSON.stringify(data)
44
44
  },
45
45
  context: {
46
- c1: "context1"
46
+ c1: "context1",
47
+ authorizer: {
48
+ c2: "context2"
49
+ }
47
50
  }
48
51
  });
49
52
  }
@@ -113,6 +116,14 @@ describe("integration tests", () => {
113
116
  c1: "context1"
114
117
  });
115
118
  });
119
+ test("context parameter authorizer", () => {
120
+ const i = createIntegration()
121
+ .addContextParameter("authorizer.c2");
122
+ const t = createTemplate(i);
123
+ expect(t).toEqual({
124
+ "authorizer.c2": "context2"
125
+ });
126
+ });
116
127
  test("all parameters and header", () => {
117
128
  const i = createIntegration()
118
129
  .passAllQueryParameters()
@@ -81,7 +81,7 @@ export class DigitrafficIntegration {
81
81
  const parameterAssignments = [];
82
82
  this.parameters.forEach((parameter) => {
83
83
  if (parameter.type === "context") {
84
- parameterAssignments.push(`#set($tmp = $paramMap.put('${parameter.name}', $util.escapeJavaScript($context['${parameter.name}'])))`);
84
+ parameterAssignments.push(`#set($tmp = $paramMap.put('${parameter.name}', $util.escapeJavaScript($context.${parameter.name})))`);
85
85
  }
86
86
  else if (parameter.type === "multivaluequerystring") {
87
87
  // make multivaluequerystring values to array
@@ -125,10 +125,6 @@ async function retryRecursive(asyncFn, retries, retryCountInj, logError, timeout
125
125
  */
126
126
  export async function retry(asyncFn, retries = 3, logError = RetryLogError.LOG_LAST_RETRY_AS_ERROR_OTHERS_AS_WARNS, timeoutBetweenRetries = timeoutFunctions.noTimeout, retryPredicate = retryPredicates.alwaysRetry) {
127
127
  retryCount = 0;
128
- logger.debug({
129
- message: `Retrying with ${retries} retries`,
130
- method: "retry.retry",
131
- });
132
128
  return retryRecursive(asyncFn, retries, 0, logError, timeoutBetweenRetries, retryPredicate);
133
129
  }
134
130
  function wrapArgsToFn(fn, ...args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitraffic/common",
3
- "version": "2024.10.25-1",
3
+ "version": "2024.11.29-1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "repository": {
@@ -104,57 +104,57 @@
104
104
  "./dist/aws/runtime/digitraffic-integration-response": "./dist/aws/runtime/digitraffic-integration-response.js"
105
105
  },
106
106
  "peerDependencies": {
107
- "@aws-sdk/client-api-gateway": "^3.667.0",
108
- "@aws-sdk/client-s3": "^3.667.0",
109
- "@aws-sdk/client-secrets-manager": "^3.667.0",
110
- "@aws-sdk/client-sns": "^3.667.0",
111
- "@aws-sdk/lib-storage": "^3.667.0",
107
+ "@aws-sdk/client-api-gateway": "^3.687.0",
108
+ "@aws-sdk/client-s3": "^3.687.0",
109
+ "@aws-sdk/client-secrets-manager": "^3.687.0",
110
+ "@aws-sdk/client-sns": "^3.687.0",
111
+ "@aws-sdk/lib-storage": "^3.687.0",
112
+ "@date-fns/tz": "1.2.0",
112
113
  "@smithy/fetch-http-handler": "3.2.9",
113
- "aws-cdk-lib": "^2.161.1",
114
+ "aws-cdk-lib": "^2.166.0",
114
115
  "change-case": "^5.4.4",
115
- "constructs": "~10.3.0",
116
+ "constructs": "~10.4.2",
116
117
  "date-fns": "~4.1.0",
117
- "@date-fns/tz": "1.1.2",
118
118
  "etag": "^1.8.1",
119
119
  "geojson-validation": "^1.0.2",
120
120
  "ky": "^1.7.2",
121
- "lodash-es": "~4.17.21",
121
+ "lodash-es": "^4.17.21",
122
122
  "node-ttl": "^0.2.0",
123
123
  "pg-native": "^3.2.0",
124
- "pg-promise": "^11.9.1",
125
- "zod": "~3.23.8"
124
+ "pg-promise": "^11.10.1",
125
+ "zod": "^3.23.8"
126
126
  },
127
127
  "devDependencies": {
128
- "@aws-sdk/client-api-gateway": "^3.669.0",
129
- "@aws-sdk/client-s3": "^3.669.0",
130
- "@aws-sdk/client-secrets-manager": "^3.669.0",
131
- "@aws-sdk/client-sns": "^3.669.0",
132
- "@aws-sdk/lib-storage": "^3.669.0",
128
+ "@aws-sdk/client-api-gateway": "^3.687.0",
129
+ "@aws-sdk/client-s3": "^3.687.0",
130
+ "@aws-sdk/client-secrets-manager": "^3.687.0",
131
+ "@aws-sdk/client-sns": "^3.687.0",
132
+ "@aws-sdk/lib-storage": "^3.687.0",
133
+ "@date-fns/tz": "1.2.0",
133
134
  "@digitraffic/eslint-config": "^3.0.1",
134
135
  "@jest/globals": "^29.7.0",
135
136
  "@rushstack/eslint-config": "^3.7.1",
136
- "@rushstack/heft": "^0.68.2",
137
- "@rushstack/heft-jest-plugin": "^0.12.14",
137
+ "@rushstack/heft": "^0.68.6",
138
+ "@rushstack/heft-jest-plugin": "^0.12.18",
138
139
  "@rushstack/heft-lint-plugin": "^0.5.0",
139
- "@rushstack/heft-typescript-plugin": "^0.5.30",
140
+ "@rushstack/heft-typescript-plugin": "^0.5.35",
140
141
  "@smithy/fetch-http-handler": "3.2.9",
141
142
  "@smithy/types": "^3.5.0",
142
143
  "@types/aws-lambda": "8.10.145",
143
144
  "@types/etag": "^1.8.3",
144
145
  "@types/geojson": "7946.0.14",
145
146
  "@types/geojson-validation": "^1.0.3",
146
- "@types/jest": "29.5.13",
147
+ "@types/jest": "29.5.14",
147
148
  "@types/lodash-es": "4.17.12",
148
149
  "@types/madge": "5.0.3",
149
- "@types/node": "20.14.9",
150
+ "@types/node": "20.17.6",
150
151
  "@typescript-eslint/eslint-plugin": "~7.14.1",
151
152
  "@typescript-eslint/parser": "^7.18.0",
152
- "aws-cdk-lib": "^2.162.0",
153
- "aws-sdk": "^2.1691.0",
153
+ "aws-cdk-lib": "^2.166.0",
154
+ "aws-sdk": "^2.1692.0",
154
155
  "change-case": "^5.4.4",
155
- "constructs": "~10.3.1",
156
+ "constructs": "~10.4.2",
156
157
  "date-fns": "~4.1.0",
157
- "@date-fns/tz": "1.1.2",
158
158
  "eslint": "^8.57.1",
159
159
  "eslint-config-prettier": "^9.1.0",
160
160
  "eslint-plugin-deprecation": "~3.0.0",
@@ -168,7 +168,7 @@
168
168
  "madge": "^8.0.0",
169
169
  "node-ttl": "^0.2.0",
170
170
  "pg-native": "^3.2.0",
171
- "pg-promise": "^11.9.1",
171
+ "pg-promise": "^11.10.1",
172
172
  "prettier": "^3.3.3",
173
173
  "rimraf": "^6.0.1",
174
174
  "ts-jest": "^29.2.5",