@typespec/http 1.0.0-rc.1-dev.4 → 1.0.0-rc.1-dev.5
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/dist/src/experimental/typekit/kits/http-operation.d.ts +2 -1
- package/dist/src/experimental/typekit/kits/http-operation.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/http-operation.js +4 -5
- package/dist/src/experimental/typekit/kits/http-operation.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Operation, Type } from "@typespec/compiler";
|
|
2
|
+
import { Diagnosable } from "@typespec/compiler/experimental/typekit";
|
|
2
3
|
import { HttpOperation, HttpOperationResponseContent, HttpStatusCodesEntry } from "../../../types.js";
|
|
3
4
|
/**
|
|
4
5
|
* Utilities for working with HTTP operations.
|
|
@@ -11,7 +12,7 @@ export interface HttpOperationKit {
|
|
|
11
12
|
*
|
|
12
13
|
* @param op The TypeSpec operation to get the HTTP operation metadata for.
|
|
13
14
|
*/
|
|
14
|
-
get(op: Operation)
|
|
15
|
+
get: Diagnosable<(op: Operation) => HttpOperation>;
|
|
15
16
|
/**
|
|
16
17
|
* Get the responses for the given operation. This function will return an array of responses grouped by status code and content type.
|
|
17
18
|
* @param op operation to extract the HttpResponse from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-operation.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/http-operation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"http-operation.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/http-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,IAAI,EAAY,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAGL,WAAW,EAEZ,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,EAAE,SAAS,KAAK,aAAa,CAAC,CAAC;IACnD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,EAAE,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACxD;;;OAGG;IACH,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/E;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,oBAAoB,CAAC;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,EAAE,4BAA4B,CAAC;IAC9C;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,UAAU,gBAAgB;IACxB;;;OAGG;IACH,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,OAAO,QAAQ,yCAAyC,CAAC;IACvD,UAAU,OAAQ,SAAQ,gBAAgB;KAAG;CAC9C"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineKit } from "@typespec/compiler/experimental/typekit";
|
|
1
|
+
import { createDiagnosable, defineKit, } from "@typespec/compiler/experimental/typekit";
|
|
3
2
|
import { getHttpOperation } from "../../../operations.js";
|
|
4
3
|
defineKit({
|
|
5
4
|
httpOperation: {
|
|
6
|
-
get(op) {
|
|
7
|
-
return
|
|
8
|
-
},
|
|
5
|
+
get: createDiagnosable(function (op) {
|
|
6
|
+
return getHttpOperation(this.program, op);
|
|
7
|
+
}),
|
|
9
8
|
getReturnType(httpOperation, options) {
|
|
10
9
|
let responses = this.httpOperation.flattenResponses(httpOperation);
|
|
11
10
|
if (!options?.includeErrors) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-operation.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/http-operation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-operation.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/http-operation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,SAAS,GAGV,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAkE1D,SAAS,CAAmB;IAC1B,aAAa,EAAE;QACb,GAAG,EAAE,iBAAiB,CAAC,UAAU,EAAE;YACjC,OAAO,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC;QACF,aAAa,CAAC,aAAa,EAAE,OAAO;YAClC,IAAI,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;YAEnE,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;gBAC5B,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7E,CAAC;YAED,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAc,CAAC;YACjE,IAAI,cAAc,GAAS,QAAQ,CAAC;YAEpC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;gBACtB,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC7E,cAAc,GAA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