@kurbo/dkit 0.4.0 → 0.5.1
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/README.md +4 -0
- package/dist/bin.js +385 -139
- package/dist/bin.js.map +1 -1
- package/package.json +4 -1
- package/vendor/registry/blocks/blog-detail/ui/minimal/next/blog-detail.tsx +0 -1
- package/vendor/registry/blocks/blog-detail/ui/shadcn/next/blog-detail.tsx +0 -1
- package/vendor/registry/blocks/blog-list/ui/minimal/next/blog-list.tsx +0 -1
- package/vendor/registry/blocks/blog-list/ui/shadcn/next/blog-list.tsx +0 -1
- package/vendor/registry/blocks/blog-list-cards/ui/minimal/next/blog-list-cards.tsx +0 -1
- package/vendor/registry/blocks/blog-list-cards/ui/shadcn/next/blog-list-cards.tsx +0 -1
- package/vendor/registry/blocks/booking-form-ui/ui/minimal/next/booking-form.tsx +0 -1
- package/vendor/registry/blocks/booking-form-ui/ui/shadcn/next/booking-form.tsx +0 -1
- package/vendor/registry/blocks/contact-form-ui/ui/minimal/next/contact-form.tsx +0 -1
- package/vendor/registry/blocks/contact-form-ui/ui/shadcn/next/contact-form.tsx +0 -1
- package/vendor/registry/blocks/faq-list/ui/minimal/next/faq-list.tsx +0 -1
- package/vendor/registry/blocks/faq-list/ui/shadcn/next/faq-list.tsx +0 -1
- package/vendor/registry/blocks/page-detail/ui/minimal/next/page-detail.tsx +0 -1
- package/vendor/registry/blocks/page-detail/ui/shadcn/next/page-detail.tsx +0 -1
- package/vendor/registry/blocks/project-detail/ui/minimal/next/project-detail.tsx +0 -1
- package/vendor/registry/blocks/project-detail/ui/shadcn/next/project-detail.tsx +0 -1
- package/vendor/registry/blocks/project-list/ui/minimal/next/project-list.tsx +0 -1
- package/vendor/registry/blocks/project-list/ui/shadcn/next/project-list.tsx +0 -1
- package/vendor/registry/blocks/project-list-cards/ui/minimal/next/project-list-cards.tsx +0 -1
- package/vendor/registry/blocks/project-list-cards/ui/shadcn/next/project-list-cards.tsx +0 -1
- package/vendor/registry/blocks/projects-carousel/ui/minimal/next/projects-carousel-client.tsx +0 -4
- package/vendor/registry/blocks/projects-carousel/ui/minimal/next/projects-carousel.tsx +0 -1
- package/vendor/registry/blocks/projects-carousel/ui/shadcn/next/projects-carousel-client.tsx +0 -1
- package/vendor/registry/blocks/projects-carousel/ui/shadcn/next/projects-carousel.tsx +0 -1
- package/vendor/registry/blocks/service-detail/ui/minimal/next/service-detail.tsx +0 -1
- package/vendor/registry/blocks/service-detail/ui/shadcn/next/service-detail.tsx +0 -1
- package/vendor/registry/blocks/service-list/ui/minimal/next/service-list.tsx +0 -1
- package/vendor/registry/blocks/service-list/ui/shadcn/next/service-list.tsx +0 -1
- package/vendor/registry/blocks/service-list-cards/ui/minimal/next/service-list-cards.tsx +0 -1
- package/vendor/registry/blocks/service-list-cards/ui/shadcn/next/service-list-cards.tsx +0 -1
- package/vendor/registry/blocks/social-links/ui/minimal/next/social-links.tsx +0 -1
- package/vendor/registry/blocks/social-links/ui/shadcn/next/social-links.tsx +0 -1
- package/vendor/registry/blocks/team-detail/ui/minimal/next/team-detail.tsx +0 -1
- package/vendor/registry/blocks/team-detail/ui/shadcn/next/team-detail.tsx +0 -1
- package/vendor/registry/blocks/team-list/ui/minimal/next/team-list.tsx +0 -1
- package/vendor/registry/blocks/team-list/ui/shadcn/next/team-list.tsx +0 -1
- package/vendor/registry/blocks/team-list-cards/ui/minimal/next/team-list-cards.tsx +0 -1
- package/vendor/registry/blocks/team-list-cards/ui/shadcn/next/team-list-cards.tsx +0 -1
- package/vendor/registry/blocks/testimonials-carousel/ui/minimal/next/testimonials-carousel-client.tsx +0 -4
- package/vendor/registry/blocks/testimonials-carousel/ui/minimal/next/testimonials-carousel.tsx +0 -1
- package/vendor/registry/blocks/testimonials-carousel/ui/shadcn/next/testimonials-carousel-client.tsx +0 -1
- package/vendor/registry/blocks/testimonials-carousel/ui/shadcn/next/testimonials-carousel.tsx +0 -1
- package/vendor/registry/blocks/testimonials-list/ui/minimal/next/testimonials-list.tsx +0 -1
- package/vendor/registry/blocks/testimonials-list/ui/shadcn/next/testimonials-list.tsx +0 -1
- package/vendor/registry/blocks/testimonials-list-cards/ui/minimal/next/testimonials-list-cards.tsx +0 -1
- package/vendor/registry/blocks/testimonials-list-cards/ui/shadcn/next/testimonials-list-cards.tsx +0 -1
- package/vendor/registry/modules/blog/lib.multilocale.ts +124 -129
- package/vendor/registry/modules/blog/lib.ts +12 -9
- package/vendor/registry/modules/blog/services/seed.json +1 -1
- package/vendor/registry/modules/blog/services/seed.multilocale.json +1 -1
- package/vendor/registry/modules/blog/types.multilocale.ts +41 -12
- package/vendor/registry/modules/blog/types.ts +8 -6
- package/vendor/registry/modules/faq/lib.multilocale.ts +30 -30
- package/vendor/registry/modules/faq/lib.ts +4 -5
- package/vendor/registry/modules/faq/types.multilocale.ts +13 -2
- package/vendor/registry/modules/faq/types.ts +4 -2
- package/vendor/registry/modules/navigation/lib.multilocale.ts +207 -76
- package/vendor/registry/modules/navigation/lib.ts +18 -17
- package/vendor/registry/modules/navigation/types.multilocale.ts +24 -4
- package/vendor/registry/modules/navigation/types.ts +6 -4
- package/vendor/registry/modules/pages/lib.multilocale.ts +34 -39
- package/vendor/registry/modules/pages/lib.ts +4 -3
- package/vendor/registry/modules/pages/types.multilocale.ts +14 -3
- package/vendor/registry/modules/pages/types.ts +5 -3
- package/vendor/registry/modules/projects/lib.multilocale.ts +149 -65
- package/vendor/registry/modules/projects/lib.ts +6 -6
- package/vendor/registry/modules/projects/services/seed.json +2 -2
- package/vendor/registry/modules/projects/services/seed.multilocale.json +2 -2
- package/vendor/registry/modules/projects/types.multilocale.ts +15 -3
- package/vendor/registry/modules/projects/types.ts +5 -3
- package/vendor/registry/modules/services/lib.multilocale.ts +143 -63
- package/vendor/registry/modules/services/lib.ts +6 -6
- package/vendor/registry/modules/services/services/seed.json +4 -4
- package/vendor/registry/modules/services/services/seed.multilocale.json +2 -2
- package/vendor/registry/modules/services/types.multilocale.ts +13 -3
- package/vendor/registry/modules/services/types.ts +5 -3
- package/vendor/registry/modules/settings/lib.multilocale.ts +159 -57
- package/vendor/registry/modules/settings/types.multilocale.ts +15 -0
- package/vendor/registry/modules/settings/types.ts +2 -2
- package/vendor/registry/modules/team/lib.multilocale.ts +116 -49
- package/vendor/registry/modules/team/lib.ts +4 -3
- package/vendor/registry/modules/team/services/seed.json +4 -4
- package/vendor/registry/modules/team/services/seed.multilocale.json +2 -2
- package/vendor/registry/modules/team/types.multilocale.ts +16 -3
- package/vendor/registry/modules/team/types.ts +5 -3
- package/vendor/registry/modules/testimonials/lib.multilocale.ts +82 -50
- package/vendor/registry/modules/testimonials/services/seed.json +4 -4
- package/vendor/registry/modules/testimonials/services/seed.multilocale.json +2 -2
- package/vendor/registry/modules/testimonials/types.multilocale.ts +14 -2
- package/vendor/registry/modules/testimonials/types.ts +4 -2
- package/vendor/registry/shared/helpers.ts +9 -3
- package/vendor/registry/shared/i18n.ts +84 -12
- package/vendor/registry/shared/prose.css +1 -1
|
@@ -3,74 +3,140 @@ import {
|
|
|
3
3
|
directusFileId,
|
|
4
4
|
dkitQueryFailed,
|
|
5
5
|
getDirectus,
|
|
6
|
-
readItem,
|
|
7
6
|
readItems,
|
|
8
7
|
} from "@/lib/dkit/client";
|
|
9
8
|
import { collections } from "@/lib/dkit/config";
|
|
10
9
|
import { queryLimit, statusFilter } from "@/lib/dkit/helpers";
|
|
11
10
|
import {
|
|
12
|
-
isUsableTranslation,
|
|
13
|
-
pickTranslation,
|
|
14
11
|
requireLocaleTranslation,
|
|
15
12
|
resolveLocale,
|
|
16
13
|
translationsDeepFilter,
|
|
14
|
+
withLocale,
|
|
17
15
|
} from "@/lib/dkit/i18n";
|
|
18
|
-
import type {
|
|
16
|
+
import type {
|
|
17
|
+
DirectusFileRef,
|
|
18
|
+
GetServiceBySlugOptions,
|
|
19
|
+
GetServicesOptions,
|
|
20
|
+
Service,
|
|
21
|
+
ServiceRow,
|
|
22
|
+
} from "./types.multilocale";
|
|
19
23
|
|
|
20
|
-
export type {
|
|
24
|
+
export type {
|
|
25
|
+
DirectusFileRef,
|
|
26
|
+
GetServiceBySlugOptions,
|
|
27
|
+
GetServicesOptions,
|
|
28
|
+
Service,
|
|
29
|
+
ServiceRow,
|
|
30
|
+
ServiceTranslation,
|
|
31
|
+
} from "./types.multilocale";
|
|
21
32
|
|
|
22
|
-
function flattenService(row:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
function flattenService(row: ServiceRow, locale: string): Service | null {
|
|
34
|
+
return withLocale(
|
|
35
|
+
row,
|
|
36
|
+
locale,
|
|
37
|
+
(r, t) => ({
|
|
38
|
+
id: r.id,
|
|
39
|
+
status: r.status,
|
|
40
|
+
title: t.title,
|
|
41
|
+
slug: t.slug,
|
|
42
|
+
summary: t.summary ?? null,
|
|
43
|
+
body: t.body ?? null,
|
|
44
|
+
image: r.image,
|
|
45
|
+
price_label: t.price_label ?? null,
|
|
46
|
+
sort: r.sort ?? null,
|
|
47
|
+
}),
|
|
48
|
+
{ required: ["title", "slug"] },
|
|
49
|
+
);
|
|
37
50
|
}
|
|
38
51
|
|
|
39
|
-
const SERVICE_LIST_FIELDS = [
|
|
40
|
-
|
|
52
|
+
const SERVICE_LIST_FIELDS = [
|
|
53
|
+
"id",
|
|
54
|
+
"status",
|
|
55
|
+
"image",
|
|
56
|
+
"sort",
|
|
57
|
+
{
|
|
58
|
+
translations: [
|
|
59
|
+
"id",
|
|
60
|
+
"languages_code",
|
|
61
|
+
"title",
|
|
62
|
+
"slug",
|
|
63
|
+
"price_label",
|
|
64
|
+
"summary",
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
] as const;
|
|
68
|
+
const SERVICE_DETAIL_FIELDS = [
|
|
69
|
+
"id",
|
|
70
|
+
"status",
|
|
71
|
+
"image",
|
|
72
|
+
"sort",
|
|
73
|
+
{
|
|
74
|
+
translations: [
|
|
75
|
+
"id",
|
|
76
|
+
"languages_code",
|
|
77
|
+
"title",
|
|
78
|
+
"slug",
|
|
79
|
+
"price_label",
|
|
80
|
+
"summary",
|
|
81
|
+
"body",
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
] as const;
|
|
41
85
|
|
|
42
86
|
export function serviceImageUrl(service: Service): string | null {
|
|
43
|
-
const id = directusFileId(
|
|
87
|
+
const id = directusFileId(
|
|
88
|
+
service.image as string | DirectusFileRef | null | undefined,
|
|
89
|
+
);
|
|
44
90
|
return id ? directusAssetUrl(id) : null;
|
|
45
91
|
}
|
|
46
92
|
|
|
47
|
-
export async function getServices(
|
|
48
|
-
|
|
49
|
-
|
|
93
|
+
export async function getServices(
|
|
94
|
+
options: GetServicesOptions = {},
|
|
95
|
+
): Promise<Service[]> {
|
|
96
|
+
const client = getDirectus();
|
|
97
|
+
if (!client) return [];
|
|
98
|
+
if (!collections.services) {
|
|
99
|
+
dkitQueryFailed("collections.services missing — re-run `dkit add services`");
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
50
102
|
const locale = await resolveLocale(options.locale);
|
|
51
103
|
const status = statusFilter(options.status);
|
|
52
|
-
const
|
|
53
|
-
|
|
104
|
+
const filter = status
|
|
105
|
+
? { _and: [status, requireLocaleTranslation(locale)] }
|
|
106
|
+
: requireLocaleTranslation(locale);
|
|
54
107
|
const limit = queryLimit(options.limit);
|
|
55
108
|
try {
|
|
56
|
-
const rows = await client.request(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
109
|
+
const rows = await client.request(
|
|
110
|
+
readItems(collections.services, {
|
|
111
|
+
filter,
|
|
112
|
+
deep: translationsDeepFilter(locale),
|
|
113
|
+
fields: [...SERVICE_LIST_FIELDS],
|
|
114
|
+
sort: options.sort ?? ["sort"],
|
|
115
|
+
...(limit !== undefined ? { limit } : {}),
|
|
116
|
+
}),
|
|
117
|
+
);
|
|
118
|
+
return (rows as ServiceRow[])
|
|
63
119
|
.map((r) => flattenService(r, locale))
|
|
64
120
|
.filter((s): s is Service => s != null);
|
|
65
|
-
} catch (err) {
|
|
121
|
+
} catch (err) {
|
|
122
|
+
dkitQueryFailed(`getServices failed`, err);
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
66
125
|
}
|
|
67
126
|
|
|
68
|
-
export async function getServiceBySlug(
|
|
69
|
-
|
|
70
|
-
|
|
127
|
+
export async function getServiceBySlug(
|
|
128
|
+
slug: string,
|
|
129
|
+
options: GetServiceBySlugOptions = {},
|
|
130
|
+
): Promise<Service | null> {
|
|
131
|
+
const client = getDirectus();
|
|
132
|
+
if (!client) return null;
|
|
133
|
+
if (!collections.services) {
|
|
134
|
+
dkitQueryFailed("collections.services missing");
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
71
137
|
const locale = await resolveLocale(options.locale);
|
|
72
138
|
const status = statusFilter(options.status);
|
|
73
|
-
const
|
|
139
|
+
const bySlug = {
|
|
74
140
|
translations: {
|
|
75
141
|
_and: [
|
|
76
142
|
{ languages_code: { _eq: locale } },
|
|
@@ -78,32 +144,46 @@ export async function getServiceBySlug(slug: string, options: GetServiceBySlugOp
|
|
|
78
144
|
{ title: { _nempty: true } },
|
|
79
145
|
],
|
|
80
146
|
},
|
|
81
|
-
}
|
|
82
|
-
|
|
147
|
+
};
|
|
148
|
+
const filter = status ? { _and: [status, bySlug] } : bySlug;
|
|
83
149
|
try {
|
|
84
|
-
const rows = await client.request(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
150
|
+
const rows = await client.request(
|
|
151
|
+
readItems(collections.services, {
|
|
152
|
+
filter,
|
|
153
|
+
deep: translationsDeepFilter(locale),
|
|
154
|
+
fields: [...SERVICE_DETAIL_FIELDS],
|
|
155
|
+
limit: 1,
|
|
156
|
+
}),
|
|
157
|
+
);
|
|
158
|
+
const row = (rows as ServiceRow[])[0];
|
|
159
|
+
return row ? flattenService(row, locale) : null;
|
|
160
|
+
} catch (err) {
|
|
161
|
+
dkitQueryFailed(`getServiceBySlug(${slug}) failed`, err);
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
92
164
|
}
|
|
93
165
|
|
|
94
|
-
export async function getServiceById(
|
|
95
|
-
|
|
166
|
+
export async function getServiceById(
|
|
167
|
+
id: string,
|
|
168
|
+
options: GetServiceBySlugOptions = {},
|
|
169
|
+
): Promise<Service | null> {
|
|
170
|
+
const client = getDirectus();
|
|
171
|
+
if (!client) return null;
|
|
172
|
+
if (!collections.services) return null;
|
|
96
173
|
const locale = await resolveLocale(options.locale);
|
|
97
174
|
try {
|
|
98
|
-
const rows = await client.request(
|
|
99
|
-
|
|
100
|
-
_and: [{ id: { _eq: id } }, requireLocaleTranslation(locale)],
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const row = (rows as
|
|
107
|
-
return row ? flattenService(row
|
|
108
|
-
} catch (err) {
|
|
175
|
+
const rows = await client.request(
|
|
176
|
+
readItems(collections.services, {
|
|
177
|
+
filter: { _and: [{ id: { _eq: id } }, requireLocaleTranslation(locale)] },
|
|
178
|
+
deep: translationsDeepFilter(locale),
|
|
179
|
+
fields: [...SERVICE_DETAIL_FIELDS],
|
|
180
|
+
limit: 1,
|
|
181
|
+
}),
|
|
182
|
+
);
|
|
183
|
+
const row = (rows as ServiceRow[])[0];
|
|
184
|
+
return row ? flattenService(row, locale) : null;
|
|
185
|
+
} catch (err) {
|
|
186
|
+
dkitQueryFailed(`getServiceById(${id}) failed`, err);
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
109
189
|
}
|
|
@@ -65,13 +65,12 @@ export async function getServices(
|
|
|
65
65
|
return [];
|
|
66
66
|
}
|
|
67
67
|
const status = statusFilter(options.status);
|
|
68
|
-
const
|
|
69
|
-
if (status) and.push(status);
|
|
68
|
+
const filter = status;
|
|
70
69
|
const limit = queryLimit(options.limit);
|
|
71
70
|
try {
|
|
72
71
|
return await client.request(
|
|
73
72
|
readItems(collections.services, {
|
|
74
|
-
filter
|
|
73
|
+
filter,
|
|
75
74
|
fields: [...SERVICE_LIST_FIELDS],
|
|
76
75
|
sort: options.sort ?? ["sort", "title"],
|
|
77
76
|
...(limit !== undefined ? { limit } : {}),
|
|
@@ -97,12 +96,13 @@ export async function getServiceBySlug(
|
|
|
97
96
|
return null;
|
|
98
97
|
}
|
|
99
98
|
const status = statusFilter(options.status);
|
|
100
|
-
const
|
|
101
|
-
|
|
99
|
+
const filter = status
|
|
100
|
+
? { _and: [status, { slug: { _eq: slug } }] }
|
|
101
|
+
: { slug: { _eq: slug } };
|
|
102
102
|
try {
|
|
103
103
|
const rows = await client.request(
|
|
104
104
|
readItems(collections.services, {
|
|
105
|
-
filter
|
|
105
|
+
filter,
|
|
106
106
|
fields: [...SERVICE_DETAIL_FIELDS],
|
|
107
107
|
limit: 1,
|
|
108
108
|
}),
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
|
-
"id": "
|
|
4
|
+
"id": "d1000000-0000-4000-8000-000000000001",
|
|
5
5
|
"filename_download": "strategy-consulting.jpg",
|
|
6
6
|
"title": "Sample image — strategy & consulting (Unsplash)",
|
|
7
7
|
"type": "image/jpeg",
|
|
8
8
|
"path": "assets/strategy-consulting.jpg"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"id": "
|
|
11
|
+
"id": "d1000000-0000-4000-8000-000000000002",
|
|
12
12
|
"filename_download": "design-development.jpg",
|
|
13
13
|
"title": "Sample image — design & development (Unsplash)",
|
|
14
14
|
"type": "image/jpeg",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"slug": "sample-strategy-consulting",
|
|
25
25
|
"summary": "Sample service — discovery workshops, roadmapping, and technical advisory for digital products.",
|
|
26
26
|
"price_label": "From €2,500",
|
|
27
|
-
"image": "
|
|
27
|
+
"image": "d1000000-0000-4000-8000-000000000001",
|
|
28
28
|
"sort": 1,
|
|
29
29
|
"body": "<p>This is <strong>sample seed data</strong> from the services module. Replace or delete it once your own offerings are ready.</p><h2>What to verify</h2><p>Use this service to confirm the public API, image field, price label, and rich-text rendering in your app.</p><blockquote><p>Sample HTML includes headings, quotes, and lists so you can judge layout and <code>.dkit-prose</code> immediately after install.</p></blockquote><h3>Includes</h3><ul><li>Stakeholder interviews</li><li>Competitive analysis</li><li>Technical architecture review</li><li>Prioritised roadmap deliverable</li></ul><h3>Next steps</h3><ol><li>Open this item in Directus to edit fields</li><li>Confirm list and detail views render correctly</li><li>Replace every sample field before going to production</li></ol><p>Safe to delete after verifying the install.</p>"
|
|
30
30
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"slug": "sample-design-development",
|
|
36
36
|
"summary": "Sample service — end-to-end UI/UX design and full-stack implementation for web applications.",
|
|
37
37
|
"price_label": "Custom quote",
|
|
38
|
-
"image": "
|
|
38
|
+
"image": "d1000000-0000-4000-8000-000000000002",
|
|
39
39
|
"sort": 2,
|
|
40
40
|
"body": "<p>A second sample service lets you test sorting, card layouts, and the <code>price_label</code> display.</p><h2>Fields to check</h2><p><code>status</code> gates public reads. <code>price_label</code> is an optional short string shown in the list and detail views — leave it empty when pricing is not public.</p><h3>Deliverables</h3><ul><li>Wireframes and interactive prototypes</li><li>Visual design and design system</li><li>Front-end and back-end implementation</li><li>Deployment and handover documentation</li></ul><blockquote><p>After install, open this service in your app and confirm list + detail layouts look right before you replace the sample content.</p></blockquote><p>Safe to delete once you have verified the install.</p>"
|
|
41
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
|
-
"id": "
|
|
4
|
+
"id": "d1000000-0000-4000-8000-000000000001",
|
|
5
5
|
"filename_download": "strategy-consulting.jpg",
|
|
6
6
|
"title": "Sample image — strategy & consulting (Unsplash)",
|
|
7
7
|
"type": "image/jpeg",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"id": "c3c3c3c3-c3c3-4c3c-8c3c-c3c3c3c3c3c3",
|
|
15
15
|
"status": "published",
|
|
16
16
|
"sort": 1,
|
|
17
|
-
"image": "
|
|
17
|
+
"image": "d1000000-0000-4000-8000-000000000001",
|
|
18
18
|
"translations": [
|
|
19
19
|
{
|
|
20
20
|
"languages_code": "en-US",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
type DkitSortField<T extends string> = T | `-${T}`;
|
|
2
|
+
|
|
1
3
|
export type DirectusFileRef = { id: string };
|
|
2
4
|
|
|
3
5
|
export type ServiceTranslation = {
|
|
@@ -11,6 +13,14 @@ export type ServiceTranslation = {
|
|
|
11
13
|
body?: string | null;
|
|
12
14
|
};
|
|
13
15
|
|
|
16
|
+
export type ServiceRow = {
|
|
17
|
+
id: string;
|
|
18
|
+
status: "published" | "draft" | "archived";
|
|
19
|
+
image?: string | DirectusFileRef | null;
|
|
20
|
+
sort?: number | null;
|
|
21
|
+
translations?: ServiceTranslation[] | null;
|
|
22
|
+
};
|
|
23
|
+
|
|
14
24
|
export type Service = {
|
|
15
25
|
id: string;
|
|
16
26
|
status: "published" | "draft" | "archived";
|
|
@@ -24,13 +34,13 @@ export type Service = {
|
|
|
24
34
|
};
|
|
25
35
|
|
|
26
36
|
export type GetServicesOptions = {
|
|
27
|
-
status?:
|
|
37
|
+
status?: Service["status"] | null;
|
|
28
38
|
limit?: number;
|
|
29
|
-
sort?:
|
|
39
|
+
sort?: Array<DkitSortField<"sort" | "id" | "status">>;
|
|
30
40
|
locale?: string;
|
|
31
41
|
};
|
|
32
42
|
|
|
33
43
|
export type GetServiceBySlugOptions = {
|
|
34
|
-
status?:
|
|
44
|
+
status?: Service["status"] | null;
|
|
35
45
|
locale?: string;
|
|
36
46
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
type DkitSortField<T extends string> = T | `-${T}`;
|
|
2
|
+
|
|
1
3
|
export type DirectusFileRef = {
|
|
2
4
|
id: string;
|
|
3
5
|
};
|
|
@@ -16,11 +18,11 @@ export type Service = {
|
|
|
16
18
|
|
|
17
19
|
export type GetServicesOptions = {
|
|
18
20
|
/** Directus status filter. Default `"published"`. Pass `null` to skip. */
|
|
19
|
-
status?:
|
|
21
|
+
status?: Service["status"] | null;
|
|
20
22
|
limit?: number;
|
|
21
|
-
sort?:
|
|
23
|
+
sort?: Array<DkitSortField<"sort" | "id" | "status">>;
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
export type GetServiceBySlugOptions = {
|
|
25
|
-
status?:
|
|
27
|
+
status?: Service["status"] | null;
|
|
26
28
|
};
|