@uniformdev/webhooks 17.4.1-alpha.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/LICENSE.txt ADDED
@@ -0,0 +1,2 @@
1
+ © 2022 Uniform Systems, Inc. All Rights Reserved.
2
+ See details of Uniform Systems, Inc. Master Subscription Agreement here: https://uniform.dev/eula
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ Webhook payload definitons for Uniform
2
+
3
+ part of the [Uniform Platform](https://uniform.app). See our [documentation](https://docs.uniform.app) for more details.
@@ -0,0 +1,360 @@
1
+ import { ZodTypeAny, z } from 'zod';
2
+
3
+ declare type DefinitionOptions<TSchema> = {
4
+ event: string;
5
+ name: string;
6
+ description: string;
7
+ schema: TSchema;
8
+ };
9
+ declare type Definition<TSchema extends ZodTypeAny = ZodTypeAny> = DefinitionOptions<TSchema> & {
10
+ _definition: true;
11
+ example: z.TypeOf<TSchema>;
12
+ };
13
+ declare const isDefinition: (obj: any) => obj is Definition<z.ZodTypeAny>;
14
+ declare const definition: <TSchema extends z.ZodTypeAny = z.ZodTypeAny>(options: DefinitionOptions<TSchema>, example: z.TypeOf<TSchema>) => Definition<TSchema>;
15
+
16
+ declare const ManifestPublishedDefinition: Definition<z.ZodObject<{
17
+ timestamp: z.ZodNumber;
18
+ site: z.ZodObject<{
19
+ name: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ name: string;
22
+ }, {
23
+ name: string;
24
+ }>;
25
+ user: z.ZodObject<{
26
+ name: z.ZodString;
27
+ email: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ name: string;
30
+ email: string;
31
+ }, {
32
+ name: string;
33
+ email: string;
34
+ }>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ timestamp: number;
37
+ site: {
38
+ name: string;
39
+ };
40
+ user: {
41
+ name: string;
42
+ email: string;
43
+ };
44
+ }, {
45
+ timestamp: number;
46
+ site: {
47
+ name: string;
48
+ };
49
+ user: {
50
+ name: string;
51
+ email: string;
52
+ };
53
+ }>>;
54
+ declare type ManifestPublishedPayload = z.infer<typeof ManifestPublishedDefinition['schema']>;
55
+ declare const ManifestPublishedEventName: string;
56
+
57
+ declare const CompositionPayloadSchema: z.ZodObject<{
58
+ id: z.ZodString;
59
+ slug: z.ZodOptional<z.ZodString>;
60
+ project_map: z.ZodOptional<z.ZodObject<{
61
+ node: z.ZodObject<{
62
+ path: z.ZodString;
63
+ }, "strip", z.ZodTypeAny, {
64
+ path: string;
65
+ }, {
66
+ path: string;
67
+ }>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ node: {
70
+ path: string;
71
+ };
72
+ }, {
73
+ node: {
74
+ path: string;
75
+ };
76
+ }>>;
77
+ state: z.ZodNumber;
78
+ name: z.ZodString;
79
+ project: z.ZodObject<{
80
+ id: z.ZodString;
81
+ url: z.ZodString;
82
+ }, "strip", z.ZodTypeAny, {
83
+ id: string;
84
+ url: string;
85
+ }, {
86
+ id: string;
87
+ url: string;
88
+ }>;
89
+ user: z.ZodObject<{
90
+ name: z.ZodString;
91
+ email: z.ZodString;
92
+ }, "strip", z.ZodTypeAny, {
93
+ name: string;
94
+ email: string;
95
+ }, {
96
+ name: string;
97
+ email: string;
98
+ }>;
99
+ edit_url: z.ZodString;
100
+ }, "strip", z.ZodTypeAny, {
101
+ slug?: string | undefined;
102
+ project_map?: {
103
+ node: {
104
+ path: string;
105
+ };
106
+ } | undefined;
107
+ name: string;
108
+ user: {
109
+ name: string;
110
+ email: string;
111
+ };
112
+ id: string;
113
+ state: number;
114
+ project: {
115
+ id: string;
116
+ url: string;
117
+ };
118
+ edit_url: string;
119
+ }, {
120
+ slug?: string | undefined;
121
+ project_map?: {
122
+ node: {
123
+ path: string;
124
+ };
125
+ } | undefined;
126
+ name: string;
127
+ user: {
128
+ name: string;
129
+ email: string;
130
+ };
131
+ id: string;
132
+ state: number;
133
+ project: {
134
+ id: string;
135
+ url: string;
136
+ };
137
+ edit_url: string;
138
+ }>;
139
+ declare type CompositionPayload = z.infer<typeof CompositionPayloadSchema>;
140
+
141
+ declare const CompositionChangedDefinition: Definition<z.ZodObject<{
142
+ id: z.ZodString;
143
+ slug: z.ZodOptional<z.ZodString>;
144
+ project_map: z.ZodOptional<z.ZodObject<{
145
+ node: z.ZodObject<{
146
+ path: z.ZodString;
147
+ }, "strip", z.ZodTypeAny, {
148
+ path: string;
149
+ }, {
150
+ path: string;
151
+ }>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ node: {
154
+ path: string;
155
+ };
156
+ }, {
157
+ node: {
158
+ path: string;
159
+ };
160
+ }>>;
161
+ state: z.ZodNumber;
162
+ name: z.ZodString;
163
+ project: z.ZodObject<{
164
+ id: z.ZodString;
165
+ url: z.ZodString;
166
+ }, "strip", z.ZodTypeAny, {
167
+ id: string;
168
+ url: string;
169
+ }, {
170
+ id: string;
171
+ url: string;
172
+ }>;
173
+ user: z.ZodObject<{
174
+ name: z.ZodString;
175
+ email: z.ZodString;
176
+ }, "strip", z.ZodTypeAny, {
177
+ name: string;
178
+ email: string;
179
+ }, {
180
+ name: string;
181
+ email: string;
182
+ }>;
183
+ edit_url: z.ZodString;
184
+ }, "strip", z.ZodTypeAny, {
185
+ slug?: string | undefined;
186
+ project_map?: {
187
+ node: {
188
+ path: string;
189
+ };
190
+ } | undefined;
191
+ name: string;
192
+ user: {
193
+ name: string;
194
+ email: string;
195
+ };
196
+ id: string;
197
+ state: number;
198
+ project: {
199
+ id: string;
200
+ url: string;
201
+ };
202
+ edit_url: string;
203
+ }, {
204
+ slug?: string | undefined;
205
+ project_map?: {
206
+ node: {
207
+ path: string;
208
+ };
209
+ } | undefined;
210
+ name: string;
211
+ user: {
212
+ name: string;
213
+ email: string;
214
+ };
215
+ id: string;
216
+ state: number;
217
+ project: {
218
+ id: string;
219
+ url: string;
220
+ };
221
+ edit_url: string;
222
+ }>>;
223
+ declare type CompositionChangedPayload = z.infer<typeof CompositionChangedDefinition['schema']>;
224
+ declare const CompositionChangedEventName: string;
225
+
226
+ declare const CompositionDeletedDefinition: Definition<z.ZodObject<{
227
+ id: z.ZodString;
228
+ state: z.ZodOptional<z.ZodNumber>;
229
+ user: z.ZodObject<{
230
+ name: z.ZodString;
231
+ email: z.ZodString;
232
+ }, "strip", z.ZodTypeAny, {
233
+ name: string;
234
+ email: string;
235
+ }, {
236
+ name: string;
237
+ email: string;
238
+ }>;
239
+ project: z.ZodObject<{
240
+ id: z.ZodString;
241
+ url: z.ZodString;
242
+ }, "strip", z.ZodTypeAny, {
243
+ id: string;
244
+ url: string;
245
+ }, {
246
+ id: string;
247
+ url: string;
248
+ }>;
249
+ }, "strip", z.ZodTypeAny, {
250
+ state?: number | undefined;
251
+ user: {
252
+ name: string;
253
+ email: string;
254
+ };
255
+ id: string;
256
+ project: {
257
+ id: string;
258
+ url: string;
259
+ };
260
+ }, {
261
+ state?: number | undefined;
262
+ user: {
263
+ name: string;
264
+ email: string;
265
+ };
266
+ id: string;
267
+ project: {
268
+ id: string;
269
+ url: string;
270
+ };
271
+ }>>;
272
+ declare type CompositionDeletedPayload = z.infer<typeof CompositionDeletedDefinition['schema']>;
273
+ declare const CompositionDeletedEventName: string;
274
+
275
+ declare const CompositionPublishedDefinition: Definition<z.ZodObject<{
276
+ id: z.ZodString;
277
+ slug: z.ZodOptional<z.ZodString>;
278
+ project_map: z.ZodOptional<z.ZodObject<{
279
+ node: z.ZodObject<{
280
+ path: z.ZodString;
281
+ }, "strip", z.ZodTypeAny, {
282
+ path: string;
283
+ }, {
284
+ path: string;
285
+ }>;
286
+ }, "strip", z.ZodTypeAny, {
287
+ node: {
288
+ path: string;
289
+ };
290
+ }, {
291
+ node: {
292
+ path: string;
293
+ };
294
+ }>>;
295
+ state: z.ZodNumber;
296
+ name: z.ZodString;
297
+ project: z.ZodObject<{
298
+ id: z.ZodString;
299
+ url: z.ZodString;
300
+ }, "strip", z.ZodTypeAny, {
301
+ id: string;
302
+ url: string;
303
+ }, {
304
+ id: string;
305
+ url: string;
306
+ }>;
307
+ user: z.ZodObject<{
308
+ name: z.ZodString;
309
+ email: z.ZodString;
310
+ }, "strip", z.ZodTypeAny, {
311
+ name: string;
312
+ email: string;
313
+ }, {
314
+ name: string;
315
+ email: string;
316
+ }>;
317
+ edit_url: z.ZodString;
318
+ }, "strip", z.ZodTypeAny, {
319
+ slug?: string | undefined;
320
+ project_map?: {
321
+ node: {
322
+ path: string;
323
+ };
324
+ } | undefined;
325
+ name: string;
326
+ user: {
327
+ name: string;
328
+ email: string;
329
+ };
330
+ id: string;
331
+ state: number;
332
+ project: {
333
+ id: string;
334
+ url: string;
335
+ };
336
+ edit_url: string;
337
+ }, {
338
+ slug?: string | undefined;
339
+ project_map?: {
340
+ node: {
341
+ path: string;
342
+ };
343
+ } | undefined;
344
+ name: string;
345
+ user: {
346
+ name: string;
347
+ email: string;
348
+ };
349
+ id: string;
350
+ state: number;
351
+ project: {
352
+ id: string;
353
+ url: string;
354
+ };
355
+ edit_url: string;
356
+ }>>;
357
+ declare type CompositionPublishedPayload = z.infer<typeof CompositionPublishedDefinition['schema']>;
358
+ declare const CompositionPublishedEventName: string;
359
+
360
+ export { CompositionChangedDefinition, CompositionChangedEventName, CompositionChangedPayload, CompositionDeletedDefinition, CompositionDeletedEventName, CompositionDeletedPayload, CompositionPayload, CompositionPayloadSchema, CompositionPublishedDefinition, CompositionPublishedEventName, CompositionPublishedPayload, Definition, DefinitionOptions, ManifestPublishedDefinition, ManifestPublishedEventName, ManifestPublishedPayload, definition, isDefinition };
@@ -0,0 +1 @@
1
+ import{z as t}from"zod";var h=n=>Object.hasOwn(n,"_definition")&&n._definition,i=(n,m)=>({...n,_definition:!0,example:m});var r=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"}}),u=r.event;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 p=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"}),x=p.event;import{z as e}from"zod";var a=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"}}),w=a.event;var c=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"}),_=c.event;export{p as CompositionChangedDefinition,x as CompositionChangedEventName,a as CompositionDeletedDefinition,w as CompositionDeletedEventName,s as CompositionPayloadSchema,c as CompositionPublishedDefinition,_ as CompositionPublishedEventName,r as ManifestPublishedDefinition,u as ManifestPublishedEventName,i as definition,h as isDefinition};
package/dist/index.js ADDED
@@ -0,0 +1 @@
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:()=>d,CompositionChangedEventName:()=>P,CompositionDeletedDefinition:()=>f,CompositionDeletedEventName:()=>T,CompositionPayloadSchema:()=>r,CompositionPublishedDefinition:()=>l,CompositionPublishedEventName:()=>w,ManifestPublishedDefinition:()=>h,ManifestPublishedEventName:()=>D,definition:()=>n,isDefinition:()=>x});module.exports=C(S);var s=require("zod");var x=e=>Object.hasOwn(e,"_definition")&&e._definition,n=(e,i)=>({...e,_definition:!0,example:i});var h=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"}}),D=h.event;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 d=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"}),P=d.event;var t=require("zod");var f=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"}}),T=f.event;var l=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"}),w=l.event;0&&(module.exports={CompositionChangedDefinition,CompositionChangedEventName,CompositionDeletedDefinition,CompositionDeletedEventName,CompositionPayloadSchema,CompositionPublishedDefinition,CompositionPublishedEventName,ManifestPublishedDefinition,ManifestPublishedEventName,definition,isDefinition});
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{z as t}from"zod";var h=n=>Object.hasOwn(n,"_definition")&&n._definition,i=(n,m)=>({...n,_definition:!0,example:m});var r=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"}}),u=r.event;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 p=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"}),x=p.event;import{z as e}from"zod";var a=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"}}),w=a.event;var c=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"}),_=c.event;export{p as CompositionChangedDefinition,x as CompositionChangedEventName,a as CompositionDeletedDefinition,w as CompositionDeletedEventName,s as CompositionPayloadSchema,c as CompositionPublishedDefinition,_ as CompositionPublishedEventName,r as ManifestPublishedDefinition,u as ManifestPublishedEventName,i as definition,h as isDefinition};
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@uniformdev/webhooks",
3
+ "version": "17.4.1-alpha.0+59ecbc3",
4
+ "description": "Uniform Webhooks",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.esm.js",
8
+ "exports": {
9
+ "import": {
10
+ "node": "./dist/index.mjs",
11
+ "default": "./dist/index.esm.js"
12
+ },
13
+ "require": "./dist/index.js"
14
+ },
15
+ "types": "./dist/index.d.ts",
16
+ "sideEffects": false,
17
+ "scripts": {
18
+ "build": "tsup --minify",
19
+ "dev": "tsup --watch",
20
+ "clean": "rimraf dist",
21
+ "test": "jest --maxWorkers=1 --passWithNoTests",
22
+ "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
23
+ "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
24
+ "migrate:svix": "tsx ./scripts/sync-svix-schemas.ts",
25
+ "postinstall": "run-s migrate:svix"
26
+ },
27
+ "files": [
28
+ "/dist"
29
+ ],
30
+ "dependencies": {
31
+ "zod": "3.19.1"
32
+ },
33
+ "devDependencies": {
34
+ "dotenv": "^16.0.3",
35
+ "npm-run-all": "4.1.5",
36
+ "svix": "^0.69.0",
37
+ "zod-to-json-schema": "3.18.1"
38
+ },
39
+ "gitHead": "59ecbc39bc240b9e2e5312a7cc0a5bb565508612"
40
+ }