forked from Azure/AppConfiguration-JavaScriptProvider
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
99 lines (88 loc) · 3.08 KB
/
types.ts
File metadata and controls
99 lines (88 loc) · 3.08 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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* SettingSelector is used to select key-values from Azure App Configuration based on keys and labels.
*/
export type SettingSelector = {
/**
* The key filter to apply when querying Azure App Configuration for key-values.
*
* @remarks
* An asterisk `*` can be added to the end to return all key-values whose key begins with the key filter.
* e.g. key filter `abc*` returns all key-values whose key starts with `abc`.
* Characters: asterisk `*`, comma `,`, and backslash `\` are reserved. Reserved characters must be escaped using a backslash (\).
* e.g. the key filter `a\\b\,\*c*` returns all key-values whose key starts with `a\b,*c`.
*/
keyFilter?: string,
/**
* The label filter to apply when querying Azure App Configuration for key-values.
*
* @remarks
* The characters asterisk `*` and comma `,` are not supported.
* Backslash `\` character is reserved and must be escaped using another backslash `\`.
*
* @defaultValue `LabelFilter.Null`, matching key-values without a label.
*/
labelFilter?: string
/**
* The tag filter to apply when querying Azure App Configuration for key-values.
*
* @remarks
* Each tag filter must follow the format "tagName=tagValue". Only those key-values will be loaded whose tags match all the tags provided here.
* Built in tag filter value is `TagFilter.Null`, which indicates the tag has no value. For example, `tagName=${TagFilter.Null}` will match all key-values with the tag "tagName" that has no value.
* Up to 5 tag filters can be provided. If no tag filters are provided, key-values will not be filtered based on tags.
*/
tagFilters?: string[]
/**
* The name of snapshot to load from App Configuration.
*
* @remarks
* Snapshot is a set of key-values selected from the App Configuration store based on the composition type and filters. Once created, it is stored as an immutable entity that can be referenced by name.
* If snapshot name is used in a selector, no key and label filter should be used for it. Otherwise, an exception will be thrown.
*/
snapshotName?: string
};
/**
* KeyFilter is used to filter key-values based on keys.
*/
export enum KeyFilter {
/**
* Matches all key-values.
*/
Any = "*"
};
/**
* LabelFilter is used to filter key-values based on labels.
*/
export enum LabelFilter {
/**
* Matches key-values without a label.
*/
Null = "\0"
};
/**
* TagFilter is used to filter key-values based on tags.
*/
export enum TagFilter {
/**
* Represents empty tag value.
*/
Null = ""
};
export type WatchedSetting = {
/**
* The key for this setting.
*/
key: string;
/**
* The label for this setting.
* Leaving this undefined means this setting does not have a label.
*/
label?: string;
}
export type SettingWatcher = {
etag?: string;
}
export type PagedSettingsWatcher = SettingSelector & {
pageWatchers?: SettingWatcher[]
};