@schemavaults/app-definitions 0.6.20 → 0.6.21
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/hardcoded-app-to-api-permissions.d.ts +2 -0
- package/dist/hardcoded-app-to-api-permissions.js +13 -0
- package/dist/hardcoded-app-to-api-permissions.js.map +1 -1
- package/dist/index.cjs +16 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,3 +4,5 @@ import type { HardcodedApiServerId } from "./hardcoded-core-schemavaults-api-ser
|
|
|
4
4
|
export declare function hasHardcodedAppToApiPermission(client_app_id: HardcodedAppId, api_server_id: HardcodedApiServerId): boolean;
|
|
5
5
|
/** Get all hardcoded API server IDs that a hardcoded app has permission to access */
|
|
6
6
|
export declare function getHardcodedApiServerIdsForHardcodedApp(client_app_id: HardcodedAppId): HardcodedApiServerId[];
|
|
7
|
+
/** Get all hardcoded app IDs that have permission to access a specific hardcoded API server */
|
|
8
|
+
export declare function getHardcodedAppIdsForHardcodedApiServer(api_server_id: HardcodedApiServerId): HardcodedAppId[];
|
|
@@ -35,4 +35,17 @@ export function getHardcodedApiServerIdsForHardcodedApp(client_app_id) {
|
|
|
35
35
|
}
|
|
36
36
|
return HARDCODED_APP_TO_API_PERMISSIONS[client_app_id] ?? [];
|
|
37
37
|
}
|
|
38
|
+
/** Get all hardcoded app IDs that have permission to access a specific hardcoded API server */
|
|
39
|
+
export function getHardcodedAppIdsForHardcodedApiServer(api_server_id) {
|
|
40
|
+
if (!isHardcodedApiServerId(api_server_id)) {
|
|
41
|
+
throw new TypeError("getHardcodedAppIdsForHardcodedApiServer received non-hardcoded API server ID!");
|
|
42
|
+
}
|
|
43
|
+
const result = [];
|
|
44
|
+
for (const [appId, apiServerIds] of Object.entries(HARDCODED_APP_TO_API_PERMISSIONS)) {
|
|
45
|
+
if (apiServerIds.includes(api_server_id)) {
|
|
46
|
+
result.push(appId);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
38
51
|
//# sourceMappingURL=hardcoded-app-to-api-permissions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardcoded-app-to-api-permissions.js","sourceRoot":"","sources":["../src/hardcoded-app-to-api-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gCAAgC,EAChC,gBAAgB,GACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGtE,uEAAuE;AACvE,MAAM,gCAAgC,GAGlC;IACF,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACzB,4BAA4B,CAAC,aAAa;QAC1C,wBAAwB,CAAC,aAAa;KACvC;IACD,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACzB,4BAA4B,CAAC,aAAa;QAC1C,wBAAwB,CAAC,aAAa;KACvC;IACD,CAAC,gCAAgC,CAAC,MAAM,CAAC,EAAE;QACzC,wBAAwB,CAAC,aAAa;KACvC;IACD,CAAC,gCAAgC,CAAC,MAAM,CAAC,EAAE,EAAE;CAC9C,CAAC;AAEF,8EAA8E;AAC9E,MAAM,UAAU,8BAA8B,CAC5C,aAA6B,EAC7B,aAAmC;IAEnC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CACjB,sEAAsE,CACvE,CAAC;IACJ,CAAC;SAAM,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,SAAS,CACjB,sEAAsE,CACvE,CAAC;IACJ,CAAC;IAED,OAAO,CACL,gCAAgC,CAAC,aAAa,CAAC,CAAC,QAAQ,CACtD,aAAqC,CACtC,IAAI,KAAK,CACX,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,uCAAuC,CACrD,aAA6B;IAE7B,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CACjB,sEAAsE,CACvE,CAAC;IACJ,CAAC;IAED,OAAO,gCAAgC,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;AAC/D,CAAC"}
|
|
1
|
+
{"version":3,"file":"hardcoded-app-to-api-permissions.js","sourceRoot":"","sources":["../src/hardcoded-app-to-api-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gCAAgC,EAChC,gBAAgB,GACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGtE,uEAAuE;AACvE,MAAM,gCAAgC,GAGlC;IACF,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACzB,4BAA4B,CAAC,aAAa;QAC1C,wBAAwB,CAAC,aAAa;KACvC;IACD,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACzB,4BAA4B,CAAC,aAAa;QAC1C,wBAAwB,CAAC,aAAa;KACvC;IACD,CAAC,gCAAgC,CAAC,MAAM,CAAC,EAAE;QACzC,wBAAwB,CAAC,aAAa;KACvC;IACD,CAAC,gCAAgC,CAAC,MAAM,CAAC,EAAE,EAAE;CAC9C,CAAC;AAEF,8EAA8E;AAC9E,MAAM,UAAU,8BAA8B,CAC5C,aAA6B,EAC7B,aAAmC;IAEnC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CACjB,sEAAsE,CACvE,CAAC;IACJ,CAAC;SAAM,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,SAAS,CACjB,sEAAsE,CACvE,CAAC;IACJ,CAAC;IAED,OAAO,CACL,gCAAgC,CAAC,aAAa,CAAC,CAAC,QAAQ,CACtD,aAAqC,CACtC,IAAI,KAAK,CACX,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,uCAAuC,CACrD,aAA6B;IAE7B,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CACjB,sEAAsE,CACvE,CAAC;IACJ,CAAC;IAED,OAAO,gCAAgC,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;AAC/D,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,uCAAuC,CACrD,aAAmC;IAEnC,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,SAAS,CACjB,+EAA+E,CAChF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAqB,EAAE,CAAC;IACpC,KAAK,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gCAAgC,CAAC,EAAE,CAAC;QACrF,IAAI,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,KAAuB,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -71,6 +71,7 @@ __export(src_exports, {
|
|
|
71
71
|
getHardcodedApiServerDomain: () => getHardcodedApiServerDomain,
|
|
72
72
|
getHardcodedApiServerIdsForHardcodedApp: () => getHardcodedApiServerIdsForHardcodedApp,
|
|
73
73
|
getHardcodedApp: () => getHardcodedApp,
|
|
74
|
+
getHardcodedAppIdsForHardcodedApiServer: () => getHardcodedAppIdsForHardcodedApiServer,
|
|
74
75
|
getHardcodedClientWebAppDomain: () => getHardcodedClientWebAppDomain,
|
|
75
76
|
hardcodedApiServerIdSchema: () => hardcodedApiServerIdSchema,
|
|
76
77
|
hardcodedAppIdSchema: () => hardcodedAppIdSchema,
|
|
@@ -4907,6 +4908,20 @@ function getHardcodedApiServerIdsForHardcodedApp(client_app_id) {
|
|
|
4907
4908
|
}
|
|
4908
4909
|
return HARDCODED_APP_TO_API_PERMISSIONS[client_app_id] ?? [];
|
|
4909
4910
|
}
|
|
4911
|
+
function getHardcodedAppIdsForHardcodedApiServer(api_server_id) {
|
|
4912
|
+
if (!isHardcodedApiServerId(api_server_id)) {
|
|
4913
|
+
throw new TypeError(
|
|
4914
|
+
"getHardcodedAppIdsForHardcodedApiServer received non-hardcoded API server ID!"
|
|
4915
|
+
);
|
|
4916
|
+
}
|
|
4917
|
+
const result = [];
|
|
4918
|
+
for (const [appId, apiServerIds] of Object.entries(HARDCODED_APP_TO_API_PERMISSIONS)) {
|
|
4919
|
+
if (apiServerIds.includes(api_server_id)) {
|
|
4920
|
+
result.push(appId);
|
|
4921
|
+
}
|
|
4922
|
+
}
|
|
4923
|
+
return result;
|
|
4924
|
+
}
|
|
4910
4925
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4911
4926
|
0 && (module.exports = {
|
|
4912
4927
|
HARDCODED_CORE_SCHEMAVAULTS_API_SERVERS,
|
|
@@ -4960,6 +4975,7 @@ function getHardcodedApiServerIdsForHardcodedApp(client_app_id) {
|
|
|
4960
4975
|
getHardcodedApiServerDomain,
|
|
4961
4976
|
getHardcodedApiServerIdsForHardcodedApp,
|
|
4962
4977
|
getHardcodedApp,
|
|
4978
|
+
getHardcodedAppIdsForHardcodedApiServer,
|
|
4963
4979
|
getHardcodedClientWebAppDomain,
|
|
4964
4980
|
hardcodedApiServerIdSchema,
|
|
4965
4981
|
hardcodedAppIdSchema,
|
package/dist/index.d.ts
CHANGED
|
@@ -28,4 +28,4 @@ export type { SchemaVaultsAppEnvironment } from "./app-environments";
|
|
|
28
28
|
export { getAppEnvironment } from "./get-app-environment";
|
|
29
29
|
export { getAuthServerUri } from "./get-auth-server-uri";
|
|
30
30
|
export { SCHEMAVAULTS_AUTH_APP_ID } from "./SCHEMAVAULTS_AUTH_APP_ID";
|
|
31
|
-
export { hasHardcodedAppToApiPermission, getHardcodedApiServerIdsForHardcodedApp, } from "./hardcoded-app-to-api-permissions";
|
|
31
|
+
export { hasHardcodedAppToApiPermission, getHardcodedApiServerIdsForHardcodedApp, getHardcodedAppIdsForHardcodedApiServer, } from "./hardcoded-app-to-api-permissions";
|
package/dist/index.js
CHANGED
|
@@ -16,5 +16,5 @@ export { schemaVaultsAppEnvironments, schemaVaultsAppEnvironmentSchema, } from "
|
|
|
16
16
|
export { getAppEnvironment } from "./get-app-environment";
|
|
17
17
|
export { getAuthServerUri } from "./get-auth-server-uri";
|
|
18
18
|
export { SCHEMAVAULTS_AUTH_APP_ID } from "./SCHEMAVAULTS_AUTH_APP_ID";
|
|
19
|
-
export { hasHardcodedAppToApiPermission, getHardcodedApiServerIdsForHardcodedApp, } from "./hardcoded-app-to-api-permissions";
|
|
19
|
+
export { hasHardcodedAppToApiPermission, getHardcodedApiServerIdsForHardcodedApp, getHardcodedAppIdsForHardcodedApiServer, } from "./hardcoded-app-to-api-permissions";
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AAGjC,cAAc,mCAAmC,CAAC;AAGlD,cAAc,i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