@scalar/workspace-store 0.61.0 → 0.62.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +7 -1
  4. package/dist/entities/auth/schema.d.ts +200 -200
  5. package/dist/helpers/get-resolved-ref-deep.d.ts +1 -1
  6. package/dist/helpers/get-resolved-ref-deep.d.ts.map +1 -1
  7. package/dist/request-example/builder/build-request.d.ts.map +1 -1
  8. package/dist/request-example/builder/build-request.js +2 -1
  9. package/dist/schemas/reference-config/index.d.ts +40 -40
  10. package/dist/schemas/reference-config/settings.d.ts +40 -40
  11. package/dist/schemas/v3.1/strict/callback.d.ts +1 -1
  12. package/dist/schemas/v3.1/strict/components.d.ts +11 -11
  13. package/dist/schemas/v3.1/strict/encoding.d.ts +1 -1
  14. package/dist/schemas/v3.1/strict/header.d.ts +2 -2
  15. package/dist/schemas/v3.1/strict/media-type.d.ts +2 -2
  16. package/dist/schemas/v3.1/strict/openapi-document.d.ts +1260 -1260
  17. package/dist/schemas/v3.1/strict/operation.d.ts +3 -3
  18. package/dist/schemas/v3.1/strict/parameter.d.ts +2 -2
  19. package/dist/schemas/v3.1/strict/path-item.d.ts +10 -10
  20. package/dist/schemas/v3.1/strict/paths.d.ts +1 -1
  21. package/dist/schemas/v3.1/strict/reference.d.ts +14 -2
  22. package/dist/schemas/v3.1/strict/reference.d.ts.map +1 -1
  23. package/dist/schemas/v3.1/strict/reference.js +13 -1
  24. package/dist/schemas/v3.1/strict/response.d.ts +2 -2
  25. package/dist/schemas/v3.1/strict/responses.d.ts +1 -1
  26. package/dist/schemas/v3.2/openapi/index.d.ts.map +1 -1
  27. package/dist/schemas/v3.2/openapi/index.js +3 -0
  28. package/dist/schemas/v3.2/strict/callback.d.ts +1 -1
  29. package/dist/schemas/v3.2/strict/components.d.ts +12 -12
  30. package/dist/schemas/v3.2/strict/encoding.d.ts +1 -1
  31. package/dist/schemas/v3.2/strict/header.d.ts +2 -2
  32. package/dist/schemas/v3.2/strict/media-type.d.ts +3 -3
  33. package/dist/schemas/v3.2/strict/openapi-document.d.ts +1400 -1400
  34. package/dist/schemas/v3.2/strict/operation.d.ts +3 -3
  35. package/dist/schemas/v3.2/strict/parameter.d.ts +2 -2
  36. package/dist/schemas/v3.2/strict/path-item.d.ts +12 -12
  37. package/dist/schemas/v3.2/strict/paths.d.ts +1 -1
  38. package/dist/schemas/v3.2/strict/reference.d.ts +14 -2
  39. package/dist/schemas/v3.2/strict/reference.d.ts.map +1 -1
  40. package/dist/schemas/v3.2/strict/reference.js +13 -1
  41. package/dist/schemas/v3.2/strict/response.d.ts +2 -2
  42. package/dist/schemas/v3.2/strict/responses.d.ts +1 -1
  43. package/dist/schemas/v3.2/strict/security-scheme.d.ts +2 -2
  44. package/dist/schemas/v3.2/strict/security-scheme.d.ts.map +1 -1
  45. package/dist/schemas/v3.2/strict/security-scheme.js +1 -1
  46. package/dist/server.d.ts +27 -0
  47. package/dist/server.d.ts.map +1 -1
  48. package/dist/server.js +18 -0
  49. package/package.json +9 -9
@@ -36,7 +36,7 @@ export declare const OperationObjectSchemaDefinition: import("@scalar/typebox").
36
36
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
37
37
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
38
38
  }>]>, import("@scalar/typebox").TObject<{
39
- '$ref-value': import("@scalar/typebox").TRef<"ParameterObject">;
39
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ParameterObject">>;
40
40
  }>]>]>>>;
