@gravity-rail/sdk 10.0.0 → 12.0.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/README.md +25 -32
- package/dist/{account-DEA-f-I9.d.cts → account-D4dzqsFS.d.cts} +0 -2
- package/dist/{account-DEA-f-I9.d.ts → account-D4dzqsFS.d.ts} +0 -2
- package/dist/{agent_team-Baa7AvKF.d.ts → bot_team-BEgHb3ol.d.ts} +163 -149
- package/dist/{agent_team-EdLmOQDL.d.cts → bot_team-C5AAy5t7.d.cts} +163 -149
- package/dist/{chunk-MWTQXZGB.js → chunk-3X5E3PWB.js} +1 -1
- package/dist/chunk-3X5E3PWB.js.map +1 -0
- package/dist/{chunk-XTB2HFSI.js → chunk-5DZ53RQ5.js} +190 -245
- package/dist/chunk-5DZ53RQ5.js.map +1 -0
- package/dist/{client-Cb9pM31S.d.cts → client-5uu0OE60.d.ts} +684 -976
- package/dist/{client-BaF3v-ux.d.ts → client-Bhqh4jc_.d.cts} +684 -976
- package/dist/helpers.d.cts +3 -3
- package/dist/helpers.d.ts +3 -3
- package/dist/index.cjs +205 -258
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -8
- package/dist/index.d.ts +11 -8
- package/dist/index.js +18 -17
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +198 -245
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +124 -66
- package/dist/internal.d.ts +124 -66
- package/dist/internal.js +10 -4
- package/dist/internal.js.map +1 -1
- package/dist/{member-import-Bq_eC7gx.d.ts → member-import-BqEl0RkU.d.ts} +2 -2
- package/dist/{member-import-_zu58M9w.d.cts → member-import-LgqWctZq.d.cts} +2 -2
- package/dist/realtime.cjs +25 -11
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +28 -9
- package/dist/realtime.d.ts +28 -9
- package/dist/realtime.js +23 -10
- package/dist/realtime.js.map +1 -1
- package/dist/schemas.cjs +8 -66
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +15 -90
- package/dist/schemas.d.ts +15 -90
- package/dist/schemas.js +9 -59
- package/dist/schemas.js.map +1 -1
- package/dist/{tasks-DssYoZDt.d.ts → tasks-D1YbBzy6.d.cts} +50 -91
- package/dist/{tasks-yScacy3c.d.cts → tasks-DZ1IFEms.d.ts} +50 -91
- package/package.json +1 -1
- package/dist/chunk-MWTQXZGB.js.map +0 -1
- package/dist/chunk-XTB2HFSI.js.map +0 -1
package/README.md
CHANGED
|
@@ -44,18 +44,13 @@ const chats = await client.getChats(workspaceId);
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
Use [Creating Members](https://docs.gravityrail.com/developer/guides/data/creating-members)
|
|
47
|
-
to select the appropriate creation/import endpoint
|
|
48
|
-
|
|
47
|
+
to select the appropriate creation/import endpoint. A direct SDK call uses the
|
|
48
|
+
request type's wire names:
|
|
49
49
|
|
|
50
50
|
```typescript
|
|
51
|
-
const roleId = Number(process.env.GRAVITY_RAIL_MEMBER_ROLE_ID);
|
|
52
|
-
if (!Number.isInteger(roleId) || roleId <= 0) {
|
|
53
|
-
throw new Error('Set GRAVITY_RAIL_MEMBER_ROLE_ID to an authorized role ID');
|
|
54
|
-
}
|
|
55
51
|
const member = await client.createWorkspaceMember(workspaceId, {
|
|
56
52
|
name: 'Integration Test',
|
|
57
53
|
email: 'integration-test@example.com',
|
|
58
|
-
memberRoleId: roleId, // an authorized role selected for the new Member
|
|
59
54
|
});
|
|
60
55
|
```
|
|
61
56
|
|
|
@@ -144,11 +139,11 @@ Every Gravity Rail workspace is a self-contained environment with isolated data,
|
|
|
144
139
|
| **Workflows** | Multi-step conversational processes with branching logic, task assignment, and templates |
|
|
145
140
|
| **Assistants** | AI personas with configurable models, voices, and a two-tier supervisor system |
|
|
146
141
|
| **Chats** | Conversations across all channels — labels, filters, summaries, message history, and export |
|
|
147
|
-
| **Members** | Contacts and team —
|
|
142
|
+
| **Members** | Contacts and team — labels, filters, custom fields, import/export, anonymous resolution |
|
|
148
143
|
| **Data Types** | Schema-driven forms (14 field types) with computed fields and conversational collection |
|
|
149
144
|
| **Events** | Trigger-based automation with [CEL expressions](https://github.com/google/cel-spec) |
|
|
150
145
|
| **Calendars** | Scheduling, availability, event types, Google Calendar sync, and iCal feeds |
|
|
151
|
-
| **Files** | Folder hierarchy with semantic search,
|
|
146
|
+
| **Files** | Folder hierarchy with semantic search, Member and user sharing, and public access |
|
|
152
147
|
| **Sites** | Customer-facing portals with custom domains, managed pages, and source applications |
|
|
153
148
|
| **Communications** | Phone numbers, SMS, email inboxes, and notification rules |
|
|
154
149
|
| **Org Domains** | Register org-owned domains, verify ownership, verify email MX/DKIM/SPF, and verify site CNAMEs |
|
|
@@ -204,7 +199,7 @@ const toolCalls = await client.getChatToolCallMessages(workspaceId, chatId);
|
|
|
204
199
|
await client.sendAssistantMessage(workspaceId, chatId);
|
|
205
200
|
|
|
206
201
|
// Direct messaging between members
|
|
207
|
-
const dm = await client.findOrCreateDMChat(workspaceId, {
|
|
202
|
+
const dm = await client.findOrCreateDMChat(workspaceId, { memberId: targetMemberId });
|
|
208
203
|
await client.sendChatMessage(workspaceId, dm.id, { content: 'Hey!' });
|
|
209
204
|
|
|
210
205
|
// Export for analysis
|
|
@@ -384,11 +379,10 @@ const operators = await client.getLiveOperators(workspaceId);
|
|
|
384
379
|
|
|
385
380
|
### Sites & Portals
|
|
386
381
|
|
|
387
|
-
Choose Site visibility,
|
|
388
|
-
Create a private source Site with no record scope opt-ins, then
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
workspace (not its numeric ID):
|
|
382
|
+
Choose Site visibility, whether Members can sign in, and record access separately.
|
|
383
|
+
Create a private source Site with no record scope opt-ins, then let Members use
|
|
384
|
+
it. This example runs on your server; replace the environment variables with
|
|
385
|
+
your OAuth token and workspace UUID:
|
|
392
386
|
|
|
393
387
|
```typescript
|
|
394
388
|
import { AccessLevel, GravityRailClient } from '@gravity-rail/sdk';
|
|
@@ -398,7 +392,6 @@ const client = new GravityRailClient(
|
|
|
398
392
|
'https://api.gravityrail.com'
|
|
399
393
|
);
|
|
400
394
|
const workspace = client.workspace(process.env.GRAVITY_RAIL_WORKSPACE_UUID!);
|
|
401
|
-
const memberRoleUuid = process.env.GRAVITY_RAIL_MEMBER_ROLE_UUID!;
|
|
402
395
|
const site = await workspace.createSite({
|
|
403
396
|
name: 'Operations',
|
|
404
397
|
theme: 'source-site',
|
|
@@ -411,7 +404,7 @@ await workspace.updateSiteSharing(site.id, {
|
|
|
411
404
|
access: AccessLevel.PRIVATE,
|
|
412
405
|
shareable: false,
|
|
413
406
|
grants: [],
|
|
414
|
-
|
|
407
|
+
membersCanUse: true,
|
|
415
408
|
});
|
|
416
409
|
|
|
417
410
|
// A Site admin enables only the operations this app needs.
|
|
@@ -421,22 +414,22 @@ await workspace.updateSite(site.id, {
|
|
|
421
414
|
```
|
|
422
415
|
|
|
423
416
|
The empty grants above apply to a **new** Site. To change an existing Site, read
|
|
424
|
-
`getSiteSharing(site.id)` first and preserve the access, shareability, grants
|
|
425
|
-
and
|
|
426
|
-
sharing lists.
|
|
427
|
-
|
|
428
|
-
| Setting
|
|
429
|
-
|
|
|
430
|
-
| `isPublic`
|
|
431
|
-
| Sharing `
|
|
432
|
-
| `allowedScopes`
|
|
433
|
-
| `allowSignup`
|
|
434
|
-
|
|
435
|
-
A Site session is still limited by the Member's
|
|
436
|
-
|
|
417
|
+
`getSiteSharing(site.id)` first and preserve the access, shareability, grants
|
|
418
|
+
and `membersCanUse` values you are not changing. The update replaces the
|
|
419
|
+
submitted sharing lists.
|
|
420
|
+
|
|
421
|
+
| Setting | What it controls |
|
|
422
|
+
| ------------------------- | ----------------------------------------------------------------------------------------- |
|
|
423
|
+
| `isPublic` | Whether visitors can open the Site; public visibility does not make records public. |
|
|
424
|
+
| Sharing `membersCanUse` | Whether Members can sign in through the Site. Teammates with `sites:read` always can. |
|
|
425
|
+
| `allowedScopes` | Record read, write, or admin operations allowed through a Site session. Defaults to `[]`. |
|
|
426
|
+
| `allowSignup` | Whether new Members may join through the Site. |
|
|
427
|
+
|
|
428
|
+
A Site session is still limited by the Member's Form, record, and field
|
|
429
|
+
permissions. Read and write opt-ins are independent. Existing own-Form
|
|
437
430
|
submission permissions still apply. `records:admin` is an explicit opt-in for
|
|
438
431
|
record administration, including deletion; enable it only for an app that needs
|
|
439
|
-
it and Members whose
|
|
432
|
+
it and Members whose permissions already allow it. A workspace UUID supplies context,
|
|
440
433
|
not authentication. A 403 needs a permission check, not a broader allowlist.
|
|
441
434
|
|
|
442
435
|
Record writes may return a successful value-free receipt (`fieldValues` is
|
|
@@ -627,7 +620,7 @@ import type {
|
|
|
627
620
|
Workspace, Member, Chat, Task, WorkflowRevision, Assistant,
|
|
628
621
|
DataType, DataRecord, EventRule, Calendar, Site,
|
|
629
622
|
PhoneNumber, Inbox, OperatorGroup, Qualification,
|
|
630
|
-
Subscription, ApiKey,
|
|
623
|
+
Subscription, ApiKey,
|
|
631
624
|
} from '@gravity-rail/sdk';
|
|
632
625
|
```
|
|
633
626
|
|
|
@@ -108,10 +108,8 @@ declare const AccountResponseAvatarSource: {
|
|
|
108
108
|
interface AdminAccountMembershipResponse {
|
|
109
109
|
workspaceUuid: string;
|
|
110
110
|
workspaceName: string;
|
|
111
|
-
role: string;
|
|
112
111
|
createdAt: string;
|
|
113
112
|
tosAccepted: boolean;
|
|
114
|
-
memberRoleId: number;
|
|
115
113
|
memberId: number;
|
|
116
114
|
glbLinked: boolean;
|
|
117
115
|
}
|
|
@@ -108,10 +108,8 @@ declare const AccountResponseAvatarSource: {
|
|
|
108
108
|
interface AdminAccountMembershipResponse {
|
|
109
109
|
workspaceUuid: string;
|
|
110
110
|
workspaceName: string;
|
|
111
|
-
role: string;
|
|
112
111
|
createdAt: string;
|
|
113
112
|
tosAccepted: boolean;
|
|
114
|
-
memberRoleId: number;
|
|
115
113
|
memberId: number;
|
|
116
114
|
glbLinked: boolean;
|
|
117
115
|
}
|