@typespec/openapi 0.55.0-dev.0 → 0.55.0-dev.2

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.
@@ -0,0 +1,58 @@
1
+ import type { DecoratorContext, Model, Namespace, Operation, Type } from "@typespec/compiler";
2
+ /**
3
+ * Specify the OpenAPI `operationId` property for this operation.
4
+ *
5
+ * @param operationId Operation id value.
6
+ * @example
7
+ * ```typespec
8
+ * @operationId("download")
9
+ * op read(): string;
10
+ * ```
11
+ */
12
+ export type OperationIdDecorator = (context: DecoratorContext, target: Operation, operationId: string) => void;
13
+ /**
14
+ * Attach some custom data to the OpenAPI element generated from this type.
15
+ *
16
+ * @param key Extension key. Must start with `x-`
17
+ * @param value Extension value.
18
+ * @example
19
+ * ```typespec
20
+ * @extension("x-custom", "My value")
21
+ * @extension("x-pageable", {nextLink: "x-next-link"})
22
+ * op read(): string;
23
+ * ```
24
+ */
25
+ export type ExtensionDecorator = (context: DecoratorContext, target: Type, key: string, value: Type) => void;
26
+ /**
27
+ * Specify that this model is to be treated as the OpenAPI `default` response.
28
+ * This differs from the compiler built-in `@error` decorator as this does not necessarily represent an error.
29
+ *
30
+ * @example
31
+ * ```typespec
32
+ * @defaultResponse
33
+ * model PetStoreResponse is object;
34
+ *
35
+ * op listPets(): Pet[] | PetStoreResponse;
36
+ * ```
37
+ */
38
+ export type DefaultResponseDecorator = (context: DecoratorContext, target: Model) => void;
39
+ /**
40
+ * Specify the OpenAPI `externalDocs` property for this type.
41
+ *
42
+ * @param url Url to the docs
43
+ * @param description Description of the docs
44
+ * @example
45
+ * ```typespec
46
+ * @externalDocs("https://example.com/detailed.md", "Detailed information on how to use this operation")
47
+ * op listPets(): Pet[];
48
+ * ```
49
+ */
50
+ export type ExternalDocsDecorator = (context: DecoratorContext, target: Type, url: string, description?: string) => void;
51
+ /**
52
+ * Specify OpenAPI additional information.
53
+ * The service `title` and `version` are already specified using `@service`.
54
+ *
55
+ * @param additionalInfo Additional information
56
+ */
57
+ export type InfoDecorator = (context: DecoratorContext, target: Namespace, additionalInfo: Type) => void;
58
+ //# sourceMappingURL=TypeSpec.OpenAPI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeSpec.OpenAPI.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.OpenAPI.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE9F;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,MAAM,KAChB,IAAI,CAAC;AAEV;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,IAAI,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,IAAI,KACR,IAAI,CAAC;AAEV;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,KAAK,IAAI,CAAC;AAE1F;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,IAAI,EACZ,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,MAAM,KACjB,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,IAAI,KACjB,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TypeSpec.OpenAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeSpec.OpenAPI.js","sourceRoot":"","sources":["../../generated-defs/TypeSpec.OpenAPI.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TypeSpec.OpenAPI.ts-test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeSpec.OpenAPI.ts-test.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.OpenAPI.ts-test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ /** An error here would mean that the decorator is not exported or doesn't have the right name. */
2
+ import { $defaultResponse, $extension, $externalDocs, $info, $operationId, } from "@typespec/openapi";
3
+ /** An error here would mean that the exported decorator is not using the same signature. Make sure to have export const $decName: DecNameDecorator = (...) => ... */
4
+ const _ = {
5
+ $operationId,
6
+ $extension,
7
+ $defaultResponse,
8
+ $externalDocs,
9
+ $info,
10
+ };
11
+ //# sourceMappingURL=TypeSpec.OpenAPI.ts-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeSpec.OpenAPI.ts-test.js","sourceRoot":"","sources":["../../generated-defs/TypeSpec.OpenAPI.ts-test.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,KAAK,EACL,YAAY,GACb,MAAM,mBAAmB,CAAC;AAiB3B,qKAAqK;AACrK,MAAM,CAAC,GAAe;IACpB,YAAY;IACZ,UAAU;IACV,gBAAgB;IAChB,aAAa;IACb,KAAK;CACN,CAAC"}
@@ -1,4 +1,5 @@
1
- import { DecoratorContext, Model, Namespace, Operation, Program, Type, TypeSpecValue } from "@typespec/compiler";
1
+ import { Namespace, Operation, Program, Type } from "@typespec/compiler";
2
+ import { DefaultResponseDecorator, ExtensionDecorator, ExternalDocsDecorator, InfoDecorator, OperationIdDecorator } from "../generated-defs/TypeSpec.OpenAPI.js";
2
3
  import { AdditionalInfo, ExtensionKey } from "./types.js";
