@deeprelay/sdk 0.1.0 → 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 +14 -0
- package/README.md +13 -2
- package/dist/apis/BillingApi.d.ts +53 -0
- package/dist/apis/BillingApi.js +141 -0
- package/dist/apis/InferenceApi.d.ts +18 -0
- package/dist/apis/InferenceApi.js +51 -0
- package/dist/esm/apis/BillingApi.d.ts +53 -0
- package/dist/esm/apis/BillingApi.js +141 -0
- package/dist/esm/apis/InferenceApi.d.ts +18 -0
- package/dist/esm/apis/InferenceApi.js +51 -0
- package/dist/esm/models/InferencePreflight.d.ts +92 -0
- package/dist/esm/models/InferencePreflight.js +86 -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/SubscriptionCheckoutRequest.d.ts +45 -0
- package/dist/esm/models/SubscriptionCheckoutRequest.js +45 -0
- package/dist/esm/models/SubscriptionCheckoutSession.d.ts +45 -0
- package/dist/esm/models/SubscriptionCheckoutSession.js +52 -0
- package/dist/esm/models/SubscriptionPortalRequest.d.ts +32 -0
- package/dist/esm/models/SubscriptionPortalRequest.js +41 -0
- package/dist/esm/models/SubscriptionPortalSession.d.ts +32 -0
- package/dist/esm/models/SubscriptionPortalSession.js +43 -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 +7 -0
- package/dist/esm/models/index.js +7 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/InferencePreflight.d.ts +92 -0
- package/dist/models/InferencePreflight.js +94 -0
- 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/SubscriptionCheckoutRequest.d.ts +45 -0
- package/dist/models/SubscriptionCheckoutRequest.js +52 -0
- package/dist/models/SubscriptionCheckoutSession.d.ts +45 -0
- package/dist/models/SubscriptionCheckoutSession.js +59 -0
- package/dist/models/SubscriptionPortalRequest.d.ts +32 -0
- package/dist/models/SubscriptionPortalRequest.js +48 -0
- package/dist/models/SubscriptionPortalSession.d.ts +32 -0
- package/dist/models/SubscriptionPortalSession.js +50 -0
- package/dist/models/VideoJob.d.ts +6 -0
- package/dist/models/VideoJob.js +2 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +7 -0
- package/dist/runtime.js +1 -1
- package/docs/BillingApi.md +220 -0
- package/docs/InferenceApi.md +74 -0
- package/docs/InferencePreflight.md +47 -0
- package/docs/RefereeStatus.md +47 -0
- package/docs/Referral.md +55 -0
- package/docs/SubscriptionCheckoutRequest.md +39 -0
- package/docs/SubscriptionCheckoutSession.md +38 -0
- package/docs/SubscriptionPortalRequest.md +35 -0
- package/docs/SubscriptionPortalSession.md +34 -0
- package/docs/VideoJob.md +2 -0
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +180 -0
- package/src/apis/InferenceApi.ts +67 -0
- package/src/models/InferencePreflight.ts +147 -0
- package/src/models/RefereeStatus.ts +131 -0
- package/src/models/Referral.ts +164 -0
- package/src/models/SubscriptionCheckoutRequest.ts +82 -0
- package/src/models/SubscriptionCheckoutSession.ts +92 -0
- package/src/models/SubscriptionPortalRequest.ts +65 -0
- package/src/models/SubscriptionPortalSession.ts +66 -0
- package/src/models/VideoJob.ts +8 -0
- package/src/models/index.ts +7 -0
- package/src/runtime.ts +1 -1
|
@@ -0,0 +1,147 @@
|
|
|
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
|
+
* The verdict for one (organization, model) pair: what would happen if the model were invoked right now.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface InferencePreflight
|
|
21
|
+
*/
|
|
22
|
+
export interface InferencePreflight {
|
|
23
|
+
/**
|
|
24
|
+
* The canonical catalog id the request resolved to.
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof InferencePreflight
|
|
27
|
+
*/
|
|
28
|
+
model: string;
|
|
29
|
+
/**
|
|
30
|
+
* `ok` — the request will be served (covered by the plan, or payable). `warn` — it will be served AND charged in a way the caller may not expect. `block` — it will be refused (402 or 429).
|
|
31
|
+
* @type {InferencePreflightVerdictEnum}
|
|
32
|
+
* @memberof InferencePreflight
|
|
33
|
+
*/
|
|
34
|
+
verdict: InferencePreflightVerdictEnum;
|
|
35
|
+
/**
|
|
36
|
+
* Stable code explaining the verdict, for clients that need their own wording. Absent on a plain `ok` that needs no explanation.
|
|
37
|
+
* @type {InferencePreflightReasonEnum}
|
|
38
|
+
* @memberof InferencePreflight
|
|
39
|
+
*/
|
|
40
|
+
reason?: InferencePreflightReasonEnum;
|
|
41
|
+
/**
|
|
42
|
+
* A ready-to-print sentence, phrased for this exact plan/credit combination. Prefer it over composing one from verdict and reason: it improves without a client release.
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @memberof InferencePreflight
|
|
45
|
+
*/
|
|
46
|
+
message: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the subscription tier covers this model. A property of the PLATFORM, not of the caller — it stays true for an organization that has no subscription, which is what makes the "this is included in the plan" upsell honest.
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
* @memberof InferencePreflight
|
|
51
|
+
*/
|
|
52
|
+
planCovered: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the organization is entitled to the plan right now.
|
|
55
|
+
* @type {boolean}
|
|
56
|
+
* @memberof InferencePreflight
|
|
57
|
+
*/
|
|
58
|
+
subscribed: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a pay-as-you-go request could be paid for right now: a positive credit balance AND no self-set spending cap already at its limit. A boolean and never a figure — this route is on the inference read scope and must not disclose the balance.
|
|
61
|
+
* @type {boolean}
|
|
62
|
+
* @memberof InferencePreflight
|
|
63
|
+
*/
|
|
64
|
+
funded: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @export
|
|
70
|
+
*/
|
|
71
|
+
export const InferencePreflightVerdictEnum = {
|
|
72
|
+
Ok: 'ok',
|
|
73
|
+
Warn: 'warn',
|
|
74
|
+
Block: 'block'
|
|
75
|
+
} as const;
|
|
76
|
+
export type InferencePreflightVerdictEnum = typeof InferencePreflightVerdictEnum[keyof typeof InferencePreflightVerdictEnum];
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @export
|
|
80
|
+
*/
|
|
81
|
+
export const InferencePreflightReasonEnum = {
|
|
82
|
+
PlanCovered: 'plan_covered',
|
|
83
|
+
Payg: 'payg',
|
|
84
|
+
NotPlanCovered: 'not_plan_covered',
|
|
85
|
+
SubscriptionQuotaExhausted: 'subscription_quota_exhausted',
|
|
86
|
+
InsufficientBalance: 'insufficient_balance',
|
|
87
|
+
DailyLimitReached: 'daily_limit_reached',
|
|
88
|
+
MonthlyLimitReached: 'monthly_limit_reached',
|
|
89
|
+
PreflightUnavailable: 'preflight_unavailable'
|
|
90
|
+
} as const;
|
|
91
|
+
export type InferencePreflightReasonEnum = typeof InferencePreflightReasonEnum[keyof typeof InferencePreflightReasonEnum];
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Check if a given object implements the InferencePreflight interface.
|
|
96
|
+
*/
|
|
97
|
+
export function instanceOfInferencePreflight(value: object): value is InferencePreflight {
|
|
98
|
+
if (!('model' in value) || value['model'] === undefined) return false;
|
|
99
|
+
if (!('verdict' in value) || value['verdict'] === undefined) return false;
|
|
100
|
+
if (!('message' in value) || value['message'] === undefined) return false;
|
|
101
|
+
if ((!('planCovered' in (value as Record<string, any>)) && !('plan_covered' in (value as Record<string, any>))) || ((value as Record<string, any>)['planCovered'] === undefined && (value as Record<string, any>)['plan_covered'] === undefined)) return false;
|
|
102
|
+
if (!('subscribed' in value) || value['subscribed'] === undefined) return false;
|
|
103
|
+
if (!('funded' in value) || value['funded'] === undefined) return false;
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function InferencePreflightFromJSON(json: any): InferencePreflight {
|
|
108
|
+
return InferencePreflightFromJSONTyped(json, false);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function InferencePreflightFromJSONTyped(json: any, ignoreDiscriminator: boolean): InferencePreflight {
|
|
112
|
+
if (json == null) {
|
|
113
|
+
return json;
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
|
|
117
|
+
'model': json['model'],
|
|
118
|
+
'verdict': json['verdict'],
|
|
119
|
+
'reason': json['reason'] == null ? undefined : json['reason'],
|
|
120
|
+
'message': json['message'],
|
|
121
|
+
'planCovered': json['plan_covered'],
|
|
122
|
+
'subscribed': json['subscribed'],
|
|
123
|
+
'funded': json['funded'],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function InferencePreflightToJSON(json: any): InferencePreflight {
|
|
128
|
+
return InferencePreflightToJSONTyped(json, false);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function InferencePreflightToJSONTyped(value?: InferencePreflight | null, ignoreDiscriminator: boolean = false): any {
|
|
132
|
+
if (value == null) {
|
|
133
|
+
return value;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
|
|
138
|
+
'model': value['model'],
|
|
139
|
+
'verdict': value['verdict'],
|
|
140
|
+
'reason': value['reason'],
|
|
141
|
+
'message': value['message'],
|
|
142
|
+
'plan_covered': value['planCovered'],
|
|
143
|
+
'subscribed': value['subscribed'],
|
|
144
|
+
'funded': value['funded'],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
@@ -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
|
+
|
|
@@ -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
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* Optional overrides for a checkout mint. Every field has a deployment default, so an empty body is the normal call.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface SubscriptionCheckoutRequest
|
|
21
|
+
*/
|
|
22
|
+
export interface SubscriptionCheckoutRequest {
|
|
23
|
+
/**
|
|
24
|
+
* Where the provider returns after a completed payment. Defaults to the deployment's configured URL.
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof SubscriptionCheckoutRequest
|
|
27
|
+
*/
|
|
28
|
+
successUrl?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Where the provider returns if checkout is abandoned. Defaults to the deployment's configured URL.
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof SubscriptionCheckoutRequest
|
|
33
|
+
*/
|
|
34
|
+
cancelUrl?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Pins the plan the client displayed. An unknown key is a 400 rather than a silent purchase of a different tier.
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof SubscriptionCheckoutRequest
|
|
39
|
+
*/
|
|
40
|
+
planKey?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Check if a given object implements the SubscriptionCheckoutRequest interface.
|
|
45
|
+
*/
|
|
46
|
+
export function instanceOfSubscriptionCheckoutRequest(value: object): value is SubscriptionCheckoutRequest {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function SubscriptionCheckoutRequestFromJSON(json: any): SubscriptionCheckoutRequest {
|
|
51
|
+
return SubscriptionCheckoutRequestFromJSONTyped(json, false);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function SubscriptionCheckoutRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionCheckoutRequest {
|
|
55
|
+
if (json == null) {
|
|
56
|
+
return json;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
|
|
60
|
+
'successUrl': json['success_url'] == null ? undefined : json['success_url'],
|
|
61
|
+
'cancelUrl': json['cancel_url'] == null ? undefined : json['cancel_url'],
|
|
62
|
+
'planKey': json['plan_key'] == null ? undefined : json['plan_key'],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function SubscriptionCheckoutRequestToJSON(json: any): SubscriptionCheckoutRequest {
|
|
67
|
+
return SubscriptionCheckoutRequestToJSONTyped(json, false);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function SubscriptionCheckoutRequestToJSONTyped(value?: SubscriptionCheckoutRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
71
|
+
if (value == null) {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'success_url': value['successUrl'],
|
|
78
|
+
'cancel_url': value['cancelUrl'],
|
|
79
|
+
'plan_key': value['planKey'],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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 { SubscriptionPlan } from './SubscriptionPlan';
|
|
17
|
+
import {
|
|
18
|
+
SubscriptionPlanFromJSON,
|
|
19
|
+
SubscriptionPlanFromJSONTyped,
|
|
20
|
+
SubscriptionPlanToJSON,
|
|
21
|
+
SubscriptionPlanToJSONTyped,
|
|
22
|
+
} from './SubscriptionPlan';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface SubscriptionCheckoutSession
|
|
28
|
+
*/
|
|
29
|
+
export interface SubscriptionCheckoutSession {
|
|
30
|
+
/**
|
|
31
|
+
* The hosted page the customer must open to pay.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof SubscriptionCheckoutSession
|
|
34
|
+
*/
|
|
35
|
+
checkoutUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Checkout session id, for support correlation.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof SubscriptionCheckoutSession
|
|
40
|
+
*/
|
|
41
|
+
sessionId: string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {SubscriptionPlan}
|
|
45
|
+
* @memberof SubscriptionCheckoutSession
|
|
46
|
+
*/
|
|
47
|
+
plan: SubscriptionPlan;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Check if a given object implements the SubscriptionCheckoutSession interface.
|
|
52
|
+
*/
|
|
53
|
+
export function instanceOfSubscriptionCheckoutSession(value: object): value is SubscriptionCheckoutSession {
|
|
54
|
+
if ((!('checkoutUrl' in (value as Record<string, any>)) && !('checkout_url' in (value as Record<string, any>))) || ((value as Record<string, any>)['checkoutUrl'] === undefined && (value as Record<string, any>)['checkout_url'] === undefined)) return false;
|
|
55
|
+
if ((!('sessionId' in (value as Record<string, any>)) && !('session_id' in (value as Record<string, any>))) || ((value as Record<string, any>)['sessionId'] === undefined && (value as Record<string, any>)['session_id'] === undefined)) return false;
|
|
56
|
+
if (!('plan' in value) || value['plan'] === undefined) return false;
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function SubscriptionCheckoutSessionFromJSON(json: any): SubscriptionCheckoutSession {
|
|
61
|
+
return SubscriptionCheckoutSessionFromJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function SubscriptionCheckoutSessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionCheckoutSession {
|
|
65
|
+
if (json == null) {
|
|
66
|
+
return json;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
|
|
70
|
+
'checkoutUrl': json['checkout_url'],
|
|
71
|
+
'sessionId': json['session_id'],
|
|
72
|
+
'plan': SubscriptionPlanFromJSON(json['plan']),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function SubscriptionCheckoutSessionToJSON(json: any): SubscriptionCheckoutSession {
|
|
77
|
+
return SubscriptionCheckoutSessionToJSONTyped(json, false);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function SubscriptionCheckoutSessionToJSONTyped(value?: SubscriptionCheckoutSession | null, ignoreDiscriminator: boolean = false): any {
|
|
81
|
+
if (value == null) {
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'checkout_url': value['checkoutUrl'],
|
|
88
|
+
'session_id': value['sessionId'],
|
|
89
|
+
'plan': SubscriptionPlanToJSON(value['plan']),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
* Optional overrides for a billing-portal mint.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface SubscriptionPortalRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface SubscriptionPortalRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Where the provider returns when the customer leaves the portal. Defaults to the deployment's configured URL.
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof SubscriptionPortalRequest
|
|
26
|
+
*/
|
|
27
|
+
returnUrl?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the SubscriptionPortalRequest interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfSubscriptionPortalRequest(value: object): value is SubscriptionPortalRequest {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function SubscriptionPortalRequestFromJSON(json: any): SubscriptionPortalRequest {
|
|
38
|
+
return SubscriptionPortalRequestFromJSONTyped(json, false);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function SubscriptionPortalRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionPortalRequest {
|
|
42
|
+
if (json == null) {
|
|
43
|
+
return json;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
|
|
47
|
+
'returnUrl': json['return_url'] == null ? undefined : json['return_url'],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function SubscriptionPortalRequestToJSON(json: any): SubscriptionPortalRequest {
|
|
52
|
+
return SubscriptionPortalRequestToJSONTyped(json, false);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function SubscriptionPortalRequestToJSONTyped(value?: SubscriptionPortalRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
56
|
+
if (value == null) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
|
|
62
|
+
'return_url': value['returnUrl'],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|