@fayz-ai/plugin-automations 0.8.0 → 0.9.0-next.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.
- package/package.json +10 -9
- package/dist/index.cjs +0 -150
- package/dist/index.cjs.map +0 -1
package/package.json
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
"fayz": {
|
|
4
4
|
"status": "preview"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.9.0-next.0",
|
|
7
7
|
"description": "[experimental] Fayz SDK — workflows & automations plugin",
|
|
8
8
|
"type": "module",
|
|
9
|
-
"
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"main": "./dist/index.js",
|
|
10
11
|
"module": "./dist/index.js",
|
|
11
12
|
"types": "./dist/index.d.ts",
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
14
15
|
"source": "./src/index.ts",
|
|
15
16
|
"types": "./dist/index.d.ts",
|
|
16
|
-
"import": "./dist/index.js"
|
|
17
|
-
"require": "./dist/index.cjs"
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
@@ -23,19 +23,20 @@
|
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^18.0.0 || ^19.0.0",
|
|
26
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
26
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
27
|
+
"lucide-react": ">=0.400.0 <1.0.0"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"
|
|
30
|
-
"@fayz-ai/
|
|
31
|
-
"@fayz-ai/ui": "^0.8.0"
|
|
30
|
+
"@fayz-ai/core": "^0.9.0-next.0",
|
|
31
|
+
"@fayz-ai/ui": "^0.9.0-next.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/react": "^18.3.0",
|
|
35
35
|
"react": "^18.3.0",
|
|
36
36
|
"tsup": "^8.2.0",
|
|
37
37
|
"typescript": "^5.5.0",
|
|
38
|
-
"@types/react-dom": "^18.3.0"
|
|
38
|
+
"@types/react-dom": "^18.3.0",
|
|
39
|
+
"lucide-react": "^0.400.0"
|
|
39
40
|
},
|
|
40
41
|
"license": "MIT",
|
|
41
42
|
"keywords": [
|
package/dist/index.cjs
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var lucideReact = require('lucide-react');
|
|
5
|
-
var ui = require('@fayz-ai/ui');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
|
|
8
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
|
-
|
|
12
|
-
// src/index.ts
|
|
13
|
-
var WORKFLOWS = [
|
|
14
|
-
{
|
|
15
|
-
id: "1",
|
|
16
|
-
name: "New lead \u2192 nurture",
|
|
17
|
-
trigger: "Form submitted",
|
|
18
|
-
enrolled: 342,
|
|
19
|
-
active: true,
|
|
20
|
-
steps: [
|
|
21
|
-
{ icon: lucideReact.MessageSquare, label: "Send SMS" },
|
|
22
|
-
{ icon: lucideReact.Clock, label: "Wait 1 day" },
|
|
23
|
-
{ icon: lucideReact.Mail, label: "Send email" },
|
|
24
|
-
{ icon: lucideReact.Tag, label: 'Tag "nurtured"' }
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: "2",
|
|
29
|
-
name: "Missed call text-back",
|
|
30
|
-
trigger: "Call missed",
|
|
31
|
-
enrolled: 128,
|
|
32
|
-
active: true,
|
|
33
|
-
steps: [
|
|
34
|
-
{ icon: lucideReact.MessageSquare, label: "Text back" },
|
|
35
|
-
{ icon: lucideReact.Tag, label: "Create task" }
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: "3",
|
|
40
|
-
name: "Appointment reminder",
|
|
41
|
-
trigger: "Appointment booked",
|
|
42
|
-
enrolled: 87,
|
|
43
|
-
active: true,
|
|
44
|
-
steps: [
|
|
45
|
-
{ icon: lucideReact.Clock, label: "Wait until 24h before" },
|
|
46
|
-
{ icon: lucideReact.MessageSquare, label: "WhatsApp reminder" }
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: "4",
|
|
51
|
-
name: "Won deal \u2192 review request",
|
|
52
|
-
trigger: "Deal marked Won",
|
|
53
|
-
enrolled: 41,
|
|
54
|
-
active: false,
|
|
55
|
-
steps: [
|
|
56
|
-
{ icon: lucideReact.Clock, label: "Wait 2 days" },
|
|
57
|
-
{ icon: lucideReact.Mail, label: "Ask for review" }
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
];
|
|
61
|
-
function Stat({ label, value }) {
|
|
62
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-card border border-border bg-card p-4", children: [
|
|
63
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground", children: label }),
|
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-2xl font-semibold text-foreground", children: value })
|
|
65
|
-
] });
|
|
66
|
-
}
|
|
67
|
-
function AutomationsHome() {
|
|
68
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto max-w-6xl p-6", children: [
|
|
69
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.PageHeaderActions, { children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { children: [
|
|
70
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "mr-1.5 h-4 w-4" }),
|
|
71
|
-
" New workflow"
|
|
72
|
-
] }) }),
|
|
73
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-6 grid grid-cols-2 gap-4 lg:grid-cols-4", children: [
|
|
74
|
-
/* @__PURE__ */ jsxRuntime.jsx(Stat, { label: "Active workflows", value: "3" }),
|
|
75
|
-
/* @__PURE__ */ jsxRuntime.jsx(Stat, { label: "Contacts enrolled", value: "598" }),
|
|
76
|
-
/* @__PURE__ */ jsxRuntime.jsx(Stat, { label: "Actions run (30d)", value: "2,140" }),
|
|
77
|
-
/* @__PURE__ */ jsxRuntime.jsx(Stat, { label: "Success rate", value: "98.6%" })
|
|
78
|
-
] }),
|
|
79
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-6 space-y-3", children: WORKFLOWS.map((w) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-card border border-border bg-card p-4", children: [
|
|
80
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
81
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
82
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-amber-100 text-amber-600", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Zap, { className: "h-4 w-4" }) }),
|
|
83
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
84
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground", children: w.name }),
|
|
85
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
86
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-3 w-3" }),
|
|
87
|
-
" When: ",
|
|
88
|
-
w.trigger,
|
|
89
|
-
" \xB7 ",
|
|
90
|
-
w.enrolled,
|
|
91
|
-
" enrolled"
|
|
92
|
-
] })
|
|
93
|
-
] })
|
|
94
|
-
] }),
|
|
95
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
96
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `rounded-full px-2 py-0.5 text-xs font-medium ${w.active ? "bg-emerald-100 text-emerald-700" : "bg-muted text-muted-foreground"}`, children: w.active ? "Active" : "Paused" }),
|
|
97
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outline", size: "icon", children: w.active ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pause, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "h-4 w-4" }) })
|
|
98
|
-
] })
|
|
99
|
-
] }),
|
|
100
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3", children: w.steps.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs(React__default.default.Fragment, { children: [
|
|
101
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1 text-xs font-medium text-foreground", children: [
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx(s.icon, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
103
|
-
" ",
|
|
104
|
-
s.label
|
|
105
|
-
] }),
|
|
106
|
-
i < w.steps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
107
|
-
] }, i)) })
|
|
108
|
-
] }, w.id)) }),
|
|
109
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 text-center text-xs text-muted-foreground", children: "Mock preview \xB7 the visual builder + execution engine (event bus, scheduler) ships in a later milestone." })
|
|
110
|
-
] });
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// src/index.ts
|
|
114
|
-
function createAutomationsPlugin(options) {
|
|
115
|
-
const PageComponent = () => React__default.default.createElement(AutomationsHome);
|
|
116
|
-
PageComponent.displayName = "AutomationsHome";
|
|
117
|
-
return {
|
|
118
|
-
id: "automations",
|
|
119
|
-
name: options?.navLabel ?? "Automations",
|
|
120
|
-
icon: "Zap",
|
|
121
|
-
version: "1.0.0",
|
|
122
|
-
scope: options?.scope ?? "universal",
|
|
123
|
-
verticalId: options?.verticalId,
|
|
124
|
-
defaultEnabled: true,
|
|
125
|
-
dependencies: [],
|
|
126
|
-
declaredFeatures: [{ id: "automations", label: "Automations", group: "Automate" }],
|
|
127
|
-
navigation: [
|
|
128
|
-
{
|
|
129
|
-
section: options?.navSection ?? "main",
|
|
130
|
-
position: options?.navPosition ?? 6,
|
|
131
|
-
label: options?.navLabel ?? "Automations",
|
|
132
|
-
route: "/automations",
|
|
133
|
-
icon: "Zap",
|
|
134
|
-
permission: { feature: "automations", action: "read" }
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
routes: [
|
|
138
|
-
{
|
|
139
|
-
path: "/automations",
|
|
140
|
-
component: PageComponent,
|
|
141
|
-
permission: { feature: "automations", action: "read" }
|
|
142
|
-
}
|
|
143
|
-
],
|
|
144
|
-
widgets: []
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
exports.createAutomationsPlugin = createAutomationsPlugin;
|
|
149
|
-
//# sourceMappingURL=index.cjs.map
|
|
150
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/views/AutomationsHome.tsx","../src/index.ts"],"names":["MessageSquare","Clock","Mail","Tag","jsxs","jsx","PageHeaderActions","Button","Plus","Zap","Filter","Pause","Play","React","ArrowRight"],"mappings":";;;;;;;;;;;;AAaA,IAAM,SAAA,GAAwB;AAAA,EAC5B;AAAA,IACE,EAAA,EAAI,GAAA;AAAA,IAAK,IAAA,EAAM,yBAAA;AAAA,IAAsB,OAAA,EAAS,gBAAA;AAAA,IAAkB,QAAA,EAAU,GAAA;AAAA,IAAK,MAAA,EAAQ,IAAA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CAAc,WAAA,GAAc,iBAAA;AAE5B,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,aAAA;AAAA,IACJ,IAAA,EAAM,SAAS,QAAA,IAAY,aAAA;AAAA,IAC3B,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,OAAA;AAAA,IACT,KAAA,EAAO,SAAS,KAAA,IAAS,WAAA;AAAA,IACzB,YAAY,OAAA,EAAS,UAAA;AAAA,IACrB,cAAA,EAAgB,IAAA;AAAA,IAChB,cAAc,EAAC;AAAA,IACf,gBAAA,EAAkB,CAAC,EAAE,EAAA,EAAI,eAAe,KAAA,EAAO,aAAA,EAAe,KAAA,EAAO,UAAA,EAAY,CAAA;AAAA,IACjF,UAAA,EAAY;AAAA,MACV;AAAA,QACE,OAAA,EAAS,SAAS,UAAA,IAAc,MAAA;AAAA,QAChC,QAAA,EAAU,SAAS,WAAA,IAAe,CAAA;AAAA,QAClC,KAAA,EAAO,SAAS,QAAA,IAAY,aAAA;AAAA,QAC5B,KAAA,EAAO,cAAA;AAAA,QACP,IAAA,EAAM,KAAA;AAAA,QACN,UAAA,EAAY,EAAE,OAAA,EAAS,aAAA,EAAe,QAAQ,MAAA;AAAgB;AAChE,KACF;AAAA,IACA,MAAA,EAAQ;AAAA,MACN;AAAA,QACE,IAAA,EAAM,cAAA;AAAA,QACN,SAAA,EAAW,aAAA;AAAA,QACX,UAAA,EAAY,EAAE,OAAA,EAAS,aAAA,EAAe,QAAQ,MAAA;AAAgB;AAChE,KACF;AAAA,IACA,SAAS;AAAC,GACZ;AACF","file":"index.cjs","sourcesContent":["import React from 'react'\nimport { Zap, Plus, Play, Pause, ArrowRight, Filter, Mail, Tag, MessageSquare, Clock } from 'lucide-react'\nimport { Button, PageHeaderActions } from '@fayz-ai/ui'\n\ninterface Workflow {\n id: string\n name: string\n trigger: string\n steps: Array<{ icon: React.ComponentType<{ className?: string }>; label: string }>\n enrolled: number\n active: boolean\n}\n\nconst WORKFLOWS: Workflow[] = [\n {\n id: '1', name: 'New lead → nurture', trigger: 'Form submitted', enrolled: 342, active: true,\n steps: [\n { icon: MessageSquare, label: 'Send SMS' },\n { icon: Clock, label: 'Wait 1 day' },\n { icon: Mail, label: 'Send email' },\n { icon: Tag, label: 'Tag \"nurtured\"' },\n ],\n },\n {\n id: '2', name: 'Missed call text-back', trigger: 'Call missed', enrolled: 128, active: true,\n steps: [\n { icon: MessageSquare, label: 'Text back' },\n { icon: Tag, label: 'Create task' },\n ],\n },\n {\n id: '3', name: 'Appointment reminder', trigger: 'Appointment booked', enrolled: 87, active: true,\n steps: [\n { icon: Clock, label: 'Wait until 24h before' },\n { icon: MessageSquare, label: 'WhatsApp reminder' },\n ],\n },\n {\n id: '4', name: 'Won deal → review request', trigger: 'Deal marked Won', enrolled: 41, active: false,\n steps: [\n { icon: Clock, label: 'Wait 2 days' },\n { icon: Mail, label: 'Ask for review' },\n ],\n },\n]\n\nfunction Stat({ label, value }: { label: string; value: string }) {\n return (\n <div className=\"rounded-card border border-border bg-card p-4\">\n <p className=\"text-xs font-medium text-muted-foreground\">{label}</p>\n <p className=\"mt-2 text-2xl font-semibold text-foreground\">{value}</p>\n </div>\n )\n}\n\nexport function AutomationsHome() {\n return (\n <div className=\"mx-auto max-w-6xl p-6\">\n <PageHeaderActions>\n <Button><Plus className=\"mr-1.5 h-4 w-4\" /> New workflow</Button>\n </PageHeaderActions>\n\n <div className=\"mt-6 grid grid-cols-2 gap-4 lg:grid-cols-4\">\n <Stat label=\"Active workflows\" value=\"3\" />\n <Stat label=\"Contacts enrolled\" value=\"598\" />\n <Stat label=\"Actions run (30d)\" value=\"2,140\" />\n <Stat label=\"Success rate\" value=\"98.6%\" />\n </div>\n\n <div className=\"mt-6 space-y-3\">\n {WORKFLOWS.map((w) => (\n <div key={w.id} className=\"rounded-card border border-border bg-card p-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2.5\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-lg bg-amber-100 text-amber-600\">\n <Zap className=\"h-4 w-4\" />\n </div>\n <div>\n <p className=\"text-sm font-semibold text-foreground\">{w.name}</p>\n <p className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Filter className=\"h-3 w-3\" /> When: {w.trigger} · {w.enrolled} enrolled\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className={`rounded-full px-2 py-0.5 text-xs font-medium ${w.active ? 'bg-emerald-100 text-emerald-700' : 'bg-muted text-muted-foreground'}`}>\n {w.active ? 'Active' : 'Paused'}\n </span>\n <Button variant=\"outline\" size=\"icon\">{w.active ? <Pause className=\"h-4 w-4\" /> : <Play className=\"h-4 w-4\" />}</Button>\n </div>\n </div>\n\n <div className=\"mt-3 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3\">\n {w.steps.map((s, i) => (\n <React.Fragment key={i}>\n <span className=\"inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1 text-xs font-medium text-foreground\">\n <s.icon className=\"h-3.5 w-3.5 text-muted-foreground\" /> {s.label}\n </span>\n {i < w.steps.length - 1 && <ArrowRight className=\"h-3.5 w-3.5 text-muted-foreground\" />}\n </React.Fragment>\n ))}\n </div>\n </div>\n ))}\n </div>\n\n <p className=\"mt-4 text-center text-xs text-muted-foreground\">\n Mock preview · the visual builder + execution engine (event bus, scheduler) ships in a later milestone.\n </p>\n </div>\n )\n}\n","import React from 'react'\nimport type { PluginManifest, PluginScope, VerticalId } from '@fayz-ai/core'\nimport { AutomationsHome } from './views/AutomationsHome'\n\n// ---------------------------------------------------------------------------\n// @fayz-ai/plugin-automations — visual workflows (GoHighLevel \"Automation\").\n// Universal plugin. M1 ships a rich mock home; the trigger→action execution\n// engine over the core event bus + scheduler comes in a later milestone.\n// ---------------------------------------------------------------------------\n\nexport interface AutomationsPluginOptions {\n navPosition?: number\n navSection?: 'main' | 'secondary' | 'settings'\n navLabel?: string\n scope?: PluginScope\n verticalId?: VerticalId\n}\n\nexport function createAutomationsPlugin(options?: AutomationsPluginOptions): PluginManifest {\n const PageComponent: React.ComponentType<unknown> = () => React.createElement(AutomationsHome)\n PageComponent.displayName = 'AutomationsHome'\n\n return {\n id: 'automations',\n name: options?.navLabel ?? 'Automations',\n icon: 'Zap',\n version: '1.0.0',\n scope: options?.scope ?? 'universal',\n verticalId: options?.verticalId,\n defaultEnabled: true,\n dependencies: [],\n declaredFeatures: [{ id: 'automations', label: 'Automations', group: 'Automate' }],\n navigation: [\n {\n section: options?.navSection ?? 'main',\n position: options?.navPosition ?? 6,\n label: options?.navLabel ?? 'Automations',\n route: '/automations',\n icon: 'Zap',\n permission: { feature: 'automations', action: 'read' as const },\n },\n ],\n routes: [\n {\n path: '/automations',\n component: PageComponent,\n permission: { feature: 'automations', action: 'read' as const },\n },\n ],\n widgets: [],\n }\n}\n"]}
|