@scalar/api-client 3.5.1 → 3.6.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 +13 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/style.css +3916 -4768
- package/dist/styles/tailwind.config.css +20 -0
- package/dist/styles/utilities.css +45 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/app/App.vue.d.ts +15 -31
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js.map +1 -1
- package/dist/v2/features/app/App.vue.script.js +107 -28
- package/dist/v2/features/app/App.vue.script.js.map +1 -1
- package/dist/v2/features/app/app-state.d.ts +10 -14
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +53 -21
- package/dist/v2/features/app/app-state.js.map +1 -1
- package/dist/v2/features/app/components/AppHeader.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppHeader.vue.js.map +1 -1
- package/dist/v2/features/app/components/AppHeader.vue.script.js +1 -1
- package/dist/v2/features/app/components/AppHeader.vue.script.js.map +1 -1
- package/dist/v2/features/app/components/AppHeaderActions.vue.d.ts +32 -0
- package/dist/v2/features/app/components/AppHeaderActions.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/AppHeaderActions.vue.js +7 -0
- package/dist/v2/features/app/components/AppHeaderActions.vue.js.map +1 -0
- package/dist/v2/features/app/components/AppHeaderActions.vue.script.js +170 -0
- package/dist/v2/features/app/components/AppHeaderActions.vue.script.js.map +1 -0
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -3
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.script.js +1 -2
- package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts +1 -2
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js +1 -1
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js.map +1 -1
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js +3 -34
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js.map +1 -1
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts +1 -1
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/PublishDocumentModal.vue.d.ts +77 -0
- package/dist/v2/features/app/components/PublishDocumentModal.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/PublishDocumentModal.vue.js +7 -0
- package/dist/v2/features/app/components/PublishDocumentModal.vue.js.map +1 -0
- package/dist/v2/features/app/components/PublishDocumentModal.vue.script.js +209 -0
- package/dist/v2/features/app/components/PublishDocumentModal.vue.script.js.map +1 -0
- package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.d.ts.map +1 -0
- package/dist/v2/features/{collection → app}/components/SyncConflictResolutionEditor.vue.js +2 -2
- package/dist/v2/features/app/components/SyncConflictResolutionEditor.vue.js.map +1 -0
- package/dist/v2/features/{collection → app}/components/SyncConflictResolutionEditor.vue.script.js +1 -1
- package/dist/v2/features/{collection/components/SyncConflictResolutionEditor.vue.js.map → app/components/SyncConflictResolutionEditor.vue.script.js.map} +1 -1
- package/dist/v2/features/app/helpers/check-version-conflict.d.ts +8 -5
- package/dist/v2/features/app/helpers/check-version-conflict.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/check-version-conflict.js +10 -7
- package/dist/v2/features/app/helpers/check-version-conflict.js.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +8 -5
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +2 -2
- package/dist/v2/features/app/helpers/create-api-client-app.js.map +1 -1
- package/dist/v2/features/app/helpers/load-registry-document.d.ts +1 -10
- package/dist/v2/features/app/helpers/load-registry-document.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/load-registry-document.js +6 -5
- package/dist/v2/features/app/helpers/load-registry-document.js.map +1 -1
- package/dist/v2/features/app/helpers/registry-error-messages.d.ts +23 -0
- package/dist/v2/features/app/helpers/registry-error-messages.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/registry-error-messages.js +63 -0
- package/dist/v2/features/app/helpers/registry-error-messages.js.map +1 -0
- package/dist/v2/features/app/hooks/use-active-document-version.d.ts +2 -1
- package/dist/v2/features/app/hooks/use-active-document-version.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-active-document-version.js.map +1 -1
- package/dist/v2/features/app/hooks/use-document-sync.d.ts +126 -0
- package/dist/v2/features/app/hooks/use-document-sync.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-document-sync.js +448 -0
- package/dist/v2/features/app/hooks/use-document-sync.js.map +1 -0
- package/dist/v2/features/app/hooks/use-network-status.d.ts +29 -0
- package/dist/v2/features/app/hooks/use-network-status.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-network-status.js +58 -0
- package/dist/v2/features/app/hooks/use-network-status.js.map +1 -0
- package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts +1 -25
- package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-sidebar-documents.js.map +1 -1
- package/dist/v2/features/app/index.d.ts +1 -1
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.script.js +43 -277
- package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.script.js +25 -9
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.script.js.map +1 -1
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.d.ts.map +1 -1
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +5 -5
- package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js.map +1 -1
- package/dist/v2/types/configuration.d.ts +273 -7
- package/dist/v2/types/configuration.d.ts.map +1 -1
- package/dist/vue-styles.css +1389 -0
- package/package.json +21 -15
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.js +0 -7
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.js.map +0 -1
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.script.js +0 -51
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.script.js.map +0 -1
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.d.ts.map +0 -1
- package/dist/v2/features/collection/components/SyncConflictResolutionEditor.vue.script.js.map +0 -1
- /package/dist/v2/features/{collection → app}/components/SyncConflictResolutionEditor.vue.d.ts +0 -0
|
@@ -1,12 +1,278 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Result } from '@scalar/helpers/types/result';
|
|
2
|
+
/**
|
|
3
|
+
* Coordinates that uniquely identify a registry-backed document. Both the
|
|
4
|
+
* fetch and publish APIs operate on these so callers can compose a single
|
|
5
|
+
* meta object once and pass it around.
|
|
6
|
+
*/
|
|
7
|
+
export type RegistryDocumentMeta = {
|
|
2
8
|
namespace: string;
|
|
3
9
|
slug: string;
|
|
4
10
|
version?: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Error codes surfaced by `fetchDocument`. Errors are returned as a
|
|
14
|
+
* discriminated union so callers can react to each failure mode without
|
|
15
|
+
* having to parse free-form strings:
|
|
16
|
+
*
|
|
17
|
+
* - `NOT_FOUND`: the registry has no document at the requested
|
|
18
|
+
* namespace / slug / version. Usually a sign that the version was
|
|
19
|
+
* removed upstream or the caller is asking for a draft that does not
|
|
20
|
+
* exist yet.
|
|
21
|
+
* - `FETCH_FAILED`: a network or server error prevented the fetch from
|
|
22
|
+
* completing. The request can usually be retried.
|
|
23
|
+
* - `UNAUTHORIZED`: the caller is not signed in / not allowed to read
|
|
24
|
+
* from this namespace. The host application is expected to surface a
|
|
25
|
+
* sign-in flow.
|
|
26
|
+
* - `UNKNOWN`: a catch-all for failure modes the adapter cannot map
|
|
27
|
+
* onto one of the dedicated codes above. Callers surface a generic
|
|
28
|
+
* error message and, when present, the human-readable `message`
|
|
29
|
+
* field returned alongside the code.
|
|
30
|
+
*/
|
|
31
|
+
export type FetchRegistryDocumentError = 'NOT_FOUND' | 'FETCH_FAILED' | 'UNAUTHORIZED' | 'UNKNOWN';
|
|
32
|
+
/**
|
|
33
|
+
* Fetches the full document from the registry by meta. When a `registry`
|
|
34
|
+
* adapter is wired up, registry meta takes priority over
|
|
35
|
+
* `x-scalar-original-source-url` when syncing. Returns the document as a
|
|
36
|
+
* plain object on success, or a discriminated `FetchRegistryDocumentError`
|
|
37
|
+
* code (with an optional human-readable `message`) on failure.
|
|
38
|
+
*/
|
|
39
|
+
export type ImportDocumentFromRegistry = (meta: RegistryDocumentMeta) => Promise<Result<{
|
|
40
|
+
document: Record<string, unknown>;
|
|
41
|
+
versionSha?: string;
|
|
42
|
+
}, FetchRegistryDocumentError>>;
|
|
43
|
+
/**
|
|
44
|
+
* Error codes surfaced by `publishDocument`. Errors are returned as a
|
|
45
|
+
* discriminated union so callers can react to each failure mode without
|
|
46
|
+
* having to parse free-form strings:
|
|
47
|
+
*
|
|
48
|
+
* - `CONFLICT`: the namespace/slug is already taken on the registry.
|
|
49
|
+
* Resolve by picking a new slug or pulling the upstream version.
|
|
50
|
+
* - `FETCH_FAILED`: a network or server error prevented the publish from
|
|
51
|
+
* completing. The request can usually be retried.
|
|
52
|
+
* - `UNAUTHORIZED`: the caller is not signed in / not allowed to publish
|
|
53
|
+
* to this namespace. The host application is expected to surface a
|
|
54
|
+
* sign-in flow.
|
|
55
|
+
* - `UNKNOWN`: a catch-all for failure modes the adapter cannot map
|
|
56
|
+
* onto one of the dedicated codes above. Callers surface a generic
|
|
57
|
+
* error message and, when present, the human-readable `message`
|
|
58
|
+
* field returned alongside the code.
|
|
59
|
+
*/
|
|
60
|
+
export type PublishRegistryDocumentError = 'CONFLICT' | 'FETCH_FAILED' | 'UNAUTHORIZED' | 'UNKNOWN';
|
|
61
|
+
/**
|
|
62
|
+
* Discriminated outcome of a `publishDocument` call.
|
|
63
|
+
*/
|
|
64
|
+
export type PublishRegistryDocumentResult = Result<RegistryDocumentMeta & {
|
|
65
|
+
/** Commit hash advertised by the registry for the published version. */
|
|
66
|
+
commitHash?: string;
|
|
67
|
+
}, PublishRegistryDocumentError>;
|
|
68
|
+
/**
|
|
69
|
+
* Publishes a brand-new document to the registry under the given
|
|
70
|
+
* namespace and slug. Used for team-workspace documents that do not yet
|
|
71
|
+
* have a registry entry - subsequent sync flows then go through the
|
|
72
|
+
* Pull / Push pair once the registry has assigned a commit hash.
|
|
73
|
+
*
|
|
74
|
+
* The caller also chooses the document's initial `version` and passes
|
|
75
|
+
* the full document body. The local workspace mirrors the same string
|
|
76
|
+
* on `info.version` after a successful publish so the document and the
|
|
77
|
+
* registry stay in sync without a follow-up edit.
|
|
78
|
+
*/
|
|
79
|
+
export type PublishRegistryDocument = (input: {
|
|
80
|
+
namespace: string;
|
|
81
|
+
slug: string;
|
|
82
|
+
/** Initial version the document is published under (e.g. `1.0.0`). */
|
|
83
|
+
version: string;
|
|
84
|
+
/**
|
|
85
|
+
* Full OpenAPI document body to seed the registry entry with. The
|
|
86
|
+
* caller is expected to apply the chosen `version` to `info.version`
|
|
87
|
+
* before passing the document so the registry stores a consistent
|
|
88
|
+
* snapshot.
|
|
89
|
+
*/
|
|
90
|
+
document: Record<string, unknown>;
|
|
91
|
+
}) => Promise<PublishRegistryDocumentResult>;
|
|
92
|
+
/**
|
|
93
|
+
* Error codes surfaced by `publishVersion`. Errors are returned as a
|
|
94
|
+
* discriminated union so callers can react to each failure mode without
|
|
95
|
+
* having to parse free-form strings:
|
|
96
|
+
*
|
|
97
|
+
* - `CONFLICT`: the registry's current commit hash for this version no
|
|
98
|
+
* longer matches the one the caller passed in. Somebody pushed in the
|
|
99
|
+
* meantime - the caller is expected to pull the upstream changes,
|
|
100
|
+
* resolve any merge conflicts and try again.
|
|
101
|
+
* - `NOT_FOUND`: the registry has no document at this namespace / slug
|
|
102
|
+
* to publish a new version against. Use `publishDocument` instead to
|
|
103
|
+
* create the document group first.
|
|
104
|
+
* - `FETCH_FAILED`: a network or server error prevented the publish
|
|
105
|
+
* from completing. The request can usually be retried.
|
|
106
|
+
* - `UNAUTHORIZED`: the caller is not signed in / not allowed to
|
|
107
|
+
* publish to this namespace. The host application is expected to
|
|
108
|
+
* surface a sign-in flow.
|
|
109
|
+
* - `UNKNOWN`: a catch-all for failure modes the adapter cannot map
|
|
110
|
+
* onto one of the dedicated codes above. Callers surface a generic
|
|
111
|
+
* error message and, when present, the human-readable `message`
|
|
112
|
+
* field returned alongside the code.
|
|
113
|
+
*/
|
|
114
|
+
export type PublishRegistryVersionError = 'CONFLICT' | 'NOT_FOUND' | 'FETCH_FAILED' | 'UNAUTHORIZED' | 'UNKNOWN';
|
|
115
|
+
/**
|
|
116
|
+
* Discriminated outcome of a `publishVersion` call. On success the
|
|
117
|
+
* registry returns the new commit hash so the caller can persist it on
|
|
118
|
+
* `x-scalar-registry-meta` and detect upstream drift on subsequent
|
|
119
|
+
* refreshes.
|
|
120
|
+
*/
|
|
121
|
+
export type PublishRegistryVersionResult = Result<RegistryDocumentMeta & {
|
|
122
|
+
/** Commit hash advertised by the registry for the published version. */
|
|
123
|
+
commitHash?: string;
|
|
124
|
+
}, PublishRegistryVersionError>;
|
|
125
|
+
/**
|
|
126
|
+
* Publishes a new version of an existing registry document. Pairs with
|
|
127
|
+
* `publishDocument` (which creates the document group itself) and is
|
|
128
|
+
* what the team-workspace "Push" flow ultimately calls once the user
|
|
129
|
+
* has saved local edits.
|
|
130
|
+
*
|
|
131
|
+
* The caller passes the `commitHash` it currently has locally so the
|
|
132
|
+
* registry can do optimistic concurrency: if the upstream hash has
|
|
133
|
+
* moved on, the publish is rejected with `CONFLICT` and the caller is
|
|
134
|
+
* expected to pull the latest version before retrying.
|
|
135
|
+
*/
|
|
136
|
+
export type PublishRegistryVersion = (input: {
|
|
137
|
+
namespace: string;
|
|
138
|
+
slug: string;
|
|
139
|
+
/** Version identifier the caller is publishing (e.g. `1.2.0`). */
|
|
140
|
+
version: string;
|
|
141
|
+
/**
|
|
142
|
+
* Full OpenAPI document body that should become the new state on the
|
|
143
|
+
* registry for this `version`. Mirrors the input shape of
|
|
144
|
+
* `publishDocument` so adapters can share the same upload helper.
|
|
145
|
+
*/
|
|
146
|
+
document: Record<string, unknown>;
|
|
147
|
+
/**
|
|
148
|
+
* Commit hash the caller currently believes is the latest one for
|
|
149
|
+
* this `version`. The registry compares this against its own current
|
|
150
|
+
* hash and rejects the publish with `CONFLICT` when they no longer
|
|
151
|
+
* match, preventing accidental overwrites of upstream changes.
|
|
152
|
+
*/
|
|
153
|
+
commitHash?: string;
|
|
154
|
+
}) => Promise<PublishRegistryVersionResult>;
|
|
155
|
+
/**
|
|
156
|
+
* A single version that the registry advertises for a document group.
|
|
157
|
+
*
|
|
158
|
+
* Mirrors the minimum surface the sidebar needs to render a version row
|
|
159
|
+
* (the version label and an optional commit hash). Loaded vs unloaded
|
|
160
|
+
* state is derived later by matching against workspace-store documents.
|
|
161
|
+
*/
|
|
162
|
+
export type RegistryDocumentVersion = {
|
|
163
|
+
version: string;
|
|
164
|
+
commitHash?: string;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* A document group as advertised by the registry, before it is merged
|
|
168
|
+
* with locally loaded workspace documents. Lives at the configuration
|
|
169
|
+
* layer so consumers can produce these without depending on internal
|
|
170
|
+
* sidebar hooks.
|
|
171
|
+
*/
|
|
172
|
+
export type RegistryDocument = {
|
|
173
|
+
namespace: string;
|
|
174
|
+
slug: string;
|
|
175
|
+
title: string;
|
|
176
|
+
versions: RegistryDocumentVersion[];
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Loading-aware wrapper for the list of registry documents.
|
|
180
|
+
*
|
|
181
|
+
* The sidebar uses the `status` to decide whether to render skeleton
|
|
182
|
+
* placeholders while the registry is being fetched. `documents` is
|
|
183
|
+
* optional during loading so callers can either render nothing or stream
|
|
184
|
+
* in cached results while a refresh is still in flight.
|
|
185
|
+
*/
|
|
186
|
+
export type RegistryDocumentsState = {
|
|
187
|
+
status: 'loading';
|
|
188
|
+
documents?: RegistryDocument[];
|
|
189
|
+
} | {
|
|
190
|
+
status: 'success';
|
|
191
|
+
documents: RegistryDocument[];
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* A namespace under which the user is allowed to publish documents.
|
|
195
|
+
*
|
|
196
|
+
* The publish modal renders one entry per namespace - as a static label
|
|
197
|
+
* when there is only one, or as a dropdown otherwise - so callers can
|
|
198
|
+
* surface the personal account, organisations, teams, etc. the user
|
|
199
|
+
* has access to.
|
|
200
|
+
*/
|
|
201
|
+
export type RegistryNamespace = {
|
|
202
|
+
/** Stable namespace identifier passed back to publish callbacks. */
|
|
203
|
+
namespace: string;
|
|
204
|
+
/** Optional human-readable label. Falls back to `namespace` when omitted. */
|
|
205
|
+
title?: string;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Loading-aware wrapper for the list of namespaces the user can publish
|
|
209
|
+
* to. Mirrors {@link RegistryDocumentsState} so the publish modal can
|
|
210
|
+
* render a skeleton row while the host application is still resolving
|
|
211
|
+
* the user's memberships.
|
|
212
|
+
*/
|
|
213
|
+
export type RegistryNamespacesState = {
|
|
214
|
+
status: 'loading';
|
|
215
|
+
namespaces?: RegistryNamespace[];
|
|
8
216
|
} | {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
217
|
+
status: 'success';
|
|
218
|
+
namespaces: RegistryNamespace[];
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Bundles every interaction the API client needs with an external
|
|
222
|
+
* registry. Consumers (Scalar Cloud, custom self-hosted setups) provide
|
|
223
|
+
* a single adapter object instead of wiring each callback up
|
|
224
|
+
* individually. The adapter itself is optional at the top level of the
|
|
225
|
+
* client - omit it to opt out of registry features entirely - but every
|
|
226
|
+
* field inside the adapter is required when it is provided.
|
|
227
|
+
*/
|
|
228
|
+
export type RegistryAdapter = {
|
|
229
|
+
/**
|
|
230
|
+
* Reactive list of all available registry documents with a loading
|
|
231
|
+
* status, used by the sidebar to render skeleton placeholders until
|
|
232
|
+
* the real list is ready.
|
|
233
|
+
*/
|
|
234
|
+
documents: RegistryDocumentsState;
|
|
235
|
+
/**
|
|
236
|
+
* Reactive list of namespaces the user can publish into. The publish
|
|
237
|
+
* modal uses it to show a single-line label (one namespace) or a
|
|
238
|
+
* dropdown (multiple namespaces) and falls back to a skeleton while
|
|
239
|
+
* the listing is still loading.
|
|
240
|
+
*/
|
|
241
|
+
namespaces: RegistryNamespacesState;
|
|
242
|
+
/**
|
|
243
|
+
* Fetches the full document from the registry by meta. When provided,
|
|
244
|
+
* registry meta takes priority over `x-scalar-original-source-url`
|
|
245
|
+
* when syncing.
|
|
246
|
+
*/
|
|
247
|
+
fetchDocument: ImportDocumentFromRegistry;
|
|
248
|
+
/**
|
|
249
|
+
* Publishes a brand-new document to the registry under the given
|
|
250
|
+
* namespace and slug. Returns a discriminated `Result` so callers can
|
|
251
|
+
* branch on `CONFLICT` / `FETCH_FAILED` / `UNAUTHORIZED` without
|
|
252
|
+
* string-matching error messages.
|
|
253
|
+
*/
|
|
254
|
+
publishDocument: PublishRegistryDocument;
|
|
255
|
+
/**
|
|
256
|
+
* Publishes a new version of an existing registry document. The
|
|
257
|
+
* caller passes the `commitHash` it currently has locally so the
|
|
258
|
+
* registry can do optimistic concurrency and reject the publish with
|
|
259
|
+
* `CONFLICT` when the upstream hash has moved on.
|
|
260
|
+
*/
|
|
261
|
+
publishVersion: PublishRegistryVersion;
|
|
262
|
+
/**
|
|
263
|
+
* Forces the host application to refetch `documents` and resolves once
|
|
264
|
+
* the new listing is in hand.
|
|
265
|
+
*
|
|
266
|
+
* Used by the sync flow to invalidate the host's listing cache after a
|
|
267
|
+
* `CONFLICT` push: the rejection means the registry has a newer
|
|
268
|
+
* commit hash than our local listing knows about, so refreshing the
|
|
269
|
+
* listing lets `computeVersionStatus` notice the mismatch and flip the
|
|
270
|
+
* Pull button on naturally - without the hook having to track its own
|
|
271
|
+
* "needs pull" overlay state.
|
|
272
|
+
*
|
|
273
|
+
* Optional so existing adapters keep type-checking; the sync flow
|
|
274
|
+
* silently no-ops when it is missing.
|
|
275
|
+
*/
|
|
276
|
+
refreshDocuments?: () => Promise<void>;
|
|
277
|
+
};
|
|
12
278
|
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/v2/types/configuration.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B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