@approvio/ts-sdk 0.0.26 → 0.0.28

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/dist/index.cjs CHANGED
@@ -57,7 +57,7 @@ function validateURL(url) {
57
57
  function removeTrailingSlash(url) {
58
58
  return url.endsWith("/") ? url.slice(0, -1) : url;
59
59
  }
60
- const USER_AGENT = `Approvio-TS-SDK/0.0.26`;
60
+ const USER_AGENT = `Approvio-TS-SDK/0.0.28`;
61
61
  //#endregion
62
62
  //#region src/client/http.ts
63
63
  /**
@@ -449,6 +449,12 @@ var BaseApprovioClient = class {
449
449
  listVotes(workflowId, params) {
450
450
  return this.get(`/workflows/${workflowId}/votes`, params);
451
451
  }
452
+ /**
453
+ * Get available authentication providers.
454
+ */
455
+ getAuthProviders() {
456
+ return this.get("/auth/providers");
457
+ }
452
458
  };
453
459
  //#endregion
454
460
  //#region src/client/user.client.ts
@@ -565,6 +571,12 @@ var ApprovioUserClient = class extends BaseApprovioClient {
565
571
  resolveResources(params) {
566
572
  return this.post("/resources/resolve", params);
567
573
  }
574
+ getOrganizationEntitlements(orgId) {
575
+ return this.get(`/organizations/${orgId}/entitlements`);
576
+ }
577
+ getOrganizationUsage(orgId, params) {
578
+ return this.get(`/organizations/${orgId}/usage`, params);
579
+ }
568
580
  logout() {
569
581
  return this.post("/auth/web/logout");
570
582
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { APIError, AddGroupEntitiesRequest, AgentGet200Response, AgentRegistrationRequest, AgentRegistrationResponse, AgentTokenResponse, CanVoteResponse, GetEntityInfo200Response, GetEntityInfoAgentResponse, GetEntityInfoUserResponse, GetWorkflowParams, GetWorkflowVotes200Response, Group, GroupCreate, ListAuditLogs200Response, ListAuditLogsParams, ListGroupEntities200Response, ListGroups200Response, ListGroupsParams, ListMyAuditLogsParams, ListOrganizationAdminsForOrg200Response, ListRoleTemplates200Response, ListSpaces200Response, ListSpacesParams, ListUsers200Response, ListUsersParams, ListWorkflowTemplates200Response, ListWorkflowTemplatesParams, ListWorkflowVotesParams, ListWorkflows200Response, ListWorkflowsParams, OrganizationAdminCreate, OrganizationAdminRemove, RemoveGroupEntitiesRequest, ResourceResolveRequest, ResourceResolveResponse, RoleAssignmentRequest, RoleRemovalRequest, Space, SpaceCreate, TokenResponse, User, UserCreate, Workflow, WorkflowCreate, WorkflowTemplate, WorkflowTemplateCreate, WorkflowTemplateDeprecate, WorkflowTemplateUpdate, WorkflowVoteRequest } from "@approvio/api";
2
+ import { APIError, AddGroupEntitiesRequest, AgentGet200Response, AgentRegistrationRequest, AgentRegistrationResponse, AgentTokenResponse, AuthProvider, CanVoteResponse, GetEntityInfo200Response, GetEntityInfoAgentResponse, GetEntityInfoUserResponse, GetWorkflowParams, GetWorkflowVotes200Response, Group, GroupCreate, ListAuditLogs200Response, ListAuditLogsParams, ListGroupEntities200Response, ListGroups200Response, ListGroupsParams, ListMyAuditLogsParams, ListOrganizationAdminsForOrg200Response, ListRoleTemplates200Response, ListSpaces200Response, ListSpacesParams, ListUsers200Response, ListUsersParams, ListWorkflowTemplates200Response, ListWorkflowTemplatesParams, ListWorkflowVotesParams, ListWorkflows200Response, ListWorkflowsParams, OrganizationAdminCreate, OrganizationAdminRemove, OrganizationEntitlementsResponse, OrganizationUsageResponse, RemoveGroupEntitiesRequest, ResourceResolveRequest, ResourceResolveResponse, RoleAssignmentRequest, RoleRemovalRequest, Space, SpaceCreate, TokenResponse, User, UserCreate, Workflow, WorkflowCreate, WorkflowTemplate, WorkflowTemplateCreate, WorkflowTemplateDeprecate, WorkflowTemplateUpdate, WorkflowVoteRequest } from "@approvio/api";
3
3
  import * as TE from "fp-ts/lib/TaskEither.js";
4
4
 
5
5
  //#region src/interfaces.d.ts
@@ -61,6 +61,7 @@ declare abstract class BaseApprovioClient {
61
61
  listRoleTemplates(): TE.TaskEither<ApprovioError, ListRoleTemplates200Response>;
62
62
  getEntityInfo(): TE.TaskEither<ApprovioError, GetEntityInfo200Response>;
63
63
  listVotes(workflowId: string, params?: ListWorkflowVotesParams): TE.TaskEither<ApprovioError, GetWorkflowVotes200Response>;
64
+ getAuthProviders(): TE.TaskEither<ApprovioError, AuthProvider[]>;
64
65
  }
65
66
  //#endregion
66
67
  //#region src/auth/auth.helpers.d.ts
@@ -91,6 +92,10 @@ declare class AgentAuthenticator implements TokenBaseAuthenticator {
91
92
  }
92
93
  //#endregion
93
94
  //#region src/client/user.client.d.ts
95
+ interface GetOrganizationUsageParams {
96
+ period?: string;
97
+ metric?: string;
98
+ }
94
99
  declare class ApprovioUserClient extends BaseApprovioClient {
95
100
  readonly authenticator: CliUserAuthenticator | WebAuthenticator;
96
101
  constructor(config: ApprovioServerConfig, authenticator: CliUserAuthenticator | WebAuthenticator);
@@ -131,6 +136,8 @@ declare class ApprovioUserClient extends BaseApprovioClient {
131
136
  listAuditLogs(params?: ListAuditLogsParams): TE.TaskEither<ApprovioError, ListAuditLogs200Response>;
132
137
  listMyAuditLogs(params?: ListMyAuditLogsParams): TE.TaskEither<ApprovioError, ListAuditLogs200Response>;
133
138
  resolveResources(params: ResourceResolveRequest): TE.TaskEither<ApprovioError, ResourceResolveResponse>;
139
+ getOrganizationEntitlements(orgId: string): TE.TaskEither<ApprovioError, OrganizationEntitlementsResponse>;
140
+ getOrganizationUsage(orgId: string, params?: GetOrganizationUsageParams): TE.TaskEither<ApprovioError, OrganizationUsageResponse>;
134
141
  logout(): TE.TaskEither<ApprovioError, void>;
135
142
  }
136
143
  //#endregion
@@ -145,4 +152,4 @@ declare class ApprovioAgentClient extends BaseApprovioClient {
145
152
  //#region src/client/utils.d.ts
146
153
  declare function isApprovioError(data: unknown): data is APIError;
147
154
  //#endregion
148
- export { AgentAuthenticator, ApprovioAgentClient, ApprovioError, ApprovioServerConfig, ApprovioUserClient, AuthHelper, Authenticator, BaseApprovioClient, CliUserAuthenticator, SafeQueryParams, TokenBaseAuthenticator, WebAuthenticator, isApprovioError };
155
+ export { AgentAuthenticator, ApprovioAgentClient, ApprovioError, ApprovioServerConfig, ApprovioUserClient, AuthHelper, Authenticator, BaseApprovioClient, CliUserAuthenticator, GetOrganizationUsageParams, SafeQueryParams, TokenBaseAuthenticator, WebAuthenticator, isApprovioError };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { APIError, AddGroupEntitiesRequest, AgentGet200Response, AgentRegistrationRequest, AgentRegistrationResponse, AgentTokenResponse, CanVoteResponse, GetEntityInfo200Response, GetEntityInfoAgentResponse, GetEntityInfoUserResponse, GetWorkflowParams, GetWorkflowVotes200Response, Group, GroupCreate, ListAuditLogs200Response, ListAuditLogsParams, ListGroupEntities200Response, ListGroups200Response, ListGroupsParams, ListMyAuditLogsParams, ListOrganizationAdminsForOrg200Response, ListRoleTemplates200Response, ListSpaces200Response, ListSpacesParams, ListUsers200Response, ListUsersParams, ListWorkflowTemplates200Response, ListWorkflowTemplatesParams, ListWorkflowVotesParams, ListWorkflows200Response, ListWorkflowsParams, OrganizationAdminCreate, OrganizationAdminRemove, RemoveGroupEntitiesRequest, ResourceResolveRequest, ResourceResolveResponse, RoleAssignmentRequest, RoleRemovalRequest, Space, SpaceCreate, TokenResponse, User, UserCreate, Workflow, WorkflowCreate, WorkflowTemplate, WorkflowTemplateCreate, WorkflowTemplateDeprecate, WorkflowTemplateUpdate, WorkflowVoteRequest } from "@approvio/api";
1
+ import { APIError, AddGroupEntitiesRequest, AgentGet200Response, AgentRegistrationRequest, AgentRegistrationResponse, AgentTokenResponse, AuthProvider, CanVoteResponse, GetEntityInfo200Response, GetEntityInfoAgentResponse, GetEntityInfoUserResponse, GetWorkflowParams, GetWorkflowVotes200Response, Group, GroupCreate, ListAuditLogs200Response, ListAuditLogsParams, ListGroupEntities200Response, ListGroups200Response, ListGroupsParams, ListMyAuditLogsParams, ListOrganizationAdminsForOrg200Response, ListRoleTemplates200Response, ListSpaces200Response, ListSpacesParams, ListUsers200Response, ListUsersParams, ListWorkflowTemplates200Response, ListWorkflowTemplatesParams, ListWorkflowVotesParams, ListWorkflows200Response, ListWorkflowsParams, OrganizationAdminCreate, OrganizationAdminRemove, OrganizationEntitlementsResponse, OrganizationUsageResponse, RemoveGroupEntitiesRequest, ResourceResolveRequest, ResourceResolveResponse, RoleAssignmentRequest, RoleRemovalRequest, Space, SpaceCreate, TokenResponse, User, UserCreate, Workflow, WorkflowCreate, WorkflowTemplate, WorkflowTemplateCreate, WorkflowTemplateDeprecate, WorkflowTemplateUpdate, WorkflowVoteRequest } from "@approvio/api";
2
2
  import { AxiosInstance } from "axios";
3
3
  import * as TE from "fp-ts/lib/TaskEither.js";
4
4
 
@@ -61,6 +61,7 @@ declare abstract class BaseApprovioClient {
61
61
  listRoleTemplates(): TE.TaskEither<ApprovioError, ListRoleTemplates200Response>;
62
62
  getEntityInfo(): TE.TaskEither<ApprovioError, GetEntityInfo200Response>;
63
63
  listVotes(workflowId: string, params?: ListWorkflowVotesParams): TE.TaskEither<ApprovioError, GetWorkflowVotes200Response>;
64
+ getAuthProviders(): TE.TaskEither<ApprovioError, AuthProvider[]>;
64
65
  }
65
66
  //#endregion
66
67
  //#region src/auth/auth.helpers.d.ts
@@ -91,6 +92,10 @@ declare class AgentAuthenticator implements TokenBaseAuthenticator {
91
92
  }
92
93
  //#endregion
93
94
  //#region src/client/user.client.d.ts
95
+ interface GetOrganizationUsageParams {
96
+ period?: string;
97
+ metric?: string;
98
+ }
94
99
  declare class ApprovioUserClient extends BaseApprovioClient {
95
100
  readonly authenticator: CliUserAuthenticator | WebAuthenticator;
96
101
  constructor(config: ApprovioServerConfig, authenticator: CliUserAuthenticator | WebAuthenticator);
@@ -131,6 +136,8 @@ declare class ApprovioUserClient extends BaseApprovioClient {
131
136
  listAuditLogs(params?: ListAuditLogsParams): TE.TaskEither<ApprovioError, ListAuditLogs200Response>;
132
137
  listMyAuditLogs(params?: ListMyAuditLogsParams): TE.TaskEither<ApprovioError, ListAuditLogs200Response>;
133
138
  resolveResources(params: ResourceResolveRequest): TE.TaskEither<ApprovioError, ResourceResolveResponse>;
139
+ getOrganizationEntitlements(orgId: string): TE.TaskEither<ApprovioError, OrganizationEntitlementsResponse>;
140
+ getOrganizationUsage(orgId: string, params?: GetOrganizationUsageParams): TE.TaskEither<ApprovioError, OrganizationUsageResponse>;
134
141
  logout(): TE.TaskEither<ApprovioError, void>;
135
142
  }
136
143
  //#endregion
@@ -145,4 +152,4 @@ declare class ApprovioAgentClient extends BaseApprovioClient {
145
152
  //#region src/client/utils.d.ts
146
153
  declare function isApprovioError(data: unknown): data is APIError;
147
154
  //#endregion
148
- export { AgentAuthenticator, ApprovioAgentClient, ApprovioError, ApprovioServerConfig, ApprovioUserClient, AuthHelper, Authenticator, BaseApprovioClient, CliUserAuthenticator, SafeQueryParams, TokenBaseAuthenticator, WebAuthenticator, isApprovioError };
155
+ export { AgentAuthenticator, ApprovioAgentClient, ApprovioError, ApprovioServerConfig, ApprovioUserClient, AuthHelper, Authenticator, BaseApprovioClient, CliUserAuthenticator, GetOrganizationUsageParams, SafeQueryParams, TokenBaseAuthenticator, WebAuthenticator, isApprovioError };
package/dist/index.mjs CHANGED
@@ -31,7 +31,7 @@ function validateURL(url) {
31
31
  function removeTrailingSlash(url) {
32
32
  return url.endsWith("/") ? url.slice(0, -1) : url;
33
33
  }
34
- const USER_AGENT = `Approvio-TS-SDK/0.0.26`;
34
+ const USER_AGENT = `Approvio-TS-SDK/0.0.28`;
35
35
  //#endregion
36
36
  //#region src/client/http.ts
37
37
  /**
@@ -423,6 +423,12 @@ var BaseApprovioClient = class {
423
423
  listVotes(workflowId, params) {
424
424
  return this.get(`/workflows/${workflowId}/votes`, params);
425
425
  }
426
+ /**
427
+ * Get available authentication providers.
428
+ */
429
+ getAuthProviders() {
430
+ return this.get("/auth/providers");
431
+ }
426
432
  };
427
433
  //#endregion
428
434
  //#region src/client/user.client.ts
@@ -539,6 +545,12 @@ var ApprovioUserClient = class extends BaseApprovioClient {
539
545
  resolveResources(params) {
540
546
  return this.post("/resources/resolve", params);
541
547
  }
548
+ getOrganizationEntitlements(orgId) {
549
+ return this.get(`/organizations/${orgId}/entitlements`);
550
+ }
551
+ getOrganizationUsage(orgId, params) {
552
+ return this.get(`/organizations/${orgId}/usage`, params);
553
+ }
542
554
  logout() {
543
555
  return this.post("/auth/web/logout");
544
556
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@approvio/ts-sdk",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -34,7 +34,7 @@
34
34
  "prepublishOnly": "yarn format && yarn lint && yarn build"
35
35
  },
36
36
  "dependencies": {
37
- "@approvio/api": "0.0.56",
37
+ "@approvio/api": "0.0.58",
38
38
  "axios": "1.16.1",
39
39
  "jose": "6.2.3"
40
40
  },
@@ -51,7 +51,7 @@
51
51
  "eslint-config-prettier": "10.1.8",
52
52
  "eslint-plugin-jest": "28.14.0",
53
53
  "eslint-plugin-node": "11.1.0",
54
- "eslint-plugin-prettier": "5.5.4",
54
+ "eslint-plugin-prettier": "5.5.6",
55
55
  "fp-ts": "2.16.11",
56
56
  "io-ts": "2.2.20",
57
57
  "jest": "29.7.0",