@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.
@@ -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,78 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * deeprelay Public Developer API
6
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@deeprelay.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.RefereeStatusStatusEnum = void 0;
17
+ exports.instanceOfRefereeStatus = instanceOfRefereeStatus;
18
+ exports.RefereeStatusFromJSON = RefereeStatusFromJSON;
19
+ exports.RefereeStatusFromJSONTyped = RefereeStatusFromJSONTyped;
20
+ exports.RefereeStatusToJSON = RefereeStatusToJSON;
21
+ exports.RefereeStatusToJSONTyped = RefereeStatusToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.RefereeStatusStatusEnum = {
26
+ Pending: 'pending',
27
+ Qualified: 'qualified',
28
+ Settled: 'settled',
29
+ Rejected: 'rejected'
30
+ };
31
+ /**
32
+ * Check if a given object implements the RefereeStatus interface.
33
+ */
34
+ function instanceOfRefereeStatus(value) {
35
+ if (!('status' in value) || value['status'] === undefined)
36
+ return false;
37
+ if ((!('spentCents' in value) && !('spent_cents' in value)) || (value['spentCents'] === undefined && value['spent_cents'] === undefined))
38
+ return false;
39
+ if ((!('qualifySpendCents' in value) && !('qualify_spend_cents' in value)) || (value['qualifySpendCents'] === undefined && value['qualify_spend_cents'] === undefined))
40
+ return false;
41
+ if ((!('rewardCents' in value) && !('reward_cents' in value)) || (value['rewardCents'] === undefined && value['reward_cents'] === undefined))
42
+ return false;
43
+ return true;
44
+ }
45
+ function RefereeStatusFromJSON(json) {
46
+ return RefereeStatusFromJSONTyped(json, false);
47
+ }
48
+ function RefereeStatusFromJSONTyped(json, ignoreDiscriminator) {
49
+ if (json == null) {
50
+ return json;
51
+ }
52
+ return {
53
+ 'status': json['status'],
54
+ 'spentCents': json['spent_cents'],
55
+ 'qualifySpendCents': json['qualify_spend_cents'],
56
+ 'rewardCents': json['reward_cents'],
57
+ 'qualifiedAt': json['qualified_at'] == null ? undefined : (new Date(json['qualified_at'])),
58
+ 'holdUntil': json['hold_until'] == null ? undefined : (new Date(json['hold_until'])),
59
+ 'settledAt': json['settled_at'] == null ? undefined : (new Date(json['settled_at'])),
60
+ };
61
+ }
62
+ function RefereeStatusToJSON(json) {
63
+ return RefereeStatusToJSONTyped(json, false);
64
+ }
65
+ function RefereeStatusToJSONTyped(value, ignoreDiscriminator = false) {
66
+ if (value == null) {
67
+ return value;
68
+ }
69
+ return {
70
+ 'status': value['status'],
71
+ 'spent_cents': value['spentCents'],
72
+ 'qualify_spend_cents': value['qualifySpendCents'],
73
+ 'reward_cents': value['rewardCents'],
74
+ 'qualified_at': value['qualifiedAt'] == null ? value['qualifiedAt'] : value['qualifiedAt'].toISOString(),
75
+ 'hold_until': value['holdUntil'] == null ? value['holdUntil'] : value['holdUntil'].toISOString(),
76
+ 'settled_at': value['settledAt'] == null ? value['settledAt'] : value['settledAt'].toISOString(),
77
+ };
78
+ }
@@ -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,89 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * deeprelay Public Developer API
6
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@deeprelay.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfReferral = instanceOfReferral;
17
+ exports.ReferralFromJSON = ReferralFromJSON;
18
+ exports.ReferralFromJSONTyped = ReferralFromJSONTyped;
19
+ exports.ReferralToJSON = ReferralToJSON;
20
+ exports.ReferralToJSONTyped = ReferralToJSONTyped;
21
+ const RefereeStatus_1 = require("./RefereeStatus");
22
+ /**
23
+ * Check if a given object implements the Referral interface.
24
+ */
25
+ function instanceOfReferral(value) {
26
+ if (!('code' in value) || value['code'] === undefined)
27
+ return false;
28
+ if ((!('inviteUrl' in value) && !('invite_url' in value)) || (value['inviteUrl'] === undefined && value['invite_url'] === undefined))
29
+ return false;
30
+ if (!('pending' in value) || value['pending'] === undefined)
31
+ return false;
32
+ if (!('qualified' in value) || value['qualified'] === undefined)
33
+ return false;
34
+ if (!('settled' in value) || value['settled'] === undefined)
35
+ return false;
36
+ if ((!('earnedCents' in value) && !('earned_cents' in value)) || (value['earnedCents'] === undefined && value['earned_cents'] === undefined))
37
+ return false;
38
+ if ((!('rewardCents' in value) && !('reward_cents' in value)) || (value['rewardCents'] === undefined && value['reward_cents'] === undefined))
39
+ return false;
40
+ if ((!('refereeRewardCents' in value) && !('referee_reward_cents' in value)) || (value['refereeRewardCents'] === undefined && value['referee_reward_cents'] === undefined))
41
+ return false;
42
+ if ((!('qualifySpendCents' in value) && !('qualify_spend_cents' in value)) || (value['qualifySpendCents'] === undefined && value['qualify_spend_cents'] === undefined))
43
+ return false;
44
+ if ((!('holdDays' in value) && !('hold_days' in value)) || (value['holdDays'] === undefined && value['hold_days'] === undefined))
45
+ return false;
46
+ return true;
47
+ }
48
+ function ReferralFromJSON(json) {
49
+ return ReferralFromJSONTyped(json, false);
50
+ }
51
+ function ReferralFromJSONTyped(json, ignoreDiscriminator) {
52
+ if (json == null) {
53
+ return json;
54
+ }
55
+ return {
56
+ 'code': json['code'],
57
+ 'inviteUrl': json['invite_url'],
58
+ 'pending': json['pending'],
59
+ 'qualified': json['qualified'],
60
+ 'settled': json['settled'],
61
+ 'earnedCents': json['earned_cents'],
62
+ 'rewardCents': json['reward_cents'],
63
+ 'refereeRewardCents': json['referee_reward_cents'],
64
+ 'qualifySpendCents': json['qualify_spend_cents'],
65
+ 'holdDays': json['hold_days'],
66
+ 'referred': json['referred'] == null ? undefined : (0, RefereeStatus_1.RefereeStatusFromJSON)(json['referred']),
67
+ };
68
+ }
69
+ function ReferralToJSON(json) {
70
+ return ReferralToJSONTyped(json, false);
71
+ }
72
+ function ReferralToJSONTyped(value, ignoreDiscriminator = false) {
73
+ if (value == null) {
74
+ return value;
75
+ }
76
+ return {
77
+ 'code': value['code'],
78
+ 'invite_url': value['inviteUrl'],
79
+ 'pending': value['pending'],
80
+ 'qualified': value['qualified'],
81
+ 'settled': value['settled'],
82
+ 'earned_cents': value['earnedCents'],
83
+ 'reward_cents': value['rewardCents'],
84
+ 'referee_reward_cents': value['refereeRewardCents'],
85
+ 'qualify_spend_cents': value['qualifySpendCents'],
86
+ 'hold_days': value['holdDays'],
87
+ 'referred': (0, RefereeStatus_1.RefereeStatusToJSON)(value['referred']),
88
+ };
89
+ }
@@ -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}
@@ -75,6 +75,7 @@ function VideoJobFromJSONTyped(json, ignoreDiscriminator) {
75
75
  'completedAt': json['completed_at'] == null ? undefined : json['completed_at'],
76
76
  'expiresAt': json['expires_at'] == null ? undefined : json['expires_at'],
77
77
  'error': json['error'] == null ? undefined : json['error'],
78
+ 'errorMessage': json['error_message'] == null ? undefined : json['error_message'],
78
79
  'costCents': json['cost_cents'] == null ? undefined : json['cost_cents'],
79
80
  };
