@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.cjs
CHANGED
|
@@ -823,42 +823,6 @@ const resourceDataBase = (config2) => {
|
|
|
823
823
|
throw new Error(`Unsupported resource type: ${type.toString()}`);
|
|
824
824
|
}
|
|
825
825
|
};
|
|
826
|
-
function _generate(client, httpRequest, request) {
|
|
827
|
-
const dataset = config.hasDataset(client.config());
|
|
828
|
-
return _request(client, httpRequest, {
|
|
829
|
-
method: "POST",
|
|
830
|
-
uri: `/agent/action/generate/${dataset}`,
|
|
831
|
-
body: request
|
|
832
|
-
});
|
|
833
|
-
}
|
|
834
|
-
class ObservableAgentsActionClient {
|
|
835
|
-
#client;
|
|
836
|
-
#httpRequest;
|
|
837
|
-
constructor(client, httpRequest) {
|
|
838
|
-
this.#client = client, this.#httpRequest = httpRequest;
|
|
839
|
-
}
|
|
840
|
-
/**
|
|
841
|
-
* Run an instruction to generate content in a target document.
|
|
842
|
-
* @param request instruction request
|
|
843
|
-
*/
|
|
844
|
-
generate(request) {
|
|
845
|
-
return _generate(this.#client, this.#httpRequest, request);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
class AgentActionsClient {
|
|
849
|
-
#client;
|
|
850
|
-
#httpRequest;
|
|
851
|
-
constructor(client, httpRequest) {
|
|
852
|
-
this.#client = client, this.#httpRequest = httpRequest;
|
|
853
|
-
}
|
|
854
|
-
/**
|
|
855
|
-
* Run an instruction to generate content in a target document.
|
|
856
|
-
* @param request instruction request
|
|
857
|
-
*/
|
|
858
|
-
generate(request) {
|
|
859
|
-
return rxjs.lastValueFrom(_generate(this.#client, this.#httpRequest, request));
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
826
|
class ObservableAssetsClient {
|
|
863
827
|
#client;
|
|
864
828
|
#httpRequest;
|
|
@@ -1279,7 +1243,6 @@ class ObservableSanityClient {
|
|
|
1279
1243
|
live;
|
|
1280
1244
|
projects;
|
|
1281
1245
|
users;
|
|
1282
|
-
agent;
|
|
1283
1246
|
/**
|
|
1284
1247
|
* Private properties
|
|
1285
1248
|
*/
|
|
@@ -1290,9 +1253,7 @@ class ObservableSanityClient {
|
|
|
1290
1253
|
*/
|
|
1291
1254
|
listen = _listen;
|
|
1292
1255
|
constructor(httpRequest, config$1 = config.defaultConfig) {
|
|
1293
|
-
this.config(config$1), 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)
|
|
1294
|
-
action: new ObservableAgentsActionClient(this, this.#httpRequest)
|
|
1295
|
-
};
|
|
1256
|
+
this.config(config$1), 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);
|
|
1296
1257
|
}
|
|
1297
1258
|
/**
|
|
1298
1259
|
* Clone the client - returns a new instance
|
|
@@ -1431,7 +1392,6 @@ class SanityClient {
|
|
|
1431
1392
|
live;
|
|
1432
1393
|
projects;
|
|
1433
1394
|
users;
|
|
1434
|
-
agent;
|
|
1435
1395
|
/**
|
|
1436
1396
|
* Observable version of the Sanity client, with the same configuration as the promise-based one
|
|
1437
1397
|
*/
|
|
@@ -1446,9 +1406,7 @@ class SanityClient {
|
|
|
1446
1406
|
*/
|
|
1447
1407
|
listen = _listen;
|
|
1448
1408
|
constructor(httpRequest, config$1 = config.defaultConfig) {
|
|
1449
|
-
this.config(config$1), 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.
|
|
1450
|
-
action: new AgentActionsClient(this, this.#httpRequest)
|
|
1451
|
-
}, this.observable = new ObservableSanityClient(httpRequest, config$1);
|
|
1409
|
+
this.config(config$1), 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$1);
|
|
1452
1410
|
}
|
|
1453
1411
|
/**
|
|
1454
1412
|
* Clone the client - returns a new instance
|
|
@@ -1624,7 +1582,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
1624
1582
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
1625
1583
|
};
|
|
1626
1584
|
}
|
|
1627
|
-
var name = "@sanity/client", version = "6.29.
|
|
1585
|
+
var name = "@sanity/client", version = "6.29.1";
|
|
1628
1586
|
const middleware = [
|
|
1629
1587
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
1630
1588
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|