@serenity-js/rest 3.0.0-rc.6 → 3.0.0-rc.7

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
7
+
8
+
9
+ ### Features
10
+
11
+ * **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
7
18
 
8
19
 
@@ -1,4 +1,4 @@
1
- import { Adapter, Question } from '@serenity-js/core';
1
+ import { QuestionAdapter } from '@serenity-js/core';
2
2
  /**
3
3
  * @desc
4
4
  * Provides access to the properties of the last {@link AxiosResponse} object,
@@ -58,7 +58,7 @@ export declare class LastResponse {
58
58
  *
59
59
  * @returns {@serenity-js/core/lib/screenplay~Question<number>}
60
60
  */
61
- static status(): Question<number> & Adapter<number>;
61
+ static status(): QuestionAdapter<number>;
62
62
  /**
63
63
  * @desc
64
64
  * Enables asserting on the {@link LastResponse} body
@@ -115,7 +115,7 @@ export declare class LastResponse {
115
115
  * @see {@link @serenity-js/core/lib/screenplay/questions~Property}
116
116
  * @see {@link @serenity-js/core/lib/screenplay/questions~List}
117
117
  */
118
- static body<T = any>(): Question<T> & Adapter<T>;
118
+ static body<T = any>(): QuestionAdapter<T>;
119
119
  /**
120
120
  * @desc
121
121
  * Enables asserting on one of the {@link LastResponse}'s headers
@@ -123,7 +123,7 @@ export declare class LastResponse {
123
123
  * @param {string} name
124
124
  * @returns {@serenity-js/core/lib/screenplay~Question<string>}
125
125
  */
126
- static header(name: string): Question<string> & Adapter<string>;
126
+ static header(name: string): QuestionAdapter<string>;
127
127
  /**
128
128
  * @desc
129
129
  * Enables asserting on all of the {@link LastResponse}'s headers,
@@ -131,5 +131,5 @@ export declare class LastResponse {
131
131
  *
132
132
  * @returns {@serenity-js/core/lib/screenplay~Question<Record<string, string>>}
133
133
  */
134
- static headers(): Question<Record<string, string>> & Adapter<Record<string, string>>;
134
+ static headers(): QuestionAdapter<Record<string, string>>;
135
135
  }
