From f3b390e4702e0783a6c776d592538d4c47ca7f8c Mon Sep 17 00:00:00 2001 From: Maher Landolsi Date: Tue, 22 Apr 2025 15:33:52 +0200 Subject: [PATCH 1/2] add endDate to LicenseGetResult --- src/licenses/README.md | 1 + src/licenses/entities/getLicense/licenseGetResult.ts | 12 +++++++++++- tests/licenses/licenses.mocks.ts | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/licenses/README.md b/src/licenses/README.md index 85d8242c..88669d4f 100644 --- a/src/licenses/README.md +++ b/src/licenses/README.md @@ -235,6 +235,7 @@ A license is managed by the `LicenseGet` entity. | associatedSubscriptionProgram | ```string``` | MSCSP | Program associated to the license in ArrowSphere format | | price | ```LicensePriceGetData``` | [LicensePriceGetResult](#LicensePriceGetResult) | | | arrowSubCategories | ```array``` | ['nce'] | Arrow sub categories | +| endDate | ```string``` | 2025-10-28T00:00:00+00:00 | end date of the license | ### ActiveSeatsGetResult diff --git a/src/licenses/entities/getLicense/licenseGetResult.ts b/src/licenses/entities/getLicense/licenseGetResult.ts index 39e1cee8..bc53abc5 100644 --- a/src/licenses/entities/getLicense/licenseGetResult.ts +++ b/src/licenses/entities/getLicense/licenseGetResult.ts @@ -83,6 +83,7 @@ export enum LicenseGetFields { COLUMN_MARKET_SEGMENT = 'marketSegment', COLUMN_CONFIGS = 'configs', COLUMN_WARNINGS = 'warnings', + COLUMN_END_DATE = 'end_date', } export type LicenseGetData = { @@ -136,6 +137,7 @@ export type LicenseGetData = { [LicenseGetFields.COLUMN_MARKET_SEGMENT]?: string | null; [LicenseGetFields.COLUMN_CONFIGS]?: Array | null; [LicenseGetFields.COLUMN_WARNINGS]?: Array | null; + [LicenseGetFields.COLUMN_END_DATE]: string; }; export class LicenseGetResult extends AbstractEntity { @@ -189,6 +191,7 @@ export class LicenseGetResult extends AbstractEntity { readonly #marketSegment?: string | null; readonly #configs?: Array | null; readonly #warnings?: Array | null; + readonly #endDate: string; public constructor(licenseGetDataInput: LicenseGetData) { super(licenseGetDataInput); @@ -318,6 +321,8 @@ export class LicenseGetResult extends AbstractEntity { (warningData: WarningFindResultData): WarningFindResult => new WarningFindResult(warningData), ); + + this.#endDate = licenseGetDataInput[LicenseGetFields.COLUMN_END_DATE] ?? ''; } public get classification(): string { @@ -523,6 +528,10 @@ export class LicenseGetResult extends AbstractEntity { return this.#warnings; } + public get endDate(): string { + return this.#endDate; + } + public toJSON(): LicenseGetData { return { [LicenseGetFields.COLUMN_ADDITIONAL_INFORMATION]: this @@ -545,7 +554,7 @@ export class LicenseGetResult extends AbstractEntity { [LicenseGetFields.COLUMN_ACTIVATION_DATETIME]: this.activationDatetime, [LicenseGetFields.COLUMN_EXPIRY_DATETIME]: this.expiryDatetime, [LicenseGetFields.COLUMN_AUTO_RENEW]: this.autoRenew, - [LicenseGetFields.COLUMN_MARKETPLACE]: this.#marketplace, + [LicenseGetFields.COLUMN_MARKETPLACE]: this.marketplace, [LicenseGetFields.COLUMN_MESSAGE]: this.message, [LicenseGetFields.COLUMN_ACTIONS]: this.actions?.toJSON(), [LicenseGetFields.COLUMN_ACTION_MESSAGES]: this.actionMessages?.map( @@ -587,6 +596,7 @@ export class LicenseGetResult extends AbstractEntity { [LicenseGetFields.COLUMN_WARNINGS]: this.warnings?.map( (warning: WarningFindResult) => warning.toJSON(), ), + [LicenseGetFields.COLUMN_END_DATE]: this.endDate, }; } } diff --git a/tests/licenses/licenses.mocks.ts b/tests/licenses/licenses.mocks.ts index a30dd39c..7305356b 100644 --- a/tests/licenses/licenses.mocks.ts +++ b/tests/licenses/licenses.mocks.ts @@ -45,6 +45,7 @@ export const PAYLOAD_SCHEMA_LICENSE: GetData = { data: { license: { [LicenseGetFields.COLUMN_CLASSIFICATION]: 'SaaS', + [LicenseGetFields.COLUMN_END_DATE]: '2025-04-22', [LicenseGetFields.COLUMN_LICENSE_ID]: '123456', [LicenseGetFields.COLUMN_PARENT_LICENSE_ID]: 'parent_license_id', [LicenseGetFields.COLUMN_FRIENDLY_NAME]: 'friendly_name', @@ -190,6 +191,7 @@ export const PAYLOAD_SCHEMA_LICENSE_WITHOUT_OPTIONAL_FIELDS: GetData Date: Tue, 22 Apr 2025 15:34:37 +0200 Subject: [PATCH 2/2] chore(package): version 3.187.0 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a06c9c1c..ea5f8011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.187.0] - 2025.04.22 +### Added +- [Licenses] add endDate to LicenseGetData type and LicenseGetResult class + ## [3.186.0] - 2025.04.15 ### Added diff --git a/package.json b/package.json index d9c05556..c8304b43 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "type": "git", "url": "https://github.com/ArrowSphere/nodejs-api-client.git" }, - "version": "3.186.0", + "version": "3.187.0", "description": "Node.js client for ArrowSphere's public API", "main": "build/index.js", "types": "build/index.d.ts",