@fraym/proto 0.26.0 → 0.26.1

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.
@@ -12,11 +12,19 @@ export interface CloneEntryResponse {
12
12
  newData: {
13
13
  [key: string]: string;
14
14
  };
15
+ validationErrors: string[];
16
+ fieldValidationErrors: {
17
+ [key: string]: string;
18
+ };
15
19
  }
16
20
  export interface CloneEntryResponse_NewDataEntry {
17
21
  key: string;
18
22
  value: string;
19
23
  }
24
+ export interface CloneEntryResponse_FieldValidationErrorsEntry {
25
+ key: string;
26
+ value: string;
27
+ }
20
28
  export declare const CloneEntryRequest: {
21
29
  encode(message: CloneEntryRequest, writer?: _m0.Writer): _m0.Writer;
22
30
  decode(input: _m0.Reader | Uint8Array, length?: number): CloneEntryRequest;
@@ -41,6 +49,14 @@ export declare const CloneEntryResponse_NewDataEntry: {
41
49
  create(base?: DeepPartial<CloneEntryResponse_NewDataEntry>): CloneEntryResponse_NewDataEntry;
42
50
  fromPartial(object: DeepPartial<CloneEntryResponse_NewDataEntry>): CloneEntryResponse_NewDataEntry;
43
51
  };
52
+ export declare const CloneEntryResponse_FieldValidationErrorsEntry: {
53
+ encode(message: CloneEntryResponse_FieldValidationErrorsEntry, writer?: _m0.Writer): _m0.Writer;
54
+ decode(input: _m0.Reader | Uint8Array, length?: number): CloneEntryResponse_FieldValidationErrorsEntry;
55
+ fromJSON(object: any): CloneEntryResponse_FieldValidationErrorsEntry;
56
+ toJSON(message: CloneEntryResponse_FieldValidationErrorsEntry): unknown;
57
+ create(base?: DeepPartial<CloneEntryResponse_FieldValidationErrorsEntry>): CloneEntryResponse_FieldValidationErrorsEntry;
58
+ fromPartial(object: DeepPartial<CloneEntryResponse_FieldValidationErrorsEntry>): CloneEntryResponse_FieldValidationErrorsEntry;
59
+ };
44
60
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
45
61
  export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
46
62
  $case: string;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CloneEntryResponse_NewDataEntry = exports.CloneEntryResponse = exports.CloneEntryRequest = exports.protobufPackage = void 0;
6
+ exports.CloneEntryResponse_FieldValidationErrorsEntry = exports.CloneEntryResponse_NewDataEntry = exports.CloneEntryResponse = exports.CloneEntryRequest = exports.protobufPackage = void 0;
7
7
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
8
8
  const shared_1 = require("./shared");
9
9
  exports.protobufPackage = "freym.crud.delivery";
@@ -119,13 +119,20 @@ exports.CloneEntryRequest = {
119
119
  },
120
120
  };
121
121
  function createBaseCloneEntryResponse() {
122
- return { newData: {} };
122
+ return { newData: {}, validationErrors: [], fieldValidationErrors: {} };
123
123
  }
124
124
  exports.CloneEntryResponse = {
125
125
  encode(message, writer = minimal_1.default.Writer.create()) {
126
126
  Object.entries(message.newData).forEach(([key, value]) => {
127
127
  exports.CloneEntryResponse_NewDataEntry.encode({ key: key, value }, writer.uint32(10).fork()).ldelim();
128
128
  });
129
+ for (const v of message.validationErrors) {
130
+ writer.uint32(18).string(v);
131
+ }
132
+ Object.entries(message.fieldValidationErrors).forEach(([key, value]) => {
133
+ exports.CloneEntryResponse_FieldValidationErrorsEntry.encode({ key: key, value }, writer.uint32(26).fork())
134
+ .ldelim();
135
+ });
129
136
  return writer;
130
137
  },
131
138
  decode(input, length) {
@@ -144,6 +151,21 @@ exports.CloneEntryResponse = {
144
151
  message.newData[entry1.key] = entry1.value;
145
152
  }
146
153
  continue;
154
+ case 2:
155
+ if (tag !== 18) {
156
+ break;
157
+ }
158
+ message.validationErrors.push(reader.string());
159
+ continue;
160
+ case 3:
161
+ if (tag !== 26) {
162
+ break;
163
+ }
164
+ const entry3 = exports.CloneEntryResponse_FieldValidationErrorsEntry.decode(reader, reader.uint32());
165
+ if (entry3.value !== undefined) {
166
+ message.fieldValidationErrors[entry3.key] = entry3.value;
167
+ }
168
+ continue;
147
169
  }
148
170
  if ((tag & 7) === 4 || tag === 0) {
149
171
  break;
@@ -160,9 +182,19 @@ exports.CloneEntryResponse = {
160
182
  return acc;
161
183
  }, {})
162
184
  : {},
185
+ validationErrors: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.validationErrors)
186
+ ? object.validationErrors.map((e) => globalThis.String(e))
187
+ : [],
188
+ fieldValidationErrors: isObject(object.fieldValidationErrors)
189
+ ? Object.entries(object.fieldValidationErrors).reduce((acc, [key, value]) => {
190
+ acc[key] = String(value);
191
+ return acc;
192
+ }, {})
193
+ : {},
163
194
  };
