Skip to content

Commit

Permalink
Made blob storage connection string and SAS URL optional. (#876)
Browse files Browse the repository at this point in the history
* Fixed type definition circular reference issue.
* Made blob storage connection string and URL optional.
  • Loading branch information
azaslonov authored Sep 3, 2020
1 parent 7f624ef commit 81e370d
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 86 deletions.
96 changes: 48 additions & 48 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
"webpack-merge": "^5.1.2"
},
"dependencies": {
"@paperbits/azure": "0.1.314",
"@paperbits/common": "0.1.314",
"@paperbits/core": "0.1.314",
"@paperbits/prosemirror": "0.1.314",
"@paperbits/styles": "0.1.314",
"@paperbits/azure": "0.1.317",
"@paperbits/common": "0.1.317",
"@paperbits/core": "0.1.317",
"@paperbits/prosemirror": "0.1.317",
"@paperbits/styles": "0.1.317",
"@webcomponents/custom-elements": "1.4.2",
"@webcomponents/shadydom": "^1.7.4",
"adal-vanilla": "^1.0.18",
Expand Down
5 changes: 2 additions & 3 deletions src/apim.design.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Constants from "./constants";
import { UnsavedChangesRouteGuard } from "./routing/unsavedChangesRouteGuard";
import { MapiObjectStorage } from "./persistence/mapiObjectStorage";
import { MapiObjectStorage, MapiBlobStorage } from "./persistence";
import { DefaultAuthenticator } from "./components/defaultAuthenticator";
import { IInjector, IInjectorModule } from "@paperbits/common/injection";
import { ConsoleLogger } from "@paperbits/common/logging";
Expand All @@ -25,7 +25,6 @@ import { SubscriptionsDesignModule } from "./components/users/subscriptions/subs
import { ProductDetailsModule } from "./components/products/product-details/productDetails.module";
import { ProductDetailsDesignModule } from "./components/products/product-details/productDetails.design.module";
import { MapiClient, IdentityService } from "./services";
import { AzureBlobStorage } from "@paperbits/azure";
import { SetupModule } from "./components/setup/setup.module";
import { ContentModule } from "./components/content";
import { OperationListModule } from "./components/operations/operation-list/ko/operationList.module";
Expand Down Expand Up @@ -110,7 +109,6 @@ export class ApimDesignModule implements IInjectorModule {
injector.bindModule(new SigninSocialEditorModule());
injector.bindSingleton("app", App);
injector.bindSingleton("logger", ConsoleLogger);
injector.bindSingleton("blobStorage", AzureBlobStorage);
injector.bindSingleton("tenantService", TenantService);
injector.bindSingleton("backendService", BackendService);
injector.bindSingleton("roleService", StaticRoleService);
Expand All @@ -120,6 +118,7 @@ export class ApimDesignModule implements IInjectorModule {
injector.bindSingleton("mapiClient", MapiClient);
injector.bindSingleton("authenticator", DefaultAuthenticator);
injector.bindSingleton("objectStorage", MapiObjectStorage);
injector.bindSingleton("blobStorage", MapiBlobStorage);
injector.bindToCollection("routeGuards", OldContentRouteGuard);
injector.bindToCollection("routeGuards", UnsavedChangesRouteGuard);
injector.bindInstance("reservedPermalinks", Constants.reservedPermalinks);
Expand Down
7 changes: 3 additions & 4 deletions src/apim.publish.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { IInjector, IInjectorModule } from "@paperbits/common/injection";
import { ConsoleLogger } from "@paperbits/common/logging";
import { AzureBlobStorage } from "@paperbits/azure";
import { MapiClient } from "./services/mapiClient";
import { MapiObjectStorage } from "./persistence/mapiObjectStorage";
import { MapiObjectStorage, MapiBlobStorage } from "./persistence";
import { ListOfApisModule } from "./components/apis/list-of-apis/ko/listOfApis.module";
import { DetailsOfApiModule } from "./components/apis/details-of-api/ko/detailsOfApi.module";
import { HistoryOfApiModule } from "./components/apis/history-of-api/ko/historyOfApi.module";
Expand Down Expand Up @@ -56,8 +55,7 @@ export class ApimPublishModule implements IInjectorModule {
injector.bindModule(new ConfirmPasswordModule());
injector.bindModule(new ChangePasswordModule());
injector.bindModule(new ReportsModule());
injector.bindModule(new ValidationSummaryModule());
injector.bindSingleton("blobStorage", AzureBlobStorage);
injector.bindModule(new ValidationSummaryModule());
injector.bindSingleton("tenantService", TenantService);
injector.bindSingleton("backendService", BackendService);
injector.bindSingleton("userService", StaticUserService);
Expand All @@ -68,6 +66,7 @@ export class ApimPublishModule implements IInjectorModule {
injector.bindSingleton("authenticator", StaticAuthenticator);
injector.bindSingleton("mapiClient", MapiClient);
injector.bindSingleton("objectStorage", MapiObjectStorage);
injector.bindSingleton("blobStorage", MapiBlobStorage);
injector.bindSingleton("logger", ConsoleLogger);
injector.bindSingleton("oauthService", OAuthService);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ export class OperationDetails {

if ((definition.type instanceof TypeDefinitionPropertyTypeReference
|| definition.type instanceof TypeDefinitionPropertyTypeArrayOfPrimitive
|| definition.type instanceof TypeDefinitionPropertyTypeArrayOfReference)
&& !skipNames.includes(definition.type.name)) {
|| definition.type instanceof TypeDefinitionPropertyTypeArrayOfReference)) {
result.push(definition.type.name);
}

Expand All @@ -243,7 +242,7 @@ export class OperationDetails {
}
});

return result;
return result.filter(x => !skipNames.includes(x));
}

public async loadGatewayInfo(apiName: string): Promise<void> {
Expand Down
12 changes: 5 additions & 7 deletions src/config.design.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"managementApiUrl": "https://<service-name>.management.azure-api.net",
"managementApiAccessToken": "SharedAccessSignature ...",
"blobStorageContainer": "content",
"blobStorageUrl": "https://<account>.blob.core.windows.net?st=...",
"environment": "development",
"backendUrl": "https://<service-name>.developer.azure-api.net",
"useHipCaptcha": false
"environment": "development",
"managementApiUrl": "https://<service-name>.management.azure-api.net",
"managementApiAccessToken": "SharedAccessSignature ...",
"backendUrl": "https://<service-name>.developer.azure-api.net",
"useHipCaptcha": false
}
10 changes: 4 additions & 6 deletions src/config.publish.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"managementApiUrl": "https://<service-name>.management.azure-api.net",
"managementApiAccessToken": "SharedAccessSignature...",
"blobStorageContainer": "content",
"blobStorageConnectionString": "DefaultEndpointsProtocol=...",
"environment": "publishing",
"useHipCaptcha": false
"environment": "publishing",
"managementApiUrl": "https://<service-name>.management.azure-api.net",
"managementApiAccessToken": "SharedAccessSignature...",
"useHipCaptcha": false
}
6 changes: 3 additions & 3 deletions src/config.runtime.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"managementApiUrl": "https://<service-name>.management.azure-api.net",
"environment": "runtime",
"backendUrl": "https://<service-name>.developer.azure-api.net"
"environment": "runtime",
"managementApiUrl": "https://<service-name>.management.azure-api.net",
"backendUrl": "https://<service-name>.developer.azure-api.net"
}
2 changes: 2 additions & 0 deletions src/persistence/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./mapiObjectStorage";
export * from "./mapiBlobStorage";
Loading

0 comments on commit 81e370d

Please sign in to comment.