@structured-id/ui-core 1.3.0 → 3.0.0

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 (152) hide show
  1. package/README.md +22 -10
  2. package/package.json +25 -43
  3. package/src/components/SidStatusBadge.vue +1 -5
  4. package/src/composables/useAccountTransport.test.ts +2 -1
  5. package/src/composables/useGrpc.test.ts +17 -14
  6. package/src/composables/useGrpc.ts +4 -2
  7. package/src/index.ts +2 -120
  8. package/src/profile/components/ConsentManager.vue +5 -1
  9. package/src/profile/components/ProfileEditor.vue +1 -1
  10. package/src/profile/components/SecuritySettings.vue +5 -1
  11. package/src/profile/components/SessionList.vue +2 -1
  12. package/src/profile/components/SidRegistrationForm.test.ts +173 -1
  13. package/src/profile/components/SidRegistrationForm.vue +88 -32
  14. package/src/profile/components/index.ts +1 -4
  15. package/src/profile/composables/index.ts +1 -0
  16. package/src/profile/composables/operationPlan.test.ts +155 -0
  17. package/src/profile/composables/operationPlan.ts +218 -0
  18. package/src/profile/composables/useAccountApi.ts +4 -4
  19. package/src/profile/composables/useAuth.test.ts +312 -31
  20. package/src/profile/composables/useAuth.ts +176 -30
  21. package/src/profile/composables/useAuthApi.opaque.test.ts +13 -6
  22. package/src/profile/composables/useAuthApi.ts +40 -18
  23. package/src/profile/composables/useCurrentPasswordRequirement.test.ts +196 -0
  24. package/src/profile/composables/useCurrentPasswordRequirement.ts +95 -0
  25. package/src/profile/composables/useEnrollmentApi.test.ts +7 -3
  26. package/src/profile/composables/useEnrollmentApi.ts +3 -5
  27. package/src/profile/composables/useIdentityApi.ts +4 -4
  28. package/src/profile/composables/useSecurityLevel.test.ts +1 -1
  29. package/src/profile/composables/useSecurityLevel.ts +1 -1
  30. package/src/quasar/SidPasswordCeremony.test.ts +253 -0
  31. package/src/quasar/SidPasswordCeremony.vue +456 -0
  32. package/src/quasar/index.ts +2 -0
  33. package/src/utils/rpcRefusal.test.ts +4 -4
  34. package/src/utils/rpcRefusal.ts +8 -4
  35. package/dist/browser-vp/index.cjs +0 -349
  36. package/dist/browser-vp/index.d.cts +0 -276
  37. package/dist/browser-vp/index.d.ts +0 -276
  38. package/dist/browser-vp/index.js +0 -349
  39. package/dist/chunk-C3Q766CY.cjs +0 -125
  40. package/dist/chunk-J5YXRXB5.js +0 -125
  41. package/dist/index.cjs +0 -23581
  42. package/dist/index.d.cts +0 -11539
  43. package/dist/index.d.ts +0 -11539
  44. package/dist/index.js +0 -23581
  45. package/dist/storage-4CB2JTLW.cjs +0 -22
  46. package/dist/storage-THRWREZP.js +0 -22
  47. package/src/browser-vp/crypto.ts +0 -253
  48. package/src/browser-vp/index.test.ts +0 -10
  49. package/src/browser-vp/index.ts +0 -116
  50. package/src/browser-vp/prf.ts +0 -179
  51. package/src/browser-vp/storage.test.ts +0 -9
  52. package/src/browser-vp/storage.ts +0 -163
  53. package/src/browser-vp/types.ts +0 -95
  54. package/src/browser-vp/vp.test.ts +0 -43
  55. package/src/browser-vp/vp.ts +0 -111
  56. package/src/generated/google/api/http.ts +0 -687
  57. package/src/generated/google/api/httpbody.ts +0 -159
  58. package/src/generated/google/protobuf/any.ts +0 -326
  59. package/src/generated/google/protobuf/descriptor.ts +0 -4865
  60. package/src/generated/google/protobuf/duration.ts +0 -230
  61. package/src/generated/google/protobuf/empty.ts +0 -94
  62. package/src/generated/google/protobuf/struct.ts +0 -484
  63. package/src/generated/google/protobuf/timestamp.ts +0 -287
  64. package/src/generated/google/rpc/error_details.ts +0 -1386
  65. package/src/generated/google/rpc/status.ts +0 -127
  66. package/src/generated/sid/v1/account/account.client.ts +0 -527
  67. package/src/generated/sid/v1/account/account.ts +0 -3261
  68. package/src/generated/sid/v1/admin/admin.client.ts +0 -139
  69. package/src/generated/sid/v1/admin/admin.ts +0 -781
  70. package/src/generated/sid/v1/admin/admin_roles.client.ts +0 -181
  71. package/src/generated/sid/v1/admin/admin_roles.ts +0 -1606
  72. package/src/generated/sid/v1/admin/analytics.client.ts +0 -106
  73. package/src/generated/sid/v1/admin/analytics.ts +0 -1017
  74. package/src/generated/sid/v1/admin/branding.client.ts +0 -166
  75. package/src/generated/sid/v1/admin/branding.ts +0 -1906
  76. package/src/generated/sid/v1/admin/enrollment.client.ts +0 -177
  77. package/src/generated/sid/v1/admin/enrollment.ts +0 -1766
  78. package/src/generated/sid/v1/admin/events.client.ts +0 -195
  79. package/src/generated/sid/v1/admin/events.ts +0 -1900
  80. package/src/generated/sid/v1/admin/flow.client.ts +0 -183
  81. package/src/generated/sid/v1/admin/flow.ts +0 -1552
  82. package/src/generated/sid/v1/admin/keys.client.ts +0 -107
  83. package/src/generated/sid/v1/admin/keys.ts +0 -931
  84. package/src/generated/sid/v1/admin/login_experience.client.ts +0 -160
  85. package/src/generated/sid/v1/admin/login_experience.ts +0 -1061
  86. package/src/generated/sid/v1/admin/migration.client.ts +0 -127
  87. package/src/generated/sid/v1/admin/migration.ts +0 -1948
  88. package/src/generated/sid/v1/admin/notifications.client.ts +0 -134
  89. package/src/generated/sid/v1/admin/notifications.ts +0 -1273
  90. package/src/generated/sid/v1/admin/operations.client.ts +0 -241
  91. package/src/generated/sid/v1/admin/operations.ts +0 -2633
  92. package/src/generated/sid/v1/admin/organizations.client.ts +0 -57
  93. package/src/generated/sid/v1/admin/organizations.ts +0 -332
  94. package/src/generated/sid/v1/admin/provisioning.client.ts +0 -232
  95. package/src/generated/sid/v1/admin/provisioning.ts +0 -1383
  96. package/src/generated/sid/v1/admin/scopes.client.ts +0 -171
  97. package/src/generated/sid/v1/admin/scopes.ts +0 -1324
  98. package/src/generated/sid/v1/admin/security.client.ts +0 -410
  99. package/src/generated/sid/v1/admin/security.ts +0 -4077
  100. package/src/generated/sid/v1/admin/sessions.client.ts +0 -114
  101. package/src/generated/sid/v1/admin/sessions.ts +0 -923
  102. package/src/generated/sid/v1/admin/settings.client.ts +0 -351
  103. package/src/generated/sid/v1/admin/settings.ts +0 -2458
  104. package/src/generated/sid/v1/admin/user_profile.client.ts +0 -57
  105. package/src/generated/sid/v1/admin/user_profile.ts +0 -730
  106. package/src/generated/sid/v1/admin/webhooks.client.ts +0 -269
  107. package/src/generated/sid/v1/admin/webhooks.ts +0 -2804
  108. package/src/generated/sid/v1/attestation/attestation.client.ts +0 -115
  109. package/src/generated/sid/v1/attestation/attestation.ts +0 -813
  110. package/src/generated/sid/v1/authn/auth.client.ts +0 -943
  111. package/src/generated/sid/v1/authn/auth.ts +0 -9719
  112. package/src/generated/sid/v1/authn/flows.client.ts +0 -413
  113. package/src/generated/sid/v1/authn/flows.ts +0 -3205
  114. package/src/generated/sid/v1/authn/issuer.client.ts +0 -489
  115. package/src/generated/sid/v1/authn/issuer.ts +0 -1600
  116. package/src/generated/sid/v1/authn/password_history.client.ts +0 -57
  117. package/src/generated/sid/v1/authn/password_history.ts +0 -578
  118. package/src/generated/sid/v1/authn/system_integration.client.ts +0 -73
  119. package/src/generated/sid/v1/authn/system_integration.ts +0 -218
  120. package/src/generated/sid/v1/authz/authz.client.ts +0 -459
  121. package/src/generated/sid/v1/authz/authz.ts +0 -6524
  122. package/src/generated/sid/v1/authz/forward_auth.client.ts +0 -97
  123. package/src/generated/sid/v1/authz/forward_auth.ts +0 -79
  124. package/src/generated/sid/v1/authz/governance.client.ts +0 -102
  125. package/src/generated/sid/v1/authz/governance.ts +0 -875
  126. package/src/generated/sid/v1/common/errors.ts +0 -710
  127. package/src/generated/sid/v1/common/pagination.ts +0 -152
  128. package/src/generated/sid/v1/common/transport.ts +0 -227
  129. package/src/generated/sid/v1/common/types.ts +0 -151
  130. package/src/generated/sid/v1/events/event_stream.client.ts +0 -67
  131. package/src/generated/sid/v1/events/event_stream.ts +0 -375
  132. package/src/generated/sid/v1/federation/upstream.client.ts +0 -142
  133. package/src/generated/sid/v1/federation/upstream.ts +0 -1736
  134. package/src/generated/sid/v1/identity/identity.client.ts +0 -467
  135. package/src/generated/sid/v1/identity/identity.ts +0 -5676
  136. package/src/generated/sid/v1/ids/ids.ts +0 -395
  137. package/src/generated/sid/v1/machine/machine_user.client.ts +0 -219
  138. package/src/generated/sid/v1/machine/machine_user.ts +0 -2364
  139. package/src/generated/sid/v1/machine/pat.client.ts +0 -130
  140. package/src/generated/sid/v1/machine/pat.ts +0 -1083
  141. package/src/generated/sid/v1/projects/projects.client.ts +0 -404
  142. package/src/generated/sid/v1/projects/projects.ts +0 -4446
  143. package/src/generated/sid/v1/scim/scim.client.ts +0 -520
  144. package/src/generated/sid/v1/scim/scim.ts +0 -3182
  145. package/src/generated/sid/v1/test/test.client.ts +0 -232
  146. package/src/generated/sid/v1/test/test.ts +0 -1136
  147. package/src/transport/adaptive.test.ts +0 -728
  148. package/src/transport/adaptive.ts +0 -308
  149. package/src/transport/framing.test.ts +0 -227
  150. package/src/transport/framing.ts +0 -98
  151. package/src/transport/webtransport.test.ts +0 -728
  152. package/src/transport/webtransport.ts +0 -323
