@tolt/api 0.1.1 → 0.2.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.
Files changed (75) hide show
  1. package/dist/Client.d.ts +3 -0
  2. package/dist/Client.js +4 -0
  3. package/dist/api/resources/customers/client/Client.d.ts +3 -4
  4. package/dist/api/resources/customers/client/Client.js +6 -5
  5. package/dist/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +14 -0
  6. package/dist/api/resources/customers/client/requests/index.d.ts +1 -0
  7. package/dist/api/resources/customers/types/index.d.ts +0 -1
  8. package/dist/api/resources/customers/types/index.js +0 -1
  9. package/dist/api/resources/embed/client/Client.d.ts +30 -0
  10. package/dist/api/resources/embed/client/Client.js +72 -0
  11. package/dist/api/resources/embed/client/index.d.ts +1 -0
  12. package/dist/api/resources/embed/client/index.js +1 -0
  13. package/dist/api/resources/embed/client/requests/CreateEmbedTokenRequest.d.ts +14 -0
  14. package/dist/api/resources/embed/client/requests/CreateEmbedTokenRequest.js +2 -0
  15. package/dist/api/resources/embed/client/requests/index.d.ts +1 -0
  16. package/dist/api/resources/embed/client/requests/index.js +1 -0
  17. package/dist/api/resources/embed/exports.d.ts +2 -0
  18. package/dist/api/resources/embed/exports.js +3 -0
  19. package/dist/api/resources/embed/index.d.ts +2 -0
  20. package/dist/api/resources/embed/index.js +2 -0
  21. package/dist/api/resources/embed/types/CreateEmbedTokenResponse.d.ts +6 -0
  22. package/dist/api/resources/embed/types/CreateEmbedTokenResponse.js +2 -0
  23. package/dist/api/resources/embed/types/index.d.ts +1 -0
  24. package/dist/api/resources/embed/types/index.js +1 -0
  25. package/dist/api/resources/index.d.ts +3 -0
  26. package/dist/api/resources/index.js +3 -0
  27. package/dist/api/resources/reports/client/Client.d.ts +56 -2
  28. package/dist/api/resources/reports/client/Client.js +249 -2
  29. package/dist/api/resources/reports/client/requests/ReportsCustomerStatsRequest.d.ts +9 -0
  30. package/dist/api/resources/reports/client/requests/ReportsCustomerStatsRequest.js +2 -0
  31. package/dist/api/resources/reports/client/requests/ReportsLinksRequest.d.ts +14 -0
  32. package/dist/api/resources/reports/client/requests/ReportsLinksRequest.js +2 -0
  33. package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.d.ts +14 -0
  34. package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.js +2 -0
  35. package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.d.ts +11 -0
  36. package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.js +2 -0
  37. package/dist/api/resources/reports/client/requests/index.d.ts +4 -0
  38. package/dist/api/resources/reports/types/ReportsCustomerStatsResponse.d.ts +6 -0
  39. package/dist/api/resources/reports/types/ReportsCustomerStatsResponse.js +2 -0
  40. package/dist/api/resources/reports/types/ReportsLinksRequestOrder.d.ts +5 -0
  41. package/dist/api/resources/reports/types/ReportsLinksRequestOrder.js +5 -0
  42. package/dist/api/resources/reports/types/ReportsLinksRequestSort.d.ts +7 -0
  43. package/dist/api/resources/reports/types/ReportsLinksRequestSort.js +7 -0
  44. package/dist/api/resources/reports/types/ReportsLinksResponse.d.ts +7 -0
  45. package/dist/api/resources/reports/types/ReportsLinksResponse.js +2 -0
  46. package/dist/api/resources/reports/types/ReportsPartnersRequestOrder.d.ts +5 -0
  47. package/dist/api/resources/reports/types/ReportsPartnersRequestOrder.js +5 -0
  48. package/dist/api/resources/reports/types/ReportsPartnersRequestSort.d.ts +7 -0
  49. package/dist/api/resources/reports/types/ReportsPartnersRequestSort.js +7 -0
  50. package/dist/api/resources/reports/types/ReportsPartnersResponse.d.ts +7 -0
  51. package/dist/api/resources/reports/types/ReportsPartnersResponse.js +2 -0
  52. package/dist/api/resources/reports/types/ReportsTimeseriesRequestGranularity.d.ts +6 -0
  53. package/dist/api/resources/reports/types/ReportsTimeseriesRequestGranularity.js +6 -0
  54. package/dist/api/resources/reports/types/ReportsTimeseriesResponse.d.ts +6 -0
  55. package/dist/api/resources/reports/types/ReportsTimeseriesResponse.js +2 -0
  56. package/dist/api/resources/reports/types/index.d.ts +9 -0
  57. package/dist/api/resources/reports/types/index.js +9 -0
  58. package/dist/api/types/EmbedToken.d.ts +4 -0
  59. package/dist/api/types/EmbedToken.js +2 -0
  60. package/dist/api/types/ReportsCustomerStats.d.ts +6 -0
  61. package/dist/api/types/ReportsCustomerStats.js +2 -0
  62. package/dist/api/types/ReportsLinkRow.d.ts +12 -0
  63. package/dist/api/types/ReportsLinkRow.js +2 -0
  64. package/dist/api/types/ReportsOverview.d.ts +2 -2
  65. package/dist/api/types/ReportsPartnerRow.d.ts +15 -0
  66. package/dist/api/types/ReportsPartnerRow.js +2 -0
  67. package/dist/api/types/ReportsTimeseriesPoint.d.ts +10 -0
  68. package/dist/api/types/ReportsTimeseriesPoint.js +2 -0
  69. package/dist/api/types/index.d.ts +5 -0
  70. package/dist/api/types/index.js +5 -0
  71. package/dist/environments.d.ts +1 -1
  72. package/dist/environments.js +1 -1
  73. package/package.json +1 -1
  74. package/dist/api/resources/customers/types/CreateCustomerRequest.d.ts +0 -1
  75. /package/dist/api/resources/customers/{types → client/requests}/CreateCustomerRequest.js +0 -0
