bruce-models 7.1.2 → 7.1.4

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.
@@ -2154,7 +2154,25 @@ var AnnDocument;
2154
2154
  let EType;
2155
2155
  (function (EType) {
2156
2156
  EType["SVG"] = "SVG";
2157
+ EType["PDF"] = "PDF";
2157
2158
  })(EType = AnnDocument.EType || (AnnDocument.EType = {}));
2159
+ /**
2160
+ * Known status values for document hotspots.
2161
+ */
2162
+ let EHotspotStatus;
2163
+ (function (EHotspotStatus) {
2164
+ EHotspotStatus["Suggested"] = "Suggested";
2165
+ })(EHotspotStatus = AnnDocument.EHotspotStatus || (AnnDocument.EHotspotStatus = {}));
2166
+ /**
2167
+ * Known extraction sources for document hotspots.
2168
+ */
2169
+ let EHotspotSource;
2170
+ (function (EHotspotSource) {
2171
+ EHotspotSource["TextExtraction"] = "TextExtraction";
2172
+ EHotspotSource["SVGTextExtraction"] = "SVGTextExtraction";
2173
+ EHotspotSource["PDFTextExtraction"] = "PDFTextExtraction";
2174
+ EHotspotSource["OCR"] = "OCR";
2175
+ })(EHotspotSource = AnnDocument.EHotspotSource || (AnnDocument.EHotspotSource = {}));
2158
2176
  /**
2159
2177
  * Returns an annotated document by ID.
2160
2178
  * @param params
@@ -2247,6 +2265,25 @@ var AnnDocument;
2247
2265
  });
2248
2266
  }
2249
2267
  AnnDocument.GetList = GetList;
2268
+ /**
2269
+ * Suggests hotspots by scraping pages in a document view and matching by pattern.
2270
+ */
2271
+ function SuggestHotspots(params) {
2272
+ return __awaiter(this, void 0, void 0, function* () {
2273
+ let { api, docId, body, req: reqParams } = params;
2274
+ if (!docId) {
2275
+ throw ("Doc ID is required.");
2276
+ }
2277
+ if (!api) {
2278
+ api = ENVIRONMENT.Api().GetBruceApi();
2279
+ }
2280
+ if (!body) {
2281
+ body = {};
2282
+ }
2283
+ return api.POST(`documentView/${docId}/suggestHotspots`, body, Api.PrepReqParams(reqParams));
2284
+ });
2285
+ }
2286
+ AnnDocument.SuggestHotspots = SuggestHotspots;
2250
2287
  /**
2251
2288
  * Returns cache identifier for an annotated document by ID.
2252
2289
  * Example: {
@@ -3454,6 +3491,26 @@ var EntityType;
3454
3491
  });
3455
3492
  }
3456
3493
  EntityType.Count = Count;
3494
+ /**
3495
+ * Suggests additional Data Schema attributes for the specified Entity Type.
3496
+ * This calls: POST v1/entityType/{entityType_id}/DataSchema/Suggest
3497
+ */
3498
+ function SuggestDataSchemaByPrompt(params) {
3499
+ return __awaiter(this, void 0, void 0, function* () {
3500
+ let { api, entityTypeId, body, req } = params;
3501
+ if (!entityTypeId) {
3502
+ throw ("Type ID is required.");
3503
+ }
3504
+ if (!(body === null || body === void 0 ? void 0 : body.Prompt)) {
3505
+ throw ("Prompt is required.");
3506
+ }
3507
+ if (!api) {
3508
+ api = ENVIRONMENT.Api().GetBruceApi();
3509
+ }
3510
+ return api.POST(`v1/entityType/${entityTypeId}/DataSchema/Suggest`, body, Api.PrepReqParams(req));
3511
+ });
3512
+ }
3513
+ EntityType.SuggestDataSchemaByPrompt = SuggestDataSchemaByPrompt;
3457
3514
  /**
3458
3515
  * Returns cache identifier for an entity type.
3459
3516
  * Example: {
@@ -14050,11 +14107,15 @@ var AccountInvite;
14050
14107
  */
