@crvouga/mockingbird-service-paddle 1.3.0 → 2.1.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/openapi.yaml CHANGED
@@ -1389,27 +1389,113 @@ paths:
1389
1389
  get:
1390
1390
  operationId: ListNotificationSettings
1391
1391
  x-mockingbird:
1392
- supported: false
1393
- reason: Notification destinations are configured on the mock (`--webhook-url`, `PUT /__admin/webhook-endpoints`), not through the API.
1392
+ supported: true
1393
+ parity:
1394
+ enabled: true
1395
+ safe: true
1396
+ parameters:
1397
+ - $ref: "#/components/parameters/After"
1398
+ - $ref: "#/components/parameters/PerPage"
1399
+ - $ref: "#/components/parameters/OrderBy"
1394
1400
  responses:
1395
1401
  "200":
1396
- description: Notification settings
1402
+ description: Notification destinations, newest first. Secrets are not included.
1397
1403
  content:
1398
1404
  application/json:
1399
1405
  schema:
1400
1406
  type: object
1407
+ required: [data, meta]
1408
+ properties:
1409
+ data:
1410
+ type: array
1411
+ items:
1412
+ $ref: "#/components/schemas/NotificationSetting"
1413
+ meta:
1414
+ $ref: "#/components/schemas/MetaPaginated"
1415
+ "400":
1416
+ $ref: "#/components/responses/BadRequest"
1417
+ "403":
1418
+ $ref: "#/components/responses/Forbidden"
1401
1419
  post:
1402
1420
  operationId: CreateNotificationSetting
1403
1421
  x-mockingbird:
1404
- supported: false
1405
- reason: Notification destinations are configured on the mock (`--webhook-url`, `PUT /__admin/webhook-endpoints`), not through the API.
1422
+ supported: true
1423
+ parity:
1424
+ enabled: true
1425
+ safe: false
1426
+ requestBody:
1427
+ required: true
1428
+ content:
1429
+ application/json:
1430
+ schema:
1431
+ $ref: "#/components/schemas/NotificationSettingCreate"
1406
1432
  responses:
1407
1433
  "201":
1408
- description: The created notification setting
1434
+ description: The created destination, including its endpoint secret
1409
1435
  content:
1410
1436
  application/json:
1411
1437
  schema:
1412
- type: object
1438
+ $ref: "#/components/schemas/NotificationSettingResponse"
1439
+ "400":
1440
+ $ref: "#/components/responses/BadRequest"
1441
+ "403":
1442
+ $ref: "#/components/responses/Forbidden"
1443
+ /notification-settings/{notification_setting_id}:
1444
+ parameters:
1445
+ - name: notification_setting_id
1446
+ in: path
1447
+ required: true
1448
+ schema:
1449
+ type: string
1450
+ x-mockingbird-resource-ref:
1451
+ type: notification_setting
1452
+ missing: ntfset_00000000000000000000000000
1453
+ get:
1454
+ operationId: GetNotificationSetting
1455
+ x-mockingbird:
1456
+ supported: true
1457
+ parity:
1458
+ enabled: true
1459
+ safe: true
1460
+ responses:
1461
+ "200":
1462
+ description: The notification destination, without its secret
1463
+ content:
1464
+ application/json:
1465
+ schema:
1466
+ $ref: "#/components/schemas/NotificationSettingResponse"
1467
+ "400":
1468
+ $ref: "#/components/responses/BadRequest"
1469
+ "403":
1470
+ $ref: "#/components/responses/Forbidden"
1471
+ "404":
1472
+ $ref: "#/components/responses/NotFound"
1473
+ patch:
1474
+ operationId: UpdateNotificationSetting
1475
+ x-mockingbird:
1476
+ supported: true
1477
+ parity:
1478
+ enabled: true
1479
+ safe: false
1480
+ requestBody:
1481
+ required: true
1482
+ content:
1483
+ application/json:
1484
+ schema:
1485
+ $ref: "#/components/schemas/NotificationSettingUpdate"
1486
+ responses:
1487
+ "200":
1488
+ description: The updated destination. The existing secret stays valid and is not returned.
1489
+ content:
1490
+ application/json:
1491
+ schema:
1492
+ $ref: "#/components/schemas/NotificationSettingResponse"
1493
+ "400":
1494
+ $ref: "#/components/responses/BadRequest"
1495
+ "403":
1496
+ $ref: "#/components/responses/Forbidden"
1497
+ "404":
1498
+ $ref: "#/components/responses/NotFound"
1413
1499
  /discounts:
1414
1500
  get:
1415
1501
  operationId: ListDiscounts
