diff --git a/config/clients/js/CHANGELOG.md.mustache b/config/clients/js/CHANGELOG.md.mustache index 37eef207..808454e2 100644 --- a/config/clients/js/CHANGELOG.md.mustache +++ b/config/clients/js/CHANGELOG.md.mustache @@ -1,5 +1,13 @@ # Changelog +## v0.6.1 + +### [0.6.1](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/compare/v0.6.0...v0.6.1) (2024-07-11) +- fix(metrics): add missing request model id attribute (#122) + +> [!IMPORTANT] +> In this release we have changed our TypeScript compile target to ES2020 to align with our stated supported environments + ## v0.6.0 ### [0.6.0](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/compare/v0.5.0...v0.6.0) (2024-06-28) diff --git a/config/clients/js/config.overrides.json b/config/clients/js/config.overrides.json index 0633574b..362dde3a 100644 --- a/config/clients/js/config.overrides.json +++ b/config/clients/js/config.overrides.json @@ -2,7 +2,7 @@ "sdkId": "js", "gitRepoId": "js-sdk", "packageName": "@openfga/sdk", - "packageVersion": "0.6.0", + "packageVersion": "0.6.1", "packageDescription": "JavaScript and Node.js SDK for OpenFGA", "packageDetailedDescription": "This is an autogenerated JavaScript SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api), and includes TS typings.", "npmRegistry": "https://registry.npmjs.org/", diff --git a/config/clients/js/patches/add-method-specific-attributes.patch b/config/clients/js/patches/add-method-specific-attributes.patch index 0b163a72..8f6b73f6 100644 --- a/config/clients/js/patches/add-method-specific-attributes.patch +++ b/config/clients/js/patches/add-method-specific-attributes.patch @@ -3,7 +3,7 @@ index e45e6c2..260e0bc 100644 --- a/api.ts +++ b/api.ts @@ -759,6 +759,9 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.check(storeId, body, options); + const localVarAxiosArgs = localVarAxiosParamCreator.check(storeId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "check", + [attributeNames.requestStoreId]: storeId, @@ -13,7 +13,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -785,6 +788,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteStore(storeId, options); + const localVarAxiosArgs = localVarAxiosParamCreator.deleteStore(storeId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "deleteStore", + [attributeNames.requestStoreId]: storeId, @@ -21,7 +21,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -799,6 +803,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.expand(storeId, body, options); + const localVarAxiosArgs = localVarAxiosParamCreator.expand(storeId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "expand", + [attributeNames.requestModelId]: body.authorization_model_id, @@ -30,7 +30,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -812,6 +818,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.getStore(storeId, options); + const localVarAxiosArgs = localVarAxiosParamCreator.getStore(storeId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "getStore", + [attributeNames.requestStoreId]: storeId, @@ -38,7 +38,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -826,6 +833,9 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.listObjects(storeId, body, options); + const localVarAxiosArgs = localVarAxiosParamCreator.listObjects(storeId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "listObjects", + [attributeNames.requestStoreId]: storeId, @@ -48,7 +48,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -854,6 +864,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.listUsers(storeId, body, options); + const localVarAxiosArgs = localVarAxiosParamCreator.listUsers(storeId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "listUsers", + [attributeNames.requestStoreId]: storeId, @@ -57,7 +57,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -868,6 +880,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.read(storeId, body, options); + const localVarAxiosArgs = localVarAxiosParamCreator.read(storeId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "read", + [attributeNames.requestStoreId]: storeId, @@ -65,7 +65,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -882,6 +895,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.readAssertions(storeId, authorizationModelId, options); + const localVarAxiosArgs = localVarAxiosParamCreator.readAssertions(storeId, authorizationModelId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "readAssertions", + [attributeNames.requestStoreId]: storeId, @@ -74,7 +74,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -896,6 +911,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.readAuthorizationModel(storeId, id, options); + const localVarAxiosArgs = localVarAxiosParamCreator.readAuthorizationModel(storeId, id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "readAuthorizationModel", + [attributeNames.requestStoreId]: storeId, @@ -82,7 +82,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -911,6 +927,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.readAuthorizationModels(storeId, pageSize, continuationToken, options); + const localVarAxiosArgs = localVarAxiosParamCreator.readAuthorizationModels(storeId, pageSize, continuationToken, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "readAuthorizationModels", + [attributeNames.requestStoreId]: storeId, @@ -90,7 +90,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -927,6 +944,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.readChanges(storeId, type, pageSize, continuationToken, options); + const localVarAxiosArgs = localVarAxiosParamCreator.readChanges(storeId, type, pageSize, continuationToken, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "readChanges", + [attributeNames.requestStoreId]: storeId, @@ -98,7 +98,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -941,6 +959,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.write(storeId, body, options); + const localVarAxiosArgs = localVarAxiosParamCreator.write(storeId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "write", + [attributeNames.requestStoreId]: storeId, @@ -107,7 +107,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -956,6 +976,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.writeAssertions(storeId, authorizationModelId, body, options); + const localVarAxiosArgs = localVarAxiosParamCreator.writeAssertions(storeId, authorizationModelId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "writeAssertions", + [attributeNames.requestStoreId]: storeId, @@ -116,7 +116,7 @@ index e45e6c2..260e0bc 100644 }, /** @@ -970,6 +992,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: - const localVarAxiosArgs = await localVarAxiosParamCreator.writeAuthorizationModel(storeId, body, options); + const localVarAxiosArgs = localVarAxiosParamCreator.writeAuthorizationModel(storeId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "writeAuthorizationModel", + [attributeNames.requestStoreId]: storeId, diff --git a/config/clients/js/template/apiInner.mustache b/config/clients/js/template/apiInner.mustache index 8a8ba5b4..7f7cca42 100644 --- a/config/clients/js/template/apiInner.mustache +++ b/config/clients/js/template/apiInner.mustache @@ -45,7 +45,7 @@ export const {{classname}}AxiosParamCreator = function (configuration: Configura * @deprecated{{/isDeprecated}} * @throws { FgaError } */ - {{nickname}}: async ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: any = {}): Promise => { + {{nickname}}: ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: any = {}): RequestArgs => { {{#allParams}} {{#required}} // verify required parameter '{{paramName}}' is not null or undefined @@ -210,7 +210,7 @@ export const {{classname}}Fp = function(configuration: Configuration, credential * @throws { FgaError } */ async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): Promise<(axios?: AxiosInstance) => PromiseResult<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); + const localVarAxiosArgs = localVarAxiosParamCreator.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { [attributeNames.requestMethod]: "{{nickname}}", }); diff --git a/config/clients/js/template/tsconfig.json b/config/clients/js/template/tsconfig.json index bcc1ef84..3b8a38ba 100644 --- a/config/clients/js/template/tsconfig.json +++ b/config/clients/js/template/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "declaration": true, - "target": "es6", + "target": "es2020", "module": "commonjs", "noImplicitAny": true, "strict": true,