anbaric-impl-cloud 1.32.0 → 1.34.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/CloudEntitlements.d.ts +10 -0
- package/dist/CloudEntitlements.d.ts.map +1 -0
- package/dist/CloudEntitlements.js +24 -0
- package/dist/CloudEntitlements.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppAware, Entitlements } from "anbaric-tsapi";
|
|
2
|
+
declare class CloudEntitlements implements Entitlements, AppAware {
|
|
3
|
+
private client;
|
|
4
|
+
constructor(baseUrl?: string);
|
|
5
|
+
getAppId(): string;
|
|
6
|
+
register(_appId: string, entitlementId: string, notes?: string): Promise<void>;
|
|
7
|
+
has(_appId: string, userId: string, entitlementId: string): Promise<boolean>;
|
|
8
|
+
}
|
|
9
|
+
export { CloudEntitlements };
|
|
10
|
+
//# sourceMappingURL=CloudEntitlements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloudEntitlements.d.ts","sourceRoot":"","sources":["../src/CloudEntitlements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAgB,YAAY,EAAC,MAAM,eAAe,CAAC;AAMnE,cAAM,iBAAkB,YAAW,YAAY,EAAE,QAAQ;IAErD,OAAO,CAAC,MAAM,CAAkB;IAEhC,YAAY,OAAO,GAAG,MAAwC,EAE7D;IAED,QAAQ,IAAK,MAAM,CAElB;IAEK,QAAQ,CAAC,MAAM,EAAG,MAAM,EAAE,aAAa,EAAG,MAAM,EAAE,KAAK,GAAG,MAAW,GAAI,OAAO,CAAC,IAAI,CAAC,CAE3F;IAEK,GAAG,CAAC,MAAM,EAAG,MAAM,EAAE,MAAM,EAAG,MAAM,EAAE,aAAa,EAAG,MAAM,GAAI,OAAO,CAAC,OAAO,CAAC,CAIrF;CAEJ;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { currentAppId } from "anbaric-tsapi";
|
|
2
|
+
import { CloudApiClient } from "./CloudApiClient.js";
|
|
3
|
+
/* The app id travels as the ambient app header the client always sends, so
|
|
4
|
+
the platform scopes registrations to the calling app and an app can never
|
|
5
|
+
register or check on behalf of another. */
|
|
6
|
+
class CloudEntitlements {
|
|
7
|
+
client;
|
|
8
|
+
constructor(baseUrl = CloudApiClient.defaultBaseUrl()) {
|
|
9
|
+
this.client = new CloudApiClient(baseUrl);
|
|
10
|
+
}
|
|
11
|
+
getAppId() {
|
|
12
|
+
return currentAppId();
|
|
13
|
+
}
|
|
14
|
+
async register(_appId, entitlementId, notes = "") {
|
|
15
|
+
await this.client.request("POST", "/entitlements", { entitlementId, notes });
|
|
16
|
+
}
|
|
17
|
+
async has(_appId, userId, entitlementId) {
|
|
18
|
+
const path = `/entitlements/${encodeURIComponent(entitlementId)}/check?userId=${encodeURIComponent(userId)}`;
|
|
19
|
+
const result = await this.client.request("GET", path);
|
|
20
|
+
return result.has;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export { CloudEntitlements };
|
|
24
|
+
//# sourceMappingURL=CloudEntitlements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloudEntitlements.js","sourceRoot":"","sources":["../src/CloudEntitlements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAe,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEnD;;6CAE6C;AAC7C,MAAM,iBAAiB;IAEX,MAAM,CAAkB;IAEhC,YAAY,OAAO,GAAY,cAAc,CAAC,cAAc,EAAE;QAC1D,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ;QACJ,OAAO,YAAY,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAAe,EAAE,aAAsB,EAAE,KAAK,GAAY,EAAE;QACvE,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAAe,EAAE,MAAe,EAAE,aAAsB;QAC9D,MAAM,IAAI,GAAG,iBAAiB,kBAAkB,CAAC,aAAa,CAAC,iBAAiB,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7G,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAsB,CAAC;QAC3E,OAAO,MAAM,CAAC,GAAG,CAAC;IACtB,CAAC;CAEJ;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./PushConsumer.js";
|
|
|
2
2
|
export * from "./CloudJobPersistence.js";
|
|
3
3
|
export * from "./CloudJsonStore.js";
|
|
4
4
|
export * from "./CloudSecretStore.js";
|
|
5
|
+
export * from "./CloudEntitlements.js";
|
|
5
6
|
export * from "./CloudQueue.js";
|
|
6
7
|
export * from "./CloudJobRunSchedulePersistence.js";
|
|
7
8
|
export * from "./CloudNotifier.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./PushConsumer.js";
|
|
|
2
2
|
export * from "./CloudJobPersistence.js";
|
|
3
3
|
export * from "./CloudJsonStore.js";
|
|
4
4
|
export * from "./CloudSecretStore.js";
|
|
5
|
+
export * from "./CloudEntitlements.js";
|
|
5
6
|
export * from "./CloudQueue.js";
|
|
6
7
|
export * from "./CloudJobRunSchedulePersistence.js";
|
|
7
8
|
export * from "./CloudNotifier.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anbaric-impl-cloud",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"description": "Public client library for the Anbaric Cloud hosting API, providing JobPersistence and Queue implementations backed by the cloud service",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chris@anbaric.ai",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"prepublishOnly": "npm run build"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"anbaric-tsapi": "^1.
|
|
23
|
+
"anbaric-tsapi": "^1.34.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^26.2.0",
|