weave-typescript 0.13.0 → 0.14.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 (121) hide show
  1. package/dist/index.d.ts +9 -16
  2. package/dist/index.js +13 -21
  3. package/dist/weaveapi/project/v1/project.pb.d.ts +67 -5
  4. package/dist/weaveapi/project/v1/project.pb.js +764 -65
  5. package/dist/weaveapi/project/v1/service.pb.d.ts +110 -69
  6. package/dist/weaveapi/project/v1/service.pb.js +1056 -392
  7. package/dist/weaveapi/task/v1/service.pb.d.ts +171 -0
  8. package/dist/weaveapi/task/v1/service.pb.js +1416 -0
  9. package/dist/weaveapi/task/v1/task.pb.d.ts +84 -0
  10. package/dist/weaveapi/task/v1/task.pb.js +782 -0
  11. package/dist/weavesql/atcdb/event_sql.d.ts +10 -0
  12. package/dist/weavesql/atcdb/event_sql.js +11 -1
  13. package/dist/weavesql/atcdb/mailbox_sql.d.ts +2 -2
  14. package/dist/weavesql/atcdb/mailbox_sql.js +1 -1
  15. package/dist/weavesql/weavedb/project_sql.d.ts +121 -46
  16. package/dist/weavesql/weavedb/project_sql.js +304 -112
  17. package/dist/weavesql/weavedb/task_sql.d.ts +163 -0
  18. package/dist/weavesql/weavedb/task_sql.js +328 -0
  19. package/package.json +1 -1
  20. package/dist/weaveapi/auth/v1/service.pb.d.ts +0 -709
  21. package/dist/weaveapi/auth/v1/service.pb.js +0 -5058
  22. package/dist/weaveapi/auth/v1/session.pb.d.ts +0 -43
  23. package/dist/weaveapi/auth/v1/session.pb.js +0 -308
  24. package/dist/weaveapi/auth/v1/usage.pb.d.ts +0 -76
  25. package/dist/weaveapi/auth/v1/usage.pb.js +0 -849
  26. package/dist/weaveapi/auth/v1/user.pb.d.ts +0 -141
  27. package/dist/weaveapi/auth/v1/user.pb.js +0 -1625
  28. package/dist/weaveapi/data/v1/data.pb.d.ts +0 -54
  29. package/dist/weaveapi/data/v1/data.pb.js +0 -411
  30. package/dist/weaveapi/data/v1/service.pb.d.ts +0 -296
  31. package/dist/weaveapi/data/v1/service.pb.js +0 -2777
  32. package/dist/weaveapi/generate/v1/configuration.pb.d.ts +0 -122
  33. package/dist/weaveapi/generate/v1/configuration.pb.js +0 -877
  34. package/dist/weaveapi/generate/v1/generate.pb.d.ts +0 -48
  35. package/dist/weaveapi/generate/v1/generate.pb.js +0 -367
  36. package/dist/weaveapi/generate/v1/service.pb.d.ts +0 -173
  37. package/dist/weaveapi/generate/v1/service.pb.js +0 -1207
  38. package/dist/weaveapi/input/v1/input.pb.d.ts +0 -77
  39. package/dist/weaveapi/input/v1/input.pb.js +0 -632
  40. package/dist/weaveapi/input/v1/service.pb.d.ts +0 -390
  41. package/dist/weaveapi/input/v1/service.pb.js +0 -3610
  42. package/dist/weaveapi/integration/v1/integration.pb.d.ts +0 -67
  43. package/dist/weaveapi/integration/v1/integration.pb.js +0 -486
  44. package/dist/weaveapi/integration/v1/service.pb.d.ts +0 -318
  45. package/dist/weaveapi/integration/v1/service.pb.js +0 -2992
  46. package/dist/weaveapi/llmx/v1/architecture.pb.d.ts +0 -665
  47. package/dist/weaveapi/llmx/v1/architecture.pb.js +0 -3028
  48. package/dist/weaveapi/llmx/v1/capabilities.pb.d.ts +0 -709
  49. package/dist/weaveapi/llmx/v1/capabilities.pb.js +0 -3458
  50. package/dist/weaveapi/llmx/v1/model.pb.d.ts +0 -375
  51. package/dist/weaveapi/llmx/v1/model.pb.js +0 -1472
  52. package/dist/weaveapi/llmx/v1/pricing.pb.d.ts +0 -340
  53. package/dist/weaveapi/llmx/v1/pricing.pb.js +0 -974
  54. package/dist/weaveapi/llmx/v1/provider.pb.d.ts +0 -72
  55. package/dist/weaveapi/llmx/v1/provider.pb.js +0 -218
  56. package/dist/weaveapi/llmx/v1/service.pb.d.ts +0 -683
  57. package/dist/weaveapi/llmx/v1/service.pb.js +0 -5311
  58. package/dist/weaveapi/mcpregistry/v1/server.pb.d.ts +0 -54
  59. package/dist/weaveapi/mcpregistry/v1/server.pb.js +0 -436
  60. package/dist/weaveapi/mcpregistry/v1/service.pb.d.ts +0 -171
  61. package/dist/weaveapi/mcpregistry/v1/service.pb.js +0 -963
  62. package/dist/weaveapi/payment/v1/invoice.pb.d.ts +0 -92
  63. package/dist/weaveapi/payment/v1/invoice.pb.js +0 -998
  64. package/dist/weaveapi/payment/v1/service.pb.d.ts +0 -662
  65. package/dist/weaveapi/payment/v1/service.pb.js +0 -5395
  66. package/dist/weaveapi/payment/v1/subscription.pb.d.ts +0 -165
  67. package/dist/weaveapi/payment/v1/subscription.pb.js +0 -1930
  68. package/dist/weaveapi/report/v1/report.pb.d.ts +0 -81
  69. package/dist/weaveapi/report/v1/report.pb.js +0 -678
  70. package/dist/weaveapi/report/v1/service.pb.d.ts +0 -194
  71. package/dist/weaveapi/report/v1/service.pb.js +0 -1923
  72. package/dist/weaveapi/requirement/v1/requirement.pb.d.ts +0 -70
  73. package/dist/weaveapi/requirement/v1/requirement.pb.js +0 -570
  74. package/dist/weaveapi/requirement/v1/service.pb.d.ts +0 -390
  75. package/dist/weaveapi/requirement/v1/service.pb.js +0 -3636
  76. package/dist/weaveapi/run/v1/run.pb.d.ts +0 -117
  77. package/dist/weaveapi/run/v1/run.pb.js +0 -1155
  78. package/dist/weaveapi/run/v1/service.pb.d.ts +0 -229
  79. package/dist/weaveapi/run/v1/service.pb.js +0 -2426
  80. package/dist/weaveapi/script/v1/script.pb.d.ts +0 -102
  81. package/dist/weaveapi/script/v1/script.pb.js +0 -1025
  82. package/dist/weaveapi/script/v1/service.pb.d.ts +0 -502
  83. package/dist/weaveapi/script/v1/service.pb.js +0 -4871
  84. package/dist/weaveapi/storage/v1/auth.pb.d.ts +0 -27
  85. package/dist/weaveapi/storage/v1/auth.pb.js +0 -110
  86. package/dist/weaveapi/storage/v1/nosql_database.pb.d.ts +0 -91
  87. package/dist/weaveapi/storage/v1/nosql_database.pb.js +0 -1056
  88. package/dist/weaveapi/storage/v1/object_store.pb.d.ts +0 -49
  89. package/dist/weaveapi/storage/v1/object_store.pb.js +0 -441
  90. package/dist/weaveapi/storage/v1/service.pb.d.ts +0 -245
  91. package/dist/weaveapi/storage/v1/service.pb.js +0 -1339
  92. package/dist/weaveapi/storage/v1/sql_database.pb.d.ts +0 -98
  93. package/dist/weaveapi/storage/v1/sql_database.pb.js +0 -1184
  94. package/dist/weaveapi/storage/v1/storage.pb.d.ts +0 -35
  95. package/dist/weaveapi/storage/v1/storage.pb.js +0 -198
  96. package/dist/weaveapi/storage/v1/vcs.pb.d.ts +0 -75
  97. package/dist/weaveapi/storage/v1/vcs.pb.js +0 -864
  98. package/dist/weaveapi/suite/v1/service.pb.d.ts +0 -539
  99. package/dist/weaveapi/suite/v1/service.pb.js +0 -5279
  100. package/dist/weaveapi/suite/v1/suite.pb.d.ts +0 -92
  101. package/dist/weaveapi/suite/v1/suite.pb.js +0 -876
  102. package/dist/weaveapi/synthesize/v1/dataset.pb.d.ts +0 -68
  103. package/dist/weaveapi/synthesize/v1/dataset.pb.js +0 -460
  104. package/dist/weaveapi/synthesize/v1/inline_data.pb.d.ts +0 -45
  105. package/dist/weaveapi/synthesize/v1/inline_data.pb.js +0 -166
  106. package/dist/weaveapi/synthesize/v1/relationship.pb.d.ts +0 -58
  107. package/dist/weaveapi/synthesize/v1/relationship.pb.js +0 -253
  108. package/dist/weaveapi/synthesize/v1/service.pb.d.ts +0 -144
  109. package/dist/weaveapi/synthesize/v1/service.pb.js +0 -937
  110. package/dist/weaveapi/synthesize/v1/training.pb.d.ts +0 -58
  111. package/dist/weaveapi/synthesize/v1/training.pb.js +0 -386
  112. package/dist/weaveapi/testcase/v1/service.pb.d.ts +0 -498
  113. package/dist/weaveapi/testcase/v1/service.pb.js +0 -4728
  114. package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +0 -91
  115. package/dist/weaveapi/testcase/v1/testcase.pb.js +0 -794
  116. package/dist/weaveapi/workflow/v1/service.pb.d.ts +0 -261
  117. package/dist/weaveapi/workflow/v1/service.pb.js +0 -2120
  118. package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +0 -77
  119. package/dist/weaveapi/workflow/v1/workflow.pb.js +0 -555
  120. package/dist/weaveapi/workflowdata/v1/service.pb.d.ts +0 -295
  121. package/dist/weaveapi/workflowdata/v1/service.pb.js +0 -2612
