Skip to content

Commit

Permalink
fix: fix 0.7.0 schema
Browse files Browse the repository at this point in the history
  • Loading branch information
shoom3301 committed Jul 5, 2023
1 parent ae9a778 commit f09cd02
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/app-data",
"version": "0.2.6",
"version": "0.2.7",
"description": "CowProtocol AppData schema definitions",
"type": "module",
"source": "src/index.ts",
Expand Down
104 changes: 104 additions & 0 deletions src/generatedTypes/v0.7.0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/

/**
* Semantic versioning of document.
*/
export type Version = string;
/**
* The code identifying the CLI, UI, service generating the order.
*/
export type AppCode = string;
/**
* Environment from which the order came from.
*/
export type Environment = string;
/**
* Semantic versioning of document.
*/
export type Version1 = string;
export type ReferrerAddress = string;
/**
* Tracks in which medium the traffic originated from (twitter, facebook, etc.)
*/
export type UTMSource = string;
/**
* Tracks in which medium the traffic originated from (mail, CPC, social, etc.)
*/
export type UTMMedium = string;
/**
* Track the performance of a specific campaign
*/
export type UTMCampaign = string;
/**
* Track which link was clicked
*/
export type UTMContent = string;
/**
* Track which keyword term a website visitor came from
*/
export type UTMKeywordTerm = string;
/**
* Semantic versioning of document.
*/
export type Version2 = string;
/**
* Slippage tolerance that was applied to the order to get the limit price. Expressed in Basis Points (BIPS)
*/
export type SlippageBips = string;
/**
* Semantic versioning of document.
*/
export type Version3 = string;
/**
* Indicator of the order class.
*/
export type OrderClass1 = "market" | "limit" | "liquidity" | "twap";

/**
* Metadata JSON document for adding information to orders.
*/
export interface AppDataRootSchema {
version: Version;
appCode?: AppCode;
environment?: Environment;
metadata: Metadata;
[k: string]: unknown;
}
/**
* Each metadata will specify one aspect of the order.
*/
export interface Metadata {
referrer?: Referrer;
utm?: UTMCodes;
quote?: Quote;
orderClass?: OrderClass;
[k: string]: unknown;
}
export interface Referrer {
version: Version1;
address: ReferrerAddress;
[k: string]: unknown;
}
export interface UTMCodes {
utmSource?: UTMSource;
utmMedium?: UTMMedium;
utmCampaign?: UTMCampaign;
utmContent?: UTMContent;
utmTerm?: UTMKeywordTerm;
[k: string]: unknown;
}
export interface Quote {
version: Version2;
slippageBips: SlippageBips;
[k: string]: unknown;
}
export interface OrderClass {
version: Version3;
orderClass: OrderClass1;
[k: string]: unknown;
}
4 changes: 2 additions & 2 deletions src/schemas/v0.7.0.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://cowswap.exchange/schemas/app-data/v0.6.0.json",
"$id": "https://cowswap.exchange/schemas/app-data/v0.7.0.json",
"$schema": "http://json-schema.org/draft-07/schema",
"description": "Metadata JSON document for adding information to orders.",
"required": ["version", "metadata"],
Expand All @@ -9,7 +9,7 @@
"version": {
"$ref": "definitions.json#/definitions/version",
"readOnly": true,
"default": "0.6.0"
"default": "0.7.0"
},
"appCode": {
"$id": "#/properties/appCode",
Expand Down

0 comments on commit f09cd02

Please sign in to comment.