@pushwoosh/rpc-v2-http-api-data 0.2.187 → 0.2.189

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/data.js +64 -0
  2. package/geozones.d.ts +49 -0
  3. package/package.json +1 -1
package/data.js CHANGED
@@ -14688,6 +14688,12 @@ export const data = {
14688
14688
  "response": "pushwoosh.rpc_v2.geozones.DeleteGeozonesResponse",
14689
14689
  "method": "delete",
14690
14690
  "path": "/api/geozones/{code}"
14691
+ },
14692
+ "BulkCreate": {
14693
+ "request": "pushwoosh.rpc_v2.geozones.BulkCreateGeozonesRequest",
14694
+ "response": "pushwoosh.rpc_v2.geozones.BulkCreateGeozonesResponse",
14695
+ "method": "post",
14696
+ "path": "/api/geozones/bulk"
14691
14697
  }
14692
14698
  }
14693
14699
  },
@@ -15035,6 +15041,64 @@ export const data = {
15035
15041
  "type": "I",
15036
15042
  "fields": {}
15037
15043
  },
15044
+ "pushwoosh.rpc_v2.geozones.BulkCreateGeozonesRequest": {
15045
+ "type": "I",
15046
+ "fields": {
15047
+ "application": {
15048
+ "type": "string"
15049
+ },
15050
+ "geozones": {
15051
+ "type": "pushwoosh.rpc_v2.geozones.CreateGeozonesRequest",
15052
+ "array": true
15053
+ },
15054
+ "validateOnly": {
15055
+ "type": "boolean"
15056
+ }
15057
+ }
15058
+ },
15059
+ "pushwoosh.rpc_v2.geozones.RowError": {
15060
+ "type": "I",
15061
+ "fields": {
15062
+ "field": {
15063
+ "type": "string"
15064
+ },
15065
+ "message": {
15066
+ "type": "string"
15067
+ }
15068
+ }
15069
+ },
15070
+ "pushwoosh.rpc_v2.geozones.BulkCreateGeozoneResult": {
15071
+ "type": "I",
15072
+ "fields": {
15073
+ "index": {
15074
+ "type": "number"
15075
+ },
15076
+ "code": {
15077
+ "type": "string"
15078
+ },
15079
+ "uid": {
15080
+ "type": "number"
15081
+ },
15082
+ "error": {
15083
+ "type": "pushwoosh.rpc_v2.geozones.RowError"
15084
+ }
15085
+ }
15086
+ },
15087
+ "pushwoosh.rpc_v2.geozones.BulkCreateGeozonesResponse": {
15088
+ "type": "I",
15089
+ "fields": {
15090
+ "results": {
15091
+ "type": "pushwoosh.rpc_v2.geozones.BulkCreateGeozoneResult",
15092
+ "array": true
15093
+ },
15094
+ "created": {
15095
+ "type": "number"
15096
+ },
15097
+ "failed": {
15098
+ "type": "number"
15099
+ }
15100
+ }
15101
+ },
15038
15102
  "pushwoosh.rpc_v2.geozones_clusters.GeozonesClustersService": {
15039
15103
  "type": "S",
15040
15104
  "key": "geozonesClusters",
package/geozones.d.ts CHANGED
@@ -4,6 +4,7 @@ export type GeozonesService_Get = RpcMethod<GetGeozonesRequest, GetGeozonesRespo
4
4
  export type GeozonesService_Update = RpcMethod<UpdateGeozonesRequest, UpdateGeozonesResponse>;
5
5
  export type GeozonesService_List = RpcMethod<ListGeozonesRequest, ListGeozonesResponse>;
6
6
  export type GeozonesService_Delete = RpcMethod<DeleteGeozonesRequest, DeleteGeozonesResponse>;
7
+ export type GeozonesService_BulkCreate = RpcMethod<BulkCreateGeozonesRequest, BulkCreateGeozonesResponse>;
7
8
  export interface GeozonesService {
8
9
  /** Creates a geozone (a location trigger with center lat/lng, radius and re-entry cooldown) for an application, sending a push preset or inline content when a device enters it. Requires either preset or content; edit it later with update_geozone. */
9
10
  Create: GeozonesService_Create;
@@ -15,6 +16,11 @@ export interface GeozonesService {
15
16
  List: GeozonesService_List;
16
17
  /** Permanently deletes a geozone by its geozone code, removing the location trigger. Not undoable; use update_geozone to disable a geozone instead of deleting it. */
17
18
  Delete: GeozonesService_Delete;
19
+ /**
20
+ * Creates up to 500 geozones for one application, reporting every row separately
21
+ * so one bad row cannot hide what was written. Not transactional.
22
+ */
23
+ BulkCreate: GeozonesService_BulkCreate;
18
24
  }
19
25
  /**
20
26
  * Status reflects the user-set on/off switch for a Geozone or a GeozonesCluster.
@@ -157,3 +163,46 @@ export type DeleteGeozonesRequest = {
157
163
  code?: string;
158
164
  };
159
165
  export type DeleteGeozonesResponse = {};
166
+ /**
167
+ * Rows reuse CreateGeozonesRequest so a new geozone field cannot reach the single
168
+ * create and miss the bulk one.
169
+ */
170
+ export type BulkCreateGeozonesRequest = {
171
+ application?: string;
172
+ /** Per-row `application` is ignored: the top-level one applies to every row. */
173
+ geozones?: CreateGeozonesRequest[];
174
+ /** Validates every row and writes nothing, so an import can be checked first. */
175
+ validateOnly?: boolean;
176
+ };
177
+ /**
178
+ * Field names the offending request field for a validation failure, and is empty
179
+ * for any other kind of failure.
180
+ */
181
+ export type RowError = {
182
+ field: string;
183
+ message: string;
184
+ };
185
+ export type BulkCreateGeozoneResult = {
186
+ /**
187
+ * Zero-based position of the row in the request, so a caller can map a failure
188
+ * back to its CSV line even though failed rows produce no code.
189
+ */
190
+ index: number;
191
+ code: string;
192
+ /** Numeric geozone id, kept for the legacy addGeoZone response contract. */
193
+ uid: number;
194
+ error: RowError;
195
+ };
196
+ export type BulkCreateGeozonesResponse = {
197
+ /**
198
+ * One entry per attempted row, in request order. Shorter than the request when an
199
+ * infrastructure failure stopped the run: later rows were not attempted.
200
+ */
201
+ results: BulkCreateGeozoneResult[];
202
+ /**
203
+ * Rows written; under validate_only nothing is written and this counts the rows
204
+ * that passed, so a dry run and its real follow-up report the same numbers.
205
+ */
206
+ created: number;
207
+ failed: number;
208
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.187",
3
+ "version": "0.2.189",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",