@prismatic-io/spectral 7.3.9 → 7.4.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.
@@ -76,7 +76,9 @@ const toAuthorizationHeaders = (connection) => {
76
76
  const toFormData = (formData, fileData) => {
77
77
  const form = new form_data_1.default();
78
78
  (formData || []).map(({ key, value }) => form.append(key, value));
79
- (fileData || []).map(({ key, value }) => form.append(key, value, { filename: key }));
79
+ (fileData || []).map(({ key, value }) => form.append(key, util_1.default.types.toBufferDataPayload(value).data, {
80
+ filename: key,
81
+ }));
80
82
  return form;
81
83
  };
82
84
  const computeRetryDelay = (retryDelay, useExponentialBackoff) => {
@@ -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.js CHANGED
@@ -62,6 +62,12 @@ const baseActionContext = {
62
62
  id: "instanceId",
63
63
  name: "Instance 1",
64
64
  },
65
+ user: {
66
+ id: "userId",
67
+ email: "user@example.com",
68
+ name: "User 1",
69
+ externalId: "1234",
70
+ },
65
71
  };
66
72
  /**
67
73
  * Invokes specified ActionDefinition perform function using supplied params
@@ -112,6 +118,12 @@ const defaultTriggerPayload = () => {
112
118
  id: "instanceId",
113
119
  name: "Instance 1",
114
120
  },
121
+ user: {
122
+ id: "userId",
123
+ email: "user@example.com",
124
+ name: "User 1",
125
+ externalId: "1234",
126
+ },
115
127
  };
116
128
  };
117
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/dist/util.d.ts CHANGED
@@ -37,7 +37,7 @@ declare const _default: {
37
37
  isDate: (value: unknown) => value is Date;
38
38
  toDate: (value: unknown) => Date;
39
39
  isUrl: (value: string) => boolean;
40
- isBufferDataPayload: (value: unknown) => boolean;
40
+ isBufferDataPayload: (value: unknown) => value is DataPayload;
41
41
  toBufferDataPayload: (value: unknown) => DataPayload;
42
42
  isData: (value: unknown) => boolean;
43
43
  toData: (value: unknown) => DataPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "7.3.9",
3
+ "version": "7.4.1",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"