@supersoniks/concorde 4.9.9 → 4.9.91
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/build-infos.json +1 -1
- package/concorde-core.bundle.js +241 -241
- package/concorde-core.es.js +2908 -2845
- package/dist/concorde-core.bundle.js +241 -241
- package/dist/concorde-core.es.js +2908 -2845
- package/dist/js/core/decorators/api.js +92 -2
- package/dist/js/core/decorators/api.js.map +1 -1
- package/dist/js/decorators.js +4 -0
- package/dist/js/decorators.js.map +1 -1
- package/dist/types/core/decorators/api.d.ts +82 -60
- package/dist/types/core/decorators/api.d.ts.map +1 -1
- package/dist/types/decorators.d.ts +3 -1
- package/dist/types/decorators.d.ts.map +1 -1
- package/docs/assets/index-BL6WVF7g.css +1 -0
- package/docs/assets/{index-hElUgV9_.js → index-DVn8AeyA.js} +572 -555
- package/docs/crawl/docs/_decorators/get.html +64 -81
- package/docs/crawl/docs/_decorators/patch.html +35 -23
- package/docs/crawl/docs/_decorators/post.html +72 -72
- package/docs/crawl/docs/_decorators/put.html +36 -21
- package/docs/crawl/docs/_getting-started/ai-agents.html +45 -6
- package/docs/crawl/hubs/decorators.html +141 -69
- package/docs/crawl/hubs/remote-data.html +141 -69
- package/docs/index.html +2 -2
- package/docs/llms-full.txt +203 -149
- package/docs/llms.txt +4 -4
- package/docs/src/core/components/functional/queue/queue.md +0 -0
- package/docs/src/core/components/ui/button/button.md +0 -0
- package/docs/src/docs/_decorators/get.md +55 -81
- package/docs/src/docs/_decorators/patch.md +36 -25
- package/docs/src/docs/_decorators/post.md +71 -62
- package/docs/src/docs/_decorators/put.md +37 -24
- package/docs/src/docs/_getting-started/ai-agents.md +24 -4
- package/docs/src/docs/search/docs-search.json +151 -1
- package/docs/src/tsconfig.json +3 -0
- package/package.json +1 -1
- package/src/core/decorators/api.post.spec.ts +79 -1
- package/src/core/decorators/api.spec.ts +100 -1
- package/src/core/decorators/api.ts +252 -138
- package/src/decorators.ts +7 -0
- package/src/docs/_decorators/get.md +81 -80
- package/src/docs/_decorators/patch.md +36 -25
- package/src/docs/_decorators/post.md +99 -62
- package/src/docs/_decorators/put.md +37 -24
- package/src/docs/components/docs-demo-sources.ts +1 -6
- package/src/docs/example/decorators-demo-geo.ts +0 -21
- package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +41 -132
- package/src/docs/search/docs-search.json +128 -133
- package/docs/assets/index-Bnp7gVaA.css +0 -1
|
@@ -5,7 +5,6 @@ import type { ApiResult } from "@supersoniks/concorde/core/utils/api";
|
|
|
5
5
|
import { DataProviderKey } from "@supersoniks/concorde/core/utils/dataProviderKey";
|
|
6
6
|
import { sub } from "@supersoniks/concorde/directives";
|
|
7
7
|
import {
|
|
8
|
-
dp,
|
|
9
8
|
get as storeGet,
|
|
10
9
|
set,
|
|
11
10
|
} from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
@@ -13,30 +12,23 @@ import { publishDemoKey } from "./docs-provider-keys";
|
|
|
13
12
|
import { tailwind } from "../tailwind";
|
|
14
13
|
import "./decorators-demo-init";
|
|
15
14
|
import {
|
|
16
|
-
docsDemoDynApiConfKeyTemplate,
|
|
17
15
|
docsDemoGeoApiConfigurationKey,
|
|
18
|
-
docsDemoGeoCommunesRefreshKey,
|
|
19
16
|
geoCommunesApiGetEndpoint,
|
|
20
17
|
geoCommunesApiGetEndpointDynamic,
|
|
21
18
|
geoCommunesApiGetPublishKey,
|
|
22
19
|
type GeoCommuneRow,
|
|
23
20
|
} from "./decorators-demo-geo";
|
|
24
21
|
|
|
25
|
-
function formatFetchedAt(response: Response | null | undefined): string {
|
|
26
|
-
const raw = response?.headers.get("X-Fetched-At");
|
|
27
|
-
if (!raw) return "—";
|
|
28
|
-
try {
|
|
29
|
-
return new Date(raw).toLocaleTimeString();
|
|
30
|
-
} catch {
|
|
31
|
-
return raw;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
22
|
type PublishDemoData = {
|
|
36
23
|
email: string;
|
|
37
24
|
message: string;
|
|
38
25
|
};
|
|
39
26
|
|
|
27
|
+
const geoCommunesGet = get(
|
|
28
|
+
geoCommunesApiGetEndpoint,
|
|
29
|
+
docsDemoGeoApiConfigurationKey,
|
|
30
|
+
);
|
|
31
|
+
|
|
40
32
|
@customElement("demo-publish")
|
|
41
33
|
export class DemoPublish extends LitElement {
|
|
42
34
|
static styles = [tailwind];
|
|
@@ -95,50 +87,35 @@ export class DemoPublish extends LitElement {
|
|
|
95
87
|
export class DemoApiGet extends LitElement {
|
|
96
88
|
static styles = [tailwind];
|
|
97
89
|
|
|
98
|
-
@
|
|
99
|
-
triggerKey: docsDemoGeoCommunesRefreshKey,
|
|
100
|
-
})
|
|
90
|
+
@geoCommunesGet
|
|
101
91
|
@state()
|
|
102
92
|
geoApiPayload?: ApiResult<GeoCommuneRow[]>;
|
|
103
93
|
|
|
104
94
|
private refresh() {
|
|
105
|
-
|
|
95
|
+
geoCommunesGet.refetch(this);
|
|
106
96
|
}
|
|
107
97
|
|
|
108
98
|
render() {
|
|
109
99
|
const rows = this.geoApiPayload?.result;
|
|
110
|
-
const status = this.geoApiPayload?.response?.status;
|
|
111
|
-
const fetchedAt = formatFetchedAt(this.geoApiPayload?.response ?? null);
|
|
112
100
|
return html`
|
|
113
|
-
<div class="space-y-
|
|
101
|
+
<div class="space-y-3">
|
|
102
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
103
|
+
<span class="text-sm font-medium">🗺️ GET simple</span>
|
|
104
|
+
<sonic-button size="sm" @click=${this.refresh}>Rafraîchir</sonic-button>
|
|
105
|
+
</div>
|
|
114
106
|
<p class="text-sm text-neutral-600 dark:text-neutral-400">
|
|
115
|
-
<code>@get</code
|
|
116
|
-
<code>sonic-queue</code> (<code>/docs-mock-api/geo/</code>).
|
|
117
|
-
Propriété typée <code>ApiResult<T></code>.
|
|
118
|
-
Refetch via <code>triggerKey</code> (<code
|
|
119
|
-
>docsDemoGeoCommunesRefresh</code
|
|
120
|
-
>).
|
|
107
|
+
Une liste de communes chargée avec <code>@get</code>.
|
|
121
108
|
</p>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
? html`<p class="text-xs text-neutral-500">
|
|
125
|
-
HTTP ${status} · fetch ${fetchedAt}
|
|
126
|
-
</p>`
|
|
127
|
-
: ""}
|
|
128
|
-
${this.geoApiPayload === null
|
|
129
|
-
? html`<p class="text-neutral-500">Chargement…</p>`
|
|
109
|
+
${this.geoApiPayload == null
|
|
110
|
+
? html`<p class="text-sm text-neutral-500">Chargement…</p>`
|
|
130
111
|
: !rows || rows.length === 0
|
|
131
|
-
? html`<p class="text-neutral-500">Aucune commune</p>`
|
|
112
|
+
? html`<p class="text-sm text-neutral-500">Aucune commune</p>`
|
|
132
113
|
: html`
|
|
133
|
-
<ul class="
|
|
114
|
+
<ul class="grid gap-1 sm:grid-cols-2">
|
|
134
115
|
${rows.map(
|
|
135
|
-
(c) =>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<span class="text-neutral-500 text-sm">
|
|
139
|
-
— ${c.code}</span
|
|
140
|
-
>
|
|
141
|
-
</li>`,
|
|
116
|
+
(c) => html`<li class="text-sm">
|
|
117
|
+
${c.nom} <span class="text-neutral-500">(${c.code})</span>
|
|
118
|
+
</li>`,
|
|
142
119
|
)}
|
|
143
120
|
</ul>
|
|
144
121
|
`}
|
|
@@ -151,116 +128,48 @@ export class DemoApiGet extends LitElement {
|
|
|
151
128
|
export class DemoApiGetConfigurationKey extends LitElement {
|
|
152
129
|
static styles = [tailwind];
|
|
153
130
|
|
|
154
|
-
@property({ type: String })
|
|
155
|
-
configSlot: "A" | "B" = "A";
|
|
156
|
-
|
|
157
131
|
@property({ type: Number })
|
|
158
|
-
communeLimit =
|
|
132
|
+
communeLimit = 3;
|
|
159
133
|
|
|
160
|
-
@get(geoCommunesApiGetEndpointDynamic,
|
|
161
|
-
triggerKey: docsDemoGeoCommunesRefreshKey,
|
|
162
|
-
})
|
|
134
|
+
@get(geoCommunesApiGetEndpointDynamic, docsDemoGeoApiConfigurationKey)
|
|
163
135
|
@state()
|
|
164
136
|
geoApiPayloadDyn?: ApiResult<GeoCommuneRow[]>;
|
|
165
137
|
|
|
166
138
|
render() {
|
|
167
139
|
const rows = this.geoApiPayloadDyn?.result;
|
|
168
|
-
const status = this.geoApiPayloadDyn?.response?.status;
|
|
169
|
-
const fetchedAt = formatFetchedAt(this.geoApiPayloadDyn?.response ?? null);
|
|
170
140
|
return html`
|
|
171
141
|
<div class="space-y-3">
|
|
172
142
|
<p class="text-sm text-neutral-600 dark:text-neutral-400">
|
|
173
|
-
|
|
174
|
-
path d’endpoint avec <code>communeLimit</code>. Le refetch manuel
|
|
175
|
-
passe par <code>triggerKey</code> — voir le bouton « ailleurs »
|
|
176
|
-
ci-dessous dans la doc.
|
|
143
|
+
<code>@get</code> avec un endpoint et une configuration dynamiques.
|
|
177
144
|
</p>
|
|
178
|
-
<div class="flex flex-wrap gap-2
|
|
179
|
-
<span class="text-
|
|
145
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
146
|
+
<span class="text-sm">Nombre de communes :</span>
|
|
180
147
|
${[3, 5, 10].map(
|
|
181
|
-
(
|
|
148
|
+
(limit) => html`
|
|
182
149
|
<sonic-button
|
|
183
150
|
size="sm"
|
|
184
|
-
type=${this.communeLimit ===
|
|
151
|
+
type=${this.communeLimit === limit ? "primary" : "neutral"}
|
|
185
152
|
@click=${() => {
|
|
186
|
-
this.communeLimit =
|
|
153
|
+
this.communeLimit = limit;
|
|
187
154
|
}}
|
|
188
|
-
>${n}</sonic-button
|
|
189
155
|
>
|
|
156
|
+
${limit}
|
|
157
|
+
</sonic-button>
|
|
190
158
|
`,
|
|
191
159
|
)}
|
|
192
160
|
</div>
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
<sonic-button
|
|
196
|
-
size="sm"
|
|
197
|
-
type=${this.configSlot === "A" ? "primary" : "neutral"}
|
|
198
|
-
@click=${() => {
|
|
199
|
-
this.configSlot = "A";
|
|
200
|
-
}}
|
|
201
|
-
>docsDemoDynApiConfA</sonic-button
|
|
202
|
-
>
|
|
203
|
-
<sonic-button
|
|
204
|
-
size="sm"
|
|
205
|
-
type=${this.configSlot === "B" ? "primary" : "neutral"}
|
|
206
|
-
@click=${() => {
|
|
207
|
-
this.configSlot = "B";
|
|
208
|
-
}}
|
|
209
|
-
>docsDemoDynApiConfB</sonic-button
|
|
210
|
-
>
|
|
211
|
-
</div>
|
|
212
|
-
${status != null
|
|
213
|
-
? html`<p class="text-xs text-neutral-500">
|
|
214
|
-
HTTP ${status} · fetch ${fetchedAt} · limit=${this.communeLimit} ·
|
|
215
|
-
conf=docsDemoDynApiConf${this.configSlot}
|
|
216
|
-
</p>`
|
|
217
|
-
: ""}
|
|
218
|
-
${this.geoApiPayloadDyn === null
|
|
219
|
-
? html`<p class="text-neutral-500">Chargement…</p>`
|
|
220
|
-
: !rows || rows.length === 0
|
|
221
|
-
? html`<p class="text-neutral-500">Aucune commune</p>`
|
|
222
|
-
: html`
|
|
223
|
-
<ul class="list-disc pl-5 space-y-1">
|
|
224
|
-
${rows.map(
|
|
225
|
-
(c) =>
|
|
226
|
-
html`<li>
|
|
227
|
-
<span class="font-medium">${c.nom}</span>
|
|
228
|
-
<span class="text-neutral-500 text-sm">
|
|
229
|
-
— ${c.code}</span
|
|
230
|
-
>
|
|
231
|
-
</li>`,
|
|
232
|
-
)}
|
|
233
|
-
</ul>
|
|
234
|
-
`}
|
|
235
|
-
</div>
|
|
236
|
-
`;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/** Déclenche le refetch d’un `@get` distant via `triggerKey` (sans toucher la config). */
|
|
241
|
-
@customElement("demo-api-get-refresh-remote")
|
|
242
|
-
export class DemoApiGetRefreshRemote extends LitElement {
|
|
243
|
-
static styles = [tailwind];
|
|
244
|
-
|
|
245
|
-
private refreshFromElsewhere() {
|
|
246
|
-
dp(docsDemoGeoCommunesRefreshKey).invalidate();
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
render() {
|
|
250
|
-
return html`
|
|
251
|
-
<div
|
|
252
|
-
class="rounded border border-dashed border-neutral-300 dark:border-neutral-600 p-3 space-y-2"
|
|
253
|
-
>
|
|
254
|
-
<p class="text-sm text-neutral-600 dark:text-neutral-400">
|
|
255
|
-
Composant séparé — même publisher
|
|
256
|
-
<code>docsDemoGeoCommunesRefresh</code> :
|
|
161
|
+
<p class="font-mono text-xs text-neutral-500">
|
|
162
|
+
communes?limit=${this.communeLimit}
|
|
257
163
|
</p>
|
|
258
|
-
|
|
259
|
-
class="text-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
164
|
+
${this.geoApiPayloadDyn == null
|
|
165
|
+
? html`<p class="text-sm text-neutral-500">Chargement…</p>`
|
|
166
|
+
: html`
|
|
167
|
+
<ul class="grid gap-1 sm:grid-cols-2">
|
|
168
|
+
${(rows ?? []).map(
|
|
169
|
+
(c) => html`<li class="text-sm">${c.nom}</li>`,
|
|
170
|
+
)}
|
|
171
|
+
</ul>
|
|
172
|
+
`}
|
|
264
173
|
</div>
|
|
265
174
|
`;
|
|
266
175
|
}
|