feat: Passwordless cross-device authentication

- Arkitektur: docs/auth/passwordless-architecture.md
- Backend: iom/quixzoom-auth-service/ (FastAPI + Redis)
- Webb: quixzoom-market-pages/se/login/ (QR-kod + polling)
- App: iom/quixzoom-app/src/features/auth/ (push + deep links)

Flöde: QR-kod → app-godkännande → webb-inloggad
This commit is contained in:
Bernt
2026-07-07 07:11:50 +00:00
parent 4aa984ad74
commit 6989a98d75
61843 changed files with 5491611 additions and 872231 deletions
+10
View File
@@ -0,0 +1,10 @@
import { APIResource } from "../../core/resource.mjs";
import * as OrganizationAPI from "./organization/organization.mjs";
import { Organization } from "./organization/organization.mjs";
export declare class Admin extends APIResource {
organization: OrganizationAPI.Organization;
}
export declare namespace Admin {
export { Organization as Organization };
}
//# sourceMappingURL=admin.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"admin.d.mts","sourceRoot":"","sources":["../../src/resources/admin/admin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,eAAe,wCAAoC;AAC/D,OAAO,EAAE,YAAY,EAAE,wCAAoC;AAE3D,qBAAa,KAAM,SAAQ,WAAW;IACpC,YAAY,EAAE,eAAe,CAAC,YAAY,CAAkD;CAC7F;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,CAAC;CACzC"}
+10
View File
@@ -0,0 +1,10 @@
import { APIResource } from "../../core/resource.js";
import * as OrganizationAPI from "./organization/organization.js";
import { Organization } from "./organization/organization.js";
export declare class Admin extends APIResource {
organization: OrganizationAPI.Organization;
}
export declare namespace Admin {
export { Organization as Organization };
}
//# sourceMappingURL=admin.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/resources/admin/admin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,eAAe,uCAAoC;AAC/D,OAAO,EAAE,YAAY,EAAE,uCAAoC;AAE3D,qBAAa,KAAM,SAAQ,WAAW;IACpC,YAAY,EAAE,eAAe,CAAC,YAAY,CAAkD;CAC7F;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,CAAC;CACzC"}
+17
View File
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Admin = void 0;
const tslib_1 = require("../../internal/tslib.js");
const resource_1 = require("../../core/resource.js");
const OrganizationAPI = tslib_1.__importStar(require("./organization/organization.js"));
const organization_1 = require("./organization/organization.js");
class Admin extends resource_1.APIResource {
constructor() {
super(...arguments);
this.organization = new OrganizationAPI.Organization(this._client);
}
}
exports.Admin = Admin;
Admin.Organization = organization_1.Organization;
//# sourceMappingURL=admin.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/resources/admin/admin.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,wFAA+D;AAC/D,iEAA2D;AAE3D,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9F,CAAC;CAAA;AAFD,sBAEC;AAED,KAAK,CAAC,YAAY,GAAG,2BAAY,CAAC"}
+12
View File
@@ -0,0 +1,12 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import * as OrganizationAPI from "./organization/organization.mjs";
import { Organization } from "./organization/organization.mjs";
export class Admin extends APIResource {
constructor() {
super(...arguments);
this.organization = new OrganizationAPI.Organization(this._client);
}
}
Admin.Organization = Organization;
//# sourceMappingURL=admin.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"admin.mjs","sourceRoot":"","sources":["../../src/resources/admin/admin.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,eAAe,wCAAoC;AAC/D,OAAO,EAAE,YAAY,EAAE,wCAAoC;AAE3D,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9F,CAAC;CAAA;AAED,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC"}
+3
View File
@@ -0,0 +1,3 @@
export { Admin } from "./admin.mjs";
export { Organization } from "./organization/index.mjs";
//# sourceMappingURL=index.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/admin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,oBAAgB;AAChC,OAAO,EAAE,YAAY,EAAE,iCAA6B"}
+3
View File
@@ -0,0 +1,3 @@
export { Admin } from "./admin.js";
export { Organization } from "./organization/index.js";
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/admin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAChC,OAAO,EAAE,YAAY,EAAE,gCAA6B"}
+9
View File
@@ -0,0 +1,9 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Organization = exports.Admin = void 0;
var admin_1 = require("./admin.js");
Object.defineProperty(exports, "Admin", { enumerable: true, get: function () { return admin_1.Admin; } });
var index_1 = require("./organization/index.js");
Object.defineProperty(exports, "Organization", { enumerable: true, get: function () { return index_1.Organization; } });
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/admin/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,iDAAoD;AAA3C,qGAAA,YAAY,OAAA"}
+4
View File
@@ -0,0 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Admin } from "./admin.mjs";
export { Organization } from "./organization/index.mjs";
//# sourceMappingURL=index.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/admin/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,KAAK,EAAE,oBAAgB;AAChC,OAAO,EAAE,YAAY,EAAE,iCAA6B"}
+2
View File
@@ -0,0 +1,2 @@
export * from "./organization/index.mjs";
//# sourceMappingURL=organization.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"organization.d.mts","sourceRoot":"","sources":["../../src/resources/admin/organization.ts"],"names":[],"mappings":"AAEA,yCAAqC"}
+2
View File
@@ -0,0 +1,2 @@
export * from "./organization/index.js";
//# sourceMappingURL=organization.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/resources/admin/organization.ts"],"names":[],"mappings":"AAEA,wCAAqC"}
+6
View File
@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../../internal/tslib.js");
tslib_1.__exportStar(require("./organization/index.js"), exports);
//# sourceMappingURL=organization.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../src/resources/admin/organization.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kEAAqC"}
+3
View File
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./organization/index.mjs";
//# sourceMappingURL=organization.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"organization.mjs","sourceRoot":"","sources":["../../src/resources/admin/organization.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,yCAAqC"}
@@ -0,0 +1,149 @@
import { APIResource } from "../../../core/resource.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { CursorPage, type CursorPageParams, PagePromise } from "../../../core/pagination.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class AdminAPIKeys extends APIResource {
/**
* Create an organization admin API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.create({
* name: 'New Admin Key',
* });
* ```
*/
create(body: AdminAPIKeyCreateParams, options?: RequestOptions): APIPromise<AdminAPIKeyCreateResponse>;
/**
* Retrieve a single organization API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.retrieve(
* 'key_id',
* );
* ```
*/
retrieve(keyID: string, options?: RequestOptions): APIPromise<AdminAPIKey>;
/**
* List organization API keys
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const adminAPIKey of client.admin.organization.adminAPIKeys.list()) {
* // ...
* }
* ```
*/
list(query?: AdminAPIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<AdminAPIKeysPage, AdminAPIKey>;
/**
* Delete an organization admin API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.delete(
* 'key_id',
* );
* ```
*/
delete(keyID: string, options?: RequestOptions): APIPromise<AdminAPIKeyDeleteResponse>;
}
export type AdminAPIKeysPage = CursorPage<AdminAPIKey>;
/**
* Represents an individual Admin API key in an org.
*/
export interface AdminAPIKey {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the API key was created
*/
created_at: number;
/**
* The Unix timestamp (in seconds) of when the API key expires
*/
expires_at: number | null;
/**
* The object type, which is always `organization.admin_api_key`
*/
object: 'organization.admin_api_key';
owner: AdminAPIKey.Owner;
/**
* The redacted value of the API key
*/
redacted_value: string;
/**
* The Unix timestamp (in seconds) of when the API key was last used
*/
last_used_at?: number | null;
/**
* The name of the API key
*/
name?: string | null;
}
export declare namespace AdminAPIKey {
interface Owner {
/**
* The identifier, which can be referenced in API endpoints
*/
id?: string;
/**
* The Unix timestamp (in seconds) of when the user was created
*/
created_at?: number;
/**
* The name of the user
*/
name?: string;
/**
* The object type, which is always organization.user
*/
object?: string;
/**
* Always `owner`
*/
role?: string;
/**
* Always `user`
*/
type?: string;
}
}
/**
* Represents an individual Admin API key in an org.
*/
export interface AdminAPIKeyCreateResponse extends AdminAPIKey {
/**
* The value of the API key. Only shown on create.
*/
value: string;
}
export interface AdminAPIKeyDeleteResponse {
id: string;
deleted: boolean;
object: 'organization.admin_api_key.deleted';
}
export interface AdminAPIKeyCreateParams {
name: string;
/**
* The number of seconds until the API key expires. Omit this field for a key that
* does not expire.
*/
expires_in_seconds?: number;
}
export interface AdminAPIKeyListParams extends CursorPageParams {
/**
* Order results by creation time, ascending or descending.
*/
order?: 'asc' | 'desc';
}
export declare namespace AdminAPIKeys {
export { type AdminAPIKey as AdminAPIKey, type AdminAPIKeyCreateResponse as AdminAPIKeyCreateResponse, type AdminAPIKeyDeleteResponse as AdminAPIKeyDeleteResponse, type AdminAPIKeysPage as AdminAPIKeysPage, type AdminAPIKeyCreateParams as AdminAPIKeyCreateParams, type AdminAPIKeyListParams as AdminAPIKeyListParams, };
}
//# sourceMappingURL=admin-api-keys.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"admin-api-keys.d.mts","sourceRoot":"","sources":["../../../src/resources/admin/organization/admin-api-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,qCAAiC;AAC1F,OAAO,EAAE,cAAc,EAAE,8CAA0C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AI,CAAC,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;CACF;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,WAAW;IAC5D;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,EAAE,OAAO,CAAC;IAEjB,MAAM,EAAE,oCAAoC,CAAC;CAC9C;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
@@ -0,0 +1,149 @@
import { APIResource } from "../../../core/resource.js";
import { APIPromise } from "../../../core/api-promise.js";
import { CursorPage, type CursorPageParams, PagePromise } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class AdminAPIKeys extends APIResource {
/**
* Create an organization admin API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.create({
* name: 'New Admin Key',
* });
* ```
*/
create(body: AdminAPIKeyCreateParams, options?: RequestOptions): APIPromise<AdminAPIKeyCreateResponse>;
/**
* Retrieve a single organization API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.retrieve(
* 'key_id',
* );
* ```
*/
retrieve(keyID: string, options?: RequestOptions): APIPromise<AdminAPIKey>;
/**
* List organization API keys
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const adminAPIKey of client.admin.organization.adminAPIKeys.list()) {
* // ...
* }
* ```
*/
list(query?: AdminAPIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<AdminAPIKeysPage, AdminAPIKey>;
/**
* Delete an organization admin API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.delete(
* 'key_id',
* );
* ```
*/
delete(keyID: string, options?: RequestOptions): APIPromise<AdminAPIKeyDeleteResponse>;
}
export type AdminAPIKeysPage = CursorPage<AdminAPIKey>;
/**
* Represents an individual Admin API key in an org.
*/
export interface AdminAPIKey {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the API key was created
*/
created_at: number;
/**
* The Unix timestamp (in seconds) of when the API key expires
*/
expires_at: number | null;
/**
* The object type, which is always `organization.admin_api_key`
*/
object: 'organization.admin_api_key';
owner: AdminAPIKey.Owner;
/**
* The redacted value of the API key
*/
redacted_value: string;
/**
* The Unix timestamp (in seconds) of when the API key was last used
*/
last_used_at?: number | null;
/**
* The name of the API key
*/
name?: string | null;
}
export declare namespace AdminAPIKey {
interface Owner {
/**
* The identifier, which can be referenced in API endpoints
*/
id?: string;
/**
* The Unix timestamp (in seconds) of when the user was created
*/
created_at?: number;
/**
* The name of the user
*/
name?: string;
/**
* The object type, which is always organization.user
*/
object?: string;
/**
* Always `owner`
*/
role?: string;
/**
* Always `user`
*/
type?: string;
}
}
/**
* Represents an individual Admin API key in an org.
*/
export interface AdminAPIKeyCreateResponse extends AdminAPIKey {
/**
* The value of the API key. Only shown on create.
*/
value: string;
}
export interface AdminAPIKeyDeleteResponse {
id: string;
deleted: boolean;
object: 'organization.admin_api_key.deleted';
}
export interface AdminAPIKeyCreateParams {
name: string;
/**
* The number of seconds until the API key expires. Omit this field for a key that
* does not expire.
*/
expires_in_seconds?: number;
}
export interface AdminAPIKeyListParams extends CursorPageParams {
/**
* Order results by creation time, ascending or descending.
*/
order?: 'asc' | 'desc';
}
export declare namespace AdminAPIKeys {
export { type AdminAPIKey as AdminAPIKey, type AdminAPIKeyCreateResponse as AdminAPIKeyCreateResponse, type AdminAPIKeyDeleteResponse as AdminAPIKeyDeleteResponse, type AdminAPIKeysPage as AdminAPIKeysPage, type AdminAPIKeyCreateParams as AdminAPIKeyCreateParams, type AdminAPIKeyListParams as AdminAPIKeyListParams, };
}
//# sourceMappingURL=admin-api-keys.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"admin-api-keys.d.ts","sourceRoot":"","sources":["../../../src/resources/admin/organization/admin-api-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,oCAAiC;AAC1F,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAQtG;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;IAO1E;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAQ7C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,KAA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BAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
@@ -0,0 +1,81 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdminAPIKeys = void 0;
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const path_1 = require("../../../internal/utils/path.js");
class AdminAPIKeys extends resource_1.APIResource {
/**
* Create an organization admin API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.create({
* name: 'New Admin Key',
* });
* ```
*/
create(body, options) {
return this._client.post('/organization/admin_api_keys', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieve a single organization API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.retrieve(
* 'key_id',
* );
* ```
*/
retrieve(keyID, options) {
return this._client.get((0, path_1.path) `/organization/admin_api_keys/${keyID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* List organization API keys
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const adminAPIKey of client.admin.organization.adminAPIKeys.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/admin_api_keys', (pagination_1.CursorPage), {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Delete an organization admin API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.delete(
* 'key_id',
* );
* ```
*/
delete(keyID, options) {
return this._client.delete((0, path_1.path) `/organization/admin_api_keys/${keyID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.AdminAPIKeys = AdminAPIKeys;
//# sourceMappingURL=admin-api-keys.js.map
@@ -0,0 +1 @@
{"version":3,"file":"admin-api-keys.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/admin-api-keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAA0F;AAE1F,0DAAoD;AAEpD,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE;YACvD,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAa,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gCAAgC,KAAK,EAAE,EAAE;YACnE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAA,uBAAuB,CAAA,EAAE;YACtF,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,gCAAgC,KAAK,EAAE,EAAE;YACtE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AA7ED,oCA6EC"}
@@ -0,0 +1,77 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { CursorPage } from "../../../core/pagination.mjs";
import { path } from "../../../internal/utils/path.mjs";
export class AdminAPIKeys extends APIResource {
/**
* Create an organization admin API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.create({
* name: 'New Admin Key',
* });
* ```
*/
create(body, options) {
return this._client.post('/organization/admin_api_keys', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieve a single organization API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.retrieve(
* 'key_id',
* );
* ```
*/
retrieve(keyID, options) {
return this._client.get(path `/organization/admin_api_keys/${keyID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* List organization API keys
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const adminAPIKey of client.admin.organization.adminAPIKeys.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/admin_api_keys', (CursorPage), {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Delete an organization admin API key
*
* @example
* ```ts
* const adminAPIKey =
* await client.admin.organization.adminAPIKeys.delete(
* 'key_id',
* );
* ```
*/
delete(keyID, options) {
return this._client.delete(path `/organization/admin_api_keys/${keyID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=admin-api-keys.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"admin-api-keys.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/admin-api-keys.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,EAAE,UAAU,EAAsC,qCAAiC;AAE1F,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE;YACvD,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAa,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gCAAgC,KAAK,EAAE,EAAE;YACnE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAA,UAAuB,CAAA,EAAE;YACtF,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,gCAAgC,KAAK,EAAE,EAAE;YACtE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
+1495
View File
@@ -0,0 +1,1495 @@
import { APIResource } from "../../../core/resource.mjs";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../../core/pagination.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
/**
* List user actions and configuration changes within this organization.
*/
export declare class AuditLogs extends APIResource {
/**
* List user actions and configuration changes within this organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const auditLogListResponse of client.admin.organization.auditLogs.list()) {
* // ...
* }
* ```
*/
list(query?: AuditLogListParams | null | undefined, options?: RequestOptions): PagePromise<AuditLogListResponsesPage, AuditLogListResponse>;
}
export type AuditLogListResponsesPage = ConversationCursorPage<AuditLogListResponse>;
/**
* A log of a user action or configuration change within this organization.
*/
export interface AuditLogListResponse {
/**
* The ID of this log.
*/
id: string;
/**
* The Unix timestamp (in seconds) of the event.
*/
effective_at: number;
/**
* The event type.
*/
type: 'api_key.created' | 'api_key.updated' | 'api_key.deleted' | 'certificate.created' | 'certificate.updated' | 'certificate.deleted' | 'certificates.activated' | 'certificates.deactivated' | 'checkpoint.permission.created' | 'checkpoint.permission.deleted' | 'external_key.registered' | 'external_key.removed' | 'group.created' | 'group.updated' | 'group.deleted' | 'invite.sent' | 'invite.accepted' | 'invite.deleted' | 'ip_allowlist.created' | 'ip_allowlist.updated' | 'ip_allowlist.deleted' | 'ip_allowlist.config.activated' | 'ip_allowlist.config.deactivated' | 'login.succeeded' | 'login.failed' | 'logout.succeeded' | 'logout.failed' | 'organization.updated' | 'project.created' | 'project.updated' | 'project.archived' | 'project.deleted' | 'rate_limit.updated' | 'rate_limit.deleted' | 'resource.deleted' | 'tunnel.created' | 'tunnel.updated' | 'tunnel.deleted' | 'workload_identity_provider.created' | 'workload_identity_provider.updated' | 'workload_identity_provider.deleted' | 'workload_identity_provider_mapping.created' | 'workload_identity_provider_mapping.updated' | 'workload_identity_provider_mapping.deleted' | 'role.created' | 'role.updated' | 'role.deleted' | 'role.assignment.created' | 'role.assignment.deleted' | 'role.bound_to_resource' | 'role.unbound_from_resource' | 'scim.enabled' | 'scim.disabled' | 'service_account.created' | 'service_account.updated' | 'service_account.deleted' | 'user.added' | 'user.updated' | 'user.deleted';
/**
* The actor who performed the audit logged action.
*/
actor?: AuditLogListResponse.Actor | null;
/**
* The details for events with this `type`.
*/
'api_key.created'?: AuditLogListResponse.APIKeyCreated;
/**
* The details for events with this `type`.
*/
'api_key.deleted'?: AuditLogListResponse.APIKeyDeleted;
/**
* The details for events with this `type`.
*/
'api_key.updated'?: AuditLogListResponse.APIKeyUpdated;
/**
* The details for events with this `type`.
*/
'certificate.created'?: AuditLogListResponse.CertificateCreated;
/**
* The details for events with this `type`.
*/
'certificate.deleted'?: AuditLogListResponse.CertificateDeleted;
/**
* The details for events with this `type`.
*/
'certificate.updated'?: AuditLogListResponse.CertificateUpdated;
/**
* The details for events with this `type`.
*/
'certificates.activated'?: AuditLogListResponse.CertificatesActivated;
/**
* The details for events with this `type`.
*/
'certificates.deactivated'?: AuditLogListResponse.CertificatesDeactivated;
/**
* The project and fine-tuned model checkpoint that the checkpoint permission was
* created for.
*/
'checkpoint.permission.created'?: AuditLogListResponse.CheckpointPermissionCreated;
/**
* The details for events with this `type`.
*/
'checkpoint.permission.deleted'?: AuditLogListResponse.CheckpointPermissionDeleted;
/**
* The details for events with this `type`.
*/
'external_key.registered'?: AuditLogListResponse.ExternalKeyRegistered;
/**
* The details for events with this `type`.
*/
'external_key.removed'?: AuditLogListResponse.ExternalKeyRemoved;
/**
* The details for events with this `type`.
*/
'group.created'?: AuditLogListResponse.GroupCreated;
/**
* The details for events with this `type`.
*/
'group.deleted'?: AuditLogListResponse.GroupDeleted;
/**
* The details for events with this `type`.
*/
'group.updated'?: AuditLogListResponse.GroupUpdated;
/**
* The details for events with this `type`.
*/
'invite.accepted'?: AuditLogListResponse.InviteAccepted;
/**
* The details for events with this `type`.
*/
'invite.deleted'?: AuditLogListResponse.InviteDeleted;
/**
* The details for events with this `type`.
*/
'invite.sent'?: AuditLogListResponse.InviteSent;
/**
* The details for events with this `type`.
*/
'ip_allowlist.config.activated'?: AuditLogListResponse.IPAllowlistConfigActivated;
/**
* The details for events with this `type`.
*/
'ip_allowlist.config.deactivated'?: AuditLogListResponse.IPAllowlistConfigDeactivated;
/**
* The details for events with this `type`.
*/
'ip_allowlist.created'?: AuditLogListResponse.IPAllowlistCreated;
/**
* The details for events with this `type`.
*/
'ip_allowlist.deleted'?: AuditLogListResponse.IPAllowlistDeleted;
/**
* The details for events with this `type`.
*/
'ip_allowlist.updated'?: AuditLogListResponse.IPAllowlistUpdated;
/**
* The details for events with this `type`.
*/
'login.failed'?: AuditLogListResponse.LoginFailed;
/**
* This event has no additional fields beyond the standard audit log attributes.
*/
'login.succeeded'?: unknown;
/**
* The details for events with this `type`.
*/
'logout.failed'?: AuditLogListResponse.LogoutFailed;
/**
* This event has no additional fields beyond the standard audit log attributes.
*/
'logout.succeeded'?: unknown;
/**
* The details for events with this `type`.
*/
'organization.updated'?: AuditLogListResponse.OrganizationUpdated;
/**
* The project that the action was scoped to. Absent for actions not scoped to
* projects. Note that any admin actions taken via Admin API keys are associated
* with the default project.
*/
project?: AuditLogListResponse.Project;
/**
* The details for events with this `type`.
*/
'project.archived'?: AuditLogListResponse.ProjectArchived;
/**
* The details for events with this `type`.
*/
'project.created'?: AuditLogListResponse.ProjectCreated;
/**
* The details for events with this `type`.
*/
'project.deleted'?: AuditLogListResponse.ProjectDeleted;
/**
* The details for events with this `type`.
*/
'project.updated'?: AuditLogListResponse.ProjectUpdated;
/**
* The details for events with this `type`.
*/
'rate_limit.deleted'?: AuditLogListResponse.RateLimitDeleted;
/**
* The details for events with this `type`.
*/
'rate_limit.updated'?: AuditLogListResponse.RateLimitUpdated;
/**
* The details for events with this `type`.
*/
'role.assignment.created'?: AuditLogListResponse.RoleAssignmentCreated;
/**
* The details for events with this `type`.
*/
'role.assignment.deleted'?: AuditLogListResponse.RoleAssignmentDeleted;
/**
* The details for events with this `type`.
*/
'role.bound_to_resource'?: AuditLogListResponse.RoleBoundToResource;
/**
* The details for events with this `type`.
*/
'role.created'?: AuditLogListResponse.RoleCreated;
/**
* The details for events with this `type`.
*/
'role.deleted'?: AuditLogListResponse.RoleDeleted;
/**
* The details for events with this `type`.
*/
'role.unbound_from_resource'?: AuditLogListResponse.RoleUnboundFromResource;
/**
* The details for events with this `type`.
*/
'role.updated'?: AuditLogListResponse.RoleUpdated;
/**
* The details for events with this `type`.
*/
'scim.disabled'?: AuditLogListResponse.ScimDisabled;
/**
* The details for events with this `type`.
*/
'scim.enabled'?: AuditLogListResponse.ScimEnabled;
/**
* The details for events with this `type`.
*/
'service_account.created'?: AuditLogListResponse.ServiceAccountCreated;
/**
* The details for events with this `type`.
*/
'service_account.deleted'?: AuditLogListResponse.ServiceAccountDeleted;
/**
* The details for events with this `type`.
*/
'service_account.updated'?: AuditLogListResponse.ServiceAccountUpdated;
/**
* The details for events with this `type`.
*/
'user.added'?: AuditLogListResponse.UserAdded;
/**
* The details for events with this `type`.
*/
'user.deleted'?: AuditLogListResponse.UserDeleted;
/**
* The details for events with this `type`.
*/
'user.updated'?: AuditLogListResponse.UserUpdated;
/**
* The details for events with this `type`.
*/
'workload_identity_provider_mapping.created'?: AuditLogListResponse.WorkloadIdentityProviderMappingCreated;
/**
* The details for events with this `type`.
*/
'workload_identity_provider_mapping.deleted'?: AuditLogListResponse.WorkloadIdentityProviderMappingDeleted;
/**
* The details for events with this `type`.
*/
'workload_identity_provider_mapping.updated'?: AuditLogListResponse.WorkloadIdentityProviderMappingUpdated;
/**
* The details for events with this `type`.
*/
'workload_identity_provider.created'?: AuditLogListResponse.WorkloadIdentityProviderCreated;
/**
* The details for events with this `type`.
*/
'workload_identity_provider.deleted'?: AuditLogListResponse.WorkloadIdentityProviderDeleted;
/**
* The details for events with this `type`.
*/
'workload_identity_provider.updated'?: AuditLogListResponse.WorkloadIdentityProviderUpdated;
}
export declare namespace AuditLogListResponse {
/**
* The actor who performed the audit logged action.
*/
interface Actor {
/**
* The API Key used to perform the audit logged action.
*/
api_key?: Actor.APIKey;
/**
* The session in which the audit logged action was performed.
*/
session?: Actor.Session;
/**
* The type of actor. Is either `session` or `api_key`.
*/
type?: 'session' | 'api_key';
}
namespace Actor {
/**
* The API Key used to perform the audit logged action.
*/
interface APIKey {
/**
* The tracking id of the API key.
*/
id?: string;
/**
* The service account that performed the audit logged action.
*/
service_account?: APIKey.ServiceAccount;
/**
* The type of API key. Can be either `user` or `service_account`.
*/
type?: 'user' | 'service_account';
/**
* The user who performed the audit logged action.
*/
user?: APIKey.User;
}
namespace APIKey {
/**
* The service account that performed the audit logged action.
*/
interface ServiceAccount {
/**
* The service account id.
*/
id?: string;
}
/**
* The user who performed the audit logged action.
*/
interface User {
/**
* The user id.
*/
id?: string;
/**
* The user email.
*/
email?: string;
}
}
/**
* The session in which the audit logged action was performed.
*/
interface Session {
/**
* The IP address from which the action was performed.
*/
ip_address?: string;
/**
* The user who performed the audit logged action.
*/
user?: Session.User;
}
namespace Session {
/**
* The user who performed the audit logged action.
*/
interface User {
/**
* The user id.
*/
id?: string;
/**
* The user email.
*/
email?: string;
}
}
}
/**
* The details for events with this `type`.
*/
interface APIKeyCreated {
/**
* The tracking ID of the API key.
*/
id?: string;
/**
* The payload used to create the API key.
*/
data?: APIKeyCreated.Data;
}
namespace APIKeyCreated {
/**
* The payload used to create the API key.
*/
interface Data {
/**
* A list of scopes allowed for the API key, e.g. `["api.model.request"]`
*/
scopes?: Array<string>;
}
}
/**
* The details for events with this `type`.
*/
interface APIKeyDeleted {
/**
* The tracking ID of the API key.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface APIKeyUpdated {
/**
* The tracking ID of the API key.
*/
id?: string;
/**
* The payload used to update the API key.
*/
changes_requested?: APIKeyUpdated.ChangesRequested;
}
namespace APIKeyUpdated {
/**
* The payload used to update the API key.
*/
interface ChangesRequested {
/**
* A list of scopes allowed for the API key, e.g. `["api.model.request"]`
*/
scopes?: Array<string>;
}
}
/**
* The details for events with this `type`.
*/
interface CertificateCreated {
/**
* The certificate ID.
*/
id?: string;
/**
* The name of the certificate.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface CertificateDeleted {
/**
* The certificate ID.
*/
id?: string;
/**
* The certificate content in PEM format.
*/
certificate?: string;
/**
* The name of the certificate.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface CertificateUpdated {
/**
* The certificate ID.
*/
id?: string;
/**
* The name of the certificate.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface CertificatesActivated {
certificates?: Array<CertificatesActivated.Certificate>;
}
namespace CertificatesActivated {
interface Certificate {
/**
* The certificate ID.
*/
id?: string;
/**
* The name of the certificate.
*/
name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface CertificatesDeactivated {
certificates?: Array<CertificatesDeactivated.Certificate>;
}
namespace CertificatesDeactivated {
interface Certificate {
/**
* The certificate ID.
*/
id?: string;
/**
* The name of the certificate.
*/
name?: string;
}
}
/**
* The project and fine-tuned model checkpoint that the checkpoint permission was
* created for.
*/
interface CheckpointPermissionCreated {
/**
* The ID of the checkpoint permission.
*/
id?: string;
/**
* The payload used to create the checkpoint permission.
*/
data?: CheckpointPermissionCreated.Data;
}
namespace CheckpointPermissionCreated {
/**
* The payload used to create the checkpoint permission.
*/
interface Data {
/**
* The ID of the fine-tuned model checkpoint.
*/
fine_tuned_model_checkpoint?: string;
/**
* The ID of the project that the checkpoint permission was created for.
*/
project_id?: string;
}
}
/**
* The details for events with this `type`.
*/
interface CheckpointPermissionDeleted {
/**
* The ID of the checkpoint permission.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ExternalKeyRegistered {
/**
* The ID of the external key configuration.
*/
id?: string;
/**
* The configuration for the external key.
*/
data?: unknown;
}
/**
* The details for events with this `type`.
*/
interface ExternalKeyRemoved {
/**
* The ID of the external key configuration.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface GroupCreated {
/**
* The ID of the group.
*/
id?: string;
/**
* Information about the created group.
*/
data?: GroupCreated.Data;
}
namespace GroupCreated {
/**
* Information about the created group.
*/
interface Data {
/**
* The group name.
*/
group_name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface GroupDeleted {
/**
* The ID of the group.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface GroupUpdated {
/**
* The ID of the group.
*/
id?: string;
/**
* The payload used to update the group.
*/
changes_requested?: GroupUpdated.ChangesRequested;
}
namespace GroupUpdated {
/**
* The payload used to update the group.
*/
interface ChangesRequested {
/**
* The updated group name.
*/
group_name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface InviteAccepted {
/**
* The ID of the invite.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface InviteDeleted {
/**
* The ID of the invite.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface InviteSent {
/**
* The ID of the invite.
*/
id?: string;
/**
* The payload used to create the invite.
*/
data?: InviteSent.Data;
}
namespace InviteSent {
/**
* The payload used to create the invite.
*/
interface Data {
/**
* The email invited to the organization.
*/
email?: string;
/**
* The role the email was invited to be. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistConfigActivated {
/**
* The configurations that were activated.
*/
configs?: Array<IPAllowlistConfigActivated.Config>;
}
namespace IPAllowlistConfigActivated {
interface Config {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The name of the IP allowlist configuration.
*/
name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistConfigDeactivated {
/**
* The configurations that were deactivated.
*/
configs?: Array<IPAllowlistConfigDeactivated.Config>;
}
namespace IPAllowlistConfigDeactivated {
interface Config {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The name of the IP allowlist configuration.
*/
name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistCreated {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The IP addresses or CIDR ranges included in the configuration.
*/
allowed_ips?: Array<string>;
/**
* The name of the IP allowlist configuration.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistDeleted {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The IP addresses or CIDR ranges that were in the configuration.
*/
allowed_ips?: Array<string>;
/**
* The name of the IP allowlist configuration.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistUpdated {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The updated set of IP addresses or CIDR ranges in the configuration.
*/
allowed_ips?: Array<string>;
}
/**
* The details for events with this `type`.
*/
interface LoginFailed {
/**
* The error code of the failure.
*/
error_code?: string;
/**
* The error message of the failure.
*/
error_message?: string;
}
/**
* The details for events with this `type`.
*/
interface LogoutFailed {
/**
* The error code of the failure.
*/
error_code?: string;
/**
* The error message of the failure.
*/
error_message?: string;
}
/**
* The details for events with this `type`.
*/
interface OrganizationUpdated {
/**
* The organization ID.
*/
id?: string;
/**
* The payload used to update the organization settings.
*/
changes_requested?: OrganizationUpdated.ChangesRequested;
}
namespace OrganizationUpdated {
/**
* The payload used to update the organization settings.
*/
interface ChangesRequested {
/**
* How your organization logs data from supported API calls. One of `disabled`,
* `enabled_per_call`, `enabled_for_all_projects`, or
* `enabled_for_selected_projects`
*/
api_call_logging?: string;
/**
* The list of project ids if api_call_logging is set to
* `enabled_for_selected_projects`
*/
api_call_logging_project_ids?: string;
/**
* The organization description.
*/
description?: string;
/**
* The organization name.
*/
name?: string;
/**
* Visibility of the threads page which shows messages created with the Assistants
* API and Playground. One of `ANY_ROLE`, `OWNERS`, or `NONE`.
*/
threads_ui_visibility?: string;
/**
* The organization title.
*/
title?: string;
/**
* Visibility of the usage dashboard which shows activity and costs for your
* organization. One of `ANY_ROLE` or `OWNERS`.
*/
usage_dashboard_visibility?: string;
}
}
/**
* The project that the action was scoped to. Absent for actions not scoped to
* projects. Note that any admin actions taken via Admin API keys are associated
* with the default project.
*/
interface Project {
/**
* The project ID.
*/
id?: string;
/**
* The project title.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface ProjectArchived {
/**
* The project ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ProjectCreated {
/**
* The project ID.
*/
id?: string;
/**
* The payload used to create the project.
*/
data?: ProjectCreated.Data;
}
namespace ProjectCreated {
/**
* The payload used to create the project.
*/
interface Data {
/**
* The project name.
*/
name?: string;
/**
* The title of the project as seen on the dashboard.
*/
title?: string;
}
}
/**
* The details for events with this `type`.
*/
interface ProjectDeleted {
/**
* The project ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ProjectUpdated {
/**
* The project ID.
*/
id?: string;
/**
* The payload used to update the project.
*/
changes_requested?: ProjectUpdated.ChangesRequested;
}
namespace ProjectUpdated {
/**
* The payload used to update the project.
*/
interface ChangesRequested {
/**
* The title of the project as seen on the dashboard.
*/
title?: string;
}
}
/**
* The details for events with this `type`.
*/
interface RateLimitDeleted {
/**
* The rate limit ID
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface RateLimitUpdated {
/**
* The rate limit ID
*/
id?: string;
/**
* The payload used to update the rate limits.
*/
changes_requested?: RateLimitUpdated.ChangesRequested;
}
namespace RateLimitUpdated {
/**
* The payload used to update the rate limits.
*/
interface ChangesRequested {
/**
* The maximum batch input tokens per day. Only relevant for certain models.
*/
batch_1_day_max_input_tokens?: number;
/**
* The maximum audio megabytes per minute. Only relevant for certain models.
*/
max_audio_megabytes_per_1_minute?: number;
/**
* The maximum images per minute. Only relevant for certain models.
*/
max_images_per_1_minute?: number;
/**
* The maximum requests per day. Only relevant for certain models.
*/
max_requests_per_1_day?: number;
/**
* The maximum requests per minute.
*/
max_requests_per_1_minute?: number;
/**
* The maximum tokens per minute.
*/
max_tokens_per_1_minute?: number;
}
}
/**
* The details for events with this `type`.
*/
interface RoleAssignmentCreated {
/**
* The identifier of the role assignment.
*/
id?: string;
/**
* The principal (user or group) that received the role.
*/
principal_id?: string;
/**
* The type of principal (user or group) that received the role.
*/
principal_type?: string;
/**
* The resource the role assignment is scoped to.
*/
resource_id?: string;
/**
* The type of resource the role assignment is scoped to.
*/
resource_type?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleAssignmentDeleted {
/**
* The identifier of the role assignment.
*/
id?: string;
/**
* The principal (user or group) that had the role removed.
*/
principal_id?: string;
/**
* The type of principal (user or group) that had the role removed.
*/
principal_type?: string;
/**
* The resource the role assignment was scoped to.
*/
resource_id?: string;
/**
* The type of resource the role assignment was scoped to.
*/
resource_type?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleBoundToResource {
/**
* The ID of the resource the role was bound to. ChatGPT workspace connector
* resources use `<workspace_id>__<connector_id>`.
*/
id?: string;
/**
* The connector ID for a ChatGPT workspace connector resource.
*/
connector_id?: string;
/**
* The connector display name for a ChatGPT workspace connector resource, or the
* connector ID when the display name could not be resolved.
*/
connector_name?: string;
/**
* Whether the connector is enabled for the role.
*/
enabled?: boolean;
/**
* The permissions granted to the role for the resource.
*/
permissions?: Array<string>;
/**
* The ID of the resource the role was bound to.
*/
resource_id?: string;
/**
* The type of resource the role was bound to.
*/
resource_type?: string;
/**
* The ID of the role that was bound to the resource.
*/
role_id?: string;
/**
* The connector role mutation path that produced the event.
*/
source?: 'role_toggle' | 'role_connector_update' | 'role_delete' | 'workspace_permissions' | 'connector_publish';
/**
* The workspace ID for a ChatGPT workspace connector resource.
*/
workspace_id?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleCreated {
/**
* The role ID.
*/
id?: string;
/**
* The permissions granted by the role.
*/
permissions?: Array<string>;
/**
* The resource the role is scoped to.
*/
resource_id?: string;
/**
* The type of resource the role belongs to.
*/
resource_type?: string;
/**
* The name of the role.
*/
role_name?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleDeleted {
/**
* The role ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleUnboundFromResource {
/**
* The ID of the resource the role was unbound from. ChatGPT workspace connector
* resources use `<workspace_id>__<connector_id>`.
*/
id?: string;
/**
* The connector ID for a ChatGPT workspace connector resource.
*/
connector_id?: string;
/**
* The connector display name for a ChatGPT workspace connector resource, or the
* connector ID when the display name could not be resolved.
*/
connector_name?: string;
/**
* Whether the connector is enabled for the role.
*/
enabled?: boolean;
/**
* The permissions remaining for the role after the change.
*/
permissions?: Array<string>;
/**
* The ID of the resource the role was unbound from.
*/
resource_id?: string;
/**
* The type of resource the role was unbound from.
*/
resource_type?: string;
/**
* The ID of the role that was unbound from the resource.
*/
role_id?: string;
/**
* The connector role mutation path that produced the event.
*/
source?: 'role_toggle' | 'role_connector_update' | 'role_delete' | 'workspace_permissions' | 'connector_publish';
/**
* The workspace ID for a ChatGPT workspace connector resource.
*/
workspace_id?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleUpdated {
/**
* The role ID.
*/
id?: string;
/**
* The payload used to update the role.
*/
changes_requested?: RoleUpdated.ChangesRequested;
}
namespace RoleUpdated {
/**
* The payload used to update the role.
*/
interface ChangesRequested {
/**
* The updated role description, when provided.
*/
description?: string;
/**
* Additional metadata stored on the role.
*/
metadata?: unknown;
/**
* The permissions added to the role.
*/
permissions_added?: Array<string>;
/**
* The permissions removed from the role.
*/
permissions_removed?: Array<string>;
/**
* The resource the role is scoped to.
*/
resource_id?: string;
/**
* The type of resource the role belongs to.
*/
resource_type?: string;
/**
* The updated role name, when provided.
*/
role_name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface ScimDisabled {
/**
* The ID of the SCIM was disabled for.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ScimEnabled {
/**
* The ID of the SCIM was enabled for.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ServiceAccountCreated {
/**
* The service account ID.
*/
id?: string;
/**
* The payload used to create the service account.
*/
data?: ServiceAccountCreated.Data;
}
namespace ServiceAccountCreated {
/**
* The payload used to create the service account.
*/
interface Data {
/**
* The role of the service account. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface ServiceAccountDeleted {
/**
* The service account ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ServiceAccountUpdated {
/**
* The service account ID.
*/
id?: string;
/**
* The payload used to updated the service account.
*/
changes_requested?: ServiceAccountUpdated.ChangesRequested;
}
namespace ServiceAccountUpdated {
/**
* The payload used to updated the service account.
*/
interface ChangesRequested {
/**
* The role of the service account. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface UserAdded {
/**
* The user ID.
*/
id?: string;
/**
* The payload used to add the user to the project.
*/
data?: UserAdded.Data;
}
namespace UserAdded {
/**
* The payload used to add the user to the project.
*/
interface Data {
/**
* The role of the user. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface UserDeleted {
/**
* The user ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface UserUpdated {
/**
* The project ID.
*/
id?: string;
/**
* The payload used to update the user.
*/
changes_requested?: UserUpdated.ChangesRequested;
}
namespace UserUpdated {
/**
* The payload used to update the user.
*/
interface ChangesRequested {
/**
* The role of the user. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderMappingCreated {
/**
* The workload identity provider mapping ID.
*/
id?: string;
/**
* The payload used to create the workload identity provider mapping.
*/
data?: unknown;
/**
* The workload identity provider ID.
*/
identity_provider_id?: string;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderMappingDeleted {
/**
* The workload identity provider mapping ID.
*/
id?: string;
/**
* The workload identity provider ID.
*/
identity_provider_id?: string;
/**
* The project ID.
*/
project_id?: string;
/**
* The mapped service account ID.
*/
service_account_id?: string;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderMappingUpdated {
/**
* The workload identity provider mapping ID.
*/
id?: string;
/**
* The payload used to update the workload identity provider mapping.
*/
changes_requested?: unknown;
/**
* The workload identity provider ID.
*/
identity_provider_id?: string;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderCreated {
/**
* The workload identity provider ID.
*/
id?: string;
/**
* The payload used to create the workload identity provider.
*/
data?: unknown;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderDeleted {
/**
* The workload identity provider ID.
*/
id?: string;
/**
* The workload identity provider name.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderUpdated {
/**
* The workload identity provider ID.
*/
id?: string;
/**
* The payload used to update the workload identity provider.
*/
changes_requested?: unknown;
}
}
export interface AuditLogListParams extends ConversationCursorPageParams {
/**
* Return only events performed by users with these emails.
*/
actor_emails?: Array<string>;
/**
* Return only events performed by these actors. Can be a user ID, a service
* account ID, or an api key tracking ID.
*/
actor_ids?: Array<string>;
/**
* A cursor for use in pagination. `before` is an object ID that defines your place
* in the list. For instance, if you make a list request and receive 100 objects,
* starting with obj_foo, your subsequent call can include before=obj_foo in order
* to fetch the previous page of the list.
*/
before?: string;
/**
* Return only events whose `effective_at` (Unix seconds) is in this range.
*/
effective_at?: AuditLogListParams.EffectiveAt;
/**
* Return only events with a `type` in one of these values. For example,
* `project.created`. For all options, see the documentation for the
* [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).
*/
event_types?: Array<'api_key.created' | 'api_key.updated' | 'api_key.deleted' | 'certificate.created' | 'certificate.updated' | 'certificate.deleted' | 'certificates.activated' | 'certificates.deactivated' | 'checkpoint.permission.created' | 'checkpoint.permission.deleted' | 'external_key.registered' | 'external_key.removed' | 'group.created' | 'group.updated' | 'group.deleted' | 'invite.sent' | 'invite.accepted' | 'invite.deleted' | 'ip_allowlist.created' | 'ip_allowlist.updated' | 'ip_allowlist.deleted' | 'ip_allowlist.config.activated' | 'ip_allowlist.config.deactivated' | 'login.succeeded' | 'login.failed' | 'logout.succeeded' | 'logout.failed' | 'organization.updated' | 'project.created' | 'project.updated' | 'project.archived' | 'project.deleted' | 'rate_limit.updated' | 'rate_limit.deleted' | 'resource.deleted' | 'tunnel.created' | 'tunnel.updated' | 'tunnel.deleted' | 'workload_identity_provider.created' | 'workload_identity_provider.updated' | 'workload_identity_provider.deleted' | 'workload_identity_provider_mapping.created' | 'workload_identity_provider_mapping.updated' | 'workload_identity_provider_mapping.deleted' | 'role.created' | 'role.updated' | 'role.deleted' | 'role.assignment.created' | 'role.assignment.deleted' | 'role.bound_to_resource' | 'role.unbound_from_resource' | 'scim.enabled' | 'scim.disabled' | 'service_account.created' | 'service_account.updated' | 'service_account.deleted' | 'user.added' | 'user.updated' | 'user.deleted'>;
/**
* Return only events for these projects.
*/
project_ids?: Array<string>;
/**
* Return only events performed on these targets. For example, a project ID
* updated. For ChatGPT connector role events, use the workspace connector resource
* ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.
*/
resource_ids?: Array<string>;
/**
* Return only tenant-scoped events associated with this organization. Required for
* tenant-scoped events such as `role.bound_to_resource` and
* `role.unbound_from_resource`. When `true`, all supplied event types must be
* tenant-scoped.
*/
tenant_only?: boolean;
}
export declare namespace AuditLogListParams {
/**
* Return only events whose `effective_at` (Unix seconds) is in this range.
*/
interface EffectiveAt {
/**
* Return only events whose `effective_at` (Unix seconds) is greater than this
* value.
*/
gt?: number;
/**
* Return only events whose `effective_at` (Unix seconds) is greater than or equal
* to this value.
*/
gte?: number;
/**
* Return only events whose `effective_at` (Unix seconds) is less than this value.
*/
lt?: number;
/**
* Return only events whose `effective_at` (Unix seconds) is less than or equal to
* this value.
*/
lte?: number;
}
}
export declare namespace AuditLogs {
export { type AuditLogListResponse as AuditLogListResponse, type AuditLogListResponsesPage as AuditLogListResponsesPage, type AuditLogListParams as AuditLogListParams, };
}
//# sourceMappingURL=audit-logs.d.mts.map
File diff suppressed because one or more lines are too long
+1495
View File
@@ -0,0 +1,1495 @@
import { APIResource } from "../../../core/resource.js";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
/**
* List user actions and configuration changes within this organization.
*/
export declare class AuditLogs extends APIResource {
/**
* List user actions and configuration changes within this organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const auditLogListResponse of client.admin.organization.auditLogs.list()) {
* // ...
* }
* ```
*/
list(query?: AuditLogListParams | null | undefined, options?: RequestOptions): PagePromise<AuditLogListResponsesPage, AuditLogListResponse>;
}
export type AuditLogListResponsesPage = ConversationCursorPage<AuditLogListResponse>;
/**
* A log of a user action or configuration change within this organization.
*/
export interface AuditLogListResponse {
/**
* The ID of this log.
*/
id: string;
/**
* The Unix timestamp (in seconds) of the event.
*/
effective_at: number;
/**
* The event type.
*/
type: 'api_key.created' | 'api_key.updated' | 'api_key.deleted' | 'certificate.created' | 'certificate.updated' | 'certificate.deleted' | 'certificates.activated' | 'certificates.deactivated' | 'checkpoint.permission.created' | 'checkpoint.permission.deleted' | 'external_key.registered' | 'external_key.removed' | 'group.created' | 'group.updated' | 'group.deleted' | 'invite.sent' | 'invite.accepted' | 'invite.deleted' | 'ip_allowlist.created' | 'ip_allowlist.updated' | 'ip_allowlist.deleted' | 'ip_allowlist.config.activated' | 'ip_allowlist.config.deactivated' | 'login.succeeded' | 'login.failed' | 'logout.succeeded' | 'logout.failed' | 'organization.updated' | 'project.created' | 'project.updated' | 'project.archived' | 'project.deleted' | 'rate_limit.updated' | 'rate_limit.deleted' | 'resource.deleted' | 'tunnel.created' | 'tunnel.updated' | 'tunnel.deleted' | 'workload_identity_provider.created' | 'workload_identity_provider.updated' | 'workload_identity_provider.deleted' | 'workload_identity_provider_mapping.created' | 'workload_identity_provider_mapping.updated' | 'workload_identity_provider_mapping.deleted' | 'role.created' | 'role.updated' | 'role.deleted' | 'role.assignment.created' | 'role.assignment.deleted' | 'role.bound_to_resource' | 'role.unbound_from_resource' | 'scim.enabled' | 'scim.disabled' | 'service_account.created' | 'service_account.updated' | 'service_account.deleted' | 'user.added' | 'user.updated' | 'user.deleted';
/**
* The actor who performed the audit logged action.
*/
actor?: AuditLogListResponse.Actor | null;
/**
* The details for events with this `type`.
*/
'api_key.created'?: AuditLogListResponse.APIKeyCreated;
/**
* The details for events with this `type`.
*/
'api_key.deleted'?: AuditLogListResponse.APIKeyDeleted;
/**
* The details for events with this `type`.
*/
'api_key.updated'?: AuditLogListResponse.APIKeyUpdated;
/**
* The details for events with this `type`.
*/
'certificate.created'?: AuditLogListResponse.CertificateCreated;
/**
* The details for events with this `type`.
*/
'certificate.deleted'?: AuditLogListResponse.CertificateDeleted;
/**
* The details for events with this `type`.
*/
'certificate.updated'?: AuditLogListResponse.CertificateUpdated;
/**
* The details for events with this `type`.
*/
'certificates.activated'?: AuditLogListResponse.CertificatesActivated;
/**
* The details for events with this `type`.
*/
'certificates.deactivated'?: AuditLogListResponse.CertificatesDeactivated;
/**
* The project and fine-tuned model checkpoint that the checkpoint permission was
* created for.
*/
'checkpoint.permission.created'?: AuditLogListResponse.CheckpointPermissionCreated;
/**
* The details for events with this `type`.
*/
'checkpoint.permission.deleted'?: AuditLogListResponse.CheckpointPermissionDeleted;
/**
* The details for events with this `type`.
*/
'external_key.registered'?: AuditLogListResponse.ExternalKeyRegistered;
/**
* The details for events with this `type`.
*/
'external_key.removed'?: AuditLogListResponse.ExternalKeyRemoved;
/**
* The details for events with this `type`.
*/
'group.created'?: AuditLogListResponse.GroupCreated;
/**
* The details for events with this `type`.
*/
'group.deleted'?: AuditLogListResponse.GroupDeleted;
/**
* The details for events with this `type`.
*/
'group.updated'?: AuditLogListResponse.GroupUpdated;
/**
* The details for events with this `type`.
*/
'invite.accepted'?: AuditLogListResponse.InviteAccepted;
/**
* The details for events with this `type`.
*/
'invite.deleted'?: AuditLogListResponse.InviteDeleted;
/**
* The details for events with this `type`.
*/
'invite.sent'?: AuditLogListResponse.InviteSent;
/**
* The details for events with this `type`.
*/
'ip_allowlist.config.activated'?: AuditLogListResponse.IPAllowlistConfigActivated;
/**
* The details for events with this `type`.
*/
'ip_allowlist.config.deactivated'?: AuditLogListResponse.IPAllowlistConfigDeactivated;
/**
* The details for events with this `type`.
*/
'ip_allowlist.created'?: AuditLogListResponse.IPAllowlistCreated;
/**
* The details for events with this `type`.
*/
'ip_allowlist.deleted'?: AuditLogListResponse.IPAllowlistDeleted;
/**
* The details for events with this `type`.
*/
'ip_allowlist.updated'?: AuditLogListResponse.IPAllowlistUpdated;
/**
* The details for events with this `type`.
*/
'login.failed'?: AuditLogListResponse.LoginFailed;
/**
* This event has no additional fields beyond the standard audit log attributes.
*/
'login.succeeded'?: unknown;
/**
* The details for events with this `type`.
*/
'logout.failed'?: AuditLogListResponse.LogoutFailed;
/**
* This event has no additional fields beyond the standard audit log attributes.
*/
'logout.succeeded'?: unknown;
/**
* The details for events with this `type`.
*/
'organization.updated'?: AuditLogListResponse.OrganizationUpdated;
/**
* The project that the action was scoped to. Absent for actions not scoped to
* projects. Note that any admin actions taken via Admin API keys are associated
* with the default project.
*/
project?: AuditLogListResponse.Project;
/**
* The details for events with this `type`.
*/
'project.archived'?: AuditLogListResponse.ProjectArchived;
/**
* The details for events with this `type`.
*/
'project.created'?: AuditLogListResponse.ProjectCreated;
/**
* The details for events with this `type`.
*/
'project.deleted'?: AuditLogListResponse.ProjectDeleted;
/**
* The details for events with this `type`.
*/
'project.updated'?: AuditLogListResponse.ProjectUpdated;
/**
* The details for events with this `type`.
*/
'rate_limit.deleted'?: AuditLogListResponse.RateLimitDeleted;
/**
* The details for events with this `type`.
*/
'rate_limit.updated'?: AuditLogListResponse.RateLimitUpdated;
/**
* The details for events with this `type`.
*/
'role.assignment.created'?: AuditLogListResponse.RoleAssignmentCreated;
/**
* The details for events with this `type`.
*/
'role.assignment.deleted'?: AuditLogListResponse.RoleAssignmentDeleted;
/**
* The details for events with this `type`.
*/
'role.bound_to_resource'?: AuditLogListResponse.RoleBoundToResource;
/**
* The details for events with this `type`.
*/
'role.created'?: AuditLogListResponse.RoleCreated;
/**
* The details for events with this `type`.
*/
'role.deleted'?: AuditLogListResponse.RoleDeleted;
/**
* The details for events with this `type`.
*/
'role.unbound_from_resource'?: AuditLogListResponse.RoleUnboundFromResource;
/**
* The details for events with this `type`.
*/
'role.updated'?: AuditLogListResponse.RoleUpdated;
/**
* The details for events with this `type`.
*/
'scim.disabled'?: AuditLogListResponse.ScimDisabled;
/**
* The details for events with this `type`.
*/
'scim.enabled'?: AuditLogListResponse.ScimEnabled;
/**
* The details for events with this `type`.
*/
'service_account.created'?: AuditLogListResponse.ServiceAccountCreated;
/**
* The details for events with this `type`.
*/
'service_account.deleted'?: AuditLogListResponse.ServiceAccountDeleted;
/**
* The details for events with this `type`.
*/
'service_account.updated'?: AuditLogListResponse.ServiceAccountUpdated;
/**
* The details for events with this `type`.
*/
'user.added'?: AuditLogListResponse.UserAdded;
/**
* The details for events with this `type`.
*/
'user.deleted'?: AuditLogListResponse.UserDeleted;
/**
* The details for events with this `type`.
*/
'user.updated'?: AuditLogListResponse.UserUpdated;
/**
* The details for events with this `type`.
*/
'workload_identity_provider_mapping.created'?: AuditLogListResponse.WorkloadIdentityProviderMappingCreated;
/**
* The details for events with this `type`.
*/
'workload_identity_provider_mapping.deleted'?: AuditLogListResponse.WorkloadIdentityProviderMappingDeleted;
/**
* The details for events with this `type`.
*/
'workload_identity_provider_mapping.updated'?: AuditLogListResponse.WorkloadIdentityProviderMappingUpdated;
/**
* The details for events with this `type`.
*/
'workload_identity_provider.created'?: AuditLogListResponse.WorkloadIdentityProviderCreated;
/**
* The details for events with this `type`.
*/
'workload_identity_provider.deleted'?: AuditLogListResponse.WorkloadIdentityProviderDeleted;
/**
* The details for events with this `type`.
*/
'workload_identity_provider.updated'?: AuditLogListResponse.WorkloadIdentityProviderUpdated;
}
export declare namespace AuditLogListResponse {
/**
* The actor who performed the audit logged action.
*/
interface Actor {
/**
* The API Key used to perform the audit logged action.
*/
api_key?: Actor.APIKey;
/**
* The session in which the audit logged action was performed.
*/
session?: Actor.Session;
/**
* The type of actor. Is either `session` or `api_key`.
*/
type?: 'session' | 'api_key';
}
namespace Actor {
/**
* The API Key used to perform the audit logged action.
*/
interface APIKey {
/**
* The tracking id of the API key.
*/
id?: string;
/**
* The service account that performed the audit logged action.
*/
service_account?: APIKey.ServiceAccount;
/**
* The type of API key. Can be either `user` or `service_account`.
*/
type?: 'user' | 'service_account';
/**
* The user who performed the audit logged action.
*/
user?: APIKey.User;
}
namespace APIKey {
/**
* The service account that performed the audit logged action.
*/
interface ServiceAccount {
/**
* The service account id.
*/
id?: string;
}
/**
* The user who performed the audit logged action.
*/
interface User {
/**
* The user id.
*/
id?: string;
/**
* The user email.
*/
email?: string;
}
}
/**
* The session in which the audit logged action was performed.
*/
interface Session {
/**
* The IP address from which the action was performed.
*/
ip_address?: string;
/**
* The user who performed the audit logged action.
*/
user?: Session.User;
}
namespace Session {
/**
* The user who performed the audit logged action.
*/
interface User {
/**
* The user id.
*/
id?: string;
/**
* The user email.
*/
email?: string;
}
}
}
/**
* The details for events with this `type`.
*/
interface APIKeyCreated {
/**
* The tracking ID of the API key.
*/
id?: string;
/**
* The payload used to create the API key.
*/
data?: APIKeyCreated.Data;
}
namespace APIKeyCreated {
/**
* The payload used to create the API key.
*/
interface Data {
/**
* A list of scopes allowed for the API key, e.g. `["api.model.request"]`
*/
scopes?: Array<string>;
}
}
/**
* The details for events with this `type`.
*/
interface APIKeyDeleted {
/**
* The tracking ID of the API key.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface APIKeyUpdated {
/**
* The tracking ID of the API key.
*/
id?: string;
/**
* The payload used to update the API key.
*/
changes_requested?: APIKeyUpdated.ChangesRequested;
}
namespace APIKeyUpdated {
/**
* The payload used to update the API key.
*/
interface ChangesRequested {
/**
* A list of scopes allowed for the API key, e.g. `["api.model.request"]`
*/
scopes?: Array<string>;
}
}
/**
* The details for events with this `type`.
*/
interface CertificateCreated {
/**
* The certificate ID.
*/
id?: string;
/**
* The name of the certificate.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface CertificateDeleted {
/**
* The certificate ID.
*/
id?: string;
/**
* The certificate content in PEM format.
*/
certificate?: string;
/**
* The name of the certificate.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface CertificateUpdated {
/**
* The certificate ID.
*/
id?: string;
/**
* The name of the certificate.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface CertificatesActivated {
certificates?: Array<CertificatesActivated.Certificate>;
}
namespace CertificatesActivated {
interface Certificate {
/**
* The certificate ID.
*/
id?: string;
/**
* The name of the certificate.
*/
name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface CertificatesDeactivated {
certificates?: Array<CertificatesDeactivated.Certificate>;
}
namespace CertificatesDeactivated {
interface Certificate {
/**
* The certificate ID.
*/
id?: string;
/**
* The name of the certificate.
*/
name?: string;
}
}
/**
* The project and fine-tuned model checkpoint that the checkpoint permission was
* created for.
*/
interface CheckpointPermissionCreated {
/**
* The ID of the checkpoint permission.
*/
id?: string;
/**
* The payload used to create the checkpoint permission.
*/
data?: CheckpointPermissionCreated.Data;
}
namespace CheckpointPermissionCreated {
/**
* The payload used to create the checkpoint permission.
*/
interface Data {
/**
* The ID of the fine-tuned model checkpoint.
*/
fine_tuned_model_checkpoint?: string;
/**
* The ID of the project that the checkpoint permission was created for.
*/
project_id?: string;
}
}
/**
* The details for events with this `type`.
*/
interface CheckpointPermissionDeleted {
/**
* The ID of the checkpoint permission.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ExternalKeyRegistered {
/**
* The ID of the external key configuration.
*/
id?: string;
/**
* The configuration for the external key.
*/
data?: unknown;
}
/**
* The details for events with this `type`.
*/
interface ExternalKeyRemoved {
/**
* The ID of the external key configuration.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface GroupCreated {
/**
* The ID of the group.
*/
id?: string;
/**
* Information about the created group.
*/
data?: GroupCreated.Data;
}
namespace GroupCreated {
/**
* Information about the created group.
*/
interface Data {
/**
* The group name.
*/
group_name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface GroupDeleted {
/**
* The ID of the group.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface GroupUpdated {
/**
* The ID of the group.
*/
id?: string;
/**
* The payload used to update the group.
*/
changes_requested?: GroupUpdated.ChangesRequested;
}
namespace GroupUpdated {
/**
* The payload used to update the group.
*/
interface ChangesRequested {
/**
* The updated group name.
*/
group_name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface InviteAccepted {
/**
* The ID of the invite.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface InviteDeleted {
/**
* The ID of the invite.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface InviteSent {
/**
* The ID of the invite.
*/
id?: string;
/**
* The payload used to create the invite.
*/
data?: InviteSent.Data;
}
namespace InviteSent {
/**
* The payload used to create the invite.
*/
interface Data {
/**
* The email invited to the organization.
*/
email?: string;
/**
* The role the email was invited to be. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistConfigActivated {
/**
* The configurations that were activated.
*/
configs?: Array<IPAllowlistConfigActivated.Config>;
}
namespace IPAllowlistConfigActivated {
interface Config {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The name of the IP allowlist configuration.
*/
name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistConfigDeactivated {
/**
* The configurations that were deactivated.
*/
configs?: Array<IPAllowlistConfigDeactivated.Config>;
}
namespace IPAllowlistConfigDeactivated {
interface Config {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The name of the IP allowlist configuration.
*/
name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistCreated {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The IP addresses or CIDR ranges included in the configuration.
*/
allowed_ips?: Array<string>;
/**
* The name of the IP allowlist configuration.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistDeleted {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The IP addresses or CIDR ranges that were in the configuration.
*/
allowed_ips?: Array<string>;
/**
* The name of the IP allowlist configuration.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface IPAllowlistUpdated {
/**
* The ID of the IP allowlist configuration.
*/
id?: string;
/**
* The updated set of IP addresses or CIDR ranges in the configuration.
*/
allowed_ips?: Array<string>;
}
/**
* The details for events with this `type`.
*/
interface LoginFailed {
/**
* The error code of the failure.
*/
error_code?: string;
/**
* The error message of the failure.
*/
error_message?: string;
}
/**
* The details for events with this `type`.
*/
interface LogoutFailed {
/**
* The error code of the failure.
*/
error_code?: string;
/**
* The error message of the failure.
*/
error_message?: string;
}
/**
* The details for events with this `type`.
*/
interface OrganizationUpdated {
/**
* The organization ID.
*/
id?: string;
/**
* The payload used to update the organization settings.
*/
changes_requested?: OrganizationUpdated.ChangesRequested;
}
namespace OrganizationUpdated {
/**
* The payload used to update the organization settings.
*/
interface ChangesRequested {
/**
* How your organization logs data from supported API calls. One of `disabled`,
* `enabled_per_call`, `enabled_for_all_projects`, or
* `enabled_for_selected_projects`
*/
api_call_logging?: string;
/**
* The list of project ids if api_call_logging is set to
* `enabled_for_selected_projects`
*/
api_call_logging_project_ids?: string;
/**
* The organization description.
*/
description?: string;
/**
* The organization name.
*/
name?: string;
/**
* Visibility of the threads page which shows messages created with the Assistants
* API and Playground. One of `ANY_ROLE`, `OWNERS`, or `NONE`.
*/
threads_ui_visibility?: string;
/**
* The organization title.
*/
title?: string;
/**
* Visibility of the usage dashboard which shows activity and costs for your
* organization. One of `ANY_ROLE` or `OWNERS`.
*/
usage_dashboard_visibility?: string;
}
}
/**
* The project that the action was scoped to. Absent for actions not scoped to
* projects. Note that any admin actions taken via Admin API keys are associated
* with the default project.
*/
interface Project {
/**
* The project ID.
*/
id?: string;
/**
* The project title.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface ProjectArchived {
/**
* The project ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ProjectCreated {
/**
* The project ID.
*/
id?: string;
/**
* The payload used to create the project.
*/
data?: ProjectCreated.Data;
}
namespace ProjectCreated {
/**
* The payload used to create the project.
*/
interface Data {
/**
* The project name.
*/
name?: string;
/**
* The title of the project as seen on the dashboard.
*/
title?: string;
}
}
/**
* The details for events with this `type`.
*/
interface ProjectDeleted {
/**
* The project ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ProjectUpdated {
/**
* The project ID.
*/
id?: string;
/**
* The payload used to update the project.
*/
changes_requested?: ProjectUpdated.ChangesRequested;
}
namespace ProjectUpdated {
/**
* The payload used to update the project.
*/
interface ChangesRequested {
/**
* The title of the project as seen on the dashboard.
*/
title?: string;
}
}
/**
* The details for events with this `type`.
*/
interface RateLimitDeleted {
/**
* The rate limit ID
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface RateLimitUpdated {
/**
* The rate limit ID
*/
id?: string;
/**
* The payload used to update the rate limits.
*/
changes_requested?: RateLimitUpdated.ChangesRequested;
}
namespace RateLimitUpdated {
/**
* The payload used to update the rate limits.
*/
interface ChangesRequested {
/**
* The maximum batch input tokens per day. Only relevant for certain models.
*/
batch_1_day_max_input_tokens?: number;
/**
* The maximum audio megabytes per minute. Only relevant for certain models.
*/
max_audio_megabytes_per_1_minute?: number;
/**
* The maximum images per minute. Only relevant for certain models.
*/
max_images_per_1_minute?: number;
/**
* The maximum requests per day. Only relevant for certain models.
*/
max_requests_per_1_day?: number;
/**
* The maximum requests per minute.
*/
max_requests_per_1_minute?: number;
/**
* The maximum tokens per minute.
*/
max_tokens_per_1_minute?: number;
}
}
/**
* The details for events with this `type`.
*/
interface RoleAssignmentCreated {
/**
* The identifier of the role assignment.
*/
id?: string;
/**
* The principal (user or group) that received the role.
*/
principal_id?: string;
/**
* The type of principal (user or group) that received the role.
*/
principal_type?: string;
/**
* The resource the role assignment is scoped to.
*/
resource_id?: string;
/**
* The type of resource the role assignment is scoped to.
*/
resource_type?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleAssignmentDeleted {
/**
* The identifier of the role assignment.
*/
id?: string;
/**
* The principal (user or group) that had the role removed.
*/
principal_id?: string;
/**
* The type of principal (user or group) that had the role removed.
*/
principal_type?: string;
/**
* The resource the role assignment was scoped to.
*/
resource_id?: string;
/**
* The type of resource the role assignment was scoped to.
*/
resource_type?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleBoundToResource {
/**
* The ID of the resource the role was bound to. ChatGPT workspace connector
* resources use `<workspace_id>__<connector_id>`.
*/
id?: string;
/**
* The connector ID for a ChatGPT workspace connector resource.
*/
connector_id?: string;
/**
* The connector display name for a ChatGPT workspace connector resource, or the
* connector ID when the display name could not be resolved.
*/
connector_name?: string;
/**
* Whether the connector is enabled for the role.
*/
enabled?: boolean;
/**
* The permissions granted to the role for the resource.
*/
permissions?: Array<string>;
/**
* The ID of the resource the role was bound to.
*/
resource_id?: string;
/**
* The type of resource the role was bound to.
*/
resource_type?: string;
/**
* The ID of the role that was bound to the resource.
*/
role_id?: string;
/**
* The connector role mutation path that produced the event.
*/
source?: 'role_toggle' | 'role_connector_update' | 'role_delete' | 'workspace_permissions' | 'connector_publish';
/**
* The workspace ID for a ChatGPT workspace connector resource.
*/
workspace_id?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleCreated {
/**
* The role ID.
*/
id?: string;
/**
* The permissions granted by the role.
*/
permissions?: Array<string>;
/**
* The resource the role is scoped to.
*/
resource_id?: string;
/**
* The type of resource the role belongs to.
*/
resource_type?: string;
/**
* The name of the role.
*/
role_name?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleDeleted {
/**
* The role ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleUnboundFromResource {
/**
* The ID of the resource the role was unbound from. ChatGPT workspace connector
* resources use `<workspace_id>__<connector_id>`.
*/
id?: string;
/**
* The connector ID for a ChatGPT workspace connector resource.
*/
connector_id?: string;
/**
* The connector display name for a ChatGPT workspace connector resource, or the
* connector ID when the display name could not be resolved.
*/
connector_name?: string;
/**
* Whether the connector is enabled for the role.
*/
enabled?: boolean;
/**
* The permissions remaining for the role after the change.
*/
permissions?: Array<string>;
/**
* The ID of the resource the role was unbound from.
*/
resource_id?: string;
/**
* The type of resource the role was unbound from.
*/
resource_type?: string;
/**
* The ID of the role that was unbound from the resource.
*/
role_id?: string;
/**
* The connector role mutation path that produced the event.
*/
source?: 'role_toggle' | 'role_connector_update' | 'role_delete' | 'workspace_permissions' | 'connector_publish';
/**
* The workspace ID for a ChatGPT workspace connector resource.
*/
workspace_id?: string;
}
/**
* The details for events with this `type`.
*/
interface RoleUpdated {
/**
* The role ID.
*/
id?: string;
/**
* The payload used to update the role.
*/
changes_requested?: RoleUpdated.ChangesRequested;
}
namespace RoleUpdated {
/**
* The payload used to update the role.
*/
interface ChangesRequested {
/**
* The updated role description, when provided.
*/
description?: string;
/**
* Additional metadata stored on the role.
*/
metadata?: unknown;
/**
* The permissions added to the role.
*/
permissions_added?: Array<string>;
/**
* The permissions removed from the role.
*/
permissions_removed?: Array<string>;
/**
* The resource the role is scoped to.
*/
resource_id?: string;
/**
* The type of resource the role belongs to.
*/
resource_type?: string;
/**
* The updated role name, when provided.
*/
role_name?: string;
}
}
/**
* The details for events with this `type`.
*/
interface ScimDisabled {
/**
* The ID of the SCIM was disabled for.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ScimEnabled {
/**
* The ID of the SCIM was enabled for.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ServiceAccountCreated {
/**
* The service account ID.
*/
id?: string;
/**
* The payload used to create the service account.
*/
data?: ServiceAccountCreated.Data;
}
namespace ServiceAccountCreated {
/**
* The payload used to create the service account.
*/
interface Data {
/**
* The role of the service account. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface ServiceAccountDeleted {
/**
* The service account ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface ServiceAccountUpdated {
/**
* The service account ID.
*/
id?: string;
/**
* The payload used to updated the service account.
*/
changes_requested?: ServiceAccountUpdated.ChangesRequested;
}
namespace ServiceAccountUpdated {
/**
* The payload used to updated the service account.
*/
interface ChangesRequested {
/**
* The role of the service account. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface UserAdded {
/**
* The user ID.
*/
id?: string;
/**
* The payload used to add the user to the project.
*/
data?: UserAdded.Data;
}
namespace UserAdded {
/**
* The payload used to add the user to the project.
*/
interface Data {
/**
* The role of the user. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface UserDeleted {
/**
* The user ID.
*/
id?: string;
}
/**
* The details for events with this `type`.
*/
interface UserUpdated {
/**
* The project ID.
*/
id?: string;
/**
* The payload used to update the user.
*/
changes_requested?: UserUpdated.ChangesRequested;
}
namespace UserUpdated {
/**
* The payload used to update the user.
*/
interface ChangesRequested {
/**
* The role of the user. Is either `owner` or `member`.
*/
role?: string;
}
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderMappingCreated {
/**
* The workload identity provider mapping ID.
*/
id?: string;
/**
* The payload used to create the workload identity provider mapping.
*/
data?: unknown;
/**
* The workload identity provider ID.
*/
identity_provider_id?: string;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderMappingDeleted {
/**
* The workload identity provider mapping ID.
*/
id?: string;
/**
* The workload identity provider ID.
*/
identity_provider_id?: string;
/**
* The project ID.
*/
project_id?: string;
/**
* The mapped service account ID.
*/
service_account_id?: string;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderMappingUpdated {
/**
* The workload identity provider mapping ID.
*/
id?: string;
/**
* The payload used to update the workload identity provider mapping.
*/
changes_requested?: unknown;
/**
* The workload identity provider ID.
*/
identity_provider_id?: string;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderCreated {
/**
* The workload identity provider ID.
*/
id?: string;
/**
* The payload used to create the workload identity provider.
*/
data?: unknown;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderDeleted {
/**
* The workload identity provider ID.
*/
id?: string;
/**
* The workload identity provider name.
*/
name?: string;
}
/**
* The details for events with this `type`.
*/
interface WorkloadIdentityProviderUpdated {
/**
* The workload identity provider ID.
*/
id?: string;
/**
* The payload used to update the workload identity provider.
*/
changes_requested?: unknown;
}
}
export interface AuditLogListParams extends ConversationCursorPageParams {
/**
* Return only events performed by users with these emails.
*/
actor_emails?: Array<string>;
/**
* Return only events performed by these actors. Can be a user ID, a service
* account ID, or an api key tracking ID.
*/
actor_ids?: Array<string>;
/**
* A cursor for use in pagination. `before` is an object ID that defines your place
* in the list. For instance, if you make a list request and receive 100 objects,
* starting with obj_foo, your subsequent call can include before=obj_foo in order
* to fetch the previous page of the list.
*/
before?: string;
/**
* Return only events whose `effective_at` (Unix seconds) is in this range.
*/
effective_at?: AuditLogListParams.EffectiveAt;
/**
* Return only events with a `type` in one of these values. For example,
* `project.created`. For all options, see the documentation for the
* [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).
*/
event_types?: Array<'api_key.created' | 'api_key.updated' | 'api_key.deleted' | 'certificate.created' | 'certificate.updated' | 'certificate.deleted' | 'certificates.activated' | 'certificates.deactivated' | 'checkpoint.permission.created' | 'checkpoint.permission.deleted' | 'external_key.registered' | 'external_key.removed' | 'group.created' | 'group.updated' | 'group.deleted' | 'invite.sent' | 'invite.accepted' | 'invite.deleted' | 'ip_allowlist.created' | 'ip_allowlist.updated' | 'ip_allowlist.deleted' | 'ip_allowlist.config.activated' | 'ip_allowlist.config.deactivated' | 'login.succeeded' | 'login.failed' | 'logout.succeeded' | 'logout.failed' | 'organization.updated' | 'project.created' | 'project.updated' | 'project.archived' | 'project.deleted' | 'rate_limit.updated' | 'rate_limit.deleted' | 'resource.deleted' | 'tunnel.created' | 'tunnel.updated' | 'tunnel.deleted' | 'workload_identity_provider.created' | 'workload_identity_provider.updated' | 'workload_identity_provider.deleted' | 'workload_identity_provider_mapping.created' | 'workload_identity_provider_mapping.updated' | 'workload_identity_provider_mapping.deleted' | 'role.created' | 'role.updated' | 'role.deleted' | 'role.assignment.created' | 'role.assignment.deleted' | 'role.bound_to_resource' | 'role.unbound_from_resource' | 'scim.enabled' | 'scim.disabled' | 'service_account.created' | 'service_account.updated' | 'service_account.deleted' | 'user.added' | 'user.updated' | 'user.deleted'>;
/**
* Return only events for these projects.
*/
project_ids?: Array<string>;
/**
* Return only events performed on these targets. For example, a project ID
* updated. For ChatGPT connector role events, use the workspace connector resource
* ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.
*/
resource_ids?: Array<string>;
/**
* Return only tenant-scoped events associated with this organization. Required for
* tenant-scoped events such as `role.bound_to_resource` and
* `role.unbound_from_resource`. When `true`, all supplied event types must be
* tenant-scoped.
*/
tenant_only?: boolean;
}
export declare namespace AuditLogListParams {
/**
* Return only events whose `effective_at` (Unix seconds) is in this range.
*/
interface EffectiveAt {
/**
* Return only events whose `effective_at` (Unix seconds) is greater than this
* value.
*/
gt?: number;
/**
* Return only events whose `effective_at` (Unix seconds) is greater than or equal
* to this value.
*/
gte?: number;
/**
* Return only events whose `effective_at` (Unix seconds) is less than this value.
*/
lt?: number;
/**
* Return only events whose `effective_at` (Unix seconds) is less than or equal to
* this value.
*/
lte?: number;
}
}
export declare namespace AuditLogs {
export { type AuditLogListResponse as AuditLogListResponse, type AuditLogListResponsesPage as AuditLogListResponsesPage, type AuditLogListParams as AuditLogListParams, };
}
//# sourceMappingURL=audit-logs.d.ts.map
File diff suppressed because one or more lines are too long
+31
View File
@@ -0,0 +1,31 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuditLogs = void 0;
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
/**
* List user actions and configuration changes within this organization.
*/
class AuditLogs extends resource_1.APIResource {
/**
* List user actions and configuration changes within this organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const auditLogListResponse of client.admin.organization.auditLogs.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/audit_logs', (pagination_1.ConversationCursorPage), {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.AuditLogs = AuditLogs;
//# sourceMappingURL=audit-logs.js.map
@@ -0,0 +1 @@
{"version":3,"file":"audit-logs.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/audit-logs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AACrD,4DAIkC;AAGlC;;GAEG;AACH,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAA,mCAA4C,CAAA,EAAE;YACvG,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AAtBD,8BAsBC"}
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { ConversationCursorPage, } from "../../../core/pagination.mjs";
/**
* List user actions and configuration changes within this organization.
*/
export class AuditLogs extends APIResource {
/**
* List user actions and configuration changes within this organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const auditLogListResponse of client.admin.organization.auditLogs.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/audit_logs', (ConversationCursorPage), {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=audit-logs.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"audit-logs.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/audit-logs.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EACL,sBAAsB,GAGvB,qCAAiC;AAGlC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAA,sBAA4C,CAAA,EAAE;YACvG,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,322 @@
import { APIResource } from "../../../core/resource.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { ConversationCursorPage, type ConversationCursorPageParams, Page, PagePromise } from "../../../core/pagination.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class Certificates extends APIResource {
/**
* Upload a certificate to the organization. This does **not** automatically
* activate the certificate.
*
* Organizations can upload up to 50 certificates.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.create({
* certificate: 'certificate',
* });
* ```
*/
create(body: CertificateCreateParams, options?: RequestOptions): APIPromise<Certificate>;
/**
* Get a certificate that has been uploaded to the organization.
*
* You can get a certificate regardless of whether it is active or not.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.retrieve(
* 'certificate_id',
* );
* ```
*/
retrieve(certificateID: string, query?: CertificateRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<Certificate>;
/**
* Modify a certificate. Note that only the name can be modified.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.update(
* 'certificate_id',
* );
* ```
*/
update(certificateID: string, body: CertificateUpdateParams, options?: RequestOptions): APIPromise<Certificate>;
/**
* List uploaded certificates for this organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateListResponse of client.admin.organization.certificates.list()) {
* // ...
* }
* ```
*/
list(query?: CertificateListParams | null | undefined, options?: RequestOptions): PagePromise<CertificateListResponsesPage, CertificateListResponse>;
/**
* Delete a certificate from the organization.
*
* The certificate must be inactive for the organization and all projects.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.delete(
* 'certificate_id',
* );
* ```
*/
delete(certificateID: string, options?: RequestOptions): APIPromise<CertificateDeleteResponse>;
/**
* Activate certificates at the organization level.
*
* You can atomically and idempotently activate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateActivateResponse of client.admin.organization.certificates.activate(
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
activate(body: CertificateActivateParams, options?: RequestOptions): PagePromise<CertificateActivateResponsesPage, CertificateActivateResponse>;
/**
* Deactivate certificates at the organization level.
*
* You can atomically and idempotently deactivate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateDeactivateResponse of client.admin.organization.certificates.deactivate(
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
deactivate(body: CertificateDeactivateParams, options?: RequestOptions): PagePromise<CertificateDeactivateResponsesPage, CertificateDeactivateResponse>;
}
export type CertificateListResponsesPage = ConversationCursorPage<CertificateListResponse>;
export type CertificateActivateResponsesPage = Page<CertificateActivateResponse>;
export type CertificateDeactivateResponsesPage = Page<CertificateDeactivateResponse>;
/**
* Represents an individual `certificate` uploaded to the organization.
*/
export interface Certificate {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
certificate_details: Certificate.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type.
*
* - If creating, updating, or getting a specific certificate, the object type is
* `certificate`.
* - If listing, activating, or deactivating certificates for the organization, the
* object type is `organization.certificate`.
* - If listing, activating, or deactivating certificates for a project, the object
* type is `organization.project.certificate`.
*/
object: 'certificate' | 'organization.certificate' | 'organization.project.certificate';
/**
* Whether the certificate is currently active at the specified scope. Not returned
* when getting details for a specific certificate.
*/
active?: boolean;
}
export declare namespace Certificate {
interface CertificateDetails {
/**
* The content of the certificate in PEM format.
*/
content?: string;
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
/**
* Represents an individual certificate configured at the organization level.
*/
export interface CertificateListResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the organization level.
*/
active: boolean;
certificate_details: CertificateListResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.certificate`.
*/
object: 'organization.certificate';
}
export declare namespace CertificateListResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
export interface CertificateDeleteResponse {
/**
* The ID of the certificate that was deleted.
*/
id: string;
/**
* The object type, must be `certificate.deleted`.
*/
object: 'certificate.deleted';
}
/**
* Represents an individual certificate configured at the organization level.
*/
export interface CertificateActivateResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the organization level.
*/
active: boolean;
certificate_details: CertificateActivateResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.certificate`.
*/
object: 'organization.certificate';
}
export declare namespace CertificateActivateResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
/**
* Represents an individual certificate configured at the organization level.
*/
export interface CertificateDeactivateResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the organization level.
*/
active: boolean;
certificate_details: CertificateDeactivateResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.certificate`.
*/
object: 'organization.certificate';
}
export declare namespace CertificateDeactivateResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
export interface CertificateCreateParams {
/**
* The certificate content in PEM format
*/
certificate: string;
/**
* An optional name for the certificate
*/
name?: string;
}
export interface CertificateRetrieveParams {
/**
* A list of additional fields to include in the response. Currently the only
* supported value is `content` to fetch the PEM content of the certificate.
*/
include?: Array<'content'>;
}
export interface CertificateUpdateParams {
/**
* The updated name for the certificate
*/
name?: string;
}
export interface CertificateListParams extends ConversationCursorPageParams {
/**
* Sort order by the `created_at` timestamp of the objects. `asc` for ascending
* order and `desc` for descending order.
*/
order?: 'asc' | 'desc';
}
export interface CertificateActivateParams {
certificate_ids: Array<string>;
}
export interface CertificateDeactivateParams {
certificate_ids: Array<string>;
}
export declare namespace Certificates {
export { type Certificate as Certificate, type CertificateListResponse as CertificateListResponse, type CertificateDeleteResponse as CertificateDeleteResponse, type CertificateActivateResponse as CertificateActivateResponse, type CertificateDeactivateResponse as CertificateDeactivateResponse, type CertificateListResponsesPage as CertificateListResponsesPage, type CertificateActivateResponsesPage as CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage as CertificateDeactivateResponsesPage, type CertificateCreateParams as CertificateCreateParams, type CertificateRetrieveParams as CertificateRetrieveParams, type CertificateUpdateParams as CertificateUpdateParams, type CertificateListParams as CertificateListParams, type CertificateActivateParams as CertificateActivateParams, type CertificateDeactivateParams as CertificateDeactivateParams, };
}
//# sourceMappingURL=certificates.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"certificates.d.mts","sourceRoot":"","sources":["../../../src/resources/admin/organization/certificates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,IAAI,EACJ,WAAW,EACZ,qCAAiC;AAClC,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;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;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
@@ -0,0 +1,322 @@
import { APIResource } from "../../../core/resource.js";
import { APIPromise } from "../../../core/api-promise.js";
import { ConversationCursorPage, type ConversationCursorPageParams, Page, PagePromise } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class Certificates extends APIResource {
/**
* Upload a certificate to the organization. This does **not** automatically
* activate the certificate.
*
* Organizations can upload up to 50 certificates.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.create({
* certificate: 'certificate',
* });
* ```
*/
create(body: CertificateCreateParams, options?: RequestOptions): APIPromise<Certificate>;
/**
* Get a certificate that has been uploaded to the organization.
*
* You can get a certificate regardless of whether it is active or not.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.retrieve(
* 'certificate_id',
* );
* ```
*/
retrieve(certificateID: string, query?: CertificateRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<Certificate>;
/**
* Modify a certificate. Note that only the name can be modified.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.update(
* 'certificate_id',
* );
* ```
*/
update(certificateID: string, body: CertificateUpdateParams, options?: RequestOptions): APIPromise<Certificate>;
/**
* List uploaded certificates for this organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateListResponse of client.admin.organization.certificates.list()) {
* // ...
* }
* ```
*/
list(query?: CertificateListParams | null | undefined, options?: RequestOptions): PagePromise<CertificateListResponsesPage, CertificateListResponse>;
/**
* Delete a certificate from the organization.
*
* The certificate must be inactive for the organization and all projects.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.delete(
* 'certificate_id',
* );
* ```
*/
delete(certificateID: string, options?: RequestOptions): APIPromise<CertificateDeleteResponse>;
/**
* Activate certificates at the organization level.
*
* You can atomically and idempotently activate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateActivateResponse of client.admin.organization.certificates.activate(
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
activate(body: CertificateActivateParams, options?: RequestOptions): PagePromise<CertificateActivateResponsesPage, CertificateActivateResponse>;
/**
* Deactivate certificates at the organization level.
*
* You can atomically and idempotently deactivate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateDeactivateResponse of client.admin.organization.certificates.deactivate(
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
deactivate(body: CertificateDeactivateParams, options?: RequestOptions): PagePromise<CertificateDeactivateResponsesPage, CertificateDeactivateResponse>;
}
export type CertificateListResponsesPage = ConversationCursorPage<CertificateListResponse>;
export type CertificateActivateResponsesPage = Page<CertificateActivateResponse>;
export type CertificateDeactivateResponsesPage = Page<CertificateDeactivateResponse>;
/**
* Represents an individual `certificate` uploaded to the organization.
*/
export interface Certificate {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
certificate_details: Certificate.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type.
*
* - If creating, updating, or getting a specific certificate, the object type is
* `certificate`.
* - If listing, activating, or deactivating certificates for the organization, the
* object type is `organization.certificate`.
* - If listing, activating, or deactivating certificates for a project, the object
* type is `organization.project.certificate`.
*/
object: 'certificate' | 'organization.certificate' | 'organization.project.certificate';
/**
* Whether the certificate is currently active at the specified scope. Not returned
* when getting details for a specific certificate.
*/
active?: boolean;
}
export declare namespace Certificate {
interface CertificateDetails {
/**
* The content of the certificate in PEM format.
*/
content?: string;
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
/**
* Represents an individual certificate configured at the organization level.
*/
export interface CertificateListResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the organization level.
*/
active: boolean;
certificate_details: CertificateListResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.certificate`.
*/
object: 'organization.certificate';
}
export declare namespace CertificateListResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
export interface CertificateDeleteResponse {
/**
* The ID of the certificate that was deleted.
*/
id: string;
/**
* The object type, must be `certificate.deleted`.
*/
object: 'certificate.deleted';
}
/**
* Represents an individual certificate configured at the organization level.
*/
export interface CertificateActivateResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the organization level.
*/
active: boolean;
certificate_details: CertificateActivateResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.certificate`.
*/
object: 'organization.certificate';
}
export declare namespace CertificateActivateResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
/**
* Represents an individual certificate configured at the organization level.
*/
export interface CertificateDeactivateResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the organization level.
*/
active: boolean;
certificate_details: CertificateDeactivateResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.certificate`.
*/
object: 'organization.certificate';
}
export declare namespace CertificateDeactivateResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
export interface CertificateCreateParams {
/**
* The certificate content in PEM format
*/
certificate: string;
/**
* An optional name for the certificate
*/
name?: string;
}
export interface CertificateRetrieveParams {
/**
* A list of additional fields to include in the response. Currently the only
* supported value is `content` to fetch the PEM content of the certificate.
*/
include?: Array<'content'>;
}
export interface CertificateUpdateParams {
/**
* The updated name for the certificate
*/
name?: string;
}
export interface CertificateListParams extends ConversationCursorPageParams {
/**
* Sort order by the `created_at` timestamp of the objects. `asc` for ascending
* order and `desc` for descending order.
*/
order?: 'asc' | 'desc';
}
export interface CertificateActivateParams {
certificate_ids: Array<string>;
}
export interface CertificateDeactivateParams {
certificate_ids: Array<string>;
}
export declare namespace Certificates {
export { type Certificate as Certificate, type CertificateListResponse as CertificateListResponse, type CertificateDeleteResponse as CertificateDeleteResponse, type CertificateActivateResponse as CertificateActivateResponse, type CertificateDeactivateResponse as CertificateDeactivateResponse, type CertificateListResponsesPage as CertificateListResponsesPage, type CertificateActivateResponsesPage as CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage as CertificateDeactivateResponsesPage, type CertificateCreateParams as CertificateCreateParams, type CertificateRetrieveParams as CertificateRetrieveParams, type CertificateUpdateParams as CertificateUpdateParams, type CertificateListParams as CertificateListParams, type CertificateActivateParams as CertificateActivateParams, type CertificateDeactivateParams as CertificateDeactivateParams, };
}
//# sourceMappingURL=certificates.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"certificates.d.ts","sourceRoot":"","sources":["../../../src/resources/admin/organization/certificates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,IAAI,EACJ,WAAW,EACZ,oCAAiC;AAClC,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;IAQxF;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,aAAa,EAAE,MAAM,EACrB,KAAK,GAAE,yBAAyB,GAAG,IAAI,GAAG,SAAc,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC;IAQ1B;;;;;;;;;;OAUG;IACH,MAAM,CACJ,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,uBAAuB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC;IAQ1B;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,4BA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AAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
@@ -0,0 +1,144 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Certificates = void 0;
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const path_1 = require("../../../internal/utils/path.js");
class Certificates extends resource_1.APIResource {
/**
* Upload a certificate to the organization. This does **not** automatically
* activate the certificate.
*
* Organizations can upload up to 50 certificates.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.create({
* certificate: 'certificate',
* });
* ```
*/
create(body, options) {
return this._client.post('/organization/certificates', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Get a certificate that has been uploaded to the organization.
*
* You can get a certificate regardless of whether it is active or not.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.retrieve(
* 'certificate_id',
* );
* ```
*/
retrieve(certificateID, query = {}, options) {
return this._client.get((0, path_1.path) `/organization/certificates/${certificateID}`, {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Modify a certificate. Note that only the name can be modified.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.update(
* 'certificate_id',
* );
* ```
*/
update(certificateID, body, options) {
return this._client.post((0, path_1.path) `/organization/certificates/${certificateID}`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* List uploaded certificates for this organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateListResponse of client.admin.organization.certificates.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/certificates', (pagination_1.ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Delete a certificate from the organization.
*
* The certificate must be inactive for the organization and all projects.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.delete(
* 'certificate_id',
* );
* ```
*/
delete(certificateID, options) {
return this._client.delete((0, path_1.path) `/organization/certificates/${certificateID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Activate certificates at the organization level.
*
* You can atomically and idempotently activate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateActivateResponse of client.admin.organization.certificates.activate(
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
activate(body, options) {
return this._client.getAPIList('/organization/certificates/activate', (pagination_1.Page), {
body,
method: 'post',
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Deactivate certificates at the organization level.
*
* You can atomically and idempotently deactivate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateDeactivateResponse of client.admin.organization.certificates.deactivate(
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
deactivate(body, options) {
return this._client.getAPIList('/organization/certificates/deactivate', (pagination_1.Page), { body, method: 'post', ...options, __security: { adminAPIKeyAuth: true } });
}
}
exports.Certificates = Certificates;
//# sourceMappingURL=certificates.js.map
@@ -0,0 +1 @@
{"version":3,"file":"certificates.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/certificates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAKkC;AAElC,0DAAoD;AAEpD,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE;YACrD,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;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,MAAM,EAAE,MAAM;YACd,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,UAAU,CACR,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,uCAAuC,EACvC,CAAA,iBAAmC,CAAA,EACnC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC5E,CAAC;IACJ,CAAC;CACF;AArKD,oCAqKC"}
@@ -0,0 +1,140 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { ConversationCursorPage, Page, } from "../../../core/pagination.mjs";
import { path } from "../../../internal/utils/path.mjs";
export class Certificates extends APIResource {
/**
* Upload a certificate to the organization. This does **not** automatically
* activate the certificate.
*
* Organizations can upload up to 50 certificates.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.create({
* certificate: 'certificate',
* });
* ```
*/
create(body, options) {
return this._client.post('/organization/certificates', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Get a certificate that has been uploaded to the organization.
*
* You can get a certificate regardless of whether it is active or not.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.retrieve(
* 'certificate_id',
* );
* ```
*/
retrieve(certificateID, query = {}, options) {
return this._client.get(path `/organization/certificates/${certificateID}`, {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Modify a certificate. Note that only the name can be modified.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.update(
* 'certificate_id',
* );
* ```
*/
update(certificateID, body, options) {
return this._client.post(path `/organization/certificates/${certificateID}`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* List uploaded certificates for this organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateListResponse of client.admin.organization.certificates.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/certificates', (ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Delete a certificate from the organization.
*
* The certificate must be inactive for the organization and all projects.
*
* @example
* ```ts
* const certificate =
* await client.admin.organization.certificates.delete(
* 'certificate_id',
* );
* ```
*/
delete(certificateID, options) {
return this._client.delete(path `/organization/certificates/${certificateID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Activate certificates at the organization level.
*
* You can atomically and idempotently activate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateActivateResponse of client.admin.organization.certificates.activate(
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
activate(body, options) {
return this._client.getAPIList('/organization/certificates/activate', (Page), {
body,
method: 'post',
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Deactivate certificates at the organization level.
*
* You can atomically and idempotently deactivate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateDeactivateResponse of client.admin.organization.certificates.deactivate(
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
deactivate(body, options) {
return this._client.getAPIList('/organization/certificates/deactivate', (Page), { body, method: 'post', ...options, __security: { adminAPIKeyAuth: true } });
}
}
//# sourceMappingURL=certificates.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"certificates.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/certificates.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,EACL,sBAAsB,EAEtB,IAAI,GAEL,qCAAiC;AAElC,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CA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ACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CACN,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,qCAAqC,EAAE,CAAA,IAAiC,CAAA,EAAE;YACvG,IAAI;YACJ,MAAM,EAAE,MAAM;YACd,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,UAAU,CACR,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,uCAAuC,EACvC,CAAA,IAAmC,CAAA,EACnC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC5E,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,50 @@
import { APIResource } from "../../../core/resource.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class DataRetention extends APIResource {
/**
* Retrieves organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.retrieve();
* ```
*/
retrieve(options?: RequestOptions): APIPromise<OrganizationDataRetention>;
/**
* Updates organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.update({
* retention_type: 'zero_data_retention',
* });
* ```
*/
update(body: DataRetentionUpdateParams, options?: RequestOptions): APIPromise<OrganizationDataRetention>;
}
/**
* Represents the organization's data retention control setting.
*/
export interface OrganizationDataRetention {
/**
* The object type, which is always `organization.data_retention`.
*/
object: 'organization.data_retention';
/**
* The configured organization data retention type.
*/
type: 'zero_data_retention' | 'modified_abuse_monitoring' | 'enhanced_zero_data_retention' | 'enhanced_modified_abuse_monitoring';
}
export interface DataRetentionUpdateParams {
/**
* The desired organization data retention type.
*/
retention_type: 'zero_data_retention' | 'modified_abuse_monitoring' | 'enhanced_zero_data_retention' | 'enhanced_modified_abuse_monitoring';
}
export declare namespace DataRetention {
export { type OrganizationDataRetention as OrganizationDataRetention, type DataRetentionUpdateParams as DataRetentionUpdateParams, };
}
//# sourceMappingURL=data-retention.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"data-retention.d.mts","sourceRoot":"","sources":["../../../src/resources/admin/organization/data-retention.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAEnE,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAOzE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;CAOzG;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,MAAM,EAAE,6BAA6B,CAAC;IAEtC;;OAEG;IACH,IAAI,EACA,qBAAqB,GACrB,2BAA2B,GAC3B,8BAA8B,GAC9B,oCAAoC,CAAC;CAC1C;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,cAAc,EACV,qBAAqB,GACrB,2BAA2B,GAC3B,8BAA8B,GAC9B,oCAAoC,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -0,0 +1,50 @@
import { APIResource } from "../../../core/resource.js";
import { APIPromise } from "../../../core/api-promise.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class DataRetention extends APIResource {
/**
* Retrieves organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.retrieve();
* ```
*/
retrieve(options?: RequestOptions): APIPromise<OrganizationDataRetention>;
/**
* Updates organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.update({
* retention_type: 'zero_data_retention',
* });
* ```
*/
update(body: DataRetentionUpdateParams, options?: RequestOptions): APIPromise<OrganizationDataRetention>;
}
/**
* Represents the organization's data retention control setting.
*/
export interface OrganizationDataRetention {
/**
* The object type, which is always `organization.data_retention`.
*/
object: 'organization.data_retention';
/**
* The configured organization data retention type.
*/
type: 'zero_data_retention' | 'modified_abuse_monitoring' | 'enhanced_zero_data_retention' | 'enhanced_modified_abuse_monitoring';
}
export interface DataRetentionUpdateParams {
/**
* The desired organization data retention type.
*/
retention_type: 'zero_data_retention' | 'modified_abuse_monitoring' | 'enhanced_zero_data_retention' | 'enhanced_modified_abuse_monitoring';
}
export declare namespace DataRetention {
export { type OrganizationDataRetention as OrganizationDataRetention, type DataRetentionUpdateParams as DataRetentionUpdateParams, };
}
//# sourceMappingURL=data-retention.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"data-retention.d.ts","sourceRoot":"","sources":["../../../src/resources/admin/organization/data-retention.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAEnE,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAOzE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;CAOzG;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,MAAM,EAAE,6BAA6B,CAAC;IAEtC;;OAEG;IACH,IAAI,EACA,qBAAqB,GACrB,2BAA2B,GAC3B,8BAA8B,GAC9B,oCAAoC,CAAC;CAC1C;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,cAAc,EACV,qBAAqB,GACrB,2BAA2B,GAC3B,8BAA8B,GAC9B,oCAAoC,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -0,0 +1,42 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataRetention = void 0;
const resource_1 = require("../../../core/resource.js");
class DataRetention extends resource_1.APIResource {
/**
* Retrieves organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.retrieve();
* ```
*/
retrieve(options) {
return this._client.get('/organization/data_retention', {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Updates organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.update({
* retention_type: 'zero_data_retention',
* });
* ```
*/
update(body, options) {
return this._client.post('/organization/data_retention', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.DataRetention = DataRetention;
//# sourceMappingURL=data-retention.js.map
@@ -0,0 +1 @@
{"version":3,"file":"data-retention.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/data-retention.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE;YACtD,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA+B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE;YACvD,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AAnCD,sCAmCC"}
@@ -0,0 +1,38 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
export class DataRetention extends APIResource {
/**
* Retrieves organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.retrieve();
* ```
*/
retrieve(options) {
return this._client.get('/organization/data_retention', {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Updates organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.update({
* retention_type: 'zero_data_retention',
* });
* ```
*/
update(body, options) {
return this._client.post('/organization/data_retention', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=data-retention.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"data-retention.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/data-retention.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAIrD,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE;YACtD,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA+B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE;YACvD,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,2 @@
export * from "./groups/index.mjs";
//# sourceMappingURL=groups.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.d.mts","sourceRoot":"","sources":["../../../src/resources/admin/organization/groups.ts"],"names":[],"mappings":"AAEA,mCAA+B"}
+2
View File
@@ -0,0 +1,2 @@
export * from "./groups/index.js";
//# sourceMappingURL=groups.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../src/resources/admin/organization/groups.ts"],"names":[],"mappings":"AAEA,kCAA+B"}
+6
View File
@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../../../internal/tslib.js");
tslib_1.__exportStar(require("./groups/index.js"), exports);
//# sourceMappingURL=groups.js.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/groups.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B"}
+3
View File
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./groups/index.mjs";
//# sourceMappingURL=groups.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/groups.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,mCAA+B"}
@@ -0,0 +1,160 @@
import { APIResource } from "../../../../core/resource.mjs";
import * as RolesAPI from "./roles.mjs";
import { RoleCreateParams, RoleCreateResponse, RoleDeleteParams, RoleDeleteResponse, RoleListParams, RoleListResponse, RoleListResponsesPage, RoleRetrieveParams, RoleRetrieveResponse, Roles } from "./roles.mjs";
import * as UsersAPI from "./users.mjs";
import { OrganizationGroupUser, OrganizationGroupUsersPage, UserCreateParams, UserCreateResponse, UserDeleteParams, UserDeleteResponse, UserListParams, UserRetrieveParams, UserRetrieveResponse, Users } from "./users.mjs";
import { APIPromise } from "../../../../core/api-promise.mjs";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../core/pagination.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class Groups extends APIResource {
users: UsersAPI.Users;
roles: RolesAPI.Roles;
/**
* Creates a new group in the organization.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.create(
* { name: 'x' },
* );
* ```
*/
create(body: GroupCreateParams, options?: RequestOptions): APIPromise<Group>;
/**
* Retrieves a group.
*
* @example
* ```ts
* const group =
* await client.admin.organization.groups.retrieve(
* 'group_id',
* );
* ```
*/
retrieve(groupID: string, options?: RequestOptions): APIPromise<Group>;
/**
* Updates a group's information.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.update(
* 'group_id',
* { name: 'x' },
* );
* ```
*/
update(groupID: string, body: GroupUpdateParams, options?: RequestOptions): APIPromise<GroupUpdateResponse>;
/**
* Lists all groups in the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const group of client.admin.organization.groups.list()) {
* // ...
* }
* ```
*/
list(query?: GroupListParams | null | undefined, options?: RequestOptions): PagePromise<GroupsPage, Group>;
/**
* Deletes a group from the organization.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.delete(
* 'group_id',
* );
* ```
*/
delete(groupID: string, options?: RequestOptions): APIPromise<GroupDeleteResponse>;
}
export type GroupsPage = NextCursorPage<Group>;
/**
* Details about an organization group.
*/
export interface Group {
/**
* Identifier for the group.
*/
id: string;
/**
* Unix timestamp (in seconds) when the group was created.
*/
created_at: number;
/**
* The type of the group.
*/
group_type: 'group' | 'tenant_group';
/**
* Whether the group is managed through SCIM and controlled by your identity
* provider.
*/
is_scim_managed: boolean;
/**
* Display name of the group.
*/
name: string;
}
/**
* Response returned after updating a group.
*/
export interface GroupUpdateResponse {
/**
* Identifier for the group.
*/
id: string;
/**
* Unix timestamp (in seconds) when the group was created.
*/
created_at: number;
/**
* Whether the group is managed through SCIM and controlled by your identity
* provider.
*/
is_scim_managed: boolean;
/**
* Updated display name for the group.
*/
name: string;
}
/**
* Confirmation payload returned after deleting a group.
*/
export interface GroupDeleteResponse {
/**
* Identifier of the deleted group.
*/
id: string;
/**
* Whether the group was deleted.
*/
deleted: boolean;
/**
* Always `group.deleted`.
*/
object: 'group.deleted';
}
export interface GroupCreateParams {
/**
* Human readable name for the group.
*/
name: string;
}
export interface GroupUpdateParams {
/**
* New display name for the group.
*/
name: string;
}
export interface GroupListParams extends NextCursorPageParams {
/**
* Specifies the sort order of the returned groups.
*/
order?: 'asc' | 'desc';
}
export declare namespace Groups {
export { type Group as Group, type GroupUpdateResponse as GroupUpdateResponse, type GroupDeleteResponse as GroupDeleteResponse, type GroupsPage as GroupsPage, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, type GroupListParams as GroupListParams, };
export { Users as Users, type OrganizationGroupUser as OrganizationGroupUser, type UserCreateResponse as UserCreateResponse, type UserRetrieveResponse as UserRetrieveResponse, type UserDeleteResponse as UserDeleteResponse, type OrganizationGroupUsersPage as OrganizationGroupUsersPage, type UserCreateParams as UserCreateParams, type UserRetrieveParams as UserRetrieveParams, type UserListParams as UserListParams, type UserDeleteParams as UserDeleteParams, };
export { Roles as Roles, type RoleCreateResponse as RoleCreateResponse, type RoleRetrieveResponse as RoleRetrieveResponse, type RoleListResponse as RoleListResponse, type RoleDeleteResponse as RoleDeleteResponse, type RoleListResponsesPage as RoleListResponsesPage, type RoleCreateParams as RoleCreateParams, type RoleRetrieveParams as RoleRetrieveParams, type RoleListParams as RoleListParams, type RoleDeleteParams as RoleDeleteParams, };
}
//# sourceMappingURL=groups.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.d.mts","s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K,IAAI,KAAK,EACnB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,160 @@
import { APIResource } from "../../../../core/resource.js";
import * as RolesAPI from "./roles.js";
import { RoleCreateParams, RoleCreateResponse, RoleDeleteParams, RoleDeleteResponse, RoleListParams, RoleListResponse, RoleListResponsesPage, RoleRetrieveParams, RoleRetrieveResponse, Roles } from "./roles.js";
import * as UsersAPI from "./users.js";
import { OrganizationGroupUser, OrganizationGroupUsersPage, UserCreateParams, UserCreateResponse, UserDeleteParams, UserDeleteResponse, UserListParams, UserRetrieveParams, UserRetrieveResponse, Users } from "./users.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../core/pagination.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class Groups extends APIResource {
users: UsersAPI.Users;
roles: RolesAPI.Roles;
/**
* Creates a new group in the organization.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.create(
* { name: 'x' },
* );
* ```
*/
create(body: GroupCreateParams, options?: RequestOptions): APIPromise<Group>;
/**
* Retrieves a group.
*
* @example
* ```ts
* const group =
* await client.admin.organization.groups.retrieve(
* 'group_id',
* );
* ```
*/
retrieve(groupID: string, options?: RequestOptions): APIPromise<Group>;
/**
* Updates a group's information.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.update(
* 'group_id',
* { name: 'x' },
* );
* ```
*/
update(groupID: string, body: GroupUpdateParams, options?: RequestOptions): APIPromise<GroupUpdateResponse>;
/**
* Lists all groups in the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const group of client.admin.organization.groups.list()) {
* // ...
* }
* ```
*/
list(query?: GroupListParams | null | undefined, options?: RequestOptions): PagePromise<GroupsPage, Group>;
/**
* Deletes a group from the organization.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.delete(
* 'group_id',
* );
* ```
*/
delete(groupID: string, options?: RequestOptions): APIPromise<GroupDeleteResponse>;
}
export type GroupsPage = NextCursorPage<Group>;
/**
* Details about an organization group.
*/
export interface Group {
/**
* Identifier for the group.
*/
id: string;
/**
* Unix timestamp (in seconds) when the group was created.
*/
created_at: number;
/**
* The type of the group.
*/
group_type: 'group' | 'tenant_group';
/**
* Whether the group is managed through SCIM and controlled by your identity
* provider.
*/
is_scim_managed: boolean;
/**
* Display name of the group.
*/
name: string;
}
/**
* Response returned after updating a group.
*/
export interface GroupUpdateResponse {
/**
* Identifier for the group.
*/
id: string;
/**
* Unix timestamp (in seconds) when the group was created.
*/
created_at: number;
/**
* Whether the group is managed through SCIM and controlled by your identity
* provider.
*/
is_scim_managed: boolean;
/**
* Updated display name for the group.
*/
name: string;
}
/**
* Confirmation payload returned after deleting a group.
*/
export interface GroupDeleteResponse {
/**
* Identifier of the deleted group.
*/
id: string;
/**
* Whether the group was deleted.
*/
deleted: boolean;
/**
* Always `group.deleted`.
*/
object: 'group.deleted';
}
export interface GroupCreateParams {
/**
* Human readable name for the group.
*/
name: string;
}
export interface GroupUpdateParams {
/**
* New display name for the group.
*/
name: string;
}
export interface GroupListParams extends NextCursorPageParams {
/**
* Specifies the sort order of the returned groups.
*/
order?: 'asc' | 'desc';
}
export declare namespace Groups {
export { type Group as Group, type GroupUpdateResponse as GroupUpdateResponse, type GroupDeleteResponse as GroupDeleteResponse, type GroupsPage as GroupsPage, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, type GroupListParams as GroupListParams, };
export { Users as Users, type OrganizationGroupUser as OrganizationGroupUser, type UserCreateResponse as UserCreateResponse, type UserRetrieveResponse as UserRetrieveResponse, type UserDeleteResponse as UserDeleteResponse, type OrganizationGroupUsersPage as OrganizationGroupUsersPage, type UserCreateParams as UserCreateParams, type UserRetrieveParams as UserRetrieveParams, type UserListParams as UserListParams, type UserDeleteParams as UserDeleteParams, };
export { Roles as Roles, type RoleCreateResponse as RoleCreateResponse, type RoleRetrieveResponse as RoleRetrieveResponse, type RoleListResponse as RoleListResponse, type RoleDeleteResponse as RoleDeleteResponse, type RoleListResponsesPage as RoleListResponsesPage, type RoleCreateParams as RoleCreateParams, type RoleRetrieveParams as RoleRetrieveParams, type RoleListParams as RoleListParams, type RoleDeleteParams as RoleDeleteParams, };
}
//# sourceMappingURL=groups.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/groups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,KAAK,QAAQ,mB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KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,109 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Groups = void 0;
const tslib_1 = require("../../../../internal/tslib.js");
const resource_1 = require("../../../../core/resource.js");
const RolesAPI = tslib_1.__importStar(require("./roles.js"));
const roles_1 = require("./roles.js");
const UsersAPI = tslib_1.__importStar(require("./users.js"));
const users_1 = require("./users.js");
const pagination_1 = require("../../../../core/pagination.js");
const path_1 = require("../../../../internal/utils/path.js");
class Groups extends resource_1.APIResource {
constructor() {
super(...arguments);
this.users = new UsersAPI.Users(this._client);
this.roles = new RolesAPI.Roles(this._client);
}
/**
* Creates a new group in the organization.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.create(
* { name: 'x' },
* );
* ```
*/
create(body, options) {
return this._client.post('/organization/groups', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves a group.
*
* @example
* ```ts
* const group =
* await client.admin.organization.groups.retrieve(
* 'group_id',
* );
* ```
*/
retrieve(groupID, options) {
return this._client.get((0, path_1.path) `/organization/groups/${groupID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Updates a group's information.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.update(
* 'group_id',
* { name: 'x' },
* );
* ```
*/
update(groupID, body, options) {
return this._client.post((0, path_1.path) `/organization/groups/${groupID}`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists all groups in the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const group of client.admin.organization.groups.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/groups', (pagination_1.NextCursorPage), {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Deletes a group from the organization.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.delete(
* 'group_id',
* );
* ```
*/
delete(groupID, options) {
return this._client.delete((0, path_1.path) `/organization/groups/${groupID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.Groups = Groups;
Groups.Users = users_1.Users;
Groups.Roles = roles_1.Roles;
//# sourceMappingURL=groups.js.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/groups.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,2DAAwD;AACxD,6DAAoC;AACpC,sCAWiB;AACjB,6DAAoC;AACpC,sCAWiB;AAEjB,+DAAqG;AAErG,6DAAuD;AAEvD,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,UAAK,GAAmB,IAAI,QAAQ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AO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,wBAAwB,OAAO,EAAE,EAAE;YAChE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AArGD,wBAqGC;AAsGD,MAAM,CAAC,KAAK,GAAG,aAAK,CAAC;AACrB,MAAM,CAAC,KAAK,GAAG,aAAK,CAAC"}
@@ -0,0 +1,104 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import * as RolesAPI from "./roles.mjs";
import { Roles, } from "./roles.mjs";
import * as UsersAPI from "./users.mjs";
import { Users, } from "./users.mjs";
import { NextCursorPage } from "../../../../core/pagination.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export class Groups extends APIResource {
constructor() {
super(...arguments);
this.users = new UsersAPI.Users(this._client);
this.roles = new RolesAPI.Roles(this._client);
}
/**
* Creates a new group in the organization.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.create(
* { name: 'x' },
* );
* ```
*/
create(body, options) {
return this._client.post('/organization/groups', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves a group.
*
* @example
* ```ts
* const group =
* await client.admin.organization.groups.retrieve(
* 'group_id',
* );
* ```
*/
retrieve(groupID, options) {
return this._client.get(path `/organization/groups/${groupID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Updates a group's information.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.update(
* 'group_id',
* { name: 'x' },
* );
* ```
*/
update(groupID, body, options) {
return this._client.post(path `/organization/groups/${groupID}`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists all groups in the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const group of client.admin.organization.groups.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/groups', (NextCursorPage), {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Deletes a group from the organization.
*
* @example
* ```ts
* const group = await client.admin.organization.groups.delete(
* 'group_id',
* );
* ```
*/
delete(groupID, options) {
return this._client.delete(path `/organization/groups/${groupID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
Groups.Users = Users;
Groups.Roles = Roles;
//# sourceMappingURL=groups.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/groups.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAUL,KAAK,GACN,oBAAgB;AACjB,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAUL,KAAK,GACN,oBAAgB;AAEjB,OAAO,EAAE,cAAc,EAA0C,wCAAoC;AAErG,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAmG3D,CAAC;IAjGC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE;YAC/C,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,OAAe,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,OAAO,EAAE,EAAE;YAC7D,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,OAAe,EACf,IAAuB,EACvB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,wBAAwB,OAAO,EAAE,EAAE;YAC9D,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,cAAqB,CAAA,EAAE;YAC5E,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,OAAe,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,OAAO,EAAE,EAAE;YAChE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AAsGD,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;AACrB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC"}
@@ -0,0 +1,4 @@
export { Groups, type Group, type GroupUpdateResponse, type GroupDeleteResponse, type GroupCreateParams, type GroupUpdateParams, type GroupListParams, type GroupsPage, } from "./groups.mjs";
export { Roles, type RoleCreateResponse, type RoleRetrieveResponse, type RoleListResponse, type RoleDeleteResponse, type RoleCreateParams, type RoleRetrieveParams, type RoleListParams, type RoleDeleteParams, type RoleListResponsesPage, } from "./roles.mjs";
export { Users, type OrganizationGroupUser, type UserCreateResponse, type UserRetrieveResponse, type UserDeleteResponse, type UserCreateParams, type UserRetrieveParams, type UserListParams, type UserDeleteParams, type OrganizationGroupUsersPage, } from "./users.mjs";
//# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,qBAAiB;AAClB,OAAO,EACL,KAAK,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,oBAAgB;AACjB,OAAO,EACL,KAAK,EACL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,GAChC,oBAAgB"}
@@ -0,0 +1,4 @@
export { Groups, type Group, type GroupUpdateResponse, type GroupDeleteResponse, type GroupCreateParams, type GroupUpdateParams, type GroupListParams, type GroupsPage, } from "./groups.js";
export { Roles, type RoleCreateResponse, type RoleRetrieveResponse, type RoleListResponse, type RoleDeleteResponse, type RoleCreateParams, type RoleRetrieveParams, type RoleListParams, type RoleDeleteParams, type RoleListResponsesPage, } from "./roles.js";
export { Users, type OrganizationGroupUser, type UserCreateResponse, type UserRetrieveResponse, type UserDeleteResponse, type UserCreateParams, type UserRetrieveParams, type UserListParams, type UserDeleteParams, type OrganizationGroupUsersPage, } from "./users.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,oBAAiB;AAClB,OAAO,EACL,KAAK,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,mBAAgB;AACjB,OAAO,EACL,KAAK,EACL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,GAChC,mBAAgB"}
@@ -0,0 +1,11 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Users = exports.Roles = exports.Groups = void 0;
var groups_1 = require("./groups.js");
Object.defineProperty(exports, "Groups", { enumerable: true, get: function () { return groups_1.Groups; } });
var roles_1 = require("./roles.js");
Object.defineProperty(exports, "Roles", { enumerable: true, get: function () { return roles_1.Roles; } });
var users_1 = require("./users.js");
Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return users_1.Users; } });
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCASkB;AARhB,gGAAA,MAAM,OAAA;AASR,oCAWiB;AAVf,8FAAA,KAAK,OAAA;AAWP,oCAWiB;AAVf,8FAAA,KAAK,OAAA"}
@@ -0,0 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Groups, } from "./groups.mjs";
export { Roles, } from "./roles.mjs";
export { Users, } from "./users.mjs";
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,MAAM,GAQP,qBAAiB;AAClB,OAAO,EACL,KAAK,GAUN,oBAAgB;AACjB,OAAO,EACL,KAAK,GAUN,oBAAgB"}
@@ -0,0 +1,275 @@
import { APIResource } from "../../../../core/resource.mjs";
import * as RolesAPI from "../roles.mjs";
import { APIPromise } from "../../../../core/api-promise.mjs";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../core/pagination.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class Roles extends APIResource {
/**
* Assigns an organization role to a group within the organization.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.create(
* 'group_id',
* { role_id: 'role_id' },
* );
* ```
*/
create(groupID: string, body: RoleCreateParams, options?: RequestOptions): APIPromise<RoleCreateResponse>;
/**
* Retrieves an organization role assigned to a group.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.retrieve(
* 'role_id',
* { group_id: 'group_id' },
* );
* ```
*/
retrieve(roleID: string, params: RoleRetrieveParams, options?: RequestOptions): APIPromise<RoleRetrieveResponse>;
/**
* Lists the organization roles assigned to a group within the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const roleListResponse of client.admin.organization.groups.roles.list(
* 'group_id',
* )) {
* // ...
* }
* ```
*/
list(groupID: string, query?: RoleListParams | null | undefined, options?: RequestOptions): PagePromise<RoleListResponsesPage, RoleListResponse>;
/**
* Unassigns an organization role from a group within the organization.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.delete(
* 'role_id',
* { group_id: 'group_id' },
* );
* ```
*/
delete(roleID: string, params: RoleDeleteParams, options?: RequestOptions): APIPromise<RoleDeleteResponse>;
}
export type RoleListResponsesPage = NextCursorPage<RoleListResponse>;
/**
* Role assignment linking a group to a role.
*/
export interface RoleCreateResponse {
/**
* Summary information about a group returned in role assignment responses.
*/
group: RoleCreateResponse.Group;
/**
* Always `group.role`.
*/
object: 'group.role';
/**
* Details about a role that can be assigned through the public Roles API.
*/
role: RolesAPI.Role;
}
export declare namespace RoleCreateResponse {
/**
* Summary information about a group returned in role assignment responses.
*/
interface Group {
/**
* Identifier for the group.
*/
id: string;
/**
* Unix timestamp (in seconds) when the group was created.
*/
created_at: number;
/**
* Display name of the group.
*/
name: string;
/**
* Always `group`.
*/
object: 'group';
/**
* Whether the group is managed through SCIM.
*/
scim_managed: boolean;
}
}
/**
* Detailed information about a role assignment entry returned when listing
* assignments.
*/
export interface RoleRetrieveResponse {
/**
* Identifier for the role.
*/
id: string;
/**
* Principals from which the role assignment is inherited, when available.
*/
assignment_sources: Array<RoleRetrieveResponse.AssignmentSource> | null;
/**
* When the role was created.
*/
created_at: number | null;
/**
* Identifier of the actor who created the role.
*/
created_by: string | null;
/**
* User details for the actor that created the role, when available.
*/
created_by_user_obj: {
[key: string]: unknown;
} | null;
/**
* Description of the role.
*/
description: string | null;
/**
* Arbitrary metadata stored on the role.
*/
metadata: {
[key: string]: unknown;
} | null;
/**
* Name of the role.
*/
name: string;
/**
* Permissions associated with the role.
*/
permissions: Array<string>;
/**
* Whether the role is predefined by OpenAI.
*/
predefined_role: boolean;
/**
* Resource type the role applies to.
*/
resource_type: string;
/**
* When the role was last updated.
*/
updated_at: number | null;
}
export declare namespace RoleRetrieveResponse {
interface AssignmentSource {
principal_id: string;
principal_type: string;
}
}
/**
* Detailed information about a role assignment entry returned when listing
* assignments.
*/
export interface RoleListResponse {
/**
* Identifier for the role.
*/
id: string;
/**
* Principals from which the role assignment is inherited, when available.
*/
assignment_sources: Array<RoleListResponse.AssignmentSource> | null;
/**
* When the role was created.
*/
created_at: number | null;
/**
* Identifier of the actor who created the role.
*/
created_by: string | null;
/**
* User details for the actor that created the role, when available.
*/
created_by_user_obj: {
[key: string]: unknown;
} | null;
/**
* Description of the role.
*/
description: string | null;
/**
* Arbitrary metadata stored on the role.
*/
metadata: {
[key: string]: unknown;
} | null;
/**
* Name of the role.
*/
name: string;
/**
* Permissions associated with the role.
*/
permissions: Array<string>;
/**
* Whether the role is predefined by OpenAI.
*/
predefined_role: boolean;
/**
* Resource type the role applies to.
*/
resource_type: string;
/**
* When the role was last updated.
*/
updated_at: number | null;
}
export declare namespace RoleListResponse {
interface AssignmentSource {
principal_id: string;
principal_type: string;
}
}
/**
* Confirmation payload returned after unassigning a role.
*/
export interface RoleDeleteResponse {
/**
* Whether the assignment was removed.
*/
deleted: boolean;
/**
* Identifier for the deleted assignment, such as `group.role.deleted` or
* `user.role.deleted`.
*/
object: string;
}
export interface RoleCreateParams {
/**
* Identifier of the role to assign.
*/
role_id: string;
}
export interface RoleRetrieveParams {
/**
* The ID of the group to inspect.
*/
group_id: string;
}
export interface RoleListParams extends NextCursorPageParams {
/**
* Sort order for the returned organization roles.
*/
order?: 'asc' | 'desc';
}
export interface RoleDeleteParams {
/**
* The ID of the group to modify.
*/
group_id: string;
}
export declare namespace Roles {
export { type RoleCreateResponse as RoleCreateResponse, type RoleRetrieveResponse as RoleRetrieveResponse, type RoleListResponse as RoleListResponse, type RoleDeleteResponse as RoleDeleteResponse, type RoleListResponsesPage as RoleListResponsesPage, type RoleCreateParams as RoleCreateParams, type RoleRetrieveParams as RoleRetrieveParams, type RoleListParams as RoleListParams, type RoleDeleteParams as RoleDeleteParams, };
}
//# sourceMappingURL=roles.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"roles.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/roles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO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;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,275 @@
import { APIResource } from "../../../../core/resource.js";
import * as RolesAPI from "../roles.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../core/pagination.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class Roles extends APIResource {
/**
* Assigns an organization role to a group within the organization.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.create(
* 'group_id',
* { role_id: 'role_id' },
* );
* ```
*/
create(groupID: string, body: RoleCreateParams, options?: RequestOptions): APIPromise<RoleCreateResponse>;
/**
* Retrieves an organization role assigned to a group.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.retrieve(
* 'role_id',
* { group_id: 'group_id' },
* );
* ```
*/
retrieve(roleID: string, params: RoleRetrieveParams, options?: RequestOptions): APIPromise<RoleRetrieveResponse>;
/**
* Lists the organization roles assigned to a group within the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const roleListResponse of client.admin.organization.groups.roles.list(
* 'group_id',
* )) {
* // ...
* }
* ```
*/
list(groupID: string, query?: RoleListParams | null | undefined, options?: RequestOptions): PagePromise<RoleListResponsesPage, RoleListResponse>;
/**
* Unassigns an organization role from a group within the organization.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.delete(
* 'role_id',
* { group_id: 'group_id' },
* );
* ```
*/
delete(roleID: string, params: RoleDeleteParams, options?: RequestOptions): APIPromise<RoleDeleteResponse>;
}
export type RoleListResponsesPage = NextCursorPage<RoleListResponse>;
/**
* Role assignment linking a group to a role.
*/
export interface RoleCreateResponse {
/**
* Summary information about a group returned in role assignment responses.
*/
group: RoleCreateResponse.Group;
/**
* Always `group.role`.
*/
object: 'group.role';
/**
* Details about a role that can be assigned through the public Roles API.
*/
role: RolesAPI.Role;
}
export declare namespace RoleCreateResponse {
/**
* Summary information about a group returned in role assignment responses.
*/
interface Group {
/**
* Identifier for the group.
*/
id: string;
/**
* Unix timestamp (in seconds) when the group was created.
*/
created_at: number;
/**
* Display name of the group.
*/
name: string;
/**
* Always `group`.
*/
object: 'group';
/**
* Whether the group is managed through SCIM.
*/
scim_managed: boolean;
}
}
/**
* Detailed information about a role assignment entry returned when listing
* assignments.
*/
export interface RoleRetrieveResponse {
/**
* Identifier for the role.
*/
id: string;
/**
* Principals from which the role assignment is inherited, when available.
*/
assignment_sources: Array<RoleRetrieveResponse.AssignmentSource> | null;
/**
* When the role was created.
*/
created_at: number | null;
/**
* Identifier of the actor who created the role.
*/
created_by: string | null;
/**
* User details for the actor that created the role, when available.
*/
created_by_user_obj: {
[key: string]: unknown;
} | null;
/**
* Description of the role.
*/
description: string | null;
/**
* Arbitrary metadata stored on the role.
*/
metadata: {
[key: string]: unknown;
} | null;
/**
* Name of the role.
*/
name: string;
/**
* Permissions associated with the role.
*/
permissions: Array<string>;
/**
* Whether the role is predefined by OpenAI.
*/
predefined_role: boolean;
/**
* Resource type the role applies to.
*/
resource_type: string;
/**
* When the role was last updated.
*/
updated_at: number | null;
}
export declare namespace RoleRetrieveResponse {
interface AssignmentSource {
principal_id: string;
principal_type: string;
}
}
/**
* Detailed information about a role assignment entry returned when listing
* assignments.
*/
export interface RoleListResponse {
/**
* Identifier for the role.
*/
id: string;
/**
* Principals from which the role assignment is inherited, when available.
*/
assignment_sources: Array<RoleListResponse.AssignmentSource> | null;
/**
* When the role was created.
*/
created_at: number | null;
/**
* Identifier of the actor who created the role.
*/
created_by: string | null;
/**
* User details for the actor that created the role, when available.
*/
created_by_user_obj: {
[key: string]: unknown;
} | null;
/**
* Description of the role.
*/
description: string | null;
/**
* Arbitrary metadata stored on the role.
*/
metadata: {
[key: string]: unknown;
} | null;
/**
* Name of the role.
*/
name: string;
/**
* Permissions associated with the role.
*/
permissions: Array<string>;
/**
* Whether the role is predefined by OpenAI.
*/
predefined_role: boolean;
/**
* Resource type the role applies to.
*/
resource_type: string;
/**
* When the role was last updated.
*/
updated_at: number | null;
}
export declare namespace RoleListResponse {
interface AssignmentSource {
principal_id: string;
principal_type: string;
}
}
/**
* Confirmation payload returned after unassigning a role.
*/
export interface RoleDeleteResponse {
/**
* Whether the assignment was removed.
*/
deleted: boolean;
/**
* Identifier for the deleted assignment, such as `group.role.deleted` or
* `user.role.deleted`.
*/
object: string;
}
export interface RoleCreateParams {
/**
* Identifier of the role to assign.
*/
role_id: string;
}
export interface RoleRetrieveParams {
/**
* The ID of the group to inspect.
*/
group_id: string;
}
export interface RoleListParams extends NextCursorPageParams {
/**
* Sort order for the returned organization roles.
*/
order?: 'asc' | 'desc';
}
export interface RoleDeleteParams {
/**
* The ID of the group to modify.
*/
group_id: string;
}
export declare namespace Roles {
export { type RoleCreateResponse as RoleCreateResponse, type RoleRetrieveResponse as RoleRetrieveResponse, type RoleListResponse as RoleListResponse, type RoleDeleteResponse as RoleDeleteResponse, type RoleListResponsesPage as RoleListResponsesPage, type RoleCreateParams as RoleCreateParams, type RoleRetrieveParams as RoleRetrieveParams, type RoleListParams as RoleListParams, type RoleDeleteParams as RoleDeleteParams, };
}
//# sourceMappingURL=roles.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/roles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,KAAK,QAAQ,oBAAiB;AACrC,OAAO,E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CAAC;IAC7B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,84 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Roles = void 0;
const resource_1 = require("../../../../core/resource.js");
const pagination_1 = require("../../../../core/pagination.js");
const path_1 = require("../../../../internal/utils/path.js");
class Roles extends resource_1.APIResource {
/**
* Assigns an organization role to a group within the organization.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.create(
* 'group_id',
* { role_id: 'role_id' },
* );
* ```
*/
create(groupID, body, options) {
return this._client.post((0, path_1.path) `/organization/groups/${groupID}/roles`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves an organization role assigned to a group.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.retrieve(
* 'role_id',
* { group_id: 'group_id' },
* );
* ```
*/
retrieve(roleID, params, options) {
const { group_id } = params;
return this._client.get((0, path_1.path) `/organization/groups/${group_id}/roles/${roleID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists the organization roles assigned to a group within the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const roleListResponse of client.admin.organization.groups.roles.list(
* 'group_id',
* )) {
* // ...
* }
* ```
*/
list(groupID, query = {}, options) {
return this._client.getAPIList((0, path_1.path) `/organization/groups/${groupID}/roles`, (pagination_1.NextCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Unassigns an organization role from a group within the organization.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.delete(
* 'role_id',
* { group_id: 'group_id' },
* );
* ```
*/
delete(roleID, params, options) {
const { group_id } = params;
return this._client.delete((0, path_1.path) `/organization/groups/${group_id}/roles/${roleID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.Roles = Roles;
//# sourceMappingURL=roles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/roles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAwD;AAGxD,+DAAqG;AAErG,6DAAuD;AAEvD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,OAAe,EAAE,IAAsB,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,wBAAwB,OAAO,QAAQ,EAAE;YACpE,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,MAAc,EACd,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,QAAQ,UAAU,MAAM,EAAE,EAAE;YAC9E,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,OAAe,EACf,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,wBAAwB,OAAO,QAAQ,EAC3C,CAAA,2BAAgC,CAAA,EAChC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAc,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,wBAAwB,QAAQ,UAAU,MAAM,EAAE,EAAE;YACjF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AAzFD,sBAyFC"}
@@ -0,0 +1,80 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { NextCursorPage } from "../../../../core/pagination.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export class Roles extends APIResource {
/**
* Assigns an organization role to a group within the organization.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.create(
* 'group_id',
* { role_id: 'role_id' },
* );
* ```
*/
create(groupID, body, options) {
return this._client.post(path `/organization/groups/${groupID}/roles`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves an organization role assigned to a group.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.retrieve(
* 'role_id',
* { group_id: 'group_id' },
* );
* ```
*/
retrieve(roleID, params, options) {
const { group_id } = params;
return this._client.get(path `/organization/groups/${group_id}/roles/${roleID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists the organization roles assigned to a group within the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const roleListResponse of client.admin.organization.groups.roles.list(
* 'group_id',
* )) {
* // ...
* }
* ```
*/
list(groupID, query = {}, options) {
return this._client.getAPIList(path `/organization/groups/${groupID}/roles`, (NextCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Unassigns an organization role from a group within the organization.
*
* @example
* ```ts
* const role =
* await client.admin.organization.groups.roles.delete(
* 'role_id',
* { group_id: 'group_id' },
* );
* ```
*/
delete(roleID, params, options) {
const { group_id } = params;
return this._client.delete(path `/organization/groups/${group_id}/roles/${roleID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=roles.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"roles.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/roles.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAGxD,OAAO,EAAE,cAAc,EAA0C,wCAAoC;AAErG,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,OAAe,EAAE,IAAsB,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,wBAAwB,OAAO,QAAQ,EAAE;YACpE,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,MAAc,EACd,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,QAAQ,UAAU,MAAM,EAAE,EAAE;YAC9E,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,OAAe,EACf,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,wBAAwB,OAAO,QAAQ,EAC3C,CAAA,cAAgC,CAAA,EAChC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAc,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,QAAQ,UAAU,MAAM,EAAE,EAAE;YACjF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,164 @@
import { APIResource } from "../../../../core/resource.mjs";
import { APIPromise } from "../../../../core/api-promise.mjs";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../core/pagination.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class Users extends APIResource {
/**
* Adds a user to a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.create(
* 'group_id',
* { user_id: 'user_id' },
* );
* ```
*/
create(groupID: string, body: UserCreateParams, options?: RequestOptions): APIPromise<UserCreateResponse>;
/**
* Retrieves a user in a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.retrieve(
* 'user_id',
* { group_id: 'group_id' },
* );
* ```
*/
retrieve(userID: string, params: UserRetrieveParams, options?: RequestOptions): APIPromise<UserRetrieveResponse>;
/**
* Lists the users assigned to a group.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const organizationGroupUser of client.admin.organization.groups.users.list(
* 'group_id',
* )) {
* // ...
* }
* ```
*/
list(groupID: string, query?: UserListParams | null | undefined, options?: RequestOptions): PagePromise<OrganizationGroupUsersPage, OrganizationGroupUser>;
/**
* Removes a user from a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.delete(
* 'user_id',
* { group_id: 'group_id' },
* );
* ```
*/
delete(userID: string, params: UserDeleteParams, options?: RequestOptions): APIPromise<UserDeleteResponse>;
}
export type OrganizationGroupUsersPage = NextCursorPage<OrganizationGroupUser>;
/**
* Represents an individual user returned when inspecting group membership.
*/
export interface OrganizationGroupUser {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The email address of the user.
*/
email: string | null;
/**
* The name of the user.
*/
name: string;
}
/**
* Confirmation payload returned after adding a user to a group.
*/
export interface UserCreateResponse {
/**
* Identifier of the group the user was added to.
*/
group_id: string;
/**
* Always `group.user`.
*/
object: 'group.user';
/**
* Identifier of the user that was added.
*/
user_id: string;
}
/**
* Details about a user returned from an organization group membership lookup.
*/
export interface UserRetrieveResponse {
/**
* Identifier for the user.
*/
id: string;
/**
* Email address of the user, or `null` for users without an email.
*/
email: string | null;
/**
* Whether the user is a service account.
*/
is_service_account: boolean | null;
/**
* Display name of the user.
*/
name: string;
/**
* URL of the user's profile picture, if available.
*/
picture: string | null;
/**
* The type of user.
*/
user_type: 'user' | 'tenant_user';
}
/**
* Confirmation payload returned after removing a user from a group.
*/
export interface UserDeleteResponse {
/**
* Whether the group membership was removed.
*/
deleted: boolean;
/**
* Always `group.user.deleted`.
*/
object: 'group.user.deleted';
}
export interface UserCreateParams {
/**
* Identifier of the user to add to the group.
*/
user_id: string;
}
export interface UserRetrieveParams {
/**
* The ID of the group to inspect.
*/
group_id: string;
}
export interface UserListParams extends NextCursorPageParams {
/**
* Specifies the sort order of users in the list.
*/
order?: 'asc' | 'desc';
}
export interface UserDeleteParams {
/**
* The ID of the group to update.
*/
group_id: string;
}
export declare namespace Users {
export { type OrganizationGroupUser as OrganizationGroupUser, type UserCreateResponse as UserCreateResponse, type UserRetrieveResponse as UserRetrieveResponse, type UserDeleteResponse as UserDeleteResponse, type OrganizationGroupUsersPage as OrganizationGroupUsersPage, type UserCreateParams as UserCreateParams, type UserRetrieveParams as UserRetrieveParams, type UserListParams as UserListParams, type UserDeleteParams as UserDeleteParams, };
}
//# sourceMappingURL=users.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"users.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/users.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,yCAAqC;AAC1D,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,WAAW,EAAE,wCAAoC;AACrG,OAAO,EAAE,cAAc,EAAE,iDAA6C;AAGtE,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAQzG;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAQnC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,qBAAqB,CAAC;IAQjE;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;CAO3G;AAED,MAAM,MAAM,0BAA0B,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,K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AAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,164 @@
import { APIResource } from "../../../../core/resource.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../core/pagination.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class Users extends APIResource {
/**
* Adds a user to a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.create(
* 'group_id',
* { user_id: 'user_id' },
* );
* ```
*/
create(groupID: string, body: UserCreateParams, options?: RequestOptions): APIPromise<UserCreateResponse>;
/**
* Retrieves a user in a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.retrieve(
* 'user_id',
* { group_id: 'group_id' },
* );
* ```
*/
retrieve(userID: string, params: UserRetrieveParams, options?: RequestOptions): APIPromise<UserRetrieveResponse>;
/**
* Lists the users assigned to a group.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const organizationGroupUser of client.admin.organization.groups.users.list(
* 'group_id',
* )) {
* // ...
* }
* ```
*/
list(groupID: string, query?: UserListParams | null | undefined, options?: RequestOptions): PagePromise<OrganizationGroupUsersPage, OrganizationGroupUser>;
/**
* Removes a user from a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.delete(
* 'user_id',
* { group_id: 'group_id' },
* );
* ```
*/
delete(userID: string, params: UserDeleteParams, options?: RequestOptions): APIPromise<UserDeleteResponse>;
}
export type OrganizationGroupUsersPage = NextCursorPage<OrganizationGroupUser>;
/**
* Represents an individual user returned when inspecting group membership.
*/
export interface OrganizationGroupUser {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The email address of the user.
*/
email: string | null;
/**
* The name of the user.
*/
name: string;
}
/**
* Confirmation payload returned after adding a user to a group.
*/
export interface UserCreateResponse {
/**
* Identifier of the group the user was added to.
*/
group_id: string;
/**
* Always `group.user`.
*/
object: 'group.user';
/**
* Identifier of the user that was added.
*/
user_id: string;
}
/**
* Details about a user returned from an organization group membership lookup.
*/
export interface UserRetrieveResponse {
/**
* Identifier for the user.
*/
id: string;
/**
* Email address of the user, or `null` for users without an email.
*/
email: string | null;
/**
* Whether the user is a service account.
*/
is_service_account: boolean | null;
/**
* Display name of the user.
*/
name: string;
/**
* URL of the user's profile picture, if available.
*/
picture: string | null;
/**
* The type of user.
*/
user_type: 'user' | 'tenant_user';
}
/**
* Confirmation payload returned after removing a user from a group.
*/
export interface UserDeleteResponse {
/**
* Whether the group membership was removed.
*/
deleted: boolean;
/**
* Always `group.user.deleted`.
*/
object: 'group.user.deleted';
}
export interface UserCreateParams {
/**
* Identifier of the user to add to the group.
*/
user_id: string;
}
export interface UserRetrieveParams {
/**
* The ID of the group to inspect.
*/
group_id: string;
}
export interface UserListParams extends NextCursorPageParams {
/**
* Specifies the sort order of users in the list.
*/
order?: 'asc' | 'desc';
}
export interface UserDeleteParams {
/**
* The ID of the group to update.
*/
group_id: string;
}
export declare namespace Users {
export { type OrganizationGroupUser as OrganizationGroupUser, type UserCreateResponse as UserCreateResponse, type UserRetrieveResponse as UserRetrieveResponse, type UserDeleteResponse as UserDeleteResponse, type OrganizationGroupUsersPage as OrganizationGroupUsersPage, type UserCreateParams as UserCreateParams, type UserRetrieveParams as UserRetrieveParams, type UserListParams as UserListParams, type UserDeleteParams as UserDeleteParams, };
}
//# sourceMappingURL=users.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/users.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,wCAAqC;AAC1D,OAAO,EAAE,cAAc,EAAE,KAA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E,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IAC1D;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,84 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Users = void 0;
const resource_1 = require("../../../../core/resource.js");
const pagination_1 = require("../../../../core/pagination.js");
const path_1 = require("../../../../internal/utils/path.js");
class Users extends resource_1.APIResource {
/**
* Adds a user to a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.create(
* 'group_id',
* { user_id: 'user_id' },
* );
* ```
*/
create(groupID, body, options) {
return this._client.post((0, path_1.path) `/organization/groups/${groupID}/users`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves a user in a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.retrieve(
* 'user_id',
* { group_id: 'group_id' },
* );
* ```
*/
retrieve(userID, params, options) {
const { group_id } = params;
return this._client.get((0, path_1.path) `/organization/groups/${group_id}/users/${userID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists the users assigned to a group.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const organizationGroupUser of client.admin.organization.groups.users.list(
* 'group_id',
* )) {
* // ...
* }
* ```
*/
list(groupID, query = {}, options) {
return this._client.getAPIList((0, path_1.path) `/organization/groups/${groupID}/users`, (pagination_1.NextCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Removes a user from a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.delete(
* 'user_id',
* { group_id: 'group_id' },
* );
* ```
*/
delete(userID, params, options) {
const { group_id } = params;
return this._client.delete((0, path_1.path) `/organization/groups/${group_id}/users/${userID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.Users = Users;
//# sourceMappingURL=users.js.map
@@ -0,0 +1 @@
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/users.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAwD;AAExD,+DAAqG;AAErG,6DAAuD;AAEvD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,OAAe,EAA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API spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { NextCursorPage } from "../../../../core/pagination.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export class Users extends APIResource {
/**
* Adds a user to a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.create(
* 'group_id',
* { user_id: 'user_id' },
* );
* ```
*/
create(groupID, body, options) {
return this._client.post(path `/organization/groups/${groupID}/users`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves a user in a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.retrieve(
* 'user_id',
* { group_id: 'group_id' },
* );
* ```
*/
retrieve(userID, params, options) {
const { group_id } = params;
return this._client.get(path `/organization/groups/${group_id}/users/${userID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists the users assigned to a group.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const organizationGroupUser of client.admin.organization.groups.users.list(
* 'group_id',
* )) {
* // ...
* }
* ```
*/
list(groupID, query = {}, options) {
return this._client.getAPIList(path `/organization/groups/${groupID}/users`, (NextCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Removes a user from a group.
*
* @example
* ```ts
* const user =
* await client.admin.organization.groups.users.delete(
* 'user_id',
* { group_id: 'group_id' },
* );
* ```
*/
delete(userID, params, options) {
const { group_id } = params;
return this._client.delete(path `/organization/groups/${group_id}/users/${userID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=users.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"users.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/groups/users.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAExD,OAAO,EAAE,cAAc,EAA0C,wCAAoC;AAErG,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,KAAM,SAAQ,WAAW;IAC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@@
export { AdminAPIKeys, type AdminAPIKey, type AdminAPIKeyCreateResponse, type AdminAPIKeyDeleteResponse, type AdminAPIKeyCreateParams, type AdminAPIKeyListParams, type AdminAPIKeysPage, } from "./admin-api-keys.mjs";
export { AuditLogs, type AuditLogListResponse, type AuditLogListParams, type AuditLogListResponsesPage, } from "./audit-logs.mjs";
export { Certificates, type Certificate, type CertificateListResponse, type CertificateDeleteResponse, type CertificateActivateResponse, type CertificateDeactivateResponse, type CertificateCreateParams, type CertificateRetrieveParams, type CertificateUpdateParams, type CertificateListParams, type CertificateActivateParams, type CertificateDeactivateParams, type CertificateListResponsesPage, type CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage, } from "./certificates.mjs";
export { DataRetention, type OrganizationDataRetention, type DataRetentionUpdateParams, } from "./data-retention.mjs";
export { Groups, type Group, type GroupUpdateResponse, type GroupDeleteResponse, type GroupCreateParams, type GroupUpdateParams, type GroupListParams, type GroupsPage, } from "./groups/index.mjs";
export { Invites, type Invite, type InviteDeleteResponse, type InviteCreateParams, type InviteListParams, type InvitesPage, } from "./invites.mjs";
export { Organization } from "./organization.mjs";
export { Projects, type Project, type ProjectCreateParams, type ProjectUpdateParams, type ProjectListParams, type ProjectsPage, } from "./projects/index.mjs";
export { Roles, type Role, type RoleDeleteResponse, type RoleCreateParams, type RoleUpdateParams, type RoleListParams, type RolesPage, } from "./roles.mjs";
export { SpendAlerts, type OrganizationSpendAlert, type OrganizationSpendAlertDeleted, type SpendAlertCreateParams, type SpendAlertUpdateParams, type SpendAlertListParams, type OrganizationSpendAlertsPage, } from "./spend-alerts.mjs";
export { Usage, type UsageAudioSpeechesResponse, type UsageAudioTranscriptionsResponse, type UsageCodeInterpreterSessionsResponse, type UsageCompletionsResponse, type UsageCostsResponse, type UsageEmbeddingsResponse, type UsageFileSearchCallsResponse, type UsageImagesResponse, type UsageModerationsResponse, type UsageVectorStoresResponse, type UsageWebSearchCallsResponse, type UsageAudioSpeechesParams, type UsageAudioTranscriptionsParams, type UsageCodeInterpreterSessionsParams, type UsageCompletionsParams, type UsageCostsParams, type UsageEmbeddingsParams, type UsageFileSearchCallsParams, type UsageImagesParams, type UsageModerationsParams, type UsageVectorStoresParams, type UsageWebSearchCallsParams, } from "./usage.mjs";
export { Users, type OrganizationUser, type UserDeleteResponse, type UserUpdateParams, type UserListParams, type OrganizationUsersPage, } from "./users/index.mjs";
//# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/admin/organization/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,6BAAyB;AAC1B,OAAO,EACL,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,GAC/B,yBAAqB;AACtB,OAAO,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,GACxC,2BAAuB;AACxB,OAAO,EACL,aAAa,EACb,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GAC/B,6BAAyB;AAC1B,OAAO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,2BAAuB;AACxB,OAAO,EACL,OAAO,EACP,KAAK,MA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@ -0,0 +1,13 @@
export { AdminAPIKeys, type AdminAPIKey, type AdminAPIKeyCreateResponse, type AdminAPIKeyDeleteResponse, type AdminAPIKeyCreateParams, type AdminAPIKeyListParams, type AdminAPIKeysPage, } from "./admin-api-keys.js";
export { AuditLogs, type AuditLogListResponse, type AuditLogListParams, type AuditLogListResponsesPage, } from "./audit-logs.js";
export { Certificates, type Certificate, type CertificateListResponse, type CertificateDeleteResponse, type CertificateActivateResponse, type CertificateDeactivateResponse, type CertificateCreateParams, type CertificateRetrieveParams, type CertificateUpdateParams, type CertificateListParams, type CertificateActivateParams, type CertificateDeactivateParams, type CertificateListResponsesPage, type CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage, } from "./certificates.js";
export { DataRetention, type OrganizationDataRetention, type DataRetentionUpdateParams, } from "./data-retention.js";
export { Groups, type Group, type GroupUpdateResponse, type GroupDeleteResponse, type GroupCreateParams, type GroupUpdateParams, type GroupListParams, type GroupsPage, } from "./groups/index.js";
export { Invites, type Invite, type InviteDeleteResponse, type InviteCreateParams, type InviteListParams, type InvitesPage, } from "./invites.js";
export { Organization } from "./organization.js";
export { Projects, type Project, type ProjectCreateParams, type ProjectUpdateParams, type ProjectListParams, type ProjectsPage, } from "./projects/index.js";
export { Roles, type Role, type RoleDeleteResponse, type RoleCreateParams, type RoleUpdateParams, type RoleListParams, type RolesPage, } from "./roles.js";
export { SpendAlerts, type OrganizationSpendAlert, type OrganizationSpendAlertDeleted, type SpendAlertCreateParams, type SpendAlertUpdateParams, type SpendAlertListParams, type OrganizationSpendAlertsPage, } from "./spend-alerts.js";
export { Usage, type UsageAudioSpeechesResponse, type UsageAudioTranscriptionsResponse, type UsageCodeInterpreterSessionsResponse, type UsageCompletionsResponse, type UsageCostsResponse, type UsageEmbeddingsResponse, type UsageFileSearchCallsResponse, type UsageImagesResponse, type UsageModerationsResponse, type UsageVectorStoresResponse, type UsageWebSearchCallsResponse, type UsageAudioSpeechesParams, type UsageAudioTranscriptionsParams, type UsageCodeInterpreterSessionsParams, type UsageCompletionsParams, type UsageCostsParams, type UsageEmbeddingsParams, type UsageFileSearchCallsParams, type UsageImagesParams, type UsageModerationsParams, type UsageVectorStoresParams, type UsageWebSearchCallsParams, } from "./usage.js";
export { Users, type OrganizationUser, type UserDeleteResponse, type UserUpdateParams, type UserListParams, type OrganizationUsersPage, } from "./users/index.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/admin/organization/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,4BAAyB;AAC1B,OAAO,EACL,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,GAC/B,wBAAqB;AACtB,OAAO,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,GACxC,0BAAuB;AACxB,OAAO,EACL,aAAa,EACb,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,GAC/B,4BAAyB;AAC1B,OAAO,EACL,MAAM,EACN,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,0BAAuB;AACxB,OAAO,EACL,OAAO,EACP,KAAK,MAAM,EACX,KAAK,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@@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Users = exports.Usage = exports.SpendAlerts = exports.Roles = exports.Projects = exports.Organization = exports.Invites = exports.Groups = exports.DataRetention = exports.Certificates = exports.AuditLogs = exports.AdminAPIKeys = void 0;
var admin_api_keys_1 = require("./admin-api-keys.js");
Object.defineProperty(exports, "AdminAPIKeys", { enumerable: true, get: function () { return admin_api_keys_1.AdminAPIKeys; } });
var audit_logs_1 = require("./audit-logs.js");
Object.defineProperty(exports, "AuditLogs", { enumerable: true, get: function () { return audit_logs_1.AuditLogs; } });
var certificates_1 = require("./certificates.js");
Object.defineProperty(exports, "Certificates", { enumerable: true, get: function () { return certificates_1.Certificates; } });
var data_retention_1 = require("./data-retention.js");
Object.defineProperty(exports, "DataRetention", { enumerable: true, get: function () { return data_retention_1.DataRetention; } });
var index_1 = require("./groups/index.js");
Object.defineProperty(exports, "Groups", { enumerable: true, get: function () { return index_1.Groups; } });
var invites_1 = require("./invites.js");
Object.defineProperty(exports, "Invites", { enumerable: true, get: function () { return invites_1.Invites; } });
var organization_1 = require("./organization.js");
Object.defineProperty(exports, "Organization", { enumerable: true, get: function () { return organization_1.Organization; } });
var index_2 = require("./projects/index.js");
Object.defineProperty(exports, "Projects", { enumerable: true, get: function () { return index_2.Projects; } });
var roles_1 = require("./roles.js");
Object.defineProperty(exports, "Roles", { enumerable: true, get: function () { return roles_1.Roles; } });
var spend_alerts_1 = require("./spend-alerts.js");
Object.defineProperty(exports, "SpendAlerts", { enumerable: true, get: function () { return spend_alerts_1.SpendAlerts; } });
var usage_1 = require("./usage.js");
Object.defineProperty(exports, "Usage", { enumerable: true, get: function () { return usage_1.Usage; } });
var index_3 = require("./users/index.js");
Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return index_3.Users; } });
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sDAQ0B;AAPxB,8GAAA,YAAY,OAAA;AAQd,8CAKsB;AAJpB,uGAAA,SAAS,OAAA;AAKX,kDAgBwB;AAftB,4GAAA,YAAY,OAAA;AAgBd,sDAI0B;AAHxB,+GAAA,aAAa,OAAA;AAIf,2CASwB;AARtB,+FAAA,MAAM,OAAA;AASR,wCAOmB;AANjB,kGAAA,OAAO,OAAA;AAOT,kDAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,6CAO0B;AANxB,iGAAA,QAAQ,OAAA;AAOV,oCAQiB;AAPf,8FAAA,KAAK,OAAA;AAQP,kDAQwB;AAPtB,2GAAA,WAAW,OAAA;AAQb,oCAwBiB;AAvBf,8FAAA,KAAK,OAAA;AAwBP,0CAOuB;AANrB,8FAAA,KAAK,OAAA"}
+14
View File
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { AdminAPIKeys, } from "./admin-api-keys.mjs";
export { AuditLogs, } from "./audit-logs.mjs";
export { Certificates, } from "./certificates.mjs";
export { DataRetention, } from "./data-retention.mjs";
export { Groups, } from "./groups/index.mjs";
export { Invites, } from "./invites.mjs";
export { Organization } from "./organization.mjs";
export { Projects, } from "./projects/index.mjs";
export { Roles, } from "./roles.mjs";
export { SpendAlerts, } from "./spend-alerts.mjs";
export { Usage, } from "./usage.mjs";
export { Users, } from "./users/index.mjs";
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,YAAY,GAOb,6BAAyB;AAC1B,OAAO,EACL,SAAS,GAIV,yBAAqB;AACtB,OAAO,EACL,YAAY,GAeb,2BAAuB;AACxB,OAAO,EACL,aAAa,GAGd,6BAAyB;AAC1B,OAAO,EACL,MAAM,GAQP,2BAAuB;AACxB,OAAO,EACL,OAAO,GAMR,sBAAkB;AACnB,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,OAAO,EACL,QAAQ,GAMT,6BAAyB;AAC1B,OAAO,EACL,KAAK,GAON,oBAAgB;AACjB,OAAO,EACL,WAAW,GAOZ,2BAAuB;AACxB,OAAO,EACL,KAAK,GAuBN,oBAAgB;AACjB,OAAO,EACL,KAAK,GAMN,0BAAsB"}
+153
View File
@@ -0,0 +1,153 @@
import { APIResource } from "../../../core/resource.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../../core/pagination.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class Invites extends APIResource {
/**
* Create an invite for a user to the organization. The invite must be accepted by
* the user before they have access to the organization.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.create({
* email: 'email',
* role: 'reader',
* });
* ```
*/
create(body: InviteCreateParams, options?: RequestOptions): APIPromise<Invite>;
/**
* Retrieves an invite.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.retrieve(
* 'invite_id',
* );
* ```
*/
retrieve(inviteID: string, options?: RequestOptions): APIPromise<Invite>;
/**
* Returns a list of invites in the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const invite of client.admin.organization.invites.list()) {
* // ...
* }
* ```
*/
list(query?: InviteListParams | null | undefined, options?: RequestOptions): PagePromise<InvitesPage, Invite>;
/**
* Delete an invite. If the invite has already been accepted, it cannot be deleted.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.delete(
* 'invite_id',
* );
* ```
*/
delete(inviteID: string, options?: RequestOptions): APIPromise<InviteDeleteResponse>;
}
export type InvitesPage = ConversationCursorPage<Invite>;
/**
* Represents an individual `invite` to the organization.
*/
export interface Invite {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the invite was sent.
*/
created_at: number;
/**
* The email address of the individual to whom the invite was sent
*/
email: string;
/**
* The object type, which is always `organization.invite`
*/
object: 'organization.invite';
/**
* The projects that were granted membership upon acceptance of the invite.
*/
projects: Array<Invite.Project>;
/**
* `owner` or `reader`
*/
role: 'owner' | 'reader';
/**
* `accepted`,`expired`, or `pending`
*/
status: 'accepted' | 'expired' | 'pending';
/**
* The Unix timestamp (in seconds) of when the invite was accepted.
*/
accepted_at?: number | null;
/**
* The Unix timestamp (in seconds) of when the invite expires.
*/
expires_at?: number | null;
}
export declare namespace Invite {
interface Project {
/**
* Project's public ID
*/
id: string;
/**
* Project membership role
*/
role: 'member' | 'owner';
}
}
export interface InviteDeleteResponse {
id: string;
deleted: boolean;
/**
* The object type, which is always `organization.invite.deleted`
*/
object: 'organization.invite.deleted';
}
export interface InviteCreateParams {
/**
* Send an email to this address
*/
email: string;
/**
* `owner` or `reader`
*/
role: 'reader' | 'owner';
/**
* An array of projects to which membership is granted at the same time the org
* invite is accepted. If omitted, the user will be invited to the default project
* for compatibility with legacy behavior. If empty list is passed, the user will
* not be invited to any projects, including the default one.
*/
projects?: Array<InviteCreateParams.Project>;
}
export declare namespace InviteCreateParams {
interface Project {
/**
* Project's public ID
*/
id: string;
/**
* Project membership role
*/
role: 'member' | 'owner';
}
}
export interface InviteListParams extends ConversationCursorPageParams {
}
export declare namespace Invites {
export { type Invite as Invite, type InviteDeleteResponse as InviteDeleteResponse, type InvitesPage as InvitesPage, type InviteCreateParams as InviteCreateParams, type InviteListParams as InviteListParams, };
}
//# sourceMappingURL=invites.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"invites.d.mts","sourceRoot":"","sources":["../../../src/resources/admin/organization/invites.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,WAAW,EACZ,qCAAiC;AAClC,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE,qBAAa,OAAQ,SA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EX;;WAEG;QACH,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;KAC1B;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,6BAA6B,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IAEzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;CAC9C;AAED,yBAAiB,kBAAkB,CAAC;IAClC,UAAiB,OAAO;QACtB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;KAC1B;CACF;AAED,MAAM,WAAW,gBAAiB,SAAQ,4BAA4B;CAAG;AAEzE,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
+153
View File
@@ -0,0 +1,153 @@
import { APIResource } from "../../../core/resource.js";
import { APIPromise } from "../../../core/api-promise.js";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class Invites extends APIResource {
/**
* Create an invite for a user to the organization. The invite must be accepted by
* the user before they have access to the organization.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.create({
* email: 'email',
* role: 'reader',
* });
* ```
*/
create(body: InviteCreateParams, options?: RequestOptions): APIPromise<Invite>;
/**
* Retrieves an invite.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.retrieve(
* 'invite_id',
* );
* ```
*/
retrieve(inviteID: string, options?: RequestOptions): APIPromise<Invite>;
/**
* Returns a list of invites in the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const invite of client.admin.organization.invites.list()) {
* // ...
* }
* ```
*/
list(query?: InviteListParams | null | undefined, options?: RequestOptions): PagePromise<InvitesPage, Invite>;
/**
* Delete an invite. If the invite has already been accepted, it cannot be deleted.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.delete(
* 'invite_id',
* );
* ```
*/
delete(inviteID: string, options?: RequestOptions): APIPromise<InviteDeleteResponse>;
}
export type InvitesPage = ConversationCursorPage<Invite>;
/**
* Represents an individual `invite` to the organization.
*/
export interface Invite {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the invite was sent.
*/
created_at: number;
/**
* The email address of the individual to whom the invite was sent
*/
email: string;
/**
* The object type, which is always `organization.invite`
*/
object: 'organization.invite';
/**
* The projects that were granted membership upon acceptance of the invite.
*/
projects: Array<Invite.Project>;
/**
* `owner` or `reader`
*/
role: 'owner' | 'reader';
/**
* `accepted`,`expired`, or `pending`
*/
status: 'accepted' | 'expired' | 'pending';
/**
* The Unix timestamp (in seconds) of when the invite was accepted.
*/
accepted_at?: number | null;
/**
* The Unix timestamp (in seconds) of when the invite expires.
*/
expires_at?: number | null;
}
export declare namespace Invite {
interface Project {
/**
* Project's public ID
*/
id: string;
/**
* Project membership role
*/
role: 'member' | 'owner';
}
}
export interface InviteDeleteResponse {
id: string;
deleted: boolean;
/**
* The object type, which is always `organization.invite.deleted`
*/
object: 'organization.invite.deleted';
}
export interface InviteCreateParams {
/**
* Send an email to this address
*/
email: string;
/**
* `owner` or `reader`
*/
role: 'reader' | 'owner';
/**
* An array of projects to which membership is granted at the same time the org
* invite is accepted. If omitted, the user will be invited to the default project
* for compatibility with legacy behavior. If empty list is passed, the user will
* not be invited to any projects, including the default one.
*/
projects?: Array<InviteCreateParams.Project>;
}
export declare namespace InviteCreateParams {
interface Project {
/**
* Project's public ID
*/
id: string;
/**
* Project membership role
*/
role: 'member' | 'owner';
}
}
export interface InviteListParams extends ConversationCursorPageParams {
}
export declare namespace Invites {
export { type Invite as Invite, type InviteDeleteResponse as InviteDeleteResponse, type InvitesPage as InvitesPage, type InviteCreateParams as InviteCreateParams, type InviteListParams as InviteListParams, };
}
//# sourceMappingURL=invites.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"invites.d.ts","sourceRoot":"","sources":["../../../src/resources/admin/organization/invites.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,WAAW,EACZ,oCAAiC;AAClC,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAQ9E;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAOxE;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC;IAQnC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAMrF;AAED,MAAM,MAAM,WAAW,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,WA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M,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
+83
View File
@@ -0,0 +1,83 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Invites = void 0;
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const path_1 = require("../../../internal/utils/path.js");
class Invites extends resource_1.APIResource {
/**
* Create an invite for a user to the organization. The invite must be accepted by
* the user before they have access to the organization.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.create({
* email: 'email',
* role: 'reader',
* });
* ```
*/
create(body, options) {
return this._client.post('/organization/invites', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves an invite.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.retrieve(
* 'invite_id',
* );
* ```
*/
retrieve(inviteID, options) {
return this._client.get((0, path_1.path) `/organization/invites/${inviteID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Returns a list of invites in the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const invite of client.admin.organization.invites.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/invites', (pagination_1.ConversationCursorPage), {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Delete an invite. If the invite has already been accepted, it cannot be deleted.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.delete(
* 'invite_id',
* );
* ```
*/
delete(inviteID, options) {
return this._client.delete((0, path_1.path) `/organization/invites/${inviteID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.Invites = Invites;
//# sourceMappingURL=invites.js.map
@@ -0,0 +1 @@
{"version":3,"file":"invites.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/invites.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAIkC;AAElC,0DAAoD;AAEpD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE;YAChD,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,yBAAyB,QAAQ,EAAE,EAAE;YAC/D,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAA,mCAA8B,CAAA,EAAE;YACtF,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,yBAAyB,QAAQ,EAAE,EAAE;YAClE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AA/ED,0BA+EC"}
+79
View File
@@ -0,0 +1,79 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { ConversationCursorPage, } from "../../../core/pagination.mjs";
import { path } from "../../../internal/utils/path.mjs";
export class Invites extends APIResource {
/**
* Create an invite for a user to the organization. The invite must be accepted by
* the user before they have access to the organization.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.create({
* email: 'email',
* role: 'reader',
* });
* ```
*/
create(body, options) {
return this._client.post('/organization/invites', {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves an invite.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.retrieve(
* 'invite_id',
* );
* ```
*/
retrieve(inviteID, options) {
return this._client.get(path `/organization/invites/${inviteID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Returns a list of invites in the organization.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const invite of client.admin.organization.invites.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/organization/invites', (ConversationCursorPage), {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Delete an invite. If the invite has already been accepted, it cannot be deleted.
*
* @example
* ```ts
* const invite =
* await client.admin.organization.invites.delete(
* 'invite_id',
* );
* ```
*/
delete(inviteID, options) {
return this._client.delete(path `/organization/invites/${inviteID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=invites.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"invites.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/invites.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,EACL,sBAAsB,GAGvB,qCAAiC;AAElC,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE;YAChD,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,QAAQ,EAAE,EAAE;YAC/D,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAA,sBAA8B,CAAA,EAAE;YACtF,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,yBAAyB,QAAQ,EAAE,EAAE;YAClE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,50 @@
import { APIResource } from "../../../core/resource.mjs";
import * as AdminAPIKeysAPI from "./admin-api-keys.mjs";
import { AdminAPIKey, AdminAPIKeyCreateParams, AdminAPIKeyCreateResponse, AdminAPIKeyDeleteResponse, AdminAPIKeyListParams, AdminAPIKeys, AdminAPIKeysPage } from "./admin-api-keys.mjs";
import * as AuditLogsAPI from "./audit-logs.mjs";
import { AuditLogListParams, AuditLogListResponse, AuditLogListResponsesPage, AuditLogs } from "./audit-logs.mjs";
import * as CertificatesAPI from "./certificates.mjs";
import { Certificate, CertificateActivateParams, CertificateActivateResponse, CertificateActivateResponsesPage, CertificateCreateParams, CertificateDeactivateParams, CertificateDeactivateResponse, CertificateDeactivateResponsesPage, CertificateDeleteResponse, CertificateListParams, CertificateListResponse, CertificateListResponsesPage, CertificateRetrieveParams, CertificateUpdateParams, Certificates } from "./certificates.mjs";
import * as DataRetentionAPI from "./data-retention.mjs";
import { DataRetention, DataRetentionUpdateParams, OrganizationDataRetention } from "./data-retention.mjs";
import * as InvitesAPI from "./invites.mjs";
import { Invite, InviteCreateParams, InviteDeleteResponse, InviteListParams, Invites, InvitesPage } from "./invites.mjs";
import * as RolesAPI from "./roles.mjs";
import { Role, RoleCreateParams, RoleDeleteResponse, RoleListParams, RoleUpdateParams, Roles, RolesPage } from "./roles.mjs";
import * as SpendAlertsAPI from "./spend-alerts.mjs";
import { OrganizationSpendAlert, OrganizationSpendAlertDeleted, OrganizationSpendAlertsPage, SpendAlertCreateParams, SpendAlertListParams, SpendAlertUpdateParams, SpendAlerts } from "./spend-alerts.mjs";
import * as UsageAPI from "./usage.mjs";
import { Usage, UsageAudioSpeechesParams, UsageAudioSpeechesResponse, UsageAudioTranscriptionsParams, UsageAudioTranscriptionsResponse, UsageCodeInterpreterSessionsParams, UsageCodeInterpreterSessionsResponse, UsageCompletionsParams, UsageCompletionsResponse, UsageCostsParams, UsageCostsResponse, UsageEmbeddingsParams, UsageEmbeddingsResponse, UsageFileSearchCallsParams, UsageFileSearchCallsResponse, UsageImagesParams, UsageImagesResponse, UsageModerationsParams, UsageModerationsResponse, UsageVectorStoresParams, UsageVectorStoresResponse, UsageWebSearchCallsParams, UsageWebSearchCallsResponse } from "./usage.mjs";
import * as GroupsAPI from "./groups/groups.mjs";
import { Group, GroupCreateParams, GroupDeleteResponse, GroupListParams, GroupUpdateParams, GroupUpdateResponse, Groups, GroupsPage } from "./groups/groups.mjs";
import * as ProjectsAPI from "./projects/projects.mjs";
import { Project, ProjectCreateParams, ProjectListParams, ProjectUpdateParams, Projects, ProjectsPage } from "./projects/projects.mjs";
import * as UsersAPI from "./users/users.mjs";
import { OrganizationUser, OrganizationUsersPage, UserDeleteResponse, UserListParams, UserUpdateParams, Users } from "./users/users.mjs";
export declare class Organization extends APIResource {
auditLogs: AuditLogsAPI.AuditLogs;
adminAPIKeys: AdminAPIKeysAPI.AdminAPIKeys;
usage: UsageAPI.Usage;
invites: InvitesAPI.Invites;
users: UsersAPI.Users;
groups: GroupsAPI.Groups;
roles: RolesAPI.Roles;
dataRetention: DataRetentionAPI.DataRetention;
spendAlerts: SpendAlertsAPI.SpendAlerts;
certificates: CertificatesAPI.Certificates;
projects: ProjectsAPI.Projects;
}
export declare namespace Organization {
export { AuditLogs as AuditLogs, type AuditLogListResponse as AuditLogListResponse, type AuditLogListResponsesPage as AuditLogListResponsesPage, type AuditLogListParams as AuditLogListParams, };
export { AdminAPIKeys as AdminAPIKeys, type AdminAPIKey as AdminAPIKey, type AdminAPIKeyCreateResponse as AdminAPIKeyCreateResponse, type AdminAPIKeyDeleteResponse as AdminAPIKeyDeleteResponse, type AdminAPIKeysPage as AdminAPIKeysPage, type AdminAPIKeyCreateParams as AdminAPIKeyCreateParams, type AdminAPIKeyListParams as AdminAPIKeyListParams, };
export { Usage as Usage, type UsageAudioSpeechesResponse as UsageAudioSpeechesResponse, type UsageAudioTranscriptionsResponse as UsageAudioTranscriptionsResponse, type UsageCodeInterpreterSessionsResponse as UsageCodeInterpreterSessionsResponse, type UsageCompletionsResponse as UsageCompletionsResponse, type UsageCostsResponse as UsageCostsResponse, type UsageEmbeddingsResponse as UsageEmbeddingsResponse, type UsageFileSearchCallsResponse as UsageFileSearchCallsResponse, type UsageImagesResponse as UsageImagesResponse, type UsageModerationsResponse as UsageModerationsResponse, type UsageVectorStoresResponse as UsageVectorStoresResponse, type UsageWebSearchCallsResponse as UsageWebSearchCallsResponse, type UsageAudioSpeechesParams as UsageAudioSpeechesParams, type UsageAudioTranscriptionsParams as UsageAudioTranscriptionsParams, type UsageCodeInterpreterSessionsParams as UsageCodeInterpreterSessionsParams, type UsageCompletionsParams as UsageCompletionsParams, type UsageCostsParams as UsageCostsParams, type UsageEmbeddingsParams as UsageEmbeddingsParams, type UsageFileSearchCallsParams as UsageFileSearchCallsParams, type UsageImagesParams as UsageImagesParams, type UsageModerationsParams as UsageModerationsParams, type UsageVectorStoresParams as UsageVectorStoresParams, type UsageWebSearchCallsParams as UsageWebSearchCallsParams, };
export { Invites as Invites, type Invite as Invite, type InviteDeleteResponse as InviteDeleteResponse, type InvitesPage as InvitesPage, type InviteCreateParams as InviteCreateParams, type InviteListParams as InviteListParams, };
export { Users as Users, type OrganizationUser as OrganizationUser, type UserDeleteResponse as UserDeleteResponse, type OrganizationUsersPage as OrganizationUsersPage, type UserUpdateParams as UserUpdateParams, type UserListParams as UserListParams, };
export { Groups as Groups, type Group as Group, type GroupUpdateResponse as GroupUpdateResponse, type GroupDeleteResponse as GroupDeleteResponse, type GroupsPage as GroupsPage, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, type GroupListParams as GroupListParams, };
export { Roles as Roles, type Role as Role, type RoleDeleteResponse as RoleDeleteResponse, type RolesPage as RolesPage, type RoleCreateParams as RoleCreateParams, type RoleUpdateParams as RoleUpdateParams, type RoleListParams as RoleListParams, };
export { DataRetention as DataRetention, type OrganizationDataRetention as OrganizationDataRetention, type DataRetentionUpdateParams as DataRetentionUpdateParams, };
export { SpendAlerts as SpendAlerts, type OrganizationSpendAlert as OrganizationSpendAlert, type OrganizationSpendAlertDeleted as OrganizationSpendAlertDeleted, type OrganizationSpendAlertsPage as OrganizationSpendAlertsPage, type SpendAlertCreateParams as SpendAlertCreateParams, type SpendAlertUpdateParams as SpendAlertUpdateParams, type SpendAlertListParams as SpendAlertListParams, };
export { Certificates as Certificates, type Certificate as Certificate, type CertificateListResponse as CertificateListResponse, type CertificateDeleteResponse as CertificateDeleteResponse, type CertificateActivateResponse as CertificateActivateResponse, type CertificateDeactivateResponse as CertificateDeactivateResponse, type CertificateListResponsesPage as CertificateListResponsesPage, type CertificateActivateResponsesPage as CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage as CertificateDeactivateResponsesPage, type CertificateCreateParams as CertificateCreateParams, type CertificateRetrieveParams as CertificateRetrieveParams, type CertificateUpdateParams as CertificateUpdateParams, type CertificateListParams as CertificateListParams, type CertificateActivateParams as CertificateActivateParams, type CertificateDeactivateParams as CertificateDeactivateParams, };
export { Projects as Projects, type Project as Project, type ProjectsPage as ProjectsPage, type ProjectCreateParams as ProjectCreateParams, type ProjectUpdateParams as ProjectUpdateParams, type ProjectListParams as ProjectListParams, };
}
//# sourceMappingURL=organization.d.mts.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,50 @@
import { APIResource } from "../../../core/resource.js";
import * as AdminAPIKeysAPI from "./admin-api-keys.js";
import { AdminAPIKey, AdminAPIKeyCreateParams, AdminAPIKeyCreateResponse, AdminAPIKeyDeleteResponse, AdminAPIKeyListParams, AdminAPIKeys, AdminAPIKeysPage } from "./admin-api-keys.js";
import * as AuditLogsAPI from "./audit-logs.js";
import { AuditLogListParams, AuditLogListResponse, AuditLogListResponsesPage, AuditLogs } from "./audit-logs.js";
import * as CertificatesAPI from "./certificates.js";
import { Certificate, CertificateActivateParams, CertificateActivateResponse, CertificateActivateResponsesPage, CertificateCreateParams, CertificateDeactivateParams, CertificateDeactivateResponse, CertificateDeactivateResponsesPage, CertificateDeleteResponse, CertificateListParams, CertificateListResponse, CertificateListResponsesPage, CertificateRetrieveParams, CertificateUpdateParams, Certificates } from "./certificates.js";
import * as DataRetentionAPI from "./data-retention.js";
import { DataRetention, DataRetentionUpdateParams, OrganizationDataRetention } from "./data-retention.js";
import * as InvitesAPI from "./invites.js";
import { Invite, InviteCreateParams, InviteDeleteResponse, InviteListParams, Invites, InvitesPage } from "./invites.js";
import * as RolesAPI from "./roles.js";
import { Role, RoleCreateParams, RoleDeleteResponse, RoleListParams, RoleUpdateParams, Roles, RolesPage } from "./roles.js";
import * as SpendAlertsAPI from "./spend-alerts.js";
import { OrganizationSpendAlert, OrganizationSpendAlertDeleted, OrganizationSpendAlertsPage, SpendAlertCreateParams, SpendAlertListParams, SpendAlertUpdateParams, SpendAlerts } from "./spend-alerts.js";
import * as UsageAPI from "./usage.js";
import { Usage, UsageAudioSpeechesParams, UsageAudioSpeechesResponse, UsageAudioTranscriptionsParams, UsageAudioTranscriptionsResponse, UsageCodeInterpreterSessionsParams, UsageCodeInterpreterSessionsResponse, UsageCompletionsParams, UsageCompletionsResponse, UsageCostsParams, UsageCostsResponse, UsageEmbeddingsParams, UsageEmbeddingsResponse, UsageFileSearchCallsParams, UsageFileSearchCallsResponse, UsageImagesParams, UsageImagesResponse, UsageModerationsParams, UsageModerationsResponse, UsageVectorStoresParams, UsageVectorStoresResponse, UsageWebSearchCallsParams, UsageWebSearchCallsResponse } from "./usage.js";
import * as GroupsAPI from "./groups/groups.js";
import { Group, GroupCreateParams, GroupDeleteResponse, GroupListParams, GroupUpdateParams, GroupUpdateResponse, Groups, GroupsPage } from "./groups/groups.js";
import * as ProjectsAPI from "./projects/projects.js";
import { Project, ProjectCreateParams, ProjectListParams, ProjectUpdateParams, Projects, ProjectsPage } from "./projects/projects.js";
import * as UsersAPI from "./users/users.js";
import { OrganizationUser, OrganizationUsersPage, UserDeleteResponse, UserListParams, UserUpdateParams, Users } from "./users/users.js";
export declare class Organization extends APIResource {
auditLogs: AuditLogsAPI.AuditLogs;
adminAPIKeys: AdminAPIKeysAPI.AdminAPIKeys;
usage: UsageAPI.Usage;
invites: InvitesAPI.Invites;
users: UsersAPI.Users;
groups: GroupsAPI.Groups;
roles: RolesAPI.Roles;
dataRetention: DataRetentionAPI.DataRetention;
spendAlerts: SpendAlertsAPI.SpendAlerts;
certificates: CertificatesAPI.Certificates;
projects: ProjectsAPI.Projects;
}
export declare namespace Organization {
export { AuditLogs as AuditLogs, type AuditLogListResponse as AuditLogListResponse, type AuditLogListResponsesPage as AuditLogListResponsesPage, type AuditLogListParams as AuditLogListParams, };
export { AdminAPIKeys as AdminAPIKeys, type AdminAPIKey as AdminAPIKey, type AdminAPIKeyCreateResponse as AdminAPIKeyCreateResponse, type AdminAPIKeyDeleteResponse as AdminAPIKeyDeleteResponse, type AdminAPIKeysPage as AdminAPIKeysPage, type AdminAPIKeyCreateParams as AdminAPIKeyCreateParams, type AdminAPIKeyListParams as AdminAPIKeyListParams, };
export { Usage as Usage, type UsageAudioSpeechesResponse as UsageAudioSpeechesResponse, type UsageAudioTranscriptionsResponse as UsageAudioTranscriptionsResponse, type UsageCodeInterpreterSessionsResponse as UsageCodeInterpreterSessionsResponse, type UsageCompletionsResponse as UsageCompletionsResponse, type UsageCostsResponse as UsageCostsResponse, type UsageEmbeddingsResponse as UsageEmbeddingsResponse, type UsageFileSearchCallsResponse as UsageFileSearchCallsResponse, type UsageImagesResponse as UsageImagesResponse, type UsageModerationsResponse as UsageModerationsResponse, type UsageVectorStoresResponse as UsageVectorStoresResponse, type UsageWebSearchCallsResponse as UsageWebSearchCallsResponse, type UsageAudioSpeechesParams as UsageAudioSpeechesParams, type UsageAudioTranscriptionsParams as UsageAudioTranscriptionsParams, type UsageCodeInterpreterSessionsParams as UsageCodeInterpreterSessionsParams, type UsageCompletionsParams as UsageCompletionsParams, type UsageCostsParams as UsageCostsParams, type UsageEmbeddingsParams as UsageEmbeddingsParams, type UsageFileSearchCallsParams as UsageFileSearchCallsParams, type UsageImagesParams as UsageImagesParams, type UsageModerationsParams as UsageModerationsParams, type UsageVectorStoresParams as UsageVectorStoresParams, type UsageWebSearchCallsParams as UsageWebSearchCallsParams, };
export { Invites as Invites, type Invite as Invite, type InviteDeleteResponse as InviteDeleteResponse, type InvitesPage as InvitesPage, type InviteCreateParams as InviteCreateParams, type InviteListParams as InviteListParams, };
export { Users as Users, type OrganizationUser as OrganizationUser, type UserDeleteResponse as UserDeleteResponse, type OrganizationUsersPage as OrganizationUsersPage, type UserUpdateParams as UserUpdateParams, type UserListParams as UserListParams, };
export { Groups as Groups, type Group as Group, type GroupUpdateResponse as GroupUpdateResponse, type GroupDeleteResponse as GroupDeleteResponse, type GroupsPage as GroupsPage, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, type GroupListParams as GroupListParams, };
export { Roles as Roles, type Role as Role, type RoleDeleteResponse as RoleDeleteResponse, type RolesPage as RolesPage, type RoleCreateParams as RoleCreateParams, type RoleUpdateParams as RoleUpdateParams, type RoleListParams as RoleListParams, };
export { DataRetention as DataRetention, type OrganizationDataRetention as OrganizationDataRetention, type DataRetentionUpdateParams as DataRetentionUpdateParams, };
export { SpendAlerts as SpendAlerts, type OrganizationSpendAlert as OrganizationSpendAlert, type OrganizationSpendAlertDeleted as OrganizationSpendAlertDeleted, type OrganizationSpendAlertsPage as OrganizationSpendAlertsPage, type SpendAlertCreateParams as SpendAlertCreateParams, type SpendAlertUpdateParams as SpendAlertUpdateParams, type SpendAlertListParams as SpendAlertListParams, };
export { Certificates as Certificates, type Certificate as Certificate, type CertificateListResponse as CertificateListResponse, type CertificateDeleteResponse as CertificateDeleteResponse, type CertificateActivateResponse as CertificateActivateResponse, type CertificateDeactivateResponse as CertificateDeactivateResponse, type CertificateListResponsesPage as CertificateListResponsesPage, type CertificateActivateResponsesPage as CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage as CertificateDeactivateResponsesPage, type CertificateCreateParams as CertificateCreateParams, type CertificateRetrieveParams as CertificateRetrieveParams, type CertificateUpdateParams as CertificateUpdateParams, type CertificateListParams as CertificateListParams, type CertificateActivateParams as CertificateActivateParams, type CertificateDeactivateParams as CertificateDeactivateParams, };
export { Projects as Projects, type Project as Project, type ProjectsPage as ProjectsPage, type ProjectCreateParams as ProjectCreateParams, type ProjectUpdateParams as ProjectUpdateParams, type ProjectListParams as ProjectListParams, };
}
//# sourceMappingURL=organization.d.ts.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,57 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Organization = void 0;
const tslib_1 = require("../../../internal/tslib.js");
const resource_1 = require("../../../core/resource.js");
const AdminAPIKeysAPI = tslib_1.__importStar(require("./admin-api-keys.js"));
const admin_api_keys_1 = require("./admin-api-keys.js");
const AuditLogsAPI = tslib_1.__importStar(require("./audit-logs.js"));
const audit_logs_1 = require("./audit-logs.js");
const CertificatesAPI = tslib_1.__importStar(require("./certificates.js"));
const certificates_1 = require("./certificates.js");
const DataRetentionAPI = tslib_1.__importStar(require("./data-retention.js"));
const data_retention_1 = require("./data-retention.js");
const InvitesAPI = tslib_1.__importStar(require("./invites.js"));
const invites_1 = require("./invites.js");
const RolesAPI = tslib_1.__importStar(require("./roles.js"));
const roles_1 = require("./roles.js");
const SpendAlertsAPI = tslib_1.__importStar(require("./spend-alerts.js"));
const spend_alerts_1 = require("./spend-alerts.js");
const UsageAPI = tslib_1.__importStar(require("./usage.js"));
const usage_1 = require("./usage.js");
const GroupsAPI = tslib_1.__importStar(require("./groups/groups.js"));
const groups_1 = require("./groups/groups.js");
const ProjectsAPI = tslib_1.__importStar(require("./projects/projects.js"));
const projects_1 = require("./projects/projects.js");
const UsersAPI = tslib_1.__importStar(require("./users/users.js"));
const users_1 = require("./users/users.js");
class Organization extends resource_1.APIResource {
constructor() {
super(...arguments);
this.auditLogs = new AuditLogsAPI.AuditLogs(this._client);
this.adminAPIKeys = new AdminAPIKeysAPI.AdminAPIKeys(this._client);
this.usage = new UsageAPI.Usage(this._client);
this.invites = new InvitesAPI.Invites(this._client);
this.users = new UsersAPI.Users(this._client);
this.groups = new GroupsAPI.Groups(this._client);
this.roles = new RolesAPI.Roles(this._client);
this.dataRetention = new DataRetentionAPI.DataRetention(this._client);
this.spendAlerts = new SpendAlertsAPI.SpendAlerts(this._client);
this.certificates = new CertificatesAPI.Certificates(this._client);
this.projects = new ProjectsAPI.Projects(this._client);
}
}
exports.Organization = Organization;
Organization.AuditLogs = audit_logs_1.AuditLogs;
Organization.AdminAPIKeys = admin_api_keys_1.AdminAPIKeys;
Organization.Usage = usage_1.Usage;
Organization.Invites = invites_1.Invites;
Organization.Users = users_1.Users;
Organization.Groups = groups_1.Groups;
Organization.Roles = roles_1.Roles;
Organization.DataRetention = data_retention_1.DataRetention;
Organization.SpendAlerts = spend_alerts_1.SpendAlerts;
Organization.Certificates = certificates_1.Certificates;
Organization.Projects = projects_1.Projects;
//# sourceMappingURL=organization.js.map
@@ -0,0 +1 @@
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/organization.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,6EAAoD;AACpD,wDAQ0B;AAC1B,sEAA6C;AAC7C,gDAA8G;AAC9G,2EAAkD;AAClD,oDAgBwB;AACxB,8EAAqD;AACrD,wDAAuG;AACvG,iEAAwC;AACxC,0CAOmB;AACnB,6DAAoC;AACpC,sCAQiB;AACjB,0EAAiD;AACjD,oDAQwB;AACxB,6DAAoC;AACpC,sCAwBiB;AACjB,sEAA6C;AAC7C,+CASyB;AACzB,4EAAmD;AACnD,qDAO6B;AAC7B,mEAA0C;AAC1C,4CAOuB;AAEvB,MAAa,YAAa,SAAQ,sBAAW;IAA7C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;CAAA;AAZD,oCAYC;AAED,YAAY,CAAC,SAAS,GAAG,sBAAS,CAAC;AACnC,YAAY,CAAC,YAAY,GAAG,6BAAY,CAAC;AACzC,YAAY,CAAC,KAAK,GAAG,aAAK,CAAC;AAC3B,YAAY,CAAC,OAAO,GAAG,iBAAO,CAAC;AAC/B,YAAY,CAAC,KAAK,GAAG,aAAK,CAAC;AAC3B,YAAY,CAAC,MAAM,GAAG,eAAM,CAAC;AAC7B,YAAY,CAAC,KAAK,GAAG,aAAK,CAAC;AAC3B,YAAY,CAAC,aAAa,GAAG,8BAAa,CAAC;AAC3C,YAAY,CAAC,WAAW,GAAG,0BAAW,CAAC;AACvC,YAAY,CAAC,YAAY,GAAG,2BAAY,CAAC;AACzC,YAAY,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
@@ -0,0 +1,52 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import * as AdminAPIKeysAPI from "./admin-api-keys.mjs";
import { AdminAPIKeys, } from "./admin-api-keys.mjs";
import * as AuditLogsAPI from "./audit-logs.mjs";
import { AuditLogs } from "./audit-logs.mjs";
import * as CertificatesAPI from "./certificates.mjs";
import { Certificates, } from "./certificates.mjs";
import * as DataRetentionAPI from "./data-retention.mjs";
import { DataRetention } from "./data-retention.mjs";
import * as InvitesAPI from "./invites.mjs";
import { Invites, } from "./invites.mjs";
import * as RolesAPI from "./roles.mjs";
import { Roles, } from "./roles.mjs";
import * as SpendAlertsAPI from "./spend-alerts.mjs";
import { SpendAlerts, } from "./spend-alerts.mjs";
import * as UsageAPI from "./usage.mjs";
import { Usage, } from "./usage.mjs";
import * as GroupsAPI from "./groups/groups.mjs";
import { Groups, } from "./groups/groups.mjs";
import * as ProjectsAPI from "./projects/projects.mjs";
import { Projects, } from "./projects/projects.mjs";
import * as UsersAPI from "./users/users.mjs";
import { Users, } from "./users/users.mjs";
export class Organization extends APIResource {
constructor() {
super(...arguments);
this.auditLogs = new AuditLogsAPI.AuditLogs(this._client);
this.adminAPIKeys = new AdminAPIKeysAPI.AdminAPIKeys(this._client);
this.usage = new UsageAPI.Usage(this._client);
this.invites = new InvitesAPI.Invites(this._client);
this.users = new UsersAPI.Users(this._client);
this.groups = new GroupsAPI.Groups(this._client);
this.roles = new RolesAPI.Roles(this._client);
this.dataRetention = new DataRetentionAPI.DataRetention(this._client);
this.spendAlerts = new SpendAlertsAPI.SpendAlerts(this._client);
this.certificates = new CertificatesAPI.Certificates(this._client);
this.projects = new ProjectsAPI.Projects(this._client);
}
}
Organization.AuditLogs = AuditLogs;
Organization.AdminAPIKeys = AdminAPIKeys;
Organization.Usage = Usage;
Organization.Invites = Invites;
Organization.Users = Users;
Organization.Groups = Groups;
Organization.Roles = Roles;
Organization.DataRetention = DataRetention;
Organization.SpendAlerts = SpendAlerts;
Organization.Certificates = Certificates;
Organization.Projects = Projects;
//# sourceMappingURL=organization.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"organization.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/organization.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,eAAe,6BAAyB;AACpD,OAAO,EAML,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CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;CAAA;AAED,YAAY,CAAC,SAAS,GAAG,SAAS,CAAC;AACnC,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC;AACzC,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC;AAC7B,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,YAAY,CAAC,aAAa,GAAG,aAAa,CAAC;AAC3C,YAAY,CAAC,WAAW,GAAG,WAAW,CAAC;AACvC,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC;AACzC,YAAY,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
export * from "./projects/index.mjs";
//# sourceMappingURL=projects.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"projects.d.mts","sourceRoot":"","sources":["../../../src/resources/admin/organization/projects.ts"],"names":[],"mappings":"AAEA,qCAAiC"}
@@ -0,0 +1,2 @@
export * from "./projects/index.js";
//# sourceMappingURL=projects.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../../src/resources/admin/organization/projects.ts"],"names":[],"mappings":"AAEA,oCAAiC"}
+6
View File
@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../../../internal/tslib.js");
tslib_1.__exportStar(require("./projects/index.js"), exports);
//# sourceMappingURL=projects.js.map
@@ -0,0 +1 @@
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../../src/resources/admin/organization/projects.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./projects/index.mjs";
//# sourceMappingURL=projects.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"projects.mjs","sourceRoot":"","sources":["../../../src/resources/admin/organization/projects.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,qCAAiC"}
@@ -0,0 +1,167 @@
import { APIResource } from "../../../../core/resource.mjs";
import { APIPromise } from "../../../../core/api-promise.mjs";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../../../core/pagination.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class APIKeys extends APIResource {
/**
* Retrieves an API key in the project.
*
* @example
* ```ts
* const projectAPIKey =
* await client.admin.organization.projects.apiKeys.retrieve(
* 'api_key_id',
* { project_id: 'project_id' },
* );
* ```
*/
retrieve(apiKeyID: string, params: APIKeyRetrieveParams, options?: RequestOptions): APIPromise<ProjectAPIKey>;
/**
* Returns a list of API keys in the project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const projectAPIKey of client.admin.organization.projects.apiKeys.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID: string, query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<ProjectAPIKeysPage, ProjectAPIKey>;
/**
* Deletes an API key from the project.
*
* Returns confirmation of the key deletion, or an error if the key belonged to a
* service account.
*
* @example
* ```ts
* const apiKey =
* await client.admin.organization.projects.apiKeys.delete(
* 'api_key_id',
* { project_id: 'project_id' },
* );
* ```
*/
delete(apiKeyID: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<APIKeyDeleteResponse>;
}
export type ProjectAPIKeysPage = ConversationCursorPage<ProjectAPIKey>;
/**
* Represents an individual API key in a project.
*/
export interface ProjectAPIKey {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the API key was created
*/
created_at: number;
/**
* The Unix timestamp (in seconds) of when the API key was last used.
*/
last_used_at: number | null;
/**
* The name of the API key
*/
name: string;
/**
* The object type, which is always `organization.project.api_key`
*/
object: 'organization.project.api_key';
owner: ProjectAPIKey.Owner;
/**
* The redacted value of the API key
*/
redacted_value: string;
}
export declare namespace ProjectAPIKey {
interface Owner {
/**
* The service account that owns a project API key.
*/
service_account?: Owner.ServiceAccount;
/**
* `user` or `service_account`
*/
type?: 'user' | 'service_account';
/**
* The user that owns a project API key.
*/
user?: Owner.User;
}
namespace Owner {
/**
* The service account that owns a project API key.
*/
interface ServiceAccount {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the service account was created.
*/
created_at: number;
/**
* The name of the service account.
*/
name: string;
/**
* The service account's project role.
*/
role: string;
}
/**
* The user that owns a project API key.
*/
interface User {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the user was created.
*/
created_at: number;
/**
* The email address of the user.
*/
email: string;
/**
* The name of the user.
*/
name: string;
/**
* The user's project role.
*/
role: string;
}
}
}
export interface APIKeyDeleteResponse {
id: string;
deleted: boolean;
object: 'organization.project.api_key.deleted';
}
export interface APIKeyRetrieveParams {
/**
* The ID of the project.
*/
project_id: string;
}
export interface APIKeyListParams extends ConversationCursorPageParams {
}
export interface APIKeyDeleteParams {
/**
* The ID of the project.
*/
project_id: string;
}
export declare namespace APIKeys {
export { type ProjectAPIKey as ProjectAPIKey, type APIKeyDeleteResponse as APIKeyDeleteResponse, type ProjectAPIKeysPage as ProjectAPIKeysPage, type APIKeyRetrieveParams as APIKeyRetrieveParams, type APIKeyListParams as APIKeyListParams, type APIKeyDeleteParams as APIKeyDeleteParams, };
}
//# sourceMappingURL=api-keys.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"api-keys.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/api-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,yCAAqC;AAC1D,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,WAAW,EACZ,wCAAoC;AACrC,OAAO,EAAE,cAAc,EAAE,iDAA6C;AAGtE,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,aAAa,CAAC;IAQ5B;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kBAAkB,EAAE,aAAa,CAAC;IAQjD;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;CAOpC;AAED,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH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UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,167 @@
import { APIResource } from "../../../../core/resource.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../../../core/pagination.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class APIKeys extends APIResource {
/**
* Retrieves an API key in the project.
*
* @example
* ```ts
* const projectAPIKey =
* await client.admin.organization.projects.apiKeys.retrieve(
* 'api_key_id',
* { project_id: 'project_id' },
* );
* ```
*/
retrieve(apiKeyID: string, params: APIKeyRetrieveParams, options?: RequestOptions): APIPromise<ProjectAPIKey>;
/**
* Returns a list of API keys in the project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const projectAPIKey of client.admin.organization.projects.apiKeys.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID: string, query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<ProjectAPIKeysPage, ProjectAPIKey>;
/**
* Deletes an API key from the project.
*
* Returns confirmation of the key deletion, or an error if the key belonged to a
* service account.
*
* @example
* ```ts
* const apiKey =
* await client.admin.organization.projects.apiKeys.delete(
* 'api_key_id',
* { project_id: 'project_id' },
* );
* ```
*/
delete(apiKeyID: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<APIKeyDeleteResponse>;
}
export type ProjectAPIKeysPage = ConversationCursorPage<ProjectAPIKey>;
/**
* Represents an individual API key in a project.
*/
export interface ProjectAPIKey {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the API key was created
*/
created_at: number;
/**
* The Unix timestamp (in seconds) of when the API key was last used.
*/
last_used_at: number | null;
/**
* The name of the API key
*/
name: string;
/**
* The object type, which is always `organization.project.api_key`
*/
object: 'organization.project.api_key';
owner: ProjectAPIKey.Owner;
/**
* The redacted value of the API key
*/
redacted_value: string;
}
export declare namespace ProjectAPIKey {
interface Owner {
/**
* The service account that owns a project API key.
*/
service_account?: Owner.ServiceAccount;
/**
* `user` or `service_account`
*/
type?: 'user' | 'service_account';
/**
* The user that owns a project API key.
*/
user?: Owner.User;
}
namespace Owner {
/**
* The service account that owns a project API key.
*/
interface ServiceAccount {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the service account was created.
*/
created_at: number;
/**
* The name of the service account.
*/
name: string;
/**
* The service account's project role.
*/
role: string;
}
/**
* The user that owns a project API key.
*/
interface User {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* The Unix timestamp (in seconds) of when the user was created.
*/
created_at: number;
/**
* The email address of the user.
*/
email: string;
/**
* The name of the user.
*/
name: string;
/**
* The user's project role.
*/
role: string;
}
}
}
export interface APIKeyDeleteResponse {
id: string;
deleted: boolean;
object: 'organization.project.api_key.deleted';
}
export interface APIKeyRetrieveParams {
/**
* The ID of the project.
*/
project_id: string;
}
export interface APIKeyListParams extends ConversationCursorPageParams {
}
export interface APIKeyDeleteParams {
/**
* The ID of the project.
*/
project_id: string;
}
export declare namespace APIKeys {
export { type ProjectAPIKey as ProjectAPIKey, type APIKeyDeleteResponse as APIKeyDeleteResponse, type ProjectAPIKeysPage as ProjectAPIKeysPage, type APIKeyRetrieveParams as APIKeyRetrieveParams, type APIKeyListParams as APIKeyListParams, type APIKeyDeleteParams as APIKeyDeleteParams, };
}
//# sourceMappingURL=api-keys.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/api-keys.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GAC9C,CAAC;CACH"}
@@ -0,0 +1,68 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.APIKeys = void 0;
const resource_1 = require("../../../../core/resource.js");
const pagination_1 = require("../../../../core/pagination.js");
const path_1 = require("../../../../internal/utils/path.js");
class APIKeys extends resource_1.APIResource {
/**
* Retrieves an API key in the project.
*
* @example
* ```ts
* const projectAPIKey =
* await client.admin.organization.projects.apiKeys.retrieve(
* 'api_key_id',
* { project_id: 'project_id' },
* );
* ```
*/
retrieve(apiKeyID, params, options) {
const { project_id } = params;
return this._client.get((0, path_1.path) `/organization/projects/${project_id}/api_keys/${apiKeyID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Returns a list of API keys in the project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const projectAPIKey of client.admin.organization.projects.apiKeys.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID, query = {}, options) {
return this._client.getAPIList((0, path_1.path) `/organization/projects/${projectID}/api_keys`, (pagination_1.ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Deletes an API key from the project.
*
* Returns confirmation of the key deletion, or an error if the key belonged to a
* service account.
*
* @example
* ```ts
* const apiKey =
* await client.admin.organization.projects.apiKeys.delete(
* 'api_key_id',
* { project_id: 'project_id' },
* );
* ```
*/
delete(apiKeyID, params, options) {
const { project_id } = params;
return this._client.delete((0, path_1.path) `/organization/projects/${project_id}/api_keys/${apiKeyID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.APIKeys = APIKeys;
//# sourceMappingURL=api-keys.js.map
@@ -0,0 +1 @@
{"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/api-keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAwD;AAExD,+DAIqC;AAErC,6DAAuD;AAEvD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,QAAgB,EAChB,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,UAAU,aAAa,QAAQ,EAAE,EAAE;YACvF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,0BAA0B,SAAS,WAAW,EAClD,CAAA,mCAAqC,CAAA,EACrC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,QAAgB,EAChB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,0BAA0B,UAAU,aAAa,QAAQ,EAAE,EAAE;YAC1F,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AA5ED,0BA4EC"}
@@ -0,0 +1,64 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { ConversationCursorPage, } from "../../../../core/pagination.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export class APIKeys extends APIResource {
/**
* Retrieves an API key in the project.
*
* @example
* ```ts
* const projectAPIKey =
* await client.admin.organization.projects.apiKeys.retrieve(
* 'api_key_id',
* { project_id: 'project_id' },
* );
* ```
*/
retrieve(apiKeyID, params, options) {
const { project_id } = params;
return this._client.get(path `/organization/projects/${project_id}/api_keys/${apiKeyID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Returns a list of API keys in the project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const projectAPIKey of client.admin.organization.projects.apiKeys.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID, query = {}, options) {
return this._client.getAPIList(path `/organization/projects/${projectID}/api_keys`, (ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Deletes an API key from the project.
*
* Returns confirmation of the key deletion, or an error if the key belonged to a
* service account.
*
* @example
* ```ts
* const apiKey =
* await client.admin.organization.projects.apiKeys.delete(
* 'api_key_id',
* { project_id: 'project_id' },
* );
* ```
*/
delete(apiKeyID, params, options) {
const { project_id } = params;
return this._client.delete(path `/organization/projects/${project_id}/api_keys/${apiKeyID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=api-keys.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"api-keys.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/api-keys.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAExD,OAAO,EACL,sBAAsB,GAGvB,wCAAoC;AAErC,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,QAAgB,EAChB,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,UAAU,aAAa,QAAQ,EAAE,EAAE;YACvF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,0BAA0B,SAAS,WAAW,EAClD,CAAA,sBAAqC,CAAA,EACrC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,QAAgB,EAChB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,0BAA0B,UAAU,aAAa,QAAQ,EAAE,EAAE;YAC1F,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,186 @@
import { APIResource } from "../../../../core/resource.mjs";
import { ConversationCursorPage, type ConversationCursorPageParams, Page, PagePromise } from "../../../../core/pagination.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class Certificates extends APIResource {
/**
* List certificates for this project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateListResponse of client.admin.organization.projects.certificates.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID: string, query?: CertificateListParams | null | undefined, options?: RequestOptions): PagePromise<CertificateListResponsesPage, CertificateListResponse>;
/**
* Activate certificates at the project level.
*
* You can atomically and idempotently activate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateActivateResponse of client.admin.organization.projects.certificates.activate(
* 'project_id',
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
activate(projectID: string, body: CertificateActivateParams, options?: RequestOptions): PagePromise<CertificateActivateResponsesPage, CertificateActivateResponse>;
/**
* Deactivate certificates at the project level. You can atomically and
* idempotently deactivate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateDeactivateResponse of client.admin.organization.projects.certificates.deactivate(
* 'project_id',
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
deactivate(projectID: string, body: CertificateDeactivateParams, options?: RequestOptions): PagePromise<CertificateDeactivateResponsesPage, CertificateDeactivateResponse>;
}
export type CertificateListResponsesPage = ConversationCursorPage<CertificateListResponse>;
export type CertificateActivateResponsesPage = Page<CertificateActivateResponse>;
export type CertificateDeactivateResponsesPage = Page<CertificateDeactivateResponse>;
/**
* Represents an individual certificate configured at the project level.
*/
export interface CertificateListResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the project level.
*/
active: boolean;
certificate_details: CertificateListResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.project.certificate`.
*/
object: 'organization.project.certificate';
}
export declare namespace CertificateListResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
/**
* Represents an individual certificate configured at the project level.
*/
export interface CertificateActivateResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the project level.
*/
active: boolean;
certificate_details: CertificateActivateResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.project.certificate`.
*/
object: 'organization.project.certificate';
}
export declare namespace CertificateActivateResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
/**
* Represents an individual certificate configured at the project level.
*/
export interface CertificateDeactivateResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the project level.
*/
active: boolean;
certificate_details: CertificateDeactivateResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.project.certificate`.
*/
object: 'organization.project.certificate';
}
export declare namespace CertificateDeactivateResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
export interface CertificateListParams extends ConversationCursorPageParams {
/**
* Sort order by the `created_at` timestamp of the objects. `asc` for ascending
* order and `desc` for descending order.
*/
order?: 'asc' | 'desc';
}
export interface CertificateActivateParams {
certificate_ids: Array<string>;
}
export interface CertificateDeactivateParams {
certificate_ids: Array<string>;
}
export declare namespace Certificates {
export { type CertificateListResponse as CertificateListResponse, type CertificateActivateResponse as CertificateActivateResponse, type CertificateDeactivateResponse as CertificateDeactivateResponse, type CertificateListResponsesPage as CertificateListResponsesPage, type CertificateActivateResponsesPage as CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage as CertificateDeactivateResponsesPage, type CertificateListParams as CertificateListParams, type CertificateActivateParams as CertificateActivateParams, type CertificateDeactivateParams as CertificateDeactivateParams, };
}
//# sourceMappingURL=certificates.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"certificates.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/certificates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,IAAI,EACJ,WAAW,EACZ,wCAAoC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AA2B;IAC1C,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
@@ -0,0 +1,186 @@
import { APIResource } from "../../../../core/resource.js";
import { ConversationCursorPage, type ConversationCursorPageParams, Page, PagePromise } from "../../../../core/pagination.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class Certificates extends APIResource {
/**
* List certificates for this project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateListResponse of client.admin.organization.projects.certificates.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID: string, query?: CertificateListParams | null | undefined, options?: RequestOptions): PagePromise<CertificateListResponsesPage, CertificateListResponse>;
/**
* Activate certificates at the project level.
*
* You can atomically and idempotently activate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateActivateResponse of client.admin.organization.projects.certificates.activate(
* 'project_id',
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
activate(projectID: string, body: CertificateActivateParams, options?: RequestOptions): PagePromise<CertificateActivateResponsesPage, CertificateActivateResponse>;
/**
* Deactivate certificates at the project level. You can atomically and
* idempotently deactivate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateDeactivateResponse of client.admin.organization.projects.certificates.deactivate(
* 'project_id',
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
deactivate(projectID: string, body: CertificateDeactivateParams, options?: RequestOptions): PagePromise<CertificateDeactivateResponsesPage, CertificateDeactivateResponse>;
}
export type CertificateListResponsesPage = ConversationCursorPage<CertificateListResponse>;
export type CertificateActivateResponsesPage = Page<CertificateActivateResponse>;
export type CertificateDeactivateResponsesPage = Page<CertificateDeactivateResponse>;
/**
* Represents an individual certificate configured at the project level.
*/
export interface CertificateListResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the project level.
*/
active: boolean;
certificate_details: CertificateListResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.project.certificate`.
*/
object: 'organization.project.certificate';
}
export declare namespace CertificateListResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
/**
* Represents an individual certificate configured at the project level.
*/
export interface CertificateActivateResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the project level.
*/
active: boolean;
certificate_details: CertificateActivateResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.project.certificate`.
*/
object: 'organization.project.certificate';
}
export declare namespace CertificateActivateResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
/**
* Represents an individual certificate configured at the project level.
*/
export interface CertificateDeactivateResponse {
/**
* The identifier, which can be referenced in API endpoints
*/
id: string;
/**
* Whether the certificate is currently active at the project level.
*/
active: boolean;
certificate_details: CertificateDeactivateResponse.CertificateDetails;
/**
* The Unix timestamp (in seconds) of when the certificate was uploaded.
*/
created_at: number;
/**
* The name of the certificate.
*/
name: string | null;
/**
* The object type, which is always `organization.project.certificate`.
*/
object: 'organization.project.certificate';
}
export declare namespace CertificateDeactivateResponse {
interface CertificateDetails {
/**
* The Unix timestamp (in seconds) of when the certificate expires.
*/
expires_at?: number;
/**
* The Unix timestamp (in seconds) of when the certificate becomes valid.
*/
valid_at?: number;
}
}
export interface CertificateListParams extends ConversationCursorPageParams {
/**
* Sort order by the `created_at` timestamp of the objects. `asc` for ascending
* order and `desc` for descending order.
*/
order?: 'asc' | 'desc';
}
export interface CertificateActivateParams {
certificate_ids: Array<string>;
}
export interface CertificateDeactivateParams {
certificate_ids: Array<string>;
}
export declare namespace Certificates {
export { type CertificateListResponse as CertificateListResponse, type CertificateActivateResponse as CertificateActivateResponse, type CertificateDeactivateResponse as CertificateDeactivateResponse, type CertificateListResponsesPage as CertificateListResponsesPage, type CertificateActivateResponsesPage as CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage as CertificateDeactivateResponsesPage, type CertificateListParams as CertificateListParams, type CertificateActivateParams as CertificateActivateParams, type CertificateDeactivateParams as CertificateDeactivateParams, };
}
//# sourceMappingURL=certificates.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"certificates.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/certificates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EACL,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,IAAI,EACJ,WAAW,EACZ,uCAAoC;AACrC,OAAO,EAAE,cAAc,EAAE,gDAA6C;AAGtE,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,4BAA4B,EAAE,uBAA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B,EACjE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
@@ -0,0 +1,64 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Certificates = void 0;
const resource_1 = require("../../../../core/resource.js");
const pagination_1 = require("../../../../core/pagination.js");
const path_1 = require("../../../../internal/utils/path.js");
class Certificates extends resource_1.APIResource {
/**
* List certificates for this project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateListResponse of client.admin.organization.projects.certificates.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID, query = {}, options) {
return this._client.getAPIList((0, path_1.path) `/organization/projects/${projectID}/certificates`, (pagination_1.ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Activate certificates at the project level.
*
* You can atomically and idempotently activate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateActivateResponse of client.admin.organization.projects.certificates.activate(
* 'project_id',
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
activate(projectID, body, options) {
return this._client.getAPIList((0, path_1.path) `/organization/projects/${projectID}/certificates/activate`, (pagination_1.Page), { body, method: 'post', ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Deactivate certificates at the project level. You can atomically and
* idempotently deactivate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateDeactivateResponse of client.admin.organization.projects.certificates.deactivate(
* 'project_id',
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
deactivate(projectID, body, options) {
return this._client.getAPIList((0, path_1.path) `/organization/projects/${projectID}/certificates/deactivate`, (pagination_1.Page), { body, method: 'post', ...options, __security: { adminAPIKeyAuth: true } });
}
}
exports.Certificates = Certificates;
//# sourceMappingURL=certificates.js.map
@@ -0,0 +1 @@
{"version":3,"file":"certificates.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/certificates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAwD;AACxD,+DAKqC;AAErC,6DAAuD;AAEvD,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,0BAA0B,SAAS,eAAe,EACtD,CAAA,mCAA+C,CAAA,EAC/C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CACN,SAAiB,EACjB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,0BAA0B,SAAS,wBAAwB,EAC/D,CAAA,iBAAiC,CAAA,EACjC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC5E,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,UAAU,CACR,SAAiB,EACjB,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,0BAA0B,SAAS,0BAA0B,EACjE,CAAA,iBAAmC,CAAA,EACnC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC5E,CAAC;IACJ,CAAC;CACF;AAhFD,oCAgFC"}
@@ -0,0 +1,60 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { ConversationCursorPage, Page, } from "../../../../core/pagination.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export class Certificates extends APIResource {
/**
* List certificates for this project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateListResponse of client.admin.organization.projects.certificates.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID, query = {}, options) {
return this._client.getAPIList(path `/organization/projects/${projectID}/certificates`, (ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Activate certificates at the project level.
*
* You can atomically and idempotently activate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateActivateResponse of client.admin.organization.projects.certificates.activate(
* 'project_id',
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
activate(projectID, body, options) {
return this._client.getAPIList(path `/organization/projects/${projectID}/certificates/activate`, (Page), { body, method: 'post', ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Deactivate certificates at the project level. You can atomically and
* idempotently deactivate up to 10 certificates at a time.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const certificateDeactivateResponse of client.admin.organization.projects.certificates.deactivate(
* 'project_id',
* { certificate_ids: ['cert_abc'] },
* )) {
* // ...
* }
* ```
*/
deactivate(projectID, body, options) {
return this._client.getAPIList(path `/organization/projects/${projectID}/certificates/deactivate`, (Page), { body, method: 'post', ...options, __security: { adminAPIKeyAuth: true } });
}
}
//# sourceMappingURL=certificates.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"certificates.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/certificates.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,EACL,sBAAsB,EAEtB,IAAI,GAEL,wCAAoC;AAErC,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,0BAA0B,SAAS,eAAe,EACtD,CAAA,sBAA+C,CAAA,EAC/C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CACN,SAAiB,EACjB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,0BAA0B,SAAS,wBAAwB,EAC/D,CAAA,IAAiC,CAAA,EACjC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC5E,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,UAAU,CACR,SAAiB,EACjB,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,0BAA0B,SAAS,0BAA0B,EACjE,CAAA,IAAmC,CAAA,EACnC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC5E,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,53 @@
import { APIResource } from "../../../../core/resource.mjs";
import { APIPromise } from "../../../../core/api-promise.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class DataRetention extends APIResource {
/**
* Retrieves project data retention controls.
*
* @example
* ```ts
* const projectDataRetention =
* await client.admin.organization.projects.dataRetention.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID: string, options?: RequestOptions): APIPromise<ProjectDataRetention>;
/**
* Updates project data retention controls.
*
* @example
* ```ts
* const projectDataRetention =
* await client.admin.organization.projects.dataRetention.update(
* 'project_id',
* { retention_type: 'organization_default' },
* );
* ```
*/
update(projectID: string, body: DataRetentionUpdateParams, options?: RequestOptions): APIPromise<ProjectDataRetention>;
}
/**
* Represents a project's data retention control setting.
*/
export interface ProjectDataRetention {
/**
* The object type, which is always `project.data_retention`.
*/
object: 'project.data_retention';
/**
* The configured project data retention type.
*/
type: 'organization_default' | 'none' | 'zero_data_retention' | 'modified_abuse_monitoring' | 'enhanced_zero_data_retention' | 'enhanced_modified_abuse_monitoring';
}
export interface DataRetentionUpdateParams {
/**
* The desired project data retention type.
*/
retention_type: 'organization_default' | 'none' | 'zero_data_retention' | 'modified_abuse_monitoring' | 'enhanced_zero_data_retention' | 'enhanced_modified_abuse_monitoring';
}
export declare namespace DataRetention {
export { type ProjectDataRetention as ProjectDataRetention, type DataRetentionUpdateParams as DataRetentionUpdateParams, };
}
//# sourceMappingURL=data-retention.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"data-retention.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/data-retention.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,yCAAqC;AAC1D,OAAO,EAAE,cAAc,EAAE,iDAA6C;AAGtE,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAOvF;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;CAOpC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,IAAI,EACA,sBAAsB,GACtB,MAAM,GACN,qBAAqB,GACrB,2BAA2B,GAC3B,8BAA8B,GAC9B,oCAAoC,CAAC;CAC1C;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,cAAc,EACV,sBAAsB,GACtB,MAAM,GACN,qBAAqB,GACrB,2BAA2B,GAC3B,8BAA8B,GAC9B,oCAAoC,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -0,0 +1,53 @@
import { APIResource } from "../../../../core/resource.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class DataRetention extends APIResource {
/**
* Retrieves project data retention controls.
*
* @example
* ```ts
* const projectDataRetention =
* await client.admin.organization.projects.dataRetention.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID: string, options?: RequestOptions): APIPromise<ProjectDataRetention>;
/**
* Updates project data retention controls.
*
* @example
* ```ts
* const projectDataRetention =
* await client.admin.organization.projects.dataRetention.update(
* 'project_id',
* { retention_type: 'organization_default' },
* );
* ```
*/
update(projectID: string, body: DataRetentionUpdateParams, options?: RequestOptions): APIPromise<ProjectDataRetention>;
}
/**
* Represents a project's data retention control setting.
*/
export interface ProjectDataRetention {
/**
* The object type, which is always `project.data_retention`.
*/
object: 'project.data_retention';
/**
* The configured project data retention type.
*/
type: 'organization_default' | 'none' | 'zero_data_retention' | 'modified_abuse_monitoring' | 'enhanced_zero_data_retention' | 'enhanced_modified_abuse_monitoring';
}
export interface DataRetentionUpdateParams {
/**
* The desired project data retention type.
*/
retention_type: 'organization_default' | 'none' | 'zero_data_retention' | 'modified_abuse_monitoring' | 'enhanced_zero_data_retention' | 'enhanced_modified_abuse_monitoring';
}
export declare namespace DataRetention {
export { type ProjectDataRetention as ProjectDataRetention, type DataRetentionUpdateParams as DataRetentionUpdateParams, };
}
//# sourceMappingURL=data-retention.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"data-retention.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/data-retention.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,wCAAqC;AAC1D,OAAO,EAAE,cAAc,EAAE,gDAA6C;AAGtE,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAOvF;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;CAOpC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,IAAI,EACA,sBAAsB,GACtB,MAAM,GACN,qBAAqB,GACrB,2BAA2B,GAC3B,8BAA8B,GAC9B,oCAAoC,CAAC;CAC1C;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,cAAc,EACV,sBAAsB,GACtB,MAAM,GACN,qBAAqB,GACrB,2BAA2B,GAC3B,8BAA8B,GAC9B,oCAAoC,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -0,0 +1,46 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataRetention = void 0;
const resource_1 = require("../../../../core/resource.js");
const path_1 = require("../../../../internal/utils/path.js");
class DataRetention extends resource_1.APIResource {
/**
* Retrieves project data retention controls.
*
* @example
* ```ts
* const projectDataRetention =
* await client.admin.organization.projects.dataRetention.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID, options) {
return this._client.get((0, path_1.path) `/organization/projects/${projectID}/data_retention`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Updates project data retention controls.
*
* @example
* ```ts
* const projectDataRetention =
* await client.admin.organization.projects.dataRetention.update(
* 'project_id',
* { retention_type: 'organization_default' },
* );
* ```
*/
update(projectID, body, options) {
return this._client.post((0, path_1.path) `/organization/projects/${projectID}/data_retention`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.DataRetention = DataRetention;
//# sourceMappingURL=data-retention.js.map
@@ -0,0 +1 @@
{"version":3,"file":"data-retention.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/data-retention.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAwD;AAGxD,6DAAuD;AAEvD,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,SAAS,iBAAiB,EAAE;YAChF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,SAAiB,EACjB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,0BAA0B,SAAS,iBAAiB,EAAE;YACjF,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AA1CD,sCA0CC"}
@@ -0,0 +1,42 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export class DataRetention extends APIResource {
/**
* Retrieves project data retention controls.
*
* @example
* ```ts
* const projectDataRetention =
* await client.admin.organization.projects.dataRetention.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID, options) {
return this._client.get(path `/organization/projects/${projectID}/data_retention`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Updates project data retention controls.
*
* @example
* ```ts
* const projectDataRetention =
* await client.admin.organization.projects.dataRetention.update(
* 'project_id',
* { retention_type: 'organization_default' },
* );
* ```
*/
update(projectID, body, options) {
return this._client.post(path `/organization/projects/${projectID}/data_retention`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=data-retention.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"data-retention.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/data-retention.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAGxD,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,SAAS,iBAAiB,EAAE;YAChF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,SAAiB,EACjB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,0BAA0B,SAAS,iBAAiB,EAAE;YACjF,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,2 @@
export * from "./groups/index.mjs";
//# sourceMappingURL=groups.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/groups.ts"],"names":[],"mappings":"AAEA,mCAA+B"}
@@ -0,0 +1,2 @@
export * from "./groups/index.js";
//# sourceMappingURL=groups.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/groups.ts"],"names":[],"mappings":"AAEA,kCAA+B"}
@@ -0,0 +1,6 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("../../../../internal/tslib.js");
tslib_1.__exportStar(require("./groups/index.js"), exports);
//# sourceMappingURL=groups.js.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/groups.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B"}
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./groups/index.mjs";
//# sourceMappingURL=groups.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/groups.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,mCAA+B"}
@@ -0,0 +1,142 @@
import { APIResource } from "../../../../../core/resource.mjs";
import * as RolesAPI from "./roles.mjs";
import { RoleCreateParams, RoleCreateResponse, RoleDeleteParams, RoleDeleteResponse, RoleListParams, RoleListResponse, RoleListResponsesPage, RoleRetrieveParams, RoleRetrieveResponse, Roles } from "./roles.mjs";
import { APIPromise } from "../../../../../core/api-promise.mjs";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../../core/pagination.mjs";
import { RequestOptions } from "../../../../../internal/request-options.mjs";
export declare class Groups extends APIResource {
roles: RolesAPI.Roles;
/**
* Grants a group access to a project.
*
* @example
* ```ts
* const projectGroup =
* await client.admin.organization.projects.groups.create(
* 'project_id',
* { group_id: 'group_id', role: 'role' },
* );
* ```
*/
create(projectID: string, body: GroupCreateParams, options?: RequestOptions): APIPromise<ProjectGroup>;
/**
* Retrieves a project's group.
*
* @example
* ```ts
* const projectGroup =
* await client.admin.organization.projects.groups.retrieve(
* 'group_id',
* { project_id: 'project_id' },
* );
* ```
*/
retrieve(groupID: string, params: GroupRetrieveParams, options?: RequestOptions): APIPromise<ProjectGroup>;
/**
* Lists the groups that have access to a project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const projectGroup of client.admin.organization.projects.groups.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID: string, query?: GroupListParams | null | undefined, options?: RequestOptions): PagePromise<ProjectGroupsPage, ProjectGroup>;
/**
* Revokes a group's access to a project.
*
* @example
* ```ts
* const group =
* await client.admin.organization.projects.groups.delete(
* 'group_id',
* { project_id: 'project_id' },
* );
* ```
*/
delete(groupID: string, params: GroupDeleteParams, options?: RequestOptions): APIPromise<GroupDeleteResponse>;
}
export type ProjectGroupsPage = NextCursorPage<ProjectGroup>;
/**
* Details about a group's membership in a project.
*/
export interface ProjectGroup {
/**
* Unix timestamp (in seconds) when the group was granted project access.
*/
created_at: number;
/**
* Identifier of the group that has access to the project.
*/
group_id: string;
/**
* Display name of the group.
*/
group_name: string;
/**
* The type of the group.
*/
group_type: 'group' | 'tenant_group';
/**
* Always `project.group`.
*/
object: 'project.group';
/**
* Identifier of the project.
*/
project_id: string;
}
/**
* Confirmation payload returned after removing a group from a project.
*/
export interface GroupDeleteResponse {
/**
* Whether the group membership in the project was removed.
*/
deleted: boolean;
/**
* Always `project.group.deleted`.
*/
object: 'project.group.deleted';
}
export interface GroupCreateParams {
/**
* Identifier of the group to add to the project.
*/
group_id: string;
/**
* Identifier of the project role to grant to the group.
*/
role: string;
}
export interface GroupRetrieveParams {
/**
* Path param: The ID of the project to inspect.
*/
project_id: string;
/**
* Query param: The type of group to retrieve.
*/
group_type?: 'group' | 'tenant_group';
}
export interface GroupListParams extends NextCursorPageParams {
/**
* Sort order for the returned groups.
*/
order?: 'asc' | 'desc';
}
export interface GroupDeleteParams {
/**
* The ID of the project to update.
*/
project_id: string;
}
export declare namespace Groups {
export { type ProjectGroup as ProjectGroup, type GroupDeleteResponse as GroupDeleteResponse, type ProjectGroupsPage as ProjectGroupsPage, type GroupCreateParams as GroupCreateParams, type GroupRetrieveParams as GroupRetrieveParams, type GroupListParams as GroupListParams, type GroupDeleteParams as GroupDeleteParams, };
export { Roles as Roles, type RoleCreateResponse as RoleCreateResponse, type RoleRetrieveResponse as RoleRetrieveResponse, type RoleListResponse as RoleListResponse, type RoleDeleteResponse as RoleDeleteResponse, type RoleListResponsesPage as RoleListResponsesPage, type RoleCreateParams as RoleCreateParams, type RoleRetrieveParams as RoleRetrieveParams, type RoleListParams as RoleListParams, type RoleDeleteParams as RoleDeleteParams, };
}
//# sourceMappingURL=groups.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.d.mts","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/groups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,yCAAqC;AAC3D,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,EACN,oBAAgB;AACjB,OAAO,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 -0,0 +1,142 @@
import { APIResource } from "../../../../../core/resource.js";
import * as RolesAPI from "./roles.js";
import { RoleCreateParams, RoleCreateResponse, RoleDeleteParams, RoleDeleteResponse, RoleListParams, RoleListResponse, RoleListResponsesPage, RoleRetrieveParams, RoleRetrieveResponse, Roles } from "./roles.js";
import { APIPromise } from "../../../../../core/api-promise.js";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../../core/pagination.js";
import { RequestOptions } from "../../../../../internal/request-options.js";
export declare class Groups extends APIResource {
roles: RolesAPI.Roles;
/**
* Grants a group access to a project.
*
* @example
* ```ts
* const projectGroup =
* await client.admin.organization.projects.groups.create(
* 'project_id',
* { group_id: 'group_id', role: 'role' },
* );
* ```
*/
create(projectID: string, body: GroupCreateParams, options?: RequestOptions): APIPromise<ProjectGroup>;
/**
* Retrieves a project's group.
*
* @example
* ```ts
* const projectGroup =
* await client.admin.organization.projects.groups.retrieve(
* 'group_id',
* { project_id: 'project_id' },
* );
* ```
*/
retrieve(groupID: string, params: GroupRetrieveParams, options?: RequestOptions): APIPromise<ProjectGroup>;
/**
* Lists the groups that have access to a project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const projectGroup of client.admin.organization.projects.groups.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID: string, query?: GroupListParams | null | undefined, options?: RequestOptions): PagePromise<ProjectGroupsPage, ProjectGroup>;
/**
* Revokes a group's access to a project.
*
* @example
* ```ts
* const group =
* await client.admin.organization.projects.groups.delete(
* 'group_id',
* { project_id: 'project_id' },
* );
* ```
*/
delete(groupID: string, params: GroupDeleteParams, options?: RequestOptions): APIPromise<GroupDeleteResponse>;
}
export type ProjectGroupsPage = NextCursorPage<ProjectGroup>;
/**
* Details about a group's membership in a project.
*/
export interface ProjectGroup {
/**
* Unix timestamp (in seconds) when the group was granted project access.
*/
created_at: number;
/**
* Identifier of the group that has access to the project.
*/
group_id: string;
/**
* Display name of the group.
*/
group_name: string;
/**
* The type of the group.
*/
group_type: 'group' | 'tenant_group';
/**
* Always `project.group`.
*/
object: 'project.group';
/**
* Identifier of the project.
*/
project_id: string;
}
/**
* Confirmation payload returned after removing a group from a project.
*/
export interface GroupDeleteResponse {
/**
* Whether the group membership in the project was removed.
*/
deleted: boolean;
/**
* Always `project.group.deleted`.
*/
object: 'project.group.deleted';
}
export interface GroupCreateParams {
/**
* Identifier of the group to add to the project.
*/
group_id: string;
/**
* Identifier of the project role to grant to the group.
*/
role: string;
}
export interface GroupRetrieveParams {
/**
* Path param: The ID of the project to inspect.
*/
project_id: string;
/**
* Query param: The type of group to retrieve.
*/
group_type?: 'group' | 'tenant_group';
}
export interface GroupListParams extends NextCursorPageParams {
/**
* Sort order for the returned groups.
*/
order?: 'asc' | 'desc';
}
export interface GroupDeleteParams {
/**
* The ID of the project to update.
*/
project_id: string;
}
export declare namespace Groups {
export { type ProjectGroup as ProjectGroup, type GroupDeleteResponse as GroupDeleteResponse, type ProjectGroupsPage as ProjectGroupsPage, type GroupCreateParams as GroupCreateParams, type GroupRetrieveParams as GroupRetrieveParams, type GroupListParams as GroupListParams, type GroupDeleteParams as GroupDeleteParams, };
export { Roles as Roles, type RoleCreateResponse as RoleCreateResponse, type RoleRetrieveResponse as RoleRetrieveResponse, type RoleListResponse as RoleListResponse, type RoleDeleteResponse as RoleDeleteResponse, type RoleListResponsesPage as RoleListResponsesPage, type RoleCreateParams as RoleCreateParams, type RoleRetrieveParams as RoleRetrieveParams, type RoleListParams as RoleListParams, type RoleDeleteParams as RoleDeleteParams, };
}
//# sourceMappingURL=groups.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/groups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,wCAAqC;AAC3D,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,cAA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BAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,93 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Groups = void 0;
const tslib_1 = require("../../../../../internal/tslib.js");
const resource_1 = require("../../../../../core/resource.js");
const RolesAPI = tslib_1.__importStar(require("./roles.js"));
const roles_1 = require("./roles.js");
const pagination_1 = require("../../../../../core/pagination.js");
const path_1 = require("../../../../../internal/utils/path.js");
class Groups extends resource_1.APIResource {
constructor() {
super(...arguments);
this.roles = new RolesAPI.Roles(this._client);
}
/**
* Grants a group access to a project.
*
* @example
* ```ts
* const projectGroup =
* await client.admin.organization.projects.groups.create(
* 'project_id',
* { group_id: 'group_id', role: 'role' },
* );
* ```
*/
create(projectID, body, options) {
return this._client.post((0, path_1.path) `/organization/projects/${projectID}/groups`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves a project's group.
*
* @example
* ```ts
* const projectGroup =
* await client.admin.organization.projects.groups.retrieve(
* 'group_id',
* { project_id: 'project_id' },
* );
* ```
*/
retrieve(groupID, params, options) {
const { project_id, ...query } = params;
return this._client.get((0, path_1.path) `/organization/projects/${project_id}/groups/${groupID}`, {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists the groups that have access to a project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const projectGroup of client.admin.organization.projects.groups.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID, query = {}, options) {
return this._client.getAPIList((0, path_1.path) `/organization/projects/${projectID}/groups`, (pagination_1.NextCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Revokes a group's access to a project.
*
* @example
* ```ts
* const group =
* await client.admin.organization.projects.groups.delete(
* 'group_id',
* { project_id: 'project_id' },
* );
* ```
*/
delete(groupID, params, options) {
const { project_id } = params;
return this._client.delete((0, path_1.path) `/organization/projects/${project_id}/groups/${groupID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.Groups = Groups;
Groups.Roles = roles_1.Roles;
//# sourceMappingURL=groups.js.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/groups.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,8DAA2D;AAC3D,6DAAoC;AACpC,sCAWiB;AAEjB,kEAAwG;AAExG,gEAA0D;AAE1D,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2F3D,CAAC;IAzFC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAuB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,0BAA0B,SAAS,SAAS,EAAE;YACzE,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAe,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,UAAU,WAAW,OAAO,EAAE,EAAE;YACpF,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,0BAA0B,SAAS,SAAS,EAChD,CAAA,2BAA4B,CAAA,EAC5B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,OAAe,EACf,MAAyB,EACzB,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,0BAA0B,UAAU,WAAW,OAAO,EAAE,EAAE;YACvF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AA5FD,wBA4FC;AA4FD,MAAM,CAAC,KAAK,GAAG,aAAK,CAAC"}
@@ -0,0 +1,88 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../../core/resource.mjs";
import * as RolesAPI from "./roles.mjs";
import { Roles, } from "./roles.mjs";
import { NextCursorPage } from "../../../../../core/pagination.mjs";
import { path } from "../../../../../internal/utils/path.mjs";
export class Groups extends APIResource {
constructor() {
super(...arguments);
this.roles = new RolesAPI.Roles(this._client);
}
/**
* Grants a group access to a project.
*
* @example
* ```ts
* const projectGroup =
* await client.admin.organization.projects.groups.create(
* 'project_id',
* { group_id: 'group_id', role: 'role' },
* );
* ```
*/
create(projectID, body, options) {
return this._client.post(path `/organization/projects/${projectID}/groups`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves a project's group.
*
* @example
* ```ts
* const projectGroup =
* await client.admin.organization.projects.groups.retrieve(
* 'group_id',
* { project_id: 'project_id' },
* );
* ```
*/
retrieve(groupID, params, options) {
const { project_id, ...query } = params;
return this._client.get(path `/organization/projects/${project_id}/groups/${groupID}`, {
query,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists the groups that have access to a project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const projectGroup of client.admin.organization.projects.groups.list(
* 'project_id',
* )) {
* // ...
* }
* ```
*/
list(projectID, query = {}, options) {
return this._client.getAPIList(path `/organization/projects/${projectID}/groups`, (NextCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Revokes a group's access to a project.
*
* @example
* ```ts
* const group =
* await client.admin.organization.projects.groups.delete(
* 'group_id',
* { project_id: 'project_id' },
* );
* ```
*/
delete(groupID, params, options) {
const { project_id } = params;
return this._client.delete(path `/organization/projects/${project_id}/groups/${groupID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
Groups.Roles = Roles;
//# sourceMappingURL=groups.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"groups.mjs","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/groups.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,yCAAqC;AAC3D,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAUL,KAAK,GACN,oBAAgB;AAEjB,OAAO,EAAE,cAAc,EAA0C,2CAAuC;AAExG,OAAO,EAAE,IAAI,EAAE,+CAA2C;AAE1D,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2F3D,CAAC;IAzFC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAuB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,0BAA0B,SAAS,SAAS,EAAE;YACzE,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAe,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,UAAU,WAAW,OAAO,EAAE,EAAE;YACpF,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,0BAA0B,SAAS,SAAS,EAChD,CAAA,cAA4B,CAAA,EAC5B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,OAAe,EACf,MAAyB,EACzB,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,0BAA0B,UAAU,WAAW,OAAO,EAAE,EAAE;YACvF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AA4FD,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC"}
@@ -0,0 +1,3 @@
export { Groups, type ProjectGroup, type GroupDeleteResponse, type GroupCreateParams, type GroupRetrieveParams, type GroupListParams, type GroupDeleteParams, type ProjectGroupsPage, } from "./groups.mjs";
export { Roles, type RoleCreateResponse, type RoleRetrieveResponse, type RoleListResponse, type RoleDeleteResponse, type RoleCreateParams, type RoleRetrieveParams, type RoleListParams, type RoleDeleteParams, type RoleListResponsesPage, } from "./roles.mjs";
//# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,qBAAiB;AAClB,OAAO,EACL,KAAK,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,oBAAgB"}
@@ -0,0 +1,3 @@
export { Groups, type ProjectGroup, type GroupDeleteResponse, type GroupCreateParams, type GroupRetrieveParams, type GroupListParams, type GroupDeleteParams, type ProjectGroupsPage, } from "./groups.js";
export { Roles, type RoleCreateResponse, type RoleRetrieveResponse, type RoleListResponse, type RoleDeleteResponse, type RoleCreateParams, type RoleRetrieveParams, type RoleListParams, type RoleDeleteParams, type RoleListResponsesPage, } from "./roles.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,oBAAiB;AAClB,OAAO,EACL,KAAK,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,mBAAgB"}
@@ -0,0 +1,9 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Roles = exports.Groups = void 0;
var groups_1 = require("./groups.js");
Object.defineProperty(exports, "Groups", { enumerable: true, get: function () { return groups_1.Groups; } });
var roles_1 = require("./roles.js");
Object.defineProperty(exports, "Roles", { enumerable: true, get: function () { return roles_1.Roles; } });
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCASkB;AARhB,gGAAA,MAAM,OAAA;AASR,oCAWiB;AAVf,8FAAA,KAAK,OAAA"}
@@ -0,0 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { Groups, } from "./groups.mjs";
export { Roles, } from "./roles.mjs";
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,MAAM,GAQP,qBAAiB;AAClB,OAAO,EACL,KAAK,GAUN,oBAAgB"}
@@ -0,0 +1,292 @@
import { APIResource } from "../../../../../core/resource.mjs";
import * as RolesAPI from "../../roles.mjs";
import { APIPromise } from "../../../../../core/api-promise.mjs";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../../core/pagination.mjs";
import { RequestOptions } from "../../../../../internal/request-options.mjs";
export declare class Roles extends APIResource {
/**
* Assigns a project role to a group within a project.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.create(
* 'group_id',
* { project_id: 'project_id', role_id: 'role_id' },
* );
* ```
*/
create(groupID: string, params: RoleCreateParams, options?: RequestOptions): APIPromise<RoleCreateResponse>;
/**
* Retrieves a project role assigned to a group.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.retrieve(
* 'role_id',
* { project_id: 'project_id', group_id: 'group_id' },
* );
* ```
*/
retrieve(roleID: string, params: RoleRetrieveParams, options?: RequestOptions): APIPromise<RoleRetrieveResponse>;
/**
* Lists the project roles assigned to a group within a project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const roleListResponse of client.admin.organization.projects.groups.roles.list(
* 'group_id',
* { project_id: 'project_id' },
* )) {
* // ...
* }
* ```
*/
list(groupID: string, params: RoleListParams, options?: RequestOptions): PagePromise<RoleListResponsesPage, RoleListResponse>;
/**
* Unassigns a project role from a group within a project.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.delete(
* 'role_id',
* { project_id: 'project_id', group_id: 'group_id' },
* );
* ```
*/
delete(roleID: string, params: RoleDeleteParams, options?: RequestOptions): APIPromise<RoleDeleteResponse>;
}
export type RoleListResponsesPage = NextCursorPage<RoleListResponse>;
/**
* Role assignment linking a group to a role.
*/
export interface RoleCreateResponse {
/**
* Summary information about a group returned in role assignment responses.
*/
group: RoleCreateResponse.Group;
/**
* Always `group.role`.
*/
object: 'group.role';
/**
* Details about a role that can be assigned through the public Roles API.
*/
role: RolesAPI.Role;
}
export declare namespace RoleCreateResponse {
/**
* Summary information about a group returned in role assignment responses.
*/
interface Group {
/**
* Identifier for the group.
*/
id: string;
/**
* Unix timestamp (in seconds) when the group was created.
*/
created_at: number;
/**
* Display name of the group.
*/
name: string;
/**
* Always `group`.
*/
object: 'group';
/**
* Whether the group is managed through SCIM.
*/
scim_managed: boolean;
}
}
/**
* Detailed information about a role assignment entry returned when listing
* assignments.
*/
export interface RoleRetrieveResponse {
/**
* Identifier for the role.
*/
id: string;
/**
* Principals from which the role assignment is inherited, when available.
*/
assignment_sources: Array<RoleRetrieveResponse.AssignmentSource> | null;
/**
* When the role was created.
*/
created_at: number | null;
/**
* Identifier of the actor who created the role.
*/
created_by: string | null;
/**
* User details for the actor that created the role, when available.
*/
created_by_user_obj: {
[key: string]: unknown;
} | null;
/**
* Description of the role.
*/
description: string | null;
/**
* Arbitrary metadata stored on the role.
*/
metadata: {
[key: string]: unknown;
} | null;
/**
* Name of the role.
*/
name: string;
/**
* Permissions associated with the role.
*/
permissions: Array<string>;
/**
* Whether the role is predefined by OpenAI.
*/
predefined_role: boolean;
/**
* Resource type the role applies to.
*/
resource_type: string;
/**
* When the role was last updated.
*/
updated_at: number | null;
}
export declare namespace RoleRetrieveResponse {
interface AssignmentSource {
principal_id: string;
principal_type: string;
}
}
/**
* Detailed information about a role assignment entry returned when listing
* assignments.
*/
export interface RoleListResponse {
/**
* Identifier for the role.
*/
id: string;
/**
* Principals from which the role assignment is inherited, when available.
*/
assignment_sources: Array<RoleListResponse.AssignmentSource> | null;
/**
* When the role was created.
*/
created_at: number | null;
/**
* Identifier of the actor who created the role.
*/
created_by: string | null;
/**
* User details for the actor that created the role, when available.
*/
created_by_user_obj: {
[key: string]: unknown;
} | null;
/**
* Description of the role.
*/
description: string | null;
/**
* Arbitrary metadata stored on the role.
*/
metadata: {
[key: string]: unknown;
} | null;
/**
* Name of the role.
*/
name: string;
/**
* Permissions associated with the role.
*/
permissions: Array<string>;
/**
* Whether the role is predefined by OpenAI.
*/
predefined_role: boolean;
/**
* Resource type the role applies to.
*/
resource_type: string;
/**
* When the role was last updated.
*/
updated_at: number | null;
}
export declare namespace RoleListResponse {
interface AssignmentSource {
principal_id: string;
principal_type: string;
}
}
/**
* Confirmation payload returned after unassigning a role.
*/
export interface RoleDeleteResponse {
/**
* Whether the assignment was removed.
*/
deleted: boolean;
/**
* Identifier for the deleted assignment, such as `group.role.deleted` or
* `user.role.deleted`.
*/
object: string;
}
export interface RoleCreateParams {
/**
* Path param: The ID of the project to update.
*/
project_id: string;
/**
* Body param: Identifier of the role to assign.
*/
role_id: string;
}
export interface RoleRetrieveParams {
/**
* The ID of the project to inspect.
*/
project_id: string;
/**
* The ID of the group to inspect.
*/
group_id: string;
}
export interface RoleListParams extends NextCursorPageParams {
/**
* Path param: The ID of the project to inspect.
*/
project_id: string;
/**
* Query param: Sort order for the returned project roles.
*/
order?: 'asc' | 'desc';
}
export interface RoleDeleteParams {
/**
* The ID of the project to modify.
*/
project_id: string;
/**
* The ID of the group whose project role assignment should be removed.
*/
group_id: string;
}
export declare namespace Roles {
export { type RoleCreateResponse as RoleCreateResponse, type RoleRetrieveResponse as RoleRetrieveResponse, type RoleListResponse as RoleListResponse, type RoleDeleteResponse as RoleDeleteResponse, type RoleListResponsesPage as RoleListResponsesPage, type RoleCreateParams as RoleCreateParams, type RoleRetrieveParams as RoleRetrieveParams, type RoleListParams as RoleListParams, type RoleDeleteParams as RoleDeleteParams, };
}
//# sourceMappingURL=roles.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"roles.d.mts","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/roles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,yCAAqC;AAC3D,OAAO,KAAK,QAAQ,wBAAoB;AACxC,OAAO,EAAE,UAAU,EAAE,4CAAwC;AAC7D,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,WAAW,EAAE,2CAAuC;AACxG,OAAO,EAAE,cAAc,EAAE,oDAAgD;AAGzE,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,kBAAkB,CAAC;IASjC;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAQnC;;;;;;;;;;;;;OAaG;IACH,IAAI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0,0 +1,292 @@
import { APIResource } from "../../../../../core/resource.js";
import * as RolesAPI from "../../roles.js";
import { APIPromise } from "../../../../../core/api-promise.js";
import { NextCursorPage, type NextCursorPageParams, PagePromise } from "../../../../../core/pagination.js";
import { RequestOptions } from "../../../../../internal/request-options.js";
export declare class Roles extends APIResource {
/**
* Assigns a project role to a group within a project.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.create(
* 'group_id',
* { project_id: 'project_id', role_id: 'role_id' },
* );
* ```
*/
create(groupID: string, params: RoleCreateParams, options?: RequestOptions): APIPromise<RoleCreateResponse>;
/**
* Retrieves a project role assigned to a group.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.retrieve(
* 'role_id',
* { project_id: 'project_id', group_id: 'group_id' },
* );
* ```
*/
retrieve(roleID: string, params: RoleRetrieveParams, options?: RequestOptions): APIPromise<RoleRetrieveResponse>;
/**
* Lists the project roles assigned to a group within a project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const roleListResponse of client.admin.organization.projects.groups.roles.list(
* 'group_id',
* { project_id: 'project_id' },
* )) {
* // ...
* }
* ```
*/
list(groupID: string, params: RoleListParams, options?: RequestOptions): PagePromise<RoleListResponsesPage, RoleListResponse>;
/**
* Unassigns a project role from a group within a project.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.delete(
* 'role_id',
* { project_id: 'project_id', group_id: 'group_id' },
* );
* ```
*/
delete(roleID: string, params: RoleDeleteParams, options?: RequestOptions): APIPromise<RoleDeleteResponse>;
}
export type RoleListResponsesPage = NextCursorPage<RoleListResponse>;
/**
* Role assignment linking a group to a role.
*/
export interface RoleCreateResponse {
/**
* Summary information about a group returned in role assignment responses.
*/
group: RoleCreateResponse.Group;
/**
* Always `group.role`.
*/
object: 'group.role';
/**
* Details about a role that can be assigned through the public Roles API.
*/
role: RolesAPI.Role;
}
export declare namespace RoleCreateResponse {
/**
* Summary information about a group returned in role assignment responses.
*/
interface Group {
/**
* Identifier for the group.
*/
id: string;
/**
* Unix timestamp (in seconds) when the group was created.
*/
created_at: number;
/**
* Display name of the group.
*/
name: string;
/**
* Always `group`.
*/
object: 'group';
/**
* Whether the group is managed through SCIM.
*/
scim_managed: boolean;
}
}
/**
* Detailed information about a role assignment entry returned when listing
* assignments.
*/
export interface RoleRetrieveResponse {
/**
* Identifier for the role.
*/
id: string;
/**
* Principals from which the role assignment is inherited, when available.
*/
assignment_sources: Array<RoleRetrieveResponse.AssignmentSource> | null;
/**
* When the role was created.
*/
created_at: number | null;
/**
* Identifier of the actor who created the role.
*/
created_by: string | null;
/**
* User details for the actor that created the role, when available.
*/
created_by_user_obj: {
[key: string]: unknown;
} | null;
/**
* Description of the role.
*/
description: string | null;
/**
* Arbitrary metadata stored on the role.
*/
metadata: {
[key: string]: unknown;
} | null;
/**
* Name of the role.
*/
name: string;
/**
* Permissions associated with the role.
*/
permissions: Array<string>;
/**
* Whether the role is predefined by OpenAI.
*/
predefined_role: boolean;
/**
* Resource type the role applies to.
*/
resource_type: string;
/**
* When the role was last updated.
*/
updated_at: number | null;
}
export declare namespace RoleRetrieveResponse {
interface AssignmentSource {
principal_id: string;
principal_type: string;
}
}
/**
* Detailed information about a role assignment entry returned when listing
* assignments.
*/
export interface RoleListResponse {
/**
* Identifier for the role.
*/
id: string;
/**
* Principals from which the role assignment is inherited, when available.
*/
assignment_sources: Array<RoleListResponse.AssignmentSource> | null;
/**
* When the role was created.
*/
created_at: number | null;
/**
* Identifier of the actor who created the role.
*/
created_by: string | null;
/**
* User details for the actor that created the role, when available.
*/
created_by_user_obj: {
[key: string]: unknown;
} | null;
/**
* Description of the role.
*/
description: string | null;
/**
* Arbitrary metadata stored on the role.
*/
metadata: {
[key: string]: unknown;
} | null;
/**
* Name of the role.
*/
name: string;
/**
* Permissions associated with the role.
*/
permissions: Array<string>;
/**
* Whether the role is predefined by OpenAI.
*/
predefined_role: boolean;
/**
* Resource type the role applies to.
*/
resource_type: string;
/**
* When the role was last updated.
*/
updated_at: number | null;
}
export declare namespace RoleListResponse {
interface AssignmentSource {
principal_id: string;
principal_type: string;
}
}
/**
* Confirmation payload returned after unassigning a role.
*/
export interface RoleDeleteResponse {
/**
* Whether the assignment was removed.
*/
deleted: boolean;
/**
* Identifier for the deleted assignment, such as `group.role.deleted` or
* `user.role.deleted`.
*/
object: string;
}
export interface RoleCreateParams {
/**
* Path param: The ID of the project to update.
*/
project_id: string;
/**
* Body param: Identifier of the role to assign.
*/
role_id: string;
}
export interface RoleRetrieveParams {
/**
* The ID of the project to inspect.
*/
project_id: string;
/**
* The ID of the group to inspect.
*/
group_id: string;
}
export interface RoleListParams extends NextCursorPageParams {
/**
* Path param: The ID of the project to inspect.
*/
project_id: string;
/**
* Query param: Sort order for the returned project roles.
*/
order?: 'asc' | 'desc';
}
export interface RoleDeleteParams {
/**
* The ID of the project to modify.
*/
project_id: string;
/**
* The ID of the group whose project role assignment should be removed.
*/
group_id: string;
}
export declare namespace Roles {
export { type RoleCreateResponse as RoleCreateResponse, type RoleRetrieveResponse as RoleRetrieveResponse, type RoleListResponse as RoleListResponse, type RoleDeleteResponse as RoleDeleteResponse, type RoleListResponsesPage as RoleListResponsesPage, type RoleCreateParams as RoleCreateParams, type RoleRetrieveParams as RoleRetrieveParams, type RoleListParams as RoleListParams, type RoleDeleteParams as RoleDeleteParams, };
}
//# sourceMappingURL=roles.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/roles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,wCAAqC;AAC3D,OAAO,KAAK,QAAQ,uBAAoB;AACxC,OAAO,EAAE,UAAU,EAAE,2CAAwC;AAC7D,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,WAAW,EAAE,0CAAuC;AACxG,OAAO,EAAE,cAAc,EAAE,mDAAgD;AAGzE,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;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kB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,87 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Roles = void 0;
const resource_1 = require("../../../../../core/resource.js");
const pagination_1 = require("../../../../../core/pagination.js");
const path_1 = require("../../../../../internal/utils/path.js");
class Roles extends resource_1.APIResource {
/**
* Assigns a project role to a group within a project.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.create(
* 'group_id',
* { project_id: 'project_id', role_id: 'role_id' },
* );
* ```
*/
create(groupID, params, options) {
const { project_id, ...body } = params;
return this._client.post((0, path_1.path) `/projects/${project_id}/groups/${groupID}/roles`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves a project role assigned to a group.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.retrieve(
* 'role_id',
* { project_id: 'project_id', group_id: 'group_id' },
* );
* ```
*/
retrieve(roleID, params, options) {
const { project_id, group_id } = params;
return this._client.get((0, path_1.path) `/projects/${project_id}/groups/${group_id}/roles/${roleID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists the project roles assigned to a group within a project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const roleListResponse of client.admin.organization.projects.groups.roles.list(
* 'group_id',
* { project_id: 'project_id' },
* )) {
* // ...
* }
* ```
*/
list(groupID, params, options) {
const { project_id, ...query } = params;
return this._client.getAPIList((0, path_1.path) `/projects/${project_id}/groups/${groupID}/roles`, (pagination_1.NextCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Unassigns a project role from a group within a project.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.delete(
* 'role_id',
* { project_id: 'project_id', group_id: 'group_id' },
* );
* ```
*/
delete(roleID, params, options) {
const { project_id, group_id } = params;
return this._client.delete((0, path_1.path) `/projects/${project_id}/groups/${group_id}/roles/${roleID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.Roles = Roles;
//# sourceMappingURL=roles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/roles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAA2D;AAG3D,kEAAwG;AAExG,gEAA0D;AAE1D,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,OAAe,EACf,MAAwB,EACxB,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,WAAW,OAAO,QAAQ,EAAE;YAC9E,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,MAAc,EACd,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,WAAW,QAAQ,UAAU,MAAM,EAAE,EAAE;YACxF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,OAAe,EACf,MAAsB,EACtB,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,aAAa,UAAU,WAAW,OAAO,QAAQ,EACrD,CAAA,2BAAgC,CAAA,EAChC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAc,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,WAAW,QAAQ,UAAU,MAAM,EAAE,EAAE;YAC3F,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AAhGD,sBAgGC"}
@@ -0,0 +1,83 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../../core/resource.mjs";
import { NextCursorPage } from "../../../../../core/pagination.mjs";
import { path } from "../../../../../internal/utils/path.mjs";
export class Roles extends APIResource {
/**
* Assigns a project role to a group within a project.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.create(
* 'group_id',
* { project_id: 'project_id', role_id: 'role_id' },
* );
* ```
*/
create(groupID, params, options) {
const { project_id, ...body } = params;
return this._client.post(path `/projects/${project_id}/groups/${groupID}/roles`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Retrieves a project role assigned to a group.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.retrieve(
* 'role_id',
* { project_id: 'project_id', group_id: 'group_id' },
* );
* ```
*/
retrieve(roleID, params, options) {
const { project_id, group_id } = params;
return this._client.get(path `/projects/${project_id}/groups/${group_id}/roles/${roleID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Lists the project roles assigned to a group within a project.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const roleListResponse of client.admin.organization.projects.groups.roles.list(
* 'group_id',
* { project_id: 'project_id' },
* )) {
* // ...
* }
* ```
*/
list(groupID, params, options) {
const { project_id, ...query } = params;
return this._client.getAPIList(path `/projects/${project_id}/groups/${groupID}/roles`, (NextCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
}
/**
* Unassigns a project role from a group within a project.
*
* @example
* ```ts
* const role =
* await client.admin.organization.projects.groups.roles.delete(
* 'role_id',
* { project_id: 'project_id', group_id: 'group_id' },
* );
* ```
*/
delete(roleID, params, options) {
const { project_id, group_id } = params;
return this._client.delete(path `/projects/${project_id}/groups/${group_id}/roles/${roleID}`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=roles.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"roles.mjs","sourceRoot":"","sources":["../../../../../src/resources/admin/organization/projects/groups/roles.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,yCAAqC;AAG3D,OAAO,EAAE,cAAc,EAA0C,2CAAuC;AAExG,OAAO,EAAE,IAAI,EAAE,+CAA2C;AAE1D,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,OAAe,EACf,MAAwB,EACxB,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,UAAU,WAAW,OAAO,QAAQ,EAAE;YAC9E,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,MAAc,EACd,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,UAAU,WAAW,QAAQ,UAAU,MAAM,EAAE,EAAE;YACxF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,OAAe,EACf,MAAsB,EACtB,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,aAAa,UAAU,WAAW,OAAO,QAAQ,EACrD,CAAA,cAAgC,CAAA,EAChC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAc,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,UAAU,WAAW,QAAQ,UAAU,MAAM,EAAE,EAAE;YAC3F,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,174 @@
import { APIResource } from "../../../../core/resource.mjs";
import { APIPromise } from "../../../../core/api-promise.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class HostedToolPermissions extends APIResource {
/**
* Returns hosted tool permissions for a project.
*
* @example
* ```ts
* const projectHostedToolPermissions =
* await client.admin.organization.projects.hostedToolPermissions.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID: string, options?: RequestOptions): APIPromise<ProjectHostedToolPermissions>;
/**
* Updates hosted tool permissions for a project.
*
* @example
* ```ts
* const projectHostedToolPermissions =
* await client.admin.organization.projects.hostedToolPermissions.update(
* 'project_id',
* );
* ```
*/
update(projectID: string, body: HostedToolPermissionUpdateParams, options?: RequestOptions): APIPromise<ProjectHostedToolPermissions>;
}
/**
* Represents hosted tool permissions for a project.
*/
export interface ProjectHostedToolPermissions {
/**
* Permission state for a single hosted tool on a project.
*/
code_interpreter: ProjectHostedToolPermissions.CodeInterpreter;
/**
* Permission state for a single hosted tool on a project.
*/
file_search: ProjectHostedToolPermissions.FileSearch;
/**
* Permission state for a single hosted tool on a project.
*/
image_generation: ProjectHostedToolPermissions.ImageGeneration;
/**
* Permission state for a single hosted tool on a project.
*/
mcp: ProjectHostedToolPermissions.Mcp;
/**
* Permission state for a single hosted tool on a project.
*/
web_search: ProjectHostedToolPermissions.WebSearch;
}
export declare namespace ProjectHostedToolPermissions {
/**
* Permission state for a single hosted tool on a project.
*/
interface CodeInterpreter {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
/**
* Permission state for a single hosted tool on a project.
*/
interface FileSearch {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
/**
* Permission state for a single hosted tool on a project.
*/
interface ImageGeneration {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
/**
* Permission state for a single hosted tool on a project.
*/
interface Mcp {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
/**
* Permission state for a single hosted tool on a project.
*/
interface WebSearch {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
}
export interface HostedToolPermissionUpdateParams {
/**
* The code interpreter permission update.
*/
code_interpreter?: HostedToolPermissionUpdateParams.CodeInterpreter | null;
/**
* The file search permission update.
*/
file_search?: HostedToolPermissionUpdateParams.FileSearch | null;
/**
* The image generation permission update.
*/
image_generation?: HostedToolPermissionUpdateParams.ImageGeneration | null;
/**
* The MCP permission update.
*/
mcp?: HostedToolPermissionUpdateParams.Mcp | null;
/**
* The web search permission update.
*/
web_search?: HostedToolPermissionUpdateParams.WebSearch | null;
}
export declare namespace HostedToolPermissionUpdateParams {
/**
* The code interpreter permission update.
*/
interface CodeInterpreter {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
/**
* The file search permission update.
*/
interface FileSearch {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
/**
* The image generation permission update.
*/
interface ImageGeneration {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
/**
* The MCP permission update.
*/
interface Mcp {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
/**
* The web search permission update.
*/
interface WebSearch {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
}
export declare namespace HostedToolPermissions {
export { type ProjectHostedToolPermissions as ProjectHostedToolPermissions, type HostedToolPermissionUpdateParams as HostedToolPermissionUpdateParams, };
}
//# sourceMappingURL=hosted-tool-permissions.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"hosted-tool-permissions.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/hosted-tool-permissions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,yCAAqC;AAC1D,OAAO,EAAE,cAAc,EAAE,iDAA6C;AAGtE,qBAAa,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAO/F;;;;;;;;;;OAUG;IACH,MAAM,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ACH,UAAU,CAAC,EAAE,gCAAgC,CAAC,SAAS,GAAG,IAAI,CAAC;CAChE;AAED,yBAAiB,gCAAgC,CAAC;IAChD;;OAEG;IACH,UAAiB,eAAe;QAC9B;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;KAClB;IAED;;OAEG;IACH,UAAiB,UAAU;QACzB;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;KAClB;IAED;;OAEG;IACH,UAAiB,eAAe;QAC9B;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;KAClB;IAED;;OAEG;IACH,UAAiB,GAAG;QAClB;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;KAClB;IAED;;OAEG;IACH,UAAiB,SAAS;QACxB;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;KAClB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,qBAAqB,CAAC;IAC7C,OAAO,EACL,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,gCAAgC,IAAI,gCAAgC,GAC1E,CAAC;CACH"}
@@ -0,0 +1,174 @@
import { APIResource } from "../../../../core/resource.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class HostedToolPermissions extends APIResource {
/**
* Returns hosted tool permissions for a project.
*
* @example
* ```ts
* const projectHostedToolPermissions =
* await client.admin.organization.projects.hostedToolPermissions.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID: string, options?: RequestOptions): APIPromise<ProjectHostedToolPermissions>;
/**
* Updates hosted tool permissions for a project.
*
* @example
* ```ts
* const projectHostedToolPermissions =
* await client.admin.organization.projects.hostedToolPermissions.update(
* 'project_id',
* );
* ```
*/
update(projectID: string, body: HostedToolPermissionUpdateParams, options?: RequestOptions): APIPromise<ProjectHostedToolPermissions>;
}
/**
* Represents hosted tool permissions for a project.
*/
export interface ProjectHostedToolPermissions {
/**
* Permission state for a single hosted tool on a project.
*/
code_interpreter: ProjectHostedToolPermissions.CodeInterpreter;
/**
* Permission state for a single hosted tool on a project.
*/
file_search: ProjectHostedToolPermissions.FileSearch;
/**
* Permission state for a single hosted tool on a project.
*/
image_generation: ProjectHostedToolPermissions.ImageGeneration;
/**
* Permission state for a single hosted tool on a project.
*/
mcp: ProjectHostedToolPermissions.Mcp;
/**
* Permission state for a single hosted tool on a project.
*/
web_search: ProjectHostedToolPermissions.WebSearch;
}
export declare namespace ProjectHostedToolPermissions {
/**
* Permission state for a single hosted tool on a project.
*/
interface CodeInterpreter {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
/**
* Permission state for a single hosted tool on a project.
*/
interface FileSearch {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
/**
* Permission state for a single hosted tool on a project.
*/
interface ImageGeneration {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
/**
* Permission state for a single hosted tool on a project.
*/
interface Mcp {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
/**
* Permission state for a single hosted tool on a project.
*/
interface WebSearch {
/**
* Whether the hosted tool is enabled for the project.
*/
enabled: boolean;
}
}
export interface HostedToolPermissionUpdateParams {
/**
* The code interpreter permission update.
*/
code_interpreter?: HostedToolPermissionUpdateParams.CodeInterpreter | null;
/**
* The file search permission update.
*/
file_search?: HostedToolPermissionUpdateParams.FileSearch | null;
/**
* The image generation permission update.
*/
image_generation?: HostedToolPermissionUpdateParams.ImageGeneration | null;
/**
* The MCP permission update.
*/
mcp?: HostedToolPermissionUpdateParams.Mcp | null;
/**
* The web search permission update.
*/
web_search?: HostedToolPermissionUpdateParams.WebSearch | null;
}
export declare namespace HostedToolPermissionUpdateParams {
/**
* The code interpreter permission update.
*/
interface CodeInterpreter {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
/**
* The file search permission update.
*/
interface FileSearch {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
/**
* The image generation permission update.
*/
interface ImageGeneration {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
/**
* The MCP permission update.
*/
interface Mcp {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
/**
* The web search permission update.
*/
interface WebSearch {
/**
* Whether to enable the hosted tool for the project.
*/
enabled: boolean;
}
}
export declare namespace HostedToolPermissions {
export { type ProjectHostedToolPermissions as ProjectHostedToolPermissions, type HostedToolPermissionUpdateParams as HostedToolPermissionUpdateParams, };
}
//# sourceMappingURL=hosted-tool-permissions.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"hosted-tool-permissions.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/hosted-tool-permissions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,wCAAqC;AAC1D,OAAO,EAAE,cAAc,EAAE,gDAA6C;AAGtE,qBAAa,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAO/F;;;;;;;;;;OAUG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,gCAAgC,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;CAO5C;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,gBAAgB,EAAE,4BAA4B,CAAC,eAAe,CAAC;IAE/D;;OAEG;IACH,WAAW,EAAE,4BAA4B,CAAC,UAAU,CAAC;IAErD;;OAEG;IACH,gBAAgB,EAAE,4BAA4B,CAAC,eAAe,CAAC;IAE/D;;OAEG;IACH,GAAG,EAAE,4BAA4B,CAAC,GAAG,CAAC;IAEtC;;OAEG;IACH,UAAU,EAAE,4BAA4B,CAAC,SAAS,CAAC;CACpD;AAED,yBAAiB,4BAA4B,CAAC;IAC5C;;OAEG;IACH,UAA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AC,OAAO,WAAW,qBAAqB,CAAC;IAC7C,OAAO,EACL,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,gCAAgC,IAAI,gCAAgC,GAC1E,CAAC;CACH"}
@@ -0,0 +1,45 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.HostedToolPermissions = void 0;
const resource_1 = require("../../../../core/resource.js");
const path_1 = require("../../../../internal/utils/path.js");
class HostedToolPermissions extends resource_1.APIResource {
/**
* Returns hosted tool permissions for a project.
*
* @example
* ```ts
* const projectHostedToolPermissions =
* await client.admin.organization.projects.hostedToolPermissions.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID, options) {
return this._client.get((0, path_1.path) `/organization/projects/${projectID}/hosted_tool_permissions`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Updates hosted tool permissions for a project.
*
* @example
* ```ts
* const projectHostedToolPermissions =
* await client.admin.organization.projects.hostedToolPermissions.update(
* 'project_id',
* );
* ```
*/
update(projectID, body, options) {
return this._client.post((0, path_1.path) `/organization/projects/${projectID}/hosted_tool_permissions`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
exports.HostedToolPermissions = HostedToolPermissions;
//# sourceMappingURL=hosted-tool-permissions.js.map
@@ -0,0 +1 @@
{"version":3,"file":"hosted-tool-permissions.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/hosted-tool-permissions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAwD;AAGxD,6DAAuD;AAEvD,MAAa,qBAAsB,SAAQ,sBAAW;IACpD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,SAAS,0BAA0B,EAAE;YACzF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,SAAiB,EACjB,IAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,0BAA0B,SAAS,0BAA0B,EAAE;YAC1F,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AAzCD,sDAyCC"}
@@ -0,0 +1,41 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export class HostedToolPermissions extends APIResource {
/**
* Returns hosted tool permissions for a project.
*
* @example
* ```ts
* const projectHostedToolPermissions =
* await client.admin.organization.projects.hostedToolPermissions.retrieve(
* 'project_id',
* );
* ```
*/
retrieve(projectID, options) {
return this._client.get(path `/organization/projects/${projectID}/hosted_tool_permissions`, {
...options,
__security: { adminAPIKeyAuth: true },
});
}
/**
* Updates hosted tool permissions for a project.
*
* @example
* ```ts
* const projectHostedToolPermissions =
* await client.admin.organization.projects.hostedToolPermissions.update(
* 'project_id',
* );
* ```
*/
update(projectID, body, options) {
return this._client.post(path `/organization/projects/${projectID}/hosted_tool_permissions`, {
body,
...options,
__security: { adminAPIKeyAuth: true },
});
}
}
//# sourceMappingURL=hosted-tool-permissions.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"hosted-tool-permissions.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/hosted-tool-permissions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAGxD,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,SAAS,0BAA0B,EAAE;YACzF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,SAAiB,EACjB,IAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,0BAA0B,SAAS,0BAA0B,EAAE;YAC1F,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,13 @@
export { APIKeys, type ProjectAPIKey, type APIKeyDeleteResponse, type APIKeyRetrieveParams, type APIKeyListParams, type APIKeyDeleteParams, type ProjectAPIKeysPage, } from "./api-keys.mjs";
export { Certificates, type CertificateListResponse, type CertificateActivateResponse, type CertificateDeactivateResponse, type CertificateListParams, type CertificateActivateParams, type CertificateDeactivateParams, type CertificateListResponsesPage, type CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage, } from "./certificates.mjs";
export { DataRetention, type ProjectDataRetention, type DataRetentionUpdateParams } from "./data-retention.mjs";
export { Groups, type ProjectGroup, type GroupDeleteResponse, type GroupCreateParams, type GroupRetrieveParams, type GroupListParams, type GroupDeleteParams, type ProjectGroupsPage, } from "./groups/index.mjs";
export { HostedToolPermissions, type ProjectHostedToolPermissions, type HostedToolPermissionUpdateParams, } from "./hosted-tool-permissions.mjs";
export { ModelPermissions, type ProjectModelPermissions, type ProjectModelPermissionsDeleted, type ModelPermissionUpdateParams, } from "./model-permissions.mjs";
export { Projects, type Project, type ProjectCreateParams, type ProjectUpdateParams, type ProjectListParams, type ProjectsPage, } from "./projects.mjs";
export { RateLimits, type ProjectRateLimit, type RateLimitListRateLimitsParams, type RateLimitUpdateRateLimitParams, type ProjectRateLimitsPage, } from "./rate-limits.mjs";
export { Roles, type RoleDeleteResponse, type RoleCreateParams, type RoleRetrieveParams, type RoleUpdateParams, type RoleListParams, type RoleDeleteParams, } from "./roles.mjs";
export { ServiceAccounts, type ProjectServiceAccount, type ServiceAccountCreateResponse, type ServiceAccountDeleteResponse, type ServiceAccountCreateParams, type ServiceAccountRetrieveParams, type ServiceAccountUpdateParams, type ServiceAccountListParams, type ServiceAccountDeleteParams, type ProjectServiceAccountsPage, } from "./service-accounts.mjs";
export { SpendAlerts, type ProjectSpendAlert, type ProjectSpendAlertDeleted, type SpendAlertCreateParams, type SpendAlertRetrieveParams, type SpendAlertUpdateParams, type SpendAlertListParams, type SpendAlertDeleteParams, type ProjectSpendAlertsPage, } from "./spend-alerts.mjs";
export { Users, type ProjectUser, type UserDeleteResponse, type UserCreateParams, type UserRetrieveParams, type UserUpdateParams, type UserListParams, type UserDeleteParams, type ProjectUsersPage, } from "./users/index.mjs";
//# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,uBAAmB;AACpB,OAAO,EACL,YAAY,EACZ,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,GACxC,2BAAuB;AACxB,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,6BAAyB;AAC5G,OAAO,EACL,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,E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K,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,0BAAsB"}
@@ -0,0 +1,13 @@
export { APIKeys, type ProjectAPIKey, type APIKeyDeleteResponse, type APIKeyRetrieveParams, type APIKeyListParams, type APIKeyDeleteParams, type ProjectAPIKeysPage, } from "./api-keys.js";
export { Certificates, type CertificateListResponse, type CertificateActivateResponse, type CertificateDeactivateResponse, type CertificateListParams, type CertificateActivateParams, type CertificateDeactivateParams, type CertificateListResponsesPage, type CertificateActivateResponsesPage, type CertificateDeactivateResponsesPage, } from "./certificates.js";
export { DataRetention, type ProjectDataRetention, type DataRetentionUpdateParams } from "./data-retention.js";
export { Groups, type ProjectGroup, type GroupDeleteResponse, type GroupCreateParams, type GroupRetrieveParams, type GroupListParams, type GroupDeleteParams, type ProjectGroupsPage, } from "./groups/index.js";
export { HostedToolPermissions, type ProjectHostedToolPermissions, type HostedToolPermissionUpdateParams, } from "./hosted-tool-permissions.js";
export { ModelPermissions, type ProjectModelPermissions, type ProjectModelPermissionsDeleted, type ModelPermissionUpdateParams, } from "./model-permissions.js";
export { Projects, type Project, type ProjectCreateParams, type ProjectUpdateParams, type ProjectListParams, type ProjectsPage, } from "./projects.js";
export { RateLimits, type ProjectRateLimit, type RateLimitListRateLimitsParams, type RateLimitUpdateRateLimitParams, type ProjectRateLimitsPage, } from "./rate-limits.js";
export { Roles, type RoleDeleteResponse, type RoleCreateParams, type RoleRetrieveParams, type RoleUpdateParams, type RoleListParams, type RoleDeleteParams, } from "./roles.js";
export { ServiceAccounts, type ProjectServiceAccount, type ServiceAccountCreateResponse, type ServiceAccountDeleteResponse, type ServiceAccountCreateParams, type ServiceAccountRetrieveParams, type ServiceAccountUpdateParams, type ServiceAccountListParams, type ServiceAccountDeleteParams, type ProjectServiceAccountsPage, } from "./service-accounts.js";
export { SpendAlerts, type ProjectSpendAlert, type ProjectSpendAlertDeleted, type SpendAlertCreateParams, type SpendAlertRetrieveParams, type SpendAlertUpdateParams, type SpendAlertListParams, type SpendAlertDeleteParams, type ProjectSpendAlertsPage, } from "./spend-alerts.js";
export { Users, type ProjectUser, type UserDeleteResponse, type UserCreateParams, type UserRetrieveParams, type UserUpdateParams, type UserListParams, type UserDeleteParams, type ProjectUsersPage, } from "./users/index.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,sBAAmB;AACpB,OAAO,EACL,YAAY,EACZ,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,GACxC,0BAAuB;AACxB,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,4BAAyB;AAC5G,OAAO,EACL,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,0BAAuB;AACxB,OAAO,EACL,qBAAqB,EACrB,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,GACtC,qCAAkC;AACnC,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,GACjC,+BAA4B;AAC7B,OAAO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,sBAAmB;AACpB,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,qBAAqB,GAC3B,yBAAsB;AACvB,OAAO,EACL,KAAK,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,mBAAgB;AACjB,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,GAChC,8BAA2B;AAC5B,OAAO,EACL,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC5B,0BAAuB;AACxB,OAAO,EACL,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,yBAAsB"}
@@ -0,0 +1,29 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Users = exports.SpendAlerts = exports.ServiceAccounts = exports.Roles = exports.RateLimits = exports.Projects = exports.ModelPermissions = exports.HostedToolPermissions = exports.Groups = exports.DataRetention = exports.Certificates = exports.APIKeys = void 0;
var api_keys_1 = require("./api-keys.js");
Object.defineProperty(exports, "APIKeys", { enumerable: true, get: function () { return api_keys_1.APIKeys; } });
var certificates_1 = require("./certificates.js");
Object.defineProperty(exports, "Certificates", { enumerable: true, get: function () { return certificates_1.Certificates; } });
var data_retention_1 = require("./data-retention.js");
Object.defineProperty(exports, "DataRetention", { enumerable: true, get: function () { return data_retention_1.DataRetention; } });
var index_1 = require("./groups/index.js");
Object.defineProperty(exports, "Groups", { enumerable: true, get: function () { return index_1.Groups; } });
var hosted_tool_permissions_1 = require("./hosted-tool-permissions.js");
Object.defineProperty(exports, "HostedToolPermissions", { enumerable: true, get: function () { return hosted_tool_permissions_1.HostedToolPermissions; } });
var model_permissions_1 = require("./model-permissions.js");
Object.defineProperty(exports, "ModelPermissions", { enumerable: true, get: function () { return model_permissions_1.ModelPermissions; } });
var projects_1 = require("./projects.js");
Object.defineProperty(exports, "Projects", { enumerable: true, get: function () { return projects_1.Projects; } });
var rate_limits_1 = require("./rate-limits.js");
Object.defineProperty(exports, "RateLimits", { enumerable: true, get: function () { return rate_limits_1.RateLimits; } });
var roles_1 = require("./roles.js");
Object.defineProperty(exports, "Roles", { enumerable: true, get: function () { return roles_1.Roles; } });
var service_accounts_1 = require("./service-accounts.js");
Object.defineProperty(exports, "ServiceAccounts", { enumerable: true, get: function () { return service_accounts_1.ServiceAccounts; } });
var spend_alerts_1 = require("./spend-alerts.js");
Object.defineProperty(exports, "SpendAlerts", { enumerable: true, get: function () { return spend_alerts_1.SpendAlerts; } });
var index_2 = require("./users/index.js");
Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return index_2.Users; } });
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAQoB;AAPlB,mGAAA,OAAO,OAAA;AAQT,kDAWwB;AAVtB,4GAAA,YAAY,OAAA;AAWd,sDAA4G;AAAnG,+GAAA,aAAa,OAAA;AACtB,2CASwB;AARtB,+FAAA,MAAM,OAAA;AASR,wEAImC;AAHjC,gIAAA,qBAAqB,OAAA;AAIvB,4DAK6B;AAJ3B,qHAAA,gBAAgB,OAAA;AAKlB,0CAOoB;AANlB,oGAAA,QAAQ,OAAA;AAOV,gDAMuB;AALrB,yGAAA,UAAU,OAAA;AAMZ,oCAQiB;AAPf,8FAAA,KAAK,OAAA;AAQP,0DAW4B;AAV1B,mHAAA,eAAe,OAAA;AAWjB,kDAUwB;AATtB,2GAAA,WAAW,OAAA;AAUb,0CAUuB;AATrB,8FAAA,KAAK,OAAA"}
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { APIKeys, } from "./api-keys.mjs";
export { Certificates, } from "./certificates.mjs";
export { DataRetention } from "./data-retention.mjs";
export { Groups, } from "./groups/index.mjs";
export { HostedToolPermissions, } from "./hosted-tool-permissions.mjs";
export { ModelPermissions, } from "./model-permissions.mjs";
export { Projects, } from "./projects.mjs";
export { RateLimits, } from "./rate-limits.mjs";
export { Roles, } from "./roles.mjs";
export { ServiceAccounts, } from "./service-accounts.mjs";
export { SpendAlerts, } from "./spend-alerts.mjs";
export { Users, } from "./users/index.mjs";
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/resources/admin/organization/projects/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,OAAO,GAOR,uBAAmB;AACpB,OAAO,EACL,YAAY,GAUb,2BAAuB;AACxB,OAAO,EAAE,aAAa,EAA6D,6BAAyB;AAC5G,OAAO,EACL,MAAM,GAQP,2BAAuB;AACxB,OAAO,EACL,qBAAqB,GAGtB,sCAAkC;AACnC,OAAO,EACL,gBAAgB,GAIjB,gCAA4B;AAC7B,OAAO,EACL,QAAQ,GAMT,uBAAmB;AACpB,OAAO,EACL,UAAU,GAKX,0BAAsB;AACvB,OAAO,EACL,KAAK,GAON,oBAAgB;AACjB,OAAO,EACL,eAAe,GAUhB,+BAA2B;AAC5B,OAAO,EACL,WAAW,GASZ,2BAAuB;AACxB,OAAO,EACL,KAAK,GASN,0BAAsB"}

Some files were not shown because too many files have changed in this diff Show More