@epcc-sdk/sdks-files 0.0.1 → 0.0.3

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/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # @epcc-sdk/sdks-files SDK
2
2
 
3
- Below you’ll find instructions on how to install, set up, and use the client, along with a list of available operations.
3
+ Below you'll find instructions on how to install, set up, and use the client, along with a list of available operations.
4
+
4
5
 
5
6
  ## Features
6
7
 
@@ -12,6 +13,7 @@ Below you’ll find instructions on how to install, set up, and use the client,
12
13
 
13
14
  ---
14
15
 
16
+
15
17
  ## Installation
16
18
 
17
19
  ```bash
@@ -217,4 +219,5 @@ const product = await getAFile({
217
219
 
218
220
 
219
221
 
220
- ---
222
+
223
+ ---
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var client_exports = {};
17
+ module.exports = __toCommonJS(client_exports);
18
+ __reExport(client_exports, require('./types.gen.cjs'), module.exports);
19
+ __reExport(client_exports, require('./sdk.gen.cjs'), module.exports);
20
+ // Annotate the CommonJS export names for ESM import in node:
21
+ 0 && (module.exports = {
22
+ ...require('./types.gen.cjs'),
23
+ ...require('./sdk.gen.cjs')
24
+ });
25
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/index.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\nexport * from \"./types.gen\"\nexport * from \"./sdk.gen\"\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AACA,2BAAc,wBADd;AAEA,2BAAc,sBAFd;","names":[]}
@@ -0,0 +1,3 @@
1
+ export { CreateAFileData, CreateAFileError, CreateAFileErrors, CreateAFileResponse, CreateAFileResponses, DeleteAFileData, DeleteAFileError, DeleteAFileErrors, DeleteAFileResponse, DeleteAFileResponses, ErrorResponse, File, FileLink, FileMeta, Filter, GetAFileData, GetAFileError, GetAFileErrors, GetAFileResponse, GetAFileResponses, GetAllFilesData, GetAllFilesError, GetAllFilesErrors, GetAllFilesResponse, GetAllFilesResponses, Links, PageLimit, PageOffset, ResultsLinks, ResultsMeta, Uuid, _Error } from './types.gen.cjs';
2
+ export { client, createAFile, deleteAFile, getAFile, getAllFiles } from './sdk.gen.cjs';
3
+ import '@hey-api/client-fetch';
@@ -1,2 +1,3 @@
1
- export * from "./types.gen";
2
- export * from "./sdk.gen";
1
+ export { CreateAFileData, CreateAFileError, CreateAFileErrors, CreateAFileResponse, CreateAFileResponses, DeleteAFileData, DeleteAFileError, DeleteAFileErrors, DeleteAFileResponse, DeleteAFileResponses, ErrorResponse, File, FileLink, FileMeta, Filter, GetAFileData, GetAFileError, GetAFileErrors, GetAFileResponse, GetAFileResponses, GetAllFilesData, GetAllFilesError, GetAllFilesErrors, GetAllFilesResponse, GetAllFilesResponses, Links, PageLimit, PageOffset, ResultsLinks, ResultsMeta, Uuid, _Error } from './types.gen.js';
2
+ export { client, createAFile, deleteAFile, getAFile, getAllFiles } from './sdk.gen.js';
3
+ import '@hey-api/client-fetch';
@@ -0,0 +1,3 @@
1
+ export * from "./types.gen.mjs";
2
+ export * from "./sdk.gen.mjs";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/index.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\nexport * from \"./types.gen\"\nexport * from \"./sdk.gen\"\n"],"mappings":"AACA,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var sdk_gen_exports = {};
20
+ __export(sdk_gen_exports, {
21
+ client: () => client,
22
+ createAFile: () => createAFile,
23
+ deleteAFile: () => deleteAFile,
24
+ getAFile: () => getAFile,
25
+ getAllFiles: () => getAllFiles
26
+ });
27
+ module.exports = __toCommonJS(sdk_gen_exports);
28
+ var import_client_fetch = require("@hey-api/client-fetch");
29
+ const client = (0, import_client_fetch.createClient)((0, import_client_fetch.createConfig)());
30
+ const getAllFiles = (options) => {
31
+ return (options?.client ?? client).get({
32
+ ...options,
33
+ security: [
34
+ {
35
+ scheme: "bearer",
36
+ type: "http"
37
+ }
38
+ ],
39
+ url: "/v2/files"
40
+ });
41
+ };
42
+ const createAFile = (options) => {
43
+ return (options?.client ?? client).post({
44
+ ...options,
45
+ ...import_client_fetch.formDataBodySerializer,
46
+ headers: {
47
+ "Content-Type": null,
48
+ ...options?.headers
49
+ },
50
+ security: [
51
+ {
52
+ scheme: "bearer",
53
+ type: "http"
54
+ }
55
+ ],
56
+ url: "/v2/files"
57
+ });
58
+ };
59
+ const deleteAFile = (options) => {
60
+ return (options?.client ?? client).delete({
61
+ ...options,
62
+ security: [
63
+ {
64
+ scheme: "bearer",
65
+ type: "http"
66
+ }
67
+ ],
68
+ url: "/v2/files/{fileID}"
69
+ });
70
+ };
71
+ const getAFile = (options) => {
72
+ return (options?.client ?? client).get({
73
+ ...options,
74
+ security: [
75
+ {
76
+ scheme: "bearer",
77
+ type: "http"
78
+ }
79
+ ],
80
+ url: "/v2/files/{fileID}"
81
+ });
82
+ };
83
+ // Annotate the CommonJS export names for ESM import in node:
84
+ 0 && (module.exports = {
85
+ client,
86
+ createAFile,
87
+ deleteAFile,
88
+ getAFile,
89
+ getAllFiles
90
+ });
91
+ //# sourceMappingURL=sdk.gen.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport {\n createClient,\n createConfig,\n type Options,\n formDataBodySerializer,\n} from \"@hey-api/client-fetch\"\nimport type {\n GetAllFilesData,\n GetAllFilesResponse,\n GetAllFilesError,\n CreateAFileData,\n CreateAFileResponse,\n CreateAFileError,\n DeleteAFileData,\n DeleteAFileResponse,\n DeleteAFileError,\n GetAFileData,\n GetAFileResponse,\n GetAFileError,\n} from \"./types.gen\"\n\nexport const client = createClient(createConfig())\n\n/**\n * Get all Files\n * Retrieves all files.\n *\n * ### Filtering\n *\n * For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering).\n *\n * The following operators and attributes are available when filtering on this endpoint.\n *\n * | Attribute | Type | Operators | Example |\n * |:----------------------|:----------|:--------------------------|:-------------|\n * | `id` | `string` | `in` | `in(id,file-id-1,file-id-2,file-id-3)` |\n * | `file_name` | `string` | `eq` / `like` | `eq(file_name, my_image.jpg)` |\n * | `width` | `integer` | `gt` / `ge` / `lt` / `le` | `gt(width,200)` |\n * | `height` | `integer` | `gt` / `ge` / `lt` / `le` | `lt(height,500)` |\n * | `file_size` | `integer` | `gt` / `ge` / `lt` / `le` | `le(file_size,20953)` |\n *\n * #### Bulk File Retrieval\n *\n * To retrieve multiple files by their IDs in a single request, use the `in` operator with a comma-separated list of file IDs:\n *\n * ```\n * GET /v2/files?filter=in(id,06b881bd-f152-4c36-8658-7132a8fab49c,ec73567b-04e8-4000-a11a-7e1407cc2f21)\n * ```\n *\n * This is more efficient than making separate requests for each file and is recommended for bulk operations.\n *\n * **Note on invalid IDs**: If any IDs in the filter are missing, malformed, or do not exist in the store, they will be silently ignored. The response will only include files that were successfully found. For example, if you request 5 IDs but only 3 exist, the response will contain 3 files with `total: 3` in the metadata.\n *\n */\nexport const getAllFiles = <ThrowOnError extends boolean = false>(\n options?: Options<GetAllFilesData, ThrowOnError>,\n) => {\n return (options?.client ?? client).get<\n GetAllFilesResponse,\n GetAllFilesError,\n ThrowOnError\n >({\n ...options,\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/v2/files\",\n })\n}\n\n/**\n * Create a File\n * Create a File\n */\nexport const createAFile = <ThrowOnError extends boolean = false>(\n options: Options<CreateAFileData, ThrowOnError>,\n) => {\n return (options?.client ?? client).post<\n CreateAFileResponse,\n CreateAFileError,\n ThrowOnError\n >({\n ...options,\n ...formDataBodySerializer,\n headers: {\n \"Content-Type\": null,\n ...options?.headers,\n },\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/v2/files\",\n })\n}\n\n/**\n * Delete a File\n * Delete a File\n */\nexport const deleteAFile = <ThrowOnError extends boolean = false>(\n options: Options<DeleteAFileData, ThrowOnError>,\n) => {\n return (options?.client ?? client).delete<\n DeleteAFileResponse,\n DeleteAFileError,\n ThrowOnError\n >({\n ...options,\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/v2/files/{fileID}\",\n })\n}\n\n/**\n * Get a File\n * Get a File\n */\nexport const getAFile = <ThrowOnError extends boolean = false>(\n options: Options<GetAFileData, ThrowOnError>,\n) => {\n return (options?.client ?? client).get<\n GetAFileResponse,\n GetAFileError,\n ThrowOnError\n >({\n ...options,\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/v2/files/{fileID}\",\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAKO;AAgBA,MAAM,aAAS,sCAAa,kCAAa,CAAC;AAiC1C,MAAM,cAAc,CACzB,YACG;AACH,UAAQ,SAAS,UAAU,QAAQ,IAIjC;AAAA,IACA,GAAG;AAAA,IACH,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;AAMO,MAAM,cAAc,CACzB,YACG;AACH,UAAQ,SAAS,UAAU,QAAQ,KAIjC;AAAA,IACA,GAAG;AAAA,IACH,GAAG;AAAA,IACH,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,GAAG,SAAS;AAAA,IACd;AAAA,IACA,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;AAMO,MAAM,cAAc,CACzB,YACG;AACH,UAAQ,SAAS,UAAU,QAAQ,OAIjC;AAAA,IACA,GAAG;AAAA,IACH,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;AAMO,MAAM,WAAW,CACtB,YACG;AACH,UAAQ,SAAS,UAAU,QAAQ,IAIjC;AAAA,IACA,GAAG;AAAA,IACH,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;","names":[]}
@@ -0,0 +1,62 @@
1
+ import { GetAllFilesData, File, ResultsMeta, ResultsLinks, ErrorResponse, CreateAFileData, DeleteAFileData, GetAFileData } from './types.gen.cjs';
2
+ import * as _hey_api_client_fetch from '@hey-api/client-fetch';
3
+ import { Options } from '@hey-api/client-fetch';
4
+
5
+ declare const client: _hey_api_client_fetch.Client<Request, Response, unknown, _hey_api_client_fetch.RequestOptions<boolean, string>>;
6
+ /**
7
+ * Get all Files
8
+ * Retrieves all files.
9
+ *
10
+ * ### Filtering
11
+ *
12
+ * For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering).
13
+ *
14
+ * The following operators and attributes are available when filtering on this endpoint.
15
+ *
16
+ * | Attribute | Type | Operators | Example |
17
+ * |:----------------------|:----------|:--------------------------|:-------------|
18
+ * | `id` | `string` | `in` | `in(id,file-id-1,file-id-2,file-id-3)` |
19
+ * | `file_name` | `string` | `eq` / `like` | `eq(file_name, my_image.jpg)` |
20
+ * | `width` | `integer` | `gt` / `ge` / `lt` / `le` | `gt(width,200)` |
21
+ * | `height` | `integer` | `gt` / `ge` / `lt` / `le` | `lt(height,500)` |
22
+ * | `file_size` | `integer` | `gt` / `ge` / `lt` / `le` | `le(file_size,20953)` |
23
+ *
24
+ * #### Bulk File Retrieval
25
+ *
26
+ * To retrieve multiple files by their IDs in a single request, use the `in` operator with a comma-separated list of file IDs:
27
+ *
28
+ * ```
29
+ * GET /v2/files?filter=in(id,06b881bd-f152-4c36-8658-7132a8fab49c,ec73567b-04e8-4000-a11a-7e1407cc2f21)
30
+ * ```
31
+ *
32
+ * This is more efficient than making separate requests for each file and is recommended for bulk operations.
33
+ *
34
+ * **Note on invalid IDs**: If any IDs in the filter are missing, malformed, or do not exist in the store, they will be silently ignored. The response will only include files that were successfully found. For example, if you request 5 IDs but only 3 exist, the response will contain 3 files with `total: 3` in the metadata.
35
+ *
36
+ */
37
+ declare const getAllFiles: <ThrowOnError extends boolean = false>(options?: Options<GetAllFilesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
38
+ data?: Array<File>;
39
+ meta?: ResultsMeta;
40
+ links?: ResultsLinks;
41
+ }, ErrorResponse, ThrowOnError>;
42
+ /**
43
+ * Create a File
44
+ * Create a File
45
+ */
46
+ declare const createAFile: <ThrowOnError extends boolean = false>(options: Options<CreateAFileData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
47
+ data?: File;
48
+ }, ErrorResponse, ThrowOnError>;
49
+ /**
50
+ * Delete a File
51
+ * Delete a File
52
+ */
53
+ declare const deleteAFile: <ThrowOnError extends boolean = false>(options: Options<DeleteAFileData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<void, ErrorResponse, ThrowOnError>;
54
+ /**
55
+ * Get a File
56
+ * Get a File
57
+ */
58
+ declare const getAFile: <ThrowOnError extends boolean = false>(options: Options<GetAFileData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
59
+ data?: File;
60
+ }, ErrorResponse, ThrowOnError>;
61
+
62
+ export { client, createAFile, deleteAFile, getAFile, getAllFiles };
@@ -1,6 +1,8 @@
1
- import { type Options } from "@hey-api/client-fetch";
2
- import type { GetAllFilesData, CreateAFileData, DeleteAFileData, GetAFileData } from "./types.gen";
3
- export declare const client: import("@hey-api/client-fetch").Client<Request, Response, unknown, import("@hey-api/client-fetch").RequestOptions<boolean, string>>;
1
+ import { GetAllFilesData, File, ResultsMeta, ResultsLinks, ErrorResponse, CreateAFileData, DeleteAFileData, GetAFileData } from './types.gen.js';
2
+ import * as _hey_api_client_fetch from '@hey-api/client-fetch';
3
+ import { Options } from '@hey-api/client-fetch';
4
+
5
+ declare const client: _hey_api_client_fetch.Client<Request, Response, unknown, _hey_api_client_fetch.RequestOptions<boolean, string>>;
4
6
  /**
5
7
  * Get all Files
6
8
  * Retrieves all files.
@@ -13,33 +15,48 @@ export declare const client: import("@hey-api/client-fetch").Client<Request, Res
13
15
  *
14
16
  * | Attribute | Type | Operators | Example |
15
17
  * |:----------------------|:----------|:--------------------------|:-------------|
18
+ * | `id` | `string` | `in` | `in(id,file-id-1,file-id-2,file-id-3)` |
16
19
  * | `file_name` | `string` | `eq` / `like` | `eq(file_name, my_image.jpg)` |
17
20
  * | `width` | `integer` | `gt` / `ge` / `lt` / `le` | `gt(width,200)` |
18
21
  * | `height` | `integer` | `gt` / `ge` / `lt` / `le` | `lt(height,500)` |
19
22
  * | `file_size` | `integer` | `gt` / `ge` / `lt` / `le` | `le(file_size,20953)` |
20
23
  *
24
+ * #### Bulk File Retrieval
25
+ *
26
+ * To retrieve multiple files by their IDs in a single request, use the `in` operator with a comma-separated list of file IDs:
27
+ *
28
+ * ```
29
+ * GET /v2/files?filter=in(id,06b881bd-f152-4c36-8658-7132a8fab49c,ec73567b-04e8-4000-a11a-7e1407cc2f21)
30
+ * ```
31
+ *
32
+ * This is more efficient than making separate requests for each file and is recommended for bulk operations.
33
+ *
34
+ * **Note on invalid IDs**: If any IDs in the filter are missing, malformed, or do not exist in the store, they will be silently ignored. The response will only include files that were successfully found. For example, if you request 5 IDs but only 3 exist, the response will contain 3 files with `total: 3` in the metadata.
35
+ *
21
36
  */
22
- export declare const getAllFiles: <ThrowOnError extends boolean = false>(options?: Options<GetAllFilesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
23
- data?: Array<import("./types.gen").File>;
24
- meta?: import("./types.gen").ResultsMeta;
25
- links?: import("./types.gen").ResultsLinks;
26
- }, import("./types.gen").ErrorResponse, ThrowOnError>;
37
+ declare const getAllFiles: <ThrowOnError extends boolean = false>(options?: Options<GetAllFilesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
38
+ data?: Array<File>;
39
+ meta?: ResultsMeta;
40
+ links?: ResultsLinks;
41
+ }, ErrorResponse, ThrowOnError>;
27
42
  /**
28
43
  * Create a File
29
44
  * Create a File
30
45
  */
31
- export declare const createAFile: <ThrowOnError extends boolean = false>(options: Options<CreateAFileData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
32
- data?: import("./types.gen").File;
33
- }, import("./types.gen").ErrorResponse, ThrowOnError>;
46
+ declare const createAFile: <ThrowOnError extends boolean = false>(options: Options<CreateAFileData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
47
+ data?: File;
48
+ }, ErrorResponse, ThrowOnError>;
34
49
  /**
35
50
  * Delete a File
36
51
  * Delete a File
37
52
  */
38
- export declare const deleteAFile: <ThrowOnError extends boolean = false>(options: Options<DeleteAFileData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ErrorResponse, ThrowOnError>;
53
+ declare const deleteAFile: <ThrowOnError extends boolean = false>(options: Options<DeleteAFileData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<void, ErrorResponse, ThrowOnError>;
39
54
  /**
40
55
  * Get a File
41
56
  * Get a File
42
57
  */
43
- export declare const getAFile: <ThrowOnError extends boolean = false>(options: Options<GetAFileData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
44
- data?: import("./types.gen").File;
45
- }, import("./types.gen").ErrorResponse, ThrowOnError>;
58
+ declare const getAFile: <ThrowOnError extends boolean = false>(options: Options<GetAFileData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
59
+ data?: File;
60
+ }, ErrorResponse, ThrowOnError>;
61
+
62
+ export { client, createAFile, deleteAFile, getAFile, getAllFiles };
@@ -0,0 +1,67 @@
1
+ import {
2
+ createClient,
3
+ createConfig,
4
+ formDataBodySerializer
5
+ } from "@hey-api/client-fetch";
6
+ const client = createClient(createConfig());
7
+ const getAllFiles = (options) => {
8
+ return (options?.client ?? client).get({
9
+ ...options,
10
+ security: [
11
+ {
12
+ scheme: "bearer",
13
+ type: "http"
14
+ }
15
+ ],
16
+ url: "/v2/files"
17
+ });
18
+ };
19
+ const createAFile = (options) => {
20
+ return (options?.client ?? client).post({
21
+ ...options,
22
+ ...formDataBodySerializer,
23
+ headers: {
24
+ "Content-Type": null,
25
+ ...options?.headers
26
+ },
27
+ security: [
28
+ {
29
+ scheme: "bearer",
30
+ type: "http"
31
+ }
32
+ ],
33
+ url: "/v2/files"
34
+ });
35
+ };
36
+ const deleteAFile = (options) => {
37
+ return (options?.client ?? client).delete({
38
+ ...options,
39
+ security: [
40
+ {
41
+ scheme: "bearer",
42
+ type: "http"
43
+ }
44
+ ],
45
+ url: "/v2/files/{fileID}"
46
+ });
47
+ };
48
+ const getAFile = (options) => {
49
+ return (options?.client ?? client).get({
50
+ ...options,
51
+ security: [
52
+ {
53
+ scheme: "bearer",
54
+ type: "http"
55
+ }
56
+ ],
57
+ url: "/v2/files/{fileID}"
58
+ });
59
+ };
60
+ export {
61
+ client,
62
+ createAFile,
63
+ deleteAFile,
64
+ getAFile,
65
+ getAllFiles
66
+ };
67
+ //# sourceMappingURL=sdk.gen.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport {\n createClient,\n createConfig,\n type Options,\n formDataBodySerializer,\n} from \"@hey-api/client-fetch\"\nimport type {\n GetAllFilesData,\n GetAllFilesResponse,\n GetAllFilesError,\n CreateAFileData,\n CreateAFileResponse,\n CreateAFileError,\n DeleteAFileData,\n DeleteAFileResponse,\n DeleteAFileError,\n GetAFileData,\n GetAFileResponse,\n GetAFileError,\n} from \"./types.gen\"\n\nexport const client = createClient(createConfig())\n\n/**\n * Get all Files\n * Retrieves all files.\n *\n * ### Filtering\n *\n * For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering).\n *\n * The following operators and attributes are available when filtering on this endpoint.\n *\n * | Attribute | Type | Operators | Example |\n * |:----------------------|:----------|:--------------------------|:-------------|\n * | `id` | `string` | `in` | `in(id,file-id-1,file-id-2,file-id-3)` |\n * | `file_name` | `string` | `eq` / `like` | `eq(file_name, my_image.jpg)` |\n * | `width` | `integer` | `gt` / `ge` / `lt` / `le` | `gt(width,200)` |\n * | `height` | `integer` | `gt` / `ge` / `lt` / `le` | `lt(height,500)` |\n * | `file_size` | `integer` | `gt` / `ge` / `lt` / `le` | `le(file_size,20953)` |\n *\n * #### Bulk File Retrieval\n *\n * To retrieve multiple files by their IDs in a single request, use the `in` operator with a comma-separated list of file IDs:\n *\n * ```\n * GET /v2/files?filter=in(id,06b881bd-f152-4c36-8658-7132a8fab49c,ec73567b-04e8-4000-a11a-7e1407cc2f21)\n * ```\n *\n * This is more efficient than making separate requests for each file and is recommended for bulk operations.\n *\n * **Note on invalid IDs**: If any IDs in the filter are missing, malformed, or do not exist in the store, they will be silently ignored. The response will only include files that were successfully found. For example, if you request 5 IDs but only 3 exist, the response will contain 3 files with `total: 3` in the metadata.\n *\n */\nexport const getAllFiles = <ThrowOnError extends boolean = false>(\n options?: Options<GetAllFilesData, ThrowOnError>,\n) => {\n return (options?.client ?? client).get<\n GetAllFilesResponse,\n GetAllFilesError,\n ThrowOnError\n >({\n ...options,\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/v2/files\",\n })\n}\n\n/**\n * Create a File\n * Create a File\n */\nexport const createAFile = <ThrowOnError extends boolean = false>(\n options: Options<CreateAFileData, ThrowOnError>,\n) => {\n return (options?.client ?? client).post<\n CreateAFileResponse,\n CreateAFileError,\n ThrowOnError\n >({\n ...options,\n ...formDataBodySerializer,\n headers: {\n \"Content-Type\": null,\n ...options?.headers,\n },\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/v2/files\",\n })\n}\n\n/**\n * Delete a File\n * Delete a File\n */\nexport const deleteAFile = <ThrowOnError extends boolean = false>(\n options: Options<DeleteAFileData, ThrowOnError>,\n) => {\n return (options?.client ?? client).delete<\n DeleteAFileResponse,\n DeleteAFileError,\n ThrowOnError\n >({\n ...options,\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/v2/files/{fileID}\",\n })\n}\n\n/**\n * Get a File\n * Get a File\n */\nexport const getAFile = <ThrowOnError extends boolean = false>(\n options: Options<GetAFileData, ThrowOnError>,\n) => {\n return (options?.client ?? client).get<\n GetAFileResponse,\n GetAFileError,\n ThrowOnError\n >({\n ...options,\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/v2/files/{fileID}\",\n })\n}\n"],"mappings":"AAEA;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAgBA,MAAM,SAAS,aAAa,aAAa,CAAC;AAiC1C,MAAM,cAAc,CACzB,YACG;AACH,UAAQ,SAAS,UAAU,QAAQ,IAIjC;AAAA,IACA,GAAG;AAAA,IACH,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;AAMO,MAAM,cAAc,CACzB,YACG;AACH,UAAQ,SAAS,UAAU,QAAQ,KAIjC;AAAA,IACA,GAAG;AAAA,IACH,GAAG;AAAA,IACH,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,GAAG,SAAS;AAAA,IACd;AAAA,IACA,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;AAMO,MAAM,cAAc,CACzB,YACG;AACH,UAAQ,SAAS,UAAU,QAAQ,OAIjC;AAAA,IACA,GAAG;AAAA,IACH,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;AAMO,MAAM,WAAW,CACtB,YACG;AACH,UAAQ,SAAS,UAAU,QAAQ,IAIjC;AAAA,IACA,GAAG;AAAA,IACH,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;","names":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_gen_exports = {};
16
+ module.exports = __toCommonJS(types_gen_exports);
17
+ //# sourceMappingURL=types.gen.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/types.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nexport type ErrorResponse = {\n errors: Array<_Error>\n}\n\nexport type File = {\n /**\n * The unique identifier for this file.\n */\n id?: Uuid\n /**\n * The type represents the object being returned.\n */\n type?: string\n /**\n * The name of the file.\n */\n file_name?: string\n /**\n * The mime type of the file.\n */\n mime_type?: string\n /**\n * The size of the file. Required when uploading files.\n */\n file_size?: number\n /**\n * DEPRECATED Whether the file public or not. Required when uploading files.\n */\n public?: boolean\n meta?: FileMeta\n links?: Links\n link?: FileLink\n}\n\nexport type FileMeta = {\n /**\n * The date and time the file was created.\n */\n timestamps?: {\n /**\n * The date and time the file was created.\n */\n created_at?: string\n }\n /**\n * The file dimensions.\n */\n dimensions?: {\n /**\n * The width of the file.\n */\n width?: number\n /**\n * The height of the file.\n */\n height?: number\n }\n}\n\nexport type ResultsMeta = {\n /**\n * Contains the results for the entire collection.\n */\n page?: {\n /**\n * The maximum number of records for all pages.\n */\n limit?: number\n /**\n * The current offset by number of pages.\n */\n offset?: number\n /**\n * The current number of pages.\n */\n current?: number\n /**\n * The total number of records for the entire collection.\n */\n total?: number\n }\n /**\n * Contains the results for the entire collection.\n */\n results?: {\n /**\n * The total number of records for the entire collection.\n */\n total?: number\n }\n}\n\n/**\n * Links are used to allow you to move between requests.\n */\nexport type Links = {\n /**\n * Single entities use a self parameter with a link to that specific resource.\n */\n self?: string\n}\n\n/**\n * Links are used to allow you to move between requests.\n */\nexport type ResultsLinks = {\n /**\n * Single entities use a self parameter with a link to that specific resource.\n */\n self?: string | null\n /**\n * The current page.\n */\n current?: string | null\n /**\n * Always the first page.\n */\n first?: string | null\n /**\n * This is `null` if there is only one page.\n */\n last?: string | null\n /**\n * The previous page. This is `null` if on the first page.\n */\n prev?: string | null\n /**\n * The next page. This is `null` if there is no next page.\n */\n next?: string | null\n}\n\n/**\n * The publicly available URL for this file.\n */\nexport type FileLink = {\n /**\n * The publicly available URL for this file.\n */\n href?: string\n}\n\nexport type Uuid = string\n\nexport type _Error = {\n /**\n * The HTTP response code of the error.\n */\n status: number\n /**\n * A brief summary of the error.\n */\n title: string\n /**\n * Optional additional detail about the error.\n */\n detail?: string\n /**\n * Internal request ID.\n */\n request_id?: string\n /**\n * Additional supporting meta data for the error.\n */\n meta?: {\n [key: string]: unknown\n }\n}\n\n/**\n *\n * Filtering is available for this endpoint. See [Filtering](/docs/api/pxm/files/get-all-files#filtering).\n *\n */\nexport type Filter = string\n\n/**\n * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\nexport type PageOffset = string\n\n/**\n * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\nexport type PageLimit = string\n\nexport type GetAllFilesData = {\n body?: never\n path?: never\n query?: {\n /**\n *\n * Filtering is available for this endpoint. See [Filtering](/docs/api/pxm/files/get-all-files#filtering).\n *\n */\n filter?: string\n /**\n * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\n \"page[limit]\"?: string\n /**\n * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\n \"page[offset]\"?: string\n }\n url: \"/v2/files\"\n}\n\nexport type GetAllFilesErrors = {\n /**\n * Bad request. The request failed validation.\n */\n 400: ErrorResponse\n /**\n * Internal server error. There was a system failure in the platform.\n */\n 500: ErrorResponse\n}\n\nexport type GetAllFilesError = GetAllFilesErrors[keyof GetAllFilesErrors]\n\nexport type GetAllFilesResponses = {\n /**\n * OK\n */\n 200: {\n data?: Array<File>\n meta?: ResultsMeta\n links?: ResultsLinks\n }\n}\n\nexport type GetAllFilesResponse =\n GetAllFilesResponses[keyof GetAllFilesResponses]\n\nexport type CreateAFileData = {\n body: {\n /**\n * Indicates the file you want to upload.\n */\n file?: Blob | File\n /**\n * Use this parameter to reference a file stored at a specific location. This must be the URL that points to an image file.\n */\n file_location?: string\n }\n path?: never\n query?: never\n url: \"/v2/files\"\n}\n\nexport type CreateAFileErrors = {\n /**\n * Bad request. The request failed validation.\n */\n 400: ErrorResponse\n /**\n * Bad request. The request failed validation.\n */\n 422: ErrorResponse\n /**\n * Internal server error. There was a system failure in the platform.\n */\n 500: ErrorResponse\n}\n\nexport type CreateAFileError = CreateAFileErrors[keyof CreateAFileErrors]\n\nexport type CreateAFileResponses = {\n /**\n * Created\n */\n 201: {\n data?: File\n }\n}\n\nexport type CreateAFileResponse =\n CreateAFileResponses[keyof CreateAFileResponses]\n\nexport type DeleteAFileData = {\n body?: never\n path: {\n /**\n * The unique identifier of the file you want to delete.\n */\n fileID: string\n }\n query?: never\n url: \"/v2/files/{fileID}\"\n}\n\nexport type DeleteAFileErrors = {\n /**\n * Bad request. The request failed validation.\n */\n 403: ErrorResponse\n /**\n * Forbidden. The operation is forbidden on this entity.\n */\n 404: ErrorResponse\n /**\n * Internal server error. There was a system failure in the platform.\n */\n 500: ErrorResponse\n}\n\nexport type DeleteAFileError = DeleteAFileErrors[keyof DeleteAFileErrors]\n\nexport type DeleteAFileResponses = {\n /**\n * No Content\n */\n 204: void\n}\n\nexport type DeleteAFileResponse =\n DeleteAFileResponses[keyof DeleteAFileResponses]\n\nexport type GetAFileData = {\n body?: never\n path: {\n /**\n * The unique identifier for a file.\n */\n fileID: string\n }\n query?: never\n url: \"/v2/files/{fileID}\"\n}\n\nexport type GetAFileErrors = {\n /**\n * Forbidden. The operation is forbidden on this entity.\n */\n 404: ErrorResponse\n /**\n * Internal server error. There was a system failure in the platform.\n */\n 500: ErrorResponse\n}\n\nexport type GetAFileError = GetAFileErrors[keyof GetAFileErrors]\n\nexport type GetAFileResponses = {\n 200: {\n data?: File\n }\n}\n\nexport type GetAFileResponse = GetAFileResponses[keyof GetAFileResponses]\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,319 @@
1
+ type ErrorResponse = {
2
+ errors: Array<_Error>;
3
+ };
4
+ type File = {
5
+ /**
6
+ * The unique identifier for this file.
7
+ */
8
+ id?: Uuid;
9
+ /**
10
+ * The type represents the object being returned.
11
+ */
12
+ type?: string;
13
+ /**
14
+ * The name of the file.
15
+ */
16
+ file_name?: string;
17
+ /**
18
+ * The mime type of the file.
19
+ */
20
+ mime_type?: string;
21
+ /**
22
+ * The size of the file. Required when uploading files.
23
+ */
24
+ file_size?: number;
25
+ /**
26
+ * DEPRECATED Whether the file public or not. Required when uploading files.
27
+ */
28
+ public?: boolean;
29
+ meta?: FileMeta;
30
+ links?: Links;
31
+ link?: FileLink;
32
+ };
33
+ type FileMeta = {
34
+ /**
35
+ * The date and time the file was created.
36
+ */
37
+ timestamps?: {
38
+ /**
39
+ * The date and time the file was created.
40
+ */
41
+ created_at?: string;
42
+ };
43
+ /**
44
+ * The file dimensions.
45
+ */
46
+ dimensions?: {
47
+ /**
48
+ * The width of the file.
49
+ */
50
+ width?: number;
51
+ /**
52
+ * The height of the file.
53
+ */
54
+ height?: number;
55
+ };
56
+ };
57
+ type ResultsMeta = {
58
+ /**
59
+ * Contains the results for the entire collection.
60
+ */
61
+ page?: {
62
+ /**
63
+ * The maximum number of records for all pages.
64
+ */
65
+ limit?: number;
66
+ /**
67
+ * The current offset by number of pages.
68
+ */
69
+ offset?: number;
70
+ /**
71
+ * The current number of pages.
72
+ */
73
+ current?: number;
74
+ /**
75
+ * The total number of records for the entire collection.
76
+ */
77
+ total?: number;
78
+ };
79
+ /**
80
+ * Contains the results for the entire collection.
81
+ */
82
+ results?: {
83
+ /**
84
+ * The total number of records for the entire collection.
85
+ */
86
+ total?: number;
87
+ };
88
+ };
89
+ /**
90
+ * Links are used to allow you to move between requests.
91
+ */
92
+ type Links = {
93
+ /**
94
+ * Single entities use a self parameter with a link to that specific resource.
95
+ */
96
+ self?: string;
97
+ };
98
+ /**
99
+ * Links are used to allow you to move between requests.
100
+ */
101
+ type ResultsLinks = {
102
+ /**
103
+ * Single entities use a self parameter with a link to that specific resource.
104
+ */
105
+ self?: string | null;
106
+ /**
107
+ * The current page.
108
+ */
109
+ current?: string | null;
110
+ /**
111
+ * Always the first page.
112
+ */
113
+ first?: string | null;
114
+ /**
115
+ * This is `null` if there is only one page.
116
+ */
117
+ last?: string | null;
118
+ /**
119
+ * The previous page. This is `null` if on the first page.
120
+ */
121
+ prev?: string | null;
122
+ /**
123
+ * The next page. This is `null` if there is no next page.
124
+ */
125
+ next?: string | null;
126
+ };
127
+ /**
128
+ * The publicly available URL for this file.
129
+ */
130
+ type FileLink = {
131
+ /**
132
+ * The publicly available URL for this file.
133
+ */
134
+ href?: string;
135
+ };
136
+ type Uuid = string;
137
+ type _Error = {
138
+ /**
139
+ * The HTTP response code of the error.
140
+ */
141
+ status: number;
142
+ /**
143
+ * A brief summary of the error.
144
+ */
145
+ title: string;
146
+ /**
147
+ * Optional additional detail about the error.
148
+ */
149
+ detail?: string;
150
+ /**
151
+ * Internal request ID.
152
+ */
153
+ request_id?: string;
154
+ /**
155
+ * Additional supporting meta data for the error.
156
+ */
157
+ meta?: {
158
+ [key: string]: unknown;
159
+ };
160
+ };
161
+ /**
162
+ *
163
+ * Filtering is available for this endpoint. See [Filtering](/docs/api/pxm/files/get-all-files#filtering).
164
+ *
165
+ */
166
+ type Filter = string;
167
+ /**
168
+ * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
169
+ */
170
+ type PageOffset = string;
171
+ /**
172
+ * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
173
+ */
174
+ type PageLimit = string;
175
+ type GetAllFilesData = {
176
+ body?: never;
177
+ path?: never;
178
+ query?: {
179
+ /**
180
+ *
181
+ * Filtering is available for this endpoint. See [Filtering](/docs/api/pxm/files/get-all-files#filtering).
182
+ *
183
+ */
184
+ filter?: string;
185
+ /**
186
+ * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
187
+ */
188
+ "page[limit]"?: string;
189
+ /**
190
+ * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
191
+ */
192
+ "page[offset]"?: string;
193
+ };
194
+ url: "/v2/files";
195
+ };
196
+ type GetAllFilesErrors = {
197
+ /**
198
+ * Bad request. The request failed validation.
199
+ */
200
+ 400: ErrorResponse;
201
+ /**
202
+ * Internal server error. There was a system failure in the platform.
203
+ */
204
+ 500: ErrorResponse;
205
+ };
206
+ type GetAllFilesError = GetAllFilesErrors[keyof GetAllFilesErrors];
207
+ type GetAllFilesResponses = {
208
+ /**
209
+ * OK
210
+ */
211
+ 200: {
212
+ data?: Array<File>;
213
+ meta?: ResultsMeta;
214
+ links?: ResultsLinks;
215
+ };
216
+ };
217
+ type GetAllFilesResponse = GetAllFilesResponses[keyof GetAllFilesResponses];
218
+ type CreateAFileData = {
219
+ body: {
220
+ /**
221
+ * Indicates the file you want to upload.
222
+ */
223
+ file?: Blob | File;
224
+ /**
225
+ * Use this parameter to reference a file stored at a specific location. This must be the URL that points to an image file.
226
+ */
227
+ file_location?: string;
228
+ };
229
+ path?: never;
230
+ query?: never;
231
+ url: "/v2/files";
232
+ };
233
+ type CreateAFileErrors = {
234
+ /**
235
+ * Bad request. The request failed validation.
236
+ */
237
+ 400: ErrorResponse;
238
+ /**
239
+ * Bad request. The request failed validation.
240
+ */
241
+ 422: ErrorResponse;
242
+ /**
243
+ * Internal server error. There was a system failure in the platform.
244
+ */
245
+ 500: ErrorResponse;
246
+ };
247
+ type CreateAFileError = CreateAFileErrors[keyof CreateAFileErrors];
248
+ type CreateAFileResponses = {
249
+ /**
250
+ * Created
251
+ */
252
+ 201: {
253
+ data?: File;
254
+ };
255
+ };
256
+ type CreateAFileResponse = CreateAFileResponses[keyof CreateAFileResponses];
257
+ type DeleteAFileData = {
258
+ body?: never;
259
+ path: {
260
+ /**
261
+ * The unique identifier of the file you want to delete.
262
+ */
263
+ fileID: string;
264
+ };
265
+ query?: never;
266
+ url: "/v2/files/{fileID}";
267
+ };
268
+ type DeleteAFileErrors = {
269
+ /**
270
+ * Bad request. The request failed validation.
271
+ */
272
+ 403: ErrorResponse;
273
+ /**
274
+ * Forbidden. The operation is forbidden on this entity.
275
+ */
276
+ 404: ErrorResponse;
277
+ /**
278
+ * Internal server error. There was a system failure in the platform.
279
+ */
280
+ 500: ErrorResponse;
281
+ };
282
+ type DeleteAFileError = DeleteAFileErrors[keyof DeleteAFileErrors];
283
+ type DeleteAFileResponses = {
284
+ /**
285
+ * No Content
286
+ */
287
+ 204: void;
288
+ };
289
+ type DeleteAFileResponse = DeleteAFileResponses[keyof DeleteAFileResponses];
290
+ type GetAFileData = {
291
+ body?: never;
292
+ path: {
293
+ /**
294
+ * The unique identifier for a file.
295
+ */
296
+ fileID: string;
297
+ };
298
+ query?: never;
299
+ url: "/v2/files/{fileID}";
300
+ };
301
+ type GetAFileErrors = {
302
+ /**
303
+ * Forbidden. The operation is forbidden on this entity.
304
+ */
305
+ 404: ErrorResponse;
306
+ /**
307
+ * Internal server error. There was a system failure in the platform.
308
+ */
309
+ 500: ErrorResponse;
310
+ };
311
+ type GetAFileError = GetAFileErrors[keyof GetAFileErrors];
312
+ type GetAFileResponses = {
313
+ 200: {
314
+ data?: File;
315
+ };
316
+ };
317
+ type GetAFileResponse = GetAFileResponses[keyof GetAFileResponses];
318
+
319
+ export type { CreateAFileData, CreateAFileError, CreateAFileErrors, CreateAFileResponse, CreateAFileResponses, DeleteAFileData, DeleteAFileError, DeleteAFileErrors, DeleteAFileResponse, DeleteAFileResponses, ErrorResponse, File, FileLink, FileMeta, Filter, GetAFileData, GetAFileError, GetAFileErrors, GetAFileResponse, GetAFileResponses, GetAllFilesData, GetAllFilesError, GetAllFilesErrors, GetAllFilesResponse, GetAllFilesResponses, Links, PageLimit, PageOffset, ResultsLinks, ResultsMeta, Uuid, _Error };
@@ -1,7 +1,7 @@
1
- export type ErrorResponse = {
1
+ type ErrorResponse = {
2
2
  errors: Array<_Error>;
3
3
  };
4
- export type File = {
4
+ type File = {
5
5
  /**
6
6
  * The unique identifier for this file.
7
7
  */
@@ -30,7 +30,7 @@ export type File = {
30
30
  links?: Links;
31
31
  link?: FileLink;
32
32
  };
33
- export type FileMeta = {
33
+ type FileMeta = {
34
34
  /**
35
35
  * The date and time the file was created.
36
36
  */
@@ -54,7 +54,7 @@ export type FileMeta = {
54
54
  height?: number;
55
55
  };
56
56
  };
57
- export type ResultsMeta = {
57
+ type ResultsMeta = {
58
58
  /**
59
59
  * Contains the results for the entire collection.
60
60
  */
@@ -89,7 +89,7 @@ export type ResultsMeta = {
89
89
  /**
90
90
  * Links are used to allow you to move between requests.
91
91
  */
92
- export type Links = {
92
+ type Links = {
93
93
  /**
94
94
  * Single entities use a self parameter with a link to that specific resource.
95
95
  */
@@ -98,11 +98,15 @@ export type Links = {
98
98
  /**
99
99
  * Links are used to allow you to move between requests.
100
100
  */
101
- export type ResultsLinks = {
101
+ type ResultsLinks = {
102
102
  /**
103
103
  * Single entities use a self parameter with a link to that specific resource.
104
104
  */
105
105
  self?: string | null;
106
+ /**
107
+ * The current page.
108
+ */
109
+ current?: string | null;
106
110
  /**
107
111
  * Always the first page.
108
112
  */
@@ -111,18 +115,26 @@ export type ResultsLinks = {
111
115
  * This is `null` if there is only one page.
112
116
  */
113
117
  last?: string | null;
118
+ /**
119
+ * The previous page. This is `null` if on the first page.
120
+ */
121
+ prev?: string | null;
122
+ /**
123
+ * The next page. This is `null` if there is no next page.
124
+ */
125
+ next?: string | null;
114
126
  };
115
127
  /**
116
128
  * The publicly available URL for this file.
117
129
  */
118
- export type FileLink = {
130
+ type FileLink = {
119
131
  /**
120
132
  * The publicly available URL for this file.
121
133
  */
122
134
  href?: string;
123
135
  };
124
- export type Uuid = string;
125
- export type _Error = {
136
+ type Uuid = string;
137
+ type _Error = {
126
138
  /**
127
139
  * The HTTP response code of the error.
128
140
  */
@@ -151,16 +163,16 @@ export type _Error = {
151
163
  * Filtering is available for this endpoint. See [Filtering](/docs/api/pxm/files/get-all-files#filtering).
152
164
  *
153
165
  */
154
- export type Filter = string;
166
+ type Filter = string;
155
167
  /**
156
168
  * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
157
169
  */
158
- export type PageOffset = string;
170
+ type PageOffset = string;
159
171
  /**
160
172
  * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
161
173
  */
162
- export type PageLimit = string;
163
- export type GetAllFilesData = {
174
+ type PageLimit = string;
175
+ type GetAllFilesData = {
164
176
  body?: never;
165
177
  path?: never;
166
178
  query?: {
@@ -181,14 +193,18 @@ export type GetAllFilesData = {
181
193
  };
182
194
  url: "/v2/files";
183
195
  };
184
- export type GetAllFilesErrors = {
196
+ type GetAllFilesErrors = {
197
+ /**
198
+ * Bad request. The request failed validation.
199
+ */
200
+ 400: ErrorResponse;
185
201
  /**
186
202
  * Internal server error. There was a system failure in the platform.
187
203
  */
188
204
  500: ErrorResponse;
189
205
  };
190
- export type GetAllFilesError = GetAllFilesErrors[keyof GetAllFilesErrors];
191
- export type GetAllFilesResponses = {
206
+ type GetAllFilesError = GetAllFilesErrors[keyof GetAllFilesErrors];
207
+ type GetAllFilesResponses = {
192
208
  /**
193
209
  * OK
194
210
  */
@@ -198,8 +214,8 @@ export type GetAllFilesResponses = {
198
214
  links?: ResultsLinks;
199
215
  };
200
216
  };
201
- export type GetAllFilesResponse = GetAllFilesResponses[keyof GetAllFilesResponses];
202
- export type CreateAFileData = {
217
+ type GetAllFilesResponse = GetAllFilesResponses[keyof GetAllFilesResponses];
218
+ type CreateAFileData = {
203
219
  body: {
204
220
  /**
205
221
  * Indicates the file you want to upload.
@@ -214,7 +230,7 @@ export type CreateAFileData = {
214
230
  query?: never;
215
231
  url: "/v2/files";
216
232
  };
217
- export type CreateAFileErrors = {
233
+ type CreateAFileErrors = {
218
234
  /**
219
235
  * Bad request. The request failed validation.
220
236
  */
@@ -228,8 +244,8 @@ export type CreateAFileErrors = {
228
244
  */
229
245
  500: ErrorResponse;
230
246
  };
231
- export type CreateAFileError = CreateAFileErrors[keyof CreateAFileErrors];
232
- export type CreateAFileResponses = {
247
+ type CreateAFileError = CreateAFileErrors[keyof CreateAFileErrors];
248
+ type CreateAFileResponses = {
233
249
  /**
234
250
  * Created
235
251
  */
@@ -237,8 +253,8 @@ export type CreateAFileResponses = {
237
253
  data?: File;
238
254
  };
239
255
  };
240
- export type CreateAFileResponse = CreateAFileResponses[keyof CreateAFileResponses];
241
- export type DeleteAFileData = {
256
+ type CreateAFileResponse = CreateAFileResponses[keyof CreateAFileResponses];
257
+ type DeleteAFileData = {
242
258
  body?: never;
243
259
  path: {
244
260
  /**
@@ -249,7 +265,7 @@ export type DeleteAFileData = {
249
265
  query?: never;
250
266
  url: "/v2/files/{fileID}";
251
267
  };
252
- export type DeleteAFileErrors = {
268
+ type DeleteAFileErrors = {
253
269
  /**
254
270
  * Bad request. The request failed validation.
255
271
  */
@@ -263,15 +279,15 @@ export type DeleteAFileErrors = {
263
279
  */
264
280
  500: ErrorResponse;
265
281
  };
266
- export type DeleteAFileError = DeleteAFileErrors[keyof DeleteAFileErrors];
267
- export type DeleteAFileResponses = {
282
+ type DeleteAFileError = DeleteAFileErrors[keyof DeleteAFileErrors];
283
+ type DeleteAFileResponses = {
268
284
  /**
269
285
  * No Content
270
286
  */
271
287
  204: void;
272
288
  };
273
- export type DeleteAFileResponse = DeleteAFileResponses[keyof DeleteAFileResponses];
274
- export type GetAFileData = {
289
+ type DeleteAFileResponse = DeleteAFileResponses[keyof DeleteAFileResponses];
290
+ type GetAFileData = {
275
291
  body?: never;
276
292
  path: {
277
293
  /**
@@ -282,7 +298,7 @@ export type GetAFileData = {
282
298
  query?: never;
283
299
  url: "/v2/files/{fileID}";
284
300
  };
285
- export type GetAFileErrors = {
301
+ type GetAFileErrors = {
286
302
  /**
287
303
  * Forbidden. The operation is forbidden on this entity.
288
304
  */
@@ -292,10 +308,12 @@ export type GetAFileErrors = {
292
308
  */
293
309
  500: ErrorResponse;
294
310
  };
295
- export type GetAFileError = GetAFileErrors[keyof GetAFileErrors];
296
- export type GetAFileResponses = {
311
+ type GetAFileError = GetAFileErrors[keyof GetAFileErrors];
312
+ type GetAFileResponses = {
297
313
  200: {
298
314
  data?: File;
299
315
  };
300
316
  };
301
- export type GetAFileResponse = GetAFileResponses[keyof GetAFileResponses];
317
+ type GetAFileResponse = GetAFileResponses[keyof GetAFileResponses];
318
+
319
+ export type { CreateAFileData, CreateAFileError, CreateAFileErrors, CreateAFileResponse, CreateAFileResponses, DeleteAFileData, DeleteAFileError, DeleteAFileErrors, DeleteAFileResponse, DeleteAFileResponses, ErrorResponse, File, FileLink, FileMeta, Filter, GetAFileData, GetAFileError, GetAFileErrors, GetAFileResponse, GetAFileResponses, GetAllFilesData, GetAllFilesError, GetAllFilesErrors, GetAllFilesResponse, GetAllFilesResponses, Links, PageLimit, PageOffset, ResultsLinks, ResultsMeta, Uuid, _Error };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.gen.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.cjs ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ client: () => import_sdk.client,
23
+ createClient: () => import_client_fetch.createClient
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ __reExport(index_exports, require('./client/index.cjs'), module.exports);
27
+ var import_client_fetch = require("@hey-api/client-fetch");
28
+ var import_sdk = require('./client/sdk.gen.cjs');
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ client,
32
+ createClient,
33
+ ...require('./client/index.cjs')
34
+ });
35
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./client\"\nimport { createClient } from \"@hey-api/client-fetch\"\nimport type { Client } from \"@hey-api/client-fetch\"\nexport { createClient }\nexport type { Client }\nexport { client } from \"./client/sdk.gen\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,qBAAd;AACA,0BAA6B;AAI7B,iBAAuB;","names":[]}
@@ -0,0 +1,3 @@
1
+ export { CreateAFileData, CreateAFileError, CreateAFileErrors, CreateAFileResponse, CreateAFileResponses, DeleteAFileData, DeleteAFileError, DeleteAFileErrors, DeleteAFileResponse, DeleteAFileResponses, ErrorResponse, File, FileLink, FileMeta, Filter, GetAFileData, GetAFileError, GetAFileErrors, GetAFileResponse, GetAFileResponses, GetAllFilesData, GetAllFilesError, GetAllFilesErrors, GetAllFilesResponse, GetAllFilesResponses, Links, PageLimit, PageOffset, ResultsLinks, ResultsMeta, Uuid, _Error } from './client/types.gen.cjs';
2
+ export { client, createAFile, deleteAFile, getAFile, getAllFiles } from './client/sdk.gen.cjs';
3
+ export { Client, createClient } from '@hey-api/client-fetch';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./client";
2
- import { Client, createClient } from "@hey-api/client-fetch";
3
- export { createClient, Client };
4
- export { client } from "./client/sdk.gen";
1
+ export { CreateAFileData, CreateAFileError, CreateAFileErrors, CreateAFileResponse, CreateAFileResponses, DeleteAFileData, DeleteAFileError, DeleteAFileErrors, DeleteAFileResponse, DeleteAFileResponses, ErrorResponse, File, FileLink, FileMeta, Filter, GetAFileData, GetAFileError, GetAFileErrors, GetAFileResponse, GetAFileResponses, GetAllFilesData, GetAllFilesError, GetAllFilesErrors, GetAllFilesResponse, GetAllFilesResponses, Links, PageLimit, PageOffset, ResultsLinks, ResultsMeta, Uuid, _Error } from './client/types.gen.js';
2
+ export { client, createAFile, deleteAFile, getAFile, getAllFiles } from './client/sdk.gen.js';
3
+ export { Client, createClient } from '@hey-api/client-fetch';
package/dist/index.mjs ADDED
@@ -0,0 +1,8 @@
1
+ export * from "./client/index.mjs";
2
+ import { createClient } from "@hey-api/client-fetch";
3
+ import { client } from "./client/sdk.gen.mjs";
4
+ export {
5
+ client,
6
+ createClient
7
+ };
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./client\"\nimport { createClient } from \"@hey-api/client-fetch\"\nimport type { Client } from \"@hey-api/client-fetch\"\nexport { createClient }\nexport type { Client }\nexport { client } from \"./client/sdk.gen\"\n"],"mappings":"AAAA,cAAc;AACd,SAAS,oBAAoB;AAI7B,SAAS,cAAc;","names":[]}
package/package.json CHANGED
@@ -1,16 +1,21 @@
1
1
  {
2
2
  "name": "@epcc-sdk/sdks-files",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
- "main": "dist/index.js",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
6
9
  "exports": {
7
10
  ".": {
8
- "types": "./dist/index.d.ts",
9
- "node": {
10
- "import": "./dist/index.js",
11
- "require": "./dist/index.js"
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.mjs"
12
14
  },
13
- "default": "./dist/index.js"
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
14
19
  },
15
20
  "./package.json": "./package.json"
16
21
  },
@@ -25,14 +30,17 @@
25
30
  "@hey-api/openapi-ts": "0.61.2",
26
31
  "typescript": "^5.5.3",
27
32
  "@types/ejs": "^3.1.5",
28
- "ejs": "^3.1.10"
33
+ "ejs": "^3.1.10",
34
+ "esbuild-fix-imports-plugin": "^1.0.19",
35
+ "esbuild-plugin-file-path-extensions": "^1.0.0",
36
+ "tsup": "^8.4.0"
29
37
  },
30
38
  "dependencies": {
31
39
  "@hey-api/client-fetch": "0.6.0"
32
40
  },
33
41
  "scripts": {
34
- "build": "pnpm openapi-ts && pnpm tsc:build",
35
- "tsc:build": "tsc -p tsconfig.node.json",
42
+ "build": "pnpm openapi-ts && pnpm build:tsup",
43
+ "build:tsup": "tsup",
36
44
  "openapi-ts": "openapi-ts"
37
45
  }
38
46
  }
@@ -1,3 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export * from "./types.gen";
3
- export * from "./sdk.gen";
@@ -1,80 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- import { createClient, createConfig, formDataBodySerializer, } from "@hey-api/client-fetch";
14
- export var client = createClient(createConfig());
15
- /**
16
- * Get all Files
17
- * Retrieves all files.
18
- *
19
- * ### Filtering
20
- *
21
- * For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering).
22
- *
23
- * The following operators and attributes are available when filtering on this endpoint.
24
- *
25
- * | Attribute | Type | Operators | Example |
26
- * |:----------------------|:----------|:--------------------------|:-------------|
27
- * | `file_name` | `string` | `eq` / `like` | `eq(file_name, my_image.jpg)` |
28
- * | `width` | `integer` | `gt` / `ge` / `lt` / `le` | `gt(width,200)` |
29
- * | `height` | `integer` | `gt` / `ge` / `lt` / `le` | `lt(height,500)` |
30
- * | `file_size` | `integer` | `gt` / `ge` / `lt` / `le` | `le(file_size,20953)` |
31
- *
32
- */
33
- export var getAllFiles = function (options) {
34
- var _a;
35
- return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : client).get(__assign(__assign({}, options), { security: [
36
- {
37
- scheme: "bearer",
38
- type: "http",
39
- },
40
- ], url: "/v2/files" }));
41
- };
42
- /**
43
- * Create a File
44
- * Create a File
45
- */
46
- export var createAFile = function (options) {
47
- var _a;
48
- return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : client).post(__assign(__assign(__assign({}, options), formDataBodySerializer), { headers: __assign({ "Content-Type": null }, options === null || options === void 0 ? void 0 : options.headers), security: [
49
- {
50
- scheme: "bearer",
51
- type: "http",
52
- },
53
- ], url: "/v2/files" }));
54
- };
55
- /**
56
- * Delete a File
57
- * Delete a File
58
- */
59
- export var deleteAFile = function (options) {
60
- var _a;
61
- return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : client).delete(__assign(__assign({}, options), { security: [
62
- {
63
- scheme: "bearer",
64
- type: "http",
65
- },
66
- ], url: "/v2/files/{fileID}" }));
67
- };
68
- /**
69
- * Get a File
70
- * Get a File
71
- */
72
- export var getAFile = function (options) {
73
- var _a;
74
- return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : client).get(__assign(__assign({}, options), { security: [
75
- {
76
- scheme: "bearer",
77
- type: "http",
78
- },
79
- ], url: "/v2/files/{fileID}" }));
80
- };
@@ -1,2 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export {};
package/dist/index.js DELETED
@@ -1,4 +0,0 @@
1
- export * from "./client";
2
- import { createClient } from "@hey-api/client-fetch";
3
- export { createClient };
4
- export { client } from "./client/sdk.gen";