@portpowered/reference-data 0.4.0 → 0.4.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 (58) hide show
  1. package/generated/openapi.json +375 -25
  2. package/generated/public/docs/for-ai/operations/addEndpointGroupMembers.md +2 -0
  3. package/generated/public/docs/for-ai/operations/authorizeDevice.md +16 -0
  4. package/generated/public/docs/for-ai/operations/completeOAuthConsent.md +5 -0
  5. package/generated/public/docs/for-ai/operations/createFlowNode.md +2 -0
  6. package/generated/public/docs/for-ai/operations/createOAuthClient.md +5 -0
  7. package/generated/public/docs/for-ai/operations/createToken.md +4 -0
  8. package/generated/public/docs/for-ai/operations/createView.md +6 -0
  9. package/generated/public/docs/for-ai/operations/deleteEndpoint.md +1 -1
  10. package/generated/public/docs/for-ai/operations/deleteFlowNode.md +2 -0
  11. package/generated/public/docs/for-ai/operations/deleteRoute.md +1 -1
  12. package/generated/public/docs/for-ai/operations/deviceAuthorize.md +21 -6
  13. package/generated/public/docs/for-ai/operations/enumerateEndpoints.md +14 -4
  14. package/generated/public/docs/for-ai/operations/establishAuthLink.md +2 -0
  15. package/generated/public/docs/for-ai/operations/establishPlugin.md +5 -0
  16. package/generated/public/docs/for-ai/operations/evaluateAccessControlRule.md +2 -0
  17. package/generated/public/docs/for-ai/operations/generateOAuthCode.md +6 -0
  18. package/generated/public/docs/for-ai/operations/generateToken.md +1 -1
  19. package/generated/public/docs/for-ai/operations/generateTuyaQrCode.md +3 -0
  20. package/generated/public/docs/for-ai/operations/getAccessControlRules.md +2 -0
  21. package/generated/public/docs/for-ai/operations/getEndpointGroup.md +8 -0
  22. package/generated/public/docs/for-ai/operations/getOAuthAuthorizationServerMetadata.md +19 -1
  23. package/generated/public/docs/for-ai/operations/getOAuthClient.md +3 -0
  24. package/generated/public/docs/for-ai/operations/getOpenIDConfiguration.md +12 -1
  25. package/generated/public/docs/for-ai/operations/getPendingOAuthConsent.md +6 -0
  26. package/generated/public/docs/for-ai/operations/getView.md +2 -0
  27. package/generated/public/docs/for-ai/operations/handleGoogleCloudSchedulerWebhook.md +3 -0
  28. package/generated/public/docs/for-ai/operations/handleOAuthCallback.md +7 -0
  29. package/generated/public/docs/for-ai/operations/index.md +1 -1
  30. package/generated/public/docs/for-ai/operations/invalidateToken.md +2 -0
  31. package/generated/public/docs/for-ai/operations/pluginAuthCodeExchange.md +4 -0
  32. package/generated/public/docs/for-ai/operations/pluginAuthMultifactorExchange.md +4 -0
  33. package/generated/public/docs/for-ai/operations/pushToMessageGateway.md +2 -0
  34. package/generated/public/docs/for-ai/operations/raiseAnonymousPrincipal.md +17 -0
  35. package/generated/public/docs/for-ai/operations/refreshAuthLinkToken.md +2 -0
  36. package/generated/public/docs/for-ai/operations/registerDynamicOAuthClient.md +9 -0
  37. package/generated/public/docs/for-ai/operations/removeEndpointGroupMembers.md +2 -0
  38. package/generated/public/docs/for-ai/operations/revokeOAuthGrant.md +3 -0
  39. package/generated/public/docs/for-ai/operations/setEndpointGroupName.md +4 -0
  40. package/generated/public/docs/for-ai/operations/synchronizeRoutes.md +2 -0
  41. package/generated/public/docs/for-ai/operations/updateOAuthClient.md +2 -0
  42. package/generated/public/docs/for-ai/operations/updateView.md +6 -0
  43. package/generated/public/docs/for-ai/operations/upsertAccessControlRule.md +5 -0
  44. package/generated/public/docs/for-ai/operations/upsertAuthLink.md +6 -0
  45. package/generated/public/docs/for-ai/operations/upsertEndpoint.md +6 -0
  46. package/generated/public/docs/for-ai/operations/upsertPluginRequest.md +2 -0
  47. package/generated/public/docs/for-ai/operations/upsertPrincipal.md +2 -0
  48. package/generated/public/docs/for-ai/operations/upsertRoute.md +4 -0
  49. package/generated/public/docs/for-ai/operations/upsertSecret.md +6 -0
  50. package/generated/public/docs/for-ai/operations/upsertSimulator.md +4 -0
  51. package/generated/public/docs/for-ai/operations/validateOAuthRequest.md +6 -0
  52. package/generated/public/docs/for-ai/operations/validateTuyaLoginCode.md +4 -0
  53. package/generated/public/docs/for-ai/operations/verifyDevice.md +11 -0
  54. package/generated/public/docs/references/authorization.json +2 -2
  55. package/generated/public/docs/references/authorization.yaml +2 -2
  56. package/generated/public/docs/references/manifest.json +108 -108
  57. package/generated/public/docs/references/openapi.yaml +282 -23
  58. package/package.json +1 -1
@@ -269,7 +269,18 @@ paths:
269
269
  - urn:ietf:params:oauth:grant-type:token-exchange
