Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/config/swagger-merger-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
}
],
"paths": {
"$ref": "../../gen/openapiv2/server/shop/catalog/v1/service.swagger.json#paths",
"$ref": "../../gen/openapiv2/server/shop/user/v1/service.swagger.json#paths",
"$ref": "../../gen/openapiv2/server/shop/purchase/v1/service.swagger.json#paths"
"$ref": "../../gen/openapiv2/server/egress/shop/catalog/v1/service.swagger.json#paths",
"$ref": "../../gen/openapiv2/server/egress/shop/user/v1/service.swagger.json#paths",
"$ref": "../../gen/openapiv2/server/egress/shop/purchase/v1/service.swagger.json#paths"
},
"definitions": {
"$ref": "../../gen/openapiv2/server/shop/catalog/v1/service.swagger.json#definitions",
"$ref": "../../gen/openapiv2/server/shop/user/v1/service.swagger.json#definitions",
"$ref": "../../gen/openapiv2/server/shop/purchase/v1/service.swagger.json#definitions"
"$ref": "../../gen/openapiv2/server/egress/shop/catalog/v1/service.swagger.json#definitions",
"$ref": "../../gen/openapiv2/server/egress/shop/user/v1/service.swagger.json#definitions",
"$ref": "../../gen/openapiv2/server/egress/shop/purchase/v1/service.swagger.json#definitions"
},
"securityDefinitions": {
"$ref": "../../gen/openapiv2/server/server.swagger.json#securityDefinitions"
"$ref": "../../gen/openapiv2/server/egress/server.swagger.json#securityDefinitions"
}
}
8 changes: 4 additions & 4 deletions gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ buf generate

# Generate TypeScript clients from OpenAPI specs
echo "Generating TypeScript clients..."
mkdir -p gen/typescript/server/shop/catalog gen/typescript/server/shop/user gen/typescript/server/shop/purchase
npx --yes swagger-typescript-api@9.3.1 -p ./gen/openapiv2/server/shop/catalog/v1/service.swagger.json -o ./gen/typescript/server/shop/catalog/ -n catalog-client.ts --route-types --module-name-index=1 --no-client
npx swagger-typescript-api@9.3.1 -p ./gen/openapiv2/server/shop/user/v1/service.swagger.json -o ./gen/typescript/server/shop/user/ -n user-client.ts --route-types --module-name-index=1 --no-client
npx swagger-typescript-api@9.3.1 -p ./gen/openapiv2/server/shop/purchase/v1/service.swagger.json -o ./gen/typescript/server/shop/purchase/ -n purchase-client.ts --route-types --module-name-index=1 --no-client
mkdir -p gen/typescript/server/egress/shop/catalog gen/typescript/server/egress/shop/user gen/typescript/server/egress/shop/purchase
npx --yes swagger-typescript-api@9.3.1 -p ./gen/openapiv2/server/egress/shop/catalog/v1/service.swagger.json -o ./gen/typescript/server/egress/shop/catalog/ -n catalog-client.ts --route-types --module-name-index=1 --no-client
npx swagger-typescript-api@9.3.1 -p ./gen/openapiv2/server/egress/shop/user/v1/service.swagger.json -o ./gen/typescript/server/egress/shop/user/ -n user-client.ts --route-types --module-name-index=1 --no-client
npx swagger-typescript-api@9.3.1 -p ./gen/openapiv2/server/egress/shop/purchase/v1/service.swagger.json -o ./gen/typescript/server/egress/shop/purchase/ -n purchase-client.ts --route-types --module-name-index=1 --no-client

# Merge all OpenAPI specs into a single swagger file
echo "Merging Swagger files..."
Expand Down
4 changes: 2 additions & 2 deletions server/server.proto → server/egress/server.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";

// buf:lint:ignore PACKAGE_VERSION_SUFFIX
package server;
package server.egress;

import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "github.com/stashgg/public-api/gen/proto/server";
option go_package = "github.com/stashgg/public-api/gen/proto/server/egress";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Stash Web Shop API"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";

package server.shop.catalog.v1;
package server.egress.shop.catalog.v1;

import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "github.com/stashgg/public-api/gen/proto/server/shop/catalog/v1";
option go_package = "github.com/stashgg/public-api/gen/proto/server/egress/shop/catalog/v1";

enum CatalogPlatform {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_enum) = {description: "Represents the platform of the user viewing the catalog"};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
syntax = "proto3";

