@pc-nexus/internal 0.5.0-next.6 → 0.5.0-next.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/index.d.ts CHANGED
@@ -5,4 +5,5 @@ export * from "./lib/resolver.js";
5
5
  export * from "./lib/error.js";
6
6
  export * from "./lib/code.js";
7
7
  export * from "./lib/error-type.js";
8
+ export * from "./lib/gateway.js";
8
9
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
package/index.js CHANGED
@@ -5,3 +5,4 @@ export * from "./lib/resolver.js";
5
5
  export * from "./lib/error.js";
6
6
  export * from "./lib/code.js";
7
7
  export * from "./lib/error-type.js";
8
+ export * from "./lib/gateway.js";
@@ -0,0 +1,15 @@
1
+ export interface NexusGatewayEndpointError {
2
+ code: number;
3
+ message: string;
4
+ type: string;
5
+ }
6
+ export declare class NexusGatewayEndpointResponse<TValue = unknown, TReference = Record<string, unknown>> {
7
+ success: boolean;
8
+ value: TValue | null;
9
+ references?: TReference | undefined;
10
+ error?: NexusGatewayEndpointError | undefined;
11
+ constructor(success: boolean, value: TValue | null, references?: TReference | undefined, error?: NexusGatewayEndpointError | undefined);
12
+ static from<TValue = unknown, TReference = Record<string, unknown>>(value: TValue, references?: TReference): NexusGatewayEndpointResponse<TValue, TReference>;
13
+ static fromError(error: NexusGatewayEndpointError): NexusGatewayEndpointResponse<null, void>;
14
+ }
15
+ //# sourceMappingURL=gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/lib/gateway.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,4BAA4B,CAAC,MAAM,GAAG,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEjF,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI;IACpB,UAAU,CAAC,EAAE,UAAU;IACvB,KAAK,CAAC,EAAE,yBAAyB;gBAHjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,UAAU,CAAC,EAAE,UAAU,YAAA,EACvB,KAAK,CAAC,EAAE,yBAAyB,YAAA;WAG9B,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,UAAU,GACxB,4BAA4B,CAAC,MAAM,EAAE,UAAU,CAAC;WAIrC,SAAS,CAAC,KAAK,EAAE,yBAAyB,GAAG,4BAA4B,CAAC,IAAI,EAAE,IAAI,CAAC;CAGtG"}
package/lib/gateway.js ADDED
@@ -0,0 +1,18 @@
1
+ export class NexusGatewayEndpointResponse {
2
+ success;
3
+ value;
4
+ references;
5
+ error;
6
+ constructor(success, value, references, error) {
7
+ this.success = success;
8
+ this.value = value;
9
+ this.references = references;
10
+ this.error = error;
11
+ }
12
+ static from(value, references) {
13
+ return new this(true, value, references);
14
+ }
15
+ static fromError(error) {
16
+ return new this(false, null, undefined, error);
17
+ }
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pc-nexus/internal",
3
- "version": "0.5.0-next.6",
3
+ "version": "0.5.0-next.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {