@serenity-js/rest 3.0.0-rc.8 → 3.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 (127) hide show
  1. package/CHANGELOG.md +80 -1851
  2. package/README.md +8 -10
  3. package/lib/index.d.ts +2 -1
  4. package/lib/index.d.ts.map +1 -0
  5. package/lib/index.js +6 -2
  6. package/lib/index.js.map +1 -1
  7. package/lib/models/DeleteRequest.d.ts +66 -0
  8. package/lib/models/DeleteRequest.d.ts.map +1 -0
  9. package/lib/models/DeleteRequest.js +73 -0
  10. package/lib/models/DeleteRequest.js.map +1 -0
  11. package/lib/models/GetRequest.d.ts +73 -0
  12. package/lib/models/GetRequest.d.ts.map +1 -0
  13. package/lib/models/GetRequest.js +80 -0
  14. package/lib/models/GetRequest.js.map +1 -0
  15. package/lib/models/HTTPRequest.d.ts +48 -0
  16. package/lib/models/HTTPRequest.d.ts.map +1 -0
  17. package/lib/{model → models}/HTTPRequest.js +14 -23
  18. package/lib/models/HTTPRequest.js.map +1 -0
  19. package/lib/models/HeadRequest.d.ts +58 -0
  20. package/lib/models/HeadRequest.d.ts.map +1 -0
  21. package/lib/models/HeadRequest.js +65 -0
  22. package/lib/models/HeadRequest.js.map +1 -0
  23. package/lib/models/OptionsRequest.d.ts +61 -0
  24. package/lib/models/OptionsRequest.d.ts.map +1 -0
  25. package/lib/models/OptionsRequest.js +68 -0
  26. package/lib/models/OptionsRequest.js.map +1 -0
  27. package/lib/models/PatchRequest.d.ts +65 -0
  28. package/lib/models/PatchRequest.d.ts.map +1 -0
  29. package/lib/models/PatchRequest.js +74 -0
  30. package/lib/models/PatchRequest.js.map +1 -0
  31. package/lib/models/PostRequest.d.ts +105 -0
  32. package/lib/models/PostRequest.d.ts.map +1 -0
  33. package/lib/models/PostRequest.js +114 -0
  34. package/lib/models/PostRequest.js.map +1 -0
  35. package/lib/models/PutRequest.d.ts +75 -0
  36. package/lib/models/PutRequest.d.ts.map +1 -0
  37. package/lib/models/PutRequest.js +84 -0
  38. package/lib/models/PutRequest.js.map +1 -0
  39. package/lib/{model → models}/index.d.ts +1 -0
  40. package/lib/models/index.d.ts.map +1 -0
  41. package/lib/{model → models}/index.js +5 -1
  42. package/lib/models/index.js.map +1 -0
  43. package/lib/screenplay/abilities/CallAnApi.d.ts +88 -99
  44. package/lib/screenplay/abilities/CallAnApi.d.ts.map +1 -0
  45. package/lib/screenplay/abilities/CallAnApi.js +94 -107
  46. package/lib/screenplay/abilities/CallAnApi.js.map +1 -1
  47. package/lib/screenplay/abilities/index.d.ts +1 -0
  48. package/lib/screenplay/abilities/index.d.ts.map +1 -0
  49. package/lib/screenplay/abilities/index.js +5 -1
  50. package/lib/screenplay/abilities/index.js.map +1 -1
  51. package/lib/screenplay/index.d.ts +1 -0
  52. package/lib/screenplay/index.d.ts.map +1 -0
  53. package/lib/screenplay/index.js +5 -1
  54. package/lib/screenplay/index.js.map +1 -1
  55. package/lib/screenplay/interactions/ChangeApiConfig.d.ts +96 -95
  56. package/lib/screenplay/interactions/ChangeApiConfig.d.ts.map +1 -0
  57. package/lib/screenplay/interactions/ChangeApiConfig.js +98 -107
  58. package/lib/screenplay/interactions/ChangeApiConfig.js.map +1 -1
  59. package/lib/screenplay/interactions/Send.d.ts +24 -41
  60. package/lib/screenplay/interactions/Send.d.ts.map +1 -0
  61. package/lib/screenplay/interactions/Send.js +37 -51
  62. package/lib/screenplay/interactions/Send.js.map +1 -1
  63. package/lib/screenplay/interactions/index.d.ts +1 -1
  64. package/lib/screenplay/interactions/index.d.ts.map +1 -0
  65. package/lib/screenplay/interactions/index.js +5 -2
  66. package/lib/screenplay/interactions/index.js.map +1 -1
  67. package/lib/screenplay/questions/LastResponse.d.ts +152 -98
  68. package/lib/screenplay/questions/LastResponse.d.ts.map +1 -0
  69. package/lib/screenplay/questions/LastResponse.js +149 -97
  70. package/lib/screenplay/questions/LastResponse.js.map +1 -1
  71. package/lib/screenplay/questions/index.d.ts +1 -0
  72. package/lib/screenplay/questions/index.d.ts.map +1 -0
  73. package/lib/screenplay/questions/index.js +5 -1
  74. package/lib/screenplay/questions/index.js.map +1 -1
  75. package/package.json +20 -43
  76. package/src/index.ts +1 -1
  77. package/src/models/DeleteRequest.ts +73 -0
  78. package/src/models/GetRequest.ts +80 -0
  79. package/src/{model → models}/HTTPRequest.ts +17 -26
  80. package/src/models/HeadRequest.ts +65 -0
  81. package/src/models/OptionsRequest.ts +68 -0
  82. package/src/models/PatchRequest.ts +75 -0
  83. package/src/models/PostRequest.ts +115 -0
  84. package/src/models/PutRequest.ts +85 -0
  85. package/src/screenplay/abilities/CallAnApi.ts +90 -108
  86. package/src/screenplay/interactions/ChangeApiConfig.ts +99 -111
  87. package/src/screenplay/interactions/Send.ts +46 -61
  88. package/src/screenplay/interactions/index.ts +0 -1
  89. package/src/screenplay/questions/LastResponse.ts +153 -100
  90. package/tsconfig.build.json +10 -0
  91. package/lib/model/DeleteRequest.d.ts +0 -63
  92. package/lib/model/DeleteRequest.js +0 -70
  93. package/lib/model/DeleteRequest.js.map +0 -1
  94. package/lib/model/GetRequest.d.ts +0 -70
  95. package/lib/model/GetRequest.js +0 -77
  96. package/lib/model/GetRequest.js.map +0 -1
  97. package/lib/model/HTTPRequest.d.ts +0 -56
  98. package/lib/model/HTTPRequest.js.map +0 -1
  99. package/lib/model/HeadRequest.d.ts +0 -55
  100. package/lib/model/HeadRequest.js +0 -62
  101. package/lib/model/HeadRequest.js.map +0 -1
  102. package/lib/model/OptionsRequest.d.ts +0 -58
  103. package/lib/model/OptionsRequest.js +0 -65
  104. package/lib/model/OptionsRequest.js.map +0 -1
  105. package/lib/model/PatchRequest.d.ts +0 -65
  106. package/lib/model/PatchRequest.js +0 -74
  107. package/lib/model/PatchRequest.js.map +0 -1
  108. package/lib/model/PostRequest.d.ts +0 -102
  109. package/lib/model/PostRequest.js +0 -111
  110. package/lib/model/PostRequest.js.map +0 -1
  111. package/lib/model/PutRequest.d.ts +0 -75
  112. package/lib/model/PutRequest.js +0 -84
  113. package/lib/model/PutRequest.js.map +0 -1
  114. package/lib/model/index.js.map +0 -1
  115. package/lib/screenplay/interactions/ChangeApiUrl.d.ts +0 -82
  116. package/lib/screenplay/interactions/ChangeApiUrl.js +0 -97
  117. package/lib/screenplay/interactions/ChangeApiUrl.js.map +0 -1
  118. package/src/model/DeleteRequest.ts +0 -71
  119. package/src/model/GetRequest.ts +0 -78
  120. package/src/model/HeadRequest.ts +0 -63
  121. package/src/model/OptionsRequest.ts +0 -66
  122. package/src/model/PatchRequest.ts +0 -76
  123. package/src/model/PostRequest.ts +0 -113
  124. package/src/model/PutRequest.ts +0 -86
  125. package/src/screenplay/interactions/ChangeApiUrl.ts +0 -97
  126. package/tsconfig.eslint.json +0 -10
  127. /package/src/{model → models}/index.ts +0 -0
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PutRequest = void 0;
4
+ const core_1 = require("@serenity-js/core");
5
+ const HTTPRequest_1 = require("./HTTPRequest");
6
+ /**
7
+ * The PUT method requests that the state of the target resource be
8
+ * created or replaced with the state defined by the representation
9
+ * enclosed in the request message payload.
10
+ *
11
+ * PUT request should be used when you want to create
12
+ * a new resource at a known `resourceUri` (e.g. `/books/0-688-00230-7`)
13
+ * or replace an existing resource at such `resourceUri`.
14
+ *
15
+ * PUT request is [idempotent](https://developer.mozilla.org/en-US/docs/Glossary/Idempotent):
16
+ * calling it once or several times successively has the same effect (that is no _side effect_).
17
+ *
18
+ * ## Create a new resource at a known location
19
+ *
20
+ * ```ts
21
+ * import { actorCalled } from '@serenity-js/core';
22
+ * import { CallAnApi, LastResponse, PutRequest, Send } from '@serenity-js/rest';
23
+ * import { Ensure, equals } from '@serenity-js/assertions';
24
+ *
25
+ * await actorCalled('Apisit')
26
+ * .whoCan(CallAnApi.at('https://api.example.org/'))
27
+ * .attemptsTo(
28
+ * Send.a(PutRequest.to('/books/0-688-00230-7').with({
29
+ * isbn: '0-688-00230-7',
30
+ * title: 'Zen and the Art of Motorcycle Maintenance: An Inquiry into Values',
31
+ * author: 'Robert M. Pirsig',
32
+ * })),
33
+ * Ensure.that(LastResponse.status(), equals(201)),
34
+ * )
35
+ * ```
36
+ *
37
+ * ## Learn more
38
+ * - https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT
39
+ * - https://tools.ietf.org/html/rfc7231#section-4.3.4
40
+ *
41
+ * @group Models
42
+ */
43
+ class PutRequest extends HTTPRequest_1.HTTPRequest {
44
+ /**
45
+ * Configures the object with a destination URI.
46
+ *
47
+ * When the `resourceUri` is not a fully qualified URL but a path, such as `/products/2`,
48
+ * it gets concatenated with the URL provided to the Axios instance
49
+ * when the {@apilink Ability|ability} to {@apilink CallAnApi} was instantiated.
50
+ *
51
+ * @param resourceUri
52
+ * The URI where the {@apilink Actor}
53
+ * should send the {@apilink HTTPRequest}
54
+ */
55
+ static to(resourceUri) {
56
+ return new PutRequest(resourceUri);
57
+ }
58
+ /**
59
+ * Configures the object with a request body.
60
+ *
61
+ * @param data
62
+ * Data to be sent to the `resourceUri`
63
+ */
64
+ with(data) {
65
+ return new PutRequest(this.resourceUri, data, this.config);
66
+ }
67
+ /**
68
+ * Overrides the default Axios request configuration provided
69
+ * when the {@apilink Ability|ability} to {@apilink CallAnApi} was instantiated.
70
+ *
71
+ * #### Learn more
72
+ * - {@apilink Answerable}
73
+ * - {@apilink WithAnswerableProperties}
74
+ * - [AxiosRequestConfig](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L75-L113)
75
+ *
76
+ * @param {Answerable<WithAnswerableProperties<AxiosRequestConfig>>} config
77
+ * Axios request configuration overrides
78
+ */
79
+ using(config) {
80
+ return new PutRequest(this.resourceUri, this.data, core_1.Question.fromObject(config));
81
+ }
82
+ }
83
+ exports.PutRequest = PutRequest;
84
+ //# sourceMappingURL=PutRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PutRequest.js","sourceRoot":"","sources":["../../src/models/PutRequest.ts"],"names":[],"mappings":";;;AAAA,4CAAmF;AAGnF,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,UAAW,SAAQ,yBAAW;IAEvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,CAAC,WAA+B;QACrC,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,IAAqB;QACtB,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,MAAgE;QAClE,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,eAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACpF,CAAC;CACJ;AA1CD,gCA0CC"}
@@ -6,3 +6,4 @@ export * from './OptionsRequest';
6
6
  export * from './PatchRequest';
