templatefox 1.10.0 → 1.11.0

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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/lib/templatefox/api/account_api.rb +1 -1
  3. data/lib/templatefox/api/image_api.rb +90 -0
  4. data/lib/templatefox/api/integrations_api.rb +1 -1
  5. data/lib/templatefox/api/pdf_api.rb +1 -1
  6. data/lib/templatefox/api/pdf_async_api.rb +1 -1
  7. data/lib/templatefox/api/pdf_tools_api.rb +1 -1
  8. data/lib/templatefox/api/templates_api.rb +9 -1
  9. data/lib/templatefox/api_client.rb +1 -1
  10. data/lib/templatefox/api_error.rb +1 -1
  11. data/lib/templatefox/api_model_base.rb +1 -1
  12. data/lib/templatefox/configuration.rb +1 -1
  13. data/lib/templatefox/models/account_info_response.rb +1 -1
  14. data/lib/templatefox/models/{app_routers_v1_pdf_export_type.rb → app_routers_v1_delivery_export_type.rb} +4 -4
  15. data/lib/templatefox/models/app_routers_v1_pdf_async_export_type.rb +1 -1
  16. data/lib/templatefox/models/app_routers_v1_pdf_tools_export_type.rb +1 -1
  17. data/lib/templatefox/models/create_async_pdf_request.rb +1 -1
  18. data/lib/templatefox/models/create_async_pdf_response.rb +1 -1
  19. data/lib/templatefox/models/create_image_request.rb +533 -0
  20. data/lib/templatefox/models/create_image_response.rb +259 -0
  21. data/lib/templatefox/models/create_pdf_request.rb +2 -2
  22. data/lib/templatefox/models/create_pdf_response.rb +1 -1
  23. data/lib/templatefox/models/create_version_request.rb +1 -1
  24. data/lib/templatefox/models/extract_pdf_pages_request.rb +1 -1
  25. data/lib/templatefox/models/http_validation_error.rb +1 -1
  26. data/lib/templatefox/models/image_format.rb +41 -0
  27. data/lib/templatefox/models/job_list_response.rb +1 -1
  28. data/lib/templatefox/models/job_status.rb +1 -1
  29. data/lib/templatefox/models/job_status_response.rb +1 -1
  30. data/lib/templatefox/models/location_inner.rb +1 -1
  31. data/lib/templatefox/models/merge_pdf_request.rb +1 -1
  32. data/lib/templatefox/models/modification.rb +305 -0
  33. data/lib/templatefox/models/pdf_input.rb +1 -1
  34. data/lib/templatefox/models/pdf_tools_response.rb +1 -1
  35. data/lib/templatefox/models/pdf_variant.rb +1 -1
  36. data/lib/templatefox/models/rotate_pdf_request.rb +1 -1
  37. data/lib/templatefox/models/s3_config_request.rb +1 -1
  38. data/lib/templatefox/models/s3_config_response.rb +1 -1
  39. data/lib/templatefox/models/s3_success_response.rb +1 -1
  40. data/lib/templatefox/models/s3_test_response.rb +1 -1
  41. data/lib/templatefox/models/template_field.rb +1 -1
  42. data/lib/templatefox/models/template_field_spec.rb +1 -1
  43. data/lib/templatefox/models/template_list_item.rb +14 -2
  44. data/lib/templatefox/models/templates_list_response.rb +1 -1
  45. data/lib/templatefox/models/transaction.rb +1 -1
  46. data/lib/templatefox/models/transactions_response.rb +1 -1
  47. data/lib/templatefox/models/update_version_request.rb +1 -1
  48. data/lib/templatefox/models/validation_error.rb +1 -1
  49. data/lib/templatefox/models/version_item.rb +1 -1
  50. data/lib/templatefox/models/versions_list_response.rb +1 -1
  51. data/lib/templatefox/version.rb +2 -2
  52. data/lib/templatefox.rb +7 -2
  53. data/spec/api/account_api_spec.rb +1 -1
  54. data/spec/api/image_api_spec.rb +47 -0
  55. data/spec/api/integrations_api_spec.rb +1 -1
  56. data/spec/api/pdf_api_spec.rb +1 -1
  57. data/spec/api/pdf_async_api_spec.rb +1 -1
  58. data/spec/api/pdf_tools_api_spec.rb +1 -1
  59. data/spec/api/templates_api_spec.rb +2 -1
  60. data/spec/models/account_info_response_spec.rb +1 -1
  61. data/spec/models/{app_routers_v1_pdf_export_type_spec.rb → app_routers_v1_delivery_export_type_spec.rb} +7 -7
  62. data/spec/models/app_routers_v1_pdf_async_export_type_spec.rb +1 -1
  63. data/spec/models/app_routers_v1_pdf_tools_export_type_spec.rb +1 -1
  64. data/spec/models/create_async_pdf_request_spec.rb +1 -1
  65. data/spec/models/create_async_pdf_response_spec.rb +1 -1
  66. data/spec/models/create_image_request_spec.rb +108 -0
  67. data/spec/models/create_image_response_spec.rb +60 -0
  68. data/spec/models/create_pdf_request_spec.rb +1 -1
  69. data/spec/models/create_pdf_response_spec.rb +1 -1
  70. data/spec/models/create_version_request_spec.rb +1 -1
  71. data/spec/models/extract_pdf_pages_request_spec.rb +1 -1
  72. data/spec/models/http_validation_error_spec.rb +1 -1
  73. data/spec/models/image_format_spec.rb +30 -0
  74. data/spec/models/job_list_response_spec.rb +1 -1
  75. data/spec/models/job_status_response_spec.rb +1 -1
  76. data/spec/models/job_status_spec.rb +1 -1
  77. data/spec/models/location_inner_spec.rb +1 -1
  78. data/spec/models/merge_pdf_request_spec.rb +1 -1
  79. data/spec/models/modification_spec.rb +66 -0
  80. data/spec/models/pdf_input_spec.rb +1 -1
  81. data/spec/models/pdf_tools_response_spec.rb +1 -1
  82. data/spec/models/pdf_variant_spec.rb +1 -1
  83. data/spec/models/rotate_pdf_request_spec.rb +1 -1
  84. data/spec/models/s3_config_request_spec.rb +1 -1
  85. data/spec/models/s3_config_response_spec.rb +1 -1
  86. data/spec/models/s3_success_response_spec.rb +1 -1
  87. data/spec/models/s3_test_response_spec.rb +1 -1
  88. data/spec/models/template_field_spec.rb +1 -1
  89. data/spec/models/template_field_spec_spec.rb +1 -1
  90. data/spec/models/template_list_item_spec.rb +7 -1
  91. data/spec/models/templates_list_response_spec.rb +1 -1
  92. data/spec/models/transaction_spec.rb +1 -1
  93. data/spec/models/transactions_response_spec.rb +1 -1
  94. data/spec/models/update_version_request_spec.rb +1 -1
  95. data/spec/models/validation_error_spec.rb +1 -1
  96. data/spec/models/version_item_spec.rb +1 -1
  97. data/spec/models/versions_list_response_spec.rb +1 -1
  98. data/spec/spec_helper.rb +1 -1
  99. data/templatefox.gemspec +1 -1
  100. metadata +46 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b86cf16f04ca4e5709627c3a2b54c2989d8dfd04ad78462fcfe73de5e63843c9
