@flocon-ai/react 0.0.0-stage → 0.0.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.
@@ -0,0 +1,345 @@
1
+ import * as openapi_fetch from 'openapi-fetch';
2
+ import * as react from 'react';
3
+
4
+ /**
5
+ * This file was auto-generated by openapi-typescript.
6
+ * Do not make direct changes to the file.
7
+ */
8
+ interface paths {
9
+ "/website": {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ get: {
17
+ parameters: {
18
+ query?: never;
19
+ header?: never;
20
+ path?: never;
21
+ cookie?: never;
22
+ };
23
+ requestBody?: never;
24
+ responses: {
25
+ /** @description The website of the website token */
26
+ 200: {
27
+ headers: {
28
+ [name: string]: unknown;
29
+ };
30
+ content: {
31
+ "application/json": components["schemas"]["PackagesWebsite"];
32
+ };
33
+ };
34
+ /** @description Missing, wrong-scope or revoked token */
35
+ 401: {
36
+ headers: {
37
+ [name: string]: unknown;
38
+ };
39
+ content?: never;
40
+ };
41
+ };
42
+ };
43
+ put?: never;
44
+ post?: never;
45
+ delete?: never;
46
+ options?: never;
47
+ head?: never;
48
+ patch?: never;
49
+ trace?: never;
50
+ };
51
+ "/pages": {
52
+ parameters: {
53
+ query?: never;
54
+ header?: never;
55
+ path?: never;
56
+ cookie?: never;
57
+ };
58
+ get: {
59
+ parameters: {
60
+ query?: never;
61
+ header?: never;
62
+ path?: never;
63
+ cookie?: never;
64
+ };
65
+ requestBody?: never;
66
+ responses: {
67
+ /** @description All served pages, light. Never drafts or scheduled pages */
68
+ 200: {
69
+ headers: {
70
+ [name: string]: unknown;
71
+ };
72
+ content: {
73
+ "application/json": components["schemas"]["PackagesSitemapEntry"][];
74
+ };
75
+ };
76
+ /** @description Missing, wrong-scope or revoked token */
77
+ 401: {
78
+ headers: {
79
+ [name: string]: unknown;
80
+ };
81
+ content?: never;
82
+ };
83
+ };
84
+ };
85
+ put?: never;
86
+ post?: never;
87
+ delete?: never;
88
+ options?: never;
89
+ head?: never;
90
+ patch?: never;
91
+ trace?: never;
92
+ };
93
+ "/pages/{locale}/{path}": {
94
+ parameters: {
95
+ query?: never;
96
+ header?: never;
97
+ path?: never;
98
+ cookie?: never;
99
+ };
100
+ get: {
101
+ parameters: {
102
+ query?: never;
103
+ header?: never;
104
+ path: {
105
+ locale: string;
106
+ path: string;
107
+ };
108
+ cookie?: never;
109
+ };
110
+ requestBody?: never;
111
+ responses: {
112
+ /** @description A published page */
113
+ 200: {
114
+ headers: {
115
+ [name: string]: unknown;
116
+ };
117
+ content: {
118
+ "application/json": components["schemas"]["PackagesPage"];
119
+ };
120
+ };
121
+ /** @description Missing, wrong-scope or revoked token */
122
+ 401: {
123
+ headers: {
124
+ [name: string]: unknown;
125
+ };
126
+ content?: never;
127
+ };
128
+ /** @description No such page, or a draft, or not published yet */
129
+ 404: {
130
+ headers: {
131
+ [name: string]: unknown;
132
+ };
133
+ content?: never;
134
+ };
135
+ };
136
+ };
137
+ put?: never;
138
+ post?: never;
139
+ delete?: never;
140
+ options?: never;
141
+ head?: never;
142
+ patch?: never;
143
+ trace?: never;
144
+ };
145
+ }
146
+ interface components {
147
+ schemas: {
148
+ PackagesWebsite: {
149
+ name: string;
150
+ defaultLocale: string;
151
+ locales: string[];
152
+ badge: boolean;
153
+ };
154
+ PackagesSitemapEntry: {
155
+ locale: string;
156
+ path: string;
157
+ title: string;
158
+ updatedAt: string;
159
+ alternates: string[];
160
+ };
161
+ PackagesPage: {
162
+ locale: string;
163
+ path: string;
164
+ title: string;
165
+ alternates: string[];
166
+ seo: {
167
+ title: string;
168
+ description: string;
169
+ keywords?: string[];
170
+ author?: {
171
+ name: string;
172
+ url?: string;
173
+ };
174
+ schemas?: ({
175
+ /** @enum {string} */
176
+ type: "article";
177
+ } | {
178
+ /** @enum {string} */
179
+ type: "softwareApplication";
180
+ name: string;
181
+ category?: string;
182
+ operatingSystem?: string;
183
+ offers?: {
184
+ price: number;
185
+ currency: string;
186
+ };
187
+ } | {
188
+ /** @enum {string} */
189
+ type: "product";
190
+ name: string;
191
+ image?: string;
192
+ offers?: {
193
+ price: number;
194
+ currency: string;
195
+ };
196
+ } | {
197
+ /** @enum {string} */
198
+ type: "howTo";
199
+ name: string;
200
+ totalTime?: string;
201
+ steps: {
202
+ name: string;
203
+ text: string;
204
+ }[];
205
+ } | {
206
+ /** @enum {string} */
207
+ type: "event";
208
+ name: string;
209
+ startDate: string;
210
+ endDate?: string;
211
+ online?: boolean;
212
+ location?: {
213
+ name: string;
214
+ address?: string;
215
+ };
216
+ offers?: {
217
+ price: number;
218
+ currency: string;
219
+ };
220
+ } | {
221
+ /** @enum {string} */
222
+ type: "localBusiness";
223
+ name: string;
224
+ address?: string;
225
+ telephone?: string;
226
+ openingHours?: string[];
227
+ priceRange?: string;
228
+ image?: string;
229
+ })[];
230
+ };
231
+ blocks: ({
232
+ /** @enum {string} */
233
+ type: "description";
234
+ content: string;
235
+ } | {
236
+ /** @enum {string} */
237
+ type: "heading";
238
+ /** @enum {number} */
239
+ level: 2;
240
+ content: string;
241
+ } | {
242
+ /** @enum {string} */
243
+ type: "text";
244
+ content: string;
245
+ } | {
246
+ /** @enum {string} */
247
+ type: "list";
248
+ ordered: boolean;
249
+ items: string[];
250
+ } | {
251
+ /** @enum {string} */
252
+ type: "faq";
253
+ items: {
254
+ question: string;
255
+ answer: string;
256
+ }[];
257
+ } | {
258
+ /** @enum {string} */
259
+ type: "table";
260
+ headers?: string[];
261
+ rows: string[][];
262
+ } | {
263
+ /** @enum {string} */
264
+ type: "space";
265
+ } | {
266
+ /** @enum {string} */
267
+ type: "related";
268
+ pages: {
269
+ path: string;
270
+ title: string;
271
+ }[];
272
+ })[];
273
+ createdAt: string;
274
+ updatedAt: string;
275
+ };
276
+ };
277
+ responses: never;
278
+ parameters: never;
279
+ requestBodies: never;
280
+ headers: never;
281
+ pathItems: never;
282
+ }
283
+
284
+ type FloconPageData = components["schemas"]["PackagesPage"] & {
285
+ /** Free plan: `<FloconPage />` shows the "Made with Flocon AI" badge. */
286
+ badge?: boolean;
287
+ /** Website default locale. Used for `x-default` in the hreflang links. */
288
+ defaultLocale?: string;
289
+ };
290
+ declare function createFloconClient(): openapi_fetch.Client<paths, `${string}/${string}`>;
291
+ type GetPageOptions = {
292
+ /** Page path, e.g. "/vs/notion". */
293
+ path: string;
294
+ /** Defaults to the website's default locale. No fallback to another locale. */
295
+ locale?: string;
296
+ };
297
+ declare function getPage({ path, locale }: GetPageOptions): Promise<FloconPageData | null>;
298
+
299
+ type PageEntry = components["schemas"]["PackagesSitemapEntry"];
300
+ type UrlOption = {
301
+ url: (entry: {
302
+ locale: string;
303
+ path: string;
304
+ }) => string;
305
+ };
306
+ declare function getAllPages(): Promise<PageEntry[]>;
307
+ declare function floconSitemap({ url }: UrlOption): Promise<string>;
308
+ declare function floconLlmsTxt({ url }: UrlOption): Promise<string>;
309
+
310
+ type Props = {
311
+ /** Page data from `getPage()`. No fetching here. */
312
+ page: FloconPageData;
313
+ /** Builds the href of a related page. Default: the page path as is. */
314
+ url?: (page: {
315
+ locale: string;
316
+ path: string;
317
+ }) => string;
318
+ };
319
+ declare function FloconPage({ page, url }: Props): react.JSX.Element;
320
+
321
+ type Options = UrlOption & {
322
+ page: FloconPageData;
323
+ };
324
+ declare function getFloconMetadata({ page, url }: Options): {
325
+ title: string;
326
+ description: string;
327
+ keywords: string[] | undefined;
328
+ canonical: string;
329
+ /** hreflang: locale (or "x-default") → URL. */
330
+ languages: Record<string, string>;
331
+ openGraph: {
332
+ type: string;
333
+ title: string;
334
+ description: string;
335
+ url: string;
336
+ locale: string;
337
+ };
338
+ twitter: {
339
+ card: string;
340
+ title: string;
341
+ description: string;
342
+ };
343
+ };
344
+
345
+ export { FloconPage, type FloconPageData, type PageEntry, type UrlOption, type components, createFloconClient, floconLlmsTxt, floconSitemap, getAllPages, getFloconMetadata, getPage, type paths };
@@ -0,0 +1,345 @@
1
+ import * as openapi_fetch from 'openapi-fetch';
2
+ import * as react from 'react';
3
+
4
+ /**
5
+ * This file was auto-generated by openapi-typescript.
6
+ * Do not make direct changes to the file.
7
+ */
8
+ interface paths {
9
+ "/website": {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ get: {
17
+ parameters: {
18
+ query?: never;
19
+ header?: never;
20
+ path?: never;
21
+ cookie?: never;
22
+ };
23
+ requestBody?: never;
24
+ responses: {
25
+ /** @description The website of the website token */
26
+ 200: {
27
+ headers: {
28
+ [name: string]: unknown;
29
+ };
30
+ content: {
31
+ "application/json": components["schemas"]["PackagesWebsite"];
32
+ };
33
+ };
34
+ /** @description Missing, wrong-scope or revoked token */
35
+ 401: {
36
+ headers: {
37
+ [name: string]: unknown;
38
+ };
39
+ content?: never;
40
+ };
41
+ };
42
+ };
43
+ put?: never;
44
+ post?: never;
45
+ delete?: never;
46
+ options?: never;
47
+ head?: never;
48
+ patch?: never;
49
+ trace?: never;
50
+ };
51
+ "/pages": {
52
+ parameters: {
53
+ query?: never;
54
+ header?: never;
55
+ path?: never;
56
+ cookie?: never;
57
+ };
58
+ get: {
59
+ parameters: {
60
+ query?: never;
61
+ header?: never;
62
+ path?: never;
63
+ cookie?: never;
64
+ };
65
+ requestBody?: never;
66
+ responses: {
67
+ /** @description All served pages, light. Never drafts or scheduled pages */
68
+ 200: {
69
+ headers: {
70
+ [name: string]: unknown;
71
+ };
72
+ content: {
73
+ "application/json": components["schemas"]["PackagesSitemapEntry"][];
74
+ };
75
+ };
76
+ /** @description Missing, wrong-scope or revoked token */
77
+ 401: {
78
+ headers: {
79
+ [name: string]: unknown;
80
+ };
81
+ content?: never;
82
+ };
83
+ };
84
+ };
85
+ put?: never;
86
+ post?: never;
87
+ delete?: never;
88
+ options?: never;
89
+ head?: never;
90
+ patch?: never;
91
+ trace?: never;
92
+ };
93
+ "/pages/{locale}/{path}": {
94
+ parameters: {
95
+ query?: never;
96
+ header?: never;
97
+ path?: never;
98
+ cookie?: never;
99
+ };
100
+ get: {
101
+ parameters: {
102
+ query?: never;
103
+ header?: never;
104
+ path: {
105
+ locale: string;
106
+ path: string;
107
+ };
108
+ cookie?: never;
109
+ };
110
+ requestBody?: never;
111
+ responses: {
112
+ /** @description A published page */
113
+ 200: {
114
+ headers: {
115
+ [name: string]: unknown;
116
+ };
117
+ content: {
118
+ "application/json": components["schemas"]["PackagesPage"];
119
+ };
120
+ };
121
+ /** @description Missing, wrong-scope or revoked token */
122
+ 401: {
123
+ headers: {
124
+ [name: string]: unknown;
125
+ };
126
+ content?: never;
127
+ };
128
+ /** @description No such page, or a draft, or not published yet */
129
+ 404: {
130
+ headers: {
131
+ [name: string]: unknown;
132
+ };
133
+ content?: never;
134
+ };
135
+ };
136
+ };
137
+ put?: never;
138
+ post?: never;
139
+ delete?: never;
140
+ options?: never;
141
+ head?: never;
142
+ patch?: never;
143
+ trace?: never;
144
+ };
145
+ }
146
+ interface components {
147
+ schemas: {
148
+ PackagesWebsite: {
149
+ name: string;
150
+ defaultLocale: string;
151
+ locales: string[];
152
+ badge: boolean;
153
+ };
154
+ PackagesSitemapEntry: {
155
+ locale: string;
156
+ path: string;
157
+ title: string;
158
+ updatedAt: string;
159
+ alternates: string[];
160
+ };
161
+ PackagesPage: {
162
+ locale: string;
163
+ path: string;
164
+ title: string;
165
+ alternates: string[];
166
+ seo: {
167
+ title: string;
168
+ description: string;
169
+ keywords?: string[];
170
+ author?: {
171
+ name: string;
172
+ url?: string;
173
+ };
174
+ schemas?: ({
175
+ /** @enum {string} */
176
+ type: "article";
177
+ } | {
178
+ /** @enum {string} */
179
+ type: "softwareApplication";
180
+ name: string;
181
+ category?: string;
182
+ operatingSystem?: string;
183
+ offers?: {
184
+ price: number;
185
+ currency: string;
186
+ };
187
+ } | {
188
+ /** @enum {string} */
189
+ type: "product";
190
+ name: string;
191
+ image?: string;
192
+ offers?: {
193
+ price: number;
194
+ currency: string;
195
+ };
196
+ } | {
197
+ /** @enum {string} */
198
+ type: "howTo";
199
+ name: string;
200
+ totalTime?: string;
201
+ steps: {
202
+ name: string;
203
+ text: string;
204
+ }[];
205
+ } | {
206
+ /** @enum {string} */
207
+ type: "event";
208
+ name: string;
209
+ startDate: string;
210
+ endDate?: string;
211
+ online?: boolean;
212
+ location?: {
213
+ name: string;
214
+ address?: string;
215
+ };
216
+ offers?: {
217
+ price: number;
218
+ currency: string;
219
+ };
220
+ } | {
221
+ /** @enum {string} */
222
+ type: "localBusiness";
223
+ name: string;
224
+ address?: string;
225
+ telephone?: string;
226
+ openingHours?: string[];
227
+ priceRange?: string;
228
+ image?: string;
229
+ })[];
230
+ };
231
+ blocks: ({
232
+ /** @enum {string} */
233
+ type: "description";
234
+ content: string;
235
+ } | {
236
+ /** @enum {string} */
237
+ type: "heading";
238
+ /** @enum {number} */
239
+ level: 2;
240
+ content: string;
241
+ } | {
242
+ /** @enum {string} */
243
+ type: "text";
244
+ content: string;
245
+ } | {
246
+ /** @enum {string} */
247
+ type: "list";
248
+ ordered: boolean;
249
+ items: string[];
250
+ } | {
251
+ /** @enum {string} */
252
+ type: "faq";
253
+ items: {
254
+ question: string;
255
+ answer: string;
256
+ }[];
257
+ } | {
258
+ /** @enum {string} */
259
+ type: "table";
260
+ headers?: string[];
261
+ rows: string[][];
262
+ } | {
263
+ /** @enum {string} */
264
+ type: "space";
265
+ } | {
266
+ /** @enum {string} */
267
+ type: "related";
268
+ pages: {
269
+ path: string;
270
+ title: string;
271
+ }[];
272
+ })[];
273
+ createdAt: string;
274
+ updatedAt: string;
275
+ };
276
+ };
277
+ responses: never;
278
+ parameters: never;
279
+ requestBodies: never;
280
+ headers: never;
281
+ pathItems: never;
282
+ }
283
+
284
+ type FloconPageData = components["schemas"]["PackagesPage"] & {
285
+ /** Free plan: `<FloconPage />` shows the "Made with Flocon AI" badge. */
286
+ badge?: boolean;
287
+ /** Website default locale. Used for `x-default` in the hreflang links. */
288
+ defaultLocale?: string;
289
+ };
290
+ declare function createFloconClient(): openapi_fetch.Client<paths, `${string}/${string}`>;
291
+ type GetPageOptions = {
292
+ /** Page path, e.g. "/vs/notion". */
293
+ path: string;
294
+ /** Defaults to the website's default locale. No fallback to another locale. */
295
+ locale?: string;
296
+ };
297
+ declare function getPage({ path, locale }: GetPageOptions): Promise<FloconPageData | null>;
298
+
299
+ type PageEntry = components["schemas"]["PackagesSitemapEntry"];
300
+ type UrlOption = {
301
+ url: (entry: {
302
+ locale: string;
303
+ path: string;
304
+ }) => string;
305
+ };
306
+ declare function getAllPages(): Promise<PageEntry[]>;
307
+ declare function floconSitemap({ url }: UrlOption): Promise<string>;
308
+ declare function floconLlmsTxt({ url }: UrlOption): Promise<string>;
309
+
310
+ type Props = {
311
+ /** Page data from `getPage()`. No fetching here. */
312
+ page: FloconPageData;
313
+ /** Builds the href of a related page. Default: the page path as is. */
314
+ url?: (page: {
315
+ locale: string;
316
+ path: string;
317
+ }) => string;
318
+ };
319
+ declare function FloconPage({ page, url }: Props): react.JSX.Element;
320
+
321
+ type Options = UrlOption & {
322
+ page: FloconPageData;
323
+ };
324
+ declare function getFloconMetadata({ page, url }: Options): {
325
+ title: string;
326
+ description: string;
327
+ keywords: string[] | undefined;
328
+ canonical: string;
329
+ /** hreflang: locale (or "x-default") → URL. */
330
+ languages: Record<string, string>;
331
+ openGraph: {
332
+ type: string;
333
+ title: string;
334
+ description: string;
335
+ url: string;
336
+ locale: string;
337
+ };
338
+ twitter: {
339
+ card: string;
340
+ title: string;
341
+ description: string;
342
+ };
343
+ };
344
+
345
+ export { FloconPage, type FloconPageData, type PageEntry, type UrlOption, type components, createFloconClient, floconLlmsTxt, floconSitemap, getAllPages, getFloconMetadata, getPage, type paths };