@@ -63,7 +63,7 @@ class LastResponse {
63
63
  * @returns {@serenity-js/core/lib/screenplay~Question<number>}
64
64
  */
65
65
  static status() {
66
- return core_1.Question.about(`the status of the last response`, actor => {
66
+ return core_1.Question.about(`the status of the last response`, async (actor) => {
67
67
  return abilities_1.CallAnApi.as(actor).mapLastResponse(response => response.status);
68
68
  });
69
69
  }
@@ -124,7 +124,7 @@ class LastResponse {
124
124
  * @see {@link @serenity-js/core/lib/screenplay/questions~List}
125
125
  */
126
126
  static body() {
127
- return core_1.Question.about(`the body of the last response`, actor => {
127
+ return core_1.Question.about(`the body of the last response`, async (actor) => {
128
128
  return abilities_1.CallAnApi.as(actor).mapLastResponse(response => response.data);
129
129
  });
130
130
  }
@@ -136,7 +136,7 @@ class LastResponse {
136
136
  * @returns {@serenity-js/core/lib/screenplay~Question<string>}
137
137
  */
138
138
  static header(name) {
139
- return core_1.Question.about(`the '${name}' header of the last response`, actor => {
139
+ return core_1.Question.about(`the '${name}' header of the last response`, async (actor) => {
140
140
  return abilities_1.CallAnApi.as(actor).mapLastResponse(response => response.headers[name]);
141
141
  });
142
142
  }
@@ -148,7 +148,7 @@ class LastResponse {
148
148
  * @returns {@serenity-js/core/lib/screenplay~Question<Record<string, string>>}
149
149
  */
150
150
  static headers() {
151
- return core_1.Question.about(`the headers or the last response`, actor => {
151
+ return core_1.Question.about(`the headers or the last response`, async (actor) => {
152
152
  return abilities_1.CallAnApi.as(actor).mapLastResponse(response => response.headers);
153
153
  });
154
154
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LastResponse.js","sourceRoot":"","sources":["../../../src/screenplay/questions/LastResponse.ts"],"names":[],"mappings":";;;AAAA,4CAAsD;AAEtD,4CAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAa,YAAY;IAErB;;;;;OAKG;IACH,MAAM,CAAC,MAAM;QACT,OAAO,eAAQ,CAAC,KAAK,CAAS,iCAAiC,EAAE,KAAK,CAAC,EAAE;YACrE,OAAO,qBAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,MAAM,CAAC,IAAI;QACP,OAAO,eAAQ,CAAC,KAAK,CAAI,+BAA+B,EAAE,KAAK,CAAC,EAAE;YAC9D,OAAO,qBAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,eAAe,CAAI,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAS,CAAC,CAAC;QAClF,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,IAAY;QACtB,OAAO,eAAQ,CAAC,KAAK,CAAS,QAAS,IAAK,+BAA+B,EAAE,KAAK,CAAC,EAAE;YACjF,OAAO,qBAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,OAAO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,OAAO,qBAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,OAAO;QACV,OAAO,eAAQ,CAAC,KAAK,CAAyB,kCAAkC,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE;YAC5F,OAAO,qBAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AArGD,oCAqGC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/rest",
3
- "version": "3.0.0-rc.6",
3
+ "version": "3.0.0-rc.7",
4
4
  "description": "Test REST APIs with Serenity/JS",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -47,13 +47,13 @@
47
47
  "npm": "^6 || ^7 || ^8"
48
48
  },
49
49
  "dependencies": {
50
- "@serenity-js/core": "3.0.0-rc.6",
50
+ "@serenity-js/core": "3.0.0-rc.7",
51
51
  "axios": "^0.21.4"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@documentation/esdoc-template": "3.0.0",
55
55
  "@integration/testing-tools": "3.0.0",
56
- "@serenity-js/assertions": "3.0.0-rc.6",
56
+ "@serenity-js/assertions": "3.0.0-rc.7",
57
57
  "@types/chai": "^4.3.0",
58
58
  "@types/mocha": "^9.0.0",
59
59
  "axios-mock-adapter": "^1.20.0",
@@ -83,5 +83,5 @@
83
83
  "cache": true,
84
84
  "all": true
85
85
  },
86
- "gitHead": "83bff6ee044088e8cb601144c5854f2e20dabd1d"
86
+ "gitHead": "74f603a7a8e0c685a0ea5e4198aad6cc30aea91c"
87
87
  }
@@ -1,4 +1,4 @@
1
- import { Adapter, Question } from '@serenity-js/core';
1
+ import { Question, QuestionAdapter } from '@serenity-js/core';
2
2
 
3
3
  import { CallAnApi } from '../abilities';
4
4
 
@@ -62,8 +62,8 @@ export class LastResponse {
62
62
  *
63
63
  * @returns {@serenity-js/core/lib/screenplay~Question<number>}
64
64
  */
65
- static status(): Question<number> & Adapter<number> {
66
- return Question.about<number>(`the status of the last response`, actor => {
65
+ static status(): QuestionAdapter<number> {
66
+ return Question.about<number>(`the status of the last response`, async actor => {
67
67
  return CallAnApi.as(actor).mapLastResponse(response => response.status);
68
68
  });
69
69
  }
@@ -124,8 +124,8 @@ export class LastResponse {
124
124
  * @see {@link @serenity-js/core/lib/screenplay/questions~Property}
125
125
  * @see {@link @serenity-js/core/lib/screenplay/questions~List}
126
126
  */
127
- static body<T = any>(): Question<T> & Adapter<T> {
128
- return Question.about<T>(`the body of the last response`, actor => {
127
+ static body<T = any>(): QuestionAdapter<T> {
128
+ return Question.about<T>(`the body of the last response`, async actor => {
129
129
  return CallAnApi.as(actor).mapLastResponse<T>(response => response.data as T);
130
130
  });
131
131
  }
@@ -137,8 +137,8 @@ export class LastResponse {
137
137
  * @param {string} name
138
138
  * @returns {@serenity-js/core/lib/screenplay~Question<string>}
139
139
  */
140
- static header(name: string): Question<string> & Adapter<string> {
141
- return Question.about<string>(`the '${ name }' header of the last response`, actor => {
140
+ static header(name: string): QuestionAdapter<string> {
141
+ return Question.about<string>(`the '${ name }' header of the last response`, async actor => {
142
142
  return CallAnApi.as(actor).mapLastResponse(response => response.headers[name]);
143
143
  });
144
144
  }
@@ -150,8 +150,8 @@ export class LastResponse {
150
150
  *
151
151
  * @returns {@serenity-js/core/lib/screenplay~Question<Record<string, string>>}
152
152
  */
153
- static headers(): Question<Record<string, string>> & Adapter<Record<string, string>> {
154
- return Question.about<Record<string, string>>(`the headers or the last response`, actor => {
153
+ static headers(): QuestionAdapter<Record<string, string>> {
154
+ return Question.about<Record<string, string>>(`the headers or the last response`, async actor => {
155
155
  return CallAnApi.as(actor).mapLastResponse(response => response.headers);
156
156
  });
157
157
  }