next-tinacms-dos 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
10
  See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
- import { Media, MediaList, MediaListOptions, MediaStore, MediaUploadOptions } from '@tinacms/toolkit';
13
+ import type { Media, MediaList, MediaListOptions, MediaStore, MediaUploadOptions } from '@tinacms/toolkit';
14
14
  export declare class DOSMediaStore implements MediaStore {
15
15
  fetchFunction: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
16
16
  accept: string;
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
13
  import { DOSMediaStore } from './dos-media-store';
14
- import { Client } from 'tinacms';
14
+ import type { Client } from 'tinacms';
15
15
  export declare class TinaCloudDOSMediaStore extends DOSMediaStore {
16
16
  client: Client;
17
17
  constructor(client: Client);
package/dist/errors.d.ts CHANGED
@@ -10,10 +10,21 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
10
  See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
- import { MediaListError } from '@tinacms/toolkit';
13
+ interface MediaListErrorConfig {
14
+ title: string;
15
+ message: string;
16
+ docsLink: string;
17
+ }
18
+ declare class MediaListError extends Error {
19
+ ERR_TYPE: string;
20
+ title: string;
21
+ docsLink: string;
22
+ constructor(config: MediaListErrorConfig);
23
+ }
14
24
  export declare const E_DEFAULT: MediaListError;
15
25
  export declare const E_UNAUTHORIZED: MediaListError;
16
26
  export declare const E_CONFIG: MediaListError;
17
27
  export declare const E_KEY_FAIL: MediaListError;
18
28
  export declare const E_BAD_ROUTE: MediaListError;
19
29
  export declare const interpretErrorMessage: (message: string) => MediaListError;
30
+ export {};
package/dist/index.es.js CHANGED
@@ -1,4 +1,11 @@
1
- import { MediaListError } from "@tinacms/toolkit";
1
+ class MediaListError extends Error {
2
+ constructor(config) {
3
+ super(config.message);
4
+ this.ERR_TYPE = "MediaListError";
5
+ this.title = config.title;
6
+ this.docsLink = config.docsLink;
7
+ }
8
+ }
2
9
  const E_DEFAULT = new MediaListError({
3
10
  title: "An Error Occurred",
4
11
  message: "Something went wrong fetching your media from Digital Ocean Space.",
package/dist/index.js CHANGED
@@ -1,28 +1,36 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@tinacms/toolkit")) : typeof define === "function" && define.amd ? define(["exports", "@tinacms/toolkit"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["next-tinacms-dos"] = {}, global.NOOP));
3
- })(this, function(exports2, toolkit) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["next-tinacms-dos"] = {}));
3
+ })(this, function(exports2) {
4
4
  "use strict";
5
- const E_DEFAULT = new toolkit.MediaListError({
5
+ class MediaListError extends Error {
6
+ constructor(config) {
7
+ super(config.message);
8
+ this.ERR_TYPE = "MediaListError";
9
+ this.title = config.title;
10
+ this.docsLink = config.docsLink;
11
+ }
12
+ }
13
+ const E_DEFAULT = new MediaListError({
6
14
  title: "An Error Occurred",
7
15
  message: "Something went wrong fetching your media from Digital Ocean Space.",
8
16
  docsLink: "https://tina.io/packages/next-tinacms-dos"
9
17
  });
10
- const E_UNAUTHORIZED = new toolkit.MediaListError({
18
+ const E_UNAUTHORIZED = new MediaListError({
11
19
  title: "Unauthorized",
12
20
  message: "You don't have access to this resource.",
13
21
  docsLink: "https://tina.io/packages/next-tinacms-dos"
14
22
  });
15
- const E_CONFIG = new toolkit.MediaListError({
23
+ const E_CONFIG = new MediaListError({
16
24
  title: "Missing Credentials",
17
25
  message: "Unable to connect to Digital Ocean Space because one or more environment variables are missing.",
18
26
  docsLink: "https://tina.io/docs/media-dos/"
19
27
  });
20
- const E_KEY_FAIL = new toolkit.MediaListError({
28
+ const E_KEY_FAIL = new MediaListError({
21
29
  title: "Bad Credentials",
22
30
  message: "Unable to connect to Digital Ocean Space because one or more environment variables are misconfigured.",
23
31
  docsLink: "https://tina.io/docs/media-dos/"
24
32
  });
25
- const E_BAD_ROUTE = new toolkit.MediaListError({
33
+ const E_BAD_ROUTE = new MediaListError({
26
34
  title: "Bad Route",
27
35
  message: "The Digital Ocean Space API route is missing or misconfigured.",
28
36
  docsLink: "https://tina.io/packages/next-tinacms-dos/#set-up-api-routes"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-tinacms-dos",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"
@@ -21,28 +21,15 @@
21
21
  "multer": "1.4.5-lts.1"
22
22
  },
23
23
  "devDependencies": {
24
- "@tinacms/toolkit": "0.57.5",
25
- "@tinacms/scripts": "0.51.1",
24
+ "@tinacms/toolkit": "0.58.1",
25
+ "@tinacms/scripts": "0.51.3",
26
26
  "@types/crypto-js": "^3.1.47",
27
27
  "@types/js-cookie": "^2.2.6",
28
28
  "@types/node": "^13.13.1",
29
- "@types/react": "^16.9.43",
30
- "@types/styled-components": "^5.1.3",
31
29
  "next": "12.2.4",
32
- "react": "17.0.2",
33
- "react-dom": "17.0.2",
34
- "styled-components": "^5.2.0",
35
- "tinacms": "0.69.8",
30
+ "tinacms": "0.69.18",
36
31
  "typescript": "4.3.5"
37
32
  },
38
- "peerDependencies": {
39
- "@tinacms/toolkit": "*",
40
- "react": ">=16.14",
41
- "react-dom": ">=16.14",
42
- "react-is": "^16.13.1 || <18.0.0",
43
- "styled-components": "*",
44
- "tinacms": ">=0.50.0"
45
- },
46
33
  "publishConfig": {
47
34
  "registry": "https://registry.npmjs.org"
48
35
  },