@arrowsphere/api-client 3.27.0 → 3.28.0-rc.ckh.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/CHANGELOG.md +6 -0
- package/build/catalog/catalogClient.d.ts +12 -0
- package/build/catalog/catalogClient.js +26 -0
- package/build/catalog/entities/program.d.ts +66 -0
- package/build/catalog/entities/program.js +102 -0
- package/build/catalog/entities/programs.d.ts +9 -0
- package/build/catalog/entities/programs.js +35 -0
- package/build/catalog/index.d.ts +3 -0
- package/build/catalog/index.js +3 -0
- package/build/catalog/types/catalogGraphQLTypes.d.ts +2 -2
- package/build/publicApiClient.d.ts +2 -0
- package/build/publicApiClient.js +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.28.0] - 2023-05-22
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- Add catalog programs endpoints
|
|
11
|
+
|
|
6
12
|
## [3.27.0] - 2023-05-10
|
|
7
13
|
|
|
8
14
|
- update create order client to add attributes for injection scenario
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractClient, Parameters } from '../abstractClient';
|
|
2
|
+
import { GetResult } from '../getResult';
|
|
3
|
+
import { Program } from './entities/program';
|
|
4
|
+
import { Programs } from './entities/programs';
|
|
5
|
+
export declare class CatalogClient extends AbstractClient {
|
|
6
|
+
/**
|
|
7
|
+
* The base path of the API
|
|
8
|
+
*/
|
|
9
|
+
protected basePath: string;
|
|
10
|
+
listPrograms(category: string, parameters?: Parameters): Promise<GetResult<Programs>>;
|
|
11
|
+
getProgram(category: string, program: string, parameters?: Parameters): Promise<GetResult<Program>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CatalogClient = void 0;
|
|
4
|
+
const abstractClient_1 = require("../abstractClient");
|
|
5
|
+
const getResult_1 = require("../getResult");
|
|
6
|
+
const program_1 = require("./entities/program");
|
|
7
|
+
const programs_1 = require("./entities/programs");
|
|
8
|
+
class CatalogClient extends abstractClient_1.AbstractClient {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
/**
|
|
12
|
+
* The base path of the API
|
|
13
|
+
*/
|
|
14
|
+
this.basePath = '/catalog';
|
|
15
|
+
}
|
|
16
|
+
async listPrograms(category, parameters = {}) {
|
|
17
|
+
this.path = `/categories/${category}/programs`;
|
|
18
|
+
return new getResult_1.GetResult(programs_1.Programs, await this.get(parameters));
|
|
19
|
+
}
|
|
20
|
+
async getProgram(category, program, parameters = {}) {
|
|
21
|
+
this.path = `/categories/${category}/programs/${program}`;
|
|
22
|
+
return new getResult_1.GetResult(program_1.Program, await this.get(parameters));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.CatalogClient = CatalogClient;
|
|
26
|
+
//# sourceMappingURL=catalogClient.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AbstractEntity } from '../../abstractEntity';
|
|
2
|
+
export declare enum ProgramFields {
|
|
3
|
+
REFERENCE = "reference",
|
|
4
|
+
NAME = "name",
|
|
5
|
+
ASSOCIATED_SUBSCRIPTION_PROGRAM = "associatedSubscriptionProgram",
|
|
6
|
+
LOGO = "logo",
|
|
7
|
+
CATEGORY = "category",
|
|
8
|
+
LINKS = "links",
|
|
9
|
+
EXTRA_INFORMATION = "extraInformation"
|
|
10
|
+
}
|
|
11
|
+
export declare enum ProgramLinksFields {
|
|
12
|
+
PROGRAM = "program",
|
|
13
|
+
PRODUCTS = "products"
|
|
14
|
+
}
|
|
15
|
+
export declare enum ProgramExtraInfoFields {
|
|
16
|
+
RESELLER = "reseller",
|
|
17
|
+
END_CUSTOMER = "endCustomer",
|
|
18
|
+
ORDER = "order"
|
|
19
|
+
}
|
|
20
|
+
export declare enum ProgramExtraInfoItemFields {
|
|
21
|
+
NAME = "name",
|
|
22
|
+
LABEL = "label",
|
|
23
|
+
TYPE = "type",
|
|
24
|
+
REGEX = "regex",
|
|
25
|
+
MANDATORY = "mandatory"
|
|
26
|
+
}
|
|
27
|
+
export declare type ProgramType = {
|
|
28
|
+
[ProgramFields.REFERENCE]?: string;
|
|
29
|
+
[ProgramFields.NAME]: string;
|
|
30
|
+
[ProgramFields.ASSOCIATED_SUBSCRIPTION_PROGRAM]: string;
|
|
31
|
+
[ProgramFields.LOGO]: string;
|
|
32
|
+
[ProgramFields.CATEGORY]: string;
|
|
33
|
+
[ProgramFields.LINKS]: ProgramLinksType;
|
|
34
|
+
[ProgramFields.EXTRA_INFORMATION]: ExtraInfoType;
|
|
35
|
+
};
|
|
36
|
+
export declare type ProgramLinksType = {
|
|
37
|
+
[ProgramLinksFields.PROGRAM]: string;
|
|
38
|
+
[ProgramLinksFields.PRODUCTS]: string;
|
|
39
|
+
};
|
|
40
|
+
export declare type ExtraInfoType = {
|
|
41
|
+
[ProgramExtraInfoFields.RESELLER]: ExtraInfoItemType[];
|
|
42
|
+
[ProgramExtraInfoFields.END_CUSTOMER]: ExtraInfoItemType[];
|
|
43
|
+
[ProgramExtraInfoFields.ORDER]: ExtraInfoItemType[];
|
|
44
|
+
};
|
|
45
|
+
export declare type ExtraInfoItemType = {
|
|
46
|
+
[ProgramExtraInfoItemFields.NAME]: string;
|
|
47
|
+
[ProgramExtraInfoItemFields.LABEL]: string;
|
|
48
|
+
[ProgramExtraInfoItemFields.TYPE]: string;
|
|
49
|
+
[ProgramExtraInfoItemFields.REGEX]: string;
|
|
50
|
+
[ProgramExtraInfoItemFields.MANDATORY]: boolean;
|
|
51
|
+
};
|
|
52
|
+
export declare class Program extends AbstractEntity<ProgramType> {
|
|
53
|
+
#private;
|
|
54
|
+
constructor(input: ProgramType);
|
|
55
|
+
get reference(): string | undefined;
|
|
56
|
+
get name(): string;
|
|
57
|
+
get associatedSubscriptionProgram(): string;
|
|
58
|
+
get logo(): string;
|
|
59
|
+
get category(): string;
|
|
60
|
+
get links(): {
|
|
61
|
+
program: string;
|
|
62
|
+
products: string;
|
|
63
|
+
};
|
|
64
|
+
get extraInformation(): ExtraInfoType;
|
|
65
|
+
toJSON(): ProgramType;
|
|
66
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
3
|
+
if (!privateMap.has(receiver)) {
|
|
4
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
5
|
+
}
|
|
6
|
+
privateMap.set(receiver, value);
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
10
|
+
if (!privateMap.has(receiver)) {
|
|
11
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
12
|
+
}
|
|
13
|
+
return privateMap.get(receiver);
|
|
14
|
+
};
|
|
15
|
+
var _reference, _name, _associatedSubscriptionProgram, _logo, _category, _links, _extraInformation;
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Program = exports.ProgramExtraInfoItemFields = exports.ProgramExtraInfoFields = exports.ProgramLinksFields = exports.ProgramFields = void 0;
|
|
18
|
+
const abstractEntity_1 = require("../../abstractEntity");
|
|
19
|
+
var ProgramFields;
|
|
20
|
+
(function (ProgramFields) {
|
|
21
|
+
ProgramFields["REFERENCE"] = "reference";
|
|
22
|
+
ProgramFields["NAME"] = "name";
|
|
23
|
+
ProgramFields["ASSOCIATED_SUBSCRIPTION_PROGRAM"] = "associatedSubscriptionProgram";
|
|
24
|
+
ProgramFields["LOGO"] = "logo";
|
|
25
|
+
ProgramFields["CATEGORY"] = "category";
|
|
26
|
+
ProgramFields["LINKS"] = "links";
|
|
27
|
+
ProgramFields["EXTRA_INFORMATION"] = "extraInformation";
|
|
28
|
+
})(ProgramFields = exports.ProgramFields || (exports.ProgramFields = {}));
|
|
29
|
+
var ProgramLinksFields;
|
|
30
|
+
(function (ProgramLinksFields) {
|
|
31
|
+
ProgramLinksFields["PROGRAM"] = "program";
|
|
32
|
+
ProgramLinksFields["PRODUCTS"] = "products";
|
|
33
|
+
})(ProgramLinksFields = exports.ProgramLinksFields || (exports.ProgramLinksFields = {}));
|
|
34
|
+
var ProgramExtraInfoFields;
|
|
35
|
+
(function (ProgramExtraInfoFields) {
|
|
36
|
+
ProgramExtraInfoFields["RESELLER"] = "reseller";
|
|
37
|
+
ProgramExtraInfoFields["END_CUSTOMER"] = "endCustomer";
|
|
38
|
+
ProgramExtraInfoFields["ORDER"] = "order";
|
|
39
|
+
})(ProgramExtraInfoFields = exports.ProgramExtraInfoFields || (exports.ProgramExtraInfoFields = {}));
|
|
40
|
+
var ProgramExtraInfoItemFields;
|
|
41
|
+
(function (ProgramExtraInfoItemFields) {
|
|
42
|
+
ProgramExtraInfoItemFields["NAME"] = "name";
|
|
43
|
+
ProgramExtraInfoItemFields["LABEL"] = "label";
|
|
44
|
+
ProgramExtraInfoItemFields["TYPE"] = "type";
|
|
45
|
+
ProgramExtraInfoItemFields["REGEX"] = "regex";
|
|
46
|
+
ProgramExtraInfoItemFields["MANDATORY"] = "mandatory";
|
|
47
|
+
})(ProgramExtraInfoItemFields = exports.ProgramExtraInfoItemFields || (exports.ProgramExtraInfoItemFields = {}));
|
|
48
|
+
class Program extends abstractEntity_1.AbstractEntity {
|
|
49
|
+
constructor(input) {
|
|
50
|
+
super(input);
|
|
51
|
+
_reference.set(this, void 0);
|
|
52
|
+
_name.set(this, void 0);
|
|
53
|
+
_associatedSubscriptionProgram.set(this, void 0);
|
|
54
|
+
_logo.set(this, void 0);
|
|
55
|
+
_category.set(this, void 0);
|
|
56
|
+
_links.set(this, void 0);
|
|
57
|
+
_extraInformation.set(this, void 0);
|
|
58
|
+
__classPrivateFieldSet(this, _reference, input[ProgramFields.REFERENCE]);
|
|
59
|
+
__classPrivateFieldSet(this, _name, input[ProgramFields.NAME]);
|
|
60
|
+
__classPrivateFieldSet(this, _associatedSubscriptionProgram, input[ProgramFields.ASSOCIATED_SUBSCRIPTION_PROGRAM]);
|
|
61
|
+
__classPrivateFieldSet(this, _logo, input[ProgramFields.LOGO]);
|
|
62
|
+
__classPrivateFieldSet(this, _category, input[ProgramFields.CATEGORY]);
|
|
63
|
+
__classPrivateFieldSet(this, _links, input[ProgramFields.LINKS]);
|
|
64
|
+
__classPrivateFieldSet(this, _extraInformation, input[ProgramFields.EXTRA_INFORMATION]);
|
|
65
|
+
}
|
|
66
|
+
get reference() {
|
|
67
|
+
return __classPrivateFieldGet(this, _reference);
|
|
68
|
+
}
|
|
69
|
+
get name() {
|
|
70
|
+
return __classPrivateFieldGet(this, _name);
|
|
71
|
+
}
|
|
72
|
+
get associatedSubscriptionProgram() {
|
|
73
|
+
return __classPrivateFieldGet(this, _associatedSubscriptionProgram);
|
|
74
|
+
}
|
|
75
|
+
get logo() {
|
|
76
|
+
return __classPrivateFieldGet(this, _logo);
|
|
77
|
+
}
|
|
78
|
+
get category() {
|
|
79
|
+
return __classPrivateFieldGet(this, _category);
|
|
80
|
+
}
|
|
81
|
+
get links() {
|
|
82
|
+
return __classPrivateFieldGet(this, _links);
|
|
83
|
+
}
|
|
84
|
+
get extraInformation() {
|
|
85
|
+
return __classPrivateFieldGet(this, _extraInformation);
|
|
86
|
+
}
|
|
87
|
+
toJSON() {
|
|
88
|
+
return {
|
|
89
|
+
[ProgramFields.REFERENCE]: this.reference,
|
|
90
|
+
[ProgramFields.NAME]: this.name,
|
|
91
|
+
[ProgramFields.ASSOCIATED_SUBSCRIPTION_PROGRAM]: this
|
|
92
|
+
.associatedSubscriptionProgram,
|
|
93
|
+
[ProgramFields.LOGO]: this.logo,
|
|
94
|
+
[ProgramFields.CATEGORY]: this.category,
|
|
95
|
+
[ProgramFields.LINKS]: this.links,
|
|
96
|
+
[ProgramFields.EXTRA_INFORMATION]: this.extraInformation,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.Program = Program;
|
|
101
|
+
_reference = new WeakMap(), _name = new WeakMap(), _associatedSubscriptionProgram = new WeakMap(), _logo = new WeakMap(), _category = new WeakMap(), _links = new WeakMap(), _extraInformation = new WeakMap();
|
|
102
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractEntity } from '../../abstractEntity';
|
|
2
|
+
import { Program, ProgramType } from './program';
|
|
3
|
+
export declare type ProgramsType = Array<ProgramType>;
|
|
4
|
+
export declare class Programs extends AbstractEntity<ProgramsType> {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(input: ProgramsType);
|
|
7
|
+
get list(): Program[];
|
|
8
|
+
toJSON(): ProgramsType;
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
3
|
+
if (!privateMap.has(receiver)) {
|
|
4
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
5
|
+
}
|
|
6
|
+
privateMap.set(receiver, value);
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
10
|
+
if (!privateMap.has(receiver)) {
|
|
11
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
12
|
+
}
|
|
13
|
+
return privateMap.get(receiver);
|
|
14
|
+
};
|
|
15
|
+
var _list;
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Programs = void 0;
|
|
18
|
+
const abstractEntity_1 = require("../../abstractEntity");
|
|
19
|
+
const program_1 = require("./program");
|
|
20
|
+
class Programs extends abstractEntity_1.AbstractEntity {
|
|
21
|
+
constructor(input) {
|
|
22
|
+
super(input);
|
|
23
|
+
_list.set(this, void 0);
|
|
24
|
+
__classPrivateFieldSet(this, _list, input.map((input) => new program_1.Program(input)));
|
|
25
|
+
}
|
|
26
|
+
get list() {
|
|
27
|
+
return __classPrivateFieldGet(this, _list);
|
|
28
|
+
}
|
|
29
|
+
toJSON() {
|
|
30
|
+
return this.list.map((item) => item.toJSON());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Programs = Programs;
|
|
34
|
+
_list = new WeakMap();
|
|
35
|
+
//# sourceMappingURL=programs.js.map
|
package/build/catalog/index.d.ts
CHANGED
package/build/catalog/index.js
CHANGED
|
@@ -11,5 +11,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./catalogGraphQLClient"), exports);
|
|
14
|
+
__exportStar(require("./catalogClient"), exports);
|
|
14
15
|
__exportStar(require("./types/catalogGraphQLTypes"), exports);
|
|
16
|
+
__exportStar(require("./entities/program"), exports);
|
|
17
|
+
__exportStar(require("./entities/programs"), exports);
|
|
15
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -55,7 +55,7 @@ export declare type ProductType = {
|
|
|
55
55
|
xspUrl?: string;
|
|
56
56
|
saleConstraints?: SaleConstraintsType;
|
|
57
57
|
vendor?: VendorType;
|
|
58
|
-
program?:
|
|
58
|
+
program?: GraphqlProgramType;
|
|
59
59
|
weightTopSales?: number;
|
|
60
60
|
weightForced?: number;
|
|
61
61
|
priceBand?: Array<PriceBandType>;
|
|
@@ -130,7 +130,7 @@ export declare type SaleConstraintsType = {
|
|
|
130
130
|
export declare type VendorType = {
|
|
131
131
|
name?: string;
|
|
132
132
|
};
|
|
133
|
-
export declare type
|
|
133
|
+
export declare type GraphqlProgramType = {
|
|
134
134
|
isEnabled?: boolean;
|
|
135
135
|
legacyCode?: string;
|
|
136
136
|
names?: ProgramNameType;
|
|
@@ -11,6 +11,7 @@ import { StandardsClient } from './security/standards/standardsClient';
|
|
|
11
11
|
import { RegisterClient } from './security';
|
|
12
12
|
import { CartClient } from './cart/cartClient';
|
|
13
13
|
import { SupportCenterClient } from './supportCenter';
|
|
14
|
+
import { CatalogClient } from './catalog';
|
|
14
15
|
/**
|
|
15
16
|
* Public API Client class, should be the main entry point for your calls
|
|
16
17
|
*/
|
|
@@ -61,5 +62,6 @@ export declare class PublicApiClient extends AbstractClient {
|
|
|
61
62
|
getSecurityRegisterClient(): RegisterClient;
|
|
62
63
|
getCartClient(): CartClient;
|
|
63
64
|
getSupportCenterClient(): SupportCenterClient;
|
|
65
|
+
getCatalogClient(): CatalogClient;
|
|
64
66
|
}
|
|
65
67
|
export default PublicApiClient;
|
package/build/publicApiClient.js
CHANGED
|
@@ -14,6 +14,7 @@ const standardsClient_1 = require("./security/standards/standardsClient");
|
|
|
14
14
|
const security_1 = require("./security");
|
|
15
15
|
const cartClient_1 = require("./cart/cartClient");
|
|
16
16
|
const supportCenter_1 = require("./supportCenter");
|
|
17
|
+
const catalog_1 = require("./catalog");
|
|
17
18
|
/**
|
|
18
19
|
* Public API Client class, should be the main entry point for your calls
|
|
19
20
|
*/
|
|
@@ -131,6 +132,12 @@ class PublicApiClient extends abstractClient_1.AbstractClient {
|
|
|
131
132
|
.setApiKey(this.apiKey)
|
|
132
133
|
.setHeaders(this.headers);
|
|
133
134
|
}
|
|
135
|
+
getCatalogClient() {
|
|
136
|
+
return new catalog_1.CatalogClient()
|
|
137
|
+
.setUrl(this.url)
|
|
138
|
+
.setApiKey(this.apiKey)
|
|
139
|
+
.setHeaders(this.headers);
|
|
140
|
+
}
|
|
134
141
|
}
|
|
135
142
|
exports.PublicApiClient = PublicApiClient;
|
|
136
143
|
exports.default = PublicApiClient;
|
package/package.json
CHANGED