How to use @ordercloud/angular-sdk - 6 common examples

To help you get started, we’ve selected a few @ordercloud/angular-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ordercloud-api / ngx-shopper / src / UI / Seller / src / app / app.module.ts View on Github external
import { CacheInterceptor } from '@app-seller/auth/interceptors/cache/cache-interceptor';

@NgModule({
  declarations: [AppComponent],
  imports: [
    // This app
    AppRoutingModule,
    AuthModule,

    // Third party
    BrowserAnimationsModule,
    BrowserModule,
    LayoutModule,
    NgProgressModule.forRoot(),
    NgProgressHttpModule,
    OrderCloudModule.forRoot(OcSDKConfig),
    CookieModule.forRoot(),
    ToastrModule.forRoot(),
    SharedModule.forRoot(),
  ],
  providers: [
    {
      provide: applicationConfiguration,
      useValue: ocAppConfig,
    },
    {
      provide: HTTP_INTERCEPTORS,
      useClass: AutoAppendTokenInterceptor,
      multi: true,
    },
    {
      provide: HTTP_INTERCEPTORS,
github ordercloud-api / ngx-shopper / src / UI / Buyer / src / app / app.module.ts View on Github external
// app modules
    AppRoutingModule,
    AuthModule,
    LayoutModule,

    /**
     * third party modules
     * only those that must be installed
     * with forRoot (except shared) should be defined here, all else
     * can live in shared
     */
    SharedModule,
    CookieModule.forRoot(),
    NgProgressModule,
    NgProgressHttpModule,
    OrderCloudModule.forRoot(OcSDKConfig),
    ToastrModule.forRoot(),
    NgxImageZoomModule.forRoot(),
  ],
  providers: [
    {
      provide: HTTP_INTERCEPTORS,
      useClass: AutoAppendTokenInterceptor,
      multi: true,
    },
    {
      provide: HTTP_INTERCEPTORS,
      useClass: RefreshTokenInterceptor,
      multi: true,
    },
    {
      provide: HTTP_INTERCEPTORS,
github ordercloud-api / ngx-shopper / src / UI / Buyer / src / app / config / ordercloud-sdk.config.ts View on Github external
export function OcSDKConfig() {
  const apiurl = 'https://api.ordercloud.io';
  const apiVersion = 'v1';
  const authUrl = 'https://auth.ordercloud.io/oauth/token';

  return new Configuration({
    basePath: `${apiurl}/${apiVersion}`,
    authPath: authUrl,
    cookiePrefix: ocAppConfig.appname.replace(/ /g, '_').toLowerCase(),
  });
}
github ordercloud-api / ngx-shopper / src / UI / Seller / src / app / auth / services / app-auth.service.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        HttpClientTestingModule,
        CookieModule.forRoot(),
      ],
      providers: [
        { provide: Router, useValue: router },
        { provide: CookieService, useValue: cookieService },
        OcAuthService,
        AppAuthService,
        { provide: AppErrorHandler, useValue: appErrorHandler },
        OcTokenService,
        { provide: Configuration, useValue: new Configuration() },
        { provide: applicationConfiguration, useValue: appConfig },
        { provide: AppStateService, useValue: appStateService },
      ],
    });
    appConfig = TestBed.get(applicationConfiguration);
    tokenService = TestBed.get(OcTokenService);
    appAuthService = TestBed.get(AppAuthService);
    authService = TestBed.get(OcAuthService);
  });
github ordercloud-api / ngx-shopper / src / UI / Buyer / src / app / auth / services / app-auth.service.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        HttpClientTestingModule,
        CookieModule.forRoot(),
      ],
      providers: [
        { provide: Router, useValue: router },
        { provide: CookieService, useValue: cookieService },
        OcAuthService,
        AppAuthService,
        { provide: AppErrorHandler, useValue: appErrorHandler },
        OcTokenService,
        { provide: Configuration, useValue: new Configuration() },
        { provide: applicationConfiguration, useValue: appConfig },
        { provide: AppStateService, useValue: appStateService },
        { provide: BaseResolveService, useValue: baseResolveService },
      ],
    });
    appConfig = TestBed.get(applicationConfiguration);
    tokenService = TestBed.get(OcTokenService);
    appAuthService = TestBed.get(AppAuthService);
    authService = TestBed.get(OcAuthService);
  });
github ordercloud-api / ngx-shopper / src / UI / Buyer / src / app / shared / services / base-resolve / base-resolve.service.spec.ts View on Github external
beforeEach(async(() => {
    const authService = { isUserAnon: jasmine.createSpy('isUserAnon') };
    const appConfig = { appname: 'mgr-dev' };
    TestBed.configureTestingModule({
      imports: [RouterTestingModule, CookieModule.forRoot()],
      providers: [
        { provide: OcAuthService, useValue: authService },
        HttpClient,
        HttpHandler,
        { provide: Configuration, useValue: new Configuration() },
        { provide: applicationConfiguration, useValue: appConfig },
      ],
    });
    service = TestBed.get(BaseResolveService);
  }));

@ordercloud/angular-sdk

angular 6.0.0+ typescript sdk for building on top of the ordercloud platform

MIT
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis