Skip to content

Commit

Permalink
feat: include contact fields on the api
Browse files Browse the repository at this point in the history
  • Loading branch information
marian2js committed Aug 29, 2023
1 parent 265a25a commit 848a25d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/api/src/chat/entities/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class Contact extends BaseEntity {
@prop({ default: [], index: true })
tags: string[]

@Field(() => GraphQLJSONObject, { nullable: true })
@jsonProp()
fields?: Record<string, any>
}
Expand Down
2 changes: 1 addition & 1 deletion apps/runner/src/utils/input.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function parseInput(input: unknown, outputs: Record<string, Record<string
*/
export function calculateExpression(input: string, references: Record<string, Record<string, unknown>>): unknown {
// each "[\w[\]]" group matches the allowed characters for variables, including array access (e.g. a.b[0].c)
const operatorsRegex = /[\w\s[\]]+(\.[\w\s[\]]+|\[\d+\])*/g
const operatorsRegex = /[\w[\]]+\.[\w[\]]+(\.[\w[\]]+)*/g

const operators = [...input.matchAll(operatorsRegex)]

Expand Down
2 changes: 2 additions & 0 deletions generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,7 @@ export interface Contact {
createdAt: DateTime;
address: string;
tags?: Nullable<string[]>;
fields?: Nullable<JSONObject>;
}

export interface AccountCredential {
Expand Down Expand Up @@ -1372,6 +1373,7 @@ export interface ContactDeleteResponse {
createdAt?: Nullable<DateTime>;
address?: Nullable<string>;
tags?: Nullable<string[]>;
fields?: Nullable<JSONObject>;
}

export interface ContactEdge {
Expand Down
2 changes: 2 additions & 0 deletions generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ type Contact {
createdAt: DateTime!
address: String!
tags: [String!]
fields: JSONObject
}

type AccountCredential {
Expand Down Expand Up @@ -826,6 +827,7 @@ type ContactDeleteResponse {
createdAt: DateTime
address: String
tags: [String!]
fields: JSONObject
}

type ContactEdge {
Expand Down

0 comments on commit 848a25d

Please sign in to comment.