diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1e642f8d..26b104a9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -35,9 +35,6 @@ jobs: - name: Run SDK Tests run: make test-client-js - env: - OPEN_API_REF: c0b62b28b14d0d164d37a1f6bf19dc9d39e5769b - - name: Check for SDK changes run: | cd clients/fga-js-sdk diff --git a/config/clients/go/config.overrides.json b/config/clients/go/config.overrides.json index 65b28938..fcf54bce 100644 --- a/config/clients/go/config.overrides.json +++ b/config/clients/go/config.overrides.json @@ -11,6 +11,7 @@ "openTelemetryDocumentation": "docs/OpenTelemetry.md", "targetGoVersion": "1.24.0", "toolchainGoVersion": "1.25.1", + "supportsStreamedListObjects": "streamed_list_objects", "files": { "internal/constants.mustache": { "destinationFilename": "internal/constants/constants.go", diff --git a/config/clients/go/template/README_calling_api.mustache b/config/clients/go/template/README_calling_api.mustache index e468ec0b..2d8a7564 100644 --- a/config/clients/go/template/README_calling_api.mustache +++ b/config/clients/go/template/README_calling_api.mustache @@ -641,6 +641,50 @@ data, err := fgaClient.ListObjects(context.Background()). // data.Objects = ["document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"] ``` +##### Streamed List Objects + +List objects of a particular type that the user has access to, using the streaming API. + +The Streamed ListObjects API is very similar to the ListObjects API, with two key differences: +1. **Streaming Results**: Instead of collecting all objects before returning a response, it streams them to the client as they are collected. +2. **No Pagination Limit**: Returns all results without the 1000-object limit of the standard ListObjects API. + +This is particularly useful when querying **computed relations** that may return large result sets. + +[API Documentation](https://openfga.dev/api/service#/Relationship%20Queries/StreamedListObjects) + +```golang +options := ClientStreamedListObjectsOptions{ + // You can rely on the model id set in the configuration or override it for this specific request + AuthorizationModelId: openfga.PtrString("01GAHCE4YVKPQEKZQHT2R89MQV"), +} + +body := ClientStreamedListObjectsRequest{ + User: "user:anne", + Relation: "can_read", + Type: "document", +} + +response, err := fgaClient.StreamedListObjects(context.Background()).Body(body).Options(options).Execute() +if err != nil { + // .. Handle error +} +defer response.Close() + +// Consume objects from the stream +var objects []string +for obj := range response.Objects { + objects = append(objects, obj.Object) +} + +// Check for any errors during streaming +if err := <-response.Errors; err != nil { + // .. Handle streaming error +} + +// objects = ["document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"] +``` + #### List Relations List the relations a user has on an object. diff --git a/config/common/config.base.json b/config/common/config.base.json index 20ef36c6..34bf8e71 100644 --- a/config/common/config.base.json +++ b/config/common/config.base.json @@ -49,10 +49,6 @@ "destinationFilename": "VERSION.txt", "templateType": "SupportingFiles" }, - "README.mustache": { - "destinationFilename": "README.md", - "templateType": "SupportingFiles" - }, ".github/CODEOWNERS.mustache": { "destinationFilename": ".github/CODEOWNERS", "templateType": "SupportingFiles"