├── scaffolds └── widget │ ├── npm_dependencies │ ├── ko │ ├── widgetView.html │ ├── runtime │ │ ├── widget-runtime.html │ │ └── widget-runtime.ts │ ├── widgetEditorView.html │ ├── index.ts │ └── widgetViewModel.ts │ ├── index.ts │ ├── widgetContract.ts │ ├── widgetModel.ts │ ├── constants.ts │ ├── widget.runtime.module.ts │ ├── readme.md │ └── widget.publish.module.ts ├── src ├── persistence │ ├── index.ts │ ├── contractVisitors │ │ └── objectContractVisitor.ts │ └── publishingCacheModule.ts ├── components │ ├── spinner │ │ ├── spinner.html │ │ └── spinner.ts │ ├── app │ │ └── app.html │ ├── help │ │ ├── helpDetails.html │ │ ├── index.ts │ │ ├── hint.ts │ │ ├── articles │ │ │ ├── cors.html │ │ │ └── domain.html │ │ ├── help.module.ts │ │ ├── help.html │ │ ├── helpDetails.ts │ │ └── helpSection.ts │ ├── users │ │ ├── reset-password │ │ │ ├── resetPasswordModel.ts │ │ │ ├── resetPasswordContract.ts │ │ │ ├── resetPasswordHandlers.ts │ │ │ ├── resetPassword.runtime.module.ts │ │ │ └── react │ │ │ │ └── ResetPasswordViewModel.tsx │ │ ├── signin │ │ │ ├── signinModel.ts │ │ │ ├── signinContract.ts │ │ │ ├── signinHandlers.ts │ │ │ ├── signin.runtime.module.ts │ │ │ ├── react │ │ │ │ └── SigninViewModel.tsx │ │ │ └── signinModelBinder.ts │ │ ├── profile │ │ │ ├── profileModel.ts │ │ │ ├── profileContract.ts │ │ │ ├── profileHandlers.ts │ │ │ ├── profile.runtime.module.ts │ │ │ ├── react │ │ │ │ └── ProfileViewModel.tsx │ │ │ └── profileModelBinder.ts │ │ ├── signup-social │ │ │ ├── signupSocialModel.ts │ │ │ ├── signupSocialContract.ts │ │ │ ├── signupSocialHandlers.ts │ │ │ └── signupSocial.runtime.module.ts │ │ ├── confirm-password │ │ │ ├── confirmPasswordModel.ts │ │ │ ├── confirmPasswordContract.ts │ │ │ ├── confirmPasswordHandlers.ts │ │ │ ├── confirmPassword.runtime.module.ts │ │ │ └── react │ │ │ │ └── ConfirmPasswordViewModel.tsx │ │ ├── subscriptions │ │ │ ├── subscriptionsModel.ts │ │ │ ├── subscriptionsContract.ts │ │ │ ├── subscriptionsHandlers.ts │ │ │ ├── subscriptions.runtime.module.ts │ │ │ └── react │ │ │ │ └── SubscriptionsViewModel.tsx │ │ ├── validation-summary │ │ │ ├── validationSummaryModel.ts │ │ │ ├── validationSummaryContract.ts │ │ │ ├── ko │ │ │ │ └── runtime │ │ │ │ │ └── validation-summary.html │ │ │ ├── validationSummaryHandlers.ts │ │ │ ├── constants.ts │ │ │ ├── validationSummary.runtime.module.ts │ │ │ └── react │ │ │ │ └── ValidationSummaryViewModel.tsx │ │ ├── signin-social │ │ │ ├── ko │ │ │ │ └── runtime │ │ │ │ │ ├── signin-aad.html │ │ │ │ │ └── signin-aad-b2c.html │ │ │ └── signinSocial.runtime.module.ts │ │ ├── signup │ │ │ ├── signupModel.ts │ │ │ ├── signupHandlers.ts │ │ │ ├── signupContract.ts │ │ │ ├── ko │ │ │ │ └── signupEditor.html │ │ │ └── signup.runtime.module.ts │ │ └── change-password │ │ │ ├── changePasswordModel.ts │ │ │ ├── changePasswordContract.ts │ │ │ ├── changePasswordHandlers.ts │ │ │ ├── changePassword.runtime.module.ts │ │ │ └── react │ │ │ └── ChangePasswordViewModel.tsx │ ├── utils │ │ ├── react │ │ │ ├── PlaceholderContent.tsx │ │ │ ├── ScrollableTableContainer.tsx │ │ │ ├── NoRecordsRow.tsx │ │ │ └── validateBasic.ts │ │ └── index.ts │ ├── custom-widget │ │ ├── ko │ │ │ ├── customWidgetView.html │ │ │ ├── index.ts │ │ │ ├── constants.ts │ │ │ ├── runtime │ │ │ │ └── customWidget.html │ │ │ └── customWidgetViewModel.ts │ │ ├── index.ts │ │ ├── constants.ts │ │ └── customWidget.runtime.module.ts │ ├── apis │ │ ├── list-of-apis │ │ │ ├── ko │ │ │ │ └── runtime │ │ │ │ │ ├── index.ts │ │ │ │ │ └── tagGroupViewModel.ts │ │ │ ├── listOfApis.runtime.module.ts │ │ │ └── listOfApisHandlers.ts │ │ ├── details-of-api │ │ │ ├── ko │ │ │ │ └── runtime │ │ │ │ │ └── api-details.spec.ts │ │ │ ├── detailsOfApiHandlers.ts │ │ │ ├── detailsOfApiModel.ts │ │ │ ├── detailsOfApiContract.ts │ │ │ └── detailsOfApi.runtime.module.ts │ │ ├── history-of-api │ │ │ ├── historyOfApiHandlers.ts │ │ │ ├── historyOfApiModel.ts │ │ │ ├── historyOfApiContract.ts │ │ │ └── historyOfApi.runtime.module.ts │ │ └── api-products │ │ │ ├── apiProductsContract.ts │ │ │ ├── apiProductsModel.ts │ │ │ ├── apiProducts.runtime.module.ts │ │ │ └── apiProductsHandlers.ts │ ├── custom-widget-list │ │ ├── index.ts │ │ ├── copyCode.html │ │ ├── customWidgetModel.ts │ │ ├── copyCode.ts │ │ └── fallbackUi.html │ ├── content │ │ ├── index.ts │ │ ├── content.html │ │ └── content.module.ts │ ├── custom-html │ │ ├── ko │ │ │ ├── index.ts │ │ │ ├── customHtmlView.html │ │ │ └── constants.ts │ │ ├── index.ts │ │ ├── customHtmlContract.ts │ │ ├── customHtmlModel.ts │ │ ├── constants.ts │ │ └── customHtmlHandlers.ts │ ├── setup │ │ ├── setupDialog.html │ │ └── setup.module.ts │ ├── operations │ │ ├── operation-details │ │ │ ├── ko │ │ │ │ └── runtime │ │ │ │ │ ├── templates │ │ │ │ │ ├── ws_wscat.liquid │ │ │ │ │ └── http.liquid │ │ │ │ │ ├── apiKeyDetails.ts │ │ │ │ │ ├── oauthSession.ts │ │ │ │ │ ├── responsePackage.ts │ │ │ │ │ └── code-snippet.html │ │ │ ├── react │ │ │ │ └── runtime │ │ │ │ │ └── operation-console │ │ │ │ │ └── templates │ │ │ │ │ ├── ws_wscat.liquid │ │ │ │ │ └── http.liquid │ │ │ ├── operationDetailsHandlers.ts │ │ │ └── operationDetails.runtime.module.ts │ │ └── operation-list │ │ │ ├── operationListHandlers.ts │ │ │ └── operationList.runtime.module.ts │ ├── products │ │ ├── product-list │ │ │ ├── react │ │ │ │ └── runtime │ │ │ │ │ └── utils.ts │ │ │ ├── productList.runtime.module.ts │ │ │ └── productListHandlers.ts │ │ ├── product-details │ │ │ ├── productDetailsModel.ts │ │ │ ├── productDetailsContract.ts │ │ │ ├── productDetailsHandlers.ts │ │ │ ├── ko │ │ │ │ └── runtime │ │ │ │ │ └── product-details.html │ │ │ └── productDetails.runtime.module.ts │ │ ├── product-subscriptions │ │ │ ├── productSubscriptionsModel.ts │ │ │ ├── productSubscriptionsContract.ts │ │ │ ├── productSubscriptionsHandlers.ts │ │ │ └── productSubscriptions.runtime.module.ts │ │ ├── product-subscribe │ │ │ ├── productSubscribeHandlers.ts │ │ │ ├── productSubscribeModel.ts │ │ │ ├── ko │ │ │ │ └── productSubscribeEditor.html │ │ │ ├── productSubscribeContract.ts │ │ │ └── productSubscribe.runtime.module.ts │ │ └── product-apis │ │ │ ├── productApis.runtime.module.ts │ │ │ ├── productApisHandlers.ts │ │ │ ├── productApisContract.ts │ │ │ └── productApisModel.ts │ ├── code-editor │ │ ├── code-editor.html │ │ └── code-editor.ts │ ├── reports │ │ ├── reportsModel.ts │ │ ├── ko │ │ │ ├── reportsEditor.html │ │ │ └── reportsEditor.ts │ │ ├── mapChart │ │ │ ├── mapChartConfig.ts │ │ │ └── mapChartRecord.ts │ │ ├── reportsContract.ts │ │ ├── reportsHandlers.ts │ │ ├── minMaxAvgChart │ │ │ └── minMaxAvgChartRecord.ts │ │ ├── reports.runtime.module.ts │ │ ├── react │ │ │ ├── runtime │ │ │ │ └── utils.ts │ │ │ └── ReportsViewModel.tsx │ │ └── reportsModelBinder.ts │ ├── file-input │ │ └── file-input.html │ └── tag-input │ │ └── tag-input.html ├── authentication │ ├── index.ts │ └── IEditorSettings.ts ├── themes │ ├── designer │ │ ├── styles │ │ │ ├── widgets │ │ │ │ ├── video.scss │ │ │ │ └── map.scss │ │ │ ├── editors │ │ │ │ ├── rowLayoutSelector.scss │ │ │ │ ├── videoEditor.scss │ │ │ │ └── fontEditor.scss │ │ │ ├── confirmation.scss │ │ │ ├── fonts │ │ │ │ ├── paperbits.eot │ │ │ │ ├── paperbits.ttf │ │ │ │ ├── paperbits.woff │ │ │ │ ├── OpenSans-Bold.ttf │ │ │ │ ├── SegoeUI-Bold.ttf │ │ │ │ ├── SegoeUI-Light.ttf │ │ │ │ ├── paperbits.woff2 │ │ │ │ ├── OpenSans-Italic.ttf │ │ │ │ ├── OpenSans-Light.ttf │ │ │ │ ├── SegoeUI-Italic.ttf │ │ │ │ ├── SegoeUI-Regular.ttf │ │ │ │ ├── OpenSans-Regular.ttf │ │ │ │ ├── SegoeUI-BoldItalic.ttf │ │ │ │ ├── OpenSans-BoldItalic.ttf │ │ │ │ ├── OpenSans-LightItalic.ttf │ │ │ │ └── SegoeUI-LightItalic.ttf │ │ │ ├── icons │ │ │ │ ├── icon-menu.svg │ │ │ │ ├── icon-select-input.svg │ │ │ │ ├── icon-submit-form-button.svg │ │ │ │ ├── icon-tab-panel.svg │ │ │ │ ├── icon-video-player.svg │ │ │ │ ├── icon-picture.svg │ │ │ │ ├── icon-table.svg │ │ │ │ ├── icon-button.svg │ │ │ │ └── icon-api-management.svg │ │ │ ├── widgets.scss │ │ │ ├── tooltips.scss │ │ │ ├── codeEditor.scss │ │ │ ├── dropdowns.scss │ │ │ ├── slider.scss │ │ │ ├── grid.scss │ │ │ ├── flex.scss │ │ │ ├── draggables.scss │ │ │ ├── scaffolding.scss │ │ │ └── blocks.scss │ │ └── images │ │ │ ├── no-preview.png │ │ │ ├── onboarding-1.png │ │ │ ├── onboarding-2.png │ │ │ ├── onboarding-3.png │ │ │ └── onboarding-4.png │ └── website │ │ ├── styles │ │ ├── widgets │ │ │ ├── map.scss │ │ │ ├── picture.scss │ │ │ ├── tables.scss │ │ │ ├── card.scss │ │ │ ├── button.scss │ │ │ ├── fui │ │ │ │ ├── reports.scss │ │ │ │ └── api-details.scss │ │ │ ├── captcha.scss │ │ │ ├── tabs.scss │ │ │ ├── widgets.scss │ │ │ ├── textblock.scss │ │ │ └── popups.scss │ │ ├── fonts │ │ │ ├── icons.eot │ │ │ ├── icons.ttf │ │ │ └── icons.woff │ │ ├── monaco.editor.scss │ │ ├── operations.scss │ │ ├── icons │ │ │ └── icon-cancel.svg │ │ ├── alerts.scss │ │ ├── grids.scss │ │ ├── mixins.scss │ │ ├── lists.scss │ │ ├── details.scss │ │ ├── badges.scss │ │ ├── svgs │ │ │ └── download.svg │ │ ├── charts.scss │ │ ├── breadcrumbs.scss │ │ ├── buttons.scss │ │ ├── pills.scss │ │ ├── text.scss │ │ ├── subscriptions.scss │ │ ├── pagination.scss │ │ └── resizables.scss │ │ ├── images │ │ └── hipaudioplay.png │ │ └── assets │ │ └── page.html ├── logging │ ├── wellKnownEventTypes.ts │ └── utils │ │ └── defaultEventTypeProvider.ts ├── configuration │ └── index.ts ├── contracts │ ├── nameValuePair.ts │ ├── portalConfigSignin.ts │ ├── url.ts │ ├── product.ts │ ├── page.ts │ ├── validationReport.ts │ ├── portalConfigSignup.ts │ ├── armResource.ts │ ├── apiHostname.ts │ ├── apiHostnames.ts │ ├── portalConfigDelegationSecrets.ts │ ├── hostname.ts │ ├── tag.ts │ ├── subscriptionSecrets.ts │ ├── httpResponse.ts │ ├── example.ts │ ├── tagResource.ts │ ├── trace.ts │ ├── oauthSession.ts │ ├── delegationSettings.ts │ ├── reportRecordByApi.ts │ ├── openIdConnectProvider.ts │ ├── identity.ts │ ├── reportRecordByProduct.ts │ ├── reportRecordByGeo.ts │ ├── portalConfigCors.ts │ ├── reportRecordByTime.ts │ ├── apiChangeLog.ts │ ├── reportRecordByOperation.ts │ ├── aadB2CClientConfig.ts │ ├── oauthTokenResponse.ts │ ├── revision.ts │ ├── apiTagDescription.ts │ ├── portalConfig.ts │ ├── signupRequest.ts │ ├── reportRecordBySubscription.ts │ ├── response.ts │ ├── request.ts │ ├── searchQuery.ts │ ├── apiVersionSet.ts │ ├── authenticationSettings.ts │ └── resetRequest.ts ├── clients │ ├── retryStrategy │ │ ├── retryStrategy.ts │ │ └── noRetryStrategy.ts │ └── index.ts ├── config.runtime.json ├── errors │ ├── index.ts │ ├── requestError.ts │ ├── appError.ts │ └── unauthorizedError.ts ├── services │ ├── IStaticDataProvider.ts │ ├── index.ts │ ├── ITenantService.ts │ ├── IAadService.ts │ ├── templatingService.ts │ ├── roleService.ts │ ├── policyService.ts │ └── reportQuery.ts ├── config.validate.runtime.json ├── models │ ├── tagGroup.ts │ ├── knownMimeTypes.ts │ ├── tag.ts │ ├── captchaData.ts │ ├── parameterExample.ts │ ├── console │ │ ├── consoleHost.ts │ │ └── consoleRepresentation.ts │ ├── knownHttpHeaders.ts │ ├── service.ts │ ├── statusCode.ts │ └── versionSet.ts ├── config.design.json ├── config.publish.json ├── admin │ ├── custom.d.ts │ └── utils │ │ └── components │ │ └── backButton.tsx ├── config.validate.publish.json ├── polyfills.ts ├── bindingHandlers │ ├── scrollintoview.ts │ ├── acceptChange.ts │ ├── tab.ts │ ├── traceClick.ts │ └── copyToClipboard.ts ├── types │ └── index.d.ts ├── styles │ ├── apimStylePublishModule.ts │ └── apimStylesDesignModule.ts ├── modules.d.ts ├── publishing │ └── runtimeConfigBuilder.ts └── config.validate.json ├── .github ├── ISSUE_TEMPLATE │ └── config.yml └── scripts │ └── wait-for-server.ps1 ├── examples ├── publisher │ └── azure-function │ │ ├── host.json │ │ ├── proxies.json │ │ ├── publish │ │ └── function.json │ │ └── local.settings.json └── widgets │ └── conference-session │ ├── conferenceSessionModel.ts │ ├── image.png │ ├── ko │ ├── runtime │ │ └── conference-session-runtime.html │ ├── conferenceSession.html │ ├── index.ts │ ├── conferenceSessionEditorView.html │ └── conferenceSessionViewModel.ts │ ├── conferenceSessionContract.ts │ ├── index.ts │ ├── constants.ts │ ├── conferenceSession.runtime.module.ts │ ├── readme.md │ └── conferenceSession.publish.module.ts ├── .editorconfig ├── readme ├── portal.png └── show-legal-text-by-default.PNG ├── tests ├── mocks │ ├── index.ts │ ├── user.ts │ └── collection │ │ ├── changePassword.ts │ │ └── resource.ts ├── services │ ├── ITestRunner.ts │ ├── ITestUserService.ts │ ├── ITestApiService.ts │ ├── ITestProvisionService.ts │ ├── testRunner.ts │ └── ITestProductService.ts ├── e2e │ └── runtime │ │ └── user-subscriptions.spec.ts-snapshots │ │ └── self-hosted │ │ └── user-resources-win32.jpeg ├── models │ ├── apiContract.ts │ ├── operationContract.ts │ ├── userContract.ts │ ├── productContract.ts │ ├── portalRevisionContract.ts │ └── subscriptionContract.ts └── tsconfig.json ├── .pipeline └── readme │ ├── variables.png │ ├── create-pipeline.png │ └── select-existing-yaml.png ├── community └── widgets │ └── document-details │ ├── documentDetailsModel.ts │ ├── image.png │ ├── ko │ ├── runtime │ │ └── document-details-runtime.html │ ├── documentDetails.html │ ├── index.ts │ ├── documentDetailsEditorView.html │ └── documentDetailsViewModel.ts │ ├── api_description.png │ ├── sample_document.png │ ├── sample_document_2.png │ ├── authentication_mode.png │ ├── document-details-widget.png │ ├── Echo-api-document-details.png │ ├── documentDetailsContract.ts │ ├── index.ts │ ├── constants.ts │ ├── documentDetails.runtime.module.ts │ └── documentDetails.publish.module.ts ├── postcss.config.js ├── mocha.js ├── scripts.v3 ├── media │ ├── 09879768-b2c8-afbd-a945-934c046b3c2d.jpg │ ├── 4cac439d-5a3d-4b03-38bb-197d32256ee0.png │ ├── 70add409-0933-e01e-acef-99999a71167e.png │ ├── a2514081-47cb-95b1-ef0b-aef128c7a7ed.jpg │ ├── c5d2da83-b255-245c-144b-cd3c242e9791.jpg │ └── ed8e43d0-5f8e-af38-5536-8f0274656ce4.jpg ├── cleanup.bat ├── generate.sh ├── generate.bat ├── capture.bat └── migrate.bat ├── environmentConstants.js ├── .gitattributes ├── .gitignore ├── playwright.config.ts ├── SECURITY.md └── tsconfig.json /scaffolds/widget/npm_dependencies: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/persistence/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./mapiObjectStorage"; -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /scaffolds/widget/ko/widgetView.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/publisher/azure-function/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | trim_trailing_whitespace = true 5 | -------------------------------------------------------------------------------- /src/components/spinner/spinner.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
-------------------------------------------------------------------------------- /scaffolds/widget/ko/runtime/widget-runtime.html: -------------------------------------------------------------------------------- 1 |

Your runtime widget markup

