glitch-javascript-sdk 3.8.5 → 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/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
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.8.5",
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/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
  *
@@ -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 },