@uipath/integrationservice-sdk 0.2.0 → 0.9.1

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 (31) hide show
  1. package/README.md +355 -143
  2. package/dist/index.js +22346 -3026
  3. package/dist/src/client-factory.d.ts +25 -2
  4. package/dist/src/dap/essential-config.d.ts +29 -0
  5. package/dist/src/dap/filter-builder/field-metadata.d.ts +18 -0
  6. package/dist/src/dap/filter-builder/filter-group-operator.d.ts +4 -0
  7. package/dist/src/dap/filter-builder/filter-operator.d.ts +32 -0
  8. package/dist/src/dap/filter-builder/filter-tree.d.ts +12 -0
  9. package/dist/src/dap/filter-builder/filter.d.ts +11 -0
  10. package/dist/src/dap/filter-builder/index.d.ts +47 -0
  11. package/dist/src/dap/filter-builder/uuid.d.ts +8 -0
  12. package/dist/src/dap/filter-builder/workflow-value.d.ts +9 -0
  13. package/dist/src/dap/helpers/array-extensions.d.ts +8 -0
  14. package/dist/src/dap/helpers/clr-type-mock.d.ts +17 -0
  15. package/dist/src/dap/helpers/constants.d.ts +9 -0
  16. package/dist/src/dap/helpers/enum-item.d.ts +10 -0
  17. package/dist/src/dap/helpers/event-field.d.ts +20 -0
  18. package/dist/src/dap/helpers/exceptions.d.ts +11 -0
  19. package/dist/src/dap/helpers/filter-builder/filter-helper.d.ts +19 -0
  20. package/dist/src/dap/helpers/filter-builder/jmes-helper.d.ts +68 -0
  21. package/dist/src/dap/helpers/string-extensions.d.ts +9 -0
  22. package/dist/src/dap/helpers/translation.d.ts +11 -0
  23. package/dist/src/dap/helpers/trim.d.ts +6 -0
  24. package/dist/src/dap/index.d.ts +6 -0
  25. package/dist/src/dap/input-metadata.d.ts +21 -0
  26. package/dist/src/dap/types.d.ts +105 -0
  27. package/dist/src/dap/validation/index.d.ts +41 -0
  28. package/dist/src/dap/validation/rules.d.ts +47 -0
  29. package/dist/src/dap/validation/types.d.ts +53 -0
  30. package/dist/src/index.d.ts +2 -1
  31. package/package.json +6 -4
@@ -1,11 +1,34 @@
1
1
  import { Configuration as ConnectionsConfiguration, type InitOverrideFunction } from "../generated/connections/src/runtime.js";
2
2
  import { Configuration as ElementsConfiguration } from "../generated/elements/src/runtime.js";
3
+ export interface ExecuteOperationResult {
4
+ ok: boolean;
5
+ status: number;
6
+ statusText: string;
7
+ body: unknown;
8
+ headers: Record<string, string>;
9
+ }
3
10
  export interface CreateApiClientOptions {
4
11
  tenant?: string;
5
12
  loginValidity?: number;
6
13
  }
7
14
  export declare function createConnectionsConfig(options?: CreateApiClientOptions): Promise<ConnectionsConfiguration>;
8
15
  export declare function createElementsConfig(options?: CreateApiClientOptions): Promise<ElementsConfiguration>;
