-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme-openapi.yml
More file actions
1291 lines (1254 loc) · 51.1 KB
/
Copy paththeme-openapi.yml
File metadata and controls
1291 lines (1254 loc) · 51.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.4
info:
title: Theme API
version: 0.1.0
x-products: [edk, vdx]
description: |
Tenant branding and theming API. Tenants brand every product surface from one system:
a simple brand (app name, colors, logos, favicon, tagline) set once at tenant level,
full design tokens for pixel control, and per-application overrides for every deployed
instance the tenant runs. Applications have features, and features declare named design
elements (a sign-in logo, a background, a tagline) that are bindable at tenant scope or
per application, optionally per variant.
Resolution endpoints are public (`security: []`) so pre-auth surfaces such as a login
page can fetch their own theme. The tenant path segment is validated against the tenant
registry; an unknown tenant is a 404. There is never a default tenant fallback, and
headers are never authoritative for tenancy. A known tenant with no definitions resolves
to system defaults with `fallback=true` and `X-Theme-Fallback: true`.
Resolution and stylesheet GETs return a strong `ETag` and honor `If-None-Match` with 304.
servers:
- url: https://api.example.com/api/theme/v1
description: Production server.
- url: http://localhost:8080/api/theme/v1
description: Local development server.
security:
- bearer: []
tags:
- name: ThemeResolution
description: Public theme, CSS, and feature resolution, plus the cross-domain branding context.
- name: ThemeBrand
description: The tenant simple brand and sparse per-application brand overrides.
- name: ThemeApplications
description: Registry of the tenant's deployed, brandable application instances.
- name: ThemeFeatures
description: Brandable features a product type declares, built-in and custom.
- name: ThemeElements
description: Design element bindings at tenant scope or per application, optionally per variant.
- name: ThemeDefinitions
description: Theme definition CRUD with validation, undo, restore, and history.
- name: ThemeTokens
description: Direct token editing against the canonical definitions.
- name: ThemeStylesheets
description: Tenant and per-application custom CSS stylesheets.
- name: ThemeAdministration
description: Palette generation, tenant theme seeding, and cache purge operations.
paths:
# ---- Public resolution ----------------------------------------------------
/{tenant}/resolved:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
get:
tags: [ThemeResolution]
summary: Resolve theme
operationId: resolveTheme
x-command-id: theme.rest-resolution.resolve
security: []
description: |
Resolves the effective theme for a tenant, optionally scoped to a registered
application and variant. Later scopes win: SYSTEM < PRODUCT < TENANT < APPLICATION
< PRINCIPAL; the PRODUCT and APPLICATION layers apply only when `applicationId` is
supplied. Returns 404 for an unknown tenant; a known tenant with no definitions
resolves to system defaults with `fallback=true` and `X-Theme-Fallback: true`.
parameters:
- $ref: './theme-components.yml#/components/parameters/VariantQuery'
- $ref: './theme-components.yml#/components/parameters/ApplicationIdQuery'
- $ref: './theme-components.yml#/components/parameters/ResolutionModeQuery'
- $ref: './theme-components.yml#/components/parameters/IfNoneMatchHeader'
responses:
'200':
description: Resolved theme.
headers:
ETag:
description: Strong ETag over the resolved tokens and applied layers.
schema:
type: string
X-Theme-Fallback:
description: True when the tenant has no definitions and system defaults were served.
schema:
type: boolean
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ResolvedTheme'
'304':
description: Cached theme is still current.
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/resolved/css:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
get:
tags: [ThemeResolution]
summary: Resolve theme CSS
operationId: resolveThemeCss
x-command-id: theme.rest-resolution.css
security: []
description: |
Resolves the effective theme and returns it as CSS custom properties. Same
parameters and tenant semantics as `GET /{tenant}/resolved`.
parameters:
- $ref: './theme-components.yml#/components/parameters/VariantQuery'
- $ref: './theme-components.yml#/components/parameters/ApplicationIdQuery'
- $ref: './theme-components.yml#/components/parameters/ResolutionModeQuery'
- $ref: './theme-components.yml#/components/parameters/IfNoneMatchHeader'
responses:
'200':
description: Resolved theme as CSS custom properties.
headers:
ETag:
description: Strong ETag over the resolved tokens and applied layers.
schema:
type: string
X-Theme-Fallback:
description: True when the tenant has no definitions and system defaults were served.
schema:
type: boolean
content:
text/css:
schema:
type: string
'304':
description: Cached CSS is still current.
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/applications/{applicationId}/features/{featureId}/resolved:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ApplicationIdPath'
- $ref: './theme-components.yml#/components/parameters/FeatureIdPath'
get:
tags: [ThemeResolution]
summary: Resolve a feature for an application
operationId: resolveApplicationFeature
x-command-id: theme.rest-feature.resolve
security: []
description: |
Resolves the design elements of one feature for a registered application: what a
running application fetches for itself. Per element, the first match wins:
application binding (variant, then common), tenant binding (variant, then common),
product default, element default, then the element's fallback token key; a required
element that resolves to nothing is listed in `missingRequired`.
parameters:
- $ref: './theme-components.yml#/components/parameters/VariantQuery'
- $ref: './theme-components.yml#/components/parameters/IfNoneMatchHeader'
responses:
'200':
description: Resolved feature elements.
headers:
ETag:
description: Strong ETag over the resolved element values and origins.
schema:
type: string
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ResolvedFeature'
'304':
description: Cached feature resolution is still current.
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/products/{productType}/features/{featureId}/resolved:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ProductTypePath'
- $ref: './theme-components.yml#/components/parameters/FeatureIdPath'
get:
tags: [ThemeResolution]
summary: Resolve a feature at product level
operationId: resolveProductFeature
x-command-id: theme.rest-feature.resolve-product
security: []
description: |
Resolves the design elements of one feature at tenant level for a product type,
without an application override layer: the defaults every application of this
product inherits.
parameters:
- $ref: './theme-components.yml#/components/parameters/VariantQuery'
- $ref: './theme-components.yml#/components/parameters/IfNoneMatchHeader'
responses:
'200':
description: Resolved feature elements.
headers:
ETag:
description: Strong ETag over the resolved element values and origins.
schema:
type: string
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ResolvedFeature'
'304':
description: Cached feature resolution is still current.
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
# ---- Stylesheets ------------------------------------------------------------
/{tenant}/stylesheet:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
get:
tags: [ThemeStylesheets]
summary: Get the tenant stylesheet
operationId: getTenantStylesheet
x-command-id: theme.rest-stylesheet.serve
security: []
description: Serves the tenant's custom CSS stylesheet. Returns 404 for an unknown tenant or when no stylesheet is set.
parameters:
- $ref: './theme-components.yml#/components/parameters/IfNoneMatchHeader'
responses:
'200':
description: The tenant stylesheet.
headers:
ETag:
schema:
type: string
content:
text/css:
schema:
type: string
'304':
description: Cached stylesheet is still current.
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
put:
tags: [ThemeStylesheets]
summary: Set the tenant stylesheet
operationId: setTenantStylesheet
x-command-id: theme.rest-stylesheet.set
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/StylesheetInput'
responses:
'204':
description: The stylesheet was stored.
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
delete:
tags: [ThemeStylesheets]
summary: Delete the tenant stylesheet
operationId: deleteTenantStylesheet
x-command-id: theme.rest-stylesheet.delete
responses:
'204':
description: The stylesheet was deleted.
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/applications/{applicationId}/stylesheet:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ApplicationIdPath'
get:
tags: [ThemeStylesheets]
summary: Get an application stylesheet
operationId: getApplicationStylesheet
x-command-id: theme.rest-stylesheet.serve-application
security: []
description: Serves the custom CSS stylesheet of one registered application. Returns 404 for an unknown tenant or application, or when no stylesheet is set.
parameters:
- $ref: './theme-components.yml#/components/parameters/IfNoneMatchHeader'
responses:
'200':
description: The application stylesheet.
headers:
ETag:
schema:
type: string
content:
text/css:
schema:
type: string
'304':
description: Cached stylesheet is still current.
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
put:
tags: [ThemeStylesheets]
summary: Set an application stylesheet
operationId: setApplicationStylesheet
x-command-id: theme.rest-stylesheet.set-application
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/StylesheetInput'
responses:
'204':
description: The stylesheet was stored.
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
delete:
tags: [ThemeStylesheets]
summary: Delete an application stylesheet
operationId: deleteApplicationStylesheet
x-command-id: theme.rest-stylesheet.delete-application
responses:
'204':
description: The stylesheet was deleted.
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
# ---- Brand ------------------------------------------------------------------
/{tenant}/brand:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
get:
tags: [ThemeBrand]
summary: Get the tenant brand
operationId: getBrand
x-command-id: theme.rest-brand.get
responses:
'200':
description: The tenant brand.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/BrandOutput'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
put:
tags: [ThemeBrand]
summary: Set the tenant brand
operationId: setBrand
x-command-id: theme.rest-brand.set
description: >-
Applies the tenant brand and regenerates the palette tokens in the canonical tenant
definitions, preserving power overrides. Simple and advanced modes compose because
they target the same definitions.
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/BrandInput'
responses:
'200':
description: The updated tenant brand.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/BrandOutput'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/applications/{applicationId}/brand:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ApplicationIdPath'
get:
tags: [ThemeBrand]
summary: Get an application brand
operationId: getApplicationBrand
x-command-id: theme.rest-brand.get-application
responses:
'200':
description: The application brand override.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/BrandOutput'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
put:
tags: [ThemeBrand]
summary: Set an application brand
operationId: setApplicationBrand
x-command-id: theme.rest-brand.set-application
description: >-
Applies a sparse brand override for one registered application. Set properties
override the tenant brand for this application; omitted properties keep cascading
from the tenant default.
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ApplicationBrandInput'
responses:
'200':
description: The updated application brand.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/BrandOutput'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
delete:
tags: [ThemeBrand]
summary: Delete an application brand
operationId: deleteApplicationBrand
x-command-id: theme.rest-brand.delete-application
description: Removes the application's brand override so it cascades from the tenant brand again.
responses:
'204':
description: The application brand override was deleted.
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
# ---- Applications registry ---------------------------------------------------
/{tenant}/applications:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
get:
tags: [ThemeApplications]
summary: List applications
operationId: listApplications
x-command-id: theme.rest-application.list
description: >-
Returns every brandable application the tenant runs, as a plain array:
platform-managed instances merged from the platform instance registries plus
applications registered through this API.
responses:
'200':
description: The tenant's applications.
content:
application/json:
schema:
type: array
items:
$ref: './theme-components.yml#/components/schemas/Application'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
post:
tags: [ThemeApplications]
summary: Register an application
operationId: registerApplication
x-command-id: theme.rest-application.register
description: Registers an external application (a self-hosted portal, a mobile app) as a brandable instance.
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ApplicationInput'
responses:
'201':
description: The registered application.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/Application'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/applications/{applicationId}:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ApplicationIdPath'
get:
tags: [ThemeApplications]
summary: Get an application
operationId: getApplication
x-command-id: theme.rest-application.get
responses:
'200':
description: The application.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/Application'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
put:
tags: [ThemeApplications]
summary: Update an application
operationId: updateApplication
x-command-id: theme.rest-application.update
description: Updates a registered application. Platform-managed instances are read-only here and return 409.
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ApplicationInput'
responses:
'200':
description: The updated application.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/Application'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'409':
$ref: './common-components.yml#/components/responses/Conflict'
'500':
$ref: './common-components.yml#/components/responses/Error'
delete:
tags: [ThemeApplications]
summary: Delete an application
operationId: deleteApplication
x-command-id: theme.rest-application.delete
description: Deletes a registered application. Platform-managed instances are read-only here and return 409.
responses:
'204':
description: The application was deleted.
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'409':
$ref: './common-components.yml#/components/responses/Conflict'
'500':
$ref: './common-components.yml#/components/responses/Error'
# ---- Features -----------------------------------------------------------------
/{tenant}/products/{productType}/features:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ProductTypePath'
get:
tags: [ThemeFeatures]
summary: List features
operationId: listFeatures
x-command-id: theme.rest-feature.list
description: Returns the brandable features of a product type as a plain array, built-in and custom.
responses:
'200':
description: The product's features.
content:
application/json:
schema:
type: array
items:
$ref: './theme-components.yml#/components/schemas/FeatureDefinition'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
post:
tags: [ThemeFeatures]
summary: Create a custom feature
operationId: createFeature
x-command-id: theme.rest-feature.create
description: Registers a custom feature, as published by user-built workflows, forms, and portal pages.
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/FeatureInput'
responses:
'201':
description: The created feature.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/FeatureDefinition'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/products/{productType}/features/{featureId}:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ProductTypePath'
- $ref: './theme-components.yml#/components/parameters/FeatureIdPath'
get:
tags: [ThemeFeatures]
summary: Get a feature
operationId: getFeature
x-command-id: theme.rest-feature.get
responses:
'200':
description: The feature.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/FeatureDefinition'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
put:
tags: [ThemeFeatures]
summary: Update a custom feature
operationId: updateFeature
x-command-id: theme.rest-feature.update
description: Updates a custom feature. Built-in features are read-only and return 409.
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/FeatureInput'
responses:
'200':
description: The updated feature.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/FeatureDefinition'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'409':
$ref: './common-components.yml#/components/responses/Conflict'
'500':
$ref: './common-components.yml#/components/responses/Error'
delete:
tags: [ThemeFeatures]
summary: Delete a custom feature
operationId: deleteFeature
x-command-id: theme.rest-feature.delete
description: Deletes a custom feature. Built-in features are read-only and return 409.
responses:
'204':
description: The feature was deleted.
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'409':
$ref: './common-components.yml#/components/responses/Conflict'
'500':
$ref: './common-components.yml#/components/responses/Error'
# ---- Design element bindings ----------------------------------------------------
/{tenant}/products/{productType}/features/{featureId}/elements:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ProductTypePath'
- $ref: './theme-components.yml#/components/parameters/FeatureIdPath'
get:
tags: [ThemeElements]
summary: List element bindings
operationId: listElementBindings
x-command-id: theme.rest-element.list
description: >-
Returns the stored design element bindings of a feature as a plain array. Without
filters, all bindings are returned; `applicationId` and `variant` narrow to one slot.
parameters:
- $ref: './theme-components.yml#/components/parameters/ApplicationIdQuery'
- $ref: './theme-components.yml#/components/parameters/VariantQuery'
responses:
'200':
description: The stored element bindings.
content:
application/json:
schema:
type: array
items:
$ref: './theme-components.yml#/components/schemas/ElementBinding'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/products/{productType}/features/{featureId}/elements/{elementId}:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ProductTypePath'
- $ref: './theme-components.yml#/components/parameters/FeatureIdPath'
- $ref: './theme-components.yml#/components/parameters/ElementIdPath'
put:
tags: [ThemeElements]
summary: Set an element binding
operationId: setElementBinding
x-command-id: theme.rest-element.set
description: >-
Binds a value to a design element at tenant scope (`applicationId` absent: the
default for every application of the product) or application scope, optionally per
variant. The `applicationId` and `variant` query parameters select the exact
binding slot. Exactly one of `asset` or `text` is set, matching the element kind.
parameters:
- $ref: './theme-components.yml#/components/parameters/ApplicationIdQuery'
- $ref: './theme-components.yml#/components/parameters/VariantQuery'
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ElementBindingInput'
responses:
'200':
description: The stored element binding.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ElementBinding'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
delete:
tags: [ThemeElements]
summary: Delete an element binding
operationId: deleteElementBinding
x-command-id: theme.rest-element.delete
description: >-
Removes the binding at the exact slot selected by the `applicationId` and `variant`
query parameters, so resolution falls through to the next layer.
parameters:
- $ref: './theme-components.yml#/components/parameters/ApplicationIdQuery'
- $ref: './theme-components.yml#/components/parameters/VariantQuery'
responses:
'204':
description: The element binding was deleted.
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
# ---- Theme definitions -----------------------------------------------------------
/{tenant}/definitions:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
get:
tags: [ThemeDefinitions]
summary: List theme definitions
operationId: listThemeDefinitions
x-command-id: theme.rest-definition.list
description: Returns the tenant's theme definitions matching the optional filters, as a plain array.
parameters:
- $ref: './theme-components.yml#/components/parameters/ScopeQuery'
- $ref: './theme-components.yml#/components/parameters/ProductTypeQuery'
- $ref: './theme-components.yml#/components/parameters/ApplicationIdQuery'
- $ref: './theme-components.yml#/components/parameters/VariantQuery'
responses:
'200':
description: The matching theme definitions.
content:
application/json:
schema:
type: array
items:
$ref: './theme-components.yml#/components/schemas/ThemeDefinition'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
post:
tags: [ThemeDefinitions]
summary: Create a theme definition
operationId: createThemeDefinition
x-command-id: theme.rest-definition.create
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ThemeDefinitionInput'
responses:
'201':
description: The created theme definition.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ThemeDefinition'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/definitions/validate:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
post:
tags: [ThemeDefinitions]
summary: Validate a theme definition
operationId: validateThemeDefinition
x-command-id: theme.rest-definition.validate
description: Validates a theme definition without saving it, including the scope key rules (PRODUCT requires `productType`, APPLICATION requires `applicationId`, other scopes carry neither).
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ThemeDefinitionInput'
responses:
'200':
description: The validation result.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ThemeValidationResult'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
/{tenant}/definitions/{themeId}:
parameters:
- $ref: './theme-components.yml#/components/parameters/TenantPath'
- $ref: './theme-components.yml#/components/parameters/ThemeIdPath'
get:
tags: [ThemeDefinitions]
summary: Get a theme definition
operationId: getThemeDefinition
x-command-id: theme.rest-definition.get
responses:
'200':
description: The theme definition.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ThemeDefinition'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':
$ref: './common-components.yml#/components/responses/NotFound'
'500':
$ref: './common-components.yml#/components/responses/Error'
put:
tags: [ThemeDefinitions]
summary: Update a theme definition
operationId: updateThemeDefinition
x-command-id: theme.rest-definition.update
requestBody:
required: true
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ThemeDefinitionInput'
responses:
'200':
description: The updated theme definition.
content:
application/json:
schema:
$ref: './theme-components.yml#/components/schemas/ThemeDefinition'
'400':
$ref: './common-components.yml#/components/responses/ValidationError'
'401':
$ref: './common-components.yml#/components/responses/Unauthorized'
'403':
$ref: './common-components.yml#/components/responses/Forbidden'
'404':