Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjames committed Dec 16, 2024
1 parent 6034e1c commit 8e92f9b
Showing 1 changed file with 0 additions and 74 deletions.
74 changes: 0 additions & 74 deletions client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,80 +755,6 @@ export class OpenFgaClient extends BaseAPI {
// Return the final response in the expected format
return { responses: results };
}





// async batchCheck(body: ClientBatchCheckRequest, options: ClientRequestOptsWithConsistency & ClientBatchCheckRequestOpts = {}): Promise<ClientBatchCheckResponse> {
// const {
// headers = {},
// maxBatchSize = DEFAULT_MAX_BATCH_SIZE,
// maxParallelRequests = DEFAULT_MAX_METHOD_PARALLEL_REQS,
// } = options;

// // TODO is this right?
// setHeaderIfNotSet(headers, CLIENT_METHOD_HEADER, "BatchCheck");
// setHeaderIfNotSet(headers, CLIENT_BULK_REQUEST_ID_HEADER, generateRandomIdWithNonUniqueFallback());

// // const seenCorrelationIds = new Set<string>();
// // for (const check of body.checks) {
// // if (!check.correlationId) {
// // check.correlationId = generateRandomIdWithNonUniqueFallback();
// // }
// // seenCorrelationIds.add(check.correlationId);
// // if (seenCorrelationIds.has(check.correlationId)) {
// // throw new FgaValidationError("correlationId", "When calling batchCheck, correlation IDs must be unique");
// // }
// // }

// if (!body?.checks?.length) {
// throw new FgaValidationError("checks", "When calling batchCheck, at least one check must be specified");
// }

// const checkToId = new Map<String, ClientBatchCheckItem>();
// const transformed: BatchCheckItem[] = [];

// for (const check of body.checks) {
// if (!check.correlationId) {
// check.correlationId = generateRandomIdWithNonUniqueFallback();
// }
// if (checkToId.has(check.correlationId)) {
// throw new FgaValidationError("correlationId", "When calling batchCheck, correlation IDs must be unique");
// }
// checkToId.set(check.correlationId, check);
// transformed.push({
// tuple_key: {
// user: check.user,
// relation: check.relation,
// object: check.object,
// },
// context: check.context,
// contextual_tuples: check.contextualTuples,
// correlation_id: check.correlationId,
// });
// }

// const batchCheckRequest: BatchCheckRequest = {
// checks: transformed,
// authorization_model_id: options.authorizationModelId,
// consistency: options.consistency,
// };

// // TODO does single need to accept options? Have some on the request? What about storeId?
// await this.singleBatchCheck(batchCheckRequest, { ...options, headers })
// .then(response => {

// })
// .catch(err => {

// });

// // return await(this.singleBatchCheck(batchCheckRequest, options))
// // TODO implement ;)
// return Promise.resolve({} as ClientBatchCheckResponse);
// }


/**
* Expand - Expands the relationships in userset tree format (evaluates)
Expand Down

0 comments on commit 8e92f9b

Please sign in to comment.