3
4
  export declare const namespace = "TypeSpec.OpenAPI";
4
5
  /**
@@ -7,15 +8,15 @@ export declare const namespace = "TypeSpec.OpenAPI";
7
8
  * @param entity Decorator target
8
9
  * @param opId Operation ID.
9
10
  */
10
- export declare function $operationId(context: DecoratorContext, entity: Operation, opId: string): void;
11
+ export declare const $operationId: OperationIdDecorator;
11
12
  /**
12
13
  * @returns operationId set via the @operationId decorator or `undefined`
13
14
  */
14
15
  export declare function getOperationId(program: Program, entity: Operation): string | undefined;
15
- export declare function $extension(context: DecoratorContext, entity: Type, extensionName: string, value: TypeSpecValue): void;
16
+ export declare const $extension: ExtensionDecorator;
16
17
  export declare function setExtension(program: Program, entity: Type, extensionName: ExtensionKey, data: unknown): void;
17
18
  export declare function getExtensions(program: Program, entity: Type): ReadonlyMap<ExtensionKey, any>;
18
- export declare function $defaultResponse(context: DecoratorContext, entity: Model): void;
19
+ export declare const $defaultResponse: DefaultResponseDecorator;
19
20
  /**
20
21
  * Check if the given model has been mark as a default response.
21
22
  * @param program TypeSpec Program
@@ -32,9 +33,9 @@ export interface ExternalDocs {
32
33
  * @param url The URL for the target documentation. Value MUST be in the format of a URL.
33
34
  * @param description A short description of the target documentation.
34
35
  */
35
- export declare function $externalDocs(context: DecoratorContext, target: Type, url: string, description?: string): void;
36
+ export declare const $externalDocs: ExternalDocsDecorator;
36
37
  export declare function getExternalDocs(program: Program, entity: Type): ExternalDocs | undefined;
37
- export declare function $info(context: DecoratorContext, entity: Namespace, model: Model): void;
38
+ export declare const $info: InfoDecorator;
38
39
  export declare function getInfo(program: Program, entity: Namespace): AdditionalInfo | undefined;
39
40
  /** Resolve the info entry by merging data specified with `@service`, `@summary` and `@info`. */
40
41
  export declare function resolveInfo(program: Program, entity: Namespace): AdditionalInfo | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAIhB,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EAEJ,aAAa,EACd,MAAM,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OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO,CAEzE;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,qBAW3B,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,YAAY,GAAG,SAAS,CAExF;AAGD,eAAO,MAAM,KAAK,EAAE,aAcnB,CAAC;AAEF,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CAEvF;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CAW3F"}
@@ -9,9 +9,9 @@ const operationIdsKey = createStateSymbol("operationIds");
9
9
  * @param entity Decorator target
10
10
  * @param opId Operation ID.
11
11
  */
12
- export function $operationId(context, entity, opId) {
12
+ export const $operationId = (context, entity, opId) => {
13
13
  context.program.stateMap(operationIdsKey).set(entity, opId);
14
- }
14
+ };
15
15
  /**
16
16
  * @returns operationId set via the @operationId decorator or `undefined`
17
17
  */
@@ -19,7 +19,7 @@ export function getOperationId(program, entity) {
19
19
  return program.stateMap(operationIdsKey).get(entity);
20
20
  }
21
21
  const openApiExtensionKey = createStateSymbol("openApiExtension");