4
- data.tar.gz: e6d77ea2b23610c270d3a462640dd2ee850d6778f7a79268816e4d5dd545526f
3
+ metadata.gz: 32e924b5c4d595bb2d6a01470815bf3f8265a35c4146ee69bd17292ed15515bc
4
+ data.tar.gz: 137bcef6d27ef8752d43a5368af77e755e87d412bd60346f82663a150f6bcc7f
5
5
  SHA512:
6
- metadata.gz: 76267ec11f05779b3ec7f886d06482873eba5b70306a8a9aba26c18ae471742321a0c50b9ecd5dc070ee3588e734fea357408df75b80f5e4fd2463a3125972d9
7
- data.tar.gz: 721003e4271027db5146bb28201490ccc1ac76f273f01c1d411c61e4999fe304470ca6121f201540a6d1e904072520154b342ceda040b9c963df1dec5b4d5dc9
6
+ metadata.gz: e2aee76a65f43feffbd88668e3c7843f5984d2bc8a860c5b925444fe9c60ee301286777d9652b94ea1312b822b3547bc8c9c7b8b8a152f0fca0354ffd6efced0
7
+ data.tar.gz: 4eaad36edc36ae5f64da2c67758c6034ceeddbac1d9cfdec0a2cbab1d71e8d98a8fe355bdec11be4114488225fd444d00532c6e3c9c57ea6a374836d7ac41f9f
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -0,0 +1,90 @@
1
+ =begin
2
+ #TemplateFox API
3
+
4
+ #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
+
6
+ The version of the OpenAPI document: 1.11.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module TemplateFox
16
+ class ImageApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Generate image from template
23
+ # Generate an image (PNG, JPEG or WebP) from an image template. **Authentication:** API Key required (`x-api-key` header) ## Request Body | Field | Type | Required | Description | |-------|------|----------|-------------| | `template_id` | string | ✅ Yes | Template short ID (12 characters) | | `modifications` | array | No | Modify elements by layer name (see below) | | `format` | string | No | `png` (default), `jpeg` or `webp` | | `width` | integer | No | Output width in pixels (defaults to the template's native width) | | `export_type` | string | No | `url` (default) or `binary` | ## Modifications Each modification targets a layer by the `name` you set in the editor's Layers panel: | Property | Description | |----------|-------------| | `name` | Layer name to modify (required) | | `text` | Replace the layer's text | | `image_url` | Set the layer's image (`src` for images, `background-image` otherwise) | | `color` | Text color | | `background` | Background color | | `hidden` | Hide (`true`) or show (`false`) the layer | Unknown layer names are skipped and listed in the response `warnings`. A name that matches several layers is applied to all of them. ## Export Types - `url` (default): image is uploaded to CDN, returns JSON with URL - `binary`: returns raw image bytes directly **Note:** This endpoint only accepts image templates. Use `/v1/pdf/create` for PDF templates. **Credits:** 1 credit deducted per successful generation. **Rate Limits:** 60 requests/min (free), 120 requests/min (paid). Headers included in response.
24
+ # @param create_image_request [CreateImageRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [CreateImageResponse]
27
+ def create_image(create_image_request, opts = {})
28
+ data, _status_code, _headers = create_image_with_http_info(create_image_request, opts)
29
+ data
30
+ end
31
+
32
+ # Generate image from template
33
+ # Generate an image (PNG, JPEG or WebP) from an image template. **Authentication:** API Key required (`x-api-key` header) ## Request Body | Field | Type | Required | Description | |-------|------|----------|-------------| | `template_id` | string | ✅ Yes | Template short ID (12 characters) | | `modifications` | array | No | Modify elements by layer name (see below) | | `format` | string | No | `png` (default), `jpeg` or `webp` | | `width` | integer | No | Output width in pixels (defaults to the template's native width) | | `export_type` | string | No | `url` (default) or `binary` | ## Modifications Each modification targets a layer by the `name` you set in the editor's Layers panel: | Property | Description | |----------|-------------| | `name` | Layer name to modify (required) | | `text` | Replace the layer's text | | `image_url` | Set the layer's image (`src` for images, `background-image` otherwise) | | `color` | Text color | | `background` | Background color | | `hidden` | Hide (`true`) or show (`false`) the layer | Unknown layer names are skipped and listed in the response `warnings`. A name that matches several layers is applied to all of them. ## Export Types - `url` (default): image is uploaded to CDN, returns JSON with URL - `binary`: returns raw image bytes directly **Note:** This endpoint only accepts image templates. Use `/v1/pdf/create` for PDF templates. **Credits:** 1 credit deducted per successful generation. **Rate Limits:** 60 requests/min (free), 120 requests/min (paid). Headers included in response.
34
+ # @param create_image_request [CreateImageRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(CreateImageResponse, Integer, Hash)>] CreateImageResponse data, response status code and response headers
37
+ def create_image_with_http_info(create_image_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ImageApi.create_image ...'
40
+ end
41
+ # verify the required parameter 'create_image_request' is set
42
+ if @api_client.config.client_side_validation && create_image_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'create_image_request' when calling ImageApi.create_image"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v1/image/create'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'image/png']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_image_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'CreateImageResponse'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"ImageApi.create_image",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: ImageApi#create_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+ end
90
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -291,6 +291,7 @@ module TemplateFox
291
291
  # List templates
292
292
  # List all templates for the authenticated user. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** This endpoint is designed for no-code tools (Zapier, Make, n8n) to populate template selection dropdowns. **No credits consumed:** This is a read-only endpoint. **Rate Limits:** 60 requests/min (free), 120 requests/min (paid). Headers included in response.
293
293
  # @param [Hash] opts the optional parameters
294
+ # @option opts [String] :kind Filter by product kind: &#x60;pdf&#x60; or &#x60;image&#x60;
294
295
  # @return [TemplatesListResponse]
295
296
  def list_templates(opts = {})
296
297
  data, _status_code, _headers = list_templates_with_http_info(opts)
@@ -300,16 +301,23 @@ module TemplateFox
300
301
  # List templates
301
302
  # List all templates for the authenticated user. **Authentication:** API Key required (&#x60;x-api-key&#x60; header) or JWT token **Usage:** This endpoint is designed for no-code tools (Zapier, Make, n8n) to populate template selection dropdowns. **No credits consumed:** This is a read-only endpoint. **Rate Limits:** 60 requests/min (free), 120 requests/min (paid). Headers included in response.
302
303
  # @param [Hash] opts the optional parameters
304
+ # @option opts [String] :kind Filter by product kind: &#x60;pdf&#x60; or &#x60;image&#x60;
303
305
  # @return [Array<(TemplatesListResponse, Integer, Hash)>] TemplatesListResponse data, response status code and response headers
304
306
  def list_templates_with_http_info(opts = {})
305
307
  if @api_client.config.debugging
306
308
  @api_client.config.logger.debug 'Calling API: TemplatesApi.list_templates ...'
307
309
  end
310
+ pattern = Regexp.new(/^(pdf|image)$/)
311
+ if @api_client.config.client_side_validation && !opts[:'kind'].nil? && opts[:'kind'] !~ pattern
312
+ fail ArgumentError, "invalid value for 'opts[:\"kind\"]' when calling TemplatesApi.list_templates, must conform to the pattern #{pattern}."
313
+ end
314
+
308
315
  # resource path
309
316
  local_var_path = '/v1/templates'
310
317
 
311
318
  # query parameters
312
319
  query_params = opts[:query_params] || {}
320
+ query_params[:'kind'] = opts[:'kind'] if !opts[:'kind'].nil?
313
321
 
314
322
  # header parameters
315
323
  header_params = opts[:header_params] || {}
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TemplateFox
17
- class AppRoutersV1PdfExportType
17
+ class AppRoutersV1DeliveryExportType
18
18
  URL = "url".freeze
19
19
  BINARY = "binary".freeze
20
20
 
@@ -33,8 +33,8 @@ module TemplateFox
33
33
  # @param [String] The enum value in the form of the string
34
34
  # @return [String] The enum value
35
35
  def build_from_hash(value)
36
- return value if AppRoutersV1PdfExportType.all_vars.include?(value)
37
- raise "Invalid ENUM value #{value} for class #AppRoutersV1PdfExportType"
36
+ return value if AppRoutersV1DeliveryExportType.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #AppRoutersV1DeliveryExportType"
38
38
  end
39
39
  end
40
40
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.10.0
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0