-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Tldraw client module with API integration and configuration
- Loading branch information
1 parent
a9842f2
commit ceb4003
Showing
22 changed files
with
1,037 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
wwwroot/*.js | ||
node_modules | ||
typings | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm |
23 changes: 23 additions & 0 deletions
23
apps/server/src/infra/tldraw-client/generated/.openapi-generator-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
13 changes: 13 additions & 0 deletions
13
apps/server/src/infra/tldraw-client/generated/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.gitignore | ||
.npmignore | ||
.openapi-generator-ignore | ||
api.ts | ||
api/tldraw-config-api.ts | ||
api/tldraw-document-api.ts | ||
base.ts | ||
common.ts | ||
configuration.ts | ||
git_push.sh | ||
index.ts | ||
models/index.ts | ||
models/tldraw-public-config-response.ts |
1 change: 1 addition & 0 deletions
1
apps/server/src/infra/tldraw-client/generated/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Tldraw API | ||
* The Tldraw API to persist and share drawings | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
|
||
export * from './api/tldraw-config-api'; | ||
export * from './api/tldraw-document-api'; | ||
|
141 changes: 141 additions & 0 deletions
141
apps/server/src/infra/tldraw-client/generated/api/tldraw-config-api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Tldraw API | ||
* The Tldraw API to persist and share drawings | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
import type { Configuration } from '../configuration'; | ||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; | ||
import globalAxios from 'axios'; | ||
// Some imports not used depending on template conditions | ||
// @ts-ignore | ||
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; | ||
// @ts-ignore | ||
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; | ||
// @ts-ignore | ||
import type { TldrawPublicConfigResponse } from '../models'; | ||
/** | ||
* TldrawConfigApi - axios parameter creator | ||
* @export | ||
*/ | ||
export const TldrawConfigApiAxiosParamCreator = function (configuration?: Configuration) { | ||
return { | ||
/** | ||
* | ||
* @summary Useable configuration for clients | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
publicConfig: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { | ||
const localVarPath = `/api/tldraw/config/public`; | ||
// 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; | ||
|
||
|
||
|
||
setSearchParams(localVarUrlObj, localVarQueryParameter); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; | ||
|
||
return { | ||
url: toPathString(localVarUrlObj), | ||
options: localVarRequestOptions, | ||
}; | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* TldrawConfigApi - functional programming interface | ||
* @export | ||
*/ | ||
export const TldrawConfigApiFp = function(configuration?: Configuration) { | ||
const localVarAxiosParamCreator = TldrawConfigApiAxiosParamCreator(configuration) | ||
return { | ||
/** | ||
* | ||
* @summary Useable configuration for clients | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async publicConfig(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TldrawPublicConfigResponse>> { | ||
const localVarAxiosArgs = await localVarAxiosParamCreator.publicConfig(options); | ||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; | ||
const localVarOperationServerBasePath = operationServerMap['TldrawConfigApi.publicConfig']?.[localVarOperationServerIndex]?.url; | ||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* TldrawConfigApi - factory interface | ||
* @export | ||
*/ | ||
export const TldrawConfigApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { | ||
const localVarFp = TldrawConfigApiFp(configuration) | ||
return { | ||
/** | ||
* | ||
* @summary Useable configuration for clients | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
publicConfig(options?: any): AxiosPromise<TldrawPublicConfigResponse> { | ||
return localVarFp.publicConfig(options).then((request) => request(axios, basePath)); | ||
}, | ||
}; | ||
}; | ||
|
||
/** | ||
* TldrawConfigApi - interface | ||
* @export | ||
* @interface TldrawConfigApi | ||
*/ | ||
export interface TldrawConfigApiInterface { | ||
/** | ||
* | ||
* @summary Useable configuration for clients | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof TldrawConfigApiInterface | ||
*/ | ||
publicConfig(options?: RawAxiosRequestConfig): AxiosPromise<TldrawPublicConfigResponse>; | ||
|
||
} | ||
|
||
/** | ||
* TldrawConfigApi - object-oriented interface | ||
* @export | ||
* @class TldrawConfigApi | ||
* @extends {BaseAPI} | ||
*/ | ||
export class TldrawConfigApi extends BaseAPI implements TldrawConfigApiInterface { | ||
/** | ||
* | ||
* @summary Useable configuration for clients | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof TldrawConfigApi | ||
*/ | ||
public publicConfig(options?: RawAxiosRequestConfig) { | ||
return TldrawConfigApiFp(this.configuration).publicConfig(options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
} | ||
|
142 changes: 142 additions & 0 deletions
142
apps/server/src/infra/tldraw-client/generated/api/tldraw-document-api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Tldraw API | ||
* The Tldraw API to persist and share drawings | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
import type { Configuration } from '../configuration'; | ||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; | ||
import globalAxios from 'axios'; | ||
// Some imports not used depending on template conditions | ||
// @ts-ignore | ||
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; | ||
// @ts-ignore | ||
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; | ||
/** | ||
* TldrawDocumentApi - axios parameter creator | ||
* @export | ||
*/ | ||
export const TldrawDocumentApiAxiosParamCreator = function (configuration?: Configuration) { | ||
return { | ||
/** | ||
* | ||
* @param {string} parentId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
deleteByDocName: async (parentId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { | ||
// verify required parameter 'parentId' is not null or undefined | ||
assertParamExists('deleteByDocName', 'parentId', parentId) | ||
const localVarPath = `/api/tldraw-document/{parentId}` | ||
.replace(`{${"parentId"}}`, encodeURIComponent(String(parentId))); | ||
// 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; | ||
|
||
|
||
|
||
setSearchParams(localVarUrlObj, localVarQueryParameter); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; | ||
|
||
return { | ||
url: toPathString(localVarUrlObj), | ||
options: localVarRequestOptions, | ||
}; | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* TldrawDocumentApi - functional programming interface | ||
* @export | ||
*/ | ||
export const TldrawDocumentApiFp = function(configuration?: Configuration) { | ||
const localVarAxiosParamCreator = TldrawDocumentApiAxiosParamCreator(configuration) | ||
return { | ||
/** | ||
* | ||
* @param {string} parentId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async deleteByDocName(parentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { | ||
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteByDocName(parentId, options); | ||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; | ||
const localVarOperationServerBasePath = operationServerMap['TldrawDocumentApi.deleteByDocName']?.[localVarOperationServerIndex]?.url; | ||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* TldrawDocumentApi - factory interface | ||
* @export | ||
*/ | ||
export const TldrawDocumentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { | ||
const localVarFp = TldrawDocumentApiFp(configuration) | ||
return { | ||
/** | ||
* | ||
* @param {string} parentId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
deleteByDocName(parentId: string, options?: any): AxiosPromise<void> { | ||
return localVarFp.deleteByDocName(parentId, options).then((request) => request(axios, basePath)); | ||
}, | ||
}; | ||
}; | ||
|
||
/** | ||
* TldrawDocumentApi - interface | ||
* @export | ||
* @interface TldrawDocumentApi | ||
*/ | ||
export interface TldrawDocumentApiInterface { | ||
/** | ||
* | ||
* @param {string} parentId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof TldrawDocumentApiInterface | ||
*/ | ||
deleteByDocName(parentId: string, options?: RawAxiosRequestConfig): AxiosPromise<void>; | ||
|
||
} | ||
|
||
/** | ||
* TldrawDocumentApi - object-oriented interface | ||
* @export | ||
* @class TldrawDocumentApi | ||
* @extends {BaseAPI} | ||
*/ | ||
export class TldrawDocumentApi extends BaseAPI implements TldrawDocumentApiInterface { | ||
/** | ||
* | ||
* @param {string} parentId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof TldrawDocumentApi | ||
*/ | ||
public deleteByDocName(parentId: string, options?: RawAxiosRequestConfig) { | ||
return TldrawDocumentApiFp(this.configuration).deleteByDocName(parentId, options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
} | ||
|
Oops, something went wrong.