@d19n/youfibre-odin-sdk 2.0.335 → 2.0.337

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 (79) hide show
  1. package/README.md +31 -2
  2. package/dist/EntityRegistry.d.ts +8 -0
  3. package/dist/EntityRegistry.js +8 -0
  4. package/dist/OdinApiClient.d.ts +16 -0
  5. package/dist/OdinApiClient.js +32 -0
  6. package/dist/OdinDbClient.d.ts +16 -0
  7. package/dist/OdinDbClient.js +32 -0
  8. package/dist/accessors-v2/QaAutoFailAccessor.d.ts +112 -0
  9. package/dist/accessors-v2/QaAutoFailAccessor.js +191 -0
  10. package/dist/accessors-v2/QaRubricAccessor.d.ts +112 -0
  11. package/dist/accessors-v2/QaRubricAccessor.js +191 -0
  12. package/dist/accessors-v2/QaRubricItemAccessor.d.ts +112 -0
  13. package/dist/accessors-v2/QaRubricItemAccessor.js +191 -0
  14. package/dist/accessors-v2/QaRubricSectionAccessor.d.ts +112 -0
  15. package/dist/accessors-v2/QaRubricSectionAccessor.js +191 -0
  16. package/dist/accessors-v2/index.d.ts +4 -0
  17. package/dist/accessors-v2/index.js +10 -2
  18. package/dist/actions-v2/CreateContactSalesAppDto.d.ts +2 -25
  19. package/dist/actions-v2/CreateInstallDayBeforeWifiEducationDto.d.ts +63 -0
  20. package/dist/actions-v2/CreateInstallDayBeforeWifiEducationDto.js +59 -0
  21. package/dist/actions-v2/CreateLeadSalesAppDto.d.ts +10 -2
  22. package/dist/actions-v2/CreateTransactionalEmailDto.d.ts +8 -1
  23. package/dist/actions-v2/UpdateQaAutoFailDto.d.ts +102 -0
  24. package/dist/actions-v2/UpdateQaAutoFailDto.js +56 -0
  25. package/dist/actions-v2/UpdateQaRubricDto.d.ts +103 -0
  26. package/dist/actions-v2/UpdateQaRubricDto.js +56 -0
  27. package/dist/actions-v2/UpdateQaRubricItemDto.d.ts +157 -0
  28. package/dist/actions-v2/UpdateQaRubricItemDto.js +56 -0
  29. package/dist/actions-v2/UpdateQaRubricSectionDto.d.ts +87 -0
  30. package/dist/actions-v2/UpdateQaRubricSectionDto.js +56 -0
  31. package/dist/api-sdk-v2/QaAutoFailApi.d.ts +48 -0
  32. package/dist/api-sdk-v2/QaAutoFailApi.js +155 -0
  33. package/dist/api-sdk-v2/QaRubricApi.d.ts +50 -0
  34. package/dist/api-sdk-v2/QaRubricApi.js +161 -0
  35. package/dist/api-sdk-v2/QaRubricItemApi.d.ts +48 -0
  36. package/dist/api-sdk-v2/QaRubricItemApi.js +155 -0
  37. package/dist/api-sdk-v2/QaRubricSectionApi.d.ts +50 -0
  38. package/dist/api-sdk-v2/QaRubricSectionApi.js +161 -0
  39. package/dist/db-accessors-v2/QaAutoFailDbAccessor.d.ts +180 -0
  40. package/dist/db-accessors-v2/QaAutoFailDbAccessor.js +265 -0
  41. package/dist/db-accessors-v2/QaRubricDbAccessor.d.ts +180 -0
  42. package/dist/db-accessors-v2/QaRubricDbAccessor.js +265 -0
  43. package/dist/db-accessors-v2/QaRubricItemDbAccessor.d.ts +180 -0
  44. package/dist/db-accessors-v2/QaRubricItemDbAccessor.js +265 -0
  45. package/dist/db-accessors-v2/QaRubricSectionDbAccessor.d.ts +180 -0
  46. package/dist/db-accessors-v2/QaRubricSectionDbAccessor.js +265 -0
  47. package/dist/db-accessors-v2/index.d.ts +4 -0
  48. package/dist/db-accessors-v2/index.js +10 -2
  49. package/dist/db-sdk-v2/QaAutoFailDb.d.ts +120 -0
  50. package/dist/db-sdk-v2/QaAutoFailDb.js +204 -0
  51. package/dist/db-sdk-v2/QaRubricDb.d.ts +122 -0
  52. package/dist/db-sdk-v2/QaRubricDb.js +210 -0
  53. package/dist/db-sdk-v2/QaRubricItemDb.d.ts +120 -0
  54. package/dist/db-sdk-v2/QaRubricItemDb.js +204 -0
  55. package/dist/db-sdk-v2/QaRubricSectionDb.d.ts +122 -0
  56. package/dist/db-sdk-v2/QaRubricSectionDb.js +210 -0
  57. package/dist/entities-v2/QaAutoFail.d.ts +117 -0
  58. package/dist/entities-v2/QaAutoFail.js +76 -0
  59. package/dist/entities-v2/QaReport.d.ts +41 -1
  60. package/dist/entities-v2/QaReport.js +10 -0
  61. package/dist/entities-v2/QaRubric.d.ts +152 -0
  62. package/dist/entities-v2/QaRubric.js +114 -0
  63. package/dist/entities-v2/QaRubricItem.d.ts +199 -0
  64. package/dist/entities-v2/QaRubricItem.js +110 -0
  65. package/dist/entities-v2/QaRubricSection.d.ts +108 -0
  66. package/dist/entities-v2/QaRubricSection.js +76 -0
  67. package/dist/records-v2/EmailRecord.d.ts +29 -0
  68. package/dist/records-v2/EmailRecord.js +36 -0
  69. package/dist/records-v2/QaAutoFailRecord.d.ts +205 -0
  70. package/dist/records-v2/QaAutoFailRecord.js +275 -0
  71. package/dist/records-v2/QaRubricItemRecord.d.ts +205 -0
  72. package/dist/records-v2/QaRubricItemRecord.js +275 -0
  73. package/dist/records-v2/QaRubricRecord.d.ts +225 -0
  74. package/dist/records-v2/QaRubricRecord.js +308 -0
  75. package/dist/records-v2/QaRubricSectionRecord.d.ts +225 -0
  76. package/dist/records-v2/QaRubricSectionRecord.js +308 -0
  77. package/dist/records-v2/index.d.ts +4 -0
  78. package/dist/records-v2/index.js +13 -1
  79. package/package.json +1 -1
