@xube/kit-destination 0.0.12 → 0.0.14

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/dist/confirm.js CHANGED
@@ -9,12 +9,13 @@ const isConfirmation = (headers, body, log = kit_log_1.XubeLog.getInstance()) =>
9
9
  log.info("Checking if confirmation request");
10
10
  log.info(JSON.stringify(headers));
11
11
  log.info(JSON.stringify(body));
12
- return (0, generated_1.isDestinationHeaders)(headers) &&
12
+ return ((0, generated_1.isDestinationHeaders)(headers) &&
13
13
  headers["x-amz-rules-engine-message-type"] === "DestinationConfirmation" &&
14
- (0, generated_1.isConfirmationRequest)(body);
14
+ (0, generated_1.isConfirmationRequest)(body));
15
15
  };
16
16
  exports.isConfirmation = isConfirmation;
17
17
  const confirmDestination = async (confirmationRequest, log = kit_log_1.XubeLog.getInstance()) => {
18
+ log.info("Attempting to confirm destination");
18
19
  const response = await fetch(confirmationRequest.enableUrl, {
19
20
  method: "GET",
20
21
  headers: {
@@ -28,6 +29,9 @@ const confirmDestination = async (confirmationRequest, log = kit_log_1.XubeLog.g
28
29
  error: "Failed to confirm destination",
29
30
  });
30
31
  }
32
+ else {
33
+ log.info("Successfully confirmed destination");
34
+ }
31
35
  return new kit_request_1.XubeResponse({
32
36
  statusCode: kit_constants_1.StatusCode.OK,
33
37
  data: true,
@@ -8,6 +8,5 @@
8
8
  export type DestinationHeaders = {
9
9
  "x-amz-rules-engine-message-type": "DestinationConfirmation" | string;
10
10
  "x-amz-rules-engine-destination-arn": string;
11
- "content-type": "application/json";
12
11
  };
13
12
  export declare const isDestinationHeaders: (item: unknown) => item is DestinationHeaders;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validate = void 0;
4
4
  exports.validate = validate10;
5
5
  exports.default = validate10;
6
- const schema27 = { "$ref": "#/definitions/destinationheadersJsonSchema", "definitions": { "destinationheadersJsonSchema": { "type": "object", "properties": { "x-amz-rules-engine-message-type": { "anyOf": [{ "type": "string", "const": "DestinationConfirmation" }, { "type": "string" }] }, "x-amz-rules-engine-destination-arn": { "type": "string" }, "content-type": { "type": "string", "const": "application/json" } }, "required": ["x-amz-rules-engine-message-type", "x-amz-rules-engine-destination-arn", "content-type"], "additionalProperties": false } }, "$schema": "http://json-schema.org/draft-07/schema#" };
7
- const schema28 = { "type": "object", "properties": { "x-amz-rules-engine-message-type": { "anyOf": [{ "type": "string", "const": "DestinationConfirmation" }, { "type": "string" }] }, "x-amz-rules-engine-destination-arn": { "type": "string" }, "content-type": { "type": "string", "const": "application/json" } }, "required": ["x-amz-rules-engine-message-type", "x-amz-rules-engine-destination-arn", "content-type"], "additionalProperties": false };
6
+ const schema27 = { "$ref": "#/definitions/destinationheadersJsonSchema", "definitions": { "destinationheadersJsonSchema": { "type": "object", "properties": { "x-amz-rules-engine-message-type": { "anyOf": [{ "type": "string", "const": "DestinationConfirmation" }, { "type": "string" }] }, "x-amz-rules-engine-destination-arn": { "type": "string" } }, "required": ["x-amz-rules-engine-message-type", "x-amz-rules-engine-destination-arn"], "additionalProperties": true } }, "$schema": "http://json-schema.org/draft-07/schema#" };
7
+ const schema28 = { "type": "object", "properties": { "x-amz-rules-engine-message-type": { "anyOf": [{ "type": "string", "const": "DestinationConfirmation" }, { "type": "string" }] }, "x-amz-rules-engine-destination-arn": { "type": "string" } }, "required": ["x-amz-rules-engine-message-type", "x-amz-rules-engine-destination-arn"], "additionalProperties": true };
8
8
  function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) {
9
9
  if (data["x-amz-rules-engine-message-type"] === undefined) {
10
10
  const err0 = { instancePath, schemaPath: "#/definitions/destinationheadersJsonSchema/required", keyword: "required", params: { missingProperty: "x-amz-rules-engine-message-type" }, message: "must have required property '" + "x-amz-rules-engine-message-type" + "'" };
@@ -26,50 +26,28 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
26
26
  }
27
27
  errors++;
28
28
  }
29
- if (data["content-type"] === undefined) {
30
- const err2 = { instancePath, schemaPath: "#/definitions/destinationheadersJsonSchema/required", keyword: "required", params: { missingProperty: "content-type" }, message: "must have required property '" + "content-type" + "'" };
31
- if (vErrors === null) {
32
- vErrors = [err2];
33
- }
34
- else {
35
- vErrors.push(err2);
36
- }
37
- errors++;
38
- }
39
- for (const key0 in data) {
40
- if (!(((key0 === "x-amz-rules-engine-message-type") || (key0 === "x-amz-rules-engine-destination-arn")) || (key0 === "content-type"))) {
41
- const err3 = { instancePath, schemaPath: "#/definitions/destinationheadersJsonSchema/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
42
- if (vErrors === null) {
43
- vErrors = [err3];
44
- }
45
- else {
46
- vErrors.push(err3);
47
- }
48
- errors++;
49
- }
50
- }
51
29
  if (data["x-amz-rules-engine-message-type"] !== undefined) {
52
30
  let data0 = data["x-amz-rules-engine-message-type"];
53
31
  const _errs4 = errors;
54
32
  let valid2 = false;
55
33
  const _errs5 = errors;
56
34
  if (typeof data0 !== "string") {
57
- const err4 = { instancePath: instancePath + "/x-amz-rules-engine-message-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
35
+ const err2 = { instancePath: instancePath + "/x-amz-rules-engine-message-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
58
36
  if (vErrors === null) {
59
- vErrors = [err4];
37
+ vErrors = [err2];
60
38
  }
61
39
  else {
62
- vErrors.push(err4);
40
+ vErrors.push(err2);
63
41
  }
64
42
  errors++;
65
43
  }
66
44
  if ("DestinationConfirmation" !== data0) {
67
- const err5 = { instancePath: instancePath + "/x-amz-rules-engine-message-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/0/const", keyword: "const", params: { allowedValue: "DestinationConfirmation" }, message: "must be equal to constant" };
45
+ const err3 = { instancePath: instancePath + "/x-amz-rules-engine-message-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/0/const", keyword: "const", params: { allowedValue: "DestinationConfirmation" }, message: "must be equal to constant" };
68
46
  if (vErrors === null) {
69
- vErrors = [err5];
47
+ vErrors = [err3];
70
48
  }
71
49
  else {
72
- vErrors.push(err5);
50
+ vErrors.push(err3);
73
51
  }
74
52
  errors++;
75
53
  }
@@ -78,12 +56,12 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
78
56
  if (!valid2) {
79
57
  const _errs7 = errors;
80
58
  if (typeof data0 !== "string") {
81
- const err6 = { instancePath: instancePath + "/x-amz-rules-engine-message-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/1/type", keyword: "type", params: { type: "string" }, message: "must be string" };
59
+ const err4 = { instancePath: instancePath + "/x-amz-rules-engine-message-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/1/type", keyword: "type", params: { type: "string" }, message: "must be string" };
82
60
  if (vErrors === null) {
83
- vErrors = [err6];
61
+ vErrors = [err4];
84
62
  }
85
63
  else {
86
- vErrors.push(err6);
64
+ vErrors.push(err4);
87
65
  }
88
66
  errors++;
89
67
  }
@@ -91,12 +69,12 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
91
69
  valid2 = valid2 || _valid0;
92
70
  }
93
71
  if (!valid2) {
94
- const err7 = { instancePath: instancePath + "/x-amz-rules-engine-message-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
72
+ const err5 = { instancePath: instancePath + "/x-amz-rules-engine-message-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
95
73
  if (vErrors === null) {
96
- vErrors = [err7];
74
+ vErrors = [err5];
97
75
  }
98
76
  else {
99
- vErrors.push(err7);
77
+ vErrors.push(err5);
100
78
  }
101
79
  errors++;
102
80
  }
@@ -114,47 +92,24 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
114
92
  }
115
93
  if (data["x-amz-rules-engine-destination-arn"] !== undefined) {
116
94
  if (typeof data["x-amz-rules-engine-destination-arn"] !== "string") {
117
- const err8 = { instancePath: instancePath + "/x-amz-rules-engine-destination-arn", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-destination-arn/type", keyword: "type", params: { type: "string" }, message: "must be string" };
118
- if (vErrors === null) {
119
- vErrors = [err8];
120
- }
121
- else {
122
- vErrors.push(err8);
123
- }
124
- errors++;
125
- }
126
- }
127
- if (data["content-type"] !== undefined) {
128
- let data2 = data["content-type"];
129
- if (typeof data2 !== "string") {
130
- const err9 = { instancePath: instancePath + "/content-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/content-type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
131
- if (vErrors === null) {
132
- vErrors = [err9];
133
- }
134
- else {
135
- vErrors.push(err9);
136
- }
137
- errors++;
138
- }
139
- if ("application/json" !== data2) {
140
- const err10 = { instancePath: instancePath + "/content-type", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/content-type/const", keyword: "const", params: { allowedValue: "application/json" }, message: "must be equal to constant" };
95
+ const err6 = { instancePath: instancePath + "/x-amz-rules-engine-destination-arn", schemaPath: "#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-destination-arn/type", keyword: "type", params: { type: "string" }, message: "must be string" };
141
96
  if (vErrors === null) {
142
- vErrors = [err10];
97
+ vErrors = [err6];
143
98
  }
144
99
  else {
145
- vErrors.push(err10);
100
+ vErrors.push(err6);
146
101
  }
147
102
  errors++;
148
103
  }
149
104
  }
150
105
  }
151
106
  else {
152
- const err11 = { instancePath, schemaPath: "#/definitions/destinationheadersJsonSchema/type", keyword: "type", params: { type: "object" }, message: "must be object" };
107
+ const err7 = { instancePath, schemaPath: "#/definitions/destinationheadersJsonSchema/type", keyword: "type", params: { type: "object" }, message: "must be object" };
153
108
  if (vErrors === null) {
154
- vErrors = [err11];
109
+ vErrors = [err7];
155
110
  }
156
111
  else {
157
- vErrors.push(err11);
112
+ vErrors.push(err7);
158
113
  }
159
114
  errors++;
160
115
  } validate10.errors = vErrors; return errors === 0; }
@@ -2,13 +2,10 @@ import { z } from "zod";
2
2
  export declare const DestinationHeadersSchema: z.ZodObject<{
3
3
  "x-amz-rules-engine-message-type": z.ZodUnion<[z.ZodLiteral<"DestinationConfirmation">, z.ZodString]>;
4
4
  "x-amz-rules-engine-destination-arn": z.ZodString;
5
- "content-type": z.ZodLiteral<"application/json">;
6
- }, "strip", z.ZodTypeAny, {
7
- "x-amz-rules-engine-message-type": string;
8
- "x-amz-rules-engine-destination-arn": string;
9
- "content-type": "application/json";
10
- }, {
11
- "x-amz-rules-engine-message-type": string;
12
- "x-amz-rules-engine-destination-arn": string;
13
- "content-type": "application/json";
14
- }>;
5
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6
+ "x-amz-rules-engine-message-type": z.ZodUnion<[z.ZodLiteral<"DestinationConfirmation">, z.ZodString]>;
7
+ "x-amz-rules-engine-destination-arn": z.ZodString;
8
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
9
+ "x-amz-rules-engine-message-type": z.ZodUnion<[z.ZodLiteral<"DestinationConfirmation">, z.ZodString]>;
10
+ "x-amz-rules-engine-destination-arn": z.ZodString;
11
+ }, z.ZodTypeAny, "passthrough">>;
@@ -6,5 +6,4 @@ const constants_1 = require("../constants");
6
6
  exports.DestinationHeadersSchema = zod_1.z.object({
7
7
  "x-amz-rules-engine-message-type": constants_1.RulesEngineMessageTypesSchema,
8
8
  "x-amz-rules-engine-destination-arn": zod_1.z.string(),
9
- "content-type": zod_1.z.literal("application/json"),
10
- });
9
+ }).nonstrict();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-destination",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -19,13 +19,13 @@
19
19
  "homepage": "https://github.com/XubeLtd/dev-kit#readme",
20
20
  "devDependencies": {
21
21
  "@types/node": "^20.4.7",
22
- "@xube/kit-build": "^0.0.12",
22
+ "@xube/kit-build": "^0.0.14",
23
23
  "ts-node": "^10.9.1",
24
24
  "typescript": "^5.1.6"
25
25
  },
26
26
  "dependencies": {
27
- "@xube/kit-generator": "^0.0.12",
28
- "@xube/kit-log": "^0.0.12",
29
- "@xube/kit-request": "^0.0.12"
27
+ "@xube/kit-generator": "^0.0.14",
28
+ "@xube/kit-log": "^0.0.14",
29
+ "@xube/kit-request": "^0.0.14"
30
30
  }
31
31
  }
package/src/confirm.ts CHANGED
@@ -11,21 +11,24 @@ export const isConfirmation = (
11
11
  headers: Record<string, any>,
12
12
  body: Record<string, any>,
13
13
  log: XubeLog = XubeLog.getInstance()
14
- ): boolean =>{
15
-
14
+ ): boolean => {
16
15
  log.info("Checking if confirmation request");
17
16
 
18
17
  log.info(JSON.stringify(headers));
19
18
  log.info(JSON.stringify(body));
20
19
 
21
- return isDestinationHeaders(headers) &&
22
- headers["x-amz-rules-engine-message-type"] === "DestinationConfirmation" &&
23
- isConfirmationRequest(body);}
20
+ return (
21
+ isDestinationHeaders(headers) &&
22
+ headers["x-amz-rules-engine-message-type"] === "DestinationConfirmation" &&
23
+ isConfirmationRequest(body)
24
+ );
25
+ };
24
26
 
25
27
  export const confirmDestination = async (
26
28
  confirmationRequest: ConfirmationRequest,
27
29
  log: XubeLog = XubeLog.getInstance()
28
30
  ): Promise<XubeResponse<boolean>> => {
31
+ log.info("Attempting to confirm destination");
29
32
  const response = await fetch(confirmationRequest.enableUrl, {
30
33
  method: "GET",
31
34
  headers: {
@@ -39,6 +42,8 @@ export const confirmDestination = async (
39
42
  statusCode: StatusCode.BadRequest,
40
43
  error: "Failed to confirm destination",
41
44
  });
45
+ } else {
46
+ log.info("Successfully confirmed destination");
42
47
  }
43
48
  return new XubeResponse({
44
49
  statusCode: StatusCode.OK,
@@ -10,7 +10,6 @@
10
10
  export type DestinationHeaders = {
11
11
  "x-amz-rules-engine-message-type": "DestinationConfirmation" | string;
12
12
  "x-amz-rules-engine-destination-arn": string;
13
- "content-type": "application/json";
14
13
  };
15
14
 
16
15
 
@@ -1 +1 @@
1
- "use strict";export const validate = validate10;export default validate10;const schema27 = {"$ref":"#/definitions/destinationheadersJsonSchema","definitions":{"destinationheadersJsonSchema":{"type":"object","properties":{"x-amz-rules-engine-message-type":{"anyOf":[{"type":"string","const":"DestinationConfirmation"},{"type":"string"}]},"x-amz-rules-engine-destination-arn":{"type":"string"},"content-type":{"type":"string","const":"application/json"}},"required":["x-amz-rules-engine-message-type","x-amz-rules-engine-destination-arn","content-type"],"additionalProperties":false}},"$schema":"http://json-schema.org/draft-07/schema#"};const schema28 = {"type":"object","properties":{"x-amz-rules-engine-message-type":{"anyOf":[{"type":"string","const":"DestinationConfirmation"},{"type":"string"}]},"x-amz-rules-engine-destination-arn":{"type":"string"},"content-type":{"type":"string","const":"application/json"}},"required":["x-amz-rules-engine-message-type","x-amz-rules-engine-destination-arn","content-type"],"additionalProperties":false};function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data["x-amz-rules-engine-message-type"] === undefined){const err0 = {instancePath,schemaPath:"#/definitions/destinationheadersJsonSchema/required",keyword:"required",params:{missingProperty: "x-amz-rules-engine-message-type"},message:"must have required property '"+"x-amz-rules-engine-message-type"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data["x-amz-rules-engine-destination-arn"] === undefined){const err1 = {instancePath,schemaPath:"#/definitions/destinationheadersJsonSchema/required",keyword:"required",params:{missingProperty: "x-amz-rules-engine-destination-arn"},message:"must have required property '"+"x-amz-rules-engine-destination-arn"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data["content-type"] === undefined){const err2 = {instancePath,schemaPath:"#/definitions/destinationheadersJsonSchema/required",keyword:"required",params:{missingProperty: "content-type"},message:"must have required property '"+"content-type"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(((key0 === "x-amz-rules-engine-message-type") || (key0 === "x-amz-rules-engine-destination-arn")) || (key0 === "content-type"))){const err3 = {instancePath,schemaPath:"#/definitions/destinationheadersJsonSchema/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data["x-amz-rules-engine-message-type"] !== undefined){let data0 = data["x-amz-rules-engine-message-type"];const _errs4 = errors;let valid2 = false;const _errs5 = errors;if(typeof data0 !== "string"){const err4 = {instancePath:instancePath+"/x-amz-rules-engine-message-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if("DestinationConfirmation" !== data0){const err5 = {instancePath:instancePath+"/x-amz-rules-engine-message-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/0/const",keyword:"const",params:{allowedValue: "DestinationConfirmation"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs5 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs7 = errors;if(typeof data0 !== "string"){const err6 = {instancePath:instancePath+"/x-amz-rules-engine-message-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid0 = _errs7 === errors;valid2 = valid2 || _valid0;}if(!valid2){const err7 = {instancePath:instancePath+"/x-amz-rules-engine-message-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}else {errors = _errs4;if(vErrors !== null){if(_errs4){vErrors.length = _errs4;}else {vErrors = null;}}}}if(data["x-amz-rules-engine-destination-arn"] !== undefined){if(typeof data["x-amz-rules-engine-destination-arn"] !== "string"){const err8 = {instancePath:instancePath+"/x-amz-rules-engine-destination-arn",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-destination-arn/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data["content-type"] !== undefined){let data2 = data["content-type"];if(typeof data2 !== "string"){const err9 = {instancePath:instancePath+"/content-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/content-type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if("application/json" !== data2){const err10 = {instancePath:instancePath+"/content-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/content-type/const",keyword:"const",params:{allowedValue: "application/json"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:"#/definitions/destinationheadersJsonSchema/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate10.errors = vErrors;return errors === 0;}
1
+ "use strict";export const validate = validate10;export default validate10;const schema27 = {"$ref":"#/definitions/destinationheadersJsonSchema","definitions":{"destinationheadersJsonSchema":{"type":"object","properties":{"x-amz-rules-engine-message-type":{"anyOf":[{"type":"string","const":"DestinationConfirmation"},{"type":"string"}]},"x-amz-rules-engine-destination-arn":{"type":"string"}},"required":["x-amz-rules-engine-message-type","x-amz-rules-engine-destination-arn"],"additionalProperties":true}},"$schema":"http://json-schema.org/draft-07/schema#"};const schema28 = {"type":"object","properties":{"x-amz-rules-engine-message-type":{"anyOf":[{"type":"string","const":"DestinationConfirmation"},{"type":"string"}]},"x-amz-rules-engine-destination-arn":{"type":"string"}},"required":["x-amz-rules-engine-message-type","x-amz-rules-engine-destination-arn"],"additionalProperties":true};function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data["x-amz-rules-engine-message-type"] === undefined){const err0 = {instancePath,schemaPath:"#/definitions/destinationheadersJsonSchema/required",keyword:"required",params:{missingProperty: "x-amz-rules-engine-message-type"},message:"must have required property '"+"x-amz-rules-engine-message-type"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data["x-amz-rules-engine-destination-arn"] === undefined){const err1 = {instancePath,schemaPath:"#/definitions/destinationheadersJsonSchema/required",keyword:"required",params:{missingProperty: "x-amz-rules-engine-destination-arn"},message:"must have required property '"+"x-amz-rules-engine-destination-arn"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data["x-amz-rules-engine-message-type"] !== undefined){let data0 = data["x-amz-rules-engine-message-type"];const _errs4 = errors;let valid2 = false;const _errs5 = errors;if(typeof data0 !== "string"){const err2 = {instancePath:instancePath+"/x-amz-rules-engine-message-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if("DestinationConfirmation" !== data0){const err3 = {instancePath:instancePath+"/x-amz-rules-engine-message-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/0/const",keyword:"const",params:{allowedValue: "DestinationConfirmation"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid0 = _errs5 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs7 = errors;if(typeof data0 !== "string"){const err4 = {instancePath:instancePath+"/x-amz-rules-engine-message-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs7 === errors;valid2 = valid2 || _valid0;}if(!valid2){const err5 = {instancePath:instancePath+"/x-amz-rules-engine-message-type",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-message-type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs4;if(vErrors !== null){if(_errs4){vErrors.length = _errs4;}else {vErrors = null;}}}}if(data["x-amz-rules-engine-destination-arn"] !== undefined){if(typeof data["x-amz-rules-engine-destination-arn"] !== "string"){const err6 = {instancePath:instancePath+"/x-amz-rules-engine-destination-arn",schemaPath:"#/definitions/destinationheadersJsonSchema/properties/x-amz-rules-engine-destination-arn/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/definitions/destinationheadersJsonSchema/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate10.errors = vErrors;return errors === 0;}
@@ -4,5 +4,4 @@ import { RulesEngineMessageTypesSchema } from "../constants";
4
4
  export const DestinationHeadersSchema = z.object({
5
5
  "x-amz-rules-engine-message-type": RulesEngineMessageTypesSchema,
6
6
  "x-amz-rules-engine-destination-arn": z.string(),
7
- "content-type": z.literal("application/json"),
8
- });
7
+ }).nonstrict();