UNPKG

kinto

Version:

An Offline-First JavaScript client for Kinto.

20 lines (19 loc) 896 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Endpoints templates. * @type {Object} */ const ENDPOINTS = { root: () => "/", batch: () => "/batch", permissions: () => "/permissions", bucket: (bucket) => "/buckets" + (bucket ? `/${bucket}` : ""), history: (bucket) => `${ENDPOINTS.bucket(bucket)}/history`, snapshot: (bucket, coll, ts) => `${ENDPOINTS.bucket(bucket)}/snapshot/collections/${coll}@${ts}`, collection: (bucket, coll) => `${ENDPOINTS.bucket(bucket)}/collections` + (coll ? `/${coll}` : ""), group: (bucket, group) => `${ENDPOINTS.bucket(bucket)}/groups` + (group ? `/${group}` : ""), record: (bucket, coll, id) => `${ENDPOINTS.collection(bucket, coll)}/records` + (id ? `/${id}` : ""), attachment: (bucket, coll, id) => `${ENDPOINTS.record(bucket, coll, id)}/attachment`, }; exports.default = ENDPOINTS;