@sentio/runtime 2.36.0-rc.1 → 2.36.0-rc.11

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.
@@ -166,6 +166,105 @@ export function permissionToJSON(object: Permission): string {
166
166
  }
167
167
  }
168
168
 
169
+ export enum NotificationType {
170
+ GENERAL = 0,
171
+ PROCESSOR_UPLOAD_FAILED = 101,
172
+ PROCESSOR_UPLOAD_SUCCESS = 102,
173
+ PROCESSOR_OBSOLETED = 103,
174
+ PROCESSOR_STOPPED = 104,
175
+ PROCESSOR_ACTIVATED = 105,
176
+ PROCESSOR_GENERAL = 106,
177
+ PROCESSOR_ERROR = 107,
178
+ EXPORT_TASK_FAILED = 201,
179
+ EXPORT_TASK_SUCCESS = 202,
180
+ BILLING_INVOICE = 301,
181
+ BILLING_PAYMENT = 302,
182
+ BILLING_SUBSCRIPTION = 303,
183
+ UNRECOGNIZED = -1,
184
+ }
185
+
186
+ export function notificationTypeFromJSON(object: any): NotificationType {
187
+ switch (object) {
188
+ case 0:
189
+ case "GENERAL":
190
+ return NotificationType.GENERAL;
191
+ case 101:
192
+ case "PROCESSOR_UPLOAD_FAILED":
193
+ return NotificationType.PROCESSOR_UPLOAD_FAILED;
194
+ case 102:
195
+ case "PROCESSOR_UPLOAD_SUCCESS":
196
+ return NotificationType.PROCESSOR_UPLOAD_SUCCESS;
197
+ case 103:
198
+ case "PROCESSOR_OBSOLETED":
199
+ return NotificationType.PROCESSOR_OBSOLETED;
200
+ case 104:
201
+ case "PROCESSOR_STOPPED":
202
+ return NotificationType.PROCESSOR_STOPPED;
203
+ case 105:
204
+ case "PROCESSOR_ACTIVATED":
205
+ return NotificationType.PROCESSOR_ACTIVATED;
206
+ case 106:
207
+ case "PROCESSOR_GENERAL":
208
+ return NotificationType.PROCESSOR_GENERAL;
209
+ case 107:
210
+ case "PROCESSOR_ERROR":
211
+ return NotificationType.PROCESSOR_ERROR;
212
+ case 201:
213
+ case "EXPORT_TASK_FAILED":
214
+ return NotificationType.EXPORT_TASK_FAILED;
215
+ case 202:
216
+ case "EXPORT_TASK_SUCCESS":
217
+ return NotificationType.EXPORT_TASK_SUCCESS;
218
+ case 301:
219
+ case "BILLING_INVOICE":
220
+ return NotificationType.BILLING_INVOICE;
221
+ case 302:
222
+ case "BILLING_PAYMENT":
223
+ return NotificationType.BILLING_PAYMENT;
224
+ case 303:
225
+ case "BILLING_SUBSCRIPTION":
226
+ return NotificationType.BILLING_SUBSCRIPTION;
227
+ case -1:
228
+ case "UNRECOGNIZED":
229
+ default:
230
+ return NotificationType.UNRECOGNIZED;
231
+ }
232
+ }
233
+
234
+ export function notificationTypeToJSON(object: NotificationType): string {
235
+ switch (object) {
236
+ case NotificationType.GENERAL:
237
+ return "GENERAL";
238
+ case NotificationType.PROCESSOR_UPLOAD_FAILED:
239
+ return "PROCESSOR_UPLOAD_FAILED";
240
+ case NotificationType.PROCESSOR_UPLOAD_SUCCESS:
241
+ return "PROCESSOR_UPLOAD_SUCCESS";
242
+ case NotificationType.PROCESSOR_OBSOLETED:
243
+ return "PROCESSOR_OBSOLETED";
244
+ case NotificationType.PROCESSOR_STOPPED:
245
+ return "PROCESSOR_STOPPED";
246
+ case NotificationType.PROCESSOR_ACTIVATED:
247
+ return "PROCESSOR_ACTIVATED";
248
+ case NotificationType.PROCESSOR_GENERAL:
249
+ return "PROCESSOR_GENERAL";
250
+ case NotificationType.PROCESSOR_ERROR:
251
+ return "PROCESSOR_ERROR";
252
+ case NotificationType.EXPORT_TASK_FAILED:
253
+ return "EXPORT_TASK_FAILED";
254
+ case NotificationType.EXPORT_TASK_SUCCESS:
255
+ return "EXPORT_TASK_SUCCESS";
256
+ case NotificationType.BILLING_INVOICE:
257
+ return "BILLING_INVOICE";
258
+ case NotificationType.BILLING_PAYMENT:
259
+ return "BILLING_PAYMENT";
260
+ case NotificationType.BILLING_SUBSCRIPTION:
261
+ return "BILLING_SUBSCRIPTION";
262
+ case NotificationType.UNRECOGNIZED:
263
+ default:
264
+ return "UNRECOGNIZED";
265
+ }
266
+ }
267
+
169
268
  export interface UsageTracker {
170
269
  apiSku: string;
171
270
  webuiSku: string;
@@ -1709,6 +1808,26 @@ export function systemSQLQuery_Aggregation_AggregateProperties_AggregationTypeTo
1709
1808
  }
