@smithers-orchestrator/gateway 0.17.0 → 0.18.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
@@ -4,11 +4,11 @@ info:
4
4
  version: v1
5
5
  description: "Stable v1 Smithers Gateway RPC contract generated from packages/gateway/src/rpc."
6
6
  servers:
7
- -
7
+ -
8
8
  url: https://gateway.example.com
9
9
  description: "Reference Gateway deployment."
10
10
  security:
11
- -
11
+ -
12
12
  bearerAuth: []
13
13
  paths:
14
14
  /v1/rpc/launchRun:
@@ -19,7 +19,7 @@ paths:
19
19
  tags:
20
20
  - "Gateway RPC"
21
21
  security:
22
- -
22
+ -
23
23
  bearerAuth:
24
24
  - run:write
25
25
  x-smithers-api-version: v1
@@ -357,7 +357,7 @@ paths:
357
357
  tags:
358
358
  - "Gateway RPC"
359
359
  security:
360
- -
360
+ -
361
361
  bearerAuth:
362
362
  - run:write
363
363
  x-smithers-api-version: v1
@@ -740,7 +740,7 @@ paths:
740
740
  tags:
741
741
  - "Gateway RPC"
742
742
  security:
743
- -
743
+ -
744
744
  bearerAuth:
745
745
  - run:write
746
746
  x-smithers-api-version: v1
@@ -1173,7 +1173,7 @@ paths:
1173
1173
  tags:
1174
1174
  - "Gateway RPC"
1175
1175
  security:
1176
- -
1176
+ -
1177
1177
  bearerAuth:
1178
1178
  - run:admin
1179
1179
  x-smithers-api-version: v1
@@ -1558,7 +1558,7 @@ paths:
1558
1558
  tags:
1559
1559
  - "Gateway RPC"
1560
1560
  security:
1561
- -
1561
+ -
1562
1562
  bearerAuth:
1563
1563
  - run:admin
1564
1564
  x-smithers-api-version: v1
@@ -2140,7 +2140,7 @@ paths:
2140
2140
  tags:
2141
2141
  - "Gateway RPC"
2142
2142
  security:
2143
- -
2143
+ -
2144
2144
  bearerAuth:
2145
2145
  - approval:submit
2146
2146
  x-smithers-api-version: v1
@@ -2186,22 +2186,22 @@ paths:
2186
2186
  description: "Any JSON value."
2187
2187
  nullable: true
2188
2188
  oneOf:
2189
- -
2189
+ -
2190
2190
  type: object
2191
2191
  additionalProperties: true
2192
- -
2192
+ -
2193
2193
  type: array
2194
2194
  items:
2195
2195
  nullable: true
2196
- -
2196
+ -
2197
2197
  type: string
2198
- -
2198
+ -
2199
2199
  type: number
2200
- -
2200
+ -
2201
2201
  type: integer
2202
- -
2202
+ -
2203
2203
  type: boolean
2204
- -
2204
+ -
2205
2205
  type: "null"
2206
2206
  note:
2207
2207
  type: string
@@ -2573,7 +2573,7 @@ paths:
2573
2573
  tags:
2574
2574
  - "Gateway RPC"
2575
2575
  security:
2576
- -
2576
+ -
2577
2577
  bearerAuth:
2578
2578
  - signal:submit
2579
2579
  x-smithers-api-version: v1
@@ -2612,22 +2612,22 @@ paths:
2612
2612
  description: "Any JSON value."
2613
2613
  nullable: true
2614
2614
  oneOf:
2615
- -
2615
+ -
2616
2616
  type: object
2617
2617
  additionalProperties: true
2618
- -
2618
+ -
2619
2619
  type: array
2620
2620
  items:
2621
2621
  nullable: true
2622
- -
2622
+ -
2623
2623
  type: string
2624
- -
2624
+ -
2625
2625
  type: number
2626
- -
2626
+ -
2627
2627
  type: integer
2628
- -
2628
+ -
2629
2629
  type: boolean
2630
- -
2630
+ -
2631
2631
  type: "null"
2632
2632
  required:
2633
2633
  - runId
@@ -2971,7 +2971,7 @@ paths:
2971
2971
  tags:
2972
2972
  - "Gateway RPC"
2973
2973
  security:
2974
- -
2974
+ -
2975
2975
  bearerAuth:
2976
2976
  - run:read
2977
2977
  x-smithers-api-version: v1
