@blimu/backend 1.2.0 → 1.2.2
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 +67 -58
- package/dist/client.cjs +164 -14
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.mts +36 -2
- package/dist/client.d.ts +36 -2
- package/dist/client.mjs +161 -11
- package/dist/client.mjs.map +1 -1
- package/dist/index.cjs +530 -236
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +265 -108
- package/dist/index.d.ts +265 -108
- package/dist/index.mjs +518 -226
- package/dist/index.mjs.map +1 -1
- package/dist/{schema-BbKn_i-U.d.mts → schema-CdEZKE7E.d.mts} +162 -39
- package/dist/{schema-BbKn_i-U.d.ts → schema-CdEZKE7E.d.ts} +162 -39
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.mts +2 -1
- package/dist/schema.d.ts +2 -1
- package/dist/services/auth_jwks.cjs +69 -0
- package/dist/services/auth_jwks.cjs.map +1 -0
- package/dist/services/auth_jwks.d.mts +13 -0
- package/dist/services/auth_jwks.d.ts +13 -0
- package/dist/services/auth_jwks.mjs +44 -0
- package/dist/services/auth_jwks.mjs.map +1 -0
- package/dist/services/bulk_resources.cjs +47 -0
- package/dist/services/bulk_resources.cjs.map +1 -0
- package/dist/services/bulk_resources.d.mts +11 -0
- package/dist/services/bulk_resources.d.ts +11 -0
- package/dist/services/bulk_resources.mjs +22 -0
- package/dist/services/bulk_resources.mjs.map +1 -0
- package/dist/services/bulk_roles.cjs +47 -0
- package/dist/services/bulk_roles.cjs.map +1 -0
- package/dist/services/bulk_roles.d.mts +11 -0
- package/dist/services/bulk_roles.d.ts +11 -0
- package/dist/services/bulk_roles.mjs +22 -0
- package/dist/services/bulk_roles.mjs.map +1 -0
- package/dist/services/entitlements.cjs +71 -0
- package/dist/services/entitlements.cjs.map +1 -0
- package/dist/services/entitlements.d.mts +13 -0
- package/dist/services/entitlements.d.ts +13 -0
- package/dist/services/entitlements.mjs +46 -0
- package/dist/services/entitlements.mjs.map +1 -0
- package/dist/services/oauth.cjs +142 -0
- package/dist/services/oauth.cjs.map +1 -0
- package/dist/services/oauth.d.mts +19 -0
- package/dist/services/oauth.d.ts +19 -0
- package/dist/services/oauth.mjs +117 -0
- package/dist/services/oauth.mjs.map +1 -0
- package/dist/services/plans.cjs +69 -0
- package/dist/services/plans.cjs.map +1 -0
- package/dist/services/plans.d.mts +13 -0
- package/dist/services/plans.d.ts +13 -0
- package/dist/services/plans.mjs +44 -0
- package/dist/services/plans.mjs.map +1 -0
- package/dist/services/resource_members.cjs +47 -0
- package/dist/services/resource_members.cjs.map +1 -0
- package/dist/services/resource_members.d.mts +11 -0
- package/dist/services/resource_members.d.ts +11 -0
- package/dist/services/resource_members.mjs +22 -0
- package/dist/services/resource_members.mjs.map +1 -0
- package/dist/services/resources.cjs +93 -0
- package/dist/services/resources.cjs.map +1 -0
- package/dist/services/resources.d.mts +15 -0
- package/dist/services/resources.d.ts +15 -0
- package/dist/services/resources.mjs +68 -0
- package/dist/services/resources.mjs.map +1 -0
- package/dist/services/roles.cjs +70 -0
- package/dist/services/roles.cjs.map +1 -0
- package/dist/services/roles.d.mts +13 -0
- package/dist/services/roles.d.ts +13 -0
- package/dist/services/roles.mjs +45 -0
- package/dist/services/roles.mjs.map +1 -0
- package/dist/services/usage.cjs +95 -0
- package/dist/services/usage.cjs.map +1 -0
- package/dist/services/usage.d.mts +15 -0
- package/dist/services/usage.d.ts +15 -0
- package/dist/services/usage.mjs +70 -0
- package/dist/services/usage.mjs.map +1 -0
- package/dist/services/users.cjs +104 -0
- package/dist/services/users.cjs.map +1 -0
- package/dist/services/users.d.mts +16 -0
- package/dist/services/users.d.ts +16 -0
- package/dist/services/users.mjs +79 -0
- package/dist/services/users.mjs.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/dist/client-B-ZYoU15.d.mts +0 -95
- package/dist/client-GKBT3WCg.d.ts +0 -95
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// src/services/oauth.ts
|
|
2
|
+
var OauthService = class {
|
|
3
|
+
constructor(core) {
|
|
4
|
+
this.core = core;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* GET /v1/oauth/authorize*
|
|
8
|
+
* @summary Check consent requirement*
|
|
9
|
+
* @description Checks if user consent is required for the OAuth2 app and requested scopes.*/
|
|
10
|
+
checkConsentRequired(query, init) {
|
|
11
|
+
return this.core.request({
|
|
12
|
+
method: "GET",
|
|
13
|
+
path: `/v1/oauth/authorize`,
|
|
14
|
+
query,
|
|
15
|
+
...init ?? {}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* POST /v1/oauth/authorize*
|
|
20
|
+
* @summary Authorize OAuth2 application*
|
|
21
|
+
* @description Handles user consent approval/denial. Validates auto_approved flag against consent requirements.*/
|
|
22
|
+
authorize(body, init) {
|
|
23
|
+
return this.core.request({
|
|
24
|
+
method: "POST",
|
|
25
|
+
path: `/v1/oauth/authorize`,
|
|
26
|
+
body,
|
|
27
|
+
...init ?? {}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* POST /v1/oauth/device/authorize*
|
|
32
|
+
* @summary Authorize or deny device code*
|
|
33
|
+
* @description Allows an authenticated user to authorize or deny a device code request. Requires valid user session.*/
|
|
34
|
+
authorizeDeviceCode(body, init) {
|
|
35
|
+
return this.core.request({
|
|
36
|
+
method: "POST",
|
|
37
|
+
path: `/v1/oauth/device/authorize`,
|
|
38
|
+
body,
|
|
39
|
+
...init ?? {}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* POST /v1/oauth/device/code*
|
|
44
|
+
* @summary Request device authorization codes*
|
|
45
|
+
* @description Initiates device authorization flow. Returns device_code (for polling) and user_code (for user entry).*/
|
|
46
|
+
requestDeviceCode(body, init) {
|
|
47
|
+
return this.core.request({
|
|
48
|
+
method: "POST",
|
|
49
|
+
path: `/v1/oauth/device/code`,
|
|
50
|
+
body,
|
|
51
|
+
...init ?? {}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* GET /v1/oauth/device/code/{user_code}*
|
|
56
|
+
* @summary Get device code information*
|
|
57
|
+
* @description Returns device code information including app name, scopes, and consent requirement status.*/
|
|
58
|
+
getDeviceCodeInfo(user_code, init) {
|
|
59
|
+
return this.core.request({
|
|
60
|
+
method: "GET",
|
|
61
|
+
path: `/v1/oauth/device/code/${encodeURIComponent(user_code)}`,
|
|
62
|
+
...init ?? {}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* POST /v1/oauth/device/token*
|
|
67
|
+
* @summary Poll for device authorization tokens*
|
|
68
|
+
* @description Client polls this endpoint to exchange device_code for tokens once user has authorized.*/
|
|
69
|
+
exchangeDeviceCode(body, init) {
|
|
70
|
+
return this.core.request({
|
|
71
|
+
method: "POST",
|
|
72
|
+
path: `/v1/oauth/device/token`,
|
|
73
|
+
body,
|
|
74
|
+
...init ?? {}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* POST /v1/oauth/introspect*
|
|
79
|
+
* @summary Introspect token*
|
|
80
|
+
* @description Validates a token and returns metadata. Requires client authentication.*/
|
|
81
|
+
introspect(body, init) {
|
|
82
|
+
return this.core.request({
|
|
83
|
+
method: "POST",
|
|
84
|
+
path: `/v1/oauth/introspect`,
|
|
85
|
+
body,
|
|
86
|
+
...init ?? {}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* POST /v1/oauth/revoke*
|
|
91
|
+
* @summary Revoke token*
|
|
92
|
+
* @description Revokes an access or refresh token. Requires client authentication.*/
|
|
93
|
+
revoke(body, init) {
|
|
94
|
+
return this.core.request({
|
|
95
|
+
method: "POST",
|
|
96
|
+
path: `/v1/oauth/revoke`,
|
|
97
|
+
body,
|
|
98
|
+
...init ?? {}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* POST /v1/oauth/token*
|
|
103
|
+
* @summary Token endpoint*
|
|
104
|
+
* @description Issues access and refresh tokens. Supports authorization_code and refresh_token (always available per OAuth2 spec).*/
|
|
105
|
+
token(body, init) {
|
|
106
|
+
return this.core.request({
|
|
107
|
+
method: "POST",
|
|
108
|
+
path: `/v1/oauth/token`,
|
|
109
|
+
body,
|
|
110
|
+
...init ?? {}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
export {
|
|
115
|
+
OauthService
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=oauth.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/oauth.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class OauthService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/oauth/authorize*\n * @summary Check consent requirement*\n * @description Checks if user consent is required for the OAuth2 app and requested scopes.*/\n checkConsentRequired(\n query?: Schema.OauthCheckConsentRequiredQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ConsentCheckResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/authorize`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/authorize*\n * @summary Authorize OAuth2 application*\n * @description Handles user consent approval/denial. Validates auto_approved flag against consent requirements.*/\n authorize(\n body: Schema.AuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/authorize*\n * @summary Authorize or deny device code*\n * @description Allows an authenticated user to authorize or deny a device code request. Requires valid user session.*/\n authorizeDeviceCode(\n body: Schema.DeviceAuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceAuthorizeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/code*\n * @summary Request device authorization codes*\n * @description Initiates device authorization flow. Returns device_code (for polling) and user_code (for user entry).*/\n requestDeviceCode(\n body: Schema.DeviceCodeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/code`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/oauth/device/code/{user_code}*\n * @summary Get device code information*\n * @description Returns device code information including app name, scopes, and consent requirement status.*/\n getDeviceCodeInfo(\n user_code: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeInfoResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/device/code/${encodeURIComponent(user_code)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/token*\n * @summary Poll for device authorization tokens*\n * @description Client polls this endpoint to exchange device_code for tokens once user has authorized.*/\n exchangeDeviceCode(\n body: Schema.DeviceTokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/token`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/introspect*\n * @summary Introspect token*\n * @description Validates a token and returns metadata. Requires client authentication.*/\n introspect(\n body: Schema.IntrospectionRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.IntrospectionResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/introspect`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/revoke*\n * @summary Revoke token*\n * @description Revokes an access or refresh token. Requires client authentication.*/\n revoke(\n body: Schema.RevocationRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/revoke`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/token*\n * @summary Token endpoint*\n * @description Issues access and refresh tokens. Supports authorization_code and refresh_token (always available per OAuth2 spec).*/\n token(\n body: Schema.TokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/token`,\n body,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAGO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,qBACE,OACA,MACsC;AACtC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UACE,MACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,oBACE,MACA,MACyC;AACzC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBACE,MACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBACE,WACA,MACwC;AACxC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,yBAAyB,mBAAmB,SAAS,CAAC;AAAA,MAC5D,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,mBACE,MACA,MAC+B;AAC/B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WACE,MACA,MACuC;AACvC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,MACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MACE,MACA,MAC+B;AAC/B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
|
|
20
|
+
// src/services/plans.ts
|
|
21
|
+
var plans_exports = {};
|
|
22
|
+
__export(plans_exports, {
|
|
23
|
+
PlansService: () => PlansService
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(plans_exports);
|
|
26
|
+
var PlansService = class {
|
|
27
|
+
constructor(core) {
|
|
28
|
+
this.core = core;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* DELETE /v1/resources/{resourceType}/{resourceId}/plan*
|
|
32
|
+
* @summary Remove plan assignment from a tenant resource*
|
|
33
|
+
* @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/
|
|
34
|
+
delete(resourceType, resourceId, init) {
|
|
35
|
+
return this.core.request({
|
|
36
|
+
method: "DELETE",
|
|
37
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
|
|
38
|
+
...init ?? {}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* GET /v1/resources/{resourceType}/{resourceId}/plan*
|
|
43
|
+
* @summary Get the plan assigned to a tenant resource*
|
|
44
|
+
* @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/
|
|
45
|
+
read(resourceType, resourceId, init) {
|
|
46
|
+
return this.core.request({
|
|
47
|
+
method: "GET",
|
|
48
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
|
|
49
|
+
...init ?? {}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* POST /v1/resources/{resourceType}/{resourceId}/plan*
|
|
54
|
+
* @summary Assign a plan to a tenant resource*
|
|
55
|
+
* @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/
|
|
56
|
+
assign(resourceType, resourceId, body, init) {
|
|
57
|
+
return this.core.request({
|
|
58
|
+
method: "POST",
|
|
59
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
|
|
60
|
+
body,
|
|
61
|
+
...init ?? {}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
PlansService
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=plans.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/plans.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class PlansService {\n constructor(private core: FetchClient) {}\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Remove plan assignment from a tenant resource*\n * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanDeleteResponse> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Get the plan assigned to a tenant resource*\n * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Assign a plan to a tenant resource*\n * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/\n assign(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.PlanAssignBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n body,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,OACE,cACA,YACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KACE,cACA,YACA,MAC8B;AAC9B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,YACA,MACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FetchClient } from '@blimu/fetch';
|
|
2
|
+
import { P as PlanDeleteResponse, q as PlanResponse, r as PlanAssignBody } from '../schema-CdEZKE7E.mjs';
|
|
3
|
+
import { ResourceType } from '@blimu/types';
|
|
4
|
+
|
|
5
|
+
declare class PlansService {
|
|
6
|
+
private core;
|
|
7
|
+
constructor(core: FetchClient);
|
|
8
|
+
delete(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<PlanDeleteResponse>;
|
|
9
|
+
read(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<PlanResponse>;
|
|
10
|
+
assign(resourceType: ResourceType, resourceId: string, body: PlanAssignBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { PlansService };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FetchClient } from '@blimu/fetch';
|
|
2
|
+
import { P as PlanDeleteResponse, q as PlanResponse, r as PlanAssignBody } from '../schema-CdEZKE7E.js';
|
|
3
|
+
import { ResourceType } from '@blimu/types';
|
|
4
|
+
|
|
5
|
+
declare class PlansService {
|
|
6
|
+
private core;
|
|
7
|
+
constructor(core: FetchClient);
|
|
8
|
+
delete(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<PlanDeleteResponse>;
|
|
9
|
+
read(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<PlanResponse>;
|
|
10
|
+
assign(resourceType: ResourceType, resourceId: string, body: PlanAssignBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { PlansService };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/services/plans.ts
|
|
2
|
+
var PlansService = class {
|
|
3
|
+
constructor(core) {
|
|
4
|
+
this.core = core;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* DELETE /v1/resources/{resourceType}/{resourceId}/plan*
|
|
8
|
+
* @summary Remove plan assignment from a tenant resource*
|
|
9
|
+
* @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/
|
|
10
|
+
delete(resourceType, resourceId, init) {
|
|
11
|
+
return this.core.request({
|
|
12
|
+
method: "DELETE",
|
|
13
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
|
|
14
|
+
...init ?? {}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* GET /v1/resources/{resourceType}/{resourceId}/plan*
|
|
19
|
+
* @summary Get the plan assigned to a tenant resource*
|
|
20
|
+
* @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/
|
|
21
|
+
read(resourceType, resourceId, init) {
|
|
22
|
+
return this.core.request({
|
|
23
|
+
method: "GET",
|
|
24
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
|
|
25
|
+
...init ?? {}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* POST /v1/resources/{resourceType}/{resourceId}/plan*
|
|
30
|
+
* @summary Assign a plan to a tenant resource*
|
|
31
|
+
* @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/
|
|
32
|
+
assign(resourceType, resourceId, body, init) {
|
|
33
|
+
return this.core.request({
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,
|
|
36
|
+
body,
|
|
37
|
+
...init ?? {}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
PlansService
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=plans.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/plans.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class PlansService {\n constructor(private core: FetchClient) {}\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Remove plan assignment from a tenant resource*\n * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanDeleteResponse> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Get the plan assigned to a tenant resource*\n * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Assign a plan to a tenant resource*\n * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/\n assign(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.PlanAssignBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n body,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAIO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,OACE,cACA,YACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KACE,cACA,YACA,MAC8B;AAC9B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,YACA,MACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
|
|
20
|
+
// src/services/resource_members.ts
|
|
21
|
+
var resource_members_exports = {};
|
|
22
|
+
__export(resource_members_exports, {
|
|
23
|
+
ResourceMembersService: () => ResourceMembersService
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(resource_members_exports);
|
|
26
|
+
var ResourceMembersService = class {
|
|
27
|
+
constructor(core) {
|
|
28
|
+
this.core = core;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* GET /v1/resources/{resourceType}/{resourceId}/members*
|
|
32
|
+
* @summary List members for a resource*
|
|
33
|
+
* @description Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/
|
|
34
|
+
list(resourceType, resourceId, query, init) {
|
|
35
|
+
return this.core.request({
|
|
36
|
+
method: "GET",
|
|
37
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/members`,
|
|
38
|
+
query,
|
|
39
|
+
...init ?? {}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
ResourceMembersService
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=resource_members.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/resource_members.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourceMembersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/members*\n * @summary List members for a resource*\n * @description Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/\n list(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.ResourceMembersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceMemberList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/members`,\n query,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,yBAAN,MAA6B;AAAA,EAClC,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,KACE,cACA,YACA,OACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FetchClient } from '@blimu/fetch';
|
|
2
|
+
import { t as ResourceMembersListQuery, u as ResourceMemberList } from '../schema-CdEZKE7E.mjs';
|
|
3
|
+
import { ResourceType } from '@blimu/types';
|
|
4
|
+
|
|
5
|
+
declare class ResourceMembersService {
|
|
6
|
+
private core;
|
|
7
|
+
constructor(core: FetchClient);
|
|
8
|
+
list(resourceType: ResourceType, resourceId: string, query?: ResourceMembersListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<ResourceMemberList>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { ResourceMembersService };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FetchClient } from '@blimu/fetch';
|
|
2
|
+
import { t as ResourceMembersListQuery, u as ResourceMemberList } from '../schema-CdEZKE7E.js';
|
|
3
|
+
import { ResourceType } from '@blimu/types';
|
|
4
|
+
|
|
5
|
+
declare class ResourceMembersService {
|
|
6
|
+
private core;
|
|
7
|
+
constructor(core: FetchClient);
|
|
8
|
+
list(resourceType: ResourceType, resourceId: string, query?: ResourceMembersListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<ResourceMemberList>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { ResourceMembersService };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/services/resource_members.ts
|
|
2
|
+
var ResourceMembersService = class {
|
|
3
|
+
constructor(core) {
|
|
4
|
+
this.core = core;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* GET /v1/resources/{resourceType}/{resourceId}/members*
|
|
8
|
+
* @summary List members for a resource*
|
|
9
|
+
* @description Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/
|
|
10
|
+
list(resourceType, resourceId, query, init) {
|
|
11
|
+
return this.core.request({
|
|
12
|
+
method: "GET",
|
|
13
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/members`,
|
|
14
|
+
query,
|
|
15
|
+
...init ?? {}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
ResourceMembersService
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=resource_members.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/resource_members.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourceMembersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/members*\n * @summary List members for a resource*\n * @description Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/\n list(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.ResourceMembersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceMemberList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/members`,\n query,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAIO,IAAM,yBAAN,MAA6B;AAAA,EAClC,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,KACE,cACA,YACA,OACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
|
|
20
|
+
// src/services/resources.ts
|
|
21
|
+
var resources_exports = {};
|
|
22
|
+
__export(resources_exports, {
|
|
23
|
+
ResourcesService: () => ResourcesService
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(resources_exports);
|
|
26
|
+
var ResourcesService = class {
|
|
27
|
+
constructor(core) {
|
|
28
|
+
this.core = core;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* GET /v1/resources/{resourceType}*
|
|
32
|
+
* @summary List resources*
|
|
33
|
+
* @description Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/
|
|
34
|
+
list(resourceType, query, init) {
|
|
35
|
+
return this.core.request({
|
|
36
|
+
method: "GET",
|
|
37
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}`,
|
|
38
|
+
query,
|
|
39
|
+
...init ?? {}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* POST /v1/resources/{resourceType}*
|
|
44
|
+
* @summary Create a resource*
|
|
45
|
+
* @description Creates a new resource of the specified type. Resources can have parent relationships to form hierarchies. You can optionally assign initial roles to users when creating the resource. Parent resources must already exist.*/
|
|
46
|
+
create(resourceType, body, init) {
|
|
47
|
+
return this.core.request({
|
|
48
|
+
method: "POST",
|
|
49
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}`,
|
|
50
|
+
body,
|
|
51
|
+
...init ?? {}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* DELETE /v1/resources/{resourceType}/{resourceId}*
|
|
56
|
+
* @summary Delete a resource*
|
|
57
|
+
* @description Deletes a resource by its type and ID. This operation is permanent and cannot be undone. Deleting a resource may affect child resources that depend on it.*/
|
|
58
|
+
delete(resourceType, resourceId, init) {
|
|
59
|
+
return this.core.request({
|
|
60
|
+
method: "DELETE",
|
|
61
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
|
|
62
|
+
...init ?? {}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* GET /v1/resources/{resourceType}/{resourceId}*
|
|
67
|
+
* @summary Read a resource*
|
|
68
|
+
* @description Retrieves a single resource by its type and ID. Returns the resource with its parent relationships and metadata.*/
|
|
69
|
+
read(resourceType, resourceId, init) {
|
|
70
|
+
return this.core.request({
|
|
71
|
+
method: "GET",
|
|
72
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
|
|
73
|
+
...init ?? {}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* PUT /v1/resources/{resourceType}/{resourceId}*
|
|
78
|
+
* @summary Update a resource*
|
|
79
|
+
* @description Updates an existing resource. You can update the resource name and modify parent relationships. Parent resources must already exist.*/
|
|
80
|
+
update(resourceType, resourceId, body, init) {
|
|
81
|
+
return this.core.request({
|
|
82
|
+
method: "PUT",
|
|
83
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
|
|
84
|
+
body,
|
|
85
|
+
...init ?? {}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
+
0 && (module.exports = {
|
|
91
|
+
ResourcesService
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=resources.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/resources.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}*\n * @summary List resources*\n * @description Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/\n list(\n resourceType: ResourceType,\n query?: Schema.ResourcesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}*\n * @summary Create a resource*\n * @description Creates a new resource of the specified type. Resources can have parent relationships to form hierarchies. You can optionally assign initial roles to users when creating the resource. Parent resources must already exist.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}*\n * @summary Delete a resource*\n * @description Deletes a resource by its type and ID. This operation is permanent and cannot be undone. Deleting a resource may affect child resources that depend on it.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}*\n * @summary Read a resource*\n * @description Retrieves a single resource by its type and ID. Returns the resource with its parent relationships and metadata.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/resources/{resourceType}/{resourceId}*\n * @summary Update a resource*\n * @description Updates an existing resource. You can update the resource name and modify parent relationships. Parent resources must already exist.*/\n update(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.ResourceUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n body,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,KACE,cACA,OACA,MAC8B;AAC9B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC;AAAA,MACvD;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,MACA,MAC0B;AAC1B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC;AAAA,MACvD;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,YACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KACE,cACA,YACA,MAC0B;AAC1B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,YACA,MACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FetchClient } from '@blimu/fetch';
|
|
2
|
+
import { v as ResourcesListQuery, w as ResourceList, x as ResourceCreateBody, y as Resource, z as ResourceUpdateBody } from '../schema-CdEZKE7E.mjs';
|
|
3
|
+
import { ResourceType } from '@blimu/types';
|
|
4
|
+
|
|
5
|
+
declare class ResourcesService {
|
|
6
|
+
private core;
|
|
7
|
+
constructor(core: FetchClient);
|
|
8
|
+
list(resourceType: ResourceType, query?: ResourcesListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<ResourceList>;
|
|
9
|
+
create(resourceType: ResourceType, body: ResourceCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Resource>;
|
|
10
|
+
delete(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
|
|
11
|
+
read(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Resource>;
|
|
12
|
+
update(resourceType: ResourceType, resourceId: string, body: ResourceUpdateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { ResourcesService };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FetchClient } from '@blimu/fetch';
|
|
2
|
+
import { v as ResourcesListQuery, w as ResourceList, x as ResourceCreateBody, y as Resource, z as ResourceUpdateBody } from '../schema-CdEZKE7E.js';
|
|
3
|
+
import { ResourceType } from '@blimu/types';
|
|
4
|
+
|
|
5
|
+
declare class ResourcesService {
|
|
6
|
+
private core;
|
|
7
|
+
constructor(core: FetchClient);
|
|
8
|
+
list(resourceType: ResourceType, query?: ResourcesListQuery, init?: Omit<RequestInit, 'method' | 'body'>): Promise<ResourceList>;
|
|
9
|
+
create(resourceType: ResourceType, body: ResourceCreateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Resource>;
|
|
10
|
+
delete(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
|
|
11
|
+
read(resourceType: ResourceType, resourceId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Resource>;
|
|
12
|
+
update(resourceType: ResourceType, resourceId: string, body: ResourceUpdateBody, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { ResourcesService };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// src/services/resources.ts
|
|
2
|
+
var ResourcesService = class {
|
|
3
|
+
constructor(core) {
|
|
4
|
+
this.core = core;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* GET /v1/resources/{resourceType}*
|
|
8
|
+
* @summary List resources*
|
|
9
|
+
* @description Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/
|
|
10
|
+
list(resourceType, query, init) {
|
|
11
|
+
return this.core.request({
|
|
12
|
+
method: "GET",
|
|
13
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}`,
|
|
14
|
+
query,
|
|
15
|
+
...init ?? {}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* POST /v1/resources/{resourceType}*
|
|
20
|
+
* @summary Create a resource*
|
|
21
|
+
* @description Creates a new resource of the specified type. Resources can have parent relationships to form hierarchies. You can optionally assign initial roles to users when creating the resource. Parent resources must already exist.*/
|
|
22
|
+
create(resourceType, body, init) {
|
|
23
|
+
return this.core.request({
|
|
24
|
+
method: "POST",
|
|
25
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}`,
|
|
26
|
+
body,
|
|
27
|
+
...init ?? {}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* DELETE /v1/resources/{resourceType}/{resourceId}*
|
|
32
|
+
* @summary Delete a resource*
|
|
33
|
+
* @description Deletes a resource by its type and ID. This operation is permanent and cannot be undone. Deleting a resource may affect child resources that depend on it.*/
|
|
34
|
+
delete(resourceType, resourceId, init) {
|
|
35
|
+
return this.core.request({
|
|
36
|
+
method: "DELETE",
|
|
37
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
|
|
38
|
+
...init ?? {}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* GET /v1/resources/{resourceType}/{resourceId}*
|
|
43
|
+
* @summary Read a resource*
|
|
44
|
+
* @description Retrieves a single resource by its type and ID. Returns the resource with its parent relationships and metadata.*/
|
|
45
|
+
read(resourceType, resourceId, init) {
|
|
46
|
+
return this.core.request({
|
|
47
|
+
method: "GET",
|
|
48
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
|
|
49
|
+
...init ?? {}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* PUT /v1/resources/{resourceType}/{resourceId}*
|
|
54
|
+
* @summary Update a resource*
|
|
55
|
+
* @description Updates an existing resource. You can update the resource name and modify parent relationships. Parent resources must already exist.*/
|
|
56
|
+
update(resourceType, resourceId, body, init) {
|
|
57
|
+
return this.core.request({
|
|
58
|
+
method: "PUT",
|
|
59
|
+
path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,
|
|
60
|
+
body,
|
|
61
|
+
...init ?? {}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
ResourcesService
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=resources.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/resources.ts"],"sourcesContent":["import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}*\n * @summary List resources*\n * @description Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/\n list(\n resourceType: ResourceType,\n query?: Schema.ResourcesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}*\n * @summary Create a resource*\n * @description Creates a new resource of the specified type. Resources can have parent relationships to form hierarchies. You can optionally assign initial roles to users when creating the resource. Parent resources must already exist.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}*\n * @summary Delete a resource*\n * @description Deletes a resource by its type and ID. This operation is permanent and cannot be undone. Deleting a resource may affect child resources that depend on it.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}*\n * @summary Read a resource*\n * @description Retrieves a single resource by its type and ID. Returns the resource with its parent relationships and metadata.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/resources/{resourceType}/{resourceId}*\n * @summary Update a resource*\n * @description Updates an existing resource. You can update the resource name and modify parent relationships. Parent resources must already exist.*/\n update(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.ResourceUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n body,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAIO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,KACE,cACA,OACA,MAC8B;AAC9B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC;AAAA,MACvD;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,MACA,MAC0B;AAC1B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC;AAAA,MACvD;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,YACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KACE,cACA,YACA,MAC0B;AAC1B,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OACE,cACA,YACA,MACA,MACkB;AAClB,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC,IAAI,mBAAmB,UAAU,CAAC;AAAA,MACzF;AAAA,MACA,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;","names":[]}
|