@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.
Files changed (140) hide show
  1. package/core/platform/custom-objects/category.d.mts +125 -0
  2. package/core/platform/custom-objects/category.d.mts.map +1 -0
  3. package/core/platform/custom-objects/category.d.ts +125 -0
  4. package/core/platform/custom-objects/category.d.ts.map +1 -0
  5. package/core/platform/custom-objects/category.js +188 -0
  6. package/core/platform/custom-objects/category.js.map +1 -0
  7. package/core/platform/custom-objects/category.mjs +178 -0
  8. package/core/platform/custom-objects/category.mjs.map +1 -0
  9. package/core/platform/custom-objects/definition.d.mts +147 -0
  10. package/core/platform/custom-objects/definition.d.mts.map +1 -0
  11. package/core/platform/custom-objects/definition.d.ts +147 -0
  12. package/core/platform/custom-objects/definition.d.ts.map +1 -0
  13. package/core/platform/custom-objects/definition.js +200 -0
  14. package/core/platform/custom-objects/definition.js.map +1 -0
  15. package/core/platform/custom-objects/definition.mjs +190 -0
  16. package/core/platform/custom-objects/definition.mjs.map +1 -0
  17. package/core/platform/custom-objects/fields.d.mts +302 -0
  18. package/core/platform/custom-objects/fields.d.mts.map +1 -0
  19. package/core/platform/custom-objects/fields.d.ts +302 -0
  20. package/core/platform/custom-objects/fields.d.ts.map +1 -0
  21. package/core/platform/custom-objects/fields.js +369 -0
  22. package/core/platform/custom-objects/fields.js.map +1 -0
  23. package/core/platform/custom-objects/fields.mjs +347 -0
  24. package/core/platform/custom-objects/fields.mjs.map +1 -0
  25. package/core/platform/custom-objects/function-runtime.d.mts +42 -0
  26. package/core/platform/custom-objects/function-runtime.d.mts.map +1 -0
  27. package/core/platform/custom-objects/function-runtime.d.ts +42 -0
  28. package/core/platform/custom-objects/function-runtime.d.ts.map +1 -0
  29. package/core/platform/custom-objects/function-runtime.js +38 -0
  30. package/core/platform/custom-objects/function-runtime.js.map +1 -0
  31. package/core/platform/custom-objects/function-runtime.mjs +35 -0
  32. package/core/platform/custom-objects/function-runtime.mjs.map +1 -0
  33. package/core/platform/custom-objects/lifecycle.d.mts +83 -0
  34. package/core/platform/custom-objects/lifecycle.d.mts.map +1 -0
  35. package/core/platform/custom-objects/lifecycle.d.ts +83 -0
  36. package/core/platform/custom-objects/lifecycle.d.ts.map +1 -0
  37. package/core/platform/custom-objects/lifecycle.js +372 -0
  38. package/core/platform/custom-objects/lifecycle.js.map +1 -0
  39. package/core/platform/custom-objects/lifecycle.mjs +367 -0
  40. package/core/platform/custom-objects/lifecycle.mjs.map +1 -0
  41. package/core/platform/custom-objects/manager.d.mts +354 -0
  42. package/core/platform/custom-objects/manager.d.mts.map +1 -0
  43. package/core/platform/custom-objects/manager.d.ts +354 -0
  44. package/core/platform/custom-objects/manager.d.ts.map +1 -0
  45. package/core/platform/custom-objects/manager.js +646 -0
  46. package/core/platform/custom-objects/manager.js.map +1 -0
  47. package/core/platform/custom-objects/manager.mjs +637 -0
  48. package/core/platform/custom-objects/manager.mjs.map +1 -0
  49. package/core/platform/custom-objects/provisioning.d.mts +138 -0
  50. package/core/platform/custom-objects/provisioning.d.mts.map +1 -0
  51. package/core/platform/custom-objects/provisioning.d.ts +138 -0
  52. package/core/platform/custom-objects/provisioning.d.ts.map +1 -0
  53. package/core/platform/custom-objects/provisioning.js +455 -0
  54. package/core/platform/custom-objects/provisioning.js.map +1 -0
  55. package/core/platform/custom-objects/provisioning.mjs +447 -0
  56. package/core/platform/custom-objects/provisioning.mjs.map +1 -0
  57. package/core/platform/custom-objects/rql.d.mts +122 -0
  58. package/core/platform/custom-objects/rql.d.mts.map +1 -0
  59. package/core/platform/custom-objects/rql.d.ts +122 -0
  60. package/core/platform/custom-objects/rql.d.ts.map +1 -0
  61. package/core/platform/custom-objects/rql.js +225 -0
  62. package/core/platform/custom-objects/rql.js.map +1 -0
  63. package/core/platform/custom-objects/rql.mjs +222 -0
  64. package/core/platform/custom-objects/rql.mjs.map +1 -0
  65. package/core/platform/custom-objects/schema-manager.d.mts +203 -0
  66. package/core/platform/custom-objects/schema-manager.d.mts.map +1 -0
  67. package/core/platform/custom-objects/schema-manager.d.ts +203 -0
  68. package/core/platform/custom-objects/schema-manager.d.ts.map +1 -0
  69. package/core/platform/custom-objects/schema-manager.js +256 -0
  70. package/core/platform/custom-objects/schema-manager.js.map +1 -0
  71. package/core/platform/custom-objects/schema-manager.mjs +249 -0
  72. package/core/platform/custom-objects/schema-manager.mjs.map +1 -0
  73. package/core/platform/custom-objects/typed-rql.d.mts +157 -0
  74. package/core/platform/custom-objects/typed-rql.d.mts.map +1 -0
  75. package/core/platform/custom-objects/typed-rql.d.ts +157 -0
  76. package/core/platform/custom-objects/typed-rql.d.ts.map +1 -0
  77. package/core/platform/custom-objects/typed-rql.js +583 -0
  78. package/core/platform/custom-objects/typed-rql.js.map +1 -0
  79. package/core/platform/custom-objects/typed-rql.mjs +580 -0
  80. package/core/platform/custom-objects/typed-rql.mjs.map +1 -0
  81. package/core/platform/custom-objects/types.d.mts +549 -0
  82. package/core/platform/custom-objects/types.d.mts.map +1 -0
  83. package/core/platform/custom-objects/types.d.ts +549 -0
  84. package/core/platform/custom-objects/types.d.ts.map +1 -0
  85. package/core/platform/custom-objects/types.js +20 -0
  86. package/core/platform/custom-objects/types.js.map +1 -0
  87. package/core/platform/custom-objects/types.mjs +17 -0
  88. package/core/platform/custom-objects/types.mjs.map +1 -0
  89. package/core/platform/custom-objects/validation.d.mts +97 -0
  90. package/core/platform/custom-objects/validation.d.mts.map +1 -0
  91. package/core/platform/custom-objects/validation.d.ts +97 -0
  92. package/core/platform/custom-objects/validation.d.ts.map +1 -0
  93. package/core/platform/custom-objects/validation.js +477 -0
  94. package/core/platform/custom-objects/validation.js.map +1 -0
  95. package/core/platform/custom-objects/validation.mjs +465 -0
  96. package/core/platform/custom-objects/validation.mjs.map +1 -0
  97. package/core/platform/custom-objects.d.mts +67 -0
  98. package/core/platform/custom-objects.d.mts.map +1 -0
  99. package/core/platform/custom-objects.d.ts +67 -0
  100. package/core/platform/custom-objects.d.ts.map +1 -0
  101. package/core/platform/custom-objects.js +118 -0
  102. package/core/platform/custom-objects.js.map +1 -0
  103. package/core/platform/custom-objects.mjs +45 -0
  104. package/core/platform/custom-objects.mjs.map +1 -0
  105. package/package.json +1 -1
  106. package/resources/custom-objects/custom-objects.d.mts +7 -0
  107. package/resources/custom-objects/custom-objects.d.mts.map +1 -1
  108. package/resources/custom-objects/custom-objects.d.ts +7 -0
  109. package/resources/custom-objects/custom-objects.d.ts.map +1 -1
  110. package/resources/custom-objects/custom-objects.js.map +1 -1
  111. package/resources/custom-objects/custom-objects.mjs.map +1 -1
  112. package/resources/custom-objects/fields.d.mts +129 -54
  113. package/resources/custom-objects/fields.d.mts.map +1 -1
  114. package/resources/custom-objects/fields.d.ts +129 -54
  115. package/resources/custom-objects/fields.d.ts.map +1 -1
  116. package/resources/levels.d.mts +25 -4
  117. package/resources/levels.d.mts.map +1 -1
  118. package/resources/levels.d.ts +25 -4
  119. package/resources/levels.d.ts.map +1 -1
  120. package/src/core/platform/custom-objects/category.ts +294 -0
  121. package/src/core/platform/custom-objects/definition.ts +373 -0
  122. package/src/core/platform/custom-objects/fields.ts +653 -0
  123. package/src/core/platform/custom-objects/function-runtime.ts +76 -0
  124. package/src/core/platform/custom-objects/lifecycle.ts +557 -0
  125. package/src/core/platform/custom-objects/manager.ts +959 -0
  126. package/src/core/platform/custom-objects/provisioning.ts +672 -0
  127. package/src/core/platform/custom-objects/rql.ts +375 -0
  128. package/src/core/platform/custom-objects/schema-manager.ts +351 -0
  129. package/src/core/platform/custom-objects/typed-rql.ts +1273 -0
  130. package/src/core/platform/custom-objects/types.ts +753 -0
  131. package/src/core/platform/custom-objects/validation.ts +573 -0
  132. package/src/core/platform/custom-objects.ts +269 -0
  133. package/src/resources/custom-objects/custom-objects.ts +8 -0
  134. package/src/resources/custom-objects/fields.ts +192 -59
  135. package/src/resources/levels.ts +28 -4
  136. package/src/version.ts +1 -1
  137. package/version.d.mts +1 -1
  138. package/version.d.ts +1 -1
  139. package/version.js +1 -1
  140. package/version.mjs +1 -1
