0.2.7 • Published 1 year ago

msda-storage v0.2.7

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

MsdaStorage

install

npm i msda-storage --save

Storage Overview

  • session-token
  • clientId (*only for public project)
  • lang
  • i18n (translations)

Add to project

import { MsdaStorageModule, MsdaStorage } from 'msda-storage';

function initApp( storage: MsdaStorage) {
  return async () => {
    
    storage.setConfig({
      apiPrefix: '/auth' //default '/api
    });

    /**
     * @param{appKeyWords}  იმ აპლიკაციების keyword-ები რომლის translate-ებსაც იყენებს აპლიკაცია
     */
    const appKeyWords = ['USER_MANAGEMENT'];
    await storage.loadTranslations(appKeyWords);
    return;
  };
}

@NgModule({
  declarations: [
   ...
  ],
  imports: [
    ...
    MsdaStorageModule
  ],
  providers: [
    ...
    {
      provide: APP_INITIALIZER,
      useFactory: initApp,
      multi: true,
      deps: [MsdaStorage],
    }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

Usage of Storage

ClientId - note: only in public projects

    this._storage.setClientId(41, setSessionClient) //set setSessionClient = true | false , default = false
    this._storage.clientId //get

Lang

    this._storage.setLang('en') //set
    MsdaStorage.lang //get

SessionToken

    this._storage.setToken('tokenString') //set
    MsdaStorage.token //get

Custom Items

    this._storage.setItem('someKey', "someItem"); //set
    this._storage.getItem('someKey'); //get

Translations

    this._storage.translations; //get

AppVersions

    this._storage.setAppVersion(MsdaAppVersions); //set
    this._storage.appVersions; //get
    
    //set example
    this._storage.setAppVersion({
        "sso": {
            "build":4,
            "version":"0.0.1"
        }
    });
0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.8-beta.1

2 years ago

0.1.8-beta

2 years ago

0.1.8

2 years ago

0.1.7-test-3

2 years ago

0.1.7-test-2

2 years ago

0.1.7-test-1

2 years ago

0.1.7-test

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago