@prismatic-io/prism 7.3.1-rc.2 → 7.3.1-rc.3

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.
package/lib/index.js CHANGED
@@ -64901,13 +64901,13 @@ To publish the component, run "prism components:publish"
64901
64901
 
64902
64902
  For documentation on writing custom components, visit https://prismatic.io/docs/custom-connectors/
64903
64903
  `)}static async invoke(e,n){await MVe.run(Nze(e),n)}}class fet extends XEe.Command{static description="Initialize a new Component";static flags={"wsdl-path":XEe.Flags.string({required:!1,description:"Path to the WSDL definition file used to generate a Component"}),"open-api-path":XEe.Flags.string({required:!1,description:"The path to an OpenAPI Specification file (JSON or YAML) used to generate a Component"}),verbose:XEe.Flags.boolean({required:!1,default:!1,description:"Output more verbose logging from Component generation"})};static args={name:XEe.Args.string({required:!0,description:"Name of the new component to create (alphanumeric characters, hyphens, and underscores)"})};async run(){let e=process.cwd();try{let{args:{name:n},flags:{verbose:o,"wsdl-path":c,"open-api-path":p}}=await this.parse(fet),g=c?zMe.resolve(c):void 0,T=p?zMe.resolve(p):void 0;if(!qWe.test(n))this.error(`'${n}' contains invalid characters. Please select a component name that starts and ends with alphanumeric characters, and contains only alphanumeric characters, hyphens, and underscores. See https://regex101.com/?regex=${encodeURIComponent(qWe.source)}`,{exit:1});if(g&&!g?.includes(".wsdl"))this.error("If a WSDL is provided it must have an extension of '.wsdl'",{exit:1});if(this.log(`Creating component directory for "${n}"...`),await G7u.mkdir(n),process.chdir(n),T)await MVe.invoke({name:n,openapi:T},this.config);else if(await C9e.invoke({name:n,description:"Prism-generated Component"},this.config),process.chdir(e),g){if(!o)AVi.Logger.disabled();let[I]=zMe.basename(g).split(".wsdl");await SVi.parseAndGenerate(g,n,{caseInsensitiveNames:!0}),await $Ei({projectRoot:n,projectTemplateName:I,projectTemplatePath:g})}process.chdir(zMe.join(e,n)),await Pze({path:"package.json",scripts:{build:"webpack",publish:"npm run build && prism components:publish","generate:manifest":"npm run build && npx @prismatic-io/spectral component-manifest","generate:manifest:dev":"npm run build && npx @prismatic-io/spectral component-manifest --skip-signature-verify",test:"jest",lint:"eslint --ext .ts ."},eslintConfig:{root:!0,extends:["@prismatic-io/eslint-config-spectral"]},dependencies:{"@prismatic-io/spectral":"*",...g?{soap:"1.1.10"}:{}},devDependencies:W4t});let N=await u3t(n);await s3t(n,N),this.log(`
64904
- "${n}" is ready for development.
64905
- To install dependencies, run either "npm install" or "yarn install"
64906
- To test the component, run "npm run test" or "yarn test"
64907
- To build the component, run "npm run build" or "yarn build"
64908
- To publish the component, run "prism components:publish"
64904
+ "${n}" is ready for development.
64905
+ To install dependencies, run either "npm install" or "yarn install"
64906
+ To test the component, run "npm run test" or "yarn test"
64907
+ To build the component, run "npm run build" or "yarn build"
64908
+ To publish the component, run "prism components:publish"
64909
64909
 
64910
- For documentation on writing custom components, visit https://prismatic.io/docs/custom-connectors/
64910
+ For documentation on writing custom components, visit https://prismatic.io/docs/custom-connectors/
64911
64911
  `)}finally{process.chdir(e)}}}var FVi=Qm(zE(),1);import H7u from"crypto";var wVi=async({componentDefinition:e,packageSignature:n})=>{let o=await km({document:bm`
