@arkyn/server 1.4.51 → 1.4.54

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.
@@ -3,7 +3,8 @@ declare class Created<T> {
3
3
  body: T;
4
4
  init: ResponseInit;
5
5
  constructor(body: T, init?: ResponseInit);
6
- json(): Response;
6
+ response(): Response;
7
+ json(): Promise<any>;
7
8
  }
8
9
  export { created, Created };
9
10
  //# sourceMappingURL=created.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"created.d.ts","sourceRoot":"","sources":["../../src/httpResponses/created.ts"],"names":[],"mappings":"AAAA,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAMzD;AAED,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,YAAY,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAKxC,IAAI,IAAI,QAAQ;CAOjB;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"created.d.ts","sourceRoot":"","sources":["../../src/httpResponses/created.ts"],"names":[],"mappings":"AAAA,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAMzD;AAED,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,YAAY,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAKxC,QAAQ;IAQR,IAAI;CAOL;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -12,12 +12,19 @@ class Created {
12
12
  this.body = body;
13
13
  this.init = init || {};
14
14
  }
15
- json() {
15
+ response() {
16
16
  return new Response(JSON.stringify(this.body), {
17
17
  ...this.init,
18
18
  status: 201,
19
19
  headers: { "Content-Type": "application/json", ...this.init.headers },
20
20
  });
21
21
  }
22
+ json() {
23
+ return new Response(JSON.stringify(this.body), {
24
+ ...this.init,
25
+ status: 201,
26
+ headers: { "Content-Type": "application/json", ...this.init.headers },
27
+ }).json();
28
+ }
22
29
  }
23
30
  export { created, Created };
@@ -2,7 +2,8 @@ declare function noContent(init?: ResponseInit): Response;
2
2
  declare class NoContent {
3
3
  init: ResponseInit;
4
4
  constructor(init?: ResponseInit);
5
- json(): Response;
5
+ response(): Response;
6
+ json(): Promise<any>;
6
7
  }
7
8
  export { noContent, NoContent };
8
9
  //# sourceMappingURL=noContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"noContent.d.ts","sourceRoot":"","sources":["../../src/httpResponses/noContent.ts"],"names":[],"mappings":"AAAA,iBAAS,SAAS,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAMhD;AAED,cAAM,SAAS;IACb,IAAI,EAAE,YAAY,CAAC;gBAEP,IAAI,CAAC,EAAE,YAAY;IAI/B,IAAI,IAAI,QAAQ;CAOjB;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"noContent.d.ts","sourceRoot":"","sources":["../../src/httpResponses/noContent.ts"],"names":[],"mappings":"AAAA,iBAAS,SAAS,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAMhD;AAED,cAAM,SAAS;IACb,IAAI,EAAE,YAAY,CAAC;gBAEP,IAAI,CAAC,EAAE,YAAY;IAI/B,QAAQ;IAQR,IAAI;CAOL;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
@@ -10,12 +10,19 @@ class NoContent {
10
10
  constructor(init) {
11
11
  this.init = init || {};
12
12
  }
13
- json() {
13
+ response() {
14
14
  return new Response(null, {
15
15
  ...this.init,
16
16
  status: 200,
17
17
  headers: { "Content-Type": "application/json", ...this.init.headers },
18
18
  });
19
19
  }
20
+ json() {
21
+ return new Response(null, {
22
+ ...this.init,
23
+ status: 200,
24
+ headers: { "Content-Type": "application/json", ...this.init.headers },
25
+ }).json();
26
+ }
20
27
  }
21
28
  export { noContent, NoContent };
@@ -3,7 +3,8 @@ declare class Success<T> {
3
3
  body: T;
4
4
  init: ResponseInit;
5
5
  constructor(body: T, init?: ResponseInit);
6
- json(): Response;
6
+ response(): Response;
7
+ json(): Promise<any>;
7
8
  }
8
9
  export { success, Success };
9
10
  //# sourceMappingURL=success.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"success.d.ts","sourceRoot":"","sources":["../../src/httpResponses/success.ts"],"names":[],"mappings":"AAAA,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAMzD;AAED,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,YAAY,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAKxC,IAAI,IAAI,QAAQ;CAOjB;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"success.d.ts","sourceRoot":"","sources":["../../src/httpResponses/success.ts"],"names":[],"mappings":"AAAA,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAMzD;AAED,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,YAAY,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAKxC,QAAQ;IAQR,IAAI;CAOL;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -12,12 +12,19 @@ class Success {
12
12
  this.body = body;
13
13
  this.init = init || {};
14
14
  }
15
- json() {
15
+ response() {
16
16
  return new Response(JSON.stringify(this.body), {
17
17
  ...this.init,
18
18
  status: 200,
19
19
  headers: { "Content-Type": "application/json", ...this.init.headers },
20
20
  });
21
21
  }
22
+ json() {
23
+ return new Response(JSON.stringify(this.body), {
24
+ ...this.init,
25
+ status: 200,
26
+ headers: { "Content-Type": "application/json", ...this.init.headers },
27
+ }).json();
28
+ }
22
29
  }