270
270
  - urn:ietf:params:oauth:grant-type:device_code
271
271
  example:
272
- key: value
272
+ issuer: https://portos-pilot-api-685761720421.us-west1.run.app
273
+ jwks_uri: https://portos-pilot-api-685761720421.us-west1.run.app/.well-known/jwks.json
274
+ token_endpoint: https://portos-pilot-api-685761720421.us-west1.run.app/auth/token
275
+ response_types_supported:
276
+ - code
277
+ subject_types_supported:
278
+ - public
279
+ id_token_signing_alg_values_supported:
280
+ - RS256
281
+ grant_types_supported:
282
+ - authorization_code
283
+ - refresh_token
273
284
  x-portos-delegated: false
274
285
  x-portos-resource-permission: false
275
286
  /.well-known/oauth-authorization-server:
@@ -293,7 +304,6 @@ paths:
293
304
  - issuer
294
305
  - authorization_endpoint
295
306
  - token_endpoint
296
- - registration_endpoint
297
307
  - revocation_endpoint
298
308
  - scopes_supported
299
309
  properties:
@@ -309,6 +319,7 @@ paths:
309
319
  registration_endpoint:
310
320
  type: string
311
321
  format: uri
322
+ description: Advertised when new anonymous registration is enabled; omitted when disabled.
312
323
  revocation_endpoint:
313
324
  type: string
314
325
  format: uri
@@ -333,6 +344,24 @@ paths:
333
344
  type: boolean
334
345
  authorization_response_iss_parameter_supported:
335
346
  type: boolean
347
+ example:
348
+ issuer: https://portos-pilot-api-685761720421.us-west1.run.app
349
+ authorization_endpoint: https://portos-pilot-api-685761720421.us-west1.run.app/oauth/authorize
350
+ token_endpoint: https://portos-pilot-api-685761720421.us-west1.run.app/auth/token
351
+ revocation_endpoint: https://portos-pilot-api-685761720421.us-west1.run.app/auth/revoke
352
+ scopes_supported:
353
+ - endpoint:read
354
+ - message:send
355
+ registration_endpoint: https://portos-pilot-api-685761720421.us-west1.run.app/oauth/register
356
+ jwks_uri: https://portos-pilot-api-685761720421.us-west1.run.app/.well-known/jwks.json
357
+ code_challenge_methods_supported:
358
+ - S256
359
+ token_endpoint_auth_methods_supported:
360
+ - none
361
+ - client_secret_post
362
+ - client_secret_basic
363
+ client_id_metadata_document_supported: true
364
+ authorization_response_iss_parameter_supported: true
336
365
  /.well-known/jwks.json:
337
366
  get:
338
367
  operationId: getJWKS
@@ -502,7 +531,7 @@ paths:
502
531
  check-token:
503
532
  value: ~caller
504
533
  check-id:
505
- value: port1/user/alice/user/alice
534
+ value: port1/principals/example
506
535
  - name: id
507
536
  in: query
508
537
  description: The unique identifier of a specific endpoint to retrieve
@@ -511,7 +540,7 @@ paths:
511
540
  type: string
512
541
  examples:
513
542
  endpoint-id:
514
- value: port1/user/alice/endpoints/abc-123
543
+ value: port1/principals/example/endpoints/light-1
515
544
  - name: type
516
545
  in: query
517
546
  description: Filter endpoints by their primary type
@@ -520,7 +549,7 @@ paths:
520
549
  type: string
521
550
  examples:
522
551
  type-filter:
523
- value: light
552
+ value: LIGHT
524
553
  - name: serialNumber
525
554
  in: query
526
555
  description: Filter endpoints by their serial number
@@ -538,7 +567,7 @@ paths:
538
567
  type: string
539
568
  examples:
540
569
  next-token:
541
- value: '123'
570
+ value: OPAQUE_TOKEN_FROM_PREVIOUS_RESPONSE
542
571
  - name: maxResults
543
572
  in: query
544
573
  description: The maximum number of results to return
@@ -578,6 +607,16 @@ paths:
578
607
  schema:
579
608
  $ref: '#/components/schemas/EndpointQueryResponse'
580
609
  examples: {}
610
+ example:
611
+ results:
612
+ - id: port1/principals/example/endpoints/light-1
613
+ name:
614
+ type: PLAIN
615
+ value: Office light
616
+ type: LIGHT
617
+ interfaces: []
618
+ ownerId: port1/principals/example
619
+ enablement: ENABLED
581
620
  '400':
582
621
  description: Bad request - missing required parameters
583
622
  content:
@@ -628,6 +667,12 @@ paths:
628
667
  application/json:
629
668
  schema:
630
669
  $ref: '#/components/schemas/UpsertEndpointRequest'
670
+ example:
671
+ id: port1/principals/example/endpoints/light-1
672
+ name:
673
+ type: PLAIN
674
+ value: Office light
675
+ type: LIGHT
631
676
  responses:
632
677
  '200':
633
678
  description: Endpoint upserted successfully
@@ -692,7 +737,7 @@ paths:
692
737
  schema:
693
738
  $ref: '#/components/schemas/DeleteEndpointRequest'
694
739
  example:
695
- id: port1/principals/user123/resources/abc-123
740
+ id: port1/principals/example/endpoints/light-1
696
741
  responses:
697
742
  '200':
698
743
  description: Endpoint deleted successfully