14051
14108
  function GetByCode(params) {
14052
14109
  return __awaiter(this, void 0, void 0, function* () {
14053
- let { api, code, req } = params;
14110
+ let { api, code, req, expand } = params;
14054
14111
  if (!api) {
14055
14112
  api = ENVIRONMENT.Api().GetGuardianApi();
14056
14113
  }
14057
- const invite = yield api.GET(`v3/accountInvite?InviteCode=${code}`, Api.PrepReqParams(req));
14114
+ let url = `v3/accountInvite?InviteCode=${code}`;
14115
+ if (expand) {
14116
+ url += "&Expand=" + expand;
14117
+ }
14118
+ const invite = yield api.GET(url, Api.PrepReqParams(req));
14058
14119
  return {
14059
14120
  invite: invite
14060
14121
  };
@@ -15148,6 +15209,29 @@ var DataLab;
15148
15209
  });
15149
15210
  }
15150
15211
  DataLab.Get = Get;
15212
+ /**
15213
+ * Suggests a DataLab query from natural language prompt.
15214
+ * This calls: POST entities/datalab/suggestDataLabQueryByPrompt
15215
+ */
15216
+ function SuggestDataLabQueryByPrompt(params) {
15217
+ var _a, _b, _c;
15218
+ return __awaiter(this, void 0, void 0, function* () {
15219
+ let { api, body, req } = params;
15220
+ if (!(body === null || body === void 0 ? void 0 : body.Prompt)) {
15221
+ throw new Error("Prompt is required.");
15222
+ }
15223
+ if (!api) {
15224
+ api = ENVIRONMENT.Api().GetBruceApi();
15225
+ }
15226
+ const res = yield api.POST("entities/datalab/suggestDataLabQueryByPrompt", body, req ? Api.PrepReqParams(req) : undefined);
15227
+ const raw = res;
15228
+ return {
15229
+ query: (_c = (_b = (_a = raw === null || raw === void 0 ? void 0 : raw.Query) !== null && _a !== void 0 ? _a : raw === null || raw === void 0 ? void 0 : raw.SuggestedQuery) !== null && _b !== void 0 ? _b : raw === null || raw === void 0 ? void 0 : raw.DataLabQuery) !== null && _c !== void 0 ? _c : raw,
15230
+ warnings: raw === null || raw === void 0 ? void 0 : raw.Warnings
15231
+ };
15232
+ });
15233
+ }
15234
+ DataLab.SuggestDataLabQueryByPrompt = SuggestDataLabQueryByPrompt;
15151
15235
  /**
15152
15236
  * Runs a DataLab query.
15153
15237
  * @param params
@@ -15390,6 +15474,7 @@ var ImportCsv;
15390
15474
 
15391
15475
  var ImportJson;
15392
15476
  (function (ImportJson) {
15477
+ const IMPORT_ONTOLOGY_ENDPOINT = "import/json/ontology";
15393
15478
  function ImportEntities(params) {
15394
15479
  return __awaiter(this, void 0, void 0, function* () {
15395
15480
  let { api, fileImport, req: reqParams } = params;
@@ -15400,6 +15485,71 @@ var ImportJson;
15400
15485
  });
15401
15486
  }
15402
15487
  ImportJson.ImportEntities = ImportEntities;
15488
+ /**
15489
+ * Starts JSON ontology import.
15490
+ * Endpoint: POST import/json/ontology
15491
+ */
15492
+ function ImportOntology(params) {
15493
+ return __awaiter(this, void 0, void 0, function* () {
15494
+ let { api, ontologyImport, req: reqParams } = params;
15495
+ if (!api) {
15496
+ api = ENVIRONMENT.Api().GetBruceApi();
15497
+ }
15498
+ const res = yield api.POST(IMPORT_ONTOLOGY_ENDPOINT, ontologyImport, reqParams ? Api.PrepReqParams(reqParams) : undefined);
15499
+ return ParseImportOntologyResponse(res);
15500
+ });
15501
+ }
15502
+ ImportJson.ImportOntology = ImportOntology;
15503
+ /**
15504
+ * Normalizes response from ImportOntology.
15505
+ * Supports both direct response payloads and wrapper shapes.
15506
+ */
15507
+ function ParseImportOntologyResponse(response) {
15508
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
15509
+ const parsed = parseObject(response);
15510
+ const parsedResult = (_c = (_b = parseObject((_a = parsed === null || parsed === void 0 ? void 0 : parsed.Result) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.ImportResult)) !== null && _b !== void 0 ? _b : parsed === null || parsed === void 0 ? void 0 : parsed.Result) !== null && _c !== void 0 ? _c : parsed === null || parsed === void 0 ? void 0 : parsed.ImportResult;
15511
+ const pendingActionId = (_j = (_h = (_g = (_e = (_d = parsed === null || parsed === void 0 ? void 0 : parsed.PendingActionID) !== null && _d !== void 0 ? _d : parsed === null || parsed === void 0 ? void 0 : parsed["PendingAction.ID"]) !== null && _e !== void 0 ? _e : (_f = parsed === null || parsed === void 0 ? void 0 : parsed.PendingAction) === null || _f === void 0 ? void 0 : _f.ID) !== null && _g !== void 0 ? _g : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.PendingActionID) !== null && _h !== void 0 ? _h : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult["PendingAction.ID"]) !== null && _j !== void 0 ? _j : (_k = parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.PendingAction) === null || _k === void 0 ? void 0 : _k.ID;
15512
+ return {
15513
+ pendingActionId: pendingActionId,
15514
+ warnings: (_l = parsed === null || parsed === void 0 ? void 0 : parsed.Warnings) !== null && _l !== void 0 ? _l : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Warnings,
15515
+ errors: (_m = parsed === null || parsed === void 0 ? void 0 : parsed.Errors) !== null && _m !== void 0 ? _m : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Errors,
15516
+ raw: parsed
15517
+ };
15518
+ }
15519
+ ImportJson.ParseImportOntologyResponse = ParseImportOntologyResponse;
15520
+ /**
15521
+ * Parses pending-action result payload produced by ontology import.
15522
+ */
15523
+ function ParseOntologyImportResult(paResult) {
15524
+ var _a, _b, _c, _d;
15525
+ const parsed = parseObject(paResult);
15526
+ if (!parsed) {
15527
+ return {
15528
+ raw: null
15529
+ };
15530
+ }
15531
+ const rawResult = (_d = (_c = (_b = parseObject((_a = parsed === null || parsed === void 0 ? void 0 : parsed.Result) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.ImportResult)) !== null && _b !== void 0 ? _b : parsed === null || parsed === void 0 ? void 0 : parsed.Result) !== null && _c !== void 0 ? _c : parsed === null || parsed === void 0 ? void 0 : parsed.ImportResult) !== null && _d !== void 0 ? _d : parsed;
15532
+ return {
15533
+ warnings: rawResult === null || rawResult === void 0 ? void 0 : rawResult.Warnings,
15534
+ errors: rawResult === null || rawResult === void 0 ? void 0 : rawResult.Errors,
15535
+ raw: rawResult
15536
+ };
15537
+ }
15538
+ ImportJson.ParseOntologyImportResult = ParseOntologyImportResult;
15539
+ function parseObject(data) {
15540
+ if (data == null || data == undefined) {
15541
+ return null;
15542
+ }
15543
+ if (typeof data == "string") {
15544
+ try {
15545
+ return JSON.parse(data);
15546
+ }
15547
+ catch (_a) {
15548
+ return null;
15549
+ }
15550
+ }
15551
+ return data;
15552
+ }
15403
15553
  })(ImportJson || (ImportJson = {}));
15404
15554
 
15405
15555
  var ImportGeoJson;
@@ -16966,7 +17116,7 @@ var ChangeSet;
16966
17116
  })(ChangeSet || (ChangeSet = {}));
16967
17117
 
16968
17118
  // This is updated with the package.json version on build.
16969
- const VERSION = "7.1.2";
17119
+ const VERSION = "7.1.4";
16970
17120
 
16971
17121
  export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, UserMfaMethod, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking, NavigatorChatClient, NavigatorMcpWebSocketClient, ChangeSet };
16972
17122
  //# sourceMappingURL=bruce-models.es5.js.map