@@ -1466,15 +1552,29 @@ paths:
1466
1552
  post:
1467
1553
  operationId: CreateCustomerPortalSession
1468
1554
  x-mockingbird:
1469
- supported: false
1470
- reason: The hosted customer portal is not served; `management_urls` on a subscription point at placeholder links.
1555
+ supported: true
1556
+ parity:
1557
+ enabled: true
1558
+ safe: false
1559
+ requestBody:
1560
+ required: false
1561
+ content:
1562
+ application/json:
1563
+ schema:
1564
+ $ref: "#/components/schemas/PortalSessionCreate"
1471
1565
  responses:
1472
1566
  "201":
1473
- description: The created portal session
1567
+ description: The created portal session and its temporary https links
1474
1568
  content:
1475
1569
  application/json:
1476
1570
  schema:
1477
- type: object
1571
+ $ref: "#/components/schemas/PortalSessionResponse"
1572
+ "400":
1573
+ $ref: "#/components/responses/BadRequest"
1574
+ "403":
1575
+ $ref: "#/components/responses/Forbidden"
1576
+ "404":
1577
+ $ref: "#/components/responses/NotFound"
1478
1578
  components:
1479
1579
  securitySchemes:
1480
1580
  bearerAuth:
@@ -3043,3 +3143,230 @@ components:
3043
3143
  type: "null"
3044
3144
  data:
3045
3145
  type: object
