rotacloud 2.3.7 → 2.3.11
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/endpoint.d.ts +3 -0
- package/dist/interfaces/account-subscription.interface.d.ts +8 -4
- package/dist/interfaces/onboarding.interface.d.ts +22 -0
- package/dist/interfaces/onboarding.interface.js +1 -0
- package/dist/interfaces/sdk-config.interface.d.ts +1 -0
- package/dist/main.d.ts +19 -0
- package/dist/ops.d.ts +2 -2
- package/dist/service.d.ts +20 -0
- package/dist/service.js +31 -0
- package/package.json +2 -2
- package/src/endpoint.ts +3 -0
- package/src/interfaces/account-subscription.interface.ts +9 -4
- package/src/interfaces/onboarding.interface.ts +25 -0
- package/src/interfaces/sdk-config.interface.ts +1 -0
- package/src/service.ts +35 -0
package/dist/endpoint.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Message } from './interfaces/message.interface.js';
|
|
|
4
4
|
import { AttendanceQueryParams, AvailabilityQueryParams, DailyBudgetsQueryParams, DailyRevenueQueryParams, DayNotesQueryParams, DaysOffQueryParams, DocumentsQueryParams, GroupsQueryParams, LeaveEmbargoesQueryParams, LeaveQueryParams, LeaveRequestsQueryParams, LocationsQueryParams, RolesQueryParams, SettingsQueryParams, ShiftsQueryParams, TerminalsQueryParams, ToilAccrualsQueryParams, ToilAllowanceQueryParams, UsersQueryParams } from './interfaces/query-params/index.js';
|
|
5
5
|
import { RequirementsOf } from './utils.js';
|
|
6
6
|
import { Invoice, InvoiceQueryParameters } from './interfaces/invoice.interface.js';
|
|
7
|
+
import { UpdateUserWithOnboardingInfo } from './interfaces/onboarding.interface.js';
|
|
7
8
|
/** Endpoint versions supported by the API */
|
|
8
9
|
export type EndpointVersion = 'v1' | 'v2';
|
|
9
10
|
/** Associated types for a given API endpoint */
|
|
@@ -63,5 +64,7 @@ export interface EndpointEntityMap extends Record<EndpointVersion, Record<string
|
|
|
63
64
|
users: RequirementsOf<PartialUserV2, 'firstName' | 'lastName' | 'roles'>[];
|
|
64
65
|
sendInvite?: boolean;
|
|
65
66
|
}>;
|
|
67
|
+
'users/onboard': Endpoint<void, number, UpdateUserWithOnboardingInfo>;
|
|
68
|
+
'users/onboard/resend': Endpoint<void, number>;
|
|
66
69
|
};
|
|
67
70
|
}
|
|
@@ -126,11 +126,15 @@ export interface EstimatesReq {
|
|
|
126
126
|
addons?: UpdatedAddon[];
|
|
127
127
|
paymentFrequency: 'monthly' | 'yearly';
|
|
128
128
|
}
|
|
129
|
-
export interface
|
|
130
|
-
paymentFrequency: 'monthly' | 'yearly';
|
|
129
|
+
export interface Estimate {
|
|
131
130
|
subTotal: number;
|
|
132
|
-
chargedImmediately: number;
|
|
133
131
|
creditsApplied: number;
|
|
134
|
-
quantity: number;
|
|
135
132
|
lineItems: EstimateLineItem[];
|
|
136
133
|
}
|
|
134
|
+
export interface EstimatesRes {
|
|
135
|
+
paymentFrequency: 'monthly' | 'yearly';
|
|
136
|
+
quantity: number;
|
|
137
|
+
immediateEstimates: Estimate;
|
|
138
|
+
nextEstimates: Estimate;
|
|
139
|
+
nextBillingDate: string;
|
|
140
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RequirementsOf } from '../utils.js';
|
|
2
|
+
import { User } from './user.interface.js';
|
|
3
|
+
export interface UpdateUserWithOnboardingInfo {
|
|
4
|
+
title: string;
|
|
5
|
+
gender: string;
|
|
6
|
+
dob: string;
|
|
7
|
+
nationalInsuranceNumber?: string;
|
|
8
|
+
address1: string;
|
|
9
|
+
address2: string;
|
|
10
|
+
county: string;
|
|
11
|
+
phone: string;
|
|
12
|
+
postcode: string;
|
|
13
|
+
city: string;
|
|
14
|
+
emergencyContactName: string;
|
|
15
|
+
emergencyContactPhone: string;
|
|
16
|
+
emergencyContactRelationship: string;
|
|
17
|
+
}
|
|
18
|
+
export type PendingV1User = RequirementsOf<User, 'first_name' | 'last_name' | 'locations' | 'email'>;
|
|
19
|
+
export interface AddOrOnboard {
|
|
20
|
+
users: PendingV1User[];
|
|
21
|
+
locations: number[];
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/main.d.ts
CHANGED
|
@@ -250,4 +250,23 @@ export declare const createRotaCloudClient: (config: import("./interfaces/sdk-co
|
|
|
250
250
|
}) => import("./ops.js").RequestConfig<typeof userSpec, import("./interfaces/user-v2.interface.js").CreateUserResponse>;
|
|
251
251
|
};
|
|
252
252
|
};
|
|
253
|
+
onboarding: {
|
|
254
|
+
endpoint: "users/onboard";
|
|
255
|
+
endpointVersion: "v2";
|
|
256
|
+
operations: ("create" | "update")[];
|
|
257
|
+
customOperations: {
|
|
258
|
+
update: ({ request, service }: import("./ops.js").OperationContext, onboardingInfoForm: import("./interfaces/onboarding.interface.js").UpdateUserWithOnboardingInfo) => import("./ops.js").RequestConfig<typeof onboardingInfoForm, void>;
|
|
259
|
+
create: ({ request, service }: import("./ops.js").OperationContext, addOrOnboard: import("./interfaces/onboarding.interface.js").AddOrOnboard) => import("./ops.js").RequestConfig<typeof addOrOnboard, void>;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
resendOnboardingLink: {
|
|
263
|
+
endpoint: "users/onboard/resend";
|
|
264
|
+
endpointVersion: "v2";
|
|
265
|
+
operations: "create"[];
|
|
266
|
+
customOperations: {
|
|
267
|
+
create: ({ request, service }: import("./ops.js").OperationContext, entity: {
|
|
268
|
+
id: number;
|
|
269
|
+
}) => import("./ops.js").RequestConfig<void, void>;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
253
272
|
}>;
|
package/dist/ops.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ export declare function getOpMap<E extends Endpoint<any, any>, T extends E['type
|
|
|
166
166
|
}) | undefined) => Promise<T[]>;
|
|
167
167
|
listByPage: (ctx: OperationContext, query: E["queryParameters"], opts?: (RequestOptions<T[]> & {
|
|
168
168
|
offset?: number;
|
|
169
|
-
}) | undefined) => AsyncGenerator<AxiosResponse<T[], any>, any, any>;
|
|
169
|
+
}) | undefined) => AsyncGenerator<AxiosResponse<T[], any, {}>, any, any>;
|
|
170
170
|
create: (ctx: OperationContext, newEntity: E["createType"]) => RequestConfig<E["createType"], T>;
|
|
171
171
|
update: (ctx: OperationContext, entity: T extends {
|
|
172
172
|
id: number;
|
|
@@ -189,7 +189,7 @@ export declare function getOpMap<E extends Endpoint<any, any>, T extends E['type
|
|
|
189
189
|
deleteBatch: typeof deleteBatchOp;
|
|
190
190
|
list: (ctx: OperationContext, query: E["queryParameters"], opts?: RequestOptions<T[]> | undefined) => AsyncGenerator<T, any, any>;
|
|
191
191
|
listAll: (ctx: OperationContext, query: E["queryParameters"], opts?: RequestOptions<T[]> | undefined) => Promise<T[]>;
|
|
192
|
-
listByPage: (ctx: OperationContext, query: E["queryParameters"], opts?: RequestOptions<T[]> | undefined) => AsyncGenerator<AxiosResponse<PagedResponse<T>, any>, any, any>;
|
|
192
|
+
listByPage: (ctx: OperationContext, query: E["queryParameters"], opts?: RequestOptions<T[]> | undefined) => AsyncGenerator<AxiosResponse<PagedResponse<T>, any, {}>, any, any>;
|
|
193
193
|
create: (ctx: OperationContext, newEntity: E["createType"]) => RequestConfig<E["createType"], T>;
|
|
194
194
|
update: (ctx: OperationContext, entity: T extends {
|
|
195
195
|
id: number;
|
package/dist/service.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { LogbookEntry, LogbookQueryParameters } from './interfaces/logbook.inter
|
|
|
11
11
|
import { Message } from './interfaces/message.interface.js';
|
|
12
12
|
import { Invoice, InvoiceDownload } from './interfaces/invoice.interface.js';
|
|
13
13
|
import { CreateUserRequest, CreateUserResponse } from './interfaces/user-v2.interface.js';
|
|
14
|
+
import { AddOrOnboard, UpdateUserWithOnboardingInfo } from './interfaces/onboarding.interface.js';
|
|
14
15
|
export type ServiceSpecification<CustomOp extends OpDef<unknown> = OpDef<any>> = {
|
|
15
16
|
/** Operations allowed and usable for the endpoint */
|
|
16
17
|
operations: Operation[];
|
|
@@ -294,4 +295,23 @@ export declare const SERVICES: {
|
|
|
294
295
|
}) => RequestConfig<typeof userSpec, CreateUserResponse>;
|
|
295
296
|
};
|
|
296
297
|
};
|
|
298
|
+
onboarding: {
|
|
299
|
+
endpoint: "users/onboard";
|
|
300
|
+
endpointVersion: "v2";
|
|
301
|
+
operations: ("create" | "update")[];
|
|
302
|
+
customOperations: {
|
|
303
|
+
update: ({ request, service }: OperationContext, onboardingInfoForm: UpdateUserWithOnboardingInfo) => RequestConfig<typeof onboardingInfoForm, void>;
|
|
304
|
+
create: ({ request, service }: OperationContext, addOrOnboard: AddOrOnboard) => RequestConfig<typeof addOrOnboard, void>;
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
resendOnboardingLink: {
|
|
308
|
+
endpoint: "users/onboard/resend";
|
|
309
|
+
endpointVersion: "v2";
|
|
310
|
+
operations: "create"[];
|
|
311
|
+
customOperations: {
|
|
312
|
+
create: ({ request, service }: OperationContext, entity: {
|
|
313
|
+
id: number;
|
|
314
|
+
}) => RequestConfig<void, void>;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
297
317
|
};
|
package/dist/service.js
CHANGED
|
@@ -394,4 +394,35 @@ export const SERVICES = {
|
|
|
394
394
|
}),
|
|
395
395
|
},
|
|
396
396
|
},
|
|
397
|
+
onboarding: {
|
|
398
|
+
endpoint: 'users/onboard',
|
|
399
|
+
endpointVersion: 'v2',
|
|
400
|
+
operations: ['update', 'create'],
|
|
401
|
+
customOperations: {
|
|
402
|
+
update: ({ request, service }, onboardingInfoForm) => ({
|
|
403
|
+
...request,
|
|
404
|
+
url: `${service.endpointVersion}/${service.endpoint}`,
|
|
405
|
+
method: 'PATCH',
|
|
406
|
+
data: onboardingInfoForm,
|
|
407
|
+
}),
|
|
408
|
+
create: ({ request, service }, addOrOnboard) => ({
|
|
409
|
+
...request,
|
|
410
|
+
url: `${service.endpointVersion}/${service.endpoint}`,
|
|
411
|
+
method: 'POST',
|
|
412
|
+
data: addOrOnboard,
|
|
413
|
+
}),
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
resendOnboardingLink: {
|
|
417
|
+
endpoint: 'users/onboard/resend',
|
|
418
|
+
endpointVersion: 'v2',
|
|
419
|
+
operations: ['create'],
|
|
420
|
+
customOperations: {
|
|
421
|
+
create: ({ request, service }, entity) => ({
|
|
422
|
+
...request,
|
|
423
|
+
url: `${service.endpointVersion}/${service.endpoint}/${entity.id}/resend`,
|
|
424
|
+
method: 'POST',
|
|
425
|
+
}),
|
|
426
|
+
},
|
|
427
|
+
},
|
|
397
428
|
};
|
package/package.json
CHANGED
package/src/endpoint.ts
CHANGED
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
} from './interfaces/query-params/index.js';
|
|
55
55
|
import { RequirementsOf } from './utils.js';
|
|
56
56
|
import { Invoice, InvoiceQueryParameters } from './interfaces/invoice.interface.js';
|
|
57
|
+
import { UpdateUserWithOnboardingInfo } from './interfaces/onboarding.interface.js';
|
|
57
58
|
|
|
58
59
|
/** Endpoint versions supported by the API */
|
|
59
60
|
export type EndpointVersion = 'v1' | 'v2';
|
|
@@ -137,5 +138,7 @@ export interface EndpointEntityMap extends Record<EndpointVersion, Record<string
|
|
|
137
138
|
sendInvite?: boolean;
|
|
138
139
|
}
|
|
139
140
|
>;
|
|
141
|
+
'users/onboard': Endpoint<void, number, UpdateUserWithOnboardingInfo>;
|
|
142
|
+
'users/onboard/resend': Endpoint<void, number>;
|
|
140
143
|
};
|
|
141
144
|
}
|
|
@@ -127,11 +127,16 @@ export interface EstimatesReq {
|
|
|
127
127
|
paymentFrequency: 'monthly' | 'yearly';
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
export interface
|
|
131
|
-
paymentFrequency: 'monthly' | 'yearly';
|
|
130
|
+
export interface Estimate {
|
|
132
131
|
subTotal: number;
|
|
133
|
-
chargedImmediately: number;
|
|
134
132
|
creditsApplied: number;
|
|
135
|
-
quantity: number;
|
|
136
133
|
lineItems: EstimateLineItem[];
|
|
137
134
|
}
|
|
135
|
+
|
|
136
|
+
export interface EstimatesRes {
|
|
137
|
+
paymentFrequency: 'monthly' | 'yearly';
|
|
138
|
+
quantity: number;
|
|
139
|
+
immediateEstimates: Estimate;
|
|
140
|
+
nextEstimates: Estimate;
|
|
141
|
+
nextBillingDate: string;
|
|
142
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RequirementsOf } from '../utils.js';
|
|
2
|
+
import { User } from './user.interface.js';
|
|
3
|
+
|
|
4
|
+
export interface UpdateUserWithOnboardingInfo {
|
|
5
|
+
title: string;
|
|
6
|
+
gender: string;
|
|
7
|
+
dob: string;
|
|
8
|
+
nationalInsuranceNumber?: string;
|
|
9
|
+
address1: string;
|
|
10
|
+
address2: string;
|
|
11
|
+
county: string;
|
|
12
|
+
phone: string;
|
|
13
|
+
postcode: string;
|
|
14
|
+
city: string;
|
|
15
|
+
emergencyContactName: string;
|
|
16
|
+
emergencyContactPhone: string;
|
|
17
|
+
emergencyContactRelationship: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type PendingV1User = RequirementsOf<User, 'first_name' | 'last_name' | 'locations' | 'email'>;
|
|
21
|
+
|
|
22
|
+
export interface AddOrOnboard {
|
|
23
|
+
users: PendingV1User[];
|
|
24
|
+
locations: number[];
|
|
25
|
+
}
|
package/src/service.ts
CHANGED
|
@@ -36,6 +36,7 @@ import { LogbookEntry, LogbookQueryParameters } from './interfaces/logbook.inter
|
|
|
36
36
|
import { Message } from './interfaces/message.interface.js';
|
|
37
37
|
import { Invoice, InvoiceDownload } from './interfaces/invoice.interface.js';
|
|
38
38
|
import { CreateUserRequest, CreateUserResponse, PartialUserV2 } from './interfaces/user-v2.interface.js';
|
|
39
|
+
import { AddOrOnboard, UpdateUserWithOnboardingInfo } from './interfaces/onboarding.interface.js';
|
|
39
40
|
|
|
40
41
|
export type ServiceSpecification<CustomOp extends OpDef<unknown> = OpDef<any>> = {
|
|
41
42
|
/** Operations allowed and usable for the endpoint */
|
|
@@ -516,4 +517,38 @@ export const SERVICES = {
|
|
|
516
517
|
}),
|
|
517
518
|
},
|
|
518
519
|
},
|
|
520
|
+
onboarding: {
|
|
521
|
+
endpoint: 'users/onboard',
|
|
522
|
+
endpointVersion: 'v2',
|
|
523
|
+
operations: ['update', 'create'],
|
|
524
|
+
customOperations: {
|
|
525
|
+
update: (
|
|
526
|
+
{ request, service },
|
|
527
|
+
onboardingInfoForm: UpdateUserWithOnboardingInfo,
|
|
528
|
+
): RequestConfig<typeof onboardingInfoForm, void> => ({
|
|
529
|
+
...request,
|
|
530
|
+
url: `${service.endpointVersion}/${service.endpoint}`,
|
|
531
|
+
method: 'PATCH',
|
|
532
|
+
data: onboardingInfoForm,
|
|
533
|
+
}),
|
|
534
|
+
create: ({ request, service }, addOrOnboard: AddOrOnboard): RequestConfig<typeof addOrOnboard, void> => ({
|
|
535
|
+
...request,
|
|
536
|
+
url: `${service.endpointVersion}/${service.endpoint}`,
|
|
537
|
+
method: 'POST',
|
|
538
|
+
data: addOrOnboard,
|
|
539
|
+
}),
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
resendOnboardingLink: {
|
|
543
|
+
endpoint: 'users/onboard/resend',
|
|
544
|
+
endpointVersion: 'v2',
|
|
545
|
+
operations: ['create'],
|
|
546
|
+
customOperations: {
|
|
547
|
+
create: ({ request, service }, entity: { id: number }): RequestConfig<void, void> => ({
|
|
548
|
+
...request,
|
|
549
|
+
url: `${service.endpointVersion}/${service.endpoint}/${entity.id}/resend`,
|
|
550
|
+
method: 'POST',
|
|
551
|
+
}),
|
|
552
|
+
},
|
|
553
|
+
},
|
|
519
554
|
} satisfies Record<string, ServiceSpecification>;
|