@scalar/workspace-store 0.49.3 → 0.51.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.
- package/CHANGELOG.md +108 -0
- package/dist/client.d.ts +2 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +38 -15
- package/dist/entities/auth/schema.d.ts +10 -5
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/events/bus.d.ts +70 -0
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/bus.js +48 -11
- package/dist/events/definitions/analytics.d.ts +0 -12
- package/dist/events/definitions/analytics.d.ts.map +1 -1
- package/dist/events/definitions/auth.d.ts +44 -6
- package/dist/events/definitions/auth.d.ts.map +1 -1
- package/dist/events/definitions/index.d.ts +3 -2
- package/dist/events/definitions/index.d.ts.map +1 -1
- package/dist/events/definitions/log.d.ts +18 -0
- package/dist/events/definitions/log.d.ts.map +1 -0
- package/dist/events/definitions/log.js +1 -0
- package/dist/events/definitions/operation.d.ts +1 -1
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/ui.d.ts +18 -1
- package/dist/events/definitions/ui.d.ts.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/helpers/get-resolved-ref.d.ts +6 -0
- package/dist/helpers/get-resolved-ref.d.ts.map +1 -1
- package/dist/helpers/get-resolved-ref.js +9 -0
- package/dist/helpers/is-hidden.d.ts +8 -0
- package/dist/helpers/is-hidden.d.ts.map +1 -0
- package/dist/helpers/is-hidden.js +5 -0
- package/dist/mutators/auth.d.ts +22 -3
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +213 -37
- package/dist/mutators/cookie.d.ts.map +1 -1
- package/dist/mutators/cookie.js +3 -2
- package/dist/mutators/document.d.ts.map +1 -1
- package/dist/mutators/document.js +5 -4
- package/dist/mutators/environment.d.ts.map +1 -1
- package/dist/mutators/environment.js +12 -5
- package/dist/mutators/index.d.ts +4 -0
- package/dist/mutators/index.d.ts.map +1 -1
- package/dist/mutators/operation/body.d.ts.map +1 -1
- package/dist/mutators/operation/body.js +6 -2
- package/dist/mutators/operation/extensions.d.ts.map +1 -1
- package/dist/mutators/operation/extensions.js +5 -1
- package/dist/mutators/operation/history.d.ts.map +1 -1
- package/dist/mutators/operation/history.js +7 -3
- package/dist/mutators/operation/operation.d.ts.map +1 -1
- package/dist/mutators/operation/operation.js +15 -10
- package/dist/mutators/operation/parameters.d.ts.map +1 -1
- package/dist/mutators/operation/parameters.js +12 -5
- package/dist/mutators/server.d.ts.map +1 -1
- package/dist/mutators/server.js +2 -1
- package/dist/mutators/tag.d.ts.map +1 -1
- package/dist/mutators/tag.js +9 -4
- package/dist/navigation/helpers/get-openapi-object.d.ts.map +1 -1
- package/dist/navigation/helpers/get-openapi-object.js +5 -0
- package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-paths.js +4 -3
- package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-schemas.js +9 -4
- package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-tags.js +2 -1
- package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-webhooks.js +4 -3
- package/dist/navigation/helpers/update-order-ids.d.ts.map +1 -1
- package/dist/navigation/helpers/update-order-ids.js +4 -1
- package/dist/persistence/index.d.ts +123 -80
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +233 -167
- package/dist/persistence/migrations/v2-team-to-local.d.ts +22 -5
- package/dist/persistence/migrations/v2-team-to-local.d.ts.map +1 -1
- package/dist/persistence/migrations/v2-team-to-local.js +195 -137
- package/dist/request-example/builder/body/build-request-body.d.ts.map +1 -1
- package/dist/request-example/builder/body/build-request-body.js +1 -1
- package/dist/request-example/builder/build-request.d.ts +24 -3
- package/dist/request-example/builder/build-request.d.ts.map +1 -1
- package/dist/request-example/builder/build-request.js +89 -18
- package/dist/request-example/builder/index.d.ts +2 -1
- package/dist/request-example/builder/index.d.ts.map +1 -1
- package/dist/request-example/builder/index.js +2 -1
- package/dist/request-example/builder/request-factory.d.ts.map +1 -1
- package/dist/request-example/builder/request-factory.js +5 -8
- package/dist/request-example/builder/resolve-request-factory-url.d.ts +18 -1
- package/dist/request-example/builder/resolve-request-factory-url.d.ts.map +1 -1
- package/dist/request-example/builder/resolve-request-factory-url.js +29 -4
- package/dist/request-example/context/environment.d.ts.map +1 -1
- package/dist/request-example/context/environment.js +2 -1
- package/dist/request-example/context/get-request-example-context.d.ts.map +1 -1
- package/dist/request-example/context/get-request-example-context.js +7 -0
- package/dist/request-example/context/headers.d.ts +28 -13
- package/dist/request-example/context/headers.d.ts.map +1 -1
- package/dist/request-example/context/headers.js +84 -19
- package/dist/request-example/context/index.d.ts +1 -0
- package/dist/request-example/context/index.d.ts.map +1 -1
- package/dist/request-example/context/index.js +1 -0
- package/dist/request-example/context/security/get-selected-security.d.ts.map +1 -1
- package/dist/request-example/context/security/get-selected-security.js +3 -6
- package/dist/request-example/context/servers.d.ts.map +1 -1
- package/dist/request-example/context/servers.js +3 -3
- package/dist/request-example/index.d.ts +3 -3
- package/dist/request-example/index.d.ts.map +1 -1
- package/dist/request-example/index.js +2 -2
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +1 -8
- package/dist/schemas/asyncapi/asyncapi-document.d.ts +79 -0
- package/dist/schemas/asyncapi/asyncapi-document.d.ts.map +1 -0
- package/dist/schemas/asyncapi/asyncapi-document.js +58 -0
- package/dist/schemas/extensions/document/workspace-managed-extensions.d.ts +25 -0
- package/dist/schemas/extensions/document/workspace-managed-extensions.d.ts.map +1 -0
- package/dist/schemas/extensions/document/workspace-managed-extensions.js +26 -0
- package/dist/schemas/inmemory-workspace.d.ts +3 -4631
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/inmemory-workspace.js +1 -15
- package/dist/schemas/reference-config/index.d.ts +3 -2
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +2 -1
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/type-guards.d.ts +24 -0
- package/dist/schemas/type-guards.d.ts.map +1 -0
- package/dist/schemas/type-guards.js +35 -0
- package/dist/schemas/v3.1/openapi/index.d.ts +2 -1
- package/dist/schemas/v3.1/openapi/index.d.ts.map +1 -1
- package/dist/schemas/v3.1/openapi/index.js +3 -3
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +74 -39
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +6 -2
- package/dist/schemas/workspace-specification/index.d.ts +1 -1
- package/dist/schemas/workspace.d.ts +15 -4377
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/dist/schemas/workspace.js +13 -8
- package/dist/schemas.d.ts +3 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +3 -1
- package/package.json +7 -7
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { WorkspaceManagedExtensions } from '../../schemas/extensions/document/workspace-managed-extensions.js';
|
|
2
|
+
import { XScalarIsDirty } from '../../schemas/extensions/document/x-scalar-is-dirty.js';
|
|
3
|
+
import { XScalarOriginalDocumentHash } from '../../schemas/extensions/document/x-scalar-original-document-hash.js';
|
|
4
|
+
import { XScalarRegistryMeta } from '../../schemas/extensions/document/x-scalar-registry-meta.js';
|
|
5
|
+
/**
|
|
6
|
+
* Minimal AsyncAPI Info Object.
|
|
7
|
+
*
|
|
8
|
+
* Intentionally scoped to the fields we surface in the MVP. AsyncAPI's real Info Object
|
|
9
|
+
* is a superset (contact, license, termsOfService, tags, externalDocs, ...) — we can
|
|
10
|
+
* grow this as consumers need the extra fields.
|
|
11
|
+
*/
|
|
12
|
+
export declare const AsyncApiInfoObject: import("@scalar/validation").ObjectSchema<{
|
|
13
|
+
title: import("@scalar/validation").StringSchema;
|
|
14
|
+
version: import("@scalar/validation").StringSchema;
|
|
15
|
+
description: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
16
|
+
}>;
|
|
17
|
+
export type AsyncApiInfoObject = {
|
|
18
|
+
/** REQUIRED. The title of the application. */
|
|
19
|
+
title: string;
|
|
20
|
+
/** REQUIRED. Provides the version of the application API (not the AsyncAPI Specification version). */
|
|
21
|
+
version: string;
|
|
22
|
+
/** A short description of the application. CommonMark syntax can be used for rich text representation. */
|
|
23
|
+
description?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* AsyncAPI-specific extensions. Store-managed metadata (source url, document
|
|
27
|
+
* hash, dirty flag, registry meta) is shared with the OpenAPI side via the
|
|
28
|
+
* dedicated extension modules so the two cannot drift apart.
|
|
29
|
+
*
|
|
30
|
+
* `x-original-aas-version` stays here because it is the AsyncAPI analog of
|
|
31
|
+
* `x-original-oas-version` — different field names per spec, so unified
|
|
32
|
+
* sharing is not a fit.
|
|
33
|
+
*/
|
|
34
|
+
export declare const AsyncApiExtensions: import("@scalar/validation").ObjectSchema<{
|
|
35
|
+
'x-original-aas-version': import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
36
|
+
}>;
|
|
37
|
+
export type AsyncApiExtensions = Partial<{
|
|
38
|
+
/** Original AsyncAPI Specification version the document was loaded with. */
|
|
39
|
+
'x-original-aas-version': string;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Minimal AsyncAPI Document.
|
|
43
|
+
*
|
|
44
|
+
* MVP shape: the spec version discriminator, the minimal Info Object, and the shared
|
|
45
|
+
* store-managed metadata extensions. Present on the discriminated {@link WorkspaceDocument}
|
|
46
|
+
* union via the required `asyncapi` field.
|
|
47
|
+
*/
|
|
48
|
+
export declare const AsyncApiDocument: import("@scalar/validation").IntersectionSchema<readonly [import("@scalar/validation").ObjectSchema<{
|
|
49
|
+
asyncapi: import("@scalar/validation").StringSchema;
|
|
50
|
+
info: import("@scalar/validation").ObjectSchema<{
|
|
51
|
+
title: import("@scalar/validation").StringSchema;
|
|
52
|
+
version: import("@scalar/validation").StringSchema;
|
|
53
|
+
description: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
54
|
+
}>;
|
|
55
|
+
}>, import("@scalar/validation").ObjectSchema<{
|
|
56
|
+
'x-original-aas-version': import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
57
|
+
}>, import("@scalar/validation").ObjectSchema<{
|
|
58
|
+
'x-scalar-original-source-url': import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
59
|
+
}>, import("@scalar/validation").ObjectSchema<{
|
|
60
|
+
'x-scalar-original-document-hash': import("@scalar/validation").StringSchema;
|
|
61
|
+
}>, import("@scalar/validation").ObjectSchema<{
|
|
62
|
+
'x-scalar-is-dirty': import("@scalar/validation").OptionalSchema<import("@scalar/validation").BooleanSchema>;
|
|
63
|
+
}>, import("@scalar/validation").ObjectSchema<{
|
|
64
|
+
'x-scalar-registry-meta': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
65
|
+
namespace: import("@scalar/validation").StringSchema;
|
|
66
|
+
slug: import("@scalar/validation").StringSchema;
|
|
67
|
+
version: import("@scalar/validation").StringSchema;
|
|
68
|
+
commitHash: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
69
|
+
conflictCheckedAgainstHash: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
70
|
+
hasConflict: import("@scalar/validation").OptionalSchema<import("@scalar/validation").BooleanSchema>;
|
|
71
|
+
}>>;
|
|
72
|
+
}>]>;
|
|
73
|
+
export type AsyncApiDocument = {
|
|
74
|
+
/** REQUIRED. The AsyncAPI Specification version the document uses (for example "3.0.0"). */
|
|
75
|
+
asyncapi: string;
|
|
76
|
+
/** REQUIRED. Provides metadata about the application. */
|
|
77
|
+
info: AsyncApiInfoObject;
|
|
78
|
+
} & AsyncApiExtensions & WorkspaceManagedExtensions & XScalarOriginalDocumentHash & XScalarIsDirty & XScalarRegistryMeta;
|
|
79
|
+
//# sourceMappingURL=asyncapi-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncapi-document.d.ts","sourceRoot":"","sources":["../../../src/schemas/asyncapi/asyncapi-document.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4DAA4D,CAAA;AACvG,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAA;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+DAA+D,CAAA;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAA;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;EAc9B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,sGAAsG;IACtG,OAAO,EAAE,MAAM,CAAA;IACf,0GAA0G;IAC1G,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;EAO9B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;IACvC,4EAA4E;IAC5E,wBAAwB,EAAE,MAAM,CAAA;CACjC,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;IAuB5B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,4FAA4F;IAC5F,QAAQ,EAAE,MAAM,CAAA;IAChB,yDAAyD;IACzD,IAAI,EAAE,kBAAkB,CAAA;CACzB,GAAG,kBAAkB,GACpB,0BAA0B,GAC1B,2BAA2B,GAC3B,cAAc,GACd,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { intersection, object, optional, string } from '@scalar/validation';
|
|
2
|
+
import { WorkspaceManagedExtensions } from '../../schemas/extensions/document/workspace-managed-extensions.js';
|
|
3
|
+
import { XScalarIsDirty } from '../../schemas/extensions/document/x-scalar-is-dirty.js';
|
|
4
|
+
import { XScalarOriginalDocumentHash } from '../../schemas/extensions/document/x-scalar-original-document-hash.js';
|
|
5
|
+
import { XScalarRegistryMeta } from '../../schemas/extensions/document/x-scalar-registry-meta.js';
|
|
6
|
+
/**
|
|
7
|
+
* Minimal AsyncAPI Info Object.
|
|
8
|
+
*
|
|
9
|
+
* Intentionally scoped to the fields we surface in the MVP. AsyncAPI's real Info Object
|
|
10
|
+
* is a superset (contact, license, termsOfService, tags, externalDocs, ...) — we can
|
|
11
|
+
* grow this as consumers need the extra fields.
|
|
12
|
+
*/
|
|
13
|
+
export const AsyncApiInfoObject = object({
|
|
14
|
+
title: string({ typeComment: 'REQUIRED. The title of the application.' }),
|
|
15
|
+
version: string({
|
|
16
|
+
typeComment: 'REQUIRED. Provides the version of the application API (not the AsyncAPI Specification version).',
|
|
17
|
+
}),
|
|
18
|
+
description: optional(string({
|
|
19
|
+
typeComment: 'A short description of the application. CommonMark syntax can be used for rich text representation.',
|
|
20
|
+
})),
|
|
21
|
+
}, { typeName: 'AsyncApiInfoObject' });
|
|
22
|
+
/**
|
|
23
|
+
* AsyncAPI-specific extensions. Store-managed metadata (source url, document
|
|
24
|
+
* hash, dirty flag, registry meta) is shared with the OpenAPI side via the
|
|
25
|
+
* dedicated extension modules so the two cannot drift apart.
|
|
26
|
+
*
|
|
27
|
+
* `x-original-aas-version` stays here because it is the AsyncAPI analog of
|
|
28
|
+
* `x-original-oas-version` — different field names per spec, so unified
|
|
29
|
+
* sharing is not a fit.
|
|
30
|
+
*/
|
|
31
|
+
export const AsyncApiExtensions = object({
|
|
32
|
+
'x-original-aas-version': optional(string({ typeComment: 'Original AsyncAPI Specification version the document was loaded with.' })),
|
|
33
|
+
}, { typeName: 'AsyncApiExtensions' });
|
|
34
|
+
/**
|
|
35
|
+
* Minimal AsyncAPI Document.
|
|
36
|
+
*
|
|
37
|
+
* MVP shape: the spec version discriminator, the minimal Info Object, and the shared
|
|
38
|
+
* store-managed metadata extensions. Present on the discriminated {@link WorkspaceDocument}
|
|
39
|
+
* union via the required `asyncapi` field.
|
|
40
|
+
*/
|
|
41
|
+
export const AsyncApiDocument = intersection([
|
|
42
|
+
object({
|
|
43
|
+
asyncapi: string({
|
|
44
|
+
typeComment: 'REQUIRED. The AsyncAPI Specification version the document uses (for example "3.0.0").',
|
|
45
|
+
}),
|
|
46
|
+
info: AsyncApiInfoObject,
|
|
47
|
+
}, { typeName: 'AsyncApiDocumentCore' }),
|
|
48
|
+
AsyncApiExtensions,
|
|
49
|
+
// Shared store-managed metadata. Composed from the same extension modules
|
|
50
|
+
// the OpenAPI side uses so the two document shapes cannot drift apart.
|
|
51
|
+
WorkspaceManagedExtensions,
|
|
52
|
+
XScalarOriginalDocumentHash,
|
|
53
|
+
XScalarIsDirty,
|
|
54
|
+
XScalarRegistryMeta,
|
|
55
|
+
], {
|
|
56
|
+
typeName: 'AsyncApiDocument',
|
|
57
|
+
typeComment: 'Root AsyncAPI document including Scalar workspace extensions.',
|
|
58
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema for workspace-store-managed metadata extensions that apply to every
|
|
3
|
+
* document type in the workspace, regardless of OpenAPI or AsyncAPI shape.
|
|
4
|
+
*
|
|
5
|
+
* Currently this is just `x-scalar-original-source-url`. The original document
|
|
6
|
+
* hash (`x-scalar-original-document-hash`) is intentionally kept in its own
|
|
7
|
+
* `XScalarOriginalDocumentHashSchema` because OpenAPI treats it as
|
|
8
|
+
* post-ingestion-required (so `coerce` defaults missing values to `""`),
|
|
9
|
+
* while AsyncAPI treats it as optional. Once that asymmetry is resolved this
|
|
10
|
+
* file can absorb it.
|
|
11
|
+
*
|
|
12
|
+
* Centralized here so the OpenAPI and AsyncAPI document schemas share one
|
|
13
|
+
* definition for the source-url field and cannot drift apart silently.
|
|
14
|
+
*/
|
|
15
|
+
export declare const WorkspaceManagedExtensionsSchema: import("@scalar/typebox").TObject<{
|
|
16
|
+
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
17
|
+
}>;
|
|
18
|
+
export type WorkspaceManagedExtensions = Partial<{
|
|
19
|
+
/** Original document source url — when loaded from an external source. */
|
|
20
|
+
'x-scalar-original-source-url': string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const WorkspaceManagedExtensions: import("@scalar/validation").ObjectSchema<{
|
|
23
|
+
'x-scalar-original-source-url': import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=workspace-managed-extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-managed-extensions.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/document/workspace-managed-extensions.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC;;EAK5C,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC;IAC/C,0EAA0E;IAC1E,8BAA8B,EAAE,MAAM,CAAA;CACvC,CAAC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;EAUtC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { object, optional, string } from '@scalar/validation';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for workspace-store-managed metadata extensions that apply to every
|
|
5
|
+
* document type in the workspace, regardless of OpenAPI or AsyncAPI shape.
|
|
6
|
+
*
|
|
7
|
+
* Currently this is just `x-scalar-original-source-url`. The original document
|
|
8
|
+
* hash (`x-scalar-original-document-hash`) is intentionally kept in its own
|
|
9
|
+
* `XScalarOriginalDocumentHashSchema` because OpenAPI treats it as
|
|
10
|
+
* post-ingestion-required (so `coerce` defaults missing values to `""`),
|
|
11
|
+
* while AsyncAPI treats it as optional. Once that asymmetry is resolved this
|
|
12
|
+
* file can absorb it.
|
|
13
|
+
*
|
|
14
|
+
* Centralized here so the OpenAPI and AsyncAPI document schemas share one
|
|
15
|
+
* definition for the source-url field and cannot drift apart silently.
|
|
16
|
+
*/
|
|
17
|
+
export const WorkspaceManagedExtensionsSchema = Type.Partial(Type.Object({
|
|
18
|
+
/** Original document source url — when loaded from an external source. */
|
|
19
|
+
'x-scalar-original-source-url': Type.String(),
|
|
20
|
+
}));
|
|
21
|
+
export const WorkspaceManagedExtensions = object({
|
|
22
|
+
'x-scalar-original-source-url': optional(string({ typeComment: 'Original document source url — when loaded from an external source.' })),
|
|
23
|
+
}, {
|
|
24
|
+
typeName: 'WorkspaceManagedExtensions',
|
|
25
|
+
typeComment: 'Workspace-store-managed metadata extensions shared by OpenAPI and AsyncAPI documents.',
|
|
26
|
+
});
|