@vigneshreddy/cms-sdk 1.0.6 → 1.0.8
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 +117 -88
- package/dist/src/client.d.ts +5 -3
- package/dist/src/client.js +12 -4
- package/dist/src/errors/base.js +13 -0
- package/dist/src/errors.js +10 -2
- package/dist/src/funcs/trackLead.d.ts +1 -2
- package/dist/src/funcs/trackLead.js +1 -5
- package/dist/src/funcs/trackSale.d.ts +1 -2
- package/dist/src/funcs/trackSale.js +1 -5
- package/dist/src/generated/api.js +2 -4
- package/dist/src/generated/base.d.ts +0 -11
- package/dist/src/generated/base.js +1 -14
- package/dist/src/generated/common.d.ts +0 -11
- package/dist/src/generated/common.js +0 -13
- package/dist/src/generated/configuration.d.ts +0 -11
- package/dist/src/generated/configuration.js +0 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vigneshreddy/cms-sdk
|
|
2
2
|
|
|
3
|
-
TypeScript/JavaScript SDK for the CutMeShort CMS API.
|
|
3
|
+
Official TypeScript/JavaScript SDK for the CutMeShort CMS API.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
- Resilient (built-in retries for transient errors).
|
|
5
|
+
Use this package to send:
|
|
6
|
+
- lead tracking events (`trackLead`)
|
|
7
|
+
- sale tracking events (`trackSale`)
|
|
9
8
|
|
|
10
9
|
## Install
|
|
11
10
|
|
|
@@ -13,104 +12,117 @@ This SDK is:
|
|
|
13
12
|
npm install @vigneshreddy/cms-sdk
|
|
14
13
|
```
|
|
15
14
|
|
|
16
|
-
##
|
|
15
|
+
## Requirements
|
|
17
16
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
17
|
+
- Node.js 18+ (recommended) or any runtime with global `fetch`
|
|
18
|
+
- TypeScript 5+ (optional, for type safety)
|
|
19
|
+
|
|
20
|
+
If your runtime does not provide `fetch`, add a polyfill before creating the client.
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import fetch, { Headers, Request, Response } from "cross-fetch";
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
global.Request = Request as any;
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
global.Response = Response as any;
|
|
25
|
+
(globalThis as any).fetch = fetch;
|
|
26
|
+
(globalThis as any).Headers = Headers;
|
|
27
|
+
(globalThis as any).Request = Request;
|
|
28
|
+
(globalThis as any).Response = Response;
|
|
33
29
|
```
|
|
34
30
|
|
|
35
|
-
## Quick
|
|
36
|
-
|
|
37
|
-
Create the client once and reuse it across calls.
|
|
31
|
+
## Quick Start
|
|
38
32
|
|
|
39
33
|
```ts
|
|
40
34
|
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
41
35
|
|
|
42
|
-
const
|
|
36
|
+
const cms = new CMS({
|
|
43
37
|
apiKey: process.env.CMS_API_KEY!,
|
|
44
38
|
timeout: 10_000,
|
|
45
39
|
});
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Track a lead
|
|
49
|
-
|
|
50
|
-
### Class-based usage (throws on error)
|
|
51
40
|
|
|
52
|
-
|
|
53
|
-
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
54
|
-
|
|
55
|
-
const sdk = new CMS({ apiKey: "sk_live_123" });
|
|
56
|
-
|
|
57
|
-
const leadResponse = await sdk.trackLead({
|
|
41
|
+
const response = await cms.trackLead({
|
|
58
42
|
clickId: "id_123",
|
|
59
43
|
eventName: "signup_started",
|
|
60
44
|
customerId: "user_42",
|
|
61
45
|
});
|
|
62
46
|
|
|
63
|
-
console.log(
|
|
47
|
+
console.log(response);
|
|
64
48
|
```
|
|
65
49
|
|
|
66
|
-
|
|
50
|
+
## API Methods
|
|
51
|
+
|
|
52
|
+
### `trackLead(leadData, options?)`
|
|
67
53
|
|
|
68
54
|
```ts
|
|
69
|
-
import { CMS
|
|
55
|
+
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
70
56
|
|
|
71
|
-
const
|
|
57
|
+
const cms = new CMS({ apiKey: "sk_live_xxx" });
|
|
72
58
|
|
|
73
|
-
|
|
59
|
+
await cms.trackLead({
|
|
74
60
|
clickId: "id_123",
|
|
75
61
|
eventName: "signup_started",
|
|
76
62
|
customerId: "user_42",
|
|
77
63
|
});
|
|
78
|
-
|
|
79
|
-
if (res.ok) {
|
|
80
|
-
console.log("Lead response:", res.value);
|
|
81
|
-
} else {
|
|
82
|
-
console.error("Lead error:", res.error);
|
|
83
|
-
}
|
|
84
64
|
```
|
|
85
65
|
|
|
86
|
-
|
|
66
|
+
Lead payload fields:
|
|
67
|
+
- `clickId: string`
|
|
68
|
+
- `eventName: string`
|
|
69
|
+
- `customerId: string`
|
|
87
70
|
|
|
88
|
-
###
|
|
71
|
+
### `trackSale(saleData, options?)`
|
|
89
72
|
|
|
90
73
|
```ts
|
|
91
74
|
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
92
75
|
|
|
93
|
-
const
|
|
76
|
+
const cms = new CMS({ apiKey: "sk_live_xxx" });
|
|
94
77
|
|
|
95
|
-
|
|
78
|
+
await cms.trackSale({
|
|
96
79
|
clickId: "id_123",
|
|
97
80
|
eventName: "purchase_completed",
|
|
98
81
|
invoiceId: "inv_987",
|
|
99
82
|
amount: 4999,
|
|
100
83
|
currency: "USD",
|
|
101
84
|
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Sale payload fields:
|
|
88
|
+
- `clickId: string`
|
|
89
|
+
- `eventName: string`
|
|
90
|
+
- `invoiceId: string`
|
|
91
|
+
- `amount: number` (in cents)
|
|
92
|
+
- `currency: string` (3-letter code, e.g. `USD`)
|
|
93
|
+
|
|
94
|
+
## Functional Style (Result Pattern)
|
|
95
|
+
|
|
96
|
+
If you prefer not to use `try/catch`, use helper functions that return `Result`.
|
|
97
|
+
|
|
98
|
+
### Lead Example
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { CMS, trackLead } from "@vigneshreddy/cms-sdk";
|
|
102
|
+
|
|
103
|
+
const cms = new CMS({ apiKey: "sk_live_xxx" });
|
|
104
|
+
|
|
105
|
+
const result = await trackLead(cms, {
|
|
106
|
+
clickId: "id_123",
|
|
107
|
+
eventName: "signup_started",
|
|
108
|
+
customerId: "user_42",
|
|
109
|
+
});
|
|
102
110
|
|
|
103
|
-
|
|
111
|
+
if (result.ok) {
|
|
112
|
+
console.log("Tracked lead:", result.value);
|
|
113
|
+
} else {
|
|
114
|
+
console.error("Lead error:", result.error);
|
|
115
|
+
}
|
|
104
116
|
```
|
|
105
117
|
|
|
106
|
-
###
|
|
118
|
+
### Sale Example
|
|
107
119
|
|
|
108
120
|
```ts
|
|
109
|
-
import { CMS, trackSale } from "cms";
|
|
121
|
+
import { CMS, trackSale } from "@vigneshreddy/cms-sdk";
|
|
110
122
|
|
|
111
|
-
const
|
|
123
|
+
const cms = new CMS({ apiKey: "sk_live_xxx" });
|
|
112
124
|
|
|
113
|
-
const
|
|
125
|
+
const result = await trackSale(cms, {
|
|
114
126
|
clickId: "id_123",
|
|
115
127
|
eventName: "purchase_completed",
|
|
116
128
|
invoiceId: "inv_987",
|
|
@@ -118,43 +130,45 @@ const res = await trackSale(sdk, {
|
|
|
118
130
|
currency: "USD",
|
|
119
131
|
});
|
|
120
132
|
|
|
121
|
-
if (
|
|
122
|
-
console.log("
|
|
133
|
+
if (result.ok) {
|
|
134
|
+
console.log("Tracked sale:", result.value);
|
|
123
135
|
} else {
|
|
124
|
-
console.error("Sale error:",
|
|
136
|
+
console.error("Sale error:", result.error);
|
|
125
137
|
}
|
|
126
138
|
```
|
|
127
139
|
|
|
128
140
|
## Configuration
|
|
129
141
|
|
|
142
|
+
`new CMS(config)` accepts:
|
|
143
|
+
|
|
130
144
|
```ts
|
|
131
|
-
|
|
145
|
+
type CMSConfig = {
|
|
132
146
|
apiKey: string;
|
|
133
147
|
timeout?: number;
|
|
134
148
|
maxRetries?: number;
|
|
135
149
|
retryDelayMs?: number;
|
|
136
150
|
retryOnStatuses?: number[];
|
|
137
151
|
retryOnNetworkError?: boolean;
|
|
138
|
-
}
|
|
152
|
+
};
|
|
139
153
|
```
|
|
140
154
|
|
|
141
|
-
|
|
142
|
-
- `timeout`:
|
|
143
|
-
- `maxRetries`:
|
|
144
|
-
- `retryDelayMs`:
|
|
145
|
-
- `retryOnStatuses`:
|
|
146
|
-
- `retryOnNetworkError`:
|
|
155
|
+
Defaults:
|
|
156
|
+
- `timeout`: `10000`
|
|
157
|
+
- `maxRetries`: `2`
|
|
158
|
+
- `retryDelayMs`: `500`
|
|
159
|
+
- `retryOnStatuses`: `[429, 500, 502, 503, 504]`
|
|
160
|
+
- `retryOnNetworkError`: `true`
|
|
147
161
|
|
|
148
|
-
## Per-request
|
|
162
|
+
## Per-request Overrides
|
|
149
163
|
|
|
150
|
-
You can override
|
|
164
|
+
You can override retry/timeout settings for a specific call:
|
|
151
165
|
|
|
152
166
|
```ts
|
|
153
167
|
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
154
168
|
|
|
155
|
-
const
|
|
169
|
+
const cms = new CMS({ apiKey: "sk_live_xxx" });
|
|
156
170
|
|
|
157
|
-
await
|
|
171
|
+
await cms.trackLead(
|
|
158
172
|
{
|
|
159
173
|
clickId: "id_123",
|
|
160
174
|
eventName: "signup_started",
|
|
@@ -163,47 +177,62 @@ await sdk.trackLead(
|
|
|
163
177
|
{
|
|
164
178
|
timeout: 5000,
|
|
165
179
|
maxRetries: 1,
|
|
180
|
+
retryDelayMs: 300,
|
|
166
181
|
}
|
|
167
182
|
);
|
|
168
183
|
```
|
|
169
184
|
|
|
170
|
-
## Error
|
|
185
|
+
## Error Handling
|
|
171
186
|
|
|
172
|
-
|
|
187
|
+
Class-based methods (`cms.trackLead`, `cms.trackSale`) throw `CMSAPIError` on failure.
|
|
173
188
|
|
|
174
189
|
```ts
|
|
175
190
|
import { CMS, CMSAPIError } from "@vigneshreddy/cms-sdk";
|
|
176
191
|
|
|
177
|
-
const
|
|
192
|
+
const cms = new CMS({ apiKey: "sk_live_xxx" });
|
|
178
193
|
|
|
179
194
|
try {
|
|
180
|
-
await
|
|
195
|
+
await cms.trackSale({
|
|
181
196
|
clickId: "id_123",
|
|
182
|
-
eventName: "
|
|
183
|
-
|
|
197
|
+
eventName: "purchase_completed",
|
|
198
|
+
invoiceId: "inv_987",
|
|
199
|
+
amount: 4999,
|
|
200
|
+
currency: "USD",
|
|
184
201
|
});
|
|
185
|
-
} catch (
|
|
186
|
-
if (
|
|
187
|
-
console.error("CMS API
|
|
188
|
-
statusCode:
|
|
189
|
-
type:
|
|
190
|
-
message:
|
|
202
|
+
} catch (error) {
|
|
203
|
+
if (error instanceof CMSAPIError) {
|
|
204
|
+
console.error("CMS API error", {
|
|
205
|
+
statusCode: error.statusCode,
|
|
206
|
+
type: error.type,
|
|
207
|
+
message: error.message,
|
|
191
208
|
});
|
|
192
209
|
} else {
|
|
193
|
-
console.error("Unexpected error
|
|
210
|
+
console.error("Unexpected error", error);
|
|
194
211
|
}
|
|
195
212
|
}
|
|
196
213
|
```
|
|
197
214
|
|
|
198
|
-
##
|
|
215
|
+
## TypeScript Types
|
|
199
216
|
|
|
200
217
|
```ts
|
|
201
|
-
import {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
218
|
+
import type {
|
|
219
|
+
TrackLeadRequest,
|
|
220
|
+
TrackSaleRequest,
|
|
221
|
+
TrackResponse,
|
|
222
|
+
RequestOptions,
|
|
223
|
+
CMSConfig,
|
|
224
|
+
} from "@vigneshreddy/cms-sdk";
|
|
205
225
|
```
|
|
206
226
|
|
|
207
|
-
##
|
|
227
|
+
## Exports
|
|
228
|
+
|
|
229
|
+
Main package exports:
|
|
230
|
+
- `CMS`
|
|
231
|
+
- `trackLead`, `trackSale`
|
|
232
|
+
- `CMSAPIError` and specific error classes
|
|
233
|
+
- `ok`, `err`, `Result`
|
|
234
|
+
- generated request/response types
|
|
235
|
+
|
|
236
|
+
## Security Best Practice
|
|
208
237
|
|
|
209
|
-
Do not expose
|
|
238
|
+
Do not expose private API keys in public frontend code. Use this SDK from a trusted backend/server environment when using secret keys.
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { EventsApi
|
|
1
|
+
import { EventsApi } from "./generated";
|
|
2
|
+
export type LeadPayload = Record<string, unknown>;
|
|
3
|
+
export type SalePayload = Record<string, unknown>;
|
|
2
4
|
export interface CMSConfig {
|
|
3
5
|
apiKey: string;
|
|
4
6
|
/**
|
|
@@ -41,6 +43,6 @@ export declare class CMS {
|
|
|
41
43
|
private sleep;
|
|
42
44
|
private withRetry;
|
|
43
45
|
private isRetryableErrorWithOptions;
|
|
44
|
-
trackLead(
|
|
45
|
-
trackSale(
|
|
46
|
+
trackLead(leadData: LeadPayload, options?: RequestOptions): Promise<import("./generated").TrackResponse>;
|
|
47
|
+
trackSale(saleData: SalePayload, options?: RequestOptions): Promise<import("./generated").TrackResponse>;
|
|
46
48
|
}
|
package/dist/src/client.js
CHANGED
|
@@ -96,14 +96,22 @@ class CMS {
|
|
|
96
96
|
}
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
99
|
-
async trackLead(
|
|
99
|
+
async trackLead(leadData, options) {
|
|
100
|
+
const payload = {
|
|
101
|
+
type: "lead",
|
|
102
|
+
lead: leadData,
|
|
103
|
+
};
|
|
100
104
|
return this.withRetry(async () => {
|
|
101
|
-
return this.events.trackLead(
|
|
105
|
+
return this.events.trackLead(payload);
|
|
102
106
|
}, options);
|
|
103
107
|
}
|
|
104
|
-
async trackSale(
|
|
108
|
+
async trackSale(saleData, options) {
|
|
109
|
+
const payload = {
|
|
110
|
+
type: "sale",
|
|
111
|
+
sale: saleData,
|
|
112
|
+
};
|
|
105
113
|
return this.withRetry(async () => {
|
|
106
|
-
return this.events.trackSale(
|
|
114
|
+
return this.events.trackSale(payload);
|
|
107
115
|
}, options);
|
|
108
116
|
}
|
|
109
117
|
}
|
package/dist/src/errors/base.js
CHANGED
|
@@ -14,6 +14,19 @@ class CMSAPIError extends Error {
|
|
|
14
14
|
this.rawError = rawError;
|
|
15
15
|
this.request = request;
|
|
16
16
|
this.response = response;
|
|
17
|
+
// Make heavy properties non-enumerable so console.log / inspection
|
|
18
|
+
// stays focused on the high-level error information.
|
|
19
|
+
try {
|
|
20
|
+
Object.defineProperties(this, {
|
|
21
|
+
rawError: { enumerable: false },
|
|
22
|
+
request: { enumerable: false },
|
|
23
|
+
response: { enumerable: false },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// If defineProperties fails for any reason, we still keep the data;
|
|
28
|
+
// it will just remain enumerable.
|
|
29
|
+
}
|
|
17
30
|
}
|
|
18
31
|
}
|
|
19
32
|
exports.CMSAPIError = CMSAPIError;
|
package/dist/src/errors.js
CHANGED
|
@@ -25,6 +25,14 @@ Object.defineProperty(exports, "createSpecificError", { enumerable: true, get: f
|
|
|
25
25
|
*/
|
|
26
26
|
function handleApiError(error, request, response) {
|
|
27
27
|
var _a, _b, _c;
|
|
28
|
+
const sanitizeRequest = (req) => {
|
|
29
|
+
if (!req || typeof req !== "object")
|
|
30
|
+
return undefined;
|
|
31
|
+
return {
|
|
32
|
+
url: req.url,
|
|
33
|
+
method: req.method,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
28
36
|
// Error with response from server
|
|
29
37
|
if ((error === null || error === void 0 ? void 0 : error.response) || response) {
|
|
30
38
|
const res = (error === null || error === void 0 ? void 0 : error.response) || response;
|
|
@@ -33,7 +41,7 @@ function handleApiError(error, request, response) {
|
|
|
33
41
|
res.statusText ||
|
|
34
42
|
"Unknown API Error";
|
|
35
43
|
// Create error with request/response metadata
|
|
36
|
-
const apiError = new base_1.CMSAPIError(`CMS API Error: ${statusCode} - ${message}`, statusCode, ((_b = res.data) === null || _b === void 0 ? void 0 : _b.type) || "api_error", (_c = res.data) !== null && _c !== void 0 ? _c : error, request || (error === null || error === void 0 ? void 0 : error.request), {
|
|
44
|
+
const apiError = new base_1.CMSAPIError(`CMS API Error: ${statusCode} - ${message}`, statusCode, ((_b = res.data) === null || _b === void 0 ? void 0 : _b.type) || "api_error", (_c = res.data) !== null && _c !== void 0 ? _c : error, sanitizeRequest(request || (error === null || error === void 0 ? void 0 : error.request)), {
|
|
37
45
|
status: statusCode,
|
|
38
46
|
statusText: res.statusText || "",
|
|
39
47
|
data: res.data,
|
|
@@ -43,7 +51,7 @@ function handleApiError(error, request, response) {
|
|
|
43
51
|
}
|
|
44
52
|
// Error where request was made but no response received
|
|
45
53
|
if ((error === null || error === void 0 ? void 0 : error.request) || request) {
|
|
46
|
-
const req = (error === null || error === void 0 ? void 0 : error.request) || request;
|
|
54
|
+
const req = sanitizeRequest((error === null || error === void 0 ? void 0 : error.request) || request);
|
|
47
55
|
const isTimeout = error.code === "ECONNABORTED" ||
|
|
48
56
|
typeof error.message === "string" &&
|
|
49
57
|
error.message.toLowerCase().includes("timeout");
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { CMS } from "../client";
|
|
1
|
+
import { CMS, type LeadPayload } from "../client";
|
|
2
2
|
import type { TrackResponse } from "../generated/api";
|
|
3
3
|
import { Result } from "../types/result";
|
|
4
4
|
import { CMSAPIError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, BadGatewayError, ServiceUnavailableError, GatewayTimeoutError } from "../errors";
|
|
5
5
|
export type TrackLeadError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitError | InternalServerError | BadGatewayError | ServiceUnavailableError | GatewayTimeoutError | CMSAPIError;
|
|
6
|
-
export type LeadPayload = Record<string, unknown>;
|
|
7
6
|
/**
|
|
8
7
|
* Track a lead for a short link.
|
|
9
8
|
*
|
|
@@ -43,11 +43,7 @@ const errors_1 = require("../errors");
|
|
|
43
43
|
*/
|
|
44
44
|
async function trackLead(client, leadData) {
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
type: "lead",
|
|
48
|
-
lead: leadData,
|
|
49
|
-
};
|
|
50
|
-
const value = await client.trackLead(payload);
|
|
46
|
+
const value = await client.trackLead(leadData);
|
|
51
47
|
return (0, result_1.ok)(value);
|
|
52
48
|
}
|
|
53
49
|
catch (error) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { CMS } from "../client";
|
|
1
|
+
import { CMS, type SalePayload } from "../client";
|
|
2
2
|
import type { TrackResponse } from "../generated/api";
|
|
3
3
|
import { Result } from "../types/result";
|
|
4
4
|
import { CMSAPIError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, BadGatewayError, ServiceUnavailableError, GatewayTimeoutError } from "../errors";
|
|
5
5
|
export type TrackSaleError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitError | InternalServerError | BadGatewayError | ServiceUnavailableError | GatewayTimeoutError | CMSAPIError;
|
|
6
|
-
export type SalePayload = Record<string, unknown>;
|
|
7
6
|
/**
|
|
8
7
|
* Track a sale for a short link.
|
|
9
8
|
*
|
|
@@ -45,11 +45,7 @@ const errors_1 = require("../errors");
|
|
|
45
45
|
*/
|
|
46
46
|
async function trackSale(client, saleData) {
|
|
47
47
|
try {
|
|
48
|
-
const
|
|
49
|
-
type: "sale",
|
|
50
|
-
sale: saleData,
|
|
51
|
-
};
|
|
52
|
-
const value = await client.trackSale(payload);
|
|
48
|
+
const value = await client.trackSale(saleData);
|
|
53
49
|
return (0, result_1.ok)(value);
|
|
54
50
|
}
|
|
55
51
|
catch (error) {
|
|
@@ -249,10 +249,8 @@ async function performFetchRequest(requestArgs, basePath) {
|
|
|
249
249
|
err.code = "ECONNABORTED";
|
|
250
250
|
}
|
|
251
251
|
if (!err.response) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
options: requestArgs.options,
|
|
255
|
-
};
|
|
252
|
+
// Attach only minimal request info to avoid leaking sensitive data
|
|
253
|
+
err.request = { url };
|
|
256
254
|
}
|
|
257
255
|
throw err;
|
|
258
256
|
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CMS API
|
|
3
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.0.0
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
1
|
import type { Configuration } from './configuration';
|
|
13
2
|
export type RequestOptions = RequestInit & {
|
|
14
3
|
/**
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* CMS API
|
|
6
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 1.0.0
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
17
|
-
exports.BASE_PATH = "https://www.cutmeshort.com/
|
|
4
|
+
exports.BASE_PATH = "https://www.cutmeshort.com/sdk".replace(/\/+$/, "");
|
|
18
5
|
exports.COLLECTION_FORMATS = {
|
|
19
6
|
csv: ",",
|
|
20
7
|
ssv: " ",
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CMS API
|
|
3
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.0.0
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
1
|
import type { Configuration } from "./configuration";
|
|
13
2
|
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
14
3
|
/**
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* CMS API
|
|
6
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 1.0.0
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
17
4
|
const base_1 = require("./base");
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CMS API
|
|
3
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.0.0
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
1
|
interface AWSv4Configuration {
|
|
13
2
|
options?: {
|
|
14
3
|
region?: string;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/**
|
|
4
|
-
* CMS API
|
|
5
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.0.0
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.Configuration = void 0;
|
|
16
4
|
class Configuration {
|