-------------------------------------------------------------------------------- /src/components/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/authentication/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./IAuthenticator"; 2 | export * from "./accessToken"; -------------------------------------------------------------------------------- /src/themes/designer/styles/widgets/video.scss: -------------------------------------------------------------------------------- 1 | video { 2 | width: 100%; 3 | display: block; 4 | } -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/map.scss: -------------------------------------------------------------------------------- 1 | map, 2 | map-runtime { 3 | display: block; 4 | } 5 | -------------------------------------------------------------------------------- /readme/portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/readme/portal.png -------------------------------------------------------------------------------- /src/logging/wellKnownEventTypes.ts: -------------------------------------------------------------------------------- 1 | export enum WellKnownEventTypes { 2 | Publishing = "Publishing" 3 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/editors/rowLayoutSelector.scss: -------------------------------------------------------------------------------- 1 | .row-layout-selector { 2 | width: 400px; 3 | } -------------------------------------------------------------------------------- /src/components/help/helpDetails.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /tests/mocks/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./mockData"; 2 | export * from "./mockHttpClient"; 3 | export * from "./user"; -------------------------------------------------------------------------------- /tests/services/ITestRunner.ts: -------------------------------------------------------------------------------- 1 | export interface ITestRunner { 2 | runTest(...args: any): Promise; 3 | } -------------------------------------------------------------------------------- /src/configuration/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./defaultSettingsProvider"; 2 | export * from "./staticSettingsProvider"; -------------------------------------------------------------------------------- /src/contracts/nameValuePair.ts: -------------------------------------------------------------------------------- 1 | export interface NameValuePair { 2 | name: string; 3 | value: string; 4 | } 5 | -------------------------------------------------------------------------------- /src/contracts/portalConfigSignin.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface PortalConfigSignin { 3 | require: boolean; 4 | } 5 | -------------------------------------------------------------------------------- /src/contracts/url.ts: -------------------------------------------------------------------------------- 1 | export interface Url { 2 | scheme: string; 3 | host: string; 4 | path: string; 5 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/confirmation.scss: -------------------------------------------------------------------------------- 1 | .confirmation { 2 | max-width: 300px; 3 | padding: 15px; 4 | } -------------------------------------------------------------------------------- /src/contracts/product.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/contracts/product.ts -------------------------------------------------------------------------------- /src/clients/retryStrategy/retryStrategy.ts: -------------------------------------------------------------------------------- 1 | export interface IRetryStrategy { 2 | invokeCall(call: any): Promise; 3 | } -------------------------------------------------------------------------------- /.pipeline/readme/variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/.pipeline/readme/variables.png -------------------------------------------------------------------------------- /examples/publisher/azure-function/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/proxies", 3 | "proxies": {} 4 | } -------------------------------------------------------------------------------- /src/contracts/page.ts: -------------------------------------------------------------------------------- 1 | export interface PageContract { 2 | value: T[]; 3 | count: number; 4 | nextLink?: string; 5 | } -------------------------------------------------------------------------------- /community/widgets/document-details/documentDetailsModel.ts: -------------------------------------------------------------------------------- 1 | export class DocumentDetailsModel { 2 | public fileName: string; 3 | } 4 | -------------------------------------------------------------------------------- /src/config.runtime.json: -------------------------------------------------------------------------------- 1 | { 2 | "environment": "runtime", 3 | "backendUrl": "https://< service name >.developer.azure-api.net" 4 | } -------------------------------------------------------------------------------- /.pipeline/readme/create-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/.pipeline/readme/create-pipeline.png -------------------------------------------------------------------------------- /examples/widgets/conference-session/conferenceSessionModel.ts: -------------------------------------------------------------------------------- 1 | export class ConferenceSessionModel { 2 | public sessionNumber: string; 3 | } 4 | -------------------------------------------------------------------------------- /readme/show-legal-text-by-default.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/readme/show-legal-text-by-default.PNG -------------------------------------------------------------------------------- /src/components/users/reset-password/resetPasswordModel.ts: -------------------------------------------------------------------------------- 1 | export class ResetPasswordModel { 2 | public requireHipCaptcha: boolean; 3 | } 4 | -------------------------------------------------------------------------------- /src/components/utils/react/PlaceholderContent.tsx: -------------------------------------------------------------------------------- 1 | export const PlaceholderContent = (children: JSX.Element) => { 2 | return (children); 3 | } -------------------------------------------------------------------------------- /src/errors/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./appError"; 2 | export * from "./sessionExpirationErrorHandler"; 3 | export * from "./unhandledErrorHandler"; -------------------------------------------------------------------------------- /src/persistence/contractVisitors/objectContractVisitor.ts: -------------------------------------------------------------------------------- 1 | export interface IObjectContractVisitor { 2 | visit(contract: any): any; 3 | } 4 | -------------------------------------------------------------------------------- /src/services/IStaticDataProvider.ts: -------------------------------------------------------------------------------- 1 | export default interface IStaticDataProvider { 2 | getStaticData(objectType: string): Promise; 3 | } -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/picture.scss: -------------------------------------------------------------------------------- 1 | .picture { 2 | display: inline-block; 3 | flex-basis: auto; 4 | max-width: 100%; 5 | } -------------------------------------------------------------------------------- /scaffolds/widget/ko/widgetEditorView.html: -------------------------------------------------------------------------------- 1 |
2 |

Your widget editor markup

3 |
-------------------------------------------------------------------------------- /src/components/custom-widget/ko/customWidgetView.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/mocks/user.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | firstName: string; 3 | lastName: string; 4 | email: string; 5 | password: string; 6 | } -------------------------------------------------------------------------------- /.pipeline/readme/select-existing-yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/.pipeline/readme/select-existing-yaml.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require("autoprefixer") 4 | ], 5 | sourceMap: true, 6 | minimize: true 7 | } -------------------------------------------------------------------------------- /scaffolds/widget/ko/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./widgetEditorViewModel"; 2 | export * from "./widgetViewModel"; 3 | export * from "./widgetViewModelBinder"; 4 | -------------------------------------------------------------------------------- /src/components/apis/list-of-apis/ko/runtime/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api-list"; 2 | export * from "./api-list-dropdown"; 3 | export * from "./api-list-tiles"; -------------------------------------------------------------------------------- /src/themes/designer/images/no-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/images/no-preview.png -------------------------------------------------------------------------------- /src/themes/designer/styles/widgets/map.scss: -------------------------------------------------------------------------------- 1 | .paperbits-googlemaps { 2 | width: 100%; 3 | height: 100%; 4 | height: 200px; 5 | border: 0; 6 | } -------------------------------------------------------------------------------- /src/themes/website/images/hipaudioplay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/website/images/hipaudioplay.png -------------------------------------------------------------------------------- /src/themes/website/styles/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/website/styles/fonts/icons.eot -------------------------------------------------------------------------------- /src/themes/website/styles/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/website/styles/fonts/icons.ttf -------------------------------------------------------------------------------- /src/themes/website/styles/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/website/styles/fonts/icons.woff -------------------------------------------------------------------------------- /community/widgets/document-details/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/community/widgets/document-details/image.png -------------------------------------------------------------------------------- /examples/widgets/conference-session/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/examples/widgets/conference-session/image.png -------------------------------------------------------------------------------- /src/components/help/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./help.module"; 2 | export * from "./helpSection"; 3 | export * from "./help"; 4 | export * from "./helpDetails"; 5 | -------------------------------------------------------------------------------- /src/themes/designer/images/onboarding-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/images/onboarding-1.png -------------------------------------------------------------------------------- /src/themes/designer/images/onboarding-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/images/onboarding-2.png -------------------------------------------------------------------------------- /src/themes/designer/images/onboarding-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/images/onboarding-3.png -------------------------------------------------------------------------------- /src/themes/designer/images/onboarding-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/images/onboarding-4.png -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/tables.scss: -------------------------------------------------------------------------------- 1 | .table { 2 | overflow: auto; 3 | display: block; 4 | flex-basis: 100%; 5 | max-width: 100%; 6 | } 7 | -------------------------------------------------------------------------------- /community/widgets/document-details/ko/runtime/document-details-runtime.html: -------------------------------------------------------------------------------- 1 |

2 |

-------------------------------------------------------------------------------- /mocha.js: -------------------------------------------------------------------------------- 1 | require("ts-node").register({ 2 | ignore: ["node_modules\/(?!@paperbits)"], 3 | compilerOptions: { 4 | "module": "commonjs" 5 | } 6 | }); -------------------------------------------------------------------------------- /scaffolds/widget/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./constants"; 2 | export * from "./widgetHandlers"; 3 | export * from "./widgetModel"; 4 | export * from "./widgetModelBinder"; -------------------------------------------------------------------------------- /src/components/custom-widget-list/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./customWidgetList.module"; 2 | export * from "./operationsSection"; 3 | export * from "./customWidgetList"; -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/paperbits.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/paperbits.eot -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/paperbits.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/paperbits.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/paperbits.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/paperbits.woff -------------------------------------------------------------------------------- /src/components/content/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./content.module"; 2 | export * from "./operationsSection"; 3 | export * from "./content"; 4 | export * from "./resetDetails"; -------------------------------------------------------------------------------- /src/components/utils/index.ts: -------------------------------------------------------------------------------- 1 | import * as moment from "moment/moment"; 2 | 3 | export const formatDate = (date: Date) => date ? moment(date).format("MM/DD/YYYY") : ""; 4 | -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/OpenSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/OpenSans-Bold.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/SegoeUI-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/SegoeUI-Bold.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/SegoeUI-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/SegoeUI-Light.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/paperbits.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/paperbits.woff2 -------------------------------------------------------------------------------- /src/config.validate.runtime.json: -------------------------------------------------------------------------------- 1 | { 2 | "environment": "runtime", 3 | "managementApiUrl": "http://localhost:8181/", 4 | "backendUrl": "http://localhost:8181/" 5 | } -------------------------------------------------------------------------------- /src/contracts/validationReport.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Cotract of validation Report 3 | */ 4 | export interface ValidationReport { 5 | source: string; 6 | errors: string[]; 7 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/OpenSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/OpenSans-Italic.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/OpenSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/OpenSans-Light.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/SegoeUI-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/SegoeUI-Italic.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/SegoeUI-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/SegoeUI-Regular.ttf -------------------------------------------------------------------------------- /src/themes/website/styles/monaco.editor.scss: -------------------------------------------------------------------------------- 1 | //this class is used indirectly for the monaco editor intelliense 2 | .overflowingContentWidgets { 3 | position: initial; 4 | } -------------------------------------------------------------------------------- /community/widgets/document-details/api_description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/community/widgets/document-details/api_description.png -------------------------------------------------------------------------------- /community/widgets/document-details/sample_document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/community/widgets/document-details/sample_document.png -------------------------------------------------------------------------------- /src/components/custom-html/ko/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./customHtmlEditorViewModel"; 2 | export * from "./customHtmlViewModel"; 3 | export * from "./customHtmlViewModelBinder"; 4 | -------------------------------------------------------------------------------- /src/contracts/portalConfigSignup.ts: -------------------------------------------------------------------------------- 1 | export interface PortalConfigSignup { 2 | termsOfService: { 3 | text: string; 4 | requireConsent: boolean; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/SegoeUI-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/SegoeUI-BoldItalic.ttf -------------------------------------------------------------------------------- /community/widgets/document-details/sample_document_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/community/widgets/document-details/sample_document_2.png -------------------------------------------------------------------------------- /scripts.v3/media/09879768-b2c8-afbd-a945-934c046b3c2d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/scripts.v3/media/09879768-b2c8-afbd-a945-934c046b3c2d.jpg -------------------------------------------------------------------------------- /scripts.v3/media/4cac439d-5a3d-4b03-38bb-197d32256ee0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/scripts.v3/media/4cac439d-5a3d-4b03-38bb-197d32256ee0.png -------------------------------------------------------------------------------- /scripts.v3/media/70add409-0933-e01e-acef-99999a71167e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/scripts.v3/media/70add409-0933-e01e-acef-99999a71167e.png -------------------------------------------------------------------------------- /scripts.v3/media/a2514081-47cb-95b1-ef0b-aef128c7a7ed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/scripts.v3/media/a2514081-47cb-95b1-ef0b-aef128c7a7ed.jpg -------------------------------------------------------------------------------- /scripts.v3/media/c5d2da83-b255-245c-144b-cd3c242e9791.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/scripts.v3/media/c5d2da83-b255-245c-144b-cd3c242e9791.jpg -------------------------------------------------------------------------------- /scripts.v3/media/ed8e43d0-5f8e-af38-5536-8f0274656ce4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/scripts.v3/media/ed8e43d0-5f8e-af38-5536-8f0274656ce4.jpg -------------------------------------------------------------------------------- /src/components/custom-widget/ko/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./customWidgetEditorViewModel"; 2 | export * from "./customWidgetViewModel"; 3 | export * from "./customWidgetViewModelBinder"; 4 | -------------------------------------------------------------------------------- /src/contracts/armResource.ts: -------------------------------------------------------------------------------- 1 | export interface ArmResource { 2 | id?: string; 3 | type?: string; 4 | name?: string; 5 | properties: any; 6 | sku?: {name: string}; 7 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/OpenSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/OpenSans-BoldItalic.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/OpenSans-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/OpenSans-LightItalic.ttf -------------------------------------------------------------------------------- /src/themes/designer/styles/fonts/SegoeUI-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/src/themes/designer/styles/fonts/SegoeUI-LightItalic.ttf -------------------------------------------------------------------------------- /tests/mocks/collection/changePassword.ts: -------------------------------------------------------------------------------- 1 | export class changePassword { 2 | public oldPassword?: string; 3 | public newPassword: string; 4 | public confirmPassword: string; 5 | } -------------------------------------------------------------------------------- /community/widgets/document-details/authentication_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/community/widgets/document-details/authentication_mode.png -------------------------------------------------------------------------------- /community/widgets/document-details/ko/documentDetails.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
-------------------------------------------------------------------------------- /examples/widgets/conference-session/ko/runtime/conference-session-runtime.html: -------------------------------------------------------------------------------- 1 |

Session #

2 |

-------------------------------------------------------------------------------- /src/components/apis/list-of-apis/ko/runtime/tagGroupViewModel.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | 3 | export class TagGroupViewModel { 4 | public expanded: ko.Observable; 5 | } -------------------------------------------------------------------------------- /src/components/custom-html/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./constants"; 2 | export * from "./customHtmlHandlers"; 3 | export * from "./customHtmlModel"; 4 | export * from "./customHtmlModelBinder"; -------------------------------------------------------------------------------- /src/components/setup/setupDialog.html: -------------------------------------------------------------------------------- 1 |
2 |

Hold on tight, we're getting your website ready...