@@ -1,1273 +0,0 @@
1
- // @generated by protobuf-ts 2.11.1 with parameter client_generic,generate_dependencies
2
- // @generated from protobuf file "sid/v1/admin/notifications.proto" (package "sid.v1.admin", syntax proto3)
3
- // tslint:disable
4
- import { Empty } from "../../../google/protobuf/empty";
5
- import { ServiceType } from "@protobuf-ts/runtime-rpc";
6
- import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
7
- import type { IBinaryWriter } from "@protobuf-ts/runtime";
8
- import type { BinaryReadOptions } from "@protobuf-ts/runtime";
9
- import type { IBinaryReader } from "@protobuf-ts/runtime";
10
- import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
- import { WireType } from "@protobuf-ts/runtime";
12
- import type { PartialMessage } from "@protobuf-ts/runtime";
13
- import { reflectionMergePartial } from "@protobuf-ts/runtime";
14
- import { MessageType } from "@protobuf-ts/runtime";
15
- import { Timestamp } from "../../../google/protobuf/timestamp";
16
- // ── Messages ──
17
-
18
- /**
19
- * Summary entry in the template catalog.
20
- *
21
- * @generated from protobuf message sid.v1.admin.TemplateSummary
22
- */
23
- export interface TemplateSummary {
24
- /**
25
- * @generated from protobuf field: string template_id = 1
26
- */
27
- templateId: string;
28
- /**
29
- * @generated from protobuf field: string name = 2
30
- */
31
- name: string;
32
- /**
33
- * @generated from protobuf field: string description = 3
34
- */
35
- description: string;
36
- /**
37
- * Which channels this template supports.
38
- *
39
- * @generated from protobuf field: repeated sid.v1.admin.NotificationChannel channels = 4
40
- */
41
- channels: NotificationChannel[];
42
- /**
43
- * Event that triggers this notification.
44
- *
45
- * @generated from protobuf field: string trigger = 5
46
- */
47
- trigger: string;
48
- /**
49
- * Whether the template has been customized (non-default).
50
- *
51
- * @generated from protobuf field: bool customized = 6
52
- */
53
- customized: boolean;
54
- /**
55
- * @generated from protobuf field: google.protobuf.Timestamp updated_at = 7
56
- */
57
- updatedAt?: Timestamp;
58
- }
59
- /**
60
- * Full template with content for a specific channel + locale.
61
- *
62
- * @generated from protobuf message sid.v1.admin.NotificationTemplate
63
- */
64
- export interface NotificationTemplate {
65
- /**
66
- * @generated from protobuf field: string template_id = 1
67
- */
68
- templateId: string;
69
- /**
70
- * @generated from protobuf field: string name = 2
71
- */
72
- name: string;
73
- /**
74
- * @generated from protobuf field: string description = 3
75
- */
76
- description: string;
77
- /**
78
- * @generated from protobuf field: repeated sid.v1.admin.NotificationChannel channels = 4
79
- */
80
- channels: NotificationChannel[];
81
- /**
82
- * @generated from protobuf field: string trigger = 5
83
- */
84
- trigger: string;
85
- /**
86
- * @generated from protobuf field: bool customized = 6
87
- */
88
- customized: boolean;
89
- /**
90
- * @generated from protobuf field: google.protobuf.Timestamp updated_at = 7
91
- */
92
- updatedAt?: Timestamp;
93
- /**
94
- * Content for the requested channel + locale.
95
- *
96
- * @generated from protobuf field: sid.v1.admin.TemplateContent content = 8
97
- */
98
- content?: TemplateContent;
99
- /**
100
- * Available locales for this template.
101
- *
102
- * @generated from protobuf field: repeated string available_locales = 9
103
- */
104
- availableLocales: string[];
105
- /**
106
- * Variables available for this template type.
107
- *
108
- * @generated from protobuf field: repeated sid.v1.admin.TemplateVariable variables = 10
109
- */
110
- variables: TemplateVariable[];
111
- }
112
- /**
113
- * Content varies by channel type.
114
- *
115
- * @generated from protobuf message sid.v1.admin.TemplateContent
116
- */
117
- export interface TemplateContent {
118
- /**
119
- * @generated from protobuf field: sid.v1.admin.NotificationChannel channel = 1
120
- */
121
- channel: NotificationChannel;
122
- /**
123
- * @generated from protobuf field: string locale = 2
124
- */
125
- locale: string;
126
- /**
127
- * Email fields.
128
- *
129
- * @generated from protobuf field: string subject = 3
130
- */
131
- subject: string;
132
- /**
133
- * @generated from protobuf field: string html_body = 4
134
- */
135
- htmlBody: string;
136
- /**
137
- * @generated from protobuf field: string text_body = 5
138
- */
139
- textBody: string;
140
- /**
141
- * SMS fields.
142
- *
143
- * @generated from protobuf field: string sms_body = 6
144
- */
145
- smsBody: string;
146
- /**
147
- * Push fields.
148
- *
149
- * @generated from protobuf field: string push_title = 7
150
- */
151
- pushTitle: string;
152
- /**
153
- * @generated from protobuf field: string push_body = 8
154
- */
155
- pushBody: string;
156
- /**
157
- * @generated from protobuf field: string push_action_url = 9
158
- */
159
- pushActionUrl: string;
160
- }
161
- /**
162
- * Variable description for the template editor UI.
163
- *
164
- * @generated from protobuf message sid.v1.admin.TemplateVariable
165
- */
166
- export interface TemplateVariable {
167
- /**
168
- * @generated from protobuf field: string name = 1
169
- */
170
- name: string;
171
- /**
172
- * @generated from protobuf field: string description = 2
173
- */
174
- description: string;
175
- /**
176
- * Example value for preview.
177
- *
178
- * @generated from protobuf field: string example = 3
179
- */
180
- example: string;
181
- }
182
- // ── Requests / Responses ──
183
-
184
- /**
185
- * @generated from protobuf message sid.v1.admin.ListTemplatesRequest
186
- */
187
- export interface ListTemplatesRequest {
188
- /**
189
- * Filter by channel.
190
- *
191
- * @generated from protobuf field: sid.v1.admin.NotificationChannel channel = 1
192
- */
193
- channel: NotificationChannel;
194
- /**
195
- * Filter: only customized templates.
196
- *
197
- * @generated from protobuf field: bool customized_only = 2
198
- */
199
- customizedOnly: boolean;
200
- }
201
- /**
202
- * @generated from protobuf message sid.v1.admin.ListTemplatesResponse
203
- */
204
- export interface ListTemplatesResponse {
205
- /**
206
- * @generated from protobuf field: repeated sid.v1.admin.TemplateSummary templates = 1
207
- */
208
- templates: TemplateSummary[];
209
- }
210
- /**
211
- * @generated from protobuf message sid.v1.admin.GetTemplateRequest
212
- */
213
- export interface GetTemplateRequest {
214
- /**
215
- * @generated from protobuf field: string template_id = 1
216
- */
217
- templateId: string;
218
- /**
219
- * @generated from protobuf field: sid.v1.admin.NotificationChannel channel = 2
220
- */
221
- channel: NotificationChannel;
222
- /**
223
- * @generated from protobuf field: string locale = 3
224
- */
225
- locale: string;
226
- }
227
- /**
228
- * @generated from protobuf message sid.v1.admin.UpdateTemplateRequest
229
- */
230
- export interface UpdateTemplateRequest {
231
- /**
232
- * @generated from protobuf field: string template_id = 1
233
- */
234
- templateId: string;
235
- /**
236
- * @generated from protobuf field: sid.v1.admin.TemplateContent content = 2
237
- */
238
- content?: TemplateContent;
239
- }
240
- /**
241
- * @generated from protobuf message sid.v1.admin.ResetTemplateRequest
242
- */
243
- export interface ResetTemplateRequest {
244
- /**
245
- * @generated from protobuf field: string template_id = 1
246
- */
247
- templateId: string;
248
- /**
249
- * @generated from protobuf field: sid.v1.admin.NotificationChannel channel = 2
250
- */
251
- channel: NotificationChannel;
252
- /**
253
- * @generated from protobuf field: string locale = 3
254
- */
255
- locale: string;
256
- }
257
- /**
258
- * @generated from protobuf message sid.v1.admin.PreviewTemplateRequest
259
- */
260
- export interface PreviewTemplateRequest {
261
- /**
262
- * @generated from protobuf field: string template_id = 1
263
- */
264
- templateId: string;
265
- /**
266
- * @generated from protobuf field: sid.v1.admin.NotificationChannel channel = 2
267
- */
268
- channel: NotificationChannel;
269
- /**
270
- * @generated from protobuf field: string locale = 3
271
- */
272
- locale: string;
273
- /**
274
- * Optional variable overrides (JSON key-value).
275
- *
276
- * @generated from protobuf field: map<string, string> sample_data = 4
277
- */
278
- sampleData: {
279
- [key: string]: string;
280
- };
281
- }
282
- /**
283
- * @generated from protobuf message sid.v1.admin.PreviewTemplateResponse
284
- */
285
- export interface PreviewTemplateResponse {
286
- /**
287
- * Rendered subject (email only).
288
- *
289
- * @generated from protobuf field: string rendered_subject = 1
290
- */
291
- renderedSubject: string;
292
- /**
293
- * Rendered body (HTML for email, plain text for SMS/push).
294
- *
295
- * @generated from protobuf field: string rendered_body = 2
296
- */
297
- renderedBody: string;
298
- /**
299
- * Plain text body (email fallback).
300
- *
301
- * @generated from protobuf field: string rendered_text = 3
302
- */
303
- renderedText: string;
304
- }
305
- /**
306
- * @generated from protobuf message sid.v1.admin.SendTestNotificationRequest
307
- */
308
- export interface SendTestNotificationRequest {
309
- /**
310
- * Template to send, as listed by ListTemplates.
311
- *
312
- * @generated from protobuf field: string template_id = 1
313
- */
314
- templateId: string;
315
- /**
316
- * Channel to send through; unspecified means email.
317
- *
318
- * @generated from protobuf field: sid.v1.admin.NotificationChannel channel = 2
319
- */
320
- channel: NotificationChannel;
321
- /**
322
- * Locale of the content; empty means "en".
323
- *
324
- * @generated from protobuf field: string locale = 3
325
- */
326
- locale: string;
327
- /**
328
- * Address for the channel: an email address, or a phone number in E.164.
329
- * Empty sends to the requesting administrator's own address on that
330
- * channel, resolved by the server; without one the request is refused.
331
- *
332
- * @generated from protobuf field: string recipient = 4
333
- */
334
- recipient: string;
335
- }
336
- // ── Enums ──
337
-
338
- /**
339
- * @generated from protobuf enum sid.v1.admin.NotificationChannel
340
- */
341
- export enum NotificationChannel {
342
- /**
343
- * @generated from protobuf enum value: NOTIFICATION_CHANNEL_UNSPECIFIED = 0;
344
- */
345
- UNSPECIFIED = 0,
346
- /**
347
- * @generated from protobuf enum value: NOTIFICATION_CHANNEL_EMAIL = 1;
348
- */
349
- EMAIL = 1,
350
- /**
351
- * @generated from protobuf enum value: NOTIFICATION_CHANNEL_SMS = 2;
352
- */
353
- SMS = 2,
354
- /**
355
- * @generated from protobuf enum value: NOTIFICATION_CHANNEL_PUSH = 3;
356
- */
357
- PUSH = 3
358
- }
359
- // @generated message type with reflection information, may provide speed optimized methods
360
- class TemplateSummary$Type extends MessageType<TemplateSummary> {
361
- constructor() {
362
- super("sid.v1.admin.TemplateSummary", [
363
- { no: 1, name: "template_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
364
- { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
365
- { no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
366
- { no: 4, name: "channels", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["sid.v1.admin.NotificationChannel", NotificationChannel, "NOTIFICATION_CHANNEL_"] },
367
- { no: 5, name: "trigger", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
368
- { no: 6, name: "customized", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
369
- { no: 7, name: "updated_at", kind: "message", T: () => Timestamp }
370
- ]);
371
- }
372
- create(value?: PartialMessage<TemplateSummary>): TemplateSummary {
373
- const message = globalThis.Object.create((this.messagePrototype!));
374
- message.templateId = "";
375
- message.name = "";
376
- message.description = "";
377
- message.channels = [];
378
- message.trigger = "";
379
- message.customized = false;
380
- if (value !== undefined)
381
- reflectionMergePartial<TemplateSummary>(this, message, value);
382
- return message;
383
- }
384
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TemplateSummary): TemplateSummary {
385
- let message = target ?? this.create(), end = reader.pos + length;
386
- while (reader.pos < end) {
387
- let [fieldNo, wireType] = reader.tag();
388
- switch (fieldNo) {
389
- case /* string template_id */ 1:
390
- message.templateId = reader.string();
391
- break;
392
- case /* string name */ 2:
393
- message.name = reader.string();
394
- break;
395
- case /* string description */ 3:
396
- message.description = reader.string();
397
- break;
398
- case /* repeated sid.v1.admin.NotificationChannel channels */ 4:
399
- if (wireType === WireType.LengthDelimited)
400
- for (let e = reader.int32() + reader.pos; reader.pos < e;)
401
- message.channels.push(reader.int32());
402
- else
403
- message.channels.push(reader.int32());
404
- break;
405
- case /* string trigger */ 5:
406
- message.trigger = reader.string();
407
- break;
408
- case /* bool customized */ 6:
409
- message.customized = reader.bool();
410
- break;
411
- case /* google.protobuf.Timestamp updated_at */ 7:
412
- message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
413
- break;
414
- default:
415
- let u = options.readUnknownField;
416
- if (u === "throw")
417
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
418
- let d = reader.skip(wireType);
419
- if (u !== false)
420
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
421
- }
422
- }
423
- return message;
424
- }
425
- internalBinaryWrite(message: TemplateSummary, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
426
- /* string template_id = 1; */
427
- if (message.templateId !== "")
428
- writer.tag(1, WireType.LengthDelimited).string(message.templateId);
429
- /* string name = 2; */
430
- if (message.name !== "")
431
- writer.tag(2, WireType.LengthDelimited).string(message.name);
432
- /* string description = 3; */
433
- if (message.description !== "")
434
- writer.tag(3, WireType.LengthDelimited).string(message.description);
435
- /* repeated sid.v1.admin.NotificationChannel channels = 4; */
436
- if (message.channels.length) {
437
- writer.tag(4, WireType.LengthDelimited).fork();
438
- for (let i = 0; i < message.channels.length; i++)
439
- writer.int32(message.channels[i]);
440
- writer.join();
441
- }
442
- /* string trigger = 5; */
443
- if (message.trigger !== "")
444
- writer.tag(5, WireType.LengthDelimited).string(message.trigger);
445
- /* bool customized = 6; */
446
- if (message.customized !== false)
447
- writer.tag(6, WireType.Varint).bool(message.customized);
448
- /* google.protobuf.Timestamp updated_at = 7; */
449
- if (message.updatedAt)
450
- Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
451
- let u = options.writeUnknownFields;
452
- if (u !== false)
453
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
454
- return writer;
455
- }
456
- }
457
- /**
458
- * @generated MessageType for protobuf message sid.v1.admin.TemplateSummary
459
- */
460
- export const TemplateSummary = new TemplateSummary$Type();
461
- // @generated message type with reflection information, may provide speed optimized methods
462
- class NotificationTemplate$Type extends MessageType<NotificationTemplate> {
463
- constructor() {
464
- super("sid.v1.admin.NotificationTemplate", [
465
- { no: 1, name: "template_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
466
- { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
467
- { no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
468
- { no: 4, name: "channels", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["sid.v1.admin.NotificationChannel", NotificationChannel, "NOTIFICATION_CHANNEL_"] },
469
- { no: 5, name: "trigger", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
470
- { no: 6, name: "customized", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
471
- { no: 7, name: "updated_at", kind: "message", T: () => Timestamp },
472
- { no: 8, name: "content", kind: "message", T: () => TemplateContent },
473
- { no: 9, name: "available_locales", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
474
- { no: 10, name: "variables", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => TemplateVariable }
475
- ]);
476
- }
477
- create(value?: PartialMessage<NotificationTemplate>): NotificationTemplate {
478
- const message = globalThis.Object.create((this.messagePrototype!));
479
- message.templateId = "";
480
- message.name = "";
481
- message.description = "";
482
- message.channels = [];
483
- message.trigger = "";
484
- message.customized = false;
485
- message.availableLocales = [];
486
- message.variables = [];
487
- if (value !== undefined)
488
- reflectionMergePartial<NotificationTemplate>(this, message, value);
489
- return message;
490
- }
491
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NotificationTemplate): NotificationTemplate {
492
- let message = target ?? this.create(), end = reader.pos + length;
493
- while (reader.pos < end) {
494
- let [fieldNo, wireType] = reader.tag();
495
- switch (fieldNo) {
496
- case /* string template_id */ 1:
497
- message.templateId = reader.string();
498
- break;
499
- case /* string name */ 2:
500
- message.name = reader.string();
501
- break;
502
- case /* string description */ 3:
503
- message.description = reader.string();
504
- break;
505
- case /* repeated sid.v1.admin.NotificationChannel channels */ 4:
506
- if (wireType === WireType.LengthDelimited)
507
- for (let e = reader.int32() + reader.pos; reader.pos < e;)
508
- message.channels.push(reader.int32());
509
- else
510
- message.channels.push(reader.int32());
511
- break;
512
- case /* string trigger */ 5:
513
- message.trigger = reader.string();
514
- break;
515
- case /* bool customized */ 6:
516
- message.customized = reader.bool();
517
- break;
518
- case /* google.protobuf.Timestamp updated_at */ 7:
519
- message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
520
- break;
521
- case /* sid.v1.admin.TemplateContent content */ 8:
522
- message.content = TemplateContent.internalBinaryRead(reader, reader.uint32(), options, message.content);
523
- break;
524
- case /* repeated string available_locales */ 9:
525
- message.availableLocales.push(reader.string());
526
- break;
527
- case /* repeated sid.v1.admin.TemplateVariable variables */ 10:
528
- message.variables.push(TemplateVariable.internalBinaryRead(reader, reader.uint32(), options));
529
- break;
530
- default:
531
- let u = options.readUnknownField;
532
- if (u === "throw")
533
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
534
- let d = reader.skip(wireType);
535
- if (u !== false)
536
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
537
- }
538
- }
539
- return message;
540
- }
541
- internalBinaryWrite(message: NotificationTemplate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
542
- /* string template_id = 1; */
543
- if (message.templateId !== "")
544
- writer.tag(1, WireType.LengthDelimited).string(message.templateId);
545
- /* string name = 2; */
546
- if (message.name !== "")
547
- writer.tag(2, WireType.LengthDelimited).string(message.name);
548
- /* string description = 3; */
549
- if (message.description !== "")
550
- writer.tag(3, WireType.LengthDelimited).string(message.description);
551
- /* repeated sid.v1.admin.NotificationChannel channels = 4; */
552
- if (message.channels.length) {
553
- writer.tag(4, WireType.LengthDelimited).fork();
554
- for (let i = 0; i < message.channels.length; i++)
555
- writer.int32(message.channels[i]);
556
- writer.join();
557
- }
558
- /* string trigger = 5; */
559
- if (message.trigger !== "")
560
- writer.tag(5, WireType.LengthDelimited).string(message.trigger);
561
- /* bool customized = 6; */
562
- if (message.customized !== false)
563
- writer.tag(6, WireType.Varint).bool(message.customized);
564
- /* google.protobuf.Timestamp updated_at = 7; */
565
- if (message.updatedAt)
566
- Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
567
- /* sid.v1.admin.TemplateContent content = 8; */
568
- if (message.content)
569
- TemplateContent.internalBinaryWrite(message.content, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
570
- /* repeated string available_locales = 9; */
571
- for (let i = 0; i < message.availableLocales.length; i++)
572
- writer.tag(9, WireType.LengthDelimited).string(message.availableLocales[i]);
573
- /* repeated sid.v1.admin.TemplateVariable variables = 10; */
574
- for (let i = 0; i < message.variables.length; i++)
575
- TemplateVariable.internalBinaryWrite(message.variables[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join();
576
- let u = options.writeUnknownFields;
577
- if (u !== false)
578
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
579
- return writer;
580
- }
581
- }
582
- /**
583
- * @generated MessageType for protobuf message sid.v1.admin.NotificationTemplate
584
- */
585
- export const NotificationTemplate = new NotificationTemplate$Type();
586
- // @generated message type with reflection information, may provide speed optimized methods
587
- class TemplateContent$Type extends MessageType<TemplateContent> {
588
- constructor() {
589
- super("sid.v1.admin.TemplateContent", [
590
- { no: 1, name: "channel", kind: "enum", T: () => ["sid.v1.admin.NotificationChannel", NotificationChannel, "NOTIFICATION_CHANNEL_"] },
591
- { no: 2, name: "locale", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
592
- { no: 3, name: "subject", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
593
- { no: 4, name: "html_body", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
594
- { no: 5, name: "text_body", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
595
- { no: 6, name: "sms_body", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
596
- { no: 7, name: "push_title", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
597
- { no: 8, name: "push_body", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
598
- { no: 9, name: "push_action_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
599
- ]);
600
- }
601
- create(value?: PartialMessage<TemplateContent>): TemplateContent {
602
- const message = globalThis.Object.create((this.messagePrototype!));
603
- message.channel = 0;
604
- message.locale = "";
605
- message.subject = "";
606
- message.htmlBody = "";
607
- message.textBody = "";
608
- message.smsBody = "";
609
- message.pushTitle = "";
610
- message.pushBody = "";
611
- message.pushActionUrl = "";
612
- if (value !== undefined)
613
- reflectionMergePartial<TemplateContent>(this, message, value);
614
- return message;
615
- }
616
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TemplateContent): TemplateContent {
617
- let message = target ?? this.create(), end = reader.pos + length;
618
- while (reader.pos < end) {
619
- let [fieldNo, wireType] = reader.tag();
620
- switch (fieldNo) {
621
- case /* sid.v1.admin.NotificationChannel channel */ 1:
622
- message.channel = reader.int32();
623
- break;
624
- case /* string locale */ 2:
625
- message.locale = reader.string();
626
- break;
627
- case /* string subject */ 3:
628
- message.subject = reader.string();
629
- break;
630
- case /* string html_body */ 4:
631
- message.htmlBody = reader.string();
632
- break;
633
- case /* string text_body */ 5:
634
- message.textBody = reader.string();
635
- break;
636
- case /* string sms_body */ 6:
637
- message.smsBody = reader.string();
638
- break;
639
- case /* string push_title */ 7:
640
- message.pushTitle = reader.string();
641
- break;
642
- case /* string push_body */ 8:
643
- message.pushBody = reader.string();
644
- break;
645
- case /* string push_action_url */ 9:
646
- message.pushActionUrl = reader.string();
647
- break;
648
- default:
649
- let u = options.readUnknownField;
650
- if (u === "throw")
651
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
652
- let d = reader.skip(wireType);
653
- if (u !== false)
654
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
655
- }
656
- }
657
- return message;
658
- }
659
- internalBinaryWrite(message: TemplateContent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
660
- /* sid.v1.admin.NotificationChannel channel = 1; */
661
- if (message.channel !== 0)
662
- writer.tag(1, WireType.Varint).int32(message.channel);
663
- /* string locale = 2; */
664
- if (message.locale !== "")
665
- writer.tag(2, WireType.LengthDelimited).string(message.locale);
666
- /* string subject = 3; */
667
- if (message.subject !== "")
668
- writer.tag(3, WireType.LengthDelimited).string(message.subject);
669
- /* string html_body = 4; */
670
- if (message.htmlBody !== "")
671
- writer.tag(4, WireType.LengthDelimited).string(message.htmlBody);
672
- /* string text_body = 5; */
673
- if (message.textBody !== "")
674
- writer.tag(5, WireType.LengthDelimited).string(message.textBody);
675
- /* string sms_body = 6; */
676
- if (message.smsBody !== "")
677
- writer.tag(6, WireType.LengthDelimited).string(message.smsBody);
678
- /* string push_title = 7; */
679
- if (message.pushTitle !== "")
680
- writer.tag(7, WireType.LengthDelimited).string(message.pushTitle);
681
- /* string push_body = 8; */
682
- if (message.pushBody !== "")
683
- writer.tag(8, WireType.LengthDelimited).string(message.pushBody);
684
- /* string push_action_url = 9; */
685
- if (message.pushActionUrl !== "")
686
- writer.tag(9, WireType.LengthDelimited).string(message.pushActionUrl);
687
- let u = options.writeUnknownFields;
688
- if (u !== false)
689
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
690
- return writer;
691
- }
692
- }
693
- /**
694
- * @generated MessageType for protobuf message sid.v1.admin.TemplateContent
695
- */
696
- export const TemplateContent = new TemplateContent$Type();
697
- // @generated message type with reflection information, may provide speed optimized methods
698
- class TemplateVariable$Type extends MessageType<TemplateVariable> {
699
- constructor() {
700
- super("sid.v1.admin.TemplateVariable", [
701
- { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
702
- { no: 2, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
703
- { no: 3, name: "example", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
704
- ]);
705
- }
706
- create(value?: PartialMessage<TemplateVariable>): TemplateVariable {
707
- const message = globalThis.Object.create((this.messagePrototype!));
708
- message.name = "";
709
- message.description = "";
710
- message.example = "";
711
- if (value !== undefined)
712
- reflectionMergePartial<TemplateVariable>(this, message, value);
713
- return message;
714
- }
715
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TemplateVariable): TemplateVariable {
716
- let message = target ?? this.create(), end = reader.pos + length;
717
- while (reader.pos < end) {
718
- let [fieldNo, wireType] = reader.tag();
719
- switch (fieldNo) {
720
- case /* string name */ 1:
721
- message.name = reader.string();
722
- break;
723
- case /* string description */ 2:
724
- message.description = reader.string();
725
- break;
726
- case /* string example */ 3:
727
- message.example = reader.string();
728
- break;
729
- default:
730
- let u = options.readUnknownField;
731
- if (u === "throw")
732
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
733
- let d = reader.skip(wireType);
734
- if (u !== false)
735
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
736
- }
737
- }
738
- return message;
739
- }
740
- internalBinaryWrite(message: TemplateVariable, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
741
- /* string name = 1; */
742
- if (message.name !== "")
743
- writer.tag(1, WireType.LengthDelimited).string(message.name);
744
- /* string description = 2; */
745
- if (message.description !== "")
746
- writer.tag(2, WireType.LengthDelimited).string(message.description);
747
- /* string example = 3; */
748
- if (message.example !== "")
749
- writer.tag(3, WireType.LengthDelimited).string(message.example);
750
- let u = options.writeUnknownFields;
751
- if (u !== false)
752
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
753
- return writer;
754
- }
755
- }
756
- /**
757
- * @generated MessageType for protobuf message sid.v1.admin.TemplateVariable
758
- */
759
- export const TemplateVariable = new TemplateVariable$Type();
760
- // @generated message type with reflection information, may provide speed optimized methods
761
- class ListTemplatesRequest$Type extends MessageType<ListTemplatesRequest> {
762
- constructor() {
763
- super("sid.v1.admin.ListTemplatesRequest", [
764
- { no: 1, name: "channel", kind: "enum", T: () => ["sid.v1.admin.NotificationChannel", NotificationChannel, "NOTIFICATION_CHANNEL_"] },
765
- { no: 2, name: "customized_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
766
- ]);
767
- }
768
- create(value?: PartialMessage<ListTemplatesRequest>): ListTemplatesRequest {
769
- const message = globalThis.Object.create((this.messagePrototype!));
770
- message.channel = 0;
771
- message.customizedOnly = false;
772
- if (value !== undefined)
773
- reflectionMergePartial<ListTemplatesRequest>(this, message, value);
774
- return message;
775
- }
776
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListTemplatesRequest): ListTemplatesRequest {
777
- let message = target ?? this.create(), end = reader.pos + length;
778
- while (reader.pos < end) {
779
- let [fieldNo, wireType] = reader.tag();
780
- switch (fieldNo) {
781
- case /* sid.v1.admin.NotificationChannel channel */ 1:
782
- message.channel = reader.int32();
783
- break;
784
- case /* bool customized_only */ 2:
785
- message.customizedOnly = reader.bool();
786
- break;
787
- default:
788
- let u = options.readUnknownField;
789
- if (u === "throw")
790
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
791
- let d = reader.skip(wireType);
792
- if (u !== false)
793
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
794
- }
795
- }
796
- return message;
797
- }
798
- internalBinaryWrite(message: ListTemplatesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
799
- /* sid.v1.admin.NotificationChannel channel = 1; */
800
- if (message.channel !== 0)
801
- writer.tag(1, WireType.Varint).int32(message.channel);
802
- /* bool customized_only = 2; */
803
- if (message.customizedOnly !== false)
804
- writer.tag(2, WireType.Varint).bool(message.customizedOnly);
805
- let u = options.writeUnknownFields;
806
- if (u !== false)
807
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
808
- return writer;
809
- }
810
- }
811
- /**
812
- * @generated MessageType for protobuf message sid.v1.admin.ListTemplatesRequest
813
- */
814
- export const ListTemplatesRequest = new ListTemplatesRequest$Type();
815
- // @generated message type with reflection information, may provide speed optimized methods
816
- class ListTemplatesResponse$Type extends MessageType<ListTemplatesResponse> {
817
- constructor() {
818
- super("sid.v1.admin.ListTemplatesResponse", [
819
- { no: 1, name: "templates", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => TemplateSummary }
820
- ]);
821
- }
822
- create(value?: PartialMessage<ListTemplatesResponse>): ListTemplatesResponse {
823
- const message = globalThis.Object.create((this.messagePrototype!));
824
- message.templates = [];
825
- if (value !== undefined)
826
- reflectionMergePartial<ListTemplatesResponse>(this, message, value);
827
- return message;
828
- }
829
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListTemplatesResponse): ListTemplatesResponse {
830
- let message = target ?? this.create(), end = reader.pos + length;
831
- while (reader.pos < end) {
832
- let [fieldNo, wireType] = reader.tag();
833
- switch (fieldNo) {
834
- case /* repeated sid.v1.admin.TemplateSummary templates */ 1:
835
- message.templates.push(TemplateSummary.internalBinaryRead(reader, reader.uint32(), options));
836
- break;
837
- default:
838
- let u = options.readUnknownField;
839
- if (u === "throw")
840
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
841
- let d = reader.skip(wireType);
842
- if (u !== false)
843
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
844
- }
845
- }
846
- return message;
847
- }
848
- internalBinaryWrite(message: ListTemplatesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
849
- /* repeated sid.v1.admin.TemplateSummary templates = 1; */
850
- for (let i = 0; i < message.templates.length; i++)
851
- TemplateSummary.internalBinaryWrite(message.templates[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
852
- let u = options.writeUnknownFields;
853
- if (u !== false)
854
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
855
- return writer;
856
- }
857
- }
858
- /**
859
- * @generated MessageType for protobuf message sid.v1.admin.ListTemplatesResponse
860
- */
861
- export const ListTemplatesResponse = new ListTemplatesResponse$Type();
862
- // @generated message type with reflection information, may provide speed optimized methods
863
- class GetTemplateRequest$Type extends MessageType<GetTemplateRequest> {
864
- constructor() {
865
- super("sid.v1.admin.GetTemplateRequest", [
866
- { no: 1, name: "template_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
867
- { no: 2, name: "channel", kind: "enum", T: () => ["sid.v1.admin.NotificationChannel", NotificationChannel, "NOTIFICATION_CHANNEL_"] },
868
- { no: 3, name: "locale", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
869
- ]);
870
- }
871
- create(value?: PartialMessage<GetTemplateRequest>): GetTemplateRequest {
872
- const message = globalThis.Object.create((this.messagePrototype!));
873
- message.templateId = "";
874
- message.channel = 0;
875
- message.locale = "";
876
- if (value !== undefined)
877
- reflectionMergePartial<GetTemplateRequest>(this, message, value);
878
- return message;
879
- }
880
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetTemplateRequest): GetTemplateRequest {
881
- let message = target ?? this.create(), end = reader.pos + length;
882
- while (reader.pos < end) {
883
- let [fieldNo, wireType] = reader.tag();
884
- switch (fieldNo) {
885
- case /* string template_id */ 1:
886
- message.templateId = reader.string();
887
- break;
888
- case /* sid.v1.admin.NotificationChannel channel */ 2:
889
- message.channel = reader.int32();
890
- break;
891
- case /* string locale */ 3:
892
- message.locale = reader.string();
893
- break;
894
- default:
895
- let u = options.readUnknownField;
896
- if (u === "throw")
897
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
898
- let d = reader.skip(wireType);
899
- if (u !== false)
900
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
901
- }
902
- }
903
- return message;
904
- }
905
- internalBinaryWrite(message: GetTemplateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
906
- /* string template_id = 1; */
907
- if (message.templateId !== "")
908
- writer.tag(1, WireType.LengthDelimited).string(message.templateId);
909
- /* sid.v1.admin.NotificationChannel channel = 2; */
910
- if (message.channel !== 0)
911
- writer.tag(2, WireType.Varint).int32(message.channel);
912
- /* string locale = 3; */
913
- if (message.locale !== "")
914
- writer.tag(3, WireType.LengthDelimited).string(message.locale);
915
- let u = options.writeUnknownFields;
916
- if (u !== false)
917
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
918
- return writer;
919
- }
920
- }
921
- /**
922
- * @generated MessageType for protobuf message sid.v1.admin.GetTemplateRequest
923
- */
924
- export const GetTemplateRequest = new GetTemplateRequest$Type();
925
- // @generated message type with reflection information, may provide speed optimized methods
926
- class UpdateTemplateRequest$Type extends MessageType<UpdateTemplateRequest> {
927
- constructor() {
928
- super("sid.v1.admin.UpdateTemplateRequest", [
929
- { no: 1, name: "template_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
930
- { no: 2, name: "content", kind: "message", T: () => TemplateContent }
931
- ]);
932
- }
933
- create(value?: PartialMessage<UpdateTemplateRequest>): UpdateTemplateRequest {
934
- const message = globalThis.Object.create((this.messagePrototype!));
935
- message.templateId = "";
936
- if (value !== undefined)
937
- reflectionMergePartial<UpdateTemplateRequest>(this, message, value);
938
- return message;
939
- }
940
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateTemplateRequest): UpdateTemplateRequest {
941
- let message = target ?? this.create(), end = reader.pos + length;
942
- while (reader.pos < end) {
943
- let [fieldNo, wireType] = reader.tag();
944
- switch (fieldNo) {
945
- case /* string template_id */ 1:
946
- message.templateId = reader.string();
947
- break;
948
- case /* sid.v1.admin.TemplateContent content */ 2:
949
- message.content = TemplateContent.internalBinaryRead(reader, reader.uint32(), options, message.content);
950
- break;
951
- default:
952
- let u = options.readUnknownField;
953
- if (u === "throw")
954
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
955
- let d = reader.skip(wireType);
956
- if (u !== false)
957
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
958
- }
959
- }
960
- return message;
961
- }
962
- internalBinaryWrite(message: UpdateTemplateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
963
- /* string template_id = 1; */
964
- if (message.templateId !== "")
965
- writer.tag(1, WireType.LengthDelimited).string(message.templateId);
966
- /* sid.v1.admin.TemplateContent content = 2; */
967
- if (message.content)
968
- TemplateContent.internalBinaryWrite(message.content, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
969
- let u = options.writeUnknownFields;
970
- if (u !== false)
971
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
972
- return writer;
973
- }
974
- }
975
- /**
976
- * @generated MessageType for protobuf message sid.v1.admin.UpdateTemplateRequest
977
- */
978
- export const UpdateTemplateRequest = new UpdateTemplateRequest$Type();
979
- // @generated message type with reflection information, may provide speed optimized methods
980
- class ResetTemplateRequest$Type extends MessageType<ResetTemplateRequest> {
981
- constructor() {
982
- super("sid.v1.admin.ResetTemplateRequest", [
983
- { no: 1, name: "template_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
984
- { no: 2, name: "channel", kind: "enum", T: () => ["sid.v1.admin.NotificationChannel", NotificationChannel, "NOTIFICATION_CHANNEL_"] },
985
- { no: 3, name: "locale", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
986
- ]);
987
- }
988
- create(value?: PartialMessage<ResetTemplateRequest>): ResetTemplateRequest {
989
- const message = globalThis.Object.create((this.messagePrototype!));
990
- message.templateId = "";
991
- message.channel = 0;
992
- message.locale = "";
993
- if (value !== undefined)
994
- reflectionMergePartial<ResetTemplateRequest>(this, message, value);
995
- return message;
996
- }
997
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetTemplateRequest): ResetTemplateRequest {
998
- let message = target ?? this.create(), end = reader.pos + length;
999
- while (reader.pos < end) {
1000
- let [fieldNo, wireType] = reader.tag();
1001
- switch (fieldNo) {
1002
- case /* string template_id */ 1:
1003
- message.templateId = reader.string();
1004
- break;
1005
- case /* sid.v1.admin.NotificationChannel channel */ 2:
1006
- message.channel = reader.int32();
1007
- break;
1008
- case /* string locale */ 3:
1009
- message.locale = reader.string();
1010
- break;
1011
- default:
1012
- let u = options.readUnknownField;
1013
- if (u === "throw")
1014
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1015
- let d = reader.skip(wireType);
1016
- if (u !== false)
1017
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1018
- }
1019
- }
1020
- return message;
1021
- }
1022
- internalBinaryWrite(message: ResetTemplateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1023
- /* string template_id = 1; */
1024
- if (message.templateId !== "")
1025
- writer.tag(1, WireType.LengthDelimited).string(message.templateId);
1026
- /* sid.v1.admin.NotificationChannel channel = 2; */
1027
- if (message.channel !== 0)
1028
- writer.tag(2, WireType.Varint).int32(message.channel);
1029
- /* string locale = 3; */
1030
- if (message.locale !== "")
1031
- writer.tag(3, WireType.LengthDelimited).string(message.locale);
1032
- let u = options.writeUnknownFields;
1033
- if (u !== false)
1034
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1035
- return writer;
1036
- }
1037
- }
1038
- /**
1039
- * @generated MessageType for protobuf message sid.v1.admin.ResetTemplateRequest
1040
- */
1041
- export const ResetTemplateRequest = new ResetTemplateRequest$Type();
1042
- // @generated message type with reflection information, may provide speed optimized methods
1043
- class PreviewTemplateRequest$Type extends MessageType<PreviewTemplateRequest> {
1044
- constructor() {
1045
- super("sid.v1.admin.PreviewTemplateRequest", [
1046
- { no: 1, name: "template_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1047
- { no: 2, name: "channel", kind: "enum", T: () => ["sid.v1.admin.NotificationChannel", NotificationChannel, "NOTIFICATION_CHANNEL_"] },
1048
- { no: 3, name: "locale", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1049
- { no: 4, name: "sample_data", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }
1050
- ]);
1051
- }
1052
- create(value?: PartialMessage<PreviewTemplateRequest>): PreviewTemplateRequest {
1053
- const message = globalThis.Object.create((this.messagePrototype!));
1054
- message.templateId = "";
1055
- message.channel = 0;
1056
- message.locale = "";
1057
- message.sampleData = {};
1058
- if (value !== undefined)
1059
- reflectionMergePartial<PreviewTemplateRequest>(this, message, value);
1060
- return message;
1061
- }
1062
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PreviewTemplateRequest): PreviewTemplateRequest {
1063
- let message = target ?? this.create(), end = reader.pos + length;
1064
- while (reader.pos < end) {
1065
- let [fieldNo, wireType] = reader.tag();
1066
- switch (fieldNo) {
1067
- case /* string template_id */ 1:
1068
- message.templateId = reader.string();
1069
- break;
1070
- case /* sid.v1.admin.NotificationChannel channel */ 2:
1071
- message.channel = reader.int32();
1072
- break;
1073
- case /* string locale */ 3:
1074
- message.locale = reader.string();
1075
- break;
1076
- case /* map<string, string> sample_data */ 4:
1077
- this.binaryReadMap4(message.sampleData, reader, options);
1078
- break;
1079
- default:
1080
- let u = options.readUnknownField;
1081
- if (u === "throw")
1082
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1083
- let d = reader.skip(wireType);
1084
- if (u !== false)
1085
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1086
- }
1087
- }
1088
- return message;
1089
- }
1090
- private binaryReadMap4(map: PreviewTemplateRequest["sampleData"], reader: IBinaryReader, options: BinaryReadOptions): void {
1091
- let len = reader.uint32(), end = reader.pos + len, key: keyof PreviewTemplateRequest["sampleData"] | undefined, val: PreviewTemplateRequest["sampleData"][any] | undefined;
1092
- while (reader.pos < end) {
1093
- let [fieldNo, wireType] = reader.tag();
1094
- switch (fieldNo) {
1095
- case 1:
1096
- key = reader.string();
1097
- break;
1098
- case 2:
1099
- val = reader.string();
1100
- break;
1101
- default: throw new globalThis.Error("unknown map entry field for sid.v1.admin.PreviewTemplateRequest.sample_data");
1102
- }
1103
- }
1104
- map[key ?? ""] = val ?? "";
1105
- }
1106
- internalBinaryWrite(message: PreviewTemplateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1107
- /* string template_id = 1; */
1108
- if (message.templateId !== "")
1109
- writer.tag(1, WireType.LengthDelimited).string(message.templateId);
1110
- /* sid.v1.admin.NotificationChannel channel = 2; */
1111
- if (message.channel !== 0)
1112
- writer.tag(2, WireType.Varint).int32(message.channel);
1113
- /* string locale = 3; */
1114
- if (message.locale !== "")
1115
- writer.tag(3, WireType.LengthDelimited).string(message.locale);
1116
- /* map<string, string> sample_data = 4; */
1117
- for (let k of globalThis.Object.keys(message.sampleData))
1118
- writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.sampleData[k]).join();
1119
- let u = options.writeUnknownFields;
1120
- if (u !== false)
1121
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1122
- return writer;
1123
- }
1124
- }
1125
- /**
1126
- * @generated MessageType for protobuf message sid.v1.admin.PreviewTemplateRequest
1127
- */
1128
- export const PreviewTemplateRequest = new PreviewTemplateRequest$Type();
1129
- // @generated message type with reflection information, may provide speed optimized methods
1130
- class PreviewTemplateResponse$Type extends MessageType<PreviewTemplateResponse> {
1131
- constructor() {
1132
- super("sid.v1.admin.PreviewTemplateResponse", [
1133
- { no: 1, name: "rendered_subject", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1134
- { no: 2, name: "rendered_body", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1135
- { no: 3, name: "rendered_text", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1136
- ]);
1137
- }
1138
- create(value?: PartialMessage<PreviewTemplateResponse>): PreviewTemplateResponse {
1139
- const message = globalThis.Object.create((this.messagePrototype!));
1140
- message.renderedSubject = "";
1141
- message.renderedBody = "";
1142
- message.renderedText = "";
1143
- if (value !== undefined)
1144
- reflectionMergePartial<PreviewTemplateResponse>(this, message, value);
1145
- return message;
1146
- }
1147
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PreviewTemplateResponse): PreviewTemplateResponse {
1148
- let message = target ?? this.create(), end = reader.pos + length;
1149
- while (reader.pos < end) {
1150
- let [fieldNo, wireType] = reader.tag();
1151
- switch (fieldNo) {
1152
- case /* string rendered_subject */ 1:
1153
- message.renderedSubject = reader.string();
1154
- break;
1155
- case /* string rendered_body */ 2:
1156
- message.renderedBody = reader.string();
1157
- break;
1158
- case /* string rendered_text */ 3:
1159
- message.renderedText = reader.string();
1160
- break;
1161
- default:
1162
- let u = options.readUnknownField;
1163
- if (u === "throw")
1164
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1165
- let d = reader.skip(wireType);
1166
- if (u !== false)
1167
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1168
- }
1169
- }
1170
- return message;
1171
- }
1172
- internalBinaryWrite(message: PreviewTemplateResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1173
- /* string rendered_subject = 1; */
1174
- if (message.renderedSubject !== "")
1175
- writer.tag(1, WireType.LengthDelimited).string(message.renderedSubject);
1176
- /* string rendered_body = 2; */
1177
- if (message.renderedBody !== "")
1178
- writer.tag(2, WireType.LengthDelimited).string(message.renderedBody);
1179
- /* string rendered_text = 3; */
1180
- if (message.renderedText !== "")
1181
- writer.tag(3, WireType.LengthDelimited).string(message.renderedText);
1182
- let u = options.writeUnknownFields;
1183
- if (u !== false)
1184
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1185
- return writer;
1186
- }
1187
- }
1188
- /**
1189
- * @generated MessageType for protobuf message sid.v1.admin.PreviewTemplateResponse
1190
- */
1191
- export const PreviewTemplateResponse = new PreviewTemplateResponse$Type();
1192
- // @generated message type with reflection information, may provide speed optimized methods
1193
- class SendTestNotificationRequest$Type extends MessageType<SendTestNotificationRequest> {
1194
- constructor() {
1195
- super("sid.v1.admin.SendTestNotificationRequest", [
1196
- { no: 1, name: "template_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1197
- { no: 2, name: "channel", kind: "enum", T: () => ["sid.v1.admin.NotificationChannel", NotificationChannel, "NOTIFICATION_CHANNEL_"] },
1198
- { no: 3, name: "locale", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1199
- { no: 4, name: "recipient", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1200
- ]);
1201
- }
1202
- create(value?: PartialMessage<SendTestNotificationRequest>): SendTestNotificationRequest {
1203
- const message = globalThis.Object.create((this.messagePrototype!));
1204
- message.templateId = "";
1205
- message.channel = 0;
1206
- message.locale = "";
1207
- message.recipient = "";
1208
- if (value !== undefined)
1209
- reflectionMergePartial<SendTestNotificationRequest>(this, message, value);
1210
- return message;
1211
- }
1212
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendTestNotificationRequest): SendTestNotificationRequest {
1213
- let message = target ?? this.create(), end = reader.pos + length;
1214
- while (reader.pos < end) {
1215
- let [fieldNo, wireType] = reader.tag();
1216
- switch (fieldNo) {
1217
- case /* string template_id */ 1:
1218
- message.templateId = reader.string();
1219
- break;
1220
- case /* sid.v1.admin.NotificationChannel channel */ 2:
1221
- message.channel = reader.int32();
1222
- break;
1223
- case /* string locale */ 3:
1224
- message.locale = reader.string();
1225
- break;
1226
- case /* string recipient */ 4:
1227
- message.recipient = reader.string();
1228
- break;
1229
- default:
1230
- let u = options.readUnknownField;
1231
- if (u === "throw")
1232
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1233
- let d = reader.skip(wireType);
1234
- if (u !== false)
1235
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1236
- }
1237
- }
1238
- return message;
1239
- }
1240
- internalBinaryWrite(message: SendTestNotificationRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1241
- /* string template_id = 1; */
1242
- if (message.templateId !== "")
1243
- writer.tag(1, WireType.LengthDelimited).string(message.templateId);
1244
- /* sid.v1.admin.NotificationChannel channel = 2; */
1245
- if (message.channel !== 0)
1246
- writer.tag(2, WireType.Varint).int32(message.channel);
1247
- /* string locale = 3; */
1248
- if (message.locale !== "")
1249
- writer.tag(3, WireType.LengthDelimited).string(message.locale);
1250
- /* string recipient = 4; */
1251
- if (message.recipient !== "")
1252
- writer.tag(4, WireType.LengthDelimited).string(message.recipient);
1253
- let u = options.writeUnknownFields;
1254
- if (u !== false)
1255
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1256
- return writer;
1257
- }
1258
- }
1259
- /**
1260
- * @generated MessageType for protobuf message sid.v1.admin.SendTestNotificationRequest
1261
- */
1262
- export const SendTestNotificationRequest = new SendTestNotificationRequest$Type();
1263
- /**
1264
- * @generated ServiceType for protobuf service sid.v1.admin.NotificationTemplateService
1265
- */
1266
- export const NotificationTemplateService = new ServiceType("sid.v1.admin.NotificationTemplateService", [
1267
- { name: "ListTemplates", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/admin/notification-templates" } }, I: ListTemplatesRequest, O: ListTemplatesResponse },
1268
- { name: "GetTemplate", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/admin/notification-templates/{template_id}" } }, I: GetTemplateRequest, O: NotificationTemplate },
1269
- { name: "UpdateTemplate", options: { "google.api.http": { patch: "/v1/admin/notification-templates/{template_id}", body: "*" } }, I: UpdateTemplateRequest, O: NotificationTemplate },
1270
- { name: "ResetTemplate", options: { "google.api.http": { post: "/v1/admin/notification-templates/{template_id}/reset", body: "*" } }, I: ResetTemplateRequest, O: NotificationTemplate },
1271
- { name: "PreviewTemplate", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { post: "/v1/admin/notification-templates/{template_id}/preview", body: "*" } }, I: PreviewTemplateRequest, O: PreviewTemplateResponse },
1272
- { name: "SendTestNotification", options: { "google.api.http": { post: "/v1/admin/notification-templates/{template_id}/test", body: "*" } }, I: SendTestNotificationRequest, O: Empty }
1273
- ]);