@xube/kit-destination 0.0.8 → 0.0.10

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.
@@ -0,0 +1,13 @@
1
+ export function validate(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
2
+ instancePath?: string | undefined;
3
+ parentData: any;
4
+ parentDataProperty: any;
5
+ rootData?: any;
6
+ }): boolean;
7
+ export default validate10;
8
+ declare function validate10(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
9
+ instancePath?: string | undefined;
10
+ parentData: any;
11
+ parentDataProperty: any;
12
+ rootData?: any;
13
+ }): boolean;
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validate = void 0;
4
+ exports.validate = validate10;
5
+ exports.default = validate10;
6
+ const schema27 = { "$ref": "#/definitions/confirmationrequestJsonSchema", "definitions": { "confirmationrequestJsonSchema": { "type": "object", "properties": { "arn": { "type": "string" }, "confirmationToken": { "type": "string" }, "enableUrl": { "type": "string" }, "messageType": { "type": "string" } }, "required": ["arn", "confirmationToken", "enableUrl", "messageType"], "additionalProperties": false } }, "$schema": "http://json-schema.org/draft-07/schema#" };
7
+ const schema28 = { "type": "object", "properties": { "arn": { "type": "string" }, "confirmationToken": { "type": "string" }, "enableUrl": { "type": "string" }, "messageType": { "type": "string" } }, "required": ["arn", "confirmationToken", "enableUrl", "messageType"], "additionalProperties": false };
8
+ function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) {
9
+ if (data.arn === undefined) {
10
+ const err0 = { instancePath, schemaPath: "#/definitions/confirmationrequestJsonSchema/required", keyword: "required", params: { missingProperty: "arn" }, message: "must have required property '" + "arn" + "'" };
11
+ if (vErrors === null) {
12
+ vErrors = [err0];
13
+ }
14
+ else {
15
+ vErrors.push(err0);
16
+ }
17
+ errors++;
18
+ }
19
+ if (data.confirmationToken === undefined) {
20
+ const err1 = { instancePath, schemaPath: "#/definitions/confirmationrequestJsonSchema/required", keyword: "required", params: { missingProperty: "confirmationToken" }, message: "must have required property '" + "confirmationToken" + "'" };
21
+ if (vErrors === null) {
22
+ vErrors = [err1];
23
+ }
24
+ else {
25
+ vErrors.push(err1);
26
+ }
27
+ errors++;
28
+ }
29
+ if (data.enableUrl === undefined) {
30
+ const err2 = { instancePath, schemaPath: "#/definitions/confirmationrequestJsonSchema/required", keyword: "required", params: { missingProperty: "enableUrl" }, message: "must have required property '" + "enableUrl" + "'" };
31
+ if (vErrors === null) {
32
+ vErrors = [err2];
33
+ }
34
+ else {
35
+ vErrors.push(err2);
36
+ }
37
+ errors++;
38
+ }
39
+ if (data.messageType === undefined) {
40
+ const err3 = { instancePath, schemaPath: "#/definitions/confirmationrequestJsonSchema/required", keyword: "required", params: { missingProperty: "messageType" }, message: "must have required property '" + "messageType" + "'" };
41
+ if (vErrors === null) {
42
+ vErrors = [err3];
43
+ }
44
+ else {
45
+ vErrors.push(err3);
46
+ }
47
+ errors++;
48
+ }
49
+ for (const key0 in data) {
50
+ if (!((((key0 === "arn") || (key0 === "confirmationToken")) || (key0 === "enableUrl")) || (key0 === "messageType"))) {
51
+ const err4 = { instancePath, schemaPath: "#/definitions/confirmationrequestJsonSchema/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
52
+ if (vErrors === null) {
53
+ vErrors = [err4];
54
+ }
55
+ else {
56
+ vErrors.push(err4);
57
+ }
58
+ errors++;
59
+ }
60
+ }
61
+ if (data.arn !== undefined) {
62
+ if (typeof data.arn !== "string") {
63
+ const err5 = { instancePath: instancePath + "/arn", schemaPath: "#/definitions/confirmationrequestJsonSchema/properties/arn/type", keyword: "type", params: { type: "string" }, message: "must be string" };
64
+ if (vErrors === null) {
65
+ vErrors = [err5];
66
+ }
67
+ else {
68
+ vErrors.push(err5);
69
+ }
70
+ errors++;
71
+ }
72
+ }
73
+ if (data.confirmationToken !== undefined) {
74
+ if (typeof data.confirmationToken !== "string") {
75
+ const err6 = { instancePath: instancePath + "/confirmationToken", schemaPath: "#/definitions/confirmationrequestJsonSchema/properties/confirmationToken/type", keyword: "type", params: { type: "string" }, message: "must be string" };
76
+ if (vErrors === null) {
77
+ vErrors = [err6];
78
+ }
79
+ else {
80
+ vErrors.push(err6);
81
+ }
82
+ errors++;
83
+ }
84
+ }
85
+ if (data.enableUrl !== undefined) {
86
+ if (typeof data.enableUrl !== "string") {
87
+ const err7 = { instancePath: instancePath + "/enableUrl", schemaPath: "#/definitions/confirmationrequestJsonSchema/properties/enableUrl/type", keyword: "type", params: { type: "string" }, message: "must be string" };
88
+ if (vErrors === null) {
89
+ vErrors = [err7];
90
+ }
91
+ else {
92
+ vErrors.push(err7);
93
+ }
94
+ errors++;
95
+ }
96
+ }
97
+ if (data.messageType !== undefined) {
98
+ if (typeof data.messageType !== "string") {
99
+ const err8 = { instancePath: instancePath + "/messageType", schemaPath: "#/definitions/confirmationrequestJsonSchema/properties/messageType/type", keyword: "type", params: { type: "string" }, message: "must be string" };
100
+ if (vErrors === null) {
101
+ vErrors = [err8];
102
+ }
103
+ else {
104
+ vErrors.push(err8);
105
+ }
106
+ errors++;
107
+ }
108
+ }
109
+ }
110
+ else {
111
+ const err9 = { instancePath, schemaPath: "#/definitions/confirmationrequestJsonSchema/type", keyword: "type", params: { type: "object" }, message: "must be object" };
112
+ if (vErrors === null) {
113
+ vErrors = [err9];
114
+ }
115
+ else {
116
+ vErrors.push(err9);
117
+ }
118
+ errors++;
119
+ } validate10.errors = vErrors; return errors === 0; }
@@ -0,0 +1,13 @@
1
+ export function validate(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
2
+ instancePath?: string | undefined;
3
+ parentData: any;
4
+ parentDataProperty: any;
5
+ rootData?: any;
6
+ }): boolean;
7
+ export default validate10;
8
+ declare function validate10(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
9
+ instancePath?: string | undefined;
10
+ parentData: any;
11
+ parentDataProperty: any;
12
+ rootData?: any;
13
+ }): boolean;
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validate = void 0;
4
+ exports.validate = validate10;
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 };
8
+ function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) {
9
+ if (data["x-amz-rules-engine-message-type"] === undefined) {
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" + "'" };
11
+ if (vErrors === null) {
12
+ vErrors = [err0];
13
+ }
14
+ else {
15
+ vErrors.push(err0);
16
+ }
17
+ errors++;
18
+ }
19
+ if (data["x-amz-rules-engine-destination-arn"] === undefined) {
20
+ 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" + "'" };
21
+ if (vErrors === null) {
22
+ vErrors = [err1];
23
+ }
24
+ else {
25
+ vErrors.push(err1);
26
+ }
27
+ errors++;
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
+ if (data["x-amz-rules-engine-message-type"] !== undefined) {
52
+ let data0 = data["x-amz-rules-engine-message-type"];
53
+ const _errs4 = errors;
54
+ let valid2 = false;
55
+ const _errs5 = errors;
56
+ 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" };
58
+ if (vErrors === null) {
59
+ vErrors = [err4];
60
+ }
61
+ else {
62
+ vErrors.push(err4);
63
+ }
64
+ errors++;
65
+ }
66
+ 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" };
68
+ if (vErrors === null) {
69
+ vErrors = [err5];
70
+ }
71
+ else {
72
+ vErrors.push(err5);
73
+ }
74
+ errors++;
75
+ }
76
+ var _valid0 = _errs5 === errors;
77
+ valid2 = valid2 || _valid0;
78
+ if (!valid2) {
79
+ const _errs7 = errors;
80
+ 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" };
82
+ if (vErrors === null) {
83
+ vErrors = [err6];
84
+ }
85
+ else {
86
+ vErrors.push(err6);
87
+ }
88
+ errors++;
89
+ }
90
+ var _valid0 = _errs7 === errors;
91
+ valid2 = valid2 || _valid0;
92
+ }
93
+ 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" };
95
+ if (vErrors === null) {
96
+ vErrors = [err7];
97
+ }
98
+ else {
99
+ vErrors.push(err7);
100
+ }
101
+ errors++;
102
+ }
103
+ else {
104
+ errors = _errs4;
105
+ if (vErrors !== null) {
106
+ if (_errs4) {
107
+ vErrors.length = _errs4;
108
+ }
109
+ else {
110
+ vErrors = null;
111
+ }
112
+ }
113
+ }
114
+ }
115
+ if (data["x-amz-rules-engine-destination-arn"] !== undefined) {
116
+ 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" };
141
+ if (vErrors === null) {
142
+ vErrors = [err10];
143
+ }
144
+ else {
145
+ vErrors.push(err10);
146
+ }
147
+ errors++;
148
+ }
149
+ }
150
+ }
151
+ else {
152
+ const err11 = { instancePath, schemaPath: "#/definitions/destinationheadersJsonSchema/type", keyword: "type", params: { type: "object" }, message: "must be object" };
153
+ if (vErrors === null) {
154
+ vErrors = [err11];
155
+ }
156
+ else {
157
+ vErrors.push(err11);
158
+ }
159
+ errors++;
160
+ } validate10.errors = vErrors; return errors === 0; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-destination",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
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.8",
22
+ "@xube/kit-build": "^0.0.10",
23
23
  "ts-node": "^10.9.1",
24
24
  "typescript": "^5.1.6"
25
25
  },
26
26
  "dependencies": {
27
- "@xube/kit-generator": "^0.0.8",
28
- "@xube/kit-log": "^0.0.8",
29
- "@xube/kit-request": "^0.0.8"
27
+ "@xube/kit-generator": "^0.0.10",
28
+ "@xube/kit-log": "^0.0.10",
29
+ "@xube/kit-request": "^0.0.10"
30
30
  }
31
31
  }