@terros-inc/sdk 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1028 -0
- package/dist/index.mjs +222 -0
- package/package.json +8 -4
- package/dist/analytics.d.ts +0 -8
- package/dist/analytics.js +0 -22
- package/dist/apiCaller.d.ts +0 -12
- package/dist/apiCaller.js +0 -44
- package/dist/client.d.ts +0 -8
- package/dist/client.js +0 -13
- package/dist/client.test.d.ts +0 -1
- package/dist/client.test.js +0 -81
- package/dist/clients/account.d.ts +0 -24
- package/dist/clients/account.js +0 -53
- package/dist/clients/calendar.d.ts +0 -21
- package/dist/clients/calendar.js +0 -44
- package/dist/clients/index.d.ts +0 -3
- package/dist/clients/index.js +0 -3
- package/dist/clients/user.d.ts +0 -18
- package/dist/clients/user.js +0 -42
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/models/account/api.d.ts +0 -167
- package/dist/models/account/api.js +0 -1
- package/dist/models/account/index.d.ts +0 -2
- package/dist/models/account/index.js +0 -2
- package/dist/models/account/model.d.ts +0 -219
- package/dist/models/account/model.js +0 -1
- package/dist/models/calendar/api.d.ts +0 -122
- package/dist/models/calendar/api.js +0 -1
- package/dist/models/calendar/index.d.ts +0 -2
- package/dist/models/calendar/index.js +0 -2
- package/dist/models/calendar/model.d.ts +0 -83
- package/dist/models/calendar/model.js +0 -1
- package/dist/models/company/index.d.ts +0 -1
- package/dist/models/company/index.js +0 -1
- package/dist/models/company/model.d.ts +0 -37
- package/dist/models/company/model.js +0 -1
- package/dist/models/index.d.ts +0 -7
- package/dist/models/index.js +0 -7
- package/dist/models/location/index.d.ts +0 -1
- package/dist/models/location/index.js +0 -1
- package/dist/models/location/model.d.ts +0 -21
- package/dist/models/location/model.js +0 -1
- package/dist/models/shared.d.ts +0 -32
- package/dist/models/shared.js +0 -6
- package/dist/models/team/index.d.ts +0 -1
- package/dist/models/team/index.js +0 -1
- package/dist/models/team/model.d.ts +0 -17
- package/dist/models/team/model.js +0 -1
- package/dist/models/user/api.d.ts +0 -111
- package/dist/models/user/api.js +0 -1
- package/dist/models/user/index.d.ts +0 -2
- package/dist/models/user/index.js +0 -2
- package/dist/models/user/model.d.ts +0 -179
- package/dist/models/user/model.js +0 -1
package/dist/models/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './model';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './model';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type LatLng = {
|
|
2
|
-
latitude: number;
|
|
3
|
-
longitude: number;
|
|
4
|
-
};
|
|
5
|
-
export type Address = {
|
|
6
|
-
country: 'US' | 'CA' | 'PR';
|
|
7
|
-
countrySubd: string;
|
|
8
|
-
line1: string;
|
|
9
|
-
line2: string;
|
|
10
|
-
locality: string;
|
|
11
|
-
oneLine: string;
|
|
12
|
-
postal1: string;
|
|
13
|
-
postal2?: string;
|
|
14
|
-
postal3?: string;
|
|
15
|
-
unitNbr?: string;
|
|
16
|
-
};
|
|
17
|
-
export type SmallAddress = Pick<Address, 'countrySubd' | 'line1' | 'locality' | 'postal1' | 'postal2' | 'postal3' | 'unitNbr'> & {
|
|
18
|
-
line2?: string;
|
|
19
|
-
oneLine?: string;
|
|
20
|
-
latlng: LatLng;
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/models/shared.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { UserId } from './user';
|
|
2
|
-
/** A Connect API route string, e.g. "user/get" or "account/status/add". */
|
|
3
|
-
export type ApiRoute = string;
|
|
4
|
-
export type ApiSuccess<T = unknown> = {
|
|
5
|
-
type: 'success';
|
|
6
|
-
} & T;
|
|
7
|
-
export type ResponseError = {
|
|
8
|
-
type: 'error';
|
|
9
|
-
error: string;
|
|
10
|
-
message?: string;
|
|
11
|
-
retry?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export type ResponseOutput = ApiSuccess | ResponseError;
|
|
14
|
-
export declare function isResponseError(response: unknown): response is ResponseError;
|
|
15
|
-
export type CustomFieldMap = Record<string, string | number | boolean | null>;
|
|
16
|
-
export type AuditLog = {
|
|
17
|
-
userId: UserId;
|
|
18
|
-
timestamp: number;
|
|
19
|
-
updateProcess?: string;
|
|
20
|
-
};
|
|
21
|
-
export type AuditProps = {
|
|
22
|
-
modifiedBy?: AuditLog[];
|
|
23
|
-
/** @deprecated */
|
|
24
|
-
createdAt?: number;
|
|
25
|
-
/** @deprecated */
|
|
26
|
-
createdBy?: UserId;
|
|
27
|
-
updatedAt?: number;
|
|
28
|
-
/** @deprecated */
|
|
29
|
-
updatedBy?: UserId;
|
|
30
|
-
lastUpdateProcess?: string;
|
|
31
|
-
version?: number;
|
|
32
|
-
};
|
package/dist/models/shared.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './model';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './model';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TeamId } from '../user';
|
|
2
|
-
export type TinyTeam = {
|
|
3
|
-
teamId: TeamId;
|
|
4
|
-
name: string;
|
|
5
|
-
parentId?: TeamId;
|
|
6
|
-
isDeleted?: boolean;
|
|
7
|
-
externalId?: string;
|
|
8
|
-
avatarBlurhash?: string;
|
|
9
|
-
avatarUrl?: string;
|
|
10
|
-
restrictVisibility?: boolean;
|
|
11
|
-
level: number;
|
|
12
|
-
meetingTimes?: {
|
|
13
|
-
day: number;
|
|
14
|
-
start: number;
|
|
15
|
-
end: number;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import type { ApiSuccess } from '../shared';
|
|
2
|
-
import type { CompanyData, CompanyId } from '../company';
|
|
3
|
-
import type { CloserStatus, EntityId, RoleId, SmallCloser, SmallUser, TeamId, TinyUser, UnsavedUser, UserData, UserId, UserIdentifier, UserProfileData } from './model';
|
|
4
|
-
export type UserListInput = {
|
|
5
|
-
showArchived?: true | false | 'all';
|
|
6
|
-
companyId?: CompanyId;
|
|
7
|
-
teamId?: TeamId;
|
|
8
|
-
userIds?: UserId[];
|
|
9
|
-
showBeta?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export type UserListSuccess = ApiSuccess<{
|
|
12
|
-
users: SmallUser[];
|
|
13
|
-
}>;
|
|
14
|
-
export type UserAddInput = {
|
|
15
|
-
user: UnsavedUser & {
|
|
16
|
-
userId?: UserId;
|
|
17
|
-
};
|
|
18
|
-
teamMemberships?: {
|
|
19
|
-
teamId: TeamId;
|
|
20
|
-
roleIds?: RoleId[];
|
|
21
|
-
}[];
|
|
22
|
-
directRoles?: RoleId[];
|
|
23
|
-
};
|
|
24
|
-
export type UserAddSuccess = ApiSuccess<{
|
|
25
|
-
user: UserProfileData;
|
|
26
|
-
password?: string;
|
|
27
|
-
}>;
|
|
28
|
-
export type UserUpdateInput = {
|
|
29
|
-
user: Partial<UserProfileData>;
|
|
30
|
-
};
|
|
31
|
-
export type UserUpdateSuccess = ApiSuccess<{
|
|
32
|
-
user: UserProfileData;
|
|
33
|
-
}>;
|
|
34
|
-
export type UserBulkUpdateInput = {
|
|
35
|
-
entityIds: EntityId[];
|
|
36
|
-
operation: {
|
|
37
|
-
type: 'invalidateCloserSettings';
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export type UserBulkUpdateSuccess = ApiSuccess<{
|
|
41
|
-
updatedCount: number;
|
|
42
|
-
}>;
|
|
43
|
-
export type UserRemoveInput = {
|
|
44
|
-
archive?: boolean;
|
|
45
|
-
userId: UserIdentifier;
|
|
46
|
-
} | {
|
|
47
|
-
archive?: boolean;
|
|
48
|
-
userIds: UserId[];
|
|
49
|
-
};
|
|
50
|
-
export type UserGetInput = {
|
|
51
|
-
/** User ID, email, or clientUserId. Defaults to the current user if not provided. */
|
|
52
|
-
userId?: UserIdentifier;
|
|
53
|
-
};
|
|
54
|
-
export type UserGetSuccess = ApiSuccess<{
|
|
55
|
-
user: UserData;
|
|
56
|
-
}>;
|
|
57
|
-
export type UserProfileInput = {
|
|
58
|
-
userId?: string;
|
|
59
|
-
};
|
|
60
|
-
export type UserProfileSuccess = ApiSuccess<{
|
|
61
|
-
user: UserProfileData;
|
|
62
|
-
company: CompanyData;
|
|
63
|
-
}>;
|
|
64
|
-
export type UserSearchInput = {
|
|
65
|
-
archived?: true | false | 'all';
|
|
66
|
-
companyId?: CompanyId;
|
|
67
|
-
query: string;
|
|
68
|
-
teamIds?: TeamId[];
|
|
69
|
-
closerStatus?: CloserStatus[];
|
|
70
|
-
options?: {
|
|
71
|
-
/** Show the first 20 users from your downline. */
|
|
72
|
-
downline?: boolean;
|
|
73
|
-
size?: number;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
export type UserSearchSuccess = ApiSuccess<{
|
|
77
|
-
users: TinyUser[];
|
|
78
|
-
}>;
|
|
79
|
-
export type UserTimezoneInput = {
|
|
80
|
-
timeZone: string;
|
|
81
|
-
};
|
|
82
|
-
export type UserReportInput = {
|
|
83
|
-
userId?: UserId;
|
|
84
|
-
};
|
|
85
|
-
export type UserReportSuccess = ApiSuccess<{
|
|
86
|
-
manager?: TinyUser;
|
|
87
|
-
managers: TinyUser[];
|
|
88
|
-
members: TinyUser[];
|
|
89
|
-
directReports: TinyUser[];
|
|
90
|
-
}>;
|
|
91
|
-
export type UserClosersInput = {
|
|
92
|
-
/**
|
|
93
|
-
* CompanyId: all closers in the company.
|
|
94
|
-
* TeamId: all closers from the highest relevant parent team and its downline.
|
|
95
|
-
* TeamId + direct: all closers directly on the team.
|
|
96
|
-
* UserId: the target user's closer settings.
|
|
97
|
-
* Omitted: all closers from the user's teams, their highest relevant parent team, and its downline.
|
|
98
|
-
*/
|
|
99
|
-
entityId?: EntityId;
|
|
100
|
-
direct?: boolean;
|
|
101
|
-
};
|
|
102
|
-
export type UserClosersSuccess = ApiSuccess<{
|
|
103
|
-
closers: SmallCloser[];
|
|
104
|
-
}>;
|
|
105
|
-
export type UserManagerInput = {
|
|
106
|
-
userId?: UserId;
|
|
107
|
-
};
|
|
108
|
-
export type UserManagerSuccess = ApiSuccess<{
|
|
109
|
-
possibleManagers: TinyUser[];
|
|
110
|
-
primaryManager?: TinyUser;
|
|
111
|
-
}>;
|
package/dist/models/user/api.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import type { TinyTeam } from '../team';
|
|
2
|
-
import type { AuditProps, CustomFieldMap } from '../shared';
|
|
3
|
-
import type { Address } from '../location';
|
|
4
|
-
import type { CompanyId } from '../company';
|
|
5
|
-
export type UserId = `U:${string}` | `U.${string}`;
|
|
6
|
-
export type TeamId = `Team:${string}` | `Team.${string}`;
|
|
7
|
-
export type RoleId = `Role.${string}`;
|
|
8
|
-
/** A user ID, email, or clientUserId. */
|
|
9
|
-
export type UserIdentifier = string;
|
|
10
|
-
export type CloserStatus = 'None' | 'Needs_Help' | 'Can_Close' | 'Can_Help' | 'Closer_Only';
|
|
11
|
-
export type TinyRole = {
|
|
12
|
-
roleId: RoleId;
|
|
13
|
-
roleType: 'admin' | 'manager' | 'recruit' | null;
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
16
|
-
export type TinyUser = {
|
|
17
|
-
userId: UserId;
|
|
18
|
-
clientUserId?: string;
|
|
19
|
-
firstName: string;
|
|
20
|
-
lastName: string;
|
|
21
|
-
preferredName?: string;
|
|
22
|
-
avatarBlurhash?: string;
|
|
23
|
-
avatarUrl?: string;
|
|
24
|
-
lastAccess?: number;
|
|
25
|
-
isDeleted?: boolean;
|
|
26
|
-
color?: string;
|
|
27
|
-
};
|
|
28
|
-
export type SmallUser = TinyUser & {
|
|
29
|
-
email: string;
|
|
30
|
-
phone?: string;
|
|
31
|
-
title?: string;
|
|
32
|
-
timeZone?: string;
|
|
33
|
-
teamIds?: TeamId[];
|
|
34
|
-
closerStatus?: CloserStatus;
|
|
35
|
-
roles?: TinyRole[];
|
|
36
|
-
memberOf?: Pick<TinyTeam, 'teamId' | 'name'>[];
|
|
37
|
-
companyId?: CompanyId;
|
|
38
|
-
};
|
|
39
|
-
export type Weekday = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
|
|
40
|
-
export type CloserSettings = {
|
|
41
|
-
order?: number;
|
|
42
|
-
taskLockout?: boolean;
|
|
43
|
-
bookingPercent?: number;
|
|
44
|
-
meetingDuration?: number;
|
|
45
|
-
timeBetweenAppointments?: number;
|
|
46
|
-
serviceCenter?: {
|
|
47
|
-
latitude: number;
|
|
48
|
-
longitude: number;
|
|
49
|
-
};
|
|
50
|
-
serviceRadius?: number;
|
|
51
|
-
minimumNotice?: number;
|
|
52
|
-
maximumNotice?: number;
|
|
53
|
-
timeslots?: Partial<Record<Weekday, number[]>>;
|
|
54
|
-
excludes?: number[];
|
|
55
|
-
includes?: number[];
|
|
56
|
-
lastUpdatedDate?: number;
|
|
57
|
-
};
|
|
58
|
-
export type TinyCloser = {
|
|
59
|
-
user: TinyUser;
|
|
60
|
-
times: {
|
|
61
|
-
startTime: number;
|
|
62
|
-
duration: number;
|
|
63
|
-
}[];
|
|
64
|
-
};
|
|
65
|
-
export type SmallCloser = TinyUser & CloserSettings & {
|
|
66
|
-
timezone: string;
|
|
67
|
-
};
|
|
68
|
-
export type AvailableCloser = TinyUser & {
|
|
69
|
-
inServiceArea?: boolean;
|
|
70
|
-
available: boolean;
|
|
71
|
-
locked?: boolean;
|
|
72
|
-
unavailableReason?: string;
|
|
73
|
-
};
|
|
74
|
-
type UserScope = {
|
|
75
|
-
entity: 'self' | 'company' | 'withinRestrictions' | 'none';
|
|
76
|
-
} | {
|
|
77
|
-
entity: 'downline';
|
|
78
|
-
entityId: UserId | TeamId;
|
|
79
|
-
};
|
|
80
|
-
type PermissionEntityId = EntityId | RoleId;
|
|
81
|
-
type ScopeWithSource = UserScope & AuditProps & {
|
|
82
|
-
source: PermissionEntityId;
|
|
83
|
-
};
|
|
84
|
-
type PermissionType = string;
|
|
85
|
-
/** A reduced view of a user's permission overrides, keyed by permission type. */
|
|
86
|
-
export type PermissionMap = Partial<Record<PermissionType, ScopeWithSource[]>>;
|
|
87
|
-
export type NotificationPreference = {
|
|
88
|
-
push?: boolean;
|
|
89
|
-
email?: boolean;
|
|
90
|
-
};
|
|
91
|
-
export type UserPreferences = Partial<Record<string, NotificationPreference>>;
|
|
92
|
-
export type UnsavedUser = {
|
|
93
|
-
isDeleted?: boolean;
|
|
94
|
-
importId?: string;
|
|
95
|
-
phone?: string;
|
|
96
|
-
firstName: string;
|
|
97
|
-
lastName: string;
|
|
98
|
-
preferredName?: string;
|
|
99
|
-
email: string;
|
|
100
|
-
timeZone?: string;
|
|
101
|
-
clientUserId?: string;
|
|
102
|
-
title?: string;
|
|
103
|
-
closerStatus?: CloserStatus;
|
|
104
|
-
companyId?: CompanyId;
|
|
105
|
-
managerId?: UserId;
|
|
106
|
-
hasManager?: boolean;
|
|
107
|
-
selfReportedManager?: {
|
|
108
|
-
managerId?: UserId;
|
|
109
|
-
updatedAt: number;
|
|
110
|
-
};
|
|
111
|
-
primaryTeam?: {
|
|
112
|
-
teamId: TeamId;
|
|
113
|
-
staleAfter: number;
|
|
114
|
-
};
|
|
115
|
-
betaProgram?: boolean;
|
|
116
|
-
language?: string;
|
|
117
|
-
secondaryLanguages?: string[];
|
|
118
|
-
color?: string;
|
|
119
|
-
superuserScore?: number;
|
|
120
|
-
customFields?: CustomFieldMap;
|
|
121
|
-
accountId?: string;
|
|
122
|
-
whitelist?: boolean;
|
|
123
|
-
closer?: CloserSettings;
|
|
124
|
-
};
|
|
125
|
-
export type UserTeamsByLevel = {
|
|
126
|
-
team1?: TinyTeam[];
|
|
127
|
-
team2?: TinyTeam[];
|
|
128
|
-
team3?: TinyTeam[];
|
|
129
|
-
team4?: TinyTeam[];
|
|
130
|
-
team5?: TinyTeam[];
|
|
131
|
-
team6?: TinyTeam[];
|
|
132
|
-
team7?: TinyTeam[];
|
|
133
|
-
team8?: TinyTeam[];
|
|
134
|
-
groups: TinyTeam[];
|
|
135
|
-
};
|
|
136
|
-
export type UserTeamData = UserTeamsByLevel & {
|
|
137
|
-
manages: TeamId[];
|
|
138
|
-
directMemberOf: TinyTeam[];
|
|
139
|
-
memberOf: TinyTeam[];
|
|
140
|
-
managers: TinyUser[];
|
|
141
|
-
manager?: TinyUser;
|
|
142
|
-
};
|
|
143
|
-
export type UserData = UnsavedUser & {
|
|
144
|
-
lastAccess?: number;
|
|
145
|
-
avatarBlurhash?: string;
|
|
146
|
-
avatarUrl?: string;
|
|
147
|
-
userId: UserId;
|
|
148
|
-
companyId: CompanyId;
|
|
149
|
-
firstAccess?: number;
|
|
150
|
-
startDate?: number;
|
|
151
|
-
clientTeamId?: string;
|
|
152
|
-
teams?: UserTeamData;
|
|
153
|
-
roles?: TinyRole[];
|
|
154
|
-
biography?: string;
|
|
155
|
-
notificationPrefs?: UserPreferences;
|
|
156
|
-
agreeToTerms?: number;
|
|
157
|
-
agreeToLicensing?: number;
|
|
158
|
-
agreeToAITraining?: boolean;
|
|
159
|
-
};
|
|
160
|
-
export type UserProfileData = UserData & {
|
|
161
|
-
createdAt?: number;
|
|
162
|
-
createdBy?: UserId;
|
|
163
|
-
updatedAt?: number;
|
|
164
|
-
updatedBy?: UserId;
|
|
165
|
-
permissionMap?: PermissionMap;
|
|
166
|
-
mailingAddress?: Address;
|
|
167
|
-
shoeSize?: string;
|
|
168
|
-
shirtSize?: string;
|
|
169
|
-
birth?: {
|
|
170
|
-
month?: number;
|
|
171
|
-
day?: number;
|
|
172
|
-
};
|
|
173
|
-
uploadAvatarUrl?: string;
|
|
174
|
-
closerIds?: UserId[];
|
|
175
|
-
directRoles?: TinyRole[];
|
|
176
|
-
};
|
|
177
|
-
/** Every entity type that can own users/teams in bulk operations. */
|
|
178
|
-
export type EntityId = UserId | TeamId | CompanyId;
|
|
179
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|