zation-assured 0.6.3 → 3.0.0-dev.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.
Files changed (151) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +55 -2
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.js +3 -9
  5. package/dist/lib/api/assert.d.ts +16 -9
  6. package/dist/lib/api/assert.js +16 -12
  7. package/dist/lib/api/testHelper.d.ts +0 -8
  8. package/dist/lib/api/testHelper.js +6 -83
  9. package/dist/lib/api/when.d.ts +41 -45
  10. package/dist/lib/api/when.js +42 -55
  11. package/dist/lib/helper/asserter/abstractActionAsserter.d.ts +68 -0
  12. package/dist/lib/helper/asserter/{rootSendAsserter.js → abstractActionAsserter.js} +23 -67
  13. package/dist/lib/helper/asserter/assertStarter.d.ts +5 -0
  14. package/dist/lib/helper/asserter/assertStarter.js +16 -0
  15. package/dist/lib/helper/asserter/channel/abstractChannelAsserter.d.ts +20 -29
  16. package/dist/lib/helper/asserter/channel/abstractChannelAsserter.js +44 -85
  17. package/dist/lib/helper/asserter/channel/channelAsserter.d.ts +3 -3
  18. package/dist/lib/helper/asserter/channel/channelAsserter.js +2 -2
  19. package/dist/lib/helper/asserter/channel/standaloneChannelAsserter.d.ts +5 -5
  20. package/dist/lib/helper/asserter/channel/standaloneChannelAsserter.js +6 -6
  21. package/dist/lib/helper/asserter/client/abstractClientAsserter.d.ts +20 -38
  22. package/dist/lib/helper/asserter/client/abstractClientAsserter.js +82 -184
  23. package/dist/lib/helper/asserter/client/clientAsserter.d.ts +3 -3
  24. package/dist/lib/helper/asserter/client/clientAsserter.js +2 -2
  25. package/dist/lib/helper/asserter/client/standaloneClientAsserter.d.ts +5 -5
  26. package/dist/lib/helper/asserter/client/standaloneClientAsserter.js +6 -6
  27. package/dist/lib/helper/asserter/controller/integratedResponseAsserter.d.ts +52 -0
  28. package/dist/lib/helper/asserter/controller/integratedResponseAsserter.js +112 -0
  29. package/dist/lib/helper/asserter/controller/standaloneResponseAsserter.d.ts +49 -0
  30. package/dist/lib/helper/asserter/controller/standaloneResponseAsserter.js +108 -0
  31. package/dist/lib/helper/asserter/databox/abstractDataboxAsserter.d.ts +29 -36
  32. package/dist/lib/helper/asserter/databox/abstractDataboxAsserter.js +44 -80
  33. package/dist/lib/helper/asserter/databox/databoxAsserter.d.ts +3 -3
  34. package/dist/lib/helper/asserter/databox/databoxAsserter.js +2 -2
  35. package/dist/lib/helper/asserter/databox/standaloneDataboxAsserter.d.ts +6 -5
  36. package/dist/lib/helper/asserter/databox/standaloneDataboxAsserter.js +6 -6
  37. package/dist/lib/helper/asserter/event/abstractEventAsserter.d.ts +12 -4
  38. package/dist/lib/helper/asserter/event/abstractEventAsserter.js +25 -10
  39. package/dist/lib/helper/asserter/event/codeMetadataEventAsserter.d.ts +21 -0
  40. package/dist/lib/helper/asserter/event/codeMetadataEventAsserter.js +47 -0
  41. package/dist/lib/helper/asserter/event/dataEventAsserter.d.ts +13 -3
  42. package/dist/lib/helper/asserter/event/dataEventAsserter.js +22 -4
  43. package/dist/lib/helper/asserter/receiver/integratedTransmitAsserter.d.ts +9 -0
  44. package/dist/lib/helper/asserter/receiver/{transmitAsserter.js → integratedTransmitAsserter.js} +9 -9
  45. package/dist/lib/helper/asserter/value/abstractValueAsserter.d.ts +10 -12
  46. package/dist/lib/helper/asserter/value/abstractValueAsserter.js +46 -50
  47. package/dist/lib/helper/asserter/value/standaloneValueAsserter.d.ts +3 -3
  48. package/dist/lib/helper/asserter/value/standaloneValueAsserter.js +6 -6
  49. package/dist/lib/helper/asserter/value/valueAsserter.d.ts +4 -4
  50. package/dist/lib/helper/asserter/value/valueAsserter.js +4 -4
  51. package/dist/lib/helper/backError/backErrorsFilterBuilder.d.ts +12 -0
  52. package/dist/lib/helper/backError/backErrorsFilterBuilder.js +29 -0
  53. package/dist/lib/helper/console/logger.js +2 -2
  54. package/dist/lib/helper/definitions/optionTypes.d.ts +8 -0
  55. package/dist/lib/helper/definitions/optionTypes.js +7 -0
  56. package/dist/lib/helper/test/test.d.ts +2 -2
  57. package/dist/lib/helper/test/test.js +8 -6
  58. package/dist/lib/helper/timeout/timeoutAssert.js +2 -2
  59. package/dist/lib/helper/utils/actionUtils.d.ts +5 -18
  60. package/dist/lib/helper/utils/actionUtils.js +14 -43
  61. package/dist/lib/helper/utils/types.d.ts +20 -0
  62. package/dist/lib/helper/utils/types.js +7 -0
  63. package/package.json +7 -9
  64. package/dist/lib/api/before.d.ts +0 -3
  65. package/dist/lib/api/before.js +0 -20
  66. package/dist/lib/api/client.d.ts +0 -3
  67. package/dist/lib/api/client.js +0 -11
  68. package/dist/lib/api/describe.d.ts +0 -1
  69. package/dist/lib/api/describe.js +0 -6
  70. package/dist/lib/api/instanceManager.d.ts +0 -8
  71. package/dist/lib/api/instanceManager.js +0 -48
  72. package/dist/lib/api/testArea.d.ts +0 -3
  73. package/dist/lib/api/testArea.js +0 -41
  74. package/dist/lib/api/testServerManager.d.ts +0 -19
  75. package/dist/lib/api/testServerManager.js +0 -100
  76. package/dist/lib/helper/asserter/abstractClientAsserter.d.ts +0 -102
  77. package/dist/lib/helper/asserter/abstractClientAsserter.js +0 -293
  78. package/dist/lib/helper/asserter/anyAsserter.d.ts +0 -62
  79. package/dist/lib/helper/asserter/anyAsserter.js +0 -130
  80. package/dist/lib/helper/asserter/channelEventAsserter.d.ts +0 -34
  81. package/dist/lib/helper/asserter/channelEventAsserter.js +0 -84
  82. package/dist/lib/helper/asserter/channelPubAsserter.d.ts +0 -53
  83. package/dist/lib/helper/asserter/channelPubAsserter.js +0 -126
  84. package/dist/lib/helper/asserter/clientAsserter.d.ts +0 -13
  85. package/dist/lib/helper/asserter/clientAsserter.js +0 -26
  86. package/dist/lib/helper/asserter/controller/responseAsserter.d.ts +0 -74
  87. package/dist/lib/helper/asserter/controller/responseAsserter.js +0 -138
  88. package/dist/lib/helper/asserter/dataEventAsserter.d.ts +0 -40
  89. package/dist/lib/helper/asserter/dataEventAsserter.js +0 -113
  90. package/dist/lib/helper/asserter/event/abstractDataEventAsserter.d.ts +0 -13
  91. package/dist/lib/helper/asserter/event/abstractDataEventAsserter.js +0 -36
  92. package/dist/lib/helper/asserter/event/codeDataEventAsserter.d.ts +0 -14
  93. package/dist/lib/helper/asserter/event/codeDataEventAsserter.js +0 -40
  94. package/dist/lib/helper/asserter/eventAsserter.d.ts +0 -41
  95. package/dist/lib/helper/asserter/eventAsserter.js +0 -115
  96. package/dist/lib/helper/asserter/objectAsserter.d.ts +0 -55
  97. package/dist/lib/helper/asserter/objectAsserter.js +0 -113
  98. package/dist/lib/helper/asserter/receiver/transmitAsserter.d.ts +0 -9
  99. package/dist/lib/helper/asserter/responseAsserter.d.ts +0 -129
  100. package/dist/lib/helper/asserter/responseAsserter.js +0 -260
  101. package/dist/lib/helper/asserter/rootSendAsserter.d.ts +0 -89
  102. package/dist/lib/helper/asserter/standaloneClientAsserter.d.ts +0 -11
  103. package/dist/lib/helper/asserter/standaloneClientAsserter.js +0 -38
  104. package/dist/lib/helper/assured/clientAssured.d.ts +0 -2
  105. package/dist/lib/helper/assured/clientAssured.js +0 -11
  106. package/dist/lib/helper/assured/responseAssured.d.ts +0 -17
  107. package/dist/lib/helper/assured/responseAssured.js +0 -72
  108. package/dist/lib/helper/backError/backErrorFilterBuilder.d.ts +0 -13
  109. package/dist/lib/helper/backError/backErrorFilterBuilder.js +0 -32
  110. package/dist/lib/helper/builder/controller/abstractRequestBuilder.d.ts +0 -53
  111. package/dist/lib/helper/builder/controller/abstractRequestBuilder.js +0 -69
  112. package/dist/lib/helper/builder/controller/authRequestBuilder.d.ts +0 -15
  113. package/dist/lib/helper/builder/controller/authRequestBuilder.js +0 -30
  114. package/dist/lib/helper/builder/controller/standardRequestBuilder.d.ts +0 -15
  115. package/dist/lib/helper/builder/controller/standardRequestBuilder.js +0 -30
  116. package/dist/lib/helper/builder/controller/validationCheckRequestBuilder.d.ts +0 -21
  117. package/dist/lib/helper/builder/controller/validationCheckRequestBuilder.js +0 -40
  118. package/dist/lib/helper/builder/receiver/packageBuilder.d.ts +0 -45
  119. package/dist/lib/helper/builder/receiver/packageBuilder.js +0 -67
  120. package/dist/lib/helper/controller/request/abstractRequestBuilder.d.ts +0 -53
  121. package/dist/lib/helper/controller/request/abstractRequestBuilder.js +0 -68
  122. package/dist/lib/helper/controller/request/authRequestBuilder.d.ts +0 -15
  123. package/dist/lib/helper/controller/request/authRequestBuilder.js +0 -29
  124. package/dist/lib/helper/controller/request/standardRequestBuilder.d.ts +0 -15
  125. package/dist/lib/helper/controller/request/standardRequestBuilder.js +0 -29
  126. package/dist/lib/helper/controller/request/validationCheckRequestBuilder.d.ts +0 -21
  127. package/dist/lib/helper/controller/request/validationCheckRequestBuilder.js +0 -39
  128. package/dist/lib/helper/data/test.d.ts +0 -13
  129. package/dist/lib/helper/data/test.js +0 -89
  130. package/dist/lib/helper/do/actionUtils.d.ts +0 -24
  131. package/dist/lib/helper/do/actionUtils.js +0 -70
  132. package/dist/lib/helper/do/doUtils.d.ts +0 -24
  133. package/dist/lib/helper/do/doUtils.js +0 -80
  134. package/dist/lib/helper/error/backErrorFilterBuilder.d.ts +0 -13
  135. package/dist/lib/helper/error/backErrorFilterBuilder.js +0 -34
  136. package/dist/lib/helper/error/taskErrorFilterBuilder.d.ts +0 -13
  137. package/dist/lib/helper/error/taskErrorFilterBuilder.js +0 -34
  138. package/dist/lib/helper/request/abstractRequestBuilder.d.ts +0 -53
  139. package/dist/lib/helper/request/abstractRequestBuilder.js +0 -68
  140. package/dist/lib/helper/request/authRequestBuilder.d.ts +0 -15
  141. package/dist/lib/helper/request/authRequestBuilder.js +0 -29
  142. package/dist/lib/helper/request/requestBuilder.d.ts +0 -46
  143. package/dist/lib/helper/request/requestBuilder.js +0 -76
  144. package/dist/lib/helper/request/standardRequestBuilder.d.ts +0 -15
  145. package/dist/lib/helper/request/standardRequestBuilder.js +0 -29
  146. package/dist/lib/helper/request/validationCheckRequestBuilder.d.ts +0 -21
  147. package/dist/lib/helper/request/validationCheckRequestBuilder.js +0 -39
  148. package/dist/lib/helper/request/validationRequestBuilder.d.ts +0 -35
  149. package/dist/lib/helper/request/validationRequestBuilder.js +0 -61
  150. package/dist/lib/helper/utils/clientUtils.d.ts +0 -4
  151. package/dist/lib/helper/utils/clientUtils.js +0 -29