80
81
  }
@@ -97,6 +98,7 @@ function VideoJobToJSONTyped(value, ignoreDiscriminator = false) {
97
98
  'completed_at': value['completedAt'],
98
99
  'expires_at': value['expiresAt'],
99
100
  'error': value['error'],
101
+ 'error_message': value['errorMessage'],
100
102
  'cost_cents': value['costCents'],
101
103
  };
102
104
  }
@@ -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';
@@ -48,6 +48,8 @@ __exportStar(require("./OperationError"), exports);
48
48
  __exportStar(require("./OperationResult"), exports);
49
49
  __exportStar(require("./PeakWindow"), exports);
50
50
  __exportStar(require("./Problem"), exports);
51
+ __exportStar(require("./RefereeStatus"), exports);
52
+ __exportStar(require("./Referral"), exports);
51
53
  __exportStar(require("./SpendingLimit"), exports);
52
54
  __exportStar(require("./StreamOptions"), exports);
53
55
  __exportStar(require("./Subscription"), exports);
package/dist/runtime.js CHANGED
@@ -69,7 +69,7 @@ class Configuration {
69
69
  return undefined;
70
70
  }
71
71
  get headers() {
72
- return Object.assign({ 'User-Agent': 'deeprelay-sdk-ts/0.1.1' }, this.configuration.headers);
72
+ return Object.assign({ 'User-Agent': 'deeprelay-sdk-ts/0.1.2' }, this.configuration.headers);
73
73
  }
