@epilot/sdk 2.18.28 → 2.18.29
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/definitions/permissions.json +85 -2
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.d.cts +2 -2
- package/dist/apis/permissions.d.ts +2 -2
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/{chunk-R35ZKFN5.js → chunk-AUPMKSFK.js} +1 -1
- package/dist/{chunk-QNCPYVVS.cjs → chunk-DZ6B3JHX.cjs} +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/permissions-I2ERCKW4.cjs +7 -0
- package/dist/permissions-K4CL2K2A.js +7 -0
- package/dist/{permissions.d-l6AT8SYP.d.cts → permissions.d-BKoyMhU7.d.cts} +62 -4
- package/dist/{permissions.d-l6AT8SYP.d.ts → permissions.d-BKoyMhU7.d.ts} +62 -4
- package/docs/permissions.md +29 -1
- package/package.json +1 -1
- package/dist/permissions-X3SJVSPC.js +0 -7
- package/dist/permissions-ZJHUIBWY.cjs +0 -7
|
@@ -6,25 +6,25 @@ var _chunkADX7IYB3cjs = require('../chunk-ADX7IYB3.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkDZ6B3JHXcjs = require('../chunk-DZ6B3JHX.cjs');
|
|
10
10
|
require('../chunk-NJK5F5TF.cjs');
|
|
11
11
|
|
|
12
12
|
// src/apis/workflow-definition.ts
|
|
13
13
|
var loadDefinition = () => {
|
|
14
14
|
const mod = _chunkADX7IYB3cjs.require_workflow_definition_runtime.call(void 0, );
|
|
15
|
-
return
|
|
15
|
+
return _chunkDZ6B3JHXcjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
|
|
16
16
|
};
|
|
17
17
|
var _instance = null;
|
|
18
18
|
var resolve = () => {
|
|
19
19
|
if (!_instance) {
|
|
20
20
|
const def = loadDefinition();
|
|
21
|
-
_instance =
|
|
21
|
+
_instance = _chunkDZ6B3JHXcjs.createApiClient.call(void 0, { definition: def, apiName: "workflowDefinition" });
|
|
22
22
|
}
|
|
23
23
|
return _instance;
|
|
24
24
|
};
|
|
25
|
-
var _handle =
|
|
25
|
+
var _handle = _chunkDZ6B3JHXcjs.createApiHandle.call(void 0, {
|
|
26
26
|
resolveClient: resolve,
|
|
27
|
-
createClient: () =>
|
|
27
|
+
createClient: () => _chunkDZ6B3JHXcjs.createApiClient.call(void 0, { definition: loadDefinition(), apiName: "workflowDefinition" }),
|
|
28
28
|
apiName: "workflowDefinition"
|
|
29
29
|
});
|
|
30
30
|
var getClient = _handle.getClient;
|
|
@@ -35,4 +35,4 @@ var workflowDefinition = _handle;
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.authorize =
|
|
38
|
+
exports.authorize = _chunkDZ6B3JHXcjs.authorize; exports.createClient = createClient; exports.getClient = getClient; exports.workflowDefinition = workflowDefinition;
|
package/dist/apis/workflow.cjs
CHANGED
|
@@ -6,25 +6,25 @@ var _chunkPM25LLETcjs = require('../chunk-PM25LLET.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkDZ6B3JHXcjs = require('../chunk-DZ6B3JHX.cjs');
|
|
10
10
|
require('../chunk-NJK5F5TF.cjs');
|
|
11
11
|
|
|
12
12
|
// src/apis/workflow.ts
|
|
13
13
|
var loadDefinition = () => {
|
|
14
14
|
const mod = _chunkPM25LLETcjs.require_workflow_runtime.call(void 0, );
|
|
15
|
-
return
|
|
15
|
+
return _chunkDZ6B3JHXcjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
|
|
16
16
|
};
|
|
17
17
|
var _instance = null;
|
|
18
18
|
var resolve = () => {
|
|
19
19
|
if (!_instance) {
|
|
20
20
|
const def = loadDefinition();
|
|
21
|
-
_instance =
|
|
21
|
+
_instance = _chunkDZ6B3JHXcjs.createApiClient.call(void 0, { definition: def, apiName: "workflow" });
|
|
22
22
|
}
|
|
23
23
|
return _instance;
|
|
24
24
|
};
|
|
25
|
-
var _handle =
|
|
25
|
+
var _handle = _chunkDZ6B3JHXcjs.createApiHandle.call(void 0, {
|
|
26
26
|
resolveClient: resolve,
|
|
27
|
-
createClient: () =>
|
|
27
|
+
createClient: () => _chunkDZ6B3JHXcjs.createApiClient.call(void 0, { definition: loadDefinition(), apiName: "workflow" }),
|
|
28
28
|
apiName: "workflow"
|
|
29
29
|
});
|
|
30
30
|
var getClient = _handle.getClient;
|
|
@@ -35,4 +35,4 @@ var workflow = _handle;
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.authorize =
|
|
38
|
+
exports.authorize = _chunkDZ6B3JHXcjs.authorize; exports.createClient = createClient; exports.getClient = getClient; exports.workflow = workflow;
|
package/dist/apis/workflow.js
CHANGED
|
@@ -65,7 +65,7 @@ var globImport_docs = __glob({
|
|
|
65
65
|
"./docs/notification.json": () => import("./notification-PLIRHBNF.js"),
|
|
66
66
|
"./docs/organization.json": () => import("./organization-ZERPH2IH.js"),
|
|
67
67
|
"./docs/partner-directory.json": () => import("./partner-directory-THI7JEXK.js"),
|
|
68
|
-
"./docs/permissions.json": () => import("./permissions-
|
|
68
|
+
"./docs/permissions.json": () => import("./permissions-K4CL2K2A.js"),
|
|
69
69
|
"./docs/pricing-tier.json": () => import("./pricing-tier-VUOFK5Q7.js"),
|
|
70
70
|
"./docs/pricing.json": () => import("./pricing-YJHJTRJS.js"),
|
|
71
71
|
"./docs/purpose.json": () => import("./purpose-RBRV3AQZ.js"),
|
|
@@ -65,7 +65,7 @@ var globImport_docs = _chunkNJK5F5TFcjs.__glob.call(void 0, {
|
|
|
65
65
|
"./docs/notification.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./notification-R2XBHFEW.cjs"))),
|
|
66
66
|
"./docs/organization.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./organization-RARYYG2E.cjs"))),
|
|
67
67
|
"./docs/partner-directory.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./partner-directory-ZQIBKD5Q.cjs"))),
|
|
68
|
-
"./docs/permissions.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./permissions-
|
|
68
|
+
"./docs/permissions.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./permissions-I2ERCKW4.cjs"))),
|
|
69
69
|
"./docs/pricing-tier.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./pricing-tier-NI35WOUP.cjs"))),
|
|
70
70
|
"./docs/pricing.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./pricing-5GBNQOLX.cjs"))),
|
|
71
71
|
"./docs/purpose.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./purpose-AKOEUHZ4.cjs"))),
|
package/dist/index.cjs
CHANGED
|
@@ -158,7 +158,7 @@ var _chunkADSWGLIVcjs = require('./chunk-ADSWGLIV.cjs');
|
|
|
158
158
|
|
|
159
159
|
|
|
160
160
|
|
|
161
|
-
var
|
|
161
|
+
var _chunkDZ6B3JHXcjs = require('./chunk-DZ6B3JHX.cjs');
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
var _chunkNJK5F5TFcjs = require('./chunk-NJK5F5TF.cjs');
|
|
@@ -225,7 +225,7 @@ var resolveClient = (params) => {
|
|
|
225
225
|
}
|
|
226
226
|
if (!entry.instance) {
|
|
227
227
|
const definition = entry.loader();
|
|
228
|
-
entry.instance =
|
|
228
|
+
entry.instance = _chunkDZ6B3JHXcjs.createApiClient.call(void 0, {
|
|
229
229
|
definition,
|
|
230
230
|
token: state.token,
|
|
231
231
|
headers: state.globalHeaders,
|
|
@@ -258,7 +258,7 @@ var resetAllClients = (registry) => {
|
|
|
258
258
|
};
|
|
259
259
|
|
|
260
260
|
// src/apis/_registry.ts
|
|
261
|
-
var expandDef = (mod) =>
|
|
261
|
+
var expandDef = (mod) => _chunkDZ6B3JHXcjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
|
|
262
262
|
var registerBuiltinApis = (registry) => {
|
|
263
263
|
registerApi({
|
|
264
264
|
registry,
|
|
@@ -601,9 +601,9 @@ var createSDK = () => {
|
|
|
601
601
|
const available = [...registry.keys()].join(", ");
|
|
602
602
|
throw new Error(`Unknown API: "${name}". Available: ${available}`);
|
|
603
603
|
}
|
|
604
|
-
return
|
|
604
|
+
return _chunkDZ6B3JHXcjs.createApiHandle.call(void 0, {
|
|
605
605
|
resolveClient: () => resolveClient({ registry, name, state }),
|
|
606
|
-
createClient: () =>
|
|
606
|
+
createClient: () => _chunkDZ6B3JHXcjs.createApiClient.call(void 0, { definition: entry.loader(), apiName: name }),
|
|
607
607
|
apiName: name
|
|
608
608
|
});
|
|
609
609
|
};
|
|
@@ -651,9 +651,9 @@ var createSDK = () => {
|
|
|
651
651
|
return interceptorUse;
|
|
652
652
|
}
|
|
653
653
|
case "help":
|
|
654
|
-
return (apiName) =>
|
|
654
|
+
return (apiName) => _chunkDZ6B3JHXcjs.help.call(void 0, apiName);
|
|
655
655
|
case "openapi":
|
|
656
|
-
return (apiName) =>
|
|
656
|
+
return (apiName) => _chunkDZ6B3JHXcjs.openapi.call(void 0, apiName);
|
|
657
657
|
case "then":
|
|
658
658
|
case "catch":
|
|
659
659
|
case "finally":
|
|
@@ -683,4 +683,4 @@ var epilot = createSDK();
|
|
|
683
683
|
|
|
684
684
|
|
|
685
685
|
|
|
686
|
-
exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize =
|
|
686
|
+
exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize = _chunkDZ6B3JHXcjs.authorize; exports.createSDK = createSDK; exports.epilot = epilot; exports.help = _chunkDZ6B3JHXcjs.help; exports.openapi = _chunkDZ6B3JHXcjs.openapi;
|
package/dist/index.d.cts
CHANGED
|
@@ -38,7 +38,7 @@ import { C as Client$v } from './notes.d-rbcyHfiB.cjs';
|
|
|
38
38
|
import { C as Client$w } from './notification.d-r89Jec85.cjs';
|
|
39
39
|
import { C as Client$x } from './organization.d-DqwnNxMg.cjs';
|
|
40
40
|
import { C as Client$y } from './partner-directory.d-BCIjHoGs.cjs';
|
|
41
|
-
import { C as Client$z } from './permissions.d-
|
|
41
|
+
import { C as Client$z } from './permissions.d-BKoyMhU7.cjs';
|
|
42
42
|
import { C as Client$A } from './pricing.d-C95oaAtN.cjs';
|
|
43
43
|
import { C as Client$B } from './pricing-tier.d-Cg0jl6n_.cjs';
|
|
44
44
|
import { C as Client$C } from './purpose.d-CbIYfTua.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ import { C as Client$v } from './notes.d-rbcyHfiB.js';
|
|
|
38
38
|
import { C as Client$w } from './notification.d-r89Jec85.js';
|
|
39
39
|
import { C as Client$x } from './organization.d-DqwnNxMg.js';
|
|
40
40
|
import { C as Client$y } from './partner-directory.d-BCIjHoGs.js';
|
|
41
|
-
import { C as Client$z } from './permissions.d-
|
|
41
|
+
import { C as Client$z } from './permissions.d-BKoyMhU7.js';
|
|
42
42
|
import { C as Client$A } from './pricing.d-C95oaAtN.js';
|
|
43
43
|
import { C as Client$B } from './pricing-tier.d-Cg0jl6n_.js';
|
|
44
44
|
import { C as Client$C } from './purpose.d-CbIYfTua.js';
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
+
|
|
3
|
+
// src/docs/permissions.json
|
|
4
|
+
var permissions_default = '# Permissions API\n\n- **Base URL:** `https://permissions.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/permissions](https://docs.epilot.io/api/permissions)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.permissions.listCurrentRoles(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/permissions\'\n\nconst permissionsClient = getClient()\nauthorize(permissionsClient, () => \'<token>\')\nconst { data } = await permissionsClient.listCurrentRoles(...)\n```\n\n## Operations\n\n**Roles**\n- [`listCurrentRoles`](#listcurrentroles)\n- [`listAllRoles`](#listallroles)\n- [`createRole`](#createrole)\n- [`searchRoles`](#searchroles)\n- [`getRole`](#getrole)\n- [`putRole`](#putrole)\n- [`deleteRole`](#deleterole)\n- [`refreshPermissions`](#refreshpermissions)\n\n**Assignments**\n- [`getAssignedRolesForUser`](#getassignedrolesforuser)\n- [`assignRoles`](#assignroles)\n- [`addAssignment`](#addassignment)\n- [`removeAssignment`](#removeassignment)\n- [`listAllAssignments`](#listallassignments)\n\n**Schemas**\n- [`Grant`](#grant)\n- [`GrantWithDependencies`](#grantwithdependencies)\n- [`GrantCondition`](#grantcondition)\n- [`EqualsCurrentUserCondition`](#equalscurrentusercondition)\n- [`NotEqualsCurrentUserCondition`](#notequalscurrentusercondition)\n- [`EqualsCondition`](#equalscondition)\n- [`NotEqualsCondition`](#notequalscondition)\n- [`RoleId`](#roleid)\n- [`BaseRole`](#baserole)\n- [`BaseRoleForCreate`](#baseroleforcreate)\n- [`UserRole`](#userrole)\n- [`OrgRole`](#orgrole)\n- [`ShareRole`](#sharerole)\n- [`PartnerRole`](#partnerrole)\n- [`PortalRole`](#portalrole)\n- [`Role`](#role)\n- [`RolePayload`](#rolepayload)\n- [`Assignment`](#assignment)\n- [`InternalAssignment`](#internalassignment)\n- [`OrgAssignments`](#orgassignments)\n- [`OrgRoles`](#orgroles)\n- [`Assignments`](#assignments)\n- [`UserId`](#userid)\n- [`OrganizationId`](#organizationid)\n- [`Slug`](#slug)\n- [`RoleSearchInput`](#rolesearchinput)\n- [`CreateRolePayload`](#createrolepayload)\n- [`Error`](#error)\n\n### `listCurrentRoles`\n\nReturns roles and grants assigned to current user\n\n`GET /v1/permissions/me`\n\n```ts\nconst { data } = await client.listCurrentRoles()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "roles": [\n {\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `listAllRoles`\n\nReturns list of all roles in organization\n\n`GET /v1/permissions/roles`\n\n```ts\nconst { data } = await client.listAllRoles()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "roles": [\n {\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createRole`\n\nCreate role\n\n`POST /v1/permissions/roles`\n\n```ts\nconst { data } = await client.createRole(\n null,\n {},\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n}\n```\n\n</details>\n\n---\n\n### `searchRoles`\n\nSearch Roles\n\n`POST /v1/permissions/roles:search`\n\n```ts\nconst { data } = await client.searchRoles(\n null,\n {\n role_ids: [\'123:manager\', \'456:owner\'],\n org_ids: [\'123\', \'456\'],\n slugs: [\'manager\', \'owner\'],\n query: \'Administrator\',\n limit: 1,\n offset: 1\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getRole`\n\nGet role by id\n\n`GET /v1/permissions/roles/{roleId}`\n\n```ts\nconst { data } = await client.getRole({\n roleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n}\n```\n\n</details>\n\n---\n\n### `putRole`\n\nCreate or update role\n\n`PUT /v1/permissions/roles/{roleId}`\n\n```ts\nconst { data } = await client.putRole(\n {\n roleId: \'example\',\n },\n {\n id: \'123:owner\',\n name: \'Owner\',\n slug: \'owner\',\n type: \'user_role\',\n expires_at: \'2028-07-21T17:32:28Z\',\n organization_id: \'123\',\n grants: [\n {\n action: \'entity-read\',\n resource: \'entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947\',\n effect: \'allow\',\n conditions: [\n {\n attribute: \'workflows.primary.task_name\',\n operation: \'equals\',\n values: [\'Qualification\']\n }\n ]\n }\n ],\n parent_role: \'123:owner\',\n vendor_created: true\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n}\n```\n\n</details>\n\n---\n\n### `deleteRole`\n\nDelete role by id\n\n`DELETE /v1/permissions/roles/{roleId}`\n\n```ts\nconst { data } = await client.deleteRole({\n roleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n}\n```\n\n</details>\n\n---\n\n### `refreshPermissions`\n\nMakes sure the user has a role in the organization\n\n`GET /v1/permissions/refresh`\n\n```ts\nconst { data } = await client.refreshPermissions()\n```\n\n---\n\n### `getAssignedRolesForUser`\n\nGet list of assigned roles by user id\n\n`GET /v1/permissions/assignments/{userId}`\n\n```ts\nconst { data } = await client.getAssignedRolesForUser({\n userId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n["123:owner"]\n```\n\n</details>\n\n---\n\n### `assignRoles`\n\nAssign / unassign roles to users.\n\n`PUT /v1/permissions/assignments/{userId}`\n\n```ts\nconst { data } = await client.assignRoles(\n {\n userId: \'example\',\n },\n [\'123:owner\'],\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n["123:owner"]\n```\n\n</details>\n\n---\n\n### `addAssignment`\n\nAssign a user to a role.\n\n`POST /v1/permissions/assignments/{userId}/{roleId}`\n\n```ts\nconst { data } = await client.addAssignment({\n userId: \'example\',\n roleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "user_id": "1",\n "roles": ["123:owner"]\n}\n```\n\n</details>\n\n---\n\n### `removeAssignment`\n\nRemove role assignment from user\n\n`DELETE /v1/permissions/assignments/{userId}/{roleId}`\n\n```ts\nconst { data } = await client.removeAssignment({\n userId: \'example\',\n roleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "user_id": "1",\n "roles": ["123:owner"]\n}\n```\n\n</details>\n\n---\n\n### `listAllAssignments`\n\nReturns list of all assignments in organization\n\n`GET /v1/permissions/assignments`\n\n```ts\nconst { data } = await client.listAllAssignments()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "assignments": [\n {\n "user_id": "1",\n "roles": ["123:owner"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `Grant`\n\n```ts\ntype Grant = {\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n}\n```\n\n### `GrantWithDependencies`\n\n```ts\ntype GrantWithDependencies = {\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n dependencies?: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `GrantCondition`\n\n```ts\ntype GrantCondition = object\n```\n\n### `EqualsCurrentUserCondition`\n\nCheck if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes when the current user appears in ANY of the listed attribut\n\n```ts\ntype EqualsCurrentUserCondition = {\n attribute?: string\n attributes?: string[]\n operation: "equals_current_user"\n}\n```\n\n### `NotEqualsCurrentUserCondition`\n\nCheck if the current user is absent from the relation_user attributes on the entity. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes only when the current user appears in NONE of the li\n\n```ts\ntype NotEqualsCurrentUserCondition = {\n attribute?: string\n attributes?: string[]\n operation: "not_equals_current_user"\n}\n```\n\n### `EqualsCondition`\n\nCheck if attribute equals to any of the values\n\n```ts\ntype EqualsCondition = {\n attribute: string\n operation: "equals"\n values: unknown[]\n}\n```\n\n### `NotEqualsCondition`\n\nPasses when the attribute does not equal any of the values. Records where the attribute is missing or empty pass the condition.\n\n```ts\ntype NotEqualsCondition = {\n attribute: string\n operation: "not_equals"\n values: unknown[]\n}\n```\n\n### `RoleId`\n\nFormat: `<organization_id>`:`<slug>`\n\n```ts\ntype RoleId = string\n```\n\n### `BaseRole`\n\n```ts\ntype BaseRole = {\n id: string\n name: string\n slug: string\n type: string\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `BaseRoleForCreate`\n\n```ts\ntype BaseRoleForCreate = {\n id?: string\n name: string\n slug: string\n type: string\n expires_at?: string // date-time\n organization_id?: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `UserRole`\n\n```ts\ntype UserRole = {\n id: string\n name: string\n slug: string\n type: "user_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n parent_role?: object\n vendor_created?: boolean\n}\n```\n\n### `OrgRole`\n\n```ts\ntype OrgRole = {\n id: string\n name: string\n slug: string\n type: "org_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n pricing_tier?: string\n}\n```\n\n### `ShareRole`\n\n```ts\ntype ShareRole = {\n id: string\n name: string\n slug: string\n type: "share_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `PartnerRole`\n\n```ts\ntype PartnerRole = {\n id: string\n name: string\n slug: string\n type: "partner_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n partner_org_id?: object\n vendor_enforced_user_limit?: number\n vendor_created?: boolean\n}\n```\n\n### `PortalRole`\n\n```ts\ntype PortalRole = {\n id: string\n name: string\n slug: string\n type: "portal_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `Role`\n\n```ts\ntype Role = {\n id: string\n name: string\n slug: string\n type: "user_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n parent_role?: object\n vendor_created?: boolean\n} | {\n id: string\n name: string\n slug: string\n type: "org_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n pricing_tier?: string\n} | {\n id: string\n name: string\n slug: string\n type: "share_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n} | {\n id: string\n name: string\n slug: string\n type: "partner_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n partner_org_id?: object\n vendor_enforced_user_limit?: number\n vendor_created?: boolean\n} | {\n id: string\n name: string\n slug: string\n type: "portal_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `RolePayload`\n\n```ts\ntype RolePayload = {\n grants?: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n dependencies?: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n }>\n}\n```\n\n### `Assignment`\n\nA role attached to an user\n\n```ts\ntype Assignment = {\n user_id?: string\n roles?: string[]\n}\n```\n\n### `InternalAssignment`\n\nA role attached to an user\n\n```ts\ntype InternalAssignment = {\n userId?: string\n roles?: string[]\n}\n```\n\n### `OrgAssignments`\n\nAll roles attached to an users of an organization\n\n```ts\ntype OrgAssignments = {\n organizationId?: string\n assignments?: Array<{\n userId?: string\n roles?: string[]\n }>\n}\n```\n\n### `OrgRoles`\n\nAll roles attached to an users of an organization\n\n```ts\ntype OrgRoles = {\n organizationId?: string\n roles?: Array<{\n id: string\n name: string\n slug: string\n type: "user_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n parent_role?: object\n vendor_created?: boolean\n } | {\n id: string\n name: string\n slug: string\n type: "org_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n pricing_tier?: string\n } | {\n id: string\n name: string\n slug: string\n type: "share_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n } | {\n id: string\n name: string\n slug: string\n type: "partner_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n partner_org_id?: object\n vendor_enforced_user_limit?: number\n vendor_created?: boolean\n } | {\n id: string\n name: string\n slug: string\n type: "portal_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n }>\n}\n```\n\n### `Assignments`\n\nList of role ids attached to an user\n\n```ts\ntype Assignments = string[]\n```\n\n### `UserId`\n\nId of a user\n\n```ts\ntype UserId = string\n```\n\n### `OrganizationId`\n\nId of an organization\n\n```ts\ntype OrganizationId = string\n```\n\n### `Slug`\n\nSlug of a role; for a role with id = 123:manager -> 123 is org_id & manager is slug\n\n```ts\ntype Slug = string\n```\n\n### `RoleSearchInput`\n\n```ts\ntype RoleSearchInput = {\n role_ids?: string[]\n org_ids?: string[]\n slugs?: string[]\n query?: string\n limit?: number\n offset?: number\n}\n```\n\n### `CreateRolePayload`\n\n```ts\ntype CreateRolePayload = {\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n id?: string\n name: string\n slug: string\n type: string\n expires_at?: string // date-time\n organization_id?: string\n}\n```\n\n### `Error`\n\nError response\n\n```ts\ntype Error = {\n message: string\n}\n```\n';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.default = permissions_default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./chunk-YPSWSI3M.js";
|
|
2
|
+
|
|
3
|
+
// src/docs/permissions.json
|
|
4
|
+
var permissions_default = '# Permissions API\n\n- **Base URL:** `https://permissions.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/permissions](https://docs.epilot.io/api/permissions)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.permissions.listCurrentRoles(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/permissions\'\n\nconst permissionsClient = getClient()\nauthorize(permissionsClient, () => \'<token>\')\nconst { data } = await permissionsClient.listCurrentRoles(...)\n```\n\n## Operations\n\n**Roles**\n- [`listCurrentRoles`](#listcurrentroles)\n- [`listAllRoles`](#listallroles)\n- [`createRole`](#createrole)\n- [`searchRoles`](#searchroles)\n- [`getRole`](#getrole)\n- [`putRole`](#putrole)\n- [`deleteRole`](#deleterole)\n- [`refreshPermissions`](#refreshpermissions)\n\n**Assignments**\n- [`getAssignedRolesForUser`](#getassignedrolesforuser)\n- [`assignRoles`](#assignroles)\n- [`addAssignment`](#addassignment)\n- [`removeAssignment`](#removeassignment)\n- [`listAllAssignments`](#listallassignments)\n\n**Schemas**\n- [`Grant`](#grant)\n- [`GrantWithDependencies`](#grantwithdependencies)\n- [`GrantCondition`](#grantcondition)\n- [`EqualsCurrentUserCondition`](#equalscurrentusercondition)\n- [`NotEqualsCurrentUserCondition`](#notequalscurrentusercondition)\n- [`EqualsCondition`](#equalscondition)\n- [`NotEqualsCondition`](#notequalscondition)\n- [`RoleId`](#roleid)\n- [`BaseRole`](#baserole)\n- [`BaseRoleForCreate`](#baseroleforcreate)\n- [`UserRole`](#userrole)\n- [`OrgRole`](#orgrole)\n- [`ShareRole`](#sharerole)\n- [`PartnerRole`](#partnerrole)\n- [`PortalRole`](#portalrole)\n- [`Role`](#role)\n- [`RolePayload`](#rolepayload)\n- [`Assignment`](#assignment)\n- [`InternalAssignment`](#internalassignment)\n- [`OrgAssignments`](#orgassignments)\n- [`OrgRoles`](#orgroles)\n- [`Assignments`](#assignments)\n- [`UserId`](#userid)\n- [`OrganizationId`](#organizationid)\n- [`Slug`](#slug)\n- [`RoleSearchInput`](#rolesearchinput)\n- [`CreateRolePayload`](#createrolepayload)\n- [`Error`](#error)\n\n### `listCurrentRoles`\n\nReturns roles and grants assigned to current user\n\n`GET /v1/permissions/me`\n\n```ts\nconst { data } = await client.listCurrentRoles()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "roles": [\n {\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `listAllRoles`\n\nReturns list of all roles in organization\n\n`GET /v1/permissions/roles`\n\n```ts\nconst { data } = await client.listAllRoles()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "roles": [\n {\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createRole`\n\nCreate role\n\n`POST /v1/permissions/roles`\n\n```ts\nconst { data } = await client.createRole(\n null,\n {},\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n}\n```\n\n</details>\n\n---\n\n### `searchRoles`\n\nSearch Roles\n\n`POST /v1/permissions/roles:search`\n\n```ts\nconst { data } = await client.searchRoles(\n null,\n {\n role_ids: [\'123:manager\', \'456:owner\'],\n org_ids: [\'123\', \'456\'],\n slugs: [\'manager\', \'owner\'],\n query: \'Administrator\',\n limit: 1,\n offset: 1\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getRole`\n\nGet role by id\n\n`GET /v1/permissions/roles/{roleId}`\n\n```ts\nconst { data } = await client.getRole({\n roleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n}\n```\n\n</details>\n\n---\n\n### `putRole`\n\nCreate or update role\n\n`PUT /v1/permissions/roles/{roleId}`\n\n```ts\nconst { data } = await client.putRole(\n {\n roleId: \'example\',\n },\n {\n id: \'123:owner\',\n name: \'Owner\',\n slug: \'owner\',\n type: \'user_role\',\n expires_at: \'2028-07-21T17:32:28Z\',\n organization_id: \'123\',\n grants: [\n {\n action: \'entity-read\',\n resource: \'entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947\',\n effect: \'allow\',\n conditions: [\n {\n attribute: \'workflows.primary.task_name\',\n operation: \'equals\',\n values: [\'Qualification\']\n }\n ]\n }\n ],\n parent_role: \'123:owner\',\n vendor_created: true\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n}\n```\n\n</details>\n\n---\n\n### `deleteRole`\n\nDelete role by id\n\n`DELETE /v1/permissions/roles/{roleId}`\n\n```ts\nconst { data } = await client.deleteRole({\n roleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "123:owner",\n "name": "Owner",\n "slug": "owner",\n "type": "user_role",\n "expires_at": "2028-07-21T17:32:28Z",\n "organization_id": "123",\n "grants": [\n {\n "action": "entity-read",\n "resource": "entity:123:contact:f7c22299-ca72-4bca-8538-0a88eeefc947",\n "effect": "allow",\n "conditions": [\n {\n "attribute": "workflows.primary.task_name",\n "operation": "equals",\n "values": ["Qualification"]\n }\n ]\n }\n ],\n "parent_role": "123:owner",\n "vendor_created": true\n}\n```\n\n</details>\n\n---\n\n### `refreshPermissions`\n\nMakes sure the user has a role in the organization\n\n`GET /v1/permissions/refresh`\n\n```ts\nconst { data } = await client.refreshPermissions()\n```\n\n---\n\n### `getAssignedRolesForUser`\n\nGet list of assigned roles by user id\n\n`GET /v1/permissions/assignments/{userId}`\n\n```ts\nconst { data } = await client.getAssignedRolesForUser({\n userId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n["123:owner"]\n```\n\n</details>\n\n---\n\n### `assignRoles`\n\nAssign / unassign roles to users.\n\n`PUT /v1/permissions/assignments/{userId}`\n\n```ts\nconst { data } = await client.assignRoles(\n {\n userId: \'example\',\n },\n [\'123:owner\'],\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n["123:owner"]\n```\n\n</details>\n\n---\n\n### `addAssignment`\n\nAssign a user to a role.\n\n`POST /v1/permissions/assignments/{userId}/{roleId}`\n\n```ts\nconst { data } = await client.addAssignment({\n userId: \'example\',\n roleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "user_id": "1",\n "roles": ["123:owner"]\n}\n```\n\n</details>\n\n---\n\n### `removeAssignment`\n\nRemove role assignment from user\n\n`DELETE /v1/permissions/assignments/{userId}/{roleId}`\n\n```ts\nconst { data } = await client.removeAssignment({\n userId: \'example\',\n roleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "user_id": "1",\n "roles": ["123:owner"]\n}\n```\n\n</details>\n\n---\n\n### `listAllAssignments`\n\nReturns list of all assignments in organization\n\n`GET /v1/permissions/assignments`\n\n```ts\nconst { data } = await client.listAllAssignments()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "assignments": [\n {\n "user_id": "1",\n "roles": ["123:owner"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `Grant`\n\n```ts\ntype Grant = {\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n}\n```\n\n### `GrantWithDependencies`\n\n```ts\ntype GrantWithDependencies = {\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n dependencies?: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `GrantCondition`\n\n```ts\ntype GrantCondition = object\n```\n\n### `EqualsCurrentUserCondition`\n\nCheck if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes when the current user appears in ANY of the listed attribut\n\n```ts\ntype EqualsCurrentUserCondition = {\n attribute?: string\n attributes?: string[]\n operation: "equals_current_user"\n}\n```\n\n### `NotEqualsCurrentUserCondition`\n\nCheck if the current user is absent from the relation_user attributes on the entity. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes only when the current user appears in NONE of the li\n\n```ts\ntype NotEqualsCurrentUserCondition = {\n attribute?: string\n attributes?: string[]\n operation: "not_equals_current_user"\n}\n```\n\n### `EqualsCondition`\n\nCheck if attribute equals to any of the values\n\n```ts\ntype EqualsCondition = {\n attribute: string\n operation: "equals"\n values: unknown[]\n}\n```\n\n### `NotEqualsCondition`\n\nPasses when the attribute does not equal any of the values. Records where the attribute is missing or empty pass the condition.\n\n```ts\ntype NotEqualsCondition = {\n attribute: string\n operation: "not_equals"\n values: unknown[]\n}\n```\n\n### `RoleId`\n\nFormat: `<organization_id>`:`<slug>`\n\n```ts\ntype RoleId = string\n```\n\n### `BaseRole`\n\n```ts\ntype BaseRole = {\n id: string\n name: string\n slug: string\n type: string\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `BaseRoleForCreate`\n\n```ts\ntype BaseRoleForCreate = {\n id?: string\n name: string\n slug: string\n type: string\n expires_at?: string // date-time\n organization_id?: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `UserRole`\n\n```ts\ntype UserRole = {\n id: string\n name: string\n slug: string\n type: "user_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n parent_role?: object\n vendor_created?: boolean\n}\n```\n\n### `OrgRole`\n\n```ts\ntype OrgRole = {\n id: string\n name: string\n slug: string\n type: "org_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n pricing_tier?: string\n}\n```\n\n### `ShareRole`\n\n```ts\ntype ShareRole = {\n id: string\n name: string\n slug: string\n type: "share_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `PartnerRole`\n\n```ts\ntype PartnerRole = {\n id: string\n name: string\n slug: string\n type: "partner_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n partner_org_id?: object\n vendor_enforced_user_limit?: number\n vendor_created?: boolean\n}\n```\n\n### `PortalRole`\n\n```ts\ntype PortalRole = {\n id: string\n name: string\n slug: string\n type: "portal_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `Role`\n\n```ts\ntype Role = {\n id: string\n name: string\n slug: string\n type: "user_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n parent_role?: object\n vendor_created?: boolean\n} | {\n id: string\n name: string\n slug: string\n type: "org_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n pricing_tier?: string\n} | {\n id: string\n name: string\n slug: string\n type: "share_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n} | {\n id: string\n name: string\n slug: string\n type: "partner_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n partner_org_id?: object\n vendor_enforced_user_limit?: number\n vendor_created?: boolean\n} | {\n id: string\n name: string\n slug: string\n type: "portal_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n}\n```\n\n### `RolePayload`\n\n```ts\ntype RolePayload = {\n grants?: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n dependencies?: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n }>\n}\n```\n\n### `Assignment`\n\nA role attached to an user\n\n```ts\ntype Assignment = {\n user_id?: string\n roles?: string[]\n}\n```\n\n### `InternalAssignment`\n\nA role attached to an user\n\n```ts\ntype InternalAssignment = {\n userId?: string\n roles?: string[]\n}\n```\n\n### `OrgAssignments`\n\nAll roles attached to an users of an organization\n\n```ts\ntype OrgAssignments = {\n organizationId?: string\n assignments?: Array<{\n userId?: string\n roles?: string[]\n }>\n}\n```\n\n### `OrgRoles`\n\nAll roles attached to an users of an organization\n\n```ts\ntype OrgRoles = {\n organizationId?: string\n roles?: Array<{\n id: string\n name: string\n slug: string\n type: "user_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n parent_role?: object\n vendor_created?: boolean\n } | {\n id: string\n name: string\n slug: string\n type: "org_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n pricing_tier?: string\n } | {\n id: string\n name: string\n slug: string\n type: "share_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n } | {\n id: string\n name: string\n slug: string\n type: "partner_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n partner_org_id?: object\n vendor_enforced_user_limit?: number\n vendor_created?: boolean\n } | {\n id: string\n name: string\n slug: string\n type: "portal_role"\n expires_at?: string // date-time\n organization_id: string\n grants: Array<{\n action: { ... }\n resource?: { ... }\n effect?: { ... }\n conditions?: { ... }\n }>\n }>\n}\n```\n\n### `Assignments`\n\nList of role ids attached to an user\n\n```ts\ntype Assignments = string[]\n```\n\n### `UserId`\n\nId of a user\n\n```ts\ntype UserId = string\n```\n\n### `OrganizationId`\n\nId of an organization\n\n```ts\ntype OrganizationId = string\n```\n\n### `Slug`\n\nSlug of a role; for a role with id = 123:manager -> 123 is org_id & manager is slug\n\n```ts\ntype Slug = string\n```\n\n### `RoleSearchInput`\n\n```ts\ntype RoleSearchInput = {\n role_ids?: string[]\n org_ids?: string[]\n slugs?: string[]\n query?: string\n limit?: number\n offset?: number\n}\n```\n\n### `CreateRolePayload`\n\n```ts\ntype CreateRolePayload = {\n grants: Array<{\n action: string\n resource?: string\n effect?: "allow" | "deny"\n conditions?: object[]\n }>\n id?: string\n name: string\n slug: string\n type: string\n expires_at?: string // date-time\n organization_id?: string\n}\n```\n\n### `Error`\n\nError response\n\n```ts\ntype Error = {\n message: string\n}\n```\n';
|
|
5
|
+
export {
|
|
6
|
+
permissions_default as default
|
|
7
|
+
};
|
|
@@ -343,10 +343,13 @@ declare namespace Components {
|
|
|
343
343
|
*/
|
|
344
344
|
attribute: string;
|
|
345
345
|
operation: "equals";
|
|
346
|
-
values:
|
|
346
|
+
values: [
|
|
347
|
+
any,
|
|
348
|
+
...any[]
|
|
349
|
+
];
|
|
347
350
|
}
|
|
348
351
|
/**
|
|
349
|
-
* Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked.
|
|
352
|
+
* Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes when the current user appears in ANY of the listed attribute paths.
|
|
350
353
|
*/
|
|
351
354
|
export interface EqualsCurrentUserCondition {
|
|
352
355
|
/**
|
|
@@ -355,6 +358,18 @@ declare namespace Components {
|
|
|
355
358
|
* assignee.*.user_id
|
|
356
359
|
*/
|
|
357
360
|
attribute?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Optional list of JSON paths to user attributes. Takes precedence over attribute.
|
|
363
|
+
* example:
|
|
364
|
+
* [
|
|
365
|
+
* "assignee.*.user_id",
|
|
366
|
+
* "owner.*.user_id"
|
|
367
|
+
* ]
|
|
368
|
+
*/
|
|
369
|
+
attributes?: [
|
|
370
|
+
string,
|
|
371
|
+
...string[]
|
|
372
|
+
];
|
|
358
373
|
operation: "equals_current_user";
|
|
359
374
|
}
|
|
360
375
|
/**
|
|
@@ -385,7 +400,7 @@ declare namespace Components {
|
|
|
385
400
|
/**
|
|
386
401
|
* An additional condition that must be met for the grant
|
|
387
402
|
*/
|
|
388
|
-
export type GrantCondition = /* An additional condition that must be met for the grant */ /* Check if attribute equals to any of the values */ EqualsCondition | /* Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. */ EqualsCurrentUserCondition;
|
|
403
|
+
export type GrantCondition = /* An additional condition that must be met for the grant */ /* Check if attribute equals to any of the values */ EqualsCondition | /* Passes when the attribute does not equal any of the values. Records where the attribute is missing or empty pass the condition. */ NotEqualsCondition | /* Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes when the current user appears in ANY of the listed attribute paths. */ EqualsCurrentUserCondition | /* Check if the current user is absent from the relation_user attributes on the entity. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes only when the current user appears in NONE of the listed attribute paths. */ NotEqualsCurrentUserCondition;
|
|
389
404
|
export interface GrantWithDependencies {
|
|
390
405
|
/**
|
|
391
406
|
* example:
|
|
@@ -421,6 +436,45 @@ declare namespace Components {
|
|
|
421
436
|
*/
|
|
422
437
|
RoleId[];
|
|
423
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* Passes when the attribute does not equal any of the values. Records where the attribute is missing or empty pass the condition.
|
|
441
|
+
*/
|
|
442
|
+
export interface NotEqualsCondition {
|
|
443
|
+
/**
|
|
444
|
+
* example:
|
|
445
|
+
* workflows.primary.task_name
|
|
446
|
+
*/
|
|
447
|
+
attribute: string;
|
|
448
|
+
operation: "not_equals";
|
|
449
|
+
values: [
|
|
450
|
+
any,
|
|
451
|
+
...any[]
|
|
452
|
+
];
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Check if the current user is absent from the relation_user attributes on the entity. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes only when the current user appears in NONE of the listed attribute paths.
|
|
456
|
+
*/
|
|
457
|
+
export interface NotEqualsCurrentUserCondition {
|
|
458
|
+
/**
|
|
459
|
+
* Optional JSON path to a specific user attribute. When omitted, all relation_user attributes on the entity are scanned.
|
|
460
|
+
* example:
|
|
461
|
+
* assignee.*.user_id
|
|
462
|
+
*/
|
|
463
|
+
attribute?: string;
|
|
464
|
+
/**
|
|
465
|
+
* Optional list of JSON paths to user attributes. Takes precedence over attribute.
|
|
466
|
+
* example:
|
|
467
|
+
* [
|
|
468
|
+
* "assignee.*.user_id",
|
|
469
|
+
* "owner.*.user_id"
|
|
470
|
+
* ]
|
|
471
|
+
*/
|
|
472
|
+
attributes?: [
|
|
473
|
+
string,
|
|
474
|
+
...string[]
|
|
475
|
+
];
|
|
476
|
+
operation: "not_equals_current_user";
|
|
477
|
+
}
|
|
424
478
|
/**
|
|
425
479
|
* All roles attached to an users of an organization
|
|
426
480
|
*/
|
|
@@ -959,6 +1013,7 @@ declare namespace Paths {
|
|
|
959
1013
|
}
|
|
960
1014
|
}
|
|
961
1015
|
|
|
1016
|
+
|
|
962
1017
|
interface OperationMethods {
|
|
963
1018
|
/**
|
|
964
1019
|
* listCurrentRoles - listCurrentRoles
|
|
@@ -1249,6 +1304,7 @@ interface PathsDictionary {
|
|
|
1249
1304
|
|
|
1250
1305
|
type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
|
1251
1306
|
|
|
1307
|
+
|
|
1252
1308
|
type Assignment = Components.Schemas.Assignment;
|
|
1253
1309
|
type Assignments = Components.Schemas.Assignments;
|
|
1254
1310
|
type BaseRole = Components.Schemas.BaseRole;
|
|
@@ -1261,6 +1317,8 @@ type Grant = Components.Schemas.Grant;
|
|
|
1261
1317
|
type GrantCondition = Components.Schemas.GrantCondition;
|
|
1262
1318
|
type GrantWithDependencies = Components.Schemas.GrantWithDependencies;
|
|
1263
1319
|
type InternalAssignment = Components.Schemas.InternalAssignment;
|
|
1320
|
+
type NotEqualsCondition = Components.Schemas.NotEqualsCondition;
|
|
1321
|
+
type NotEqualsCurrentUserCondition = Components.Schemas.NotEqualsCurrentUserCondition;
|
|
1264
1322
|
type OrgAssignments = Components.Schemas.OrgAssignments;
|
|
1265
1323
|
type OrgRole = Components.Schemas.OrgRole;
|
|
1266
1324
|
type OrgRoles = Components.Schemas.OrgRoles;
|
|
@@ -1276,4 +1334,4 @@ type Slug = Components.Schemas.Slug;
|
|
|
1276
1334
|
type UserId = Components.Schemas.UserId;
|
|
1277
1335
|
type UserRole = Components.Schemas.UserRole;
|
|
1278
1336
|
|
|
1279
|
-
export { type Assignment as A, type BaseRole as B, type Client as C, type EqualsCondition as E, type Grant as G, type InternalAssignment as I, type OperationMethods as O, Paths as P, type Role as R, type ShareRole as S, type UserId as U, Components as a, type PathsDictionary as b, type Assignments as c, type BaseRoleForCreate as d, type CreateRolePayload as e, type EqualsCurrentUserCondition as f, type Error as g, type GrantCondition as h, type GrantWithDependencies as i, type
|
|
1337
|
+
export { type Assignment as A, type BaseRole as B, type Client as C, type EqualsCondition as E, type Grant as G, type InternalAssignment as I, type NotEqualsCondition as N, type OperationMethods as O, Paths as P, type Role as R, type ShareRole as S, type UserId as U, Components as a, type PathsDictionary as b, type Assignments as c, type BaseRoleForCreate as d, type CreateRolePayload as e, type EqualsCurrentUserCondition as f, type Error as g, type GrantCondition as h, type GrantWithDependencies as i, type NotEqualsCurrentUserCondition as j, type OrgAssignments as k, type OrgRole as l, type OrgRoles as m, type OrganizationId as n, type PartnerRole as o, type PortalRole as p, type RoleId as q, type RolePayload as r, type RoleSearchInput as s, type Slug as t, type UserRole as u };
|
|
@@ -343,10 +343,13 @@ declare namespace Components {
|
|
|
343
343
|
*/
|
|
344
344
|
attribute: string;
|
|
345
345
|
operation: "equals";
|
|
346
|
-
values:
|
|
346
|
+
values: [
|
|
347
|
+
any,
|
|
348
|
+
...any[]
|
|
349
|
+
];
|
|
347
350
|
}
|
|
348
351
|
/**
|
|
349
|
-
* Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked.
|
|
352
|
+
* Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes when the current user appears in ANY of the listed attribute paths.
|
|
350
353
|
*/
|
|
351
354
|
export interface EqualsCurrentUserCondition {
|
|
352
355
|
/**
|
|
@@ -355,6 +358,18 @@ declare namespace Components {
|
|
|
355
358
|
* assignee.*.user_id
|
|
356
359
|
*/
|
|
357
360
|
attribute?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Optional list of JSON paths to user attributes. Takes precedence over attribute.
|
|
363
|
+
* example:
|
|
364
|
+
* [
|
|
365
|
+
* "assignee.*.user_id",
|
|
366
|
+
* "owner.*.user_id"
|
|
367
|
+
* ]
|
|
368
|
+
*/
|
|
369
|
+
attributes?: [
|
|
370
|
+
string,
|
|
371
|
+
...string[]
|
|
372
|
+
];
|
|
358
373
|
operation: "equals_current_user";
|
|
359
374
|
}
|
|
360
375
|
/**
|
|
@@ -385,7 +400,7 @@ declare namespace Components {
|
|
|
385
400
|
/**
|
|
386
401
|
* An additional condition that must be met for the grant
|
|
387
402
|
*/
|
|
388
|
-
export type GrantCondition = /* An additional condition that must be met for the grant */ /* Check if attribute equals to any of the values */ EqualsCondition | /* Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. */ EqualsCurrentUserCondition;
|
|
403
|
+
export type GrantCondition = /* An additional condition that must be met for the grant */ /* Check if attribute equals to any of the values */ EqualsCondition | /* Passes when the attribute does not equal any of the values. Records where the attribute is missing or empty pass the condition. */ NotEqualsCondition | /* Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes when the current user appears in ANY of the listed attribute paths. */ EqualsCurrentUserCondition | /* Check if the current user is absent from the relation_user attributes on the entity. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes only when the current user appears in NONE of the listed attribute paths. */ NotEqualsCurrentUserCondition;
|
|
389
404
|
export interface GrantWithDependencies {
|
|
390
405
|
/**
|
|
391
406
|
* example:
|
|
@@ -421,6 +436,45 @@ declare namespace Components {
|
|
|
421
436
|
*/
|
|
422
437
|
RoleId[];
|
|
423
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* Passes when the attribute does not equal any of the values. Records where the attribute is missing or empty pass the condition.
|
|
441
|
+
*/
|
|
442
|
+
export interface NotEqualsCondition {
|
|
443
|
+
/**
|
|
444
|
+
* example:
|
|
445
|
+
* workflows.primary.task_name
|
|
446
|
+
*/
|
|
447
|
+
attribute: string;
|
|
448
|
+
operation: "not_equals";
|
|
449
|
+
values: [
|
|
450
|
+
any,
|
|
451
|
+
...any[]
|
|
452
|
+
];
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Check if the current user is absent from the relation_user attributes on the entity. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes only when the current user appears in NONE of the listed attribute paths.
|
|
456
|
+
*/
|
|
457
|
+
export interface NotEqualsCurrentUserCondition {
|
|
458
|
+
/**
|
|
459
|
+
* Optional JSON path to a specific user attribute. When omitted, all relation_user attributes on the entity are scanned.
|
|
460
|
+
* example:
|
|
461
|
+
* assignee.*.user_id
|
|
462
|
+
*/
|
|
463
|
+
attribute?: string;
|
|
464
|
+
/**
|
|
465
|
+
* Optional list of JSON paths to user attributes. Takes precedence over attribute.
|
|
466
|
+
* example:
|
|
467
|
+
* [
|
|
468
|
+
* "assignee.*.user_id",
|
|
469
|
+
* "owner.*.user_id"
|
|
470
|
+
* ]
|
|
471
|
+
*/
|
|
472
|
+
attributes?: [
|
|
473
|
+
string,
|
|
474
|
+
...string[]
|
|
475
|
+
];
|
|
476
|
+
operation: "not_equals_current_user";
|
|
477
|
+
}
|
|
424
478
|
/**
|
|
425
479
|
* All roles attached to an users of an organization
|
|
426
480
|
*/
|
|
@@ -959,6 +1013,7 @@ declare namespace Paths {
|
|
|
959
1013
|
}
|
|
960
1014
|
}
|
|
961
1015
|
|
|
1016
|
+
|
|
962
1017
|
interface OperationMethods {
|
|
963
1018
|
/**
|
|
964
1019
|
* listCurrentRoles - listCurrentRoles
|
|
@@ -1249,6 +1304,7 @@ interface PathsDictionary {
|
|
|
1249
1304
|
|
|
1250
1305
|
type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
|
1251
1306
|
|
|
1307
|
+
|
|
1252
1308
|
type Assignment = Components.Schemas.Assignment;
|
|
1253
1309
|
type Assignments = Components.Schemas.Assignments;
|
|
1254
1310
|
type BaseRole = Components.Schemas.BaseRole;
|
|
@@ -1261,6 +1317,8 @@ type Grant = Components.Schemas.Grant;
|
|
|
1261
1317
|
type GrantCondition = Components.Schemas.GrantCondition;
|
|
1262
1318
|
type GrantWithDependencies = Components.Schemas.GrantWithDependencies;
|
|
1263
1319
|
type InternalAssignment = Components.Schemas.InternalAssignment;
|
|
1320
|
+
type NotEqualsCondition = Components.Schemas.NotEqualsCondition;
|
|
1321
|
+
type NotEqualsCurrentUserCondition = Components.Schemas.NotEqualsCurrentUserCondition;
|
|
1264
1322
|
type OrgAssignments = Components.Schemas.OrgAssignments;
|
|
1265
1323
|
type OrgRole = Components.Schemas.OrgRole;
|
|
1266
1324
|
type OrgRoles = Components.Schemas.OrgRoles;
|
|
@@ -1276,4 +1334,4 @@ type Slug = Components.Schemas.Slug;
|
|
|
1276
1334
|
type UserId = Components.Schemas.UserId;
|
|
1277
1335
|
type UserRole = Components.Schemas.UserRole;
|
|
1278
1336
|
|
|
1279
|
-
export { type Assignment as A, type BaseRole as B, type Client as C, type EqualsCondition as E, type Grant as G, type InternalAssignment as I, type OperationMethods as O, Paths as P, type Role as R, type ShareRole as S, type UserId as U, Components as a, type PathsDictionary as b, type Assignments as c, type BaseRoleForCreate as d, type CreateRolePayload as e, type EqualsCurrentUserCondition as f, type Error as g, type GrantCondition as h, type GrantWithDependencies as i, type
|
|
1337
|
+
export { type Assignment as A, type BaseRole as B, type Client as C, type EqualsCondition as E, type Grant as G, type InternalAssignment as I, type NotEqualsCondition as N, type OperationMethods as O, Paths as P, type Role as R, type ShareRole as S, type UserId as U, Components as a, type PathsDictionary as b, type Assignments as c, type BaseRoleForCreate as d, type CreateRolePayload as e, type EqualsCurrentUserCondition as f, type Error as g, type GrantCondition as h, type GrantWithDependencies as i, type NotEqualsCurrentUserCondition as j, type OrgAssignments as k, type OrgRole as l, type OrgRoles as m, type OrganizationId as n, type PartnerRole as o, type PortalRole as p, type RoleId as q, type RolePayload as r, type RoleSearchInput as s, type Slug as t, type UserRole as u };
|
package/docs/permissions.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Permissions API
|
|
2
2
|
|
|
3
|
+
- **Base URL:** `https://permissions.sls.epilot.io`
|
|
3
4
|
- **Full API Docs:** [https://docs.epilot.io/api/permissions](https://docs.epilot.io/api/permissions)
|
|
4
5
|
|
|
5
6
|
## Usage
|
|
@@ -45,7 +46,9 @@ const { data } = await permissionsClient.listCurrentRoles(...)
|
|
|
45
46
|
- [`GrantWithDependencies`](#grantwithdependencies)
|
|
46
47
|
- [`GrantCondition`](#grantcondition)
|
|
47
48
|
- [`EqualsCurrentUserCondition`](#equalscurrentusercondition)
|
|
49
|
+
- [`NotEqualsCurrentUserCondition`](#notequalscurrentusercondition)
|
|
48
50
|
- [`EqualsCondition`](#equalscondition)
|
|
51
|
+
- [`NotEqualsCondition`](#notequalscondition)
|
|
49
52
|
- [`RoleId`](#roleid)
|
|
50
53
|
- [`BaseRole`](#baserole)
|
|
51
54
|
- [`BaseRoleForCreate`](#baseroleforcreate)
|
|
@@ -615,15 +618,28 @@ type GrantCondition = object
|
|
|
615
618
|
|
|
616
619
|
### `EqualsCurrentUserCondition`
|
|
617
620
|
|
|
618
|
-
Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked.
|
|
621
|
+
Check if any relation_user attribute on the entity contains the current user. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes when the current user appears in ANY of the listed attribut
|
|
619
622
|
|
|
620
623
|
```ts
|
|
621
624
|
type EqualsCurrentUserCondition = {
|
|
622
625
|
attribute?: string
|
|
626
|
+
attributes?: string[]
|
|
623
627
|
operation: "equals_current_user"
|
|
624
628
|
}
|
|
625
629
|
```
|
|
626
630
|
|
|
631
|
+
### `NotEqualsCurrentUserCondition`
|
|
632
|
+
|
|
633
|
+
Check if the current user is absent from the relation_user attributes on the entity. When attribute is provided, only that specific attribute path is checked. When attributes is provided, it takes precedence over attribute and the condition passes only when the current user appears in NONE of the li
|
|
634
|
+
|
|
635
|
+
```ts
|
|
636
|
+
type NotEqualsCurrentUserCondition = {
|
|
637
|
+
attribute?: string
|
|
638
|
+
attributes?: string[]
|
|
639
|
+
operation: "not_equals_current_user"
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
627
643
|
### `EqualsCondition`
|
|
628
644
|
|
|
629
645
|
Check if attribute equals to any of the values
|
|
@@ -636,6 +652,18 @@ type EqualsCondition = {
|
|
|
636
652
|
}
|
|
637
653
|
```
|
|
638
654
|
|
|
655
|
+
### `NotEqualsCondition`
|
|
656
|
+
|
|
657
|
+
Passes when the attribute does not equal any of the values. Records where the attribute is missing or empty pass the condition.
|
|
658
|
+
|
|
659
|
+
```ts
|
|
660
|
+
type NotEqualsCondition = {
|
|
661
|
+
attribute: string
|
|
662
|
+
operation: "not_equals"
|
|
663
|
+
values: unknown[]
|
|
664
|
+
}
|
|
665
|
+
```
|
|
666
|
+
|
|
639
667
|
### `RoleId`
|
|
640
668
|
|
|
641
669
|
Format: `<organization_id>`:`<slug>`
|