@@ -3336,7 +3336,7 @@ paths:
3336
3336
  tags:
3337
3337
  - "Gateway RPC"
3338
3338
  security:
3339
- -
3339
+ -
3340
3340
  bearerAuth:
3341
3341
  - run:read
3342
3342
  x-smithers-api-version: v1
@@ -3443,7 +3443,7 @@ paths:
3443
3443
  ok: true
3444
3444
  apiVersion: v1
3445
3445
  payload:
3446
- -
3446
+ -
3447
3447
  runId: run_01
3448
3448
  workflowKey: deploy
3449
3449
  status: finished
@@ -3664,6 +3664,667 @@ paths:
3664
3664
  - observability:read
3665
3665
  refresh:
3666
3666
  type: string
3667
+ /v1/rpc/listWorkflows:
3668
+ post:
3669
+ operationId: listWorkflows
3670
+ summary: "List Workflows"
3671
+ description: "List workflows registered with the Gateway."
3672
+ tags:
3673
+ - "Gateway RPC"
3674
+ security:
3675
+ -
3676
+ bearerAuth:
3677
+ - run:read
3678
+ x-smithers-api-version: v1
3679
+ x-smithers-maturity: stable
3680
+ x-smithers-transport: "http+websocket"
3681
+ x-smithers-required-scope: run:read
3682
+ requestBody:
3683
+ required: true
3684
+ content:
3685
+ application/json:
3686
+ schema:
3687
+ type: object
3688
+ required:
3689
+ - method
3690
+ - params
3691
+ additionalProperties: false
3692
+ properties:
3693
+ id:
3694
+ type: string
3695
+ description: "Optional caller request id."
3696
+ method:
3697
+ const: listWorkflows
3698
+ params:
3699
+ type: object
3700
+ properties:
3701
+ filter:
3702
+ type: object
3703
+ properties:
3704
+ hasUi:
3705
+ type: boolean
3706
+ description: "Only return workflows with or without an attached UI."
3707
+ required: []
3708
+ additionalProperties: false
3709
+ required: []
3710
+ additionalProperties: false
3711
+ example:
3712
+ id: listWorkflows-1
3713
+ method: listWorkflows
3714
+ params:
3715
+ filter:
3716
+ hasUi: true
3717
+ responses:
3718
+ 200:
3719
+ description: "List Workflows response."
3720
+ headers:
3721
+ X-Smithers-API-Version:
3722
+ schema:
3723
+ type: string
3724
+ enum:
3725
+ - v1
3726
+ description: "Stable Smithers Gateway API version."
3727
+ content:
3728
+ application/json:
3729
+ schema:
3730
+ type: object
3731
+ required:
3732
+ - type
3733
+ - id
3734
+ - ok
3735
+ - apiVersion
3736
+ - payload
3737
+ additionalProperties: false
3738
+ properties:
3739
+ type:
3740
+ const: res
3741
+ id:
3742
+ type: string
3743
+ ok:
3744
+ const: true
3745
+ apiVersion:
3746
+ const: v1
3747
+ payload:
3748
+ type: array
3749
+ description: "Registered workflow summaries."
3750
+ items:
3751
+ type: object
3752
+ properties:
3753
+ key:
3754
+ type: string
3755
+ description: "Registered Gateway workflow key."
3756
+ readableName:
3757
+ type: string
3758
+ description: "Human-readable workflow name."
3759
+ description:
3760
+ type: string
3761
+ description: "Workflow description."
3762
+ hasUi:
3763
+ type: boolean
3764
+ description: "Whether this workflow has a custom UI mounted."
3765
+ uiPath:
3766
+ type:
3767
+ - string
3768
+ - "null"
3769
+ description: "Mounted UI path when present."
3770
+ required:
3771
+ - key
3772
+ - hasUi
3773
+ - uiPath
3774
+ additionalProperties: false
3775
+ example:
3776
+ type: res
3777
+ id: listWorkflows-1
3778
+ ok: true
3779
+ apiVersion: v1
3780
+ payload:
3781
+ -
3782
+ key: deploy
3783
+ readableName: Deploy
3784
+ hasUi: true
3785
+ uiPath: /workflows/deploy
3786
+ 400:
3787
+ description: "The request shape is invalid."
3788
+ content:
3789
+ application/json:
3790
+ schema:
3791
+ type: object
3792
+ required:
3793
+ - type
3794
+ - id
3795
+ - ok
3796
+ - apiVersion
3797
+ - error
3798
+ additionalProperties: false
3799
+ properties:
3800
+ type:
3801
+ const: res
3802
+ id:
3803
+ type: string
3804
+ ok:
3805
+ const: false
3806
+ apiVersion:
3807
+ const: v1
3808
+ error:
3809
+ type: object
3810
+ required:
3811
+ - version
3812
+ - code
3813
+ - message
3814
+ additionalProperties: true
3815
+ properties:
3816
+ version:
3817
+ const: v1
3818
+ code:
3819
+ type: string
3820
+ enum:
3821
+ - InvalidRequest
3822
+ - Unauthorized
3823
+ - Forbidden
3824
+ - Internal
3825
+ message:
3826
+ type: string
3827
+ requiredScope:
3828
+ type: string
3829
+ enum:
3830
+ - run:read
3831
+ - run:write
3832
+ - run:admin
3833
+ - approval:submit
3834
+ - signal:submit
3835
+ - cron:read
3836
+ - cron:write
3837
+ - observability:read
3838
+ refresh:
3839
+ type: string
3840
+ 401:
3841
+ description: "Authentication failed or the token expired."
3842
+ content:
3843
+ application/json:
3844
+ schema:
3845
+ type: object
3846
+ required:
3847
+ - type
3848
+ - id
3849
+ - ok
3850
+ - apiVersion
3851
+ - error
3852
+ additionalProperties: false
3853
+ properties:
3854
+ type:
3855
+ const: res
3856
+ id:
3857
+ type: string
3858
+ ok:
3859
+ const: false
3860
+ apiVersion:
3861
+ const: v1
3862
+ error:
3863
+ type: object
3864
+ required:
3865
+ - version
3866
+ - code
3867
+ - message
3868
+ additionalProperties: true
3869
+ properties:
3870
+ version:
3871
+ const: v1
3872
+ code:
3873
+ type: string
3874
+ enum:
3875
+ - InvalidRequest
3876
+ - Unauthorized
3877
+ - Forbidden
3878
+ - Internal
3879
+ message:
3880
+ type: string
3881
+ requiredScope:
3882
+ type: string
3883
+ enum:
3884
+ - run:read
3885
+ - run:write
3886
+ - run:admin
3887
+ - approval:submit
3888
+ - signal:submit
3889
+ - cron:read
3890
+ - cron:write
3891
+ - observability:read
3892
+ refresh:
3893
+ type: string
3894
+ 403:
3895
+ description: "The token is missing the required scope."
3896
+ content:
3897
+ application/json:
3898
+ schema:
3899
+ type: object
3900
+ required:
3901
+ - type
3902
+ - id
3903
+ - ok
3904
+ - apiVersion
3905
+ - error
3906
+ additionalProperties: false
3907
+ properties:
3908
+ type:
3909
+ const: res
3910
+ id:
3911
+ type: string
3912
+ ok:
3913
+ const: false
3914
+ apiVersion:
3915
+ const: v1
3916
+ error:
3917
+ type: object
3918
+ required:
3919
+ - version
3920
+ - code
3921
+ - message
3922
+ additionalProperties: true
3923
+ properties:
3924
+ version:
3925
+ const: v1
3926
+ code:
3927
+ type: string
3928
+ enum:
3929
+ - InvalidRequest
3930
+ - Unauthorized
3931
+ - Forbidden
3932
+ - Internal
3933
+ message:
3934
+ type: string
3935
+ requiredScope:
3936
+ type: string
3937
+ enum:
3938
+ - run:read
3939
+ - run:write
3940
+ - run:admin
3941
+ - approval:submit
3942
+ - signal:submit
3943
+ - cron:read
3944
+ - cron:write
3945
+ - observability:read
3946
+ refresh:
3947
+ type: string
3948
+ 500:
3949
+ description: "The Gateway encountered an internal error."
3950
+ content:
3951
+ application/json:
3952
+ schema:
3953
+ type: object
3954
+ required:
3955
+ - type
3956
+ - id
3957
+ - ok
3958
+ - apiVersion
3959
+ - error
3960
+ additionalProperties: false
3961
+ properties:
3962
+ type:
3963
+ const: res
3964
+ id:
3965
+ type: string
3966
+ ok:
3967
+ const: false
3968
+ apiVersion:
3969
+ const: v1
3970
+ error:
3971
+ type: object
3972
+ required:
3973
+ - version
3974
+ - code
3975
+ - message
3976
+ additionalProperties: true
3977
+ properties:
3978
+ version:
3979
+ const: v1
3980
+ code:
3981
+ type: string
3982
+ enum:
3983
+ - InvalidRequest
3984
+ - Unauthorized
3985
+ - Forbidden
3986
+ - Internal
3987
+ message:
3988
+ type: string
3989
+ requiredScope:
3990
+ type: string
3991
+ enum:
3992
+ - run:read
3993
+ - run:write
3994
+ - run:admin
3995
+ - approval:submit
3996
+ - signal:submit
3997
+ - cron:read
3998
+ - cron:write
3999
+ - observability:read
4000
+ refresh:
4001
+ type: string
4002
+ /v1/rpc/listApprovals:
4003
+ post:
4004
+ operationId: listApprovals
4005
+ summary: "List Approvals"
4006
+ description: "List pending Gateway approval requests."
4007
+ tags:
4008
+ - "Gateway RPC"
4009
+ security:
4010
+ -
4011
+ bearerAuth:
4012
+ - run:read
4013
+ x-smithers-api-version: v1
4014
+ x-smithers-maturity: stable
4015
+ x-smithers-transport: "http+websocket"
4016
+ x-smithers-required-scope: run:read
4017
+ requestBody:
4018
+ required: true
4019
+ content:
4020
+ application/json:
4021
+ schema:
4022
+ type: object
4023
+ required:
4024
+ - method
4025
+ - params
4026
+ additionalProperties: false
4027
+ properties:
4028
+ id:
4029
+ type: string
4030
+ description: "Optional caller request id."
4031
+ method:
4032
+ const: listApprovals
4033
+ params:
4034
+ type: object
4035
+ properties:
4036
+ filter:
4037
+ type: object
4038
+ properties:
4039
+ runId:
4040
+ type: string
4041
+ description: "Stable run identifier."
4042
+ workflow:
4043
+ type: string
4044
+ description: "Registered Gateway workflow key."
4045
+ limit:
4046
+ type: integer
4047
+ minimum: 1
4048
+ description: "Maximum number of approvals."
4049
+ required: []
4050
+ additionalProperties: false
4051
+ required: []
4052
+ additionalProperties: false
4053
+ example:
4054
+ id: listApprovals-1
4055
+ method: listApprovals
4056
+ params:
4057
+ filter:
4058
+ workflow: deploy
4059
+ limit: 20
4060
+ responses:
4061
+ 200:
4062
+ description: "List Approvals response."
4063
+ headers:
4064
+ X-Smithers-API-Version:
4065
+ schema:
4066
+ type: string
4067
+ enum:
4068
+ - v1
4069
+ description: "Stable Smithers Gateway API version."
4070
+ content:
4071
+ application/json:
4072
+ schema:
4073
+ type: object
4074
+ required:
4075
+ - type
4076
+ - id
4077
+ - ok
4078
+ - apiVersion
4079
+ - payload
4080
+ additionalProperties: false
4081
+ properties:
4082
+ type:
4083
+ const: res
4084
+ id:
4085
+ type: string
4086
+ ok:
4087
+ const: true
4088
+ apiVersion:
4089
+ const: v1
4090
+ payload:
4091
+ type: array
4092
+ description: "Pending approvals."
4093
+ items:
4094
+ type: object
4095
+ description: "Pending approval summary."
4096
+ properties: {}
4097
+ required: []
4098
+ additionalProperties: true
4099
+ example:
4100
+ type: res
4101
+ id: listApprovals-1
4102
+ ok: true
4103
+ apiVersion: v1
4104
+ payload:
4105
+ -
4106
+ runId: run_01
4107
+ workflowKey: deploy
4108
+ nodeId: approve
4109
+ iteration: 0
4110
+ requestTitle: "Approve deploy"
4111
+ requestedAtMs: 1710000000000
4112
+ 400:
4113
+ description: "The request shape is invalid."
4114
+ content:
4115
+ application/json:
4116
+ schema:
4117
+ type: object
4118
+ required:
4119
+ - type
4120
+ - id
4121
+ - ok
4122
+ - apiVersion
4123
+ - error
4124
+ additionalProperties: false
4125
+ properties:
4126
+ type:
4127
+ const: res
4128
+ id:
4129
+ type: string
4130
+ ok:
4131
+ const: false
4132
+ apiVersion:
4133
+ const: v1
4134
+ error:
4135
+ type: object
4136
+ required:
4137
+ - version
4138
+ - code
4139
+ - message
4140
+ additionalProperties: true
4141
+ properties:
4142
+ version:
4143
+ const: v1
4144
+ code:
4145
+ type: string
4146
+ enum:
4147
+ - InvalidRequest
4148
+ - Unauthorized
4149
+ - Forbidden
4150
+ - Internal
4151
+ message:
4152
+ type: string
4153
+ requiredScope:
4154
+ type: string
4155
+ enum:
4156
+ - run:read
4157
+ - run:write
4158
+ - run:admin
4159
+ - approval:submit
4160
+ - signal:submit
4161
+ - cron:read
4162
+ - cron:write
4163
+ - observability:read
4164
+ refresh:
4165
+ type: string
4166
+ 401:
4167
+ description: "Authentication failed or the token expired."
4168
+ content:
4169
+ application/json:
4170
+ schema:
4171
+ type: object
4172
+ required:
4173
+ - type
4174
+ - id
4175
+ - ok
4176
+ - apiVersion
4177
+ - error
4178
+ additionalProperties: false
4179
+ properties:
4180
+ type:
4181
+ const: res
4182
+ id:
4183
+ type: string
4184
+ ok:
4185
+ const: false
4186
+ apiVersion:
4187
+ const: v1
4188
+ error:
4189
+ type: object
4190
+ required:
4191
+ - version
4192
+ - code
4193
+ - message
4194
+ additionalProperties: true
4195
+ properties:
4196
+ version:
4197
+ const: v1
4198
+ code:
4199
+ type: string
4200
+ enum:
4201
+ - InvalidRequest
4202
+ - Unauthorized
4203
+ - Forbidden
4204
+ - Internal
4205
+ message:
4206
+ type: string
4207
+ requiredScope:
4208
+ type: string
4209
+ enum:
4210
+ - run:read
4211
+ - run:write
4212
+ - run:admin
4213
+ - approval:submit
4214
+ - signal:submit
4215
+ - cron:read
4216
+ - cron:write
4217
+ - observability:read
4218
+ refresh:
4219
+ type: string
4220
+ 403:
4221
+ description: "The token is missing the required scope."
4222
+ content:
4223
+ application/json:
4224
+ schema:
4225
+ type: object
4226
+ required:
4227
+ - type
4228
+ - id
4229
+ - ok
4230
+ - apiVersion
4231
+ - error
4232
+ additionalProperties: false
4233
+ properties:
4234
+ type:
4235
+ const: res
4236
+ id:
4237
+ type: string
4238
+ ok:
4239
+ const: false
4240
+ apiVersion:
4241
+ const: v1
4242
+ error:
4243
+ type: object
4244
+ required:
4245
+ - version
4246
+ - code
4247
+ - message
4248
+ additionalProperties: true
4249
+ properties:
4250
+ version:
4251
+ const: v1
4252
+ code:
4253
+ type: string
4254
+ enum:
4255
+ - InvalidRequest
4256
+ - Unauthorized
4257
+ - Forbidden
4258
+ - Internal
4259
+ message:
4260
+ type: string
4261
+ requiredScope:
4262
+ type: string
4263
+ enum:
4264
+ - run:read
4265
+ - run:write
4266
+ - run:admin
4267
+ - approval:submit
4268
+ - signal:submit
4269
+ - cron:read
4270
+ - cron:write
4271
+ - observability:read
4272
+ refresh:
4273
+ type: string
4274
+ 500:
4275
+ description: "The Gateway encountered an internal error."
4276
+ content:
4277
+ application/json:
4278
+ schema:
4279
+ type: object
4280
+ required:
4281
+ - type
4282
+ - id
4283
+ - ok
4284
+ - apiVersion
4285
+ - error
4286
+ additionalProperties: false
4287
+ properties:
4288
+ type:
4289
+ const: res
4290
+ id:
4291
+ type: string
4292
+ ok:
4293
+ const: false
4294
+ apiVersion:
4295
+ const: v1
4296
+ error:
4297
+ type: object
4298
+ required:
4299
+ - version
4300
+ - code
4301
+ - message
4302
+ additionalProperties: true
4303
+ properties:
4304
+ version:
4305
+ const: v1
4306
+ code:
4307
+ type: string
4308
+ enum:
4309
+ - InvalidRequest
4310
+ - Unauthorized
4311
+ - Forbidden
4312
+ - Internal
4313
+ message:
4314
+ type: string
4315
+ requiredScope:
4316
+ type: string
4317
+ enum:
4318
+ - run:read
4319
+ - run:write
4320
+ - run:admin
4321
+ - approval:submit
4322
+ - signal:submit
4323
+ - cron:read
4324
+ - cron:write
4325
+ - observability:read
4326
+ refresh:
4327
+ type: string
3667
4328
  /v1/rpc/streamRunEvents:
