@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.
- package/.openapi-generator/FILES +4 -0
- package/README.md +5 -2
- package/dist/apis/BillingApi.d.ts +15 -0
- package/dist/apis/BillingApi.js +45 -0
- package/dist/esm/apis/BillingApi.d.ts +15 -0
- package/dist/esm/apis/BillingApi.js +45 -0
- package/dist/esm/models/RefereeStatus.d.ts +79 -0
- package/dist/esm/models/RefereeStatus.js +70 -0
- package/dist/esm/models/Referral.d.ts +94 -0
- package/dist/esm/models/Referral.js +82 -0
- package/dist/esm/models/VideoJob.d.ts +6 -0
- package/dist/esm/models/VideoJob.js +2 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/RefereeStatus.d.ts +79 -0
- package/dist/models/RefereeStatus.js +78 -0
- package/dist/models/Referral.d.ts +94 -0
- package/dist/models/Referral.js +89 -0
- package/dist/models/VideoJob.d.ts +6 -0
- package/dist/models/VideoJob.js +2 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/runtime.js +1 -1
- package/docs/BillingApi.md +66 -0
- package/docs/RefereeStatus.md +47 -0
- package/docs/Referral.md +55 -0
- package/docs/VideoJob.md +2 -0
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +52 -0
- package/src/models/RefereeStatus.ts +131 -0
- package/src/models/Referral.ts +164 -0
- package/src/models/VideoJob.ts +8 -0
- package/src/models/index.ts +2 -0
- package/src/runtime.ts +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* 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.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface RefereeStatus
|
|
21
|
+
*/
|
|
22
|
+
export interface RefereeStatus {
|
|
23
|
+
/**
|
|
24
|
+
* Lifecycle state. `pending` until the spend gate is met; `qualified` inside the hold; `settled` once paid.
|
|
25
|
+
* @type {RefereeStatusStatusEnum}
|
|
26
|
+
* @memberof RefereeStatus
|
|
27
|
+
*/
|
|
28
|
+
status: RefereeStatusStatusEnum;
|
|
29
|
+
/**
|
|
30
|
+
* Cumulative inference spend so far.
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof RefereeStatus
|
|
33
|
+
*/
|
|
34
|
+
spentCents: number;
|
|
35
|
+
/**
|
|
36
|
+
* The spend that qualifies the referral.
|
|
37
|
+
* @type {number}
|
|
38
|
+
* @memberof RefereeStatus
|
|
39
|
+
*/
|
|
40
|
+
qualifySpendCents: number;
|
|
41
|
+
/**
|
|
42
|
+
* What this organization receives on settlement.
|
|
43
|
+
* @type {number}
|
|
44
|
+
* @memberof RefereeStatus
|
|
45
|
+
*/
|
|
46
|
+
rewardCents: number;
|
|
47
|
+
/**
|
|
48
|
+
* When the spend gate was met. Absent while pending.
|
|
49
|
+
* @type {Date}
|
|
50
|
+
* @memberof RefereeStatus
|
|
51
|
+
*/
|
|
52
|
+
qualifiedAt?: Date;
|
|
53
|
+
/**
|
|
54
|
+
* When the hold ends and both halves pay out. Absent while pending.
|
|
55
|
+
* @type {Date}
|
|
56
|
+
* @memberof RefereeStatus
|
|
57
|
+
*/
|
|
58
|
+
holdUntil?: Date;
|
|
59
|
+
/**
|
|
60
|
+
* When the reward was paid. Absent until settled.
|
|
61
|
+
* @type {Date}
|
|
62
|
+
* @memberof RefereeStatus
|
|
63
|
+
*/
|
|
64
|
+
settledAt?: Date;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @export
|
|
70
|
+
*/
|
|
71
|
+
export const RefereeStatusStatusEnum = {
|
|
72
|
+
Pending: 'pending',
|
|
73
|
+
Qualified: 'qualified',
|
|
74
|
+
Settled: 'settled',
|
|
75
|
+
Rejected: 'rejected'
|
|
76
|
+
} as const;
|
|
77
|
+
export type RefereeStatusStatusEnum = typeof RefereeStatusStatusEnum[keyof typeof RefereeStatusStatusEnum];
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Check if a given object implements the RefereeStatus interface.
|
|
82
|
+
*/
|
|
83
|
+
export function instanceOfRefereeStatus(value: object): value is RefereeStatus {
|
|
84
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
85
|
+
if ((!('spentCents' in (value as Record<string, any>)) && !('spent_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['spentCents'] === undefined && (value as Record<string, any>)['spent_cents'] === undefined)) return false;
|
|
86
|
+
if ((!('qualifySpendCents' in (value as Record<string, any>)) && !('qualify_spend_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['qualifySpendCents'] === undefined && (value as Record<string, any>)['qualify_spend_cents'] === undefined)) return false;
|
|
87
|
+
if ((!('rewardCents' in (value as Record<string, any>)) && !('reward_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['rewardCents'] === undefined && (value as Record<string, any>)['reward_cents'] === undefined)) return false;
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function RefereeStatusFromJSON(json: any): RefereeStatus {
|
|
92
|
+
return RefereeStatusFromJSONTyped(json, false);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function RefereeStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): RefereeStatus {
|
|
96
|
+
if (json == null) {
|
|
97
|
+
return json;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
|
|
101
|
+
'status': json['status'],
|
|
102
|
+
'spentCents': json['spent_cents'],
|
|
103
|
+
'qualifySpendCents': json['qualify_spend_cents'],
|
|
104
|
+
'rewardCents': json['reward_cents'],
|
|
105
|
+
'qualifiedAt': json['qualified_at'] == null ? undefined : (new Date(json['qualified_at'])),
|
|
106
|
+
'holdUntil': json['hold_until'] == null ? undefined : (new Date(json['hold_until'])),
|
|
107
|
+
'settledAt': json['settled_at'] == null ? undefined : (new Date(json['settled_at'])),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function RefereeStatusToJSON(json: any): RefereeStatus {
|
|
112
|
+
return RefereeStatusToJSONTyped(json, false);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function RefereeStatusToJSONTyped(value?: RefereeStatus | null, ignoreDiscriminator: boolean = false): any {
|
|
116
|
+
if (value == null) {
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
|
|
122
|
+
'status': value['status'],
|
|
123
|
+
'spent_cents': value['spentCents'],
|
|
124
|
+
'qualify_spend_cents': value['qualifySpendCents'],
|
|
125
|
+
'reward_cents': value['rewardCents'],
|
|
126
|
+
'qualified_at': value['qualifiedAt'] == null ? value['qualifiedAt'] : value['qualifiedAt'].toISOString(),
|
|
127
|
+
'hold_until': value['holdUntil'] == null ? value['holdUntil'] : value['holdUntil'].toISOString(),
|
|
128
|
+
'settled_at': value['settledAt'] == null ? value['settledAt'] : value['settledAt'].toISOString(),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { RefereeStatus } from './RefereeStatus';
|
|
17
|
+
import {
|
|
18
|
+
RefereeStatusFromJSON,
|
|
19
|
+
RefereeStatusFromJSONTyped,
|
|
20
|
+
RefereeStatusToJSON,
|
|
21
|
+
RefereeStatusToJSONTyped,
|
|
22
|
+
} from './RefereeStatus';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 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.
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @interface Referral
|
|
29
|
+
*/
|
|
30
|
+
export interface Referral {
|
|
31
|
+
/**
|
|
32
|
+
* The organization's shareable referral code, e.g. `GPU-7KQ2-M4XP`.
|
|
33
|
+
* @type {string}
|
|
34
|
+
* @memberof Referral
|
|
35
|
+
*/
|
|
36
|
+
code: string;
|
|
37
|
+
/**
|
|
38
|
+
* The ready-to-share invite link, `{site}/r/{code}`.
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @memberof Referral
|
|
41
|
+
*/
|
|
42
|
+
inviteUrl: string;
|
|
43
|
+
/**
|
|
44
|
+
* Friends who signed up through the link but have not yet reached the spend gate.
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof Referral
|
|
47
|
+
*/
|
|
48
|
+
pending: number;
|
|
49
|
+
/**
|
|
50
|
+
* Friends past the spend gate whose reward is inside the chargeback hold.
|
|
51
|
+
* @type {number}
|
|
52
|
+
* @memberof Referral
|
|
53
|
+
*/
|
|
54
|
+
qualified: number;
|
|
55
|
+
/**
|
|
56
|
+
* Referrals that have paid out.
|
|
57
|
+
* @type {number}
|
|
58
|
+
* @memberof Referral
|
|
59
|
+
*/
|
|
60
|
+
settled: number;
|
|
61
|
+
/**
|
|
62
|
+
* Total credit paid to this organization as a referrer.
|
|
63
|
+
* @type {number}
|
|
64
|
+
* @memberof Referral
|
|
65
|
+
*/
|
|
66
|
+
earnedCents: number;
|
|
67
|
+
/**
|
|
68
|
+
* Credit paid to the referrer per settled referral.
|
|
69
|
+
* @type {number}
|
|
70
|
+
* @memberof Referral
|
|
71
|
+
*/
|
|
72
|
+
rewardCents: number;
|
|
73
|
+
/**
|
|
74
|
+
* Credit paid to the referred friend per settled referral.
|
|
75
|
+
* @type {number}
|
|
76
|
+
* @memberof Referral
|
|
77
|
+
*/
|
|
78
|
+
refereeRewardCents: number;
|
|
79
|
+
/**
|
|
80
|
+
* The friend's cumulative inference spend that qualifies a referral.
|
|
81
|
+
* @type {number}
|
|
82
|
+
* @memberof Referral
|
|
83
|
+
*/
|
|
84
|
+
qualifySpendCents: number;
|
|
85
|
+
/**
|
|
86
|
+
* Days between qualification and payout (chargeback hold).
|
|
87
|
+
* @type {number}
|
|
88
|
+
* @memberof Referral
|
|
89
|
+
*/
|
|
90
|
+
holdDays: number;
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @type {RefereeStatus}
|
|
94
|
+
* @memberof Referral
|
|
95
|
+
*/
|
|
96
|
+
referred?: RefereeStatus;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Check if a given object implements the Referral interface.
|
|
101
|
+
*/
|
|
102
|
+
export function instanceOfReferral(value: object): value is Referral {
|
|
103
|
+
if (!('code' in value) || value['code'] === undefined) return false;
|
|
104
|
+
if ((!('inviteUrl' in (value as Record<string, any>)) && !('invite_url' in (value as Record<string, any>))) || ((value as Record<string, any>)['inviteUrl'] === undefined && (value as Record<string, any>)['invite_url'] === undefined)) return false;
|
|
105
|
+
if (!('pending' in value) || value['pending'] === undefined) return false;
|
|
106
|
+
if (!('qualified' in value) || value['qualified'] === undefined) return false;
|
|
107
|
+
if (!('settled' in value) || value['settled'] === undefined) return false;
|
|
108
|
+
if ((!('earnedCents' in (value as Record<string, any>)) && !('earned_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['earnedCents'] === undefined && (value as Record<string, any>)['earned_cents'] === undefined)) return false;
|
|
109
|
+
if ((!('rewardCents' in (value as Record<string, any>)) && !('reward_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['rewardCents'] === undefined && (value as Record<string, any>)['reward_cents'] === undefined)) return false;
|
|
110
|
+
if ((!('refereeRewardCents' in (value as Record<string, any>)) && !('referee_reward_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['refereeRewardCents'] === undefined && (value as Record<string, any>)['referee_reward_cents'] === undefined)) return false;
|
|
111
|
+
if ((!('qualifySpendCents' in (value as Record<string, any>)) && !('qualify_spend_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['qualifySpendCents'] === undefined && (value as Record<string, any>)['qualify_spend_cents'] === undefined)) return false;
|
|
112
|
+
if ((!('holdDays' in (value as Record<string, any>)) && !('hold_days' in (value as Record<string, any>))) || ((value as Record<string, any>)['holdDays'] === undefined && (value as Record<string, any>)['hold_days'] === undefined)) return false;
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function ReferralFromJSON(json: any): Referral {
|
|
117
|
+
return ReferralFromJSONTyped(json, false);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function ReferralFromJSONTyped(json: any, ignoreDiscriminator: boolean): Referral {
|
|
121
|
+
if (json == null) {
|
|
122
|
+
return json;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
|
|
126
|
+
'code': json['code'],
|
|
127
|
+
'inviteUrl': json['invite_url'],
|
|
128
|
+
'pending': json['pending'],
|
|
129
|
+
'qualified': json['qualified'],
|
|
130
|
+
'settled': json['settled'],
|
|
131
|
+
'earnedCents': json['earned_cents'],
|
|
132
|
+
'rewardCents': json['reward_cents'],
|
|
133
|
+
'refereeRewardCents': json['referee_reward_cents'],
|
|
134
|
+
'qualifySpendCents': json['qualify_spend_cents'],
|
|
135
|
+
'holdDays': json['hold_days'],
|
|
136
|
+
'referred': json['referred'] == null ? undefined : RefereeStatusFromJSON(json['referred']),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function ReferralToJSON(json: any): Referral {
|
|
141
|
+
return ReferralToJSONTyped(json, false);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function ReferralToJSONTyped(value?: Referral | null, ignoreDiscriminator: boolean = false): any {
|
|
145
|
+
if (value == null) {
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
|
|
151
|
+
'code': value['code'],
|
|
152
|
+
'invite_url': value['inviteUrl'],
|
|
153
|
+
'pending': value['pending'],
|
|
154
|
+
'qualified': value['qualified'],
|
|
155
|
+
'settled': value['settled'],
|
|
156
|
+
'earned_cents': value['earnedCents'],
|
|
157
|
+
'reward_cents': value['rewardCents'],
|
|
158
|
+
'referee_reward_cents': value['refereeRewardCents'],
|
|
159
|
+
'qualify_spend_cents': value['qualifySpendCents'],
|
|
160
|
+
'hold_days': value['holdDays'],
|
|
161
|
+
'referred': RefereeStatusToJSON(value['referred']),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
package/src/models/VideoJob.ts
CHANGED
|
@@ -85,6 +85,12 @@ export interface VideoJob {
|
|
|
85
85
|
* @memberof VideoJob
|
|
86
86
|
*/
|
|
87
87
|
error?: string;
|
|
88
|
+
/**
|
|
89
|
+
* 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`.
|
|
90
|
+
* @type {string}
|
|
91
|
+
* @memberof VideoJob
|
|
92
|
+
*/
|
|
93
|
+
errorMessage?: string;
|
|
88
94
|
/**
|
|
89
95
|
* Final billed cost in cents; present once the job completes (failed/cancelled jobs are never billed).
|
|
90
96
|
* @type {number}
|
|
@@ -152,6 +158,7 @@ export function VideoJobFromJSONTyped(json: any, ignoreDiscriminator: boolean):
|
|
|
152
158
|
'completedAt': json['completed_at'] == null ? undefined : json['completed_at'],
|
|
153
159
|
'expiresAt': json['expires_at'] == null ? undefined : json['expires_at'],
|
|
154
160
|
'error': json['error'] == null ? undefined : json['error'],
|
|
161
|
+
'errorMessage': json['error_message'] == null ? undefined : json['error_message'],
|
|
155
162
|
'costCents': json['cost_cents'] == null ? undefined : json['cost_cents'],
|
|
156
163
|
};
|
|
157
164
|
}
|
|
@@ -178,6 +185,7 @@ export function VideoJobToJSONTyped(value?: VideoJob | null, ignoreDiscriminator
|
|
|
178
185
|
'completed_at': value['completedAt'],
|
|
179
186
|
'expires_at': value['expiresAt'],
|
|
180
187
|
'error': value['error'],
|
|
188
|
+
'error_message': value['errorMessage'],
|
|
181
189
|
'cost_cents': value['costCents'],
|
|
182
190
|
};
|
|
183
191
|
}
|
package/src/models/index.ts
CHANGED
|
@@ -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';
|
package/src/runtime.ts
CHANGED
|
@@ -75,7 +75,7 @@ export class Configuration {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
get headers(): HTTPHeaders | undefined {
|
|
78
|
-
return { 'User-Agent': 'deeprelay-sdk-ts/0.1.
|
|
78
|
+
return { 'User-Agent': 'deeprelay-sdk-ts/0.1.2', ...this.configuration.headers };
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
get credentials(): RequestCredentials | undefined {
|