@contractspec/lib.files 1.56.1 → 1.58.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.
Files changed (44) hide show
  1. package/dist/contracts/index.d.ts +1080 -1086
  2. package/dist/contracts/index.d.ts.map +1 -1
  3. package/dist/contracts/index.js +575 -854
  4. package/dist/docs/files.docblock.d.ts +2 -1
  5. package/dist/docs/files.docblock.d.ts.map +1 -0
  6. package/dist/docs/files.docblock.js +17 -22
  7. package/dist/docs/index.d.ts +2 -1
  8. package/dist/docs/index.d.ts.map +1 -0
  9. package/dist/docs/index.js +66 -1
  10. package/dist/entities/index.d.ts +134 -139
  11. package/dist/entities/index.d.ts.map +1 -1
  12. package/dist/entities/index.js +228 -257
  13. package/dist/events.d.ts +357 -363
  14. package/dist/events.d.ts.map +1 -1
  15. package/dist/events.js +217 -400
  16. package/dist/files.capability.d.ts +2 -7
  17. package/dist/files.capability.d.ts.map +1 -1
  18. package/dist/files.capability.js +29 -25
  19. package/dist/files.feature.d.ts +1 -7
  20. package/dist/files.feature.d.ts.map +1 -1
  21. package/dist/files.feature.js +50 -131
  22. package/dist/index.d.ts +7 -6
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +1411 -8
  25. package/dist/node/contracts/index.js +576 -0
  26. package/dist/node/docs/files.docblock.js +65 -0
  27. package/dist/node/docs/index.js +65 -0
  28. package/dist/node/entities/index.js +235 -0
  29. package/dist/node/events.js +219 -0
  30. package/dist/node/files.capability.js +28 -0
  31. package/dist/node/files.feature.js +51 -0
  32. package/dist/node/index.js +1410 -0
  33. package/dist/node/storage/index.js +268 -0
  34. package/dist/storage/index.d.ts +163 -166
  35. package/dist/storage/index.d.ts.map +1 -1
  36. package/dist/storage/index.js +266 -266
  37. package/package.json +104 -30
  38. package/dist/contracts/index.js.map +0 -1
  39. package/dist/docs/files.docblock.js.map +0 -1
  40. package/dist/entities/index.js.map +0 -1
  41. package/dist/events.js.map +0 -1
  42. package/dist/files.capability.js.map +0 -1
  43. package/dist/files.feature.js.map +0 -1
  44. package/dist/storage/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;;;;cA6Ha,mBAAiB,4BAAA,CAAA,oCAAA;EAAjB,MAAA,EAAA;IAUX,IAAA,EAAA,yBAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;EAV4B,CAAA;EAAA,IAAA,EAAA;IAejB,IAAA,qCAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;IAV2B,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAehB,CAAA;EAUX,KAAA,EAAA;;;;;;;;CAV2B,CAAA,CAAA;;AAe7B;;cA9Ba,kBAAgB,4BAAA,CAAA,oCAAA;;UAU3B,yBAAA,CAAA;;;;;;EAoBkC,CAAA;EAAA,OAAA,EAAA;IAevB,IAAA,qCAUX,CAAA,OAAA,EAAA,OAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;EAVkC,CAAA;CAAA,CAAA,CAAA;AAepC;;;cA7Ca,kBAAgB,4BAAA,CAAA,oCAAA;;UAU3B,yBAAA,CAAA;;;;IAmCkC,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAevB,CAAA;EAUX,eAAA,EAAA;;;;;;;;EAVoC,SAAA,EAAA;IAAA,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAezB,UAAA,EAAA,IAAA;EAUX,CAAA;;;;;;;;;AAKW,cA3EA,uBAoFZ,EApFmC,4BAAA,CAAA,SAoFnC,2BApFmC,WAoFnC,CAAA;EAAA,MAAA,EAAA;UA1EC,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,yBAAuB,4BAAA,CAAA,oCAAA;;UAUlC,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,yBAAuB,4BAAA,CAAA,oCAAA;;UAUlC,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,2BAAyB,4BAAA,CAAA,oCAAA;;UAUpC,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,6BAA2B,4BAAA,CAAA,oCAAA;;UAUtC,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;cAKW;;;YASZ,yBAAA,CAAA"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AA0HA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAU5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;GAU3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;GAU3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;GAUlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;GAUpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;GAUtC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAStB,CAAC"}