74
74
  get credentials() {
75
75
  return this.configuration.credentials;
@@ -9,6 +9,7 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
9
9
  | [**createSubscriptionPortal**](BillingApi.md#createsubscriptionportal) | **POST** /billing/subscription/portal | Open the billing portal to cancel or manage the subscription |
10
10
  | [**getBalance**](BillingApi.md#getbalance) | **GET** /billing/balance | Get the org credit balance |
11
11
  | [**getDeposit**](BillingApi.md#getdeposit) | **GET** /billing/deposits/{id} | Get one stablecoin deposit |
12
+ | [**getReferral**](BillingApi.md#getreferral) | **GET** /referrals | Get the org referral code, invite link, terms and stats |
12
13
  | [**getSpendingLimit**](BillingApi.md#getspendinglimit) | **GET** /billing/spending-limit | Get the org spending limit |
13
14
  | [**getSubscription**](BillingApi.md#getsubscription) | **GET** /billing/subscription | Get the org subscription status and quota usage |
14
15
  | [**listDeposits**](BillingApi.md#listdeposits) | **GET** /billing/deposits | List stablecoin deposits |
@@ -384,6 +385,71 @@ example().catch(console.error);
384
385
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
385
386
 
386
387
 
388
+ ## getReferral
389
+
390
+ > Referral getReferral()
391
+
392
+ Get the org referral code, invite link, terms and stats
393
+
394
+ 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.
395
+
396
+ ### Example
397
+
398
+ ```ts
399
+ import {
400
+ Configuration,
401
+ BillingApi,
402
+ } from '@deeprelay/sdk';
403
+ import type { GetReferralRequest } from '@deeprelay/sdk';
404
+
405
+ async function example() {
406
+ console.log("🚀 Testing @deeprelay/sdk SDK...");
407
+ const config = new Configuration({
408
+ // Configure HTTP bearer authorization: bearerAuth
409
+ accessToken: "YOUR BEARER TOKEN",
410
+ });
411
+ const api = new BillingApi(config);
412
+
413
+ try {
414
+ const data = await api.getReferral();
415
+ console.log(data);
416
+ } catch (error) {
417
+ console.error(error);
418
+ }
419
+ }
420
+
421
+ // Run the test
422
+ example().catch(console.error);
423
+ ```
424
+
425
+ ### Parameters
426
+
427
+ This endpoint does not need any parameter.
428
+
429
+ ### Return type
430
+
431
+ [**Referral**](Referral.md)
432
+
433
+ ### Authorization
434
+
435
+ [bearerAuth](../README.md#bearerAuth)
436
+
437
+ ### HTTP request headers
438
+
439
+ - **Content-Type**: Not defined
440
+ - **Accept**: `application/json`, `application/problem+json`
441
+
442
+
443
+ ### HTTP response details
444
+ | Status code | Description | Response headers |
445
+ |-------------|-------------|------------------|
446
+ | **200** | OK | - |
447
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
448
+ | **0** | Error response (RFC 7807) | - |
449
+
450
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
451
+
452
+
387
453
  ## getSpendingLimit
388
454
 
389
455
  > SpendingLimit getSpendingLimit()
@@ -0,0 +1,47 @@
1
+
2
+ # RefereeStatus
3
+
4
+ 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.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `status` | string
11
+ `spentCents` | number
12
+ `qualifySpendCents` | number
13
+ `rewardCents` | number
14
+ `qualifiedAt` | Date
15
+ `holdUntil` | Date
16
+ `settledAt` | Date
17
+
18
+ ## Example
19
+
20
+ ```typescript
21
+ import type { RefereeStatus } from '@deeprelay/sdk'
22
+
23
+ // TODO: Update the object below with actual values
24
+ const example = {
25
+ "status": null,
26
+ "spentCents": null,
27
+ "qualifySpendCents": null,
28
+ "rewardCents": null,
29
+ "qualifiedAt": null,
30
+ "holdUntil": null,
31
+ "settledAt": null,
32
+ } satisfies RefereeStatus
33
+
34
+ console.log(example)
35
+
36
+ // Convert the instance to a JSON string
37
+ const exampleJSON: string = JSON.stringify(example)
38
+ console.log(exampleJSON)
39
+
40
+ // Parse the JSON string back to an object
41
+ const exampleParsed = JSON.parse(exampleJSON) as RefereeStatus
42
+ console.log(exampleParsed)
43
+ ```
44
+
45
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
46
+
47
+
@@ -0,0 +1,55 @@
1
+
2
+ # Referral
3
+
4
+ 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.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `code` | string
11
+ `inviteUrl` | string
12
+ `pending` | number
13
+ `qualified` | number
14
+ `settled` | number
15
+ `earnedCents` | number
16
+ `rewardCents` | number
17
+ `refereeRewardCents` | number
18
+ `qualifySpendCents` | number
19
+ `holdDays` | number
20
+ `referred` | [RefereeStatus](RefereeStatus.md)
21
+
22
+ ## Example
23
+
24
+ ```typescript
25
+ import type { Referral } from '@deeprelay/sdk'
26
+
27
+ // TODO: Update the object below with actual values
28
+ const example = {
29
+ "code": GPU-7KQ2-M4XP,
30
+ "inviteUrl": https://deeprelay.ai/r/GPU-7KQ2-M4XP,
31
+ "pending": null,
32
+ "qualified": null,
33
+ "settled": null,
34
+ "earnedCents": null,
35
+ "rewardCents": null,
36
+ "refereeRewardCents": null,
37
+ "qualifySpendCents": null,
38
+ "holdDays": null,
39
+ "referred": null,
40
+ } satisfies Referral
41
+
42
+ console.log(example)
43
+
44
+ // Convert the instance to a JSON string
45
+ const exampleJSON: string = JSON.stringify(example)
46
+ console.log(exampleJSON)
47
+
48
+ // Parse the JSON string back to an object
49
+ const exampleParsed = JSON.parse(exampleJSON) as Referral
50
+ console.log(exampleParsed)
51
+ ```
52
+
53
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
54
+
55
+
package/docs/VideoJob.md CHANGED
@@ -17,6 +17,7 @@ Name | Type
17
17
  `completedAt` | number
18
18
  `expiresAt` | number
19
19
  `error` | string
20
+ `errorMessage` | string
20
21
  `costCents` | number
21
22
 
22
23
  ## Example
@@ -37,6 +38,7 @@ const example = {
37
38
  "completedAt": null,
38
39
  "expiresAt": null,
39
40
  "error": null,
41
+ "errorMessage": null,
40
42
  "costCents": null,
41
43
  } satisfies VideoJob
42
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeprelay/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "TypeScript SDK for the deeprelay Public Developer API",
5
5
  "author": "deeprelay Support <support@deeprelay.ai>",
6
6
  "repository": {
@@ -38,6 +38,11 @@ import {
38
38
  ProblemFromJSON,
39
39
  ProblemToJSON,
40
40
  } from '../models/Problem';
41
+ import {
42
+ type Referral,
43
+ ReferralFromJSON,
44
+ ReferralToJSON,
45
+ } from '../models/Referral';
41
46
  import {
42
47
  type SpendingLimit,
43
48
  SpendingLimitFromJSON,
@@ -358,6 +363,53 @@ export class BillingApi extends runtime.BaseAPI {
358
363
  return await response.value();
359
364
  }
360
365
 
366
+ /**
367
+ * Creates request options for getReferral without sending the request
368
+ */
369
+ async getReferralRequestOpts(): Promise<runtime.RequestOpts> {
370
+ const queryParameters: any = {};
371
+
372
+ const headerParameters: runtime.HTTPHeaders = {};
373
+
374
+ if (this.configuration && this.configuration.accessToken) {
375
+ const token = this.configuration.accessToken;
376
+ const tokenString = await token("bearerAuth", []);
377
+
378
+ if (tokenString) {
379
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
380
+ }
381
+ }
382
+
383
+ let urlPath = `/referrals`;
384
+
385
+ return {
386
+ path: urlPath,
387
+ method: 'GET',
388
+ headers: headerParameters,
389
+ query: queryParameters,
390
+ };
391
+ }
392
+
393
+ /**
394
+ * 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.
395
+ * Get the org referral code, invite link, terms and stats
396
+ */
397
+ async getReferralRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Referral>> {
398
+ const requestOptions = await this.getReferralRequestOpts();
399
+ const response = await this.request(requestOptions, initOverrides);
400
+
401
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReferralFromJSON(jsonValue));
402
+ }
403
+
404
+ /**
405
+ * 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.
406
+ * Get the org referral code, invite link, terms and stats
407
+ */
408
+ async getReferral(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Referral> {
409
+ const response = await this.getReferralRaw(initOverrides);
410
+ return await response.value();
411
+ }
412
+
361
413
  /**
362
414
  * Creates request options for getSpendingLimit without sending the request
363
415
  */