@hahnpro/hpc-api 2026.9.13 → 2026.10.2
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/package.json +1 -1
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/lib/constants/index.d.ts +3 -0
- package/src/lib/constants/index.js +16 -0
- package/src/lib/constants/permissions.constants.d.ts +1 -0
- package/src/lib/constants/permissions.constants.js +4 -0
- package/src/lib/interfaces/authz/feature.interface.d.ts +0 -4
- package/src/lib/interfaces/authz/index.d.ts +5 -3
- package/src/lib/interfaces/authz/localized-permission.interface.d.ts +5 -0
- package/src/lib/interfaces/authz/localized-permission.interface.js +2 -0
- package/src/lib/interfaces/authz/org-subscription.interface.d.ts +4 -0
- package/src/lib/interfaces/authz/plan.interface.d.ts +0 -4
- package/src/lib/interfaces/authz/sql-sort.interface.d.ts +4 -0
- package/src/lib/interfaces/authz/sql-sort.interface.js +2 -0
- package/src/lib/interfaces/knowledge.interface.d.ts +10 -0
- package/src/lib/mock/authz/authorization.mock.service.d.ts +2 -2
- package/src/lib/mock/authz/plans.mock.service.d.ts +1 -1
- package/src/lib/mock/authz/plans.mock.service.js +1 -1
- package/src/lib/mock/knowledge.mock.service.d.ts +2 -1
- package/src/lib/mock/knowledge.mock.service.js +15 -0
- package/src/lib/services/authz/authorization.service.d.ts +2 -2
- package/src/lib/services/authz/org-subscription.service.d.ts +2 -2
- package/src/lib/services/authz/org-subscription.service.js +2 -2
- package/src/lib/services/authz/plans.service.d.ts +2 -2
- package/src/lib/services/authz/plans.service.js +5 -2
- package/src/lib/services/knowledge.service.d.ts +2 -1
- package/src/lib/services/knowledge.service.js +3 -0
- package/src/lib/services/organizations.service.d.ts +2 -1
- package/src/lib/services/organizations.service.js +3 -2
- /package/src/lib/{constants.d.ts → constants/active-org-id-header.constants.d.ts} +0 -0
- /package/src/lib/{constants.js → constants/active-org-id-header.constants.js} +0 -0
- /package/src/lib/{crm.constants.d.ts → constants/crm.constants.d.ts} +0 -0
- /package/src/lib/{crm.constants.js → constants/crm.constants.js} +0 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./lib/api"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./lib/constants"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./lib/crm.constants"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./lib/interfaces"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./lib/mock"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./lib/services"), exports);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ACTIVE_ORG_ID_HEADER } from './active-org-id-header.constants';
|
|
2
|
+
export { type CrmDealReminderRule, type CrmDealReminderStage, CRM_DEAL_REMINDER_RULES, CRM_DEAL_REMINDER_SCHEMA_MARKER, buildCrmMeetingSourceId, buildCrmMeetingParticipantSourceId, CRM_ASSET_TYPE_IDS, CRM_ASSET_TYPE_NAMES, CRM_ASSET_TYPES, PUBLIC_EMAIL_PROVIDERS, } from './crm.constants';
|
|
3
|
+
export { PUBLIC_PERMISSION } from './permissions.constants';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PUBLIC_PERMISSION = exports.PUBLIC_EMAIL_PROVIDERS = exports.CRM_ASSET_TYPES = exports.CRM_ASSET_TYPE_NAMES = exports.CRM_ASSET_TYPE_IDS = exports.buildCrmMeetingParticipantSourceId = exports.buildCrmMeetingSourceId = exports.CRM_DEAL_REMINDER_SCHEMA_MARKER = exports.CRM_DEAL_REMINDER_RULES = exports.ACTIVE_ORG_ID_HEADER = void 0;
|
|
4
|
+
var active_org_id_header_constants_1 = require("./active-org-id-header.constants");
|
|
5
|
+
Object.defineProperty(exports, "ACTIVE_ORG_ID_HEADER", { enumerable: true, get: function () { return active_org_id_header_constants_1.ACTIVE_ORG_ID_HEADER; } });
|
|
6
|
+
var crm_constants_1 = require("./crm.constants");
|
|
7
|
+
Object.defineProperty(exports, "CRM_DEAL_REMINDER_RULES", { enumerable: true, get: function () { return crm_constants_1.CRM_DEAL_REMINDER_RULES; } });
|
|
8
|
+
Object.defineProperty(exports, "CRM_DEAL_REMINDER_SCHEMA_MARKER", { enumerable: true, get: function () { return crm_constants_1.CRM_DEAL_REMINDER_SCHEMA_MARKER; } });
|
|
9
|
+
Object.defineProperty(exports, "buildCrmMeetingSourceId", { enumerable: true, get: function () { return crm_constants_1.buildCrmMeetingSourceId; } });
|
|
10
|
+
Object.defineProperty(exports, "buildCrmMeetingParticipantSourceId", { enumerable: true, get: function () { return crm_constants_1.buildCrmMeetingParticipantSourceId; } });
|
|
11
|
+
Object.defineProperty(exports, "CRM_ASSET_TYPE_IDS", { enumerable: true, get: function () { return crm_constants_1.CRM_ASSET_TYPE_IDS; } });
|
|
12
|
+
Object.defineProperty(exports, "CRM_ASSET_TYPE_NAMES", { enumerable: true, get: function () { return crm_constants_1.CRM_ASSET_TYPE_NAMES; } });
|
|
13
|
+
Object.defineProperty(exports, "CRM_ASSET_TYPES", { enumerable: true, get: function () { return crm_constants_1.CRM_ASSET_TYPES; } });
|
|
14
|
+
Object.defineProperty(exports, "PUBLIC_EMAIL_PROVIDERS", { enumerable: true, get: function () { return crm_constants_1.PUBLIC_EMAIL_PROVIDERS; } });
|
|
15
|
+
var permissions_constants_1 = require("./permissions.constants");
|
|
16
|
+
Object.defineProperty(exports, "PUBLIC_PERMISSION", { enumerable: true, get: function () { return permissions_constants_1.PUBLIC_PERMISSION; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PUBLIC_PERMISSION = "public";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Audited } from './audited.interface';
|
|
2
|
-
import type { CapabilityBundle } from './capability-bundle.interface';
|
|
3
2
|
import type { LocalizedText, LocalizedTextPatch } from './localized-text.interface';
|
|
4
3
|
export declare enum FeatureId {
|
|
5
4
|
ALERTS = "alerts",
|
|
@@ -40,6 +39,3 @@ export interface Feature extends Audited<string>, Omit<CreateFeature, 'id' | 'de
|
|
|
40
39
|
readonly id: FeatureId;
|
|
41
40
|
description: LocalizedText | null;
|
|
42
41
|
}
|
|
43
|
-
export interface FeatureWithCapabilityBundles extends Feature {
|
|
44
|
-
capabilityBundles: CapabilityBundle[];
|
|
45
|
-
}
|
|
@@ -4,17 +4,19 @@ export type { CreateCapabilityBundle, UpdateCapabilityBundle, CapabilityBundle }
|
|
|
4
4
|
export type { CreateCapabilityBundleCapability, CapabilityBundleCapability } from './capability-bundle-capability.interface';
|
|
5
5
|
export type { CreateCapability, UpdateCapability, Capability } from './capability.interface';
|
|
6
6
|
export type { CreateOrgGroup, UpdateOrgGroup, OrgGroup } from './org-group.interface';
|
|
7
|
-
export type { CreateFeature, UpdateFeature, Feature
|
|
7
|
+
export type { CreateFeature, UpdateFeature, Feature } from './feature.interface';
|
|
8
8
|
export type { CreateFeatureCapability, FeatureCapability } from './feature-capability.interface';
|
|
9
9
|
export type { CreateOrgGroupCapability, OrgGroupCapability } from './org-group-capability.interface';
|
|
10
10
|
export type { CreateOrgGroupCapabilityBundle, OrgGroupCapabilityBundle } from './org-group-capability-bundle.interface';
|
|
11
11
|
export type { CreateOrgGroupMember, OrgGroupMember } from './org-group-member.interface';
|
|
12
|
-
export type { CreateOrgSubscription, UpdateOrgSubscription, OrgSubscription } from './org-subscription.interface';
|
|
12
|
+
export type { CreateOrgSubscription, UpdateOrgSubscription, OrgSubscription, OrgSubscriptionSqlSort } from './org-subscription.interface';
|
|
13
13
|
export type { SqlPagination, SqlPaginationResult } from './sql-pagination.interface';
|
|
14
|
-
export type { CreatePlan, UpdatePlan, Plan as AuthzPlan
|
|
14
|
+
export type { CreatePlan, UpdatePlan, Plan as AuthzPlan } from './plan.interface';
|
|
15
15
|
export type { CreatePlanFeature, PlanFeature } from './plan-feature.interface';
|
|
16
16
|
export type { CreateServiceAccountCapability, ServiceAccountCapability } from './service-account-capability.interface';
|
|
17
17
|
export type { CreateServiceAccountCapabilityBundle, ServiceAccountCapabilityBundle } from './service-account-capability-bundle.interface';
|
|
18
|
+
export type { LocalizedPermission } from './localized-permission.interface';
|
|
19
|
+
export type { SqlSort, SqlSortDirection } from './sql-sort.interface';
|
|
18
20
|
export { CapabilityId, CapabilityType, CapabilityAction, CapabilityScope } from './capability.interface';
|
|
19
21
|
export { CapabilityBundleId } from './capability-bundle.interface';
|
|
20
22
|
export { FeatureId } from './feature.interface';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Audited } from './audited.interface';
|
|
2
2
|
import type { PlanId } from './plan.interface';
|
|
3
|
+
import type { SqlSort, SqlSortDirection } from './sql-sort.interface';
|
|
4
|
+
export interface OrgSubscriptionSqlSort extends SqlSort {
|
|
5
|
+
status?: SqlSortDirection;
|
|
6
|
+
}
|
|
3
7
|
export declare enum OrgSubscriptionStatus {
|
|
4
8
|
ACTIVE = "active",
|
|
5
9
|
CANCELLED = "cancelled"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Audited } from './audited.interface';
|
|
2
|
-
import type { FeatureWithCapabilityBundles } from './feature.interface';
|
|
3
2
|
import type { LocalizedText, LocalizedTextPatch } from './localized-text.interface';
|
|
4
3
|
export declare enum PlanId {
|
|
5
4
|
DEFAULT = "default",
|
|
@@ -23,6 +22,3 @@ export interface Plan extends Audited<string>, Omit<CreatePlan, 'id' | 'descript
|
|
|
23
22
|
readonly id: PlanId;
|
|
24
23
|
description: LocalizedText | null;
|
|
25
24
|
}
|
|
26
|
-
export interface PlanWithFeaturesAndCapabilityBundles extends Plan {
|
|
27
|
-
features: FeatureWithCapabilityBundles[];
|
|
28
|
-
}
|
|
@@ -140,3 +140,13 @@ export interface KnowledgeRevision {
|
|
|
140
140
|
state: KnowledgePage['state'];
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
+
export interface KnowledgeRevisionSummary {
|
|
144
|
+
revision: number;
|
|
145
|
+
title: string;
|
|
146
|
+
updatedBy: Author;
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
}
|
|
149
|
+
export interface KnowledgeRevisionList {
|
|
150
|
+
docs: KnowledgeRevisionSummary[];
|
|
151
|
+
nextCursor?: string;
|
|
152
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Capability, CapabilityBundle, CapabilityId,
|
|
1
|
+
import type { Capability, CapabilityBundle, CapabilityId, LocalizedPermission, SqlPagination, TokenOption } from '../../interfaces';
|
|
2
2
|
import { APIBaseMock } from '../../mock/api-base.mock';
|
|
3
3
|
import { AuthorizationService } from '../../services/authz/authorization.service';
|
|
4
4
|
export declare class AuthorizationMockService extends APIBaseMock<never> implements AuthorizationService {
|
|
@@ -6,5 +6,5 @@ export declare class AuthorizationMockService extends APIBaseMock<never> impleme
|
|
|
6
6
|
getOrgCapabilitiesForActiveSubscription(sqlPagination?: SqlPagination, options?: TokenOption): Promise<Capability[]>;
|
|
7
7
|
getOrgCapabilityBundlesForActiveSubscription(sqlPagination?: SqlPagination, options?: TokenOption): Promise<CapabilityBundle[]>;
|
|
8
8
|
getCapabilitiesForUsersActiveOrg(options?: TokenOption): Promise<CapabilityId[]>;
|
|
9
|
-
getPermissionsForUsersActiveOrg(options?: TokenOption): Promise<
|
|
9
|
+
getPermissionsForUsersActiveOrg(options?: TokenOption): Promise<LocalizedPermission[]>;
|
|
10
10
|
}
|
|
@@ -4,5 +4,5 @@ export declare class PlansMockService extends APIBaseMock<never> implements Plan
|
|
|
4
4
|
constructor();
|
|
5
5
|
getPlans(..._args: Parameters<PlansService['getPlans']>): ReturnType<PlansService['getPlans']>;
|
|
6
6
|
getPlanById(..._args: Parameters<PlansService['getPlanById']>): ReturnType<PlansService['getPlanById']>;
|
|
7
|
-
|
|
7
|
+
getPlanFeaturesByPlanId(..._args: Parameters<PlansService['getPlanFeaturesByPlanId']>): ReturnType<PlansService['getPlanFeaturesByPlanId']>;
|
|
8
8
|
}
|
|
@@ -12,7 +12,7 @@ class PlansMockService extends api_base_mock_1.APIBaseMock {
|
|
|
12
12
|
getPlanById(..._args) {
|
|
13
13
|
throw new Error('Method not implemented.');
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
getPlanFeaturesByPlanId(..._args) {
|
|
16
16
|
throw new Error('Method not implemented.');
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ConfirmKnowledge, type CreateKnowledge, type KnowledgeBacklinkQuery, type KnowledgeBatch, type KnowledgeHome, type KnowledgeList, type KnowledgePage, type KnowledgeQuery, type KnowledgeRevision, type KnowledgeVersion, type UpdateKnowledge } from '../interfaces';
|
|
1
|
+
import { type ConfirmKnowledge, type CreateKnowledge, type KnowledgeBacklinkQuery, type KnowledgeBatch, type KnowledgeHome, type KnowledgeList, type KnowledgePage, type KnowledgeQuery, type KnowledgeRevision, type KnowledgeRevisionList, type KnowledgeVersion, type UpdateKnowledge } from '../interfaces';
|
|
2
2
|
import { KnowledgeService } from '../services/knowledge.service';
|
|
3
3
|
export declare class KnowledgeMockService extends KnowledgeService {
|
|
4
4
|
data: KnowledgePage[];
|
|
@@ -15,6 +15,7 @@ export declare class KnowledgeMockService extends KnowledgeService {
|
|
|
15
15
|
getHome(query?: KnowledgeQuery): Promise<KnowledgeHome>;
|
|
16
16
|
getBacklinks(query: KnowledgeBacklinkQuery): Promise<KnowledgeList>;
|
|
17
17
|
getRelated(id: string, query?: Pick<KnowledgeQuery, 'cursor' | 'limit'>): Promise<KnowledgeList>;
|
|
18
|
+
getRevisions(id: string, query?: Pick<KnowledgeQuery, 'cursor' | 'limit'>): Promise<KnowledgeRevisionList>;
|
|
18
19
|
getRevision(id: string, revision: number): Promise<KnowledgeRevision>;
|
|
19
20
|
readBatch(ids: string[]): Promise<KnowledgeBatch>;
|
|
20
21
|
private check;
|
|
@@ -90,6 +90,20 @@ class KnowledgeMockService extends knowledge_service_1.KnowledgeService {
|
|
|
90
90
|
(outgoing.includes(item.id) ||
|
|
91
91
|
item.links.some((link) => link.target.resourceType === interfaces_1.ResourceType.KNOWLEDGE && link.target.id === id))), query);
|
|
92
92
|
}
|
|
93
|
+
async getRevisions(id, query = {}) {
|
|
94
|
+
const current = this.page(id);
|
|
95
|
+
const before = query.cursor ? Number(query.cursor) : current.revision + 1;
|
|
96
|
+
const limit = query.limit || 20;
|
|
97
|
+
const docs = [];
|
|
98
|
+
for (let revision = before - 1; revision >= 1 && docs.length < limit; revision--) {
|
|
99
|
+
const page = this.revisions.get(`${id}:${revision}`);
|
|
100
|
+
if (page) {
|
|
101
|
+
docs.push({ revision, title: page.title, updatedBy: structuredClone(page.updatedBy), updatedAt: page.updatedAt });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const last = docs[docs.length - 1]?.revision ?? 1;
|
|
105
|
+
return { docs, ...(last > 1 ? { nextCursor: String(last) } : {}) };
|
|
106
|
+
}
|
|
93
107
|
async getRevision(id, revision) {
|
|
94
108
|
const current = this.page(id);
|
|
95
109
|
const page = this.revisions.get(`${id}:${revision}`);
|
|
@@ -131,6 +145,7 @@ class KnowledgeMockService extends knowledge_service_1.KnowledgeService {
|
|
|
131
145
|
if (staleAfter !== undefined) {
|
|
132
146
|
page.staleAfter = staleAfter || undefined;
|
|
133
147
|
}
|
|
148
|
+
page.updatedAt = new Date().toISOString();
|
|
134
149
|
if (this.content(page) !== before) {
|
|
135
150
|
page.revision++;
|
|
136
151
|
this.remember(page);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { APIBase } from '../../api-base';
|
|
2
|
-
import type { Capability, CapabilityBundle, CapabilityId,
|
|
2
|
+
import type { Capability, CapabilityBundle, CapabilityId, LocalizedPermission, SqlPagination, TokenOption } from '../../interfaces';
|
|
3
3
|
import { HttpClientService } from '../http-client.service';
|
|
4
4
|
export declare class AuthorizationService extends APIBase {
|
|
5
5
|
constructor(httpClient: HttpClientService);
|
|
6
6
|
getOrgCapabilitiesForActiveSubscription(sqlPagination?: SqlPagination, options?: TokenOption): Promise<Capability[]>;
|
|
7
7
|
getOrgCapabilityBundlesForActiveSubscription(sqlPagination?: SqlPagination, options?: TokenOption): Promise<CapabilityBundle[]>;
|
|
8
8
|
getCapabilitiesForUsersActiveOrg(options?: TokenOption): Promise<CapabilityId[]>;
|
|
9
|
-
getPermissionsForUsersActiveOrg(options?: TokenOption): Promise<
|
|
9
|
+
getPermissionsForUsersActiveOrg(options?: TokenOption): Promise<LocalizedPermission[]>;
|
|
10
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { APIBase } from '../../api-base';
|
|
2
|
-
import type { OrgSubscription, SqlPagination, SqlPaginationResult, TokenOption } from '../../interfaces';
|
|
2
|
+
import type { OrgSubscription, OrgSubscriptionSqlSort, SqlPagination, SqlPaginationResult, TokenOption } from '../../interfaces';
|
|
3
3
|
import { HttpClientService } from '../http-client.service';
|
|
4
4
|
export declare class OrgSubscriptionService extends APIBase {
|
|
5
5
|
constructor(httpClient: HttpClientService);
|
|
6
|
-
getOrgSubscriptionsByOrgId(sqlPagination?: SqlPagination, options?: TokenOption): Promise<SqlPaginationResult<OrgSubscription>>;
|
|
6
|
+
getOrgSubscriptionsByOrgId(sqlPagination?: SqlPagination, sort?: OrgSubscriptionSqlSort, options?: TokenOption): Promise<SqlPaginationResult<OrgSubscription>>;
|
|
7
7
|
getOrgSubscriptionById(orgSubscriptionId: string, options?: TokenOption): Promise<OrgSubscription>;
|
|
8
8
|
}
|
|
@@ -6,8 +6,8 @@ class OrgSubscriptionService extends api_base_1.APIBase {
|
|
|
6
6
|
constructor(httpClient) {
|
|
7
7
|
super(httpClient, '/authz/org-subscriptions');
|
|
8
8
|
}
|
|
9
|
-
getOrgSubscriptionsByOrgId(sqlPagination = {}, options = {}) {
|
|
10
|
-
return this.httpClient.get(this.basePath, { ...options, params: sqlPagination });
|
|
9
|
+
getOrgSubscriptionsByOrgId(sqlPagination = {}, sort = {}, options = {}) {
|
|
10
|
+
return this.httpClient.get(this.basePath, { ...options, params: { ...sqlPagination, ...sort } });
|
|
11
11
|
}
|
|
12
12
|
getOrgSubscriptionById(orgSubscriptionId, options = {}) {
|
|
13
13
|
return this.httpClient.get(`${this.basePath}/${orgSubscriptionId}`, options);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { APIBase } from '../../api-base';
|
|
2
|
-
import type { AuthzPlan as Plan, PlanId,
|
|
2
|
+
import type { Feature, AuthzPlan as Plan, PlanId, SqlPagination, SqlPaginationResult, TokenOption } from '../../interfaces';
|
|
3
3
|
import { HttpClientService } from '../http-client.service';
|
|
4
4
|
export declare class PlansService extends APIBase {
|
|
5
5
|
constructor(httpClient: HttpClientService);
|
|
6
6
|
getPlans(sqlPagination?: SqlPagination, options?: TokenOption): Promise<SqlPaginationResult<Plan>>;
|
|
7
7
|
getPlanById(planId: PlanId, options?: TokenOption): Promise<Plan>;
|
|
8
|
-
|
|
8
|
+
getPlanFeaturesByPlanId(planId: PlanId, sqlPagination?: SqlPagination, options?: TokenOption): Promise<SqlPaginationResult<Feature>>;
|
|
9
9
|
}
|
|
@@ -12,8 +12,11 @@ class PlansService extends api_base_1.APIBase {
|
|
|
12
12
|
getPlanById(planId, options = {}) {
|
|
13
13
|
return this.httpClient.get(`${this.basePath}/${planId}`, options);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
return this.httpClient.get(`${this.basePath}/${planId}/
|
|
15
|
+
getPlanFeaturesByPlanId(planId, sqlPagination = {}, options = {}) {
|
|
16
|
+
return this.httpClient.get(`${this.basePath}/${planId}/features`, {
|
|
17
|
+
...options,
|
|
18
|
+
params: sqlPagination,
|
|
19
|
+
});
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
exports.PlansService = PlansService;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIBase } from '../api-base';
|
|
2
|
-
import type { Config, ConfirmKnowledge, CreateKnowledge, KnowledgeBacklinkQuery, KnowledgeBatch, KnowledgeHome, KnowledgeList, KnowledgePage, KnowledgeQuery, KnowledgeRevision, KnowledgeVersion, UpdateKnowledge } from '../interfaces';
|
|
2
|
+
import type { Config, ConfirmKnowledge, CreateKnowledge, KnowledgeBacklinkQuery, KnowledgeBatch, KnowledgeHome, KnowledgeList, KnowledgePage, KnowledgeQuery, KnowledgeRevision, KnowledgeRevisionList, KnowledgeVersion, UpdateKnowledge } from '../interfaces';
|
|
3
3
|
import { HttpClientService } from './http-client.service';
|
|
4
4
|
export declare class KnowledgeService extends APIBase {
|
|
5
5
|
constructor(httpClient: HttpClientService);
|
|
@@ -9,6 +9,7 @@ export declare class KnowledgeService extends APIBase {
|
|
|
9
9
|
getHome(query?: KnowledgeQuery, options?: Config): Promise<KnowledgeHome>;
|
|
10
10
|
getBacklinks(query: KnowledgeBacklinkQuery, options?: Config): Promise<KnowledgeList>;
|
|
11
11
|
getRelated(id: string, query?: Pick<KnowledgeQuery, 'cursor' | 'limit'>, options?: Config): Promise<KnowledgeList>;
|
|
12
|
+
getRevisions(id: string, query?: Pick<KnowledgeQuery, 'cursor' | 'limit'>, options?: Config): Promise<KnowledgeRevisionList>;
|
|
12
13
|
getRevision(id: string, revision: number, options?: Config): Promise<KnowledgeRevision>;
|
|
13
14
|
readBatch(ids: string[], options?: Config): Promise<KnowledgeBatch>;
|
|
14
15
|
updateOne(id: string, dto: UpdateKnowledge, options?: Config): Promise<KnowledgePage>;
|
|
@@ -24,6 +24,9 @@ class KnowledgeService extends api_base_1.APIBase {
|
|
|
24
24
|
getRelated(id, query = {}, options = {}) {
|
|
25
25
|
return this.httpClient.get(`${this.basePath}/${encodeURIComponent(id)}/related`, { ...options, params: query });
|
|
26
26
|
}
|
|
27
|
+
getRevisions(id, query = {}, options = {}) {
|
|
28
|
+
return this.httpClient.get(`${this.basePath}/${encodeURIComponent(id)}/revisions`, { ...options, params: query });
|
|
29
|
+
}
|
|
27
30
|
getRevision(id, revision, options = {}) {
|
|
28
31
|
return this.httpClient.get(`${this.basePath}/${encodeURIComponent(id)}/revisions/${revision}`, options);
|
|
29
32
|
}
|
|
@@ -95,9 +95,10 @@ export declare class OrganizationsService extends APIBase {
|
|
|
95
95
|
*
|
|
96
96
|
* @param {string} id - organization id
|
|
97
97
|
* @param {string} kinds - array of requested data types ( selection of: ['members', 'invitations', 'roles', 'domains', 'userRoles'])
|
|
98
|
+
* @param {TokenOption} options - Optional token option
|
|
98
99
|
* @returns{Promise<OrganizationData>} organizationData (only selected kinds are returned)
|
|
99
100
|
*/
|
|
100
|
-
getOrganizationData(id: string, kinds?: OrganizationDataKind[]): Promise<OrganizationData>;
|
|
101
|
+
getOrganizationData(id: string, kinds?: OrganizationDataKind[], options?: TokenOption): Promise<OrganizationData>;
|
|
101
102
|
/**
|
|
102
103
|
* Returns the member with the provided id
|
|
103
104
|
*
|
|
@@ -131,11 +131,12 @@ class OrganizationsService extends api_base_1.APIBase {
|
|
|
131
131
|
*
|
|
132
132
|
* @param {string} id - organization id
|
|
133
133
|
* @param {string} kinds - array of requested data types ( selection of: ['members', 'invitations', 'roles', 'domains', 'userRoles'])
|
|
134
|
+
* @param {TokenOption} options - Optional token option
|
|
134
135
|
* @returns{Promise<OrganizationData>} organizationData (only selected kinds are returned)
|
|
135
136
|
*/
|
|
136
|
-
getOrganizationData(id, kinds = []) {
|
|
137
|
+
getOrganizationData(id, kinds = [], options = {}) {
|
|
137
138
|
const params = kinds.length > 0 ? { kinds: kinds.join(',') } : {};
|
|
138
|
-
return this.httpClient.get(`${this.basePath}/${id}/data`, { params });
|
|
139
|
+
return this.httpClient.get(`${this.basePath}/${id}/data`, { params, ...options });
|
|
139
140
|
}
|
|
140
141
|
/**
|
|
141
142
|
* Returns the member with the provided id
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|