@prosewire/sdk 0.2.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 +10 -0
- package/LICENSE +202 -0
- package/README.md +44 -0
- package/dist/index.d.mts +656 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +315 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +77 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { HttpApi, HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
+
//#region ../contract/src/router.d.ts
|
|
4
|
+
declare const ApiInputRejected_base: Schema.Class<ApiInputRejected, Schema.TaggedStruct<"ApiInputRejected", {
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
declare class ApiInputRejected extends ApiInputRejected_base {}
|
|
8
|
+
declare const ApiAuthenticationFailed_base: Schema.Class<ApiAuthenticationFailed, Schema.TaggedStruct<"ApiAuthenticationFailed", {
|
|
9
|
+
readonly message: Schema.String;
|
|
10
|
+
}>, import("effect/Cause").YieldableError>;
|
|
11
|
+
declare class ApiAuthenticationFailed extends ApiAuthenticationFailed_base {}
|
|
12
|
+
declare const ApiAccessDenied_base: Schema.Class<ApiAccessDenied, Schema.TaggedStruct<"ApiAccessDenied", {
|
|
13
|
+
readonly message: Schema.String;
|
|
14
|
+
}>, import("effect/Cause").YieldableError>;
|
|
15
|
+
declare class ApiAccessDenied extends ApiAccessDenied_base {}
|
|
16
|
+
declare const ApiPostNotFound_base: Schema.Class<ApiPostNotFound, Schema.TaggedStruct<"ApiPostNotFound", {
|
|
17
|
+
readonly message: Schema.String;
|
|
18
|
+
}>, import("effect/Cause").YieldableError>;
|
|
19
|
+
declare class ApiPostNotFound extends ApiPostNotFound_base {}
|
|
20
|
+
declare const ApiUnavailable_base: Schema.Class<ApiUnavailable, Schema.TaggedStruct<"ApiUnavailable", {
|
|
21
|
+
readonly message: Schema.String;
|
|
22
|
+
}>, import("effect/Cause").YieldableError>;
|
|
23
|
+
declare class ApiUnavailable extends ApiUnavailable_base {}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../contract/src/schemas.d.ts
|
|
26
|
+
declare const postStatus: Schema.Literals<readonly ["draft", "scheduled", "published", "archived"]>;
|
|
27
|
+
declare const authorOutput: Schema.Struct<{
|
|
28
|
+
readonly id: Schema.String;
|
|
29
|
+
readonly name: Schema.String;
|
|
30
|
+
readonly slug: Schema.String;
|
|
31
|
+
readonly bio: Schema.NullOr<Schema.String>;
|
|
32
|
+
readonly avatarUrl: Schema.NullOr<Schema.String>;
|
|
33
|
+
readonly jobTitle: Schema.NullOr<Schema.String>;
|
|
34
|
+
readonly credentials: Schema.NullOr<Schema.String>;
|
|
35
|
+
}>;
|
|
36
|
+
declare const categoryOutput: Schema.Struct<{
|
|
37
|
+
readonly id: Schema.String;
|
|
38
|
+
readonly name: Schema.String;
|
|
39
|
+
readonly slug: Schema.String;
|
|
40
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
41
|
+
}>;
|
|
42
|
+
declare const postCreateInput: Schema.Struct<{
|
|
43
|
+
readonly blogId: Schema.String;
|
|
44
|
+
readonly authorId: Schema.String;
|
|
45
|
+
readonly title: Schema.Trim;
|
|
46
|
+
readonly slug: Schema.Trim;
|
|
47
|
+
readonly excerpt: Schema.optionalKey<Schema.String>;
|
|
48
|
+
readonly contentMarkdown: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
49
|
+
readonly coverImageUrl: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
50
|
+
readonly coverImageAlt: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
51
|
+
readonly status: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["draft", "scheduled", "published", "archived"]>, never>;
|
|
52
|
+
readonly locale: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
53
|
+
readonly featured: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
54
|
+
readonly seoTitle: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
55
|
+
readonly seoDescription: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
56
|
+
readonly focusKeyword: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
57
|
+
readonly canonicalUrl: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
58
|
+
readonly scheduledAt: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
59
|
+
readonly categoryIds: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
60
|
+
}>;
|
|
61
|
+
declare const postUpdateInput: Schema.Struct<{
|
|
62
|
+
readonly authorId: Schema.optionalKey<Schema.String>;
|
|
63
|
+
readonly title: Schema.optionalKey<Schema.Trim>;
|
|
64
|
+
readonly slug: Schema.optionalKey<Schema.Trim>;
|
|
65
|
+
readonly excerpt: Schema.optionalKey<Schema.String>;
|
|
66
|
+
readonly contentMarkdown: Schema.optionalKey<Schema.String>;
|
|
67
|
+
readonly coverImageUrl: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
68
|
+
readonly coverImageAlt: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
69
|
+
readonly status: Schema.optionalKey<Schema.Literals<readonly ["draft", "scheduled", "published", "archived"]>>;
|
|
70
|
+
readonly locale: Schema.optionalKey<Schema.String>;
|
|
71
|
+
readonly featured: Schema.optionalKey<Schema.Boolean>;
|
|
72
|
+
readonly seoTitle: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
73
|
+
readonly seoDescription: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
74
|
+
readonly focusKeyword: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
75
|
+
readonly canonicalUrl: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
76
|
+
readonly scheduledAt: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
77
|
+
readonly categoryIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
78
|
+
}>;
|
|
79
|
+
declare const publicBlogOutput: Schema.Struct<{
|
|
80
|
+
readonly id: Schema.String;
|
|
81
|
+
readonly name: Schema.String;
|
|
82
|
+
readonly slug: Schema.String;
|
|
83
|
+
readonly description: Schema.String;
|
|
84
|
+
readonly locale: Schema.String;
|
|
85
|
+
readonly accentColor: Schema.String;
|
|
86
|
+
readonly publicUrl: Schema.NullOr<Schema.String>;
|
|
87
|
+
readonly createdAt: Schema.String;
|
|
88
|
+
readonly updatedAt: Schema.String;
|
|
89
|
+
}>;
|
|
90
|
+
declare const publicPostOutput: Schema.Struct<{
|
|
91
|
+
readonly id: Schema.String;
|
|
92
|
+
readonly slug: Schema.String;
|
|
93
|
+
readonly title: Schema.String;
|
|
94
|
+
readonly excerpt: Schema.String;
|
|
95
|
+
readonly contentMarkdown: Schema.String;
|
|
96
|
+
readonly contentHtml: Schema.String;
|
|
97
|
+
readonly coverImageUrl: Schema.NullOr<Schema.String>;
|
|
98
|
+
readonly coverImageAlt: Schema.NullOr<Schema.String>;
|
|
99
|
+
readonly status: Schema.Literals<readonly ["draft", "scheduled", "published", "archived"]>;
|
|
100
|
+
readonly locale: Schema.String;
|
|
101
|
+
readonly featured: Schema.Boolean;
|
|
102
|
+
readonly publishedAt: Schema.NullOr<Schema.String>;
|
|
103
|
+
readonly updatedAt: Schema.String;
|
|
104
|
+
readonly readingMinutes: Schema.Number;
|
|
105
|
+
readonly seoTitle: Schema.NullOr<Schema.String>;
|
|
106
|
+
readonly seoDescription: Schema.NullOr<Schema.String>;
|
|
107
|
+
readonly canonicalUrl: Schema.NullOr<Schema.String>;
|
|
108
|
+
readonly author: Schema.Struct<{
|
|
109
|
+
readonly id: Schema.String;
|
|
110
|
+
readonly name: Schema.String;
|
|
111
|
+
readonly slug: Schema.String;
|
|
112
|
+
readonly bio: Schema.NullOr<Schema.String>;
|
|
113
|
+
readonly avatarUrl: Schema.NullOr<Schema.String>;
|
|
114
|
+
readonly jobTitle: Schema.NullOr<Schema.String>;
|
|
115
|
+
readonly credentials: Schema.NullOr<Schema.String>;
|
|
116
|
+
}>;
|
|
117
|
+
readonly categories: Schema.$Array<Schema.Struct<{
|
|
118
|
+
readonly id: Schema.String;
|
|
119
|
+
readonly name: Schema.String;
|
|
120
|
+
readonly slug: Schema.String;
|
|
121
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
122
|
+
}>>;
|
|
123
|
+
}>;
|
|
124
|
+
declare const publicPostPage: Schema.Struct<{
|
|
125
|
+
readonly blog: Schema.Struct<{
|
|
126
|
+
readonly id: Schema.String;
|
|
127
|
+
readonly name: Schema.String;
|
|
128
|
+
readonly slug: Schema.String;
|
|
129
|
+
readonly description: Schema.String;
|
|
130
|
+
readonly locale: Schema.String;
|
|
131
|
+
readonly accentColor: Schema.String;
|
|
132
|
+
readonly publicUrl: Schema.NullOr<Schema.String>;
|
|
133
|
+
readonly createdAt: Schema.String;
|
|
134
|
+
readonly updatedAt: Schema.String;
|
|
135
|
+
}>;
|
|
136
|
+
readonly posts: Schema.$Array<Schema.Struct<{
|
|
137
|
+
readonly id: Schema.String;
|
|
138
|
+
readonly slug: Schema.String;
|
|
139
|
+
readonly title: Schema.String;
|
|
140
|
+
readonly excerpt: Schema.String;
|
|
141
|
+
readonly contentMarkdown: Schema.String;
|
|
142
|
+
readonly contentHtml: Schema.String;
|
|
143
|
+
readonly coverImageUrl: Schema.NullOr<Schema.String>;
|
|
144
|
+
readonly coverImageAlt: Schema.NullOr<Schema.String>;
|
|
145
|
+
readonly status: Schema.Literals<readonly ["draft", "scheduled", "published", "archived"]>;
|
|
146
|
+
readonly locale: Schema.String;
|
|
147
|
+
readonly featured: Schema.Boolean;
|
|
148
|
+
readonly publishedAt: Schema.NullOr<Schema.String>;
|
|
149
|
+
readonly updatedAt: Schema.String;
|
|
150
|
+
readonly readingMinutes: Schema.Number;
|
|
151
|
+
readonly seoTitle: Schema.NullOr<Schema.String>;
|
|
152
|
+
readonly seoDescription: Schema.NullOr<Schema.String>;
|
|
153
|
+
readonly canonicalUrl: Schema.NullOr<Schema.String>;
|
|
154
|
+
readonly author: Schema.Struct<{
|
|
155
|
+
readonly id: Schema.String;
|
|
156
|
+
readonly name: Schema.String;
|
|
157
|
+
readonly slug: Schema.String;
|
|
158
|
+
readonly bio: Schema.NullOr<Schema.String>;
|
|
159
|
+
readonly avatarUrl: Schema.NullOr<Schema.String>;
|
|
160
|
+
readonly jobTitle: Schema.NullOr<Schema.String>;
|
|
161
|
+
readonly credentials: Schema.NullOr<Schema.String>;
|
|
162
|
+
}>;
|
|
163
|
+
readonly categories: Schema.$Array<Schema.Struct<{
|
|
164
|
+
readonly id: Schema.String;
|
|
165
|
+
readonly name: Schema.String;
|
|
166
|
+
readonly slug: Schema.String;
|
|
167
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
168
|
+
}>>;
|
|
169
|
+
}>>;
|
|
170
|
+
readonly categories: Schema.$Array<Schema.Struct<{
|
|
171
|
+
readonly id: Schema.String;
|
|
172
|
+
readonly name: Schema.String;
|
|
173
|
+
readonly slug: Schema.String;
|
|
174
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
175
|
+
}>>;
|
|
176
|
+
readonly pagination: Schema.Struct<{
|
|
177
|
+
readonly page: Schema.Int;
|
|
178
|
+
readonly pageSize: Schema.Int;
|
|
179
|
+
readonly hasMore: Schema.Boolean;
|
|
180
|
+
}>;
|
|
181
|
+
}>;
|
|
182
|
+
declare const publicPostResult: Schema.Struct<{
|
|
183
|
+
readonly blog: Schema.Struct<{
|
|
184
|
+
readonly id: Schema.String;
|
|
185
|
+
readonly name: Schema.String;
|
|
186
|
+
readonly slug: Schema.String;
|
|
187
|
+
readonly description: Schema.String;
|
|
188
|
+
readonly locale: Schema.String;
|
|
189
|
+
readonly accentColor: Schema.String;
|
|
190
|
+
readonly publicUrl: Schema.NullOr<Schema.String>;
|
|
191
|
+
readonly createdAt: Schema.String;
|
|
192
|
+
readonly updatedAt: Schema.String;
|
|
193
|
+
}>;
|
|
194
|
+
readonly post: Schema.Struct<{
|
|
195
|
+
readonly id: Schema.String;
|
|
196
|
+
readonly slug: Schema.String;
|
|
197
|
+
readonly title: Schema.String;
|
|
198
|
+
readonly excerpt: Schema.String;
|
|
199
|
+
readonly contentMarkdown: Schema.String;
|
|
200
|
+
readonly contentHtml: Schema.String;
|
|
201
|
+
readonly coverImageUrl: Schema.NullOr<Schema.String>;
|
|
202
|
+
readonly coverImageAlt: Schema.NullOr<Schema.String>;
|
|
203
|
+
readonly status: Schema.Literals<readonly ["draft", "scheduled", "published", "archived"]>;
|
|
204
|
+
readonly locale: Schema.String;
|
|
205
|
+
readonly featured: Schema.Boolean;
|
|
206
|
+
readonly publishedAt: Schema.NullOr<Schema.String>;
|
|
207
|
+
readonly updatedAt: Schema.String;
|
|
208
|
+
readonly readingMinutes: Schema.Number;
|
|
209
|
+
readonly seoTitle: Schema.NullOr<Schema.String>;
|
|
210
|
+
readonly seoDescription: Schema.NullOr<Schema.String>;
|
|
211
|
+
readonly canonicalUrl: Schema.NullOr<Schema.String>;
|
|
212
|
+
readonly author: Schema.Struct<{
|
|
213
|
+
readonly id: Schema.String;
|
|
214
|
+
readonly name: Schema.String;
|
|
215
|
+
readonly slug: Schema.String;
|
|
216
|
+
readonly bio: Schema.NullOr<Schema.String>;
|
|
217
|
+
readonly avatarUrl: Schema.NullOr<Schema.String>;
|
|
218
|
+
readonly jobTitle: Schema.NullOr<Schema.String>;
|
|
219
|
+
readonly credentials: Schema.NullOr<Schema.String>;
|
|
220
|
+
}>;
|
|
221
|
+
readonly categories: Schema.$Array<Schema.Struct<{
|
|
222
|
+
readonly id: Schema.String;
|
|
223
|
+
readonly name: Schema.String;
|
|
224
|
+
readonly slug: Schema.String;
|
|
225
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
226
|
+
}>>;
|
|
227
|
+
}>;
|
|
228
|
+
}>;
|
|
229
|
+
type PostStatus = typeof postStatus.Type;
|
|
230
|
+
type PublicBlog = typeof publicBlogOutput.Type;
|
|
231
|
+
type PublicAuthor = typeof authorOutput.Type;
|
|
232
|
+
type PublicCategory = typeof categoryOutput.Type;
|
|
233
|
+
type PublicPost = typeof publicPostOutput.Type;
|
|
234
|
+
type PublicPostPage = typeof publicPostPage.Type;
|
|
235
|
+
type PublicPostResult = typeof publicPostResult.Type;
|
|
236
|
+
type PostCreateEncodedInput = typeof postCreateInput.Encoded;
|
|
237
|
+
type PostUpdateInput = typeof postUpdateInput.Type;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/index.d.ts
|
|
240
|
+
interface ProsewireClientOptions {
|
|
241
|
+
/** Base URL of a Prosewire deployment, e.g. https://blog.example.com. */
|
|
242
|
+
baseUrl: string;
|
|
243
|
+
/** Private API key. Public rendered/raw endpoints do not need one. */
|
|
244
|
+
apiKey?: string;
|
|
245
|
+
fetch?: typeof fetch;
|
|
246
|
+
}
|
|
247
|
+
interface PrivatePostListInput {
|
|
248
|
+
readonly blog?: string;
|
|
249
|
+
readonly search?: string;
|
|
250
|
+
readonly status?: PostStatus;
|
|
251
|
+
readonly page?: number;
|
|
252
|
+
readonly pageSize?: number;
|
|
253
|
+
}
|
|
254
|
+
declare function createEffectClient(options: ProsewireClientOptions): {
|
|
255
|
+
health: () => Effect.Effect<{
|
|
256
|
+
readonly status: "ok";
|
|
257
|
+
readonly version: string;
|
|
258
|
+
}, Schema.SchemaError | ApiUnavailable | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
259
|
+
blogs: {
|
|
260
|
+
list: () => Effect.Effect<readonly {
|
|
261
|
+
readonly id: string;
|
|
262
|
+
readonly name: string;
|
|
263
|
+
readonly slug: string;
|
|
264
|
+
readonly description: string;
|
|
265
|
+
readonly locale: string;
|
|
266
|
+
readonly accentColor: string;
|
|
267
|
+
readonly customCss: string;
|
|
268
|
+
readonly publicUrl: string | null;
|
|
269
|
+
readonly createdAt: string;
|
|
270
|
+
readonly updatedAt: string;
|
|
271
|
+
}[], Schema.SchemaError | ApiUnavailable | ApiInputRejected | ApiAuthenticationFailed | ApiAccessDenied | ApiPostNotFound | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
272
|
+
};
|
|
273
|
+
posts: {
|
|
274
|
+
list: (input?: PrivatePostListInput) => Effect.Effect<{
|
|
275
|
+
readonly items: readonly {
|
|
276
|
+
readonly id: string;
|
|
277
|
+
readonly blogId: string;
|
|
278
|
+
readonly title: string;
|
|
279
|
+
readonly slug: string;
|
|
280
|
+
readonly excerpt: string;
|
|
281
|
+
readonly contentMarkdown: string;
|
|
282
|
+
readonly contentHtml: string;
|
|
283
|
+
readonly coverImageUrl: string | null;
|
|
284
|
+
readonly coverImageAlt: string | null;
|
|
285
|
+
readonly status: "draft" | "scheduled" | "published" | "archived";
|
|
286
|
+
readonly locale: string;
|
|
287
|
+
readonly featured: boolean;
|
|
288
|
+
readonly seoTitle: string | null;
|
|
289
|
+
readonly seoDescription: string | null;
|
|
290
|
+
readonly focusKeyword: string | null;
|
|
291
|
+
readonly canonicalUrl: string | null;
|
|
292
|
+
readonly publishedAt: string | null;
|
|
293
|
+
readonly scheduledAt: string | null;
|
|
294
|
+
readonly createdAt: string;
|
|
295
|
+
readonly updatedAt: string;
|
|
296
|
+
readonly author: {
|
|
297
|
+
readonly id: string;
|
|
298
|
+
readonly name: string;
|
|
299
|
+
readonly slug: string;
|
|
300
|
+
readonly bio: string | null;
|
|
301
|
+
readonly avatarUrl: string | null;
|
|
302
|
+
readonly jobTitle: string | null;
|
|
303
|
+
readonly credentials: string | null;
|
|
304
|
+
};
|
|
305
|
+
readonly categories: readonly {
|
|
306
|
+
readonly id: string;
|
|
307
|
+
readonly name: string;
|
|
308
|
+
readonly slug: string;
|
|
309
|
+
readonly description: string | null;
|
|
310
|
+
}[];
|
|
311
|
+
}[];
|
|
312
|
+
readonly total: number;
|
|
313
|
+
readonly page: number;
|
|
314
|
+
readonly pageSize: number;
|
|
315
|
+
}, Schema.SchemaError | ApiUnavailable | ApiInputRejected | ApiAuthenticationFailed | ApiAccessDenied | ApiPostNotFound | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
316
|
+
get: (input: {
|
|
317
|
+
readonly params: {
|
|
318
|
+
readonly id: string;
|
|
319
|
+
};
|
|
320
|
+
}) => Effect.Effect<{
|
|
321
|
+
readonly id: string;
|
|
322
|
+
readonly blogId: string;
|
|
323
|
+
readonly title: string;
|
|
324
|
+
readonly slug: string;
|
|
325
|
+
readonly excerpt: string;
|
|
326
|
+
readonly contentMarkdown: string;
|
|
327
|
+
readonly contentHtml: string;
|
|
328
|
+
readonly coverImageUrl: string | null;
|
|
329
|
+
readonly coverImageAlt: string | null;
|
|
330
|
+
readonly status: "draft" | "scheduled" | "published" | "archived";
|
|
331
|
+
readonly locale: string;
|
|
332
|
+
readonly featured: boolean;
|
|
333
|
+
readonly seoTitle: string | null;
|
|
334
|
+
readonly seoDescription: string | null;
|
|
335
|
+
readonly focusKeyword: string | null;
|
|
336
|
+
readonly canonicalUrl: string | null;
|
|
337
|
+
readonly publishedAt: string | null;
|
|
338
|
+
readonly scheduledAt: string | null;
|
|
339
|
+
readonly createdAt: string;
|
|
340
|
+
readonly updatedAt: string;
|
|
341
|
+
readonly author: {
|
|
342
|
+
readonly id: string;
|
|
343
|
+
readonly name: string;
|
|
344
|
+
readonly slug: string;
|
|
345
|
+
readonly bio: string | null;
|
|
346
|
+
readonly avatarUrl: string | null;
|
|
347
|
+
readonly jobTitle: string | null;
|
|
348
|
+
readonly credentials: string | null;
|
|
349
|
+
};
|
|
350
|
+
readonly categories: readonly {
|
|
351
|
+
readonly id: string;
|
|
352
|
+
readonly name: string;
|
|
353
|
+
readonly slug: string;
|
|
354
|
+
readonly description: string | null;
|
|
355
|
+
}[];
|
|
356
|
+
}, Schema.SchemaError | ApiUnavailable | ApiInputRejected | ApiAuthenticationFailed | ApiAccessDenied | ApiPostNotFound | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
357
|
+
create: (input: PostCreateEncodedInput) => Effect.Effect<{
|
|
358
|
+
readonly id: string;
|
|
359
|
+
readonly blogId: string;
|
|
360
|
+
readonly title: string;
|
|
361
|
+
readonly slug: string;
|
|
362
|
+
readonly excerpt: string;
|
|
363
|
+
readonly contentMarkdown: string;
|
|
364
|
+
readonly contentHtml: string;
|
|
365
|
+
readonly coverImageUrl: string | null;
|
|
366
|
+
readonly coverImageAlt: string | null;
|
|
367
|
+
readonly status: "draft" | "scheduled" | "published" | "archived";
|
|
368
|
+
readonly locale: string;
|
|
369
|
+
readonly featured: boolean;
|
|
370
|
+
readonly seoTitle: string | null;
|
|
371
|
+
readonly seoDescription: string | null;
|
|
372
|
+
readonly focusKeyword: string | null;
|
|
373
|
+
readonly canonicalUrl: string | null;
|
|
374
|
+
readonly publishedAt: string | null;
|
|
375
|
+
readonly scheduledAt: string | null;
|
|
376
|
+
readonly createdAt: string;
|
|
377
|
+
readonly updatedAt: string;
|
|
378
|
+
readonly author: {
|
|
379
|
+
readonly id: string;
|
|
380
|
+
readonly name: string;
|
|
381
|
+
readonly slug: string;
|
|
382
|
+
readonly bio: string | null;
|
|
383
|
+
readonly avatarUrl: string | null;
|
|
384
|
+
readonly jobTitle: string | null;
|
|
385
|
+
readonly credentials: string | null;
|
|
386
|
+
};
|
|
387
|
+
readonly categories: readonly {
|
|
388
|
+
readonly id: string;
|
|
389
|
+
readonly name: string;
|
|
390
|
+
readonly slug: string;
|
|
391
|
+
readonly description: string | null;
|
|
392
|
+
}[];
|
|
393
|
+
}, Schema.SchemaError | ApiUnavailable | ApiInputRejected | ApiAuthenticationFailed | ApiAccessDenied | ApiPostNotFound | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
394
|
+
update: (input: {
|
|
395
|
+
readonly params: {
|
|
396
|
+
readonly id: string;
|
|
397
|
+
};
|
|
398
|
+
readonly body: PostUpdateInput;
|
|
399
|
+
}) => Effect.Effect<{
|
|
400
|
+
readonly id: string;
|
|
401
|
+
readonly blogId: string;
|
|
402
|
+
readonly title: string;
|
|
403
|
+
readonly slug: string;
|
|
404
|
+
readonly excerpt: string;
|
|
405
|
+
readonly contentMarkdown: string;
|
|
406
|
+
readonly contentHtml: string;
|
|
407
|
+
readonly coverImageUrl: string | null;
|
|
408
|
+
readonly coverImageAlt: string | null;
|
|
409
|
+
readonly status: "draft" | "scheduled" | "published" | "archived";
|
|
410
|
+
readonly locale: string;
|
|
411
|
+
readonly featured: boolean;
|
|
412
|
+
readonly seoTitle: string | null;
|
|
413
|
+
readonly seoDescription: string | null;
|
|
414
|
+
readonly focusKeyword: string | null;
|
|
415
|
+
readonly canonicalUrl: string | null;
|
|
416
|
+
readonly publishedAt: string | null;
|
|
417
|
+
readonly scheduledAt: string | null;
|
|
418
|
+
readonly createdAt: string;
|
|
419
|
+
readonly updatedAt: string;
|
|
420
|
+
readonly author: {
|
|
421
|
+
readonly id: string;
|
|
422
|
+
readonly name: string;
|
|
423
|
+
readonly slug: string;
|
|
424
|
+
readonly bio: string | null;
|
|
425
|
+
readonly avatarUrl: string | null;
|
|
426
|
+
readonly jobTitle: string | null;
|
|
427
|
+
readonly credentials: string | null;
|
|
428
|
+
};
|
|
429
|
+
readonly categories: readonly {
|
|
430
|
+
readonly id: string;
|
|
431
|
+
readonly name: string;
|
|
432
|
+
readonly slug: string;
|
|
433
|
+
readonly description: string | null;
|
|
434
|
+
}[];
|
|
435
|
+
}, Schema.SchemaError | ApiUnavailable | ApiInputRejected | ApiAuthenticationFailed | ApiAccessDenied | ApiPostNotFound | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
436
|
+
archive: (input: {
|
|
437
|
+
readonly params: {
|
|
438
|
+
readonly id: string;
|
|
439
|
+
};
|
|
440
|
+
}) => Effect.Effect<{
|
|
441
|
+
readonly ok: true;
|
|
442
|
+
}, Schema.SchemaError | ApiUnavailable | ApiInputRejected | ApiAuthenticationFailed | ApiAccessDenied | ApiPostNotFound | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
type EffectClient = ReturnType<typeof createEffectClient>;
|
|
446
|
+
declare function createClient(options: ProsewireClientOptions): {
|
|
447
|
+
health: () => Promise<{
|
|
448
|
+
readonly status: "ok";
|
|
449
|
+
readonly version: string;
|
|
450
|
+
}>;
|
|
451
|
+
blogs: {
|
|
452
|
+
list: () => Promise<readonly {
|
|
453
|
+
readonly id: string;
|
|
454
|
+
readonly name: string;
|
|
455
|
+
readonly slug: string;
|
|
456
|
+
readonly description: string;
|
|
457
|
+
readonly locale: string;
|
|
458
|
+
readonly accentColor: string;
|
|
459
|
+
readonly customCss: string;
|
|
460
|
+
readonly publicUrl: string | null;
|
|
461
|
+
readonly createdAt: string;
|
|
462
|
+
readonly updatedAt: string;
|
|
463
|
+
}[]>;
|
|
464
|
+
};
|
|
465
|
+
posts: {
|
|
466
|
+
list: (input?: PrivatePostListInput) => Promise<{
|
|
467
|
+
readonly items: readonly {
|
|
468
|
+
readonly id: string;
|
|
469
|
+
readonly blogId: string;
|
|
470
|
+
readonly title: string;
|
|
471
|
+
readonly slug: string;
|
|
472
|
+
readonly excerpt: string;
|
|
473
|
+
readonly contentMarkdown: string;
|
|
474
|
+
readonly contentHtml: string;
|
|
475
|
+
readonly coverImageUrl: string | null;
|
|
476
|
+
readonly coverImageAlt: string | null;
|
|
477
|
+
readonly status: "draft" | "scheduled" | "published" | "archived";
|
|
478
|
+
readonly locale: string;
|
|
479
|
+
readonly featured: boolean;
|
|
480
|
+
readonly seoTitle: string | null;
|
|
481
|
+
readonly seoDescription: string | null;
|
|
482
|
+
readonly focusKeyword: string | null;
|
|
483
|
+
readonly canonicalUrl: string | null;
|
|
484
|
+
readonly publishedAt: string | null;
|
|
485
|
+
readonly scheduledAt: string | null;
|
|
486
|
+
readonly createdAt: string;
|
|
487
|
+
readonly updatedAt: string;
|
|
488
|
+
readonly author: {
|
|
489
|
+
readonly id: string;
|
|
490
|
+
readonly name: string;
|
|
491
|
+
readonly slug: string;
|
|
492
|
+
readonly bio: string | null;
|
|
493
|
+
readonly avatarUrl: string | null;
|
|
494
|
+
readonly jobTitle: string | null;
|
|
495
|
+
readonly credentials: string | null;
|
|
496
|
+
};
|
|
497
|
+
readonly categories: readonly {
|
|
498
|
+
readonly id: string;
|
|
499
|
+
readonly name: string;
|
|
500
|
+
readonly slug: string;
|
|
501
|
+
readonly description: string | null;
|
|
502
|
+
}[];
|
|
503
|
+
}[];
|
|
504
|
+
readonly total: number;
|
|
505
|
+
readonly page: number;
|
|
506
|
+
readonly pageSize: number;
|
|
507
|
+
}>;
|
|
508
|
+
get: (input: {
|
|
509
|
+
readonly params: {
|
|
510
|
+
readonly id: string;
|
|
511
|
+
};
|
|
512
|
+
}) => Promise<{
|
|
513
|
+
readonly id: string;
|
|
514
|
+
readonly blogId: string;
|
|
515
|
+
readonly title: string;
|
|
516
|
+
readonly slug: string;
|
|
517
|
+
readonly excerpt: string;
|
|
518
|
+
readonly contentMarkdown: string;
|
|
519
|
+
readonly contentHtml: string;
|
|
520
|
+
readonly coverImageUrl: string | null;
|
|
521
|
+
readonly coverImageAlt: string | null;
|
|
522
|
+
readonly status: "draft" | "scheduled" | "published" | "archived";
|
|
523
|
+
readonly locale: string;
|
|
524
|
+
readonly featured: boolean;
|
|
525
|
+
readonly seoTitle: string | null;
|
|
526
|
+
readonly seoDescription: string | null;
|
|
527
|
+
readonly focusKeyword: string | null;
|
|
528
|
+
readonly canonicalUrl: string | null;
|
|
529
|
+
readonly publishedAt: string | null;
|
|
530
|
+
readonly scheduledAt: string | null;
|
|
531
|
+
readonly createdAt: string;
|
|
532
|
+
readonly updatedAt: string;
|
|
533
|
+
readonly author: {
|
|
534
|
+
readonly id: string;
|
|
535
|
+
readonly name: string;
|
|
536
|
+
readonly slug: string;
|
|
537
|
+
readonly bio: string | null;
|
|
538
|
+
readonly avatarUrl: string | null;
|
|
539
|
+
readonly jobTitle: string | null;
|
|
540
|
+
readonly credentials: string | null;
|
|
541
|
+
};
|
|
542
|
+
readonly categories: readonly {
|
|
543
|
+
readonly id: string;
|
|
544
|
+
readonly name: string;
|
|
545
|
+
readonly slug: string;
|
|
546
|
+
readonly description: string | null;
|
|
547
|
+
}[];
|
|
548
|
+
}>;
|
|
549
|
+
create: (input: PostCreateEncodedInput) => Promise<{
|
|
550
|
+
readonly id: string;
|
|
551
|
+
readonly blogId: string;
|
|
552
|
+
readonly title: string;
|
|
553
|
+
readonly slug: string;
|
|
554
|
+
readonly excerpt: string;
|
|
555
|
+
readonly contentMarkdown: string;
|
|
556
|
+
readonly contentHtml: string;
|
|
557
|
+
readonly coverImageUrl: string | null;
|
|
558
|
+
readonly coverImageAlt: string | null;
|
|
559
|
+
readonly status: "draft" | "scheduled" | "published" | "archived";
|
|
560
|
+
readonly locale: string;
|
|
561
|
+
readonly featured: boolean;
|
|
562
|
+
readonly seoTitle: string | null;
|
|
563
|
+
readonly seoDescription: string | null;
|
|
564
|
+
readonly focusKeyword: string | null;
|
|
565
|
+
readonly canonicalUrl: string | null;
|
|
566
|
+
readonly publishedAt: string | null;
|
|
567
|
+
readonly scheduledAt: string | null;
|
|
568
|
+
readonly createdAt: string;
|
|
569
|
+
readonly updatedAt: string;
|
|
570
|
+
readonly author: {
|
|
571
|
+
readonly id: string;
|
|
572
|
+
readonly name: string;
|
|
573
|
+
readonly slug: string;
|
|
574
|
+
readonly bio: string | null;
|
|
575
|
+
readonly avatarUrl: string | null;
|
|
576
|
+
readonly jobTitle: string | null;
|
|
577
|
+
readonly credentials: string | null;
|
|
578
|
+
};
|
|
579
|
+
readonly categories: readonly {
|
|
580
|
+
readonly id: string;
|
|
581
|
+
readonly name: string;
|
|
582
|
+
readonly slug: string;
|
|
583
|
+
readonly description: string | null;
|
|
584
|
+
}[];
|
|
585
|
+
}>;
|
|
586
|
+
update: (input: {
|
|
587
|
+
readonly params: {
|
|
588
|
+
readonly id: string;
|
|
589
|
+
};
|
|
590
|
+
readonly body: PostUpdateInput;
|
|
591
|
+
}) => Promise<{
|
|
592
|
+
readonly id: string;
|
|
593
|
+
readonly blogId: string;
|
|
594
|
+
readonly title: string;
|
|
595
|
+
readonly slug: string;
|
|
596
|
+
readonly excerpt: string;
|
|
597
|
+
readonly contentMarkdown: string;
|
|
598
|
+
readonly contentHtml: string;
|
|
599
|
+
readonly coverImageUrl: string | null;
|
|
600
|
+
readonly coverImageAlt: string | null;
|
|
601
|
+
readonly status: "draft" | "scheduled" | "published" | "archived";
|
|
602
|
+
readonly locale: string;
|
|
603
|
+
readonly featured: boolean;
|
|
604
|
+
readonly seoTitle: string | null;
|
|
605
|
+
readonly seoDescription: string | null;
|
|
606
|
+
readonly focusKeyword: string | null;
|
|
607
|
+
readonly canonicalUrl: string | null;
|
|
608
|
+
readonly publishedAt: string | null;
|
|
609
|
+
readonly scheduledAt: string | null;
|
|
610
|
+
readonly createdAt: string;
|
|
611
|
+
readonly updatedAt: string;
|
|
612
|
+
readonly author: {
|
|
613
|
+
readonly id: string;
|
|
614
|
+
readonly name: string;
|
|
615
|
+
readonly slug: string;
|
|
616
|
+
readonly bio: string | null;
|
|
617
|
+
readonly avatarUrl: string | null;
|
|
618
|
+
readonly jobTitle: string | null;
|
|
619
|
+
readonly credentials: string | null;
|
|
620
|
+
};
|
|
621
|
+
readonly categories: readonly {
|
|
622
|
+
readonly id: string;
|
|
623
|
+
readonly name: string;
|
|
624
|
+
readonly slug: string;
|
|
625
|
+
readonly description: string | null;
|
|
626
|
+
}[];
|
|
627
|
+
}>;
|
|
628
|
+
archive: (input: {
|
|
629
|
+
readonly params: {
|
|
630
|
+
readonly id: string;
|
|
631
|
+
};
|
|
632
|
+
}) => Promise<{
|
|
633
|
+
readonly ok: true;
|
|
634
|
+
}>;
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
type Client = ReturnType<typeof createClient>;
|
|
638
|
+
interface PublicListInput {
|
|
639
|
+
search?: string;
|
|
640
|
+
category?: string;
|
|
641
|
+
page?: number;
|
|
642
|
+
pageSize?: number;
|
|
643
|
+
/** @deprecated Use pageSize. */
|
|
644
|
+
limit?: number;
|
|
645
|
+
}
|
|
646
|
+
interface PublicContentClient {
|
|
647
|
+
listPosts(input?: PublicListInput): Promise<PublicPostPage>;
|
|
648
|
+
getPost(slug: string): Promise<PublicPostResult>;
|
|
649
|
+
getRendered(path?: string): Promise<string>;
|
|
650
|
+
}
|
|
651
|
+
declare function createPublicClient(options: Pick<ProsewireClientOptions, "baseUrl" | "fetch"> & {
|
|
652
|
+
blog: string;
|
|
653
|
+
}): PublicContentClient;
|
|
654
|
+
//#endregion
|
|
655
|
+
export { Client, EffectClient, PrivatePostListInput, ProsewireClientOptions, type PublicAuthor, type PublicBlog, type PublicCategory, PublicContentClient, PublicListInput, type PublicPost, type PublicPostPage, type PublicPostResult, createClient, createEffectClient, createPublicClient };
|
|
656
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../contract/src/router.ts","../../contract/src/schemas.ts","../src/index.ts"],"mappings":";;;;;;cAiBa,yBAAyB;;;;cAMzB,gCAAgC;;;;cAMhC,wBAAwB;;;;cAMxB,wBAAwB;;;;cAMxB,uBAAuB;;;cCzBvB,YAAU,OAAA;cAOV,cAAY,OAAA;;;;;;;;;cAUZ,gBAAc,OAAA;;;;;;cAiEd,iBAAe,OAAA;;;;;;;;;;;;;;;;;;;cAoBf,iBAAe,OAAA;;;;;;;;;;;;;;;;;;cAgCf,kBAAgB,OAAA;;;;;;;;;;;cAYhB,kBAAgB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBhB,gBAAc,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWd,kBAAgB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYjB,oBAAoB,WAAW;KAG/B,oBAAoB,iBAAiB;KACrC,sBAAsB,aAAa;KACnC,wBAAwB,eAAe;KACvC,oBAAoB,iBAAiB;KACrC,wBAAwB,eAAe;KACvC,0BAA0B,iBAAiB;KAE3C,gCAAgC,gBAAgB;KAChD,yBAAyB,gBAAgB;;;UCnMpC;;EAEf;;EAEA;EACA,eAAe;;UAGA;WACN;WACA;WACA,SAAS;WACT;WACA;;iBAcK,mBAAmB,SAAS;;;;;;;;;;;;;;;;;;;;IA0BxB,OAAA,QAAA,yBAAoB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAErB,MAAA;eAAW;iBAAmB;;UAAc,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEzC,SAAA,OAAA,2BAAsB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAItB,SAAA;eACL;iBAAmB;;eACnB,MAAM;UAChB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOgB,UAAA;eAAW;iBAAmB;;UAAc,OAAA;;;;;KAMvD,eAAe,kBAAkB;iBAE7B,aAAa,SAAS;;;;;;;;;;;;;;;;;;;;IAQlB,OAAA,QAAA,yBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAErB,MAAA;eAAW;iBAAmB;;UAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEzC,SAAA,OAAA,2BAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEtB,SAAA;eACL;iBAAmB;;eACnB,MAAM;UAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACgB,UAAA;eAAW;iBAAmB;;UAAc;;;;;KAMvD,SAAS,kBAAkB;UAWtB;EACf;EACA;EACA;EACA;;EAEA;;UAGe;EACf,UAAU,QAAQ,kBAAkB,QAAQ;EAC5C,QAAQ,eAAe,QAAQ;EAC/B,YAAY,gBAAgB;;iBAUd,mBACd,SAAS,KAAK;EAAiD;IAC9D"}
|