@gpt-core/admin 0.7.2 → 0.7.4

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/index.d.mts CHANGED
@@ -84,10 +84,46 @@ type WebhookConfig = {
84
84
  * An attributes object for a webhook_config
85
85
  */
86
86
  attributes?: {
87
+ /**
88
+ * Field included by default.
89
+ */
90
+ application_id: string;
91
+ /**
92
+ * Field included by default.
93
+ */
94
+ enabled?: boolean | null | unknown;
95
+ /**
96
+ * Field included by default.
97
+ */
98
+ events?: Array<string> | null | unknown;
99
+ /**
100
+ * Field included by default.
101
+ */
102
+ inserted_at: unknown;
103
+ /**
104
+ * Field included by default.
105
+ */
106
+ name: string;
107
+ /**
108
+ * HMAC secret for webhook signature verification. Field included by default.
109
+ */
110
+ secret?: string | null | unknown;
111
+ /**
112
+ * Field included by default.
113
+ */
114
+ tenant_id?: string | null | unknown;
87
115
  /**
88
116
  * ISV filter: specific tenant UUIDs to receive events from (null = all). Field included by default.
89
117
  */
90
118
  tenant_ids?: Array<string> | null | unknown;
119
+ /**
120
+ * Field included by default.
121
+ */
122
+ updated_at: unknown;
123
+ /**
124
+ * Field included by default.
125
+ */
126
+ url: string;
91
127
  /**
92
128
  * Tenant filter: specific workspace UUIDs to receive events from (null = all). Field included by default.
93
129
  */
@@ -98,7 +134,30 @@ type WebhookConfig = {
98
134
  * A relationships object for a webhook_config
99
135
  */
100
136
  relationships?: {
101
- [key: string]: never;
137
+ application?: {
138
+ /**
139
+ * An identifier for application
140
+ */
141
+ data?: {
142
+ id: string;
143
+ meta?: {
144
+ [key: string]: unknown;
145
+ };
146
+ type: string;
147
+ } | null;
148
+ };
149
+ tenant?: {
150
+ /**
151
+ * An identifier for tenant
152
+ */
153
+ data?: {
154
+ id: string;
155
+ meta?: {
156
+ [key: string]: unknown;
157
+ };
158
+ type: string;
159
+ } | null;
160
+ };
102
161
  };
103
162
  type: string;
104
163
  };
@@ -422,7 +481,12 @@ type Ledger = {
422
481
  * An attributes object for a ledger
423
482
  */
424
483
  attributes?: {
425
- [key: string]: never;
484
+ /**
485
+ * Optional metadata including api_key_id for tracking source. Field included by default.
486
+ */
487
+ metadata?: {
488
+ [key: string]: unknown;
489
+ } | null | unknown;
426
490
  };
427
491
  id: string;
428
492
  /**
@@ -855,6 +919,22 @@ type ApiKey = {
855
919
  * Field included by default.
856
920
  */
857
921
  application_id: string;
922
+ /**
923
+ * Credits remaining in current budget period
924
+ */
925
+ budget_remaining?: number | null | unknown;
926
+ /**
927
+ * When the current budget period will reset
928
+ */
929
+ budget_resets_at?: unknown;
930
+ /**
931
+ * Maximum credits allowed per period (null = unlimited). Field included by default.
932
+ */
933
+ credit_limit?: number | null | unknown;
934
+ /**
935
+ * Budget reset period. Field included by default.
936
+ */
937
+ credit_limit_period?: "daily" | "weekly" | "monthly" | "yearly" | "lifetime" | unknown;
858
938
  current_scopes?: Array<string> | null | unknown;
859
939
  /**
860
940
  * Field included by default.
@@ -864,14 +944,38 @@ type ApiKey = {
864
944
  * The raw API key token. Only returned once upon creation or rotation.
865
945
  */
866
946
  generated_api_key?: string | null | unknown;
947
+ /**
948
+ * Field included by default.
949
+ */
950
+ key_type: "user" | "application" | "system" | "server";
951
+ /**
952
+ * Field included by default.
953
+ */
954
+ last_used_at?: unknown;
867
955
  /**
868
956
  * Field included by default.
869
957
  */
870
958
  name?: string | null | unknown;
959
+ /**
960
+ * Credits used in current period (resets based on period). Field included by default.
961
+ */
962
+ period_credits_used: number;
963
+ /**
964
+ * When the current budget period began. Field included by default.
965
+ */
966
+ period_started_at?: unknown;
871
967
  /**
872
968
  * Field included by default.
873
969
  */
874
970
  prefix: string;
971
+ /**
972
+ * Rate limit period in seconds. Field included by default.
973
+ */
974
+ rate_limit_period_seconds: number;
975
+ /**
976
+ * Maximum requests allowed per period. Field included by default.
977
+ */
978
+ rate_limit_requests: number;
875
979
  /**
876
980
  * Field included by default.
877
981
  */
@@ -884,6 +988,14 @@ type ApiKey = {
884
988
  * Field included by default.
885
989
  */
886
990
  tenant_id?: string | null | unknown;
991
+ /**
992
+ * Field included by default.
993
+ */
994
+ total_credits_used: number;
995
+ /**
996
+ * Field included by default.
997
+ */
998
+ total_requests: number;
887
999
  /**
888
1000
  * Field included by default.
889
1001
  */
@@ -1786,14 +1898,76 @@ type WebhookDelivery = {
1786
1898
  * An attributes object for a webhook_delivery
1787
1899
  */
1788
1900
  attributes?: {
1789
- [key: string]: never;
1901
+ /**
1902
+ * Field included by default.
1903
+ */
1904
+ attempt_count?: number | null | unknown;
1905
+ /**
1906
+ * Field included by default.
1907
+ */
1908
+ event_type?: string | null | unknown;
1909
+ /**
1910
+ * Field included by default.
1911
+ */
1912
+ inserted_at: unknown;
1913
+ /**
1914
+ * Field included by default.
1915
+ */
1916
+ next_retry_at?: unknown;
1917
+ /**
1918
+ * Field included by default.
1919
+ */
1920
+ payload: {
1921
+ [key: string]: unknown;
1922
+ };
1923
+ /**
1924
+ * Field included by default.
1925
+ */
1926
+ request_headers?: {
1927
+ [key: string]: unknown;
1928
+ } | null | unknown;
1929
+ /**
1930
+ * Field included by default.
1931
+ */
1932
+ response_body?: string | null | unknown;
1933
+ /**
1934
+ * Field included by default.
1935
+ */
1936
+ response_status?: number | null | unknown;
1937
+ /**
1938
+ * Field included by default.
1939
+ */
1940
+ status?: "pending" | "success" | "failed" | "retrying" | unknown;
1941
+ /**
1942
+ * Field included by default.
1943
+ */
1944
+ updated_at: unknown;
1945
+ /**
1946
+ * Field included by default.
1947
+ */
1948
+ url: string;
1949
+ /**
1950
+ * Field included by default.
1951
+ */
1952
+ webhook_config_id: string;
1790
1953
  };
1791
1954
  id: string;
1792
1955
  /**
1793
1956
  * A relationships object for a webhook_delivery
1794
1957
  */
1795
1958
  relationships?: {
1796
- [key: string]: never;
1959
+ webhook_config?: {
1960
+ /**
1961
+ * An identifier for webhook_config
1962
+ */
1963
+ data?: {
1964
+ id: string;
1965
+ meta?: {
1966
+ [key: string]: unknown;
1967
+ };
1968
+ type: string;
1969
+ } | null;
1970
+ };
1797
1971
  };
1798
1972
  type: string;
1799
1973
  };
@@ -5410,10 +5584,13 @@ type PostAdminWebhookConfigsData = {
5410
5584
  body: {
5411
5585
  data: {
5412
5586
  attributes?: {
5413
- application_id: string;
5587
+ application_id?: string | unknown;
5414
5588
  enabled?: boolean | unknown;
5415
5589
  events?: Array<string> | unknown;
5416
5590
  name: string;
5591
+ /**
5592
+ * HMAC secret for webhook signature verification
5593
+ */
5417
5594
  secret?: string | unknown;
5418
5595
  tenant_id?: string | unknown;
5419
5596
  /**
@@ -6479,6 +6656,9 @@ type PatchAdminWebhookConfigsByIdData = {
6479
6656
  enabled?: boolean | unknown;
6480
6657
  events?: Array<string> | unknown;
6481
6658
  name?: string | unknown;
6659
+ /**
6660
+ * HMAC secret for webhook signature verification
6661
+ */
6482
6662
  secret?: string | unknown;
6483
6663
  /**
6484
6664
  * ISV filter: specific tenant UUIDs to receive events from (null = all)
@@ -17161,16 +17341,32 @@ type PostAdminApiKeysData = {
17161
17341
  /**
17162
17342
  * Request body for the /api_keys operation on api_key resource
17163
17343
  */
17164
- body: {
17344
+ body?: {
17165
17345
  data: {
17166
17346
  attributes?: {
17167
17347
  application_id?: string | unknown;
17348
+ /**
17349
+ * Maximum credits allowed per period (null = unlimited)
17350
+ */
17351
+ credit_limit?: number | unknown;
17352
+ /**
17353
+ * Budget reset period
17354
+ */
17355
+ credit_limit_period?: "daily" | "weekly" | "monthly" | "yearly" | "lifetime" | unknown;
17168
17356
  expires_at?: unknown;
17357
+ key_type?: "user" | "application" | "system" | "server" | unknown;
17169
17358
  name?: string | unknown;
17359
+ /**
17360
+ * Rate limit period in seconds
17361
+ */
17362
+ rate_limit_period_seconds?: number | unknown;
17363
+ /**
17364
+ * Maximum requests allowed per period
17365
+ */
17366
+ rate_limit_requests?: number | unknown;
17170
17367
  scopes?: Array<string> | unknown;
17171
17368
  tenant_id?: string | unknown;
17172
17369
  token?: string | unknown;
17173
- type: "user" | "application" | "system" | "server";
17174
17370
  user_id?: string | unknown;
17175
17371
  workspace_id?: string | unknown;
17176
17372
  };
@@ -19585,7 +19781,24 @@ type PatchAdminApiKeysByIdData = {
19585
19781
  body?: {
19586
19782
  data: {
19587
19783
  attributes?: {
19784
+ /**
19785
+ * Maximum credits allowed per period (null = unlimited)
19786
+ */
19787
+ credit_limit?: number | unknown;
19788
+ /**
19789
+ * Budget reset period
19790
+ */
19791
+ credit_limit_period?: "daily" | "weekly" | "monthly" | "yearly" | "lifetime" | unknown;
19588
19792
  name?: string | unknown;
19793
+ /**
19794
+ * Rate limit period in seconds
19795
+ */
19796
+ rate_limit_period_seconds?: number | unknown;
19797
+ /**
19798
+ * Maximum requests allowed per period
19799
+ */
19800
+ rate_limit_requests?: number | unknown;
19801
+ scopes?: Array<string> | unknown;
19589
19802
  };
19590
19803
  id: string;
19591
19804
  relationships?: {
package/dist/index.d.ts CHANGED
@@ -84,10 +84,46 @@ type WebhookConfig = {
84
84
  * An attributes object for a webhook_config
85
85
  */
86
86
  attributes?: {
87
+ /**
88
+ * Field included by default.
89
+ */
90
+ application_id: string;
91
+ /**
92
+ * Field included by default.
93
+ */
94
+ enabled?: boolean | null | unknown;
95
+ /**
96
+ * Field included by default.
97
+ */
98
+ events?: Array<string> | null | unknown;
99
+ /**
100
+ * Field included by default.
101
+ */
102
+ inserted_at: unknown;
103
+ /**
104
+ * Field included by default.
105
+ */
106
+ name: string;
107
+ /**
108
+ * HMAC secret for webhook signature verification. Field included by default.
109
+ */
110
+ secret?: string | null | unknown;
111
+ /**
112
+ * Field included by default.
113
+ */
114
+ tenant_id?: string | null | unknown;
87
115
  /**
88
116
  * ISV filter: specific tenant UUIDs to receive events from (null = all). Field included by default.
89
117
  */
90
118
  tenant_ids?: Array<string> | null | unknown;
119
+ /**
120
+ * Field included by default.
121
+ */
122
+ updated_at: unknown;
123
+ /**
124
+ * Field included by default.
125
+ */
126
+ url: string;
91
127
  /**
92
128
  * Tenant filter: specific workspace UUIDs to receive events from (null = all). Field included by default.
93
129
  */
@@ -98,7 +134,30 @@ type WebhookConfig = {
98
134
  * A relationships object for a webhook_config
99
135
  */
100
136
  relationships?: {
101
- [key: string]: never;
137
+ application?: {
138
+ /**
139
+ * An identifier for application
140
+ */
141
+ data?: {
142
+ id: string;
143
+ meta?: {
144
+ [key: string]: unknown;
145
+ };
146
+ type: string;
147
+ } | null;
148
+ };
149
+ tenant?: {
150
+ /**
151
+ * An identifier for tenant
152
+ */
153
+ data?: {
154
+ id: string;
155
+ meta?: {
156
+ [key: string]: unknown;
157
+ };
158
+ type: string;
159
+ } | null;
160
+ };
102
161
  };
103
162
  type: string;
104
163
  };
@@ -422,7 +481,12 @@ type Ledger = {
422
481
  * An attributes object for a ledger
423
482
  */
424
483
  attributes?: {
425
- [key: string]: never;
484
+ /**
485
+ * Optional metadata including api_key_id for tracking source. Field included by default.
486
+ */
487
+ metadata?: {
488
+ [key: string]: unknown;
489
+ } | null | unknown;
426
490
  };
427
491
  id: string;
428
492
  /**
@@ -855,6 +919,22 @@ type ApiKey = {
855
919
  * Field included by default.
856
920
  */
857
921
  application_id: string;
922
+ /**
923
+ * Credits remaining in current budget period
924
+ */
925
+ budget_remaining?: number | null | unknown;
926
+ /**
927
+ * When the current budget period will reset
928
+ */
929
+ budget_resets_at?: unknown;
930
+ /**
931
+ * Maximum credits allowed per period (null = unlimited). Field included by default.
932
+ */
933
+ credit_limit?: number | null | unknown;
934
+ /**
935
+ * Budget reset period. Field included by default.
936
+ */
937
+ credit_limit_period?: "daily" | "weekly" | "monthly" | "yearly" | "lifetime" | unknown;
858
938
  current_scopes?: Array<string> | null | unknown;
859
939
  /**
860
940
  * Field included by default.
@@ -864,14 +944,38 @@ type ApiKey = {
864
944
  * The raw API key token. Only returned once upon creation or rotation.
865
945
  */
866
946
  generated_api_key?: string | null | unknown;
947
+ /**
948
+ * Field included by default.
949
+ */
950
+ key_type: "user" | "application" | "system" | "server";
951
+ /**
952
+ * Field included by default.
953
+ */
954
+ last_used_at?: unknown;
867
955
  /**
868
956
  * Field included by default.
869
957
  */
870
958
  name?: string | null | unknown;
959
+ /**
960
+ * Credits used in current period (resets based on period). Field included by default.
961
+ */
962
+ period_credits_used: number;
963
+ /**
964
+ * When the current budget period began. Field included by default.
965
+ */
966
+ period_started_at?: unknown;
871
967
  /**
872
968
  * Field included by default.
873
969
  */
874
970
  prefix: string;
971
+ /**
972
+ * Rate limit period in seconds. Field included by default.
973
+ */
974
+ rate_limit_period_seconds: number;
975
+ /**
976
+ * Maximum requests allowed per period. Field included by default.
977
+ */
978
+ rate_limit_requests: number;
875
979
  /**
876
980
  * Field included by default.
877
981
  */
@@ -884,6 +988,14 @@ type ApiKey = {
884
988
  * Field included by default.
885
989
  */
886
990
  tenant_id?: string | null | unknown;
991
+ /**
992
+ * Field included by default.
993
+ */
994
+ total_credits_used: number;
995
+ /**
996
+ * Field included by default.
997
+ */
998
+ total_requests: number;
887
999
  /**
888
1000
  * Field included by default.
889
1001
  */
@@ -1786,14 +1898,76 @@ type WebhookDelivery = {
1786
1898
  * An attributes object for a webhook_delivery
1787
1899
  */
1788
1900
  attributes?: {
1789
- [key: string]: never;
1901
+ /**
1902
+ * Field included by default.
1903
+ */
1904
+ attempt_count?: number | null | unknown;
1905
+ /**
1906
+ * Field included by default.
1907
+ */
1908
+ event_type?: string | null | unknown;
1909
+ /**
1910
+ * Field included by default.
1911
+ */
1912
+ inserted_at: unknown;
1913
+ /**
1914
+ * Field included by default.
1915
+ */
1916
+ next_retry_at?: unknown;
1917
+ /**
1918
+ * Field included by default.
1919
+ */
1920
+ payload: {
1921
+ [key: string]: unknown;
1922
+ };
1923
+ /**
1924
+ * Field included by default.
1925
+ */
1926
+ request_headers?: {
1927
+ [key: string]: unknown;
1928
+ } | null | unknown;
1929
+ /**
1930
+ * Field included by default.
1931
+ */
1932
+ response_body?: string | null | unknown;
1933
+ /**
1934
+ * Field included by default.
1935
+ */
1936
+ response_status?: number | null | unknown;
1937
+ /**
1938
+ * Field included by default.
1939
+ */
1940
+ status?: "pending" | "success" | "failed" | "retrying" | unknown;
1941
+ /**
1942
+ * Field included by default.
1943
+ */
1944
+ updated_at: unknown;
1945
+ /**
1946
+ * Field included by default.
1947
+ */
1948
+ url: string;
1949
+ /**
1950
+ * Field included by default.
1951
+ */
1952
+ webhook_config_id: string;
1790
1953
  };
1791
1954
  id: string;
1792
1955
  /**
1793
1956
  * A relationships object for a webhook_delivery
1794
1957
  */
1795
1958
  relationships?: {
1796
- [key: string]: never;
1959
+ webhook_config?: {
1960
+ /**
1961
+ * An identifier for webhook_config
1962
+ */
1963
+ data?: {
1964
+ id: string;
1965
+ meta?: {
1966
+ [key: string]: unknown;
1967
+ };
1968
+ type: string;
1969
+ } | null;
1970
+ };
1797
1971
  };
1798
1972
  type: string;
1799
1973
  };
@@ -5410,10 +5584,13 @@ type PostAdminWebhookConfigsData = {
5410
5584
  body: {
5411
5585
  data: {
5412
5586
  attributes?: {
5413
- application_id: string;
5587
+ application_id?: string | unknown;
5414
5588
  enabled?: boolean | unknown;
5415
5589
  events?: Array<string> | unknown;
5416
5590
  name: string;
5591
+ /**
5592
+ * HMAC secret for webhook signature verification
5593
+ */
5417
5594
  secret?: string | unknown;
5418
5595
  tenant_id?: string | unknown;
5419
5596
  /**
@@ -6479,6 +6656,9 @@ type PatchAdminWebhookConfigsByIdData = {
6479
6656
  enabled?: boolean | unknown;
6480
6657
  events?: Array<string> | unknown;
6481
6658
  name?: string | unknown;
6659
+ /**
6660
+ * HMAC secret for webhook signature verification
6661
+ */
6482
6662
  secret?: string | unknown;
6483
6663
  /**
6484
6664
  * ISV filter: specific tenant UUIDs to receive events from (null = all)
@@ -17161,16 +17341,32 @@ type PostAdminApiKeysData = {
17161
17341
  /**
17162
17342
  * Request body for the /api_keys operation on api_key resource
17163
17343
  */
17164
- body: {
17344
+ body?: {
17165
17345
  data: {
17166
17346
  attributes?: {
17167
17347
  application_id?: string | unknown;
17348
+ /**
17349
+ * Maximum credits allowed per period (null = unlimited)
17350
+ */
17351
+ credit_limit?: number | unknown;
17352
+ /**
17353
+ * Budget reset period
17354
+ */
17355
+ credit_limit_period?: "daily" | "weekly" | "monthly" | "yearly" | "lifetime" | unknown;
17168
17356
  expires_at?: unknown;
17357
+ key_type?: "user" | "application" | "system" | "server" | unknown;
17169
17358
  name?: string | unknown;
17359
+ /**
17360
+ * Rate limit period in seconds
17361
+ */
17362
+ rate_limit_period_seconds?: number | unknown;
17363
+ /**
17364
+ * Maximum requests allowed per period
17365
+ */
17366
+ rate_limit_requests?: number | unknown;
17170
17367
  scopes?: Array<string> | unknown;
17171
17368
  tenant_id?: string | unknown;
17172
17369
  token?: string | unknown;
17173
- type: "user" | "application" | "system" | "server";
17174
17370
  user_id?: string | unknown;
17175
17371
  workspace_id?: string | unknown;
17176
17372
  };
@@ -19585,7 +19781,24 @@ type PatchAdminApiKeysByIdData = {
19585
19781
  body?: {
19586
19782
  data: {
19587
19783
  attributes?: {
19784
+ /**
19785
+ * Maximum credits allowed per period (null = unlimited)
19786
+ */
19787
+ credit_limit?: number | unknown;
19788
+ /**
19789
+ * Budget reset period
19790
+ */
19791
+ credit_limit_period?: "daily" | "weekly" | "monthly" | "yearly" | "lifetime" | unknown;
19588
19792
  name?: string | unknown;
19793
+ /**
19794
+ * Rate limit period in seconds
19795
+ */
19796
+ rate_limit_period_seconds?: number | unknown;
19797
+ /**
19798
+ * Maximum requests allowed per period
19799
+ */
19800
+ rate_limit_requests?: number | unknown;
19801
+ scopes?: Array<string> | unknown;
19589
19802
  };
19590
19803
  id: string;
19591
19804
  relationships?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpt-core/admin",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "TypeScript SDK for GPT Core Admin API - Platform administration and ISV management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -42,6 +42,14 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
+ "scripts": {
46
+ "generate": "openapi-ts",
47
+ "build": "tsup src/index.ts --format cjs,esm --dts",
48
+ "test": "vitest run",
49
+ "test:watch": "vitest",
50
+ "test:ui": "vitest --ui",
51
+ "test:coverage": "vitest run --coverage"
52
+ },
45
53
  "dependencies": {
46
54
  "zod": "^3.25.76"
47
55
  },
@@ -53,13 +61,5 @@
53
61
  "tsup": "^8.5.1",
54
62
  "typescript": "^5.9.3",
55
63
  "vitest": "^4.0.15"
56
- },
57
- "scripts": {
58
- "generate": "openapi-ts",
59
- "build": "tsup src/index.ts --format cjs,esm --dts",
60
- "test": "vitest run",
61
- "test:watch": "vitest",
62
- "test:ui": "vitest --ui",
63
- "test:coverage": "vitest run --coverage"
64
64
  }
65
- }
65
+ }