3668
4329
  post:
3669
4330
  operationId: streamRunEvents
@@ -3672,7 +4333,7 @@ paths:
3672
4333
  tags:
3673
4334
  - "Gateway RPC"
3674
4335
  security:
3675
- -
4336
+ -
3676
4337
  bearerAuth:
3677
4338
  - run:read
3678
4339
  x-smithers-api-version: v1
@@ -4065,7 +4726,7 @@ paths:
4065
4726
  tags:
4066
4727
  - "Gateway RPC"
4067
4728
  security:
4068
- -
4729
+ -
4069
4730
  bearerAuth:
4070
4731
  - observability:read
4071
4732
  x-smithers-api-version: v1
@@ -4513,7 +5174,7 @@ paths:
4513
5174
  tags:
4514
5175
  - "Gateway RPC"
4515
5176
  security:
4516
- -
5177
+ -
4517
5178
  bearerAuth:
4518
5179
  - run:read
4519
5180
  x-smithers-api-version: v1
@@ -4968,7 +5629,7 @@ paths:
4968
5629
  tags:
4969
5630
  - "Gateway RPC"
4970
5631
  security:
4971
- -
5632
+ -
4972
5633
  bearerAuth:
4973
5634
  - run:read
4974
5635
  x-smithers-api-version: v1
