-
Notifications
You must be signed in to change notification settings - Fork 38
/
constants.ts
104 lines (92 loc) · 4.81 KB
/
constants.ts
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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export const isWindows: boolean = /^win/.test(process.platform);
export const extensionName = 'vscode-azureapim';
export const extensionPrefix: string = 'azureApiManagement';
export const doubleClickDebounceDelay = 500; //milliseconds
export const topItemCount: number = 20;
export const swaggerSchema = "application/vnd.ms-azure-apim.swagger.definitions+json";
export const openApiSchema = "application/vnd.oai.openapi.components+json";
export const swaggerExport = "swagger";
export const openApiExport = "openapi%2Bjson";
export const openApiAcceptHeader = "application/vnd.oai.openapi+json";
export const swaggerAcceptHeader = "application/vnd.swagger.doc+json";
export const functionAppApiVersion = "2019-08-01";
// this api version for function app support creating function key
export const functionAppCreateKeyApiVersion = "2018-11-01";
export const invalidIdCharRegEx = "[^A-Za-z0-9]";
export const maxApiNameLength = 80;
export const HttpTriggerType = "httpTrigger";
export enum HttpTriggerDirectionContract {
in = "in",
out = "out"
}
export const HttpTriggerAuthLevelAdmin = "admin";
export const FunctionAppKeyLength = 40;
export const webAppApiVersion20190801 = "2019-08-01";
export const apimApiVersion = "2019-12-01";
export const maxTokenValidTimeSpan = 29;
export const gatewayHostName = "CustomerHostName";
export enum GatewayKeyType {
primary = "primary",
secondary = "secondary"
}
// constants for extractor
export const templatesFolder = "templates";
export const showSavePromptConfigKey = "azureApiManagement.showSavePrompt";
export const advancedPolicyAuthoringExperienceConfigKey = "azureApiManagement.advancedPolicyAuthoringExperience";
export const policyFormat = "rawxml";
export const emptyGlobalPolicyXml =
`<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
-->
<policies>
<inbound>
</inbound>
<backend>
<forward-request />
</backend>
<outbound>
</outbound>
<on-error>
</on-error>
</policies>`;
export const emptyPolicyXml =
`<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
-->
<policies>
<inbound>
<base />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>`;
export const sessionFolderKey = "currentSessionWorkingFolder";