@pushwoosh/rpc-v2-http-api-data 0.2.389 → 0.2.390

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/data.js CHANGED
@@ -30744,6 +30744,128 @@ export const data = {
30744
30744
  }
30745
30745
  }
30746
30746
  },
30747
+ "pushwoosh.rpc_v2.plugin_auth.PluginAuthService": {
30748
+ "type": "S",
30749
+ "key": "pluginAuth",
30750
+ "methods": {
30751
+ "GetSession": {
30752
+ "request": "pushwoosh.rpc_v2.plugin_auth.GetPluginSessionRequest",
30753
+ "response": "pushwoosh.rpc_v2.plugin_auth.GetPluginSessionResponse",
30754
+ "method": "get",
30755
+ "path": "/api/plugin-connections/sessions/{user_code}"
30756
+ },
30757
+ "ApproveSession": {
30758
+ "request": "pushwoosh.rpc_v2.plugin_auth.ApprovePluginSessionRequest",
30759
+ "response": "pushwoosh.rpc_v2.plugin_auth.ApprovePluginSessionResponse",
30760
+ "method": "post",
30761
+ "path": "/api/plugin-connections/sessions/{user_code}/approve"
30762
+ },
30763
+ "ListConnections": {
30764
+ "request": "pushwoosh.rpc_v2.plugin_auth.ListPluginConnectionsRequest",
30765
+ "response": "pushwoosh.rpc_v2.plugin_auth.ListPluginConnectionsResponse",
30766
+ "method": "get",
30767
+ "path": "/api/plugin-connections"
30768
+ },
30769
+ "RevokeConnection": {
30770
+ "request": "pushwoosh.rpc_v2.plugin_auth.RevokePluginConnectionRequest",
30771
+ "response": "pushwoosh.rpc_v2.plugin_auth.RevokePluginConnectionResponse",
30772
+ "method": "delete",
30773
+ "path": "/api/plugin-connections/{id}"
30774
+ }
30775
+ }
30776
+ },
30777
+ "pushwoosh.rpc_v2.plugin_auth.GetPluginSessionRequest": {
30778
+ "type": "I",
30779
+ "fields": {
30780
+ "userCode": {
30781
+ "type": "string"
30782
+ }
30783
+ }
30784
+ },
30785
+ "pushwoosh.rpc_v2.plugin_auth.GetPluginSessionResponse": {
30786
+ "type": "I",
30787
+ "fields": {
30788
+ "client": {
30789
+ "type": "string"
30790
+ },
30791
+ "createdAt": {
30792
+ "type": "Date"
30793
+ },
30794
+ "ip": {
30795
+ "type": "string"
30796
+ },
30797
+ "userAgent": {
30798
+ "type": "string"
30799
+ }
30800
+ }
30801
+ },
30802
+ "pushwoosh.rpc_v2.plugin_auth.ApprovePluginSessionRequest": {
30803
+ "type": "I",
30804
+ "fields": {
30805
+ "userCode": {
30806
+ "type": "string"
30807
+ }
30808
+ }
30809
+ },
30810
+ "pushwoosh.rpc_v2.plugin_auth.ApprovePluginSessionResponse": {
30811
+ "type": "I",
30812
+ "fields": {
30813
+ "connection": {
30814
+ "type": "pushwoosh.rpc_v2.plugin_auth.PluginConnection"
30815
+ }
30816
+ }
30817
+ },
30818
+ "pushwoosh.rpc_v2.plugin_auth.ListPluginConnectionsRequest": {
30819
+ "type": "I",
30820
+ "fields": {}
30821
+ },
30822
+ "pushwoosh.rpc_v2.plugin_auth.ListPluginConnectionsResponse": {
30823
+ "type": "I",
30824
+ "fields": {
30825
+ "connections": {
30826
+ "type": "pushwoosh.rpc_v2.plugin_auth.PluginConnection",
30827
+ "array": true
30828
+ }
30829
+ }
30830
+ },
30831
+ "pushwoosh.rpc_v2.plugin_auth.RevokePluginConnectionRequest": {
30832
+ "type": "I",
30833
+ "fields": {
30834
+ "id": {
30835
+ "type": "string"
30836
+ }
30837
+ }
30838
+ },
30839
+ "pushwoosh.rpc_v2.plugin_auth.RevokePluginConnectionResponse": {
30840
+ "type": "I",
30841
+ "fields": {}
30842
+ },
30843
+ "pushwoosh.rpc_v2.plugin_auth.PluginConnection": {
30844
+ "type": "I",
30845
+ "fields": {
30846
+ "id": {
30847
+ "type": "string"
30848
+ },
30849
+ "client": {
30850
+ "type": "string"
30851
+ },
30852
+ "createdAt": {
30853
+ "type": "Date"
30854
+ },
30855
+ "lastUsedAt": {
30856
+ "type": "Date"
30857
+ },
30858
+ "expiresAt": {
30859
+ "type": "Date"
30860
+ },
30861
+ "ip": {
30862
+ "type": "string"
30863
+ },
30864
+ "userAgent": {
30865
+ "type": "string"
30866
+ }
30867
+ }
30868
+ },
30747
30869
  "pushwoosh.rpc.popup_forms.v3.PopupFormsServiceErrors": {
30748
30870
  "type": "E",
30749
30871
  "values": [
package/index.d.ts CHANGED
@@ -55,6 +55,7 @@ import { MediaFilesService as pushwoosh_rpc_v2_media_files_MediaFilesService } f
55
55
  import { MessagesService as pushwoosh_rpc_v2_messages_MessagesService } from './messages';
56
56
  import { NewsService as pushwoosh_rpc_v2_news_NewsService } from './news';
57
57
  import { RestrictionValuesCrudService as pushwoosh_objects_restrictionValues_v1_RestrictionValuesCrudService } from './pushwoosh_objects_restrictionValues_v1';
58
+ import { PluginAuthService as pushwoosh_rpc_v2_plugin_auth_PluginAuthService } from './plugin_auth';
58
59
  import { PopupFormsService as pushwoosh_rpc_popup_forms_v3_PopupFormsService } from './pushwoosh_rpc_popup_forms_v3';
59
60
  import { PopupFormsContentsService as pushwoosh_rpc_popup_forms_contents_v3_PopupFormsContentsService } from './pushwoosh_rpc_popup_forms_contents_v3';
60
61
  import { presetsService as pushwoosh_rpc_v2_presets_presetsService } from './presets';
@@ -135,6 +136,7 @@ export type API = {
135
136
  messages: pushwoosh_rpc_v2_messages_MessagesService;
136
137
  news: pushwoosh_rpc_v2_news_NewsService;
137
138
  restrictionValuesCrud: pushwoosh_objects_restrictionValues_v1_RestrictionValuesCrudService;
139
+ pluginAuth: pushwoosh_rpc_v2_plugin_auth_PluginAuthService;
138
140
  popupForms: pushwoosh_rpc_popup_forms_v3_PopupFormsService;
139
141
  popupFormsContents: pushwoosh_rpc_popup_forms_contents_v3_PopupFormsContentsService;
140
142
  presets: pushwoosh_rpc_v2_presets_presetsService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.389",
3
+ "version": "0.2.390",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -0,0 +1,60 @@
1
+ import { RpcMethod } from './commonTypes';
2
+ export type PluginAuthService_GetSession = RpcMethod<GetPluginSessionRequest, GetPluginSessionResponse>;
3
+ export type PluginAuthService_ApproveSession = RpcMethod<ApprovePluginSessionRequest, ApprovePluginSessionResponse>;
4
+ export type PluginAuthService_ListConnections = RpcMethod<ListPluginConnectionsRequest, ListPluginConnectionsResponse>;
5
+ export type PluginAuthService_RevokeConnection = RpcMethod<RevokePluginConnectionRequest, RevokePluginConnectionResponse>;
6
+ /**
7
+ * PluginAuthService connects the Figma plugin to a signed-in user: the user enters the code the plugin
8
+ * shows, and the plugin gets its own token, accepted only by the plugin endpoints, never an SSO token.
9
+ */
10
+ export interface PluginAuthService {
11
+ /** Describes a pending plugin sign-in by the code the plugin shows: which plugin, when and from where it started. Use to show the consent screen before approve_plugin_session. Signed-in users only. */
12
+ GetSession: PluginAuthService_GetSession;
13
+ /** Approves a pending plugin sign-in by its code, giving that plugin a token that can list the user's applications and upload images to their Media Library. Signed-in users only; a code works once. */
14
+ ApproveSession: PluginAuthService_ApproveSession;
15
+ /** Lists the plugins the calling user has connected, newest first. Use for the connected apps settings page. */
16
+ ListConnections: PluginAuthService_ListConnections;
17
+ /** Disconnects one of the calling user's plugins: its token stops working at once and the plugin asks to sign in again. */
18
+ RevokeConnection: PluginAuthService_RevokeConnection;
19
+ }
20
+ export type GetPluginSessionRequest = {
21
+ /** Code the plugin shows, e.g. "BCDF-2345"; case, spaces and the dash are ignored. */
22
+ userCode?: string;
23
+ };
24
+ export type GetPluginSessionResponse = {
25
+ /** Plugin that started the sign-in, e.g. "figma". */
26
+ client: string;
27
+ createdAt: Date;
28
+ /** Address the plugin started the sign-in from, to compare with the user's own. */
29
+ ip: string;
30
+ userAgent: string;
31
+ };
32
+ export type ApprovePluginSessionRequest = {
33
+ /** Code the plugin shows, e.g. "BCDF-2345"; case, spaces and the dash are ignored. */
34
+ userCode?: string;
35
+ };
36
+ export type ApprovePluginSessionResponse = {
37
+ connection: PluginConnection;
38
+ };
39
+ export type ListPluginConnectionsRequest = {};
40
+ export type ListPluginConnectionsResponse = {
41
+ connections: PluginConnection[];
42
+ };
43
+ export type RevokePluginConnectionRequest = {
44
+ /** Connection id from list_plugin_connections. */
45
+ id?: string;
46
+ };
47
+ export type RevokePluginConnectionResponse = {};
48
+ /** PluginConnection is one plugin token of the user; the token itself is never shown again. */
49
+ export type PluginConnection = {
50
+ id: string;
51
+ /** Plugin holding the token, e.g. "figma". */
52
+ client: string;
53
+ createdAt: Date;
54
+ lastUsedAt: Date;
55
+ /** The token stops working at this time unless used before; it never outlives created_at plus 90 days. */
56
+ expiresAt: Date;
57
+ /** Address and user agent of the sign-in. */
58
+ ip: string;
59
+ userAgent: string;
60
+ };
package/plugin_auth.js ADDED
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ /* Autogenerated code */
3
+ export {};