@rio-cloud/cdk-v2-constructs 9.0.0-alpha.8 → 9.0.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.
Files changed (33) hide show
  1. package/.jsii +883 -183
  2. package/README.md +65 -0
  3. package/docs/AGENTS_DOCUMENTATION.md +20 -203
  4. package/lib/fargate/datadog.d.ts +4 -1
  5. package/lib/fargate/datadog.js +6 -3
  6. package/lib/fargate/rio-fargate-service-blue-green-alpha.js +6 -1
  7. package/lib/fargate/rio-fargate-service.d.ts +22 -1
  8. package/lib/fargate/rio-fargate-service.js +11 -2
  9. package/lib/fargate/trace-sampling.d.ts +87 -0
  10. package/lib/fargate/trace-sampling.js +123 -0
  11. package/lib/sbom-catalog/lambda/handler.cjs +38 -1
  12. package/node_modules/zod/package.json +1 -1
  13. package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  14. package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  15. package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  16. package/node_modules/zod/src/v4/core/compile.ts +9 -0
  17. package/node_modules/zod/src/v4/core/schemas.ts +35 -1
  18. package/node_modules/zod/src/v4/core/util.ts +13 -0
  19. package/node_modules/zod/src/v4/core/versions.ts +1 -1
  20. package/node_modules/zod/v4/core/compile.cjs +8 -0
  21. package/node_modules/zod/v4/core/compile.js +8 -0
  22. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  23. package/node_modules/zod/v4/core/schemas.d.cts +3 -1
  24. package/node_modules/zod/v4/core/schemas.d.ts +3 -1
  25. package/node_modules/zod/v4/core/schemas.js +30 -0
  26. package/node_modules/zod/v4/core/util.cjs +15 -0
  27. package/node_modules/zod/v4/core/util.d.cts +2 -0
  28. package/node_modules/zod/v4/core/util.d.ts +2 -0
  29. package/node_modules/zod/v4/core/util.js +14 -0
  30. package/node_modules/zod/v4/core/versions.cjs +1 -1
  31. package/node_modules/zod/v4/core/versions.js +1 -1
  32. package/package.json +1 -1
  33. package/version.json +1 -1
@@ -834,8 +834,10 @@ export type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Val
834
834
  export type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<core.input<Key> & PropertyKey, core.input<Value>>> : [
835
835
  Value
836
836
  ] extends [OptionalInSchema] ? Partial<Record<core.input<Key> & PropertyKey, core.input<Value>>> : Record<core.input<Key> & PropertyKey, core.input<Value>>;
837
- export interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
837
+ export interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals {
838
838
  def: $ZodRecordDef<Key, Value>;
839
+ output: $InferZodRecordOutput<Key, Value>;
840
+ input: $InferZodRecordInput<Key, Value>;
839
841
  isst: errors.$ZodIssueInvalidType | errors.$ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
840
842
  optin?: "optional" | undefined;
841
843
  optout?: "optional" | undefined;
@@ -816,6 +816,33 @@ export const $ZodDate = /*@__PURE__*/ core.$constructor("$ZodDate", (inst, def)
816
816
  return payload;
817
817
  };
818
818
  });
819
+ // an oversized container fails its leading size checks before any element is parsed
820
+ function capSize(inst, size) {
821
+ const caps = util.sizeCaps(inst._zod.def.checks);
822
+ if (!caps.length)
823
+ return;
824
+ const cap = Math.min(...caps.map((c) => c[0]));
825
+ const parse = inst._zod.parse;
826
+ inst._zod.parse = (payload, ctx) => {
827
+ const n = size(payload.value);
828
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
829
+ for (const [max, ch] of util.sizeCaps(inst._zod.def.checks)) {
830
+ if (n > max && ch._zod.def.when(payload)) {
831
+ const start = payload.issues.length;
832
+ ch._zod.check(payload);
833
+ // the value is still the raw input, so no later check may read it
834
+ payload.issues[start].continue = false;
835
+ util.attachSchema(payload.issues, start, inst);
836
+ return payload;
837
+ }
838
+ }
839
+ }
840
+ return parse(payload, ctx);
841
+ };
842
+ }
843
+ const arraySize = (input) => (Array.isArray(input) ? input.length : -1);
844
+ const mapSize = (input) => (input instanceof Map ? input.size : -1);
845
+ const setSize = (input) => (input instanceof Set ? input.size : -1);
819
846
  function handleArrayResult(result, final, index) {
820
847
  if (result.issues.length) {
821
848
  final.issues.push(...util.prefixIssues(index, result.issues));
@@ -861,6 +888,7 @@ export const $ZodArray = /*@__PURE__*/ core.$constructor("$ZodArray", (inst, def
861
888
  }
862
889
  return payload; //handleArrayResultsAsync(parseResults, final);
863
890
  };
891
+ capSize(inst, arraySize);
864
892
  });
865
893
  function handlePropertyResult(result, final, key, input, optin, optout) {
866
894
  const isPresent = key in input;
@@ -1898,6 +1926,7 @@ export const $ZodMap = /*@__PURE__*/ core.$constructor("$ZodMap", (inst, def) =>
1898
1926
  return Promise.all(proms).then(() => payload);
1899
1927
  return payload;
1900
1928
  };
1929
+ capSize(inst, mapSize);
1901
1930
  });
