- Source:
Methods for applications.
Methods
(static) dpDeployAllByAppKey(externalKey) → {Promise.<{status: 200, statusText: 'OK', message: string}>}
- Source:
- Since:
- 1.0.0
Deploys all DataPages in an application where the application is specified by its ID (i.e., externalKey
).
Example
// deploy all DataPages in the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpDeployAll() {
const APP_ID = '09d18152-7c45-44f1-a0e6-5ffe18881b60';
const deployResult = await caspio.apps.dpDeployAllByAppKey(APP_ID);
console.log(deployResult);
return deployResult;
}
dpDeployAll();
// sample return value
{
status: 200,
statusText: 'OK',
message: 'All DataPages in the specified application have been successfully deployed.'
}
Parameters:
Name | Type | Description |
---|---|---|
externalKey |
string | Application ID |
Returns:
Object with information about the attempted deployment of all DataPages in the specified application (i.e., status
, statusText
, and message
).
- Type
- Promise.<{status: 200, statusText: 'OK', message: string}>
(static) dpDeployAllByAppName(appName) → {Promise.<{status: 200, statusText: 'OK', message: string}>}
- Source:
- Since:
- 1.0.0
Deploys all DataPages in an application where the application is specified by its case-insensitive name (i.e., appName
).
Example
// deploy all DataPages in the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpDeployAll() {
const APP_NAME = 'Demo - Physician Directory - Caspio SDK';
const deployResult = await caspio.apps.dpDeployAllByAppName(APP_NAME);
console.log(deployResult);
return deployResult;
}
dpDeployAll();
// sample return value
{
status: 200,
statusText: 'OK',
message: "All DataPages in application 'Demo - Physician Directory - Caspio SDK' have been successfully deployed."
}
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Name of the application (case-insensitive) |
Returns:
Object with information about the attempted deployment of all DataPages in the specified application (i.e., status
, statusText
, and message
).
- Type
- Promise.<{status: 200, statusText: 'OK', message: string}>
(static) dpDeployByKeys(externalKey, appKey) → {Promise.<{status: 200, statusText: 'OK', message: string}>}
- Source:
- Since:
- 1.0.0
Deploy a DataPage by specifying the ID of the application to which the DataPage is linked (i.e., externalKey
) as well as specifying the ID of the DataPage itself (i.e., appKey
).
Example
// deploy the 'Physician Registration' DataPage which is part of the
// 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpDeploy() {
const APP_ID = '09d18152-7c45-44f1-a0e6-5ffe18881b60';
const DP_ID = '409550008f83dc4dd4554a07b7bf';
const deployResult = await caspio.apps.dpDeployByKeys(APP_ID, DP_ID);
console.log(deployResult);
return deployResult;
}
dpDeploy();
// sample return value
{
status: 200,
statusText: 'OK',
message: 'DataPage successfully deployed.'
}
Parameters:
Name | Type | Description |
---|---|---|
externalKey |
string | Application ID |
appKey |
string | DataPage ID |
Returns:
Object with information about the attempted deployment (i.e., status
, statusText
, and message
).
- Type
- Promise.<{status: 200, statusText: 'OK', message: string}>
(static) dpDeployByNames(appName, dataPageName) → {Promise.<{status: 200, statusText: 'OK', message: string}>}
- Source:
- Since:
- 1.0.0
Deploy a DataPage by specifying the name of the application to which the DataPage is linked (i.e., appName
) as well as specifying the name of the DataPage itself (i.e., dataPageName
).
Example
// deploy the 'Physician Registration' DataPage which is part of the
// 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpDeploy() {
const APP_NAME = 'Demo - Physician Directory - Caspio SDK';
const DP_NAME = 'Physician Registration';
const deployResult = await caspio.apps.dpDeployByNames(APP_NAME, DP_NAME);
console.log(deployResult);
return deployResult;
}
dpDeploy();
// sample return value
{
status: 200,
statusText: 'OK',
message: "DataPage 'Physician Registration' has been successfully deployed."
}
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Name of the application (case-insensitive) |
dataPageName |
string | Name of the DataPage (case-insensitive) |
Returns:
Object with information about the attempted deployment (i.e., status
, statusText
, and message
).
- Type
- Promise.<{status: 200, statusText: 'OK', message: string}>
(static) dpDeployCodeByKeys(externalKey, appKey, deployMethod) → {Promise.<string>}
- Source:
- Since:
- 1.0.0
- See:
-
Read the Caspio documentation on SEO deployment directions for more details.
Returns deploy code (string) for a DataPage given an application's ID (i.e., externalKey
), DataPage ID (i.e., appKey
), and deploy method (i.e., deployMethod
), where the deployMethod
is case-insensitive.
Example
// get the URL deploy code of the 'Physician Registration' DataPage
// which lives in the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpGetDeployCode() {
const APP_ID = '09d18152-7c45-44f1-a0e6-5ffe18881b60';
const DP_ID = '409550008f83dc4dd4554a07b7bf';
const dpDeployCode = await caspio.apps.dpDeployCodeByKeys(APP_ID, DP_ID, 'U');
console.log(dpDeployCode);
return dpDeployCode;
}
dpGetDeployCode();
// sample return value
'https://ab1de2fg3.caspio.com/dp/409550008f83dc4dd4554a07b7bf'
Parameters:
Name | Type | Description |
---|---|---|
externalKey |
string | Application ID |
appKey |
string | DataPage ID |
deployMethod |
'I' | 'F' | 'U' | 'L' | 'E' | 'N' | 'P' | 'A' | 'X' | 'B' | 'Y' | 'Z' | Deploy method (case-insensitive). Valid deploy methods: Note: Deploy methods |
Returns:
String representing the deploy code for the specified DataPage for the specified application
- Type
- Promise.<string>
(static) dpDeployCodeByNames(appName, dataPageName, deployMethod) → {Promise.<string>}
- Source:
- Since:
- 1.0.0
- See:
-
Read the Caspio documentation on SEO deployment directions for more details.
Returns deploy code (string) for a DataPage given an application name (i.e., appName
), DataPage name (i.e., dataPageName
), and deploy method (i.e., deployMethod
), where all parameters are case-insensitive.
Example
// get the URL deploy code of the 'Physician Registration' DataPage
// which lives in the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpGetDeployCode() {
const APP_NAME = 'Demo - Physician Directory - Caspio SDK';
const DP_NAME = 'Physician Registration';
const dpDeployCode = await caspio.apps.dpDeployCodeByNames(APP_NAME, DP_NAME, 'U');
console.log(dpDeployCode);
return dpDeployCode;
}
dpGetDeployCode();
// sample return value
'https://ab1de2fg3.caspio.com/dp/409550008f83dc4dd4554a07b7bf'
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Name of the application (case-insensitive) |
dataPageName |
string | Name of the DataPage (case-insensitive) |
deployMethod |
'I' | 'F' | 'U' | 'L' | 'E' | 'N' | 'P' | 'A' | 'X' | 'B' | 'Y' | 'Z' | Deploy method (case-insensitive). Valid deploy methods: Note: Deploy methods |
Returns:
String representing the deploy code for the specified DataPage for the specified application
- Type
- Promise.<string>
(static) dpDisableAllByAppKey(externalKey) → {Promise.<{status: 200, statusText: 'OK', message: string}>}
- Source:
- Since:
- 1.0.0
Disables all DataPages in an application where the application is specified by its ID (i.e., externalKey
).
Example
// disable all DataPages in the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpDisableAll() {
const APP_ID = '09d18152-7c45-44f1-a0e6-5ffe18881b60';
const disableResult = await caspio.apps.dpDisableAllByAppKey(APP_ID);
console.log(disableResult);
return disableResult;
}
dpDisableAll();
// sample return value
{
status: 200,
statusText: 'OK',
message: 'All DataPages in the specified application have been successfully disabled.'
}
Parameters:
Name | Type | Description |
---|---|---|
externalKey |
string | Application ID |
Returns:
Object with information about the attempted disabling of all DataPages in the specified application (i.e., status
, statusText
, and message
).
- Type
- Promise.<{status: 200, statusText: 'OK', message: string}>
(static) dpDisableAllByAppName(appName) → {Promise.<{status: 200, statusText: 'OK', message: string}>}
- Source:
- Since:
- 1.0.0
Disables all DataPages in an application where the application is specified by its case-insensitive name (i.e., appName
).
Example
// disable all DataPages in the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpDisableAll() {
const APP_NAME = 'Demo - Physician Directory - Caspio SDK';
const disableResult = await caspio.apps.dpDisableAllByAppName(APP_NAME);
console.log(disableResult);
return disableResult;
}
dpDisableAll();
// sample return value
{
status: 200,
statusText: 'OK',
message: "All DataPages in application 'Demo - Physician Directory - Caspio SDK' have been successfully disabled."
}
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Name of the application (case-insensitive) |
Returns:
Object with information about the attempted disabling of all DataPages in the specified application (i.e., status
, statusText
, and message
).
- Type
- Promise.<{status: 200, statusText: 'OK', message: string}>
(static) dpDisableByKeys(externalKey, appKey) → {Promise.<{status: 200, statusText: 'OK', message: string}>}
- Source:
- Since:
- 1.0.0
Disable a DataPage by specifying the ID of the application to which the DataPage is linked (i.e., externalKey
) as well as specifying the ID of the DataPage itself (i.e., appKey
).
Example
// disable the 'Physician Registration' DataPage which is part of the
// 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpDeploy() {
const APP_ID = '09d18152-7c45-44f1-a0e6-5ffe18881b60';
const DP_ID = '409550008f83dc4dd4554a07b7bf';
const deployResult = await caspio.apps.dpDeployByKeys(APP_ID, DP_ID);
console.log(deployResult);
return deployResult;
}
dpDeploy();
// sample return value
{
status: 200,
statusText: 'OK',
message: 'DataPage successfully disabled.'
}
Parameters:
Name | Type | Description |
---|---|---|
externalKey |
string | Application ID |
appKey |
string | DataPage ID |
Returns:
Object with information about the disable attempt (i.e., status
, statusText
, and message
).
- Type
- Promise.<{status: 200, statusText: 'OK', message: string}>
(static) dpDisableByNames(appName, dataPageName) → {Promise.<{status: 200, statusText: 'OK', message: string}>}
- Source:
- Since:
- 1.0.0
Disable a DataPage by specifying the name of the application to which the DataPage is linked (i.e., appName
) as well as specifying the name of the DataPage itself (i.e., dataPageName
).
Example
// disable the 'Physician Registration' DataPage which is part of the
// 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpDisable() {
const APP_NAME = 'Demo - Physician Directory - Caspio SDK';
const DP_NAME = 'Physician Registration';
const disableResult = await caspio.apps.dpDisableByNames(APP_NAME, DP_NAME);
console.log(disableResult);
return disableResult;
}
dpDisable();
// sample return value
{
status: 200,
statusText: 'OK',
message: "DataPage 'Physician Registration' has been successfully disabled."
}
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Name of the application (case-insensitive) |
dataPageName |
string | Name of the DataPage (case-insensitive) |
Returns:
Object with information about the disable attempt (i.e., status
, statusText
, and message
).
- Type
- Promise.<{status: 200, statusText: 'OK', message: string}>
(static) dpPropertiesByAppKey(externalKey) → {Promise.<Array.<{Name: string, AppKey: string, AppName: string, Path: string, Type: string, DateCreated: string, DateModified: string, CreatedBy: string, ModifiedBy: string, Note: string}>>}
- Source:
- Since:
- 1.0.0
Returns a list of DataPage properties for DataPages associated with an application (i.e., an array of objects where the objects represent an application's DataPages and their properties--the application is identified by its App ID, externalKey
).
Example
// get all DataPage properties linked to the 'Demo - Physician Directory - Caspio SDK' application
// whose App ID is '09d18152-7c45-44f1-a0e6-5ffe18881b60'
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpPropertiesForApp() {
const APP_KEY = '09d18152-7c45-44f1-a0e6-5ffe18881b60';
const dpProperties = await caspio.apps.dpPropertiesByAppKey(APP_KEY);
console.log(dpProperties);
return dpProperties;
}
dpPropertiesForApp();
// sample return value
[
...,
{
Name: 'Physician Registration',
AppKey: '409550008f83dc4dd4554a07b7bf',
AppName: 'Demo - Physician Directory - Caspio SDK',
Path: '/Public Interfaces',
Type: 'WEBFORM',
DateCreated: '2022-01-25T15:20:43.787',
DateModified: '2022-01-25T15:20:43.837',
CreatedBy: 'user@user.com',
ModifiedBy: '',
Note: ''
},
...
]
Parameters:
Name | Type | Description |
---|---|---|
externalKey |
string | Application ID |
Returns:
Array of DataPages and their properties linked to a specific application
- Type
- Promise.<Array.<{Name: string, AppKey: string, AppName: string, Path: string, Type: string, DateCreated: string, DateModified: string, CreatedBy: string, ModifiedBy: string, Note: string}>>
(static) dpPropertiesByAppName(appName) → {Promise.<Array.<{Name: string, AppKey: string, AppName: string, Path: string, Type: string, DateCreated: string, DateModified: string, CreatedBy: string, ModifiedBy: string, Note: string}>>}
- Source:
- Since:
- 1.0.0
Returns a list of DataPage properties for DataPages associated with an application (i.e., an array of objects where the objects represent an application's DataPages and their properties--the application is identified by its case-insensitive name, appName
).
Example
// get all DataPage properties linked to the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpPropertiesForApp() {
const APP_NAME = 'Demo - Physician Directory - Caspio SDK';
const dpProperties = await caspio.apps.dpPropertiesByAppName(APP_NAME);
console.log(dpProperties);
return dpProperties;
}
dpPropertiesForApp();
// sample return value
[
...,
{
Name: 'Physician Registration',
AppKey: '409550008f83dc4dd4554a07b7bf',
AppName: 'Demo - Physician Directory - Caspio SDK',
Path: '/Public Interfaces',
Type: 'WEBFORM',
DateCreated: '2022-01-25T15:20:43.787',
DateModified: '2022-01-25T15:20:43.837',
CreatedBy: 'user@user.com',
ModifiedBy: '',
Note: ''
},
...
]
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Name of the application (case-insensitive) |
Returns:
Array of DataPages and their properties linked to a specific application
- Type
- Promise.<Array.<{Name: string, AppKey: string, AppName: string, Path: string, Type: string, DateCreated: string, DateModified: string, CreatedBy: string, ModifiedBy: string, Note: string}>>
(static) dpPropertiesByKeys(externalKey, appKey) → {Promise.<{Name: string, AppKey: string, AppName: string, Path: string, Type: string, DateCreated: string, DateModified: string, CreatedBy: string, ModifiedBy: string, Note: string}>}
- Source:
- Since:
- 1.0.0
Returns the DataPage's properties (object) for the specified DataPage (i.e., appKey
) linked to the specified application (i.e., externalKey
).
Example
// get properties of the 'Physician Registration' DataPage which is a DataPage in
// the 'Demo - Physician Directory - Caspio SDK' application
// 'Physician Registration' DataPage key: '409550008f83dc4dd4554a07b7bf'
// 'Demo - Physician Directory - Caspio SDK' application key: '09d18152-7c45-44f1-a0e6-5ffe18881b60'
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpGetProperties() {
const APP_ID = '09d18152-7c45-44f1-a0e6-5ffe18881b60';
const DP_ID = '409550008f83dc4dd4554a07b7bf';
const dpProperties = await caspio.apps.dpPropertiesByKeys(APP_ID, DP_ID);
console.log(dpProperties);
return dpProperties;
}
dpGetProperties();
// sample return value
{
Name: 'Physician Registration',
AppKey: '409550008f83dc4dd4554a07b7bf',
AppName: 'Demo - Physician Directory - Caspio SDK',
Path: '/Public Interfaces',
Type: 'WEBFORM',
DateCreated: '2022-01-25T15:20:43.787',
DateModified: '2022-01-25T15:20:43.837',
CreatedBy: 'user@user.com',
ModifiedBy: '',
Note: ''
}
Parameters:
Name | Type | Description |
---|---|---|
externalKey |
string | Application ID |
appKey |
string | DataPage ID |
Returns:
Object representing the properties of the specified DataPage for the specified application
- Type
- Promise.<{Name: string, AppKey: string, AppName: string, Path: string, Type: string, DateCreated: string, DateModified: string, CreatedBy: string, ModifiedBy: string, Note: string}>
(static) dpPropertiesByNames(appName, dataPageName) → {Promise.<{Name: string, AppKey: string, AppName: string, Path: string, Type: string, DateCreated: string, DateModified: string, CreatedBy: string, ModifiedBy: string, Note: string}>}
- Source:
- Since:
- 1.0.0
Returns the DataPage's properties (object) for the specified DataPage (i.e., dataPageName
) linked to the specified application (i.e., appName
), where both specifications are case-insensitive.
Example
// get properties of the 'Physician Registration' DataPage which is a DataPage in
// the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function dpGetProperties() {
const APP_NAME = 'Demo - Physician Directory - Caspio SDK';
const DP_NAME = 'Physician Registration';
const dpProperties = await caspio.apps.dpPropertiesByNames(APP_NAME, DP_NAME);
console.log(dpProperties);
return dpProperties;
}
dpGetProperties();
// sample return value
{
Name: 'Physician Registration',
AppKey: '409550008f83dc4dd4554a07b7bf',
AppName: 'Demo - Physician Directory - Caspio SDK',
Path: '/Public Interfaces',
Type: 'WEBFORM',
DateCreated: '2022-01-25T15:20:43.787',
DateModified: '2022-01-25T15:20:43.837',
CreatedBy: 'user@user.com',
ModifiedBy: '',
Note: ''
}
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Name of the application (case-insensitive) |
dataPageName |
string | Name of the DataPage (case-insensitive) |
Returns:
Object representing the properties of the specified DataPage for the specified application
- Type
- Promise.<{Name: string, AppKey: string, AppName: string, Path: string, Type: string, DateCreated: string, DateModified: string, CreatedBy: string, ModifiedBy: string, Note: string}>
(static) listing() → {Promise.<Array.<{AppName: string, ExternalKey: string, DataPagesCount: number, DateCreated: string, DateModified: string, DefaultIcon: boolean, IconFileName: string}>>}
- Source:
- Since:
- 1.0.0
Returns list of applications (i.e., an array of objects where each object represents an application and its properties).
Example
// get list of all Caspio applications linked to a Caspio account
const caspio = require('caspio-sdk')(caspioCredentials);
async function getAllAppProperties() {
const propertiesForAllApps = await caspio.apps.listing();
console.log(propertiesForAllApps);
return propertiesForAllApps;
}
getAllAppProperties();
// sample return value
[
...,
{
AppName: 'Demo - Physician Directory - Caspio SDK',
ExternalKey: '09d18152-7c45-44f1-a0e6-5ffe18881b60',
DataPagesCount: 5,
DateCreated: '2022-01-25T15:17:10.607',
DateModified: '2022-01-25T15:20:44.850',
DefaultIcon: true,
IconFileName: ''
},
...
]
Returns:
Array of Caspio applications with each application's properties
- Type
- Promise.<Array.<{AppName: string, ExternalKey: string, DataPagesCount: number, DateCreated: string, DateModified: string, DefaultIcon: boolean, IconFileName: string}>>
(static) propertiesByKey(externalKey) → {Promise.<{AppName: string, ExternalKey: string, DataPagesCount: number, DateCreated: string, DateModified: string, DefaultIcon: boolean, IconFileName: string}>}
- Source:
- Since:
- 1.0.0
Returns the application's properties (i.e., an object that represents an application's properties given the application's ID, externalKey
).
Example
// get properties of the 'Demo - Physician Directory - Caspio SDK' application
// whose application ID is '09d18152-7c45-44f1-a0e6-5ffe18881b60'
const caspio = require('caspio-sdk')(caspioCredentials);
async function getAppProperties() {
const APP_KEY = '09d18152-7c45-44f1-a0e6-5ffe18881b60';
const appProperties = await caspio.apps.propertiesByKey(APP_KEY);
console.log(appProperties);
return appProperties;
}
getAppProperties();
// sample return value
{
AppName: 'Demo - Physician Directory - Caspio SDK',
ExternalKey: '09d18152-7c45-44f1-a0e6-5ffe18881b60',
DataPagesCount: 5,
DateCreated: '2022-01-25T15:17:10.607',
DateModified: '2022-01-25T15:20:44.850',
DefaultIcon: true,
IconFileName: ''
}
Parameters:
Name | Type | Description |
---|---|---|
externalKey |
string | Application ID |
Returns:
Object representing a Caspio application and its properties
- Type
- Promise.<{AppName: string, ExternalKey: string, DataPagesCount: number, DateCreated: string, DateModified: string, DefaultIcon: boolean, IconFileName: string}>
(static) propertiesByName(appName) → {Promise.<{AppName: string, ExternalKey: string, DataPagesCount: number, DateCreated: string, DateModified: string, DefaultIcon: boolean, IconFileName: string}>}
- Source:
- Since:
- 1.0.0
Returns the application's properties (i.e., an object that represents an application's properties given the application's case-insensitive name, appName
).
Example
// get properties of the 'Demo - Physician Directory - Caspio SDK' application
const caspio = require('caspio-sdk')(caspioCredentials);
async function getAppProperties() {
const APP_NAME = 'Demo - Physician Directory - Caspio SDK';
const appProperties = await caspio.apps.propertiesByName(APP_NAME);
console.log(appProperties);
return appProperties;
}
getAppProperties();
// sample return value
{
AppName: 'Demo - Physician Directory - Caspio SDK',
ExternalKey: '09d18152-7c45-44f1-a0e6-5ffe18881b60',
DataPagesCount: 5,
DateCreated: '2022-01-25T15:17:10.607',
DateModified: '2022-01-25T15:20:44.850',
DefaultIcon: true,
IconFileName: ''
}
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Name of the application (case-insensitive) |
Returns:
Object representing a Caspio application and its properties
- Type
- Promise.<{AppName: string, ExternalKey: string, DataPagesCount: number, DateCreated: string, DateModified: string, DefaultIcon: boolean, IconFileName: string}>