From 14bba440aad4bf93ccdda21009200dfaf048ae41 Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Fri, 20 Sep 2024 09:40:55 -0300 Subject: [PATCH] Remove public key related types/endpoints --- api.ts | 485 -------------------------------------------------- dist/api.d.ts | 268 ---------------------------- dist/api.js | 387 +--------------------------------------- 3 files changed, 1 insertion(+), 1139 deletions(-) diff --git a/api.ts b/api.ts index 373519f..5127f87 100644 --- a/api.ts +++ b/api.ts @@ -639,32 +639,6 @@ export interface CreatePublicKey { */ 'public_key': string; } -/** - * - * @export - * @interface CreatePublicKey200Response - */ -export interface CreatePublicKey200Response { - /** - * - * @type {PublicKeysResponsePublicKeysInner} - * @memberof CreatePublicKey200Response - */ - 'public_key': PublicKeysResponsePublicKeysInner; -} -/** - * - * @export - * @interface CreatePublicKeyRequest - */ -export interface CreatePublicKeyRequest { - /** - * Base64 encoded (public) PEM file - * @type {string} - * @memberof CreatePublicKeyRequest - */ - 'public_key': string; -} /** * * @export @@ -4701,44 +4675,6 @@ export interface PublicKey { */ 'last_used_at'?: string | null; } -/** - * - * @export - * @interface PublicKeysResponse - */ -export interface PublicKeysResponse { - /** - * - * @type {Array} - * @memberof PublicKeysResponse - */ - 'public_keys': Array; -} -/** - * To authenticate your requests using asymmetric key pairs (e.g., for signing embed requests), you need to share your public key with us. The public key resource allows you to manage your active public keys and track their last usage. - * @export - * @interface PublicKeysResponsePublicKeysInner - */ -export interface PublicKeysResponsePublicKeysInner { - /** - * - * @type {string} - * @memberof PublicKeysResponsePublicKeysInner - */ - 'id'?: string; - /** - * Your public key, PEM encoded - * @type {string} - * @memberof PublicKeysResponsePublicKeysInner - */ - 'pem'?: string; - /** - * The last time your public key was used to sign a request - * @type {string} - * @memberof PublicKeysResponsePublicKeysInner - */ - 'last_used_at'?: string | null; -} /** * Details of the recipient of the reward * @export @@ -5850,19 +5786,6 @@ export interface TestPublicKey { */ 'jwt': string; } -/** - * - * @export - * @interface TestPublicKeyRequest - */ -export interface TestPublicKeyRequest { - /** - * A JWT token encoded with RS256, signed using the RSA private key corresponding to your public key. - * @type {string} - * @memberof TestPublicKeyRequest - */ - 'jwt': string; -} /** * With a campaign you can define the look & feel of how rewards are sent out. It also lets you set the available products (different gift cards, charity, etc.) recipients can choose from. * @export @@ -9396,414 +9319,6 @@ export class ProductsApi extends BaseAPI { -/** - * PublicKeysApi - axios parameter creator - * @export - */ -export const PublicKeysApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createPublicKey: async (createPublicKeyRequest: CreatePublicKeyRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'createPublicKeyRequest' is not null or undefined - assertParamExists('createPublicKey', 'createPublicKeyRequest', createPublicKeyRequest) - const localVarPath = `/public_keys`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication BearerApiKey required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(createPublicKeyRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePublicKey: async (id: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('deletePublicKey', 'id', id) - const localVarPath = `/public_keys/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication BearerApiKey required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey: async (id: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getPublicKey', 'id', id) - const localVarPath = `/public_keys/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication BearerApiKey required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPublicKeys: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/public_keys`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication BearerApiKey required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - testPublicKey: async (id: string, testPublicKeyRequest: TestPublicKeyRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('testPublicKey', 'id', id) - // verify required parameter 'testPublicKeyRequest' is not null or undefined - assertParamExists('testPublicKey', 'testPublicKeyRequest', testPublicKeyRequest) - const localVarPath = `/public_keys/{id}/decode_jwt` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication BearerApiKey required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(testPublicKeyRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * PublicKeysApi - functional programming interface - * @export - */ -export const PublicKeysApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = PublicKeysApiAxiosParamCreator(configuration) - return { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createPublicKey(createPublicKeyRequest: CreatePublicKeyRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createPublicKey(createPublicKeyRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['PublicKeysApi.createPublicKey']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deletePublicKey(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deletePublicKey(id, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['PublicKeysApi.deletePublicKey']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getPublicKey(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicKey(id, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['PublicKeysApi.getPublicKey']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listPublicKeys(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listPublicKeys(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['PublicKeysApi.listPublicKeys']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async testPublicKey(id: string, testPublicKeyRequest: TestPublicKeyRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.testPublicKey(id, testPublicKeyRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['PublicKeysApi.testPublicKey']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * PublicKeysApi - factory interface - * @export - */ -export const PublicKeysApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = PublicKeysApiFp(configuration) - return { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createPublicKey(createPublicKeyRequest: CreatePublicKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createPublicKey(createPublicKeyRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePublicKey(id: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deletePublicKey(id, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey(id: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getPublicKey(id, options).then((request) => request(axios, basePath)); - }, - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPublicKeys(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listPublicKeys(options).then((request) => request(axios, basePath)); - }, - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - testPublicKey(id: string, testPublicKeyRequest: TestPublicKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.testPublicKey(id, testPublicKeyRequest, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * PublicKeysApi - object-oriented interface - * @export - * @class PublicKeysApi - * @extends {BaseAPI} - */ -export class PublicKeysApi extends BaseAPI { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - public createPublicKey(createPublicKeyRequest: CreatePublicKeyRequest, options?: RawAxiosRequestConfig) { - return PublicKeysApiFp(this.configuration).createPublicKey(createPublicKeyRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - public deletePublicKey(id: string, options?: RawAxiosRequestConfig) { - return PublicKeysApiFp(this.configuration).deletePublicKey(id, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - public getPublicKey(id: string, options?: RawAxiosRequestConfig) { - return PublicKeysApiFp(this.configuration).getPublicKey(id, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - public listPublicKeys(options?: RawAxiosRequestConfig) { - return PublicKeysApiFp(this.configuration).listPublicKeys(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - public testPublicKey(id: string, testPublicKeyRequest: TestPublicKeyRequest, options?: RawAxiosRequestConfig) { - return PublicKeysApiFp(this.configuration).testPublicKey(id, testPublicKeyRequest, options).then((request) => request(this.axios, this.basePath)); - } -} - - - /** * RewardsApi - axios parameter creator * @export diff --git a/dist/api.d.ts b/dist/api.d.ts index 30f8d93..dbec0c1 100644 --- a/dist/api.d.ts +++ b/dist/api.d.ts @@ -621,32 +621,6 @@ export interface CreatePublicKey { */ 'public_key': string; } -/** - * - * @export - * @interface CreatePublicKey200Response - */ -export interface CreatePublicKey200Response { - /** - * - * @type {PublicKeysResponsePublicKeysInner} - * @memberof CreatePublicKey200Response - */ - 'public_key': PublicKeysResponsePublicKeysInner; -} -/** - * - * @export - * @interface CreatePublicKeyRequest - */ -export interface CreatePublicKeyRequest { - /** - * Base64 encoded (public) PEM file - * @type {string} - * @memberof CreatePublicKeyRequest - */ - 'public_key': string; -} /** * * @export @@ -4528,44 +4502,6 @@ export interface PublicKey { */ 'last_used_at'?: string | null; } -/** - * - * @export - * @interface PublicKeysResponse - */ -export interface PublicKeysResponse { - /** - * - * @type {Array} - * @memberof PublicKeysResponse - */ - 'public_keys': Array; -} -/** - * To authenticate your requests using asymmetric key pairs (e.g., for signing embed requests), you need to share your public key with us. The public key resource allows you to manage your active public keys and track their last usage. - * @export - * @interface PublicKeysResponsePublicKeysInner - */ -export interface PublicKeysResponsePublicKeysInner { - /** - * - * @type {string} - * @memberof PublicKeysResponsePublicKeysInner - */ - 'id'?: string; - /** - * Your public key, PEM encoded - * @type {string} - * @memberof PublicKeysResponsePublicKeysInner - */ - 'pem'?: string; - /** - * The last time your public key was used to sign a request - * @type {string} - * @memberof PublicKeysResponsePublicKeysInner - */ - 'last_used_at'?: string | null; -} /** * Details of the recipient of the reward * @export @@ -5654,19 +5590,6 @@ export interface TestPublicKey { */ 'jwt': string; } -/** - * - * @export - * @interface TestPublicKeyRequest - */ -export interface TestPublicKeyRequest { - /** - * A JWT token encoded with RS256, signed using the RSA private key corresponding to your public key. - * @type {string} - * @memberof TestPublicKeyRequest - */ - 'jwt': string; -} /** * With a campaign you can define the look & feel of how rewards are sent out. It also lets you set the available products (different gift cards, charity, etc.) recipients can choose from. * @export @@ -7488,197 +7411,6 @@ export declare class ProductsApi extends BaseAPI { */ listProducts(country?: string, currency?: string, options?: RawAxiosRequestConfig): Promise>; } -/** - * PublicKeysApi - axios parameter creator - * @export - */ -export declare const PublicKeysApiAxiosParamCreator: (configuration?: Configuration) => { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createPublicKey: (createPublicKeyRequest: CreatePublicKeyRequest, options?: RawAxiosRequestConfig) => Promise; - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePublicKey: (id: string, options?: RawAxiosRequestConfig) => Promise; - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey: (id: string, options?: RawAxiosRequestConfig) => Promise; - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPublicKeys: (options?: RawAxiosRequestConfig) => Promise; - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - testPublicKey: (id: string, testPublicKeyRequest: TestPublicKeyRequest, options?: RawAxiosRequestConfig) => Promise; -}; -/** - * PublicKeysApi - functional programming interface - * @export - */ -export declare const PublicKeysApiFp: (configuration?: Configuration) => { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createPublicKey(createPublicKeyRequest: CreatePublicKeyRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePublicKey(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPublicKeys(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - testPublicKey(id: string, testPublicKeyRequest: TestPublicKeyRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>; -}; -/** - * PublicKeysApi - factory interface - * @export - */ -export declare const PublicKeysApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createPublicKey(createPublicKeyRequest: CreatePublicKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise; - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePublicKey(id: string, options?: RawAxiosRequestConfig): AxiosPromise; - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey(id: string, options?: RawAxiosRequestConfig): AxiosPromise; - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPublicKeys(options?: RawAxiosRequestConfig): AxiosPromise; - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - testPublicKey(id: string, testPublicKeyRequest: TestPublicKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise; -}; -/** - * PublicKeysApi - object-oriented interface - * @export - * @class PublicKeysApi - * @extends {BaseAPI} - */ -export declare class PublicKeysApi extends BaseAPI { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - createPublicKey(createPublicKeyRequest: CreatePublicKeyRequest, options?: RawAxiosRequestConfig): Promise>; - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - deletePublicKey(id: string, options?: RawAxiosRequestConfig): Promise>; - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - getPublicKey(id: string, options?: RawAxiosRequestConfig): Promise>; - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - listPublicKeys(options?: RawAxiosRequestConfig): Promise>; - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - testPublicKey(id: string, testPublicKeyRequest: TestPublicKeyRequest, options?: RawAxiosRequestConfig): Promise>; -} /** * RewardsApi - axios parameter creator * @export diff --git a/dist/api.js b/dist/api.js index 89f7371..3cd734c 100644 --- a/dist/api.js +++ b/dist/api.js @@ -24,7 +24,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); exports.MemberStatusEnum = exports.ListRewards200ResponseRewardsInnerValueCurrencyCodeEnum = exports.ListRewards200ResponseRewardsInnerDeliveryStatusEnum = exports.ListRewards200ResponseRewardsInnerDeliveryMethodEnum = exports.ListProductsResponseProductsInnerImagesInnerTypeEnum = exports.ListProductsResponseProductsInnerCurrencyCodesEnum = exports.ListProductsResponseProductsInnerCategoryEnum = exports.ListOrganizations200ResponseOrganizationsInnerStatusEnum = exports.ListOrders200ResponseOrdersInnerPaymentChannelEnum = exports.ListOrders200ResponseOrdersInnerChannelEnum = exports.ListOrders200ResponseOrdersInnerStatusEnum = exports.ListMembers200ResponseMembersInnerStatusEnum = exports.ListInvoices200ResponseInvoicesInnerStatusEnum = exports.ListFundingSources200ResponseFundingSourcesInnerMetaNetworkEnum = exports.ListFundingSources200ResponseFundingSourcesInnerMetaAccountTypeEnum = exports.ListFundingSources200ResponseFundingSourcesInnerTypeEnum = exports.ListFundingSources200ResponseFundingSourcesInnerMethodEnum = exports.ListFraudRules200ResponseFraudRulesInnerRuleTypeEnum = exports.ListFraudReviews200ResponseFraudReviewsInnerReasonsEnum = exports.ListFraudReviews200ResponseFraudReviewsInnerStatusEnum = exports.InvoiceStatusEnum = exports.GetMember200ResponseMemberEventsInnerTypeEnum = exports.GetMember200ResponseMemberStatusEnum = exports.GetFraudReview200ResponseFraudReviewRedemptionMethodEnum = exports.GetFraudReview200ResponseFraudReviewReasonsEnum = exports.GetFraudReview200ResponseFraudReviewStatusEnum = exports.FundingSourceTypeEnum = exports.FundingSourceMethodEnum = exports.FraudRulesListItemRuleTypeEnum = exports.FraudRuleType = exports.FraudRuleRequestConfigPeriodEnum = exports.FraudRuleRequestConfigTypeEnum = exports.FraudReviewStatus = exports.FraudReviewRedemptionMethod = exports.FraudReviewReason = exports.FraudReviewListItemReasonsEnum = exports.FraudReviewListItemStatusEnum = exports.FraudReviewRedemptionMethodEnum = exports.FraudReviewReasonsEnum = exports.FraudReviewStatusEnum = exports.FraudConfigRedeemedRewardsCountPeriodEnum = exports.FraudConfigRedeemedRewardsAmountPeriodEnum = exports.FraudConfigCountryTypeEnum = exports.DeliveryStatus = exports.DeliveryMethod = exports.DeliveryDetailsStatusEnum = exports.DeliveryDetailsMethodEnum = exports.CurrencyCodes = exports.CreateOrganization200ResponseOrganizationStatusEnum = exports.Channel = void 0; exports.FraudRulesApi = exports.FraudRulesApiFactory = exports.FraudRulesApiFp = exports.FraudRulesApiAxiosParamCreator = exports.ListFraudReviewsStatusEnum = exports.FraudReviewsApi = exports.FraudReviewsApiFactory = exports.FraudReviewsApiFp = exports.FraudReviewsApiAxiosParamCreator = exports.ForexApi = exports.ForexApiFactory = exports.ForexApiFp = exports.ForexApiAxiosParamCreator = exports.FieldsApi = exports.FieldsApiFactory = exports.FieldsApiFp = exports.FieldsApiAxiosParamCreator = exports.CampaignsApi = exports.CampaignsApiFactory = exports.CampaignsApiFp = exports.CampaignsApiAxiosParamCreator = exports.BalanceTransactionsApi = exports.BalanceTransactionsApiFactory = exports.BalanceTransactionsApiFp = exports.BalanceTransactionsApiAxiosParamCreator = exports.UpdateFraudRuleListRequestOperationEnum = exports.SingleRewardOrderWithoutLinkOrderChannelEnum = exports.SingleRewardOrderWithoutLinkOrderStatusEnum = exports.SingleRewardOrder1RewardDeliveryMethodEnum = exports.RewardWithoutLinkDeliveryStatusEnum = exports.RewardWithoutLinkDeliveryMethodEnum = exports.RewardValueCurrencyCodeEnum = exports.ReviewRedeemedRewardsCountPeriodEnum = exports.ReviewRedeemedRewardsAmountPeriodEnum = exports.ReviewCountryTypeEnum = exports.ProductCurrencyCodesEnum = exports.ProductCategoryEnum = exports.PaymentDetailsChannelEnum = exports.OrganizationStatusEnum = exports.OrderWithoutLinkChannelEnum = exports.OrderWithoutLinkStatusEnum = exports.OrderStatus = exports.OrderBasePaymentChannelEnum = exports.OrderBaseChannelEnum = exports.OrderBaseStatusEnum = exports.OrderChannelEnum = exports.OrderStatusEnum = exports.MemberWithoutEventsStatusEnum = exports.MemberWithEventsStatusEnum = exports.MemberBaseStatusEnum = void 0; -exports.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = exports.WebhooksApiAxiosParamCreator = exports.RolesApi = exports.RolesApiFactory = exports.RolesApiFp = exports.RolesApiAxiosParamCreator = exports.RewardsApi = exports.RewardsApiFactory = exports.RewardsApiFp = exports.RewardsApiAxiosParamCreator = exports.PublicKeysApi = exports.PublicKeysApiFactory = exports.PublicKeysApiFp = exports.PublicKeysApiAxiosParamCreator = exports.ProductsApi = exports.ProductsApiFactory = exports.ProductsApiFp = exports.ProductsApiAxiosParamCreator = exports.OrganizationsApi = exports.OrganizationsApiFactory = exports.OrganizationsApiFp = exports.OrganizationsApiAxiosParamCreator = exports.OrdersApi = exports.OrdersApiFactory = exports.OrdersApiFp = exports.OrdersApiAxiosParamCreator = exports.MembersApi = exports.MembersApiFactory = exports.MembersApiFp = exports.MembersApiAxiosParamCreator = exports.InvoicesApi = exports.InvoicesApiFactory = exports.InvoicesApiFp = exports.InvoicesApiAxiosParamCreator = exports.FundingSourcesApi = exports.FundingSourcesApiFactory = exports.FundingSourcesApiFp = exports.FundingSourcesApiAxiosParamCreator = exports.UpdateFraudRuleListRuleTypeEnum = exports.FraudRuleRuleTypeEnum = exports.DeleteFraudRuleRuleTypeEnum = void 0; +exports.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = exports.WebhooksApiAxiosParamCreator = exports.RolesApi = exports.RolesApiFactory = exports.RolesApiFp = exports.RolesApiAxiosParamCreator = exports.RewardsApi = exports.RewardsApiFactory = exports.RewardsApiFp = exports.RewardsApiAxiosParamCreator = exports.ProductsApi = exports.ProductsApiFactory = exports.ProductsApiFp = exports.ProductsApiAxiosParamCreator = exports.OrganizationsApi = exports.OrganizationsApiFactory = exports.OrganizationsApiFp = exports.OrganizationsApiAxiosParamCreator = exports.OrdersApi = exports.OrdersApiFactory = exports.OrdersApiFp = exports.OrdersApiAxiosParamCreator = exports.MembersApi = exports.MembersApiFactory = exports.MembersApiFp = exports.MembersApiAxiosParamCreator = exports.InvoicesApi = exports.InvoicesApiFactory = exports.InvoicesApiFp = exports.InvoicesApiAxiosParamCreator = exports.FundingSourcesApi = exports.FundingSourcesApiFactory = exports.FundingSourcesApiFp = exports.FundingSourcesApiAxiosParamCreator = exports.UpdateFraudRuleListRuleTypeEnum = exports.FraudRuleRuleTypeEnum = exports.DeleteFraudRuleRuleTypeEnum = void 0; const axios_1 = require("axios"); // Some imports not used depending on template conditions // @ts-ignore @@ -4360,391 +4360,6 @@ class ProductsApi extends base_1.BaseAPI { } } exports.ProductsApi = ProductsApi; -/** - * PublicKeysApi - axios parameter creator - * @export - */ -const PublicKeysApiAxiosParamCreator = function (configuration) { - return { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createPublicKey: (createPublicKeyRequest_1, ...args_1) => __awaiter(this, [createPublicKeyRequest_1, ...args_1], void 0, function* (createPublicKeyRequest, options = {}) { - // verify required parameter 'createPublicKeyRequest' is not null or undefined - (0, common_1.assertParamExists)('createPublicKey', 'createPublicKeyRequest', createPublicKeyRequest); - const localVarPath = `/public_keys`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - // authentication BearerApiKey required - // http bearer authentication required - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter['Content-Type'] = 'application/json'; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createPublicKeyRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions, - }; - }), - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePublicKey: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) { - // verify required parameter 'id' is not null or undefined - (0, common_1.assertParamExists)('deletePublicKey', 'id', id); - const localVarPath = `/public_keys/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - // authentication BearerApiKey required - // http bearer authentication required - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions, - }; - }), - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) { - // verify required parameter 'id' is not null or undefined - (0, common_1.assertParamExists)('getPublicKey', 'id', id); - const localVarPath = `/public_keys/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - // authentication BearerApiKey required - // http bearer authentication required - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions, - }; - }), - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPublicKeys: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/public_keys`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - // authentication BearerApiKey required - // http bearer authentication required - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions, - }; - }), - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - testPublicKey: (id_1, testPublicKeyRequest_1, ...args_1) => __awaiter(this, [id_1, testPublicKeyRequest_1, ...args_1], void 0, function* (id, testPublicKeyRequest, options = {}) { - // verify required parameter 'id' is not null or undefined - (0, common_1.assertParamExists)('testPublicKey', 'id', id); - // verify required parameter 'testPublicKeyRequest' is not null or undefined - (0, common_1.assertParamExists)('testPublicKey', 'testPublicKeyRequest', testPublicKeyRequest); - const localVarPath = `/public_keys/{id}/decode_jwt` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - // authentication BearerApiKey required - // http bearer authentication required - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter['Content-Type'] = 'application/json'; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(testPublicKeyRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions, - }; - }), - }; -}; -exports.PublicKeysApiAxiosParamCreator = PublicKeysApiAxiosParamCreator; -/** - * PublicKeysApi - functional programming interface - * @export - */ -const PublicKeysApiFp = function (configuration) { - const localVarAxiosParamCreator = (0, exports.PublicKeysApiAxiosParamCreator)(configuration); - return { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createPublicKey(createPublicKeyRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createPublicKey(createPublicKeyRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['PublicKeysApi.createPublicKey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePublicKey(id, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deletePublicKey(id, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['PublicKeysApi.deletePublicKey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey(id, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getPublicKey(id, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['PublicKeysApi.getPublicKey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPublicKeys(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listPublicKeys(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['PublicKeysApi.listPublicKeys']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - testPublicKey(id, testPublicKeyRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.testPublicKey(id, testPublicKeyRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['PublicKeysApi.testPublicKey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - }; -}; -exports.PublicKeysApiFp = PublicKeysApiFp; -/** - * PublicKeysApi - factory interface - * @export - */ -const PublicKeysApiFactory = function (configuration, basePath, axios) { - const localVarFp = (0, exports.PublicKeysApiFp)(configuration); - return { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createPublicKey(createPublicKeyRequest, options) { - return localVarFp.createPublicKey(createPublicKeyRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePublicKey(id, options) { - return localVarFp.deletePublicKey(id, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPublicKey(id, options) { - return localVarFp.getPublicKey(id, options).then((request) => request(axios, basePath)); - }, - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPublicKeys(options) { - return localVarFp.listPublicKeys(options).then((request) => request(axios, basePath)); - }, - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - testPublicKey(id, testPublicKeyRequest, options) { - return localVarFp.testPublicKey(id, testPublicKeyRequest, options).then((request) => request(axios, basePath)); - }, - }; -}; -exports.PublicKeysApiFactory = PublicKeysApiFactory; -/** - * PublicKeysApi - object-oriented interface - * @export - * @class PublicKeysApi - * @extends {BaseAPI} - */ -class PublicKeysApi extends base_1.BaseAPI { - /** - * Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub`
Property Type Description
public_key
string

Base64 encoded (public) PEM file

- * @summary Create public key - * @param {CreatePublicKeyRequest} createPublicKeyRequest Public key details - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - createPublicKey(createPublicKeyRequest, options) { - return (0, exports.PublicKeysApiFp)(this.configuration).createPublicKey(createPublicKeyRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Deactivates a public key. Any further attempt to verify a request signature with this key will fail. - * @summary Delete public key - * @param {string} id ID of the public key that should be deactivated - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - deletePublicKey(id, options) { - return (0, exports.PublicKeysApiFp)(this.configuration).deletePublicKey(id, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Retrieve an active public key, identified by the given `id` in the URL. - * @summary Retrieve public key - * @param {string} id ID of the public key that should be retrieved - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - getPublicKey(id, options) { - return (0, exports.PublicKeysApiFp)(this.configuration).getPublicKey(id, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys. - * @summary List public keys - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - listPublicKeys(options) { - return (0, exports.PublicKeysApiFp)(this.configuration).listPublicKeys(options).then((request) => request(this.axios, this.basePath)); - } - /** - * Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token. - * @summary Test public key - * @param {string} id ID of the public key to test - * @param {TestPublicKeyRequest} testPublicKeyRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PublicKeysApi - */ - testPublicKey(id, testPublicKeyRequest, options) { - return (0, exports.PublicKeysApiFp)(this.configuration).testPublicKey(id, testPublicKeyRequest, options).then((request) => request(this.axios, this.basePath)); - } -} -exports.PublicKeysApi = PublicKeysApi; /** * RewardsApi - axios parameter creator * @export