@typespec/compiler 1.0.0-rc.2-dev.26 → 1.0.0-rc.2-dev.27
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/dist/manifest.js
CHANGED
package/lib/std/visibility.tsp
CHANGED
|
@@ -366,6 +366,7 @@ extern dec withLifecycleUpdate(target: Model, nameTemplate?: valueof string);
|
|
|
366
366
|
* model CreateDog is Create<Dog>;
|
|
367
367
|
* ```
|
|
368
368
|
*/
|
|
369
|
+
@doc("")
|
|
369
370
|
@friendlyName(NameTemplate, T)
|
|
370
371
|
@withVisibilityFilter(#{ all: #[Lifecycle.Create] }, NameTemplate)
|
|
371
372
|
model Create<T extends Reflection.Model, NameTemplate extends valueof string = "Create{name}"> {
|
|
@@ -404,6 +405,7 @@ model Create<T extends Reflection.Model, NameTemplate extends valueof string = "
|
|
|
404
405
|
* model ReadDog is Read<Dog>;
|
|
405
406
|
* ```
|
|
406
407
|
*/
|
|
408
|
+
@doc("")
|
|
407
409
|
@friendlyName(NameTemplate, T)
|
|
408
410
|
@withVisibilityFilter(#{ all: #[Lifecycle.Read] }, NameTemplate)
|
|
409
411
|
model Read<T extends Reflection.Model, NameTemplate extends valueof string = "Read{name}"> {
|
|
@@ -443,6 +445,7 @@ model Read<T extends Reflection.Model, NameTemplate extends valueof string = "Re
|
|
|
443
445
|
* model UpdateDog is Update<Dog>;
|
|
444
446
|
* ```
|
|
445
447
|
*/
|
|
448
|
+
@doc("")
|
|
446
449
|
@friendlyName(NameTemplate, T)
|
|
447
450
|
@withLifecycleUpdate(NameTemplate)
|
|
448
451
|
model Update<T extends Reflection.Model, NameTemplate extends valueof string = "Update{name}"> {
|
|
@@ -484,6 +487,7 @@ model Update<T extends Reflection.Model, NameTemplate extends valueof string = "
|
|
|
484
487
|
* model CreateOrUpdateDog is CreateOrUpdate<Dog>;
|
|
485
488
|
* ```
|
|
486
489
|
*/
|
|
490
|
+
@doc("")
|
|
487
491
|
@friendlyName(NameTemplate, T)
|
|
488
492
|
@withVisibilityFilter(#{ any: #[Lifecycle.Create, Lifecycle.Update] }, NameTemplate)
|
|
489
493
|
model CreateOrUpdate<
|
|
@@ -527,6 +531,7 @@ model CreateOrUpdate<
|
|
|
527
531
|
* model DeleteDog is Delete<Dog>;
|
|
528
532
|
* ```
|
|
529
533
|
*/
|
|
534
|
+
@doc("")
|
|
530
535
|
@friendlyName(NameTemplate, T)
|
|
531
536
|
@withVisibilityFilter(#{ all: #[Lifecycle.Delete] }, NameTemplate)
|
|
532
537
|
model Delete<T extends Reflection.Model, NameTemplate extends valueof string = "Delete{name}"> {
|
|
@@ -575,6 +580,7 @@ model Delete<T extends Reflection.Model, NameTemplate extends valueof string = "
|
|
|
575
580
|
* model QueryDog is Query<Dog>;
|
|
576
581
|
* ```
|
|
577
582
|
*/
|
|
583
|
+
@doc("")
|
|
578
584
|
@friendlyName(NameTemplate, T)
|
|
579
585
|
@withVisibilityFilter(#{ all: #[Lifecycle.Query] }, NameTemplate)
|
|
580
586
|
model Query<T extends Reflection.Model, NameTemplate extends valueof string = "Query{name}"> {
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ interface Widgets {
|
|
|
35
35
|
/** Create a widget */
|
|
36
36
|
@post create(@body body: Widget): Widget | Error;
|
|
37
37
|
/** Update a widget */
|
|
38
|
-
@patch update(@path id: string, @body body: Widget): Widget | Error;
|
|
38
|
+
@patch update(@path id: string, @body body: MergePatchUpdate<Widget>): Widget | Error;
|
|
39
39
|
/** Delete a widget */
|
|
40
40
|
@delete delete(@path id: string): void | Error;
|
|
41
41
|
|
package/templates/rest/main.tsp
CHANGED
|
@@ -35,7 +35,7 @@ interface Widgets {
|
|
|
35
35
|
/** Create a widget */
|
|
36
36
|
@post create(@body body: Widget): Widget | Error;
|
|
37
37
|
/** Update a widget */
|
|
38
|
-
@patch update(@path id: string, @body body: Widget): Widget | Error;
|
|
38
|
+
@patch update(@path id: string, @body body: MergePatchUpdate<Widget>): Widget | Error;
|
|
39
39
|
/** Delete a widget */
|
|
40
40
|
@delete delete(@path id: string): void | Error;
|
|
41
41
|
|