@itm-studio/partner-sdk 0.3.3 → 0.3.4

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/README.md CHANGED
@@ -1885,3 +1885,31 @@ Deploy the backend media schema and migration before releasing this SDK contract
1885
1885
  Agent-session email callers first query `getPartnerAgentEmailContext { operatorCcEmail }`, show that address with every email draft, and include `operatorCcEmail` in `SendPartnerAgentEmailInput` after approval. The backend verifies it against the authenticated admin, snapshots it on the batch, and CCs that address on each message. When the operator is already the primary recipient, no duplicate CC is added. Read the approved snapshot through `BrandAgentEmailSendBatch.operatorCcEmail`. A changed operator address before queuing requires a revised draft and approval; queued retries retain the original address.
1886
1886
 
1887
1887
  Partner API-key callers cannot query operator context or supply operator CC. Existing partner sends and the brand Reply-To address retain their existing behavior.
1888
+
1889
+ ### Agent-generated posters
1890
+
1891
+ Agent sessions with `UPLOAD_MEDIA` can reserve an immutable upload using
1892
+ `reserveAgentMediaUpload({ input: { idempotencyKey, toolCallId, requestHash } })`.
1893
+ The request hash is SHA-256 of the canonical generation brief and model settings.
1894
+ Only the first claim receives `mayGenerate: true`; replays must inspect
1895
+ `getAgentMediaUpload({ uid })` and must never repeat a paid generation.
1896
+
1897
+ Generate pixels inside Eve through AI Gateway. PUT the PNG to the reserved
1898
+ `uploadUrl` with `Content-Type: image/png` and `If-None-Match: *`. Keep signed URLs
1899
+ and image bytes out of chat/tool results. Reserved posters are 1024 × 1280 PNGs,
1900
+ up to 10 MB. Register through `createPartnerMediaAsset` with the reservation's
1901
+ `filename`, `reservationUid`, `idempotencyKey: "media-upload:" + reservation.uid`,
1902
+ and the current `toolCallId`. Registration links the resulting asset to brand media.
1903
+ Return its UID, URL, MIME type and dimensions for preview and moment selection.
1904
+
1905
+ `getAgentMediaUpload` returns an existing asset or reports whether the object was
1906
+ uploaded, allowing registration after interruption without another model call.
1907
+ `finishAgentMediaUpload({ uid })` releases an unsuccessful attempt's active slot;
1908
+ it never grants permission to regenerate that attempt. A brand allows one active
1909
+ attempt for five minutes. Recovery requires the original brand and admin identity
1910
+ with current authorization; partner API keys cannot use reservation operations.
1911
+ Each requested revision gets a new reservation and brand media asset.
1912
+
1913
+ Deploy the backend reservation migration and schema before publishing SDK 0.3.3,
1914
+ then release the Eve and Backstage consumers. These operations do not call an
1915
+ image provider or consume notification credits.
package/dist/index.d.mts CHANGED
@@ -686,9 +686,21 @@ interface GetPartnerMediaAssetsResponse {
686
686
  nextCursor: (Scalars['String'] | null);
687
687
  __typename: 'GetPartnerMediaAssetsResponse';
688
688
  }
