@uipath/integrationservice-sdk 1.202.0-preview.159 → 1.203.0-preview.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-NOTICES.md +16 -3
- package/dist/index.js +339 -33
- package/dist/src/client-factory.d.ts +4 -4
- package/dist/src/dap/types.d.ts +7 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/runtime/connector-execute-helper.d.ts +11 -0
- package/dist/src/runtime/index.d.ts +2 -0
- package/dist/src/runtime/types.d.ts +59 -0
- package/package.json +3 -2
|
@@ -5,9 +5,10 @@ compiled into its `dist/` output rather than installed alongside it.
|
|
|
5
5
|
Their licences and copyright notices are reproduced here in full, as
|
|
6
6
|
those licences require.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
22 bundled dependencies:
|
|
9
9
|
|
|
10
|
-
- @serverlessworkflow/sdk@1.0.1 —
|
|
10
|
+
- @serverlessworkflow/sdk@1.0.1 — Apache-2.0
|
|
11
|
+
- @uipath/integration-service-design-time@0.25.2 — see below
|
|
11
12
|
- base64-js@1.5.1 — MIT
|
|
12
13
|
- bundle-name@4.1.0 — MIT
|
|
13
14
|
- commander@14.0.3 — MIT
|
|
@@ -33,7 +34,9 @@ those licences require.
|
|
|
33
34
|
|
|
34
35
|
## @serverlessworkflow/sdk@1.0.1
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
Licence decision: Its `license` field is a URL to the Apache-2.0 text rather than an SPDX id, so it reads as unknown to every scanner. Normalised to the licence that URL names.
|
|
38
|
+
|
|
39
|
+
SPDX: Apache-2.0
|
|
37
40
|
|
|
38
41
|
```
|
|
39
42
|
Apache License
|
|
@@ -241,6 +244,16 @@ SPDX: http://www.apache.org/licenses/LICENSE-2.0.txt
|
|
|
241
244
|
|
|
242
245
|
---
|
|
243
246
|
|
|
247
|
+
## @uipath/integration-service-design-time@0.25.2
|
|
248
|
+
|
|
249
|
+
SPDX:
|
|
250
|
+
|
|
251
|
+
The upstream package ships no licence file here; `` is the
|
|
252
|
+
licence it is distributed under. The canonical text of that licence
|
|
253
|
+
applies, with copyright held by the package's authors.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
244
257
|
## base64-js@1.5.1
|
|
245
258
|
|
|
246
259
|
SPDX: MIT
|
package/dist/index.js
CHANGED
|
@@ -65335,8 +65335,9 @@ class TextApiResponse2 {
|
|
|
65335
65335
|
// package.json
|
|
65336
65336
|
var package_default = {
|
|
65337
65337
|
name: "@uipath/integrationservice-sdk",
|
|
65338
|
+
author: "UiPath",
|
|
65338
65339
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
65339
|
-
version: "1.
|
|
65340
|
+
version: "1.203.0-preview.160",
|
|
65340
65341
|
repository: {
|
|
65341
65342
|
type: "git",
|
|
65342
65343
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -85054,16 +85055,7 @@ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) =
|
|
|
85054
85055
|
errorMessage: location2.source === "absolute" ? `Environment file not found: ${envFilePath}` : `Unable to locate environment file: ${envFilePath}. Run 'uip login' to authenticate.`
|
|
85055
85056
|
};
|
|
85056
85057
|
};
|
|
85057
|
-
var
|
|
85058
|
-
const fs7 = getFileSystem();
|
|
85059
|
-
const absolutePath = fs7.path.isAbsolute(envPath) ? envPath : fs7.path.join(fs7.env.cwd(), envPath);
|
|
85060
|
-
if (!await fs7.exists(absolutePath)) {
|
|
85061
|
-
throw new Error(`Environment file not found: ${envPath}`);
|
|
85062
|
-
}
|
|
85063
|
-
const content = await fs7.readFile(absolutePath, "utf-8");
|
|
85064
|
-
if (content === null) {
|
|
85065
|
-
throw new Error(`Environment file not found: ${envPath}`);
|
|
85066
|
-
}
|
|
85058
|
+
var parseEnvContent = (content) => {
|
|
85067
85059
|
const env = {};
|
|
85068
85060
|
for (const line of content.split(`
|
|
85069
85061
|
`)) {
|
|
@@ -85084,6 +85076,18 @@ var loadEnvFileAsync = async ({ envPath }) => {
|
|
|
85084
85076
|
}
|
|
85085
85077
|
return env;
|
|
85086
85078
|
};
|
|
85079
|
+
var loadEnvFileAsync = async ({ envPath }) => {
|
|
85080
|
+
const fs7 = getFileSystem();
|
|
85081
|
+
const absolutePath = fs7.path.isAbsolute(envPath) ? envPath : fs7.path.join(fs7.env.cwd(), envPath);
|
|
85082
|
+
if (!await fs7.exists(absolutePath)) {
|
|
85083
|
+
throw new Error(`Environment file not found: ${envPath}`);
|
|
85084
|
+
}
|
|
85085
|
+
const content = await fs7.readFile(absolutePath, "utf-8");
|
|
85086
|
+
if (content === null) {
|
|
85087
|
+
throw new Error(`Environment file not found: ${envPath}`);
|
|
85088
|
+
}
|
|
85089
|
+
return parseEnvContent(content);
|
|
85090
|
+
};
|
|
85087
85091
|
var saveEnvFileAsync = async ({
|
|
85088
85092
|
envPath,
|
|
85089
85093
|
data,
|
|
@@ -85624,6 +85628,8 @@ var getAuthContext = async (options = {}) => {
|
|
|
85624
85628
|
tenantName
|
|
85625
85629
|
};
|
|
85626
85630
|
};
|
|
85631
|
+
// ../auth/src/authProfileDetails.ts
|
|
85632
|
+
init_src();
|
|
85627
85633
|
// ../auth/src/index.ts
|
|
85628
85634
|
init_constants();
|
|
85629
85635
|
|
|
@@ -85785,9 +85791,9 @@ function isV4ActivityConfiguration(instanceParameters) {
|
|
|
85785
85791
|
return false;
|
|
85786
85792
|
return instanceParameters.version === ACTIVITY_VERSION_V4;
|
|
85787
85793
|
}
|
|
85788
|
-
async function getConnectorActivityMetadataV4(options, connectorKey,
|
|
85794
|
+
async function getConnectorActivityMetadataV4(options, connectorKey, objectName) {
|
|
85789
85795
|
const { baseUrl, accessToken, organizationId, tenantName } = await getValidatedAuthContext(options);
|
|
85790
|
-
const url = `${baseUrl}/${organizationId}/${tenantName}/elements_/v4/element/connectors/${encodeURIComponent(connectorKey)}/
|
|
85796
|
+
const url = `${baseUrl}/${organizationId}/${tenantName}/elements_/v4/element/connectors/${encodeURIComponent(connectorKey)}/objects/${encodeURIComponent(objectName)}/metadata`;
|
|
85791
85797
|
const response = await fetch(url, {
|
|
85792
85798
|
headers: addSdkUserAgentHeader({
|
|
85793
85799
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -87030,7 +87036,7 @@ var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{1
|
|
|
87030
87036
|
var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
87031
87037
|
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
87032
87038
|
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
87033
|
-
var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
87039
|
+
var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
87034
87040
|
var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
|
|
87035
87041
|
var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
|
|
87036
87042
|
var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
|
|
@@ -87077,7 +87083,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
|
|
|
87077
87083
|
`(?<![A-Za-z0-9])"(?:[^\\
|
|
87078
87084
|
]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
|
|
87079
87085
|
].join("|"), "g");
|
|
87080
|
-
var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
|
|
87086
|
+
var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
|
|
87081
87087
|
var COLLAPSED_BODY = "{…}";
|
|
87082
87088
|
var COLLAPSED_BODY_MARKER = "\x01body\x01";
|
|
87083
87089
|
var MAX_BODY_NESTING = 8;
|
|
@@ -87092,10 +87098,13 @@ function collapseJsonBodies(text) {
|
|
|
87092
87098
|
}
|
|
87093
87099
|
return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
|
|
87094
87100
|
}
|
|
87095
|
-
var TRAILING_PROSE_PUNCT =
|
|
87101
|
+
var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
|
|
87096
87102
|
function peelTrailingPunctuation(match2) {
|
|
87097
|
-
|
|
87098
|
-
|
|
87103
|
+
let end = match2.length;
|
|
87104
|
+
while (end > 0 && TRAILING_PROSE_PUNCT.includes(match2[end - 1])) {
|
|
87105
|
+
end -= 1;
|
|
87106
|
+
}
|
|
87107
|
+
return [match2.slice(0, end), match2.slice(end)];
|
|
87099
87108
|
}
|
|
87100
87109
|
function redactUrl(raw) {
|
|
87101
87110
|
try {
|
|
@@ -87803,7 +87812,8 @@ function readRegistryValue(keyPath, valueName) {
|
|
|
87803
87812
|
}
|
|
87804
87813
|
const [error46, output] = catchError3(() => execFileSync2("reg", ["query", keyPath, "/v", valueName], {
|
|
87805
87814
|
encoding: "utf-8",
|
|
87806
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
87815
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
87816
|
+
windowsHide: true
|
|
87807
87817
|
}));
|
|
87808
87818
|
if (error46) {
|
|
87809
87819
|
return "";
|
|
@@ -88293,6 +88303,7 @@ class TelemetryService2 {
|
|
|
88293
88303
|
}
|
|
88294
88304
|
}
|
|
88295
88305
|
// ../common/src/timings.ts
|
|
88306
|
+
init_src();
|
|
88296
88307
|
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
88297
88308
|
function createStorage2() {
|
|
88298
88309
|
const [error46, mod] = catchError3(() => __require("node:async_hooks"));
|
|
@@ -88474,28 +88485,32 @@ function isPlainRecord(value) {
|
|
|
88474
88485
|
const prototype = Object.getPrototypeOf(value);
|
|
88475
88486
|
return prototype === Object.prototype || prototype === null;
|
|
88476
88487
|
}
|
|
88477
|
-
function
|
|
88488
|
+
function splitPagedEnvelope(value) {
|
|
88478
88489
|
if (Array.isArray(value) || !isPlainRecord(value))
|
|
88479
88490
|
return null;
|
|
88480
|
-
const entries = Object.
|
|
88491
|
+
const entries = Object.entries(value);
|
|
88481
88492
|
if (entries.length === 0)
|
|
88482
88493
|
return null;
|
|
88483
|
-
let
|
|
88484
|
-
|
|
88485
|
-
for (const entry of entries) {
|
|
88494
|
+
let found = null;
|
|
88495
|
+
const meta3 = Object.create(null);
|
|
88496
|
+
for (const [key, entry] of entries) {
|
|
88486
88497
|
if (Array.isArray(entry)) {
|
|
88487
|
-
if (
|
|
88498
|
+
if (found !== null)
|
|
88488
88499
|
return null;
|
|
88489
|
-
|
|
88500
|
+
found = { key, rows: entry };
|
|
88490
88501
|
} else if (entry !== null && typeof entry === "object") {
|
|
88491
88502
|
return null;
|
|
88492
88503
|
} else {
|
|
88493
|
-
|
|
88504
|
+
meta3[key] = entry;
|
|
88494
88505
|
}
|
|
88495
88506
|
}
|
|
88496
|
-
if (
|
|
88507
|
+
if (found === null || Object.keys(meta3).length === 0)
|
|
88497
88508
|
return null;
|
|
88498
|
-
return
|
|
88509
|
+
return { ...found, meta: meta3 };
|
|
88510
|
+
}
|
|
88511
|
+
function extractPagedRows(value) {
|
|
88512
|
+
const paged = splitPagedEnvelope(value);
|
|
88513
|
+
return paged === null ? null : paged.rows;
|
|
88499
88514
|
}
|
|
88500
88515
|
function toLowerCamelCaseKey(key) {
|
|
88501
88516
|
if (!key)
|
|
@@ -88599,6 +88614,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
|
|
|
88599
88614
|
}
|
|
88600
88615
|
break;
|
|
88601
88616
|
}
|
|
88617
|
+
case "markdown":
|
|
88618
|
+
logFn(renderMarkdown(data));
|
|
88619
|
+
break;
|
|
88602
88620
|
default: {
|
|
88603
88621
|
const hasData = "Data" in data && data.Data != null;
|
|
88604
88622
|
const pagedRows = hasData ? extractPagedRows(data.Data) : null;
|
|
@@ -88623,6 +88641,10 @@ function logOutput(data, format = "json", tableRowStyle) {
|
|
|
88623
88641
|
printOutput(data, format, (msg) => sink.writeOut(`${msg}
|
|
88624
88642
|
`), needsAsciiSafeJson(sink), styleFn);
|
|
88625
88643
|
}
|
|
88644
|
+
var PLUMBING_KEYS = new Set(["code", "log"]);
|
|
88645
|
+
function isPlumbingKey(key) {
|
|
88646
|
+
return PLUMBING_KEYS.has(key.toLowerCase());
|
|
88647
|
+
}
|
|
88626
88648
|
function cellToString(val) {
|
|
88627
88649
|
return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
|
|
88628
88650
|
}
|
|
@@ -88638,7 +88660,7 @@ function wrapText(text, width) {
|
|
|
88638
88660
|
function printTable(data, logFn, externalLogValue, tableRowStyle) {
|
|
88639
88661
|
if (data.length === 0)
|
|
88640
88662
|
return;
|
|
88641
|
-
const keys2 = Object.keys(data[0]).filter((key) => !
|
|
88663
|
+
const keys2 = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
88642
88664
|
const maxWidths = keys2.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
|
|
88643
88665
|
const header = keys2.map((key, i2) => key.padEnd(maxWidths[i2])).join(" | ");
|
|
88644
88666
|
logFn(header);
|
|
@@ -88660,7 +88682,7 @@ function isNonEmptyPlainObject(value) {
|
|
|
88660
88682
|
}
|
|
88661
88683
|
var NESTED_INDENT = " ";
|
|
88662
88684
|
function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
88663
|
-
const keys2 = Object.keys(data).filter((key) => !
|
|
88685
|
+
const keys2 = Object.keys(data).filter((key) => !isPlumbingKey(key));
|
|
88664
88686
|
if (keys2.length === 0)
|
|
88665
88687
|
return;
|
|
88666
88688
|
const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
|
|
@@ -88691,7 +88713,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
|
88691
88713
|
function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
|
|
88692
88714
|
if (data.length === 0)
|
|
88693
88715
|
return;
|
|
88694
|
-
const keys2 = Object.keys(data[0]).filter((key) => !
|
|
88716
|
+
const keys2 = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
88695
88717
|
if (keys2.length === 0)
|
|
88696
88718
|
return;
|
|
88697
88719
|
if (!process.stdout.isTTY) {
|
|
@@ -88765,6 +88787,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
|
|
|
88765
88787
|
logFn(`Log: ${externalLogValue}`);
|
|
88766
88788
|
}
|
|
88767
88789
|
}
|
|
88790
|
+
var MARKDOWN_MAX_CELL = 200;
|
|
88791
|
+
var MARKDOWN_MAX_DEPTH = 3;
|
|
88792
|
+
function markdownHeading(depth) {
|
|
88793
|
+
return "#".repeat(Math.min(3 + depth, 6));
|
|
88794
|
+
}
|
|
88795
|
+
var BACKTICK_RUN = /`+/g;
|
|
88796
|
+
function fencedBlock(text) {
|
|
88797
|
+
const first = text.trimStart()[0];
|
|
88798
|
+
const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
|
|
88799
|
+
const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match2) => match2[0].length));
|
|
88800
|
+
const fence = "`".repeat(Math.max(3, longestRun + 1));
|
|
88801
|
+
return `${fence}${language}
|
|
88802
|
+
${text}
|
|
88803
|
+
${fence}`;
|
|
88804
|
+
}
|
|
88805
|
+
function collapseNewlineRuns(text) {
|
|
88806
|
+
return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
|
|
88807
|
+
`) ? " " : part).join("");
|
|
88808
|
+
}
|
|
88809
|
+
function markdownCell(value) {
|
|
88810
|
+
const text = value instanceof Date ? value.toISOString() : cellToString(value);
|
|
88811
|
+
return collapseNewlineRuns(text).replace(/\|/g, "\\|");
|
|
88812
|
+
}
|
|
88813
|
+
function markdownLabel(key) {
|
|
88814
|
+
return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
|
|
88815
|
+
}
|
|
88816
|
+
function withoutPlumbing(record2) {
|
|
88817
|
+
const kept = Object.create(null);
|
|
88818
|
+
for (const [key, value] of Object.entries(record2)) {
|
|
88819
|
+
if (!isPlumbingKey(key))
|
|
88820
|
+
kept[key] = value;
|
|
88821
|
+
}
|
|
88822
|
+
return kept;
|
|
88823
|
+
}
|
|
88824
|
+
function rowsWithoutPlumbing(rows) {
|
|
88825
|
+
return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
|
|
88826
|
+
}
|
|
88827
|
+
function markdownTable(rows) {
|
|
88828
|
+
const columns = [];
|
|
88829
|
+
const seen = new Set;
|
|
88830
|
+
for (const row of rows) {
|
|
88831
|
+
for (const key of Object.keys(row)) {
|
|
88832
|
+
if (!seen.has(key)) {
|
|
88833
|
+
seen.add(key);
|
|
88834
|
+
columns.push(key);
|
|
88835
|
+
}
|
|
88836
|
+
}
|
|
88837
|
+
}
|
|
88838
|
+
if (columns.length === 0)
|
|
88839
|
+
return null;
|
|
88840
|
+
const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
|
|
88841
|
+
if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
|
|
88842
|
+
return null;
|
|
88843
|
+
}
|
|
88844
|
+
return [
|
|
88845
|
+
`| ${columns.map(markdownLabel).join(" | ")} |`,
|
|
88846
|
+
`| ${columns.map(() => "---").join(" | ")} |`,
|
|
88847
|
+
...cells.map((row) => `| ${row.join(" | ")} |`)
|
|
88848
|
+
].join(`
|
|
88849
|
+
`);
|
|
88850
|
+
}
|
|
88851
|
+
function extractMessageSequence(rows) {
|
|
88852
|
+
const messages = [];
|
|
88853
|
+
for (const row of rows) {
|
|
88854
|
+
const message = extractSingleMessage(row);
|
|
88855
|
+
if (message === null)
|
|
88856
|
+
return null;
|
|
88857
|
+
messages.push(message);
|
|
88858
|
+
}
|
|
88859
|
+
return messages.join(`
|
|
88860
|
+
|
|
88861
|
+
`);
|
|
88862
|
+
}
|
|
88863
|
+
function markdownRows(rows, depth) {
|
|
88864
|
+
if (rows.length === 0)
|
|
88865
|
+
return "(none)";
|
|
88866
|
+
if (!isPlainObjectArray(rows)) {
|
|
88867
|
+
return rows.map((item) => `- ${markdownCell(item)}`).join(`
|
|
88868
|
+
`);
|
|
88869
|
+
}
|
|
88870
|
+
const prose = extractMessageSequence(rows);
|
|
88871
|
+
if (prose !== null)
|
|
88872
|
+
return prose;
|
|
88873
|
+
const table = markdownTable(rows);
|
|
88874
|
+
if (table !== null)
|
|
88875
|
+
return table;
|
|
88876
|
+
if (depth >= MARKDOWN_MAX_DEPTH) {
|
|
88877
|
+
return fencedBlock(JSON.stringify(rows, null, 2));
|
|
88878
|
+
}
|
|
88879
|
+
return rows.map((row, index) => [
|
|
88880
|
+
`${markdownHeading(depth)} ${index + 1}`,
|
|
88881
|
+
markdownObject(row, depth + 1)
|
|
88882
|
+
].join(`
|
|
88883
|
+
|
|
88884
|
+
`)).join(`
|
|
88885
|
+
|
|
88886
|
+
`);
|
|
88887
|
+
}
|
|
88888
|
+
function markdownObject(obj, depth) {
|
|
88889
|
+
const scalars = [];
|
|
88890
|
+
const blocks = [];
|
|
88891
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
88892
|
+
if (value === undefined)
|
|
88893
|
+
continue;
|
|
88894
|
+
const label = markdownLabel(key);
|
|
88895
|
+
if (Array.isArray(value)) {
|
|
88896
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
88897
|
+
|
|
88898
|
+
${markdownRows(value, depth + 1)}`);
|
|
88899
|
+
} else if (isNonEmptyPlainObject(value)) {
|
|
88900
|
+
const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
|
|
88901
|
+
if (nested !== "") {
|
|
88902
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
88903
|
+
|
|
88904
|
+
${nested}`);
|
|
88905
|
+
}
|
|
88906
|
+
} else if (typeof value === "string" && value.includes(`
|
|
88907
|
+
`)) {
|
|
88908
|
+
blocks.push(`**${label}:**
|
|
88909
|
+
|
|
88910
|
+
${fencedBlock(value)}`);
|
|
88911
|
+
} else {
|
|
88912
|
+
scalars.push(`**${label}:** ${markdownCell(value)}`);
|
|
88913
|
+
}
|
|
88914
|
+
}
|
|
88915
|
+
const sections = scalars.length > 0 ? [scalars.join(`
|
|
88916
|
+
`)] : [];
|
|
88917
|
+
sections.push(...blocks);
|
|
88918
|
+
return sections.join(`
|
|
88919
|
+
|
|
88920
|
+
`);
|
|
88921
|
+
}
|
|
88922
|
+
function extractSingleMessage(payload) {
|
|
88923
|
+
if (!isPlainRecord(payload))
|
|
88924
|
+
return null;
|
|
88925
|
+
const keys2 = Object.keys(payload);
|
|
88926
|
+
if (keys2.length !== 1 || keys2[0].toLowerCase() !== "message")
|
|
88927
|
+
return null;
|
|
88928
|
+
const value = payload[keys2[0]];
|
|
88929
|
+
return typeof value === "string" ? value : null;
|
|
88930
|
+
}
|
|
88931
|
+
function markdownPayload(payload) {
|
|
88932
|
+
const message = extractSingleMessage(payload);
|
|
88933
|
+
if (message !== null)
|
|
88934
|
+
return message;
|
|
88935
|
+
if (Array.isArray(payload)) {
|
|
88936
|
+
return markdownRows(rowsWithoutPlumbing(payload), 0);
|
|
88937
|
+
}
|
|
88938
|
+
const visible = withoutPlumbing(payload);
|
|
88939
|
+
const paged = splitPagedEnvelope(visible);
|
|
88940
|
+
if (paged !== null) {
|
|
88941
|
+
const meta3 = markdownObject(paged.meta, 0);
|
|
88942
|
+
const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
|
|
88943
|
+
|
|
88944
|
+
${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
|
|
88945
|
+
return meta3 === "" ? rows : `${meta3}
|
|
88946
|
+
|
|
88947
|
+
${rows}`;
|
|
88948
|
+
}
|
|
88949
|
+
return markdownObject(visible, 0);
|
|
88950
|
+
}
|
|
88951
|
+
function isPaginationWorthShowing(value) {
|
|
88952
|
+
if (typeof value !== "object" || value === null)
|
|
88953
|
+
return false;
|
|
88954
|
+
const page = value;
|
|
88955
|
+
return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
|
|
88956
|
+
}
|
|
88957
|
+
function markdownEnvelopeNotes(data) {
|
|
88958
|
+
const envelope = data;
|
|
88959
|
+
const notes = [];
|
|
88960
|
+
const warning = envelope.Warning;
|
|
88961
|
+
if (typeof warning === "string" && warning !== "") {
|
|
88962
|
+
notes.push(`> **Warning:** ${warning}`);
|
|
88963
|
+
}
|
|
88964
|
+
const instructions = envelope.Instructions;
|
|
88965
|
+
if (typeof instructions === "string" && instructions !== "") {
|
|
88966
|
+
notes.push(`> ${instructions}`);
|
|
88967
|
+
}
|
|
88968
|
+
const pagination = envelope.Pagination;
|
|
88969
|
+
if (isPaginationWorthShowing(pagination)) {
|
|
88970
|
+
const body = markdownObject(pagination, 1);
|
|
88971
|
+
if (body !== "") {
|
|
88972
|
+
notes.push(`${markdownHeading(0)} Pagination
|
|
88973
|
+
|
|
88974
|
+
${body}`);
|
|
88975
|
+
}
|
|
88976
|
+
}
|
|
88977
|
+
const log = envelope.Log;
|
|
88978
|
+
if (typeof log === "string" && log !== "") {
|
|
88979
|
+
notes.push(`**Log:** ${log}`);
|
|
88980
|
+
}
|
|
88981
|
+
return notes;
|
|
88982
|
+
}
|
|
88983
|
+
function renderMarkdown(data) {
|
|
88984
|
+
if (data.Result !== RESULTS.Success) {
|
|
88985
|
+
const failure = data;
|
|
88986
|
+
const sections = [`**Failed:** ${failure.Message}`];
|
|
88987
|
+
if (failure.Data != null) {
|
|
88988
|
+
sections.push(markdownPayload(failure.Data));
|
|
88989
|
+
}
|
|
88990
|
+
if (failure.Instructions) {
|
|
88991
|
+
sections.push(`> ${failure.Instructions}`);
|
|
88992
|
+
}
|
|
88993
|
+
return sections.filter((section) => section !== "").join(`
|
|
88994
|
+
|
|
88995
|
+
`);
|
|
88996
|
+
}
|
|
88997
|
+
if (!("Data" in data) || data.Data == null) {
|
|
88998
|
+
return markdownObject(withoutPlumbing(data), 0);
|
|
88999
|
+
}
|
|
89000
|
+
return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
|
|
89001
|
+
|
|
89002
|
+
`);
|
|
89003
|
+
}
|
|
88768
89004
|
function toYaml(data) {
|
|
88769
89005
|
const codec2 = getYamlCodec();
|
|
88770
89006
|
if (!codec2) {
|
|
@@ -89942,6 +90178,75 @@ var hasMoreElementsPages = (token) => {
|
|
|
89942
90178
|
const cursor = decodeElementsNextPageToken(token)?.providerNextPage;
|
|
89943
90179
|
return typeof cursor === "string" && cursor.length > 0 && cursor !== ELEMENTS_NEXT_PAGE_DONE;
|
|
89944
90180
|
};
|
|
90181
|
+
// src/runtime/connector-execute-helper.ts
|
|
90182
|
+
var EXECUTE_PATH = "elements_/v4/execute";
|
|
90183
|
+
function resolveExecuteUrl(ctx) {
|
|
90184
|
+
const base = ctx.baseUrl.replace(/\/+$/, "");
|
|
90185
|
+
return `${base}/${ctx.organizationId}/${ctx.tenantName}/${EXECUTE_PATH}`;
|
|
90186
|
+
}
|
|
90187
|
+
async function executeRequest(input) {
|
|
90188
|
+
const options = input.tenant ? { tenant: input.tenant } : undefined;
|
|
90189
|
+
const { baseUrl, accessToken, organizationId, tenantName } = await getValidatedAuthContext(options);
|
|
90190
|
+
const requestBody = buildRequestBody(input);
|
|
90191
|
+
const headers = {
|
|
90192
|
+
"Content-Type": "application/json",
|
|
90193
|
+
Authorization: `Bearer ${accessToken}`,
|
|
90194
|
+
"X-UIPATH-OrganizationId": organizationId,
|
|
90195
|
+
"X-UIPATH-TenantId": tenantName,
|
|
90196
|
+
"User-Agent": SDK_USER_AGENT
|
|
90197
|
+
};
|
|
90198
|
+
const url2 = resolveExecuteUrl({ baseUrl, organizationId, tenantName });
|
|
90199
|
+
const response = await fetch(url2, {
|
|
90200
|
+
method: "POST",
|
|
90201
|
+
headers,
|
|
90202
|
+
body: JSON.stringify(requestBody)
|
|
90203
|
+
});
|
|
90204
|
+
const body = await response.text();
|
|
90205
|
+
const responseHeaders = Object.fromEntries(response.headers.entries());
|
|
90206
|
+
if (response.status < 200 || response.status >= 300) {
|
|
90207
|
+
return { status: response.status, headers: responseHeaders, body };
|
|
90208
|
+
}
|
|
90209
|
+
const envelope = parseEnvelope(body);
|
|
90210
|
+
if (envelope === undefined) {
|
|
90211
|
+
return { status: response.status, headers: responseHeaders, body };
|
|
90212
|
+
}
|
|
90213
|
+
return {
|
|
90214
|
+
status: envelope.status ?? response.status,
|
|
90215
|
+
headers: envelope.headers ?? responseHeaders,
|
|
90216
|
+
body: envelope.body ?? []
|
|
90217
|
+
};
|
|
90218
|
+
}
|
|
90219
|
+
function parseEnvelope(body) {
|
|
90220
|
+
try {
|
|
90221
|
+
const parsed = JSON.parse(body);
|
|
90222
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
90223
|
+
return;
|
|
90224
|
+
}
|
|
90225
|
+
return parsed;
|
|
90226
|
+
} catch {
|
|
90227
|
+
return;
|
|
90228
|
+
}
|
|
90229
|
+
}
|
|
90230
|
+
function buildRequestBody(input) {
|
|
90231
|
+
const context = {
|
|
90232
|
+
connectionId: input.connectionId
|
|
90233
|
+
};
|
|
90234
|
+
if (input.connectorKey) {
|
|
90235
|
+
context.connectorKey = input.connectorKey;
|
|
90236
|
+
}
|
|
90237
|
+
if (input.inlineScript !== undefined) {
|
|
90238
|
+
context.script = {
|
|
90239
|
+
inlineScript: input.inlineScript
|
|
90240
|
+
};
|
|
90241
|
+
} else if (input.scriptRef !== undefined) {
|
|
90242
|
+
context.script = { reference: input.scriptRef };
|
|
90243
|
+
}
|
|
90244
|
+
const requestBody = { context };
|
|
90245
|
+
if (input.request) {
|
|
90246
|
+
requestBody.request = input.request;
|
|
90247
|
+
}
|
|
90248
|
+
return requestBody;
|
|
90249
|
+
}
|
|
89945
90250
|
export {
|
|
89946
90251
|
ACTIVITY_VERSION_V4,
|
|
89947
90252
|
AccessTokenResponseFromJSON,
|
|
@@ -91110,6 +91415,7 @@ export {
|
|
|
91110
91415
|
createElementsConfig,
|
|
91111
91416
|
decodeElementsNextPageToken,
|
|
91112
91417
|
executeOperation,
|
|
91418
|
+
executeRequest,
|
|
91113
91419
|
exists,
|
|
91114
91420
|
exportConnectorZip,
|
|
91115
91421
|
extractMultipartParameters,
|
|
@@ -91418,4 +91724,4 @@ export {
|
|
|
91418
91724
|
validateRequiredParameters
|
|
91419
91725
|
};
|
|
91420
91726
|
|
|
91421
|
-
//# debugId=
|
|
91727
|
+
//# debugId=AE7FC8DFE864C16964756E2164756E21
|
|
@@ -47,13 +47,13 @@ export declare function isV4ActivityConfiguration(instanceParameters: Record<str
|
|
|
47
47
|
/**
|
|
48
48
|
* Fetch activity metadata from the v4 elements endpoints (4.0.0 activities).
|
|
49
49
|
*
|
|
50
|
-
* v4 activities are addressed by
|
|
51
|
-
* activity's configuration JSON),
|
|
50
|
+
* v4 activities are addressed by object name (the `objectName` in the
|
|
51
|
+
* activity's configuration JSON), and the v4 route has no
|
|
52
52
|
* `/instances/{connectionId}` prefix — the instance segment was removed in v4.
|
|
53
53
|
*
|
|
54
|
-
* Endpoint: GET {baseUrl}/{org}/{tenant}/elements_/v4/element/connectors/{connectorKey}/
|
|
54
|
+
* Endpoint: GET {baseUrl}/{org}/{tenant}/elements_/v4/element/connectors/{connectorKey}/objects/{objectName}/metadata
|
|
55
55
|
*/
|
|
56
|
-
export declare function getConnectorActivityMetadataV4(options: CreateApiClientOptions | undefined, connectorKey: string,
|
|
56
|
+
export declare function getConnectorActivityMetadataV4(options: CreateApiClientOptions | undefined, connectorKey: string, objectName: string): Promise<Record<string, unknown>>;
|
|
57
57
|
/**
|
|
58
58
|
* Fetch object metadata as JSON Schema (with connection — enriched fields including custom).
|
|
59
59
|
*/
|
package/dist/src/dap/types.d.ts
CHANGED
|
@@ -73,11 +73,18 @@ export type ConnectorMethodInfo = {
|
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
export type FieldReference = {
|
|
76
|
+
/** Listable object behind the lookup (v3). Absent on 4.0.0 script-backed references. */
|
|
76
77
|
objectName: string;
|
|
77
78
|
lookupValue: string;
|
|
78
79
|
lookupNames?: string[];
|
|
79
80
|
path?: string;
|
|
80
81
|
childPath?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Published connector script behind the lookup (4.0.0 activities). Resolve
|
|
84
|
+
* with `uip is resources run script --script-ref <scriptRef>`; there
|
|
85
|
+
* is no object to `run list`.
|
|
86
|
+
*/
|
|
87
|
+
scriptRef?: string;
|
|
81
88
|
};
|
|
82
89
|
export type ISFieldMethod = {
|
|
83
90
|
request: boolean;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export { normalizeConnectionStatus } from "./connection-state.js";
|
|
|
9
9
|
export * from "./dap/index.js";
|
|
10
10
|
export { buildResourceCompactSummary, buildTriggerCompactSummary, CRUD_OPERATIONS, fetchRawMetadata, fetchTriggerMetadata, fetchTriggerObjects, normalizeObjectsList, } from "./metadata/resource-metadata.js";
|
|
11
11
|
export { decodeElementsNextPageToken, ELEMENTS_NEXT_PAGE_DONE, type ElementsNextPage, hasMoreElementsPages, } from "./pagination.js";
|
|
12
|
+
export * from "./runtime/index.js";
|
|
12
13
|
export { SDK_USER_AGENT } from "./user-agent.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExecuteRequestInput, ExecuteResponse } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Execute an activity script through the Integration Service runtime.
|
|
4
|
+
*
|
|
5
|
+
* The runtime answers a vendor call with a JSON envelope `{ status, headers,
|
|
6
|
+
* body }`; this unwraps it so `status` is the VENDOR's status and `body` is
|
|
7
|
+
* the vendor's payload as parsed JSON. A runtime refusal (a non-2xx answer)
|
|
8
|
+
* is relayed as-is — the runtime's own status and raw body — and is a normal
|
|
9
|
+
* result, not a thrown error. Only a network failure throws.
|
|
10
|
+
*/
|
|
11
|
+
export declare function executeRequest(input: ExecuteRequestInput): Promise<ExecuteResponse>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Integration Service runtime `POST /execute` surface.
|
|
3
|
+
*
|
|
4
|
+
* The runtime answers WITH the vendor's own response: the vendor's
|
|
5
|
+
* status is the HTTP status and the vendor's bytes are the body.
|
|
6
|
+
*/
|
|
7
|
+
interface callContext {
|
|
8
|
+
connectorKey?: string;
|
|
9
|
+
connectionId: string;
|
|
10
|
+
script?: script | undefined;
|
|
11
|
+
}
|
|
12
|
+
interface script {
|
|
13
|
+
reference?: string;
|
|
14
|
+
inlineScript?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ExecuteRequest {
|
|
17
|
+
context?: callContext;
|
|
18
|
+
request?: {
|
|
19
|
+
body?: unknown;
|
|
20
|
+
query?: Record<string, string>;
|
|
21
|
+
headers?: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* What to execute. Exactly one of `inlineScript` or `scriptRef` must be set —
|
|
26
|
+
* the runtime treats `inlineScript` as winning over a reference, so the caller
|
|
27
|
+
* must never send both.
|
|
28
|
+
*/
|
|
29
|
+
export interface ExecuteRequestInput {
|
|
30
|
+
connectionId: string;
|
|
31
|
+
/** Optional: filled from the connection's own `connector.key` when omitted. */
|
|
32
|
+
connectorKey?: string;
|
|
33
|
+
/** JavaScript module text, sent as `context.script.inlineScript`. */
|
|
34
|
+
inlineScript?: string;
|
|
35
|
+
/** A tenant-authorized artifact id, sent as `context.script.reference`. */
|
|
36
|
+
scriptRef?: string;
|
|
37
|
+
/** The INBOUND call a script reads as `context.request`. Never a vendor target. */
|
|
38
|
+
request?: {
|
|
39
|
+
body?: unknown;
|
|
40
|
+
query?: Record<string, string>;
|
|
41
|
+
headers?: Record<string, string>;
|
|
42
|
+
};
|
|
43
|
+
tenant?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The runtime's execute answer.
|
|
47
|
+
*/
|
|
48
|
+
export interface ExecuteResponse {
|
|
49
|
+
/** The VENDOR's status for a vendor answer; the runtime's own for a runtime refusal. */
|
|
50
|
+
status: number;
|
|
51
|
+
headers: Record<string, string>;
|
|
52
|
+
body: unknown;
|
|
53
|
+
}
|
|
54
|
+
export interface ExecuteRouteContext {
|
|
55
|
+
baseUrl: string;
|
|
56
|
+
organizationId: string;
|
|
57
|
+
tenantName: string;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/integrationservice-sdk",
|
|
3
|
+
"author": "UiPath",
|
|
3
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
4
|
-
"version": "1.
|
|
5
|
+
"version": "1.203.0-preview.160",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
7
8
|
"url": "https://github.com/UiPath/cli.git",
|
|
@@ -30,5 +31,5 @@
|
|
|
30
31
|
"dependencies": {
|
|
31
32
|
"@uipath/integration-service-design-time": "0.25.2"
|
|
32
33
|
},
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "3a42062ba731afca4595ba9aa8a80afc9667528d"
|
|
34
35
|
}
|