dodopayments 2.30.0 → 2.31.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 (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +1 -1
  3. package/resources/entitlements/entitlements.d.mts +173 -35
  4. package/resources/entitlements/entitlements.d.mts.map +1 -1
  5. package/resources/entitlements/entitlements.d.ts +173 -35
  6. package/resources/entitlements/entitlements.d.ts.map +1 -1
  7. package/resources/entitlements/entitlements.js.map +1 -1
  8. package/resources/entitlements/entitlements.mjs.map +1 -1
  9. package/resources/entitlements/files.d.mts +4 -11
  10. package/resources/entitlements/files.d.mts.map +1 -1
  11. package/resources/entitlements/files.d.ts +4 -11
  12. package/resources/entitlements/files.d.ts.map +1 -1
  13. package/resources/entitlements/files.js +2 -9
  14. package/resources/entitlements/files.js.map +1 -1
  15. package/resources/entitlements/files.mjs +2 -9
  16. package/resources/entitlements/files.mjs.map +1 -1
  17. package/resources/entitlements/grants.d.mts +80 -13
  18. package/resources/entitlements/grants.d.mts.map +1 -1
  19. package/resources/entitlements/grants.d.ts +80 -13
  20. package/resources/entitlements/grants.d.ts.map +1 -1
  21. package/resources/entitlements/grants.js +2 -4
  22. package/resources/entitlements/grants.js.map +1 -1
  23. package/resources/entitlements/grants.mjs +2 -4
  24. package/resources/entitlements/grants.mjs.map +1 -1
  25. package/resources/products/products.d.mts +36 -12
  26. package/resources/products/products.d.mts.map +1 -1
  27. package/resources/products/products.d.ts +36 -12
  28. package/resources/products/products.d.ts.map +1 -1
  29. package/resources/products/products.js.map +1 -1
  30. package/resources/products/products.mjs.map +1 -1
  31. package/resources/webhook-events.d.mts +4 -0
  32. package/resources/webhook-events.d.mts.map +1 -1
  33. package/resources/webhook-events.d.ts +4 -0
  34. package/resources/webhook-events.d.ts.map +1 -1
  35. package/resources/webhooks/webhooks.d.mts +32 -0
  36. package/resources/webhooks/webhooks.d.mts.map +1 -1
  37. package/resources/webhooks/webhooks.d.ts +32 -0
  38. package/resources/webhooks/webhooks.d.ts.map +1 -1
  39. package/resources/webhooks/webhooks.js.map +1 -1
  40. package/resources/webhooks/webhooks.mjs.map +1 -1
  41. package/src/resources/entitlements/entitlements.ts +172 -37
  42. package/src/resources/entitlements/files.ts +4 -11
  43. package/src/resources/entitlements/grants.ts +78 -14
  44. package/src/resources/products/products.ts +36 -12
  45. package/src/resources/webhook-events.ts +4 -0
  46. package/src/resources/webhooks/webhooks.ts +32 -0
  47. package/src/version.ts +1 -1
  48. package/version.d.mts +1 -1
  49. package/version.d.ts +1 -1
  50. package/version.js +1 -1
  51. package/version.mjs +1 -1
@@ -74,32 +74,62 @@ export class Entitlements extends APIResource {
74
74
 
75
75
  export type EntitlementsDefaultPageNumberPagination = DefaultPageNumberPagination<Entitlement>;
76
76
 
77
+ /**
78
+ * Detailed view of a single entitlement: identity, integration type,
79
+ * integration-specific configuration, and metadata.
80
+ */
77
81
  export interface Entitlement {
82
+ /**
83
+ * Unique identifier of the entitlement.
84
+ */
78
85
  id: string;
79
86
 
87
+ /**
88
+ * Identifier of the business that owns this entitlement.
89
+ */
80
90
  business_id: string;
81
91
 
92
+ /**
93
+ * Timestamp when the entitlement was created.
94
+ */
82
95
  created_at: string;
83
96
 
84
97
  /**
85
- * Public-facing variant of [`IntegrationConfig`]. Mirrors every variant shape on
86
- * the wire EXCEPT `DigitalFiles`, which is replaced with a hydrated
87
- * `digital_files` object (resolved download URLs etc.). The persisted JSONB stays
88
- * ID-only via [`IntegrationConfig`]; this enum is response-only.
98
+ * Integration-specific configuration. For `digital_files` entitlements this
99
+ * includes presigned download URLs for each attached file.
89
100
  */
90
101
  integration_config: IntegrationConfigResponse;
91
102
 
103
+ /**
104
+ * Platform integration this entitlement uses.
105
+ */
92
106
  integration_type: EntitlementIntegrationType;
93
107
 
108
+ /**
109
+ * Always `true` for entitlements returned by the public API; soft-deleted
110
+ * entitlements are not returned.
111
+ */
94
112
  is_active: boolean;
95
113
 
114
+ /**
115
+ * Arbitrary key-value metadata supplied at creation or via PATCH.
116
+ */
117
+ metadata: { [key: string]: string };
118
+
119
+ /**
120
+ * Display name supplied at creation.
121
+ */
96
122
  name: string;
97
123
 
124
+ /**
125
+ * Timestamp when the entitlement was last modified.
126
+ */
98
127
  updated_at: string;
99
128
 
129
+ /**
130
+ * Optional description supplied at creation.
131
+ */
100
132
  description?: string | null;
101
-
102
- metadata?: unknown;
103
133
  }
104
134
 
105
135
  export type EntitlementIntegrationType =
@@ -113,8 +143,8 @@ export type EntitlementIntegrationType =
113
143
  | 'license_key';
114
144
 
115
145
  /**
116
- * Platform-specific configuration for an entitlement. Each variant uses unique
117
- * field names so `#[serde(untagged)]` can disambiguate correctly.
146
+ * Integration-specific configuration supplied when creating or updating an
147
+ * entitlement. The shape required matches the entitlement's `integration_type`.
118
148
  */
119
149
  export type IntegrationConfig =
120
150
  | IntegrationConfig.GitHubConfig
@@ -129,71 +159,119 @@ export type IntegrationConfig =
129
159
  export namespace IntegrationConfig {
130
160
  export interface GitHubConfig {
131
161
  /**
132
- * One of: pull, push, admin, maintain, triage
162
+ * Permission to grant on the repository.
133
163
  */
134
- permission: string;
164
+ permission: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
135
165
 
166
+ /**
167
+ * Repository or organisation slug to grant access to.
168
+ */
136
169
  target_id: string;
137
170
  }
138
171
 
139
172
  export interface DiscordConfig {
173
+ /**
174
+ * Discord guild (server) ID.
175
+ */
140
176
  guild_id: string;
141
177
 
178
+ /**
179
+ * Optional Discord role to assign within the guild.
180
+ */
142
181
  role_id?: string | null;
143
182
  }
144
183
 
145
184
  export interface TelegramConfig {
185
+ /**
186
+ * Telegram chat ID. For groups this is typically a negative integer.
187
+ */
146
188
  chat_id: string;
147
189
  }
148
190
 
149
191
  export interface FigmaConfig {
192
+ /**
193
+ * Figma file identifier to grant access to.
194
+ */
150
195
  figma_file_id: string;
151
196
  }
152
197
 
153
198
  export interface FramerConfig {
199
+ /**
200
+ * Framer template identifier to grant access to.
201
+ */
154
202
  framer_template_id: string;
155
203
  }
156
204
 
157
205
  export interface NotionConfig {
206
+ /**
207
+ * Notion template identifier to grant access to.
208
+ */
158
209
  notion_template_id: string;
159
210
  }
160
211
 
161
212
  export interface DigitalFilesConfig {
213
+ /**
214
+ * Files attached to this entitlement. Add files via
215
+ * `POST /entitlements/{id}/files` and remove them via
216
+ * `DELETE /entitlements/{id}/files/{file_id}`.
217
+ */
162
218
  digital_file_ids: Array<string>;
163
219
 
220
+ /**
221
+ * Optional external URL shown to the customer alongside the files.
222
+ */
164
223
  external_url?: string | null;
165
224
 
225
+ /**
226
+ * Optional human-readable delivery instructions shown to the customer alongside
227
+ * the files.
228
+ */
166
229
  instructions?: string | null;
167
230
 
168
231
  /**
169
- * Three-way patchable field (mirrors the credit_entitlements pattern):
232
+ * Three-way patchable list of legacy file identifiers:
170
233
  *
171
- * - omitted → preserve persisted (`None`)
172
- * - `null` → clear (`Some(None)`)
173
- * - `[...]` → replace (`Some(Some(...))`)
234
+ * - omitted → preserve the current value
235
+ * - `null` → clear
236
+ * - `[...]` → replace
174
237
  *
175
- * On Create / storage we collapse "clear" and empty-array to `None` so the
176
- * persisted JSONB never carries a `null` legacy_file_ids key.
238
+ * On create, an omitted field, an explicit `null`, or an empty array all result in
239
+ * no legacy files attached.
177
240
  */
178
241
  legacy_file_ids?: Array<string> | null;
179
242
  }
180
243
 
181
244
  export interface LicenseKeyConfig {
245
+ /**
246
+ * Optional message displayed when a customer activates the license key (≤ 2500
247
+ * characters).
248
+ */
182
249
  activation_message?: string | null;
183
250
 
251
+ /**
252
+ * Maximum activations allowed per issued license key. Omit for unlimited.
253
+ */
184
254
  activations_limit?: number | null;
185
255
 
256
+ /**
257
+ * Validity duration of issued license keys. Provide both `duration_count` and
258
+ * `duration_interval` together for a fixed duration; omit both for non-expiring
259
+ * keys.
260
+ */
186
261
  duration_count?: number | null;
187
262
 
263
+ /**
264
+ * Unit of `duration_count`.
265
+ */
188
266
  duration_interval?: SubscriptionsAPI.TimeInterval | null;
189
267
  }
190
268
  }
191
269
 
192
270
  /**
193
- * Public-facing variant of [`IntegrationConfig`]. Mirrors every variant shape on
194
- * the wire EXCEPT `DigitalFiles`, which is replaced with a hydrated
195
- * `digital_files` object (resolved download URLs etc.). The persisted JSONB stays
196
- * ID-only via [`IntegrationConfig`]; this enum is response-only.
271
+ * Integration-specific configuration on an entitlement read response.
272
+ *
273
+ * For `digital_files` entitlements the response includes presigned download URLs
274
+ * for each attached file; other integrations match the shape supplied at creation.
197
275
  */
198
276
  export type IntegrationConfigResponse =
199
277
  | IntegrationConfigResponse.GitHubConfig
@@ -207,60 +285,96 @@ export type IntegrationConfigResponse =
207
285
 
208
286
  export namespace IntegrationConfigResponse {
209
287
  export interface GitHubConfig {
210
- permission: string;
288
+ /**
289
+ * Permission to grant on the repository.
290
+ */
291
+ permission: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
211
292
 
293
+ /**
294
+ * Repository or organisation slug to grant access to.
295
+ */
212
296
  target_id: string;
213
297
  }
214
298
 
215
299
  export interface DiscordConfig {
300
+ /**
301
+ * Discord guild (server) ID.
302
+ */
216
303
  guild_id: string;
217
304
 
305
+ /**
306
+ * Optional Discord role to assign within the guild.
307
+ */
218
308
  role_id?: string | null;
219
309
  }
220
310
 
221
311
  export interface TelegramConfig {
312
+ /**
313
+ * Telegram chat ID. For groups this is typically a negative integer.
314
+ */
222
315
  chat_id: string;
223
316
  }
224
317
 
225
318
  export interface FigmaConfig {
319
+ /**
320
+ * Figma file identifier to grant access to.
321
+ */
226
322
  figma_file_id: string;
227
323
  }
228
324
 
229
325
  export interface FramerConfig {
326
+ /**
327
+ * Framer template identifier to grant access to.
328
+ */
230
329
  framer_template_id: string;
231
330
  }
232
331
 
233
332
  export interface NotionConfig {
333
+ /**
334
+ * Notion template identifier to grant access to.
335
+ */
234
336
  notion_template_id: string;
235
337
  }
236
338
 
237
339
  export interface DigitalFilesConfig {
238
340
  /**
239
- * Populated digital-files payload for entitlement read surfaces. Mirrors
240
- * `DigitalProductDelivery` but is sourced from an entitlement's
241
- * `integration_config` (not a grant) and tags each file with its origin (`legacy`
242
- * vs `ee`).
341
+ * Populated digital-files payload with each file's metadata and a short-lived
342
+ * presigned download URL.
243
343
  */
244
344
  digital_files: DigitalFilesConfig.DigitalFiles;
245
345
  }
246
346
 
247
347
  export namespace DigitalFilesConfig {
248
348
  /**
249
- * Populated digital-files payload for entitlement read surfaces. Mirrors
250
- * `DigitalProductDelivery` but is sourced from an entitlement's
251
- * `integration_config` (not a grant) and tags each file with its origin (`legacy`
252
- * vs `ee`).
349
+ * Populated digital-files payload with each file's metadata and a short-lived
350
+ * presigned download URL.
253
351
  */
254
352
  export interface DigitalFiles {
353
+ /**
354
+ * One entry per attached file.
355
+ */
255
356
  files: Array<DigitalFiles.File>;
256
357
 
358
+ /**
359
+ * Optional external URL, passed through from the entitlement configuration.
360
+ */
257
361
  external_url?: string | null;
258
362
 
363
+ /**
364
+ * Optional human-readable delivery instructions, passed through from the
365
+ * entitlement configuration.
366
+ */
259
367
  instructions?: string | null;
260
368
  }
261
369
 
262
370
  export namespace DigitalFiles {
371
+ /**
372
+ * One file in a resolved digital-files payload.
373
+ */
263
374
  export interface File {
375
+ /**
376
+ * Short-lived presigned URL for downloading the file.
377
+ */
264
378
  download_url: string;
265
379
 
266
380
  /**
@@ -268,30 +382,51 @@ export namespace IntegrationConfigResponse {
268
382
  */
269
383
  expires_in: number;
270
384
 
385
+ /**
386
+ * Identifier of the attached file.
387
+ */
271
388
  file_id: string;
272
389
 
390
+ /**
391
+ * Original filename of the attached file.
392
+ */
273
393
  filename: string;
274
394
 
275
395
  /**
276
- * `"legacy"` for files in `product_files`, `"ee"` for files managed by the
277
- * Entitlements Engine.
396
+ * Optional content-type declared at upload.
278
397
  */
279
- source: string;
280
-
281
398
  content_type?: string | null;
282
399
 
400
+ /**
401
+ * Optional size of the file in bytes.
402
+ */
283
403
  file_size?: number | null;
284
404
  }
285
405
  }
286
406
  }
287
407
 
288
408
  export interface LicenseKeyConfig {
409
+ /**
410
+ * Optional message displayed when a customer activates the license key (≤ 2500
411
+ * characters).
412
+ */
289
413
  activation_message?: string | null;
290
414
 
415
+ /**
416
+ * Maximum activations allowed per issued license key. Omit for unlimited.
417
+ */
291
418
  activations_limit?: number | null;
292
419
 
420
+ /**
421
+ * Validity duration of issued license keys. Provide both `duration_count` and
422
+ * `duration_interval` together for a fixed duration; omit both for non-expiring
423
+ * keys.
424
+ */
293
425
  duration_count?: number | null;
294
426
 
427
+ /**
428
+ * Unit of `duration_count`.
429
+ */
295
430
  duration_interval?: SubscriptionsAPI.TimeInterval | null;
296
431
  }
297
432
  }
@@ -318,17 +453,17 @@ export interface EntitlementCreateParams {
318
453
  description?: string | null;
319
454
 
320
455
  /**
321
- * Optional user-facing metadata
456
+ * Additional metadata for the entitlement
322
457
  */
323
- metadata?: { [key: string]: string } | null;
458
+ metadata?: { [key: string]: string };
324
459
  }
325
460
 
326
461
  export interface EntitlementUpdateParams {
327
462
  description?: string | null;
328
463
 
329
464
  /**
330
- * Platform-specific configuration for an entitlement. Each variant uses unique
331
- * field names so `#[serde(untagged)]` can disambiguate correctly.
465
+ * Integration-specific configuration supplied when creating or updating an
466
+ * entitlement. The shape required matches the entitlement's `integration_type`.
332
467
  */
333
468
  integration_config?: IntegrationConfig | null;
334
469
 
@@ -8,10 +8,7 @@ import { path } from '../../internal/utils/path';
8
8
 
9
9
  export class Files extends APIResource {
10
10
  /**
11
- * Companion to `post_entitlement_file`. Deletes the file from the Entitlements
12
- * Engine (force=true) and atomically removes the `file_id` from the entitlement's
13
- * `integration_config.digital_file_ids` JSONB array. EE delete happens first; if
14
- * it fails we surface the error and leave local state untouched.
11
+ * Detach a previously-attached file from a `digital_files` entitlement.
15
12
  */
16
13
  delete(fileID: string, params: FileDeleteParams, options?: RequestOptions): APIPromise<void> {
17
14
  const { id } = params;
@@ -22,11 +19,7 @@ export class Files extends APIResource {
22
19
  }
23
20
 
24
21
  /**
25
- * Streams a multipart/form-data body to the Entitlements Engine
26
- * (`POST /api/digital-files/dodo/files/upload`) and appends the returned `file_id`
27
- * to the entitlement's `integration_config.digital_file_ids` using a JSONB array
28
- * append. Compensates EE-side on local DB write failure (best-effort delete of the
29
- * just-uploaded file).
22
+ * Attach a file to a `digital_files` entitlement. Per-file size cap: 500 MiB.
30
23
  */
31
24
  upload(id: string, options?: RequestOptions): APIPromise<FileUploadResponse> {
32
25
  return this._client.post(path`/entitlements/${id}/files`, options);
@@ -35,8 +28,8 @@ export class Files extends APIResource {
35
28
 
36
29
  export interface FileUploadResponse {
37
30
  /**
38
- * EE-issued digital file id; appended to
39
- * `entitlements.integration_config.digital_file_ids`.
31
+ * Identifier of the attached file. Pass it to
32
+ * `DELETE /entitlements/{id}/files/{file_id}` to detach the file later.
40
33
  */
41
34
  file_id: string;
42
35
  }
@@ -28,10 +28,8 @@ export class Grants extends APIResource {
28
28
  }
29
29
 
30
30
  /**
31
- * Revokes a single entitlement grant for the caller's business. For LicenseKey
32
- * integrations, also disables the backing license key. Idempotent: re-revoking an
33
- * already-revoked grant returns 200 with current state. The revocation reason is
34
- * always set to "manual" for API-initiated revocations.
31
+ * Revoke a single grant. Idempotent: re-revoking an already-revoked grant returns
32
+ * the grant in its current state.
35
33
  */
36
34
  revoke(grantID: string, params: GrantRevokeParams, options?: RequestOptions): APIPromise<EntitlementGrant> {
37
35
  const { id } = params;
@@ -41,68 +39,134 @@ export class Grants extends APIResource {
41
39
 
42
40
  export type EntitlementGrantsDefaultPageNumberPagination = DefaultPageNumberPagination<EntitlementGrant>;
43
41
 
42
+ /**
43
+ * Detailed view of a single entitlement grant: who it's for, its lifecycle state,
44
+ * and any integration-specific delivery payload.
45
+ */
44
46
  export interface EntitlementGrant {
47
+ /**
48
+ * Unique identifier of the grant.
49
+ */
45
50
  id: string;
46
51
 
52
+ /**
53
+ * Identifier of the business that owns the grant.
54
+ */
47
55
  business_id: string;
48
56
 
57
+ /**
58
+ * Timestamp when the grant was created.
59
+ */
49
60
  created_at: string;
50
61
 
62
+ /**
63
+ * Identifier of the customer the grant was issued to.
64
+ */
51
65
  customer_id: string;
52
66
 
67
+ /**
68
+ * Identifier of the entitlement this grant was issued from.
69
+ */
53
70
  entitlement_id: string;
54
71
 
55
- external_id: string;
72
+ /**
73
+ * Arbitrary key-value metadata recorded on the grant.
74
+ */
75
+ metadata: { [key: string]: string };
56
76
 
77
+ /**
78
+ * Lifecycle status of the grant.
79
+ */
57
80
  status: 'Pending' | 'Delivered' | 'Failed' | 'Revoked';
58
81
 
82
+ /**
83
+ * Timestamp when the grant was last modified.
84
+ */
59
85
  updated_at: string;
60
86
 
87
+ /**
88
+ * Timestamp when the grant transitioned to `delivered`, when applicable.
89
+ */
61
90
  delivered_at?: string | null;
62
91
 
63
92
  /**
64
- * Present only when the entitlement integration_type is `digital_files`. Populated
65
- * eagerly on every list and single-record endpoint.
93
+ * Digital-product-delivery payload, present when the entitlement integration is
94
+ * `digital_files`.
66
95
  */
67
96
  digital_product_delivery?: ProductsAPI.DigitalProductDelivery | null;
68
97
 
98
+ /**
99
+ * Machine-readable code reported when delivery failed, when applicable.
100
+ */
69
101
  error_code?: string | null;
70
102
 
103
+ /**
104
+ * Human-readable message reported when delivery failed, when applicable.
105
+ */
71
106
  error_message?: string | null;
72
107
 
73
108
  /**
74
- * Present only when the entitlement integration_type is `license_key`.
109
+ * License-key delivery payload, present when the entitlement integration is
110
+ * `license_key`.
75
111
  */
76
112
  license_key?: LicenseKeyGrant | null;
77
113
 
78
- metadata?: unknown;
79
-
114
+ /**
115
+ * Timestamp when `oauth_url` stops being valid, when applicable.
116
+ */
80
117
  oauth_expires_at?: string | null;
81
118
 
119
+ /**
120
+ * Customer-facing OAuth URL for OAuth-style integrations. Populated during the
121
+ * customer-portal accept flow; `null` until the customer completes that step, and
122
+ * on grants for non-OAuth integrations.
123
+ */
82
124
  oauth_url?: string | null;
83
125
 
126
+ /**
127
+ * Identifier of the payment that triggered this grant, when applicable.
128
+ */
84
129
  payment_id?: string | null;
85
130
 
131
+ /**
132
+ * Reason recorded when the grant was revoked, when applicable.
133
+ */
86
134
  revocation_reason?: string | null;
87
135
 
136
+ /**
137
+ * Timestamp when the grant transitioned to `revoked`, when applicable.
138
+ */
88
139
  revoked_at?: string | null;
89
140
 
141
+ /**
142
+ * Identifier of the subscription that triggered this grant, when applicable.
143
+ */
90
144
  subscription_id?: string | null;
91
145
  }
92
146
 
93
147
  /**
94
- * Nested representation of license-key grant fields. Present only when the grant's
95
- * entitlement has `integration_type = 'license_key'` and a row exists in
96
- * `license_keys`. The grant's top-level `status` is the source of truth for the
97
- * grant's lifecycle — no per-license-key status is exposed here.
148
+ * License-key delivery payload, present on grants for `license_key` entitlements.
149
+ * The grant's top-level `status` is the source of truth for the grant's lifecycle.
98
150
  */
99
151
  export interface LicenseKeyGrant {
152
+ /**
153
+ * Number of activations consumed so far.
154
+ */
100
155
  activations_used: number;
101
156
 
157
+ /**
158
+ * Issued license key.
159
+ */
102
160
  key: string;
103
161
 
162
+ /**
163
+ * Maximum activations allowed by the entitlement, when set.
164
+ */
104
165
  activations_limit?: number | null;
105
166
 
167
+ /**
168
+ * When the license key expires, when applicable.
169
+ */
106
170
  expires_at?: string | null;
107
171
  }
108
172
 
@@ -333,20 +333,34 @@ export interface CreditEntitlementMappingResponse {
333
333
  }
334
334
 
335
335
  /**
336
- * Digital-product-delivery payload for a grant. Populated for grants whose
337
- * entitlement has `integration_type = 'digital_files'`. `files` carries presigned
338
- * download URLs; the source (EE service or legacy in-process S3 presigning) is
339
- * opaque to the caller.
336
+ * Digital-product-delivery payload, present on grants for `digital_files`
337
+ * entitlements. Each file carries a short-lived presigned download URL.
340
338
  */
341
339
  export interface DigitalProductDelivery {
340
+ /**
341
+ * One entry per attached file.
342
+ */
342
343
  files: Array<DigitalProductDeliveryFile>;
343
344
 
345
+ /**
346
+ * Optional external URL, passed through from the entitlement configuration.
347
+ */
344
348
  external_url?: string | null;
345
349
 
350
+ /**
351
+ * Optional human-readable delivery instructions, passed through from the
352
+ * entitlement configuration.
353
+ */
346
354
  instructions?: string | null;
347
355
  }
348
356
 
357
+ /**
358
+ * One file in a digital-product delivery payload.
359
+ */
349
360
  export interface DigitalProductDeliveryFile {
361
+ /**
362
+ * Short-lived presigned URL for downloading the file.
363
+ */
350
364
  download_url: string;
351
365
 
352
366
  /**
@@ -354,12 +368,24 @@ export interface DigitalProductDeliveryFile {
354
368
  */
355
369
  expires_in: number;
356
370
 
371
+ /**
372
+ * Identifier of the attached file.
373
+ */
357
374
  file_id: string;
358
375
 
376
+ /**
377
+ * Original filename of the attached file.
378
+ */
359
379
  filename: string;
360
380
 
381
+ /**
382
+ * Optional content-type declared at upload.
383
+ */
361
384
  content_type?: string | null;
362
385
 
386
+ /**
387
+ * Optional size of the file in bytes.
388
+ */
363
389
  file_size?: number | null;
364
390
  }
365
391
 
@@ -614,10 +640,8 @@ export interface Product {
614
640
  description?: string | null;
615
641
 
616
642
  /**
617
- * Digital-product-delivery payload for a grant. Populated for grants whose
618
- * entitlement has `integration_type = 'digital_files'`. `files` carries presigned
619
- * download URLs; the source (EE service or legacy in-process S3 presigning) is
620
- * opaque to the caller.
643
+ * Digital-product-delivery payload, present on grants for `digital_files`
644
+ * entitlements. Each file carries a short-lived presigned download URL.
621
645
  */
622
646
  digital_product_delivery?: DigitalProductDelivery | null;
623
647
 
@@ -664,10 +688,10 @@ export interface ProductEntitlementSummary {
664
688
  id: string;
665
689
 
666
690
  /**
667
- * Public-facing variant of [`IntegrationConfig`]. Mirrors every variant shape on
668
- * the wire EXCEPT `DigitalFiles`, which is replaced with a hydrated
669
- * `digital_files` object (resolved download URLs etc.). The persisted JSONB stays
670
- * ID-only via [`IntegrationConfig`]; this enum is response-only.
691
+ * Integration-specific configuration on an entitlement read response.
692
+ *
693
+ * For `digital_files` entitlements the response includes presigned download URLs
694
+ * for each attached file; other integrations match the shape supplied at creation.
671
695
  */
672
696
  integration_config: EntitlementsAPI.IntegrationConfigResponse;
673
697
 
@@ -175,6 +175,10 @@ export namespace WebhookPayload {
175
175
  payment_id?: string | null;
176
176
  }
177
177
 
178
+ /**
179
+ * Detailed view of a single entitlement grant: who it's for, its lifecycle state,
180
+ * and any integration-specific delivery payload.
181
+ */
178
182
  export interface EntitlementGrant extends GrantsAPI.EntitlementGrant {
179
183
  payload_type: 'EntitlementGrant';
180
184
  }