-
Notifications
You must be signed in to change notification settings - Fork 221
/
fml.udl
85 lines (67 loc) · 2.77 KB
/
fml.udl
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
namespace fml {};
[Custom]
typedef string JsonObject;
[Error]
enum FMLError {
"IOError", "JSONError", "YAMLError", "UrlError", "FetchError", "InvalidPath",
"TemplateProblem", "Fatal", "InternalError", "ValidationError", "TypeParsingError",
"InvalidChannelError", "FMLModuleError", "CliError", "ClientError", "InvalidFeatureError",
"FeatureValidationError",
};
dictionary MergedJsonWithErrors {
string json;
sequence<FMLError> errors;
};
dictionary FmlLoaderConfig {
string? cache;
record<DOMString, string> refs;
sequence<string> ref_files;
};
interface FmlClient {
// Constructs a new FmlClient object.
//
// Definitions of the parameters are as follows:
// - `manifest_path`: The path (relative to the current working directory) to the fml.yml that should be loaded.
// - `channel`: The channel that should be loaded for the manifest.
[Throws=FMLError]
constructor(string manifest, string channel);
[Name=new_with_ref, Throws=FMLError]
constructor(string manifest, string channel, string? ref_);
[Name=new_with_config, Throws=FMLError]
constructor(string manifest, string channel, FmlLoaderConfig config);
// Validates a supplied feature configuration. Returns true or an FMLError.
[Throws=FMLError]
boolean is_feature_valid(string feature_id, JsonObject value);
// Validates a supplied list of feature configurations. The valid configurations will be merged into the manifest's
// default feature JSON, and invalid configurations will be returned as a list of their respective errors.
[Throws=FMLError]
MergedJsonWithErrors merge(record<DOMString, JsonObject> feature_configs);
// Returns the default feature JSON for the loaded FML's selected channel.
[Throws=FMLError]
string get_default_json();
// Returns a list of feature ids that support coenrollment.
[Throws=FMLError]
sequence<string> get_coenrolling_feature_ids();
// Returns a list of feature ids.
sequence<string> get_feature_ids();
// Returns a description of the given feature.
// If no feature exists, returns None.
FmlFeatureDescriptor? get_feature_descriptor(string id);
// Returns a description of the given feature.
// If no feature exists, returns None.
sequence<FmlFeatureDescriptor> get_feature_descriptors();
FmlFeatureInspector? get_feature_inspector(string id);
};
dictionary FmlFeatureDescriptor {
string id;
string description;
boolean is_coenrolling;
};
interface FmlFeatureInspector {
// Validates a supplied feature configuration. Returns true or an FMLError.
[Throws=FMLError]
boolean is_feature_valid(JsonObject value);
// Returns the default JSON for the feature for this channel.
[Throws=FMLError]
JsonObject get_default_json();
};