@uniformdev/webhooks 17.7.1-alpha.140 → 17.7.1-alpha.169

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.d.ts CHANGED
@@ -179,7 +179,7 @@ declare const CompositionChangedDefinition: Definition<z.ZodObject<{
179
179
  };
180
180
  edit_url: string;
181
181
  }>>;
182
- type CompositionChangedPayload = z.infer<typeof CompositionChangedDefinition['schema']>;
182
+ type CompositionChangedPayload = z.infer<(typeof CompositionChangedDefinition)['schema']>;
183
183
  declare const CompositionChangedEventName: string;
184
184
 
185
185
  declare const CompositionDeletedDefinition: Definition<z.ZodObject<{
@@ -228,7 +228,7 @@ declare const CompositionDeletedDefinition: Definition<z.ZodObject<{
228
228
  email: string;
229
229
  };
230
230
  }>>;
231
- type CompositionDeletedPayload = z.infer<typeof CompositionDeletedDefinition['schema']>;
231
+ type CompositionDeletedPayload = z.infer<(typeof CompositionDeletedDefinition)['schema']>;
232
232
  declare const CompositionDeletedEventName: string;
233
233
 
234
234
  declare const CompositionPublishedDefinition: Definition<z.ZodObject<{
@@ -313,7 +313,7 @@ declare const CompositionPublishedDefinition: Definition<z.ZodObject<{
313
313
  };
314
314
  edit_url: string;
315
315
  }>>;
316
- type CompositionPublishedPayload = z.infer<typeof CompositionPublishedDefinition['schema']>;
316
+ type CompositionPublishedPayload = z.infer<(typeof CompositionPublishedDefinition)['schema']>;
317
317
  declare const CompositionPublishedEventName: string;
318
318
 
319
319
  declare const ManifestPublishedDefinition: Definition<z.ZodObject<{
@@ -354,7 +354,7 @@ declare const ManifestPublishedDefinition: Definition<z.ZodObject<{
354
354
  name: string;
355
355
  };
356
356
  }>>;
357
- type ManifestPublishedPayload = z.infer<typeof ManifestPublishedDefinition['schema']>;
357
+ type ManifestPublishedPayload = z.infer<(typeof ManifestPublishedDefinition)['schema']>;
358
358
  declare const ManifestPublishedEventName: string;
359
359
 
360
360
  export { CompositionChangedDefinition, CompositionChangedEventName, CompositionChangedPayload, CompositionDeletedDefinition, CompositionDeletedEventName, CompositionDeletedPayload, CompositionPayload, CompositionPayloadSchema, CompositionPublishedDefinition, CompositionPublishedEventName, CompositionPublishedPayload, Definition, DefinitionOptions, ManifestPublishedDefinition, ManifestPublishedEventName, ManifestPublishedPayload, definition, isDefinition };
