@arrowsphere/api-client 3.373.0 → 3.374.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
4
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [3.374.0] - 2026.06.05
7
+ ### Added
8
+ - [billing] Add PricingPlan client with support for CRUD operations, business rules, scopes, and history
9
+
6
10
  ## [3.373.0] - 2026.06.03
7
11
  ### Added
8
12
  - [graphql-api] Add new field to ProductType: `isForPartnerOnly`
@@ -1,2 +1,4 @@
1
1
  export * from './entities/export/exportAsyncRequest';
2
2
  export * from './billingClient';
3
+ export * from './pricingPlanClient';
4
+ export * from './types';
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./entities/export/exportAsyncRequest"), exports);
18
18
  __exportStar(require("./billingClient"), exports);
19
+ __exportStar(require("./pricingPlanClient"), exports);
20
+ __exportStar(require("./types"), exports);
19
21
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,56 @@
1
+ import { AbstractRestfulClient } from '../abstractRestfulClient';
2
+ import { AttachScopesPayload, AttachScopesResponse, CreateBusinessRulesPayload, CreateBusinessRulesResponse, CreatePricingPlanPayload, CreatePricingPlanResponse, DetachScopesPayload, GetBusinessRulesHistoryParameters, GetBusinessRulesHistoryResponse, GetBusinessRulesParameters, GetBusinessRulesResponse, GetClientsHistoryParameters, GetClientsHistoryResponse, GetPricingPlanResponse, GetScopesParameters, GetScopesResponse, ListPricingPlansParameters, ListPricingPlansResponse, PricingPlanScopeType, UpdatePricingPlanPayload } from './types/pricingPlan';
3
+ export declare class PricingPlanClient extends AbstractRestfulClient {
4
+ /**
5
+ * The base path of the API
6
+ */
7
+ protected basePath: string;
8
+ /**
9
+ * Lists pricing plans with optional filters
10
+ */
11
+ listPricingPlans(params?: ListPricingPlansParameters): Promise<ListPricingPlansResponse>;
12
+ /**
13
+ * Gets a single pricing plan by reference
14
+ */
15
+ getPricingPlan(reference: string): Promise<GetPricingPlanResponse>;
16
+ /**
17
+ * Creates a new pricing plan
18
+ */
19
+ createPricingPlan(payload: CreatePricingPlanPayload): Promise<CreatePricingPlanResponse>;
20
+ /**
21
+ * Updates a pricing plan (rename)
22
+ */
23
+ updatePricingPlan(reference: string, payload: UpdatePricingPlanPayload): Promise<void>;
24
+ /**
25
+ * Deletes a pricing plan
26
+ */
27
+ deletePricingPlan(reference: string): Promise<void>;
28
+ /**
29
+ * Gets business rules for a pricing plan
30
+ */
31
+ getBusinessRules(reference: string, params?: GetBusinessRulesParameters): Promise<GetBusinessRulesResponse>;
32
+ /**
33
+ * Creates or updates business rules for a pricing plan
34
+ */
35
+ createBusinessRules(reference: string, payload: CreateBusinessRulesPayload): Promise<CreateBusinessRulesResponse>;
36
+ /**
37
+ * Gets business rules history for a pricing plan
38
+ */
39
+ getBusinessRulesHistory(reference: string, params: GetBusinessRulesHistoryParameters): Promise<GetBusinessRulesHistoryResponse>;
40
+ /**
41
+ * Gets scopes (attached customers or resellers) for a pricing plan
42
+ */
43
+ getScopes(reference: string, type: PricingPlanScopeType, params?: GetScopesParameters): Promise<GetScopesResponse>;
44
+ /**
45
+ * Attaches scopes (customers or resellers) to a pricing plan
46
+ */
47
+ attachScopes(reference: string, type: PricingPlanScopeType, payload: AttachScopesPayload): Promise<AttachScopesResponse>;
48
+ /**
49
+ * Detaches scopes (customers or resellers) from a pricing plan
50
+ */
51
+ detachScopes(reference: string, type: PricingPlanScopeType, payload: DetachScopesPayload): Promise<void>;
52
+ /**
53
+ * Gets clients (attach/detach) history for a pricing plan
54
+ */
55
+ getClientsHistory(reference: string, params?: GetClientsHistoryParameters): Promise<GetClientsHistoryResponse>;
56
+ }
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PricingPlanClient = void 0;
4
+ const abstractRestfulClient_1 = require("../abstractRestfulClient");
5
+ class PricingPlanClient extends abstractRestfulClient_1.AbstractRestfulClient {
6
+ constructor() {
7
+ super(...arguments);
8
+ /**
9
+ * The base path of the API
10
+ */
11
+ this.basePath = '/billing/pricing-plans';
12
+ }
13
+ /**
14
+ * Lists pricing plans with optional filters
15
+ */
16
+ async listPricingPlans(params) {
17
+ this.path = '';
18
+ return this.get(params, {}, { returnAxiosData: true });
19
+ }
20
+ /**
21
+ * Gets a single pricing plan by reference
22
+ */
23
+ async getPricingPlan(reference) {
24
+ this.path = `/${reference}`;
25
+ return this.get({}, {}, { returnAxiosData: true });
26
+ }
27
+ /**
28
+ * Creates a new pricing plan
29
+ */
30
+ async createPricingPlan(payload) {
31
+ this.path = '';
32
+ return this.post(payload, {}, {}, { returnAxiosData: true });
33
+ }
34
+ /**
35
+ * Updates a pricing plan (rename)
36
+ */
37
+ async updatePricingPlan(reference, payload) {
38
+ this.path = `/${reference}`;
39
+ return this.patch(payload, {}, {}, { returnAxiosData: true });
40
+ }
41
+ /**
42
+ * Deletes a pricing plan
43
+ */
44
+ async deletePricingPlan(reference) {
45
+ this.path = `/${reference}`;
46
+ return this.delete();
47
+ }
48
+ /**
49
+ * Gets business rules for a pricing plan
50
+ */
51
+ async getBusinessRules(reference, params) {
52
+ this.path = `/${reference}/business-rules`;
53
+ return this.get(params, {}, { returnAxiosData: true });
54
+ }
55
+ /**
56
+ * Creates or updates business rules for a pricing plan
57
+ */
58
+ async createBusinessRules(reference, payload) {
59
+ this.path = `/${reference}/business-rules`;
60
+ return this.post(payload, {}, {}, { returnAxiosData: true });
61
+ }
62
+ /**
63
+ * Gets business rules history for a pricing plan
64
+ */
65
+ async getBusinessRulesHistory(reference, params) {
66
+ this.path = `/${reference}/business-rules/history`;
67
+ return this.get(params, {}, { returnAxiosData: true });
68
+ }
69
+ /**
70
+ * Gets scopes (attached customers or resellers) for a pricing plan
71
+ */
72
+ async getScopes(reference, type, params) {
73
+ this.path = `/${reference}/scopes/${type}`;
74
+ return this.get(params, {}, { returnAxiosData: true });
75
+ }
76
+ /**
77
+ * Attaches scopes (customers or resellers) to a pricing plan
78
+ */
79
+ async attachScopes(reference, type, payload) {
80
+ this.path = `/${reference}/scopes/${type}`;
81
+ return this.post(payload, {}, {}, { returnAxiosData: true });
82
+ }
83
+ /**
84
+ * Detaches scopes (customers or resellers) from a pricing plan
85
+ */
86
+ async detachScopes(reference, type, payload) {
87
+ this.path = `/${reference}/scopes/${type}`;
88
+ return this.delete({}, {}, {}, payload);
89
+ }
90
+ /**
91
+ * Gets clients (attach/detach) history for a pricing plan
92
+ */
93
+ async getClientsHistory(reference, params) {
94
+ this.path = `/${reference}/history`;
95
+ return this.get(params, {}, { returnAxiosData: true });
96
+ }
97
+ }
98
+ exports.PricingPlanClient = PricingPlanClient;
99
+ //# sourceMappingURL=pricingPlanClient.js.map
@@ -0,0 +1 @@
1
+ export * from './pricingPlan';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./pricingPlan"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,189 @@
1
+ export declare enum PricingPlanScopeType {
2
+ END_CUSTOMER_XSP_REF = "end-customer-xsp-ref",
3
+ RESELLER_XSP_REF = "reseller-xsp-ref"
4
+ }
5
+ export declare enum BusinessRuleEffectType {
6
+ RATE = "rate",
7
+ LINK_TO_DEFAULT = "linkToDefault"
8
+ }
9
+ export declare type PricingPlanScopeData = {
10
+ marketplace: string;
11
+ program: string;
12
+ };
13
+ export declare type PricingPlanType = {
14
+ effectiveDate: string;
15
+ name: string;
16
+ reference: string;
17
+ scope: PricingPlanScopeData;
18
+ };
19
+ export declare type BusinessRuleScopeData = {
20
+ billingCycle?: number;
21
+ billingTerm?: number;
22
+ classification?: string;
23
+ default?: boolean;
24
+ marketSegment?: string;
25
+ offerArrowSphereSku?: string;
26
+ offerFamily?: string;
27
+ priceBandArrowSphereSku?: string;
28
+ };
29
+ export declare type BusinessRuleEffectData = {
30
+ rateType?: string;
31
+ type: BusinessRuleEffectType;
32
+ value?: number;
33
+ };
34
+ export declare type BusinessRuleType = {
35
+ effect: BusinessRuleEffectData;
36
+ effectiveDate?: string;
37
+ label?: string;
38
+ metadata?: {
39
+ updatedAt: string;
40
+ };
41
+ reference?: string;
42
+ scope: BusinessRuleScopeData;
43
+ };
44
+ export declare type ListPricingPlansParameters = {
45
+ continuationToken?: string;
46
+ endCustomerXspRef?: string;
47
+ marketplace?: string;
48
+ perPage?: number;
49
+ program?: string;
50
+ };
51
+ export declare type CreatePricingPlanPayload = {
52
+ name: string;
53
+ scope: {
54
+ marketplace?: string;
55
+ program: string;
56
+ };
57
+ };
58
+ export declare type UpdatePricingPlanPayload = {
59
+ name: string;
60
+ };
61
+ export declare type GetBusinessRulesParameters = {
62
+ continuationToken?: string;
63
+ offerFamily?: string;
64
+ perPage?: number;
65
+ };
66
+ export declare type CreateBusinessRulesPayload = {
67
+ businessRules: BusinessRuleType[];
68
+ };
69
+ export declare type GetBusinessRulesHistoryParameters = {
70
+ billingCycle?: string;
71
+ billingTerm?: string;
72
+ classification: string;
73
+ effectiveDateFrom?: string;
74
+ effectiveDateTo?: string;
75
+ marketSegment?: string;
76
+ offerArrowSphereSku?: string;
77
+ offerFamily?: string;
78
+ priceBandArrowSphereSku?: string;
79
+ };
80
+ export declare type GetScopesParameters = {
81
+ continuationToken?: string;
82
+ perPage?: number;
83
+ };
84
+ export declare type AttachScopesPayload = {
85
+ scopes: string[];
86
+ };
87
+ export declare type DetachScopesPayload = {
88
+ scopes: string[];
89
+ };
90
+ export declare type GetClientsHistoryParameters = {
91
+ continuationToken?: string;
92
+ perPage?: number;
93
+ };
94
+ export declare type ContinuationPagination = {
95
+ continuationToken: string;
96
+ next?: string;
97
+ perPage: number;
98
+ previous?: string;
99
+ };
100
+ export declare type ListPricingPlansResponse = {
101
+ data: {
102
+ pricingPlans: PricingPlanType[];
103
+ };
104
+ pagination: ContinuationPagination;
105
+ status: number;
106
+ };
107
+ export declare type GetPricingPlanResponse = {
108
+ data: {
109
+ pricingPlan: PricingPlanType;
110
+ };
111
+ status: number;
112
+ };
113
+ export declare type CreatePricingPlanResponse = {
114
+ data: {
115
+ pricingPlan: PricingPlanType;
116
+ };
117
+ status: number;
118
+ };
119
+ export declare type GetBusinessRulesResponse = {
120
+ data: {
121
+ businessRules: BusinessRuleType[];
122
+ };
123
+ pagination: ContinuationPagination;
124
+ status: number;
125
+ };
126
+ export declare type CreateBusinessRulesResponse = {
127
+ data: {
128
+ businessRules: BusinessRuleType[];
129
+ };
130
+ status: number;
131
+ };
132
+ export declare type BusinessRulesHistoryEntry = {
133
+ effect: BusinessRuleEffectData & {
134
+ tier: number;
135
+ };
136
+ effectiveDate: string;
137
+ label: string;
138
+ metadata: {
139
+ updatedAt: string;
140
+ updatedBy: {
141
+ contactName: string;
142
+ xapUsername: string;
143
+ };
144
+ };
145
+ reference: string;
146
+ scope: BusinessRuleScopeData;
147
+ };
148
+ export declare type GetBusinessRulesHistoryResponse = {
149
+ data: {
150
+ businessRules: BusinessRulesHistoryEntry[];
151
+ };
152
+ pagination: ContinuationPagination;
153
+ status: number;
154
+ };
155
+ export declare type GetScopesResponse = {
156
+ data: {
157
+ scopes: string[];
158
+ };
159
+ pagination?: ContinuationPagination;
160
+ status: number;
161
+ };
162
+ export declare type AttachScopesResponse = {
163
+ data: {
164
+ errors?: {
165
+ conflictWithExistingPricingPlan?: Record<string, string>;
166
+ };
167
+ scopes: string[];
168
+ };
169
+ status: number;
170
+ };
171
+ export declare type ClientsHistoryAction = {
172
+ action: string;
173
+ company: {
174
+ name: string;
175
+ xspRef: string;
176
+ };
177
+ effectiveDate: string;
178
+ updatedBy: {
179
+ contactName: string;
180
+ xapUsername: string;
181
+ };
182
+ };
183
+ export declare type GetClientsHistoryResponse = {
184
+ data: {
185
+ actions: ClientsHistoryAction[];
186
+ };
187
+ pagination: ContinuationPagination;
188
+ status: number;
189
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // --- Enums ---
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.BusinessRuleEffectType = exports.PricingPlanScopeType = void 0;
5
+ var PricingPlanScopeType;
6
+ (function (PricingPlanScopeType) {
7
+ PricingPlanScopeType["END_CUSTOMER_XSP_REF"] = "end-customer-xsp-ref";
8
+ PricingPlanScopeType["RESELLER_XSP_REF"] = "reseller-xsp-ref";
9
+ })(PricingPlanScopeType = exports.PricingPlanScopeType || (exports.PricingPlanScopeType = {}));
10
+ var BusinessRuleEffectType;
11
+ (function (BusinessRuleEffectType) {
12
+ BusinessRuleEffectType["RATE"] = "rate";
13
+ BusinessRuleEffectType["LINK_TO_DEFAULT"] = "linkToDefault";
14
+ })(BusinessRuleEffectType = exports.BusinessRuleEffectType || (exports.BusinessRuleEffectType = {}));
15
+ //# sourceMappingURL=pricingPlan.js.map
@@ -17,7 +17,7 @@ import { RegisterClient, StandardsClient } from './security';
17
17
  import { PartnerClient } from './partner';
18
18
  import { OrganizationUnitClient } from './organisationUnit';
19
19
  import { QuotesClient } from './quotes';
20
- import { BillingClient } from './billing';
20
+ import { BillingClient, PricingPlanClient } from './billing';
21
21
  import { AnalyticsClient } from './analytics';
22
22
  import { ReportsClient } from './reports';
23
23
  import { OrderSoftwareClient } from './orderSoftware';
@@ -108,6 +108,7 @@ export declare class PublicApiClient extends AbstractRestfulClient {
108
108
  getNotificationsClient(configuration?: ConfigurationsClient): NotificationsClient;
109
109
  getOrganizationUnitClient(configuration?: ConfigurationsClient): OrganizationUnitClient;
110
110
  getBillingClient(configuration?: ConfigurationsClient): BillingClient;
111
+ getPricingPlanClient(configuration?: ConfigurationsClient): PricingPlanClient;
111
112
  getAnalyticsClient(configuration?: ConfigurationsClient): AnalyticsClient;
112
113
  getReportsClient(configuration?: ConfigurationsClient): ReportsClient;
113
114
  getMonitoringClient(configuration?: ConfigurationsClient): MonitoringClient;
@@ -216,6 +216,11 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
216
216
  this.applyConfig(client);
217
217
  return client;
218
218
  }
219
+ getPricingPlanClient(configuration) {
220
+ const client = new billing_1.PricingPlanClient(configuration);
221
+ this.applyConfig(client);
222
+ return client;
223
+ }
219
224
  getAnalyticsClient(configuration) {
220
225
  const client = new analytics_1.AnalyticsClient(configuration);
221
226
  this.applyConfig(client);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/ArrowSphere/nodejs-api-client.git"
6
6
  },
7
- "version": "3.373.0",
7
+ "version": "3.374.0",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",