skapi-js 2.0.0 → 2.0.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.
- package/dist/skapi.browser.mjs +6 -6
- package/dist/skapi.browser.mjs.map +1 -1
- package/dist/skapi.cjs +6 -6
- package/dist/skapi.cjs.map +1 -1
- package/dist/skapi.d.mts +71 -10
- package/dist/skapi.d.ts +71 -10
- package/dist/skapi.js +6 -6
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.mjs +6 -6
- package/dist/skapi.mjs.map +1 -1
- package/package.json +2 -2
package/dist/skapi.d.mts
CHANGED
|
@@ -280,6 +280,29 @@ type Newsletter = {
|
|
|
280
280
|
url: string;
|
|
281
281
|
/** Number users delivered */
|
|
282
282
|
delivered: number;
|
|
283
|
+
/**
|
|
284
|
+
* Newsletter group the message was sent to.<br>
|
|
285
|
+
* A number for the 0 ~ 99 groups, the group name for a named newsletter group.
|
|
286
|
+
*/
|
|
287
|
+
group: number | string;
|
|
288
|
+
};
|
|
289
|
+
type NewsletterGroup = {
|
|
290
|
+
/** Name of the newsletter group. */
|
|
291
|
+
group: string;
|
|
292
|
+
/**
|
|
293
|
+
* Access group required to subscribe to the group and to read its sent mail.<br>
|
|
294
|
+
* 0 is anyone, 1 is any signed in user, 2 ~ 99 is that access group.
|
|
295
|
+
*/
|
|
296
|
+
restriction: number;
|
|
297
|
+
/** Display label of the group. Empty string when none was set. */
|
|
298
|
+
name: string;
|
|
299
|
+
/** Number of subscribers of the group. */
|
|
300
|
+
subscribers: number;
|
|
301
|
+
/**
|
|
302
|
+
* E-Mail address a newsletter for this group is sent to.<br>
|
|
303
|
+
* Empty string when the service has no sender e-mail set.
|
|
304
|
+
*/
|
|
305
|
+
endpoint: string;
|
|
283
306
|
};
|
|
284
307
|
type UserAttributes = {
|
|
285
308
|
/** User's name */
|
|
@@ -648,6 +671,7 @@ type Types_Form<T> = Form<T>;
|
|
|
648
671
|
type Types_GetRecordQuery = GetRecordQuery;
|
|
649
672
|
type Types_Index = Index;
|
|
650
673
|
type Types_Newsletter = Newsletter;
|
|
674
|
+
type Types_NewsletterGroup = NewsletterGroup;
|
|
651
675
|
type Types_PostRecordConfig = PostRecordConfig;
|
|
652
676
|
type Types_ProgressCallback = ProgressCallback;
|
|
653
677
|
type Types_RTCConnector = RTCConnector;
|
|
@@ -668,7 +692,7 @@ type Types_UserProfile = UserProfile;
|
|
|
668
692
|
type Types_UserPublic = UserPublic;
|
|
669
693
|
type Types_WebSocketMessage = WebSocketMessage;
|
|
670
694
|
declare namespace Types {
|
|
671
|
-
export type { Types_BinaryFile as BinaryFile, Types_Condition as Condition, Types_Connection as Connection, Types_ConnectionInfo as ConnectionInfo, Types_DatabaseResponse as DatabaseResponse, Types_DelRecordQuery as DelRecordQuery, Types_EncryptionOptions as EncryptionOptions, Types_FetchOptions as FetchOptions, Types_FileInfo as FileInfo, Types_Form as Form, Types_GetRecordQuery as GetRecordQuery, Types_Index as Index, Types_Newsletter as Newsletter, Types_PostRecordConfig as PostRecordConfig, Types_ProgressCallback as ProgressCallback, Types_RTCConnector as RTCConnector, Types_RTCConnectorParams as RTCConnectorParams, Types_RTCEvent as RTCEvent, Types_RTCReceiverParams as RTCReceiverParams, Types_RTCResolved as RTCResolved, Types_RealtimeCallback as RealtimeCallback, Types_RecordData as RecordData, Types_RecordEncryptionInfo as RecordEncryptionInfo, Types_RequestHistory as RequestHistory, Types_Subscription as Subscription, Types_Table as Table, Types_Tag as Tag, Types_UniqueId as UniqueId, Types_UserAttributes as UserAttributes, Types_UserProfile as UserProfile, Types_UserPublic as UserPublic, Types_WebSocketMessage as WebSocketMessage };
|
|
695
|
+
export type { Types_BinaryFile as BinaryFile, Types_Condition as Condition, Types_Connection as Connection, Types_ConnectionInfo as ConnectionInfo, Types_DatabaseResponse as DatabaseResponse, Types_DelRecordQuery as DelRecordQuery, Types_EncryptionOptions as EncryptionOptions, Types_FetchOptions as FetchOptions, Types_FileInfo as FileInfo, Types_Form as Form, Types_GetRecordQuery as GetRecordQuery, Types_Index as Index, Types_Newsletter as Newsletter, Types_NewsletterGroup as NewsletterGroup, Types_PostRecordConfig as PostRecordConfig, Types_ProgressCallback as ProgressCallback, Types_RTCConnector as RTCConnector, Types_RTCConnectorParams as RTCConnectorParams, Types_RTCEvent as RTCEvent, Types_RTCReceiverParams as RTCReceiverParams, Types_RTCResolved as RTCResolved, Types_RealtimeCallback as RealtimeCallback, Types_RecordData as RecordData, Types_RecordEncryptionInfo as RecordEncryptionInfo, Types_RequestHistory as RequestHistory, Types_Subscription as Subscription, Types_Table as Table, Types_Tag as Tag, Types_UniqueId as UniqueId, Types_UserAttributes as UserAttributes, Types_UserProfile as UserProfile, Types_UserPublic as UserPublic, Types_WebSocketMessage as WebSocketMessage };
|
|
672
696
|
}
|
|
673
697
|
|
|
674
698
|
declare function terminatePendingRequests(): void;
|
|
@@ -985,6 +1009,28 @@ declare class Skapi {
|
|
|
985
1009
|
accessToken?: string;
|
|
986
1010
|
refreshToken?: string;
|
|
987
1011
|
}): Promise<UserProfile>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Registers a named newsletter group. Service owner only.
|
|
1014
|
+
* @param params Request parameters.
|
|
1015
|
+
* @returns A promise that resolves to Promise<'SUCCESS: Group registered successfully.'>.
|
|
1016
|
+
*/
|
|
1017
|
+
registerNewsletterGroup(params: Form<{
|
|
1018
|
+
/** Name of the newsletter group. 2 ~ 20 lowercase alphanumeric characters, at least one letter, not a reserved name. */
|
|
1019
|
+
group: string;
|
|
1020
|
+
/** Access group required to subscribe. 0 ~ 99. Defaults to 0. */
|
|
1021
|
+
restriction?: number;
|
|
1022
|
+
/** Display label of the group. 60 characters max. */
|
|
1023
|
+
name?: string;
|
|
1024
|
+
}>): Promise<'SUCCESS: Group registered successfully.'>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Deletes a named newsletter group along with every subscription of that group. Service owner only.
|
|
1027
|
+
* @param params Request parameters.
|
|
1028
|
+
* @returns A promise that resolves to Promise<string>, 'SUCCESS: Group has been deleted along with N subscription(s).'.
|
|
1029
|
+
*/
|
|
1030
|
+
deleteNewsletterGroup(params: Form<{
|
|
1031
|
+
/** Name of the newsletter group to delete. */
|
|
1032
|
+
group: string;
|
|
1033
|
+
}>): Promise<string>;
|
|
988
1034
|
/**
|
|
989
1035
|
* Sends a secure outbound request using a Skapi client secret key.
|
|
990
1036
|
* @param params Request parameters.
|
|
@@ -1309,6 +1355,13 @@ declare class Skapi {
|
|
|
1309
1355
|
group: string;
|
|
1310
1356
|
number_of_users: number;
|
|
1311
1357
|
}>>;
|
|
1358
|
+
/**
|
|
1359
|
+
* Lists every named newsletter group of the service with its restriction, subscriber count and sending address. Service owner only.
|
|
1360
|
+
* @returns A promise that resolves to Promise<{ groups: NewsletterGroup[] }>.
|
|
1361
|
+
*/
|
|
1362
|
+
newsletterGroupEndpoint(): Promise<{
|
|
1363
|
+
groups: NewsletterGroup[];
|
|
1364
|
+
}>;
|
|
1312
1365
|
/**
|
|
1313
1366
|
* Sends realtime data to a user or group with optional push notification metadata.
|
|
1314
1367
|
* @param message Message payload to send.
|
|
@@ -1520,11 +1573,13 @@ declare class Skapi {
|
|
|
1520
1573
|
}): Promise<string | UserProfile>;
|
|
1521
1574
|
/**
|
|
1522
1575
|
* Unsubscribes the user from a newsletter group.
|
|
1576
|
+
* Takes a numeric group, "public", "authorized" or the name of a named newsletter group. null unsubscribes from every group.
|
|
1523
1577
|
* @param params Request parameters.
|
|
1524
1578
|
* @returns A promise that resolves to Promise<string>.
|
|
1525
1579
|
*/
|
|
1526
1580
|
unsubscribeNewsletter(params: {
|
|
1527
|
-
|
|
1581
|
+
/** Numeric group, "public", "authorized" or a named newsletter group. null unsubscribes from every group. */
|
|
1582
|
+
group: number | 'public' | 'authorized' | (string & {}) | null;
|
|
1528
1583
|
}): Promise<string>;
|
|
1529
1584
|
/**
|
|
1530
1585
|
* Registers a web push subscription endpoint for notifications.
|
|
@@ -1565,6 +1620,7 @@ declare class Skapi {
|
|
|
1565
1620
|
}, user_ids?: string | string[]): Promise<'SUCCESS: Notification sent.'>;
|
|
1566
1621
|
/**
|
|
1567
1622
|
* Fetches newsletter delivery records with filters and pagination.
|
|
1623
|
+
* Reads a numeric group, "public", "authorized" or a named newsletter group. A named group is readable by anyone its restriction allows, signed in or not.
|
|
1568
1624
|
* @param params Request parameters.
|
|
1569
1625
|
* @param fetchOptions Pagination and fetch behavior options.
|
|
1570
1626
|
* @returns A promise that resolves to Promise<DatabaseResponse<Newsletter>>.
|
|
@@ -1583,26 +1639,29 @@ declare class Skapi {
|
|
|
1583
1639
|
* Condition does not work with range.
|
|
1584
1640
|
*/
|
|
1585
1641
|
condition?: '>' | '>=' | '=' | '<' | '<=' | 'gt' | 'gte' | 'eq' | 'lt' | 'lte';
|
|
1586
|
-
group
|
|
1642
|
+
/** Numeric group, "public", "authorized" or a named newsletter group. */
|
|
1643
|
+
group: 'public' | 'authorized' | number | (string & {});
|
|
1587
1644
|
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Newsletter>>;
|
|
1588
1645
|
/**
|
|
1589
1646
|
* Gets newsletter subscription status for the requested groups.
|
|
1647
|
+
* Takes a numeric group, "public", "authorized" or a named newsletter group. Omit the group for every group the user is subscribed to.
|
|
1590
1648
|
* @param params Request parameters.
|
|
1591
1649
|
* @param fetchOptions Pagination and fetch behavior options.
|
|
1592
|
-
* @returns A promise that resolves to Promise<{ active: boolean; timestamp: number; group: number; subscribed_email: string; }[]>.
|
|
1650
|
+
* @returns A promise that resolves to Promise<{ active: boolean; timestamp: number; group: number | string; subscribed_email: string; }[]>.
|
|
1593
1651
|
*/
|
|
1594
|
-
getNewsletterSubscription(params
|
|
1595
|
-
|
|
1652
|
+
getNewsletterSubscription(params?: {
|
|
1653
|
+
/** Numeric group, "public", "authorized" or a named newsletter group. Omit or null for every group. */
|
|
1654
|
+
group?: number | 'public' | 'authorized' | (string & {}) | null;
|
|
1596
1655
|
user_id?: string;
|
|
1597
1656
|
}, fetchOptions?: FetchOptions): Promise<{
|
|
1598
1657
|
active: boolean;
|
|
1599
1658
|
timestamp: number;
|
|
1600
|
-
group: number;
|
|
1659
|
+
group: number | string;
|
|
1601
1660
|
subscribed_email: string;
|
|
1602
1661
|
}[] | DatabaseResponse<{
|
|
1603
1662
|
active: boolean;
|
|
1604
1663
|
timestamp: number;
|
|
1605
|
-
group: number;
|
|
1664
|
+
group: number | string;
|
|
1606
1665
|
subscribed_email: string;
|
|
1607
1666
|
}>>;
|
|
1608
1667
|
/**
|
|
@@ -1980,12 +2039,14 @@ declare class Skapi {
|
|
|
1980
2039
|
}): Promise<'SUCCESS: Unblocked user ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'>;
|
|
1981
2040
|
/**
|
|
1982
2041
|
* Subscribes an email/user to a newsletter group with optional redirect flow.
|
|
2042
|
+
* Takes a numeric group, "public", "authorized" or the name of a named newsletter group registered with registerNewsletterGroup().
|
|
1983
2043
|
* @param params Request parameters.
|
|
1984
2044
|
* @returns A promise that resolves to Promise<string>.
|
|
1985
2045
|
*/
|
|
1986
2046
|
subscribeNewsletter(params: Form<{
|
|
1987
2047
|
email?: string | string[];
|
|
1988
|
-
|
|
2048
|
+
/** Numeric group, "public", "authorized" or a named newsletter group. */
|
|
2049
|
+
group: number | 'public' | 'authorized' | (string & {});
|
|
1989
2050
|
redirect?: string;
|
|
1990
2051
|
}>): Promise<string>;
|
|
1991
2052
|
/**
|
|
@@ -2006,4 +2067,4 @@ declare class SkapiError extends Error {
|
|
|
2006
2067
|
});
|
|
2007
2068
|
}
|
|
2008
2069
|
|
|
2009
|
-
export { type BinaryFile, type Condition, type Connection, type ConnectionInfo, type DatabaseResponse, type DelRecordQuery, type FetchOptions, type FileInfo, type Form, type GetRecordQuery, type Index, type Newsletter, type PostRecordConfig, type ProgressCallback, type RTCConnector, type RTCConnectorParams, type RTCEvent, type RTCReceiverParams, type RTCResolved, type RealtimeCallback, type RecordData, Skapi, SkapiError, type Subscription, type Table, type Tag, Types, type UniqueId, type UserAttributes, type UserProfile, type UserPublic, type WebSocketMessage };
|
|
2070
|
+
export { type BinaryFile, type Condition, type Connection, type ConnectionInfo, type DatabaseResponse, type DelRecordQuery, type FetchOptions, type FileInfo, type Form, type GetRecordQuery, type Index, type Newsletter, type NewsletterGroup, type PostRecordConfig, type ProgressCallback, type RTCConnector, type RTCConnectorParams, type RTCEvent, type RTCReceiverParams, type RTCResolved, type RealtimeCallback, type RecordData, Skapi, SkapiError, type Subscription, type Table, type Tag, Types, type UniqueId, type UserAttributes, type UserProfile, type UserPublic, type WebSocketMessage };
|
package/dist/skapi.d.ts
CHANGED
|
@@ -280,6 +280,29 @@ type Newsletter = {
|
|
|
280
280
|
url: string;
|
|
281
281
|
/** Number users delivered */
|
|
282
282
|
delivered: number;
|
|
283
|
+
/**
|
|
284
|
+
* Newsletter group the message was sent to.<br>
|
|
285
|
+
* A number for the 0 ~ 99 groups, the group name for a named newsletter group.
|
|
286
|
+
*/
|
|
287
|
+
group: number | string;
|
|
288
|
+
};
|
|
289
|
+
type NewsletterGroup = {
|
|
290
|
+
/** Name of the newsletter group. */
|
|
291
|
+
group: string;
|
|
292
|
+
/**
|
|
293
|
+
* Access group required to subscribe to the group and to read its sent mail.<br>
|
|
294
|
+
* 0 is anyone, 1 is any signed in user, 2 ~ 99 is that access group.
|
|
295
|
+
*/
|
|
296
|
+
restriction: number;
|
|
297
|
+
/** Display label of the group. Empty string when none was set. */
|
|
298
|
+
name: string;
|
|
299
|
+
/** Number of subscribers of the group. */
|
|
300
|
+
subscribers: number;
|
|
301
|
+
/**
|
|
302
|
+
* E-Mail address a newsletter for this group is sent to.<br>
|
|
303
|
+
* Empty string when the service has no sender e-mail set.
|
|
304
|
+
*/
|
|
305
|
+
endpoint: string;
|
|
283
306
|
};
|
|
284
307
|
type UserAttributes = {
|
|
285
308
|
/** User's name */
|
|
@@ -648,6 +671,7 @@ type Types_Form<T> = Form<T>;
|
|
|
648
671
|
type Types_GetRecordQuery = GetRecordQuery;
|
|
649
672
|
type Types_Index = Index;
|
|
650
673
|
type Types_Newsletter = Newsletter;
|
|
674
|
+
type Types_NewsletterGroup = NewsletterGroup;
|
|
651
675
|
type Types_PostRecordConfig = PostRecordConfig;
|
|
652
676
|
type Types_ProgressCallback = ProgressCallback;
|
|
653
677
|
type Types_RTCConnector = RTCConnector;
|
|
@@ -668,7 +692,7 @@ type Types_UserProfile = UserProfile;
|
|
|
668
692
|
type Types_UserPublic = UserPublic;
|
|
669
693
|
type Types_WebSocketMessage = WebSocketMessage;
|
|
670
694
|
declare namespace Types {
|
|
671
|
-
export type { Types_BinaryFile as BinaryFile, Types_Condition as Condition, Types_Connection as Connection, Types_ConnectionInfo as ConnectionInfo, Types_DatabaseResponse as DatabaseResponse, Types_DelRecordQuery as DelRecordQuery, Types_EncryptionOptions as EncryptionOptions, Types_FetchOptions as FetchOptions, Types_FileInfo as FileInfo, Types_Form as Form, Types_GetRecordQuery as GetRecordQuery, Types_Index as Index, Types_Newsletter as Newsletter, Types_PostRecordConfig as PostRecordConfig, Types_ProgressCallback as ProgressCallback, Types_RTCConnector as RTCConnector, Types_RTCConnectorParams as RTCConnectorParams, Types_RTCEvent as RTCEvent, Types_RTCReceiverParams as RTCReceiverParams, Types_RTCResolved as RTCResolved, Types_RealtimeCallback as RealtimeCallback, Types_RecordData as RecordData, Types_RecordEncryptionInfo as RecordEncryptionInfo, Types_RequestHistory as RequestHistory, Types_Subscription as Subscription, Types_Table as Table, Types_Tag as Tag, Types_UniqueId as UniqueId, Types_UserAttributes as UserAttributes, Types_UserProfile as UserProfile, Types_UserPublic as UserPublic, Types_WebSocketMessage as WebSocketMessage };
|
|
695
|
+
export type { Types_BinaryFile as BinaryFile, Types_Condition as Condition, Types_Connection as Connection, Types_ConnectionInfo as ConnectionInfo, Types_DatabaseResponse as DatabaseResponse, Types_DelRecordQuery as DelRecordQuery, Types_EncryptionOptions as EncryptionOptions, Types_FetchOptions as FetchOptions, Types_FileInfo as FileInfo, Types_Form as Form, Types_GetRecordQuery as GetRecordQuery, Types_Index as Index, Types_Newsletter as Newsletter, Types_NewsletterGroup as NewsletterGroup, Types_PostRecordConfig as PostRecordConfig, Types_ProgressCallback as ProgressCallback, Types_RTCConnector as RTCConnector, Types_RTCConnectorParams as RTCConnectorParams, Types_RTCEvent as RTCEvent, Types_RTCReceiverParams as RTCReceiverParams, Types_RTCResolved as RTCResolved, Types_RealtimeCallback as RealtimeCallback, Types_RecordData as RecordData, Types_RecordEncryptionInfo as RecordEncryptionInfo, Types_RequestHistory as RequestHistory, Types_Subscription as Subscription, Types_Table as Table, Types_Tag as Tag, Types_UniqueId as UniqueId, Types_UserAttributes as UserAttributes, Types_UserProfile as UserProfile, Types_UserPublic as UserPublic, Types_WebSocketMessage as WebSocketMessage };
|
|
672
696
|
}
|
|
673
697
|
|
|
674
698
|
declare function terminatePendingRequests(): void;
|
|
@@ -985,6 +1009,28 @@ declare class Skapi {
|
|
|
985
1009
|
accessToken?: string;
|
|
986
1010
|
refreshToken?: string;
|
|
987
1011
|
}): Promise<UserProfile>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Registers a named newsletter group. Service owner only.
|
|
1014
|
+
* @param params Request parameters.
|
|
1015
|
+
* @returns A promise that resolves to Promise<'SUCCESS: Group registered successfully.'>.
|
|
1016
|
+
*/
|
|
1017
|
+
registerNewsletterGroup(params: Form<{
|
|
1018
|
+
/** Name of the newsletter group. 2 ~ 20 lowercase alphanumeric characters, at least one letter, not a reserved name. */
|
|
1019
|
+
group: string;
|
|
1020
|
+
/** Access group required to subscribe. 0 ~ 99. Defaults to 0. */
|
|
1021
|
+
restriction?: number;
|
|
1022
|
+
/** Display label of the group. 60 characters max. */
|
|
1023
|
+
name?: string;
|
|
1024
|
+
}>): Promise<'SUCCESS: Group registered successfully.'>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Deletes a named newsletter group along with every subscription of that group. Service owner only.
|
|
1027
|
+
* @param params Request parameters.
|
|
1028
|
+
* @returns A promise that resolves to Promise<string>, 'SUCCESS: Group has been deleted along with N subscription(s).'.
|
|
1029
|
+
*/
|
|
1030
|
+
deleteNewsletterGroup(params: Form<{
|
|
1031
|
+
/** Name of the newsletter group to delete. */
|
|
1032
|
+
group: string;
|
|
1033
|
+
}>): Promise<string>;
|
|
988
1034
|
/**
|
|
989
1035
|
* Sends a secure outbound request using a Skapi client secret key.
|
|
990
1036
|
* @param params Request parameters.
|
|
@@ -1309,6 +1355,13 @@ declare class Skapi {
|
|
|
1309
1355
|
group: string;
|
|
1310
1356
|
number_of_users: number;
|
|
1311
1357
|
}>>;
|
|
1358
|
+
/**
|
|
1359
|
+
* Lists every named newsletter group of the service with its restriction, subscriber count and sending address. Service owner only.
|
|
1360
|
+
* @returns A promise that resolves to Promise<{ groups: NewsletterGroup[] }>.
|
|
1361
|
+
*/
|
|
1362
|
+
newsletterGroupEndpoint(): Promise<{
|
|
1363
|
+
groups: NewsletterGroup[];
|
|
1364
|
+
}>;
|
|
1312
1365
|
/**
|
|
1313
1366
|
* Sends realtime data to a user or group with optional push notification metadata.
|
|
1314
1367
|
* @param message Message payload to send.
|
|
@@ -1520,11 +1573,13 @@ declare class Skapi {
|
|
|
1520
1573
|
}): Promise<string | UserProfile>;
|
|
1521
1574
|
/**
|
|
1522
1575
|
* Unsubscribes the user from a newsletter group.
|
|
1576
|
+
* Takes a numeric group, "public", "authorized" or the name of a named newsletter group. null unsubscribes from every group.
|
|
1523
1577
|
* @param params Request parameters.
|
|
1524
1578
|
* @returns A promise that resolves to Promise<string>.
|
|
1525
1579
|
*/
|
|
1526
1580
|
unsubscribeNewsletter(params: {
|
|
1527
|
-
|
|
1581
|
+
/** Numeric group, "public", "authorized" or a named newsletter group. null unsubscribes from every group. */
|
|
1582
|
+
group: number | 'public' | 'authorized' | (string & {}) | null;
|
|
1528
1583
|
}): Promise<string>;
|
|
1529
1584
|
/**
|
|
1530
1585
|
* Registers a web push subscription endpoint for notifications.
|
|
@@ -1565,6 +1620,7 @@ declare class Skapi {
|
|
|
1565
1620
|
}, user_ids?: string | string[]): Promise<'SUCCESS: Notification sent.'>;
|
|
1566
1621
|
/**
|
|
1567
1622
|
* Fetches newsletter delivery records with filters and pagination.
|
|
1623
|
+
* Reads a numeric group, "public", "authorized" or a named newsletter group. A named group is readable by anyone its restriction allows, signed in or not.
|
|
1568
1624
|
* @param params Request parameters.
|
|
1569
1625
|
* @param fetchOptions Pagination and fetch behavior options.
|
|
1570
1626
|
* @returns A promise that resolves to Promise<DatabaseResponse<Newsletter>>.
|
|
@@ -1583,26 +1639,29 @@ declare class Skapi {
|
|
|
1583
1639
|
* Condition does not work with range.
|
|
1584
1640
|
*/
|
|
1585
1641
|
condition?: '>' | '>=' | '=' | '<' | '<=' | 'gt' | 'gte' | 'eq' | 'lt' | 'lte';
|
|
1586
|
-
group
|
|
1642
|
+
/** Numeric group, "public", "authorized" or a named newsletter group. */
|
|
1643
|
+
group: 'public' | 'authorized' | number | (string & {});
|
|
1587
1644
|
}, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Newsletter>>;
|
|
1588
1645
|
/**
|
|
1589
1646
|
* Gets newsletter subscription status for the requested groups.
|
|
1647
|
+
* Takes a numeric group, "public", "authorized" or a named newsletter group. Omit the group for every group the user is subscribed to.
|
|
1590
1648
|
* @param params Request parameters.
|
|
1591
1649
|
* @param fetchOptions Pagination and fetch behavior options.
|
|
1592
|
-
* @returns A promise that resolves to Promise<{ active: boolean; timestamp: number; group: number; subscribed_email: string; }[]>.
|
|
1650
|
+
* @returns A promise that resolves to Promise<{ active: boolean; timestamp: number; group: number | string; subscribed_email: string; }[]>.
|
|
1593
1651
|
*/
|
|
1594
|
-
getNewsletterSubscription(params
|
|
1595
|
-
|
|
1652
|
+
getNewsletterSubscription(params?: {
|
|
1653
|
+
/** Numeric group, "public", "authorized" or a named newsletter group. Omit or null for every group. */
|
|
1654
|
+
group?: number | 'public' | 'authorized' | (string & {}) | null;
|
|
1596
1655
|
user_id?: string;
|
|
1597
1656
|
}, fetchOptions?: FetchOptions): Promise<{
|
|
1598
1657
|
active: boolean;
|
|
1599
1658
|
timestamp: number;
|
|
1600
|
-
group: number;
|
|
1659
|
+
group: number | string;
|
|
1601
1660
|
subscribed_email: string;
|
|
1602
1661
|
}[] | DatabaseResponse<{
|
|
1603
1662
|
active: boolean;
|
|
1604
1663
|
timestamp: number;
|
|
1605
|
-
group: number;
|
|
1664
|
+
group: number | string;
|
|
1606
1665
|
subscribed_email: string;
|
|
1607
1666
|
}>>;
|
|
1608
1667
|
/**
|
|
@@ -1980,12 +2039,14 @@ declare class Skapi {
|
|
|
1980
2039
|
}): Promise<'SUCCESS: Unblocked user ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'>;
|
|
1981
2040
|
/**
|
|
1982
2041
|
* Subscribes an email/user to a newsletter group with optional redirect flow.
|
|
2042
|
+
* Takes a numeric group, "public", "authorized" or the name of a named newsletter group registered with registerNewsletterGroup().
|
|
1983
2043
|
* @param params Request parameters.
|
|
1984
2044
|
* @returns A promise that resolves to Promise<string>.
|
|
1985
2045
|
*/
|
|
1986
2046
|
subscribeNewsletter(params: Form<{
|
|
1987
2047
|
email?: string | string[];
|
|
1988
|
-
|
|
2048
|
+
/** Numeric group, "public", "authorized" or a named newsletter group. */
|
|
2049
|
+
group: number | 'public' | 'authorized' | (string & {});
|
|
1989
2050
|
redirect?: string;
|
|
1990
2051
|
}>): Promise<string>;
|
|
1991
2052
|
/**
|
|
@@ -2006,4 +2067,4 @@ declare class SkapiError extends Error {
|
|
|
2006
2067
|
});
|
|
2007
2068
|
}
|
|
2008
2069
|
|
|
2009
|
-
export { type BinaryFile, type Condition, type Connection, type ConnectionInfo, type DatabaseResponse, type DelRecordQuery, type FetchOptions, type FileInfo, type Form, type GetRecordQuery, type Index, type Newsletter, type PostRecordConfig, type ProgressCallback, type RTCConnector, type RTCConnectorParams, type RTCEvent, type RTCReceiverParams, type RTCResolved, type RealtimeCallback, type RecordData, Skapi, SkapiError, type Subscription, type Table, type Tag, Types, type UniqueId, type UserAttributes, type UserProfile, type UserPublic, type WebSocketMessage };
|
|
2070
|
+
export { type BinaryFile, type Condition, type Connection, type ConnectionInfo, type DatabaseResponse, type DelRecordQuery, type FetchOptions, type FileInfo, type Form, type GetRecordQuery, type Index, type Newsletter, type NewsletterGroup, type PostRecordConfig, type ProgressCallback, type RTCConnector, type RTCConnectorParams, type RTCEvent, type RTCReceiverParams, type RTCResolved, type RealtimeCallback, type RecordData, Skapi, SkapiError, type Subscription, type Table, type Tag, Types, type UniqueId, type UserAttributes, type UserProfile, type UserPublic, type WebSocketMessage };
|