41
41
  /** The request body applicable for this operation. The requestBody is fully supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as GET, HEAD and DELETE), requestBody is permitted but does not have well-defined semantics and SHOULD be avoided if possible. */
42
42
  requestBody: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"RequestBodyObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -47,7 +47,7 @@ export declare const OperationObjectSchemaDefinition: import("@scalar/typebox").
47
47
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
48
48
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
49
49
  }>]>, import("@scalar/typebox").TObject<{
50
- '$ref-value': import("@scalar/typebox").TRef<"RequestBodyObject">;
50
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"RequestBodyObject">>;
51
51
  }>]>]>>;
52
52
  /** The list of possible responses as they are returned from executing this operation. */
53
53
  responses: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ResponsesObject">>;
@@ -66,7 +66,7 @@ export declare const OperationObjectSchemaDefinition: import("@scalar/typebox").
66
66
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
67
67
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
68
68
  }>]>, import("@scalar/typebox").TObject<{
69
- '$ref-value': import("@scalar/typebox").TRef<"CallbackObject">;
69
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"CallbackObject">>;
70
70
  }>]>]>>>;
71
71
  }>, import("@scalar/typebox").TObject<{
72
72
  'x-badges': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
@@ -88,7 +88,7 @@ export declare const ParameterObjectSchemaDefinition: import("@scalar/typebox").
88
88
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
89
89
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
90
90
  }>]>, import("@scalar/typebox").TObject<{
91
- '$ref-value': import("@scalar/typebox").TRef<"SchemaObject">;
91
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"SchemaObject">>;
92
92
  }>]>]>>;
93
93
  /** Example of the header's potential value; see Working With Examples. https://swagger.io/specification/#working-with-examples */
94
94
  example: import("@scalar/typebox").TOptional<import("@scalar/typebox").TAny>;
@@ -101,7 +101,7 @@ export declare const ParameterObjectSchemaDefinition: import("@scalar/typebox").
101
101
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
102
102
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
103
103
  }>]>, import("@scalar/typebox").TObject<{
104
- '$ref-value': import("@scalar/typebox").TRef<"ExampleObject">;
104
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ExampleObject">>;
105
105
  }>]>]>>>;
106
106
  }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
107
107
  /** REQUIRED. The name of the parameter. Parameter names are case sensitive.
@@ -22,7 +22,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
22
22
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
23
23
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
24
24
  }>]>, import("@scalar/typebox").TObject<{
25
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
25
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
26
26
  }>]>]>>;
27
27
  /** A definition of a PUT operation on this path. */
28
28
  put: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -33,7 +33,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
33
33
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
34
34
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
35
35
  }>]>, import("@scalar/typebox").TObject<{
36
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
36
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
37
37
  }>]>]>>;
38
38
  /** A definition of a POST operation on this path. */
39
39
  post: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -44,7 +44,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
44
44
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
45
45
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
46
46
  }>]>, import("@scalar/typebox").TObject<{
47
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
47
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
48
48
  }>]>]>>;
49
49
  /** A definition of a DELETE operation on this path. */
50
50
  delete: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -55,7 +55,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
55
55
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
56
56
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
57
57
  }>]>, import("@scalar/typebox").TObject<{
58
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
58
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
59
59
  }>]>]>>;
60
60
  /** A definition of a PATCH operation on this path. */
61
61
  patch: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -66,7 +66,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
66
66
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
67
67
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
68
68
  }>]>, import("@scalar/typebox").TObject<{
69
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
69
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
70
70
  }>]>]>>;
71
71
  /** A definition of a CONNECT operation on this path. */
72
72
  connect: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -77,7 +77,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
77
77
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
78
78
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
79
79
  }>]>, import("@scalar/typebox").TObject<{
80
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
80
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
81
81
  }>]>]>>;
82
82
  /** A definition of a OPTIONS operation on this path. */
83
83
  options: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -88,7 +88,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
88
88
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
89
89
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
90
90
  }>]>, import("@scalar/typebox").TObject<{
91
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
91
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
92
92
  }>]>]>>;
93
93
  /** A definition of a HEAD operation on this path. */
94
94
  head: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -99,7 +99,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
