@or-sdk/api-tokens 1.1.0 → 1.1.1-beta.4113.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.
- package/dist/types/types.d.ts +13 -8
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/ApiTokens.ts +1 -1
- package/src/types.ts +17 -9
package/dist/types/types.d.ts
CHANGED
|
@@ -4,18 +4,23 @@ export type ApiTokensConfig = {
|
|
|
4
4
|
apiTokensUrl: string;
|
|
5
5
|
discoveryUrl?: string;
|
|
6
6
|
};
|
|
7
|
+
export type ApiTokenStatus = 'ACTIVE' | 'INACTIVE' | 'REVOKED' | 'EXPIRED';
|
|
8
|
+
export type CreatedByEntityType = 'FLOW' | 'USER' | 'SERVICE';
|
|
9
|
+
export type CreatedBy = {
|
|
10
|
+
entityType: CreatedByEntityType;
|
|
11
|
+
entityId: string;
|
|
12
|
+
};
|
|
7
13
|
export type ApiToken = {
|
|
8
14
|
id: string;
|
|
9
15
|
name: string;
|
|
10
16
|
token: string;
|
|
11
|
-
role: string;
|
|
12
17
|
accountId: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
metadata?: Record<string, unknown
|
|
18
|
+
status: ApiTokenStatus;
|
|
19
|
+
expiresAt?: string | null;
|
|
20
|
+
revokedAt?: string | null;
|
|
21
|
+
metadata?: Record<string, unknown> | null;
|
|
17
22
|
permissions?: string[];
|
|
18
|
-
createdBy?:
|
|
23
|
+
createdBy?: CreatedBy | null;
|
|
19
24
|
createdAt: string;
|
|
20
25
|
updatedAt: string;
|
|
21
26
|
};
|
|
@@ -27,7 +32,7 @@ export type CreateApiTokenDto = {
|
|
|
27
32
|
};
|
|
28
33
|
export type UpdateApiTokenDto = {
|
|
29
34
|
name?: string;
|
|
30
|
-
|
|
35
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
31
36
|
expiresAt?: string | null;
|
|
32
37
|
metadata?: Record<string, unknown>;
|
|
33
38
|
permissions?: string[];
|
|
@@ -38,7 +43,7 @@ export type ValidateApiTokenResponse = {
|
|
|
38
43
|
tokenId?: string;
|
|
39
44
|
expire?: number | null;
|
|
40
45
|
accountId?: string;
|
|
41
|
-
|
|
46
|
+
createdBy?: CreatedBy | null;
|
|
42
47
|
permissions?: string[];
|
|
43
48
|
};
|
|
44
49
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,eAAe,GAAG;IAI5B,KAAK,EAAE,KAAK,CAAC;IAIb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,eAAe,GAAG;IAI5B,KAAK,EAAE,KAAK,CAAC;IAIb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE3E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9D,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/api-tokens",
|
|
3
|
-
"version": "1.1.0",
|
|
3
|
+
"version": "1.1.1-beta.4113.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -26,6 +26,5 @@
|
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
|
-
}
|
|
30
|
-
"gitHead": "ec3215fa15ebe430b6e90d3c0e926db4ced3ac3a"
|
|
29
|
+
}
|
|
31
30
|
}
|
package/src/ApiTokens.ts
CHANGED
|
@@ -97,7 +97,7 @@ export class ApiTokens extends Base {
|
|
|
97
97
|
* @param {string} id - API Token identifier
|
|
98
98
|
* @param {UpdateApiTokenDto} params - Fields to update
|
|
99
99
|
* @param {string} [params.name] - Name of the API token
|
|
100
|
-
* @param {
|
|
100
|
+
* @param {'ACTIVE'|'INACTIVE'} [params.status] - New status (use /revoke for REVOKED)
|
|
101
101
|
* @param {string} [params.expiresAt] - Token expiration date (ISO 8601)
|
|
102
102
|
* @param {Record<string, unknown>} [params.metadata] - Additional metadata
|
|
103
103
|
* @param {string[]} [params.permissions] - Replace all linked permissions
|
package/src/types.ts
CHANGED
|
@@ -12,18 +12,26 @@ export type ApiTokensConfig = {
|
|
|
12
12
|
discoveryUrl?: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
export type ApiTokenStatus = 'ACTIVE' | 'INACTIVE' | 'REVOKED' | 'EXPIRED';
|
|
16
|
+
|
|
17
|
+
export type CreatedByEntityType = 'FLOW' | 'USER' | 'SERVICE';
|
|
18
|
+
|
|
19
|
+
export type CreatedBy = {
|
|
20
|
+
entityType: CreatedByEntityType;
|
|
21
|
+
entityId: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
15
24
|
export type ApiToken = {
|
|
16
25
|
id: string;
|
|
17
26
|
name: string;
|
|
18
27
|
token: string;
|
|
19
|
-
role: string;
|
|
20
28
|
accountId: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
metadata?: Record<string, unknown
|
|
29
|
+
status: ApiTokenStatus;
|
|
30
|
+
expiresAt?: string | null;
|
|
31
|
+
revokedAt?: string | null;
|
|
32
|
+
metadata?: Record<string, unknown> | null;
|
|
25
33
|
permissions?: string[];
|
|
26
|
-
createdBy?:
|
|
34
|
+
createdBy?: CreatedBy | null;
|
|
27
35
|
createdAt: string;
|
|
28
36
|
updatedAt: string;
|
|
29
37
|
};
|
|
@@ -42,8 +50,8 @@ export type CreateApiTokenDto = {
|
|
|
42
50
|
export type UpdateApiTokenDto = {
|
|
43
51
|
/** Name of the API token */
|
|
44
52
|
name?: string;
|
|
45
|
-
/**
|
|
46
|
-
|
|
53
|
+
/** Token status — only ACTIVE/INACTIVE may be set; revoke uses dedicated endpoint */
|
|
54
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
47
55
|
/** Token expiration date (ISO 8601) */
|
|
48
56
|
expiresAt?: string | null;
|
|
49
57
|
/** Additional metadata */
|
|
@@ -58,6 +66,6 @@ export type ValidateApiTokenResponse = {
|
|
|
58
66
|
tokenId?: string;
|
|
59
67
|
expire?: number | null;
|
|
60
68
|
accountId?: string;
|
|
61
|
-
|
|
69
|
+
createdBy?: CreatedBy | null;
|
|
62
70
|
permissions?: string[];
|
|
63
71
|
};
|