-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new schema structure quicktypeUtils update npm scripts update * PR feedback * cleanup * typos * fix type generation folder * Fixed schema structures * copy schemas to website * package json update * removed defunct file * make sources optional * cleanup * Update schemas/bridging/raiseIntentResultResponse.schema.json Co-authored-by: Kris West <kris@cosaic.io> * cleanup * regenerated types * PR feedback * Fixe meta for requests * Apply suggestions from code review * Regenerating bridging typescript * Apply suggestions from code review * adjust OptionalFeatures and IntentResult schemas --------- Co-authored-by: Kris West <kris@cosaic.io>
- Loading branch information
Showing
102 changed files
with
4,230 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,51 @@ | ||
/** Utility for preparing arguments to quicktype, which workaround a specific | ||
* quicktype bug in command line argument handling (where a directory is used | ||
/** Utility for preparing arguments to quicktype, which workaround a specific | ||
* quicktype bug in command line argument handling (where a directory is used | ||
* as input the source language argument is ignored which causes our schemas | ||
* to be interpreted as JSON input, rather than JSONSchema). | ||
* Bug issue: | ||
* Bug issue: | ||
* */ | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
const exec = require('child_process').exec; | ||
|
||
const args = process.argv; | ||
const inputFolder = args[2] | ||
const outputFile = args[3]; | ||
const args = process.argv.slice(2); | ||
const outputFile = args.pop(); | ||
const inputs = args; | ||
|
||
console.log("Input folder argument: " + inputFolder); | ||
console.log("Output file argument: " + outputFile); | ||
console.log('Inputs: ' + inputs.join(' | ')); | ||
console.log('Output file argument: ' + outputFile); | ||
|
||
let srcs = ""; | ||
fs.readdirSync(inputFolder).forEach(file => { | ||
srcs += `--src ${path.join(inputFolder, file)} `; | ||
}); | ||
let sources = ''; | ||
|
||
let dirIndex = 0; | ||
|
||
while (dirIndex < inputs.length) { | ||
if (inputs[dirIndex].endsWith('.schema.json')) { | ||
sources += `--src ${path.join(inputs[dirIndex])} `; | ||
} else { | ||
fs.readdirSync(inputs[dirIndex], { withFileTypes: true }).forEach(file => { | ||
if (file.isDirectory()) { | ||
inputs.push(path.join(inputs[dirIndex], file.name)); | ||
} else { | ||
sources += `--src ${path.join(inputs[dirIndex], file.name)} `; | ||
} | ||
}); | ||
} | ||
dirIndex++; | ||
} | ||
|
||
// Normalise path to local quicktype executable. | ||
const quicktypeExec = ['.', 'node_modules', '.bin', 'quicktype'].join(path.sep); | ||
|
||
const command = `${quicktypeExec} -s schema -o ${outputFile} ${srcs}`; | ||
console.log("command to run: " + command); | ||
const command = `${quicktypeExec} -s schema -o ${outputFile} ${sources}`; | ||
console.log('command to run: ' + command); | ||
|
||
exec(command, function(error, stdout, stderr) { | ||
if (stdout) { | ||
console.log(stdout); | ||
} | ||
if (stderr) { | ||
console.log(stderr); | ||
} | ||
if (stdout) { | ||
console.log(stdout); | ||
} | ||
if (stderr) { | ||
console.log(stderr); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/api/schemas/appIntent.schema.json → schemas/api/appIntent.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/api/schemas/contextMetadata.schema.json → schemas/api/contextMetadata.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://fdc3.finos.org/schemas/next/api/desktopAgentIdentifier.schema.json", | ||
"title": "DesktopAgentIdentifier", | ||
"description": "Identifies a particular Desktop Agent. Used by Desktop Agent Bridging to indicate the source or destination of a message which was produced by or should be processed by the Desktop Agent itself rather than a specific application. Often added to messages by the Desktop Agent Bridge.", | ||
"type": "object", | ||
"properties": { | ||
"desktopAgent": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"desktopAgent" | ||
], | ||
"additionalProperties": false | ||
} |
2 changes: 1 addition & 1 deletion
2
src/api/schemas/displayMetadata.schema.json → schemas/api/displayMetadata.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/api/schemas/icon.schema.json → schemas/api/icon.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/api/schemas/image.schema.json → schemas/api/image.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://fdc3.finos.org/schemas/next/api/implementationMetadata.schema.json", | ||
"title": "ImplementationMetadata", | ||
"description": "Metadata relating to the FDC3 DesktopAgent object and its provider", | ||
"type": "object", | ||
"properties": { | ||
"fdc3Version": { | ||
"type": "string" | ||
}, | ||
"provider": { | ||
"type": "string" | ||
}, | ||
"providerVersion": { | ||
"type": "string" | ||
}, | ||
"optionalFeatures": { | ||
"type": "object", | ||
"properties": { | ||
"OriginatingAppMetadata": { | ||
"type": "boolean" | ||
}, | ||
"UserChannelMembershipAPIs": { | ||
"type": "boolean" | ||
}, | ||
"DesktopAgentBridging": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"required": [ | ||
"OriginatingAppMetadata", | ||
"UserChannelMembershipAPIs" | ||
], | ||
"additionalProperties": false | ||
}, | ||
"appMetadata": { | ||
"$ref": "appMetadata.schema.json" | ||
} | ||
}, | ||
"required": [ | ||
"fdc3Version", | ||
"provider", | ||
"optionalFeatures", | ||
"appMetadata" | ||
], | ||
"additionalProperties": false | ||
} |
Oops, something went wrong.