@canva/intents 2.2.0 → 2.2.1-beta.1
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/CHANGELOG.md +18 -18
- package/asset/beta.d.ts +190 -0
- package/asset/index.d.ts +1 -1
- package/beta.d.ts +2963 -0
- package/content/beta.d.ts +1567 -0
- package/content/index.d.ts +1 -1510
- package/data/beta.d.ts +1229 -0
- package/data/index.d.ts +1 -1229
- package/design/beta.d.ts +41 -0
- package/design/index.d.ts +1 -41
- package/index.d.ts +1 -2895
- package/lib/cjs/sdk/intents/asset/beta.js +13 -0
- package/lib/cjs/sdk/intents/asset/index.js +15 -1
- package/lib/cjs/sdk/intents/beta.js +20 -0
- package/lib/cjs/sdk/intents/content/beta.js +27 -0
- package/lib/cjs/sdk/intents/content/public.js +0 -1
- package/lib/cjs/sdk/intents/data/beta.js +20 -0
- package/lib/cjs/sdk/intents/data/public.js +0 -1
- package/lib/cjs/sdk/intents/design/beta.js +20 -0
- package/lib/cjs/sdk/intents/design/public.js +0 -1
- package/lib/cjs/sdk/intents/fake/{create.js → create_beta.js} +9 -6
- package/lib/cjs/sdk/intents/index.js +2 -4
- package/lib/cjs/sdk/intents/test/beta.js +19 -0
- package/lib/cjs/sdk/intents/test/index.js +13 -14
- package/lib/cjs/sdk/intents/version.js +1 -1
- package/lib/esm/sdk/intents/asset/beta.js +3 -0
- package/lib/esm/sdk/intents/asset/index.js +1 -1
- package/lib/esm/sdk/intents/beta.js +3 -0
- package/lib/esm/sdk/intents/content/beta.js +4 -0
- package/lib/esm/sdk/intents/content/public.js +0 -1
- package/lib/esm/sdk/intents/data/beta.js +3 -0
- package/lib/esm/sdk/intents/data/public.js +0 -1
- package/lib/esm/sdk/intents/design/beta.js +3 -0
- package/lib/esm/sdk/intents/design/public.js +0 -1
- package/lib/esm/sdk/intents/fake/{create.js → create_beta.js} +7 -4
- package/lib/esm/sdk/intents/index.js +1 -3
- package/lib/esm/sdk/intents/test/beta.js +9 -0
- package/lib/esm/sdk/intents/test/index.js +1 -9
- package/lib/esm/sdk/intents/version.js +1 -1
- package/package.json +23 -23
- package/test/beta.d.ts +11 -0
- package/test/index.d.ts +1 -11
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "prepareUrlExpander", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return prepareUrlExpander;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _version = require("../version");
|
|
12
|
+
const prepareUrlExpander = canva_sdk.intents.v1.asset.prepareUrlExpander;
|
|
13
|
+
window.__canva__?.sdkRegistration?.registerPackageVersion('intents/asset', _version.LATEST_VERSION_BETA, 'beta');
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
_export_star(require("./beta"), exports);
|
|
6
|
+
function _export_star(from, to) {
|
|
7
|
+
Object.keys(from).forEach(function(k) {
|
|
8
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
+
Object.defineProperty(to, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return from[k];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return from;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _version = require("./version");
|
|
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
|
+
window.__canva__?.sdkRegistration?.registerPackageVersion('intents', _version.LATEST_VERSION_BETA, 'beta');
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "prepareContentPublisher", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return prepareContentPublisher;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _version = require("../version");
|
|
12
|
+
_export_star(require("./public"), exports);
|
|
13
|
+
function _export_star(from, to) {
|
|
14
|
+
Object.keys(from).forEach(function(k) {
|
|
15
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
16
|
+
Object.defineProperty(to, k, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return from[k];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return from;
|
|
25
|
+
}
|
|
26
|
+
const prepareContentPublisher = canva_sdk.intents.v1.content.prepareContentPublisher;
|
|
27
|
+
window.__canva__?.sdkRegistration?.registerPackageVersion('intents/content', _version.LATEST_VERSION_BETA, 'beta');
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _version = require("../version");
|
|
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
|
+
window.__canva__?.sdkRegistration?.registerPackageVersion('intents/data', _version.LATEST_VERSION_BETA, 'beta');
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _version = require("../version");
|
|
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
|
+
window.__canva__?.sdkRegistration?.registerPackageVersion('intents/design', _version.LATEST_VERSION_BETA, 'beta');
|
|
@@ -2,24 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "createBetaFakeIntentsClients", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return createBetaFakeIntentsClients;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
function
|
|
11
|
+
function createBetaFakeIntentsClients() {
|
|
12
12
|
return {
|
|
13
13
|
intents: {
|
|
14
14
|
v1: {
|
|
15
|
+
asset: {
|
|
16
|
+
prepareUrlExpander: ()=>{}
|
|
17
|
+
},
|
|
18
|
+
content: {
|
|
19
|
+
prepareContentPublisher: ()=>{}
|
|
20
|
+
},
|
|
15
21
|
design: {
|
|
16
22
|
prepareDesignEditor: ()=>{}
|
|
17
23
|
},
|
|
18
24
|
data: {
|
|
19
25
|
prepareDataConnector: ()=>{}
|
|
20
|
-
},
|
|
21
|
-
content: {
|
|
22
|
-
prepareContentPublisher: ()=>{}
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
_export_star(require("./public"), exports);
|
|
5
|
+
_export_star(require("./beta"), exports);
|
|
7
6
|
function _export_star(from, to) {
|
|
8
7
|
Object.keys(from).forEach(function(k) {
|
|
9
8
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -17,4 +16,3 @@ function _export_star(from, to) {
|
|
|
17
16
|
});
|
|
18
17
|
return from;
|
|
19
18
|
}
|
|
20
|
-
window.__canva__?.sdkRegistration?.registerPackageVersion('intents', _version.LATEST_VERSION, 'ga');
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "initTestEnvironment", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return initTestEnvironment;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _create_beta = require('../fake/create_beta');
|
|
12
|
+
const _canva_sdk = require('../../utils/canva_sdk');
|
|
13
|
+
function initTestEnvironment() {
|
|
14
|
+
(0, _canva_sdk.assertIsTestCanvaSdk)();
|
|
15
|
+
const fakeClients = (0, _create_beta.createBetaFakeIntentsClients)();
|
|
16
|
+
(0, _canva_sdk.injectFakeAPIClients)({
|
|
17
|
+
intents: fakeClients.intents
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(0, _canva_sdk.injectFakeAPIClients)({
|
|
17
|
-
intents: fakeClients.intents
|
|
5
|
+
_export_star(require("./beta"), exports);
|
|
6
|
+
function _export_star(from, to) {
|
|
7
|
+
Object.keys(from).forEach(function(k) {
|
|
8
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
+
Object.defineProperty(to, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return from[k];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
18
16
|
});
|
|
17
|
+
return from;
|
|
19
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './beta';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LATEST_VERSION_BETA } from '../version';
|
|
2
|
+
export * from './public';
|
|
3
|
+
export const prepareContentPublisher = canva_sdk.intents.v1.content.prepareContentPublisher;
|
|
4
|
+
window.__canva__?.sdkRegistration?.registerPackageVersion('intents/content', LATEST_VERSION_BETA, 'beta');
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function createBetaFakeIntentsClients() {
|
|
2
2
|
return {
|
|
3
3
|
intents: {
|
|
4
4
|
v1: {
|
|
5
|
+
asset: {
|
|
6
|
+
prepareUrlExpander: ()=>{}
|
|
7
|
+
},
|
|
8
|
+
content: {
|
|
9
|
+
prepareContentPublisher: ()=>{}
|
|
10
|
+
},
|
|
5
11
|
design: {
|
|
6
12
|
prepareDesignEditor: ()=>{}
|
|
7
13
|
},
|
|
8
14
|
data: {
|
|
9
15
|
prepareDataConnector: ()=>{}
|
|
10
|
-
},
|
|
11
|
-
content: {
|
|
12
|
-
prepareContentPublisher: ()=>{}
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
18
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createBetaFakeIntentsClients } from '../fake/create_beta';
|
|
2
|
+
import { assertIsTestCanvaSdk, injectFakeAPIClients } from '../../utils/canva_sdk';
|
|
3
|
+
export function initTestEnvironment() {
|
|
4
|
+
assertIsTestCanvaSdk();
|
|
5
|
+
const fakeClients = createBetaFakeIntentsClients();
|
|
6
|
+
injectFakeAPIClients({
|
|
7
|
+
intents: fakeClients.intents
|
|
8
|
+
});
|
|
9
|
+
}
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { assertIsTestCanvaSdk, injectFakeAPIClients } from '../../utils/canva_sdk';
|
|
3
|
-
export function initTestEnvironment() {
|
|
4
|
-
assertIsTestCanvaSdk();
|
|
5
|
-
const fakeClients = createFakeIntentsClients();
|
|
6
|
-
injectFakeAPIClients({
|
|
7
|
-
intents: fakeClients.intents
|
|
8
|
-
});
|
|
9
|
-
}
|
|
1
|
+
export * from './beta';
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canva/intents",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1-beta.1",
|
|
4
4
|
"description": "The Canva Apps SDK Intents library",
|
|
5
5
|
"author": "Canva Pty Ltd.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md FILE",
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@canva/error": "^2.0.0"
|
|
9
9
|
},
|
|
10
|
-
"main": "./lib/cjs/sdk/intents/
|
|
11
|
-
"module": "./lib/esm/sdk/intents/
|
|
10
|
+
"main": "./lib/cjs/sdk/intents/beta.js",
|
|
11
|
+
"module": "./lib/esm/sdk/intents/beta.js",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./
|
|
15
|
-
"require": "./lib/cjs/sdk/intents/
|
|
16
|
-
"import": "./lib/esm/sdk/intents/
|
|
14
|
+
"types": "./beta.d.ts",
|
|
15
|
+
"require": "./lib/cjs/sdk/intents/beta.js",
|
|
16
|
+
"import": "./lib/esm/sdk/intents/beta.js"
|
|
17
17
|
},
|
|
18
18
|
"./test": {
|
|
19
|
-
"types": "./test/
|
|
20
|
-
"require": "./lib/cjs/sdk/intents/test/
|
|
21
|
-
"import": "./lib/esm/sdk/intents/test/
|
|
19
|
+
"types": "./test/beta.d.ts",
|
|
20
|
+
"require": "./lib/cjs/sdk/intents/test/beta.js",
|
|
21
|
+
"import": "./lib/esm/sdk/intents/test/beta.js"
|
|
22
22
|
},
|
|
23
23
|
"./data": {
|
|
24
|
-
"types": "./data/
|
|
25
|
-
"require": "./lib/cjs/sdk/intents/data/
|
|
26
|
-
"import": "./lib/esm/sdk/intents/data/
|
|
24
|
+
"types": "./data/beta.d.ts",
|
|
25
|
+
"require": "./lib/cjs/sdk/intents/data/beta.js",
|
|
26
|
+
"import": "./lib/esm/sdk/intents/data/beta.js"
|
|
27
27
|
},
|
|
28
28
|
"./design": {
|
|
29
|
-
"types": "./design/
|
|
30
|
-
"require": "./lib/cjs/sdk/intents/design/
|
|
31
|
-
"import": "./lib/esm/sdk/intents/design/
|
|
29
|
+
"types": "./design/beta.d.ts",
|
|
30
|
+
"require": "./lib/cjs/sdk/intents/design/beta.js",
|
|
31
|
+
"import": "./lib/esm/sdk/intents/design/beta.js"
|
|
32
32
|
},
|
|
33
33
|
"./asset": {
|
|
34
|
-
"types": "./asset/
|
|
35
|
-
"require": "./lib/cjs/sdk/intents/asset/
|
|
36
|
-
"import": "./lib/esm/sdk/intents/asset/
|
|
34
|
+
"types": "./asset/beta.d.ts",
|
|
35
|
+
"require": "./lib/cjs/sdk/intents/asset/beta.js",
|
|
36
|
+
"import": "./lib/esm/sdk/intents/asset/beta.js"
|
|
37
37
|
},
|
|
38
38
|
"./content": {
|
|
39
|
-
"types": "./content/
|
|
40
|
-
"require": "./lib/cjs/sdk/intents/content/
|
|
41
|
-
"import": "./lib/esm/sdk/intents/content/
|
|
39
|
+
"types": "./content/beta.d.ts",
|
|
40
|
+
"require": "./lib/cjs/sdk/intents/content/beta.js",
|
|
41
|
+
"import": "./lib/esm/sdk/intents/content/beta.js"
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"typings": "./
|
|
45
|
-
}
|
|
44
|
+
"typings": "./beta.d.ts"
|
|
45
|
+
}
|
package/test/beta.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @beta
|
|
3
|
+
* Initializes a test environment for the `@canva/intents` package, enabling unit tests to mock Canva's APIs.
|
|
4
|
+
* @remarks
|
|
5
|
+
* This method should only be called once in a test environment, such as in a Jest setup file.
|
|
6
|
+
* @see
|
|
7
|
+
* https://www.canva.dev/docs/apps/testing/
|
|
8
|
+
*/
|
|
9
|
+
export declare function initTestEnvironment(): void;
|
|
10
|
+
|
|
11
|
+
export { }
|
package/test/index.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* @public
|
|
3
|
-
* Initializes a test environment for the `@canva/intents` package, enabling unit tests to mock Canva's APIs.
|
|
4
|
-
* @remarks
|
|
5
|
-
* This method should only be called once in a test environment, such as in a Jest setup file.
|
|
6
|
-
* @see
|
|
7
|
-
* https://www.canva.dev/docs/apps/testing/
|
|
8
|
-
*/
|
|
9
|
-
export declare function initTestEnvironment(): void;
|
|
10
|
-
|
|
11
|
-
export { }
|
|
1
|
+
export * from "./beta";
|