@arrowsphere/api-client 3.71.1 → 3.72.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,11 @@
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.72.0] - 2023-12-05
7
+
8
+ ### Changed
9
+ - Adds Organization unit client and endpoints
10
+
6
11
  ## [3.71.1] - 2023-12-05
7
12
 
8
13
  ### Fixed
package/build/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './pagination';
15
15
  export * from './licenses/';
16
16
  export * from './notifications/';
17
17
  export * from './orders/';
18
+ export * from './organisationUnit/';
18
19
  export * from './partner';
19
20
  export * from './publicApiClient';
20
21
  export * from './publicGraphQLClient';
package/build/index.js CHANGED
@@ -44,6 +44,7 @@ __exportStar(require("./pagination"), exports);
44
44
  __exportStar(require("./licenses/"), exports);
45
45
  __exportStar(require("./notifications/"), exports);
46
46
  __exportStar(require("./orders/"), exports);
47
+ __exportStar(require("./organisationUnit/"), exports);
47
48
  __exportStar(require("./partner"), exports);
48
49
  __exportStar(require("./publicApiClient"), exports);
49
50
  __exportStar(require("./publicGraphQLClient"), exports);
@@ -0,0 +1,25 @@
1
+ import { AbstractEntity } from '../../abstractEntity';
2
+ export declare enum OrganizationUnitFields {
3
+ COLUMN_ORGANIZATION_UNIT_REF = "organizationUnitRef",
4
+ COLUMN_COMPANY_REF = "companyRef",
5
+ COLUMN_NAME = "name",
6
+ COLUMN_COUNT_USERS = "countUsers",
7
+ COLUMN_COUNT_CUSTOMERS = "countCustomers"
8
+ }
9
+ export declare type OrganizationUnitType = {
10
+ [OrganizationUnitFields.COLUMN_ORGANIZATION_UNIT_REF]: string;
11
+ [OrganizationUnitFields.COLUMN_COMPANY_REF]: string;
12
+ [OrganizationUnitFields.COLUMN_NAME]: string;
13
+ [OrganizationUnitFields.COLUMN_COUNT_USERS]?: number;
14
+ [OrganizationUnitFields.COLUMN_COUNT_CUSTOMERS]?: number;
15
+ };
16
+ export declare class OrganizationUnit extends AbstractEntity<OrganizationUnitType> {
17
+ #private;
18
+ constructor(organizationUnitInput: OrganizationUnitType);
19
+ get organizationUnitRef(): string;
20
+ get companyRef(): string;
21
+ get name(): string;
22
+ get countUsers(): number | undefined;
23
+ get countCustomers(): number | undefined;
24
+ toJSON(): OrganizationUnitType;
25
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _OrganizationUnit_organizationUnitRef, _OrganizationUnit_companyRef, _OrganizationUnit_name, _OrganizationUnit_countUsers, _OrganizationUnit_countCustomers;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.OrganizationUnit = exports.OrganizationUnitFields = void 0;
16
+ const abstractEntity_1 = require("../../abstractEntity");
17
+ var OrganizationUnitFields;
18
+ (function (OrganizationUnitFields) {
19
+ OrganizationUnitFields["COLUMN_ORGANIZATION_UNIT_REF"] = "organizationUnitRef";
20
+ OrganizationUnitFields["COLUMN_COMPANY_REF"] = "companyRef";
21
+ OrganizationUnitFields["COLUMN_NAME"] = "name";
22
+ OrganizationUnitFields["COLUMN_COUNT_USERS"] = "countUsers";
23
+ OrganizationUnitFields["COLUMN_COUNT_CUSTOMERS"] = "countCustomers";
24
+ })(OrganizationUnitFields = exports.OrganizationUnitFields || (exports.OrganizationUnitFields = {}));
25
+ class OrganizationUnit extends abstractEntity_1.AbstractEntity {
26
+ constructor(organizationUnitInput) {
27
+ super(organizationUnitInput);
28
+ _OrganizationUnit_organizationUnitRef.set(this, void 0);
29
+ _OrganizationUnit_companyRef.set(this, void 0);
30
+ _OrganizationUnit_name.set(this, void 0);
31
+ _OrganizationUnit_countUsers.set(this, void 0);
32
+ _OrganizationUnit_countCustomers.set(this, void 0);
33
+ __classPrivateFieldSet(this, _OrganizationUnit_organizationUnitRef, organizationUnitInput[OrganizationUnitFields.COLUMN_ORGANIZATION_UNIT_REF], "f");
34
+ __classPrivateFieldSet(this, _OrganizationUnit_companyRef, organizationUnitInput[OrganizationUnitFields.COLUMN_COMPANY_REF], "f");
35
+ __classPrivateFieldSet(this, _OrganizationUnit_name, organizationUnitInput[OrganizationUnitFields.COLUMN_NAME], "f");
36
+ __classPrivateFieldSet(this, _OrganizationUnit_countUsers, organizationUnitInput[OrganizationUnitFields.COLUMN_COUNT_USERS], "f");
37
+ __classPrivateFieldSet(this, _OrganizationUnit_countCustomers, organizationUnitInput[OrganizationUnitFields.COLUMN_COUNT_CUSTOMERS], "f");
38
+ }
39
+ get organizationUnitRef() {
40
+ return __classPrivateFieldGet(this, _OrganizationUnit_organizationUnitRef, "f");
41
+ }
42
+ get companyRef() {
43
+ return __classPrivateFieldGet(this, _OrganizationUnit_companyRef, "f");
44
+ }
45
+ get name() {
46
+ return __classPrivateFieldGet(this, _OrganizationUnit_name, "f");
47
+ }
48
+ get countUsers() {
49
+ return __classPrivateFieldGet(this, _OrganizationUnit_countUsers, "f");
50
+ }
51
+ get countCustomers() {
52
+ return __classPrivateFieldGet(this, _OrganizationUnit_countCustomers, "f");
53
+ }
54
+ toJSON() {
55
+ return {
56
+ [OrganizationUnitFields.COLUMN_ORGANIZATION_UNIT_REF]: this
57
+ .organizationUnitRef,
58
+ [OrganizationUnitFields.COLUMN_COMPANY_REF]: this.companyRef,
59
+ [OrganizationUnitFields.COLUMN_NAME]: this.name,
60
+ [OrganizationUnitFields.COLUMN_COUNT_USERS]: this.countUsers,
61
+ [OrganizationUnitFields.COLUMN_COUNT_CUSTOMERS]: this.countCustomers,
62
+ };
63
+ }
64
+ }
65
+ exports.OrganizationUnit = OrganizationUnit;
66
+ _OrganizationUnit_organizationUnitRef = new WeakMap(), _OrganizationUnit_companyRef = new WeakMap(), _OrganizationUnit_name = new WeakMap(), _OrganizationUnit_countUsers = new WeakMap(), _OrganizationUnit_countCustomers = new WeakMap();
67
+ //# sourceMappingURL=organizationUnit.js.map
@@ -0,0 +1,9 @@
1
+ import { OrganizationUnit, OrganizationUnitType } from './organizationUnit';
2
+ import { AbstractEntity } from '../../abstractEntity';
3
+ export declare type OrganizationUnitListType = Array<OrganizationUnitType>;
4
+ export declare class OrganizationUnitList extends AbstractEntity<OrganizationUnitListType> {
5
+ #private;
6
+ constructor(organizationUnitsDataInput: OrganizationUnitListType);
7
+ get organizationUnitList(): Array<OrganizationUnit>;
8
+ toJSON(): OrganizationUnitListType;
9
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _OrganizationUnitList_organizationUnitList;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.OrganizationUnitList = void 0;
16
+ const organizationUnit_1 = require("./organizationUnit");
17
+ const abstractEntity_1 = require("../../abstractEntity");
18
+ class OrganizationUnitList extends abstractEntity_1.AbstractEntity {
19
+ constructor(organizationUnitsDataInput) {
20
+ super(organizationUnitsDataInput);
21
+ _OrganizationUnitList_organizationUnitList.set(this, void 0);
22
+ __classPrivateFieldSet(this, _OrganizationUnitList_organizationUnitList, organizationUnitsDataInput.map((organizationUnit) => new organizationUnit_1.OrganizationUnit(organizationUnit)), "f");
23
+ }
24
+ get organizationUnitList() {
25
+ return __classPrivateFieldGet(this, _OrganizationUnitList_organizationUnitList, "f");
26
+ }
27
+ toJSON() {
28
+ return this.organizationUnitList.map((organizationUnit) => organizationUnit.toJSON());
29
+ }
30
+ }
31
+ exports.OrganizationUnitList = OrganizationUnitList;
32
+ _OrganizationUnitList_organizationUnitList = new WeakMap();
33
+ //# sourceMappingURL=organizationUnitList.js.map
@@ -0,0 +1,3 @@
1
+ export * from './entities/organizationUnitList';
2
+ export * from './entities/organizationUnit';
3
+ export * from './organizationUnitClient';
@@ -0,0 +1,20 @@
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("./entities/organizationUnitList"), exports);
18
+ __exportStar(require("./entities/organizationUnit"), exports);
19
+ __exportStar(require("./organizationUnitClient"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,18 @@
1
+ import { AbstractRestfulClient, Parameters } from '../abstractRestfulClient';
2
+ import { GetResult } from '../getResult';
3
+ import { OrganizationUnit } from './entities/organizationUnit';
4
+ import { OrganizationUnitList } from './entities/organizationUnitList';
5
+ export declare enum OrganizationUnitPayloadFields {
6
+ COLUMN_NAME = "name"
7
+ }
8
+ export declare type OrganizationUnitPayloadType = {
9
+ [OrganizationUnitPayloadFields.COLUMN_NAME]: string;
10
+ };
11
+ export declare class OrganizationUnitClient extends AbstractRestfulClient {
12
+ protected basePath: string;
13
+ getList(perPage?: number, page?: number, parameters?: Parameters): Promise<GetResult<OrganizationUnitList>>;
14
+ create(payload: OrganizationUnitPayloadType, parameters?: Parameters): Promise<GetResult<OrganizationUnit>>;
15
+ getOne(organizationUnitRef: string, parameters?: Parameters): Promise<GetResult<OrganizationUnit>>;
16
+ update(organizationUnitRef: string, payload: OrganizationUnitPayloadType, parameters?: Parameters): Promise<GetResult<OrganizationUnit>>;
17
+ deleteOne(organizationUnitRef: string, parameters?: Parameters): Promise<void>;
18
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationUnitClient = exports.OrganizationUnitPayloadFields = void 0;
4
+ const abstractRestfulClient_1 = require("../abstractRestfulClient");
5
+ const getResult_1 = require("../getResult");
6
+ const organizationUnit_1 = require("./entities/organizationUnit");
7
+ const organizationUnitList_1 = require("./entities/organizationUnitList");
8
+ var OrganizationUnitPayloadFields;
9
+ (function (OrganizationUnitPayloadFields) {
10
+ OrganizationUnitPayloadFields["COLUMN_NAME"] = "name";
11
+ })(OrganizationUnitPayloadFields = exports.OrganizationUnitPayloadFields || (exports.OrganizationUnitPayloadFields = {}));
12
+ class OrganizationUnitClient extends abstractRestfulClient_1.AbstractRestfulClient {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.basePath = '/partners/organizationUnits';
16
+ }
17
+ async getList(perPage = 25, page = 1, parameters = {}) {
18
+ this.setPage(page);
19
+ this.setPerPage(perPage);
20
+ return new getResult_1.GetResult(organizationUnitList_1.OrganizationUnitList, await this.get(parameters));
21
+ }
22
+ async create(payload, parameters = {}) {
23
+ return new getResult_1.GetResult(organizationUnit_1.OrganizationUnit, await this.post(payload, parameters));
24
+ }
25
+ async getOne(organizationUnitRef, parameters = {}) {
26
+ this.path = `/${organizationUnitRef}`;
27
+ return new getResult_1.GetResult(organizationUnit_1.OrganizationUnit, await this.get(parameters));
28
+ }
29
+ async update(organizationUnitRef, payload, parameters = {}) {
30
+ this.path = `/${organizationUnitRef}`;
31
+ return new getResult_1.GetResult(organizationUnit_1.OrganizationUnit, await this.patch(payload, parameters));
32
+ }
33
+ async deleteOne(organizationUnitRef, parameters = {}) {
34
+ this.path = `/${organizationUnitRef}`;
35
+ return await this.delete(parameters);
36
+ }
37
+ }
38
+ exports.OrganizationUnitClient = OrganizationUnitClient;
39
+ //# sourceMappingURL=organizationUnitClient.js.map
@@ -15,6 +15,7 @@ import { UserClient } from './user';
15
15
  import { NotificationsClient } from './notifications';
16
16
  import { RegisterClient, StandardsClient } from './security';
17
17
  import { PartnerClient } from './partner';
18
+ import { OrganizationUnitClient } from './organisationUnit';
18
19
  /**
19
20
  * Public API Client class, should be the main entry point for your calls
20
21
  */
@@ -89,5 +90,6 @@ export declare class PublicApiClient extends AbstractRestfulClient {
89
90
  getCatalogClient(configuration?: ConfigurationsClient): CatalogClient;
90
91
  getUserClient(configuration?: ConfigurationsClient): UserClient;
91
92
  getNotificationsClient(configuration?: ConfigurationsClient): NotificationsClient;
93
+ getOrganizationUnitClient(configuration?: ConfigurationsClient): OrganizationUnitClient;
92
94
  }
93
95
  export default PublicApiClient;
@@ -18,6 +18,7 @@ const user_1 = require("./user");
18
18
  const notifications_1 = require("./notifications");
19
19
  const security_1 = require("./security");
20
20
  const partner_1 = require("./partner");
21
+ const organisationUnit_1 = require("./organisationUnit");
21
22
  /**
22
23
  * Public API Client class, should be the main entry point for your calls
23
24
  */
@@ -181,6 +182,11 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
181
182
  this.applyConfig(client);
182
183
  return client;
183
184
  }
185
+ getOrganizationUnitClient(configuration) {
186
+ const client = new organisationUnit_1.OrganizationUnitClient(configuration);
187
+ this.applyConfig(client);
188
+ return client;
189
+ }
184
190
  }
185
191
  exports.PublicApiClient = PublicApiClient;
186
192
  exports.default = PublicApiClient;
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.71.1",
7
+ "version": "3.72.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",