@xpert-ai/plugin-analytics-files 0.1.2 → 0.2.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/dist/lib/provider.d.ts +5 -0
- package/dist/lib/provider.js +12 -0
- package/package.json +1 -1
package/dist/lib/provider.d.ts
CHANGED
|
@@ -62,6 +62,11 @@ export declare class FileAnalyticsProvider implements AnalyticsQueryProvider {
|
|
|
62
62
|
}[];
|
|
63
63
|
};
|
|
64
64
|
constructor(runtime: RuntimeCapabilityRegistry);
|
|
65
|
+
/**
|
|
66
|
+
* Only a manager of the exact source Project may delegate a current declared file dataset.
|
|
67
|
+
* Validate the binding and authorized file metadata without reading rows; query access remains actor-scoped.
|
|
68
|
+
*/
|
|
69
|
+
authorizeGroupSharing(binding: AnalyticsBinding, context: AnalyticsProviderContext): Promise<void>;
|
|
65
70
|
private check;
|
|
66
71
|
private file;
|
|
67
72
|
private read;
|
package/dist/lib/provider.js
CHANGED
|
@@ -37,6 +37,18 @@ let FileAnalyticsProvider = class FileAnalyticsProvider {
|
|
|
37
37
|
this.authoring = authoring_1.fileAuthoring;
|
|
38
38
|
this.configuration = { kind: 'definition', connection: 'workspace-files', schema: (0, schema_1.jsonSchema)(schema_1.optionsSchema) };
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Only a manager of the exact source Project may delegate a current declared file dataset.
|
|
42
|
+
* Validate the binding and authorized file metadata without reading rows; query access remains actor-scoped.
|
|
43
|
+
*/
|
|
44
|
+
async authorizeGroupSharing(binding, context) {
|
|
45
|
+
const query = schema_1.payloadSchema.parse(binding.payload), { datasets } = schema_1.optionsSchema.parse(context.options);
|
|
46
|
+
const definition = datasets.find(dataset => dataset.id === query.datasetId);
|
|
47
|
+
if (!definition || query.revision !== definition.revision || query.contractHash !== (0, exports.contractHash)(definition) || definition.file.catalog !== 'projects')
|
|
48
|
+
throw new common_1.ForbiddenException('FILE_DATASET_SHARING_UNAVAILABLE');
|
|
49
|
+
await this.runtime.require(plugin_sdk_1.ProjectAccessRuntimeCapability).assertManage({ actor: context.actor, projectId: definition.file.projectId });
|
|
50
|
+
await this.file(definition, context);
|
|
51
|
+
}
|
|
40
52
|
check(context) {
|
|
41
53
|
context.signal.throwIfAborted();
|
|
42
54
|
if (Date.now() >= context.deadlineAt)
|
package/package.json
CHANGED