Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mergeKey to IdentityDefinition #3037

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified dist/cli/coda.js
100644 → 100755
Empty file.
29 changes: 19 additions & 10 deletions schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,14 @@ export interface IdentityDefinition {
dynamicUrl?: string;
/** The ID of another pack, if you are trying to reference a value from different pack. */
packId?: number;
/**
* By default, result sets returned by dynamic sync tables will not be merged together for the purposes of presenting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps "merged together across different dynamicUrl values"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, will update before merging. (Since I released already though won't cut another release for the correction.).

* information. This value, if set, will allow results for identities for the same Pack and name to be merged together
* if they share the same `mergeKey`.
*
* @hidden In development.
*/
mergeKey?: string;
/** @deprecated See {@link ObjectSchemaDefinition.attribution} */
attribution?: AttributionNode[];
}
Expand Down Expand Up @@ -1100,16 +1108,16 @@ export interface DetailedIndexedProperty {
export type IndexedProperty = BasicIndexedProperty | DetailedIndexedProperty;

/**
* Defines how to index objects for use with full-text indexing.
* TODO(alexd): Unhide this
* @hidden
*/
* Defines how to index objects for use with full-text indexing.
* TODO(alexd): Unhide this
* @hidden
*/
export interface IndexDefinition {
/**
* A list of properties from within {@link ObjectSchemaDefinition.properties} that should be indexed.
*/
properties: IndexedProperty[];

/*
* The context properties to be used for indexing.
* If unspecified, intelligent defaults may be used..
Expand Down Expand Up @@ -1930,17 +1938,18 @@ function normalizeIndexProperty(value: IndexedProperty, normalizedProperties: Ob
}

function normalizeIndexDefinition(
index: IndexDefinition,
normalizedProperties: ObjectSchemaProperties): IndexDefinition {
index: IndexDefinition,
normalizedProperties: ObjectSchemaProperties,
): IndexDefinition {
const {properties, contextProperties, popularityRankProperty, ...rest} = index;
ensureNever<keyof typeof rest>();
return {
properties: properties.map(prop => normalizeIndexProperty(prop, normalizedProperties)),
contextProperties: contextProperties
? contextProperties.map(prop => normalizeSchemaPropertyIdentifier(prop, normalizedProperties))
: undefined,
popularityRankProperty: popularityRankProperty
? normalizeSchemaPropertyIdentifier(popularityRankProperty, normalizedProperties)
popularityRankProperty: popularityRankProperty
? normalizeSchemaPropertyIdentifier(popularityRankProperty, normalizedProperties)
: undefined,
};
}
Expand Down Expand Up @@ -2055,7 +2064,7 @@ export function normalizeObjectSchema(schema: GenericObjectSchema): GenericObjec
properties: normalizedProperties,
snippetProperty: snippetProperty
? normalizeSchemaPropertyIdentifier(snippetProperty, normalizedProperties)
: undefined,
: undefined,
subtitleProperties: subtitleProperties
? subtitleProperties.map(subProp => normalizeSchemaPropertyIdentifier(subProp, normalizedProperties))
: undefined,
Expand Down