@fonoster/sdk 0.27.0 → 0.31.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 (91) hide show
  1. package/README.md +12 -9
  2. package/dist/node/Agents.js +5 -20
  3. package/dist/node/Applications.d.ts +21 -85
  4. package/dist/node/Applications.js +64 -74
  5. package/dist/node/Billing.d.ts +50 -0
  6. package/dist/node/Billing.js +84 -0
  7. package/dist/node/CallRecords.d.ts +92 -0
  8. package/dist/node/CallRecords.js +127 -0
  9. package/dist/node/Calls.d.ts +3 -1
  10. package/dist/node/Calls.js +3 -1
  11. package/dist/node/Domains.js +4 -2
  12. package/dist/node/Numbers.js +2 -7
  13. package/dist/node/Providers.d.ts +49 -0
  14. package/dist/node/Providers.js +109 -0
  15. package/dist/node/Regions.d.ts +91 -0
  16. package/dist/node/Regions.js +127 -0
  17. package/dist/node/Usage.d.ts +44 -0
  18. package/dist/node/Usage.js +41 -0
  19. package/dist/node/Users.d.ts +4 -2
  20. package/dist/node/Users.js +4 -2
  21. package/dist/node/Webhooks.d.ts +56 -0
  22. package/dist/node/Webhooks.js +139 -0
  23. package/dist/node/Workspaces.d.ts +22 -3
  24. package/dist/node/Workspaces.js +29 -2
  25. package/dist/node/client/AbstractClient.d.ts +94 -3
  26. package/dist/node/client/AbstractClient.js +101 -1
  27. package/dist/node/client/Client.d.ts +9 -0
  28. package/dist/node/client/Client.js +34 -1
  29. package/dist/node/client/jsonToObject.js +17 -0
  30. package/dist/node/client/objectToJson.js +35 -0
  31. package/dist/node/client/types/ApplicationsClient.d.ts +2 -1
  32. package/dist/node/client/types/BillingClient.d.ts +28 -0
  33. package/dist/node/client/types/BillingClient.js +2 -0
  34. package/dist/node/client/types/CapabilitiesClient.d.ts +24 -0
  35. package/dist/node/client/types/CapabilitiesClient.js +2 -0
  36. package/dist/node/client/types/FonosterClient.d.ts +12 -0
  37. package/dist/node/client/types/IdentityClient.d.ts +3 -1
  38. package/dist/node/client/types/ProvidersClient.d.ts +28 -0
  39. package/dist/node/client/types/ProvidersClient.js +2 -0
  40. package/dist/node/client/types/UsageClient.d.ts +24 -0
  41. package/dist/node/client/types/UsageClient.js +2 -0
  42. package/dist/node/client/types/WebhooksClient.d.ts +31 -0
  43. package/dist/node/client/types/WebhooksClient.js +2 -0
  44. package/dist/node/client/types/index.d.ts +5 -0
  45. package/dist/node/client/types/index.js +5 -0
  46. package/dist/node/generated/node/applications_grpc_pb.js +34 -0
  47. package/dist/node/generated/node/applications_pb.js +2991 -178
  48. package/dist/node/generated/node/billing_grpc_pb.js +169 -0
  49. package/dist/node/generated/node/billing_pb.js +1720 -0
  50. package/dist/node/generated/node/calls_pb.js +62 -2
  51. package/dist/node/generated/node/capabilities_grpc_pb.js +66 -0
  52. package/dist/node/generated/node/capabilities_pb.js +2288 -0
  53. package/dist/node/generated/node/identity_grpc_pb.js +34 -0
  54. package/dist/node/generated/node/identity_pb.js +609 -5
  55. package/dist/node/generated/node/providers_grpc_pb.js +200 -0
  56. package/dist/node/generated/node/providers_pb.js +3094 -0
  57. package/dist/node/generated/node/usage_grpc_pb.js +64 -0
  58. package/dist/node/generated/node/usage_pb.js +866 -0
  59. package/dist/node/generated/node/webhooks_grpc_pb.js +302 -0
  60. package/dist/node/generated/node/webhooks_pb.js +3314 -0
  61. package/dist/node/generated/web/ApplicationsServiceClientPb.ts +43 -0
  62. package/dist/node/generated/web/BillingServiceClientPb.ts +258 -0
  63. package/dist/node/generated/web/CapabilitiesServiceClientPb.ts +87 -0
  64. package/dist/node/generated/web/IdentityServiceClientPb.ts +43 -0
  65. package/dist/node/generated/web/ProvidersServiceClientPb.ts +258 -0
  66. package/dist/node/generated/web/UsageServiceClientPb.ts +86 -0
  67. package/dist/node/generated/web/WebhooksServiceClientPb.ts +387 -0
  68. package/dist/node/generated/web/applications_pb.d.ts +343 -1
  69. package/dist/node/generated/web/applications_pb.js +2991 -178
  70. package/dist/node/generated/web/billing_pb.d.ts +210 -0
  71. package/dist/node/generated/web/billing_pb.js +1720 -0
  72. package/dist/node/generated/web/calls_pb.d.ts +8 -0
  73. package/dist/node/generated/web/calls_pb.js +62 -2
  74. package/dist/node/generated/web/capabilities_pb.d.ts +273 -0
  75. package/dist/node/generated/web/capabilities_pb.js +2288 -0
  76. package/dist/node/generated/web/identity_pb.d.ts +76 -0
  77. package/dist/node/generated/web/identity_pb.js +609 -5
  78. package/dist/node/generated/web/providers_pb.d.ts +372 -0
  79. package/dist/node/generated/web/providers_pb.js +3094 -0
  80. package/dist/node/generated/web/usage_pb.d.ts +106 -0
  81. package/dist/node/generated/web/usage_pb.js +866 -0
  82. package/dist/node/generated/web/webhooks_pb.d.ts +398 -0
  83. package/dist/node/generated/web/webhooks_pb.js +3314 -0
  84. package/dist/node/node.d.ts +7 -0
  85. package/dist/node/node.js +6 -0
  86. package/dist/node/tsconfig.tsbuildinfo +1 -1
  87. package/dist/node/utils.d.ts +7 -12
  88. package/dist/node/utils.js +18 -39
  89. package/dist/web/fonoster.min.js +1 -1
  90. package/dist/web/index.esm.js +1 -1
  91. package/package.json +8 -13
