@meshmakers/octo-services 3.4.670 → 3.4.730

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.
@@ -4375,6 +4375,25 @@ class AssetRepoService {
4375
4375
  }
4376
4376
  return null;
4377
4377
  }
4378
+ /**
4379
+ * Returns the tenant the caller is currently signed into, including its database name.
4380
+ *
4381
+ * The tenants list only contains child tenants, and a tenant's own registry entry lives in
4382
+ * its parent's database — so the current tenant's database name is not derivable client-side
4383
+ * and comes from this dedicated endpoint (AB#4601). Needed by any operation that has to name
4384
+ * the database of the current tenant, such as restoring it from a backup.
4385
+ */
4386
+ async getOwnTenant() {
4387
+ const baseUrl = await this.getTenantApiBaseUrl();
4388
+ if (baseUrl) {
4389
+ const r = await firstValueFrom(this.httpClient
4390
+ .get(`${baseUrl}/self`, {
4391
+ observe: 'response'
4392
+ }));
4393
+ return r.body;
4394
+ }
4395
+ return null;
4396
+ }
4378
4397
  async createTenant(tenantDto) {
4379
4398
  const params = new HttpParams().set('childTenantId', tenantDto.tenantId).set('databaseName', tenantDto.database);
4380
4399
  const baseUrl = await this.getTenantApiBaseUrl();
@@ -5378,6 +5397,69 @@ class IdentityService {
5378
5397
  }));
5379
5398
  }
5380
5399
  }
5400
+ /**
5401
+ * Searches provisionable users from the target tenant's ancestor (parent) tenants. Powers the
5402
+ * cross-tenant user picker on the Admin Provisioning page. Matches on username or email; an empty
5403
+ * search returns the first users. Cross-tenant shadow users (xt_) are excluded server-side.
5404
+ */
5405
+ async getProvisioningSourceUsers(targetTenantId, search, take = 20) {
5406
+ const baseUrl = this.getSystemTenantBaseUrl();
5407
+ if (baseUrl) {
5408
+ let params = new HttpParams().set('take', take.toString());
5409
+ if (search) {
5410
+ params = params.set('search', search);
5411
+ }
5412
+ const response = await firstValueFrom(this.httpClient.get(baseUrl + `adminProvisioning/${encodeURIComponent(targetTenantId)}/sourceUsers`, {
5413
+ params,
5414
+ observe: 'response'
5415
+ }));
5416
+ return response.body;
5417
+ }
5418
+ return null;
5419
+ }
5420
+ /**
5421
+ * Returns the roles defined in the target tenant, offered as assignable options when creating a
5422
+ * cross-tenant user mapping.
5423
+ */
5424
+ async getProvisioningRoles(targetTenantId) {
5425
+ const baseUrl = this.getSystemTenantBaseUrl();
5426
+ if (baseUrl) {
5427
+ const response = await firstValueFrom(this.httpClient.get(baseUrl + `adminProvisioning/${encodeURIComponent(targetTenantId)}/roles`, {
5428
+ observe: 'response'
5429
+ }));
5430
+ return response.body;
5431
+ }
5432
+ return null;
5433
+ }
5434
+ /**
5435
+ * Returns the groups defined in the target tenant, offered as assignable options when creating a
5436
+ * cross-tenant user mapping. Assigning a group makes the mapping a GroupMember (group-based role
5437
+ * inheritance) — the idiomatic grant, consistent with provisionCurrentUser.
5438
+ */
5439
+ async getProvisioningGroups(targetTenantId) {
5440
+ const baseUrl = this.getSystemTenantBaseUrl();
5441
+ if (baseUrl) {
5442
+ const response = await firstValueFrom(this.httpClient.get(baseUrl + `adminProvisioning/${encodeURIComponent(targetTenantId)}/groups`, {
5443
+ observe: 'response'
5444
+ }));
5445
+ return response.body;
5446
+ }
5447
+ return null;
5448
+ }
5449
+ /**
5450
+ * Creates a cross-tenant user mapping and makes it a member of the given target-tenant groups, so
5451
+ * the user inherits the groups' roles.
5452
+ */
5453
+ async createAdminProvisioningWithGroups(targetTenantId, dto) {
5454
+ const baseUrl = this.getSystemTenantBaseUrl();
5455
+ if (baseUrl) {
5456
+ const response = await firstValueFrom(this.httpClient.post(baseUrl + `adminProvisioning/${encodeURIComponent(targetTenantId)}/withGroups`, dto, {
5457
+ observe: 'response'
5458
+ }));
5459
+ return response.body;
5460
+ }
5461
+ return null;
5462
+ }
5381
5463
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IdentityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5382
5464
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IdentityService, providedIn: 'root' });
5383
5465
  }