22
- export function $extension(context, entity, extensionName, value) {
22
+ export const $extension = (context, entity, extensionName, value) => {
23
23
  if (!isOpenAPIExtensionKey(extensionName)) {
24
24
  reportDiagnostic(context.program, {
25
25
  code: "invalid-extension-key",
@@ -32,7 +32,7 @@ export function $extension(context, entity, extensionName, value) {
32
32
  context.program.reportDiagnostics(diagnostics);
33
33
  }
34
34
  setExtension(context.program, entity, extensionName, data);
35
- }
35
+ };
36
36
  export function setExtension(program, entity, extensionName, data) {
37
37
  var _a;
38
38
  const openApiExtensions = program.stateMap(openApiExtensionKey);
@@ -53,11 +53,11 @@ function isOpenAPIExtensionKey(key) {
53
53
  *
54
54
  */
55
55
  const defaultResponseKey = createStateSymbol("defaultResponse");
56
- export function $defaultResponse(context, entity) {
56
+ export const $defaultResponse = (context, entity) => {
57
57
  // eslint-disable-next-line deprecation/deprecation
58
58
  setStatusCode(context.program, entity, ["*"]);
59
59
  context.program.stateSet(defaultResponseKey).add(entity);
60
- }
60
+ };
61
61
  /**
62
62
  * Check if the given model has been mark as a default response.
63
63
  * @param program TypeSpec Program
@@ -73,25 +73,25 @@ const externalDocsKey = createStateSymbol("externalDocs");
73
73
  * @param url The URL for the target documentation. Value MUST be in the format of a URL.
74
74
  * @param description A short description of the target documentation.
75
75
  */
76
- export function $externalDocs(context, target, url, description) {
76
+ export const $externalDocs = (context, target, url, description) => {
77
77
  const doc = { url };
78
78
  if (description) {
79
79
  doc.description = description;
80
80
  }
81
81
  context.program.stateMap(externalDocsKey).set(target, doc);
82
- }
82
+ };
83
83
  export function getExternalDocs(program, entity) {
84
84
  return program.stateMap(externalDocsKey).get(entity);
85
85
  }
86
86
  const infoKey = createStateSymbol("info");
87
- export function $info(context, entity, model) {
87
+ export const $info = (context, entity, model) => {
88
88
  const [data, diagnostics] = typespecTypeToJson(model, context.getArgumentTarget(0));
89
89
  context.program.reportDiagnostics(diagnostics);
90
90
  if (data === undefined) {
91
91
  return;
92
92
  }
93
93
  context.program.stateMap(infoKey).set(entity, data);
94
- }
94
+ };
95
95
  export function getInfo(program, entity) {
96
96
  return program.stateMap(infoKey).get(entity);
97
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,UAAU,EACV,UAAU,EAMV,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAA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OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,OAAO,aAAa,CAAC;QACnB,GAAG,IAAI;QACP,KAAK,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,mCAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK;QACpC,mDAAmD;QACnD,OAAO,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,mCAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;QAC1C,OAAO,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,mCAAI,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC;QACrD,WAAW,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,mCAAI,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAoC,IAAO;IAC/D,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAQ,CAAC;AAC7F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/openapi",
3
- "version": "0.55.0-dev.0",
3
+ "version": "0.55.0-dev.2",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec library providing OpenAPI concepts",
6
6
  "homepage": "https://typespec.io",
@@ -49,20 +49,21 @@
49
49
  "@typespec/http": "~0.54.0 || >=0.55.0-dev <0.55.0",
50
50
  "@typespec/library-linter": "~0.54.0 || >=0.55.0-dev <0.55.0",
51
51
  "@typespec/rest": "~0.54.0 || >=0.55.0-dev <0.55.0",
52
- "@vitest/coverage-v8": "^1.2.2",
53
- "@vitest/ui": "^1.2.2",
52
+ "@vitest/coverage-v8": "^1.4.0",
53
+ "@vitest/ui": "^1.4.0",
54
54
  "c8": "^9.1.0",
55
- "eslint": "^8.56.0",
55
+ "eslint": "^8.57.0",
56
56
  "rimraf": "~5.0.5",
57
- "typescript": "~5.3.3",
58
- "vitest": "^1.2.2",
57
+ "typescript": "~5.4.2",
58
+ "vitest": "^1.4.0",
59
59
  "@typespec/tspd": "~0.46.0"
60
60
  },
61
61
  "dependencies": {},
62
62
  "scripts": {
63
63
  "clean": "rimraf ./dist ./temp",
64
- "build": "tsc -p . && npm run lint-typespec-library",
64
+ "build": "npm run gen-extern-signature && tsc -p . && npm run lint-typespec-library",
65
65
  "watch": "tsc -p . --watch",
66
+ "gen-extern-signature": "tspd --enable-experimental gen-extern-signature .",
66
67
  "lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit",
67
68
  "test": "vitest run",
68
69
  "test:ui": "vitest --ui",