crovver-node 1.0.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.
@@ -0,0 +1,479 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CrovverClient = exports.CrovverError = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const constants_1 = require("./constants");
9
+ /**
10
+ * Custom error class for Crovver API errors
11
+ */
12
+ class CrovverError extends Error {
13
+ constructor(message, statusCode, code, originalError) {
14
+ super(message);
15
+ this.name = "CrovverError";
16
+ this.statusCode = statusCode;
17
+ this.code = code;
18
+ this.originalError = originalError;
19
+ this.isRetryable = CrovverError.isRetryableStatus(statusCode);
20
+ // Maintains proper stack trace for where error was thrown (V8 engines)
21
+ if (Error.captureStackTrace) {
22
+ Error.captureStackTrace(this, CrovverError);
23
+ }
24
+ }
25
+ /**
26
+ * Check if a status code indicates a retryable error
27
+ * - 5xx: Server errors (temporary)
28
+ * - 429: Rate limited
29
+ * - 408: Request timeout
30
+ * - undefined: Network errors
31
+ */
32
+ static isRetryableStatus(status) {
33
+ if (!status)
34
+ return true; // Network errors are retryable
35
+ return status >= 500 || status === 429 || status === 408;
36
+ }
37
+ /**
38
+ * Convert to JSON for logging
39
+ */
40
+ toJSON() {
41
+ return {
42
+ name: this.name,
43
+ message: this.message,
44
+ statusCode: this.statusCode,
45
+ code: this.code,
46
+ isRetryable: this.isRetryable,
47
+ };
48
+ }
49
+ }
50
+ exports.CrovverError = CrovverError;
51
+ async function sleep(ms) {
52
+ return new Promise((resolve) => setTimeout(resolve, ms));
53
+ }
54
+ function calculateBackoff(attempt, baseDelay, maxDelay) {
55
+ const delay = Math.min(baseDelay * Math.pow(2, attempt), maxDelay);
56
+ // Add jitter (±25%)
57
+ const jitter = delay * 0.25 * (Math.random() * 2 - 1);
58
+ return Math.round(delay + jitter);
59
+ }
60
+ // ════════════════════════════════════════════════════════════════════════
61
+ // CROVVER CLIENT
62
+ // ════════════════════════════════════════════════════════════════════════
63
+ class CrovverClient {
64
+ constructor(config) {
65
+ if (!config.apiKey) {
66
+ throw new Error("CrovverConfig.apiKey is required");
67
+ }
68
+ this.config = {
69
+ ...config,
70
+ maxRetries: config.maxRetries ?? 3,
71
+ debug: config.debug ?? false,
72
+ };
73
+ this.logger =
74
+ config.logger ||
75
+ ((message, data) => {
76
+ if (this.config.debug) {
77
+ console.log(`[Crovver SDK] ${message}`, data ?? "");
78
+ }
79
+ });
80
+ this.client = axios_1.default.create({
81
+ baseURL: config.baseUrl ?? constants_1.CROVVER_BASE_URL,
82
+ timeout: config.timeout || 30000,
83
+ headers: {
84
+ Authorization: `Bearer ${config.apiKey}`,
85
+ "Content-Type": "application/json",
86
+ },
87
+ });
88
+ this.setupInterceptors();
89
+ }
90
+ setupInterceptors() {
91
+ // Request interceptor for logging
92
+ this.client.interceptors.request.use((config) => {
93
+ this.logger(`Request: ${config.method?.toUpperCase()} ${config.url}`, {
94
+ data: config.data,
95
+ params: config.params,
96
+ });
97
+ return config;
98
+ });
99
+ // Response interceptor to unwrap ApiResponse format
100
+ this.client.interceptors.response.use((response) => {
101
+ const apiResponse = response.data;
102
+ this.logger(`Response: ${response.status}`, {
103
+ success: apiResponse.success,
104
+ hasData: !!apiResponse.data,
105
+ });
106
+ if (apiResponse.success && apiResponse.data !== null) {
107
+ response.data = apiResponse.data;
108
+ return response;
109
+ }
110
+ else if (!apiResponse.success && apiResponse.error) {
111
+ throw new CrovverError(apiResponse.error.message, response.status, apiResponse.error.code);
112
+ }
113
+ return response;
114
+ }, (error) => {
115
+ if (error.response) {
116
+ const apiResponse = error.response.data;
117
+ this.logger(`Error Response: ${error.response.status}`, {
118
+ error: apiResponse?.error,
119
+ });
120
+ if (apiResponse?.error) {
121
+ throw new CrovverError(apiResponse.error.message, error.response.status, apiResponse.error.code, error);
122
+ }
123
+ throw new CrovverError("Request failed", error.response.status, undefined, error);
124
+ }
125
+ this.logger("Network Error", { message: error.message });
126
+ throw new CrovverError(error.message || "Network error", undefined, "NETWORK_ERROR", error);
127
+ });
128
+ }
129
+ /**
130
+ * Execute a request with automatic retry logic
131
+ */
132
+ async withRetry(operation, retryConfig) {
133
+ const config = {
134
+ maxRetries: retryConfig?.maxRetries ?? this.config.maxRetries,
135
+ baseDelay: retryConfig?.baseDelay ?? 1000,
136
+ maxDelay: retryConfig?.maxDelay ?? 30000,
137
+ };
138
+ let lastError;
139
+ for (let attempt = 0; attempt <= config.maxRetries; attempt++) {
140
+ try {
141
+ return await operation();
142
+ }
143
+ catch (error) {
144
+ lastError = error;
145
+ const isCrovverError = error instanceof CrovverError;
146
+ const isRetryable = isCrovverError ? error.isRetryable : true;
147
+ if (!isRetryable || attempt >= config.maxRetries) {
148
+ throw error;
149
+ }
150
+ const delay = calculateBackoff(attempt, config.baseDelay, config.maxDelay);
151
+ this.logger(`Retry attempt ${attempt + 1}/${config.maxRetries} after ${delay}ms`);
152
+ await sleep(delay);
153
+ }
154
+ }
155
+ throw lastError;
156
+ }
157
+ // ────────────────────────────────────────────────────────────────────────
158
+ // TENANT MANAGEMENT (B2B Only)
159
+ // ────────────────────────────────────────────────────────────────────────
160
+ /**
161
+ * Create a new tenant (B2B organizations only)
162
+ *
163
+ * For D2C organizations, tenants are automatically created during checkout.
164
+ *
165
+ * @param request - Tenant creation request
166
+ * @returns Created tenant and owner information
167
+ * @throws {CrovverError} If the organization is D2C or tenant already exists
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * const result = await crovver.createTenant({
172
+ * externalTenantId: 'company-123',
173
+ * name: 'Acme Corporation',
174
+ * ownerExternalUserId: 'user-456',
175
+ * ownerEmail: 'admin@acme.com',
176
+ * });
177
+ * console.log('Tenant created:', result.tenant.id);
178
+ * ```
179
+ */
180
+ async createTenant(request) {
181
+ return this.withRetry(async () => {
182
+ const response = await this.client.post("/api/public/tenants", request);
183
+ return response.data;
184
+ });
185
+ }
186
+ /**
187
+ * Get tenant information by external tenant ID
188
+ *
189
+ * @param externalTenantId - The external tenant ID from your SaaS app
190
+ * @returns Tenant information with members
191
+ *
192
+ * @example
193
+ * ```typescript
194
+ * const { tenant, members } = await crovver.getTenant('company-123');
195
+ * console.log(`Tenant: ${tenant.name}`);
196
+ * console.log(`Members: ${members.length}`);
197
+ * ```
198
+ */
199
+ async getTenant(externalTenantId) {
200
+ return this.withRetry(async () => {
201
+ const response = await this.client.get("/api/public/tenants", {
202
+ params: { externalUserId: externalTenantId },
203
+ });
204
+ return response.data;
205
+ });
206
+ }
207
+ // ────────────────────────────────────────────────────────────────────────
208
+ // PLANS
209
+ // ────────────────────────────────────────────────────────────────────────
210
+ /**
211
+ * Get all available plans for the organization
212
+ *
213
+ * Use this to render pricing pages or display upgrade options.
214
+ *
215
+ * @returns List of all active plans with pricing and features
216
+ *
217
+ * @example
218
+ * ```typescript
219
+ * const { plans } = await crovver.getPlans();
220
+ * plans.forEach(plan => {
221
+ * console.log(`${plan.name}: $${plan.pricing.amount}/${plan.pricing.interval}`);
222
+ * });
223
+ * ```
224
+ */
225
+ async getPlans() {
226
+ return this.withRetry(async () => {
227
+ const response = await this.client.get("/api/public/plans");
228
+ return response.data;
229
+ });
230
+ }
231
+ // ────────────────────────────────────────────────────────────────────────
232
+ // SUBSCRIPTIONS
233
+ // ────────────────────────────────────────────────────────────────────────
234
+ /**
235
+ * Get active subscriptions for a tenant/user
236
+ *
237
+ * @param requestingEntityId - External tenant ID (B2B) or user ID (D2C)
238
+ * @returns Active subscriptions with plan and billing details
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * const { subscriptions, tenant } = await crovver.getSubscriptions('company-123');
243
+ * console.log(`${tenant.name} has ${subscriptions.length} subscriptions`);
244
+ * ```
245
+ */
246
+ async getSubscriptions(requestingEntityId) {
247
+ return this.withRetry(async () => {
248
+ const response = await this.client.get("/api/public/subscriptions", {
249
+ params: { requestingEntityId },
250
+ });
251
+ return response.data;
252
+ });
253
+ }
254
+ // ────────────────────────────────────────────────────────────────────────
255
+ // CHECKOUT
256
+ // ────────────────────────────────────────────────────────────────────────
257
+ /**
258
+ * Create a checkout session for payment
259
+ *
260
+ * For B2B: Provide requestingUserId and requestingTenantId
261
+ * For D2C: Provide requestingUserId, userEmail, and userName (tenant auto-created)
262
+ *
263
+ * @param request - Checkout session request
264
+ * @returns Checkout URL to redirect the user to
265
+ *
266
+ * @example
267
+ * ```typescript
268
+ * // B2B checkout
269
+ * const checkout = await crovver.createCheckoutSession({
270
+ * requestingUserId: 'user-456',
271
+ * requestingTenantId: 'company-123',
272
+ * planId: 'plan-uuid',
273
+ * provider: 'stripe',
274
+ * successUrl: 'https://myapp.com/success',
275
+ * cancelUrl: 'https://myapp.com/cancel',
276
+ * });
277
+ * window.location.href = checkout.checkoutUrl;
278
+ * ```
279
+ */
280
+ async createCheckoutSession(request) {
281
+ // Checkout operations should not be retried to avoid duplicate payments
282
+ const response = await this.client.post("/api/public/checkout", request);
283
+ return response.data;
284
+ }
285
+ // ────────────────────────────────────────────────────────────────────────
286
+ // ENTITLEMENT CHECKS
287
+ // ────────────────────────────────────────────────────────────────────────
288
+ /**
289
+ * Check if a tenant/user can access a specific feature
290
+ *
291
+ * @param requestingEntityId - External tenant ID (B2B) or user ID (D2C)
292
+ * @param featureKey - The feature key to check
293
+ * @returns Whether access is allowed
294
+ *
295
+ * @example
296
+ * ```typescript
297
+ * const canAccess = await crovver.canAccess('company-123', 'advanced-analytics');
298
+ * if (canAccess) {
299
+ * // Show the feature
300
+ * } else {
301
+ * // Show upgrade prompt
302
+ * }
303
+ * ```
304
+ */
305
+ async canAccess(requestingEntityId, featureKey) {
306
+ return this.withRetry(async () => {
307
+ const response = await this.client.post("/api/public/can-access", {
308
+ requestingEntityId,
309
+ featureKey,
310
+ });
311
+ return response.data.canAccess;
312
+ });
313
+ }
314
+ /**
315
+ * Record usage for a metric
316
+ *
317
+ * @param requestingEntityId - External tenant ID (B2B) or user ID (D2C)
318
+ * @param metric - The metric key to record usage for
319
+ * @param value - Usage value (default: 1)
320
+ * @param metadata - Optional metadata
321
+ *
322
+ * @example
323
+ * ```typescript
324
+ * await crovver.recordUsage('company-123', 'api-calls', 1, {
325
+ * endpoint: '/api/v1/users',
326
+ * method: 'GET'
327
+ * });
328
+ * ```
329
+ */
330
+ async recordUsage(requestingEntityId, metric, value = 1, metadata) {
331
+ return this.withRetry(async () => {
332
+ const response = await this.client.post("/api/public/record-usage", {
333
+ requestingEntityId,
334
+ metric,
335
+ value,
336
+ metadata,
337
+ });
338
+ return response.data;
339
+ });
340
+ }
341
+ /**
342
+ * Check current usage and limits for a metric
343
+ *
344
+ * @param requestingEntityId - External tenant ID (B2B) or user ID (D2C)
345
+ * @param metric - The metric key to check
346
+ * @returns Usage information including current value, limit, and remaining
347
+ *
348
+ * @example
349
+ * ```typescript
350
+ * const usage = await crovver.checkUsageLimit('company-123', 'api-calls');
351
+ * console.log(`Used: ${usage.current} / ${usage.limit}`);
352
+ * console.log(`Remaining: ${usage.remaining}`);
353
+ * ```
354
+ */
355
+ async checkUsageLimit(requestingEntityId, metric) {
356
+ return this.withRetry(async () => {
357
+ const response = await this.client.post("/api/public/check-usage-limit", {
358
+ requestingEntityId,
359
+ metric,
360
+ });
361
+ return response.data;
362
+ });
363
+ }
364
+ // ────────────────────────────────────────────────────────────────────────
365
+ // PRORATION (Seat-Based Plans)
366
+ // ────────────────────────────────────────────────────────────────────────
367
+ /**
368
+ * Create a proration checkout session for a mid-cycle seat capacity upgrade.
369
+ *
370
+ * The proration amount is calculated server-side. After successful payment
371
+ * the webhook will upgrade the subscription capacity automatically.
372
+ *
373
+ * @param params - Proration checkout details
374
+ * @returns Checkout URL, proration ID, and calculated amount
375
+ *
376
+ * @example
377
+ * ```typescript
378
+ * const checkout = await crovver.createProrationCheckout({
379
+ * requestingEntityId: 'company-123',
380
+ * newCapacity: 15,
381
+ * planId: 'plan-uuid', // optional
382
+ * successUrl: 'https://myapp.com/success',
383
+ * cancelUrl: 'https://myapp.com/cancel',
384
+ * });
385
+ *
386
+ * if (checkout.checkoutUrl) {
387
+ * window.location.href = checkout.checkoutUrl;
388
+ * }
389
+ * ```
390
+ */
391
+ async createProrationCheckout(params) {
392
+ // Payment operations should not be retried to avoid duplicate charges
393
+ const response = await this.client.post("/api/public/capacity/proration-checkout", {
394
+ requestingEntityId: params.requestingEntityId,
395
+ newCapacity: params.newCapacity,
396
+ planId: params.planId,
397
+ successUrl: params.successUrl,
398
+ cancelUrl: params.cancelUrl,
399
+ });
400
+ return response.data;
401
+ }
402
+ // ────────────────────────────────────────────────────────────────────────
403
+ // SUBSCRIPTION MANAGEMENT
404
+ // ────────────────────────────────────────────────────────────────────────
405
+ /**
406
+ * Cancel an active subscription.
407
+ *
408
+ * The subscription remains active until the end of the current billing
409
+ * period (cancel-at-period-end behaviour).
410
+ *
411
+ * @param subscriptionId - The Crovver subscription ID
412
+ * @param reason - Cancellation reason (required by the API)
413
+ * @param feedback - Optional free-text feedback
414
+ *
415
+ * @example
416
+ * ```typescript
417
+ * const result = await crovver.cancelSubscription(
418
+ * 'sub-uuid',
419
+ * 'too_expensive',
420
+ * 'Pricing is a bit high for our team size',
421
+ * );
422
+ * console.log(`Subscription ends at: ${result.willEndAt}`);
423
+ * ```
424
+ */
425
+ async cancelSubscription(subscriptionId, reason, feedback) {
426
+ return this.withRetry(async () => {
427
+ const response = await this.client.post(`/api/public/subscriptions/${subscriptionId}/cancel`, { reason, feedback });
428
+ return response.data;
429
+ });
430
+ }
431
+ // ────────────────────────────────────────────────────────────────────────
432
+ // BILLING / INVOICES
433
+ // ────────────────────────────────────────────────────────────────────────
434
+ /**
435
+ * Get invoices for a tenant.
436
+ *
437
+ * @param externalTenantId - External tenant ID
438
+ * @returns List of invoices
439
+ *
440
+ * @example
441
+ * ```typescript
442
+ * const { invoices } = await crovver.getInvoices('company-123');
443
+ * invoices.forEach(inv => {
444
+ * console.log(`${inv.invoice_number}: ${inv.total_amount} ${inv.currency}`);
445
+ * });
446
+ * ```
447
+ */
448
+ async getInvoices(externalTenantId) {
449
+ return this.withRetry(async () => {
450
+ const response = await this.client.get("/api/public/billing/invoices", { params: { externalTenantId } });
451
+ return response.data;
452
+ });
453
+ }
454
+ // ────────────────────────────────────────────────────────────────────────
455
+ // PAYMENT PROVIDERS
456
+ // ────────────────────────────────────────────────────────────────────────
457
+ /**
458
+ * Get list of supported payment providers
459
+ *
460
+ * Returns all payment providers available on the Crovver platform.
461
+ *
462
+ * @returns List of supported payment providers
463
+ *
464
+ * @example
465
+ * ```typescript
466
+ * const { providers } = await crovver.getSupportedProviders();
467
+ * providers.forEach(p => console.log(`${p.name}: ${p.code}`));
468
+ * ```
469
+ */
470
+ async getSupportedProviders() {
471
+ return this.withRetry(async () => {
472
+ const response = await this.client.get("/api/public/supported-providers");
473
+ return response.data;
474
+ });
475
+ }
476
+ }
477
+ exports.CrovverClient = CrovverClient;
478
+ exports.default = CrovverClient;
479
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAIe;AACf,2CAA+C;AAsC/C;;GAEG;AACH,MAAa,YAAa,SAAQ,KAAK;IAUrC,YACE,OAAe,EACf,UAAmB,EACnB,IAAa,EACb,aAAuB;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAE9D,uEAAuE;QACvE,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,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,SAAS,EACpD,EAAE,MAAM,EAAE,QAAQ,EAAE,CACrB,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,2EAA2E;IAC3E,qBAAqB;IACrB,2EAA2E;IAE3E;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,WAAW,CAAC,gBAAwB;QACxC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;YAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpC,8BAA8B,EAC9B,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,EAAE,CACjC,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,2EAA2E;IAC3E,oBAAoB;IACpB,2EAA2E;IAE3E;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,qBAAqB;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;YAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpC,iCAAiC,CAClC,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAliBD,sCAkiBC;AAED,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const CROVVER_BASE_URL = "https://app.crovver.com";
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC"}