cloudstructs 0.5.6 → 0.5.9

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.
Files changed (61) hide show
  1. package/.jsii +3 -3
  2. package/assets/slack-app/provider.lambda/index.js +40 -21
  3. package/assets/slack-events/events.lambda/index.js +4 -1
  4. package/assets/slack-textract/detect.lambda/index.js +153 -53
  5. package/assets/static-website/origin-request.edge-lambda/index.js +4 -1
  6. package/assets/toolkit-cleaner/clean-objects.lambda/index.js +4 -1
  7. package/lib/codecommit-mirror/index.js +2 -2
  8. package/lib/ecs-service-roller/index.js +2 -2
  9. package/lib/email-receiver/receiver.js +1 -1
  10. package/lib/email-receiver/s3-function.js +2 -2
  11. package/lib/email-receiver/whitelist-function.js +2 -2
  12. package/lib/saml-identity-provider/index.js +2 -2
  13. package/lib/slack-app/manifest.js +1 -1
  14. package/lib/slack-app/provider-function.js +2 -2
  15. package/lib/slack-app/slack-app.js +2 -2
  16. package/lib/slack-events/events-function.js +2 -2
  17. package/lib/slack-events/index.js +1 -1
  18. package/lib/slack-textract/detect-function.js +2 -2
  19. package/lib/slack-textract/index.js +1 -1
  20. package/lib/state-machine-cr-provider/index.js +1 -1
  21. package/lib/static-website/index.js +1 -1
  22. package/lib/static-website/origin-request-function.js +2 -2
  23. package/lib/toolkit-cleaner/clean-images-function.js +2 -2
  24. package/lib/toolkit-cleaner/clean-objects-function.js +2 -2
  25. package/lib/toolkit-cleaner/extract-template-hashes-function.js +2 -2
  26. package/lib/toolkit-cleaner/get-stack-names-function.js +2 -2
  27. package/lib/toolkit-cleaner/index.js +1 -1
  28. package/lib/url-shortener/index.js +1 -1
  29. package/lib/url-shortener/redirect-function.js +2 -2
  30. package/lib/url-shortener/shortener-function.js +2 -2
  31. package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
  32. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +1 -1
  33. package/node_modules/@slack/logger/node_modules/@types/node/package.json +2 -2
  34. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +12 -0
  35. package/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +146 -112
  36. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  37. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +1 -1
  38. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  39. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +12 -0
  40. package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +146 -112
  41. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  42. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +1 -1
  43. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +2 -2
  44. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +12 -0
  45. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +146 -112
  46. package/node_modules/@types/is-stream/node_modules/@types/node/README.md +1 -1
  47. package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +1 -1
  48. package/node_modules/@types/is-stream/node_modules/@types/node/package.json +2 -2
  49. package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +12 -0
  50. package/node_modules/@types/is-stream/node_modules/@types/node/test.d.ts +146 -112
  51. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  52. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +1 -1
  53. package/node_modules/@types/keyv/node_modules/@types/node/package.json +2 -2
  54. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +12 -0
  55. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +146 -112
  56. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  57. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +1 -1
  58. package/node_modules/@types/responselike/node_modules/@types/node/package.json +2 -2
  59. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +12 -0
  60. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +146 -112
  61. package/package.json +8 -8
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.0.6",
3
+ "version": "18.6.1",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  },
221
221
  "scripts": {},
222
222
  "dependencies": {},
223
- "typesPublisherContentHash": "66f1b140a3a1f77d215036a5818c51674db9998bb96d0ae9b251d09f2825200e",
223
+ "typesPublisherContentHash": "44e628c188a3b958cbf3478d419ce6106d591da55cf4b80f1d8dffa1caae8bf2",
224
224
  "typeScriptVersion": "4.0"
225
225
  }