7
7
  export * from './PostRequest';
8
8
  export * from './PutRequest';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,+CAA6B;AAC7B,gDAA8B;AAC9B,gDAA8B;AAC9B,mDAAiC;AACjC,iDAA+B;AAC/B,gDAA8B;AAC9B,+CAA6B"}
@@ -1,151 +1,140 @@
1
- import { Ability, UsesAbilities } from '@serenity-js/core';
2
- import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
1
+ import { Ability } from '@serenity-js/core';
2
+ import { AxiosDefaults, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
3
3
  /**
4
- * @desc
5
- * An {@link @serenity-js/core/lib/screenplay~Ability} that enables the {@link Actor} to call a HTTP API.
6
- * If you need to connect via a proxy, check out [this article](https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d).
4
+ * An {@apilink Ability} that enables the {@apilink Actor} to call an HTTP API.
7
5
  *
8
- * @example <caption>Using a default Axios HTTP client</caption>
9
- * import { Actor } from '@serenity-js/core';
10
- * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
11
- * import { Ensure, equals } from '@serenity-js/assertions';
6
+ * If you need to connect via a proxy, check out ["Using Axios behind corporate proxies"](https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d).
12
7
  *
13
- * const actor = Actor.named('Apisit').whoCan(
14
- * CallAnApi.at('https://myapp.com/api'),
15
- * );
8
+ * ## Using the default Axios HTTP client
16
9
  *
17
- * actor.attemptsTo(
18
- * Send.a(GetRequest.to('/users/2')),
19
- * Ensure.that(LastResponse.status(), equals(200)),
20
- * );
10
+ * ```ts
11
+ * import { actorCalled } from '@serenity-js/core'
12
+ * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
13
+ * import { Ensure, equals } from '@serenity-js/assertions'
21
14
  *
22
- * @example <caption>Using Axios client with custom configuration</caption>
23
- * import { Actor } from '@serenity-js/core';
24
- * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
25
- * import { Ensure, equals } from '@serenity-js/assertions';
15
+ * await actorCalled('Apisitt')
16
+ * .whoCan(
17
+ * CallAnApi.at('https://api.example.org/')
18
+ * )
19
+ * .attemptsTo(
20
+ * Send.a(GetRequest.to('/users/2')),
21
+ * Ensure.that(LastResponse.status(), equals(200)),
22
+ * )
23
+ * ```
26
24
  *
27
- * import axios from 'axios';
25
+ * ## Using Axios client with custom configuration
28
26
  *
29
- * const axiosInstance = axios.create({
30
- * timeout: 5 * 1000,
31
- * headers: {
32
- * 'X-Custom-Api-Key': 'secret-key',
33
- * },
34
- * });
27
+ * ```ts
28
+ * import { actorCalled } from '@serenity-js/core'
29
+ * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
30
+ * import { Ensure, equals } from '@serenity-js/assertions'
35
31
  *
36
- * const actor = Actor.named('Apisit').whoCan(
37
- * CallAnApi.using(axiosInstance),
38
- * );
32
+ * import * as axios from 'axios'
39
33
  *
40
- * actor.attemptsTo(
41
- * Send.a(GetRequest.to('/users/2')),
42
- * Ensure.that(LastResponse.status(), equals(200)),
43
- * );
34
+ * const axiosInstance = axios.create({
35
+ * timeout: 5 * 1000,
36
+ * headers: {
37
+ * 'X-Custom-Api-Key': 'secret-key',
38
+ * },
39
+ * });
44
40
  *
45
- * @see https://github.com/axios/axios
46
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
41
+ * await actorCalled('Apisitt')
42
+ * .whoCan(
43
+ * CallAnApi.using(axiosInstance),
44
+ * )
45
+ * .attemptsTo(
46
+ * Send.a(GetRequest.to('/users/2')),
47
+ * Ensure.that(LastResponse.status(), equals(200)),
48
+ * )
49
+ * ```
47
50
  *
48
- * @public
49
- * @implements {@link @serenity-js/core/lib/screenplay~Ability}
51
+ * ## Learn more
52
+ * - https://github.com/axios/axios
53
+ * - https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
54
+ *
55
+ * @group Abilities
50
56
  */
51
- export declare class CallAnApi implements Ability {
57
+ export declare class CallAnApi extends Ability {
52
58
  private readonly axiosInstance;
53
59
  /** @private */
54
60
  private lastResponse;
55
61
  /**
56
- * @desc
57
- * Ability to Call and api at a specified baseUrl
62
+ * Produces an {@apilink Ability|ability} to call a REST api at a specified baseUrl
58
63
  *
59
- * Default timeout is set to 2s.
64
+ * Default timeout is set to 2s.
60
65
  *
61
- * Default request headers:
62
- * - Accept: application/json,application/xml
66
+ * Default request headers:
67
+ * - `Accept`: `application/json,application/xml`
63
68
  *
64
- * @param {string} baseURL
65
- * @returns {CallAnApi}
69
+ * @param baseURL
66
70
  */
67
71
  static at(baseURL: string): CallAnApi;
68
72
  /**
69
- * @desc
70
- * Ability to Call a REST API using a given axios instance.
73
+ * Produces an {@apilink Ability|ability} to call a REST API using a given axios instance.
71
74
  *
72
- * Useful when you need to customise Axios to
73
- * [make it aware of proxies](https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d),
74
- * for example.
75
+ * Useful when you need to customise Axios to
76
+ * [make it aware of proxies](https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d),
77
+ * for example.
75
78
  *
76
- * @param {AxiosInstance} axiosInstance
77
- * @returns {CallAnApi}
79
+ * #### Learn more
80
+ * - [AxiosInstance](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L235-L238)
78
81
  *
79
- * @see {@link AxiosInstance}
82
+ * @param axiosInstance
80
83
  */
81
84
  static using(axiosInstance: AxiosInstance): CallAnApi;
82
85
  /**
83
- * @desc
84
- * Used to access the Actor's ability to {@link CallAnApi}
85
- * from within the {@link @serenity-js/core/lib/screenplay~Interaction} classes,
86
- * such as {@link Send}.
86
+ * #### Learn more
87
+ * - [AxiosInstance](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L235-L238)
87
88
  *
88
- * @param {UsesAbilities} actor
89
- * @return {CallAnApi}
90
- */
91
- static as(actor: UsesAbilities): CallAnApi;
92
- /**
93
- * @param {AxiosInstance} axiosInstance
89
+ * @param axiosInstance
94
90
  * A pre-configured instance of the Axios HTTP client
95
- *
96
- * @see {@link AxiosInstance}
97
91
  */
98
92
  constructor(axiosInstance: AxiosInstance);
99
93
  /**
100
- * @desc
101
- * Allows for the original Axios config to be changed after
102
- * the {@link CallAnApi} {@link @serenity-js/core/lib/screenplay~Ability}
103
- * has been instantiated and given to the {@link Actor}.
94
+ * Allows for the original Axios config to be changed after
95
+ * the {@apilink Ability|ability} to {@apilink CallAnApi}
96
+ * has been instantiated and given to the {@apilink Actor}.
104
97
  *
105
- * @param {function (original: AxiosRequestConfig): any} fn
106
- * @returns {void}
98
+ * #### Learn more
99
+ * - [AxiosRequestConfig](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L75-L113)
107
100
  *
108
- * @see {@link AxiosRequestConfig}
101
+ * @param fn
109
102
  */
110
- modifyConfig(fn: (original: AxiosRequestConfig) => any): void;
103
+ modifyConfig(fn: (original: AxiosDefaults<any>) => any): void;
111
104
  /**
112
- * @desc
113
- * Sends a HTTP request to a specified url.
114
- * Response will be cached and available via {@link CallAnApi#mapLastResponse}
105
+ * Sends an HTTP request to a specified url.
106
+ * Response will be cached and available via {@apilink mapLastResponse}
115
107
  *
116
- * @param {AxiosRequestConfig} config
117
- * Axios request configuration, which can be used to override the defaults
118
- * provided when the {@link CallAnApi} {@link @serenity-js/core/lib/screenplay~Ability} is instantiated
119
- *
120
- * @returns {Promise<AxiosResponse>}
121
- * A promise of an AxiosResponse
108
+ * #### Learn more
109
+ * - [AxiosRequestConfig](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L75-L113)
110
+ * - [AxiosResponse](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L133-L140)
122
111
  *
123
- * @see {@link AxiosRequestConfig}
124
- * @see {@link AxiosResponse}
112
+ * @param config
113
+ * Axios request configuration, which can be used to override the defaults
114
+ * provided when the {@apilink Ability|ability} to {@apilink CallAnApi} was instantiated.
125
115
  */
126
116
  request(config: AxiosRequestConfig): Promise<AxiosResponse>;
127
117
  /**
128
- * @desc
129
- * Resolves the final URL, based on the {@link AxiosRequestConfig} provided
130
- * any any defaults {@link AxiosInstance} has been configured with.
118
+ * Resolves the final URL, based on the {@apilink AxiosRequestConfig} provided
119
+ * and any defaults that the {@apilink AxiosInstance} has been configured with.
131
120
  *
132
- * @param {AxiosRequestConfig} config
133
- * @returns {string}
121
+ * #### Learn more
122
+ * - [AxiosRequestConfig](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L75-L113)
123
+ * - [AxiosInstance](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L235-L238)
134
124
  *
135
- * @see {@link AxiosRequestConfig}
136
- * @see {@link AxiosInstance}
125
+ * @param config
137
126
  */
138
127
  resolveUrl(config: AxiosRequestConfig): string;
139
128
  /**
140
- * @desc
141
- * Maps the last cached response to another type.
142
- * Useful when you need to extract a portion of the {@link AxiosResponse} object.
129
+ * Maps the last cached response to another type.
130
+ * Useful when you need to extract a portion of the {@apilink AxiosResponse} object.
143
131
  *
144
- * @param {function<T>(AxiosResponse): T} fn - mapper function
145
- * @returns {T}
132
+ * #### Learn more
133
+ * - [AxiosResponse](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L133-L140)
146
134
  *
147
- * @see {@link AxiosResponse}
135
+ * @param mappingFunction
148
136
  */
149
- mapLastResponse<T>(fn: (response: AxiosResponse) => T): T;
137
+ mapLastResponse<T>(mappingFunction: (response: AxiosResponse) => T): T;
150
138
  private captureResponseOf;
151
139
  }
140
+ //# sourceMappingURL=CallAnApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CallAnApi.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/CallAnApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAwD,MAAM,mBAAmB,CAAC;AAClG,OAAc,EAAE,aAAa,EAAc,aAAa,EAAgB,kBAAkB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEzH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBAAa,SAAU,SAAQ,OAAO;IA8CtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IA5C1C,eAAe;IACf,OAAO,CAAC,YAAY,CAAgB;IAEpC;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS;IAQrC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS;IAIrD;;;;;;OAMG;gBAC0B,aAAa,EAAE,aAAa;IAIzD;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,IAAI;IAI7D;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IAI3D;;;;;;;;;OASG;IACH,UAAU,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM;IAI9C;;;;;;;;OAQG;IACH,eAAe,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,CAAC,GAAG,CAAC;IAQtE,OAAO,CAAC,iBAAiB;CA0B5B"}
@@ -1,79 +1,75 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.CallAnApi = void 0;
4
7
  const core_1 = require("@serenity-js/core");
5
- const axios_1 = require("axios");
6
- const mergeConfig = require('axios/lib/core/mergeConfig'); // eslint-disable-line @typescript-eslint/no-var-requires
7
- const buildFullPath = require('axios/lib/core/buildFullPath'); // eslint-disable-line @typescript-eslint/no-var-requires
8
+ const axios_1 = __importDefault(require("axios"));
8
9
  /**
9
- * @desc
10
- * An {@link @serenity-js/core/lib/screenplay~Ability} that enables the {@link Actor} to call a HTTP API.
11
- * If you need to connect via a proxy, check out [this article](https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d).
10
+ * An {@apilink Ability} that enables the {@apilink Actor} to call an HTTP API.
12
11
  *
13
- * @example <caption>Using a default Axios HTTP client</caption>
14
- * import { Actor } from '@serenity-js/core';
15
- * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
16
- * import { Ensure, equals } from '@serenity-js/assertions';
12
+ * If you need to connect via a proxy, check out ["Using Axios behind corporate proxies"](https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d).
17
13
  *
18
- * const actor = Actor.named('Apisit').whoCan(
19
- * CallAnApi.at('https://myapp.com/api'),
20
- * );
14
+ * ## Using the default Axios HTTP client
21
15
  *
22
- * actor.attemptsTo(
23
- * Send.a(GetRequest.to('/users/2')),
24
- * Ensure.that(LastResponse.status(), equals(200)),
25
- * );
16
+ * ```ts
17
+ * import { actorCalled } from '@serenity-js/core'
18
+ * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
19
+ * import { Ensure, equals } from '@serenity-js/assertions'
26
20
  *
27
- * @example <caption>Using Axios client with custom configuration</caption>
28
- * import { Actor } from '@serenity-js/core';
29
- * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
30
- * import { Ensure, equals } from '@serenity-js/assertions';
21
+ * await actorCalled('Apisitt')
22
+ * .whoCan(
23
+ * CallAnApi.at('https://api.example.org/')
24
+ * )
25
+ * .attemptsTo(
26
+ * Send.a(GetRequest.to('/users/2')),
27
+ * Ensure.that(LastResponse.status(), equals(200)),
28
+ * )
29
+ * ```
31
30
  *
32
- * import axios from 'axios';
31
+ * ## Using Axios client with custom configuration
33
32
  *
34
- * const axiosInstance = axios.create({
35
- * timeout: 5 * 1000,
36
- * headers: {
37
- * 'X-Custom-Api-Key': 'secret-key',
38
- * },
39
- * });
33
+ * ```ts
34
+ * import { actorCalled } from '@serenity-js/core'
35
+ * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
36
+ * import { Ensure, equals } from '@serenity-js/assertions'
40
37
  *
41
- * const actor = Actor.named('Apisit').whoCan(
42
- * CallAnApi.using(axiosInstance),
43
- * );
38
+ * import * as axios from 'axios'
44
39
  *
45
- * actor.attemptsTo(
46
- * Send.a(GetRequest.to('/users/2')),
47
- * Ensure.that(LastResponse.status(), equals(200)),
48
- * );
40
+ * const axiosInstance = axios.create({
41
+ * timeout: 5 * 1000,
42
+ * headers: {
43
+ * 'X-Custom-Api-Key': 'secret-key',
44
+ * },
45
+ * });
49
46
  *
50
- * @see https://github.com/axios/axios
51
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
47
+ * await actorCalled('Apisitt')
48
+ * .whoCan(
49
+ * CallAnApi.using(axiosInstance),
50
+ * )
51
+ * .attemptsTo(
52
+ * Send.a(GetRequest.to('/users/2')),
53
+ * Ensure.that(LastResponse.status(), equals(200)),
54
+ * )
55
+ * ```
52
56
  *
53
- * @public
54
- * @implements {@link @serenity-js/core/lib/screenplay~Ability}
57
+ * ## Learn more
58
+ * - https://github.com/axios/axios
59
+ * - https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
60
+ *
61
+ * @group Abilities
55
62
  */
56
- class CallAnApi {
57
- /**
58
- * @param {AxiosInstance} axiosInstance
59
- * A pre-configured instance of the Axios HTTP client
60
- *
61
- * @see {@link AxiosInstance}
62
- */
63
- constructor(axiosInstance) {
64
- this.axiosInstance = axiosInstance;
65
- }
63
+ class CallAnApi extends core_1.Ability {
66
64
  /**
67
- * @desc
68
- * Ability to Call and api at a specified baseUrl
65
+ * Produces an {@apilink Ability|ability} to call a REST api at a specified baseUrl
69
66
  *
70
- * Default timeout is set to 2s.
67
+ * Default timeout is set to 2s.
71
68
  *
72
- * Default request headers:
73
- * - Accept: application/json,application/xml
69
+ * Default request headers:
70
+ * - `Accept`: `application/json,application/xml`
74
71
  *
75
- * @param {string} baseURL
76
- * @returns {CallAnApi}
72
+ * @param baseURL
77
73
  */
78
74
  static at(baseURL) {
79
75
  return new CallAnApi(axios_1.default.create({
@@ -83,95 +79,86 @@ class CallAnApi {
83
79
  }));
84
80
  }
85
81
  /**
86
- * @desc
87
- * Ability to Call a REST API using a given axios instance.
82
+ * Produces an {@apilink Ability|ability} to call a REST API using a given axios instance.
88
83
  *
89
- * Useful when you need to customise Axios to
90
- * [make it aware of proxies](https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d),
91
- * for example.
84
+ * Useful when you need to customise Axios to
85
+ * [make it aware of proxies](https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d),
86
+ * for example.
92
87
  *
93
- * @param {AxiosInstance} axiosInstance
94
- * @returns {CallAnApi}
88
+ * #### Learn more
89
+ * - [AxiosInstance](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L235-L238)
95
90
  *
96
- * @see {@link AxiosInstance}
91
+ * @param axiosInstance
97
92
  */
98
93
  static using(axiosInstance) {
99
94
  return new CallAnApi(axiosInstance);
100
95
  }
101
96
  /**
102
- * @desc
103
- * Used to access the Actor's ability to {@link CallAnApi}
104
- * from within the {@link @serenity-js/core/lib/screenplay~Interaction} classes,
105
- * such as {@link Send}.
97
+ * #### Learn more
98
+ * - [AxiosInstance](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L235-L238)
106
99
  *
107
- * @param {UsesAbilities} actor
108
- * @return {CallAnApi}
100
+ * @param axiosInstance
101
+ * A pre-configured instance of the Axios HTTP client
109
102
  */
110
- static as(actor) {
111
- return actor.abilityTo(CallAnApi);
103
+ constructor(axiosInstance) {
104
+ super();
105
+ this.axiosInstance = axiosInstance;
112
106
  }
113
107
  /**
114
- * @desc
115
- * Allows for the original Axios config to be changed after
116
- * the {@link CallAnApi} {@link @serenity-js/core/lib/screenplay~Ability}
117
- * has been instantiated and given to the {@link Actor}.
108
+ * Allows for the original Axios config to be changed after
109
+ * the {@apilink Ability|ability} to {@apilink CallAnApi}
110
+ * has been instantiated and given to the {@apilink Actor}.
118
111
  *
119
- * @param {function (original: AxiosRequestConfig): any} fn
120
- * @returns {void}
112
+ * #### Learn more
113
+ * - [AxiosRequestConfig](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L75-L113)
121
114
  *
122
- * @see {@link AxiosRequestConfig}
115
+ * @param fn
123
116
  */
124
117
  modifyConfig(fn) {
125
118
  fn(this.axiosInstance.defaults);
126
119
  }
127
120
  /**
128
- * @desc
129
- * Sends a HTTP request to a specified url.
130
- * Response will be cached and available via {@link CallAnApi#mapLastResponse}
121
+ * Sends an HTTP request to a specified url.
122
+ * Response will be cached and available via {@apilink mapLastResponse}
131
123
  *
132
- * @param {AxiosRequestConfig} config
133
- * Axios request configuration, which can be used to override the defaults
134
- * provided when the {@link CallAnApi} {@link @serenity-js/core/lib/screenplay~Ability} is instantiated
135
- *
136
- * @returns {Promise<AxiosResponse>}
137
- * A promise of an AxiosResponse
124
+ * #### Learn more
125
+ * - [AxiosRequestConfig](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L75-L113)
126
+ * - [AxiosResponse](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L133-L140)
138
127
  *
139
- * @see {@link AxiosRequestConfig}
140
- * @see {@link AxiosResponse}
128
+ * @param config
129
+ * Axios request configuration, which can be used to override the defaults
130
+ * provided when the {@apilink Ability|ability} to {@apilink CallAnApi} was instantiated.
141
131
  */
142
132
  request(config) {
143
133
  return this.captureResponseOf(this.axiosInstance.request(config));
144
134
  }
145
135
  /**
146
- * @desc
147
- * Resolves the final URL, based on the {@link AxiosRequestConfig} provided
148
- * any any defaults {@link AxiosInstance} has been configured with.
136
+ * Resolves the final URL, based on the {@apilink AxiosRequestConfig} provided
137
+ * and any defaults that the {@apilink AxiosInstance} has been configured with.
149
138
  *
150
- * @param {AxiosRequestConfig} config
151
- * @returns {string}
139
+ * #### Learn more
140
+ * - [AxiosRequestConfig](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L75-L113)
141
+ * - [AxiosInstance](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L235-L238)
152
142
  *
153
- * @see {@link AxiosRequestConfig}
154
- * @see {@link AxiosInstance}
143
+ * @param config
155
144
  */
156
145
  resolveUrl(config) {
157
- const merged = mergeConfig(this.axiosInstance.defaults, config);
158
- return buildFullPath(merged.baseURL, merged.url);
146
+ return this.axiosInstance.getUri(config);
159
147
  }
160
148
  /**
161
- * @desc
162
- * Maps the last cached response to another type.
163
- * Useful when you need to extract a portion of the {@link AxiosResponse} object.
149
+ * Maps the last cached response to another type.
150
+ * Useful when you need to extract a portion of the {@apilink AxiosResponse} object.
164
151
  *
165
- * @param {function<T>(AxiosResponse): T} fn - mapper function
166
- * @returns {T}
152
+ * #### Learn more
153
+ * - [AxiosResponse](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L133-L140)
167
154
  *
168
- * @see {@link AxiosResponse}
155
+ * @param mappingFunction
169
156
  */
170
- mapLastResponse(fn) {
157
+ mapLastResponse(mappingFunction) {
171
158
  if (!this.lastResponse) {
172
159
  throw new core_1.LogicError(`Make sure to perform a HTTP API call before checking on the response`);
173
160
  }
174
- return fn(this.lastResponse);
161
+ return mappingFunction(this.lastResponse);
175
162
  }
176
163
  captureResponseOf(promisedResponse) {
177
164
  return promisedResponse
@@ -1 +1 @@
1
- {"version":3,"file":"CallAnApi.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/CallAnApi.ts"],"names":[],"mappings":";;;AAAA,4CAAiH;AACjH,iCAA0G;AAC1G,MAAM,WAAW,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC,C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