rever-component-manifest-prod
v2024.9.13-t-21.1.58
Published
Component to connect to Rever
Downloads
1
Readme
Rever Manifest
Component to connect to Rever
This package contains the Component Manifest for the Rever Component.
Code Native Integration (CNI) Usage
Register your component manifest in the Code Native Integration (CNI) component registry src/componentRegistry.ts
.
import { componentManifests } from "@prismatic-io/spectral";
import reverPrismatic from "rever-component-manifest-prod";
export const componentRegistry = componentManifests({
reverPrismatic,
});
Using Triggers in flows
Example:
import { flow } from "@prismatic-io/spectral";
export default flow({
name: "Flow Name",
...
onTrigger: {
key: "tasksWebhook",
component: "reverPrismatic",
isPublic: false,
values: {
...
}
},
});
Using Actions in flows
The component registry is accessible on the context
argument in the onExecution
and onTrigger
methods as context.components
.
Example:
import { flow } from "@prismatic-io/spectral";
export default flow({
name: "Flow Name",
...
onExecution: async (context, params) => {
const { components, logger, components } = context;
const response = await components.reverPrismatic.addLike({
...
});
return Promise.resolve({ data: response });
},
});
Using Data Sources in config pages
Example:
import { configPage, dataSourceConfigVar } from "@prismatic-io/spectral";
export const configPages = {
"Data Sources": configPage({
elements: {
"Custom Data Source": dataSourceConfigVar({
dataType: "jsonForm",
stableKey: "custom-data-source",
dataSource: {
key: "account",
component: "reverPrismatic",
isPublic: false,
values: {
...
},
}
})
},
}),
};
Using Connections in config pages
Example:
import { configPage, connectionConfigVar } from "@prismatic-io/spectral";
export const configPages = {
Connections: configPage({
elements: {
"Custom Connection": connectionConfigVar({
dataType: "connection",
stableKey: "custom-connection"
connection: {
key: "reverConnection",
component: "reverPrismatic",
isPublic: false,
values: {
...
},
},
}),
}),
};
Development
There are two modes for this package:
Component Manifest development package: Use this to test the Component in the Code Native Integration (CNI) locally. Publishing the CNI with this package will fail because the Component doesn't exist in the Prismatic Platform yet. A development package is typically built with
npm run generate:manifest:dev
and identified by anull
signature
in the Component Manifestindex.ts
file.Component Manifest production package: Use this with the Code Native Integration (CNI) either locally or in production by publishing the CNI to the Prismatic Platform. A production package is generated by publishing the Component with
prism components:publish
command, and then generating the Component Manifest with thegenerate:manifest
command. A production package is identified by a non-nullsignature
in the Component Manifestindex.ts
file.
Installation with a Code Native Integration
Before publishing the CNI, the local Component package must be published to the Prismatic Platform. This generates a stable signature key for the Component Manifest, indicating it's available for use.
Install via remote registry
For public components:
npm install rever-component-manifest-prod
For private components:
- If you're installing from a private registry, install the
rever-component-manifest-prod
however you normally install your packages from your own registry.
Alternatively, install from a local package or tarball.
Link to local package
Things to keep in mind when using npm link
:
- The node versions between the Component Manifest directory and the CNI directory must be the same.
Steps:
- From the new
rever-component-manifest-prod
directory, create a symlink to the global module directory:
npm link;
- From the Code Native Integration directory, link the local package:
npm link rever-component-manifest-prod;
Install from local tarball package
- From the new
rever-component-manifest-prod
directory, create a tarball package:
npm pack;
- From the Code Native Integration directory, install the tarball package:
npm install [path to tarball];