You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.error('Error occurred during evaluation. ERROR: ',(errorasError).message);
85
+
return{
86
+
value: defaultValue,
87
+
}asResolutionDetails<T>;
88
+
}
89
+
}
90
+
91
+
initialize?(context?: any): Promise<void>{
92
+
if(context.pricingUrl){
93
+
this.pricingUrl=context.pricingUrl;
94
+
if(!context.subscription){
95
+
returnPromise.reject(
96
+
"Subscription not provided in context. Use 'subscription' to provide one. It's value must be a list comprised of at least one name of plan/add-on."
97
+
);
98
+
}
99
+
if(!context.userContext){
100
+
returnPromise.reject(
101
+
"User context not provided in context. Use 'userContext' to provide one. It's value must be a JSON object with at least the key 'user', with a string value identifying the user."
102
+
);
103
+
}
104
+
returnfetch(this.pricingUrl!)
105
+
.then(response=>response.text())
106
+
.then(yaml=>{
107
+
this.pricingYaml=yaml;
108
+
this.evaluation=evaluatePricing(
109
+
this.pricingYaml,
110
+
context.subscription,
111
+
context.userContext!
112
+
);
113
+
console.log("PricingDrivenFeaturesProvider initialized with context: ",context);
114
+
});
115
+
}else{
116
+
returnPromise.reject(
117
+
"Pricing URL not provided in context. Use 'pricingUrl' to provide one."
0 commit comments