@@ -1,998 +0,0 @@
1
- "use strict";
2
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
- // versions:
4
- // protoc-gen-ts_proto v2.11.6
5
- // protoc unknown
6
- // source: weaveapi/payment/v1/invoice.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.TaxRate = exports.InvoiceLineItem = exports.Invoice_MetadataEntry = exports.Invoice = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- const timestamp_pb_1 = require("../../../google/protobuf/timestamp.pb");
12
- const subscription_pb_1 = require("./subscription.pb");
13
- exports.protobufPackage = "weaveapi.payment.v1";
14
- function createBaseInvoice() {
15
- return {
16
- id: "",
17
- number: "",
18
- status: "",
19
- subtotalCents: 0,
20
- taxCents: 0,
21
- totalCents: 0,
22
- amountPaidCents: 0,
23
- amountDueCents: 0,
24
- currency: "",
25
- createdAt: undefined,
26
- periodStart: undefined,
27
- periodEnd: undefined,
28
- dueDate: undefined,
29
- paidAt: undefined,
30
- lineItems: [],
31
- paymentMethod: undefined,
32
- paymentIntentId: "",
33
- pdfUrl: "",
34
- hostedInvoiceUrl: "",
35
- discount: undefined,
36
- taxRates: [],
37
- taxId: "",
38
- metadata: {},
39
- };
40
- }
41
- exports.Invoice = {
42
- encode(message, writer = new wire_1.BinaryWriter()) {
43
- if (message.id !== "") {
44
- writer.uint32(10).string(message.id);
45
- }
46
- if (message.number !== "") {
47
- writer.uint32(18).string(message.number);
48
- }
49
- if (message.status !== "") {
50
- writer.uint32(26).string(message.status);
51
- }
52
- if (message.subtotalCents !== 0) {
53
- writer.uint32(32).int64(message.subtotalCents);
54
- }
55
- if (message.taxCents !== 0) {
56
- writer.uint32(40).int64(message.taxCents);
57
- }
58
- if (message.totalCents !== 0) {
59
- writer.uint32(48).int64(message.totalCents);
60
- }
61
- if (message.amountPaidCents !== 0) {
62
- writer.uint32(56).int64(message.amountPaidCents);
63
- }
64
- if (message.amountDueCents !== 0) {
65
- writer.uint32(64).int64(message.amountDueCents);
66
- }
67
- if (message.currency !== "") {
68
- writer.uint32(74).string(message.currency);
69
- }
70
- if (message.createdAt !== undefined) {
71
- timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
72
- }
73
- if (message.periodStart !== undefined) {
74
- timestamp_pb_1.Timestamp.encode(toTimestamp(message.periodStart), writer.uint32(90).fork()).join();
75
- }
76
- if (message.periodEnd !== undefined) {
77
- timestamp_pb_1.Timestamp.encode(toTimestamp(message.periodEnd), writer.uint32(98).fork()).join();
78
- }
79
- if (message.dueDate !== undefined) {
80
- timestamp_pb_1.Timestamp.encode(toTimestamp(message.dueDate), writer.uint32(106).fork()).join();
81
- }
82
- if (message.paidAt !== undefined) {
83
- timestamp_pb_1.Timestamp.encode(toTimestamp(message.paidAt), writer.uint32(114).fork()).join();
84
- }
85
- for (const v of message.lineItems) {
86
- exports.InvoiceLineItem.encode(v, writer.uint32(122).fork()).join();
87
- }
88
- if (message.paymentMethod !== undefined) {
89
- subscription_pb_1.PaymentMethod.encode(message.paymentMethod, writer.uint32(130).fork()).join();
90
- }
91
- if (message.paymentIntentId !== "") {
92
- writer.uint32(138).string(message.paymentIntentId);
93
- }
94
- if (message.pdfUrl !== "") {
95
- writer.uint32(146).string(message.pdfUrl);
96
- }
97
- if (message.hostedInvoiceUrl !== "") {
98
- writer.uint32(154).string(message.hostedInvoiceUrl);
99
- }
100
- if (message.discount !== undefined) {
101
- subscription_pb_1.Discount.encode(message.discount, writer.uint32(162).fork()).join();
102
- }
103
- for (const v of message.taxRates) {
104
- exports.TaxRate.encode(v, writer.uint32(170).fork()).join();
105
- }
106
- if (message.taxId !== "") {
107
- writer.uint32(178).string(message.taxId);
108
- }
109
- globalThis.Object.entries(message.metadata).forEach(([key, value]) => {
110
- exports.Invoice_MetadataEntry.encode({ key: key, value }, writer.uint32(186).fork()).join();
111
- });
112
- return writer;
113
- },
114
- decode(input, length) {
115
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
116
- const end = length === undefined ? reader.len : reader.pos + length;
117
- const message = createBaseInvoice();
118
- while (reader.pos < end) {
119
- const tag = reader.uint32();
120
- switch (tag >>> 3) {
121
- case 1: {
122
- if (tag !== 10) {
123
- break;
124
- }
125
- message.id = reader.string();
126
- continue;
127
- }
128
- case 2: {
129
- if (tag !== 18) {
130
- break;
131
- }
132
- message.number = reader.string();
133
- continue;
134
- }
135
- case 3: {
136
- if (tag !== 26) {
137
- break;
138
- }
139
- message.status = reader.string();
140
- continue;
141
- }
142
- case 4: {
143
- if (tag !== 32) {
144
- break;
145
- }
146
- message.subtotalCents = longToNumber(reader.int64());
147
- continue;
148
- }
149
- case 5: {
150
- if (tag !== 40) {
151
- break;
152
- }
153
- message.taxCents = longToNumber(reader.int64());
154
- continue;
155
- }
156
- case 6: {
157
- if (tag !== 48) {
158
- break;
159
- }
160
- message.totalCents = longToNumber(reader.int64());
161
- continue;
162
- }
163
- case 7: {
164
- if (tag !== 56) {
165
- break;
166
- }
167
- message.amountPaidCents = longToNumber(reader.int64());
168
- continue;
169
- }
170
- case 8: {
171
- if (tag !== 64) {
172
- break;
173
- }
174
- message.amountDueCents = longToNumber(reader.int64());
175
- continue;
176
- }
177
- case 9: {
178
- if (tag !== 74) {
179
- break;
180
- }
181
- message.currency = reader.string();
182
- continue;
183
- }
184
- case 10: {
185
- if (tag !== 82) {
186
- break;
187
- }
188
- message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
189
- continue;
190
- }
191
- case 11: {
192
- if (tag !== 90) {
193
- break;
194
- }
195
- message.periodStart = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
196
- continue;
197
- }
198
- case 12: {
199
- if (tag !== 98) {
200
- break;
201
- }
202
- message.periodEnd = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
203
- continue;
204
- }
205
- case 13: {
206
- if (tag !== 106) {
207
- break;
208
- }
209
- message.dueDate = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
210
- continue;
211
- }
212
- case 14: {
213
- if (tag !== 114) {
214
- break;
215
- }
216
- message.paidAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
217
- continue;
218
- }
219
- case 15: {
220
- if (tag !== 122) {
221
- break;
222
- }
223
- message.lineItems.push(exports.InvoiceLineItem.decode(reader, reader.uint32()));
224
- continue;
225
- }
226
- case 16: {
227
- if (tag !== 130) {
228
- break;
229
- }
230
- message.paymentMethod = subscription_pb_1.PaymentMethod.decode(reader, reader.uint32());
231
- continue;
232
- }
233
- case 17: {
234
- if (tag !== 138) {
235
- break;
236
- }
237
- message.paymentIntentId = reader.string();
238
- continue;
239
- }
240
- case 18: {
241
- if (tag !== 146) {
242
- break;
243
- }
244
- message.pdfUrl = reader.string();
245
- continue;
246
- }
247
- case 19: {
248
- if (tag !== 154) {
249
- break;
250
- }
251
- message.hostedInvoiceUrl = reader.string();
252
- continue;
253
- }
254
- case 20: {
255
- if (tag !== 162) {
256
- break;
257
- }
258
- message.discount = subscription_pb_1.Discount.decode(reader, reader.uint32());
259
- continue;
260
- }
261
- case 21: {
262
- if (tag !== 170) {
263
- break;
264
- }
265
- message.taxRates.push(exports.TaxRate.decode(reader, reader.uint32()));
266
- continue;
267
- }
268
- case 22: {
269
- if (tag !== 178) {
270
- break;
271
- }
272
- message.taxId = reader.string();
273
- continue;
274
- }
275
- case 23: {
276
- if (tag !== 186) {
277
- break;
278
- }
279
- const entry23 = exports.Invoice_MetadataEntry.decode(reader, reader.uint32());
280
- if (entry23.value !== undefined) {
281
- message.metadata[entry23.key] = entry23.value;
282
- }
283
- continue;
284
- }
285
- }
286
- if ((tag & 7) === 4 || tag === 0) {
287
- break;
288
- }
289
- reader.skip(tag & 7);
290
- }
291
- return message;
292
- },
293
- fromJSON(object) {
294
- return {
295
- id: isSet(object.id) ? globalThis.String(object.id) : "",
296
- number: isSet(object.number) ? globalThis.String(object.number) : "",
297
- status: isSet(object.status) ? globalThis.String(object.status) : "",
298
- subtotalCents: isSet(object.subtotalCents)
299
- ? globalThis.Number(object.subtotalCents)
300
- : isSet(object.subtotal_cents)
301
- ? globalThis.Number(object.subtotal_cents)
302
- : 0,
303
- taxCents: isSet(object.taxCents)
304
- ? globalThis.Number(object.taxCents)
305
- : isSet(object.tax_cents)
306
- ? globalThis.Number(object.tax_cents)
307
- : 0,
308
- totalCents: isSet(object.totalCents)
309
- ? globalThis.Number(object.totalCents)
310
- : isSet(object.total_cents)
311
- ? globalThis.Number(object.total_cents)
312
- : 0,
313
- amountPaidCents: isSet(object.amountPaidCents)
314
- ? globalThis.Number(object.amountPaidCents)
315
- : isSet(object.amount_paid_cents)
316
- ? globalThis.Number(object.amount_paid_cents)
317
- : 0,
318
- amountDueCents: isSet(object.amountDueCents)
319
- ? globalThis.Number(object.amountDueCents)
320
- : isSet(object.amount_due_cents)
321
- ? globalThis.Number(object.amount_due_cents)
322
- : 0,
323
- currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
324
- createdAt: isSet(object.createdAt)
325
- ? fromJsonTimestamp(object.createdAt)
326
- : isSet(object.created_at)
327
- ? fromJsonTimestamp(object.created_at)
328
- : undefined,
329
- periodStart: isSet(object.periodStart)
330
- ? fromJsonTimestamp(object.periodStart)
331
- : isSet(object.period_start)
332
- ? fromJsonTimestamp(object.period_start)
333
- : undefined,
334
- periodEnd: isSet(object.periodEnd)
335
- ? fromJsonTimestamp(object.periodEnd)
336
- : isSet(object.period_end)
337
- ? fromJsonTimestamp(object.period_end)
338
- : undefined,
339
- dueDate: isSet(object.dueDate)
340
- ? fromJsonTimestamp(object.dueDate)
341
- : isSet(object.due_date)
342
- ? fromJsonTimestamp(object.due_date)
343
- : undefined,
344
- paidAt: isSet(object.paidAt)
345
- ? fromJsonTimestamp(object.paidAt)
346
- : isSet(object.paid_at)
347
- ? fromJsonTimestamp(object.paid_at)
348
- : undefined,
349
- lineItems: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.lineItems)
350
- ? object.lineItems.map((e) => exports.InvoiceLineItem.fromJSON(e))
351
- : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.line_items)
352
- ? object.line_items.map((e) => exports.InvoiceLineItem.fromJSON(e))
353
- : [],
354
- paymentMethod: isSet(object.paymentMethod)
355
- ? subscription_pb_1.PaymentMethod.fromJSON(object.paymentMethod)
356
- : isSet(object.payment_method)
357
- ? subscription_pb_1.PaymentMethod.fromJSON(object.payment_method)
358
- : undefined,
359
- paymentIntentId: isSet(object.paymentIntentId)
360
- ? globalThis.String(object.paymentIntentId)
361
- : isSet(object.payment_intent_id)
362
- ? globalThis.String(object.payment_intent_id)
363
- : "",
364
- pdfUrl: isSet(object.pdfUrl)
365
- ? globalThis.String(object.pdfUrl)
366
- : isSet(object.pdf_url)
367
- ? globalThis.String(object.pdf_url)
368
- : "",
369
- hostedInvoiceUrl: isSet(object.hostedInvoiceUrl)
370
- ? globalThis.String(object.hostedInvoiceUrl)
371
- : isSet(object.hosted_invoice_url)
372
- ? globalThis.String(object.hosted_invoice_url)
373
- : "",
374
- discount: isSet(object.discount) ? subscription_pb_1.Discount.fromJSON(object.discount) : undefined,
375
- taxRates: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.taxRates)
376
- ? object.taxRates.map((e) => exports.TaxRate.fromJSON(e))
377
- : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.tax_rates)
378
- ? object.tax_rates.map((e) => exports.TaxRate.fromJSON(e))
379
- : [],
380
- taxId: isSet(object.taxId)
381
- ? globalThis.String(object.taxId)
382
- : isSet(object.tax_id)
383
- ? globalThis.String(object.tax_id)
384
- : "",
385
- metadata: isObject(object.metadata)
386
- ? globalThis.Object.entries(object.metadata).reduce((acc, [key, value]) => {
387
- acc[key] = globalThis.String(value);
388
- return acc;
389
- }, {})
390
- : {},
391
- };
392
- },
393
- toJSON(message) {
394
- var _a, _b;
395
- const obj = {};
396
- if (message.id !== "") {
397
- obj.id = message.id;
398
- }
399
- if (message.number !== "") {
400
- obj.number = message.number;
401
- }
402
- if (message.status !== "") {
403
- obj.status = message.status;
404
- }
405
- if (message.subtotalCents !== 0) {
406
- obj.subtotalCents = Math.round(message.subtotalCents);
407
- }
408
- if (message.taxCents !== 0) {
409
- obj.taxCents = Math.round(message.taxCents);
410
- }
411
- if (message.totalCents !== 0) {
412
- obj.totalCents = Math.round(message.totalCents);
413
- }
414
- if (message.amountPaidCents !== 0) {
415
- obj.amountPaidCents = Math.round(message.amountPaidCents);
416
- }
417
- if (message.amountDueCents !== 0) {
418
- obj.amountDueCents = Math.round(message.amountDueCents);
419
- }
420
- if (message.currency !== "") {
421
- obj.currency = message.currency;
422
- }
423
- if (message.createdAt !== undefined) {
424
- obj.createdAt = message.createdAt.toISOString();
425
- }
426
- if (message.periodStart !== undefined) {
427
- obj.periodStart = message.periodStart.toISOString();
428
- }
429
- if (message.periodEnd !== undefined) {
430
- obj.periodEnd = message.periodEnd.toISOString();
431
- }
432
- if (message.dueDate !== undefined) {
433
- obj.dueDate = message.dueDate.toISOString();
434
- }
435
- if (message.paidAt !== undefined) {
436
- obj.paidAt = message.paidAt.toISOString();
437
- }
438
- if ((_a = message.lineItems) === null || _a === void 0 ? void 0 : _a.length) {
439
- obj.lineItems = message.lineItems.map((e) => exports.InvoiceLineItem.toJSON(e));
440
- }
441
- if (message.paymentMethod !== undefined) {
442
- obj.paymentMethod = subscription_pb_1.PaymentMethod.toJSON(message.paymentMethod);
443
- }
444
- if (message.paymentIntentId !== "") {
445
- obj.paymentIntentId = message.paymentIntentId;
446
- }
447
- if (message.pdfUrl !== "") {
448
- obj.pdfUrl = message.pdfUrl;
449
- }
450
- if (message.hostedInvoiceUrl !== "") {
451
- obj.hostedInvoiceUrl = message.hostedInvoiceUrl;
452
- }
453
- if (message.discount !== undefined) {
454
- obj.discount = subscription_pb_1.Discount.toJSON(message.discount);
455
- }
456
- if ((_b = message.taxRates) === null || _b === void 0 ? void 0 : _b.length) {
457
- obj.taxRates = message.taxRates.map((e) => exports.TaxRate.toJSON(e));
458
- }
459
- if (message.taxId !== "") {
460
- obj.taxId = message.taxId;
461
- }
462
- if (message.metadata) {
463
- const entries = globalThis.Object.entries(message.metadata);
464
- if (entries.length > 0) {
465
- obj.metadata = {};
466
- entries.forEach(([k, v]) => {
467
- obj.metadata[k] = v;
468
- });
469
- }
470
- }
471
- return obj;
472
- },
473
- create(base) {
474
- return exports.Invoice.fromPartial(base !== null && base !== void 0 ? base : {});
475
- },
476
- fromPartial(object) {
477
- var _a, _b;
478
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
479
- const message = createBaseInvoice();
480
- message.id = (_c = object.id) !== null && _c !== void 0 ? _c : "";
481
- message.number = (_d = object.number) !== null && _d !== void 0 ? _d : "";
482
- message.status = (_e = object.status) !== null && _e !== void 0 ? _e : "";
483
- message.subtotalCents = (_f = object.subtotalCents) !== null && _f !== void 0 ? _f : 0;
484
- message.taxCents = (_g = object.taxCents) !== null && _g !== void 0 ? _g : 0;
485
- message.totalCents = (_h = object.totalCents) !== null && _h !== void 0 ? _h : 0;
486
- message.amountPaidCents = (_j = object.amountPaidCents) !== null && _j !== void 0 ? _j : 0;
487
- message.amountDueCents = (_k = object.amountDueCents) !== null && _k !== void 0 ? _k : 0;
488
- message.currency = (_l = object.currency) !== null && _l !== void 0 ? _l : "";
489
- message.createdAt = (_m = object.createdAt) !== null && _m !== void 0 ? _m : undefined;
490
- message.periodStart = (_o = object.periodStart) !== null && _o !== void 0 ? _o : undefined;
491
- message.periodEnd = (_p = object.periodEnd) !== null && _p !== void 0 ? _p : undefined;
492
- message.dueDate = (_q = object.dueDate) !== null && _q !== void 0 ? _q : undefined;
493
- message.paidAt = (_r = object.paidAt) !== null && _r !== void 0 ? _r : undefined;
494
- message.lineItems = ((_a = object.lineItems) === null || _a === void 0 ? void 0 : _a.map((e) => exports.InvoiceLineItem.fromPartial(e))) || [];
495
- message.paymentMethod = (object.paymentMethod !== undefined && object.paymentMethod !== null)
496
- ? subscription_pb_1.PaymentMethod.fromPartial(object.paymentMethod)
497
- : undefined;
498
- message.paymentIntentId = (_s = object.paymentIntentId) !== null && _s !== void 0 ? _s : "";
499
- message.pdfUrl = (_t = object.pdfUrl) !== null && _t !== void 0 ? _t : "";
500
- message.hostedInvoiceUrl = (_u = object.hostedInvoiceUrl) !== null && _u !== void 0 ? _u : "";
501
- message.discount = (object.discount !== undefined && object.discount !== null)
502
- ? subscription_pb_1.Discount.fromPartial(object.discount)
503
- : undefined;
504
- message.taxRates = ((_b = object.taxRates) === null || _b === void 0 ? void 0 : _b.map((e) => exports.TaxRate.fromPartial(e))) || [];
505
- message.taxId = (_v = object.taxId) !== null && _v !== void 0 ? _v : "";
506
- message.metadata = globalThis.Object.entries((_w = object.metadata) !== null && _w !== void 0 ? _w : {}).reduce((acc, [key, value]) => {
507
- if (value !== undefined) {
508
- acc[key] = globalThis.String(value);
509
- }
510
- return acc;
511
- }, {});
512
- return message;
513
- },
514
- };
515
- function createBaseInvoice_MetadataEntry() {
516
- return { key: "", value: "" };
517
- }
518
- exports.Invoice_MetadataEntry = {
519
- encode(message, writer = new wire_1.BinaryWriter()) {
520
- if (message.key !== "") {
521
- writer.uint32(10).string(message.key);
522
- }
523
- if (message.value !== "") {
524
- writer.uint32(18).string(message.value);
525
- }
526
- return writer;
527
- },
528
- decode(input, length) {
529
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
530
- const end = length === undefined ? reader.len : reader.pos + length;
531
- const message = createBaseInvoice_MetadataEntry();
532
- while (reader.pos < end) {
533
- const tag = reader.uint32();
534
- switch (tag >>> 3) {
535
- case 1: {
536
- if (tag !== 10) {
537
- break;
538
- }
539
- message.key = reader.string();
540
- continue;
541
- }
542
- case 2: {
543
- if (tag !== 18) {
544
- break;
545
- }
546
- message.value = reader.string();
547
- continue;
548
- }
549
- }
550
- if ((tag & 7) === 4 || tag === 0) {
551
- break;
552
- }
553
- reader.skip(tag & 7);
554
- }
555
- return message;
556
- },
557
- fromJSON(object) {
558
- return {
559
- key: isSet(object.key) ? globalThis.String(object.key) : "",
560
- value: isSet(object.value) ? globalThis.String(object.value) : "",
561
- };
562
- },
563
- toJSON(message) {
564
- const obj = {};
565
- if (message.key !== "") {
566
- obj.key = message.key;
567
- }
568
- if (message.value !== "") {
569
- obj.value = message.value;
570
- }
571
- return obj;
572
- },
573
- create(base) {
574
- return exports.Invoice_MetadataEntry.fromPartial(base !== null && base !== void 0 ? base : {});
575
- },
576
- fromPartial(object) {
577
- var _a, _b;
578
- const message = createBaseInvoice_MetadataEntry();
579
- message.key = (_a = object.key) !== null && _a !== void 0 ? _a : "";
580
- message.value = (_b = object.value) !== null && _b !== void 0 ? _b : "";
581
- return message;
582
- },
583
- };
584
- function createBaseInvoiceLineItem() {
585
- return {
586
- id: "",
587
- description: "",
588
- amountCents: 0,
589
- currency: "",
590
- quantity: 0,
591
- unitAmountCents: 0,
592
- periodStart: undefined,
593
- periodEnd: undefined,
594
- productId: "",
595
- priceId: "",
596
- proration: false,
597
- prorationDetails: "",
598
- };
599
- }
600
- exports.InvoiceLineItem = {
601
- encode(message, writer = new wire_1.BinaryWriter()) {
602
- if (message.id !== "") {
603
- writer.uint32(10).string(message.id);
604
- }
605
- if (message.description !== "") {
606
- writer.uint32(18).string(message.description);
607
- }
608
- if (message.amountCents !== 0) {
609
- writer.uint32(24).int64(message.amountCents);
610
- }
611
- if (message.currency !== "") {
612
- writer.uint32(34).string(message.currency);
613
- }
614
- if (message.quantity !== 0) {
615
- writer.uint32(40).int32(message.quantity);
616
- }
617
- if (message.unitAmountCents !== 0) {
618
- writer.uint32(48).int64(message.unitAmountCents);
619
- }
620
- if (message.periodStart !== undefined) {
621
- timestamp_pb_1.Timestamp.encode(toTimestamp(message.periodStart), writer.uint32(58).fork()).join();
622
- }
623
- if (message.periodEnd !== undefined) {
624
- timestamp_pb_1.Timestamp.encode(toTimestamp(message.periodEnd), writer.uint32(66).fork()).join();
625
- }
626
- if (message.productId !== "") {
627
- writer.uint32(74).string(message.productId);
628
- }
629
- if (message.priceId !== "") {
630
- writer.uint32(82).string(message.priceId);
631
- }
632
- if (message.proration !== false) {
633
- writer.uint32(88).bool(message.proration);
634
- }
635
- if (message.prorationDetails !== "") {
636
- writer.uint32(98).string(message.prorationDetails);
637
- }
638
- return writer;
639
- },
640
- decode(input, length) {
641
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
642
- const end = length === undefined ? reader.len : reader.pos + length;
643
- const message = createBaseInvoiceLineItem();
644
- while (reader.pos < end) {
645
- const tag = reader.uint32();
646
- switch (tag >>> 3) {
647
- case 1: {
648
- if (tag !== 10) {
649
- break;
650
- }
651
- message.id = reader.string();
652
- continue;
653
- }
654
- case 2: {
655
- if (tag !== 18) {
656
- break;
657
- }
658
- message.description = reader.string();
659
- continue;
660
- }
661
- case 3: {
662
- if (tag !== 24) {
663
- break;
664
- }
665
- message.amountCents = longToNumber(reader.int64());
666
- continue;
667
- }
668
- case 4: {
669
- if (tag !== 34) {
670
- break;
671
- }
672
- message.currency = reader.string();
673
- continue;
674
- }
675
- case 5: {
676
- if (tag !== 40) {
677
- break;
678
- }
679
- message.quantity = reader.int32();
680
- continue;
681
- }
682
- case 6: {
683
- if (tag !== 48) {
684
- break;
685
- }
686
- message.unitAmountCents = longToNumber(reader.int64());
687
- continue;
688
- }
689
- case 7: {
690
- if (tag !== 58) {
691
- break;
692
- }
693
- message.periodStart = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
694
- continue;
695
- }
696
- case 8: {
697
- if (tag !== 66) {
698
- break;
699
- }
700
- message.periodEnd = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
701
- continue;
702
- }
703
- case 9: {
704
- if (tag !== 74) {
705
- break;
706
- }
707
- message.productId = reader.string();
708
- continue;
709
- }
710
- case 10: {
711
- if (tag !== 82) {
712
- break;
713
- }
714
- message.priceId = reader.string();
715
- continue;
716
- }
717
- case 11: {
718
- if (tag !== 88) {
719
- break;
720
- }
721
- message.proration = reader.bool();
722
- continue;
723
- }
724
- case 12: {
725
- if (tag !== 98) {
726
- break;
727
- }
728
- message.prorationDetails = reader.string();
729
- continue;
730
- }
731
- }
732
- if ((tag & 7) === 4 || tag === 0) {
733
- break;
734
- }
735
- reader.skip(tag & 7);
736
- }
737
- return message;
738
- },
739
- fromJSON(object) {
740
- return {
741
- id: isSet(object.id) ? globalThis.String(object.id) : "",
742
- description: isSet(object.description) ? globalThis.String(object.description) : "",
743
- amountCents: isSet(object.amountCents)
744
- ? globalThis.Number(object.amountCents)
745
- : isSet(object.amount_cents)
746
- ? globalThis.Number(object.amount_cents)
747
- : 0,
748
- currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
749
- quantity: isSet(object.quantity) ? globalThis.Number(object.quantity) : 0,
750
- unitAmountCents: isSet(object.unitAmountCents)
751
- ? globalThis.Number(object.unitAmountCents)
752
- : isSet(object.unit_amount_cents)
753
- ? globalThis.Number(object.unit_amount_cents)
754
- : 0,
755
- periodStart: isSet(object.periodStart)
756
- ? fromJsonTimestamp(object.periodStart)
757
- : isSet(object.period_start)
758
- ? fromJsonTimestamp(object.period_start)
759
- : undefined,
760
- periodEnd: isSet(object.periodEnd)
761
- ? fromJsonTimestamp(object.periodEnd)
762
- : isSet(object.period_end)
763
- ? fromJsonTimestamp(object.period_end)
764
- : undefined,
765
- productId: isSet(object.productId)
766
- ? globalThis.String(object.productId)
767
- : isSet(object.product_id)
768
- ? globalThis.String(object.product_id)
769
- : "",
770
- priceId: isSet(object.priceId)
771
- ? globalThis.String(object.priceId)
772
- : isSet(object.price_id)
773
- ? globalThis.String(object.price_id)
774
- : "",
775
- proration: isSet(object.proration) ? globalThis.Boolean(object.proration) : false,
776
- prorationDetails: isSet(object.prorationDetails)
777
- ? globalThis.String(object.prorationDetails)
778
- : isSet(object.proration_details)
779
- ? globalThis.String(object.proration_details)
780
- : "",
781
- };
782
- },
783
- toJSON(message) {
784
- const obj = {};
785
- if (message.id !== "") {
786
- obj.id = message.id;
787
- }
788
- if (message.description !== "") {
789
- obj.description = message.description;
790
- }
791
- if (message.amountCents !== 0) {
792
- obj.amountCents = Math.round(message.amountCents);
793
- }
794
- if (message.currency !== "") {
795
- obj.currency = message.currency;
796
- }
797
- if (message.quantity !== 0) {
798
- obj.quantity = Math.round(message.quantity);
799
- }
800
- if (message.unitAmountCents !== 0) {
801
- obj.unitAmountCents = Math.round(message.unitAmountCents);
802
- }
803
- if (message.periodStart !== undefined) {
804
- obj.periodStart = message.periodStart.toISOString();
805
- }
806
- if (message.periodEnd !== undefined) {
807
- obj.periodEnd = message.periodEnd.toISOString();
808
- }
809
- if (message.productId !== "") {
810
- obj.productId = message.productId;
811
- }
812
- if (message.priceId !== "") {
813
- obj.priceId = message.priceId;
814
- }
815
- if (message.proration !== false) {
816
- obj.proration = message.proration;
817
- }
818
- if (message.prorationDetails !== "") {
819
- obj.prorationDetails = message.prorationDetails;
820
- }
821
- return obj;
822
- },
823
- create(base) {
824
- return exports.InvoiceLineItem.fromPartial(base !== null && base !== void 0 ? base : {});
825
- },
826
- fromPartial(object) {
827
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
828
- const message = createBaseInvoiceLineItem();
829
- message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
830
- message.description = (_b = object.description) !== null && _b !== void 0 ? _b : "";
831
- message.amountCents = (_c = object.amountCents) !== null && _c !== void 0 ? _c : 0;
832
- message.currency = (_d = object.currency) !== null && _d !== void 0 ? _d : "";
833
- message.quantity = (_e = object.quantity) !== null && _e !== void 0 ? _e : 0;
834
- message.unitAmountCents = (_f = object.unitAmountCents) !== null && _f !== void 0 ? _f : 0;
835
- message.periodStart = (_g = object.periodStart) !== null && _g !== void 0 ? _g : undefined;
836
- message.periodEnd = (_h = object.periodEnd) !== null && _h !== void 0 ? _h : undefined;
837
- message.productId = (_j = object.productId) !== null && _j !== void 0 ? _j : "";
838
- message.priceId = (_k = object.priceId) !== null && _k !== void 0 ? _k : "";
839
- message.proration = (_l = object.proration) !== null && _l !== void 0 ? _l : false;
840
- message.prorationDetails = (_m = object.prorationDetails) !== null && _m !== void 0 ? _m : "";
841
- return message;
842
- },
843
- };
844
- function createBaseTaxRate() {
845
- return { id: "", displayName: "", jurisdiction: "", percentage: 0, inclusive: false };
846
- }
847
- exports.TaxRate = {
848
- encode(message, writer = new wire_1.BinaryWriter()) {
849
- if (message.id !== "") {
850
- writer.uint32(10).string(message.id);
851
- }
852
- if (message.displayName !== "") {
853
- writer.uint32(18).string(message.displayName);
854
- }
855
- if (message.jurisdiction !== "") {
856
- writer.uint32(26).string(message.jurisdiction);
857
- }
858
- if (message.percentage !== 0) {
859
- writer.uint32(33).double(message.percentage);
860
- }
861
- if (message.inclusive !== false) {
862
- writer.uint32(40).bool(message.inclusive);
863
- }
864
- return writer;
865
- },
866
- decode(input, length) {
867
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
868
- const end = length === undefined ? reader.len : reader.pos + length;
869
- const message = createBaseTaxRate();
870
- while (reader.pos < end) {
871
- const tag = reader.uint32();
872
- switch (tag >>> 3) {
873
- case 1: {
874
- if (tag !== 10) {
875
- break;
876
- }
877
- message.id = reader.string();
878
- continue;
879
- }
880
- case 2: {
881
- if (tag !== 18) {
882
- break;
883
- }
884
- message.displayName = reader.string();
885
- continue;
886
- }
887
- case 3: {
888
- if (tag !== 26) {
889
- break;
890
- }
891
- message.jurisdiction = reader.string();
892
- continue;
893
- }
894
- case 4: {
895
- if (tag !== 33) {
896
- break;
897
- }
898
- message.percentage = reader.double();
899
- continue;
900
- }
901
- case 5: {
902
- if (tag !== 40) {
903
- break;
904
- }
905
- message.inclusive = reader.bool();
906
- continue;
907
- }
908
- }
909
- if ((tag & 7) === 4 || tag === 0) {
910
- break;
911
- }
912
- reader.skip(tag & 7);
913
- }
914
- return message;
915
- },
916
- fromJSON(object) {
917
- return {
918
- id: isSet(object.id) ? globalThis.String(object.id) : "",
919
- displayName: isSet(object.displayName)
920
- ? globalThis.String(object.displayName)
921
- : isSet(object.display_name)
922
- ? globalThis.String(object.display_name)
923
- : "",
924
- jurisdiction: isSet(object.jurisdiction) ? globalThis.String(object.jurisdiction) : "",
925
- percentage: isSet(object.percentage) ? globalThis.Number(object.percentage) : 0,
926
- inclusive: isSet(object.inclusive) ? globalThis.Boolean(object.inclusive) : false,
927
- };
928
- },
929
- toJSON(message) {
930
- const obj = {};
931
- if (message.id !== "") {
932
- obj.id = message.id;
933
- }
934
- if (message.displayName !== "") {
935
- obj.displayName = message.displayName;
936
- }
937
- if (message.jurisdiction !== "") {
938
- obj.jurisdiction = message.jurisdiction;
939
- }
940
- if (message.percentage !== 0) {
941
- obj.percentage = message.percentage;
942
- }
943
- if (message.inclusive !== false) {
944
- obj.inclusive = message.inclusive;
945
- }
946
- return obj;
947
- },
948
- create(base) {
949
- return exports.TaxRate.fromPartial(base !== null && base !== void 0 ? base : {});
950
- },
951
- fromPartial(object) {
952
- var _a, _b, _c, _d, _e;
953
- const message = createBaseTaxRate();
954
- message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
955
- message.displayName = (_b = object.displayName) !== null && _b !== void 0 ? _b : "";
956
- message.jurisdiction = (_c = object.jurisdiction) !== null && _c !== void 0 ? _c : "";
957
- message.percentage = (_d = object.percentage) !== null && _d !== void 0 ? _d : 0;
958
- message.inclusive = (_e = object.inclusive) !== null && _e !== void 0 ? _e : false;
959
- return message;
960
- },
961
- };
962
- function toTimestamp(date) {
963
- const seconds = Math.trunc(date.getTime() / 1000);
964
- const nanos = (date.getTime() % 1000) * 1000000;
965
- return { seconds, nanos };
966
- }
967
- function fromTimestamp(t) {
968
- let millis = (t.seconds || 0) * 1000;
969
- millis += (t.nanos || 0) / 1000000;
970
- return new globalThis.Date(millis);
971
- }
972
- function fromJsonTimestamp(o) {
973
- if (o instanceof globalThis.Date) {
974
- return o;
975
- }
976
- else if (typeof o === "string") {
977
- return new globalThis.Date(o);
978
- }
979
- else {
980
- return fromTimestamp(timestamp_pb_1.Timestamp.fromJSON(o));
981
- }
982
- }
983
- function longToNumber(int64) {
984
- const num = globalThis.Number(int64.toString());
985
- if (num > globalThis.Number.MAX_SAFE_INTEGER) {
986
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
987
- }
988
- if (num < globalThis.Number.MIN_SAFE_INTEGER) {
989
- throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
990
- }
991
- return num;
992
- }
993
- function isObject(value) {
994
- return typeof value === "object" && value !== null;
995
- }
996
- function isSet(value) {
997
- return value !== null && value !== undefined;
998
- }