@azure-tools/typespec-azure-core 0.68.0-dev.5 → 0.68.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-final-state-via.d.ts","sourceRoot":"","sources":["../../../src/decorators/use-final-state-via.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAQpF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"use-final-state-via.d.ts","sourceRoot":"","sources":["../../../src/decorators/use-final-state-via.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAQpF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,yBAqD/B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ignoreDiagnostics } from "@typespec/compiler";
|
|
2
2
|
import { getHttpOperation } from "@typespec/http";
|
|
3
|
-
import { reportDiagnostic } from "../lib.js";
|
|
3
|
+
import { createDiagnostic, reportDiagnostic } from "../lib.js";
|
|
4
4
|
import { FinalStateValue, setFinalStateOverride, validateFinalState, } from "../state/final-state.js";
|
|
5
5
|
/**
|
|
6
6
|
* overrides the final state for an lro
|
|
@@ -33,23 +33,30 @@ export const $useFinalStateVia = (context, entity, finalState) => {
|
|
|
33
33
|
});
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
return {
|
|
37
|
+
onTargetFinish: () => {
|
|
38
|
+
const operation = ignoreDiagnostics(getHttpOperation(program, entity));
|
|
39
|
+
const storedValue = validateFinalState(program, operation, finalStateVia);
|
|
40
|
+
if (storedValue !== undefined || operation.verb === "put") {
|
|
41
|
+
setFinalStateOverride(program, entity, finalStateVia);
|
|
42
|
+
}
|
|
43
|
+
if (storedValue === undefined &&
|
|
44
|
+
[
|
|
45
|
+
FinalStateValue.operationLocation,
|
|
46
|
+
FinalStateValue.location,
|
|
47
|
+
FinalStateValue.azureAsyncOperation,
|
|
48
|
+
].includes(finalStateVia)) {
|
|
49
|
+
return [
|
|
50
|
+
createDiagnostic({
|
|
51
|
+
code: "invalid-final-state",
|
|
52
|
+
target: entity,
|
|
53
|
+
messageId: "noHeader",
|
|
54
|
+
format: { finalStateValue: finalStateVia },
|
|
55
|
+
}),
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
return [];
|
|
59
|
+
},
|
|
60
|
+
};
|
|
54
61
|
};
|
|
55
62
|
//# sourceMappingURL=use-final-state-via.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-final-state-via.js","sourceRoot":"","sources":["../../../src/decorators/use-final-state-via.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"use-final-state-via.js","sourceRoot":"","sources":["../../../src/decorators/use-final-state-via.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC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aAAa,CAAC,EACzB,CAAC;gBACD,OAAO;oBACL,gBAAgB,CAAC;wBACf,IAAI,EAAE,qBAAqB;wBAC3B,MAAM,EAAE,MAAM;wBACd,SAAS,EAAE,UAAU;wBACrB,MAAM,EAAE,EAAE,eAAe,EAAE,aAAa,EAAE;qBAC3C,CAAC;iBACH,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/foundations.tsp
CHANGED
|
@@ -74,7 +74,9 @@ alias ResourceCreatedResponse<Resource extends TypeSpec.Reflection.Model> = Type
|
|
|
74
74
|
|
|
75
75
|
alias ResourceOkResponse<Resource> = TypeSpec.Http.Response<200> & Resource;
|
|
76
76
|
|
|
77
|
-
alias ResourceCreatedOrOkResponse<Resource extends TypeSpec.Reflection.Model> =
|
|
77
|
+
alias ResourceCreatedOrOkResponse<Resource extends TypeSpec.Reflection.Model> =
|
|
78
|
+
| ResourceCreatedResponse<Resource>
|
|
79
|
+
| ResourceOkResponse<Resource>;
|
|
78
80
|
|
|
79
81
|
/**
|
|
80
82
|
* Response describing the location of a created resource.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-core",
|
|
3
|
-
"version": "0.68.0
|
|
3
|
+
"version": "0.68.0",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Core library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -47,26 +47,25 @@
|
|
|
47
47
|
"!dist/test/**"
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@typespec/compiler": "^1.
|
|
51
|
-
"@typespec/
|
|
52
|
-
"@typespec/
|
|
50
|
+
"@typespec/compiler": "^1.12.0",
|
|
51
|
+
"@typespec/rest": "^0.82.0",
|
|
52
|
+
"@typespec/http": "^1.12.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^25.5.2",
|
|
56
|
-
"@typespec/compiler": "^1.11.0",
|
|
57
|
-
"@typespec/http": "^1.11.0",
|
|
58
|
-
"@typespec/library-linter": "^0.81.0 || >=0.82.0-dev <0.82.0",
|
|
59
|
-
"@typespec/openapi": "^1.11.0",
|
|
60
|
-
"@typespec/rest": "^0.81.0 || >=0.82.0-dev <0.82.0",
|
|
61
|
-
"@typespec/tspd": "^0.74.1 || >=0.75.0-dev <0.75.0",
|
|
62
|
-
"@typespec/versioning": "^0.81.0 || >=0.82.0-dev <0.82.0",
|
|
63
56
|
"@vitest/coverage-v8": "^4.1.3",
|
|
64
57
|
"@vitest/ui": "^4.1.3",
|
|
65
58
|
"rimraf": "^6.1.3",
|
|
66
59
|
"typescript": "~6.0.2",
|
|
67
|
-
"vitest": "^4.1.3"
|
|
60
|
+
"vitest": "^4.1.3",
|
|
61
|
+
"@typespec/compiler": "^1.12.0",
|
|
62
|
+
"@typespec/library-linter": "^0.82.0",
|
|
63
|
+
"@typespec/tspd": "^0.74.2",
|
|
64
|
+
"@typespec/rest": "^0.82.0",
|
|
65
|
+
"@typespec/http": "^1.12.0",
|
|
66
|
+
"@typespec/openapi": "^1.12.0",
|
|
67
|
+
"@typespec/versioning": "^0.82.0"
|
|
68
68
|
},
|
|
69
|
-
"dependencies": {},
|
|
70
69
|
"scripts": {
|
|
71
70
|
"clean": "rimraf ./dist ./temp",
|
|
72
71
|
"build": "pnpm run gen-extern-signature && tsc -p tsconfig.build.json && pnpm run lint-typespec-library",
|