@typespec/rest 0.59.0 → 0.60.0-dev.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.
- package/dist/generated-defs/TypeSpec.Rest.Private.d.ts +7 -0
- package/dist/generated-defs/TypeSpec.Rest.Private.d.ts.map +1 -1
- package/dist/generated-defs/TypeSpec.Rest.d.ts +18 -0
- package/dist/generated-defs/TypeSpec.Rest.d.ts.map +1 -1
- package/dist/generated-defs/TypeSpec.Rest.ts-test.js +2 -19
- package/dist/generated-defs/TypeSpec.Rest.ts-test.js.map +1 -1
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal-decorators.d.ts +1 -4
- package/dist/src/internal-decorators.d.ts.map +1 -1
- package/dist/src/internal-decorators.js +15 -3
- package/dist/src/internal-decorators.js.map +1 -1
- package/dist/src/lib.d.ts +2 -3
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +3 -5
- package/dist/src/lib.js.map +1 -1
- package/dist/src/tsp-index.d.ts +3 -0
- package/dist/src/tsp-index.d.ts.map +1 -0
- package/dist/src/tsp-index.js +26 -0
- package/dist/src/tsp-index.js.map +1 -0
- package/lib/resource.tsp +0 -1
- package/lib/rest.tsp +1 -0
- package/package.json +7 -6
|
@@ -4,4 +4,11 @@ export type ValidateHasKeyDecorator = (context: DecoratorContext, target: Type,
|
|
|
4
4
|
export type ValidateIsErrorDecorator = (context: DecoratorContext, target: Type, value: Type) => void;
|
|
5
5
|
export type ActionSegmentDecorator = (context: DecoratorContext, target: Operation, value: string) => void;
|
|
6
6
|
export type ResourceTypeForKeyParamDecorator = (context: DecoratorContext, entity: ModelProperty, resourceType: Model) => void;
|
|
7
|
+
export type TypeSpecRestPrivateDecorators = {
|
|
8
|
+
resourceLocation: ResourceLocationDecorator;
|
|
9
|
+
validateHasKey: ValidateHasKeyDecorator;
|
|
10
|
+
validateIsError: ValidateIsErrorDecorator;
|
|
11
|
+
actionSegment: ActionSegmentDecorator;
|
|
12
|
+
resourceTypeForKeyParam: ResourceTypeForKeyParamDecorator;
|
|
13
|
+
};
|
|
7
14
|
//# sourceMappingURL=TypeSpec.Rest.Private.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeSpec.Rest.Private.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.Rest.Private.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,SAAS,EACT,MAAM,EACN,IAAI,EACL,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,yBAAyB,GAAG,CACtC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV,MAAM,MAAM,uBAAuB,GAAG,CACpC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,IAAI,KACR,IAAI,CAAC;AAEV,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,IAAI,KACR,IAAI,CAAC;AAEV,MAAM,MAAM,sBAAsB,GAAG,CACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,KACV,IAAI,CAAC;AAEV,MAAM,MAAM,gCAAgC,GAAG,CAC7C,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"TypeSpec.Rest.Private.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.Rest.Private.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,SAAS,EACT,MAAM,EACN,IAAI,EACL,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,yBAAyB,GAAG,CACtC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV,MAAM,MAAM,uBAAuB,GAAG,CACpC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,IAAI,KACR,IAAI,CAAC;AAEV,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,IAAI,KACR,IAAI,CAAC;AAEV,MAAM,MAAM,sBAAsB,GAAG,CACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,KACV,IAAI,CAAC;AAEV,MAAM,MAAM,gCAAgC,GAAG,CAC7C,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV,MAAM,MAAM,6BAA6B,GAAG;IAC1C,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,cAAc,EAAE,uBAAuB,CAAC;IACxC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,aAAa,EAAE,sBAAsB,CAAC;IACtC,uBAAuB,EAAE,gCAAgC,CAAC;CAC3D,CAAC"}
|
|
@@ -136,4 +136,22 @@ export type CollectionActionDecorator = (context: DecoratorContext, target: Oper
|
|
|
136
136
|
* @param filter Filter to exclude certain properties.
|
|
137
137
|
*/
|
|
138
138
|
export type CopyResourceKeyParametersDecorator = (context: DecoratorContext, target: Model, filter?: string) => void;
|
|
139
|
+
export type TypeSpecRestDecorators = {
|
|
140
|
+
autoRoute: AutoRouteDecorator;
|
|
141
|
+
segment: SegmentDecorator;
|
|
142
|
+
segmentOf: SegmentOfDecorator;
|
|
143
|
+
actionSeparator: ActionSeparatorDecorator;
|
|
144
|
+
resource: ResourceDecorator;
|
|
145
|
+
parentResource: ParentResourceDecorator;
|
|
146
|
+
readsResource: ReadsResourceDecorator;
|
|
147
|
+
createsResource: CreatesResourceDecorator;
|
|
148
|
+
createsOrReplacesResource: CreatesOrReplacesResourceDecorator;
|
|
149
|
+
createsOrUpdatesResource: CreatesOrUpdatesResourceDecorator;
|
|
150
|
+
updatesResource: UpdatesResourceDecorator;
|
|
151
|
+
deletesResource: DeletesResourceDecorator;
|
|
152
|
+
listsResource: ListsResourceDecorator;
|
|
153
|
+
action: ActionDecorator;
|
|
154
|
+
collectionAction: CollectionActionDecorator;
|
|
155
|
+
copyResourceKeyParameters: CopyResourceKeyParametersDecorator;
|
|
156
|
+
};
|
|
139
157
|
//# sourceMappingURL=TypeSpec.Rest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeSpec.Rest.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.Rest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACV,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;AAEpG;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,GAAG,aAAa,GAAG,SAAS,EACzC,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,KAAK,KACR,IAAI,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,gBAAg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MAAM,EAAE,eAAe,CAAC;IACxB,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,yBAAyB,EAAE,kCAAkC,CAAC;CAC/D,CAAC"}
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
/** An error here would mean that the decorator is not exported or doesn't have the right name. */
|
|
2
|
-
import { $
|
|
2
|
+
import { $decorators } from "@typespec/rest";
|
|
3
3
|
/** An error here would mean that the exported decorator is not using the same signature. Make sure to have export const $decName: DecNameDecorator = (...) => ... */
|
|
4
|
-
const _ =
|
|
5
|
-
$autoRoute,
|
|
6
|
-
$segment,
|
|
7
|
-
$segmentOf,
|
|
8
|
-
$actionSeparator,
|
|
9
|
-
$resource,
|
|
10
|
-
$parentResource,
|
|
11
|
-
$readsResource,
|
|
12
|
-
$createsResource,
|
|
13
|
-
$createsOrReplacesResource,
|
|
14
|
-
$createsOrUpdatesResource,
|
|
15
|
-
$updatesResource,
|
|
16
|
-
$deletesResource,
|
|
17
|
-
$listsResource,
|
|
18
|
-
$action,
|
|
19
|
-
$collectionAction,
|
|
20
|
-
$copyResourceKeyParameters,
|
|
21
|
-
};
|
|
4
|
+
const _ = $decorators["TypeSpec.Rest"];
|
|
22
5
|
//# sourceMappingURL=TypeSpec.Rest.ts-test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeSpec.Rest.ts-test.js","sourceRoot":"","sources":["../../generated-defs/TypeSpec.Rest.ts-test.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,
|
|
1
|
+
{"version":3,"file":"TypeSpec.Rest.ts-test.js","sourceRoot":"","sources":["../../generated-defs/TypeSpec.Rest.ts-test.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,qKAAqK;AACrK,MAAM,CAAC,GAA2B,WAAW,CAAC,eAAe,CAAC,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { $lib } from "./lib.js";
|
|
2
2
|
export * from "./resource.js";
|
|
3
3
|
export * from "./rest.js";
|
|
4
|
-
|
|
4
|
+
/** @internal */
|
|
5
|
+
export { $decorators } from "./tsp-index.js";
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAE1B,gBAAgB;AAChB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const namespace = "TypeSpec.Rest.Private";
|
|
3
|
-
export declare const $validateHasKey: ValidateHasKeyDecorator;
|
|
4
|
-
export declare const $validateIsError: ValidateIsErrorDecorator;
|
|
1
|
+
export {};
|
|
5
2
|
//# sourceMappingURL=internal-decorators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-decorators.d.ts","sourceRoot":"","sources":["../../src/internal-decorators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal-decorators.d.ts","sourceRoot":"","sources":["../../src/internal-decorators.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { getTypeName, isErrorModel } from "@typespec/compiler";
|
|
2
2
|
import { createStateSymbol, reportDiagnostic } from "./lib.js";
|
|
3
|
-
import { getResourceTypeKey } from "./resource.js";
|
|
3
|
+
import { $resourceTypeForKeyParam, getResourceTypeKey } from "./resource.js";
|
|
4
|
+
import { $actionSegment, $resourceLocation } from "./rest.js";
|
|
5
|
+
/** @internal */
|
|
4
6
|
export const namespace = "TypeSpec.Rest.Private";
|
|
5
7
|
const validatedMissingKey = createStateSymbol("validatedMissing");
|
|
6
8
|
// Workaround for the lack of template constraints https://github.com/microsoft/typespec/issues/377
|
|
7
|
-
|
|
9
|
+
const $validateHasKey = (context, target, value) => {
|
|
8
10
|
if (context.program.stateSet(validatedMissingKey).has(value)) {
|
|
9
11
|
return;
|
|
10
12
|
}
|
|
@@ -20,7 +22,7 @@ export const $validateHasKey = (context, target, value) => {
|
|
|
20
22
|
};
|
|
21
23
|
const validatedErrorKey = createStateSymbol("validatedError");
|
|
22
24
|
// Workaround for the lack of template constraints https://github.com/microsoft/typespec/issues/377
|
|
23
|
-
|
|
25
|
+
const $validateIsError = (context, target, value) => {
|
|
24
26
|
if (context.program.stateSet(validatedErrorKey).has(value)) {
|
|
25
27
|
return;
|
|
26
28
|
}
|
|
@@ -34,4 +36,14 @@ export const $validateIsError = (context, target, value) => {
|
|
|
34
36
|
context.program.stateSet(validatedErrorKey).add(value);
|
|
35
37
|
}
|
|
36
38
|
};
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const $decorators = {
|
|
41
|
+
"TypeSpec.Rest.Private": {
|
|
42
|
+
actionSegment: $actionSegment,
|
|
43
|
+
resourceLocation: $resourceLocation,
|
|
44
|
+
resourceTypeForKeyParam: $resourceTypeForKeyParam,
|
|
45
|
+
validateHasKey: $validateHasKey,
|
|
46
|
+
validateIsError: $validateIsError,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
37
49
|
//# sourceMappingURL=internal-decorators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-decorators.js","sourceRoot":"","sources":["../../src/internal-decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,WAAW,EAAE,YAAY,EAAQ,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"internal-decorators.js","sourceRoot":"","sources":["../../src/internal-decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,WAAW,EAAE,YAAY,EAAQ,MAAM,oBAAoB,CAAC;AAMvF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9D,gBAAgB;AAChB,MAAM,CAAC,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAEjD,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAClE,mGAAmG;AACnG,MAAM,eAAe,GAA4B,CAC/C,OAAyB,EACzB,MAAY,EACZ,KAAW,EACX,EAAE;IACF,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7D,OAAO;IACT,CAAC;IACD,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACzF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE;YAChC,IAAI,EAAE,sBAAsB;YAC5B,MAAM,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE;YACzC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<{
|
|
2
2
|
"not-key-type": {
|
|
3
3
|
readonly default: "Cannot copy keys from a non-key type (KeysOf<T> or ParentKeysOf<T>)";
|
|
4
4
|
};
|
|
@@ -21,7 +21,7 @@ declare const restLib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
21
21
|
readonly default: import("@typespec/compiler").CallableMessage<["decoratorName"]>;
|
|
22
22
|
};
|
|
23
23
|
}, Record<string, any>, never>;
|
|
24
|
-
declare const reportDiagnostic: <C extends "not-key-type" | "resource-missing-key" | "resource-missing-error" | "duplicate-key" | "duplicate-parent-key" | "invalid-action-name" | "shared-route-unspecified-action-name", M extends keyof {
|
|
24
|
+
export declare const reportDiagnostic: <C extends "not-key-type" | "resource-missing-key" | "resource-missing-error" | "duplicate-key" | "duplicate-parent-key" | "invalid-action-name" | "shared-route-unspecified-action-name", M extends keyof {
|
|
25
25
|
"not-key-type": {
|
|
26
26
|
readonly default: "Cannot copy keys from a non-key type (KeysOf<T> or ParentKeysOf<T>)";
|
|
27
27
|
};
|
|
@@ -110,5 +110,4 @@ declare const reportDiagnostic: <C extends "not-key-type" | "resource-missing-ke
|
|
|
110
110
|
readonly default: import("@typespec/compiler").CallableMessage<["decoratorName"]>;
|
|
111
111
|
};
|
|
112
112
|
}, C, M>) => import("@typespec/compiler").Diagnostic, createStateSymbol: (name: string) => symbol;
|
|
113
|
-
export { createDiagnostic, createStateSymbol, reportDiagnostic, restLib };
|
|
114
113
|
//# sourceMappingURL=lib.d.ts.map
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;8BA8Cf,CAAC;AAEH,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAAE,iBAAiB,0BAAS,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler";
|
|
2
|
-
const
|
|
2
|
+
export const $lib = createTypeSpecLibrary({
|
|
3
3
|
name: "@typespec/rest",
|
|
4
4
|
diagnostics: {
|
|
5
5
|
"not-key-type": {
|
|
@@ -45,8 +45,6 @@ const libDefinition = {
|
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
|
-
};
|
|
49
|
-
const
|
|
50
|
-
const { reportDiagnostic, createDiagnostic, createStateSymbol } = restLib;
|
|
51
|
-
export { createDiagnostic, createStateSymbol, reportDiagnostic, restLib };
|
|
48
|
+
});
|
|
49
|
+
export const { reportDiagnostic, createDiagnostic, createStateSymbol } = $lib;
|
|
52
50
|
//# sourceMappingURL=lib.js.map
|
package/dist/src/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;IACxC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;QACX,cAAc,EAAE;YACd,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,qEAAqE;aAC/E;SACF;QACD,sBAAsB,EAAE;YACtB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,SAAS,WAAW,qGAAqG;aAC/I;SACF;QACD,wBAAwB,EAAE;YACxB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,SAAS,WAAW,6EAA6E;aACvH;SACF;QACD,eAAe,EAAE;YACf,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,yCAAyC,cAAc,EAAE;aAC/E;SACF;QACD,sBAAsB,EAAE;YACtB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,kBAAkB,cAAc,+BAA+B,SAAS,oEAAoE;aAClK;SACF;QACD,qBAAqB,EAAE;YACrB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,qCAAqC;aAC/C;SACF;QACD,sCAAsC,EAAE;YACtC,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,iGAAiG,eAAe,IAAI;aAC1I;SACF;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsp-index.d.ts","sourceRoot":"","sources":["../../src/tsp-index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { $copyResourceKeyParameters, $parentResource } from "./resource.js";
|
|
2
|
+
import { $action, $actionSeparator, $autoRoute, $collectionAction, $createsOrReplacesResource, $createsOrUpdatesResource, $createsResource, $deletesResource, $listsResource, $readsResource, $resource, $segment, $segmentOf, $updatesResource, } from "./rest.js";
|
|
3
|
+
export { $lib } from "./lib.js";
|
|
4
|
+
export { $onValidate } from "./validate.js";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export const $decorators = {
|
|
7
|
+
"TypeSpec.Rest": {
|
|
8
|
+
autoRoute: $autoRoute,
|
|
9
|
+
segment: $segment,
|
|
10
|
+
segmentOf: $segmentOf,
|
|
11
|
+
actionSeparator: $actionSeparator,
|
|
12
|
+
resource: $resource,
|
|
13
|
+
parentResource: $parentResource,
|
|
14
|
+
readsResource: $readsResource,
|
|
15
|
+
createsResource: $createsResource,
|
|
16
|
+
createsOrReplacesResource: $createsOrReplacesResource,
|
|
17
|
+
createsOrUpdatesResource: $createsOrUpdatesResource,
|
|
18
|
+
updatesResource: $updatesResource,
|
|
19
|
+
deletesResource: $deletesResource,
|
|
20
|
+
listsResource: $listsResource,
|
|
21
|
+
action: $action,
|
|
22
|
+
collectionAction: $collectionAction,
|
|
23
|
+
copyResourceKeyParameters: $copyResourceKeyParameters,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=tsp-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsp-index.js","sourceRoot":"","sources":["../../src/tsp-index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,SAAS,EACT,QAAQ,EACR,UAAU,EACV,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,eAAe,EAAE;QACf,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,QAAQ;QACjB,SAAS,EAAE,UAAU;QACrB,eAAe,EAAE,gBAAgB;QACjC,QAAQ,EAAE,SAAS;QACnB,cAAc,EAAE,eAAe;QAC/B,aAAa,EAAE,cAAc;QAC7B,eAAe,EAAE,gBAAgB;QACjC,yBAAyB,EAAE,0BAA0B;QACrD,wBAAwB,EAAE,yBAAyB;QACnD,eAAe,EAAE,gBAAgB;QACjC,eAAe,EAAE,gBAAgB;QACjC,aAAa,EAAE,cAAc;QAC7B,MAAM,EAAE,OAAO;QACf,gBAAgB,EAAE,iBAAiB;QACnC,yBAAyB,EAAE,0BAA0B;KACrB;CACnC,CAAC"}
|
package/lib/resource.tsp
CHANGED
package/lib/rest.tsp
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/rest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0-dev.1",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec REST protocol binding",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -38,22 +38,23 @@
|
|
|
38
38
|
"!dist/test/**"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@typespec/compiler": "~0.59.0",
|
|
42
|
-
"@typespec/http": "~0.59.0"
|
|
41
|
+
"@typespec/compiler": "~0.59.0 || >=0.60.0-dev <0.60.0",
|
|
42
|
+
"@typespec/http": "~0.59.0 || >=0.60.0-dev <0.60.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "~18.11.19",
|
|
46
|
+
"@typespec/compiler": "~0.59.0 || >=0.60.0-dev <0.60.0",
|
|
47
|
+
"@typespec/http": "~0.59.0 || >=0.60.0-dev <0.60.0",
|
|
48
|
+
"@typespec/library-linter": "~0.59.0 || >=0.60.0-dev <0.60.0",
|
|
46
49
|
"@vitest/coverage-v8": "^2.0.4",
|
|
47
50
|
"@vitest/ui": "^2.0.4",
|
|
48
51
|
"c8": "^10.1.2",
|
|
49
52
|
"rimraf": "~6.0.1",
|
|
50
53
|
"typescript": "~5.5.4",
|
|
51
54
|
"vitest": "^2.0.4",
|
|
52
|
-
"@typespec/compiler": "~0.59.0",
|
|
53
|
-
"@typespec/http": "~0.59.0",
|
|
54
|
-
"@typespec/library-linter": "~0.59.0",
|
|
55
55
|
"@typespec/tspd": "~0.46.0"
|
|
56
56
|
},
|
|
57
|
+
"dependencies": {},
|
|
57
58
|
"scripts": {
|
|
58
59
|
"clean": "rimraf ./dist ./temp",
|
|
59
60
|
"build": "npm run gen-extern-signature && tsc -p . && npm run lint-typespec-library",
|