@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.
Files changed (71) hide show
  1. package/.openapi-generator/FILES +14 -0
  2. package/README.md +13 -2
  3. package/dist/apis/BillingApi.d.ts +53 -0
  4. package/dist/apis/BillingApi.js +141 -0
  5. package/dist/apis/InferenceApi.d.ts +18 -0
  6. package/dist/apis/InferenceApi.js +51 -0
  7. package/dist/esm/apis/BillingApi.d.ts +53 -0
  8. package/dist/esm/apis/BillingApi.js +141 -0
  9. package/dist/esm/apis/InferenceApi.d.ts +18 -0
  10. package/dist/esm/apis/InferenceApi.js +51 -0
  11. package/dist/esm/models/InferencePreflight.d.ts +92 -0
  12. package/dist/esm/models/InferencePreflight.js +86 -0
  13. package/dist/esm/models/RefereeStatus.d.ts +79 -0
  14. package/dist/esm/models/RefereeStatus.js +70 -0
  15. package/dist/esm/models/Referral.d.ts +94 -0
  16. package/dist/esm/models/Referral.js +82 -0
  17. package/dist/esm/models/SubscriptionCheckoutRequest.d.ts +45 -0
  18. package/dist/esm/models/SubscriptionCheckoutRequest.js +45 -0
  19. package/dist/esm/models/SubscriptionCheckoutSession.d.ts +45 -0
  20. package/dist/esm/models/SubscriptionCheckoutSession.js +52 -0
  21. package/dist/esm/models/SubscriptionPortalRequest.d.ts +32 -0
  22. package/dist/esm/models/SubscriptionPortalRequest.js +41 -0
  23. package/dist/esm/models/SubscriptionPortalSession.d.ts +32 -0
  24. package/dist/esm/models/SubscriptionPortalSession.js +43 -0
  25. package/dist/esm/models/VideoJob.d.ts +6 -0
  26. package/dist/esm/models/VideoJob.js +2 -0
  27. package/dist/esm/models/index.d.ts +7 -0
  28. package/dist/esm/models/index.js +7 -0
  29. package/dist/esm/runtime.js +1 -1
  30. package/dist/models/InferencePreflight.d.ts +92 -0
  31. package/dist/models/InferencePreflight.js +94 -0
  32. package/dist/models/RefereeStatus.d.ts +79 -0
  33. package/dist/models/RefereeStatus.js +78 -0
  34. package/dist/models/Referral.d.ts +94 -0
  35. package/dist/models/Referral.js +89 -0
  36. package/dist/models/SubscriptionCheckoutRequest.d.ts +45 -0
  37. package/dist/models/SubscriptionCheckoutRequest.js +52 -0
  38. package/dist/models/SubscriptionCheckoutSession.d.ts +45 -0
  39. package/dist/models/SubscriptionCheckoutSession.js +59 -0
  40. package/dist/models/SubscriptionPortalRequest.d.ts +32 -0
  41. package/dist/models/SubscriptionPortalRequest.js +48 -0
  42. package/dist/models/SubscriptionPortalSession.d.ts +32 -0
  43. package/dist/models/SubscriptionPortalSession.js +50 -0
  44. package/dist/models/VideoJob.d.ts +6 -0
  45. package/dist/models/VideoJob.js +2 -0
  46. package/dist/models/index.d.ts +7 -0
  47. package/dist/models/index.js +7 -0
  48. package/dist/runtime.js +1 -1
  49. package/docs/BillingApi.md +220 -0
  50. package/docs/InferenceApi.md +74 -0
  51. package/docs/InferencePreflight.md +47 -0
  52. package/docs/RefereeStatus.md +47 -0
  53. package/docs/Referral.md +55 -0
  54. package/docs/SubscriptionCheckoutRequest.md +39 -0
  55. package/docs/SubscriptionCheckoutSession.md +38 -0
  56. package/docs/SubscriptionPortalRequest.md +35 -0
  57. package/docs/SubscriptionPortalSession.md +34 -0
  58. package/docs/VideoJob.md +2 -0
  59. package/package.json +1 -1
  60. package/src/apis/BillingApi.ts +180 -0
  61. package/src/apis/InferenceApi.ts +67 -0
  62. package/src/models/InferencePreflight.ts +147 -0
  63. package/src/models/RefereeStatus.ts +131 -0
  64. package/src/models/Referral.ts +164 -0
  65. package/src/models/SubscriptionCheckoutRequest.ts +82 -0
  66. package/src/models/SubscriptionCheckoutSession.ts +92 -0
  67. package/src/models/SubscriptionPortalRequest.ts +65 -0
  68. package/src/models/SubscriptionPortalSession.ts +66 -0
  69. package/src/models/VideoJob.ts +8 -0
  70. package/src/models/index.ts +7 -0
  71. package/src/runtime.ts +1 -1
