@discomedia/utils 1.0.72 → 1.0.74
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-frontend.cjs +608 -13
- package/dist/index-frontend.cjs.map +1 -1
- package/dist/index-frontend.mjs +608 -13
- package/dist/index-frontend.mjs.map +1 -1
- package/dist/index.cjs +696 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +696 -19
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +4 -4
- package/dist/test.js +2556 -8967
- package/dist/test.js.map +1 -1
- package/dist/types/llm-config.d.ts +1 -1
- package/dist/types/llm-config.d.ts.map +1 -1
- package/dist/types/types/llm-types.d.ts +2 -2
- package/dist/types/types/llm-types.d.ts.map +1 -1
- package/dist/types-frontend/llm-config.d.ts +1 -1
- package/dist/types-frontend/llm-config.d.ts.map +1 -1
- package/dist/types-frontend/types/llm-types.d.ts +2 -2
- package/dist/types-frontend/types/llm-types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index-frontend.mjs
CHANGED
|
@@ -5,6 +5,7 @@ const OPENAI_MODELS = [
|
|
|
5
5
|
'gpt-5',
|
|
6
6
|
'gpt-5-mini',
|
|
7
7
|
'gpt-5.4-mini',
|
|
8
|
+
'gpt-5.4-nano',
|
|
8
9
|
'gpt-5-nano',
|
|
9
10
|
'gpt-5.1',
|
|
10
11
|
'gpt-5.4',
|
|
@@ -47,6 +48,7 @@ const OPENROUTER_MODELS = [
|
|
|
47
48
|
'openai/gpt-5',
|
|
48
49
|
'openai/gpt-5-mini',
|
|
49
50
|
'openai/gpt-5.4-mini',
|
|
51
|
+
'openai/gpt-5.4-nano',
|
|
50
52
|
'openai/gpt-5-nano',
|
|
51
53
|
'openai/gpt-5.1',
|
|
52
54
|
'openai/gpt-5.4',
|
|
@@ -344,7 +346,7 @@ const safeJSON = (text) => {
|
|
|
344
346
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
345
347
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
346
348
|
|
|
347
|
-
const VERSION = '6.
|
|
349
|
+
const VERSION = '6.39.0'; // x-release-please-version
|
|
348
350
|
|
|
349
351
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
350
352
|
const isRunningInBrowser = () => {
|
|
@@ -1793,19 +1795,22 @@ class WorkloadIdentityAuth {
|
|
|
1793
1795
|
}
|
|
1794
1796
|
async refreshToken() {
|
|
1795
1797
|
const subjectToken = await this.config.provider.getToken();
|
|
1798
|
+
const body = {
|
|
1799
|
+
grant_type: TOKEN_EXCHANGE_GRANT_TYPE,
|
|
1800
|
+
subject_token: subjectToken,
|
|
1801
|
+
subject_token_type: SUBJECT_TOKEN_TYPES[this.config.provider.tokenType],
|
|
1802
|
+
identity_provider_id: this.config.identityProviderId,
|
|
1803
|
+
service_account_id: this.config.serviceAccountId,
|
|
1804
|
+
};
|
|
1805
|
+
if (this.config.clientId) {
|
|
1806
|
+
body['client_id'] = this.config.clientId;
|
|
1807
|
+
}
|
|
1796
1808
|
const response = await this.fetch(this.tokenExchangeUrl, {
|
|
1797
1809
|
method: 'POST',
|
|
1798
1810
|
headers: {
|
|
1799
1811
|
'Content-Type': 'application/json',
|
|
1800
1812
|
},
|
|
1801
|
-
body: JSON.stringify(
|
|
1802
|
-
grant_type: TOKEN_EXCHANGE_GRANT_TYPE,
|
|
1803
|
-
client_id: this.config.clientId,
|
|
1804
|
-
subject_token: subjectToken,
|
|
1805
|
-
subject_token_type: SUBJECT_TOKEN_TYPES[this.config.provider.tokenType],
|
|
1806
|
-
identity_provider_id: this.config.identityProviderId,
|
|
1807
|
-
service_account_id: this.config.serviceAccountId,
|
|
1808
|
-
}),
|
|
1813
|
+
body: JSON.stringify(body),
|
|
1809
1814
|
});
|
|
1810
1815
|
if (!response.ok) {
|
|
1811
1816
|
const errorText = await response.text();
|
|
@@ -3877,6 +3882,43 @@ let Certificates$1 = class Certificates extends APIResource {
|
|
|
3877
3882
|
}
|
|
3878
3883
|
};
|
|
3879
3884
|
|
|
3885
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3886
|
+
let DataRetention$1 = class DataRetention extends APIResource {
|
|
3887
|
+
/**
|
|
3888
|
+
* Retrieves organization data retention controls.
|
|
3889
|
+
*
|
|
3890
|
+
* @example
|
|
3891
|
+
* ```ts
|
|
3892
|
+
* const organizationDataRetention =
|
|
3893
|
+
* await client.admin.organization.dataRetention.retrieve();
|
|
3894
|
+
* ```
|
|
3895
|
+
*/
|
|
3896
|
+
retrieve(options) {
|
|
3897
|
+
return this._client.get('/organization/data_retention', {
|
|
3898
|
+
...options,
|
|
3899
|
+
__security: { adminAPIKeyAuth: true },
|
|
3900
|
+
});
|
|
3901
|
+
}
|
|
3902
|
+
/**
|
|
3903
|
+
* Updates organization data retention controls.
|
|
3904
|
+
*
|
|
3905
|
+
* @example
|
|
3906
|
+
* ```ts
|
|
3907
|
+
* const organizationDataRetention =
|
|
3908
|
+
* await client.admin.organization.dataRetention.update({
|
|
3909
|
+
* retention_type: 'zero_data_retention',
|
|
3910
|
+
* });
|
|
3911
|
+
* ```
|
|
3912
|
+
*/
|
|
3913
|
+
update(body, options) {
|
|
3914
|
+
return this._client.post('/organization/data_retention', {
|
|
3915
|
+
body,
|
|
3916
|
+
...options,
|
|
3917
|
+
__security: { adminAPIKeyAuth: true },
|
|
3918
|
+
});
|
|
3919
|
+
}
|
|
3920
|
+
};
|
|
3921
|
+
|
|
3880
3922
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3881
3923
|
class Invites extends APIResource {
|
|
3882
3924
|
/**
|
|
@@ -3973,6 +4015,22 @@ let Roles$5 = class Roles extends APIResource {
|
|
|
3973
4015
|
__security: { adminAPIKeyAuth: true },
|
|
3974
4016
|
});
|
|
3975
4017
|
}
|
|
4018
|
+
/**
|
|
4019
|
+
* Retrieves an organization role.
|
|
4020
|
+
*
|
|
4021
|
+
* @example
|
|
4022
|
+
* ```ts
|
|
4023
|
+
* const role = await client.admin.organization.roles.retrieve(
|
|
4024
|
+
* 'role_id',
|
|
4025
|
+
* );
|
|
4026
|
+
* ```
|
|
4027
|
+
*/
|
|
4028
|
+
retrieve(roleID, options) {
|
|
4029
|
+
return this._client.get(path `/organization/roles/${roleID}`, {
|
|
4030
|
+
...options,
|
|
4031
|
+
__security: { adminAPIKeyAuth: true },
|
|
4032
|
+
});
|
|
4033
|
+
}
|
|
3976
4034
|
/**
|
|
3977
4035
|
* Updates an existing organization role.
|
|
3978
4036
|
*
|
|
@@ -4026,6 +4084,92 @@ let Roles$5 = class Roles extends APIResource {
|
|
|
4026
4084
|
}
|
|
4027
4085
|
};
|
|
4028
4086
|
|
|
4087
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4088
|
+
let SpendAlerts$1 = class SpendAlerts extends APIResource {
|
|
4089
|
+
/**
|
|
4090
|
+
* Creates an organization spend alert.
|
|
4091
|
+
*
|
|
4092
|
+
* @example
|
|
4093
|
+
* ```ts
|
|
4094
|
+
* const organizationSpendAlert =
|
|
4095
|
+
* await client.admin.organization.spendAlerts.create({
|
|
4096
|
+
* currency: 'USD',
|
|
4097
|
+
* interval: 'month',
|
|
4098
|
+
* notification_channel: {
|
|
4099
|
+
* recipients: ['string'],
|
|
4100
|
+
* type: 'email',
|
|
4101
|
+
* },
|
|
4102
|
+
* threshold_amount: 0,
|
|
4103
|
+
* });
|
|
4104
|
+
* ```
|
|
4105
|
+
*/
|
|
4106
|
+
create(body, options) {
|
|
4107
|
+
return this._client.post('/organization/spend_alerts', {
|
|
4108
|
+
body,
|
|
4109
|
+
...options,
|
|
4110
|
+
__security: { adminAPIKeyAuth: true },
|
|
4111
|
+
});
|
|
4112
|
+
}
|
|
4113
|
+
/**
|
|
4114
|
+
* Updates an organization spend alert.
|
|
4115
|
+
*
|
|
4116
|
+
* @example
|
|
4117
|
+
* ```ts
|
|
4118
|
+
* const organizationSpendAlert =
|
|
4119
|
+
* await client.admin.organization.spendAlerts.update(
|
|
4120
|
+
* 'alert_id',
|
|
4121
|
+
* {
|
|
4122
|
+
* currency: 'USD',
|
|
4123
|
+
* interval: 'month',
|
|
4124
|
+
* notification_channel: {
|
|
4125
|
+
* recipients: ['string'],
|
|
4126
|
+
* type: 'email',
|
|
4127
|
+
* },
|
|
4128
|
+
* threshold_amount: 0,
|
|
4129
|
+
* },
|
|
4130
|
+
* );
|
|
4131
|
+
* ```
|
|
4132
|
+
*/
|
|
4133
|
+
update(alertID, body, options) {
|
|
4134
|
+
return this._client.post(path `/organization/spend_alerts/${alertID}`, {
|
|
4135
|
+
body,
|
|
4136
|
+
...options,
|
|
4137
|
+
__security: { adminAPIKeyAuth: true },
|
|
4138
|
+
});
|
|
4139
|
+
}
|
|
4140
|
+
/**
|
|
4141
|
+
* Lists organization spend alerts.
|
|
4142
|
+
*
|
|
4143
|
+
* @example
|
|
4144
|
+
* ```ts
|
|
4145
|
+
* // Automatically fetches more pages as needed.
|
|
4146
|
+
* for await (const organizationSpendAlert of client.admin.organization.spendAlerts.list()) {
|
|
4147
|
+
* // ...
|
|
4148
|
+
* }
|
|
4149
|
+
* ```
|
|
4150
|
+
*/
|
|
4151
|
+
list(query = {}, options) {
|
|
4152
|
+
return this._client.getAPIList('/organization/spend_alerts', (ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
|
|
4153
|
+
}
|
|
4154
|
+
/**
|
|
4155
|
+
* Deletes an organization spend alert.
|
|
4156
|
+
*
|
|
4157
|
+
* @example
|
|
4158
|
+
* ```ts
|
|
4159
|
+
* const organizationSpendAlertDeleted =
|
|
4160
|
+
* await client.admin.organization.spendAlerts.delete(
|
|
4161
|
+
* 'alert_id',
|
|
4162
|
+
* );
|
|
4163
|
+
* ```
|
|
4164
|
+
*/
|
|
4165
|
+
delete(alertID, options) {
|
|
4166
|
+
return this._client.delete(path `/organization/spend_alerts/${alertID}`, {
|
|
4167
|
+
...options,
|
|
4168
|
+
__security: { adminAPIKeyAuth: true },
|
|
4169
|
+
});
|
|
4170
|
+
}
|
|
4171
|
+
};
|
|
4172
|
+
|
|
4029
4173
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4030
4174
|
class Usage extends APIResource {
|
|
4031
4175
|
/**
|
|
@@ -4136,6 +4280,24 @@ class Usage extends APIResource {
|
|
|
4136
4280
|
__security: { adminAPIKeyAuth: true },
|
|
4137
4281
|
});
|
|
4138
4282
|
}
|
|
4283
|
+
/**
|
|
4284
|
+
* Get file search calls usage details for the organization.
|
|
4285
|
+
*
|
|
4286
|
+
* @example
|
|
4287
|
+
* ```ts
|
|
4288
|
+
* const response =
|
|
4289
|
+
* await client.admin.organization.usage.fileSearchCalls({
|
|
4290
|
+
* start_time: 0,
|
|
4291
|
+
* });
|
|
4292
|
+
* ```
|
|
4293
|
+
*/
|
|
4294
|
+
fileSearchCalls(query, options) {
|
|
4295
|
+
return this._client.get('/organization/usage/file_search_calls', {
|
|
4296
|
+
query,
|
|
4297
|
+
...options,
|
|
4298
|
+
__security: { adminAPIKeyAuth: true },
|
|
4299
|
+
});
|
|
4300
|
+
}
|
|
4139
4301
|
/**
|
|
4140
4302
|
* Get images usage details for the organization.
|
|
4141
4303
|
*
|
|
@@ -4190,6 +4352,24 @@ class Usage extends APIResource {
|
|
|
4190
4352
|
__security: { adminAPIKeyAuth: true },
|
|
4191
4353
|
});
|
|
4192
4354
|
}
|
|
4355
|
+
/**
|
|
4356
|
+
* Get web search calls usage details for the organization.
|
|
4357
|
+
*
|
|
4358
|
+
* @example
|
|
4359
|
+
* ```ts
|
|
4360
|
+
* const response =
|
|
4361
|
+
* await client.admin.organization.usage.webSearchCalls({
|
|
4362
|
+
* start_time: 0,
|
|
4363
|
+
* });
|
|
4364
|
+
* ```
|
|
4365
|
+
*/
|
|
4366
|
+
webSearchCalls(query, options) {
|
|
4367
|
+
return this._client.get('/organization/usage/web_search_calls', {
|
|
4368
|
+
query,
|
|
4369
|
+
...options,
|
|
4370
|
+
__security: { adminAPIKeyAuth: true },
|
|
4371
|
+
});
|
|
4372
|
+
}
|
|
4193
4373
|
}
|
|
4194
4374
|
|
|
4195
4375
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
@@ -4213,6 +4393,25 @@ let Roles$4 = class Roles extends APIResource {
|
|
|
4213
4393
|
__security: { adminAPIKeyAuth: true },
|
|
4214
4394
|
});
|
|
4215
4395
|
}
|
|
4396
|
+
/**
|
|
4397
|
+
* Retrieves an organization role assigned to a group.
|
|
4398
|
+
*
|
|
4399
|
+
* @example
|
|
4400
|
+
* ```ts
|
|
4401
|
+
* const role =
|
|
4402
|
+
* await client.admin.organization.groups.roles.retrieve(
|
|
4403
|
+
* 'role_id',
|
|
4404
|
+
* { group_id: 'group_id' },
|
|
4405
|
+
* );
|
|
4406
|
+
* ```
|
|
4407
|
+
*/
|
|
4408
|
+
retrieve(roleID, params, options) {
|
|
4409
|
+
const { group_id } = params;
|
|
4410
|
+
return this._client.get(path `/organization/groups/${group_id}/roles/${roleID}`, {
|
|
4411
|
+
...options,
|
|
4412
|
+
__security: { adminAPIKeyAuth: true },
|
|
4413
|
+
});
|
|
4414
|
+
}
|
|
4216
4415
|
/**
|
|
4217
4416
|
* Lists the organization roles assigned to a group within the organization.
|
|
4218
4417
|
*
|
|
@@ -4271,6 +4470,25 @@ let Users$2 = class Users extends APIResource {
|
|
|
4271
4470
|
__security: { adminAPIKeyAuth: true },
|
|
4272
4471
|
});
|
|
4273
4472
|
}
|
|
4473
|
+
/**
|
|
4474
|
+
* Retrieves a user in a group.
|
|
4475
|
+
*
|
|
4476
|
+
* @example
|
|
4477
|
+
* ```ts
|
|
4478
|
+
* const user =
|
|
4479
|
+
* await client.admin.organization.groups.users.retrieve(
|
|
4480
|
+
* 'user_id',
|
|
4481
|
+
* { group_id: 'group_id' },
|
|
4482
|
+
* );
|
|
4483
|
+
* ```
|
|
4484
|
+
*/
|
|
4485
|
+
retrieve(userID, params, options) {
|
|
4486
|
+
const { group_id } = params;
|
|
4487
|
+
return this._client.get(path `/organization/groups/${group_id}/users/${userID}`, {
|
|
4488
|
+
...options,
|
|
4489
|
+
__security: { adminAPIKeyAuth: true },
|
|
4490
|
+
});
|
|
4491
|
+
}
|
|
4274
4492
|
/**
|
|
4275
4493
|
* Lists the users assigned to a group.
|
|
4276
4494
|
*
|
|
@@ -4332,6 +4550,23 @@ let Groups$1 = class Groups extends APIResource {
|
|
|
4332
4550
|
__security: { adminAPIKeyAuth: true },
|
|
4333
4551
|
});
|
|
4334
4552
|
}
|
|
4553
|
+
/**
|
|
4554
|
+
* Retrieves a group.
|
|
4555
|
+
*
|
|
4556
|
+
* @example
|
|
4557
|
+
* ```ts
|
|
4558
|
+
* const group =
|
|
4559
|
+
* await client.admin.organization.groups.retrieve(
|
|
4560
|
+
* 'group_id',
|
|
4561
|
+
* );
|
|
4562
|
+
* ```
|
|
4563
|
+
*/
|
|
4564
|
+
retrieve(groupID, options) {
|
|
4565
|
+
return this._client.get(path `/organization/groups/${groupID}`, {
|
|
4566
|
+
...options,
|
|
4567
|
+
__security: { adminAPIKeyAuth: true },
|
|
4568
|
+
});
|
|
4569
|
+
}
|
|
4335
4570
|
/**
|
|
4336
4571
|
* Updates a group's information.
|
|
4337
4572
|
*
|
|
@@ -4506,6 +4741,142 @@ class Certificates extends APIResource {
|
|
|
4506
4741
|
}
|
|
4507
4742
|
}
|
|
4508
4743
|
|
|
4744
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4745
|
+
class DataRetention extends APIResource {
|
|
4746
|
+
/**
|
|
4747
|
+
* Retrieves project data retention controls.
|
|
4748
|
+
*
|
|
4749
|
+
* @example
|
|
4750
|
+
* ```ts
|
|
4751
|
+
* const projectDataRetention =
|
|
4752
|
+
* await client.admin.organization.projects.dataRetention.retrieve(
|
|
4753
|
+
* 'project_id',
|
|
4754
|
+
* );
|
|
4755
|
+
* ```
|
|
4756
|
+
*/
|
|
4757
|
+
retrieve(projectID, options) {
|
|
4758
|
+
return this._client.get(path `/organization/projects/${projectID}/data_retention`, {
|
|
4759
|
+
...options,
|
|
4760
|
+
__security: { adminAPIKeyAuth: true },
|
|
4761
|
+
});
|
|
4762
|
+
}
|
|
4763
|
+
/**
|
|
4764
|
+
* Updates project data retention controls.
|
|
4765
|
+
*
|
|
4766
|
+
* @example
|
|
4767
|
+
* ```ts
|
|
4768
|
+
* const projectDataRetention =
|
|
4769
|
+
* await client.admin.organization.projects.dataRetention.update(
|
|
4770
|
+
* 'project_id',
|
|
4771
|
+
* { retention_type: 'organization_default' },
|
|
4772
|
+
* );
|
|
4773
|
+
* ```
|
|
4774
|
+
*/
|
|
4775
|
+
update(projectID, body, options) {
|
|
4776
|
+
return this._client.post(path `/organization/projects/${projectID}/data_retention`, {
|
|
4777
|
+
body,
|
|
4778
|
+
...options,
|
|
4779
|
+
__security: { adminAPIKeyAuth: true },
|
|
4780
|
+
});
|
|
4781
|
+
}
|
|
4782
|
+
}
|
|
4783
|
+
|
|
4784
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4785
|
+
class HostedToolPermissions extends APIResource {
|
|
4786
|
+
/**
|
|
4787
|
+
* Returns hosted tool permissions for a project.
|
|
4788
|
+
*
|
|
4789
|
+
* @example
|
|
4790
|
+
* ```ts
|
|
4791
|
+
* const projectHostedToolPermissions =
|
|
4792
|
+
* await client.admin.organization.projects.hostedToolPermissions.retrieve(
|
|
4793
|
+
* 'project_id',
|
|
4794
|
+
* );
|
|
4795
|
+
* ```
|
|
4796
|
+
*/
|
|
4797
|
+
retrieve(projectID, options) {
|
|
4798
|
+
return this._client.get(path `/organization/projects/${projectID}/hosted_tool_permissions`, {
|
|
4799
|
+
...options,
|
|
4800
|
+
__security: { adminAPIKeyAuth: true },
|
|
4801
|
+
});
|
|
4802
|
+
}
|
|
4803
|
+
/**
|
|
4804
|
+
* Updates hosted tool permissions for a project.
|
|
4805
|
+
*
|
|
4806
|
+
* @example
|
|
4807
|
+
* ```ts
|
|
4808
|
+
* const projectHostedToolPermissions =
|
|
4809
|
+
* await client.admin.organization.projects.hostedToolPermissions.update(
|
|
4810
|
+
* 'project_id',
|
|
4811
|
+
* );
|
|
4812
|
+
* ```
|
|
4813
|
+
*/
|
|
4814
|
+
update(projectID, body, options) {
|
|
4815
|
+
return this._client.post(path `/organization/projects/${projectID}/hosted_tool_permissions`, {
|
|
4816
|
+
body,
|
|
4817
|
+
...options,
|
|
4818
|
+
__security: { adminAPIKeyAuth: true },
|
|
4819
|
+
});
|
|
4820
|
+
}
|
|
4821
|
+
}
|
|
4822
|
+
|
|
4823
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4824
|
+
class ModelPermissions extends APIResource {
|
|
4825
|
+
/**
|
|
4826
|
+
* Returns model permissions for a project.
|
|
4827
|
+
*
|
|
4828
|
+
* @example
|
|
4829
|
+
* ```ts
|
|
4830
|
+
* const projectModelPermissions =
|
|
4831
|
+
* await client.admin.organization.projects.modelPermissions.retrieve(
|
|
4832
|
+
* 'project_id',
|
|
4833
|
+
* );
|
|
4834
|
+
* ```
|
|
4835
|
+
*/
|
|
4836
|
+
retrieve(projectID, options) {
|
|
4837
|
+
return this._client.get(path `/organization/projects/${projectID}/model_permissions`, {
|
|
4838
|
+
...options,
|
|
4839
|
+
__security: { adminAPIKeyAuth: true },
|
|
4840
|
+
});
|
|
4841
|
+
}
|
|
4842
|
+
/**
|
|
4843
|
+
* Updates model permissions for a project.
|
|
4844
|
+
*
|
|
4845
|
+
* @example
|
|
4846
|
+
* ```ts
|
|
4847
|
+
* const projectModelPermissions =
|
|
4848
|
+
* await client.admin.organization.projects.modelPermissions.update(
|
|
4849
|
+
* 'project_id',
|
|
4850
|
+
* { mode: 'allow_list', model_ids: ['string'] },
|
|
4851
|
+
* );
|
|
4852
|
+
* ```
|
|
4853
|
+
*/
|
|
4854
|
+
update(projectID, body, options) {
|
|
4855
|
+
return this._client.post(path `/organization/projects/${projectID}/model_permissions`, {
|
|
4856
|
+
body,
|
|
4857
|
+
...options,
|
|
4858
|
+
__security: { adminAPIKeyAuth: true },
|
|
4859
|
+
});
|
|
4860
|
+
}
|
|
4861
|
+
/**
|
|
4862
|
+
* Deletes model permissions for a project.
|
|
4863
|
+
*
|
|
4864
|
+
* @example
|
|
4865
|
+
* ```ts
|
|
4866
|
+
* const projectModelPermissionsDeleted =
|
|
4867
|
+
* await client.admin.organization.projects.modelPermissions.delete(
|
|
4868
|
+
* 'project_id',
|
|
4869
|
+
* );
|
|
4870
|
+
* ```
|
|
4871
|
+
*/
|
|
4872
|
+
delete(projectID, options) {
|
|
4873
|
+
return this._client.delete(path `/organization/projects/${projectID}/model_permissions`, {
|
|
4874
|
+
...options,
|
|
4875
|
+
__security: { adminAPIKeyAuth: true },
|
|
4876
|
+
});
|
|
4877
|
+
}
|
|
4878
|
+
}
|
|
4879
|
+
|
|
4509
4880
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4510
4881
|
class RateLimits extends APIResource {
|
|
4511
4882
|
/**
|
|
@@ -4567,6 +4938,25 @@ let Roles$3 = class Roles extends APIResource {
|
|
|
4567
4938
|
__security: { adminAPIKeyAuth: true },
|
|
4568
4939
|
});
|
|
4569
4940
|
}
|
|
4941
|
+
/**
|
|
4942
|
+
* Retrieves a project role.
|
|
4943
|
+
*
|
|
4944
|
+
* @example
|
|
4945
|
+
* ```ts
|
|
4946
|
+
* const role =
|
|
4947
|
+
* await client.admin.organization.projects.roles.retrieve(
|
|
4948
|
+
* 'role_id',
|
|
4949
|
+
* { project_id: 'project_id' },
|
|
4950
|
+
* );
|
|
4951
|
+
* ```
|
|
4952
|
+
*/
|
|
4953
|
+
retrieve(roleID, params, options) {
|
|
4954
|
+
const { project_id } = params;
|
|
4955
|
+
return this._client.get(path `/projects/${project_id}/roles/${roleID}`, {
|
|
4956
|
+
...options,
|
|
4957
|
+
__security: { adminAPIKeyAuth: true },
|
|
4958
|
+
});
|
|
4959
|
+
}
|
|
4570
4960
|
/**
|
|
4571
4961
|
* Updates an existing project role.
|
|
4572
4962
|
*
|
|
@@ -4669,6 +5059,22 @@ class ServiceAccounts extends APIResource {
|
|
|
4669
5059
|
__security: { adminAPIKeyAuth: true },
|
|
4670
5060
|
});
|
|
4671
5061
|
}
|
|
5062
|
+
/**
|
|
5063
|
+
* Updates a service account in the project.
|
|
5064
|
+
*
|
|
5065
|
+
* @example
|
|
5066
|
+
* ```ts
|
|
5067
|
+
* const projectServiceAccount =
|
|
5068
|
+
* await client.admin.organization.projects.serviceAccounts.update(
|
|
5069
|
+
* 'service_account_id',
|
|
5070
|
+
* { project_id: 'project_id' },
|
|
5071
|
+
* );
|
|
5072
|
+
* ```
|
|
5073
|
+
*/
|
|
5074
|
+
update(serviceAccountID, params, options) {
|
|
5075
|
+
const { project_id, ...body } = params;
|
|
5076
|
+
return this._client.post(path `/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { body, ...options, __security: { adminAPIKeyAuth: true } });
|
|
5077
|
+
}
|
|
4672
5078
|
/**
|
|
4673
5079
|
* Returns a list of service accounts in the project.
|
|
4674
5080
|
*
|
|
@@ -4706,6 +5112,101 @@ class ServiceAccounts extends APIResource {
|
|
|
4706
5112
|
}
|
|
4707
5113
|
}
|
|
4708
5114
|
|
|
5115
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
5116
|
+
class SpendAlerts extends APIResource {
|
|
5117
|
+
/**
|
|
5118
|
+
* Creates a project spend alert.
|
|
5119
|
+
*
|
|
5120
|
+
* @example
|
|
5121
|
+
* ```ts
|
|
5122
|
+
* const projectSpendAlert =
|
|
5123
|
+
* await client.admin.organization.projects.spendAlerts.create(
|
|
5124
|
+
* 'project_id',
|
|
5125
|
+
* {
|
|
5126
|
+
* currency: 'USD',
|
|
5127
|
+
* interval: 'month',
|
|
5128
|
+
* notification_channel: {
|
|
5129
|
+
* recipients: ['string'],
|
|
5130
|
+
* type: 'email',
|
|
5131
|
+
* },
|
|
5132
|
+
* threshold_amount: 0,
|
|
5133
|
+
* },
|
|
5134
|
+
* );
|
|
5135
|
+
* ```
|
|
5136
|
+
*/
|
|
5137
|
+
create(projectID, body, options) {
|
|
5138
|
+
return this._client.post(path `/organization/projects/${projectID}/spend_alerts`, {
|
|
5139
|
+
body,
|
|
5140
|
+
...options,
|
|
5141
|
+
__security: { adminAPIKeyAuth: true },
|
|
5142
|
+
});
|
|
5143
|
+
}
|
|
5144
|
+
/**
|
|
5145
|
+
* Updates a project spend alert.
|
|
5146
|
+
*
|
|
5147
|
+
* @example
|
|
5148
|
+
* ```ts
|
|
5149
|
+
* const projectSpendAlert =
|
|
5150
|
+
* await client.admin.organization.projects.spendAlerts.update(
|
|
5151
|
+
* 'alert_id',
|
|
5152
|
+
* {
|
|
5153
|
+
* project_id: 'project_id',
|
|
5154
|
+
* currency: 'USD',
|
|
5155
|
+
* interval: 'month',
|
|
5156
|
+
* notification_channel: {
|
|
5157
|
+
* recipients: ['string'],
|
|
5158
|
+
* type: 'email',
|
|
5159
|
+
* },
|
|
5160
|
+
* threshold_amount: 0,
|
|
5161
|
+
* },
|
|
5162
|
+
* );
|
|
5163
|
+
* ```
|
|
5164
|
+
*/
|
|
5165
|
+
update(alertID, params, options) {
|
|
5166
|
+
const { project_id, ...body } = params;
|
|
5167
|
+
return this._client.post(path `/organization/projects/${project_id}/spend_alerts/${alertID}`, {
|
|
5168
|
+
body,
|
|
5169
|
+
...options,
|
|
5170
|
+
__security: { adminAPIKeyAuth: true },
|
|
5171
|
+
});
|
|
5172
|
+
}
|
|
5173
|
+
/**
|
|
5174
|
+
* Lists project spend alerts.
|
|
5175
|
+
*
|
|
5176
|
+
* @example
|
|
5177
|
+
* ```ts
|
|
5178
|
+
* // Automatically fetches more pages as needed.
|
|
5179
|
+
* for await (const projectSpendAlert of client.admin.organization.projects.spendAlerts.list(
|
|
5180
|
+
* 'project_id',
|
|
5181
|
+
* )) {
|
|
5182
|
+
* // ...
|
|
5183
|
+
* }
|
|
5184
|
+
* ```
|
|
5185
|
+
*/
|
|
5186
|
+
list(projectID, query = {}, options) {
|
|
5187
|
+
return this._client.getAPIList(path `/organization/projects/${projectID}/spend_alerts`, (ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
|
|
5188
|
+
}
|
|
5189
|
+
/**
|
|
5190
|
+
* Deletes a project spend alert.
|
|
5191
|
+
*
|
|
5192
|
+
* @example
|
|
5193
|
+
* ```ts
|
|
5194
|
+
* const projectSpendAlertDeleted =
|
|
5195
|
+
* await client.admin.organization.projects.spendAlerts.delete(
|
|
5196
|
+
* 'alert_id',
|
|
5197
|
+
* { project_id: 'project_id' },
|
|
5198
|
+
* );
|
|
5199
|
+
* ```
|
|
5200
|
+
*/
|
|
5201
|
+
delete(alertID, params, options) {
|
|
5202
|
+
const { project_id } = params;
|
|
5203
|
+
return this._client.delete(path `/organization/projects/${project_id}/spend_alerts/${alertID}`, {
|
|
5204
|
+
...options,
|
|
5205
|
+
__security: { adminAPIKeyAuth: true },
|
|
5206
|
+
});
|
|
5207
|
+
}
|
|
5208
|
+
}
|
|
5209
|
+
|
|
4709
5210
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4710
5211
|
let Roles$2 = class Roles extends APIResource {
|
|
4711
5212
|
/**
|
|
@@ -4728,6 +5229,25 @@ let Roles$2 = class Roles extends APIResource {
|
|
|
4728
5229
|
__security: { adminAPIKeyAuth: true },
|
|
4729
5230
|
});
|
|
4730
5231
|
}
|
|
5232
|
+
/**
|
|
5233
|
+
* Retrieves a project role assigned to a group.
|
|
5234
|
+
*
|
|
5235
|
+
* @example
|
|
5236
|
+
* ```ts
|
|
5237
|
+
* const role =
|
|
5238
|
+
* await client.admin.organization.projects.groups.roles.retrieve(
|
|
5239
|
+
* 'role_id',
|
|
5240
|
+
* { project_id: 'project_id', group_id: 'group_id' },
|
|
5241
|
+
* );
|
|
5242
|
+
* ```
|
|
5243
|
+
*/
|
|
5244
|
+
retrieve(roleID, params, options) {
|
|
5245
|
+
const { project_id, group_id } = params;
|
|
5246
|
+
return this._client.get(path `/projects/${project_id}/groups/${group_id}/roles/${roleID}`, {
|
|
5247
|
+
...options,
|
|
5248
|
+
__security: { adminAPIKeyAuth: true },
|
|
5249
|
+
});
|
|
5250
|
+
}
|
|
4731
5251
|
/**
|
|
4732
5252
|
* Lists the project roles assigned to a group within a project.
|
|
4733
5253
|
*
|
|
@@ -4792,6 +5312,26 @@ class Groups extends APIResource {
|
|
|
4792
5312
|
__security: { adminAPIKeyAuth: true },
|
|
4793
5313
|
});
|
|
4794
5314
|
}
|
|
5315
|
+
/**
|
|
5316
|
+
* Retrieves a project's group.
|
|
5317
|
+
*
|
|
5318
|
+
* @example
|
|
5319
|
+
* ```ts
|
|
5320
|
+
* const projectGroup =
|
|
5321
|
+
* await client.admin.organization.projects.groups.retrieve(
|
|
5322
|
+
* 'group_id',
|
|
5323
|
+
* { project_id: 'project_id' },
|
|
5324
|
+
* );
|
|
5325
|
+
* ```
|
|
5326
|
+
*/
|
|
5327
|
+
retrieve(groupID, params, options) {
|
|
5328
|
+
const { project_id, ...query } = params;
|
|
5329
|
+
return this._client.get(path `/organization/projects/${project_id}/groups/${groupID}`, {
|
|
5330
|
+
query,
|
|
5331
|
+
...options,
|
|
5332
|
+
__security: { adminAPIKeyAuth: true },
|
|
5333
|
+
});
|
|
5334
|
+
}
|
|
4795
5335
|
/**
|
|
4796
5336
|
* Lists the groups that have access to a project.
|
|
4797
5337
|
*
|
|
@@ -4852,6 +5392,25 @@ let Roles$1 = class Roles extends APIResource {
|
|
|
4852
5392
|
__security: { adminAPIKeyAuth: true },
|
|
4853
5393
|
});
|
|
4854
5394
|
}
|
|
5395
|
+
/**
|
|
5396
|
+
* Retrieves a project role assigned to a user.
|
|
5397
|
+
*
|
|
5398
|
+
* @example
|
|
5399
|
+
* ```ts
|
|
5400
|
+
* const role =
|
|
5401
|
+
* await client.admin.organization.projects.users.roles.retrieve(
|
|
5402
|
+
* 'role_id',
|
|
5403
|
+
* { project_id: 'project_id', user_id: 'user_id' },
|
|
5404
|
+
* );
|
|
5405
|
+
* ```
|
|
5406
|
+
*/
|
|
5407
|
+
retrieve(roleID, params, options) {
|
|
5408
|
+
const { project_id, user_id } = params;
|
|
5409
|
+
return this._client.get(path `/projects/${project_id}/users/${user_id}/roles/${roleID}`, {
|
|
5410
|
+
...options,
|
|
5411
|
+
__security: { adminAPIKeyAuth: true },
|
|
5412
|
+
});
|
|
5413
|
+
}
|
|
4855
5414
|
/**
|
|
4856
5415
|
* Lists the project roles assigned to a user within a project.
|
|
4857
5416
|
*
|
|
@@ -5005,8 +5564,12 @@ class Projects extends APIResource {
|
|
|
5005
5564
|
this.serviceAccounts = new ServiceAccounts(this._client);
|
|
5006
5565
|
this.apiKeys = new APIKeys(this._client);
|
|
5007
5566
|
this.rateLimits = new RateLimits(this._client);
|
|
5567
|
+
this.modelPermissions = new ModelPermissions(this._client);
|
|
5568
|
+
this.hostedToolPermissions = new HostedToolPermissions(this._client);
|
|
5008
5569
|
this.groups = new Groups(this._client);
|
|
5009
5570
|
this.roles = new Roles$3(this._client);
|
|
5571
|
+
this.dataRetention = new DataRetention(this._client);
|
|
5572
|
+
this.spendAlerts = new SpendAlerts(this._client);
|
|
5010
5573
|
this.certificates = new Certificates(this._client);
|
|
5011
5574
|
}
|
|
5012
5575
|
/**
|
|
@@ -5104,8 +5667,12 @@ Projects.Users = Users$1;
|
|
|
5104
5667
|
Projects.ServiceAccounts = ServiceAccounts;
|
|
5105
5668
|
Projects.APIKeys = APIKeys;
|
|
5106
5669
|
Projects.RateLimits = RateLimits;
|
|
5670
|
+
Projects.ModelPermissions = ModelPermissions;
|
|
5671
|
+
Projects.HostedToolPermissions = HostedToolPermissions;
|
|
5107
5672
|
Projects.Groups = Groups;
|
|
5108
5673
|
Projects.Roles = Roles$3;
|
|
5674
|
+
Projects.DataRetention = DataRetention;
|
|
5675
|
+
Projects.SpendAlerts = SpendAlerts;
|
|
5109
5676
|
Projects.Certificates = Certificates;
|
|
5110
5677
|
|
|
5111
5678
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
@@ -5129,6 +5696,25 @@ class Roles extends APIResource {
|
|
|
5129
5696
|
__security: { adminAPIKeyAuth: true },
|
|
5130
5697
|
});
|
|
5131
5698
|
}
|
|
5699
|
+
/**
|
|
5700
|
+
* Retrieves an organization role assigned to a user.
|
|
5701
|
+
*
|
|
5702
|
+
* @example
|
|
5703
|
+
* ```ts
|
|
5704
|
+
* const role =
|
|
5705
|
+
* await client.admin.organization.users.roles.retrieve(
|
|
5706
|
+
* 'role_id',
|
|
5707
|
+
* { user_id: 'user_id' },
|
|
5708
|
+
* );
|
|
5709
|
+
* ```
|
|
5710
|
+
*/
|
|
5711
|
+
retrieve(roleID, params, options) {
|
|
5712
|
+
const { user_id } = params;
|
|
5713
|
+
return this._client.get(path `/organization/users/${user_id}/roles/${roleID}`, {
|
|
5714
|
+
...options,
|
|
5715
|
+
__security: { adminAPIKeyAuth: true },
|
|
5716
|
+
});
|
|
5717
|
+
}
|
|
5132
5718
|
/**
|
|
5133
5719
|
* Lists the organization roles assigned to a user within the organization.
|
|
5134
5720
|
*
|
|
@@ -5251,6 +5837,8 @@ class Organization extends APIResource {
|
|
|
5251
5837
|
this.users = new Users(this._client);
|
|
5252
5838
|
this.groups = new Groups$1(this._client);
|
|
5253
5839
|
this.roles = new Roles$5(this._client);
|
|
5840
|
+
this.dataRetention = new DataRetention$1(this._client);
|
|
5841
|
+
this.spendAlerts = new SpendAlerts$1(this._client);
|
|
5254
5842
|
this.certificates = new Certificates$1(this._client);
|
|
5255
5843
|
this.projects = new Projects(this._client);
|
|
5256
5844
|
}
|
|
@@ -5262,6 +5850,8 @@ Organization.Invites = Invites;
|
|
|
5262
5850
|
Organization.Users = Users;
|
|
5263
5851
|
Organization.Groups = Groups$1;
|
|
5264
5852
|
Organization.Roles = Roles$5;
|
|
5853
|
+
Organization.DataRetention = DataRetention$1;
|
|
5854
|
+
Organization.SpendAlerts = SpendAlerts$1;
|
|
5265
5855
|
Organization.Certificates = Certificates$1;
|
|
5266
5856
|
Organization.Projects = Projects;
|
|
5267
5857
|
|
|
@@ -12256,7 +12846,7 @@ const DEFAULT_MODEL = 'gpt-5.4-mini';
|
|
|
12256
12846
|
const GPT_5_HIGH_CONTEXT_THRESHOLD_TOKENS = 272_000;
|
|
12257
12847
|
const GPT_5_HIGH_CONTEXT_INPUT_MULTIPLIER = 2;
|
|
12258
12848
|
const GPT_5_HIGH_CONTEXT_OUTPUT_MULTIPLIER = 1.5;
|
|
12259
|
-
/** Token costs in USD per 1M tokens. Last updated May 2026. */
|
|
12849
|
+
/** Token costs in USD per 1M tokens. Last updated May 2026 from the OpenAI API pricing page. */
|
|
12260
12850
|
const openAiModelCosts = {
|
|
12261
12851
|
'gpt-5': {
|
|
12262
12852
|
inputCost: 1.25 / 1_000_000,
|
|
@@ -12269,9 +12859,14 @@ const openAiModelCosts = {
|
|
|
12269
12859
|
outputCost: 2 / 1_000_000,
|
|
12270
12860
|
},
|
|
12271
12861
|
'gpt-5.4-mini': {
|
|
12272
|
-
inputCost: 0.
|
|
12273
|
-
cacheHitCost: 0.
|
|
12274
|
-
outputCost:
|
|
12862
|
+
inputCost: 0.75 / 1_000_000,
|
|
12863
|
+
cacheHitCost: 0.075 / 1_000_000,
|
|
12864
|
+
outputCost: 4.5 / 1_000_000,
|
|
12865
|
+
},
|
|
12866
|
+
'gpt-5.4-nano': {
|
|
12867
|
+
inputCost: 0.2 / 1_000_000,
|
|
12868
|
+
cacheHitCost: 0.02 / 1_000_000,
|
|
12869
|
+
outputCost: 1.25 / 1_000_000,
|
|
12275
12870
|
},
|
|
12276
12871
|
'gpt-5-nano': {
|
|
12277
12872
|
inputCost: 0.05 / 1_000_000,
|