1710
1809
  }
1711
1810
 
1811
+ export interface Notification {
1812
+ id: string;
1813
+ projectId: string;
1814
+ source: string;
1815
+ level: string;
1816
+ message: string;
1817
+ createdAt: Date | undefined;
1818
+ type: NotificationType;
1819
+ ownerId: string;
1820
+ owner: Owner | undefined;
1821
+ project: Project | undefined;
1822
+ attributes: { [key: string]: string };
1823
+ read: boolean;
1824
+ }
1825
+
1826
+ export interface Notification_AttributesEntry {
1827
+ key: string;
1828
+ value: string;
1829
+ }
1830
+
1712
1831
  function createBaseUsageTracker(): UsageTracker {
1713
1832
  return {
1714
1833
  apiSku: "",
@@ -11990,6 +12109,341 @@ export const SystemSQLQuery_Aggregation_AggregateProperties = {
11990
12109
  },
11991
12110
  };
11992
12111
 
12112
+ function createBaseNotification(): Notification {
12113
+ return {
12114
+ id: "",
12115
+ projectId: "",
12116
+ source: "",
12117
+ level: "",
12118
+ message: "",
12119
+ createdAt: undefined,
12120
+ type: 0,
12121
+ ownerId: "",
12122
+ owner: undefined,
12123
+ project: undefined,
12124
+ attributes: {},
12125
+ read: false,
12126
+ };
12127
+ }
12128
+
12129
+ export const Notification = {
12130
+ encode(message: Notification, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
12131
+ if (message.id !== "") {
12132
+ writer.uint32(10).string(message.id);
12133
+ }
12134
+ if (message.projectId !== "") {
12135
+ writer.uint32(18).string(message.projectId);
12136
+ }
12137
+ if (message.source !== "") {
12138
+ writer.uint32(26).string(message.source);
12139
+ }
12140
+ if (message.level !== "") {
12141
+ writer.uint32(34).string(message.level);
12142
+ }
12143
+ if (message.message !== "") {
12144
+ writer.uint32(42).string(message.message);
12145
+ }
12146
+ if (message.createdAt !== undefined) {
12147
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).ldelim();
12148
+ }
12149
+ if (message.type !== 0) {
12150
+ writer.uint32(64).int32(message.type);
12151
+ }
12152
+ if (message.ownerId !== "") {
12153
+ writer.uint32(74).string(message.ownerId);
12154
+ }
12155
+ if (message.owner !== undefined) {
12156
+ Owner.encode(message.owner, writer.uint32(82).fork()).ldelim();
12157
+ }
12158
+ if (message.project !== undefined) {
12159
+ Project.encode(message.project, writer.uint32(90).fork()).ldelim();
12160
+ }
12161
+ Object.entries(message.attributes).forEach(([key, value]) => {
12162
+ Notification_AttributesEntry.encode({ key: key as any, value }, writer.uint32(98).fork()).ldelim();
12163
+ });
12164
+ if (message.read !== false) {
12165
+ writer.uint32(104).bool(message.read);
12166
+ }
12167
+ return writer;
12168
+ },
12169
+
12170
+ decode(input: _m0.Reader | Uint8Array, length?: number): Notification {
12171
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
12172
+ let end = length === undefined ? reader.len : reader.pos + length;
12173
+ const message = createBaseNotification();
12174
+ while (reader.pos < end) {
12175
+ const tag = reader.uint32();
12176
+ switch (tag >>> 3) {
12177
+ case 1:
12178
+ if (tag !== 10) {
12179
+ break;
12180
+ }
12181
+
12182
+ message.id = reader.string();
12183
+ continue;
12184
+ case 2:
12185
+ if (tag !== 18) {
12186
+ break;
12187
+ }
12188
+
12189
+ message.projectId = reader.string();
12190
+ continue;
12191
+ case 3:
12192
+ if (tag !== 26) {
12193
+ break;
12194
+ }
12195
+
12196
+ message.source = reader.string();
12197
+ continue;
12198
+ case 4:
12199
+ if (tag !== 34) {
12200
+ break;
12201
+ }
12202
+
12203
+ message.level = reader.string();
12204
+ continue;
12205
+ case 5:
12206
+ if (tag !== 42) {
12207
+ break;
12208
+ }
12209
+
12210
+ message.message = reader.string();
12211
+ continue;
12212
+ case 6:
12213
+ if (tag !== 50) {
12214
+ break;
12215
+ }
12216
+
12217
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12218
+ continue;
12219
+ case 8:
12220
+ if (tag !== 64) {
12221
+ break;
12222
+ }
12223
+
12224
+ message.type = reader.int32() as any;
12225
+ continue;
12226
+ case 9:
12227
+ if (tag !== 74) {
12228
+ break;
12229
+ }
12230
+
12231
+ message.ownerId = reader.string();
12232
+ continue;
12233
+ case 10:
12234
+ if (tag !== 82) {
12235
+ break;
12236
+ }
12237
+
12238
+ message.owner = Owner.decode(reader, reader.uint32());
12239
+ continue;
12240
+ case 11:
12241
+ if (tag !== 90) {
12242
+ break;
12243
+ }
12244
+
12245
+ message.project = Project.decode(reader, reader.uint32());
12246
+ continue;
12247
+ case 12:
12248
+ if (tag !== 98) {
12249
+ break;
12250
+ }
12251
+
12252
+ const entry12 = Notification_AttributesEntry.decode(reader, reader.uint32());
12253
+ if (entry12.value !== undefined) {
12254
+ message.attributes[entry12.key] = entry12.value;
12255
+ }
12256
+ continue;
12257
+ case 13:
12258
+ if (tag !== 104) {
12259
+ break;
12260
+ }
12261
+
12262
+ message.read = reader.bool();
12263
+ continue;
12264
+ }
12265
+ if ((tag & 7) === 4 || tag === 0) {
12266
+ break;
12267
+ }
12268
+ reader.skipType(tag & 7);
12269
+ }
12270
+ return message;
12271
+ },
12272
+
12273
+ fromJSON(object: any): Notification {
12274
+ return {
12275
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
12276
+ projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "",
12277
+ source: isSet(object.source) ? globalThis.String(object.source) : "",
12278
+ level: isSet(object.level) ? globalThis.String(object.level) : "",
12279
+ message: isSet(object.message) ? globalThis.String(object.message) : "",
12280
+ createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined,
12281
+ type: isSet(object.type) ? notificationTypeFromJSON(object.type) : 0,
12282
+ ownerId: isSet(object.ownerId) ? globalThis.String(object.ownerId) : "",
12283
+ owner: isSet(object.owner) ? Owner.fromJSON(object.owner) : undefined,
12284
+ project: isSet(object.project) ? Project.fromJSON(object.project) : undefined,
12285
+ attributes: isObject(object.attributes)
12286
+ ? Object.entries(object.attributes).reduce<{ [key: string]: string }>((acc, [key, value]) => {
12287
+ acc[key] = String(value);
12288
+ return acc;
12289
+ }, {})
12290
+ : {},
12291
+ read: isSet(object.read) ? globalThis.Boolean(object.read) : false,
12292
+ };
12293
+ },
12294
+
12295
+ toJSON(message: Notification): unknown {
12296
+ const obj: any = {};
12297
+ if (message.id !== "") {
12298
+ obj.id = message.id;
12299
+ }
12300
+ if (message.projectId !== "") {
12301
+ obj.projectId = message.projectId;
12302
+ }
12303
+ if (message.source !== "") {
12304
+ obj.source = message.source;
12305
+ }
12306
+ if (message.level !== "") {
12307
+ obj.level = message.level;
12308
+ }
12309
+ if (message.message !== "") {
12310
+ obj.message = message.message;
12311
+ }
12312
+ if (message.createdAt !== undefined) {
12313
+ obj.createdAt = message.createdAt.toISOString();
12314
+ }
12315
+ if (message.type !== 0) {
12316
+ obj.type = notificationTypeToJSON(message.type);
12317
+ }
12318
+ if (message.ownerId !== "") {
12319
+ obj.ownerId = message.ownerId;
12320
+ }
12321
+ if (message.owner !== undefined) {
12322
+ obj.owner = Owner.toJSON(message.owner);
12323
+ }
12324
+ if (message.project !== undefined) {
12325
+ obj.project = Project.toJSON(message.project);
12326
+ }
12327
+ if (message.attributes) {
12328
+ const entries = Object.entries(message.attributes);
12329
+ if (entries.length > 0) {
12330
+ obj.attributes = {};
12331
+ entries.forEach(([k, v]) => {
12332
+ obj.attributes[k] = v;
12333
+ });
12334
+ }
12335
+ }
12336
+ if (message.read !== false) {
12337
+ obj.read = message.read;
12338
+ }
12339
+ return obj;
12340
+ },
12341
+
12342
+ create(base?: DeepPartial<Notification>): Notification {
12343
+ return Notification.fromPartial(base ?? {});
12344
+ },
12345
+ fromPartial(object: DeepPartial<Notification>): Notification {
12346
+ const message = createBaseNotification();
12347
+ message.id = object.id ?? "";
12348
+ message.projectId = object.projectId ?? "";
12349
+ message.source = object.source ?? "";
12350
+ message.level = object.level ?? "";
12351
+ message.message = object.message ?? "";
12352
+ message.createdAt = object.createdAt ?? undefined;
12353
+ message.type = object.type ?? 0;
12354
+ message.ownerId = object.ownerId ?? "";
12355
+ message.owner = (object.owner !== undefined && object.owner !== null) ? Owner.fromPartial(object.owner) : undefined;
12356
+ message.project = (object.project !== undefined && object.project !== null)
12357
+ ? Project.fromPartial(object.project)
12358
+ : undefined;
12359
+ message.attributes = Object.entries(object.attributes ?? {}).reduce<{ [key: string]: string }>(
12360
+ (acc, [key, value]) => {
12361
+ if (value !== undefined) {
12362
+ acc[key] = globalThis.String(value);
12363
+ }
12364
+ return acc;
12365
+ },
12366
+ {},
12367
+ );
12368
+ message.read = object.read ?? false;
12369
+ return message;
12370
+ },
12371
+ };
12372
+
12373
+ function createBaseNotification_AttributesEntry(): Notification_AttributesEntry {
12374
+ return { key: "", value: "" };
12375
+ }
12376
+
12377
+ export const Notification_AttributesEntry = {
12378
+ encode(message: Notification_AttributesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
12379
+ if (message.key !== "") {
12380
+ writer.uint32(10).string(message.key);
12381
+ }
12382
+ if (message.value !== "") {
12383
+ writer.uint32(18).string(message.value);
12384
+ }
12385
+ return writer;
12386
+ },
12387
+
12388
+ decode(input: _m0.Reader | Uint8Array, length?: number): Notification_AttributesEntry {
12389
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
12390
+ let end = length === undefined ? reader.len : reader.pos + length;
12391
+ const message = createBaseNotification_AttributesEntry();
12392
+ while (reader.pos < end) {
12393
+ const tag = reader.uint32();
12394
+ switch (tag >>> 3) {
12395
+ case 1:
12396
+ if (tag !== 10) {
12397
+ break;
12398
+ }
12399
+
12400
+ message.key = reader.string();
12401
+ continue;
12402
+ case 2:
12403
+ if (tag !== 18) {
12404
+ break;
12405
+ }
12406
+
12407
+ message.value = reader.string();
12408
+ continue;
12409
+ }
12410
+ if ((tag & 7) === 4 || tag === 0) {
12411
+ break;
12412
+ }
12413
+ reader.skipType(tag & 7);
12414
+ }
12415
+ return message;
12416
+ },
12417
+
12418
+ fromJSON(object: any): Notification_AttributesEntry {
12419
+ return {
12420
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
12421
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
12422
+ };
12423
+ },
12424
+
12425
+ toJSON(message: Notification_AttributesEntry): unknown {
12426
+ const obj: any = {};
12427
+ if (message.key !== "") {
12428
+ obj.key = message.key;
12429
+ }
12430
+ if (message.value !== "") {
12431
+ obj.value = message.value;
12432
+ }
12433
+ return obj;
12434
+ },
12435
+
12436
+ create(base?: DeepPartial<Notification_AttributesEntry>): Notification_AttributesEntry {
12437
+ return Notification_AttributesEntry.fromPartial(base ?? {});
12438
+ },
12439
+ fromPartial(object: DeepPartial<Notification_AttributesEntry>): Notification_AttributesEntry {
12440
+ const message = createBaseNotification_AttributesEntry();
12441
+ message.key = object.key ?? "";
12442
+ message.value = object.value ?? "";
12443
+ return message;
12444
+ },
12445
+ };
12446
+
11993
12447
  type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
11994
12448
 
11995
12449
  type DeepPartial<T> = T extends Builtin ? T