@furystack/rest 4.1.16 → 4.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@furystack/rest",
3
- "version": "4.1.16",
3
+ "version": "4.2.0",
4
4
  "description": "Generic REST package",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "homepage": "https://github.com/furystack/furystack",
31
31
  "dependencies": {
32
- "@furystack/core": "^11.2.11",
32
+ "@furystack/core": "^11.3.0",
33
33
  "@furystack/inject": "^7.1.8"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/jest": "^29.5.0",
37
- "@types/node": "^18.15.10"
37
+ "@types/node": "^18.15.11"
38
38
  },
39
39
  "typings": "./types/index.d.ts",
40
40
  "gitHead": "1045d854bfd8c475b7035471d130d401417a2321"
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Endpoint model for updating entities
3
3
  */
4
- export type PatchEndpoint<T, TPrimaryKey extends keyof T> = {
5
- body: Partial<T>
4
+ export type PatchEndpoint<T, TPrimaryKey extends keyof T, TWritableData = Partial<T>> = {
5
+ body: TWritableData
6
6
  url: { id: T[TPrimaryKey] }
7
7
  result: {}
8
8
  }
@@ -3,7 +3,7 @@ import type { WithOptionalId } from '@furystack/core'
3
3
  /**
4
4
  * Endpoint model for creating new entities
5
5
  */
6
- export type PostEndpoint<T, TPrimaryKey extends keyof T> = {
7
- body: WithOptionalId<T, TPrimaryKey>
6
+ export type PostEndpoint<T, TPrimaryKey extends keyof T, TPostData = WithOptionalId<T, TPrimaryKey>> = {
7
+ body: TPostData
8
8
  result: T
9
9
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Endpoint model for updating entities
3
3
  */
4
- export type PatchEndpoint<T, TPrimaryKey extends keyof T> = {
5
- body: Partial<T>;
4
+ export type PatchEndpoint<T, TPrimaryKey extends keyof T, TWritableData = Partial<T>> = {
5
+ body: TWritableData;
6
6
  url: {
7
7
  id: T[TPrimaryKey];
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"patch-endpoint.d.ts","sourceRoot":"","sources":["../../src/endpoint-models/patch-endpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,WAAW,SAAS,MAAM,CAAC,IAAI;IAC1D,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IAChB,GAAG,EAAE;QAAE,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAA;KAAE,CAAA;IAC3B,MAAM,EAAE,EAAE,CAAA;CACX,CAAA"}
1
+ {"version":3,"file":"patch-endpoint.d.ts","sourceRoot":"","sources":["../../src/endpoint-models/patch-endpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,WAAW,SAAS,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI;IACtF,IAAI,EAAE,aAAa,CAAA;IACnB,GAAG,EAAE;QAAE,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAA;KAAE,CAAA;IAC3B,MAAM,EAAE,EAAE,CAAA;CACX,CAAA"}
@@ -2,8 +2,8 @@ import type { WithOptionalId } from '@furystack/core';
2
2
  /**
3
3
  * Endpoint model for creating new entities
4
4
  */
5
- export type PostEndpoint<T, TPrimaryKey extends keyof T> = {
6
- body: WithOptionalId<T, TPrimaryKey>;
5
+ export type PostEndpoint<T, TPrimaryKey extends keyof T, TPostData = WithOptionalId<T, TPrimaryKey>> = {
6
+ body: TPostData;
7
7
  result: T;
8
8
  };
9
9
  //# sourceMappingURL=post-endpoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"post-endpoint.d.ts","sourceRoot":"","sources":["../../src/endpoint-models/post-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,WAAW,SAAS,MAAM,CAAC,IAAI;IACzD,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE,WAAW,CAAC,CAAA;IACpC,MAAM,EAAE,CAAC,CAAA;CACV,CAAA"}
1
+ {"version":3,"file":"post-endpoint.d.ts","sourceRoot":"","sources":["../../src/endpoint-models/post-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,WAAW,SAAS,MAAM,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC,CAAC,EAAE,WAAW,CAAC,IAAI;IACrG,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,CAAC,CAAA;CACV,CAAA"}