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 +223 -8
- package/dist/index.d.cts +267 -23
- package/dist/index.d.ts +267 -23
- package/dist/index.js +198 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -569,6 +569,173 @@ function TakoCardToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
569
569
|
};
|
|
570
570
|
}
|
|
571
571
|
|
|
572
|
+
// src/generated/models/AgentAnswerCitation.ts
|
|
573
|
+
function instanceOfAgentAnswerCitation(value) {
|
|
574
|
+
if (!("index" in value) || value["index"] === void 0) return false;
|
|
575
|
+
if (!("title" in value) || value["title"] === void 0) return false;
|
|
576
|
+
return true;
|
|
577
|
+
}
|
|
578
|
+
function AgentAnswerCitationFromJSON(json) {
|
|
579
|
+
return AgentAnswerCitationFromJSONTyped(json, false);
|
|
580
|
+
}
|
|
581
|
+
function AgentAnswerCitationFromJSONTyped(json, ignoreDiscriminator) {
|
|
582
|
+
if (json == null) {
|
|
583
|
+
return json;
|
|
584
|
+
}
|
|
585
|
+
return {
|
|
586
|
+
"index": json["index"],
|
|
587
|
+
"title": json["title"],
|
|
588
|
+
"url": json["url"] == null ? void 0 : json["url"],
|
|
589
|
+
"source_name": json["source_name"] == null ? void 0 : json["source_name"]
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
function AgentAnswerCitationToJSON(json) {
|
|
593
|
+
return AgentAnswerCitationToJSONTyped(json, false);
|
|
594
|
+
}
|
|
595
|
+
function AgentAnswerCitationToJSONTyped(value, ignoreDiscriminator = false) {
|
|
596
|
+
if (value == null) {
|
|
597
|
+
return value;
|
|
598
|
+
}
|
|
599
|
+
return {
|
|
600
|
+
"index": value["index"],
|
|
601
|
+
"title": value["title"],
|
|
602
|
+
"url": value["url"],
|
|
603
|
+
"source_name": value["source_name"]
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// src/generated/models/AgentAnswerDefinition.ts
|
|
608
|
+
function instanceOfAgentAnswerDefinition(value) {
|
|
609
|
+
if (!("term" in value) || value["term"] === void 0) return false;
|
|
610
|
+
if (!("definition" in value) || value["definition"] === void 0) return false;
|
|
611
|
+
return true;
|
|
612
|
+
}
|
|
613
|
+
function AgentAnswerDefinitionFromJSON(json) {
|
|
614
|
+
return AgentAnswerDefinitionFromJSONTyped(json, false);
|
|
615
|
+
}
|
|
616
|
+
function AgentAnswerDefinitionFromJSONTyped(json, ignoreDiscriminator) {
|
|
617
|
+
if (json == null) {
|
|
618
|
+
return json;
|
|
619
|
+
}
|
|
620
|
+
return {
|
|
621
|
+
"term": json["term"],
|
|
622
|
+
"definition": json["definition"],
|
|
623
|
+
"source_ref": json["source_ref"] == null ? void 0 : json["source_ref"]
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
function AgentAnswerDefinitionToJSON(json) {
|
|
627
|
+
return AgentAnswerDefinitionToJSONTyped(json, false);
|
|
628
|
+
}
|
|
629
|
+
function AgentAnswerDefinitionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
630
|
+
if (value == null) {
|
|
631
|
+
return value;
|
|
632
|
+
}
|
|
633
|
+
return {
|
|
634
|
+
"term": value["term"],
|
|
635
|
+
"definition": value["definition"],
|
|
636
|
+
"source_ref": value["source_ref"]
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// src/generated/models/AgentAnswerMethodologyNote.ts
|
|
641
|
+
function instanceOfAgentAnswerMethodologyNote(value) {
|
|
642
|
+
if (!("title" in value) || value["title"] === void 0) return false;
|
|
643
|
+
if (!("description" in value) || value["description"] === void 0) return false;
|
|
644
|
+
return true;
|
|
645
|
+
}
|
|
646
|
+
function AgentAnswerMethodologyNoteFromJSON(json) {
|
|
647
|
+
return AgentAnswerMethodologyNoteFromJSONTyped(json, false);
|
|
648
|
+
}
|
|
649
|
+
function AgentAnswerMethodologyNoteFromJSONTyped(json, ignoreDiscriminator) {
|
|
650
|
+
if (json == null) {
|
|
651
|
+
return json;
|
|
652
|
+
}
|
|
653
|
+
return {
|
|
654
|
+
"title": json["title"],
|
|
655
|
+
"description": json["description"]
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
function AgentAnswerMethodologyNoteToJSON(json) {
|
|
659
|
+
return AgentAnswerMethodologyNoteToJSONTyped(json, false);
|
|
660
|
+
}
|
|
661
|
+
function AgentAnswerMethodologyNoteToJSONTyped(value, ignoreDiscriminator = false) {
|
|
662
|
+
if (value == null) {
|
|
663
|
+
return value;
|
|
664
|
+
}
|
|
665
|
+
return {
|
|
666
|
+
"title": value["title"],
|
|
667
|
+
"description": value["description"]
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
// src/generated/models/AgentAnswerAssumption.ts
|
|
672
|
+
function instanceOfAgentAnswerAssumption(value) {
|
|
673
|
+
if (!("title" in value) || value["title"] === void 0) return false;
|
|
674
|
+
if (!("description" in value) || value["description"] === void 0) return false;
|
|
675
|
+
return true;
|
|
676
|
+
}
|
|
677
|
+
function AgentAnswerAssumptionFromJSON(json) {
|
|
678
|
+
return AgentAnswerAssumptionFromJSONTyped(json, false);
|
|
679
|
+
}
|
|
680
|
+
function AgentAnswerAssumptionFromJSONTyped(json, ignoreDiscriminator) {
|
|
681
|
+
if (json == null) {
|
|
682
|
+
return json;
|
|
683
|
+
}
|
|
684
|
+
return {
|
|
685
|
+
"title": json["title"],
|
|
686
|
+
"description": json["description"],
|
|
687
|
+
"category": json["category"] == null ? void 0 : json["category"],
|
|
688
|
+
"source_ref": json["source_ref"] == null ? void 0 : json["source_ref"]
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
function AgentAnswerAssumptionToJSON(json) {
|
|
692
|
+
return AgentAnswerAssumptionToJSONTyped(json, false);
|
|
693
|
+
}
|
|
694
|
+
function AgentAnswerAssumptionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
695
|
+
if (value == null) {
|
|
696
|
+
return value;
|
|
697
|
+
}
|
|
698
|
+
return {
|
|
699
|
+
"title": value["title"],
|
|
700
|
+
"description": value["description"],
|
|
701
|
+
"category": value["category"],
|
|
702
|
+
"source_ref": value["source_ref"]
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// src/generated/models/AgentAnswerMetadata.ts
|
|
707
|
+
function instanceOfAgentAnswerMetadata(value) {
|
|
708
|
+
return true;
|
|
709
|
+
}
|
|
710
|
+
function AgentAnswerMetadataFromJSON(json) {
|
|
711
|
+
return AgentAnswerMetadataFromJSONTyped(json, false);
|
|
712
|
+
}
|
|
713
|
+
function AgentAnswerMetadataFromJSONTyped(json, ignoreDiscriminator) {
|
|
714
|
+
if (json == null) {
|
|
715
|
+
return json;
|
|
716
|
+
}
|
|
717
|
+
return {
|
|
718
|
+
"citations": json["citations"] == null ? void 0 : json["citations"].map(AgentAnswerCitationFromJSON),
|
|
719
|
+
"definitions": json["definitions"] == null ? void 0 : json["definitions"].map(AgentAnswerDefinitionFromJSON),
|
|
720
|
+
"assumptions": json["assumptions"] == null ? void 0 : json["assumptions"].map(AgentAnswerAssumptionFromJSON),
|
|
721
|
+
"methodology": json["methodology"] == null ? void 0 : json["methodology"].map(AgentAnswerMethodologyNoteFromJSON)
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
function AgentAnswerMetadataToJSON(json) {
|
|
725
|
+
return AgentAnswerMetadataToJSONTyped(json, false);
|
|
726
|
+
}
|
|
727
|
+
function AgentAnswerMetadataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
728
|
+
if (value == null) {
|
|
729
|
+
return value;
|
|
730
|
+
}
|
|
731
|
+
return {
|
|
732
|
+
"citations": value["citations"] == null ? void 0 : value["citations"].map(AgentAnswerCitationToJSON),
|
|
733
|
+
"definitions": value["definitions"] == null ? void 0 : value["definitions"].map(AgentAnswerDefinitionToJSON),
|
|
734
|
+
"assumptions": value["assumptions"] == null ? void 0 : value["assumptions"].map(AgentAnswerAssumptionToJSON),
|
|
735
|
+
"methodology": value["methodology"] == null ? void 0 : value["methodology"].map(AgentAnswerMethodologyNoteToJSON)
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
|
|
572
739
|
// src/generated/models/WebResult.ts
|
|
573
740
|
function instanceOfWebResult(value) {
|
|
574
741
|
if (!("title" in value) || value["title"] === void 0) return false;
|
|
@@ -625,6 +792,7 @@ function AgentResultFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
625
792
|
"answer": json["answer"] == null ? void 0 : json["answer"],
|
|
626
793
|
"cards": json["cards"] == null ? void 0 : json["cards"].map(TakoCardFromJSON),
|
|
627
794
|
"web_results": json["web_results"] == null ? void 0 : json["web_results"].map(WebResultFromJSON),
|
|
795
|
+
"metadata": json["metadata"] == null ? void 0 : AgentAnswerMetadataFromJSON(json["metadata"]),
|
|
628
796
|
"request_id": json["request_id"] == null ? void 0 : json["request_id"]
|
|
629
797
|
};
|
|
630
798
|
}
|
|
@@ -639,6 +807,7 @@ function AgentResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
639
807
|
"answer": value["answer"],
|
|
640
808
|
"cards": value["cards"] == null ? void 0 : value["cards"].map(TakoCardToJSON),
|
|
641
809
|
"web_results": value["web_results"] == null ? void 0 : value["web_results"].map(WebResultToJSON),
|
|
810
|
+
"metadata": AgentAnswerMetadataToJSON(value["metadata"]),
|
|
642
811
|
"request_id": value["request_id"]
|
|
643
812
|
};
|
|
644
813
|
}
|
|
@@ -1339,7 +1508,6 @@ function EntityClassNameToJSONTyped(value, ignoreDiscriminator) {
|
|
|
1339
1508
|
|
|
1340
1509
|
// src/generated/models/GraphNodeType.ts
|
|
1341
1510
|
var GraphNodeType = {
|
|
1342
|
-
Source: "source",
|
|
1343
1511
|
Metric: "metric",
|
|
1344
1512
|
Entity: "entity"
|
|
1345
1513
|
};
|
|
@@ -1439,7 +1607,6 @@ function RelationGroupToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1439
1607
|
|
|
1440
1608
|
// src/generated/models/RelatedGroups.ts
|
|
1441
1609
|
function instanceOfRelatedGroups(value) {
|
|
1442
|
-
if (!("sources" in value) || value["sources"] === void 0) return false;
|
|
1443
1610
|
if (!("metrics" in value) || value["metrics"] === void 0) return false;
|
|
1444
1611
|
if (!("entities" in value) || value["entities"] === void 0) return false;
|
|
1445
1612
|
return true;
|
|
@@ -1452,7 +1619,6 @@ function RelatedGroupsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
1452
1619
|
return json;
|
|
1453
1620
|
}
|
|
1454
1621
|
return {
|
|
1455
|
-
"sources": RelationGroupFromJSON(json["sources"]),
|
|
1456
1622
|
"metrics": RelationGroupFromJSON(json["metrics"]),
|
|
1457
1623
|
"entities": RelationGroupFromJSON(json["entities"])
|
|
1458
1624
|
};
|
|
@@ -1465,7 +1631,6 @@ function RelatedGroupsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1465
1631
|
return value;
|
|
1466
1632
|
}
|
|
1467
1633
|
return {
|
|
1468
|
-
"sources": RelationGroupToJSON(value["sources"]),
|
|
1469
1634
|
"metrics": RelationGroupToJSON(value["metrics"]),
|
|
1470
1635
|
"entities": RelationGroupToJSON(value["entities"])
|
|
1471
1636
|
};
|
|
@@ -1948,7 +2113,7 @@ var TakoApi = class extends BaseAPI {
|
|
|
1948
2113
|
};
|
|
1949
2114
|
}
|
|
1950
2115
|
/**
|
|
1951
|
-
* Explore what a node connects to: a
|
|
2116
|
+
* 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.
|
|
1952
2117
|
* Get a graph node\'s related nodes
|
|
1953
2118
|
*/
|
|
1954
2119
|
async graphRelatedRaw(requestParameters, initOverrides) {
|
|
@@ -1957,7 +2122,7 @@ var TakoApi = class extends BaseAPI {
|
|
|
1957
2122
|
return new JSONApiResponse(response, (jsonValue) => GraphRelatedResponseFromJSON(jsonValue));
|
|
1958
2123
|
}
|
|
1959
2124
|
/**
|
|
1960
|
-
* Explore what a node connects to: a
|
|
2125
|
+
* 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.
|
|
1961
2126
|
* Get a graph node\'s related nodes
|
|
1962
2127
|
*/
|
|
1963
2128
|
async graphRelated(requestParameters, initOverrides) {
|
|
@@ -1997,7 +2162,7 @@ var TakoApi = class extends BaseAPI {
|
|
|
1997
2162
|
};
|
|
1998
2163
|
}
|
|
1999
2164
|
/**
|
|
2000
|
-
* Resolve a
|
|
2165
|
+
* 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).
|
|
2001
2166
|
* Search the data graph
|
|
2002
2167
|
*/
|
|
2003
2168
|
async graphSearchRaw(requestParameters, initOverrides) {
|
|
@@ -2006,7 +2171,7 @@ var TakoApi = class extends BaseAPI {
|
|
|
2006
2171
|
return new JSONApiResponse(response, (jsonValue) => GraphSearchResponseFromJSON(jsonValue));
|
|
2007
2172
|
}
|
|
2008
2173
|
/**
|
|
2009
|
-
* Resolve a
|
|
2174
|
+
* 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).
|
|
2010
2175
|
* Search the data graph
|
|
2011
2176
|
*/
|
|
2012
2177
|
async graphSearch(requestParameters, initOverrides) {
|
|
@@ -3082,6 +3247,26 @@ export {
|
|
|
3082
3247
|
APIErrorTypeFromJSONTyped,
|
|
3083
3248
|
APIErrorTypeToJSON,
|
|
3084
3249
|
APIErrorTypeToJSONTyped,
|
|
3250
|
+
AgentAnswerAssumptionFromJSON,
|
|
3251
|
+
AgentAnswerAssumptionFromJSONTyped,
|
|
3252
|
+
AgentAnswerAssumptionToJSON,
|
|
3253
|
+
AgentAnswerAssumptionToJSONTyped,
|
|
3254
|
+
AgentAnswerCitationFromJSON,
|
|
3255
|
+
AgentAnswerCitationFromJSONTyped,
|
|
3256
|
+
AgentAnswerCitationToJSON,
|
|
3257
|
+
AgentAnswerCitationToJSONTyped,
|
|
3258
|
+
AgentAnswerDefinitionFromJSON,
|
|
3259
|
+
AgentAnswerDefinitionFromJSONTyped,
|
|
3260
|
+
AgentAnswerDefinitionToJSON,
|
|
3261
|
+
AgentAnswerDefinitionToJSONTyped,
|
|
3262
|
+
AgentAnswerMetadataFromJSON,
|
|
3263
|
+
AgentAnswerMetadataFromJSONTyped,
|
|
3264
|
+
AgentAnswerMetadataToJSON,
|
|
3265
|
+
AgentAnswerMetadataToJSONTyped,
|
|
3266
|
+
AgentAnswerMethodologyNoteFromJSON,
|
|
3267
|
+
AgentAnswerMethodologyNoteFromJSONTyped,
|
|
3268
|
+
AgentAnswerMethodologyNoteToJSON,
|
|
3269
|
+
AgentAnswerMethodologyNoteToJSONTyped,
|
|
3085
3270
|
AgentApi,
|
|
3086
3271
|
AgentEffortLevel,
|
|
3087
3272
|
AgentEffortLevelFromJSON,
|
|
@@ -3359,6 +3544,11 @@ export {
|
|
|
3359
3544
|
canConsumeForm,
|
|
3360
3545
|
exists,
|
|
3361
3546
|
instanceOfAPIErrorType,
|
|
3547
|
+
instanceOfAgentAnswerAssumption,
|
|
3548
|
+
instanceOfAgentAnswerCitation,
|
|
3549
|
+
instanceOfAgentAnswerDefinition,
|
|
3550
|
+
instanceOfAgentAnswerMetadata,
|
|
3551
|
+
instanceOfAgentAnswerMethodologyNote,
|
|
3362
3552
|
instanceOfAgentEffortLevel,
|
|
3363
3553
|
instanceOfAgentOutputSettings,
|
|
3364
3554
|
instanceOfAgentResult,
|