@finos/legend-server-marketplace 0.0.6 → 0.0.8

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.
@@ -0,0 +1,45 @@
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_ContractCreate_LegendDataProduct, V1_CreateSubscriptionInput, V1_DataContract, V1_DataContractsRecord, V1_DataSubscriptionResponse, V1_PendingTasksRespond, V1_TaskStatus, V1_UserPendingContractsResponse } 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 _contracts;
25
+ getDataProducts: (token?: string | undefined) => Promise<PlainObject[]>;
26
+ private _dataContracts;
27
+ getDataContracts: (token: string | undefined) => Promise<PlainObject<V1_DataContractsRecord>>;
28
+ getDataContract: (id: string, token: string | undefined) => Promise<PlainObject<V1_DataContractsRecord>>;
29
+ getApprovedUsersForDataContract: (id: string, token: string | undefined) => Promise<PlainObject<V1_DataContractsRecord>>;
30
+ getDataContractsFromDID: (body: PlainObject<AppendMode>[], token: string | undefined) => Promise<PlainObject<V1_DataContractsRecord>>;
31
+ getPendingContracts: (user: string | undefined, token: string | undefined) => Promise<PlainObject<V1_UserPendingContractsResponse>>;
32
+ createContract: (contractRequest: PlainObject<V1_ContractCreate_LegendDataProduct>, token: string | undefined) => Promise<V1_DataContract>;
33
+ private _tasks;
34
+ private _contract_tasks;
35
+ getPendingTasks: (user: string | undefined, token: string | undefined) => Promise<PlainObject<V1_PendingTasksRespond>>;
36
+ getTask: (taskId: string, token: string | undefined) => Promise<PlainObject<V1_PendingTasksRespond>>;
37
+ getContractTasks: (contractId: string, token: string | undefined) => Promise<PlainObject<V1_PendingTasksRespond>>;
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
+ }
45
+ //# sourceMappingURL=LakehouseContractServerClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LakehouseContractServerClient.d.ts","sourceRoot":"","sources":["../src/LakehouseContractServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,mCAAmC,EACnC,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,aAAa,EACb,+BAA+B,EAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE9E,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,6BAA8B,SAAQ,oBAAoB;gBACzD,MAAM,EAAE,mCAAmC;IAOvD,OAAO,CAAC,MAAM,CAEX;IAEH,OAAO,CAAC,UAAU,CAA6C;IAE/D,e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AAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,CAS7C;IAEF,WAAW,GACT,IAAI,MAAM,EACV,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAMlC;IAEJ,QAAQ,GACN,IAAI,MAAM,EACV,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAMlC;IAIJ,OAAO,CAAC,cAAc,CAAiD;IAEvE,mBAAmB,GACjB,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,2BAA2B,CAAC,EAAE,CAAC,CACI;IAE1D,2BAA2B,GACzB,YAAY,MAAM,EAClB,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAKlD;IAEJ,kBAAkB,GAChB,OAAO,WAAW,CAAC,0BAA0B,CAAC,EAC9C,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CACc;CACnE"}
@@ -0,0 +1,65 @@
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
+ _contracts = () => `${this.baseUrl}/contracts`;
28
+ getDataProducts = (token) => this.get(`${this._contracts()}/dataProducts`, {}, this._token(token));
29
+ // ------------------------------------------- Data Contracts -------------------------------------------
30
+ _dataContracts = () => `${this.baseUrl}/datacontracts`;
31
+ getDataContracts = (token) => this.get(this._dataContracts(), {}, this._token(token));
32
+ getDataContract = (id, token) => this.get(`${this._dataContracts()}/${encodeURIComponent(id)}`, {}, this._token(token));
33
+ getApprovedUsersForDataContract = (id, token) => this.get(`${this._dataContracts()}/${encodeURIComponent(id)}/approvedUsers`, {}, 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()}/alloyDataProduct`, 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
+ }
65
+ //# sourceMappingURL=LakehouseContractServerClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LakehouseContractServerClient.js","sourceRoot":"","sources":["../src/LakehouseContractServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,OAAO,EAAE,oBAAoB,EAAoB,MAAM,sBAAsB,CAAC;AAM9E,MAAM,OAAO,6BAA8B,SAAQ,oBAAoB;IACrE,YAAY,MAA2C;QACrD,KAAK,CAAC;YACJ,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;IACC,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;QACpC,aAAa,EAAE,UAAU,KAAK,EAAE;KACjC,CAAC,CAAC;IAEK,UAAU,GAAG,GAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,YAAY,CAAC;IAE/D,eAAe,GAAG,CAAC,KAA0B,EAA0B,EAAE,CACvE,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,eAAe,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAExE,yGAAyG;IAEjG,cAAc,GAAG,GAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,gBAAgB,CAAC;IAEvE,gBAAgB,GAAG,CACjB,KAAyB,EACqB,EAAE,CAChD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1D,eAAe,GAAG,CAChB,EAAU,EACV,KAAyB,EACqB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AAgG;IAExF,cAAc,GAAG,GAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,gBAAgB,CAAC;IAEvE,mBAAmB,GAAG,CACpB,KAAyB,EAC4B,EAAE,CACvD,IAAI,CAAC,GAAG,CAAC,IAAI,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;CACnE"}
@@ -0,0 +1,25 @@
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_IngestEnvironment, V1_SandboxDataProductDeploymentResponse } from '@finos/legend-graph';
17
+ import { AbstractServerClient, type PlainObject } from '@finos/legend-shared';
18
+ export declare class LakehouseIngestServerClient extends AbstractServerClient {
19
+ constructor();
20
+ private _token;
21
+ private _deploy;
22
+ getDeployedIngestDefinitions: (ingestServerUrl: string, token: string | undefined) => Promise<PlainObject<V1_SandboxDataProductDeploymentResponse>>;
23
+ getIngestEnvironment: (ingestServerUrl: string, token: string | undefined) => Promise<PlainObject<V1_IngestEnvironment>>;
24
+ }
25
+ //# sourceMappingURL=LakehouseIngestServerClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LakehouseIngestServerClient.d.ts","sourceRoot":"","sources":["../src/LakehouseIngestServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,uCAAuC,EACxC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE9E,qBAAa,2BAA4B,SAAQ,oBAAoB;;IAMnE,OAAO,CAAC,MAAM,CAEX;IAIH,OAAO,CAAC,OAAO,CAAsD;IAErE,4BAA4B,GAC1B,iBAAiB,MAAM,EACvB,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,uCAAuC,CAAC,CAAC,CAK5D;IAIJ,oBAAoB,GAClB,iBAAiB,MAAM,EACvB,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAKzC;CACL"}
@@ -0,0 +1,31 @@
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 LakehouseIngestServerClient extends AbstractServerClient {
18
+ constructor() {
19
+ super({});
20
+ }
21
+ // auth
22
+ _token = (token) => ({
23
+ Authorization: `Bearer ${token}`,
24
+ });
25
+ // ------------------------------------------- Deploy -------------------------------------------
26
+ _deploy = () => `data-product/api/entitlements/sdlc`;
27
+ getDeployedIngestDefinitions = (ingestServerUrl, token) => this.get(`${ingestServerUrl}/${this._deploy()}/deploy/definitions`, {}, this._token(token));
28
+ // ------------------------------------- Invest Environment ----p---------------------------------
29
+ getIngestEnvironment = (ingestServerUrl, token) => this.get(`${ingestServerUrl}/api/ingest/catalog-state/environment`, {}, this._token(token));
30
+ }
31
+ //# sourceMappingURL=LakehouseIngestServerClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LakehouseIngestServerClient.js","sourceRoot":"","sources":["../src/LakehouseIngestServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EAAE,oBAAoB,EAAoB,MAAM,sBAAsB,CAAC;AAE9E,MAAM,OAAO,2BAA4B,SAAQ,oBAAoB;IACnE;QACE,KAAK,CAAC,EAAE,CAAC,CAAC;IACZ,CAAC;IAED,OAAO;IACC,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;QACpC,aAAa,EAAE,UAAU,KAAK,EAAE;KACjC,CAAC,CAAC;IAEH,iGAAiG;IAEzF,OAAO,GAAG,GAAW,EAAE,CAAC,oCAAoC,CAAC;IAErE,4BAA4B,GAAG,CAC7B,eAAuB,EACvB,KAAyB,EACsC,EAAE,CACjE,IAAI,CAAC,GAAG,CACN,GAAG,eAAe,IAAI,IAAI,CAAC,OAAO,EAAE,qBAAqB,EACzD,EAAE,EACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CACnB,CAAC;IAEJ,kGAAkG;IAElG,oBAAoB,GAAG,CACrB,eAAuB,EACvB,KAAyB,EACmB,EAAE,CAC9C,IAAI,CAAC,GAAG,CACN,GAAG,eAAe,uCAAuC,EACzD,EAAE,EACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CACnB,CAAC;CACL"}
@@ -0,0 +1,28 @@
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_LakehouseDiscoveryEnvironmentResponse } from '@finos/legend-graph';
17
+ import { AbstractServerClient, type PlainObject } from '@finos/legend-shared';
18
+ export interface LakehousePlatformServerClientConfig {
19
+ baseUrl: string;
20
+ }
21
+ export declare class LakehousePlatformServerClient extends AbstractServerClient {
22
+ constructor(config: LakehousePlatformServerClientConfig);
23
+ private _token;
24
+ private _discovery;
25
+ getIngestEnvironmentSummaries: (token: string | undefined) => Promise<PlainObject<V1_LakehouseDiscoveryEnvironmentResponse>[]>;
26
+ getIngestEnvironmentSummary: (ingestEnvironmentUrn: string, token: string | undefined) => Promise<PlainObject<V1_LakehouseDiscoveryEnvironmentResponse>>;
27
+ }
28
+ //# sourceMappingURL=LakehousePlatformServerClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LakehousePlatformServerClient.d.ts","sourceRoot":"","sources":["../src/LakehousePlatformServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,wCAAwC,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE9E,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,6BAA8B,SAAQ,oBAAoB;gBACzD,MAAM,EAAE,mCAAmC;IAOvD,OAAO,CAAC,MAAM,CAEX;IAIH,OAAO,CAAC,UAAU,CAAoD;IAEtE,6BAA6B,GAC3B,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,wCAAwC,CAAC,EAAE,CAAC,CACK;IAExE,2BAA2B,GACzB,sBAAsB,MAAM,EAC5B,OAAO,MAAM,GAAG,SAAS,KACxB,OAAO,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAC,CAK7D;CACL"}
@@ -0,0 +1,33 @@
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 {} from '@finos/legend-graph';
17
+ import { AbstractServerClient } from '@finos/legend-shared';
18
+ export class LakehousePlatformServerClient extends AbstractServerClient {
19
+ constructor(config) {
20
+ super({
21
+ baseUrl: config.baseUrl,
22
+ });
23
+ }
24
+ // auth
25
+ _token = (token) => ({
26
+ Authorization: `Bearer ${token}`,
27
+ });
28
+ // ------------------------------------------- Discovery -------------------------------------------
29
+ _discovery = () => `${this.baseUrl}/ingest/discovery`;
30
+ getIngestEnvironmentSummaries = (token) => this.get(`${this._discovery()}/environments`, {}, this._token(token));
31
+ getIngestEnvironmentSummary = (ingestEnvironmentUrn, token) => this.get(`${this._discovery()}/environments/${ingestEnvironmentUrn}`, {}, this._token(token));
32
+ }
33
+ //# sourceMappingURL=LakehousePlatformServerClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LakehousePlatformServerClient.js","sourceRoot":"","sources":["../src/LakehousePlatformServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAiD,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAoB,MAAM,sBAAsB,CAAC;AAM9E,MAAM,OAAO,6BAA8B,SAAQ,oBAAoB;IACrE,YAAY,MAA2C;QACrD,KAAK,CAAC;YACJ,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;IACC,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC;QACpC,aAAa,EAAE,UAAU,KAAK,EAAE;KACjC,CAAC,CAAC;IAEH,oGAAoG;IAE5F,UAAU,GAAG,GAAW,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,mBAAmB,CAAC;IAEtE,6BAA6B,GAAG,CAC9B,KAAyB,EACyC,EAAE,CACpE,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,eAAe,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAExE,2BAA2B,GAAG,CAC5B,oBAA4B,EAC5B,KAAyB,EACuC,EAAE,CAClE,IAAI,CAAC,GAAG,CACN,GAAG,IAAI,CAAC,UAAU,EAAE,iBAAiB,oBAAoB,EAAE,EAC3D,EAAE,EACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CACnB,CAAC;CACL"}
package/lib/index.d.ts CHANGED
@@ -16,5 +16,8 @@
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
+ export { LakehouseIngestServerClient } from './LakehouseIngestServerClient.js';
21
+ export { LakehousePlatformServerClient } from './LakehousePlatformServerClient.js';
19
22
  export { MarketplaceServerClient } from './MarketplaceServerClient.js';
20
23
  //# 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,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;AAEzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
package/lib/index.js CHANGED
@@ -16,5 +16,8 @@
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
+ export { LakehouseIngestServerClient } from './LakehouseIngestServerClient.js';
21
+ export { LakehousePlatformServerClient } from './LakehousePlatformServerClient.js';
19
22
  export { MarketplaceServerClient } from './MarketplaceServerClient.js';
20
23
  //# 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,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;AAEzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,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.6",
3
+ "version": "0.0.8",
4
4
  "description": "Legend Marketplace server client",
5
5
  "keywords": [
6
6
  "legend",
@@ -38,6 +38,7 @@
38
38
  "test:watch": "jest --watch"
39
39
  },
40
40
  "dependencies": {
41
+ "@finos/legend-graph": "workspace:*",
41
42
  "@finos/legend-shared": "workspace:*",
42
43
  "serializr": "3.0.3"
43
44
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-server-marketplace",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Legend Marketplace server client",
5
5
  "keywords": [
6
6
  "legend",
@@ -38,6 +38,7 @@
38
38
  "test:watch": "jest --watch"
39
39
  },
40
40
  "dependencies": {
41
+ "@finos/legend-graph": "32.1.37",
41
42
  "@finos/legend-shared": "11.0.13",
42
43
  "serializr": "3.0.3"
43
44
  },
@@ -0,0 +1,200 @@
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_ContractCreate_LegendDataProduct,
19
+ V1_CreateSubscriptionInput,
20
+ V1_DataContract,
21
+ V1_DataContractsRecord,
22
+ V1_DataSubscriptionResponse,
23
+ V1_PendingTasksRespond,
24
+ V1_TaskStatus,
25
+ V1_UserPendingContractsResponse,
26
+ } from '@finos/legend-graph';
27
+ import { AbstractServerClient, type PlainObject } from '@finos/legend-shared';
28
+
29
+ export interface LakehouseContractServerClientConfig {
30
+ baseUrl: string;
31
+ }
32
+
33
+ export class LakehouseContractServerClient extends AbstractServerClient {
34
+ constructor(config: LakehouseContractServerClientConfig) {
35
+ super({
36
+ baseUrl: config.baseUrl,
37
+ });
38
+ }
39
+
40
+ // auth
41
+ private _token = (token?: string) => ({
42
+ Authorization: `Bearer ${token}`,
43
+ });
44
+
45
+ private _contracts = (): string => `${this.baseUrl}/contracts`;
46
+
47
+ getDataProducts = (token?: string | undefined): Promise<PlainObject[]> =>
48
+ this.get(`${this._contracts()}/dataProducts`, {}, this._token(token));
49
+
50
+ // ------------------------------------------- Data Contracts -------------------------------------------
51
+
52
+ private _dataContracts = (): string => `${this.baseUrl}/datacontracts`;
53
+
54
+ getDataContracts = (
55
+ token: string | undefined,
56
+ ): Promise<PlainObject<V1_DataContractsRecord>> =>
57
+ this.get(this._dataContracts(), {}, this._token(token));
58
+
59
+ getDataContract = (
60
+ id: string,
61
+ token: string | undefined,
62
+ ): Promise<PlainObject<V1_DataContractsRecord>> =>
63
+ this.get(
64
+ `${this._dataContracts()}/${encodeURIComponent(id)}`,
65
+ {},
66
+ this._token(token),
67
+ );
68
+
69
+ getApprovedUsersForDataContract = (
70
+ id: string,
71
+ token: string | undefined,
72
+ ): Promise<PlainObject<V1_DataContractsRecord>> =>
73
+ this.get(
74
+ `${this._dataContracts()}/${encodeURIComponent(id)}/approvedUsers`,
75
+ {},
76
+ this._token(token),
77
+ );
78
+
79
+ getDataContractsFromDID = (
80
+ body: PlainObject<AppendMode>[],
81
+ token: string | undefined,
82
+ ): Promise<PlainObject<V1_DataContractsRecord>> => {
83
+ return this.post(
84
+ `${this._dataContracts()}/query/accessPointsOwnedByDeployments`,
85
+ body,
86
+ undefined,
87
+ this._token(token),
88
+ );
89
+ };
90
+
91
+ getPendingContracts = (
92
+ user: string | undefined,
93
+ token: string | undefined,
94
+ ): Promise<PlainObject<V1_UserPendingContractsResponse>> => {
95
+ return this.get(
96
+ `${this._dataContracts()}/pendingContractsForUser`,
97
+ {},
98
+ this._token(token),
99
+ { user },
100
+ );
101
+ };
102
+
103
+ createContract = (
104
+ contractRequest: PlainObject<V1_ContractCreate_LegendDataProduct>,
105
+ token: string | undefined,
106
+ ): Promise<V1_DataContract> =>
107
+ this.post(
108
+ `${this._dataContracts()}/alloyDataProduct`,
109
+ contractRequest,
110
+ undefined,
111
+ this._token(token),
112
+ );
113
+
114
+ // ------------------------------------------- Tasks -------------------------------------------
115
+
116
+ private _tasks = (): string => `${this.baseUrl}/datacontracts/tasks`;
117
+ private _contract_tasks = (): string => `${this._tasks()}/query/contract`;
118
+
119
+ getPendingTasks = (
120
+ user: string | undefined,
121
+ token: string | undefined,
122
+ ): Promise<PlainObject<V1_PendingTasksRespond>> => {
123
+ return this.get(`${this._tasks()}/pending`, {}, this._token(token), {
124
+ user,
125
+ });
126
+ };
127
+
128
+ getTask = (
129
+ taskId: string,
130
+ token: string | undefined,
131
+ ): Promise<PlainObject<V1_PendingTasksRespond>> => {
132
+ return this.get(
133
+ `${this._tasks()}/${encodeURIComponent(taskId)}`,
134
+ {},
135
+ this._token(token),
136
+ undefined,
137
+ );
138
+ };
139
+
140
+ getContractTasks = (
141
+ contractId: string,
142
+ token: string | undefined,
143
+ ): Promise<PlainObject<V1_PendingTasksRespond>> => {
144
+ return this.get(
145
+ `${this._contract_tasks()}/${encodeURIComponent(contractId)}`,
146
+ {},
147
+ this._token(token),
148
+ {
149
+ user: contractId,
150
+ },
151
+ );
152
+ };
153
+
154
+ approveTask = (
155
+ id: string,
156
+ token: string | undefined,
157
+ ): Promise<PlainObject<V1_TaskStatus>> =>
158
+ this.post(
159
+ `${this._tasks()}/${encodeURIComponent(id)}/approve`,
160
+ {},
161
+ {},
162
+ this._token(token),
163
+ );
164
+
165
+ denyTask = (
166
+ id: string,
167
+ token: string | undefined,
168
+ ): Promise<PlainObject<V1_TaskStatus>> =>
169
+ this.post(
170
+ `${this._tasks()}/${encodeURIComponent(id)}/deny`,
171
+ {},
172
+ {},
173
+ this._token(token),
174
+ );
175
+
176
+ // --------------------------------------- Subscriptions ---------------------------------------
177
+
178
+ private _subscriptions = (): string => `${this.baseUrl}/subscriptions`;
179
+
180
+ getAllSubscriptions = (
181
+ token: string | undefined,
182
+ ): Promise<PlainObject<V1_DataSubscriptionResponse>[]> =>
183
+ this.get(this._subscriptions(), {}, this._token(token));
184
+
185
+ getSubscriptionsForContract = (
186
+ contractId: string,
187
+ token: string | undefined,
188
+ ): Promise<PlainObject<V1_DataSubscriptionResponse>[]> =>
189
+ this.get(
190
+ `${this._subscriptions()}/query/contract/${contractId}`,
191
+ {},
192
+ this._token(token),
193
+ );
194
+
195
+ createSubscription = (
196
+ input: PlainObject<V1_CreateSubscriptionInput>,
197
+ token: string | undefined,
198
+ ): Promise<PlainObject<V1_DataSubscriptionResponse>> =>
199
+ this.post(this._subscriptions(), input, {}, this._token(token));
200
+ }
@@ -0,0 +1,58 @@
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_IngestEnvironment,
19
+ V1_SandboxDataProductDeploymentResponse,
20
+ } from '@finos/legend-graph';
21
+ import { AbstractServerClient, type PlainObject } from '@finos/legend-shared';
22
+
23
+ export class LakehouseIngestServerClient extends AbstractServerClient {
24
+ constructor() {
25
+ super({});
26
+ }
27
+
28
+ // auth
29
+ private _token = (token?: string) => ({
30
+ Authorization: `Bearer ${token}`,
31
+ });
32
+
33
+ // ------------------------------------------- Deploy -------------------------------------------
34
+
35
+ private _deploy = (): string => `data-product/api/entitlements/sdlc`;
36
+
37
+ getDeployedIngestDefinitions = (
38
+ ingestServerUrl: string,
39
+ token: string | undefined,
40
+ ): Promise<PlainObject<V1_SandboxDataProductDeploymentResponse>> =>
41
+ this.get(
42
+ `${ingestServerUrl}/${this._deploy()}/deploy/definitions`,
43
+ {},
44
+ this._token(token),
45
+ );
46
+
47
+ // ------------------------------------- Invest Environment ----p---------------------------------
48
+
49
+ getIngestEnvironment = (
50
+ ingestServerUrl: string,
51
+ token: string | undefined,
52
+ ): Promise<PlainObject<V1_IngestEnvironment>> =>
53
+ this.get(
54
+ `${ingestServerUrl}/api/ingest/catalog-state/environment`,
55
+ {},
56
+ this._token(token),
57
+ );
58
+ }
@@ -0,0 +1,54 @@
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 V1_LakehouseDiscoveryEnvironmentResponse } from '@finos/legend-graph';
18
+ import { AbstractServerClient, type PlainObject } from '@finos/legend-shared';
19
+
20
+ export interface LakehousePlatformServerClientConfig {
21
+ baseUrl: string;
22
+ }
23
+
24
+ export class LakehousePlatformServerClient extends AbstractServerClient {
25
+ constructor(config: LakehousePlatformServerClientConfig) {
26
+ super({
27
+ baseUrl: config.baseUrl,
28
+ });
29
+ }
30
+
31
+ // auth
32
+ private _token = (token?: string) => ({
33
+ Authorization: `Bearer ${token}`,
34
+ });
35
+
36
+ // ------------------------------------------- Discovery -------------------------------------------
37
+
38
+ private _discovery = (): string => `${this.baseUrl}/ingest/discovery`;
39
+
40
+ getIngestEnvironmentSummaries = (
41
+ token: string | undefined,
42
+ ): Promise<PlainObject<V1_LakehouseDiscoveryEnvironmentResponse>[]> =>
43
+ this.get(`${this._discovery()}/environments`, {}, this._token(token));
44
+
45
+ getIngestEnvironmentSummary = (
46
+ ingestEnvironmentUrn: string,
47
+ token: string | undefined,
48
+ ): Promise<PlainObject<V1_LakehouseDiscoveryEnvironmentResponse>> =>
49
+ this.get(
50
+ `${this._discovery()}/environments/${ingestEnvironmentUrn}`,
51
+ {},
52
+ this._token(token),
53
+ );
54
+ }
package/src/index.ts CHANGED
@@ -18,4 +18,7 @@ export * from './models/DataProduct.js';
18
18
  export * from './models/Provider.js';
19
19
  export * from './models/Subscription.js';
20
20
 
21
+ export { LakehouseContractServerClient } from './LakehouseContractServerClient.js';
22
+ export { LakehouseIngestServerClient } from './LakehouseIngestServerClient.js';
23
+ export { LakehousePlatformServerClient } from './LakehousePlatformServerClient.js';
21
24
  export { MarketplaceServerClient } from './MarketplaceServerClient.js';
package/tsconfig.json CHANGED
@@ -51,6 +51,9 @@
51
51
  }
52
52
  ],
53
53
  "files": [
54
+ "./src/LakehouseContractServerClient.ts",
55
+ "./src/LakehouseIngestServerClient.ts",
56
+ "./src/LakehousePlatformServerClient.ts",
54
57
  "./src/MarketplaceServerClient.ts",
55
58
  "./src/index.ts",
56
59
  "./src/models/DataProduct.ts",