3 | 4 |
-------------------------------------------------------------------------------- /src/contracts/apiHostname.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Hostname of an API 3 | */ 4 | export interface ApiHostnameContract { 5 | /** 6 | * Value of hostname 7 | */ 8 | value: string; 9 | } -------------------------------------------------------------------------------- /community/widgets/document-details/document-details-widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/community/widgets/document-details/document-details-widget.png -------------------------------------------------------------------------------- /src/components/custom-widget/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./constants"; 2 | export * from "./customWidgetHandlers"; 3 | export * from "./customWidgetModel"; 4 | export * from "./customWidgetModelBinder"; -------------------------------------------------------------------------------- /src/contracts/apiHostnames.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Hostnames of API 3 | */ 4 | export interface ApiHostnamesContract { 5 | /** 6 | * List of hostnames 7 | */ 8 | hostnames: string[]; 9 | } -------------------------------------------------------------------------------- /tests/mocks/collection/resource.ts: -------------------------------------------------------------------------------- 1 | export class Resource{ 2 | public testId: string; 3 | 4 | public constructor(testId: string){ 5 | this.testId = testId; 6 | } 7 | } -------------------------------------------------------------------------------- /community/widgets/document-details/Echo-api-document-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/community/widgets/document-details/Echo-api-document-details.png -------------------------------------------------------------------------------- /community/widgets/document-details/ko/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./documentDetailsEditorViewModel"; 2 | export * from "./documentDetailsViewModel"; 3 | export * from "./documentDetailsViewModelBinder"; 4 | -------------------------------------------------------------------------------- /examples/widgets/conference-session/ko/conferenceSession.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
-------------------------------------------------------------------------------- /src/models/tagGroup.ts: -------------------------------------------------------------------------------- 1 | export class TagGroup { 2 | public tag: string; 3 | public readonly items: TResource[]; 4 | 5 | constructor() { 6 | this.items = []; 7 | } 8 | } -------------------------------------------------------------------------------- /community/widgets/document-details/documentDetailsContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | 3 | export interface DocumentDetailsContract extends Contract { 4 | fileName: string; 5 | } -------------------------------------------------------------------------------- /examples/widgets/conference-session/ko/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./conferenceSessionEditorViewModel"; 2 | export * from "./conferenceSessionViewModel"; 3 | export * from "./conferenceSessionViewModelBinder"; 4 | -------------------------------------------------------------------------------- /src/components/operations/operation-details/ko/runtime/templates/ws_wscat.liquid: -------------------------------------------------------------------------------- 1 | {%- if showSecrets == false -%} 2 | wscat -c {{console.hiddenWsUrl}} 3 | {% else -%} 4 | wscat -c {{console.wsUrl}} 5 | {%- endif -%} -------------------------------------------------------------------------------- /community/widgets/document-details/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./constants"; 2 | export * from "./documentDetailsHandlers"; 3 | export * from "./documentDetailsModel"; 4 | export * from "./documentDetailsModelBinder"; 5 | -------------------------------------------------------------------------------- /examples/widgets/conference-session/conferenceSessionContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | 3 | export interface ConferenceSessionContract extends Contract { 4 | sessionNumber: string; 5 | } -------------------------------------------------------------------------------- /src/config.design.json: -------------------------------------------------------------------------------- 1 | { 2 | "environment": "development", 3 | "subscriptionId": "< subscription ID >", 4 | "resourceGroupName": "< resource group name >", 5 | "serviceName": "< service name >" 6 | } -------------------------------------------------------------------------------- /src/config.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "environment": "publishing", 3 | "subscriptionId": "< subscription ID >", 4 | "resourceGroupName": "< resource group name >", 5 | "serviceName": "< service name >" 6 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/editors/videoEditor.scss: -------------------------------------------------------------------------------- 1 | .video-player-editor { 2 | position: fixed; 3 | top: 20px; 4 | left: 100px; 5 | 6 | video { 7 | width: 100%; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /environmentConstants.js: -------------------------------------------------------------------------------- 1 | 2 | const staticDataEnvironment = "staticData"; 3 | const mockStaticDataEnvironment = "mockStaticData"; 4 | module.exports = { 5 | staticDataEnvironment, 6 | mockStaticDataEnvironment 7 | } -------------------------------------------------------------------------------- /src/components/custom-html/ko/customHtmlView.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/users/reset-password/resetPasswordContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | 3 | export interface ResetPasswordContract extends Contract { 4 | requireHipCaptcha: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/card.scss: -------------------------------------------------------------------------------- 1 | .card { 2 | flex-direction: row; 3 | flex-wrap: wrap; 4 | 5 | &.item-tile { 6 | margin-left: 0; 7 | margin-right: 0; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pfx binary 2 | *.ico binary 3 | *.svg binary 4 | *.jpg binary 5 | *.png binary 6 | *.exe binary 7 | *.eot binary 8 | *.woff binary 9 | *.woff2 binary 10 | *.ttf binary 11 | *.otf binary 12 | *.cdr binary -------------------------------------------------------------------------------- /examples/widgets/conference-session/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./constants"; 2 | export * from "./conferenceSessionHandlers"; 3 | export * from "./conferenceSessionModel"; 4 | export * from "./conferenceSessionModelBinder"; 5 | -------------------------------------------------------------------------------- /src/admin/custom.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.svg" { 2 | import React = require("react"); 3 | export const ReactComponent: React.FC>; 4 | const src: string; 5 | export default src; 6 | } -------------------------------------------------------------------------------- /src/components/products/product-list/react/runtime/utils.ts: -------------------------------------------------------------------------------- 1 | import { Page } from "../../../../../models/page"; 2 | import { Product } from "../../../../../models/product"; 3 | 4 | export type TProductsData = Page 5 | -------------------------------------------------------------------------------- /src/config.validate.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "environment": "publishing", 3 | "managementApiUrl": "http://localhost:8181/", 4 | "managementApiAccessToken": "SharedAccessSignature...", 5 | "useHipCaptcha": false 6 | } -------------------------------------------------------------------------------- /src/contracts/portalConfigDelegationSecrets.ts: -------------------------------------------------------------------------------- 1 | export interface PortalConfigDelegationSecrets { 2 | /** 3 | * Encryption key used to validate delegation signature. 4 | */ 5 | validationKey: string; 6 | } 7 | -------------------------------------------------------------------------------- /src/components/custom-widget/ko/constants.ts: -------------------------------------------------------------------------------- 1 | import { SizeStylePluginConfig } from "@paperbits/styles/plugins"; 2 | 3 | export const sizeStylesInitial: SizeStylePluginConfig = { 4 | height: "500px", 5 | width: "100%", 6 | }; -------------------------------------------------------------------------------- /src/components/code-editor/code-editor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
-------------------------------------------------------------------------------- /src/components/operations/operation-details/react/runtime/operation-console/templates/ws_wscat.liquid: -------------------------------------------------------------------------------- 1 | {%- if showSecrets == false -%} 2 | wscat -c {{console.hiddenWsUrl}} 3 | {% else -%} 4 | wscat -c {{console.wsUrl}} 5 | {%- endif -%} -------------------------------------------------------------------------------- /src/components/reports/reportsModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class ReportsModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | } 9 | -------------------------------------------------------------------------------- /src/services/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./IAadService"; 2 | export * from "./aadService"; 3 | export * from "./aadServiceV2"; 4 | export * from "./userService"; 5 | export * from "./usersService"; 6 | export * from "./identityService"; 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .history/ 2 | .vs/ 3 | .vscode/ 4 | .idea/ 5 | *.iml 6 | .DS_Store 7 | dist/ 8 | node_modules/ 9 | src/config.design.json 10 | src/config.publish.json 11 | src/config.runtime.json 12 | test-results/ 13 | tsconfig.tsbuildinfo -------------------------------------------------------------------------------- /src/components/users/signin/signinModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class SigninModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | } 9 | -------------------------------------------------------------------------------- /src/themes/website/styles/operations.scss: -------------------------------------------------------------------------------- 1 | .example-form-control{ 2 | padding-left: 8px; 3 | 4 | label { 5 | font-weight: bold; 6 | } 7 | 8 | select { 9 | margin-bottom: 0px; 10 | } 11 | } -------------------------------------------------------------------------------- /src/components/operations/operation-details/ko/runtime/apiKeyDetails.ts: -------------------------------------------------------------------------------- 1 | export enum ApiKeyLocation { 2 | Query = "query", 3 | Header = "header" 4 | } 5 | 6 | export interface ApiKeyDetails { 7 | in: string; 8 | name: string; 9 | } -------------------------------------------------------------------------------- /src/components/users/profile/profileModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class ProfileModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | } 9 | -------------------------------------------------------------------------------- /src/contracts/hostname.ts: -------------------------------------------------------------------------------- 1 | import { ArmResource } from "./armResource"; 2 | 3 | export interface Hostname extends ArmResource { 4 | properties: HostnameProperties; 5 | } 6 | 7 | export interface HostnameProperties { 8 | value: string; 9 | } -------------------------------------------------------------------------------- /src/contracts/tag.ts: -------------------------------------------------------------------------------- 1 | export interface TagContract { 2 | /** 3 | * Tag identifier. 4 | */ 5 | id: string; 6 | 7 | /** 8 | * Tag name. Must be 1 to 160 characters long. 9 | */ 10 | name: string; 11 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/components/reports/ko/reportsEditor.html: -------------------------------------------------------------------------------- 1 |
2 | Coming soon 3 |

4 | An editor for this widget is not yet ready.
5 |

6 |
-------------------------------------------------------------------------------- /src/components/spinner/spinner.ts: -------------------------------------------------------------------------------- 1 | import template from "./spinner.html"; 2 | import { Component } from "@paperbits/common/ko/decorators"; 3 | 4 | @Component({ 5 | selector: "spinner", 6 | template: template 7 | }) 8 | export class Spinner { } -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | import "@webcomponents/custom-elements"; 2 | import "core-js/es/array"; 3 | import "core-js/es/object"; 4 | import "core-js/es/promise"; 5 | import "core-js/es/reflect"; 6 | import "core-js/es/symbol"; 7 | import "core-js/web/immediate"; -------------------------------------------------------------------------------- /src/bindingHandlers/scrollintoview.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | 3 | ko.bindingHandlers["scrollintoview"] = { 4 | init: (element: HTMLElement): void => { 5 | element.scrollIntoView({ behavior: "smooth", block: "end" }); 6 | } 7 | }; -------------------------------------------------------------------------------- /src/clients/retryStrategy/noRetryStrategy.ts: -------------------------------------------------------------------------------- 1 | import { IRetryStrategy } from "./retryStrategy"; 2 | 3 | export class NoRetryStrategy implements IRetryStrategy { 4 | public invokeCall(call: any): Promise { 5 | return call(); 6 | } 7 | } -------------------------------------------------------------------------------- /tests/e2e/runtime/user-subscriptions.spec.ts-snapshots/self-hosted/user-resources-win32.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/api-management-developer-portal/HEAD/tests/e2e/runtime/user-subscriptions.spec.ts-snapshots/self-hosted/user-resources-win32.jpeg -------------------------------------------------------------------------------- /src/components/operations/operation-details/ko/runtime/oauthSession.ts: -------------------------------------------------------------------------------- 1 | export interface StoredCredentials { 2 | grantType: string; 3 | accessToken: string; 4 | } 5 | 6 | export interface OAuthSession { 7 | [apiName: string]: StoredCredentials; 8 | } -------------------------------------------------------------------------------- /src/components/users/signup-social/signupSocialModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class SignupSocialModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | } 9 | -------------------------------------------------------------------------------- /src/themes/website/styles/icons/icon-cancel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/clients/index.ts: -------------------------------------------------------------------------------- 1 | import ApiClient from "./apiClient"; 2 | import { DataApiClient } from "./dataApiClient"; 3 | import IApiClient from "./IApiClient"; 4 | import { MapiClient } from "./mapiClient"; 5 | 6 | export { IApiClient, ApiClient, MapiClient, DataApiClient } -------------------------------------------------------------------------------- /src/components/custom-widget/ko/runtime/customWidget.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/models/knownMimeTypes.ts: -------------------------------------------------------------------------------- 1 | export enum KnownMimeTypes { 2 | FormData = "multipart/form-data", 3 | Json = "application/json", 4 | Xml = "text/xml", 5 | UrlEncodedForm = "application/x-www-form-urlencoded", 6 | Soap = "application/soap+xml", 7 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/widgets.scss: -------------------------------------------------------------------------------- 1 | @import "widgets/map.scss"; 2 | @import "widgets/video.scss"; 3 | @import "editors/videoEditor.scss"; 4 | @import "editors/rowLayoutSelector.scss"; 5 | @import "editors/colorSelector.scss"; 6 | @import "editors/fontEditor.scss"; -------------------------------------------------------------------------------- /src/components/products/product-details/productDetailsModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class ProductDetailsModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | } 9 | -------------------------------------------------------------------------------- /src/components/users/confirm-password/confirmPasswordModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class ConfirmPasswordModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | } 9 | -------------------------------------------------------------------------------- /scaffolds/widget/widgetContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | 3 | /** 4 | * Data contact (data layer) that defines how widget configuration gets persisted. 5 | */ 6 | export interface WidgetContract extends Contract { 7 | // property: string; 8 | } -------------------------------------------------------------------------------- /src/components/users/subscriptions/subscriptionsModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class SubscriptionsModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/components/users/validation-summary/validationSummaryModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class ValidationSummaryModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | } 9 | -------------------------------------------------------------------------------- /scaffolds/widget/widgetModel.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Model (business layer) is a primary representation of the widget in the system, 3 | * which gets updated by editors and rendered by the presentation layer. 4 | */ 5 | export class WidgetModel { 6 | // public property: string; 7 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/tooltips.scss: -------------------------------------------------------------------------------- 1 | .tooltip { 2 | padding: 10px; 3 | max-width: 300px; 4 | display: block; 5 | line-height: 1.5em; 6 | p { 7 | margin: 0; 8 | } 9 | 10 | h1 { 11 | margin-bottom: 5px; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/operations/operation-details/ko/runtime/responsePackage.ts: -------------------------------------------------------------------------------- 1 | import { HttpHeader } from "@paperbits/common/http"; 2 | 3 | export interface ResponsePackage { 4 | statusCode: number; 5 | statusMessage: string; 6 | headers: HttpHeader[]; 7 | body: any; 8 | } -------------------------------------------------------------------------------- /src/components/products/product-subscriptions/productSubscriptionsModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class ProductSubscriptionsModel { 4 | /** 5 | * Widget local styles. 6 | */ 7 | public styles: LocalStyles = {}; 8 | } 9 | -------------------------------------------------------------------------------- /src/contracts/subscriptionSecrets.ts: -------------------------------------------------------------------------------- 1 | export interface SubscriptionSecrets { 2 | 3 | /** 4 | * Subscription primary key. 5 | */ 6 | primaryKey: string; 7 | 8 | /** 9 | * Subscription secondary key. 10 | */ 11 | secondaryKey: string; 12 | } -------------------------------------------------------------------------------- /src/components/users/signin-social/ko/runtime/signin-aad.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /src/components/reports/mapChart/mapChartConfig.ts: -------------------------------------------------------------------------------- 1 | import { MapChartRecord } from "./mapChartRecord"; 2 | 3 | /** 4 | * Map chart configuration. 5 | */ 6 | export interface MapChartConfig { 7 | records: MapChartRecord[]; 8 | formatHeat?: (value: number) => string; 9 | } 10 | -------------------------------------------------------------------------------- /src/components/users/signin-social/ko/runtime/signin-aad-b2c.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /src/services/ITenantService.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A service for management operations with API Management/Data API tenant. 3 | */ 4 | export default interface ITenantService { 5 | /** 6 | * Returns API Management service SKU name. 7 | */ 8 | getServiceSkuName(): Promise; 9 | } -------------------------------------------------------------------------------- /src/components/users/signup/signupModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class SignupModel { 4 | public requireHipCaptcha: boolean; 5 | 6 | /** 7 | * Widget local styles. 8 | */ 9 | public styles: LocalStyles = {}; 10 | } 11 | -------------------------------------------------------------------------------- /src/contracts/httpResponse.ts: -------------------------------------------------------------------------------- 1 | import { HttpHeader } from "@paperbits/common/http"; 2 | 3 | /** 4 | * HTTP response contract. 5 | */ 6 | export interface HttpResponse { 7 | headers: HttpHeader[]; 8 | statusCode: number; 9 | statusText: string; 10 | body: Buffer; 11 | } -------------------------------------------------------------------------------- /src/components/custom-widget-list/copyCode.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 6 |
7 | -------------------------------------------------------------------------------- /src/components/reports/reportsContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface ReportsContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } 10 | -------------------------------------------------------------------------------- /src/components/users/signin/signinContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface SigninContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } 10 | -------------------------------------------------------------------------------- /src/models/tag.ts: -------------------------------------------------------------------------------- 1 | import { TagContract } from "../contracts/tag"; 2 | 3 | export class Tag { 4 | public readonly id: string; 5 | public readonly name: string; 6 | 7 | constructor(contract: TagContract) { 8 | this.id = contract.id; 9 | this.name = contract.name; 10 | } 11 | } -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/button.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | display: inline-block; 3 | 4 | .icon { 5 | padding-right: .5em; 6 | vertical-align: middle; 7 | } 8 | } 9 | 10 | .button-profile { 11 | margin-top: 20px !important; 12 | margin-bottom: 20px !important; 13 | } -------------------------------------------------------------------------------- /src/components/custom-widget-list/customWidgetModel.ts: -------------------------------------------------------------------------------- 1 | import { ScaffoldTech } from "@azure/api-management-custom-widgets-scaffolder"; 2 | 3 | export class CustomWidgetModel { 4 | public name: string; 5 | public technology: ScaffoldTech | null; 6 | // public sourceControl: TScaffoldSourceControl; 7 | } 8 | -------------------------------------------------------------------------------- /src/components/users/profile/profileContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface ProfileContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } 10 | -------------------------------------------------------------------------------- /src/themes/designer/styles/codeEditor.scss: -------------------------------------------------------------------------------- 1 | code-editor { 2 | position: relative; 3 | min-height: 200px; 4 | 5 | /* fix for positioning of the IntelliSense window of Monaco Editor */ 6 | .monaco-editor .overflowingContentWidgets { 7 | position: absolute; 8 | top: 0; 9 | } 10 | } -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/fui/reports.scss: -------------------------------------------------------------------------------- 1 | .report-chart-container { 2 | box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.14), 0px 0px 2px 0px rgba(0, 0, 0, 0.12); 3 | padding: 1rem 3rem 2rem 2rem; 4 | margin-bottom: 2rem; 5 | 6 | .report-chart-title { 7 | margin-bottom: 2rem; 8 | } 9 | } -------------------------------------------------------------------------------- /scaffolds/widget/constants.ts: -------------------------------------------------------------------------------- 1 | export const widgetName = "your-widget"; 2 | export const widgetDisplayName = "Your widget"; 3 | export const widgetCategory = "Community"; 4 | export const widgetSelector = "widget"; 5 | export const widgetRuntimeSelector = "widget-runtime"; 6 | export const widgetEditorSelector = "widget-editor"; -------------------------------------------------------------------------------- /src/components/users/change-password/changePasswordModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class ChangePasswordModel { 4 | public requireHipCaptcha: boolean; 5 | 6 | /** 7 | * Widget local styles. 8 | */ 9 | public styles: LocalStyles = {}; 10 | } 11 | -------------------------------------------------------------------------------- /tests/services/ITestUserService.ts: -------------------------------------------------------------------------------- 1 | import { UserContract as SmapiUserContract } from "../models/userContract"; 2 | 3 | export interface ITestUserService { 4 | 5 | putUser(userId: string, userContract: SmapiUserContract): Promise ; 6 | 7 | deleteUser(userId: string, deleteSubs: boolean): Promise ; 8 | } -------------------------------------------------------------------------------- /src/errors/requestError.ts: -------------------------------------------------------------------------------- 1 | export class RequestError extends Error { 2 | constructor(public readonly message: string) { 3 | super(); 4 | Object.setPrototypeOf(this, RequestError.prototype); 5 | } 6 | 7 | public toString(): string { 8 | return `${this.stack} `; 9 | } 10 | } -------------------------------------------------------------------------------- /playwright.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from '@playwright/test'; 2 | 3 | export default defineConfig({ 4 | retries: 2, 5 | use: { 6 | video: 'retain-on-failure' 7 | }, 8 | expect: { 9 | toMatchSnapshot: { 10 | maxDiffPixels: 20 11 | }, 12 | }, 13 | }); -------------------------------------------------------------------------------- /src/components/users/signup-social/signupSocialContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface SignupSocialContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } 10 | -------------------------------------------------------------------------------- /src/components/users/subscriptions/subscriptionsContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface SubscriptionsContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } 10 | -------------------------------------------------------------------------------- /src/components/users/validation-summary/validationSummaryContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface ValidationSummaryContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } -------------------------------------------------------------------------------- /src/components/custom-widget-list/copyCode.ts: -------------------------------------------------------------------------------- 1 | import { Component, Param } from "@paperbits/common/ko/decorators"; 2 | import template from "./copyCode.html"; 3 | 4 | @Component({ 5 | selector: "copy-code", 6 | template: template, 7 | }) 8 | export class CopyCode { 9 | @Param() 10 | public code: string; 11 | } 12 | -------------------------------------------------------------------------------- /src/themes/designer/styles/dropdowns.scss: -------------------------------------------------------------------------------- 1 | .toolbox-dropdown { 2 | display: inline-block; 3 | box-sizing: border-box; 4 | border: none; 5 | 6 | & > span { 7 | line-height: $toolbox-btn-size; 8 | padding: 0 10px; 9 | } 10 | 11 | a { 12 | text-decoration: none; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/components/custom-html/customHtmlContract.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | import { Contract } from "@paperbits/common"; 3 | 4 | export interface CustomHtmlContract extends Contract { 5 | htmlCode: string; 6 | inheritStyling: boolean; 7 | addCustomFonts: boolean; 8 | styles: LocalStyles; 9 | } -------------------------------------------------------------------------------- /src/components/products/product-details/productDetailsContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface ProductDetailsContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } 10 | -------------------------------------------------------------------------------- /src/components/users/confirm-password/confirmPasswordContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface ConfirmPasswordContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } 10 | -------------------------------------------------------------------------------- /src/components/users/signin/signinHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { SigninModel } from "./signinModel"; 3 | 4 | export class SigninHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new SigninModel() 7 | } 8 | } -------------------------------------------------------------------------------- /src/themes/website/styles/alerts.scss: -------------------------------------------------------------------------------- 1 | .alert { 2 | position: relative; 3 | padding: .75rem 1.25rem; 4 | margin-bottom: 1rem; 5 | border: 1px solid transparent; 6 | border-radius: .25rem; 7 | } 8 | 9 | .alert-danger { 10 | color: #721c24; 11 | background-color: #f8d7da; 12 | border-color: #f5c6cb; 13 | } -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/captcha.scss: -------------------------------------------------------------------------------- 1 | .captcha { 2 | min-height: 220px; 3 | padding-bottom: 10px; 4 | 5 | .captcha-toggle { 6 | white-space: nowrap; 7 | } 8 | 9 | .captcha-challenge { 10 | min-height: 70px; 11 | margin-top: 15px; 12 | margin-bottom: 15px; 13 | } 14 | } -------------------------------------------------------------------------------- /tests/models/apiContract.ts: -------------------------------------------------------------------------------- 1 | export interface ApiContract { 2 | properties: ApiProperties; 3 | } 4 | 5 | export interface ApiProperties{ 6 | displayName: string; 7 | 8 | description: string; 9 | 10 | subscriptionRequired: boolean; 11 | 12 | path: string; 13 | 14 | protocols: string[] 15 | } -------------------------------------------------------------------------------- /tests/models/operationContract.ts: -------------------------------------------------------------------------------- 1 | export interface OperationContract { 2 | "id": string, 3 | "name": string, 4 | "properties": { 5 | "displayName": string, 6 | "description": string, 7 | "urlTemplate": string, 8 | "method": string, 9 | "templateParameters": [], 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/components/reports/reportsHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ReportsModel } from "./reportsModel"; 3 | 4 | 5 | export class ReportsHandlers implements IWidgetHandler { 6 | public async getWidgetModel(): Promise { 7 | return new ReportsModel() 8 | } 9 | } -------------------------------------------------------------------------------- /src/components/setup/setup.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { SetupDialog } from "./setupDialog"; 3 | 4 | 5 | export class SetupModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("setupDialog", SetupDialog); 8 | } 9 | } -------------------------------------------------------------------------------- /src/components/users/signup/signupHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { SignupModel } from "./signupModel"; 3 | 4 | 5 | export class SignupHandlers implements IWidgetHandler { 6 | public async getWidgetModel(): Promise { 7 | return new SignupModel() 8 | } 9 | } -------------------------------------------------------------------------------- /src/components/users/validation-summary/ko/runtime/validation-summary.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
-------------------------------------------------------------------------------- /src/components/file-input/file-input.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /src/components/users/profile/profileHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ProfileModel } from "./profileModel"; 3 | 4 | export class ProfileHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ProfileModel() 7 | } 8 | } -------------------------------------------------------------------------------- /src/services/IAadService.ts: -------------------------------------------------------------------------------- 1 | export interface IAadService { 2 | signInWithAad(clientId: string, authority: string, signinTenant: string, replyUrl?: string): Promise; 3 | runAadB2CUserFlow(clientId: string, tenant: string, instance: string, userFlow: string, replyUrl?: string): Promise; 4 | checkCallbacks(): Promise; 5 | } -------------------------------------------------------------------------------- /src/themes/website/styles/grids.scss: -------------------------------------------------------------------------------- 1 | $console-parameters-row-gap: 10px; 2 | 3 | .console-parameters-row { 4 | display: grid; 5 | grid-template-columns: 1fr 1fr 30px; 6 | column-gap: $console-parameters-row-gap; 7 | justify-items: start; 8 | margin-bottom: $console-parameters-row-gap; 9 | align-items: baseline; 10 | } 11 | -------------------------------------------------------------------------------- /tests/models/userContract.ts: -------------------------------------------------------------------------------- 1 | export interface UserContract { 2 | properties: UserProperties; 3 | } 4 | 5 | export interface UserProperties{ 6 | email: string; 7 | 8 | firstName: string; 9 | 10 | lastName: string; 11 | 12 | state: string; 13 | 14 | password: string; 15 | 16 | appType: string; 17 | } -------------------------------------------------------------------------------- /src/components/products/product-subscriptions/productSubscriptionsContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface ProductSubscriptionsContract extends Contract { 5 | /** 6 | * Widget local styles. 7 | */ 8 | styles?: LocalStyles; 9 | } 10 | -------------------------------------------------------------------------------- /src/components/users/signup/signupContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface SignupContract extends Contract { 5 | requireHipCaptcha: boolean; 6 | 7 | /** 8 | * Widget local styles. 9 | */ 10 | styles?: LocalStyles; 11 | } 12 | -------------------------------------------------------------------------------- /src/models/captchaData.ts: -------------------------------------------------------------------------------- 1 | import { CaptchaChallengeRequest } from "../contracts/captchaParams"; 2 | 3 | export class CaptchaData { 4 | public challenge?: CaptchaChallengeRequest; 5 | public solution?: { 6 | solution: string; 7 | flowId: string; 8 | token: string; 9 | type: string; 10 | }; 11 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-select-input.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/components/help/hint.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Entity describing the issue and its potential solution. 3 | */ 4 | export interface Hint { 5 | /** 6 | * Short text defining the issue. 7 | */ 8 | issue: string; 9 | 10 | /** 11 | * Free text explaining what can be done to resolve this issue. 12 | */ 13 | suggestion: string; 14 | } -------------------------------------------------------------------------------- /src/services/templatingService.ts: -------------------------------------------------------------------------------- 1 | import { Liquid } from "liquidjs"; 2 | 3 | export class TemplatingService { 4 | public static async render(template: string, model: Object): Promise { 5 | const engine = new Liquid(); 6 | const result = await engine.parseAndRender(template, model); 7 | 8 | return result; 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/utils/react/ScrollableTableContainer.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | interface Props { 4 | className?: string; 5 | children: React.ReactNode; 6 | } 7 | 8 | export const ScrollableTableContainer = ({ className, children }: Props) => ( 9 |
{children}
10 | ); 11 | -------------------------------------------------------------------------------- /src/contracts/example.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Example object. 3 | */ 4 | export interface Example { 5 | /** 6 | * Example description. 7 | */ 8 | description: string; 9 | 10 | /** 11 | * Example value. 12 | */ 13 | value: any; 14 | 15 | /** 16 | * A URL that points to the example 17 | */ 18 | externalValue: string; 19 | } -------------------------------------------------------------------------------- /src/services/roleService.ts: -------------------------------------------------------------------------------- 1 | import { BuiltInRoles, RoleModel } from "@paperbits/common/user"; 2 | 3 | /** 4 | * Static role service for demo purposes. 5 | */ 6 | export class StaticRoleService { 7 | public async getRoles(): Promise { 8 | return [BuiltInRoles.everyone, BuiltInRoles.anonymous, BuiltInRoles.authenticated]; 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/apis/details-of-api/ko/runtime/api-details.spec.ts: -------------------------------------------------------------------------------- 1 | import { describe, it } from "mocha"; 2 | 3 | describe("API details widget", async () => { 4 | it("Initializes correctly", async () => { 5 | // TODO: Not implemented 6 | }); 7 | 8 | it("Reacts on route change", async () => { 9 | // TODO: Not implemented 10 | }); 11 | }); -------------------------------------------------------------------------------- /src/components/reports/mapChart/mapChartRecord.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Map-chart record. 3 | */ 4 | export interface MapChartRecord { 5 | /** 6 | * Three-letter ISO country code, e.g. "USA". 7 | * @see https://www.iso.org/obp/ui 8 | */ 9 | countryCode: string; 10 | 11 | /** 12 | * Heat value. 13 | */ 14 | heat: number; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/contracts/tagResource.ts: -------------------------------------------------------------------------------- 1 | import { ApiContract } from "./api"; 2 | import { OperationContract } from "./operation"; 3 | import { TagContract } from "./tag"; 4 | 5 | 6 | /** 7 | * Contract of TagResource 8 | */ 9 | export interface ApiTagResourceContract { 10 | api?: ApiContract; 11 | operation?: OperationContract; 12 | tag?: TagContract; 13 | } 14 | -------------------------------------------------------------------------------- /src/errors/appError.ts: -------------------------------------------------------------------------------- 1 | export class AppError extends Error { 2 | constructor( 3 | public readonly message: string, 4 | public readonly innerError?: Error 5 | ) { 6 | super(); 7 | Object.setPrototypeOf(this, AppError.prototype); 8 | } 9 | 10 | public toString(): string { 11 | return `${this.stack} `; 12 | } 13 | } -------------------------------------------------------------------------------- /tests/services/ITestApiService.ts: -------------------------------------------------------------------------------- 1 | import { ApiContract as SmapiApiContract } from "../models/apiContract"; 2 | export interface ITestApiService { 3 | 4 | putApi(apiId: string, apiContract: SmapiApiContract): Promise ; 5 | 6 | putApiProduct(productId: string, apiId: string): Promise ; 7 | 8 | deleteApi(apiId: string): Promise ; 9 | } -------------------------------------------------------------------------------- /src/components/users/change-password/changePasswordContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface ChangePasswordContract extends Contract { 5 | requireHipCaptcha: boolean; 6 | 7 | /** 8 | * Widget local styles. 9 | */ 10 | styles?: LocalStyles; 11 | } 12 | -------------------------------------------------------------------------------- /src/contracts/trace.ts: -------------------------------------------------------------------------------- 1 | export interface TraceEntry { 2 | source: string; 3 | timestamp: string; 4 | elapsed: string; 5 | data: any; 6 | } 7 | 8 | export interface TraceEntries { 9 | inbound: TraceEntry[]; 10 | backend: TraceEntry[]; 11 | outbound: TraceEntry[]; 12 | } 13 | 14 | export interface Trace { 15 | traceId: string; 16 | traceEntries: TraceEntries; 17 | } -------------------------------------------------------------------------------- /src/themes/website/styles/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin fit($spacing: 0) { 2 | top: $spacing; 3 | left: $spacing; 4 | right: $spacing; 5 | bottom: $spacing; 6 | position: absolute; 7 | } 8 | 9 | @mixin icon-18px() { 10 | margin-left: 5px; 11 | background-position: center; 12 | background-repeat: no-repeat; 13 | width: 18px; 14 | height: 18px; 15 | } -------------------------------------------------------------------------------- /scripts.v3/cleanup.bat: -------------------------------------------------------------------------------- 1 | @REM Delete the content (incl. pages, media files, configuration, etc.) of API Management developer portal. 2 | @REM Make sure you're logged-in with `az login` command before running the script. 3 | 4 | node ./cleanup ^ 5 | --subscriptionId "< your subscription ID >" ^ 6 | --resourceGroupName "< your resource group name >" ^ 7 | --serviceName "< your service name >" 8 | -------------------------------------------------------------------------------- /src/components/apis/details-of-api/detailsOfApiHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { DetailsOfApiModel } from "./detailsOfApiModel"; 3 | 4 | export class DetailsOfApiHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new DetailsOfApiModel(); 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/apis/history-of-api/historyOfApiHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { HistoryOfApiModel } from "./historyOfApiModel"; 3 | 4 | export class HistoryOfApiHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new HistoryOfApiModel(); 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/users/signup-social/signupSocialHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { SignupSocialModel } from "./signupSocialModel"; 3 | 4 | export class SignupSocialHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new SignupSocialModel() 7 | } 8 | } -------------------------------------------------------------------------------- /src/contracts/oauthSession.ts: -------------------------------------------------------------------------------- 1 | export interface OAuthSession { 2 | authenticationFlow: string; 3 | authenticationCallback: (accessToken: string) => void; 4 | authenticationErrorCallback: (error: Error) => void; 5 | loginUrl: string; 6 | redirectUri: string; 7 | clientId: string; 8 | issuer: string; 9 | tokenEndpoint: string; 10 | scope: string; 11 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/editors/fontEditor.scss: -------------------------------------------------------------------------------- 1 | .font-variant-item { 2 | border-bottom: 1px solid #ccc; 3 | padding: 10px; 4 | 5 | &:last-child { 6 | border-bottom: none; 7 | } 8 | 9 | .font-variant-display { 10 | text-decoration: none; 11 | color: $color-base; 12 | font-size: 40px; 13 | overflow: hidden; 14 | } 15 | } -------------------------------------------------------------------------------- /tests/services/ITestProvisionService.ts: -------------------------------------------------------------------------------- 1 | import { PortalRevisionContract } from "../models/portalRevisionContract"; 2 | 3 | export interface ITestProvisionService { 4 | putPortalRevision(revisionId: string): Promise; 5 | getPortalRevision(revisionId: string): Promise; 6 | isRevisionPublished(revisionId: string): Promise; 7 | } -------------------------------------------------------------------------------- /src/components/help/articles/cors.html: -------------------------------------------------------------------------------- 1 |

2 | The interactive console of the Developer portal makes client-side API requests directly from the browser, this requires 3 | Cross-Origin Resource Sharing (CORS) enabled on the server. 4 |

5 |

6 | You can enable it by adding a CORS policy on your API(s). 7 | Learn more 8 |

-------------------------------------------------------------------------------- /src/components/users/reset-password/resetPasswordHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ResetPasswordModel } from "./resetPasswordModel"; 3 | 4 | export class ResetPasswordHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ResetPasswordModel() 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/users/signup/ko/signupEditor.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |
7 |
-------------------------------------------------------------------------------- /src/components/users/subscriptions/subscriptionsHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { SubscriptionsModel } from "./subscriptionsModel"; 3 | 4 | export class SubscriptionsHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new SubscriptionsModel() 7 | } 8 | } -------------------------------------------------------------------------------- /src/contracts/delegationSettings.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generic string value container 3 | */ 4 | export interface DelegationSettings { 5 | /** 6 | * Specifies whether signin is delegated to external system. 7 | */ 8 | signin: boolean; 9 | 10 | /** 11 | * Specifies whether Product subscribe is delegated to external system. 12 | */ 13 | subscribe: boolean; 14 | } -------------------------------------------------------------------------------- /src/contracts/reportRecordByApi.ts: -------------------------------------------------------------------------------- 1 | import { ReportRecord } from "./reportRecord"; 2 | 3 | /** 4 | * Metrics aggregated by API. 5 | */ 6 | export interface ReportRecordByApi extends ReportRecord { 7 | /** 8 | * API name, e.g. "HTTP Bin". 9 | */ 10 | name: string; 11 | 12 | /** 13 | * API identifier, e.g. "/apis/httpbin". 14 | */ 15 | apiId: string; 16 | } -------------------------------------------------------------------------------- /scripts.v3/generate.sh: -------------------------------------------------------------------------------- 1 | # Generate and provision default content of an API Management portal - incl. pages, layouts, configuration, media files, etc. 2 | # Make sure you're logged-in with `az login` command before running the script. 3 | 4 | node ./generate \ 5 | --subscriptionId "< your subscription ID >" \ 6 | --resourceGroupName "< your resource group name >" \ 7 | --serviceName "< your service name >" 8 | -------------------------------------------------------------------------------- /src/components/operations/operation-list/operationListHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { OperationListModel } from "./operationListModel"; 3 | 4 | export class OperationListHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new OperationListModel(); 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/users/change-password/changePasswordHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ChangePasswordModel } from "./changePasswordModel"; 3 | 4 | export class ChangePasswordHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ChangePasswordModel() 7 | } 8 | } -------------------------------------------------------------------------------- /src/errors/unauthorizedError.ts: -------------------------------------------------------------------------------- 1 | export class UnauthorizedError extends Error { 2 | constructor( 3 | public readonly message: string, 4 | public readonly innerError?: Error 5 | ) { 6 | super(); 7 | Object.setPrototypeOf(this, UnauthorizedError.prototype); 8 | } 9 | 10 | public toString(): string { 11 | return `${this.stack} `; 12 | } 13 | } -------------------------------------------------------------------------------- /src/components/products/product-details/productDetailsHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ProductDetailsModel } from "./productDetailsModel"; 3 | 4 | export class ProductDetailsHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ProductDetailsModel() 7 | } 8 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-submit-form-button.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/publisher/azure-function/publish/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "function", 5 | "type": "httpTrigger", 6 | "direction": "in", 7 | "name": "req", 8 | "methods": [ 9 | "get", 10 | "post" 11 | ] 12 | }, 13 | { 14 | "type": "http", 15 | "direction": "out", 16 | "name": "res" 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /scripts.v3/generate.bat: -------------------------------------------------------------------------------- 1 | @REM Generate content (incl. pages, media files, configuration, etc.) of API Management developer portal from ./dist/snapshot folder. 2 | @REM Make sure you're logged-in with `az login` command before running the script. 3 | 4 | node ./generate ^ 5 | --subscriptionId "< your subscription ID >" ^ 6 | --resourceGroupName "< your resource group name >" ^ 7 | --serviceName "< your service name >" 8 | -------------------------------------------------------------------------------- /src/components/help/articles/domain.html: -------------------------------------------------------------------------------- 1 |

2 | By default, your API Management service instance is available through *.azure-api.net subdomain (e.g. 3 | contoso.developer.azure-api.net). You can also expose the service through your own domain name, such as contoso.com. 4 | Learn 5 | more 6 |

-------------------------------------------------------------------------------- /src/components/users/confirm-password/confirmPasswordHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ConfirmPasswordModel } from "./confirmPasswordModel"; 3 | 4 | 5 | export class ConfirmPasswordHandlers implements IWidgetHandler { 6 | public async getWidgetModel(): Promise { 7 | return new ConfirmPasswordModel() 8 | } 9 | } -------------------------------------------------------------------------------- /src/logging/utils/defaultEventTypeProvider.ts: -------------------------------------------------------------------------------- 1 | import { WellKnownEventTypes } from "../wellKnownEventTypes"; 2 | 3 | export interface IDefaultLogEventTypeProvider { 4 | getLogEventType(): string; 5 | } 6 | 7 | export class PublishingDefaultLogEventTypeProvider implements IDefaultLogEventTypeProvider { 8 | public getLogEventType(): string { 9 | return WellKnownEventTypes.Publishing; 10 | } 11 | } -------------------------------------------------------------------------------- /scripts.v3/capture.bat: -------------------------------------------------------------------------------- 1 | @REM Capture the content (incl. pages, media files, configuration, etc.) of API Management developer portal into ./dist/snapshot folder. 2 | @REM @REM Make sure you're logged-in with `az login` command before running the script. 3 | 4 | node ./capture ^ 5 | --subscriptionId "< your subscription ID >" ^ 6 | --resourceGroupName "< your resource group name >" ^ 7 | --serviceName "< your service name >" 8 | -------------------------------------------------------------------------------- /src/components/custom-widget-list/fallbackUi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback ui 6 | 7 | 8 |

Custom widget hasn't loaded correctly

9 | 10 | Learn more about using custom widgets in the developer portal. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/components/operations/operation-details/operationDetailsHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { OperationDetailsModel } from "./operationDetailsModel"; 3 | 4 | export class OperationDetailsHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new OperationDetailsModel(); 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/products/product-subscribe/productSubscribeHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ProductSubscribeModel } from "./productSubscribeModel"; 3 | 4 | export class ProductSubscribeHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ProductSubscribeModel() 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/products/product-subscribe/productSubscribeModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class ProductSubscribeModel { 4 | /** 5 | * Controls whether legal text is displayed by default or not. 6 | */ 7 | public showTermsByDefault: boolean; 8 | 9 | /** 10 | * Widget local styles. 11 | */ 12 | public styles: LocalStyles = {}; 13 | } 14 | -------------------------------------------------------------------------------- /src/contracts/openIdConnectProvider.ts: -------------------------------------------------------------------------------- 1 | export interface OpenIdConnectProviderContract { 2 | /** 3 | * User-friendly OpenID Connect Provider name. 4 | */ 5 | name: string; 6 | 7 | /** 8 | * User-friendly description of OpenID Connect Provider. 9 | */ 10 | description: string; 11 | 12 | /** 13 | * Metadata endpoint URI. 14 | */ 15 | metadataEndpoint: string; 16 | } -------------------------------------------------------------------------------- /src/components/custom-html/customHtmlModel.ts: -------------------------------------------------------------------------------- 1 | import { LocalStyles } from "@paperbits/common/styles"; 2 | 3 | export class CustomHtmlModel { 4 | public htmlCode: string; 5 | public inheritStyling: boolean; 6 | public addCustomFonts: boolean; 7 | 8 | /** 9 | * Local styles. 10 | */ 11 | public styles: LocalStyles; 12 | 13 | constructor() { 14 | this.styles = {}; 15 | } 16 | } -------------------------------------------------------------------------------- /src/contracts/identity.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * User identity contract. 3 | */ 4 | export interface Identity { 5 | /** 6 | * User unique identifier. 7 | */ 8 | id: string; 9 | 10 | /** 11 | * User provider. i.e. Basic, AAD, etc. 12 | */ 13 | provider: string; 14 | } 15 | 16 | export interface SmapiIdentity { 17 | /** 18 | * User unique identifier. 19 | */ 20 | id: string; 21 | } -------------------------------------------------------------------------------- /src/contracts/reportRecordByProduct.ts: -------------------------------------------------------------------------------- 1 | import { ReportRecord } from "./reportRecord"; 2 | 3 | /** 4 | * Metrics aggregated by product. 5 | */ 6 | export interface ReportRecordByProduct extends ReportRecord { 7 | /** 8 | * Product name, e.g. "Starter". 9 | */ 10 | name: string; 11 | 12 | /** 13 | * Product unique identifier, e.g. "/products/starter" 14 | */ 15 | productId: string; 16 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/slider.scss: -------------------------------------------------------------------------------- 1 | .slider-display { 2 | width: 100%; 3 | height: 25px; 4 | margin-top: 15px; 5 | } 6 | 7 | .slider { 8 | width: 100%; 9 | height: 15px; 10 | 11 | .slider-thumb { 12 | @include slider-thumb(); 13 | position: absolute; 14 | transform: translate(-$form-control-slider-thumb-size / 2, -$form-control-slider-thumb-size / 2); 15 | } 16 | } -------------------------------------------------------------------------------- /src/themes/website/styles/lists.scss: -------------------------------------------------------------------------------- 1 | .list { 2 | .list-item { 3 | padding: .5em; 4 | display: block; 5 | color: $default-text-color; 6 | cursor: pointer; 7 | 8 | &.selected { 9 | font-weight: bold; 10 | } 11 | } 12 | 13 | .list-item-empty { 14 | padding: 10px; 15 | display: block; 16 | color: $default-text-color; 17 | } 18 | } -------------------------------------------------------------------------------- /src/types/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.html" { 2 | const content: string; 3 | export default content; 4 | } 5 | 6 | declare module "*.liquid" { 7 | const content: string; 8 | export default content; 9 | } 10 | 11 | declare module "*.txt" { 12 | const content: string; 13 | export default content; 14 | } 15 | 16 | declare module "*!text" { 17 | const _: string; 18 | export default _; 19 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-tab-panel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /community/widgets/document-details/constants.ts: -------------------------------------------------------------------------------- 1 | export const widgetName = "document-details"; 2 | export const widgetDisplayName = "Document details"; 3 | export const widgetCategory = "Community"; 4 | export const widgetSelector = "document-details"; 5 | export const widgetRuntimeSelector = "document-details-runtime"; 6 | export const widgetEditorSelector = "document-details-editor"; 7 | export const defaultFileName = "sample_document.html"; -------------------------------------------------------------------------------- /examples/widgets/conference-session/constants.ts: -------------------------------------------------------------------------------- 1 | export const widgetName = "conference-session"; 2 | export const widgetDisplayName = "Conference session"; 3 | export const widgetCategory = "Community"; 4 | export const widgetSelector = "conference-session"; 5 | export const widgetRuntimeSelector = "conference-session-runtime"; 6 | export const widgetEditorSelector = "conference-session-editor"; 7 | export const defaultSessionNumber = "107"; -------------------------------------------------------------------------------- /src/components/custom-html/constants.ts: -------------------------------------------------------------------------------- 1 | export const widgetName = "custom-html-code"; 2 | export const widgetDisplayName = "Custom HTML code"; 3 | export const widgetCategory = "Custom widgets"; 4 | export const widgetSelector = "custom-html"; 5 | export const widgetRuntimeSelector = "custom-html-runtime"; 6 | export const widgetEditorSelector = "custom-html-editor"; 7 | export const widgetIconClass = "widget-icon widget-icon-api-management"; -------------------------------------------------------------------------------- /src/components/custom-widget/constants.ts: -------------------------------------------------------------------------------- 1 | export const widgetName = "custom-widget"; 2 | export const widgetDisplayName = "Custom widget"; 3 | export const widgetCategory = "Custom widgets"; 4 | export const widgetSelector = "custom-widget"; 5 | export const widgetRuntimeSelector = "custom-widget-runtime"; 6 | export const widgetEditorSelector = "custom-widget-editor"; 7 | export const widgetIconClass = "widget-icon widget-icon-api-management"; -------------------------------------------------------------------------------- /tests/models/productContract.ts: -------------------------------------------------------------------------------- 1 | export interface ProductContract { 2 | properties: ProductPorperties; 3 | } 4 | 5 | export interface ProductPorperties{ 6 | displayName: string; 7 | 8 | description: string; 9 | 10 | approvalRequired: boolean; 11 | 12 | state: string; 13 | 14 | subscriptionRequired: boolean; 15 | 16 | subscriptionsLimit: number; 17 | 18 | terms: string; 19 | } -------------------------------------------------------------------------------- /.github/scripts/wait-for-server.ps1: -------------------------------------------------------------------------------- 1 | param ($HostName = $(throw "HostName parameter is required.")) 2 | $Counter = 0 3 | while ($Counter -ne 2 ){ 4 | Start-Sleep -Seconds 4 5 | $Response = Invoke-WebRequest -Uri $HostName 6 | if ($Response.StatusCode -eq 200){ 7 | Write-Host "server returned 200" 8 | exit 0 9 | } 10 | $Counter++ 11 | } 12 | 13 | Write-Error "Server didn't return 200 status" -------------------------------------------------------------------------------- /community/widgets/document-details/documentDetails.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { DocumentDetailsRuntime } from "./ko/runtime/document-details-runtime"; 3 | 4 | 5 | export class DocumentDetailsRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("documentDetailsRuntime", DocumentDetailsRuntime); 8 | } 9 | } -------------------------------------------------------------------------------- /src/contracts/reportRecordByGeo.ts: -------------------------------------------------------------------------------- 1 | import { ReportRecord } from "./reportRecord"; 2 | 3 | /** 4 | * Metrics aggregated by geographical region. 5 | */ 6 | export interface ReportRecordByGeo extends ReportRecord { 7 | /** 8 | * e.g. "US" 9 | */ 10 | country: string; 11 | 12 | /** 13 | * e.g. "CA" 14 | */ 15 | region: string; 16 | 17 | /** 18 | * e.g. 98065 19 | */ 20 | zip: number; 21 | } -------------------------------------------------------------------------------- /src/components/users/validation-summary/validationSummaryHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ValidationSummaryModel } from "../validation-summary/validationSummaryModel"; 3 | 4 | 5 | export class ValidationSummaryHandlers implements IWidgetHandler { 6 | public async getWidgetModel(): Promise { 7 | return new ValidationSummaryModel() 8 | } 9 | } -------------------------------------------------------------------------------- /src/contracts/portalConfigCors.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * CORS policy of the portal that defines origins from which the browser is allowed to load resources. 3 | */ 4 | export interface PortalConfigCors { 5 | /** 6 | * Allowed origins, e.g. `https://trusted.com`. 7 | */ 8 | allowedOrigins: string[]; 9 | 10 | /** 11 | * Possible future extensions: 12 | * "allowedMethods": [], 13 | * "allowedHeaders": [] 14 | */ 15 | } -------------------------------------------------------------------------------- /src/bindingHandlers/acceptChange.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | 3 | ko.extenders.acceptChange = (target, condition) => { 4 | const result = ko.pureComputed({ 5 | read: target, 6 | write: (newValue) => { 7 | if (!ko.unwrap(condition)) { 8 | return; 9 | } 10 | target(newValue); 11 | } 12 | }); 13 | 14 | result(target()); 15 | 16 | return result; 17 | }; -------------------------------------------------------------------------------- /src/components/products/product-subscriptions/productSubscriptionsHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ProductSubscriptionsModel } from "./productSubscriptionsModel"; 3 | 4 | 5 | export class ProductSubscriptionsHandlers implements IWidgetHandler { 6 | public async getWidgetModel(): Promise { 7 | return new ProductSubscriptionsModel(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/contracts/reportRecordByTime.ts: -------------------------------------------------------------------------------- 1 | import { ReportRecord } from "./reportRecord"; 2 | 3 | /** 4 | * Metrics aggregated over a period of time. 5 | */ 6 | export interface ReportRecordByTime extends ReportRecord { 7 | /** 8 | * e.g. "2019-09-05T19:30:00Z" 9 | */ 10 | timestamp: string; 11 | 12 | /** 13 | * Interval must be multiple of 15 minutes and may not be zero, e.g. "PT15M" 14 | */ 15 | interval: string; 16 | } -------------------------------------------------------------------------------- /src/themes/website/styles/details.scss: -------------------------------------------------------------------------------- 1 | details.details-styled { 2 | summary { 3 | list-style: none; 4 | cursor: pointer; 5 | 6 | i.icon-emb { 7 | display: inline-block; 8 | transition: transform .33s ease; 9 | } 10 | } 11 | 12 | summary::-webkit-details-marker { 13 | display: none; 14 | } 15 | 16 | &[open] summary { 17 | i.icon-emb { 18 | transform: rotate(-180deg); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/widgets/conference-session/conferenceSession.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { ConferenceSessionRuntime } from "./ko/runtime/conference-session-runtime"; 3 | 4 | 5 | export class ConferenceSessionRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("conferenceSessionRuntime", ConferenceSessionRuntime); 8 | } 9 | } -------------------------------------------------------------------------------- /src/components/products/product-subscribe/ko/productSubscribeEditor.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 7 |
8 | 9 |
-------------------------------------------------------------------------------- /scaffolds/widget/widget.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { WidgetRuntime } from "./ko/runtime/widget-runtime"; 3 | 4 | /** 5 | * Inversion of control module that registers runtime-time dependencies. 6 | */ 7 | export class WidgetRuntimeModule implements IInjectorModule { 8 | public register(injector: IInjector): void { 9 | injector.bind("widgetRuntime", WidgetRuntime); 10 | } 11 | } -------------------------------------------------------------------------------- /src/components/apis/details-of-api/detailsOfApiModel.ts: -------------------------------------------------------------------------------- 1 | import { HyperlinkModel } from "@paperbits/common/permalinks"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export class DetailsOfApiModel { 5 | /** 6 | * Link to a page that contains API changelog. 7 | */ 8 | public changeLogPageHyperlink: HyperlinkModel; 9 | 10 | /** 11 | * Widget local styles. 12 | */ 13 | public styles: LocalStyles = {}; 14 | } 15 | -------------------------------------------------------------------------------- /src/components/products/product-details/ko/runtime/product-details.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |

9 |

10 |
11 | 12 | 13 | 14 |

Please select a product

15 | -------------------------------------------------------------------------------- /src/contracts/apiChangeLog.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Contract of API change log 3 | */ 4 | export interface ChangeLogContract { 5 | 6 | /** 7 | * The date when this API change log is created 8 | */ 9 | createdDateTime?: string; 10 | 11 | /** 12 | * The date when this API change log is edited and updated 13 | */ 14 | updatedDateTime?: string; 15 | 16 | /** 17 | * The notes of this API change 18 | */ 19 | notes?: string; 20 | } -------------------------------------------------------------------------------- /src/components/products/product-subscribe/productSubscribeContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export interface ProductSubscribeContract extends Contract { 5 | /** 6 | * Controls whether legal text is displayed by default or not. 7 | */ 8 | showTermsByDefault: boolean; 9 | 10 | /** 11 | * Widget local styles. 12 | */ 13 | styles?: LocalStyles; 14 | } 15 | -------------------------------------------------------------------------------- /src/components/apis/history-of-api/historyOfApiModel.ts: -------------------------------------------------------------------------------- 1 | import { HyperlinkModel } from "@paperbits/common/permalinks/hyperlinkModel"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export class HistoryOfApiModel { 5 | 6 | /** 7 | * Link to a page that contains API details. 8 | */ 9 | public detailsPageHyperlink: HyperlinkModel; 10 | 11 | /** 12 | * Widget local styles. 13 | */ 14 | public styles: LocalStyles = {}; 15 | } 16 | -------------------------------------------------------------------------------- /src/themes/website/styles/badges.scss: -------------------------------------------------------------------------------- 1 | .badge { 2 | background: none; 3 | border: 1px solid #aaa; 4 | color: #636363; 5 | border-radius: 0; 6 | } 7 | 8 | .badge-soap { 9 | display: inline; 10 | font-weight: normal; 11 | font-family: Menlo,Monaco,Consolas,"Courier New",monospace; 12 | font-size: 10px; 13 | padding: 0 2px; 14 | margin: 2px; 15 | 16 | order: 1; 17 | vertical-align: middle; 18 | display: inline; 19 | line-height: 1.7em; 20 | } -------------------------------------------------------------------------------- /community/widgets/document-details/ko/documentDetailsEditorView.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 8 | 9 |
10 |
-------------------------------------------------------------------------------- /src/themes/website/styles/svgs/download.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scaffolds/widget/readme.md: -------------------------------------------------------------------------------- 1 | # Community widget: 2 | 3 | **Contributor's GitHub alias**: 4 | 5 | **Organization name**: 6 | 7 | **Privacy and security notes**: <(optional) describe and explain all potentially unsafe operations performed by the widget; for example: this widget forwards the logged-in user token to a service hosted under the `contoso.com` domain> 8 | 9 | ![Widget screenshot](image.png) 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/components/utils/react/NoRecordsRow.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { TableCell, TableRow } from "@fluentui/react-components"; 3 | 4 | type TNoRecordsRowProps = { 5 | colspan: number; 6 | customText?: string; 7 | } 8 | 9 | export const NoRecordsRow = ({ colspan, customText }: TNoRecordsRowProps) => ( 10 | 11 | {customText ?? 'No records to show'} 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /src/themes/website/styles/charts.scss: -------------------------------------------------------------------------------- 1 | .subunit { 2 | fill: none; 3 | stroke: #f0f0f0; 4 | stroke-width: 1px; 5 | } 6 | 7 | text.subunit-label { 8 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 9 | font-size: 14px; 10 | font-weight: 300; 11 | text-anchor: middle; 12 | fill: #000; 13 | } 14 | 15 | .subunit-label { 16 | display: none; 17 | } 18 | 19 | .graticule { 20 | fill: none; 21 | stroke: #aaa; 22 | stroke-opacity: .5; 23 | stroke-width: .5px; 24 | } 25 | -------------------------------------------------------------------------------- /src/themes/website/assets/page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/tabs.scss: -------------------------------------------------------------------------------- 1 | .tab-panel { 2 | display: flex; 3 | flex-direction: column; 4 | position: relative; 5 | overflow: hidden; 6 | 7 | .tab-navs { 8 | display: flex; 9 | 10 | .nav-link-active { 11 | font-weight: bold; 12 | } 13 | } 14 | 15 | .tab-content { 16 | display: none; 17 | flex-grow: 1; 18 | 19 | &.tab-content-active { 20 | display: flex; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/widgets/conference-session/ko/conferenceSessionEditorView.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 8 | 9 |
10 |
-------------------------------------------------------------------------------- /src/styles/apimStylePublishModule.ts: -------------------------------------------------------------------------------- 1 | 2 | import { StylePublishModule } from "@paperbits/styles/styles.publish.module"; 3 | import { IInjector } from "@paperbits/common/injection"; 4 | import { ApimDefaultStyleCompiler } from "./apimDefaultStyleCompiler"; 5 | 6 | export class ApimStylePublishModule extends StylePublishModule { 7 | public register(injector: IInjector): void { 8 | super.register(injector); 9 | injector.bindSingleton("styleCompiler", ApimDefaultStyleCompiler); 10 | } 11 | } -------------------------------------------------------------------------------- /src/styles/apimStylesDesignModule.ts: -------------------------------------------------------------------------------- 1 | import { StylesDesignModule } from "@paperbits/styles/styles.design.module"; 2 | import { IInjector } from "@paperbits/common/injection"; 3 | import { ApimDefaultStyleCompiler } from "./apimDefaultStyleCompiler"; 4 | 5 | export class ApimStylesDesignModule extends StylesDesignModule { 6 | public register(injector: IInjector): void { 7 | super.register(injector); 8 | injector.bindSingleton("styleCompiler", ApimDefaultStyleCompiler); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/modules.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.html" { 2 | const content: string; 3 | export default content; 4 | } 5 | 6 | declare module "*.liquid" { 7 | const content: string; 8 | export default content; 9 | } 10 | 11 | declare module "*.txt" { 12 | const content: string; 13 | export default content; 14 | } 15 | 16 | declare module "*.raw" { 17 | const content: string; 18 | export default content; 19 | } 20 | 21 | declare let DecompressionStream: any; 22 | 23 | declare let ARM_TOKEN: string; -------------------------------------------------------------------------------- /tests/models/portalRevisionContract.ts: -------------------------------------------------------------------------------- 1 | export interface PortalRevisionContract { 2 | properties: PortalRevisionProperties; 3 | } 4 | 5 | export interface PortalRevisionProperties{ 6 | /** 7 | * Portal revision description. 8 | */ 9 | description?: string; 10 | 11 | /** 12 | * Status of the revision. 13 | */ 14 | status?: string; 15 | 16 | /** 17 | * Is current published reviosion of the portal. 18 | */ 19 | isCurrent?: boolean; 20 | } -------------------------------------------------------------------------------- /scaffolds/widget/ko/widgetViewModel.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | import template from "./widgetView.html"; 3 | import { widgetSelector } from "../constants"; 4 | import { Component } from "@paperbits/common/ko/decorators"; 5 | 6 | @Component({ 7 | selector: widgetSelector, 8 | template: template 9 | }) 10 | export class WidgetViewModel { 11 | public readonly runtimeConfig: ko.Observable; 12 | 13 | constructor() { 14 | this.runtimeConfig = ko.observable(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/components/help/help.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjectorModule, IInjector } from "@paperbits/common/injection"; 2 | import { HelpWorkshop, HelpDetailsWorkshop, HelpSectionToolButton } from "."; 3 | 4 | export class HelpModule implements IInjectorModule { 5 | public register(injector: IInjector): void { 6 | injector.bind("helpWorkshop", HelpWorkshop); 7 | injector.bind("helpDetailsWorkshop", HelpDetailsWorkshop); 8 | injector.bindToCollection("workshopSections", HelpSectionToolButton); 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/apis/details-of-api/detailsOfApiContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { HyperlinkContract } from "@paperbits/common/editing"; 3 | import { LocalStyles } from "@paperbits/common/styles"; 4 | 5 | export interface DetailsOfApiContract extends Contract { 6 | /** 7 | * Link to a page that contains API changelog. 8 | */ 9 | changeLogPageHyperlink?: HyperlinkContract; 10 | 11 | /** 12 | * Widget local styles. 13 | */ 14 | styles?: LocalStyles; 15 | } 16 | -------------------------------------------------------------------------------- /src/components/apis/history-of-api/historyOfApiContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { HyperlinkContract } from "@paperbits/common/editing"; 3 | import { LocalStyles } from "@paperbits/common/styles"; 4 | 5 | export interface HistoryOfApiContract extends Contract { 6 | /** 7 | * Link to a page that contains API details. 8 | */ 9 | detailsPageHyperlink?: HyperlinkContract; 10 | 11 | /** 12 | * Widget local styles. 13 | */ 14 | styles?: LocalStyles; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/models/parameterExample.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Request parameter/header example. 3 | */ 4 | export class ParameterExample { 5 | constructor( 6 | /** 7 | * Title, e.g. `Short version` 8 | */ 9 | public title: string, 10 | 11 | /** 12 | * Description, e.g. `Short version of the API`. 13 | */ 14 | public description: string, 15 | 16 | /** 17 | * Example value, e.g. `api-version`. 18 | */ 19 | public value: string 20 | ) { } 21 | } -------------------------------------------------------------------------------- /src/themes/website/styles/breadcrumbs.scss: -------------------------------------------------------------------------------- 1 | .breadcrumb { 2 | display: flex; 3 | flex-wrap: wrap; 4 | padding: 0; 5 | margin-bottom: 20px; 6 | list-style: none; 7 | background-color: none; 8 | a { 9 | text-decoration: underline; 10 | } 11 | } 12 | 13 | .breadcrumb-item+.breadcrumb-item { 14 | padding-left: .5rem; 15 | 16 | &::before { 17 | display: inline-block; 18 | padding-right: .5rem; 19 | color: #6c757d; 20 | content: "/"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/themes/website/styles/buttons.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | display: flex; 3 | align-items: center; 4 | justify-content: center; 5 | 6 | &:disabled { 7 | pointer-events: none; 8 | } 9 | 10 | &.button-noborder { 11 | border: none; 12 | background: transparent; 13 | box-shadow: none; 14 | } 15 | } 16 | 17 | .btn-centered-vert { 18 | display: flex; 19 | align-items: center; 20 | height: 100%; 21 | } 22 | 23 | .btn-inline { 24 | padding-bottom: 1rem; 25 | } 26 | -------------------------------------------------------------------------------- /scripts.v3/migrate.bat: -------------------------------------------------------------------------------- 1 | @REM This script automates content migration between developer portal instances. 2 | @REM Make sure you're logged-in with `az login` command before running the script. 3 | 4 | node ./migrate ^ 5 | --sourceSubscriptionId "< your subscription ID >" ^ 6 | --sourceResourceGroupName "< your resource group name >" ^ 7 | --sourceServiceName "< your service name >" ^ 8 | --destSubscriptionId "< your subscription ID >" ^ 9 | --destResourceGroupName "< your resource group name >" ^ 10 | --destServiceName "< your service name >" 11 | -------------------------------------------------------------------------------- /src/contracts/reportRecordByOperation.ts: -------------------------------------------------------------------------------- 1 | import { ReportRecord } from "./reportRecord"; 2 | 3 | /** 4 | * Metrics aggregated by operation. 5 | */ 6 | export interface ReportRecordByOperation extends ReportRecord { 7 | /** 8 | * Operation name, e.g. "Get". 9 | */ 10 | name: string; 11 | 12 | /** 13 | * Operation identifier, e.g. "/apis/httpbin/operations/get". 14 | */ 15 | operationId: string; 16 | 17 | /** 18 | * API identifier, e.g. "/apis/httpbin". 19 | */ 20 | apiId: string; 21 | } 22 | -------------------------------------------------------------------------------- /tests/services/testRunner.ts: -------------------------------------------------------------------------------- 1 | import { ITestRunner } from "./ITestRunner"; 2 | export class TestRunner implements ITestRunner { 3 | public runTest(validate: () => Promise, populateData: () => Promise, testName: string ): Promise { 4 | return new Promise((resolve, reject) => { 5 | populateData() 6 | .then(() => validate()) 7 | .then(() => resolve()) 8 | .catch((err) => { 9 | reject(err); 10 | }); 11 | }); 12 | } 13 | } -------------------------------------------------------------------------------- /examples/widgets/conference-session/readme.md: -------------------------------------------------------------------------------- 1 | # Community widget: Conference Session 2 | 3 | **Contributor's GitHub alias**: mikebudzynski 4 | 5 | **Organization name**: Contoso 6 | 7 | **Privacy and security notes**: This widget issues API calls to an external source. 8 | 9 | ![Conference session widget](image.png) 10 | 11 | This widget retrieves conference session information from the [Conference API](https://conferenceapi.azurewebsites.net/?format=json) and displays it on the portal. You can configure the session id through the widget editor. 12 | -------------------------------------------------------------------------------- /src/components/apis/api-products/apiProductsContract.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { HyperlinkContract } from "@paperbits/common/editing"; 3 | 4 | /** 5 | * Product API list widget configuration. 6 | */ 7 | export interface ApiProductsContract extends Contract { 8 | /** 9 | * List layout. "list", "dropdown" or "tiles" 10 | */ 11 | itemStyleView?: string; 12 | 13 | /** 14 | * Link to a page that contains operation details. 15 | */ 16 | detailsPageHyperlink?: HyperlinkContract; 17 | } 18 | -------------------------------------------------------------------------------- /src/components/apis/details-of-api/detailsOfApi.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ApiDetails } from "./react/runtime/ApiDetails"; 4 | 5 | export class DetailsOfApiRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("detailsOfApiRuntime", ApiDetails); 8 | registerCustomElement(ApiDetails, "fui-api-details", injector); 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/apis/history-of-api/historyOfApi.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ApiHistory } from "./react/runtime/ApiHistory"; 4 | 5 | export class HistoryOfApiRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("historyOfApiRuntime", ApiHistory); 8 | registerCustomElement(ApiHistory, "fui-api-history", injector); 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/users/signin/signin.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { SignInRuntime } from "./react/runtime/SignInRuntime"; 4 | 5 | export class SignInRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("SignInRuntimeModule", SignInRuntime); 8 | registerCustomElement(SignInRuntime, "fui-signin-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/users/signup/signup.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { SignUpRuntime } from "./react/runtime/SignUpRuntime"; 4 | 5 | export class SignUpRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("SignUpRuntimeModule", SignUpRuntime); 8 | registerCustomElement(SignUpRuntime, "fui-signup-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/reports/minMaxAvgChart/minMaxAvgChartRecord.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Min-max-avg-chart record. 3 | */ 4 | export interface MinMaxAvgChartRecord { 5 | /** 6 | * Time stamp of the record used to build X-axis. 7 | */ 8 | timestamp: Date; 9 | 10 | /** 11 | * Min value used to build Y-axis. 12 | */ 13 | min: number; 14 | 15 | /** 16 | * Avg value used to build Y-axis. 17 | */ 18 | avg: number; 19 | 20 | /** 21 | * Max value used to build Y-axis. 22 | */ 23 | max: number; 24 | } 25 | -------------------------------------------------------------------------------- /src/components/reports/reports.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ReportsRuntime } from "./react/runtime/ReportsRuntime"; 4 | 5 | export class ReportsRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ReportsRuntimeModule", ReportsRuntime); 8 | registerCustomElement(ReportsRuntime, "fui-reports-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/models/console/consoleHost.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | // import { ValidateIf, IsNotEmpty } from "class-validator"; 3 | 4 | export class ConsoleHost { 5 | public readonly hostname: ko.Observable; 6 | 7 | // @ValidateIf(x => x.hostname && x.hostname.indexOf("*") >= 0) 8 | // @IsNotEmpty({ message: "Wildcard segment is required." }) 9 | public readonly wildcard: ko.Observable; 10 | 11 | constructor() { 12 | this.hostname = ko.observable(); 13 | this.wildcard = ko.observable(); 14 | } 15 | } -------------------------------------------------------------------------------- /community/widgets/document-details/ko/documentDetailsViewModel.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | import template from "./documentDetails.html"; 3 | import { Component } from "@paperbits/common/ko/decorators"; 4 | import { widgetSelector } from "../constants"; 5 | 6 | 7 | @Component({ 8 | selector: widgetSelector, 9 | template: template 10 | }) 11 | export class DocumentDetailsViewModel { 12 | public readonly runtimeConfig: ko.Observable; 13 | 14 | constructor() { 15 | this.runtimeConfig = ko.observable(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/components/custom-widget/customWidget.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjectorModule, IInjector } from "@paperbits/common/injection"; 2 | import { CustomWidget } from "./ko/runtime/customWidget"; 3 | import { ListenForSecretsRequests } from "./listenForSecretsRequests"; 4 | 5 | export class CustomWidgetRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("customWidgetScaffoldRuntime", CustomWidget); 8 | injector.bindToCollection("autostart", ListenForSecretsRequests); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/users/profile/profile.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ProfileRuntime } from "./react/runtime/ProfileRuntime"; 4 | 5 | export class ProfileRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ProfileRuntimeModule", ProfileRuntime); 8 | registerCustomElement(ProfileRuntime, "fui-profile-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/content/content.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 7 |
8 |
9 | 13 |
14 |
-------------------------------------------------------------------------------- /examples/widgets/conference-session/ko/conferenceSessionViewModel.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | import template from "./conferenceSession.html"; 3 | import { Component } from "@paperbits/common/ko/decorators"; 4 | import { widgetSelector } from "../constants"; 5 | 6 | 7 | @Component({ 8 | selector: widgetSelector, 9 | template: template 10 | }) 11 | export class ConferenceSessionViewModel { 12 | public readonly runtimeConfig: ko.Observable; 13 | 14 | constructor() { 15 | this.runtimeConfig = ko.observable(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/components/apis/list-of-apis/listOfApis.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { ApiListRuntime } from "./react/runtime/ApiListRuntime"; 3 | import { registerCustomElement } from "@paperbits/react/customElements"; 4 | 5 | export class ListOfApisRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("listOfApisRuntime", ApiListRuntime); 8 | registerCustomElement(ApiListRuntime, "fui-api-list-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/users/validation-summary/constants.ts: -------------------------------------------------------------------------------- 1 | export const onValidationErrors = "onValidationErrors"; 2 | 3 | export enum ErrorSources { 4 | signin = "signin", 5 | signup = "signup", 6 | signInOAuth = "signInOAuth", 7 | confirmpassword = "confirmpassword", 8 | changepassword = "changepassword", 9 | resetpassword = "resetpassword", 10 | changeProfile = "changeProfile", 11 | renameSubscription = "renameSubscription", 12 | cancelSubscription = "cancelSubscription", 13 | regeneratePKey = "regeneratePKey", 14 | regenerateSKey = "regenerateSKey", 15 | } 16 | -------------------------------------------------------------------------------- /src/components/apis/api-products/apiProductsModel.ts: -------------------------------------------------------------------------------- 1 | import { HyperlinkModel } from "@paperbits/common/permalinks"; 2 | 3 | /** 4 | * Product API list widget configuration. 5 | */ 6 | export class ApiProductsModel { 7 | /** 8 | * List layout. "list", "dropdown" or "tiles" 9 | */ 10 | public layout?: string; 11 | 12 | /** 13 | * Link to a page that contains API details. 14 | */ 15 | public detailsPageHyperlink: HyperlinkModel; 16 | 17 | constructor(layout?: "list"|"dropdown"|"tiles") { 18 | this.layout = layout; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/themes/website/styles/pills.scss: -------------------------------------------------------------------------------- 1 | .nav-pills { 2 | margin: 5px 0; 3 | 4 | .nav-item { 5 | margin: 1px; 6 | 7 | .nav-link { 8 | border-radius: .25rem; 9 | font-size: 1.3em; 10 | padding: 5px 10px; 11 | border: none; 12 | background: inherit; 13 | 14 | &:hover { 15 | background-color: $border-color-hover; 16 | } 17 | 18 | &.active { 19 | border: 1px solid $border-color-active; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/components/apis/api-products/apiProducts.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ApiProductsRuntime } from "./react/runtime/ApiProductsRuntime"; 4 | 5 | export class ApiProductsRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("apiProductsRuntime", ApiProductsRuntime); 8 | registerCustomElement(ApiProductsRuntime, "fui-api-products-runtime", injector); 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/users/signup-social/signupSocial.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { SignUpAadRuntime } from "./react/runtime/SignUpAadRuntime"; 4 | 5 | export class SignUpAadRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("SignUpAadRuntimeModule", SignUpAadRuntime); 8 | registerCustomElement(SignUpAadRuntime, "fui-signup-aad-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/contracts/aadB2CClientConfig.ts: -------------------------------------------------------------------------------- 1 | import { AadClientConfig } from "./aadClientConfig"; 2 | 3 | export interface AadB2CClientConfig extends AadClientConfig { 4 | /** 5 | * Sign-in policy name. Only applies to AAD B2C identity provider. 6 | */ 7 | signinPolicyName: string; 8 | 9 | /** 10 | * Sign-up policy name. Only applies to AAD B2C identity provider. 11 | */ 12 | signupPolicyName: string; 13 | 14 | /** 15 | * Password reset policy name. Only applies to AAD B2C identity provider. 16 | */ 17 | passwordResetPolicyName: string; 18 | } -------------------------------------------------------------------------------- /src/contracts/oauthTokenResponse.ts: -------------------------------------------------------------------------------- 1 | export interface OAuthTokenResponse { 2 | /** 3 | * Access token. 4 | */ 5 | access_token: string; 6 | 7 | /** 8 | * Type of the access token, e.g. `Bearer`. 9 | */ 10 | token_type: string; 11 | 12 | /** 13 | * Expiration date and time, e.g. `1663205603` 14 | */ 15 | expires_on: string; 16 | 17 | /** 18 | * Base64-encoded ID token. 19 | */ 20 | id_token: string; 21 | 22 | /** 23 | * Refresh token. 24 | */ 25 | refresh_token: string; 26 | } -------------------------------------------------------------------------------- /src/models/knownHttpHeaders.ts: -------------------------------------------------------------------------------- 1 | export enum KnownHttpHeaders { 2 | Authorization = "Authorization", 3 | CacheControl = "Cache-Control", 4 | ContentType = "Content-Type", 5 | ContentEncoding = "Content-Encoding", 6 | OcpApimSubscriptionKey = "Ocp-Apim-Subscription-Key", 7 | OcpApimTrace = "Ocp-Apim-Trace", 8 | OcpApimTraceLocation = "Ocp-Apim-Trace-Location", 9 | OcpApimSasToken = "Ocp-Apim-Sas-Token", 10 | SoapAction = "SOAPAction", 11 | IfMatch = "If-Match", 12 | XMsApiName = "X-Ms-Api-Name", 13 | XMsApiDevPortal = "x-ms-api-devportal" 14 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-video-player.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/components/reports/react/runtime/utils.ts: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | export const useLoadData = (load: (...args: D) => Promise, deps: D): { working: boolean, data: T | undefined } => { 4 | const [working, setWorking] = React.useState(true); 5 | const [data, setData] = React.useState(); 6 | 7 | React.useEffect(() => { 8 | setWorking(true); 9 | load(...deps) 10 | .then(setData) 11 | .finally(() => setWorking(false)); 12 | }, [load, ...deps]); 13 | 14 | return { working, data }; 15 | } 16 | -------------------------------------------------------------------------------- /src/contracts/revision.ts: -------------------------------------------------------------------------------- 1 | export interface RevisionContract { 2 | apiId: string; 3 | 4 | /** 5 | * Example: "1" 6 | */ 7 | apiRevision: string; 8 | 9 | /** 10 | * Example: "2016-12-01T19:30:35.763" 11 | */ 12 | createdDateTime: string; 13 | 14 | /** 15 | * Example: "2016-12-01T19:30:35.763" 16 | */ 17 | updatedDateTime: string; 18 | 19 | description: string; 20 | 21 | /** 22 | * Example: "/amazons3;rev=0" 23 | */ 24 | privateUrl: string; 25 | 26 | isOnline: boolean; 27 | 28 | isCurrent: boolean; 29 | } -------------------------------------------------------------------------------- /src/components/products/product-apis/productApis.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ProductApisRuntime } from "./react/runtime/ProductApisRuntime"; 4 | 5 | export class ProductApisRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("productApsRuntime", ProductApisRuntime); 8 | registerCustomElement(ProductApisRuntime, "fui-product-apis-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/contracts/apiTagDescription.ts: -------------------------------------------------------------------------------- 1 | import { TagContract } from "./tag"; 2 | 3 | export interface ApiTagDescriptionContract { 4 | /** 5 | * Example: /apiTagDescriptions/DCD501300701F346BA206320 6 | */ 7 | id: string; 8 | 9 | /** 10 | * Example: /apis/echo-api 11 | */ 12 | apiId: string; 13 | 14 | /** 15 | * Example: /tags/34CB3A8E1F77FB46BFD268E9 16 | */ 17 | tagId: string; 18 | 19 | description: string; 20 | 21 | externalDocsDescription: string; 22 | 23 | externalDocsUrl: string; 24 | 25 | tag: TagContract; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/contracts/portalConfig.ts: -------------------------------------------------------------------------------- 1 | import { PortalConfigCors } from "./portalConfigCors"; 2 | import { PortalConfigCsp } from "./contentSecurityPolicy"; 3 | import { PortalConfigDelegation } from "./portalConfigDelegation"; 4 | import { PortalConfigSignup } from "./portalConfigSignup"; 5 | import { PortalConfigSignin } from "./portalConfigSignin"; 6 | 7 | export interface PortalConfig { 8 | enableBasicAuth: boolean; 9 | signin: PortalConfigSignin; 10 | signup: PortalConfigSignup; 11 | delegation: PortalConfigDelegation; 12 | csp: PortalConfigCsp; 13 | cors: PortalConfigCors; 14 | } -------------------------------------------------------------------------------- /src/components/operations/operation-list/operationList.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { OperationListRuntime } from "./react/runtime/OperationListRuntime"; 4 | 5 | export class OperationListRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("operationListRuntime", OperationListRuntime); 8 | registerCustomElement(OperationListRuntime, "fui-operation-list", injector); 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/products/product-list/productList.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ProductsListRuntime } from "./react/runtime/ProductsListRuntime"; 4 | 5 | export class ProductListRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ProductListRuntime", ProductsListRuntime); 8 | registerCustomElement(ProductsListRuntime, "fui-product-list-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/users/reset-password/resetPassword.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ResetPasswordRuntime } from "./react/runtime/ResetPasswordRuntime"; 4 | 5 | export class ResetPasswordRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ResetPasswordRuntimeModule", ResetPasswordRuntime); 8 | registerCustomElement(ResetPasswordRuntime, "fui-reset-password", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/models/subscriptionContract.ts: -------------------------------------------------------------------------------- 1 | export interface SubscriptionContract { 2 | properties: SubscriptionProperties; 3 | } 4 | 5 | export interface SubscriptionProperties{ 6 | displayName: string; 7 | 8 | createdDate: string; 9 | 10 | endDate: string; 11 | 12 | expirationDate: string; 13 | 14 | notificationDate: string; 15 | 16 | primaryKey: string; 17 | 18 | scope: string; 19 | 20 | secondaryKey: string; 21 | 22 | startDate: string; 23 | 24 | state: string; 25 | 26 | stateComment: string; 27 | 28 | ownerId: string; 29 | } -------------------------------------------------------------------------------- /src/components/help/help.html: -------------------------------------------------------------------------------- 1 |
2 |

Go to this documentation article to learn more about 3 | the API Management developer portal

4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
-------------------------------------------------------------------------------- /src/components/products/product-apis/productApisHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ProductApisModel } from "./productApisModel"; 3 | 4 | export class ProductApisHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ProductApisModel("list") 7 | } 8 | } 9 | 10 | export class ProductApisTilesHandlers implements IWidgetHandler { 11 | public async getWidgetModel(): Promise { 12 | return new ProductApisModel("tiles") 13 | } 14 | } -------------------------------------------------------------------------------- /src/components/users/change-password/changePassword.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ChangePasswordRuntime } from "./react/runtime/ChangePasswordRuntime"; 4 | 5 | export class ChangePasswordRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ChangePasswordRuntimeModule", ChangePasswordRuntime); 8 | registerCustomElement(ChangePasswordRuntime, "fui-change-password", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/users/subscriptions/subscriptions.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { SubscriptionsRuntime } from "./react/runtime/SubscriptionsRuntime"; 4 | 5 | export class SubscriptionsRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("SubscriptionsRuntimeModule", SubscriptionsRuntime); 8 | registerCustomElement(SubscriptionsRuntime, "fui-subscriptions-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/users/confirm-password/confirmPassword.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ConfirmPasswordRuntime } from "./react/runtime/ConfirmPasswordRuntime"; 4 | 5 | export class ConfirmPasswordRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ConfirmPasswordRuntimeModule", ConfirmPasswordRuntime); 8 | registerCustomElement(ConfirmPasswordRuntime, "fui-confirm-password", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/models/service.ts: -------------------------------------------------------------------------------- 1 | import { ServiceDescriptionContract, HostnameConfiguration, ServiceSku } from "./../contracts/service"; 2 | 3 | export class ServiceDescription { 4 | public name: string; 5 | public hostnameConfigurations: HostnameConfiguration[]; 6 | public sku: ServiceSku; 7 | public gatewayUrl: string; 8 | 9 | constructor(contract: ServiceDescriptionContract) { 10 | this.name = contract.name; 11 | this.sku = contract.sku; 12 | this.gatewayUrl = contract.properties.gatewayUrl; 13 | this.hostnameConfigurations = contract.properties.hostnameConfigurations; 14 | } 15 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-picture.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/components/operations/operation-details/operationDetails.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { OperationDetailsRuntime } from "./react/runtime/OperationDetailsRuntime"; 4 | 5 | export class OperationDetailsRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("operationDetailsRuntime", OperationDetailsRuntime); 8 | registerCustomElement(OperationDetailsRuntime, "fui-operation-details", injector); 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/products/product-details/productDetails.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ProductDetailsRuntime } from "./react/runtime/ProductDetailsRuntime"; 4 | 5 | export class ProductDetailsRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ProductDetailsRuntimeModule", ProductDetailsRuntime); 8 | registerCustomElement(ProductDetailsRuntime, "fui-product-details-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/reports/react/ReportsViewModel.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { LocalStyles } from "@paperbits/common/styles"; 3 | 4 | export class ReportsViewModel extends React.Component { 5 | constructor(props) { 6 | super(props); 7 | 8 | this.state = {...props}; 9 | } 10 | 11 | public render(): JSX.Element { 12 | const data = JSON.stringify(this.state); 13 | 14 | return this.state.isRedesignEnabled 15 | ? 16 | : ; 17 | } 18 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-table.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/components/users/validation-summary/validationSummary.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { selector, ValidationSummaryRuntime } from "./react/runtime/ValidationSummaryRuntime"; 4 | 5 | export class ValidationSummaryRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ValidationSummaryRuntimeModule", ValidationSummaryRuntime); 8 | registerCustomElement(ValidationSummaryRuntime, selector, injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/components/content/content.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjectorModule, IInjector } from "@paperbits/common/injection"; 2 | import { ContentWorkshop } from "./content"; 3 | import { OperationsSectionToolButton } from "./operationsSection"; 4 | import { ResetDetailsWorkshop } from "./resetDetails"; 5 | 6 | export class ContentModule implements IInjectorModule { 7 | public register(injector: IInjector): void { 8 | injector.bind("contentWorkshop", ContentWorkshop); 9 | injector.bind("resetDetailsWorkshop", ResetDetailsWorkshop); 10 | injector.bindToCollection("workshopSections", OperationsSectionToolButton); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/components/products/product-subscribe/productSubscribe.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { ProductSubscribeRuntime } from "./react/runtime/ProductSubscribeRuntime"; 4 | 5 | export class ProductSubscribeRuntimeModule implements IInjectorModule { 6 | public register(injector: IInjector): void { 7 | injector.bind("ProductSubscribeRuntimeRuntime", ProductSubscribeRuntime); 8 | registerCustomElement(ProductSubscribeRuntime, "fui-product-subscribe-runtime", injector); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/themes/designer/styles/grid.scss: -------------------------------------------------------------------------------- 1 | .snippet-grid { 2 | display: grid; 3 | grid-template-columns: repeat(12, 10px); 4 | grid-template-rows: repeat(12, 10px); 5 | row-gap: 0 !important; 6 | column-gap: 0 !important; 7 | margin: 5px !important; 8 | width: 80px !important; 9 | float: left; 10 | 11 | &:hover { 12 | @include selection(15px, -5px); 13 | cursor: pointer; 14 | } 15 | } 16 | 17 | .snippet-grid-cell { 18 | background: #d9d9d9; 19 | outline: 1px solid gray; 20 | min-width: 15px; 21 | min-height: 20px; 22 | margin: 2px; 23 | 24 | &[role="article"] { 25 | background: #bfbfbf; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-button.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/bindingHandlers/tab.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | 3 | interface TabConfig { 4 | isSelected: ko.Observable; 5 | } 6 | 7 | ko.bindingHandlers["tab"] = { 8 | update: (element: HTMLElement, valueAccessor: () => TabConfig): void => { 9 | const config = valueAccessor(); 10 | const isSelected = ko.unwrap(config.isSelected); 11 | 12 | ko.applyBindingsToNode(element, { 13 | css: { 14 | "nav-link-active": isSelected 15 | }, 16 | attr: { 17 | "aria-selected": isSelected ? "true" : "false" 18 | } 19 | }, null); 20 | } 21 | }; -------------------------------------------------------------------------------- /src/components/operations/operation-details/ko/runtime/templates/http.liquid: -------------------------------------------------------------------------------- 1 | {{console.method}} {{console.requestUrl}} HTTP/1.1 2 | 3 | {% for header in console.request.meaningfulHeaders -%} 4 | {% if showSecrets == false and header.secret -%} 5 | {{ header.name }}: {{ header.hiddenValue }} 6 | {% else -%} 7 | {{ header.name }}: {{ header.value }} 8 | {% endif -%} 9 | {% endfor %} 10 | {% if console.request.body != blank and console.request.bodyFormat == "raw" -%} 11 | {{ console.request.body }} 12 | {% endif -%} 13 | {% if console.request.binary != blank and console.request.bodyFormat == "binary" -%} 14 | [ {{ console.request.binary.name }} ] 15 | {% endif -%} -------------------------------------------------------------------------------- /tests/services/ITestProductService.ts: -------------------------------------------------------------------------------- 1 | import { ProductContract as SmapiProductContract } from "../models/productContract"; 2 | import { SubscriptionContract as SmapiSubscriptionContract } from "../models/subscriptionContract"; 3 | export interface ITestProductService { 4 | 5 | putProduct(productId: string, productContract: SmapiProductContract): Promise; 6 | 7 | putProductGroup(productId: string, groupId: string): Promise; 8 | 9 | deleteProduct(productId: string, deleteSubs: boolean): Promise; 10 | 11 | putProductSubscription(id: String, subscriptionContract: SmapiSubscriptionContract): Promise; 12 | } -------------------------------------------------------------------------------- /src/themes/website/styles/widgets/widgets.scss: -------------------------------------------------------------------------------- 1 | @import "button.scss"; 2 | @import "captcha.scss"; 3 | @import "card.scss"; 4 | @import "map.scss"; 5 | @import "textblock.scss"; 6 | @import "collapsibles.scss"; 7 | @import "carousel.scss"; 8 | @import "tabs.scss"; 9 | @import "popups.scss"; 10 | @import "tables.scss"; 11 | @import "tabs.scss"; 12 | @import "picture.scss"; 13 | @import "accordion.scss"; 14 | 15 | @import "fui/fluentui.scss"; 16 | @import "fui/table.scss"; 17 | @import "fui/operation-list.scss"; 18 | @import "fui/api-details.scss"; 19 | @import "fui/operation-details.scss"; 20 | @import "fui/apis-products-lists.scss"; 21 | @import "fui/reports.scss"; 22 | -------------------------------------------------------------------------------- /src/components/operations/operation-details/ko/runtime/code-snippet.html: -------------------------------------------------------------------------------- 1 |

2 |
3 |
4 |
5 | 6 | 11 |
12 |
13 |



--------------------------------------------------------------------------------
/src/components/users/profile/react/ProfileViewModel.tsx:
--------------------------------------------------------------------------------
 1 | import * as React from "react";
 2 | 
 3 | export class ProfileViewModel extends React.Component {
 4 |     constructor(props) {
 5 |         super(props);
 6 | 
 7 |         this.state = {
 8 |             isRedesignEnabled: props.isRedesignEnabled,
 9 |             classNames: props.styles
10 |         };
11 |     }
12 | 
13 |     public render(): JSX.Element {
14 |         return this.state.isRedesignEnabled
15 |             ? 
16 |             : ;
17 |     }
18 | }


--------------------------------------------------------------------------------
/src/persistence/publishingCacheModule.ts:
--------------------------------------------------------------------------------
 1 | import { IObjectStorage } from "@paperbits/common/persistence";
 2 | import { IInjector, IInjectorModule } from "@paperbits/common/injection";
 3 | import { CachedObjectStorage } from "./cachedObjectStorage";
 4 | 
 5 | 
 6 | export class PublishingCacheModule implements IInjectorModule {
 7 |     public register(injector: IInjector): void {
 8 |         const underlyingObjectStorage = injector.resolve("objectStorage");
 9 | 
10 |         injector.bindSingletonFactory("objectStorage", (ctx: IInjector) => {
11 |             return new CachedObjectStorage(underlyingObjectStorage);
12 |         });
13 |     }
14 | }


--------------------------------------------------------------------------------
/src/admin/utils/components/backButton.tsx:
--------------------------------------------------------------------------------
 1 | import * as React from 'react';
 2 | import { CommandBarButton, IIconProps } from '@fluentui/react';
 3 | 
 4 | const backIcon: IIconProps = { iconName: 'ChevronLeftMed' };
 5 | 
 6 | interface BackButtonProps {
 7 |     onClick: () => void
 8 | }
 9 | 
10 | export class BackButton extends React.Component {
11 |     render(): JSX.Element {
12 |         return <>
13 |             
19 |         
20 |     };
21 | }


--------------------------------------------------------------------------------
/src/components/products/product-subscriptions/productSubscriptions.runtime.module.ts:
--------------------------------------------------------------------------------
 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection";
 2 | import { registerCustomElement } from "@paperbits/react/customElements";
 3 | import { ProductSubscriptionsRuntime } from "./react/runtime/ProductSubscriptionsRuntime";
 4 | 
 5 | export class ProductSubscriptionsRuntimeModule implements IInjectorModule {
 6 |     public register(injector: IInjector): void {
 7 |         injector.bind("productSubscriptionsRuntime", ProductSubscriptionsRuntime);
 8 |         registerCustomElement(ProductSubscriptionsRuntime, "fui-product-subscriptions-runtime", injector);
 9 |     }
10 | }
11 | 


--------------------------------------------------------------------------------
/src/components/operations/operation-details/react/runtime/operation-console/templates/http.liquid:
--------------------------------------------------------------------------------
 1 | {{console.method}} {{console.requestUrl}} HTTP/1.1
 2 | 
 3 | {% for header in console.request.meaningfulHeaders -%}
 4 | {% if showSecrets == false and header.secret -%}
 5 | {{ header.name }}: {{ header.hiddenValue }}
 6 | {% else -%}
 7 | {{ header.name }}: {{ header.value }}
 8 | {% endif -%}
 9 | {% endfor %}
10 | {% if console.request.body != blank and console.request.bodyFormat == "raw" -%}
11 | {{ console.request.body }}
12 | {% endif -%}
13 | {% if console.request.binary != blank and console.request.bodyFormat == "binary" -%}
14 | [ {{ console.request.binary.name }} ]
15 | {% endif -%}


--------------------------------------------------------------------------------
/src/contracts/signupRequest.ts:
--------------------------------------------------------------------------------
 1 | import { CaptchaChallengeRequest } from "./captchaParams";
 2 | 
 3 | /**
 4 |  * Cotract of user sign up request
 5 |  */
 6 | export interface SignupRequest {
 7 |     challenge: CaptchaChallengeRequest;
 8 |     solution: string;
 9 |     token: string;
10 |     type: string;
11 |     flowId: string;
12 |     signupData: MapiSignupRequest;
13 | }
14 | 
15 | export interface MapiSignupRequest {
16 |     email: string;
17 |     firstName: string;
18 |     lastName: string;
19 |     password: string;
20 |     confirmation: string;
21 |     state?: string;
22 |     note?: string;
23 |     identities?: { id: string; name: string }[];
24 |     appType: string;
25 | }


--------------------------------------------------------------------------------
/src/models/console/consoleRepresentation.ts:
--------------------------------------------------------------------------------
 1 | import { Representation } from "../representation";
 2 | 
 3 | export class ConsoleRepresentation {
 4 |     public readonly sample: string;
 5 |     public readonly contentType: string;
 6 |     public readonly schemaId?: string;
 7 |     public readonly typeName?: string;
 8 | 
 9 |     constructor(representation: Representation) {
10 |         this.sample = representation.sample ?? representation.examples?.length > 0 ? representation.examples[0].value : "";
11 |         this.contentType = representation.contentType;
12 |         this.schemaId = representation.schemaId;
13 |         this.typeName = representation.typeName;
14 |     }
15 | }
16 | 


--------------------------------------------------------------------------------
/src/publishing/runtimeConfigBuilder.ts:
--------------------------------------------------------------------------------
 1 | import { Bag } from "@paperbits/common";
 2 | 
 3 | /**
 4 |  * Runtime config builder helps content publishers to compose runtime configuration.
 5 |  */
 6 | export class RuntimeConfigBuilder {
 7 |     private readonly configuration: Bag = {};
 8 | 
 9 |     /**
10 |      * Adds setting to runtime configuration.
11 |      * @param key {string} Setting key.
12 |      * @param value {Object} Serializable object.
13 |      */
14 |     public addSetting(key: string, value: Object): void {
15 |         this.configuration[key] = value;
16 |     }
17 | 
18 |     public build(): Bag {
19 |         return this.configuration;
20 |     }
21 | }


--------------------------------------------------------------------------------
/src/components/help/helpDetails.ts:
--------------------------------------------------------------------------------
 1 | import * as ko from "knockout";
 2 | import template from "./helpDetails.html";
 3 | import { Component, OnMounted, Param } from "@paperbits/common/ko/decorators";
 4 | import { Hint } from "./hint";
 5 | 
 6 | @Component({
 7 |     selector: "help-details-workshop",
 8 |     template: template
 9 | })
10 | export class HelpDetailsWorkshop {
11 |     public readonly hints: ko.ObservableArray;
12 | 
13 |     public constructor() {
14 |         this.hints = ko.observableArray();
15 |     }
16 | 
17 |     @Param()
18 |     public hint: Hint;
19 | 
20 |     @OnMounted()
21 |     public async initialize(): Promise {
22 |         //
23 |     }
24 | }
25 | 


--------------------------------------------------------------------------------
/src/themes/designer/styles/flex.scss:
--------------------------------------------------------------------------------
 1 | .flex {
 2 |     display: flex;
 3 |     justify-content: flex-start;
 4 |     align-content: flex-start;
 5 |     min-height: 0; // fixes issue with oveflow in Edge, FF and other browsers
 6 | 
 7 |     &.flex-row {
 8 |         flex-direction: row;
 9 |     }
10 | 
11 |     &.flex-column {
12 |         flex-direction: column;
13 |     }
14 | 
15 |     .flex-item {
16 |         flex: 0 1 auto;
17 |         align-self: auto;
18 | 
19 |         &.flex-item-grow {
20 |             flex: 1 1 auto;
21 |         }
22 |     }
23 | 
24 |     .flex-wrap {
25 |         flex-wrap: wrap;
26 |     }
27 | }
28 | 
29 | .flex-end {
30 |     align-items: flex-end;
31 | }
32 | 


--------------------------------------------------------------------------------
/src/themes/website/styles/text.scss:
--------------------------------------------------------------------------------
 1 | h1,
 2 | h2,
 3 | h3,
 4 | h4,
 5 | h5,
 6 | h6 {
 7 |     font-weight: $default-heading-font-weight;
 8 |     line-height: $default-heading-line-height;
 9 |     color: $default-heading-color;
10 | }
11 | 
12 | pre {
13 |     white-space: pre-wrap;
14 | }
15 | 
16 | span {
17 |     &.strong {
18 |         font-weight: 600;
19 |     }
20 | 
21 |     &.stronger {
22 |         font-weight: 700;
23 |     }
24 | }
25 | 
26 | span.caption1 {
27 |     font-size: .9em;
28 | 
29 |     &-strong {
30 |         font-weight: 600;
31 |     }
32 | }
33 | 
34 | a.dropdown-link {
35 |     color: inherit;
36 | 
37 |     &:hover {
38 |         color: inherit;
39 |     }
40 | }
41 | 


--------------------------------------------------------------------------------
/src/components/custom-widget/ko/customWidgetViewModel.ts:
--------------------------------------------------------------------------------
 1 | import * as ko from "knockout";
 2 | import { Component } from "@paperbits/common/ko/decorators";
 3 | import { StyleModel } from "@paperbits/common/styles";
 4 | import { widgetSelector } from "../constants";
 5 | import template from "./customWidgetView.html";
 6 | 
 7 | @Component({
 8 |     selector: widgetSelector,
 9 |     template: template
10 | })
11 | export class CustomWidgetViewModel {
12 |     public readonly config: ko.Observable;
13 |     public readonly styles: ko.Observable;
14 | 
15 |     constructor() {
16 |         this.config = ko.observable();
17 |         this.styles = ko.observable();
18 |     }
19 | }
20 | 


--------------------------------------------------------------------------------
/src/components/users/confirm-password/react/ConfirmPasswordViewModel.tsx:
--------------------------------------------------------------------------------
 1 | import * as React from "react";
 2 | 
 3 | export class ConfirmPasswordViewModel extends React.Component {
 4 |     constructor(props) {
 5 |         super(props);
 6 | 
 7 |         this.state = {
 8 |             isRedesignEnabled: props.isRedesignEnabled,
 9 |             classNames: props.styles
10 |         };
11 |     }
12 | 
13 |     public render(): JSX.Element {
14 |         return this.state.isRedesignEnabled
15 |             ? 
16 |             : ;
17 |     }
18 | }


--------------------------------------------------------------------------------
/src/contracts/reportRecordBySubscription.ts:
--------------------------------------------------------------------------------
 1 | import { ReportRecord } from "./reportRecord";
 2 | 
 3 | /**
 4 |  * Metrics aggregated by product subscription.
 5 |  */
 6 | export interface ReportRecordBySubscription extends ReportRecord {
 7 |     /**
 8 |      * Subscription name, e.g. "My subscription".
 9 |      */
10 |     name: string;
11 | 
12 |     /**
13 |      * Product identifier, e.g. "/products/unlimited".
14 |      */
15 |     productId: string;
16 | 
17 |     /**
18 |      * Subscription identifier, e.g. "/subscriptions/my-subscription"
19 |      */
20 |     subscriptionId: string;
21 | 
22 |     /**
23 |      * User identifier, e.g. "/users/john-doe"
24 |      */
25 |     userId: string;
26 | }


--------------------------------------------------------------------------------
/src/themes/designer/styles/draggables.scss:
--------------------------------------------------------------------------------
 1 | .dragtarget {
 2 |     width: 100px;
 3 |     height: 100px;
 4 |     border: 1px dashed #ccc;
 5 | }
 6 | 
 7 | .dragsource {
 8 |     border: 1px solid #ccc;
 9 |     position: fixed;
10 |     background: #fff;
11 | }
12 | 
13 | .dragged {
14 |     @include no-select();
15 |     @include no-drag();
16 |     @include no-pointer-events();
17 |     z-index: $z-index-dragging;
18 |     cursor: grab;
19 |     position: fixed;
20 |     background: #fff;
21 | }
22 | 
23 | .placeholder {
24 |     border: 2px dashed #ccc;
25 |     border: 2px dashed darken($toolbox-background, 20%);
26 |     transition: height .5s ease-in-out;
27 |     position: relative;
28 | }
29 | 
30 | 


--------------------------------------------------------------------------------
/src/bindingHandlers/traceClick.ts:
--------------------------------------------------------------------------------
 1 | import { Logger } from "@paperbits/common/logging";
 2 | import * as ko from "knockout";
 3 | import { eventTypes } from "../logging/clientLogger";
 4 | 
 5 | export class TraceClick {
 6 |     constructor(private readonly logger: Logger) { }
 7 | 
 8 |     public setupBinding(): void {
 9 |         ko.bindingHandlers["traceClick"] = {
10 |             init: (element: HTMLElement): void => {
11 |                 ko.utils.registerEventHandler(element, "click", () => {
12 |                     this.logger.trackEvent(eventTypes.click, { message: `User clicked on the element with id ${element.id ?? "-"}` });
13 |                 });
14 |             }
15 |         }
16 |     }
17 | }


--------------------------------------------------------------------------------
/src/components/products/product-apis/productApisContract.ts:
--------------------------------------------------------------------------------
 1 | import { Contract } from "@paperbits/common";
 2 | import { HyperlinkContract } from "@paperbits/common/editing";
 3 | import { LocalStyles } from "@paperbits/common/styles";
 4 | 
 5 | /**
 6 |  * Product API list widget configuration.
 7 |  */
 8 | export interface ProductApisContract extends Contract {
 9 |     /**
10 |      * List layout. "list" or "tiles"
11 |      */
12 |     itemStyleView?: string;
13 | 
14 |     /**
15 |      * Link to a page that contains operation details.
16 |      */
17 |     detailsPageHyperlink?: HyperlinkContract;
18 | 
19 |     /**
20 |      * Widget local styles.
21 |      */
22 |     styles?: LocalStyles;
23 | }
24 | 


--------------------------------------------------------------------------------
/src/bindingHandlers/copyToClipboard.ts:
--------------------------------------------------------------------------------
 1 | import * as ko from "knockout";
 2 | 
 3 | ko.bindingHandlers["copyToClipboard"] = {
 4 |     init: (element: HTMLElement, valueAccessor: () => (string | (() => Promise))): void => {
 5 |         const copyToClipboard = async () => {
 6 |             const unwrappedValue = ko.unwrap(valueAccessor());
 7 |             const text = typeof unwrappedValue === "string"
 8 |                 ? unwrappedValue as string
 9 |                 : await (unwrappedValue as (() => Promise))();
10 | 
11 |             await navigator.clipboard.writeText(text);
12 |         };
13 | 
14 |         ko.applyBindingsToNode(element, { click: copyToClipboard }, null);
15 |     }
16 | };


--------------------------------------------------------------------------------
/src/contracts/response.ts:
--------------------------------------------------------------------------------
 1 | import { RepresentationContract } from "./representation";
 2 | import { ParameterContract } from "./parameter";
 3 | 
 4 | /*
 5 |  * Model of API operation response
 6 |  */
 7 | export interface ResponseContract {
 8 |     /**
 9 |      * Collection of operation response headers.
10 |      */
11 |     headers?: ParameterContract[];
12 | 
13 |     /**
14 |      * Operation response status code.
15 |      */
16 |     statusCode: number;
17 | 
18 |     /**
19 |      * Collection of operation response representations.
20 |      */
21 |     representations?: RepresentationContract[];
22 | 
23 |     /**
24 |      * Operation response description.
25 |      */
26 |     description?: string;
27 | }


--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
 1 | # Security Policy
 2 | 
 3 | ## Supported Versions
 4 | 
 5 | Use this section to tell people about which versions of your project are
 6 | currently being supported with security updates.
 7 | 
 8 | | Version | Supported          |
 9 | | ------- | ------------------ |
10 | | 5.1.x   | :white_check_mark: |
11 | | 5.0.x   | :x:                |
12 | | 4.0.x   | :white_check_mark: |
13 | | < 4.0   | :x:                |
14 | 
15 | ## Reporting a Vulnerability
16 | 
17 | Use this section to tell people how to report a vulnerability.
18 | 
19 | Tell them where to go, how often they can expect to get an update on a
20 | reported vulnerability, what to expect if the vulnerability is accepted or
21 | declined, etc.
22 | 


--------------------------------------------------------------------------------
/src/components/users/subscriptions/react/SubscriptionsViewModel.tsx:
--------------------------------------------------------------------------------
 1 | import * as React from "react";
 2 | 
 3 | 
 4 | export class SubscriptionsViewModel extends React.Component {
 5 |     constructor(props) {
 6 |         super(props);
 7 | 
 8 |         this.state = {
 9 |             isRedesignEnabled: props.isRedesignEnabled,
10 |             classNames: props.styles
11 |         };
12 |     }
13 | 
14 |     public render(): JSX.Element {
15 |         return this.state.isRedesignEnabled
16 |             ? 
17 |             : ;
18 |     }
19 | }


--------------------------------------------------------------------------------
/src/components/users/validation-summary/react/ValidationSummaryViewModel.tsx:
--------------------------------------------------------------------------------
 1 | import * as React from "react";
 2 | 
 3 | export class ValidationSummaryViewModel extends React.Component {
 4 |     constructor(props) {
 5 |         super(props);
 6 | 
 7 |         this.state = {
 8 |             isRedesignEnabled: props.isRedesignEnabled,
 9 |             classNames: props.styles,
10 |         };
11 |     }
12 | 
13 |     public render(): JSX.Element {
14 |         return this.state.isRedesignEnabled ?
15 |              :
16 |             ;
17 |     }
18 | }
19 | 


--------------------------------------------------------------------------------
/src/themes/website/styles/widgets/fui/api-details.scss:
--------------------------------------------------------------------------------
 1 | fui-api-details {
 2 |     width: 100%;
 3 | 
 4 |     .api-title {
 5 |         margin-right: 1rem;
 6 |     }
 7 | 
 8 |     .api-version-menu {
 9 |         padding: .25rem;
10 |         min-width: 50px;
11 |         align-self: center;
12 |         align-items: unset;
13 |         margin: 0 1rem 0 .5rem;
14 |     }
15 | 
16 |     .api-details-dropdowns,
17 |     .api-details-description {
18 |         margin: 1.25rem 0;
19 |     }
20 | 
21 |     .api-details-dropdown {
22 |         min-width: 190px;
23 |         margin: 0 1rem 0 .5rem;
24 |     }
25 | 
26 |     .api-additional-info,
27 |     .api-additional-info-block {
28 |         margin-top: 1rem;
29 |     }
30 | }


--------------------------------------------------------------------------------
/scaffolds/widget/ko/runtime/widget-runtime.ts:
--------------------------------------------------------------------------------
 1 | import template from "./widget-runtime.html";
 2 | import { Component, RuntimeComponent, OnMounted, OnDestroyed } from "@paperbits/common/ko/decorators";
 3 | import { widgetRuntimeSelector } from "../../constants";
 4 | 
 5 | 
 6 | @RuntimeComponent({
 7 |     selector: widgetRuntimeSelector
 8 | })
 9 | @Component({
10 |     selector: widgetRuntimeSelector,
11 |     template: template
12 | })
13 | export class WidgetRuntime {
14 |     @OnMounted()
15 |     public async initialize(): Promise {
16 |         // Your initialization logic
17 |     }
18 | 
19 |     @OnDestroyed()
20 |     public async dispose(): Promise {
21 |         // Your cleanup widget logic
22 |     }
23 | }


--------------------------------------------------------------------------------
/src/authentication/IEditorSettings.ts:
--------------------------------------------------------------------------------
 1 | 
 2 | /**
 3 |  * Service environment settings fro editor.
 4 |  */
 5 | export interface IEditorSettings {
 6 |     /**
 7 |      * ARM endpoint host. example: management.azure.com
 8 |      */
 9 |     armEndpoint: string;
10 |     
11 |     /**
12 |      * AAD ClientId. example: 4c6edb5e-d0fb-4ca1-ac29-8c181c1a9522
13 |      */
14 |     clientId: string;
15 |     
16 |     /**
17 |      * AAD authority. example: https://login.windows-ppe.net/2083f1d9-e72c-4514-b8cc-13d228bcf8a6
18 |      */
19 |     tenantId: string;
20 | 
21 |     /**
22 |      * Optional. AAD scopes. example: ["https://management.azure.com/.default"]
23 |      */
24 |     scopes?: string[];
25 | }


--------------------------------------------------------------------------------
/src/models/statusCode.ts:
--------------------------------------------------------------------------------
 1 | import { KnownStatusCodes } from "../models/knownStatusCodes";
 2 | 
 3 | export class StatusCode {
 4 |     public code: number;
 5 |     public description: string;
 6 | 
 7 |     constructor(code: number) {
 8 |         this.code = code;
 9 | 
10 |         const knownStatusCode = KnownStatusCodes.find(x => x.code.toString() === code.toString());
11 | 
12 |         if (knownStatusCode) {
13 |             this.description = knownStatusCode.description;
14 |         }
15 |     }
16 | 
17 |     public toString(): string {
18 |         if (!this.description) {
19 |             return `${this.code} User defined status code`;
20 |         }
21 |         return `${this.code} ${this.description}`;
22 |     }
23 | }


--------------------------------------------------------------------------------
/src/services/policyService.ts:
--------------------------------------------------------------------------------
 1 | import { IApiClient } from "../clients";
 2 | 
 3 | export class PolicyService {
 4 |     constructor(private readonly apiClient: IApiClient) { }
 5 | 
 6 |     public async getPolicyXmlForGlobalScope(): Promise {
 7 |         try {
 8 |             const policyXml = await this.apiClient.get(`/policies/policy?format=rawxml`, [await this.apiClient.getPortalHeader("getPolicyXmlForGlobalScope")]);
 9 |             return policyXml;
10 |         }
11 |         catch (error) {
12 |             if (error.code === "ResourceNotFound") {
13 |                 return null;
14 |             }
15 |             else {
16 |                 throw error;
17 |             }
18 |         }
19 |     }
20 | }


--------------------------------------------------------------------------------
/src/themes/website/styles/widgets/textblock.scss:
--------------------------------------------------------------------------------
 1 | [contenteditable]:focus {
 2 |     outline: none;
 3 | }
 4 | 
 5 | p:empty {
 6 |     &:before {
 7 |         content: " ";
 8 |     }
 9 | }
10 | 
11 | .ProseMirror {
12 |     display: block;
13 |     flex-basis: 100%;
14 |     max-width: 100%;
15 |     position: relative;
16 |     word-wrap: break-word;
17 |     white-space: pre-wrap;
18 |     white-space: break-spaces;
19 |     -webkit-font-variant-ligatures: none;
20 |     font-variant-ligatures: none;
21 |     font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
22 | 
23 |     pre {
24 |         white-space: pre-wrap;
25 |     }
26 | 
27 |     li {
28 |         position: relative;
29 |     }
30 | }
31 | 


--------------------------------------------------------------------------------
/src/components/products/product-apis/productApisModel.ts:
--------------------------------------------------------------------------------
 1 | import { HyperlinkModel } from "@paperbits/common/permalinks";
 2 | import { LocalStyles } from "@paperbits/common/styles";
 3 | 
 4 | /**
 5 |  * Product API list widget configuration.
 6 |  */
 7 | export class ProductApisModel {
 8 |     /**
 9 |      * List layout. "list" or "tiles"
10 |      */
11 |     public layout?: string;
12 | 
13 |     /**
14 |      * Link to a page that contains API details.
15 |      */
16 |     public detailsPageHyperlink: HyperlinkModel;
17 | 
18 |     constructor(layout?: "list" | "tiles") {
19 |         this.layout = layout;
20 |     }
21 | 
22 |     /**
23 |      * Widget local styles.
24 |      */
25 |     public styles: LocalStyles = {};
26 | }
27 | 


--------------------------------------------------------------------------------
/src/components/users/signin/react/SigninViewModel.tsx:
--------------------------------------------------------------------------------
 1 | import * as React from "react";
 2 | 
 3 | export class SigninViewModel extends React.Component {
 4 |     constructor(props) {
 5 |         super(props);
 6 | 
 7 |         this.state = {
 8 |             runtimeConfig: props.runtimeConfig,
 9 |             styles: props.styles,
10 |             isRedesignEnabled: props.isRedesignEnabled
11 |         };
12 |     }
13 | 
14 |     public render(): JSX.Element {
15 |         return this.state.isRedesignEnabled
16 |             ? 
17 |             : ;
18 |     }
19 | }


--------------------------------------------------------------------------------
/src/contracts/request.ts:
--------------------------------------------------------------------------------
 1 | import { ParameterContract } from "./parameter";
 2 | import { RepresentationContract } from "./representation";
 3 | 
 4 | /*
 5 | Model of API operation request
 6 | */
 7 | export interface RequestContract {
 8 |     /**
 9 |      * Operation request description.
10 |      */
11 |     description?: string;
12 | 
13 |     /**
14 |      * Collection of operation request query parameters.
15 |      */
16 |     queryParameters: ParameterContract[];
17 | 
18 |     /**
19 |      * Collection of operation request headers.
20 |      */
21 |     headers: ParameterContract[];
22 | 
23 |     /**
24 |      * Collection of operation request representations.
25 |      */
26 |     representations: RepresentationContract[];
27 | }
28 | 


--------------------------------------------------------------------------------
/src/contracts/searchQuery.ts:
--------------------------------------------------------------------------------
 1 | import { Tag } from "./../models/tag";
 2 | 
 3 | /**
 4 |  * Search query.
 5 |  */
 6 | export interface SearchQuery {
 7 |     /**
 8 |      * Name of the property to search.
 9 |      */
10 |     propertyName?: string;
11 | 
12 |     /**
13 |      * The value of the property to search.
14 |      */
15 |     pattern?: string;
16 | 
17 |     /**
18 |      * The tags to search for.
19 |      */
20 |     tags?: Tag[];
21 | 
22 |     /**
23 |      * Number of items to skip.
24 |      */
25 |     skip?: number;
26 | 
27 |     /**
28 |      * Number of items to return.
29 |      */
30 |     take?: number;
31 | 
32 |     /**
33 |      * Result grouping, e.g. `tag` or `none`.
34 |      */
35 |     grouping?: string;
36 | }


--------------------------------------------------------------------------------
/src/contracts/apiVersionSet.ts:
--------------------------------------------------------------------------------
 1 | export interface VersionSetContract {
 2 | 
 3 |     /**
 4 |      *  API Version Set identifier
 5 |      */
 6 |     id?: string;
 7 | 
 8 |     /**
 9 |      * API Version Set name. Must be 1 to 100 characters long.
10 |      */
11 |     name?: string;
12 | 
13 |     /**
14 |      *  API Version Set description
15 |      */
16 |     description?: string;
17 | 
18 |     /**
19 |      *  Versioning scheme
20 |      */
21 |     versioningScheme?: string;
22 | 
23 |     /**
24 |      * Version query name. Must be 1 to 100 characters long.
25 |      */
26 |     versionQueryName?: string;
27 | 
28 |     /**
29 |      * Version header name. Must be 1 to 100 characters long.
30 |      */
31 |     versionHeaderName?: string;
32 | }


--------------------------------------------------------------------------------
/src/themes/website/styles/subscriptions.scss:
--------------------------------------------------------------------------------
 1 | subscriptions-runtime {
 2 |     .table .table-head {
 3 |         @media (max-width: $breakpoint-md) {
 4 |             display: none;
 5 |         }
 6 |     }
 7 | 
 8 |     .table .table-row {
 9 |         @media (max-width: $breakpoint-md) {
10 |             display: block;
11 |         }
12 | 
13 |         > div {
14 |             @media (max-width: $breakpoint-md) {
15 |                 max-width: 100%;
16 |             }
17 | 
18 |             .columnheader {
19 |                 font-weight: bold;
20 |                 margin-bottom: 10px;
21 | 
22 |                 @media (min-width: $breakpoint-md) {
23 |                     display: none;
24 |                 }
25 |             }
26 |         }
27 |     }
28 | }


--------------------------------------------------------------------------------
/scaffolds/widget/widget.publish.module.ts:
--------------------------------------------------------------------------------
 1 | import { IInjectorModule, IInjector } from "@paperbits/common/injection";
 2 | import { WidgetViewModel } from "./ko/widgetViewModel";
 3 | import { WidgetModelBinder } from "./widgetModelBinder";
 4 | import { WidgetViewModelBinder } from "./ko/widgetViewModelBinder";
 5 | 
 6 | 
 7 | /**
 8 |  * Inversion of control module that registers publish-time dependencies.
 9 |  */
10 | export class WidgetPublishModule implements IInjectorModule {
11 |     public register(injector: IInjector): void {        
12 |         injector.bind("widget", WidgetViewModel);
13 |         injector.bindToCollection("modelBinders", WidgetModelBinder);
14 |         injector.bindToCollection("viewModelBinders", WidgetViewModelBinder);
15 |     }
16 | }


--------------------------------------------------------------------------------
/src/services/reportQuery.ts:
--------------------------------------------------------------------------------
 1 | import * as Constants from "../constants";
 2 | 
 3 | /**
 4 |  * Query object used for making queries to Analtics service.
 5 |  */
 6 | export interface ReportQuery {
 7 |     /**
 8 |      * Report start time.
 9 |      */
10 |     startTime: Date;
11 | 
12 |     /**
13 |      * Report end time.
14 |      */
15 |     endTime: Date;
16 | 
17 |     /**
18 |      * Amount of records to skip.
19 |      */
20 |     skip?: number;
21 | 
22 |     /**
23 |      * Amount of records to take.
24 |      */
25 |     take?: number;
26 | 
27 |     /**
28 |      * A field the report needs to be order by.
29 |      */
30 |     orderBy?: string;
31 | 
32 |     /**
33 |      * Order direction.
34 |      */
35 |     orderDirection?: Constants.Direction;
36 | }


--------------------------------------------------------------------------------
/src/components/custom-html/customHtmlHandlers.ts:
--------------------------------------------------------------------------------
 1 | import { IWidgetHandler } from "@paperbits/common/editing";
 2 | import { StyleHelper } from "@paperbits/styles";
 3 | import { CustomHtmlModel } from "./customHtmlModel";
 4 | import { htmlCodeInitial, htmlCodeSizeStylesInitial } from "./ko/constants";
 5 | 
 6 | export class HTMLInjectionHandlers implements IWidgetHandler {
 7 |     public async getWidgetModel(): Promise {
 8 |         const model = new CustomHtmlModel();
 9 |         model.htmlCode = htmlCodeInitial;
10 |         model.inheritStyling = true;
11 |         model.addCustomFonts = false;
12 |         StyleHelper.setPluginConfigForLocalStyles(model.styles, "size", htmlCodeSizeStylesInitial);
13 |         return model;
14 |     }
15 | }


--------------------------------------------------------------------------------
/src/themes/website/styles/widgets/popups.scss:
--------------------------------------------------------------------------------
 1 | .popup {
 2 |     display: none;
 3 | 
 4 |     &.show {
 5 |         display: block;
 6 |     }
 7 | 
 8 |     .popup-backdrop {
 9 |         position: fixed;
10 |         top: 0;
11 |         left: 0;
12 |         right: 0;
13 |         bottom: 0;
14 |         z-index: 10000;
15 |     }
16 | 
17 |     .popup-container {
18 |         z-index: 10001;
19 |         align-items: center;
20 |     }
21 | 
22 |     .popup-close {
23 |         position: absolute;
24 |         top: 5px;
25 |         right: 5px;
26 |         border: none;
27 |         background: none;
28 |         z-index: 10002;
29 |     }
30 | }
31 | 
32 | .popup-host {
33 |     display: block;
34 |     overflow: visible;
35 |     height: 0;
36 |     width: 100%;
37 | }
38 | 


--------------------------------------------------------------------------------
/src/components/reports/ko/reportsEditor.ts:
--------------------------------------------------------------------------------
 1 | import * as ko from "knockout";
 2 | import template from "./reportsEditor.html";
 3 | import { Component, OnMounted, Param, Event } from "@paperbits/common/ko/decorators";
 4 | import { ReportsModel } from "../reportsModel";
 5 | 
 6 | @Component({
 7 |     selector: "reports-editor",
 8 |     template: template
 9 | })
10 | export class ReportsEditor {
11 |     @Param()
12 |     public model: ReportsModel;
13 | 
14 |     @Event()
15 |     public onChange: (model: ReportsModel) => void;
16 | 
17 |     @OnMounted()
18 |     public async initialize(): Promise {
19 |         // TODO: Implement
20 |     }
21 | 
22 |     private applyChanges(): void {
23 |         // TODO: Implement
24 |         this.onChange(this.model);
25 |     }
26 | }


--------------------------------------------------------------------------------
/src/contracts/authenticationSettings.ts:
--------------------------------------------------------------------------------
 1 | import { AuthorizationServerForClient } from "./authorizationServer";
 2 | 
 3 | export interface BearerTokenSendingMethod {
 4 |     sendingMethodType: string;
 5 |     isChecked: boolean;
 6 | }
 7 | 
 8 | export interface OAuth2AuthenticationSettings {
 9 |     authorizationServerId?: string;
10 |     scope?: string;
11 |     authorizationServer: AuthorizationServerForClient;
12 | }
13 | 
14 | export interface OpenIdAuthenticationSettings {
15 |     openidProviderId?: string;
16 |     bearerTokenSendingMethods?: BearerTokenSendingMethod[];
17 | }
18 | 
19 | export interface AuthenticationSettings {
20 |     oAuth2AuthenticationSettings: OAuth2AuthenticationSettings[];
21 |     openidAuthenticationSettings: OpenIdAuthenticationSettings[];
22 | }


--------------------------------------------------------------------------------
/src/themes/designer/styles/scaffolding.scss:
--------------------------------------------------------------------------------
 1 | html,
 2 | body {
 3 |     width: 100%;
 4 |     height: 100%;
 5 |     padding: 0;
 6 |     margin: 0;
 7 |     overflow: hidden;
 8 | }
 9 | 
10 | * {
11 |     @include box-sizing(border-box);
12 |     // position: relative; // Leaving this commented out to show that this should not be added as it breaks some pop-ups
13 | }
14 | 
15 | *:before,
16 | *:after {
17 |     @include box-sizing(border-box);
18 | }
19 | 
20 | // Reset fonts for relevant elements
21 | input,
22 | button,
23 | select,
24 | textarea {
25 |     font-family: inherit;
26 |     font-size: inherit;
27 | }
28 | 
29 | figure {
30 |     margin: 0;
31 | }
32 | 
33 | img {
34 |     vertical-align: middle;
35 | }
36 | 
37 | [role="button"] {
38 |     cursor: pointer;
39 | }
40 | 


--------------------------------------------------------------------------------
/tests/tsconfig.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "compilerOptions": {
 3 |         "target": "es6",
 4 |         "lib": [
 5 |             "dom",
 6 |             "es2019"
 7 |         ],
 8 |         "module": "commonjs",
 9 |         "moduleResolution": "node",
10 |         "ignoreDeprecations": "5.0",
11 |         "removeComments": true,
12 |         "noLib": false,
13 |         "skipLibCheck": true,
14 |         "experimentalDecorators": true,
15 |         "emitDecoratorMetadata": true,
16 |         "allowUnreachableCode": true,
17 |         "sourceMap": true,
18 |         "incremental": false,
19 |         "resolveJsonModule": true,
20 |         "noEmit": false
21 |     },
22 |     "include": [
23 |         "../node_modules/@paperbits/common/http/*",
24 |     ]
25 | }
26 | 


--------------------------------------------------------------------------------
/src/components/tag-input/tag-input.html:
--------------------------------------------------------------------------------
 1 | 
2 | 3 |
4 | 5 | 6 | 9 |
10 | 11 | 12 |
14 | 15 |
16 |
-------------------------------------------------------------------------------- /community/widgets/document-details/documentDetails.publish.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjectorModule, IInjector } from "@paperbits/common/injection"; 2 | import { DocumentDetailsViewModel } from "./ko/documentDetailsViewModel"; 3 | import { DocumentDetailsModelBinder } from "./documentDetailsModelBinder"; 4 | import { DocumentDetailsViewModelBinder } from "./ko/documentDetailsViewModelBinder"; 5 | 6 | 7 | export class DocumentDetailsPublishModule implements IInjectorModule { 8 | public register(injector: IInjector): void { 9 | injector.bind("documentDetails", DocumentDetailsViewModel); 10 | injector.bindToCollection("modelBinders", DocumentDetailsModelBinder); 11 | injector.bindToCollection("viewModelBinders", DocumentDetailsViewModelBinder); 12 | } 13 | } -------------------------------------------------------------------------------- /src/components/users/change-password/react/ChangePasswordViewModel.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | export class ChangePasswordViewModel extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | 7 | this.state = { 8 | isRedesignEnabled: props.isRedesignEnabled, 9 | classNames: props.styles, 10 | requireHipCaptcha: props.requireHipCaptcha 11 | }; 12 | } 13 | 14 | public render(): JSX.Element { 15 | const data = JSON.stringify(this.state); 16 | 17 | return this.state.isRedesignEnabled 18 | ? 19 | : ; 20 | } 21 | } -------------------------------------------------------------------------------- /src/components/users/reset-password/react/ResetPasswordViewModel.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | export class ResetPasswordViewModel extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | 7 | this.state = { 8 | isRedesignEnabled: props.isRedesignEnabled, 9 | classNames: props.styles, 10 | requireHipCaptcha: props.requireHipCaptcha 11 | }; 12 | } 13 | 14 | public render(): JSX.Element { 15 | const data = JSON.stringify(this.state); 16 | 17 | return this.state.isRedesignEnabled 18 | ? 19 | : ; 20 | } 21 | } -------------------------------------------------------------------------------- /src/config.validate.json: -------------------------------------------------------------------------------- 1 | { 2 | "environment": "validation", 3 | "isLocalRun": false, 4 | "root": "https://.developer.azure-api.net", 5 | "managementUrl": "https://.management.azure-api.net", 6 | "accessToken": "SharedAccessSignature ...", 7 | "useArmAuth": false, 8 | "useExternalEditor": false, 9 | "isMultitenant": false, 10 | "externalEditorUrl": "", 11 | "certificate": "", 12 | "urls": { 13 | "home": "/", 14 | "signin": "/signin", 15 | "signup": "/signup", 16 | "profile": "/profile", 17 | "products": "/products", 18 | "apis": "/apis", 19 | "apiDetails": "/api-details/#api=", 20 | "confirmPassword":"/confirm-password", 21 | "changePassword":"/change-password" 22 | } 23 | } -------------------------------------------------------------------------------- /src/themes/website/styles/pagination.scss: -------------------------------------------------------------------------------- 1 | .pagination { 2 | display: flex; 3 | padding-left: 0; 4 | list-style: none; 5 | margin-top: 20px; 6 | 7 | .page-link { 8 | border: none; 9 | position: relative; 10 | display: block; 11 | padding: .5rem .5rem; 12 | line-height: 1.25; 13 | color: $default-text-color; 14 | background-color: #fff; 15 | border: 1px solid $default-text-color; 16 | margin: 2px; 17 | 18 | &:hover { 19 | text-decoration: none; 20 | } 21 | 22 | .icon { 23 | font-weight: 900; 24 | } 25 | 26 | &.active { 27 | font-weight: bold; 28 | outline: 1px solid $default-text-color; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/publisher/azure-function/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "WEBSITE_SLOT_NAME": "Production", 5 | "FUNCTIONS_EXTENSION_VERSION": "~2", 6 | "ScmType": "None", 7 | "WEBSITE_AUTH_ENABLED": "False", 8 | "WEBSITE_RUN_FROM_PACKAGE": "1", 9 | "REMOTEDEBUGGINGVERSION": "15.0.28010.00", 10 | "WEBSITE_NODE_DEFAULT_VERSION": "10.14.1", 11 | "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "DefaultEndpointsProtocol=...", 12 | "WEBSITE_CONTENTSHARE": "apim-portal-publisher-content", 13 | "WEBSITE_AUTH_AUTO_AAD": "False", 14 | "FUNCTIONS_WORKER_RUNTIME": "node", 15 | "WEBSITE_SITE_NAME": "apim-portal-publisher", 16 | "WEBSITE_AUTH_LOGOUT_PATH": "/.auth/logout", 17 | "AzureWebJobsStorage": "DefaultEndpointsProtocol=..." 18 | } 19 | } -------------------------------------------------------------------------------- /examples/widgets/conference-session/conferenceSession.publish.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjectorModule, IInjector } from "@paperbits/common/injection"; 2 | import { ConferenceSessionViewModel } from "./ko/conferenceSessionViewModel"; 3 | import { ConferenceSessionModelBinder } from "./conferenceSessionModelBinder"; 4 | import { ConferenceSessionViewModelBinder } from "./ko/conferenceSessionViewModelBinder"; 5 | 6 | 7 | export class ConferenceSessionPublishModule implements IInjectorModule { 8 | public register(injector: IInjector): void { 9 | injector.bind("conferenceSession", ConferenceSessionViewModel); 10 | injector.bindToCollection("modelBinders", ConferenceSessionModelBinder); 11 | injector.bindToCollection("viewModelBinders", ConferenceSessionViewModelBinder); 12 | } 13 | } -------------------------------------------------------------------------------- /src/components/reports/reportsModelBinder.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { IModelBinder } from "@paperbits/common/editing"; 3 | import { ReportsModel } from "./reportsModel"; 4 | import { ReportsContract } from "./reportsContract"; 5 | 6 | export class ReportsModelBinder implements IModelBinder { 7 | public async contractToModel(contract: ReportsContract): Promise { 8 | const model = new ReportsModel(); 9 | model.styles = contract.styles ?? {}; 10 | return model; 11 | } 12 | 13 | public modelToContract(model: ReportsModel): Contract { 14 | const contract: ReportsContract = { 15 | type: "reports", 16 | styles: model.styles 17 | }; 18 | return contract; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/components/utils/react/validateBasic.ts: -------------------------------------------------------------------------------- 1 | type TRule = string | { 2 | eval(value: unknown): string | false, 3 | required?: string, 4 | } 5 | 6 | export const validateBasic = (values: Record, rules: Partial>) => { 7 | const errors: string[] = []; 8 | Object.keys(rules).forEach(key => { 9 | let rule: Partial = rules[key]; 10 | if (typeof rule === "string") rule = { required: rule }; 11 | 12 | if (rule.required && (!(key in values) || (!values[key] && values[key] !== 0))) { 13 | errors.push(rule.required); 14 | } else if ("eval" in rule) { 15 | const errorMsg = rule.eval(values[key]); 16 | if (errorMsg) errors.push(errorMsg); 17 | } 18 | }); 19 | return errors; 20 | } 21 | -------------------------------------------------------------------------------- /src/components/help/helpSection.ts: -------------------------------------------------------------------------------- 1 | import { ToolButton, ViewManager, View } from "@paperbits/common/ui"; 2 | 3 | const helpText = "

Help

Get help with configuring the developer portal.

"; 4 | 5 | export class HelpSectionToolButton implements ToolButton { 6 | public readonly iconClass: string = "paperbits-icon paperbits-c-question"; 7 | public readonly title: string = "Help"; 8 | public readonly tooltip: string = helpText; 9 | 10 | constructor(private readonly viewManager: ViewManager) { } 11 | 12 | public onActivate(): void { 13 | this.viewManager.clearJourney(); 14 | 15 | const view: View = { 16 | heading: this.title, 17 | component: { name: "help-workshop" } 18 | }; 19 | 20 | this.viewManager.openViewAsWorkshop(view); 21 | } 22 | } -------------------------------------------------------------------------------- /src/components/apis/list-of-apis/listOfApisHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ListOfApisModel } from "./listOfApisModel"; 3 | 4 | export class ListOfApisHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ListOfApisModel("list"); 7 | } 8 | } 9 | 10 | export class ListOfApisTilesHandlers implements IWidgetHandler { 11 | public async getWidgetModel(): Promise { 12 | return new ListOfApisModel("tiles"); 13 | } 14 | } 15 | 16 | export class ListOfApisDropdownHandlers implements IWidgetHandler { 17 | public async getWidgetModel(): Promise { 18 | return new ListOfApisModel("dropdown"); 19 | } 20 | } -------------------------------------------------------------------------------- /src/components/custom-html/ko/constants.ts: -------------------------------------------------------------------------------- 1 | import { SizeStylePluginConfig } from "@paperbits/styles/plugins"; 2 | 3 | export const htmlCodeInitial =` 4 | 5 | 6 | 7 | 13 | 14 | 15 |
16 |

Custom HTML code example

17 |

Replace this content with custom HTML code. It will be rendered in an iframe in the developer portal.

18 | 21 |
22 | 23 | `; 24 | 25 | export const htmlCodeSizeStylesInitial: SizeStylePluginConfig = { 26 | height: "300px", 27 | width: "100%", 28 | }; -------------------------------------------------------------------------------- /src/themes/website/styles/resizables.scss: -------------------------------------------------------------------------------- 1 | .resize-handle { 2 | background: transparent; 3 | position: absolute; 4 | z-index: $z-index-base + 1; 5 | 6 | &.resize-handle-right { 7 | cursor: e-resize; 8 | width: 5px; 9 | right: 0; 10 | top: 0; 11 | bottom: 0; 12 | } 13 | 14 | &.resize-handle-left { 15 | cursor: w-resize; 16 | width: 5px; 17 | left: 0; 18 | top: 0; 19 | bottom: 0; 20 | } 21 | 22 | &.resize-handle-top { 23 | cursor: n-resize; 24 | height: 5px; 25 | left: 0; 26 | right: 0; 27 | top: 0; 28 | } 29 | 30 | &.resize-handle-bottom { 31 | cursor: s-resize; 32 | height: 5px; 33 | left: 0; 34 | right: 0; 35 | bottom: 0; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/components/apis/api-products/apiProductsHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ApiProductsModel } from "./apiProductsModel"; 3 | 4 | export class ApiProductsHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ApiProductsModel("list"); 7 | } 8 | } 9 | 10 | export class ApiProductsDropdownHandlers implements IWidgetHandler { 11 | public async getWidgetModel(): Promise { 12 | return new ApiProductsModel("dropdown"); 13 | } 14 | } 15 | 16 | export class ApiProductsTilesHandlers implements IWidgetHandler { 17 | public async getWidgetModel(): Promise { 18 | return new ApiProductsModel("tiles"); 19 | } 20 | } -------------------------------------------------------------------------------- /src/components/users/signin-social/signinSocial.runtime.module.ts: -------------------------------------------------------------------------------- 1 | import { IInjector, IInjectorModule } from "@paperbits/common/injection"; 2 | import { registerCustomElement } from "@paperbits/react/customElements"; 3 | import { SignInAadRuntime } from "./react/runtime/SignInAadRuntime"; 4 | import { SignInAadB2cRuntime } from "./react/runtime/SignInAadB2cRuntime"; 5 | 6 | export class SignInSocialRuntimeModule implements IInjectorModule { 7 | public register(injector: IInjector): void { 8 | injector.bind("SignInAadRuntimeModule", SignInAadRuntime); 9 | registerCustomElement(SignInAadRuntime, "fui-signin-aad-runtime", injector); 10 | 11 | injector.bind("SignInAadB2cRuntimeModule", SignInAadB2cRuntime); 12 | registerCustomElement(SignInAadB2cRuntime, "fui-signin-aadb2c-runtime", injector); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/components/products/product-list/productListHandlers.ts: -------------------------------------------------------------------------------- 1 | import { IWidgetHandler } from "@paperbits/common/editing"; 2 | import { ProductListModel } from "./productListModel"; 3 | 4 | export class ProductListHandlers implements IWidgetHandler { 5 | public async getWidgetModel(): Promise { 6 | return new ProductListModel("list"); 7 | } 8 | } 9 | 10 | export class ProductListDropdownHandlers implements IWidgetHandler { 11 | public async getWidgetModel(): Promise { 12 | return new ProductListModel("dropdown"); 13 | } 14 | } 15 | 16 | export class ProductListTilesHandlers implements IWidgetHandler { 17 | public async getWidgetModel(): Promise { 18 | return new ProductListModel("tiles"); 19 | } 20 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/icons/icon-api-management.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/components/users/signin/signinModelBinder.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { IModelBinder } from "@paperbits/common/editing"; 3 | import { SigninModel } from "./signinModel"; 4 | import { SigninContract } from "./signinContract"; 5 | 6 | 7 | const nodeType = "signin"; 8 | 9 | export class SigninModelBinder implements IModelBinder { 10 | public async contractToModel(contract: SigninContract): Promise { 11 | const model = new SigninModel(); 12 | model.styles = contract.styles ?? {}; 13 | 14 | return model; 15 | } 16 | 17 | public modelToContract(model: SigninModel): Contract { 18 | const contract: SigninContract = { 19 | type: nodeType, 20 | styles: model.styles 21 | }; 22 | 23 | return contract; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/models/versionSet.ts: -------------------------------------------------------------------------------- 1 | import { VersionSetContract } from "../contracts/apiVersionSet"; 2 | import { Utils } from "../utils"; 3 | 4 | export class VersionSet { 5 | public readonly id: string; 6 | public name: string; 7 | public description: string; 8 | public versioningScheme: string; 9 | public versionQueryName: string; 10 | public versionHeaderName: string; 11 | 12 | constructor(id: string, contract?: VersionSetContract) { 13 | this.id = id 14 | 15 | if (!contract) { 16 | return; 17 | } 18 | 19 | this.name = contract.name; 20 | this.description = contract.description; 21 | this.versioningScheme = contract.versioningScheme; 22 | this.versionQueryName = contract.versionQueryName; 23 | this.versionHeaderName = contract.versionHeaderName; 24 | } 25 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "lib": [ 5 | "dom", 6 | "ES2022", 7 | "webworker" 8 | ], 9 | "module": "ES2022", 10 | "moduleResolution": "node", 11 | "removeComments": true, 12 | "noLib": false, 13 | "skipLibCheck": true, 14 | "experimentalDecorators": true, 15 | "emitDecoratorMetadata": true, 16 | "allowUnreachableCode": true, 17 | "allowSyntheticDefaultImports": true, 18 | "sourceMap": true, 19 | "incremental": true, 20 | "jsx": "react", 21 | "resolveJsonModule": true 22 | }, 23 | "include": [ 24 | "./src/**/*", 25 | "./node_modules/@paperbits/**/*" 26 | ], 27 | "exclude": [ 28 | "./node_modules" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /src/components/code-editor/code-editor.ts: -------------------------------------------------------------------------------- 1 | import * as ko from "knockout"; 2 | import template from "./code-editor.html"; 3 | import { Component, Event, OnMounted, Param } from "@paperbits/common/ko/decorators"; 4 | 5 | @Component({ 6 | selector: "code-editor", 7 | template: template 8 | }) 9 | export class CodeEditor { 10 | public readonly editorContent: ko.Observable; 11 | public readonly editorLoading: ko.Observable; 12 | 13 | @Param() 14 | public code: string; 15 | 16 | @Event() 17 | public onChange: (content: string) => void; 18 | 19 | constructor() { 20 | this.editorContent = ko.observable(); 21 | this.editorLoading = ko.observable(true); 22 | } 23 | 24 | @OnMounted() 25 | public async init(): Promise { 26 | this.editorContent(this.code); 27 | } 28 | } -------------------------------------------------------------------------------- /src/components/users/profile/profileModelBinder.ts: -------------------------------------------------------------------------------- 1 | import { Contract } from "@paperbits/common"; 2 | import { IModelBinder } from "@paperbits/common/editing"; 3 | import { ProfileModel } from "./profileModel"; 4 | import { ProfileContract } from "./profileContract"; 5 | 6 | 7 | const nodeType = "profile"; 8 | 9 | export class ProfileModelBinder implements IModelBinder { 10 | public async contractToModel(contract: ProfileContract): Promise { 11 | const model = new ProfileModel(); 12 | model.styles = contract.styles ?? {}; 13 | 14 | return model; 15 | } 16 | 17 | public modelToContract(model: ProfileModel): Contract { 18 | const contract: ProfileContract = { 19 | type: nodeType, 20 | styles: model.styles 21 | }; 22 | 23 | return contract; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/contracts/resetRequest.ts: -------------------------------------------------------------------------------- 1 | import { CaptchaChallengeRequest } from "./captchaParams"; 2 | 3 | /** 4 | * Cotract of Reset password request 5 | */ 6 | export interface ResetRequest { 7 | challenge: CaptchaChallengeRequest; 8 | solution: string; 9 | token: string; 10 | type: string; 11 | flowId: string; 12 | email: string; 13 | } 14 | 15 | /** 16 | * Cotract of user change password 17 | */ 18 | export interface ChangePasswordRequest { 19 | challenge: CaptchaChallengeRequest; 20 | solution: string; 21 | token: string; 22 | type: string; 23 | flowId: string; 24 | userId: string; 25 | newPassword: string; 26 | } 27 | 28 | /** 29 | * Cotract of user reset password 30 | */ 31 | export interface ResetPassword { 32 | userid: string; 33 | ticketid: string; 34 | ticket: string; 35 | password: string; 36 | } -------------------------------------------------------------------------------- /src/themes/designer/styles/blocks.scss: -------------------------------------------------------------------------------- 1 | .add-block-container { 2 | width: 100%; 3 | max-height: 600px; 4 | .remove-block { 5 | background-color: rgb(43, 135, 218); 6 | background-repeat: no-repeat; 7 | position: absolute; 8 | top: 10px; 9 | right: 10px; 10 | .paperbits-icon { 11 | padding: 0; 12 | } 13 | } 14 | } 15 | 16 | .block-item { 17 | width: 100%; 18 | height: 120px; 19 | overflow: hidden; 20 | margin: 8px 2px 2px 2px; 21 | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); 22 | } 23 | 24 | .block-item-container { 25 | width: 1300px; 26 | height: 400px; 27 | transform: scale(0.28); 28 | transform-origin: 0% 0%; 29 | transform-origin: top left; 30 | pointer-events: none; 31 | border: none; 32 | overflow: hidden; 33 | } --------------------------------------------------------------------------------