@startinblox/components-ds4go 4.1.1 → 4.1.2
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.
- package/dist/index.js +360 -353
- package/package.json +1 -1
- package/src/components/solid-fact-list.ts +22 -6
package/package.json
CHANGED
|
@@ -74,6 +74,8 @@ export class SolidFactList extends OrbitComponent {
|
|
|
74
74
|
return Promise.resolve();
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
assetData: Asset[] = [];
|
|
78
|
+
|
|
77
79
|
_getResource = new Task(this, {
|
|
78
80
|
task: async ([objSrc]) => {
|
|
79
81
|
if (
|
|
@@ -118,16 +120,30 @@ export class SolidFactList extends OrbitComponent {
|
|
|
118
120
|
},
|
|
119
121
|
);
|
|
120
122
|
|
|
121
|
-
|
|
123
|
+
// Let's get dirty, my connector does not know the asset, so I'll call provider directly
|
|
124
|
+
const assets: Promise<Response>[] = [];
|
|
122
125
|
for (const agreement of consumerAgreements) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
if (
|
|
127
|
+
!this.assetData.find(
|
|
128
|
+
(asset) => asset["@id"] === agreement.assetId,
|
|
129
|
+
)
|
|
130
|
+
) {
|
|
131
|
+
assets.push(
|
|
132
|
+
fetch(
|
|
133
|
+
`https://afp.connector-dev.startinblox.com/management/v3/assets/${agreement.assetId}`,
|
|
134
|
+
),
|
|
135
|
+
);
|
|
136
|
+
}
|
|
127
137
|
}
|
|
128
138
|
|
|
139
|
+
const assetResponses = await Promise.all(assets);
|
|
140
|
+
this.assetData = [
|
|
141
|
+
...this.assetData,
|
|
142
|
+
...(await Promise.all(assetResponses.map((r) => r.json()))),
|
|
143
|
+
];
|
|
144
|
+
|
|
129
145
|
const bundles = [];
|
|
130
|
-
for (const asset of
|
|
146
|
+
for (const asset of this.assetData) {
|
|
131
147
|
const bundleUrl = asset?.dataAddress?.baseUrl;
|
|
132
148
|
if (bundleUrl) {
|
|
133
149
|
bundles.push(this._getProxyValue(bundleUrl));
|