164
195
  },
165
196
  toJSON(message) {
197
+ var _a;
166
198
  const obj = {};
167
199
  if (message.newData) {
168
200
  const entries = Object.entries(message.newData);
@@ -173,13 +205,25 @@ exports.CloneEntryResponse = {
173
205
  });
174
206
  }
175
207
  }
208
+ if ((_a = message.validationErrors) === null || _a === void 0 ? void 0 : _a.length) {
209
+ obj.validationErrors = message.validationErrors;
210
+ }
211
+ if (message.fieldValidationErrors) {
212
+ const entries = Object.entries(message.fieldValidationErrors);
213
+ if (entries.length > 0) {
214
+ obj.fieldValidationErrors = {};
215
+ entries.forEach(([k, v]) => {
216
+ obj.fieldValidationErrors[k] = v;
217
+ });
218
+ }
219
+ }
176
220
  return obj;
177
221
  },
178
222
  create(base) {
179
223
  return exports.CloneEntryResponse.fromPartial(base !== null && base !== void 0 ? base : {});
180
224
  },
181
225
  fromPartial(object) {
182
- var _a;
226
+ var _a, _b, _c;
183
227
  const message = createBaseCloneEntryResponse();
184
228
  message.newData = Object.entries((_a = object.newData) !== null && _a !== void 0 ? _a : {}).reduce((acc, [key, value]) => {
185
229
  if (value !== undefined) {
@@ -187,6 +231,13 @@ exports.CloneEntryResponse = {
187
231
  }
188
232
  return acc;
189
233
  }, {});
234
+ message.validationErrors = ((_b = object.validationErrors) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
235
+ message.fieldValidationErrors = Object.entries((_c = object.fieldValidationErrors) !== null && _c !== void 0 ? _c : {}).reduce((acc, [key, value]) => {
236
+ if (value !== undefined) {
237
+ acc[key] = globalThis.String(value);
238
+ }
239
+ return acc;
240
+ }, {});
190
241
  return message;
191
242
  },
192
243
  };
@@ -257,6 +308,73 @@ exports.CloneEntryResponse_NewDataEntry = {
257
308
  return message;
258
309
  },
259
310
  };
311
+ function createBaseCloneEntryResponse_FieldValidationErrorsEntry() {
312
+ return { key: "", value: "" };
313
+ }
314
+ exports.CloneEntryResponse_FieldValidationErrorsEntry = {
315
+ encode(message, writer = minimal_1.default.Writer.create()) {
316
+ if (message.key !== "") {
317
+ writer.uint32(10).string(message.key);
318
+ }
319
+ if (message.value !== "") {
320
+ writer.uint32(18).string(message.value);
321
+ }
322
+ return writer;
323
+ },
324
+ decode(input, length) {
325
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
326
+ let end = length === undefined ? reader.len : reader.pos + length;
327
+ const message = createBaseCloneEntryResponse_FieldValidationErrorsEntry();
328
+ while (reader.pos < end) {
329
+ const tag = reader.uint32();
330
+ switch (tag >>> 3) {
331
+ case 1:
332
+ if (tag !== 10) {
333
+ break;
334
+ }
335
+ message.key = reader.string();
336
+ continue;
337
+ case 2:
338
+ if (tag !== 18) {
339
+ break;
340
+ }
341
+ message.value = reader.string();
342
+ continue;
343
+ }
344
+ if ((tag & 7) === 4 || tag === 0) {
345
+ break;
346
+ }
347
+ reader.skipType(tag & 7);
348
+ }
349
+ return message;
350
+ },
351
+ fromJSON(object) {
352
+ return {
353
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
354
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
355
+ };
356
+ },
357
+ toJSON(message) {
358
+ const obj = {};
359
+ if (message.key !== "") {
360
+ obj.key = message.key;
361
+ }
362
+ if (message.value !== "") {
363
+ obj.value = message.value;
364
+ }
365
+ return obj;
366
+ },
367
+ create(base) {
368
+ return exports.CloneEntryResponse_FieldValidationErrorsEntry.fromPartial(base !== null && base !== void 0 ? base : {});
369
+ },
370
+ fromPartial(object) {
371
+ var _a, _b;
372
+ const message = createBaseCloneEntryResponse_FieldValidationErrorsEntry();
373
+ message.key = (_a = object.key) !== null && _a !== void 0 ? _a : "";
374
+ message.value = (_b = object.value) !== null && _b !== void 0 ? _b : "";
375
+ return message;
376
+ },
377
+ };
260
378
  function isObject(value) {
261
379
  return typeof value === "object" && value !== null;
262
380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fraym/proto",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/fraym/proto",
6
6
  "repository": {