@pushwoosh/rpc-v2-http-api-data 0.2.382 → 0.2.385

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.
Files changed (3) hide show
  1. package/canva.d.ts +50 -0
  2. package/data.js +112 -0
  3. package/package.json +1 -1
package/canva.d.ts CHANGED
@@ -1,13 +1,63 @@
1
1
  import { RpcMethod } from './commonTypes';
2
+ import { MediaFile as pushwoosh_rpc_v2_media_files_MediaFile } from './media_files';
3
+ export type CanvaService_GetStatus = RpcMethod<GetCanvaStatusRequest, GetCanvaStatusResponse>;
2
4
  export type CanvaService_ListDesigns = RpcMethod<ListCanvaDesignsRequest, ListCanvaDesignsResponse>;
5
+ export type CanvaService_StartImport = RpcMethod<StartCanvaImportRequest, StartCanvaImportResponse>;
6
+ export type CanvaService_GetImport = RpcMethod<GetCanvaImportRequest, GetCanvaImportResponse>;
3
7
  /**
4
8
  * CanvaService reads the calling user's own Canva designs for the Media Library import. The user
5
9
  * connects Canva once through the OAuth integration endpoints with provider "canva".
6
10
  */
7
11
  export interface CanvaService {
12
+ /** Tells whether Canva import is available to the calling user and whether that user has connected Canva, without calling Canva. Use to decide whether to show the import entry point and the connect step. */
13
+ GetStatus: CanvaService_GetStatus;
8
14
  /** Lists the calling user's Canva designs, newest edited first, optionally filtered by a title search; pass continuation from the previous page to read the next. Needs that user's own Canva connection and a signed-in user: API tokens are refused, because a Canva grant opens one person's designs. */
9
15
  ListDesigns: CanvaService_ListDesigns;
16
+ /** Starts importing pages of the user's Canva design into an application's Media Library as images. Spends one Canva export of the integration's shared daily quota; poll get_canva_import with the returned id until it is done or failed. */
17
+ StartImport: CanvaService_StartImport;
18
+ /** Advances and reports a Canva import: waits for the export, then stores the pages in the Media Library a few per call. Poll until state is done (files hold the stored images) or failed (error says why). */
19
+ GetImport: CanvaService_GetImport;
10
20
  }
