medusa-plugin-automation 0.1.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/.medusa/server/medusa-config.d.ts +1 -0
- package/.medusa/server/medusa-config.js +23 -0
- package/.medusa/server/src/admin/index.js +9920 -0
- package/.medusa/server/src/admin/index.mjs +9918 -0
- package/.medusa/server/src/admin/lib/medusa-events.d.ts +16 -0
- package/.medusa/server/src/admin/lib/medusa-events.js +131 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/[actionId]/deliveries/retry/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/[actionId]/deliveries/retry/route.js +56 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/[actionId]/deliveries/route.d.ts +2 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/[actionId]/deliveries/route.js +26 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/[actionId]/query/route.d.ts +5 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/[actionId]/query/route.js +46 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/[actionId]/route.d.ts +5 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/[actionId]/route.js +37 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/route.d.ts +5 -0
- package/.medusa/server/src/api/admin/automations/[id]/actions/route.js +44 -0
- package/.medusa/server/src/api/admin/automations/[id]/receipts/route.d.ts +2 -0
- package/.medusa/server/src/api/admin/automations/[id]/receipts/route.js +17 -0
- package/.medusa/server/src/api/admin/automations/[id]/route.d.ts +5 -0
- package/.medusa/server/src/api/admin/automations/[id]/route.js +37 -0
- package/.medusa/server/src/api/admin/automations/route.d.ts +5 -0
- package/.medusa/server/src/api/admin/automations/route.js +36 -0
- package/.medusa/server/src/api/admin/automations/secrets/[id]/route.d.ts +2 -0
- package/.medusa/server/src/api/admin/automations/secrets/[id]/route.js +13 -0
- package/.medusa/server/src/api/admin/automations/secrets/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/automations/secrets/route.js +38 -0
- package/.medusa/server/src/api/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/middlewares.js +169 -0
- package/.medusa/server/src/api/validators.d.ts +470 -0
- package/.medusa/server/src/api/validators.js +123 -0
- package/.medusa/server/src/api/webhooks/[id]/route.d.ts +2 -0
- package/.medusa/server/src/api/webhooks/[id]/route.js +78 -0
- package/.medusa/server/src/lib/dispatch.d.ts +43 -0
- package/.medusa/server/src/lib/dispatch.js +400 -0
- package/.medusa/server/src/modules/automation/index.d.ts +92 -0
- package/.medusa/server/src/modules/automation/index.js +25 -0
- package/.medusa/server/src/modules/automation/migrations/Migration20260409171930.d.ts +5 -0
- package/.medusa/server/src/modules/automation/migrations/Migration20260409171930.js +47 -0
- package/.medusa/server/src/modules/automation/models/automation-action.d.ts +75 -0
- package/.medusa/server/src/modules/automation/models/automation-action.js +41 -0
- package/.medusa/server/src/modules/automation/models/automation-delivery.d.ts +57 -0
- package/.medusa/server/src/modules/automation/models/automation-delivery.js +23 -0
- package/.medusa/server/src/modules/automation/models/automation-query.d.ts +52 -0
- package/.medusa/server/src/modules/automation/models/automation-query.js +14 -0
- package/.medusa/server/src/modules/automation/models/automation-receipt.d.ts +53 -0
- package/.medusa/server/src/modules/automation/models/automation-receipt.js +29 -0
- package/.medusa/server/src/modules/automation/models/automation-secret.d.ts +5 -0
- package/.medusa/server/src/modules/automation/models/automation-secret.js +10 -0
- package/.medusa/server/src/modules/automation/models/automation-trigger.d.ts +56 -0
- package/.medusa/server/src/modules/automation/models/automation-trigger.js +27 -0
- package/.medusa/server/src/modules/automation/service.d.ts +274 -0
- package/.medusa/server/src/modules/automation/service.js +21 -0
- package/.medusa/server/src/modules/automation/types.d.ts +13 -0
- package/.medusa/server/src/modules/automation/types.js +3 -0
- package/.medusa/server/src/subscribers/automation-dispatcher.d.ts +3 -0
- package/.medusa/server/src/subscribers/automation-dispatcher.js +51 -0
- package/LICENSE.md +73 -0
- package/README.md +53 -0
- package/package.json +91 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.AUTOMATION_MODULE = void 0;
|
|
18
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
19
|
+
const service_1 = require("./service");
|
|
20
|
+
exports.AUTOMATION_MODULE = 'automation';
|
|
21
|
+
exports.default = (0, utils_1.Module)(exports.AUTOMATION_MODULE, {
|
|
22
|
+
service: service_1.AutomationService
|
|
23
|
+
});
|
|
24
|
+
__exportStar(require("./service"), exports);
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9hdXRvbWF0aW9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEscURBQWtEO0FBQ2xELHVDQUE2QztBQUVoQyxRQUFBLGlCQUFpQixHQUFHLFlBQVksQ0FBQTtBQUU3QyxrQkFBZSxJQUFBLGNBQU0sRUFBQyx5QkFBaUIsRUFBRTtJQUN4QyxPQUFPLEVBQUUsMkJBQWlCO0NBQzFCLENBQUMsQ0FBQTtBQUVGLDRDQUF5QiJ9
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Migration20260409171930 = void 0;
|
|
4
|
+
const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
|
|
5
|
+
class Migration20260409171930 extends migrations_1.Migration {
|
|
6
|
+
async up() {
|
|
7
|
+
this.addSql(`alter table if exists "automation_query" drop constraint if exists "automation_query_action_id_unique";`);
|
|
8
|
+
this.addSql(`create table if not exists "automation_secret" ("id" text not null, "label" text not null, "secret" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "automation_secret_pkey" primary key ("id"));`);
|
|
9
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_secret_deleted_at" ON "automation_secret" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
10
|
+
this.addSql(`create table if not exists "automation_trigger" ("id" text not null, "name" text not null, "description" text null, "is_active" boolean not null default true, "trigger_type" text check ("trigger_type" in ('medusa_event', 'incoming_webhook')) not null, "trigger_events" jsonb null, "trigger_signing_key" text null, "log_incoming" boolean not null default false, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "automation_trigger_pkey" primary key ("id"));`);
|
|
11
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_trigger_deleted_at" ON "automation_trigger" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
12
|
+
this.addSql(`create table if not exists "automation_receipt" ("id" text not null, "trigger_id" text not null, "request_ip" text null, "payload" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "automation_receipt_pkey" primary key ("id"));`);
|
|
13
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_receipt_trigger_id" ON "automation_receipt" ("trigger_id") WHERE deleted_at IS NULL;`);
|
|
14
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_receipt_deleted_at" ON "automation_receipt" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
15
|
+
this.addSql(`create table if not exists "automation_action" ("id" text not null, "name" text not null, "description" text null, "is_active" boolean not null default true, "trigger_id" text not null, "action_type" text check ("action_type" in ('outgoing_webhook', 'outgoing_request', 'medusa_workflow')) not null, "target_url" text null, "signing_secret_id" text null, "request_method" text null, "target_headers" jsonb null, "medusa_workflow" text null, "field_mappings" jsonb null, "static_values" jsonb null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "automation_action_pkey" primary key ("id"));`);
|
|
16
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_action_trigger_id" ON "automation_action" ("trigger_id") WHERE deleted_at IS NULL;`);
|
|
17
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_action_deleted_at" ON "automation_action" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
18
|
+
this.addSql(`create table if not exists "automation_query" ("id" text not null, "action_id" text not null, "entity_name" text not null, "fields" jsonb null, "filters" jsonb null, "limit" integer not null default 10, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "automation_query_pkey" primary key ("id"));`);
|
|
19
|
+
this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_automation_query_action_id_unique" ON "automation_query" ("action_id") WHERE deleted_at IS NULL;`);
|
|
20
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_query_deleted_at" ON "automation_query" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
21
|
+
this.addSql(`create table if not exists "automation_delivery" ("id" text not null, "event_name" text not null, "request_payload" jsonb null, "response_status" integer null, "response_body" text null, "status" text check ("status" in ('pending', 'success', 'failed')) not null default 'pending', "attempts" integer not null default 0, "error_message" text null, "action_id" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "automation_delivery_pkey" primary key ("id"));`);
|
|
22
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_delivery_action_id" ON "automation_delivery" ("action_id") WHERE deleted_at IS NULL;`);
|
|
23
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_automation_delivery_deleted_at" ON "automation_delivery" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
24
|
+
this.addSql(`alter table if exists "automation_receipt" drop constraint if exists "automation_receipt_trigger_id_foreign";`);
|
|
25
|
+
this.addSql(`alter table if exists "automation_receipt" add constraint "automation_receipt_trigger_id_foreign" foreign key ("trigger_id") references "automation_trigger" ("id") on update cascade on delete cascade;`);
|
|
26
|
+
this.addSql(`alter table if exists "automation_action" drop constraint if exists "automation_action_trigger_id_foreign";`);
|
|
27
|
+
this.addSql(`alter table if exists "automation_action" add constraint "automation_action_trigger_id_foreign" foreign key ("trigger_id") references "automation_trigger" ("id") on update cascade on delete cascade;`);
|
|
28
|
+
this.addSql(`alter table if exists "automation_query" drop constraint if exists "automation_query_action_id_foreign";`);
|
|
29
|
+
this.addSql(`alter table if exists "automation_query" add constraint "automation_query_action_id_foreign" foreign key ("action_id") references "automation_action" ("id") on update cascade on delete cascade;`);
|
|
30
|
+
this.addSql(`alter table if exists "automation_delivery" drop constraint if exists "automation_delivery_action_id_foreign";`);
|
|
31
|
+
this.addSql(`alter table if exists "automation_delivery" add constraint "automation_delivery_action_id_foreign" foreign key ("action_id") references "automation_action" ("id") on update cascade on delete cascade;`);
|
|
32
|
+
}
|
|
33
|
+
async down() {
|
|
34
|
+
this.addSql(`alter table if exists "automation_receipt" drop constraint if exists "automation_receipt_trigger_id_foreign";`);
|
|
35
|
+
this.addSql(`alter table if exists "automation_action" drop constraint if exists "automation_action_trigger_id_foreign";`);
|
|
36
|
+
this.addSql(`alter table if exists "automation_query" drop constraint if exists "automation_query_action_id_foreign";`);
|
|
37
|
+
this.addSql(`alter table if exists "automation_delivery" drop constraint if exists "automation_delivery_action_id_foreign";`);
|
|
38
|
+
this.addSql(`drop table if exists "automation_secret" cascade;`);
|
|
39
|
+
this.addSql(`drop table if exists "automation_trigger" cascade;`);
|
|
40
|
+
this.addSql(`drop table if exists "automation_receipt" cascade;`);
|
|
41
|
+
this.addSql(`drop table if exists "automation_action" cascade;`);
|
|
42
|
+
this.addSql(`drop table if exists "automation_query" cascade;`);
|
|
43
|
+
this.addSql(`drop table if exists "automation_delivery" cascade;`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.Migration20260409171930 = Migration20260409171930;
|
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNjA0MDkxNzE5MzAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9hdXRvbWF0aW9uL21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNjA0MDkxNzE5MzAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUFDLHlHQUF5RyxDQUFDLENBQUM7UUFDdkgsSUFBSSxDQUFDLE1BQU0sQ0FBQyw4U0FBOFMsQ0FBQyxDQUFDO1FBQzVULElBQUksQ0FBQyxNQUFNLENBQUMsK0hBQStILENBQUMsQ0FBQztRQUU3SSxJQUFJLENBQUMsTUFBTSxDQUFDLDRqQkFBNGpCLENBQUMsQ0FBQztRQUMxa0IsSUFBSSxDQUFDLE1BQU0sQ0FBQyxpSUFBaUksQ0FBQyxDQUFDO1FBRS9JLElBQUksQ0FBQyxNQUFNLENBQUMsMlVBQTJVLENBQUMsQ0FBQztRQUN6VixJQUFJLENBQUMsTUFBTSxDQUFDLGlJQUFpSSxDQUFDLENBQUM7UUFDL0ksSUFBSSxDQUFDLE1BQU0sQ0FBQyxpSUFBaUksQ0FBQyxDQUFDO1FBRS9JLElBQUksQ0FBQyxNQUFNLENBQUMsb3NCQUFvc0IsQ0FBQyxDQUFDO1FBQ2x0QixJQUFJLENBQUMsTUFBTSxDQUFDLCtIQUErSCxDQUFDLENBQUM7UUFDN0ksSUFBSSxDQUFDLE1BQU0sQ0FBQywrSEFBK0gsQ0FBQyxDQUFDO1FBRTdJLElBQUksQ0FBQyxNQUFNLENBQUMscVlBQXFZLENBQUMsQ0FBQztRQUNuWixJQUFJLENBQUMsTUFBTSxDQUFDLHlJQUF5SSxDQUFDLENBQUM7UUFDdkosSUFBSSxDQUFDLE1BQU0sQ0FBQyw2SEFBNkgsQ0FBQyxDQUFDO1FBRTNJLElBQUksQ0FBQyxNQUFNLENBQUMsb2pCQUFvakIsQ0FBQyxDQUFDO1FBQ2xrQixJQUFJLENBQUMsTUFBTSxDQUFDLGlJQUFpSSxDQUFDLENBQUM7UUFDL0ksSUFBSSxDQUFDLE1BQU0sQ0FBQyxtSUFBbUksQ0FBQyxDQUFDO1FBRWpKLElBQUksQ0FBQyxNQUFNLENBQUMsK0dBQStHLENBQUMsQ0FBQztRQUM3SCxJQUFJLENBQUMsTUFBTSxDQUFDLDBNQUEwTSxDQUFDLENBQUM7UUFFeE4sSUFBSSxDQUFDLE1BQU0sQ0FBQyw2R0FBNkcsQ0FBQyxDQUFDO1FBQzNILElBQUksQ0FBQyxNQUFNLENBQUMsd01BQXdNLENBQUMsQ0FBQztRQUV0TixJQUFJLENBQUMsTUFBTSxDQUFDLDBHQUEwRyxDQUFDLENBQUM7UUFDeEgsSUFBSSxDQUFDLE1BQU0sQ0FBQyxtTUFBbU0sQ0FBQyxDQUFDO1FBRWpOLElBQUksQ0FBQyxNQUFNLENBQUMsZ0hBQWdILENBQUMsQ0FBQztRQUM5SCxJQUFJLENBQUMsTUFBTSxDQUFDLHlNQUF5TSxDQUFDLENBQUM7SUFDek4sQ0FBQztJQUVRLEtBQUssQ0FBQyxJQUFJO1FBQ2pCLElBQUksQ0FBQyxNQUFNLENBQUMsK0dBQStHLENBQUMsQ0FBQztRQUU3SCxJQUFJLENBQUMsTUFBTSxDQUFDLDZHQUE2RyxDQUFDLENBQUM7UUFFM0gsSUFBSSxDQUFDLE1BQU0sQ0FBQywwR0FBMEcsQ0FBQyxDQUFDO1FBRXhILElBQUksQ0FBQyxNQUFNLENBQUMsZ0hBQWdILENBQUMsQ0FBQztRQUU5SCxJQUFJLENBQUMsTUFBTSxDQUFDLG1EQUFtRCxDQUFDLENBQUM7UUFFakUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxvREFBb0QsQ0FBQyxDQUFDO1FBRWxFLElBQUksQ0FBQyxNQUFNLENBQUMsb0RBQW9ELENBQUMsQ0FBQztRQUVsRSxJQUFJLENBQUMsTUFBTSxDQUFDLG1EQUFtRCxDQUFDLENBQUM7UUFFakUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxrREFBa0QsQ0FBQyxDQUFDO1FBRWhFLElBQUksQ0FBQyxNQUFNLENBQUMscURBQXFELENBQUMsQ0FBQztJQUNyRSxDQUFDO0NBRUY7QUE3REQsMERBNkRDIn0=
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare enum AutomationActionType {
|
|
2
|
+
OUTGOING_WEBHOOK = "outgoing_webhook",
|
|
3
|
+
OUTGOING_REQUEST = "outgoing_request",
|
|
4
|
+
MEDUSA_WORKFLOW = "medusa_workflow"
|
|
5
|
+
}
|
|
6
|
+
export declare enum AutomationRequestMethod {
|
|
7
|
+
GET = "GET",
|
|
8
|
+
POST = "POST",
|
|
9
|
+
PUT = "PUT",
|
|
10
|
+
DELETE = "DELETE"
|
|
11
|
+
}
|
|
12
|
+
export type FieldMapping = {
|
|
13
|
+
source_path: string;
|
|
14
|
+
target_key: string;
|
|
15
|
+
};
|
|
16
|
+
export type TargetHeader = {
|
|
17
|
+
key: string;
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
export type StaticValue = {
|
|
21
|
+
key: string;
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const AutomationAction: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
25
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
26
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
27
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
28
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
29
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
30
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
31
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
32
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
33
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
34
|
+
trigger_type: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-trigger").AutomationTriggerType>;
|
|
35
|
+
trigger_events: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
36
|
+
trigger_signing_key: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
37
|
+
log_incoming: import("@medusajs/framework/utils").BooleanProperty;
|
|
38
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
39
|
+
actions: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">>;
|
|
40
|
+
receipts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
41
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
42
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationTrigger">, undefined>;
|
|
43
|
+
request_ip: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
44
|
+
payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
45
|
+
}>, "automationReceipt">>;
|
|
46
|
+
}>, "automationTrigger">, undefined>;
|
|
47
|
+
action_type: import("@medusajs/framework/utils").EnumProperty<typeof AutomationActionType>;
|
|
48
|
+
target_url: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
49
|
+
signing_secret_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
50
|
+
request_method: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
51
|
+
target_headers: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
52
|
+
medusa_workflow: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
53
|
+
field_mappings: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
54
|
+
static_values: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
55
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
56
|
+
deliveries: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
57
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
58
|
+
event_name: import("@medusajs/framework/utils").TextProperty;
|
|
59
|
+
request_payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
60
|
+
response_status: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
61
|
+
response_body: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
62
|
+
status: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-delivery").AutomationDeliveryStatus>;
|
|
63
|
+
attempts: import("@medusajs/framework/utils").NumberProperty;
|
|
64
|
+
error_message: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
65
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">, undefined>;
|
|
66
|
+
}>, "automationDelivery">>;
|
|
67
|
+
query: import("@medusajs/framework/utils").HasOne<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
68
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
69
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">, undefined>;
|
|
70
|
+
entity_name: import("@medusajs/framework/utils").TextProperty;
|
|
71
|
+
fields: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
72
|
+
filters: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
73
|
+
limit: import("@medusajs/framework/utils").NumberProperty;
|
|
74
|
+
}>, "automationQuery">>;
|
|
75
|
+
}>, "automationAction">;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutomationAction = exports.AutomationRequestMethod = exports.AutomationActionType = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const automation_trigger_1 = require("./automation-trigger");
|
|
6
|
+
const automation_delivery_1 = require("./automation-delivery");
|
|
7
|
+
const automation_query_1 = require("./automation-query");
|
|
8
|
+
var AutomationActionType;
|
|
9
|
+
(function (AutomationActionType) {
|
|
10
|
+
AutomationActionType["OUTGOING_WEBHOOK"] = "outgoing_webhook";
|
|
11
|
+
AutomationActionType["OUTGOING_REQUEST"] = "outgoing_request";
|
|
12
|
+
AutomationActionType["MEDUSA_WORKFLOW"] = "medusa_workflow";
|
|
13
|
+
})(AutomationActionType || (exports.AutomationActionType = AutomationActionType = {}));
|
|
14
|
+
var AutomationRequestMethod;
|
|
15
|
+
(function (AutomationRequestMethod) {
|
|
16
|
+
AutomationRequestMethod["GET"] = "GET";
|
|
17
|
+
AutomationRequestMethod["POST"] = "POST";
|
|
18
|
+
AutomationRequestMethod["PUT"] = "PUT";
|
|
19
|
+
AutomationRequestMethod["DELETE"] = "DELETE";
|
|
20
|
+
})(AutomationRequestMethod || (exports.AutomationRequestMethod = AutomationRequestMethod = {}));
|
|
21
|
+
exports.AutomationAction = utils_1.model
|
|
22
|
+
.define('automationAction', {
|
|
23
|
+
id: utils_1.model.id().primaryKey(),
|
|
24
|
+
name: utils_1.model.text(),
|
|
25
|
+
description: utils_1.model.text().nullable(),
|
|
26
|
+
is_active: utils_1.model.boolean().default(true),
|
|
27
|
+
trigger: utils_1.model.belongsTo(() => automation_trigger_1.AutomationTrigger, { mappedBy: 'actions' }),
|
|
28
|
+
action_type: utils_1.model.enum(AutomationActionType),
|
|
29
|
+
target_url: utils_1.model.text().nullable(),
|
|
30
|
+
signing_secret_id: utils_1.model.text().nullable(), // FK to automation_secret — outgoing_webhook only
|
|
31
|
+
request_method: utils_1.model.text().nullable(), // AutomationRequestMethod — outgoing_request only
|
|
32
|
+
target_headers: utils_1.model.json().nullable(), // TargetHeader[]
|
|
33
|
+
medusa_workflow: utils_1.model.text().nullable(), // core-flows workflow name
|
|
34
|
+
field_mappings: utils_1.model.json().nullable(), // FieldMapping[]
|
|
35
|
+
static_values: utils_1.model.json().nullable(), // StaticValue[]
|
|
36
|
+
metadata: utils_1.model.json().nullable(),
|
|
37
|
+
deliveries: utils_1.model.hasMany(() => automation_delivery_1.AutomationDelivery, { mappedBy: 'action' }),
|
|
38
|
+
query: utils_1.model.hasOne(() => automation_query_1.AutomationQuery, { mappedBy: 'action' })
|
|
39
|
+
})
|
|
40
|
+
.cascades({ delete: ['deliveries', 'query'] });
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0b21hdGlvbi1hY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9hdXRvbWF0aW9uL21vZGVscy9hdXRvbWF0aW9uLWFjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxxREFBaUQ7QUFDakQsNkRBQXdEO0FBQ3hELCtEQUEwRDtBQUMxRCx5REFBb0Q7QUFFcEQsSUFBWSxvQkFJWDtBQUpELFdBQVksb0JBQW9CO0lBQy9CLDZEQUFxQyxDQUFBO0lBQ3JDLDZEQUFxQyxDQUFBO0lBQ3JDLDJEQUFtQyxDQUFBO0FBQ3BDLENBQUMsRUFKVyxvQkFBb0Isb0NBQXBCLG9CQUFvQixRQUkvQjtBQUVELElBQVksdUJBS1g7QUFMRCxXQUFZLHVCQUF1QjtJQUNsQyxzQ0FBVyxDQUFBO0lBQ1gsd0NBQWEsQ0FBQTtJQUNiLHNDQUFXLENBQUE7SUFDWCw0Q0FBaUIsQ0FBQTtBQUNsQixDQUFDLEVBTFcsdUJBQXVCLHVDQUF2Qix1QkFBdUIsUUFLbEM7QUFpQlksUUFBQSxnQkFBZ0IsR0FBRyxhQUFLO0tBQ25DLE1BQU0sQ0FBQyxrQkFBa0IsRUFBRTtJQUMzQixFQUFFLEVBQUUsYUFBSyxDQUFDLEVBQUUsRUFBRSxDQUFDLFVBQVUsRUFBRTtJQUMzQixJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRTtJQUNsQixXQUFXLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUNwQyxTQUFTLEVBQUUsYUFBSyxDQUFDLE9BQU8sRUFBRSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUM7SUFDeEMsT0FBTyxFQUFFLGFBQUssQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQUMsc0NBQWlCLEVBQUUsRUFBRSxRQUFRLEVBQUUsU0FBUyxFQUFFLENBQUM7SUFDMUUsV0FBVyxFQUFFLGFBQUssQ0FBQyxJQUFJLENBQUMsb0JBQW9CLENBQUM7SUFDN0MsVUFBVSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDbkMsaUJBQWlCLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRSxFQUFFLGtEQUFrRDtJQUM5RixjQUFjLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRSxFQUFLLGtEQUFrRDtJQUM5RixjQUFjLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRSxFQUFHLGlCQUFpQjtJQUMzRCxlQUFlLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRSxFQUFHLDJCQUEyQjtJQUN0RSxjQUFjLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRSxFQUFJLGlCQUFpQjtJQUM1RCxhQUFhLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRSxFQUFLLGdCQUFnQjtJQUMzRCxRQUFRLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUNqQyxVQUFVLEVBQUUsYUFBSyxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQyx3Q0FBa0IsRUFBRSxFQUFFLFFBQVEsRUFBRSxRQUFRLEVBQUUsQ0FBQztJQUMzRSxLQUFLLEVBQUUsYUFBSyxDQUFDLE1BQU0sQ0FBQyxHQUFHLEVBQUUsQ0FBQyxrQ0FBZSxFQUFFLEVBQUUsUUFBUSxFQUFFLFFBQVEsRUFBRSxDQUFDO0NBQ2xFLENBQUM7S0FDRCxRQUFRLENBQUMsRUFBRSxNQUFNLEVBQUUsQ0FBQyxZQUFZLEVBQUUsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFBIn0=
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare enum AutomationDeliveryStatus {
|
|
2
|
+
PENDING = "pending",
|
|
3
|
+
SUCCESS = "success",
|
|
4
|
+
FAILED = "failed"
|
|
5
|
+
}
|
|
6
|
+
export declare const AutomationDelivery: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
7
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
8
|
+
event_name: import("@medusajs/framework/utils").TextProperty;
|
|
9
|
+
request_payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
10
|
+
response_status: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
11
|
+
response_body: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
12
|
+
status: import("@medusajs/framework/utils").EnumProperty<typeof AutomationDeliveryStatus>;
|
|
13
|
+
attempts: import("@medusajs/framework/utils").NumberProperty;
|
|
14
|
+
error_message: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
15
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
16
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
17
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
18
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
19
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
20
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
21
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
22
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
23
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
24
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
25
|
+
trigger_type: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-trigger").AutomationTriggerType>;
|
|
26
|
+
trigger_events: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
27
|
+
trigger_signing_key: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
28
|
+
log_incoming: import("@medusajs/framework/utils").BooleanProperty;
|
|
29
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
30
|
+
actions: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">>;
|
|
31
|
+
receipts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
32
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
33
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationTrigger">, undefined>;
|
|
34
|
+
request_ip: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
35
|
+
payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
36
|
+
}>, "automationReceipt">>;
|
|
37
|
+
}>, "automationTrigger">, undefined>;
|
|
38
|
+
action_type: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-action").AutomationActionType>;
|
|
39
|
+
target_url: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
40
|
+
signing_secret_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
41
|
+
request_method: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
42
|
+
target_headers: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
43
|
+
medusa_workflow: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
44
|
+
field_mappings: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
45
|
+
static_values: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
46
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
47
|
+
deliveries: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationDelivery">>;
|
|
48
|
+
query: import("@medusajs/framework/utils").HasOne<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
49
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
50
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">, undefined>;
|
|
51
|
+
entity_name: import("@medusajs/framework/utils").TextProperty;
|
|
52
|
+
fields: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
53
|
+
filters: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
54
|
+
limit: import("@medusajs/framework/utils").NumberProperty;
|
|
55
|
+
}>, "automationQuery">>;
|
|
56
|
+
}>, "automationAction">, undefined>;
|
|
57
|
+
}>, "automationDelivery">;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutomationDelivery = exports.AutomationDeliveryStatus = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const automation_action_1 = require("./automation-action");
|
|
6
|
+
var AutomationDeliveryStatus;
|
|
7
|
+
(function (AutomationDeliveryStatus) {
|
|
8
|
+
AutomationDeliveryStatus["PENDING"] = "pending";
|
|
9
|
+
AutomationDeliveryStatus["SUCCESS"] = "success";
|
|
10
|
+
AutomationDeliveryStatus["FAILED"] = "failed";
|
|
11
|
+
})(AutomationDeliveryStatus || (exports.AutomationDeliveryStatus = AutomationDeliveryStatus = {}));
|
|
12
|
+
exports.AutomationDelivery = utils_1.model.define('automationDelivery', {
|
|
13
|
+
id: utils_1.model.id().primaryKey(),
|
|
14
|
+
event_name: utils_1.model.text(),
|
|
15
|
+
request_payload: utils_1.model.json().nullable(),
|
|
16
|
+
response_status: utils_1.model.number().nullable(),
|
|
17
|
+
response_body: utils_1.model.text().nullable(),
|
|
18
|
+
status: utils_1.model.enum(AutomationDeliveryStatus).default(AutomationDeliveryStatus.PENDING),
|
|
19
|
+
attempts: utils_1.model.number().default(0),
|
|
20
|
+
error_message: utils_1.model.text().nullable(),
|
|
21
|
+
action: utils_1.model.belongsTo(() => automation_action_1.AutomationAction, { mappedBy: 'deliveries' })
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0b21hdGlvbi1kZWxpdmVyeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tb2R1bGVzL2F1dG9tYXRpb24vbW9kZWxzL2F1dG9tYXRpb24tZGVsaXZlcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEscURBQWlEO0FBQ2pELDJEQUFzRDtBQUV0RCxJQUFZLHdCQUlYO0FBSkQsV0FBWSx3QkFBd0I7SUFDbkMsK0NBQW1CLENBQUE7SUFDbkIsK0NBQW1CLENBQUE7SUFDbkIsNkNBQWlCLENBQUE7QUFDbEIsQ0FBQyxFQUpXLHdCQUF3Qix3Q0FBeEIsd0JBQXdCLFFBSW5DO0FBRVksUUFBQSxrQkFBa0IsR0FBRyxhQUFLLENBQUMsTUFBTSxDQUFDLG9CQUFvQixFQUFFO0lBQ3BFLEVBQUUsRUFBRSxhQUFLLENBQUMsRUFBRSxFQUFFLENBQUMsVUFBVSxFQUFFO0lBQzNCLFVBQVUsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQ3hCLGVBQWUsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQ3hDLGVBQWUsRUFBRSxhQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQzFDLGFBQWEsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBQ3RDLE1BQU0sRUFBRSxhQUFLLENBQUMsSUFBSSxDQUFDLHdCQUF3QixDQUFDLENBQUMsT0FBTyxDQUFDLHdCQUF3QixDQUFDLE9BQU8sQ0FBQztJQUN0RixRQUFRLEVBQUUsYUFBSyxDQUFDLE1BQU0sRUFBRSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7SUFDbkMsYUFBYSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDdEMsTUFBTSxFQUFFLGFBQUssQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQUMsb0NBQWdCLEVBQUUsRUFBRSxRQUFRLEVBQUUsWUFBWSxFQUFFLENBQUM7Q0FDM0UsQ0FBQyxDQUFBIn0=
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const AutomationQuery: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
4
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
5
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
6
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
7
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
8
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
9
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
10
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
11
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
12
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
13
|
+
trigger_type: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-trigger").AutomationTriggerType>;
|
|
14
|
+
trigger_events: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
15
|
+
trigger_signing_key: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
16
|
+
log_incoming: import("@medusajs/framework/utils").BooleanProperty;
|
|
17
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
18
|
+
actions: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">>;
|
|
19
|
+
receipts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
20
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
21
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationTrigger">, undefined>;
|
|
22
|
+
request_ip: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
23
|
+
payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
24
|
+
}>, "automationReceipt">>;
|
|
25
|
+
}>, "automationTrigger">, undefined>;
|
|
26
|
+
action_type: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-action").AutomationActionType>;
|
|
27
|
+
target_url: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
28
|
+
signing_secret_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
29
|
+
request_method: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
30
|
+
target_headers: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
31
|
+
medusa_workflow: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
32
|
+
field_mappings: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
33
|
+
static_values: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
34
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
35
|
+
deliveries: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
36
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
37
|
+
event_name: import("@medusajs/framework/utils").TextProperty;
|
|
38
|
+
request_payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
39
|
+
response_status: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
40
|
+
response_body: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
41
|
+
status: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-delivery").AutomationDeliveryStatus>;
|
|
42
|
+
attempts: import("@medusajs/framework/utils").NumberProperty;
|
|
43
|
+
error_message: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
44
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">, undefined>;
|
|
45
|
+
}>, "automationDelivery">>;
|
|
46
|
+
query: import("@medusajs/framework/utils").HasOne<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationQuery">>;
|
|
47
|
+
}>, "automationAction">, undefined>;
|
|
48
|
+
entity_name: import("@medusajs/framework/utils").TextProperty;
|
|
49
|
+
fields: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
50
|
+
filters: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
51
|
+
limit: import("@medusajs/framework/utils").NumberProperty;
|
|
52
|
+
}>, "automationQuery">;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutomationQuery = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const automation_action_1 = require("./automation-action");
|
|
6
|
+
exports.AutomationQuery = utils_1.model.define('automationQuery', {
|
|
7
|
+
id: utils_1.model.id().primaryKey(),
|
|
8
|
+
action: utils_1.model.belongsTo(() => automation_action_1.AutomationAction, { mappedBy: 'query' }),
|
|
9
|
+
entity_name: utils_1.model.text(),
|
|
10
|
+
fields: utils_1.model.json().nullable(), // string[] — passed as options.fields to query.graph()
|
|
11
|
+
filters: utils_1.model.json().nullable(), // Record<string, unknown> — supports $event.path references
|
|
12
|
+
limit: utils_1.model.number().default(10) // options.pagination.take, max 100
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0b21hdGlvbi1xdWVyeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tb2R1bGVzL2F1dG9tYXRpb24vbW9kZWxzL2F1dG9tYXRpb24tcXVlcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEscURBQWlEO0FBQ2pELDJEQUFzRDtBQUV6QyxRQUFBLGVBQWUsR0FBRyxhQUFLLENBQUMsTUFBTSxDQUFDLGlCQUFpQixFQUFFO0lBQzlELEVBQUUsRUFBRSxhQUFLLENBQUMsRUFBRSxFQUFFLENBQUMsVUFBVSxFQUFFO0lBQzNCLE1BQU0sRUFBRSxhQUFLLENBQUMsU0FBUyxDQUFDLEdBQUcsRUFBRSxDQUFDLG9DQUFnQixFQUFFLEVBQUUsUUFBUSxFQUFFLE9BQU8sRUFBRSxDQUFDO0lBQ3RFLFdBQVcsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQ3pCLE1BQU0sRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFLEVBQUksdURBQXVEO0lBQzFGLE9BQU8sRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFLEVBQUcsNERBQTREO0lBQy9GLEtBQUssRUFBRSxhQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFFLG1DQUFtQztDQUN0RSxDQUFDLENBQUEifQ==
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare function redactPayload(obj: unknown): unknown;
|
|
2
|
+
export declare const AutomationReceipt: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
3
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
4
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
5
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
6
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
7
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
8
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
9
|
+
trigger_type: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-trigger").AutomationTriggerType>;
|
|
10
|
+
trigger_events: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
11
|
+
trigger_signing_key: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
12
|
+
log_incoming: import("@medusajs/framework/utils").BooleanProperty;
|
|
13
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
14
|
+
actions: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
15
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
16
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
17
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
18
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
19
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationTrigger">, undefined>;
|
|
20
|
+
action_type: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-action").AutomationActionType>;
|
|
21
|
+
target_url: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
22
|
+
signing_secret_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
23
|
+
request_method: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
24
|
+
target_headers: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
25
|
+
medusa_workflow: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
26
|
+
field_mappings: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
27
|
+
static_values: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
28
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
29
|
+
deliveries: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
30
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
31
|
+
event_name: import("@medusajs/framework/utils").TextProperty;
|
|
32
|
+
request_payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
33
|
+
response_status: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
34
|
+
response_body: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
35
|
+
status: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-delivery").AutomationDeliveryStatus>;
|
|
36
|
+
attempts: import("@medusajs/framework/utils").NumberProperty;
|
|
37
|
+
error_message: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
38
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">, undefined>;
|
|
39
|
+
}>, "automationDelivery">>;
|
|
40
|
+
query: import("@medusajs/framework/utils").HasOne<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
41
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
42
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">, undefined>;
|
|
43
|
+
entity_name: import("@medusajs/framework/utils").TextProperty;
|
|
44
|
+
fields: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
45
|
+
filters: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
46
|
+
limit: import("@medusajs/framework/utils").NumberProperty;
|
|
47
|
+
}>, "automationQuery">>;
|
|
48
|
+
}>, "automationAction">>;
|
|
49
|
+
receipts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationReceipt">>;
|
|
50
|
+
}>, "automationTrigger">, undefined>;
|
|
51
|
+
request_ip: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
52
|
+
payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
53
|
+
}>, "automationReceipt">;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutomationReceipt = void 0;
|
|
4
|
+
exports.redactPayload = redactPayload;
|
|
5
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
6
|
+
const automation_trigger_1 = require("./automation-trigger");
|
|
7
|
+
const REDACT_KEYS = ['password', 'pass', 'apikey', 'secret'];
|
|
8
|
+
function shouldRedact(key) {
|
|
9
|
+
const lower = key.toLowerCase();
|
|
10
|
+
return REDACT_KEYS.some(k => lower.includes(k));
|
|
11
|
+
}
|
|
12
|
+
function redactPayload(obj) {
|
|
13
|
+
if (obj === null || typeof obj !== 'object')
|
|
14
|
+
return obj;
|
|
15
|
+
if (Array.isArray(obj))
|
|
16
|
+
return obj.map(redactPayload);
|
|
17
|
+
const result = {};
|
|
18
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
19
|
+
result[k] = shouldRedact(k) ? '[REDACTED]' : redactPayload(v);
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
exports.AutomationReceipt = utils_1.model.define('automationReceipt', {
|
|
24
|
+
id: utils_1.model.id().primaryKey(),
|
|
25
|
+
trigger: utils_1.model.belongsTo(() => automation_trigger_1.AutomationTrigger, { mappedBy: 'receipts' }),
|
|
26
|
+
request_ip: utils_1.model.text().nullable(),
|
|
27
|
+
payload: utils_1.model.json().nullable() // redacted before storage
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0b21hdGlvbi1yZWNlaXB0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvYXV0b21hdGlvbi9tb2RlbHMvYXV0b21hdGlvbi1yZWNlaXB0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQVVBLHNDQVFDO0FBbEJELHFEQUFpRDtBQUNqRCw2REFBd0Q7QUFFeEQsTUFBTSxXQUFXLEdBQUcsQ0FBQyxVQUFVLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxRQUFRLENBQUMsQ0FBQTtBQUU1RCxTQUFTLFlBQVksQ0FBQyxHQUFXO0lBQ2hDLE1BQU0sS0FBSyxHQUFHLEdBQUcsQ0FBQyxXQUFXLEVBQUUsQ0FBQTtJQUMvQixPQUFPLFdBQVcsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUE7QUFDaEQsQ0FBQztBQUVELFNBQWdCLGFBQWEsQ0FBQyxHQUFZO0lBQ3pDLElBQUksR0FBRyxLQUFLLElBQUksSUFBSSxPQUFPLEdBQUcsS0FBSyxRQUFRO1FBQUUsT0FBTyxHQUFHLENBQUE7SUFDdkQsSUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQztRQUFFLE9BQU8sR0FBRyxDQUFDLEdBQUcsQ0FBQyxhQUFhLENBQUMsQ0FBQTtJQUNyRCxNQUFNLE1BQU0sR0FBNEIsRUFBRSxDQUFBO0lBQzFDLEtBQUssTUFBTSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsSUFBSSxNQUFNLENBQUMsT0FBTyxDQUFDLEdBQThCLENBQUMsRUFBRSxDQUFDO1FBQ3JFLE1BQU0sQ0FBQyxDQUFDLENBQUMsR0FBRyxZQUFZLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFBO0lBQzlELENBQUM7SUFDRCxPQUFPLE1BQU0sQ0FBQTtBQUNkLENBQUM7QUFFWSxRQUFBLGlCQUFpQixHQUFHLGFBQUssQ0FBQyxNQUFNLENBQUMsbUJBQW1CLEVBQUU7SUFDbEUsRUFBRSxFQUFFLGFBQUssQ0FBQyxFQUFFLEVBQUUsQ0FBQyxVQUFVLEVBQUU7SUFDM0IsT0FBTyxFQUFFLGFBQUssQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQUMsc0NBQWlCLEVBQUUsRUFBRSxRQUFRLEVBQUUsVUFBVSxFQUFFLENBQUM7SUFDM0UsVUFBVSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFDbkMsT0FBTyxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUUsQ0FBQywwQkFBMEI7Q0FDM0QsQ0FBQyxDQUFBIn0=
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const AutomationSecret: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
label: import("@medusajs/framework/utils").TextProperty;
|
|
4
|
+
secret: import("@medusajs/framework/utils").TextProperty;
|
|
5
|
+
}>, "automationSecret">;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutomationSecret = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
exports.AutomationSecret = utils_1.model.define('automationSecret', {
|
|
6
|
+
id: utils_1.model.id().primaryKey(),
|
|
7
|
+
label: utils_1.model.text(),
|
|
8
|
+
secret: utils_1.model.text() // HMAC key — stored plaintext, never returned via API after initial creation
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0b21hdGlvbi1zZWNyZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9hdXRvbWF0aW9uL21vZGVscy9hdXRvbWF0aW9uLXNlY3JldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxxREFBaUQ7QUFFcEMsUUFBQSxnQkFBZ0IsR0FBRyxhQUFLLENBQUMsTUFBTSxDQUFDLGtCQUFrQixFQUFFO0lBQ2hFLEVBQUUsRUFBRSxhQUFLLENBQUMsRUFBRSxFQUFFLENBQUMsVUFBVSxFQUFFO0lBQzNCLEtBQUssRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQ25CLE1BQU0sRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsNkVBQTZFO0NBQ2xHLENBQUMsQ0FBQSJ9
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare enum AutomationTriggerType {
|
|
2
|
+
MEDUSA_EVENT = "medusa_event",
|
|
3
|
+
INCOMING_WEBHOOK = "incoming_webhook"
|
|
4
|
+
}
|
|
5
|
+
export declare const AutomationTrigger: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
6
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
7
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
8
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
9
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
10
|
+
trigger_type: import("@medusajs/framework/utils").EnumProperty<typeof AutomationTriggerType>;
|
|
11
|
+
trigger_events: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
12
|
+
trigger_signing_key: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
13
|
+
log_incoming: import("@medusajs/framework/utils").BooleanProperty;
|
|
14
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
15
|
+
actions: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
16
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
17
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
18
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
19
|
+
is_active: import("@medusajs/framework/utils").BooleanProperty;
|
|
20
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationTrigger">, undefined>;
|
|
21
|
+
action_type: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-action").AutomationActionType>;
|
|
22
|
+
target_url: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
23
|
+
signing_secret_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
24
|
+
request_method: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
25
|
+
target_headers: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
26
|
+
medusa_workflow: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
27
|
+
field_mappings: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
28
|
+
static_values: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
29
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
30
|
+
deliveries: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
31
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
32
|
+
event_name: import("@medusajs/framework/utils").TextProperty;
|
|
33
|
+
request_payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
34
|
+
response_status: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
35
|
+
response_body: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
36
|
+
status: import("@medusajs/framework/utils").EnumProperty<typeof import("./automation-delivery").AutomationDeliveryStatus>;
|
|
37
|
+
attempts: import("@medusajs/framework/utils").NumberProperty;
|
|
38
|
+
error_message: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
39
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">, undefined>;
|
|
40
|
+
}>, "automationDelivery">>;
|
|
41
|
+
query: import("@medusajs/framework/utils").HasOne<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
42
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
43
|
+
action: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationAction">, undefined>;
|
|
44
|
+
entity_name: import("@medusajs/framework/utils").TextProperty;
|
|
45
|
+
fields: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
46
|
+
filters: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
47
|
+
limit: import("@medusajs/framework/utils").NumberProperty;
|
|
48
|
+
}>, "automationQuery">>;
|
|
49
|
+
}>, "automationAction">>;
|
|
50
|
+
receipts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
51
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
52
|
+
trigger: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "automationTrigger">, undefined>;
|
|
53
|
+
request_ip: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
54
|
+
payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
55
|
+
}>, "automationReceipt">>;
|
|
56
|
+
}>, "automationTrigger">;
|