99
99
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
100
100
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
101
101
  }>]>, import("@scalar/typebox").TObject<{
102
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
102
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
103
103
  }>]>]>>;
104
104
  /** A definition of a TRACE operation on this path. */
105
105
  trace: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -110,7 +110,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
110
110
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
111
111
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
112
112
  }>]>, import("@scalar/typebox").TObject<{
113
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
113
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
114
114
  }>]>]>>;
115
115
  /** A definition of a QUERY operation, as defined in the most recent IETF draft or its RFC successor, on this path. Added in OpenAPI 3.2. */
116
116
  query: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -121,7 +121,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
121
121
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
122
122
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
123
123
  }>]>, import("@scalar/typebox").TObject<{
124
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
124
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
125
125
  }>]>]>>;
126
126
  /** A map of additional operations on this path. The map key is the HTTP method with the same capitalization that is to be sent in the request. This map MUST NOT contain any entry for the methods that can be defined by other fixed fields with Operation Object values (e.g. no POST entry, as the post field is used for this method). Added in OpenAPI 3.2. */
127
127
  additionalOperations: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"OperationObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
@@ -132,7 +132,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
132
132
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
133
133
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
134
134
  }>]>, import("@scalar/typebox").TObject<{
135
- '$ref-value': import("@scalar/typebox").TRef<"OperationObject">;
135
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"OperationObject">>;
136
136
  }>]>]>>>;
137
137
  /** An alternative servers array to service all operations in this path. If a servers array is specified at the OpenAPI Object level, it will be overridden by this value. */
138
138
  servers: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TRef<"ServerObject">>>;
@@ -145,7 +145,7 @@ export declare const PathItemObjectSchemaDefinition: import("@scalar/typebox").T
145
145
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
146
146
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
147
147
  }>]>, import("@scalar/typebox").TObject<{
148
- '$ref-value': import("@scalar/typebox").TRef<"ParameterObject">;
148
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ParameterObject">>;
149
149
  }>]>]>>>;
150
150
  }>;
151
151
  export type PathItemObject = {
@@ -11,7 +11,7 @@ export declare const PathsObjectSchemaDefinition: import("@scalar/typebox").TRec
11
11
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
12
12
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
13
13
  }>]>, import("@scalar/typebox").TObject<{
14
- '$ref-value': import("@scalar/typebox").TRef<"PathItemObject">;
14
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"PathItemObject">>;
15
15
  }>]>]>>;
16
16
  /**
17
17
  * Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the Server Object in order to construct the full URL. The Paths Object MAY be empty, due to Access Control List (ACL) constraints.
@@ -42,6 +42,18 @@ export type ReferenceObject = {
42
42
  /** Indicates whether this reference should be resolved globally across all documents, rather than just within the current document context. */
43
43
  '$global'?: boolean;
44
44
  };
45
+ /**
46
+ * Object or Reference Object with a resolved `$ref-value`.
47
+ *
48
+ * `$ref-value` is kept optional on purpose (mirroring the schema position in `schema.ts`): an
49
+ * unresolved reference — for example a sparse chunk `$ref` produced by the server store — is just
50
+ * `{ $ref }` with no resolved value yet. If it were required, such a value would match neither
51
+ * union branch, so coercion would fall back to the plain-object branch and silently drop the
52
+ * `$ref`. With it optional the `{ $ref }` matches the reference branch and is preserved unchanged.
53
+ *
54
+ * The bundler/proxy still populates `$ref-value` for resolved documents, so `getResolvedRef` keeps
55
+ * returning the value in practice.
56
+ */
45
57
  export declare const reference: <T extends TSchema>(schema: T) => import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
46
58
  /** REQUIRED. The reference identifier. This MUST be in the form of a URI. */
47
59
  $ref: import("@scalar/typebox").TString;
@@ -55,9 +67,9 @@ export declare const reference: <T extends TSchema>(schema: T) => import("@scala
55
67
  /** Indicates whether this reference should be resolved globally across all documents, rather than just within the current document context. */
56
68
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
57
69
  }>]>, import("@scalar/typebox").TObject<{
58
- '$ref-value': T;
70
+ '$ref-value': T extends import("@scalar/typebox").TOptional<infer S extends TSchema> ? import("@scalar/typebox").TOptional<S> : import("@scalar/typebox").Ensure<import("@scalar/typebox").TOptional<T>>;
59
71
  }>]>;
