modules inc

This commit is contained in:
nannal
2021-07-15 23:10:20 +03:00
parent 6bb353de89
commit 5921b02b7c
845 changed files with 105299 additions and 121 deletions

View File

@@ -0,0 +1,43 @@
import { AccountCache, IdTokenCache, AccessTokenCache, RefreshTokenCache, AppMetadataCache } from "@azure/msal-common";
import { JsonCache, InMemoryCache, SerializedAccountEntity, SerializedIdTokenEntity, SerializedAccessTokenEntity, SerializedRefreshTokenEntity, SerializedAppMetadataEntity } from "./SerializerTypes";
/**
* This class deserializes cache entities read from the file into in memory object types defined internally
*/
export declare class Deserializer {
/**
* Parse the JSON blob in memory and deserialize the content
* @param cachedJson
*/
static deserializeJSONBlob(jsonFile: string): JsonCache;
/**
* Deserializes accounts to AccountEntity objects
* @param accounts
*/
static deserializeAccounts(accounts: Record<string, SerializedAccountEntity>): AccountCache;
/**
* Deserializes id tokens to IdTokenEntity objects
* @param idTokens
*/
static deserializeIdTokens(idTokens: Record<string, SerializedIdTokenEntity>): IdTokenCache;
/**
* Deserializes access tokens to AccessTokenEntity objects
* @param accessTokens
*/
static deserializeAccessTokens(accessTokens: Record<string, SerializedAccessTokenEntity>): AccessTokenCache;
/**
* Deserializes refresh tokens to RefreshTokenEntity objects
* @param refreshTokens
*/
static deserializeRefreshTokens(refreshTokens: Record<string, SerializedRefreshTokenEntity>): RefreshTokenCache;
/**
* Deserializes appMetadata to AppMetaData objects
* @param appMetadata
*/
static deserializeAppMetadata(appMetadata: Record<string, SerializedAppMetadataEntity>): AppMetadataCache;
/**
* Deserialize an inMemory Cache
* @param jsonCache
*/
static deserializeAllCache(jsonCache: JsonCache): InMemoryCache;
}
//# sourceMappingURL=Deserializer.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Deserializer.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/Deserializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAwG,MAAM,oBAAoB,CAAC;AAC1O,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEvM;;GAEG;AACH,qBAAa,YAAY;IACrB;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAOvD;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,YAAY;IA0B3F;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,YAAY;IAqB3F;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,GAAG,gBAAgB;IA6B3G;;;OAGG;IACH,MAAM,CAAC,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,GAAG,iBAAiB;IAwB/G;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,GAAG,gBAAgB;IAmBzG;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa;CAmBlE"}

View File

@@ -0,0 +1,40 @@
import { AccountCache, IdTokenCache, AccessTokenCache, RefreshTokenCache, AppMetadataCache } from "@azure/msal-common";
import { InMemoryCache, JsonCache, SerializedAccountEntity, SerializedIdTokenEntity, SerializedAccessTokenEntity, SerializedRefreshTokenEntity, SerializedAppMetadataEntity } from "./SerializerTypes";
export declare class Serializer {
/**
* serialize the JSON blob
* @param data
*/
static serializeJSONBlob(data: JsonCache): string;
/**
* Serialize Accounts
* @param accCache
*/
static serializeAccounts(accCache: AccountCache): Record<string, SerializedAccountEntity>;
/**
* Serialize IdTokens
* @param idTCache
*/
static serializeIdTokens(idTCache: IdTokenCache): Record<string, SerializedIdTokenEntity>;
/**
* Serializes AccessTokens
* @param atCache
*/
static serializeAccessTokens(atCache: AccessTokenCache): Record<string, SerializedAccessTokenEntity>;
/**
* Serialize refreshTokens
* @param rtCache
*/
static serializeRefreshTokens(rtCache: RefreshTokenCache): Record<string, SerializedRefreshTokenEntity>;
/**
* Serialize amdtCache
* @param amdtCache
*/
static serializeAppMetadata(amdtCache: AppMetadataCache): Record<string, SerializedAppMetadataEntity>;
/**
* Serialize the cache
* @param jsonContent
*/
static serializeAllCache(inMemCache: InMemoryCache): JsonCache;
}
//# sourceMappingURL=Serializer.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Serializer.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/Serializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEvM,qBAAa,UAAU;IACnB;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAIjD;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;IAqBzF;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;IAiBzF;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAwBpG;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAmBvG;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAcrG;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,GAAG,SAAS;CASjE"}

View File

@@ -0,0 +1,99 @@
import { AccountCache, IdTokenCache, AccessTokenCache, RefreshTokenCache, AppMetadataCache, ValidCacheType } from "@azure/msal-common";
/**
* Key value store for in-memory cache
* @public
*/
export declare type CacheKVStore = Record<string, ValidCacheType>;
/**
* Cache format read from the cache blob provided to the configuration during app instantiation
* @public
*/
export declare type JsonCache = {
Account: Record<string, SerializedAccountEntity>;
IdToken: Record<string, SerializedIdTokenEntity>;
AccessToken: Record<string, SerializedAccessTokenEntity>;
RefreshToken: Record<string, SerializedRefreshTokenEntity>;
AppMetadata: Record<string, SerializedAppMetadataEntity>;
};
/**
* Intermittent type to handle in-memory data objects with defined types
* @public
*/
export declare type InMemoryCache = {
accounts: AccountCache;
idTokens: IdTokenCache;
accessTokens: AccessTokenCache;
refreshTokens: RefreshTokenCache;
appMetadata: AppMetadataCache;
};
/**
* Account type
* @public
*/
export declare type SerializedAccountEntity = {
home_account_id: string;
environment: string;
realm: string;
local_account_id: string;
username: string;
authority_type: string;
name?: string;
client_info?: string;
last_modification_time?: string;
last_modification_app?: string;
};
/**
* Idtoken credential type
* @public
*/
export declare type SerializedIdTokenEntity = {
home_account_id: string;
environment: string;
credential_type: string;
client_id: string;
secret: string;
realm: string;
};
/**
* Access token credential type
* @public
*/
export declare type SerializedAccessTokenEntity = {
home_account_id: string;
environment: string;
credential_type: string;
client_id: string;
secret: string;
realm: string;
target: string;
cached_at: string;
expires_on: string;
extended_expires_on?: string;
refresh_on?: string;
key_id?: string;
token_type?: string;
};
/**
* Refresh token credential type
* @public
*/
export declare type SerializedRefreshTokenEntity = {
home_account_id: string;
environment: string;
credential_type: string;
client_id: string;
secret: string;
family_id?: string;
target?: string;
realm?: string;
};
/**
* AppMetadata type
* @public
*/
export declare type SerializedAppMetadataEntity = {
client_id: string;
environment: string;
family_id?: string;
};
//# sourceMappingURL=SerializerTypes.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SerializerTypes.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/SerializerTypes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvI;;;GAGG;AACH,oBAAY,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE1D;;;GAGG;AACH,oBAAY,SAAS,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IACjD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IACzD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;CAC5D,CAAC;AAEF;;;GAGG;AACH,oBAAY,aAAa,GAAG;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,aAAa,EAAE,iBAAiB,CAAC;IACjC,WAAW,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;GAGG;AACH,oBAAY,uBAAuB,GAAG;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CA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