689
+ interface AgentMediaUploadReservation {
690
+ uid: Scalars['String'];
691
+ mayGenerate: Scalars['Boolean'];
692
+ filename: Scalars['String'];
693
+ uploadUrl: (Scalars['String'] | null);
694
+ downloadUrl: Scalars['String'];
695
+ uploaded: Scalars['Boolean'];
696
+ finishedAt: (Scalars['DateTime'] | null);
697
+ mediaAsset: (MediaAsset | null);
698
+ __typename: 'AgentMediaUploadReservation';
699
+ }
689
700
  interface Query {
690
701
  /** Get the authenticated agent operator email for the approval preview. Requires a brand-agent session with SEND_EMAIL; unavailable to partner API keys. */
691
702
  getPartnerAgentEmailContext: BrandAgentEmailContext;
703
+ getAgentMediaUpload: AgentMediaUploadReservation;
692
704
  /** Active brand-linked assets, newest first. Defaults to 50, capped at 100. READ_MEDIA for agents. */
693
705
  getPartnerMediaAssets: GetPartnerMediaAssetsResponse;
694
706
  /** An active asset linked to the caller's brand; null when unavailable. READ_MEDIA for agents. */
@@ -810,6 +822,8 @@ interface CreatePartnerBrandSubscriptionResponse {
810
822
  __typename: 'CreatePartnerBrandSubscriptionResponse';
811
823
  }
812
824
  interface Mutation {
825
+ reserveAgentMediaUpload: AgentMediaUploadReservation;
826
+ finishAgentMediaUpload: Scalars['Boolean'];
813
827
  /**
814
828
  * Get a presigned S3 URL for direct file upload.
815
829
  * Rate limited to 30 requests per minute.
@@ -1615,9 +1629,31 @@ interface GetPartnerMediaAssetsResponseGenqlSelection {
1615
1629
  __typename?: boolean | number;
1616
1630
  __scalar?: boolean | number;
1617
1631
  }
1632
+ interface ReserveAgentMediaUploadInput {
1633
+ idempotencyKey: Scalars['String'];
1634
+ toolCallId: Scalars['String'];
1635
+ requestHash: Scalars['String'];
1636
+ }
1637
+ interface AgentMediaUploadReservationGenqlSelection {
1638
+ uid?: boolean | number;
1639
+ mayGenerate?: boolean | number;
1640
+ filename?: boolean | number;
1641
+ uploadUrl?: boolean | number;
1642
+ downloadUrl?: boolean | number;
1643
+ uploaded?: boolean | number;
1644
+ finishedAt?: boolean | number;
1645
+ mediaAsset?: MediaAssetGenqlSelection;
1646
+ __typename?: boolean | number;
1647
+ __scalar?: boolean | number;
1648
+ }
1618
1649
  interface QueryGenqlSelection {
1619
1650
  /** Get the authenticated agent operator email for the approval preview. Requires a brand-agent session with SEND_EMAIL; unavailable to partner API keys. */
1620
1651
  getPartnerAgentEmailContext?: BrandAgentEmailContextGenqlSelection;
1652
+ getAgentMediaUpload?: (AgentMediaUploadReservationGenqlSelection & {
1653
+ __args: {
1654
+ uid: Scalars['String'];
1655
+ };
1656
+ });
1621
1657
  /** Active brand-linked assets, newest first. Defaults to 50, capped at 100. READ_MEDIA for agents. */
1622
1658
  getPartnerMediaAssets?: (GetPartnerMediaAssetsResponseGenqlSelection & {
1623
1659
  __args: {
@@ -2095,6 +2131,16 @@ interface CreatePartnerBrandSubscriptionResponseGenqlSelection {
2095
2131
  __scalar?: boolean | number;
2096
2132
  }
2097
2133
  interface MutationGenqlSelection {
2134
+ reserveAgentMediaUpload?: (AgentMediaUploadReservationGenqlSelection & {
2135
+ __args: {
2136
+ input: ReserveAgentMediaUploadInput;
2137
+ };
2138
+ });
2139
+ finishAgentMediaUpload?: {
2140
+ __args: {
2141
+ uid: Scalars['String'];
2142
+ };
2143
+ };
2098
2144
  /**
2099
2145
  * Get a presigned S3 URL for direct file upload.
2100
2146
  * Rate limited to 30 requests per minute.
@@ -2118,6 +2164,7 @@ interface MutationGenqlSelection {
2118
2164
  idempotencyKey?: (Scalars['String'] | null);
2119
2165
  /** Required for agent sessions; omit for partner tokens. */
2120
2166
  toolCallId?: (Scalars['String'] | null);
2167
+ reservationUid?: (Scalars['String'] | null);
2121
2168
  };
2122
2169
  });
2123
2170
  /**
package/dist/index.d.ts CHANGED
@@ -686,9 +686,21 @@ interface GetPartnerMediaAssetsResponse {
686
686
  nextCursor: (Scalars['String'] | null);
687
687
  __typename: 'GetPartnerMediaAssetsResponse';
688
688
  }
689
+ interface AgentMediaUploadReservation {
690
+ uid: Scalars['String'];
691
+ mayGenerate: Scalars['Boolean'];
692
+ filename: Scalars['String'];
693
+ uploadUrl: (Scalars['String'] | null);
694
+ downloadUrl: Scalars['String'];
695
+ uploaded: Scalars['Boolean'];
696
+ finishedAt: (Scalars['DateTime'] | null);
697
+ mediaAsset: (MediaAsset | null);
698
+ __typename: 'AgentMediaUploadReservation';
699
+ }
689
700
  interface Query {
690
701
  /** Get the authenticated agent operator email for the approval preview. Requires a brand-agent session with SEND_EMAIL; unavailable to partner API keys. */
691
702
  getPartnerAgentEmailContext: BrandAgentEmailContext;
703
+ getAgentMediaUpload: AgentMediaUploadReservation;
692
704
  /** Active brand-linked assets, newest first. Defaults to 50, capped at 100. READ_MEDIA for agents. */
693
705
  getPartnerMediaAssets: GetPartnerMediaAssetsResponse;
694
706
  /** An active asset linked to the caller's brand; null when unavailable. READ_MEDIA for agents. */
@@ -810,6 +822,8 @@ interface CreatePartnerBrandSubscriptionResponse {
810
822
  __typename: 'CreatePartnerBrandSubscriptionResponse';
811
823
  }
812
824
  interface Mutation {
825
+ reserveAgentMediaUpload: AgentMediaUploadReservation;
826
+ finishAgentMediaUpload: Scalars['Boolean'];
813
827
  /**
814
828
  * Get a presigned S3 URL for direct file upload.
815
829
  * Rate limited to 30 requests per minute.
@@ -1615,9 +1629,31 @@ interface GetPartnerMediaAssetsResponseGenqlSelection {
1615
1629
  __typename?: boolean | number;
1616
1630
  __scalar?: boolean | number;
1617
1631
  }
1632
+ interface ReserveAgentMediaUploadInput {
1633
+ idempotencyKey: Scalars['String'];
1634
+ toolCallId: Scalars['String'];
1635
+ requestHash: Scalars['String'];
1636
+ }
1637
+ interface AgentMediaUploadReservationGenqlSelection {
1638
+ uid?: boolean | number;
1639
+ mayGenerate?: boolean | number;
1640
+ filename?: boolean | number;
1641
+ uploadUrl?: boolean | number;
1642
+ downloadUrl?: boolean | number;
1643
+ uploaded?: boolean | number;
1644
+ finishedAt?: boolean | number;
1645
+ mediaAsset?: MediaAssetGenqlSelection;
1646
+ __typename?: boolean | number;
1647
+ __scalar?: boolean | number;
1648
+ }
1618
1649
  interface QueryGenqlSelection {
1619
1650
  /** Get the authenticated agent operator email for the approval preview. Requires a brand-agent session with SEND_EMAIL; unavailable to partner API keys. */
1620
1651
  getPartnerAgentEmailContext?: BrandAgentEmailContextGenqlSelection;
1652
+ getAgentMediaUpload?: (AgentMediaUploadReservationGenqlSelection & {
1653
+ __args: {
1654
+ uid: Scalars['String'];
1655
+ };
1656
+ });
1621
1657
  /** Active brand-linked assets, newest first. Defaults to 50, capped at 100. READ_MEDIA for agents. */
1622
1658
  getPartnerMediaAssets?: (GetPartnerMediaAssetsResponseGenqlSelection & {
1623
1659
  __args: {
@@ -2095,6 +2131,16 @@ interface CreatePartnerBrandSubscriptionResponseGenqlSelection {
2095
2131
  __scalar?: boolean | number;
2096
2132
  }
2097
2133
  interface MutationGenqlSelection {
2134
+ reserveAgentMediaUpload?: (AgentMediaUploadReservationGenqlSelection & {
2135
+ __args: {
2136
+ input: ReserveAgentMediaUploadInput;
2137
+ };
2138
+ });
2139
+ finishAgentMediaUpload?: {
2140
+ __args: {
2141
+ uid: Scalars['String'];
2142
+ };
2143
+ };
2098
2144
  /**
2099
2145
  * Get a presigned S3 URL for direct file upload.
2100
2146
  * Rate limited to 30 requests per minute.
@@ -2118,6 +2164,7 @@ interface MutationGenqlSelection {
2118
2164
  idempotencyKey?: (Scalars['String'] | null);
2119
2165
  /** Required for agent sessions; omit for partner tokens. */
2120
2166
  toolCallId?: (Scalars['String'] | null);
2167
+ reservationUid?: (Scalars['String'] | null);
2121
2168
  };
2122
2169
  });
2123
2170
  /**
package/dist/index.js CHANGED
@@ -1547,10 +1547,10 @@ var types_default = {
1547
1547
  27
1548
1548
  ],
1549
1549
  "coverImage": [
1550
- 127
1550
+ 129
1551
1551
  ],
1552
1552
  "coverImageMobile": [
1553
- 127
1553
+ 129
1554
1554
  ],
1555
1555
  "isActive": [
1556
1556
  33
@@ -2391,7 +2391,7 @@ var types_default = {
2391
2391
  },
2392
2392
  "GetPartnerMediaAssetsResponse": {
2393
2393
  "mediaAssets": [
2394
- 127
2394
+ 129
2395
2395
  ],
2396
2396
  "totalCount": [
2397
2397
  36
@@ -2406,10 +2406,62 @@ var types_default = {
2406
2406
  27
2407
2407
  ]
2408
2408
  },
2409
+ "ReserveAgentMediaUploadInput": {
2410
+ "idempotencyKey": [
2411
+ 27
2412
+ ],
2413
+ "toolCallId": [
2414
+ 27
2415
+ ],
2416
+ "requestHash": [
2417
+ 27
2418
+ ],
2419
+ "__typename": [
2420
+ 27
2421
+ ]
2422
+ },
2423
+ "AgentMediaUploadReservation": {
2424
+ "uid": [
2425
+ 27
2426
+ ],
2427
+ "mayGenerate": [
2428
+ 33
2429
+ ],
2430
+ "filename": [
2431
+ 27
2432
+ ],
2433
+ "uploadUrl": [
2434
+ 27
2435
+ ],
2436
+ "downloadUrl": [
2437
+ 27
2438
+ ],
2439
+ "uploaded": [
2440
+ 33
2441
+ ],
2442
+ "finishedAt": [
2443
+ 0
2444
+ ],
2445
+ "mediaAsset": [
2446
+ 129
2447
+ ],
2448
+ "__typename": [
2449
+ 27
2450
+ ]
2451
+ },
2409
2452
  "Query": {
2410
2453
  "getPartnerAgentEmailContext": [
2411
2454
  98
2412
2455
  ],
2456
+ "getAgentMediaUpload": [
2457
+ 104,
2458
+ {
2459
+ "uid": [
2460
+ 27,
2461
+ "String!"
2462
+ ]
2463
+ }
2464
+ ],
2413
2465
  "getPartnerMediaAssets": [
2414
2466
  102,
2415
2467
  {
@@ -2420,7 +2472,7 @@ var types_default = {
2420
2472
  }
2421
2473
  ],
2422
2474
  "getPartnerMediaAsset": [
2423
- 127,
2475
+ 129,
2424
2476
  {
2425
2477
  "uid": [
2426
2478
  27,
@@ -2578,7 +2630,7 @@ var types_default = {
2578
2630
  73,
2579
2631
  {
2580
2632
  "input": [
2581
- 111,
2633
+ 113,
2582
2634
  "GetPartnerTicketTiersForMomentInput!"
2583
2635
  ]
2584
2636
  }
@@ -2587,7 +2639,7 @@ var types_default = {
2587
2639
  86,
2588
2640
  {
2589
2641
  "input": [
2590
- 114,
2642
+ 116,
2591
2643
  "DynamicPricingMomentInput!"
2592
2644
  ]
2593
2645
  }
@@ -2665,7 +2717,7 @@ var types_default = {
2665
2717
  27
2666
2718
  ],
2667
2719
  "messages": [
2668
- 105
2720
+ 107
2669
2721
  ],
2670
2722
  "toolCallId": [
2671
2723
  27
@@ -2775,10 +2827,10 @@ var types_default = {
2775
2827
  27
2776
2828
  ],
2777
2829
  "venue": [
2778
- 107
2830
+ 109
2779
2831
  ],
2780
2832
  "onlineConfig": [
2781
- 109
2833
+ 111
2782
2834
  ],
2783
2835
  "isPrivate": [
2784
2836
  33
@@ -2793,7 +2845,7 @@ var types_default = {
2793
2845
  16
2794
2846
  ],
2795
2847
  "ticketTiers": [
2796
- 108
2848
+ 110
2797
2849
  ],
2798
2850
  "idempotencyKey": [
2799
2851
  27
@@ -2907,7 +2959,7 @@ var types_default = {
2907
2959
  27
2908
2960
  ],
2909
2961
  "updates": [
2910
- 112
2962
+ 114
2911
2963
  ],
2912
2964
  "__typename": [
2913
2965
  27
@@ -2938,7 +2990,7 @@ var types_default = {
2938
2990
  27
2939
2991
  ],
2940
2992
  "inventoryGuard": [
2941
- 116
2993
+ 118
2942
2994
  ],
2943
2995
  "externalSignals": [
2944
2996
  1
@@ -2996,7 +3048,7 @@ var types_default = {
2996
3048
  1
2997
3049
  ],
2998
3050
  "updates": [
2999
- 115
3051
+ 117
3000
3052
  ],
3001
3053
  "__typename": [
3002
3054
  27
@@ -3116,13 +3168,13 @@ var types_default = {
3116
3168
  },
3117
3169
  "PostSubscriptionMessageInput": {
3118
3170
  "sms": [
3119
- 120
3171
+ 122
3120
3172
  ],
3121
3173
  "email": [
3122
- 121
3174
+ 123
3123
3175
  ],
3124
3176
  "push": [
3125
- 122
3177
+ 124
3126
3178
  ],
3127
3179
  "__typename": [
3128
3180
  27
@@ -3130,7 +3182,7 @@ var types_default = {
3130
3182
  },
3131
3183
  "CreatePartnerBrandSubscriptionInput": {
3132
3184
  "compliance": [
3133
- 119
3185
+ 121
3134
3186
  ],
3135
3187
  "consentText": [
3136
3188
  27
@@ -3151,7 +3203,7 @@ var types_default = {
3151
3203
  33
3152
3204
  ],
3153
3205
  "postSubscriptionMessage": [
3154
- 123
3206
+ 125
3155
3207
  ],
3156
3208
  "__typename": [
3157
3209
  27
@@ -3205,7 +3257,7 @@ var types_default = {
3205
3257
  27
3206
3258
  ],
3207
3259
  "transforms": [
3208
- 128
3260
+ 130
3209
3261
  ],
3210
3262
  "createdAt": [
3211
3263
  0
@@ -3252,8 +3304,26 @@ var types_default = {
3252
3304
  ]
3253
3305
  },
3254
3306
  "Mutation": {
3307
+ "reserveAgentMediaUpload": [
3308
+ 104,
3309
+ {
3310
+ "input": [
3311
+ 103,
3312
+ "ReserveAgentMediaUploadInput!"
3313
+ ]
3314
+ }
3315
+ ],
3316
+ "finishAgentMediaUpload": [
3317
+ 33,
3318
+ {
3319
+ "uid": [
3320
+ 27,
3321
+ "String!"
3322
+ ]
3323
+ }
3324
+ ],
3255
3325
  "getPartnerUploadUrl": [
3256
- 126,
3326
+ 128,
3257
3327
  {
3258
3328
  "filename": [
3259
3329
  27,
@@ -3266,7 +3336,7 @@ var types_default = {
3266
3336
  }
3267
3337
  ],
3268
3338
  "createPartnerMediaAsset": [
3269
- 127,
3339
+ 129,
3270
3340
  {
3271
3341
  "mimetype": [
3272
3342
  27,
@@ -3277,7 +3347,7 @@ var types_default = {
3277
3347
  "String!"
3278
3348
  ],
3279
3349
  "dimensions": [
3280
- 104,
3350
+ 106,
3281
3351
  "DimensionsInput!"
3282
3352
  ],
3283
3353
  "idempotencyKey": [
@@ -3285,14 +3355,17 @@ var types_default = {
3285
3355
  ],
3286
3356
  "toolCallId": [
3287
3357
  27
3358
+ ],
3359
+ "reservationUid": [
3360
+ 27
3288
3361
  ]
3289
3362
  }
3290
3363
  ],
3291
3364
  "createPartnerBrandSubscription": [
3292
- 129,
3365
+ 131,
3293
3366
  {
3294
3367
  "input": [
3295
- 124,
3368
+ 126,
3296
3369
  "CreatePartnerBrandSubscriptionInput!"
3297
3370
  ]
3298
3371
  }
@@ -3301,7 +3374,7 @@ var types_default = {
3301
3374
  38,
3302
3375
  {
3303
3376
  "input": [
3304
- 110,
3377
+ 112,
3305
3378
  "CreatePartnerMomentInput!"
3306
3379
  ]
3307
3380
  }
@@ -3310,7 +3383,7 @@ var types_default = {
3310
3383
  99,
3311
3384
  {
3312
3385
  "input": [
3313
- 106,
3386
+ 108,
3314
3387
  "SendPartnerAgentEmailInput!"
3315
3388
  ]
3316
3389
  }
@@ -3319,7 +3392,7 @@ var types_default = {
3319
3392
  72,
3320
3393
  {
3321
3394
  "input": [
3322
- 113,
3395
+ 115,
3323
3396
  "EditPartnerTicketTiersForMomentInput!"
3324
3397
  ]
3325
3398
  }
@@ -3328,7 +3401,7 @@ var types_default = {
3328
3401
  89,
3329
3402
  {
3330
3403
  "input": [
3331
- 117,
3404
+ 119,
3332
3405
  "ApplyDynamicPricingInput!"
3333
3406
  ]
3334
3407
  }
@@ -3337,7 +3410,7 @@ var types_default = {
3337
3410
  90,
3338
3411
  {
3339
3412
  "input": [
3340
- 125,
3413
+ 127,
3341
3414
  "VerifyPartnerBrandSubscriptionInput!"
3342
3415
  ]
3343
3416
  }
@@ -3346,7 +3419,7 @@ var types_default = {
3346
3419
  92,
3347
3420
  {
3348
3421
  "input": [
3349
- 118,
3422
+ 120,
3350
3423
  "RespondToMomentLineupInput!"
3351
3424
  ]
3352
3425
  }