@@ -5422,7 +6083,7 @@ paths:
5422
6083
  tags:
5423
6084
  - "Gateway RPC"
5424
6085
  security:
5425
- -
6086
+ -
5426
6087
  bearerAuth:
5427
6088
  - cron:read
5428
6089
  x-smithers-api-version: v1
@@ -5509,7 +6170,7 @@ paths:
5509
6170
  ok: true
5510
6171
  apiVersion: v1
5511
6172
  payload:
5512
- -
6173
+ -
5513
6174
  cronId: cron_01
5514
6175
  workflow: deploy
5515
6176
  pattern: "0 8 * * 1-5"
@@ -5737,7 +6398,7 @@ paths:
5737
6398
  tags:
5738
6399
  - "Gateway RPC"
5739
6400
  security:
5740
- -
6401
+ -
5741
6402
  bearerAuth:
5742
6403
  - cron:write
5743
6404
  x-smithers-api-version: v1
@@ -6055,7 +6716,7 @@ paths:
6055
6716
  tags:
6056
6717
  - "Gateway RPC"
6057
6718
  security:
6058
- -
6719
+ -
6059
6720
  bearerAuth:
6060
6721
  - cron:write
6061
6722
  x-smithers-api-version: v1
@@ -6426,7 +7087,7 @@ paths:
6426
7087
  tags:
