rotacloud 2.3.18 → 2.3.22

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/README.md CHANGED
@@ -10,6 +10,37 @@ to start working with the SDK in your project.
10
10
  Please ensure you perform the `npm run version:bump` command before commiting and
11
11
  pushing your changes to the remote branch.
12
12
 
13
+ ## Local development
14
+
15
+ When making changes to the SDK and testing them locally with the web app (`rotacloud-app`), follow these steps, provided you have already followed the above ones:
16
+
17
+ ### Initial setup
18
+
19
+ 1.**Build the SDK:**
20
+
21
+ `npm run build -- --watch`
22
+
23
+ 2.**Link in the web app:**
24
+ / cd rotacloud-app
25
+
26
+ `npm link rotacloud`
27
+
28
+ 3.**Verify the link is correct:**
29
+
30
+ `npm ls rotacloud`
31
+
32
+ Expected output:
33
+
34
+ ```
35
+ └── rotacloud@x.x.x -> ./../rotacloud-node
36
+ ```
37
+
38
+ The version displayed is the bumped version you are linking the app to.
39
+
40
+ Once you are sure you have the web app linked to the correct version of the package, you can start up the app and test your changes:
41
+
42
+ `npm run start`
43
+
13
44
  ## Configuration
14
45
 
15
46
  Configuration is simple, import the `createRotaCloudClient` function from the SDK
@@ -75,12 +75,13 @@ export interface ProductCatalogueItemPrice {
75
75
  unitPrice?: number;
76
76
  stairStep?: ProductCatalogueItemStairStep[];
77
77
  billingPeriod: number;
78
- billingPeriodUnit: 'monthly' | 'yearly';
78
+ billingPeriodUnit: 'month' | 'year';
79
+ paymentPeriodUnit: 'monthly' | 'yearly';
79
80
  }
80
81
  export interface ProductCatalogueItemStairStep {
81
82
  startingUnit: number;
82
83
  endingUnit?: number;
83
- tierPrice: number;
84
+ price: number;
84
85
  }
85
86
  export interface ProductCatalogueItem {
86
87
  id: string;
package/dist/main.d.ts CHANGED
@@ -255,7 +255,10 @@ export declare const createRotaCloudClient: (config: import("./interfaces/sdk-co
255
255
  endpointVersion: "v2";
256
256
  operations: ("create" | "update")[];
257
257
  customOperations: {
258
- update: ({ request, service }: import("./ops.js").OperationContext, onboardingInfoForm: import("./interfaces/onboarding.interface.js").UpdateUserWithOnboardingInfo) => import("./ops.js").RequestConfig<typeof onboardingInfoForm, void>;
258
+ update: ({ request, service }: import("./ops.js").OperationContext, params: {
259
+ id: number;
260
+ data: import("./interfaces/onboarding.interface.js").UpdateUserWithOnboardingInfo;
261
+ }) => import("./ops.js").RequestConfig<import("./interfaces/onboarding.interface.js").UpdateUserWithOnboardingInfo, void>;
259
262
  create: ({ request, service }: import("./ops.js").OperationContext, addOrOnboard: import("./interfaces/onboarding.interface.js").AddOrOnboard) => import("./ops.js").RequestConfig<typeof addOrOnboard, void>;
260
263
  };
261
264
  };
package/dist/service.d.ts CHANGED
@@ -300,7 +300,10 @@ export declare const SERVICES: {
300
300
  endpointVersion: "v2";
301
301
  operations: ("create" | "update")[];
302
302
  customOperations: {
303
- update: ({ request, service }: OperationContext, onboardingInfoForm: UpdateUserWithOnboardingInfo) => RequestConfig<typeof onboardingInfoForm, void>;
303
+ update: ({ request, service }: OperationContext, params: {
304
+ id: number;
305
+ data: UpdateUserWithOnboardingInfo;
306
+ }) => RequestConfig<UpdateUserWithOnboardingInfo, void>;
304
307
  create: ({ request, service }: OperationContext, addOrOnboard: AddOrOnboard) => RequestConfig<typeof addOrOnboard, void>;
305
308
  };
306
309
  };
package/dist/service.js CHANGED
@@ -399,11 +399,11 @@ export const SERVICES = {
399
399
  endpointVersion: 'v2',
400
400
  operations: ['update', 'create'],
401
401
  customOperations: {
402
- update: ({ request, service }, onboardingInfoForm) => ({
402
+ update: ({ request, service }, params) => ({
403
403
  ...request,
404
- url: `${service.endpointVersion}/${service.endpoint}`,
404
+ url: `${service.endpointVersion}/${service.endpoint}/${params.id}`,
405
405
  method: 'PATCH',
406
- data: onboardingInfoForm,
406
+ data: params.data,
407
407
  }),
408
408
  create: ({ request, service }, addOrOnboard) => ({
409
409
  ...request,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rotacloud",
3
- "version": "2.3.18",
3
+ "version": "2.3.22",
4
4
  "description": "The RotaCloud SDK for the RotaCloud API",
5
5
  "type": "module",
6
6
  "engines": {
@@ -73,13 +73,14 @@ export interface ProductCatalogueItemPrice {
73
73
  unitPrice?: number;
74
74
  stairStep?: ProductCatalogueItemStairStep[];
75
75
  billingPeriod: number;
76
- billingPeriodUnit: 'monthly' | 'yearly';
76
+ billingPeriodUnit: 'month' | 'year';
77
+ paymentPeriodUnit: 'monthly' | 'yearly';
77
78
  }
78
79
 
79
80
  export interface ProductCatalogueItemStairStep {
80
81
  startingUnit: number;
81
82
  endingUnit?: number;
82
- tierPrice: number;
83
+ price: number;
83
84
  }
84
85
  export interface ProductCatalogueItem {
85
86
  id: string;
package/src/service.ts CHANGED
@@ -35,7 +35,7 @@ import { ToilAllowanceQueryParams } from './interfaces/query-params/index.js';
35
35
  import { LogbookEntry, LogbookQueryParameters } from './interfaces/logbook.interface.js';
36
36
  import { Message } from './interfaces/message.interface.js';
37
37
  import { Invoice } from './interfaces/invoice.interface.js';
38
- import { CreateUserRequest, CreateUserResponse, PartialUserV2 } from './interfaces/user-v2.interface.js';
38
+ import { CreateUserRequest, CreateUserResponse } from './interfaces/user-v2.interface.js';
39
39
  import { AddOrOnboard, UpdateUserWithOnboardingInfo } from './interfaces/onboarding.interface.js';
40
40
 
41
41
  export type ServiceSpecification<CustomOp extends OpDef<unknown> = OpDef<any>> = {
@@ -524,12 +524,12 @@ export const SERVICES = {
524
524
  customOperations: {
525
525
  update: (
526
526
  { request, service },
527
- onboardingInfoForm: UpdateUserWithOnboardingInfo,
528
- ): RequestConfig<typeof onboardingInfoForm, void> => ({
527
+ params: { id: number; data: UpdateUserWithOnboardingInfo },
528
+ ): RequestConfig<UpdateUserWithOnboardingInfo, void> => ({
529
529
  ...request,
530
- url: `${service.endpointVersion}/${service.endpoint}`,
530
+ url: `${service.endpointVersion}/${service.endpoint}/${params.id}`,
531
531
  method: 'PATCH',
532
- data: onboardingInfoForm,
532
+ data: params.data,
533
533
  }),
534
534
  create: ({ request, service }, addOrOnboard: AddOrOnboard): RequestConfig<typeof addOrOnboard, void> => ({
535
535
  ...request,