@prismatic-io/spectral 7.3.8 → 7.4.0

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.
@@ -1,11 +1,12 @@
1
1
  /// <reference types="node" />
2
- import { Instance, Customer, DataSourceType, DataSourceResultType } from "../types";
2
+ import { Instance, Customer, DataSourceType, DataSourceResultType, User } from "../types";
3
3
  interface DisplayDefinition {
4
4
  label: string;
5
5
  description: string;
6
6
  }
7
7
  export { Instance } from "../types";
8
8
  export { Customer } from "../types";
9
+ export { User } from "../types";
9
10
  export interface Component {
10
11
  key: string;
11
12
  public?: boolean;
@@ -57,6 +58,7 @@ export interface ActionContext {
57
58
  invokeUrl: string;
58
59
  customer: Customer;
59
60
  instance: Instance;
61
+ user: User;
60
62
  }
61
63
  declare type TriggerOptionChoice = "invalid" | "valid" | "required";
62
64
  export interface TriggerPayload {
@@ -77,6 +79,7 @@ export interface TriggerPayload {
77
79
  executionId: string;
78
80
  customer: Customer;
79
81
  instance: Instance;
82
+ user: User;
80
83
  }
81
84
  interface HttpResponse {
82
85
  statusCode: number;
package/dist/testing.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { TriggerPayload, TriggerResult, ConnectionValue, ActionLogger, Component, ActionContext, ActionPerformReturn, DataSourceResult, DataSourceContext } from "./serverTypes";
8
8
  import { ConnectionDefinition, ActionDefinition, TriggerDefinition, Inputs, ActionInputParameters, DataSourceDefinition, ActionPerformReturn as InvokeActionPerformReturn, TriggerResult as InvokeTriggerResult, DataSourceResult as InvokeDataSourceResult } from "./types";
9
- export declare const createConnection: <T extends ConnectionDefinition>({ key }: T, values: Record<string, unknown>) => ConnectionValue;
9
+ export declare const createConnection: <T extends ConnectionDefinition>({ key }: T, values: Record<string, unknown>, tokenValues?: Record<string, unknown> | undefined) => ConnectionValue;
10
10
  /**
11
11
  * Pre-built mock of ActionLogger. Suitable for asserting logs are created as expected.
12
12
  * See https://prismatic.io/docs/custom-components/writing-custom-components/#verifying-correct-logging-in-action-tests for information on testing correct logging behavior in your custom component.
package/dist/testing.js CHANGED
@@ -17,10 +17,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.createHarness = exports.ComponentTestHarness = exports.invokeDataSource = exports.invokeTrigger = exports.defaultTriggerPayload = exports.invoke = exports.loggerMock = exports.createConnection = void 0;
19
19
  const jest_mock_1 = require("jest-mock");
20
- const createConnection = ({ key }, values) => ({
20
+ const createConnection = ({ key }, values, tokenValues) => ({
21
21
  configVarKey: "",
22
22
  key,
23
23
  fields: values,
24
+ token: tokenValues,
24
25
  });
25
26
  exports.createConnection = createConnection;
26
27
  /**
@@ -61,6 +62,12 @@ const baseActionContext = {
61
62
  id: "instanceId",
62
63
  name: "Instance 1",
63
64
  },
65
+ user: {
66
+ id: "userId",
67
+ email: "user@example.com",
68
+ name: "User 1",
69
+ externalId: "1234",
70
+ },
64
71
  };
65
72
  /**
66
73
  * Invokes specified ActionDefinition perform function using supplied params
@@ -111,6 +118,12 @@ const defaultTriggerPayload = () => {
111
118
  id: "instanceId",
112
119
  name: "Instance 1",
113
120
  },
121
+ user: {
122
+ id: "userId",
123
+ email: "user@example.com",
124
+ name: "User 1",
125
+ externalId: "1234",
126
+ },
114
127
  };
115
128
  };
116
129
  exports.defaultTriggerPayload = defaultTriggerPayload;
@@ -1,4 +1,4 @@
1
- import { Inputs, ActionPerformReturn, ActionInputParameters, ActionLogger, Instance, Customer } from ".";
1
+ import { Inputs, ActionPerformReturn, ActionInputParameters, ActionLogger, Instance, Customer, User } from ".";
2
2
  /** Definition of the function to perform when an Action is invoked. */
3
3
  export declare type ActionPerformFunction<TInputs extends Inputs, TAllowsBranching extends boolean | undefined, TReturn extends ActionPerformReturn<TAllowsBranching, unknown>> = (context: ActionContext, params: ActionInputParameters<TInputs>) => Promise<TReturn>;
4
4
  /** Context provided to perform method containing helpers and contextual data */
@@ -27,4 +27,6 @@ export interface ActionContext {
27
27
  customer: Customer;
28
28
  /** Contains attributes of the Instance that is being executed. */
29
29
  instance: Instance;
30
+ /** Contains attributes of the User for whom a User Level Configuration is being used. */
31
+ user: User;
30
32
  }
@@ -1,4 +1,4 @@
1
- import { Instance, Customer } from ".";
1
+ import { Instance, Customer, User } from ".";
2
2
  /** Represents a Trigger Payload, which is data passed into a Trigger to invoke an Integration execution. */
3
3
  export interface TriggerPayload {
4
4
  headers: {
@@ -32,4 +32,6 @@ export interface TriggerPayload {
32
32
  customer: Customer;
33
33
  /** Contains attributes of the Instance that is being executed. */
34
34
  instance: Instance;
35
+ /** Contains attributes of the User for whom a User Level Configuration is being used. */
36
+ user: User;
35
37
  }
@@ -0,0 +1,7 @@
1
+ /** Contains attributes of the User for whom a User Level Configuration is being used. */
2
+ export interface User {
3
+ id: string;
4
+ email: string;
5
+ name: string;
6
+ externalId: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -23,4 +23,5 @@ export * from "./DataSourcePerformFunction";
23
23
  export * from "./DataSourceResult";
24
24
  export * from "./Instance";
25
25
  export * from "./Customer";
26
+ export * from "./User";
26
27
  export * as serverTypes from "../serverTypes";
@@ -52,4 +52,5 @@ __exportStar(require("./DataSourcePerformFunction"), exports);
52
52
  __exportStar(require("./DataSourceResult"), exports);
53
53
  __exportStar(require("./Instance"), exports);
54
54
  __exportStar(require("./Customer"), exports);
55
+ __exportStar(require("./User"), exports);
55
56
  exports.serverTypes = __importStar(require("../serverTypes"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "7.3.8",
3
+ "version": "7.4.0",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"