@peristyle/emdash-plugin-instagram-to-recipe 0.1.0 → 0.1.3

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/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  function instagramToRecipePlugin(options = {}) {
3
3
  return {
4
4
  id: "peristyle-instagram-to-recipe",
5
- version: "0.1.0",
5
+ version: "0.1.3",
6
6
  format: "standard",
7
7
  entrypoint: "@peristyle/emdash-plugin-instagram-to-recipe/sandbox",
8
8
  options,
@@ -24,6 +24,8 @@ type ParsedInstagramRecipe = {
24
24
  id: string;
25
25
  src: string;
26
26
  mimeType?: string;
27
+ width?: number;
28
+ height?: number;
27
29
  meta?: {
28
30
  storageKey: string;
29
31
  };
@@ -35,14 +37,24 @@ type ParsedInstagramRecipe = {
35
37
  image_notice?: string;
36
38
  };
37
39
 
40
+ type BulkCandidate = {
41
+ recipe: ParsedInstagramRecipe;
42
+ alreadyImported: boolean;
43
+ };
44
+
38
45
  type AdminInteraction = {
39
46
  type: string;
40
47
  page?: string;
41
48
  action_id?: string;
42
49
  block_id?: string;
43
- values?: Record<string, string | boolean | number>;
50
+ values?: Record<string, string | boolean | number | string[]>;
44
51
  value?: unknown;
45
52
  };
53
+ type BulkDraft = {
54
+ shortcode: string;
55
+ contentId: string;
56
+ title: string;
57
+ };
46
58
  declare const _default: {
47
59
  hooks: {
48
60
  "plugin:install": {
@@ -79,6 +91,41 @@ declare const _default: {
79
91
  ok: boolean;
80
92
  }>;
81
93
  };
94
+ "bulk-scan": {
95
+ input: z.ZodObject<{
96
+ handle: z.ZodString;
97
+ }, z.core.$strip>;
98
+ handler: (routeCtx: {
99
+ input: {
100
+ handle: string;
101
+ };
102
+ }, ctx: PluginContext) => Promise<{
103
+ handle: string;
104
+ candidates: BulkCandidate[];
105
+ scanned: number;
106
+ rateLimited?: boolean;
107
+ fromCache?: boolean;
108
+ ok: boolean;
109
+ }>;
110
+ };
111
+ "bulk-create": {
112
+ input: z.ZodObject<{
113
+ shortcodes: z.ZodArray<z.ZodString>;
114
+ }, z.core.$strip>;
115
+ handler: (routeCtx: {
116
+ input: {
117
+ shortcodes: string[];
118
+ };
119
+ }, ctx: PluginContext) => Promise<{
120
+ created: BulkDraft[];
121
+ skipped: BulkDraft[];
122
+ failed: Array<{
123
+ shortcode: string;
124
+ message: string;
125
+ }>;
126
+ ok: boolean;
127
+ }>;
128
+ };
82
129
  admin: {
83
130
  handler: (routeCtx: {
84
131
  input?: AdminInteraction;