@shuffl/api-contracts 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/LICENSE +21 -0
- package/README.md +19 -0
- package/dist/base.d.ts +77 -0
- package/dist/base.js +92 -0
- package/dist/index.d.ts +14018 -0
- package/dist/index.js +329 -0
- package/dist/management-operations.d.ts +1 -0
- package/dist/management-operations.js +973 -0
- package/dist/management.generated.d.ts +11915 -0
- package/dist/management.generated.js +10400 -0
- package/dist/permissions.d.ts +548 -0
- package/dist/permissions.js +115 -0
- package/dist/schemas.d.ts +219 -0
- package/dist/schemas.js +143 -0
- package/openapi.json +148813 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shuffl LLC
|
|
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
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Shuffl API contracts
|
|
2
|
+
|
|
3
|
+
The public [oRPC](https://orpc.dev) contract, endpoint permission catalog and OpenAPI document for the Shuffl API.
|
|
4
|
+
|
|
5
|
+
Most people want [`@shuffl/sdk`](https://www.npmjs.com/package/@shuffl/sdk), which installs this package and uses it for every method's input and output types. Install it directly only to build your own client or validate against the contract:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @shuffl/api-contracts
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import type { Permission, ShufflContract } from '@shuffl/api-contracts';
|
|
13
|
+
import openapi from '@shuffl/api-contracts/openapi.json' with { type: 'json' };
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`@shuffl/api-contracts/schemas` exports the shared Zod validators. The contract, SDK and CLI are released together under one version.
|
|
17
|
+
|
|
18
|
+
- [Use the SDK and HTTP API](https://shuffl-rebuild.vercel.app/docs/sdk)
|
|
19
|
+
- [Endpoint permissions](https://shuffl-rebuild.vercel.app/docs/api-permissions)
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const scopes: readonly ['users:read', 'programs:read', 'programs:write', 'runs:write', 'runs:read', 'knowledge:read', 'manager:read', 'users:write', 'participation:write', 'profile:write', 'access:read', 'access:write', 'identities:read', 'identities:write', 'knowledge:manage', 'knowledge:write', 'integrations:read', 'integrations:write', 'hr:read', 'hr:write', 'support:read', 'support:write', 'billing:read', 'billing:write', 'operations:read', 'operations:write', 'operator:read', 'operator:write', 'reports:read', 'workspace:read', 'workspace:write', 'credentials:read', 'credentials:write', 'exports:read', 'assistant:read', 'assistant:write', 'onboarding:read', 'onboarding:write', 'celebrations:read', 'celebrations:write', 'self:read', 'self:write', 'pulse:read', 'pulse:write', 'praise:read', 'praise:write'];
|
|
3
|
+
export declare const scopeSchema: z.ZodEnum<{
|
|
4
|
+
"access:read": "access:read";
|
|
5
|
+
"access:write": "access:write";
|
|
6
|
+
"assistant:read": "assistant:read";
|
|
7
|
+
"assistant:write": "assistant:write";
|
|
8
|
+
"billing:read": "billing:read";
|
|
9
|
+
"billing:write": "billing:write";
|
|
10
|
+
"celebrations:read": "celebrations:read";
|
|
11
|
+
"celebrations:write": "celebrations:write";
|
|
12
|
+
"credentials:read": "credentials:read";
|
|
13
|
+
"credentials:write": "credentials:write";
|
|
14
|
+
"exports:read": "exports:read";
|
|
15
|
+
"hr:read": "hr:read";
|
|
16
|
+
"hr:write": "hr:write";
|
|
17
|
+
"identities:read": "identities:read";
|
|
18
|
+
"identities:write": "identities:write";
|
|
19
|
+
"integrations:read": "integrations:read";
|
|
20
|
+
"integrations:write": "integrations:write";
|
|
21
|
+
"knowledge:manage": "knowledge:manage";
|
|
22
|
+
"knowledge:read": "knowledge:read";
|
|
23
|
+
"knowledge:write": "knowledge:write";
|
|
24
|
+
"manager:read": "manager:read";
|
|
25
|
+
"onboarding:read": "onboarding:read";
|
|
26
|
+
"onboarding:write": "onboarding:write";
|
|
27
|
+
"operations:read": "operations:read";
|
|
28
|
+
"operations:write": "operations:write";
|
|
29
|
+
"operator:read": "operator:read";
|
|
30
|
+
"operator:write": "operator:write";
|
|
31
|
+
"participation:write": "participation:write";
|
|
32
|
+
"praise:read": "praise:read";
|
|
33
|
+
"praise:write": "praise:write";
|
|
34
|
+
"profile:write": "profile:write";
|
|
35
|
+
"programs:read": "programs:read";
|
|
36
|
+
"programs:write": "programs:write";
|
|
37
|
+
"pulse:read": "pulse:read";
|
|
38
|
+
"pulse:write": "pulse:write";
|
|
39
|
+
"reports:read": "reports:read";
|
|
40
|
+
"runs:read": "runs:read";
|
|
41
|
+
"runs:write": "runs:write";
|
|
42
|
+
"self:read": "self:read";
|
|
43
|
+
"self:write": "self:write";
|
|
44
|
+
"support:read": "support:read";
|
|
45
|
+
"support:write": "support:write";
|
|
46
|
+
"users:read": "users:read";
|
|
47
|
+
"users:write": "users:write";
|
|
48
|
+
"workspace:read": "workspace:read";
|
|
49
|
+
"workspace:write": "workspace:write";
|
|
50
|
+
}>;
|
|
51
|
+
export type Scope = z.infer<typeof scopeSchema>;
|
|
52
|
+
export declare const base: import("@orpc/contract").ContractBuilder<import("@orpc/contract").Schema<unknown, unknown>, import("@orpc/contract").Schema<unknown, unknown>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
53
|
+
BAD_REQUEST: {
|
|
54
|
+
message: string;
|
|
55
|
+
};
|
|
56
|
+
CONFLICT: {
|
|
57
|
+
message: string;
|
|
58
|
+
};
|
|
59
|
+
FORBIDDEN: {
|
|
60
|
+
message: string;
|
|
61
|
+
};
|
|
62
|
+
NOT_FOUND: {
|
|
63
|
+
message: string;
|
|
64
|
+
};
|
|
65
|
+
PRECONDITION_FAILED: {
|
|
66
|
+
message: string;
|
|
67
|
+
};
|
|
68
|
+
TOO_MANY_REQUESTS: {
|
|
69
|
+
message: string;
|
|
70
|
+
};
|
|
71
|
+
UNAUTHORIZED: {
|
|
72
|
+
message: string;
|
|
73
|
+
};
|
|
74
|
+
}>, {
|
|
75
|
+
scope: Scope | null;
|
|
76
|
+
} & Record<never, never>>;
|
|
77
|
+
export declare const adminScopes: readonly Scope[];
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { oc } from '@orpc/contract';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const scopes = [
|
|
4
|
+
'users:read',
|
|
5
|
+
'programs:read',
|
|
6
|
+
'programs:write',
|
|
7
|
+
'runs:write',
|
|
8
|
+
'runs:read',
|
|
9
|
+
'knowledge:read',
|
|
10
|
+
'manager:read',
|
|
11
|
+
'users:write',
|
|
12
|
+
'participation:write',
|
|
13
|
+
'profile:write',
|
|
14
|
+
'access:read',
|
|
15
|
+
'access:write',
|
|
16
|
+
'identities:read',
|
|
17
|
+
'identities:write',
|
|
18
|
+
'knowledge:manage',
|
|
19
|
+
'knowledge:write',
|
|
20
|
+
'integrations:read',
|
|
21
|
+
'integrations:write',
|
|
22
|
+
'hr:read',
|
|
23
|
+
'hr:write',
|
|
24
|
+
'support:read',
|
|
25
|
+
'support:write',
|
|
26
|
+
'billing:read',
|
|
27
|
+
'billing:write',
|
|
28
|
+
'operations:read',
|
|
29
|
+
'operations:write',
|
|
30
|
+
'operator:read',
|
|
31
|
+
'operator:write',
|
|
32
|
+
'reports:read',
|
|
33
|
+
'workspace:read',
|
|
34
|
+
'workspace:write',
|
|
35
|
+
'credentials:read',
|
|
36
|
+
'credentials:write',
|
|
37
|
+
'exports:read',
|
|
38
|
+
'assistant:read',
|
|
39
|
+
'assistant:write',
|
|
40
|
+
'onboarding:read',
|
|
41
|
+
'onboarding:write',
|
|
42
|
+
'celebrations:read',
|
|
43
|
+
'celebrations:write',
|
|
44
|
+
'self:read',
|
|
45
|
+
'self:write',
|
|
46
|
+
'pulse:read',
|
|
47
|
+
'pulse:write',
|
|
48
|
+
'praise:read',
|
|
49
|
+
'praise:write',
|
|
50
|
+
];
|
|
51
|
+
export const scopeSchema = z.enum(scopes);
|
|
52
|
+
export const base = oc.$meta({ scope: null }).errors({
|
|
53
|
+
BAD_REQUEST: { message: 'Check the request input.' },
|
|
54
|
+
CONFLICT: { message: 'The resource changed or the request key was reused.' },
|
|
55
|
+
FORBIDDEN: {
|
|
56
|
+
message: 'This token or workspace role does not permit the operation.',
|
|
57
|
+
},
|
|
58
|
+
NOT_FOUND: { message: 'The requested resource was not found.' },
|
|
59
|
+
PRECONDITION_FAILED: {
|
|
60
|
+
message: 'The workspace is not ready for this operation.',
|
|
61
|
+
},
|
|
62
|
+
TOO_MANY_REQUESTS: { message: 'Too many requests. Try again shortly.' },
|
|
63
|
+
UNAUTHORIZED: { message: 'A valid Shuffl API token is required.' },
|
|
64
|
+
});
|
|
65
|
+
export const adminScopes = [
|
|
66
|
+
'programs:write',
|
|
67
|
+
'runs:write',
|
|
68
|
+
'users:write',
|
|
69
|
+
'access:read',
|
|
70
|
+
'access:write',
|
|
71
|
+
'identities:read',
|
|
72
|
+
'identities:write',
|
|
73
|
+
'knowledge:manage',
|
|
74
|
+
'knowledge:write',
|
|
75
|
+
'integrations:read',
|
|
76
|
+
'integrations:write',
|
|
77
|
+
'billing:read',
|
|
78
|
+
'billing:write',
|
|
79
|
+
'operations:read',
|
|
80
|
+
'operations:write',
|
|
81
|
+
'workspace:write',
|
|
82
|
+
'workspace:read',
|
|
83
|
+
'exports:read',
|
|
84
|
+
'onboarding:read',
|
|
85
|
+
'onboarding:write',
|
|
86
|
+
'celebrations:read',
|
|
87
|
+
'celebrations:write',
|
|
88
|
+
'pulse:read',
|
|
89
|
+
'pulse:write',
|
|
90
|
+
'praise:read',
|
|
91
|
+
'praise:write',
|
|
92
|
+
];
|