Skip to content

Commit

Permalink
remove package from permissions, add rest of build files
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-kugler committed Aug 16, 2023
1 parent 74a212b commit 0d8b5f1
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 17 deletions.
2 changes: 1 addition & 1 deletion javascript-web/generate_protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mkdir $out
# So we do a terrible hack to comment out the package declaration before generating the JS types,
# but add them back before generating the GRPC web bindings

proto_file_list=" extensions.proto cacheclient.proto controlclient.proto auth.proto cacheping.proto cachepubsub.proto vectorindex.proto "
proto_file_list=" permissions.proto extensions.proto cacheclient.proto controlclient.proto auth.proto cacheping.proto cachepubsub.proto vectorindex.proto token.proto "

echo "Backing up protos dir"
cp -r ../proto ../proto.bak
Expand Down
1 change: 1 addition & 0 deletions javascript-web/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * as cache from './CacheclientServiceClientPb'
export * as control from './ControlclientServiceClientPb'
export * as auth from './AuthServiceClientPb'
export * as token from './TokenServiceClientPb'
export * as ping from './CachepingServiceClientPb'
38 changes: 31 additions & 7 deletions javascript-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion javascript-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
"license": "Apache-2.0",
"devDependencies": {
"@tsconfig/node16": "1.0.2",
"@types/google-protobuf": "^3.15.6",
"@types/node": "16.10.3",
"typescript": "4.4.3"
"typescript": "^4.9.5"
},
"dependencies": {
"google-protobuf": "3.21.2",
"grpc-web": "1.4.2"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion javascript/generate_protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -e
set -x

PATH=node_modules/protoc-gen-ts/bin/:$PATH protoc -I=../proto -I=/usr/local/include --ts_out=src cacheclient.proto controlclient.proto cachepubsub.proto auth.proto cacheping.proto vectorindex.proto
PATH=node_modules/protoc-gen-ts/bin/:$PATH protoc -I=../proto -I=/usr/local/include --ts_out=src permissions.proto cacheclient.proto controlclient.proto cachepubsub.proto auth.proto cacheping.proto vectorindex.proto token.proto
1 change: 1 addition & 0 deletions javascript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * as control from './controlclient'
export * as pubsub from './cachepubsub'
export * as ping from './cacheping'
export * as auth from './auth'
export * as token from './token'
Binary file not shown.
2 changes: 1 addition & 1 deletion proto/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ message _GenerateApiTokenRequest {

string auth_token = 3;

permissions.Permissions permissions = 4;
Permissions permissions = 4;
}

message _GenerateApiTokenResponse {
Expand Down
2 changes: 0 additions & 2 deletions proto/permissions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ option go_package = "github.com/momentohq/client-sdk-go;client_sdk_go";
option java_multiple_files = true;
option java_package = "momento.shared.permissions";

package permissions;

// Aliases for categories of functionality.
enum CacheRole {
CachePermitNone = 0;
Expand Down
4 changes: 1 addition & 3 deletions proto/token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ option go_package = "github.com/momentohq/client-sdk-go;client_sdk_go";
option java_multiple_files = true;
option java_package = "momento.auth";

package token;

service Token {
rpc GenerateTempAuthToken (_GenerateTempAuthTokenRequest) returns (stream _GenerateTempAuthTokenResponse) {}
}
Expand All @@ -21,7 +19,7 @@ message _GenerateTempAuthTokenRequest {

Expires expires = 1;

permissions.Permissions permissions = 2;
Permissions permissions = 2;
}

message _GenerateTempAuthTokenResponse {
Expand Down
2 changes: 1 addition & 1 deletion python/run-protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ do
if [[ $python_protobuf_version == "protobuf>4" ]]; then
pyi_out="--pyi_out=$src_path"
fi
poetry run python -m grpc_tools.protoc -I../proto --python_out=$src_path $pyi_out --grpc_python_out=$src_path extensions.proto cacheclient.proto controlclient.proto auth.proto cachepubsub.proto vectorindex.proto
poetry run python -m grpc_tools.protoc -I../proto --python_out=$src_path $pyi_out --grpc_python_out=$src_path permissions.proto extensions.proto cacheclient.proto controlclient.proto auth.proto cachepubsub.proto vectorindex.proto token.proto

# A shortcoming of the generated code is in the grpc generated code,
# the protobuf imports are absolute instead of relative.
Expand Down

0 comments on commit 0d8b5f1

Please sign in to comment.