cozy-client / models / instance
Namespace: instance¶
models.instance
Interfaces¶
Type aliases¶
ContextInfo¶
Ƭ ContextInfo<>: object
Defined in
packages/cozy-client/src/models/instance.js:10
DiskUsageInfo¶
Ƭ DiskUsageInfo<>: object
Defined in
packages/cozy-client/src/models/instance.js:11
InstanceInfo¶
Ƭ InstanceInfo<>: object
Defined in
packages/cozy-client/src/models/instance.js:9
Functions¶
arePremiumLinksEnabled¶
▸ arePremiumLinksEnabled(instanceInfo
): boolean
Parameters
Name | Type |
---|---|
instanceInfo |
any |
Returns
boolean
Defined in
packages/cozy-client/src/models/instance.js:25
buildPremiumLink¶
▸ buildPremiumLink(instanceInfo
): string
Returns the link to the Premium page on the Cozy’s Manager
Parameters
Name | Type | Description |
---|---|---|
instanceInfo |
any |
Instance information |
Returns
string
Defined in
packages/cozy-client/src/models/instance.js:70
getUuid¶
▸ getUuid(instanceInfo
): any
Parameters
Name | Type |
---|---|
instanceInfo |
any |
Returns
any
Defined in
packages/cozy-client/src/models/instance.js:32
hasAnOffer¶
▸ hasAnOffer(data
): boolean
Returns if an instance has subscribed to one of our offers
Parameters
Name | Type | Description |
---|---|---|
data |
SettingsInfo |
Object containing all the results from /settings/* |
Returns
boolean
Does the cozy have offers
Defined in
packages/cozy-client/src/models/instance.js:56
hasPasswordDefinedAttribute¶
▸ hasPasswordDefinedAttribute(client
): Promise
<boolean
>
Checks the value of the password_defined attribute
Parameters
Name | Type | Description |
---|---|---|
client |
CozyClient |
The CozyClient instance |
Returns
Promise
<boolean
>
- Returns the value of the password_defined attribute
Defined in
packages/cozy-client/src/models/instance.js:86
isFreemiumUser¶
▸ isFreemiumUser(instanceInfo
): boolean
Parameters
Name | Type |
---|---|
instanceInfo |
any |
Returns
boolean
Defined in
packages/cozy-client/src/models/instance.js:28
isSelfHosted¶
▸ isSelfHosted(instanceInfo
): boolean
property
{ContextInfo} context - Object returned by /settings/context
property
{InstanceInfo} instance - Object returned by /settings/instance
property
{DiskUsageInfo} diskUsage - Object returned by /settings/disk-usage
Parameters
Name | Type |
---|---|
instanceInfo |
any |
Returns
boolean
Defined in
packages/cozy-client/src/models/instance.js:22
makeDiskInfos¶
▸ makeDiskInfos(usage
, quota
): DiskInfos
Make human readable information from disk information (usage, quota)
Parameters
Name | Type | Description |
---|---|---|
usage |
string |
number |
quota |
string |
number |
Returns
- Return a set of human readable information about disk
Defined in
packages/cozy-client/src/models/instance.js:156
shouldDisplayOffers¶
▸ shouldDisplayOffers(data
): boolean
Returns whether an instance is concerned by our offers
Parameters
Name | Type | Description |
---|---|---|
data |
SettingsInfo |
Object containing all the results from /settings/* |
Returns
boolean
Should we display offers
Defined in