1902
1931
  function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
1903
1932
  if (keyResult.issues.length) {
@@ -1967,6 +1996,7 @@ export const $ZodSet = /*@__PURE__*/ core.$constructor("$ZodSet", (inst, def) =>
1967
1996
  return Promise.all(proms).then(() => payload);
1968
1997
  return payload;
1969
1998
  };
1999
+ capSize(inst, setSize);
1970
2000
  });
1971
2001
  function handleSetResult(result, final) {
1972
2002
  if (result.issues.length) {
@@ -46,6 +46,7 @@ exports.aborted = aborted;
46
46
  exports.explicitlyAborted = explicitlyAborted;
47
47
  exports.prefixIssues = prefixIssues;
48
48
  exports.unwrapMessage = unwrapMessage;
49
+ exports.sizeCaps = sizeCaps;
49
50
  exports.attachSchema = attachSchema;
50
51
  exports.finalizeIssue = finalizeIssue;
51
52
  exports.getSizableOrigin = getSizableOrigin;
@@ -620,6 +621,20 @@ function unwrapMessage(message) {
620
621
  return typeof message === "string" ? message : message?.message;
621
622
  }
622
623
  /* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */
624
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
625
+ function sizeCaps(defChecks) {
626
+ const caps = [];
627
+ for (const ch of defChecks ?? []) {
628
+ const d = ch._zod.def;
629
+ // a later check may rewrite the value
630
+ if (!/_(length|size)$|_equals$/.test(d.check))
631
+ break;
632
+ const max = d.maximum ?? d.length ?? d.size;
633
+ if (max >= 0)
634
+ caps.push([max, ch]);
635
+ }
636
+ return caps;
637
+ }
623
638
  function attachSchema(issues, start, inst) {
624
639
  var _a;
625
640
  for (let i = start; i < issues.length; i++) {
@@ -221,6 +221,8 @@ export declare function prefixIssues(path: PropertyKey, issues: errors.$ZodRawIs
221
221
  export declare function unwrapMessage(message: string | {
222
222
  message: string;
223
223
  } | undefined | null): string | undefined;
224
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
225
+ export declare function sizeCaps(defChecks: checks.$ZodCheck<never>[] | undefined): [number, checks.$ZodCheck<never>][];
224
226
  export declare function attachSchema(issues: errors.$ZodRawIssue[], start: number, inst: schemas.$ZodType): void;
225
227
  export declare function finalizeIssue(iss: errors.$ZodRawIssue, ctx: schemas.ParseContextInternal | undefined, config: $ZodConfig): errors.$ZodIssue;
226
228
  export declare function getSizableOrigin(input: any): "set" | "map" | "file" | "unknown";
@@ -221,6 +221,8 @@ export declare function prefixIssues(path: PropertyKey, issues: errors.$ZodRawIs
221
221
  export declare function unwrapMessage(message: string | {
222
222
  message: string;
223
223
  } | undefined | null): string | undefined;
224
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
225
+ export declare function sizeCaps(defChecks: checks.$ZodCheck<never>[] | undefined): [number, checks.$ZodCheck<never>][];
224
226
  export declare function attachSchema(issues: errors.$ZodRawIssue[], start: number, inst: schemas.$ZodType): void;
225
227
  export declare function finalizeIssue(iss: errors.$ZodRawIssue, ctx: schemas.ParseContextInternal | undefined, config: $ZodConfig): errors.$ZodIssue;
226
228
  export declare function getSizableOrigin(input: any): "set" | "map" | "file" | "unknown";
@@ -550,6 +550,20 @@ export function unwrapMessage(message) {
550
550
  return typeof message === "string" ? message : message?.message;
551
551
  }
552
552
  /* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */
553
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
554
+ export function sizeCaps(defChecks) {
555
+ const caps = [];
556
+ for (const ch of defChecks ?? []) {
557
+ const d = ch._zod.def;
558
+ // a later check may rewrite the value
559
+ if (!/_(length|size)$|_equals$/.test(d.check))
560
+ break;
561
+ const max = d.maximum ?? d.length ?? d.size;
562
+ if (max >= 0)
563
+ caps.push([max, ch]);
564
+ }
565
+ return caps;
566
+ }
553
567
  export function attachSchema(issues, start, inst) {
554
568
  var _a;
555
569
  for (let i = start; i < issues.length; i++) {
@@ -4,7 +4,7 @@ exports.version = void 0;
4
4
  exports.version = {
5
5
  major: 4,
6
6
  minor: 6,
7
- patch: 5,
7
+ patch: 7,
8
8
  };
9
9
 
10
10
  // seal-cjs-exports
@@ -1,5 +1,5 @@
1
1
  export const version = {
2
2
  major: 4,
3
3
  minor: 6,
4
- patch: 5,
4
+ patch: 7,
5
5
  };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "main": "lib/index.js",
17
17
  "license": "Apache-2.0",
18
- "version": "9.0.0-alpha.8",
18
+ "version": "9.0.0",
19
19
  "types": "lib/index.d.ts",
20
20
  "stability": "stable",
21
21
  "exports": {
package/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "9.0.0-alpha.8"
2
+ "version": "9.0.0"
3
3
  }