64912
64912
  query component($key: String!, $public: Boolean!) {
64913
64913
  components(key: $key, public: $public) {
@@ -11,7 +11,7 @@
11
11
  * https://prismatic.io/docs/custom-connectors/connections/#writing-oauth-20-connections
12
12
  */
13
13
 
14
- import { connection } from "@prismatic-io/spectral";
14
+ import { connection, oauth2Connection, OAuth2Type } from "@prismatic-io/spectral";
15
15
 
16
16
  export const acmeApiKey = connection({
17
17
  key: "apiKey",
@@ -37,4 +37,73 @@ export const acmeApiKey = connection({
37
37
  },
38
38
  });
39
39
 
40
- export default [acmeApiKey];
40
+ export const authorizationCode = oauth2Connection({
41
+ key: "authorizationCode",
42
+ display: {
43
+ label: "OAuth 2.0 Authorization Code",
44
+ description: "OAuth 2.0 Authorization Code flow",
45
+ },
46
+ oauth2Type: OAuth2Type.AuthorizationCode,
47
+ inputs: {
48
+ baseUrl: {
49
+ label: "Base URL",
50
+ placeholder: "Base URL",
51
+ type: "string",
52
+ required: true,
53
+ shown: false,
54
+ default: "https://api.example.com",
55
+ comments: "Base URL of the API",
56
+ },
57
+ authorizeUrl: {
58
+ label: "Authorize URL",
59
+ placeholder: "Authorize URL",
60
+ type: "string",
61
+ required: true,
62
+ shown: true,
63
+ comments: "The OAuth 2.0 Authorization URL for the API",
64
+ },
65
+ tokenUrl: {
66
+ label: "Token URL",
67
+ placeholder: "Token URL",
68
+ type: "string",
69
+ required: true,
70
+ shown: true,
71
+ comments: "The OAuth 2.0 Token URL for the API",
72
+ },
73
+ scopes: {
74
+ label: "Scopes",
75
+ placeholder: "Scopes",
76
+ type: "string",
77
+ required: false,
78
+ shown: true,
79
+ comments: "Space separated OAuth 2.0 permission scopes for the API",
80
+ default: "",
81
+ },
82
+ clientId: {
83
+ label: "Client ID",
84
+ placeholder: "Client ID",
85
+ type: "string",
86
+ required: true,
87
+ shown: true,
88
+ comments: "Client Identifier of your app for the API",
89
+ },
90
+ clientSecret: {
91
+ label: "Client Secret",
92
+ placeholder: "Client Secret",
93
+ type: "password",
94
+ required: true,
95
+ shown: true,
96
+ comments: "Client Secret of your app for the API",
97
+ },
98
+ headers: {
99
+ label: "Headers",
100
+ type: "string",
101
+ collection: "keyvaluelist",
102
+ required: false,
103
+ shown: true,
104
+ comments: "Additional header to supply to authorization requests",
105
+ },
106
+ },
107
+ });
108
+
109
+ export default [acmeApiKey, authorizationCode];
@@ -1,10 +1,13 @@
1
1
  import type { ComponentManifest, ConfigPage, ScopedConfigVar } from "@prismatic-io/spectral";
2
2
 
3
- // @ts-ignore
4
3
  import type {
4
+ // @ts-ignore
5
5
  configPages,
6
+ // @ts-ignore
6
7
  componentRegistry,
8
+ // @ts-ignore
7
9
  userLevelConfigPages,
10
+ // @ts-ignore
8
11
  scopedConfigVars,
9
12
  } from "../src";
10
13
 
@@ -5,7 +5,7 @@
5
5
  * about the data it fetched.
6
6
  */
7
7
 
8
- import { type Connection, flow } from "@prismatic-io/spectral";
8
+ import { flow } from "@prismatic-io/spectral";
9
9
  import { createAcmeClient } from "./client";
10
10
  import type { Item } from "./configPages";
11
11
 
@@ -30,7 +30,7 @@ export const listItems = flow({
30
30
  );
31
31
 
32
32
  // Create an authenticated reusable HTTP client from client.ts
33
- const acmeErpClient = createAcmeClient(context.configVars["Acme Connection"] as Connection);
33
+ const acmeErpClient = createAcmeClient(context.configVars["Acme Connection"]);
34
34
  const response = await acmeErpClient.get<Item[]>("/items");
35
35
  for (const item of response.data) {
36
36
  context.logger.info(
@@ -5346,5 +5346,5 @@
5346
5346
  "enableJsonFlag": false
5347
5347
  }
5348
5348
  },
5349
- "version": "7.3.1-rc.2"
5349
+ "version": "7.3.1-rc.3"
5350
5350
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/prism",
3
- "version": "7.3.1-rc.2",
3
+ "version": "7.3.1-rc.3",
4
4
  "description": "Build, deploy, and support integrations in Prismatic from the comfort of your command line",
5
5
  "keywords": ["prismatic", "cli"],
6
6
  "homepage": "https://prismatic.io",