@@ -0,0 +1,138 @@
1
+ import type { RipplingSDK } from "../../../client.mjs";
2
+ import type { CustomObject, CustomObjectCreateParams, CustomObjectUpdateParams } from "../../../resources/custom-objects/custom-objects.mjs";
3
+ import type { CustomObjectField, CustomObjectNameFieldDetails, FieldCreateParams, FieldUpdateParams } from "../../../resources/custom-objects/fields.mjs";
4
+ import type { AnyCustomObjectDefinition, FieldNames } from "./types.mjs";
5
+ import type { CustomObjectCategoryDefinition } from "./category.mjs";
6
+ /**
7
+ * Provisioned custom-object summary returned by the SDK provisioning helpers.
8
+ *
9
+ * @typeParam TDefinition - Typed custom-object definition that was provisioned.
10
+ */
11
+ export interface ProvisionedCustomObject<TDefinition extends AnyCustomObjectDefinition = AnyCustomObjectDefinition> {
12
+ /** Logical object definition used as the source of truth. */
13
+ readonly definition: TDefinition;
14
+ /** Wire-level api name created on the backend. */
15
+ readonly customObjectApiName: TDefinition['apiName'];
16
+ /** Backend response returned by `client.customObjects.create(...)`. */
17
+ readonly createdObject: CustomObject;
18
+ /** Backend response returned by `client.customObjects.update(...)`. */
19
+ readonly updatedObject: CustomObject;
20
+ /** Optional response returned when the helper updates the platform-managed `name` field. */
21
+ readonly updatedNameField?: CustomObjectField;
22
+ /** Backend responses returned by field creation calls, keyed by logical field name. */
23
+ readonly createdFields: Readonly<Record<FieldNames<TDefinition>, CustomObjectField>>;
24
+ /** Backend responses returned by field update calls, keyed by logical field name. */
25
+ readonly updatedFields: Readonly<Record<FieldNames<TDefinition>, CustomObjectField>>;
26
+ }
27
+ /**
28
+ * Options for provisioning a single typed custom-object definition through the REST SDK.
29
+ *
30
+ * Assumptions baked into this helper:
31
+ * - custom-object `create` derives the immutable `api_name` from the submitted logical name
32
+ * - field `create` derives the immutable `api_name` from the submitted logical field name
33
+ * - follow-up `update` calls can safely set human-facing display labels without changing api names
34
+ */
35
+ export interface ProvisionCustomObjectOptions {
36
+ /**
37
+ * Optional typed category definition to create or update before provisioning the object.
38
+ */
39
+ readonly categoryDefinition?: CustomObjectCategoryDefinition;
40
+ /**
41
+ * Resolved custom-category id or native category id used by the live REST object APIs.
42
+ *
43
+ * Supply this when the definition does not embed a typed category definition.
44
+ */
45
+ readonly categoryIdentifier?: string;
46
+ /**
47
+ * Whether to issue the follow-up object update that applies the human-facing display name.
48
+ *
49
+ * Defaults to `true`.
50
+ */
51
+ readonly updateObjectDisplayMetadata?: boolean;
52
+ /**
53
+ * Whether to issue the follow-up field updates that apply human-facing display names.
54
+ *
55
+ * Defaults to `true`.
56
+ */
57
+ readonly updateFieldDisplayMetadata?: boolean;
58
+ /**
59
+ * Whether to update the platform-managed `name` field when the object definition uses autonumber metadata.
60
+ *
61
+ * Defaults to `true`.
62
+ */
63
+ readonly updateNameFieldDetails?: boolean;
64
+ }
65
+ /** Options for provisioning multiple custom-object definitions in one batch. */
66
+ export interface ProvisionCustomObjectsOptions extends Omit<ProvisionCustomObjectOptions, 'categoryDefinition' | 'categoryIdentifier'> {
67
+ /** Optional typed categories to ensure before creating the objects in this batch. */
68
+ readonly categoryDefinitions?: readonly CustomObjectCategoryDefinition[];
69
+ /**
70
+ * Resolved category ids keyed by object api name for definitions that do not embed a typed category definition.
71
+ */
72
+ readonly categoryIdentifiersByObjectApiName?: Readonly<Record<string, string>>;
73
+ }
74
+ /**
75
+ * Normalized field payload returned by the field-param builder helpers.
76
+ */
77
+ export interface ProvisionableFieldParams {
78
+ /** Payload passed to `client.customObjects.fields.create(...)`. */
79
+ readonly create: FieldCreateParams;
80
+ /** Payload passed to `client.customObjects.fields.update(...)`. */
81
+ readonly update: FieldUpdateParams;
82
+ }
83
+ /**
84
+ * Builds name-field metadata for REST field updates when the object uses autonumber names.
85
+ *
86
+ * @param definition - Typed object definition whose name-field metadata should be compiled.
87
+ * @returns Name-field metadata payload for the platform-managed `name` field, when needed.
88
+ * @typeParam TDefinition - Object definition being compiled.
89
+ */
90
+ export declare function buildCustomObjectNameFieldDetails<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition): CustomObjectNameFieldDetails | undefined;
91
+ /**
92
+ * Builds the object-creation payload for the low-level REST API using a resolved category id.
93
+ *
94
+ * @param definition - Typed object definition to compile.
95
+ * @param categoryIdentifier - Resolved custom-category id or native category id required by the live API.
96
+ * @returns REST object-create payload.
97
+ * @typeParam TDefinition - Object definition being compiled.
98
+ */
99
+ export declare function buildCustomObjectCreateParams<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition, categoryIdentifier: string): CustomObjectCreateParams;
100
+ /**
101
+ * Builds the object-update payload used to restore human-facing labels after creation.
102
+ *
103
+ * @param definition - Typed object definition to compile.
104
+ * @param categoryIdentifier - Resolved custom-category id or native category id required by the live API.
105
+ * @returns REST object-update payload.
106
+ * @typeParam TDefinition - Object definition being compiled.
107
+ */
108
+ export declare function buildCustomObjectUpdateParams<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition, categoryIdentifier: string): CustomObjectUpdateParams;
109
+ /**
110
+ * Builds field create/update payloads for one logical field in a typed object definition.
111
+ *
112
+ * @param definition - Typed object definition that owns the field.
113
+ * @param fieldName - Logical field name to compile.
114
+ * @returns Frozen create/update payload pair for the field.
115
+ * @typeParam TDefinition - Object definition being compiled.
116
+ * @typeParam TFieldName - Logical field name being compiled.
117
+ */
118
+ export declare function buildProvisionableFieldParams<TDefinition extends AnyCustomObjectDefinition, TFieldName extends FieldNames<TDefinition>>(definition: TDefinition, fieldName: TFieldName): ProvisionableFieldParams;
119
+ /**
120
+ * Creates one typed custom object through the REST SDK and returns the backend responses.
121
+ *
122
+ * @param client - SDK client used to call the metadata APIs.
123
+ * @param definition - Typed object definition to provision.
124
+ * @param options - Provisioning behavior flags for categories, display metadata, and name fields.
125
+ * @returns Frozen provisioning result describing the created object, fields, and optional name-field update.
126
+ * @typeParam TDefinition - Object definition being provisioned.
127
+ */
128
+ export declare function provisionCustomObjectDefinition<TDefinition extends AnyCustomObjectDefinition>(client: RipplingSDK, definition: TDefinition, options?: ProvisionCustomObjectOptions): Promise<ProvisionedCustomObject<TDefinition>>;
129
+ /**
130
+ * Provisions multiple typed custom-object definitions through the REST SDK.
131
+ *
132
+ * @param client - SDK client used to call the metadata APIs.
133
+ * @param definitions - Typed object definitions to provision.
134
+ * @param options - Batch provisioning behavior flags.
135
+ * @returns Frozen provisioning results in input order.
136
+ */
137
+ export declare function provisionCustomObjectDefinitions(client: RipplingSDK, definitions: readonly AnyCustomObjectDefinition[], options?: ProvisionCustomObjectsOptions): Promise<ReadonlyArray<ProvisionedCustomObject>>;
138
+ //# sourceMappingURL=provisioning.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provisioning.d.mts","sourceRoot":"","sources":["../../../src/core/platform/custom-objects/provisioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAwB;AACnD,OAAO,KAAK,EACV,YAAY,EACZ,wBAAwB,EACxB,wBAAwB,EACzB,6DAAyD;AAC1D,OAAO,KAAK,EACV,iBAAiB,EAEjB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EAClB,qDAAiD;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAsB,UAAU,EAAE,oBAAgB;AACzF,OAAO,KAAK,EAAE,8BAA8B,EAAE,uBAAmB;AAGjE;;;;GAIG;AACH,MAAM,WAAW,uBAAuB,CACtC,WAAW,SAAS,yBAAyB,GAAG,yBAAyB;IAEzE,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,kDAAkD;IAClD,QAAQ,CAAC,mBAAmB,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,uEAAuE;IACvE,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC;IACrC,uEAAuE;IACvE,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC;IACrC,4FAA4F;IAC5F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IAC9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;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,SAAS,yBAAyB,EACzF,UAAU,EAAE,WAAW,EACvB,kBAAkB,EAAE,MAAM,GACzB,wBAAwB,CAM1B;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,SAAS,yBAAyB,EACzF,UAAU,EAAE,WAAW,EACvB,kBAAkB,EAAE,MAAM,GACzB,wBAAwB,CAS1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,WAAW,SAAS,yBAAyB,EAC7C,UAAU,SAAS,UAAU,CAAC,WAAW,CAAC,EAC1C,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,GAAG,wBAAwB,CA+B1E;AAiLD;;;;;;;;GAQG;AACH,wBAAsB,+BAA+B,CAAC,WAAW,SAAS,yBAAyB,EACjG,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,WAAW,EACvB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAoC/C;AAED;;;;;;;GAOG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,SAAS,yBAAyB,EAAE,EACjD,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAuEjD"}
@@ -0,0 +1,138 @@
1
+ import type { RipplingSDK } from "../../../client.js";
2
+ import type { CustomObject, CustomObjectCreateParams, CustomObjectUpdateParams } from "../../../resources/custom-objects/custom-objects.js";
3
+ import type { CustomObjectField, CustomObjectNameFieldDetails, FieldCreateParams, FieldUpdateParams } from "../../../resources/custom-objects/fields.js";
4
+ import type { AnyCustomObjectDefinition, FieldNames } from "./types.js";
5
+ import type { CustomObjectCategoryDefinition } from "./category.js";
6
+ /**
7
+ * Provisioned custom-object summary returned by the SDK provisioning helpers.
8
+ *
9
+ * @typeParam TDefinition - Typed custom-object definition that was provisioned.
10
+ */
11
+ export interface ProvisionedCustomObject<TDefinition extends AnyCustomObjectDefinition = AnyCustomObjectDefinition> {
12
+ /** Logical object definition used as the source of truth. */
13
+ readonly definition: TDefinition;
14
+ /** Wire-level api name created on the backend. */
15
+ readonly customObjectApiName: TDefinition['apiName'];
16
+ /** Backend response returned by `client.customObjects.create(...)`. */
17
+ readonly createdObject: CustomObject;
18
+ /** Backend response returned by `client.customObjects.update(...)`. */
19
+ readonly updatedObject: CustomObject;
20
+ /** Optional response returned when the helper updates the platform-managed `name` field. */
21
+ readonly updatedNameField?: CustomObjectField;
22
+ /** Backend responses returned by field creation calls, keyed by logical field name. */
23
+ readonly createdFields: Readonly<Record<FieldNames<TDefinition>, CustomObjectField>>;
24
+ /** Backend responses returned by field update calls, keyed by logical field name. */
25
+ readonly updatedFields: Readonly<Record<FieldNames<TDefinition>, CustomObjectField>>;
26
+ }
27
+ /**
28
+ * Options for provisioning a single typed custom-object definition through the REST SDK.
29
+ *
30
+ * Assumptions baked into this helper:
31
+ * - custom-object `create` derives the immutable `api_name` from the submitted logical name
32
+ * - field `create` derives the immutable `api_name` from the submitted logical field name
33
+ * - follow-up `update` calls can safely set human-facing display labels without changing api names
34
+ */
35
+ export interface ProvisionCustomObjectOptions {
36
+ /**
37
+ * Optional typed category definition to create or update before provisioning the object.
38
+ */
39
+ readonly categoryDefinition?: CustomObjectCategoryDefinition;
40
+ /**
41
+ * Resolved custom-category id or native category id used by the live REST object APIs.
42
+ *
43
+ * Supply this when the definition does not embed a typed category definition.
44
+ */
45
+ readonly categoryIdentifier?: string;
46
+ /**
47
+ * Whether to issue the follow-up object update that applies the human-facing display name.
48
+ *
49
+ * Defaults to `true`.
50
+ */
51
+ readonly updateObjectDisplayMetadata?: boolean;
52
+ /**
53
+ * Whether to issue the follow-up field updates that apply human-facing display names.
54
+ *
55
+ * Defaults to `true`.
56
+ */
57
+ readonly updateFieldDisplayMetadata?: boolean;
58
+ /**
59
+ * Whether to update the platform-managed `name` field when the object definition uses autonumber metadata.
60
+ *
61
+ * Defaults to `true`.
62
+ */
63
+ readonly updateNameFieldDetails?: boolean;
64
+ }
65
+ /** Options for provisioning multiple custom-object definitions in one batch. */
66
+ export interface ProvisionCustomObjectsOptions extends Omit<ProvisionCustomObjectOptions, 'categoryDefinition' | 'categoryIdentifier'> {
67
+ /** Optional typed categories to ensure before creating the objects in this batch. */
68
+ readonly categoryDefinitions?: readonly CustomObjectCategoryDefinition[];
69
+ /**
70
+ * Resolved category ids keyed by object api name for definitions that do not embed a typed category definition.
71
+ */
72
+ readonly categoryIdentifiersByObjectApiName?: Readonly<Record<string, string>>;
73
+ }
74
+ /**
75
+ * Normalized field payload returned by the field-param builder helpers.
76
+ */
77
+ export interface ProvisionableFieldParams {
78
+ /** Payload passed to `client.customObjects.fields.create(...)`. */
79
+ readonly create: FieldCreateParams;
80
+ /** Payload passed to `client.customObjects.fields.update(...)`. */
81
+ readonly update: FieldUpdateParams;
82
+ }
83
+ /**
84
+ * Builds name-field metadata for REST field updates when the object uses autonumber names.
85
+ *
86
+ * @param definition - Typed object definition whose name-field metadata should be compiled.
87
+ * @returns Name-field metadata payload for the platform-managed `name` field, when needed.
88
+ * @typeParam TDefinition - Object definition being compiled.
89
+ */
90
+ export declare function buildCustomObjectNameFieldDetails<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition): CustomObjectNameFieldDetails | undefined;
91
+ /**
92
+ * Builds the object-creation payload for the low-level REST API using a resolved category id.
93
+ *
94
+ * @param definition - Typed object definition to compile.
95
+ * @param categoryIdentifier - Resolved custom-category id or native category id required by the live API.
96
+ * @returns REST object-create payload.
97
+ * @typeParam TDefinition - Object definition being compiled.
98
+ */
99
+ export declare function buildCustomObjectCreateParams<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition, categoryIdentifier: string): CustomObjectCreateParams;
100
+ /**
101
+ * Builds the object-update payload used to restore human-facing labels after creation.
102
+ *
103
+ * @param definition - Typed object definition to compile.
104
+ * @param categoryIdentifier - Resolved custom-category id or native category id required by the live API.
105
+ * @returns REST object-update payload.
106
+ * @typeParam TDefinition - Object definition being compiled.
107
+ */
108
+ export declare function buildCustomObjectUpdateParams<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition, categoryIdentifier: string): CustomObjectUpdateParams;
109
+ /**
110
+ * Builds field create/update payloads for one logical field in a typed object definition.
111
+ *
112
+ * @param definition - Typed object definition that owns the field.
113
+ * @param fieldName - Logical field name to compile.
114
+ * @returns Frozen create/update payload pair for the field.
115
+ * @typeParam TDefinition - Object definition being compiled.
116
+ * @typeParam TFieldName - Logical field name being compiled.
117
+ */
118
+ export declare function buildProvisionableFieldParams<TDefinition extends AnyCustomObjectDefinition, TFieldName extends FieldNames<TDefinition>>(definition: TDefinition, fieldName: TFieldName): ProvisionableFieldParams;
119
+ /**
120
+ * Creates one typed custom object through the REST SDK and returns the backend responses.
121
+ *
122
+ * @param client - SDK client used to call the metadata APIs.
123
+ * @param definition - Typed object definition to provision.
124
+ * @param options - Provisioning behavior flags for categories, display metadata, and name fields.
125
+ * @returns Frozen provisioning result describing the created object, fields, and optional name-field update.
126
+ * @typeParam TDefinition - Object definition being provisioned.
127
+ */
128
+ export declare function provisionCustomObjectDefinition<TDefinition extends AnyCustomObjectDefinition>(client: RipplingSDK, definition: TDefinition, options?: ProvisionCustomObjectOptions): Promise<ProvisionedCustomObject<TDefinition>>;
129
+ /**
130
+ * Provisions multiple typed custom-object definitions through the REST SDK.
131
+ *
132
+ * @param client - SDK client used to call the metadata APIs.
133
+ * @param definitions - Typed object definitions to provision.
134
+ * @param options - Batch provisioning behavior flags.
135
+ * @returns Frozen provisioning results in input order.
136
+ */
137
+ export declare function provisionCustomObjectDefinitions(client: RipplingSDK, definitions: readonly AnyCustomObjectDefinition[], options?: ProvisionCustomObjectsOptions): Promise<ReadonlyArray<ProvisionedCustomObject>>;
138
+ //# sourceMappingURL=provisioning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provisioning.d.ts","sourceRoot":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