@finos/legend-server-marketplace 0.0.38 → 0.1.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/lib/index.d.ts CHANGED
@@ -16,6 +16,5 @@
16
16
  export * from './models/DataProduct.js';
17
17
  export * from './models/Provider.js';
18
18
  export * from './models/Subscription.js';
19
- export { LakehouseContractServerClient } from './LakehouseContractServerClient.js';
20
19
  export { MarketplaceServerClient } from './MarketplaceServerClient.js';
21
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
package/lib/index.js CHANGED
@@ -16,6 +16,5 @@
16
16
  export * from './models/DataProduct.js';
17
17
  export * from './models/Provider.js';
18
18
  export * from './models/Subscription.js';
19
- export { LakehouseContractServerClient } from './LakehouseContractServerClient.js';
20
19
  export { MarketplaceServerClient } from './MarketplaceServerClient.js';
21
20
  //# 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,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-server-marketplace",
3
- "version": "0.0.38",
3
+ "version": "0.1.0",
4
4
  "description": "Legend Marketplace server client",
5
5
  "keywords": [
6
6
  "legend",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-server-marketplace",
3
- "version": "0.0.38",
3
+ "version": "0.1.0",
4
4
  "description": "Legend Marketplace server client",
5
5
  "keywords": [
6
6
  "legend",
@@ -38,7 +38,7 @@
38
38
  "test:watch": "jest --watch"
39
39
  },
40
40
  "dependencies": {
41
- "@finos/legend-graph": "32.1.67",
41
+ "@finos/legend-graph": "32.2.0",
42
42
  "@finos/legend-shared": "11.0.19",
43
43
  "serializr": "3.0.3"
44
44
  },
package/src/index.ts CHANGED
@@ -17,6 +17,4 @@
17
17
  export * from './models/DataProduct.js';
18
18
  export * from './models/Provider.js';
19
19
  export * from './models/Subscription.js';
20
-
21
- export { LakehouseContractServerClient } from './LakehouseContractServerClient.js';
22
20
  export { MarketplaceServerClient } from './MarketplaceServerClient.js';
package/tsconfig.json CHANGED
@@ -51,7 +51,6 @@
51
51
  }
52
52
  ],
