@datocms/cma-client
Advanced tools
Comparing version 0.1.8 to 1.0.0
@@ -56,4 +56,4 @@ "use strict"; | ||
*/ | ||
Site.prototype.find = function () { | ||
return this.rawFind().then(function (body) { | ||
Site.prototype.find = function (queryParams) { | ||
return this.rawFind(queryParams).then(function (body) { | ||
return Utils.deserializeResponseBody(body); | ||
@@ -67,6 +67,7 @@ }); | ||
*/ | ||
Site.prototype.rawFind = function () { | ||
Site.prototype.rawFind = function (queryParams) { | ||
return this.client.request({ | ||
method: 'GET', | ||
url: "/site", | ||
queryParams: queryParams, | ||
}); | ||
@@ -73,0 +74,0 @@ }; |
@@ -104,4 +104,4 @@ "use strict"; | ||
*/ | ||
User.prototype.find = function (userId) { | ||
return this.rawFind(Utils.toId(userId)).then(function (body) { | ||
User.prototype.find = function (userId, queryParams) { | ||
return this.rawFind(Utils.toId(userId), queryParams).then(function (body) { | ||
return Utils.deserializeResponseBody(body); | ||
@@ -115,9 +115,32 @@ }); | ||
*/ | ||
User.prototype.rawFind = function (userId) { | ||
User.prototype.rawFind = function (userId, queryParams) { | ||
return this.client.request({ | ||
method: 'GET', | ||
url: "/users/".concat(userId), | ||
queryParams: queryParams, | ||
}); | ||
}; | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
User.prototype.findMe = function (queryParams) { | ||
return this.rawFindMe(queryParams).then(function (body) { | ||
return Utils.deserializeResponseBody(body); | ||
}); | ||
}; | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
User.prototype.rawFindMe = function (queryParams) { | ||
return this.client.request({ | ||
method: 'GET', | ||
url: "/users/me", | ||
queryParams: queryParams, | ||
}); | ||
}; | ||
/** | ||
* Delete a collaborator | ||
@@ -124,0 +147,0 @@ * |
@@ -26,5 +26,5 @@ import * as SimpleSchemaTypes from './generated/SimpleSchemaTypes'; | ||
creator?: { | ||
data: SchemaTypes.UserData | SchemaTypes.SsoUserData | SchemaTypes.AccountData | SchemaTypes.AccessTokenData; | ||
data: SchemaTypes.UserData | SchemaTypes.SsoUserData | SchemaTypes.AccessTokenData | SchemaTypes.AccountData; | ||
} | undefined; | ||
} | undefined; | ||
}; |
@@ -11,3 +11,3 @@ import * as SchemaTypes from '../SchemaTypes'; | ||
*/ | ||
find(): Promise<SimpleSchemaTypes.Site>; | ||
find(queryParams?: SimpleSchemaTypes.SiteSelfHrefSchema): Promise<SimpleSchemaTypes.Site>; | ||
/** | ||
@@ -18,3 +18,3 @@ * Retrieve the site | ||
*/ | ||
rawFind(): Promise<SchemaTypes.SiteSelfTargetSchema>; | ||
rawFind(queryParams?: SchemaTypes.SiteSelfHrefSchema): Promise<SchemaTypes.SiteSelfTargetSchema>; | ||
/** | ||
@@ -21,0 +21,0 @@ * Update the site's settings |
@@ -28,4 +28,4 @@ var __extends = (this && this.__extends) || (function () { | ||
*/ | ||
Site.prototype.find = function () { | ||
return this.rawFind().then(function (body) { | ||
Site.prototype.find = function (queryParams) { | ||
return this.rawFind(queryParams).then(function (body) { | ||
return Utils.deserializeResponseBody(body); | ||
@@ -39,6 +39,7 @@ }); | ||
*/ | ||
Site.prototype.rawFind = function () { | ||
Site.prototype.rawFind = function (queryParams) { | ||
return this.client.request({ | ||
method: 'GET', | ||
url: "/site", | ||
queryParams: queryParams, | ||
}); | ||
@@ -45,0 +46,0 @@ }; |
@@ -35,3 +35,3 @@ import * as SchemaTypes from '../SchemaTypes'; | ||
*/ | ||
find(userId: string | SimpleSchemaTypes.UserData): Promise<SimpleSchemaTypes.User>; | ||
find(userId: string | SimpleSchemaTypes.UserData, queryParams?: SimpleSchemaTypes.UserSelfHrefSchema): Promise<SimpleSchemaTypes.User>; | ||
/** | ||
@@ -42,4 +42,16 @@ * Retrieve a collaborator | ||
*/ | ||
rawFind(userId: string): Promise<SchemaTypes.UserSelfTargetSchema>; | ||
rawFind(userId: string, queryParams?: SchemaTypes.UserSelfHrefSchema): Promise<SchemaTypes.UserSelfTargetSchema>; | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
findMe(queryParams?: SimpleSchemaTypes.UserMeHrefSchema): Promise<SimpleSchemaTypes.User | SimpleSchemaTypes.SsoUser | SimpleSchemaTypes.AccessToken | SimpleSchemaTypes.Account>; | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
rawFindMe(queryParams?: SchemaTypes.UserMeHrefSchema): Promise<SchemaTypes.UserMeTargetSchema>; | ||
/** | ||
* Delete a collaborator | ||
@@ -46,0 +58,0 @@ * |
@@ -76,4 +76,4 @@ var __extends = (this && this.__extends) || (function () { | ||
*/ | ||
User.prototype.find = function (userId) { | ||
return this.rawFind(Utils.toId(userId)).then(function (body) { | ||
User.prototype.find = function (userId, queryParams) { | ||
return this.rawFind(Utils.toId(userId), queryParams).then(function (body) { | ||
return Utils.deserializeResponseBody(body); | ||
@@ -87,9 +87,32 @@ }); | ||
*/ | ||
User.prototype.rawFind = function (userId) { | ||
User.prototype.rawFind = function (userId, queryParams) { | ||
return this.client.request({ | ||
method: 'GET', | ||
url: "/users/".concat(userId), | ||
queryParams: queryParams, | ||
}); | ||
}; | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
User.prototype.findMe = function (queryParams) { | ||
return this.rawFindMe(queryParams).then(function (body) { | ||
return Utils.deserializeResponseBody(body); | ||
}); | ||
}; | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
User.prototype.rawFindMe = function (queryParams) { | ||
return this.client.request({ | ||
method: 'GET', | ||
url: "/users/me", | ||
queryParams: queryParams, | ||
}); | ||
}; | ||
/** | ||
* Delete a collaborator | ||
@@ -96,0 +119,0 @@ * |
@@ -26,5 +26,5 @@ import * as SimpleSchemaTypes from './generated/SimpleSchemaTypes'; | ||
creator?: { | ||
data: SchemaTypes.UserData | SchemaTypes.SsoUserData | SchemaTypes.AccountData | SchemaTypes.AccessTokenData; | ||
data: SchemaTypes.UserData | SchemaTypes.SsoUserData | SchemaTypes.AccessTokenData | SchemaTypes.AccountData; | ||
} | undefined; | ||
} | undefined; | ||
}; |
@@ -11,3 +11,3 @@ import * as SchemaTypes from '../SchemaTypes'; | ||
*/ | ||
find(): Promise<SimpleSchemaTypes.Site>; | ||
find(queryParams?: SimpleSchemaTypes.SiteSelfHrefSchema): Promise<SimpleSchemaTypes.Site>; | ||
/** | ||
@@ -18,3 +18,3 @@ * Retrieve the site | ||
*/ | ||
rawFind(): Promise<SchemaTypes.SiteSelfTargetSchema>; | ||
rawFind(queryParams?: SchemaTypes.SiteSelfHrefSchema): Promise<SchemaTypes.SiteSelfTargetSchema>; | ||
/** | ||
@@ -21,0 +21,0 @@ * Update the site's settings |
@@ -35,3 +35,3 @@ import * as SchemaTypes from '../SchemaTypes'; | ||
*/ | ||
find(userId: string | SimpleSchemaTypes.UserData): Promise<SimpleSchemaTypes.User>; | ||
find(userId: string | SimpleSchemaTypes.UserData, queryParams?: SimpleSchemaTypes.UserSelfHrefSchema): Promise<SimpleSchemaTypes.User>; | ||
/** | ||
@@ -42,4 +42,16 @@ * Retrieve a collaborator | ||
*/ | ||
rawFind(userId: string): Promise<SchemaTypes.UserSelfTargetSchema>; | ||
rawFind(userId: string, queryParams?: SchemaTypes.UserSelfHrefSchema): Promise<SchemaTypes.UserSelfTargetSchema>; | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
findMe(queryParams?: SimpleSchemaTypes.UserMeHrefSchema): Promise<SimpleSchemaTypes.User | SimpleSchemaTypes.SsoUser | SimpleSchemaTypes.AccessToken | SimpleSchemaTypes.Account>; | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
rawFindMe(queryParams?: SchemaTypes.UserMeHrefSchema): Promise<SchemaTypes.UserMeTargetSchema>; | ||
/** | ||
* Delete a collaborator | ||
@@ -46,0 +58,0 @@ * |
{ | ||
"name": "@datocms/cma-client", | ||
"version": "0.1.8", | ||
"version": "1.0.0", | ||
"description": "JS client for DatoCMS REST Content Management API", | ||
@@ -40,8 +40,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@datocms/rest-client-utils": "^0.1.8" | ||
"@datocms/rest-client-utils": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@datocms/dashboard-client": "^0.1.8" | ||
"@datocms/dashboard-client": "^1.0.0" | ||
}, | ||
"gitHead": "ffb2f67a843f695e97dd14e2ca493f9dc9c87823" | ||
"gitHead": "7972ee65694bd9e6eb5579fa6c32aa630092ce7c" | ||
} |
@@ -61,2 +61,8 @@ [ | ||
{ | ||
"rel": "me", | ||
"returnsCollection": false, | ||
"name": "findMe", | ||
"rawName": "rawFindMe" | ||
}, | ||
{ | ||
"rel": "destroy", | ||
@@ -63,0 +69,0 @@ "returnsCollection": false, |
@@ -14,4 +14,4 @@ import * as Utils from '@datocms/rest-client-utils'; | ||
*/ | ||
find() { | ||
return this.rawFind().then((body) => | ||
find(queryParams?: SimpleSchemaTypes.SiteSelfHrefSchema) { | ||
return this.rawFind(queryParams).then((body) => | ||
Utils.deserializeResponseBody<SimpleSchemaTypes.SiteSelfTargetSchema>( | ||
@@ -28,6 +28,9 @@ body, | ||
*/ | ||
rawFind(): Promise<SchemaTypes.SiteSelfTargetSchema> { | ||
rawFind( | ||
queryParams?: SchemaTypes.SiteSelfHrefSchema, | ||
): Promise<SchemaTypes.SiteSelfTargetSchema> { | ||
return this.client.request<SchemaTypes.SiteSelfTargetSchema>({ | ||
method: 'GET', | ||
url: `/site`, | ||
queryParams, | ||
}); | ||
@@ -34,0 +37,0 @@ } |
@@ -79,4 +79,7 @@ import * as Utils from '@datocms/rest-client-utils'; | ||
*/ | ||
find(userId: string | SimpleSchemaTypes.UserData) { | ||
return this.rawFind(Utils.toId(userId)).then((body) => | ||
find( | ||
userId: string | SimpleSchemaTypes.UserData, | ||
queryParams?: SimpleSchemaTypes.UserSelfHrefSchema, | ||
) { | ||
return this.rawFind(Utils.toId(userId), queryParams).then((body) => | ||
Utils.deserializeResponseBody<SimpleSchemaTypes.UserSelfTargetSchema>( | ||
@@ -93,6 +96,10 @@ body, | ||
*/ | ||
rawFind(userId: string): Promise<SchemaTypes.UserSelfTargetSchema> { | ||
rawFind( | ||
userId: string, | ||
queryParams?: SchemaTypes.UserSelfHrefSchema, | ||
): Promise<SchemaTypes.UserSelfTargetSchema> { | ||
return this.client.request<SchemaTypes.UserSelfTargetSchema>({ | ||
method: 'GET', | ||
url: `/users/${userId}`, | ||
queryParams, | ||
}); | ||
@@ -102,2 +109,28 @@ } | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
findMe(queryParams?: SimpleSchemaTypes.UserMeHrefSchema) { | ||
return this.rawFindMe(queryParams).then((body) => | ||
Utils.deserializeResponseBody<SimpleSchemaTypes.UserMeTargetSchema>(body), | ||
); | ||
} | ||
/** | ||
* Retrieve current signed-in user | ||
* | ||
* Read more: https://www.datocms.com/docs/content-management-api/resources/user/me | ||
*/ | ||
rawFindMe( | ||
queryParams?: SchemaTypes.UserMeHrefSchema, | ||
): Promise<SchemaTypes.UserMeTargetSchema> { | ||
return this.client.request<SchemaTypes.UserMeTargetSchema>({ | ||
method: 'GET', | ||
url: `/users/me`, | ||
queryParams, | ||
}); | ||
} | ||
/** | ||
* Delete a collaborator | ||
@@ -104,0 +137,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2730680
82160
0
+ Added@datocms/rest-client-utils@1.3.3(transitive)
+ Added@fastify/busboy@2.1.1(transitive)
+ Added@peculiar/asn1-schema@2.3.15(transitive)
+ Added@peculiar/json-schema@1.1.12(transitive)
+ Added@peculiar/webcrypto@1.5.0(transitive)
+ Added@whatwg-node/fetch@0.5.4(transitive)
+ Addedabort-controller@3.0.0(transitive)
+ Addedasn1js@3.0.5(transitive)
+ Addedbusboy@1.6.0(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedform-data-encoder@1.9.0(transitive)
+ Addedformdata-node@4.4.1(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addedpvtsutils@1.3.6(transitive)
+ Addedpvutils@1.1.3(transitive)
+ Addedstreamsearch@1.1.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedundici@5.28.5(transitive)
+ Addedweb-streams-polyfill@3.3.34.0.0-beta.3(transitive)
+ Addedwebcrypto-core@1.8.1(transitive)
- Removed@datocms/rest-client-utils@0.1.8(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedcross-fetch@3.2.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.7(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedqs@6.14.0(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)