Skip to content

Commit

Permalink
Merge branch 'release/v7' into restrict-character-sets
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Mar 6, 2025
2 parents 049490c + d983145 commit 78298fe
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ export class AttributesController extends ConsumptionBaseController {
return LocalAttribute.from(result);
}

public async getLocalAttributes(query?: any, hideTechnical = false, onlyValid = false): Promise<LocalAttribute[]> {
public async getLocalAttributes(query?: any, hideTechnical = false): Promise<LocalAttribute[]> {
const enrichedQuery = this.enrichQuery(query, hideTechnical);
const attributes = await this.attributes.find(enrichedQuery);
const parsed = this.parseArray(attributes, LocalAttribute);
if (!onlyValid) return parsed;

const sorted = parsed.sort((a, b) => {
return a.createdAt.compare(b.createdAt);
Expand Down Expand Up @@ -118,10 +117,6 @@ export class AttributesController extends ConsumptionBaseController {
return { $and: [query, hideTechnicalQuery] };
}

public async getValidLocalAttributes(query?: any, hideTechnical = false): Promise<LocalAttribute[]> {
return await this.getLocalAttributes(query, hideTechnical, true);
}

public async executeIQLQuery(query: IIQLQuery): Promise<LocalAttribute[]> {
/* Fetch subset of attributes relevant for IQL queries. We filter for
* identity attributes which are not shared. */
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/dataViews/DataViewExpander.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ export class DataViewExpander {
const relationshipSetting = await this.getRelationshipSettingDVO(relationship);

const stringByType: Record<string, undefined | string> = {};
const relationshipAttributesResult = await this.consumption.attributes.getPeerSharedAttributes({ onlyValid: true, peer: relationship.peer });
const relationshipAttributesResult = await this.consumption.attributes.getPeerSharedAttributes({ peer: relationship.peer });
const expandedAttributes = await this.expandLocalAttributeDTOs(relationshipAttributesResult.value);
const attributesByType: Record<string, undefined | LocalAttributeDVO[]> = {};
for (const attribute of expandedAttributes) {
Expand Down
9 changes: 0 additions & 9 deletions packages/runtime/src/useCases/common/Schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15522,9 +15522,6 @@ export const GetAttributesRequest: any = {
"query": {
"$ref": "#/definitions/GetAttributesRequestQuery"
},
"onlyValid": {
"type": "boolean"
},
"hideTechnical": {
"type": "boolean"
}
Expand Down Expand Up @@ -15793,9 +15790,6 @@ export const GetOwnSharedAttributesRequest: any = {
"peer": {
"$ref": "#/definitions/AddressString"
},
"onlyValid": {
"type": "boolean"
},
"query": {
"$ref": "#/definitions/GetOwnSharedAttributeRequestQuery"
},
Expand Down Expand Up @@ -16010,9 +16004,6 @@ export const GetPeerSharedAttributesRequest: any = {
"peer": {
"$ref": "#/definitions/AddressString"
},
"onlyValid": {
"type": "boolean"
},
"query": {
"$ref": "#/definitions/GetPeerSharedAttributesRequestQuery"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { AttributeMapper } from "./AttributeMapper";

export interface GetAttributesRequest {
query?: GetAttributesRequestQuery;
onlyValid?: boolean;
hideTechnical?: boolean;
}

Expand Down Expand Up @@ -131,7 +130,7 @@ export class GetAttributesUseCase extends UseCase<GetAttributesRequest, LocalAtt
const flattenedQuery = flattenObject(query);
const dbQuery = GetAttributesUseCase.queryTranslator.parse(flattenedQuery);

const attributes = await this.attributeController.getLocalAttributes(dbQuery, request.hideTechnical, request.onlyValid);
const attributes = await this.attributeController.getLocalAttributes(dbQuery, request.hideTechnical);

return Result.ok(AttributeMapper.toAttributeDTOList(attributes));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { GetAttributesRequestQuery, GetAttributesUseCase } from "./GetAttributes

export interface GetOwnSharedAttributesRequest {
peer: AddressString;
onlyValid?: boolean;
query?: GetOwnSharedAttributeRequestQuery;
hideTechnical?: boolean;
/**
Expand Down Expand Up @@ -65,7 +64,7 @@ export class GetOwnSharedAttributesUseCase extends UseCase<GetOwnSharedAttribute
dbQuery["succeededBy"] = { $exists: false };
}

const attributes = await this.attributeController.getLocalAttributes(dbQuery, request.hideTechnical, request.onlyValid);
const attributes = await this.attributeController.getLocalAttributes(dbQuery, request.hideTechnical);

return Result.ok(AttributeMapper.toAttributeDTOList(attributes));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { GetAttributesRequestQuery, GetAttributesUseCase } from "./GetAttributes

export interface GetPeerSharedAttributesRequest {
peer: AddressString;
onlyValid?: boolean;
query?: GetPeerSharedAttributesRequestQuery;
hideTechnical?: boolean;
/**
Expand Down Expand Up @@ -60,7 +59,7 @@ export class GetPeerSharedAttributesUseCase extends UseCase<GetPeerSharedAttribu
dbQuery["succeededBy"] = { $exists: false };
}

const attributes = await this.attributeController.getLocalAttributes(dbQuery, request.hideTechnical, request.onlyValid);
const attributes = await this.attributeController.getLocalAttributes(dbQuery, request.hideTechnical);

return Result.ok(AttributeMapper.toAttributeDTOList(attributes));
}
Expand Down

0 comments on commit 78298fe

Please sign in to comment.