@slates/provider-handler 1.0.0-rc.15 → 1.0.0-rc.18
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 +16 -5
- package/dist/index.module.js +16 -5
- package/package.json +3 -3
- package/src/index.ts +12 -4
- package/src/spec.ts +5 -1
package/dist/index.cjs
CHANGED
|
@@ -108,7 +108,8 @@ var mapAuthMethod = (slate, m) => ({
|
|
|
108
108
|
enabled: !!m.onInputChanged
|
|
109
109
|
},
|
|
110
110
|
getProfile: { enabled: !!m.getProfile }
|
|
111
|
-
}
|
|
111
|
+
},
|
|
112
|
+
docs: m.docs ?? []
|
|
112
113
|
});
|
|
113
114
|
var getAction = (slate, actionId) => {
|
|
114
115
|
let action = slate.actions.find((m) => m.key === actionId);
|
|
@@ -138,6 +139,8 @@ var mapAction = (_slate, a) => {
|
|
|
138
139
|
tags: a.tags,
|
|
139
140
|
metadata: a.metadata,
|
|
140
141
|
scopes: a.scopes,
|
|
142
|
+
authMethods: a.authMethods,
|
|
143
|
+
docs: a.docs ?? [],
|
|
141
144
|
inputSchema: toJsonSchema(a.inputSchema),
|
|
142
145
|
outputSchema: toJsonSchema(a.outputSchema)
|
|
143
146
|
};
|
|
@@ -434,7 +437,10 @@ var createProviderHandler = (slate, listeners) => (0, import_proto.createSlatesP
|
|
|
434
437
|
});
|
|
435
438
|
manager.onRequest("slates/config.schema.get", async () => {
|
|
436
439
|
getContextBasic();
|
|
437
|
-
return {
|
|
440
|
+
return {
|
|
441
|
+
schema: toJsonSchema(slate.spec.configSchema),
|
|
442
|
+
docs: slate.spec.config.docsReferences ?? []
|
|
443
|
+
};
|
|
438
444
|
});
|
|
439
445
|
manager.onRequest("slates/provider.identify", async () => {
|
|
440
446
|
getContextBasic();
|
|
@@ -446,7 +452,8 @@ var createProviderHandler = (slate, listeners) => (0, import_proto.createSlatesP
|
|
|
446
452
|
name: slate.spec.name,
|
|
447
453
|
description: slate.spec.description,
|
|
448
454
|
metadata: slate.spec.parameters.metadata
|
|
449
|
-
}
|
|
455
|
+
},
|
|
456
|
+
docs: slate.spec.docs ?? []
|
|
450
457
|
};
|
|
451
458
|
});
|
|
452
459
|
manager.onRequest("slates/auth.methods.list", async () => {
|
|
@@ -549,12 +556,16 @@ var createProviderHandler = (slate, listeners) => (0, import_proto.createSlatesP
|
|
|
549
556
|
inputKeyCount: getObjectKeyCount(input)
|
|
550
557
|
},
|
|
551
558
|
onSuccess: (result) => ({
|
|
552
|
-
outputKeyCount: getObjectKeyCount(result.output)
|
|
559
|
+
outputKeyCount: getObjectKeyCount(result.output),
|
|
560
|
+
scopeCount: result.scopes?.length ?? 0
|
|
553
561
|
})
|
|
554
562
|
},
|
|
555
563
|
() => (0, import_provider2.runWithContext)(context, () => authMethod.getOutput({ input }))
|
|
556
564
|
);
|
|
557
|
-
return withRequestTraces(context, {
|
|
565
|
+
return withRequestTraces(context, {
|
|
566
|
+
output: outputRes.output,
|
|
567
|
+
scopes: outputRes.scopes
|
|
568
|
+
});
|
|
558
569
|
}
|
|
559
570
|
return { output: input };
|
|
560
571
|
});
|
package/dist/index.module.js
CHANGED
|
@@ -81,7 +81,8 @@ var mapAuthMethod = (slate, m) => ({
|
|
|
81
81
|
enabled: !!m.onInputChanged
|
|
82
82
|
},
|
|
83
83
|
getProfile: { enabled: !!m.getProfile }
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
|
+
docs: m.docs ?? []
|
|
85
86
|
});
|
|
86
87
|
var getAction = (slate, actionId) => {
|
|
87
88
|
let action = slate.actions.find((m) => m.key === actionId);
|
|
@@ -111,6 +112,8 @@ var mapAction = (_slate, a) => {
|
|
|
111
112
|
tags: a.tags,
|
|
112
113
|
metadata: a.metadata,
|
|
113
114
|
scopes: a.scopes,
|
|
115
|
+
authMethods: a.authMethods,
|
|
116
|
+
docs: a.docs ?? [],
|
|
114
117
|
inputSchema: toJsonSchema(a.inputSchema),
|
|
115
118
|
outputSchema: toJsonSchema(a.outputSchema)
|
|
116
119
|
};
|
|
@@ -407,7 +410,10 @@ var createProviderHandler = (slate, listeners) => createSlatesProviderProtoHandl
|
|
|
407
410
|
});
|
|
408
411
|
manager.onRequest("slates/config.schema.get", async () => {
|
|
409
412
|
getContextBasic();
|
|
410
|
-
return {
|
|
413
|
+
return {
|
|
414
|
+
schema: toJsonSchema(slate.spec.configSchema),
|
|
415
|
+
docs: slate.spec.config.docsReferences ?? []
|
|
416
|
+
};
|
|
411
417
|
});
|
|
412
418
|
manager.onRequest("slates/provider.identify", async () => {
|
|
413
419
|
getContextBasic();
|
|
@@ -419,7 +425,8 @@ var createProviderHandler = (slate, listeners) => createSlatesProviderProtoHandl
|
|
|
419
425
|
name: slate.spec.name,
|
|
420
426
|
description: slate.spec.description,
|
|
421
427
|
metadata: slate.spec.parameters.metadata
|
|
422
|
-
}
|
|
428
|
+
},
|
|
429
|
+
docs: slate.spec.docs ?? []
|
|
423
430
|
};
|
|
424
431
|
});
|
|
425
432
|
manager.onRequest("slates/auth.methods.list", async () => {
|
|
@@ -522,12 +529,16 @@ var createProviderHandler = (slate, listeners) => createSlatesProviderProtoHandl
|
|
|
522
529
|
inputKeyCount: getObjectKeyCount(input)
|
|
523
530
|
},
|
|
524
531
|
onSuccess: (result) => ({
|
|
525
|
-
outputKeyCount: getObjectKeyCount(result.output)
|
|
532
|
+
outputKeyCount: getObjectKeyCount(result.output),
|
|
533
|
+
scopeCount: result.scopes?.length ?? 0
|
|
526
534
|
})
|
|
527
535
|
},
|
|
528
536
|
() => runWithContext(context, () => authMethod.getOutput({ input }))
|
|
529
537
|
);
|
|
530
|
-
return withRequestTraces(context, {
|
|
538
|
+
return withRequestTraces(context, {
|
|
539
|
+
output: outputRes.output,
|
|
540
|
+
scopes: outputRes.scopes
|
|
541
|
+
});
|
|
531
542
|
}
|
|
532
543
|
return { output: input };
|
|
533
544
|
});
|
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.18",
|
|
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.12",
|
|
36
|
+
"@slates/provider": "1.0.0-rc.16",
|
|
37
37
|
"zod": "^4.2.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -363,7 +363,10 @@ export let createProviderHandler = <ConfigType extends {}, AuthType extends {}>(
|
|
|
363
363
|
manager.onRequest('slates/config.schema.get', async () => {
|
|
364
364
|
getContextBasic();
|
|
365
365
|
|
|
366
|
-
return {
|
|
366
|
+
return {
|
|
367
|
+
schema: toJsonSchema(slate.spec.configSchema),
|
|
368
|
+
docs: slate.spec.config.docsReferences ?? []
|
|
369
|
+
};
|
|
367
370
|
});
|
|
368
371
|
|
|
369
372
|
manager.onRequest('slates/provider.identify', async () => {
|
|
@@ -377,7 +380,8 @@ export let createProviderHandler = <ConfigType extends {}, AuthType extends {}>(
|
|
|
377
380
|
name: slate.spec.name,
|
|
378
381
|
description: slate.spec.description,
|
|
379
382
|
metadata: slate.spec.parameters.metadata
|
|
380
|
-
}
|
|
383
|
+
},
|
|
384
|
+
docs: slate.spec.docs ?? []
|
|
381
385
|
};
|
|
382
386
|
});
|
|
383
387
|
|
|
@@ -496,12 +500,16 @@ export let createProviderHandler = <ConfigType extends {}, AuthType extends {}>(
|
|
|
496
500
|
inputKeyCount: getObjectKeyCount(input)
|
|
497
501
|
},
|
|
498
502
|
onSuccess: result => ({
|
|
499
|
-
outputKeyCount: getObjectKeyCount(result.output)
|
|
503
|
+
outputKeyCount: getObjectKeyCount(result.output),
|
|
504
|
+
scopeCount: result.scopes?.length ?? 0
|
|
500
505
|
})
|
|
501
506
|
},
|
|
502
507
|
() => runWithContext(context, () => authMethod.getOutput({ input }))
|
|
503
508
|
);
|
|
504
|
-
return withRequestTraces(context, {
|
|
509
|
+
return withRequestTraces(context, {
|
|
510
|
+
output: outputRes.output,
|
|
511
|
+
scopes: outputRes.scopes
|
|
512
|
+
});
|
|
505
513
|
}
|
|
506
514
|
|
|
507
515
|
return { output: input as any };
|
package/src/spec.ts
CHANGED
|
@@ -50,7 +50,9 @@ export let mapAuthMethod = <ConfigType extends {}, AuthType extends {}>(
|
|
|
50
50
|
enabled: !!m.onInputChanged
|
|
51
51
|
},
|
|
52
52
|
getProfile: { enabled: !!m.getProfile }
|
|
53
|
-
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
docs: m.docs ?? []
|
|
54
56
|
});
|
|
55
57
|
|
|
56
58
|
export let getAction = <ConfigType extends {}, AuthType extends {}>(
|
|
@@ -99,6 +101,8 @@ export let mapAction = <ConfigType extends {}, AuthType extends {}>(
|
|
|
99
101
|
tags: a.tags,
|
|
100
102
|
metadata: a.metadata,
|
|
101
103
|
scopes: a.scopes,
|
|
104
|
+
authMethods: a.authMethods,
|
|
105
|
+
docs: a.docs ?? [],
|
|
102
106
|
|
|
103
107
|
inputSchema: toJsonSchema(a.inputSchema),
|
|
104
108
|
outputSchema: toJsonSchema(a.outputSchema)
|