@ume-group/contracts 0.2.1

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 (57) hide show
  1. package/README.md +37 -0
  2. package/dist/adserving.d.ts +150 -0
  3. package/dist/adserving.d.ts.map +1 -0
  4. package/dist/adserving.js +8 -0
  5. package/dist/campaigns.d.ts +37 -0
  6. package/dist/campaigns.d.ts.map +1 -0
  7. package/dist/campaigns.js +8 -0
  8. package/dist/gausst.d.ts +236 -0
  9. package/dist/gausst.d.ts.map +1 -0
  10. package/dist/gausst.js +307 -0
  11. package/dist/gausst.test.d.ts +2 -0
  12. package/dist/gausst.test.d.ts.map +1 -0
  13. package/dist/gausst.test.js +71 -0
  14. package/dist/index.d.ts +1531 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +1112 -0
  17. package/dist/layer2/index.d.ts +9 -0
  18. package/dist/layer2/index.d.ts.map +1 -0
  19. package/dist/layer2/index.js +10 -0
  20. package/dist/layer2/shaders.d.ts +185 -0
  21. package/dist/layer2/shaders.d.ts.map +1 -0
  22. package/dist/layer2/shaders.js +604 -0
  23. package/dist/layer2/webcam-utils.d.ts +113 -0
  24. package/dist/layer2/webcam-utils.d.ts.map +1 -0
  25. package/dist/layer2/webcam-utils.js +147 -0
  26. package/dist/layer2/webcam-utils.test.d.ts +2 -0
  27. package/dist/layer2/webcam-utils.test.d.ts.map +1 -0
  28. package/dist/layer2/webcam-utils.test.js +18 -0
  29. package/dist/layer2.d.ts +558 -0
  30. package/dist/layer2.d.ts.map +1 -0
  31. package/dist/layer2.js +376 -0
  32. package/dist/layer2.test.d.ts +2 -0
  33. package/dist/layer2.test.d.ts.map +1 -0
  34. package/dist/layer2.test.js +65 -0
  35. package/dist/perspective.d.ts +28 -0
  36. package/dist/perspective.d.ts.map +1 -0
  37. package/dist/perspective.js +157 -0
  38. package/dist/segmentation/MediaPipeSegmenter.d.ts +201 -0
  39. package/dist/segmentation/MediaPipeSegmenter.d.ts.map +1 -0
  40. package/dist/segmentation/MediaPipeSegmenter.js +434 -0
  41. package/dist/segmentation/index.d.ts +5 -0
  42. package/dist/segmentation/index.d.ts.map +1 -0
  43. package/dist/segmentation/index.js +4 -0
  44. package/dist/webcam/GarbageMatteDragManager.d.ts +63 -0
  45. package/dist/webcam/GarbageMatteDragManager.d.ts.map +1 -0
  46. package/dist/webcam/GarbageMatteDragManager.js +183 -0
  47. package/dist/webcam/WebcamStreamManager.d.ts +103 -0
  48. package/dist/webcam/WebcamStreamManager.d.ts.map +1 -0
  49. package/dist/webcam/WebcamStreamManager.js +356 -0
  50. package/dist/webcam/index.d.ts +5 -0
  51. package/dist/webcam/index.d.ts.map +1 -0
  52. package/dist/webcam/index.js +2 -0
  53. package/openapi/admetise.yaml +632 -0
  54. package/openapi/includu.yaml +621 -0
  55. package/openapi/integration.yaml +372 -0
  56. package/openapi/shared/schemas.yaml +227 -0
  57. package/package.json +53 -0