3146
+ NotificationEventName:
3147
+ type: string
3148
+ enum:
3149
+ - customer.created
3150
+ - customer.updated
3151
+ - transaction.created
3152
+ - transaction.updated
3153
+ - transaction.paid
3154
+ - transaction.completed
3155
+ - subscription.created
3156
+ - subscription.imported
3157
+ - subscription.updated
3158
+ - subscription.activated
3159
+ - subscription.trialing
3160
+ - subscription.past_due
3161
+ - subscription.paused
3162
+ - subscription.resumed
3163
+ - subscription.canceled
3164
+ NotificationEvent:
3165
+ oneOf:
3166
+ - $ref: "#/components/schemas/NotificationEventName"
3167
+ - type: object
3168
+ required: [name]
3169
+ properties:
3170
+ name:
3171
+ $ref: "#/components/schemas/NotificationEventName"
3172
+ NotificationDestination:
3173
+ type: string
3174
+ minLength: 1
3175
+ maxLength: 200
3176
+ pattern: "^(https://[A-Za-z0-9./_-]+|[A-Za-z0-9._+-]+@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)+)$"
3177
+ NotificationSetting:
3178
+ type: object
3179
+ required:
3180
+ - id
3181
+ - description
3182
+ - type
3183
+ - destination
3184
+ - active
3185
+ - api_version
3186
+ - traffic_source
3187
+ - include_sensitive_fields
3188
+ - subscribed_events
3189
+ - created_at
3190
+ - updated_at
3191
+ properties:
3192
+ id:
3193
+ type: string
3194
+ x-mockingbird-resource:
3195
+ type: notification_setting
3196
+ identity: true
3197
+ x-mockingbird-volatile:
3198
+ kind: id
3199
+ description:
3200
+ type: string
3201
+ type:
3202
+ type: string
3203
+ enum: [url, email]
3204
+ destination:
3205
+ type: string
3206
+ active:
3207
+ type: boolean
3208
+ api_version:
3209
+ type: integer
3210
+ traffic_source:
3211
+ type: string
3212
+ enum: [platform, simulation, all]
3213
+ include_sensitive_fields:
3214
+ type: boolean
3215
+ subscribed_events:
3216
+ type: array
3217
+ items:
3218
+ type: object
3219
+ required: [name]
3220
+ properties:
3221
+ name:
3222
+ type: string
3223
+ endpoint_secret_key:
3224
+ type: string
3225
+ description: Present on create only.
3226
+ x-mockingbird-volatile:
3227
+ kind: token
3228
+ created_at:
3229
+ $ref: "#/components/schemas/Timestamp"
3230
+ updated_at:
3231
+ $ref: "#/components/schemas/Timestamp"
3232
+ NotificationSettingResponse:
3233
+ type: object
3234
+ required: [data, meta]
3235
+ properties:
3236
+ data:
3237
+ $ref: "#/components/schemas/NotificationSetting"
3238
+ meta:
3239
+ $ref: "#/components/schemas/Meta"
3240
+ NotificationSettingCreate:
3241
+ type: object
3242
+ required: [description, destination, type, subscribed_events]
3243
+ properties:
3244
+ description:
3245
+ type: string
3246
+ minLength: 1
3247
+ maxLength: 200
3248
+ destination:
3249
+ $ref: "#/components/schemas/NotificationDestination"
3250
+ type:
3251
+ type: string
3252
+ enum: [url, email]
3253
+ active:
3254
+ type: boolean
3255
+ subscribed_events:
3256
+ type: array
3257
+ minItems: 1
3258
+ maxItems: 20
3259
+ items:
3260
+ $ref: "#/components/schemas/NotificationEvent"
3261
+ api_version:
3262
+ type: integer
3263
+ minimum: 1
3264
+ maximum: 1
3265
+ traffic_source:
3266
+ type: string
3267
+ enum: [platform, simulation, all]
3268
+ include_sensitive_fields:
3269
+ type: boolean
3270
+ NotificationSettingUpdate:
3271
+ type: object
3272
+ properties:
3273
+ description:
3274
+ type: string
3275
+ minLength: 1
3276
+ maxLength: 200
3277
+ destination:
3278
+ $ref: "#/components/schemas/NotificationDestination"
3279
+ type:
3280
+ type: string
3281
+ enum: [url, email]
3282
+ active:
3283
+ type: boolean
3284
+ subscribed_events:
3285
+ type: array
3286
+ minItems: 1
3287
+ maxItems: 20
3288
+ items:
3289
+ $ref: "#/components/schemas/NotificationEvent"
3290
+ api_version:
3291
+ type: integer
3292
+ minimum: 1
3293
+ maximum: 1
3294
+ traffic_source:
3295
+ type: string
3296
+ enum: [platform, simulation, all]
3297
+ include_sensitive_fields:
3298
+ type: boolean
3299
+ PortalSession:
3300
+ type: object
3301
+ required: [id, customer_id, urls, created_at]
3302
+ properties:
3303
+ id:
3304
+ type: string
3305
+ x-mockingbird-resource:
3306
+ type: portal_session
3307
+ identity: true
3308
+ x-mockingbird-volatile:
3309
+ kind: id
3310
+ customer_id:
3311
+ type: string
3312
+ x-mockingbird-volatile:
3313
+ kind: id
3314
+ urls:
3315
+ type: object
3316
+ required: [general, subscriptions]
3317
+ properties:
3318
+ general:
3319
+ type: object
3320
+ required: [overview]
3321
+ properties:
3322
+ overview:
3323
+ type: string
3324
+ x-mockingbird-volatile:
3325
+ kind: url
3326
+ subscriptions:
3327
+ type: array
3328
+ items:
3329
+ type: object
3330
+ required:
3331
+ - id
3332
+ - cancel_subscription
3333
+ - update_subscription_payment_method
3334
+ - update_subscription
3335
+ properties:
3336
+ id:
3337
+ type: string
3338
+ x-mockingbird-volatile:
3339
+ kind: id
3340
+ cancel_subscription:
3341
+ type: string
3342
+ x-mockingbird-volatile:
3343
+ kind: url
3344
+ update_subscription_payment_method:
3345
+ type: string
3346
+ x-mockingbird-volatile:
3347
+ kind: url
3348
+ update_subscription:
3349
+ type: string
3350
+ x-mockingbird-volatile:
3351
+ kind: url
3352
+ created_at:
3353
+ $ref: "#/components/schemas/Timestamp"
3354
+ PortalSessionResponse:
3355
+ type: object
3356
+ required: [data, meta]
3357
+ properties:
3358
+ data:
3359
+ $ref: "#/components/schemas/PortalSession"
3360
+ meta:
3361
+ $ref: "#/components/schemas/Meta"
3362
+ PortalSessionCreate:
3363
+ type: object
3364
+ properties:
3365
+ subscription_ids:
3366
+ type: array
3367
+ maxItems: 20
3368
+ items:
3369
+ type: string
3370
+ x-mockingbird-resource-ref:
3371
+ type: subscription
3372
+ missing: sub_00000000000000000000000000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-paddle",
3
- "version": "1.3.0",
3
+ "version": "2.1.0",
4
4
  "description": "Stateful mock of the Paddle Billing API (customers, addresses, businesses, products, prices, transactions with computed totals, subscriptions with pause/resume/cancel and renewals, events) with Paddle-Signature webhooks and admin routes that simulate checkout, renewals and failed payments (Mockingbird service contract).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -105,7 +105,7 @@
105
105
  "pack:check": "bun ../../../scripts/pack-check.ts"
106
106
  },
107
107
  "dependencies": {
108
- "@crvouga/mockingbird-service-sqlite": "2.1.1",
108
+ "@crvouga/mockingbird-service-sqlite": "3.0.0",
109
109
  "hono": "4.11.9"
110
110
  },
111
111
  "devDependencies": {