tako-sdk 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -25,6 +25,26 @@ __export(index_exports, {
25
25
  APIErrorTypeFromJSONTyped: () => APIErrorTypeFromJSONTyped,
26
26
  APIErrorTypeToJSON: () => APIErrorTypeToJSON,
27
27
  APIErrorTypeToJSONTyped: () => APIErrorTypeToJSONTyped,
28
+ AgentAnswerAssumptionFromJSON: () => AgentAnswerAssumptionFromJSON,
29
+ AgentAnswerAssumptionFromJSONTyped: () => AgentAnswerAssumptionFromJSONTyped,
30
+ AgentAnswerAssumptionToJSON: () => AgentAnswerAssumptionToJSON,
31
+ AgentAnswerAssumptionToJSONTyped: () => AgentAnswerAssumptionToJSONTyped,
32
+ AgentAnswerCitationFromJSON: () => AgentAnswerCitationFromJSON,
33
+ AgentAnswerCitationFromJSONTyped: () => AgentAnswerCitationFromJSONTyped,
34
+ AgentAnswerCitationToJSON: () => AgentAnswerCitationToJSON,
35
+ AgentAnswerCitationToJSONTyped: () => AgentAnswerCitationToJSONTyped,
36
+ AgentAnswerDefinitionFromJSON: () => AgentAnswerDefinitionFromJSON,
37
+ AgentAnswerDefinitionFromJSONTyped: () => AgentAnswerDefinitionFromJSONTyped,
38
+ AgentAnswerDefinitionToJSON: () => AgentAnswerDefinitionToJSON,
39
+ AgentAnswerDefinitionToJSONTyped: () => AgentAnswerDefinitionToJSONTyped,
40
+ AgentAnswerMetadataFromJSON: () => AgentAnswerMetadataFromJSON,
41
+ AgentAnswerMetadataFromJSONTyped: () => AgentAnswerMetadataFromJSONTyped,
42
+ AgentAnswerMetadataToJSON: () => AgentAnswerMetadataToJSON,
43
+ AgentAnswerMetadataToJSONTyped: () => AgentAnswerMetadataToJSONTyped,
44
+ AgentAnswerMethodologyNoteFromJSON: () => AgentAnswerMethodologyNoteFromJSON,
45
+ AgentAnswerMethodologyNoteFromJSONTyped: () => AgentAnswerMethodologyNoteFromJSONTyped,
46
+ AgentAnswerMethodologyNoteToJSON: () => AgentAnswerMethodologyNoteToJSON,
47
+ AgentAnswerMethodologyNoteToJSONTyped: () => AgentAnswerMethodologyNoteToJSONTyped,
28
48
  AgentApi: () => AgentApi,
29
49
  AgentEffortLevel: () => AgentEffortLevel,
30
50
  AgentEffortLevelFromJSON: () => AgentEffortLevelFromJSON,
@@ -302,6 +322,11 @@ __export(index_exports, {
302
322
  canConsumeForm: () => canConsumeForm,
303
323
  exists: () => exists,
304
324
  instanceOfAPIErrorType: () => instanceOfAPIErrorType,
325
+ instanceOfAgentAnswerAssumption: () => instanceOfAgentAnswerAssumption,
326
+ instanceOfAgentAnswerCitation: () => instanceOfAgentAnswerCitation,
327
+ instanceOfAgentAnswerDefinition: () => instanceOfAgentAnswerDefinition,
328
+ instanceOfAgentAnswerMetadata: () => instanceOfAgentAnswerMetadata,
329
+ instanceOfAgentAnswerMethodologyNote: () => instanceOfAgentAnswerMethodologyNote,
305
330
  instanceOfAgentEffortLevel: () => instanceOfAgentEffortLevel,
306
331
  instanceOfAgentOutputSettings: () => instanceOfAgentOutputSettings,
307
332
  instanceOfAgentResult: () => instanceOfAgentResult,
@@ -934,6 +959,173 @@ function TakoCardToJSONTyped(value, ignoreDiscriminator = false) {
934
959
  };
935
960
  }
936
961
 
962
+ // src/generated/models/AgentAnswerCitation.ts
963
+ function instanceOfAgentAnswerCitation(value) {
964
+ if (!("index" in value) || value["index"] === void 0) return false;
965
+ if (!("title" in value) || value["title"] === void 0) return false;
966
+ return true;
967
+ }
968
+ function AgentAnswerCitationFromJSON(json) {
969
+ return AgentAnswerCitationFromJSONTyped(json, false);
970
+ }
971
+ function AgentAnswerCitationFromJSONTyped(json, ignoreDiscriminator) {
972
+ if (json == null) {
973
+ return json;
974
+ }
975
+ return {
976
+ "index": json["index"],
977
+ "title": json["title"],
978
+ "url": json["url"] == null ? void 0 : json["url"],
979
+ "source_name": json["source_name"] == null ? void 0 : json["source_name"]
980
+ };
981
+ }
982
+ function AgentAnswerCitationToJSON(json) {
983
+ return AgentAnswerCitationToJSONTyped(json, false);
984
+ }
985
+ function AgentAnswerCitationToJSONTyped(value, ignoreDiscriminator = false) {
986
+ if (value == null) {
987
+ return value;
988
+ }
989
+ return {
990
+ "index": value["index"],
991
+ "title": value["title"],
992
+ "url": value["url"],
993
+ "source_name": value["source_name"]
994
+ };
995
+ }
996
+
997
+ // src/generated/models/AgentAnswerDefinition.ts
998
+ function instanceOfAgentAnswerDefinition(value) {
999
+ if (!("term" in value) || value["term"] === void 0) return false;
1000
+ if (!("definition" in value) || value["definition"] === void 0) return false;
1001
+ return true;
1002
+ }
1003
+ function AgentAnswerDefinitionFromJSON(json) {
1004
+ return AgentAnswerDefinitionFromJSONTyped(json, false);
1005
+ }
1006
+ function AgentAnswerDefinitionFromJSONTyped(json, ignoreDiscriminator) {
1007
+ if (json == null) {
1008
+ return json;
1009
+ }
1010
+ return {
1011
+ "term": json["term"],
1012
+ "definition": json["definition"],
1013
+ "source_ref": json["source_ref"] == null ? void 0 : json["source_ref"]
1014
+ };
1015
+ }
1016
+ function AgentAnswerDefinitionToJSON(json) {
1017
+ return AgentAnswerDefinitionToJSONTyped(json, false);
1018
+ }
1019
+ function AgentAnswerDefinitionToJSONTyped(value, ignoreDiscriminator = false) {
1020
+ if (value == null) {
1021
+ return value;
1022
+ }
1023
+ return {
1024
+ "term": value["term"],
1025
+ "definition": value["definition"],
1026
+ "source_ref": value["source_ref"]
1027
+ };
1028
+ }
1029
+
1030
+ // src/generated/models/AgentAnswerMethodologyNote.ts
1031
+ function instanceOfAgentAnswerMethodologyNote(value) {
1032
+ if (!("title" in value) || value["title"] === void 0) return false;
1033
+ if (!("description" in value) || value["description"] === void 0) return false;
1034
+ return true;
1035
+ }
1036
+ function AgentAnswerMethodologyNoteFromJSON(json) {
1037
+ return AgentAnswerMethodologyNoteFromJSONTyped(json, false);
1038
+ }
1039
+ function AgentAnswerMethodologyNoteFromJSONTyped(json, ignoreDiscriminator) {
1040
+ if (json == null) {
1041
+ return json;
1042
+ }
1043
+ return {
1044
+ "title": json["title"],
1045
+ "description": json["description"]
1046
+ };
1047
+ }
1048
+ function AgentAnswerMethodologyNoteToJSON(json) {
1049
+ return AgentAnswerMethodologyNoteToJSONTyped(json, false);
1050
+ }
1051
+ function AgentAnswerMethodologyNoteToJSONTyped(value, ignoreDiscriminator = false) {
1052
+ if (value == null) {
1053
+ return value;
1054
+ }
1055
+ return {
1056
+ "title": value["title"],
1057
+ "description": value["description"]
1058
+ };
1059
+ }
1060
+
1061
+ // src/generated/models/AgentAnswerAssumption.ts
1062
+ function instanceOfAgentAnswerAssumption(value) {
1063
+ if (!("title" in value) || value["title"] === void 0) return false;
1064
+ if (!("description" in value) || value["description"] === void 0) return false;
1065
+ return true;
1066
+ }
1067
+ function AgentAnswerAssumptionFromJSON(json) {
1068
+ return AgentAnswerAssumptionFromJSONTyped(json, false);
1069
+ }
1070
+ function AgentAnswerAssumptionFromJSONTyped(json, ignoreDiscriminator) {
1071
+ if (json == null) {
1072
+ return json;
1073
+ }
1074
+ return {
1075
+ "title": json["title"],
1076
+ "description": json["description"],
1077
+ "category": json["category"] == null ? void 0 : json["category"],
1078
+ "source_ref": json["source_ref"] == null ? void 0 : json["source_ref"]
1079
+ };
1080
+ }
1081
+ function AgentAnswerAssumptionToJSON(json) {
1082
+ return AgentAnswerAssumptionToJSONTyped(json, false);
1083
+ }
1084
+ function AgentAnswerAssumptionToJSONTyped(value, ignoreDiscriminator = false) {
1085
+ if (value == null) {
1086
+ return value;
1087
+ }
1088
+ return {
1089
+ "title": value["title"],
1090
+ "description": value["description"],
1091
+ "category": value["category"],
1092
+ "source_ref": value["source_ref"]
1093
+ };
1094
+ }
1095
+
1096
+ // src/generated/models/AgentAnswerMetadata.ts
1097
+ function instanceOfAgentAnswerMetadata(value) {
1098
+ return true;
1099
+ }
1100
+ function AgentAnswerMetadataFromJSON(json) {
1101
+ return AgentAnswerMetadataFromJSONTyped(json, false);
1102
+ }
1103
+ function AgentAnswerMetadataFromJSONTyped(json, ignoreDiscriminator) {
1104
+ if (json == null) {
1105
+ return json;
1106
+ }
1107
+ return {
1108
+ "citations": json["citations"] == null ? void 0 : json["citations"].map(AgentAnswerCitationFromJSON),
1109
+ "definitions": json["definitions"] == null ? void 0 : json["definitions"].map(AgentAnswerDefinitionFromJSON),
1110
+ "assumptions": json["assumptions"] == null ? void 0 : json["assumptions"].map(AgentAnswerAssumptionFromJSON),
1111
+ "methodology": json["methodology"] == null ? void 0 : json["methodology"].map(AgentAnswerMethodologyNoteFromJSON)
1112
+ };
1113
+ }
1114
+ function AgentAnswerMetadataToJSON(json) {
1115
+ return AgentAnswerMetadataToJSONTyped(json, false);
1116
+ }
1117
+ function AgentAnswerMetadataToJSONTyped(value, ignoreDiscriminator = false) {
1118
+ if (value == null) {
1119
+ return value;
1120
+ }
1121
+ return {
1122
+ "citations": value["citations"] == null ? void 0 : value["citations"].map(AgentAnswerCitationToJSON),
1123
+ "definitions": value["definitions"] == null ? void 0 : value["definitions"].map(AgentAnswerDefinitionToJSON),
1124
+ "assumptions": value["assumptions"] == null ? void 0 : value["assumptions"].map(AgentAnswerAssumptionToJSON),
1125
+ "methodology": value["methodology"] == null ? void 0 : value["methodology"].map(AgentAnswerMethodologyNoteToJSON)
1126
+ };
1127
+ }
1128
+
937
1129
  // src/generated/models/WebResult.ts
938
1130
  function instanceOfWebResult(value) {
939
1131
  if (!("title" in value) || value["title"] === void 0) return false;
@@ -990,6 +1182,7 @@ function AgentResultFromJSONTyped(json, ignoreDiscriminator) {
990
1182
  "answer": json["answer"] == null ? void 0 : json["answer"],
991
1183
  "cards": json["cards"] == null ? void 0 : json["cards"].map(TakoCardFromJSON),
992
1184
  "web_results": json["web_results"] == null ? void 0 : json["web_results"].map(WebResultFromJSON),
1185
+ "metadata": json["metadata"] == null ? void 0 : AgentAnswerMetadataFromJSON(json["metadata"]),
993
1186
  "request_id": json["request_id"] == null ? void 0 : json["request_id"]
994
1187
  };
995
1188
  }
@@ -1004,6 +1197,7 @@ function AgentResultToJSONTyped(value, ignoreDiscriminator = false) {
1004
1197
  "answer": value["answer"],
1005
1198
  "cards": value["cards"] == null ? void 0 : value["cards"].map(TakoCardToJSON),
1006
1199
  "web_results": value["web_results"] == null ? void 0 : value["web_results"].map(WebResultToJSON),
1200
+ "metadata": AgentAnswerMetadataToJSON(value["metadata"]),
1007
1201
  "request_id": value["request_id"]
1008
1202
  };
1009
1203
  }
@@ -1704,7 +1898,6 @@ function EntityClassNameToJSONTyped(value, ignoreDiscriminator) {
1704
1898
 
1705
1899
  // src/generated/models/GraphNodeType.ts
1706
1900
  var GraphNodeType = {
1707
- Source: "source",
1708
1901
  Metric: "metric",
1709
1902
  Entity: "entity"
1710
1903
  };
@@ -1804,7 +1997,6 @@ function RelationGroupToJSONTyped(value, ignoreDiscriminator = false) {
1804
1997
 
1805
1998
  // src/generated/models/RelatedGroups.ts
1806
1999
  function instanceOfRelatedGroups(value) {
1807
- if (!("sources" in value) || value["sources"] === void 0) return false;
1808
2000
  if (!("metrics" in value) || value["metrics"] === void 0) return false;
1809
2001
  if (!("entities" in value) || value["entities"] === void 0) return false;
1810
2002
  return true;
@@ -1817,7 +2009,6 @@ function RelatedGroupsFromJSONTyped(json, ignoreDiscriminator) {
1817
2009
  return json;
1818
2010
  }
1819
2011
  return {
1820
- "sources": RelationGroupFromJSON(json["sources"]),
1821
2012
  "metrics": RelationGroupFromJSON(json["metrics"]),
1822
2013
  "entities": RelationGroupFromJSON(json["entities"])
1823
2014
  };
@@ -1830,7 +2021,6 @@ function RelatedGroupsToJSONTyped(value, ignoreDiscriminator = false) {
1830
2021
  return value;
1831
2022
  }
1832
2023
  return {
1833
- "sources": RelationGroupToJSON(value["sources"]),
1834
2024
  "metrics": RelationGroupToJSON(value["metrics"]),
1835
2025
  "entities": RelationGroupToJSON(value["entities"])
1836
2026
  };
@@ -2313,7 +2503,7 @@ var TakoApi = class extends BaseAPI {
2313
2503
  };
2314
2504
  }
2315
2505
  /**
2316
- * Explore what a node connects to: a source\'s metrics and entities, a metric\'s sources and the entities it\'s tracked for, or an entity\'s available metrics. Use it to find which entity + metric combinations Tako covers, then query /v3/search or /v1/answer for that combination. Pass relation_type + cursor to paginate one facet, and the optional q to narrow that facet by a case-insensitive substring on name/aliases (e.g. metrics for an entity matching \'gdp\'). Public and unauthenticated.
2506
+ * Explore what a node connects to: a metric\'s entities (the things it\'s tracked for), or an entity\'s available metrics. Use it to find which entity + metric combinations Tako covers, then query /v3/search or /v1/answer for that combination. Pass relation_type + cursor to paginate one facet, and the optional q to narrow that facet by a case-insensitive substring on name/aliases (e.g. metrics for an entity matching \'gdp\'). Public and unauthenticated.
2317
2507
  * Get a graph node\'s related nodes
2318
2508
  */
2319
2509
  async graphRelatedRaw(requestParameters, initOverrides) {
@@ -2322,7 +2512,7 @@ var TakoApi = class extends BaseAPI {
2322
2512
  return new JSONApiResponse(response, (jsonValue) => GraphRelatedResponseFromJSON(jsonValue));
2323
2513
  }
2324
2514
  /**
2325
- * Explore what a node connects to: a source\'s metrics and entities, a metric\'s sources and the entities it\'s tracked for, or an entity\'s available metrics. Use it to find which entity + metric combinations Tako covers, then query /v3/search or /v1/answer for that combination. Pass relation_type + cursor to paginate one facet, and the optional q to narrow that facet by a case-insensitive substring on name/aliases (e.g. metrics for an entity matching \'gdp\'). Public and unauthenticated.
2515
+ * Explore what a node connects to: a metric\'s entities (the things it\'s tracked for), or an entity\'s available metrics. Use it to find which entity + metric combinations Tako covers, then query /v3/search or /v1/answer for that combination. Pass relation_type + cursor to paginate one facet, and the optional q to narrow that facet by a case-insensitive substring on name/aliases (e.g. metrics for an entity matching \'gdp\'). Public and unauthenticated.
2326
2516
  * Get a graph node\'s related nodes
2327
2517
  */
2328
2518
  async graphRelated(requestParameters, initOverrides) {
@@ -2362,7 +2552,7 @@ var TakoApi = class extends BaseAPI {
2362
2552
  };
2363
2553
  }
2364
2554
  /**
2365
- * Resolve a data source, metric, or entity in Tako\'s data graph by name. Use this to discover and confirm what data exists before querying — e.g. resolve the metric and the entity you care about here, then ask /v3/search or /v1/answer for that specific entity + metric combination. Public and unauthenticated. Note: results are not yet filtered to the production-ready inventory, so a returned metric or entity that is not backed by a production fact table may 404 when passed to /beta/graph/related. Pass subtype to scope results to one entity class (see the subtype enum).
2555
+ * Resolve a metric or entity in Tako\'s data graph by name. Use this to discover and confirm what data exists before querying — e.g. resolve the metric and the entity you care about here, then ask /v3/search or /v1/answer for that specific entity + metric combination. Public and unauthenticated. Note: results are not yet filtered to the production-ready inventory, so a returned metric or entity that is not backed by a production fact table may 404 when passed to /beta/graph/related. Pass subtype to scope results to one entity class (see the subtype enum).
2366
2556
  * Search the data graph
2367
2557
  */
2368
2558
  async graphSearchRaw(requestParameters, initOverrides) {
@@ -2371,7 +2561,7 @@ var TakoApi = class extends BaseAPI {
2371
2561
  return new JSONApiResponse(response, (jsonValue) => GraphSearchResponseFromJSON(jsonValue));
2372
2562
  }
2373
2563
  /**
2374
- * Resolve a data source, metric, or entity in Tako\'s data graph by name. Use this to discover and confirm what data exists before querying — e.g. resolve the metric and the entity you care about here, then ask /v3/search or /v1/answer for that specific entity + metric combination. Public and unauthenticated. Note: results are not yet filtered to the production-ready inventory, so a returned metric or entity that is not backed by a production fact table may 404 when passed to /beta/graph/related. Pass subtype to scope results to one entity class (see the subtype enum).
2564
+ * Resolve a metric or entity in Tako\'s data graph by name. Use this to discover and confirm what data exists before querying — e.g. resolve the metric and the entity you care about here, then ask /v3/search or /v1/answer for that specific entity + metric combination. Public and unauthenticated. Note: results are not yet filtered to the production-ready inventory, so a returned metric or entity that is not backed by a production fact table may 404 when passed to /beta/graph/related. Pass subtype to scope results to one entity class (see the subtype enum).
2375
2565
  * Search the data graph
2376
2566
  */
2377
2567
  async graphSearch(requestParameters, initOverrides) {
@@ -3448,6 +3638,26 @@ var Tako = class {
3448
3638
  APIErrorTypeFromJSONTyped,
3449
3639
  APIErrorTypeToJSON,
3450
3640
  APIErrorTypeToJSONTyped,
3641
+ AgentAnswerAssumptionFromJSON,
3642
+ AgentAnswerAssumptionFromJSONTyped,
3643
+ AgentAnswerAssumptionToJSON,
3644
+ AgentAnswerAssumptionToJSONTyped,
3645
+ AgentAnswerCitationFromJSON,
3646
+ AgentAnswerCitationFromJSONTyped,
3647
+ AgentAnswerCitationToJSON,
3648
+ AgentAnswerCitationToJSONTyped,
3649
+ AgentAnswerDefinitionFromJSON,
3650
+ AgentAnswerDefinitionFromJSONTyped,
3651
+ AgentAnswerDefinitionToJSON,
3652
+ AgentAnswerDefinitionToJSONTyped,
3653
+ AgentAnswerMetadataFromJSON,
3654
+ AgentAnswerMetadataFromJSONTyped,
3655
+ AgentAnswerMetadataToJSON,
3656
+ AgentAnswerMetadataToJSONTyped,
3657
+ AgentAnswerMethodologyNoteFromJSON,
3658
+ AgentAnswerMethodologyNoteFromJSONTyped,
3659
+ AgentAnswerMethodologyNoteToJSON,
3660
+ AgentAnswerMethodologyNoteToJSONTyped,
3451
3661
  AgentApi,
3452
3662
  AgentEffortLevel,
3453
3663
  AgentEffortLevelFromJSON,
@@ -3725,6 +3935,11 @@ var Tako = class {
3725
3935
  canConsumeForm,
3726
3936
  exists,
3727
3937
  instanceOfAPIErrorType,
3938
+ instanceOfAgentAnswerAssumption,
3939
+ instanceOfAgentAnswerCitation,
3940
+ instanceOfAgentAnswerDefinition,
3941
+ instanceOfAgentAnswerMetadata,
3942
+ instanceOfAgentAnswerMethodologyNote,
3728
3943
  instanceOfAgentEffortLevel,
3729
3944
  instanceOfAgentOutputSettings,
3730
3945
  instanceOfAgentResult,