@pushwoosh/rpc-v2-http-api-data 0.2.289 → 0.2.290

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.
Files changed (3) hide show
  1. package/api_tokens.d.ts +54 -0
  2. package/data.js +95 -0
  3. package/package.json +1 -1
package/api_tokens.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { RpcMethod } from './commonTypes';
2
2
  export type ApiTokensService_Create = RpcMethod<CreateApiTokenRequest, CreateApiTokenResponse>;
3
3
  export type ApiTokensService_Get = RpcMethod<GetApiTokenRequest, GetApiTokenResponse>;
4
+ export type ApiTokensService_GetUsage = RpcMethod<GetApiTokenUsageRequest, GetApiTokenUsageResponse>;
5
+ export type ApiTokensService_GetUsageSummary = RpcMethod<GetApiTokenUsageSummaryRequest, GetApiTokenUsageSummaryResponse>;
4
6
  export type ApiTokensService_List = RpcMethod<ListApiTokensRequest, ListApiTokensResponse>;
5
7
  export type ApiTokensService_Update = RpcMethod<UpdateApiTokenRequest, UpdateApiTokenResponse>;
6
8
  export type ApiTokensService_Delete = RpcMethod<DeleteApiTokenRequest, DeleteApiTokenResponse>;
@@ -13,6 +15,10 @@ export interface ApiTokensService {
13
15
  Create: ApiTokensService_Create;
14
16
  /** Returns one API token by its token code, including type and the resolved application/group restrictions. Use after list_api_tokens to inspect a single token's scope. */
15
17
  Get: ApiTokensService_Get;
18
+ /** Returns the calls made with one API token: time, caller address, API method, application, message code and outcome. Use to answer "who sent this message and from where", including transactional sends that never reach message history. */
19
+ GetUsage: ApiTokensService_GetUsage;
20
+ /** Returns the token card summary: when and from where the token was last used, and how many calls it was refused over the last 7 and 30 days. */
21
+ GetUsageSummary: ApiTokensService_GetUsageSummary;
16
22
  /** Lists the account's API tokens with paging, ordering and optional name search. Use to browse issued tokens or find a token code before get/update/delete. */
17
23
  List: ApiTokensService_List;
18
24
  /** Updates an API token's name and/or restriction scope by token code, overwriting the stored restrictions. Use to rename a token or change which applications, groups and modify rights it carries. */
@@ -191,3 +197,51 @@ export type GrantDeviceDataModificationRightAllRequest = {
191
197
  selectAll?: boolean;
192
198
  };
193
199
  export type GrantDeviceDataModificationRightAllResponse = {};
200
+ /** One recorded call made with an API token. */
201
+ export type ApiTokenUsage = {
202
+ /** When the call happened. */
203
+ timestamp: Date;
204
+ /** Address the call came from, as our edge resolved it. */
205
+ clientIp: string;
206
+ /** API method that was called, e.g. /json/1.3/createMessage. */
207
+ method: string;
208
+ /** Application the call touched, empty when the method is not application-scoped. */
209
+ applicationCode: string;
210
+ /** Public message code of the send; the key to find transactional sends, which have no message id. */
211
+ messageCode: string;
212
+ /** Number of recipients the send reached; filled by the completion row, zero on the request row. */
213
+ audienceSize: number;
214
+ /** Outcome: ok, denied_ip, denied_acl or completed. */
215
+ result: string;
216
+ /** Origin the call was made via, e.g. api, live activity api. */
217
+ createdVia: string;
218
+ };
219
+ export type GetApiTokenUsageRequest = {
220
+ /** API token code. */
221
+ code?: string;
222
+ /** Start of the time window (inclusive); omit for no lower bound. */
223
+ startTime?: Date;
224
+ /** End of the time window (inclusive); omit for no upper bound. */
225
+ endTime?: Date;
226
+ /** Outcome to filter by: ok, denied_ip, denied_acl or completed; e.g. denied_ip lists calls refused by address only. */
227
+ result?: string;
228
+ /** Page number, starting from 1. */
229
+ page?: number;
230
+ /** Rows per page; defaults to 50. */
231
+ perPage?: number;
232
+ };
233
+ export type GetApiTokenUsageResponse = {
234
+ usage: ApiTokenUsage[];
235
+ };
236
+ export type GetApiTokenUsageSummaryRequest = {
237
+ /** API token code. */
238
+ code?: string;
239
+ };
240
+ export type GetApiTokenUsageSummaryResponse = {
241
+ /** Last recorded call, absent when the token has not been used within the journal retention. */
242
+ lastUsed: ApiTokenUsage;
243
+ /** Calls the token was refused over the last 7 days: both denied_ip (caller address is not on the token allowlist) and denied_acl (token has no rights on the application). */
244
+ deniedLast_7Days: number;
245
+ /** The same count over the last 30 days. */
246
+ deniedLast_30Days: number;
247
+ };
package/data.js CHANGED
@@ -4517,6 +4517,18 @@ export const data = {
4517
4517
  "method": "get",
4518
4518
  "path": "/api/api_tokens/{code}"
4519
4519
  },
4520
+ "GetUsage": {
4521
+ "request": "pushwoosh.rpc_v2.api_tokens.GetApiTokenUsageRequest",
4522
+ "response": "pushwoosh.rpc_v2.api_tokens.GetApiTokenUsageResponse",
4523
+ "method": "get",
4524
+ "path": "/api/api_tokens/{code}/usage"
4525
+ },
4526
+ "GetUsageSummary": {
4527
+ "request": "pushwoosh.rpc_v2.api_tokens.GetApiTokenUsageSummaryRequest",
4528
+ "response": "pushwoosh.rpc_v2.api_tokens.GetApiTokenUsageSummaryResponse",
4529
+ "method": "get",
4530
+ "path": "/api/api_tokens/{code}/usage/summary"
4531
+ },
4520
4532
  "List": {
4521
4533
  "request": "pushwoosh.rpc_v2.api_tokens.ListApiTokensRequest",
4522
4534
  "response": "pushwoosh.rpc_v2.api_tokens.ListApiTokensResponse",
@@ -4908,6 +4920,89 @@ export const data = {
4908
4920
  "type": "I",
4909
4921
  "fields": {}
4910
4922
  },
4923
+ "pushwoosh.rpc_v2.api_tokens.ApiTokenUsage": {
4924
+ "type": "I",
4925
+ "fields": {
4926
+ "timestamp": {
4927
+ "type": "Date"
4928
+ },
4929
+ "clientIp": {
4930
+ "type": "string"
4931
+ },
4932
+ "method": {
4933
+ "type": "string"
4934
+ },
4935
+ "applicationCode": {
4936
+ "type": "string"
4937
+ },
4938
+ "messageCode": {
4939
+ "type": "string"
4940
+ },
4941
+ "audienceSize": {
4942
+ "type": "number"
4943
+ },
4944
+ "result": {
4945
+ "type": "string"
4946
+ },
4947
+ "createdVia": {
4948
+ "type": "string"
4949
+ }
4950
+ }
4951
+ },
4952
+ "pushwoosh.rpc_v2.api_tokens.GetApiTokenUsageRequest": {
4953
+ "type": "I",
4954
+ "fields": {
4955
+ "code": {
4956
+ "type": "string"
4957
+ },
4958
+ "startTime": {
4959
+ "type": "Date"
4960
+ },
4961
+ "endTime": {
4962
+ "type": "Date"
4963
+ },
4964
+ "result": {
4965
+ "type": "string"
4966
+ },
4967
+ "page": {
4968
+ "type": "number"
4969
+ },
4970
+ "perPage": {
4971
+ "type": "number"
4972
+ }
4973
+ }
4974
+ },
4975
+ "pushwoosh.rpc_v2.api_tokens.GetApiTokenUsageResponse": {
4976
+ "type": "I",
4977
+ "fields": {
4978
+ "usage": {
4979
+ "type": "pushwoosh.rpc_v2.api_tokens.ApiTokenUsage",
4980
+ "array": true
4981
+ }
4982
+ }
4983
+ },
4984
+ "pushwoosh.rpc_v2.api_tokens.GetApiTokenUsageSummaryRequest": {
4985
+ "type": "I",
4986
+ "fields": {
4987
+ "code": {
4988
+ "type": "string"
4989
+ }
4990
+ }
4991
+ },
4992
+ "pushwoosh.rpc_v2.api_tokens.GetApiTokenUsageSummaryResponse": {
4993
+ "type": "I",
4994
+ "fields": {
4995
+ "lastUsed": {
4996
+ "type": "pushwoosh.rpc_v2.api_tokens.ApiTokenUsage"
4997
+ },
4998
+ "deniedLast_7Days": {
4999
+ "type": "number"
5000
+ },
5001
+ "deniedLast_30Days": {
5002
+ "type": "number"
5003
+ }
5004
+ }
5005
+ },
4911
5006
  "pushwoosh.rpc_v2.app_inbox_presets.appInboxPresetsService": {
4912
5007
  "type": "S",
4913
5008
  "key": "appInboxPresets",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.289",
3
+ "version": "0.2.290",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",