@@ -0,0 +1,632 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Admetise API
4
+ description: |
5
+ Ad serving and campaign management API for the Admetise monetization platform.
6
+
7
+ ## Authentication
8
+ All endpoints are behind Cloudflare Zero Trust (`@ume.group` email policy).
9
+ The pod serving endpoints (`/api/v1/pods/*`) will be made public at launch.
10
+
11
+ ## Versioning
12
+ Cross-product boundary endpoints use `/api/v1/` prefix.
13
+ Internal studio endpoints use `/api/` (unversioned).
14
+ version: 1.0.0
15
+ contact:
16
+ name: uMe Group
17
+ url: https://ume.group
18
+ license:
19
+ name: Proprietary
20
+
21
+ servers:
22
+ - url: https://studio.admetise.com
23
+ description: Production
24
+
25
+ tags:
26
+ - name: Health
27
+ description: Service health check
28
+ - name: Campaigns
29
+ description: Campaign CRUD (Studio UI)
30
+ - name: Pods
31
+ description: Ad pod serving (Player integration)
32
+ - name: Tracking
33
+ description: Impression and event tracking
34
+ - name: Formats
35
+ description: Supported ad formats
36
+ - name: GAM
37
+ description: Google Ad Manager integration
38
+
39
+ paths:
40
+ # =========================================================================
41
+ # HEALTH
42
+ # =========================================================================
43
+
44
+ /api/health:
45
+ get:
46
+ tags: [Health]
47
+ summary: Health check
48
+ operationId: getHealth
49
+ responses:
50
+ '200':
51
+ description: Service is healthy
52
+ content:
53
+ application/json:
54
+ schema:
55
+ type: object
56
+ properties:
57
+ status:
58
+ type: string
59
+ example: ok
60
+
61
+ # =========================================================================
62
+ # CAMPAIGNS (existing, implemented)
63
+ # =========================================================================
64
+
65
+ /api/campaigns:
66
+ get:
67
+ tags: [Campaigns]
68
+ summary: List all campaigns
69
+ operationId: listCampaigns
70
+ responses:
71
+ '200':
72
+ description: Campaigns listed
73
+ content:
74
+ application/json:
75
+ schema:
76
+ type: array
77
+ items:
78
+ $ref: '#/components/schemas/ExclusiveCampaign'
79
+ post:
80
+ tags: [Campaigns]
81
+ summary: Create a campaign
82
+ operationId: createCampaign
83
+ requestBody:
84
+ required: true
85
+ content:
86
+ application/json:
87
+ schema:
88
+ type: object
89
+ required: [advertiserId, title, gamAdUnitPath, startsAt, endsAt]
90
+ properties:
91
+ advertiserId:
92
+ type: string
93
+ title:
94
+ type: string
95
+ gamAdUnitPath:
96
+ type: string
97
+ startsAt:
98
+ type: string
99
+ format: date-time
100
+ endsAt:
101
+ type: string
102
+ format: date-time
103
+ budget:
104
+ type: object
105
+ properties:
106
+ totalBudget:
107
+ type: number
108
+ currency:
109
+ type: string
110
+ default: NOK
111
+ targeting:
112
+ type: object
113
+ properties:
114
+ geo:
115
+ type: object
116
+ properties:
117
+ countries:
118
+ type: array
119
+ items:
120
+ type: string
121
+ responses:
122
+ '201':
123
+ description: Campaign created
124
+ content:
125
+ application/json:
126
+ schema:
127
+ $ref: '#/components/schemas/ExclusiveCampaign'
128
+ '400':
129
+ description: Missing required fields
130
+ content:
131
+ application/json:
132
+ schema:
133
+ $ref: 'shared/schemas.yaml#/components/schemas/Error'
134
+
135
+ /api/campaigns/{id}:
136
+ get:
137
+ tags: [Campaigns]
138
+ summary: Get campaign by ID
139
+ operationId: getCampaign
140
+ parameters:
141
+ - $ref: '#/components/parameters/CampaignId'
142
+ responses:
143
+ '200':
144
+ description: Campaign found
145
+ content:
146
+ application/json:
147
+ schema:
148
+ $ref: '#/components/schemas/ExclusiveCampaign'
149
+ '404':
150
+ description: Campaign not found
151
+ content:
152
+ application/json:
153
+ schema:
154
+ $ref: 'shared/schemas.yaml#/components/schemas/Error'
155
+ put:
156
+ tags: [Campaigns]
157
+ summary: Update campaign
158
+ operationId: updateCampaign
159
+ parameters:
160
+ - $ref: '#/components/parameters/CampaignId'
161
+ requestBody:
162
+ required: true
163
+ content:
164
+ application/json:
165
+ schema:
166
+ $ref: '#/components/schemas/ExclusiveCampaign'
167
+ responses:
168
+ '200':
169
+ description: Campaign updated
170
+ content:
171
+ application/json:
172
+ schema:
173
+ $ref: '#/components/schemas/ExclusiveCampaign'
174
+ '404':
175
+ description: Campaign not found
176
+ delete:
177
+ tags: [Campaigns]
178
+ summary: Delete campaign
179
+ operationId: deleteCampaign
180
+ parameters:
181
+ - $ref: '#/components/parameters/CampaignId'
182
+ responses:
183
+ '204':
184
+ description: Campaign deleted
185
+ '404':
186
+ description: Campaign not found
187
+
188
+ # =========================================================================
189
+ # PODS (planned — issue #6)
190
+ # =========================================================================
191
+
192
+ /api/v1/pods/request:
193
+ post:
194
+ tags: [Pods]
195
+ summary: Request an ad pod
196
+ description: |
197
+ Player calls this at load time to get a resolved ad schedule.
198
+ Returns a list of AdPod objects with fully-built GAM VAST URLs.
199
+ operationId: requestPod
200
+ x-status: planned
201
+ requestBody:
202
+ required: true
203
+ content:
204
+ application/json:
205
+ schema:
206
+ $ref: '#/components/schemas/AdServeRequest'
207
+ responses:
208
+ '200':
209
+ description: Ad pod resolved
210
+ content:
211
+ application/json:
212
+ schema:
213
+ $ref: '#/components/schemas/AdServeResponse'
214
+ '404':
215
+ description: No matching campaigns or publish ID not found
216
+
217
+ /api/v1/pods/{podId}:
218
+ get:
219
+ tags: [Pods]
220
+ summary: Get pod build status
221
+ description: |
222
+ Poll this endpoint if the initial pod request returns a pending status.
223
+ Used for async VAST resolution when GAM needs extra processing time.
224
+ operationId: getPodStatus
225
+ x-status: planned
226
+ parameters:
227
+ - name: podId
228
+ in: path
229
+ required: true
230
+ schema:
231
+ type: string
232
+ responses:
233
+ '200':
234
+ description: Pod status
235
+ content:
236
+ application/json:
237
+ schema:
238
+ $ref: '#/components/schemas/PodStatusResponse'
239
+ '404':
240
+ description: Pod not found
241
+
242
+ # =========================================================================
243
+ # TRACKING (planned — issue #6)
244
+ # =========================================================================
245
+
246
+ /api/v1/tracking/event:
247
+ post:
248
+ tags: [Tracking]
249
+ summary: Track ad event
250
+ description: |
251
+ Player fires this when IMA SDK reports an ad event (impression, quartile, click, etc.).
252
+ Used for Admetise-side billing and analytics.
253
+ operationId: trackEvent
254
+ x-status: planned
255
+ requestBody:
256
+ required: true
257
+ content:
258
+ application/json:
259
+ schema:
260
+ $ref: '#/components/schemas/TrackingEventRequest'
261
+ responses:
262
+ '200':
263
+ description: Event tracked
264
+ content:
265
+ application/json:
266
+ schema:
267
+ $ref: '#/components/schemas/TrackingEventResponse'
268
+ '400':
269
+ description: Invalid event data
270
+ content:
271
+ application/json:
272
+ schema:
273
+ $ref: 'shared/schemas.yaml#/components/schemas/Error'
274
+
275
+ # =========================================================================
276
+ # FORMATS (planned — issue #6)
277
+ # =========================================================================
278
+
279
+ /api/v1/formats:
280
+ get:
281
+ tags: [Formats]
282
+ summary: List supported ad formats
283
+ description: |
284
+ Returns the available ad format templates.
285
+ Used by Studio UI for campaign setup and by Player for rendering hints.
286
+ operationId: listFormats
287
+ x-status: planned
288
+ responses:
289
+ '200':
290
+ description: Available formats
291
+ content:
292
+ application/json:
293
+ schema:
294
+ type: array
295
+ items:
296
+ $ref: '#/components/schemas/AdFormat'
297
+
298
+ # =========================================================================
299
+ # GAM (planned — issue #6)
300
+ # =========================================================================
301
+
302
+ /api/v1/gam/status:
303
+ get:
304
+ tags: [GAM]
305
+ summary: Get GAM connection status
306
+ description: Returns the current OAuth connection state for Google Ad Manager.
307
+ operationId: getGamStatus
308
+ x-status: planned
309
+ responses:
310
+ '200':
311
+ description: GAM connection status
312
+ content:
313
+ application/json:
314
+ schema:
315
+ $ref: '#/components/schemas/GamAuthStatus'
316
+
317
+ /api/v1/gam/ad-units:
318
+ get:
319
+ tags: [GAM]
320
+ summary: List GAM ad units
321
+ description: Fetches ad units from the connected GAM network for slot mapping.
322
+ operationId: listGamAdUnits
323
+ x-status: planned
324
+ responses:
325
+ '200':
326
+ description: Ad units from GAM
327
+ content:
328
+ application/json:
329
+ schema:
330
+ type: array
331
+ items:
332
+ $ref: '#/components/schemas/GamAdUnit'
333
+ '401':
334
+ description: GAM not connected
335
+
336
+ components:
337
+ parameters:
338
+ CampaignId:
339
+ name: id
340
+ in: path
341
+ required: true
342
+ description: Campaign UUID
343
+ schema:
344
+ type: string
345
+ format: uuid
346
+
347
+ schemas:
348
+ ExclusiveCampaign:
349
+ type: object
350
+ required:
351
+ - id
352
+ - advertiserId
353
+ - title
354
+ - status
355
+ - gamAdUnitPath
356
+ - startsAt
357
+ - endsAt
358
+ - createdAt
359
+ - updatedAt
360
+ properties:
361
+ id:
362
+ type: string
363
+ format: uuid
364
+ advertiserId:
365
+ type: string
366
+ title:
367
+ type: string
368
+ status:
369
+ type: string
370
+ enum: [draft, pending_review, active, paused, completed, cancelled]
371
+ gamAdUnitPath:
372
+ type: string
373
+ startsAt:
374
+ type: string
375
+ format: date-time
376
+ endsAt:
377
+ type: string
378
+ format: date-time
379
+ budget:
380
+ type: object
381
+ properties:
382
+ totalBudget:
383
+ type: number
384
+ spent:
385
+ type: number
386
+ currency:
387
+ type: string
388
+ targeting:
389
+ type: object
390
+ properties:
391
+ geo:
392
+ type: object
393
+ properties:
394
+ countries:
395
+ type: array
396
+ items:
397
+ type: string
398
+ createdAt:
399
+ type: string
400
+ format: date-time
401
+ updatedAt:
402
+ type: string
403
+ format: date-time
404
+
405
+ AdServeRequest:
406
+ type: object
407
+ required:
408
+ - publishId
409
+ properties:
410
+ publishId:
411
+ type: string
412
+ description: Includu publish ID
413
+ viewerGeo:
414
+ type: string
415
+ description: ISO 3166-1 alpha-2 country code
416
+ example: "NO"
417
+ deviceType:
418
+ type: string
419
+ enum: [mobile, tablet, desktop, ctv]
420
+ correlator:
421
+ type: number
422
+ description: Random number for GAM frequency capping
423
+ contentCategory:
424
+ type: string
425
+ description: Content category for targeting
426
+ videoDuration:
427
+ type: number
428
+ description: Video duration in seconds
429
+ pageUrl:
430
+ type: string
431
+ format: uri
432
+ description: Page URL where player is embedded
433
+
434
+ AdServeResponse:
435
+ type: object
436
+ required:
437
+ - publishId
438
+ - pods
439
+ - resolvedAt
440
+ properties:
441
+ publishId:
442
+ type: string
443
+ pods:
444
+ type: array
445
+ items:
446
+ $ref: '#/components/schemas/AdPod'
447
+ resolvedAt:
448
+ type: string
449
+ format: date-time
450
+ correlator:
451
+ type: number
452
+
453
+ AdPod:
454
+ type: object
455
+ required:
456
+ - id
457
+ - slotType
458
+ - adTagUrl
459
+ - trackingUrl
460
+ properties:
461
+ id:
462
+ type: string
463
+ slotType:
464
+ type: string
465
+ enum: [preroll, midroll, postroll, overlay, companion]
466
+ triggerTime:
467
+ type: number
468
+ triggerPercent:
469
+ type: number
470
+ adTagUrl:
471
+ type: string
472
+ format: uri
473
+ description: Fully resolved GAM VAST URL
474
+ maxDuration:
475
+ type: integer
476
+ position:
477
+ type: object
478
+ properties:
479
+ x:
480
+ type: number
481
+ y:
482
+ type: number
483
+ width:
484
+ type: integer
485
+ height:
486
+ type: integer
487
+ trackingUrl:
488
+ type: string
489
+ format: uri
490
+
491
+ PodStatusResponse:
492
+ type: object
493
+ required:
494
+ - podId
495
+ - status
496
+ properties:
497
+ podId:
498
+ type: string
499
+ status:
500
+ type: string
501
+ enum: [pending, building, ready, error]
502
+ description: Pod build status
503
+ pods:
504
+ type: array
505
+ description: Resolved pods (only when status is ready)
506
+ items:
507
+ $ref: '#/components/schemas/AdPod'
508
+ error:
509
+ type: string
510
+ description: Error message (only when status is error)
511
+ retryAfterMs:
512
+ type: integer
513
+ description: Suggested retry delay in milliseconds (only when pending/building)
514
+
515
+ TrackingEventRequest:
516
+ type: object
517
+ required:
518
+ - podId
519
+ - publishId
520
+ - eventType
521
+ - timestamp
522
+ properties:
523
+ podId:
524
+ type: string
525
+ publishId:
526
+ type: string
527
+ eventType:
528
+ type: string
529
+ enum: [impression, firstQuartile, midpoint, thirdQuartile, complete, click, skip]
530
+ geo:
531
+ type: string
532
+ description: ISO 3166-1 alpha-2
533
+ timestamp:
534
+ type: string
535
+ format: date-time
536
+ positionSeconds:
537
+ type: number
538
+ description: Current playback position in seconds
539
+ userAgent:
540
+ type: string
541
+ description: Viewer's user agent string
542
+
543
+ TrackingEventResponse:
544
+ type: object
545
+ required:
546
+ - accepted
547
+ properties:
548
+ accepted:
549
+ type: boolean
550
+ eventId:
551
+ type: string
552
+ description: Unique event ID for deduplication
553
+
554
+ AdFormat:
555
+ type: object
556
+ required:
557
+ - id
558
+ - name
559
+ - type
560
+ - category
561
+ - active
562
+ properties:
563
+ id:
564
+ type: string
565
+ example: "preroll-15"
566
+ name:
567
+ type: string
568
+ example: "Standard Preroll (15s)"
569
+ description:
570
+ type: string
571
+ type:
572
+ type: string
573
+ enum: [preroll, midroll, postroll, overlay, companion]
574
+ category:
575
+ type: string
576
+ enum: [video, display, companion]
577
+ width:
578
+ type: integer
579
+ height:
580
+ type: integer
581
+ position:
582
+ type: string
583
+ enum: [top-left, top-right, bottom-left, bottom-right, center]
584
+ duration:
585
+ type: integer
586
+ maxDuration:
587
+ type: integer
588
+ iabSize:
589
+ type: string
590
+ example: "300x250"
591
+ active:
592
+ type: boolean
593
+
594
+ GamAuthStatus:
595
+ type: object
596
+ required:
597
+ - status
598
+ properties:
599
+ status:
600
+ type: string
601
+ enum: [connected, expired, disconnected]
602
+ networkCode:
603
+ type: string
604
+ networkName:
605
+ type: string
606
+ tokenExpiresAt:
607
+ type: string
608
+ format: date-time
609
+ scopes:
610
+ type: array
611
+ items:
612
+ type: string
613
+
614
+ GamAdUnit:
615
+ type: object
616
+ required:
617
+ - id
618
+ - name
619
+ - adUnitPath
620
+ properties:
621
+ id:
622
+ type: string
623
+ name:
624
+ type: string
625
+ adUnitPath:
626
+ type: string
627
+ example: "/12345678/includu/preroll"
628
+ compatibleSlotTypes:
629
+ type: array
630
+ items:
631
+ type: string
632
+ enum: [preroll, midroll, postroll, overlay, companion]