Skip to content

Commit

Permalink
Add query selector config
Browse files Browse the repository at this point in the history
  • Loading branch information
thenamankumar committed Jul 26, 2024
1 parent f588cc3 commit 6b967c9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/protocol/src/openctx-protocol.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@
}
}
},
"QuerySelector": {
"description": "List of regex patterns matching the query for which the provider can return context items.",
"type": "object",
"additionalProperties": false,
"required": ["pattern"],
"properties": {
"pattern": {
"description": "The regex pattern matching the query for which the provider can return context items",
"type": "string"
}
}
},
"MetaParams": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -147,6 +159,21 @@
"description": "The name of the provider.",
"type": "string"
},
"items": {
"description": "Configuration for providing context items.",
"type": "object",
"additionalProperties": false,
"properties": {
"querySelectors": {
"description": "The list of regex patterns for matching with a query for which the provider can return context items",
"type": "array",
"items": {
"$ref": "#/definitions/QuerySelector"
},
"tsType": "QuerySelector[]"
}
}
},
"mentions": {
"description": "Configuration for the mentions feature.",
"type": "object",
Expand Down
9 changes: 9 additions & 0 deletions lib/protocol/src/openctx-protocol.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ export interface MetaResult {
* The name of the provider.
*/
name: string
/**
* Configuration for providing context items.
*/
items?: {
/**
* The list of regex patterns for matching with a query for which the provider can return context items
*/
querySelectors?: QuerySelector[]

Check failure on line 58 in lib/protocol/src/openctx-protocol.schema.ts

View workflow job for this annotation

GitHub Actions / test-integration (ubuntu)

Cannot find name 'QuerySelector'.

Check failure on line 58 in lib/protocol/src/openctx-protocol.schema.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'QuerySelector'.

Check failure on line 58 in lib/protocol/src/openctx-protocol.schema.ts

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 20)

Cannot find name 'QuerySelector'.

Check failure on line 58 in lib/protocol/src/openctx-protocol.schema.ts

View workflow job for this annotation

GitHub Actions / test-integration (macos)

Cannot find name 'QuerySelector'.

Check failure on line 58 in lib/protocol/src/openctx-protocol.schema.ts

View workflow job for this annotation

GitHub Actions / test-unit (macos, 20)

Cannot find name 'QuerySelector'.

Check failure on line 58 in lib/protocol/src/openctx-protocol.schema.ts

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 18.15.0)

Cannot find name 'QuerySelector'.
}
/**
* Configuration for the mentions feature.
*/
Expand Down

0 comments on commit 6b967c9

Please sign in to comment.