@nevermined-io/core-kit 0.0.49 → 0.0.51

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.
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentsApi.d.ts","sourceRoot":"","sources":["../../../src/nevermined/api/PaymentsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAoC,MAAM,MAAM,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,IAAI,EAA8B,MAAM,uBAAuB,CAAA;AAQrF,qBAAa,WAAY,SAAQ,YAAY;IAC3C;;;;OAIG;gBACS,MAAM,EAAE,kBAAkB;IAKzB,eAAe,CAAC,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAgB7E,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAChD,aAAa,EAAE,MAAM,CAAA;QACrB,WAAW,EAAE,MAAM,CAAA;QACnB,cAAc,EAAE,MAAM,CAAA;QACtB,WAAW,EAAE,MAAM,CAAA;QACnB,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC;IA4CW,gBAAgB,CAC3B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,GAAG,YAAY,GAC3B,OAAO,CAAC,WAAW,CAAC;IA0BV,kBAAkB,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,OAAO,GAAG,YAAY,EAC5B,YAAY,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,WAAW,CAAC;CAyFxB"}
1
+ {"version":3,"file":"PaymentsApi.d.ts","sourceRoot":"","sources":["../../../src/nevermined/api/PaymentsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAoC,MAAM,MAAM,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,IAAI,EAA8B,MAAM,uBAAuB,CAAA;AAQrF,qBAAa,WAAY,SAAQ,YAAY;IAC3C;;;;OAIG;gBACS,MAAM,EAAE,kBAAkB;IAKzB,eAAe,CAAC,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAgB7E,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAChD,aAAa,EAAE,MAAM,CAAA;QACrB,WAAW,EAAE,MAAM,CAAA;QACnB,cAAc,EAAE,MAAM,CAAA;QACtB,WAAW,EAAE,MAAM,CAAA;QACnB,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC;IA4CW,gBAAgB,CAC3B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,GAAG,YAAY,GAC3B,OAAO,CAAC,WAAW,CAAC;IAyBV,kBAAkB,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,OAAO,GAAG,YAAY,EAC5B,YAAY,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,WAAW,CAAC;CAyFxB"}
@@ -72,7 +72,6 @@ export class PaymentsApi extends Instantiable {
72
72
  async orderFiatPayment(planId, planReceiver, from) {
73
73
  const plan = await this.nevermined.contracts.assetRegistry.getPlan(planId);
74
74
  const totalAmount = plan.price.amounts.reduce((a, b) => a + b, 0n);
75
- // console.log(`Ordering fiat payment for planId ${planId} to ${planReceiver} from account ${from.address} `)
76
75
  this.logger.info(`Ordering fiat payment for planId ${planId} to ${planReceiver} from account ${from.address} `);
77
76
  const txHash = await this.nevermined.contracts.fiatPaymentTemplate.createAgreement(planId, planReceiver, from);
78
77
  const txReceipt = await this.nevermined.contracts.assetRegistry.getTransactionReceipt(txHash);
@@ -1 +1 @@
1
- {"version":3,"file":"AgentUtils.d.ts","sourceRoot":"","sources":["../../../src/nevermined/utils/AgentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,WAAW,EAAE,EAC7B,kBAAkB,GAAE,MAAM,EAAO,GAChC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,GAAG,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAoChE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAOvE"}
1
+ {"version":3,"file":"AgentUtils.d.ts","sourceRoot":"","sources":["../../../src/nevermined/utils/AgentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,WAAW,EAAE,EAC7B,kBAAkB,GAAE,MAAM,EAAO,GAChC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,GAAG,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAqChE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAOvE"}
@@ -6,17 +6,18 @@ export function isEndpointRequestedIncluded(requestEndpoint, requestedHTTPVerb,
6
6
  let urlMatching, verbMatching;
7
7
  const requestedUrl = new URL(requestEndpoint);
8
8
  // Is the endpoint an open endpoint?
9
- agentOpenEndpoints.forEach((openEndpoint) => {
9
+ for (const openEndpoint of agentOpenEndpoints) {
10
10
  const agentUrl = new URL(openEndpoint);
11
11
  if (areUrlsEqualIgnoringQuery(agentUrl, requestedUrl)) {
12
12
  urlMatching = new URL(openEndpoint);
13
13
  matches = true;
14
+ break;
14
15
  }
15
- });
16
+ }
16
17
  if (matches)
17
18
  return { matches: true, urlMatching };
18
19
  // check if the endpoint/verb is part of the list
19
- agentEndpoints.forEach((ep) => {
20
+ for (const ep of agentEndpoints) {
20
21
  const [verb, url] = Object.entries(ep)[0];
21
22
  const _url = new URL(url);
22
23
  const fn = match(_url.pathname, { decode: decodeURIComponent });
@@ -24,9 +25,9 @@ export function isEndpointRequestedIncluded(requestEndpoint, requestedHTTPVerb,
24
25
  matches = true;
25
26
  urlMatching = _url;
26
27
  verbMatching = verb;
27
- return;
28
+ break;
28
29
  }
29
- });
30
+ }
30
31
  return { matches, urlMatching, verbMatching };
31
32
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevermined-io/core-kit",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",