diff --git a/CHANGELOG.md b/CHANGELOG.md index df1f7ab..d705073 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.10] - 2024-09-27 +### Added +- Telegram Mini App auth provider + ## [0.8.9] - 2024-09-27 ### Added - Telegram auth provider diff --git a/examples/apps/auth-sample/package.json b/examples/apps/auth-sample/package.json index fcffa8d..6f431ff 100644 --- a/examples/apps/auth-sample/package.json +++ b/examples/apps/auth-sample/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@heroicons/react": "^2.0.13", - "@openfort/openfort-js": "0.8.9", + "@openfort/openfort-js": "0.8.10", "@openfort/openfort-node": "^0.6.65", "@radix-ui/react-toast": "^1.1.2", "@rainbow-me/rainbowkit": "^2.1.1", diff --git a/packages/internal/openapi-clients/src/backend-openapi.json b/packages/internal/openapi-clients/src/backend-openapi.json index d8d158c..20127c7 100644 --- a/packages/internal/openapi-clients/src/backend-openapi.json +++ b/packages/internal/openapi-clients/src/backend-openapi.json @@ -52,7 +52,8 @@ "facebook", "discord", "epic_games", - "telegram" + "telegram", + "line" ], "type": "string" }, @@ -65,7 +66,8 @@ "playfab", "supabase", "custom", - "oidc" + "oidc", + "telegramMiniApp" ], "type": "string" }, @@ -1421,6 +1423,40 @@ "type": "object", "additionalProperties": false }, + "OAuthProvider.LINE": { + "enum": [ + "line" + ], + "type": "string" + }, + "LineOAuthConfig": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable OAuth provider." + }, + "provider": { + "$ref": "#/components/schemas/OAuthProvider.LINE", + "description": "OAuth provider type" + }, + "channelId": { + "type": "string", + "description": "Line Channel ID." + }, + "channelSecret": { + "type": "string", + "description": "Line Channel secret." + } + }, + "required": [ + "enabled", + "provider", + "channelId", + "channelSecret" + ], + "type": "object", + "additionalProperties": false + }, "OAuthProvider.DISCORD": { "enum": [ "discord" @@ -1455,6 +1491,35 @@ "type": "object", "additionalProperties": false }, + "ThirdPartyOAuthProvider.TELEGRAM_MINI_APP": { + "enum": [ + "telegramMiniApp" + ], + "type": "string" + }, + "TelegramThirdPartyConfig": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable OAuth provider." + }, + "provider": { + "$ref": "#/components/schemas/ThirdPartyOAuthProvider.TELEGRAM_MINI_APP", + "description": "OAuth provider type" + }, + "botToken": { + "type": "string", + "description": "Telegram bot token." + } + }, + "required": [ + "enabled", + "provider", + "botToken" + ], + "type": "object", + "additionalProperties": false + }, "OAuthProvider.EPIC_GAMES": { "enum": [ "epic_games" @@ -1630,9 +1695,15 @@ { "$ref": "#/components/schemas/FacebookOAuthConfig" }, + { + "$ref": "#/components/schemas/LineOAuthConfig" + }, { "$ref": "#/components/schemas/DiscordOAuthConfig" }, + { + "$ref": "#/components/schemas/TelegramThirdPartyConfig" + }, { "$ref": "#/components/schemas/EpicGamesOAuthConfig" }, @@ -6005,6 +6076,9 @@ }, "functionName": { "type": "string" + }, + "wildcard": { + "type": "boolean" } }, "required": [ @@ -6012,8 +6086,7 @@ "object", "createdAt", "type", - "contract", - "functionName" + "wildcard" ], "type": "object", "additionalProperties": false @@ -6843,6 +6916,11 @@ "description": "The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.", "example": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35" }, + "wildcard": { + "type": "boolean", + "description": "When using `contract_functions` type, set this to `true` to allow all contracts.", + "example": true + }, "gasLimit": { "type": "string", "description": "Gas limit in WEI (i.e. factor 10^18).", @@ -6894,6 +6972,11 @@ "description": "The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.", "example": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35" }, + "wildcard": { + "type": "boolean", + "description": "When using `contract_functions` type, set this to `true` to allow all contracts.", + "example": true + }, "gasLimit": { "type": "string", "description": "Gas limit in WEI (i.e. factor 10^18).", @@ -7168,8 +7251,7 @@ "address", "chainId", "validAfter", - "validUntil", - "player" + "validUntil" ], "type": "object", "additionalProperties": false @@ -14673,6 +14755,7 @@ { "createdAt": 1689869074, "id": "afu_...", + "wildcard": false, "object": "policyRule", "type": "contract_functions", "contract": { @@ -14779,6 +14862,7 @@ "value": { "createdAt": 1689869074, "id": "afu_...", + "wildcard": false, "object": "policyRule", "type": "contract_functions", "contract": { @@ -15195,6 +15279,12 @@ { "sk": [] }, + { + "pk_third_party": [] + }, + { + "pk_access_token": [] + }, { "pk_identity_token": [] } @@ -15290,6 +15380,12 @@ { "sk": [] }, + { + "pk_third_party": [] + }, + { + "pk_access_token": [] + }, { "pk_identity_token": [] } diff --git a/packages/internal/openapi-clients/src/backend/.openapi-generator/FILES b/packages/internal/openapi-clients/src/backend/.openapi-generator/FILES index 71db99e..f7e7717 100644 --- a/packages/internal/openapi-clients/src/backend/.openapi-generator/FILES +++ b/packages/internal/openapi-clients/src/backend/.openapi-generator/FILES @@ -182,6 +182,7 @@ models/inventory-list-response.ts models/inventory-response.ts models/jwt-key-response.ts models/jwt-key.ts +models/line-oauth-config.ts models/linked-account-response.ts models/list-subscription-logs-request.ts models/log-response.ts @@ -205,6 +206,7 @@ models/oauth-provider-discord.ts models/oauth-provider-epicgames.ts models/oauth-provider-facebook.ts models/oauth-provider-google.ts +models/oauth-provider-line.ts models/oauth-provider-telegram.ts models/oauth-provider-twitter.ts models/oauth-provider.ts @@ -302,6 +304,7 @@ models/subscription-response-plan.ts models/subscription-response.ts models/supabase-auth-config.ts models/telegram-oauth-config.ts +models/telegram-third-party-config.ts models/third-party-oauth-provider-accelbyte.ts models/third-party-oauth-provider-custom.ts models/third-party-oauth-provider-firebase.ts @@ -309,6 +312,7 @@ models/third-party-oauth-provider-lootlocker.ts models/third-party-oauth-provider-oidc.ts models/third-party-oauth-provider-playfab.ts models/third-party-oauth-provider-supabase.ts +models/third-party-oauth-provider-telegramminiapp.ts models/third-party-oauth-provider.ts models/third-party-oauth-request.ts models/time-interval-type.ts diff --git a/packages/internal/openapi-clients/src/backend/models/contract-policy-rule-response.ts b/packages/internal/openapi-clients/src/backend/models/contract-policy-rule-response.ts index d0d4399..a2f7c4a 100644 --- a/packages/internal/openapi-clients/src/backend/models/contract-policy-rule-response.ts +++ b/packages/internal/openapi-clients/src/backend/models/contract-policy-rule-response.ts @@ -58,13 +58,19 @@ export interface ContractPolicyRuleResponse { * @type {ContractPolicyRuleResponseContract} * @memberof ContractPolicyRuleResponse */ - 'contract': ContractPolicyRuleResponseContract; + 'contract'?: ContractPolicyRuleResponseContract; /** * * @type {string} * @memberof ContractPolicyRuleResponse */ - 'functionName': string; + 'functionName'?: string; + /** + * + * @type {boolean} + * @memberof ContractPolicyRuleResponse + */ + 'wildcard': boolean; } diff --git a/packages/internal/openapi-clients/src/backend/models/create-policy-rule-request.ts b/packages/internal/openapi-clients/src/backend/models/create-policy-rule-request.ts index bbbc1af..6c23816 100644 --- a/packages/internal/openapi-clients/src/backend/models/create-policy-rule-request.ts +++ b/packages/internal/openapi-clients/src/backend/models/create-policy-rule-request.ts @@ -44,6 +44,12 @@ export interface CreatePolicyRuleRequest { * @memberof CreatePolicyRuleRequest */ 'contract'?: string; + /** + * When using `contract_functions` type, set this to `true` to allow all contracts. + * @type {boolean} + * @memberof CreatePolicyRuleRequest + */ + 'wildcard'?: boolean; /** * Gas limit in WEI (i.e. factor 10^18). * @type {string} diff --git a/packages/internal/openapi-clients/src/backend/models/create-session-request.ts b/packages/internal/openapi-clients/src/backend/models/create-session-request.ts index 642c21e..f5c68dd 100644 --- a/packages/internal/openapi-clients/src/backend/models/create-session-request.ts +++ b/packages/internal/openapi-clients/src/backend/models/create-session-request.ts @@ -79,6 +79,6 @@ export interface CreateSessionRequest { * @type {string} * @memberof CreateSessionRequest */ - 'player': string; + 'player'?: string; } diff --git a/packages/internal/openapi-clients/src/backend/models/index.ts b/packages/internal/openapi-clients/src/backend/models/index.ts index c5d0c5b..6624217 100644 --- a/packages/internal/openapi-clients/src/backend/models/index.ts +++ b/packages/internal/openapi-clients/src/backend/models/index.ts @@ -156,6 +156,7 @@ export * from './inventory-list-response'; export * from './inventory-response'; export * from './jwt-key'; export * from './jwt-key-response'; +export * from './line-oauth-config'; export * from './linked-account-response'; export * from './list-subscription-logs-request'; export * from './log'; @@ -180,6 +181,7 @@ export * from './oauth-provider-discord'; export * from './oauth-provider-epicgames'; export * from './oauth-provider-facebook'; export * from './oauth-provider-google'; +export * from './oauth-provider-line'; export * from './oauth-provider-telegram'; export * from './oauth-provider-twitter'; export * from './oauth-request'; @@ -276,6 +278,7 @@ export * from './subscription-response'; export * from './subscription-response-plan'; export * from './supabase-auth-config'; export * from './telegram-oauth-config'; +export * from './telegram-third-party-config'; export * from './third-party-oauth-provider'; export * from './third-party-oauth-provider-accelbyte'; export * from './third-party-oauth-provider-custom'; @@ -284,6 +287,7 @@ export * from './third-party-oauth-provider-lootlocker'; export * from './third-party-oauth-provider-oidc'; export * from './third-party-oauth-provider-playfab'; export * from './third-party-oauth-provider-supabase'; +export * from './third-party-oauth-provider-telegramminiapp'; export * from './third-party-oauth-request'; export * from './time-interval-type'; export * from './token'; diff --git a/packages/internal/openapi-clients/src/backend/models/line-oauth-config.ts b/packages/internal/openapi-clients/src/backend/models/line-oauth-config.ts new file mode 100644 index 0000000..744d46a --- /dev/null +++ b/packages/internal/openapi-clients/src/backend/models/line-oauth-config.ts @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Openfort API + * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: founders@openfort.xyz + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { OAuthProviderLINE } from './oauth-provider-line'; + +/** + * + * @export + * @interface LineOAuthConfig + */ +export interface LineOAuthConfig { + /** + * Enable OAuth provider. + * @type {boolean} + * @memberof LineOAuthConfig + */ + 'enabled': boolean; + /** + * + * @type {OAuthProviderLINE} + * @memberof LineOAuthConfig + */ + 'provider': OAuthProviderLINE; + /** + * Line Channel ID. + * @type {string} + * @memberof LineOAuthConfig + */ + 'channelId': string; + /** + * Line Channel secret. + * @type {string} + * @memberof LineOAuthConfig + */ + 'channelSecret': string; +} + + + diff --git a/packages/internal/openapi-clients/src/backend/models/oauth-config.ts b/packages/internal/openapi-clients/src/backend/models/oauth-config.ts index 0e525a3..7c40d30 100644 --- a/packages/internal/openapi-clients/src/backend/models/oauth-config.ts +++ b/packages/internal/openapi-clients/src/backend/models/oauth-config.ts @@ -36,6 +36,9 @@ import { FirebaseOAuthConfig } from './firebase-oauth-config'; import { GoogleOAuthConfig } from './google-oauth-config'; // May contain unused imports in some cases // @ts-ignore +import { LineOAuthConfig } from './line-oauth-config'; +// May contain unused imports in some cases +// @ts-ignore import { LootLockerOAuthConfig } from './loot-locker-oauth-config'; // May contain unused imports in some cases // @ts-ignore @@ -51,6 +54,9 @@ import { SupabaseAuthConfig } from './supabase-auth-config'; import { TelegramOAuthConfig } from './telegram-oauth-config'; // May contain unused imports in some cases // @ts-ignore +import { TelegramThirdPartyConfig } from './telegram-third-party-config'; +// May contain unused imports in some cases +// @ts-ignore import { ThirdPartyOAuthProviderLOOTLOCKER } from './third-party-oauth-provider-lootlocker'; // May contain unused imports in some cases // @ts-ignore @@ -134,6 +140,18 @@ export interface OAuthConfig { * @memberof OAuthConfig */ 'botToken': string; + /** + * Line Channel ID. + * @type {string} + * @memberof OAuthConfig + */ + 'channelId': string; + /** + * Line Channel secret. + * @type {string} + * @memberof OAuthConfig + */ + 'channelSecret': string; /** * Title ID of your Play Fab gaming service environment. * @type {string} diff --git a/packages/internal/openapi-clients/src/backend/models/oauth-provider-line.ts b/packages/internal/openapi-clients/src/backend/models/oauth-provider-line.ts new file mode 100644 index 0000000..47472dd --- /dev/null +++ b/packages/internal/openapi-clients/src/backend/models/oauth-provider-line.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Openfort API + * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: founders@openfort.xyz + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @enum {string} + */ + +export const OAuthProviderLINE = { + Line: 'line' +} as const; + +export type OAuthProviderLINE = typeof OAuthProviderLINE[keyof typeof OAuthProviderLINE]; + + + diff --git a/packages/internal/openapi-clients/src/backend/models/oauth-provider.ts b/packages/internal/openapi-clients/src/backend/models/oauth-provider.ts index 32edfa4..e4f4e77 100644 --- a/packages/internal/openapi-clients/src/backend/models/oauth-provider.ts +++ b/packages/internal/openapi-clients/src/backend/models/oauth-provider.ts @@ -26,7 +26,8 @@ export const OAuthProvider = { Facebook: 'facebook', Discord: 'discord', EpicGames: 'epic_games', - Telegram: 'telegram' + Telegram: 'telegram', + Line: 'line' } as const; export type OAuthProvider = typeof OAuthProvider[keyof typeof OAuthProvider]; diff --git a/packages/internal/openapi-clients/src/backend/models/policy-response-policy-rules-inner.ts b/packages/internal/openapi-clients/src/backend/models/policy-response-policy-rules-inner.ts index be4098c..b70e7bf 100644 --- a/packages/internal/openapi-clients/src/backend/models/policy-response-policy-rules-inner.ts +++ b/packages/internal/openapi-clients/src/backend/models/policy-response-policy-rules-inner.ts @@ -70,13 +70,19 @@ export interface PolicyResponsePolicyRulesInner { * @type {ContractPolicyRuleResponseContract} * @memberof PolicyResponsePolicyRulesInner */ - 'contract': ContractPolicyRuleResponseContract; + 'contract'?: ContractPolicyRuleResponseContract; /** * * @type {PolicyRateLimitCOUNTPERINTERVAL} * @memberof PolicyResponsePolicyRulesInner */ 'functionName': PolicyRateLimitCOUNTPERINTERVAL; + /** + * + * @type {boolean} + * @memberof PolicyResponsePolicyRulesInner + */ + 'wildcard': boolean; /** * * @type {string} diff --git a/packages/internal/openapi-clients/src/backend/models/policy-rule-response.ts b/packages/internal/openapi-clients/src/backend/models/policy-rule-response.ts index 3510638..7dc1b14 100644 --- a/packages/internal/openapi-clients/src/backend/models/policy-rule-response.ts +++ b/packages/internal/openapi-clients/src/backend/models/policy-rule-response.ts @@ -79,13 +79,19 @@ export interface PolicyRuleResponse { * @type {ContractPolicyRuleResponseContract} * @memberof PolicyRuleResponse */ - 'contract': ContractPolicyRuleResponseContract; + 'contract'?: ContractPolicyRuleResponseContract; /** * * @type {PolicyRateLimitCOUNTPERINTERVAL} * @memberof PolicyRuleResponse */ 'functionName': PolicyRateLimitCOUNTPERINTERVAL; + /** + * + * @type {boolean} + * @memberof PolicyRuleResponse + */ + 'wildcard': boolean; /** * * @type {string} diff --git a/packages/internal/openapi-clients/src/backend/models/telegram-third-party-config.ts b/packages/internal/openapi-clients/src/backend/models/telegram-third-party-config.ts new file mode 100644 index 0000000..ace5418 --- /dev/null +++ b/packages/internal/openapi-clients/src/backend/models/telegram-third-party-config.ts @@ -0,0 +1,47 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Openfort API + * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: founders@openfort.xyz + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { ThirdPartyOAuthProviderTELEGRAMMINIAPP } from './third-party-oauth-provider-telegramminiapp'; + +/** + * + * @export + * @interface TelegramThirdPartyConfig + */ +export interface TelegramThirdPartyConfig { + /** + * Enable OAuth provider. + * @type {boolean} + * @memberof TelegramThirdPartyConfig + */ + 'enabled': boolean; + /** + * + * @type {ThirdPartyOAuthProviderTELEGRAMMINIAPP} + * @memberof TelegramThirdPartyConfig + */ + 'provider': ThirdPartyOAuthProviderTELEGRAMMINIAPP; + /** + * Telegram bot token. + * @type {string} + * @memberof TelegramThirdPartyConfig + */ + 'botToken': string; +} + + + diff --git a/packages/internal/openapi-clients/src/backend/models/third-party-oauth-provider-telegramminiapp.ts b/packages/internal/openapi-clients/src/backend/models/third-party-oauth-provider-telegramminiapp.ts new file mode 100644 index 0000000..ffc3c92 --- /dev/null +++ b/packages/internal/openapi-clients/src/backend/models/third-party-oauth-provider-telegramminiapp.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Openfort API + * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: founders@openfort.xyz + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @enum {string} + */ + +export const ThirdPartyOAuthProviderTELEGRAMMINIAPP = { + TelegramMiniApp: 'telegramMiniApp' +} as const; + +export type ThirdPartyOAuthProviderTELEGRAMMINIAPP = typeof ThirdPartyOAuthProviderTELEGRAMMINIAPP[keyof typeof ThirdPartyOAuthProviderTELEGRAMMINIAPP]; + + + diff --git a/packages/internal/openapi-clients/src/backend/models/third-party-oauth-provider.ts b/packages/internal/openapi-clients/src/backend/models/third-party-oauth-provider.ts index be327f4..93e845a 100644 --- a/packages/internal/openapi-clients/src/backend/models/third-party-oauth-provider.ts +++ b/packages/internal/openapi-clients/src/backend/models/third-party-oauth-provider.ts @@ -27,7 +27,8 @@ export const ThirdPartyOAuthProvider = { Playfab: 'playfab', Supabase: 'supabase', Custom: 'custom', - Oidc: 'oidc' + Oidc: 'oidc', + TelegramMiniApp: 'telegramMiniApp' } as const; export type ThirdPartyOAuthProvider = typeof ThirdPartyOAuthProvider[keyof typeof ThirdPartyOAuthProvider]; diff --git a/packages/internal/openapi-clients/src/backend/models/update-policy-rule-request.ts b/packages/internal/openapi-clients/src/backend/models/update-policy-rule-request.ts index 94944ab..0402316 100644 --- a/packages/internal/openapi-clients/src/backend/models/update-policy-rule-request.ts +++ b/packages/internal/openapi-clients/src/backend/models/update-policy-rule-request.ts @@ -44,6 +44,12 @@ export interface UpdatePolicyRuleRequest { * @memberof UpdatePolicyRuleRequest */ 'contract'?: string; + /** + * When using `contract_functions` type, set this to `true` to allow all contracts. + * @type {boolean} + * @memberof UpdatePolicyRuleRequest + */ + 'wildcard'?: boolean; /** * Gas limit in WEI (i.e. factor 10^18). * @type {string} diff --git a/sdk/src/types.ts b/sdk/src/types.ts index 755b626..61b9331 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -103,6 +103,7 @@ export enum ThirdPartyOAuthProvider { SUPABASE = 'supabase', CUSTOM = 'custom', OIDC = 'oidc', + TELEGRAM_MINI_APP = 'telegramMiniApp', } export enum BasicAuthProvider { @@ -116,6 +117,7 @@ export const AUTH_PROVIDER = { google: 'google', twitter: 'twitter', telegram: 'telegram', + telegramMiniApp: 'telegramMiniApp', discord: 'discord', facebook: 'facebook', epicGames: 'epic_games', diff --git a/sdk/src/version.ts b/sdk/src/version.ts index 0ee97b4..97c3563 100644 --- a/sdk/src/version.ts +++ b/sdk/src/version.ts @@ -1,2 +1,2 @@ -export const VERSION = '0.8.9'; +export const VERSION = '0.8.10'; export const PACKAGE = '@openfort/openfort-js';