diff --git a/packages/cma-client-browser/package.json b/packages/cma-client-browser/package.json index 08fea23..177cdd6 100644 --- a/packages/cma-client-browser/package.json +++ b/packages/cma-client-browser/package.json @@ -2,10 +2,7 @@ "name": "@datocms/cma-client-browser", "version": "3.3.3", "description": "Browser client for DatoCMS REST Content Management API", - "keywords": [ - "datocms", - "client" - ], + "keywords": ["datocms", "client"], "author": "Stefano Verna ", "homepage": "https://github.com/datocms/js-rest-api-clients/tree/main/packages/cma-client-browser#readme", "license": "MIT", @@ -16,10 +13,7 @@ "lib": "dist", "test": "__tests__" }, - "files": [ - "dist", - "src" - ], + "files": ["dist", "src"], "publishConfig": { "access": "public" }, diff --git a/packages/cma-client-node/package.json b/packages/cma-client-node/package.json index a34a19d..0926315 100644 --- a/packages/cma-client-node/package.json +++ b/packages/cma-client-node/package.json @@ -2,10 +2,7 @@ "name": "@datocms/cma-client-node", "version": "3.3.3", "description": "NodeJS client for DatoCMS REST Content Management API", - "keywords": [ - "datocms", - "client" - ], + "keywords": ["datocms", "client"], "author": "Stefano Verna ", "homepage": "https://github.com/datocms/js-rest-api-clients/tree/main/packages/cma-client-node#readme", "license": "MIT", @@ -16,10 +13,7 @@ "lib": "dist", "test": "__tests__" }, - "files": [ - "dist", - "src" - ], + "files": ["dist", "src"], "publishConfig": { "access": "public" }, diff --git a/packages/cma-client/package.json b/packages/cma-client/package.json index 44e865c..b453637 100644 --- a/packages/cma-client/package.json +++ b/packages/cma-client/package.json @@ -2,10 +2,7 @@ "name": "@datocms/cma-client", "version": "3.3.3", "description": "JS client for DatoCMS REST Content Management API", - "keywords": [ - "datocms", - "client" - ], + "keywords": ["datocms", "client"], "author": "Stefano Verna ", "homepage": "https://github.com/datocms/js-rest-api-clients/tree/main/packages/cma-client#readme", "license": "MIT", @@ -17,11 +14,7 @@ "lib": "dist", "test": "__tests__" }, - "files": [ - "dist", - "src", - "resources.json" - ], + "files": ["dist", "src", "resources.json"], "publishConfig": { "access": "public" }, diff --git a/packages/cma-client/src/idUtils.ts b/packages/cma-client/src/idUtils.ts index 7ee1650..fd59382 100644 --- a/packages/cma-client/src/idUtils.ts +++ b/packages/cma-client/src/idUtils.ts @@ -34,6 +34,13 @@ function fromUrlSafeBase64toUint8Array(urlSafeBase64: string): Uint8Array { } export function isValidId(id: string) { + // For backward compatibility, first check to see if this is an older-style integer ID formerly used by Dato + if (/^\d+$/.test(id)) { + const intId = BigInt(id); + const maxDatoIntegerId = 281474976710655; // Max 6-byte/48-bit unsigned int + return intId <= maxDatoIntegerId; + } + const bytes = fromUrlSafeBase64toUint8Array(id); // UUIDs are 16 bytes diff --git a/packages/dashboard-client/package.json b/packages/dashboard-client/package.json index adf5d1d..f57d3d8 100644 --- a/packages/dashboard-client/package.json +++ b/packages/dashboard-client/package.json @@ -2,10 +2,7 @@ "name": "@datocms/dashboard-client", "version": "3.3.3", "description": "JS client for DatoCMS REST Content Management API", - "keywords": [ - "datocms", - "client" - ], + "keywords": ["datocms", "client"], "author": "Stefano Verna ", "homepage": "https://github.com/datocms/js-rest-api-clients/tree/main/packages/cma-client#readme", "license": "MIT", @@ -17,11 +14,7 @@ "lib": "dist", "test": "__tests__" }, - "files": [ - "dist", - "src", - "resources.json" - ], + "files": ["dist", "src", "resources.json"], "publishConfig": { "access": "public" }, diff --git a/packages/rest-api-events/package.json b/packages/rest-api-events/package.json index 2208909..35f7f54 100644 --- a/packages/rest-api-events/package.json +++ b/packages/rest-api-events/package.json @@ -2,10 +2,7 @@ "name": "@datocms/rest-api-events", "version": "3.3.3", "description": "Utilities to receive real-time events from DatoCMS REST APIs", - "keywords": [ - "datocms", - "client" - ], + "keywords": ["datocms", "client"], "author": "Stefano Verna ", "homepage": "https://github.com/datocms/js-rest-api-clients/tree/main/packages/rest-api-events#readme", "license": "MIT", @@ -17,10 +14,7 @@ "lib": "dist", "test": "__tests__" }, - "files": [ - "dist", - "src" - ], + "files": ["dist", "src"], "publishConfig": { "access": "public" }, diff --git a/packages/rest-client-utils/package.json b/packages/rest-client-utils/package.json index f74507b..8955f17 100644 --- a/packages/rest-client-utils/package.json +++ b/packages/rest-client-utils/package.json @@ -2,10 +2,7 @@ "name": "@datocms/rest-client-utils", "version": "3.3.3", "description": "Utilities for DatoCMS REST API clients", - "keywords": [ - "datocms", - "client" - ], + "keywords": ["datocms", "client"], "author": "Stefano Verna ", "homepage": "https://github.com/datocms/js-rest-api-clients/tree/main/packages/rest-client-utils#readme", "license": "MIT", @@ -17,10 +14,7 @@ "lib": "dist", "test": "__tests__" }, - "files": [ - "dist", - "src" - ], + "files": ["dist", "src"], "publishConfig": { "access": "public" },