60
72
  export type ReferenceType<Value> = Value | (ReferenceObject & {
61
- '$ref-value': Value;
73
+ '$ref-value'?: Value;
62
74
  });
63
75
  //# sourceMappingURL=reference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../../src/schemas/v3.2/strict/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,iBAAiB,CAAA;AAIpD,eAAO,MAAM,+BAA+B;IAC1C,0JAA0J;;IAE1J,+IAA+I;;EAE/I,CAAA;AAEF;;;;;sDAKsD;AACtD,eAAO,MAAM,qBAAqB;IAE9B,6EAA6E;;IAE7E,sLAAsL;;IAEtL,oPAAoP;;;IAlBtP,0JAA0J;;IAE1J,+IAA+I;;IAoBhJ,CAAA;AAED;;;;;sDAKsD;AACtD,MAAM,MAAM,eAAe,GAAG;IAC5B,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAA;IACd,sLAAsL;IACtL,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oPAAoP;IACpP,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0JAA0J;IAC1J,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC/B,+IAA+I;IAC/I,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,OAAO,EAAE,QAAQ,CAAC;IA7BlD,6EAA6E;;IAE7E,sLAAsL;;IAEtL,oPAAoP;;;IAlBtP,0JAA0J;;IAE1J,+IAA+I;;;;IA0C1E,CAAA;AAEvE,MAAM,MAAM,aAAa,CAAC,KAAK,IAAI,KAAK,GAAG,CAAC,eAAe,GAAG;IAAE,YAAY,EAAE,KAAK,CAAA;CAAE,CAAC,CAAA"}
1
+ {"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../../src/schemas/v3.2/strict/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,iBAAiB,CAAA;AAIpD,eAAO,MAAM,+BAA+B;IAC1C,0JAA0J;;IAE1J,+IAA+I;;EAE/I,CAAA;AAEF;;;;;sDAKsD;AACtD,eAAO,MAAM,qBAAqB;IAE9B,6EAA6E;;IAE7E,sLAAsL;;IAEtL,oPAAoP;;;IAlBtP,0JAA0J;;IAE1J,+IAA+I;;IAoBhJ,CAAA;AAED;;;;;sDAKsD;AACtD,MAAM,MAAM,eAAe,GAAG;IAC5B,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAA;IACd,sLAAsL;IACtL,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oPAAoP;IACpP,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0JAA0J;IAC1J,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC/B,+IAA+I;IAC/I,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,OAAO,EAAE,QAAQ,CAAC;IAzClD,6EAA6E;;IAE7E,sLAAsL;;IAEtL,oPAAoP;;;IAlBtP,0JAA0J;;IAE1J,+IAA+I;;;;IAsD3D,CAAA;AAEtF,MAAM,MAAM,aAAa,CAAC,KAAK,IAAI,KAAK,GAAG,CAAC,eAAe,GAAG;IAAE,YAAY,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAA"}
@@ -20,4 +20,16 @@ export const ReferenceObjectSchema = compose(Type.Object({
20
20
  /** A description which by default SHOULD override that of the referenced component. CommonMark syntax MAY be used for rich text representation. If the referenced object-type does not allow a description field, then this field has no effect. */
21
21
  description: Type.Optional(Type.String()),
22
22
  }), ReferenceObjectExtensionsSchema);
