@slates/provider-handler 1.0.0-rc.36 → 1.0.0-rc.37
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/dist/index.cjs +1 -0
- package/dist/index.module.js +1 -0
- package/package.json +3 -3
- package/src/spec.test.ts +24 -1
- package/src/spec.ts +4 -0
package/dist/index.cjs
CHANGED
|
@@ -113,6 +113,7 @@ var mapAuthMethod = (slate, m) => ({
|
|
|
113
113
|
description: s.description
|
|
114
114
|
})) : void 0,
|
|
115
115
|
adapters: "adapters" in m ? m.adapters : void 0,
|
|
116
|
+
..."syncTokensAcrossConnections" in m && m.syncTokensAcrossConnections ? { syncTokensAcrossConnections: true } : {},
|
|
116
117
|
inputSchema: toJsonSchema(m.inputSchema ?? import_zod.default.object({})),
|
|
117
118
|
outputSchema: toJsonSchema(slate.spec.auth.outputSchema),
|
|
118
119
|
capabilities: {
|
package/dist/index.module.js
CHANGED
|
@@ -96,6 +96,7 @@ var mapAuthMethod = (slate, m) => ({
|
|
|
96
96
|
description: s.description
|
|
97
97
|
})) : void 0,
|
|
98
98
|
adapters: "adapters" in m ? m.adapters : void 0,
|
|
99
|
+
..."syncTokensAcrossConnections" in m && m.syncTokensAcrossConnections ? { syncTokensAcrossConnections: true } : {},
|
|
99
100
|
inputSchema: toJsonSchema(m.inputSchema ?? z.object({})),
|
|
100
101
|
outputSchema: toJsonSchema(slate.spec.auth.outputSchema),
|
|
101
102
|
capabilities: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slates/provider-handler",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.37",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@lowerdeck/error": "^1.1.0",
|
|
35
|
-
"@slates/proto": "1.0.0-rc.
|
|
36
|
-
"@slates/provider": "1.0.0-rc.
|
|
35
|
+
"@slates/proto": "1.0.0-rc.23",
|
|
36
|
+
"@slates/provider": "1.0.0-rc.27",
|
|
37
37
|
"p-queue": "^6.6.2",
|
|
38
38
|
"zod": "^4.2.1"
|
|
39
39
|
},
|
package/src/spec.test.ts
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
getTriggersForGroup,
|
|
10
10
|
isMappableTrigger,
|
|
11
11
|
mapAction,
|
|
12
|
-
mapAdapter
|
|
12
|
+
mapAdapter,
|
|
13
|
+
mapAuthMethod
|
|
13
14
|
} from './spec';
|
|
14
15
|
|
|
15
16
|
let baseAction = {
|
|
@@ -145,3 +146,25 @@ describe('adapter exposure', () => {
|
|
|
145
146
|
});
|
|
146
147
|
});
|
|
147
148
|
});
|
|
149
|
+
|
|
150
|
+
describe('mapAuthMethod', () => {
|
|
151
|
+
let slate: any = { spec: { auth: { outputSchema: z.object({ token: z.string() }) } } };
|
|
152
|
+
let oauthMethod: any = {
|
|
153
|
+
type: 'auth.oauth',
|
|
154
|
+
key: 'oauth',
|
|
155
|
+
name: 'OAuth',
|
|
156
|
+
scopes: [],
|
|
157
|
+
getAuthorizationUrl: async () => ({ url: '' }),
|
|
158
|
+
handleCallback: async () => ({ output: { token: '' } })
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
it('emits syncTokensAcrossConnections only when the method opts in', () => {
|
|
162
|
+
expect(
|
|
163
|
+
mapAuthMethod(slate, { ...oauthMethod, syncTokensAcrossConnections: true })
|
|
164
|
+
).toMatchObject({ syncTokensAcrossConnections: true });
|
|
165
|
+
|
|
166
|
+
for (let method of [oauthMethod, { ...oauthMethod, syncTokensAcrossConnections: false }]) {
|
|
167
|
+
expect(mapAuthMethod(slate, method)).not.toHaveProperty('syncTokensAcrossConnections');
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
package/src/spec.ts
CHANGED
|
@@ -49,6 +49,10 @@ export let mapAuthMethod = <ConfigType extends {}, AuthType extends {}>(
|
|
|
49
49
|
|
|
50
50
|
adapters: 'adapters' in m ? m.adapters : undefined,
|
|
51
51
|
|
|
52
|
+
...('syncTokensAcrossConnections' in m && m.syncTokensAcrossConnections
|
|
53
|
+
? { syncTokensAcrossConnections: true }
|
|
54
|
+
: {}),
|
|
55
|
+
|
|
52
56
|
inputSchema: toJsonSchema(m.inputSchema ?? z.object({})),
|
|
53
57
|
outputSchema: toJsonSchema(slate.spec.auth.outputSchema),
|
|
54
58
|
|