rotacloud 1.0.37 → 1.0.39

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.
@@ -1,6 +1,14 @@
1
1
  export interface UsersQueryParams {
2
2
  ids?: number[];
3
3
  locations?: number[];
4
+ /**
5
+ * Works different from {UserQueryParams.locations},
6
+ * When filtering out employees for rota, this is more suggested,
7
+ * one scenario would be filtering out employees base on their starting and
8
+ * final working date, using {UserQueryParams.locations} will not work in tandem
9
+ * of {UserQueryParams.start_date} and {UserQueryParams.end_date}
10
+ */
11
+ location?: number;
4
12
  roles?: number[];
5
13
  only_managed?: boolean;
6
14
  include_self?: boolean;
@@ -5,4 +5,5 @@ export interface SDKConfig {
5
5
  accountId?: number;
6
6
  userId?: number;
7
7
  retry?: false | `${RetryStrategy}` | RetryOptions;
8
+ [key: string]: unknown;
8
9
  }
@@ -85,6 +85,14 @@ class Service {
85
85
  Authorization: `Bearer ${rotacloud_js_1.RotaCloud.config.apiKey}`,
86
86
  'SDK-Version': version_js_1.Version.version,
87
87
  };
88
+ const extraHeaders = rotacloud_js_1.RotaCloud.config.headers;
89
+ if (extraHeaders && typeof extraHeaders === 'object') {
90
+ for (const [key, val] of Object.entries(extraHeaders)) {
91
+ if (typeof key === 'string' && typeof val === 'string') {
92
+ headers[key] = val;
93
+ }
94
+ }
95
+ }
88
96
  if (rotacloud_js_1.RotaCloud.config.accountId) {
89
97
  headers.Account = String(rotacloud_js_1.RotaCloud.config.accountId);
90
98
  }
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Version = void 0;
4
- exports.Version = { version: '1.0.37' };
4
+ exports.Version = { version: '1.0.39' };
@@ -1,6 +1,14 @@
1
1
  export interface UsersQueryParams {
2
2
  ids?: number[];
3
3
  locations?: number[];
4
+ /**
5
+ * Works different from {UserQueryParams.locations},
6
+ * When filtering out employees for rota, this is more suggested,
7
+ * one scenario would be filtering out employees base on their starting and
8
+ * final working date, using {UserQueryParams.locations} will not work in tandem
9
+ * of {UserQueryParams.start_date} and {UserQueryParams.end_date}
10
+ */
11
+ location?: number;
4
12
  roles?: number[];
5
13
  only_managed?: boolean;
6
14
  include_self?: boolean;
@@ -5,4 +5,5 @@ export interface SDKConfig {
5
5
  accountId?: number;
6
6
  userId?: number;
7
7
  retry?: false | `${RetryStrategy}` | RetryOptions;
8
+ [key: string]: unknown;
8
9
  }
@@ -54,6 +54,14 @@ export class Service {
54
54
  Authorization: `Bearer ${RotaCloud.config.apiKey}`,
55
55
  'SDK-Version': Version.version,
56
56
  };
57
+ const extraHeaders = RotaCloud.config.headers;
58
+ if (extraHeaders && typeof extraHeaders === 'object') {
59
+ for (const [key, val] of Object.entries(extraHeaders)) {
60
+ if (typeof key === 'string' && typeof val === 'string') {
61
+ headers[key] = val;
62
+ }
63
+ }
64
+ }
57
65
  if (RotaCloud.config.accountId) {
58
66
  headers.Account = String(RotaCloud.config.accountId);
59
67
  }
@@ -1 +1 @@
1
- export const Version = { version: '1.0.37' };
1
+ export const Version = { version: '1.0.39' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rotacloud",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "The RotaCloud SDK for the RotaCloud API",
5
5
  "engines": {
6
6
  "node": ">=14.17.0"
@@ -1,6 +1,14 @@
1
1
  export interface UsersQueryParams {
2
2
  ids?: number[];
3
3
  locations?: number[];
4
+ /**
5
+ * Works different from {UserQueryParams.locations},
6
+ * When filtering out employees for rota, this is more suggested,
7
+ * one scenario would be filtering out employees base on their starting and
8
+ * final working date, using {UserQueryParams.locations} will not work in tandem
9
+ * of {UserQueryParams.start_date} and {UserQueryParams.end_date}
10
+ */
11
+ location?: number;
4
12
  roles?: number[];
5
13
  only_managed?: boolean;
6
14
  include_self?: boolean;
@@ -6,4 +6,5 @@ export interface SDKConfig {
6
6
  accountId?: number;
7
7
  userId?: number;
8
8
  retry?: false | `${RetryStrategy}` | RetryOptions;
9
+ [key: string]: unknown;
9
10
  }
@@ -93,6 +93,16 @@ export abstract class Service<ApiResponse = any> {
93
93
  Authorization: `Bearer ${RotaCloud.config.apiKey}`,
94
94
  'SDK-Version': Version.version,
95
95
  };
96
+
97
+ const extraHeaders = RotaCloud.config.headers;
98
+ if (extraHeaders && typeof extraHeaders === 'object') {
99
+ for (const [key, val] of Object.entries(extraHeaders)) {
100
+ if (typeof key === 'string' && typeof val === 'string') {
101
+ headers[key] = val;
102
+ }
103
+ }
104
+ }
105
+
96
106
  if (RotaCloud.config.accountId) {
97
107
  headers.Account = String(RotaCloud.config.accountId);
98
108
  } else {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const Version = { version: '1.0.37' };
1
+ export const Version = { version: '1.0.39' };