@rmdes/indiekit-endpoint-micropub 1.0.0-beta.26 → 1.0.0-beta.27

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.
Files changed (2) hide show
  1. package/lib/post-data.js +15 -0
  2. package/package.json +1 -1
package/lib/post-data.js CHANGED
@@ -150,6 +150,11 @@ export const postData = {
150
150
  const typeConfig = postTypes[type];
151
151
  properties["post-type"] = type;
152
152
 
153
+ // Validate post type configuration exists
154
+ if (!typeConfig || !typeConfig.post?.path) {
155
+ throw IndiekitError.notImplemented(type);
156
+ }
157
+
153
158
  // Post paths
154
159
  const path = await renderPath(
155
160
  typeConfig.post.path,
@@ -219,6 +224,11 @@ export const postData = {
219
224
  const type = properties["post-type"];
220
225
  const typeConfig = postTypes[type];
221
226
 
227
+ // Validate post type configuration exists
228
+ if (!typeConfig || !typeConfig.post?.path) {
229
+ throw IndiekitError.notImplemented(type);
230
+ }
231
+
222
232
  // Post paths
223
233
  const path = await renderPath(
224
234
  typeConfig.post.path,
@@ -261,6 +271,11 @@ export const postData = {
261
271
  const type = properties["post-type"];
262
272
  const typeConfig = postTypes[type];
263
273
 
274
+ // Validate post type configuration exists
275
+ if (!typeConfig || !typeConfig.post?.path) {
276
+ throw IndiekitError.notImplemented(type);
277
+ }
278
+
264
279
  // Post paths
265
280
  const path = await renderPath(
266
281
  typeConfig.post.path,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-micropub",
3
- "version": "1.0.0-beta.26",
3
+ "version": "1.0.0-beta.27",
4
4
  "description": "Micropub endpoint for Indiekit with custom type-based post discovery. Enables publishing content to your website using the Micropub protocol.",
5
5
  "keywords": [
6
6
  "indiekit",