glitch-javascript-sdk 3.8.4 → 3.8.6
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/cjs/index.js +18 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Scheduler.d.ts +9 -1
- package/dist/esm/api/Users.d.ts +39 -0
- package/dist/esm/index.js +18 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +48 -1
- package/package.json +2 -2
- package/src/api/Scheduler.ts +10 -1
- package/src/api/Users.ts +50 -0
- package/src/routes/UserRoutes.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1937,6 +1937,35 @@ interface InfluencerPayoutQuery {
|
|
|
1937
1937
|
orderBy?: "created_at" | "amount";
|
|
1938
1938
|
orderDirection?: "asc" | "desc";
|
|
1939
1939
|
}
|
|
1940
|
+
/** Delivery state for the authenticated user's registered email address. */
|
|
1941
|
+
type EmailDeliveryState = "healthy" | "suppressed";
|
|
1942
|
+
/** Recovery action selected by the API for the current suppression category. */
|
|
1943
|
+
type EmailDeliveryRecoveryAction = "none" | "self_service" | "change_email" | "contact_support";
|
|
1944
|
+
/** Self-service and fallback actions available for an email-delivery state. */
|
|
1945
|
+
interface EmailDeliveryRecovery {
|
|
1946
|
+
allowed: boolean;
|
|
1947
|
+
action: EmailDeliveryRecoveryAction;
|
|
1948
|
+
requires_acknowledgement: boolean;
|
|
1949
|
+
account_verified?: boolean;
|
|
1950
|
+
change_email_path?: string;
|
|
1951
|
+
support_path?: string;
|
|
1952
|
+
}
|
|
1953
|
+
/** Current delivery state for the authenticated user's registered email. */
|
|
1954
|
+
interface EmailDeliveryStatus {
|
|
1955
|
+
state: EmailDeliveryState;
|
|
1956
|
+
action_required: boolean;
|
|
1957
|
+
email: string | null;
|
|
1958
|
+
category: string | null;
|
|
1959
|
+
provider: string | null;
|
|
1960
|
+
suppressed_at: string | null;
|
|
1961
|
+
display_reason: string | null;
|
|
1962
|
+
recovery: EmailDeliveryRecovery;
|
|
1963
|
+
restored_now?: boolean;
|
|
1964
|
+
}
|
|
1965
|
+
/** Explicit confirmation required to remove an eligible active suppression. */
|
|
1966
|
+
interface RestoreEmailDeliveryRequest {
|
|
1967
|
+
acknowledged: true;
|
|
1968
|
+
}
|
|
1940
1969
|
declare class Users {
|
|
1941
1970
|
/**
|
|
1942
1971
|
* List all the users.
|
|
@@ -1967,6 +1996,16 @@ declare class Users {
|
|
|
1967
1996
|
* @returns promise
|
|
1968
1997
|
*/
|
|
1969
1998
|
static me<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1999
|
+
/**
|
|
2000
|
+
* Gets the delivery and suppression state for the authenticated user's
|
|
2001
|
+
* current registered email address.
|
|
2002
|
+
*/
|
|
2003
|
+
static emailDeliveryStatus(): AxiosPromise<Response<EmailDeliveryStatus>>;
|
|
2004
|
+
/**
|
|
2005
|
+
* Removes an eligible active suppression for the authenticated user's
|
|
2006
|
+
* current verified email address.
|
|
2007
|
+
*/
|
|
2008
|
+
static restoreEmailDelivery(data: RestoreEmailDeliveryRequest): AxiosPromise<Response<EmailDeliveryStatus>>;
|
|
1970
2009
|
/**
|
|
1971
2010
|
* Gets the campaigns the users has been invited too.
|
|
1972
2011
|
*
|
|
@@ -7046,8 +7085,11 @@ interface DiscordMediaImportGroup {
|
|
|
7046
7085
|
message_id: string;
|
|
7047
7086
|
attachment_ids: string[];
|
|
7048
7087
|
}
|
|
7088
|
+
type DiscordTitleUpdateMode = 'grouped' | 'separate';
|
|
7049
7089
|
interface DiscordMediaImportRequest {
|
|
7050
7090
|
groups: DiscordMediaImportGroup[];
|
|
7091
|
+
/** Group files by Discord message or create one pending Library item per file. */
|
|
7092
|
+
title_update_mode?: DiscordTitleUpdateMode;
|
|
7051
7093
|
}
|
|
7052
7094
|
interface DiscordMediaImportAttachmentResult {
|
|
7053
7095
|
status: 'imported' | 'duplicate' | 'failed';
|
|
@@ -7078,6 +7120,8 @@ interface DiscordUserCommandStatus {
|
|
|
7078
7120
|
destination_scheduler_id?: string | null;
|
|
7079
7121
|
destination_scheduler_name?: string | null;
|
|
7080
7122
|
installed_at?: string | null;
|
|
7123
|
+
destination_count?: number;
|
|
7124
|
+
linked_account_count?: number;
|
|
7081
7125
|
pending_count: number;
|
|
7082
7126
|
command_name: string;
|
|
7083
7127
|
setup_path: string;
|
|
@@ -7138,6 +7182,8 @@ interface DiscordMediaCaptureListResponse {
|
|
|
7138
7182
|
interface DiscordMediaCaptureImportRequest {
|
|
7139
7183
|
capture_id: string;
|
|
7140
7184
|
attachment_ids: string[];
|
|
7185
|
+
/** Group selected files together or create one pending Library item per file. */
|
|
7186
|
+
title_update_mode?: DiscordTitleUpdateMode;
|
|
7141
7187
|
}
|
|
7142
7188
|
declare class Scheduler {
|
|
7143
7189
|
/**
|
|
@@ -7457,7 +7503,8 @@ declare class Scheduler {
|
|
|
7457
7503
|
static searchDiscordMedia<T = DiscordMediaSearchResponse>(scheduler_id: string, params?: DiscordMediaSearchParams): AxiosPromise<Response<T>>;
|
|
7458
7504
|
/**
|
|
7459
7505
|
* Import explicitly selected Discord attachments as pending, unscheduled
|
|
7460
|
-
* Library updates.
|
|
7506
|
+
* Library updates. Callers can group files by message or create one item
|
|
7507
|
+
* per file through title_update_mode.
|
|
7461
7508
|
*/
|
|
7462
7509
|
static importDiscordMedia<T = DiscordMediaImportResponse>(scheduler_id: string, data: DiscordMediaImportRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7463
7510
|
/** Get the current user's personal Save to Glitch command setup state. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitch-javascript-sdk",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.6",
|
|
4
4
|
"description": "Javascript SDK for Glitch",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"scripts": {
|
|
16
|
-
"test": "node scripts/test-game-advertising-routes.cjs && node scripts/test-discord-media-routes.cjs",
|
|
16
|
+
"test": "node scripts/test-game-advertising-routes.cjs && node scripts/test-discord-media-routes.cjs && node scripts/test-user-email-delivery-routes.cjs",
|
|
17
17
|
"build": "rm -Rf dist && rollup -c --bundleConfigAsCjs",
|
|
18
18
|
"build-docs": "rm -rf docs && typedoc --tsconfig tsconfig.json src/"
|
|
19
19
|
},
|
package/src/api/Scheduler.ts
CHANGED
|
@@ -73,8 +73,12 @@ export interface DiscordMediaImportGroup {
|
|
|
73
73
|
attachment_ids: string[];
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
export type DiscordTitleUpdateMode = 'grouped' | 'separate';
|
|
77
|
+
|
|
76
78
|
export interface DiscordMediaImportRequest {
|
|
77
79
|
groups: DiscordMediaImportGroup[];
|
|
80
|
+
/** Group files by Discord message or create one pending Library item per file. */
|
|
81
|
+
title_update_mode?: DiscordTitleUpdateMode;
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
export interface DiscordMediaImportAttachmentResult {
|
|
@@ -108,6 +112,8 @@ export interface DiscordUserCommandStatus {
|
|
|
108
112
|
destination_scheduler_id?: string | null;
|
|
109
113
|
destination_scheduler_name?: string | null;
|
|
110
114
|
installed_at?: string | null;
|
|
115
|
+
destination_count?: number;
|
|
116
|
+
linked_account_count?: number;
|
|
111
117
|
pending_count: number;
|
|
112
118
|
command_name: string;
|
|
113
119
|
setup_path: string;
|
|
@@ -174,6 +180,8 @@ export interface DiscordMediaCaptureListResponse {
|
|
|
174
180
|
export interface DiscordMediaCaptureImportRequest {
|
|
175
181
|
capture_id: string;
|
|
176
182
|
attachment_ids: string[];
|
|
183
|
+
/** Group selected files together or create one pending Library item per file. */
|
|
184
|
+
title_update_mode?: DiscordTitleUpdateMode;
|
|
177
185
|
}
|
|
178
186
|
|
|
179
187
|
class Scheduler {
|
|
@@ -618,7 +626,8 @@ class Scheduler {
|
|
|
618
626
|
|
|
619
627
|
/**
|
|
620
628
|
* Import explicitly selected Discord attachments as pending, unscheduled
|
|
621
|
-
* Library updates.
|
|
629
|
+
* Library updates. Callers can group files by message or create one item
|
|
630
|
+
* per file through title_update_mode.
|
|
622
631
|
*/
|
|
623
632
|
public static importDiscordMedia<T = DiscordMediaImportResponse>(
|
|
624
633
|
scheduler_id: string,
|
package/src/api/Users.ts
CHANGED
|
@@ -52,6 +52,40 @@ export interface InfluencerPayoutQuery {
|
|
|
52
52
|
orderDirection?: "asc" | "desc";
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/** Delivery state for the authenticated user's registered email address. */
|
|
56
|
+
export type EmailDeliveryState = "healthy" | "suppressed";
|
|
57
|
+
|
|
58
|
+
/** Recovery action selected by the API for the current suppression category. */
|
|
59
|
+
export type EmailDeliveryRecoveryAction = "none" | "self_service" | "change_email" | "contact_support";
|
|
60
|
+
|
|
61
|
+
/** Self-service and fallback actions available for an email-delivery state. */
|
|
62
|
+
export interface EmailDeliveryRecovery {
|
|
63
|
+
allowed: boolean;
|
|
64
|
+
action: EmailDeliveryRecoveryAction;
|
|
65
|
+
requires_acknowledgement: boolean;
|
|
66
|
+
account_verified?: boolean;
|
|
67
|
+
change_email_path?: string;
|
|
68
|
+
support_path?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Current delivery state for the authenticated user's registered email. */
|
|
72
|
+
export interface EmailDeliveryStatus {
|
|
73
|
+
state: EmailDeliveryState;
|
|
74
|
+
action_required: boolean;
|
|
75
|
+
email: string | null;
|
|
76
|
+
category: string | null;
|
|
77
|
+
provider: string | null;
|
|
78
|
+
suppressed_at: string | null;
|
|
79
|
+
display_reason: string | null;
|
|
80
|
+
recovery: EmailDeliveryRecovery;
|
|
81
|
+
restored_now?: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Explicit confirmation required to remove an eligible active suppression. */
|
|
85
|
+
export interface RestoreEmailDeliveryRequest {
|
|
86
|
+
acknowledged: true;
|
|
87
|
+
}
|
|
88
|
+
|
|
55
89
|
class Users {
|
|
56
90
|
|
|
57
91
|
/**
|
|
@@ -94,6 +128,22 @@ class Users {
|
|
|
94
128
|
return Requests.processRoute(UserRoutes.routes.me, {}, undefined, params);
|
|
95
129
|
}
|
|
96
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Gets the delivery and suppression state for the authenticated user's
|
|
133
|
+
* current registered email address.
|
|
134
|
+
*/
|
|
135
|
+
public static emailDeliveryStatus(): AxiosPromise<Response<EmailDeliveryStatus>> {
|
|
136
|
+
return Requests.processRoute(UserRoutes.routes.emailDeliveryStatus);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Removes an eligible active suppression for the authenticated user's
|
|
141
|
+
* current verified email address.
|
|
142
|
+
*/
|
|
143
|
+
public static restoreEmailDelivery(data: RestoreEmailDeliveryRequest): AxiosPromise<Response<EmailDeliveryStatus>> {
|
|
144
|
+
return Requests.processRoute(UserRoutes.routes.restoreEmailDelivery, data);
|
|
145
|
+
}
|
|
146
|
+
|
|
97
147
|
/**
|
|
98
148
|
* Gets the campaigns the users has been invited too.
|
|
99
149
|
*
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -9,6 +9,8 @@ class UserRoutes {
|
|
|
9
9
|
follow: { url: '/users/{user_id}/follow', method: HTTP_METHODS.POST },
|
|
10
10
|
profile: { url: '/users/{user_id}/profile', method: HTTP_METHODS.GET },
|
|
11
11
|
me: { url: '/users/me', method: HTTP_METHODS.GET },
|
|
12
|
+
emailDeliveryStatus: { url: '/users/me/email-delivery', method: HTTP_METHODS.GET },
|
|
13
|
+
restoreEmailDelivery: { url: '/users/me/email-delivery/restore', method: HTTP_METHODS.POST },
|
|
12
14
|
syncInfluencer: { url: '/users/syncInfluencer', method: HTTP_METHODS.POST },
|
|
13
15
|
generateInfluencerProfile: { url: '/users/generateInfluencerProfile', method: HTTP_METHODS.POST },
|
|
14
16
|
oneTimeToken: { url: '/users/oneTimeToken', method: HTTP_METHODS.GET },
|