@base44-preview/platform 0.1.0-pr.319.850fe58 → 0.1.0-pr.319.cf89f7f
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
CHANGED
|
@@ -46,9 +46,9 @@ activation challenge and picks the status code: 400 for a delivery that fails ve
|
|
|
46
46
|
including for event types you have no handler for.
|
|
47
47
|
|
|
48
48
|
```ts
|
|
49
|
-
import {
|
|
49
|
+
import { createBase44PlatformServer } from "@base44/platform/server";
|
|
50
50
|
|
|
51
|
-
const platform =
|
|
51
|
+
const platform = createBase44PlatformServer({
|
|
52
52
|
serverUrl: "https://base44.app",
|
|
53
53
|
apiKey: process.env.BASE44_API_KEY!,
|
|
54
54
|
webhooks: { publicKeys: process.env.BASE44_WEBHOOK_PUBLIC_KEYS },
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Server platform modules, authenticated with a workspace API key. */
|
|
2
|
-
export {
|
|
2
|
+
export { createBase44PlatformServer } from "./server.js";
|
|
3
3
|
export { WebhookConfigurationError, WebhookVerificationError } from "./errors.js";
|
|
4
4
|
export type { WebhookConfigurationErrorCode, WebhookVerificationErrorCode } from "./errors.types.js";
|
|
5
|
-
export type { PlatformServerOptions } from "./server.types.js";
|
|
5
|
+
export type { Base44PlatformServer, PlatformServerOptions } from "./server.types.js";
|
|
6
6
|
export type { AppCreatedV1Data, AppDeletedV1Data, AppPublishedV1Data, AppRestoredV1Data, AppUnpublishedV1Data, CloudEvent, CreateHandlerOptions, DeliveredWebhookEvent, VerifyEventOptions, WebhookEventHandlers, WebhookEvent, WebhookEventMap, WebhookEventType, WebhookHeaders, WebhookPublicKeys, WebhooksModule, WebhooksOptions, WebhookTestV1Data, } from "./modules/webhooks.types.js";
|
package/dist/server/index.js
CHANGED
|
@@ -42,7 +42,7 @@ export type WebhookEvent = {
|
|
|
42
42
|
export type WebhookHeaders = Headers | Record<string, string | string[] | undefined>;
|
|
43
43
|
/** One Ed25519 public key (`whpk_…`), or several separated by commas or whitespace. */
|
|
44
44
|
export type WebhookPublicKeys = string | string[];
|
|
45
|
-
/** Webhook settings for
|
|
45
|
+
/** Webhook settings for `createBase44PlatformServer`. */
|
|
46
46
|
export interface WebhooksOptions {
|
|
47
47
|
/** Public keys of your workspace. Pass more than one while a key rotation is in progress. */
|
|
48
48
|
publicKeys?: WebhookPublicKeys;
|
package/dist/server/server.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare class Base44PlatformServer {
|
|
5
|
-
#private;
|
|
6
|
-
/** Verify Base44 outbound webhooks and answer the activation challenge. */
|
|
7
|
-
readonly webhooks: WebhooksModule;
|
|
8
|
-
/** Configure shared service/auth settings; modules are added on top of this. */
|
|
9
|
-
constructor(options: PlatformServerOptions);
|
|
10
|
-
}
|
|
1
|
+
import type { Base44PlatformServer, PlatformServerOptions } from "./server.types.js";
|
|
2
|
+
/** Create a server platform client, authenticated with a workspace API key. Performs no network requests. */
|
|
3
|
+
export declare function createBase44PlatformServer(options: PlatformServerOptions): Base44PlatformServer;
|
package/dist/server/server.js
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var _Base44PlatformServer_serverUrl, _Base44PlatformServer_apiKey;
|
|
8
1
|
import { normalizeServerUrl } from "../shared/server-url.js";
|
|
9
2
|
import { createWebhooks } from "./modules/webhooks.js";
|
|
10
|
-
/**
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
__classPrivateFieldSet(this, _Base44PlatformServer_serverUrl, normalizeServerUrl(options.serverUrl), "f");
|
|
19
|
-
__classPrivateFieldSet(this, _Base44PlatformServer_apiKey, options.apiKey, "f");
|
|
20
|
-
this.webhooks = Object.freeze(createWebhooks(options.webhooks));
|
|
21
|
-
}
|
|
3
|
+
/** Create a server platform client, authenticated with a workspace API key. Performs no network requests. */
|
|
4
|
+
export function createBase44PlatformServer(options) {
|
|
5
|
+
if (!options.apiKey)
|
|
6
|
+
throw new TypeError("apiKey is required");
|
|
7
|
+
normalizeServerUrl(options.serverUrl);
|
|
8
|
+
return Object.freeze({
|
|
9
|
+
webhooks: Object.freeze(createWebhooks(options.webhooks)),
|
|
10
|
+
});
|
|
22
11
|
}
|
|
23
|
-
_Base44PlatformServer_serverUrl = new WeakMap(), _Base44PlatformServer_apiKey = new WeakMap();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WebhooksOptions } from "./modules/webhooks.types.js";
|
|
1
|
+
import type { WebhooksModule, WebhooksOptions } from "./modules/webhooks.types.js";
|
|
2
2
|
/** Shared configuration for server platform modules. */
|
|
3
3
|
export interface PlatformServerOptions {
|
|
4
4
|
/** Origin of the platform service, e.g. https://base44.app. No path/query/credentials. */
|
|
@@ -8,3 +8,8 @@ export interface PlatformServerOptions {
|
|
|
8
8
|
/** Webhook receiving settings. */
|
|
9
9
|
webhooks?: WebhooksOptions;
|
|
10
10
|
}
|
|
11
|
+
/** Server platform client, returned by `createBase44PlatformServer`. */
|
|
12
|
+
export interface Base44PlatformServer {
|
|
13
|
+
/** Verify Base44 outbound webhooks and answer the activation challenge. */
|
|
14
|
+
readonly webhooks: WebhooksModule;
|
|
15
|
+
}
|
package/package.json
CHANGED