9
- export declare function createApiClient<T>(ApiClass: new (config: any) => T, options?: CreateApiClientOptions): Promise<T>;
10
- export declare function executeOperation(options: CreateApiClientOptions | undefined, connectionId: string, objectName: string, httpMethod?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", body?: any, queryParams?: Record<string, string>): Promise<any>;
16
+ export declare function createApiClient<T>(ApiClass: new (config: ConnectionsConfiguration | ElementsConfiguration) => T, options?: CreateApiClientOptions): Promise<T>;
17
+ export declare function executeOperation(options: CreateApiClientOptions | undefined, connectionId: string, objectName: string, httpMethod?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", body?: unknown, queryParams?: Record<string, string>): Promise<ExecuteOperationResult>;
18
+ /**
19
+ * Fetch object metadata as JSON Schema (no connection — base/standard fields only).
20
+ */
21
+ export declare function getObjectMetadataAsSchema(options: CreateApiClientOptions | undefined, elementKey: string, objectName: string): Promise<unknown>;
22
+ /**
23
+ * Fetch object metadata as JSON Schema (with connection — enriched fields including custom).
24
+ */
25
+ export declare function getInstanceObjectMetadataAsSchema(options: CreateApiClientOptions | undefined, connectionOrInstanceId: string, elementKey: string, objectName: string): Promise<unknown>;
26
+ /**
27
+ * Fetch event operation metadata as JSON Schema (no connection).
28
+ */
29
+ export declare function getEventObjectMetadataAsSchema(options: CreateApiClientOptions | undefined, elementKey: string, operationName: string, objectName: string): Promise<unknown>;
30
+ /**
31
+ * Fetch event operation metadata as JSON Schema (with connection — enriched event fields).
32
+ */
33
+ export declare function getInstanceEventObjectMetadataAsSchema(options: CreateApiClientOptions | undefined, connectionOrInstanceId: string, elementKey: string, operationName: string, objectName: string): Promise<unknown>;
11
34
  export declare function folderOverride(folderKey?: string): InitOverrideFunction | undefined;
@@ -0,0 +1,29 @@
1
+ import type { FilterTree } from "./filter-builder/filter-tree.js";
2
+ import type { ConnectorMethodInfo } from "./types.js";
3
+ /**
4
+ * Connector key and version for the managed HTTP node (core.action.http.v2).
5
+ * The managed HTTP node proxies requests through this connector, using the
6
+ * target connector's IS connection for authentication.
7
+ */
8
+ export declare const MANAGED_HTTP_CONNECTOR_KEY = "uipath-uipath-http";
9
+ export declare const MANAGED_HTTP_CONNECTOR_VERSION = "1.4.50";
10
+ /**
11
+ * Build the essential-only configuration blob for an activity connector node.
12
+ * DAP re-fetches optional data (fieldsContainer, caches) on open.
13
+ */
14
+ export declare function buildActivityEssentialConfiguration(instanceParameters: Record<string, unknown>, methodInfo: ConnectorMethodInfo): Record<string, unknown>;
15
+ /**
16
+ * Build the essential-only configuration blob for a managed HTTP node
17
+ * (core.action.http.v2). The managed HTTP node always proxies through the
18
+ * uipath-uipath-http connector with a fixed POST /http-request shape.
19
+ */
20
+ export declare function buildManagedHttpEssentialConfiguration(): Record<string, unknown>;
21
+ /**
22
+ * Build the essential-only configuration blob for a trigger connector node.
23
+ * Trigger essentials include filter (user-configured, not recoverable from connector)
24
+ * but omit operation, httpMethod, path (not applicable to triggers).
25
+ *
26
+ * The `filter` tree is the design-time source of truth for the trigger's
27
+ * conditions;
28
+ */
29
+ export declare function buildTriggerEssentialConfiguration(instanceParameters: Record<string, unknown>, filter?: FilterTree | null): Record<string, unknown>;
@@ -0,0 +1,18 @@
1
+ import type { FilterTree } from "./filter-tree.js";
2
+ /**
3
+ * Event field metadata needed to serialize a filter to JMESPath.
4
+ *
5
+ * Only carries what the generator needs (name + primitive type kind). The
6
+ * caller extracts this from `TriggerObjectMetadata.fields` before invoking
7
+ * {@link buildFilter}.
8
+ */
9
+ export type FilterFieldType = "string" | "number" | "integer" | "boolean" | "date-time";
10
+ export type FilterFieldMetadata = {
11
+ name: string;
12
+ type: FilterFieldType;
13
+ };
14
+ /** Result of building a filter: both the normalized tree and derived JMESPath. */
15
+ export type BuiltFilter = {
16
+ filter: FilterTree;
17
+ filterExpression: string;
18
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum FilterGroupOperator {
2
+ And = 0,
3
+ Or = 1
4
+ }
@@ -0,0 +1,32 @@
1
+ export declare enum FilterOperator {
2
+ Equals = "Equals",
3
+ NotEquals = "NotEquals",
4
+ LessThan = "LessThan",
5
+ LessThanOrEqual = "LessThanOrEqual",
6
+ GreaterThan = "GreaterThan",
7
+ GreaterThanOrEqual = "GreaterThanOrEqual",
8
+ Contains = "Contains",
9
+ NotContains = "NotContains",
10
+ IsOneOf = "IsOneOf",
11
+ IsNotOneOf = "IsNotOneOf",
12
+ StartsWith = "StartsWith",
13
+ NotStartsWith = "NotStartsWith",
14
+ EndsWith = "EndsWith",
15
+ NotEndsWith = "NotEndsWith",
16
+ IsEmpty = "IsEmpty",
17
+ IsNotEmpty = "IsNotEmpty",
18
+ Is = "Is",
19
+ IsNot = "IsNot",
20
+ DateTimeEquals = "DateTimeEquals",
21
+ DateTimeNotEqual = "DateTimeNotEqual",
22
+ After = "After",
23
+ AfterOrEqual = "AfterOrEqual",
24
+ Before = "Before",
25
+ BeforeOrEqual = "BeforeOrEqual",
26
+ In = "In",
27
+ NotIn = "NotIn",
28
+ NotLike = "NotLike",
29
+ Like = "Like",
30
+ IsNotNull = "IsNotNull",
31
+ IsNull = "IsNull"
32
+ }
@@ -0,0 +1,12 @@
1
+ import { Filter } from "./filter.js";
2
+ import type { FilterGroupOperator } from "./filter-group-operator.js";
3
+ export declare class FilterTree {
4
+ constructor(groupOperator: FilterGroupOperator | null, index: number, filters: Filter[], uuId: string | null);
5
+ readonly groupOperator: FilterGroupOperator | null;
6
+ readonly index: number;
7
+ readonly uuId: string | null;
8
+ readonly filters: Filter[];
9
+ readonly groups: FilterTree[];
10
+ static factory(serialized: string): FilterTree;
11
+ private static _reviver;
12
+ }
@@ -0,0 +1,11 @@
1
+ import type { FilterOperator } from "./filter-operator.js";
2
+ import { WorkflowValue } from "./workflow-value.js";
3
+ export declare class Filter {
4
+ constructor(id: string, operator: FilterOperator | null, value: WorkflowValue | null, uiId: string | null);
5
+ readonly id: string;
6
+ readonly uiId: string | null;
7
+ readonly operator: FilterOperator | null;
8
+ value: WorkflowValue | null;
9
+ static factory(serialized: string): Filter;
10
+ private static _reviver;
11
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * IS trigger filter builder — produces the paired `filter` tree and
3
+ * derived `filterExpression` that Studio Web and the Maestro runtime consume.
4
+ *
5
+ * The model files in this folder mirror Studio Web's
6
+ * `connector-activity/is-activities/runtime/models/filter-builder` 1:1, and
7
+ * the actual JMESPath generation is delegated to `JmesHelper` under
8
+ * `../helpers/filter-builder/jmes-helper.ts` (also a verbatim port of SW).
9
+ *
10
+ * Studio Web generates the JMESPath `filterExpression` from the structured
11
+ * `filter` tree; it cannot parse an expression back into the tree. Before
12
+ * MST-8802, the CLI wrote only `filterExpression` and left `filter: null`,
13
+ * which caused SW to show an empty filter UI and silently drop the user's
14
+ * configuration on save. The CLI must now accept the filter tree as input
15
+ * and emit both fields in lockstep.
16
+ */
17
+ export type { BuiltFilter, FilterFieldMetadata, FilterFieldType, } from "./field-metadata.js";
18
+ export { Filter } from "./filter.js";
19
+ export { FilterGroupOperator } from "./filter-group-operator.js";
20
+ export { FilterOperator } from "./filter-operator.js";
21
+ export { FilterTree } from "./filter-tree.js";
22
+ export { getUuid } from "./uuid.js";
23
+ export { WorkflowValue } from "./workflow-value.js";
24
+ import type { BuiltFilter, FilterFieldMetadata } from "./field-metadata.js";
25
+ import type { FilterTree } from "./filter-tree.js";
26
+ /**
27
+ * Raised when the caller hands the builder a filter feature we haven't
28
+ * ported yet (array fields, expression/non-literal values, enum arrays, etc.).
29
+ * Kept as a distinct error type so callers can surface a clear message rather
30
+ * than seeing a raw `InvalidOperationException` / `ArgumentNullException`
31
+ * bubble out from the SW helpers.
32
+ */
33
+ export declare class FilterNotSupportedError extends Error {
34
+ constructor(message: string);
35
+ }
36
+ /**
37
+ * Build the paired `filter` tree and `filterExpression` for an IS trigger.
38
+ *
39
+ * Generation is delegated to `JmesHelper.buildFilterExpression` (verbatim SW
40
+ * port) so the CLI's expression output stays byte-identical to SW's.
41
+ */
42
+ export declare function buildFilter(tree: FilterTree, fields: readonly FilterFieldMetadata[]): BuiltFilter;
43
+ /**
44
+ * Back-compat helper for callers that only need the expression string.
45
+ * Prefer `buildFilter` when the normalized tree is also needed.
46
+ */
47
+ export declare function buildFilterExpression(tree: FilterTree, fields: readonly FilterFieldMetadata[]): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generate a UUID for filter tree group/leaf identifiers.
3
+ *
4
+ * Ported verbatim from Studio Web's `getUuid` helper to keep SW and CLI in
5
+ * sync — prefer the platform `crypto.randomUUID()` when available, fall back
6
+ * to the `uuid` package otherwise.
7
+ */
8
+ export declare function getUuid(): string;
@@ -0,0 +1,9 @@
1
+ export declare class WorkflowValue {
2
+ isLiteral: boolean;
3
+ readonly rawString: string | null;
4
+ value: unknown | null;
5
+ constructor(value: unknown | null);
6
+ constructor(value: unknown | null, isLiteral: boolean);
7
+ static factory(serialized: string): WorkflowValue;
8
+ static canBeWorkflowValue(obj: unknown): boolean;
9
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Local shim for SW's `ArrayExtensions`. Mirrors
3
+ * `@sw/.../extension-methods/array-extensions` — only the members the
4
+ * filter-builder helpers use.
5
+ */
6
+ export declare class ArrayExtensions {
7
+ static any<T>(arr: readonly T[] | null | undefined): boolean;
8
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * NO-OP
3
+ */
4
+ export declare class ClrTypeMock {
5
+ static readonly Int = "Int";
6
+ static readonly Long = "Long";
7
+ static readonly Double = "Double";
8
+ static readonly Float = "Float";
9
+ static readonly Boolean = "Boolean";
10
+ static readonly String = "String";
11
+ static readonly DateTimeOffset = "DateTimeOffset";
12
+ static readonly Enum: ClrTypeMock;
13
+ readonly name: string;
14
+ readonly isArray: boolean;
15
+ constructor(name: string, isArray?: boolean);
16
+ isSame(other: ClrTypeMock | string | null | undefined): boolean;
17
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Local shim for SW's runtime-helpers `Constants`. Mirrors
3
+ * `@sw/.../runtime/helpers/constants`. Only carries the two markers the
4
+ * filter-builder helpers use.
5
+ */
6
+ export declare class Constants {
7
+ static readonly FieldArrayMarker = "[*]";
8
+ static readonly ChunkSeparator = ".";
9
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * TEMP no-op shim for SW's `EnumItem` (mirrors
3
+ * `@sw/.../runtime/models/enum-item`). The CLI filter-builder does not author
4
+ * enum-typed fields, so this carries only the `value` slot the helpers dereference.
5
+ * Revisit if/when enum filter support is ported.
6
+ */
7
+ export declare class EnumItem {
8
+ readonly value: unknown;
9
+ constructor(value: unknown);
10
+ }
@@ -0,0 +1,20 @@
1
+ import { ClrTypeMock } from "./clr-type-mock.js";
2
+ /**
3
+ * Local shim for SW's `EventField` (mirrors
4
+ * `@sw/.../runtime/models/connector-metadata/event-field`). SW's class carries
5
+ * a richer connector-metadata descriptor; this shim keeps the members the
6
+ * filter-builder helpers read (`name`, `clrType`, `type`, `mask`).
7
+ */
8
+ export declare class EventField {
9
+ readonly name: string;
10
+ readonly clrType: ClrTypeMock;
11
+ readonly type?: string;
12
+ readonly mask: string | null;
13
+ constructor(name: string, clrType: ClrTypeMock, type?: string, mask?: string | null);
14
+ /**
15
+ * TEMP no-op: SW synthesizes a string-typed event-field for connectors with
16
+ * `hasStaticLeftOperandFilterBuilder` (freeform left-operand). The CLI does
17
+ * not author freeform filters yet, so this returns a plain string field.
18
+ */
19
+ static createFreeform(name: string): EventField;
20
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Local shim for SW's old-infra exception classes. Mirrors
3
+ * `@sw/.../old-infra/invalid-operation-exception` and
4
+ * `@sw/.../old-infra/argument-null-exception`.
5
+ */
6
+ export declare class InvalidOperationException extends Error {
7
+ constructor(message: string);
8
+ }
9
+ export declare class ArgumentNullException extends Error {
10
+ constructor(message: string);
11
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Ported verbatim from Studio Web:
3
+ * src/Client/app/packages/connector-activity/is-activities/runtime/helpers/filter-builder/filter-helper.ts
4
+ *
5
+ * Only the import paths have been rewritten to point at local shims under
6
+ * `./` — the method bodies are intentionally kept identical so the CLI and
7
+ * SW stay in sync. TEMP no-ops are annotated inline.
8
+ */
9
+ import type { FilterGroupOperator } from "../../filter-builder/filter-group-operator.js";
10
+ import type { WorkflowValue } from "../../filter-builder/workflow-value.js";
11
+ import { ClrTypeMock } from "../clr-type-mock.js";
12
+ export declare class FilterHelper {
13
+ static supportsNumericFilter(type: ClrTypeMock): boolean;
14
+ static serializeDateTimeOffset(value: unknown | null, _mask: string | null): string;
15
+ static aggregateExpressions(expressions: string[], op: FilterGroupOperator, transformer: (input: string) => string, isGroup: boolean, logicalOperators: Map<FilterGroupOperator, string>): string;
16
+ static resolveValuesCollection(value: WorkflowValue | null): unknown[];
17
+ static convertCollectionToStringExpression(values: unknown[], quoteType?: string): string;
18
+ static convertValueToStringExpression(value: unknown, quoteType?: string): string | null;
19
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Ported verbatim from Studio Web:
3
+ * src/Client/app/packages/connector-activity/is-activities/runtime/helpers/filter-builder/jmes-helper.ts
4
+ *
5
+ * Only import paths are rewritten to local shims / models. Method bodies are
6
+ * kept identical to SW so the two implementations produce byte-identical
7
+ * JMESPath output. TEMP no-ops are annotated inline in their respective shims
8
+ * (`addExpressionWrapper`, `FilterHelper.serializeDateTimeOffset`, `EventField.createFreeform`).
9
+ */
10
+ import { FilterGroupOperator } from "../../filter-builder/filter-group-operator.js";
11
+ import { FilterOperator } from "../../filter-builder/filter-operator.js";
12
+ import type { FilterTree } from "../../filter-builder/filter-tree.js";
13
+ import type { WorkflowValue } from "../../filter-builder/workflow-value.js";
14
+ import { ClrTypeMock } from "../clr-type-mock.js";
15
+ import { EventField } from "../event-field.js";
16
+ import { type TranslationConfiguration } from "../translation.js";
17
+ /**
18
+ * Options controlling how {@link JmesHelper.buildFilterExpression} handles filter rows whose
19
+ * field name is not present in the supplied event-field schema.
20
+ */
21
+ type BuildFilterExpressionOptions = {
22
+ /**
23
+ * When true, a missing event-field is treated as a synthesized string-typed freeform field
24
+ * rather than throwing {@link ArgumentNullException}. This is the mode used by connectors
25
+ * that declare `hasStaticLeftOperandFilterBuilder` — they ship no schema and let the user
26
+ * type the left-operand field name directly.
27
+ */
28
+ allowFreeformFields?: boolean;
29
+ };
30
+ export declare class JmesHelper {
31
+ static readonly operatorMappings: Map<FilterOperator, string>;
32
+ static readonly functionMappings: Map<FilterOperator, string>;
33
+ static readonly logicalOperatorMappings: Map<FilterGroupOperator, string>;
34
+ static buildMandatoryFilterExpression(fieldArguments: Map<string, unknown>): string;
35
+ /** Convert the filter tree to JMES string */
36
+ static buildFilterExpression(filters: FilterTree, filterCriteria: EventField[], translationConfiguration?: TranslationConfiguration, options?: BuildFilterExpressionOptions): {
37
+ jmesExpression: string;
38
+ isLiteral: boolean;
39
+ };
40
+ /**
41
+ * Builds the JMES fragments for a single group's filters. Rows whose field name is missing
42
+ * in the supplied schema are either synthesized as freeform string fields (when
43
+ * `allowFreeformFields` is on) or rejected via {@link ArgumentNullException}. Rows without
44
+ * an operator or without an id are skipped — these represent UI-only in-progress rows that
45
+ * must not appear in the persisted expression.
46
+ */
47
+ private static _buildGroupConditions;
48
+ /** Converts a filter field to a corresponding JMESPath expression. */
49
+ private static _buildJmesPathExpression;
50
+ /** Compose an array filter for In/NotIn. */
51
+ static composeArrayInExpression(field: string, values: unknown[], isNumeric: boolean, negate: boolean): string;
52
+ static composeArrayJmesPathExpression(field: string, op: FilterOperator, value: unknown | null, fieldType: ClrTypeMock, mask?: string | null): string;
53
+ private static _composeArrayExpression;
54
+ static is(field: string, value: boolean): string;
55
+ static isNot(field: string, value: boolean): string;
56
+ static isEmpty(field: string): string;
57
+ static isNotEmpty(field: string): string;
58
+ static isOneOf(field: string, values: unknown[], isNumeric: boolean): string;
59
+ static isNotOneOf(field: string, values: unknown[], isNumeric: boolean): string;
60
+ private static _toJsonArray;
61
+ static composeJmesPathExpression(field: string, op: FilterOperator, value: WorkflowValue | null, fieldType: ClrTypeMock, mask?: string | null, translationConfiguration?: TranslationConfiguration): string;
62
+ private static _composeSingleValueExpression;
63
+ static aggregateExpressions(expressions: string[], op: FilterGroupOperator): string;
64
+ static aggregateExpressionGroup(expressions: string[], op: FilterGroupOperator): string;
65
+ static aggregateFinalExpressions(expressions: string[], op: FilterGroupOperator): string;
66
+ private static _getSubExpression;
67
+ }
68
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Local shim for SW's `StringExtensions`. Covers only the members the
3
+ * filter-builder helpers use. Mirrors `@sw/.../extension-methods/string-extensions`.
4
+ */
5
+ export declare class StringExtensions {
6
+ static readonly empty = "";
7
+ static isNullOrEmpty(s: string | null | undefined): boolean;
8
+ static isNullOrWhiteSpace(s: string | null | undefined): boolean;
9
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * TEMP no-op shims for SW translation utilities:
3
+ * - `TranslationConfiguration` from `@uipath/studio-web-unified-build`
4
+ * - `addExpressionWrapper` from `@sw/translation/translators/utils-translators`
5
+ *
6
+ * The CLI filter-builder only emits literal-value expressions, so the
7
+ * wrapper used by SW for non-literal (expression) values is never required.
8
+ * Revisit if/when expression-value support is ported.
9
+ */
10
+ export type TranslationConfiguration = unknown;
11
+ export declare function addExpressionWrapper(value: string | undefined, _translationConfiguration?: TranslationConfiguration): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Local shim for `lodash-es`'s `trim(string, chars)` — avoids pulling lodash
3
+ * into the SDK bundle. Strips any leading/trailing occurrence of any character
4
+ * in `chars`; if `chars` is omitted, trims whitespace like native `String.trim`.
5
+ */
6
+ export declare function trim(value: string, chars?: string): string;
@@ -0,0 +1,6 @@
1
+ export { buildActivityEssentialConfiguration, buildManagedHttpEssentialConfiguration, buildTriggerEssentialConfiguration, MANAGED_HTTP_CONNECTOR_KEY, MANAGED_HTTP_CONNECTOR_VERSION, } from "./essential-config.js";
2
+ export * from "./filter-builder/index.js";
3
+ export { buildInputMetadata, extractMultipartParameters, } from "./input-metadata.js";
4
+ export type { ConnectorMethodInfo, FieldReference, InputMetadata, ISField, ISFieldMethod, ISMetadata, ISMetadataParam, MultipartParam, TriggerField, TriggerFieldEvent, TriggerObjectMetadata, } from "./types.js";
5
+ export type { ConnectorValidationContext, Issue, IssueType, ValidationRule, } from "./validation/index.js";
6
+ export { DEFAULT_RULES, validateConfiguration, validateConnectionId, validateEndpoint, validateEventMode, validateEventType, validateFolderKey, validateHttpMethod, validateIntSvcNode, validateMethodInMetadata, validateObjectName, validatePathTemplateParams, validateRequiredEventParameters, validateRequiredFields, validateRequiredParameters, } from "./validation/index.js";
@@ -0,0 +1,21 @@
1
+ import type { InputMetadata, ISMetadataParam, MultipartParam } from "./types.js";
2
+ /**
3
+ * Extract multipart parameters from IS metadata parameters.
4
+ * These are fields with type "multipart" (e.g. file attachments).
5
+ *
6
+ * TODO: file-type multipart params can carry a `value` binding
7
+ * (e.g. "=js:($vars.start.output.fileToAdd)") for attachments.
8
+ * Currently not supported — cli debug may not support file params either.
9
+ */
10
+ export declare function extractMultipartParameters(params: ISMetadataParam[]): MultipartParam[];
11
+ /**
12
+ * Build inputMetadata from multipart params and operation type.
13
+ *
14
+ * When `maxPageSize` is provided (from `ConnectorMethodInfo.pagination.maxPageSize`
15
+ * or connector-level configurations), it is used for list operations instead of the
16
+ * default 1000 cap. StudioWeb resolves this from
17
+ * `objectMethod.Pagination.MaxPageSize ?? connectorConfigurations.GetMaxPageSize()`.
18
+ *
19
+ * Returns undefined when there's nothing to report.
20
+ */
21
+ export declare function buildInputMetadata(multipartParams: MultipartParam[], operation: string, maxPageSize?: number): InputMetadata | undefined;
@@ -0,0 +1,105 @@
1
+ /**
2
+ * DAP (Design-time Automation Platform) types for Integration Service metadata.
3
+ *
4
+ * These types represent the shape of metadata returned by the IS Elements API
5
+ * and are used by essential configuration builders across multiple tools
6
+ * (flow-tool, case-tool, coded-apps, etc.).
7
+ */
8
+ export type ISMetadataParam = {
9
+ name: string;
10
+ description: string;
11
+ /** Where this parameter is sent: "query", "path", "body", or "multipart". */
12
+ type?: string;
13
+ dataType: string;
14
+ required: boolean;
15
+ curated: boolean;
16
+ displayName: string;
17
+ reference?: Record<string, unknown>;
18
+ defaultValue?: unknown;
19
+ };
20
+ export type MultipartParam = {
21
+ name: string;
22
+ dataType: string;
23
+ };
24
+ export type InputMetadata = {
25
+ type?: string;
26
+ multipart?: {
27
+ bodyFieldName: string;
28
+ };
29
+ operation?: string;
30
+ pagination?: {
31
+ maxPageSize: number;
32
+ };
33
+ };
34
+ export type ConnectorMethodInfo = {
35
+ operation: string;
36
+ description: string;
37
+ method: string;
38
+ parameters: ISMetadataParam[];
39
+ path: string;
40
+ operationId: string;
41
+ /** Pagination details from IS metadata (per-operation). */
42
+ pagination?: {
43
+ maxPageSize?: number;
44
+ };
45
+ };
46
+ export type FieldReference = {
47
+ objectName: string;
48
+ lookupValue: string;
49
+ lookupNames?: string[];
50
+ path?: string;
51
+ childPath?: string;
52
+ };
53
+ export type ISFieldMethod = {
54
+ request: boolean;
55
+ requestCurated?: boolean;
56
+ response: boolean;
57
+ responseCurated?: boolean;
58
+ required: boolean;
59
+ };
60
+ export type ISField = {
61
+ name: string;
62
+ type: string;
63
+ displayName: string;
64
+ description?: string;
65
+ method: Record<string, ISFieldMethod>;
66
+ enum?: unknown[];
67
+ reference?: FieldReference;
68
+ };
69
+ export type ISMetadata = {
70
+ fields?: Record<string, ISField> | ISField[];
71
+ metadata?: {
72
+ method?: Record<string, ConnectorMethodInfo>;
73
+ };
74
+ };
75
+ export type TriggerFieldEvent = {
76
+ name: string;
77
+ curated: boolean;
78
+ required: boolean;
79
+ designOverrides?: {
80
+ displayName?: string;
81
+ description?: string;
82
+ };
83
+ };
84
+ export type TriggerField = {
85
+ name: string;
86
+ type: string;
87
+ displayName: string;
88
+ custom?: string;
89
+ events?: Record<string, TriggerFieldEvent>;
90
+ isCuratedEventField?: boolean;
91
+ reference?: FieldReference;
92
+ enum?: unknown[];
93
+ order?: number;
94
+ description?: string;
95
+ };
96
+ export type TriggerObjectMetadata = {
97
+ name: string;
98
+ path: string;
99
+ type: string;
100
+ subType: string;
101
+ elementKey: string;
102
+ eventMode: string;
103
+ custom: string;
104
+ fields: Record<string, TriggerField>;
105
+ };
@@ -0,0 +1,41 @@
1
+ export { validateConfiguration, validateConnectionId, validateEndpoint, validateEventMode, validateEventType, validateFolderKey, validateHttpMethod, validateMethodInMetadata, validateObjectName, validatePathTemplateParams, validateRequiredEventParameters, validateRequiredFields, validateRequiredParameters, } from "./rules.js";
2
+ export type { ConnectorValidationContext, Issue, IssueType, ValidationRule, } from "./types.js";
3
+ import type { ConnectorValidationContext, Issue, ValidationRule } from "./types.js";
4
+ /**
5
+ * Default rule set — structural checks first, then metadata-aware.
6
+ * Metadata-aware rules gracefully return [] when metadata is absent.
7
+ *
8
+ * Frozen via `readonly` to prevent cross-consumer mutation.
9
+ * Compose a new array to add or remove rules:
10
+ * `validateIntSvcNode(ctx, [...DEFAULT_RULES, myRule])`
11
+ */
12
+ export declare const DEFAULT_RULES: readonly ValidationRule[];
13
+ /**
14
+ * Run validation rules against an Integration Service connector node.
15
+ *
16
+ * @param context Surface-agnostic node data (flow JSON, XAML, BPMN, etc.)
17
+ * @param rules Rules to run — defaults to {@link DEFAULT_RULES}.
18
+ * Pass a custom array to add, remove, or reorder checks.
19
+ * @returns Issues found — empty array means the node is valid.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * import { validateIntSvcNode, type ConnectorValidationContext } from "@uipath/integrationservice-sdk";
24
+ *
25
+ * const issues = validateIntSvcNode({
26
+ * nodeKind: "activity",
27
+ * connectionId: detail.connectionId,
28
+ * folderKey: detail.connectionFolderKey,
29
+ * objectName,
30
+ * httpMethod: detail.method,
31
+ * endpoint: detail.endpoint,
32
+ * bodyParameters: detail.bodyParameters,
33
+ * pathParameters: detail.pathParameters,
34
+ * configuration: detail.configuration,
35
+ * methodInfo, // from fetchConnectorMetadata
36
+ * metadata, // from fetchConnectorMetadata
37
+ * });
38
+ * detail.errorState = { issues };
39
+ * ```
40
+ */
41
+ export declare function validateIntSvcNode(context: ConnectorValidationContext, rules?: readonly ValidationRule[]): Issue[];
@@ -0,0 +1,47 @@
1
+ import type { ConnectorValidationContext, Issue } from "./types.js";
2
+ /** ConnectionId must be present and non-empty. Maps to DAP-RT-1002. */
3
+ export declare function validateConnectionId(context: ConnectorValidationContext): Issue[];
4
+ /** FolderKey must be present and non-empty. */
5
+ export declare function validateFolderKey(context: ConnectorValidationContext): Issue[];
6
+ /** Activity nodes must have a valid HTTP method. Maps to DAP-RT-1100. */
7
+ export declare function validateHttpMethod(context: ConnectorValidationContext): Issue[];
8
+ /** Activity nodes must have an endpoint starting with "/". */
9
+ export declare function validateEndpoint(context: ConnectorValidationContext): Issue[];
10
+ /** ObjectName must be present for both activities and triggers. Maps to DAP-RT-1053. */
11
+ export declare function validateObjectName(context: ConnectorValidationContext): Issue[];
12
+ /** Trigger nodes must have an eventMode. */
13
+ export declare function validateEventMode(context: ConnectorValidationContext): Issue[];
14
+ /** Trigger nodes must have an eventType (operation name). Maps to DAP-RT-1053. */
15
+ export declare function validateEventType(context: ConnectorValidationContext): Issue[];
16
+ /**
17
+ * Configuration blob must exist and be parseable JSON
18
+ * with an essentialConfiguration envelope. Maps to DAP-RT-1000.
19
+ */
20
+ export declare function validateConfiguration(context: ConnectorValidationContext): Issue[];
21
+ /**
22
+ * Path template variables (e.g. `/{conversationId}`) must have
23
+ * matching entries in pathParameters.
24
+ */
25
+ export declare function validatePathTemplateParams(context: ConnectorValidationContext): Issue[];
26
+ /**
27
+ * The configured HTTP method must exist in the IS metadata method map.
28
+ * Maps to DAP-DT-2201.
29
+ */
30
+ export declare function validateMethodInMetadata(context: ConnectorValidationContext): Issue[];
31
+ /**
32
+ * Required method parameters (path, query, body) from IS metadata must
33
+ * have values in the corresponding parameter map. Maps to DAP-RT-1003.
34
+ */
35
+ export declare function validateRequiredParameters(context: ConnectorValidationContext): Issue[];
36
+ /**
37
+ * Required fields from IS metadata (fields with method[httpMethod].required
38
+ * && method[httpMethod].request) must have values in bodyParameters.
39
+ * Maps to DAP-RT-1003.
40
+ */
41
+ export declare function validateRequiredFields(context: ConnectorValidationContext): Issue[];
42
+ /**
43
+ * Required event parameters from trigger IS metadata must have values
44
+ * in eventParameters. Uses `field.events[eventType].required` to
45
+ * determine which fields are mandatory. Maps to DAP-RT-1003.
46
+ */
47
+ export declare function validateRequiredEventParameters(context: ConnectorValidationContext): Issue[];