@nemphi/sdk 0.1.0 → 0.2.4556

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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/resources/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,cAAc,GACtB,cAAc,GACd,YAAY,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAE1B,MAAM,EAAE,YAAY;IAIhC,SAAS;eAC6B,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;IAGpE,UAAU;IAIV,UAAU,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAShD,UAAU,CAAC,KAAK,GAAE,WAAgB;IAMlC,UAAU,CAAC,KAAK,EAAE,oBAAoB;kBACG,OAAO;gBAAU,OAAO;;IAMjE,gBAAgB,CAAC,KAAK,EAAE,MAAM;CAK/B"}
@@ -1,35 +0,0 @@
1
- export class UsageResource {
2
- constructor(client) {
3
- this.client = client;
4
- }
5
- listPlans() {
6
- return this.client.request("/usage/plans");
7
- }
8
- getCurrent() {
9
- return this.client.request("/usage/current");
10
- }
11
- getHistory(input) {
12
- return this.client.request("/usage/history", {
13
- query: {
14
- start: input.start,
15
- end: input.end,
16
- },
17
- });
18
- }
19
- listEvents(query = {}) {
20
- return this.client.request("/usage/events", {
21
- query,
22
- });
23
- }
24
- trackEvent(input) {
25
- return this.client.request("/usage/events", {
26
- method: "POST",
27
- body: input,
28
- });
29
- }
30
- getMonthlyReport(month) {
31
- return this.client.request("/usage/reports/monthly", {
32
- query: { month },
33
- });
34
- }
35
- }
package/dist/types.d.ts DELETED
@@ -1,27 +0,0 @@
1
- export type HttpMethod = "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
2
- export type QueryValue = string | number | boolean | null | undefined;
3
- export type QueryParams = Record<string, QueryValue | QueryValue[]>;
4
- export type RequestOptions = {
5
- method?: HttpMethod;
6
- query?: QueryParams;
7
- body?: unknown;
8
- headers?: Record<string, string>;
9
- signal?: AbortSignal;
10
- };
11
- export type SdkOptions = {
12
- baseUrl: string;
13
- apiKey?: string;
14
- token?: string;
15
- organizationId?: string;
16
- defaultHeaders?: Record<string, string>;
17
- fetch?: typeof globalThis.fetch;
18
- };
19
- export type ApiErrorPayload = {
20
- message?: string;
21
- [key: string]: unknown;
22
- };
23
- export type PaginatedResponse<T> = {
24
- nextCursor: string | null;
25
- total?: number;
26
- } & T;
27
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAErE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM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