23
30
  export { success, Success };
@@ -3,7 +3,8 @@ declare class Updated<T> {
3
3
  body: T;
4
4
  init: ResponseInit;
5
5
  constructor(body: T, init?: ResponseInit);
6
- json(): Response;
6
+ response(): Response;
7
+ json(): Promise<any>;
7
8
  }
8
9
  export { updated, Updated };
9
10
  //# sourceMappingURL=updated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"updated.d.ts","sourceRoot":"","sources":["../../src/httpResponses/updated.ts"],"names":[],"mappings":"AAAA,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAMzD;AAED,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,YAAY,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAKxC,IAAI,IAAI,QAAQ;CAOjB;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"updated.d.ts","sourceRoot":"","sources":["../../src/httpResponses/updated.ts"],"names":[],"mappings":"AAAA,iBAAS,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAMzD;AAED,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,YAAY,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAKxC,QAAQ;IAQR,IAAI;CAOL;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -12,12 +12,19 @@ class Updated {
12
12
  this.body = body;
13
13
  this.init = init || {};
14
14
  }
15
- json() {
15
+ response() {
16
16
  return new Response(JSON.stringify(this.body), {
17
17
  ...this.init,
18
18
  status: 200,
19
19
  headers: { "Content-Type": "application/json", ...this.init.headers },
20
20
  });
21
21
  }
22
+ json() {
23
+ return new Response(JSON.stringify(this.body), {
24
+ ...this.init,
25
+ status: 200,
26
+ headers: { "Content-Type": "application/json", ...this.init.headers },
27
+ }).json();
28
+ }
22
29
  }
23
30
  export { updated, Updated };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/server",
3
- "version": "1.4.51",
3
+ "version": "1.4.54",
4
4
  "main": "./dist/bundle.js",
5
5
  "module": "./src/index.ts",
6
6
  "type": "module",
@@ -15,13 +15,21 @@ class Created<T> {
15
15
  this.init = init || {};
16
16
  }
17
17
 
18
- json(): Response {
18
+ response() {
19
19
  return new Response(JSON.stringify(this.body), {
20
20
  ...this.init,
21
21
  status: 201,
22
22
  headers: { "Content-Type": "application/json", ...this.init.headers },
23
23
  });
24
24
  }
25
+
26
+ json() {
27
+ return new Response(JSON.stringify(this.body), {
28
+ ...this.init,
29
+ status: 201,
30
+ headers: { "Content-Type": "application/json", ...this.init.headers },
31
+ }).json();
32
+ }
25
33
  }
26
34
 
27
35
  export { created, Created };
@@ -13,13 +13,21 @@ class NoContent {
13
13
  this.init = init || {};
14
14
  }
15
15
 
16
- json(): Response {
16
+ response() {
17
17
  return new Response(null, {
18
18
  ...this.init,
19
19
  status: 200,
20
20
  headers: { "Content-Type": "application/json", ...this.init.headers },
21
21
  });
22
22
  }
23
+
24
+ json() {
25
+ return new Response(null, {
26
+ ...this.init,
27
+ status: 200,
28
+ headers: { "Content-Type": "application/json", ...this.init.headers },
29
+ }).json();
30
+ }
23
31
  }
24
32
 
25
33
  export { noContent, NoContent };
@@ -15,13 +15,21 @@ class Success<T> {
15
15
  this.init = init || {};
16
16
  }
17
17
 
18
- json(): Response {
18
+ response() {
19
19
  return new Response(JSON.stringify(this.body), {
20
20
  ...this.init,
21
21
  status: 200,
22
22
  headers: { "Content-Type": "application/json", ...this.init.headers },
23
23
  });
24
24
  }
25
+
26
+ json() {
27
+ return new Response(JSON.stringify(this.body), {
28
+ ...this.init,
29
+ status: 200,
30
+ headers: { "Content-Type": "application/json", ...this.init.headers },
31
+ }).json();
32
+ }
25
33
  }
26
34
 
27
35
  export { success, Success };
@@ -15,13 +15,21 @@ class Updated<T> {
15
15
  this.init = init || {};
16
16
  }
17
17
 
18
- json(): Response {
18
+ response() {
19
19
  return new Response(JSON.stringify(this.body), {
20
20
  ...this.init,
21
21
  status: 200,
22
22
  headers: { "Content-Type": "application/json", ...this.init.headers },
23
23
  });
24
24
  }
25
+
26
+ json() {
27
+ return new Response(JSON.stringify(this.body), {
28
+ ...this.init,
29
+ status: 200,
30
+ headers: { "Content-Type": "application/json", ...this.init.headers },
31
+ }).json();
32
+ }
25
33
  }
26
34
 
27
35
  export { updated, Updated };