53
53
  "files": [
54
- "./src/LakehouseContractServerClient.ts",
55
54
  "./src/MarketplaceServerClient.ts",
56
55
  "./src/index.ts",
57
56
  "./src/models/DataProduct.ts",
@@ -1,48 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-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
- import type { V1_ContractUserStatusResponse, V1_CreateContractPayload, V1_CreateSubscriptionInput, V1_DataContract, V1_DataContractApprovedUsersResponse, V1_DataContractsResponse, V1_DataSubscriptionResponse, V1_PendingTasksResponse, V1_EntitlementsDataProductDetailsResponse, V1_TaskStatus, V1_UserPendingContractsResponse, V1_LiteDataContractsResponse, V1_TaskResponse } from '@finos/legend-graph';
17
- import { AbstractServerClient, type PlainObject } from '@finos/legend-shared';
18
- export interface LakehouseContractServerClientConfig {
19
- baseUrl: string;
20
- }
21
- export declare class LakehouseContractServerClient extends AbstractServerClient {
22
- constructor(config: LakehouseContractServerClientConfig);
23
- private _token;
24
- private _dataContracts;
25
- getDataContracts: (token: string | undefined) => Promise<PlainObject<V1_DataContractsResponse>>;
26
- getLiteDataContracts: (token: string | undefined) => Promise<PlainObject<V1_LiteDataContractsResponse>>;
27
- getDataContract: (id: string, withMembers: boolean, token: string | undefined) => Promise<PlainObject<V1_DataContractsResponse>>;
28
- getApprovedUsersForDataContract: (id: string, token: string | undefined) => Promise<PlainObject<V1_DataContractApprovedUsersResponse>>;
29
- getContractUserStatus: (contractId: string, userId: string, token: string | undefined) => Promise<PlainObject<V1_ContractUserStatusResponse>>;
30
- getDataContractsFromDID: (body: PlainObject<AppendMode>[], token: string | undefined) => Promise<PlainObject<V1_DataContractsResponse>>;
31
- getPendingContracts: (user: string | undefined, token: string | undefined) => Promise<PlainObject<V1_UserPendingContractsResponse>>;
32
- createContract: (contractRequest: PlainObject<V1_CreateContractPayload>, token: string | undefined) => Promise<V1_DataContract>;
33
- private _tasks;
34
- private _contract_tasks;
35
- getPendingTasks: (user: string | undefined, token: string | undefined) => Promise<PlainObject<V1_PendingTasksResponse>>;
36
- getTask: (taskId: string, token: string | undefined) => Promise<PlainObject<V1_PendingTasksResponse>>;
37
- getContractTasks: (contractId: string, token: string | undefined) => Promise<PlainObject<V1_TaskResponse>>;
38
- approveTask: (id: string, token: string | undefined) => Promise<PlainObject<V1_TaskStatus>>;
39
- denyTask: (id: string, token: string | undefined) => Promise<PlainObject<V1_TaskStatus>>;
40
- private _subscriptions;
41
- getAllSubscriptions: (token: string | undefined) => Promise<PlainObject<V1_DataSubscriptionResponse>>;
42
- getSubscriptionsForContract: (contractId: string, token: string | undefined) => Promise<PlainObject<V1_DataSubscriptionResponse>[]>;
43
- createSubscription: (input: PlainObject<V1_CreateSubscriptionInput>, token: string | undefined) => Promise<PlainObject<V1_DataSubscriptionResponse>>;
44
- private _dataProducts;
45
- getDataProducts: (token: string | undefined) => Promise<PlainObject<V1_EntitlementsDataProductDetailsResponse>>;
46
- getDataProductByIdAndDID: (dataProductId: string, deploymentId: number, token: string | undefined) => Promise<PlainObject<V1_EntitlementsDataProductDetailsResponse>>;
47
- }
48
- //# sourceMappingURL=LakehouseContractServerClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LakehouseContractServerClient.d.ts","sourceRoot":"","sources":["../src/LakehouseContractServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,EACf,oCAAoC,EACpC,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,yCAAyC,EACzC,aAAa,EACb,+BAA+B,EAC/B,4BAA4B,EAC5B,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAA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EACpB,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAC,CAK9D;CACL"}
@@ -1,69 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-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
- import { AbstractServerClient } from '@finos/legend-shared';
17
- export class LakehouseContractServerClient extends AbstractServerClient {
18
- constructor(config) {
19
- super({
20
- baseUrl: config.baseUrl,
21
- });
22
- }
23
- // auth
24
- _token = (token) => ({
25
- Authorization: `Bearer ${token}`,
26
- });
27
- // ------------------------------------------- Data Contracts -------------------------------------------
28
- _dataContracts = () => `${this.baseUrl}/datacontracts`;
29
- getDataContracts = (token) => this.get(this._dataContracts(), {}, this._token(token));
30
- getLiteDataContracts = (token) => this.get(`${this._dataContracts()}/lite`, {}, this._token(token));
31
- getDataContract = (id, withMembers, token) => this.get(`${this._dataContracts()}/${encodeURIComponent(id)}?withMembers=${withMembers}`, {}, this._token(token));
32
- getApprovedUsersForDataContract = (id, token) => this.get(`${this._dataContracts()}/${encodeURIComponent(id)}/approvedUsers`, {}, this._token(token));
33
- getContractUserStatus = (contractId, userId, token) => this.get(`${this._dataContracts()}/${encodeURIComponent(contractId)}/user/${encodeURIComponent(userId)}`, {}, this._token(token));
34
- getDataContractsFromDID = (body, token) => {
35
- return this.post(`${this._dataContracts()}/query/accessPointsOwnedByDeployments`, body, undefined, this._token(token));
36
- };
37
- getPendingContracts = (user, token) => {
38
- return this.get(`${this._dataContracts()}/pendingContractsForUser`, {}, this._token(token), { user });
39
- };
40
- createContract = (contractRequest, token) => this.post(`${this._dataContracts()}`, contractRequest, undefined, this._token(token));
41
- // ------------------------------------------- Tasks -------------------------------------------
42
- _tasks = () => `${this.baseUrl}/datacontracts/tasks`;
43
- _contract_tasks = () => `${this._tasks()}/query/contract`;
44
- getPendingTasks = (user, token) => {
45
- return this.get(`${this._tasks()}/pending`, {}, this._token(token), {
46
- user,
47
- });
48
- };
49
- getTask = (taskId, token) => {
50
- return this.get(`${this._tasks()}/${encodeURIComponent(taskId)}`, {}, this._token(token), undefined);
51
- };
52
- getContractTasks = (contractId, token) => {
53
- return this.get(`${this._contract_tasks()}/${encodeURIComponent(contractId)}`, {}, this._token(token), {
54
- user: contractId,
55
- });
56
- };
57
- approveTask = (id, token) => this.post(`${this._tasks()}/${encodeURIComponent(id)}/approve`, {}, {}, this._token(token));
58
- denyTask = (id, token) => this.post(`${this._tasks()}/${encodeURIComponent(id)}/deny`, {}, {}, this._token(token));
59
- // --------------------------------------- Subscriptions ---------------------------------------
60
- _subscriptions = () => `${this.baseUrl}/subscriptions`;
61
- getAllSubscriptions = (token) => this.get(this._subscriptions(), {}, this._token(token));
62
- getSubscriptionsForContract = (contractId, token) => this.get(`${this._subscriptions()}/query/contract/${contractId}`, {}, this._token(token));
63
- createSubscription = (input, token) => this.post(this._subscriptions(), input, {}, this._token(token));
64
- // --------------------------------------- Data Products ---------------------------------------
65
- _dataProducts = () => `${this.baseUrl}/dataproducts`;
66
- getDataProducts = (token) => this.get(this._dataProducts(), {}, this._token(token));
67
- getDataProductByIdAndDID = (dataProductId, deploymentId, token) => this.get(`${this._dataProducts()}/${dataProductId}/deployments/${deploymentId}`, {}, this._token(token));
68
- }
69
- //# sourceMappingURL=LakehouseContractServerClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LakehouseContractServerClient.js","sourceRoot":"","sources":["../src/LakehouseContractServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,OAAO,EAAE,oBAAoB,E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AI,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1D,2BAA2B,GAAG,CAC5B,UAAkB,EAClB,KAAyB,EAC4B,EAAE,CACvD,IAAI,CAAC,GAAG,CACN,GAAG,IAAI,CAAC,cAAc,EAAE,mBAAmB,UAAU,EAAE,EACvD,EAAE,EACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CACnB,CAAC;IAEJ,kBAAkB,GAAG,CACnB,KAA8C,EAC9C,KAAyB,EAC0B,EAAE,CACrD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAElE,gGAAgG;IAExF,aAAa,GAAG,GAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,eAAe,CAAC;IAErE,eAAe,GAAG,CAChB,KAAyB,EACwC,EAAE,CACnE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAEzD,wBAAwB,GAAG,CACzB,aAAqB,EACrB,YAAoB,EACpB,KAAyB,EACwC,EAAE,CACnE,IAAI,CAAC,GAAG,CACN,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,aAAa,gBAAgB,YAAY,EAAE,EACtE,EAAE,EACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CACnB,CAAC;CACL"}
@@ -1,237 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-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
- import type {
18
- V1_ContractUserStatusResponse,
19
- V1_CreateContractPayload,
20
- V1_CreateSubscriptionInput,
21
- V1_DataContract,
22
- V1_DataContractApprovedUsersResponse,
23
- V1_DataContractsResponse,
24
- V1_DataSubscriptionResponse,
25
- V1_PendingTasksResponse,
26
- V1_EntitlementsDataProductDetailsResponse,
27
- V1_TaskStatus,
28
- V1_UserPendingContractsResponse,
29
- V1_LiteDataContractsResponse,
30
- V1_TaskResponse,
31
- } from '@finos/legend-graph';
32
- import { AbstractServerClient, type PlainObject } from '@finos/legend-shared';
33
-
34
- export interface LakehouseContractServerClientConfig {
35
- baseUrl: string;
36
- }
37
-
38
- export class LakehouseContractServerClient extends AbstractServerClient {
39
- constructor(config: LakehouseContractServerClientConfig) {
40
- super({
41
- baseUrl: config.baseUrl,
42
- });
43
- }
44
-
45
- // auth
46
- private _token = (token?: string) => ({
47
- Authorization: `Bearer ${token}`,
48
- });
49
-
50
- // ------------------------------------------- Data Contracts -------------------------------------------
51
-
52
- private _dataContracts = (): string => `${this.baseUrl}/datacontracts`;
53
-
54
- getDataContracts = (
55
- token: string | undefined,
56
- ): Promise<PlainObject<V1_DataContractsResponse>> =>
57
- this.get(this._dataContracts(), {}, this._token(token));
58
-
59
- getLiteDataContracts = (
60
- token: string | undefined,
61
- ): Promise<PlainObject<V1_LiteDataContractsResponse>> =>
62
- this.get(`${this._dataContracts()}/lite`, {}, this._token(token));
63
-
64
- getDataContract = (
65
- id: string,
66
- withMembers: boolean,
67
- token: string | undefined,
68
- ): Promise<PlainObject<V1_DataContractsResponse>> =>
69
- this.get(
70
- `${this._dataContracts()}/${encodeURIComponent(id)}?withMembers=${withMembers}`,
71
- {},
72
- this._token(token),
73
- );
74
-
75
- getApprovedUsersForDataContract = (
76
- id: string,
77
- token: string | undefined,
78
- ): Promise<PlainObject<V1_DataContractApprovedUsersResponse>> =>
79
- this.get(
80
- `${this._dataContracts()}/${encodeURIComponent(id)}/approvedUsers`,
81
- {},
82
- this._token(token),
83
- );
84
-
85
- getContractUserStatus = (
86
- contractId: string,
87
- userId: string,
88
- token: string | undefined,
89
- ): Promise<PlainObject<V1_ContractUserStatusResponse>> =>
90
- this.get(
91
- `${this._dataContracts()}/${encodeURIComponent(contractId)}/user/${encodeURIComponent(userId)}`,
92
- {},
93
- this._token(token),
94
- );
95
-
96
- getDataContractsFromDID = (
97
- body: PlainObject<AppendMode>[],
98
- token: string | undefined,
99
- ): Promise<PlainObject<V1_DataContractsResponse>> => {
100
- return this.post(
101
- `${this._dataContracts()}/query/accessPointsOwnedByDeployments`,
102
- body,
103
- undefined,
104
- this._token(token),
105
- );
106
- };
107
-
108
- getPendingContracts = (
109
- user: string | undefined,
110
- token: string | undefined,
111
- ): Promise<PlainObject<V1_UserPendingContractsResponse>> => {
112
- return this.get(
113
- `${this._dataContracts()}/pendingContractsForUser`,
114
- {},
115
- this._token(token),
116
- { user },
117
- );
118
- };
119
-
120
- createContract = (
121
- contractRequest: PlainObject<V1_CreateContractPayload>,
122
- token: string | undefined,
123
- ): Promise<V1_DataContract> =>
124
- this.post(
125
- `${this._dataContracts()}`,
126
- contractRequest,
127
- undefined,
128
- this._token(token),
129
- );
130
-
131
- // ------------------------------------------- Tasks -------------------------------------------
132
-
133
- private _tasks = (): string => `${this.baseUrl}/datacontracts/tasks`;
134
- private _contract_tasks = (): string => `${this._tasks()}/query/contract`;
135
-
136
- getPendingTasks = (
137
- user: string | undefined,
138
- token: string | undefined,
139
- ): Promise<PlainObject<V1_PendingTasksResponse>> => {
140
- return this.get(`${this._tasks()}/pending`, {}, this._token(token), {
141
- user,
142
- });
143
- };
144
-
145
- getTask = (
146
- taskId: string,
147
- token: string | undefined,
148
- ): Promise<PlainObject<V1_PendingTasksResponse>> => {
149
- return this.get(
150
- `${this._tasks()}/${encodeURIComponent(taskId)}`,
151
- {},
152
- this._token(token),
153
- undefined,
154
- );
155
- };
156
-
157
- getContractTasks = (
158
- contractId: string,
159
- token: string | undefined,
160
- ): Promise<PlainObject<V1_TaskResponse>> => {
161
- return this.get(
162
- `${this._contract_tasks()}/${encodeURIComponent(contractId)}`,
163
- {},
164
- this._token(token),
165
- {
166
- user: contractId,
167
- },
168
- );
169
- };
170
-
171
- approveTask = (
172
- id: string,
173
- token: string | undefined,
174
- ): Promise<PlainObject<V1_TaskStatus>> =>
175
- this.post(
176
- `${this._tasks()}/${encodeURIComponent(id)}/approve`,
177
- {},
178
- {},
179
- this._token(token),
180
- );
181
-
182
- denyTask = (
183
- id: string,
184
- token: string | undefined,
185
- ): Promise<PlainObject<V1_TaskStatus>> =>
186
- this.post(
187
- `${this._tasks()}/${encodeURIComponent(id)}/deny`,
188
- {},
189
- {},
190
- this._token(token),
191
- );
192
-
193
- // --------------------------------------- Subscriptions ---------------------------------------
194
-
195
- private _subscriptions = (): string => `${this.baseUrl}/subscriptions`;
196
-
197
- getAllSubscriptions = (
198
- token: string | undefined,
199
- ): Promise<PlainObject<V1_DataSubscriptionResponse>> =>
200
- this.get(this._subscriptions(), {}, this._token(token));
201
-
202
- getSubscriptionsForContract = (
203
- contractId: string,
204
- token: string | undefined,
205
- ): Promise<PlainObject<V1_DataSubscriptionResponse>[]> =>
206
- this.get(
207
- `${this._subscriptions()}/query/contract/${contractId}`,
208
- {},
209
- this._token(token),
210
- );
211
-
212
- createSubscription = (
213
- input: PlainObject<V1_CreateSubscriptionInput>,
214
- token: string | undefined,
215
- ): Promise<PlainObject<V1_DataSubscriptionResponse>> =>
216
- this.post(this._subscriptions(), input, {}, this._token(token));
217
-
218
- // --------------------------------------- Data Products ---------------------------------------
219
-
220
- private _dataProducts = (): string => `${this.baseUrl}/dataproducts`;
221
-
222
- getDataProducts = (
223
- token: string | undefined,
224
- ): Promise<PlainObject<V1_EntitlementsDataProductDetailsResponse>> =>
225
- this.get(this._dataProducts(), {}, this._token(token));
226
-
227
- getDataProductByIdAndDID = (
228
- dataProductId: string,
229
- deploymentId: number,
230
- token: string | undefined,
231
- ): Promise<PlainObject<V1_EntitlementsDataProductDetailsResponse>> =>
232
- this.get(
233
- `${this._dataProducts()}/${dataProductId}/deployments/${deploymentId}`,
234
- {},
235
- this._token(token),
236
- );
237
- }