@shuffl/sdk 0.6.1 → 0.6.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/README.md +16 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -32,7 +32,17 @@ const preview = await shuffl.programs.preview({
|
|
|
32
32
|
|
|
33
33
|
`users` means people in the team directory, including people who have no web login. IDs are Shuffl person IDs, not Slack IDs or authentication account IDs.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
A team key never gains company scope; company settings have their own key and live under `shuffl.company`, below. See the [permission reference](https://shuffl-rebuild.vercel.app/docs/api-permissions) for every method. Input and output types come directly from the portable public oRPC contract.
|
|
36
|
+
|
|
37
|
+
## What the client covers
|
|
38
|
+
|
|
39
|
+
- People: `users`, `profiles`, `identities`, `invitations`, `access`, `manager`, `timeOff` and `sync` (People Sync).
|
|
40
|
+
- Groups: `groups` (lists, departments, synced groups, automations and their runs), `units` and `communities`.
|
|
41
|
+
- Programs: `programs` and `runs` (Connections), `mentorship`, `network` (the org chart and introductions) and `playbooks` (onboarding, buddies, 30/60/90 plans and leaving).
|
|
42
|
+
- Culture: `celebrations`, `pulse`, `praise`, `badges`, `reminders`, `home`, `getStarted` and `digest`.
|
|
43
|
+
- Knowledge and HR: `knowledge` (pages, sources, templates, read-and-confirm and the handbook), `hr` (HR requests), `support` and `assistant`.
|
|
44
|
+
- Workspace: `teams`, `team`, `channels`, `integrations`, `notifications`, `reports`, `exports` and `webhooks`.
|
|
45
|
+
- Keys and receipts: `credentials`, `permissions`, `commands` and `operations`.
|
|
36
46
|
|
|
37
47
|
Program creation requires a stable `requestKey`. Repeating the same creation request returns the existing program; using that key with different settings returns `CONFLICT`. Programs start paused unless `draft: false` is explicitly supplied. Updates require `expectedRevision`. Run requests require a preview and request key and return a durable run ID; poll `runs.get` for status. The application scheduler owns execution and delivery.
|
|
38
48
|
|
|
@@ -48,7 +58,7 @@ Use `ORPCError.code` for errors (`UNAUTHORIZED`, `FORBIDDEN`, `BAD_REQUEST`, `NO
|
|
|
48
58
|
|
|
49
59
|
## Webhooks
|
|
50
60
|
|
|
51
|
-
Shuffl can call your HTTPS endpoint when something happens in a workspace
|
|
61
|
+
Shuffl can call your HTTPS endpoint when something happens in a workspace. Add an endpoint in Settings → Webhooks or with `webhooks.create`, keep the `whsec_…` signing secret it returns, and check every delivery against it before you trust it. Pass the raw body, before any JSON parsing:
|
|
52
62
|
|
|
53
63
|
```ts
|
|
54
64
|
import { verifyWebhook, WebhookVerificationError } from '@shuffl/sdk';
|
|
@@ -105,3 +115,7 @@ await shuffl.company.members.remove({ userId: page.items[0]!.userId });
|
|
|
105
115
|
`shuffl.company.current()` returns the key's company and grants. Every other method needs its grant: `company.details`, `company.workspaces.list`, `company.members.list`, `company.emailDomains.list`, `company.slack.list`, `company.rename`, `company.workspaces.setDefault` and `company.members.remove`. `members.list` pages with `limit` and `cursor` like `users.list`. Company writes run once when called and take no `requestKey`. A company key can't call the workspace methods, and a workspace key can't call `shuffl.company`; the SDK refuses the wrong kind with `UNAUTHORIZED` before sending a request. See [company keys](https://shuffl-rebuild.vercel.app/docs/api-permissions#company-keys).
|
|
106
116
|
|
|
107
117
|
Full guide: [Use the SDK and HTTP API](https://shuffl-rebuild.vercel.app/docs/sdk).
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT © Shuffl LLC. See [LICENSE](./LICENSE).
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { ORPCError } from '@orpc/client';
|
|
|
5
5
|
export type { CompanyPermission, Permission, PermissionDefinition, Scope, } from '@shuffl/api-contracts';
|
|
6
6
|
export { isWebhookEventType, signWebhook, verifyWebhook, type WebhookActor, type WebhookEvent, type WebhookEventData, type WebhookEventGroup, type WebhookEventType, WebhookVerificationError, webhookApiVersion, webhookEventCatalog, webhookEventGroups, webhookEventTypes, } from '@shuffl/api-contracts/webhooks';
|
|
7
7
|
export type ShufflClient = ContractRouterClient<ShufflContract>;
|
|
8
|
-
/** The company API
|
|
8
|
+
/** The company API, for a company key (shuffl_company_). */
|
|
9
9
|
export type ShufflCompanyClient = ContractRouterClient<ShufflCompanyContract>;
|
|
10
10
|
export interface ShufflOptions {
|
|
11
11
|
/**
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isContractProcedure } from '@orpc/contract';
|
|
|
4
4
|
import { contract } from '@shuffl/api-contracts';
|
|
5
5
|
import { companyContract, } from '@shuffl/api-contracts/company';
|
|
6
6
|
export { ORPCError } from '@orpc/client';
|
|
7
|
-
//
|
|
7
|
+
// Check and type the webhooks Shuffl sends.
|
|
8
8
|
export { isWebhookEventType, signWebhook, verifyWebhook, WebhookVerificationError, webhookApiVersion, webhookEventCatalog, webhookEventGroups, webhookEventTypes, } from '@shuffl/api-contracts/webhooks';
|
|
9
9
|
import { sdkVersion } from './version.js';
|
|
10
10
|
// Which SDK release (and, for the CLI, which CLI release) made a request,
|
|
@@ -66,7 +66,7 @@ const statusCodes = {
|
|
|
66
66
|
409: 'CONFLICT',
|
|
67
67
|
429: 'TOO_MANY_REQUESTS',
|
|
68
68
|
};
|
|
69
|
-
// The company API
|
|
69
|
+
// The company API is REST under /api/v1/company, so its client is
|
|
70
70
|
// built from the contract's routes rather than the RPC link.
|
|
71
71
|
function companyClient(base, options, client) {
|
|
72
72
|
const procedure = ({ method, path }) => async (input, call) => {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const sdkVersion = "0.6.
|
|
1
|
+
export declare const sdkVersion = "0.6.2";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@orpc/client": "1.15.3",
|
|
4
4
|
"@orpc/contract": "1.15.3",
|
|
5
|
-
"@shuffl/api-contracts": "0.6.
|
|
5
|
+
"@shuffl/api-contracts": "0.6.2"
|
|
6
6
|
},
|
|
7
|
-
"description": "TypeScript client for the Shuffl API: people,
|
|
7
|
+
"description": "TypeScript client for the Shuffl API: people, groups, knowledge, playbooks, programs and management commands.",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=22"
|
|
10
10
|
},
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"type": "module",
|
|
36
36
|
"types": "./dist/index.d.ts",
|
|
37
|
-
"version": "0.6.
|
|
37
|
+
"version": "0.6.2"
|
|
38
38
|
}
|