pinejs-client-supertest 1.3.5 → 1.4.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,170 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file
4
+ automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
5
+ This project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ ## 1.4.0 - 2023-04-03
8
+
9
+ * Allow passing a url string as the `app` instead of an Express app [Thodoris Greasidis]
10
+
11
+ ## 1.3.5 - 2022-09-26
12
+
13
+ * Delete redundant .resinci.yml [Thodoris Greasidis]
14
+
15
+ ## 1.3.4 - 2022-09-22
16
+
17
+ * Specify node 10 as the minimum supported node engine in the package.json [Thodoris Greasidis]
18
+ * Replace balenaCI with flowzone [Thodoris Greasidis]
19
+
20
+ ## 1.3.3 - 2022-02-08
21
+
22
+
23
+ <details>
24
+ <summary> Fix using along with pinejs-client v6.10 [Thodoris Greasidis] </summary>
25
+
26
+ > ### pinejs-client-js-6.10.1 - 2022-02-08
27
+ >
28
+ > * Do not await the _request() result to allow enhanced promises downstream [Thodoris Greasidis]
29
+ >
30
+ > ### pinejs-client-js-6.10.0 - 2022-01-24
31
+ >
32
+ > * Add optional retry logic to client [Paul Jonathan Zoulin]
33
+ >
34
+ > ### pinejs-client-js-6.9.6 - Invalid date
35
+ >
36
+ > * Reformat with the latest prettier [Thodoris Greasidis]
37
+ > * Delete CODEOWNERS [Thodoris Greasidis]
38
+ >
39
+ > ### pinejs-client-js-6.9.5 - 2021-03-22
40
+ >
41
+ > * Enable strict tsconfig options by default [Pagan Gazzard]
42
+ >
43
+ > ### pinejs-client-js-6.9.4 - 2021-03-10
44
+ >
45
+ > * Update dependencies [Pagan Gazzard]
46
+ >
47
+ </details>
48
+
49
+ ## 1.3.2 - 2021-06-30
50
+
51
+ * Delete CODEOWNERS [Thodoris Greasidis]
52
+
53
+ ## 1.3.1 - 2021-01-19
54
+
55
+ * Throw on not supported upsert & getOrCreate methods [Thodoris Greasidis]
56
+
57
+ ## 1.3.0 - 2021-01-18
58
+
59
+
60
+ <details>
61
+ <summary> Update pinejs-client-core to 6.9.3 and pick up improved typings [Pagan Gazzard] </summary>
62
+
63
+ > ### pinejs-client-js-6.9.3 - 2020-11-20
64
+ >
65
+ > * Explicitly specify return types for all functions [Pagan Gazzard]
66
+ >
67
+ > ### pinejs-client-js-6.9.2 - 2020-10-23
68
+ >
69
+ > * Update dev dependencies [Pagan Gazzard]
70
+ >
71
+ > ### pinejs-client-js-6.9.1 - 2020-09-17
72
+ >
73
+ > * Improve typings [Pagan Gazzard]
74
+ >
75
+ > ### pinejs-client-js-6.9.0 - 2020-09-07
76
+ >
77
+ > * Add 'getOrCreate' method supporting natural keys [Thodoris Greasidis]
78
+ >
79
+ > ### pinejs-client-js-6.8.0 - 2020-09-03
80
+ >
81
+ > * Add support for $format [Pagan Gazzard]
82
+ >
83
+ > ### pinejs-client-js-6.7.3 - 2020-08-26
84
+ >
85
+ > * Improve $orderby typing to allow `[{a: 'desc'}, {b: 'asc'}]` [Pagan Gazzard]
86
+ >
87
+ > ### pinejs-client-js-6.7.2 - 2020-08-24
88
+ >
89
+ > * Update dev dependencies [Pagan Gazzard]
90
+ >
91
+ > ### pinejs-client-js-6.7.1 - 2020-08-12
92
+ >
93
+ > * Fix prepare $count typings [Pagan Gazzard]
94
+ >
95
+ > ### pinejs-client-js-6.7.0 - 2020-08-12
96
+ >
97
+ > * Improve typings for request/post/put/patch/delete [Pagan Gazzard]
98
+ >
99
+ </details>
100
+
101
+ ## 1.2.0 - 2020-08-12
102
+
103
+
104
+ <details>
105
+ <summary> Update pinejs-client-core to 6.6.1 [Pagan Gazzard] </summary>
106
+
107
+ > ### pinejs-client-js-6.6.1 - 2020-08-11
108
+ >
109
+ > * Fix typing when id is specified to be `AnyObject | undefined` [Pagan Gazzard]
110
+ >
111
+ > ### pinejs-client-js-6.6.0 - 2020-08-11
112
+ >
113
+ > * Deprecate `$expand: { 'a/$count': {...} }` [Pagan Gazzard]
114
+ > * Deprecate `resource: 'a/$count'` and update typings to reflect it [Pagan Gazzard]
115
+ >
116
+ > ### pinejs-client-js-6.5.0 - 2020-08-11
117
+ >
118
+ > * Add `options: { $count: { ... } }` sugar for top level $count [Pagan Gazzard]
119
+ > * Add `$expand: { a: { $count: { ... } } }` sugar for $count in expands [Pagan Gazzard]
120
+ >
121
+ > ### pinejs-client-js-6.4.0 - 2020-08-11
122
+ >
123
+ > * Improve return typing of `subscribe` method [Pagan Gazzard]
124
+ >
125
+ > ### pinejs-client-js-6.3.0 - 2020-08-11
126
+ >
127
+ > * Fix Poll.on typings [Pagan Gazzard]
128
+ > * Improve return typing when id is passed to GET methods [Pagan Gazzard]
129
+ > * Remove `PromiseResult` type, use `Promise<PromiseResultTypes>` instead [Pagan Gazzard]
130
+ > * Remove `PromiseObj` type, use `Promise<{}>` instead [Pagan Gazzard]
131
+ >
132
+ > ### pinejs-client-js-6.2.0 - 2020-08-10
133
+ >
134
+ > * Add `$filter: { a: { $count: 1 } }` sugar for $count in filters [Pagan Gazzard]
135
+ >
136
+ > ### pinejs-client-js-6.1.2 - 2020-08-10
137
+ >
138
+ > * Remove redundant ParamsObj/SubscribeParamsObj types [Pagan Gazzard]
139
+ >
140
+ > ### pinejs-client-js-6.1.1 - 2020-08-10
141
+ >
142
+ > * Make use of `mapObj` helper in more places [Pagan Gazzard]
143
+ > * Use `Object.keys` in preference to `hasOwnProperty` where applicable [Pagan Gazzard]
144
+ >
145
+ </details>
146
+
147
+ ## 1.1.0 - 2020-07-22
148
+
149
+ * Update dependencies [Pagan Gazzard]
150
+
151
+ # v1.0.1
152
+ ## (2020-06-23)
153
+
154
+ * Add a .versionbot/CHANGELOG.yml for nested changelogs [Pagan Gazzard]
155
+
156
+ # v1.0.0
157
+ ## (2020-06-19)
158
+
159
+ * Bump build target to es2018 [Thodoris Greasidis]
160
+ * Add method overrides to provide supertest typings in the results [Thodoris Greasidis]
161
+ * Update pinejs-client-core to v6 [Thodoris Greasidis]
162
+
163
+ # v0.2.0
164
+ ## (2020-04-24)
165
+
166
+ * Initial code commit [Thodoris Greasidis]
167
+
168
+ ## v0.1.0 - 2020-04-24
169
+
170
+ * Initialize repository
package/build/common.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type UserParam = string | Partial<{
1
+ export type UserParam = string | Partial<{
2
2
  token: string;
3
3
  }>;
4
- export declare type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
4
+ export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
package/build/index.d.ts CHANGED
@@ -2,18 +2,18 @@ import { PinejsClientCore, Params } from 'pinejs-client-core';
2
2
  import type * as express from 'express';
3
3
  import type { CallbackHandler, Response, Test } from 'supertest';
4
4
  import type { UserParam, Overwrite } from './common';
5
- declare type supportedMethod = 'get' | 'put' | 'patch' | 'post' | 'delete';
6
- declare type PromiseResult<T = any> = Promise<T> & Omit<Test, 'expect' | 'then'> & Promise<Overwrite<Response, {
5
+ type supportedMethod = 'get' | 'put' | 'patch' | 'post' | 'delete';
6
+ type PromiseResult<T = any> = Promise<T> & Omit<Test, 'expect' | 'then'> & Promise<Overwrite<Response, {
7
7
  body: T;
8
8
  }>> & {
9
9
  expect(statusOrCheckerOrBody: number | ((res: Response) => any) | string | RegExp | object, callback?: CallbackHandler): PromiseResult<T>;
10
10
  expect(status: number, body: any, callback?: CallbackHandler): PromiseResult<T>;
11
11
  expect(field: string, val: string | RegExp, callback?: CallbackHandler): PromiseResult<T>;
12
12
  };
13
- declare type Resolvable<R> = R | PromiseLike<R>;
14
- declare type ResolvableReturnType<T extends (...args: any[]) => any> = T extends (...args: any[]) => Resolvable<infer R> ? R : any;
13
+ type Resolvable<R> = R | PromiseLike<R>;
14
+ type ResolvableReturnType<T extends (...args: any[]) => any> = T extends (...args: any[]) => Resolvable<infer R> ? R : any;
15
15
  interface BackendParams {
16
- app: express.Express;
16
+ app: express.Express | string;
17
17
  }
18
18
  export declare class PineTest extends PinejsClientCore<PineTest> {
19
19
  backendParams: BackendParams;
@@ -1,4 +1,4 @@
1
1
  import type * as express from 'express';
2
2
  import * as supertest from 'supertest';
3
3
  import { UserParam } from './common';
4
- export default function (app: express.Express, user?: UserParam): supertest.SuperAgentTest;
4
+ export default function (app: express.Express | string, user?: UserParam): supertest.SuperAgentTest;
@@ -1 +1 @@
1
- {"version":3,"file":"supertest.js","sourceRoot":"","sources":["../src/supertest.ts"],"names":[],"mappings":";;AACA,uCAAuC;AAGvC,mBAAyB,GAAoB,EAAE,IAAgB;IAE9D,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,EAAE;QAC3C,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;KACnB;IAGD,MAAM,GAAG,GAAQ,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAEtC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;KAC5C;IACD,OAAO,GAAyC,CAAC;AAClD,CAAC;AAfD,4BAeC"}
1
+ {"version":3,"file":"supertest.js","sourceRoot":"","sources":["../src/supertest.ts"],"names":[],"mappings":";;AACA,uCAAuC;AAGvC,mBAAyB,GAA6B,EAAE,IAAgB;IAEvE,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,EAAE;QAC3C,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;KACnB;IAGD,MAAM,GAAG,GAAQ,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAEtC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;KAC5C;IACD,OAAO,GAAyC,CAAC;AAClD,CAAC;AAfD,4BAeC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinejs-client-supertest",
3
- "version": "1.3.5",
3
+ "version": "1.4.0",
4
4
  "description": "This module provides the nodejs interface for the pinejs API using request.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -50,6 +50,6 @@
50
50
  "supertest": "^4.0.2"
51
51
  },
52
52
  "versionist": {
53
- "publishedAt": "2022-09-26T12:31:56.569Z"
53
+ "publishedAt": "2023-04-03T17:07:12.677Z"
54
54
  }
55
55
  }