@cherwell/emdash-crm 0.0.0-stage → 0.1.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/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +205 -2
- package/assets/banner.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/icon.svg +6 -0
- package/dist/helpers/testing.d.ts +95 -0
- package/dist/helpers/testing.js +365 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +924 -0
- package/dist/manifest.json +921 -0
- package/dist/plugin.d.mts +6 -0
- package/dist/plugin.mjs +58 -0
- package/docs/faq.md +23 -0
- package/docs/install.md +38 -0
- package/docs/overview.md +10 -0
- package/docs/reference.md +332 -0
- package/docs/security.md +11 -0
- package/emdash-plugin.jsonc +74 -0
- package/llms.txt +20 -0
- package/package.json +77 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
First release.
|
|
6
|
+
|
|
7
|
+
- **Organisations and people:** roles with permissions, dated links, tags and custom fields. An organisation can run content entries.
|
|
8
|
+
- **Service API:** other plugins call the CRM's `service/*` routes with a shared Service key. [Memberships](../memberships) is built this way.
|
|
9
|
+
- **Fake CRM for tests:** `@cherwell/emdash-crm/testing` answers the service routes from memory, and a contract test keeps it in step with the real service.
|
|
10
|
+
- **Work and records:**
|
|
11
|
+
- tasks with due dates
|
|
12
|
+
- a timeline of notes, calls and messages
|
|
13
|
+
- CSV import in background steps
|
|
14
|
+
- JSON API and MCP tools
|
|
15
|
+
- signed webhooks
|
|
16
|
+
- audit trail
|
|
17
|
+
- subject-access export and erasure
|
|
18
|
+
- **Administrators only:** data requests, imports and webhooks. Archived organisations are closed to members.
|
|
19
|
+
- **Settings** for time zone, rate limits and retention.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cherwell Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,206 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CRM for EmDash
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="assets/icon.png" alt="" width="96" align="right">
|
|
4
|
+
|
|
5
|
+
**Organisations, people and their roles for EmDash, with a service API for plugins that build on it.**
|
|
6
|
+
|
|
7
|
+
A CRM for sites that work with businesses and groups: tourism boards, chambers of commerce, business improvement districts, clubs and associations. It keeps the organisations you work with, the people in them and each person's role, with a timeline, follow-up tasks, imports and data requests.
|
|
8
|
+
|
|
9
|
+
- **Organisations and people.** A person can belong to several organisations, each with a role (owner, manager, billing, contact, or your own). Links are dated, so history is kept. Both take tags and custom fields.
|
|
10
|
+
- **Entries.** An organisation can run content entries (a listing, an event). Each entry belongs to one organisation at most.
|
|
11
|
+
- **Roles and permissions.** Each role carries a list of permissions. The CRM stores them; plugins built on it check them.
|
|
12
|
+
- **Service API.** Other plugins can't read the CRM's storage, so they call its `service/*` routes with a shared **Service key**. [Memberships](../memberships) (`@cherwell/emdash-memberships`) works this way, and so can your own plugins.
|
|
13
|
+
- **For teams and tools:**
|
|
14
|
+
- tasks with due dates
|
|
15
|
+
- a timeline of notes, calls and messages
|
|
16
|
+
- CSV import in the background
|
|
17
|
+
- a JSON API and MCP tools
|
|
18
|
+
- signed webhooks
|
|
19
|
+
- an audit trail
|
|
20
|
+
- data-protection tools to export or erase a person
|
|
21
|
+
- **Built for a sandbox.** Every request stays inside Cloudflare's subrequest limit; long jobs run in batches.
|
|
22
|
+
|
|
23
|
+
The CRM holds no memberships, claims or members area of its own. Memberships and renewals are the [Memberships](../memberships) plugin; listing claims and a members area are plugins you build on the service API.
|
|
24
|
+
|
|
25
|
+
## Documentation
|
|
26
|
+
|
|
27
|
+
- [Overview](docs/overview.md): what it does and who it's for.
|
|
28
|
+
- [Installation](docs/install.md): install, settings and the Service key.
|
|
29
|
+
- [FAQ](docs/faq.md): memberships, other plugins, data requests and sandbox limits.
|
|
30
|
+
- [Reference](docs/reference.md): every setting, route, MCP tool and storage collection, generated from the code.
|
|
31
|
+
- [The service API](../../docs/crm-service.md): the contract for plugins that build on the CRM.
|
|
32
|
+
- [llms.txt](llms.txt): a summary for AI agents.
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
From the EmDash registry: **Admin ▸ Plugins ▸ Browse**, then search for *CRM*.
|
|
37
|
+
|
|
38
|
+
From npm:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm install @cherwell/emdash-crm
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import crm from "@cherwell/emdash-crm";
|
|
46
|
+
emdash({ plugins: [crm] }); // or sandboxed: [crm]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
It works with no settings. To let other plugins use it, set a **Service key** (see below).
|
|
50
|
+
|
|
51
|
+
## Roles and permissions
|
|
52
|
+
|
|
53
|
+
Roles are listed highest first, each with its permissions. Here are the defaults:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"owner": ["*"],
|
|
58
|
+
"manager": ["profile.update", "organisation.update", "entries.update", "people.invite", "membership.view", "report.view", "notify"],
|
|
59
|
+
"billing": ["profile.update", "membership.view", "billing.view"],
|
|
60
|
+
"contact": ["profile.update", "report.view"]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`*` means every permission any role lists, plus the base set (`profile.update`, `organisation.update`, `entries.update`, `people.invite`, `people.manage`, `membership.view`, `billing.view`, `report.view`, `notify`).
|
|
65
|
+
|
|
66
|
+
Permission names are free text. The CRM keeps them; the plugins built on it decide what each one allows. For example, a members area might show membership terms to `membership.view` and let `listing.update` edit the organisation's listings. Add the names your plugins check to your roles.
|
|
67
|
+
|
|
68
|
+
Some roles have a job:
|
|
69
|
+
|
|
70
|
+
- **Owner role** (`ownerRole`, `owner`): every organisation keeps at least one. Removing, demoting or erasing the last owner is refused.
|
|
71
|
+
- **Billing role** (`billingRole`, `billing`): who Memberships sends renewal reminders to first.
|
|
72
|
+
- **Notify permission** (`notifyPermission`, `notify`): who gets notifications about the organisation's entries, unless the organisation lists its own addresses.
|
|
73
|
+
- **Contact role** (`contactRole`, `contact`): given to people added without a role.
|
|
74
|
+
|
|
75
|
+
## Service API
|
|
76
|
+
|
|
77
|
+
Plugins that build on the CRM call `POST /_emdash/api/plugins/crm/service/<name>` on your own site, with the header `x-crm-service-key`. The routes are public, so the key is the only check: set **Service key** (`serviceKey`) to a long random value and give the same value to each plugin that uses the CRM. With no key set, every service call is refused.
|
|
78
|
+
|
|
79
|
+
| Route | Does |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `service/config` | Roles with their permissions, and the role settings. |
|
|
82
|
+
| `service/person` | A person by email or id, with their current organisations and roles. |
|
|
83
|
+
| `service/organisation` | One organisation, optionally with its people. |
|
|
84
|
+
| `service/organisations` | Name-prefix search, for pickers. |
|
|
85
|
+
| `service/entry-owner` | Which organisation runs an entry. |
|
|
86
|
+
| `service/organisation/create` | Adds an organisation. |
|
|
87
|
+
| `service/organisation/update` | Changes contact details, adds entries, sets active plans, changes status (optionally only from given statuses). |
|
|
88
|
+
| `service/person/ensure` | Finds a person by email or adds them. |
|
|
89
|
+
| `service/link` | Adds a person to an organisation, changes their role, or ends their place. |
|
|
90
|
+
| `service/activity` | A line on an organisation's timeline. |
|
|
91
|
+
| `service/record` | A line in the CRM's audit trail, and an event to the CRM's webhooks. |
|
|
92
|
+
|
|
93
|
+
Every write names an `actor` for the audit trail. The full contract, with inputs and answers, is in [docs/crm-service.md](../../docs/crm-service.md). `@cherwell/emdash-kit` has the client (`crmService`).
|
|
94
|
+
|
|
95
|
+
Organisations carry the **plans** Memberships keeps up to date (an active plan per scope). The organisation page shows them.
|
|
96
|
+
|
|
97
|
+
## Settings
|
|
98
|
+
|
|
99
|
+
| Setting | Default | |
|
|
100
|
+
|---|---|---|
|
|
101
|
+
| Roles (`roles`) | the defaults above | JSON. Malformed JSON uses the defaults. |
|
|
102
|
+
| Owner role, billing role (`ownerRole`, `billingRole`) | `owner`, `billing` | |
|
|
103
|
+
| Notify permission (`notifyPermission`) | `notify` | |
|
|
104
|
+
| Contact role (`contactRole`) | `contact` | |
|
|
105
|
+
| Custom fields on organisations and people (`orgFields`, `personFields`) | none | JSON. Malformed definitions are ignored. |
|
|
106
|
+
| Time zone (`timeZone`) | `UTC` | IANA name, e.g. `Europe/London`. Decides what "today" is for task due dates. |
|
|
107
|
+
| Service key (`serviceKey`) | none | Shared with plugins that build on the CRM. |
|
|
108
|
+
| Webhook secret (`webhookSecret`) | none | |
|
|
109
|
+
| Call budget (`callBudget`) | 28 | Host calls per background run. Raise it when running in-process. |
|
|
110
|
+
| Audit retention (`auditDays`) | 730 days | |
|
|
111
|
+
| Webhook delivery records (`deliveryDays`) | 30 days | |
|
|
112
|
+
|
|
113
|
+
Number settings outside their range are clamped, and an unknown time zone falls back to UTC.
|
|
114
|
+
|
|
115
|
+
Custom fields use the same format as the other Cherwell plugins:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
[{ "key": "vatNumber", "label": "VAT number", "type": "text" },
|
|
119
|
+
{ "key": "dietary", "label": "Dietary needs", "type": "text", "personal": true }]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Fields marked `personal` are included in data exports and cleared on erasure.
|
|
123
|
+
|
|
124
|
+
## Capabilities
|
|
125
|
+
|
|
126
|
+
| Capability | Why |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `content:read` | Link organisations to the entries they run, and show those entries' titles. |
|
|
129
|
+
| `network:request:unrestricted` | Webhooks to addresses you enter. |
|
|
130
|
+
|
|
131
|
+
## API
|
|
132
|
+
|
|
133
|
+
All routes are under `/_emdash/api/plugins/crm/`. Responses are `{ ok: true, … }` or `{ ok: false, error, fields? }`.
|
|
134
|
+
|
|
135
|
+
**Staff (editors and above):**
|
|
136
|
+
|
|
137
|
+
| Route | Does |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `organisations/list` | Lists organisations, filtered by `q`, `status`, `cursor` or `limit`. |
|
|
140
|
+
| `organisations/get` | Reads one organisation (`id`) with its people and recent timeline. |
|
|
141
|
+
| `organisations/create` | Creates an organisation. |
|
|
142
|
+
| `organisations/update` | Updates an organisation. |
|
|
143
|
+
| `people/find` | Finds people by `email` or name prefix `q`. |
|
|
144
|
+
| `people/update` | Updates a person. |
|
|
145
|
+
| `activities/add` | Adds a timeline entry. |
|
|
146
|
+
| `tasks/list` | Lists tasks. |
|
|
147
|
+
| `tasks/create` | Creates a task. |
|
|
148
|
+
| `tasks/complete` | Completes a task. |
|
|
149
|
+
|
|
150
|
+
**Administrators:** `privacy/export`, `privacy/erase` (each takes `email`).
|
|
151
|
+
|
|
152
|
+
**Public:**
|
|
153
|
+
|
|
154
|
+
- the `service/*` routes above (Service key required)
|
|
155
|
+
- `privacy/download` (GET; needs a signed link from **Data requests**, valid for 10 minutes)
|
|
156
|
+
|
|
157
|
+
### MCP tools
|
|
158
|
+
|
|
159
|
+
Turn them on in **Admin ▸ Plugins ▸ CRM ▸ MCP**.
|
|
160
|
+
|
|
161
|
+
- **Read:** `crm_organisations_list`, `crm_organisation_get`, `crm_people_find`, `crm_tasks_list`
|
|
162
|
+
- **Create:** `crm_organisation_create`, `crm_note_add`, `crm_task_create`
|
|
163
|
+
- **Marked destructive** (an agent must confirm): `crm_organisation_update`
|
|
164
|
+
|
|
165
|
+
## Webhooks
|
|
166
|
+
|
|
167
|
+
**The CRM's events:**
|
|
168
|
+
|
|
169
|
+
- **Organisations:** `crm.organisation.created`, `.updated`, `.archived`
|
|
170
|
+
- **People:** `crm.person.created`, `.updated`, `.joined`, `.left`, `.role_changed`, `.erased`
|
|
171
|
+
- **Tasks:** `crm.task.created`
|
|
172
|
+
|
|
173
|
+
Plugins built on the CRM send their events through `service/record`, so one webhook list covers them all. Their names start with the plugin, such as `memberships.term.created`, `.activated`, `.lapsed` and `.cancelled`; names starting `crm.` are refused. Memberships' events are offered from the start, and other plugins' events once the first one arrives. Use `memberships.*` to subscribe to a group. For signing, retries and verification, see the [Short Links README](../shortlinks/README.md#webhooks); every Cherwell plugin uses the same format.
|
|
174
|
+
|
|
175
|
+
## Data protection
|
|
176
|
+
|
|
177
|
+
**Data requests** finds what the CRM holds about an email address. It is for administrators only: editors see the page but can't search, download or erase. From there you can:
|
|
178
|
+
|
|
179
|
+
- **Download it** as JSON, through a signed link valid for 10 minutes: the person, their organisations and roles, tasks about them and their own messages.
|
|
180
|
+
- **Erase the person.** Their name, contact details and personal custom fields are removed. They leave every organisation, and their own messages are deleted. The row stays, anonymised, so history stays consistent.
|
|
181
|
+
|
|
182
|
+
Erasing the last owner of an organisation is refused until another owner is added. Every request is in the audit trail.
|
|
183
|
+
|
|
184
|
+
This covers only what the CRM holds. Plugins built on it keep their own records (membership terms, claims) and answer for them in their own data requests.
|
|
185
|
+
|
|
186
|
+
## Limits
|
|
187
|
+
|
|
188
|
+
- Imports run each row as up to two steps (the organisation, then its contact) in the background. Rows match an organisation by `id` or email; rows with neither always add a new one. Columns starting `_` are ignored. Membership terms are imported by Memberships.
|
|
189
|
+
- Data exports and erasure read messages in the first five organisations a person belongs to.
|
|
190
|
+
- Admin lists and `service/organisations` page 50 at a time.
|
|
191
|
+
- Up to 50 event names from other plugins are remembered for the webhook screen.
|
|
192
|
+
|
|
193
|
+
## Development
|
|
194
|
+
|
|
195
|
+
In this monorepo:
|
|
196
|
+
|
|
197
|
+
```sh
|
|
198
|
+
pnpm --filter @cherwell/emdash-crm validate
|
|
199
|
+
pnpm --filter @cherwell/emdash-crm typecheck
|
|
200
|
+
pnpm --filter @cherwell/emdash-crm test
|
|
201
|
+
pnpm --filter @cherwell/emdash-crm build
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Licence
|
|
205
|
+
|
|
206
|
+
MIT © Cherwell Studio
|
|
Binary file
|
package/assets/icon.png
ADDED
|
Binary file
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><g transform="translate(0 0)">
|
|
2
|
+
<defs><linearGradient id="t" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#4338CA"/><stop offset="1" stop-color="#312E81"/></linearGradient></defs>
|
|
3
|
+
<rect width="512" height="512" rx="112.64" fill="url(#t)"/>
|
|
4
|
+
<rect x="1" y="1" width="510" height="510" rx="111.64" fill="none" stroke="#fff" stroke-opacity=".14" stroke-width="2"/>
|
|
5
|
+
<g transform="translate(102.4 102.4) scale(12.799999999999999)" fill="none" stroke="#fff" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="8" r="3.2"/><path d="M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6"/><path d="M15.5 4.9a3.2 3.2 0 0 1 0 6.2"/><path d="M18 14.4c1.8.9 3 2.9 3 5.1"/></g>
|
|
6
|
+
</g></svg>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//#region src/testing.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A fake CRM service API (emdash-plugins/docs/crm-service.md), answering
|
|
4
|
+
* `POST {site}/_emdash/api/plugins/crm/service/<route>` from memory. Give
|
|
5
|
+
* `crm.fetch` to `createTestContext({ fetch })` and a plugin built on the
|
|
6
|
+
* CRM (claims, members) talks to it as it would to the real one: the same
|
|
7
|
+
* key header, the same `{ data: { ok, ... } }` answers and the same refusals
|
|
8
|
+
* (SERVICE_KEY, NOT_FOUND, ENTRY_TAKEN, LAST_OWNER, ROLE_UNKNOWN, ALREADY_MEMBER).
|
|
9
|
+
*
|
|
10
|
+
* import { fakeCrm } from "@cherwell/emdash-crm/testing";
|
|
11
|
+
*/
|
|
12
|
+
declare const CRM_KEY = "crm-service-key-0123456789";
|
|
13
|
+
type OrgStatus = "prospect" | "active" | "lapsed" | "archived";
|
|
14
|
+
interface FakeOrg {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
status: OrgStatus;
|
|
18
|
+
email: string | null;
|
|
19
|
+
phone: string | null;
|
|
20
|
+
website: string | null;
|
|
21
|
+
address: Record<string, string> | null;
|
|
22
|
+
entries: string[];
|
|
23
|
+
notifyEmails: string[];
|
|
24
|
+
plans: Record<string, string>;
|
|
25
|
+
renewals: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
interface FakePerson {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
email: string;
|
|
31
|
+
}
|
|
32
|
+
interface FakeLink {
|
|
33
|
+
orgId: string;
|
|
34
|
+
personId: string;
|
|
35
|
+
role: string;
|
|
36
|
+
jobTitle: string | null;
|
|
37
|
+
primary: boolean;
|
|
38
|
+
/** Set when the place ended. */
|
|
39
|
+
ended: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface FakeActivity {
|
|
42
|
+
orgId: string;
|
|
43
|
+
kind: string;
|
|
44
|
+
text: string;
|
|
45
|
+
by: string | null;
|
|
46
|
+
byName: string | null;
|
|
47
|
+
visibleToMember: boolean;
|
|
48
|
+
at: string;
|
|
49
|
+
}
|
|
50
|
+
interface FakeRecord {
|
|
51
|
+
actor: string;
|
|
52
|
+
action: string;
|
|
53
|
+
target: string;
|
|
54
|
+
before?: unknown;
|
|
55
|
+
after?: unknown;
|
|
56
|
+
event?: string;
|
|
57
|
+
data?: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
declare const DEFAULT_ROLES: Record<string, string[]>;
|
|
60
|
+
interface FakeCrmOptions {
|
|
61
|
+
key?: string;
|
|
62
|
+
site?: string;
|
|
63
|
+
roles?: Record<string, string[]>;
|
|
64
|
+
ownerRole?: string;
|
|
65
|
+
billingRole?: string;
|
|
66
|
+
notifyPermission?: string;
|
|
67
|
+
contactRole?: string;
|
|
68
|
+
}
|
|
69
|
+
declare function fakeCrm(opts?: FakeCrmOptions): {
|
|
70
|
+
orgs: Map<string, FakeOrg>;
|
|
71
|
+
people: Map<string, FakePerson>;
|
|
72
|
+
links: FakeLink[];
|
|
73
|
+
activities: FakeActivity[];
|
|
74
|
+
records: FakeRecord[];
|
|
75
|
+
calls: {
|
|
76
|
+
route: string;
|
|
77
|
+
body: any;
|
|
78
|
+
}[];
|
|
79
|
+
key: string; /** Answers every call with UNAVAILABLE-making junk while true. */
|
|
80
|
+
down: boolean;
|
|
81
|
+
addOrg(o: Partial<FakeOrg> & {
|
|
82
|
+
name: string;
|
|
83
|
+
}): string;
|
|
84
|
+
addPerson(email: string, name?: string): string;
|
|
85
|
+
link(orgId: string, personId: string, role: string, extra?: Partial<FakeLink>): void; /** An organisation with one primary owner. */
|
|
86
|
+
orgWithOwner(name: string, ownerEmail: string, extra?: Partial<FakeOrg>, ownerName?: string): string;
|
|
87
|
+
roleOf(orgId: string, email: string): string | null;
|
|
88
|
+
routes: () => string[]; /** Refuse the next call to `route` with `code`. */
|
|
89
|
+
refuseNext(route: string, code: string): void;
|
|
90
|
+
answer(route: string, b: any): object; /** For `createTestContext({ fetch })`. */
|
|
91
|
+
fetch(url: string, init?: RequestInit): Promise<Response>;
|
|
92
|
+
};
|
|
93
|
+
type FakeCrm = ReturnType<typeof fakeCrm>;
|
|
94
|
+
//#endregion
|
|
95
|
+
export { CRM_KEY, DEFAULT_ROLES, FakeActivity, FakeCrm, FakeCrmOptions, FakeLink, FakeOrg, FakePerson, FakeRecord, OrgStatus, fakeCrm };
|