@prismatic-io/spectral 10.5.5 → 10.5.7

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.
@@ -239,6 +239,9 @@ const convertComponentReference = (componentReference, componentRegistry, refere
239
239
  if ("configVar" in value) {
240
240
  return Object.assign(Object.assign({}, result), { [key]: { type: "configVar", value: value.configVar } });
241
241
  }
242
+ if ("template" in value) {
243
+ return Object.assign(Object.assign({}, result), { [key]: { type: "template", value: value.template } });
244
+ }
242
245
  return result;
243
246
  }, {});
244
247
  return {
@@ -1,4 +1,5 @@
1
1
  import { InstanceAttributes, CustomerAttributes, DataSourceType, DataSourceResultType, UserAttributes, TriggerEventFunctionReturn, IntegrationAttributes, FlowAttributes, ConfigVarResultCollection, ComponentManifest, FlowInvoker, ExecutionFrame, DebugContext } from "../types";
2
+ import { FlowSchemas } from "../types/FlowSchema";
2
3
  interface DisplayDefinition {
3
4
  label: string;
4
5
  description: string;
@@ -66,6 +67,7 @@ export type ActionContext<TConfigVars extends ConfigVarResultCollection = Config
66
67
  flow: FlowAttributes;
67
68
  startedAt: string;
68
69
  executionFrame: ExecutionFrame;
70
+ flowSchemas: FlowSchemas;
69
71
  globalDebug?: boolean;
70
72
  runnerAllocatedMemoryMb?: number;
71
73
  components: {
package/dist/testing.js CHANGED
@@ -134,6 +134,12 @@ const createActionContext = (context) => {
134
134
  memoryUsage: [],
135
135
  allowedMemory: 1024,
136
136
  },
137
+ }, flowSchemas: {
138
+ invoke: {
139
+ properties: {},
140
+ type: "",
141
+ title: "",
142
+ },
137
143
  } }, context);
138
144
  };
139
145
  const createDataSourceContext = (context) => {
@@ -1,5 +1,6 @@
1
1
  import { AxiosRequestConfig, AxiosResponse } from "axios";
2
2
  import { Inputs, ConfigVarResultCollection, ActionPerformReturn, ActionInputParameters, ActionLogger, InstanceAttributes, CustomerAttributes, UserAttributes, IntegrationAttributes, FlowAttributes, ComponentManifest } from ".";
3
+ import { FlowSchemas } from "./FlowSchema";
3
4
  interface StandardLineage {
4
5
  componentActionKey: string;
5
6
  executionId: string;
@@ -117,5 +118,7 @@ export type ActionContext<TConfigVars extends ConfigVarResultCollection = Config
117
118
  executionFrame: ExecutionFrame;
118
119
  /** Contains methods, flags, and data to support debug modes. */
119
120
  debug: DebugContext;
121
+ /** JSON schemas to enable using flows for AI function calls. */
122
+ flowSchemas: FlowSchemas;
120
123
  };
121
124
  export {};
@@ -22,6 +22,15 @@ export type ComponentRegistry = keyof IntegrationDefinitionComponentRegistry ext
22
22
  export type ConfigVarExpression = {
23
23
  configVar: string;
24
24
  };
25
+ export type TemplateExpression = {
26
+ /**
27
+ * Use a template to concatenate strings and other config variables together.
28
+ * For example, if you have a config variable named "Sharepoint Site", you
29
+ * can provide a value `/sites/{{#Sharepoint Site}}/drives`, and your `{{#}}`
30
+ * config variable will be concatenated with `/sites/` and `/drives`.
31
+ */
32
+ template: string;
33
+ };
25
34
  export type ValueExpression<TValueType = unknown> = {
26
35
  value: TValueType;
27
36
  };
@@ -29,7 +38,7 @@ type ComponentReferenceType = Extract<keyof ComponentManifest, "actions" | "trig
29
38
  type ComponentReferenceTypeValueMap<TValue, TMap extends Record<ComponentReferenceType, unknown> = {
30
39
  actions: ValueExpression<TValue>;
31
40
  triggers: ValueExpression<TValue> | ConfigVarExpression;
32
- dataSources: ValueExpression<TValue> | ConfigVarExpression;
41
+ dataSources: ValueExpression<TValue> | ConfigVarExpression | TemplateExpression;
33
42
  connections: (ValueExpression<TValue> | ConfigVarExpression) & ConfigVarVisibility & {
34
43
  writeOnly?: true;
35
44
  };
@@ -38,14 +47,14 @@ export type ComponentReference<TComponentReference extends {
38
47
  component: string;
39
48
  key: string;
40
49
  values?: {
41
- [key: string]: ValueExpression | ConfigVarExpression;
50
+ [key: string]: ValueExpression | ConfigVarExpression | TemplateExpression;
42
51
  };
43
52
  template?: string;
44
53
  } = {
45
54
  component: string;
46
55
  key: string;
47
56
  values?: {
48
- [key: string]: ValueExpression | ConfigVarExpression;
57
+ [key: string]: ValueExpression | ConfigVarExpression | TemplateExpression;
49
58
  };
50
59
  template?: string;
51
60
  }> = TComponentReference;
@@ -0,0 +1,10 @@
1
+ export interface FlowSchema {
2
+ title: string;
3
+ $comment?: string;
4
+ type: string;
5
+ properties: Record<string, Record<string, unknown>>;
6
+ }
7
+ export interface FlowSchemas {
8
+ invoke: FlowSchema;
9
+ [key: string]: FlowSchema;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "10.5.5",
3
+ "version": "10.5.7",
4
4
  "description": "Utility library for building Prismatic connectors and code-native integrations",
5
5
  "keywords": ["prismatic"],
6
6
  "main": "dist/index.js",