@sanity/client 6.29.0-generate.0 → 6.29.1
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.browser.cjs +2 -44
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +0 -404
- package/dist/index.browser.d.ts +0 -404
- package/dist/index.browser.js +2 -44
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +3 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -393
- package/dist/index.d.ts +0 -393
- package/dist/index.js +3 -45
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +0 -393
- package/dist/stega.browser.d.ts +0 -393
- package/dist/stega.d.cts +0 -393
- package/dist/stega.d.ts +0 -393
- package/package.json +2 -1
- package/src/SanityClient.ts +0 -13
- package/src/types.ts +0 -10
- package/umd/sanityClient.js +2 -44
- package/umd/sanityClient.min.js +2 -2
- package/src/agent/actions/AgentActionsClient.ts +0 -74
- package/src/agent/actions/generate.ts +0 -24
- package/src/agent/actions/types.ts +0 -373
package/dist/index.browser.cjs
CHANGED
|
@@ -981,42 +981,6 @@ const resourceDataBase = (config) => {
|
|
|
981
981
|
throw new Error(`Unsupported resource type: ${type.toString()}`);
|
|
982
982
|
}
|
|
983
983
|
};
|
|
984
|
-
function _generate(client, httpRequest, request) {
|
|
985
|
-
const dataset2 = hasDataset(client.config());
|
|
986
|
-
return _request(client, httpRequest, {
|
|
987
|
-
method: "POST",
|
|
988
|
-
uri: `/agent/action/generate/${dataset2}`,
|
|
989
|
-
body: request
|
|
990
|
-
});
|
|
991
|
-
}
|
|
992
|
-
class ObservableAgentsActionClient {
|
|
993
|
-
#client;
|
|
994
|
-
#httpRequest;
|
|
995
|
-
constructor(client, httpRequest) {
|
|
996
|
-
this.#client = client, this.#httpRequest = httpRequest;
|
|
997
|
-
}
|
|
998
|
-
/**
|
|
999
|
-
* Run an instruction to generate content in a target document.
|
|
1000
|
-
* @param request instruction request
|
|
1001
|
-
*/
|
|
1002
|
-
generate(request) {
|
|
1003
|
-
return _generate(this.#client, this.#httpRequest, request);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
class AgentActionsClient {
|
|
1007
|
-
#client;
|
|
1008
|
-
#httpRequest;
|
|
1009
|
-
constructor(client, httpRequest) {
|
|
1010
|
-
this.#client = client, this.#httpRequest = httpRequest;
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* Run an instruction to generate content in a target document.
|
|
1014
|
-
* @param request instruction request
|
|
1015
|
-
*/
|
|
1016
|
-
generate(request) {
|
|
1017
|
-
return rxjs.lastValueFrom(_generate(this.#client, this.#httpRequest, request));
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
984
|
class ObservableAssetsClient {
|
|
1021
985
|
#client;
|
|
1022
986
|
#httpRequest;
|
|
@@ -1437,7 +1401,6 @@ class ObservableSanityClient {
|
|
|
1437
1401
|
live;
|
|
1438
1402
|
projects;
|
|
1439
1403
|
users;
|
|
1440
|
-
agent;
|
|
1441
1404
|
/**
|
|
1442
1405
|
* Private properties
|
|
1443
1406
|
*/
|
|
@@ -1448,9 +1411,7 @@ class ObservableSanityClient {
|
|
|
1448
1411
|
*/
|
|
1449
1412
|
listen = _listen;
|
|
1450
1413
|
constructor(httpRequest, config = defaultConfig) {
|
|
1451
|
-
this.config(config), this.#httpRequest = httpRequest, this.assets = new ObservableAssetsClient(this, this.#httpRequest), this.datasets = new ObservableDatasetsClient(this, this.#httpRequest), this.live = new LiveClient(this), this.projects = new ObservableProjectsClient(this, this.#httpRequest), this.users = new ObservableUsersClient(this, this.#httpRequest)
|
|
1452
|
-
action: new ObservableAgentsActionClient(this, this.#httpRequest)
|
|
1453
|
-
};
|
|
1414
|
+
this.config(config), this.#httpRequest = httpRequest, this.assets = new ObservableAssetsClient(this, this.#httpRequest), this.datasets = new ObservableDatasetsClient(this, this.#httpRequest), this.live = new LiveClient(this), this.projects = new ObservableProjectsClient(this, this.#httpRequest), this.users = new ObservableUsersClient(this, this.#httpRequest);
|
|
1454
1415
|
}
|
|
1455
1416
|
/**
|
|
1456
1417
|
* Clone the client - returns a new instance
|
|
@@ -1589,7 +1550,6 @@ class SanityClient {
|
|
|
1589
1550
|
live;
|
|
1590
1551
|
projects;
|
|
1591
1552
|
users;
|
|
1592
|
-
agent;
|
|
1593
1553
|
/**
|
|
1594
1554
|
* Observable version of the Sanity client, with the same configuration as the promise-based one
|
|
1595
1555
|
*/
|
|
@@ -1604,9 +1564,7 @@ class SanityClient {
|
|
|
1604
1564
|
*/
|
|
1605
1565
|
listen = _listen;
|
|
1606
1566
|
constructor(httpRequest, config = defaultConfig) {
|
|
1607
|
-
this.config(config), this.#httpRequest = httpRequest, this.assets = new AssetsClient(this, this.#httpRequest), this.datasets = new DatasetsClient(this, this.#httpRequest), this.live = new LiveClient(this), this.projects = new ProjectsClient(this, this.#httpRequest), this.users = new UsersClient(this, this.#httpRequest), this.
|
|
1608
|
-
action: new AgentActionsClient(this, this.#httpRequest)
|
|
1609
|
-
}, this.observable = new ObservableSanityClient(httpRequest, config);
|
|
1567
|
+
this.config(config), this.#httpRequest = httpRequest, this.assets = new AssetsClient(this, this.#httpRequest), this.datasets = new DatasetsClient(this, this.#httpRequest), this.live = new LiveClient(this), this.projects = new ProjectsClient(this, this.#httpRequest), this.users = new UsersClient(this, this.#httpRequest), this.observable = new ObservableSanityClient(httpRequest, config);
|
|
1610
1568
|
}
|
|
1611
1569
|
/**
|
|
1612
1570
|
* Clone the client - returns a new instance
|