package/dist/events.js CHANGED
@@ -1,403 +1,220 @@
1
+ // @bun
2
+ // src/events.ts
1
3
  import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
4
  import { defineEvent } from "@contractspec/lib.contracts";
3
-
4
- //#region src/events.ts
5
- const FileUploadedPayload = defineSchemaModel({
6
- name: "FileUploadedEventPayload",
7
- description: "Payload when a file is uploaded",
8
- fields: {
9
- fileId: {
10
- type: ScalarTypeEnum.String_unsecure(),
11
- isOptional: false
12
- },
13
- name: {
14
- type: ScalarTypeEnum.String_unsecure(),
15
- isOptional: false
16
- },
17
- mimeType: {
18
- type: ScalarTypeEnum.String_unsecure(),
19
- isOptional: false
20
- },
21
- size: {
22
- type: ScalarTypeEnum.Int_unsecure(),
23
- isOptional: false
24
- },
25
- storageProvider: {
26
- type: ScalarTypeEnum.String_unsecure(),
27
- isOptional: false
28
- },
29
- ownerId: {
30
- type: ScalarTypeEnum.String_unsecure(),
31
- isOptional: false
32
- },
33
- orgId: {
34
- type: ScalarTypeEnum.String_unsecure(),
35
- isOptional: true
36
- },
37
- uploadedAt: {
38
- type: ScalarTypeEnum.DateTime(),
39
- isOptional: false
40
- }
41
- }
42
- });
43
- const FileUpdatedPayload = defineSchemaModel({
44
- name: "FileUpdatedEventPayload",
45
- description: "Payload when a file is updated",
46
- fields: {
47
- fileId: {
48
- type: ScalarTypeEnum.String_unsecure(),
49
- isOptional: false
50
- },
51
- name: {
52
- type: ScalarTypeEnum.String_unsecure(),
53
- isOptional: false
54
- },
55
- changes: {
56
- type: ScalarTypeEnum.JSON(),
57
- isOptional: false
58
- },
59
- updatedBy: {
60
- type: ScalarTypeEnum.String_unsecure(),
61
- isOptional: true
62
- },
63
- updatedAt: {
64
- type: ScalarTypeEnum.DateTime(),
65
- isOptional: false
66
- }
67
- }
68
- });
69
- const FileDeletedPayload = defineSchemaModel({
70
- name: "FileDeletedEventPayload",
71
- description: "Payload when a file is deleted",
72
- fields: {
73
- fileId: {
74
- type: ScalarTypeEnum.String_unsecure(),
75
- isOptional: false
76
- },
77
- name: {
78
- type: ScalarTypeEnum.String_unsecure(),
79
- isOptional: false
80
- },
81
- storageProvider: {
82
- type: ScalarTypeEnum.String_unsecure(),
83
- isOptional: false
84
- },
85
- storagePath: {
86
- type: ScalarTypeEnum.String_unsecure(),
87
- isOptional: false
88
- },
89
- deletedBy: {
90
- type: ScalarTypeEnum.String_unsecure(),
91
- isOptional: true
92
- },
93
- deletedAt: {
94
- type: ScalarTypeEnum.DateTime(),
95
- isOptional: false
96
- }
97
- }
98
- });
99
- const FileVersionCreatedPayload = defineSchemaModel({
100
- name: "FileVersionCreatedEventPayload",
101
- description: "Payload when a file version is created",
102
- fields: {
103
- fileId: {
104
- type: ScalarTypeEnum.String_unsecure(),
105
- isOptional: false
106
- },
107
- versionId: {
108
- type: ScalarTypeEnum.String_unsecure(),
109
- isOptional: false
110
- },
111
- version: {
112
- type: ScalarTypeEnum.String_unsecure(),
113
- isOptional: false
114
- },
115
- size: {
116
- type: ScalarTypeEnum.Int_unsecure(),
117
- isOptional: false
118
- },
119
- createdBy: {
120
- type: ScalarTypeEnum.String_unsecure(),
121
- isOptional: false
122
- },
123
- comment: {
124
- type: ScalarTypeEnum.String_unsecure(),
125
- isOptional: true
126
- },
127
- createdAt: {
128
- type: ScalarTypeEnum.DateTime(),
129
- isOptional: false
130
- }
131
- }
132
- });
133
- const AttachmentAttachedPayload = defineSchemaModel({
134
- name: "AttachmentAttachedEventPayload",
135
- description: "Payload when a file is attached to an entity",
136
- fields: {
137
- attachmentId: {
138
- type: ScalarTypeEnum.String_unsecure(),
139
- isOptional: false
140
- },
141
- fileId: {
142
- type: ScalarTypeEnum.String_unsecure(),
143
- isOptional: false
144
- },
145
- entityType: {
146
- type: ScalarTypeEnum.String_unsecure(),
147
- isOptional: false
148
- },
149
- entityId: {
150
- type: ScalarTypeEnum.String_unsecure(),
151
- isOptional: false
152
- },
153
- attachmentType: {
154
- type: ScalarTypeEnum.String_unsecure(),
155
- isOptional: true
156
- },
157
- attachedBy: {
158
- type: ScalarTypeEnum.String_unsecure(),
159
- isOptional: false
160
- },
161
- attachedAt: {
162
- type: ScalarTypeEnum.DateTime(),
163
- isOptional: false
164
- }
165
- }
166
- });
167
- const AttachmentDetachedPayload = defineSchemaModel({
168
- name: "AttachmentDetachedEventPayload",
169
- description: "Payload when a file is detached from an entity",
170
- fields: {
171
- attachmentId: {
172
- type: ScalarTypeEnum.String_unsecure(),
173
- isOptional: false
174
- },
175
- fileId: {
176
- type: ScalarTypeEnum.String_unsecure(),
177
- isOptional: false
178
- },
179
- entityType: {
180
- type: ScalarTypeEnum.String_unsecure(),
181
- isOptional: false
182
- },
183
- entityId: {
184
- type: ScalarTypeEnum.String_unsecure(),
185
- isOptional: false
186
- },
187
- detachedBy: {
188
- type: ScalarTypeEnum.String_unsecure(),
189
- isOptional: true
190
- },
191
- detachedAt: {
192
- type: ScalarTypeEnum.DateTime(),
193
- isOptional: false
194
- }
195
- }
196
- });
197
- const UploadSessionStartedPayload = defineSchemaModel({
198
- name: "UploadSessionStartedEventPayload",
199
- description: "Payload when an upload session starts",
200
- fields: {
201
- sessionId: {
202
- type: ScalarTypeEnum.String_unsecure(),
203
- isOptional: false
204
- },
205
- fileName: {
206
- type: ScalarTypeEnum.String_unsecure(),
207
- isOptional: false
208
- },
209
- mimeType: {
210
- type: ScalarTypeEnum.String_unsecure(),
211
- isOptional: false
212
- },
213
- totalSize: {
214
- type: ScalarTypeEnum.Int_unsecure(),
215
- isOptional: false
216
- },
217
- ownerId: {
218
- type: ScalarTypeEnum.String_unsecure(),
219
- isOptional: false
220
- },
221
- startedAt: {
222
- type: ScalarTypeEnum.DateTime(),
223
- isOptional: false
224
- }
225
- }
226
- });
227
- const UploadSessionCompletedPayload = defineSchemaModel({
228
- name: "UploadSessionCompletedEventPayload",
229
- description: "Payload when an upload session completes",
230
- fields: {
231
- sessionId: {
232
- type: ScalarTypeEnum.String_unsecure(),
233
- isOptional: false
234
- },
235
- fileId: {
236
- type: ScalarTypeEnum.String_unsecure(),
237
- isOptional: false
238
- },
239
- fileName: {
240
- type: ScalarTypeEnum.String_unsecure(),
241
- isOptional: false
242
- },
243
- size: {
244
- type: ScalarTypeEnum.Int_unsecure(),
245
- isOptional: false
246
- },
247
- completedAt: {
248
- type: ScalarTypeEnum.DateTime(),
249
- isOptional: false
250
- }
251
- }
252
- });
253
- /**
254
- * Emitted when a file is uploaded.
255
- */
256
- const FileUploadedEvent = defineEvent({
257
- meta: {
258
- key: "file.uploaded",
259
- version: "1.0.0",
260
- description: "A file has been uploaded.",
261
- stability: "stable",
262
- owners: ["@platform.files"],
263
- tags: ["files", "upload"]
264
- },
265
- payload: FileUploadedPayload
266
- });
267
- /**
268
- * Emitted when a file is updated.
269
- */
270
- const FileUpdatedEvent = defineEvent({
271
- meta: {
272
- key: "file.updated",
273
- version: "1.0.0",
274
- description: "A file has been updated.",
275
- stability: "stable",
276
- owners: ["@platform.files"],
277
- tags: ["files", "update"]
278
- },
279
- payload: FileUpdatedPayload
280
- });
281
- /**
282
- * Emitted when a file is deleted.
283
- */
284
- const FileDeletedEvent = defineEvent({
285
- meta: {
286
- key: "file.deleted",
287
- version: "1.0.0",
288
- description: "A file has been deleted.",
289
- stability: "stable",
290
- owners: ["@platform.files"],
291
- tags: ["files", "delete"]
292
- },
293
- payload: FileDeletedPayload
294
- });
295
- /**
296
- * Emitted when a file version is created.
297
- */
298
- const FileVersionCreatedEvent = defineEvent({
299
- meta: {
300
- key: "file.version_created",
301
- version: "1.0.0",
302
- description: "A new file version has been created.",
303
- stability: "stable",
304
- owners: ["@platform.files"],
305
- tags: [
306
- "files",
307
- "version",
308
- "create"
309
- ]
310
- },
311
- payload: FileVersionCreatedPayload
312
- });
313
- /**
314
- * Emitted when a file is attached to an entity.
315
- */
316
- const AttachmentAttachedEvent = defineEvent({
317
- meta: {
318
- key: "attachment.attached",
319
- version: "1.0.0",
320
- description: "A file has been attached to an entity.",
321
- stability: "stable",
322
- owners: ["@platform.files"],
323
- tags: [
324
- "files",
325
- "attachment",
326
- "attach"
327
- ]
328
- },
329
- payload: AttachmentAttachedPayload
330
- });
331
- /**
332
- * Emitted when a file is detached from an entity.
333
- */
334
- const AttachmentDetachedEvent = defineEvent({
335
- meta: {
336
- key: "attachment.detached",
337
- version: "1.0.0",
338
- description: "A file has been detached from an entity.",
339
- stability: "stable",
340
- owners: ["@platform.files"],
341
- tags: [
342
- "files",
343
- "attachment",
344
- "detach"
345
- ]
346
- },
347
- payload: AttachmentDetachedPayload
348
- });
349
- /**
350
- * Emitted when an upload session starts.
351
- */
352
- const UploadSessionStartedEvent = defineEvent({
353
- meta: {
354
- key: "upload.session_started",
355
- version: "1.0.0",
356
- description: "An upload session has started.",
357
- stability: "stable",
358
- owners: ["@platform.files"],
359
- tags: [
360
- "files",
361
- "upload",
362
- "session",
363
- "start"
364
- ]
365
- },
366
- payload: UploadSessionStartedPayload
367
- });
368
- /**
369
- * Emitted when an upload session completes.
370
- */
371
- const UploadSessionCompletedEvent = defineEvent({
372
- meta: {
373
- key: "upload.session_completed",
374
- version: "1.0.0",
375
- description: "An upload session has completed.",
376
- stability: "stable",
377
- owners: ["@platform.files"],
378
- tags: [
379
- "files",
380
- "upload",
381
- "session",
382
- "complete"
383
- ]
384
- },
385
- payload: UploadSessionCompletedPayload
386
- });
387
- /**
388
- * All file events.
389
- */
390
- const FileEvents = {
391
- FileUploadedEvent,
392
- FileUpdatedEvent,
393
- FileDeletedEvent,
394
- FileVersionCreatedEvent,
395
- AttachmentAttachedEvent,
396
- AttachmentDetachedEvent,
397
- UploadSessionStartedEvent,
398
- UploadSessionCompletedEvent
5
+ var FileUploadedPayload = defineSchemaModel({
6
+ name: "FileUploadedEventPayload",
7
+ description: "Payload when a file is uploaded",
8
+ fields: {
9
+ fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
12
+ size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
13
+ storageProvider: {
14
+ type: ScalarTypeEnum.String_unsecure(),
15
+ isOptional: false
16
+ },
17
+ ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
18
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
19
+ uploadedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
20
+ }
21
+ });
22
+ var FileUpdatedPayload = defineSchemaModel({
23
+ name: "FileUpdatedEventPayload",
24
+ description: "Payload when a file is updated",
25
+ fields: {
26
+ fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
27
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
28
+ changes: { type: ScalarTypeEnum.JSON(), isOptional: false },
29
+ updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
30
+ updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
31
+ }
32
+ });
33
+ var FileDeletedPayload = defineSchemaModel({
34
+ name: "FileDeletedEventPayload",
35
+ description: "Payload when a file is deleted",
36
+ fields: {
37
+ fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
39
+ storageProvider: {
40
+ type: ScalarTypeEnum.String_unsecure(),
41
+ isOptional: false
42
+ },
43
+ storagePath: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
44
+ deletedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
45
+ deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
46
+ }
47
+ });
48
+ var FileVersionCreatedPayload = defineSchemaModel({
49
+ name: "FileVersionCreatedEventPayload",
50
+ description: "Payload when a file version is created",
51
+ fields: {
52
+ fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
53
+ versionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
54
+ version: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
55
+ size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
56
+ createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
57
+ comment: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
58
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
59
+ }
60
+ });
61
+ var AttachmentAttachedPayload = defineSchemaModel({
62
+ name: "AttachmentAttachedEventPayload",
63
+ description: "Payload when a file is attached to an entity",
64
+ fields: {
65
+ attachmentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
66
+ fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
67
+ entityType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
68
+ entityId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
69
+ attachmentType: {
70
+ type: ScalarTypeEnum.String_unsecure(),
71
+ isOptional: true
72
+ },
73
+ attachedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
74
+ attachedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
75
+ }
76
+ });
77
+ var AttachmentDetachedPayload = defineSchemaModel({
78
+ name: "AttachmentDetachedEventPayload",
79
+ description: "Payload when a file is detached from an entity",
80
+ fields: {
81
+ attachmentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
82
+ fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
83
+ entityType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
84
+ entityId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
85
+ detachedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
86
+ detachedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
87
+ }
88
+ });
89
+ var UploadSessionStartedPayload = defineSchemaModel({
90
+ name: "UploadSessionStartedEventPayload",
91
+ description: "Payload when an upload session starts",
92
+ fields: {
93
+ sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
94
+ fileName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
95
+ mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
96
+ totalSize: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
97
+ ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
98
+ startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
99
+ }
100
+ });
101
+ var UploadSessionCompletedPayload = defineSchemaModel({
102
+ name: "UploadSessionCompletedEventPayload",
103
+ description: "Payload when an upload session completes",
104
+ fields: {
105
+ sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
106
+ fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
107
+ fileName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
108
+ size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
109
+ completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
110
+ }
111
+ });
112
+ var FileUploadedEvent = defineEvent({
113
+ meta: {
114
+ key: "file.uploaded",
115
+ version: "1.0.0",
116
+ description: "A file has been uploaded.",
117
+ stability: "stable",
118
+ owners: ["@platform.files"],
119
+ tags: ["files", "upload"]
120
+ },
121
+ payload: FileUploadedPayload
122
+ });
123
+ var FileUpdatedEvent = defineEvent({
124
+ meta: {
125
+ key: "file.updated",
126
+ version: "1.0.0",
127
+ description: "A file has been updated.",
128
+ stability: "stable",
129
+ owners: ["@platform.files"],
130
+ tags: ["files", "update"]
131
+ },
132
+ payload: FileUpdatedPayload
133
+ });
134
+ var FileDeletedEvent = defineEvent({
135
+ meta: {
136
+ key: "file.deleted",
137
+ version: "1.0.0",
138
+ description: "A file has been deleted.",
139
+ stability: "stable",
140
+ owners: ["@platform.files"],
141
+ tags: ["files", "delete"]
142
+ },
143
+ payload: FileDeletedPayload
144
+ });
145
+ var FileVersionCreatedEvent = defineEvent({
146
+ meta: {
147
+ key: "file.version_created",
148
+ version: "1.0.0",
149
+ description: "A new file version has been created.",
150
+ stability: "stable",
151
+ owners: ["@platform.files"],
152
+ tags: ["files", "version", "create"]
153
+ },
154
+ payload: FileVersionCreatedPayload
155
+ });
156
+ var AttachmentAttachedEvent = defineEvent({
157
+ meta: {
158
+ key: "attachment.attached",
159
+ version: "1.0.0",
160
+ description: "A file has been attached to an entity.",
161
+ stability: "stable",
162
+ owners: ["@platform.files"],
163
+ tags: ["files", "attachment", "attach"]
164
+ },
165
+ payload: AttachmentAttachedPayload
166
+ });
167
+ var AttachmentDetachedEvent = defineEvent({
168
+ meta: {
169
+ key: "attachment.detached",
170
+ version: "1.0.0",
171
+ description: "A file has been detached from an entity.",
172
+ stability: "stable",
173
+ owners: ["@platform.files"],
174
+ tags: ["files", "attachment", "detach"]
175
+ },
176
+ payload: AttachmentDetachedPayload
177
+ });
178
+ var UploadSessionStartedEvent = defineEvent({
179
+ meta: {
180
+ key: "upload.session_started",
181
+ version: "1.0.0",
182
+ description: "An upload session has started.",
183
+ stability: "stable",
184
+ owners: ["@platform.files"],
185
+ tags: ["files", "upload", "session", "start"]
186
+ },
187
+ payload: UploadSessionStartedPayload
188
+ });
189
+ var UploadSessionCompletedEvent = defineEvent({
190
+ meta: {
191
+ key: "upload.session_completed",
192
+ version: "1.0.0",
193
+ description: "An upload session has completed.",
194
+ stability: "stable",
195
+ owners: ["@platform.files"],
196
+ tags: ["files", "upload", "session", "complete"]
197
+ },
198
+ payload: UploadSessionCompletedPayload
199
+ });
200
+ var FileEvents = {
201
+ FileUploadedEvent,
202
+ FileUpdatedEvent,
203
+ FileDeletedEvent,
204
+ FileVersionCreatedEvent,
205
+ AttachmentAttachedEvent,
206
+ AttachmentDetachedEvent,
207
+ UploadSessionStartedEvent,
208
+ UploadSessionCompletedEvent
209
+ };
210
+ export {
211
+ UploadSessionStartedEvent,
212
+ UploadSessionCompletedEvent,
213
+ FileVersionCreatedEvent,
214
+ FileUploadedEvent,
215
+ FileUpdatedEvent,
216
+ FileEvents,
217
+ FileDeletedEvent,
218
+ AttachmentDetachedEvent,
219
+ AttachmentAttachedEvent
399
220
  };
400
-
401
- //#endregion
402
- export { AttachmentAttachedEvent, AttachmentDetachedEvent, FileDeletedEvent, FileEvents, FileUpdatedEvent, FileUploadedEvent, FileVersionCreatedEvent, UploadSessionCompletedEvent, UploadSessionStartedEvent };
403
- //# sourceMappingURL=events.js.map
@@ -1,8 +1,3 @@
1
- import * as _contractspec_lib_contracts15 from "@contractspec/lib.contracts";
2
-
3
- //#region src/files.capability.d.ts
4
- declare const FilesCapability: _contractspec_lib_contracts15.CapabilitySpec;
5
- declare const AttachmentsCapability: _contractspec_lib_contracts15.CapabilitySpec;
6
- //#endregion
7
- export { AttachmentsCapability, FilesCapability };
1
+ export declare const FilesCapability: import("@contractspec/lib.contracts").CapabilitySpec;
2
+ export declare const AttachmentsCapability: import("@contractspec/lib.contracts").CapabilitySpec;
8
3
  //# sourceMappingURL=files.capability.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.capability.d.ts","names":[],"sources":["../src/files.capability.ts"],"sourcesContent":[],"mappings":";;;cAEa,iBAUX,6BAAA,CAV0B;cAYf,uBAUX,6BAAA,CAVgC"}
1
+ {"version":3,"file":"files.capability.d.ts","sourceRoot":"","sources":["../src/files.capability.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,sDAU1B,CAAC;AAEH,eAAO,MAAM,qBAAqB,sDAUhC,CAAC"}