@uipath/solution-sdk 1.205.0-preview.281 → 1.206.0-preview.282
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deployment-search.js +49 -19
- package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/first-party-service-ahcc6xc6.js +8 -0
- package/dist/{index-y4vgqz1w.js → index-0b3srjv7.js} +98 -8
- package/dist/{index-78paj2kz.js → index-0drvtcm4.js} +12 -11
- package/dist/{index-asp9b472.js → index-bhnv4san.js} +582 -577
- package/dist/{index-hkexw5er.js → index-bpn15jyk.js} +35 -20
- package/dist/{index-gdtpsdn7.js → index-mm1x18d6.js} +223 -28
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/{index-enc2hqq5.js → index-tdffhvfs.js} +931 -502
- package/dist/index-txd1grjc.js +541 -0
- package/dist/{index-cs3g624n.js → index-xnrbg4x3.js} +6 -7
- package/dist/index-z2qk2qn6.js +24 -0
- package/dist/index.js +1310 -669
- package/dist/{jmespath-231m3hyn.js → jmespath-x4na7sj8.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/package-search.js +18 -19
- package/dist/project-context.js +75 -0
- package/dist/resources/index.js +265 -237
- package/dist/scripts/generate-sdk.js +2 -2
- package/dist/solution-auth.js +6 -7
- package/dist/src/deployment-search.d.ts +30 -0
- package/dist/src/project-context.d.ts +9 -0
- package/dist/src/resources/providers/artefact-pair-binding-provider.d.ts +8 -2
- package/dist/src/resources/services/sync-resources-from-bindings.d.ts +14 -1
- package/package.json +6 -2
- package/dist/first-party-service-sd8yaf73.js +0 -27
- package/dist/index-1de529jm.js +0 -39
- package/dist/index-53w8skv5.js +0 -262
- package/dist/index-dqa169gp.js +0 -25
- package/dist/index-zmneg45c.js +0 -1184
|
@@ -8,7 +8,7 @@ import { mkdir, readFile, rm, writeFile } from "fs/promises";
|
|
|
8
8
|
import { dirname, join } from "path";
|
|
9
9
|
import { fileURLToPath } from "url";
|
|
10
10
|
var SWAGGER_URL = "https://alpha.uipath.com/uipattycyrhx/abizon_1/automationsolutions_/swagger/v1.0/swagger.json";
|
|
11
|
-
var __dirname2 =
|
|
11
|
+
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
12
12
|
var PKG_ROOT = join(__dirname2, "../..");
|
|
13
13
|
var OUTPUT_DIR = join(PKG_ROOT, "generated");
|
|
14
14
|
var TEMP_DIR = join(PKG_ROOT, "temp");
|
|
@@ -206,4 +206,4 @@ export {
|
|
|
206
206
|
main as generateSdk
|
|
207
207
|
};
|
|
208
208
|
|
|
209
|
-
//# debugId=
|
|
209
|
+
//# debugId=AAE44A16F135548564756E2164756E21
|
package/dist/solution-auth.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-1de529jm.js";
|
|
2
|
+
getSolutionAuthContext2
|
|
3
|
+
} from "./index-xnrbg4x3.js";
|
|
4
|
+
import"./index-bpn15jyk.js";
|
|
5
|
+
import"./index-0b3srjv7.js";
|
|
7
6
|
export {
|
|
8
|
-
getSolutionAuthContext
|
|
7
|
+
getSolutionAuthContext2 as getSolutionAuthContext
|
|
9
8
|
};
|
|
10
9
|
|
|
11
|
-
//# debugId=
|
|
10
|
+
//# debugId=A66110800BDD5EC564756E2164756E21
|
|
@@ -65,6 +65,36 @@ export declare class DeploymentSearchTruncatedError extends Error {
|
|
|
65
65
|
* superset of it, so its extra fields are dropped.
|
|
66
66
|
*/
|
|
67
67
|
export declare function searchDeploymentsPage(auth: SolutionAuthContext, query: DeploymentSearchQuery, scope?: RequestInit | InitOverrideFunction): Promise<DeploymentSearchPage>;
|
|
68
|
+
/**
|
|
69
|
+
* The request header that names the feed, which a server that applied it
|
|
70
|
+
* echoes back on the response with the feed's root folder key. A server that
|
|
71
|
+
* ignored it ran the request against the tenant feed and echoes nothing.
|
|
72
|
+
*/
|
|
73
|
+
export declare const APPLIED_FEED_HEADER = "X-UIPATH-FolderKey";
|
|
74
|
+
/** Whether the server applies `X-UIPATH-FolderKey` to this session's requests. */
|
|
75
|
+
export type FeedHeaderProbe = "applied" | "ignored";
|
|
76
|
+
/**
|
|
77
|
+
* Which Pipelines search the probe sends. A command asks over the route its
|
|
78
|
+
* own work uses — the package search for `packages list` / `packages delete`,
|
|
79
|
+
* the deployment search for everything else — so the question needs no OAuth
|
|
80
|
+
* scope the command does not already need: an application with only
|
|
81
|
+
* `Solutions.Packages.*` is refused by the deployment search, and that
|
|
82
|
+
* refusal must not read as "the server ignores the feed".
|
|
83
|
+
*/
|
|
84
|
+
export type FeedProbeRoute = "deployments" | "packages";
|
|
85
|
+
/**
|
|
86
|
+
* Asks the server, with one single-row Pipelines search sent with
|
|
87
|
+
* `X-UIPATH-FolderKey: <folderKey>`, whether it runs this session's requests
|
|
88
|
+
* in that feed. It does when its answer echoes the same feed in
|
|
89
|
+
* {@link APPLIED_FEED_HEADER}. An application token on a server that predates
|
|
90
|
+
* that support gets no echo: the header was ignored and the search ran against
|
|
91
|
+
* the tenant feed — as would an install sent the same way. A server without
|
|
92
|
+
* the Pipelines search is `"ignored"` too. Any other failure is thrown, so the
|
|
93
|
+
* caller decides; nothing here reads as "applied" without the echo.
|
|
94
|
+
*
|
|
95
|
+
* Remembered per server, session, route and feed for the process.
|
|
96
|
+
*/
|
|
97
|
+
export declare function probeFeedHeaderAsync(auth: Pick<SolutionAuthContext, "basePath" | "accessToken">, folderKey: string, route?: FeedProbeRoute): Promise<FeedHeaderProbe>;
|
|
68
98
|
export interface SearchDeploymentsOptions {
|
|
69
99
|
/** Narrows the search to this package. Sent to the server as `packageName`. */
|
|
70
100
|
readonly packageName?: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type TelemetryProperties } from "@uipath/common";
|
|
2
|
+
import { type IFileSystem } from "@uipath/filesystem";
|
|
3
|
+
/**
|
|
4
|
+
* Read only the nearest solution and require one exact project membership.
|
|
5
|
+
* A file target must match the registered manifest, not just its directory.
|
|
6
|
+
* Never infer membership from the working directory, a project ID or a name.
|
|
7
|
+
* This focused entry point avoids the SDK's cloud and resource-engine barrels.
|
|
8
|
+
*/
|
|
9
|
+
export declare function readProjectSolutionContext(projectDirectory: string, fs?: IFileSystem): Promise<TelemetryProperties | undefined>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { IJsonSerializerFactory, ILoggerFactory } from "@uipath/resource-builder-sdk";
|
|
1
2
|
import type { ISolutionContext } from "@uipath/resource-builder-sdk/models";
|
|
2
|
-
import {
|
|
3
|
+
import type { IFileStorageProviderFactory } from "@uipath/resource-builder-sdk/providers";
|
|
4
|
+
import { type ISolutionDefinitionFactory, MultiFileSolutionDefinitionProvider, type SolutionDefinition } from "@uipath/resource-builder-sdk/solution";
|
|
3
5
|
/**
|
|
4
6
|
* Runs on every `writeAsync` to backfill artefact-pair wiring the TS SDK's
|
|
5
7
|
* `bindArtefactResources` doesn't yet port from the C# `BindAppResources`
|
|
@@ -20,6 +22,10 @@ export declare class ArtefactPairBindingProvider extends MultiFileSolutionDefini
|
|
|
20
22
|
* (`saveChangesAsync` → `saveAsync`), so registering the provider alone
|
|
21
23
|
* isn't enough — the factory has to produce it too.
|
|
22
24
|
*/
|
|
23
|
-
export declare class ArtefactPairBindingSolutionDefinitionFactory
|
|
25
|
+
export declare class ArtefactPairBindingSolutionDefinitionFactory implements ISolutionDefinitionFactory {
|
|
26
|
+
private readonly fileStorageProviderFactory;
|
|
27
|
+
private readonly jsonSerializerFactory;
|
|
28
|
+
private readonly loggerFactory;
|
|
29
|
+
constructor(fileStorageProviderFactory: IFileStorageProviderFactory, jsonSerializerFactory: IJsonSerializerFactory, loggerFactory: ILoggerFactory);
|
|
24
30
|
getProviderAsync(): Promise<ArtefactPairBindingProvider>;
|
|
25
31
|
}
|
|
@@ -65,6 +65,15 @@ interface SyncResult {
|
|
|
65
65
|
/** Why the catalog could not be searched, when a search failed. */
|
|
66
66
|
catalogLookupFailure?: CatalogLookupFailure;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* A resource the solution provisions itself: a project's own tool contributes
|
|
70
|
+
* its spec by name (`ProjectSpecPatch.name`), so the sync mints it and never
|
|
71
|
+
* asks the Resource Catalog for it.
|
|
72
|
+
*/
|
|
73
|
+
export interface SelfProvisionedResource {
|
|
74
|
+
kind: string;
|
|
75
|
+
name: string;
|
|
76
|
+
}
|
|
68
77
|
/**
|
|
69
78
|
* Reads bindings_v2.json from project paths and creates/imports matching
|
|
70
79
|
* resources in the solution using the resource-builder-sdk.
|
|
@@ -75,8 +84,11 @@ interface SyncResult {
|
|
|
75
84
|
* `.uipx` project `Id`, as `bindings_v2.json` `resources[]` entries. Read in
|
|
76
85
|
* place of that project's `bindings_v2.json`: such a project keeps its
|
|
77
86
|
* bindings in its own source format, so a file on disk is a stale copy.
|
|
87
|
+
* @param selfProvisioned - Resources the solution provisions itself, by
|
|
88
|
+
* `(kind, name)`. A binding naming one is minted as a virtual without a
|
|
89
|
+
* Resource Catalog lookup, as a member project's declaration is.
|
|
78
90
|
*/
|
|
79
|
-
export declare function syncResourcesFromBindings(solutionDir: string, projectPaths?: string[], projectSubTypes?: ReadonlyMap<string, string>, projectBindings?: ReadonlyMap<string, readonly ContributedBinding[]
|
|
91
|
+
export declare function syncResourcesFromBindings(solutionDir: string, projectPaths?: string[], projectSubTypes?: ReadonlyMap<string, string>, projectBindings?: ReadonlyMap<string, readonly ContributedBinding[]>, selfProvisioned?: readonly SelfProvisionedResource[]): Promise<SyncResult>;
|
|
80
92
|
/**
|
|
81
93
|
* Mirror of SDK's private `addResourceWithUniqueName`
|
|
82
94
|
* (resource-builder-sdk index.js:673): if any other resource of the same
|
|
@@ -198,4 +210,5 @@ export declare function readUipxProjects(solutionDir: string): Promise<UipxProje
|
|
|
198
210
|
export declare function syncAndLog(solutionDir: string, projectSubTypes?: ReadonlyMap<string, string>, options?: {
|
|
199
211
|
projectBindings?: ReadonlyMap<string, readonly ContributedBinding[]>;
|
|
200
212
|
failOnUnresolved?: boolean;
|
|
213
|
+
selfProvisioned?: readonly SelfProvisionedResource[];
|
|
201
214
|
}): Promise<void>;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uipath/solution-sdk",
|
|
3
3
|
"author": "UiPath",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.206.0-preview.282",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/UiPath/cli.git",
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"./packages": {
|
|
40
40
|
"types": "./dist/src/package-search.d.ts",
|
|
41
41
|
"default": "./dist/package-search.js"
|
|
42
|
+
},
|
|
43
|
+
"./project-context": {
|
|
44
|
+
"types": "./dist/src/project-context.d.ts",
|
|
45
|
+
"default": "./dist/project-context.js"
|
|
42
46
|
}
|
|
43
47
|
},
|
|
44
48
|
"bin": {
|
|
@@ -48,5 +52,5 @@
|
|
|
48
52
|
"dist"
|
|
49
53
|
],
|
|
50
54
|
"private": false,
|
|
51
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "9f18b69f2307838e3ce650b91de76cf6c9a23c13"
|
|
52
56
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FirstPartyServiceApi,
|
|
3
|
-
HttpClient,
|
|
4
|
-
first_party_service_ContentType,
|
|
5
|
-
first_party_service_DeploymentAction,
|
|
6
|
-
first_party_service_DeploymentResourceValidationAction,
|
|
7
|
-
first_party_service_DeploymentResourceValidationErrorKind,
|
|
8
|
-
first_party_service_DeploymentResourceValidationErrorLevel,
|
|
9
|
-
first_party_service_QueryOptions,
|
|
10
|
-
first_party_service_SolutionDeploymentAction,
|
|
11
|
-
first_party_service_SolutionStatus
|
|
12
|
-
} from "./index-53w8skv5.js";
|
|
13
|
-
import"./index-1de529jm.js";
|
|
14
|
-
export {
|
|
15
|
-
first_party_service_ContentType as ContentType,
|
|
16
|
-
first_party_service_DeploymentAction as DeploymentAction,
|
|
17
|
-
first_party_service_DeploymentResourceValidationAction as DeploymentResourceValidationAction,
|
|
18
|
-
first_party_service_DeploymentResourceValidationErrorKind as DeploymentResourceValidationErrorKind,
|
|
19
|
-
first_party_service_DeploymentResourceValidationErrorLevel as DeploymentResourceValidationErrorLevel,
|
|
20
|
-
FirstPartyServiceApi,
|
|
21
|
-
HttpClient,
|
|
22
|
-
first_party_service_QueryOptions as QueryOptions,
|
|
23
|
-
first_party_service_SolutionDeploymentAction as SolutionDeploymentAction,
|
|
24
|
-
first_party_service_SolutionStatus as SolutionStatus
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
//# debugId=10C4E50B625B238964756E2164756E21
|
package/dist/index-1de529jm.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(mod))
|
|
24
|
-
if (!__hasOwnProp.call(to, key))
|
|
25
|
-
__defProp(to, key, {
|
|
26
|
-
get: __accessProp.bind(mod, key),
|
|
27
|
-
enumerable: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (canCache)
|
|
31
|
-
cache.set(mod, to);
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
35
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
36
|
-
|
|
37
|
-
export { __toESM, __commonJS, __require };
|
|
38
|
-
|
|
39
|
-
//# debugId=4A15A0D6FCDB684764756E2164756E21
|
package/dist/index-53w8skv5.js
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/@uipath/resource-builder-sdk/dist/clients/generated/first-party-service.js
|
|
2
|
-
var first_party_service_DeploymentAction = /* @__PURE__ */ function(DeploymentAction) {
|
|
3
|
-
DeploymentAction["Install"] = "Install";
|
|
4
|
-
DeploymentAction["Link"] = "Link";
|
|
5
|
-
DeploymentAction["Uninstall"] = "Uninstall";
|
|
6
|
-
DeploymentAction["Unlink"] = "Unlink";
|
|
7
|
-
DeploymentAction["Merge"] = "Merge";
|
|
8
|
-
DeploymentAction["UseExisting"] = "UseExisting";
|
|
9
|
-
DeploymentAction["Activate"] = "Activate";
|
|
10
|
-
return DeploymentAction;
|
|
11
|
-
}({});
|
|
12
|
-
var first_party_service_SolutionDeploymentAction = /* @__PURE__ */ function(SolutionDeploymentAction) {
|
|
13
|
-
SolutionDeploymentAction["Install"] = "Install";
|
|
14
|
-
SolutionDeploymentAction["Uninstall"] = "Uninstall";
|
|
15
|
-
SolutionDeploymentAction["Upgrade"] = "Upgrade";
|
|
16
|
-
SolutionDeploymentAction["Rollback"] = "Rollback";
|
|
17
|
-
SolutionDeploymentAction["Activate"] = "Activate";
|
|
18
|
-
return SolutionDeploymentAction;
|
|
19
|
-
}({});
|
|
20
|
-
var first_party_service_SolutionStatus = /* @__PURE__ */ function(SolutionStatus) {
|
|
21
|
-
SolutionStatus["Installed"] = "Installed";
|
|
22
|
-
SolutionStatus["Uninstalled"] = "Uninstalled";
|
|
23
|
-
SolutionStatus["Installing"] = "Installing";
|
|
24
|
-
SolutionStatus["Uninstalling"] = "Uninstalling";
|
|
25
|
-
SolutionStatus["InstallError"] = "InstallError";
|
|
26
|
-
SolutionStatus["UninstallError"] = "UninstallError";
|
|
27
|
-
SolutionStatus["Unknown"] = "Unknown";
|
|
28
|
-
return SolutionStatus;
|
|
29
|
-
}({});
|
|
30
|
-
var first_party_service_QueryOptions = /* @__PURE__ */ function(QueryOptions) {
|
|
31
|
-
QueryOptions["Contains"] = "Contains";
|
|
32
|
-
QueryOptions["Equals"] = "Equals";
|
|
33
|
-
return QueryOptions;
|
|
34
|
-
}({});
|
|
35
|
-
var first_party_service_DeploymentResourceValidationErrorLevel = /* @__PURE__ */ function(DeploymentResourceValidationErrorLevel) {
|
|
36
|
-
DeploymentResourceValidationErrorLevel["Error"] = "Error";
|
|
37
|
-
DeploymentResourceValidationErrorLevel["Warning"] = "Warning";
|
|
38
|
-
DeploymentResourceValidationErrorLevel["Info"] = "Info";
|
|
39
|
-
return DeploymentResourceValidationErrorLevel;
|
|
40
|
-
}({});
|
|
41
|
-
var first_party_service_DeploymentResourceValidationErrorKind = /* @__PURE__ */ function(DeploymentResourceValidationErrorKind) {
|
|
42
|
-
DeploymentResourceValidationErrorKind["Conflict"] = "Conflict";
|
|
43
|
-
DeploymentResourceValidationErrorKind["ConfigurationError"] = "ConfigurationError";
|
|
44
|
-
return DeploymentResourceValidationErrorKind;
|
|
45
|
-
}({});
|
|
46
|
-
var first_party_service_DeploymentResourceValidationAction = /* @__PURE__ */ function(DeploymentResourceValidationAction) {
|
|
47
|
-
DeploymentResourceValidationAction["RenameExisting"] = "RenameExisting";
|
|
48
|
-
DeploymentResourceValidationAction["RenameInSolution"] = "RenameInSolution";
|
|
49
|
-
DeploymentResourceValidationAction["UseExisting"] = "UseExisting";
|
|
50
|
-
DeploymentResourceValidationAction["FixConfiguration"] = "FixConfiguration";
|
|
51
|
-
DeploymentResourceValidationAction["Delete"] = "Delete";
|
|
52
|
-
DeploymentResourceValidationAction["SkipDelete"] = "SkipDelete";
|
|
53
|
-
DeploymentResourceValidationAction["MergeConfiguration"] = "MergeConfiguration";
|
|
54
|
-
DeploymentResourceValidationAction["Replace"] = "Replace";
|
|
55
|
-
return DeploymentResourceValidationAction;
|
|
56
|
-
}({});
|
|
57
|
-
var first_party_service_ContentType = /* @__PURE__ */ function(ContentType) {
|
|
58
|
-
ContentType["Json"] = "application/json";
|
|
59
|
-
ContentType["JsonApi"] = "application/vnd.api+json";
|
|
60
|
-
ContentType["FormData"] = "multipart/form-data";
|
|
61
|
-
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
|
|
62
|
-
ContentType["Text"] = "text/plain";
|
|
63
|
-
return ContentType;
|
|
64
|
-
}({});
|
|
65
|
-
|
|
66
|
-
class HttpClient {
|
|
67
|
-
encodeQueryParam(key, value) {
|
|
68
|
-
const encodedKey = encodeURIComponent(key);
|
|
69
|
-
return `${encodedKey}=${encodeURIComponent(typeof value == "number" ? value : `${value}`)}`;
|
|
70
|
-
}
|
|
71
|
-
addQueryParam(query, key) {
|
|
72
|
-
return this.encodeQueryParam(key, query[key]);
|
|
73
|
-
}
|
|
74
|
-
addArrayQueryParam(query, key) {
|
|
75
|
-
const value = query[key];
|
|
76
|
-
return value.map((v) => this.encodeQueryParam(key, v)).join("&");
|
|
77
|
-
}
|
|
78
|
-
toQueryString(rawQuery) {
|
|
79
|
-
const query = rawQuery || {};
|
|
80
|
-
const keys = Object.keys(query).filter((key) => query[key] !== undefined);
|
|
81
|
-
return keys.map((key) => Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key)).join("&");
|
|
82
|
-
}
|
|
83
|
-
addQueryParams(rawQuery) {
|
|
84
|
-
const queryString = this.toQueryString(rawQuery);
|
|
85
|
-
return queryString ? `?${queryString}` : "";
|
|
86
|
-
}
|
|
87
|
-
mergeRequestParams(params1, params2) {
|
|
88
|
-
return {
|
|
89
|
-
...this.baseApiParams,
|
|
90
|
-
...params1,
|
|
91
|
-
...params2 || {},
|
|
92
|
-
headers: {
|
|
93
|
-
...this.baseApiParams.headers || {},
|
|
94
|
-
...params1.headers || {},
|
|
95
|
-
...params2 && params2.headers || {}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
constructor(apiConfig = {}) {
|
|
100
|
-
this.baseUrl = "https://localhost:7008";
|
|
101
|
-
this.securityData = null;
|
|
102
|
-
this.abortControllers = new Map;
|
|
103
|
-
this.customFetch = (...fetchParams) => fetch(...fetchParams);
|
|
104
|
-
this.baseApiParams = {
|
|
105
|
-
credentials: "same-origin",
|
|
106
|
-
headers: {},
|
|
107
|
-
redirect: "follow",
|
|
108
|
-
referrerPolicy: "no-referrer"
|
|
109
|
-
};
|
|
110
|
-
this.setSecurityData = (data) => {
|
|
111
|
-
this.securityData = data;
|
|
112
|
-
};
|
|
113
|
-
this.contentFormatters = {
|
|
114
|
-
["application/json"]: (input) => input !== null && (typeof input == "object" || typeof input == "string") ? JSON.stringify(input) : input,
|
|
115
|
-
["application/vnd.api+json"]: (input) => input !== null && (typeof input == "object" || typeof input == "string") ? JSON.stringify(input) : input,
|
|
116
|
-
["text/plain"]: (input) => input !== null && typeof input != "string" ? JSON.stringify(input) : input,
|
|
117
|
-
["multipart/form-data"]: (input) => {
|
|
118
|
-
if (input instanceof FormData)
|
|
119
|
-
return input;
|
|
120
|
-
return Object.keys(input || {}).reduce((formData, key) => {
|
|
121
|
-
const property = input[key];
|
|
122
|
-
formData.append(key, property instanceof Blob ? property : typeof property == "object" && property !== null ? JSON.stringify(property) : `${property}`);
|
|
123
|
-
return formData;
|
|
124
|
-
}, new FormData);
|
|
125
|
-
},
|
|
126
|
-
["application/x-www-form-urlencoded"]: (input) => this.toQueryString(input)
|
|
127
|
-
};
|
|
128
|
-
this.createAbortSignal = (cancelToken) => {
|
|
129
|
-
if (this.abortControllers.has(cancelToken)) {
|
|
130
|
-
const abortController2 = this.abortControllers.get(cancelToken);
|
|
131
|
-
if (abortController2)
|
|
132
|
-
return abortController2.signal;
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const abortController = new AbortController;
|
|
136
|
-
this.abortControllers.set(cancelToken, abortController);
|
|
137
|
-
return abortController.signal;
|
|
138
|
-
};
|
|
139
|
-
this.abortRequest = (cancelToken) => {
|
|
140
|
-
const abortController = this.abortControllers.get(cancelToken);
|
|
141
|
-
if (abortController) {
|
|
142
|
-
abortController.abort();
|
|
143
|
-
this.abortControllers.delete(cancelToken);
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
this.request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => {
|
|
147
|
-
const secureParams = (typeof secure == "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
|
|
148
|
-
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
149
|
-
const queryString = query && this.toQueryString(query);
|
|
150
|
-
const payloadFormatter = this.contentFormatters[type || "application/json"];
|
|
151
|
-
const responseFormat = format || requestParams.format;
|
|
152
|
-
return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
|
|
153
|
-
...requestParams,
|
|
154
|
-
headers: {
|
|
155
|
-
...requestParams.headers || {},
|
|
156
|
-
...type && type !== "multipart/form-data" ? {
|
|
157
|
-
"Content-Type": type
|
|
158
|
-
} : {}
|
|
159
|
-
},
|
|
160
|
-
signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
|
|
161
|
-
body: body == null ? null : payloadFormatter(body)
|
|
162
|
-
}).then(async (response) => {
|
|
163
|
-
const r = response;
|
|
164
|
-
r.data = null;
|
|
165
|
-
r.error = null;
|
|
166
|
-
const responseToParse = responseFormat ? response.clone() : response;
|
|
167
|
-
const data = responseFormat ? await responseToParse[responseFormat]().then((data2) => {
|
|
168
|
-
if (r.ok)
|
|
169
|
-
r.data = data2;
|
|
170
|
-
else
|
|
171
|
-
r.error = data2;
|
|
172
|
-
return r;
|
|
173
|
-
}).catch((e) => {
|
|
174
|
-
r.error = e;
|
|
175
|
-
return r;
|
|
176
|
-
}) : r;
|
|
177
|
-
if (cancelToken)
|
|
178
|
-
this.abortControllers.delete(cancelToken);
|
|
179
|
-
if (!response.ok)
|
|
180
|
-
throw data;
|
|
181
|
-
return data.data;
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
Object.assign(this, apiConfig);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
class FirstPartyServiceApi extends HttpClient {
|
|
189
|
-
constructor(...args) {
|
|
190
|
-
super(...args), this.v2 = {
|
|
191
|
-
automationSolutionsGetMetadata: (params = {}) => this.request({
|
|
192
|
-
path: "/v2/automationsolutions/metadata",
|
|
193
|
-
method: "GET",
|
|
194
|
-
...params
|
|
195
|
-
}),
|
|
196
|
-
automationSolutionsHeadMetadata: (params = {}) => this.request({
|
|
197
|
-
path: "/v2/automationsolutions/metadata",
|
|
198
|
-
method: "HEAD",
|
|
199
|
-
...params
|
|
200
|
-
}),
|
|
201
|
-
automationSolutionsSetState: (data, query, params = {}) => this.request({
|
|
202
|
-
path: "/v2/automationsolutions",
|
|
203
|
-
method: "PATCH",
|
|
204
|
-
query,
|
|
205
|
-
body: data,
|
|
206
|
-
type: "application/json",
|
|
207
|
-
...params
|
|
208
|
-
}),
|
|
209
|
-
automationSolutionsInstall: (data, query, params = {}) => this.request({
|
|
210
|
-
path: "/v2/automationsolutions",
|
|
211
|
-
method: "PUT",
|
|
212
|
-
query,
|
|
213
|
-
body: data,
|
|
214
|
-
format: "json",
|
|
215
|
-
...params
|
|
216
|
-
}),
|
|
217
|
-
automationSolutionsUninstall: (data, query, params = {}) => this.request({
|
|
218
|
-
path: "/v2/automationsolutions",
|
|
219
|
-
method: "DELETE",
|
|
220
|
-
query,
|
|
221
|
-
body: data,
|
|
222
|
-
type: "application/json",
|
|
223
|
-
format: "json",
|
|
224
|
-
...params
|
|
225
|
-
}),
|
|
226
|
-
automationSolutionsExport: (data, params = {}) => this.request({
|
|
227
|
-
path: "/v2/automationsolutions/export",
|
|
228
|
-
method: "POST",
|
|
229
|
-
body: data,
|
|
230
|
-
type: "application/json",
|
|
231
|
-
format: "json",
|
|
232
|
-
...params
|
|
233
|
-
}),
|
|
234
|
-
automationSolutionsGetTranslations: (query, params = {}) => this.request({
|
|
235
|
-
path: "/v2/automationsolutions/translations",
|
|
236
|
-
method: "GET",
|
|
237
|
-
query,
|
|
238
|
-
format: "json",
|
|
239
|
-
...params
|
|
240
|
-
}),
|
|
241
|
-
automationSolutionsValidate: (data, query, params = {}) => this.request({
|
|
242
|
-
path: "/v2/automationsolutions/validate",
|
|
243
|
-
method: "POST",
|
|
244
|
-
query,
|
|
245
|
-
body: data,
|
|
246
|
-
type: "application/json",
|
|
247
|
-
format: "json",
|
|
248
|
-
...params
|
|
249
|
-
}),
|
|
250
|
-
automationSolutionsLookup: (query, params = {}) => this.request({
|
|
251
|
-
path: "/v2/automationsolutions/lookup",
|
|
252
|
-
method: "GET",
|
|
253
|
-
query,
|
|
254
|
-
format: "json",
|
|
255
|
-
...params
|
|
256
|
-
})
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
export { first_party_service_DeploymentAction, first_party_service_SolutionDeploymentAction, first_party_service_SolutionStatus, first_party_service_QueryOptions, first_party_service_DeploymentResourceValidationErrorLevel, first_party_service_DeploymentResourceValidationErrorKind, first_party_service_DeploymentResourceValidationAction, first_party_service_ContentType, HttpClient, FirstPartyServiceApi };
|
|
261
|
-
|
|
262
|
-
//# debugId=AC88CC622210E15664756E2164756E21
|
package/dist/index-dqa169gp.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CAMEL_CASE_ENUM_PROPERTIES,
|
|
3
|
-
JsonSerializer,
|
|
4
|
-
JsonSerializerFactory,
|
|
5
|
-
JsonSerializerNames,
|
|
6
|
-
JsonSerializerProxy,
|
|
7
|
-
PASCAL_CASE_ENUM_PROPERTIES,
|
|
8
|
-
RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES,
|
|
9
|
-
SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES,
|
|
10
|
-
StreamSerializer
|
|
11
|
-
} from "./index-gdtpsdn7.js";
|
|
12
|
-
import"./index-1de529jm.js";
|
|
13
|
-
export {
|
|
14
|
-
CAMEL_CASE_ENUM_PROPERTIES,
|
|
15
|
-
JsonSerializer,
|
|
16
|
-
JsonSerializerFactory,
|
|
17
|
-
JsonSerializerNames,
|
|
18
|
-
JsonSerializerProxy,
|
|
19
|
-
PASCAL_CASE_ENUM_PROPERTIES,
|
|
20
|
-
RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES,
|
|
21
|
-
SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES,
|
|
22
|
-
StreamSerializer
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
//# debugId=A79DD62A6A37B41864756E2164756E21
|