@@ -1,34 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const zation_client_1 = require("zation-client");
9
- class BackErrorFilterBuilder extends zation_client_1.AbstractBackErrorFilterBuilder {
10
- constructor(respAsserter, count) {
11
- super();
12
- this.respAsserter = respAsserter;
13
- this.count = count;
14
- }
15
- // noinspection JSUnusedGlobalSymbols
16
- /**
17
- * @description
18
- * End the filter builder.
19
- */
20
- end() {
21
- this._pushTmpFilter();
22
- if (this.count) {
23
- this.respAsserter.hasErrorCount(this.count, ...this.filter);
24
- }
25
- else {
26
- this.respAsserter.hasError(...this.filter);
27
- }
28
- return this.respAsserter;
29
- }
30
- self() {
31
- return this;
32
- }
33
- }
34
- exports.BackErrorFilterBuilder = BackErrorFilterBuilder;
@@ -1,13 +0,0 @@
1
- import { AbstractErrorFilterBuilder } from "zation-client";
2
- import { ResponseAsserter } from "./../asserter/responseAsserter";
3
- export declare class TaskErrorFilterBuilder<T extends ResponseAsserter> extends AbstractErrorFilterBuilder<TaskErrorFilterBuilder<T>> {
4
- private readonly respAsserter;
5
- private readonly count;
6
- constructor(respAsserter: T, count?: number);
7
- /**
8
- * @description
9
- * End the filter builder.
10
- */
11
- end(): T;
12
- protected self(): TaskErrorFilterBuilder<T>;
13
- }
@@ -1,34 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const zation_client_1 = require("zation-client");
9
- class TaskErrorFilterBuilder extends zation_client_1.AbstractErrorFilterBuilder {
10
- constructor(respAsserter, count) {
11
- super();
12
- this.respAsserter = respAsserter;
13
- this.count = count;
14
- }
15
- // noinspection JSUnusedGlobalSymbols
16
- /**
17
- * @description
18
- * End the filter builder.
19
- */
20
- end() {
21
- this._pushTmpFilter();
22
- if (this.count) {
23
- this.respAsserter.hasErrorCount(this.count, ...this.filter);
24
- }
25
- else {
26
- this.respAsserter.hasError(...this.filter);
27
- }
28
- return this.respAsserter;
29
- }
30
- self() {
31
- return this;
32
- }
33
- }
34
- exports.TaskErrorFilterBuilder = TaskErrorFilterBuilder;
@@ -1,53 +0,0 @@
1
- import { AbstractRequestBuilder as NativeAbstractRequestBuilder, Zation as ZationClient } from "zation-client";
2
- import { Test } from "../data/test";
3
- import { ResponseAsserter } from "../asserter/responseAsserter";
4
- import { ConnectTimeoutOption } from "zation-client/dist/lib/main/utils/connectionUtils";
5
- export declare abstract class AbstractRequestBuilder<T, RT> {
6
- private readonly test;
7
- private readonly client;
8
- private readonly abReq;
9
- protected constructor(test: Test, client: ZationClient, req: NativeAbstractRequestBuilder<any>);
10
- /**
11
- * @description
12
- * Set the apiLevel of the request.
13
- * @param apiLevel.
14
- * @default undefined.
15
- */
16
- apiLevel(apiLevel: number | undefined): T;
17
- /**
18
- * @description
19
- * Set the timeout for the response of the request.
20
- * Value can be null which means the timeout is disabled or
21
- * undefined then it will use the default timeout of the zation config,
22
- * or it can be a number that indicates the milliseconds.
23
- * @param timeout
24
- */
25
- responseTimeout(timeout: null | undefined | number): T;
26
- /**
27
- * With the ConnectTimeout option, you can activate that the socket is
28
- * trying to connect when it is not connected. You have five possible choices:
29
- * Undefined: It will use the value from the default options.
30
- * False: The action will fail and throw a ConnectionRequiredError,
31
- * when the socket is not connected.
32
- * Null: The socket will try to connect (if it is not connected) and
33
- * waits until the connection is made, then it continues the action.
34
- * Number: Same as null, but now you can specify a timeout (in ms) of
35
- * maximum waiting time for the connection. If the timeout is reached,
36
- * it will throw a timeout error.
37
- * AbortTrigger: Same as null, but now you have the possibility to abort the wait later.
38
- * @param timeout
39
- * @default undefined
40
- */
41
- connectTimeout(timeout: ConnectTimeoutOption): T;
42
- /**
43
- * @description
44
- * Start the assert that part
45
- */
46
- assertThat(): ResponseAsserter;
47
- /**
48
- * @description
49
- * Returns self.
50
- * For fluent programing with inheritance.
51
- */
52
- protected abstract self(): T;
53
- }
@@ -1,68 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const responseAsserter_1 = require("../asserter/responseAsserter");
9
- class AbstractRequestBuilder {
10
- constructor(test, client, req) {
11
- this.test = test;
12
- this.client = client;
13
- this.abReq = req;
14
- }
15
- // noinspection JSUnusedGlobalSymbols
16
- /**
17
- * @description
18
- * Set the apiLevel of the request.
19
- * @param apiLevel.
20
- * @default undefined.
21
- */
22
- apiLevel(apiLevel) {
23
- this.abReq.apiLevel(apiLevel);
24
- return this.self();
25
- }
26
- // noinspection JSUnusedGlobalSymbols
27
- /**
28
- * @description
29
- * Set the timeout for the response of the request.
30
- * Value can be null which means the timeout is disabled or
31
- * undefined then it will use the default timeout of the zation config,
32
- * or it can be a number that indicates the milliseconds.
33
- * @param timeout
34
- */
35
- responseTimeout(timeout) {
36
- this.abReq.responseTimeout(timeout);
37
- return this.self();
38
- }
39
- // noinspection JSUnusedGlobalSymbols
40
- /**
41
- * With the ConnectTimeout option, you can activate that the socket is
42
- * trying to connect when it is not connected. You have five possible choices:
43
- * Undefined: It will use the value from the default options.
44
- * False: The action will fail and throw a ConnectionRequiredError,
45
- * when the socket is not connected.
46
- * Null: The socket will try to connect (if it is not connected) and
47
- * waits until the connection is made, then it continues the action.
48
- * Number: Same as null, but now you can specify a timeout (in ms) of
49
- * maximum waiting time for the connection. If the timeout is reached,
50
- * it will throw a timeout error.
51
- * AbortTrigger: Same as null, but now you have the possibility to abort the wait later.
52
- * @param timeout
53
- * @default undefined
54
- */
55
- connectTimeout(timeout) {
56
- this.abReq.connectTimeout(timeout);
57
- return this.self();
58
- }
59
- // noinspection JSUnusedGlobalSymbols
60
- /**
61
- * @description
62
- * Start the assert that part
63
- */
64
- assertThat() {
65
- return new responseAsserter_1.ResponseAsserter(this.abReq, this.test, this.client);
66
- }
67
- }
68
- exports.AbstractRequestBuilder = AbstractRequestBuilder;
@@ -1,15 +0,0 @@
1
- import { AbstractRequestBuilder } from "./abstractRequestBuilder";
2
- import { AuthRequestBuilder as NativeAuthRequestBuilder, Zation as ZationClient } from "zation-client";
3
- import { Test } from "../data/test";
4
- export declare class AuthRequestBuilder extends AbstractRequestBuilder<AuthRequestBuilder, NativeAuthRequestBuilder> {
5
- private req;
6
- constructor(req: NativeAuthRequestBuilder, test: Test, client: ZationClient);
7
- /**
8
- * @description
9
- * Set the authData of the request.
10
- * @param data
11
- * @default undefined (equals to {} on server param based input).
12
- */
13
- authData(data: any): AuthRequestBuilder;
14
- protected self(): AuthRequestBuilder;
15
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const abstractRequestBuilder_1 = require("./abstractRequestBuilder");
9
- class AuthRequestBuilder extends abstractRequestBuilder_1.AbstractRequestBuilder {
10
- constructor(req, test, client) {
11
- super(test, client, req);
12
- this.req = req;
13
- }
14
- // noinspection JSUnusedGlobalSymbols
15
- /**
16
- * @description
17
- * Set the authData of the request.
18
- * @param data
19
- * @default undefined (equals to {} on server param based input).
20
- */
21
- authData(data) {
22
- this.req.authData(data);
23
- return this;
24
- }
25
- self() {
26
- return this;
27
- }
28
- }
29
- exports.AuthRequestBuilder = AuthRequestBuilder;
@@ -1,46 +0,0 @@
1
- import { RequestBuilder as NativeRequestBuilder, Zation as ZationClient } from "zation-client";
2
- import { AbstractRequestBuilder } from "./abstractRequestBuilder";
3
- import { Test } from "../data/test";
4
- export declare class RequestBuilder extends AbstractRequestBuilder<RequestBuilder, NativeRequestBuilder> {
5
- private req;
6
- constructor(req: NativeRequestBuilder, test: Test, client: ZationClient);
7
- /**
8
- * @description
9
- * Set request should use authentication if it is an http request and client is authenticated.
10
- * @param useAuth
11
- * @default true
12
- */
13
- useAuth(useAuth: boolean): RequestBuilder;
14
- /**
15
- * @description
16
- * Set the controller of the request.
17
- * @param controller
18
- * @default ''
19
- */
20
- controller(controller: string): RequestBuilder;
21
- /**
22
- * @description
23
- * Set is systemController of the request.
24
- * @default false
25
- * @param isSystemController
26
- */
27
- systemController(isSystemController: boolean): RequestBuilder;
28
- /**
29
- * @description
30
- * Set the data of the request.
31
- * @param data
32
- * @default undefined (equals to {} on server param based input).
33
- */
34
- data(data: any): RequestBuilder;
35
- /**
36
- * @description
37
- * Attach http content to http request.
38
- * The attached http content will only used by post requests.
39
- * Can be used for attaching files.
40
- * @param key
41
- * @param data
42
- * @default []
43
- */
44
- attachHttpContent(key: string, data: string | Blob): RequestBuilder;
45
- protected self(): RequestBuilder;
46
- }
@@ -1,76 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const abstractRequestBuilder_1 = require("./abstractRequestBuilder");
9
- class RequestBuilder extends abstractRequestBuilder_1.AbstractRequestBuilder {
10
- constructor(req, test, client) {
11
- super(test, client, req);
12
- this.req = req;
13
- }
14
- // noinspection JSUnusedGlobalSymbols
15
- /**
16
- * @description
17
- * Set request should use authentication if it is an http request and client is authenticated.
18
- * @param useAuth
19
- * @default true
20
- */
21
- useAuth(useAuth) {
22
- this.req.useAuth(useAuth);
23
- return this;
24
- }
25
- // noinspection JSUnusedGlobalSymbols
26
- /**
27
- * @description
28
- * Set the controller of the request.
29
- * @param controller
30
- * @default ''
31
- */
32
- controller(controller) {
33
- this.req.controller(controller);
34
- return this;
35
- }
36
- // noinspection JSUnusedGlobalSymbols
37
- /**
38
- * @description
39
- * Set is systemController of the request.
40
- * @default false
41
- * @param isSystemController
42
- */
43
- systemController(isSystemController) {
44
- this.req.systemController(isSystemController);
45
- return this;
46
- }
47
- // noinspection JSUnusedGlobalSymbols
48
- /**
49
- * @description
50
- * Set the data of the request.
51
- * @param data
52
- * @default undefined (equals to {} on server param based input).
53
- */
54
- data(data) {
55
- this.req.data(data);
56
- return this;
57
- }
58
- // noinspection JSUnusedGlobalSymbols
59
- /**
60
- * @description
61
- * Attach http content to http request.
62
- * The attached http content will only used by post requests.
63
- * Can be used for attaching files.
64
- * @param key
65
- * @param data
66
- * @default []
67
- */
68
- attachHttpContent(key, data) {
69
- this.req.attachHttpContent(key, data);
70
- return this;
71
- }
72
- self() {
73
- return this;
74
- }
75
- }
76
- exports.RequestBuilder = RequestBuilder;
@@ -1,15 +0,0 @@
1
- import { StandardRequestBuilder as NativeStandardRequestBuilder, Zation as ZationClient } from "zation-client";
2
- import { AbstractRequestBuilder } from "./abstractRequestBuilder";
3
- import { Test } from "../data/test";
4
- export declare class StandardRequestBuilder extends AbstractRequestBuilder<StandardRequestBuilder, NativeStandardRequestBuilder> {
5
- private req;
6
- constructor(req: NativeStandardRequestBuilder, test: Test, client: ZationClient);
7
- /**
8
- * @description
9
- * Set the data of the request.
10
- * @param data
11
- * @default undefined (equals to {} on server param based input).
12
- */
13
- data(data: any): StandardRequestBuilder;
14
- protected self(): StandardRequestBuilder;
15
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const abstractRequestBuilder_1 = require("./abstractRequestBuilder");
9
- class StandardRequestBuilder extends abstractRequestBuilder_1.AbstractRequestBuilder {
10
- constructor(req, test, client) {
11
- super(test, client, req);
12
- this.req = req;
13
- }
14
- // noinspection JSUnusedGlobalSymbols
15
- /**
16
- * @description
17
- * Set the data of the request.
18
- * @param data
19
- * @default undefined (equals to {} on server param based input).
20
- */
21
- data(data) {
22
- this.req.data(data);
23
- return this;
24
- }
25
- self() {
26
- return this;
27
- }
28
- }
29
- exports.StandardRequestBuilder = StandardRequestBuilder;
@@ -1,21 +0,0 @@
1
- import { AbstractRequestBuilder } from "./abstractRequestBuilder";
2
- import { ValidationCheckPair, ValidationCheckRequestBuilder as NativeValidationCheckRequestBuilder, Zation as ZationClient } from "zation-client";
3
- import { Test } from "../data/test";
4
- export declare class ValidationCheckRequestBuilder extends AbstractRequestBuilder<ValidationCheckRequestBuilder, NativeValidationCheckRequestBuilder> {
5
- private req;
6
- constructor(req: NativeValidationCheckRequestBuilder, test: Test, client: ZationClient);
7
- /**
8
- * @description
9
- * Adds validation checks.
10
- * @param checks
11
- */
12
- checks(...checks: ValidationCheckPair[]): ValidationCheckRequestBuilder;
13
- /**
14
- * @description
15
- * Adds validation check.
16
- * @param path
17
- * @param value
18
- */
19
- check(path: string | string[], value: any): ValidationCheckRequestBuilder;
20
- protected self(): ValidationCheckRequestBuilder;
21
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const abstractRequestBuilder_1 = require("./abstractRequestBuilder");
9
- class ValidationCheckRequestBuilder extends abstractRequestBuilder_1.AbstractRequestBuilder {
10
- constructor(req, test, client) {
11
- super(test, client, req);
12
- this.req = req;
13
- }
14
- // noinspection JSUnusedGlobalSymbols
15
- /**
16
- * @description
17
- * Adds validation checks.
18
- * @param checks
19
- */
20
- checks(...checks) {
21
- this.req.checks(...checks);
22
- return this;
23
- }
24
- // noinspection JSUnusedGlobalSymbols
25
- /**
26
- * @description
27
- * Adds validation check.
28
- * @param path
29
- * @param value
30
- */
31
- check(path, value) {
32
- this.req.check(path, value);
33
- return this;
34
- }
35
- self() {
36
- return this;
37
- }
38
- }
39
- exports.ValidationCheckRequestBuilder = ValidationCheckRequestBuilder;
@@ -1,35 +0,0 @@
1
- import { AbstractRequestBuilder } from "./abstractRequestBuilder";
2
- import { ValidationCheck, ValidationRequestBuilder as NativeValidationRequestBuilder, Zation as ZationClient } from "zation-client";
3
- import { Test } from "../data/test";
4
- export declare class ValidationRequestBuilder extends AbstractRequestBuilder<ValidationRequestBuilder, NativeValidationRequestBuilder> {
5
- private req;
6
- constructor(req: NativeValidationRequestBuilder, test: Test, client: ZationClient);
7
- /**
8
- * @description
9
- * Set the controller of the request.
10
- * @param controller
11
- * @default ''
12
- */
13
- controller(controller: string): ValidationRequestBuilder;
14
- /**
15
- * @description
16
- * Set is systemController of the request.
17
- * @default false
18
- * @param isSystemController
19
- */
20
- systemController(isSystemController: boolean): ValidationRequestBuilder;
21
- /**
22
- * @description
23
- * Add validation checks.
24
- * @param checks
25
- */
26
- checks(...checks: ValidationCheck[]): ValidationRequestBuilder;
27
- /**
28
- * @description
29
- * Add validation check.
30
- * @param path
31
- * @param value
32
- */
33
- check(path: string | string[], value: any): ValidationRequestBuilder;
34
- protected self(): ValidationRequestBuilder;
35
- }
@@ -1,61 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const abstractRequestBuilder_1 = require("./abstractRequestBuilder");
9
- class ValidationRequestBuilder extends abstractRequestBuilder_1.AbstractRequestBuilder {
10
- constructor(req, test, client) {
11
- super(test, client, req);
12
- this.req = req;
13
- }
14
- // noinspection JSUnusedGlobalSymbols
15
- /**
16
- * @description
17
- * Set the controller of the request.
18
- * @param controller
19
- * @default ''
20
- */
21
- controller(controller) {
22
- this.req.controller(controller);
23
- return this;
24
- }
25
- // noinspection JSUnusedGlobalSymbols
26
- /**
27
- * @description
28
- * Set is systemController of the request.
29
- * @default false
30
- * @param isSystemController
31
- */
32
- systemController(isSystemController) {
33
- this.req.systemController(isSystemController);
34
- return this;
35
- }
36
- // noinspection JSUnusedGlobalSymbols
37
- /**
38
- * @description
39
- * Add validation checks.
40
- * @param checks
41
- */
42
- checks(...checks) {
43
- this.req.checks(...checks);
44
- return this;
45
- }
46
- // noinspection JSUnusedGlobalSymbols
47
- /**
48
- * @description
49
- * Add validation check.
50
- * @param path
51
- * @param value
52
- */
53
- check(path, value) {
54
- this.req.check(path, value);
55
- return this;
56
- }
57
- self() {
58
- return this;
59
- }
60
- }
61
- exports.ValidationRequestBuilder = ValidationRequestBuilder;
@@ -1,4 +0,0 @@
1
- import { Client } from "zation-client";
2
- export declare class ClientUtils {
3
- static forEachClient(func: (client: Client) => void | Promise<void>, ...clients: Client[]): Promise<void>;
4
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- /*
3
- Author: Luca Scaringella
4
- GitHub: LucaCode
5
- ©Copyright by Luca Scaringella
6
- */
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ClientUtils = void 0;
18
- class ClientUtils {
19
- static forEachClient(func, ...clients) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const promises = [];
22
- for (let i = 0; i < clients.length; i++) {
23
- promises.push(func(clients[i]));
24
- }
25
- yield Promise.all(promises);
26
- });
27
- }
28
- }
29
- exports.ClientUtils = ClientUtils;