@@ -0,0 +1,169 @@
1
+ // GENERATED CODE -- DO NOT EDIT!
2
+
3
+ // Original file comments:
4
+ //
5
+ // Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
+ // http://github.com/fonoster/fonoster
7
+ //
8
+ // This file is part of Fonoster
9
+ //
10
+ // Licensed under the MIT License (the "License");
11
+ // you may not use this file except in compliance with
12
+ // the License. You may obtain a copy of the License at
13
+ //
14
+ // https://opensource.org/licenses/MIT
15
+ //
16
+ // Unless required by applicable law or agreed to in writing, software
17
+ // distributed under the License is distributed on an "AS IS" BASIS,
18
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ // See the License for the specific language governing permissions and
20
+ // limitations under the License.
21
+ 'use strict';
22
+ var grpc = require('@grpc/grpc-js');
23
+ var billing_pb = require('./billing_pb.js');
24
+
25
+ function serialize_fonoster_billing_v1beta2_BillingSummary(arg) {
26
+ if (!(arg instanceof billing_pb.BillingSummary)) {
27
+ throw new Error('Expected argument of type fonoster.billing.v1beta2.BillingSummary');
28
+ }
29
+ return Buffer.from(arg.serializeBinary());
30
+ }
31
+
32
+ function deserialize_fonoster_billing_v1beta2_BillingSummary(buffer_arg) {
33
+ return billing_pb.BillingSummary.deserializeBinary(new Uint8Array(buffer_arg));
34
+ }
35
+
36
+ function serialize_fonoster_billing_v1beta2_CreatePortalSessionRequest(arg) {
37
+ if (!(arg instanceof billing_pb.CreatePortalSessionRequest)) {
38
+ throw new Error('Expected argument of type fonoster.billing.v1beta2.CreatePortalSessionRequest');
39
+ }
40
+ return Buffer.from(arg.serializeBinary());
41
+ }
42
+
43
+ function deserialize_fonoster_billing_v1beta2_CreatePortalSessionRequest(buffer_arg) {
44
+ return billing_pb.CreatePortalSessionRequest.deserializeBinary(new Uint8Array(buffer_arg));
45
+ }
46
+
47
+ function serialize_fonoster_billing_v1beta2_CreatePortalSessionResponse(arg) {
48
+ if (!(arg instanceof billing_pb.CreatePortalSessionResponse)) {
49
+ throw new Error('Expected argument of type fonoster.billing.v1beta2.CreatePortalSessionResponse');
50
+ }
51
+ return Buffer.from(arg.serializeBinary());
52
+ }
53
+
54
+ function deserialize_fonoster_billing_v1beta2_CreatePortalSessionResponse(buffer_arg) {
55
+ return billing_pb.CreatePortalSessionResponse.deserializeBinary(new Uint8Array(buffer_arg));
56
+ }
57
+
58
+ function serialize_fonoster_billing_v1beta2_CreateTopUpRequest(arg) {
59
+ if (!(arg instanceof billing_pb.CreateTopUpRequest)) {
60
+ throw new Error('Expected argument of type fonoster.billing.v1beta2.CreateTopUpRequest');
61
+ }
62
+ return Buffer.from(arg.serializeBinary());
63
+ }
64
+
65
+ function deserialize_fonoster_billing_v1beta2_CreateTopUpRequest(buffer_arg) {
66
+ return billing_pb.CreateTopUpRequest.deserializeBinary(new Uint8Array(buffer_arg));
67
+ }
68
+
69
+ function serialize_fonoster_billing_v1beta2_GetBillingRequest(arg) {
70
+ if (!(arg instanceof billing_pb.GetBillingRequest)) {
71
+ throw new Error('Expected argument of type fonoster.billing.v1beta2.GetBillingRequest');
72
+ }
73
+ return Buffer.from(arg.serializeBinary());
74
+ }
75
+
76
+ function deserialize_fonoster_billing_v1beta2_GetBillingRequest(buffer_arg) {
77
+ return billing_pb.GetBillingRequest.deserializeBinary(new Uint8Array(buffer_arg));
78
+ }
79
+
80
+ function serialize_fonoster_billing_v1beta2_SubscribeRequest(arg) {
81
+ if (!(arg instanceof billing_pb.SubscribeRequest)) {
82
+ throw new Error('Expected argument of type fonoster.billing.v1beta2.SubscribeRequest');
83
+ }
84
+ return Buffer.from(arg.serializeBinary());
85
+ }
86
+
87
+ function deserialize_fonoster_billing_v1beta2_SubscribeRequest(buffer_arg) {
88
+ return billing_pb.SubscribeRequest.deserializeBinary(new Uint8Array(buffer_arg));
89
+ }
90
+
91
+ function serialize_fonoster_billing_v1beta2_UpdateAutoRechargeRequest(arg) {
92
+ if (!(arg instanceof billing_pb.UpdateAutoRechargeRequest)) {
93
+ throw new Error('Expected argument of type fonoster.billing.v1beta2.UpdateAutoRechargeRequest');
94
+ }
95
+ return Buffer.from(arg.serializeBinary());
96
+ }
97
+
98
+ function deserialize_fonoster_billing_v1beta2_UpdateAutoRechargeRequest(buffer_arg) {
99
+ return billing_pb.UpdateAutoRechargeRequest.deserializeBinary(new Uint8Array(buffer_arg));
100
+ }
101
+
102
+
103
+ // Billing for Fonoster Cloud (add-billing-service): the owner's credits, plan, auto-recharge,
104
+ // top-ups and the Stripe Customer Portal. The billing service serves it with owner_ref set; the
105
+ // apiserver serves it to the dashboard for workspace owners and sets owner_ref from the caller.
106
+ var BillingService = exports.BillingService = {
107
+ // The balance by source, the plan and auto-recharge
108
+ getBilling: {
109
+ path: '/fonoster.billing.v1beta2.Billing/GetBilling',
110
+ requestStream: false,
111
+ responseStream: false,
112
+ requestType: billing_pb.GetBillingRequest,
113
+ responseType: billing_pb.BillingSummary,
114
+ requestSerialize: serialize_fonoster_billing_v1beta2_GetBillingRequest,
115
+ requestDeserialize: deserialize_fonoster_billing_v1beta2_GetBillingRequest,
116
+ responseSerialize: serialize_fonoster_billing_v1beta2_BillingSummary,
117
+ responseDeserialize: deserialize_fonoster_billing_v1beta2_BillingSummary,
118
+ },
119
+ // Turns auto-recharge on or off, with its threshold and amount in credits
120
+ updateAutoRecharge: {
121
+ path: '/fonoster.billing.v1beta2.Billing/UpdateAutoRecharge',
122
+ requestStream: false,
123
+ responseStream: false,
124
+ requestType: billing_pb.UpdateAutoRechargeRequest,
125
+ responseType: billing_pb.BillingSummary,
126
+ requestSerialize: serialize_fonoster_billing_v1beta2_UpdateAutoRechargeRequest,
127
+ requestDeserialize: deserialize_fonoster_billing_v1beta2_UpdateAutoRechargeRequest,
128
+ responseSerialize: serialize_fonoster_billing_v1beta2_BillingSummary,
129
+ responseDeserialize: deserialize_fonoster_billing_v1beta2_BillingSummary,
130
+ },
131
+ // Buys top-up credits; they are added once the payment succeeds
132
+ createTopUp: {
133
+ path: '/fonoster.billing.v1beta2.Billing/CreateTopUp',
134
+ requestStream: false,
135
+ responseStream: false,
136
+ requestType: billing_pb.CreateTopUpRequest,
137
+ responseType: billing_pb.BillingSummary,
138
+ requestSerialize: serialize_fonoster_billing_v1beta2_CreateTopUpRequest,
139
+ requestDeserialize: deserialize_fonoster_billing_v1beta2_CreateTopUpRequest,
140
+ responseSerialize: serialize_fonoster_billing_v1beta2_BillingSummary,
141
+ responseDeserialize: deserialize_fonoster_billing_v1beta2_BillingSummary,
142
+ },
143
+ // Moves the owner to Pay-as-you-go (needs a payment method, added in the portal)
144
+ subscribe: {
145
+ path: '/fonoster.billing.v1beta2.Billing/Subscribe',
146
+ requestStream: false,
147
+ responseStream: false,
148
+ requestType: billing_pb.SubscribeRequest,
149
+ responseType: billing_pb.BillingSummary,
150
+ requestSerialize: serialize_fonoster_billing_v1beta2_SubscribeRequest,
151
+ requestDeserialize: deserialize_fonoster_billing_v1beta2_SubscribeRequest,
152
+ responseSerialize: serialize_fonoster_billing_v1beta2_BillingSummary,
153
+ responseDeserialize: deserialize_fonoster_billing_v1beta2_BillingSummary,
154
+ },
155
+ // A Stripe Customer Portal link for payment methods and invoices
156
+ createPortalSession: {
157
+ path: '/fonoster.billing.v1beta2.Billing/CreatePortalSession',
158
+ requestStream: false,
159
+ responseStream: false,
160
+ requestType: billing_pb.CreatePortalSessionRequest,
161
+ responseType: billing_pb.CreatePortalSessionResponse,
162
+ requestSerialize: serialize_fonoster_billing_v1beta2_CreatePortalSessionRequest,
163
+ requestDeserialize: deserialize_fonoster_billing_v1beta2_CreatePortalSessionRequest,
164
+ responseSerialize: serialize_fonoster_billing_v1beta2_CreatePortalSessionResponse,
165
+ responseDeserialize: deserialize_fonoster_billing_v1beta2_CreatePortalSessionResponse,
166
+ },
167
+ };
168
+
169
+ exports.BillingClient = grpc.makeGenericClientConstructor(BillingService, 'Billing');