@rippling/rippling-sdk 0.2.0-alpha.85 → 0.2.0-alpha.86
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/core/platform/custom-objects/category.d.mts +125 -0
- package/core/platform/custom-objects/category.d.mts.map +1 -0
- package/core/platform/custom-objects/category.d.ts +125 -0
- package/core/platform/custom-objects/category.d.ts.map +1 -0
- package/core/platform/custom-objects/category.js +188 -0
- package/core/platform/custom-objects/category.js.map +1 -0
- package/core/platform/custom-objects/category.mjs +178 -0
- package/core/platform/custom-objects/category.mjs.map +1 -0
- package/core/platform/custom-objects/definition.d.mts +147 -0
- package/core/platform/custom-objects/definition.d.mts.map +1 -0
- package/core/platform/custom-objects/definition.d.ts +147 -0
- package/core/platform/custom-objects/definition.d.ts.map +1 -0
- package/core/platform/custom-objects/definition.js +200 -0
- package/core/platform/custom-objects/definition.js.map +1 -0
- package/core/platform/custom-objects/definition.mjs +190 -0
- package/core/platform/custom-objects/definition.mjs.map +1 -0
- package/core/platform/custom-objects/fields.d.mts +302 -0
- package/core/platform/custom-objects/fields.d.mts.map +1 -0
- package/core/platform/custom-objects/fields.d.ts +302 -0
- package/core/platform/custom-objects/fields.d.ts.map +1 -0
- package/core/platform/custom-objects/fields.js +369 -0
- package/core/platform/custom-objects/fields.js.map +1 -0
- package/core/platform/custom-objects/fields.mjs +347 -0
- package/core/platform/custom-objects/fields.mjs.map +1 -0
- package/core/platform/custom-objects/function-runtime.d.mts +42 -0
- package/core/platform/custom-objects/function-runtime.d.mts.map +1 -0
- package/core/platform/custom-objects/function-runtime.d.ts +42 -0
- package/core/platform/custom-objects/function-runtime.d.ts.map +1 -0
- package/core/platform/custom-objects/function-runtime.js +38 -0
- package/core/platform/custom-objects/function-runtime.js.map +1 -0
- package/core/platform/custom-objects/function-runtime.mjs +35 -0
- package/core/platform/custom-objects/function-runtime.mjs.map +1 -0
- package/core/platform/custom-objects/lifecycle.d.mts +83 -0
- package/core/platform/custom-objects/lifecycle.d.mts.map +1 -0
- package/core/platform/custom-objects/lifecycle.d.ts +83 -0
- package/core/platform/custom-objects/lifecycle.d.ts.map +1 -0
- package/core/platform/custom-objects/lifecycle.js +372 -0
- package/core/platform/custom-objects/lifecycle.js.map +1 -0
- package/core/platform/custom-objects/lifecycle.mjs +367 -0
- package/core/platform/custom-objects/lifecycle.mjs.map +1 -0
- package/core/platform/custom-objects/manager.d.mts +354 -0
- package/core/platform/custom-objects/manager.d.mts.map +1 -0
- package/core/platform/custom-objects/manager.d.ts +354 -0
- package/core/platform/custom-objects/manager.d.ts.map +1 -0
- package/core/platform/custom-objects/manager.js +646 -0
- package/core/platform/custom-objects/manager.js.map +1 -0
- package/core/platform/custom-objects/manager.mjs +637 -0
- package/core/platform/custom-objects/manager.mjs.map +1 -0
- package/core/platform/custom-objects/provisioning.d.mts +138 -0
- package/core/platform/custom-objects/provisioning.d.mts.map +1 -0
- package/core/platform/custom-objects/provisioning.d.ts +138 -0
- package/core/platform/custom-objects/provisioning.d.ts.map +1 -0
- package/core/platform/custom-objects/provisioning.js +455 -0
- package/core/platform/custom-objects/provisioning.js.map +1 -0
- package/core/platform/custom-objects/provisioning.mjs +447 -0
- package/core/platform/custom-objects/provisioning.mjs.map +1 -0
- package/core/platform/custom-objects/rql.d.mts +122 -0
- package/core/platform/custom-objects/rql.d.mts.map +1 -0
- package/core/platform/custom-objects/rql.d.ts +122 -0
- package/core/platform/custom-objects/rql.d.ts.map +1 -0
- package/core/platform/custom-objects/rql.js +225 -0
- package/core/platform/custom-objects/rql.js.map +1 -0
- package/core/platform/custom-objects/rql.mjs +222 -0
- package/core/platform/custom-objects/rql.mjs.map +1 -0
- package/core/platform/custom-objects/schema-manager.d.mts +203 -0
- package/core/platform/custom-objects/schema-manager.d.mts.map +1 -0
- package/core/platform/custom-objects/schema-manager.d.ts +203 -0
- package/core/platform/custom-objects/schema-manager.d.ts.map +1 -0
- package/core/platform/custom-objects/schema-manager.js +256 -0
- package/core/platform/custom-objects/schema-manager.js.map +1 -0
- package/core/platform/custom-objects/schema-manager.mjs +249 -0
- package/core/platform/custom-objects/schema-manager.mjs.map +1 -0
- package/core/platform/custom-objects/typed-rql.d.mts +157 -0
- package/core/platform/custom-objects/typed-rql.d.mts.map +1 -0
- package/core/platform/custom-objects/typed-rql.d.ts +157 -0
- package/core/platform/custom-objects/typed-rql.d.ts.map +1 -0
- package/core/platform/custom-objects/typed-rql.js +583 -0
- package/core/platform/custom-objects/typed-rql.js.map +1 -0
- package/core/platform/custom-objects/typed-rql.mjs +580 -0
- package/core/platform/custom-objects/typed-rql.mjs.map +1 -0
- package/core/platform/custom-objects/types.d.mts +549 -0
- package/core/platform/custom-objects/types.d.mts.map +1 -0
- package/core/platform/custom-objects/types.d.ts +549 -0
- package/core/platform/custom-objects/types.d.ts.map +1 -0
- package/core/platform/custom-objects/types.js +20 -0
- package/core/platform/custom-objects/types.js.map +1 -0
- package/core/platform/custom-objects/types.mjs +17 -0
- package/core/platform/custom-objects/types.mjs.map +1 -0
- package/core/platform/custom-objects/validation.d.mts +97 -0
- package/core/platform/custom-objects/validation.d.mts.map +1 -0
- package/core/platform/custom-objects/validation.d.ts +97 -0
- package/core/platform/custom-objects/validation.d.ts.map +1 -0
- package/core/platform/custom-objects/validation.js +477 -0
- package/core/platform/custom-objects/validation.js.map +1 -0
- package/core/platform/custom-objects/validation.mjs +465 -0
- package/core/platform/custom-objects/validation.mjs.map +1 -0
- package/core/platform/custom-objects.d.mts +67 -0
- package/core/platform/custom-objects.d.mts.map +1 -0
- package/core/platform/custom-objects.d.ts +67 -0
- package/core/platform/custom-objects.d.ts.map +1 -0
- package/core/platform/custom-objects.js +118 -0
- package/core/platform/custom-objects.js.map +1 -0
- package/core/platform/custom-objects.mjs +45 -0
- package/core/platform/custom-objects.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/custom-objects/custom-objects.d.mts +7 -0
- package/resources/custom-objects/custom-objects.d.mts.map +1 -1
- package/resources/custom-objects/custom-objects.d.ts +7 -0
- package/resources/custom-objects/custom-objects.d.ts.map +1 -1
- package/resources/custom-objects/custom-objects.js.map +1 -1
- package/resources/custom-objects/custom-objects.mjs.map +1 -1
- package/resources/custom-objects/fields.d.mts +129 -54
- package/resources/custom-objects/fields.d.mts.map +1 -1
- package/resources/custom-objects/fields.d.ts +129 -54
- package/resources/custom-objects/fields.d.ts.map +1 -1
- package/resources/levels.d.mts +25 -4
- package/resources/levels.d.mts.map +1 -1
- package/resources/levels.d.ts +25 -4
- package/resources/levels.d.ts.map +1 -1
- package/src/core/platform/custom-objects/category.ts +294 -0
- package/src/core/platform/custom-objects/definition.ts +373 -0
- package/src/core/platform/custom-objects/fields.ts +653 -0
- package/src/core/platform/custom-objects/function-runtime.ts +76 -0
- package/src/core/platform/custom-objects/lifecycle.ts +557 -0
- package/src/core/platform/custom-objects/manager.ts +959 -0
- package/src/core/platform/custom-objects/provisioning.ts +672 -0
- package/src/core/platform/custom-objects/rql.ts +375 -0
- package/src/core/platform/custom-objects/schema-manager.ts +351 -0
- package/src/core/platform/custom-objects/typed-rql.ts +1273 -0
- package/src/core/platform/custom-objects/types.ts +753 -0
- package/src/core/platform/custom-objects/validation.ts +573 -0
- package/src/core/platform/custom-objects.ts +269 -0
- package/src/resources/custom-objects/custom-objects.ts +8 -0
- package/src/resources/custom-objects/fields.ts +192 -59
- package/src/resources/levels.ts +28 -4
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { RipplingSDK } from "../../../client.mjs";
|
|
2
|
+
import type { ObjectCategory, ObjectCategoryCreateParams, ObjectCategoryUpdateParams } from "../../../resources/object-categories.mjs";
|
|
3
|
+
import type { CategoryApiName, LogicalCategoryName } from "./types.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Author input accepted by {@link defineCustomObjectCategory}.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam TName - Logical category name supplied by the caller.
|
|
8
|
+
*/
|
|
9
|
+
interface CustomObjectCategoryDefinitionInput<TName extends string> {
|
|
10
|
+
/** Logical unsuffixed snake_case category name. */
|
|
11
|
+
readonly name: LogicalCategoryName<TName>;
|
|
12
|
+
/** Human-readable display name applied after creation. */
|
|
13
|
+
readonly displayName: string;
|
|
14
|
+
/** Optional category description. */
|
|
15
|
+
readonly description?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Immutable typed category definition used by provisioning and lifecycle helpers. */
|
|
18
|
+
export interface CustomObjectCategoryDefinition<TName extends LogicalCategoryName = LogicalCategoryName> {
|
|
19
|
+
/** Logical unsuffixed snake_case category name. */
|
|
20
|
+
readonly name: TName;
|
|
21
|
+
/** Compiled wire-level category api name. */
|
|
22
|
+
readonly apiName: CategoryApiName<TName>;
|
|
23
|
+
/** Human-readable display name. */
|
|
24
|
+
readonly displayName: string;
|
|
25
|
+
/** Optional category description. */
|
|
26
|
+
readonly description?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Result returned by category provisioning helpers. */
|
|
29
|
+
export interface ProvisionedCustomObjectCategory<TName extends LogicalCategoryName = LogicalCategoryName> {
|
|
30
|
+
/** Source typed category definition. */
|
|
31
|
+
readonly definition: CustomObjectCategoryDefinition<TName>;
|
|
32
|
+
/** Response returned by `client.objectCategories.create(...)`. */
|
|
33
|
+
readonly createdCategory: ObjectCategory;
|
|
34
|
+
/** Response returned by `client.objectCategories.update(...)`. */
|
|
35
|
+
readonly updatedCategory: ObjectCategory;
|
|
36
|
+
}
|
|
37
|
+
/** Lifecycle action emitted by category reconciliation helpers. */
|
|
38
|
+
export type CustomObjectCategoryLifecycleAction = 'created' | 'updated' | 'unchanged';
|
|
39
|
+
/** Result returned by category reconciliation helpers. */
|
|
40
|
+
export interface ReconciledCustomObjectCategory<TName extends LogicalCategoryName = LogicalCategoryName> {
|
|
41
|
+
/** Source typed category definition. */
|
|
42
|
+
readonly definition: CustomObjectCategoryDefinition<TName>;
|
|
43
|
+
/** Whether the remote category was created, updated, or already matched. */
|
|
44
|
+
readonly action: CustomObjectCategoryLifecycleAction;
|
|
45
|
+
/** Remote category after reconciliation. */
|
|
46
|
+
readonly category: ObjectCategory;
|
|
47
|
+
}
|
|
48
|
+
/** Options for category provisioning and reconciliation helpers. */
|
|
49
|
+
export interface CustomObjectCategoryMutationOptions {
|
|
50
|
+
/** Whether to apply the follow-up display-metadata update. Defaults to `true`. */
|
|
51
|
+
readonly updateDisplayMetadata?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates an immutable typed custom-object category definition.
|
|
55
|
+
*
|
|
56
|
+
* @param definition - Logical category metadata to normalize and freeze.
|
|
57
|
+
* @returns Immutable typed category definition with compiled API name.
|
|
58
|
+
* @typeParam TName - Logical category name supplied by the caller.
|
|
59
|
+
*/
|
|
60
|
+
export declare function defineCustomObjectCategory<TName extends string>(definition: CustomObjectCategoryDefinitionInput<TName>): Readonly<CustomObjectCategoryDefinition<LogicalCategoryName<TName>>>;
|
|
61
|
+
/**
|
|
62
|
+
* Builds the low-level create payload for an object category.
|
|
63
|
+
*
|
|
64
|
+
* @param definition - Typed category definition to compile.
|
|
65
|
+
* @returns REST create payload using the logical category name.
|
|
66
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildObjectCategoryCreateParams<TName extends LogicalCategoryName>(definition: CustomObjectCategoryDefinition<TName>): ObjectCategoryCreateParams;
|
|
69
|
+
/**
|
|
70
|
+
* Builds the low-level update payload for an object category.
|
|
71
|
+
*
|
|
72
|
+
* @param definition - Typed category definition to compile.
|
|
73
|
+
* @returns REST update payload using human-facing display metadata.
|
|
74
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildObjectCategoryUpdateParams<TName extends LogicalCategoryName>(definition: CustomObjectCategoryDefinition<TName>): ObjectCategoryUpdateParams;
|
|
77
|
+
/**
|
|
78
|
+
* Creates one typed custom-object category through the REST SDK.
|
|
79
|
+
*
|
|
80
|
+
* @param client - SDK client used to call the category APIs.
|
|
81
|
+
* @param definition - Typed category definition to provision.
|
|
82
|
+
* @param options - Provisioning behavior flags for display-metadata updates.
|
|
83
|
+
* @returns Frozen summary of the created and updated backend category DTOs.
|
|
84
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
85
|
+
*/
|
|
86
|
+
export declare function provisionCustomObjectCategoryDefinition<TName extends LogicalCategoryName>(client: RipplingSDK, definition: CustomObjectCategoryDefinition<TName>, options?: CustomObjectCategoryMutationOptions): Promise<ProvisionedCustomObjectCategory<TName>>;
|
|
87
|
+
/**
|
|
88
|
+
* Creates multiple typed custom-object categories through the REST SDK.
|
|
89
|
+
*
|
|
90
|
+
* @param client - SDK client used to call the category APIs.
|
|
91
|
+
* @param definitions - Typed category definitions to provision.
|
|
92
|
+
* @param options - Provisioning behavior flags shared across the batch.
|
|
93
|
+
* @returns Frozen batch of provisioning results in input order.
|
|
94
|
+
*/
|
|
95
|
+
export declare function provisionCustomObjectCategoryDefinitions(client: RipplingSDK, definitions: readonly CustomObjectCategoryDefinition[], options?: CustomObjectCategoryMutationOptions): Promise<readonly ProvisionedCustomObjectCategory[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Reconciles one typed category definition against the backend by name.
|
|
98
|
+
*
|
|
99
|
+
* @param client - SDK client used to call the category APIs.
|
|
100
|
+
* @param definition - Typed category definition to reconcile.
|
|
101
|
+
* @param options - Reconciliation behavior flags for display-metadata updates.
|
|
102
|
+
* @returns Frozen reconciliation result describing the final backend category state.
|
|
103
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
104
|
+
*/
|
|
105
|
+
export declare function reconcileCustomObjectCategoryDefinition<TName extends LogicalCategoryName>(client: RipplingSDK, definition: CustomObjectCategoryDefinition<TName>, options?: CustomObjectCategoryMutationOptions): Promise<ReconciledCustomObjectCategory<TName>>;
|
|
106
|
+
/**
|
|
107
|
+
* Reconciles multiple typed category definitions against the backend by name.
|
|
108
|
+
*
|
|
109
|
+
* @param client - SDK client used to call the category APIs.
|
|
110
|
+
* @param definitions - Typed category definitions to reconcile.
|
|
111
|
+
* @param options - Reconciliation behavior flags shared across the batch.
|
|
112
|
+
* @returns Frozen batch of reconciliation results in input order.
|
|
113
|
+
*/
|
|
114
|
+
export declare function reconcileCustomObjectCategoryDefinitions(client: RipplingSDK, definitions: readonly CustomObjectCategoryDefinition[], options?: CustomObjectCategoryMutationOptions): Promise<readonly ReconciledCustomObjectCategory[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Deletes a category that matches the typed definition's logical or display name.
|
|
117
|
+
*
|
|
118
|
+
* @param client - SDK client used to call the category APIs.
|
|
119
|
+
* @param definition - Typed category definition used to find the category to delete.
|
|
120
|
+
* @returns Whether a matching category existed and was deleted.
|
|
121
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
122
|
+
*/
|
|
123
|
+
export declare function deleteCustomObjectCategoryDefinition<TName extends LogicalCategoryName>(client: RipplingSDK, definition: CustomObjectCategoryDefinition<TName>): Promise<boolean>;
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=category.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.d.mts","sourceRoot":"","sources":["../../../src/core/platform/custom-objects/category.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAwB;AACnD,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC1B,0BAA0B,EAC3B,iDAA6C;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAgB;AAIpE;;;;GAIG;AACH,UAAU,mCAAmC,CAAC,KAAK,SAAS,MAAM;IAChE,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC1C,0DAA0D;IAC1D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,qCAAqC;IACrC,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C,CAAC,KAAK,SAAS,mBAAmB,EAC1F,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,8BAA8B,CAAC,KAAK,CAAC,GAChD,OAAO,CAAC,OAAO,CAAC,CAKlB"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { RipplingSDK } from "../../../client.js";
|
|
2
|
+
import type { ObjectCategory, ObjectCategoryCreateParams, ObjectCategoryUpdateParams } from "../../../resources/object-categories.js";
|
|
3
|
+
import type { CategoryApiName, LogicalCategoryName } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Author input accepted by {@link defineCustomObjectCategory}.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam TName - Logical category name supplied by the caller.
|
|
8
|
+
*/
|
|
9
|
+
interface CustomObjectCategoryDefinitionInput<TName extends string> {
|
|
10
|
+
/** Logical unsuffixed snake_case category name. */
|
|
11
|
+
readonly name: LogicalCategoryName<TName>;
|
|
12
|
+
/** Human-readable display name applied after creation. */
|
|
13
|
+
readonly displayName: string;
|
|
14
|
+
/** Optional category description. */
|
|
15
|
+
readonly description?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Immutable typed category definition used by provisioning and lifecycle helpers. */
|
|
18
|
+
export interface CustomObjectCategoryDefinition<TName extends LogicalCategoryName = LogicalCategoryName> {
|
|
19
|
+
/** Logical unsuffixed snake_case category name. */
|
|
20
|
+
readonly name: TName;
|
|
21
|
+
/** Compiled wire-level category api name. */
|
|
22
|
+
readonly apiName: CategoryApiName<TName>;
|
|
23
|
+
/** Human-readable display name. */
|
|
24
|
+
readonly displayName: string;
|
|
25
|
+
/** Optional category description. */
|
|
26
|
+
readonly description?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Result returned by category provisioning helpers. */
|
|
29
|
+
export interface ProvisionedCustomObjectCategory<TName extends LogicalCategoryName = LogicalCategoryName> {
|
|
30
|
+
/** Source typed category definition. */
|
|
31
|
+
readonly definition: CustomObjectCategoryDefinition<TName>;
|
|
32
|
+
/** Response returned by `client.objectCategories.create(...)`. */
|
|
33
|
+
readonly createdCategory: ObjectCategory;
|
|
34
|
+
/** Response returned by `client.objectCategories.update(...)`. */
|
|
35
|
+
readonly updatedCategory: ObjectCategory;
|
|
36
|
+
}
|
|
37
|
+
/** Lifecycle action emitted by category reconciliation helpers. */
|
|
38
|
+
export type CustomObjectCategoryLifecycleAction = 'created' | 'updated' | 'unchanged';
|
|
39
|
+
/** Result returned by category reconciliation helpers. */
|
|
40
|
+
export interface ReconciledCustomObjectCategory<TName extends LogicalCategoryName = LogicalCategoryName> {
|
|
41
|
+
/** Source typed category definition. */
|
|
42
|
+
readonly definition: CustomObjectCategoryDefinition<TName>;
|
|
43
|
+
/** Whether the remote category was created, updated, or already matched. */
|
|
44
|
+
readonly action: CustomObjectCategoryLifecycleAction;
|
|
45
|
+
/** Remote category after reconciliation. */
|
|
46
|
+
readonly category: ObjectCategory;
|
|
47
|
+
}
|
|
48
|
+
/** Options for category provisioning and reconciliation helpers. */
|
|
49
|
+
export interface CustomObjectCategoryMutationOptions {
|
|
50
|
+
/** Whether to apply the follow-up display-metadata update. Defaults to `true`. */
|
|
51
|
+
readonly updateDisplayMetadata?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates an immutable typed custom-object category definition.
|
|
55
|
+
*
|
|
56
|
+
* @param definition - Logical category metadata to normalize and freeze.
|
|
57
|
+
* @returns Immutable typed category definition with compiled API name.
|
|
58
|
+
* @typeParam TName - Logical category name supplied by the caller.
|
|
59
|
+
*/
|
|
60
|
+
export declare function defineCustomObjectCategory<TName extends string>(definition: CustomObjectCategoryDefinitionInput<TName>): Readonly<CustomObjectCategoryDefinition<LogicalCategoryName<TName>>>;
|
|
61
|
+
/**
|
|
62
|
+
* Builds the low-level create payload for an object category.
|
|
63
|
+
*
|
|
64
|
+
* @param definition - Typed category definition to compile.
|
|
65
|
+
* @returns REST create payload using the logical category name.
|
|
66
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildObjectCategoryCreateParams<TName extends LogicalCategoryName>(definition: CustomObjectCategoryDefinition<TName>): ObjectCategoryCreateParams;
|
|
69
|
+
/**
|
|
70
|
+
* Builds the low-level update payload for an object category.
|
|
71
|
+
*
|
|
72
|
+
* @param definition - Typed category definition to compile.
|
|
73
|
+
* @returns REST update payload using human-facing display metadata.
|
|
74
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildObjectCategoryUpdateParams<TName extends LogicalCategoryName>(definition: CustomObjectCategoryDefinition<TName>): ObjectCategoryUpdateParams;
|
|
77
|
+
/**
|
|
78
|
+
* Creates one typed custom-object category through the REST SDK.
|
|
79
|
+
*
|
|
80
|
+
* @param client - SDK client used to call the category APIs.
|
|
81
|
+
* @param definition - Typed category definition to provision.
|
|
82
|
+
* @param options - Provisioning behavior flags for display-metadata updates.
|
|
83
|
+
* @returns Frozen summary of the created and updated backend category DTOs.
|
|
84
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
85
|
+
*/
|
|
86
|
+
export declare function provisionCustomObjectCategoryDefinition<TName extends LogicalCategoryName>(client: RipplingSDK, definition: CustomObjectCategoryDefinition<TName>, options?: CustomObjectCategoryMutationOptions): Promise<ProvisionedCustomObjectCategory<TName>>;
|
|
87
|
+
/**
|
|
88
|
+
* Creates multiple typed custom-object categories through the REST SDK.
|
|
89
|
+
*
|
|
90
|
+
* @param client - SDK client used to call the category APIs.
|
|
91
|
+
* @param definitions - Typed category definitions to provision.
|
|
92
|
+
* @param options - Provisioning behavior flags shared across the batch.
|
|
93
|
+
* @returns Frozen batch of provisioning results in input order.
|
|
94
|
+
*/
|
|
95
|
+
export declare function provisionCustomObjectCategoryDefinitions(client: RipplingSDK, definitions: readonly CustomObjectCategoryDefinition[], options?: CustomObjectCategoryMutationOptions): Promise<readonly ProvisionedCustomObjectCategory[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Reconciles one typed category definition against the backend by name.
|
|
98
|
+
*
|
|
99
|
+
* @param client - SDK client used to call the category APIs.
|
|
100
|
+
* @param definition - Typed category definition to reconcile.
|
|
101
|
+
* @param options - Reconciliation behavior flags for display-metadata updates.
|
|
102
|
+
* @returns Frozen reconciliation result describing the final backend category state.
|
|
103
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
104
|
+
*/
|
|
105
|
+
export declare function reconcileCustomObjectCategoryDefinition<TName extends LogicalCategoryName>(client: RipplingSDK, definition: CustomObjectCategoryDefinition<TName>, options?: CustomObjectCategoryMutationOptions): Promise<ReconciledCustomObjectCategory<TName>>;
|
|
106
|
+
/**
|
|
107
|
+
* Reconciles multiple typed category definitions against the backend by name.
|
|
108
|
+
*
|
|
109
|
+
* @param client - SDK client used to call the category APIs.
|
|
110
|
+
* @param definitions - Typed category definitions to reconcile.
|
|
111
|
+
* @param options - Reconciliation behavior flags shared across the batch.
|
|
112
|
+
* @returns Frozen batch of reconciliation results in input order.
|
|
113
|
+
*/
|
|
114
|
+
export declare function reconcileCustomObjectCategoryDefinitions(client: RipplingSDK, definitions: readonly CustomObjectCategoryDefinition[], options?: CustomObjectCategoryMutationOptions): Promise<readonly ReconciledCustomObjectCategory[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Deletes a category that matches the typed definition's logical or display name.
|
|
117
|
+
*
|
|
118
|
+
* @param client - SDK client used to call the category APIs.
|
|
119
|
+
* @param definition - Typed category definition used to find the category to delete.
|
|
120
|
+
* @returns Whether a matching category existed and was deleted.
|
|
121
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
122
|
+
*/
|
|
123
|
+
export declare function deleteCustomObjectCategoryDefinition<TName extends LogicalCategoryName>(client: RipplingSDK, definition: CustomObjectCategoryDefinition<TName>): Promise<boolean>;
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../../src/core/platform/custom-objects/category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wBAAsB,uCAAuC,CAAC,KAAK,SAAS,mBAAmB,EAC7F,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,8BAA8B,CAAC,KAAK,CAAC,EACjD,OAAO,GAAE,mCAAwC,GAChD,OAAO,CAAC,8BAA8B,CAAC,KAAK,CAAC,CAAC,CAyBhD;AAED;;;;;;;GAOG;AACH,wBAAsB,wCAAwC,CAC5D,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,SAAS,8BAA8B,EAAE,EACtD,OAAO,GAAE,mCAAwC,GAChD,OAAO,CAAC,SAAS,8BAA8B,EAAE,CAAC,CAMpD;AAED;;;;;;;GAOG;AACH,wBAAsB,oCAAoC,CAAC,KAAK,SAAS,mBAAmB,EAC1F,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,8BAA8B,CAAC,KAAK,CAAC,GAChD,OAAO,CAAC,OAAO,CAAC,CAKlB"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineCustomObjectCategory = defineCustomObjectCategory;
|
|
4
|
+
exports.buildObjectCategoryCreateParams = buildObjectCategoryCreateParams;
|
|
5
|
+
exports.buildObjectCategoryUpdateParams = buildObjectCategoryUpdateParams;
|
|
6
|
+
exports.provisionCustomObjectCategoryDefinition = provisionCustomObjectCategoryDefinition;
|
|
7
|
+
exports.provisionCustomObjectCategoryDefinitions = provisionCustomObjectCategoryDefinitions;
|
|
8
|
+
exports.reconcileCustomObjectCategoryDefinition = reconcileCustomObjectCategoryDefinition;
|
|
9
|
+
exports.reconcileCustomObjectCategoryDefinitions = reconcileCustomObjectCategoryDefinitions;
|
|
10
|
+
exports.deleteCustomObjectCategoryDefinition = deleteCustomObjectCategoryDefinition;
|
|
11
|
+
const definition_1 = require("./definition.js");
|
|
12
|
+
const validation_1 = require("./validation.js");
|
|
13
|
+
/**
|
|
14
|
+
* Creates an immutable typed custom-object category definition.
|
|
15
|
+
*
|
|
16
|
+
* @param definition - Logical category metadata to normalize and freeze.
|
|
17
|
+
* @returns Immutable typed category definition with compiled API name.
|
|
18
|
+
* @typeParam TName - Logical category name supplied by the caller.
|
|
19
|
+
*/
|
|
20
|
+
function defineCustomObjectCategory(definition) {
|
|
21
|
+
(0, validation_1.validateLogicalCategoryName)(definition.name);
|
|
22
|
+
return Object.freeze({
|
|
23
|
+
name: definition.name,
|
|
24
|
+
apiName: (0, definition_1.toCustomCategoryApiName)(definition.name),
|
|
25
|
+
displayName: definition.displayName,
|
|
26
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Builds the low-level create payload for an object category.
|
|
31
|
+
*
|
|
32
|
+
* @param definition - Typed category definition to compile.
|
|
33
|
+
* @returns REST create payload using the logical category name.
|
|
34
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
35
|
+
*/
|
|
36
|
+
function buildObjectCategoryCreateParams(definition) {
|
|
37
|
+
return {
|
|
38
|
+
name: definition.name,
|
|
39
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Builds the low-level update payload for an object category.
|
|
44
|
+
*
|
|
45
|
+
* @param definition - Typed category definition to compile.
|
|
46
|
+
* @returns REST update payload using human-facing display metadata.
|
|
47
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
48
|
+
*/
|
|
49
|
+
function buildObjectCategoryUpdateParams(definition) {
|
|
50
|
+
return {
|
|
51
|
+
name: definition.displayName,
|
|
52
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Returns whether one public category DTO matches the typed category definition by currently visible names.
|
|
57
|
+
*
|
|
58
|
+
* @param category - Public category DTO returned by the REST API.
|
|
59
|
+
* @param definition - Typed category definition being matched.
|
|
60
|
+
* @returns Whether the visible name matches either the logical or display name.
|
|
61
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
62
|
+
*/
|
|
63
|
+
function isMatchingCategoryName(category, definition) {
|
|
64
|
+
return category.name === definition.name || category.name === definition.displayName;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Lists all public category DTOs that ambiguously or exactly match one typed definition.
|
|
68
|
+
*
|
|
69
|
+
* @param client - SDK client used to enumerate categories.
|
|
70
|
+
* @param definition - Typed category definition being matched.
|
|
71
|
+
* @returns Frozen list of public categories whose visible names match.
|
|
72
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
73
|
+
*/
|
|
74
|
+
async function listMatchingCategories(client, definition) {
|
|
75
|
+
const matches = [];
|
|
76
|
+
for await (const category of client.objectCategories.list()) {
|
|
77
|
+
if (isMatchingCategoryName(category, definition)) {
|
|
78
|
+
matches.push(category);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return Object.freeze(matches);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns the single public category matching one typed definition or throws when the match is ambiguous.
|
|
85
|
+
*
|
|
86
|
+
* @param client - SDK client used to enumerate categories.
|
|
87
|
+
* @param definition - Typed category definition being matched.
|
|
88
|
+
* @returns Matching public category, if any.
|
|
89
|
+
* @throws Error when multiple public categories match the visible names.
|
|
90
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
91
|
+
*/
|
|
92
|
+
async function getSingleMatchingCategory(client, definition) {
|
|
93
|
+
const matches = await listMatchingCategories(client, definition);
|
|
94
|
+
if (matches.length <= 1)
|
|
95
|
+
return matches[0];
|
|
96
|
+
throw new Error(`Ambiguous category match for "${definition.name}" / "${definition.displayName}". ` +
|
|
97
|
+
`Matched ids: ${matches.map((category) => category.id).join(', ')}.`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Creates one typed custom-object category through the REST SDK.
|
|
101
|
+
*
|
|
102
|
+
* @param client - SDK client used to call the category APIs.
|
|
103
|
+
* @param definition - Typed category definition to provision.
|
|
104
|
+
* @param options - Provisioning behavior flags for display-metadata updates.
|
|
105
|
+
* @returns Frozen summary of the created and updated backend category DTOs.
|
|
106
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
107
|
+
*/
|
|
108
|
+
async function provisionCustomObjectCategoryDefinition(client, definition, options = {}) {
|
|
109
|
+
const createdCategory = await client.objectCategories.create(buildObjectCategoryCreateParams(definition));
|
|
110
|
+
const updatedCategory = options.updateDisplayMetadata ?? true ?
|
|
111
|
+
await client.objectCategories.update(createdCategory.id, buildObjectCategoryUpdateParams(definition))
|
|
112
|
+
: createdCategory;
|
|
113
|
+
return Object.freeze({ definition, createdCategory, updatedCategory });
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Creates multiple typed custom-object categories through the REST SDK.
|
|
117
|
+
*
|
|
118
|
+
* @param client - SDK client used to call the category APIs.
|
|
119
|
+
* @param definitions - Typed category definitions to provision.
|
|
120
|
+
* @param options - Provisioning behavior flags shared across the batch.
|
|
121
|
+
* @returns Frozen batch of provisioning results in input order.
|
|
122
|
+
*/
|
|
123
|
+
async function provisionCustomObjectCategoryDefinitions(client, definitions, options = {}) {
|
|
124
|
+
const results = [];
|
|
125
|
+
for (const definition of definitions) {
|
|
126
|
+
results.push(await provisionCustomObjectCategoryDefinition(client, definition, options));
|
|
127
|
+
}
|
|
128
|
+
return Object.freeze(results);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Reconciles one typed category definition against the backend by name.
|
|
132
|
+
*
|
|
133
|
+
* @param client - SDK client used to call the category APIs.
|
|
134
|
+
* @param definition - Typed category definition to reconcile.
|
|
135
|
+
* @param options - Reconciliation behavior flags for display-metadata updates.
|
|
136
|
+
* @returns Frozen reconciliation result describing the final backend category state.
|
|
137
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
138
|
+
*/
|
|
139
|
+
async function reconcileCustomObjectCategoryDefinition(client, definition, options = {}) {
|
|
140
|
+
const existing = await getSingleMatchingCategory(client, definition);
|
|
141
|
+
if (existing == null) {
|
|
142
|
+
const provisioned = await provisionCustomObjectCategoryDefinition(client, definition, options);
|
|
143
|
+
return Object.freeze({
|
|
144
|
+
definition,
|
|
145
|
+
action: 'created',
|
|
146
|
+
category: provisioned.updatedCategory,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const shouldUpdate = (options.updateDisplayMetadata ?? true) &&
|
|
150
|
+
(existing.name !== definition.displayName ||
|
|
151
|
+
(existing.description ?? '') !== (definition.description ?? ''));
|
|
152
|
+
if (!shouldUpdate) {
|
|
153
|
+
return Object.freeze({ definition, action: 'unchanged', category: existing });
|
|
154
|
+
}
|
|
155
|
+
const updated = await client.objectCategories.update(existing.id, buildObjectCategoryUpdateParams(definition));
|
|
156
|
+
return Object.freeze({ definition, action: 'updated', category: updated });
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Reconciles multiple typed category definitions against the backend by name.
|
|
160
|
+
*
|
|
161
|
+
* @param client - SDK client used to call the category APIs.
|
|
162
|
+
* @param definitions - Typed category definitions to reconcile.
|
|
163
|
+
* @param options - Reconciliation behavior flags shared across the batch.
|
|
164
|
+
* @returns Frozen batch of reconciliation results in input order.
|
|
165
|
+
*/
|
|
166
|
+
async function reconcileCustomObjectCategoryDefinitions(client, definitions, options = {}) {
|
|
167
|
+
const results = [];
|
|
168
|
+
for (const definition of definitions) {
|
|
169
|
+
results.push(await reconcileCustomObjectCategoryDefinition(client, definition, options));
|
|
170
|
+
}
|
|
171
|
+
return Object.freeze(results);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Deletes a category that matches the typed definition's logical or display name.
|
|
175
|
+
*
|
|
176
|
+
* @param client - SDK client used to call the category APIs.
|
|
177
|
+
* @param definition - Typed category definition used to find the category to delete.
|
|
178
|
+
* @returns Whether a matching category existed and was deleted.
|
|
179
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
180
|
+
*/
|
|
181
|
+
async function deleteCustomObjectCategoryDefinition(client, definition) {
|
|
182
|
+
const existing = await getSingleMatchingCategory(client, definition);
|
|
183
|
+
if (existing == null)
|
|
184
|
+
return false;
|
|
185
|
+
await client.objectCategories.delete(existing.id);
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../../src/core/platform/custom-objects/category.ts"],"names":[],"mappings":";;AAwEA,gEAUC;AASD,0EAOC;AASD,0EAOC;AAqED,0FAYC;AAUD,4FAUC;AAWD,0FA6BC;AAUD,4FAUC;AAUD,oFAQC;AA9RD,gDAAuD;AACvD,gDAA2D;AAyD3D;;;;;;GAMG;AACH,SAAgB,0BAA0B,CACxC,UAAsD;IAEtD,IAAA,wCAA2B,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,OAAO,EAAE,IAAA,oCAAuB,EAAC,UAAU,CAAC,IAAI,CAAC;QACjD,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAyE,CAAC;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAC7C,UAAiD;IAEjD,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAC7C,UAAiD;IAEjD,OAAO;QACL,IAAI,E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AAU,CAAC,CAAC;IACrE,IAAI,QAAQ,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { toCustomCategoryApiName } from "./definition.mjs";
|
|
2
|
+
import { validateLogicalCategoryName } from "./validation.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Creates an immutable typed custom-object category definition.
|
|
5
|
+
*
|
|
6
|
+
* @param definition - Logical category metadata to normalize and freeze.
|
|
7
|
+
* @returns Immutable typed category definition with compiled API name.
|
|
8
|
+
* @typeParam TName - Logical category name supplied by the caller.
|
|
9
|
+
*/
|
|
10
|
+
export function defineCustomObjectCategory(definition) {
|
|
11
|
+
validateLogicalCategoryName(definition.name);
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
name: definition.name,
|
|
14
|
+
apiName: toCustomCategoryApiName(definition.name),
|
|
15
|
+
displayName: definition.displayName,
|
|
16
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Builds the low-level create payload for an object category.
|
|
21
|
+
*
|
|
22
|
+
* @param definition - Typed category definition to compile.
|
|
23
|
+
* @returns REST create payload using the logical category name.
|
|
24
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
25
|
+
*/
|
|
26
|
+
export function buildObjectCategoryCreateParams(definition) {
|
|
27
|
+
return {
|
|
28
|
+
name: definition.name,
|
|
29
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Builds the low-level update payload for an object category.
|
|
34
|
+
*
|
|
35
|
+
* @param definition - Typed category definition to compile.
|
|
36
|
+
* @returns REST update payload using human-facing display metadata.
|
|
37
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
38
|
+
*/
|
|
39
|
+
export function buildObjectCategoryUpdateParams(definition) {
|
|
40
|
+
return {
|
|
41
|
+
name: definition.displayName,
|
|
42
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns whether one public category DTO matches the typed category definition by currently visible names.
|
|
47
|
+
*
|
|
48
|
+
* @param category - Public category DTO returned by the REST API.
|
|
49
|
+
* @param definition - Typed category definition being matched.
|
|
50
|
+
* @returns Whether the visible name matches either the logical or display name.
|
|
51
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
52
|
+
*/
|
|
53
|
+
function isMatchingCategoryName(category, definition) {
|
|
54
|
+
return category.name === definition.name || category.name === definition.displayName;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Lists all public category DTOs that ambiguously or exactly match one typed definition.
|
|
58
|
+
*
|
|
59
|
+
* @param client - SDK client used to enumerate categories.
|
|
60
|
+
* @param definition - Typed category definition being matched.
|
|
61
|
+
* @returns Frozen list of public categories whose visible names match.
|
|
62
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
63
|
+
*/
|
|
64
|
+
async function listMatchingCategories(client, definition) {
|
|
65
|
+
const matches = [];
|
|
66
|
+
for await (const category of client.objectCategories.list()) {
|
|
67
|
+
if (isMatchingCategoryName(category, definition)) {
|
|
68
|
+
matches.push(category);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return Object.freeze(matches);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the single public category matching one typed definition or throws when the match is ambiguous.
|
|
75
|
+
*
|
|
76
|
+
* @param client - SDK client used to enumerate categories.
|
|
77
|
+
* @param definition - Typed category definition being matched.
|
|
78
|
+
* @returns Matching public category, if any.
|
|
79
|
+
* @throws Error when multiple public categories match the visible names.
|
|
80
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
81
|
+
*/
|
|
82
|
+
async function getSingleMatchingCategory(client, definition) {
|
|
83
|
+
const matches = await listMatchingCategories(client, definition);
|
|
84
|
+
if (matches.length <= 1)
|
|
85
|
+
return matches[0];
|
|
86
|
+
throw new Error(`Ambiguous category match for "${definition.name}" / "${definition.displayName}". ` +
|
|
87
|
+
`Matched ids: ${matches.map((category) => category.id).join(', ')}.`);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates one typed custom-object category through the REST SDK.
|
|
91
|
+
*
|
|
92
|
+
* @param client - SDK client used to call the category APIs.
|
|
93
|
+
* @param definition - Typed category definition to provision.
|
|
94
|
+
* @param options - Provisioning behavior flags for display-metadata updates.
|
|
95
|
+
* @returns Frozen summary of the created and updated backend category DTOs.
|
|
96
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
97
|
+
*/
|
|
98
|
+
export async function provisionCustomObjectCategoryDefinition(client, definition, options = {}) {
|
|
99
|
+
const createdCategory = await client.objectCategories.create(buildObjectCategoryCreateParams(definition));
|
|
100
|
+
const updatedCategory = options.updateDisplayMetadata ?? true ?
|
|
101
|
+
await client.objectCategories.update(createdCategory.id, buildObjectCategoryUpdateParams(definition))
|
|
102
|
+
: createdCategory;
|
|
103
|
+
return Object.freeze({ definition, createdCategory, updatedCategory });
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Creates multiple typed custom-object categories through the REST SDK.
|
|
107
|
+
*
|
|
108
|
+
* @param client - SDK client used to call the category APIs.
|
|
109
|
+
* @param definitions - Typed category definitions to provision.
|
|
110
|
+
* @param options - Provisioning behavior flags shared across the batch.
|
|
111
|
+
* @returns Frozen batch of provisioning results in input order.
|
|
112
|
+
*/
|
|
113
|
+
export async function provisionCustomObjectCategoryDefinitions(client, definitions, options = {}) {
|
|
114
|
+
const results = [];
|
|
115
|
+
for (const definition of definitions) {
|
|
116
|
+
results.push(await provisionCustomObjectCategoryDefinition(client, definition, options));
|
|
117
|
+
}
|
|
118
|
+
return Object.freeze(results);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Reconciles one typed category definition against the backend by name.
|
|
122
|
+
*
|
|
123
|
+
* @param client - SDK client used to call the category APIs.
|
|
124
|
+
* @param definition - Typed category definition to reconcile.
|
|
125
|
+
* @param options - Reconciliation behavior flags for display-metadata updates.
|
|
126
|
+
* @returns Frozen reconciliation result describing the final backend category state.
|
|
127
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
128
|
+
*/
|
|
129
|
+
export async function reconcileCustomObjectCategoryDefinition(client, definition, options = {}) {
|
|
130
|
+
const existing = await getSingleMatchingCategory(client, definition);
|
|
131
|
+
if (existing == null) {
|
|
132
|
+
const provisioned = await provisionCustomObjectCategoryDefinition(client, definition, options);
|
|
133
|
+
return Object.freeze({
|
|
134
|
+
definition,
|
|
135
|
+
action: 'created',
|
|
136
|
+
category: provisioned.updatedCategory,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
const shouldUpdate = (options.updateDisplayMetadata ?? true) &&
|
|
140
|
+
(existing.name !== definition.displayName ||
|
|
141
|
+
(existing.description ?? '') !== (definition.description ?? ''));
|
|
142
|
+
if (!shouldUpdate) {
|
|
143
|
+
return Object.freeze({ definition, action: 'unchanged', category: existing });
|
|
144
|
+
}
|
|
145
|
+
const updated = await client.objectCategories.update(existing.id, buildObjectCategoryUpdateParams(definition));
|
|
146
|
+
return Object.freeze({ definition, action: 'updated', category: updated });
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Reconciles multiple typed category definitions against the backend by name.
|
|
150
|
+
*
|
|
151
|
+
* @param client - SDK client used to call the category APIs.
|
|
152
|
+
* @param definitions - Typed category definitions to reconcile.
|
|
153
|
+
* @param options - Reconciliation behavior flags shared across the batch.
|
|
154
|
+
* @returns Frozen batch of reconciliation results in input order.
|
|
155
|
+
*/
|
|
156
|
+
export async function reconcileCustomObjectCategoryDefinitions(client, definitions, options = {}) {
|
|
157
|
+
const results = [];
|
|
158
|
+
for (const definition of definitions) {
|
|
159
|
+
results.push(await reconcileCustomObjectCategoryDefinition(client, definition, options));
|
|
160
|
+
}
|
|
161
|
+
return Object.freeze(results);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Deletes a category that matches the typed definition's logical or display name.
|
|
165
|
+
*
|
|
166
|
+
* @param client - SDK client used to call the category APIs.
|
|
167
|
+
* @param definition - Typed category definition used to find the category to delete.
|
|
168
|
+
* @returns Whether a matching category existed and was deleted.
|
|
169
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
170
|
+
*/
|
|
171
|
+
export async function deleteCustomObjectCategoryDefinition(client, definition) {
|
|
172
|
+
const existing = await getSingleMatchingCategory(client, definition);
|
|
173
|
+
if (existing == null)
|
|
174
|
+
return false;
|
|
175
|
+
await client.objectCategories.delete(existing.id);
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=category.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.mjs","sourceRoot":"","sources":["../../../src/core/platform/custom-objects/category.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,yBAAqB;AACvD,OAAO,EAAE,2BAA2B,EAAE,yBAAqB;AAyD3D;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,UAAsD;IAEtD,2BAA2B,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,OAAO,EAAE,uBAAuB,CAAC,UAAU,CAAC,IAAI,CAAC;QACjD,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAyE,CAAC;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CA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