@@ -0,0 +1,92 @@
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
+ * The verdict for one (organization, model) pair: what would happen if the model were invoked right now.
14
+ *
15
+ * @export
16
+ * @interface InferencePreflight
17
+ */
18
+ export interface InferencePreflight {
19
+ /**
20
+ * The canonical catalog id the request resolved to.
21
+ * @type {string}
22
+ * @memberof InferencePreflight
23
+ */
24
+ model: string;
25
+ /**
26
+ * `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).
27
+ * @type {InferencePreflightVerdictEnum}
28
+ * @memberof InferencePreflight
29
+ */
30
+ verdict: InferencePreflightVerdictEnum;
31
+ /**
32
+ * Stable code explaining the verdict, for clients that need their own wording. Absent on a plain `ok` that needs no explanation.
33
+ * @type {InferencePreflightReasonEnum}
34
+ * @memberof InferencePreflight
35
+ */
36
+ reason?: InferencePreflightReasonEnum;
37
+ /**
38
+ * 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.
39
+ * @type {string}
40
+ * @memberof InferencePreflight
41
+ */
42
+ message: string;
43
+ /**
44
+ * 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.
45
+ * @type {boolean}
46
+ * @memberof InferencePreflight
47
+ */
48
+ planCovered: boolean;
49
+ /**
50
+ * Whether the organization is entitled to the plan right now.
51
+ * @type {boolean}
52
+ * @memberof InferencePreflight
53
+ */
54
+ subscribed: boolean;
55
+ /**
56
+ * 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.
57
+ * @type {boolean}
58
+ * @memberof InferencePreflight
59
+ */
60
+ funded: boolean;
61
+ }
62
+ /**
63
+ * @export
64
+ */
65
+ export declare const InferencePreflightVerdictEnum: {
66
+ readonly Ok: "ok";
67
+ readonly Warn: "warn";
68
+ readonly Block: "block";
69
+ };
70
+ export type InferencePreflightVerdictEnum = typeof InferencePreflightVerdictEnum[keyof typeof InferencePreflightVerdictEnum];
71
+ /**
72
+ * @export
73
+ */
74
+ export declare const InferencePreflightReasonEnum: {
75
+ readonly PlanCovered: "plan_covered";
76
+ readonly Payg: "payg";
77
+ readonly NotPlanCovered: "not_plan_covered";
78
+ readonly SubscriptionQuotaExhausted: "subscription_quota_exhausted";
79
+ readonly InsufficientBalance: "insufficient_balance";
80
+ readonly DailyLimitReached: "daily_limit_reached";
81
+ readonly MonthlyLimitReached: "monthly_limit_reached";
82
+ readonly PreflightUnavailable: "preflight_unavailable";
83
+ };
84
+ export type InferencePreflightReasonEnum = typeof InferencePreflightReasonEnum[keyof typeof InferencePreflightReasonEnum];
85
+ /**
86
+ * Check if a given object implements the InferencePreflight interface.
87
+ */
88
+ export declare function instanceOfInferencePreflight(value: object): value is InferencePreflight;
89
+ export declare function InferencePreflightFromJSON(json: any): InferencePreflight;
90
+ export declare function InferencePreflightFromJSONTyped(json: any, ignoreDiscriminator: boolean): InferencePreflight;
91
+ export declare function InferencePreflightToJSON(json: any): InferencePreflight;
92
+ export declare function InferencePreflightToJSONTyped(value?: InferencePreflight | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,94 @@
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.InferencePreflightReasonEnum = exports.InferencePreflightVerdictEnum = void 0;
17
+ exports.instanceOfInferencePreflight = instanceOfInferencePreflight;
18
+ exports.InferencePreflightFromJSON = InferencePreflightFromJSON;
19
+ exports.InferencePreflightFromJSONTyped = InferencePreflightFromJSONTyped;
20
+ exports.InferencePreflightToJSON = InferencePreflightToJSON;
21
+ exports.InferencePreflightToJSONTyped = InferencePreflightToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.InferencePreflightVerdictEnum = {
26
+ Ok: 'ok',
27
+ Warn: 'warn',
28
+ Block: 'block'
29
+ };
30
+ /**
31
+ * @export
32
+ */
33
+ exports.InferencePreflightReasonEnum = {
34
+ PlanCovered: 'plan_covered',
35
+ Payg: 'payg',
36
+ NotPlanCovered: 'not_plan_covered',
37
+ SubscriptionQuotaExhausted: 'subscription_quota_exhausted',
38
+ InsufficientBalance: 'insufficient_balance',
39
+ DailyLimitReached: 'daily_limit_reached',
40
+ MonthlyLimitReached: 'monthly_limit_reached',
41
+ PreflightUnavailable: 'preflight_unavailable'
42
+ };
43
+ /**
44
+ * Check if a given object implements the InferencePreflight interface.
45
+ */
46
+ function instanceOfInferencePreflight(value) {
47
+ if (!('model' in value) || value['model'] === undefined)
48
+ return false;
49
+ if (!('verdict' in value) || value['verdict'] === undefined)
50
+ return false;
51
+ if (!('message' in value) || value['message'] === undefined)
52
+ return false;
53
+ if ((!('planCovered' in value) && !('plan_covered' in value)) || (value['planCovered'] === undefined && value['plan_covered'] === undefined))
54
+ return false;
55
+ if (!('subscribed' in value) || value['subscribed'] === undefined)
56
+ return false;
57
+ if (!('funded' in value) || value['funded'] === undefined)
58
+ return false;
59
+ return true;
60
+ }
61
+ function InferencePreflightFromJSON(json) {
62
+ return InferencePreflightFromJSONTyped(json, false);
63
+ }
64
+ function InferencePreflightFromJSONTyped(json, ignoreDiscriminator) {
65
+ if (json == null) {
66
+ return json;
67
+ }
68
+ return {
69
+ 'model': json['model'],
70
+ 'verdict': json['verdict'],
71
+ 'reason': json['reason'] == null ? undefined : json['reason'],
72
+ 'message': json['message'],
73
+ 'planCovered': json['plan_covered'],
74
+ 'subscribed': json['subscribed'],
75
+ 'funded': json['funded'],
76
+ };
77
+ }
78
+ function InferencePreflightToJSON(json) {
79
+ return InferencePreflightToJSONTyped(json, false);
80
+ }
81
+ function InferencePreflightToJSONTyped(value, ignoreDiscriminator = false) {
82
+ if (value == null) {
83
+ return value;
84
+ }
85
+ return {
86
+ 'model': value['model'],
87
+ 'verdict': value['verdict'],
88
+ 'reason': value['reason'],
89
+ 'message': value['message'],
90
+ 'plan_covered': value['planCovered'],
91
+ 'subscribed': value['subscribed'],
92
+ 'funded': value['funded'],
93
+ };
94
+ }
@@ -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
+ }
@@ -0,0 +1,45 @@
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
+ * Optional overrides for a checkout mint. Every field has a deployment default, so an empty body is the normal call.
14
+ *
15
+ * @export
16
+ * @interface SubscriptionCheckoutRequest
17
+ */
18
+ export interface SubscriptionCheckoutRequest {
19
+ /**
20
+ * Where the provider returns after a completed payment. Defaults to the deployment's configured URL.
21
+ * @type {string}
22
+ * @memberof SubscriptionCheckoutRequest
23
+ */
24
+ successUrl?: string;
25
+ /**
26
+ * Where the provider returns if checkout is abandoned. Defaults to the deployment's configured URL.
27
+ * @type {string}
28
+ * @memberof SubscriptionCheckoutRequest
29
+ */
30
+ cancelUrl?: string;
31
+ /**
32
+ * Pins the plan the client displayed. An unknown key is a 400 rather than a silent purchase of a different tier.
33
+ * @type {string}
34
+ * @memberof SubscriptionCheckoutRequest
35
+ */
36
+ planKey?: string;
37
+ }
38
+ /**
39
+ * Check if a given object implements the SubscriptionCheckoutRequest interface.
40
+ */
41
+ export declare function instanceOfSubscriptionCheckoutRequest(value: object): value is SubscriptionCheckoutRequest;
42
+ export declare function SubscriptionCheckoutRequestFromJSON(json: any): SubscriptionCheckoutRequest;
43
+ export declare function SubscriptionCheckoutRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionCheckoutRequest;
44
+ export declare function SubscriptionCheckoutRequestToJSON(json: any): SubscriptionCheckoutRequest;
45
+ export declare function SubscriptionCheckoutRequestToJSONTyped(value?: SubscriptionCheckoutRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,52 @@
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.instanceOfSubscriptionCheckoutRequest = instanceOfSubscriptionCheckoutRequest;
17
+ exports.SubscriptionCheckoutRequestFromJSON = SubscriptionCheckoutRequestFromJSON;
18
+ exports.SubscriptionCheckoutRequestFromJSONTyped = SubscriptionCheckoutRequestFromJSONTyped;
19
+ exports.SubscriptionCheckoutRequestToJSON = SubscriptionCheckoutRequestToJSON;
20
+ exports.SubscriptionCheckoutRequestToJSONTyped = SubscriptionCheckoutRequestToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the SubscriptionCheckoutRequest interface.
23
+ */
24
+ function instanceOfSubscriptionCheckoutRequest(value) {
25
+ return true;
26
+ }
27
+ function SubscriptionCheckoutRequestFromJSON(json) {
28
+ return SubscriptionCheckoutRequestFromJSONTyped(json, false);
29
+ }
30
+ function SubscriptionCheckoutRequestFromJSONTyped(json, ignoreDiscriminator) {
31
+ if (json == null) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'successUrl': json['success_url'] == null ? undefined : json['success_url'],
36
+ 'cancelUrl': json['cancel_url'] == null ? undefined : json['cancel_url'],
37
+ 'planKey': json['plan_key'] == null ? undefined : json['plan_key'],
38
+ };
39
+ }
40
+ function SubscriptionCheckoutRequestToJSON(json) {
41
+ return SubscriptionCheckoutRequestToJSONTyped(json, false);
42
+ }
43
+ function SubscriptionCheckoutRequestToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ 'success_url': value['successUrl'],
49
+ 'cancel_url': value['cancelUrl'],
50
+ 'plan_key': value['planKey'],
51
+ };
52
+ }
@@ -0,0 +1,45 @@
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 { SubscriptionPlan } from './SubscriptionPlan';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface SubscriptionCheckoutSession
17
+ */
18
+ export interface SubscriptionCheckoutSession {
19
+ /**
20
+ * The hosted page the customer must open to pay.
21
+ * @type {string}
22
+ * @memberof SubscriptionCheckoutSession
23
+ */
24
+ checkoutUrl: string;
25
+ /**
26
+ * Checkout session id, for support correlation.
27
+ * @type {string}
28
+ * @memberof SubscriptionCheckoutSession
29
+ */
30
+ sessionId: string;
31
+ /**
32
+ *
33
+ * @type {SubscriptionPlan}
34
+ * @memberof SubscriptionCheckoutSession
35
+ */
36
+ plan: SubscriptionPlan;
37
+ }
38
+ /**
39
+ * Check if a given object implements the SubscriptionCheckoutSession interface.
40
+ */
41
+ export declare function instanceOfSubscriptionCheckoutSession(value: object): value is SubscriptionCheckoutSession;
42
+ export declare function SubscriptionCheckoutSessionFromJSON(json: any): SubscriptionCheckoutSession;
43
+ export declare function SubscriptionCheckoutSessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionCheckoutSession;
44
+ export declare function SubscriptionCheckoutSessionToJSON(json: any): SubscriptionCheckoutSession;
45
+ export declare function SubscriptionCheckoutSessionToJSONTyped(value?: SubscriptionCheckoutSession | null, ignoreDiscriminator?: boolean): any;