23
- export const reference = (schema) => compose(ReferenceObjectSchema, Type.Object({ '$ref-value': schema }));
23
+ /**
24
+ * Object or Reference Object with a resolved `$ref-value`.
25
+ *
26
+ * `$ref-value` is kept optional on purpose (mirroring the schema position in `schema.ts`): an
27
+ * unresolved reference — for example a sparse chunk `$ref` produced by the server store — is just
28
+ * `{ $ref }` with no resolved value yet. If it were required, such a value would match neither
29
+ * union branch, so coercion would fall back to the plain-object branch and silently drop the
30
+ * `$ref`. With it optional the `{ $ref }` matches the reference branch and is preserved unchanged.
31
+ *
32
+ * The bundler/proxy still populates `$ref-value` for resolved documents, so `getResolvedRef` keeps
33
+ * returning the value in practice.
34
+ */
35
+ export const reference = (schema) => compose(ReferenceObjectSchema, Type.Object({ '$ref-value': Type.Optional(schema) }));
@@ -16,7 +16,7 @@ export declare const ResponseObjectSchemaDefinition: import("@scalar/typebox").T
16
16
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
17
17
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
18
18
  }>]>, import("@scalar/typebox").TObject<{
19
- '$ref-value': import("@scalar/typebox").TRef<"HeaderObject">;
19
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"HeaderObject">>;
20
20
  }>]>]>>>;
21
21
  /** A map containing descriptions of potential response payloads. The key is a media type or media type range and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. "text/plain" overrides "text/*" */
22
22
  content: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TRef<"MediaTypeObject">>>;
@@ -29,7 +29,7 @@ export declare const ResponseObjectSchemaDefinition: import("@scalar/typebox").T
29
29
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
30
30
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
31
31
  }>]>, import("@scalar/typebox").TObject<{
32
- '$ref-value': import("@scalar/typebox").TRef<"LinkObject">;
32
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"LinkObject">>;
33
33
  }>]>]>>>;
34
34
  }>;
35
35
  /**
@@ -17,7 +17,7 @@ export declare const ResponsesObjectSchemaDefinition: import("@scalar/typebox").
17
17
  $status: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"loading">, import("@scalar/typebox").TLiteral<"error">]>>;
18
18
  $global: import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
19
19
  }>]>, import("@scalar/typebox").TObject<{
20
- '$ref-value': import("@scalar/typebox").TRef<"ResponseObject">;
20
+ '$ref-value': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ResponseObject">>;
21
21
  }>]>]>>;
22
22
  /**
23
23
  * A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
@@ -32,7 +32,7 @@ export type OAuth2Object = Description & {
32
32
  type: 'oauth2';
33
33
  /** REQUIRED. An object containing configuration information for the flow types supported. */
34
34
  flows: OAuthFlowsObject;
35
- /** URL to the OAuth2 authorization server metadata (RFC8414). TLS is required. Added in OpenAPI 3.2. */
35
+ /** URL to the OAuth2 authorization server metadata (RFC8414). Use HTTPS, or HTTP for local development URLs. Added in OpenAPI 3.2. */
36
36
  oauth2MetadataUrl?: string;
37
37
  } & XDefaultScopes;
