@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 +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/lib/gateway.d.ts +15 -0
- package/lib/gateway.d.ts.map +1 -0
- package/lib/gateway.js +18 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
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
package/lib/gateway.d.ts
ADDED
|
@@ -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
|
+
}
|