@slates/provider-handler 1.0.0-rc.17 → 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 CHANGED
@@ -139,6 +139,7 @@ var mapAction = (_slate, a) => {
139
139
  tags: a.tags,
140
140
  metadata: a.metadata,
141
141
  scopes: a.scopes,
142
+ authMethods: a.authMethods,
142
143
  docs: a.docs ?? [],
143
144
  inputSchema: toJsonSchema(a.inputSchema),
144
145
  outputSchema: toJsonSchema(a.outputSchema)
@@ -555,12 +556,16 @@ var createProviderHandler = (slate, listeners) => (0, import_proto.createSlatesP
555
556
  inputKeyCount: getObjectKeyCount(input)
556
557
  },
557
558
  onSuccess: (result) => ({
558
- outputKeyCount: getObjectKeyCount(result.output)
559
+ outputKeyCount: getObjectKeyCount(result.output),
560
+ scopeCount: result.scopes?.length ?? 0
559
561
  })
560
562
  },
561
563
  () => (0, import_provider2.runWithContext)(context, () => authMethod.getOutput({ input }))
562
564
  );
563
- return withRequestTraces(context, { output: outputRes.output });
565
+ return withRequestTraces(context, {
566
+ output: outputRes.output,
567
+ scopes: outputRes.scopes
568
+ });
564
569
  }
565
570
  return { output: input };
566
571
  });
@@ -112,6 +112,7 @@ var mapAction = (_slate, a) => {
112
112
  tags: a.tags,
113
113
  metadata: a.metadata,
114
114
  scopes: a.scopes,
115
+ authMethods: a.authMethods,
115
116
  docs: a.docs ?? [],
116
117
  inputSchema: toJsonSchema(a.inputSchema),
117
118
  outputSchema: toJsonSchema(a.outputSchema)
@@ -528,12 +529,16 @@ var createProviderHandler = (slate, listeners) => createSlatesProviderProtoHandl
528
529
  inputKeyCount: getObjectKeyCount(input)
529
530
  },
530
531
  onSuccess: (result) => ({
531
- outputKeyCount: getObjectKeyCount(result.output)
532
+ outputKeyCount: getObjectKeyCount(result.output),
533
+ scopeCount: result.scopes?.length ?? 0
532
534
  })
533
535
  },
534
536
  () => runWithContext(context, () => authMethod.getOutput({ input }))
535
537
  );
536
- return withRequestTraces(context, { output: outputRes.output });
538
+ return withRequestTraces(context, {
539
+ output: outputRes.output,
540
+ scopes: outputRes.scopes
541
+ });
537
542
  }
538
543
  return { output: input };
539
544
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slates/provider-handler",
3
- "version": "1.0.0-rc.17",
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.11",
36
- "@slates/provider": "1.0.0-rc.15",
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
@@ -500,12 +500,16 @@ export let createProviderHandler = <ConfigType extends {}, AuthType extends {}>(
500
500
  inputKeyCount: getObjectKeyCount(input)
501
501
  },
502
502
  onSuccess: result => ({
503
- outputKeyCount: getObjectKeyCount(result.output)
503
+ outputKeyCount: getObjectKeyCount(result.output),
504
+ scopeCount: result.scopes?.length ?? 0
504
505
  })
505
506
  },
506
507
  () => runWithContext(context, () => authMethod.getOutput({ input }))
507
508
  );
508
- return withRequestTraces(context, { output: outputRes.output });
509
+ return withRequestTraces(context, {
510
+ output: outputRes.output,
511
+ scopes: outputRes.scopes
512
+ });
509
513
  }
510
514
 
511
515
  return { output: input as any };
package/src/spec.ts CHANGED
@@ -101,6 +101,7 @@ export let mapAction = <ConfigType extends {}, AuthType extends {}>(
101
101
  tags: a.tags,
102
102
  metadata: a.metadata,
103
103
  scopes: a.scopes,
104
+ authMethods: a.authMethods,
104
105
  docs: a.docs ?? [],
105
106
 
106
107
  inputSchema: toJsonSchema(a.inputSchema),