@ecodrix/erix-api 1.2.1 → 1.2.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/dist/cli.js +1 -1
- package/dist/index.d.ts +22 -6
- package/dist/ts/browser/index.global.js +5 -5
- package/dist/ts/browser/index.global.js.map +1 -1
- package/dist/ts/cjs/index.cjs +1 -1
- package/dist/ts/cjs/index.cjs.map +1 -1
- package/dist/ts/cjs/index.d.cts +22 -6
- package/dist/ts/esm/index.d.ts +22 -6
- package/dist/ts/esm/index.js +1 -1
- package/dist/ts/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/core.ts +24 -0
- package/src/resources/media.ts +16 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecodrix/erix-api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"author": "ECODrIx Team <contact@ecodrix.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Official Isomorphic SDK for the ECODrIx platform. Native support for WhatsApp, CRM, Storage, and Meetings across TS, JS, Python, and Java.",
|
package/src/core.ts
CHANGED
|
@@ -84,6 +84,13 @@ export class Ecodrix {
|
|
|
84
84
|
*/
|
|
85
85
|
private readonly socket: Socket;
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* The tenant client code this SDK instance is scoped to.
|
|
89
|
+
* Useful for components that need to read the clientCode back
|
|
90
|
+
* from a context-provided SDK instance.
|
|
91
|
+
*/
|
|
92
|
+
public readonly clientCode: string | undefined;
|
|
93
|
+
|
|
87
94
|
/** WhatsApp messaging and conversation management. */
|
|
88
95
|
public readonly whatsapp: WhatsApp;
|
|
89
96
|
|
|
@@ -128,6 +135,8 @@ export class Ecodrix {
|
|
|
128
135
|
throw new AuthenticationError("API Key is required");
|
|
129
136
|
}
|
|
130
137
|
|
|
138
|
+
this.clientCode = options.clientCode?.toUpperCase();
|
|
139
|
+
|
|
131
140
|
// @internal: options.baseUrl is available for CLI/test use only.
|
|
132
141
|
// Host projects hardcode to prod — they never set baseUrl.
|
|
133
142
|
const baseUrl = options.baseUrl ?? ECOD_API_BASE;
|
|
@@ -203,6 +212,21 @@ export class Ecodrix {
|
|
|
203
212
|
});
|
|
204
213
|
|
|
205
214
|
this.setupSocket(options.clientCode);
|
|
215
|
+
|
|
216
|
+
// ─── Wappalyzer & Technology Detection ─────────────────────────────────────
|
|
217
|
+
if (isBrowser) {
|
|
218
|
+
const footprint = {
|
|
219
|
+
version: "1.2.2",
|
|
220
|
+
clientCode: options.clientCode,
|
|
221
|
+
initializedAt: new Date().toISOString(),
|
|
222
|
+
};
|
|
223
|
+
// Standard identifying global
|
|
224
|
+
(window as any).__ECODRIX_SDK__ = footprint;
|
|
225
|
+
// Ergonomic access for developers (as attempted by the user)
|
|
226
|
+
if (!(window as any).ecodrix) {
|
|
227
|
+
(window as any).ecodrix = this;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
206
230
|
}
|
|
207
231
|
|
|
208
232
|
/**
|
package/src/resources/media.ts
CHANGED
|
@@ -72,15 +72,25 @@ export class Media extends APIResource {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
|
-
* List files within a
|
|
75
|
+
* List files within a folder, with optional date / search filtering.
|
|
76
76
|
*
|
|
77
|
-
* @param folder - The folder
|
|
78
|
-
*
|
|
79
|
-
*
|
|
77
|
+
* @param folder - The folder name to list, **or `"*"` to fetch all folders**
|
|
78
|
+
* for the tenant in a single call (returns a merged flat list with a
|
|
79
|
+
* `folder` field on each file so callers can group/filter client-side).
|
|
80
|
+
* @param params - Optional `year`, `month`, and keyword search `q` filters.
|
|
81
|
+
* @returns `{ data: { files, count, totalSizeBytes } }`.
|
|
80
82
|
*
|
|
81
|
-
* @example
|
|
83
|
+
* @example Single folder
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const { data } = await ecod.media.list("invoices", { q: "contract" });
|
|
86
|
+
* // data.files → files only from the "invoices" folder
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @example All folders
|
|
82
90
|
* ```typescript
|
|
83
|
-
* const { data
|
|
91
|
+
* const { data } = await ecod.media.list("*");
|
|
92
|
+
* // data.files → merged files from every folder the tenant has
|
|
93
|
+
* // Each file has a `folder` field indicating its source folder
|
|
84
94
|
* ```
|
|
85
95
|
*/
|
|
86
96
|
async list(folder: string, params?: { year?: string; month?: string; q?: string }) {
|