nixflex 0.11.0 → 0.11.2
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/{KIT-EXAMPLES-K7.md → CALL-EXAMPLES.md} +2 -2
- package/CALL-REQUESTS.md +3 -5
- package/CHANGELOG.md +35 -34
- package/{B57-DELETES.md → DELETING-CONTENT.md} +2 -4
- package/KNOWLEDGE.md +6 -6
- package/LICENSE +21 -21
- package/METHODS.md +13 -13
- package/{KIT-EXAMPLES-K6.md → NUMBER-EXAMPLES.md} +118 -118
- package/NUMBER-FEATURES.md +3 -5
- package/ORGANISATIONS.md +7 -9
- package/README.md +24 -38
- package/TEAM-INTEGRATIONS.md +65 -69
- package/THIRD-PARTY-NOTICES.md +26 -26
- package/dist/cli/index.js +18 -18
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +2 -2
- package/package.json +5 -5
package/NUMBER-FEATURES.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Engine contract: deb63749acc74fe5d1d840dbf3589b2c40b5627e (B50/B50b/B51/B52). No engine changes. Public Cal.com methods remain unchanged.
|
|
1
|
+
# Calendar, number credentials, SMS and bookings
|
|
4
2
|
|
|
5
3
|
| HTTP operation (number is URL-encoded E.164) | Node / CLI command | Python sync + async | MCP |
|
|
6
4
|
| --- | --- | --- | --- |
|
|
@@ -44,8 +42,8 @@ New response: HTTP 409, type `conflict`, code `do_not_contact`. Node/Python rais
|
|
|
44
42
|
|
|
45
43
|
## Booking webhook model
|
|
46
44
|
|
|
47
|
-
Node/Python export Booking, CallCompletedBookingEvent and SmsBookingEvent. MCP ships bookingSchema, callCompletedBookingSchema and smsBookingSchema in
|
|
45
|
+
Node/Python export Booking, CallCompletedBookingEvent and SmsBookingEvent. MCP ships bookingSchema, callCompletedBookingSchema and smsBookingSchema in booking-schemas.js (models, not extra tools). Verify the original raw-body webhook signature first using the existing verifier; these models do not authenticate a delivery.
|
|
48
46
|
|
|
49
47
|
Required booking keys: action (`created`/`rescheduled`/`cancelled`), booking_uid, start, end, attendee_name, attendee_email, service, timezone. Every field except action can be null; service can also be a string or number. Do not turn null into fabricated dates or attendee data. The flat call.completed event has bookings[], sms.booking has booking. Duplicate `already_exists` lookup is internal and is NOT a public booking mutation. Event models describe the booking part; other existing envelope fields remain available. No webhook receiver or listener is added.
|
|
50
48
|
|
|
51
|
-
See
|
|
49
|
+
See [Number examples](NUMBER-EXAMPLES.md) for Node, CLI, Python and MCP usage.
|
package/ORGANISATIONS.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
# Organisations
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
These use the existing organisation API key and its Owner-level API authority. Removing a dashboard member does not invalidate an externally shared key; the Owner must roll that key separately. No new key is created. No personal acceptance, Leave, ownership transfer or account deletion is exposed through this resource. No automatic signing-secret disclosure.
|
|
6
|
-
|
|
7
|
-
CLI: `nixflex organisation get`, `members`, `activity`; changes `invite`, `claim`, `resend ID`, `revoke ID`, `remove USER_ID`, `role USER_ID`. Use `--set email=person@example.com`, `--set role=member` (or admin), Activity `--set before=123 --set actor=UUID`. Review the default preview, then add `--confirm` to make a change. Never blindly repeat after an unknown response.
|
|
8
|
-
|
|
9
|
-
The current SDK fixed-resource CLI coverage test has no Organisation mapping. It remains unchanged and fails deliberately until an additive test-map extension is approved. New behavioural tests prove each implemented route and preview. Do not publish this candidate while any full gate fails.
|
|
1
|
+
# Organisations and members
|
|
2
|
+
|
|
3
|
+
Read `client.organisation.get()`, `.members()` and `.activity({before,actor})`. Manage `.invite(email,role)`, `.resend(inviteId)`, `.revoke(inviteId)`, `.removeMember(userId)`, `.setRole(userId,role)` and API-only `.claimInvite(email)`.
|
|
4
|
+
|
|
5
|
+
These use the existing organisation API key and its Owner-level API authority. Removing a dashboard member does not invalidate an externally shared key; the Owner must roll that key separately. No new key is created. No personal acceptance, Leave, ownership transfer or account deletion is exposed through this resource. No automatic signing-secret disclosure.
|
|
6
|
+
|
|
7
|
+
CLI: `nixflex organisation get`, `members`, `activity`; changes `invite`, `claim`, `resend ID`, `revoke ID`, `remove USER_ID`, `role USER_ID`. Use `--set email=person@example.com`, `--set role=member` (or admin), Activity `--set before=123 --set actor=UUID`. Review the default preview, then add `--confirm` to make a change. Never blindly repeat after an unknown response.
|
package/README.md
CHANGED
|
@@ -1,56 +1,42 @@
|
|
|
1
|
-
# Nixflex Node SDK and CLI
|
|
1
|
+
# Nixflex Node SDK and CLI
|
|
2
|
+
> **Building with AI?** Tell your assistant to read https://docs.nixflex.com/ai-rules.md first - the rules for building on Nixflex (safe defaults, costs, what to ask before acting). Full docs: https://docs.nixflex.com
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
Copy the whole API key from **API Keys** in your Nixflex dashboard and store it privately in `NIXFLEX_API_KEY`. Pass the value exactly as copied, including its colon. Raw HTTP requests use `https://api.nixflex.com/v1` and the header `Authorization: Bearer <whole key>`. For the SDK or MCP server, use the origin `https://api.nixflex.com`. The client adds `/v1` to requests.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Install with `npm install nixflex`. The SDK and CLI require Node 18 or later. The SDK uses native fetch.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
```js
|
|
8
9
|
import Nixflex from 'nixflex';
|
|
9
|
-
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY});
|
|
10
|
-
const agents = await client.agents.list({limit:1});
|
|
11
|
-
// Do not print private responses or credentials.
|
|
12
|
-
~~~
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
const client = new Nixflex({ apiKey: process.env.NIXFLEX_API_KEY });
|
|
12
|
+
const agents = await client.agents.list({ limit: 1 });
|
|
13
|
+
```
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Run `npx nixflex --help` to see the CLI commands. Use `--base-url` to select an API origin and `--json` for machine-readable results. Commands that support a preview require `--confirm` before sending the change.
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
## Connect an AI assistant
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
MCP setup requires Node 22 or later. The CLI can write the Claude Desktop and Cursor configuration. Claude Code and Codex use manual setup. Regular setup configures a launcher for `nixflex-mcp@0.5.0`. Use `--mcp-local DIRECTORY` with a locally installed server. Supply the key and API origin through the client environment. Legacy credential files store the key as plain text.
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
The CLI refuses malformed or unreadable configuration, preserves unrelated entries and comments, and asks before replacing an entry. Close any other configuration editor before saving. See the [client setup guide](https://docs.nixflex.com/ai-tools/overview).
|
|
23
22
|
|
|
24
|
-
##
|
|
23
|
+
## Requests and errors
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
GET requests retry once by default. Writes make one attempt, including after HTTP 429, a lost reply or a malformed success. If the SDK raises `NixflexOutcomeUnknownError` with `safe_to_retry:false`, inspect the server state before taking further action. Keep raw errors, credentials, customer content, recordings and private integration responses out of logs.
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
An organisation API key acts with Owner authority. Personal login, invitation acceptance, ownership transfer and account closure require a dashboard session. Use the organisation’s separate signing secret to verify the original webhook body. API-key rotation leaves that signing secret intact.
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
Omitting an optional field preserves its default. New agents default to dynamic greeting on, a maximum duration of 300 seconds and a silence timeout of 10 seconds. For single calls, use `dynamic_vars` or its non-conflicting alias `variables`. Campaign recipient variables keep their own shape. Supply an SMS sender and use `message_template` and `scheduled_date` for campaigns.
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
Keep filters and string cursors when paging. Stop when `next_cursor` is null. Call iterators accept page sizes from 1 to 200. Offset pages can change between requests. An integration PUT replaces its configuration. A custom-function PATCH changes only the supplied fields.
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
A caller lookup can return two different 404 codes. `caller_not_found` means the owned business number has no saved record for that caller. `phone_number_not_found` means the business number is missing or belongs to another account. Both SDKs expose the exact code on `NixflexNotFoundError`. CLI JSON includes `error.status` and `error.code` and exits with status 1.
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
## Guides
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
- [Retained booking results and saved outbound requests](https://docs.nixflex.com/ai-tools/call-results). Save the request ID before the first send so you can look up an uncertain outcome.
|
|
38
|
+
- [Call history](https://docs.nixflex.com/guides/developer/call-history) and [campaigns](https://docs.nixflex.com/guides/developer/campaigns). Deletion can end running calls. A queued response means cleanup is still pending.
|
|
39
|
+
- [Calendar settings](https://docs.nixflex.com/ai-tools/calendar-settings) and [number credentials](https://docs.nixflex.com/ai-tools/number-credentials).
|
|
40
|
+
- [Organisations](https://docs.nixflex.com/guides/developer/organisations) and [Knowledge](https://docs.nixflex.com/guides/developer/knowledge).
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Unpublished candidates. Offline coverage does not prove successful mutations on staging; those tests remain manual.
|
|
43
|
-
|
|
44
|
-
## Caller read: missing record versus wrong number
|
|
45
|
-
|
|
46
|
-
GET /v1/phone-numbers/:phoneNumber/callers/:callerNumber returns HTTP 404 with code caller_not_found when the owned number has no saved record for that caller. HTTP 404 phone_number_not_found means the business number is missing or is not owned by this account; do not treat it as an empty caller record. Generic not_found is not the documented caller-absence response.
|
|
47
|
-
|
|
48
|
-
Node and Python raise NixflexNotFoundError with status=404 and the exact server code. CLI --json exits 1 and preserves error.status and error.code (it does not serialize a JavaScript exception class). Inspect the code; never swallow all 404s. The K5b staging checker passes its synthetic-caller absence check only for 404 caller_not_found and selects that probe's business number from the authenticated account list, excluding the two protected staging numbers. With no eligible number it reports PENDING and sends no caller request. Never log the key, headers or raw response body.
|
|
49
|
-
|
|
50
|
-
## K6 additions
|
|
51
|
-
|
|
52
|
-
Four Google Calendar methods, private number credentials, SMS 409 handling and booking models. Read [NUMBER-FEATURES.md](NUMBER-FEATURES.md) for exact fields, safe errors and recovery. All earlier exclusions remain, except the two explicit K6 MCP additions noted there.
|
|
53
|
-
|
|
54
|
-
## K7 additions
|
|
55
|
-
|
|
56
|
-
Read a call’s retained booking result and its saved outbound request. Optional UUID request_id adds duplicate protection without automatic redial. Prepare and save the ID before the first send. See [CALL-REQUESTS.md](CALL-REQUESTS.md) for every state/error and [KIT-EXAMPLES-K7.md](KIT-EXAMPLES-K7.md) for Node, CLI, Python sync/async and MCP examples. Existing no-ID calls keep their old behavior.
|
|
42
|
+
[Package guide](https://docs.nixflex.com/sdks/node) · Developer contact: dev@nixflex.com
|
package/TEAM-INTEGRATIONS.md
CHANGED
|
@@ -1,69 +1,65 @@
|
|
|
1
|
-
# Organisation and integration settings
|
|
2
|
-
|
|
3
|
-
Use the account API key privately. It has Owner authority. These kits do not
|
|
4
|
-
accept a teammate's dashboard session or impersonate a role.
|
|
5
|
-
|
|
6
|
-
| Kit | Entry point |
|
|
7
|
-
| --- | --- |
|
|
8
|
-
| Node | client.organisation, client.integrations |
|
|
9
|
-
| CLI | nixflex organisation, nixflex integrations |
|
|
10
|
-
| Python sync/async | client.organisation, client.integrations |
|
|
11
|
-
| MCP | See KITS-COVERAGE.md for included tools and deliberate exceptions |
|
|
12
|
-
|
|
13
|
-
Organisation reads: get, members, activity. JSON activity accepts before, actor,
|
|
14
|
-
from, to; Python spells from as from_. Dates are inclusive UTC calendar dates,
|
|
15
|
-
clamped to retained history. IDs and next_cursor are strings; never parse them as
|
|
16
|
-
floating-point numbers. Continue JSON pages with next_cursor as before until null.
|
|
17
|
-
|
|
18
|
-
Node activityCsv and Python activity_csv stream CSV bytes. Python async usage is
|
|
19
|
-
async for, not await. The server reads 500 rows per database chunk and rechecks
|
|
20
|
-
authority each chunk. Closing/stopping early must close/aclose the iterator.
|
|
21
|
-
Discard partial output after any error. Streaming never automatically restarts
|
|
22
|
-
after yielding data. The CLI activityCsv --output FILE publishes the file only
|
|
23
|
-
after completion and never overwrites an existing file.
|
|
24
|
-
|
|
25
|
-
Organisation changes: invite, claimInvite/claim_invite, resend, revoke,
|
|
26
|
-
removeMember/remove_member, setRole/set_role, rename. Personal acceptance, leave,
|
|
27
|
-
ownership transfer and closure stay dashboard only. A sent invitation means
|
|
28
|
-
provider acceptance, not delivery to the inbox. A resent invite replaces the old
|
|
29
|
-
link. A membership 202/live_disconnect_pending means the change committed but
|
|
30
|
-
live disconnection is unconfirmed; do not repeat the membership change blindly.
|
|
31
|
-
|
|
32
|
-
Personal dashboard rules still apply there: Members cannot manage team/settings;
|
|
33
|
-
Admins have permitted Member-management/settings rights but cannot manage Admins,
|
|
34
|
-
rename the organisation, access keys, transfer ownership or close the account.
|
|
35
|
-
The API key is Owner authority, so these kits cannot test personal Admin/Member
|
|
36
|
-
access. Server refusals remain typed errors.
|
|
37
|
-
|
|
38
|
-
Integration get/set/delete supports only calcom, slack, zapier, make, gohighlevel,
|
|
39
|
-
webhook, webhook2, precall, web-calls. Use getAgentPrecall/setAgentPrecall/
|
|
40
|
-
deleteAgentPrecall (snake_case in Python) for the agent default. Number pre-call
|
|
41
|
-
overrides the default; removing the override can expose the default again.
|
|
42
|
-
|
|
43
|
-
Provider PUT replaces stored configuration. Supply required credentials privately;
|
|
44
|
-
omitted options reset to documented server defaults. Optional agent_id is only a
|
|
45
|
-
fallback when the number has no assigned agent; it does not move the number.
|
|
46
|
-
Web-call reads return the saved flag, not proof of effective availability.
|
|
47
|
-
|
|
48
|
-
Functions use listFunctions/createFunction/updateFunction/deleteFunction
|
|
49
|
-
(snake_case in Python). At most 15 per number; names are lowercase snake_case,
|
|
50
|
-
maximum 64 characters; default method POST. timeout_ms defaults to 5000 and is
|
|
51
|
-
clamped server-side to 1000..45000. PATCH only changes supplied fields; null
|
|
52
|
-
speak_during clears it; an empty PATCH is refused. Reads expose has_headers,
|
|
53
|
-
never the header values. Empty lists and successful no-op deletes are not proof
|
|
54
|
-
of ownership or previous existence.
|
|
55
|
-
|
|
56
|
-
SDKs return exact wire data without logging it. URLs can contain credentials:
|
|
57
|
-
never print full integration responses. Use private body files/environment input.
|
|
58
|
-
CLI display omits URLs, credential fields and free-form configuration, including
|
|
59
|
-
webhook get/delete previews. Signing-secret retrieval is a private human action,
|
|
60
|
-
not a kit method. Do not paste credential settings into an AI conversation.
|
|
61
|
-
|
|
62
|
-
Every NEW CLI/MCP write needs explicit confirmation before any HTTP request.
|
|
63
|
-
SDK writes are explicit method calls. Only GET may retry, with a bounded budget.
|
|
64
|
-
Unknown write outcomes stay outcome_unknown / safe_to_retry:false: read current
|
|
65
|
-
state before deciding whether to retry manually.
|
|
66
|
-
|
|
67
|
-
K4-TEST.ps1 is read-only and uses built packages. It refuses every mutation at its
|
|
68
|
-
transport boundary. Successful writes require a separately authorised manual test
|
|
69
|
-
on disposable resources; never use the protected production/testing numbers.
|
|
1
|
+
# Organisation and integration settings
|
|
2
|
+
|
|
3
|
+
Use the account API key privately. It has Owner authority. These kits do not
|
|
4
|
+
accept a teammate's dashboard session or impersonate a role.
|
|
5
|
+
|
|
6
|
+
| Kit | Entry point |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| Node | client.organisation, client.integrations |
|
|
9
|
+
| CLI | nixflex organisation, nixflex integrations |
|
|
10
|
+
| Python sync/async | client.organisation, client.integrations |
|
|
11
|
+
| MCP | See KITS-COVERAGE.md for included tools and deliberate exceptions |
|
|
12
|
+
|
|
13
|
+
Organisation reads: get, members, activity. JSON activity accepts before, actor,
|
|
14
|
+
from, to; Python spells from as from_. Dates are inclusive UTC calendar dates,
|
|
15
|
+
clamped to retained history. IDs and next_cursor are strings; never parse them as
|
|
16
|
+
floating-point numbers. Continue JSON pages with next_cursor as before until null.
|
|
17
|
+
|
|
18
|
+
Node activityCsv and Python activity_csv stream CSV bytes. Python async usage is
|
|
19
|
+
async for, not await. The server reads 500 rows per database chunk and rechecks
|
|
20
|
+
authority each chunk. Closing/stopping early must close/aclose the iterator.
|
|
21
|
+
Discard partial output after any error. Streaming never automatically restarts
|
|
22
|
+
after yielding data. The CLI activityCsv --output FILE publishes the file only
|
|
23
|
+
after completion and never overwrites an existing file.
|
|
24
|
+
|
|
25
|
+
Organisation changes: invite, claimInvite/claim_invite, resend, revoke,
|
|
26
|
+
removeMember/remove_member, setRole/set_role, rename. Personal acceptance, leave,
|
|
27
|
+
ownership transfer and closure stay dashboard only. A sent invitation means
|
|
28
|
+
provider acceptance, not delivery to the inbox. A resent invite replaces the old
|
|
29
|
+
link. A membership 202/live_disconnect_pending means the change committed but
|
|
30
|
+
live disconnection is unconfirmed; do not repeat the membership change blindly.
|
|
31
|
+
|
|
32
|
+
Personal dashboard rules still apply there: Members cannot manage team/settings;
|
|
33
|
+
Admins have permitted Member-management/settings rights but cannot manage Admins,
|
|
34
|
+
rename the organisation, access keys, transfer ownership or close the account.
|
|
35
|
+
The API key is Owner authority, so these kits cannot test personal Admin/Member
|
|
36
|
+
access. Server refusals remain typed errors.
|
|
37
|
+
|
|
38
|
+
Integration get/set/delete supports only calcom, slack, zapier, make, gohighlevel,
|
|
39
|
+
webhook, webhook2, precall, web-calls. Use getAgentPrecall/setAgentPrecall/
|
|
40
|
+
deleteAgentPrecall (snake_case in Python) for the agent default. Number pre-call
|
|
41
|
+
overrides the default; removing the override can expose the default again.
|
|
42
|
+
|
|
43
|
+
Provider PUT replaces stored configuration. Supply required credentials privately;
|
|
44
|
+
omitted options reset to documented server defaults. Optional agent_id is only a
|
|
45
|
+
fallback when the number has no assigned agent; it does not move the number.
|
|
46
|
+
Web-call reads return the saved flag, not proof of effective availability.
|
|
47
|
+
|
|
48
|
+
Functions use listFunctions/createFunction/updateFunction/deleteFunction
|
|
49
|
+
(snake_case in Python). At most 15 per number; names are lowercase snake_case,
|
|
50
|
+
maximum 64 characters; default method POST. timeout_ms defaults to 5000 and is
|
|
51
|
+
clamped server-side to 1000..45000. PATCH only changes supplied fields; null
|
|
52
|
+
speak_during clears it; an empty PATCH is refused. Reads expose has_headers,
|
|
53
|
+
never the header values. Empty lists and successful no-op deletes are not proof
|
|
54
|
+
of ownership or previous existence.
|
|
55
|
+
|
|
56
|
+
SDKs return exact wire data without logging it. URLs can contain credentials:
|
|
57
|
+
never print full integration responses. Use private body files/environment input.
|
|
58
|
+
CLI display omits URLs, credential fields and free-form configuration, including
|
|
59
|
+
webhook get/delete previews. Signing-secret retrieval is a private human action,
|
|
60
|
+
not a kit method. Do not paste credential settings into an AI conversation.
|
|
61
|
+
|
|
62
|
+
Every NEW CLI/MCP write needs explicit confirmation before any HTTP request.
|
|
63
|
+
SDK writes are explicit method calls. Only GET may retry, with a bounded budget.
|
|
64
|
+
Unknown write outcomes stay outcome_unknown / safe_to_retry:false: read current
|
|
65
|
+
state before deciding whether to retry manually.
|
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# Bundled CLI dependency
|
|
2
|
-
|
|
3
|
-
The MCP configuration editor in the CLI bundles jsonc-parser 3.3.1.
|
|
4
|
-
The SDK library does not acquire a runtime dependency from this installer work.
|
|
5
|
-
|
|
6
|
-
The MIT License (MIT)
|
|
7
|
-
|
|
8
|
-
Copyright (c) Microsoft
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
SOFTWARE.
|
|
1
|
+
# Bundled CLI dependency
|
|
2
|
+
|
|
3
|
+
The MCP configuration editor in the CLI bundles jsonc-parser 3.3.1.
|
|
4
|
+
The SDK library does not acquire a runtime dependency from this installer work.
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) Microsoft
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
package/dist/cli/index.js
CHANGED
|
@@ -422,7 +422,7 @@ function queuedContentDelete(method, path2, status, body, requestId2) {
|
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
// src/client.ts
|
|
425
|
-
var SDK_VERSION = "0.11.
|
|
425
|
+
var SDK_VERSION = "0.11.2";
|
|
426
426
|
var DEFAULT_BASE_URL = "https://api.nixflex.com";
|
|
427
427
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
428
428
|
var HttpClient = class {
|
|
@@ -452,7 +452,7 @@ var HttpClient = class {
|
|
|
452
452
|
constructor(opts) {
|
|
453
453
|
if (!opts || typeof opts.apiKey !== "string" || !opts.apiKey.includes(":")) {
|
|
454
454
|
throw new Error(
|
|
455
|
-
|
|
455
|
+
"Nixflex: supply the whole dashboard API key as apiKey, including its colon. Find yours at https://dashboard.nixflex.com under API Keys."
|
|
456
456
|
);
|
|
457
457
|
}
|
|
458
458
|
this.apiKey = opts.apiKey;
|
|
@@ -2272,7 +2272,7 @@ async function activityExport(c, output, body) {
|
|
|
2272
2272
|
}
|
|
2273
2273
|
|
|
2274
2274
|
// src/cli/organisation.ts
|
|
2275
|
-
var organisationHelp = "\nORGANISATION
|
|
2275
|
+
var organisationHelp = "\nORGANISATION\n" + [
|
|
2276
2276
|
"organisation rename --set name=Business --confirm",
|
|
2277
2277
|
"organisation activityCsv --output activity.csv [--set from=2026-10-01 --set to=2026-10-31]",
|
|
2278
2278
|
"organisation get",
|
|
@@ -2369,11 +2369,11 @@ async function coreRead(client, group, cmd, id, values) {
|
|
|
2369
2369
|
throw new Error("Use account retention, keys activity, voices list, or voices get <voice_key>.");
|
|
2370
2370
|
}
|
|
2371
2371
|
|
|
2372
|
-
// src/cli/
|
|
2373
|
-
var
|
|
2374
|
-
var
|
|
2375
|
-
var
|
|
2376
|
-
|
|
2372
|
+
// src/cli/campaigns-and-conversations.ts
|
|
2373
|
+
var conversationGroups = ["contacts", "web-agent", "inbox"];
|
|
2374
|
+
var conversationFlags = Object.fromEntries(["channel", "after", "archived", "unread", "before-id", "thread", "number"].map((key) => [key, { type: "string" }]));
|
|
2375
|
+
var conversationHelp = `
|
|
2376
|
+
CAMPAIGNS AND CONVERSATIONS
|
|
2377
2377
|
campaigns list [--status S] [--limit N] default 50; cap 200; no cursor
|
|
2378
2378
|
campaigns cancel <id> --confirm in-progress work may finish
|
|
2379
2379
|
campaigns consent <id> --body @consent.json --confirm
|
|
@@ -2398,10 +2398,10 @@ C5 CAMPAIGNS AND CONVERSATIONS
|
|
|
2398
2398
|
Reads never acknowledge messages. Preserve string read_version; archive is not erasure.
|
|
2399
2399
|
Campaign creation is executable work, NOT a draft. Writes never auto-retry.
|
|
2400
2400
|
`;
|
|
2401
|
-
function
|
|
2402
|
-
return
|
|
2401
|
+
function isConversationCommand(group, cmd, sub) {
|
|
2402
|
+
return conversationGroups.includes(group) || group === "campaigns" && ["list", "cancel", "consent", "resume"].includes(cmd) || group === "sms" && cmd === "campaigns" && ["update", "cancel", "consent", "resume"].includes(sub || "");
|
|
2403
2403
|
}
|
|
2404
|
-
async function
|
|
2404
|
+
async function runConversationCommand(c, pos, values, body, confirmed) {
|
|
2405
2405
|
const [group, cmd, a1, a2] = pos;
|
|
2406
2406
|
const str = (key) => values[key];
|
|
2407
2407
|
const num = (key) => values[key] === void 0 ? void 0 : Number(values[key]);
|
|
@@ -2457,7 +2457,7 @@ async function c5Command(c, pos, values, body, confirmed) {
|
|
|
2457
2457
|
if (cmd === "thread") return c.inbox.thread(channel, number, thread, { limit: num("limit"), before: str("before"), before_id: str("before-id") });
|
|
2458
2458
|
if (cmd === "update") return write(() => c.inbox.update(channel, number, thread, body));
|
|
2459
2459
|
}
|
|
2460
|
-
throw new Error("Unknown
|
|
2460
|
+
throw new Error("Unknown campaign or conversation command. Run nixflex --help.");
|
|
2461
2461
|
}
|
|
2462
2462
|
|
|
2463
2463
|
// src/cli/core-fields.ts
|
|
@@ -4129,7 +4129,7 @@ async function setupMcp(app, { confirmed = false, localPackage, env = process.en
|
|
|
4129
4129
|
}
|
|
4130
4130
|
|
|
4131
4131
|
// src/cli/index.ts
|
|
4132
|
-
var VERSION = true ? "0.11.
|
|
4132
|
+
var VERSION = true ? "0.11.2" : "0.0.0";
|
|
4133
4133
|
var CONFIG_DIR = join4(homedir3(), ".nixflex");
|
|
4134
4134
|
var CONFIG_FILE = join4(CONFIG_DIR, "config.json");
|
|
4135
4135
|
function readConfig() {
|
|
@@ -4325,7 +4325,7 @@ function recipientsFromCsv(file, allowOverride) {
|
|
|
4325
4325
|
return rec;
|
|
4326
4326
|
});
|
|
4327
4327
|
}
|
|
4328
|
-
var GROUPS = ["login", "logout", "whoami", "usage", "doctor", "completion", "mcp", "agents", "calls", "campaigns", "numbers", "callers", "sms", "webhooks", "keys", "organisation", "integrations", "knowledge", ...coreGroups, ...
|
|
4328
|
+
var GROUPS = ["login", "logout", "whoami", "usage", "doctor", "completion", "mcp", "agents", "calls", "campaigns", "numbers", "callers", "sms", "webhooks", "keys", "organisation", "integrations", "knowledge", ...coreGroups, ...conversationGroups];
|
|
4329
4329
|
var HELP = `nixflex ${VERSION} - the Nixflex voice AI platform from your terminal
|
|
4330
4330
|
|
|
4331
4331
|
USAGE nixflex <group> <command> [args] [--json] [--key KEY] [--base-url URL]
|
|
@@ -4454,7 +4454,7 @@ async function main() {
|
|
|
4454
4454
|
...callRequestFlags,
|
|
4455
4455
|
...knowledgeFlags,
|
|
4456
4456
|
...coreFlags,
|
|
4457
|
-
...
|
|
4457
|
+
...conversationFlags,
|
|
4458
4458
|
output: { type: "string" },
|
|
4459
4459
|
...agentListFlags,
|
|
4460
4460
|
...callReadFlags,
|
|
@@ -4507,7 +4507,7 @@ async function main() {
|
|
|
4507
4507
|
return;
|
|
4508
4508
|
}
|
|
4509
4509
|
if (!group || values.help) {
|
|
4510
|
-
process.stdout.write(HELP + organisationHelp + coreHelp +
|
|
4510
|
+
process.stdout.write(HELP + organisationHelp + coreHelp + conversationHelp + integrationsHelp + knowledgeHelp + k6Help + callRequestHelp);
|
|
4511
4511
|
return;
|
|
4512
4512
|
}
|
|
4513
4513
|
if (!GROUPS.includes(group)) {
|
|
@@ -4553,8 +4553,8 @@ async function main() {
|
|
|
4553
4553
|
out(await k6Command(client, positionals, values, confirmed, () => bodyFrom(values)));
|
|
4554
4554
|
return;
|
|
4555
4555
|
}
|
|
4556
|
-
if (
|
|
4557
|
-
out(await
|
|
4556
|
+
if (isConversationCommand(group, cmd, a1)) {
|
|
4557
|
+
out(await runConversationCommand(client, positionals, values, bodyFrom(values), confirmed));
|
|
4558
4558
|
return;
|
|
4559
4559
|
}
|
|
4560
4560
|
if (coreGroups.includes(group) || group === "keys" && cmd === "activity") {
|
package/dist/index.cjs
CHANGED
|
@@ -444,7 +444,7 @@ function queuedContentDelete(method, path2, status, body, requestId2) {
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
// src/client.ts
|
|
447
|
-
var SDK_VERSION = "0.11.
|
|
447
|
+
var SDK_VERSION = "0.11.2";
|
|
448
448
|
var DEFAULT_BASE_URL = "https://api.nixflex.com";
|
|
449
449
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
450
450
|
var HttpClient = class {
|
|
@@ -474,7 +474,7 @@ var HttpClient = class {
|
|
|
474
474
|
constructor(opts) {
|
|
475
475
|
if (!opts || typeof opts.apiKey !== "string" || !opts.apiKey.includes(":")) {
|
|
476
476
|
throw new Error(
|
|
477
|
-
|
|
477
|
+
"Nixflex: supply the whole dashboard API key as apiKey, including its colon. Find yours at https://dashboard.nixflex.com under API Keys."
|
|
478
478
|
);
|
|
479
479
|
}
|
|
480
480
|
this.apiKey = opts.apiKey;
|
package/dist/index.d.cts
CHANGED
|
@@ -10,7 +10,7 @@ interface BodyOptions {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
interface NixflexClientOptions {
|
|
13
|
-
/** Your
|
|
13
|
+
/** Your whole API key, copied from the dashboard. */
|
|
14
14
|
apiKey: string;
|
|
15
15
|
/** Override the API base URL (testing/staging). Default: https://api.nixflex.com */
|
|
16
16
|
baseUrl?: string;
|
|
@@ -617,7 +617,7 @@ interface OutboundRequestReceipt {
|
|
|
617
617
|
[receiptField: string]: unknown;
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
-
/**
|
|
620
|
+
/** API wire contract. Server defaults apply only when a field is omitted. */
|
|
621
621
|
type CampaignCancelResponse = {
|
|
622
622
|
"campaign_id": string;
|
|
623
623
|
"status": "cancelled";
|
|
@@ -914,7 +914,7 @@ interface PhoneNumberImportParams {
|
|
|
914
914
|
telnyx_api_key?: string;
|
|
915
915
|
/** Your TeXML Application ID. Telnyx import. */
|
|
916
916
|
telnyx_connection_id?: string;
|
|
917
|
-
/** Optional Telnyx signature public
|
|
917
|
+
/** Optional Telnyx signature public key; saving does not verify it. */
|
|
918
918
|
telnyx_public_key?: string;
|
|
919
919
|
/** Per-number prompt override, max 8000 chars. */
|
|
920
920
|
custom_prompt?: string | null;
|
|
@@ -1007,7 +1007,7 @@ interface PhoneNumberUpdateParams {
|
|
|
1007
1007
|
web_agent_enabled?: boolean;
|
|
1008
1008
|
/** Website visitors may use all enabled custom functions. Default OFF. */
|
|
1009
1009
|
web_functions_enabled?: boolean;
|
|
1010
|
-
/** Telnyx webhook public
|
|
1010
|
+
/** Telnyx webhook public key; saving it does not verify it. */
|
|
1011
1011
|
telnyx_public_key?: string;
|
|
1012
1012
|
require_booking_confirmation?: boolean | null;
|
|
1013
1013
|
/** Business profile layered on the agent prompt for CALLS only. Max 8000. null clears. */
|
|
@@ -1196,7 +1196,7 @@ interface SmsCampaignLaunchResponse {
|
|
|
1196
1196
|
message?: string;
|
|
1197
1197
|
}
|
|
1198
1198
|
/** Legacy receipt construction remains source-compatible. The delete method returns
|
|
1199
|
-
* the complete
|
|
1199
|
+
* the complete CampaignDeleteResponse with required campaign_id/deleted fields. */
|
|
1200
1200
|
interface SmsCampaignDeleteResponse {
|
|
1201
1201
|
message: string;
|
|
1202
1202
|
campaign_id?: string;
|
|
@@ -1667,7 +1667,7 @@ declare class Integrations {
|
|
|
1667
1667
|
interface KnowledgeObject {
|
|
1668
1668
|
[key: string]: unknown;
|
|
1669
1669
|
}
|
|
1670
|
-
/**
|
|
1670
|
+
/** Account-scoped read. Counts describe returned arrays; limits are server-configured. */
|
|
1671
1671
|
interface KnowledgeKeyterms {
|
|
1672
1672
|
knowledge_keyterms: string[];
|
|
1673
1673
|
knowledge_keyterms_count: number;
|
|
@@ -2100,7 +2100,7 @@ declare class Voices {
|
|
|
2100
2100
|
get(voiceKey: string, params?: VoiceContext, opts?: RequestOptions): Promise<Voice>;
|
|
2101
2101
|
}
|
|
2102
2102
|
|
|
2103
|
-
/**
|
|
2103
|
+
/** API wire contract. Server defaults apply only when a field is omitted. */
|
|
2104
2104
|
type ContactPreviewParams = {
|
|
2105
2105
|
"agent_id": string;
|
|
2106
2106
|
"recipients": ({
|
|
@@ -2222,7 +2222,7 @@ declare class Contacts {
|
|
|
2222
2222
|
remove(params: ContactRemoveParams, opts?: RequestOptions): Promise<ContactRemoveResponse>;
|
|
2223
2223
|
}
|
|
2224
2224
|
|
|
2225
|
-
/**
|
|
2225
|
+
/** API wire contract. Server defaults apply only when a field is omitted. */
|
|
2226
2226
|
type WebAgentReadResponse = {
|
|
2227
2227
|
"phone_number": string;
|
|
2228
2228
|
"agent_id": string | null;
|
|
@@ -2508,7 +2508,7 @@ declare class WebAgent {
|
|
|
2508
2508
|
update(number: string, params: WebAgentUpdateParams, opts?: RequestOptions): Promise<WebAgentUpdateResponse>;
|
|
2509
2509
|
}
|
|
2510
2510
|
|
|
2511
|
-
/**
|
|
2511
|
+
/** API wire contract. Server defaults apply only when a field is omitted. */
|
|
2512
2512
|
type InboxListQuery = {
|
|
2513
2513
|
"archived"?: boolean;
|
|
2514
2514
|
"unread"?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface BodyOptions {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
interface NixflexClientOptions {
|
|
13
|
-
/** Your
|
|
13
|
+
/** Your whole API key, copied from the dashboard. */
|
|
14
14
|
apiKey: string;
|
|
15
15
|
/** Override the API base URL (testing/staging). Default: https://api.nixflex.com */
|
|
16
16
|
baseUrl?: string;
|
|
@@ -617,7 +617,7 @@ interface OutboundRequestReceipt {
|
|
|
617
617
|
[receiptField: string]: unknown;
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
-
/**
|
|
620
|
+
/** API wire contract. Server defaults apply only when a field is omitted. */
|
|
621
621
|
type CampaignCancelResponse = {
|
|
622
622
|
"campaign_id": string;
|
|
623
623
|
"status": "cancelled";
|
|
@@ -914,7 +914,7 @@ interface PhoneNumberImportParams {
|
|
|
914
914
|
telnyx_api_key?: string;
|
|
915
915
|
/** Your TeXML Application ID. Telnyx import. */
|
|
916
916
|
telnyx_connection_id?: string;
|
|
917
|
-
/** Optional Telnyx signature public
|
|
917
|
+
/** Optional Telnyx signature public key; saving does not verify it. */
|
|
918
918
|
telnyx_public_key?: string;
|
|
919
919
|
/** Per-number prompt override, max 8000 chars. */
|
|
920
920
|
custom_prompt?: string | null;
|
|
@@ -1007,7 +1007,7 @@ interface PhoneNumberUpdateParams {
|
|
|
1007
1007
|
web_agent_enabled?: boolean;
|
|
1008
1008
|
/** Website visitors may use all enabled custom functions. Default OFF. */
|
|
1009
1009
|
web_functions_enabled?: boolean;
|
|
1010
|
-
/** Telnyx webhook public
|
|
1010
|
+
/** Telnyx webhook public key; saving it does not verify it. */
|
|
1011
1011
|
telnyx_public_key?: string;
|
|
1012
1012
|
require_booking_confirmation?: boolean | null;
|
|
1013
1013
|
/** Business profile layered on the agent prompt for CALLS only. Max 8000. null clears. */
|
|
@@ -1196,7 +1196,7 @@ interface SmsCampaignLaunchResponse {
|
|
|
1196
1196
|
message?: string;
|
|
1197
1197
|
}
|
|
1198
1198
|
/** Legacy receipt construction remains source-compatible. The delete method returns
|
|
1199
|
-
* the complete
|
|
1199
|
+
* the complete CampaignDeleteResponse with required campaign_id/deleted fields. */
|
|
1200
1200
|
interface SmsCampaignDeleteResponse {
|
|
1201
1201
|
message: string;
|
|
1202
1202
|
campaign_id?: string;
|
|
@@ -1667,7 +1667,7 @@ declare class Integrations {
|
|
|
1667
1667
|
interface KnowledgeObject {
|
|
1668
1668
|
[key: string]: unknown;
|
|
1669
1669
|
}
|
|
1670
|
-
/**
|
|
1670
|
+
/** Account-scoped read. Counts describe returned arrays; limits are server-configured. */
|
|
1671
1671
|
interface KnowledgeKeyterms {
|
|
1672
1672
|
knowledge_keyterms: string[];
|
|
1673
1673
|
knowledge_keyterms_count: number;
|
|
@@ -2100,7 +2100,7 @@ declare class Voices {
|
|
|
2100
2100
|
get(voiceKey: string, params?: VoiceContext, opts?: RequestOptions): Promise<Voice>;
|
|
2101
2101
|
}
|
|
2102
2102
|
|
|
2103
|
-
/**
|
|
2103
|
+
/** API wire contract. Server defaults apply only when a field is omitted. */
|
|
2104
2104
|
type ContactPreviewParams = {
|
|
2105
2105
|
"agent_id": string;
|
|
2106
2106
|
"recipients": ({
|
|
@@ -2222,7 +2222,7 @@ declare class Contacts {
|
|
|
2222
2222
|
remove(params: ContactRemoveParams, opts?: RequestOptions): Promise<ContactRemoveResponse>;
|
|
2223
2223
|
}
|
|
2224
2224
|
|
|
2225
|
-
/**
|
|
2225
|
+
/** API wire contract. Server defaults apply only when a field is omitted. */
|
|
2226
2226
|
type WebAgentReadResponse = {
|
|
2227
2227
|
"phone_number": string;
|
|
2228
2228
|
"agent_id": string | null;
|
|
@@ -2508,7 +2508,7 @@ declare class WebAgent {
|
|
|
2508
2508
|
update(number: string, params: WebAgentUpdateParams, opts?: RequestOptions): Promise<WebAgentUpdateResponse>;
|
|
2509
2509
|
}
|
|
2510
2510
|
|
|
2511
|
-
/**
|
|
2511
|
+
/** API wire contract. Server defaults apply only when a field is omitted. */
|
|
2512
2512
|
type InboxListQuery = {
|
|
2513
2513
|
"archived"?: boolean;
|
|
2514
2514
|
"unread"?: boolean;
|