@@ -1506,6 +1551,10 @@ paths:
1506
1551
  application/json:
1507
1552
  schema:
1508
1553
  $ref: '#/components/schemas/Simulator'
1554
+ example:
1555
+ device_type: light
1556
+ id: port1.simulator.example
1557
+ name: Example device
1509
1558
  application/vnd.portos.simulator.v2+json:
1510
1559
  schema:
1511
1560
  $ref: '#/components/schemas/SimulatorV2'
@@ -1866,7 +1915,7 @@ paths:
1866
1915
  schema:
1867
1916
  $ref: '#/components/schemas/DeleteRouteRequest'
1868
1917
  example:
1869
- id: port1/principals/user123/resources/abc-123
1918
+ id: port1/principals/example/routes/light-route
1870
1919
  responses:
1871
1920
  '200':
1872
1921
  description: Route deleted successfully
@@ -1891,6 +1940,10 @@ paths:
1891
1940
  application/json:
1892
1941
  schema:
1893
1942
  $ref: '#/components/schemas/UpsertRouteRequest'
1943
+ example:
1944
+ id: port1/principals/example/routes/light-route
1945
+ endpointId: port1/principals/example/endpoints/light-1
1946
+ pluginId: port1/systems/zero/plugins/example
1894
1947
  responses:
1895
1948
  '200':
1896
1949
  description: Route upserted successfully
@@ -1927,6 +1980,8 @@ paths:
1927
1980
  application/json:
1928
1981
  schema:
1929
1982
  $ref: '#/components/schemas/SynchronizationRequest'
1983
+ example:
1984
+ routes: []
1930
1985
  responses:
1931
1986
  '200':
1932
1987
  description: Routes synchronized successfully
@@ -2073,6 +2128,8 @@ paths:
2073
2128
  application/json:
2074
2129
  schema:
2075
2130
  $ref: '#/components/schemas/UpsertPluginResponse'
2131
+ example:
2132
+ id: port1/principals/example/plugins/example
2076
2133
  '400':
2077
2134
  description: Invalid request payload
2078
2135
  '500':
@@ -2129,6 +2186,9 @@ paths:
2129
2186
  application/json:
2130
2187
  schema:
2131
2188
  $ref: '#/components/schemas/EstablishPluginRequest'
2189
+ example:
2190
+ plugin:
2191
+ type: LIGHT
2132
2192
  responses:
2133
2193
  '200':
2134
2194
  description: Plugin established successfully
@@ -2136,6 +2196,8 @@ paths:
2136
2196
  application/json:
2137
2197
  schema:
2138
2198
  $ref: '#/components/schemas/EstablishPluginResponse'
2199
+ example:
2200
+ pluginId: port1/principals/example
2139
2201
  '400':
2140
2202
  description: Invalid request payload
2141
2203
  content:
@@ -2239,6 +2301,12 @@ paths:
2239
2301
  application/json:
2240
2302
  schema:
2241
2303
  $ref: '#/components/schemas/UpsertAuthLinkRequest'
2304
+ example:
2305
+ authLink:
2306
+ associatedPrincipalId: port1/principals/example
2307
+ associatedPluginId: port1/systems/zero/plugins/example
2308
+ associatedSecrets:
2309
+ - id: port1/principals/example/secrets/plugin-credential
2242
2310
  responses:
2243
2311
  '200':
2244
2312
  description: Auth link created successfully
@@ -2304,6 +2372,8 @@ paths:
2304
2372
  application/json:
2305
2373
  schema:
2306
2374
  $ref: '#/components/schemas/EstablishAuthLinkRequest'
2375
+ example:
2376
+ pluginId: port1/principals/example
2307
2377
  responses:
2308
2378
  '200':
2309
2379
  description: Auth link established successfully
@@ -2376,6 +2446,8 @@ paths:
2376
2446
  authLinkId:
2377
2447
  type: string
2378
2448
  description: The ID of the auth link to refresh tokens for
2449
+ example:
2450
+ authLinkId: port1/principals/example
2379
2451
  responses:
2380
2452
  '200':
2381
2453
  description: Token refreshed successfully
@@ -2400,6 +2472,10 @@ paths:
2400
2472
  application/json:
2401
2473
  schema:
2402
2474
  $ref: '#/components/schemas/PluginAuthMultifactorExchangeRequest'
2475
+ example:
2476
+ pluginId: port1/principals/example
2477
+ principalId: port1/principals/example
2478
+ pluginAuthenticationData: {}
2403
2479
  responses:
2404
2480
  '202':
2405
2481
  description: Auth link setup started successfully, the operation is ongoing in the background.
@@ -2427,6 +2503,10 @@ paths:
2427
2503
  application/json:
2428
2504
  schema:
2429
2505
  $ref: '#/components/schemas/PluginAuthCodeExchangeRequest'
2506
+ example:
2507
+ pluginId: port1/principals/example
2508
+ principalId: port1/principals/example
2509
+ pluginAuthenticationData: {}
2430
2510
  responses:
2431
2511
  '202':
2432
2512
  description: Plugin auth code exchange started successfully, the operation is ongoing in the background.
@@ -2970,6 +3050,10 @@ paths:
2970
3050
  application/json:
2971
3051
  schema:
2972
3052
  $ref: '#/components/schemas/SetEndpointGroupNameRequest'
3053
+ example:
3054
+ name:
3055
+ type: LIGHT
3056
+ value: port1/principals/example
2973
3057
  responses:
