aegis-platform-sdk 0.1.0 → 1.0.0
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/CHANGELOG.md +67 -0
- package/README.md +38 -0
- package/dist/cli.js +3640 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +3797 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1985 -110
- package/dist/index.d.ts +1985 -110
- package/dist/index.js +3715 -62
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
- package/skills/aegis-sdk/SKILL.md +52 -1
package/dist/index.js
CHANGED
|
@@ -20,10 +20,27 @@ var NotFoundError = class extends AegisAPIError {
|
|
|
20
20
|
|
|
21
21
|
// src/transport.ts
|
|
22
22
|
function buildUrl(baseUrl, path, params) {
|
|
23
|
-
const
|
|
23
|
+
const raw = baseUrl.replace(/\/+$/, "") + path;
|
|
24
|
+
let url;
|
|
25
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(raw)) {
|
|
26
|
+
url = new URL(raw);
|
|
27
|
+
} else {
|
|
28
|
+
const origin = globalThis.location?.origin;
|
|
29
|
+
if (!origin) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`relative baseUrl "${baseUrl}" requires a browser origin \u2014 use an absolute URL in Node`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
url = new URL(raw, origin);
|
|
35
|
+
}
|
|
24
36
|
if (params) {
|
|
25
37
|
for (const [key, value] of Object.entries(params)) {
|
|
26
|
-
if (value
|
|
38
|
+
if (value === void 0 || value === null) continue;
|
|
39
|
+
if (Array.isArray(value)) {
|
|
40
|
+
for (const item of value) url.searchParams.append(key, String(item));
|
|
41
|
+
} else {
|
|
42
|
+
url.searchParams.set(key, String(value));
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
45
|
}
|
|
29
46
|
return url.toString();
|
|
@@ -49,19 +66,96 @@ async function handleResponse(res) {
|
|
|
49
66
|
throw new AegisAPIError(res.status, detail || text, payload);
|
|
50
67
|
}
|
|
51
68
|
|
|
69
|
+
// src/sse.ts
|
|
70
|
+
async function* parseSseStream(stream) {
|
|
71
|
+
const reader = stream.getReader();
|
|
72
|
+
const decoder = new TextDecoder();
|
|
73
|
+
let buffer = "";
|
|
74
|
+
let event = "";
|
|
75
|
+
let data = [];
|
|
76
|
+
let id;
|
|
77
|
+
let retry;
|
|
78
|
+
const flush = () => {
|
|
79
|
+
if (data.length === 0) {
|
|
80
|
+
event = "";
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const ev = { event: event || "message", data: data.join("\n") };
|
|
84
|
+
if (id !== void 0) ev.id = id;
|
|
85
|
+
if (retry !== void 0) ev.retry = retry;
|
|
86
|
+
event = "";
|
|
87
|
+
data = [];
|
|
88
|
+
return ev;
|
|
89
|
+
};
|
|
90
|
+
const handleLine = (line) => {
|
|
91
|
+
if (line === "") return flush();
|
|
92
|
+
if (line.startsWith(":")) return null;
|
|
93
|
+
const colon = line.indexOf(":");
|
|
94
|
+
const field = colon === -1 ? line : line.slice(0, colon);
|
|
95
|
+
let value = colon === -1 ? "" : line.slice(colon + 1);
|
|
96
|
+
if (value.startsWith(" ")) value = value.slice(1);
|
|
97
|
+
switch (field) {
|
|
98
|
+
case "event":
|
|
99
|
+
event = value;
|
|
100
|
+
break;
|
|
101
|
+
case "data":
|
|
102
|
+
data.push(value);
|
|
103
|
+
break;
|
|
104
|
+
case "id":
|
|
105
|
+
id = value;
|
|
106
|
+
break;
|
|
107
|
+
case "retry": {
|
|
108
|
+
const n = Number(value);
|
|
109
|
+
if (Number.isFinite(n)) retry = n;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
};
|
|
115
|
+
try {
|
|
116
|
+
for (; ; ) {
|
|
117
|
+
const { done, value } = await reader.read();
|
|
118
|
+
if (done) break;
|
|
119
|
+
buffer += decoder.decode(value, { stream: true });
|
|
120
|
+
let newline;
|
|
121
|
+
while ((newline = buffer.search(/\r\n|\n|\r/)) !== -1) {
|
|
122
|
+
const line = buffer.slice(0, newline);
|
|
123
|
+
buffer = buffer.slice(newline + (buffer[newline] === "\r" && buffer[newline + 1] === "\n" ? 2 : 1));
|
|
124
|
+
const ev = handleLine(line);
|
|
125
|
+
if (ev) yield ev;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (buffer) handleLine(buffer);
|
|
129
|
+
const tail = flush();
|
|
130
|
+
if (tail) yield tail;
|
|
131
|
+
} finally {
|
|
132
|
+
reader.releaseLock();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
52
136
|
// src/resources/auth.ts
|
|
53
137
|
var AuthResource = class {
|
|
54
|
-
constructor(t,
|
|
138
|
+
constructor(t, attach) {
|
|
55
139
|
this.t = t;
|
|
56
|
-
this.
|
|
140
|
+
this.attach = attach;
|
|
57
141
|
}
|
|
58
142
|
t;
|
|
59
|
-
|
|
143
|
+
attach;
|
|
60
144
|
async login(username, password, opts = {}) {
|
|
61
145
|
const body = { username, password };
|
|
62
146
|
if (opts.totpCode) body.totp_code = opts.totpCode;
|
|
63
147
|
const pair = await this.t.request("POST", "/auth/login", { json: body });
|
|
64
|
-
if (opts.attach !== false) this.
|
|
148
|
+
if (opts.attach !== false) this.attach(pair);
|
|
149
|
+
return pair;
|
|
150
|
+
}
|
|
151
|
+
/** Rotate a refresh token explicitly (`POST /auth/refresh`). The client
|
|
152
|
+
* already does this transparently on 401 — call this only for manual
|
|
153
|
+
* flows. Attaches the new pair unless `attach: false`. */
|
|
154
|
+
async refresh(refreshToken, opts = {}) {
|
|
155
|
+
const pair = await this.t.request("POST", "/auth/refresh", {
|
|
156
|
+
json: { refresh_token: refreshToken }
|
|
157
|
+
});
|
|
158
|
+
if (opts.attach !== false) this.attach(pair);
|
|
65
159
|
return pair;
|
|
66
160
|
}
|
|
67
161
|
me() {
|
|
@@ -617,72 +711,3631 @@ var DatasetsResource = class {
|
|
|
617
711
|
}
|
|
618
712
|
};
|
|
619
713
|
|
|
620
|
-
// src/
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
}
|
|
625
|
-
var AegisClient = class {
|
|
626
|
-
baseUrl;
|
|
627
|
-
_token;
|
|
628
|
-
timeoutMs;
|
|
629
|
-
_fetch;
|
|
630
|
-
auth;
|
|
631
|
-
iam;
|
|
632
|
-
osdk;
|
|
633
|
-
operator;
|
|
634
|
-
ontology;
|
|
635
|
-
aip;
|
|
636
|
-
functions;
|
|
637
|
-
codeRepositories;
|
|
638
|
-
datasets;
|
|
639
|
-
constructor(options = {}) {
|
|
640
|
-
const baseUrl = options.baseUrl ?? envVar("AEGIS_API_URL") ?? "http://localhost:8002";
|
|
641
|
-
this.baseUrl = baseUrl.replace(/\/+$/, "");
|
|
642
|
-
this._token = options.token ?? envVar("AEGIS_TOKEN") ?? null;
|
|
643
|
-
this.timeoutMs = options.timeoutMs ?? 15e3;
|
|
644
|
-
this._fetch = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
645
|
-
this.auth = new AuthResource(this, (t) => this.setToken(t));
|
|
646
|
-
this.iam = new IamResource(this);
|
|
647
|
-
this.osdk = new OsdkResource(this);
|
|
648
|
-
this.operator = new OperatorResource(this);
|
|
649
|
-
this.ontology = new OntologyResource(this);
|
|
650
|
-
this.aip = new AipResource(this);
|
|
651
|
-
this.functions = new FunctionsResource(this);
|
|
652
|
-
this.codeRepositories = new CodeRepositoriesResource(this);
|
|
653
|
-
this.datasets = new DatasetsResource(this);
|
|
714
|
+
// src/resources/reading.ts
|
|
715
|
+
var GeoResource = class {
|
|
716
|
+
constructor(t) {
|
|
717
|
+
this.t = t;
|
|
654
718
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
this.
|
|
719
|
+
t;
|
|
720
|
+
nodes(opts = {}) {
|
|
721
|
+
return this.t.request("GET", "/api/v1/geo/nodes", { params: opts });
|
|
658
722
|
}
|
|
659
|
-
|
|
660
|
-
return this.
|
|
723
|
+
nodeTypes() {
|
|
724
|
+
return this.t.request("GET", "/api/v1/geo/node-types");
|
|
661
725
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
726
|
+
sources() {
|
|
727
|
+
return this.t.request("GET", "/api/v1/geo/sources");
|
|
728
|
+
}
|
|
729
|
+
edges(nodeIds, relationTypes) {
|
|
730
|
+
return this.t.request("GET", "/api/v1/geo/edges", {
|
|
731
|
+
params: { node_ids: nodeIds.join(","), relation_types: relationTypes?.join(",") }
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
/** Catalog of keyless reference layers (IBGE limits, CNES health, …). */
|
|
735
|
+
referenceLayers() {
|
|
736
|
+
return this.t.request("GET", "/api/v1/geo/reference-layers");
|
|
737
|
+
}
|
|
738
|
+
/** GeoJSON of one reference layer (resilient keyless proxy). */
|
|
739
|
+
referenceLayer(layerId, opts = {}) {
|
|
740
|
+
return this.t.request("GET", `/api/v1/geo/reference-layers/${encodeURIComponent(layerId)}`, {
|
|
741
|
+
params: opts
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
zones() {
|
|
745
|
+
return this.t.request("GET", "/api/v1/geo/zones");
|
|
746
|
+
}
|
|
747
|
+
importZones(features, opts = {}) {
|
|
748
|
+
return this.t.request("POST", "/api/v1/geo/zones/import", { json: { features, ...opts } });
|
|
749
|
+
}
|
|
750
|
+
deleteZone(zoneId) {
|
|
751
|
+
return this.t.request("DELETE", `/api/v1/geo/zones/${zoneId}`);
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
var MapTemplatesResource = class {
|
|
755
|
+
constructor(t) {
|
|
756
|
+
this.t = t;
|
|
757
|
+
}
|
|
758
|
+
t;
|
|
759
|
+
async list() {
|
|
760
|
+
const payload = await this.t.request("GET", "/platform/v22/map-templates");
|
|
761
|
+
return payload.items ?? [];
|
|
762
|
+
}
|
|
763
|
+
get(templateId) {
|
|
764
|
+
return this.t.request("GET", `/platform/v22/map-templates/${templateId}`);
|
|
765
|
+
}
|
|
766
|
+
create(name, spec, description = "") {
|
|
767
|
+
return this.t.request("POST", "/platform/v22/map-templates", {
|
|
768
|
+
json: { name, spec, description }
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
instantiate(templateId, variables) {
|
|
772
|
+
return this.t.request("POST", `/platform/v22/map-templates/${templateId}/instantiate`, {
|
|
773
|
+
json: { variables: variables ?? {} }
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
/** Returns the raw SVG markup (non-JSON body). */
|
|
777
|
+
exportSvg(templateId) {
|
|
778
|
+
return this.t.request("GET", `/platform/v22/map-templates/${templateId}/export.svg`);
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
var MediaResource = class {
|
|
782
|
+
constructor(t) {
|
|
783
|
+
this.t = t;
|
|
784
|
+
}
|
|
785
|
+
t;
|
|
786
|
+
listSets() {
|
|
787
|
+
return this.t.request("GET", "/platform/v23/media/sets");
|
|
788
|
+
}
|
|
789
|
+
createSet(input) {
|
|
790
|
+
return this.t.request("POST", "/platform/v23/media/sets", { json: input });
|
|
791
|
+
}
|
|
792
|
+
deleteSet(setId) {
|
|
793
|
+
return this.t.request("DELETE", `/platform/v23/media/sets/${setId}`);
|
|
794
|
+
}
|
|
795
|
+
listItems(setId) {
|
|
796
|
+
return this.t.request("GET", `/platform/v23/media/sets/${setId}/items`);
|
|
797
|
+
}
|
|
798
|
+
/** Metadata only — no file bytes are uploaded (pass a pre-supplied `uri`). */
|
|
799
|
+
addItem(setId, input) {
|
|
800
|
+
return this.t.request("POST", `/platform/v23/media/sets/${setId}/items`, { json: input });
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
var DocsResource = class {
|
|
804
|
+
constructor(t) {
|
|
805
|
+
this.t = t;
|
|
806
|
+
}
|
|
807
|
+
t;
|
|
808
|
+
tree() {
|
|
809
|
+
return this.t.request("GET", "/docs/tree");
|
|
810
|
+
}
|
|
811
|
+
read(path) {
|
|
812
|
+
return this.t.request("GET", "/docs/content", { params: { path } });
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
var PagesResource = class {
|
|
816
|
+
constructor(t) {
|
|
817
|
+
this.t = t;
|
|
818
|
+
}
|
|
819
|
+
t;
|
|
820
|
+
list(opts = {}) {
|
|
821
|
+
return this.t.request("GET", "/platform/v23/pages", { params: opts });
|
|
822
|
+
}
|
|
823
|
+
get(slug) {
|
|
824
|
+
return this.t.request("GET", `/platform/v23/pages/${slug}`);
|
|
825
|
+
}
|
|
826
|
+
getConfig(slug) {
|
|
827
|
+
return this.t.request("GET", `/platform/v23/pages/${slug}/config`);
|
|
828
|
+
}
|
|
829
|
+
create(input) {
|
|
830
|
+
return this.t.request("POST", "/platform/v23/pages", { json: input });
|
|
831
|
+
}
|
|
832
|
+
update(slug, patch) {
|
|
833
|
+
return this.t.request("PATCH", `/platform/v23/pages/${slug}`, { json: patch });
|
|
834
|
+
}
|
|
835
|
+
/** Soft delete — page moves to status=archived. */
|
|
836
|
+
delete(slug) {
|
|
837
|
+
return this.t.request("DELETE", `/platform/v23/pages/${slug}`);
|
|
838
|
+
}
|
|
839
|
+
duplicate(slug) {
|
|
840
|
+
return this.t.request("POST", `/platform/v23/pages/${slug}/duplicate`);
|
|
841
|
+
}
|
|
842
|
+
putConfig(slug, config) {
|
|
843
|
+
return this.t.request("PUT", `/platform/v23/pages/${slug}/config`, { json: { config } });
|
|
844
|
+
}
|
|
845
|
+
publish(slug) {
|
|
846
|
+
return this.t.request("POST", `/platform/v23/pages/${slug}/publish`);
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
var DossierResource = class {
|
|
850
|
+
constructor(t) {
|
|
851
|
+
this.t = t;
|
|
852
|
+
}
|
|
853
|
+
t;
|
|
854
|
+
startGeneric(nodeId, purpose) {
|
|
855
|
+
return this.t.request("POST", `/ontology/nodes/${nodeId}/dossier`, {
|
|
856
|
+
json: purpose ? { purpose } : {}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
/** Requires `anchor_node_id` or `node_ids`. */
|
|
860
|
+
startComposite(input) {
|
|
861
|
+
if (!input.anchor_node_id && !input.node_ids?.length) {
|
|
862
|
+
throw new Error("startComposite requires anchor_node_id or node_ids");
|
|
676
863
|
}
|
|
677
|
-
|
|
678
|
-
|
|
864
|
+
return this.t.request("POST", "/ontology/dossier/composite", { json: input });
|
|
865
|
+
}
|
|
866
|
+
/** Poll until `status === "done"`; `result` is then populated. */
|
|
867
|
+
get(taskId) {
|
|
868
|
+
return this.t.request("GET", `/ontology/dossier/${taskId}`);
|
|
869
|
+
}
|
|
870
|
+
};
|
|
871
|
+
var TimeSeriesResource = class {
|
|
872
|
+
constructor(t) {
|
|
873
|
+
this.t = t;
|
|
874
|
+
}
|
|
875
|
+
t;
|
|
876
|
+
list() {
|
|
877
|
+
return this.t.request("GET", "/platform/v23/timeseries");
|
|
878
|
+
}
|
|
879
|
+
create(input) {
|
|
880
|
+
return this.t.request("POST", "/platform/v23/timeseries", { json: input });
|
|
881
|
+
}
|
|
882
|
+
delete(chartId) {
|
|
883
|
+
return this.t.request("DELETE", `/platform/v23/timeseries/${chartId}`);
|
|
884
|
+
}
|
|
885
|
+
render(chartId) {
|
|
886
|
+
return this.t.request("POST", `/platform/v23/timeseries/${chartId}/render`);
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
// src/resources/operational.ts
|
|
891
|
+
var AlertFeedsResource = class {
|
|
892
|
+
constructor(t) {
|
|
893
|
+
this.t = t;
|
|
894
|
+
}
|
|
895
|
+
t;
|
|
896
|
+
list() {
|
|
897
|
+
return this.t.request("GET", "/alerts/feeds");
|
|
898
|
+
}
|
|
899
|
+
create(name, filters, cadenceSeconds = 300) {
|
|
900
|
+
return this.t.request("POST", "/alerts/feeds", {
|
|
901
|
+
json: { name, filters, cadence_seconds: cadenceSeconds }
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
delete(feedId) {
|
|
905
|
+
return this.t.request("DELETE", `/alerts/feeds/${feedId}`);
|
|
906
|
+
}
|
|
907
|
+
alerts() {
|
|
908
|
+
return this.t.request("GET", "/alerts/feeds/alerts");
|
|
909
|
+
}
|
|
910
|
+
acknowledge(alertId) {
|
|
911
|
+
return this.t.request("POST", `/alerts/feeds/${alertId}/acknowledge`);
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
var AlertWatchesResource = class {
|
|
915
|
+
constructor(t) {
|
|
916
|
+
this.t = t;
|
|
917
|
+
}
|
|
918
|
+
t;
|
|
919
|
+
list() {
|
|
920
|
+
return this.t.request("GET", "/alerts/watches");
|
|
921
|
+
}
|
|
922
|
+
create(objectId) {
|
|
923
|
+
return this.t.request("POST", "/alerts/watches", { json: { object_id: objectId } });
|
|
924
|
+
}
|
|
925
|
+
delete(watchId) {
|
|
926
|
+
return this.t.request("DELETE", `/alerts/watches/${watchId}`);
|
|
927
|
+
}
|
|
928
|
+
alerts() {
|
|
929
|
+
return this.t.request("GET", "/alerts/watches/alerts");
|
|
930
|
+
}
|
|
931
|
+
acknowledge(alertId) {
|
|
932
|
+
return this.t.request("POST", `/alerts/watches/${alertId}/acknowledge`);
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
var AlertGeofencesResource = class {
|
|
936
|
+
constructor(t) {
|
|
937
|
+
this.t = t;
|
|
938
|
+
}
|
|
939
|
+
t;
|
|
940
|
+
list() {
|
|
941
|
+
return this.t.request("GET", "/alerts/geofences");
|
|
942
|
+
}
|
|
943
|
+
/** `coordinates` is shape-dependent: polygon `[[lon,lat],…]`, circle
|
|
944
|
+
* `{center, radius_meters}`, corridor/route `{waypoints, width_meters}`. */
|
|
945
|
+
create(input) {
|
|
946
|
+
return this.t.request("POST", "/alerts/geofences", { json: input });
|
|
947
|
+
}
|
|
948
|
+
update(geofenceId, patch) {
|
|
949
|
+
return this.t.request("PATCH", `/alerts/geofences/${geofenceId}`, { json: patch });
|
|
950
|
+
}
|
|
951
|
+
delete(geofenceId) {
|
|
952
|
+
return this.t.request("DELETE", `/alerts/geofences/${geofenceId}`);
|
|
953
|
+
}
|
|
954
|
+
alerts() {
|
|
955
|
+
return this.t.request("GET", "/alerts/geofences/alerts");
|
|
956
|
+
}
|
|
957
|
+
acknowledge(alertId) {
|
|
958
|
+
return this.t.request("POST", `/alerts/geofences/${alertId}/acknowledge`);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
var AlertSharesResource = class {
|
|
962
|
+
constructor(t) {
|
|
963
|
+
this.t = t;
|
|
964
|
+
}
|
|
965
|
+
t;
|
|
966
|
+
list() {
|
|
967
|
+
return this.t.request("GET", "/alerts/shares");
|
|
968
|
+
}
|
|
969
|
+
acknowledge(alertId) {
|
|
970
|
+
return this.t.request("POST", `/alerts/shares/${alertId}/ack`);
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
var AlertRoutesResource = class {
|
|
974
|
+
constructor(t) {
|
|
975
|
+
this.t = t;
|
|
976
|
+
}
|
|
977
|
+
t;
|
|
978
|
+
list() {
|
|
979
|
+
return this.t.request("GET", "/alerts/routes");
|
|
980
|
+
}
|
|
981
|
+
create(input) {
|
|
982
|
+
return this.t.request("POST", "/alerts/routes", { json: input });
|
|
983
|
+
}
|
|
984
|
+
update(routeId, patch) {
|
|
985
|
+
return this.t.request("PATCH", `/alerts/routes/${routeId}`, { json: patch });
|
|
986
|
+
}
|
|
987
|
+
delete(routeId) {
|
|
988
|
+
return this.t.request("DELETE", `/alerts/routes/${routeId}`);
|
|
989
|
+
}
|
|
990
|
+
silence(routeId, minutes) {
|
|
991
|
+
return this.t.request("POST", `/alerts/routes/${routeId}/silence`, { json: { minutes } });
|
|
992
|
+
}
|
|
993
|
+
unsilence(routeId) {
|
|
994
|
+
return this.silence(routeId, 0);
|
|
995
|
+
}
|
|
996
|
+
silenceState(routeId) {
|
|
997
|
+
return this.t.request("GET", `/alerts/routes/${routeId}/silence`);
|
|
998
|
+
}
|
|
999
|
+
async kinds() {
|
|
1000
|
+
const payload = await this.t.request("GET", "/alerts/routes/kinds");
|
|
1001
|
+
return payload.kinds ?? [];
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
var AlertInboxResource = class {
|
|
1005
|
+
constructor(t) {
|
|
1006
|
+
this.t = t;
|
|
1007
|
+
}
|
|
1008
|
+
t;
|
|
1009
|
+
list(opts = {}) {
|
|
1010
|
+
return this.t.request("GET", "/alerts/inbox", {
|
|
1011
|
+
params: {
|
|
1012
|
+
kinds: opts.kinds?.join(","),
|
|
1013
|
+
severities: opts.severities?.join(","),
|
|
1014
|
+
status: opts.status,
|
|
1015
|
+
limit: opts.limit,
|
|
1016
|
+
offset: opts.offset
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
async countPending() {
|
|
1021
|
+
const payload = await this.t.request("GET", "/alerts/count_pending");
|
|
1022
|
+
return payload.count ?? 0;
|
|
1023
|
+
}
|
|
1024
|
+
acknowledge(alertId) {
|
|
1025
|
+
return this.t.request("POST", `/alerts/${alertId}/acknowledge`);
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
var AlertsResource = class {
|
|
1029
|
+
constructor(t) {
|
|
1030
|
+
this.t = t;
|
|
1031
|
+
this.feeds = new AlertFeedsResource(t);
|
|
1032
|
+
this.watches = new AlertWatchesResource(t);
|
|
1033
|
+
this.geofences = new AlertGeofencesResource(t);
|
|
1034
|
+
this.shares = new AlertSharesResource(t);
|
|
1035
|
+
this.routes = new AlertRoutesResource(t);
|
|
1036
|
+
this.inbox = new AlertInboxResource(t);
|
|
1037
|
+
}
|
|
1038
|
+
t;
|
|
1039
|
+
feeds;
|
|
1040
|
+
watches;
|
|
1041
|
+
geofences;
|
|
1042
|
+
shares;
|
|
1043
|
+
routes;
|
|
1044
|
+
inbox;
|
|
1045
|
+
escalate(alertId) {
|
|
1046
|
+
return this.t.request("POST", `/alerts/escalate/${alertId}`);
|
|
1047
|
+
}
|
|
1048
|
+
channels() {
|
|
1049
|
+
return this.t.request("GET", "/alerts/channels");
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1052
|
+
var AlarmsResource = class {
|
|
1053
|
+
constructor(t) {
|
|
1054
|
+
this.t = t;
|
|
1055
|
+
}
|
|
1056
|
+
t;
|
|
1057
|
+
list() {
|
|
1058
|
+
return this.t.request("GET", "/platform/v26/alarms");
|
|
1059
|
+
}
|
|
1060
|
+
/** `node_id` XOR `node_type`; operator ∈ gt|gte|lt|lte|eq|ne. */
|
|
1061
|
+
create(input) {
|
|
1062
|
+
return this.t.request("POST", "/platform/v26/alarms", { json: input });
|
|
1063
|
+
}
|
|
1064
|
+
update(ruleId, patch) {
|
|
1065
|
+
return this.t.request("PUT", `/platform/v26/alarms/${encodeURIComponent(ruleId)}`, {
|
|
1066
|
+
json: patch
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
delete(ruleId) {
|
|
1070
|
+
return this.t.request("DELETE", `/platform/v26/alarms/${encodeURIComponent(ruleId)}`);
|
|
1071
|
+
}
|
|
1072
|
+
events(opts = {}) {
|
|
1073
|
+
return this.t.request("GET", "/platform/v26/alarms/events", { params: opts });
|
|
1074
|
+
}
|
|
1075
|
+
};
|
|
1076
|
+
var EventsResource = class {
|
|
1077
|
+
constructor(t) {
|
|
1078
|
+
this.t = t;
|
|
1079
|
+
}
|
|
1080
|
+
t;
|
|
1081
|
+
pipelineStatus() {
|
|
1082
|
+
return this.t.request("GET", "/api/v1/events/pipeline/status");
|
|
1083
|
+
}
|
|
1084
|
+
dlqList(limit = 50) {
|
|
1085
|
+
return this.t.request("GET", "/api/v1/events/pipeline/dlq", { params: { limit } });
|
|
1086
|
+
}
|
|
1087
|
+
/** Exactly one of `ids` / `all` is required. */
|
|
1088
|
+
dlqRetry(opts) {
|
|
1089
|
+
assertIdsXorAll(opts);
|
|
1090
|
+
return this.t.request("POST", "/api/v1/events/pipeline/dlq/retry", { json: opts });
|
|
1091
|
+
}
|
|
1092
|
+
/** Exactly one of `ids` / `all` is required. */
|
|
1093
|
+
dlqPurge(opts) {
|
|
1094
|
+
assertIdsXorAll(opts);
|
|
1095
|
+
return this.t.request("POST", "/api/v1/events/pipeline/dlq/purge", { json: opts });
|
|
679
1096
|
}
|
|
680
1097
|
};
|
|
1098
|
+
function assertIdsXorAll(opts) {
|
|
1099
|
+
const hasIds = !!opts.ids?.length;
|
|
1100
|
+
if (hasIds === !!opts.all) throw new Error("pass exactly one of ids or all");
|
|
1101
|
+
}
|
|
1102
|
+
var ConnectorsResource = class {
|
|
1103
|
+
constructor(t) {
|
|
1104
|
+
this.t = t;
|
|
1105
|
+
}
|
|
1106
|
+
t;
|
|
1107
|
+
list() {
|
|
1108
|
+
return this.t.request("GET", "/governance/agents");
|
|
1109
|
+
}
|
|
1110
|
+
patch(agentId, patch) {
|
|
1111
|
+
const body = Object.fromEntries(Object.entries(patch).filter(([, v]) => v !== void 0));
|
|
1112
|
+
if (Object.keys(body).length === 0) throw new Error("empty patch");
|
|
1113
|
+
return this.t.request("PATCH", `/governance/agents/${agentId}`, { json: body });
|
|
1114
|
+
}
|
|
1115
|
+
/** status ∈ inactive|active|running|degraded|failed */
|
|
1116
|
+
setStatus(agentId, status) {
|
|
1117
|
+
return this.patch(agentId, { status });
|
|
1118
|
+
}
|
|
1119
|
+
bindings(agentId) {
|
|
1120
|
+
return this.t.request("GET", `/governance/agents/${agentId}/skills`);
|
|
1121
|
+
}
|
|
1122
|
+
/** Two calls: creates the worker agent, then binds the `connector.http` skill. */
|
|
1123
|
+
async register(input) {
|
|
1124
|
+
const agent = await this.t.request("POST", "/governance/agents", {
|
|
1125
|
+
json: {
|
|
1126
|
+
slug: input.slug,
|
|
1127
|
+
display_name: input.display_name,
|
|
1128
|
+
kind: "worker",
|
|
1129
|
+
config: input.cron_preset ? { cron_preset: input.cron_preset } : {}
|
|
1130
|
+
}
|
|
1131
|
+
});
|
|
1132
|
+
await this.t.request("POST", `/governance/agents/${agent.id}/skills`, {
|
|
1133
|
+
json: {
|
|
1134
|
+
skill_key: "connector.http",
|
|
1135
|
+
config: {
|
|
1136
|
+
base_url: input.base_url,
|
|
1137
|
+
path: input.path ?? "",
|
|
1138
|
+
node_type: input.node_type,
|
|
1139
|
+
id_field: input.id_field,
|
|
1140
|
+
name_field: input.name_field ?? "",
|
|
1141
|
+
records_path: input.records_path ?? "",
|
|
1142
|
+
auth: input.auth,
|
|
1143
|
+
pagination: input.pagination
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
return agent;
|
|
1148
|
+
}
|
|
1149
|
+
test(agentId) {
|
|
1150
|
+
return this.t.request("POST", `/governance/agents/${agentId}/skills/connector.http/test`);
|
|
1151
|
+
}
|
|
1152
|
+
run(agentId) {
|
|
1153
|
+
return this.t.request("POST", `/governance/agents/${agentId}/run`, {
|
|
1154
|
+
json: { skill_key: "connector.http" }
|
|
1155
|
+
});
|
|
1156
|
+
}
|
|
1157
|
+
schedulerTick() {
|
|
1158
|
+
return this.t.request("POST", "/governance/agents/scheduler/tick");
|
|
1159
|
+
}
|
|
1160
|
+
/** source ∈ native|clawhub */
|
|
1161
|
+
skillCatalog(source) {
|
|
1162
|
+
return this.t.request("GET", "/governance/agents/skills", { params: { source } });
|
|
1163
|
+
}
|
|
1164
|
+
installOpenclaw(slug) {
|
|
1165
|
+
return this.t.request("POST", "/governance/agents/skills/openclaw/install", {
|
|
1166
|
+
json: { slug: slug.replace(/^openclaw:/, "") }
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
refreshOpenclaw() {
|
|
1170
|
+
return this.t.request("POST", "/governance/agents/skills/openclaw/refresh");
|
|
1171
|
+
}
|
|
1172
|
+
};
|
|
1173
|
+
var PipelinesResource = class {
|
|
1174
|
+
constructor(t) {
|
|
1175
|
+
this.t = t;
|
|
1176
|
+
}
|
|
1177
|
+
t;
|
|
1178
|
+
list() {
|
|
1179
|
+
return this.t.request("GET", "/platform/v22/pipelines");
|
|
1180
|
+
}
|
|
1181
|
+
transformPreview(sampleRows, steps) {
|
|
1182
|
+
return this.t.request("POST", "/platform/v23/pipeline/transform/preview", {
|
|
1183
|
+
json: { sample_rows: sampleRows, steps }
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
dryRun(boardId) {
|
|
1187
|
+
return this.t.request("POST", `/platform/v23/pipeline/${boardId}/dry-run`);
|
|
1188
|
+
}
|
|
1189
|
+
syncPreview(format, opts = {}) {
|
|
1190
|
+
const body = { format };
|
|
1191
|
+
for (const [k, v] of Object.entries(opts)) if (v !== void 0) body[k] = v;
|
|
1192
|
+
return this.t.request("POST", "/platform/v23/pipeline/sync/preview", { json: body });
|
|
1193
|
+
}
|
|
1194
|
+
create(input) {
|
|
1195
|
+
return this.t.request("POST", "/platform/v22/pipelines", { json: input });
|
|
1196
|
+
}
|
|
1197
|
+
update(pipelineId, patch) {
|
|
1198
|
+
return this.t.request("PUT", `/platform/v22/pipelines/${pipelineId}`, { json: patch });
|
|
1199
|
+
}
|
|
1200
|
+
setSchedule(pipelineId, preset) {
|
|
1201
|
+
return this.update(pipelineId, { schedule_preset: preset || "" });
|
|
1202
|
+
}
|
|
1203
|
+
build(pipelineId, opts = {}) {
|
|
1204
|
+
return this.t.request("POST", `/platform/v22/pipelines/${pipelineId}/build`, {
|
|
1205
|
+
params: {
|
|
1206
|
+
incremental: String(opts.incremental ?? false),
|
|
1207
|
+
branch: opts.branch ?? "main"
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
runs(pipelineId, limit = 50) {
|
|
1212
|
+
return this.t.request("GET", `/platform/v22/pipelines/${pipelineId}/runs`, {
|
|
1213
|
+
params: { limit }
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
};
|
|
1217
|
+
var ChatChannelsResource = class {
|
|
1218
|
+
constructor(t) {
|
|
1219
|
+
this.t = t;
|
|
1220
|
+
}
|
|
1221
|
+
t;
|
|
1222
|
+
list() {
|
|
1223
|
+
return this.t.request("GET", "/chat/channels");
|
|
1224
|
+
}
|
|
1225
|
+
get(channelId) {
|
|
1226
|
+
return this.t.request("GET", `/chat/channels/${channelId}`);
|
|
1227
|
+
}
|
|
1228
|
+
create(input) {
|
|
1229
|
+
const body = Object.fromEntries(Object.entries(input).filter(([, v]) => v !== void 0));
|
|
1230
|
+
return this.t.request("POST", "/chat/channels", { json: body });
|
|
1231
|
+
}
|
|
1232
|
+
patch(channelId, payload) {
|
|
1233
|
+
return this.t.request("PATCH", `/chat/channels/${channelId}`, { json: payload });
|
|
1234
|
+
}
|
|
1235
|
+
delete(channelId) {
|
|
1236
|
+
return this.t.request("DELETE", `/chat/channels/${channelId}`);
|
|
1237
|
+
}
|
|
1238
|
+
};
|
|
1239
|
+
var ChatMessagesResource = class {
|
|
1240
|
+
constructor(t) {
|
|
1241
|
+
this.t = t;
|
|
1242
|
+
}
|
|
1243
|
+
t;
|
|
1244
|
+
list(channelId, opts = {}) {
|
|
1245
|
+
return this.t.request("GET", `/chat/channels/${channelId}/messages`, { params: opts });
|
|
1246
|
+
}
|
|
1247
|
+
send(channelId, body, opts = {}) {
|
|
1248
|
+
return this.t.request("POST", `/chat/channels/${channelId}/messages`, {
|
|
1249
|
+
json: { body, classification: opts.classification ?? "U", embeds: opts.embeds }
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
var ChatResource = class {
|
|
1254
|
+
channels;
|
|
1255
|
+
messages;
|
|
1256
|
+
constructor(t) {
|
|
1257
|
+
this.channels = new ChatChannelsResource(t);
|
|
1258
|
+
this.messages = new ChatMessagesResource(t);
|
|
1259
|
+
}
|
|
1260
|
+
};
|
|
1261
|
+
var NotepadResource = class {
|
|
1262
|
+
constructor(t) {
|
|
1263
|
+
this.t = t;
|
|
1264
|
+
}
|
|
1265
|
+
t;
|
|
1266
|
+
list() {
|
|
1267
|
+
return this.t.request("GET", "/platform/v23/notepad");
|
|
1268
|
+
}
|
|
1269
|
+
get(docId) {
|
|
1270
|
+
return this.t.request("GET", `/platform/v23/notepad/${encodeURIComponent(docId)}`);
|
|
1271
|
+
}
|
|
1272
|
+
create(input) {
|
|
1273
|
+
return this.t.request("POST", "/platform/v23/notepad", { json: input });
|
|
1274
|
+
}
|
|
1275
|
+
/** Mirrors Python: all keys are sent (null = unchanged server-side). */
|
|
1276
|
+
update(docId, patch) {
|
|
1277
|
+
return this.t.request("PUT", `/platform/v23/notepad/${encodeURIComponent(docId)}`, {
|
|
1278
|
+
json: {
|
|
1279
|
+
title: patch.title ?? null,
|
|
1280
|
+
body_md: patch.body_md ?? null,
|
|
1281
|
+
markings: patch.markings ?? null,
|
|
1282
|
+
pinned: patch.pinned ?? null
|
|
1283
|
+
}
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
delete(docId) {
|
|
1287
|
+
return this.t.request("DELETE", `/platform/v23/notepad/${encodeURIComponent(docId)}`);
|
|
1288
|
+
}
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
// src/resources/governance.ts
|
|
1292
|
+
var LineageResource = class {
|
|
1293
|
+
constructor(t) {
|
|
1294
|
+
this.t = t;
|
|
1295
|
+
}
|
|
1296
|
+
t;
|
|
1297
|
+
graph(opts = {}) {
|
|
1298
|
+
return this.t.request("GET", "/platform/v23/lineage-graph", { params: opts });
|
|
1299
|
+
}
|
|
1300
|
+
events(opts = {}) {
|
|
1301
|
+
return this.t.request("GET", "/lineage/events", { params: opts });
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
var AccessAuditResource = class {
|
|
1305
|
+
constructor(t) {
|
|
1306
|
+
this.t = t;
|
|
1307
|
+
}
|
|
1308
|
+
t;
|
|
1309
|
+
list(opts = {}) {
|
|
1310
|
+
return this.t.request("GET", "/governance/access-audit", { params: opts });
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
1313
|
+
var MarkingCategoriesResource = class {
|
|
1314
|
+
constructor(t) {
|
|
1315
|
+
this.t = t;
|
|
1316
|
+
}
|
|
1317
|
+
t;
|
|
1318
|
+
list(opts = {}) {
|
|
1319
|
+
return this.t.request("GET", "/markings/categories", { params: opts });
|
|
1320
|
+
}
|
|
1321
|
+
create(input) {
|
|
1322
|
+
return this.t.request("POST", "/markings/categories", { json: input });
|
|
1323
|
+
}
|
|
1324
|
+
};
|
|
1325
|
+
var MarkingsResource = class {
|
|
1326
|
+
constructor(t) {
|
|
1327
|
+
this.t = t;
|
|
1328
|
+
this.categories = new MarkingCategoriesResource(t);
|
|
1329
|
+
}
|
|
1330
|
+
t;
|
|
1331
|
+
categories;
|
|
1332
|
+
list(opts = {}) {
|
|
1333
|
+
return this.t.request("GET", "/markings", { params: opts });
|
|
1334
|
+
}
|
|
1335
|
+
get(markingId) {
|
|
1336
|
+
return this.t.request("GET", `/markings/${markingId}`);
|
|
1337
|
+
}
|
|
1338
|
+
create(input) {
|
|
1339
|
+
return this.t.request("POST", "/markings", { json: input });
|
|
1340
|
+
}
|
|
1341
|
+
update(markingId, patch) {
|
|
1342
|
+
return this.t.request("PATCH", `/markings/${markingId}`, { json: patch });
|
|
1343
|
+
}
|
|
1344
|
+
listEligibility(markingId) {
|
|
1345
|
+
return this.t.request("GET", `/markings/${markingId}/eligibility`);
|
|
1346
|
+
}
|
|
1347
|
+
grantEligibility(markingId, userId, canApply = false) {
|
|
1348
|
+
return this.t.request("POST", `/markings/${markingId}/eligibility`, {
|
|
1349
|
+
json: { user_id: userId, can_apply: canApply }
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
revokeEligibility(markingId, userId) {
|
|
1353
|
+
return this.t.request("DELETE", `/markings/${markingId}/eligibility/${userId}`);
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
var ResourceMarkingsResource = class {
|
|
1357
|
+
constructor(t) {
|
|
1358
|
+
this.t = t;
|
|
1359
|
+
}
|
|
1360
|
+
t;
|
|
1361
|
+
list(resourceKind, resourceId) {
|
|
1362
|
+
return this.t.request("GET", `/resources/${resourceKind}/${resourceId}/markings`);
|
|
1363
|
+
}
|
|
1364
|
+
apply(resourceKind, resourceId, markingId) {
|
|
1365
|
+
return this.t.request("POST", `/resources/${resourceKind}/${resourceId}/markings`, {
|
|
1366
|
+
json: { marking_id: markingId }
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
remove(resourceKind, resourceId, markingId) {
|
|
1370
|
+
return this.t.request(
|
|
1371
|
+
"DELETE",
|
|
1372
|
+
`/resources/${resourceKind}/${resourceId}/markings/${markingId}`
|
|
1373
|
+
);
|
|
1374
|
+
}
|
|
1375
|
+
};
|
|
1376
|
+
var PropertyMarkingsResource = class {
|
|
1377
|
+
constructor(t) {
|
|
1378
|
+
this.t = t;
|
|
1379
|
+
}
|
|
1380
|
+
t;
|
|
1381
|
+
listForNode(nodeId) {
|
|
1382
|
+
return this.t.request("GET", `/ontology/nodes/${nodeId}/property-markings`);
|
|
1383
|
+
}
|
|
1384
|
+
listOne(nodeId, propertyKey) {
|
|
1385
|
+
return this.t.request("GET", `/ontology/nodes/${nodeId}/properties/${propertyKey}/markings`);
|
|
1386
|
+
}
|
|
1387
|
+
apply(nodeId, propertyKey, markingId) {
|
|
1388
|
+
return this.t.request("POST", `/ontology/nodes/${nodeId}/properties/${propertyKey}/markings`, {
|
|
1389
|
+
json: { marking_id: markingId }
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
remove(nodeId, propertyKey, markingId) {
|
|
1393
|
+
return this.t.request(
|
|
1394
|
+
"DELETE",
|
|
1395
|
+
`/ontology/nodes/${nodeId}/properties/${propertyKey}/markings/${markingId}`
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
var RowPoliciesResource = class {
|
|
1400
|
+
constructor(t) {
|
|
1401
|
+
this.t = t;
|
|
1402
|
+
}
|
|
1403
|
+
t;
|
|
1404
|
+
list() {
|
|
1405
|
+
return this.t.request("GET", "/platform/v26/row-policies");
|
|
1406
|
+
}
|
|
1407
|
+
create(input) {
|
|
1408
|
+
return this.t.request("POST", "/platform/v26/row-policies", { json: input });
|
|
1409
|
+
}
|
|
1410
|
+
delete(policyId) {
|
|
1411
|
+
return this.t.request("DELETE", `/platform/v26/row-policies/${encodeURIComponent(policyId)}`);
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
var ErasureResource = class {
|
|
1415
|
+
constructor(t) {
|
|
1416
|
+
this.t = t;
|
|
1417
|
+
}
|
|
1418
|
+
t;
|
|
1419
|
+
/** Dry-run: shows the match radius without mutating anything. */
|
|
1420
|
+
preview(selector) {
|
|
1421
|
+
return this.t.request("POST", "/governance/erasure/preview", { json: selector });
|
|
1422
|
+
}
|
|
1423
|
+
/** Requires `confirm: true`; pass `expected_count` to guard the radius (422 on mismatch). */
|
|
1424
|
+
forget(selector, opts = {}) {
|
|
1425
|
+
return this.t.request("POST", "/governance/erasure/forget", { json: { ...selector, ...opts } });
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
var RetentionResource = class {
|
|
1429
|
+
constructor(t) {
|
|
1430
|
+
this.t = t;
|
|
1431
|
+
}
|
|
1432
|
+
t;
|
|
1433
|
+
list() {
|
|
1434
|
+
return this.t.request("GET", "/governance/retention");
|
|
1435
|
+
}
|
|
1436
|
+
set(target, retentionDays, active = true) {
|
|
1437
|
+
return this.t.request("PUT", "/governance/retention", {
|
|
1438
|
+
json: { target, retention_days: retentionDays, active }
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
delete(target) {
|
|
1442
|
+
return this.t.request("DELETE", `/governance/retention/${encodeURIComponent(target)}`);
|
|
1443
|
+
}
|
|
1444
|
+
run(target) {
|
|
1445
|
+
return this.t.request("POST", `/governance/retention/${encodeURIComponent(target)}/run`);
|
|
1446
|
+
}
|
|
1447
|
+
};
|
|
1448
|
+
var GuestTokensResource = class {
|
|
1449
|
+
constructor(t) {
|
|
1450
|
+
this.t = t;
|
|
1451
|
+
}
|
|
1452
|
+
t;
|
|
1453
|
+
list() {
|
|
1454
|
+
return this.t.request("GET", "/platform/v23/guest-tokens");
|
|
1455
|
+
}
|
|
1456
|
+
/** Plaintext token appears once in the response — treat as a secret. */
|
|
1457
|
+
issue(input) {
|
|
1458
|
+
return this.t.request("POST", "/platform/v23/guest-tokens", { json: input });
|
|
1459
|
+
}
|
|
1460
|
+
revoke(tokenId) {
|
|
1461
|
+
return this.t.request("POST", `/platform/v23/guest-tokens/${tokenId}/revoke`);
|
|
1462
|
+
}
|
|
1463
|
+
};
|
|
1464
|
+
|
|
1465
|
+
// src/resources/platform.ts
|
|
1466
|
+
var WorkshopBriefingsResource = class {
|
|
1467
|
+
constructor(t) {
|
|
1468
|
+
this.t = t;
|
|
1469
|
+
}
|
|
1470
|
+
t;
|
|
1471
|
+
list() {
|
|
1472
|
+
return this.t.request("GET", "/workshop/apps", { params: { kind: "briefing" } });
|
|
1473
|
+
}
|
|
1474
|
+
get(briefingId) {
|
|
1475
|
+
return this.t.request("GET", `/workshop/apps/${briefingId}`);
|
|
1476
|
+
}
|
|
1477
|
+
create(name) {
|
|
1478
|
+
return this.t.request("POST", "/workshop/apps", { json: { name, kind: "briefing" } });
|
|
1479
|
+
}
|
|
1480
|
+
patch(briefingId, payload) {
|
|
1481
|
+
return this.t.request("PATCH", `/workshop/apps/${briefingId}`, { json: payload });
|
|
1482
|
+
}
|
|
1483
|
+
broadcast(briefingId) {
|
|
1484
|
+
return this.t.request("POST", `/workshop/briefings/${briefingId}/broadcast`);
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
var WorkshopDossiersResource = class {
|
|
1488
|
+
constructor(t) {
|
|
1489
|
+
this.t = t;
|
|
1490
|
+
}
|
|
1491
|
+
t;
|
|
1492
|
+
list() {
|
|
1493
|
+
return this.t.request("GET", "/workshop/dossiers");
|
|
1494
|
+
}
|
|
1495
|
+
get(dossierId) {
|
|
1496
|
+
return this.t.request("GET", `/workshop/dossiers/${dossierId}`);
|
|
1497
|
+
}
|
|
1498
|
+
create(title) {
|
|
1499
|
+
return this.t.request("POST", "/workshop/dossiers", { json: { title } });
|
|
1500
|
+
}
|
|
1501
|
+
patch(dossierId, body) {
|
|
1502
|
+
return this.t.request("PATCH", `/workshop/dossiers/${dossierId}`, { json: body });
|
|
1503
|
+
}
|
|
1504
|
+
delete(dossierId) {
|
|
1505
|
+
return this.t.request("DELETE", `/workshop/dossiers/${dossierId}`);
|
|
1506
|
+
}
|
|
1507
|
+
addEmbed(dossierId, kind, sourceRef, nodeId) {
|
|
1508
|
+
return this.t.request("POST", `/workshop/dossiers/${dossierId}/embeds`, {
|
|
1509
|
+
json: { embed_kind: kind, source_ref: sourceRef, node_id: nodeId }
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
embeds(dossierId) {
|
|
1513
|
+
return this.t.request("GET", `/workshop/dossiers/${dossierId}/embeds`);
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
var WorkshopCovsResource = class {
|
|
1517
|
+
constructor(t) {
|
|
1518
|
+
this.t = t;
|
|
1519
|
+
}
|
|
1520
|
+
t;
|
|
1521
|
+
list(objectType) {
|
|
1522
|
+
return this.t.request("GET", "/workshop/covs", { params: { object_type: objectType } });
|
|
1523
|
+
}
|
|
1524
|
+
get(covId) {
|
|
1525
|
+
return this.t.request("GET", `/workshop/covs/${covId}`);
|
|
1526
|
+
}
|
|
1527
|
+
/** Full-object upsert. */
|
|
1528
|
+
save(cov) {
|
|
1529
|
+
return this.t.request("POST", "/workshop/covs", { json: cov });
|
|
1530
|
+
}
|
|
1531
|
+
delete(covId) {
|
|
1532
|
+
return this.t.request("DELETE", `/workshop/covs/${covId}`);
|
|
1533
|
+
}
|
|
1534
|
+
setTeamDefault(covId) {
|
|
1535
|
+
return this.t.request("POST", `/workshop/covs/${covId}/set-team-default`);
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1538
|
+
var WorkshopResource = class {
|
|
1539
|
+
constructor(t) {
|
|
1540
|
+
this.t = t;
|
|
1541
|
+
this.briefings = new WorkshopBriefingsResource(t);
|
|
1542
|
+
this.dossiers = new WorkshopDossiersResource(t);
|
|
1543
|
+
this.covs = new WorkshopCovsResource(t);
|
|
1544
|
+
}
|
|
1545
|
+
t;
|
|
1546
|
+
briefings;
|
|
1547
|
+
dossiers;
|
|
1548
|
+
covs;
|
|
1549
|
+
widgetCatalog(proposableOnly = false) {
|
|
1550
|
+
return this.t.request("GET", "/workshop/widget-catalog", {
|
|
1551
|
+
params: proposableOnly ? { proposable_only: "true" } : {}
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
var ComputeProvidersResource = class {
|
|
1556
|
+
constructor(t) {
|
|
1557
|
+
this.t = t;
|
|
1558
|
+
}
|
|
1559
|
+
t;
|
|
1560
|
+
catalog() {
|
|
1561
|
+
return this.t.request("GET", "/compute/providers/catalog");
|
|
1562
|
+
}
|
|
1563
|
+
list() {
|
|
1564
|
+
return this.t.request("GET", "/compute/providers");
|
|
1565
|
+
}
|
|
1566
|
+
/** `api_key` is write-only — never returned by the API. */
|
|
1567
|
+
create(input) {
|
|
1568
|
+
return this.t.request("POST", "/compute/providers", { json: input });
|
|
1569
|
+
}
|
|
1570
|
+
update(providerId, patch) {
|
|
1571
|
+
const body = Object.fromEntries(Object.entries(patch).filter(([, v]) => v !== void 0));
|
|
1572
|
+
return this.t.request("PUT", `/compute/providers/${providerId}`, { json: body });
|
|
1573
|
+
}
|
|
1574
|
+
delete(providerId) {
|
|
1575
|
+
return this.t.request("DELETE", `/compute/providers/${providerId}`);
|
|
1576
|
+
}
|
|
1577
|
+
test(providerId) {
|
|
1578
|
+
return this.t.request("POST", `/compute/providers/${providerId}/test`);
|
|
1579
|
+
}
|
|
1580
|
+
};
|
|
1581
|
+
var ComputeReleasesResource = class {
|
|
1582
|
+
constructor(t) {
|
|
1583
|
+
this.t = t;
|
|
1584
|
+
}
|
|
1585
|
+
t;
|
|
1586
|
+
list(name) {
|
|
1587
|
+
return this.t.request("GET", "/compute/releases", { params: { name } });
|
|
1588
|
+
}
|
|
1589
|
+
publish(input) {
|
|
1590
|
+
return this.t.request("POST", "/compute/releases", { json: input });
|
|
1591
|
+
}
|
|
1592
|
+
/** 409 if `eval_score` is below the gate. */
|
|
1593
|
+
promote(name, version, minEvalScore = 0.8) {
|
|
1594
|
+
return this.t.request("POST", "/compute/releases/promote", {
|
|
1595
|
+
json: { name, version, min_eval_score: minEvalScore }
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
deploy(providerId, name, channel = "production", extra = {}) {
|
|
1599
|
+
return this.t.request("POST", `/compute/providers/${providerId}/releases/deploy`, {
|
|
1600
|
+
json: { name, channel, ...extra }
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
var ComputeControlResource = class {
|
|
1605
|
+
constructor(t, providerId) {
|
|
1606
|
+
this.t = t;
|
|
1607
|
+
this.base = `/compute/providers/${providerId}`;
|
|
1608
|
+
}
|
|
1609
|
+
t;
|
|
1610
|
+
base;
|
|
1611
|
+
listTemplates() {
|
|
1612
|
+
return this.t.request("GET", `${this.base}/templates`);
|
|
1613
|
+
}
|
|
1614
|
+
saveTemplate(name, imageName, extra = {}) {
|
|
1615
|
+
return this.t.request("POST", `${this.base}/templates`, {
|
|
1616
|
+
json: { name, image_name: imageName, ...extra }
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1619
|
+
deleteTemplate(templateId) {
|
|
1620
|
+
return this.t.request("DELETE", `${this.base}/templates/${templateId}`);
|
|
1621
|
+
}
|
|
1622
|
+
listEndpoints() {
|
|
1623
|
+
return this.t.request("GET", `${this.base}/endpoints`);
|
|
1624
|
+
}
|
|
1625
|
+
createEndpoint(templateId, name, extra = {}) {
|
|
1626
|
+
return this.t.request("POST", `${this.base}/endpoints`, {
|
|
1627
|
+
json: { template_id: templateId, name, ...extra }
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
updateEndpoint(endpointId, patch) {
|
|
1631
|
+
return this.t.request("PATCH", `${this.base}/endpoints/${endpointId}`, {
|
|
1632
|
+
json: { patch }
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
deleteEndpoint(endpointId) {
|
|
1636
|
+
return this.t.request("DELETE", `${this.base}/endpoints/${endpointId}`);
|
|
1637
|
+
}
|
|
1638
|
+
endpointHealth(endpointId) {
|
|
1639
|
+
return this.t.request("GET", `${this.base}/endpoints/${endpointId}/health`);
|
|
1640
|
+
}
|
|
1641
|
+
/** `sync: true` long-polls server-side up to `timeout_s` — pass a matching
|
|
1642
|
+
* `signal` (or raise the client `timeoutMs`) for long jobs. */
|
|
1643
|
+
submitJob(endpointId, input, opts = {}) {
|
|
1644
|
+
return this.t.request("POST", `${this.base}/endpoints/${endpointId}/jobs`, {
|
|
1645
|
+
json: { input, sync: opts.sync ?? false, webhook: opts.webhook, timeout_s: opts.timeout_s }
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
jobStatus(endpointId, jobId) {
|
|
1649
|
+
return this.t.request("GET", `${this.base}/endpoints/${endpointId}/jobs/${jobId}`);
|
|
1650
|
+
}
|
|
1651
|
+
cancelJob(endpointId, jobId) {
|
|
1652
|
+
return this.t.request("POST", `${this.base}/endpoints/${endpointId}/jobs/${jobId}/cancel`);
|
|
1653
|
+
}
|
|
1654
|
+
listPods() {
|
|
1655
|
+
return this.t.request("GET", `${this.base}/pods`);
|
|
1656
|
+
}
|
|
1657
|
+
createPod(name, imageName, extra = {}) {
|
|
1658
|
+
return this.t.request("POST", `${this.base}/pods`, {
|
|
1659
|
+
json: { name, image_name: imageName, ...extra }
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
stopPod(podId) {
|
|
1663
|
+
return this.t.request("POST", `${this.base}/pods/${podId}/stop`);
|
|
1664
|
+
}
|
|
1665
|
+
terminatePod(podId) {
|
|
1666
|
+
return this.t.request("DELETE", `${this.base}/pods/${podId}`);
|
|
1667
|
+
}
|
|
1668
|
+
};
|
|
1669
|
+
var ComputeResource = class {
|
|
1670
|
+
constructor(t) {
|
|
1671
|
+
this.t = t;
|
|
1672
|
+
this.providers = new ComputeProvidersResource(t);
|
|
1673
|
+
this.releases = new ComputeReleasesResource(t);
|
|
1674
|
+
}
|
|
1675
|
+
t;
|
|
1676
|
+
providers;
|
|
1677
|
+
releases;
|
|
1678
|
+
selectModel(objective, opts = {}) {
|
|
1679
|
+
return this.t.request("POST", "/compute/vision/select-model", {
|
|
1680
|
+
json: { objective, ...opts }
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1683
|
+
generateSpec(objective, opts = {}) {
|
|
1684
|
+
return this.t.request("POST", "/compute/spec/generate", {
|
|
1685
|
+
json: { objective, base_image: opts.base_image ?? "python:3.11-slim", ...opts }
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
visionCount(imageUrl, instruction, opts = {}) {
|
|
1689
|
+
return this.t.request("POST", "/compute/vision/count", {
|
|
1690
|
+
json: { image_url: imageUrl, instruction, ...opts }
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
/** Factory (no HTTP) — control plane scoped to one provider. */
|
|
1694
|
+
control(providerId) {
|
|
1695
|
+
return new ComputeControlResource(this.t, providerId);
|
|
1696
|
+
}
|
|
1697
|
+
};
|
|
1698
|
+
var InferenceResource = class {
|
|
1699
|
+
constructor(t) {
|
|
1700
|
+
this.t = t;
|
|
1701
|
+
}
|
|
1702
|
+
t;
|
|
1703
|
+
complete(prompt, opts = {}) {
|
|
1704
|
+
return this.t.request("POST", "/inference/complete", {
|
|
1705
|
+
json: {
|
|
1706
|
+
prompt,
|
|
1707
|
+
provider: opts.provider ?? "groq",
|
|
1708
|
+
model: opts.model ?? "llama-3.3-70b-versatile",
|
|
1709
|
+
system_prompt: opts.system_prompt,
|
|
1710
|
+
temperature: opts.temperature ?? 0,
|
|
1711
|
+
max_tokens: opts.max_tokens ?? 4096
|
|
1712
|
+
}
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
chat(messages, opts = {}) {
|
|
1716
|
+
const body = {
|
|
1717
|
+
messages,
|
|
1718
|
+
provider: opts.provider ?? "groq",
|
|
1719
|
+
model: opts.model ?? "llama-3.3-70b-versatile",
|
|
1720
|
+
temperature: opts.temperature ?? 0,
|
|
1721
|
+
max_tokens: opts.max_tokens ?? 4096
|
|
1722
|
+
};
|
|
1723
|
+
if (opts.rag_sources) {
|
|
1724
|
+
body.rag_sources = opts.rag_sources;
|
|
1725
|
+
body.rag_limit = opts.rag_limit ?? 5;
|
|
1726
|
+
}
|
|
1727
|
+
return this.t.request("POST", "/inference/chat", { json: body });
|
|
1728
|
+
}
|
|
1729
|
+
models() {
|
|
1730
|
+
return this.t.request("GET", "/inference/models");
|
|
1731
|
+
}
|
|
1732
|
+
collections() {
|
|
1733
|
+
return this.t.request("GET", "/inference/collections");
|
|
1734
|
+
}
|
|
1735
|
+
async chatWithRag(query, opts = {}) {
|
|
1736
|
+
const payload = await this.t.request("POST", "/mcp/tools/call", {
|
|
1737
|
+
json: {
|
|
1738
|
+
name: "chat_with_rag",
|
|
1739
|
+
arguments: {
|
|
1740
|
+
query,
|
|
1741
|
+
sources: opts.sources ?? ["all"],
|
|
1742
|
+
limit: opts.limit ?? 6,
|
|
1743
|
+
provider: opts.provider ?? "groq",
|
|
1744
|
+
model: opts.model ?? "llama-3.3-70b-versatile",
|
|
1745
|
+
temperature: opts.temperature ?? 0.2,
|
|
1746
|
+
max_tokens: opts.max_tokens ?? 512,
|
|
1747
|
+
system: opts.system
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
});
|
|
1751
|
+
return payload.result ?? payload;
|
|
1752
|
+
}
|
|
1753
|
+
auditTrail(opts = {}) {
|
|
1754
|
+
return this.t.request("GET", "/inference/audit-trail", {
|
|
1755
|
+
params: { limit: opts.limit ?? 50, provider: opts.provider }
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1758
|
+
};
|
|
1759
|
+
var CodegenResource = class {
|
|
1760
|
+
constructor(t) {
|
|
1761
|
+
this.t = t;
|
|
1762
|
+
}
|
|
1763
|
+
t;
|
|
1764
|
+
/** kind ∈ transform|script */
|
|
1765
|
+
generate(objective, kind = "transform", context) {
|
|
1766
|
+
return this.t.request("POST", "/codegen/generate", { json: { objective, kind, context } });
|
|
1767
|
+
}
|
|
1768
|
+
};
|
|
1769
|
+
var CorrelationResource = class {
|
|
1770
|
+
constructor(t) {
|
|
1771
|
+
this.t = t;
|
|
1772
|
+
}
|
|
1773
|
+
t;
|
|
1774
|
+
quickLinks(value, kind) {
|
|
1775
|
+
return this.t.request("POST", "/correlation/quick-links", { json: { value, kind } });
|
|
1776
|
+
}
|
|
1777
|
+
startChain(value, opts = {}) {
|
|
1778
|
+
return this.t.request("POST", "/correlation/chain", { json: { value, ...opts } });
|
|
1779
|
+
}
|
|
1780
|
+
/** Poll until `status === "done"`. */
|
|
1781
|
+
getChain(taskId) {
|
|
1782
|
+
return this.t.request("GET", `/correlation/chain/${taskId}`);
|
|
1783
|
+
}
|
|
1784
|
+
/** Opt-in: materializes the chain graph into the ontology. */
|
|
1785
|
+
saveChain(taskId, nodeIds) {
|
|
1786
|
+
return this.t.request("POST", `/correlation/chain/${taskId}/save`, {
|
|
1787
|
+
json: nodeIds ? { node_ids: nodeIds } : {}
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
};
|
|
1791
|
+
var SituationalResource = class {
|
|
1792
|
+
constructor(t) {
|
|
1793
|
+
this.t = t;
|
|
1794
|
+
}
|
|
1795
|
+
t;
|
|
1796
|
+
nearby(nodeId, opts = {}) {
|
|
1797
|
+
return this.t.request("GET", "/api/v1/situational/nearby", {
|
|
1798
|
+
params: { node_id: nodeId, ...opts, kinds: opts.kinds?.join(",") }
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
correlations(nodeId) {
|
|
1802
|
+
return this.t.request("GET", "/api/v1/situational/correlations", {
|
|
1803
|
+
params: { node_id: nodeId }
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
correlate(anchorNodeId, opts = {}) {
|
|
1807
|
+
return this.t.request("POST", "/api/v1/situational/correlations", {
|
|
1808
|
+
json: { anchor_node_id: anchorNodeId, ...opts }
|
|
1809
|
+
});
|
|
1810
|
+
}
|
|
1811
|
+
/** Reversible — removes the correlation edge. */
|
|
1812
|
+
cut(edgeId) {
|
|
1813
|
+
return this.t.request("DELETE", `/api/v1/situational/correlations/${edgeId}`);
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
var MergeResource = class {
|
|
1817
|
+
constructor(t) {
|
|
1818
|
+
this.t = t;
|
|
1819
|
+
}
|
|
1820
|
+
t;
|
|
1821
|
+
suggestTarget(nodeType, canonical) {
|
|
1822
|
+
return this.t.request("POST", "/ontology/merge/suggest-target", {
|
|
1823
|
+
json: { node_type: nodeType, canonical }
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
/** Pass `result_payload` (raw) OR `properties` (ready). */
|
|
1827
|
+
preview(target, opts = {}) {
|
|
1828
|
+
return this.t.request("POST", "/ontology/merge/preview", { json: { target, ...opts } });
|
|
1829
|
+
}
|
|
1830
|
+
/** `field_resolutions`: `{field: "keep"|"replace"|"append"}`;
|
|
1831
|
+
* `link`: `{target_object_id, relation_type, metadata?}`. */
|
|
1832
|
+
apply(target, opts = {}) {
|
|
1833
|
+
return this.t.request("POST", "/ontology/merge/apply", { json: { target, ...opts } });
|
|
1834
|
+
}
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1837
|
+
// src/resources/domain.ts
|
|
1838
|
+
var AtlasLayersResource = class {
|
|
1839
|
+
constructor(t) {
|
|
1840
|
+
this.t = t;
|
|
1841
|
+
}
|
|
1842
|
+
t;
|
|
1843
|
+
list() {
|
|
1844
|
+
return this.t.request("GET", "/atlas/layers");
|
|
1845
|
+
}
|
|
1846
|
+
create(name, kind, extra = {}) {
|
|
1847
|
+
const body = { name, kind };
|
|
1848
|
+
for (const [k, v] of Object.entries(extra)) if (v !== void 0 && v !== null) body[k] = v;
|
|
1849
|
+
return this.t.request("POST", "/atlas/layers", { json: body });
|
|
1850
|
+
}
|
|
1851
|
+
delete(layerId) {
|
|
1852
|
+
return this.t.request("DELETE", `/atlas/layers/${layerId}`);
|
|
1853
|
+
}
|
|
1854
|
+
/** KML content travels inside the JSON body (not multipart) — same as Python. */
|
|
1855
|
+
importKml(layerId, kmlText) {
|
|
1856
|
+
return this.t.request("POST", `/atlas/layers/${layerId}/import`, {
|
|
1857
|
+
json: { _kml_bytes_b64: kmlText }
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
};
|
|
1861
|
+
var AtlasEvaluationResource = class {
|
|
1862
|
+
constructor(t) {
|
|
1863
|
+
this.t = t;
|
|
1864
|
+
}
|
|
1865
|
+
t;
|
|
1866
|
+
status() {
|
|
1867
|
+
return this.t.request("GET", "/atlas/evaluation/status");
|
|
1868
|
+
}
|
|
1869
|
+
runOnce() {
|
|
1870
|
+
return this.t.request("POST", "/atlas/evaluation/run-once");
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
var AtlasResource = class {
|
|
1874
|
+
layers;
|
|
1875
|
+
evaluation;
|
|
1876
|
+
constructor(t) {
|
|
1877
|
+
this.layers = new AtlasLayersResource(t);
|
|
1878
|
+
this.evaluation = new AtlasEvaluationResource(t);
|
|
1879
|
+
}
|
|
1880
|
+
};
|
|
1881
|
+
var BriefingResource = class {
|
|
1882
|
+
constructor(t) {
|
|
1883
|
+
this.t = t;
|
|
1884
|
+
}
|
|
1885
|
+
t;
|
|
1886
|
+
get(slug) {
|
|
1887
|
+
return this.t.request("GET", `/campaign/home-briefing/${slug}`);
|
|
1888
|
+
}
|
|
1889
|
+
refresh(slug) {
|
|
1890
|
+
return this.t.request("POST", `/campaign/home-briefing/${slug}/refresh`);
|
|
1891
|
+
}
|
|
1892
|
+
crisisPlan(slug) {
|
|
1893
|
+
return this.t.request("POST", `/campaign/home-briefing/${slug}/crisis-plan`);
|
|
1894
|
+
}
|
|
1895
|
+
};
|
|
1896
|
+
var CctvBookmarksResource = class {
|
|
1897
|
+
constructor(t) {
|
|
1898
|
+
this.t = t;
|
|
1899
|
+
}
|
|
1900
|
+
t;
|
|
1901
|
+
create(streamId, input) {
|
|
1902
|
+
return this.t.request("POST", `/api/v1/cctv/streams/${streamId}/bookmarks`, { json: input });
|
|
1903
|
+
}
|
|
1904
|
+
list(streamId, opts = {}) {
|
|
1905
|
+
return this.t.request("GET", `/api/v1/cctv/streams/${streamId}/bookmarks`, { params: opts });
|
|
1906
|
+
}
|
|
1907
|
+
delete(bookmarkId) {
|
|
1908
|
+
return this.t.request("DELETE", `/api/v1/cctv/bookmarks/${bookmarkId}`);
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
var CctvGcpsResource = class {
|
|
1912
|
+
constructor(t) {
|
|
1913
|
+
this.t = t;
|
|
1914
|
+
}
|
|
1915
|
+
t;
|
|
1916
|
+
put(streamId, gcps) {
|
|
1917
|
+
return this.t.request("PUT", `/api/v1/cctv/streams/${streamId}/gcps`, { json: { gcps } });
|
|
1918
|
+
}
|
|
1919
|
+
get(streamId) {
|
|
1920
|
+
return this.t.request("GET", `/api/v1/cctv/streams/${streamId}/gcps`);
|
|
1921
|
+
}
|
|
1922
|
+
delete(streamId) {
|
|
1923
|
+
return this.t.request("DELETE", `/api/v1/cctv/streams/${streamId}/gcps`);
|
|
1924
|
+
}
|
|
1925
|
+
};
|
|
1926
|
+
var CctvHotlistResource = class {
|
|
1927
|
+
constructor(t) {
|
|
1928
|
+
this.t = t;
|
|
1929
|
+
}
|
|
1930
|
+
t;
|
|
1931
|
+
list(activeOnly) {
|
|
1932
|
+
return this.t.request("GET", "/api/v1/cctv/hotlist", { params: { active_only: activeOnly } });
|
|
1933
|
+
}
|
|
1934
|
+
add(plate, opts = {}) {
|
|
1935
|
+
return this.t.request("POST", "/api/v1/cctv/hotlist", {
|
|
1936
|
+
json: { plate, reason: opts.reason, severity: opts.severity ?? "medium" }
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
remove(watchedId) {
|
|
1940
|
+
return this.t.request("DELETE", `/api/v1/cctv/hotlist/${watchedId}`);
|
|
1941
|
+
}
|
|
1942
|
+
};
|
|
1943
|
+
var CctvResource = class {
|
|
1944
|
+
constructor(t) {
|
|
1945
|
+
this.t = t;
|
|
1946
|
+
this.bookmarks = new CctvBookmarksResource(t);
|
|
1947
|
+
this.gcps = new CctvGcpsResource(t);
|
|
1948
|
+
this.hotlist = new CctvHotlistResource(t);
|
|
1949
|
+
}
|
|
1950
|
+
t;
|
|
1951
|
+
bookmarks;
|
|
1952
|
+
gcps;
|
|
1953
|
+
hotlist;
|
|
1954
|
+
streamsPage(opts = {}) {
|
|
1955
|
+
return this.t.request("GET", "/api/v1/cctv/streams/page", { params: opts });
|
|
1956
|
+
}
|
|
1957
|
+
detections(streamId, opts = {}) {
|
|
1958
|
+
return this.t.request("GET", `/api/v1/cctv/streams/${streamId}/detections`, { params: opts });
|
|
1959
|
+
}
|
|
1960
|
+
detectorClasses() {
|
|
1961
|
+
return this.t.request("GET", "/api/v1/cctv/detector/classes");
|
|
1962
|
+
}
|
|
1963
|
+
presets() {
|
|
1964
|
+
return this.t.request("GET", "/api/v1/cctv/presets");
|
|
1965
|
+
}
|
|
1966
|
+
bridgeBackfill() {
|
|
1967
|
+
return this.t.request("POST", "/api/v1/cctv/bridge/backfill");
|
|
1968
|
+
}
|
|
1969
|
+
/** 202 — returns a provider job to poll. */
|
|
1970
|
+
detectNow(streamId, opts = {}) {
|
|
1971
|
+
return this.t.request("POST", `/api/v1/cctv/streams/${streamId}/detect-now`, { json: opts });
|
|
1972
|
+
}
|
|
1973
|
+
/** 202 — export job; poll with `exportStatus`. */
|
|
1974
|
+
exportClip(streamId, opts = {}) {
|
|
1975
|
+
return this.t.request("POST", `/api/v1/cctv/streams/${streamId}/export`, { json: opts });
|
|
1976
|
+
}
|
|
1977
|
+
exportStatus(jobId) {
|
|
1978
|
+
return this.t.request("GET", `/api/v1/cctv/exports/${jobId}`);
|
|
1979
|
+
}
|
|
1980
|
+
recordings(streamId, opts = {}) {
|
|
1981
|
+
return this.t.request("GET", `/api/v1/cctv/streams/${streamId}/recordings`, { params: opts });
|
|
1982
|
+
}
|
|
1983
|
+
recordingStatus(streamId) {
|
|
1984
|
+
return this.t.request("GET", `/api/v1/cctv/streams/${streamId}/recording`);
|
|
1985
|
+
}
|
|
1986
|
+
/** action ∈ start|stop */
|
|
1987
|
+
recordingControl(streamId, action, cadence) {
|
|
1988
|
+
return this.t.request("POST", `/api/v1/cctv/streams/${streamId}/recording`, {
|
|
1989
|
+
json: { action, cadence }
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1992
|
+
/** Returns the raw HLS VOD playlist text (m3u8), not JSON. */
|
|
1993
|
+
recordingsPlaylist(streamId, opts = {}) {
|
|
1994
|
+
return this.t.request("GET", `/api/v1/cctv/streams/${streamId}/recordings/playlist.m3u8`, {
|
|
1995
|
+
params: opts
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
};
|
|
1999
|
+
var EdgeResource = class {
|
|
2000
|
+
constructor(t) {
|
|
2001
|
+
this.t = t;
|
|
2002
|
+
}
|
|
2003
|
+
t;
|
|
2004
|
+
createPairingCode(opts = {}) {
|
|
2005
|
+
return this.t.request("POST", "/api/v1/edge/pairing-codes", { json: opts });
|
|
2006
|
+
}
|
|
2007
|
+
listNodes() {
|
|
2008
|
+
return this.t.request("GET", "/api/v1/edge/nodes");
|
|
2009
|
+
}
|
|
2010
|
+
listDiscovered() {
|
|
2011
|
+
return this.t.request("GET", "/api/v1/edge/discovered");
|
|
2012
|
+
}
|
|
2013
|
+
revoke(edgeId) {
|
|
2014
|
+
return this.t.request("POST", `/api/v1/edge/${edgeId}/revoke`);
|
|
2015
|
+
}
|
|
2016
|
+
setExpectedVersion(version) {
|
|
2017
|
+
return this.t.request("PUT", "/api/v1/edge/expected-version", { json: { version } });
|
|
2018
|
+
}
|
|
2019
|
+
getExpectedVersion() {
|
|
2020
|
+
return this.t.request("GET", "/api/v1/edge/expected-version");
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
2023
|
+
var VideoStreamsResource = class {
|
|
2024
|
+
constructor(t) {
|
|
2025
|
+
this.t = t;
|
|
2026
|
+
}
|
|
2027
|
+
t;
|
|
2028
|
+
list() {
|
|
2029
|
+
return this.t.request("GET", "/video/streams");
|
|
2030
|
+
}
|
|
2031
|
+
create(input) {
|
|
2032
|
+
return this.t.request("POST", "/video/streams", { json: input });
|
|
2033
|
+
}
|
|
2034
|
+
delete(streamId) {
|
|
2035
|
+
return this.t.request("DELETE", `/video/streams/${streamId}`);
|
|
2036
|
+
}
|
|
2037
|
+
};
|
|
2038
|
+
var VideoResource = class {
|
|
2039
|
+
constructor(t) {
|
|
2040
|
+
this.t = t;
|
|
2041
|
+
this.streams = new VideoStreamsResource(t);
|
|
2042
|
+
}
|
|
2043
|
+
t;
|
|
2044
|
+
streams;
|
|
2045
|
+
listDetections(streamId, opts = {}) {
|
|
2046
|
+
return this.t.request("GET", "/video/detections", {
|
|
2047
|
+
params: { stream_id: streamId, ...opts }
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
submitDetection(detection) {
|
|
2051
|
+
return this.t.request("POST", "/video/detections", { json: detection });
|
|
2052
|
+
}
|
|
2053
|
+
listTags(streamId) {
|
|
2054
|
+
return this.t.request("GET", "/video/tags", { params: { stream_id: streamId } });
|
|
2055
|
+
}
|
|
2056
|
+
submitTag(tag) {
|
|
2057
|
+
return this.t.request("POST", "/video/tags", { json: tag });
|
|
2058
|
+
}
|
|
2059
|
+
soakHeatmap(streamId, from, to, precision) {
|
|
2060
|
+
return this.t.request("GET", "/video/soak", {
|
|
2061
|
+
params: { stream_id: streamId, from, to, precision }
|
|
2062
|
+
});
|
|
2063
|
+
}
|
|
2064
|
+
createExport(streamId, frameRange, redactions) {
|
|
2065
|
+
return this.t.request("POST", "/video/exports", {
|
|
2066
|
+
json: { stream_id: streamId, frame_range: frameRange, redactions }
|
|
2067
|
+
});
|
|
2068
|
+
}
|
|
2069
|
+
getExport(exportId) {
|
|
2070
|
+
return this.t.request("GET", `/video/exports/${exportId}`);
|
|
2071
|
+
}
|
|
2072
|
+
};
|
|
2073
|
+
var ComunicadosResource = class {
|
|
2074
|
+
constructor(t) {
|
|
2075
|
+
this.t = t;
|
|
2076
|
+
}
|
|
2077
|
+
t;
|
|
2078
|
+
list(opts = {}) {
|
|
2079
|
+
return this.t.request("GET", "/platform/v23/comunicados", { params: opts });
|
|
2080
|
+
}
|
|
2081
|
+
listActive() {
|
|
2082
|
+
return this.t.request("GET", "/platform/v23/comunicados/active");
|
|
2083
|
+
}
|
|
2084
|
+
create(input) {
|
|
2085
|
+
return this.t.request("POST", "/platform/v23/comunicados", { json: input });
|
|
2086
|
+
}
|
|
2087
|
+
/** Sparse patch — only provided keys are sent. */
|
|
2088
|
+
patch(comunicadoId, patch) {
|
|
2089
|
+
const body = Object.fromEntries(Object.entries(patch).filter(([, v]) => v !== void 0));
|
|
2090
|
+
return this.t.request("PATCH", `/platform/v23/comunicados/${comunicadoId}`, { json: body });
|
|
2091
|
+
}
|
|
2092
|
+
/** Soft delete. */
|
|
2093
|
+
delete(comunicadoId) {
|
|
2094
|
+
return this.t.request("DELETE", `/platform/v23/comunicados/${comunicadoId}`);
|
|
2095
|
+
}
|
|
2096
|
+
/** Idempotent per-user dismissal. */
|
|
2097
|
+
dismissMe(comunicadoId) {
|
|
2098
|
+
return this.t.request("POST", `/platform/v23/comunicados/${comunicadoId}/dismiss/me`, {
|
|
2099
|
+
json: {}
|
|
2100
|
+
});
|
|
2101
|
+
}
|
|
2102
|
+
};
|
|
2103
|
+
var CampaignBriefingResource = class {
|
|
2104
|
+
constructor(t) {
|
|
2105
|
+
this.t = t;
|
|
2106
|
+
}
|
|
2107
|
+
t;
|
|
2108
|
+
refresh(opts = {}) {
|
|
2109
|
+
return this.t.request("POST", "/campaign/home-briefing/refresh", {
|
|
2110
|
+
json: { default_modo_inicial: "B", ...opts }
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
2113
|
+
get(candidatoSlug, includeHeadline) {
|
|
2114
|
+
return this.t.request("GET", "/campaign/home-briefing", {
|
|
2115
|
+
params: {
|
|
2116
|
+
candidato_slug: candidatoSlug,
|
|
2117
|
+
include_headline: includeHeadline === void 0 ? void 0 : String(includeHeadline)
|
|
2118
|
+
}
|
|
2119
|
+
});
|
|
2120
|
+
}
|
|
2121
|
+
/** 409 when the briefing is in crisis mode. */
|
|
2122
|
+
regenerateHeadline(candidatoSlug) {
|
|
2123
|
+
return this.t.request("POST", "/campaign/home-briefing/headline/regenerate", {
|
|
2124
|
+
json: { candidato_slug: candidatoSlug }
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
/** duration_hours ∈ 1..168 (default 24). */
|
|
2128
|
+
overrideModo(candidatoSlug, novoModo, durationHours = 24) {
|
|
2129
|
+
return this.t.request("POST", "/campaign/home-briefing/modo/override", {
|
|
2130
|
+
json: { candidato_slug: candidatoSlug, novo_modo: novoModo, duration_hours: durationHours }
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
};
|
|
2134
|
+
var CampaignResource = class {
|
|
2135
|
+
briefing;
|
|
2136
|
+
constructor(t) {
|
|
2137
|
+
this.briefing = new CampaignBriefingResource(t);
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
|
|
2141
|
+
// src/resources/collab.ts
|
|
2142
|
+
var FormsResource = class {
|
|
2143
|
+
constructor(t) {
|
|
2144
|
+
this.t = t;
|
|
2145
|
+
}
|
|
2146
|
+
t;
|
|
2147
|
+
submit(formKey, payload, opts = {}) {
|
|
2148
|
+
return this.t.request("POST", "/platform/v23/forms/submit", {
|
|
2149
|
+
json: {
|
|
2150
|
+
form_key: formKey,
|
|
2151
|
+
payload,
|
|
2152
|
+
visibility_policy: opts.visibility_policy ?? "requires_auth",
|
|
2153
|
+
...opts
|
|
2154
|
+
}
|
|
2155
|
+
});
|
|
2156
|
+
}
|
|
2157
|
+
listSubmissions(opts = {}) {
|
|
2158
|
+
return this.t.request("GET", "/platform/v23/forms/submissions", { params: opts });
|
|
2159
|
+
}
|
|
2160
|
+
};
|
|
2161
|
+
var AppShellSection = class {
|
|
2162
|
+
constructor(t, path) {
|
|
2163
|
+
this.t = t;
|
|
2164
|
+
this.path = path;
|
|
2165
|
+
}
|
|
2166
|
+
t;
|
|
2167
|
+
path;
|
|
2168
|
+
get() {
|
|
2169
|
+
return this.t.request("GET", this.path);
|
|
2170
|
+
}
|
|
2171
|
+
put(value) {
|
|
2172
|
+
return this.t.request("PUT", this.path, { json: value });
|
|
2173
|
+
}
|
|
2174
|
+
};
|
|
2175
|
+
var AppShellResource = class {
|
|
2176
|
+
constructor(t) {
|
|
2177
|
+
this.t = t;
|
|
2178
|
+
this.banner = new AppShellSection(t, "/platform/v23/app-shell/banner");
|
|
2179
|
+
this.footer = new AppShellSection(t, "/platform/v23/app-shell/footer");
|
|
2180
|
+
this.userMenu = new AppShellSection(t, "/platform/v23/app-shell/user-menu");
|
|
2181
|
+
this.sidenav = new AppShellSection(t, "/platform/v23/app-shell/sidenav");
|
|
2182
|
+
this.homepage = new AppShellSection(t, "/platform/v23/app-shell/homepage");
|
|
2183
|
+
}
|
|
2184
|
+
t;
|
|
2185
|
+
banner;
|
|
2186
|
+
footer;
|
|
2187
|
+
userMenu;
|
|
2188
|
+
sidenav;
|
|
2189
|
+
homepage;
|
|
2190
|
+
getMe() {
|
|
2191
|
+
return this.t.request("GET", "/platform/v23/app-shell/me");
|
|
2192
|
+
}
|
|
2193
|
+
putMe(config) {
|
|
2194
|
+
return this.t.request("PUT", "/platform/v23/app-shell/me", { json: config });
|
|
2195
|
+
}
|
|
2196
|
+
getTenant() {
|
|
2197
|
+
return this.t.request("GET", "/platform/v23/app-shell/tenant");
|
|
2198
|
+
}
|
|
2199
|
+
putTenant(config) {
|
|
2200
|
+
return this.t.request("PUT", "/platform/v23/app-shell/tenant", { json: config });
|
|
2201
|
+
}
|
|
2202
|
+
};
|
|
2203
|
+
var ProjectConstraintsResource = class {
|
|
2204
|
+
constructor(t) {
|
|
2205
|
+
this.t = t;
|
|
2206
|
+
}
|
|
2207
|
+
t;
|
|
2208
|
+
get(projectId) {
|
|
2209
|
+
return this.t.request("GET", `/projects/${projectId}/constraints`);
|
|
2210
|
+
}
|
|
2211
|
+
put(projectId, opts = {}) {
|
|
2212
|
+
return this.t.request("PUT", `/projects/${projectId}/constraints`, {
|
|
2213
|
+
json: { mode: opts.mode ?? "none", ...opts }
|
|
2214
|
+
});
|
|
2215
|
+
}
|
|
2216
|
+
clear(projectId) {
|
|
2217
|
+
return this.t.request("DELETE", `/projects/${projectId}/constraints`);
|
|
2218
|
+
}
|
|
2219
|
+
/** Report-only — deletes nothing. */
|
|
2220
|
+
revalidate(projectId) {
|
|
2221
|
+
return this.t.request("POST", `/projects/${projectId}/constraints/revalidate`);
|
|
2222
|
+
}
|
|
2223
|
+
};
|
|
2224
|
+
var ProjectsResource = class {
|
|
2225
|
+
constructor(t) {
|
|
2226
|
+
this.t = t;
|
|
2227
|
+
this.constraints = new ProjectConstraintsResource(t);
|
|
2228
|
+
}
|
|
2229
|
+
t;
|
|
2230
|
+
constraints;
|
|
2231
|
+
/** `spaceId: null` removes the project from its Space. */
|
|
2232
|
+
move(projectId, spaceId) {
|
|
2233
|
+
return this.t.request("PATCH", `/projects/${projectId}/move`, {
|
|
2234
|
+
json: { space_id: spaceId }
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
};
|
|
2238
|
+
var OrganizationsResource = class {
|
|
2239
|
+
constructor(t) {
|
|
2240
|
+
this.t = t;
|
|
2241
|
+
}
|
|
2242
|
+
t;
|
|
2243
|
+
list(opts = {}) {
|
|
2244
|
+
return this.t.request("GET", "/organizations", { params: opts });
|
|
2245
|
+
}
|
|
2246
|
+
get(organizationId) {
|
|
2247
|
+
return this.t.request("GET", `/organizations/${organizationId}`);
|
|
2248
|
+
}
|
|
2249
|
+
listGuests(organizationId, includeRevoked = false) {
|
|
2250
|
+
return this.t.request("GET", `/organizations/${organizationId}/guests`, {
|
|
2251
|
+
params: { include_revoked: includeRevoked }
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
inviteGuest(organizationId, userId, expiresAt) {
|
|
2255
|
+
return this.t.request("POST", `/organizations/${organizationId}/guests`, {
|
|
2256
|
+
json: { user_id: userId, expires_at: expiresAt }
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
revokeGuest(organizationId, userId) {
|
|
2260
|
+
return this.t.request("DELETE", `/organizations/${organizationId}/guests/${userId}`);
|
|
2261
|
+
}
|
|
2262
|
+
};
|
|
2263
|
+
var SpacesResource = class {
|
|
2264
|
+
constructor(t) {
|
|
2265
|
+
this.t = t;
|
|
2266
|
+
}
|
|
2267
|
+
t;
|
|
2268
|
+
list(opts = {}) {
|
|
2269
|
+
return this.t.request("GET", "/spaces", { params: opts });
|
|
2270
|
+
}
|
|
2271
|
+
get(spaceId) {
|
|
2272
|
+
return this.t.request("GET", `/spaces/${spaceId}`);
|
|
2273
|
+
}
|
|
2274
|
+
create(slug, displayName, description) {
|
|
2275
|
+
return this.t.request("POST", "/spaces", {
|
|
2276
|
+
json: { slug, display_name: displayName, description }
|
|
2277
|
+
});
|
|
2278
|
+
}
|
|
2279
|
+
update(spaceId, patch) {
|
|
2280
|
+
return this.t.request("PATCH", `/spaces/${spaceId}`, { json: patch });
|
|
2281
|
+
}
|
|
2282
|
+
addOrganization(spaceId, tenantId) {
|
|
2283
|
+
return this.t.request("POST", `/spaces/${spaceId}/organizations`, {
|
|
2284
|
+
json: { tenant_id: tenantId }
|
|
2285
|
+
});
|
|
2286
|
+
}
|
|
2287
|
+
removeOrganization(spaceId, tenantId) {
|
|
2288
|
+
return this.t.request("DELETE", `/spaces/${spaceId}/organizations/${tenantId}`);
|
|
2289
|
+
}
|
|
2290
|
+
};
|
|
2291
|
+
var VALID_PROJECT_ROLES = [
|
|
2292
|
+
"owner",
|
|
2293
|
+
"editor",
|
|
2294
|
+
"reviewer",
|
|
2295
|
+
"viewer",
|
|
2296
|
+
"discoverer"
|
|
2297
|
+
];
|
|
2298
|
+
var SolutionsResource = class {
|
|
2299
|
+
constructor(t) {
|
|
2300
|
+
this.t = t;
|
|
2301
|
+
}
|
|
2302
|
+
t;
|
|
2303
|
+
design(problem, opts = {}) {
|
|
2304
|
+
return this.t.request("POST", "/platform/v23/solutions/design", {
|
|
2305
|
+
json: { problem, ...opts }
|
|
2306
|
+
});
|
|
2307
|
+
}
|
|
2308
|
+
/** Accept-flags travel nested under `accept`; blueprint/diagram_id/app_id/linked_sources stay top-level. */
|
|
2309
|
+
materialize(blueprint, accept = {}, opts = {}) {
|
|
2310
|
+
return this.t.request("POST", "/platform/v23/solutions/materialize", {
|
|
2311
|
+
json: { blueprint, accept, ...opts }
|
|
2312
|
+
});
|
|
2313
|
+
}
|
|
2314
|
+
/** depth ∈ lean|full */
|
|
2315
|
+
designGraph(problem, opts = {}) {
|
|
2316
|
+
return this.t.request("POST", "/platform/v23/solutions/design-graph", {
|
|
2317
|
+
json: { problem, depth: opts.depth ?? "lean", wizard: opts.wizard }
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
mergeGraph(currentGraph, baseBlueprint, incomingBlueprint) {
|
|
2321
|
+
return this.t.request("POST", "/platform/v23/solutions/merge-graph", {
|
|
2322
|
+
json: {
|
|
2323
|
+
current_graph: currentGraph,
|
|
2324
|
+
base_blueprint: baseBlueprint,
|
|
2325
|
+
incoming_blueprint: incomingBlueprint
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
listPatterns() {
|
|
2330
|
+
return this.t.request("GET", "/platform/v23/solutions/patterns");
|
|
2331
|
+
}
|
|
2332
|
+
listDiagrams(opts = {}) {
|
|
2333
|
+
return this.t.request("GET", "/platform/v23/solutions/diagrams", { params: opts });
|
|
2334
|
+
}
|
|
2335
|
+
get(diagramId) {
|
|
2336
|
+
return this.t.request("GET", `/platform/v23/solutions/diagrams/${diagramId}`);
|
|
2337
|
+
}
|
|
2338
|
+
create(input) {
|
|
2339
|
+
return this.t.request("POST", "/platform/v23/solutions/diagrams", { json: input });
|
|
2340
|
+
}
|
|
2341
|
+
/** Save == publish. */
|
|
2342
|
+
save(diagramId, input) {
|
|
2343
|
+
return this.t.request("PATCH", `/platform/v23/solutions/diagrams/${diagramId}`, {
|
|
2344
|
+
json: input
|
|
2345
|
+
});
|
|
2346
|
+
}
|
|
2347
|
+
delete(diagramId) {
|
|
2348
|
+
return this.t.request("DELETE", `/platform/v23/solutions/diagrams/${diagramId}`);
|
|
2349
|
+
}
|
|
2350
|
+
versions(diagramId) {
|
|
2351
|
+
return this.t.request("GET", `/platform/v23/solutions/diagrams/${diagramId}/versions`);
|
|
2352
|
+
}
|
|
2353
|
+
walkthrough(diagramId) {
|
|
2354
|
+
return this.t.request("POST", `/platform/v23/solutions/diagrams/${diagramId}/walkthrough`, {
|
|
2355
|
+
json: {}
|
|
2356
|
+
});
|
|
2357
|
+
}
|
|
2358
|
+
implementations(graph, nodeId, opts = {}) {
|
|
2359
|
+
return this.t.request("POST", "/platform/v23/solutions/implementations", {
|
|
2360
|
+
json: { graph, node_id: nodeId, problem: opts.problem ?? "", wizard: opts.wizard }
|
|
2361
|
+
});
|
|
2362
|
+
}
|
|
2363
|
+
expandNode(graph, nodeId, planId, wizard) {
|
|
2364
|
+
return this.t.request("POST", "/platform/v23/solutions/expand-node", {
|
|
2365
|
+
json: { graph, node_id: nodeId, plan_id: planId, wizard }
|
|
2366
|
+
});
|
|
2367
|
+
}
|
|
2368
|
+
ontologyModel(prompt) {
|
|
2369
|
+
return this.t.request("POST", "/platform/v23/solutions/ontology-model", { json: { prompt } });
|
|
2370
|
+
}
|
|
2371
|
+
fromLineage(events) {
|
|
2372
|
+
return this.t.request("POST", "/platform/v23/solutions/from-lineage", {
|
|
2373
|
+
json: events ? { events } : {}
|
|
2374
|
+
});
|
|
2375
|
+
}
|
|
2376
|
+
teardownPlan(appId) {
|
|
2377
|
+
return this.t.request("GET", `/workshop/apps/${appId}/teardown-plan`);
|
|
2378
|
+
}
|
|
2379
|
+
teardown(appId) {
|
|
2380
|
+
return this.t.request("DELETE", `/workshop/apps/${appId}`, {
|
|
2381
|
+
params: { teardown_build: "true" }
|
|
2382
|
+
});
|
|
2383
|
+
}
|
|
2384
|
+
marketplaceListings(opts = {}) {
|
|
2385
|
+
return this.t.request("GET", "/solutions/marketplace/listings", {
|
|
2386
|
+
params: { status: opts.status ?? "published", q: opts.q, tag: opts.tag, category: opts.category }
|
|
2387
|
+
});
|
|
2388
|
+
}
|
|
2389
|
+
marketplaceDetail(listingId) {
|
|
2390
|
+
return this.t.request("GET", `/solutions/marketplace/listings/${listingId}`);
|
|
2391
|
+
}
|
|
2392
|
+
marketplacePublish(diagramId, opts = {}) {
|
|
2393
|
+
return this.t.request("POST", "/solutions/marketplace/listings", {
|
|
2394
|
+
json: { diagram_id: diagramId, category: opts.category ?? "", ...opts }
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2397
|
+
/** Re-materializes the listing in the caller's tenant. */
|
|
2398
|
+
marketplaceInstall(listingId) {
|
|
2399
|
+
return this.t.request("POST", `/solutions/marketplace/listings/${listingId}/install`);
|
|
2400
|
+
}
|
|
2401
|
+
marketplacePatch(listingId, fields) {
|
|
2402
|
+
return this.t.request("PATCH", `/solutions/marketplace/listings/${listingId}`, {
|
|
2403
|
+
json: fields
|
|
2404
|
+
});
|
|
2405
|
+
}
|
|
2406
|
+
};
|
|
2407
|
+
|
|
2408
|
+
// src/resources/workspaces.ts
|
|
2409
|
+
var WorkspaceVersionsResource = class {
|
|
2410
|
+
constructor(t) {
|
|
2411
|
+
this.t = t;
|
|
2412
|
+
}
|
|
2413
|
+
t;
|
|
2414
|
+
list(workspaceId) {
|
|
2415
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/versions`);
|
|
2416
|
+
}
|
|
2417
|
+
get(workspaceId, versionNumber) {
|
|
2418
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/versions/${versionNumber}`);
|
|
2419
|
+
}
|
|
2420
|
+
republish(workspaceId, versionNumber, message) {
|
|
2421
|
+
return this.t.request(
|
|
2422
|
+
"POST",
|
|
2423
|
+
`/workspaces/${workspaceId}/versions/${versionNumber}/republish`,
|
|
2424
|
+
{ json: message ? { message } : {} }
|
|
2425
|
+
);
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
var WorkspacesResource = class {
|
|
2429
|
+
constructor(t) {
|
|
2430
|
+
this.t = t;
|
|
2431
|
+
this.versions = new WorkspaceVersionsResource(t);
|
|
2432
|
+
}
|
|
2433
|
+
t;
|
|
2434
|
+
versions;
|
|
2435
|
+
list(opts = {}) {
|
|
2436
|
+
return this.t.request("GET", "/workspaces", { params: opts });
|
|
2437
|
+
}
|
|
2438
|
+
get(workspaceId) {
|
|
2439
|
+
return this.t.request("GET", `/workspaces/${workspaceId}`);
|
|
2440
|
+
}
|
|
2441
|
+
create(input) {
|
|
2442
|
+
return this.t.request("POST", "/workspaces", { json: input });
|
|
2443
|
+
}
|
|
2444
|
+
/** Save == immediate publish — bumps version + snapshot. */
|
|
2445
|
+
publish(workspaceId, config, message) {
|
|
2446
|
+
return this.t.request("PATCH", `/workspaces/${workspaceId}`, { json: { config, message } });
|
|
2447
|
+
}
|
|
2448
|
+
/** Soft delete (`active=false`). */
|
|
2449
|
+
delete(workspaceId) {
|
|
2450
|
+
return this.t.request("DELETE", `/workspaces/${workspaceId}`);
|
|
2451
|
+
}
|
|
2452
|
+
getNavigation(workspaceId) {
|
|
2453
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/navigation`);
|
|
2454
|
+
}
|
|
2455
|
+
setNavigation(workspaceId, opts = {}) {
|
|
2456
|
+
return this.t.request("PUT", `/workspaces/${workspaceId}/navigation`, {
|
|
2457
|
+
json: { navigate_out_allowed: opts.navigate_out_allowed ?? true, ...opts }
|
|
2458
|
+
});
|
|
2459
|
+
}
|
|
2460
|
+
listPromotions(workspaceId) {
|
|
2461
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/promotions`);
|
|
2462
|
+
}
|
|
2463
|
+
/** Idempotent. */
|
|
2464
|
+
promote(workspaceId, organizationId, ordering = 0) {
|
|
2465
|
+
return this.t.request("POST", `/workspaces/${workspaceId}/promotions`, {
|
|
2466
|
+
json: { organization_id: organizationId, ordering }
|
|
2467
|
+
});
|
|
2468
|
+
}
|
|
2469
|
+
unpromote(workspaceId, organizationId) {
|
|
2470
|
+
return this.t.request("DELETE", `/workspaces/${workspaceId}/promotions/${organizationId}`);
|
|
2471
|
+
}
|
|
2472
|
+
listPromotedForOrganization(organizationId) {
|
|
2473
|
+
return this.t.request("GET", `/organizations/${organizationId}/promoted-workspaces`);
|
|
2474
|
+
}
|
|
2475
|
+
getKiosk(workspaceId) {
|
|
2476
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/kiosk`);
|
|
2477
|
+
}
|
|
2478
|
+
setKiosk(workspaceId, opts = {}) {
|
|
2479
|
+
return this.t.request("PUT", `/workspaces/${workspaceId}/kiosk`, {
|
|
2480
|
+
json: {
|
|
2481
|
+
hide_chrome: opts.hide_chrome ?? true,
|
|
2482
|
+
allow_exit: opts.allow_exit ?? true,
|
|
2483
|
+
auto_fullscreen: opts.auto_fullscreen ?? true,
|
|
2484
|
+
message: opts.message
|
|
2485
|
+
}
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2488
|
+
startKioskSession(workspaceId, clientInfo) {
|
|
2489
|
+
return this.t.request("POST", `/workspaces/${workspaceId}/kiosk/sessions`, {
|
|
2490
|
+
json: clientInfo ? { client_info: clientInfo } : {}
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
endKioskSession(workspaceId, sessionId) {
|
|
2494
|
+
return this.t.request("POST", `/workspaces/${workspaceId}/kiosk/sessions/${sessionId}/end`);
|
|
2495
|
+
}
|
|
2496
|
+
listKioskSessions(workspaceId, opts = {}) {
|
|
2497
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/kiosk/sessions`, { params: opts });
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
var WorkspaceUpdatesResource = class {
|
|
2501
|
+
constructor(t) {
|
|
2502
|
+
this.t = t;
|
|
2503
|
+
}
|
|
2504
|
+
t;
|
|
2505
|
+
list(workspaceId, includeArchived = false) {
|
|
2506
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/updates`, {
|
|
2507
|
+
params: { include_archived: includeArchived }
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
/** Active updates not yet seen by the caller. */
|
|
2511
|
+
listUnseen(workspaceId) {
|
|
2512
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/updates/unseen`);
|
|
2513
|
+
}
|
|
2514
|
+
get(workspaceId, updateId) {
|
|
2515
|
+
return this.t.request("GET", `/workspaces/${workspaceId}/updates/${updateId}`);
|
|
2516
|
+
}
|
|
2517
|
+
create(workspaceId, input) {
|
|
2518
|
+
return this.t.request("POST", `/workspaces/${workspaceId}/updates`, { json: input });
|
|
2519
|
+
}
|
|
2520
|
+
patch(workspaceId, updateId, patch) {
|
|
2521
|
+
return this.t.request("PATCH", `/workspaces/${workspaceId}/updates/${updateId}`, {
|
|
2522
|
+
json: patch
|
|
2523
|
+
});
|
|
2524
|
+
}
|
|
2525
|
+
archive(workspaceId, updateId) {
|
|
2526
|
+
return this.t.request("POST", `/workspaces/${workspaceId}/updates/${updateId}/archive`);
|
|
2527
|
+
}
|
|
2528
|
+
/** Hard delete — cascades pages + views. */
|
|
2529
|
+
delete(workspaceId, updateId) {
|
|
2530
|
+
return this.t.request("DELETE", `/workspaces/${workspaceId}/updates/${updateId}`);
|
|
2531
|
+
}
|
|
2532
|
+
markSeen(workspaceId, updateId, dismissed = false) {
|
|
2533
|
+
return this.t.request("POST", `/workspaces/${workspaceId}/updates/${updateId}/seen`, {
|
|
2534
|
+
json: { dismissed }
|
|
2535
|
+
});
|
|
2536
|
+
}
|
|
2537
|
+
};
|
|
2538
|
+
|
|
2539
|
+
// src/resources/platformVersions.ts
|
|
2540
|
+
var V22ActionLogResource = class {
|
|
2541
|
+
constructor(t) {
|
|
2542
|
+
this.t = t;
|
|
2543
|
+
}
|
|
2544
|
+
t;
|
|
2545
|
+
record(input) {
|
|
2546
|
+
return this.t.request("POST", "/platform/v22/action-log", { json: input });
|
|
2547
|
+
}
|
|
2548
|
+
list(opts = {}) {
|
|
2549
|
+
return this.t.request("GET", "/platform/v22/action-log", { params: opts });
|
|
2550
|
+
}
|
|
2551
|
+
};
|
|
2552
|
+
var V22NotepadResource = class {
|
|
2553
|
+
constructor(t) {
|
|
2554
|
+
this.t = t;
|
|
2555
|
+
}
|
|
2556
|
+
t;
|
|
2557
|
+
create(title, opts = {}) {
|
|
2558
|
+
return this.t.request("POST", "/platform/v22/notepad", { json: { title, ...opts } });
|
|
2559
|
+
}
|
|
2560
|
+
freeze(docId) {
|
|
2561
|
+
return this.t.request("POST", `/platform/v22/notepad/${docId}/freeze`);
|
|
2562
|
+
}
|
|
2563
|
+
instantiate(templateId, title, variables) {
|
|
2564
|
+
return this.t.request("POST", `/platform/v22/notepad/${templateId}/instantiate`, {
|
|
2565
|
+
json: { title, variables }
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
};
|
|
2569
|
+
var V22QuiverResource = class {
|
|
2570
|
+
constructor(t) {
|
|
2571
|
+
this.t = t;
|
|
2572
|
+
}
|
|
2573
|
+
t;
|
|
2574
|
+
create(input) {
|
|
2575
|
+
return this.t.request("POST", "/platform/v22/quiver", { json: input });
|
|
2576
|
+
}
|
|
2577
|
+
render(dashId, opts = {}) {
|
|
2578
|
+
return this.t.request("POST", `/platform/v22/quiver/${dashId}/render`, { json: opts });
|
|
2579
|
+
}
|
|
2580
|
+
};
|
|
2581
|
+
var PlatformV22Resource = class {
|
|
2582
|
+
constructor(t) {
|
|
2583
|
+
this.t = t;
|
|
2584
|
+
this.actionLog = new V22ActionLogResource(t);
|
|
2585
|
+
this.notepad = new V22NotepadResource(t);
|
|
2586
|
+
this.quiver = new V22QuiverResource(t);
|
|
2587
|
+
}
|
|
2588
|
+
t;
|
|
2589
|
+
actionLog;
|
|
2590
|
+
notepad;
|
|
2591
|
+
quiver;
|
|
2592
|
+
/** Returns the transformed value (unwraps the response's `value` field). */
|
|
2593
|
+
async applyVariableTransform(kind, inputs) {
|
|
2594
|
+
const payload = await this.t.request("POST", "/platform/v22/variable-transforms/apply", {
|
|
2595
|
+
json: { kind, inputs }
|
|
2596
|
+
});
|
|
2597
|
+
return payload.value;
|
|
2598
|
+
}
|
|
2599
|
+
recordUsage(input) {
|
|
2600
|
+
return this.t.request("POST", "/platform/v22/ontology-usage/record", { json: input });
|
|
2601
|
+
}
|
|
2602
|
+
queryUsage(opts = {}) {
|
|
2603
|
+
return this.t.request("GET", "/platform/v22/ontology-usage", {
|
|
2604
|
+
params: { days: 30, ...opts }
|
|
2605
|
+
});
|
|
2606
|
+
}
|
|
2607
|
+
};
|
|
2608
|
+
var V23LogicResource = class {
|
|
2609
|
+
constructor(t) {
|
|
2610
|
+
this.t = t;
|
|
2611
|
+
}
|
|
2612
|
+
t;
|
|
2613
|
+
list() {
|
|
2614
|
+
return this.t.request("GET", "/platform/v23/aip-logic");
|
|
2615
|
+
}
|
|
2616
|
+
get(fid) {
|
|
2617
|
+
return this.t.request("GET", `/platform/v23/aip-logic/${fid}`);
|
|
2618
|
+
}
|
|
2619
|
+
create(input) {
|
|
2620
|
+
return this.t.request("POST", "/platform/v23/aip-logic", { json: input });
|
|
2621
|
+
}
|
|
2622
|
+
update(fid, patch) {
|
|
2623
|
+
return this.t.request("PUT", `/platform/v23/aip-logic/${fid}`, { json: patch });
|
|
2624
|
+
}
|
|
2625
|
+
delete(fid) {
|
|
2626
|
+
return this.t.request("DELETE", `/platform/v23/aip-logic/${fid}`);
|
|
2627
|
+
}
|
|
2628
|
+
invoke(fid, inputs) {
|
|
2629
|
+
return this.t.request("POST", `/platform/v23/aip-logic/${fid}/invoke`, {
|
|
2630
|
+
json: { inputs: inputs ?? {} }
|
|
2631
|
+
});
|
|
2632
|
+
}
|
|
2633
|
+
addTest(fid, input) {
|
|
2634
|
+
return this.t.request("POST", `/platform/v23/aip-logic/${fid}/tests`, { json: input });
|
|
2635
|
+
}
|
|
2636
|
+
runTest(fid, testId) {
|
|
2637
|
+
return this.t.request("POST", `/platform/v23/aip-logic/${fid}/tests/${testId}/run`);
|
|
2638
|
+
}
|
|
2639
|
+
};
|
|
2640
|
+
var V23ActionsResource = class {
|
|
2641
|
+
constructor(t) {
|
|
2642
|
+
this.t = t;
|
|
2643
|
+
}
|
|
2644
|
+
t;
|
|
2645
|
+
list() {
|
|
2646
|
+
return this.t.request("GET", "/platform/v23/action-types");
|
|
2647
|
+
}
|
|
2648
|
+
get(aid) {
|
|
2649
|
+
return this.t.request("GET", `/platform/v23/action-types/${aid}`);
|
|
2650
|
+
}
|
|
2651
|
+
create(input) {
|
|
2652
|
+
return this.t.request("POST", "/platform/v23/action-types", { json: input });
|
|
2653
|
+
}
|
|
2654
|
+
update(aid, patch) {
|
|
2655
|
+
return this.t.request("PUT", `/platform/v23/action-types/${aid}`, { json: patch });
|
|
2656
|
+
}
|
|
2657
|
+
delete(aid) {
|
|
2658
|
+
return this.t.request("DELETE", `/platform/v23/action-types/${aid}`);
|
|
2659
|
+
}
|
|
2660
|
+
execute(aid, inputs, note) {
|
|
2661
|
+
return this.t.request("POST", `/platform/v23/action-types/${aid}/execute`, {
|
|
2662
|
+
json: { input: inputs ?? {}, note }
|
|
2663
|
+
});
|
|
2664
|
+
}
|
|
2665
|
+
plan(steps) {
|
|
2666
|
+
return this.t.request("POST", "/platform/v23/action-types/plan", { json: { steps } });
|
|
2667
|
+
}
|
|
2668
|
+
executions(aid) {
|
|
2669
|
+
return this.t.request("GET", `/platform/v23/action-types/${aid}/executions`);
|
|
2670
|
+
}
|
|
2671
|
+
};
|
|
2672
|
+
var V23AssistResource = class {
|
|
2673
|
+
constructor(t) {
|
|
2674
|
+
this.t = t;
|
|
2675
|
+
}
|
|
2676
|
+
t;
|
|
2677
|
+
list(opts = {}) {
|
|
2678
|
+
return this.t.request("GET", "/platform/v23/aip-assist", { params: opts });
|
|
2679
|
+
}
|
|
2680
|
+
create(input) {
|
|
2681
|
+
return this.t.request("POST", "/platform/v23/aip-assist", { json: input });
|
|
2682
|
+
}
|
|
2683
|
+
delete(cid) {
|
|
2684
|
+
return this.t.request("DELETE", `/platform/v23/aip-assist/${cid}`);
|
|
2685
|
+
}
|
|
2686
|
+
suggest(input) {
|
|
2687
|
+
return this.t.request("POST", "/platform/v23/aip-assist/suggest", { json: input });
|
|
2688
|
+
}
|
|
2689
|
+
};
|
|
2690
|
+
var V23PipelineResource = class {
|
|
2691
|
+
constructor(t) {
|
|
2692
|
+
this.t = t;
|
|
2693
|
+
}
|
|
2694
|
+
t;
|
|
2695
|
+
list() {
|
|
2696
|
+
return this.t.request("GET", "/platform/v23/pipeline");
|
|
2697
|
+
}
|
|
2698
|
+
create(input) {
|
|
2699
|
+
return this.t.request("POST", "/platform/v23/pipeline", { json: input });
|
|
2700
|
+
}
|
|
2701
|
+
update(pid, patch) {
|
|
2702
|
+
return this.t.request("PUT", `/platform/v23/pipeline/${pid}`, { json: patch });
|
|
2703
|
+
}
|
|
2704
|
+
delete(pid) {
|
|
2705
|
+
return this.t.request("DELETE", `/platform/v23/pipeline/${pid}`);
|
|
2706
|
+
}
|
|
2707
|
+
run(pid, opts = {}) {
|
|
2708
|
+
return this.t.request("POST", `/platform/v23/pipeline/${pid}/run`, { json: opts });
|
|
2709
|
+
}
|
|
2710
|
+
runs(pid, limit = 50) {
|
|
2711
|
+
return this.t.request("GET", `/platform/v23/pipeline/${pid}/runs`, { params: { limit } });
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2714
|
+
var V23StylesBrandResource = class {
|
|
2715
|
+
constructor(t) {
|
|
2716
|
+
this.t = t;
|
|
2717
|
+
}
|
|
2718
|
+
t;
|
|
2719
|
+
get() {
|
|
2720
|
+
return this.t.request("GET", "/platform/v23/styles/brand");
|
|
2721
|
+
}
|
|
2722
|
+
update(patch) {
|
|
2723
|
+
return this.t.request("PUT", "/platform/v23/styles/brand", { json: patch });
|
|
2724
|
+
}
|
|
2725
|
+
/** Unauthenticated-safe read. */
|
|
2726
|
+
getPublic(tenant) {
|
|
2727
|
+
return this.t.request("GET", "/platform/v23/styles/brand/public", { params: { tenant } });
|
|
2728
|
+
}
|
|
2729
|
+
};
|
|
2730
|
+
var V23StylesResource = class {
|
|
2731
|
+
constructor(t) {
|
|
2732
|
+
this.t = t;
|
|
2733
|
+
this.brand = new V23StylesBrandResource(t);
|
|
2734
|
+
}
|
|
2735
|
+
t;
|
|
2736
|
+
brand;
|
|
2737
|
+
get() {
|
|
2738
|
+
return this.t.request("GET", "/platform/v23/styles");
|
|
2739
|
+
}
|
|
2740
|
+
update(tokens, message) {
|
|
2741
|
+
return this.t.request("PUT", "/platform/v23/styles", { json: { tokens, message } });
|
|
2742
|
+
}
|
|
2743
|
+
getRegionColors() {
|
|
2744
|
+
return this.t.request("GET", "/platform/v23/styles/region-colors");
|
|
2745
|
+
}
|
|
2746
|
+
updateRegionColors(patch) {
|
|
2747
|
+
return this.t.request("PUT", "/platform/v23/styles/region-colors", { json: patch });
|
|
2748
|
+
}
|
|
2749
|
+
/** Multipart upload (the only non-JSON write in the v2x surfaces). */
|
|
2750
|
+
uploadLogo(file, filename = "logo.png") {
|
|
2751
|
+
const form = new FormData();
|
|
2752
|
+
form.append("file", file, filename);
|
|
2753
|
+
return this.t.request("POST", "/platform/v23/styles/upload/logo", { form });
|
|
2754
|
+
}
|
|
2755
|
+
};
|
|
2756
|
+
function crudFactory(t, base) {
|
|
2757
|
+
return {
|
|
2758
|
+
list: () => t.request("GET", base),
|
|
2759
|
+
create: (input) => t.request("POST", base, { json: input }),
|
|
2760
|
+
delete: (id) => t.request("DELETE", `${base}/${id}`)
|
|
2761
|
+
};
|
|
2762
|
+
}
|
|
2763
|
+
var PlatformV23Resource = class {
|
|
2764
|
+
constructor(t) {
|
|
2765
|
+
this.t = t;
|
|
2766
|
+
this.logic = new V23LogicResource(t);
|
|
2767
|
+
this.actions = new V23ActionsResource(t);
|
|
2768
|
+
this.assist = new V23AssistResource(t);
|
|
2769
|
+
this.pipeline = new V23PipelineResource(t);
|
|
2770
|
+
this.styles = new V23StylesResource(t);
|
|
2771
|
+
const quiverBase = "/platform/v23/quiver";
|
|
2772
|
+
this.quiver = {
|
|
2773
|
+
...crudFactory(t, quiverBase),
|
|
2774
|
+
update: (id, patch) => t.request("PUT", `${quiverBase}/${id}`, { json: patch }),
|
|
2775
|
+
run: (id) => t.request("POST", `${quiverBase}/${id}/run`)
|
|
2776
|
+
};
|
|
2777
|
+
const connectorsBase = "/platform/v23/connectors";
|
|
2778
|
+
this.connectors = {
|
|
2779
|
+
list: () => t.request("GET", connectorsBase),
|
|
2780
|
+
register: (input) => t.request("POST", connectorsBase, { json: input }),
|
|
2781
|
+
delete: (id) => t.request("DELETE", `${connectorsBase}/${id}`),
|
|
2782
|
+
heartbeat: (id, status = "connected", error) => t.request("POST", `${connectorsBase}/${id}/heartbeat`, { json: { status, error } })
|
|
2783
|
+
};
|
|
2784
|
+
const automateBase = "/platform/v23/automate";
|
|
2785
|
+
this.automate = {
|
|
2786
|
+
...crudFactory(t, automateBase),
|
|
2787
|
+
fire: (id) => t.request("POST", `${automateBase}/${id}/fire`),
|
|
2788
|
+
runs: (id) => t.request("GET", `${automateBase}/${id}/runs`)
|
|
2789
|
+
};
|
|
2790
|
+
const healthBase = "/platform/v23/health";
|
|
2791
|
+
this.health = {
|
|
2792
|
+
...crudFactory(t, healthBase),
|
|
2793
|
+
run: (id) => t.request("POST", `${healthBase}/${id}/run`)
|
|
2794
|
+
};
|
|
2795
|
+
const contourBase = "/platform/v23/contour";
|
|
2796
|
+
this.contour = {
|
|
2797
|
+
...crudFactory(t, contourBase),
|
|
2798
|
+
evaluate: (id, limit = 50) => t.request("POST", `${contourBase}/${id}/evaluate`, { json: { limit } })
|
|
2799
|
+
};
|
|
2800
|
+
this.vertex = crudFactory(t, "/platform/v23/vertex");
|
|
2801
|
+
const reposBase = "/platform/v23/repos";
|
|
2802
|
+
this.repos = {
|
|
2803
|
+
...crudFactory(t, reposBase),
|
|
2804
|
+
commit: (id, input) => t.request("POST", `${reposBase}/${id}/commits`, { json: input }),
|
|
2805
|
+
commits: (id, branch) => t.request("GET", `${reposBase}/${id}/commits`, { params: { branch } }),
|
|
2806
|
+
show: (id, commitId) => t.request("GET", `${reposBase}/${id}/commits/${commitId}`)
|
|
2807
|
+
};
|
|
2808
|
+
const objectSetsBase = "/platform/v23/object-sets";
|
|
2809
|
+
this.objectSets = {
|
|
2810
|
+
...crudFactory(t, objectSetsBase),
|
|
2811
|
+
materialize: (id, limit = 200) => t.request("POST", `${objectSetsBase}/${id}/materialize`, { json: { limit } })
|
|
2812
|
+
};
|
|
2813
|
+
}
|
|
2814
|
+
t;
|
|
2815
|
+
logic;
|
|
2816
|
+
actions;
|
|
2817
|
+
assist;
|
|
2818
|
+
pipeline;
|
|
2819
|
+
styles;
|
|
2820
|
+
quiver;
|
|
2821
|
+
connectors;
|
|
2822
|
+
automate;
|
|
2823
|
+
health;
|
|
2824
|
+
contour;
|
|
2825
|
+
vertex;
|
|
2826
|
+
repos;
|
|
2827
|
+
objectSets;
|
|
2828
|
+
carbonValidate(config) {
|
|
2829
|
+
return this.t.request("POST", "/platform/v23/carbon/validate", { json: config });
|
|
2830
|
+
}
|
|
2831
|
+
catalog() {
|
|
2832
|
+
return this.t.request("GET", "/platform/v23");
|
|
2833
|
+
}
|
|
2834
|
+
};
|
|
2835
|
+
var MarketplaceResource = class {
|
|
2836
|
+
constructor(t) {
|
|
2837
|
+
this.t = t;
|
|
2838
|
+
}
|
|
2839
|
+
t;
|
|
2840
|
+
storefront(opts = {}) {
|
|
2841
|
+
return this.t.request("GET", "/platform/v23/marketplace", {
|
|
2842
|
+
params: { sort: opts.sort ?? "popular", category: opts.category, search: opts.search, tags: opts.tags }
|
|
2843
|
+
});
|
|
2844
|
+
}
|
|
2845
|
+
products(publishedOnly = false) {
|
|
2846
|
+
return this.t.request("GET", "/platform/v23/marketplace/products", {
|
|
2847
|
+
params: { published_only: publishedOnly }
|
|
2848
|
+
});
|
|
2849
|
+
}
|
|
2850
|
+
create(input) {
|
|
2851
|
+
return this.t.request("POST", "/platform/v23/marketplace/products", { json: input });
|
|
2852
|
+
}
|
|
2853
|
+
publish(pid) {
|
|
2854
|
+
return this.t.request("POST", `/platform/v23/marketplace/products/${pid}/publish`);
|
|
2855
|
+
}
|
|
2856
|
+
details(pid) {
|
|
2857
|
+
return this.t.request("GET", `/platform/v23/marketplace/${pid}`);
|
|
2858
|
+
}
|
|
2859
|
+
ontologyImpact(pid) {
|
|
2860
|
+
return this.t.request("GET", `/platform/v23/marketplace/${pid}/ontology-impact`);
|
|
2861
|
+
}
|
|
2862
|
+
installPrecheck(pid) {
|
|
2863
|
+
return this.t.request("GET", `/platform/v23/marketplace/${pid}/install-precheck`);
|
|
2864
|
+
}
|
|
2865
|
+
/** 422 with `{ok:false, gaps}` in the error payload when modules are missing. */
|
|
2866
|
+
install(pid, opts = {}) {
|
|
2867
|
+
return this.t.request("POST", `/platform/v23/marketplace/${pid}/install`, {
|
|
2868
|
+
json: { confirm_text: opts.confirm_text ?? "instalar", config: opts.config, notes: opts.notes }
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
installed() {
|
|
2872
|
+
return this.t.request("GET", "/platform/v23/marketplace/installed");
|
|
2873
|
+
}
|
|
2874
|
+
uninstall(installId) {
|
|
2875
|
+
return this.t.request("POST", `/platform/v23/marketplace/installs/${installId}/uninstall`);
|
|
2876
|
+
}
|
|
2877
|
+
/** Admin, idempotent. */
|
|
2878
|
+
seed() {
|
|
2879
|
+
return this.t.request("POST", "/platform/v23/marketplace/seed");
|
|
2880
|
+
}
|
|
2881
|
+
};
|
|
2882
|
+
var PlatformV24Resource = class {
|
|
2883
|
+
constructor(t) {
|
|
2884
|
+
this.t = t;
|
|
2885
|
+
}
|
|
2886
|
+
t;
|
|
2887
|
+
createLogicFunction(input) {
|
|
2888
|
+
return this.t.request("POST", "/platform/v24/logic/functions", { json: input });
|
|
2889
|
+
}
|
|
2890
|
+
listLogicFunctions() {
|
|
2891
|
+
return this.t.request("GET", "/platform/v24/logic/functions");
|
|
2892
|
+
}
|
|
2893
|
+
invokeLogicFunction(fnId, inputs) {
|
|
2894
|
+
return this.t.request("POST", `/platform/v24/logic/functions/${fnId}/invoke`, {
|
|
2895
|
+
json: { inputs }
|
|
2896
|
+
});
|
|
2897
|
+
}
|
|
2898
|
+
openAssistSession(surface, context) {
|
|
2899
|
+
return this.t.request("POST", "/platform/v24/assist/sessions", {
|
|
2900
|
+
json: { surface, context }
|
|
2901
|
+
});
|
|
2902
|
+
}
|
|
2903
|
+
assistTurn(sessionId, content) {
|
|
2904
|
+
return this.t.request("POST", `/platform/v24/assist/sessions/${sessionId}/turn`, {
|
|
2905
|
+
json: { content }
|
|
2906
|
+
});
|
|
2907
|
+
}
|
|
2908
|
+
createView(input) {
|
|
2909
|
+
return this.t.request("POST", "/platform/v24/views", { json: input });
|
|
2910
|
+
}
|
|
2911
|
+
materializeView(viewId) {
|
|
2912
|
+
return this.t.request("POST", `/platform/v24/views/${viewId}/materialize`);
|
|
2913
|
+
}
|
|
2914
|
+
listTemplates() {
|
|
2915
|
+
return this.t.request("GET", "/platform/v24/marketplace/templates");
|
|
2916
|
+
}
|
|
2917
|
+
installTemplate(templateId, config) {
|
|
2918
|
+
return this.t.request("POST", "/platform/v24/marketplace/install", {
|
|
2919
|
+
json: { template_id: templateId, config }
|
|
2920
|
+
});
|
|
2921
|
+
}
|
|
2922
|
+
createRule(input) {
|
|
2923
|
+
return this.t.request("POST", "/platform/v24/rules", { json: input });
|
|
2924
|
+
}
|
|
2925
|
+
evaluateRules(trigger, subject) {
|
|
2926
|
+
return this.t.request("POST", "/platform/v24/rules/evaluate", {
|
|
2927
|
+
json: { trigger, subject }
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
2930
|
+
recordCheckpoint(pipeline, step, opts = {}) {
|
|
2931
|
+
return this.t.request("POST", "/platform/v24/checkpoints", {
|
|
2932
|
+
json: { pipeline, step, status: opts.status ?? "OK", state: opts.state }
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
resumePipeline(pipeline) {
|
|
2936
|
+
return this.t.request("GET", `/platform/v24/checkpoints/${pipeline}/resume`);
|
|
2937
|
+
}
|
|
2938
|
+
createExpectation(input) {
|
|
2939
|
+
return this.t.request("POST", "/platform/v24/expectations", { json: input });
|
|
2940
|
+
}
|
|
2941
|
+
runExpectation(expId) {
|
|
2942
|
+
return this.t.request("POST", `/platform/v24/expectations/${expId}/run`);
|
|
2943
|
+
}
|
|
2944
|
+
submitChangeRequest(input) {
|
|
2945
|
+
return this.t.request("POST", "/platform/v24/change-requests", { json: input });
|
|
2946
|
+
}
|
|
2947
|
+
reviewChangeRequest(crId, status, note) {
|
|
2948
|
+
return this.t.request("POST", `/platform/v24/change-requests/${crId}/review`, {
|
|
2949
|
+
json: { status, note }
|
|
2950
|
+
});
|
|
2951
|
+
}
|
|
2952
|
+
createScenario(input) {
|
|
2953
|
+
return this.t.request("POST", "/platform/v24/scenarios", { json: input });
|
|
2954
|
+
}
|
|
2955
|
+
simulateScenario(scenarioId) {
|
|
2956
|
+
return this.t.request("POST", `/platform/v24/scenarios/${scenarioId}/simulate`);
|
|
2957
|
+
}
|
|
2958
|
+
createNotebook(input) {
|
|
2959
|
+
return this.t.request("POST", "/platform/v24/quiver/notebooks", { json: input });
|
|
2960
|
+
}
|
|
2961
|
+
createAgent(input) {
|
|
2962
|
+
return this.t.request("POST", "/platform/v24/agent-studio/agents", { json: input });
|
|
2963
|
+
}
|
|
2964
|
+
createEvalDashboard(input) {
|
|
2965
|
+
return this.t.request("POST", "/platform/v24/eval-dashboards", { json: input });
|
|
2966
|
+
}
|
|
2967
|
+
renderEvalDashboard(dashId) {
|
|
2968
|
+
return this.t.request("GET", `/platform/v24/eval-dashboards/${dashId}/render`);
|
|
2969
|
+
}
|
|
2970
|
+
addVerticalTab(input) {
|
|
2971
|
+
return this.t.request("POST", "/platform/v24/vertical-tabs", { json: input });
|
|
2972
|
+
}
|
|
2973
|
+
createAggregation(input) {
|
|
2974
|
+
return this.t.request("POST", "/platform/v24/aggregations", { json: input });
|
|
2975
|
+
}
|
|
2976
|
+
runAggregation(aggId) {
|
|
2977
|
+
return this.t.request("POST", `/platform/v24/aggregations/${aggId}/run`);
|
|
2978
|
+
}
|
|
2979
|
+
/** Multi-hop object-set traversal (gate `workshop.apps.read`). */
|
|
2980
|
+
searchAround(input) {
|
|
2981
|
+
return this.t.request("POST", "/workshop/object-set/search-around", { json: input });
|
|
2982
|
+
}
|
|
2983
|
+
/** On-the-fly aggregation: count/sum/avg/min/max/distinct_count/cardinality. */
|
|
2984
|
+
aggregateObjectSet(input) {
|
|
2985
|
+
return this.t.request("POST", "/workshop/object-set/aggregate", { json: input });
|
|
2986
|
+
}
|
|
2987
|
+
createOsdkToken(name, scopes) {
|
|
2988
|
+
return this.t.request("POST", "/platform/v24/osdk-tokens", { json: { name, scopes } });
|
|
2989
|
+
}
|
|
2990
|
+
verifyOsdkToken(token) {
|
|
2991
|
+
return this.t.request("POST", "/platform/v24/osdk-tokens/verify", { json: { token } });
|
|
2992
|
+
}
|
|
2993
|
+
createAutomation(input) {
|
|
2994
|
+
return this.t.request("POST", "/platform/v24/automations", { json: input });
|
|
2995
|
+
}
|
|
2996
|
+
runAutomation(autoId) {
|
|
2997
|
+
return this.t.request("POST", `/platform/v24/automations/${autoId}/run`);
|
|
2998
|
+
}
|
|
2999
|
+
computeOntologyMetrics() {
|
|
3000
|
+
return this.t.request("POST", "/platform/v24/metrics/compute");
|
|
3001
|
+
}
|
|
3002
|
+
forkThread(parentSessionId, branchName, forkAtMessage = 0) {
|
|
3003
|
+
return this.t.request("POST", "/platform/v24/thread-branches", {
|
|
3004
|
+
json: {
|
|
3005
|
+
parent_session_id: parentSessionId,
|
|
3006
|
+
branch_name: branchName,
|
|
3007
|
+
fork_at_message: forkAtMessage
|
|
3008
|
+
}
|
|
3009
|
+
});
|
|
3010
|
+
}
|
|
3011
|
+
};
|
|
3012
|
+
var PlatformV25Resource = class {
|
|
3013
|
+
constructor(t) {
|
|
3014
|
+
this.t = t;
|
|
3015
|
+
}
|
|
3016
|
+
t;
|
|
3017
|
+
// machinery
|
|
3018
|
+
listProcesses() {
|
|
3019
|
+
return this.t.request("GET", "/platform/v25/machinery/processes");
|
|
3020
|
+
}
|
|
3021
|
+
createProcess(input) {
|
|
3022
|
+
return this.t.request("POST", "/platform/v25/machinery/processes", { json: input });
|
|
3023
|
+
}
|
|
3024
|
+
startProcessInstance(processId, opts = {}) {
|
|
3025
|
+
return this.t.request("POST", `/platform/v25/machinery/processes/${processId}/instances`, {
|
|
3026
|
+
json: opts
|
|
3027
|
+
});
|
|
3028
|
+
}
|
|
3029
|
+
transitionProcessInstance(instanceId, to, reason) {
|
|
3030
|
+
return this.t.request("POST", `/platform/v25/machinery/instances/${instanceId}/transition`, {
|
|
3031
|
+
json: { to, reason }
|
|
3032
|
+
});
|
|
3033
|
+
}
|
|
3034
|
+
// branch protection
|
|
3035
|
+
setBranchProtection(dataset, branch, opts = {}) {
|
|
3036
|
+
return this.t.request("PUT", `/platform/v25/branch-protection/${dataset}/${branch}`, {
|
|
3037
|
+
json: {
|
|
3038
|
+
require_approvals: opts.require_approvals ?? 1,
|
|
3039
|
+
block_direct_commit: opts.block_direct_commit ?? true,
|
|
3040
|
+
required_clearances: opts.required_clearances,
|
|
3041
|
+
required_reviewers: opts.required_reviewers
|
|
3042
|
+
}
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
evaluateBranchProtection(dataset, branch, opts = {}) {
|
|
3046
|
+
return this.t.request("POST", "/platform/v25/branch-protection/evaluate", {
|
|
3047
|
+
json: { dataset, branch, ...opts }
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
// kiosk
|
|
3051
|
+
mintKioskSession(appId, opts = {}) {
|
|
3052
|
+
return this.t.request("POST", "/platform/v25/kiosk/sessions", {
|
|
3053
|
+
json: {
|
|
3054
|
+
app_id: appId,
|
|
3055
|
+
display_name: opts.display_name ?? "kiosk",
|
|
3056
|
+
allowed_markings: opts.allowed_markings,
|
|
3057
|
+
ttl_hours: opts.ttl_hours ?? 24
|
|
3058
|
+
}
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
3061
|
+
verifyKioskToken(token) {
|
|
3062
|
+
return this.t.request("POST", "/platform/v25/kiosk/verify", { json: { token } });
|
|
3063
|
+
}
|
|
3064
|
+
// analyst threads
|
|
3065
|
+
newAnalystThread(title = "Analyst thread") {
|
|
3066
|
+
return this.t.request("POST", "/platform/v25/aip/analyst/threads", { json: { title } });
|
|
3067
|
+
}
|
|
3068
|
+
postAnalystMessage(threadId, input) {
|
|
3069
|
+
return this.t.request("POST", `/platform/v25/aip/analyst/threads/${threadId}/messages`, {
|
|
3070
|
+
json: input
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
// dataset ops
|
|
3074
|
+
rollbackDataset(dataset, toAssetId, opts = {}) {
|
|
3075
|
+
return this.t.request("POST", `/platform/v25/datasets/${dataset}/rollback`, {
|
|
3076
|
+
json: { branch: opts.branch ?? "main", to_asset_id: toAssetId, reason: opts.reason ?? "" }
|
|
3077
|
+
});
|
|
3078
|
+
}
|
|
3079
|
+
queueSnapshot(dataset, branch = "main") {
|
|
3080
|
+
return this.t.request("POST", `/platform/v25/datasets/${dataset}/queue-snapshot`, {
|
|
3081
|
+
json: { branch }
|
|
3082
|
+
});
|
|
3083
|
+
}
|
|
3084
|
+
peekSnapshotQueue(dataset, branch = "main") {
|
|
3085
|
+
return this.t.request("GET", `/platform/v25/datasets/${dataset}/queue-snapshot`, {
|
|
3086
|
+
params: { branch }
|
|
3087
|
+
});
|
|
3088
|
+
}
|
|
3089
|
+
setTransactionLimits(dataset, opts = {}) {
|
|
3090
|
+
return this.t.request("PUT", `/platform/v25/datasets/${dataset}/transaction-limits`, {
|
|
3091
|
+
json: { branch: "main", max_rows: 0, max_bytes: 0, max_open: 0, ...opts }
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3094
|
+
/** Repeated `dataset` query params. */
|
|
3095
|
+
checkFreshness(datasets) {
|
|
3096
|
+
return this.t.request("GET", "/platform/v25/workshop/widgets/data-freshness", {
|
|
3097
|
+
params: { dataset: datasets }
|
|
3098
|
+
});
|
|
3099
|
+
}
|
|
3100
|
+
// code scan
|
|
3101
|
+
raiseCodeScanFinding(input) {
|
|
3102
|
+
return this.t.request("POST", "/platform/v25/code-scan/findings", { json: input });
|
|
3103
|
+
}
|
|
3104
|
+
codeScanSummary(repoRef) {
|
|
3105
|
+
return this.t.request("GET", `/platform/v25/code-scan/summary/${repoRef}`);
|
|
3106
|
+
}
|
|
3107
|
+
// evals
|
|
3108
|
+
generateEvals(subjectFunction, opts = {}) {
|
|
3109
|
+
return this.t.request("POST", "/platform/v25/evals/generate", {
|
|
3110
|
+
json: {
|
|
3111
|
+
subject_function: subjectFunction,
|
|
3112
|
+
description: opts.description ?? "",
|
|
3113
|
+
count: opts.count ?? 5
|
|
3114
|
+
}
|
|
3115
|
+
});
|
|
3116
|
+
}
|
|
3117
|
+
analyzeEvals(evalRunId, failures) {
|
|
3118
|
+
return this.t.request("POST", "/platform/v25/evals/analyze", {
|
|
3119
|
+
json: { eval_run_id: evalRunId, failures }
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3122
|
+
};
|
|
3123
|
+
var PlatformV26Resource = class {
|
|
3124
|
+
constructor(t) {
|
|
3125
|
+
this.t = t;
|
|
3126
|
+
}
|
|
3127
|
+
t;
|
|
3128
|
+
listPromotions() {
|
|
3129
|
+
return this.t.request("GET", "/platform/v26/promotions");
|
|
3130
|
+
}
|
|
3131
|
+
promoteObjectType(objectType, opts = {}) {
|
|
3132
|
+
return this.t.request("POST", "/platform/v26/promotions", {
|
|
3133
|
+
json: { object_type: objectType, status: opts.status ?? "verified", justification: opts.justification }
|
|
3134
|
+
});
|
|
3135
|
+
}
|
|
3136
|
+
listObjectViews(objectType) {
|
|
3137
|
+
return this.t.request("GET", "/platform/v26/object-views", {
|
|
3138
|
+
params: { object_type: objectType }
|
|
3139
|
+
});
|
|
3140
|
+
}
|
|
3141
|
+
createObjectView(objectType, branch, opts = {}) {
|
|
3142
|
+
return this.t.request("POST", "/platform/v26/object-views", {
|
|
3143
|
+
json: {
|
|
3144
|
+
object_type: objectType,
|
|
3145
|
+
branch,
|
|
3146
|
+
parent_branch: opts.parent_branch ?? "main",
|
|
3147
|
+
view_spec: opts.view_spec
|
|
3148
|
+
}
|
|
3149
|
+
});
|
|
3150
|
+
}
|
|
3151
|
+
publishObjectView(branchId) {
|
|
3152
|
+
return this.t.request("POST", `/platform/v26/object-views/${branchId}/publish`);
|
|
3153
|
+
}
|
|
3154
|
+
generateCoreView(objectType, topN = 8) {
|
|
3155
|
+
return this.t.request("POST", `/platform/v26/core-views/generate/${objectType}`, {
|
|
3156
|
+
params: { top_n: topN }
|
|
3157
|
+
});
|
|
3158
|
+
}
|
|
3159
|
+
getCoreView(objectType) {
|
|
3160
|
+
return this.t.request("GET", `/platform/v26/core-views/${objectType}`);
|
|
3161
|
+
}
|
|
3162
|
+
reserveCapacity(provider, model, opts = {}) {
|
|
3163
|
+
return this.t.request("POST", "/platform/v26/capacity/reservations", {
|
|
3164
|
+
json: { provider, model, reserved_tpm: 0, reserved_rpm: 0, ...opts }
|
|
3165
|
+
});
|
|
3166
|
+
}
|
|
3167
|
+
consumeCapacity(provider, model, opts = {}) {
|
|
3168
|
+
return this.t.request("POST", "/platform/v26/capacity/consume", {
|
|
3169
|
+
json: { provider, model, tokens: opts.tokens ?? 0, requests: opts.requests ?? 1 }
|
|
3170
|
+
});
|
|
3171
|
+
}
|
|
3172
|
+
/** Webhook listener — the secret is returned once. */
|
|
3173
|
+
createListener(slug, opts = {}) {
|
|
3174
|
+
return this.t.request("POST", "/platform/v26/listeners", {
|
|
3175
|
+
json: { slug, integration: opts.integration ?? "generic", ...opts }
|
|
3176
|
+
});
|
|
3177
|
+
}
|
|
3178
|
+
listenerEvents(listenerId) {
|
|
3179
|
+
return this.t.request("GET", `/platform/v26/listeners/${listenerId}/events`);
|
|
3180
|
+
}
|
|
3181
|
+
/** mode ∈ report_only|hash|redact */
|
|
3182
|
+
scanSensitive(payload, opts = {}) {
|
|
3183
|
+
return this.t.request("POST", "/platform/v26/scanner/scan", {
|
|
3184
|
+
json: { payload, mode: opts.mode ?? "report_only", scope: opts.scope ?? "inline", scope_ref: opts.scope_ref }
|
|
3185
|
+
});
|
|
3186
|
+
}
|
|
3187
|
+
scanHistory(limit = 50) {
|
|
3188
|
+
return this.t.request("GET", "/platform/v26/scanner/scans", { params: { limit } });
|
|
3189
|
+
}
|
|
3190
|
+
createMonitoringView(slug, displayName, opts = {}) {
|
|
3191
|
+
return this.t.request("POST", "/platform/v26/monitoring", {
|
|
3192
|
+
json: {
|
|
3193
|
+
slug,
|
|
3194
|
+
display_name: displayName,
|
|
3195
|
+
project_scope: opts.project_scope,
|
|
3196
|
+
resource_kinds: opts.resource_kinds ?? ["object_type", "action"]
|
|
3197
|
+
}
|
|
3198
|
+
});
|
|
3199
|
+
}
|
|
3200
|
+
monitoringRollup(slug) {
|
|
3201
|
+
return this.t.request("GET", `/platform/v26/monitoring/${slug}/rollup`);
|
|
3202
|
+
}
|
|
3203
|
+
createHealthCheck(datasetName, name, checkType, spec) {
|
|
3204
|
+
return this.t.request("POST", "/platform/v26/health/checks", {
|
|
3205
|
+
json: { dataset_name: datasetName, name, check_type: checkType, spec }
|
|
3206
|
+
});
|
|
3207
|
+
}
|
|
3208
|
+
runHealthCheck(checkId, branch = "main") {
|
|
3209
|
+
return this.t.request("POST", `/platform/v26/health/checks/${checkId}/run`, {
|
|
3210
|
+
params: { branch }
|
|
3211
|
+
});
|
|
3212
|
+
}
|
|
3213
|
+
healthRuns(checkId, limit = 50) {
|
|
3214
|
+
return this.t.request("GET", `/platform/v26/health/checks/${checkId}/runs`, {
|
|
3215
|
+
params: { limit }
|
|
3216
|
+
});
|
|
3217
|
+
}
|
|
3218
|
+
/** Hash-referenced version metadata — no binary body. */
|
|
3219
|
+
uploadMediaVersion(mediaSet, path, input) {
|
|
3220
|
+
return this.t.request("POST", "/platform/v26/media/upload", {
|
|
3221
|
+
json: { media_set: mediaSet, path, size_bytes: 0, ...input }
|
|
3222
|
+
});
|
|
3223
|
+
}
|
|
3224
|
+
mediaHistory(mediaSet, path) {
|
|
3225
|
+
return this.t.request("GET", "/platform/v26/media/items/history", {
|
|
3226
|
+
params: { media_set: mediaSet, path }
|
|
3227
|
+
});
|
|
3228
|
+
}
|
|
3229
|
+
createInsight(slug, input) {
|
|
3230
|
+
return this.t.request("POST", "/platform/v26/insight", { json: { slug, ...input } });
|
|
3231
|
+
}
|
|
3232
|
+
executeInsight(analysisId) {
|
|
3233
|
+
return this.t.request("POST", `/platform/v26/insight/${analysisId}/execute`);
|
|
3234
|
+
}
|
|
3235
|
+
createPeer(slug, displayName, remoteUrl, authToken) {
|
|
3236
|
+
return this.t.request("POST", "/platform/v26/peers", {
|
|
3237
|
+
json: { slug, display_name: displayName, remote_url: remoteUrl, auth_token: authToken }
|
|
3238
|
+
});
|
|
3239
|
+
}
|
|
3240
|
+
syncPeer(peerId, input) {
|
|
3241
|
+
return this.t.request("POST", `/platform/v26/peers/${peerId}/sync`, { json: input });
|
|
3242
|
+
}
|
|
3243
|
+
listPeerMirrors(peerId) {
|
|
3244
|
+
return this.t.request("GET", `/platform/v26/peers/${peerId}/mirrors`);
|
|
3245
|
+
}
|
|
3246
|
+
runHistory(opts = {}) {
|
|
3247
|
+
return this.t.request("GET", "/platform/v26/run-history", {
|
|
3248
|
+
params: { limit: 200, ...opts }
|
|
3249
|
+
});
|
|
3250
|
+
}
|
|
3251
|
+
};
|
|
3252
|
+
|
|
3253
|
+
// src/client.ts
|
|
3254
|
+
var RETRIABLE_STATUS = /* @__PURE__ */ new Set([429, 502, 503, 504]);
|
|
3255
|
+
function isRetriableError(err) {
|
|
3256
|
+
if (err instanceof AegisAPIError) return RETRIABLE_STATUS.has(err.statusCode);
|
|
3257
|
+
if (err instanceof TypeError) return true;
|
|
3258
|
+
return err instanceof Error && err.name === "TimeoutError";
|
|
3259
|
+
}
|
|
3260
|
+
function backoffDelay(attempt, base, max) {
|
|
3261
|
+
const exp = Math.min(max, base * 2 ** (attempt - 1));
|
|
3262
|
+
return exp * (0.5 + Math.random() * 0.5);
|
|
3263
|
+
}
|
|
3264
|
+
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
3265
|
+
function envVar(name) {
|
|
3266
|
+
if (typeof process !== "undefined" && process.env) return process.env[name];
|
|
3267
|
+
return void 0;
|
|
3268
|
+
}
|
|
3269
|
+
var AegisClient = class {
|
|
3270
|
+
baseUrl;
|
|
3271
|
+
_token;
|
|
3272
|
+
timeoutMs;
|
|
3273
|
+
_fetchOverride;
|
|
3274
|
+
_fetchInit;
|
|
3275
|
+
_refreshToken;
|
|
3276
|
+
_retry;
|
|
3277
|
+
_refreshInFlight = null;
|
|
3278
|
+
auth;
|
|
3279
|
+
iam;
|
|
3280
|
+
osdk;
|
|
3281
|
+
operator;
|
|
3282
|
+
ontology;
|
|
3283
|
+
aip;
|
|
3284
|
+
functions;
|
|
3285
|
+
codeRepositories;
|
|
3286
|
+
datasets;
|
|
3287
|
+
// Reading / consumption
|
|
3288
|
+
geo;
|
|
3289
|
+
mapTemplates;
|
|
3290
|
+
media;
|
|
3291
|
+
docs;
|
|
3292
|
+
pages;
|
|
3293
|
+
dossier;
|
|
3294
|
+
timeseries;
|
|
3295
|
+
// Operational
|
|
3296
|
+
alerts;
|
|
3297
|
+
alarms;
|
|
3298
|
+
events;
|
|
3299
|
+
connectors;
|
|
3300
|
+
pipelines;
|
|
3301
|
+
chat;
|
|
3302
|
+
notepad;
|
|
3303
|
+
// Governance
|
|
3304
|
+
lineage;
|
|
3305
|
+
accessAudit;
|
|
3306
|
+
markings;
|
|
3307
|
+
resourceMarkings;
|
|
3308
|
+
propertyMarkings;
|
|
3309
|
+
rowPolicies;
|
|
3310
|
+
erasure;
|
|
3311
|
+
retention;
|
|
3312
|
+
guestTokens;
|
|
3313
|
+
// Domain
|
|
3314
|
+
atlas;
|
|
3315
|
+
briefing;
|
|
3316
|
+
campaign;
|
|
3317
|
+
cctv;
|
|
3318
|
+
comunicados;
|
|
3319
|
+
edge;
|
|
3320
|
+
video;
|
|
3321
|
+
// Collaboration / apps
|
|
3322
|
+
appShell;
|
|
3323
|
+
forms;
|
|
3324
|
+
/** Alias of `iam.groups` (mirrors Python's standalone `client.groups`). */
|
|
3325
|
+
groups;
|
|
3326
|
+
organizations;
|
|
3327
|
+
projects;
|
|
3328
|
+
solutions;
|
|
3329
|
+
spaces;
|
|
3330
|
+
workspaces;
|
|
3331
|
+
workspaceUpdates;
|
|
3332
|
+
marketplace;
|
|
3333
|
+
// Versioned platform surfaces
|
|
3334
|
+
platformV22;
|
|
3335
|
+
platformV23;
|
|
3336
|
+
platformV24;
|
|
3337
|
+
platformV25;
|
|
3338
|
+
platformV26;
|
|
3339
|
+
// Platform
|
|
3340
|
+
workshop;
|
|
3341
|
+
compute;
|
|
3342
|
+
inference;
|
|
3343
|
+
codegen;
|
|
3344
|
+
correlation;
|
|
3345
|
+
situational;
|
|
3346
|
+
merge;
|
|
3347
|
+
constructor(options = {}) {
|
|
3348
|
+
const baseUrl = options.baseUrl ?? envVar("AEGIS_API_URL") ?? "http://localhost:8002";
|
|
3349
|
+
this.baseUrl = baseUrl.replace(/\/+$/, "");
|
|
3350
|
+
this._token = options.token ?? envVar("AEGIS_TOKEN") ?? null;
|
|
3351
|
+
this.timeoutMs = options.timeoutMs ?? 15e3;
|
|
3352
|
+
this._fetchOverride = options.fetch;
|
|
3353
|
+
this._fetchInit = options.fetchInit ?? {};
|
|
3354
|
+
this._refreshToken = options.refreshToken ?? null;
|
|
3355
|
+
this._retry = {
|
|
3356
|
+
retries: options.retry?.retries ?? 2,
|
|
3357
|
+
baseDelayMs: options.retry?.baseDelayMs ?? 250,
|
|
3358
|
+
maxDelayMs: options.retry?.maxDelayMs ?? 4e3,
|
|
3359
|
+
retryPost: options.retry?.retryPost ?? false
|
|
3360
|
+
};
|
|
3361
|
+
this.auth = new AuthResource(this, (pair) => {
|
|
3362
|
+
this.setToken(pair.access_token);
|
|
3363
|
+
if (pair.refresh_token) this.setRefreshToken(pair.refresh_token);
|
|
3364
|
+
});
|
|
3365
|
+
this.iam = new IamResource(this);
|
|
3366
|
+
this.osdk = new OsdkResource(this);
|
|
3367
|
+
this.operator = new OperatorResource(this);
|
|
3368
|
+
this.ontology = new OntologyResource(this);
|
|
3369
|
+
this.aip = new AipResource(this);
|
|
3370
|
+
this.functions = new FunctionsResource(this);
|
|
3371
|
+
this.codeRepositories = new CodeRepositoriesResource(this);
|
|
3372
|
+
this.datasets = new DatasetsResource(this);
|
|
3373
|
+
this.geo = new GeoResource(this);
|
|
3374
|
+
this.mapTemplates = new MapTemplatesResource(this);
|
|
3375
|
+
this.media = new MediaResource(this);
|
|
3376
|
+
this.docs = new DocsResource(this);
|
|
3377
|
+
this.pages = new PagesResource(this);
|
|
3378
|
+
this.dossier = new DossierResource(this);
|
|
3379
|
+
this.timeseries = new TimeSeriesResource(this);
|
|
3380
|
+
this.alerts = new AlertsResource(this);
|
|
3381
|
+
this.alarms = new AlarmsResource(this);
|
|
3382
|
+
this.events = new EventsResource(this);
|
|
3383
|
+
this.connectors = new ConnectorsResource(this);
|
|
3384
|
+
this.pipelines = new PipelinesResource(this);
|
|
3385
|
+
this.chat = new ChatResource(this);
|
|
3386
|
+
this.notepad = new NotepadResource(this);
|
|
3387
|
+
this.lineage = new LineageResource(this);
|
|
3388
|
+
this.accessAudit = new AccessAuditResource(this);
|
|
3389
|
+
this.markings = new MarkingsResource(this);
|
|
3390
|
+
this.resourceMarkings = new ResourceMarkingsResource(this);
|
|
3391
|
+
this.propertyMarkings = new PropertyMarkingsResource(this);
|
|
3392
|
+
this.rowPolicies = new RowPoliciesResource(this);
|
|
3393
|
+
this.erasure = new ErasureResource(this);
|
|
3394
|
+
this.retention = new RetentionResource(this);
|
|
3395
|
+
this.guestTokens = new GuestTokensResource(this);
|
|
3396
|
+
this.atlas = new AtlasResource(this);
|
|
3397
|
+
this.briefing = new BriefingResource(this);
|
|
3398
|
+
this.campaign = new CampaignResource(this);
|
|
3399
|
+
this.cctv = new CctvResource(this);
|
|
3400
|
+
this.comunicados = new ComunicadosResource(this);
|
|
3401
|
+
this.edge = new EdgeResource(this);
|
|
3402
|
+
this.video = new VideoResource(this);
|
|
3403
|
+
this.appShell = new AppShellResource(this);
|
|
3404
|
+
this.forms = new FormsResource(this);
|
|
3405
|
+
this.groups = this.iam.groups;
|
|
3406
|
+
this.organizations = new OrganizationsResource(this);
|
|
3407
|
+
this.projects = new ProjectsResource(this);
|
|
3408
|
+
this.solutions = new SolutionsResource(this);
|
|
3409
|
+
this.spaces = new SpacesResource(this);
|
|
3410
|
+
this.workspaces = new WorkspacesResource(this);
|
|
3411
|
+
this.workspaceUpdates = new WorkspaceUpdatesResource(this);
|
|
3412
|
+
this.marketplace = new MarketplaceResource(this);
|
|
3413
|
+
this.platformV22 = new PlatformV22Resource(this);
|
|
3414
|
+
this.platformV23 = new PlatformV23Resource(this);
|
|
3415
|
+
this.platformV24 = new PlatformV24Resource(this);
|
|
3416
|
+
this.platformV25 = new PlatformV25Resource(this);
|
|
3417
|
+
this.platformV26 = new PlatformV26Resource(this);
|
|
3418
|
+
this.workshop = new WorkshopResource(this);
|
|
3419
|
+
this.compute = new ComputeResource(this);
|
|
3420
|
+
this.inference = new InferenceResource(this);
|
|
3421
|
+
this.codegen = new CodegenResource(this);
|
|
3422
|
+
this.correlation = new CorrelationResource(this);
|
|
3423
|
+
this.situational = new SituationalResource(this);
|
|
3424
|
+
this.merge = new MergeResource(this);
|
|
3425
|
+
}
|
|
3426
|
+
/** Replace the active bearer token (or clear with `null`). */
|
|
3427
|
+
setToken(token) {
|
|
3428
|
+
this._token = token;
|
|
3429
|
+
}
|
|
3430
|
+
/** Replace the refresh token used for automatic 401 recovery. */
|
|
3431
|
+
setRefreshToken(token) {
|
|
3432
|
+
this._refreshToken = token;
|
|
3433
|
+
}
|
|
3434
|
+
get token() {
|
|
3435
|
+
return this._token;
|
|
3436
|
+
}
|
|
3437
|
+
get _fetch() {
|
|
3438
|
+
if (this._fetchOverride) return this._fetchOverride;
|
|
3439
|
+
const globalFetch = globalThis.fetch;
|
|
3440
|
+
if (!globalFetch) {
|
|
3441
|
+
throw new Error("no fetch available \u2014 Node >= 18, a browser, or pass options.fetch");
|
|
3442
|
+
}
|
|
3443
|
+
return globalFetch.bind(globalThis);
|
|
3444
|
+
}
|
|
3445
|
+
/** Generic escape hatch — call any AEGIS endpoint not yet wrapped.
|
|
3446
|
+
* Transient failures are retried with backoff (see `RetryOptions`);
|
|
3447
|
+
* a 401 triggers one transparent `POST /auth/refresh` + retry when a
|
|
3448
|
+
* refresh token is held. */
|
|
3449
|
+
async request(method, path, opts = {}) {
|
|
3450
|
+
try {
|
|
3451
|
+
return await this._requestWithRetry(method, path, opts);
|
|
3452
|
+
} catch (err) {
|
|
3453
|
+
const refreshable = err instanceof AuthError && this._refreshToken !== null && !path.startsWith("/auth/");
|
|
3454
|
+
if (!refreshable) throw err;
|
|
3455
|
+
await this._refreshOnce();
|
|
3456
|
+
return this._requestWithRetry(method, path, opts);
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
/** Rotate the refresh token (single-flight) and attach the new pair. */
|
|
3460
|
+
_refreshOnce() {
|
|
3461
|
+
this._refreshInFlight ??= (async () => {
|
|
3462
|
+
try {
|
|
3463
|
+
const pair = await this._requestWithRetry("POST", "/auth/refresh", {
|
|
3464
|
+
json: { refresh_token: this._refreshToken }
|
|
3465
|
+
});
|
|
3466
|
+
this._token = pair.access_token;
|
|
3467
|
+
this._refreshToken = pair.refresh_token ?? this._refreshToken;
|
|
3468
|
+
} catch (err) {
|
|
3469
|
+
if (err instanceof AuthError) this._refreshToken = null;
|
|
3470
|
+
throw err;
|
|
3471
|
+
} finally {
|
|
3472
|
+
this._refreshInFlight = null;
|
|
3473
|
+
}
|
|
3474
|
+
})();
|
|
3475
|
+
return this._refreshInFlight;
|
|
3476
|
+
}
|
|
3477
|
+
async _requestWithRetry(method, path, opts) {
|
|
3478
|
+
const idempotent = method === "GET" || method === "HEAD" || this._retry.retryPost;
|
|
3479
|
+
for (let attempt = 0; ; attempt++) {
|
|
3480
|
+
try {
|
|
3481
|
+
return await this._doRequest(method, path, opts);
|
|
3482
|
+
} catch (err) {
|
|
3483
|
+
if (!idempotent || attempt >= this._retry.retries || !isRetriableError(err)) throw err;
|
|
3484
|
+
await sleep(backoffDelay(attempt + 1, this._retry.baseDelayMs, this._retry.maxDelayMs));
|
|
3485
|
+
}
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
async _doRequest(method, path, opts) {
|
|
3489
|
+
const url = buildUrl(this.baseUrl, path, opts.params);
|
|
3490
|
+
const headers = {};
|
|
3491
|
+
if (this._token) headers.Authorization = `Bearer ${this._token}`;
|
|
3492
|
+
const init = { ...this._fetchInit, method, headers };
|
|
3493
|
+
if (opts.form !== void 0) {
|
|
3494
|
+
init.body = opts.form;
|
|
3495
|
+
} else if (opts.json !== void 0) {
|
|
3496
|
+
headers["Content-Type"] = "application/json";
|
|
3497
|
+
init.body = JSON.stringify(opts.json);
|
|
3498
|
+
}
|
|
3499
|
+
if (opts.signal) {
|
|
3500
|
+
init.signal = opts.signal;
|
|
3501
|
+
} else if (typeof AbortSignal !== "undefined" && "timeout" in AbortSignal) {
|
|
3502
|
+
init.signal = AbortSignal.timeout(this.timeoutMs);
|
|
3503
|
+
}
|
|
3504
|
+
const res = await this._fetch(url, init);
|
|
3505
|
+
return handleResponse(res);
|
|
3506
|
+
}
|
|
3507
|
+
/**
|
|
3508
|
+
* Open a server-sent-events endpoint and iterate its events. Long-lived:
|
|
3509
|
+
* no default timeout is applied — pass `signal` to cancel.
|
|
3510
|
+
*
|
|
3511
|
+
* ```ts
|
|
3512
|
+
* for await (const ev of client.stream("/operator/tasks/t1/events")) { … }
|
|
3513
|
+
* ```
|
|
3514
|
+
*/
|
|
3515
|
+
async *stream(path, opts = {}) {
|
|
3516
|
+
const url = buildUrl(this.baseUrl, path, opts.params);
|
|
3517
|
+
const headers = { Accept: "text/event-stream" };
|
|
3518
|
+
if (this._token) headers.Authorization = `Bearer ${this._token}`;
|
|
3519
|
+
const init = { ...this._fetchInit, method: opts.method ?? "GET", headers };
|
|
3520
|
+
if (opts.json !== void 0) {
|
|
3521
|
+
headers["Content-Type"] = "application/json";
|
|
3522
|
+
init.body = JSON.stringify(opts.json);
|
|
3523
|
+
init.method = opts.method ?? "POST";
|
|
3524
|
+
}
|
|
3525
|
+
if (opts.signal) init.signal = opts.signal;
|
|
3526
|
+
const res = await this._fetch(url, init);
|
|
3527
|
+
if (!res.ok || !res.body) {
|
|
3528
|
+
await handleResponse(res);
|
|
3529
|
+
throw new AegisAPIError(res.status, "stream endpoint returned no body");
|
|
3530
|
+
}
|
|
3531
|
+
yield* parseSseStream(res.body);
|
|
3532
|
+
}
|
|
3533
|
+
};
|
|
3534
|
+
|
|
3535
|
+
// src/classification.ts
|
|
3536
|
+
var VALID_LEVELS = [
|
|
3537
|
+
"PUBLICO",
|
|
3538
|
+
"INTERNO",
|
|
3539
|
+
"RESTRITO",
|
|
3540
|
+
"SECRETO"
|
|
3541
|
+
];
|
|
3542
|
+
var CLASSIFICATION_RANK = {
|
|
3543
|
+
PUBLICO: 0,
|
|
3544
|
+
INTERNO: 1,
|
|
3545
|
+
RESTRITO: 2,
|
|
3546
|
+
SECRETO: 3
|
|
3547
|
+
};
|
|
3548
|
+
var CLASSIFICATION_LABEL = {
|
|
3549
|
+
PUBLICO: "P\xFAblico",
|
|
3550
|
+
INTERNO: "Interno",
|
|
3551
|
+
RESTRITO: "Restrito",
|
|
3552
|
+
SECRETO: "Secreto"
|
|
3553
|
+
};
|
|
3554
|
+
var ClassificationInvariantViolation = class extends Error {
|
|
3555
|
+
constructor(message) {
|
|
3556
|
+
super(message);
|
|
3557
|
+
this.name = "ClassificationInvariantViolation";
|
|
3558
|
+
}
|
|
3559
|
+
};
|
|
3560
|
+
function rank(level) {
|
|
3561
|
+
const r = CLASSIFICATION_RANK[level];
|
|
3562
|
+
if (r === void 0) throw new ClassificationInvariantViolation(`invalid level: ${level}`);
|
|
3563
|
+
return r;
|
|
3564
|
+
}
|
|
3565
|
+
function maxLevel(levels) {
|
|
3566
|
+
let best = "PUBLICO";
|
|
3567
|
+
for (const level of levels) {
|
|
3568
|
+
if (rank(level) > CLASSIFICATION_RANK[best]) best = level;
|
|
3569
|
+
}
|
|
3570
|
+
return best;
|
|
3571
|
+
}
|
|
3572
|
+
function validateInvariant(fileCls, dataCls, upstreamData = []) {
|
|
3573
|
+
if (rank(fileCls) < rank(dataCls)) {
|
|
3574
|
+
throw new ClassificationInvariantViolation(
|
|
3575
|
+
`file classification ${fileCls} must dominate data classification ${dataCls}`
|
|
3576
|
+
);
|
|
3577
|
+
}
|
|
3578
|
+
for (const upstream of upstreamData) {
|
|
3579
|
+
if (rank(dataCls) < rank(upstream)) {
|
|
3580
|
+
throw new ClassificationInvariantViolation(
|
|
3581
|
+
`data classification ${dataCls} must dominate upstream ${upstream}`
|
|
3582
|
+
);
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3587
|
+
// src/permissions.ts
|
|
3588
|
+
var NAV_PERMISSIONS = [
|
|
3589
|
+
"nav.section.discover",
|
|
3590
|
+
"nav.item.discover.home",
|
|
3591
|
+
"nav.section.operations",
|
|
3592
|
+
"nav.item.operations.tasks",
|
|
3593
|
+
"nav.section.core_loop",
|
|
3594
|
+
"nav.item.core_loop.alerts",
|
|
3595
|
+
"nav.item.core_loop.proposals",
|
|
3596
|
+
"nav.item.core_loop.actions",
|
|
3597
|
+
"nav.section.ontology",
|
|
3598
|
+
"nav.item.ontology.manager",
|
|
3599
|
+
"nav.item.ontology.explorer",
|
|
3600
|
+
"nav.item.ontology.types",
|
|
3601
|
+
"nav.item.ontology.actions",
|
|
3602
|
+
"nav.item.ontology.interfaces",
|
|
3603
|
+
"nav.item.ontology.links",
|
|
3604
|
+
"nav.item.ontology.views",
|
|
3605
|
+
"nav.item.ontology.aggregations",
|
|
3606
|
+
"nav.item.ontology.object_sets",
|
|
3607
|
+
"nav.section.data",
|
|
3608
|
+
"nav.item.data.datasets",
|
|
3609
|
+
"nav.item.data.pipelines",
|
|
3610
|
+
"nav.item.data.connectors",
|
|
3611
|
+
"nav.item.data.media",
|
|
3612
|
+
"nav.item.data.schedules",
|
|
3613
|
+
"nav.item.data.notepad",
|
|
3614
|
+
"nav.item.data.lineage",
|
|
3615
|
+
"nav.item.data.health",
|
|
3616
|
+
"nav.section.aip",
|
|
3617
|
+
"nav.item.aip.threads",
|
|
3618
|
+
"nav.item.aip.agents",
|
|
3619
|
+
"nav.item.aip.tools",
|
|
3620
|
+
"nav.item.aip.logic",
|
|
3621
|
+
"nav.item.aip.models",
|
|
3622
|
+
"nav.item.aip.capacity",
|
|
3623
|
+
"nav.item.aip.scenarios",
|
|
3624
|
+
"nav.item.aip.evals",
|
|
3625
|
+
"nav.item.aip.memory",
|
|
3626
|
+
"nav.item.aip.mcp_adapters",
|
|
3627
|
+
"nav.section.workshop",
|
|
3628
|
+
"nav.item.workshop.apps",
|
|
3629
|
+
"nav.section.governance",
|
|
3630
|
+
"nav.item.governance.projects",
|
|
3631
|
+
"nav.item.governance.audit",
|
|
3632
|
+
"nav.item.governance.lgpd",
|
|
3633
|
+
"nav.item.governance.trace",
|
|
3634
|
+
"nav.item.governance.rules",
|
|
3635
|
+
"nav.item.governance.change_requests",
|
|
3636
|
+
"nav.item.governance.automations",
|
|
3637
|
+
"nav.item.governance.tokens",
|
|
3638
|
+
"nav.item.governance.peers",
|
|
3639
|
+
"nav.item.governance.code_scan",
|
|
3640
|
+
"nav.item.governance.kiosk",
|
|
3641
|
+
"nav.item.governance.access",
|
|
3642
|
+
"nav.item.governance.osdk",
|
|
3643
|
+
"nav.section.resources",
|
|
3644
|
+
"nav.item.resources.docs",
|
|
3645
|
+
"nav.item.resources.template_gallery",
|
|
3646
|
+
"nav.item.resources.aegis_sdk",
|
|
3647
|
+
"nav.section.other",
|
|
3648
|
+
"nav.item.other.intel_map",
|
|
3649
|
+
"nav.item.other.cognitive",
|
|
3650
|
+
"nav.item.other.map_view",
|
|
3651
|
+
"nav.section.campanha",
|
|
3652
|
+
"nav.item.campaign.hub",
|
|
3653
|
+
"nav.item.campaign.chat",
|
|
3654
|
+
"nav.item.campaign.visibility",
|
|
3655
|
+
"nav.item.campaign.agents",
|
|
3656
|
+
"nav.item.campaign.scenarios",
|
|
3657
|
+
"nav.item.campaign.brief",
|
|
3658
|
+
"nav.section.painel-de-controle",
|
|
3659
|
+
"nav.item.painel.home",
|
|
3660
|
+
"nav.item.painel.aprovacoes",
|
|
3661
|
+
"nav.item.painel.comunicacoes",
|
|
3662
|
+
"nav.item.painel.atividade"
|
|
3663
|
+
];
|
|
3664
|
+
var CAPABILITY_PERMISSIONS = [
|
|
3665
|
+
"ontology.types.read",
|
|
3666
|
+
"ontology.types.write",
|
|
3667
|
+
"ontology.actions.read",
|
|
3668
|
+
"ontology.actions.write",
|
|
3669
|
+
"ontology.actions.execute",
|
|
3670
|
+
"ontology.actions.execute_external",
|
|
3671
|
+
"ontology.objects.read",
|
|
3672
|
+
"ontology.objects.write",
|
|
3673
|
+
"ontology.objects.bulk_delete",
|
|
3674
|
+
"ontology.links.read",
|
|
3675
|
+
"ontology.links.write",
|
|
3676
|
+
"solution.diagram.read",
|
|
3677
|
+
"solution.diagram.write",
|
|
3678
|
+
"solution.diagram.publish",
|
|
3679
|
+
"solution.diagram.delete",
|
|
3680
|
+
"solution.diagram.history.read",
|
|
3681
|
+
"solution.materialize.delete",
|
|
3682
|
+
"solution.refactor",
|
|
3683
|
+
"data.datasets.read",
|
|
3684
|
+
"data.datasets.write",
|
|
3685
|
+
"data.pipelines.read",
|
|
3686
|
+
"data.pipelines.write",
|
|
3687
|
+
"data.lineage.read",
|
|
3688
|
+
"data.connectors.read",
|
|
3689
|
+
"data.connectors.write",
|
|
3690
|
+
"aip.threads.read",
|
|
3691
|
+
"aip.threads.write",
|
|
3692
|
+
"aip.agents.read",
|
|
3693
|
+
"aip.agents.write",
|
|
3694
|
+
"aip.models.read",
|
|
3695
|
+
"aip.models.write",
|
|
3696
|
+
"aip.evals.read",
|
|
3697
|
+
"aip.evals.run",
|
|
3698
|
+
"aip.memory.read",
|
|
3699
|
+
"aip.memory.write",
|
|
3700
|
+
"workshop.apps.read",
|
|
3701
|
+
"workshop.apps.write",
|
|
3702
|
+
"workshop.apps.purge",
|
|
3703
|
+
"operator.tasks.read",
|
|
3704
|
+
"operator.tasks.write",
|
|
3705
|
+
"governance.audit.read",
|
|
3706
|
+
"governance.rules.read",
|
|
3707
|
+
"governance.rules.write",
|
|
3708
|
+
"governance.change_requests.read",
|
|
3709
|
+
"governance.change_requests.write",
|
|
3710
|
+
"governance.change_requests.approve",
|
|
3711
|
+
"governance.tokens.read",
|
|
3712
|
+
"governance.tokens.write",
|
|
3713
|
+
"governance.lgpd.read",
|
|
3714
|
+
"governance.lgpd.write",
|
|
3715
|
+
"governance.peers.read",
|
|
3716
|
+
"governance.peers.write",
|
|
3717
|
+
"governance.kiosk.read",
|
|
3718
|
+
"governance.kiosk.write",
|
|
3719
|
+
"admin.acessos",
|
|
3720
|
+
"admin.classificacao",
|
|
3721
|
+
"admin.auditoria",
|
|
3722
|
+
"admin.federacao",
|
|
3723
|
+
"admin.unidades",
|
|
3724
|
+
"admin.templates",
|
|
3725
|
+
"admin.automacoes",
|
|
3726
|
+
"admin.tokens",
|
|
3727
|
+
"campaign.chat.read",
|
|
3728
|
+
"campaign.chat.write",
|
|
3729
|
+
"campaign.brief.read",
|
|
3730
|
+
"campaign.brief.generate",
|
|
3731
|
+
"campaign.brief.sign",
|
|
3732
|
+
"campaign.scenario.read",
|
|
3733
|
+
"campaign.scenario.run",
|
|
3734
|
+
"campaign.scenario.write",
|
|
3735
|
+
"campaign.visibility.read",
|
|
3736
|
+
"campaign.visibility.pin",
|
|
3737
|
+
"campaign.visibility.escalate",
|
|
3738
|
+
"campaign.agents.read",
|
|
3739
|
+
"campaign.agents.write",
|
|
3740
|
+
"campaign.agents.run",
|
|
3741
|
+
"campaign.flows.read",
|
|
3742
|
+
"campaign.flows.write",
|
|
3743
|
+
"campaign.flows.run",
|
|
3744
|
+
"campaign.briefing.read",
|
|
3745
|
+
"campaign.briefing.refresh",
|
|
3746
|
+
"campaign.briefing.headline",
|
|
3747
|
+
"campaign.briefing.crisis_override",
|
|
3748
|
+
"vault.cookies.manage",
|
|
3749
|
+
"iam.users.read",
|
|
3750
|
+
"iam.users.write",
|
|
3751
|
+
"iam.roles.read",
|
|
3752
|
+
"iam.roles.write",
|
|
3753
|
+
"iam.permissions.read",
|
|
3754
|
+
"iam.permissions.write",
|
|
3755
|
+
"iam.nav.read",
|
|
3756
|
+
"iam.nav.write",
|
|
3757
|
+
"iam.audit.read",
|
|
3758
|
+
"iam.groups.read",
|
|
3759
|
+
"iam.groups.write",
|
|
3760
|
+
"iam.groups.manage_members",
|
|
3761
|
+
"docs.tree.read",
|
|
3762
|
+
"docs.content.read",
|
|
3763
|
+
"aip.flows.read",
|
|
3764
|
+
"aip.flows.write",
|
|
3765
|
+
"aip.flows.execute",
|
|
3766
|
+
"aip.agents.execute",
|
|
3767
|
+
"briefing.read",
|
|
3768
|
+
"briefing.refresh",
|
|
3769
|
+
"ontology.objects.view",
|
|
3770
|
+
"ontology.graph.read",
|
|
3771
|
+
"ontology.graph.export",
|
|
3772
|
+
"ontology.explorer.aggregate",
|
|
3773
|
+
"workshop.briefings.read",
|
|
3774
|
+
"workshop.briefings.write",
|
|
3775
|
+
"workshop.briefings.broadcast",
|
|
3776
|
+
"workshop.dossiers.read",
|
|
3777
|
+
"workshop.dossiers.write",
|
|
3778
|
+
"workshop.dossiers.share",
|
|
3779
|
+
"workshop.covs.read",
|
|
3780
|
+
"workshop.covs.write",
|
|
3781
|
+
"workshop.covs.share",
|
|
3782
|
+
"chat.channels.read",
|
|
3783
|
+
"chat.channels.write",
|
|
3784
|
+
"chat.channels.manage",
|
|
3785
|
+
"chat.messages.send",
|
|
3786
|
+
"chat.messages.read",
|
|
3787
|
+
"alerts.feeds.read",
|
|
3788
|
+
"alerts.feeds.subscribe",
|
|
3789
|
+
"alerts.watches.read",
|
|
3790
|
+
"alerts.watches.subscribe",
|
|
3791
|
+
"alerts.geofences.read",
|
|
3792
|
+
"alerts.geofences.manage",
|
|
3793
|
+
"alerts.shares.read",
|
|
3794
|
+
"alerts.read",
|
|
3795
|
+
"alerts.escalate",
|
|
3796
|
+
"alerts.routes.view",
|
|
3797
|
+
"alerts.routes.manage",
|
|
3798
|
+
"atlas.layers.read",
|
|
3799
|
+
"atlas.layers.manage",
|
|
3800
|
+
"atlas.geofences.draw",
|
|
3801
|
+
"atlas.evaluation.read",
|
|
3802
|
+
"atlas.evaluation.manage",
|
|
3803
|
+
"video.exports.create",
|
|
3804
|
+
"connectors.manage",
|
|
3805
|
+
"events.pipeline.view",
|
|
3806
|
+
"events.pipeline.manage",
|
|
3807
|
+
"situational.correlate.view",
|
|
3808
|
+
"situational.correlate.manage",
|
|
3809
|
+
"security.painel.view",
|
|
3810
|
+
"security.buscar.view",
|
|
3811
|
+
"security.geo.view",
|
|
3812
|
+
"security.geo.cerca.create",
|
|
3813
|
+
"security.cameras.view",
|
|
3814
|
+
"security.cameras.tag",
|
|
3815
|
+
"security.cameras.export",
|
|
3816
|
+
"security.cameras.manage",
|
|
3817
|
+
"security.cameras.bookmark",
|
|
3818
|
+
"security.cameras.hotlist",
|
|
3819
|
+
"security.cameras.cloud_inference",
|
|
3820
|
+
"security.explorador.view",
|
|
3821
|
+
"security.rede.view",
|
|
3822
|
+
"security.rede.edit",
|
|
3823
|
+
"security.ficha.view",
|
|
3824
|
+
"security.ficha.edit",
|
|
3825
|
+
"security.alertas.view",
|
|
3826
|
+
"security.alertas.resolve",
|
|
3827
|
+
"security.relatorios.view",
|
|
3828
|
+
"security.relatorios.edit",
|
|
3829
|
+
"security.relatorios.close",
|
|
3830
|
+
"security.briefings.view",
|
|
3831
|
+
"security.briefings.edit",
|
|
3832
|
+
"security.briefings.broadcast",
|
|
3833
|
+
"security.workshop.view",
|
|
3834
|
+
"security.workshop.edit",
|
|
3835
|
+
"security.workshop.publish_global",
|
|
3836
|
+
"security.fluxos.view",
|
|
3837
|
+
"security.fluxos.edit",
|
|
3838
|
+
"security.fluxos.run",
|
|
3839
|
+
"security.agentes.view",
|
|
3840
|
+
"security.agentes.edit",
|
|
3841
|
+
"security.agentes.run",
|
|
3842
|
+
"security.ontologia.view",
|
|
3843
|
+
"security.ontologia.edit",
|
|
3844
|
+
"security.workshop.kiosk",
|
|
3845
|
+
"security.configuracoes.view",
|
|
3846
|
+
"security.browser.manage",
|
|
3847
|
+
"painel.home.view",
|
|
3848
|
+
"painel.aprovacoes.view",
|
|
3849
|
+
"painel.aprovacoes.act",
|
|
3850
|
+
"painel.comunicacoes.view",
|
|
3851
|
+
"painel.comunicacoes.edit",
|
|
3852
|
+
"painel.atividade.view",
|
|
3853
|
+
"painel.atividade.export",
|
|
3854
|
+
"painel.favoritos.edit",
|
|
3855
|
+
"organization.read",
|
|
3856
|
+
"organization.write",
|
|
3857
|
+
"organization.invite_guest",
|
|
3858
|
+
"space.read",
|
|
3859
|
+
"space.write",
|
|
3860
|
+
"space.add_organization",
|
|
3861
|
+
"project.read",
|
|
3862
|
+
"project.write",
|
|
3863
|
+
"project.move",
|
|
3864
|
+
"project.link",
|
|
3865
|
+
"markings.read",
|
|
3866
|
+
"markings.write",
|
|
3867
|
+
"markings.apply",
|
|
3868
|
+
"markings.remove",
|
|
3869
|
+
"markings.expand_access",
|
|
3870
|
+
"markings.manage_eligibility",
|
|
3871
|
+
"classification.read",
|
|
3872
|
+
"classification.set",
|
|
3873
|
+
"classification.upgrade",
|
|
3874
|
+
"project.constraints.read",
|
|
3875
|
+
"project.constraints.configure",
|
|
3876
|
+
"project.constraints.revalidate",
|
|
3877
|
+
"workspace.read",
|
|
3878
|
+
"workspace.write",
|
|
3879
|
+
"workspace.delete",
|
|
3880
|
+
"workspace.publish",
|
|
3881
|
+
"workspace.history.read",
|
|
3882
|
+
"workspace.republish",
|
|
3883
|
+
"workspace.update.read",
|
|
3884
|
+
"workspace.update.write",
|
|
3885
|
+
"workspace.update.archive",
|
|
3886
|
+
"workspace.update.delete",
|
|
3887
|
+
"workspace.update.view",
|
|
3888
|
+
"workspace.navigation.read",
|
|
3889
|
+
"workspace.navigation.configure",
|
|
3890
|
+
"workspace.promote.read",
|
|
3891
|
+
"workspace.promote.set",
|
|
3892
|
+
"workspace.promote.unset",
|
|
3893
|
+
"workspace.kiosk.read",
|
|
3894
|
+
"workspace.kiosk.configure",
|
|
3895
|
+
"workspace.kiosk.session.start",
|
|
3896
|
+
"workspace.kiosk.session.end",
|
|
3897
|
+
"app_shell.manage",
|
|
3898
|
+
"comunicado.read",
|
|
3899
|
+
"comunicado.write",
|
|
3900
|
+
"comunicado.delete",
|
|
3901
|
+
"forms.submit",
|
|
3902
|
+
"forms.submissions.read",
|
|
3903
|
+
"vendor.dev_mode",
|
|
3904
|
+
"public.token.read",
|
|
3905
|
+
"public.token.issue",
|
|
3906
|
+
"public.token.revoke",
|
|
3907
|
+
"messaging.send",
|
|
3908
|
+
"automation.alarms.read",
|
|
3909
|
+
"automation.alarms.write",
|
|
3910
|
+
"data.media.read",
|
|
3911
|
+
"data.media.write",
|
|
3912
|
+
"function.read",
|
|
3913
|
+
"function.write",
|
|
3914
|
+
"function.invoke",
|
|
3915
|
+
"function.review",
|
|
3916
|
+
"sandbox.install",
|
|
3917
|
+
"sandbox.terminal",
|
|
3918
|
+
"llm.budget.read",
|
|
3919
|
+
"llm.budget.write",
|
|
3920
|
+
"governance.retention.read",
|
|
3921
|
+
"governance.retention.write",
|
|
3922
|
+
"rowpolicy.read",
|
|
3923
|
+
"rowpolicy.write",
|
|
3924
|
+
"compute.providers.read",
|
|
3925
|
+
"compute.providers.write",
|
|
3926
|
+
"compute.pipelines.deploy",
|
|
3927
|
+
"vision.count.execute",
|
|
3928
|
+
"ontology.objects.bulk_write"
|
|
3929
|
+
];
|
|
3930
|
+
var ALL_PERMISSIONS = [
|
|
3931
|
+
...NAV_PERMISSIONS,
|
|
3932
|
+
...CAPABILITY_PERMISSIONS
|
|
3933
|
+
];
|
|
3934
|
+
function toDef(key, kind) {
|
|
3935
|
+
const idx = key.lastIndexOf(".");
|
|
3936
|
+
return { key, kind, resource: key.slice(0, idx), action: key.slice(idx + 1) };
|
|
3937
|
+
}
|
|
3938
|
+
function listPermissions(kind) {
|
|
3939
|
+
if (kind === "nav") return NAV_PERMISSIONS.map((k) => toDef(k, "nav"));
|
|
3940
|
+
if (kind === "capability") return CAPABILITY_PERMISSIONS.map((k) => toDef(k, "capability"));
|
|
3941
|
+
if (kind !== void 0) throw new Error(`invalid permission kind: ${String(kind)}`);
|
|
3942
|
+
return [...listPermissions("nav"), ...listPermissions("capability")];
|
|
3943
|
+
}
|
|
3944
|
+
var ALL_SET = new Set(ALL_PERMISSIONS);
|
|
3945
|
+
function isSystemPermission(key) {
|
|
3946
|
+
return ALL_SET.has(key);
|
|
3947
|
+
}
|
|
3948
|
+
|
|
3949
|
+
// src/osdk-applications.ts
|
|
3950
|
+
var APPLICATIONS = [
|
|
3951
|
+
{
|
|
3952
|
+
slug: "security-app",
|
|
3953
|
+
display_name: "Security Application",
|
|
3954
|
+
description: "Operational security frontend \u2014 painel, geo, cameras, ficha, workshop, AIP.",
|
|
3955
|
+
permissions: [
|
|
3956
|
+
"nav.section.discover",
|
|
3957
|
+
"nav.section.painel-de-controle",
|
|
3958
|
+
"nav.item.painel.home",
|
|
3959
|
+
"nav.item.painel.aprovacoes",
|
|
3960
|
+
"nav.item.painel.comunicacoes",
|
|
3961
|
+
"nav.item.painel.atividade",
|
|
3962
|
+
"security.painel.view",
|
|
3963
|
+
"security.buscar.view",
|
|
3964
|
+
"security.geo.view",
|
|
3965
|
+
"security.geo.cerca.create",
|
|
3966
|
+
"security.cameras.view",
|
|
3967
|
+
"security.cameras.tag",
|
|
3968
|
+
"security.cameras.export",
|
|
3969
|
+
"security.cameras.manage",
|
|
3970
|
+
"security.cameras.bookmark",
|
|
3971
|
+
"security.cameras.hotlist",
|
|
3972
|
+
"security.cameras.cloud_inference",
|
|
3973
|
+
"video.exports.create",
|
|
3974
|
+
"security.explorador.view",
|
|
3975
|
+
"security.rede.view",
|
|
3976
|
+
"security.rede.edit",
|
|
3977
|
+
"security.ficha.view",
|
|
3978
|
+
"security.ficha.edit",
|
|
3979
|
+
"security.alertas.view",
|
|
3980
|
+
"security.alertas.resolve",
|
|
3981
|
+
"security.relatorios.view",
|
|
3982
|
+
"security.relatorios.edit",
|
|
3983
|
+
"security.relatorios.close",
|
|
3984
|
+
"security.briefings.view",
|
|
3985
|
+
"security.briefings.edit",
|
|
3986
|
+
"security.briefings.broadcast",
|
|
3987
|
+
"security.workshop.view",
|
|
3988
|
+
"security.workshop.edit",
|
|
3989
|
+
"security.workshop.publish_global",
|
|
3990
|
+
"security.fluxos.view",
|
|
3991
|
+
"security.fluxos.edit",
|
|
3992
|
+
"security.fluxos.run",
|
|
3993
|
+
"security.agentes.view",
|
|
3994
|
+
"security.agentes.edit",
|
|
3995
|
+
"security.agentes.run",
|
|
3996
|
+
"security.ontologia.view",
|
|
3997
|
+
"security.ontologia.edit",
|
|
3998
|
+
"security.workshop.kiosk",
|
|
3999
|
+
"security.configuracoes.view",
|
|
4000
|
+
"security.browser.manage",
|
|
4001
|
+
"connectors.manage",
|
|
4002
|
+
"events.pipeline.view",
|
|
4003
|
+
"events.pipeline.manage",
|
|
4004
|
+
"alerts.read",
|
|
4005
|
+
"alerts.escalate",
|
|
4006
|
+
"alerts.geofences.read",
|
|
4007
|
+
"alerts.geofences.manage",
|
|
4008
|
+
"alerts.routes.view",
|
|
4009
|
+
"alerts.routes.manage",
|
|
4010
|
+
"situational.correlate.view",
|
|
4011
|
+
"situational.correlate.manage",
|
|
4012
|
+
"painel.home.view",
|
|
4013
|
+
"painel.aprovacoes.view",
|
|
4014
|
+
"painel.aprovacoes.act",
|
|
4015
|
+
"painel.comunicacoes.view",
|
|
4016
|
+
"painel.comunicacoes.edit",
|
|
4017
|
+
"painel.atividade.view",
|
|
4018
|
+
"painel.atividade.export",
|
|
4019
|
+
"painel.favoritos.edit",
|
|
4020
|
+
"aip.threads.read",
|
|
4021
|
+
"aip.threads.write",
|
|
4022
|
+
"aip.models.read",
|
|
4023
|
+
"aip.memory.read",
|
|
4024
|
+
"aip.memory.write",
|
|
4025
|
+
"compute.providers.read",
|
|
4026
|
+
"compute.providers.write",
|
|
4027
|
+
"compute.pipelines.deploy",
|
|
4028
|
+
"vision.count.execute",
|
|
4029
|
+
"ontology.objects.bulk_write"
|
|
4030
|
+
]
|
|
4031
|
+
},
|
|
4032
|
+
{
|
|
4033
|
+
slug: "aip-application",
|
|
4034
|
+
display_name: "AIP Application",
|
|
4035
|
+
description: "AIP threads, agents, tools, logic, models, evals, memory.",
|
|
4036
|
+
permissions: [
|
|
4037
|
+
"nav.section.aip",
|
|
4038
|
+
"nav.item.aip.threads",
|
|
4039
|
+
"nav.item.aip.agents",
|
|
4040
|
+
"nav.item.aip.tools",
|
|
4041
|
+
"nav.item.aip.logic",
|
|
4042
|
+
"nav.item.aip.models",
|
|
4043
|
+
"nav.item.aip.capacity",
|
|
4044
|
+
"nav.item.aip.scenarios",
|
|
4045
|
+
"nav.item.aip.evals",
|
|
4046
|
+
"nav.item.aip.memory",
|
|
4047
|
+
"nav.item.aip.mcp_adapters",
|
|
4048
|
+
"aip.threads.read",
|
|
4049
|
+
"aip.threads.write",
|
|
4050
|
+
"aip.agents.read",
|
|
4051
|
+
"aip.agents.write",
|
|
4052
|
+
"aip.agents.execute",
|
|
4053
|
+
"aip.models.read",
|
|
4054
|
+
"aip.models.write",
|
|
4055
|
+
"aip.memory.read",
|
|
4056
|
+
"aip.memory.write",
|
|
4057
|
+
"aip.evals.read",
|
|
4058
|
+
"aip.evals.run",
|
|
4059
|
+
"aip.flows.read",
|
|
4060
|
+
"aip.flows.write",
|
|
4061
|
+
"aip.flows.execute"
|
|
4062
|
+
]
|
|
4063
|
+
},
|
|
4064
|
+
{
|
|
4065
|
+
slug: "ontology-application",
|
|
4066
|
+
display_name: "Ontology Application",
|
|
4067
|
+
description: "Ontology types, objects, links, graph, solution diagrams, lineage.",
|
|
4068
|
+
permissions: [
|
|
4069
|
+
"ontology.types.read",
|
|
4070
|
+
"ontology.types.write",
|
|
4071
|
+
"ontology.actions.read",
|
|
4072
|
+
"ontology.actions.write",
|
|
4073
|
+
"ontology.actions.execute",
|
|
4074
|
+
"ontology.actions.execute_external",
|
|
4075
|
+
"ontology.objects.read",
|
|
4076
|
+
"ontology.objects.write",
|
|
4077
|
+
"ontology.objects.view",
|
|
4078
|
+
"ontology.links.read",
|
|
4079
|
+
"ontology.links.write",
|
|
4080
|
+
"ontology.graph.read",
|
|
4081
|
+
"ontology.graph.export",
|
|
4082
|
+
"ontology.explorer.aggregate",
|
|
4083
|
+
"data.lineage.read",
|
|
4084
|
+
"solution.diagram.read",
|
|
4085
|
+
"solution.diagram.write",
|
|
4086
|
+
"solution.diagram.publish",
|
|
4087
|
+
"solution.diagram.delete",
|
|
4088
|
+
"solution.diagram.history.read",
|
|
4089
|
+
"solution.materialize.delete",
|
|
4090
|
+
"solution.refactor",
|
|
4091
|
+
"messaging.send",
|
|
4092
|
+
"compute.providers.read",
|
|
4093
|
+
"compute.pipelines.deploy",
|
|
4094
|
+
"vision.count.execute",
|
|
4095
|
+
"ontology.objects.bulk_write"
|
|
4096
|
+
]
|
|
4097
|
+
},
|
|
4098
|
+
{
|
|
4099
|
+
slug: "governance-application",
|
|
4100
|
+
display_name: "Governance Application",
|
|
4101
|
+
description: "IAM groups, audit, rules, change requests, tokens, LGPD, markings, classification.",
|
|
4102
|
+
permissions: [
|
|
4103
|
+
"iam.groups.read",
|
|
4104
|
+
"iam.groups.write",
|
|
4105
|
+
"iam.groups.manage_members",
|
|
4106
|
+
"governance.audit.read",
|
|
4107
|
+
"governance.rules.read",
|
|
4108
|
+
"governance.rules.write",
|
|
4109
|
+
"governance.change_requests.read",
|
|
4110
|
+
"governance.change_requests.write",
|
|
4111
|
+
"governance.change_requests.approve",
|
|
4112
|
+
"governance.tokens.read",
|
|
4113
|
+
"governance.tokens.write",
|
|
4114
|
+
"governance.lgpd.read",
|
|
4115
|
+
"governance.lgpd.write",
|
|
4116
|
+
"governance.peers.read",
|
|
4117
|
+
"governance.peers.write",
|
|
4118
|
+
"governance.kiosk.read",
|
|
4119
|
+
"governance.kiosk.write",
|
|
4120
|
+
"admin.acessos",
|
|
4121
|
+
"admin.classificacao",
|
|
4122
|
+
"admin.auditoria",
|
|
4123
|
+
"admin.federacao",
|
|
4124
|
+
"admin.unidades",
|
|
4125
|
+
"admin.templates",
|
|
4126
|
+
"admin.automacoes",
|
|
4127
|
+
"admin.tokens",
|
|
4128
|
+
"markings.read",
|
|
4129
|
+
"markings.write",
|
|
4130
|
+
"markings.apply",
|
|
4131
|
+
"markings.remove",
|
|
4132
|
+
"markings.expand_access",
|
|
4133
|
+
"markings.manage_eligibility",
|
|
4134
|
+
"classification.read",
|
|
4135
|
+
"classification.set",
|
|
4136
|
+
"classification.upgrade",
|
|
4137
|
+
"project.constraints.read",
|
|
4138
|
+
"project.constraints.configure",
|
|
4139
|
+
"project.constraints.revalidate",
|
|
4140
|
+
"public.token.read",
|
|
4141
|
+
"public.token.issue",
|
|
4142
|
+
"public.token.revoke"
|
|
4143
|
+
]
|
|
4144
|
+
},
|
|
4145
|
+
{
|
|
4146
|
+
slug: "workshop-application",
|
|
4147
|
+
display_name: "Workshop Application",
|
|
4148
|
+
description: "Workshop apps, briefings, dossiers, COVs, workspaces, app-shell, comunicados.",
|
|
4149
|
+
permissions: [
|
|
4150
|
+
"workshop.apps.read",
|
|
4151
|
+
"workshop.apps.write",
|
|
4152
|
+
"workshop.briefings.read",
|
|
4153
|
+
"workshop.briefings.write",
|
|
4154
|
+
"workshop.briefings.broadcast",
|
|
4155
|
+
"workshop.dossiers.read",
|
|
4156
|
+
"workshop.dossiers.write",
|
|
4157
|
+
"workshop.dossiers.share",
|
|
4158
|
+
"workshop.covs.read",
|
|
4159
|
+
"workshop.covs.write",
|
|
4160
|
+
"workshop.covs.share",
|
|
4161
|
+
"workspace.read",
|
|
4162
|
+
"workspace.write",
|
|
4163
|
+
"workspace.delete",
|
|
4164
|
+
"workspace.publish",
|
|
4165
|
+
"workspace.history.read",
|
|
4166
|
+
"workspace.republish",
|
|
4167
|
+
"workspace.update.read",
|
|
4168
|
+
"workspace.update.write",
|
|
4169
|
+
"workspace.update.archive",
|
|
4170
|
+
"workspace.update.delete",
|
|
4171
|
+
"workspace.update.view",
|
|
4172
|
+
"workspace.navigation.read",
|
|
4173
|
+
"workspace.navigation.configure",
|
|
4174
|
+
"workspace.promote.read",
|
|
4175
|
+
"workspace.promote.set",
|
|
4176
|
+
"workspace.promote.unset",
|
|
4177
|
+
"workspace.kiosk.read",
|
|
4178
|
+
"workspace.kiosk.configure",
|
|
4179
|
+
"workspace.kiosk.session.start",
|
|
4180
|
+
"workspace.kiosk.session.end",
|
|
4181
|
+
"app_shell.manage",
|
|
4182
|
+
"comunicado.read",
|
|
4183
|
+
"comunicado.write",
|
|
4184
|
+
"comunicado.delete"
|
|
4185
|
+
]
|
|
4186
|
+
},
|
|
4187
|
+
{
|
|
4188
|
+
slug: "campaign-application",
|
|
4189
|
+
display_name: "Campaign Application (politicians-app)",
|
|
4190
|
+
description: "Campaign hub, chat, visibility, agents, scenarios, briefing.",
|
|
4191
|
+
permissions: [
|
|
4192
|
+
"nav.section.campanha",
|
|
4193
|
+
"nav.item.campaign.hub",
|
|
4194
|
+
"nav.item.campaign.chat",
|
|
4195
|
+
"nav.item.campaign.visibility",
|
|
4196
|
+
"nav.item.campaign.agents",
|
|
4197
|
+
"nav.item.campaign.scenarios",
|
|
4198
|
+
"nav.item.campaign.brief",
|
|
4199
|
+
"campaign.chat.read",
|
|
4200
|
+
"campaign.chat.write",
|
|
4201
|
+
"campaign.brief.read",
|
|
4202
|
+
"campaign.brief.generate",
|
|
4203
|
+
"campaign.brief.sign",
|
|
4204
|
+
"campaign.scenario.read",
|
|
4205
|
+
"campaign.scenario.run",
|
|
4206
|
+
"campaign.scenario.write",
|
|
4207
|
+
"campaign.visibility.read",
|
|
4208
|
+
"campaign.visibility.pin",
|
|
4209
|
+
"campaign.visibility.escalate",
|
|
4210
|
+
"campaign.agents.read",
|
|
4211
|
+
"campaign.agents.write",
|
|
4212
|
+
"campaign.agents.run",
|
|
4213
|
+
"campaign.briefing.read",
|
|
4214
|
+
"campaign.briefing.refresh",
|
|
4215
|
+
"campaign.briefing.headline",
|
|
4216
|
+
"campaign.briefing.crisis_override",
|
|
4217
|
+
"vault.cookies.manage"
|
|
4218
|
+
]
|
|
4219
|
+
},
|
|
4220
|
+
{
|
|
4221
|
+
slug: "docs-loader",
|
|
4222
|
+
display_name: "Docs UI Loader",
|
|
4223
|
+
description: "Read-only access to the docs tree and content.",
|
|
4224
|
+
permissions: ["docs.tree.read", "docs.content.read"]
|
|
4225
|
+
}
|
|
4226
|
+
];
|
|
4227
|
+
function listApplications() {
|
|
4228
|
+
return APPLICATIONS;
|
|
4229
|
+
}
|
|
4230
|
+
function applicationBySlug(slug) {
|
|
4231
|
+
return APPLICATIONS.find((app) => app.slug === slug);
|
|
4232
|
+
}
|
|
4233
|
+
function applicationHas(app, key) {
|
|
4234
|
+
return app.permissions.includes(key);
|
|
4235
|
+
}
|
|
4236
|
+
function validateApplication(app) {
|
|
4237
|
+
for (const key of app.permissions) {
|
|
4238
|
+
if (!isSystemPermission(key)) {
|
|
4239
|
+
throw new Error(`application ${app.slug} references unknown permission: ${key}`);
|
|
4240
|
+
}
|
|
4241
|
+
}
|
|
4242
|
+
}
|
|
4243
|
+
|
|
4244
|
+
// src/osdk-adapter.ts
|
|
4245
|
+
function asOsdkClient(client) {
|
|
4246
|
+
return {
|
|
4247
|
+
get: (path, params) => client.request("GET", path, {
|
|
4248
|
+
params
|
|
4249
|
+
}),
|
|
4250
|
+
post: (path, body) => client.request("POST", path, { json: body ?? {} })
|
|
4251
|
+
};
|
|
4252
|
+
}
|
|
681
4253
|
export {
|
|
4254
|
+
ALL_PERMISSIONS,
|
|
4255
|
+
APPLICATIONS,
|
|
4256
|
+
AccessAuditResource,
|
|
682
4257
|
AegisAPIError,
|
|
683
4258
|
AegisClient,
|
|
4259
|
+
AipResource,
|
|
4260
|
+
AlarmsResource,
|
|
4261
|
+
AlertsResource,
|
|
4262
|
+
AppShellResource,
|
|
4263
|
+
AtlasResource,
|
|
684
4264
|
AuthError,
|
|
4265
|
+
AuthResource,
|
|
4266
|
+
BriefingResource,
|
|
4267
|
+
CAPABILITY_PERMISSIONS,
|
|
4268
|
+
CLASSIFICATION_LABEL,
|
|
4269
|
+
CLASSIFICATION_RANK,
|
|
4270
|
+
CampaignResource,
|
|
4271
|
+
CctvResource,
|
|
4272
|
+
ChatResource,
|
|
4273
|
+
ClassificationInvariantViolation,
|
|
4274
|
+
CodeRepositoriesResource,
|
|
4275
|
+
CodegenResource,
|
|
4276
|
+
ComputeControlResource,
|
|
4277
|
+
ComputeResource,
|
|
4278
|
+
ComunicadosResource,
|
|
4279
|
+
ConnectorsResource,
|
|
4280
|
+
CorrelationResource,
|
|
4281
|
+
DatasetsResource,
|
|
4282
|
+
DocsResource,
|
|
4283
|
+
DossierResource,
|
|
4284
|
+
EdgeResource,
|
|
4285
|
+
ErasureResource,
|
|
4286
|
+
EventsResource,
|
|
4287
|
+
FormsResource,
|
|
4288
|
+
FunctionsResource,
|
|
4289
|
+
GeoResource,
|
|
4290
|
+
GroupsResource,
|
|
4291
|
+
GuestTokensResource,
|
|
4292
|
+
IamResource,
|
|
4293
|
+
InferenceResource,
|
|
4294
|
+
LineageResource,
|
|
4295
|
+
MapTemplatesResource,
|
|
4296
|
+
MarketplaceResource,
|
|
4297
|
+
MarkingsResource,
|
|
4298
|
+
MediaResource,
|
|
4299
|
+
MergeResource,
|
|
4300
|
+
NAV_PERMISSIONS,
|
|
685
4301
|
NotFoundError,
|
|
686
|
-
|
|
4302
|
+
NotepadResource,
|
|
4303
|
+
OntologyResource,
|
|
4304
|
+
OperatorResource,
|
|
4305
|
+
OrganizationsResource,
|
|
4306
|
+
OsdkResource,
|
|
4307
|
+
PagesResource,
|
|
4308
|
+
PermissionDeniedError,
|
|
4309
|
+
PipelinesResource,
|
|
4310
|
+
PlatformV22Resource,
|
|
4311
|
+
PlatformV23Resource,
|
|
4312
|
+
PlatformV24Resource,
|
|
4313
|
+
PlatformV25Resource,
|
|
4314
|
+
PlatformV26Resource,
|
|
4315
|
+
ProjectsResource,
|
|
4316
|
+
PropertyMarkingsResource,
|
|
4317
|
+
ResourceMarkingsResource,
|
|
4318
|
+
RetentionResource,
|
|
4319
|
+
RowPoliciesResource,
|
|
4320
|
+
SituationalResource,
|
|
4321
|
+
SolutionsResource,
|
|
4322
|
+
SpacesResource,
|
|
4323
|
+
TimeSeriesResource,
|
|
4324
|
+
VALID_LEVELS,
|
|
4325
|
+
VALID_PROJECT_ROLES,
|
|
4326
|
+
VideoResource,
|
|
4327
|
+
WorkshopResource,
|
|
4328
|
+
WorkspaceUpdatesResource,
|
|
4329
|
+
WorkspacesResource,
|
|
4330
|
+
applicationBySlug,
|
|
4331
|
+
applicationHas,
|
|
4332
|
+
asOsdkClient,
|
|
4333
|
+
isSystemPermission,
|
|
4334
|
+
listApplications,
|
|
4335
|
+
listPermissions,
|
|
4336
|
+
maxLevel,
|
|
4337
|
+
parseSseStream,
|
|
4338
|
+
validateApplication,
|
|
4339
|
+
validateInvariant
|
|
687
4340
|
};
|
|
688
4341
|
//# sourceMappingURL=index.js.map
|