@finos/legend-server-marketplace 0.1.26 → 0.1.27
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 +9 -2
- package/lib/MarketplaceServerClient.d.ts.map +1 -1
- package/lib/MarketplaceServerClient.js +10 -1
- package/lib/MarketplaceServerClient.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/models/Subscription.d.ts +23 -1
- package/lib/models/Subscription.d.ts.map +1 -1
- package/lib/models/Subscription.js +19 -3
- package/lib/models/Subscription.js.map +1 -1
- package/lib/models/TerminalProductOrder.d.ts +60 -0
- package/lib/models/TerminalProductOrder.d.ts.map +1 -0
- package/lib/models/TerminalProductOrder.js +32 -0
- package/lib/models/TerminalProductOrder.js.map +1 -0
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/MarketplaceServerClient.ts +38 -7
- package/src/index.ts +1 -0
- package/src/models/Subscription.ts +41 -3
- package/src/models/TerminalProductOrder.ts +66 -0
- package/tsconfig.json +1 -0
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
import { type PlainObject, AbstractServerClient } from '@finos/legend-shared';
|
|
17
17
|
import type { LightProvider, TerminalResult } from './models/Provider.js';
|
|
18
18
|
import type { DataProductSearchResult } from './models/DataProductSearchResult.js';
|
|
19
|
-
import type {
|
|
19
|
+
import type { SubscriptionRequest, SubscriptionResponse } from './models/Subscription.js';
|
|
20
20
|
import type { CartItem, CartItemRequest, CartItemResponse, CartSummary } from './models/Cart.js';
|
|
21
21
|
import type { OrderDetails } from './models/Order.js';
|
|
22
22
|
import type { V1_EntitlementsLakehouseEnvironmentType } from '@finos/legend-graph';
|
|
23
|
+
import { type TerminalProductOrderResponse, OrderStatusCategory } from './models/TerminalProductOrder.js';
|
|
23
24
|
export interface MarketplaceServerClientConfig {
|
|
24
25
|
serverUrl: string;
|
|
25
26
|
subscriptionUrl: string;
|
|
@@ -32,7 +33,11 @@ export declare class MarketplaceServerClient extends AbstractServerClient {
|
|
|
32
33
|
getVendorsByCategory: (user: string, category: string, viewType: string, filters: string, limit: number) => Promise<PlainObject<TerminalResult>[]>;
|
|
33
34
|
private _search;
|
|
34
35
|
dataProductSearch: (query: string, lakehouseEnv: V1_EntitlementsLakehouseEnvironmentType, searchType?: string) => Promise<PlainObject<DataProductSearchResult>[]>;
|
|
35
|
-
|
|
36
|
+
private _subscriptions;
|
|
37
|
+
getSubscriptions: (user: string) => Promise<PlainObject<SubscriptionResponse>>;
|
|
38
|
+
cancelSubscriptions: (cancellationRequest: SubscriptionRequest) => Promise<PlainObject<{
|
|
39
|
+
message: string;
|
|
40
|
+
}>>;
|
|
36
41
|
private _cart;
|
|
37
42
|
getCart: (user: string) => Promise<PlainObject<Record<number, CartItem[]>>>;
|
|
38
43
|
getCartSummary: (user: string) => Promise<PlainObject<CartSummary>>;
|
|
@@ -40,5 +45,7 @@ export declare class MarketplaceServerClient extends AbstractServerClient {
|
|
|
40
45
|
deleteCartItem: (user: string, cartId: number) => Promise<void>;
|
|
41
46
|
addToCart: (user: string, cartItemData: CartItemRequest) => Promise<PlainObject<CartItemResponse>>;
|
|
42
47
|
submitOrder: (user: string, orderData: OrderDetails) => Promise<PlainObject<unknown>>;
|
|
48
|
+
private _orders;
|
|
49
|
+
fetchOrders: (user: string, category?: OrderStatusCategory) => Promise<PlainObject<TerminalProductOrderResponse>>;
|
|
43
50
|
}
|
|
44
51
|
//# 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,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* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { AbstractServerClient } from '@finos/legend-shared';
|
|
17
|
+
import { OrderStatusCategory, } from './models/TerminalProductOrder.js';
|
|
17
18
|
export class MarketplaceServerClient extends AbstractServerClient {
|
|
18
19
|
subscriptionUrl;
|
|
19
20
|
constructor(config) {
|
|
@@ -52,7 +53,9 @@ export class MarketplaceServerClient extends AbstractServerClient {
|
|
|
52
53
|
_search = () => `${this.baseUrl}/v1/search`;
|
|
53
54
|
dataProductSearch = async (query, lakehouseEnv, searchType = 'hybrid') => (await this.get(`${this._search()}/dataProducts/${lakehouseEnv}?query=${query}&search_type=${searchType}`)).results;
|
|
54
55
|
// ------------------------------------------- Subscriptions -----------------------------------------
|
|
55
|
-
|
|
56
|
+
_subscriptions = (user) => `${this.baseUrl}/v1/service/subscription/${user}`;
|
|
57
|
+
getSubscriptions = async (user) => this.get(this._subscriptions(user));
|
|
58
|
+
cancelSubscriptions = async (cancellationRequest) => this.post(`${this.baseUrl}/v1/workflow/cancel/subscription`, cancellationRequest);
|
|
56
59
|
// ------------------------------------------- Cart -------------------------------------------
|
|
57
60
|
_cart = (user) => `${this.baseUrl}/v1/cart/${user}`;
|
|
58
61
|
getCart = async (user) => this.get(this._cart(user));
|
|
@@ -61,5 +64,11 @@ export class MarketplaceServerClient extends AbstractServerClient {
|
|
|
61
64
|
deleteCartItem = async (user, cartId) => this.delete(`${this._cart(user)}/item/${cartId}`);
|
|
62
65
|
addToCart = async (user, cartItemData) => this.post(this._cart(user), cartItemData);
|
|
63
66
|
submitOrder = async (user, orderData) => this.post(`${this.baseUrl}/v1/workflow/create/order`, orderData);
|
|
67
|
+
// ------------------------------------------- Orders -------------------------------------------
|
|
68
|
+
_orders = () => `${this.baseUrl}/v1/workflow/fetch/orders`;
|
|
69
|
+
fetchOrders = async (user, category = OrderStatusCategory.OPEN) => this.get(this._orders(), undefined, undefined, {
|
|
70
|
+
kerberos: user,
|
|
71
|
+
category,
|
|
72
|
+
});
|
|
64
73
|
}
|
|
65
74
|
//# 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;AAe9E,OAAO,EAEL,mBAAmB,GACpB,MAAM,kCAAkC,CAAC;AAoB1C,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,IAAY,EACZ,QAAgB,EAChB,QAAgB,EAChB,OAAe,EACf,KAAa,EAC2B,EAAE;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAE7B,GAAG,IAAI,CAAC,OAAO,eAAe,QAAQ,IAAI,QAAQ,aAAa,IAAI,EAAE,CAAC,CAAC;Q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QACd,QAAQ;KACT,CACF,CAAC;CACL"}
|
package/lib/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './models/Provider.js';
|
|
|
18
18
|
export * from './models/Subscription.js';
|
|
19
19
|
export * from './models/Cart.js';
|
|
20
20
|
export * from './models/Order.js';
|
|
21
|
+
export * from './models/TerminalProductOrder.js';
|
|
21
22
|
export { MarketplaceServerClient } from './MarketplaceServerClient.js';
|
|
22
23
|
export { TerminalAccessServerClient } from './TerminalAccessServerClient.js';
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export * from './models/Provider.js';
|
|
|
18
18
|
export * from './models/Subscription.js';
|
|
19
19
|
export * from './models/Cart.js';
|
|
20
20
|
export * from './models/Order.js';
|
|
21
|
+
export * from './models/TerminalProductOrder.js';
|
|
21
22
|
export { MarketplaceServerClient } from './MarketplaceServerClient.js';
|
|
22
23
|
export { TerminalAccessServerClient } from './TerminalAccessServerClient.js';
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -20,9 +20,31 @@ export declare class Subscription {
|
|
|
20
20
|
sourceVendor: string;
|
|
21
21
|
itemName: string;
|
|
22
22
|
serviceName: string;
|
|
23
|
-
|
|
23
|
+
annualAmount: number;
|
|
24
24
|
taxValue: number;
|
|
25
25
|
costCode: string;
|
|
26
|
+
price: number;
|
|
27
|
+
servicepriceId?: number;
|
|
28
|
+
permId: number;
|
|
29
|
+
id: string;
|
|
26
30
|
static readonly serialization: SerializationFactory<Subscription>;
|
|
27
31
|
}
|
|
32
|
+
export declare class SubscriptionResponse {
|
|
33
|
+
subscriptionFeeds: Subscription[];
|
|
34
|
+
TotalMonthlyCost: number;
|
|
35
|
+
static readonly serialization: SerializationFactory<SubscriptionResponse>;
|
|
36
|
+
}
|
|
37
|
+
export interface ProductSubscription {
|
|
38
|
+
providerName: string;
|
|
39
|
+
productName: string;
|
|
40
|
+
category: string;
|
|
41
|
+
price: number;
|
|
42
|
+
servicepriceId: number;
|
|
43
|
+
model: string;
|
|
44
|
+
}
|
|
45
|
+
export interface SubscriptionRequest {
|
|
46
|
+
ordered_by: string;
|
|
47
|
+
kerberos: string;
|
|
48
|
+
order_items: Record<number, ProductSubscription[]>;
|
|
49
|
+
}
|
|
28
50
|
//# sourceMappingURL=Subscription.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../../src/models/Subscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,qBAAa,YAAY;IACvB,aAAa,EAAG,MAAM,CAAC;IACvB,KAAK,EAAG,MAAM,CAAC;IACf,YAAY,EAAG,MAAM,CAAC;IACtB,QAAQ,EAAG,MAAM,CAAC;IAClB,WAAW,EAAG,MAAM,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../../src/models/Subscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,qBAAa,YAAY;IACvB,aAAa,EAAG,MAAM,CAAC;IACvB,KAAK,EAAG,MAAM,CAAC;IACf,YAAY,EAAG,MAAM,CAAC;IACtB,QAAQ,EAAG,MAAM,CAAC;IAClB,WAAW,EAAG,MAAM,CAAC;IACrB,YAAY,EAAG,MAAM,CAAC;IACtB,QAAQ,EAAG,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,CAAC;IAClB,KAAK,EAAG,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAG,MAAM,CAAC;IAChB,EAAE,EAAG,MAAM,CAAC;IAEZ,MAAM,CAAC,QAAQ,CAAC,aAAa,qCAe3B;CACH;AAED,qBAAa,oBAAoB;IAC/B,iBAAiB,EAAG,YAAY,EAAE,CAAC;IACnC,gBAAgB,EAAG,MAAM,CAAC;IAE1B,MAAM,CAAC,QAAQ,CAAC,aAAa,6CAQ3B;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;CACpD"}
|
|
@@ -14,25 +14,41 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { SerializationFactory } from '@finos/legend-shared';
|
|
17
|
-
import { alias, createModelSchema, primitive } from 'serializr';
|
|
17
|
+
import { alias, createModelSchema, list, object, primitive } from 'serializr';
|
|
18
18
|
export class Subscription {
|
|
19
19
|
carrierVendor;
|
|
20
20
|
model;
|
|
21
21
|
sourceVendor;
|
|
22
22
|
itemName;
|
|
23
23
|
serviceName;
|
|
24
|
-
|
|
24
|
+
annualAmount;
|
|
25
25
|
taxValue;
|
|
26
26
|
costCode;
|
|
27
|
+
price;
|
|
28
|
+
servicepriceId;
|
|
29
|
+
permId;
|
|
30
|
+
id;
|
|
27
31
|
static serialization = new SerializationFactory(createModelSchema(Subscription, {
|
|
28
32
|
carrierVendor: alias('CarrierVendor', primitive()),
|
|
29
33
|
model: alias('Model', primitive()),
|
|
30
34
|
sourceVendor: alias('SourceVendor', primitive()),
|
|
31
35
|
itemName: alias('ItemName', primitive()),
|
|
32
36
|
serviceName: alias('ServiceName', primitive()),
|
|
33
|
-
|
|
37
|
+
annualAmount: alias('AnnualAmount', primitive()),
|
|
34
38
|
taxValue: alias('TaxValue', primitive()),
|
|
35
39
|
costCode: alias('CostCode', primitive()),
|
|
40
|
+
price: primitive(),
|
|
41
|
+
servicepriceId: primitive(),
|
|
42
|
+
permId: primitive(),
|
|
43
|
+
id: primitive(),
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
export class SubscriptionResponse {
|
|
47
|
+
subscriptionFeeds;
|
|
48
|
+
TotalMonthlyCost;
|
|
49
|
+
static serialization = new SerializationFactory(createModelSchema(SubscriptionResponse, {
|
|
50
|
+
subscriptionFeeds: alias('subscription_feeds', list(object(Subscription))),
|
|
51
|
+
TotalMonthlyCost: primitive(),
|
|
36
52
|
}));
|
|
37
53
|
}
|
|
38
54
|
//# sourceMappingURL=Subscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../src/models/Subscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../src/models/Subscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE9E,MAAM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C,CACH,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum OrderCategory {
|
|
17
|
+
TERMINAL = "TERMINAL",
|
|
18
|
+
TERMINAL_WITH_ADD_ON = "TERMINAL WITH ADD-ON"
|
|
19
|
+
}
|
|
20
|
+
export declare enum OrderStatus {
|
|
21
|
+
IN_PROGRESS = "IN PROGRESS",
|
|
22
|
+
OPEN = "OPEN",
|
|
23
|
+
COMPLETED = "COMPLETED"
|
|
24
|
+
}
|
|
25
|
+
export declare enum OrderStatusCategory {
|
|
26
|
+
OPEN = "OPEN",
|
|
27
|
+
CLOSED = "CLOSED"
|
|
28
|
+
}
|
|
29
|
+
export interface TerminalProductOrder {
|
|
30
|
+
order_id: string;
|
|
31
|
+
ordered_by: string;
|
|
32
|
+
ordered_for: string;
|
|
33
|
+
created_at: string;
|
|
34
|
+
updated_at: string;
|
|
35
|
+
order_cost: number;
|
|
36
|
+
order_category: OrderCategory;
|
|
37
|
+
order_type: string;
|
|
38
|
+
vendor_profile_id: number;
|
|
39
|
+
vendor_profile_name: string;
|
|
40
|
+
vendor_name: string;
|
|
41
|
+
status: string;
|
|
42
|
+
business_justification: string;
|
|
43
|
+
service_pricing_items: ServicePricingItems[];
|
|
44
|
+
workflow_details?: WorkflowDetails;
|
|
45
|
+
}
|
|
46
|
+
export interface ServicePricingItems {
|
|
47
|
+
service_pricing_id: number;
|
|
48
|
+
service_pricing_name: string;
|
|
49
|
+
}
|
|
50
|
+
export interface WorkflowDetails {
|
|
51
|
+
current_stage: string;
|
|
52
|
+
workflow_status: OrderStatus;
|
|
53
|
+
}
|
|
54
|
+
export interface TerminalProductOrderResponse {
|
|
55
|
+
orders: TerminalProductOrder[];
|
|
56
|
+
total_count: number;
|
|
57
|
+
status_filter: OrderStatusCategory;
|
|
58
|
+
kerberos: string;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=TerminalProductOrder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalProductOrder.d.ts","sourceRoot":"","sources":["../../src/models/TerminalProductOrder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oBAAY,aAAa;IACvB,QAAQ,aAAa;IACrB,oBAAoB,yBAAyB;CAC9C;AAED,oBAAY,WAAW;IACrB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,SAAS,cAAc;CACxB;AAED,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,aAAa,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,mBAAmB,EAAE,CAAC;IAC7C,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,mBAAmB,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export var OrderCategory;
|
|
17
|
+
(function (OrderCategory) {
|
|
18
|
+
OrderCategory["TERMINAL"] = "TERMINAL";
|
|
19
|
+
OrderCategory["TERMINAL_WITH_ADD_ON"] = "TERMINAL WITH ADD-ON";
|
|
20
|
+
})(OrderCategory || (OrderCategory = {}));
|
|
21
|
+
export var OrderStatus;
|
|
22
|
+
(function (OrderStatus) {
|
|
23
|
+
OrderStatus["IN_PROGRESS"] = "IN PROGRESS";
|
|
24
|
+
OrderStatus["OPEN"] = "OPEN";
|
|
25
|
+
OrderStatus["COMPLETED"] = "COMPLETED";
|
|
26
|
+
})(OrderStatus || (OrderStatus = {}));
|
|
27
|
+
export var OrderStatusCategory;
|
|
28
|
+
(function (OrderStatusCategory) {
|
|
29
|
+
OrderStatusCategory["OPEN"] = "OPEN";
|
|
30
|
+
OrderStatusCategory["CLOSED"] = "CLOSED";
|
|
31
|
+
})(OrderStatusCategory || (OrderStatusCategory = {}));
|
|
32
|
+
//# sourceMappingURL=TerminalProductOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalProductOrder.js","sourceRoot":"","sources":["../../src/models/TerminalProductOrder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,8DAA6C,CAAA;AAC/C,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,4BAAa,CAAA;IACb,sCAAuB,CAAA;AACzB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,wCAAiB,CAAA;AACnB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B"}
|
package/lib/package.json
CHANGED
package/package.json
CHANGED
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
import { type PlainObject, AbstractServerClient } from '@finos/legend-shared';
|
|
18
18
|
import type { LightProvider, TerminalResult } from './models/Provider.js';
|
|
19
19
|
import type { DataProductSearchResult } from './models/DataProductSearchResult.js';
|
|
20
|
-
import type {
|
|
20
|
+
import type {
|
|
21
|
+
SubscriptionRequest,
|
|
22
|
+
SubscriptionResponse,
|
|
23
|
+
} from './models/Subscription.js';
|
|
21
24
|
import type {
|
|
22
25
|
CartItem,
|
|
23
26
|
CartItemRequest,
|
|
@@ -26,6 +29,10 @@ import type {
|
|
|
26
29
|
} from './models/Cart.js';
|
|
27
30
|
import type { OrderDetails } from './models/Order.js';
|
|
28
31
|
import type { V1_EntitlementsLakehouseEnvironmentType } from '@finos/legend-graph';
|
|
32
|
+
import {
|
|
33
|
+
type TerminalProductOrderResponse,
|
|
34
|
+
OrderStatusCategory,
|
|
35
|
+
} from './models/TerminalProductOrder.js';
|
|
29
36
|
|
|
30
37
|
export interface MarketplaceServerClientConfig {
|
|
31
38
|
serverUrl: string;
|
|
@@ -113,14 +120,21 @@ export class MarketplaceServerClient extends AbstractServerClient {
|
|
|
113
120
|
|
|
114
121
|
// ------------------------------------------- Subscriptions -----------------------------------------
|
|
115
122
|
|
|
123
|
+
private _subscriptions = (user: string): string =>
|
|
124
|
+
`${this.baseUrl}/v1/service/subscription/${user}`;
|
|
125
|
+
|
|
116
126
|
getSubscriptions = async (
|
|
117
127
|
user: string,
|
|
118
|
-
): Promise<PlainObject<
|
|
119
|
-
(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
): Promise<PlainObject<SubscriptionResponse>> =>
|
|
129
|
+
this.get<PlainObject<SubscriptionResponse>>(this._subscriptions(user));
|
|
130
|
+
|
|
131
|
+
cancelSubscriptions = async (
|
|
132
|
+
cancellationRequest: SubscriptionRequest,
|
|
133
|
+
): Promise<PlainObject<{ message: string }>> =>
|
|
134
|
+
this.post(
|
|
135
|
+
`${this.baseUrl}/v1/workflow/cancel/subscription`,
|
|
136
|
+
cancellationRequest,
|
|
137
|
+
);
|
|
124
138
|
|
|
125
139
|
// ------------------------------------------- Cart -------------------------------------------
|
|
126
140
|
|
|
@@ -151,4 +165,21 @@ export class MarketplaceServerClient extends AbstractServerClient {
|
|
|
151
165
|
orderData: OrderDetails,
|
|
152
166
|
): Promise<PlainObject<unknown>> =>
|
|
153
167
|
this.post(`${this.baseUrl}/v1/workflow/create/order`, orderData);
|
|
168
|
+
|
|
169
|
+
// ------------------------------------------- Orders -------------------------------------------
|
|
170
|
+
private _orders = (): string => `${this.baseUrl}/v1/workflow/fetch/orders`;
|
|
171
|
+
|
|
172
|
+
fetchOrders = async (
|
|
173
|
+
user: string,
|
|
174
|
+
category: OrderStatusCategory = OrderStatusCategory.OPEN,
|
|
175
|
+
): Promise<PlainObject<TerminalProductOrderResponse>> =>
|
|
176
|
+
this.get<PlainObject<TerminalProductOrderResponse>>(
|
|
177
|
+
this._orders(),
|
|
178
|
+
undefined,
|
|
179
|
+
undefined,
|
|
180
|
+
{
|
|
181
|
+
kerberos: user,
|
|
182
|
+
category,
|
|
183
|
+
},
|
|
184
|
+
);
|
|
154
185
|
}
|
package/src/index.ts
CHANGED
|
@@ -19,5 +19,6 @@ export * from './models/Provider.js';
|
|
|
19
19
|
export * from './models/Subscription.js';
|
|
20
20
|
export * from './models/Cart.js';
|
|
21
21
|
export * from './models/Order.js';
|
|
22
|
+
export * from './models/TerminalProductOrder.js';
|
|
22
23
|
export { MarketplaceServerClient } from './MarketplaceServerClient.js';
|
|
23
24
|
export { TerminalAccessServerClient } from './TerminalAccessServerClient.js';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { SerializationFactory } from '@finos/legend-shared';
|
|
18
|
-
import { alias, createModelSchema, primitive } from 'serializr';
|
|
18
|
+
import { alias, createModelSchema, list, object, primitive } from 'serializr';
|
|
19
19
|
|
|
20
20
|
export class Subscription {
|
|
21
21
|
carrierVendor!: string;
|
|
@@ -23,9 +23,13 @@ export class Subscription {
|
|
|
23
23
|
sourceVendor!: string;
|
|
24
24
|
itemName!: string;
|
|
25
25
|
serviceName!: string;
|
|
26
|
-
|
|
26
|
+
annualAmount!: number;
|
|
27
27
|
taxValue!: number;
|
|
28
28
|
costCode!: string;
|
|
29
|
+
price!: number;
|
|
30
|
+
servicepriceId?: number;
|
|
31
|
+
permId!: number;
|
|
32
|
+
id!: string;
|
|
29
33
|
|
|
30
34
|
static readonly serialization = new SerializationFactory(
|
|
31
35
|
createModelSchema(Subscription, {
|
|
@@ -34,9 +38,43 @@ export class Subscription {
|
|
|
34
38
|
sourceVendor: alias('SourceVendor', primitive()),
|
|
35
39
|
itemName: alias('ItemName', primitive()),
|
|
36
40
|
serviceName: alias('ServiceName', primitive()),
|
|
37
|
-
|
|
41
|
+
annualAmount: alias('AnnualAmount', primitive()),
|
|
38
42
|
taxValue: alias('TaxValue', primitive()),
|
|
39
43
|
costCode: alias('CostCode', primitive()),
|
|
44
|
+
price: primitive(),
|
|
45
|
+
servicepriceId: primitive(),
|
|
46
|
+
permId: primitive(),
|
|
47
|
+
id: primitive(),
|
|
40
48
|
}),
|
|
41
49
|
);
|
|
42
50
|
}
|
|
51
|
+
|
|
52
|
+
export class SubscriptionResponse {
|
|
53
|
+
subscriptionFeeds!: Subscription[];
|
|
54
|
+
TotalMonthlyCost!: number;
|
|
55
|
+
|
|
56
|
+
static readonly serialization = new SerializationFactory(
|
|
57
|
+
createModelSchema(SubscriptionResponse, {
|
|
58
|
+
subscriptionFeeds: alias(
|
|
59
|
+
'subscription_feeds',
|
|
60
|
+
list(object(Subscription)),
|
|
61
|
+
),
|
|
62
|
+
TotalMonthlyCost: primitive(),
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ProductSubscription {
|
|
68
|
+
providerName: string;
|
|
69
|
+
productName: string;
|
|
70
|
+
category: string;
|
|
71
|
+
price: number;
|
|
72
|
+
servicepriceId: number;
|
|
73
|
+
model: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface SubscriptionRequest {
|
|
77
|
+
ordered_by: string;
|
|
78
|
+
kerberos: string;
|
|
79
|
+
order_items: Record<number, ProductSubscription[]>;
|
|
80
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export enum OrderCategory {
|
|
18
|
+
TERMINAL = 'TERMINAL',
|
|
19
|
+
TERMINAL_WITH_ADD_ON = 'TERMINAL WITH ADD-ON',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum OrderStatus {
|
|
23
|
+
IN_PROGRESS = 'IN PROGRESS',
|
|
24
|
+
OPEN = 'OPEN',
|
|
25
|
+
COMPLETED = 'COMPLETED',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export enum OrderStatusCategory {
|
|
29
|
+
OPEN = 'OPEN',
|
|
30
|
+
CLOSED = 'CLOSED',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface TerminalProductOrder {
|
|
34
|
+
order_id: string;
|
|
35
|
+
ordered_by: string;
|
|
36
|
+
ordered_for: string;
|
|
37
|
+
created_at: string;
|
|
38
|
+
updated_at: string;
|
|
39
|
+
order_cost: number;
|
|
40
|
+
order_category: OrderCategory;
|
|
41
|
+
order_type: string; //enum
|
|
42
|
+
vendor_profile_id: number;
|
|
43
|
+
vendor_profile_name: string;
|
|
44
|
+
vendor_name: string;
|
|
45
|
+
status: string;
|
|
46
|
+
business_justification: string;
|
|
47
|
+
service_pricing_items: ServicePricingItems[];
|
|
48
|
+
workflow_details?: WorkflowDetails;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface ServicePricingItems {
|
|
52
|
+
service_pricing_id: number;
|
|
53
|
+
service_pricing_name: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface WorkflowDetails {
|
|
57
|
+
current_stage: string;
|
|
58
|
+
workflow_status: OrderStatus;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface TerminalProductOrderResponse {
|
|
62
|
+
orders: TerminalProductOrder[];
|
|
63
|
+
total_count: number;
|
|
64
|
+
status_filter: OrderStatusCategory;
|
|
65
|
+
kerberos: string;
|
|
66
|
+
}
|