2974
3058
  '202':
2975
3059
  description: Endpoint group name update accepted
@@ -3116,6 +3200,14 @@ paths:
3116
3200
  application/json:
3117
3201
  schema:
3118
3202
  $ref: '#/components/schemas/EndpointGroup'
3203
+ example:
3204
+ id: port1/principals/example/endpoint-groups/living-room
3205
+ name:
3206
+ type: LIGHT
3207
+ value: port1/principals/example
3208
+ ownerId: port1/principals/example
3209
+ interfaces: []
3210
+ etag: '"12"'
3119
3211
  '400':
3120
3212
  description: Invalid request payload
3121
3213
  content:
@@ -3313,6 +3405,8 @@ paths:
3313
3405
  application/json:
3314
3406
  schema:
3315
3407
  $ref: '#/components/schemas/AddEndpointGroupMembersRequest'
3408
+ example:
3409
+ memberEndpointIds: []
3316
3410
  responses:
3317
3411
  '202':
3318
3412
  description: Members addition accepted
@@ -3429,6 +3523,8 @@ paths:
3429
3523
  application/json:
3430
3524
  schema:
3431
3525
  $ref: '#/components/schemas/RemoveEndpointGroupMembersRequest'
3526
+ example:
3527
+ memberEndpointIds: []
3432
3528
  responses:
3433
3529
  '202':
3434
3530
  description: Members removal accepted
@@ -3709,6 +3805,11 @@ paths:
3709
3805
  application/json:
3710
3806
  schema:
3711
3807
  $ref: '#/components/schemas/UpsertAccessControlRuleRequest'
3808
+ example:
3809
+ operation: port1/principals/example
3810
+ resource: port1/users/alice/endpoints/thermostat-zero
3811
+ identity: port1/account/john/users/alice
3812
+ effect: ALLOW
3712
3813
  responses:
3713
3814
  '200':
3714
3815
  description: Access control rule upserted successfully
@@ -3796,6 +3897,8 @@ paths:
3796
3897
  application/json:
3797
3898
  schema:
3798
3899
  $ref: '#/components/schemas/GetAccessControlRulesResponse'
3900
+ example:
3901
+ results: []
3799
3902
  '500':
3800
3903
  description: Internal server error
3801
3904
  content:
@@ -3828,6 +3931,8 @@ paths:
3828
3931
  application/json:
3829
3932
  schema:
3830
3933
  $ref: '#/components/schemas/EvaluateAccessControlRuleRequest'
3934
+ example:
3935
+ requests: port1/principals/example
3831
3936
  responses:
3832
3937
  '200':
3833
3938
  description: Access control rule evaluated successfully
@@ -3999,6 +4104,12 @@ paths:
3999
4104
  application/json:
4000
4105
  schema:
4001
4106
  $ref: '#/components/schemas/UpsertSecretRequest'
4107
+ example:
4108
+ secret:
4109
+ id: port1/principals/example
4110
+ type: LIGHT
4111
+ clientId: port1/principals/example
4112
+ clientSecret: port1/principals/example
4002
4113
  responses:
4003
4114
  '200':
4004
4115
  description: Secret created successfully
@@ -4140,6 +4251,8 @@ paths:
4140
4251
  application/json:
4141
4252
  schema:
4142
4253
  $ref: '#/components/schemas/UpsertPrincipalRequest'
4254
+ example:
4255
+ items: port1/principals/example
4143
4256
  responses:
4144
4257
  '200':
4145
4258
  description: Principal created successfully
@@ -4221,7 +4334,7 @@ paths:
4221
4334
  redirect_uri: http://127.0.0.1:8765/callback
4222
4335
  code: CALLBACK_CODE
4223
4336
  code_verifier: ORIGINAL_RANDOM_PKCE_VERIFIER
4224
- resource: https://api.portpowered.com
4337
+ resource: https://portos-pilot-api-685761720421.us-west1.run.app
4225
4338
  responses:
4226
4339
  '200':
4227
4340
  description: Token generated successfully
@@ -4266,6 +4379,9 @@ paths:
4266
4379
  type: string
4267
4380
  client_id:
4268
4381
  type: string
4382
+ example:
4383
+ token: port1/principals/example
4384
+ client_id: dcr_example
4269
4385
  responses:
4270
4386
  '200':
4271
4387
  description: Grant revoked or token was already invalid.
@@ -4396,6 +4512,10 @@ paths:
4396
4512
  application/json:
4397
4513
  schema:
4398
4514
  $ref: '#/components/schemas/CreateTokenResponse'
4515
+ example:
4516
+ id: port1/principals/example
4517
+ token: port1/principals/example
4518
+ expires_at: '2026-10-08T12:00:00Z'
4399
4519
  '400':
4400
4520
  description: Invalid request (e.g. invalid subject, malformed body)
4401
4521
  '401':
@@ -4451,6 +4571,8 @@ paths:
4451
4571
  application/json:
4452
4572
  schema:
4453
4573
  $ref: '#/components/schemas/InvalidateTokenResponse'
4574
+ example:
4575
+ message: The request could not be completed. Check the supplied parameters and try again.
4454
4576
  '401':
4455
4577
  description: Unauthorized
4456
4578
  '403':
@@ -4494,6 +4616,10 @@ paths:
4494
4616
  type: string
4495
4617
  description: |
4496
4618
  Token type identifier. Must be urn:ietf:params:oauth:token-type:id_token
