@plasma-platform/service-uploads v2.3.10
Full documentation
install:npm i @plasma-platform/service-uploads -S
Short documentation
Table of Contents
- ServiceUploads
- getHeaders
- getDocuments
- getDocument
- getFeatures
- getLicenses
- getTools
- getTopics
- getTypes
- getType
- getAuthorTemplates
- getAuthorTemplateInfo
- getAuthorTemplateUploadLink
- getAuthorScreenshotUploadLink
- createNewTemplate
- updateTemplateInfo
- validateUploadFields
- getBulkUploadErrorsById
- getSampleCsvFile
- searchBulkUploads
- uploadCsvFile
- getAuthorShareStatistics
- registrationShareProductInSocial
- removeTemplateFromUploads
- getListProductBoosts
- getListProductDiscounts
- getCriticalUpdateStatistics
- deletePlannedAuthorDiscount
- getDownloadLink
ServiceUploads
Uploads API
getHeaders
Get response headers
Parameters
response{Object} response data
Returns Object
getDocuments
Get list of documents
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url);
const request = await service.getDocuments();
})();Returns Promise<any>
getDocument
Get document by id
Parameters
Examples
(async () => {
const service = new Service(url);
const request = await service.getDocument(id);
})();Returns Promise<any>
getFeatures
Get list of template features
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url);
const request = await service.getFeatures();
})();Returns Promise<any>
getLicenses
Get list of template licenses
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url);
const request = await service.getLicenses();
})();Returns Promise<any>
getTools
Get list of template tools
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url);
const request = await service.getTools();
})();Returns Promise<any>
getTopics
Get list of template topics
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url);
const request = await service.getTopics();
})();Returns Promise<any>
getTypes
Get list of template types
Parameters
paramsobjectparams.expandstring? Show additional info (e.g. ?expand=fields,steps).params.sortstring? sort by any param (e.g. sort DESC by id: "?sort=-id"), Possible values: id, title, price, need_demo_urlparams.fieldsstring? Filter by any param (e.g. return only id filed: "?fields=id"), Possible values: id, title, price, need_demo_url, stepsparams.statusstring? Filter types by status. Possible values: active, inactive
Examples
(async () => {
const service = new Service(url);
const request = await service.getTypes();
})();Returns Promise<any>
getType
Types - Get template type
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url);
const request = await service.getType(params);
})();Returns Promise<any>
getAuthorTemplates
Get Author templates
Parameters
paramsobjectparams.statestring? filter by status id (e.g. Pending - 1; In progress - 2; Approved - 3; Soft Reject - 4; Hard Reject - 5; Deploy - 6; Deploy failed - 7;)params.statesstring? filter by more then one state divided by comma (e.g. "states=1,2,3")params.stepIdstring? filter by step idparams.templateIdstring? filter by template idparams.hasTemplateIdnumber? 1 to receive uploads only with template_id, 0 to receive uploads without template_idparams.namestring? filter fieldparams.sortstring? sort by parameter (e.g. DESC sort by id: "?sort=-id"); available values cheap, pricey, new, from doc API // TODO: clarify sort optionsparams.perPagenumber? Templates per pageparams.pagestring? Templates pageparams.accessTokenstring? Access token. Use either the Authorization header or the access_token query param to pass an access token.params.productStatesstring? products states for filter in uploadsparams.expandstring? products expand for uploadsparams.textstring? products search textparams.shareStatestring? products share state: if not shared - "0", if shared 1 to 4 - "1", if shared 5 - "2"params.isProductBooststring? products boosted state: 0 or 1params.criticalUpdateFromstring? Timestamp critical update fromparams.criticalUpdateTostring? Timestamp critical update to
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getAuthorTemplates({
state: 3,
stepId: 1,
templateId: 10,
hasTemplateId: true,
sort: 'price',
perPage: 20,
page: 5,
accessToken: 'He46Mlwsr6uowkPsrZCG1GYHJ8laUEcfrW1Xt6UG'
productStates: '10',
expand: 'downloadLink',
text: 'Monstroid',
shareState: 0,
isProductBoost: 1,
});
})();Returns Promise<object> object of products list
getAuthorTemplateInfo
Get author template info
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getAuthorTemplateInfo({ id: 1 });
})();Returns Promise<object> object of product
getAuthorTemplateUploadLink
Get author template upload link (Amazon S3)
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getAuthorTemplateUploadLink({ file: 'loremipsumdolorsitamet' });
})();Returns Promise<object> object of product
getAuthorScreenshotUploadLink
Get author screenshot upload link (Amazon S3)
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getAuthorScreenshotUploadLink({ file: 'loremipsumdolorsitamet', id: 1});
})();Returns Promise<object> object of product
createNewTemplate
Templates - Create new template
Parameters
paramsobjectparams.namestring Template name. (required)params.typestring Template type ID. (required)params.filestring File name which has been saved into S3 (required)params.templateIdnumber? real template ID (if template is already released and update is needed)params.pricenumber? Template priceparams.authorCommentstring? author review commentparams.isExclusiveboolean? if template sold exclusively on TMparams.isOnSaleboolean? if template can be sold on saleparams.isOnLoyaltyboolean? If template will take part in loyalty programparams.isOnAffiliateboolean? If template will take part in affiliate programparams.changelogstring? template changelogparams.licensesArray<number>? Product Licenses IDs.params.supportArray<Object>? Support types.params.mediaArray<Object>? Additional media content.params.propertiesobject? Template properties.
stringstring [].type] - Support type(1 - Tickets, 2 - Email, 3 - Phone, 4 - Chat).stringstring [].measure] - Support measure (day, minute, hour).numbernumber [].value] - Measure value.stringstring [].phone] - Support phone if needed.stringstring [].url] - Media url.stringstring [].type] - Media type (image | video).stringstring [].slot] - Media view slot (slider | presentational | main).
Examples
(async () => {
const service = new Service(url, token);
const request = await service.createNewTemplate({
name: "Some brand new WP Template",
type: 'wordpress-templates',
file: "wp-v1-brand-new.zip",
templateId: null,
price: null,
authorComment: "Some comments from template author",
isExclusive: false,
isOnSale: true,
isOnLoyalty: true,
isOnAffiliate: false,
changelog: null,
licenses: [],
support: [],
media: [],
properties: {},
});
})();Returns Promise<userInfo>
updateTemplateInfo
Templates - Update template info
Parameters
paramsobjectparams.idnumber Template ID (required)params.namestring Template name. (required)params.typestring Template type ID. (required)params.filestring File name which has been saved into S3 (required)params.pricenumber Template price (required)params.authorCommentstring? author review commentparams.isExclusiveboolean? if template sold exclusively on TMparams.isOnSaleboolean? if template can be sold on saleparams.isOnLoyaltyboolean? If template will take part in loyalty programparams.isOnAffiliateboolean? If template will take part in affiliate programparams.changelogstring? template changelogparams.licensesArray<number>? Product Licenses IDs.params.supportArray<Object>? Support types.params.mediaArray<Object>? Additional media content.params.propertiesobject? Template properties.
stringstring [].type] - Support type(1 - Tickets, 2 - Email, 3 - Phone, 4 - Chat).stringstring [].measure] - Support measure (day, minute, hour).numbernumber [].value] - Measure value.stringstring [].phone] - Support phone if needed.stringstring [].url] - Media url.stringstring [].type] - Media type (image | video).stringstring [].slot] - Media view slot (slider | presentational | main).
Examples
(async () => {
const service = new Service(url, token);
const request = await service.updateTemplateInfo({
id: 3498,
name: "Some brand new WP Template",
type: 'wordpress-templates',
file: "wp-v1-brand-new.zip",
price: null,
authorComment: "Some comments from template author",
isExclusive: false,
isOnSale: true,
isOnLoyalty: true,
isOnAffiliate: false,
changelog: null,
licenses: [],
support: [],
media: [],
properties: {},
});
})();Returns Promise<userInfo>
validateUploadFields
Templates - Validate
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url, token);
const request = await service.validateUploadFields(params);
})();Returns Promise<userInfo>
getBulkUploadErrorsById
BulkUpload - Get errors by upload item
Parameters
idstring Bulk upload id (required)
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getBulkUploadErrorsById(id);
})();Returns Promise<any>
getSampleCsvFile
BulkUpload - Get sample CSV files
Parameters
typeUrlstring Type Url (required)
Examples
(async () => {
const service = new Service(url);
const request = await service.getSampleCsvFile(typeUrl);
})();Returns Promise<any>
searchBulkUploads
BulkUpload - Search bulk uploads
Parameters
paramsobjectparams.idsstring? Array of id divided by comma (e.g. "1,2"). Max count items 50params.typeIdsstring? Array of type id divided by comma (e.g. "6,8"). Max count items 50params.statusnumber? Statusparams.perPagenumber? Max items per one page (50 is max size). default = 20params.pagenumber? Page number to view. default = 1params.sortstring? Sort. Defines on which fields to sort (e.g. ?sort=-id) ("-" symbol is DESC sort). default = id
Examples
(async () => {
const service = new Service(url, token);
const request = await service.searchBulkUploads(params);
})();Returns Promise<any>
uploadCsvFile
BulkUpload - Upload csv file
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url, token);
const request = await service.uploadCsvFile(params);Returns Promise<userInfo>
getAuthorShareStatistics
Get author share statistics
Parameters
paramsobjectparams.accessTokenstring Access token. Use either the Authorization header or the access_token query param to pass an access token.
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getAuthorShareStatistics({});
})();Returns Promise<object> object of product
registrationShareProductInSocial
Registration share product in social network
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url, token);
const request = await service.registrationShareProductInSocial({});
})();Returns Promise<object> object of product
removeTemplateFromUploads
Registration share product in social network
Parameters
paramsobject
Examples
(async () => {
const service = new Service(url, token);
const request = await service.removeTemplateFromUploads({templateId: 55555});
})();Returns Promise<object> object of product
getListProductBoosts
Get list product boost
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getListProductBoosts();
})();Returns Promise<object> object of boosts
getListProductDiscounts
Get list product discounts
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getListProductDiscounts();
})();Returns Promise<object> object of discounts
getCriticalUpdateStatistics
Get critical update statistics
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getCriticalUpdateStatistics();
})();Returns Promise<object> object of discounts
deletePlannedAuthorDiscount
Delete planned author discount
Examples
(async () => {
const service = new Service(url, token);
const request = await service.deletePlannedAuthorDiscount();
})();Returns Promise<object> object of discounts
getDownloadLink
Get download link
Parameters
paramsobjectparams.accessTokenstring Access token. Use either the Authorization header or the access_token query param to pass an access token.params.idnumber Upload Id (required)params.user_idnumber User idparams.product_idnumber Find last upload by product idparams.user_loginstring User loginparams.user_ipstring User ipparams.user_agentstring User Agentparams.user_refererstring User refererparams.access_tokenstring Access token. Use either the Authorization header or the access_token query param to pass an access token.
Examples
(async () => {
const service = new Service(url, token);
const request = await service.getDownloadLink({ id: 1 });
})();3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago