@ptkl/sdk 1.13.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import PlatformBaseClient from "./platformBaseClient";
2
- import { UserClaims, UserModel, Role, CreateRoleRequest, EditRoleRequest, RoleModel, Permission } from "../types/users";
2
+ import { UserClaims, UserModel, Role, CreateRoleRequest, EditRoleRequest, RoleModel, Permission, Permissions } from "../types/users";
3
3
  import { AxiosResponse } from "axios";
4
4
  export default class Users extends PlatformBaseClient {
5
5
  auth(username: string, password: string, project: string): Promise<AxiosResponse<any>>;
@@ -28,9 +28,28 @@ export default class Users extends PlatformBaseClient {
28
28
  */
29
29
  editProfile(data: any): Promise<AxiosResponse<any>>;
30
30
  /**
31
- * Get user permissions
31
+ * Get the current token's permissions.
32
+ *
33
+ * Returns the resolved permission set carried by the calling token. For a
34
+ * forge actor token this is the scoped intersection minted at launch time —
35
+ * see `getPrincipalPermissions()` for the underlying user's full set.
32
36
  */
33
- getPermissions(): Promise<AxiosResponse<Permission[]>>;
37
+ getPermissions(): Promise<AxiosResponse<Permissions>>;
38
+ /**
39
+ * Get the FULL permissions of the user the current token is acting on behalf
40
+ * of (the "principal").
41
+ *
42
+ * When a forge app runs under an actor token, `getPermissions()` returns only
43
+ * the token's scoped permissions — the intersection of the app's declared
44
+ * runtime permissions and the user's permissions. This instead returns the
45
+ * complete permission set of the underlying user, so the app can check what
46
+ * that user is actually allowed to do, independent of what the app itself was
47
+ * granted. The token scope is unchanged: this exposes knowledge, not capability.
48
+ *
49
+ * For a normal user session (no actor token) it returns the caller's own
50
+ * permissions, identical to `getPermissions()`'s scope.
51
+ */
52
+ getPrincipalPermissions(): Promise<AxiosResponse<Permissions>>;
34
53
  /**
35
54
  * Get list of available permissions
36
55
  */
@@ -1,6 +1,6 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import PlatformBaseClient from "./platformBaseClient";
3
- import { WorkflowModel, WorkflowCreatePayload, WorkflowUpdatePayload, WorkflowListResponse } from '../types/workflow';
3
+ import { WorkflowModel, WorkflowCreatePayload, WorkflowUpdatePayload, WorkflowListResponse, WorkflowInstallPayload, WorkflowHistoryQuery, WorkflowHistoryListResponse, WorkflowHistoryEntry, WorkflowStatsQuery, WorkflowStats, WorkflowRunningQuery, WorkflowRunningListResponse, WorkflowRunningExecution, WorkflowControlResponse, WorkflowRestartOptions, WorkflowRestartResponse, WorkflowNodeControlOptions, WorkflowErrorListResponse } from '../types/workflow';
4
4
  export default class Workflow extends PlatformBaseClient {
5
5
  create(data: WorkflowCreatePayload): Promise<AxiosResponse<WorkflowModel>>;
6
6
  update(id: string, data: WorkflowUpdatePayload): Promise<AxiosResponse<WorkflowModel>>;
@@ -9,4 +9,28 @@ export default class Workflow extends PlatformBaseClient {
9
9
  delete(id: string): Promise<AxiosResponse<void>>;
10
10
  trigger(id: string, event: string, data: any): Promise<AxiosResponse<any, any>>;
11
11
  publish(event: string, data: any): Promise<AxiosResponse<any, any>>;
12
+ /**
13
+ * Install (create + publish) a workflow in one call.
14
+ * Rejects if a workflow with the same name + integrator already exists.
15
+ */
16
+ install(data: WorkflowInstallPayload): Promise<AxiosResponse<WorkflowModel>>;
17
+ getHistory(query?: WorkflowHistoryQuery): Promise<AxiosResponse<WorkflowHistoryListResponse>>;
18
+ getHistoryEntry(executionUuid: string): Promise<AxiosResponse<WorkflowHistoryEntry>>;
19
+ getStats(query?: WorkflowStatsQuery): Promise<AxiosResponse<WorkflowStats>>;
20
+ getRunning(query?: WorkflowRunningQuery): Promise<AxiosResponse<WorkflowRunningListResponse>>;
21
+ getRunningEntry(executionUuid: string): Promise<AxiosResponse<WorkflowRunningExecution>>;
22
+ pause(executionUuid: string): Promise<AxiosResponse<WorkflowControlResponse>>;
23
+ resume(executionUuid: string): Promise<AxiosResponse<WorkflowControlResponse>>;
24
+ kill(executionUuid: string): Promise<AxiosResponse<WorkflowControlResponse>>;
25
+ /**
26
+ * Restart a failed/killed workflow execution from history.
27
+ * `clearState: true` discards prior node state instead of a smart resume.
28
+ */
29
+ restart(executionUuid: string, options?: WorkflowRestartOptions): Promise<AxiosResponse<WorkflowRestartResponse>>;
30
+ pauseNode(executionUuid: string, nodeId: number, options?: WorkflowNodeControlOptions): Promise<AxiosResponse<WorkflowControlResponse>>;
31
+ resumeNode(executionUuid: string, nodeId: number, options?: WorkflowNodeControlOptions): Promise<AxiosResponse<WorkflowControlResponse>>;
32
+ killNode(executionUuid: string, nodeId: number, options?: WorkflowNodeControlOptions): Promise<AxiosResponse<WorkflowControlResponse>>;
33
+ getErrors(): Promise<AxiosResponse<WorkflowErrorListResponse>>;
34
+ removeError(id: string): Promise<AxiosResponse<WorkflowControlResponse>>;
35
+ removeAllErrors(): Promise<AxiosResponse<WorkflowControlResponse>>;
12
36
  }