@flowrunner/cli 0.1.12 → 0.1.13-dev.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 (59) hide show
  1. package/ai-docs/instructions/service-code-format/02-zod-types.md +3 -1
  2. package/ai-docs/instructions/service-code-format/05-dictionaries.md +59 -1
  3. package/ai-docs/instructions/service-code-format/06-oauth2.md +29 -1
  4. package/ai-docs/instructions/service-code-format/09-realtime-triggers.md +104 -5
  5. package/ai-docs/instructions/service-code-format/11-output-model.md +6 -0
  6. package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +6 -3
  7. package/dist/cli.js +10673 -85
  8. package/dist/cli.js.map +4 -4
  9. package/dist/index.js +10642 -78
  10. package/dist/index.js.map +4 -4
  11. package/dist/types/flow-extension-runner/src/v2/dictionaries/dictionary-method.d.ts +1 -0
  12. package/dist/types/flow-extension-runner/src/v2/model/field-mapper.d.ts +4 -2
  13. package/dist/types/flow-extension-runner/src/v2/model/params-model.d.ts +2 -2
  14. package/dist/types/flow-extension-runner/src/v2/params/index.d.ts +1 -0
  15. package/dist/types/flow-extension-runner/src/v2/params/json/encode.d.ts +7 -1
  16. package/dist/types/flow-extension-runner/src/v2/params/schema/dictionary-binding.d.ts +37 -0
  17. package/dist/types/flow-extension-runner/src/v2/params/zod.d.ts +7 -5
  18. package/dist/types/flow-extension-runner/src/v2/realtime-triggers/trigger-method.d.ts +12 -2
  19. package/dist/types/flow-extension-runner/src/v2/realtime-triggers/types.d.ts +11 -2
  20. package/dist/types/flow-extension-runner/src/v2/types.d.ts +1 -0
  21. package/dist/types/shared/src/constants/error-codes.d.ts +3 -0
  22. package/dist/types/shared/src/constants/index.d.ts +1 -0
  23. package/dist/types/shared/src/constants/notification-types.d.ts +59 -0
  24. package/dist/types/shared/src/constants/oauth-connection-error.d.ts +3 -0
  25. package/dist/types/shared/src/errors/api.d.ts +11 -0
  26. package/dist/types/shared/src/errors/index.d.ts +1 -0
  27. package/dist/types/shared/src/errors/oauth-connection.d.ts +4 -0
  28. package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +26 -0
  29. package/dist/types/shared/src/scheme/integration-connection/dto.d.ts +46 -4
  30. package/dist/types/shared/src/scheme/notifications/dto.d.ts +1 -0
  31. package/dist/types/shared/src/scheme/notifications/rest.d.ts +2 -0
  32. package/dist/types/shared/src/scheme/shared-extensions/list.d.ts +52 -11
  33. package/dist/types/shared/src/scheme/shared-extensions/workspace-stack.d.ts +2 -2
  34. package/package.json +1 -4
  35. package/runtime/index.js +10631 -57
  36. package/runtime/index.js.map +4 -4
  37. package/runtime/types/flow-extension-runner/src/v2/dictionaries/dictionary-method.d.ts +1 -0
  38. package/runtime/types/flow-extension-runner/src/v2/model/field-mapper.d.ts +4 -2
  39. package/runtime/types/flow-extension-runner/src/v2/model/params-model.d.ts +2 -2
  40. package/runtime/types/flow-extension-runner/src/v2/params/index.d.ts +1 -0
  41. package/runtime/types/flow-extension-runner/src/v2/params/json/encode.d.ts +7 -1
  42. package/runtime/types/flow-extension-runner/src/v2/params/schema/dictionary-binding.d.ts +37 -0
  43. package/runtime/types/flow-extension-runner/src/v2/params/zod.d.ts +7 -5
  44. package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/trigger-method.d.ts +12 -2
  45. package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/types.d.ts +11 -2
  46. package/runtime/types/flow-extension-runner/src/v2/types.d.ts +1 -0
  47. package/runtime/types/shared/src/constants/error-codes.d.ts +3 -0
  48. package/runtime/types/shared/src/constants/index.d.ts +1 -0
  49. package/runtime/types/shared/src/constants/notification-types.d.ts +59 -0
  50. package/runtime/types/shared/src/constants/oauth-connection-error.d.ts +3 -0
  51. package/runtime/types/shared/src/errors/api.d.ts +11 -0
  52. package/runtime/types/shared/src/errors/index.d.ts +1 -0
  53. package/runtime/types/shared/src/errors/oauth-connection.d.ts +4 -0
  54. package/runtime/types/shared/src/scheme/flowrunner/java.dto.d.ts +26 -0
  55. package/runtime/types/shared/src/scheme/integration-connection/dto.d.ts +46 -4
  56. package/runtime/types/shared/src/scheme/notifications/dto.d.ts +1 -0
  57. package/runtime/types/shared/src/scheme/notifications/rest.d.ts +2 -0
  58. package/runtime/types/shared/src/scheme/shared-extensions/list.d.ts +52 -11
  59. package/runtime/types/shared/src/scheme/shared-extensions/workspace-stack.d.ts +2 -2
