@canva/error 1.1.0 → 1.2.0

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.
package/index.d.ts CHANGED
@@ -53,6 +53,10 @@ export declare type ErrorCode =
53
53
  * The caller does not have sufficient permissions to execute the specified operation.
54
54
  */
55
55
  | "PERMISSION_DENIED"
56
+ /**
57
+ * The specified operation is not supported on the surface.
58
+ */
59
+ | "UNSUPPORTED_SURFACE"
56
60
  /**
57
61
  * The user is currently offline and cannot perform the requested operation.
58
62
  */
@@ -1,19 +1,21 @@
1
+ // must use relative paths
1
2
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./public"), exports);
18
- // purposefully not exporting `BaseCanvaError` from '../.../api/error/api' since we want to export
19
- // the actual CanvaError class, and not the interface, to allow apps to do instanceof checks
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ _export_star(require("./public"), exports);
7
+ function _export_star(from, to) {
8
+ Object.keys(from).forEach(function(k) {
9
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
10
+ Object.defineProperty(to, k, {
11
+ enumerable: true,
12
+ get: function() {
13
+ return from[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ return from;
19
+ }
20
+ // purposefully not exporting `BaseCanvaError` from '../.../api/error/api' since we want to export
21
+ // the actual CanvaError class, and not the interface, to allow apps to do instanceof checks
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CanvaError = void 0;
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "CanvaError", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return CanvaError;
9
+ }
10
+ });
4
11
  const { canva } = window;
5
- /**
6
- * @public
7
- * Base Error thrown by Apps SDK methods
8
- */
9
- exports.CanvaError = canva.CanvaError;
12
+ const CanvaError = canva.CanvaError;
@@ -1,3 +1,3 @@
1
- export * from './public';
2
- // purposefully not exporting `BaseCanvaError` from '../.../api/error/api' since we want to export
3
- // the actual CanvaError class, and not the interface, to allow apps to do instanceof checks
1
+ // must use relative paths
2
+ export * from './public'; // purposefully not exporting `BaseCanvaError` from '../.../api/error/api' since we want to export
3
+ // the actual CanvaError class, and not the interface, to allow apps to do instanceof checks
@@ -2,5 +2,4 @@ const { canva } = window;
2
2
  /**
3
3
  * @public
4
4
  * Base Error thrown by Apps SDK methods
5
- */
6
- export const CanvaError = canva.CanvaError;
5
+ */ export const CanvaError = canva.CanvaError;
package/package.json CHANGED
@@ -1,16 +1,21 @@
1
1
  {
2
2
  "name": "@canva/error",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "The Canva Apps SDK error library",
5
5
  "author": "Canva Pty Ltd.",
6
6
  "license": "SEE LICENSE IN LICENSE.md FILE",
7
- "private": false,
8
- "main": "lib/cjs/sdk/error/index.js",
9
- "module": "lib/esm/sdk/error/index.js",
7
+ "main": "./lib/cjs/sdk/error/index.js",
8
+ "module": "./lib/esm/sdk/error/index.js",
10
9
  "exports": {
11
10
  ".": {
12
- "require": "./lib/cjs/sdk/error/index.js",
13
- "import": "./lib/esm/sdk/error/index.js"
11
+ "require": {
12
+ "types": "./index.d.ts",
13
+ "default": "./lib/cjs/sdk/error/index.js"
14
+ },
15
+ "import": {
16
+ "types": "./index.d.ts",
17
+ "default": "./lib/esm/sdk/error/index.js"
18
+ }
14
19
  }
15
20
  },
16
21
  "typings": "./index.d.ts"