@deeprelay/sdk 0.1.1 → 0.1.2

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.
@@ -37,6 +37,8 @@ docs/OperationResult.md
37
37
  docs/OperationsApi.md
38
38
  docs/PeakWindow.md
39
39
  docs/Problem.md
40
+ docs/RefereeStatus.md
41
+ docs/Referral.md
40
42
  docs/SpendingLimit.md
41
43
  docs/StreamOptions.md
42
44
  docs/Subscription.md
@@ -100,6 +102,8 @@ src/models/OperationError.ts
100
102
  src/models/OperationResult.ts
101
103
  src/models/PeakWindow.ts
102
104
  src/models/Problem.ts
105
+ src/models/RefereeStatus.ts
106
+ src/models/Referral.ts
103
107
  src/models/SpendingLimit.ts
104
108
  src/models/StreamOptions.ts
105
109
  src/models/Subscription.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @deeprelay/sdk@0.1.1
1
+ # @deeprelay/sdk@0.1.2
2
2
 
3
3
  A TypeScript SDK client for the api.deeprelay.ai API.
4
4
 
@@ -59,6 +59,7 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
59
59
  *BillingApi* | [**createSubscriptionPortal**](docs/BillingApi.md#createsubscriptionportal) | **POST** /billing/subscription/portal | Open the billing portal to cancel or manage the subscription
60
60
  *BillingApi* | [**getBalance**](docs/BillingApi.md#getbalance) | **GET** /billing/balance | Get the org credit balance
61
61
  *BillingApi* | [**getDeposit**](docs/BillingApi.md#getdeposit) | **GET** /billing/deposits/{id} | Get one stablecoin deposit
62
+ *BillingApi* | [**getReferral**](docs/BillingApi.md#getreferral) | **GET** /referrals | Get the org referral code, invite link, terms and stats
62
63
  *BillingApi* | [**getSpendingLimit**](docs/BillingApi.md#getspendinglimit) | **GET** /billing/spending-limit | Get the org spending limit
63
64
  *BillingApi* | [**getSubscription**](docs/BillingApi.md#getsubscription) | **GET** /billing/subscription | Get the org subscription status and quota usage
64
65
  *BillingApi* | [**listDeposits**](docs/BillingApi.md#listdeposits) | **GET** /billing/deposits | List stablecoin deposits
@@ -118,6 +119,8 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
118
119
  - [OperationResult](docs/OperationResult.md)
119
120
  - [PeakWindow](docs/PeakWindow.md)
120
121
  - [Problem](docs/Problem.md)
122
+ - [RefereeStatus](docs/RefereeStatus.md)
123
+ - [Referral](docs/Referral.md)
121
124
  - [SpendingLimit](docs/SpendingLimit.md)
122
125
  - [StreamOptions](docs/StreamOptions.md)
123
126
  - [Subscription](docs/Subscription.md)
@@ -156,7 +159,7 @@ and is automatically generated by the
156
159
  [OpenAPI Generator](https://openapi-generator.tech) project:
157
160
 
158
161
  - API version: `1.0.0`
159
- - Package version: `0.1.1`
162
+ - Package version: `0.1.2`
160
163
  - Generator version: `7.24.0`
161
164
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
162
165
 
@@ -14,6 +14,7 @@ import { type Balance } from '../models/Balance';
14
14
  import { type CreateCryptoDepositRequest } from '../models/CreateCryptoDepositRequest';
15
15
  import { type CryptoDeposit } from '../models/CryptoDeposit';
16
16
  import { type ListDeposits200Response } from '../models/ListDeposits200Response';
17
+ import { type Referral } from '../models/Referral';
17
18
  import { type SpendingLimit } from '../models/SpendingLimit';
18
19
  import { type Subscription } from '../models/Subscription';
19
20
  import { type SubscriptionCheckoutRequest } from '../models/SubscriptionCheckoutRequest';
@@ -110,6 +111,20 @@ export declare class BillingApi extends runtime.BaseAPI {
110
111
  * Get one stablecoin deposit
111
112
  */
112
113
  getDeposit(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit>;
114
+ /**
115
+ * Creates request options for getReferral without sending the request
116
+ */
117
+ getReferralRequestOpts(): Promise<runtime.RequestOpts>;
118
+ /**
119
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
120
+ * Get the org referral code, invite link, terms and stats
121
+ */
122
+ getReferralRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Referral>>;
123
+ /**
124
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
125
+ * Get the org referral code, invite link, terms and stats
126
+ */
127
+ getReferral(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Referral>;
113
128
  /**
114
129
  * Creates request options for getSpendingLimit without sending the request
115
130
  */
@@ -28,6 +28,7 @@ const Balance_1 = require("../models/Balance");
28
28
  const CreateCryptoDepositRequest_1 = require("../models/CreateCryptoDepositRequest");
29
29
  const CryptoDeposit_1 = require("../models/CryptoDeposit");
30
30
  const ListDeposits200Response_1 = require("../models/ListDeposits200Response");
31
+ const Referral_1 = require("../models/Referral");
31
32
  const SpendingLimit_1 = require("../models/SpendingLimit");
32
33
  const Subscription_1 = require("../models/Subscription");
33
34
  const SubscriptionCheckoutRequest_1 = require("../models/SubscriptionCheckoutRequest");
@@ -272,6 +273,50 @@ class BillingApi extends runtime.BaseAPI {
272
273
  return yield response.value();
273
274
  });
274
275
  }
276
+ /**
277
+ * Creates request options for getReferral without sending the request
278
+ */
279
+ getReferralRequestOpts() {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ const queryParameters = {};
282
+ const headerParameters = {};
283
+ if (this.configuration && this.configuration.accessToken) {
284
+ const token = this.configuration.accessToken;
285
+ const tokenString = yield token("bearerAuth", []);
286
+ if (tokenString) {
287
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
288
+ }
289
+ }
290
+ let urlPath = `/referrals`;
291
+ return {
292
+ path: urlPath,
293
+ method: 'GET',
294
+ headers: headerParameters,
295
+ query: queryParameters,
296
+ };
297
+ });
298
+ }
299
+ /**
300
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
301
+ * Get the org referral code, invite link, terms and stats
302
+ */
303
+ getReferralRaw(initOverrides) {
304
+ return __awaiter(this, void 0, void 0, function* () {
305
+ const requestOptions = yield this.getReferralRequestOpts();
306
+ const response = yield this.request(requestOptions, initOverrides);
307
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, Referral_1.ReferralFromJSON)(jsonValue));
308
+ });
309
+ }
310
+ /**
311
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
312
+ * Get the org referral code, invite link, terms and stats
313
+ */
314
+ getReferral(initOverrides) {
315
+ return __awaiter(this, void 0, void 0, function* () {
316
+ const response = yield this.getReferralRaw(initOverrides);
317
+ return yield response.value();
318
+ });
319
+ }
275
320
  /**
276
321
  * Creates request options for getSpendingLimit without sending the request
277
322
  */
@@ -14,6 +14,7 @@ import { type Balance } from '../models/Balance';
14
14
  import { type CreateCryptoDepositRequest } from '../models/CreateCryptoDepositRequest';
15
15
  import { type CryptoDeposit } from '../models/CryptoDeposit';
16
16
  import { type ListDeposits200Response } from '../models/ListDeposits200Response';
17
+ import { type Referral } from '../models/Referral';
17
18
  import { type SpendingLimit } from '../models/SpendingLimit';
18
19
  import { type Subscription } from '../models/Subscription';
19
20
  import { type SubscriptionCheckoutRequest } from '../models/SubscriptionCheckoutRequest';
@@ -110,6 +111,20 @@ export declare class BillingApi extends runtime.BaseAPI {
110
111
  * Get one stablecoin deposit
111
112
  */
112
113
  getDeposit(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit>;
114
+ /**
115
+ * Creates request options for getReferral without sending the request
116
+ */
117
+ getReferralRequestOpts(): Promise<runtime.RequestOpts>;
118
+ /**
119
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
120
+ * Get the org referral code, invite link, terms and stats
121
+ */
122
+ getReferralRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Referral>>;
123
+ /**
124
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
125
+ * Get the org referral code, invite link, terms and stats
126
+ */
127
+ getReferral(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Referral>;
113
128
  /**
114
129
  * Creates request options for getSpendingLimit without sending the request
115
130
  */
@@ -25,6 +25,7 @@ import { BalanceFromJSON, } from '../models/Balance';
25
25
  import { CreateCryptoDepositRequestToJSON, } from '../models/CreateCryptoDepositRequest';
26
26
  import { CryptoDepositFromJSON, } from '../models/CryptoDeposit';
27
27
  import { ListDeposits200ResponseFromJSON, } from '../models/ListDeposits200Response';
28
+ import { ReferralFromJSON, } from '../models/Referral';
28
29
  import { SpendingLimitFromJSON, } from '../models/SpendingLimit';
29
30
  import { SubscriptionFromJSON, } from '../models/Subscription';
30
31
  import { SubscriptionCheckoutRequestToJSON, } from '../models/SubscriptionCheckoutRequest';
@@ -269,6 +270,50 @@ export class BillingApi extends runtime.BaseAPI {
269
270
  return yield response.value();
270
271
  });
271
272
  }
273
+ /**
274
+ * Creates request options for getReferral without sending the request
275
+ */
276
+ getReferralRequestOpts() {
277
+ return __awaiter(this, void 0, void 0, function* () {
278
+ const queryParameters = {};
279
+ const headerParameters = {};
280
+ if (this.configuration && this.configuration.accessToken) {
281
+ const token = this.configuration.accessToken;
282
+ const tokenString = yield token("bearerAuth", []);
283
+ if (tokenString) {
284
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
285
+ }
286
+ }
287
+ let urlPath = `/referrals`;
288
+ return {
289
+ path: urlPath,
290
+ method: 'GET',
291
+ headers: headerParameters,
292
+ query: queryParameters,
293
+ };
294
+ });
295
+ }
296
+ /**
297
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
298
+ * Get the org referral code, invite link, terms and stats
299
+ */
300
+ getReferralRaw(initOverrides) {
301
+ return __awaiter(this, void 0, void 0, function* () {
302
+ const requestOptions = yield this.getReferralRequestOpts();
303
+ const response = yield this.request(requestOptions, initOverrides);
304
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReferralFromJSON(jsonValue));
305
+ });
306
+ }
307
+ /**
308
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
309
+ * Get the org referral code, invite link, terms and stats
310
+ */
311
+ getReferral(initOverrides) {
312
+ return __awaiter(this, void 0, void 0, function* () {
313
+ const response = yield this.getReferralRaw(initOverrides);
314
+ return yield response.value();
315
+ });
316
+ }
272
317
  /**
273
318
  * Creates request options for getSpendingLimit without sending the request
274
319
  */
@@ -0,0 +1,79 @@
1
+ /**
2
+ * deeprelay Public Developer API
3
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@deeprelay.ai
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
+ /**
13
+ * Present only when the organization signed up through someone else's invite link: where that referral sits and how far the organization is from unlocking its own reward.
14
+ *
15
+ * @export
16
+ * @interface RefereeStatus
17
+ */
18
+ export interface RefereeStatus {
19
+ /**
20
+ * Lifecycle state. `pending` until the spend gate is met; `qualified` inside the hold; `settled` once paid.
21
+ * @type {RefereeStatusStatusEnum}
22
+ * @memberof RefereeStatus
23
+ */
24
+ status: RefereeStatusStatusEnum;
25
+ /**
26
+ * Cumulative inference spend so far.
27
+ * @type {number}
28
+ * @memberof RefereeStatus
29
+ */
30
+ spentCents: number;
31
+ /**
32
+ * The spend that qualifies the referral.
33
+ * @type {number}
34
+ * @memberof RefereeStatus
35
+ */
36
+ qualifySpendCents: number;
37
+ /**
38
+ * What this organization receives on settlement.
39
+ * @type {number}
40
+ * @memberof RefereeStatus
41
+ */
42
+ rewardCents: number;
43
+ /**
44
+ * When the spend gate was met. Absent while pending.
45
+ * @type {Date}
46
+ * @memberof RefereeStatus
47
+ */
48
+ qualifiedAt?: Date;
49
+ /**
50
+ * When the hold ends and both halves pay out. Absent while pending.
51
+ * @type {Date}
52
+ * @memberof RefereeStatus
53
+ */
54
+ holdUntil?: Date;
55
+ /**
56
+ * When the reward was paid. Absent until settled.
57
+ * @type {Date}
58
+ * @memberof RefereeStatus
59
+ */
60
+ settledAt?: Date;
61
+ }
62
+ /**
63
+ * @export
64
+ */
65
+ export declare const RefereeStatusStatusEnum: {
66
+ readonly Pending: "pending";
67
+ readonly Qualified: "qualified";
68
+ readonly Settled: "settled";
69
+ readonly Rejected: "rejected";
70
+ };
71
+ export type RefereeStatusStatusEnum = typeof RefereeStatusStatusEnum[keyof typeof RefereeStatusStatusEnum];
72
+ /**
73
+ * Check if a given object implements the RefereeStatus interface.
74
+ */
75
+ export declare function instanceOfRefereeStatus(value: object): value is RefereeStatus;
76
+ export declare function RefereeStatusFromJSON(json: any): RefereeStatus;
77
+ export declare function RefereeStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): RefereeStatus;
78
+ export declare function RefereeStatusToJSON(json: any): RefereeStatus;
79
+ export declare function RefereeStatusToJSONTyped(value?: RefereeStatus | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,70 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
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
+ /**
15
+ * @export
16
+ */
17
+ export const RefereeStatusStatusEnum = {
18
+ Pending: 'pending',
19
+ Qualified: 'qualified',
20
+ Settled: 'settled',
21
+ Rejected: 'rejected'
22
+ };
23
+ /**
24
+ * Check if a given object implements the RefereeStatus interface.
25
+ */
26
+ export function instanceOfRefereeStatus(value) {
27
+ if (!('status' in value) || value['status'] === undefined)
28
+ return false;
29
+ if ((!('spentCents' in value) && !('spent_cents' in value)) || (value['spentCents'] === undefined && value['spent_cents'] === undefined))
30
+ return false;
31
+ if ((!('qualifySpendCents' in value) && !('qualify_spend_cents' in value)) || (value['qualifySpendCents'] === undefined && value['qualify_spend_cents'] === undefined))
32
+ return false;
33
+ if ((!('rewardCents' in value) && !('reward_cents' in value)) || (value['rewardCents'] === undefined && value['reward_cents'] === undefined))
34
+ return false;
35
+ return true;
36
+ }
37
+ export function RefereeStatusFromJSON(json) {
38
+ return RefereeStatusFromJSONTyped(json, false);
39
+ }
40
+ export function RefereeStatusFromJSONTyped(json, ignoreDiscriminator) {
41
+ if (json == null) {
42
+ return json;
43
+ }
44
+ return {
45
+ 'status': json['status'],
46
+ 'spentCents': json['spent_cents'],
47
+ 'qualifySpendCents': json['qualify_spend_cents'],
48
+ 'rewardCents': json['reward_cents'],
49
+ 'qualifiedAt': json['qualified_at'] == null ? undefined : (new Date(json['qualified_at'])),
50
+ 'holdUntil': json['hold_until'] == null ? undefined : (new Date(json['hold_until'])),
51
+ 'settledAt': json['settled_at'] == null ? undefined : (new Date(json['settled_at'])),
52
+ };
53
+ }
54
+ export function RefereeStatusToJSON(json) {
55
+ return RefereeStatusToJSONTyped(json, false);
56
+ }
57
+ export function RefereeStatusToJSONTyped(value, ignoreDiscriminator = false) {
58
+ if (value == null) {
59
+ return value;
60
+ }
61
+ return {
62
+ 'status': value['status'],
63
+ 'spent_cents': value['spentCents'],
64
+ 'qualify_spend_cents': value['qualifySpendCents'],
65
+ 'reward_cents': value['rewardCents'],
66
+ 'qualified_at': value['qualifiedAt'] == null ? value['qualifiedAt'] : value['qualifiedAt'].toISOString(),
67
+ 'hold_until': value['holdUntil'] == null ? value['holdUntil'] : value['holdUntil'].toISOString(),
68
+ 'settled_at': value['settledAt'] == null ? value['settledAt'] : value['settledAt'].toISOString(),
69
+ };
70
+ }
@@ -0,0 +1,94 @@
1
+ /**
2
+ * deeprelay Public Developer API
3
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@deeprelay.ai
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
+ import type { RefereeStatus } from './RefereeStatus';
13
+ /**
14
+ * The organization's referral-program view: its invite link, the program terms, its referrer stats, and (only when it was itself referred) its referee progress. Amounts are USD cents.
15
+ *
16
+ * @export
17
+ * @interface Referral
18
+ */
19
+ export interface Referral {
20
+ /**
21
+ * The organization's shareable referral code, e.g. `GPU-7KQ2-M4XP`.
22
+ * @type {string}
23
+ * @memberof Referral
24
+ */
25
+ code: string;
26
+ /**
27
+ * The ready-to-share invite link, `{site}/r/{code}`.
28
+ * @type {string}
29
+ * @memberof Referral
30
+ */
31
+ inviteUrl: string;
32
+ /**
33
+ * Friends who signed up through the link but have not yet reached the spend gate.
34
+ * @type {number}
35
+ * @memberof Referral
36
+ */
37
+ pending: number;
38
+ /**
39
+ * Friends past the spend gate whose reward is inside the chargeback hold.
40
+ * @type {number}
41
+ * @memberof Referral
42
+ */
43
+ qualified: number;
44
+ /**
45
+ * Referrals that have paid out.
46
+ * @type {number}
47
+ * @memberof Referral
48
+ */
49
+ settled: number;
50
+ /**
51
+ * Total credit paid to this organization as a referrer.
52
+ * @type {number}
53
+ * @memberof Referral
54
+ */
55
+ earnedCents: number;
56
+ /**
57
+ * Credit paid to the referrer per settled referral.
58
+ * @type {number}
59
+ * @memberof Referral
60
+ */
61
+ rewardCents: number;
62
+ /**
63
+ * Credit paid to the referred friend per settled referral.
64
+ * @type {number}
65
+ * @memberof Referral
66
+ */
67
+ refereeRewardCents: number;
68
+ /**
69
+ * The friend's cumulative inference spend that qualifies a referral.
70
+ * @type {number}
71
+ * @memberof Referral
72
+ */
73
+ qualifySpendCents: number;
74
+ /**
75
+ * Days between qualification and payout (chargeback hold).
76
+ * @type {number}
77
+ * @memberof Referral
78
+ */
79
+ holdDays: number;
80
+ /**
81
+ *
82
+ * @type {RefereeStatus}
83
+ * @memberof Referral
84
+ */
85
+ referred?: RefereeStatus;
86
+ }
87
+ /**
88
+ * Check if a given object implements the Referral interface.
89
+ */
90
+ export declare function instanceOfReferral(value: object): value is Referral;
91
+ export declare function ReferralFromJSON(json: any): Referral;
92
+ export declare function ReferralFromJSONTyped(json: any, ignoreDiscriminator: boolean): Referral;
93
+ export declare function ReferralToJSON(json: any): Referral;
94
+ export declare function ReferralToJSONTyped(value?: Referral | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,82 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
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
+ import { RefereeStatusFromJSON, RefereeStatusToJSON, } from './RefereeStatus';
15
+ /**
16
+ * Check if a given object implements the Referral interface.
17
+ */
18
+ export function instanceOfReferral(value) {
19
+ if (!('code' in value) || value['code'] === undefined)
20
+ return false;
21
+ if ((!('inviteUrl' in value) && !('invite_url' in value)) || (value['inviteUrl'] === undefined && value['invite_url'] === undefined))
22
+ return false;
23
+ if (!('pending' in value) || value['pending'] === undefined)
24
+ return false;
25
+ if (!('qualified' in value) || value['qualified'] === undefined)
26
+ return false;
27
+ if (!('settled' in value) || value['settled'] === undefined)
28
+ return false;
29
+ if ((!('earnedCents' in value) && !('earned_cents' in value)) || (value['earnedCents'] === undefined && value['earned_cents'] === undefined))
30
+ return false;
31
+ if ((!('rewardCents' in value) && !('reward_cents' in value)) || (value['rewardCents'] === undefined && value['reward_cents'] === undefined))
32
+ return false;
33
+ if ((!('refereeRewardCents' in value) && !('referee_reward_cents' in value)) || (value['refereeRewardCents'] === undefined && value['referee_reward_cents'] === undefined))
34
+ return false;
35
+ if ((!('qualifySpendCents' in value) && !('qualify_spend_cents' in value)) || (value['qualifySpendCents'] === undefined && value['qualify_spend_cents'] === undefined))
36
+ return false;
37
+ if ((!('holdDays' in value) && !('hold_days' in value)) || (value['holdDays'] === undefined && value['hold_days'] === undefined))
38
+ return false;
39
+ return true;
40
+ }
41
+ export function ReferralFromJSON(json) {
42
+ return ReferralFromJSONTyped(json, false);
43
+ }
44
+ export function ReferralFromJSONTyped(json, ignoreDiscriminator) {
45
+ if (json == null) {
46
+ return json;
47
+ }
48
+ return {
49
+ 'code': json['code'],
50
+ 'inviteUrl': json['invite_url'],
51
+ 'pending': json['pending'],
52
+ 'qualified': json['qualified'],
53
+ 'settled': json['settled'],
54
+ 'earnedCents': json['earned_cents'],
55
+ 'rewardCents': json['reward_cents'],
56
+ 'refereeRewardCents': json['referee_reward_cents'],
57
+ 'qualifySpendCents': json['qualify_spend_cents'],
58
+ 'holdDays': json['hold_days'],
59
+ 'referred': json['referred'] == null ? undefined : RefereeStatusFromJSON(json['referred']),
60
+ };
61
+ }
62
+ export function ReferralToJSON(json) {
63
+ return ReferralToJSONTyped(json, false);
64
+ }
65
+ export function ReferralToJSONTyped(value, ignoreDiscriminator = false) {
66
+ if (value == null) {
67
+ return value;
68
+ }
69
+ return {
70
+ 'code': value['code'],
71
+ 'invite_url': value['inviteUrl'],
72
+ 'pending': value['pending'],
73
+ 'qualified': value['qualified'],
74
+ 'settled': value['settled'],
75
+ 'earned_cents': value['earnedCents'],
76
+ 'reward_cents': value['rewardCents'],
77
+ 'referee_reward_cents': value['refereeRewardCents'],
78
+ 'qualify_spend_cents': value['qualifySpendCents'],
79
+ 'hold_days': value['holdDays'],
80
+ 'referred': RefereeStatusToJSON(value['referred']),
81
+ };
82
+ }
@@ -81,6 +81,12 @@ export interface VideoJob {
81
81
  * @memberof VideoJob
82
82
  */
83
83
  error?: string;
84
+ /**
85
+ * Human-readable reason behind `error`, when the upstream supplied one. `error` classifies the failure, `error_message` explains it (for example a requested duration outside the model's supported range). Sanitized before storage; only ever present alongside `error`.
86
+ * @type {string}
87
+ * @memberof VideoJob
88
+ */
89
+ errorMessage?: string;
84
90
  /**
85
91
  * Final billed cost in cents; present once the job completes (failed/cancelled jobs are never billed).
86
92
  * @type {number}
@@ -67,6 +67,7 @@ export function VideoJobFromJSONTyped(json, ignoreDiscriminator) {
67
67
  'completedAt': json['completed_at'] == null ? undefined : json['completed_at'],
68
68
  'expiresAt': json['expires_at'] == null ? undefined : json['expires_at'],
69
69
  'error': json['error'] == null ? undefined : json['error'],
70
+ 'errorMessage': json['error_message'] == null ? undefined : json['error_message'],
70
71
  'costCents': json['cost_cents'] == null ? undefined : json['cost_cents'],
71
72
  };
72
73
  }
@@ -89,6 +90,7 @@ export function VideoJobToJSONTyped(value, ignoreDiscriminator = false) {
89
90
  'completed_at': value['completedAt'],
90
91
  'expires_at': value['expiresAt'],
91
92
  'error': value['error'],
93
+ 'error_message': value['errorMessage'],
92
94
  'cost_cents': value['costCents'],
93
95
  };
94
96
  }
@@ -30,6 +30,8 @@ export * from './OperationError';
30
30
  export * from './OperationResult';
31
31
  export * from './PeakWindow';
32
32
  export * from './Problem';
33
+ export * from './RefereeStatus';
34
+ export * from './Referral';
33
35
  export * from './SpendingLimit';
34
36
  export * from './StreamOptions';
35
37
  export * from './Subscription';
@@ -32,6 +32,8 @@ export * from './OperationError';
32
32
  export * from './OperationResult';
33
33
  export * from './PeakWindow';
34
34
  export * from './Problem';
35
+ export * from './RefereeStatus';
36
+ export * from './Referral';
35
37
  export * from './SpendingLimit';
36
38
  export * from './StreamOptions';
37
39
  export * from './Subscription';
@@ -61,7 +61,7 @@ export class Configuration {
61
61
  return undefined;
62
62
  }
63
63
  get headers() {
64
- return Object.assign({ 'User-Agent': 'deeprelay-sdk-ts/0.1.1' }, this.configuration.headers);
64
+ return Object.assign({ 'User-Agent': 'deeprelay-sdk-ts/0.1.2' }, this.configuration.headers);
65
65
  }
66
66
  get credentials() {
67
67
  return this.configuration.credentials;