@eluvio/elv-client-js 4.0.68 → 4.0.69
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/package.json +1 -1
- package/src/FrameClient.js +1 -0
- package/src/walletClient/index.js +36 -0
package/package.json
CHANGED
package/src/FrameClient.js
CHANGED
|
@@ -1332,6 +1332,42 @@ class ElvWalletClient {
|
|
|
1332
1332
|
return [];
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
|
+
|
|
1336
|
+
async DeployTenant({tenantId, tenantSlug="", tenantHash}) {
|
|
1337
|
+
if(!tenantHash) {
|
|
1338
|
+
const tenantLink = await this.client.ContentObjectMetadata({
|
|
1339
|
+
libraryId: this.mainSiteLibraryId,
|
|
1340
|
+
objectId: this.mainSiteId,
|
|
1341
|
+
metadataSubtree: UrlJoin("public/asset_metadata/tenants", tenantSlug),
|
|
1342
|
+
resolveLinks: true,
|
|
1343
|
+
linkDepthLimit: 1,
|
|
1344
|
+
resolveIncludeSource: true,
|
|
1345
|
+
resolveIgnoreErrors: true,
|
|
1346
|
+
select: [
|
|
1347
|
+
"."
|
|
1348
|
+
]
|
|
1349
|
+
});
|
|
1350
|
+
|
|
1351
|
+
if(!tenantLink) {
|
|
1352
|
+
throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${tenantSlug}`);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
const deployedTenantHash = tenantLink["."].source;
|
|
1356
|
+
|
|
1357
|
+
tenantHash = await this.client.LatestVersionHash({versionHash: deployedTenantHash});
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
const body = { content_hash: tenantHash, ts: Date.now() };
|
|
1361
|
+
const token = await this.client.Sign(JSON.stringify(body));
|
|
1362
|
+
await this.client.authClient.MakeAuthServiceRequest({
|
|
1363
|
+
path: UrlJoin("as", "tnt", "config", tenantId, "metadata"),
|
|
1364
|
+
method: "POST",
|
|
1365
|
+
body,
|
|
1366
|
+
headers: {
|
|
1367
|
+
Authorization: `Bearer ${token}`
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1335
1371
|
}
|
|
1336
1372
|
|
|
1337
1373
|
Object.assign(ElvWalletClient.prototype, require("./ClientMethods"));
|