@paakd/api 0.0.3 → 0.0.4
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.
- package/package.json +7 -9
- package/buf/validate/validate_pb.ts +0 -5001
- package/gen/buf/validate/validate_pb.ts +0 -4799
- package/gen/src/proto/auth/v1/authv1connect/service.connect.go +0 -454
- package/gen/src/proto/auth/v1/entities/auth.pb.go +0 -818
- package/gen/src/proto/auth/v1/entities/auth_pb.ts +0 -348
- package/gen/src/proto/auth/v1/entities/policy.pb.go +0 -727
- package/gen/src/proto/auth/v1/entities/policy_pb.ts +0 -306
- package/gen/src/proto/auth/v1/service-AuthService_connectquery.ts +0 -70
- package/gen/src/proto/auth/v1/service.pb.go +0 -119
- package/gen/src/proto/auth/v1/service_pb.ts +0 -152
- package/gen/src/proto/customers/v1/customersv1connect/service.connect.go +0 -358
- package/gen/src/proto/customers/v1/entities/address.pb.go +0 -1073
- package/gen/src/proto/customers/v1/entities/address_pb.ts +0 -478
- package/gen/src/proto/customers/v1/entities/profile.pb.go +0 -633
- package/gen/src/proto/customers/v1/entities/profile_pb.ts +0 -252
- package/gen/src/proto/customers/v1/service-CustomerService_connectquery.ts +0 -50
- package/gen/src/proto/customers/v1/service.pb.go +0 -110
- package/gen/src/proto/customers/v1/service_pb.ts +0 -121
- package/gen/src/proto/files/v1/entities/file.pb.go +0 -669
- package/gen/src/proto/files/v1/entities/file_pb.ts +0 -265
- package/gen/src/proto/files/v1/filesv1connect/service.connect.go +0 -200
- package/gen/src/proto/files/v1/service-FileService_connectquery.ts +0 -25
- package/gen/src/proto/files/v1/service.pb.go +0 -85
- package/gen/src/proto/files/v1/service_pb.ts +0 -65
- package/gen/src/proto/products/v1/entities/category.pb.go +0 -744
- package/gen/src/proto/products/v1/entities/category_pb.ts +0 -318
- package/gen/src/proto/products/v1/entities/collection.pb.go +0 -528
- package/gen/src/proto/products/v1/entities/collection_pb.ts +0 -214
- package/gen/src/proto/products/v1/entities/product/create.pb.go +0 -453
- package/gen/src/proto/products/v1/entities/product/create_pb.ts +0 -199
- package/gen/src/proto/products/v1/entities/product/option.pb.go +0 -206
- package/gen/src/proto/products/v1/entities/product/option_pb.ts +0 -74
- package/gen/src/proto/products/v1/entities/product/shared.pb.go +0 -2890
- package/gen/src/proto/products/v1/entities/product/shared_pb.ts +0 -1317
- package/gen/src/proto/products/v1/entities/product/update.pb.go +0 -794
- package/gen/src/proto/products/v1/entities/product/update_pb.ts +0 -325
- package/gen/src/proto/products/v1/entities/tag.pb.go +0 -610
- package/gen/src/proto/products/v1/entities/tag_pb.ts +0 -233
- package/gen/src/proto/products/v1/entities/taxonomy.pb.go +0 -1352
- package/gen/src/proto/products/v1/entities/taxonomy_pb.ts +0 -606
- package/gen/src/proto/products/v1/entities/type.pb.go +0 -553
- package/gen/src/proto/products/v1/entities/type_pb.ts +0 -215
- package/gen/src/proto/products/v1/entities/variant.pb.go +0 -1474
- package/gen/src/proto/products/v1/entities/variant_pb.ts +0 -629
- package/gen/src/proto/products/v1/productsv1connect/service.connect.go +0 -1195
- package/gen/src/proto/products/v1/service-ProductsService_connectquery.ts +0 -199
- package/gen/src/proto/products/v1/service.pb.go +0 -250
- package/gen/src/proto/products/v1/service_pb.ts +0 -429
- package/gen/src/proto/promotions/v1/entities/campaign.pb.go +0 -1229
- package/gen/src/proto/promotions/v1/entities/campaign_pb.ts +0 -511
- package/gen/src/proto/promotions/v1/promotionsv1connect/service.connect.go +0 -289
- package/gen/src/proto/promotions/v1/service-CampaignService_connectquery.ts +0 -42
- package/gen/src/proto/promotions/v1/service.pb.go +0 -98
- package/gen/src/proto/promotions/v1/service_pb.ts +0 -95
- package/gen/src/proto/stocknodes/v1/entities/stocknode.pb.go +0 -1499
- package/gen/src/proto/stocknodes/v1/entities/stocknode_pb.ts +0 -655
- package/gen/src/proto/stocknodes/v1/service-StockNodesService_connectquery.ts +0 -41
- package/gen/src/proto/stocknodes/v1/service.pb.go +0 -98
- package/gen/src/proto/stocknodes/v1/service_pb.ts +0 -95
- package/gen/src/proto/stocknodes/v1/stocknodesv1connect/service.connect.go +0 -297
|
@@ -1,454 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
|
2
|
-
//
|
|
3
|
-
// Source: src/proto/auth/v1/service.proto
|
|
4
|
-
|
|
5
|
-
package authv1connect
|
|
6
|
-
|
|
7
|
-
import (
|
|
8
|
-
connect "connectrpc.com/connect"
|
|
9
|
-
context "context"
|
|
10
|
-
errors "errors"
|
|
11
|
-
http "net/http"
|
|
12
|
-
v1 "paakd.com/packages/api/gen/src/proto/auth/v1"
|
|
13
|
-
entities "paakd.com/packages/api/gen/src/proto/auth/v1/entities"
|
|
14
|
-
strings "strings"
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
// This is a compile-time assertion to ensure that this generated file and the connect package are
|
|
18
|
-
// compatible. If you get a compiler error that this constant is not defined, this code was
|
|
19
|
-
// generated with a version of connect newer than the one compiled into your binary. You can fix the
|
|
20
|
-
// problem by either regenerating this code with an older version of connect or updating the connect
|
|
21
|
-
// version compiled into your binary.
|
|
22
|
-
const _ = connect.IsAtLeastVersion1_13_0
|
|
23
|
-
|
|
24
|
-
const (
|
|
25
|
-
// AuthServiceName is the fully-qualified name of the AuthService service.
|
|
26
|
-
AuthServiceName = "apps.enterprise.interfaces.rpc.auth.v1.AuthService"
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
// These constants are the fully-qualified names of the RPCs defined in this package. They're
|
|
30
|
-
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
|
|
31
|
-
//
|
|
32
|
-
// Note that these are different from the fully-qualified method names used by
|
|
33
|
-
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
|
|
34
|
-
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
|
35
|
-
// period.
|
|
36
|
-
const (
|
|
37
|
-
// AuthServiceLoginProcedure is the fully-qualified name of the AuthService's Login RPC.
|
|
38
|
-
AuthServiceLoginProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/Login"
|
|
39
|
-
// AuthServiceRefreshTokenProcedure is the fully-qualified name of the AuthService's RefreshToken
|
|
40
|
-
// RPC.
|
|
41
|
-
AuthServiceRefreshTokenProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/RefreshToken"
|
|
42
|
-
// AuthServiceVerifyEmailProcedure is the fully-qualified name of the AuthService's VerifyEmail RPC.
|
|
43
|
-
AuthServiceVerifyEmailProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/VerifyEmail"
|
|
44
|
-
// AuthServiceValidateOTPProcedure is the fully-qualified name of the AuthService's ValidateOTP RPC.
|
|
45
|
-
AuthServiceValidateOTPProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/ValidateOTP"
|
|
46
|
-
// AuthServiceRegisterProcedure is the fully-qualified name of the AuthService's Register RPC.
|
|
47
|
-
AuthServiceRegisterProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/Register"
|
|
48
|
-
// AuthServiceGetPoliciesProcedure is the fully-qualified name of the AuthService's GetPolicies RPC.
|
|
49
|
-
AuthServiceGetPoliciesProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/GetPolicies"
|
|
50
|
-
// AuthServiceSavePoliciesProcedure is the fully-qualified name of the AuthService's SavePolicies
|
|
51
|
-
// RPC.
|
|
52
|
-
AuthServiceSavePoliciesProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/SavePolicies"
|
|
53
|
-
// AuthServiceAddPolicyProcedure is the fully-qualified name of the AuthService's AddPolicy RPC.
|
|
54
|
-
AuthServiceAddPolicyProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/AddPolicy"
|
|
55
|
-
// AuthServiceRemovePolicyProcedure is the fully-qualified name of the AuthService's RemovePolicy
|
|
56
|
-
// RPC.
|
|
57
|
-
AuthServiceRemovePolicyProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/RemovePolicy"
|
|
58
|
-
// AuthServiceAddPoliciesProcedure is the fully-qualified name of the AuthService's AddPolicies RPC.
|
|
59
|
-
AuthServiceAddPoliciesProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/AddPolicies"
|
|
60
|
-
// AuthServiceRemovePoliciesProcedure is the fully-qualified name of the AuthService's
|
|
61
|
-
// RemovePolicies RPC.
|
|
62
|
-
AuthServiceRemovePoliciesProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/RemovePolicies"
|
|
63
|
-
// AuthServiceGetFilteredPolicyProcedure is the fully-qualified name of the AuthService's
|
|
64
|
-
// GetFilteredPolicy RPC.
|
|
65
|
-
AuthServiceGetFilteredPolicyProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/GetFilteredPolicy"
|
|
66
|
-
// AuthServiceRemoveFilteredPolicyProcedure is the fully-qualified name of the AuthService's
|
|
67
|
-
// RemoveFilteredPolicy RPC.
|
|
68
|
-
AuthServiceRemoveFilteredPolicyProcedure = "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/RemoveFilteredPolicy"
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
// AuthServiceClient is a client for the apps.enterprise.interfaces.rpc.auth.v1.AuthService service.
|
|
72
|
-
type AuthServiceClient interface {
|
|
73
|
-
Login(context.Context, *connect.Request[entities.LoginRequest]) (*connect.Response[entities.LoginResponse], error)
|
|
74
|
-
RefreshToken(context.Context, *connect.Request[entities.TokenRefreshRequest]) (*connect.Response[entities.LoginResponse], error)
|
|
75
|
-
VerifyEmail(context.Context, *connect.Request[entities.VerifyEmailRequest]) (*connect.Response[entities.VerifyEmailResponse], error)
|
|
76
|
-
ValidateOTP(context.Context, *connect.Request[entities.ValidateOTPRequest]) (*connect.Response[entities.ValidateOTPResponse], error)
|
|
77
|
-
Register(context.Context, *connect.Request[entities.RegisterRequest]) (*connect.Response[entities.RegisterResponse], error)
|
|
78
|
-
GetPolicies(context.Context, *connect.Request[entities.PolicyEmptyRequest]) (*connect.Response[entities.GetPoliciesResponse], error)
|
|
79
|
-
SavePolicies(context.Context, *connect.Request[entities.SavePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
80
|
-
AddPolicy(context.Context, *connect.Request[entities.ChangePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
81
|
-
RemovePolicy(context.Context, *connect.Request[entities.ChangePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
82
|
-
AddPolicies(context.Context, *connect.Request[entities.ChangePoliciesRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
83
|
-
RemovePolicies(context.Context, *connect.Request[entities.ChangePoliciesRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
84
|
-
GetFilteredPolicy(context.Context, *connect.Request[entities.FilteredPolicyRequest]) (*connect.Response[entities.GetPoliciesResponse], error)
|
|
85
|
-
RemoveFilteredPolicy(context.Context, *connect.Request[entities.RemoveFilteredPolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// NewAuthServiceClient constructs a client for the
|
|
89
|
-
// apps.enterprise.interfaces.rpc.auth.v1.AuthService service. By default, it uses the Connect
|
|
90
|
-
// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed
|
|
91
|
-
// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
|
|
92
|
-
// connect.WithGRPCWeb() options.
|
|
93
|
-
//
|
|
94
|
-
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
|
|
95
|
-
// http://api.acme.com or https://acme.com/grpc).
|
|
96
|
-
func NewAuthServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthServiceClient {
|
|
97
|
-
baseURL = strings.TrimRight(baseURL, "/")
|
|
98
|
-
authServiceMethods := v1.File_src_proto_auth_v1_service_proto.Services().ByName("AuthService").Methods()
|
|
99
|
-
return &authServiceClient{
|
|
100
|
-
login: connect.NewClient[entities.LoginRequest, entities.LoginResponse](
|
|
101
|
-
httpClient,
|
|
102
|
-
baseURL+AuthServiceLoginProcedure,
|
|
103
|
-
connect.WithSchema(authServiceMethods.ByName("Login")),
|
|
104
|
-
connect.WithClientOptions(opts...),
|
|
105
|
-
),
|
|
106
|
-
refreshToken: connect.NewClient[entities.TokenRefreshRequest, entities.LoginResponse](
|
|
107
|
-
httpClient,
|
|
108
|
-
baseURL+AuthServiceRefreshTokenProcedure,
|
|
109
|
-
connect.WithSchema(authServiceMethods.ByName("RefreshToken")),
|
|
110
|
-
connect.WithClientOptions(opts...),
|
|
111
|
-
),
|
|
112
|
-
verifyEmail: connect.NewClient[entities.VerifyEmailRequest, entities.VerifyEmailResponse](
|
|
113
|
-
httpClient,
|
|
114
|
-
baseURL+AuthServiceVerifyEmailProcedure,
|
|
115
|
-
connect.WithSchema(authServiceMethods.ByName("VerifyEmail")),
|
|
116
|
-
connect.WithClientOptions(opts...),
|
|
117
|
-
),
|
|
118
|
-
validateOTP: connect.NewClient[entities.ValidateOTPRequest, entities.ValidateOTPResponse](
|
|
119
|
-
httpClient,
|
|
120
|
-
baseURL+AuthServiceValidateOTPProcedure,
|
|
121
|
-
connect.WithSchema(authServiceMethods.ByName("ValidateOTP")),
|
|
122
|
-
connect.WithClientOptions(opts...),
|
|
123
|
-
),
|
|
124
|
-
register: connect.NewClient[entities.RegisterRequest, entities.RegisterResponse](
|
|
125
|
-
httpClient,
|
|
126
|
-
baseURL+AuthServiceRegisterProcedure,
|
|
127
|
-
connect.WithSchema(authServiceMethods.ByName("Register")),
|
|
128
|
-
connect.WithClientOptions(opts...),
|
|
129
|
-
),
|
|
130
|
-
getPolicies: connect.NewClient[entities.PolicyEmptyRequest, entities.GetPoliciesResponse](
|
|
131
|
-
httpClient,
|
|
132
|
-
baseURL+AuthServiceGetPoliciesProcedure,
|
|
133
|
-
connect.WithSchema(authServiceMethods.ByName("GetPolicies")),
|
|
134
|
-
connect.WithClientOptions(opts...),
|
|
135
|
-
),
|
|
136
|
-
savePolicies: connect.NewClient[entities.SavePolicyRequest, entities.PolicyEmptyResponse](
|
|
137
|
-
httpClient,
|
|
138
|
-
baseURL+AuthServiceSavePoliciesProcedure,
|
|
139
|
-
connect.WithSchema(authServiceMethods.ByName("SavePolicies")),
|
|
140
|
-
connect.WithClientOptions(opts...),
|
|
141
|
-
),
|
|
142
|
-
addPolicy: connect.NewClient[entities.ChangePolicyRequest, entities.PolicyEmptyResponse](
|
|
143
|
-
httpClient,
|
|
144
|
-
baseURL+AuthServiceAddPolicyProcedure,
|
|
145
|
-
connect.WithSchema(authServiceMethods.ByName("AddPolicy")),
|
|
146
|
-
connect.WithClientOptions(opts...),
|
|
147
|
-
),
|
|
148
|
-
removePolicy: connect.NewClient[entities.ChangePolicyRequest, entities.PolicyEmptyResponse](
|
|
149
|
-
httpClient,
|
|
150
|
-
baseURL+AuthServiceRemovePolicyProcedure,
|
|
151
|
-
connect.WithSchema(authServiceMethods.ByName("RemovePolicy")),
|
|
152
|
-
connect.WithClientOptions(opts...),
|
|
153
|
-
),
|
|
154
|
-
addPolicies: connect.NewClient[entities.ChangePoliciesRequest, entities.PolicyEmptyResponse](
|
|
155
|
-
httpClient,
|
|
156
|
-
baseURL+AuthServiceAddPoliciesProcedure,
|
|
157
|
-
connect.WithSchema(authServiceMethods.ByName("AddPolicies")),
|
|
158
|
-
connect.WithClientOptions(opts...),
|
|
159
|
-
),
|
|
160
|
-
removePolicies: connect.NewClient[entities.ChangePoliciesRequest, entities.PolicyEmptyResponse](
|
|
161
|
-
httpClient,
|
|
162
|
-
baseURL+AuthServiceRemovePoliciesProcedure,
|
|
163
|
-
connect.WithSchema(authServiceMethods.ByName("RemovePolicies")),
|
|
164
|
-
connect.WithClientOptions(opts...),
|
|
165
|
-
),
|
|
166
|
-
getFilteredPolicy: connect.NewClient[entities.FilteredPolicyRequest, entities.GetPoliciesResponse](
|
|
167
|
-
httpClient,
|
|
168
|
-
baseURL+AuthServiceGetFilteredPolicyProcedure,
|
|
169
|
-
connect.WithSchema(authServiceMethods.ByName("GetFilteredPolicy")),
|
|
170
|
-
connect.WithClientOptions(opts...),
|
|
171
|
-
),
|
|
172
|
-
removeFilteredPolicy: connect.NewClient[entities.RemoveFilteredPolicyRequest, entities.PolicyEmptyResponse](
|
|
173
|
-
httpClient,
|
|
174
|
-
baseURL+AuthServiceRemoveFilteredPolicyProcedure,
|
|
175
|
-
connect.WithSchema(authServiceMethods.ByName("RemoveFilteredPolicy")),
|
|
176
|
-
connect.WithClientOptions(opts...),
|
|
177
|
-
),
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// authServiceClient implements AuthServiceClient.
|
|
182
|
-
type authServiceClient struct {
|
|
183
|
-
login *connect.Client[entities.LoginRequest, entities.LoginResponse]
|
|
184
|
-
refreshToken *connect.Client[entities.TokenRefreshRequest, entities.LoginResponse]
|
|
185
|
-
verifyEmail *connect.Client[entities.VerifyEmailRequest, entities.VerifyEmailResponse]
|
|
186
|
-
validateOTP *connect.Client[entities.ValidateOTPRequest, entities.ValidateOTPResponse]
|
|
187
|
-
register *connect.Client[entities.RegisterRequest, entities.RegisterResponse]
|
|
188
|
-
getPolicies *connect.Client[entities.PolicyEmptyRequest, entities.GetPoliciesResponse]
|
|
189
|
-
savePolicies *connect.Client[entities.SavePolicyRequest, entities.PolicyEmptyResponse]
|
|
190
|
-
addPolicy *connect.Client[entities.ChangePolicyRequest, entities.PolicyEmptyResponse]
|
|
191
|
-
removePolicy *connect.Client[entities.ChangePolicyRequest, entities.PolicyEmptyResponse]
|
|
192
|
-
addPolicies *connect.Client[entities.ChangePoliciesRequest, entities.PolicyEmptyResponse]
|
|
193
|
-
removePolicies *connect.Client[entities.ChangePoliciesRequest, entities.PolicyEmptyResponse]
|
|
194
|
-
getFilteredPolicy *connect.Client[entities.FilteredPolicyRequest, entities.GetPoliciesResponse]
|
|
195
|
-
removeFilteredPolicy *connect.Client[entities.RemoveFilteredPolicyRequest, entities.PolicyEmptyResponse]
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// Login calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.Login.
|
|
199
|
-
func (c *authServiceClient) Login(ctx context.Context, req *connect.Request[entities.LoginRequest]) (*connect.Response[entities.LoginResponse], error) {
|
|
200
|
-
return c.login.CallUnary(ctx, req)
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// RefreshToken calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.RefreshToken.
|
|
204
|
-
func (c *authServiceClient) RefreshToken(ctx context.Context, req *connect.Request[entities.TokenRefreshRequest]) (*connect.Response[entities.LoginResponse], error) {
|
|
205
|
-
return c.refreshToken.CallUnary(ctx, req)
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// VerifyEmail calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.VerifyEmail.
|
|
209
|
-
func (c *authServiceClient) VerifyEmail(ctx context.Context, req *connect.Request[entities.VerifyEmailRequest]) (*connect.Response[entities.VerifyEmailResponse], error) {
|
|
210
|
-
return c.verifyEmail.CallUnary(ctx, req)
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// ValidateOTP calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.ValidateOTP.
|
|
214
|
-
func (c *authServiceClient) ValidateOTP(ctx context.Context, req *connect.Request[entities.ValidateOTPRequest]) (*connect.Response[entities.ValidateOTPResponse], error) {
|
|
215
|
-
return c.validateOTP.CallUnary(ctx, req)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Register calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.Register.
|
|
219
|
-
func (c *authServiceClient) Register(ctx context.Context, req *connect.Request[entities.RegisterRequest]) (*connect.Response[entities.RegisterResponse], error) {
|
|
220
|
-
return c.register.CallUnary(ctx, req)
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// GetPolicies calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.GetPolicies.
|
|
224
|
-
func (c *authServiceClient) GetPolicies(ctx context.Context, req *connect.Request[entities.PolicyEmptyRequest]) (*connect.Response[entities.GetPoliciesResponse], error) {
|
|
225
|
-
return c.getPolicies.CallUnary(ctx, req)
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// SavePolicies calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.SavePolicies.
|
|
229
|
-
func (c *authServiceClient) SavePolicies(ctx context.Context, req *connect.Request[entities.SavePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
230
|
-
return c.savePolicies.CallUnary(ctx, req)
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// AddPolicy calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.AddPolicy.
|
|
234
|
-
func (c *authServiceClient) AddPolicy(ctx context.Context, req *connect.Request[entities.ChangePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
235
|
-
return c.addPolicy.CallUnary(ctx, req)
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// RemovePolicy calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.RemovePolicy.
|
|
239
|
-
func (c *authServiceClient) RemovePolicy(ctx context.Context, req *connect.Request[entities.ChangePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
240
|
-
return c.removePolicy.CallUnary(ctx, req)
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// AddPolicies calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.AddPolicies.
|
|
244
|
-
func (c *authServiceClient) AddPolicies(ctx context.Context, req *connect.Request[entities.ChangePoliciesRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
245
|
-
return c.addPolicies.CallUnary(ctx, req)
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// RemovePolicies calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.RemovePolicies.
|
|
249
|
-
func (c *authServiceClient) RemovePolicies(ctx context.Context, req *connect.Request[entities.ChangePoliciesRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
250
|
-
return c.removePolicies.CallUnary(ctx, req)
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// GetFilteredPolicy calls apps.enterprise.interfaces.rpc.auth.v1.AuthService.GetFilteredPolicy.
|
|
254
|
-
func (c *authServiceClient) GetFilteredPolicy(ctx context.Context, req *connect.Request[entities.FilteredPolicyRequest]) (*connect.Response[entities.GetPoliciesResponse], error) {
|
|
255
|
-
return c.getFilteredPolicy.CallUnary(ctx, req)
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// RemoveFilteredPolicy calls
|
|
259
|
-
// apps.enterprise.interfaces.rpc.auth.v1.AuthService.RemoveFilteredPolicy.
|
|
260
|
-
func (c *authServiceClient) RemoveFilteredPolicy(ctx context.Context, req *connect.Request[entities.RemoveFilteredPolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
261
|
-
return c.removeFilteredPolicy.CallUnary(ctx, req)
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// AuthServiceHandler is an implementation of the apps.enterprise.interfaces.rpc.auth.v1.AuthService
|
|
265
|
-
// service.
|
|
266
|
-
type AuthServiceHandler interface {
|
|
267
|
-
Login(context.Context, *connect.Request[entities.LoginRequest]) (*connect.Response[entities.LoginResponse], error)
|
|
268
|
-
RefreshToken(context.Context, *connect.Request[entities.TokenRefreshRequest]) (*connect.Response[entities.LoginResponse], error)
|
|
269
|
-
VerifyEmail(context.Context, *connect.Request[entities.VerifyEmailRequest]) (*connect.Response[entities.VerifyEmailResponse], error)
|
|
270
|
-
ValidateOTP(context.Context, *connect.Request[entities.ValidateOTPRequest]) (*connect.Response[entities.ValidateOTPResponse], error)
|
|
271
|
-
Register(context.Context, *connect.Request[entities.RegisterRequest]) (*connect.Response[entities.RegisterResponse], error)
|
|
272
|
-
GetPolicies(context.Context, *connect.Request[entities.PolicyEmptyRequest]) (*connect.Response[entities.GetPoliciesResponse], error)
|
|
273
|
-
SavePolicies(context.Context, *connect.Request[entities.SavePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
274
|
-
AddPolicy(context.Context, *connect.Request[entities.ChangePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
275
|
-
RemovePolicy(context.Context, *connect.Request[entities.ChangePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
276
|
-
AddPolicies(context.Context, *connect.Request[entities.ChangePoliciesRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
277
|
-
RemovePolicies(context.Context, *connect.Request[entities.ChangePoliciesRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
278
|
-
GetFilteredPolicy(context.Context, *connect.Request[entities.FilteredPolicyRequest]) (*connect.Response[entities.GetPoliciesResponse], error)
|
|
279
|
-
RemoveFilteredPolicy(context.Context, *connect.Request[entities.RemoveFilteredPolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error)
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// NewAuthServiceHandler builds an HTTP handler from the service implementation. It returns the path
|
|
283
|
-
// on which to mount the handler and the handler itself.
|
|
284
|
-
//
|
|
285
|
-
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
|
|
286
|
-
// and JSON codecs. They also support gzip compression.
|
|
287
|
-
func NewAuthServiceHandler(svc AuthServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
|
|
288
|
-
authServiceMethods := v1.File_src_proto_auth_v1_service_proto.Services().ByName("AuthService").Methods()
|
|
289
|
-
authServiceLoginHandler := connect.NewUnaryHandler(
|
|
290
|
-
AuthServiceLoginProcedure,
|
|
291
|
-
svc.Login,
|
|
292
|
-
connect.WithSchema(authServiceMethods.ByName("Login")),
|
|
293
|
-
connect.WithHandlerOptions(opts...),
|
|
294
|
-
)
|
|
295
|
-
authServiceRefreshTokenHandler := connect.NewUnaryHandler(
|
|
296
|
-
AuthServiceRefreshTokenProcedure,
|
|
297
|
-
svc.RefreshToken,
|
|
298
|
-
connect.WithSchema(authServiceMethods.ByName("RefreshToken")),
|
|
299
|
-
connect.WithHandlerOptions(opts...),
|
|
300
|
-
)
|
|
301
|
-
authServiceVerifyEmailHandler := connect.NewUnaryHandler(
|
|
302
|
-
AuthServiceVerifyEmailProcedure,
|
|
303
|
-
svc.VerifyEmail,
|
|
304
|
-
connect.WithSchema(authServiceMethods.ByName("VerifyEmail")),
|
|
305
|
-
connect.WithHandlerOptions(opts...),
|
|
306
|
-
)
|
|
307
|
-
authServiceValidateOTPHandler := connect.NewUnaryHandler(
|
|
308
|
-
AuthServiceValidateOTPProcedure,
|
|
309
|
-
svc.ValidateOTP,
|
|
310
|
-
connect.WithSchema(authServiceMethods.ByName("ValidateOTP")),
|
|
311
|
-
connect.WithHandlerOptions(opts...),
|
|
312
|
-
)
|
|
313
|
-
authServiceRegisterHandler := connect.NewUnaryHandler(
|
|
314
|
-
AuthServiceRegisterProcedure,
|
|
315
|
-
svc.Register,
|
|
316
|
-
connect.WithSchema(authServiceMethods.ByName("Register")),
|
|
317
|
-
connect.WithHandlerOptions(opts...),
|
|
318
|
-
)
|
|
319
|
-
authServiceGetPoliciesHandler := connect.NewUnaryHandler(
|
|
320
|
-
AuthServiceGetPoliciesProcedure,
|
|
321
|
-
svc.GetPolicies,
|
|
322
|
-
connect.WithSchema(authServiceMethods.ByName("GetPolicies")),
|
|
323
|
-
connect.WithHandlerOptions(opts...),
|
|
324
|
-
)
|
|
325
|
-
authServiceSavePoliciesHandler := connect.NewUnaryHandler(
|
|
326
|
-
AuthServiceSavePoliciesProcedure,
|
|
327
|
-
svc.SavePolicies,
|
|
328
|
-
connect.WithSchema(authServiceMethods.ByName("SavePolicies")),
|
|
329
|
-
connect.WithHandlerOptions(opts...),
|
|
330
|
-
)
|
|
331
|
-
authServiceAddPolicyHandler := connect.NewUnaryHandler(
|
|
332
|
-
AuthServiceAddPolicyProcedure,
|
|
333
|
-
svc.AddPolicy,
|
|
334
|
-
connect.WithSchema(authServiceMethods.ByName("AddPolicy")),
|
|
335
|
-
connect.WithHandlerOptions(opts...),
|
|
336
|
-
)
|
|
337
|
-
authServiceRemovePolicyHandler := connect.NewUnaryHandler(
|
|
338
|
-
AuthServiceRemovePolicyProcedure,
|
|
339
|
-
svc.RemovePolicy,
|
|
340
|
-
connect.WithSchema(authServiceMethods.ByName("RemovePolicy")),
|
|
341
|
-
connect.WithHandlerOptions(opts...),
|
|
342
|
-
)
|
|
343
|
-
authServiceAddPoliciesHandler := connect.NewUnaryHandler(
|
|
344
|
-
AuthServiceAddPoliciesProcedure,
|
|
345
|
-
svc.AddPolicies,
|
|
346
|
-
connect.WithSchema(authServiceMethods.ByName("AddPolicies")),
|
|
347
|
-
connect.WithHandlerOptions(opts...),
|
|
348
|
-
)
|
|
349
|
-
authServiceRemovePoliciesHandler := connect.NewUnaryHandler(
|
|
350
|
-
AuthServiceRemovePoliciesProcedure,
|
|
351
|
-
svc.RemovePolicies,
|
|
352
|
-
connect.WithSchema(authServiceMethods.ByName("RemovePolicies")),
|
|
353
|
-
connect.WithHandlerOptions(opts...),
|
|
354
|
-
)
|
|
355
|
-
authServiceGetFilteredPolicyHandler := connect.NewUnaryHandler(
|
|
356
|
-
AuthServiceGetFilteredPolicyProcedure,
|
|
357
|
-
svc.GetFilteredPolicy,
|
|
358
|
-
connect.WithSchema(authServiceMethods.ByName("GetFilteredPolicy")),
|
|
359
|
-
connect.WithHandlerOptions(opts...),
|
|
360
|
-
)
|
|
361
|
-
authServiceRemoveFilteredPolicyHandler := connect.NewUnaryHandler(
|
|
362
|
-
AuthServiceRemoveFilteredPolicyProcedure,
|
|
363
|
-
svc.RemoveFilteredPolicy,
|
|
364
|
-
connect.WithSchema(authServiceMethods.ByName("RemoveFilteredPolicy")),
|
|
365
|
-
connect.WithHandlerOptions(opts...),
|
|
366
|
-
)
|
|
367
|
-
return "/apps.enterprise.interfaces.rpc.auth.v1.AuthService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
368
|
-
switch r.URL.Path {
|
|
369
|
-
case AuthServiceLoginProcedure:
|
|
370
|
-
authServiceLoginHandler.ServeHTTP(w, r)
|
|
371
|
-
case AuthServiceRefreshTokenProcedure:
|
|
372
|
-
authServiceRefreshTokenHandler.ServeHTTP(w, r)
|
|
373
|
-
case AuthServiceVerifyEmailProcedure:
|
|
374
|
-
authServiceVerifyEmailHandler.ServeHTTP(w, r)
|
|
375
|
-
case AuthServiceValidateOTPProcedure:
|
|
376
|
-
authServiceValidateOTPHandler.ServeHTTP(w, r)
|
|
377
|
-
case AuthServiceRegisterProcedure:
|
|
378
|
-
authServiceRegisterHandler.ServeHTTP(w, r)
|
|
379
|
-
case AuthServiceGetPoliciesProcedure:
|
|
380
|
-
authServiceGetPoliciesHandler.ServeHTTP(w, r)
|
|
381
|
-
case AuthServiceSavePoliciesProcedure:
|
|
382
|
-
authServiceSavePoliciesHandler.ServeHTTP(w, r)
|
|
383
|
-
case AuthServiceAddPolicyProcedure:
|
|
384
|
-
authServiceAddPolicyHandler.ServeHTTP(w, r)
|
|
385
|
-
case AuthServiceRemovePolicyProcedure:
|
|
386
|
-
authServiceRemovePolicyHandler.ServeHTTP(w, r)
|
|
387
|
-
case AuthServiceAddPoliciesProcedure:
|
|
388
|
-
authServiceAddPoliciesHandler.ServeHTTP(w, r)
|
|
389
|
-
case AuthServiceRemovePoliciesProcedure:
|
|
390
|
-
authServiceRemovePoliciesHandler.ServeHTTP(w, r)
|
|
391
|
-
case AuthServiceGetFilteredPolicyProcedure:
|
|
392
|
-
authServiceGetFilteredPolicyHandler.ServeHTTP(w, r)
|
|
393
|
-
case AuthServiceRemoveFilteredPolicyProcedure:
|
|
394
|
-
authServiceRemoveFilteredPolicyHandler.ServeHTTP(w, r)
|
|
395
|
-
default:
|
|
396
|
-
http.NotFound(w, r)
|
|
397
|
-
}
|
|
398
|
-
})
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
// UnimplementedAuthServiceHandler returns CodeUnimplemented from all methods.
|
|
402
|
-
type UnimplementedAuthServiceHandler struct{}
|
|
403
|
-
|
|
404
|
-
func (UnimplementedAuthServiceHandler) Login(context.Context, *connect.Request[entities.LoginRequest]) (*connect.Response[entities.LoginResponse], error) {
|
|
405
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.Login is not implemented"))
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
func (UnimplementedAuthServiceHandler) RefreshToken(context.Context, *connect.Request[entities.TokenRefreshRequest]) (*connect.Response[entities.LoginResponse], error) {
|
|
409
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.RefreshToken is not implemented"))
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
func (UnimplementedAuthServiceHandler) VerifyEmail(context.Context, *connect.Request[entities.VerifyEmailRequest]) (*connect.Response[entities.VerifyEmailResponse], error) {
|
|
413
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.VerifyEmail is not implemented"))
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
func (UnimplementedAuthServiceHandler) ValidateOTP(context.Context, *connect.Request[entities.ValidateOTPRequest]) (*connect.Response[entities.ValidateOTPResponse], error) {
|
|
417
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.ValidateOTP is not implemented"))
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
func (UnimplementedAuthServiceHandler) Register(context.Context, *connect.Request[entities.RegisterRequest]) (*connect.Response[entities.RegisterResponse], error) {
|
|
421
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.Register is not implemented"))
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
func (UnimplementedAuthServiceHandler) GetPolicies(context.Context, *connect.Request[entities.PolicyEmptyRequest]) (*connect.Response[entities.GetPoliciesResponse], error) {
|
|
425
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.GetPolicies is not implemented"))
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
func (UnimplementedAuthServiceHandler) SavePolicies(context.Context, *connect.Request[entities.SavePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
429
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.SavePolicies is not implemented"))
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
func (UnimplementedAuthServiceHandler) AddPolicy(context.Context, *connect.Request[entities.ChangePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
433
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.AddPolicy is not implemented"))
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
func (UnimplementedAuthServiceHandler) RemovePolicy(context.Context, *connect.Request[entities.ChangePolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
437
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.RemovePolicy is not implemented"))
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
func (UnimplementedAuthServiceHandler) AddPolicies(context.Context, *connect.Request[entities.ChangePoliciesRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
441
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.AddPolicies is not implemented"))
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
func (UnimplementedAuthServiceHandler) RemovePolicies(context.Context, *connect.Request[entities.ChangePoliciesRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
445
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.RemovePolicies is not implemented"))
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
func (UnimplementedAuthServiceHandler) GetFilteredPolicy(context.Context, *connect.Request[entities.FilteredPolicyRequest]) (*connect.Response[entities.GetPoliciesResponse], error) {
|
|
449
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.GetFilteredPolicy is not implemented"))
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
func (UnimplementedAuthServiceHandler) RemoveFilteredPolicy(context.Context, *connect.Request[entities.RemoveFilteredPolicyRequest]) (*connect.Response[entities.PolicyEmptyResponse], error) {
|
|
453
|
-
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("apps.enterprise.interfaces.rpc.auth.v1.AuthService.RemoveFilteredPolicy is not implemented"))
|
|
454
|
-
}
|