# Class Packager<L>

#### Type Parameters

- L extends Link<any>

- Defined in work/deeplinks/deeplinks/imports/packager.ts:112

#####
Index

### Constructors

constructor

### Properties

client
pckg

### Methods

deserialize
export
fetchDependenciedLinkId
fetchPackageNamespaceId
globalizeIds
import
insertItem
insertItems
selectLinks
serialize
update
validate

##
Constructors

### constructor

- new Packager<L>(client): Packager<L>

- #### Type Parameters

  - L extends Link<any>

  #### Parameters

  - client: DeepClient<L>

  #### Returns Packager<L>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:115

##
Properties

### client

client: DeepClient<any>

- Defined in work/deeplinks/deeplinks/imports/packager.ts:114

### pckg

pckg: Package

- Defined in work/deeplinks/deeplinks/imports/packager.ts:113

##
Methods

### deserialize

- deserialize(pckg, errors?): Promise<{
  counter: number;
  data: PackageItem[];
  dependedLinks: PackageItem[];
  errors?: any[];
  namespaceId: Id;
  packageId: Id;
  }>

- Deserialize pckg data to links list with local numerical ids.

  #### Parameters

  - pckg: Package
  - errors: any[] = []

  #### Returns Promise<{
  counter: number;
  data: PackageItem[];
  dependedLinks: PackageItem[];
  errors?: any[];
  namespaceId: Id;
  packageId: Id;
  }>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:490

### export

- export(options): Promise<Package>

- Export from system pckg by package link id.

  #### Parameters

  - options: PackagerExportOptions

  #### Returns Promise<Package>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:804

### fetchDependenciedLinkId

- fetchDependenciedLinkId(pckg, dependedLink): Promise<number>

- Fetch package namespace.

  #### Parameters

  - pckg: Package
  - dependedLink: PackageItem

  #### Returns Promise<number>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:146

### fetchPackageNamespaceId

- fetchPackageNamespaceId(name, deep): Promise<{
  error: any;
  namespaceId: Id;
  }>

- Fetch package namespace.

  #### Parameters

  - name: string
  - deep: DeepClient<Link<Id>>

  #### Returns Promise<{
  error: any;
  namespaceId: Id;
  }>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:122

### globalizeIds

- globalizeIds(pckg, ids, links): Promise<{
  difference: {
  [id: Id]: Id;
  };
  global: PackageItem[];
  }>

- #### Parameters

  - pckg: Package
  - ids: Id[]
  - links: PackageItem[]

  #### Returns Promise<{
  difference: {
  [id: Id]: Id;
  };
  global: PackageItem[];
  }>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:274

### import

- import(pckg): Promise<PackagerImportResult>

- Import into system pckg.

  #### Parameters

  - pckg: Package

  #### Returns Promise<PackagerImportResult>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:359

### insertItem

- insertItem(items, item, errors, mutated): Promise<void>

- #### Parameters

  - items: PackageItem[]
  - item: PackageItem
  - errors: any[]
  - mutated: PackagerMutated

  #### Returns Promise<void>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:169

### insertItems

- insertItems(pckg, data, counter, dependedLinks, errors?, mutated?): Promise<any>

- #### Parameters

  - pckg: Package
  - data: PackageItem[]
  - counter: number
  - dependedLinks: PackageItem[]
  - errors: any[] = []
  - mutated: {
    [index: number]: boolean;
    } = {}

    - ##### [index: number]: boolean

  #### Returns Promise<any>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:243

### selectLinks

- selectLinks(options): Promise<MinilinksResult<PackagerLink>>

- #### Parameters

  - options: PackagerExportOptions

  #### Returns Promise<MinilinksResult<PackagerLink>>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:419

### serialize

- serialize(globalLinks, options, pckg): Promise<Package>

- #### Parameters

  - globalLinks: MinilinksResult<PackagerLink>
  - options: PackagerExportOptions
  - pckg: Package

  #### Returns Promise<Package>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:647

### update

- update(packageId, pckg): Promise<{
  errors: any[];
  ids?: undefined;
  } | {
  errors: any[];
  ids: any[];
  }>

- #### Parameters

  - packageId: Id
  - pckg: Package

  #### Returns Promise<{
  errors: any[];
  ids?: undefined;
  } | {
  errors: any[];
  ids: any[];
  }>

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:390

### validate

- validate(pckg, errors): void

- #### Parameters

  - pckg: Package
  - errors: any[]

  #### Returns void

  - Defined in work/deeplinks/deeplinks/imports/packager.ts:313