@epilot/sdk 2.18.28 → 2.18.30
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/automation.json +33 -0
- 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.d.cts +2 -2
- package/dist/apis/automation.d.ts +2 -2
- 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/automation-3HMHBP6P.cjs +7 -0
- package/dist/automation-GIJB3MOI.js +7 -0
- package/dist/{automation.d-DiWfPkLs.d.cts → automation.d-BnQFR6k8.d.cts} +49 -3
- package/dist/{automation.d-DiWfPkLs.d.ts → automation.d-BnQFR6k8.d.ts} +49 -3
- package/dist/{chunk-QNCPYVVS.cjs → chunk-SH4WTF3U.cjs} +2 -2
- package/dist/{chunk-R35ZKFN5.js → chunk-VFIPZC47.js} +2 -2
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- 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/automation.md +47 -2
- package/docs/permissions.md +29 -1
- package/package.json +1 -1
- package/dist/automation-UP6J7QIK.js +0 -7
- package/dist/automation-ZF5ACFVW.cjs +0 -7
- package/dist/permissions-X3SJVSPC.js +0 -7
- package/dist/permissions-ZJHUIBWY.cjs +0 -7
package/dist/index.d.cts
CHANGED
|
@@ -9,7 +9,7 @@ import { C as Client$2 } from './address-suggestions.d-_YwTOR-9.cjs';
|
|
|
9
9
|
import { C as Client$3 } from './ai-agents.d-B3TkP4mo.cjs';
|
|
10
10
|
import { C as Client$4 } from './app.d-CZDjyxee.cjs';
|
|
11
11
|
import { C as Client$5 } from './audit-logs.d-BRToFqeX.cjs';
|
|
12
|
-
import { C as Client$6 } from './automation.d-
|
|
12
|
+
import { C as Client$6 } from './automation.d-BnQFR6k8.cjs';
|
|
13
13
|
import { C as Client$7 } from './billing.d-Blv16_el.cjs';
|
|
14
14
|
import { C as Client$8 } from './blueprint-manifest.d-BVxmCeu7.cjs';
|
|
15
15
|
import { C as Client$9 } from './calendar.d-mk-ltGpk.cjs';
|
|
@@ -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
|
@@ -9,7 +9,7 @@ import { C as Client$2 } from './address-suggestions.d-_YwTOR-9.js';
|
|
|
9
9
|
import { C as Client$3 } from './ai-agents.d-B3TkP4mo.js';
|
|
10
10
|
import { C as Client$4 } from './app.d-CZDjyxee.js';
|
|
11
11
|
import { C as Client$5 } from './audit-logs.d-BRToFqeX.js';
|
|
12
|
-
import { C as Client$6 } from './automation.d-
|
|
12
|
+
import { C as Client$6 } from './automation.d-BnQFR6k8.js';
|
|
13
13
|
import { C as Client$7 } from './billing.d-Blv16_el.js';
|
|
14
14
|
import { C as Client$8 } from './blueprint-manifest.d-BVxmCeu7.js';
|
|
15
15
|
import { C as Client$9 } from './calendar.d-mk-ltGpk.js';
|
|
@@ -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/automation.md
CHANGED
|
@@ -133,6 +133,7 @@ const { data } = await automationClient.searchFlows(...)
|
|
|
133
133
|
- [`AutomationExecution`](#automationexecution)
|
|
134
134
|
- [`AutomationLoopState`](#automationloopstate)
|
|
135
135
|
- [`WorkflowExecutionContext`](#workflowexecutioncontext)
|
|
136
|
+
- [`WorkflowWaitContext`](#workflowwaitcontext)
|
|
136
137
|
- [`ExecutionChain`](#executionchain)
|
|
137
138
|
- [`TriggerEventManual`](#triggereventmanual)
|
|
138
139
|
- [`TriggerEventFlowAutomationTask`](#triggereventflowautomationtask)
|
|
@@ -322,6 +323,7 @@ const { data } = await client.getExecutions({
|
|
|
322
323
|
"version": 2,
|
|
323
324
|
"trigger_event": {},
|
|
324
325
|
"workflow_context": {},
|
|
326
|
+
"workflow_wait_context": {},
|
|
325
327
|
"loops": [],
|
|
326
328
|
"loop_state": {},
|
|
327
329
|
"chain": ["string"]
|
|
@@ -486,6 +488,11 @@ const { data } = await client.startExecution(
|
|
|
486
488
|
{}
|
|
487
489
|
]
|
|
488
490
|
},
|
|
491
|
+
"workflow_wait_context": {
|
|
492
|
+
"workflow_execution_id": "string",
|
|
493
|
+
"workflow_task_id": "string",
|
|
494
|
+
"source": "journey_submission"
|
|
495
|
+
},
|
|
489
496
|
"loops": [
|
|
490
497
|
{
|
|
491
498
|
"id": "loop_contracts",
|
|
@@ -551,6 +558,7 @@ const { data } = await client.searchExecutions(
|
|
|
551
558
|
"version": 2,
|
|
552
559
|
"trigger_event": {},
|
|
553
560
|
"workflow_context": {},
|
|
561
|
+
"workflow_wait_context": {},
|
|
554
562
|
"loops": [],
|
|
555
563
|
"loop_state": {},
|
|
556
564
|
"chain": ["string"]
|
|
@@ -852,6 +860,11 @@ const { data } = await client.getExecution({
|
|
|
852
860
|
{}
|
|
853
861
|
]
|
|
854
862
|
},
|
|
863
|
+
"workflow_wait_context": {
|
|
864
|
+
"workflow_execution_id": "string",
|
|
865
|
+
"workflow_task_id": "string",
|
|
866
|
+
"source": "journey_submission"
|
|
867
|
+
},
|
|
855
868
|
"loops": [
|
|
856
869
|
{
|
|
857
870
|
"id": "loop_contracts",
|
|
@@ -997,6 +1010,11 @@ const { data } = await client.cancelExecution({
|
|
|
997
1010
|
{}
|
|
998
1011
|
]
|
|
999
1012
|
},
|
|
1013
|
+
"workflow_wait_context": {
|
|
1014
|
+
"workflow_execution_id": "string",
|
|
1015
|
+
"workflow_task_id": "string",
|
|
1016
|
+
"source": "journey_submission"
|
|
1017
|
+
},
|
|
1000
1018
|
"loops": [
|
|
1001
1019
|
{
|
|
1002
1020
|
"id": "loop_contracts",
|
|
@@ -1104,6 +1122,11 @@ const { data } = await client.resumeExecutionWithToken(
|
|
|
1104
1122
|
"_automation_chain": ["string"],
|
|
1105
1123
|
"entity_contexts": []
|
|
1106
1124
|
},
|
|
1125
|
+
"workflow_wait_context": {
|
|
1126
|
+
"workflow_execution_id": "string",
|
|
1127
|
+
"workflow_task_id": "string",
|
|
1128
|
+
"source": "journey_submission"
|
|
1129
|
+
},
|
|
1107
1130
|
"loops": [
|
|
1108
1131
|
{}
|
|
1109
1132
|
],
|
|
@@ -1605,8 +1628,8 @@ type AnyAction = {
|
|
|
1605
1628
|
notify_portal_user_only?: boolean
|
|
1606
1629
|
skip_creating_entities?: boolean
|
|
1607
1630
|
wait_for_confirmation?: boolean
|
|
1608
|
-
|
|
1609
|
-
|
|
1631
|
+
wait_for_journey_submission?: boolean
|
|
1632
|
+
journey_id?: string
|
|
1610
1633
|
// ...
|
|
1611
1634
|
}
|
|
1612
1635
|
```
|
|
@@ -2523,6 +2546,8 @@ type SendEmailActionConfig = {
|
|
|
2523
2546
|
notify_portal_user_only?: boolean
|
|
2524
2547
|
skip_creating_entities?: boolean
|
|
2525
2548
|
wait_for_confirmation?: boolean
|
|
2549
|
+
wait_for_journey_submission?: boolean
|
|
2550
|
+
journey_id?: string
|
|
2526
2551
|
reply_to_sender?: boolean
|
|
2527
2552
|
reply_mode?: "reply_in_thread" | "new_email"
|
|
2528
2553
|
mark_as_done?: boolean
|
|
@@ -2558,6 +2583,8 @@ type SendEmailAction = {
|
|
|
2558
2583
|
notify_portal_user_only?: boolean
|
|
2559
2584
|
skip_creating_entities?: boolean
|
|
2560
2585
|
wait_for_confirmation?: boolean
|
|
2586
|
+
wait_for_journey_submission?: boolean
|
|
2587
|
+
journey_id?: string
|
|
2561
2588
|
reply_to_sender?: boolean
|
|
2562
2589
|
reply_mode?: "reply_in_thread" | "new_email"
|
|
2563
2590
|
mark_as_done?: boolean
|
|
@@ -2700,6 +2727,8 @@ type SendEmailConfig = {
|
|
|
2700
2727
|
notify_portal_user_only?: boolean
|
|
2701
2728
|
skip_creating_entities?: boolean
|
|
2702
2729
|
wait_for_confirmation?: boolean
|
|
2730
|
+
wait_for_journey_submission?: boolean
|
|
2731
|
+
journey_id?: string
|
|
2703
2732
|
reply_to_sender?: boolean
|
|
2704
2733
|
reply_mode?: "reply_in_thread" | "new_email"
|
|
2705
2734
|
mark_as_done?: boolean
|
|
@@ -3370,6 +3399,9 @@ type AutomationLoopState = {
|
|
|
3370
3399
|
|
|
3371
3400
|
### `WorkflowExecutionContext`
|
|
3372
3401
|
|
|
3402
|
+
Automation Executions triggered by workflow task automations will always carry information about the triggering workflow. This information is helpful in correlating workflow executions with all the triggered automation executions
|
|
3403
|
+
|
|
3404
|
+
|
|
3373
3405
|
```ts
|
|
3374
3406
|
type WorkflowExecutionContext = {
|
|
3375
3407
|
workflow_exec_id: string
|
|
@@ -3389,6 +3421,19 @@ type WorkflowExecutionContext = {
|
|
|
3389
3421
|
}
|
|
3390
3422
|
```
|
|
3391
3423
|
|
|
3424
|
+
### `WorkflowWaitContext`
|
|
3425
|
+
|
|
3426
|
+
Workflow automation tasks can be paused & waiting for journey automation executions to succeed. If such is the case, this context tracks the task_id of the workflow waiting for journey submission success This context is consumed by svc-workflows to resume a task waiting on this journey submission.
|
|
3427
|
+
|
|
3428
|
+
|
|
3429
|
+
```ts
|
|
3430
|
+
type WorkflowWaitContext = {
|
|
3431
|
+
workflow_execution_id: string
|
|
3432
|
+
workflow_task_id: string
|
|
3433
|
+
source?: string
|
|
3434
|
+
}
|
|
3435
|
+
```
|
|
3436
|
+
|
|
3392
3437
|
### `ExecutionChain`
|
|
3393
3438
|
|
|
3394
3439
|
[Internal] Tracks execution chain for infinite loop prevention. This is an internal property and should not be used by external consumers.
|
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>`
|