@finos/legend-server-marketplace 0.0.17 → 0.0.19
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/lib/MarketplaceServerClient.d.ts +4 -2
- package/lib/MarketplaceServerClient.d.ts.map +1 -1
- package/lib/MarketplaceServerClient.js +4 -1
- package/lib/MarketplaceServerClient.js.map +1 -1
- package/lib/models/DataProduct.d.ts +8 -1
- package/lib/models/DataProduct.d.ts.map +1 -1
- package/lib/models/DataProduct.js +12 -0
- package/lib/models/DataProduct.js.map +1 -1
- package/lib/models/Provider.d.ts +5 -0
- package/lib/models/Provider.d.ts.map +1 -1
- package/lib/models/Provider.js +2 -0
- package/lib/models/Provider.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +3 -3
- package/src/MarketplaceServerClient.ts +34 -4
- package/src/models/DataProduct.ts +17 -1
- package/src/models/Provider.ts +7 -0
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type PlainObject, AbstractServerClient } from '@finos/legend-shared';
|
|
17
17
|
import type { LightProvider, ProviderResult } from './models/Provider.js';
|
|
18
|
-
import type { DataProductSearchResult } from './models/DataProduct.js';
|
|
18
|
+
import type { DataProduct, DataProductSearchResult } from './models/DataProduct.js';
|
|
19
19
|
import type { Subscription } from './models/Subscription.js';
|
|
20
20
|
export interface MarketplaceServerClientConfig {
|
|
21
21
|
serverUrl: string;
|
|
@@ -26,9 +26,11 @@ export declare class MarketplaceServerClient extends AbstractServerClient {
|
|
|
26
26
|
constructor(config: MarketplaceServerClientConfig);
|
|
27
27
|
private _vendors;
|
|
28
28
|
getVendors: () => Promise<PlainObject<LightProvider>[]>;
|
|
29
|
-
getVendorsByCategory: (category: string, limit: number) => Promise<PlainObject<ProviderResult>[]>;
|
|
29
|
+
getVendorsByCategory: (category: string, filters: string, limit: number) => Promise<PlainObject<ProviderResult>[]>;
|
|
30
30
|
private _search;
|
|
31
31
|
semanticSearch: (query: string, vendorName: string, limit: number) => Promise<PlainObject<DataProductSearchResult>[]>;
|
|
32
32
|
getSubscriptions: (user: string) => Promise<PlainObject<Subscription>[]>;
|
|
33
|
+
private _dataProducts;
|
|
34
|
+
getDataProducts: (page_size: number) => Promise<PlainObject<DataProduct>[]>;
|
|
33
35
|
}
|
|
34
36
|
//# sourceMappingURL=MarketplaceServerClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketplaceServerClient.d.ts","sourceRoot":"","sources":["../src/MarketplaceServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"MarketplaceServerClient.d.ts","sourceRoot":"","sources":["../src/MarketplaceServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EACV,WAAW,EACX,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB;AAmBD,qBAAa,uBAAwB,SAAQ,oBAAoB;IAC/D,eAAe,EAAE,MAAM,CAAC;gBACZ,MAAM,EAAE,6BAA6B;IAgBjD,OAAO,CAAC,QAAQ,CAA8C;IAE9D,UAAU,QAAO,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC,CAC1B;IAE5B,oBAAoB,GAClB,UAAU,MAAM,EAChB,SAAS,MAAM,EACf,OAAO,MAAM,KACZ,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,CAOxB;IAIjB,OAAO,CAAC,OAAO,CAA6C;IAE5D,cAAc,GACZ,OAAO,MAAM,EACb,YAAY,MAAM,EAClB,OAAO,MAAM,KACZ,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAOtC;IAIZ,gBAAgB,GACd,MAAM,MAAM,KACX,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC,CAKhB;IAIvB,OAAO,CAAC,aAAa,CAA+C;IAEpE,eAAe,GACb,WAAW,MAAM,KAChB,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC,CAK1B;CACb"}
|
|
@@ -31,11 +31,14 @@ export class MarketplaceServerClient extends AbstractServerClient {
|
|
|
31
31
|
// ------------------------------------------- Vendors -------------------------------------------
|
|
32
32
|
_vendors = () => `${this.baseUrl}/v1/vendors`;
|
|
33
33
|
getVendors = () => this.get(this._vendors());
|
|
34
|
-
getVendorsByCategory = async (category, limit) => (await this.get(`${this.baseUrl}/v1/vendor/category?category=${category}&
|
|
34
|
+
getVendorsByCategory = async (category, filters, limit) => (await this.get(`${this.baseUrl}/v1/vendor/category?category=${category}&page_size=${limit}${filters}`)).results.data;
|
|
35
35
|
// ------------------------------------------- Search- -------------------------------------------
|
|
36
36
|
_search = () => `${this.baseUrl}/v1/search`;
|
|
37
37
|
semanticSearch = async (query, vendorName, limit) => (await this.get(`${this._search()}/semantic/catalog?query=${query}&vendor_name=${vendorName}&limit=${limit}`)).results;
|
|
38
38
|
// ------------------------------------------- Subscriptions -----------------------------------------
|
|
39
39
|
getSubscriptions = async (user) => (await this.get(`${this.subscriptionUrl}/v1/service/subscription/${user}`)).subscription_feeds;
|
|
40
|
+
// ------------------------------------------- Data Products -----------------------------------------
|
|
41
|
+
_dataProducts = () => `${this.baseUrl}/v1/products`;
|
|
42
|
+
getDataProducts = async (page_size) => (await this.get(`${this._dataProducts()}/?page_size=${page_size}`)).results;
|
|
40
43
|
}
|
|
41
44
|
//# sourceMappingURL=MarketplaceServerClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketplaceServerClient.js","sourceRoot":"","sources":["../src/MarketplaceServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAoB,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"MarketplaceServerClient.js","sourceRoot":"","sources":["../src/MarketplaceServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAoB,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AA8B9E,MAAM,OAAO,uBAAwB,SAAQ,oBAAoB;IAC/D,eAAe,CAAS;IACxB,YAAY,MAAqC;QAC/C,KAAK,CAAC;YACJ,OAAO,EAAE,MAAM,CAAC,SAAS;YACzB,oBAAoB,EAAE;gBACpB,4EAA4E;gBAC5E,+CAA+C;gBAC/C,sEAAsE;gBACtE,WAAW,EAAE,MAAM;aACpB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IAChD,CAAC;IAED,kGAAkG;IAE1F,QAAQ,GAAG,GAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,CAAC;IAE9D,UAAU,GAAG,GAA0C,EAAE,CACvD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE5B,oBAAoB,GAAG,KAAK,EAC1B,QAAgB,EAChB,OAAe,EACf,KAAa,EAC2B,EAAE,CAC1C,CACE,MAAM,IAAI,CAAC,GAAG,CAGZ,GAAG,IAAI,CAAC,OAAO,gCAAgC,QAAQ,cAAc,KAAK,GAAG,OAAO,EAAE,CACvF,CACF,CAAC,OAAO,CAAC,IAAI,CAAC;IAEjB,kGAAkG;IAE1F,OAAO,GAAG,GAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,YAAY,CAAC;IAE5D,cAAc,GAAG,KAAK,EACpB,KAAa,EACb,UAAkB,EAClB,KAAa,EACoC,EAAE,CACnD,CACE,MAAM,IAAI,CAAC,GAAG,CAGZ,GAAG,IAAI,CAAC,OAAO,EAAE,2BAA2B,KAAK,gBAAgB,UAAU,UAAU,KAAK,EAAE,CAC7F,CACF,CAAC,OAAO,CAAC;IAEZ,sGAAsG;IAEtG,gBAAgB,GAAG,KAAK,EACtB,IAAY,EAC0B,EAAE,CACxC,CACE,MAAM,IAAI,CAAC,GAAG,CACZ,GAAG,IAAI,CAAC,eAAe,4BAA4B,IAAI,EAAE,CAC1D,CACF,CAAC,kBAAkB,CAAC;IAEvB,sGAAsG;IAE9F,aAAa,GAAG,GAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,cAAc,CAAC;IAEpE,eAAe,GAAG,KAAK,EACrB,SAAiB,EACoB,EAAE,CACvC,CACE,MAAM,IAAI,CAAC,GAAG,CACZ,GAAG,IAAI,CAAC,aAAa,EAAE,eAAe,SAAS,EAAE,CAClD,CACF,CAAC,OAAO,CAAC;CACb"}
|
|
@@ -17,9 +17,16 @@ import { SerializationFactory } from '@finos/legend-shared';
|
|
|
17
17
|
export interface LightDataProduct {
|
|
18
18
|
description: string;
|
|
19
19
|
provider: string;
|
|
20
|
-
type:
|
|
20
|
+
type: string;
|
|
21
21
|
moreInfo: string;
|
|
22
22
|
}
|
|
23
|
+
export declare class DataProduct {
|
|
24
|
+
provider: string;
|
|
25
|
+
productName: string;
|
|
26
|
+
description: string;
|
|
27
|
+
dataProductLink: string;
|
|
28
|
+
static readonly serialization: SerializationFactory<DataProduct>;
|
|
29
|
+
}
|
|
23
30
|
export declare class DataProductSearchResultTableField {
|
|
24
31
|
field_description: string;
|
|
25
32
|
field_name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataProduct.d.ts","sourceRoot":"","sources":["../../src/models/DataProduct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"DataProduct.d.ts","sourceRoot":"","sources":["../../src/models/DataProduct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,WAAW;IACtB,QAAQ,EAAG,MAAM,CAAC;IAClB,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,eAAe,EAAG,MAAM,CAAC;IAEzB,MAAM,CAAC,QAAQ,CAAC,aAAa,oCAO3B;CACH;AAED,qBAAa,iCAAiC;IAC5C,iBAAiB,EAAG,MAAM,CAAC;IAC3B,UAAU,EAAG,MAAM,CAAC;IACpB,UAAU,EAAG,MAAM,CAAC;IAEpB,MAAM,CAAC,QAAQ,CAAC,aAAa,0DAM3B;CACH;AAED,qBAAa,4BAA4B;IACvC,aAAa,EAAG,MAAM,CAAC;IACvB,iBAAiB,EAAG,MAAM,CAAC;IAC3B,YAAY,EAAG,iCAAiC,EAAE,CAAC;IACnD,UAAU,EAAG,MAAM,CAAC;IAEpB,MAAM,CAAC,QAAQ,CAAC,aAAa,qDAO3B;CACH;AAED,qBAAa,uBAAuB;IAClC,wBAAwB,EAAG,MAAM,CAAC;IAClC,iBAAiB,EAAG,MAAM,CAAC;IAC3B,iBAAiB,EAAG,MAAM,CAAC;IAC3B,aAAa,EAAG,MAAM,CAAC;IACvB,MAAM,EAAG,4BAA4B,EAAE,CAAC;IACxC,WAAW,EAAG,MAAM,CAAC;IAErB,MAAM,CAAC,QAAQ,CAAC,aAAa,gDAS3B;CACH"}
|
|
@@ -15,6 +15,18 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { SerializationFactory } from '@finos/legend-shared';
|
|
17
17
|
import { createModelSchema, list, object, primitive } from 'serializr';
|
|
18
|
+
export class DataProduct {
|
|
19
|
+
provider;
|
|
20
|
+
productName;
|
|
21
|
+
description;
|
|
22
|
+
dataProductLink;
|
|
23
|
+
static serialization = new SerializationFactory(createModelSchema(DataProduct, {
|
|
24
|
+
provider: primitive(),
|
|
25
|
+
productName: primitive(),
|
|
26
|
+
description: primitive(),
|
|
27
|
+
dataProductLink: primitive(),
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
18
30
|
export class DataProductSearchResultTableField {
|
|
19
31
|
field_description;
|
|
20
32
|
field_name;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataProduct.js","sourceRoot":"","sources":["../../src/models/DataProduct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AASvE,MAAM,OAAO,iCAAiC;IAC5C,iBAAiB,CAAU;IAC3B,UAAU,CAAU;IACpB,UAAU,CAAU;IAEpB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,iCAAiC,EAAE;QACnD,iBAAiB,EAAE,SAAS,EAAE;QAC9B,UAAU,EAAE,SAAS,EAAE;QACvB,UAAU,EAAE,SAAS,EAAE;KACxB,CAAC,CACH,CAAC;;AAGJ,MAAM,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4B,CAAC,CAAC;QAClD,WAAW,EAAE,SAAS,EAAE;KACzB,CAAC,CACH,CAAC"}
|
package/lib/models/Provider.d.ts
CHANGED
|
@@ -27,6 +27,11 @@ export declare class ProviderResult {
|
|
|
27
27
|
description: string;
|
|
28
28
|
price: number;
|
|
29
29
|
isOwned?: boolean;
|
|
30
|
+
profileId?: string;
|
|
30
31
|
static readonly serialization: SerializationFactory<ProviderResult>;
|
|
31
32
|
}
|
|
33
|
+
export interface Filter {
|
|
34
|
+
label: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
32
37
|
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../src/models/Provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,cAAc;IACzB,EAAE,EAAG,MAAM,CAAC;IACZ,QAAQ,EAAG,MAAM,CAAC;IAClB,YAAY,EAAG,MAAM,CAAC;IACtB,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,KAAK,EAAG,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../src/models/Provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,cAAc;IACzB,EAAE,EAAG,MAAM,CAAC;IACZ,QAAQ,EAAG,MAAM,CAAC;IAClB,YAAY,EAAG,MAAM,CAAC;IACtB,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,KAAK,EAAG,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,MAAM,CAAC,QAAQ,CAAC,aAAa,uCAW3B;CACH;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/lib/models/Provider.js
CHANGED
|
@@ -23,6 +23,7 @@ export class ProviderResult {
|
|
|
23
23
|
description;
|
|
24
24
|
price;
|
|
25
25
|
isOwned;
|
|
26
|
+
profileId;
|
|
26
27
|
static serialization = new SerializationFactory(createModelSchema(ProviderResult, {
|
|
27
28
|
id: primitive(),
|
|
28
29
|
category: primitive(),
|
|
@@ -31,6 +32,7 @@ export class ProviderResult {
|
|
|
31
32
|
description: primitive(),
|
|
32
33
|
price: primitive(),
|
|
33
34
|
isOwned: optional(primitive()),
|
|
35
|
+
profileId: optional(primitive()),
|
|
34
36
|
}));
|
|
35
37
|
}
|
|
36
38
|
//# sourceMappingURL=Provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../src/models/Provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAQnE,MAAM,OAAO,cAAc;IACzB,EAAE,CAAU;IACZ,QAAQ,CAAU;IAClB,YAAY,CAAU;IACtB,WAAW,CAAU;IACrB,WAAW,CAAU;IACrB,KAAK,CAAU;IACf,OAAO,CAAW;
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../src/models/Provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAQnE,MAAM,OAAO,cAAc;IACzB,EAAE,CAAU;IACZ,QAAQ,CAAU;IAClB,YAAY,CAAU;IACtB,WAAW,CAAU;IACrB,WAAW,CAAU;IACrB,KAAK,CAAU;IACf,OAAO,CAAW;IAClB,SAAS,CAAU;IAEnB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,cAAc,EAAE;QAChC,EAAE,EAAE,SAAS,EAAE;QACf,QAAQ,EAAE,SAAS,EAAE;QACrB,YAAY,EAAE,SAAS,EAAE;QACzB,WAAW,EAAE,SAAS,EAAE;QACxB,WAAW,EAAE,SAAS,EAAE;QACxB,KAAK,EAAE,SAAS,EAAE;QAClB,OAAO,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC9B,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;KACjC,CAAC,CACH,CAAC"}
|
package/lib/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-server-marketplace",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Legend Marketplace server client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"test:watch": "jest --watch"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@finos/legend-graph": "32.1.
|
|
42
|
-
"@finos/legend-shared": "11.0.
|
|
41
|
+
"@finos/legend-graph": "32.1.48",
|
|
42
|
+
"@finos/legend-shared": "11.0.15",
|
|
43
43
|
"serializr": "3.0.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
import { type PlainObject, AbstractServerClient } from '@finos/legend-shared';
|
|
18
18
|
import type { LightProvider, ProviderResult } from './models/Provider.js';
|
|
19
|
-
import type {
|
|
19
|
+
import type {
|
|
20
|
+
DataProduct,
|
|
21
|
+
DataProductSearchResult,
|
|
22
|
+
} from './models/DataProduct.js';
|
|
20
23
|
import type { Subscription } from './models/Subscription.js';
|
|
21
24
|
|
|
22
25
|
export interface MarketplaceServerClientConfig {
|
|
@@ -24,12 +27,23 @@ export interface MarketplaceServerClientConfig {
|
|
|
24
27
|
subscriptionUrl: string;
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
interface ServerResult<T> {
|
|
31
|
+
data: T;
|
|
32
|
+
total_items: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
interface MarketplaceServerResponse<T> {
|
|
28
36
|
response_code: string;
|
|
29
37
|
status: string;
|
|
30
38
|
results: T;
|
|
31
39
|
}
|
|
32
40
|
|
|
41
|
+
interface MarketplaceServerVendorsResponse<T> {
|
|
42
|
+
response_code: string;
|
|
43
|
+
status: string;
|
|
44
|
+
results: ServerResult<T>;
|
|
45
|
+
}
|
|
46
|
+
|
|
33
47
|
export class MarketplaceServerClient extends AbstractServerClient {
|
|
34
48
|
subscriptionUrl: string;
|
|
35
49
|
constructor(config: MarketplaceServerClientConfig) {
|
|
@@ -55,13 +69,16 @@ export class MarketplaceServerClient extends AbstractServerClient {
|
|
|
55
69
|
|
|
56
70
|
getVendorsByCategory = async (
|
|
57
71
|
category: string,
|
|
72
|
+
filters: string,
|
|
58
73
|
limit: number,
|
|
59
74
|
): Promise<PlainObject<ProviderResult>[]> =>
|
|
60
75
|
(
|
|
61
|
-
await this.get<
|
|
62
|
-
|
|
76
|
+
await this.get<
|
|
77
|
+
MarketplaceServerVendorsResponse<PlainObject<ProviderResult>[]>
|
|
78
|
+
>(
|
|
79
|
+
`${this.baseUrl}/v1/vendor/category?category=${category}&page_size=${limit}${filters}`,
|
|
63
80
|
)
|
|
64
|
-
).results;
|
|
81
|
+
).results.data;
|
|
65
82
|
|
|
66
83
|
// ------------------------------------------- Search- -------------------------------------------
|
|
67
84
|
|
|
@@ -90,4 +107,17 @@ export class MarketplaceServerClient extends AbstractServerClient {
|
|
|
90
107
|
`${this.subscriptionUrl}/v1/service/subscription/${user}`,
|
|
91
108
|
)
|
|
92
109
|
).subscription_feeds;
|
|
110
|
+
|
|
111
|
+
// ------------------------------------------- Data Products -----------------------------------------
|
|
112
|
+
|
|
113
|
+
private _dataProducts = (): string => `${this.baseUrl}/v1/products`;
|
|
114
|
+
|
|
115
|
+
getDataProducts = async (
|
|
116
|
+
page_size: number,
|
|
117
|
+
): Promise<PlainObject<DataProduct>[]> =>
|
|
118
|
+
(
|
|
119
|
+
await this.get<MarketplaceServerResponse<PlainObject<DataProduct>[]>>(
|
|
120
|
+
`${this._dataProducts()}/?page_size=${page_size}`,
|
|
121
|
+
)
|
|
122
|
+
).results;
|
|
93
123
|
}
|
|
@@ -20,10 +20,26 @@ import { createModelSchema, list, object, primitive } from 'serializr';
|
|
|
20
20
|
export interface LightDataProduct {
|
|
21
21
|
description: string;
|
|
22
22
|
provider: string;
|
|
23
|
-
type:
|
|
23
|
+
type: string;
|
|
24
24
|
moreInfo: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export class DataProduct {
|
|
28
|
+
provider!: string;
|
|
29
|
+
productName!: string;
|
|
30
|
+
description!: string;
|
|
31
|
+
dataProductLink!: string;
|
|
32
|
+
|
|
33
|
+
static readonly serialization = new SerializationFactory(
|
|
34
|
+
createModelSchema(DataProduct, {
|
|
35
|
+
provider: primitive(),
|
|
36
|
+
productName: primitive(),
|
|
37
|
+
description: primitive(),
|
|
38
|
+
dataProductLink: primitive(),
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
27
43
|
export class DataProductSearchResultTableField {
|
|
28
44
|
field_description!: string;
|
|
29
45
|
field_name!: string;
|
package/src/models/Provider.ts
CHANGED
|
@@ -31,6 +31,7 @@ export class ProviderResult {
|
|
|
31
31
|
description!: string;
|
|
32
32
|
price!: number;
|
|
33
33
|
isOwned?: boolean;
|
|
34
|
+
profileId?: string;
|
|
34
35
|
|
|
35
36
|
static readonly serialization = new SerializationFactory(
|
|
36
37
|
createModelSchema(ProviderResult, {
|
|
@@ -41,6 +42,12 @@ export class ProviderResult {
|
|
|
41
42
|
description: primitive(),
|
|
42
43
|
price: primitive(),
|
|
43
44
|
isOwned: optional(primitive()),
|
|
45
|
+
profileId: optional(primitive()),
|
|
44
46
|
}),
|
|
45
47
|
);
|
|
46
48
|
}
|
|
49
|
+
|
|
50
|
+
export interface Filter {
|
|
51
|
+
label: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}
|