@@ -0,0 +1,112 @@
1
+ /**
2
+ * QaRubric Accessor
3
+ *
4
+ * Provides typed access to QaRubric records via API.
5
+ * Returns wrapped records with typed action methods.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // Get existing record
10
+ * const record = await accessor.get(id);
11
+ * await record.updateQaRubric({ ... });
12
+ *
13
+ * // Create new record
14
+ * const newRecord = accessor.new();
15
+ * await newRecord.createQaRubric({ ... });
16
+ * ```
17
+ *
18
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
19
+ */
20
+ import { OdinSearchV2 } from '@d19n/odin-types/dist/core';
21
+ import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
22
+ import { OauthParams } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
23
+ import { QueryBuilder } from '@d19n/odin-sdk-generator/dist/query-builder';
24
+ import { QaRubricProperties } from '../entities-v2/QaRubric';
25
+ import { QaRubricRecord } from '../records-v2/QaRubricRecord';
26
+ /** List response with wrapped records */
27
+ export interface QaRubricListResponse {
28
+ data: QaRubricRecord[];
29
+ hasMore: boolean;
30
+ totalRecords: number;
31
+ }
32
+ /** Search response with wrapped records */
33
+ export interface QaRubricSearchResponse {
34
+ records: QaRubricRecord[];
35
+ totalRecords: number;
36
+ hasMore: boolean;
37
+ aggregations?: Record<string, any>;
38
+ }
39
+ export declare class QaRubricAccessor {
40
+ private readonly _provider;
41
+ private readonly _moduleName;
42
+ private readonly _entityName;
43
+ constructor(provider: ApiProvider);
44
+ constructor(authParams: OauthParams);
45
+ constructor(authToken: string, host?: string);
46
+ get moduleName(): string;
47
+ get entityName(): string;
48
+ /**
49
+ * Create a new empty QaRubric record instance for create operations.
50
+ * Pre-generates an ID that can be referenced before the record is saved.
51
+ *
52
+ * @param id - Optional ID to use (auto-generated UUID if not provided)
53
+ * @returns A new record wrapper with pre-generated ID
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * // Auto-generated ID
58
+ * const note = odinClient.notes.new();
59
+ * console.log(note.id); // UUID available immediately
60
+ *
61
+ * // Custom ID
62
+ * const order = odinClient.orders.new("custom-id-123");
63
+ *
64
+ * // Reference ID before save
65
+ * const account = odinClient.accounts.new();
66
+ * const contact = odinClient.contacts.new();
67
+ * await contact
68
+ * .link({ id: account.id, entity: "CrmModule:Account" })
69
+ * .createContact({ FirstName: "John" });
70
+ * ```
71
+ */
72
+ new(id?: string): QaRubricRecord;
73
+ /**
74
+ * Get a single QaRubric record by ID
75
+ */
76
+ get(id: string): Promise<QaRubricRecord>;
77
+ /**
78
+ * Get multiple QaRubric records by IDs
79
+ */
80
+ getMany(ids: string[]): Promise<QaRubricRecord[]>;
81
+ /**
82
+ * Search QaRubric records
83
+ */
84
+ search(params: Partial<OdinSearchV2>): Promise<QaRubricSearchResponse>;
85
+ /**
86
+ * Search all QaRubric records with automatic pagination
87
+ */
88
+ searchAll(params: Partial<OdinSearchV2>): Promise<QaRubricRecord[]>;
89
+ /**
90
+ * Async generator for paginating through all matching records.
91
+ * Yields batches of wrapped records.
92
+ */
93
+ paginate(params: Partial<OdinSearchV2>): AsyncGenerator<QaRubricRecord[]>;
94
+ /**
95
+ * Create a fluent query builder for QaRubric records
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * const results = await accessor
100
+ * .query()
101
+ * .where('Status', 'in', ['Active', 'Pending'])
102
+ * .where('CreatedAt', 'gte', '2025-01-01')
103
+ * .select('id', 'title', 'properties.*')
104
+ * .sortBy('createdAt', 'desc')
105
+ * .limit(100)
106
+ * .execute();
107
+ * ```
108
+ */
109
+ query(): QueryBuilder<QaRubricProperties, QaRubricRecord>;
110
+ /** Access the underlying ApiProvider */
111
+ get provider(): ApiProvider;
112
+ }
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+ /**
3
+ * QaRubric Accessor
4
+ *
5
+ * Provides typed access to QaRubric records via API.
6
+ * Returns wrapped records with typed action methods.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Get existing record
11
+ * const record = await accessor.get(id);
12
+ * await record.updateQaRubric({ ... });
13
+ *
14
+ * // Create new record
15
+ * const newRecord = accessor.new();
16
+ * await newRecord.createQaRubric({ ... });
17
+ * ```
18
+ *
19
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
20
+ */
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
31
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
32
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
33
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
34
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
35
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
36
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
37
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
38
+ function fulfill(value) { resume("next", value); }
39
+ function reject(value) { resume("throw", value); }
40
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
41
+ };
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.QaRubricAccessor = void 0;
44
+ const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
45
+ const query_builder_1 = require("@d19n/odin-sdk-generator/dist/query-builder");
46
+ const QaRubricRecord_1 = require("../records-v2/QaRubricRecord");
47
+ class QaRubricAccessor {
48
+ constructor(providerOrAuth, host) {
49
+ this._moduleName = 'SupportModule';
50
+ this._entityName = 'QaRubric';
51
+ if (providerOrAuth instanceof api_provider_1.ApiProvider) {
52
+ this._provider = providerOrAuth;
53
+ }
54
+ else if (typeof providerOrAuth === 'string') {
55
+ // Auth token provided
56
+ this._provider = new api_provider_1.ApiProvider(host ? { host } : undefined, providerOrAuth);
57
+ }
58
+ else {
59
+ // OauthParams provided
60
+ this._provider = new api_provider_1.ApiProvider(providerOrAuth);
61
+ }
62
+ }
63
+ get moduleName() { return this._moduleName; }
64
+ get entityName() { return this._entityName; }
65
+ // ============================================
66
+ // RECORD CREATION
67
+ // ============================================
68
+ /**
69
+ * Create a new empty QaRubric record instance for create operations.
70
+ * Pre-generates an ID that can be referenced before the record is saved.
71
+ *
72
+ * @param id - Optional ID to use (auto-generated UUID if not provided)
73
+ * @returns A new record wrapper with pre-generated ID
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * // Auto-generated ID
78
+ * const note = odinClient.notes.new();
79
+ * console.log(note.id); // UUID available immediately
80
+ *
81
+ * // Custom ID
82
+ * const order = odinClient.orders.new("custom-id-123");
83
+ *
84
+ * // Reference ID before save
85
+ * const account = odinClient.accounts.new();
86
+ * const contact = odinClient.contacts.new();
87
+ * await contact
88
+ * .link({ id: account.id, entity: "CrmModule:Account" })
89
+ * .createContact({ FirstName: "John" });
90
+ * ```
91
+ */
92
+ new(id) {
93
+ return new QaRubricRecord_1.QaRubricRecord(null, this._provider, id);
94
+ }
95
+ // ============================================
96
+ // RECORD RETRIEVAL
97
+ // ============================================
98
+ /**
99
+ * Get a single QaRubric record by ID
100
+ */
101
+ get(id) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ const record = yield this._provider._getByPrimaryKey(this._moduleName, this._entityName, id);
104
+ return new QaRubricRecord_1.QaRubricRecord(record, this._provider);
105
+ });
106
+ }
107
+ /**
108
+ * Get multiple QaRubric records by IDs
109
+ */
110
+ getMany(ids) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ if (ids.length === 0)
113
+ return [];
114
+ const records = yield this._provider._getManyByPrimaryKey(this._moduleName, this._entityName, ids);
115
+ return records.map((r) => new QaRubricRecord_1.QaRubricRecord(r, this._provider));
116
+ });
117
+ }
118
+ // ============================================
119
+ // SEARCH OPERATIONS
120
+ // ============================================
121
+ /**
122
+ * Search QaRubric records
123
+ */
124
+ search(params) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ const result = yield this._provider._searchRecords(this._moduleName, this._entityName, params);
127
+ return {
128
+ records: result.records.map((r) => new QaRubricRecord_1.QaRubricRecord(r, this._provider)),
129
+ totalRecords: result.totalRecords,
130
+ hasMore: result.hasMore,
131
+ aggregations: result.aggregations,
132
+ };
133
+ });
134
+ }
135
+ /**
136
+ * Search all QaRubric records with automatic pagination
137
+ */
138
+ searchAll(params) {
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ const result = yield this._provider._searchAllRecordsAndPaginate(this._moduleName, this._entityName, params);
141
+ return result.records.map((r) => new QaRubricRecord_1.QaRubricRecord(r, this._provider));
142
+ });
143
+ }
144
+ /**
145
+ * Async generator for paginating through all matching records.
146
+ * Yields batches of wrapped records.
147
+ */
148
+ paginate(params) {
149
+ var _a;
150
+ return __asyncGenerator(this, arguments, function* paginate_1() {
151
+ let hasMore = true;
152
+ let searchAfter;
153
+ const query = Object.assign(Object.assign({}, params.query), { pageSize: ((_a = params.query) === null || _a === void 0 ? void 0 : _a.pageSize) || 500 });
154
+ while (hasMore) {
155
+ const result = yield __await(this._provider._searchRecords(this._moduleName, this._entityName, Object.assign(Object.assign({}, params), { query: Object.assign(Object.assign({}, query), { searchAfter }) })));
156
+ if (result.records.length > 0) {
157
+ yield yield __await(result.records.map((r) => new QaRubricRecord_1.QaRubricRecord(r, this._provider)));
158
+ const lastRecord = result.records[result.records.length - 1];
159
+ searchAfter = lastRecord === null || lastRecord === void 0 ? void 0 : lastRecord.sort;
160
+ }
161
+ hasMore = result.hasMore && result.records.length >= query.pageSize;
162
+ }
163
+ });
164
+ }
165
+ // ============================================
166
+ // QUERY BUILDER
167
+ // ============================================
168
+ /**
169
+ * Create a fluent query builder for QaRubric records
170
+ *
171
+ * @example
172
+ * ```typescript
173
+ * const results = await accessor
174
+ * .query()
175
+ * .where('Status', 'in', ['Active', 'Pending'])
176
+ * .where('CreatedAt', 'gte', '2025-01-01')
177
+ * .select('id', 'title', 'properties.*')
178
+ * .sortBy('createdAt', 'desc')
179
+ * .limit(100)
180
+ * .execute();
181
+ * ```
182
+ */
183
+ query() {
184
+ return (0, query_builder_1.createQueryBuilder)(this);
185
+ }
186
+ /** Access the underlying ApiProvider */
187
+ get provider() {
188
+ return this._provider;
189
+ }
190
+ }
191
+ exports.QaRubricAccessor = QaRubricAccessor;
@@ -0,0 +1,112 @@
1
+ /**
2
+ * QaRubricItem Accessor
3
+ *
4
+ * Provides typed access to QaRubricItem records via API.
5
+ * Returns wrapped records with typed action methods.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // Get existing record
10
+ * const record = await accessor.get(id);
11
+ * await record.updateQaRubricItem({ ... });
12
+ *
13
+ * // Create new record
14
+ * const newRecord = accessor.new();
15
+ * await newRecord.createQaRubricItem({ ... });
16
+ * ```
17
+ *
18
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
19
+ */
20
+ import { OdinSearchV2 } from '@d19n/odin-types/dist/core';
21
+ import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
22
+ import { OauthParams } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
23
+ import { QueryBuilder } from '@d19n/odin-sdk-generator/dist/query-builder';
24
+ import { QaRubricItemProperties } from '../entities-v2/QaRubricItem';
25
+ import { QaRubricItemRecord } from '../records-v2/QaRubricItemRecord';
26
+ /** List response with wrapped records */
27
+ export interface QaRubricItemListResponse {
28
+ data: QaRubricItemRecord[];
29
+ hasMore: boolean;
30
+ totalRecords: number;
31
+ }
32
+ /** Search response with wrapped records */
33
+ export interface QaRubricItemSearchResponse {
34
+ records: QaRubricItemRecord[];
35
+ totalRecords: number;
36
+ hasMore: boolean;
37
+ aggregations?: Record<string, any>;
38
+ }
39
+ export declare class QaRubricItemAccessor {
40
+ private readonly _provider;
41
+ private readonly _moduleName;
42
+ private readonly _entityName;
43
+ constructor(provider: ApiProvider);
44
+ constructor(authParams: OauthParams);
45
+ constructor(authToken: string, host?: string);
46
+ get moduleName(): string;
47
+ get entityName(): string;
48
+ /**
49
+ * Create a new empty QaRubricItem record instance for create operations.
50
+ * Pre-generates an ID that can be referenced before the record is saved.
51
+ *
52
+ * @param id - Optional ID to use (auto-generated UUID if not provided)
53
+ * @returns A new record wrapper with pre-generated ID
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * // Auto-generated ID
58
+ * const note = odinClient.notes.new();
59
+ * console.log(note.id); // UUID available immediately
60
+ *
61
+ * // Custom ID
62
+ * const order = odinClient.orders.new("custom-id-123");
63
+ *
64
+ * // Reference ID before save
65
+ * const account = odinClient.accounts.new();
66
+ * const contact = odinClient.contacts.new();
67
+ * await contact
68
+ * .link({ id: account.id, entity: "CrmModule:Account" })
69
+ * .createContact({ FirstName: "John" });
70
+ * ```
71
+ */
72
+ new(id?: string): QaRubricItemRecord;
73
+ /**
74
+ * Get a single QaRubricItem record by ID
75
+ */
76
+ get(id: string): Promise<QaRubricItemRecord>;
77
+ /**
78
+ * Get multiple QaRubricItem records by IDs
79
+ */
80
+ getMany(ids: string[]): Promise<QaRubricItemRecord[]>;
81
+ /**
82
+ * Search QaRubricItem records
83
+ */
84
+ search(params: Partial<OdinSearchV2>): Promise<QaRubricItemSearchResponse>;
85
+ /**
86
+ * Search all QaRubricItem records with automatic pagination
87
+ */
88
+ searchAll(params: Partial<OdinSearchV2>): Promise<QaRubricItemRecord[]>;
89
+ /**
90
+ * Async generator for paginating through all matching records.
91
+ * Yields batches of wrapped records.
92
+ */
93
+ paginate(params: Partial<OdinSearchV2>): AsyncGenerator<QaRubricItemRecord[]>;
94
+ /**
95
+ * Create a fluent query builder for QaRubricItem records
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * const results = await accessor
100
+ * .query()
101
+ * .where('Status', 'in', ['Active', 'Pending'])
102
+ * .where('CreatedAt', 'gte', '2025-01-01')
103
+ * .select('id', 'title', 'properties.*')
104
+ * .sortBy('createdAt', 'desc')
105
+ * .limit(100)
106
+ * .execute();
107
+ * ```
108
+ */
109
+ query(): QueryBuilder<QaRubricItemProperties, QaRubricItemRecord>;
110
+ /** Access the underlying ApiProvider */
111
+ get provider(): ApiProvider;
112
+ }
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+ /**
3
+ * QaRubricItem Accessor
4
+ *
5
+ * Provides typed access to QaRubricItem records via API.
6
+ * Returns wrapped records with typed action methods.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Get existing record
11
+ * const record = await accessor.get(id);
12
+ * await record.updateQaRubricItem({ ... });
13
+ *
14
+ * // Create new record
15
+ * const newRecord = accessor.new();
16
+ * await newRecord.createQaRubricItem({ ... });
17
+ * ```
18
+ *
19
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
20
+ */
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
31
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
32
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
33
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
34
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
35
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
36
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
37
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
38
+ function fulfill(value) { resume("next", value); }
39
+ function reject(value) { resume("throw", value); }
40
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
41
+ };
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.QaRubricItemAccessor = void 0;
44
+ const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
45
+ const query_builder_1 = require("@d19n/odin-sdk-generator/dist/query-builder");
46
+ const QaRubricItemRecord_1 = require("../records-v2/QaRubricItemRecord");
47
+ class QaRubricItemAccessor {
48
+ constructor(providerOrAuth, host) {
49
+ this._moduleName = 'SupportModule';
50
+ this._entityName = 'QaRubricItem';
51
+ if (providerOrAuth instanceof api_provider_1.ApiProvider) {
52
+ this._provider = providerOrAuth;
53
+ }
54
+ else if (typeof providerOrAuth === 'string') {
55
+ // Auth token provided
56
+ this._provider = new api_provider_1.ApiProvider(host ? { host } : undefined, providerOrAuth);
57
+ }
58
+ else {
59
+ // OauthParams provided
60
+ this._provider = new api_provider_1.ApiProvider(providerOrAuth);
61
+ }
62
+ }
63
+ get moduleName() { return this._moduleName; }
64
+ get entityName() { return this._entityName; }
65
+ // ============================================
66
+ // RECORD CREATION
67
+ // ============================================
68
+ /**
69
+ * Create a new empty QaRubricItem record instance for create operations.
70
+ * Pre-generates an ID that can be referenced before the record is saved.
71
+ *
72
+ * @param id - Optional ID to use (auto-generated UUID if not provided)
73
+ * @returns A new record wrapper with pre-generated ID
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * // Auto-generated ID
78
+ * const note = odinClient.notes.new();
79
+ * console.log(note.id); // UUID available immediately
80
+ *
81
+ * // Custom ID
82
+ * const order = odinClient.orders.new("custom-id-123");
83
+ *
84
+ * // Reference ID before save
85
+ * const account = odinClient.accounts.new();
86
+ * const contact = odinClient.contacts.new();
87
+ * await contact
88
+ * .link({ id: account.id, entity: "CrmModule:Account" })
89
+ * .createContact({ FirstName: "John" });
90
+ * ```
91
+ */
92
+ new(id) {
93
+ return new QaRubricItemRecord_1.QaRubricItemRecord(null, this._provider, id);
94
+ }
95
+ // ============================================
96
+ // RECORD RETRIEVAL
97
+ // ============================================
98
+ /**
99
+ * Get a single QaRubricItem record by ID
100
+ */
101
+ get(id) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ const record = yield this._provider._getByPrimaryKey(this._moduleName, this._entityName, id);
104
+ return new QaRubricItemRecord_1.QaRubricItemRecord(record, this._provider);
105
+ });
106
+ }
107
+ /**
108
+ * Get multiple QaRubricItem records by IDs
109
+ */
110
+ getMany(ids) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ if (ids.length === 0)
113
+ return [];
114
+ const records = yield this._provider._getManyByPrimaryKey(this._moduleName, this._entityName, ids);
115
+ return records.map((r) => new QaRubricItemRecord_1.QaRubricItemRecord(r, this._provider));
116
+ });
117
+ }
118
+ // ============================================
119
+ // SEARCH OPERATIONS
120
+ // ============================================
121
+ /**
122
+ * Search QaRubricItem records
123
+ */
124
+ search(params) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ const result = yield this._provider._searchRecords(this._moduleName, this._entityName, params);
127
+ return {
128
+ records: result.records.map((r) => new QaRubricItemRecord_1.QaRubricItemRecord(r, this._provider)),
129
+ totalRecords: result.totalRecords,
130
+ hasMore: result.hasMore,
131
+ aggregations: result.aggregations,
132
+ };
133
+ });
134
+ }
135
+ /**
136
+ * Search all QaRubricItem records with automatic pagination
137
+ */
138
+ searchAll(params) {
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ const result = yield this._provider._searchAllRecordsAndPaginate(this._moduleName, this._entityName, params);
141
+ return result.records.map((r) => new QaRubricItemRecord_1.QaRubricItemRecord(r, this._provider));
142
+ });
143
+ }
144
+ /**
145
+ * Async generator for paginating through all matching records.
146
+ * Yields batches of wrapped records.
147
+ */
148
+ paginate(params) {
149
+ var _a;
150
+ return __asyncGenerator(this, arguments, function* paginate_1() {
151
+ let hasMore = true;
152
+ let searchAfter;
153
+ const query = Object.assign(Object.assign({}, params.query), { pageSize: ((_a = params.query) === null || _a === void 0 ? void 0 : _a.pageSize) || 500 });
154
+ while (hasMore) {
155
+ const result = yield __await(this._provider._searchRecords(this._moduleName, this._entityName, Object.assign(Object.assign({}, params), { query: Object.assign(Object.assign({}, query), { searchAfter }) })));
156
+ if (result.records.length > 0) {
157
+ yield yield __await(result.records.map((r) => new QaRubricItemRecord_1.QaRubricItemRecord(r, this._provider)));
158
+ const lastRecord = result.records[result.records.length - 1];
159
+ searchAfter = lastRecord === null || lastRecord === void 0 ? void 0 : lastRecord.sort;
160
+ }
161
+ hasMore = result.hasMore && result.records.length >= query.pageSize;
162
+ }
163
+ });
164
+ }
165
+ // ============================================
166
+ // QUERY BUILDER
167
+ // ============================================
168
+ /**
169
+ * Create a fluent query builder for QaRubricItem records
170
+ *
171
+ * @example
172
+ * ```typescript
173
+ * const results = await accessor
174
+ * .query()
175
+ * .where('Status', 'in', ['Active', 'Pending'])
176
+ * .where('CreatedAt', 'gte', '2025-01-01')
177
+ * .select('id', 'title', 'properties.*')
178
+ * .sortBy('createdAt', 'desc')
179
+ * .limit(100)
180
+ * .execute();
181
+ * ```
182
+ */
183
+ query() {
184
+ return (0, query_builder_1.createQueryBuilder)(this);
185
+ }
186
+ /** Access the underlying ApiProvider */
187
+ get provider() {
188
+ return this._provider;
189
+ }
190
+ }
191
+ exports.QaRubricItemAccessor = QaRubricItemAccessor;