@@ -11,6 +11,7 @@ export declare class DictionaryMethod extends ExtensionMethod {
11
11
  private readonly props;
12
12
  readonly criteria: MethodParams;
13
13
  readonly result: ResultSpec;
14
+ readonly criteriaAliases?: Record<string, string[]>;
14
15
  constructor(extension: Extension, props: DictionaryProps);
15
16
  get id(): string;
16
17
  get name(): string;
@@ -1,10 +1,12 @@
1
1
  import type { ConfigItem } from '../../common/types';
2
+ import { DictionaryScope } from '../params/schema/dictionary-binding';
2
3
  import { type AnyZod } from '../params/schema/introspect';
3
4
  import type { SharedExtensionMetaInfoArg, SharedExtensionParam } from './model-types';
4
5
  export interface FieldToParamOptions {
5
6
  nested?: boolean;
7
+ scope?: DictionaryScope;
6
8
  }
7
9
  export declare function fieldToParam(name: string, schema: AnyZod, options?: FieldToParamOptions): SharedExtensionParam;
8
- export declare function propertiesOf(objectCore: AnyZod | undefined): SharedExtensionParam[];
9
- export declare function fieldToArg(name: string, schema: AnyZod): SharedExtensionMetaInfoArg;
10
+ export declare function propertiesOf(objectCore: AnyZod | undefined, scope?: DictionaryScope): SharedExtensionParam[];
11
+ export declare function fieldToArg(name: string, schema: AnyZod, scope?: DictionaryScope): SharedExtensionMetaInfoArg;
10
12
  export declare function fieldToConfigItem(name: string, schema: AnyZod): ConfigItem;
@@ -1,5 +1,5 @@
1
1
  import type { ConfigItem } from '../../common/types';
2
- import type { ConfigParams, MethodParams, Params } from '../params';
2
+ import { type ConfigParams, DictionaryScope, type MethodParams, type Params } from '../params';
3
3
  import type { SharedExtensionMetaInfoArg, SharedExtensionParam } from './model-types';
4
4
  export declare function toBodyParams(params: MethodParams): SharedExtensionParam[];
5
5
  export declare function toArgs(params: MethodParams): Record<string, SharedExtensionMetaInfoArg>;
@@ -12,5 +12,5 @@ export declare function toArgs(params: MethodParams): Record<string, SharedExten
12
12
  * must stay compatible with declares them exactly this way.
13
13
  */
14
14
  export declare function toOpaqueBodyParams(params: MethodParams): SharedExtensionParam[];
15
- export declare function toProperties(params: Params): SharedExtensionParam[];
15
+ export declare function toProperties(params: Params, scope?: DictionaryScope): SharedExtensionParam[];
16
16
  export declare function toConfigItems(config: ConfigParams): ConfigItem[];
@@ -4,6 +4,7 @@ export { Params } from './params';
4
4
  export type { NormalizedInput, SchemaSource, ZodIssue, ZodSchema } from './types';
5
5
  export * from './widget-types';
6
6
  export { describeField, FORMAT_DESCRIPTIONS, TYPE_DESCRIPTIONS, WIDGET_DESCRIPTIONS, } from './schema/defaults';
7
+ export { type DictionaryBinding, DictionaryScope, publishedBinding, type ResolvedDependsOn, resolveDependsOn, } from './schema/dictionary-binding';
7
8
  export type { AnyZod, Inspected, WidgetInfo } from './schema/introspect';
8
9
  export { deriveWidget, fieldLabels, inspect, shapeEntries } from './schema/introspect';
9
10
  export { humanizeKey, labelOf } from './schema/labels';
@@ -1,3 +1,4 @@
1
+ import { DictionaryScope } from '../schema/dictionary-binding';
1
2
  import { type AnyZod } from '../schema/introspect';
2
3
  import { type FieldJSON, type ParamsSchemaJSON } from './types';
3
4
  /**
@@ -7,6 +8,11 @@ import { type FieldJSON, type ParamsSchemaJSON } from './types';
7
8
  */
8
9
  export interface EncodeParamsOptions {
9
10
  loaderIdOf?: (fieldName: string) => string;
11
+ /**
12
+ * What the level ABOVE these fields sees, for their `.dictionary()` bindings — the owner's params, when the
13
+ * fields are a loader's. Omitted, the fields are a method's top level.
14
+ */
15
+ scope?: DictionaryScope;
10
16
  }
11
17
  /**
12
18
  * One declared field → its wire form.
@@ -16,7 +22,7 @@ export interface EncodeParamsOptions {
16
22
  * added before descending and removed after, which makes the check below a cycle test rather than a
17
23
  * deduplication.
18
24
  */
19
- export declare function encodeField(name: string, schema: AnyZod, seen?: Set<unknown>, loaderId?: string): FieldJSON;
25
+ export declare function encodeField(name: string, schema: AnyZod, seen?: Set<unknown>, loaderId?: string, scope?: DictionaryScope): FieldJSON;
20
26
  /**
21
27
  * A whole declared slot → its wire form. `null` for an undeclared slot, which is legal everywhere: a method
22
28
  * with no params publishes no schema rather than an empty one.
@@ -0,0 +1,37 @@
1
+ export interface DictionaryBinding {
2
+ id: string;
3
+ dependsOn: string[];
4
+ criteriaAliases?: Record<string, string[]>;
5
+ }
6
+ /**
7
+ * The param names visible at one level of a declared schema.
8
+ *
9
+ * Entered once per level of fields: the first level is the method's top level, and every level below it sees
10
+ * its own fields plus the top level — not the levels in between, which the console does not send.
11
+ */
12
+ export declare class DictionaryScope {
13
+ private readonly top;
14
+ readonly visible: ReadonlySet<string>;
15
+ static readonly ROOT: DictionaryScope;
16
+ private constructor();
17
+ enter(names: string[]): DictionaryScope;
18
+ }
19
+ export interface ResolvedDependsOn {
20
+ dependsOn: string[];
21
+ clash?: {
22
+ key: string;
23
+ names: string[];
24
+ };
25
+ }
26
+ /**
27
+ * Each criteria key → the one of `[key, ...aliases]` visible in `scope`, or the key itself when none is.
28
+ *
29
+ * Without aliases this is the identity, so a service that declares none publishes exactly what it always did.
30
+ * On a clash the canonical key (or the first visible alias) is published and the clash is reported; the
31
+ * registration guard turns it into an error (./assert-supported-schema.ts).
32
+ */
33
+ export declare function resolveDependsOn(binding: DictionaryBinding, scope: DictionaryScope): ResolvedDependsOn;
34
+ export declare function publishedBinding(binding: DictionaryBinding, scope: DictionaryScope): {
35
+ id: string;
36
+ dependsOn: string[];
37
+ };
@@ -1,9 +1,11 @@
1
1
  import { z as baseZod } from 'zod';
2
2
  import { filesDeleteOptions, filesGetOptions, filesListOptions, filesUploadOptions } from './files-options';
3
+ import type { DictionaryBinding } from './schema/dictionary-binding';
3
4
  import { type FrWidgetToken } from './widget-types';
4
5
  export interface DictionaryRef {
5
6
  id: string;
6
7
  dependsOn?: string[];
8
+ criteriaAliases?: Record<string, string[]>;
7
9
  }
8
10
  /**
9
11
  * What `.dynamicProps()` takes: the sibling params whose values the loader receives as `criteria`, and the
@@ -26,10 +28,7 @@ export interface FrMeta {
26
28
  description?: string;
27
29
  examples?: unknown[];
28
30
  frShared?: boolean;
29
- frDictionary?: {
30
- id: string;
31
- dependsOn: string[];
32
- };
31
+ frDictionary?: DictionaryBinding;
33
32
  frLabels?: Record<string, string>;
34
33
  /** A widget token the declaration carries explicitly — see `FrWidgetToken` in ./widget-types.ts. */
35
34
  frWidget?: FrWidgetToken;
@@ -61,7 +60,10 @@ declare module 'zod' {
61
60
  * its input would suggest a protection that is not there.
62
61
  */
63
62
  secret(): this;
64
- /** Bind a param to a dictionary for dynamic options; auto-derives `dependsOn` from the dictionary criteria. */
63
+ /**
64
+ * Bind a param to a dictionary for dynamic options; auto-derives `dependsOn` from the dictionary criteria —
65
+ * through its `criteriaAliases`, as the names this param's method declares.
66
+ */
65
67
  dictionary(ref: DictionaryRef): this;
66
68
  /**
67
69
  * Show a human label per declared VALUE: `.labels({ asc: 'Ascending' })`.
@@ -6,7 +6,7 @@ import type { SharedExtensionMethod } from '../model/model-types';
6
6
  import { MethodParams } from '../params';
7
7
  import { ResultSpec } from '../result';
8
8
  import type { ProviderPayload } from '../types';
9
- import type { RealtimeTriggerProps } from './types';
9
+ import type { RealtimeInstance, RealtimeTriggerProps } from './types';
10
10
  export declare class RealtimeTriggerMethod extends ExtensionMethod implements LoaderOwner {
11
11
  private readonly props;
12
12
  readonly params: MethodParams;
@@ -21,6 +21,16 @@ export declare class RealtimeTriggerMethod extends ExtensionMethod implements Lo
21
21
  providerEventNames(params?: Record<string, unknown>): string[];
22
22
  claims(providerEventName: string): boolean;
23
23
  extendEventData(requestBody: ProviderPayload, providerEventData: ProviderPayload): Record<string, unknown> | undefined;
24
+ /**
25
+ * Whether `extendMatchData` should run before these instances are matched. Only when something will READ its
26
+ * result — otherwise the API call is pure cost, paid on every event:
27
+ * - no instances, or no `match` → nothing to decide (with no `match` every instance fires);
28
+ * - declarative `match`, and no instance fills any of its params → every instance matches regardless,
29
+ * since an empty param means "any". This is the v1 rule: read the resource only when a flow filters.
30
+ * A predicate `match` is opaque, so the hook runs and receives the instances to make that call itself.
31
+ */
32
+ needsMatchData(instances: RealtimeInstance[]): boolean;
33
+ extendMatchData(providerEventData: ProviderPayload, instances: RealtimeInstance[], ctx: ExecutionContext, webhookData?: ProviderPayload): Promise<Record<string, unknown> | void> | Record<string, unknown> | void;
24
34
  /**
25
35
  * Whether one CONFIGURED INSTANCE of this trigger cares about an event. Declarative form: type-coerced
26
36
  * equality per filled param, where an empty param means "any" — that is what lets a user leave a filter
@@ -30,7 +40,7 @@ export declare class RealtimeTriggerMethod extends ExtensionMethod implements Lo
30
40
  * subscription registered (a tenant id, a resource the webhook was scoped to) has nowhere else to get it.
31
41
  * Returning a new document is not a thing this seam can do; only subscribe/refresh/unsubscribe persist.
32
42
  */
33
- matches(params: Record<string, unknown>, providerEventData: ProviderPayload, webhookData?: ProviderPayload): boolean;
43
+ matches(params: Record<string, unknown>, providerEventData: ProviderPayload, webhookData?: ProviderPayload): Promise<boolean>;
34
44
  extendResult(providerEventData: ProviderPayload, ctx: ExecutionContext, webhookData?: ProviderPayload): Promise<unknown> | unknown;
35
45
  hasExtendResult(): boolean;
36
46
  toModel(): SharedExtensionMethod;
@@ -66,7 +66,7 @@ export interface RealtimeSetupProps<TShape extends ExtensionShape = AnyShape> {
66
66
  verify?: RealtimeVerify<TShape>;
67
67
  handshake?: (bag: InboundBag<TShape> & {
68
68
  requestBody: ProviderPayload;
69
- }) => HandshakeResult | void | Promise<HandshakeResult | void>;
69
+ }) => HandshakeResult | boolean | void | Promise<HandshakeResult | boolean | void>;
70
70
  subscribe: (bag: HandlerBag<TShape> & {
71
71
  callbackUrl: string;
72
72
  triggers: RealtimeSubTrigger[];
@@ -116,11 +116,16 @@ export interface RealtimeTriggerProps<TShape extends ExtensionShape = AnyShape,
116
116
  requestBody: ProviderPayload;
117
117
  providerEventData: ProviderPayload;
118
118
  }) => Record<string, unknown>;
119
+ extendMatchData?: (bag: HandlerBag<TShape> & {
120
+ providerEventData: ProviderPayload;
121
+ webhookData: ProviderPayload;
122
+ instances: RealtimeInstance<Infer<TParams>>[];
123
+ }) => Record<string, unknown> | void | Promise<Record<string, unknown> | void>;
119
124
  match?: Record<string, string> | ((bag: {
120
125
  params: Infer<TParams>;
121
126
  providerEventData: ProviderPayload;
122
127
  webhookData: ProviderPayload;
123
- }) => boolean);
128
+ }) => boolean | Promise<boolean>);
124
129
  extendResult?: (bag: HandlerBag<TShape> & {
125
130
  providerEventData: ProviderPayload;
126
131
  webhookData: ProviderPayload;
@@ -129,6 +134,10 @@ export interface RealtimeTriggerProps<TShape extends ExtensionShape = AnyShape,
129
134
  logo?: string;
130
135
  appearanceColors?: [string, string];
131
136
  }
137
+ export interface RealtimeInstance<TParams = Record<string, unknown>> {
138
+ id: string;
139
+ params: TParams;
140
+ }
132
141
  export interface RealtimeInvocation {
133
142
  callbackUrl?: string;
134
143
  events?: {
@@ -86,6 +86,7 @@ export interface DictionaryProps<TShape extends ExtensionShape = AnyShape, TCrit
86
86
  label?: string;
87
87
  description?: string;
88
88
  criteria?: TCriteria;
89
+ criteriaAliases?: Record<string, string[]>;
89
90
  result?: unknown;
90
91
  oauth2Scopes?: string[];
91
92
  execute: (bag: HandlerBag<TShape> & {
@@ -15,3 +15,6 @@ export declare enum CommonErrorTypes {
15
15
  CLOUD_CODE_RESPONSE_TOO_LARGE = "CLOUD_CODE_RESPONSE_TOO_LARGE",
16
16
  VECTOR_SEARCH_ERROR = "VECTOR_SEARCH_ERROR"
17
17
  }
18
+ export declare enum OAuthConnectionErrorTypes {
19
+ OAUTH_CONNECTION_RECONNECT_REQUIRED = "OAUTH_CONNECTION_RECONNECT_REQUIRED"
20
+ }
@@ -10,6 +10,7 @@ export * from './error-codes';
10
10
  export * from './knowledge-base';
11
11
  export * from './notification-types';
12
12
  export * from './notifications';
13
+ export * from './oauth-connection-error';
13
14
  export * from './patterns';
14
15
  export * from './retry-policy';
15
16
  export * from './severity';
@@ -230,6 +230,18 @@ export declare const FlowExtensionPollingTriggerFailedDataSchema: z.ZodObject<{
230
230
  reason: z.ZodOptional<z.ZodString>;
231
231
  error: z.ZodOptional<z.ZodString>;
232
232
  }, z.core.$strip>;
233
+ export declare const OAuthConnectionRefreshTokenFailedDataSchema: z.ZodObject<{
234
+ hostType: z.ZodEnum<{
235
+ APP: "APP";
236
+ SHARED: "SHARED";
237
+ }>;
238
+ packageId: z.ZodString;
239
+ serviceId: z.ZodString;
240
+ serviceName: z.ZodString;
241
+ connectionId: z.ZodString;
242
+ connectionName: z.ZodString;
243
+ code: z.ZodString;
244
+ }, z.core.$strip>;
233
245
  export declare const FlowExtensionRealtimeTriggerFailedDataSchema: z.ZodObject<{
234
246
  developerFullName: z.ZodOptional<z.ZodString>;
235
247
  serviceName: z.ZodOptional<z.ZodString>;
@@ -403,6 +415,29 @@ export declare const WorkspaceNotificationTypes: {
403
415
  error: z.ZodOptional<z.ZodString>;
404
416
  }, z.core.$strip>;
405
417
  };
418
+ readonly OAUTH_CONNECTION_REFRESH_TOKEN_FAILED: {
419
+ readonly severity: "warning";
420
+ readonly title: (data: Record<string, unknown>) => string;
421
+ readonly message: (data: Record<string, unknown>) => string;
422
+ readonly emailTemplate: "oauth-connection-refresh-token-failed";
423
+ readonly tags: ["flow-execution"];
424
+ readonly dataSchema: z.ZodObject<{
425
+ hostType: z.ZodEnum<{
426
+ APP: "APP";
427
+ SHARED: "SHARED";
428
+ }>;
429
+ packageId: z.ZodString;
430
+ serviceId: z.ZodString;
431
+ serviceName: z.ZodString;
432
+ connectionId: z.ZodString;
433
+ connectionName: z.ZodString;
434
+ code: z.ZodString;
435
+ }, z.core.$strip>;
436
+ readonly grouping: {
437
+ readonly keyFields: ["connectionId"];
438
+ readonly windowMs: number;
439
+ };
440
+ };
406
441
  readonly FLOW_EXTENSION_REALTIME_TRIGGER_FAILED: {
407
442
  readonly severity: "critical";
408
443
  readonly title: (data: Record<string, unknown>) => string;
@@ -593,6 +628,7 @@ export type AccountNotificationType = keyof typeof AccountNotificationTypes;
593
628
  export type WorkspaceNotificationType = keyof typeof WorkspaceNotificationTypes;
594
629
  export type AllNotificationType = AccountNotificationType | WorkspaceNotificationType;
595
630
  export type FlowExtensionPollingTriggerFailedDetails = z.infer<typeof FlowExtensionPollingTriggerFailedDataSchema>;
631
+ export type OAuthConnectionRefreshTokenFailedDetails = z.infer<typeof OAuthConnectionRefreshTokenFailedDataSchema>;
596
632
  export type FlowInstanceTerminatedDetails = z.infer<typeof FlowInstanceTerminatedDataSchema>;
597
633
  export declare const AccountNotificationTypeKeys: KeysTuple<typeof AccountNotificationTypes>;
598
634
  export declare const WorkspaceNotificationTypeKeys: KeysTuple<typeof WorkspaceNotificationTypes>;
@@ -734,6 +770,29 @@ export declare const AllNotificationTypes: {
734
770
  error: z.ZodOptional<z.ZodString>;
735
771
  }, z.core.$strip>;
736
772
  };
773
+ readonly OAUTH_CONNECTION_REFRESH_TOKEN_FAILED: {
774
+ readonly severity: "warning";
775
+ readonly title: (data: Record<string, unknown>) => string;
776
+ readonly message: (data: Record<string, unknown>) => string;
777
+ readonly emailTemplate: "oauth-connection-refresh-token-failed";
778
+ readonly tags: ["flow-execution"];
779
+ readonly dataSchema: z.ZodObject<{
780
+ hostType: z.ZodEnum<{
781
+ APP: "APP";
782
+ SHARED: "SHARED";
783
+ }>;
784
+ packageId: z.ZodString;
785
+ serviceId: z.ZodString;
786
+ serviceName: z.ZodString;
787
+ connectionId: z.ZodString;
788
+ connectionName: z.ZodString;
789
+ code: z.ZodString;
790
+ }, z.core.$strip>;
791
+ readonly grouping: {
792
+ readonly keyFields: ["connectionId"];
793
+ readonly windowMs: number;
794
+ };
795
+ };
737
796
  readonly FLOW_EXTENSION_REALTIME_TRIGGER_FAILED: {
738
797
  readonly severity: "critical";
739
798
  readonly title: (data: Record<string, unknown>) => string;
@@ -0,0 +1,3 @@
1
+ export declare const ConnectionErrorTypes: {
2
+ readonly TOKEN_REFRESH: "token_refresh";
3
+ };
@@ -1,4 +1,15 @@
1
1
  import { ApiError } from './base';
2
+ import { NotAuthorizedError } from './common';
2
3
  export declare class ClITokenExpiredError extends ApiError {
3
4
  constructor(message?: string);
4
5
  }
6
+ /**
7
+ * The caller's own developer auth key is missing or was rejected — an expired session, a signed-out tab, a
8
+ * key from another cluster. Expected traffic, not a server fault (logged at debug, see `handlers.ts`).
9
+ *
10
+ * Throw it only for the USER's key. A 401 to a call made with the console's own credentials is a
11
+ * misconfiguration and must stay an error.
12
+ */
13
+ export declare class InvalidAuthKeyError extends NotAuthorizedError {
14
+ constructor(message?: string);
15
+ }
@@ -8,6 +8,7 @@ export * from './api';
8
8
  export * from './base';
9
9
  export * from './common';
10
10
  export * from './k8s';
11
+ export * from './oauth-connection';
11
12
  export * from './open-search';
12
13
  export * from './s3';
13
14
  export * from '../constants/error-codes';
@@ -0,0 +1,4 @@
1
+ import { ApiError } from './base';
2
+ export declare class OAuthConnectionReconnectRequiredError extends ApiError {
3
+ constructor(message?: string, details?: unknown);
4
+ }
@@ -157,6 +157,7 @@ export interface FlowVersionJavaDto {
157
157
  version: number;
158
158
  serverFields: {
159
159
  hasResult: boolean;
160
+ configId?: string | null;
160
161
  };
161
162
  metaInfo: {
162
163
  errorMessage: string | null;
@@ -626,4 +627,29 @@ export interface ExpressionJavaDto {
626
627
  parseJsonString: boolean;
627
628
  resultType?: DataTypesJavaDto | null;
628
629
  }
630
+ export interface FlowLogMessageJavaDto {
631
+ id: string;
632
+ executionId: string;
633
+ executionName: string | null;
634
+ elementId: string | null;
635
+ elementName: string | null;
636
+ level: string;
637
+ text: string;
638
+ timestamp: number;
639
+ }
640
+ export interface FlowLogsQueryJavaDto {
641
+ executionId?: string;
642
+ elementId?: string;
643
+ level?: string;
644
+ textFilter?: string;
645
+ forDebugSession?: boolean;
646
+ range?: {
647
+ fromInMillis?: number | null;
648
+ toInMillis?: number | null;
649
+ };
650
+ page?: {
651
+ size?: number;
652
+ offset?: number;
653
+ };
654
+ }
629
655
  export {};
@@ -21,10 +21,28 @@ export declare const ConnectionInfoDTOSchema: z.ZodObject<{
21
21
  connectionIdentityName: z.ZodOptional<z.ZodString>;
22
22
  connectionIdentityImageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
23
  serviceName: z.ZodString;
24
- packageId: z.ZodOptional<z.ZodString>;
25
24
  hostType: z.ZodOptional<z.ZodString>;
25
+ packageId: z.ZodOptional<z.ZodString>;
26
26
  modelName: z.ZodOptional<z.ZodString>;
27
27
  }, z.core.$strip>;
28
+ export declare const OAuthConnectionErrorTypeSchema: z.ZodEnum<{
29
+ readonly TOKEN_REFRESH: "token_refresh";
30
+ }>;
31
+ export declare const OAuthConnectionErrorSchema: z.ZodObject<{
32
+ type: z.ZodEnum<{
33
+ readonly TOKEN_REFRESH: "token_refresh";
34
+ }>;
35
+ code: z.ZodString;
36
+ failedAt: z.ZodCoercedDate<unknown>;
37
+ notifiedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
38
+ }, z.core.$strip>;
39
+ export declare const OAuthConnectionErrorDTOSchema: z.ZodObject<{
40
+ type: z.ZodEnum<{
41
+ readonly TOKEN_REFRESH: "token_refresh";
42
+ }>;
43
+ code: z.ZodString;
44
+ failedAt: z.ZodCoercedDate<unknown>;
45
+ }, z.core.$strip>;
28
46
  export declare const OAuthConnectionDTOSchema: z.ZodObject<{
29
47
  _id: z.ZodUUID;
30
48
  name: z.ZodString;
@@ -36,8 +54,8 @@ export declare const OAuthConnectionDTOSchema: z.ZodObject<{
36
54
  connectionIdentityName: z.ZodOptional<z.ZodString>;
37
55
  connectionIdentityImageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
56
  serviceName: z.ZodString;
39
- packageId: z.ZodOptional<z.ZodString>;
40
57
  hostType: z.ZodOptional<z.ZodString>;
58
+ packageId: z.ZodOptional<z.ZodString>;
41
59
  modelName: z.ZodOptional<z.ZodString>;
42
60
  }, z.core.$strip>>;
43
61
  created: z.ZodCoercedDate<unknown>;
@@ -47,8 +65,8 @@ export declare const ConnectionInfoListDTOSchema: z.ZodObject<{
47
65
  serviceId: z.ZodString;
48
66
  userData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
49
67
  connectionIdentityImageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
- packageId: z.ZodOptional<z.ZodString>;
51
68
  hostType: z.ZodOptional<z.ZodString>;
69
+ packageId: z.ZodOptional<z.ZodString>;
52
70
  }, z.core.$strip>;
53
71
  export declare const OAuthConnectionListDTOSchema: z.ZodObject<{
54
72
  name: z.ZodString;
@@ -57,14 +75,25 @@ export declare const OAuthConnectionListDTOSchema: z.ZodObject<{
57
75
  serviceId: z.ZodString;
58
76
  userData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
59
77
  connectionIdentityImageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
- packageId: z.ZodOptional<z.ZodString>;
61
78
  hostType: z.ZodOptional<z.ZodString>;
79
+ packageId: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>>;
81
+ created: z.ZodNullable<z.ZodCoercedDate<unknown>>;
82
+ expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
83
+ renewsAutomatically: z.ZodBoolean;
84
+ connectionError: z.ZodNullable<z.ZodObject<{
85
+ type: z.ZodEnum<{
86
+ readonly TOKEN_REFRESH: "token_refresh";
87
+ }>;
88
+ code: z.ZodString;
89
+ failedAt: z.ZodCoercedDate<unknown>;
62
90
  }, z.core.$strip>>;
63
91
  }, z.core.$strip>;
64
92
  export declare const OAuthConnectionUsageDTOSchema: z.ZodObject<{
65
93
  connectionId: z.ZodUUID;
66
94
  flowVersions: z.ZodArray<z.ZodObject<{
67
95
  id: z.ZodUUID;
96
+ flowId: z.ZodString;
68
97
  name: z.ZodString;
69
98
  version: z.ZodNumber;
70
99
  status: z.ZodString;
@@ -73,9 +102,22 @@ export declare const OAuthConnectionUsageDTOSchema: z.ZodObject<{
73
102
  export declare const UpdateIntegrationConnectionNameBodySchema: z.ZodObject<{
74
103
  updatedName: z.ZodString;
75
104
  }, z.core.$strip>;
105
+ export declare const IntegrationConnectionOAuthUrlQuerySchema: z.ZodObject<{
106
+ hostType: z.ZodEnum<{
107
+ APP: "APP";
108
+ SHARED: "SHARED";
109
+ }>;
110
+ packageId: z.ZodString;
111
+ serviceId: z.ZodString;
112
+ connectionId: z.ZodOptional<z.ZodString>;
113
+ }, z.core.$strip>;
114
+ export type OAuthConnectionErrorType = z.infer<typeof OAuthConnectionErrorTypeSchema>;
115
+ export type OAuthConnectionError = z.infer<typeof OAuthConnectionErrorSchema>;
116
+ export type OAuthConnectionErrorDTO = z.infer<typeof OAuthConnectionErrorDTOSchema>;
76
117
  export type OAuthConnectionDTO = z.infer<typeof OAuthConnectionDTOSchema>;
77
118
  export type OAuthConnectionListDTO = z.infer<typeof OAuthConnectionListDTOSchema>;
78
119
  export type OAuthConnectionUsageDTO = z.infer<typeof OAuthConnectionUsageDTOSchema>;
79
120
  export type ConnectionInfoDTO = z.infer<typeof ConnectionInfoDTOSchema>;
121
+ export type IntegrationConnectionOAuthUrlQuery = z.infer<typeof IntegrationConnectionOAuthUrlQuerySchema>;
80
122
  export type ConnectionInfoListDTO = z.infer<typeof ConnectionInfoListDTOSchema>;
81
123
  export type UpdateIntegrationConnectionNameBodyDTO = z.infer<typeof UpdateIntegrationConnectionNameBodySchema>;
@@ -88,6 +88,7 @@ export declare const WorkspaceNotificationDTOSchema: z.ZodObject<{
88
88
  WORKSPACE_UNBLOCKED: "WORKSPACE_UNBLOCKED";
89
89
  FLOW_INSTANCE_TERMINATED: "FLOW_INSTANCE_TERMINATED";
90
90
  FLOW_EXTENSION_POLLING_TRIGGER_FAILED: "FLOW_EXTENSION_POLLING_TRIGGER_FAILED";
91
+ OAUTH_CONNECTION_REFRESH_TOKEN_FAILED: "OAUTH_CONNECTION_REFRESH_TOKEN_FAILED";
91
92
  FLOW_EXTENSION_REALTIME_TRIGGER_FAILED: "FLOW_EXTENSION_REALTIME_TRIGGER_FAILED";
92
93
  WORKSPACE_CLONING_COMPLETED: "WORKSPACE_CLONING_COMPLETED";
93
94
  WORKSPACE_CLONING_FAILED: "WORKSPACE_CLONING_FAILED";
@@ -34,6 +34,7 @@ export declare const WorkspaceNotificationRequestBodySchema: z.ZodObject<{
34
34
  WORKSPACE_UNBLOCKED: "WORKSPACE_UNBLOCKED";
35
35
  FLOW_INSTANCE_TERMINATED: "FLOW_INSTANCE_TERMINATED";
36
36
  FLOW_EXTENSION_POLLING_TRIGGER_FAILED: "FLOW_EXTENSION_POLLING_TRIGGER_FAILED";
37
+ OAUTH_CONNECTION_REFRESH_TOKEN_FAILED: "OAUTH_CONNECTION_REFRESH_TOKEN_FAILED";
37
38
  FLOW_EXTENSION_REALTIME_TRIGGER_FAILED: "FLOW_EXTENSION_REALTIME_TRIGGER_FAILED";
38
39
  WORKSPACE_CLONING_COMPLETED: "WORKSPACE_CLONING_COMPLETED";
39
40
  WORKSPACE_CLONING_FAILED: "WORKSPACE_CLONING_FAILED";
@@ -127,6 +128,7 @@ export declare const WorkspaceNotificationsResponseSchema: z.ZodObject<{
127
128
  WORKSPACE_UNBLOCKED: "WORKSPACE_UNBLOCKED";
128
129
  FLOW_INSTANCE_TERMINATED: "FLOW_INSTANCE_TERMINATED";
129
130
  FLOW_EXTENSION_POLLING_TRIGGER_FAILED: "FLOW_EXTENSION_POLLING_TRIGGER_FAILED";
131
+ OAUTH_CONNECTION_REFRESH_TOKEN_FAILED: "OAUTH_CONNECTION_REFRESH_TOKEN_FAILED";
130
132
  FLOW_EXTENSION_REALTIME_TRIGGER_FAILED: "FLOW_EXTENSION_REALTIME_TRIGGER_FAILED";
131
133
  WORKSPACE_CLONING_COMPLETED: "WORKSPACE_CLONING_COMPLETED";
132
134
  WORKSPACE_CLONING_FAILED: "WORKSPACE_CLONING_FAILED";
@@ -13,11 +13,25 @@ export declare const SharedExtensionConfigStatusSchema: z.ZodEnum<{
13
13
  export declare const InstalledSharedExtensionsSortFieldSchema: z.ZodEnum<{
14
14
  name: "name";
15
15
  serviceId: "serviceId";
16
+ enabled: "enabled";
16
17
  status: "status";
17
18
  updatedAt: "updatedAt";
18
19
  runnerVersion: "runnerVersion";
19
20
  }>;
20
21
  export declare const InstalledSharedExtensionsQuerySchema: z.ZodObject<{
22
+ sortBy: z.ZodDefault<z.ZodEnum<{
23
+ name: "name";
24
+ serviceId: "serviceId";
25
+ enabled: "enabled";
26
+ status: "status";
27
+ updatedAt: "updatedAt";
28
+ runnerVersion: "runnerVersion";
29
+ }>>;
30
+ sortOrder: z.ZodDefault<z.ZodEnum<{
31
+ asc: "asc";
32
+ desc: "desc";
33
+ }>>;
34
+ search: z.ZodOptional<z.ZodString>;
21
35
  runnerVersion: z.ZodOptional<z.ZodEnum<{
22
36
  v1: "v1";
23
37
  v2: "v2";
@@ -35,18 +49,10 @@ export declare const InstalledSharedExtensionsQuerySchema: z.ZodObject<{
35
49
  configured: "configured";
36
50
  missing: "missing";
37
51
  }>>;
38
- sortBy: z.ZodDefault<z.ZodEnum<{
39
- name: "name";
40
- serviceId: "serviceId";
41
- status: "status";
42
- updatedAt: "updatedAt";
43
- runnerVersion: "runnerVersion";
44
- }>>;
45
- sortOrder: z.ZodDefault<z.ZodEnum<{
46
- asc: "asc";
47
- desc: "desc";
52
+ enabled: z.ZodOptional<z.ZodEnum<{
53
+ true: "true";
54
+ false: "false";
48
55
  }>>;
49
- search: z.ZodOptional<z.ZodString>;
50
56
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
51
57
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
52
58
  }, z.core.$strip>;
@@ -97,6 +103,11 @@ export declare const InstalledSharedExtensionsCountsSchema: z.ZodObject<{
97
103
  configured: z.ZodNumber;
98
104
  missing: z.ZodNumber;
99
105
  }, z.core.$strip>;
106
+ enabled: z.ZodObject<{
107
+ any: z.ZodNumber;
108
+ enabled: z.ZodNumber;
109
+ disabled: z.ZodNumber;
110
+ }, z.core.$strip>;
100
111
  }, z.core.$strip>;
101
112
  export declare const InstalledSharedExtensionsPageSchema: z.ZodObject<{
102
113
  items: z.ZodArray<z.ZodObject<{
@@ -149,6 +160,11 @@ export declare const InstalledSharedExtensionsPageSchema: z.ZodObject<{
149
160
  configured: z.ZodNumber;
150
161
  missing: z.ZodNumber;
151
162
  }, z.core.$strip>;
163
+ enabled: z.ZodObject<{
164
+ any: z.ZodNumber;
165
+ enabled: z.ZodNumber;
166
+ disabled: z.ZodNumber;
167
+ }, z.core.$strip>;
152
168
  }, z.core.$strip>;
153
169
  }, z.core.$strip>;
154
170
  export declare const NotInstalledSharedExtensionsSortFieldSchema: z.ZodEnum<{
@@ -178,6 +194,30 @@ export declare const NotInstalledSharedExtensionsPageSchema: z.ZodObject<{
178
194
  page: z.ZodNumber;
179
195
  limit: z.ZodNumber;
180
196
  }, z.core.$strip>;
197
+ export declare const SharedExtensionBulkTargetsQuerySchema: z.ZodObject<{
198
+ search: z.ZodOptional<z.ZodString>;
199
+ runnerVersion: z.ZodOptional<z.ZodEnum<{
200
+ v1: "v1";
201
+ v2: "v2";
202
+ }>>;
203
+ status: z.ZodOptional<z.ZodEnum<{
204
+ up_to_date: "up_to_date";
205
+ update_available: "update_available";
206
+ legacy: "legacy";
207
+ }>>;
208
+ oauth: z.ZodOptional<z.ZodEnum<{
209
+ true: "true";
210
+ false: "false";
211
+ }>>;
212
+ config: z.ZodOptional<z.ZodEnum<{
213
+ configured: "configured";
214
+ missing: "missing";
215
+ }>>;
216
+ enabled: z.ZodOptional<z.ZodEnum<{
217
+ true: "true";
218
+ false: "false";
219
+ }>>;
220
+ }, z.core.$strip>;
181
221
  export declare const SharedExtensionBulkTargetSchema: z.ZodObject<{
182
222
  serviceId: z.ZodString;
183
223
  enabled: z.ZodBoolean;
@@ -207,3 +247,4 @@ export type NotInstalledSharedExtensionsQueryInput = z.input<typeof NotInstalled
207
247
  export type NotInstalledSharedExtensionsPage = z.infer<typeof NotInstalledSharedExtensionsPageSchema>;
208
248
  export type SharedExtensionBulkTarget = z.infer<typeof SharedExtensionBulkTargetSchema>;
209
249
  export type SharedExtensionBulkTargets = z.infer<typeof SharedExtensionBulkTargetsSchema>;
250
+ export type SharedExtensionBulkTargetsQuery = z.infer<typeof SharedExtensionBulkTargetsQuerySchema>;