@violetbuse/rocktick 0.4.0 → 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/src/client.ts CHANGED
@@ -26,6 +26,7 @@ import {
26
26
  CronListResponse,
27
27
  CronListResponsesCursorPage,
28
28
  CronUpdateParams,
29
+ HTTPRequest,
29
30
  } from './resources/cron';
30
31
  import {
31
32
  Execution,
@@ -33,6 +34,7 @@ import {
33
34
  ExecutionListResponse,
34
35
  ExecutionListResponsesCursorPage,
35
36
  Executions,
37
+ HTTPResponse,
36
38
  } from './resources/executions';
37
39
  import {
38
40
  JobCreateParams,
@@ -70,6 +72,8 @@ export interface ClientOptions {
70
72
  */
71
73
  apiKey?: string | undefined;
72
74
 
75
+ tenantID?: string | null | undefined;
76
+
73
77
  /**
74
78
  * Specifies the environment to use for the API.
75
79
  *
@@ -153,6 +157,7 @@ export interface ClientOptions {
153
157
  */
154
158
  export class Rocktick {
155
159
  apiKey: string;
160
+ tenantID: string | null;
156
161
 
157
162
  baseURL: string;
158
163
  maxRetries: number;
@@ -170,6 +175,7 @@ export class Rocktick {
170
175
  * API Client for interfacing with the Rocktick API.
171
176
  *
172
177
  * @param {string | undefined} [opts.apiKey=process.env['ROCKTICK_API_KEY'] ?? undefined]
178
+ * @param {string | null | undefined} [opts.tenantID]
173
179
  * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
174
180
  * @param {string} [opts.baseURL=process.env['ROCKTICK_BASE_URL'] ?? https://rocktick.com] - Override the default base URL for the API.
175
181
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
@@ -182,6 +188,7 @@ export class Rocktick {
182
188
  constructor({
183
189
  baseURL = readEnv('ROCKTICK_BASE_URL'),
184
190
  apiKey = readEnv('ROCKTICK_API_KEY'),
191
+ tenantID = null,
185
192
  ...opts
186
193
  }: ClientOptions = {}) {
187
194
  if (apiKey === undefined) {
@@ -192,6 +199,7 @@ export class Rocktick {
192
199
 
193
200
  const options: ClientOptions = {
194
201
  apiKey,
202
+ tenantID,
195
203
  ...opts,
196
204
  baseURL,
197
205
  environment: opts.environment ?? 'production',
@@ -221,6 +229,7 @@ export class Rocktick {
221
229
  this._options = options;
222
230
 
223
231
  this.apiKey = apiKey;
232
+ this.tenantID = tenantID;
224
233
  }
225
234
 
226
235
  /**
@@ -238,6 +247,7 @@ export class Rocktick {
238
247
  fetch: this.fetch,
239
248
  fetchOptions: this.fetchOptions,
240
249
  apiKey: this.apiKey,
250
+ tenantID: this.tenantID,
241
251
  ...options,
242
252
  });
243
253
  return client;
@@ -717,6 +727,7 @@ export class Rocktick {
717
727
  'X-Stainless-Retry-Count': String(retryCount),
718
728
  ...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
719
729
  ...getPlatformHeaders(),
730
+ 'Tenant-Id': this.tenantID,
720
731
  },
721
732
  await this.authHeaders(options),
722
733
  this._options.defaultHeaders,
@@ -807,6 +818,7 @@ export declare namespace Rocktick {
807
818
  export {
808
819
  Cron as Cron,
809
820
  type CronJob as CronJob,
821
+ type HTTPRequest as HTTPRequest,
810
822
  type CronListResponse as CronListResponse,
811
823
  type CronListResponsesCursorPage as CronListResponsesCursorPage,
812
824
  type CronCreateParams as CronCreateParams,
@@ -817,6 +829,7 @@ export declare namespace Rocktick {
817
829
  export {
818
830
  Executions as Executions,
819
831
  type Execution as Execution,
832
+ type HTTPResponse as HTTPResponse,
820
833
  type ExecutionListResponse as ExecutionListResponse,
821
834
  type ExecutionListResponsesCursorPage as ExecutionListResponsesCursorPage,
822
835
  type ExecutionListParams as ExecutionListParams,
@@ -39,7 +39,7 @@ export interface CronJob {
39
39
 
40
40
  region: string;
41
41
 
42
- request: CronJob.Request;
42
+ request: HTTPRequest;
43
43
 
44
44
  schedule: string;
45
45
 
@@ -50,16 +50,14 @@ export interface CronJob {
50
50
  timeout_ms?: number | null;
51
51
  }
52
52
 
53
- export namespace CronJob {
54
- export interface Request {
55
- headers: { [key: string]: string };
53
+ export interface HTTPRequest {
54
+ headers: { [key: string]: string };
56
55
 
57
- method: string;
56
+ method: string;
58
57
 
59
- url: string;
58
+ url: string;
60
59
 
61
- body?: string | null;
62
- }
60
+ body?: string | null;
63
61
  }
64
62
 
65
63
  export interface CronListResponse {
@@ -71,7 +69,7 @@ export interface CronListResponse {
71
69
 
72
70
  region: string;
73
71
 
74
- request: CronListResponse.Request;
72
+ request: HTTPRequest;
75
73
 
76
74
  schedule: string;
77
75
 
@@ -82,20 +80,8 @@ export interface CronListResponse {
82
80
  timeout_ms?: number | null;
83
81
  }
84
82
 
85
- export namespace CronListResponse {
86
- export interface Request {
87
- headers: { [key: string]: string };
88
-
89
- method: string;
90
-
91
- url: string;
92
-
93
- body?: string | null;
94
- }
95
- }
96
-
97
83
  export interface CronCreateParams {
98
- request: CronCreateParams.Request;
84
+ request: HTTPRequest;
99
85
 
100
86
  schedule: string;
101
87
 
@@ -108,18 +94,6 @@ export interface CronCreateParams {
108
94
  timeout_ms?: number | null;
109
95
  }
110
96
 
111
- export namespace CronCreateParams {
112
- export interface Request {
113
- headers: { [key: string]: string };
114
-
115
- method: string;
116
-
117
- url: string;
118
-
119
- body?: string | null;
120
- }
121
- }
122
-
123
97
  export interface CronUpdateParams {
124
98
  max_response_bytes?: number | null;
125
99
 
@@ -127,30 +101,19 @@ export interface CronUpdateParams {
127
101
 
128
102
  region?: string | null;
129
103
 
130
- request?: CronUpdateParams.Request | null;
104
+ request?: HTTPRequest | null;
131
105
 
132
106
  schedule?: string | null;
133
107
 
134
108
  timeout_ms?: number | null;
135
109
  }
136
110
 
137
- export namespace CronUpdateParams {
138
- export interface Request {
139
- headers: { [key: string]: string };
140
-
141
- method: string;
142
-
143
- url: string;
144
-
145
- body?: string | null;
146
- }
147
- }
148
-
149
111
  export interface CronListParams extends CursorPageParams {}
150
112
 
151
113
  export declare namespace Cron {
152
114
  export {
153
115
  type CronJob as CronJob,
116
+ type HTTPRequest as HTTPRequest,
154
117
  type CronListResponse as CronListResponse,
155
118
  type CronListResponsesCursorPage as CronListResponsesCursorPage,
156
119
  type CronCreateParams as CronCreateParams,
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
+ import * as CronAPI from './cron';
4
5
  import { APIPromise } from '../core/api-promise';
5
6
  import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
6
7
  import { RequestOptions } from '../internal/request-options';
@@ -31,7 +32,7 @@ export interface Execution {
31
32
 
32
33
  region: string;
33
34
 
34
- request: Execution.Request;
35
+ request: CronAPI.HTTPRequest;
35
36
 
36
37
  scheduled_at: number;
37
38
 
@@ -43,7 +44,7 @@ export interface Execution {
43
44
 
44
45
  one_off_job_id?: string | null;
45
46
 
46
- response?: Execution.Response | null;
47
+ response?: HTTPResponse | null;
47
48
 
48
49
  response_error?: string | null;
49
50
 
@@ -56,24 +57,12 @@ export interface Execution {
56
57
  timeout_ms?: number | null;
57
58
  }
58
59
 
59
- export namespace Execution {
60
- export interface Request {
61
- headers: { [key: string]: string };
60
+ export interface HTTPResponse {
61
+ body: string;
62
62
 
63
- method: string;
63
+ headers: { [key: string]: string };
64
64
 
65
- url: string;
66
-
67
- body?: string | null;
68
- }
69
-
70
- export interface Response {
71
- body: string;
72
-
73
- headers: { [key: string]: string };
74
-
75
- status: number;
76
- }
65
+ status: number;
77
66
  }
78
67
 
79
68
  export interface ExecutionListResponse {
@@ -83,7 +72,7 @@ export interface ExecutionListResponse {
83
72
 
84
73
  region: string;
85
74
 
86
- request: ExecutionListResponse.Request;
75
+ request: CronAPI.HTTPRequest;
87
76
 
88
77
  scheduled_at: number;
89
78
 
@@ -95,7 +84,7 @@ export interface ExecutionListResponse {
95
84
 
96
85
  one_off_job_id?: string | null;
97
86
 
98
- response?: ExecutionListResponse.Response | null;
87
+ response?: HTTPResponse | null;
99
88
 
100
89
  response_error?: string | null;
101
90
 
@@ -108,26 +97,6 @@ export interface ExecutionListResponse {
108
97
  timeout_ms?: number | null;
109
98
  }
110
99
 
111
- export namespace ExecutionListResponse {
112
- export interface Request {
113
- headers: { [key: string]: string };
114
-
115
- method: string;
116
-
117
- url: string;
118
-
119
- body?: string | null;
120
- }
121
-
122
- export interface Response {
123
- body: string;
124
-
125
- headers: { [key: string]: string };
126
-
127
- status: number;
128
- }
129
- }
130
-
131
100
  export interface ExecutionListParams extends CursorPageParams {
132
101
  completed?: boolean | null;
133
102
 
@@ -143,6 +112,7 @@ export interface ExecutionListParams extends CursorPageParams {
143
112
  export declare namespace Executions {
144
113
  export {
145
114
  type Execution as Execution,
115
+ type HTTPResponse as HTTPResponse,
146
116
  type ExecutionListResponse as ExecutionListResponse,
147
117
  type ExecutionListResponsesCursorPage as ExecutionListResponsesCursorPage,
148
118
  type ExecutionListParams as ExecutionListParams,
@@ -3,6 +3,7 @@
3
3
  export {
4
4
  Cron,
5
5
  type CronJob,
6
+ type HTTPRequest,
6
7
  type CronListResponse,
7
8
  type CronCreateParams,
8
9
  type CronUpdateParams,
@@ -12,6 +13,7 @@ export {
12
13
  export {
13
14
  Executions,
14
15
  type Execution,
16
+ type HTTPResponse,
15
17
  type ExecutionListResponse,
16
18
  type ExecutionListParams,
17
19
  type ExecutionListResponsesCursorPage,
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
+ import * as CronAPI from './cron';
4
5
  import * as ExecutionsAPI from './executions';
5
6
  import { APIPromise } from '../core/api-promise';
6
7
  import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
@@ -41,7 +42,7 @@ export interface OneOffJob {
41
42
 
42
43
  region: string;
43
44
 
44
- request: OneOffJob.Request;
45
+ request: CronAPI.HTTPRequest;
45
46
 
46
47
  max_response_bytes?: number | null;
47
48
 
@@ -50,18 +51,6 @@ export interface OneOffJob {
50
51
  timeout_ms?: number | null;
51
52
  }
52
53
 
53
- export namespace OneOffJob {
54
- export interface Request {
55
- headers: { [key: string]: string };
56
-
57
- method: string;
58
-
59
- url: string;
60
-
61
- body?: string | null;
62
- }
63
- }
64
-
65
54
  export interface JobListResponse {
66
55
  id: string;
67
56
 
@@ -73,7 +62,7 @@ export interface JobListResponse {
73
62
 
74
63
  region: string;
75
64
 
76
- request: JobListResponse.Request;
65
+ request: CronAPI.HTTPRequest;
77
66
 
78
67
  max_response_bytes?: number | null;
79
68
 
@@ -82,22 +71,10 @@ export interface JobListResponse {
82
71
  timeout_ms?: number | null;
83
72
  }
84
73
 
85
- export namespace JobListResponse {
86
- export interface Request {
87
- headers: { [key: string]: string };
88
-
89
- method: string;
90
-
91
- url: string;
92
-
93
- body?: string | null;
94
- }
95
- }
96
-
97
74
  export interface JobCreateParams {
98
75
  execute_at: number;
99
76
 
100
- request: JobCreateParams.Request;
77
+ request: CronAPI.HTTPRequest;
101
78
 
102
79
  max_response_bytes?: number | null;
103
80
 
@@ -108,18 +85,6 @@ export interface JobCreateParams {
108
85
  timeout_ms?: number | null;
109
86
  }
110
87
 
111
- export namespace JobCreateParams {
112
- export interface Request {
113
- headers: { [key: string]: string };
114
-
115
- method: string;
116
-
117
- url: string;
118
-
119
- body?: string | null;
120
- }
121
- }
122
-
123
88
  export interface JobUpdateParams {
124
89
  execute_at?: number | null;
125
90
 
@@ -129,23 +94,11 @@ export interface JobUpdateParams {
129
94
 
130
95
  region?: string | null;
131
96
 
132
- request?: JobUpdateParams.Request | null;
97
+ request?: CronAPI.HTTPRequest | null;
133
98
 
134
99
  timeout_ms?: number | null;
135
100
  }
136
101
 
137
- export namespace JobUpdateParams {
138
- export interface Request {
139
- headers: { [key: string]: string };
140
-
141
- method: string;
142
-
143
- url: string;
144
-
145
- body?: string | null;
146
- }
147
- }
148
-
149
102
  export interface JobListParams extends CursorPageParams {}
150
103
 
151
104
  export declare namespace Jobs {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.4.0'; // x-release-please-version
1
+ export const VERSION = '0.6.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.4.0";
1
+ export declare const VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.4.0";
1
+ export declare const VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.4.0'; // x-release-please-version
4
+ exports.VERSION = '0.6.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.4.0'; // x-release-please-version
1
+ export const VERSION = '0.6.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map