@cocreate/api
Advanced tools
Comparing version 1.18.2 to 1.19.0
{ | ||
"name": "@cocreate/api", | ||
"version": "1.18.2", | ||
"version": "1.19.0", | ||
"description": "A simple api helper component in vanilla javascript used by JavaScript developers to create thirdparty api intergrations. CoCreate-api includes the client component and server side for api processing. Thirdparty apis can be accessible using HTML5 attributes and/or JavaScript API. ", | ||
@@ -62,9 +62,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@cocreate/actions": "^1.14.0", | ||
"@cocreate/crud-client": "^1.31.0", | ||
"@cocreate/actions": "^1.15.1", | ||
"@cocreate/crud-client": "^1.32.2", | ||
"@cocreate/element-prototype": "^1.15.0", | ||
"@cocreate/render": "^1.35.0", | ||
"@cocreate/socket-client": "^1.35.0", | ||
"@cocreate/utils": "^1.29.0" | ||
"@cocreate/render": "^1.37.1", | ||
"@cocreate/socket-client": "^1.36.1", | ||
"@cocreate/utils": "^1.30.0" | ||
} | ||
} |
@@ -10,49 +10,9 @@ class CoCreateApi { | ||
let org = await CRUD.send({ | ||
method: 'object.read', | ||
array: "organizations", | ||
key: config["key"], | ||
organization_id: config["organization_id"], | ||
object: { | ||
_id: config["organization_id"] | ||
} | ||
let organization = await this.crud.getOrganization(config.organization_id); | ||
}); | ||
if (!org || !org.object && !org.object[0]) { | ||
console.log(component, " Error GET ORG in : ", e); | ||
if (!organization.error) | ||
return false; | ||
} | ||
return org.object[0]; | ||
return organization | ||
} | ||
async getApiKey(organization_id, name) { | ||
this.organizations[organization_id] = this.getOrganization(organization_id, name) | ||
this.organizations[organization_id] = await this.organizations[organization_id] | ||
return this.organizations[organization_id] | ||
} | ||
async getOrganizationNew(organization_id, name) { | ||
let organization = await this.crud.send({ | ||
method: 'object.read', | ||
database: organization_id, | ||
array: 'organizations', | ||
object: [{ _id: organization_id }], | ||
organization_id | ||
}) | ||
if (organization | ||
&& organization.object | ||
&& organization.object[0]) { | ||
if (organization.object[0].apis && organization.object[0].apis[name]) { | ||
return organization.object[0].apis && organization.object[0].apis[name] | ||
} else | ||
return { [this.name]: false, error: 'An apikey could not be found' } | ||
} else { | ||
return { serverOrganization: false, error: 'An organization could not be found' } | ||
} | ||
} | ||
} | ||
@@ -59,0 +19,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188023
347
Updated@cocreate/actions@^1.15.1
Updated@cocreate/render@^1.37.1
Updated@cocreate/utils@^1.30.0