4619
+ example:
4620
+ anonymous_refresh_token: port1/principals/example
4621
+ subject_token: port1/principals/example
4622
+ subject_token_type: port1/principals/example
4497
4623
  responses:
4498
4624
  '200':
4499
4625
  description: Principal raised successfully
@@ -4501,24 +4627,37 @@ paths:
4501
4627
  application/json:
4502
4628
  schema:
4503
4629
  $ref: '#/components/schemas/GenerateTokenResponse'
4630
+ example:
4631
+ access_token: port1/principals/example
4632
+ token_type: port1/principals/example
4633
+ expires_in: 1
4504
4634
  '400':
4505
4635
  description: Invalid request (malformed form data or invalid parameters)
4506
4636
  content:
4507
4637
  application/json:
4508
4638
  schema:
4509
4639
  $ref: '#/components/schemas/OAuthErrorResponse'
4640
+ example:
4641
+ error: invalid_request
4642
+ error_description: user_code is required
4510
4643
  '401':
4511
4644
  description: Invalid grant (anonymous refresh token is not valid)
4512
4645
  content:
4513
4646
  application/json:
4514
4647
  schema:
4515
4648
  $ref: '#/components/schemas/OAuthErrorResponse'
4649
+ example:
4650
+ error: invalid_request
4651
+ error_description: user_code is required
4516
4652
  '500':
4517
4653
  description: Internal server error
4518
4654
  content:
4519
4655
  application/json:
4520
4656
  schema:
4521
4657
  $ref: '#/components/schemas/OAuthErrorResponse'
4658
+ example:
4659
+ error: invalid_request
4660
+ error_description: user_code is required
4522
4661
  x-portos-delegated: false
4523
4662
  x-portos-resource-permission: false
4524
4663
  /auth/callback:
@@ -4558,15 +4697,22 @@ paths:
4558
4697
  application/json:
4559
4698
  schema:
4560
4699
  $ref: '#/components/schemas/GenerateTokenResponse'
4700
+ example:
4701
+ access_token: port1/principals/example
4702
+ token_type: port1/principals/example
4703
+ expires_in: 1
4561
4704
  '400':
4562
4705
  description: Invalid callback data or provider error
4563
4706
  content:
4564
4707
  application/json:
4565
4708
  schema:
4566
4709
  $ref: '#/components/schemas/OAuthErrorResponse'
4710
+ example:
4711
+ error: invalid_request
4712
+ error_description: user_code is required
4567
4713
  x-portos-delegated: false
4568
4714
  x-portos-resource-permission: false
4569
- /auth/device_authorization:
4715
+ /auth/device-authorization:
4570
4716
  post:
4571
4717
  tags:
4572
4718
  - Auth
@@ -4577,7 +4723,7 @@ paths:
4577
4723
  See the [OAuth device authorization docs for more](https://datatracker.ietf.org/doc/html/rfc8628).
4578
4724
 
4579
4725
 
4580
- Uses the existing managed-client device flow. This endpoint is public, but validates its client and supported device grant; anonymous DCR clients support authorization_code and optional refresh_token, and cannot start the device flow.
4726
+ Uses the existing managed-client device flow. This endpoint is public, but validates its client and supported device grant; anonymous DCR clients support authorization_code and optional refresh_token, and cannot start the device flow. The legacy /auth/device_authorization path remains a compatibility alias.
4581
4727
  operationId: deviceAuthorize
4582
4728
  security:
4583
4729
  - {}
@@ -4587,6 +4733,8 @@ paths:
4587
4733
  application/x-www-form-urlencoded:
4588
4734
  schema:
4589
4735
  $ref: '#/components/schemas/DeviceAuthorizationRequest'
4736
+ example:
4737
+ client_id: dcr_example
4590
4738
  responses:
4591
4739
  '200':
4592
4740
  description: Device authorization initiated successfully
@@ -4594,18 +4742,30 @@ paths:
4594
4742
  application/json:
4595
4743
  schema:
4596
4744
  $ref: '#/components/schemas/DeviceAuthorizationResponse'
4745
+ example:
4746
+ device_code: port1/principals/example
4747
+ user_code: port1/principals/example
4748
+ verification_uri: https://portpowered.com/oauth/device/verify
4749
+ expires_in: 1800
4750
+ interval: 5
4597
4751
  '400':
4598
4752
  description: Invalid request parameters
4599
4753
  content:
4600
4754
  application/json:
4601
4755
  schema:
4602
4756
  $ref: '#/components/schemas/OAuthErrorResponse'
4757
+ example:
4758
+ error: invalid_request
4759
+ error_description: user_code is required
4603
4760
  '500':
4604
4761
  description: Internal server error
4605
4762
  content:
4606
4763
  application/json:
4607
4764
  schema:
4608
4765
  $ref: '#/components/schemas/OAuthErrorResponse'
4766
+ example:
4767
+ error: invalid_request
4768
+ error_description: user_code is required
4609
4769
  x-portos-delegated: false
4610
4770
  x-portos-resource-permission: false
4611
4771
  /oauth-clients:
@@ -4710,6 +4870,8 @@ paths:
4710
4870
  application/json:
4711
4871
  schema:
4712
4872
  $ref: '#/components/schemas/OAuthClientRegistrationRequest'
4873
+ example:
4874
+ clientName: port1/principals/example
4713
4875
  responses:
4714
4876
  '200':
4715
4877
  description: OAuth client created successfully
@@ -4717,6 +4879,9 @@ paths:
4717
4879
  application/json:
4718
4880
  schema:
4719
4881
  $ref: '#/components/schemas/CreateOAuthClientResponse'
4882
+ example:
4883
+ clientId: port1/principals/example
4884
+ clientSecret: port1/principals/example
4720
4885
  '400':
4721
4886
  description: Invalid request payload
4722
4887
  '401':
@@ -4777,6 +4942,9 @@ paths:
4777
4942
  application/json:
4778
4943
  schema:
4779
4944
  $ref: '#/components/schemas/OAuthClient'
4945
+ example:
4946
+ clientId: port1/systems/zero/oauth-clients/1234567890
4947
+ clientName: port1/principals/example
4780
4948
  '400':
4781
4949
  description: Invalid request payload
4782
4950
  content:
@@ -4873,6 +5041,8 @@ paths:
4873
5041
  application/json:
4874
5042
  schema:
4875
5043
  $ref: '#/components/schemas/UpdateOAuthClientResponse'
5044
+ example:
5045
+ clientId: port1/principals/example
4876
5046
  '400':
4877
5047
  description: Invalid request payload
4878
5048
  '401':
@@ -4949,6 +5119,9 @@ paths:
4949
5119
  application/json:
4950
5120
  schema:
4951
5121
  $ref: '#/components/schemas/GenerateOAuthCodeRequest'
5122
+ example:
5123
+ client_id: port1/principals/user123/oauth-clients/my-client
5124
+ redirect_uri: https://myapp.com/callback
4952
5125
  responses:
4953
5126
  '200':
4954
5127
  description: Authorization code generated successfully
@@ -4956,6 +5129,9 @@ paths:
4956
5129
  application/json:
4957
5130
  schema:
4958
5131
  $ref: '#/components/schemas/GenerateOAuthCodeResponse'
5132
+ example:
5133
+ code: abc123def456ghi789
5134
+ expiryInSeconds: 600
4959
5135
  '400':
4960
5136
  description: Invalid request (e.g., invalid client_id, redirect_uri, or scopes)
4961
5137
  '401':
@@ -5024,12 +5200,21 @@ paths:
5024
5200
  client_id_issued_at:
5025
5201
  type: integer
5026
5202
  format: int64
5203
+ example:
5204
+ redirect_uris:
5205
+ - http://127.0.0.1:8765/callback
5206
+ token_endpoint_auth_method: none
5207
+ client_id: dcr_example
5208
+ client_id_issued_at: 1791504000
5027
5209
  '400':
5028
5210
  description: Invalid metadata, redirect URI, or unapproved software statement.
5029
5211
  content:
5030
5212
  application/json:
5031
5213
  schema:
5032
5214
  $ref: '#/components/schemas/OAuthProtocolError'
5215
+ example:
5216
+ error: invalid_client_metadata
5217
+ error_description: Use HTTPS callbacks or an entirely local callback set.
5033
5218
  '415':
5034
5219
  description: Use application/json.
5035
5220
  '429':
@@ -5141,6 +5326,9 @@ paths:
5141
5326
  type: boolean
5142
5327
  scope:
5143
5328
  type: string
5329
+ example:
5330
+ request_id: SERVER_ISSUED_PENDING_REQUEST_ID
5331
+ approved: true
5144
5332
  responses:
5145
5333
  '200':
5146
5334
  description: Callback navigation URL containing code or denial and original state.
@@ -5154,6 +5342,8 @@ paths:
5154
5342
  redirect_url:
5155
5343
  type: string
5156
5344
  format: uri
5345
+ example:
5346
+ redirect_url: http://127.0.0.1:8765/callback?code=SERVER_ISSUED_CODE&state=ORIGINAL_STATE
5157
5347
  '400':
5158
5348
  description: Invalid, expired or consumed request.
5159
5349
  '401':
@@ -5207,6 +5397,12 @@ paths:
5207
5397
  type: array
5208
5398
  items:
5209
5399
  type: string
5400
+ example:
5401
+ client_id: dcr_example
5402
+ client_name: Example agent
5403
+ redirect_uri: http://127.0.0.1:8765/callback
5404
+ resource: https://portos-pilot-api-685761720421.us-west1.run.app
5405
+ scopes: []
5210
5406
  '400':
5211
5407
  description: Invalid, expired or consumed request.
5212
5408
  '401':
@@ -5228,6 +5424,9 @@ paths:
5228
5424
  application/json:
5229
5425
  schema:
5230
5426
  $ref: '#/components/schemas/ValidateOAuthRequestRequest'
5427
+ example:
5428
+ client_id: port1/principals/user123/oauth-clients/my-client
5429
+ redirect_uri: https://myapp.com/callback
5231
5430
  responses:
5232
5431
  '200':
5233
5432
  description: Request validated successfully, returns client information
@@ -5235,6 +5434,9 @@ paths:
5235
5434
  application/json:
5236
5435
  schema:
5237
5436
  $ref: '#/components/schemas/ValidateOAuthRequestResponse'
5437
+ example:
5438
+ clientName: My OAuth Application
5439
+ scopes: []
5238
5440
  '400':
5239
5441
  description: Invalid request (e.g., invalid client_id, redirect_uri, or scopes)
5240
5442
  '500':
@@ -5266,18 +5468,29 @@ paths:
5266
5468
  application/json:
5267
5469
  schema:
5268
5470
  $ref: '#/components/schemas/VerifyDeviceResponse'
5471
+ example:
5472
+ deviceauth_id: da_1234567890abcdef
5473
+ client_name: My OAuth Application
5474
+ client_id: port1/principals/user123/oauth-clients/my-client
5475
+ status: pending
5269
5476
  '400':
5270
5477
  description: Invalid request (e.g., missing or invalid user_code)
5271
5478
  content:
5272
5479
  application/json:
5273
5480
  schema:
5274
5481
  $ref: '#/components/schemas/OAuthErrorResponse'
5482
+ example:
5483
+ error: invalid_request
5484
+ error_description: user_code is required
5275
5485
  '500':
5276
5486
  description: Internal server error
5277
5487
  content:
5278
5488
  application/json:
5279
5489
  schema:
5280
5490
  $ref: '#/components/schemas/OAuthErrorResponse'
5491
+ example:
5492
+ error: invalid_request
5493
+ error_description: user_code is required
5281
5494
  x-portos-delegated: false
5282
5495
  x-portos-resource-permission: false
5283
5496
  /oauth/authorize-device:
@@ -5298,6 +5511,11 @@ paths:
5298
5511
  application/json:
5299
5512
  schema:
5300
5513
  $ref: '#/components/schemas/AuthorizeDeviceRequest'
5514
+ example:
5515
+ user_code: ABCD-EFGH
5516
+ scopes:
5517
+ - endpoint:read
5518
+ - endpoint:write
5301
5519
  responses:
5302
5520
  '200':
5303
5521
  description: Device authorization successful
@@ -5305,24 +5523,35 @@ paths:
5305
5523
  application/json:
5306
5524
  schema:
5307
5525
  $ref: '#/components/schemas/AuthorizeDeviceResponse'
5526
+ example:
5527
+ success: true
5308
5528
  '400':
5309
5529
  description: Invalid request (e.g., missing user_code, invalid user_code, or invalid scopes)
5310
5530
  content:
5311
5531
  application/json:
5312
5532
  schema:
5313
5533
  $ref: '#/components/schemas/OAuthErrorResponse'
5534
+ example:
5535
+ error: invalid_request
5536
+ error_description: user_code is required
5314
5537
  '401':
5315
5538
  description: Unauthorized (missing or invalid authentication token)
5316
5539
  content:
5317
5540
  application/json:
5318
5541
  schema:
5319
5542
  $ref: '#/components/schemas/OAuthErrorResponse'
5543
+ example:
5544
+ error: invalid_request
5545
+ error_description: user_code is required
5320
5546
  '500':
5321
5547
  description: Internal server error
5322
5548
  content:
5323
5549
  application/json:
5324
5550
  schema:
5325
5551
  $ref: '#/components/schemas/OAuthErrorResponse'
5552
+ example:
5553
+ error: invalid_request
5554
+ error_description: user_code is required
5326
5555
  x-portos-delegated: false
5327
5556
  x-portos-resource-permission: false
5328
5557
  security:
@@ -6182,6 +6411,8 @@ paths:
6182
6411
  application/json:
6183
6412
  schema:
6184
6413
  $ref: '#/components/schemas/FlowNode'
6414
+ example:
6415
+ id: port1/principals/example
6185
6416
  '400':
6186
6417
  description: Bad request — invalid request payload or validation failure.
6187
6418
  content:
@@ -6244,6 +6475,8 @@ paths:
6244
6475
  id:
6245
6476
  type: string
6246
6477
  description: The ID of the flow node to delete.
6478
+ example:
6479
+ id: port1/principals/example
6247
6480
  responses:
6248
6481
  '200':
6249
6482
  description: Flow node deleted successfully.
@@ -6805,6 +7038,8 @@ paths:
6805
7038
  application/json:
6806
7039
  schema:
6807
7040
  $ref: '#/components/schemas/Message'
7041
+ example:
7042
+ body: {}
6808
7043
  responses:
6809
7044
  '202':
6810
7045
  description: Message accepted for processing
@@ -7316,6 +7551,12 @@ paths:
7316
7551
  application/json:
7317
7552
  schema:
7318
7553
  $ref: '#/components/schemas/UpsertViewRequest'
7554
+ example:
7555
+ title:
7556
+ type: LIGHT
7557
+ value: port1/principals/example
7558
+ positions: []
7559
+ widgets: []
7319
7560
  responses:
7320
7561
  '201':
7321
7562
  description: View created successfully
@@ -7404,6 +7645,8 @@ paths:
7404
7645
  application/json:
7405
7646
  schema:
7406
7647
  $ref: '#/components/schemas/View'
7648
+ example:
7649
+ id: port1/principals/example
7407
7650
  '400':
7408
7651
  description: Invalid request payload
7409
7652
  content:
@@ -7476,6 +7719,12 @@ paths:
7476
7719
  application/json:
7477
7720
  schema:
7478
7721
  $ref: '#/components/schemas/UpsertViewRequest'
7722
+ example:
7723
+ title:
7724
+ type: LIGHT
7725
+ value: port1/principals/example
7726
+ positions: []
7727
+ widgets: []
7479
7728
  responses:
7480
7729
  '200':
7481
7730
  description: View updated successfully
@@ -7704,6 +7953,9 @@ paths:
7704
7953
  node_id:
7705
7954
  type: string
7706
7955
  description: The Port OS identifier of the flow node to execute
7956
+ example:
7957
+ flow_id: port1/principals/example
7958
+ node_id: port1/principals/example
7707
7959
  responses:
7708
7960
  '200':
7709
7961
  description: Webhook received and flow run triggered (always returned to prevent retries)
@@ -7759,6 +8011,9 @@ paths:
7759
8011
  type: string
7760
8012
  description: |
7761
8013
  Optional override for the Tuya authentication API endpoint. Defaults to https://apigw.iotbing.com if not provided.
8014
+ example:
8015
+ accessCode: port1/principals/example
8016
+ clientId: port1/principals/example
7762
8017
  responses:
7763
8018
  '200':
7764
8019
  description: QR code generated successfully
@@ -7829,6 +8084,10 @@ paths:
7829
8084
  type: string
7830
8085
  description: |
7831
8086
  Optional override for the Tuya authentication API endpoint. Defaults to https://apigw.iotbing.com if not provided.
8087
+ example:
8088
+ loginCode: port1/principals/example
8089
+ userCode: port1/principals/example
8090
+ clientId: port1/principals/example
7832
8091
  responses:
7833
8092
  '200':
7834
8093
  description: Login code validated successfully
@@ -13821,8 +14080,8 @@ components:
13821
14080
  id:
13822
14081
  type: string
13823
14082
  description: The unique identifier for the endpoint group
13824
- pattern: ^port1\/principals\/.*\/groups\/.*
13825
- example: port1/principals/123/groups/456
14083
+ pattern: ^port1/[^/]+/[^/]+/endpoint-groups/[^/]+$
14084
+ example: port1/principals/example/endpoint-groups/living-room
13826
14085
  name:
13827
14086
  $ref: '#/components/schemas/TypeValue'
13828
14087
  description: The name of the endpoint group
@@ -13881,12 +14140,12 @@ components:
13881
14140
  id:
13882
14141
  type: string
13883
14142
  description: The unique identifier for the group route
13884
- pattern: ^port1\/principals\/.*\/group-routes\/.*
13885
- example: port1/principals/123/group-routes/456
14143
+ pattern: ^port1/[^/]+/[^/]+/endpoint-group-routes/[^/]+$
14144
+ example: port1/principals/example/endpoint-group-routes/living-room
13886
14145
  associatedGroupId:
13887
14146
  type: string
13888
14147
  description: The ID of the associated endpoint group
13889
- pattern: ^port1\/principals\/.*\/groups\/.*
14148
+ pattern: ^port1/[^/]+/[^/]+/endpoint-groups/[^/]+$
13890
14149
  associatedPluginId:
13891
14150
  type: string
13892
14151
  description: The ID of the associated plugin
@@ -16790,7 +17049,7 @@ components:
16790
17049
  id:
16791
17050
  type: string
16792
17051
  description: The unique identifier for the principal
16793
- pattern: ^port1\.principal\..*
17052
+ pattern: ^port1/[^/]+/[^/]+$
16794
17053
  ownerId:
16795
17054
  type: string
16796
17055
  description: The owner ID of the principal
@@ -16943,7 +17202,7 @@ components:
16943
17202
  type: string
16944
17203
  description: |
16945
17204
  The persisted Port OS route identifier. Synchronized routes can receive a backend-generated, owner-scoped value here even when the discovery payload supplied an explicit route `id`; do not use this field as the stable plugin-owned route identity unless the synchronizing implementation explicitly documents preservation.
16946
- pattern: ^port1\.route\..*
17205
+ pattern: ^port1/[^/]+/[^/]+/routes/[^/]+$
16947
17206
  associatedPluginId:
16948
17207
  type: string
16949
17208
  description: The ID of the associated plugin
@@ -17036,8 +17295,8 @@ components:
17036
17295
  id:
17037
17296
  type: string
17038
17297
  description: The unique identifier for the endpoint
17039
- pattern: ^port1\/principals\/.*\/endpoints\/.*
17040
- example: port1\principals/123/endpoints/456
17298
+ pattern: ^port1/[^/]+/[^/]+/endpoints/[^/]+$
17299
+ example: port1/principals/example/endpoints/light-1
17041
17300
  name:
17042
17301
  $ref: '#/components/schemas/TypeValue'
17043
17302
  description: The name of the endpoint
@@ -17670,7 +17929,7 @@ components:
17670
17929
  id:
17671
17930
  type: string
17672
17931
  description: The created plugin ID
17673
- pattern: ^port1\.plugin\..*
17932
+ pattern: ^port1/[^/]+/[^/]+/plugins/[^/]+$
17674
17933
  DeletePluginRequest:
17675
17934
  type: object
17676
17935
  required:
@@ -17743,7 +18002,7 @@ components:
17743
18002
  id:
17744
18003
  type: string
17745
18004
  description: The unique identifier for the auth link
17746
- pattern: ^port1\.authlink\..*
18005
+ pattern: ^port1/[^/]+/[^/]+/auth-links/[^/]+$
17747
18006
  ownerId:
17748
18007
  type: string
17749
18008
  description: The owner ID of the auth link
@@ -17782,7 +18041,7 @@ components:
17782
18041
  type: object
17783
18042
  description: A request denoting the creation of an auth link between a principal and a plugin
17784
18043
  required:
17785
- - plugin
18044
+ - authLink
17786
18045
  properties:
17787
18046
  authLink:
17788
18047
  $ref: '#/components/schemas/AuthLink'