@nemphi/sdk 0.1.0 → 0.2.4599

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nemphi
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,89 +1,91 @@
1
- # @nemphi/sdk
1
+ # `@nemphi/sdk`
2
2
 
3
- TypeScript SDK for interacting with Nemphi API products from Node.js, edge runtimes, and browsers.
3
+ Typed TypeScript client for the [Nemphi](https://nemphi.com) API. Zero runtime
4
+ dependencies. It uses the platform `fetch`. Business tool invocations use the
5
+ same tenant scoping, policy, idempotency, and action ledger as the product UI.
4
6
 
5
7
  ## Install
6
8
 
7
9
  ```bash
8
10
  npm install @nemphi/sdk
11
+ # or: pnpm add @nemphi/sdk / yarn add @nemphi/sdk
9
12
  ```
10
13
 
14
+ Requires Node 20+ (or any runtime with global `fetch`).
15
+
11
16
  ## Quick start
12
17
 
13
18
  ```ts
14
- import { NemphiSdk } from "@nemphi/sdk";
19
+ import { createClient } from "@nemphi/sdk";
20
+
21
+ const nemphi = createClient({
22
+ baseUrl: "https://api.nemphi.com",
23
+ // API key (nk_…) is tenant-bound. Session tokens (nse_…) also need tenantId.
24
+ token: process.env.NEMPHI_API_KEY!,
25
+ });
15
26
 
16
- const sdk = new NemphiSdk({
17
- baseUrl: "https://api.your-domain.com",
18
- token: process.env.NEMPHI_TOKEN,
19
- organizationId: "org_123",
27
+ const { invoice, journal_entry } = await nemphi.postInvoice(invoiceId, {
28
+ idempotencyKey: `post-${invoiceId}`,
20
29
  });
21
30
 
22
- const usage = await sdk.usage.getCurrent();
23
- console.log(usage);
31
+ console.log(invoice.status, journal_entry.entry_number);
24
32
  ```
25
33
 
26
34
  ## Configuration
27
35
 
28
- - `baseUrl` (required): Base URL for your platform API deployment.
29
- - `token` (optional): Bearer token sent as `Authorization: Bearer <token>`.
30
- - `apiKey` (optional): API key sent as `x-api-key`.
31
- - `organizationId` (optional): Default organization header (`x-organization-id`).
32
- - `defaultHeaders` (optional): Additional headers merged into every request.
33
- - `fetch` (optional): Custom fetch implementation.
34
-
35
- ## Included product resources
36
-
37
- - `sdk.usage`
38
- - `listPlans()`
39
- - `getCurrent()`
40
- - `getHistory({ start, end })`
41
- - `listEvents(query)`
42
- - `trackEvent({ eventType, count, metadata })`
43
- - `getMonthlyReport(month)`
44
- - `sdk.organization`
45
- - `create({ name })`
46
- - `getMembers()`
47
- - `listMemberships()`
48
- - `listInvitations()`
49
- - `inviteMember(input)`
50
- - `removeMember(memberId)`
51
- - `updateMemberRole(memberId, role)`
52
- - `getStats()`
53
- - `getActivity(query)`
54
- - `sdk.crm`
55
- - `listContacts(query)` / `getContact(contactId)`
56
- - `createContact(body)` / `updateContact(contactId, body)`
57
- - `listDeals(query)` / `createDeal(body)` / `updateDeal(dealId, body)`
58
- - `listTasks(query)` / `createTask(body)`
59
- - `createNote(body)`
60
-
61
- ## Error handling
36
+ | Option | Description |
37
+ | --- | --- |
38
+ | `baseUrl` | API origin, e.g. `https://api.nemphi.com` |
39
+ | `token` | Bearer credential: API key (`nk_…`) or session token (`nse_…`) |
40
+ | `tenantId` | Required for tenant-scoped calls when using a user session |
41
+ | `headers` | Extra headers on every request |
42
+ | `fetch` | Custom `fetch` (defaults to the global) |
43
+
44
+ ## Auth
45
+
46
+ - **API keys** are created in the workspace settings and are already bound to one
47
+ tenant — pass them as `token`, no `tenantId` needed.
48
+ - **User sessions** need both `token` and `tenantId` (`X-Tenant-Id`).
62
49
 
63
50
  ```ts
64
- import { NemphiApiError } from "@nemphi/sdk";
51
+ const session = createClient({
52
+ baseUrl: "https://api.nemphi.com",
53
+ token: sessionToken,
54
+ tenantId: workspaceId,
55
+ });
56
+ ```
57
+
58
+ ## Errors
59
+
60
+ ```ts
61
+ import { ApiError } from "@nemphi/sdk";
65
62
 
66
63
  try {
67
- await sdk.usage.trackEvent({ eventType: "message_sent" });
68
- } catch (error) {
69
- if (error instanceof NemphiApiError) {
70
- console.error(error.status, error.message, error.data);
64
+ await nemphi.postInvoice(id);
65
+ } catch (err) {
66
+ if (err instanceof ApiError) {
67
+ // status, code (e.g. "approval_required"), message, body
68
+ console.error(err.status, err.code, err.message);
71
69
  }
70
+ throw err;
72
71
  }
73
72
  ```
74
73
 
75
- ## Release and deployment (Trusted Publishing)
74
+ ## What it covers
75
+
76
+ The client mirrors the HTTP surface used by the Nemphi web app: auth, workspaces,
77
+ tools (`invoke` / typed helpers), actions, runs, dashboards, mail, CRM, and more.
78
+ Types live next to the client in the same module.
76
79
 
77
- The SDK is published to npm via GitHub Actions using npm Trusted Publishing (OIDC) in `.github/workflows/publish-sdk.yml`.
80
+ For the design contract, see `docs/backbone.md` in the monorepo (§3 pillars, §9
81
+ API contracts).
78
82
 
79
- 1. In npm, open the package settings for `@nemphi/sdk` and add a **Trusted Publisher** for this GitHub repository/workflow.
80
- 2. Ensure `packages/sdk/package.json` version is bumped.
81
- 3. Push a matching tag in the format `sdk-v<version>` (example: `sdk-v0.1.0`).
82
- 4. The workflow will typecheck, build `dist/`, verify the tag-version match, and run `npm publish --access public`.
83
+ ## Maintainer workflow
83
84
 
84
- Notes:
85
+ The web and mobile apps use `workspace:*`. Rebuild their SDK with
86
+ `pnpm build:sdk` after source changes. Merging an SDK change to `master`
87
+ publishes it to npm; [PUBLISHING.md](PUBLISHING.md) covers versioning, package
88
+ checks, and releases.
85
89
 
86
- - No `NPM_TOKEN` secret is required for publishing when Trusted Publishing is configured.
87
- - Keep `id-token: write` permission in the workflow so GitHub can mint the OIDC token for npm.
88
- - `package.json` should include a `repository.url` that exactly matches the GitHub repo URL configured in npm Trusted Publisher settings.
89
- - npm can automatically generate provenance for public packages published from public GitHub repositories via Trusted Publishing.
90
+ The private `@nemphi/admin-sdk` owns `/v1/admin/*`; those methods do not belong
91
+ in this public package.
@@ -0,0 +1,55 @@
1
+ import type { BlockAction, BlockElement, BlockState, BlockValue, MessageBlock, OptionObject } from "./block-kit.js";
2
+ /** A block's id, or its position when the author left it out. */
3
+ export declare const blockIdOf: (block: {
4
+ block_id?: string;
5
+ }, index: number) => string;
6
+ /** An element's action id, or its position in the block. */
7
+ export declare const actionIdOf: (element: {
8
+ action_id?: string;
9
+ }, index: number) => string;
10
+ /** What a select or a choice group offers, groups flattened. */
11
+ export declare function optionsOf(element: BlockElement): OptionObject[];
12
+ /** The value an element starts with, from its `initial_*` field. */
13
+ export declare function elementInitialValue(element: BlockElement): BlockValue;
14
+ /** Elements that hold a value, with the block and label they belong to. */
15
+ export interface ValuedElement {
16
+ blockId: string;
17
+ actionId: string;
18
+ element: BlockElement;
19
+ /** The input block's label, or the placeholder, or the action id. */
20
+ label: string;
21
+ }
22
+ /** Every element of a message that holds state, input blocks and controls alike. */
23
+ export declare function valuedElements(blocks: ReadonlyArray<MessageBlock>): ValuedElement[];
24
+ /** The state a message starts in: every valued element at its initial value. */
25
+ export declare function initialBlockState(blocks: ReadonlyArray<MessageBlock>): BlockState;
26
+ /** The state with one element's value replaced. */
27
+ export declare function withBlockValue(state: BlockState, blockId: string, actionId: string, value: BlockValue): BlockState;
28
+ /** One element's current value, when the state knows it. */
29
+ export declare const blockValueOf: (state: BlockState, blockId: string, actionId: string) => BlockValue | undefined;
30
+ /** Whether a value is worth reporting: a choice made, a field filled. */
31
+ export declare function valueIsSet(value: BlockValue): boolean;
32
+ /** The words for one value: the option text, the date, the text typed. */
33
+ export declare function valueText(value: BlockValue): string;
34
+ /** `Label: value` for every set field of the message, in message order. */
35
+ export declare function stateSummary(blocks: ReadonlyArray<MessageBlock>, state: BlockState): string[];
36
+ export interface ActionWords {
37
+ /** "Pulsaste «{label}»" */
38
+ clicked: string;
39
+ /** "Elegiste {value}" */
40
+ chose: string;
41
+ /** "Enviaste el formulario" */
42
+ submitted: string;
43
+ }
44
+ /**
45
+ * The line the person sees as their own turn after interacting: what they
46
+ * clicked or chose, then every field they had filled in.
47
+ */
48
+ export declare function blockActionSummary(action: BlockAction, blocks: ReadonlyArray<MessageBlock>, words: ActionWords): string;
49
+ /**
50
+ * The machine-facing marker folded into the model's copy of the turn:
51
+ * which element fired, in which block, with which value. The state is in
52
+ * the visible summary already, so it stays out of the marker.
53
+ */
54
+ export declare function blockActionContext(action: BlockAction): string;
55
+ //# sourceMappingURL=block-kit-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-kit-state.d.ts","sourceRoot":"","sources":["../src/block-kit-state.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EAGb,MAAM,gBAAgB,CAAC;AAGxB,iEAAiE;AACjE,eAAO,MAAM,SAAS,UAAW;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,SAAS,MAAM,KAAG,MACpC,CAAC;AAErC,4DAA4D;AAC5D,eAAO,MAAM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AM,CAAC;IAChB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAKD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,EACnC,KAAK,EAAE,WAAW,GACjB,MAAM,CAiBR;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAM9D"}
@@ -0,0 +1,218 @@
1
+ // The values a message's elements hold, and the words an interaction
2
+ // becomes. Pure functions over the Block Kit types, shared by the web
3
+ // renderer, the chat surfaces and the mobile app, so every client reasons
4
+ // about a message the same way without React.
5
+ import { blockActionText, richTextText } from "./block-kit.js";
6
+ /** A block's id, or its position when the author left it out. */
7
+ export const blockIdOf = (block, index) => block.block_id ?? `block_${index}`;
8
+ /** An element's action id, or its position in the block. */
9
+ export const actionIdOf = (element, index) => element.action_id ?? `action_${index}`;
10
+ /** What a select or a choice group offers, groups flattened. */
11
+ export function optionsOf(element) {
12
+ switch (element.type) {
13
+ case "checkboxes":
14
+ case "radio_buttons":
15
+ case "overflow":
16
+ return element.options;
17
+ case "static_select":
18
+ case "multi_static_select":
19
+ return element.options ?? element.option_groups?.flatMap((g) => g.options) ?? [];
20
+ default:
21
+ return [];
22
+ }
23
+ }
24
+ /** The value an element starts with, from its `initial_*` field. */
25
+ export function elementInitialValue(element) {
26
+ switch (element.type) {
27
+ case "checkboxes":
28
+ return { type: element.type, selected_options: element.initial_options ?? [] };
29
+ case "radio_buttons":
30
+ case "static_select":
31
+ case "external_select":
32
+ return { type: element.type, selected_option: element.initial_option ?? null };
33
+ case "multi_static_select":
34
+ case "multi_external_select":
35
+ return { type: element.type, selected_options: element.initial_options ?? [] };
36
+ case "users_select":
37
+ return { type: element.type, selected_user: element.initial_user ?? null };
38
+ case "multi_users_select":
39
+ return { type: element.type, selected_users: element.initial_users ?? [] };
40
+ case "conversations_select":
41
+ return { type: element.type, selected_conversation: element.initial_conversation ?? null };
42
+ case "multi_conversations_select":
43
+ return { type: element.type, selected_conversations: element.initial_conversations ?? [] };
44
+ case "channels_select":
45
+ return { type: element.type, selected_channel: element.initial_channel ?? null };
46
+ case "multi_channels_select":
47
+ return { type: element.type, selected_channels: element.initial_channels ?? [] };
48
+ case "datepicker":
49
+ return { type: element.type, selected_date: element.initial_date ?? null };
50
+ case "timepicker":
51
+ return { type: element.type, selected_time: element.initial_time ?? null };
52
+ case "datetimepicker":
53
+ return { type: element.type, selected_date_time: element.initial_date_time ?? null };
54
+ case "plain_text_input":
55
+ case "email_text_input":
56
+ case "url_text_input":
57
+ case "number_input":
58
+ return { type: element.type, value: element.initial_value ?? "" };
59
+ case "rich_text_input":
60
+ return element.initial_value
61
+ ? { type: element.type, rich_text_value: element.initial_value }
62
+ : { type: element.type };
63
+ case "file_input":
64
+ return { type: element.type, files: [] };
65
+ default:
66
+ return { type: element.type };
67
+ }
68
+ }
69
+ const textOf = (t) => (t ? t.text : "");
70
+ /** Whether an element's `text` carries a composition object rather than a bare string. */
71
+ const isPlainTextObject = (text) => typeof text === "object";
72
+ const elementLabel = (element, actionId) => {
73
+ if ("placeholder" in element && element.placeholder)
74
+ return element.placeholder.text;
75
+ if ("text" in element &&
76
+ element.text &&
77
+ isPlainTextObject(element.text) &&
78
+ "text" in element.text)
79
+ return element.text.text;
80
+ return actionId;
81
+ };
82
+ /** Every element of a message that holds state, input blocks and controls alike. */
83
+ export function valuedElements(blocks) {
84
+ const out = [];
85
+ const visit = (block, index) => {
86
+ const blockId = blockIdOf(block, index);
87
+ switch (block.type) {
88
+ case "input":
89
+ out.push({
90
+ blockId,
91
+ actionId: actionIdOf(block.element, 0),
92
+ element: block.element,
93
+ label: block.label.text,
94
+ });
95
+ break;
96
+ case "actions":
97
+ block.elements.forEach((element, i) => {
98
+ if (element.type === "button" || element.type === "workflow_button")
99
+ return;
100
+ const actionId = actionIdOf(element, i);
101
+ out.push({ blockId, actionId, element, label: elementLabel(element, actionId) });
102
+ });
103
+ break;
104
+ case "section":
105
+ if (block.accessory &&
106
+ block.accessory.type !== "button" &&
107
+ block.accessory.type !== "workflow_button" &&
108
+ block.accessory.type !== "image" &&
109
+ block.accessory.type !== "overflow") {
110
+ const actionId = actionIdOf(block.accessory, 0);
111
+ out.push({
112
+ blockId,
113
+ actionId,
114
+ element: block.accessory,
115
+ label: textOf(block.text) || elementLabel(block.accessory, actionId),
116
+ });
117
+ }
118
+ break;
119
+ case "container":
120
+ block.child_blocks.forEach((child, i) => visit(child, i));
121
+ break;
122
+ default:
123
+ break;
124
+ }
125
+ };
126
+ blocks.forEach(visit);
127
+ return out;
128
+ }
129
+ /** The state a message starts in: every valued element at its initial value. */
130
+ export function initialBlockState(blocks) {
131
+ const values = {};
132
+ for (const { blockId, actionId, element } of valuedElements(blocks)) {
133
+ (values[blockId] ??= {})[actionId] = elementInitialValue(element);
134
+ }
135
+ return { values };
136
+ }
137
+ /** The state with one element's value replaced. */
138
+ export function withBlockValue(state, blockId, actionId, value) {
139
+ return {
140
+ values: {
141
+ ...state.values,
142
+ [blockId]: { ...state.values[blockId], [actionId]: value },
143
+ },
144
+ };
145
+ }
146
+ /** One element's current value, when the state knows it. */
147
+ export const blockValueOf = (state, blockId, actionId) => state.values[blockId]?.[actionId];
148
+ /** Whether a value is worth reporting: a choice made, a field filled. */
149
+ export function valueIsSet(value) {
150
+ if (value.value !== undefined && value.value !== "")
151
+ return true;
152
+ if (value.selected_option)
153
+ return true;
154
+ if (value.selected_options?.length)
155
+ return true;
156
+ if (value.selected_date || value.selected_time)
157
+ return true;
158
+ if (value.selected_date_time !== undefined && value.selected_date_time !== null)
159
+ return true;
160
+ if (value.selected_user || value.selected_conversation || value.selected_channel)
161
+ return true;
162
+ if (value.selected_users?.length || value.selected_conversations?.length)
163
+ return true;
164
+ if (value.selected_channels?.length)
165
+ return true;
166
+ if (value.rich_text_value)
167
+ return richTextText(value.rich_text_value).trim() !== "";
168
+ if (value.files?.length)
169
+ return true;
170
+ return false;
171
+ }
172
+ /** The words for one value: the option text, the date, the text typed. */
173
+ export function valueText(value) {
174
+ return blockActionText({ ...value, block_id: "", action_id: "" });
175
+ }
176
+ /** `Label: value` for every set field of the message, in message order. */
177
+ export function stateSummary(blocks, state) {
178
+ const lines = [];
179
+ for (const { blockId, actionId, label } of valuedElements(blocks)) {
180
+ const value = state.values[blockId]?.[actionId];
181
+ if (value === undefined || !valueIsSet(value))
182
+ continue;
183
+ lines.push(`${label}: ${valueText(value)}`);
184
+ }
185
+ return lines;
186
+ }
187
+ const fill = (template, vars) => template.replace(/\{(\w+)\}/g, (_, k) => vars[k] ?? "");
188
+ /**
189
+ * The line the person sees as their own turn after interacting: what they
190
+ * clicked or chose, then every field they had filled in.
191
+ */
192
+ export function blockActionSummary(action, blocks, words) {
193
+ const fields = action.state ? stateSummary(blocks, action.state) : [];
194
+ const isButton = action.type === "button" ||
195
+ action.type === "workflow_button" ||
196
+ action.type === "icon_button" ||
197
+ action.type === "feedback_buttons";
198
+ const label = blockActionText(action);
199
+ let head;
200
+ if (isButton)
201
+ head = fields.length > 0 && !label ? words.submitted : fill(words.clicked, { label });
202
+ else
203
+ head = fill(words.chose, { value: label });
204
+ return fields.length > 0 ? `${head}\n${fields.join("\n")}` : head;
205
+ }
206
+ const ContextMax = 480;
207
+ /**
208
+ * The machine-facing marker folded into the model's copy of the turn:
209
+ * which element fired, in which block, with which value. The state is in
210
+ * the visible summary already, so it stays out of the marker.
211
+ */
212
+ export function blockActionContext(action) {
213
+ const { state: _state, label: _label, ...rest } = action;
214
+ const compact = JSON.stringify(rest);
215
+ const marker = `Block action: ${compact}`;
216
+ return marker.length <= ContextMax ? marker : `${marker.slice(0, ContextMax - 1)}…`;
217
+ }
218
+ //# sourceMappingURL=block-kit-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-kit-state.js","sourceRoot":"","sources":["../src/block-kit-state.ts"],"names":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