From 2289ca8ebbdb6ac4d15ab55d0d1915b7be4723b6 Mon Sep 17 00:00:00 2001 From: Jakub Marek Date: Tue, 13 Jan 2026 20:05:57 +0100 Subject: [PATCH 1/2] Add files via upload --- ...___VARIABLE_endpointName___Endpoints.swift | 8 ++ ...___VARIABLE_endpointName___Endpoints.swift | 10 +++ .../___VARIABLE_endpointName___Requests.swift | 6 ++ ...___VARIABLE_endpointName___Endpoints.swift | 11 +++ .../___VARIABLE_endpointName___Requests.swift | 6 ++ ...___VARIABLE_endpointName___Responses.swift | 6 ++ ...___VARIABLE_endpointName___Endpoints.swift | 9 +++ ...___VARIABLE_endpointName___Responses.swift | 6 ++ .../Endpoints.xctemplate/TemplateIcon.png | Bin 0 -> 553 bytes .../Endpoints.xctemplate/TemplateIcon@2x.png | Bin 0 -> 801 bytes .../Endpoints.xctemplate/TemplateInfo.plist | 71 ++++++++++++++++++ Templates/Makefile | 9 +++ 12 files changed, 142 insertions(+) create mode 100644 Templates/Endpoints.xctemplate/Default/___VARIABLE_endpointName___Endpoints.swift create mode 100644 Templates/Endpoints.xctemplate/HasRequest/___VARIABLE_endpointName___Endpoints.swift create mode 100644 Templates/Endpoints.xctemplate/HasRequest/___VARIABLE_endpointName___Requests.swift create mode 100644 Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Endpoints.swift create mode 100644 Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Requests.swift create mode 100644 Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Responses.swift create mode 100644 Templates/Endpoints.xctemplate/HasResponse/___VARIABLE_endpointName___Endpoints.swift create mode 100644 Templates/Endpoints.xctemplate/HasResponse/___VARIABLE_endpointName___Responses.swift create mode 100644 Templates/Endpoints.xctemplate/TemplateIcon.png create mode 100644 Templates/Endpoints.xctemplate/TemplateIcon@2x.png create mode 100644 Templates/Endpoints.xctemplate/TemplateInfo.plist create mode 100644 Templates/Makefile diff --git a/Templates/Endpoints.xctemplate/Default/___VARIABLE_endpointName___Endpoints.swift b/Templates/Endpoints.xctemplate/Default/___VARIABLE_endpointName___Endpoints.swift new file mode 100644 index 0000000..22d131b --- /dev/null +++ b/Templates/Endpoints.xctemplate/Default/___VARIABLE_endpointName___Endpoints.swift @@ -0,0 +1,8 @@ +// ___FILEHEADER___ + +import FTAPIKit + +struct ___VARIABLE_templateName___Endpoint: APIEndpoint { + + let path: String = "" +} diff --git a/Templates/Endpoints.xctemplate/HasRequest/___VARIABLE_endpointName___Endpoints.swift b/Templates/Endpoints.xctemplate/HasRequest/___VARIABLE_endpointName___Endpoints.swift new file mode 100644 index 0000000..de36a2f --- /dev/null +++ b/Templates/Endpoints.xctemplate/HasRequest/___VARIABLE_endpointName___Endpoints.swift @@ -0,0 +1,10 @@ +// ___FILEHEADER___ + +import FTAPIKit + +struct ___VARIABLE_templateName___Endpoint: APIRequestEndpoint { + typealias Request = ___VARIABLE_templateName___Request + + var body: ___VARIABLE_templateName___Request + var path: String +} diff --git a/Templates/Endpoints.xctemplate/HasRequest/___VARIABLE_endpointName___Requests.swift b/Templates/Endpoints.xctemplate/HasRequest/___VARIABLE_endpointName___Requests.swift new file mode 100644 index 0000000..3896b77 --- /dev/null +++ b/Templates/Endpoints.xctemplate/HasRequest/___VARIABLE_endpointName___Requests.swift @@ -0,0 +1,6 @@ +// ___FILEHEADER___ + +import Foundation + +struct ___VARIABLE_templateName___Request: Encodable { +} diff --git a/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Endpoints.swift b/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Endpoints.swift new file mode 100644 index 0000000..254c379 --- /dev/null +++ b/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Endpoints.swift @@ -0,0 +1,11 @@ +// ___FILEHEADER___ + +import FTAPIKit + +struct ___VARIABLE_templateName___Endpoint: APIRequestResponseEndpoint { + typealias Response = ___VARIABLE_templateName___Response + typealias Request = ___VARIABLE_templateName___Request + + var body: ___VARIABLE_templateName___Request + let path: String = "" +} diff --git a/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Requests.swift b/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Requests.swift new file mode 100644 index 0000000..3896b77 --- /dev/null +++ b/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Requests.swift @@ -0,0 +1,6 @@ +// ___FILEHEADER___ + +import Foundation + +struct ___VARIABLE_templateName___Request: Encodable { +} diff --git a/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Responses.swift b/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Responses.swift new file mode 100644 index 0000000..644df96 --- /dev/null +++ b/Templates/Endpoints.xctemplate/HasRequestHasResponse/___VARIABLE_endpointName___Responses.swift @@ -0,0 +1,6 @@ +// ___FILEHEADER___ + +import Foundation + +struct ___VARIABLE_templateName___Response: Decodable { +} diff --git a/Templates/Endpoints.xctemplate/HasResponse/___VARIABLE_endpointName___Endpoints.swift b/Templates/Endpoints.xctemplate/HasResponse/___VARIABLE_endpointName___Endpoints.swift new file mode 100644 index 0000000..725f647 --- /dev/null +++ b/Templates/Endpoints.xctemplate/HasResponse/___VARIABLE_endpointName___Endpoints.swift @@ -0,0 +1,9 @@ +// ___FILEHEADER___ + +import FTAPIKit + +struct ___VARIABLE_templateName___Endpoint: APIResponseEndpoint { + typealias Response = ___VARIABLE_templateName___Response + + let path: String = "" +} diff --git a/Templates/Endpoints.xctemplate/HasResponse/___VARIABLE_endpointName___Responses.swift b/Templates/Endpoints.xctemplate/HasResponse/___VARIABLE_endpointName___Responses.swift new file mode 100644 index 0000000..644df96 --- /dev/null +++ b/Templates/Endpoints.xctemplate/HasResponse/___VARIABLE_endpointName___Responses.swift @@ -0,0 +1,6 @@ +// ___FILEHEADER___ + +import Foundation + +struct ___VARIABLE_templateName___Response: Decodable { +} diff --git a/Templates/Endpoints.xctemplate/TemplateIcon.png b/Templates/Endpoints.xctemplate/TemplateIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..45e1992dd33d7973fa7b06489af5c3608d7c7741 GIT binary patch literal 553 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyy~ySip>6gB0F2&*1?oo9yZ07?Q#I zHsWq?vjLCV^4p7Zm}cMMZr;GY=Z@M2PixPt#XH0=n=BMH^*ldu!p6Bb=Kt5&vZ^GL z?O!>Yk3x;~gr_P=GxirbedC(;{=`Dbl3*A8m01TPH(yoUCJ^`c8Z*;x0q%!M@4E68 zc^j^NW>7Obvismhd++~7)z7x?vgNy86@Q$MRU&txLy(K>(Qtc3`wHvp!_dF1L7da}4v+6`pFc zzK><%8s^O}y?2;#&9RB1ivK%Qci0tmsEcRuetGh)IBVgx#HfyslI8U&r&%7{>6CbO zLEv)dbhdWB_deMh-0w~>nJY7AN$X$pFA0+h3|}AR-^h00RV71k4QrDB!n>b#{=3e| z`#U}{d+&PhMvZ+;QVy$*yua3c#$na+;9n6!TUwKDPP`x*%9wnk`^BXB)hF+Z-{7%U z>(t5naFOXpnnc^G*SiGL(wgr5+O&}2Uf<)4Lc=BeGjbZ3?Or$EmpahABV>)_j}tsG Zj5`lZeDSD%H7M>GJYD@<);T3K0RYd&*!}E7$weaD78i8JuIK3tT~Rv6qUdwvcQr+Y&cBzxzut9siLbCehXVtX zKm!Ad0s|w5!-K0FbENnx@*)mTGGd(mG1{_krXY(!0!ykpGqa3^@-i^<@!gr9m)$w` zh*hpeuja55YsYyGo&yYqj2mr48yJ(Ak}9Yc zuUTi>Pej#d=Ix$*gF{r{@zi}%%$Ft}6H0RE3ICPFZ7;aH<9n^d&uQC5)*OF*m_edI zK`*)L00X-XC(nl$JTneAFix=ToTgS|DpVtte9bEPW@1~A#17s=j;W^4?#1+-*+0)K z@qntw8$-5)h8YbJ`<8OXOMSnwYn|cUV7<)}5y__yZZ+{+eN%_?$6~JosXqKGKHV;7 zWP5XZ`z%@JRUO}AFI;L_D;u-c@tE4{mp6_+GV8eSv6^%Hk)4Ow=kjcRB&1>|Yyb@) zh>KS;@CXPCoDOD`P*78t_P$ozY0ulWHE(yz$q6ofU$f%q^ha`))%C@kuT-atv@?1t zR9{YT(BHYlg2#jD=4>|Rs*|cm6CH$3+%u85;H{^*?&;*UAC}vAR#zW0NelzVK^m6O zDw|?I|GehS`ggh4?KM03XQVtVX}7M2ZPrJZM>~vG Pf|94FtDnm{r-UW|d{Zrj literal 0 HcmV?d00001 diff --git a/Templates/Endpoints.xctemplate/TemplateInfo.plist b/Templates/Endpoints.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..a5703a2 --- /dev/null +++ b/Templates/Endpoints.xctemplate/TemplateInfo.plist @@ -0,0 +1,71 @@ + + + + + DefaultCompletionName + Endpoint + Description + This generates a new endpoint for use with the APIAdapter from the FTAPIKit. + Kind + Xcode.IDEKit.TextSubstitutionFileTemplateKind + Options + + + Description + The name of the endpoint + Identifier + endpointName + Name + Endpoint file name: + NotPersisted + + Required + + Type + text + + + Description + The name of template request. + Identifier + templateName + Name + Template endpoint name: + NotPersisted + + Required + + Type + text + + + Identifier + hasRequest + Name + Generate Request file + Description + Check whethe you want to create file containing requests. + Type + checkbox + + + Identifier + hasResponse + Name + Generate Response file + Description + Check whethe you want to create file containing responses. + Type + checkbox + + + Platforms + + com.apple.platform.iphoneos + + SortOrder + 99 + Summary + This generates a new service for use with the ServiceHolder (dependency injection) from the FuturedKit. + + diff --git a/Templates/Makefile b/Templates/Makefile new file mode 100644 index 0000000..3ebb72a --- /dev/null +++ b/Templates/Makefile @@ -0,0 +1,9 @@ +TEMPLATE_DIR = $(HOME)/Library/Developer/Xcode/Templates/FTAPIKit + +install: + mkdir -p $(TEMPLATE_DIR) + cp -R *.xctemplate $(TEMPLATE_DIR)/ + echo "\033[0;32mInstallation was successful!\033[0m" + +.PHONY: install +.SILENT: install From 4a9cb96041d6eca33eb8fa3667c6583b612dbab0 Mon Sep 17 00:00:00 2001 From: Jakub Marek Date: Tue, 13 Jan 2026 20:13:41 +0100 Subject: [PATCH 2/2] Improve README formatting and installation details Updated README to enhance logo display and installation instructions. --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ccbe252..bd6e450 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -FTAPIKit logo +FTAPIKit logo # FTAPIKit @@ -13,6 +13,7 @@ Declarative and generic REST API framework using Codable. With standard implementation using URLSesssion and JSON encoder/decoder. Easily extensible for your asynchronous framework or networking stack. +The repository also contains set of Xcode templates, see `Installation`. ## Installation @@ -29,6 +30,14 @@ When using CocoaPods add following line to your `Podfile`: pod 'FTAPIKit', '~> 1.5' ``` +The repository includes an API endpoint Xcode template for user convenience. You can install it using make: + +```bash +git clone --depth=1 https://github.com/futuredapp/FTAPIKit.git +cd Templates +make +``` + ## Features The main feature of this library is to provide documentation-like API