Skip to content

Commit a114881

Browse files
committed
fix(compare-comply): contract_type corrected to contract_types in model ClassifyReturn
1 parent a1c4f6d commit a114881

File tree

1 file changed

+133
-31
lines changed

1 file changed

+133
-31
lines changed

compare-comply/v1.ts

+133-31
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class CompareComplyV1 extends BaseService {
3535
* @param {Object} options - Options for the service.
3636
* @param {string} options.version - The API version date to use with the service, in "YYYY-MM-DD" format. Whenever the API is changed in a backwards incompatible way, a new minor version of the API is released. The service uses the API version for the date you specify, or the most recent version before that date. Note that you should not programmatically specify the current date at runtime, in case the API has been updated since your application's release. Instead, specify a version date that is compatible with your application, and don't change it until your application is ready for a later version.
3737
* @param {string} [options.url] - The base url to use when contacting the service (e.g. 'https://gateway.watsonplatform.net/compare-comply/api'). The base url may differ between IBM Cloud regions.
38+
* @param {string} [options.username] - The username used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of IBM Cloud. When running on IBM Cloud, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable.
39+
* @param {string} [options.password] - The password used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of IBM Cloud. When running on IBM Cloud, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable.
3840
* @param {string} [options.iam_access_token] - An IAM access token fully managed by the application. Responsibility falls on the application to refresh the token, either before it expires or reactively upon receiving a 401 from the service, as any requests made with an expired token will fail.
3941
* @param {string} [options.iam_apikey] - An API key that can be used to request IAM tokens. If this API key is provided, the SDK will manage the token and handle the refreshing.
4042
* @param {string} [options.iam_url] - An optional URL for the IAM service API. Defaults to 'https://iam.cloud.ibm.com/identity/token'.
@@ -108,7 +110,7 @@ class CompareComplyV1 extends BaseService {
108110
contentType: _params.file_content_type
109111
}
110112
};
111-
113+
112114
const query = {
113115
'model': _params.model
114116
};
@@ -176,7 +178,7 @@ class CompareComplyV1 extends BaseService {
176178
contentType: _params.file_content_type
177179
}
178180
};
179-
181+
180182
const query = {
181183
'model': _params.model
182184
};
@@ -244,7 +246,7 @@ class CompareComplyV1 extends BaseService {
244246
contentType: _params.file_content_type
245247
}
246248
};
247-
249+
248250
const query = {
249251
'model': _params.model
250252
};
@@ -320,7 +322,7 @@ class CompareComplyV1 extends BaseService {
320322
contentType: _params.file_2_content_type
321323
}
322324
};
323-
325+
324326
const query = {
325327
'file_1_label': _params.file_1_label,
326328
'file_2_label': _params.file_2_label,
@@ -441,7 +443,7 @@ class CompareComplyV1 extends BaseService {
441443
if (missingParams) {
442444
return _callback(missingParams);
443445
}
444-
446+
445447
const query = {
446448
'model': _params.model
447449
};
@@ -501,7 +503,7 @@ class CompareComplyV1 extends BaseService {
501503
if (missingParams) {
502504
return _callback(missingParams);
503505
}
504-
506+
505507
const query = {
506508
'model': _params.model
507509
};
@@ -589,7 +591,7 @@ class CompareComplyV1 extends BaseService {
589591
});
590592
});
591593
}
592-
594+
593595
const query = {
594596
'feedback_type': _params.feedback_type,
595597
'before': _params.before,
@@ -696,7 +698,7 @@ class CompareComplyV1 extends BaseService {
696698
'output_bucket_location': _params.output_bucket_location,
697699
'output_bucket_name': _params.output_bucket_name
698700
};
699-
701+
700702
const query = {
701703
'function': _params._function,
702704
'model': _params.model
@@ -846,7 +848,7 @@ class CompareComplyV1 extends BaseService {
846848
if (missingParams) {
847849
return _callback(missingParams);
848850
}
849-
851+
850852
const query = {
851853
'action': _params.action,
852854
'model': _params.model
@@ -1360,20 +1362,24 @@ namespace CompareComplyV1 {
13601362
model_version?: string;
13611363
/** Document elements identified by the service. */
13621364
elements?: Element[];
1363-
/** Definition of tables identified in the input document. */
1364-
tables?: Tables[];
1365-
/** The structure of the input document. */
1366-
document_structure?: DocStructure;
1367-
/** Definitions of the parties identified in the input document. */
1368-
parties?: Parties[];
13691365
/** The date or dates on which the document becomes effective. */
13701366
effective_dates?: EffectiveDates[];
13711367
/** The monetary amounts that identify the total amount of the contract that needs to be paid from one party to another. */
13721368
contract_amounts?: ContractAmts[];
13731369
/** The date or dates on which the document is to be terminated. */
13741370
termination_dates?: TerminationDates[];
13751371
/** The document's contract type or types as declared in the document. */
1376-
contract_type?: ContractType[];
1372+
contract_types?: ContractTypes[];
1373+
/** The duration or durations of the contract. */
1374+
contract_terms?: ContractTerms[];
1375+
/** The document's payment duration or durations. */
1376+
payment_terms?: PaymentTerms[];
1377+
/** Definition of tables identified in the input document. */
1378+
tables?: Tables[];
1379+
/** The structure of the input document. */
1380+
document_structure?: DocStructure;
1381+
/** Definitions of the parties identified in the input document. */
1382+
parties?: Parties[];
13771383
}
13781384

13791385
/** An array of values, each being the `id` value of a column header that is applicable to the current cell. */
@@ -1436,22 +1442,54 @@ namespace CompareComplyV1 {
14361442
role?: string;
14371443
}
14381444

1445+
/** Text that is related to the contents of the table and that precedes or follows the current table. */
1446+
export interface Contexts {
1447+
/** The related text. */
1448+
text?: string;
1449+
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
1450+
location?: Location;
1451+
}
1452+
14391453
/** A monetary amount identified in the input document. */
14401454
export interface ContractAmts {
1455+
/** The confidence level in the identification of the contract amount. */
1456+
confidence_level?: string;
14411457
/** The monetary amount. */
14421458
text?: string;
1443-
/** The confidence level in the identification of the contract amount. */
1459+
/** The normalized form of the amount, which is listed as a string. This element is optional; that is, the service output lists it only if normalized text exists. */
1460+
text_normalized?: string;
1461+
/** The details of the normalized text, if applicable. This element is optional; that is, the service output lists it only if normalized text exists. */
1462+
interpretation?: Interpretation;
1463+
/** One or more hash values that you can send to IBM to provide feedback or receive support. */
1464+
provenance_ids?: string[];
1465+
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
1466+
location?: Location;
1467+
}
1468+
1469+
/** The duration or durations of the contract. */
1470+
export interface ContractTerms {
1471+
/** The confidence level in the identification of the contract term. */
14441472
confidence_level?: string;
1473+
/** The contract term (duration). */
1474+
text?: string;
1475+
/** The normalized form of the contract term, which is listed as a string. This element is optional; that is, the service output lists it only if normalized text exists. */
1476+
text_normalized?: string;
1477+
/** The details of the normalized text, if applicable. This element is optional; that is, the service output lists it only if normalized text exists. */
1478+
interpretation?: Interpretation;
1479+
/** One or more hash values that you can send to IBM to provide feedback or receive support. */
1480+
provenance_ids?: string[];
14451481
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
14461482
location?: Location;
14471483
}
14481484

14491485
/** The contract type identified in the input document. */
1450-
export interface ContractType {
1486+
export interface ContractTypes {
1487+
/** The confidence level in the identification of the contract type. */
1488+
confidence_level?: string;
14511489
/** The contract type. */
14521490
text?: string;
1453-
/** The confidence level in the identification of the termination date. */
1454-
confidence_level?: string;
1491+
/** One or more hash values that you can send to IBM to provide feedback or receive support. */
1492+
provenance_ids?: string[];
14551493
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
14561494
location?: Location;
14571495
}
@@ -1484,6 +1522,8 @@ namespace CompareComplyV1 {
14841522
section_titles?: SectionTitles[];
14851523
/** An array containing one object per section or subsection, in parallel with the `section_titles` array, that details the leading sentences in the corresponding section or subsection. */
14861524
leading_sentences?: LeadingSentence[];
1525+
/** An array containing one object per paragraph, in parallel with the `section_titles` and `leading_sentences` arrays. */
1526+
paragraphs?: Paragraphs[];
14871527
}
14881528

14891529
/** Basic information about the input document. */
@@ -1500,10 +1540,14 @@ namespace CompareComplyV1 {
15001540

15011541
/** An effective date. */
15021542
export interface EffectiveDates {
1503-
/** The effective date, listed as a string. */
1504-
text?: string;
15051543
/** The confidence level in the identification of the effective date. */
15061544
confidence_level?: string;
1545+
/** The effective date, listed as a string. */
1546+
text?: string;
1547+
/** The normalized form of the effective date, which is listed as a string. This element is optional; that is, the service output lists it only if normalized text exists. */
1548+
text_normalized?: string;
1549+
/** One or more hash values that you can send to IBM to provide feedback or receive support. */
1550+
provenance_ids?: string[];
15071551
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
15081552
location?: Location;
15091553
}
@@ -1642,6 +1686,16 @@ namespace CompareComplyV1 {
16421686
html?: string;
16431687
}
16441688

1689+
/** The details of the normalized text, if applicable. This element is optional; that is, the service output lists it only if normalized text exists. */
1690+
export interface Interpretation {
1691+
/** The value that was located in the normalized text. */
1692+
value?: string;
1693+
/** An integer or float expressing the numeric value of the `value` key. */
1694+
numeric_value?: number;
1695+
/** A string listing the unit of the value that was found in the normalized text. **Note:** The value of `unit` is the [ISO-4217 currency code](https://www.iso.org/iso-4217-currency-codes.html) identified for the currency amount (for example, `USD` or `EUR`). If the service cannot disambiguate a currency symbol (for example, `$` or `£`), the value of `unit` contains the ambiguous symbol as-is. */
1696+
unit?: string;
1697+
}
1698+
16451699
/** A key in a key-value pair. */
16461700
export interface Key {
16471701
/** The unique ID of the key in the table. */
@@ -1686,6 +1740,14 @@ namespace CompareComplyV1 {
16861740
end: number;
16871741
}
16881742

1743+
/** A mention of a party. */
1744+
export interface Mention {
1745+
/** The name of the party. */
1746+
text?: string;
1747+
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
1748+
location?: Location;
1749+
}
1750+
16891751
/** The original labeling from the input document, without the submitted feedback. */
16901752
export interface OriginalLabelsIn {
16911753
/** Description of the action specified by the element and whom it affects. */
@@ -1718,18 +1780,42 @@ namespace CompareComplyV1 {
17181780
total?: number;
17191781
}
17201782

1783+
/** The locations of each paragraph in the input document. */
1784+
export interface Paragraphs {
1785+
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
1786+
location?: Location;
1787+
}
1788+
17211789
/** A party and its corresponding role, including address and contact information if identified. */
17221790
export interface Parties {
1723-
/** A string identifying the party. */
1791+
/** The normalized form of the party's name. */
17241792
party?: string;
1725-
/** A string that identifies the importance of the party. */
1726-
importance?: string;
17271793
/** A string identifying the party's role. */
17281794
role?: string;
1729-
/** List of the party's address or addresses. */
1795+
/** A string that identifies the importance of the party. */
1796+
importance?: string;
1797+
/** A list of the party's address or addresses. */
17301798
addresses?: Address[];
1731-
/** List of the names and roles of contacts identified in the input document. */
1799+
/** A list of the names and roles of contacts identified in the input document. */
17321800
contacts?: Contact[];
1801+
/** A list of the party's mentions in the input document. */
1802+
mentions?: Mention[];
1803+
}
1804+
1805+
/** The document's payment duration or durations. */
1806+
export interface PaymentTerms {
1807+
/** The confidence level in the identification of the payment term. */
1808+
confidence_level?: string;
1809+
/** The payment term (duration). */
1810+
text?: string;
1811+
/** The normalized form of the payment term, which is listed as a string. This element is optional; that is, the service output lists it only if normalized text exists. */
1812+
text_normalized?: string;
1813+
/** The details of the normalized text, if applicable. This element is optional; that is, the service output lists it only if normalized text exists. */
1814+
interpretation?: Interpretation;
1815+
/** One or more hash values that you can send to IBM to provide feedback or receive support. */
1816+
provenance_ids?: string[];
1817+
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
1818+
location?: Location;
17331819
}
17341820

17351821
/** An array of values, each being the `id` value of a row header that is applicable to this body cell. */
@@ -1828,6 +1914,14 @@ namespace CompareComplyV1 {
18281914
tables?: Tables[];
18291915
}
18301916

1917+
/** If identified, the title or caption of the current table of the form `Table x.: ...`. Empty when no title is identified. When exposed, the `title` is also excluded from the `contexts` array of the same table. */
1918+
export interface TableTitle {
1919+
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
1920+
location?: Location;
1921+
/** The text of the identified table title or caption. */
1922+
text?: string;
1923+
}
1924+
18311925
/** The contents of the tables extracted from a document. */
18321926
export interface Tables {
18331927
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
@@ -1836,24 +1930,32 @@ namespace CompareComplyV1 {
18361930
text?: string;
18371931
/** The table's section title, if identified. */
18381932
section_title?: SectionTitle;
1933+
/** If identified, the title or caption of the current table of the form `Table x.: ...`. Empty when no title is identified. When exposed, the `title` is also excluded from the `contexts` array of the same table. */
1934+
title?: TableTitle;
18391935
/** An array of table-level cells that apply as headers to all the other cells in the current table. */
18401936
table_headers?: TableHeaders[];
18411937
/** An array of row-level cells, each applicable as a header to other cells in the same row as itself, of the current table. */
18421938
row_headers?: RowHeaders[];
18431939
/** An array of column-level cells, each applicable as a header to other cells in the same column as itself, of the current table. */
18441940
column_headers?: ColumnHeaders[];
1845-
/** An array of key-value pairs identified in the current table. */
1846-
key_value_pairs?: KeyValuePair[];
18471941
/** An array of cells that are neither table header nor column header nor row header cells, of the current table with corresponding row and column header associations. */
18481942
body_cells?: BodyCells[];
1943+
/** An array of objects that list text that is related to the table contents and that precedes or follows the current table. */
1944+
contexts?: Contexts[];
1945+
/** An array of key-value pairs identified in the current table. */
1946+
key_value_pairs?: KeyValuePair[];
18491947
}
18501948

18511949
/** Termination dates identified in the input document. */
18521950
export interface TerminationDates {
1853-
/** The termination date. */
1854-
text?: string;
18551951
/** The confidence level in the identification of the termination date. */
18561952
confidence_level?: string;
1953+
/** The termination date. */
1954+
text?: string;
1955+
/** The normalized form of the termination date, which is listed as a string. This element is optional; that is, the service output lists it only if normalized text exists. */
1956+
text_normalized?: string;
1957+
/** One or more hash values that you can send to IBM to provide feedback or receive support. */
1958+
provenance_ids?: string[];
18571959
/** The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`. */
18581960
location?: Location;
18591961
}

0 commit comments

Comments
 (0)