@naturali/cli 0.230.0 → 0.232.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.
Files changed (2) hide show
  1. package/dist/index.mjs +547 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ var __exportAll = (all, no_symbols) => {
17
17
  };
18
18
  //#endregion
19
19
  //#region package.json
20
- var version = "0.230.0";
20
+ var version = "0.232.0";
21
21
  //#endregion
22
22
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
23
23
  const serializeFormDataPair = (data, key, value) => {
@@ -4568,6 +4568,121 @@ var Models = class {
4568
4568
  });
4569
4569
  }
4570
4570
  };
4571
+ var OauthClients = class {
4572
+ /**
4573
+ * List OAuth clients
4574
+ *
4575
+ * Returns the OAuth clients of a project.
4576
+ */
4577
+ static listOauthClients(options) {
4578
+ return (options.client ?? client).get({
4579
+ url: "/v1/projects/{project_id}/oauth-clients",
4580
+ ...options
4581
+ });
4582
+ }
4583
+ /**
4584
+ * Create an OAuth client
4585
+ *
4586
+ * Registers your app at a provider. `client_secret` is a `{{secret:sec_...}}` reference, and the caller needs `secrets:UseSecret` on it.
4587
+ */
4588
+ static createOauthClient(options) {
4589
+ return (options.client ?? client).post({
4590
+ url: "/v1/projects/{project_id}/oauth-clients",
4591
+ ...options,
4592
+ headers: {
4593
+ "Content-Type": "application/json",
4594
+ ...options.headers
4595
+ }
4596
+ });
4597
+ }
4598
+ /**
4599
+ * Delete an OAuth client
4600
+ *
4601
+ * Deletes the client and every connection made through it.
4602
+ */
4603
+ static deleteOauthClient(options) {
4604
+ return (options.client ?? client).delete({
4605
+ url: "/v1/projects/{project_id}/oauth-clients/{oauth_client_id}",
4606
+ ...options
4607
+ });
4608
+ }
4609
+ /**
4610
+ * Get an OAuth client
4611
+ *
4612
+ * Returns the client; `client_secret` is its secret reference.
4613
+ */
4614
+ static getOauthClient(options) {
4615
+ return (options.client ?? client).get({
4616
+ url: "/v1/projects/{project_id}/oauth-clients/{oauth_client_id}",
4617
+ ...options
4618
+ });
4619
+ }
4620
+ /**
4621
+ * Update an OAuth client
4622
+ *
4623
+ * Changes only the fields sent; `null` clears a nullable one.
4624
+ */
4625
+ static updateOauthClient(options) {
4626
+ return (options.client ?? client).patch({
4627
+ url: "/v1/projects/{project_id}/oauth-clients/{oauth_client_id}",
4628
+ ...options,
4629
+ headers: {
4630
+ "Content-Type": "application/json",
4631
+ ...options.headers
4632
+ }
4633
+ });
4634
+ }
4635
+ };
4636
+ var OauthConnections = class {
4637
+ /**
4638
+ * List OAuth connections
4639
+ *
4640
+ * Returns a project's OAuth connections, without tokens.
4641
+ */
4642
+ static listOauthConnections(options) {
4643
+ return (options.client ?? client).get({
4644
+ url: "/v1/projects/{project_id}/oauth-connections",
4645
+ ...options
4646
+ });
4647
+ }
4648
+ /**
4649
+ * Start an OAuth connection
4650
+ *
4651
+ * Starts the authorization of an actor through an OAuth client and returns the `authorize_url` to send the person to; it is single-use and expires after 10 minutes. Starting again for the same actor and client restarts the same connection (`200`), and a connected one keeps its tokens until the new authorization completes. Hand the `authorize_url` only to the person the actor is: whoever consents connects their account to that actor.
4652
+ */
4653
+ static createOauthConnection(options) {
4654
+ return (options.client ?? client).post({
4655
+ url: "/v1/projects/{project_id}/oauth-connections",
4656
+ ...options,
4657
+ headers: {
4658
+ "Content-Type": "application/json",
4659
+ ...options.headers
4660
+ }
4661
+ });
4662
+ }
4663
+ /**
4664
+ * Delete an OAuth connection
4665
+ *
4666
+ * Revokes the grant at the provider's `revocation_url`, when the client has one, and deletes the connection. A failed revocation does not stop the deletion.
4667
+ */
4668
+ static deleteOauthConnection(options) {
4669
+ return (options.client ?? client).delete({
4670
+ url: "/v1/projects/{project_id}/oauth-connections/{oauth_connection_id}",
4671
+ ...options
4672
+ });
4673
+ }
4674
+ /**
4675
+ * Get an OAuth connection
4676
+ *
4677
+ * Returns the connection's status, without tokens.
4678
+ */
4679
+ static getOauthConnection(options) {
4680
+ return (options.client ?? client).get({
4681
+ url: "/v1/projects/{project_id}/oauth-connections/{oauth_connection_id}",
4682
+ ...options
4683
+ });
4684
+ }
4685
+ };
4571
4686
  var Orchestrations = class {
4572
4687
  /**
4573
4688
  * List orchestrations
@@ -6916,6 +7031,8 @@ var NaturaliClient = class {
6916
7031
  memoryStores;
6917
7032
  metadataSchemas;
6918
7033
  modelRoutes;
7034
+ oauthClients;
7035
+ oauthConnections;
6919
7036
  quotas;
6920
7037
  models;
6921
7038
  orchestrations;
@@ -6974,6 +7091,8 @@ var NaturaliClient = class {
6974
7091
  this.memoryStores = bindResource(MemoryStores, this.http);
6975
7092
  this.metadataSchemas = bindResource(MetadataSchemas, this.http);
6976
7093
  this.modelRoutes = bindResource(ModelRoutes, this.http);
7094
+ this.oauthClients = bindResource(OauthClients, this.http);
7095
+ this.oauthConnections = bindResource(OauthConnections, this.http);
6977
7096
  this.quotas = bindResource(Quotas, this.http);
6978
7097
  this.models = bindResource(Models, this.http);
6979
7098
  this.orchestrations = bindResource(Orchestrations, this.http);
@@ -7029,6 +7148,8 @@ var src_exports = /* @__PURE__ */ __exportAll({
7029
7148
  ModelRoutes: () => ModelRoutes,
7030
7149
  Models: () => Models,
7031
7150
  NaturaliClient: () => NaturaliClient,
7151
+ OauthClients: () => OauthClients,
7152
+ OauthConnections: () => OauthConnections,
7032
7153
  Orchestrations: () => Orchestrations,
7033
7154
  Playbooks: () => Playbooks,
7034
7155
  Projects: () => Projects,
@@ -19956,6 +20077,431 @@ const routes = {
19956
20077
  "in": "path"
19957
20078
  }]
19958
20079
  },
20080
+ "list-oauth-clients": {
20081
+ serviceClass: "OauthClients",
20082
+ operationId: "listOauthClients",
20083
+ description: "Returns the OAuth clients of a project.",
20084
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-clients",
20085
+ httpMethod: "get",
20086
+ pathParams: ["project_id"],
20087
+ queryParams: ["limit", "cursor"],
20088
+ headerParams: [],
20089
+ cookieParams: [],
20090
+ flags: [
20091
+ {
20092
+ "name": "project_id",
20093
+ "description": "Project public ID (proj_ prefix).",
20094
+ "required": true,
20095
+ "type": "string",
20096
+ "in": "path"
20097
+ },
20098
+ {
20099
+ "name": "limit",
20100
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
20101
+ "required": false,
20102
+ "type": "integer",
20103
+ "in": "query"
20104
+ },
20105
+ {
20106
+ "name": "cursor",
20107
+ "description": "The previous page's `next_cursor`; omit it for the first page. A cursor this list did not issue is `400`.",
20108
+ "required": false,
20109
+ "type": "string",
20110
+ "in": "query"
20111
+ }
20112
+ ]
20113
+ },
20114
+ "create-oauth-client": {
20115
+ serviceClass: "OauthClients",
20116
+ operationId: "createOauthClient",
20117
+ description: "Registers your app at a provider. `client_secret` is a `{{secret:sec_...}}` reference, and the caller needs `secrets:UseSecret` on it.",
20118
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-clients",
20119
+ httpMethod: "post",
20120
+ pathParams: ["project_id"],
20121
+ queryParams: [],
20122
+ headerParams: [],
20123
+ cookieParams: [],
20124
+ flags: [
20125
+ {
20126
+ "name": "project_id",
20127
+ "description": "Project public ID (proj_ prefix).",
20128
+ "required": true,
20129
+ "type": "string",
20130
+ "in": "path"
20131
+ },
20132
+ {
20133
+ "name": "name",
20134
+ "description": "A label for the client, such as the provider's name.",
20135
+ "required": true,
20136
+ "type": "string",
20137
+ "in": "body"
20138
+ },
20139
+ {
20140
+ "name": "authorize_url",
20141
+ "description": "The provider's authorization endpoint. Query parameters it already carries are kept.",
20142
+ "required": true,
20143
+ "type": "string",
20144
+ "in": "body"
20145
+ },
20146
+ {
20147
+ "name": "token_url",
20148
+ "description": "The provider's token endpoint.",
20149
+ "required": true,
20150
+ "type": "string",
20151
+ "in": "body"
20152
+ },
20153
+ {
20154
+ "name": "revocation_url",
20155
+ "description": "The provider's RFC 7009 revocation endpoint, called when a connection is deleted. `null` skips revocation.",
20156
+ "required": false,
20157
+ "type": "string",
20158
+ "in": "body"
20159
+ },
20160
+ {
20161
+ "name": "client_id",
20162
+ "description": "Your app's client ID at the provider.",
20163
+ "required": true,
20164
+ "type": "string",
20165
+ "in": "body"
20166
+ },
20167
+ {
20168
+ "name": "client_secret",
20169
+ "description": "A `{{secret:sec_...}}` reference to your app's client secret, never the value. `null` for a public client, which relies on PKCE.",
20170
+ "required": false,
20171
+ "type": "string",
20172
+ "in": "body"
20173
+ },
20174
+ {
20175
+ "name": "scopes",
20176
+ "description": "The scopes requested at authorization.",
20177
+ "required": true,
20178
+ "type": "array",
20179
+ "in": "body"
20180
+ },
20181
+ {
20182
+ "name": "pkce",
20183
+ "description": "Whether the authorization uses PKCE (`S256`).",
20184
+ "required": false,
20185
+ "type": "boolean",
20186
+ "in": "body"
20187
+ },
20188
+ {
20189
+ "name": "token_endpoint_auth_method",
20190
+ "description": "How the client authenticates at the token endpoint.",
20191
+ "required": false,
20192
+ "type": "string",
20193
+ "in": "body"
20194
+ },
20195
+ {
20196
+ "name": "redirect_uri",
20197
+ "description": "The callback the provider redirects to, as registered with the provider. Omitted or `null`, this API fills in its own `https://api.naturali.ai/v1/oauth/callback`, the URL to register with the provider; a front end that receives the redirect itself forwards `code` and `state` there.",
20198
+ "required": false,
20199
+ "type": "string",
20200
+ "in": "body"
20201
+ },
20202
+ {
20203
+ "name": "authorize_params",
20204
+ "description": "Extra query parameters for the authorize URL, such as Google's `access_type: offline` and `prompt: consent` for a refresh token.",
20205
+ "required": false,
20206
+ "type": "object",
20207
+ "in": "body"
20208
+ }
20209
+ ]
20210
+ },
20211
+ "get-oauth-client": {
20212
+ serviceClass: "OauthClients",
20213
+ operationId: "getOauthClient",
20214
+ description: "Returns the client; `client_secret` is its secret reference.",
20215
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-clients",
20216
+ httpMethod: "get",
20217
+ pathParams: ["oauth_client_id", "project_id"],
20218
+ queryParams: [],
20219
+ headerParams: [],
20220
+ cookieParams: [],
20221
+ flags: [{
20222
+ "name": "oauth_client_id",
20223
+ "description": "OAuth client ID",
20224
+ "required": true,
20225
+ "type": "string",
20226
+ "in": "path"
20227
+ }, {
20228
+ "name": "project_id",
20229
+ "description": "Project public ID (proj_ prefix).",
20230
+ "required": true,
20231
+ "type": "string",
20232
+ "in": "path"
20233
+ }]
20234
+ },
20235
+ "update-oauth-client": {
20236
+ serviceClass: "OauthClients",
20237
+ operationId: "updateOauthClient",
20238
+ description: "Changes only the fields sent; `null` clears a nullable one.",
20239
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-clients",
20240
+ httpMethod: "patch",
20241
+ pathParams: ["oauth_client_id", "project_id"],
20242
+ queryParams: [],
20243
+ headerParams: [],
20244
+ cookieParams: [],
20245
+ flags: [
20246
+ {
20247
+ "name": "oauth_client_id",
20248
+ "description": "OAuth client ID",
20249
+ "required": true,
20250
+ "type": "string",
20251
+ "in": "path"
20252
+ },
20253
+ {
20254
+ "name": "project_id",
20255
+ "description": "Project public ID (proj_ prefix).",
20256
+ "required": true,
20257
+ "type": "string",
20258
+ "in": "path"
20259
+ },
20260
+ {
20261
+ "name": "name",
20262
+ "description": "A label for the client, such as the provider's name.",
20263
+ "required": false,
20264
+ "type": "string",
20265
+ "in": "body"
20266
+ },
20267
+ {
20268
+ "name": "authorize_url",
20269
+ "description": "The provider's authorization endpoint. Query parameters it already carries are kept.",
20270
+ "required": false,
20271
+ "type": "string",
20272
+ "in": "body"
20273
+ },
20274
+ {
20275
+ "name": "token_url",
20276
+ "description": "The provider's token endpoint.",
20277
+ "required": false,
20278
+ "type": "string",
20279
+ "in": "body"
20280
+ },
20281
+ {
20282
+ "name": "revocation_url",
20283
+ "description": "The provider's RFC 7009 revocation endpoint, called when a connection is deleted. `null` skips revocation.",
20284
+ "required": false,
20285
+ "type": "string",
20286
+ "in": "body"
20287
+ },
20288
+ {
20289
+ "name": "client_id",
20290
+ "description": "Your app's client ID at the provider.",
20291
+ "required": false,
20292
+ "type": "string",
20293
+ "in": "body"
20294
+ },
20295
+ {
20296
+ "name": "client_secret",
20297
+ "description": "A `{{secret:sec_...}}` reference to your app's client secret, never the value. `null` for a public client, which relies on PKCE.",
20298
+ "required": false,
20299
+ "type": "string",
20300
+ "in": "body"
20301
+ },
20302
+ {
20303
+ "name": "scopes",
20304
+ "description": "The scopes requested at authorization.",
20305
+ "required": false,
20306
+ "type": "array",
20307
+ "in": "body"
20308
+ },
20309
+ {
20310
+ "name": "pkce",
20311
+ "description": "Whether the authorization uses PKCE (`S256`).",
20312
+ "required": false,
20313
+ "type": "boolean",
20314
+ "in": "body"
20315
+ },
20316
+ {
20317
+ "name": "token_endpoint_auth_method",
20318
+ "description": "How the client authenticates at the token endpoint.",
20319
+ "required": false,
20320
+ "type": "string",
20321
+ "in": "body"
20322
+ },
20323
+ {
20324
+ "name": "redirect_uri",
20325
+ "description": "The callback the provider redirects to, as registered with the provider. Omitted or `null`, this API fills in its own `https://api.naturali.ai/v1/oauth/callback`, the URL to register with the provider; a front end that receives the redirect itself forwards `code` and `state` there.",
20326
+ "required": false,
20327
+ "type": "string",
20328
+ "in": "body"
20329
+ },
20330
+ {
20331
+ "name": "authorize_params",
20332
+ "description": "Extra query parameters for the authorize URL, such as Google's `access_type: offline` and `prompt: consent` for a refresh token.",
20333
+ "required": false,
20334
+ "type": "object",
20335
+ "in": "body"
20336
+ }
20337
+ ]
20338
+ },
20339
+ "delete-oauth-client": {
20340
+ serviceClass: "OauthClients",
20341
+ operationId: "deleteOauthClient",
20342
+ description: "Deletes the client and every connection made through it.",
20343
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-clients",
20344
+ httpMethod: "delete",
20345
+ pathParams: ["oauth_client_id", "project_id"],
20346
+ queryParams: [],
20347
+ headerParams: [],
20348
+ cookieParams: [],
20349
+ flags: [{
20350
+ "name": "oauth_client_id",
20351
+ "description": "OAuth client ID",
20352
+ "required": true,
20353
+ "type": "string",
20354
+ "in": "path"
20355
+ }, {
20356
+ "name": "project_id",
20357
+ "description": "Project public ID (proj_ prefix).",
20358
+ "required": true,
20359
+ "type": "string",
20360
+ "in": "path"
20361
+ }]
20362
+ },
20363
+ "list-oauth-connections": {
20364
+ serviceClass: "OauthConnections",
20365
+ operationId: "listOauthConnections",
20366
+ description: "Returns a project's OAuth connections, without tokens.",
20367
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-connections",
20368
+ httpMethod: "get",
20369
+ pathParams: ["project_id"],
20370
+ queryParams: [
20371
+ "actor_id",
20372
+ "oauth_client_id",
20373
+ "limit",
20374
+ "cursor"
20375
+ ],
20376
+ headerParams: [],
20377
+ cookieParams: [],
20378
+ flags: [
20379
+ {
20380
+ "name": "project_id",
20381
+ "description": "Project public ID (proj_ prefix).",
20382
+ "required": true,
20383
+ "type": "string",
20384
+ "in": "path"
20385
+ },
20386
+ {
20387
+ "name": "actor_id",
20388
+ "description": "Only this actor's connections",
20389
+ "required": false,
20390
+ "type": "string",
20391
+ "in": "query"
20392
+ },
20393
+ {
20394
+ "name": "oauth_client_id",
20395
+ "description": "Only connections through this OAuth client",
20396
+ "required": false,
20397
+ "type": "string",
20398
+ "in": "query"
20399
+ },
20400
+ {
20401
+ "name": "limit",
20402
+ "description": "Results per page, 1 to 100 (default 50). Above 100 it is clamped; below 1 or not an integer it is `400`.",
20403
+ "required": false,
20404
+ "type": "integer",
20405
+ "in": "query"
20406
+ },
20407
+ {
20408
+ "name": "cursor",
20409
+ "description": "The previous page's `next_cursor`; omit it for the first page. A cursor this list did not issue is `400`.",
20410
+ "required": false,
20411
+ "type": "string",
20412
+ "in": "query"
20413
+ }
20414
+ ]
20415
+ },
20416
+ "create-oauth-connection": {
20417
+ serviceClass: "OauthConnections",
20418
+ operationId: "createOauthConnection",
20419
+ description: "Starts the authorization of an actor through an OAuth client and returns the `authorize_url` to send the person to; it is single-use and expires after 10 minutes. Starting again for the same actor and client restarts the same connection (`200`), and a connected one keeps its tokens until the new authorization completes. Hand the `authorize_url` only to the person the actor is: whoever consents connects their account to that actor.",
20420
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-connections",
20421
+ httpMethod: "post",
20422
+ pathParams: ["project_id"],
20423
+ queryParams: [],
20424
+ headerParams: [],
20425
+ cookieParams: [],
20426
+ flags: [
20427
+ {
20428
+ "name": "project_id",
20429
+ "description": "Project public ID (proj_ prefix).",
20430
+ "required": true,
20431
+ "type": "string",
20432
+ "in": "path"
20433
+ },
20434
+ {
20435
+ "name": "oauth_client_id",
20436
+ "description": "The OAuth client to connect through.",
20437
+ "required": true,
20438
+ "type": "string",
20439
+ "in": "body"
20440
+ },
20441
+ {
20442
+ "name": "actor_id",
20443
+ "description": "The actor the grant is for.",
20444
+ "required": true,
20445
+ "type": "string",
20446
+ "in": "body"
20447
+ },
20448
+ {
20449
+ "name": "return_url",
20450
+ "description": "Where the callback redirects the person's browser when it completes, with `oauth_connection_id` and `status` (`connected` or `failed`) added to its query.",
20451
+ "required": false,
20452
+ "type": "string",
20453
+ "in": "body"
20454
+ }
20455
+ ]
20456
+ },
20457
+ "get-oauth-connection": {
20458
+ serviceClass: "OauthConnections",
20459
+ operationId: "getOauthConnection",
20460
+ description: "Returns the connection's status, without tokens.",
20461
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-connections",
20462
+ httpMethod: "get",
20463
+ pathParams: ["oauth_connection_id", "project_id"],
20464
+ queryParams: [],
20465
+ headerParams: [],
20466
+ cookieParams: [],
20467
+ flags: [{
20468
+ "name": "oauth_connection_id",
20469
+ "description": "OAuth connection ID",
20470
+ "required": true,
20471
+ "type": "string",
20472
+ "in": "path"
20473
+ }, {
20474
+ "name": "project_id",
20475
+ "description": "Project public ID (proj_ prefix).",
20476
+ "required": true,
20477
+ "type": "string",
20478
+ "in": "path"
20479
+ }]
20480
+ },
20481
+ "delete-oauth-connection": {
20482
+ serviceClass: "OauthConnections",
20483
+ operationId: "deleteOauthConnection",
20484
+ description: "Revokes the grant at the provider's `revocation_url`, when the client has one, and deletes the connection. A failed revocation does not stop the deletion.",
20485
+ moduleDocsUrl: "https://naturali.ai/docs/modules/oauth-connections",
20486
+ httpMethod: "delete",
20487
+ pathParams: ["oauth_connection_id", "project_id"],
20488
+ queryParams: [],
20489
+ headerParams: [],
20490
+ cookieParams: [],
20491
+ flags: [{
20492
+ "name": "oauth_connection_id",
20493
+ "description": "OAuth connection ID",
20494
+ "required": true,
20495
+ "type": "string",
20496
+ "in": "path"
20497
+ }, {
20498
+ "name": "project_id",
20499
+ "description": "Project public ID (proj_ prefix).",
20500
+ "required": true,
20501
+ "type": "string",
20502
+ "in": "path"
20503
+ }]
20504
+ },
19959
20505
  "list-orchestrations": {
19960
20506
  serviceClass: "Orchestrations",
19961
20507
  operationId: "listOrchestrations",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.230.0",
3
+ "version": "0.232.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "keywords": [
6
6
  "naturali",
@@ -31,7 +31,7 @@
31
31
  "yaml": "^2.9.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@naturali/sdk": "0.230.0",
34
+ "@naturali/sdk": "0.232.0",
35
35
  "@ttoss/openapi-codegen": "^0.10.0",
36
36
  "@types/node": "^26.5.1",
37
37
  "tsdown": "^0.23.0",