@vertikalx/vtx-backend-client 1.0.0-dev.98 → 1.0.0-dev.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.0-dev.98",
3
+ "version": "1.0.0-dev.99",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -9,8 +9,4 @@ export declare const DEFAULT_APP_KEY_HEADER = "io-stackbus-app-key";
9
9
  export declare const DEFAULT_SYSTEM_USER_TOKEN_HEADER = "io-stackbus-cms-system-user-token";
10
10
  export declare const DEFAULT_API_KEY_ID_HEADER = "io-stackbus-cms-api-key-id";
11
11
  export declare const DEFAULT_API_KEY_VALUE_HEADER = "io-stackbus-cms-api-key-value";
12
- export declare const DEFAULT_PROD_URL = "https://backend.vtxapp.net:443";
13
- export declare const DEFAULT_PREPROD_URL = "https://backend.vtxapp.net:443";
14
- export declare const DEFAULT_DEV_REMOTE_URL = "https://backend.vtxapp.net:443";
15
- export declare const DEFAULT_DEV_LOCAL_URL = "http://localhost:3010";
16
12
  export declare const DEFAULT_HEADERS: APICallHeaders;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_HEADERS = exports.DEFAULT_DEV_LOCAL_URL = exports.DEFAULT_DEV_REMOTE_URL = exports.DEFAULT_PREPROD_URL = exports.DEFAULT_PROD_URL = exports.DEFAULT_API_KEY_VALUE_HEADER = exports.DEFAULT_API_KEY_ID_HEADER = exports.DEFAULT_SYSTEM_USER_TOKEN_HEADER = exports.DEFAULT_APP_KEY_HEADER = exports.DEFAULT_SYSTEM_KEY_VALUE_HEADER = exports.DEFAULT_SYSTEM_KEY_NAME_HEADER = exports.DEFAULT_SYSTEM_ID_HEADER = exports.DEFAULT_SYSTEM_ID = void 0;
3
+ exports.DEFAULT_HEADERS = exports.DEFAULT_API_KEY_VALUE_HEADER = exports.DEFAULT_API_KEY_ID_HEADER = exports.DEFAULT_SYSTEM_USER_TOKEN_HEADER = exports.DEFAULT_APP_KEY_HEADER = exports.DEFAULT_SYSTEM_KEY_VALUE_HEADER = exports.DEFAULT_SYSTEM_KEY_NAME_HEADER = exports.DEFAULT_SYSTEM_ID_HEADER = exports.DEFAULT_SYSTEM_ID = void 0;
4
4
  exports.DEFAULT_SYSTEM_ID = 'vtx';
5
5
  exports.DEFAULT_SYSTEM_ID_HEADER = 'io-stackbus-cms-system-id';
6
6
  exports.DEFAULT_SYSTEM_KEY_NAME_HEADER = 'io-stackbus-cms-system-key-name';
@@ -9,10 +9,6 @@ exports.DEFAULT_APP_KEY_HEADER = 'io-stackbus-app-key';
9
9
  exports.DEFAULT_SYSTEM_USER_TOKEN_HEADER = 'io-stackbus-cms-system-user-token';
10
10
  exports.DEFAULT_API_KEY_ID_HEADER = 'io-stackbus-cms-api-key-id';
11
11
  exports.DEFAULT_API_KEY_VALUE_HEADER = 'io-stackbus-cms-api-key-value';
