From 7d683e0f5506e731fec8d9495fef4142f603b62e Mon Sep 17 00:00:00 2001 From: Anurag Bandyopadhyay Date: Wed, 19 Nov 2025 22:37:44 +0530 Subject: [PATCH 1/2] feat(go-sdk) : auxilliary changes for go streamed list endpoint --- config/clients/go/config.overrides.json | 1 + .../go/template/README_calling_api.mustache | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) 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. From 46389c2e6e8cbc70e83d7b1cec06aade371393d7 Mon Sep 17 00:00:00 2001 From: Anurag Bandyopadhyay Date: Wed, 19 Nov 2025 22:55:30 +0530 Subject: [PATCH 2/2] feat: add js ci and config update --- .github/workflows/main.yaml | 3 --- config/common/config.base.json | 4 ---- 2 files changed, 7 deletions(-) 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/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"