package/dist/index.esm.js CHANGED
@@ -1 +1,175 @@
1
- import{z as o}from"zod";var s=o.object({id:o.string(),slug:o.string().optional(),project_map:o.object({node:o.object({path:o.string()})}).optional(),state:o.number(),name:o.string(),project:o.object({id:o.string(),url:o.string()}),user:o.object({name:o.string(),email:o.string()}),edit_url:o.string()});var f=n=>Object.hasOwn(n,"_definition")&&n._definition,i=(n,m)=>({...n,_definition:!0,example:m});var r=i({event:"composition.changed",name:"Composition Changed",description:"Triggers when a composition has been changed.",schema:s},{id:"id of composition",name:"name of composition",slug:"slug of composition",project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"},state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project_map:{node:{path:"path that this composition is associated with"}},edit_url:"link to edit this composition"}),b=r.event;import{z as e}from"zod";var p=i({event:"composition.deleted",name:"Composition Deleted",description:"Triggers when a composition has been deleted.",schema:e.object({id:e.string(),state:e.number().optional(),user:e.object({name:e.string(),email:e.string()}),project:e.object({id:e.string(),url:e.string()})})},{id:"id of composition",state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"}}),x=p.event;var a=i({event:"composition.published",name:"Composition Published",description:"Triggers when a composition has been published.",schema:s},{id:"id of composition",name:"name of composition",slug:"slug of composition",project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"},state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project_map:{node:{path:"path that this composition is associated with"}},edit_url:"link to edit this composition"}),w=a.event;import{z as t}from"zod";var c=i({event:"manifest.published",name:"Manifest Published",description:"Triggers when a manifest has been published.",schema:t.object({timestamp:t.number(),site:t.object({name:t.string()}),user:t.object({name:t.string(),email:t.string()})})},{timestamp:1667425322407,site:{name:"My Site"},user:{email:"email of the user who performed this action",name:"name of the user who performed this action"}}),_=c.event;export{r as CompositionChangedDefinition,b as CompositionChangedEventName,p as CompositionDeletedDefinition,x as CompositionDeletedEventName,s as CompositionPayloadSchema,a as CompositionPublishedDefinition,w as CompositionPublishedEventName,c as ManifestPublishedDefinition,_ as ManifestPublishedEventName,i as definition,f as isDefinition};
1
+ // src/composition/common.ts
2
+ import { z } from "zod";
3
+ var CompositionPayloadSchema = z.object({
4
+ id: z.string(),
5
+ slug: z.string().optional(),
6
+ project_map: z.object({
7
+ node: z.object({
8
+ path: z.string()
9
+ })
10
+ }).optional(),
11
+ state: z.number(),
12
+ name: z.string(),
13
+ project: z.object({
14
+ id: z.string(),
15
+ url: z.string()
16
+ }),
17
+ user: z.object({
18
+ name: z.string(),
19
+ email: z.string()
20
+ }),
21
+ edit_url: z.string()
22
+ });
23
+
24
+ // src/definition.ts
25
+ var isDefinition = (obj) => {
26
+ return Object.hasOwn(obj, "_definition") && obj["_definition"];
27
+ };
28
+ var definition = (options, example) => {
29
+ return {
30
+ ...options,
31
+ _definition: true,
32
+ example
33
+ };
34
+ };
35
+
36
+ // src/composition/composition.changed.ts
37
+ var CompositionChangedDefinition = definition(
38
+ {
39
+ event: "composition.changed",
40
+ name: "Composition Changed",
41
+ description: "Triggers when a composition has been changed.",
42
+ schema: CompositionPayloadSchema
43
+ },
44
+ {
45
+ id: "id of composition",
46
+ name: "name of composition",
47
+ slug: "slug of composition",
48
+ project: {
49
+ id: "id of the project this composition belongs to",
50
+ url: "link to project this composition belongs to"
51
+ },
52
+ state: 0,
53
+ user: {
54
+ email: "email of the user who performed this action",
55
+ name: "name of the user who performed this action"
56
+ },
57
+ project_map: {
58
+ node: {
59
+ path: "path that this composition is associated with"
60
+ }
61
+ },
62
+ edit_url: "link to edit this composition"
63
+ }
64
+ );
65
+ var CompositionChangedEventName = CompositionChangedDefinition["event"];
66
+
67
+ // src/composition/composition.deleted.ts
68
+ import { z as z2 } from "zod";
69
+ var CompositionDeletedDefinition = definition(
70
+ {
71
+ event: "composition.deleted",
72
+ name: "Composition Deleted",
73
+ description: "Triggers when a composition has been deleted.",
74
+ schema: z2.object({
75
+ id: z2.string(),
76
+ state: z2.number().optional(),
77
+ user: z2.object({
78
+ name: z2.string(),
79
+ email: z2.string()
80
+ }),
81
+ project: z2.object({
82
+ id: z2.string(),
83
+ url: z2.string()
84
+ })
85
+ })
86
+ },
87
+ {
88
+ id: "id of composition",
89
+ state: 0,
90
+ user: {
91
+ email: "email of the user who performed this action",
92
+ name: "name of the user who performed this action"
93
+ },
94
+ project: {
95
+ id: "id of the project this composition belongs to",
96
+ url: "link to project this composition belongs to"
97
+ }
98
+ }
99
+ );
100
+ var CompositionDeletedEventName = CompositionDeletedDefinition["event"];
101
+
102
+ // src/composition/composition.published.ts
103
+ var CompositionPublishedDefinition = definition(
104
+ {
105
+ event: "composition.published",
106
+ name: "Composition Published",
107
+ description: "Triggers when a composition has been published.",
108
+ schema: CompositionPayloadSchema
109
+ },
110
+ {
111
+ id: "id of composition",
112
+ name: "name of composition",
113
+ slug: "slug of composition",
114
+ project: {
115
+ id: "id of the project this composition belongs to",
116
+ url: "link to project this composition belongs to"
117
+ },
118
+ state: 0,
119
+ user: {
120
+ email: "email of the user who performed this action",
121
+ name: "name of the user who performed this action"
122
+ },
123
+ project_map: {
124
+ node: {
125
+ path: "path that this composition is associated with"
126
+ }
127
+ },
128
+ edit_url: "link to edit this composition"
129
+ }
130
+ );
131
+ var CompositionPublishedEventName = CompositionPublishedDefinition["event"];
132
+
133
+ // src/manifest/manifest.published.ts
134
+ import { z as z3 } from "zod";
135
+ var ManifestPublishedDefinition = definition(
136
+ {
137
+ event: "manifest.published",
138
+ name: "Manifest Published",
139
+ description: "Triggers when a manifest has been published.",
140
+ schema: z3.object({
141
+ timestamp: z3.number(),
142
+ site: z3.object({
143
+ name: z3.string()
144
+ }),
145
+ user: z3.object({
146
+ name: z3.string(),
147
+ email: z3.string()
148
+ })
149
+ })
150
+ },
151
+ {
152
+ timestamp: 1667425322407,
153
+ site: {
154
+ name: "My Site"
155
+ },
156
+ user: {
157
+ email: "email of the user who performed this action",
158
+ name: "name of the user who performed this action"
159
+ }
160
+ }
161
+ );
162
+ var ManifestPublishedEventName = ManifestPublishedDefinition["event"];
163
+ export {
164
+ CompositionChangedDefinition,
165
+ CompositionChangedEventName,
166
+ CompositionDeletedDefinition,
167
+ CompositionDeletedEventName,
168
+ CompositionPayloadSchema,
169
+ CompositionPublishedDefinition,
170
+ CompositionPublishedEventName,
171
+ ManifestPublishedDefinition,
172
+ ManifestPublishedEventName,
173
+ definition,
174
+ isDefinition
175
+ };
package/dist/index.js CHANGED
@@ -1 +1,212 @@
1
- "use strict";var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var y=(e,i)=>{for(var p in i)a(e,p,{get:i[p],enumerable:!0})},j=(e,i,p,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let m of g(i))!b.call(e,m)&&m!==p&&a(e,m,{get:()=>i[m],enumerable:!(c=u(i,m))||c.enumerable});return e};var C=e=>j(a({},"__esModule",{value:!0}),e);var S={};y(S,{CompositionChangedDefinition:()=>h,CompositionChangedEventName:()=>D,CompositionDeletedDefinition:()=>d,CompositionDeletedEventName:()=>P,CompositionPayloadSchema:()=>r,CompositionPublishedDefinition:()=>f,CompositionPublishedEventName:()=>T,ManifestPublishedDefinition:()=>l,ManifestPublishedEventName:()=>w,definition:()=>n,isDefinition:()=>x});module.exports=C(S);var o=require("zod"),r=o.z.object({id:o.z.string(),slug:o.z.string().optional(),project_map:o.z.object({node:o.z.object({path:o.z.string()})}).optional(),state:o.z.number(),name:o.z.string(),project:o.z.object({id:o.z.string(),url:o.z.string()}),user:o.z.object({name:o.z.string(),email:o.z.string()}),edit_url:o.z.string()});var x=e=>Object.hasOwn(e,"_definition")&&e._definition,n=(e,i)=>({...e,_definition:!0,example:i});var h=n({event:"composition.changed",name:"Composition Changed",description:"Triggers when a composition has been changed.",schema:r},{id:"id of composition",name:"name of composition",slug:"slug of composition",project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"},state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project_map:{node:{path:"path that this composition is associated with"}},edit_url:"link to edit this composition"}),D=h.event;var t=require("zod");var d=n({event:"composition.deleted",name:"Composition Deleted",description:"Triggers when a composition has been deleted.",schema:t.z.object({id:t.z.string(),state:t.z.number().optional(),user:t.z.object({name:t.z.string(),email:t.z.string()}),project:t.z.object({id:t.z.string(),url:t.z.string()})})},{id:"id of composition",state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"}}),P=d.event;var f=n({event:"composition.published",name:"Composition Published",description:"Triggers when a composition has been published.",schema:r},{id:"id of composition",name:"name of composition",slug:"slug of composition",project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"},state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project_map:{node:{path:"path that this composition is associated with"}},edit_url:"link to edit this composition"}),T=f.event;var s=require("zod");var l=n({event:"manifest.published",name:"Manifest Published",description:"Triggers when a manifest has been published.",schema:s.z.object({timestamp:s.z.number(),site:s.z.object({name:s.z.string()}),user:s.z.object({name:s.z.string(),email:s.z.string()})})},{timestamp:1667425322407,site:{name:"My Site"},user:{email:"email of the user who performed this action",name:"name of the user who performed this action"}}),w=l.event;0&&(module.exports={CompositionChangedDefinition,CompositionChangedEventName,CompositionDeletedDefinition,CompositionDeletedEventName,CompositionPayloadSchema,CompositionPublishedDefinition,CompositionPublishedEventName,ManifestPublishedDefinition,ManifestPublishedEventName,definition,isDefinition});
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ CompositionChangedDefinition: () => CompositionChangedDefinition,
24
+ CompositionChangedEventName: () => CompositionChangedEventName,
25
+ CompositionDeletedDefinition: () => CompositionDeletedDefinition,
26
+ CompositionDeletedEventName: () => CompositionDeletedEventName,
27
+ CompositionPayloadSchema: () => CompositionPayloadSchema,
28
+ CompositionPublishedDefinition: () => CompositionPublishedDefinition,
29
+ CompositionPublishedEventName: () => CompositionPublishedEventName,
30
+ ManifestPublishedDefinition: () => ManifestPublishedDefinition,
31
+ ManifestPublishedEventName: () => ManifestPublishedEventName,
32
+ definition: () => definition,
33
+ isDefinition: () => isDefinition
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+
37
+ // src/composition/common.ts
38
+ var import_zod = require("zod");
39
+ var CompositionPayloadSchema = import_zod.z.object({
40
+ id: import_zod.z.string(),
41
+ slug: import_zod.z.string().optional(),
42
+ project_map: import_zod.z.object({
43
+ node: import_zod.z.object({
44
+ path: import_zod.z.string()
45
+ })
46
+ }).optional(),
47
+ state: import_zod.z.number(),
48
+ name: import_zod.z.string(),
49
+ project: import_zod.z.object({
50
+ id: import_zod.z.string(),
51
+ url: import_zod.z.string()
52
+ }),
53
+ user: import_zod.z.object({
54
+ name: import_zod.z.string(),
55
+ email: import_zod.z.string()
56
+ }),
57
+ edit_url: import_zod.z.string()
58
+ });
59
+
60
+ // src/definition.ts
61
+ var isDefinition = (obj) => {
62
+ return Object.hasOwn(obj, "_definition") && obj["_definition"];
63
+ };
64
+ var definition = (options, example) => {
65
+ return {
66
+ ...options,
67
+ _definition: true,
68
+ example
69
+ };
70
+ };
71
+
72
+ // src/composition/composition.changed.ts
73
+ var CompositionChangedDefinition = definition(
74
+ {
75
+ event: "composition.changed",
76
+ name: "Composition Changed",
77
+ description: "Triggers when a composition has been changed.",
78
+ schema: CompositionPayloadSchema
79
+ },
80
+ {
81
+ id: "id of composition",
82
+ name: "name of composition",
83
+ slug: "slug of composition",
84
+ project: {
85
+ id: "id of the project this composition belongs to",
86
+ url: "link to project this composition belongs to"
87
+ },
88
+ state: 0,
89
+ user: {
90
+ email: "email of the user who performed this action",
91
+ name: "name of the user who performed this action"
92
+ },
93
+ project_map: {
94
+ node: {
95
+ path: "path that this composition is associated with"
96
+ }
97
+ },
98
+ edit_url: "link to edit this composition"
99
+ }
100
+ );
101
+ var CompositionChangedEventName = CompositionChangedDefinition["event"];
102
+
103
+ // src/composition/composition.deleted.ts
104
+ var import_zod2 = require("zod");
105
+ var CompositionDeletedDefinition = definition(
106
+ {
107
+ event: "composition.deleted",
108
+ name: "Composition Deleted",
109
+ description: "Triggers when a composition has been deleted.",
110
+ schema: import_zod2.z.object({
111
+ id: import_zod2.z.string(),
112
+ state: import_zod2.z.number().optional(),
113
+ user: import_zod2.z.object({
114
+ name: import_zod2.z.string(),
115
+ email: import_zod2.z.string()
116
+ }),
117
+ project: import_zod2.z.object({
118
+ id: import_zod2.z.string(),
119
+ url: import_zod2.z.string()
120
+ })
121
+ })
122
+ },
123
+ {
124
+ id: "id of composition",
125
+ state: 0,
126
+ user: {
127
+ email: "email of the user who performed this action",
128
+ name: "name of the user who performed this action"
129
+ },
130
+ project: {
131
+ id: "id of the project this composition belongs to",
132
+ url: "link to project this composition belongs to"
133
+ }
134
+ }
135
+ );
136
+ var CompositionDeletedEventName = CompositionDeletedDefinition["event"];
137
+
138
+ // src/composition/composition.published.ts
139
+ var CompositionPublishedDefinition = definition(
140
+ {
141
+ event: "composition.published",
142
+ name: "Composition Published",
143
+ description: "Triggers when a composition has been published.",
144
+ schema: CompositionPayloadSchema
145
+ },
146
+ {
147
+ id: "id of composition",
148
+ name: "name of composition",
149
+ slug: "slug of composition",
150
+ project: {
151
+ id: "id of the project this composition belongs to",
152
+ url: "link to project this composition belongs to"
153
+ },
154
+ state: 0,
155
+ user: {
156
+ email: "email of the user who performed this action",
157
+ name: "name of the user who performed this action"
158
+ },
159
+ project_map: {
160
+ node: {
161
+ path: "path that this composition is associated with"
162
+ }
163
+ },
164
+ edit_url: "link to edit this composition"
165
+ }
166
+ );
167
+ var CompositionPublishedEventName = CompositionPublishedDefinition["event"];
168
+
169
+ // src/manifest/manifest.published.ts
170
+ var import_zod3 = require("zod");
171
+ var ManifestPublishedDefinition = definition(
172
+ {
173
+ event: "manifest.published",
174
+ name: "Manifest Published",
175
+ description: "Triggers when a manifest has been published.",
176
+ schema: import_zod3.z.object({
177
+ timestamp: import_zod3.z.number(),
178
+ site: import_zod3.z.object({
179
+ name: import_zod3.z.string()
180
+ }),
181
+ user: import_zod3.z.object({
182
+ name: import_zod3.z.string(),
183
+ email: import_zod3.z.string()
184
+ })
185
+ })
186
+ },
187
+ {
188
+ timestamp: 1667425322407,
189
+ site: {
190
+ name: "My Site"
191
+ },
192
+ user: {
193
+ email: "email of the user who performed this action",
194
+ name: "name of the user who performed this action"
195
+ }
196
+ }
197
+ );
198
+ var ManifestPublishedEventName = ManifestPublishedDefinition["event"];
199
+ // Annotate the CommonJS export names for ESM import in node:
200
+ 0 && (module.exports = {
201
+ CompositionChangedDefinition,
202
+ CompositionChangedEventName,
203
+ CompositionDeletedDefinition,
204
+ CompositionDeletedEventName,
205
+ CompositionPayloadSchema,
206
+ CompositionPublishedDefinition,
207
+ CompositionPublishedEventName,
208
+ ManifestPublishedDefinition,
209
+ ManifestPublishedEventName,
210
+ definition,
211
+ isDefinition
212
+ });
package/dist/index.mjs CHANGED
@@ -1 +1,175 @@
1
- import{z as o}from"zod";var s=o.object({id:o.string(),slug:o.string().optional(),project_map:o.object({node:o.object({path:o.string()})}).optional(),state:o.number(),name:o.string(),project:o.object({id:o.string(),url:o.string()}),user:o.object({name:o.string(),email:o.string()}),edit_url:o.string()});var f=n=>Object.hasOwn(n,"_definition")&&n._definition,i=(n,m)=>({...n,_definition:!0,example:m});var r=i({event:"composition.changed",name:"Composition Changed",description:"Triggers when a composition has been changed.",schema:s},{id:"id of composition",name:"name of composition",slug:"slug of composition",project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"},state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project_map:{node:{path:"path that this composition is associated with"}},edit_url:"link to edit this composition"}),b=r.event;import{z as e}from"zod";var p=i({event:"composition.deleted",name:"Composition Deleted",description:"Triggers when a composition has been deleted.",schema:e.object({id:e.string(),state:e.number().optional(),user:e.object({name:e.string(),email:e.string()}),project:e.object({id:e.string(),url:e.string()})})},{id:"id of composition",state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"}}),x=p.event;var a=i({event:"composition.published",name:"Composition Published",description:"Triggers when a composition has been published.",schema:s},{id:"id of composition",name:"name of composition",slug:"slug of composition",project:{id:"id of the project this composition belongs to",url:"link to project this composition belongs to"},state:0,user:{email:"email of the user who performed this action",name:"name of the user who performed this action"},project_map:{node:{path:"path that this composition is associated with"}},edit_url:"link to edit this composition"}),w=a.event;import{z as t}from"zod";var c=i({event:"manifest.published",name:"Manifest Published",description:"Triggers when a manifest has been published.",schema:t.object({timestamp:t.number(),site:t.object({name:t.string()}),user:t.object({name:t.string(),email:t.string()})})},{timestamp:1667425322407,site:{name:"My Site"},user:{email:"email of the user who performed this action",name:"name of the user who performed this action"}}),_=c.event;export{r as CompositionChangedDefinition,b as CompositionChangedEventName,p as CompositionDeletedDefinition,x as CompositionDeletedEventName,s as CompositionPayloadSchema,a as CompositionPublishedDefinition,w as CompositionPublishedEventName,c as ManifestPublishedDefinition,_ as ManifestPublishedEventName,i as definition,f as isDefinition};
1
+ // src/composition/common.ts
2
+ import { z } from "zod";
3
+ var CompositionPayloadSchema = z.object({
4
+ id: z.string(),
5
+ slug: z.string().optional(),
6
+ project_map: z.object({
7
+ node: z.object({
8
+ path: z.string()
9
+ })
10
+ }).optional(),
11
+ state: z.number(),
12
+ name: z.string(),
13
+ project: z.object({
14
+ id: z.string(),
15
+ url: z.string()
16
+ }),
17
+ user: z.object({
18
+ name: z.string(),
19
+ email: z.string()
20
+ }),
21
+ edit_url: z.string()
22
+ });
23
+
24
+ // src/definition.ts
25
+ var isDefinition = (obj) => {
26
+ return Object.hasOwn(obj, "_definition") && obj["_definition"];
27
+ };
28
+ var definition = (options, example) => {
29
+ return {
30
+ ...options,
31
+ _definition: true,
32
+ example
33
+ };
34
+ };
35
+
36
+ // src/composition/composition.changed.ts
37
+ var CompositionChangedDefinition = definition(
38
+ {
39
+ event: "composition.changed",
40
+ name: "Composition Changed",
41
+ description: "Triggers when a composition has been changed.",
42
+ schema: CompositionPayloadSchema
43
+ },
44
+ {
45
+ id: "id of composition",
46
+ name: "name of composition",
47
+ slug: "slug of composition",
48
+ project: {
49
+ id: "id of the project this composition belongs to",
50
+ url: "link to project this composition belongs to"
51
+ },
52
+ state: 0,
53
+ user: {
54
+ email: "email of the user who performed this action",
55
+ name: "name of the user who performed this action"
56
+ },
57
+ project_map: {
58
+ node: {
59
+ path: "path that this composition is associated with"
60
+ }
61
+ },
62
+ edit_url: "link to edit this composition"
63
+ }
64
+ );
65
+ var CompositionChangedEventName = CompositionChangedDefinition["event"];
66
+
67
+ // src/composition/composition.deleted.ts
68
+ import { z as z2 } from "zod";
69
+ var CompositionDeletedDefinition = definition(
70
+ {
71
+ event: "composition.deleted",
72
+ name: "Composition Deleted",
73
+ description: "Triggers when a composition has been deleted.",
74
+ schema: z2.object({
75
+ id: z2.string(),
76
+ state: z2.number().optional(),
77
+ user: z2.object({
78
+ name: z2.string(),
79
+ email: z2.string()
80
+ }),
81
+ project: z2.object({
82
+ id: z2.string(),
83
+ url: z2.string()
84
+ })
85
+ })
86
+ },
87
+ {
88
+ id: "id of composition",
89
+ state: 0,
90
+ user: {
91
+ email: "email of the user who performed this action",
92
+ name: "name of the user who performed this action"
93
+ },
94
+ project: {
95
+ id: "id of the project this composition belongs to",
96
+ url: "link to project this composition belongs to"
97
+ }
98
+ }
99
+ );
100
+ var CompositionDeletedEventName = CompositionDeletedDefinition["event"];
101
+
102
+ // src/composition/composition.published.ts
103
+ var CompositionPublishedDefinition = definition(
104
+ {
105
+ event: "composition.published",
106
+ name: "Composition Published",
107
+ description: "Triggers when a composition has been published.",
108
+ schema: CompositionPayloadSchema
109
+ },
110
+ {
111
+ id: "id of composition",
112
+ name: "name of composition",
113
+ slug: "slug of composition",
114
+ project: {
115
+ id: "id of the project this composition belongs to",
116
+ url: "link to project this composition belongs to"
117
+ },
118
+ state: 0,
119
+ user: {
120
+ email: "email of the user who performed this action",
121
+ name: "name of the user who performed this action"
122
+ },
123
+ project_map: {
124
+ node: {
125
+ path: "path that this composition is associated with"
126
+ }
127
+ },
128
+ edit_url: "link to edit this composition"
129
+ }
130
+ );
131
+ var CompositionPublishedEventName = CompositionPublishedDefinition["event"];
132
+
133
+ // src/manifest/manifest.published.ts
134
+ import { z as z3 } from "zod";
135
+ var ManifestPublishedDefinition = definition(
136
+ {
137
+ event: "manifest.published",
138
+ name: "Manifest Published",
139
+ description: "Triggers when a manifest has been published.",
140
+ schema: z3.object({
141
+ timestamp: z3.number(),
142
+ site: z3.object({
143
+ name: z3.string()
144
+ }),
145
+ user: z3.object({
146
+ name: z3.string(),
147
+ email: z3.string()
148
+ })
149
+ })
150
+ },
151
+ {
152
+ timestamp: 1667425322407,
153
+ site: {
154
+ name: "My Site"
155
+ },
156
+ user: {
157
+ email: "email of the user who performed this action",
158
+ name: "name of the user who performed this action"
159
+ }
160
+ }
161
+ );
162
+ var ManifestPublishedEventName = ManifestPublishedDefinition["event"];
163
+ export {
164
+ CompositionChangedDefinition,
165
+ CompositionChangedEventName,
166
+ CompositionDeletedDefinition,
167
+ CompositionDeletedEventName,
168
+ CompositionPayloadSchema,
169
+ CompositionPublishedDefinition,
170
+ CompositionPublishedEventName,
171
+ ManifestPublishedDefinition,
172
+ ManifestPublishedEventName,
173
+ definition,
174
+ isDefinition
175
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/webhooks",
3
- "version": "17.7.1-alpha.140+80ab6baf9",
3
+ "version": "17.7.1-alpha.169+522807b78",
4
4
  "description": "Uniform Webhooks",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "types": "./dist/index.d.ts",
16
16
  "sideEffects": false,
17
17
  "scripts": {
18
- "build": "tsup --minify",
18
+ "build": "tsup",
19
19
  "dev": "tsup --watch",
20
20
  "clean": "rimraf dist",
21
21
  "test": "jest --maxWorkers=1 --passWithNoTests",
@@ -36,5 +36,5 @@
36
36
  "svix": "^0.74.1",
37
37
  "zod-to-json-schema": "3.20.1"
38
38
  },
39
- "gitHead": "80ab6baf9edea6b520738bd3dff5c6afc882bf77"
39
+ "gitHead": "522807b78c5e15b076bd07b4a1a4124de07dcb5b"
40
40
  }