package/dist/Client.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ClicksClient } from "./api/resources/clicks/client/Client.js";
2
2
  import { CommissionsClient } from "./api/resources/commissions/client/Client.js";
3
3
  import { CustomersClient } from "./api/resources/customers/client/Client.js";
4
+ import { EmbedClient } from "./api/resources/embed/client/Client.js";
4
5
  import { FlowsClient } from "./api/resources/flows/client/Client.js";
5
6
  import { GroupsClient } from "./api/resources/groups/client/Client.js";
6
7
  import { LinksClient } from "./api/resources/links/client/Client.js";
@@ -19,6 +20,7 @@ export declare namespace ToltApiClient {
19
20
  }
20
21
  export declare class ToltApiClient {
21
22
  protected readonly _options: NormalizedClientOptionsWithAuth<ToltApiClient.Options>;
23
+ protected _embed: EmbedClient | undefined;
22
24
  protected _groups: GroupsClient | undefined;
23
25
  protected _flows: FlowsClient | undefined;
24
26
  protected _clicks: ClicksClient | undefined;
@@ -31,6 +33,7 @@ export declare class ToltApiClient {
31
33
  protected _promotionCodes: PromotionCodesClient | undefined;
32
34
  protected _reports: ReportsClient | undefined;
33
35
  constructor(options: ToltApiClient.Options);
36
+ get embed(): EmbedClient;
34
37
  get groups(): GroupsClient;
35
38
  get flows(): FlowsClient;
36
39
  get clicks(): ClicksClient;
package/dist/Client.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { ClicksClient } from "./api/resources/clicks/client/Client.js";
3
3
  import { CommissionsClient } from "./api/resources/commissions/client/Client.js";
4
4
  import { CustomersClient } from "./api/resources/customers/client/Client.js";
5
+ import { EmbedClient } from "./api/resources/embed/client/Client.js";
5
6
  import { FlowsClient } from "./api/resources/flows/client/Client.js";
6
7
  import { GroupsClient } from "./api/resources/groups/client/Client.js";
7
8
  import { LinksClient } from "./api/resources/links/client/Client.js";
@@ -16,6 +17,9 @@ export class ToltApiClient {
16
17
  constructor(options) {
17
18
  this._options = normalizeClientOptionsWithAuth(options);
18
19
  }
20
+ get embed() {
21
+ return (this._embed ??= new EmbedClient(this._options));
22
+ }
19
23
  get groups() {
20
24
  return (this._groups ??= new GroupsClient(this._options));
21
25
  }
@@ -30,15 +30,14 @@ export declare class CustomersClient {
30
30
  *
31
31
  * @throws {@link ToltApi.BadRequestError}
32
32
  * @throws {@link ToltApi.UnauthorizedError}
33
+ * @throws {@link ToltApi.NotFoundError}
33
34
  * @throws {@link errors.ToltApiError}
34
35
  * @throws {@link errors.ToltApiTimeoutError}
35
36
  *
36
37
  * @example
37
- * await client.customers.createCustomer({
38
- * "key": "value"
39
- * })
38
+ * await client.customers.createCustomer()
40
39
  */
41
- createCustomer(request: ToltApi.CreateCustomerRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateCustomerResponse>;
40
+ createCustomer(request?: ToltApi.CreateCustomerRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateCustomerResponse>;
42
41
  private __createCustomer;
43
42
  /**
44
43
  * @param {ToltApi.GetCustomerRequest} request
@@ -82,18 +82,17 @@ export class CustomersClient {
82
82
  *
83
83
  * @throws {@link ToltApi.BadRequestError}
84
84
  * @throws {@link ToltApi.UnauthorizedError}
85
+ * @throws {@link ToltApi.NotFoundError}
85
86
  * @throws {@link errors.ToltApiError}
86
87
  * @throws {@link errors.ToltApiTimeoutError}
87
88
  *
88
89
  * @example
89
- * await client.customers.createCustomer({
90
- * "key": "value"
91
- * })
90
+ * await client.customers.createCustomer()
92
91
  */
93
- createCustomer(request, requestOptions) {
92
+ createCustomer(request = {}, requestOptions) {
94
93
  return core.HttpResponsePromise.fromPromise(this.__createCustomer(request, requestOptions));
95
94
  }
96
- async __createCustomer(request, requestOptions) {
95
+ async __createCustomer(request = {}, requestOptions) {
97
96
  const _authRequest = await this._options.authProvider.getAuthRequest();
98
97
  const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
99
98
  const _response = await core.fetcher({
@@ -121,6 +120,8 @@ export class CustomersClient {
121
120
  throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
122
121
  case 401:
123
122
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
123
+ case 404:
124
+ throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
124
125
  default:
125
126
  throw new errors.ToltApiError({
126
127
  statusCode: _response.error.statusCode,
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface CreateCustomerRequest {
6
+ email?: string;
7
+ name?: string;
8
+ customerId?: string;
9
+ status?: string;
10
+ subscriptionId?: string;
11
+ clickId?: string;
12
+ linkId?: string;
13
+ partnerId?: string;
14
+ }
@@ -1,3 +1,4 @@
1
+ export type { CreateCustomerRequest } from "./CreateCustomerRequest.js";
1
2
  export type { DeleteCustomerRequest } from "./DeleteCustomerRequest.js";
2
3
  export type { GetCustomerRequest } from "./GetCustomerRequest.js";
3
4
  export type { ListCustomersRequest } from "./ListCustomersRequest.js";
@@ -1,4 +1,3 @@
1
- export * from "./CreateCustomerRequest.js";
2
1
  export * from "./CreateCustomerResponse.js";
3
2
  export * from "./DeleteCustomerResponse.js";
4
3
  export * from "./GetCustomerResponse.js";
@@ -1,4 +1,3 @@
1
- export * from "./CreateCustomerRequest.js";
2
1
  export * from "./CreateCustomerResponse.js";
3
2
  export * from "./DeleteCustomerResponse.js";
4
3
  export * from "./GetCustomerResponse.js";
@@ -0,0 +1,30 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as ToltApi from "../../../index.js";
5
+ export declare namespace EmbedClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class EmbedClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<EmbedClient.Options>;
12
+ constructor(options: EmbedClient.Options);
13
+ /**
14
+ * Mint a short-lived, partner-scoped token for the embedded referral dashboard. Safe to send to the browser.
15
+ *
16
+ * @param {ToltApi.CreateEmbedTokenRequest} request
17
+ * @param {EmbedClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link ToltApi.BadRequestError}
20
+ * @throws {@link ToltApi.UnauthorizedError}
21
+ * @throws {@link ToltApi.NotFoundError}
22
+ * @throws {@link errors.ToltApiError}
23
+ * @throws {@link errors.ToltApiTimeoutError}
24
+ *
25
+ * @example
26
+ * await client.embed.createEmbedToken()
27
+ */
28
+ createEmbedToken(request?: ToltApi.CreateEmbedTokenRequest, requestOptions?: EmbedClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateEmbedTokenResponse>;
29
+ private __createEmbedToken;
30
+ }
@@ -0,0 +1,72 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import { mergeHeaders } from "../../../../core/headers.js";
4
+ import * as core from "../../../../core/index.js";
5
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js";
6
+ import * as environments from "../../../../environments.js";
7
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
8
+ import * as errors from "../../../../errors/index.js";
9
+ import * as ToltApi from "../../../index.js";
10
+ export class EmbedClient {
11
+ constructor(options) {
12
+ this._options = normalizeClientOptionsWithAuth(options);
13
+ }
14
+ /**
15
+ * Mint a short-lived, partner-scoped token for the embedded referral dashboard. Safe to send to the browser.
16
+ *
17
+ * @param {ToltApi.CreateEmbedTokenRequest} request
18
+ * @param {EmbedClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link ToltApi.BadRequestError}
21
+ * @throws {@link ToltApi.UnauthorizedError}
22
+ * @throws {@link ToltApi.NotFoundError}
23
+ * @throws {@link errors.ToltApiError}
24
+ * @throws {@link errors.ToltApiTimeoutError}
25
+ *
26
+ * @example
27
+ * await client.embed.createEmbedToken()
28
+ */
29
+ createEmbedToken(request = {}, requestOptions) {
30
+ return core.HttpResponsePromise.fromPromise(this.__createEmbedToken(request, requestOptions));
31
+ }
32
+ async __createEmbedToken(request = {}, requestOptions) {
33
+ const _authRequest = await this._options.authProvider.getAuthRequest();
34
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
35
+ const _response = await core.fetcher({
36
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
37
+ (await core.Supplier.get(this._options.environment)) ??
38
+ environments.ToltApiEnvironment.Production, "v2/embed-tokens"),
39
+ method: "POST",
40
+ headers: _headers,
41
+ contentType: "application/json",
42
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
43
+ requestType: "json",
44
+ body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
45
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
46
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
47
+ abortSignal: requestOptions?.abortSignal,
48
+ fetchFn: this._options?.fetch,
49
+ logging: this._options.logging,
50
+ });
51
+ if (_response.ok) {
52
+ return { data: _response.body, rawResponse: _response.rawResponse };
53
+ }
54
+ if (_response.error.reason === "status-code") {
55
+ switch (_response.error.statusCode) {
56
+ case 400:
57
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
58
+ case 401:
59
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
60
+ case 404:
61
+ throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
62
+ default:
63
+ throw new errors.ToltApiError({
64
+ statusCode: _response.error.statusCode,
65
+ body: _response.error.body,
66
+ rawResponse: _response.rawResponse,
67
+ });
68
+ }
69
+ }
70
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/embed-tokens");
71
+ }
72
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface CreateEmbedTokenRequest {
6
+ partnerId?: string;
7
+ partner?: CreateEmbedTokenRequest.Partner;
8
+ }
9
+ export declare namespace CreateEmbedTokenRequest {
10
+ interface Partner {
11
+ email: string;
12
+ programId: string;
13
+ }
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { CreateEmbedTokenRequest } from "./CreateEmbedTokenRequest.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { EmbedClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { EmbedClient } from "./client/Client.js";
3
+ export * from "./client/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,6 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface CreateEmbedTokenResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.EmbedToken;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./CreateEmbedTokenResponse.js";
@@ -0,0 +1 @@
1
+ export * from "./CreateEmbedTokenResponse.js";
@@ -7,6 +7,9 @@ export * from "./commissions/types/index.js";
7
7
  export * from "./customers/client/requests/index.js";
8
8
  export * as customers from "./customers/index.js";
9
9
  export * from "./customers/types/index.js";
10
+ export * from "./embed/client/requests/index.js";
11
+ export * as embed from "./embed/index.js";
12
+ export * from "./embed/types/index.js";
10
13
  export * from "./flows/client/requests/index.js";
11
14
  export * as flows from "./flows/index.js";
12
15
  export * from "./flows/types/index.js";
@@ -7,6 +7,9 @@ export * from "./commissions/types/index.js";
7
7
  export * from "./customers/client/requests/index.js";
8
8
  export * as customers from "./customers/index.js";
9
9
  export * from "./customers/types/index.js";
10
+ export * from "./embed/client/requests/index.js";
11
+ export * as embed from "./embed/index.js";
12
+ export * from "./embed/types/index.js";
10
13
  export * from "./flows/client/requests/index.js";
11
14
  export * as flows from "./flows/index.js";
12
15
  export * from "./flows/types/index.js";
@@ -11,8 +11,6 @@ export declare class ReportsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<ReportsClient.Options>;
12
12
  constructor(options: ReportsClient.Options);
13
13
  /**
14
- * Aggregate revenue and commission totals (grouped by currency) plus commission, customer, and partner counts for the organization. Supports optional program_id and start_date/end_date filters.
15
- *
16
14
  * @param {ToltApi.ReportsOverviewRequest} request
17
15
  * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
18
16
  *
@@ -26,4 +24,60 @@ export declare class ReportsClient {
26
24
  */
27
25
  overview(request?: ToltApi.ReportsOverviewRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsOverviewResponse>;
28
26
  private __overview;
27
+ /**
28
+ * @param {ToltApi.ReportsPartnersRequest} request
29
+ * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link ToltApi.BadRequestError}
32
+ * @throws {@link ToltApi.UnauthorizedError}
33
+ * @throws {@link errors.ToltApiError}
34
+ * @throws {@link errors.ToltApiTimeoutError}
35
+ *
36
+ * @example
37
+ * await client.reports.partners()
38
+ */
39
+ partners(request?: ToltApi.ReportsPartnersRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsPartnersResponse>;
40
+ private __partners;
41
+ /**
42
+ * @param {ToltApi.ReportsLinksRequest} request
43
+ * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
44
+ *
45
+ * @throws {@link ToltApi.BadRequestError}
46
+ * @throws {@link ToltApi.UnauthorizedError}
47
+ * @throws {@link errors.ToltApiError}
48
+ * @throws {@link errors.ToltApiTimeoutError}
49
+ *
50
+ * @example
51
+ * await client.reports.links()
52
+ */
53
+ links(request?: ToltApi.ReportsLinksRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsLinksResponse>;
54
+ private __links;
55
+ /**
56
+ * @param {ToltApi.ReportsTimeseriesRequest} request
57
+ * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link ToltApi.BadRequestError}
60
+ * @throws {@link ToltApi.UnauthorizedError}
61
+ * @throws {@link errors.ToltApiError}
62
+ * @throws {@link errors.ToltApiTimeoutError}
63
+ *
64
+ * @example
65
+ * await client.reports.timeseries()
66
+ */
67
+ timeseries(request?: ToltApi.ReportsTimeseriesRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsTimeseriesResponse>;
68
+ private __timeseries;
69
+ /**
70
+ * @param {ToltApi.ReportsCustomerStatsRequest} request
71
+ * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
72
+ *
73
+ * @throws {@link ToltApi.BadRequestError}
74
+ * @throws {@link ToltApi.UnauthorizedError}
75
+ * @throws {@link errors.ToltApiError}
76
+ * @throws {@link errors.ToltApiTimeoutError}
77
+ *
78
+ * @example
79
+ * await client.reports.customerStats()
80
+ */
81
+ customerStats(request?: ToltApi.ReportsCustomerStatsRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsCustomerStatsResponse>;
82
+ private __customerStats;
29
83
  }
@@ -11,8 +11,6 @@ export class ReportsClient {
11
11
  this._options = normalizeClientOptionsWithAuth(options);
12
12
  }
13
13
  /**
14
- * Aggregate revenue and commission totals (grouped by currency) plus commission, customer, and partner counts for the organization. Supports optional program_id and start_date/end_date filters.
15
- *
16
14
  * @param {ToltApi.ReportsOverviewRequest} request
17
15
  * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
18
16
  *
@@ -72,4 +70,253 @@ export class ReportsClient {
72
70
  }
73
71
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/reports/overview");
74
72
  }
73
+ /**
74
+ * @param {ToltApi.ReportsPartnersRequest} request
75
+ * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
76
+ *
77
+ * @throws {@link ToltApi.BadRequestError}
78
+ * @throws {@link ToltApi.UnauthorizedError}
79
+ * @throws {@link errors.ToltApiError}
80
+ * @throws {@link errors.ToltApiTimeoutError}
81
+ *
82
+ * @example
83
+ * await client.reports.partners()
84
+ */
85
+ partners(request = {}, requestOptions) {
86
+ return core.HttpResponsePromise.fromPromise(this.__partners(request, requestOptions));
87
+ }
88
+ async __partners(request = {}, requestOptions) {
89
+ const { program_id: programId, start_date: startDate, end_date: endDate, limit, offset, sort, order } = request;
90
+ const _queryParams = {
91
+ program_id: programId,
92
+ start_date: startDate != null ? startDate : undefined,
93
+ end_date: endDate != null ? endDate : undefined,
94
+ limit,
95
+ offset,
96
+ sort: sort != null ? sort : undefined,
97
+ order: order != null ? order : undefined,
98
+ };
99
+ const _authRequest = await this._options.authProvider.getAuthRequest();
100
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
101
+ const _response = await core.fetcher({
102
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
103
+ (await core.Supplier.get(this._options.environment)) ??
104
+ environments.ToltApiEnvironment.Production, "v2/reports/partners"),
105
+ method: "GET",
106
+ headers: _headers,
107
+ queryString: core.url
108
+ .queryBuilder()
109
+ .addMany(_queryParams)
110
+ .mergeAdditional(requestOptions?.queryParams)
111
+ .build(),
112
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
113
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
114
+ abortSignal: requestOptions?.abortSignal,
115
+ fetchFn: this._options?.fetch,
116
+ logging: this._options.logging,
117
+ });
118
+ if (_response.ok) {
119
+ return { data: _response.body, rawResponse: _response.rawResponse };
120
+ }
121
+ if (_response.error.reason === "status-code") {
122
+ switch (_response.error.statusCode) {
123
+ case 400:
124
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
125
+ case 401:
126
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
127
+ default:
128
+ throw new errors.ToltApiError({
129
+ statusCode: _response.error.statusCode,
130
+ body: _response.error.body,
131
+ rawResponse: _response.rawResponse,
132
+ });
133
+ }
134
+ }
135
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/reports/partners");
136
+ }
137
+ /**
138
+ * @param {ToltApi.ReportsLinksRequest} request
139
+ * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
140
+ *
141
+ * @throws {@link ToltApi.BadRequestError}
142
+ * @throws {@link ToltApi.UnauthorizedError}
143
+ * @throws {@link errors.ToltApiError}
144
+ * @throws {@link errors.ToltApiTimeoutError}
145
+ *
146
+ * @example
147
+ * await client.reports.links()
148
+ */
149
+ links(request = {}, requestOptions) {
150
+ return core.HttpResponsePromise.fromPromise(this.__links(request, requestOptions));
151
+ }
152
+ async __links(request = {}, requestOptions) {
153
+ const { program_id: programId, start_date: startDate, end_date: endDate, limit, offset, sort, order } = request;
154
+ const _queryParams = {
155
+ program_id: programId,
156
+ start_date: startDate != null ? startDate : undefined,
157
+ end_date: endDate != null ? endDate : undefined,
158
+ limit,
159
+ offset,
160
+ sort: sort != null ? sort : undefined,
161
+ order: order != null ? order : undefined,
162
+ };
163
+ const _authRequest = await this._options.authProvider.getAuthRequest();
164
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
165
+ const _response = await core.fetcher({
166
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
167
+ (await core.Supplier.get(this._options.environment)) ??
168
+ environments.ToltApiEnvironment.Production, "v2/reports/links"),
169
+ method: "GET",
170
+ headers: _headers,
171
+ queryString: core.url
172
+ .queryBuilder()
173
+ .addMany(_queryParams)
174
+ .mergeAdditional(requestOptions?.queryParams)
175
+ .build(),
176
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
177
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
178
+ abortSignal: requestOptions?.abortSignal,
179
+ fetchFn: this._options?.fetch,
180
+ logging: this._options.logging,
181
+ });
182
+ if (_response.ok) {
183
+ return { data: _response.body, rawResponse: _response.rawResponse };
184
+ }
185
+ if (_response.error.reason === "status-code") {
186
+ switch (_response.error.statusCode) {
187
+ case 400:
188
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
189
+ case 401:
190
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
191
+ default:
192
+ throw new errors.ToltApiError({
193
+ statusCode: _response.error.statusCode,
194
+ body: _response.error.body,
195
+ rawResponse: _response.rawResponse,
196
+ });
197
+ }
198
+ }
199
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/reports/links");
200
+ }
201
+ /**
202
+ * @param {ToltApi.ReportsTimeseriesRequest} request
203
+ * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
204
+ *
205
+ * @throws {@link ToltApi.BadRequestError}
206
+ * @throws {@link ToltApi.UnauthorizedError}
207
+ * @throws {@link errors.ToltApiError}
208
+ * @throws {@link errors.ToltApiTimeoutError}
209
+ *
210
+ * @example
211
+ * await client.reports.timeseries()
212
+ */
213
+ timeseries(request = {}, requestOptions) {
214
+ return core.HttpResponsePromise.fromPromise(this.__timeseries(request, requestOptions));
215
+ }
216
+ async __timeseries(request = {}, requestOptions) {
217
+ const { program_id: programId, start_date: startDate, end_date: endDate, granularity } = request;
218
+ const _queryParams = {
219
+ program_id: programId,
220
+ start_date: startDate != null ? startDate : undefined,
221
+ end_date: endDate != null ? endDate : undefined,
222
+ granularity: granularity != null ? granularity : undefined,
223
+ };
224
+ const _authRequest = await this._options.authProvider.getAuthRequest();
225
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
226
+ const _response = await core.fetcher({
227
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
228
+ (await core.Supplier.get(this._options.environment)) ??
229
+ environments.ToltApiEnvironment.Production, "v2/reports/timeseries"),
230
+ method: "GET",
231
+ headers: _headers,
232
+ queryString: core.url
233
+ .queryBuilder()
234
+ .addMany(_queryParams)
235
+ .mergeAdditional(requestOptions?.queryParams)
236
+ .build(),
237
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
238
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
239
+ abortSignal: requestOptions?.abortSignal,
240
+ fetchFn: this._options?.fetch,
241
+ logging: this._options.logging,
242
+ });
243
+ if (_response.ok) {
244
+ return { data: _response.body, rawResponse: _response.rawResponse };
245
+ }
246
+ if (_response.error.reason === "status-code") {
247
+ switch (_response.error.statusCode) {
248
+ case 400:
249
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
250
+ case 401:
251
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
252
+ default:
253
+ throw new errors.ToltApiError({
254
+ statusCode: _response.error.statusCode,
255
+ body: _response.error.body,
256
+ rawResponse: _response.rawResponse,
257
+ });
258
+ }
259
+ }
260
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/reports/timeseries");
261
+ }
262
+ /**
263
+ * @param {ToltApi.ReportsCustomerStatsRequest} request
264
+ * @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
265
+ *
266
+ * @throws {@link ToltApi.BadRequestError}
267
+ * @throws {@link ToltApi.UnauthorizedError}
268
+ * @throws {@link errors.ToltApiError}
269
+ * @throws {@link errors.ToltApiTimeoutError}
270
+ *
271
+ * @example
272
+ * await client.reports.customerStats()
273
+ */
274
+ customerStats(request = {}, requestOptions) {
275
+ return core.HttpResponsePromise.fromPromise(this.__customerStats(request, requestOptions));
276
+ }
277
+ async __customerStats(request = {}, requestOptions) {
278
+ const { program_id: programId, start_date: startDate, end_date: endDate } = request;
279
+ const _queryParams = {
280
+ program_id: programId,
281
+ start_date: startDate != null ? startDate : undefined,
282
+ end_date: endDate != null ? endDate : undefined,
283
+ };
284
+ const _authRequest = await this._options.authProvider.getAuthRequest();
285
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
286
+ const _response = await core.fetcher({
287
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
288
+ (await core.Supplier.get(this._options.environment)) ??
289
+ environments.ToltApiEnvironment.Production, "v2/reports/customers"),
290
+ method: "GET",
291
+ headers: _headers,
292
+ queryString: core.url
293
+ .queryBuilder()
294
+ .addMany(_queryParams)
295
+ .mergeAdditional(requestOptions?.queryParams)
296
+ .build(),
297
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
298
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
299
+ abortSignal: requestOptions?.abortSignal,
300
+ fetchFn: this._options?.fetch,
301
+ logging: this._options.logging,
302
+ });
303
+ if (_response.ok) {
304
+ return { data: _response.body, rawResponse: _response.rawResponse };
305
+ }
306
+ if (_response.error.reason === "status-code") {
307
+ switch (_response.error.statusCode) {
308
+ case 400:
309
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
310
+ case 401:
311
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
312
+ default:
313
+ throw new errors.ToltApiError({
314
+ statusCode: _response.error.statusCode,
315
+ body: _response.error.body,
316
+ rawResponse: _response.rawResponse,
317
+ });
318
+ }
319
+ }
320
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/reports/customers");
321
+ }
75
322
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface ReportsCustomerStatsRequest {
6
+ program_id?: string;
7
+ start_date?: string;
8
+ end_date?: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,14 @@
1
+ import type * as ToltApi from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface ReportsLinksRequest {
7
+ program_id?: string;
8
+ start_date?: string;
9
+ end_date?: string;
10
+ limit?: number;
11
+ offset?: number | null;
12
+ sort?: ToltApi.ReportsLinksRequestSort;
13
+ order?: ToltApi.ReportsLinksRequestOrder;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,14 @@
1
+ import type * as ToltApi from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface ReportsPartnersRequest {
7
+ program_id?: string;
8
+ start_date?: string;
9
+ end_date?: string;
10
+ limit?: number;
11
+ offset?: number | null;
12
+ sort?: ToltApi.ReportsPartnersRequestSort;
13
+ order?: ToltApi.ReportsPartnersRequestOrder;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,11 @@
1
+ import type * as ToltApi from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface ReportsTimeseriesRequest {
7
+ program_id?: string;
8
+ start_date?: string;
9
+ end_date?: string;
10
+ granularity?: ToltApi.ReportsTimeseriesRequestGranularity;
11
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1 +1,5 @@
1
+ export type { ReportsCustomerStatsRequest } from "./ReportsCustomerStatsRequest.js";
2
+ export type { ReportsLinksRequest } from "./ReportsLinksRequest.js";
1
3
  export type { ReportsOverviewRequest } from "./ReportsOverviewRequest.js";
4
+ export type { ReportsPartnersRequest } from "./ReportsPartnersRequest.js";
5
+ export type { ReportsTimeseriesRequest } from "./ReportsTimeseriesRequest.js";
@@ -0,0 +1,6 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface ReportsCustomerStatsResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.ReportsCustomerStats;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const ReportsLinksRequestOrder: {
2
+ readonly Asc: "asc";
3
+ readonly Desc: "desc";
4
+ };
5
+ export type ReportsLinksRequestOrder = (typeof ReportsLinksRequestOrder)[keyof typeof ReportsLinksRequestOrder];
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const ReportsLinksRequestOrder = {
3
+ Asc: "asc",
4
+ Desc: "desc",
5
+ };
@@ -0,0 +1,7 @@
1
+ export declare const ReportsLinksRequestSort: {
2
+ readonly Revenue: "revenue";
3
+ readonly Commissions: "commissions";
4
+ readonly Clicks: "clicks";
5
+ readonly Customers: "customers";
6
+ };
7
+ export type ReportsLinksRequestSort = (typeof ReportsLinksRequestSort)[keyof typeof ReportsLinksRequestSort];
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const ReportsLinksRequestSort = {
3
+ Revenue: "revenue",
4
+ Commissions: "commissions",
5
+ Clicks: "clicks",
6
+ Customers: "customers",
7
+ };
@@ -0,0 +1,7 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface ReportsLinksResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.ReportsLinkRow[];
6
+ has_more: boolean;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const ReportsPartnersRequestOrder: {
2
+ readonly Asc: "asc";
3
+ readonly Desc: "desc";
4
+ };
5
+ export type ReportsPartnersRequestOrder = (typeof ReportsPartnersRequestOrder)[keyof typeof ReportsPartnersRequestOrder];
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const ReportsPartnersRequestOrder = {
3
+ Asc: "asc",
4
+ Desc: "desc",
5
+ };
@@ -0,0 +1,7 @@
1
+ export declare const ReportsPartnersRequestSort: {
2
+ readonly Revenue: "revenue";
3
+ readonly Commissions: "commissions";
4
+ readonly Clicks: "clicks";
5
+ readonly Customers: "customers";
6
+ };
7
+ export type ReportsPartnersRequestSort = (typeof ReportsPartnersRequestSort)[keyof typeof ReportsPartnersRequestSort];
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const ReportsPartnersRequestSort = {
3
+ Revenue: "revenue",
4
+ Commissions: "commissions",
5
+ Clicks: "clicks",
6
+ Customers: "customers",
7
+ };
@@ -0,0 +1,7 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface ReportsPartnersResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.ReportsPartnerRow[];
6
+ has_more: boolean;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const ReportsTimeseriesRequestGranularity: {
2
+ readonly Day: "day";
3
+ readonly Week: "week";
4
+ readonly Month: "month";
5
+ };
6
+ export type ReportsTimeseriesRequestGranularity = (typeof ReportsTimeseriesRequestGranularity)[keyof typeof ReportsTimeseriesRequestGranularity];
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const ReportsTimeseriesRequestGranularity = {
3
+ Day: "day",
4
+ Week: "week",
5
+ Month: "month",
6
+ };
@@ -0,0 +1,6 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface ReportsTimeseriesResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.ReportsTimeseriesPoint[];
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1 +1,10 @@
1
+ export * from "./ReportsCustomerStatsResponse.js";
2
+ export * from "./ReportsLinksRequestOrder.js";
3
+ export * from "./ReportsLinksRequestSort.js";
4
+ export * from "./ReportsLinksResponse.js";
1
5
  export * from "./ReportsOverviewResponse.js";
6
+ export * from "./ReportsPartnersRequestOrder.js";
7
+ export * from "./ReportsPartnersRequestSort.js";
8
+ export * from "./ReportsPartnersResponse.js";
9
+ export * from "./ReportsTimeseriesRequestGranularity.js";
10
+ export * from "./ReportsTimeseriesResponse.js";
@@ -1 +1,10 @@
1
+ export * from "./ReportsCustomerStatsResponse.js";
2
+ export * from "./ReportsLinksRequestOrder.js";
3
+ export * from "./ReportsLinksRequestSort.js";
4
+ export * from "./ReportsLinksResponse.js";
1
5
  export * from "./ReportsOverviewResponse.js";
6
+ export * from "./ReportsPartnersRequestOrder.js";
7
+ export * from "./ReportsPartnersRequestSort.js";
8
+ export * from "./ReportsPartnersResponse.js";
9
+ export * from "./ReportsTimeseriesRequestGranularity.js";
10
+ export * from "./ReportsTimeseriesResponse.js";
@@ -0,0 +1,4 @@
1
+ export interface EmbedToken {
2
+ token: string;
3
+ expiresAt: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface ReportsCustomerStats {
2
+ trialing: number;
3
+ active: number;
4
+ canceled: number;
5
+ suspended: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface ReportsLinkRow {
2
+ linkId: string;
3
+ param: string | null;
4
+ value: string | null;
5
+ clicks: number;
6
+ customers: number;
7
+ /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
8
+ revenue: string;
9
+ /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
10
+ commissions: string;
11
+ conversionRate: number;
12
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -14,7 +14,7 @@ export declare namespace ReportsOverview {
14
14
  interface Item {
15
15
  /** ISO currency code for this bucket, or null when the source rows carry none. */
16
16
  currency: string | null;
17
- /** Integer amount in the smallest currency unit (cents), serialized as a string. */
17
+ /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
18
18
  amount: string;
19
19
  }
20
20
  }
@@ -23,7 +23,7 @@ export declare namespace ReportsOverview {
23
23
  interface Item {
24
24
  /** ISO currency code for this bucket, or null when the source rows carry none. */
25
25
  currency: string | null;
26
- /** Integer amount in the smallest currency unit (cents), serialized as a string. */
26
+ /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
27
27
  amount: string;
28
28
  }
29
29
  }
@@ -0,0 +1,15 @@
1
+ export interface ReportsPartnerRow {
2
+ partnerId: string;
3
+ firstName: string | null;
4
+ lastName: string | null;
5
+ email: string | null;
6
+ clicks: number;
7
+ /** Converted (non-lead) customers. */
8
+ customers: number;
9
+ /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
10
+ revenue: string;
11
+ /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
12
+ commissions: string;
13
+ /** Customers / clicks as a percentage. */
14
+ conversionRate: number;
15
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ export interface ReportsTimeseriesPoint {
2
+ /** Start of the bucket as YYYY-MM-DD. */
3
+ period: string;
4
+ /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
5
+ revenue: string;
6
+ /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
7
+ commissions: string;
8
+ customers: number;
9
+ clicks: number;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,6 +1,7 @@
1
1
  export * from "./Click.js";
2
2
  export * from "./Commission.js";
3
3
  export * from "./Customer.js";
4
+ export * from "./EmbedToken.js";
4
5
  export * from "./Error_.js";
5
6
  export * from "./Flow.js";
6
7
  export * from "./Group.js";
@@ -8,6 +9,10 @@ export * from "./Link.js";
8
9
  export * from "./Partner.js";
9
10
  export * from "./Program.js";
10
11
  export * from "./PromotionCode.js";
12
+ export * from "./ReportsCustomerStats.js";
13
+ export * from "./ReportsLinkRow.js";
11
14
  export * from "./ReportsOverview.js";
15
+ export * from "./ReportsPartnerRow.js";
16
+ export * from "./ReportsTimeseriesPoint.js";
12
17
  export * from "./RerunFlowsResult.js";
13
18
  export * from "./Transaction.js";
@@ -1,6 +1,7 @@
1
1
  export * from "./Click.js";
2
2
  export * from "./Commission.js";
3
3
  export * from "./Customer.js";
4
+ export * from "./EmbedToken.js";
4
5
  export * from "./Error_.js";
5
6
  export * from "./Flow.js";
6
7
  export * from "./Group.js";
@@ -8,6 +9,10 @@ export * from "./Link.js";
8
9
  export * from "./Partner.js";
9
10
  export * from "./Program.js";
10
11
  export * from "./PromotionCode.js";
12
+ export * from "./ReportsCustomerStats.js";
13
+ export * from "./ReportsLinkRow.js";
11
14
  export * from "./ReportsOverview.js";
15
+ export * from "./ReportsPartnerRow.js";
16
+ export * from "./ReportsTimeseriesPoint.js";
12
17
  export * from "./RerunFlowsResult.js";
13
18
  export * from "./Transaction.js";
@@ -1,4 +1,4 @@
1
1
  export declare const ToltApiEnvironment: {
2
- readonly Production: "https://api.tolt.com";
2
+ readonly Production: "https://platform.tolt.com";
3
3
  };
4
4
  export type ToltApiEnvironment = typeof ToltApiEnvironment.Production;
@@ -1,4 +1,4 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  export const ToltApiEnvironment = {
3
- Production: "https://api.tolt.com",
3
+ Production: "https://platform.tolt.com",
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolt/api",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "TypeScript SDK for the Tolt Public API",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- export type CreateCustomerRequest = unknown;