@sentdm/sentdm 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +2 -8
- package/client.d.mts +3 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -1
- package/client.js.map +1 -1
- package/client.mjs +7 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/organizations/index.d.mts +2 -2
- package/resources/organizations/index.d.mts.map +1 -1
- package/resources/organizations/index.d.ts +2 -2
- package/resources/organizations/index.d.ts.map +1 -1
- package/resources/organizations/index.js.map +1 -1
- package/resources/organizations/index.mjs +2 -2
- package/resources/organizations/index.mjs.map +1 -1
- package/resources/organizations/organizations.d.mts +2 -55
- package/resources/organizations/organizations.d.mts.map +1 -1
- package/resources/organizations/organizations.d.ts +2 -55
- package/resources/organizations/organizations.d.ts.map +1 -1
- package/resources/organizations/organizations.js +0 -29
- package/resources/organizations/organizations.js.map +1 -1
- package/resources/organizations/organizations.mjs +1 -30
- package/resources/organizations/organizations.mjs.map +1 -1
- package/resources/organizations/users.d.mts +0 -122
- package/resources/organizations/users.d.mts.map +1 -1
- package/resources/organizations/users.d.ts +0 -122
- package/resources/organizations/users.d.ts.map +1 -1
- package/resources/organizations/users.js +0 -86
- package/resources/organizations/users.js.map +1 -1
- package/resources/organizations/users.mjs +0 -86
- package/resources/organizations/users.mjs.map +1 -1
- package/src/client.ts +9 -13
- package/src/resources/index.ts +1 -6
- package/src/resources/organizations/index.ts +2 -16
- package/src/resources/organizations/organizations.ts +2 -103
- package/src/resources/organizations/users.ts +1 -185
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,63 +1,10 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
|
-
import * as OrganizationsAPI from "./organizations.js";
|
|
3
2
|
import * as UsersAPI from "./users.js";
|
|
4
|
-
import {
|
|
5
|
-
import { APIPromise } from "../../core/api-promise.js";
|
|
6
|
-
import { RequestOptions } from "../../internal/request-options.js";
|
|
3
|
+
import { Users } from "./users.js";
|
|
7
4
|
export declare class Organizations extends APIResource {
|
|
8
5
|
users: UsersAPI.Users;
|
|
9
|
-
/**
|
|
10
|
-
* Retrieves all organizations that the authenticated user has access to, including
|
|
11
|
-
* the sender profiles within each organization that the user can access. Returns
|
|
12
|
-
* organization details with nested profiles filtered by user permissions.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const organizations = await client.organizations.list();
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
list(options?: RequestOptions): APIPromise<OrganizationListResponse>;
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves all sender profiles within an organization that the authenticated user
|
|
22
|
-
* has access to. Returns filtered list based on user's permissions.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```ts
|
|
26
|
-
* const response =
|
|
27
|
-
* await client.organizations.retrieveProfiles(
|
|
28
|
-
* '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
|
|
29
|
-
* );
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
retrieveProfiles(orgID: string, options?: RequestOptions): APIPromise<OrganizationRetrieveProfilesResponse>;
|
|
33
|
-
}
|
|
34
|
-
export interface ProfileSummary {
|
|
35
|
-
id?: string;
|
|
36
|
-
createdAt?: string;
|
|
37
|
-
description?: string | null;
|
|
38
|
-
icon?: string | null;
|
|
39
|
-
name?: string;
|
|
40
|
-
shortName?: string | null;
|
|
41
|
-
}
|
|
42
|
-
export interface OrganizationListResponse {
|
|
43
|
-
organizations?: Array<OrganizationListResponse.Organization>;
|
|
44
|
-
}
|
|
45
|
-
export declare namespace OrganizationListResponse {
|
|
46
|
-
interface Organization {
|
|
47
|
-
id?: string;
|
|
48
|
-
createdAt?: string;
|
|
49
|
-
description?: string | null;
|
|
50
|
-
icon?: string | null;
|
|
51
|
-
name?: string;
|
|
52
|
-
profiles?: Array<OrganizationsAPI.ProfileSummary>;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
export interface OrganizationRetrieveProfilesResponse {
|
|
56
|
-
organizationId?: string;
|
|
57
|
-
profiles?: Array<ProfileSummary>;
|
|
58
6
|
}
|
|
59
7
|
export declare namespace Organizations {
|
|
60
|
-
export {
|
|
61
|
-
export { Users as Users, type CustomerUser as CustomerUser, type UserListResponse as UserListResponse, type UserRetrieveParams as UserRetrieveParams, type UserListParams as UserListParams, type UserDeleteParams as UserDeleteParams, type UserInviteParams as UserInviteParams, type UserUpdateRoleParams as UserUpdateRoleParams, };
|
|
8
|
+
export { Users as Users };
|
|
62
9
|
}
|
|
63
10
|
//# sourceMappingURL=organizations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/resources/organizations/organizations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/resources/organizations/organizations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,KAAK,EAAE;AAEhB,qBAAa,aAAc,SAAQ,WAAW;IAC5C,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;CAC1D;AAID,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC;CAC3B"}
|
|
@@ -6,40 +6,11 @@ const tslib_1 = require("../../internal/tslib.js");
|
|
|
6
6
|
const resource_1 = require("../../core/resource.js");
|
|
7
7
|
const UsersAPI = tslib_1.__importStar(require("./users.js"));
|
|
8
8
|
const users_1 = require("./users.js");
|
|
9
|
-
const path_1 = require("../../internal/utils/path.js");
|
|
10
9
|
class Organizations extends resource_1.APIResource {
|
|
11
10
|
constructor() {
|
|
12
11
|
super(...arguments);
|
|
13
12
|
this.users = new UsersAPI.Users(this._client);
|
|
14
13
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves all organizations that the authenticated user has access to, including
|
|
17
|
-
* the sender profiles within each organization that the user can access. Returns
|
|
18
|
-
* organization details with nested profiles filtered by user permissions.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* const organizations = await client.organizations.list();
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
list(options) {
|
|
26
|
-
return this._client.get('/v2/organizations', options);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Retrieves all sender profiles within an organization that the authenticated user
|
|
30
|
-
* has access to. Returns filtered list based on user's permissions.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* const response =
|
|
35
|
-
* await client.organizations.retrieveProfiles(
|
|
36
|
-
* '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
|
|
37
|
-
* );
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
retrieveProfiles(orgID, options) {
|
|
41
|
-
return this._client.get((0, path_1.path) `/v2/organizations/${orgID}/profiles`, options);
|
|
42
|
-
}
|
|
43
14
|
}
|
|
44
15
|
exports.Organizations = Organizations;
|
|
45
16
|
Organizations.Users = users_1.Users;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../src/resources/organizations/organizations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../src/resources/organizations/organizations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6DAAoC;AACpC,sCAAgC;AAEhC,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;CAAA;AAFD,sCAEC;AAED,aAAa,CAAC,KAAK,GAAG,aAAK,CAAC"}
|
|
@@ -1,41 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import * as UsersAPI from "./users.mjs";
|
|
4
|
-
import { Users
|
|
5
|
-
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
import { Users } from "./users.mjs";
|
|
6
5
|
export class Organizations extends APIResource {
|
|
7
6
|
constructor() {
|
|
8
7
|
super(...arguments);
|
|
9
8
|
this.users = new UsersAPI.Users(this._client);
|
|
10
9
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Retrieves all organizations that the authenticated user has access to, including
|
|
13
|
-
* the sender profiles within each organization that the user can access. Returns
|
|
14
|
-
* organization details with nested profiles filtered by user permissions.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* const organizations = await client.organizations.list();
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
list(options) {
|
|
22
|
-
return this._client.get('/v2/organizations', options);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Retrieves all sender profiles within an organization that the authenticated user
|
|
26
|
-
* has access to. Returns filtered list based on user's permissions.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const response =
|
|
31
|
-
* await client.organizations.retrieveProfiles(
|
|
32
|
-
* '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
|
|
33
|
-
* );
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
retrieveProfiles(orgID, options) {
|
|
37
|
-
return this._client.get(path `/v2/organizations/${orgID}/profiles`, options);
|
|
38
|
-
}
|
|
39
10
|
}
|
|
40
11
|
Organizations.Users = Users;
|
|
41
12
|
//# sourceMappingURL=organizations.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.mjs","sourceRoot":"","sources":["../../src/resources/organizations/organizations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"organizations.mjs","sourceRoot":"","sources":["../../src/resources/organizations/organizations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,KAAK,EAAE;AAEhB,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;CAAA;AAED,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC"}
|
|
@@ -1,126 +1,4 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
-
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
-
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
2
|
export declare class Users extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Retrieves a specific user by their ID. Requires appropriate permissions. The
|
|
7
|
-
* customerId can be either an organization ID or a profile ID.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const customerUser =
|
|
12
|
-
* await client.organizations.users.retrieve(
|
|
13
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
14
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
15
|
-
* );
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
retrieve(userID: string, params: UserRetrieveParams, options?: RequestOptions): APIPromise<CustomerUser>;
|
|
19
|
-
/**
|
|
20
|
-
* Retrieves all users associated with an organization or sender profile. Requires
|
|
21
|
-
* appropriate permissions. Supports pagination.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const users = await client.organizations.users.list(
|
|
26
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
27
|
-
* { page: 0, pageSize: 0 },
|
|
28
|
-
* );
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
list(customerID: string, query: UserListParams, options?: RequestOptions): APIPromise<UserListResponse>;
|
|
32
|
-
/**
|
|
33
|
-
* Removes a user from an organization or sender profile. Requires admin
|
|
34
|
-
* permissions. This action permanently deletes the user association.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* await client.organizations.users.delete(
|
|
39
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
40
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
41
|
-
* );
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
delete(userID: string, params: UserDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Invites a user to an organization or sender profile with a specified role.
|
|
47
|
-
* Requires appropriate permissions. The customerId can be either an organization
|
|
48
|
-
* ID or a profile ID.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* const customerUser =
|
|
53
|
-
* await client.organizations.users.invite(
|
|
54
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
55
|
-
* );
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
invite(customerID: string, body: UserInviteParams, options?: RequestOptions): APIPromise<CustomerUser>;
|
|
59
|
-
/**
|
|
60
|
-
* Updates a user's role within an organization or sender profile. Requires admin
|
|
61
|
-
* permissions. Valid roles are: admin, billing, developer.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```ts
|
|
65
|
-
* const customerUser =
|
|
66
|
-
* await client.organizations.users.updateRole(
|
|
67
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
68
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
69
|
-
* );
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
updateRole(userID: string, params: UserUpdateRoleParams, options?: RequestOptions): APIPromise<CustomerUser>;
|
|
73
|
-
}
|
|
74
|
-
export interface CustomerUser {
|
|
75
|
-
/**
|
|
76
|
-
* Unique identifier
|
|
77
|
-
*/
|
|
78
|
-
id?: string;
|
|
79
|
-
createdAt?: string;
|
|
80
|
-
customerId?: string;
|
|
81
|
-
email?: string;
|
|
82
|
-
invitationSentAt?: string | null;
|
|
83
|
-
invitationToken?: string | null;
|
|
84
|
-
invitationTokenExpiresAt?: string | null;
|
|
85
|
-
lastLoginAt?: string | null;
|
|
86
|
-
name?: string;
|
|
87
|
-
role?: string;
|
|
88
|
-
status?: string;
|
|
89
|
-
updatedAt?: string | null;
|
|
90
|
-
}
|
|
91
|
-
export interface UserListResponse {
|
|
92
|
-
page?: number;
|
|
93
|
-
pageSize?: number;
|
|
94
|
-
totalCount?: number;
|
|
95
|
-
users?: Array<CustomerUser>;
|
|
96
|
-
}
|
|
97
|
-
export interface UserRetrieveParams {
|
|
98
|
-
customerId: string;
|
|
99
|
-
}
|
|
100
|
-
export interface UserListParams {
|
|
101
|
-
page: number;
|
|
102
|
-
pageSize: number;
|
|
103
|
-
}
|
|
104
|
-
export interface UserDeleteParams {
|
|
105
|
-
customerId: string;
|
|
106
|
-
}
|
|
107
|
-
export interface UserInviteParams {
|
|
108
|
-
email?: string;
|
|
109
|
-
invitedBy?: string | null;
|
|
110
|
-
name?: string;
|
|
111
|
-
role?: string;
|
|
112
|
-
}
|
|
113
|
-
export interface UserUpdateRoleParams {
|
|
114
|
-
/**
|
|
115
|
-
* Path param
|
|
116
|
-
*/
|
|
117
|
-
customerId: string;
|
|
118
|
-
/**
|
|
119
|
-
* Body param
|
|
120
|
-
*/
|
|
121
|
-
role?: string;
|
|
122
|
-
}
|
|
123
|
-
export declare namespace Users {
|
|
124
|
-
export { type CustomerUser as CustomerUser, type UserListResponse as UserListResponse, type UserRetrieveParams as UserRetrieveParams, type UserListParams as UserListParams, type UserDeleteParams as UserDeleteParams, type UserInviteParams as UserInviteParams, type UserUpdateRoleParams as UserUpdateRoleParams, };
|
|
125
3
|
}
|
|
126
4
|
//# sourceMappingURL=users.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.mts","sourceRoot":"","sources":["../../src/resources/organizations/users.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"users.d.mts","sourceRoot":"","sources":["../../src/resources/organizations/users.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;AAEtB,qBAAa,KAAM,SAAQ,WAAW;CAAG"}
|
|
@@ -1,126 +1,4 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
|
-
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
-
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
2
|
export declare class Users extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Retrieves a specific user by their ID. Requires appropriate permissions. The
|
|
7
|
-
* customerId can be either an organization ID or a profile ID.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const customerUser =
|
|
12
|
-
* await client.organizations.users.retrieve(
|
|
13
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
14
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
15
|
-
* );
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
retrieve(userID: string, params: UserRetrieveParams, options?: RequestOptions): APIPromise<CustomerUser>;
|
|
19
|
-
/**
|
|
20
|
-
* Retrieves all users associated with an organization or sender profile. Requires
|
|
21
|
-
* appropriate permissions. Supports pagination.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const users = await client.organizations.users.list(
|
|
26
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
27
|
-
* { page: 0, pageSize: 0 },
|
|
28
|
-
* );
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
list(customerID: string, query: UserListParams, options?: RequestOptions): APIPromise<UserListResponse>;
|
|
32
|
-
/**
|
|
33
|
-
* Removes a user from an organization or sender profile. Requires admin
|
|
34
|
-
* permissions. This action permanently deletes the user association.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* await client.organizations.users.delete(
|
|
39
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
40
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
41
|
-
* );
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
delete(userID: string, params: UserDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Invites a user to an organization or sender profile with a specified role.
|
|
47
|
-
* Requires appropriate permissions. The customerId can be either an organization
|
|
48
|
-
* ID or a profile ID.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* const customerUser =
|
|
53
|
-
* await client.organizations.users.invite(
|
|
54
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
55
|
-
* );
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
invite(customerID: string, body: UserInviteParams, options?: RequestOptions): APIPromise<CustomerUser>;
|
|
59
|
-
/**
|
|
60
|
-
* Updates a user's role within an organization or sender profile. Requires admin
|
|
61
|
-
* permissions. Valid roles are: admin, billing, developer.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```ts
|
|
65
|
-
* const customerUser =
|
|
66
|
-
* await client.organizations.users.updateRole(
|
|
67
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
68
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
69
|
-
* );
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
updateRole(userID: string, params: UserUpdateRoleParams, options?: RequestOptions): APIPromise<CustomerUser>;
|
|
73
|
-
}
|
|
74
|
-
export interface CustomerUser {
|
|
75
|
-
/**
|
|
76
|
-
* Unique identifier
|
|
77
|
-
*/
|
|
78
|
-
id?: string;
|
|
79
|
-
createdAt?: string;
|
|
80
|
-
customerId?: string;
|
|
81
|
-
email?: string;
|
|
82
|
-
invitationSentAt?: string | null;
|
|
83
|
-
invitationToken?: string | null;
|
|
84
|
-
invitationTokenExpiresAt?: string | null;
|
|
85
|
-
lastLoginAt?: string | null;
|
|
86
|
-
name?: string;
|
|
87
|
-
role?: string;
|
|
88
|
-
status?: string;
|
|
89
|
-
updatedAt?: string | null;
|
|
90
|
-
}
|
|
91
|
-
export interface UserListResponse {
|
|
92
|
-
page?: number;
|
|
93
|
-
pageSize?: number;
|
|
94
|
-
totalCount?: number;
|
|
95
|
-
users?: Array<CustomerUser>;
|
|
96
|
-
}
|
|
97
|
-
export interface UserRetrieveParams {
|
|
98
|
-
customerId: string;
|
|
99
|
-
}
|
|
100
|
-
export interface UserListParams {
|
|
101
|
-
page: number;
|
|
102
|
-
pageSize: number;
|
|
103
|
-
}
|
|
104
|
-
export interface UserDeleteParams {
|
|
105
|
-
customerId: string;
|
|
106
|
-
}
|
|
107
|
-
export interface UserInviteParams {
|
|
108
|
-
email?: string;
|
|
109
|
-
invitedBy?: string | null;
|
|
110
|
-
name?: string;
|
|
111
|
-
role?: string;
|
|
112
|
-
}
|
|
113
|
-
export interface UserUpdateRoleParams {
|
|
114
|
-
/**
|
|
115
|
-
* Path param
|
|
116
|
-
*/
|
|
117
|
-
customerId: string;
|
|
118
|
-
/**
|
|
119
|
-
* Body param
|
|
120
|
-
*/
|
|
121
|
-
role?: string;
|
|
122
|
-
}
|
|
123
|
-
export declare namespace Users {
|
|
124
|
-
export { type CustomerUser as CustomerUser, type UserListResponse as UserListResponse, type UserRetrieveParams as UserRetrieveParams, type UserListParams as UserListParams, type UserDeleteParams as UserDeleteParams, type UserInviteParams as UserInviteParams, type UserUpdateRoleParams as UserUpdateRoleParams, };
|
|
125
3
|
}
|
|
126
4
|
//# sourceMappingURL=users.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/resources/organizations/users.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/resources/organizations/users.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;AAEtB,qBAAa,KAAM,SAAQ,WAAW;CAAG"}
|
|
@@ -3,93 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Users = void 0;
|
|
5
5
|
const resource_1 = require("../../core/resource.js");
|
|
6
|
-
const headers_1 = require("../../internal/headers.js");
|
|
7
|
-
const path_1 = require("../../internal/utils/path.js");
|
|
8
6
|
class Users extends resource_1.APIResource {
|
|
9
|
-
/**
|
|
10
|
-
* Retrieves a specific user by their ID. Requires appropriate permissions. The
|
|
11
|
-
* customerId can be either an organization ID or a profile ID.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* const customerUser =
|
|
16
|
-
* await client.organizations.users.retrieve(
|
|
17
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
18
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
19
|
-
* );
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
retrieve(userID, params, options) {
|
|
23
|
-
const { customerId } = params;
|
|
24
|
-
return this._client.get((0, path_1.path) `/v2/organizations/${customerId}/users/${userID}`, options);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Retrieves all users associated with an organization or sender profile. Requires
|
|
28
|
-
* appropriate permissions. Supports pagination.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```ts
|
|
32
|
-
* const users = await client.organizations.users.list(
|
|
33
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
34
|
-
* { page: 0, pageSize: 0 },
|
|
35
|
-
* );
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
list(customerID, query, options) {
|
|
39
|
-
return this._client.get((0, path_1.path) `/v2/organizations/${customerID}/users`, { query, ...options });
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Removes a user from an organization or sender profile. Requires admin
|
|
43
|
-
* permissions. This action permanently deletes the user association.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```ts
|
|
47
|
-
* await client.organizations.users.delete(
|
|
48
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
49
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
50
|
-
* );
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
delete(userID, params, options) {
|
|
54
|
-
const { customerId } = params;
|
|
55
|
-
return this._client.delete((0, path_1.path) `/v2/organizations/${customerId}/users/${userID}`, {
|
|
56
|
-
...options,
|
|
57
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Invites a user to an organization or sender profile with a specified role.
|
|
62
|
-
* Requires appropriate permissions. The customerId can be either an organization
|
|
63
|
-
* ID or a profile ID.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* const customerUser =
|
|
68
|
-
* await client.organizations.users.invite(
|
|
69
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
70
|
-
* );
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
invite(customerID, body, options) {
|
|
74
|
-
return this._client.post((0, path_1.path) `/v2/organizations/${customerID}/users`, { body, ...options });
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Updates a user's role within an organization or sender profile. Requires admin
|
|
78
|
-
* permissions. Valid roles are: admin, billing, developer.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```ts
|
|
82
|
-
* const customerUser =
|
|
83
|
-
* await client.organizations.users.updateRole(
|
|
84
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
85
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
86
|
-
* );
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
updateRole(userID, params, options) {
|
|
90
|
-
const { customerId, ...body } = params;
|
|
91
|
-
return this._client.put((0, path_1.path) `/v2/organizations/${customerId}/users/${userID}`, { body, ...options });
|
|
92
|
-
}
|
|
93
7
|
}
|
|
94
8
|
exports.Users = Users;
|
|
95
9
|
//# sourceMappingURL=users.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/resources/organizations/users.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/resources/organizations/users.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,MAAa,KAAM,SAAQ,sBAAW;CAAG;AAAzC,sBAAyC"}
|
|
@@ -1,91 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
-
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
|
-
import { path } from "../../internal/utils/path.mjs";
|
|
5
3
|
export class Users extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves a specific user by their ID. Requires appropriate permissions. The
|
|
8
|
-
* customerId can be either an organization ID or a profile ID.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const customerUser =
|
|
13
|
-
* await client.organizations.users.retrieve(
|
|
14
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
15
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
16
|
-
* );
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
retrieve(userID, params, options) {
|
|
20
|
-
const { customerId } = params;
|
|
21
|
-
return this._client.get(path `/v2/organizations/${customerId}/users/${userID}`, options);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Retrieves all users associated with an organization or sender profile. Requires
|
|
25
|
-
* appropriate permissions. Supports pagination.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```ts
|
|
29
|
-
* const users = await client.organizations.users.list(
|
|
30
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
31
|
-
* { page: 0, pageSize: 0 },
|
|
32
|
-
* );
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
list(customerID, query, options) {
|
|
36
|
-
return this._client.get(path `/v2/organizations/${customerID}/users`, { query, ...options });
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Removes a user from an organization or sender profile. Requires admin
|
|
40
|
-
* permissions. This action permanently deletes the user association.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```ts
|
|
44
|
-
* await client.organizations.users.delete(
|
|
45
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
46
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
47
|
-
* );
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
delete(userID, params, options) {
|
|
51
|
-
const { customerId } = params;
|
|
52
|
-
return this._client.delete(path `/v2/organizations/${customerId}/users/${userID}`, {
|
|
53
|
-
...options,
|
|
54
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Invites a user to an organization or sender profile with a specified role.
|
|
59
|
-
* Requires appropriate permissions. The customerId can be either an organization
|
|
60
|
-
* ID or a profile ID.
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```ts
|
|
64
|
-
* const customerUser =
|
|
65
|
-
* await client.organizations.users.invite(
|
|
66
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
67
|
-
* );
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
invite(customerID, body, options) {
|
|
71
|
-
return this._client.post(path `/v2/organizations/${customerID}/users`, { body, ...options });
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Updates a user's role within an organization or sender profile. Requires admin
|
|
75
|
-
* permissions. Valid roles are: admin, billing, developer.
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```ts
|
|
79
|
-
* const customerUser =
|
|
80
|
-
* await client.organizations.users.updateRole(
|
|
81
|
-
* '650e8400-e29b-41d4-a716-446655440000',
|
|
82
|
-
* { customerId: '550e8400-e29b-41d4-a716-446655440000' },
|
|
83
|
-
* );
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
updateRole(userID, params, options) {
|
|
87
|
-
const { customerId, ...body } = params;
|
|
88
|
-
return this._client.put(path `/v2/organizations/${customerId}/users/${userID}`, { body, ...options });
|
|
89
|
-
}
|
|
90
4
|
}
|
|
91
5
|
//# sourceMappingURL=users.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.mjs","sourceRoot":"","sources":["../../src/resources/organizations/users.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"users.mjs","sourceRoot":"","sources":["../../src/resources/organizations/users.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAEtB,MAAM,OAAO,KAAM,SAAQ,WAAW;CAAG"}
|