38
38
  export type OpenIdConnectObject = Description & {
@@ -96,7 +96,7 @@ export declare const SecuritySchemeObjectSchemaDefinition: import("@scalar/typeb
96
96
  type: import("@scalar/typebox").TLiteral<"oauth2">;
97
97
  /** REQUIRED. An object containing configuration information for the flow types supported. */
98
98
  flows: import("@scalar/typebox").TRef<"OAuthFlowsObject">;
99
- /** URL to the OAuth2 authorization server metadata (RFC8414). TLS is required. Added in OpenAPI 3.2. */
99
+ /** URL to the OAuth2 authorization server metadata (RFC8414). Use HTTPS, or HTTP for local development URLs. Added in OpenAPI 3.2. */
100
100
  oauth2MetadataUrl: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
101
101
  }>, import("@scalar/typebox").TObject<{
102
102
  'x-default-scopes': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TString>>;
@@ -1 +1 @@
1
- {"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../../../src/schemas/v3.2/strict/security-scheme.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,+CAA+C,CAAA;AACvG,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gDAAgD,CAAA;AAC1G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAexE,KAAK,WAAW,GAAG;IACjB,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wIAAwI;IACxI,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,GAAG,aAAa,CAAA;AAcjB,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACvC,4HAA4H;IAC5H,IAAI,EAAE,QAAQ,CAAA;IACd,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAA;IACZ,8FAA8F;IAC9F,EAAE,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAClC,CAAA;AAcD,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IACrC,4HAA4H;IAC5H,IAAI,EAAE,MAAM,CAAA;IACZ,gQAAgQ;IAChQ,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC1B,uMAAuM;IACvM,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAUD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,4HAA4H;IAC5H,IAAI,EAAE,WAAW,CAAA;CAClB,CAAA;AAeD,MAAM,MAAM,YAAY,GAAG,W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;;IA0DxI,4HAA4H;;;IA5D5H,qGAAqG;;IAErG,wIAAwI;;;;;IAuExI,4HAA4H;;IAE5H,6FAA6F;;IAE7F,sIAAsI;;;;;IA7EtI,qGAAqG;;IAErG,wIAAwI;;;;;IA6FxI,4HAA4H;;IAE5H,+FAA+F;;MAuBjG,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,UAAU,GAAG,eAAe,GAAG,YAAY,GAAG,mBAAmB,CAAA"}
@@ -36,7 +36,7 @@ const OAuth2 = compose(DescriptionSchema, Type.Object({
36
36
  type: Type.Literal('oauth2'),
37
37
  /** REQUIRED. An object containing configuration information for the flow types supported. */
38
38
  flows: OAuthFlowsObjectRef,
39
- /** URL to the OAuth2 authorization server metadata (RFC8414). TLS is required. Added in OpenAPI 3.2. */
39
+ /** URL to the OAuth2 authorization server metadata (RFC8414). Use HTTPS, or HTTP for local development URLs. Added in OpenAPI 3.2. */
40
40
  oauth2MetadataUrl: Type.Optional(Type.String()),
41
41
  }), XDefaultScopesSchema);
42
42
  const OpenIdConnect = compose(DescriptionSchema, Type.Object({
package/dist/server.d.ts CHANGED
@@ -178,6 +178,33 @@ export type ServerWorkspaceStore = {
178
178
  * @returns The resolved chunk, or `undefined` when not found
179
179
  */
180
180
  get: (pointer: string) => unknown;
181
+ /**
182
+ * Returns a document whole, with local references resolving, for rendering on the server.
183
+ *
184
+ * `getWorkspace()` hands back the sparse document: every component and operation is a reference
185
+ * to a chunk, which is what the browser wants so it can load only what a page needs. A server
186
+ * render wants the opposite — the complete document, read through one reference, with `$ref-value`
187
+ * resolving locally and nothing fetched. That is the document the store built its navigation and
188
+ * chunks from, so this is that object rather than a second copy: it shares the components and
189
+ * operations the chunks are written from, and carries the same metadata and navigation as the
190
+ * sparse document.
191
+ *
192
+ * It is a magic proxy, never reactive, so reading it costs a property lookup and a pointer
193
+ * resolution. Use `getRaw` to serialize it: `$ref-value` is enumerable on the proxy and would
194
+ * inline every referenced value beside its `$ref`.
195
+ *
196
+ * @example
197
+ * ```ts
198
+ * const document = store.getResolvedDocument('petstore')
199
+ *
200
+ * // A real operation, not a chunk reference
201
+ * document?.paths?.['/pets']?.get
202
+ * ```
203
+ *
204
+ * @param name - The document name it was added under
205
+ * @returns The resolved document, or `undefined` when no document has that name
206
+ */
207
+ getResolvedDocument: (name: string) => ServerWorkspace['documents'][string] | undefined;
181
208
  };
182
209
  /**
183
210
  * Create server state workspace store
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAI5E,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,wCAAwC,CAAA;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAG1F,eAAO,MAAM,mBAAmB,0BAA0B,CAAA;AAE1D,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,qBAAqB,CAAA;CAC7B,CAAA;AAED,KAAK,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,0BAA0B,CAAA;AAC1D,KAAK,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,0BAA0B,CAAA;AAC5D,KAAK,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,0BAA0B,CAAA;AAEnF,KAAK,sBAAsB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;AAE1D,KAAK,8BAA8B,GAAG;IACpC,SAAS,EAAE,sBAAsB,EAAE,CAAA;IACnC,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC,CAAA;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EACzB,IAAI,EAAE;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,uBAyC3G;AAED,KAAK,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAA;AAuCxD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACpG;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,uBAAuB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,EAAE,MAAM,eAAe,CAAA;IACnC;;;;;;;;;;;;;;;;;OAiBG;IACH,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAA;IACjC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,eAAe,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CACxF,CAAA;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,cAAc,EAAE,+BAA+B,GAC9C,OAAO,CAAC,oBAAoB,CAAC,CA2S/B"}
package/dist/server.js CHANGED
@@ -258,6 +258,13 @@ export async function createServerWorkspaceStore(workspaceProps) {
258
258
  * for that document.
259
259
  */
260
260
  const assets = {};
261
+ /**
262
+ * Each document whole, for `getResolvedDocument`.
263
+ *
264
+ * Written at the same point as `workspace.documents`, after everything that can throw, so a failed
265
+ * add leaves neither map with a half-processed entry.
266
+ */
267
+ const resolvedDocuments = {};
261
268
  /**
262
269
  * Adds an AsyncAPI document to the workspace.
263
270
  *
@@ -306,6 +313,9 @@ export async function createServerWorkspaceStore(workspaceProps) {
306
313
  // checks OpenAPI first — so leaving `openapi` in place would hand an OpenAPI renderer a
307
314
  // navigation tree of channel entries. The document is stored as the type it was read as.
308
315
  delete workspace.documents[name]['openapi'];
316
+ // Nothing was externalized, so the stored document already is the whole document; it only needs
317
+ // its references resolving to be rendered from.
318
+ resolvedDocuments[name] = resolveLocalReferences(workspace.documents[name]);
309
319
  };
310
320
  /**
311
321
  * Adds a new document to the workspace.
@@ -364,6 +374,13 @@ export async function createServerWorkspaceStore(workspaceProps) {
364
374
  paths,
365
375
  [extensions.document.navigation]: navigation,
366
376
  };
377
+ // The same document without the externalization, for server rendering. A shallow spread, so the
378
+ // components and operations are the objects the chunks are written from rather than copies.
379
+ resolvedDocuments[meta.name] = resolveLocalReferences({
380
+ ...documentMeta,
381
+ ...documentV3,
382
+ [extensions.document.navigation]: navigation,
383
+ });
367
384
  };
368
385
  /**
369
386
  * Adds a new document to the workspace asynchronously.
@@ -445,6 +462,7 @@ export async function createServerWorkspaceStore(workspaceProps) {
445
462
  getWorkspace: () => {
446
463
  return workspace;
447
464
  },
465
+ getResolvedDocument: (name) => resolvedDocuments[name],
448
466
  get: (pointer) => {
449
467
  const pointerPath = (() => {
450
468
  if (pointer.startsWith('#')) {
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "openapi",
17
17
  "scalar"
18
18
  ],
19
- "version": "0.61.0",
19
+ "version": "0.62.0",
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
@@ -143,19 +143,19 @@
143
143
  "CHANGELOG.md"
144
144
  ],
145
145
  "dependencies": {
146
- "@scalar/typebox": "0.1.3",
147
- "js-base64": "^3.9.2",
148
- "type-fest": "^5.8.0",
149
- "vue": "^3.5.40",
150
- "yaml": "^2.9.0",
151
- "@scalar/helpers": "0.12.0",
152
146
  "@scalar/asyncapi-upgrader": "0.1.10",
153
- "@scalar/openapi-upgrader": "0.2.16",
147
+ "@scalar/helpers": "0.12.0",
148
+ "@scalar/json-magic": "0.14.0",
149
+ "@scalar/openapi-upgrader": "0.2.17",
154
150
  "@scalar/schemas": "0.10.0",
155
151
  "@scalar/snippetz": "0.9.31",
152
+ "@scalar/typebox": "0.1.3",
156
153
  "@scalar/types": "0.20.0",
157
154
  "@scalar/validation": "0.6.3",
158
- "@scalar/json-magic": "0.13.5"
155
+ "js-base64": "^3.9.2",
156
+ "type-fest": "^5.8.0",
157
+ "vue": "^3.5.40",
158
+ "yaml": "^2.9.0"
159
159
  },
160
160
  "devDependencies": {
161
161
  "@google-cloud/storage": "7.21.0",