glitch-javascript-sdk 3.9.7 → 3.9.9
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 +8 -0
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Hosting.d.ts +26 -2
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +26 -0
- package/package.json +1 -1
- package/src/api/Hosting.ts +30 -2
- package/src/routes/HostingRoute.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -11552,6 +11552,27 @@ type HostingPlanKey = 'free' | 'launch' | 'growth' | 'scale' | 'studio';
|
|
|
11552
11552
|
type HostingMode = 'static' | 'server';
|
|
11553
11553
|
type HostingDatabaseEngine = 'postgresql' | 'mysql' | 'azure_sql' | 'cosmos_nosql';
|
|
11554
11554
|
type HostingDatabasePlan = 'sandbox' | 'launch' | 'growth' | 'scale' | 'dedicated';
|
|
11555
|
+
interface HostingDatabaseCredentials {
|
|
11556
|
+
database_id: string;
|
|
11557
|
+
name: string;
|
|
11558
|
+
engine: HostingDatabaseEngine;
|
|
11559
|
+
binding_name: string;
|
|
11560
|
+
connection_string: string;
|
|
11561
|
+
connection: {
|
|
11562
|
+
driver?: string;
|
|
11563
|
+
host?: string;
|
|
11564
|
+
endpoint?: string;
|
|
11565
|
+
port?: number;
|
|
11566
|
+
database?: string;
|
|
11567
|
+
username?: string;
|
|
11568
|
+
password?: string;
|
|
11569
|
+
key?: string;
|
|
11570
|
+
tls: boolean;
|
|
11571
|
+
};
|
|
11572
|
+
revealed_at: string;
|
|
11573
|
+
/** UI safety timer only; the database credential itself does not expire after this interval. */
|
|
11574
|
+
hide_after_seconds: number;
|
|
11575
|
+
}
|
|
11555
11576
|
interface CreateHostingSiteRequest {
|
|
11556
11577
|
name: string;
|
|
11557
11578
|
slug: string;
|
|
@@ -11616,6 +11637,11 @@ declare class Hosting {
|
|
|
11616
11637
|
static databases<T>(title_id: string, site_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11617
11638
|
static createDatabase<T>(title_id: string, site_id: string, data: CreateHostingDatabaseRequest): AxiosPromise<Response<T>>;
|
|
11618
11639
|
static database<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>>;
|
|
11640
|
+
/**
|
|
11641
|
+
* Reveal credentials to a signed-in business billing administrator after an
|
|
11642
|
+
* exact database-name confirmation. Hosting and MCP tokens are rejected.
|
|
11643
|
+
*/
|
|
11644
|
+
static databaseCredentials<T = HostingDatabaseCredentials>(title_id: string, site_id: string, database_id: string, confirmation: string): AxiosPromise<Response<T>>;
|
|
11619
11645
|
static updateDatabase<T>(title_id: string, site_id: string, database_id: string, data: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11620
11646
|
static retryDatabase<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>>;
|
|
11621
11647
|
static deleteDatabase<T>(title_id: string, site_id: string, database_id: string, confirmation: string): AxiosPromise<Response<T>>;
|
package/package.json
CHANGED
package/src/api/Hosting.ts
CHANGED
|
@@ -78,6 +78,28 @@ export interface HostingDatabase {
|
|
|
78
78
|
last_error?: string | null;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
export interface HostingDatabaseCredentials {
|
|
82
|
+
database_id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
engine: HostingDatabaseEngine;
|
|
85
|
+
binding_name: string;
|
|
86
|
+
connection_string: string;
|
|
87
|
+
connection: {
|
|
88
|
+
driver?: string;
|
|
89
|
+
host?: string;
|
|
90
|
+
endpoint?: string;
|
|
91
|
+
port?: number;
|
|
92
|
+
database?: string;
|
|
93
|
+
username?: string;
|
|
94
|
+
password?: string;
|
|
95
|
+
key?: string;
|
|
96
|
+
tls: boolean;
|
|
97
|
+
};
|
|
98
|
+
revealed_at: string;
|
|
99
|
+
/** UI safety timer only; the database credential itself does not expire after this interval. */
|
|
100
|
+
hide_after_seconds: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
81
103
|
export interface HostingSite {
|
|
82
104
|
id: string;
|
|
83
105
|
hosting_account_id: string;
|
|
@@ -142,8 +164,6 @@ export interface HostingMarketplaceSubscription {
|
|
|
142
164
|
export interface HostingAwsMarketplaceSubscription {
|
|
143
165
|
id: string;
|
|
144
166
|
customer_aws_account_id?: string | null;
|
|
145
|
-
license_arn: string;
|
|
146
|
-
product_code: string;
|
|
147
167
|
plan_dimension?: string | null;
|
|
148
168
|
plan_key?: Exclude<HostingPlanKey, 'free'> | null;
|
|
149
169
|
status: 'PendingRegistration' | 'PendingEntitlement' | 'Subscribed' | 'Unsubscribed';
|
|
@@ -300,6 +320,14 @@ class Hosting {
|
|
|
300
320
|
return Requests.processRoute(HostingRoute.routes.database, undefined, { title_id, site_id, database_id });
|
|
301
321
|
}
|
|
302
322
|
|
|
323
|
+
/**
|
|
324
|
+
* Reveal credentials to a signed-in business billing administrator after an
|
|
325
|
+
* exact database-name confirmation. Hosting and MCP tokens are rejected.
|
|
326
|
+
*/
|
|
327
|
+
public static databaseCredentials<T = HostingDatabaseCredentials>(title_id: string, site_id: string, database_id: string, confirmation: string): AxiosPromise<Response<T>> {
|
|
328
|
+
return Requests.processRoute(HostingRoute.routes.databaseCredentials, { confirmation }, { title_id, site_id, database_id });
|
|
329
|
+
}
|
|
330
|
+
|
|
303
331
|
public static updateDatabase<T>(title_id: string, site_id: string, database_id: string, data: Record<string, any>): AxiosPromise<Response<T>> {
|
|
304
332
|
return Requests.processRoute(HostingRoute.routes.updateDatabase, data, { title_id, site_id, database_id });
|
|
305
333
|
}
|
|
@@ -32,6 +32,7 @@ class HostingRoute {
|
|
|
32
32
|
databases: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases', method: HTTP_METHODS.GET },
|
|
33
33
|
createDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases', method: HTTP_METHODS.POST },
|
|
34
34
|
database: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.GET },
|
|
35
|
+
databaseCredentials: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}/credentials', method: HTTP_METHODS.POST },
|
|
35
36
|
updateDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.PUT },
|
|
36
37
|
retryDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}/retry', method: HTTP_METHODS.POST },
|
|
37
38
|
deleteDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.DELETE },
|