6427
7088
  - "Gateway RPC"
6428
7089
  security:
6429
- -
7090
+ -
6430
7091
  bearerAuth:
6431
7092
  - cron:write
6432
7093
  x-smithers-api-version: v1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithers-orchestrator/gateway",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Stable Smithers Gateway RPC contracts, auth scopes, and deployment metadata",
5
5
  "type": "module",
6
6
  "sideEffects": false,
package/src/rpc/index.ts CHANGED
@@ -76,6 +76,8 @@ export type GatewayRpcMethod =
76
76
  | "submitSignal"
77
77
  | "getRun"
78
78
  | "listRuns"
79
+ | "listWorkflows"
80
+ | "listApprovals"
79
81
  | "streamRunEvents"
80
82
  | "streamDevTools"
81
83
  | "getNodeOutput"
@@ -173,6 +175,47 @@ export type ListRunsRequest = {
173
175
  };
174
176
  };
175
177
 
178
+ export type GatewayWorkflowSummary = {
179
+ key: string;
180
+ readableName?: string;
181
+ description?: string;
182
+ hasUi: boolean;
183
+ uiPath: string | null;
184
+ };
185
+
186
+ export type ListWorkflowsRequest = {
187
+ filter?: {
188
+ hasUi?: boolean;
189
+ };
190
+ };
191
+
192
+ export type ListWorkflowsResponse = GatewayWorkflowSummary[];
193
+
194
+ export type GatewayApprovalSummary = {
195
+ runId: string;
196
+ workflowKey?: string;
197
+ nodeId: string;
198
+ iteration: number;
199
+ requestTitle?: string;
200
+ requestSummary?: string;
201
+ requestedAtMs: number | null;
202
+ approvalMode?: string;
203
+ options?: unknown;
204
+ allowedScopes?: readonly string[];
205
+ allowedUsers?: readonly string[];
206
+ autoApprove?: unknown;
207
+ };
208
+
209
+ export type ListApprovalsRequest = {
210
+ filter?: {
211
+ runId?: string;
212
+ workflow?: string;
213
+ limit?: number;
214
+ };
215
+ };
216
+
217
+ export type ListApprovalsResponse = GatewayApprovalSummary[];
218
+
176
219
  export type StreamRunEventsRequest = {
177
220
  runId: string;
178
221
  afterSeq?: number;
@@ -456,6 +499,50 @@ export const GATEWAY_RPC_DEFINITIONS: readonly GatewayRpcDefinition[] = [
456
499
  exampleRequest: { filter: { status: "finished", limit: 20 } },
457
500
  exampleResponse: [{ runId: "run_01", workflowKey: "deploy", status: "finished", createdAtMs: 1710000000000 }],
458
501
  },
502
+ {
503
+ version: SMITHERS_API_VERSION,
504
+ method: "listWorkflows",
505
+ title: "List Workflows",
506
+ description: "List workflows registered with the Gateway.",
507
+ maturity: "stable",
508
+ transport: "http+websocket",
509
+ requiredScope: "run:read",
510
+ requestSchema: objectSchema({
511
+ filter: objectSchema({
512
+ hasUi: booleanSchema("Only return workflows with or without an attached UI."),
513
+ }),
514
+ }),
515
+ responseSchema: arraySchema(objectSchema({
516
+ key: workflow,
517
+ readableName: stringSchema("Human-readable workflow name."),
518
+ description: stringSchema("Workflow description."),
519
+ hasUi: booleanSchema("Whether this workflow has a custom UI mounted."),
520
+ uiPath: { type: ["string", "null"], description: "Mounted UI path when present." },
521
+ }, ["key", "hasUi", "uiPath"]), "Registered workflow summaries."),
522
+ errors: ["InvalidRequest", "Unauthorized", "Forbidden", "Internal"],
523
+ exampleRequest: { filter: { hasUi: true } },
524
+ exampleResponse: [{ key: "deploy", readableName: "Deploy", hasUi: true, uiPath: "/workflows/deploy" }],
525
+ },
526
+ {
527
+ version: SMITHERS_API_VERSION,
528
+ method: "listApprovals",
529
+ title: "List Approvals",
530
+ description: "List pending Gateway approval requests.",
531
+ maturity: "stable",
532
+ transport: "http+websocket",
533
+ requiredScope: "run:read",
534
+ requestSchema: objectSchema({
535
+ filter: objectSchema({
536
+ runId,
537
+ workflow: stringSchema("Registered Gateway workflow key."),
538
+ limit: integerSchema("Maximum number of approvals.", 1),
539
+ }),
540
+ }),
541
+ responseSchema: arraySchema(objectSchema({}, [], "Pending approval summary.", true), "Pending approvals."),
542
+ errors: ["InvalidRequest", "Unauthorized", "Forbidden", "Internal"],
543
+ exampleRequest: { filter: { workflow: "deploy", limit: 20 } },
544
+ exampleResponse: [{ runId: "run_01", workflowKey: "deploy", nodeId: "approve", iteration: 0, requestTitle: "Approve deploy", requestedAtMs: 1710000000000 }],
545
+ },
459
546
  {
460
547
  version: SMITHERS_API_VERSION,
461
548
  method: "streamRunEvents",
@@ -593,6 +680,9 @@ export function getRequiredScopeForGatewayMethod(method: string): GatewayScope |
593
680
  if (method === "approvals.list") {
594
681
  return "run:read";
595
682
  }
683
+ if (method === "workflows.list") {
684
+ return "run:read";
685
+ }
596
686
  if (method === "runs.diff" || method === "frames.list" || method === "frames.get" || method === "attempts.list" || method === "attempts.get") {
597
687
  return "run:read";
598
688
  }