@naturali/sdk 0.164.0 → 0.165.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/dist/index.cjs +205 -0
- package/dist/index.d.cts +990 -81
- package/dist/index.d.mts +990 -81
- package/dist/index.mjs +204 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1167,6 +1167,34 @@ var Admin = class {
|
|
|
1167
1167
|
...options
|
|
1168
1168
|
});
|
|
1169
1169
|
}
|
|
1170
|
+
/**
|
|
1171
|
+
* List listings for review
|
|
1172
|
+
*
|
|
1173
|
+
* Every listing in one state, newest first — `in_review` by default, the queue an operator works through.
|
|
1174
|
+
*
|
|
1175
|
+
*/
|
|
1176
|
+
static listAdminListings(options) {
|
|
1177
|
+
return (options?.client ?? client).get({
|
|
1178
|
+
url: "/v1/admin/listings",
|
|
1179
|
+
...options
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Review a listing
|
|
1184
|
+
*
|
|
1185
|
+
* List a listing in review or one that is suspended, send one in review back to `draft`, or suspend any listing. A listing an operator suspends cannot be resumed by its publisher. An invalid move answers `409 invalid_listing_state`.
|
|
1186
|
+
*
|
|
1187
|
+
*/
|
|
1188
|
+
static setAdminListingState(options) {
|
|
1189
|
+
return (options.client ?? client).put({
|
|
1190
|
+
url: "/v1/admin/listings/{listing_id}/state",
|
|
1191
|
+
...options,
|
|
1192
|
+
headers: {
|
|
1193
|
+
"Content-Type": "application/json",
|
|
1194
|
+
...options.headers
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1170
1198
|
};
|
|
1171
1199
|
var Agents = class {
|
|
1172
1200
|
/**
|
|
@@ -3328,6 +3356,60 @@ var IngestionRules = class {
|
|
|
3328
3356
|
});
|
|
3329
3357
|
}
|
|
3330
3358
|
};
|
|
3359
|
+
var Installs = class {
|
|
3360
|
+
/**
|
|
3361
|
+
* List installs
|
|
3362
|
+
*
|
|
3363
|
+
* The listings the project installed, newest first.
|
|
3364
|
+
*/
|
|
3365
|
+
static listInstalls(options) {
|
|
3366
|
+
return (options.client ?? client).get({
|
|
3367
|
+
url: "/v1/projects/{project_id}/installs",
|
|
3368
|
+
...options
|
|
3369
|
+
});
|
|
3370
|
+
}
|
|
3371
|
+
/**
|
|
3372
|
+
* Install a listing
|
|
3373
|
+
*
|
|
3374
|
+
* Install a listing by its id. A listed entry, a draft and a listing in review all install; a suspended one answers `409 listing_suspended`. Installing again answers the existing install.
|
|
3375
|
+
* After the publisher removed this project's access, installing answers `403 install_blocked`.
|
|
3376
|
+
*
|
|
3377
|
+
*/
|
|
3378
|
+
static createInstall(options) {
|
|
3379
|
+
return (options.client ?? client).post({
|
|
3380
|
+
url: "/v1/projects/{project_id}/installs",
|
|
3381
|
+
...options,
|
|
3382
|
+
headers: {
|
|
3383
|
+
"Content-Type": "application/json",
|
|
3384
|
+
...options.headers
|
|
3385
|
+
}
|
|
3386
|
+
});
|
|
3387
|
+
}
|
|
3388
|
+
/**
|
|
3389
|
+
* Uninstall a listing
|
|
3390
|
+
*
|
|
3391
|
+
* Remove the install. While the project's agents, ingestion rules or other resources still name the installed resource, this answers `409 install_in_use` with them in `details.references`; `force=true` uninstalls anyway and those resources stop reaching it.
|
|
3392
|
+
* A `blocked` install, and the install managed conversion uses, answer `403`.
|
|
3393
|
+
*
|
|
3394
|
+
*/
|
|
3395
|
+
static deleteInstall(options) {
|
|
3396
|
+
return (options.client ?? client).delete({
|
|
3397
|
+
url: "/v1/projects/{project_id}/installs/{install_id}",
|
|
3398
|
+
...options
|
|
3399
|
+
});
|
|
3400
|
+
}
|
|
3401
|
+
/**
|
|
3402
|
+
* Get an install
|
|
3403
|
+
*
|
|
3404
|
+
* One of the project's installs.
|
|
3405
|
+
*/
|
|
3406
|
+
static getInstall(options) {
|
|
3407
|
+
return (options.client ?? client).get({
|
|
3408
|
+
url: "/v1/projects/{project_id}/installs/{install_id}",
|
|
3409
|
+
...options
|
|
3410
|
+
});
|
|
3411
|
+
}
|
|
3412
|
+
};
|
|
3331
3413
|
var Knowledge = class {
|
|
3332
3414
|
/**
|
|
3333
3415
|
* Search knowledge
|
|
@@ -3345,6 +3427,123 @@ var Knowledge = class {
|
|
|
3345
3427
|
});
|
|
3346
3428
|
}
|
|
3347
3429
|
};
|
|
3430
|
+
var Listings = class {
|
|
3431
|
+
/**
|
|
3432
|
+
* Browse the marketplace
|
|
3433
|
+
*
|
|
3434
|
+
* Every listed entry, newest first. `interface` is what an installing project sees of the resource, read live from the publisher.
|
|
3435
|
+
*
|
|
3436
|
+
*/
|
|
3437
|
+
static listPublicListings(options) {
|
|
3438
|
+
return (options?.client ?? client).get({
|
|
3439
|
+
url: "/v1/listings",
|
|
3440
|
+
...options
|
|
3441
|
+
});
|
|
3442
|
+
}
|
|
3443
|
+
/**
|
|
3444
|
+
* Get a public listing
|
|
3445
|
+
*
|
|
3446
|
+
* One listed entry. A listing that is not listed answers `404`.
|
|
3447
|
+
*/
|
|
3448
|
+
static getPublicListing(options) {
|
|
3449
|
+
return (options.client ?? client).get({
|
|
3450
|
+
url: "/v1/listings/{listing_id}",
|
|
3451
|
+
...options
|
|
3452
|
+
});
|
|
3453
|
+
}
|
|
3454
|
+
/**
|
|
3455
|
+
* List a project's listings
|
|
3456
|
+
*
|
|
3457
|
+
* The listings the project publishes, newest first.
|
|
3458
|
+
*/
|
|
3459
|
+
static listListings(options) {
|
|
3460
|
+
return (options.client ?? client).get({
|
|
3461
|
+
url: "/v1/projects/{project_id}/listings",
|
|
3462
|
+
...options
|
|
3463
|
+
});
|
|
3464
|
+
}
|
|
3465
|
+
/**
|
|
3466
|
+
* Create a listing
|
|
3467
|
+
*
|
|
3468
|
+
* Publish one of the project's tools or agents as a `draft`. Any project member may publish.
|
|
3469
|
+
* An agent on a naturali model whose model has no price answers `503 model_not_priced`. A resource that does not exist in the project answers `400 resource_not_found`, and one that already has a listing `409 listing_exists`.
|
|
3470
|
+
*
|
|
3471
|
+
*/
|
|
3472
|
+
static createListing(options) {
|
|
3473
|
+
return (options.client ?? client).post({
|
|
3474
|
+
url: "/v1/projects/{project_id}/listings",
|
|
3475
|
+
...options,
|
|
3476
|
+
headers: {
|
|
3477
|
+
"Content-Type": "application/json",
|
|
3478
|
+
...options.headers
|
|
3479
|
+
}
|
|
3480
|
+
});
|
|
3481
|
+
}
|
|
3482
|
+
/**
|
|
3483
|
+
* Get a listing
|
|
3484
|
+
*
|
|
3485
|
+
* One of the project's listings.
|
|
3486
|
+
*/
|
|
3487
|
+
static getListing(options) {
|
|
3488
|
+
return (options.client ?? client).get({
|
|
3489
|
+
url: "/v1/projects/{project_id}/listings/{listing_id}",
|
|
3490
|
+
...options
|
|
3491
|
+
});
|
|
3492
|
+
}
|
|
3493
|
+
/**
|
|
3494
|
+
* Update a listing
|
|
3495
|
+
*
|
|
3496
|
+
* Change the title or description, or pause and resume the listing.
|
|
3497
|
+
* `state: suspended` stops the listing for every installing project at once; their installs are kept. `state: listed` resumes a listing you suspended, provided naturali had listed it; nobody reinstalls. A listing naturali suspended cannot be resumed here, and an invalid move answers `409 invalid_listing_state`.
|
|
3498
|
+
*
|
|
3499
|
+
*/
|
|
3500
|
+
static updateListing(options) {
|
|
3501
|
+
return (options.client ?? client).patch({
|
|
3502
|
+
url: "/v1/projects/{project_id}/listings/{listing_id}",
|
|
3503
|
+
...options,
|
|
3504
|
+
headers: {
|
|
3505
|
+
"Content-Type": "application/json",
|
|
3506
|
+
...options.headers
|
|
3507
|
+
}
|
|
3508
|
+
});
|
|
3509
|
+
}
|
|
3510
|
+
/**
|
|
3511
|
+
* Submit a listing for review
|
|
3512
|
+
*
|
|
3513
|
+
* Move a `draft` listing to `in_review`. naturali lists it in the marketplace or sends it back to `draft`. Any other state answers `409 invalid_listing_state`.
|
|
3514
|
+
*
|
|
3515
|
+
*/
|
|
3516
|
+
static submitListing(options) {
|
|
3517
|
+
return (options.client ?? client).post({
|
|
3518
|
+
url: "/v1/projects/{project_id}/listings/{listing_id}:submit",
|
|
3519
|
+
...options
|
|
3520
|
+
});
|
|
3521
|
+
}
|
|
3522
|
+
/**
|
|
3523
|
+
* List a listing's installs
|
|
3524
|
+
*
|
|
3525
|
+
* Each project that installed the listing, with its usage this billing cycle as last sampled. Never the content of a call.
|
|
3526
|
+
*
|
|
3527
|
+
*/
|
|
3528
|
+
static listListingInstalls(options) {
|
|
3529
|
+
return (options.client ?? client).get({
|
|
3530
|
+
url: "/v1/projects/{project_id}/listings/{listing_id}/installs",
|
|
3531
|
+
...options
|
|
3532
|
+
});
|
|
3533
|
+
}
|
|
3534
|
+
/**
|
|
3535
|
+
* Remove a project's install
|
|
3536
|
+
*
|
|
3537
|
+
* Cut one installing project off. An `active` or `suspended` install becomes `blocked`, and that project cannot install the listing again. Deleting a `blocked` install removes it, which lets that project install again.
|
|
3538
|
+
*
|
|
3539
|
+
*/
|
|
3540
|
+
static deleteListingInstall(options) {
|
|
3541
|
+
return (options.client ?? client).delete({
|
|
3542
|
+
url: "/v1/projects/{project_id}/listings/{listing_id}/installs/{install_id}",
|
|
3543
|
+
...options
|
|
3544
|
+
});
|
|
3545
|
+
}
|
|
3546
|
+
};
|
|
3348
3547
|
var Memories = class {
|
|
3349
3548
|
/**
|
|
3350
3549
|
* List memories
|
|
@@ -5504,7 +5703,9 @@ var NaturaliClient = class {
|
|
|
5504
5703
|
generations;
|
|
5505
5704
|
guardrails;
|
|
5506
5705
|
ingestionRules;
|
|
5706
|
+
installs;
|
|
5507
5707
|
knowledge;
|
|
5708
|
+
listings;
|
|
5508
5709
|
memories;
|
|
5509
5710
|
memoryRules;
|
|
5510
5711
|
memoryStores;
|
|
@@ -5557,7 +5758,9 @@ var NaturaliClient = class {
|
|
|
5557
5758
|
this.generations = bindResource(Generations, this.http);
|
|
5558
5759
|
this.guardrails = bindResource(Guardrails, this.http);
|
|
5559
5760
|
this.ingestionRules = bindResource(IngestionRules, this.http);
|
|
5761
|
+
this.installs = bindResource(Installs, this.http);
|
|
5560
5762
|
this.knowledge = bindResource(Knowledge, this.http);
|
|
5763
|
+
this.listings = bindResource(Listings, this.http);
|
|
5561
5764
|
this.memories = bindResource(Memories, this.http);
|
|
5562
5765
|
this.memoryRules = bindResource(MemoryRules, this.http);
|
|
5563
5766
|
this.memoryStores = bindResource(MemoryStores, this.http);
|
|
@@ -5603,7 +5806,9 @@ exports.Formations = Formations;
|
|
|
5603
5806
|
exports.Generations = Generations;
|
|
5604
5807
|
exports.Guardrails = Guardrails;
|
|
5605
5808
|
exports.IngestionRules = IngestionRules;
|
|
5809
|
+
exports.Installs = Installs;
|
|
5606
5810
|
exports.Knowledge = Knowledge;
|
|
5811
|
+
exports.Listings = Listings;
|
|
5607
5812
|
exports.Memories = Memories;
|
|
5608
5813
|
exports.MemoryRules = MemoryRules;
|
|
5609
5814
|
exports.MemoryStores = MemoryStores;
|