package server.shop.catalog.v1;
package server.egress.shop.catalog.v1;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "server/shop/catalog/v1/enums.proto";
import "server/shop/v1/enums.proto";
import "server/egress/shop/catalog/v1/enums.proto";
import "server/egress/shop/v1/enums.proto";
import "validate/validate.proto";

option go_package = "github.com/stashgg/public-api/gen/proto/server/shop/catalog/v1";
option go_package = "github.com/stashgg/public-api/gen/proto/server/egress/shop/catalog/v1";

service CatalogService {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = {
Expand Down Expand Up @@ -100,7 +100,7 @@ message GetCatalogRequest {
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional player ID filter to get player-specific catalog items"}
];
server.shop.v1.PaymentEnvironment environment = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
server.egress.shop.v1.PaymentEnvironment environment = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
}

message GetCatalogResponse {
Expand Down Expand Up @@ -708,7 +708,7 @@ message GetOfferDetailsRequest {
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional player ID filter to get player-specific catalog items"}
];
server.shop.v1.PaymentEnvironment environment = 7 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
server.egress.shop.v1.PaymentEnvironment environment = 7 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
}

message GetOfferDetailsResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";

package server.shop.purchase.v1;
package server.egress.shop.purchase.v1;

import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "github.com/stashgg/public-api/gen/proto/server/shop/purchase/v1";
option go_package = "github.com/stashgg/public-api/gen/proto/server/egress/shop/purchase/v1";

enum PurchaseRegistrationStatus {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_enum) = {description: "Represents the status of a purchase registration"};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
syntax = "proto3";

package server.shop.purchase.v1;
package server.egress.shop.purchase.v1;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "server/shop/purchase/v1/enums.proto";
import "server/shop/v1/enums.proto";
import "server/egress/shop/purchase/v1/enums.proto";
import "server/egress/shop/v1/enums.proto";
import "validate/validate.proto";

option go_package = "github.com/stashgg/public-api/gen/proto/server/shop/purchase/v1";
option go_package = "github.com/stashgg/public-api/gen/proto/server/egress/shop/purchase/v1";

service PurchaseService {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = {
Expand Down Expand Up @@ -89,7 +89,7 @@ message RegisterPaymentRequest {
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Unique transaction identifier for this purchase session"}
];
optional string checkout_link_id = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional checkout link identifier if purchase was made through a checkout link"}];
server.shop.v1.PaymentEnvironment environment = 12 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
server.egress.shop.v1.PaymentEnvironment environment = 12 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];

string currency = 4 [
(google.api.field_behavior) = REQUIRED,
Expand Down Expand Up @@ -221,7 +221,7 @@ message CancelPaymentRequest {
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Transaction identifier to cancel"}
];
optional string checkout_link_id = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional checkout link identifier if purchase was made through a checkout link"}];
server.shop.v1.PaymentEnvironment environment = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
server.egress.shop.v1.PaymentEnvironment environment = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];

message CanceledItem {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
Expand Down Expand Up @@ -303,7 +303,7 @@ message ConfirmPaymentRequest {
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Transaction identifier to confirm"}
];
optional string checkout_link_id = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional checkout link identifier if purchase was made through a checkout link"}];
server.shop.v1.PaymentEnvironment environment = 21 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
server.egress.shop.v1.PaymentEnvironment environment = 21 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];

string currency = 4 [
(google.api.field_behavior) = REQUIRED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
syntax = "proto3";

package server.shop.user.v1;
package server.egress.shop.user.v1;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "server/shop/v1/enums.proto";
import "server/egress/shop/v1/enums.proto";
import "validate/validate.proto";

option go_package = "github.com/stashgg/public-api/gen/proto/server/shop/user/v1";
option go_package = "github.com/stashgg/public-api/gen/proto/server/egress/shop/user/v1";

service UserService {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = {
Expand Down Expand Up @@ -42,7 +42,7 @@ message GetPlayerRequest {
(validate.rules).string.min_len = 1,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The player ID to retrieve"}
];
server.shop.v1.PaymentEnvironment environment = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
server.egress.shop.v1.PaymentEnvironment environment = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}];
}

message GetPlayerResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";

package server.shop.v1;
package server.egress.shop.v1;

import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "github.com/stashgg/public-api/gen/proto/server/shop/v1";
option go_package = "github.com/stashgg/public-api/gen/proto/server/egress/shop/v1";

enum PaymentEnvironment {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_enum) = {description: "Represents the payment environment for the request"};
Expand Down
Loading