@nevermined-io/payments 0.8.2 → 0.8.4

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,4 +1,4 @@
1
- import { Endpoint } from '../payments';
1
+ import { Endpoint } from './types';
2
2
  export declare const sleep: (ms: number) => Promise<unknown>;
3
3
  export declare const jsonReplacer: (_key: any, value: {
4
4
  toString: () => any;
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/common/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,eAAO,MAAM,KAAK,OAAQ,MAAM,qBAAsD,CAAA;AAEtF,eAAO,MAAM,YAAY,SAAU,GAAG,SAAS;IAAE,QAAQ,EAAE,MAAM,GAAG,CAAA;CAAE;cAAX,MAAM,GAAG;CAEnE,CAAA;AAED,eAAO,MAAM,2BAA2B,cAAe,QAAQ,EAAE,KAAG,MAOnE,CAAA"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/common/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,eAAO,MAAM,KAAK,OAAQ,MAAM,qBAAsD,CAAA;AAEtF,eAAO,MAAM,YAAY,SAAU,GAAG,SAAS;IAAE,QAAQ,EAAE,MAAM,GAAG,CAAA;CAAE;cAAX,MAAM,GAAG;CAEnE,CAAA;AAED,eAAO,MAAM,2BAA2B,cAAe,QAAQ,EAAE,KAAG,MAOnE,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { EnvironmentName } from '../environments';
1
2
  export declare const FIRST_STEP_NAME = "init";
2
3
  /**
3
4
  * A task defines something that the agent should execute.
@@ -164,6 +165,35 @@ export interface TaskLogMessage {
164
165
  step_id?: string;
165
166
  }
166
167
  export type TaskCallback = (data: any) => void;
168
+ /**
169
+ * Options to initialize the Payments class.
170
+ */
171
+ export interface PaymentOptions {
172
+ /**
173
+ * The Nevermined environment to connect to.
174
+ * If you are developing an agent it's recommended to use the "testing" environment.
175
+ * When deploying to production use the "arbitrum" environment.
176
+ */
177
+ environment: EnvironmentName;
178
+ /**
179
+ * The Nevermined API Key. This key identify your user and is required to interact with the Nevermined API.
180
+ * You can get your API key by logging in to the Nevermined App.
181
+ * @see https://docs.nevermined.app/docs/tutorials/integration/nvm-api-keys
182
+ */
183
+ nvmApiKey?: string;
184
+ /**
185
+ * The URL to return to the app after a successful login.
186
+ */
187
+ returnUrl?: string;
188
+ /**
189
+ * The app id. This attribute is optional and helps to associate assets registered into Nevermined with a common identifier.
190
+ */
191
+ appId?: string;
192
+ /**
193
+ * The version of the API to use.
194
+ */
195
+ version?: string;
196
+ }
167
197
  export interface CreateTaskDto {
168
198
  /**
169
199
  * The query parameter for the task
@@ -184,4 +214,225 @@ export interface CreateTaskDto {
184
214
  */
185
215
  artifacts?: Artifact[];
186
216
  }
217
+ export interface Endpoint {
218
+ [verb: string]: string;
219
+ }
220
+ export interface CreatePlanTimeDto {
221
+ /**
222
+ * The name of the plan.
223
+ */
224
+ name: string;
225
+ /**
226
+ * A description of what the plan offers.
227
+ */
228
+ description: string;
229
+ /**
230
+ * The price of the plan. It must be given in the lowest denomination of the currency.
231
+ */
232
+ price: bigint;
233
+ /**
234
+ * The address of the ERC20 contract used for the payment. Using the `ZeroAddress` will use the chain's native currency instead.
235
+ */
236
+ tokenAddress: string;
237
+ /**
238
+ * The duration of the plan in days. If `duration` is left undefined an unlimited time duration subscription will be created.
239
+ */
240
+ duration?: number;
241
+ /**
242
+ * An array of tags or keywords that best fit the subscription.
243
+ */
244
+ tags?: string[];
245
+ }
246
+ export interface CreatePlanCreditsDto {
247
+ /**
248
+ * The name of the plan.
249
+ */
250
+ name: string;
251
+ /**
252
+ * A description of what the plan offers.
253
+ */
254
+ description: string;
255
+ /**
256
+ * The price of the plan. It must be given in the lowest denomination of the currency.
257
+ */
258
+ price: bigint;
259
+ /**
260
+ * The address of the ERC20 contract used for the payment. Using the `ZeroAddress` will use the chain's native currency instead.
261
+ */
262
+ tokenAddress: string;
263
+ /**
264
+ * The number of credits that are transferred to the user when purchases the plan.
265
+ */
266
+ amountOfCredits: number;
267
+ /**
268
+ * An array of tags or keywords that best fit the subscription.
269
+ */
270
+ tags?: string[];
271
+ }
272
+ export interface CreateServiceDto {
273
+ /**
274
+ * The service type ('service', 'agent', or 'assistant').
275
+ */
276
+ serviceType: string;
277
+ /**
278
+ * The plan unique identifier of the Plan (DID). @see {@link createCreditsPlan} or {@link createTimePlan}
279
+ */
280
+ planDID: string;
281
+ /**
282
+ * The name of the AI Agent/Service.
283
+ */
284
+ name: string;
285
+ /**
286
+ * The description of the AI Agent/Service.
287
+ */
288
+ description: string;
289
+ /**
290
+ * If the agent is using the AI Hub. If true, the agent will be configured to use the AI Hub endpoints.
291
+ */
292
+ usesAIHub?: boolean;
293
+ /**
294
+ * It the agent implements the Nevermined Query Protocol. @see https://docs.nevermined.io/docs/protocol/query-protocol
295
+ */
296
+ implementsQueryProtocol?: boolean;
297
+ /**
298
+ * The service charge type ('fixed' or 'dynamic').
299
+ */
300
+ serviceChargeType: 'fixed' | 'dynamic';
301
+ /**
302
+ * The upstream agent/service authentication type ('none', 'basic', 'bearer' or 'oauth').
303
+ */
304
+ authType?: 'none' | 'basic' | 'oauth' | 'bearer';
305
+ /**
306
+ * The amount of credits to charge per request to the agent.
307
+ */
308
+ amountOfCredits?: number;
309
+ /**
310
+ * The minimum credits to charge.
311
+ */
312
+ minCreditsToCharge?: number;
313
+ /**
314
+ * The maximum credits to charge.
315
+ */
316
+ maxCreditsToCharge?: number;
317
+ /**
318
+ * The upstream agent/service username for authentication. Only if `authType` is 'basic'.
319
+ */
320
+ username?: string;
321
+ /**
322
+ * The upstream agent/service password for authentication. Only if `authType` is 'basic'.
323
+ */
324
+ password?: string;
325
+ /**
326
+ * The upstream agent/service bearer token for authentication. Only if `authType` is 'bearer' or 'oauth'.
327
+ */
328
+ token?: string;
329
+ /**
330
+ * The list endpoints of the upstream service. All these endpoints are protected and only accessible to subscribers of the Payment Plan.
331
+ */
332
+ endpoints?: Endpoint[];
333
+ /**
334
+ * The list of endpoints of the upstream service that publicly available. The access to these endpoints don't require subscription to the Payment Plan. They are useful to expose documentation, etc.
335
+ */
336
+ openEndpoints?: string[];
337
+ /**
338
+ * The URL to the OpenAPI description of the Upstream API. The access to the OpenAPI definition don't require subscription to the Payment Plan.
339
+ */
340
+ openApiUrl?: string;
341
+ /**
342
+ * Some description or instructions about how to integrate the Agent.
343
+ */
344
+ integration?: string;
345
+ /**
346
+ * A link to some same usage of the Agent.
347
+ */
348
+ sampleLink?: string;
349
+ /**
350
+ * Text describing the API of the Agent.
351
+ */
352
+ apiDescription?: string;
353
+ /**
354
+ * The curation details.
355
+ */
356
+ curation?: object;
357
+ /**
358
+ * The tags describing the AI Agent/Service.
359
+ */
360
+ tags?: string[];
361
+ }
362
+ export type CreateAgentDto = Omit<CreateServiceDto, 'serviceType'>;
363
+ export type CreateFileDto = {
364
+ /**
365
+ * The plan unique identifier of the Plan (DID). @see {@link createCreditsPlan} or {@link createTimePlan}
366
+ */
367
+ planDID: string;
368
+ /**
369
+ * @param assetType - The type of asset ('dataset' | 'algorithm' | 'model' | 'file' | 'other')
370
+ *
371
+ */
372
+ assetType: 'dataset' | 'algorithm' | 'model' | 'file' | 'other';
373
+ /**
374
+ * The name of the file.
375
+ */
376
+ name: string;
377
+ /**
378
+ * The description of the file.
379
+ */
380
+ description: string;
381
+ /**
382
+ * The array of files that can be downloaded for users that are subscribers of the Payment Plan.
383
+ */
384
+ files: object[];
385
+ /**
386
+ * The data schema of the files.
387
+ */
388
+ dataSchema?: string;
389
+ /**
390
+ * Some sample code related to the file.
391
+ */
392
+ sampleCode?: string;
393
+ /**
394
+ * The format of the files.
395
+ */
396
+ filesFormat?: string;
397
+ /**
398
+ * The usage example.
399
+ */
400
+ usageExample?: string;
401
+ /**
402
+ * The programming language used in the files.
403
+ */
404
+ programmingLanguage?: string;
405
+ /**
406
+ * The framework used for creating the file.
407
+ */
408
+ framework?: string;
409
+ /**
410
+ * The task creating the file.
411
+ */
412
+ task?: string;
413
+ /**
414
+ * The training details.
415
+ */
416
+ trainingDetails?: string;
417
+ /**
418
+ * The variations.
419
+ */
420
+ variations?: string;
421
+ /**
422
+ * Indicates if the file is fine-tunable.
423
+ */
424
+ fineTunable?: boolean;
425
+ /**
426
+ * The cost in credits of downloading a file. This parameter is only required if the Payment Plan attached to the file is based on credits.
427
+ */
428
+ amountOfCredits?: number;
429
+ /**
430
+ * The curation object.
431
+ */
432
+ curation?: object;
433
+ /**
434
+ * The array of tags describing the file.
435
+ */
436
+ tags?: string[];
437
+ };
187
438
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,SAAS,CAAA;AAErC;;GAEG;AACH,MAAM,WAAW,IAAK,SAAQ,gBAAgB;IAC5C;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,WAAW,EAAE,oBAAoB,CAAA;IAEjC;;OAEG;IACH,KAAK,EAAE,IAAI,EAAE,CAAA;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,IAAK,SAAQ,gBAAgB;IAC5C;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,WAAW,EAAE,oBAAoB,CAAA;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,eAAe;IACvE;;OAEG;IACH,UAAU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;IAEnB;;OAEG;IACH,mDAA2B,CAAA;IAE3B;;OAEG;IACH,+CAAuB,CAAA;IAEvB;;OAEG;IACH,+CAAuB,CAAA;IAEvB;;OAEG;IACH,yCAAiB,CAAA;AACnB,CAAC,EAzBW,oBAAoB,oCAApB,oBAAoB,QAyB/B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAG,MAAM,CAAA;AA0HrC;;GAEG;AACH,IAAY,oBAyBX;AAzBD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,2CAAmB,CAAA;IAEnB;;OAEG;IACH,mDAA2B,CAAA;IAE3B;;OAEG;IACH,+CAAuB,CAAA;IAEvB;;OAEG;IACH,+CAAuB,CAAA;IAEvB;;OAEG;IACH,yCAAiB,CAAA;AACnB,CAAC,EAzBW,oBAAoB,oCAApB,oBAAoB,QAyB/B"}
@@ -5,7 +5,7 @@ export interface EnvironmentInfo {
5
5
  proxy: string;
6
6
  }
7
7
  export declare const ZeroAddress = "0x0000000000000000000000000000000000000000";
8
- export type EnvironmentName = 'local' | 'staging' | 'testing' | 'arbitrum' | 'peaq' | 'custom';
8
+ export type EnvironmentName = 'local' | 'staging' | 'testing' | 'arbitrum' | 'peaq' | 'base' | 'custom';
9
9
  /**
10
10
  * Represents the different environments and their corresponding URLs.
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../src/environments.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,WAAW,+CAA+C,CAAA;AAEvE,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE9F;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,eAAe,CAuDjE,CAAA"}
1
+ {"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../src/environments.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,WAAW,+CAA+C,CAAA;AAEvE,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,SAAS,GACT,SAAS,GACT,UAAU,GACV,MAAM,GACN,MAAM,GACN,QAAQ,CAAA;AAEZ;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,eAAe,CA6DjE,CAAA"}
@@ -51,6 +51,12 @@ exports.Environments = {
51
51
  websocketBackend: 'wss://one-backend.peaq.nevermined.app',
52
52
  proxy: 'https://proxy.peaq.nevermined.app',
53
53
  },
54
+ base: {
55
+ frontend: 'https://base.nevermined.app',
56
+ backend: 'https://one-backend.base.nevermined.app',
57
+ websocketBackend: 'wss://one-backend.base.nevermined.app',
58
+ proxy: 'https://proxy.base.nevermined.app',
59
+ },
54
60
  /**
55
61
  * A custom environment URLs.
56
62
  */
@@ -1 +1 @@
1
- {"version":3,"file":"environments.js","sourceRoot":"","sources":["../src/environments.ts"],"names":[],"mappings":";;;AAOa,QAAA,WAAW,GAAG,4CAA4C,CAAA;AAIvE;;GAEG;AACU,QAAA,YAAY,GAA6C;IACpE;;OAEG;IACH,KAAK,EAAE;QACL,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,uBAAuB;QAChC,gBAAgB,EAAE,qBAAqB;QACvC,KAAK,EAAE,uBAAuB;KAC/B;IACD;;OAEG;IACH,OAAO,EAAE;QACP,QAAQ,EAAE,gCAAgC;QAC1C,OAAO,EAAE,4CAA4C;QACrD,g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KAC9C;IACD;;OAEG;IACH,OAAO,EAAE;QACP,QAAQ,EAAE,gCAAgC;QAC1C,OAAO,EAAE,4CAA4C;QACrD,gBAAgB,EAAE,0CAA0C;QAC5D,KAAK,EAAE,sCAAsC;KAC9C;IACD;;OAEG;IACH,QAAQ,EAAE;QACR,QAAQ,EAAE,wBAAwB;QAClC,OAAO,EAAE,6CAA6C;QACtD,gBAAgB,EAAE,2CAA2C;QAC7D,KAAK,EAAE,uCAAuC;KAC/C;IACD;;OAEG;IACH,IAAI,EAAE;QACJ,QAAQ,EAAE,6BAA6B;QACvC,OAAO,EAAE,yCAAyC;QAClD,gBAAgB,EAAE,uCAAuC;QACzD,KAAK,EAAE,mCAAmC;KAC3C;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,6BAA6B;QACvC,OAAO,EAAE,yCAAyC;QAClD,gBAAgB,EAAE,uCAAuC;QACzD,KAAK,EAAE,mCAAmC;KAC3C;IACD;;OAEG;IACH,MAAM,EAAE;QACN,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,uBAAuB;QACjE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB;QAC/D,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,qBAAqB;QACxE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,uBAAuB;KAC5D;CACF,CAAA"}
@@ -1,37 +1,6 @@
1
1
  import { AIQueryApi } from './api/query-api';
2
- import { EnvironmentInfo, EnvironmentName } from './environments';
3
- /**
4
- * Options to initialize the Payments class.
5
- */
6
- export interface PaymentOptions {
7
- /**
8
- * The Nevermined environment to connect to.
9
- * If you are developing an agent it's recommended to use the "testing" environment.
10
- * When deploying to production use the "arbitrum" environment.
11
- */
12
- environment: EnvironmentName;
13
- /**
14
- * The Nevermined API Key. This key identify your user and is required to interact with the Nevermined API.
15
- * You can get your API key by logging in to the Nevermined App.
16
- * @see https://docs.nevermined.app/docs/tutorials/integration/nvm-api-keys
17
- */
18
- nvmApiKey?: string;
19
- /**
20
- * The URL to return to the app after a successful login.
21
- */
22
- returnUrl?: string;
23
- /**
24
- * The app id. This attribute is optional and helps to associate assets registered into Nevermined with a common identifier.
25
- */
26
- appId?: string;
27
- /**
28
- * The version of the API to use.
29
- */
30
- version?: string;
31
- }
32
- export interface Endpoint {
33
- [verb: string]: string;
34
- }
2
+ import { CreateAgentDto, CreateFileDto, CreatePlanCreditsDto, CreatePlanTimeDto, CreateServiceDto, PaymentOptions } from './common/types';
3
+ import { EnvironmentInfo } from './environments';
35
4
  /**
36
5
  * Main class that interacts with the Nevermined payments API.
37
6
  * To get an instance of this class use the `getInstance` method.
@@ -177,12 +146,7 @@ export declare class Payments {
177
146
  *
178
147
  * @see https://docs.nevermined.app/docs/tutorials/builders/create-plan
179
148
  *
180
- * @param name - The name of the plan.
181
- * @param description - A description of what the plan offers.
182
- * @param price - The price of the plan. It must be given in the lowest denomination of the currency.
183
- * @param tokenAddress - The address of the ERC20 contract used for the payment. Using the `ZeroAddress` will use the chain's native currency instead.
184
- * @param amountOfCredits - The number of credits that are transferred to the user when purchases the plan.
185
- * @param tags - An array of tags or keywords that best fit the subscription.
149
+ * @param createPlanCreditsDto - @see {@link CreatePlanCreditsDto}
186
150
  *
187
151
  * @example
188
152
  * ```
@@ -198,14 +162,7 @@ export declare class Payments {
198
162
  *
199
163
  * @returns The unique identifier of the plan (Plan DID) of the newly created plan.
200
164
  */
201
- createCreditsPlan({ name, description, price, tokenAddress, amountOfCredits, tags, }: {
202
- name: string;
203
- description: string;
204
- price: bigint;
205
- tokenAddress: string;
206
- amountOfCredits: number;
207
- tags?: string[];
208
- }): Promise<{
165
+ createCreditsPlan(createPlanCreditsDto: CreatePlanCreditsDto): Promise<{
209
166
  did: string;
210
167
  }>;
211
168
  /**
@@ -221,13 +178,7 @@ export declare class Payments {
221
178
  *
222
179
  * @see https://docs.nevermined.app/docs/tutorials/builders/create-plan
223
180
  *
224
- * @param name - The name of the plan.
225
- * @param description - A description of what the plan offers.
226
- * @param price - The price of the plan. It must be given in the lowest denomination of the currency.
227
- * @param tokenAddress - The address of the ERC20 contract used for the payment. Using the `ZeroAddress` will use the chain's native currency instead.
228
- * @param tags - An array of tags or keywords that best fit the subscription.
229
- * @param duration - The duration of the plan in days. If `duration` is left undefined an unlimited time duration subscription will be created.
230
- * @param tags - An array of tags or keywords that best fit the subscription.
181
+ * @param createPlanTimeDto - @see {@link CreatePlanTimeDto}
231
182
  *
232
183
  * @example
233
184
  * ```
@@ -243,14 +194,7 @@ export declare class Payments {
243
194
  *
244
195
  * @returns The unique identifier of the plan (Plan DID) of the newly created plan.
245
196
  */
246
- createTimePlan({ name, description, price, tokenAddress, duration, tags, }: {
247
- name: string;
248
- description: string;
249
- price: bigint;
250
- tokenAddress: string;
251
- duration?: number;
252
- tags?: string[];
253
- }): Promise<{
197
+ createTimePlan(createPlanTimeDto: CreatePlanTimeDto): Promise<{
254
198
  did: string;
255
199
  }>;
256
200
  /**
@@ -281,54 +225,59 @@ export declare class Payments {
281
225
  * })
282
226
  * ```
283
227
  *
284
- * @param planDID - The plan unique identifier of the Plan (DID). @see {@link createCreditsPlan} or {@link createTimePlan}
285
- * @param name - The name of the AI Agent/Service.
286
- * @param description - The description of the AI Agent/Service.
287
- * @param tags - The tags describing the AI Agent/Service.
288
- * @param usesAIHub - If the agent is using the AI Hub. If true, the agent will be configured to use the AI Hub endpoints.
289
- * @param implementsQueryProtocol - It the agent implements the Nevermined Query Protocol. @see https://docs.nevermined.io/docs/protocol/query-protocol
290
- * @param serviceChargeType - The service charge type ('fixed' or 'dynamic').
291
- * @param amountOfCredits - The amount of credits to charge per request to the agent.
292
- * @param minCreditsToCharge - The minimum credits to charge.
293
- * @param maxCreditsToCharge - The maximum credits to charge.
294
- * @param authType - The upstream agent/service authentication type ('none', 'basic', 'bearer' or 'oauth').
295
- * @param username - The upstream agent/service username for authentication. Only if `authType` is 'basic'.
296
- * @param password - The upstream agent/service password for authentication. Only if `authType` is 'basic'.
297
- * @param token - The upstream agent/service bearer token for authentication. Only if `authType` is 'bearer' or 'oauth'.
298
- * @param endpoints - The list endpoints of the upstream service. All these endpoints are protected and only accessible to subscribers of the Payment Plan.
299
- * @param openEndpoints - The list of endpoints of the upstream service that publicly available. The access to these endpoints don't require subscription to the Payment Plan. They are useful to expose documentation, etc.
300
- * @param openApiUrl - The URL to the OpenAPI description of the Upstream API. The access to the OpenAPI definition don't require subscription to the Payment Plan.
301
- * @param integration - Some description or instructions about how to integrate the Agent.
302
- * @param sampleLink - A link to some same usage of the Agent.
303
- * @param apiDescription - Text describing the API of the Agent.
304
- * @param curation - The curation details.
228
+ * @param createAgentDto - @see {@link CreateAgentDto}
305
229
  * @returns A promise that resolves to the created agent DID.
306
230
  */
307
- createAgent({ planDID, name, description, amountOfCredits, tags, usesAIHub, implementsQueryProtocol, serviceChargeType, minCreditsToCharge, maxCreditsToCharge, authType, username, password, token, endpoints, openEndpoints, openApiUrl, integration, sampleLink, apiDescription, curation, }: {
308
- planDID: string;
309
- name: string;
310
- description: string;
311
- usesAIHub?: boolean;
312
- implementsQueryProtocol?: boolean;
313
- serviceChargeType: 'fixed' | 'dynamic';
314
- authType?: 'none' | 'basic' | 'oauth' | 'bearer';
315
- amountOfCredits?: number;
316
- minCreditsToCharge?: number;
317
- maxCreditsToCharge?: number;
318
- username?: string;
319
- password?: string;
320
- token?: string;
321
- endpoints?: Endpoint[];
322
- openEndpoints?: string[];
323
- openApiUrl?: string;
324
- integration?: string;
325
- sampleLink?: string;
326
- apiDescription?: string;
327
- curation?: object;
328
- tags?: string[];
329
- }): Promise<{
231
+ createAgent(createAgentDto: CreateAgentDto): Promise<{
330
232
  did: string;
331
233
  }>;
234
+ /**
235
+ *
236
+ * It creates a new AI Agent and a Payment Plan on Nevermined.
237
+ *
238
+ * @remarks
239
+ *
240
+ * This method is oriented to AI Builders
241
+ *
242
+ * @see https://docs.nevermined.app/docs/tutorials/builders/register-agent
243
+ *
244
+ * @param plan - @see {@link CreatePlanCreditsDto}
245
+ * @param agent - @see {@link CreateAgentDto} PlanDID is generated automatically.
246
+ * @returns A promise that resolves to the Plan DID and Agent DID.
247
+ *
248
+ * @example
249
+ * ```
250
+ * const { planDID, agentDID } = await paymentsBuilder.createAgentAndPlan(
251
+ * {
252
+ * name: 'My AI Payments Plan',
253
+ * description: 'AI stuff',
254
+ * price: 10000000n,
255
+ * tokenAddress: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d',
256
+ * amountOfCredits: 30,
257
+ * },
258
+ * {
259
+ * name: 'Payments Agent name',
260
+ * description: 'description',
261
+ * amountOfCredits: 1,
262
+ * tags: ['test'],
263
+ * usesAIHub: true,
264
+ * implementsQueryProtocol: true,
265
+ * serviceChargeType: 'fixed',
266
+ * authType: 'bearer',
267
+ * token,
268
+ * endpoints,
269
+ * integration: 'integration details',
270
+ * apiDescription: 'description',
271
+ * curation: {}
272
+ * })
273
+ * ```
274
+ *
275
+ * @returns A promise that resolves to the Plan DID and Agent DID.
276
+ */
277
+ createAgentAndPlan(plan: CreatePlanCreditsDto, agent: Omit<CreateAgentDto, 'planDID'>): Promise<{
278
+ planDID: string;
279
+ agentDID: string;
280
+ }>;
332
281
  /**
333
282
  * It creates a new AI Agent or Service on Nevermined.
334
283
  * The agent/service must be associated to a Payment Plan. Users that are subscribers of a payment plan can access the agent/service.
@@ -361,54 +310,10 @@ export declare class Payments {
361
310
  * })
362
311
  * ```
363
312
  *
364
- * @param planDID - The plan unique identifier of the Plan (DID). @see {@link createCreditsPlan} or {@link createTimePlan}
365
- * @param name - The name of the AI Agent/Service.
366
- * @param description - The description of the AI Agent/Service.
367
- * @param tags - The tags describing the AI Agent/Service.
368
- * @param usesAIHub - If the agent is using the AI Hub. If true, the agent will be configured to use the AI Hub endpoints.
369
- * @param implementsQueryProtocol - It the agent implements the Nevermined Query Protocol. @see https://docs.nevermined.io/docs/protocol/query-protocol
370
- * @param serviceType - The service type ('service', 'agent', or 'assistant').
371
- * @param serviceChargeType - The service charge type ('fixed' or 'dynamic').
372
- * @param amountOfCredits - The amount of credits to charge per request to the agent.
373
- * @param minCreditsToCharge - The minimum credits to charge.
374
- * @param maxCreditsToCharge - The maximum credits to charge.
375
- * @param authType - The upstream agent/service authentication type ('none', 'basic', 'bearer' or 'oauth').
376
- * @param username - The upstream agent/service username for authentication. Only if `authType` is 'basic'.
377
- * @param password - The upstream agent/service password for authentication. Only if `authType` is 'basic'.
378
- * @param token - The upstream agent/service bearer token for authentication. Only if `authType` is 'bearer' or 'oauth'.
379
- * @param endpoints - The list endpoints of the upstream service. All these endpoints are protected and only accessible to subscribers of the Payment Plan.
380
- * @param openEndpoints - The list of endpoints of the upstream service that publicly available. The access to these endpoints don't require subscription to the Payment Plan. They are useful to expose documentation, etc.
381
- * @param openApiUrl - The URL to the OpenAPI description of the Upstream API. The access to the OpenAPI definition don't require subscription to the Payment Plan.
382
- * @param integration - Some description or instructions about how to integrate the Agent.
383
- * @param sampleLink - A link to some same usage of the Agent.
384
- * @param apiDescription - Text describing the API of the Agent.
385
- * @param curation - The curation details.
313
+ * @param createServiceDto - @see {@link CreateServiceDto}
386
314
  * @returns A promise that resolves to the created agent DID.
387
315
  */
388
- createService({ planDID, name, description, usesAIHub, implementsQueryProtocol, amountOfCredits, tags, serviceType, serviceChargeType, minCreditsToCharge, maxCreditsToCharge, authType, username, password, token, endpoints, openEndpoints, openApiUrl, integration, sampleLink, apiDescription, curation, }: {
389
- planDID: string;
390
- name: string;
391
- description: string;
392
- usesAIHub?: boolean;
393
- implementsQueryProtocol?: boolean;
394
- serviceType: 'service' | 'agent' | 'assistant';
395
- serviceChargeType: 'fixed' | 'dynamic';
396
- authType?: 'none' | 'basic' | 'oauth' | 'bearer';
397
- amountOfCredits?: number;
398
- minCreditsToCharge?: number;
399
- maxCreditsToCharge?: number;
400
- username?: string;
401
- password?: string;
402
- token?: string;
403
- endpoints?: Endpoint[];
404
- openEndpoints?: string[];
405
- openApiUrl?: string;
406
- integration?: string;
407
- sampleLink?: string;
408
- apiDescription?: string;
409
- curation?: object;
410
- tags?: string[];
411
- }): Promise<{
316
+ createService(createServiceDto: CreateServiceDto): Promise<{
412
317
  did: string;
413
318
  }>;
414
319
  /**
@@ -423,48 +328,10 @@ export declare class Payments {
423
328
  *
424
329
  * @see https://docs.nevermined.app/docs/tutorials/builders/register-file-asset
425
330
  *
426
- * @param planDID - The plan unique identifier of the Plan (DID). @see {@link createCreditsPlan} or {@link createTimePlan}
427
- * @param assetType - The type of asset ('dataset' | 'algorithm' | 'model' | 'file' | 'other')
428
- * @param name - The name of the file.
429
- * @param description - The description of the file.
430
- * @param files - The array of files that can be downloaded for users that are subscribers of the Payment Plan.
431
- * @param amountOfCredits - The cost in credits of downloading a file. This parameter is only required if the Payment Plan attached to the file is based on credits.
432
- * @param tags - The array of tags describing the file.
433
- * @param dataSchema - The data schema of the files.
434
- * @param sampleCode - Some sample code related to the file.
435
- * @param filesFormat - The format of the files.
436
- * @param usageExample - The usage example.
437
- * @param programmingLanguage - The programming language used in the files.
438
- * @param framework - The framework used for creating the file.
439
- * @param task - The task creating the file.
440
- * @param trainingDetails - The training details.
441
- * @param variations - The variations.
442
- * @param fineTunable - Indicates if the file is fine-tunable.
443
- * @param curation - The curation object.
331
+ * @param createFileDto - @see {@link CreateFileDto}
444
332
  * @returns The promise that resolves to the created file's DID.
445
333
  */
446
- createFile({ planDID, assetType, name, description, files, amountOfCredits, tags, dataSchema, sampleCode, filesFormat, usageExample, programmingLanguage, framework, task, trainingDetails, variations, fineTunable, curation, }: {
447
- planDID: string;
448
- assetType: 'dataset' | 'algorithm' | 'model' | 'file' | 'other';
449
- name: string;
450
- description: string;
451
- files: object[];
452
- dataSchema?: string;
453
- sampleCode?: string;
454
- filesFormat?: string;
455
- usageExample?: string;
456
- programmingLanguage?: string;
457
- framework?: string;
458
- task?: string;
459
- trainingDetails?: string;
460
- variations?: string;
461
- fineTunable?: boolean;
462
- amountOfCredits?: number;
463
- minCreditsToCharge?: number;
464
- maxCreditsToCharge?: number;
465
- curation?: object;
466
- tags?: string[];
467
- }): Promise<{
334
+ createFile(createFileDto: CreateFileDto): Promise<{
468
335
  did: string;
469
336
  }>;
470
337
  /**