@uipath/solution-tool 1.205.0-preview.281 → 1.206.0-preview.279

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.
Files changed (132) hide show
  1. package/dist/{archive-extract-x35t9ktj.js → archive-extract-136rn3ja.js} +13 -15
  2. package/dist/{cleanup-command-service-je9d70vv.js → cleanup-command-service-ejakyhea.js} +34 -31
  3. package/dist/deploy-delete-service-r7abfh28.js +23 -0
  4. package/dist/deploy-run-service-rnthz10q.js +23 -0
  5. package/dist/{deploy-status-service-919yn8wn.js → deploy-status-service-6my5vm61.js} +72 -62
  6. package/dist/deploy.js +35 -37
  7. package/dist/deployment-search-gfm907tx.js +54 -0
  8. package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
  9. package/dist/feed-resolver-14crsx5y.js +27 -0
  10. package/dist/feed-scope-failure-67cyybn0.js +20 -0
  11. package/dist/feed-session-g94q2bjc.js +23 -0
  12. package/dist/first-party-service-n3vva2m4.js +8 -0
  13. package/dist/governance-options-t20vsznh.js +19 -0
  14. package/dist/index-aspmac9f.js +24 -0
  15. package/dist/index-ddk6v1ej.js +60 -0
  16. package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
  17. package/dist/index-qq4kre7a.js +93 -0
  18. package/dist/index-t262f2xv.js +16 -0
  19. package/dist/index.js +33 -34
  20. package/dist/init.js +18 -21
  21. package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
  22. package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
  23. package/dist/{list-5fke71jn.js → list-jntan9tx.js} +23 -23
  24. package/dist/models/pack-command-types.d.ts +3 -1
  25. package/dist/node-kwzcw5ex.js +25 -0
  26. package/dist/pack-command-service-pwaeha7y.js +29 -0
  27. package/dist/{pack-project-ha0pxw3h.js → pack-project-ztt1hfrs.js} +33 -40
  28. package/dist/pack.js +26 -30
  29. package/dist/package-id-4tsg5jsb.js +11 -0
  30. package/dist/{packager-tool-4pa108k7.js → packager-tool-1bz9h5ca.js} +11 -11
  31. package/dist/{packager-tool-gs3f3tf7.js → packager-tool-1ctvbx0h.js} +1 -1
  32. package/dist/{packager-tool-f23a485e.js → packager-tool-55ztfccd.js} +176 -196
  33. package/dist/{packager-tool-45a8fkw0.js → packager-tool-95y24705.js} +37 -39
  34. package/dist/{packager-tool-2vmz56qh.js → packager-tool-9j8e5q1z.js} +184 -33
  35. package/dist/{packager-tool-tx834spe.js → packager-tool-9vrwpgt3.js} +757 -309
  36. package/dist/packager-tool-a6va4gc5.js +1178 -0
  37. package/dist/{packager-tool-pbmqk39a.js → packager-tool-a7s0gbxs.js} +33 -28
  38. package/dist/{packager-tool-47wzvqw0.js → packager-tool-aws5w512.js} +6 -6
  39. package/dist/{packager-tool-97rcgwvv.js → packager-tool-bs1jn1yn.js} +331 -55
  40. package/dist/packager-tool-c64hqa8n.js +106 -0
  41. package/dist/{packager-tool-5ddtwzva.js → packager-tool-ca5ngmqv.js} +12 -12
  42. package/dist/{packager-tool-6kz1pv9f.js → packager-tool-d1texmvn.js} +828 -338
  43. package/dist/{packager-tool-1de529jm.js → packager-tool-epsr41wx.js} +12 -3
  44. package/dist/packager-tool-f84z7nds.js +130 -0
  45. package/dist/{packager-tool-8ptbmmmp.js → packager-tool-fp46ebde.js} +147 -76
  46. package/dist/packager-tool-fqs6hdcy.js +290 -0
  47. package/dist/{packager-tool-3bwnkjdq.js → packager-tool-fx4ws49n.js} +12 -12
  48. package/dist/{packager-tool-6ybywxxn.js → packager-tool-m07vyk89.js} +371 -221
  49. package/dist/{packager-tool-gyqfs04e.js → packager-tool-nrhqgr4z.js} +273 -255
  50. package/dist/{packager-tool-61pwb567.js → packager-tool-ppj5f4y7.js} +6 -7
  51. package/dist/{packager-tool-d78ww4hb.js → packager-tool-pyt9fvty.js} +51 -48
  52. package/dist/packager-tool-q5d9df2q.js +74 -0
  53. package/dist/{packager-tool-cvf46scg.js → packager-tool-q8ryk6q9.js} +122 -89
  54. package/dist/{packager-tool-t8gh825q.js → packager-tool-qf8753ee.js} +53 -41
  55. package/dist/{packager-tool-60af1hw2.js → packager-tool-qzcd5c9s.js} +3 -3
  56. package/dist/packager-tool-resolver-td3bhccd.js +20 -0
  57. package/dist/{packager-tool-dfrk01gn.js → packager-tool-rj2d1g0w.js} +154 -154
  58. package/dist/{packager-tool-2t72aez8.js → packager-tool-snm6s7b5.js} +15 -15
  59. package/dist/{packager-tool-43ahv5mn.js → packager-tool-t39pjz7n.js} +35 -18
  60. package/dist/{packager-tool-wm0jaz7p.js → packager-tool-t3a48ys5.js} +305 -657
  61. package/dist/{packager-tool-dnrk1gg6.js → packager-tool-t3ahzjh1.js} +356 -298
  62. package/dist/{packager-tool-v1f5e8t9.js → packager-tool-vgrswa8p.js} +53 -8
  63. package/dist/packager-tool-vrtabg73.js +2307 -0
  64. package/dist/{packager-tool-gmwva4yv.js → packager-tool-vx2c68sb.js} +2 -2
  65. package/dist/{packager-tool-h1tq7bqf.js → packager-tool-vx39dhvn.js} +65 -35
  66. package/dist/{packager-tool-5qzgdb66.js → packager-tool-w34wyhwf.js} +13 -15
  67. package/dist/packager-tool-w8bcwfd3.js +280 -0
  68. package/dist/{packager-tool-1ybnxbp9.js → packager-tool-wm0h0wa1.js} +18 -18
  69. package/dist/{packager-tool-b2nhscfk.js → packager-tool-wm8nj6e9.js} +18 -18
  70. package/dist/{packager-tool-amhyxzz6.js → packager-tool-x33sdw6n.js} +16 -16
  71. package/dist/{packager-tool-wy4fx250.js → packager-tool-yetmzme9.js} +89 -30
  72. package/dist/{packager-tool-056k8w2f.js → packager-tool-z5r49ky9.js} +75 -9
  73. package/dist/packager-tool.js +6 -7
  74. package/dist/prepare-solution-resources-pwnyvtza.js +26 -0
  75. package/dist/{project-command-utils-t6pmpvq3.js → project-command-utils-zcmbecfy.js} +23 -26
  76. package/dist/project-contributions-kh9yftvg.js +27 -0
  77. package/dist/publish.js +17 -17
  78. package/dist/resource-mutations-mfn5k1hb.js +27 -0
  79. package/dist/{resource-version-lookup-0e3e2j58.js → resource-version-lookup-6ejh1hwd.js} +20 -23
  80. package/dist/resource.js +13 -16
  81. package/dist/{restore-command-service-pzpet021.js → restore-command-service-n880dxre.js} +37 -34
  82. package/dist/{run-service-hk8w2h31.js → run-service-4vhn6mtb.js} +144 -66
  83. package/dist/services/deploy-activate-service.d.ts +2 -1
  84. package/dist/services/deployment-search-client.d.ts +2 -1
  85. package/dist/services/deployment-search.d.ts +39 -0
  86. package/dist/services/feed-resolver.d.ts +13 -1
  87. package/dist/services/feed-selection.d.ts +8 -5
  88. package/dist/services/feed-session.d.ts +34 -0
  89. package/dist/services/install-run.d.ts +92 -0
  90. package/dist/services/prepare-solution-resources.d.ts +11 -2
  91. package/dist/services/project-contributions.d.ts +2 -0
  92. package/dist/services/project-identity-telemetry.d.ts +3 -0
  93. package/dist/services/publish-service.d.ts +20 -3
  94. package/dist/services/solution-identity.d.ts +18 -0
  95. package/dist/ship-telemetry-bkf3800w.js +16 -0
  96. package/dist/solution-auth-jxcgd2m0.js +10 -0
  97. package/dist/solution-identity-92h2fbpa.js +19 -0
  98. package/dist/templates/AGENTS.md +27 -29
  99. package/dist/tool.js +32 -33
  100. package/package.json +2 -2
  101. package/dist/deploy-delete-service-0tm600d1.js +0 -25
  102. package/dist/deploy-run-service-hne5w17k.js +0 -25
  103. package/dist/deployment-search-32zvxn35.js +0 -55
  104. package/dist/feed-resolver-pdeb4wkq.js +0 -28
  105. package/dist/feed-scope-failure-4baame72.js +0 -19
  106. package/dist/feed-session-7xqphdrg.js +0 -17
  107. package/dist/first-party-service-sd8yaf73.js +0 -27
  108. package/dist/governance-options-bqgv5fte.js +0 -32
  109. package/dist/index-dqa169gp.js +0 -25
  110. package/dist/index-prm27bvm.js +0 -138
  111. package/dist/index-wdndcwab.js +0 -667
  112. package/dist/node-v7xhqwe2.js +0 -86
  113. package/dist/pack-command-service-b1v9c8cw.js +0 -35
  114. package/dist/package-id-rpzgy31w.js +0 -13
  115. package/dist/packager-tool-53w8skv5.js +0 -262
  116. package/dist/packager-tool-5edvzz80.js +0 -543
  117. package/dist/packager-tool-99jaqabz.js +0 -171
  118. package/dist/packager-tool-9hsmn8th.js +0 -418
  119. package/dist/packager-tool-azre7mm1.js +0 -182
  120. package/dist/packager-tool-fn13r8e1.js +0 -188
  121. package/dist/packager-tool-gdtpsdn7.js +0 -342
  122. package/dist/packager-tool-qw47eyw7.js +0 -43
  123. package/dist/packager-tool-resolver-994z3jkj.js +0 -23
  124. package/dist/packager-tool-tedbebpq.js +0 -5367
  125. package/dist/packager-tool-x1ah4eez.js +0 -68
  126. package/dist/prepare-solution-resources-m1djfj62.js +0 -29
  127. package/dist/project-contributions-79ndycrx.js +0 -32
  128. package/dist/resource-mutations-c3krjqze.js +0 -36
  129. package/dist/ship-telemetry-myes7ak5.js +0 -21
  130. package/dist/solution-auth-aead70sw.js +0 -11
  131. /package/dist/{packager-tool-act5r386.js → packager-tool-2pxe2r4j.js} +0 -0
  132. /package/dist/{packager-tool-kkfb5kgn.js → packager-tool-vrqbbh01.js} +0 -0