21
+ export type CanvaImportFormat = 'CANVA_IMPORT_FORMAT_UNSPECIFIED' | 'CANVA_IMPORT_FORMAT_PNG' | 'CANVA_IMPORT_FORMAT_JPG';
22
+ export type CanvaImportState = 'CANVA_IMPORT_STATE_UNSPECIFIED'
23
+ /** Canva is rendering the export. */
24
+ | 'CANVA_IMPORT_STATE_EXPORTING'
25
+ /** The pages are being stored in the Media Library. */
26
+ | 'CANVA_IMPORT_STATE_UPLOADING' | 'CANVA_IMPORT_STATE_DONE' | 'CANVA_IMPORT_STATE_FAILED';
27
+ export type StartCanvaImportRequest = {
28
+ /** Application code (format XXXXX-XXXXX) whose Media Library receives the images. */
29
+ application?: string;
30
+ designId?: string;
31
+ /** 1-based page numbers, at most 10; empty imports page 1. */
32
+ pages?: number[];
33
+ /** PNG when unset. */
34
+ format?: CanvaImportFormat;
35
+ };
36
+ export type StartCanvaImportResponse = {
37
+ importId: string;
38
+ };
39
+ export type GetCanvaImportRequest = {
40
+ importId?: string;
41
+ };
42
+ export type GetCanvaImportResponse = {
43
+ state: CanvaImportState;
44
+ pagesTotal: number;
45
+ pagesDone: number;
46
+ /** Stored images in page order, filled as pages land. */
47
+ files: pushwoosh_rpc_v2_media_files_MediaFile[];
48
+ /** Why the import failed, readable by the user; empty otherwise. */
49
+ error: string;
50
+ };
51
+ export type GetCanvaStatusRequest = {};
52
+ export type GetCanvaStatusResponse = {
53
+ /** False when Canva is off in this region, the account is not in the beta, or the caller is not a signed-in user. */
54
+ available: boolean;
55
+ connected: boolean;
56
+ /** The Canva display name of the connection. */
57
+ identity: string;
58
+ /** False when Canva rejected the stored grant: connect again. */
59
+ tokenValid: boolean;
60
+ };
11
61
  export type ListCanvaDesignsRequest = {
12
62
  /** Title search; empty lists every design the user can access. */
13
63
  query?: string;
package/data.js CHANGED
@@ -8750,11 +8750,123 @@ export const data = {
8750
8750
  "type": "S",
8751
8751
  "key": "canva",
8752
8752
  "methods": {
8753
+ "GetStatus": {
8754
+ "request": "pushwoosh.rpc_v2.canva.GetCanvaStatusRequest",
8755
+ "response": "pushwoosh.rpc_v2.canva.GetCanvaStatusResponse",
8756
+ "method": "get",
8757
+ "path": "/api/canva/status"
8758
+ },
8753
8759
  "ListDesigns": {
8754
8760
  "request": "pushwoosh.rpc_v2.canva.ListCanvaDesignsRequest",
8755
8761
  "response": "pushwoosh.rpc_v2.canva.ListCanvaDesignsResponse",
8756
8762
  "method": "get",
8757
8763
  "path": "/api/canva/designs"
8764
+ },
8765
+ "StartImport": {
8766
+ "request": "pushwoosh.rpc_v2.canva.StartCanvaImportRequest",
8767
+ "response": "pushwoosh.rpc_v2.canva.StartCanvaImportResponse",
8768
+ "method": "post",
8769
+ "path": "/api/canva/imports"
8770
+ },
8771
+ "GetImport": {
8772
+ "request": "pushwoosh.rpc_v2.canva.GetCanvaImportRequest",
8773
+ "response": "pushwoosh.rpc_v2.canva.GetCanvaImportResponse",
8774
+ "method": "get",
8775
+ "path": "/api/canva/imports/{import_id}"
8776
+ }
8777
+ }
8778
+ },
8779
+ "pushwoosh.rpc_v2.canva.CanvaImportFormat": {
8780
+ "type": "E",
8781
+ "values": [
8782
+ "CANVA_IMPORT_FORMAT_UNSPECIFIED",
8783
+ "CANVA_IMPORT_FORMAT_PNG",
8784
+ "CANVA_IMPORT_FORMAT_JPG"
8785
+ ]
8786
+ },
8787
+ "pushwoosh.rpc_v2.canva.CanvaImportState": {
8788
+ "type": "E",
8789
+ "values": [
8790
+ "CANVA_IMPORT_STATE_UNSPECIFIED",
8791
+ "CANVA_IMPORT_STATE_EXPORTING",
8792
+ "CANVA_IMPORT_STATE_UPLOADING",
8793
+ "CANVA_IMPORT_STATE_DONE",
8794
+ "CANVA_IMPORT_STATE_FAILED"
8795
+ ]
8796
+ },
8797
+ "pushwoosh.rpc_v2.canva.StartCanvaImportRequest": {
8798
+ "type": "I",
8799
+ "fields": {
8800
+ "application": {
8801
+ "type": "string"
8802
+ },
8803
+ "designId": {
8804
+ "type": "string"
8805
+ },
8806
+ "pages": {
8807
+ "type": "number",
8808
+ "array": true
8809
+ },
8810
+ "format": {
8811
+ "type": "pushwoosh.rpc_v2.canva.CanvaImportFormat"
8812
+ }
8813
+ }
8814
+ },
8815
+ "pushwoosh.rpc_v2.canva.StartCanvaImportResponse": {
8816
+ "type": "I",
8817
+ "fields": {
8818
+ "importId": {
8819
+ "type": "string"
8820
+ }
8821
+ }
8822
+ },
8823
+ "pushwoosh.rpc_v2.canva.GetCanvaImportRequest": {
8824
+ "type": "I",
8825
+ "fields": {
8826
+ "importId": {
8827
+ "type": "string"
8828
+ }
8829
+ }
8830
+ },
8831
+ "pushwoosh.rpc_v2.canva.GetCanvaImportResponse": {
8832
+ "type": "I",
8833
+ "fields": {
8834
+ "state": {
8835
+ "type": "pushwoosh.rpc_v2.canva.CanvaImportState"
8836
+ },
8837
+ "pagesTotal": {
8838
+ "type": "number"
8839
+ },
8840
+ "pagesDone": {
8841
+ "type": "number"
8842
+ },
8843
+ "files": {
8844
+ "type": "pushwoosh.rpc_v2.media_files.MediaFile",
8845
+ "array": true
8846
+ },
8847
+ "error": {
8848
+ "type": "string"
8849
+ }
8850
+ }
8851
+ },
8852
+ "pushwoosh.rpc_v2.canva.GetCanvaStatusRequest": {
8853
+ "type": "I",
8854
+ "fields": {}
8855
+ },
8856
+ "pushwoosh.rpc_v2.canva.GetCanvaStatusResponse": {
8857
+ "type": "I",
8858
+ "fields": {
8859
+ "available": {
8860
+ "type": "boolean"
8861
+ },
8862
+ "connected": {
8863
+ "type": "boolean"
8864
+ },
8865
+ "identity": {
8866
+ "type": "string"
8867
+ },
8868
+ "tokenValid": {
8869
+ "type": "boolean"
8758
8870
  }
8759
8871
  }
8760
8872
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.382",
3
+ "version": "0.2.385",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",