@@ -519,6 +519,18 @@ declare module 'stream' {
519
519
  * @since v0.9.4
520
520
  */
521
521
  class Writable extends Stream implements NodeJS.WritableStream {
522
+ /**
523
+ * A utility method for creating a `Writable` from a web `WritableStream`.
524
+ * @since v17.0.0
525
+ * @experimental
526
+ */
527
+ static fromWeb(writableStream: streamWeb.WritableStream, options?: Pick<WritableOptions, 'decodeStrings' | 'highWaterMark' | 'objectMode' | 'signal'>): Writable;
528
+ /**
529
+ * A utility method for creating a web `WritableStream` from a `Writable`.
530
+ * @since v17.0.0
531
+ * @experimental
532
+ */
533
+ static toWeb(streamWritable: Writable): streamWeb.WritableStream;
522
534
  /**
523
535
  * Is `true` if it is safe to call `writable.write()`, which means
524
536
  * the stream has not been destroyed, errored or ended.
@@ -3,140 +3,174 @@
3
3
  * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/test.js)
4
4
  */
5
5
  declare module 'node:test' {
6
- /**
7
- * The `test()` function is the value imported from the test module. Each invocation of this
8
- * function results in the creation of a test point in the TAP output.
9
- *
10
- * The {@link TestContext} object passed to the fn argument can be used to perform actions
11
- * related to the current test. Examples include skipping the test, adding additional TAP
12
- * diagnostic information, or creating subtests.
13
- *
14
- * `test()` returns a {@link Promise} that resolves once the test completes. The return value
15
- * can usually be discarded for top level tests. However, the return value from subtests should
16
- * be used to prevent the parent test from finishing first and cancelling the subtest as shown
17
- * in the following example.
18
- *
19
- * ```js
20
- * test('top level test', async (t) => {
21
- * // The setTimeout() in the following subtest would cause it to outlive its
22
- * // parent test if 'await' is removed on the next line. Once the parent test
23
- * // completes, it will cancel any outstanding subtests.
24
- * await t.test('longer running subtest', async (t) => {
25
- * return new Promise((resolve, reject) => {
26
- * setTimeout(resolve, 1000);
27
- * });
28
- * });
29
- * });
30
- * ```
31
- * @since v18.0.0
32
- * @param name The name of the test, which is displayed when reporting test results.
33
- * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
34
- * @param options Configuration options for the test
35
- * @param fn The function under test. This first argument to this function is a
36
- * {@link TestContext} object. If the test uses callbacks, the callback function is
37
- * passed as the second argument. Default: A no-op function.
38
- * @returns A {@link Promise} resolved with `undefined` once the test completes.
39
- */
40
- function test(name?: string, fn?: TestFn): Promise<void>;
41
- function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
42
- function test(options?: TestOptions, fn?: TestFn): Promise<void>;
43
- function test(fn?: TestFn): Promise<void>;
44
-
45
- /**
46
- * The type of a function under test. This first argument to this function is a
47
- * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
48
- * the second argument.
49
- */
50
- type TestFn = ((t: TestContext, done: (result?: any) => void) => any);
51
-
52
- /**
53
- * An instance of `TestContext` is passed to each test function in order to interact with the
54
- * test runner. However, the `TestContext` constructor is not exposed as part of the API.
55
- * @since v18.0.0
56
- */
57
- interface TestContext {
58
- /**
59
- * This function is used to write TAP diagnostics to the output. Any diagnostic information is
60
- * included at the end of the test's results. This function does not return a value.
61
- * @param message Message to be displayed as a TAP diagnostic.
62
- * @since v18.0.0
63
- */
64
- diagnostic(message: string): void;
65
-
66
- /**
67
- * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
68
- * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
69
- * command-line option, this function is a no-op.
70
- * @param shouldRunOnlyTests Whether or not to run `only` tests.
71
- * @since v18.0.0
72
- */
73
- runOnly(shouldRunOnlyTests: boolean): void;
74
-
75
6
  /**
76
- * This function causes the test's output to indicate the test as skipped. If `message` is
77
- * provided, it is included in the TAP output. Calling `skip()` does not terminate execution of
78
- * the test function. This function does not return a value.
79
- * @param message Optional skip message to be displayed in TAP output.
7
+ * The `test()` function is the value imported from the test module. Each invocation of this
8
+ * function results in the creation of a test point in the TAP output.
9
+ *
10
+ * The {@link TestContext} object passed to the fn argument can be used to perform actions
11
+ * related to the current test. Examples include skipping the test, adding additional TAP
12
+ * diagnostic information, or creating subtests.
13
+ *
14
+ * `test()` returns a {@link Promise} that resolves once the test completes. The return value
15
+ * can usually be discarded for top level tests. However, the return value from subtests should
16
+ * be used to prevent the parent test from finishing first and cancelling the subtest as shown
17
+ * in the following example.
18
+ *
19
+ * ```js
20
+ * test('top level test', async (t) => {
21
+ * // The setTimeout() in the following subtest would cause it to outlive its
22
+ * // parent test if 'await' is removed on the next line. Once the parent test
23
+ * // completes, it will cancel any outstanding subtests.
24
+ * await t.test('longer running subtest', async (t) => {
25
+ * return new Promise((resolve, reject) => {
26
+ * setTimeout(resolve, 1000);
27
+ * });
28
+ * });
29
+ * });
30
+ * ```
80
31
  * @since v18.0.0
32
+ * @param name The name of the test, which is displayed when reporting test results.
33
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
34
+ * @param options Configuration options for the test
35
+ * @param fn The function under test. The first argument to this function is a
36
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
37
+ * passed as the second argument. Default: A no-op function.
38
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
81
39
  */
82
- skip(message?: string): void;
40
+ function test(name?: string, fn?: TestFn): Promise<void>;
41
+ function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
42
+ function test(options?: TestOptions, fn?: TestFn): Promise<void>;
43
+ function test(fn?: TestFn): Promise<void>;
83
44
 
84
- /**
85
- * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
86
- * included in the TAP output. Calling `todo()` does not terminate execution of the test
87
- * function. This function does not return a value.
88
- * @param message Optional `TODO` message to be displayed in TAP output.
89
- * @since v18.0.0
45
+ /*
46
+ * @since v18.6.0
47
+ * @param name The name of the suite, which is displayed when reporting suite results.
48
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
49
+ * @param options Configuration options for the suite
50
+ * @param fn The function under suite. Default: A no-op function.
90
51
  */
91
- todo(message?: string): void;
52
+ function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void;
53
+ function describe(name?: string, fn?: SuiteFn): void;
54
+ function describe(options?: TestOptions, fn?: SuiteFn): void;
55
+ function describe(fn?: SuiteFn): void;
92
56
 
93
- /**
94
- * This function is used to create subtests under the current test. This function behaves in
95
- * the same fashion as the top level {@link test} function.
96
- * @since v18.0.0
57
+ /*
58
+ * @since v18.6.0
97
59
  * @param name The name of the test, which is displayed when reporting test results.
98
60
  * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
99
61
  * @param options Configuration options for the test
100
- * @param fn The function under test. This first argument to this function is a
101
- * {@link TestContext} object. If the test uses callbacks, the callback function is
62
+ * @param fn The function under test. If the test uses callbacks, the callback function is
102
63
  * passed as the second argument. Default: A no-op function.
103
- * @returns A {@link Promise} resolved with `undefined` once the test completes.
104
64
  */
105
- test: typeof test;
106
- }
65
+ function it(name?: string, options?: TestOptions, fn?: ItFn): void;
66
+ function it(name?: string, fn?: ItFn): void;
67
+ function it(options?: TestOptions, fn?: ItFn): void;
68
+ function it(fn?: ItFn): void;
107
69
 
108
- interface TestOptions {
109
70
  /**
110
- * The number of tests that can be run at the same time. If unspecified, subtests inherit this
111
- * value from their parent.
112
- * @default 1
71
+ * The type of a function under test. The first argument to this function is a
72
+ * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
73
+ * the second argument.
113
74
  */
114
- concurrency?: number;
75
+ type TestFn = (t: TestContext, done: (result?: any) => void) => any;
115
76
 
116
77
  /**
117
- * If truthy, and the test context is configured to run `only` tests, then this test will be
118
- * run. Otherwise, the test is skipped.
119
- * @default false
78
+ * The type of a function under Suite.
79
+ * If the test uses callbacks, the callback function is passed as an argument
120
80
  */
121
- only?: boolean;
81
+ type SuiteFn = (done: (result?: any) => void) => void;
122
82
 
123
83
  /**
124
- * If truthy, the test is skipped. If a string is provided, that string is displayed in the
125
- * test results as the reason for skipping the test.
126
- * @default false
84
+ * The type of a function under test.
85
+ * If the test uses callbacks, the callback function is passed as an argument
127
86
  */
128
- skip?: boolean | string;
87
+ type ItFn = (done: (result?: any) => void) => any;
129
88
 
130
89
  /**
131
- * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
132
- * the test results as the reason why the test is `TODO`.
133
- * @default false
90
+ * An instance of `TestContext` is passed to each test function in order to interact with the
91
+ * test runner. However, the `TestContext` constructor is not exposed as part of the API.
92
+ * @since v18.0.0
134
93
  */
135
- todo?: boolean | string;
136
- }
94
+ interface TestContext {
95
+ /**
96
+ * This function is used to write TAP diagnostics to the output. Any diagnostic information is
97
+ * included at the end of the test's results. This function does not return a value.
98
+ * @param message Message to be displayed as a TAP diagnostic.
99
+ * @since v18.0.0
100
+ */
101
+ diagnostic(message: string): void;
102
+
103
+ /**
104
+ * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
105
+ * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
106
+ * command-line option, this function is a no-op.
107
+ * @param shouldRunOnlyTests Whether or not to run `only` tests.
108
+ * @since v18.0.0
109
+ */
110
+ runOnly(shouldRunOnlyTests: boolean): void;
111
+
112
+ /**
113
+ * This function causes the test's output to indicate the test as skipped. If `message` is
114
+ * provided, it is included in the TAP output. Calling `skip()` does not terminate execution of
115
+ * the test function. This function does not return a value.
116
+ * @param message Optional skip message to be displayed in TAP output.
117
+ * @since v18.0.0
118
+ */
119
+ skip(message?: string): void;
120
+
121
+ /**
122
+ * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
123
+ * included in the TAP output. Calling `todo()` does not terminate execution of the test
124
+ * function. This function does not return a value.
125
+ * @param message Optional `TODO` message to be displayed in TAP output.
126
+ * @since v18.0.0
127
+ */
128
+ todo(message?: string): void;
129
+
130
+ /**
131
+ * This function is used to create subtests under the current test. This function behaves in
132
+ * the same fashion as the top level {@link test} function.
133
+ * @since v18.0.0
134
+ * @param name The name of the test, which is displayed when reporting test results.
135
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
136
+ * @param options Configuration options for the test
137
+ * @param fn The function under test. This first argument to this function is a
138
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
139
+ * passed as the second argument. Default: A no-op function.
140
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
141
+ */
142
+ test: typeof test;
143
+ }
144
+
145
+ interface TestOptions {
146
+ /**
147
+ * The number of tests that can be run at the same time. If unspecified, subtests inherit this
148
+ * value from their parent.
149
+ * @default 1
150
+ */
151
+ concurrency?: number;
152
+
153
+ /**
154
+ * If truthy, and the test context is configured to run `only` tests, then this test will be
155
+ * run. Otherwise, the test is skipped.
156
+ * @default false
157
+ */
158
+ only?: boolean;
159
+
160
+ /**
161
+ * If truthy, the test is skipped. If a string is provided, that string is displayed in the
162
+ * test results as the reason for skipping the test.
163
+ * @default false
164
+ */
165
+ skip?: boolean | string;
166
+
167
+ /**
168
+ * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
169
+ * the test results as the reason why the test is `TODO`.
170
+ * @default false
171
+ */
172
+ todo?: boolean | string;
173
+ }
137
174
 
138
- export {
139
- test as default,
140
- test,
141
- };
175
+ export { test as default, test, describe, it };
142
176
  }
package/package.json CHANGED
@@ -90,24 +90,24 @@
90
90
  "@typescript-eslint/parser": "^5",
91
91
  "aws-cdk": "^2",
92
92
  "aws-cdk-lib": "2.1.0",
93
- "aws-sdk": "^2.1177.0",
93
+ "aws-sdk": "^2.1182.0",
94
94
  "aws-sdk-mock": "^5.7.0",
95
95
  "constructs": "10.0.5",
96
- "esbuild": "^0.14.49",
96
+ "esbuild": "^0.14.50",
97
97
  "eslint": "^8",
98
98
  "eslint-import-resolver-node": "^0.3.6",
99
99
  "eslint-import-resolver-typescript": "^2.7.1",
100
100
  "eslint-plugin-import": "^2.26.0",
101
101
  "jest": "^27",
102
102
  "jest-junit": "^13",
103
- "jsii": "^1.62.0",
104
- "jsii-diff": "^1.62.0",
103
+ "jsii": "^1.63.0",
104
+ "jsii-diff": "^1.63.0",
105
105
  "jsii-docgen": "^1.8.110",
106
- "jsii-pacmak": "^1.62.0",
106
+ "jsii-pacmak": "^1.63.0",
107
107
  "json-schema": "^0.4.0",
108
- "nock": "^13.2.8",
108
+ "nock": "^13.2.9",
109
109
  "npm-check-updates": "^15",
110
- "projen": "^0.58.36",
110
+ "projen": "^0.60.4",
111
111
  "standard-version": "^9",
112
112
  "ts-jest": "^27",
113
113
  "ts-node": "^10.9.1",
@@ -132,7 +132,7 @@
132
132
  ],
133
133
  "main": "lib/index.js",
134
134
  "license": "Apache-2.0",
135
- "version": "0.5.6",
135
+ "version": "0.5.9",
136
136
  "jest": {
137
137
  "testMatch": [
138
138
  "<rootDir>/src/**/__tests__/**/*.ts?(x)",