@withone/connect 0.14.0 → 0.16.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/README.md +229 -59
- package/dist/button.d.ts +0 -2
- package/dist/flow.d.ts +0 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -7
- package/dist/index.esm.js +1 -1
- package/dist/next.cjs.js +10 -0
- package/dist/next.d.ts +10 -1
- package/dist/next.esm.js +10 -0
- package/dist/node.cjs.js +17 -13
- package/dist/node.d.ts +6 -1
- package/dist/node.esm.js +17 -13
- package/dist/platforms.d.ts +1 -1
- package/dist/react.cjs.js +1 -1
- package/dist/react.esm.js +1 -1
- package/dist/server/types.d.ts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/types.d.ts +19 -16
- package/dist/vue.cjs.js +1 -1
- package/dist/vue.d.ts +15 -24
- package/dist/vue.esm.js +1 -1
- package/package.json +1 -1
- package/skills/one-connect/SKILL.md +108 -52
- package/src/button.ts +11 -78
- package/src/flow.ts +1 -7
- package/src/index.ts +3 -6
- package/src/next.ts +17 -1
- package/src/node.ts +23 -15
- package/src/platforms.ts +1 -1
- package/src/react.ts +2 -3
- package/src/server/types.ts +1 -1
- package/src/svelte.ts +1 -1
- package/src/types.ts +20 -16
- package/src/vue.ts +7 -5
package/src/types.ts
CHANGED
|
@@ -31,8 +31,6 @@ export interface OneConnectFlowOptions {
|
|
|
31
31
|
/** Theme for One's hosted page. Carried on the URL fragment, which
|
|
32
32
|
* survives the redirect chain, so the backend forwards nothing. */
|
|
33
33
|
connectTheme?: OneConnectTheme;
|
|
34
|
-
/** @deprecated Renamed to `connectTheme`; removed in the next minor. */
|
|
35
|
-
appTheme?: OneConnectTheme;
|
|
36
34
|
/** The grant completed and the backend stored the tokens. Fires once
|
|
37
35
|
* per page load, on the first flow still mounted when the tab
|
|
38
36
|
* returns. Treat it as a hint to refetch: your server is the truth. */
|
|
@@ -62,20 +60,26 @@ export interface OneConnectReturn {
|
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
/**
|
|
65
|
-
* A
|
|
63
|
+
* A logo chip on the button. Pass One's connector slug ("stripe",
|
|
66
64
|
* "google-calendar") and the SDK shows its logo and name; pass an
|
|
67
|
-
* object to override either.
|
|
65
|
+
* object to override either. Decoration only: what One asks the user
|
|
66
|
+
* for comes from the app's permission set, not from this list.
|
|
68
67
|
*/
|
|
69
|
-
export type
|
|
68
|
+
export type ConnectButtonLogoInput =
|
|
70
69
|
string | { slug?: string; name?: string; imageUrl?: string };
|
|
71
70
|
|
|
72
71
|
/** A normalized chip: what the button actually draws. */
|
|
73
|
-
export interface
|
|
72
|
+
export interface ConnectButtonLogo {
|
|
74
73
|
slug: string;
|
|
75
74
|
name: string;
|
|
76
75
|
imageUrl: string;
|
|
77
76
|
}
|
|
78
77
|
|
|
78
|
+
/** @deprecated Renamed to `ConnectButtonLogoInput`; removed in 0.17.0. */
|
|
79
|
+
export type ConnectButtonPlatformInput = ConnectButtonLogoInput;
|
|
80
|
+
/** @deprecated Renamed to `ConnectButtonLogo`; removed in 0.17.0. */
|
|
81
|
+
export type ConnectButtonPlatform = ConnectButtonLogo;
|
|
82
|
+
|
|
79
83
|
export type ConnectButtonVariant = "default" | "accent" | "block";
|
|
80
84
|
export type ConnectButtonSize = "sm" | "md" | "lg";
|
|
81
85
|
export type ConnectButtonState = "idle" | "connecting" | "connected";
|
|
@@ -85,17 +89,22 @@ export type ConnectButtonState = "idle" | "connecting" | "connected";
|
|
|
85
89
|
export interface ConnectButtonProps {
|
|
86
90
|
/** The app's own backend authorize route; relative is fine. */
|
|
87
91
|
authorizeUrl: string;
|
|
88
|
-
/**
|
|
89
|
-
* The first three draw
|
|
90
|
-
|
|
92
|
+
/** Logos to draw on the button: connector slugs, or objects that
|
|
93
|
+
* override the name or the image. The first three draw; the rest fold
|
|
94
|
+
* into a "+N" chip. Decoration only; the permission set decides what
|
|
95
|
+
* One asks for. */
|
|
96
|
+
logos?: ConnectButtonLogoInput[];
|
|
97
|
+
/** @deprecated Renamed to `logos`; removed in 0.17.0. */
|
|
98
|
+
platforms?: ConnectButtonLogoInput[];
|
|
91
99
|
/** Whether this user has a live grant, from your server. When set, it
|
|
92
100
|
* decides the Connected state. When omitted, the button shows
|
|
93
101
|
* Connected only right after a successful return. */
|
|
94
102
|
connected?: boolean;
|
|
95
103
|
/** Not clickable, for example until terms are accepted. */
|
|
96
104
|
disabled?: boolean;
|
|
97
|
-
/** default = neutral, accent = your brand colour
|
|
98
|
-
*
|
|
105
|
+
/** default = neutral, accent = your brand colour (set
|
|
106
|
+
* `--one-connect-accent` and `--one-connect-accent-fg` on the host),
|
|
107
|
+
* block = a card with a description and a "Secured by One" foot. */
|
|
99
108
|
variant?: ConnectButtonVariant;
|
|
100
109
|
size?: ConnectButtonSize;
|
|
101
110
|
/** Stretches to the width of its container. */
|
|
@@ -104,11 +113,6 @@ export interface ConnectButtonProps {
|
|
|
104
113
|
theme?: ConnectButtonTheme;
|
|
105
114
|
/** Theme of One's hosted page. */
|
|
106
115
|
connectTheme?: OneConnectTheme;
|
|
107
|
-
/** @deprecated Renamed to `connectTheme`; removed in the next minor. */
|
|
108
|
-
appTheme?: OneConnectTheme;
|
|
109
|
-
/** Fill of the accent variant; One's lime when omitted. The label is
|
|
110
|
-
* black or white, whichever reads better on it. */
|
|
111
|
-
accentColor?: string;
|
|
112
116
|
/** "Connect your apps" unless set. */
|
|
113
117
|
label?: string;
|
|
114
118
|
/** "Connected" unless set. */
|
package/src/vue.ts
CHANGED
|
@@ -23,7 +23,7 @@ import type { PropType } from "vue";
|
|
|
23
23
|
import {
|
|
24
24
|
renderConnectButton,
|
|
25
25
|
type ConnectButtonHandle,
|
|
26
|
-
type
|
|
26
|
+
type ConnectButtonLogoInput,
|
|
27
27
|
type ConnectButtonProps,
|
|
28
28
|
type ConnectButtonSize,
|
|
29
29
|
type ConnectButtonTheme,
|
|
@@ -40,8 +40,13 @@ export const ConnectButton = defineComponent({
|
|
|
40
40
|
name: "OneConnectButton",
|
|
41
41
|
props: {
|
|
42
42
|
authorizeUrl: { type: String, required: true },
|
|
43
|
+
logos: {
|
|
44
|
+
type: Array as PropType<ConnectButtonLogoInput[]>,
|
|
45
|
+
default: undefined,
|
|
46
|
+
},
|
|
47
|
+
/** @deprecated use logos */
|
|
43
48
|
platforms: {
|
|
44
|
-
type: Array as PropType<
|
|
49
|
+
type: Array as PropType<ConnectButtonLogoInput[]>,
|
|
45
50
|
default: undefined,
|
|
46
51
|
},
|
|
47
52
|
connected: optionalBoolean,
|
|
@@ -57,9 +62,6 @@ export const ConnectButton = defineComponent({
|
|
|
57
62
|
type: String as PropType<OneConnectTheme>,
|
|
58
63
|
default: undefined,
|
|
59
64
|
},
|
|
60
|
-
/** @deprecated use connectTheme */
|
|
61
|
-
appTheme: { type: String as PropType<OneConnectTheme>, default: undefined },
|
|
62
|
-
accentColor: { type: String, default: undefined },
|
|
63
65
|
label: { type: String, default: undefined },
|
|
64
66
|
connectedLabel: { type: String, default: undefined },
|
|
65
67
|
description: { type: String, default: undefined },
|