@@ -0,0 +1,2307 @@
1
+ import {
2
+ catchError,
3
+ addSdkUserAgentHeader
4
+ } from "./packager-tool-m07vyk89.js";
5
+ import {
6
+ ResponseError,
7
+ SDK_USER_AGENT
8
+ } from "./packager-tool-a6va4gc5.js";
9
+ import {
10
+ RESULTS,
11
+ summarizePlatformBody,
12
+ logger
13
+ } from "./packager-tool-9vrwpgt3.js";
14
+ import {
15
+ zipSync2
16
+ } from "./packager-tool-rj2d1g0w.js";
17
+ import {
18
+ readUipxFile
19
+ } from "./packager-tool-c64hqa8n.js";
20
+ import {
21
+ __toESM,
22
+ __commonJS
23
+ } from "./packager-tool-epsr41wx.js";
24
+
25
+ // ../../node_modules/ignore/index.js
26
+ var require_ignore = __commonJS(function(exports, module) {
27
+ function makeArray(subject) {
28
+ return Array.isArray(subject) ? subject : [subject];
29
+ }
30
+ var EMPTY = "";
31
+ var SPACE = " ";
32
+ var ESCAPE = "\\";
33
+ var REGEX_TEST_BLANK_LINE = /^\s+$/;
34
+ var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
35
+ var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
36
+ var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
37
+ var REGEX_SPLITALL_CRLF = /\r?\n/g;
38
+ var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
39
+ var SLASH = "/";
40
+ var TMP_KEY_IGNORE = "node-ignore";
41
+ if (typeof Symbol !== "undefined") {
42
+ TMP_KEY_IGNORE = Symbol.for("node-ignore");
43
+ }
44
+ var KEY_IGNORE = TMP_KEY_IGNORE;
45
+ var define = (object, key, value) => Object.defineProperty(object, key, { value });
46
+ var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
47
+ var RETURN_FALSE = () => false;
48
+ var sanitizeRange = (range) => range.replace(REGEX_REGEXP_RANGE, (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY);
49
+ var cleanRangeBackSlash = (slashes) => {
50
+ const { length } = slashes;
51
+ return slashes.slice(0, length - length % 2);
52
+ };
53
+ var REPLACERS = [
54
+ [
55
+ /^\uFEFF/,
56
+ () => EMPTY
57
+ ],
58
+ [
59
+ /((?:\\\\)*?)(\\?\s+)$/,
60
+ (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY)
61
+ ],
62
+ [
63
+ /(\\+?)\s/g,
64
+ (_, m1) => {
65
+ const { length } = m1;
66
+ return m1.slice(0, length - length % 2) + SPACE;
67
+ }
68
+ ],
69
+ [
70
+ /[\\$.|*+(){^]/g,
71
+ (match) => `\\${match}`
72
+ ],
73
+ [
74
+ /(?!\\)\?/g,
75
+ () => "[^/]"
76
+ ],
77
+ [
78
+ /^\//,
79
+ () => "^"
80
+ ],
81
+ [
82
+ /\//g,
83
+ () => "\\/"
84
+ ],
85
+ [
86
+ /^\^*\\\*\\\*\\\//,
87
+ () => "^(?:.*\\/)?"
88
+ ],
89
+ [
90
+ /^(?=[^^])/,
91
+ function startingReplacer() {
92
+ return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
93
+ }
94
+ ],
95
+ [
96
+ /\\\/\\\*\\\*(?=\\\/|$)/g,
97
+ (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
98
+ ],
99
+ [
100
+ /(^|[^\\]+)(\\\*)+(?=.+)/g,
101
+ (_, p1, p2) => {
102
+ const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
103
+ return p1 + unescaped;
104
+ }
105
+ ],
106
+ [
107
+ /\\\\\\(?=[$.|*+(){^])/g,
108
+ () => ESCAPE
109
+ ],
110
+ [
111
+ /\\\\/g,
112
+ () => ESCAPE
113
+ ],
114
+ [
115
+ /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
116
+ (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
117
+ ],
118
+ [
119
+ /(?:[^*])$/,
120
+ (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
121
+ ],
122
+ [
123
+ /(\^|\\\/)?\\\*$/,
124
+ (_, p1) => {
125
+ const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
126
+ return `${prefix}(?=$|\\/$)`;
127
+ }
128
+ ]
129
+ ];
130
+ var regexCache = Object.create(null);
131
+ var makeRegex = (pattern, ignoreCase) => {
132
+ let source = regexCache[pattern];
133
+ if (!source) {
134
+ source = REPLACERS.reduce((prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)), pattern);
135
+ regexCache[pattern] = source;
136
+ }
137
+ return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
138
+ };
139
+ var isString = (subject) => typeof subject === "string";
140
+ var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
141
+ var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
142
+
143
+ class IgnoreRule {
144
+ constructor(origin, pattern, negative, regex) {
145
+ this.origin = origin;
146
+ this.pattern = pattern;
147
+ this.negative = negative;
148
+ this.regex = regex;
149
+ }
150
+ }
151
+ var createRule = (pattern, ignoreCase) => {
152
+ const origin = pattern;
153
+ let negative = false;
154
+ if (pattern.indexOf("!") === 0) {
155
+ negative = true;
156
+ pattern = pattern.substr(1);
157
+ }
158
+ pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
159
+ const regex = makeRegex(pattern, ignoreCase);
160
+ return new IgnoreRule(origin, pattern, negative, regex);
161
+ };
162
+ var throwError = (message, Ctor) => {
163
+ throw new Ctor(message);
164
+ };
165
+ var checkPath = (path, originalPath, doThrow) => {
166
+ if (!isString(path)) {
167
+ return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
168
+ }
169
+ if (!path) {
170
+ return doThrow(`path must not be empty`, TypeError);
171
+ }
172
+ if (checkPath.isNotRelative(path)) {
173
+ const r = "`path.relative()`d";
174
+ return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError);
175
+ }
176
+ return true;
177
+ };
178
+ var isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
179
+ checkPath.isNotRelative = isNotRelative;
180
+ checkPath.convert = (p) => p;
181
+
182
+ class Ignore {
183
+ constructor({
184
+ ignorecase = true,
185
+ ignoreCase = ignorecase,
186
+ allowRelativePaths = false
187
+ } = {}) {
188
+ define(this, KEY_IGNORE, true);
189
+ this._rules = [];
190
+ this._ignoreCase = ignoreCase;
191
+ this._allowRelativePaths = allowRelativePaths;
192
+ this._initCache();
193
+ }
194
+ _initCache() {
195
+ this._ignoreCache = Object.create(null);
196
+ this._testCache = Object.create(null);
197
+ }
198
+ _addPattern(pattern) {
199
+ if (pattern && pattern[KEY_IGNORE]) {
200
+ this._rules = this._rules.concat(pattern._rules);
201
+ this._added = true;
202
+ return;
203
+ }
204
+ if (checkPattern(pattern)) {
205
+ const rule = createRule(pattern, this._ignoreCase);
206
+ this._added = true;
207
+ this._rules.push(rule);
208
+ }
209
+ }
210
+ add(pattern) {
211
+ this._added = false;
212
+ makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this);
213
+ if (this._added) {
214
+ this._initCache();
215
+ }
216
+ return this;
217
+ }
218
+ addPattern(pattern) {
219
+ return this.add(pattern);
220
+ }
221
+ _testOne(path, checkUnignored) {
222
+ let ignored = false;
223
+ let unignored = false;
224
+ this._rules.forEach((rule) => {
225
+ const { negative } = rule;
226
+ if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
227
+ return;
228
+ }
229
+ const matched = rule.regex.test(path);
230
+ if (matched) {
231
+ ignored = !negative;
232
+ unignored = negative;
233
+ }
234
+ });
235
+ return {
236
+ ignored,
237
+ unignored
238
+ };
239
+ }
240
+ _test(originalPath, cache, checkUnignored, slices) {
241
+ const path = originalPath && checkPath.convert(originalPath);
242
+ checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
243
+ return this._t(path, cache, checkUnignored, slices);
244
+ }
245
+ _t(path, cache, checkUnignored, slices) {
246
+ if (path in cache) {
247
+ return cache[path];
248
+ }
249
+ if (!slices) {
250
+ slices = path.split(SLASH);
251
+ }
252
+ slices.pop();
253
+ if (!slices.length) {
254
+ return cache[path] = this._testOne(path, checkUnignored);
255
+ }
256
+ const parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);
257
+ return cache[path] = parent.ignored ? parent : this._testOne(path, checkUnignored);
258
+ }
259
+ ignores(path) {
260
+ return this._test(path, this._ignoreCache, false).ignored;
261
+ }
262
+ createFilter() {
263
+ return (path) => !this.ignores(path);
264
+ }
265
+ filter(paths) {
266
+ return makeArray(paths).filter(this.createFilter());
267
+ }
268
+ test(path) {
269
+ return this._test(path, this._testCache, true);
270
+ }
271
+ }
272
+ var factory = (options) => new Ignore(options);
273
+ var isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
274
+ factory.isPathValid = isPathValid;
275
+ factory.default = factory;
276
+ module.exports = factory;
277
+ if (typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")) {
278
+ const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
279
+ checkPath.convert = makePosix;
280
+ const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
281
+ checkPath.isNotRelative = (path) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
282
+ }
283
+ });
284
+
285
+ // ../studioweb-sdk/generated/src/runtime.ts
286
+ var BASE_PATH = "https://alpha.uipath.com/studio_/backend".replace(/\/+$/, "");
287
+
288
+ class Configuration {
289
+ configuration;
290
+ constructor(configuration = {}) {
291
+ this.configuration = configuration;
292
+ }
293
+ set config(configuration) {
294
+ this.configuration = configuration;
295
+ }
296
+ get basePath() {
297
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
298
+ }
299
+ get fetchApi() {
300
+ return this.configuration.fetchApi;
301
+ }
302
+ get middleware() {
303
+ return this.configuration.middleware || [];
304
+ }
305
+ get queryParamsStringify() {
306
+ return this.configuration.queryParamsStringify || querystring;
307
+ }
308
+ get username() {
309
+ return this.configuration.username;
310
+ }
311
+ get password() {
312
+ return this.configuration.password;
313
+ }
314
+ get apiKey() {
315
+ const apiKey = this.configuration.apiKey;
316
+ if (apiKey) {
317
+ return typeof apiKey === "function" ? apiKey : () => apiKey;
318
+ }
319
+ return;
320
+ }
321
+ get accessToken() {
322
+ const accessToken = this.configuration.accessToken;
323
+ if (accessToken) {
324
+ return typeof accessToken === "function" ? accessToken : async () => accessToken;
325
+ }
326
+ return;
327
+ }
328
+ get headers() {
329
+ return this.configuration.headers;
330
+ }
331
+ get credentials() {
332
+ return this.configuration.credentials;
333
+ }
334
+ }
335
+ var DefaultConfig = new Configuration;
336
+
337
+ class BaseAPI {
338
+ configuration;
339
+ static jsonRegex = new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", "i");
340
+ middleware;
341
+ constructor(configuration = DefaultConfig) {
342
+ this.configuration = configuration;
343
+ this.middleware = configuration.middleware;
344
+ }
345
+ withMiddleware(...middlewares) {
346
+ const next = this.clone();
347
+ next.middleware = next.middleware.concat(...middlewares);
348
+ return next;
349
+ }
350
+ withPreMiddleware(...preMiddlewares) {
351
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
352
+ return this.withMiddleware(...middlewares);
353
+ }
354
+ withPostMiddleware(...postMiddlewares) {
355
+ const middlewares = postMiddlewares.map((post) => ({ post }));
356
+ return this.withMiddleware(...middlewares);
357
+ }
358
+ isJsonMime(mime) {
359
+ if (!mime) {
360
+ return false;
361
+ }
362
+ return BaseAPI.jsonRegex.test(mime);
363
+ }
364
+ async request(context, initOverrides) {
365
+ const { url, init } = await this.createFetchParams(context, initOverrides);
366
+ const response = await this.fetchApi(url, init);
367
+ if (response && (response.status >= 200 && response.status < 300)) {
368
+ return response;
369
+ }
370
+ throw new ResponseError2(response, "Response returned an error code");
371
+ }
372
+ async createFetchParams(context, initOverrides) {
373
+ let url = this.configuration.basePath + context.path;
374
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
375
+ url += "?" + this.configuration.queryParamsStringify(context.query);
376
+ }
377
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
378
+ Object.keys(headers).forEach((key) => headers[key] === undefined ? delete headers[key] : {});
379
+ const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
380
+ const initParams = {
381
+ method: context.method,
382
+ headers,
383
+ body: context.body,
384
+ credentials: this.configuration.credentials
385
+ };
386
+ const overriddenInit = {
387
+ ...initParams,
388
+ ...await initOverrideFn({
389
+ init: initParams,
390
+ context
391
+ })
392
+ };
393
+ let body;
394
+ if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
395
+ body = overriddenInit.body;
396
+ } else if (this.isJsonMime(headers["Content-Type"])) {
397
+ body = JSON.stringify(overriddenInit.body);
398
+ } else {
399
+ body = overriddenInit.body;
400
+ }
401
+ const init = {
402
+ ...overriddenInit,
403
+ body
404
+ };
405
+ return { url, init };
406
+ }
407
+ fetchApi = async (url, init) => {
408
+ let fetchParams = { url, init };
409
+ for (const middleware of this.middleware) {
410
+ if (middleware.pre) {
411
+ fetchParams = await middleware.pre({
412
+ fetch: this.fetchApi,
413
+ ...fetchParams
414
+ }) || fetchParams;
415
+ }
416
+ }
417
+ let response = undefined;
418
+ try {
419
+ response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
420
+ } catch (e) {
421
+ for (const middleware of this.middleware) {
422
+ if (middleware.onError) {
423
+ response = await middleware.onError({
424
+ fetch: this.fetchApi,
425
+ url: fetchParams.url,
426
+ init: fetchParams.init,
427
+ error: e,
428
+ response: response ? response.clone() : undefined
429
+ }) || response;
430
+ }
431
+ }
432
+ if (response === undefined) {
433
+ if (e instanceof Error) {
434
+ throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
435
+ } else {
436
+ throw e;
437
+ }
438
+ }
439
+ }
440
+ for (const middleware of this.middleware) {
441
+ if (middleware.post) {
442
+ response = await middleware.post({
443
+ fetch: this.fetchApi,
444
+ url: fetchParams.url,
445
+ init: fetchParams.init,
446
+ response: response.clone()
447
+ }) || response;
448
+ }
449
+ }
450
+ return response;
451
+ };
452
+ clone() {
453
+ const constructor = this.constructor;
454
+ const next = new constructor(this.configuration);
455
+ next.middleware = this.middleware.slice();
456
+ return next;
457
+ }
458
+ }
459
+ function isBlob(value) {
460
+ return typeof Blob !== "undefined" && value instanceof Blob;
461
+ }
462
+ function isFormData(value) {
463
+ return typeof FormData !== "undefined" && value instanceof FormData;
464
+ }
465
+
466
+ class ResponseError2 extends Error {
467
+ response;
468
+ name = "ResponseError";
469
+ constructor(response, msg) {
470
+ super(msg);
471
+ this.response = response;
472
+ }
473
+ }
474
+
475
+ class FetchError extends Error {
476
+ cause;
477
+ name = "FetchError";
478
+ constructor(cause, msg) {
479
+ super(msg);
480
+ this.cause = cause;
481
+ }
482
+ }
483
+
484
+ class RequiredError extends Error {
485
+ field;
486
+ name = "RequiredError";
487
+ constructor(field, msg) {
488
+ super(msg);
489
+ this.field = field;
490
+ }
491
+ }
492
+ function querystring(params, prefix = "") {
493
+ return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
494
+ }
495
+ function querystringSingleKey(key, value, keyPrefix = "") {
496
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
497
+ if (value instanceof Array) {
498
+ const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
499
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
500
+ }
501
+ if (value instanceof Set) {
502
+ const valueAsArray = Array.from(value);
503
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
504
+ }
505
+ if (value instanceof Date) {
506
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
507
+ }
508
+ if (value instanceof Object) {
509
+ return querystring(value, fullKey);
510
+ }
511
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
512
+ }
513
+ function canConsumeForm(consumes) {
514
+ for (const consume of consumes) {
515
+ if (consume.contentType === "multipart/form-data") {
516
+ return true;
517
+ }
518
+ }
519
+ return false;
520
+ }
521
+
522
+ class JSONApiResponse {
523
+ raw;
524
+ transformer;
525
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
526
+ this.raw = raw;
527
+ this.transformer = transformer;
528
+ }
529
+ async value() {
530
+ return this.transformer(await this.raw.json());
531
+ }
532
+ }
533
+ // ../studioweb-sdk/generated/src/models/AccessStatus.ts
534
+ function AccessStatusFromJSON(json) {
535
+ return AccessStatusFromJSONTyped(json, false);
536
+ }
537
+ function AccessStatusFromJSONTyped(json, ignoreDiscriminator) {
538
+ return json;
539
+ }
540
+ // ../studioweb-sdk/generated/src/models/PinnedProject.ts
541
+ function PinnedProjectFromJSON(json) {
542
+ return PinnedProjectFromJSONTyped(json, false);
543
+ }
544
+ function PinnedProjectFromJSONTyped(json, ignoreDiscriminator) {
545
+ if (json == null) {
546
+ return json;
547
+ }
548
+ return {
549
+ id: json["id"] == null ? undefined : json["id"],
550
+ projectDbModelId: json["projectDbModelId"] == null ? undefined : json["projectDbModelId"],
551
+ userId: json["userId"] == null ? undefined : json["userId"],
552
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"]),
553
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"])
554
+ };
555
+ }
556
+
557
+ // ../studioweb-sdk/generated/src/models/ProjectStructure.ts
558
+ function ProjectStructureFromJSON(json) {
559
+ return ProjectStructureFromJSONTyped(json, false);
560
+ }
561
+ function ProjectStructureFromJSONTyped(json, ignoreDiscriminator) {
562
+ return json;
563
+ }
564
+
565
+ // ../studioweb-sdk/generated/src/models/ProjectAppliedProfileModel.ts
566
+ function ProjectAppliedProfileModelFromJSON(json) {
567
+ return ProjectAppliedProfileModelFromJSONTyped(json, false);
568
+ }
569
+ function ProjectAppliedProfileModelFromJSONTyped(json, ignoreDiscriminator) {
570
+ if (json == null) {
571
+ return json;
572
+ }
573
+ return {
574
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
575
+ workflowId: json["workflowId"] == null ? undefined : json["workflowId"],
576
+ userProfileId: json["userProfileId"] == null ? undefined : json["userProfileId"],
577
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"]),
578
+ profile: json["profile"] == null ? undefined : UserBindingProfileModelFromJSON(json["profile"])
579
+ };
580
+ }
581
+
582
+ // ../studioweb-sdk/generated/src/models/PropertyBindingModel.ts
583
+ function PropertyBindingModelFromJSON(json) {
584
+ return PropertyBindingModelFromJSONTyped(json, false);
585
+ }
586
+ function PropertyBindingModelFromJSONTyped(json, ignoreDiscriminator) {
587
+ if (json == null) {
588
+ return json;
589
+ }
590
+ return {
591
+ id: json["id"] == null ? undefined : json["id"],
592
+ profileId: json["profileId"] == null ? undefined : json["profileId"],
593
+ workflowId: json["workflowId"] == null ? undefined : json["workflowId"],
594
+ activityIdRef: json["activityIdRef"] == null ? undefined : json["activityIdRef"],
595
+ propertyName: json["propertyName"] == null ? undefined : json["propertyName"],
596
+ contractName: json["contractName"] == null ? undefined : json["contractName"],
597
+ resourceKey: json["resourceKey"] == null ? undefined : json["resourceKey"],
598
+ propertyValue: json["propertyValue"] == null ? undefined : json["propertyValue"],
599
+ profile: json["profile"] == null ? undefined : UserBindingProfileModelFromJSON(json["profile"])
600
+ };
601
+ }
602
+
603
+ // ../studioweb-sdk/generated/src/models/UserBindingProfileModel.ts
604
+ function UserBindingProfileModelFromJSON(json) {
605
+ return UserBindingProfileModelFromJSONTyped3(json, false);
606
+ }
607
+ function UserBindingProfileModelFromJSONTyped3(json, ignoreDiscriminator) {
608
+ if (json == null) {
609
+ return json;
610
+ }
611
+ return {
612
+ id: json["id"] == null ? undefined : json["id"],
613
+ userId: json["userId"] == null ? undefined : json["userId"],
614
+ tenantId: json["tenantId"] == null ? undefined : json["tenantId"],
615
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
616
+ workflowId: json["workflowId"] == null ? undefined : json["workflowId"],
617
+ bindingsJson: json["bindingsJson"] == null ? undefined : json["bindingsJson"],
618
+ userPropertyBindings: json["userPropertyBindings"] == null ? undefined : json["userPropertyBindings"].map(PropertyBindingModelFromJSON),
619
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"]),
620
+ appliedTo: json["appliedTo"] == null ? undefined : ProjectAppliedProfileModelFromJSON(json["appliedTo"])
621
+ };
622
+ }
623
+
624
+ // ../studioweb-sdk/generated/src/models/ProjectAppModel.ts
625
+ function ProjectAppModelFromJSON(json) {
626
+ return ProjectAppModelFromJSONTyped(json, false);
627
+ }
628
+ function ProjectAppModelFromJSONTyped(json, ignoreDiscriminator) {
629
+ if (json == null) {
630
+ return json;
631
+ }
632
+ return {
633
+ id: json["id"] == null ? undefined : json["id"],
634
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
635
+ appId: json["appId"] == null ? undefined : json["appId"],
636
+ isFileSystemEnabled: json["isFileSystemEnabled"] == null ? undefined : json["isFileSystemEnabled"],
637
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"])
638
+ };
639
+ }
640
+
641
+ // ../studioweb-sdk/generated/src/models/ProjectLockModel.ts
642
+ function ProjectLockModelFromJSON(json) {
643
+ return ProjectLockModelFromJSONTyped(json, false);
644
+ }
645
+ function ProjectLockModelFromJSONTyped(json, ignoreDiscriminator) {
646
+ if (json == null) {
647
+ return json;
648
+ }
649
+ return {
650
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
651
+ key: json["key"] == null ? undefined : json["key"],
652
+ userId: json["userId"] == null ? undefined : json["userId"],
653
+ expirationDate: json["expirationDate"] == null ? undefined : new Date(json["expirationDate"]),
654
+ rowVersion: json["rowVersion"] == null ? undefined : json["rowVersion"],
655
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"]),
656
+ solutionId: json["solutionId"] == null ? undefined : json["solutionId"]
657
+ };
658
+ }
659
+
660
+ // ../studioweb-sdk/generated/src/models/TestManagerMetadataModel.ts
661
+ function TestManagerMetadataModelFromJSON(json) {
662
+ return TestManagerMetadataModelFromJSONTyped(json, false);
663
+ }
664
+ function TestManagerMetadataModelFromJSONTyped(json, ignoreDiscriminator) {
665
+ if (json == null) {
666
+ return json;
667
+ }
668
+ return {
669
+ id: json["id"] == null ? undefined : json["id"],
670
+ studioWebProjectId: json["studioWebProjectId"] == null ? undefined : json["studioWebProjectId"],
671
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"]),
672
+ testManagerProjectId: json["testManagerProjectId"] == null ? undefined : json["testManagerProjectId"],
673
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"])
674
+ };
675
+ }
676
+
677
+ // ../studioweb-sdk/generated/src/models/TargetFramework.ts
678
+ function TargetFrameworkFromJSON(json) {
679
+ return TargetFrameworkFromJSONTyped(json, false);
680
+ }
681
+ function TargetFrameworkFromJSONTyped(json, ignoreDiscriminator) {
682
+ return json;
683
+ }
684
+
685
+ // ../studioweb-sdk/generated/src/models/ProjectStatus.ts
686
+ function ProjectStatusFromJSON(json) {
687
+ return ProjectStatusFromJSONTyped(json, false);
688
+ }
689
+ function ProjectStatusFromJSONTyped(json, ignoreDiscriminator) {
690
+ return json;
691
+ }
692
+
693
+ // ../studioweb-sdk/generated/src/models/SharingPermissions.ts
694
+ function SharingPermissionsFromJSON(json) {
695
+ return SharingPermissionsFromJSONTyped(json, false);
696
+ }
697
+ function SharingPermissionsFromJSONTyped(json, ignoreDiscriminator) {
698
+ return json;
699
+ }
700
+
701
+ // ../studioweb-sdk/generated/src/models/SharedProject.ts
702
+ function SharedProjectFromJSON(json) {
703
+ return SharedProjectFromJSONTyped(json, false);
704
+ }
705
+ function SharedProjectFromJSONTyped(json, ignoreDiscriminator) {
706
+ if (json == null) {
707
+ return json;
708
+ }
709
+ return {
710
+ id: json["id"] == null ? undefined : json["id"],
711
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
712
+ entityId: json["entityId"] == null ? undefined : json["entityId"],
713
+ organizationId: json["organizationId"] == null ? undefined : json["organizationId"],
714
+ isHidden: json["isHidden"] == null ? undefined : json["isHidden"],
715
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"]),
716
+ isGroup: json["isGroup"] == null ? undefined : json["isGroup"],
717
+ permissions: json["permissions"] == null ? undefined : SharingPermissionsFromJSON(json["permissions"]),
718
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"])
719
+ };
720
+ }
721
+
722
+ // ../studioweb-sdk/generated/src/models/UserMessageDbModel.ts
723
+ function UserMessageDbModelFromJSON(json) {
724
+ return UserMessageDbModelFromJSONTyped(json, false);
725
+ }
726
+ function UserMessageDbModelFromJSONTyped(json, ignoreDiscriminator) {
727
+ if (json == null) {
728
+ return json;
729
+ }
730
+ return {
731
+ id: json["id"] == null ? undefined : json["id"],
732
+ message: json["message"] == null ? undefined : json["message"],
733
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"]),
734
+ projectDbModelId: json["projectDbModelId"] == null ? undefined : json["projectDbModelId"],
735
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"])
736
+ };
737
+ }
738
+
739
+ // ../studioweb-sdk/generated/src/models/ProjectConnectionModel.ts
740
+ function ProjectConnectionModelFromJSON(json) {
741
+ return ProjectConnectionModelFromJSONTyped(json, false);
742
+ }
743
+ function ProjectConnectionModelFromJSONTyped(json, ignoreDiscriminator) {
744
+ if (json == null) {
745
+ return json;
746
+ }
747
+ return {
748
+ connectionId: json["connectionId"] == null ? undefined : json["connectionId"],
749
+ connector: json["connector"] == null ? undefined : json["connector"],
750
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
751
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"]),
752
+ usedInWorkflow: json["usedInWorkflow"] == null ? undefined : json["usedInWorkflow"],
753
+ usedInTrigger: json["usedInTrigger"] == null ? undefined : json["usedInTrigger"],
754
+ workflowFileId: json["workflowFileId"] == null ? undefined : json["workflowFileId"]
755
+ };
756
+ }
757
+
758
+ // ../studioweb-sdk/generated/src/models/TriggerMetadataModel.ts
759
+ function TriggerMetadataModelFromJSON(json) {
760
+ return TriggerMetadataModelFromJSONTyped(json, false);
761
+ }
762
+ function TriggerMetadataModelFromJSONTyped(json, ignoreDiscriminator) {
763
+ if (json == null) {
764
+ return json;
765
+ }
766
+ return {
767
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
768
+ connectionId: json["connectionId"] == null ? undefined : json["connectionId"],
769
+ connection: json["connection"] == null ? undefined : ConnectionMetadataModelFromJSON(json["connection"]),
770
+ projectConnection: json["projectConnection"] == null ? undefined : ProjectConnectionModelFromJSON(json["projectConnection"]),
771
+ operation: json["operation"] == null ? undefined : json["operation"],
772
+ triggerId: json["triggerId"] == null ? undefined : json["triggerId"],
773
+ defaultDisplayName: json["defaultDisplayName"] == null ? undefined : json["defaultDisplayName"],
774
+ displayName: json["displayName"] == null ? undefined : json["displayName"],
775
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"])
776
+ };
777
+ }
778
+
779
+ // ../studioweb-sdk/generated/src/models/ConnectionMetadataModel.ts
780
+ function ConnectionMetadataModelFromJSON(json) {
781
+ return ConnectionMetadataModelFromJSONTyped2(json, false);
782
+ }
783
+ function ConnectionMetadataModelFromJSONTyped2(json, ignoreDiscriminator) {
784
+ if (json == null) {
785
+ return json;
786
+ }
787
+ return {
788
+ connectionId: json["connectionId"] == null ? undefined : json["connectionId"],
789
+ connector: json["connector"] == null ? undefined : json["connector"],
790
+ projects: json["projects"] == null ? undefined : json["projects"].map(ProjectDbModelFromJSON),
791
+ triggers: json["triggers"] == null ? undefined : json["triggers"].map(TriggerMetadataModelFromJSON)
792
+ };
793
+ }
794
+
795
+ // ../studioweb-sdk/generated/src/models/ProjectMetadataModel.ts
796
+ function ProjectMetadataModelFromJSON(json) {
797
+ return ProjectMetadataModelFromJSONTyped(json, false);
798
+ }
799
+ function ProjectMetadataModelFromJSONTyped(json, ignoreDiscriminator) {
800
+ if (json == null) {
801
+ return json;
802
+ }
803
+ return {
804
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
805
+ hasTestCases: json["hasTestCases"] == null ? undefined : json["hasTestCases"],
806
+ mcIgnorableApplied: json["mcIgnorableApplied"] == null ? undefined : new Date(json["mcIgnorableApplied"]),
807
+ lastScanDate: json["lastScanDate"] == null ? undefined : new Date(json["lastScanDate"]),
808
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"])
809
+ };
810
+ }
811
+
812
+ // ../studioweb-sdk/generated/src/models/PublishStatus.ts
813
+ function PublishStatusFromJSON(json) {
814
+ return PublishStatusFromJSONTyped(json, false);
815
+ }
816
+ function PublishStatusFromJSONTyped(json, ignoreDiscriminator) {
817
+ return json;
818
+ }
819
+
820
+ // ../studioweb-sdk/generated/src/models/PublishResultModel.ts
821
+ function PublishResultModelFromJSON(json) {
822
+ return PublishResultModelFromJSONTyped(json, false);
823
+ }
824
+ function PublishResultModelFromJSONTyped(json, ignoreDiscriminator) {
825
+ if (json == null) {
826
+ return json;
827
+ }
828
+ return {
829
+ id: json["id"] == null ? undefined : json["id"],
830
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
831
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"]),
832
+ status: json["status"] == null ? undefined : PublishStatusFromJSON(json["status"]),
833
+ message: json["message"] == null ? undefined : json["message"],
834
+ tenantId: json["tenantId"] == null ? undefined : json["tenantId"],
835
+ feedId: json["feedId"] == null ? undefined : json["feedId"],
836
+ version: json["version"] == null ? undefined : json["version"],
837
+ userId: json["userId"] == null ? undefined : json["userId"],
838
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"]),
839
+ iconUrl: json["iconUrl"] == null ? undefined : json["iconUrl"]
840
+ };
841
+ }
842
+
843
+ // ../studioweb-sdk/generated/src/models/SapContext.ts
844
+ function SapContextFromJSON(json) {
845
+ return SapContextFromJSONTyped(json, false);
846
+ }
847
+ function SapContextFromJSONTyped(json, ignoreDiscriminator) {
848
+ if (json == null) {
849
+ return json;
850
+ }
851
+ return {
852
+ id: json["id"] == null ? undefined : json["id"],
853
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
854
+ tenantId: json["tenantId"] == null ? undefined : json["tenantId"],
855
+ isPrimaryProject: json["isPrimaryProject"] == null ? undefined : json["isPrimaryProject"],
856
+ externalProjectId: json["externalProjectId"] == null ? undefined : json["externalProjectId"],
857
+ baseCallbackPath: json["baseCallbackPath"] == null ? undefined : json["baseCallbackPath"],
858
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"])
859
+ };
860
+ }
861
+
862
+ // ../studioweb-sdk/generated/src/models/ProjectPackageModel.ts
863
+ function ProjectPackageModelFromJSON(json) {
864
+ return ProjectPackageModelFromJSONTyped(json, false);
865
+ }
866
+ function ProjectPackageModelFromJSONTyped(json, ignoreDiscriminator) {
867
+ if (json == null) {
868
+ return json;
869
+ }
870
+ return {
871
+ id: json["id"] == null ? undefined : json["id"],
872
+ name: json["name"] == null ? undefined : json["name"],
873
+ version: json["version"] == null ? undefined : json["version"],
874
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"])
875
+ };
876
+ }
877
+
878
+ // ../studioweb-sdk/generated/src/models/ProjectDbModel.ts
879
+ function ProjectDbModelFromJSON(json) {
880
+ return ProjectDbModelFromJSONTyped16(json, false);
881
+ }
882
+ function ProjectDbModelFromJSONTyped16(json, ignoreDiscriminator) {
883
+ if (json == null) {
884
+ return json;
885
+ }
886
+ return {
887
+ id: json["id"] == null ? undefined : json["id"],
888
+ designId: json["designId"] == null ? undefined : json["designId"],
889
+ previousProjectId: json["previousProjectId"] == null ? undefined : json["previousProjectId"],
890
+ userId: json["userId"] == null ? undefined : json["userId"],
891
+ organisationId: json["organisationId"] == null ? undefined : json["organisationId"],
892
+ name: json["name"] == null ? undefined : json["name"],
893
+ solutionId: json["solutionId"] == null ? undefined : json["solutionId"],
894
+ deletionDate: json["deletionDate"] == null ? undefined : new Date(json["deletionDate"]),
895
+ status: json["status"] == null ? undefined : ProjectStatusFromJSON(json["status"]),
896
+ fakeProjectTemplateEdit: json["fakeProjectTemplateEdit"] == null ? undefined : json["fakeProjectTemplateEdit"],
897
+ isHidden: json["isHidden"] == null ? undefined : json["isHidden"],
898
+ targetFramework: json["targetFramework"] == null ? undefined : TargetFrameworkFromJSON(json["targetFramework"]),
899
+ projectType: json["projectType"] == null ? undefined : json["projectType"],
900
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"]),
901
+ lastModifiedTime: json["lastModifiedTime"] == null ? undefined : new Date(json["lastModifiedTime"]),
902
+ expressionLanguage: json["expressionLanguage"] == null ? undefined : json["expressionLanguage"],
903
+ nameLower: json["nameLower"] == null ? undefined : json["nameLower"],
904
+ description: json["description"] == null ? undefined : json["description"],
905
+ descriptionLower: json["descriptionLower"] == null ? undefined : json["descriptionLower"],
906
+ jitVersion: json["jitVersion"] == null ? undefined : json["jitVersion"],
907
+ dependencies: json["dependencies"] == null ? undefined : json["dependencies"].map(ProjectPackageModelFromJSON),
908
+ pinDate: json["pinDate"] == null ? undefined : new Date(json["pinDate"]),
909
+ lock: json["lock"] == null ? undefined : ProjectLockModelFromJSON(json["lock"]),
910
+ hasTrigger: json["hasTrigger"] == null ? undefined : json["hasTrigger"],
911
+ tenantId: json["tenantId"] == null ? undefined : json["tenantId"],
912
+ sapContext: json["sapContext"] == null ? undefined : SapContextFromJSON(json["sapContext"]),
913
+ rowVersion: json["rowVersion"] == null ? undefined : json["rowVersion"],
914
+ disableAutoUpdateUntilDate: json["disableAutoUpdateUntilDate"] == null ? undefined : new Date(json["disableAutoUpdateUntilDate"]),
915
+ structure: json["structure"] == null ? undefined : ProjectStructureFromJSON(json["structure"]),
916
+ userMessage: json["userMessage"] == null ? undefined : UserMessageDbModelFromJSON(json["userMessage"]),
917
+ triggerType: json["triggerType"] == null ? undefined : json["triggerType"],
918
+ trigger: json["trigger"] == null ? undefined : TriggerMetadataModelFromJSON(json["trigger"]),
919
+ connections: json["connections"] == null ? undefined : json["connections"].map(ConnectionMetadataModelFromJSON),
920
+ pins: json["pins"] == null ? undefined : json["pins"].map(PinnedProjectFromJSON),
921
+ bindingProfiles: json["bindingProfiles"] == null ? undefined : json["bindingProfiles"].map(UserBindingProfileModelFromJSON),
922
+ lastAppliedProfileId: json["lastAppliedProfileId"] == null ? undefined : json["lastAppliedProfileId"],
923
+ lastAppliedProfile: json["lastAppliedProfile"] == null ? undefined : UserBindingProfileModelFromJSON(json["lastAppliedProfile"]),
924
+ hasDefaultName: json["hasDefaultName"] == null ? undefined : json["hasDefaultName"],
925
+ projectAppliedProfiles: json["projectAppliedProfiles"] == null ? undefined : json["projectAppliedProfiles"].map(ProjectAppliedProfileModelFromJSON),
926
+ projectConnections: json["projectConnections"] == null ? undefined : json["projectConnections"].map(ProjectConnectionModelFromJSON),
927
+ additionalBindingProperties: json["additionalBindingProperties"] == null ? undefined : json["additionalBindingProperties"].map(AdditionalBindingPropertiesFromJSON),
928
+ publishHistory: json["publishHistory"] == null ? undefined : json["publishHistory"].map(PublishResultModelFromJSON),
929
+ projectAppMetadata: json["projectAppMetadata"] == null ? undefined : ProjectAppModelFromJSON(json["projectAppMetadata"]),
930
+ testManagerMetadata: json["testManagerMetadata"] == null ? undefined : TestManagerMetadataModelFromJSON(json["testManagerMetadata"]),
931
+ shares: json["shares"] == null ? undefined : json["shares"].map(SharedProjectFromJSON),
932
+ metadata: json["metadata"] == null ? undefined : ProjectMetadataModelFromJSON(json["metadata"]),
933
+ isPreview: json["isPreview"] == null ? undefined : json["isPreview"],
934
+ errorList: json["errorList"] == null ? undefined : json["errorList"],
935
+ requirePreprocessing: json["requirePreprocessing"] == null ? undefined : json["requirePreprocessing"],
936
+ relativePath: json["relativePath"] == null ? undefined : json["relativePath"]
937
+ };
938
+ }
939
+
940
+ // ../studioweb-sdk/generated/src/models/AdditionalBindingProperties.ts
941
+ function AdditionalBindingPropertiesFromJSON(json) {
942
+ return AdditionalBindingPropertiesFromJSONTyped2(json, false);
943
+ }
944
+ function AdditionalBindingPropertiesFromJSONTyped2(json, ignoreDiscriminator) {
945
+ if (json == null) {
946
+ return json;
947
+ }
948
+ return {
949
+ projectId: json["projectId"] == null ? undefined : json["projectId"],
950
+ project: json["project"] == null ? undefined : ProjectDbModelFromJSON(json["project"]),
951
+ workflowFileId: json["workflowFileId"] == null ? undefined : json["workflowFileId"],
952
+ resourceType: json["resourceType"] == null ? undefined : json["resourceType"],
953
+ resourceKey: json["resourceKey"] == null ? undefined : json["resourceKey"],
954
+ purpose: json["purpose"] == null ? undefined : json["purpose"]
955
+ };
956
+ }
957
+ // ../studioweb-sdk/generated/src/models/AdditionalBindingPropertiesDto.ts
958
+ function AdditionalBindingPropertiesDtoFromJSON(json) {
959
+ return AdditionalBindingPropertiesDtoFromJSONTyped(json, false);
960
+ }
961
+ function AdditionalBindingPropertiesDtoFromJSONTyped(json, ignoreDiscriminator) {
962
+ if (json == null) {
963
+ return json;
964
+ }
965
+ return {
966
+ resourceType: json["resourceType"] == null ? undefined : json["resourceType"],
967
+ resourceKey: json["resourceKey"] == null ? undefined : json["resourceKey"],
968
+ purpose: json["purpose"] == null ? undefined : json["purpose"],
969
+ workflowFileId: json["workflowFileId"] == null ? undefined : json["workflowFileId"]
970
+ };
971
+ }
972
+ // ../studioweb-sdk/generated/src/models/AppUsageType.ts
973
+ function AppUsageTypeFromJSON(json) {
974
+ return AppUsageTypeFromJSONTyped(json, false);
975
+ }
976
+ function AppUsageTypeFromJSONTyped(json, ignoreDiscriminator) {
977
+ return json;
978
+ }
979
+ // ../studioweb-sdk/generated/src/models/FileType.ts
980
+ function FileTypeFromJSON(json) {
981
+ return FileTypeFromJSONTyped(json, false);
982
+ }
983
+ function FileTypeFromJSONTyped(json, ignoreDiscriminator) {
984
+ return json;
985
+ }
986
+
987
+ // ../studioweb-sdk/generated/src/models/FileDto.ts
988
+ function FileDtoFromJSON(json) {
989
+ return FileDtoFromJSONTyped(json, false);
990
+ }
991
+ function FileDtoFromJSONTyped(json, ignoreDiscriminator) {
992
+ if (json == null) {
993
+ return json;
994
+ }
995
+ return {
996
+ id: json["id"] == null ? undefined : json["id"],
997
+ name: json["name"] == null ? undefined : json["name"],
998
+ isMain: json["isMain"] == null ? undefined : json["isMain"],
999
+ fileType: json["fileType"] == null ? undefined : FileTypeFromJSON(json["fileType"]),
1000
+ isEntryPoint: json["isEntryPoint"] == null ? undefined : json["isEntryPoint"],
1001
+ ignoredFromPublish: json["ignoredFromPublish"] == null ? undefined : json["ignoredFromPublish"],
1002
+ appFormId: json["appFormId"] == null ? undefined : json["appFormId"],
1003
+ externalAutomationId: json["externalAutomationId"] == null ? undefined : json["externalAutomationId"],
1004
+ testCaseId: json["testCaseId"] == null ? undefined : json["testCaseId"],
1005
+ contentSignature: json["contentSignature"] == null ? undefined : json["contentSignature"]
1006
+ };
1007
+ }
1008
+ // ../studioweb-sdk/generated/src/models/SpecialFolderType.ts
1009
+ function SpecialFolderTypeFromJSON(json) {
1010
+ return SpecialFolderTypeFromJSONTyped(json, false);
1011
+ }
1012
+ function SpecialFolderTypeFromJSONTyped(json, ignoreDiscriminator) {
1013
+ return json;
1014
+ }
1015
+
1016
+ // ../studioweb-sdk/generated/src/models/FolderDto.ts
1017
+ function FolderDtoFromJSON(json) {
1018
+ return FolderDtoFromJSONTyped(json, false);
1019
+ }
1020
+ function FolderDtoFromJSONTyped(json, ignoreDiscriminator) {
1021
+ if (json == null) {
1022
+ return json;
1023
+ }
1024
+ return {
1025
+ id: json["id"] == null ? undefined : json["id"],
1026
+ name: json["name"] == null ? undefined : json["name"],
1027
+ folders: json["folders"] == null ? undefined : json["folders"].map(FolderDtoFromJSON),
1028
+ files: json["files"] == null ? undefined : json["files"].map(FileDtoFromJSON),
1029
+ folderType: json["folderType"] == null ? undefined : SpecialFolderTypeFromJSON(json["folderType"])
1030
+ };
1031
+ }
1032
+ // ../studioweb-sdk/generated/src/models/MetadataConnectionDto.ts
1033
+ function MetadataConnectionDtoFromJSON(json) {
1034
+ return MetadataConnectionDtoFromJSONTyped(json, false);
1035
+ }
1036
+ function MetadataConnectionDtoFromJSONTyped(json, ignoreDiscriminator) {
1037
+ if (json == null) {
1038
+ return json;
1039
+ }
1040
+ return {
1041
+ connectionId: json["connectionId"] == null ? undefined : json["connectionId"],
1042
+ connector: json["connector"] == null ? undefined : json["connector"],
1043
+ purpose: json["purpose"] == null ? undefined : json["purpose"],
1044
+ workflowFileId: json["workflowFileId"] == null ? undefined : json["workflowFileId"]
1045
+ };
1046
+ }
1047
+ // ../studioweb-sdk/generated/src/models/MetadataTriggerDto.ts
1048
+ function MetadataTriggerDtoFromJSON(json) {
1049
+ return MetadataTriggerDtoFromJSONTyped(json, false);
1050
+ }
1051
+ function MetadataTriggerDtoFromJSONTyped(json, ignoreDiscriminator) {
1052
+ if (json == null) {
1053
+ return json;
1054
+ }
1055
+ return {
1056
+ connection: json["connection"] == null ? undefined : MetadataConnectionDtoFromJSON(json["connection"]),
1057
+ operation: json["operation"] == null ? undefined : json["operation"],
1058
+ triggerId: json["triggerId"] == null ? undefined : json["triggerId"],
1059
+ defaultDisplayName: json["defaultDisplayName"] == null ? undefined : json["defaultDisplayName"],
1060
+ displayName: json["displayName"] == null ? undefined : json["displayName"]
1061
+ };
1062
+ }
1063
+ // ../studioweb-sdk/generated/src/models/PackageDto.ts
1064
+ function PackageDtoFromJSON(json) {
1065
+ return PackageDtoFromJSONTyped(json, false);
1066
+ }
1067
+ function PackageDtoFromJSONTyped(json, ignoreDiscriminator) {
1068
+ if (json == null) {
1069
+ return json;
1070
+ }
1071
+ return {
1072
+ name: json["name"],
1073
+ version: json["version"],
1074
+ isRestricted: json["isRestricted"] == null ? undefined : json["isRestricted"]
1075
+ };
1076
+ }
1077
+ // ../studioweb-sdk/generated/src/models/TestManagerMetadataDto.ts
1078
+ function TestManagerMetadataDtoFromJSON(json) {
1079
+ return TestManagerMetadataDtoFromJSONTyped(json, false);
1080
+ }
1081
+ function TestManagerMetadataDtoFromJSONTyped(json, ignoreDiscriminator) {
1082
+ if (json == null) {
1083
+ return json;
1084
+ }
1085
+ return {
1086
+ testManagerProjectId: json["testManagerProjectId"] == null ? undefined : json["testManagerProjectId"],
1087
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"])
1088
+ };
1089
+ }
1090
+
1091
+ // ../studioweb-sdk/generated/src/models/TargetPlatform.ts
1092
+ function TargetPlatformFromJSON(json) {
1093
+ return TargetPlatformFromJSONTyped(json, false);
1094
+ }
1095
+ function TargetPlatformFromJSONTyped(json, ignoreDiscriminator) {
1096
+ return json;
1097
+ }
1098
+
1099
+ // ../studioweb-sdk/generated/src/models/ProjectErrorCode.ts
1100
+ function ProjectErrorCodeFromJSON(json) {
1101
+ return ProjectErrorCodeFromJSONTyped(json, false);
1102
+ }
1103
+ function ProjectErrorCodeFromJSONTyped(json, ignoreDiscriminator) {
1104
+ return json;
1105
+ }
1106
+
1107
+ // ../studioweb-sdk/generated/src/models/ProjectErrorInformation.ts
1108
+ function ProjectErrorInformationFromJSON(json) {
1109
+ return ProjectErrorInformationFromJSONTyped(json, false);
1110
+ }
1111
+ function ProjectErrorInformationFromJSONTyped(json, ignoreDiscriminator) {
1112
+ if (json == null) {
1113
+ return json;
1114
+ }
1115
+ return {
1116
+ errorCode: json["errorCode"] == null ? undefined : ProjectErrorCodeFromJSON(json["errorCode"]),
1117
+ metadata: json["metadata"] == null ? undefined : json["metadata"],
1118
+ errorMessage: json["errorMessage"] == null ? undefined : json["errorMessage"],
1119
+ locationId: json["locationId"] == null ? undefined : json["locationId"],
1120
+ isSpecialLocation: json["isSpecialLocation"] == null ? undefined : json["isSpecialLocation"]
1121
+ };
1122
+ }
1123
+
1124
+ // ../studioweb-sdk/generated/src/models/SapContextDto.ts
1125
+ function SapContextDtoFromJSON(json) {
1126
+ return SapContextDtoFromJSONTyped(json, false);
1127
+ }
1128
+ function SapContextDtoFromJSONTyped(json, ignoreDiscriminator) {
1129
+ if (json == null) {
1130
+ return json;
1131
+ }
1132
+ return {
1133
+ tenantId: json["tenantId"] == null ? undefined : json["tenantId"],
1134
+ isPrimaryProject: json["isPrimaryProject"] == null ? undefined : json["isPrimaryProject"],
1135
+ externalProjectId: json["externalProjectId"] == null ? undefined : json["externalProjectId"]
1136
+ };
1137
+ }
1138
+
1139
+ // ../studioweb-sdk/generated/src/models/PreviewProjectDto.ts
1140
+ function PreviewProjectDtoFromJSON(json) {
1141
+ return PreviewProjectDtoFromJSONTyped(json, false);
1142
+ }
1143
+ function PreviewProjectDtoFromJSONTyped(json, ignoreDiscriminator) {
1144
+ if (json == null) {
1145
+ return json;
1146
+ }
1147
+ return {
1148
+ id: json["id"] == null ? undefined : json["id"],
1149
+ designId: json["designId"] == null ? undefined : json["designId"],
1150
+ expressionLanguage: json["expressionLanguage"] == null ? undefined : json["expressionLanguage"],
1151
+ projectType: json["projectType"] == null ? undefined : json["projectType"],
1152
+ name: json["name"] == null ? undefined : json["name"],
1153
+ description: json["description"] == null ? undefined : json["description"],
1154
+ tenantId: json["tenantId"] == null ? undefined : json["tenantId"],
1155
+ status: json["status"] == null ? undefined : ProjectStatusFromJSON(json["status"]),
1156
+ message: json["message"] == null ? undefined : json["message"],
1157
+ lastModifiedTime: json["lastModifiedTime"] == null ? undefined : new Date(json["lastModifiedTime"]),
1158
+ pinDate: json["pinDate"] == null ? undefined : new Date(json["pinDate"]),
1159
+ triggerType: json["triggerType"] == null ? undefined : json["triggerType"],
1160
+ trigger: json["trigger"] == null ? undefined : MetadataTriggerDtoFromJSON(json["trigger"]),
1161
+ connections: json["connections"] == null ? undefined : json["connections"].map(MetadataConnectionDtoFromJSON),
1162
+ lockedBy: json["lockedBy"] == null ? undefined : json["lockedBy"],
1163
+ isSharedByMe: json["isSharedByMe"] == null ? undefined : json["isSharedByMe"],
1164
+ isSharedWithMe: json["isSharedWithMe"] == null ? undefined : json["isSharedWithMe"],
1165
+ projectAppId: json["projectAppId"] == null ? undefined : json["projectAppId"],
1166
+ isSwFileSystemEnabledForApps: json["isSwFileSystemEnabledForApps"] == null ? undefined : json["isSwFileSystemEnabledForApps"],
1167
+ ownerId: json["ownerId"] == null ? undefined : json["ownerId"],
1168
+ sapContext: json["sapContext"] == null ? undefined : SapContextDtoFromJSON(json["sapContext"]),
1169
+ hasDefaultName: json["hasDefaultName"] == null ? undefined : json["hasDefaultName"],
1170
+ errorList: json["errorList"] == null ? undefined : json["errorList"].map(ProjectErrorInformationFromJSON),
1171
+ solutionId: json["solutionId"] == null ? undefined : json["solutionId"],
1172
+ testManagerMetadata: json["testManagerMetadata"] == null ? undefined : TestManagerMetadataDtoFromJSON(json["testManagerMetadata"]),
1173
+ isPreview: json["isPreview"] == null ? undefined : json["isPreview"],
1174
+ lastPublishedVersion: json["lastPublishedVersion"] == null ? undefined : PublishResultModelFromJSON(json["lastPublishedVersion"]),
1175
+ publishedToFeeds: json["publishedToFeeds"] == null ? undefined : json["publishedToFeeds"],
1176
+ sortIndex: json["sortIndex"] == null ? undefined : json["sortIndex"],
1177
+ hasTestCases: json["hasTestCases"] == null ? undefined : json["hasTestCases"],
1178
+ isApp: json["isApp"] == null ? undefined : json["isApp"],
1179
+ targetPlatform: json["targetPlatform"] == null ? undefined : TargetPlatformFromJSON(json["targetPlatform"])
1180
+ };
1181
+ }
1182
+ // ../studioweb-sdk/generated/src/models/SolutionStatus.ts
1183
+ function SolutionStatusFromJSON(json) {
1184
+ return SolutionStatusFromJSONTyped(json, false);
1185
+ }
1186
+ function SolutionStatusFromJSONTyped(json, ignoreDiscriminator) {
1187
+ return json;
1188
+ }
1189
+
1190
+ // ../studioweb-sdk/generated/src/models/SolutionPublishStatus.ts
1191
+ function SolutionPublishStatusFromJSON(json) {
1192
+ return SolutionPublishStatusFromJSONTyped(json, false);
1193
+ }
1194
+ function SolutionPublishStatusFromJSONTyped(json, ignoreDiscriminator) {
1195
+ return json;
1196
+ }
1197
+
1198
+ // ../studioweb-sdk/generated/src/models/PreviewSolutionDto.ts
1199
+ function PreviewSolutionDtoFromJSON(json) {
1200
+ return PreviewSolutionDtoFromJSONTyped(json, false);
1201
+ }
1202
+ function PreviewSolutionDtoFromJSONTyped(json, ignoreDiscriminator) {
1203
+ if (json == null) {
1204
+ return json;
1205
+ }
1206
+ return {
1207
+ id: json["id"] == null ? undefined : json["id"],
1208
+ name: json["name"] == null ? undefined : json["name"],
1209
+ ownerId: json["ownerId"] == null ? undefined : json["ownerId"],
1210
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"]),
1211
+ lastModifiedTime: json["lastModifiedTime"] == null ? undefined : new Date(json["lastModifiedTime"]),
1212
+ pinDate: json["pinDate"] == null ? undefined : new Date(json["pinDate"]),
1213
+ projects: json["projects"] == null ? undefined : json["projects"].map(PreviewProjectDtoFromJSON),
1214
+ sortIndex: json["sortIndex"] == null ? undefined : json["sortIndex"],
1215
+ hasTestCases: json["hasTestCases"] == null ? undefined : json["hasTestCases"],
1216
+ status: json["status"] == null ? undefined : SolutionStatusFromJSON(json["status"]),
1217
+ lockedBy: json["lockedBy"] == null ? undefined : json["lockedBy"],
1218
+ isSharedByMe: json["isSharedByMe"] == null ? undefined : json["isSharedByMe"],
1219
+ isSharedWithMe: json["isSharedWithMe"] == null ? undefined : json["isSharedWithMe"],
1220
+ permissions: json["permissions"] == null ? undefined : SharingPermissionsFromJSON(json["permissions"]),
1221
+ publishStatus: json["publishStatus"] == null ? undefined : SolutionPublishStatusFromJSON(json["publishStatus"])
1222
+ };
1223
+ }
1224
+ // ../studioweb-sdk/generated/src/models/WorkflowUiState.ts
1225
+ function WorkflowUiStateFromJSON(json) {
1226
+ return WorkflowUiStateFromJSONTyped(json, false);
1227
+ }
1228
+ function WorkflowUiStateFromJSONTyped(json, ignoreDiscriminator) {
1229
+ if (json == null) {
1230
+ return json;
1231
+ }
1232
+ return {
1233
+ id: json["id"] == null ? undefined : json["id"],
1234
+ workflowId: json["workflowId"] == null ? undefined : json["workflowId"],
1235
+ json: json["json"] == null ? undefined : json["json"],
1236
+ projectId: json["projectId"] == null ? undefined : json["projectId"]
1237
+ };
1238
+ }
1239
+
1240
+ // ../studioweb-sdk/generated/src/models/ProjectDto.ts
1241
+ function ProjectDtoFromJSON(json) {
1242
+ return ProjectDtoFromJSONTyped(json, false);
1243
+ }
1244
+ function ProjectDtoFromJSONTyped(json, ignoreDiscriminator) {
1245
+ if (json == null) {
1246
+ return json;
1247
+ }
1248
+ return {
1249
+ id: json["id"] == null ? undefined : json["id"],
1250
+ designId: json["designId"] == null ? undefined : json["designId"],
1251
+ expressionLanguage: json["expressionLanguage"] == null ? undefined : json["expressionLanguage"],
1252
+ projectType: json["projectType"] == null ? undefined : json["projectType"],
1253
+ name: json["name"] == null ? undefined : json["name"],
1254
+ description: json["description"] == null ? undefined : json["description"],
1255
+ tenantId: json["tenantId"] == null ? undefined : json["tenantId"],
1256
+ status: json["status"] == null ? undefined : ProjectStatusFromJSON(json["status"]),
1257
+ message: json["message"] == null ? undefined : json["message"],
1258
+ lastModifiedTime: json["lastModifiedTime"] == null ? undefined : new Date(json["lastModifiedTime"]),
1259
+ pinDate: json["pinDate"] == null ? undefined : new Date(json["pinDate"]),
1260
+ triggerType: json["triggerType"] == null ? undefined : json["triggerType"],
1261
+ trigger: json["trigger"] == null ? undefined : MetadataTriggerDtoFromJSON(json["trigger"]),
1262
+ connections: json["connections"] == null ? undefined : json["connections"].map(MetadataConnectionDtoFromJSON),
1263
+ lockedBy: json["lockedBy"] == null ? undefined : json["lockedBy"],
1264
+ isSharedByMe: json["isSharedByMe"] == null ? undefined : json["isSharedByMe"],
1265
+ isSharedWithMe: json["isSharedWithMe"] == null ? undefined : json["isSharedWithMe"],
1266
+ projectAppId: json["projectAppId"] == null ? undefined : json["projectAppId"],
1267
+ isSwFileSystemEnabledForApps: json["isSwFileSystemEnabledForApps"] == null ? undefined : json["isSwFileSystemEnabledForApps"],
1268
+ ownerId: json["ownerId"] == null ? undefined : json["ownerId"],
1269
+ sapContext: json["sapContext"] == null ? undefined : SapContextDtoFromJSON(json["sapContext"]),
1270
+ hasDefaultName: json["hasDefaultName"] == null ? undefined : json["hasDefaultName"],
1271
+ errorList: json["errorList"] == null ? undefined : json["errorList"].map(ProjectErrorInformationFromJSON),
1272
+ solutionId: json["solutionId"] == null ? undefined : json["solutionId"],
1273
+ testManagerMetadata: json["testManagerMetadata"] == null ? undefined : TestManagerMetadataDtoFromJSON(json["testManagerMetadata"]),
1274
+ isPreview: json["isPreview"] == null ? undefined : json["isPreview"],
1275
+ lastPublishedVersion: json["lastPublishedVersion"] == null ? undefined : PublishResultModelFromJSON(json["lastPublishedVersion"]),
1276
+ publishedToFeeds: json["publishedToFeeds"] == null ? undefined : json["publishedToFeeds"],
1277
+ sortIndex: json["sortIndex"] == null ? undefined : json["sortIndex"],
1278
+ hasTestCases: json["hasTestCases"] == null ? undefined : json["hasTestCases"],
1279
+ isApp: json["isApp"] == null ? undefined : json["isApp"],
1280
+ targetPlatform: json["targetPlatform"] == null ? undefined : TargetPlatformFromJSON(json["targetPlatform"]),
1281
+ creationTime: json["creationTime"] == null ? undefined : new Date(json["creationTime"]),
1282
+ userId: json["userId"] == null ? undefined : json["userId"],
1283
+ rootFolder: json["rootFolder"] == null ? undefined : FolderDtoFromJSON(json["rootFolder"]),
1284
+ dependencies: json["dependencies"] == null ? undefined : json["dependencies"].map(PackageDtoFromJSON),
1285
+ uiStateWorkflows: json["uiStateWorkflows"] == null ? undefined : json["uiStateWorkflows"].map(WorkflowUiStateFromJSON),
1286
+ hasTrigger: json["hasTrigger"] == null ? undefined : json["hasTrigger"],
1287
+ disableAutoUpdate: json["disableAutoUpdate"] == null ? undefined : json["disableAutoUpdate"],
1288
+ userAccessStatus: json["userAccessStatus"] == null ? undefined : AccessStatusFromJSON(json["userAccessStatus"]),
1289
+ hasUnsavedEdits: json["hasUnsavedEdits"] == null ? undefined : json["hasUnsavedEdits"],
1290
+ projectJson: json["projectJson"] == null ? undefined : json["projectJson"],
1291
+ isReadOnly: json["isReadOnly"] == null ? undefined : json["isReadOnly"],
1292
+ version: json["version"] == null ? undefined : json["version"],
1293
+ additionalBindingProperties: json["additionalBindingProperties"] == null ? undefined : json["additionalBindingProperties"].map(AdditionalBindingPropertiesDtoFromJSON),
1294
+ workflowsWithErrors: json["workflowsWithErrors"] == null ? undefined : json["workflowsWithErrors"],
1295
+ requirePreprocessing: json["requirePreprocessing"] == null ? undefined : json["requirePreprocessing"],
1296
+ permissions: json["permissions"] == null ? undefined : SharingPermissionsFromJSON(json["permissions"]),
1297
+ projectSubType: json["projectSubType"] == null ? undefined : json["projectSubType"],
1298
+ appUsageType: json["appUsageType"] == null ? undefined : AppUsageTypeFromJSON(json["appUsageType"]),
1299
+ parentProjectId: json["parentProjectId"] == null ? undefined : json["parentProjectId"],
1300
+ jitVersion: json["jitVersion"] == null ? undefined : json["jitVersion"]
1301
+ };
1302
+ }
1303
+ // ../studioweb-sdk/generated/src/models/SolutionAndProjectSearchModelDto.ts
1304
+ function SolutionAndProjectSearchModelDtoFromJSON(json) {
1305
+ return SolutionAndProjectSearchModelDtoFromJSONTyped(json, false);
1306
+ }
1307
+ function SolutionAndProjectSearchModelDtoFromJSONTyped(json, ignoreDiscriminator) {
1308
+ if (json == null) {
1309
+ return json;
1310
+ }
1311
+ return {
1312
+ solutions: json["solutions"] == null ? undefined : json["solutions"].map(PreviewSolutionDtoFromJSON),
1313
+ standaloneProjects: json["standaloneProjects"] == null ? undefined : json["standaloneProjects"].map(PreviewProjectDtoFromJSON),
1314
+ totalCount: json["totalCount"] == null ? undefined : json["totalCount"]
1315
+ };
1316
+ }
1317
+ // ../studioweb-sdk/generated/src/models/SolutionDto.ts
1318
+ function SolutionDtoFromJSON(json) {
1319
+ return SolutionDtoFromJSONTyped(json, false);
1320
+ }
1321
+ function SolutionDtoFromJSONTyped(json, ignoreDiscriminator) {
1322
+ if (json == null) {
1323
+ return json;
1324
+ }
1325
+ return {
1326
+ id: json["id"] == null ? undefined : json["id"],
1327
+ name: json["name"] == null ? undefined : json["name"],
1328
+ description: json["description"] == null ? undefined : json["description"],
1329
+ userId: json["userId"] == null ? undefined : json["userId"],
1330
+ organizationId: json["organizationId"] == null ? undefined : json["organizationId"],
1331
+ status: json["status"] == null ? undefined : SolutionStatusFromJSON(json["status"]),
1332
+ projects: json["projects"] == null ? undefined : json["projects"].map(ProjectDtoFromJSON),
1333
+ isSharedWithMe: json["isSharedWithMe"] == null ? undefined : json["isSharedWithMe"],
1334
+ isSharedByMe: json["isSharedByMe"] == null ? undefined : json["isSharedByMe"],
1335
+ permissions: json["permissions"] == null ? undefined : SharingPermissionsFromJSON(json["permissions"]),
1336
+ lastModifiedTime: json["lastModifiedTime"] == null ? undefined : new Date(json["lastModifiedTime"]),
1337
+ resourcesLastModifiedTime: json["resourcesLastModifiedTime"] == null ? undefined : new Date(json["resourcesLastModifiedTime"]),
1338
+ hasDraftEdits: json["hasDraftEdits"] == null ? undefined : json["hasDraftEdits"],
1339
+ publishStatus: json["publishStatus"] == null ? undefined : SolutionPublishStatusFromJSON(json["publishStatus"]),
1340
+ lastAccessedTenantId: json["lastAccessedTenantId"] == null ? undefined : json["lastAccessedTenantId"],
1341
+ automationHubIdeaUrl: json["automationHubIdeaUrl"] == null ? undefined : json["automationHubIdeaUrl"]
1342
+ };
1343
+ }
1344
+ // ../studioweb-sdk/generated/src/apis/SolutionApi.ts
1345
+ class SolutionApi extends BaseAPI {
1346
+ async solutionGetSolutionRaw(requestParameters, initOverrides) {
1347
+ if (requestParameters["solutionId"] == null) {
1348
+ throw new RequiredError("solutionId", 'Required parameter "solutionId" was null or undefined when calling solutionGetSolution().');
1349
+ }
1350
+ const queryParameters = {};
1351
+ if (requestParameters["includeReconciliationContext"] != null) {
1352
+ queryParameters["includeReconciliationContext"] = requestParameters["includeReconciliationContext"];
1353
+ }
1354
+ if (requestParameters["apiVersion"] != null) {
1355
+ queryParameters["api-version"] = requestParameters["apiVersion"];
1356
+ }
1357
+ const headerParameters = {};
1358
+ if (this.configuration && this.configuration.accessToken) {
1359
+ const token = this.configuration.accessToken;
1360
+ const tokenString = await token("Bearer", []);
1361
+ if (tokenString) {
1362
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1363
+ }
1364
+ }
1365
+ let urlPath = `/api/Solution/{solutionId}`;
1366
+ urlPath = urlPath.replace(`{${"solutionId"}}`, encodeURIComponent(String(requestParameters["solutionId"])));
1367
+ const response = await this.request({
1368
+ path: urlPath,
1369
+ method: "GET",
1370
+ headers: headerParameters,
1371
+ query: queryParameters
1372
+ }, initOverrides);
1373
+ return new JSONApiResponse(response, (jsonValue) => SolutionDtoFromJSON(jsonValue));
1374
+ }
1375
+ async solutionGetSolution(requestParameters, initOverrides) {
1376
+ const response = await this.solutionGetSolutionRaw(requestParameters, initOverrides);
1377
+ return await response.value();
1378
+ }
1379
+ async solutionImportSolutionRaw(requestParameters, initOverrides) {
1380
+ if (requestParameters["uploadFile"] == null) {
1381
+ throw new RequiredError("uploadFile", 'Required parameter "uploadFile" was null or undefined when calling solutionImportSolution().');
1382
+ }
1383
+ const queryParameters = {};
1384
+ if (requestParameters["apiVersion"] != null) {
1385
+ queryParameters["api-version"] = requestParameters["apiVersion"];
1386
+ }
1387
+ const headerParameters = {};
1388
+ if (this.configuration && this.configuration.accessToken) {
1389
+ const token = this.configuration.accessToken;
1390
+ const tokenString = await token("Bearer", []);
1391
+ if (tokenString) {
1392
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1393
+ }
1394
+ }
1395
+ const consumes = [
1396
+ { contentType: "multipart/form-data" }
1397
+ ];
1398
+ const canConsumeForm2 = canConsumeForm(consumes);
1399
+ let formParams;
1400
+ let useForm = false;
1401
+ useForm = canConsumeForm2;
1402
+ if (useForm) {
1403
+ formParams = new FormData;
1404
+ } else {
1405
+ formParams = new URLSearchParams;
1406
+ }
1407
+ if (requestParameters["uploadFile"] != null) {
1408
+ formParams.append("uploadFile", requestParameters["uploadFile"]);
1409
+ }
1410
+ if (requestParameters["isHidden"] != null) {
1411
+ formParams.append("isHidden", requestParameters["isHidden"]);
1412
+ }
1413
+ if (requestParameters["createSnapshot"] != null) {
1414
+ formParams.append("createSnapshot", requestParameters["createSnapshot"]);
1415
+ }
1416
+ let urlPath = `/api/Solution/Import`;
1417
+ const response = await this.request({
1418
+ path: urlPath,
1419
+ method: "POST",
1420
+ headers: headerParameters,
1421
+ query: queryParameters,
1422
+ body: formParams
1423
+ }, initOverrides);
1424
+ return new JSONApiResponse(response, (jsonValue) => SolutionDtoFromJSON(jsonValue));
1425
+ }
1426
+ async solutionImportSolution(requestParameters, initOverrides) {
1427
+ const response = await this.solutionImportSolutionRaw(requestParameters, initOverrides);
1428
+ return await response.value();
1429
+ }
1430
+ async solutionOverwriteSolutionRaw(requestParameters, initOverrides) {
1431
+ if (requestParameters["solutionId"] == null) {
1432
+ throw new RequiredError("solutionId", 'Required parameter "solutionId" was null or undefined when calling solutionOverwriteSolution().');
1433
+ }
1434
+ if (requestParameters["uploadFile"] == null) {
1435
+ throw new RequiredError("uploadFile", 'Required parameter "uploadFile" was null or undefined when calling solutionOverwriteSolution().');
1436
+ }
1437
+ const queryParameters = {};
1438
+ if (requestParameters["apiVersion"] != null) {
1439
+ queryParameters["api-version"] = requestParameters["apiVersion"];
1440
+ }
1441
+ const headerParameters = {};
1442
+ if (requestParameters["xUiPathSWLockKey"] != null) {
1443
+ headerParameters["x-UiPath-SW-LockKey"] = String(requestParameters["xUiPathSWLockKey"]);
1444
+ }
1445
+ if (this.configuration && this.configuration.accessToken) {
1446
+ const token = this.configuration.accessToken;
1447
+ const tokenString = await token("Bearer", []);
1448
+ if (tokenString) {
1449
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1450
+ }
1451
+ }
1452
+ const consumes = [
1453
+ { contentType: "multipart/form-data" }
1454
+ ];
1455
+ const canConsumeForm2 = canConsumeForm(consumes);
1456
+ let formParams;
1457
+ let useForm = false;
1458
+ useForm = canConsumeForm2;
1459
+ if (useForm) {
1460
+ formParams = new FormData;
1461
+ } else {
1462
+ formParams = new URLSearchParams;
1463
+ }
1464
+ if (requestParameters["uploadFile"] != null) {
1465
+ formParams.append("uploadFile", requestParameters["uploadFile"]);
1466
+ }
1467
+ if (requestParameters["isHidden"] != null) {
1468
+ formParams.append("isHidden", requestParameters["isHidden"]);
1469
+ }
1470
+ if (requestParameters["createSnapshot"] != null) {
1471
+ formParams.append("createSnapshot", requestParameters["createSnapshot"]);
1472
+ }
1473
+ let urlPath = `/api/Solution/{solutionId}/Overwrite`;
1474
+ urlPath = urlPath.replace(`{${"solutionId"}}`, encodeURIComponent(String(requestParameters["solutionId"])));
1475
+ const response = await this.request({
1476
+ path: urlPath,
1477
+ method: "POST",
1478
+ headers: headerParameters,
1479
+ query: queryParameters,
1480
+ body: formParams
1481
+ }, initOverrides);
1482
+ return new JSONApiResponse(response, (jsonValue) => SolutionDtoFromJSON(jsonValue));
1483
+ }
1484
+ async solutionOverwriteSolution(requestParameters, initOverrides) {
1485
+ const response = await this.solutionOverwriteSolutionRaw(requestParameters, initOverrides);
1486
+ return await response.value();
1487
+ }
1488
+ async solutionSearchSolutionsAndProjectsRaw(requestParameters, initOverrides) {
1489
+ const queryParameters = {};
1490
+ if (requestParameters["triggerTypes"] != null) {
1491
+ queryParameters["triggerTypes"] = requestParameters["triggerTypes"];
1492
+ }
1493
+ if (requestParameters["owners"] != null) {
1494
+ queryParameters["owners"] = requestParameters["owners"];
1495
+ }
1496
+ if (requestParameters["isPublished"] != null) {
1497
+ queryParameters["isPublished"] = requestParameters["isPublished"];
1498
+ }
1499
+ if (requestParameters["hasTestCases"] != null) {
1500
+ queryParameters["hasTestCases"] = requestParameters["hasTestCases"];
1501
+ }
1502
+ if (requestParameters["publishStatus"] != null) {
1503
+ queryParameters["publishStatus"] = requestParameters["publishStatus"];
1504
+ }
1505
+ if (requestParameters["validIds"] != null) {
1506
+ queryParameters["validIds"] = requestParameters["validIds"];
1507
+ }
1508
+ if (requestParameters["keywords"] != null) {
1509
+ queryParameters["keywords"] = requestParameters["keywords"];
1510
+ }
1511
+ if (requestParameters["connectors"] != null) {
1512
+ queryParameters["connectors"] = requestParameters["connectors"];
1513
+ }
1514
+ if (requestParameters["pagingOptionsLimit"] != null) {
1515
+ queryParameters["pagingOptions.limit"] = requestParameters["pagingOptionsLimit"];
1516
+ }
1517
+ if (requestParameters["pagingOptionsSkip"] != null) {
1518
+ queryParameters["pagingOptions.skip"] = requestParameters["pagingOptionsSkip"];
1519
+ }
1520
+ if (requestParameters["sortBy"] != null) {
1521
+ queryParameters["sortBy"] = requestParameters["sortBy"];
1522
+ }
1523
+ if (requestParameters["sortOrder"] != null) {
1524
+ queryParameters["sortOrder"] = requestParameters["sortOrder"];
1525
+ }
1526
+ if (requestParameters["apiVersion"] != null) {
1527
+ queryParameters["api-version"] = requestParameters["apiVersion"];
1528
+ }
1529
+ const headerParameters = {};
1530
+ if (this.configuration && this.configuration.accessToken) {
1531
+ const token = this.configuration.accessToken;
1532
+ const tokenString = await token("Bearer", []);
1533
+ if (tokenString) {
1534
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1535
+ }
1536
+ }
1537
+ let urlPath = `/api/Solution/SearchSolutionsAndProjects`;
1538
+ const response = await this.request({
1539
+ path: urlPath,
1540
+ method: "GET",
1541
+ headers: headerParameters,
1542
+ query: queryParameters
1543
+ }, initOverrides);
1544
+ return new JSONApiResponse(response, (jsonValue) => SolutionAndProjectSearchModelDtoFromJSON(jsonValue));
1545
+ }
1546
+ async solutionSearchSolutionsAndProjects(requestParameters = {}, initOverrides) {
1547
+ const response = await this.solutionSearchSolutionsAndProjectsRaw(requestParameters, initOverrides);
1548
+ return await response.value();
1549
+ }
1550
+ }
1551
+ // ../studioweb-sdk/src/client.ts
1552
+ function studioWebBasePath(config, organizationName) {
1553
+ return `${config.baseUrl}/${organizationName}/studio_/backend`;
1554
+ }
1555
+ function buildStudioWebConfiguration(config, organizationName) {
1556
+ const headers = {};
1557
+ if (config.tenantId) {
1558
+ headers["x-uipath-tenantid"] = config.tenantId;
1559
+ }
1560
+ return new Configuration({
1561
+ basePath: studioWebBasePath(config, organizationName),
1562
+ accessToken: config.authToken,
1563
+ headers
1564
+ });
1565
+ }
1566
+ function createSolutionApi(config, organizationName) {
1567
+ return new SolutionApi(buildStudioWebConfiguration(config, organizationName));
1568
+ }
1569
+ // ../studioweb-sdk/src/publish-locations.ts
1570
+ class PublishLocationsRequestError extends Error {
1571
+ name = "PublishLocationsRequestError";
1572
+ status;
1573
+ constructor(status, message) {
1574
+ super(message);
1575
+ this.status = status;
1576
+ }
1577
+ }
1578
+ async function getAvailablePublishLocationsV22(config, organizationName) {
1579
+ const url = `${studioWebBasePath(config, organizationName)}/api/resourcebuilder/solutions/v2/publish-location`;
1580
+ const headers = {
1581
+ Authorization: `Bearer ${config.authToken}`
1582
+ };
1583
+ if (config.tenantId) {
1584
+ headers["x-uipath-tenantid"] = config.tenantId;
1585
+ }
1586
+ const response = await fetch(url, { method: "GET", headers });
1587
+ if (!response.ok) {
1588
+ const text = await response.text();
1589
+ throw new PublishLocationsRequestError(response.status, `Failed to fetch publish locations (${response.status}): ${text}`);
1590
+ }
1591
+ const raw = await response.json();
1592
+ if (!Array.isArray(raw)) {
1593
+ throw new Error("Unexpected publish-locations response: expected a JSON array.");
1594
+ }
1595
+ return raw.map(toPublishLocationV2);
1596
+ }
1597
+ function toPublishLocationV2(value) {
1598
+ const v = value ?? {};
1599
+ return {
1600
+ name: typeof v.name === "string" ? v.name : "",
1601
+ key: typeof v.key === "string" ? v.key : "",
1602
+ isMyPersonalWorkspace: v.isMyPersonalWorkspace === true,
1603
+ type: normalizeType(v.type)
1604
+ };
1605
+ }
1606
+ function normalizeType(type) {
1607
+ if (typeof type !== "string") {
1608
+ return "Unknown";
1609
+ }
1610
+ switch (type.toLowerCase()) {
1611
+ case "tenant":
1612
+ return "Tenant";
1613
+ case "folder":
1614
+ return "Folder";
1615
+ case "personalworkspace":
1616
+ return "PersonalWorkspace";
1617
+ default:
1618
+ return "Unknown";
1619
+ }
1620
+ }
1621
+ // ../solution-sdk/src/studio-web-compat.ts
1622
+ var API_PROJECT_TYPES = new Set(["api", "apiautomation"]);
1623
+
1624
+ class StudioWebIncompatibleProjectError2 extends Error {
1625
+ offendingProjects;
1626
+ constructor(offendingProjects) {
1627
+ super(`Studio Web cannot import API Workflow project(s) manifested by project.json: ${offendingProjects.join(", ")}. Studio Web's solution import accepts only project.uiproj-manifested projects.`);
1628
+ this.offendingProjects = offendingProjects;
1629
+ this.name = "StudioWebIncompatibleProjectError";
1630
+ }
1631
+ }
1632
+ function assertStudioWebCompatibleProjects(projects) {
1633
+ const incompatible = projects.filter((p) => typeof p.Type === "string" && API_PROJECT_TYPES.has(p.Type.toLowerCase()) && p.ProjectRelativePath.replace(/\\/g, "/").split("/").pop() === "project.json");
1634
+ if (incompatible.length > 0) {
1635
+ throw new StudioWebIncompatibleProjectError2(incompatible.map((p) => p.ProjectRelativePath));
1636
+ }
1637
+ }
1638
+
1639
+ // ../solution-sdk/src/zip-utils.ts
1640
+ var import_ignore = __toESM(require_ignore(), 1);
1641
+ var DEFAULT_EXCLUDED_DIR_NAMES = new Set([
1642
+ ".venv",
1643
+ "node_modules",
1644
+ "__pycache__",
1645
+ ".git",
1646
+ ".local",
1647
+ ".flow-sdk",
1648
+ ".flow-debug"
1649
+ ]);
1650
+ var DEFAULT_EXCLUDED_FILE_PATTERNS = [
1651
+ /^\.env($|\..+)/
1652
+ ];
1653
+ function isDefaultExcludedFileName(name) {
1654
+ for (const pattern of DEFAULT_EXCLUDED_FILE_PATTERNS) {
1655
+ if (pattern.test(name)) {
1656
+ return true;
1657
+ }
1658
+ }
1659
+ return false;
1660
+ }
1661
+ var UIPIGNORE_FILENAME = ".uipignore";
1662
+ function parseUipignore(body) {
1663
+ return body.split(/\r?\n/).filter((line) => line.trim() !== "" && !line.startsWith("#"));
1664
+ }
1665
+ function createUipignoreRules(baseDir, patterns) {
1666
+ const matcher = import_ignore.default().add([...patterns]);
1667
+ return {
1668
+ baseDir,
1669
+ patterns,
1670
+ ignores: (relativePath) => matcher.ignores(relativePath)
1671
+ };
1672
+ }
1673
+ var UNMATCHABLE_RELATIVE_PATH = /^\.+$|^\.*\//;
1674
+ function isIgnoredByRules(fs, rules, fullPath, isDirectory) {
1675
+ if (!rules) {
1676
+ return false;
1677
+ }
1678
+ for (const rule of rules) {
1679
+ const rel = fs.path.relative(rule.baseDir, fullPath).replace(/\\/g, "/");
1680
+ if (!rel || UNMATCHABLE_RELATIVE_PATH.test(rel) || fs.path.isAbsolute(rel)) {
1681
+ continue;
1682
+ }
1683
+ if (rule.ignores(isDirectory ? `${rel}/` : rel)) {
1684
+ return true;
1685
+ }
1686
+ }
1687
+ return false;
1688
+ }
1689
+ async function collectTree(fs, dir, options = {}) {
1690
+ const files = [];
1691
+ const emptyDirs = [];
1692
+ const excluded = new Set(DEFAULT_EXCLUDED_DIR_NAMES);
1693
+ if (options.additionalExcludeDirs) {
1694
+ for (const name of options.additionalExcludeDirs) {
1695
+ excluded.add(name);
1696
+ }
1697
+ }
1698
+ async function walk(current, isRoot) {
1699
+ const entries = await fs.readdir(current);
1700
+ if (entries.length === 0) {
1701
+ if (!isRoot) {
1702
+ emptyDirs.push(current);
1703
+ }
1704
+ return;
1705
+ }
1706
+ for (const entryName of entries) {
1707
+ const fullPath = fs.path.join(current, entryName);
1708
+ const entryStat = await fs.stat(fullPath);
1709
+ if (entryStat?.isDirectory()) {
1710
+ if (excluded.has(entryName) || isIgnoredByRules(fs, options.ignoreRules, fullPath, true)) {
1711
+ continue;
1712
+ }
1713
+ await walk(fullPath, false);
1714
+ } else if (entryStat?.isFile()) {
1715
+ if (isDefaultExcludedFileName(entryName) || isIgnoredByRules(fs, options.ignoreRules, fullPath, false)) {
1716
+ continue;
1717
+ }
1718
+ files.push(fullPath);
1719
+ }
1720
+ }
1721
+ }
1722
+ await walk(dir, true);
1723
+ return { files, emptyDirs };
1724
+ }
1725
+ async function createZipFromDir(fs, dir, options = {}) {
1726
+ const { files, emptyDirs } = await collectTree(fs, dir, options);
1727
+ const zippable = {};
1728
+ for (const filePath of files) {
1729
+ const relPath = fs.path.relative(dir, filePath).replace(/\\/g, "/");
1730
+ const data = await fs.readFile(filePath);
1731
+ if (data) {
1732
+ zippable[relPath] = new Uint8Array(data);
1733
+ }
1734
+ }
1735
+ for (const emptyDir of emptyDirs) {
1736
+ const relPath = fs.path.relative(dir, emptyDir).replace(/\\/g, "/");
1737
+ if (!relPath) {
1738
+ continue;
1739
+ }
1740
+ zippable[`${relPath}/`] = new Uint8Array(0);
1741
+ }
1742
+ return finalizeZip64(zipSync2(zippable, { level: 6 }));
1743
+ }
1744
+ var EOCD_SIZE = 22;
1745
+ var EOCD_SIGNATURE = 101010256;
1746
+ var CD_HEADER_SIGNATURE = 33639248;
1747
+ var ZIP64_EOCD_SIGNATURE = 101075792;
1748
+ var ZIP64_EOCD_SIZE = 56;
1749
+ var ZIP64_LOCATOR_SIGNATURE = 117853008;
1750
+ var ZIP64_LOCATOR_SIZE = 20;
1751
+ var MAX_ZIP32_ENTRIES = 65535;
1752
+ var MAX_ZIP32_OFFSET = 4294967295;
1753
+ function finalizeZip64(zip) {
1754
+ const view = new DataView(zip.buffer, zip.byteOffset, zip.byteLength);
1755
+ const eocdStart = zip.byteLength - EOCD_SIZE;
1756
+ if (eocdStart < 0 || view.getUint32(eocdStart, true) !== EOCD_SIGNATURE) {
1757
+ throw new Error("Cannot finalize the solution archive: it does not end with an end-of-central-directory record.");
1758
+ }
1759
+ const cdSize = view.getUint32(eocdStart + 12, true);
1760
+ const cdOffset = view.getUint32(eocdStart + 16, true);
1761
+ const entryCount = countCentralDirectoryEntries(view, cdOffset, cdSize);
1762
+ if (entryCount <= MAX_ZIP32_ENTRIES) {
1763
+ return zip;
1764
+ }
1765
+ if (cdOffset >= MAX_ZIP32_OFFSET || zip.byteLength >= MAX_ZIP32_OFFSET) {
1766
+ throw new Error(`The solution archive is ${zip.byteLength} bytes, past the 4 GB limit this packer supports. Exclude large directories from the solution with a .uipignore file.`);
1767
+ }
1768
+ const tail = new Uint8Array(ZIP64_EOCD_SIZE + ZIP64_LOCATOR_SIZE + EOCD_SIZE);
1769
+ const tailView = new DataView(tail.buffer);
1770
+ const count = BigInt(entryCount);
1771
+ tailView.setUint32(0, ZIP64_EOCD_SIGNATURE, true);
1772
+ tailView.setBigUint64(4, BigInt(ZIP64_EOCD_SIZE - 12), true);
1773
+ tailView.setUint16(12, 45, true);
1774
+ tailView.setUint16(14, 45, true);
1775
+ tailView.setUint32(16, 0, true);
1776
+ tailView.setUint32(20, 0, true);
1777
+ tailView.setBigUint64(24, count, true);
1778
+ tailView.setBigUint64(32, count, true);
1779
+ tailView.setBigUint64(40, BigInt(cdSize), true);
1780
+ tailView.setBigUint64(48, BigInt(cdOffset), true);
1781
+ const locator = ZIP64_EOCD_SIZE;
1782
+ tailView.setUint32(locator, ZIP64_LOCATOR_SIGNATURE, true);
1783
+ tailView.setUint32(locator + 4, 0, true);
1784
+ tailView.setBigUint64(locator + 8, BigInt(eocdStart), true);
1785
+ tailView.setUint32(locator + 16, 1, true);
1786
+ const eocd = ZIP64_EOCD_SIZE + ZIP64_LOCATOR_SIZE;
1787
+ tailView.setUint32(eocd, EOCD_SIGNATURE, true);
1788
+ tailView.setUint16(eocd + 4, 0, true);
1789
+ tailView.setUint16(eocd + 6, 0, true);
1790
+ tailView.setUint16(eocd + 8, MAX_ZIP32_ENTRIES, true);
1791
+ tailView.setUint16(eocd + 10, MAX_ZIP32_ENTRIES, true);
1792
+ tailView.setUint32(eocd + 12, cdSize, true);
1793
+ tailView.setUint32(eocd + 16, cdOffset, true);
1794
+ tailView.setUint16(eocd + 20, 0, true);
1795
+ const out = new Uint8Array(eocdStart + tail.byteLength);
1796
+ out.set(zip.subarray(0, eocdStart), 0);
1797
+ out.set(tail, eocdStart);
1798
+ return out;
1799
+ }
1800
+ function countCentralDirectoryEntries(view, cdOffset, cdSize) {
1801
+ const end = cdOffset + cdSize;
1802
+ let position = cdOffset;
1803
+ let count = 0;
1804
+ while (position + 46 <= end && view.getUint32(position, true) === CD_HEADER_SIGNATURE) {
1805
+ const nameLength = view.getUint16(position + 28, true);
1806
+ const extraLength = view.getUint16(position + 30, true);
1807
+ const commentLength = view.getUint16(position + 32, true);
1808
+ position += 46 + nameLength + extraLength + commentLength;
1809
+ count++;
1810
+ }
1811
+ return count;
1812
+ }
1813
+
1814
+ // ../solution-sdk/src/bundle-service.ts
1815
+ class UipignoreExcludesProjectError2 extends Error {
1816
+ projectManifestPath;
1817
+ constructor(projectManifestPath) {
1818
+ super(`${UIPIGNORE_FILENAME} excludes ${projectManifestPath}, which the solution references. A project listed in the .uipx cannot be left out of the bundle.`);
1819
+ this.projectManifestPath = projectManifestPath;
1820
+ this.name = "UipignoreExcludesProjectError";
1821
+ }
1822
+ }
1823
+ async function readUipignore(fs, dir) {
1824
+ const ignorePath = fs.path.join(dir, UIPIGNORE_FILENAME);
1825
+ if (!await fs.exists(ignorePath)) {
1826
+ return;
1827
+ }
1828
+ try {
1829
+ const body = await fs.readFile(ignorePath, "utf-8");
1830
+ const patterns = body ? parseUipignore(body) : [];
1831
+ if (patterns.length === 0) {
1832
+ return;
1833
+ }
1834
+ return createUipignoreRules(dir, patterns);
1835
+ } catch (err) {
1836
+ logger.warn(`Could not read ${UIPIGNORE_FILENAME}; ignoring it: ${String(err)}`);
1837
+ return;
1838
+ }
1839
+ }
1840
+ async function mergeProjectUipignore(fs, projectPath, projectLabel, solutionRules) {
1841
+ const projectRules = await readUipignore(fs, projectPath);
1842
+ if (!projectRules) {
1843
+ return solutionRules;
1844
+ }
1845
+ logger.info(`[${projectLabel}] Applying ${projectRules.patterns.length} extra exclude(s) from project ${UIPIGNORE_FILENAME}: ${projectRules.patterns.join(", ")}`);
1846
+ return [...solutionRules, projectRules];
1847
+ }
1848
+ var toForwardSlash = (p) => p.replace(/\\/g, "/");
1849
+ async function mirrorTree(fs, srcDir, relativeBase, destBaseDir, ignoreRules) {
1850
+ const { files, emptyDirs } = await collectTree(fs, srcDir, {
1851
+ ignoreRules
1852
+ });
1853
+ if (files.length === 0 && emptyDirs.length === 0) {
1854
+ const rootRel = fs.path.relative(relativeBase, srcDir);
1855
+ if (rootRel) {
1856
+ await fs.mkdir(fs.path.join(destBaseDir, rootRel));
1857
+ }
1858
+ return;
1859
+ }
1860
+ for (const f of files) {
1861
+ const relPath = fs.path.relative(relativeBase, f);
1862
+ const destPath = fs.path.join(destBaseDir, relPath);
1863
+ const data = await fs.readFile(f);
1864
+ if (data) {
1865
+ await fs.writeFile(destPath, data);
1866
+ } else {
1867
+ logger.warn(`Skipping empty or unreadable file: ${f}`);
1868
+ }
1869
+ }
1870
+ for (const dir of emptyDirs) {
1871
+ const relPath = fs.path.relative(relativeBase, dir);
1872
+ if (!relPath) {
1873
+ continue;
1874
+ }
1875
+ await fs.mkdir(fs.path.join(destBaseDir, relPath));
1876
+ }
1877
+ }
1878
+ async function flattenProjectDir(fs, srcProjectDir, destProjectDir, ignoreRules) {
1879
+ await fs.mkdir(destProjectDir);
1880
+ const entries = await fs.readdir(srcProjectDir);
1881
+ for (const entryName of entries) {
1882
+ const srcPath = fs.path.join(srcProjectDir, entryName);
1883
+ const entryStat = await fs.stat(srcPath);
1884
+ if (!entryStat) {
1885
+ continue;
1886
+ }
1887
+ if (entryStat.isFile()) {
1888
+ if (isDefaultExcludedFileName(entryName) || isIgnoredByRules(fs, ignoreRules, srcPath, false)) {
1889
+ continue;
1890
+ }
1891
+ const data = await fs.readFile(srcPath);
1892
+ if (data) {
1893
+ await fs.writeFile(fs.path.join(destProjectDir, entryName), data);
1894
+ }
1895
+ } else if (entryStat.isDirectory()) {
1896
+ if (DEFAULT_EXCLUDED_DIR_NAMES.has(entryName) || isIgnoredByRules(fs, ignoreRules, srcPath, true)) {
1897
+ continue;
1898
+ }
1899
+ if (entryName === "content" || entryName === "flow_files") {
1900
+ await mirrorTree(fs, srcPath, srcPath, destProjectDir, ignoreRules);
1901
+ } else {
1902
+ await mirrorTree(fs, srcPath, srcProjectDir, destProjectDir, ignoreRules);
1903
+ }
1904
+ }
1905
+ }
1906
+ }
1907
+ async function bundleSolution2(fs, solutionDir, outputDir, outputName) {
1908
+ const resolvedPath = fs.path.resolve(solutionDir);
1909
+ const solStat = await fs.stat(resolvedPath);
1910
+ if (!solStat) {
1911
+ throw new Error(`Path not found: ${resolvedPath}`);
1912
+ }
1913
+ if (!solStat.isDirectory()) {
1914
+ throw new Error(`Not a directory: ${resolvedPath}. Provide the solution directory containing a .uipx file.`);
1915
+ }
1916
+ const { uipx, uipxFileName } = await readUipxFile(fs, resolvedPath);
1917
+ const solutionUipignore = await readUipignore(fs, resolvedPath);
1918
+ const solutionRules = solutionUipignore ? [solutionUipignore] : [];
1919
+ if (solutionUipignore) {
1920
+ logger.info(`Applying ${solutionUipignore.patterns.length} extra exclude(s) from ${UIPIGNORE_FILENAME}: ${solutionUipignore.patterns.join(", ")}`);
1921
+ }
1922
+ const isTopLevelTreeExcluded = (treePath, name) => DEFAULT_EXCLUDED_DIR_NAMES.has(name) || isIgnoredByRules(fs, solutionRules, treePath, true);
1923
+ for (const project of uipx.Projects) {
1924
+ project.ProjectRelativePath = toForwardSlash(project.ProjectRelativePath);
1925
+ }
1926
+ assertStudioWebCompatibleProjects(uipx.Projects);
1927
+ const solutionStorage = {
1928
+ SolutionId: uipx.SolutionId,
1929
+ Projects: uipx.Projects.map((p) => ({
1930
+ ProjectId: p.Id,
1931
+ ProjectRelativePath: p.ProjectRelativePath
1932
+ }))
1933
+ };
1934
+ const solutionName = outputName || fs.path.basename(uipxFileName, ".uipx");
1935
+ const stagingDir = fs.path.join(resolvedPath, `.uis-staging-${Date.now()}`);
1936
+ await fs.mkdir(stagingDir);
1937
+ try {
1938
+ await fs.writeFile(fs.path.join(stagingDir, "SolutionStorage.json"), JSON.stringify(solutionStorage));
1939
+ await fs.writeFile(fs.path.join(stagingDir, uipxFileName), JSON.stringify(uipx));
1940
+ for (const project of uipx.Projects) {
1941
+ const projectDir = fs.path.dirname(project.ProjectRelativePath);
1942
+ const srcProjectPath = fs.path.join(resolvedPath, projectDir);
1943
+ const projectStat = await fs.stat(srcProjectPath);
1944
+ if (!projectStat) {
1945
+ throw new Error(`Project directory not found: ${srcProjectPath}`);
1946
+ }
1947
+ const projectRules = await mergeProjectUipignore(fs, srcProjectPath, projectDir, solutionRules);
1948
+ const manifestPath = fs.path.join(resolvedPath, project.ProjectRelativePath);
1949
+ if (isIgnoredByRules(fs, projectRules, manifestPath, false)) {
1950
+ throw new UipignoreExcludesProjectError2(project.ProjectRelativePath);
1951
+ }
1952
+ await flattenProjectDir(fs, srcProjectPath, fs.path.join(stagingDir, projectDir), projectRules);
1953
+ }
1954
+ const resourcesPath = fs.path.join(resolvedPath, "resources");
1955
+ if (!isTopLevelTreeExcluded(resourcesPath, "resources") && await fs.exists(resourcesPath)) {
1956
+ await mirrorTree(fs, resourcesPath, resolvedPath, stagingDir, solutionRules);
1957
+ }
1958
+ const userProfilePath = fs.path.join(resolvedPath, "userProfile");
1959
+ if (!isTopLevelTreeExcluded(userProfilePath, "userProfile") && await fs.exists(userProfilePath)) {
1960
+ await mirrorTree(fs, userProfilePath, resolvedPath, stagingDir, solutionRules);
1961
+ }
1962
+ const resolvedOutputDir = fs.path.resolve(outputDir);
1963
+ if (!await fs.exists(resolvedOutputDir)) {
1964
+ await fs.mkdir(resolvedOutputDir);
1965
+ }
1966
+ const uisPath = fs.path.join(resolvedOutputDir, `${solutionName}.uis`);
1967
+ const zipData = await createZipFromDir(fs, stagingDir);
1968
+ await fs.writeFile(uisPath, zipData);
1969
+ const uipxPath = fs.path.join(resolvedPath, uipxFileName);
1970
+ return {
1971
+ uisPath,
1972
+ solutionName,
1973
+ solutionId: uipx.SolutionId,
1974
+ uipxPath,
1975
+ projects: uipx.Projects.map((p) => ({
1976
+ Name: fs.path.dirname(p.ProjectRelativePath),
1977
+ Type: p.Type
1978
+ }))
1979
+ };
1980
+ } finally {
1981
+ await fs.rm(stagingDir);
1982
+ }
1983
+ }
1984
+ // ../solution-sdk/src/project-debug-status.ts
1985
+ var SUCCEEDED = "creationsucceeded";
1986
+ var TERMINAL = new Set([SUCCEEDED, "creationfailed", "validationfailed"]);
1987
+ var isDebugProvisioningTerminal2 = (status) => TERMINAL.has((status ?? "").toLowerCase());
1988
+ var isDebugProvisioningSucceeded2 = (status) => (status ?? "").toLowerCase() === SUCCEEDED;
1989
+ async function getProjectDebugStatus2(config, solutionKey, debugSessionId) {
1990
+ const url = `${config.basePath}/api/v1/solutions/${encodeURIComponent(solutionKey)}` + `/projects/debug/status?debugSessionId=${encodeURIComponent(debugSessionId)}`;
1991
+ const response = await fetch(url, {
1992
+ headers: { Authorization: `Bearer ${config.accessToken}` }
1993
+ });
1994
+ if (!response.ok) {
1995
+ throw new ResponseError(response, "Response returned an error code");
1996
+ }
1997
+ return await response.json();
1998
+ }
1999
+ // ../solution-sdk/src/solution-info.ts
2000
+ async function getStudioWebSolutionProjects2(config, organizationName, solutionId) {
2001
+ const api = createSolutionApi(config, organizationName);
2002
+ try {
2003
+ const solution = await api.solutionGetSolution({ solutionId });
2004
+ return (solution.projects ?? []).flatMap((project) => project.id ? [
2005
+ {
2006
+ id: project.id,
2007
+ designId: project.designId ?? undefined,
2008
+ name: project.name ?? undefined,
2009
+ projectType: project.projectType ?? undefined
2010
+ }
2011
+ ] : []);
2012
+ } catch (error) {
2013
+ if (error instanceof ResponseError2) {
2014
+ if (error.response.status === 404) {
2015
+ return;
2016
+ }
2017
+ const text = await error.response.text().catch(() => "");
2018
+ throw new Error(`Studio Web solution lookup failed (${error.response.status}): ${text}`);
2019
+ }
2020
+ throw error;
2021
+ }
2022
+ }
2023
+ async function listStudioWebSolutions2(config, organizationName, options = {}) {
2024
+ const api = createSolutionApi(config, organizationName);
2025
+ try {
2026
+ const result = await api.solutionSearchSolutionsAndProjects({
2027
+ keywords: options.name === undefined ? undefined : [options.name],
2028
+ pagingOptionsLimit: options.limit,
2029
+ pagingOptionsSkip: options.skip,
2030
+ sortBy: options.sortBy,
2031
+ sortOrder: options.sortOrder
2032
+ });
2033
+ const solutions = result.solutions ?? [];
2034
+ return {
2035
+ solutions,
2036
+ combinedCount: solutions.length + (result.standaloneProjects?.length ?? 0),
2037
+ totalCount: result.totalCount
2038
+ };
2039
+ } catch (error) {
2040
+ if (error instanceof ResponseError2) {
2041
+ const text = await error.response.text().catch(() => "");
2042
+ throw new Error(`Studio Web solution listing failed (${error.response.status}): ${text}`);
2043
+ }
2044
+ throw error;
2045
+ }
2046
+ }
2047
+ // ../solution-sdk/src/upload-service.ts
2048
+ class HttpError extends Error {
2049
+ status;
2050
+ constructor(status, message) {
2051
+ super(message);
2052
+ this.status = status;
2053
+ }
2054
+ }
2055
+
2056
+ class SolutionUploadHttpError extends Error {
2057
+ status;
2058
+ operation;
2059
+ method;
2060
+ endpoint;
2061
+ url;
2062
+ body;
2063
+ solutionId;
2064
+ parsedErrorCode;
2065
+ parsedErrorMessage;
2066
+ authChallenge;
2067
+ constructor(details) {
2068
+ super(details.message);
2069
+ this.name = "SolutionUploadHttpError";
2070
+ this.status = details.status;
2071
+ this.operation = details.operation;
2072
+ this.method = details.method;
2073
+ this.endpoint = details.endpoint;
2074
+ this.url = details.url;
2075
+ this.body = details.body;
2076
+ if (details.operation === "overwrite") {
2077
+ this.solutionId = details.solutionId;
2078
+ }
2079
+ this.authChallenge = details.authChallenge;
2080
+ const parsed = parseUploadErrorBody(details.body);
2081
+ this.parsedErrorCode = parsed.code;
2082
+ this.parsedErrorMessage = parsed.message;
2083
+ }
2084
+ }
2085
+ function parseUploadErrorBody(body) {
2086
+ const [, parsed] = catchError(() => JSON.parse(body));
2087
+ if (!parsed || typeof parsed !== "object")
2088
+ return {};
2089
+ const rawCode = parsed.code ?? parsed.Code;
2090
+ const rawMessage = parsed.message ?? parsed.Message;
2091
+ return {
2092
+ code: typeof rawCode === "string" || typeof rawCode === "number" ? String(rawCode) : undefined,
2093
+ message: typeof rawMessage === "string" && rawMessage.trim() ? rawMessage : undefined
2094
+ };
2095
+ }
2096
+ function isSolutionUploadHttpError2(error) {
2097
+ return error instanceof Error && error.name === "SolutionUploadHttpError" && "operation" in error && (error.operation === "import" || error.operation === "overwrite") && "status" in error && typeof error.status === "number" && "body" in error && typeof error.body === "string";
2098
+ }
2099
+ function requestPath(url) {
2100
+ const [, parsed] = catchError(() => new URL(url));
2101
+ return parsed ? `${parsed.pathname}${parsed.search}` : url;
2102
+ }
2103
+ var TOKEN_SHAPED = /\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]*)?|\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi;
2104
+ function redactTokens(text) {
2105
+ return text.replace(TOKEN_SHAPED, "[REDACTED]");
2106
+ }
2107
+ var MAX_CHALLENGE_DESCRIPTION = 200;
2108
+ function parseAuthChallenge(header) {
2109
+ if (!header)
2110
+ return {};
2111
+ const code = /\berror="([^"]*)"/.exec(header)?.[1]?.trim();
2112
+ const raw = /\berror_description="([^"]*)"/.exec(header)?.[1]?.trim();
2113
+ const description = raw ? redactTokens(raw).slice(0, MAX_CHALLENGE_DESCRIPTION) : undefined;
2114
+ return {
2115
+ error: code || undefined,
2116
+ description: description || undefined
2117
+ };
2118
+ }
2119
+ function summarizeAuthRefusalBody(body) {
2120
+ return summarizePlatformBody(redactTokens(body));
2121
+ }
2122
+ function isAuthRefusal(status) {
2123
+ return status === 401 || status === 403;
2124
+ }
2125
+ function buildAuthRefusalInstructions({
2126
+ err,
2127
+ subject,
2128
+ target,
2129
+ bodySuffix,
2130
+ identityType,
2131
+ clientId
2132
+ }) {
2133
+ const refusal = err.status === 401 ? "rejected the call as unauthorized (401)" : "forbade the call (403)";
2134
+ const what = err.operation === "overwrite" ? `replacing the contents of solution ${target}` : "importing the solution package";
2135
+ const actor = identityType === "Application" ? `This session acts as external application ${clientId ?? "(client id unknown)"}, so ` + `check what that application is allowed to do: it needs the Studio ` + `Web scopes that cover writing a solution (the StudioWebS2S grants ` + `on the external application), not just the Orchestrator or ` + `Solutions ones. ` : identityType === "User" ? `This session acts as a user, so check that your account has ` + `Studio Web access in this tenant. ` : `Check what this session is allowed to do in Studio Web — an ` + `external application needs the StudioWebS2S grants that cover ` + `writing a solution, a user needs Studio Web access in the tenant. `;
2136
+ const tenant = err.operation === "overwrite" ? `Also confirm that ${target} is the solution this project should ` + `publish to, and that it lives in the organization and tenant ` + `this session logged into — the id comes from the SolutionId ` + `recorded in the enclosing solution file. An id this session ` + `cannot see at all is reported separately, as nothing to ` + `overwrite, so a refusal here points at the grants first. ` : `Also confirm you are logged into the organization and tenant the ` + `solution should land in. `;
2137
+ const challenge = parseAuthChallenge(err.authChallenge);
2138
+ const quoted = challenge.description ? ` ("${challenge.description}")` : "";
2139
+ if (challenge.error === "invalid_token") {
2140
+ return `Studio Web ${refusal} while ${what}, and rejected the credential ` + `itself with the reason \`invalid_token\`${quoted}. That is the ` + `platform refusing this token rather than the permissions behind ` + `it, so unlike a grants refusal this one is worth a fresh ` + `\`uip login\` — or, in a pipeline, a newly minted ` + `client-credentials token. Check too that the token was issued for ` + `the organization being called: one minted against a different ` + `environment or audience is refused this way. Nothing was uploaded ` + `and nothing ran, so the ${subject} is not the cause.${bodySuffix}`;
2141
+ }
2142
+ const authenticated = `The session is authenticated — the token was issued and had not ` + `expired when the call went out — so re-running \`uip login\` mints ` + `the same token and fails the same way. `;
2143
+ const diagnosis = challenge.error === "insufficient_scope" ? `Studio Web reported \`insufficient_scope\`${quoted}, so the ` + `token is valid and simply not allowed to do this: logging in ` + `again will not change it. ` : challenge.error ? `${authenticated}Studio Web gave the reason ` + `\`${challenge.error}\`${quoted}. ` : authenticated;
2144
+ const closing = bodySuffix ? `If the grants and the tenant are already right, report the platform ` + `response, including its traceId.${bodySuffix}` : challenge.error ? `If the grants and the tenant are already right, report that reason ` + `together with the request path and status above.` : `If the grants and the tenant are already right, report the request ` + `path and status above — Studio Web returned no response body and ` + `no authentication challenge, so there is nothing further to quote.`;
2145
+ return `Studio Web ${refusal} while ${what}. ${diagnosis}${actor}${tenant}` + `Nothing was uploaded and nothing ran, so the ${subject} is not the ` + `cause. ${closing}`;
2146
+ }
2147
+ function buildSolutionUploadFailureOutput2(err, options = {}) {
2148
+ const stage = err.operation === "overwrite" ? "overwrite-solution" : "import-solution";
2149
+ const authRefusal = isAuthRefusal(err.status);
2150
+ const parsedMessage = authRefusal && err.parsedErrorMessage ? redactTokens(err.parsedErrorMessage) : err.parsedErrorMessage;
2151
+ const detail = parsedMessage ? ` — ${parsedMessage}` : "";
2152
+ const Message = `Failed during ${stage}: HTTP ${err.status} on ${err.method} ` + `${err.endpoint}${detail}`;
2153
+ const quote = authRefusal ? summarizeAuthRefusalBody : summarizePlatformBody;
2154
+ const body = err.parsedErrorMessage ? "" : quote(err.body);
2155
+ const bodySuffix = body ? ` Platform response: "${body}".` : "";
2156
+ const importHint = options.importCheckHint ? ` ${options.importCheckHint}` : "";
2157
+ const subject = options.subject ?? "project";
2158
+ const target = err.solutionId ?? `the solution at ${err.endpoint}`;
2159
+ const authInstructions = isAuthRefusal(err.status) ? buildAuthRefusalInstructions({
2160
+ err,
2161
+ subject,
2162
+ target,
2163
+ bodySuffix,
2164
+ identityType: options.identityType,
2165
+ clientId: options.clientId
2166
+ }) : undefined;
2167
+ const Instructions = authInstructions ?? (err.operation === "overwrite" ? `Studio Web refused to replace the contents of solution ` + `${target}. Nothing was uploaded and nothing ran, so the ` + `${subject} is not the cause: do not re-author it, and do not ` + `copy the project into another solution. Confirm that ${target} ` + `is a solution you can still write to, and that it is the one ` + `this project should publish to — it comes from the SolutionId ` + `recorded in the enclosing solution file. If it is right, report ` + `the platform response.${bodySuffix}` : `Studio Web refused to import the solution package. Nothing was ` + `uploaded and nothing ran, so no part of the ${subject} executed ` + `— but the package itself may be what was rejected.${importHint} ` + `Report the platform response if the ${subject} is ` + `well-formed.${bodySuffix}`);
2168
+ const Context = {
2169
+ httpStatus: err.status,
2170
+ stage,
2171
+ endpoint: err.endpoint,
2172
+ method: err.method
2173
+ };
2174
+ if (err.parsedErrorCode !== undefined) {
2175
+ Context.errorCode = err.parsedErrorCode;
2176
+ }
2177
+ const output = {
2178
+ Result: RESULTS.Failure,
2179
+ Message,
2180
+ Instructions,
2181
+ Context
2182
+ };
2183
+ if (err.status === 401 && options.identityType === "Application") {
2184
+ output.ErrorCode = "permission_denied";
2185
+ }
2186
+ if (err.operation === "overwrite" && err.status >= 500 && err.status < 600) {
2187
+ output.Retry = "RetryAfter30Seconds";
2188
+ }
2189
+ return output;
2190
+ }
2191
+ var DEFAULT_UPLOAD_TIMEOUT_MS = 120000;
2192
+ function resolveUploadTimeoutMs() {
2193
+ const raw = Number(process.env?.UIPATH_SOLUTION_UPLOAD_TIMEOUT_MS);
2194
+ return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_UPLOAD_TIMEOUT_MS;
2195
+ }
2196
+ function formatTimeout(timeoutMs) {
2197
+ return timeoutMs < 1000 ? `${Math.round(timeoutMs)}ms` : `${Math.round(timeoutMs / 1000)}s`;
2198
+ }
2199
+ function timeoutMessage(what, timeoutMs) {
2200
+ return `${what} timed out after ${formatTimeout(timeoutMs)} — the connection ` + `stalled with no response from Studio Web. Retry the command; if it keeps ` + `timing out, check connectivity (VPN/proxy) to the tenant, or raise the ` + `ceiling with UIPATH_SOLUTION_UPLOAD_TIMEOUT_MS.`;
2201
+ }
2202
+ function isTimeoutError(error) {
2203
+ let current = error;
2204
+ for (let depth = 0;depth < 5 && current instanceof Error; depth += 1) {
2205
+ if (current.name === "TimeoutError")
2206
+ return true;
2207
+ current = current.cause;
2208
+ }
2209
+ return false;
2210
+ }
2211
+ async function fetchWithUploadTimeout(url, init, what) {
2212
+ const timeoutMs = resolveUploadTimeoutMs();
2213
+ const [error, response] = await catchError(fetch(url, { ...init, signal: AbortSignal.timeout(timeoutMs) }));
2214
+ if (error) {
2215
+ if (isTimeoutError(error)) {
2216
+ throw new Error(timeoutMessage(what, timeoutMs));
2217
+ }
2218
+ throw error;
2219
+ }
2220
+ return response;
2221
+ }
2222
+ async function solutionExistsOnStudioWeb2(config, organizationName, solutionId) {
2223
+ const api = createSolutionApi(config, organizationName);
2224
+ const timeoutMs = resolveUploadTimeoutMs();
2225
+ try {
2226
+ await api.solutionGetSolutionRaw({ solutionId }, { signal: AbortSignal.timeout(timeoutMs) });
2227
+ return true;
2228
+ } catch (error) {
2229
+ if (isTimeoutError(error)) {
2230
+ throw new Error(timeoutMessage("Studio Web solution existence probe", timeoutMs));
2231
+ }
2232
+ if (error instanceof ResponseError2) {
2233
+ if (error.response.status === 404) {
2234
+ return false;
2235
+ }
2236
+ const text = await error.response.text().catch(() => "");
2237
+ throw new HttpError(error.response.status, `Studio Web solution existence probe failed (${error.response.status}): ${text}`);
2238
+ }
2239
+ throw error;
2240
+ }
2241
+ }
2242
+ async function importSolution2(config, organizationName, fileBuffer, fileName) {
2243
+ const importUrl = `${config.baseUrl}/${encodeURIComponent(organizationName)}/studio_/backend/api/Solution/Import?desktopJit=true&useFileRest=true&enableUnifiedBuild=true`;
2244
+ const formData = new FormData;
2245
+ const fileBlob = new Blob([fileBuffer], {
2246
+ type: "application/octet-stream"
2247
+ });
2248
+ formData.append("uploadFile", fileBlob, fileName);
2249
+ formData.append("telemetryData", JSON.stringify({ FirstRun: false }));
2250
+ const headers = addSdkUserAgentHeader({
2251
+ Authorization: `Bearer ${config.authToken}`
2252
+ }, SDK_USER_AGENT);
2253
+ if (config.tenantId) {
2254
+ headers["x-uipath-tenantid"] = config.tenantId;
2255
+ }
2256
+ const response = await fetchWithUploadTimeout(importUrl, { method: "POST", headers, body: formData }, "Studio Web solution import");
2257
+ if (!response.ok) {
2258
+ const text = await response.text().catch(() => "");
2259
+ throw new SolutionUploadHttpError({
2260
+ operation: "import",
2261
+ status: response.status,
2262
+ method: "POST",
2263
+ endpoint: requestPath(importUrl),
2264
+ url: importUrl,
2265
+ body: text,
2266
+ authChallenge: response.headers?.get("www-authenticate") ?? undefined,
2267
+ message: `Import failed (${response.status}): ${text}`
2268
+ });
2269
+ }
2270
+ return await response.json();
2271
+ }
2272
+ async function overwriteSolution2(config, organizationName, fileBuffer, fileName, solutionId, createSnapshot = false) {
2273
+ const overwriteUrl = `${config.baseUrl}/${encodeURIComponent(organizationName)}/studio_/backend/api/Solution/${encodeURIComponent(solutionId)}/Overwrite`;
2274
+ const formData = new FormData;
2275
+ const fileBlob = new Blob([fileBuffer], {
2276
+ type: "application/octet-stream"
2277
+ });
2278
+ formData.append("UploadFile", fileBlob, fileName);
2279
+ if (createSnapshot) {
2280
+ formData.append("createSnapshot", "true");
2281
+ }
2282
+ const headers = addSdkUserAgentHeader({
2283
+ Authorization: `Bearer ${config.authToken}`
2284
+ }, SDK_USER_AGENT);
2285
+ if (config.tenantId) {
2286
+ headers["x-uipath-tenantid"] = config.tenantId;
2287
+ }
2288
+ const response = await fetchWithUploadTimeout(overwriteUrl, { method: "POST", headers, body: formData }, "Studio Web solution overwrite");
2289
+ if (!response.ok) {
2290
+ const text = await response.text().catch(() => "");
2291
+ throw new SolutionUploadHttpError({
2292
+ operation: "overwrite",
2293
+ status: response.status,
2294
+ method: "POST",
2295
+ endpoint: requestPath(overwriteUrl),
2296
+ url: overwriteUrl,
2297
+ body: text,
2298
+ authChallenge: response.headers?.get("www-authenticate") ?? undefined,
2299
+ message: `Overwrite failed (${response.status}): ${text}`,
2300
+ solutionId
2301
+ });
2302
+ }
2303
+ return await response.json();
2304
+ }
2305
+ export { getAvailablePublishLocationsV22, StudioWebIncompatibleProjectError2, UipignoreExcludesProjectError2, bundleSolution2, isDebugProvisioningTerminal2, isDebugProvisioningSucceeded2, getProjectDebugStatus2, getStudioWebSolutionProjects2, listStudioWebSolutions2, isSolutionUploadHttpError2, buildSolutionUploadFailureOutput2, solutionExistsOnStudioWeb2, importSolution2, overwriteSolution2 };
2306
+
2307
+ //# debugId=EBE15C167A99838C64756E2164756E21