glitch-javascript-sdk 4.0.1 → 4.2.0
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/dist/browser/hosting-runtime.js +5840 -5627
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +304 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +5 -0
- package/dist/esm/api/Mcp.d.ts +8 -0
- package/dist/esm/api/Preorders.d.ts +239 -0
- package/dist/esm/api/Scheduler.d.ts +3 -1
- package/dist/esm/api/Titles.d.ts +127 -2
- package/dist/esm/api/index.d.ts +1 -0
- package/dist/esm/hosting-runtime.d.ts +13 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +293 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/PreordersRoute.d.ts +7 -0
- package/dist/index.d.ts +382 -4
- package/guides/game-license-validation.md +54 -0
- package/guides/microtransactions.md +157 -9
- package/package.json +2 -2
- package/src/api/Campaigns.ts +8 -0
- package/src/api/Mcp.ts +23 -0
- package/src/api/Preorders.ts +342 -0
- package/src/api/Scheduler.ts +3 -1
- package/src/api/Titles.ts +246 -99
- package/src/api/index.ts +1 -0
- package/src/hosting-runtime.ts +277 -2
- package/src/index.ts +4 -0
- package/src/routes/CampaignsRoute.ts +1 -0
- package/src/routes/McpRoute.ts +5 -0
- package/src/routes/PreordersRoute.ts +46 -0
- package/src/routes/TitlesRoute.ts +13 -0
|
@@ -607,6 +607,11 @@ declare class Campaigns {
|
|
|
607
607
|
* @returns promise
|
|
608
608
|
*/
|
|
609
609
|
static sourcingGetSimilarIgdbGames<T>(campaign_id: string, params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
610
|
+
/**
|
|
611
|
+
* Discover recently streamed look-alikes for Easy Create (minimum five).
|
|
612
|
+
* Never treat older Twitch activity as currently streaming.
|
|
613
|
+
*/
|
|
614
|
+
static sourcingGetActiveStreamLookalikes<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
610
615
|
/**
|
|
611
616
|
* Find content creators for selected games. This does not save them to the database.
|
|
612
617
|
* @param campaign_id The UUID of the campaign.
|
package/dist/esm/api/Mcp.d.ts
CHANGED
|
@@ -27,6 +27,14 @@ declare class Mcp {
|
|
|
27
27
|
static titleContext<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
28
28
|
/** Check subscription, trial, plan, and credit state for a title. */
|
|
29
29
|
static billing<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
30
|
+
/** Discover title-scoped social operations for ordinary and eligible Agent subscriptions. */
|
|
31
|
+
static socialCapabilities<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
32
|
+
static socialOperation<T>(title_id: string, operation: string, args: Record<string, unknown>, confirm?: boolean, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
|
+
/** Discover full advertising and conversion tracking operations. */
|
|
34
|
+
static marketingCapabilities<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
35
|
+
/** Run a title-scoped advertising or conversion operation; mutations require confirmation. */
|
|
36
|
+
static marketingOperation<T>(title_id: string, operation: string, args: Record<string, unknown>, confirm?: boolean, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
37
|
+
static influencerCampaignOperation<T>(title_id: string, operation: string, fields?: Record<string, unknown>, campaign_id?: string, confirm?: boolean, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
30
38
|
/** Start a paid Glitch Agent run for a title. */
|
|
31
39
|
static startRun<T>(title_id: string, data?: McpStartRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
32
40
|
/** Fetch a durable run with status, actions, guidance, events, files, and report. */
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { AxiosPromise, AxiosRequestConfig } from 'axios';
|
|
2
|
+
import Response from '../util/Response';
|
|
3
|
+
export type PreorderFulfillmentType = 'glitch_license' | 'platform_key';
|
|
4
|
+
export type PreorderOfferStatus = 'draft' | 'active' | 'paused' | 'ended' | 'archived';
|
|
5
|
+
export type PreorderDerivedState = 'draft' | 'available' | 'scheduled' | 'sold_out' | 'paused' | 'ended' | 'released' | 'archived';
|
|
6
|
+
export type PreorderPaymentStatus = 'created' | 'requires_action' | 'processing' | 'paid' | 'failed' | 'canceled' | 'refunded' | 'disputed' | 'unknown';
|
|
7
|
+
export type PreorderFulfillmentStatus = 'waiting_for_release' | 'ready' | 'processing' | 'fulfilled' | 'blocked_missing_build' | 'blocked_missing_key' | 'canceled' | 'failed';
|
|
8
|
+
export interface PreorderRequestOptions extends Pick<AxiosRequestConfig, 'signal' | 'timeout' | 'headers'> {
|
|
9
|
+
}
|
|
10
|
+
export interface PreorderPrice {
|
|
11
|
+
country: string;
|
|
12
|
+
currency: string;
|
|
13
|
+
amount_minor: number;
|
|
14
|
+
}
|
|
15
|
+
export interface PreorderInventory {
|
|
16
|
+
available: number;
|
|
17
|
+
reserved: number;
|
|
18
|
+
delivered: number;
|
|
19
|
+
retired: number;
|
|
20
|
+
total: number;
|
|
21
|
+
}
|
|
22
|
+
export interface PreorderOfferInput {
|
|
23
|
+
sku: string;
|
|
24
|
+
platform_code: string;
|
|
25
|
+
platform_label: string;
|
|
26
|
+
fulfillment_type: PreorderFulfillmentType;
|
|
27
|
+
status?: PreorderOfferStatus;
|
|
28
|
+
sales_start_at?: string | null;
|
|
29
|
+
sales_end_at?: string | null;
|
|
30
|
+
release_at: string;
|
|
31
|
+
limit_total?: number | null;
|
|
32
|
+
max_per_user?: number;
|
|
33
|
+
custom_message?: string | null;
|
|
34
|
+
post_purchase_url?: string | null;
|
|
35
|
+
redeem_url?: string | null;
|
|
36
|
+
prices: PreorderPrice[];
|
|
37
|
+
}
|
|
38
|
+
export interface PreorderOffer extends Omit<PreorderOfferInput, 'status'> {
|
|
39
|
+
id: string;
|
|
40
|
+
title_id: string;
|
|
41
|
+
status: PreorderOfferStatus;
|
|
42
|
+
state: PreorderDerivedState;
|
|
43
|
+
sold: number;
|
|
44
|
+
reserved_or_paid: number;
|
|
45
|
+
remaining: number | null;
|
|
46
|
+
revision: number;
|
|
47
|
+
inventory?: PreorderInventory;
|
|
48
|
+
owned_count?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface PreorderSettings {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
hosted_checkout_enabled: boolean;
|
|
53
|
+
timezone: string;
|
|
54
|
+
readiness?: PreorderReadiness;
|
|
55
|
+
}
|
|
56
|
+
export interface PreorderCatalog {
|
|
57
|
+
enabled: boolean;
|
|
58
|
+
timezone?: string;
|
|
59
|
+
offers: PreorderOffer[];
|
|
60
|
+
}
|
|
61
|
+
export interface PreorderPurchaseInput {
|
|
62
|
+
country?: string;
|
|
63
|
+
currency?: string;
|
|
64
|
+
idempotency_key: string;
|
|
65
|
+
payment_method_id?: string;
|
|
66
|
+
payment_intent_id?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface HostedPreorderCatalog extends PreorderCatalog {
|
|
69
|
+
hosted_checkout_enabled: boolean;
|
|
70
|
+
title: {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
};
|
|
74
|
+
hosting: {
|
|
75
|
+
site_id: string;
|
|
76
|
+
hostname: string;
|
|
77
|
+
origin: string;
|
|
78
|
+
};
|
|
79
|
+
checkout_origin: string;
|
|
80
|
+
embed_script_url: string;
|
|
81
|
+
version: number;
|
|
82
|
+
}
|
|
83
|
+
export interface HostedPreorderSessionInput {
|
|
84
|
+
offer_id: string;
|
|
85
|
+
return_origin: string;
|
|
86
|
+
nonce: string;
|
|
87
|
+
country?: string;
|
|
88
|
+
currency?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface HostedPreorderRestoreInput {
|
|
91
|
+
return_origin: string;
|
|
92
|
+
nonce: string;
|
|
93
|
+
country?: string;
|
|
94
|
+
currency?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface HostedPreorderPaymentState {
|
|
97
|
+
status: string;
|
|
98
|
+
requires_action?: boolean;
|
|
99
|
+
client_secret?: string | null;
|
|
100
|
+
payment_intent_id?: string | null;
|
|
101
|
+
retryable_same_request?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface HostedPreorderSession {
|
|
104
|
+
id: string;
|
|
105
|
+
checkout_session_id: string;
|
|
106
|
+
intent: 'preorder' | 'preorder_restore';
|
|
107
|
+
title: {
|
|
108
|
+
id: string;
|
|
109
|
+
name: string;
|
|
110
|
+
};
|
|
111
|
+
hosting_site_id: string;
|
|
112
|
+
offer?: PreorderOffer | null;
|
|
113
|
+
country: string;
|
|
114
|
+
currency: string;
|
|
115
|
+
return_origin: string;
|
|
116
|
+
nonce: string;
|
|
117
|
+
expires_at: string;
|
|
118
|
+
authenticated: boolean;
|
|
119
|
+
status: string;
|
|
120
|
+
order?: PreorderOrder | null;
|
|
121
|
+
orders?: PreorderOrder[];
|
|
122
|
+
payment?: HostedPreorderPaymentState | null;
|
|
123
|
+
session_token?: string;
|
|
124
|
+
hosted_url?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface PreorderOrder {
|
|
127
|
+
id: string;
|
|
128
|
+
title_id: string;
|
|
129
|
+
offer_id: string;
|
|
130
|
+
user_id?: string;
|
|
131
|
+
platform_code: string;
|
|
132
|
+
platform_label: string;
|
|
133
|
+
fulfillment_type: PreorderFulfillmentType;
|
|
134
|
+
payment_status: PreorderPaymentStatus;
|
|
135
|
+
fulfillment_status: PreorderFulfillmentStatus;
|
|
136
|
+
currency: string;
|
|
137
|
+
subtotal_minor: number;
|
|
138
|
+
tax_minor: number;
|
|
139
|
+
total_minor: number;
|
|
140
|
+
promised_release_at: string;
|
|
141
|
+
current_release_at: string;
|
|
142
|
+
paid_at?: string;
|
|
143
|
+
fulfilled_at?: string;
|
|
144
|
+
custom_message?: string;
|
|
145
|
+
post_purchase_url?: string;
|
|
146
|
+
redeem_url?: string;
|
|
147
|
+
platform_key?: string;
|
|
148
|
+
key_masked_suffix?: string;
|
|
149
|
+
purchase_email?: string;
|
|
150
|
+
provider_reference?: string;
|
|
151
|
+
commission_minor?: number;
|
|
152
|
+
developer_share_minor?: number;
|
|
153
|
+
requires_action?: boolean;
|
|
154
|
+
client_secret?: string;
|
|
155
|
+
payment_intent_id?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface PreorderReadinessIssue {
|
|
158
|
+
offer_id: string;
|
|
159
|
+
code: string;
|
|
160
|
+
[key: string]: unknown;
|
|
161
|
+
}
|
|
162
|
+
export interface PreorderReadiness {
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
ready: boolean;
|
|
165
|
+
blockers: PreorderReadinessIssue[];
|
|
166
|
+
warnings: PreorderReadinessIssue[];
|
|
167
|
+
}
|
|
168
|
+
export interface PreorderAdminOrderFilters {
|
|
169
|
+
offer_id?: string;
|
|
170
|
+
payment_status?: string;
|
|
171
|
+
fulfillment_status?: string;
|
|
172
|
+
per_page?: number;
|
|
173
|
+
page?: number;
|
|
174
|
+
}
|
|
175
|
+
export type PreorderAdminOrderAction = 'refund' | 'reconcile' | 'fulfill' | 'resend_receipt' | 'resend_access';
|
|
176
|
+
declare class Preorders {
|
|
177
|
+
private static hostedOptions;
|
|
178
|
+
static hostedCatalog(options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderCatalog>>;
|
|
179
|
+
static createHostedSession(data: HostedPreorderSessionInput, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
180
|
+
static createHostedRestoreSession(data: HostedPreorderRestoreInput, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
181
|
+
static hostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
182
|
+
static hostedMine(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
183
|
+
static authenticateHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
184
|
+
static checkoutHostedSession(title_id: string, session_id: string, checkoutToken: string, data: {
|
|
185
|
+
accept_terms: boolean;
|
|
186
|
+
payment_method_id?: string;
|
|
187
|
+
payment_intent_id?: string;
|
|
188
|
+
}, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
189
|
+
static reconcileHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
190
|
+
static retryHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
191
|
+
static refundHostedOrder(title_id: string, session_id: string, checkoutToken: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
|
|
192
|
+
static resendHostedAccess(title_id: string, session_id: string, checkoutToken: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
193
|
+
resent: boolean;
|
|
194
|
+
}>>;
|
|
195
|
+
static catalog(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderCatalog>>;
|
|
196
|
+
static purchase(title_id: string, offer_id: string, data: PreorderPurchaseInput, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
|
|
197
|
+
static myOrders(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
198
|
+
orders: PreorderOrder[];
|
|
199
|
+
}>>;
|
|
200
|
+
static order(title_id: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
|
|
201
|
+
static refundMine(title_id: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
|
|
202
|
+
static resendMine(title_id: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
203
|
+
resent: boolean;
|
|
204
|
+
}>>;
|
|
205
|
+
static settings(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderSettings>>;
|
|
206
|
+
static updateSettings(title_id: string, data: Partial<Pick<PreorderSettings, 'enabled' | 'hosted_checkout_enabled' | 'timezone'>>, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderSettings>>;
|
|
207
|
+
static offers(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
208
|
+
offers: PreorderOffer[];
|
|
209
|
+
}>>;
|
|
210
|
+
static offer(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
|
|
211
|
+
static createOffer(title_id: string, data: PreorderOfferInput, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
|
|
212
|
+
static updateOffer(title_id: string, offer_id: string, data: PreorderOfferInput, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
|
|
213
|
+
static activateOffer(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
|
|
214
|
+
static pauseOffer(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
|
|
215
|
+
static archiveOffer(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
|
|
216
|
+
static inventory(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderInventory>>;
|
|
217
|
+
static importKeys(title_id: string, offer_id: string, keys: string[], options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
218
|
+
inserted: number;
|
|
219
|
+
duplicate_in_upload: number;
|
|
220
|
+
duplicate_existing: number;
|
|
221
|
+
invalid: number;
|
|
222
|
+
inventory: PreorderInventory;
|
|
223
|
+
}>>;
|
|
224
|
+
static importKeyFile<T>(title_id: string, offer_id: string, file: File | Blob): AxiosPromise<Response<T>>;
|
|
225
|
+
static retireKey(title_id: string, offer_id: string, key_id: string, reason: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
226
|
+
id: string;
|
|
227
|
+
status: string;
|
|
228
|
+
masked_suffix: string;
|
|
229
|
+
}>>;
|
|
230
|
+
static adminOrders(title_id: string, filters?: PreorderAdminOrderFilters, options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
231
|
+
orders: PreorderOrder[];
|
|
232
|
+
pagination: Record<string, number>;
|
|
233
|
+
}>>;
|
|
234
|
+
static readiness(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderReadiness>>;
|
|
235
|
+
static adminOrderAction(title_id: string, order_id: string, action: PreorderAdminOrderAction, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
|
|
236
|
+
static mcpCapabilities<T = unknown>(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<T>>;
|
|
237
|
+
static mcpOperation<T = unknown>(title_id: string, operation: string, argumentsData?: Record<string, unknown>, options?: PreorderRequestOptions): AxiosPromise<Response<T>>;
|
|
238
|
+
}
|
|
239
|
+
export default Preorders;
|
|
@@ -646,7 +646,9 @@ declare class Scheduler {
|
|
|
646
646
|
*/
|
|
647
647
|
static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
648
648
|
/**
|
|
649
|
-
* List
|
|
649
|
+
* List provider conversion actions (Google), Pixel sources (Meta, TikTok, Reddit), or X website-event tags
|
|
650
|
+
* for the scheduler's connected advertising account. The Reddit result
|
|
651
|
+
* does not establish delivery of conversion events.
|
|
650
652
|
* GET /schedulers/{scheduler_id}/conversion-actions
|
|
651
653
|
*/
|
|
652
654
|
static listConversionActions<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
package/dist/esm/api/Titles.d.ts
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
import Response from "../util/Response";
|
|
2
2
|
import { AxiosPromise } from "axios";
|
|
3
|
+
export type AegisLicenseType = 'premium' | 'rental' | 'subscription' | 'sponsored' | 'admin' | 'trial' | 'free' | 'demo' | 'playtest' | 'none';
|
|
4
|
+
export interface AegisLicenseDetail {
|
|
5
|
+
id: string | null;
|
|
6
|
+
type: AegisLicenseType;
|
|
7
|
+
source: string | null;
|
|
8
|
+
status: string;
|
|
9
|
+
acquired_at: string | null;
|
|
10
|
+
purchased_at: string | null;
|
|
11
|
+
expires_at: string | null;
|
|
12
|
+
is_permanent: boolean;
|
|
13
|
+
price_paid: {
|
|
14
|
+
amount: string;
|
|
15
|
+
currency: string;
|
|
16
|
+
} | null;
|
|
17
|
+
}
|
|
18
|
+
export interface AegisInstallValidation {
|
|
19
|
+
valid: boolean;
|
|
20
|
+
reason?: string;
|
|
21
|
+
code?: string;
|
|
22
|
+
user_id?: string | null;
|
|
23
|
+
user_name?: string;
|
|
24
|
+
/** Kept for backward compatibility; inspect license.type for the exact category. */
|
|
25
|
+
license_type?: string;
|
|
26
|
+
license?: AegisLicenseDetail;
|
|
27
|
+
access?: {
|
|
28
|
+
premium_purchase_required: boolean;
|
|
29
|
+
subscription_alone_sufficient: boolean;
|
|
30
|
+
};
|
|
31
|
+
build_type?: 'production' | 'demo' | 'playtest';
|
|
32
|
+
has_full_access?: boolean;
|
|
33
|
+
non_revenue_build?: boolean;
|
|
34
|
+
trial_time_remaining?: number | null;
|
|
35
|
+
rental_time_remaining?: number | null;
|
|
36
|
+
server_time?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface GameMonetizationSettings {
|
|
39
|
+
is_premium: boolean;
|
|
40
|
+
premium_price: string | number | null;
|
|
41
|
+
is_rental: boolean;
|
|
42
|
+
rental_price: string | number | null;
|
|
43
|
+
rental_duration_hours: number;
|
|
44
|
+
is_subscription_eligible: boolean;
|
|
45
|
+
premium_purchase_required_for_full_game: boolean;
|
|
46
|
+
}
|
|
3
47
|
export type GameReviewRecommendation = 'recommended' | 'not_recommended' | 'neutral';
|
|
4
48
|
export type GameReviewSentiment = 'positive' | 'mixed' | 'negative';
|
|
5
49
|
export type GameReviewVoteType = 'helpful' | 'funny' | 'detailed' | 'not_helpful';
|
|
@@ -90,6 +134,13 @@ declare class Titles {
|
|
|
90
134
|
* @returns promise
|
|
91
135
|
*/
|
|
92
136
|
static update<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
137
|
+
/** View public title monetization settings. For mutation use authenticated title admin. */
|
|
138
|
+
static getGameMonetization<T = GameMonetizationSettings>(title_id: string): AxiosPromise<Response<T>>;
|
|
139
|
+
/**
|
|
140
|
+
* Update publisher monetization including premium_purchase_required_for_full_game.
|
|
141
|
+
* Requires a title administrator JWT; backend validates premium/subscription/rental compatibility.
|
|
142
|
+
*/
|
|
143
|
+
static updateGameMonetization<T = GameMonetizationSettings>(title_id: string, settings: Partial<GameMonetizationSettings>): AxiosPromise<Response<T>>;
|
|
93
144
|
/**
|
|
94
145
|
* Retrieve the information for a single title.
|
|
95
146
|
*
|
|
@@ -585,9 +636,13 @@ declare class Titles {
|
|
|
585
636
|
*
|
|
586
637
|
* @param title_id The UUID of the game title.
|
|
587
638
|
* @param install_id The UUID of the specific install/session.
|
|
588
|
-
* @returns
|
|
639
|
+
* @returns Access result with a backward-compatible license_type and exact license
|
|
640
|
+
* metadata: type, status, source, acquired_at, purchased_at, expires_at and
|
|
641
|
+
* verified price_paid (null when no authoritative historical price exists).
|
|
642
|
+
* Production requests may return PREMIUM_PURCHASE_REQUIRED (403).
|
|
643
|
+
* The caller must block gameplay when valid is false.
|
|
589
644
|
*/
|
|
590
|
-
static validateInstall<T>(title_id: string, install_id: string): AxiosPromise<Response<T>>;
|
|
645
|
+
static validateInstall<T = AegisInstallValidation>(title_id: string, install_id: string): AxiosPromise<Response<T>>;
|
|
591
646
|
/**
|
|
592
647
|
* List all builds/deployments for a specific title.
|
|
593
648
|
* @param title_id The UUID of the title.
|
|
@@ -834,5 +889,75 @@ declare class Titles {
|
|
|
834
889
|
linked_patch_note_id?: string;
|
|
835
890
|
issue_marked_fixed?: boolean;
|
|
836
891
|
}): AxiosPromise<Response<T>>;
|
|
892
|
+
/**
|
|
893
|
+
* Steam Financial API connection and sync status for a title: masked key, partner,
|
|
894
|
+
* last sync times, stored sales/wishlist date ranges and pending dates.
|
|
895
|
+
*/
|
|
896
|
+
static steamFinancialsStatus<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
897
|
+
/**
|
|
898
|
+
* Verify a Steamworks Financial API Group key with Steam and store it (encrypted) on the title.
|
|
899
|
+
* Queues a full sync unless `sync: false` is passed.
|
|
900
|
+
*
|
|
901
|
+
* @param data { api_key: string, sync?: boolean }
|
|
902
|
+
*/
|
|
903
|
+
static steamFinancialsConnect<T>(title_id: string, data: {
|
|
904
|
+
api_key: string;
|
|
905
|
+
sync?: boolean;
|
|
906
|
+
}): AxiosPromise<Response<T>>;
|
|
907
|
+
/** Check a key (or the stored key when api_key is omitted) with Steam without saving anything. */
|
|
908
|
+
static steamFinancialsTestKey<T>(title_id: string, data?: {
|
|
909
|
+
api_key?: string;
|
|
910
|
+
}): AxiosPromise<Response<T>>;
|
|
911
|
+
/** Remove the stored key. Pass { purge_data: true } to also delete synced Steam financial data. */
|
|
912
|
+
static steamFinancialsDisconnect<T>(title_id: string, params?: {
|
|
913
|
+
purge_data?: boolean;
|
|
914
|
+
}): AxiosPromise<Response<T>>;
|
|
915
|
+
/**
|
|
916
|
+
* Sync sales and/or wishlists from Steam. Queued by default; pass `wait: true` for a short inline run.
|
|
917
|
+
*
|
|
918
|
+
* @param data { datasets?: ('sales'|'wishlists')[], full?: boolean, wait?: boolean, max_dates?: number, max_days?: number, from?: string, to?: string, include_view_grants?: boolean }
|
|
919
|
+
*/
|
|
920
|
+
static steamFinancialsSync<T>(title_id: string, data?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
921
|
+
/**
|
|
922
|
+
* Report bundle built from synced Steam data: summary, sales over time and by country, region,
|
|
923
|
+
* product, platform, sale type, discount and price point, key activations, revenue-share tiers,
|
|
924
|
+
* wishlists over time and by country, region, language and platform, and the wishlist-to-sales funnel.
|
|
925
|
+
*
|
|
926
|
+
* @param params { from?: 'YYYY-MM-DD', to?: 'YYYY-MM-DD', report_keys?: string (comma separated), app_scope?: 'title'|'partner', app_id?: number, limit?: number }
|
|
927
|
+
*/
|
|
928
|
+
static steamFinancialsReports<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
929
|
+
/**
|
|
930
|
+
* Paginated Steam sales line items (every GetDetailedSales field) with product, country,
|
|
931
|
+
* discount and key-request names attached.
|
|
932
|
+
*
|
|
933
|
+
* @param params { from?, to?, app_scope?, app_id?, page?, per_page?, country_code?, platform?, line_item_type?, package_sale_type?, currency?, packageid?, bundleid?, key_request_id?, combined_discount_id? }
|
|
934
|
+
*/
|
|
935
|
+
static steamFinancialsSales<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
936
|
+
/**
|
|
937
|
+
* Daily Steam wishlist rows; pass dimension 'country' or 'language' for the breakdown rows.
|
|
938
|
+
*
|
|
939
|
+
* @param params { from?, to?, app_id?, dimension?: 'country'|'language' }
|
|
940
|
+
*/
|
|
941
|
+
static steamFinancialsWishlists<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
942
|
+
/** Names Steam returned with sales: package, app, bundle, discount, combined_discount, key_request, game_item, country, partner. */
|
|
943
|
+
static steamFinancialsLookups<T>(title_id: string, params?: {
|
|
944
|
+
kind?: string;
|
|
945
|
+
}): AxiosPromise<Response<T>>;
|
|
946
|
+
/** Live GetChangedDatesForPartner (nothing stored). */
|
|
947
|
+
static steamFinancialsLiveChangedDates<T>(title_id: string, params?: {
|
|
948
|
+
highwatermark?: string;
|
|
949
|
+
include_view_grants?: boolean;
|
|
950
|
+
}): AxiosPromise<Response<T>>;
|
|
951
|
+
/** Live GetDetailedSales for one date and page (nothing stored). */
|
|
952
|
+
static steamFinancialsLiveDetailedSales<T>(title_id: string, params: {
|
|
953
|
+
date: string;
|
|
954
|
+
highwatermark_id?: string;
|
|
955
|
+
include_view_grants?: boolean;
|
|
956
|
+
}): AxiosPromise<Response<T>>;
|
|
957
|
+
/** Live GetAppWishlistReporting for one date (nothing stored). */
|
|
958
|
+
static steamFinancialsLiveWishlist<T>(title_id: string, params: {
|
|
959
|
+
date: string;
|
|
960
|
+
app_id?: number;
|
|
961
|
+
}): AxiosPromise<Response<T>>;
|
|
837
962
|
}
|
|
838
963
|
export default Titles;
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
type HostedPreorderClient = {
|
|
2
|
+
open: (options: {
|
|
3
|
+
offerId: string;
|
|
4
|
+
onComplete?: (order: Record<string, any>) => void;
|
|
5
|
+
onClose?: (reason?: string) => void;
|
|
6
|
+
onError?: (error: any) => void;
|
|
7
|
+
}) => Promise<any>;
|
|
8
|
+
restore?: (options?: {
|
|
9
|
+
onClose?: (reason?: string) => void;
|
|
10
|
+
onError?: (error: any) => void;
|
|
11
|
+
}) => Promise<any>;
|
|
12
|
+
};
|
|
1
13
|
declare global {
|
|
2
14
|
interface Window {
|
|
3
15
|
GlitchHosting?: {
|
|
@@ -5,6 +17,7 @@ declare global {
|
|
|
5
17
|
session?: Record<string, any>;
|
|
6
18
|
getContext: () => Record<string, any> | null;
|
|
7
19
|
};
|
|
20
|
+
GlitchPreorders?: HostedPreorderClient;
|
|
8
21
|
}
|
|
9
22
|
}
|
|
10
23
|
export {};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { Publications } from "./api";
|
|
|
27
27
|
import { GameShows } from "./api";
|
|
28
28
|
import FestivalNetworking from './api/FestivalNetworking';
|
|
29
29
|
export * from './api/FestivalNetworking';
|
|
30
|
+
export type { AegisLicenseType, AegisLicenseDetail, AegisInstallValidation, GameMonetizationSettings } from './api/Titles';
|
|
30
31
|
import { Newsletters } from "./api";
|
|
31
32
|
import { PlayTests } from "./api";
|
|
32
33
|
import { Media } from "./api";
|
|
@@ -57,7 +58,9 @@ import { GameAdvertising } from './api';
|
|
|
57
58
|
import { Hosting } from './api';
|
|
58
59
|
import { GameDesign } from './api';
|
|
59
60
|
import { Microtransactions } from './api';
|
|
61
|
+
import { Preorders } from './api';
|
|
60
62
|
export * from './api/Microtransactions';
|
|
63
|
+
export * from './api/Preorders';
|
|
61
64
|
export * from './util/MicrotransactionBridge';
|
|
62
65
|
export * from './util/MicrotransactionOverlay';
|
|
63
66
|
import Requests from "./util/Requests";
|
|
@@ -137,6 +140,7 @@ declare class Glitch {
|
|
|
137
140
|
Hosting: typeof Hosting;
|
|
138
141
|
GameDesign: typeof GameDesign;
|
|
139
142
|
Microtransactions: typeof Microtransactions;
|
|
143
|
+
Preorders: typeof Preorders;
|
|
140
144
|
};
|
|
141
145
|
static util: {
|
|
142
146
|
Requests: typeof Requests;
|