@naturali/sdk 0.309.4 → 0.310.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 +95 -0
- package/dist/index.d.cts +502 -1
- package/dist/index.d.mts +502 -1
- package/dist/index.mjs +94 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -637,6 +637,95 @@ var Activity = class {
|
|
|
637
637
|
});
|
|
638
638
|
}
|
|
639
639
|
};
|
|
640
|
+
var ActorIssuer = class {
|
|
641
|
+
/**
|
|
642
|
+
* Get the project's actor issuer
|
|
643
|
+
*
|
|
644
|
+
* Returns the project's issuer URL (the `iss` of every actor token it signs), the JWKS a receiver verifies them against and the token lifetimes. The JWKS and an OpenID-style discovery document are served without a credential under the issuer URL.
|
|
645
|
+
*/
|
|
646
|
+
static getActorIssuer(options) {
|
|
647
|
+
return (options.client ?? client).get({
|
|
648
|
+
url: "/v1/projects/{project_id}/actor-issuer",
|
|
649
|
+
...options
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Get the actor issuer's key set
|
|
654
|
+
*
|
|
655
|
+
* Returns the JSON Web Key Set actor tokens verify against, without a credential: a verifier holds none. Served with `Cache-Control: public, max-age=300`.
|
|
656
|
+
*/
|
|
657
|
+
static getActorIssuerJwks(options) {
|
|
658
|
+
return (options.client ?? client).get({
|
|
659
|
+
url: "/v1/projects/{project_id}/actor-issuer/.well-known/jwks.json",
|
|
660
|
+
...options
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Get the actor issuer's discovery document
|
|
665
|
+
*
|
|
666
|
+
* Returns the OpenID-style discovery document of the project's issuer, for a JWT library that discovers keys from `iss`, without a credential. Served with `Cache-Control: public, max-age=300`.
|
|
667
|
+
*/
|
|
668
|
+
static getActorIssuerConfiguration(options) {
|
|
669
|
+
return (options.client ?? client).get({
|
|
670
|
+
url: "/v1/projects/{project_id}/actor-issuer/.well-known/openid-configuration",
|
|
671
|
+
...options
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
var ActorTokens = class {
|
|
676
|
+
/**
|
|
677
|
+
* List actor tokens
|
|
678
|
+
*
|
|
679
|
+
* Returns a project's active actor tokens, without tokens.
|
|
680
|
+
*/
|
|
681
|
+
static listActorTokens(options) {
|
|
682
|
+
return (options.client ?? client).get({
|
|
683
|
+
url: "/v1/projects/{project_id}/actor-tokens",
|
|
684
|
+
...options
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Create an actor token
|
|
689
|
+
*
|
|
690
|
+
* Creates an actor token for an actor the caller has authenticated and returns its first access token and refresh token. The access token is signed by the project's actor issuer (`GET /v1/projects/{project_id}/actor-issuer`) and its `aud` is `audience`. Create one only for the person the actor is.
|
|
691
|
+
*/
|
|
692
|
+
static createActorToken(options) {
|
|
693
|
+
return (options.client ?? client).post({
|
|
694
|
+
url: "/v1/projects/{project_id}/actor-tokens",
|
|
695
|
+
...options,
|
|
696
|
+
headers: {
|
|
697
|
+
"Content-Type": "application/json",
|
|
698
|
+
...options.headers
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Refresh an actor token
|
|
704
|
+
*
|
|
705
|
+
* Exchanges a refresh token for a new access token and refresh token. The presented refresh token stops working; presenting it again revokes the actor token. An unknown, expired, spent or revoked refresh token is `401 ACTOR_TOKEN_INVALID`.
|
|
706
|
+
*/
|
|
707
|
+
static refreshActorToken(options) {
|
|
708
|
+
return (options.client ?? client).post({
|
|
709
|
+
url: "/v1/projects/{project_id}/actor-tokens/refresh",
|
|
710
|
+
...options,
|
|
711
|
+
headers: {
|
|
712
|
+
"Content-Type": "application/json",
|
|
713
|
+
...options.headers
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Revoke an actor token
|
|
719
|
+
*
|
|
720
|
+
* Revokes the actor token: its refresh token stops working. Access tokens already issued stay valid until they expire. Deleting the actor revokes all of its actor tokens.
|
|
721
|
+
*/
|
|
722
|
+
static deleteActorToken(options) {
|
|
723
|
+
return (options.client ?? client).delete({
|
|
724
|
+
url: "/v1/projects/{project_id}/actor-tokens/{actor_token_id}",
|
|
725
|
+
...options
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
};
|
|
640
729
|
var Actors = class {
|
|
641
730
|
/**
|
|
642
731
|
* List actors
|
|
@@ -7232,6 +7321,8 @@ var NaturaliClient = class {
|
|
|
7232
7321
|
activity;
|
|
7233
7322
|
admin;
|
|
7234
7323
|
actors;
|
|
7324
|
+
actorIssuer;
|
|
7325
|
+
actorTokens;
|
|
7235
7326
|
agents;
|
|
7236
7327
|
agentVersions;
|
|
7237
7328
|
aiProviders;
|
|
@@ -7291,6 +7382,8 @@ var NaturaliClient = class {
|
|
|
7291
7382
|
this.activity = bindResource(Activity, this.http);
|
|
7292
7383
|
this.admin = bindResource(Admin, this.http);
|
|
7293
7384
|
this.actors = bindResource(Actors, this.http);
|
|
7385
|
+
this.actorIssuer = bindResource(ActorIssuer, this.http);
|
|
7386
|
+
this.actorTokens = bindResource(ActorTokens, this.http);
|
|
7294
7387
|
this.agents = bindResource(Agents, this.http);
|
|
7295
7388
|
this.agentVersions = bindResource(AgentVersions, this.http);
|
|
7296
7389
|
this.aiProviders = bindResource(AiProviders, this.http);
|
|
@@ -7341,6 +7434,8 @@ var NaturaliClient = class {
|
|
|
7341
7434
|
};
|
|
7342
7435
|
//#endregion
|
|
7343
7436
|
exports.Activity = Activity;
|
|
7437
|
+
exports.ActorIssuer2 = ActorIssuer;
|
|
7438
|
+
exports.ActorTokens = ActorTokens;
|
|
7344
7439
|
exports.Actors = Actors;
|
|
7345
7440
|
exports.Admin = Admin;
|
|
7346
7441
|
exports.AgentVersions = AgentVersions;
|