12
- exports.DEFAULT_PROD_URL = 'https://backend.vtxapp.net:443';
13
- exports.DEFAULT_PREPROD_URL = 'https://backend.vtxapp.net:443';
14
- exports.DEFAULT_DEV_REMOTE_URL = 'https://backend.vtxapp.net:443';
15
- exports.DEFAULT_DEV_LOCAL_URL = 'http://localhost:3010';
16
12
  exports.DEFAULT_HEADERS = {
17
13
  ["Content-Type"]: "application/json",
18
14
  [exports.DEFAULT_SYSTEM_ID_HEADER]: exports.DEFAULT_SYSTEM_ID
@@ -1 +1 @@
1
- {"version":3,"file":"api-call-headers.js","sourceRoot":"","sources":["../../../../../libs/vtx-backend-client/src/api/api-call-headers.ts"],"names":[],"mappings":";;;AAOa,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAG1B,QAAA,wBAAwB,GAAG,2BAA2B,CAAC;AAGvD,QAAA,8BAA8B,GAAG,iCAAiC,CAAC;AAGnE,QAAA,+BAA+B,GAAG,kCAAkC,CAAC;AAGrE,QAAA,sBAAsB,GAAG,qBAAqB,CAAC;AAG/C,QAAA,gCAAgC,GAAG,mCAAmC,CAAC;AAGvE,QAAA,yBAAyB,GAAG,4BAA4B,CAAC;AAGzD,QAAA,4BAA4B,GAAG,+BAA+B,CAAC;AAS/D,QAAA,gBAAgB,GAAG,gCAAgC,CAAC;AACpD,QAAA,mBAAmB,GAAG,gCAAgC,CAAC;AACvD,QAAA,sBAAsB,GAAG,gCAAgC,CAAC;AAC1D,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAGhD,QAAA,eAAe,GAAkB;IAC1C,CAAC,cAAc,CAAC,EAAC,kBAAkB;IACnC,CAAC,gCAAwB,CAAC,EAAC,yBAAiB;CAC/C,CAAC"}
1
+ {"version":3,"file":"api-call-headers.js","sourceRoot":"","sources":["../../../../../libs/vtx-backend-client/src/api/api-call-headers.ts"],"names":[],"mappings":";;;AAOa,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAG1B,QAAA,wBAAwB,GAAG,2BAA2B,CAAC;AAGvD,QAAA,8BAA8B,GAAG,iCAAiC,CAAC;AAGnE,QAAA,+BAA+B,GAAG,kCAAkC,CAAC;AAGrE,QAAA,sBAAsB,GAAG,qBAAqB,CAAC;AAG/C,QAAA,gCAAgC,GAAG,mCAAmC,CAAC;AAGvE,QAAA,yBAAyB,GAAG,4BAA4B,CAAC;AAGzD,QAAA,4BAA4B,GAAG,+BAA+B,CAAC;AAG/D,QAAA,eAAe,GAAkB;IAC1C,CAAC,cAAc,CAAC,EAAC,kBAAkB;IACnC,CAAC,gCAAwB,CAAC,EAAC,yBAAiB;CAC/C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { User, AddValuesResponse, UserToken, UserWithToken, Athlete, RegisterAthleteDto, Brand, CreateBrandDto, BrandGenqlSelection, AWSS3UploadUrl, AWSS3GetUploadDto, CreateTenantInput, Tenant, TenantWithUserLogin, RegisterUserToDomainFromEmailInput, DecodedToken, Sponsorship, SponsorshipGenqlSelection, CreateSponsorshipDto, SponsorAthleteInvitation, InviteAthletesDto, RegisterUserDto, VerificationCode, VerifyCodeDto, FindSponsorAthleteInvitationDto, FindVtxUserDto, City, SportLevel, Sport, UserImages, EditValueResponse, CreateAthleteCompetitionDto, AthleteCompetition, GetSportEventsDto, SportsEvent, CreateSportEventDto, GetAthleteCompetitionsDto, AthleteMembership, AthleteMembershipGenqlSelection, MembershipOrganizationReferenceGenqlSelection, MembershipOrganizationReference, CreateMembershipOrganizationDto, CreateAthleteMembershipDto, DeleteSingleValueDto, DeleteSingleValueResponse, FundRaisingCampaign, CreateFundingCampaignDto, FundRaisingCampaignGenqlSelection, AthleteQueryDto, AthleteQueryResponse, StripeSessionGenqlSelection, CreateStripeAccountDto, StripeSession, StripeAccountReferenceGenqlSelection, StripeAccountReference, StripeCheckoutSessionGenqlSelection, StripeCheckoutSession, DonationCheckoutDto, GetDatabaseFileDto, TextDatabaseFileGenqlSelection, TextDatabaseFile, StripeQueryDto, StripeObject, SetFundingStatusDto, EditPictureResponse, UploadAlbumsPicturesDto, EditPictureDto, Album, State, Country, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult, SetCompetitionResultDto, AthleteCompetitionResult, CodeVerificationResponse, resetPasswordDto, DeleteValuesDto } from '../client';
1
+ import { User, AddValuesResponse, UserToken, UserWithToken, Athlete, RegisterAthleteDto, Brand, CreateBrandDto, BrandGenqlSelection, AWSS3UploadUrl, AWSS3GetUploadDto, CreateTenantInput, Tenant, TenantWithUserLogin, RegisterUserToDomainFromEmailInput, DecodedToken, Sponsorship, SponsorshipGenqlSelection, CreateSponsorshipDto, SponsorAthleteInvitation, InviteAthletesDto, RegisterUserDto, VerificationCode, VerifyCodeDto, FindSponsorAthleteInvitationDto, FindVtxUserDto, City, SportLevel, Sport, UserImages, EditValueResponse, CreateAthleteCompetitionDto, AthleteCompetition, GetSportEventsDto, SportsEvent, CreateSportEventDto, GetAthleteCompetitionsDto, AthleteMembership, AthleteMembershipGenqlSelection, MembershipOrganizationReferenceGenqlSelection, MembershipOrganizationReference, CreateMembershipOrganizationDto, CreateAthleteMembershipDto, DeleteSingleValueDto, DeleteSingleValueResponse, FundRaisingCampaign, CreateFundingCampaignDto, FundRaisingCampaignGenqlSelection, AthleteQueryDto, AthleteQueryResponse, StripeSessionGenqlSelection, CreateStripeAccountDto, StripeSession, StripeAccountReferenceGenqlSelection, StripeAccountReference, StripeCheckoutSessionGenqlSelection, StripeCheckoutSession, DonationCheckoutDto, GetDatabaseFileDto, TextDatabaseFileGenqlSelection, TextDatabaseFile, StripeQueryDto, StripeObject, SetFundingStatusDto, EditPictureResponse, UploadAlbumsPicturesDto, EditPictureDto, Album, State, Country, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult, SetCompetitionResultDto, AthleteCompetitionResult, CodeVerificationResponse, resetPasswordDto, DeleteValuesDto, existValueDto, ExistValueResponse } from '../client';
2
2
  import { ITypedBackendResponse } from './backend-response';
3
3
  import { APICallHeaders } from './api-call-headers';
4
4
  import { VerificationCodeType } from '@stackbus/common-types';
@@ -99,4 +99,5 @@ export declare class VTXBaseAPI {
99
99
  verifyCode(input: VerifyCodeDto): Promise<ITypedBackendResponse<CodeVerificationResponse>>;
100
100
  resetUserPassword(input: resetPasswordDto): Promise<ITypedBackendResponse<EditValueResponse>>;
101
101
  deleteAlbumFotos(dto: DeleteValuesDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
102
+ screenNameAviability(dto: existValueDto): Promise<ITypedBackendResponse<ExistValueResponse>>;
102
103
  }
@@ -7,6 +7,10 @@ const api_call_headers_1 = require("./api-call-headers");
7
7
  const response_builder_1 = require("./response-builder");
8
8
  const domains_1 = require("./domains");
9
9
  const vtx_core_common_1 = require("@vertikalx/vtx-core-common");
10
+ const DEFAULT_PROD_URL = 'https://backend.vtxathlete.com:443';
11
+ const DEFAULT_PREPROD_URL = 'https://backend.vtxathlete.com:443';
12
+ const DEFAULT_DEV_REMOTE_URL = 'https://backend.vtxathlete.com:443';
13
+ const DEFAULT_DEV_LOCAL_URL = 'http://localhost:3010';
10
14
  class VTXBaseAPI {
11
15
  constructor(headers, backendUrl) {
12
16
  this.headers = headers ?? api_call_headers_1.DEFAULT_HEADERS;
@@ -19,23 +23,23 @@ class VTXBaseAPI {
19
23
  this.headers[key] = value;
20
24
  }
21
25
  static getDefaultBackendUrl() {
22
- let retValue = api_call_headers_1.DEFAULT_PROD_URL;
26
+ let retValue = DEFAULT_PROD_URL;
23
27
  switch (process.env?.NODE_ENV) {
24
28
  case 'production':
25
- retValue = api_call_headers_1.DEFAULT_PROD_URL;
29
+ retValue = DEFAULT_PROD_URL;
26
30
  break;
27
31
  case 'preprod':
28
- retValue = api_call_headers_1.DEFAULT_PREPROD_URL;
32
+ retValue = DEFAULT_PREPROD_URL;
29
33
  break;
30
34
  case 'development':
31
35
  case 'devlocal':
32
- retValue = api_call_headers_1.DEFAULT_DEV_LOCAL_URL;
36
+ retValue = DEFAULT_DEV_LOCAL_URL;
33
37
  break;
34
38
  case 'devremote':
35
- retValue = api_call_headers_1.DEFAULT_DEV_REMOTE_URL;
39
+ retValue = DEFAULT_DEV_REMOTE_URL;
36
40
  break;
37
41
  default:
38
- retValue = api_call_headers_1.DEFAULT_PROD_URL;
42
+ retValue = DEFAULT_PROD_URL;
39
43
  break;
40
44
  }
41
45
  return retValue;
@@ -7005,6 +7009,42 @@ class VTXBaseAPI {
7005
7009
  console.log(JSON.stringify(retValue, null, 2));
7006
7010
  return retValue;
7007
7011
  }
7012
+ async screenNameAviability(dto) {
7013
+ console.log('HEADERS:');
7014
+ console.log(JSON.stringify(this.headers, null, 2));
7015
+ const client = (0, client_1.createClient)({
7016
+ url: this.backendUrl + '/graphql',
7017
+ headers: this.headers,
7018
+ });
7019
+ let retValue = {};
7020
+ const fields = {
7021
+ exist: true
7022
+ };
7023
+ try {
7024
+ const response = await client.query({
7025
+ screenNameAvailability: {
7026
+ __args: {
7027
+ input: dto
7028
+ },
7029
+ ...fields
7030
+ },
7031
+ });
7032
+ console.log('screenNameAvailability Response:');
7033
+ console.log(JSON.stringify(response, null, 2));
7034
+ retValue = (0, response_builder_1.buildResponse)(response, 'screenNameAvailability', (r) => {
7035
+ const isResponseOk = response?.screenNameAvailability?.exist === false || response?.screenNameAvailability?.exist === true;
7036
+ return isResponseOk;
7037
+ });
7038
+ }
7039
+ catch (err1) {
7040
+ console.error('screenNameAvailability err1:');
7041
+ console.error(err1);
7042
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
7043
+ }
7044
+ console.log('retValue:');
7045
+ console.log(JSON.stringify(retValue, null, 2));
7046
+ return retValue;
7047
+ }
7008
7048
  }
7009
7049
  exports.VTXBaseAPI = VTXBaseAPI;
7010
7050
  VTXBaseAPI.Logger = {